PageSourceSearch

https://regione.puglia.it/combo?browserId=chrome&minifierType=js&l…nd-js-module-launcher/webpack_federation.js

js regione.puglia.it collected 2026-10-02 09:49:49 UTC 752,201 bytes, 20,585 lines download raw bytes

1/**
2The YUI module contains the components required for building the YUI seed file.
3This includes the script loading mechanism, a simple queue, and the core
4utilities for the library.
5
6@module yui
7@main yui
8@submodule yui-base
9**/
10
11/*jshint eqeqeq: false*/
12if (typeof YUI != 'undefined') {
13    YUI._YUI = YUI;
14}
15
16/**
17The YUI global namespace object. This is the constructor for all YUI instances.
18
19This is a self-instantiable factory function, meaning you don't need to precede
20it with the `new` operator. You can invoke it directly like this:
21
22    YUI().use('*', function (Y) {
23        // Y is a new YUI instance.
24    });
25
26But it also works like this:
27
28    var Y = YUI();
29
30The `YUI` constructor accepts an optional config object, like this:
31
32    YUI({
33        debug: true,
34        combine: false
35    }).use('node', function (Y) {
36        // Y.Node is ready to use.
37    });
38
39See the API docs for the <a href="config.html">Config</a> class for the complete
40list of supported configuration properties accepted by the YUI constuctor.
41
42If a global `YUI` object is already defined, the existing YUI object will not be
43overwritten, to ensure that defined namespaces are preserved.
44
45Each YUI instance has full custom event support, but only if the event system is
46available.
47
48@class YUI
49@uses EventTarget
50@constructor
51@global
52@param {Object} [config]* Zero or more optional configuration objects. Config
53    values are stored in the `Y.config` property. See the
54    <a href="config.html">Config</a> docs for the list of supported properties.
55**/
56
57    /*global YUI*/
58    /*global YUI_config*/
59    var YUI = function() {
60        var i = 0,
61            Y = this,
62            args = arguments,
63            l = args.length,
64            instanceOf = function(o, type) {
65                return (o && o.hasOwnProperty && (o instanceof type));
66            },
67            gconf = (typeof YUI_config !== 'undefined') && YUI_config;
68
69        if (!(instanceOf(Y, YUI))) {
70            Y = new YUI();
71        } else {
72            // set up the core environment
73            Y._init();
74
75            /**
76            Master configuration that might span multiple contexts in a non-
77            browser environment. It is applied first to all instances in all
78            contexts.
79
80            @example
81
82                YUI.GlobalConfig = {
83                    filter: 'debug'
84                };
85
86                YUI().use('node', function (Y) {
87                    // debug files used here
88                });
89
90                YUI({
91                    filter: 'min'
92                }).use('node', function (Y) {
93                    // min files used here
94                });
95
96            @property {Object} GlobalConfig
97            @global
98            @static
99            **/
100            if (YUI.GlobalConfig) {
101                Y.applyConfig(YUI.GlobalConfig);
102            }
103
104            /**
105            Page-level config applied to all YUI instances created on the
106            current page. This is applied after `YUI.GlobalConfig` and before
107            any instance-level configuration.
108
109            @example
110
111                // Single global var to include before YUI seed file
112                YUI_config = {
113                    filter: 'debug'
114                };
115
116                YUI().use('node', function (Y) {
117                    // debug files used here
118                });
119
120                YUI({
121                    filter: 'min'
122                }).use('node', function (Y) {
123                    // min files used here
124                });
125
126            @property {Object} YUI_config
127            @global
128            **/
129            if (gconf) {
130                Y.applyConfig(gconf);
131            }
132
133            // bind the specified additional modules for this instance
134            if (!l) {
135                Y._afterConfig();
136                Y._setup();
137            }
138        }
139
140        if (l) {
141            // Each instance can accept one or more configuration objects.
142            // These are applied after YUI.GlobalConfig and YUI_Config,
143            // overriding values set in those config files if there is a
144            // matching property.
145            for (; i < l; i++) {
146                Y.applyConfig(args[i]);
147            }
148
149            Y._afterConfig();
150            Y._setup();
151        }
152
153        Y.instanceOf = instanceOf;
154
155        return Y;
156    };
157
158(function() {
159
160    var proto, prop,
161        VERSION = 'patched-v3.18.3',
162        PERIOD = '.',
163        BASE = 'http://yui.yahooapis.com/',
164        /*
165            These CSS class names can't be generated by
166            getClassName since it is not available at the
167            time they are being used.
168        */
169        DOC_LABEL = 'yui3-js-enabled',
170        CSS_STAMP_EL = 'yui3-css-stamp',
171        NOOP = function() {},
172        SLICE = Array.prototype.slice,
173        APPLY_TO_AUTH = { 'io.xdrReady': 1,   // the functions applyTo
174                          'io.xdrResponse': 1,   // can call. this should
175                          'SWF.eventHandler': 1 }, // be done at build time
176        hasWin = (typeof window != 'undefined'),
177        win = (hasWin) ? window : null,
178        doc = (hasWin) ? win.document : null,
179        docEl = doc && doc.documentElement,
180        docClass = docEl && docEl.className,
181        instances = {},
182        time = new Date().getTime(),
183        add = function(el, type, fn, capture) {
184            if (el && el.addEventListener) {
185                el.addEventListener(type, fn, capture);
186            } else if (el && el.attachEvent) {
187                el.attachEvent('on' + type, fn);
188            }
189        },
190        remove = function(el, type, fn, capture) {
191            if (el && el.removeEventListener) {
192                // this can throw an uncaught exception in FF
193                try {
194                    el.removeEventListener(type, fn, capture);
195                } catch (ex) {}
196            } else if (el && el.detachEvent) {
197                el.detachEvent('on' + type, fn);
198            }
199        },
200        handleReady = function() {
201            YUI.Env.DOMReady = true;
202            if (hasWin) {
203                remove(doc, 'DOMContentLoaded', handleReady);
204            }
205            if (doc && doc.body && YUI.Env.cssStampEl && (!doc.body.contains(YUI.Env.cssStampEl))) {
206                doc.body.appendChild(YUI.Env.cssStampEl);
207            }
208        },
209        handleLoad = function() {
210            YUI.Env.windowLoaded = true;
211            YUI.Env.DOMReady = true;
212            if (hasWin) {
213                remove(window, 'load', handleLoad);
214            }
215        },
216        getLoader = function(Y, o) {
217            var loader = Y.Env._loader,
218                lCore = [ 'loader-base' ],
219                G_ENV = YUI.Env,
220                mods = G_ENV.mods;
221
222            if (loader) {
223                //loader._config(Y.config);
224                loader.ignoreRegistered = false;
225                loader.onEnd = null;
226                loader.data = null;
227                loader.required = [];
228                loader.loadType = null;
229            } else {
230                loader = new Y.Loader(Y.config);
231                Y.Env._loader = loader;
232            }
233            if (mods && mods.loader) {
234                lCore = [].concat(lCore, YUI.Env.loaderExtras);
235            }
236            YUI.Env.core = Y.Array.dedupe([].concat(YUI.Env.core, lCore));
237
238            return loader;
239        },
240
241        clobber = function(r, s) {
242            for (var i in s) {
243                if (s.hasOwnProperty(i)) {
244                    r[i] = s[i];
245                }
246            }
247        },
248
249        ALREADY_DONE = { success: true };
250
251//  Stamp the documentElement (HTML) with a class of "yui-loaded" to
252//  enable styles that need to key off of JS being enabled.
253if (docEl && docClass.indexOf(DOC_LABEL) == -1) {
254    if (docClass) {
255        docClass += ' ';
256    }
257    docClass += DOC_LABEL;
258    docEl.className = docClass;
259}
260
261if (VERSION.indexOf('@') > -1) {
262    VERSION = '3.5.0'; // dev time hack for cdn test
263}
264
265proto = {
266    /**
267    Applies a new configuration object to the config of this YUI instance. This
268    will merge new group/module definitions, and will also update the loader
269    cache if necessary. Updating `Y.config` directly will not update the cache.
270
271    @method applyConfig
272    @param {Object} o the configuration object.
273    @since 3.2.0
274    **/
275    applyConfig: function(o) {
276
277        o = o || NOOP;
278
279        var attr,
280            name,
281            // detail,
282            config = this.config,
283            mods = config.modules,
284            groups = config.groups,
285            aliases = config.aliases,
286            loader = this.Env._loader;
287
288        for (name in o) {
289            if (o.hasOwnProperty(name)) {
290                attr = o[name];
291                if (mods && name == 'modules') {
292                    clobber(mods, attr);
293                } else if (aliases && name == 'aliases') {
294                    clobber(aliases, attr);
295                } else if (groups && name == 'groups') {
296                    clobber(groups, attr);
297                } else if (name == 'win') {
298                    config[name] = (attr && attr.contentWindow) || attr;
299                    config.doc = config[name] ? config[name].document : null;
300                } else if (name == '_yuid') {
301                    // preserve the guid
302                } else {
303                    config[name] = attr;
304                }
305            }
306        }
307
308        if (loader) {
309            loader._config(o);
310        }
311
312    },
313
314    /**
315    Old way to apply a config to this instance (calls `applyConfig` under the
316    hood).
317
318    @private
319    @method _config
320    @param {Object} o The config to apply
321    **/
322    _config: function(o) {
323        this.applyConfig(o);
324    },
325
326    /**
327    Initializes this YUI instance.
328
329    @private
330    @method _init
331    **/
332    _init: function() {
333        var filter, el,
334            Y = this,
335            G_ENV = YUI.Env,
336            Env = Y.Env,
337            prop;
338
339        /**
340        The version number of this YUI instance.
341
342        This value is typically updated by a script when a YUI release is built,
343        so it may not reflect the correct version number when YUI is run from
344        the development source tree.
345
346        @property {String} version
347        **/
348        Y.version = VERSION;
349
350        if (!Env) {
351            Y.Env = {
352                core: ['get', 'features', 'intl-base', 'yui-log', 'yui-later', 'loader-base', 'loader-rollup', 'loader-yui3'],
353                loaderExtras: ['loader-rollup', 'loader-yui3'],
354                mods: {}, // flat module map
355                versions: {}, // version module map
356                base: BASE,
357                cdn: BASE + VERSION + '/',
358                // bootstrapped: false,
359                _idx: 0,
360                _used: {},
361                _attached: {},
362                _exported: {},
363                _missed: [],
364                _yidx: 0,
365                _uidx: 0,
366                _guidp: 'y',
367                _loaded: {},
368                // serviced: {},
369                // Regex in English:
370                // I'll start at the \b(yui).
371                // 1. Look in the test string for "yui" or
372                //    "yui-base" or "yui-davglass" or "yui-foobar" that comes after a word break.  That is, it
373                //    can't match "foyui" or "i_heart_yui". This can be anywhere in the string.
374                // 2. After #1 must come a forward slash followed by the string matched in #1, so
375                //    "yui-base/yui-base" or "yui-pants/yui-pants".
376                // 3. The second occurence of the #1 token can optionally be followed by "-debug" or "-min",
377                //    so "yui/yui-min", "yui/yui-debug", "yui-base/yui-base-debug". NOT "yui/yui-tshirt".
378                // 4. This is followed by ".js", so "yui/yui.js".
379                // 0. Going back to the beginning, now. If all that stuff in 1-4 comes after a "?" in the string,
380                //    then capture the junk between the LAST "&" and the string in 1-4.  So
381                //    "blah?foo/yui/yui.js" will capture "foo/" and "blah?some/thing.js&3.3.0/build/yui-davglass/yui-davglass.js"
382                //    will capture "3.3.0/build/"
383                //
384                // Regex Exploded:
385                // (?:\?             Find a ?
386                //   (?:[^&]*&)      followed by 0..n characters followed by an &
387                //   *               in fact, find as many sets of characters followed by a & as you can
388                //   ([^&]*)         capture the stuff after the last & in \1
389                // )?                but it's ok if all this ?junk&more_junk stuff isn't even there
390                // \b(               after a word break find either the string
391                //    yui(?:-\w+)?   "yui" optionally followed by a -, then more characters
392                // )                 and store the yui-* string in \2
393                // \/\2              then comes a / followed by the yui-* string in \2
394                // (?:-(min|debug))? optionally followed by "-min" or "-debug"
395                // .js               and ending in ".js"
396                _BASE_RE: /(?:\?(?:[^&]*&)*([^&]*))?\b(aui|yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,
397                parseBasePath: function(src, pattern) {
398                    var match = src.match(pattern),
399                        path, filter;
400
401                    if (match) {
402                        path = RegExp.leftContext || src.slice(0, src.indexOf(match[0]));
403
404                        // this is to set up the path to the loader.  The file
405                        // filter for loader should match the yui include.
406                        filter = match[3];
407
408                        // extract correct path for mixed combo urls
409                        // http://yuilibrary.com/projects/yui3/ticket/2528423
410                        if (match[1]) {
411                            path += '?' + match[1];
412                        }
413                        path = {
414                            filter: filter,
415                            path: path
416                        };
417                    }
418                    return path;
419                },
420                getBase: G_ENV && G_ENV.getBase ||
421                        function(pattern) {
422                            var nodes = (doc && doc.getElementsByTagName('script')) || [],
423                                path = Env.cdn, parsed,
424                                i, len, src;
425
426                            for (i = 0, len = nodes.length; i < len; ++i) {
427                                src = nodes[i].src;
428                                if (src) {
429                                    parsed = Y.Env.parseBasePath(src, pattern);
430                                    if (parsed) {
431                                        filter = parsed.filter;
432                                        path = parsed.path;
433                                        break;
434                                    }
435                                }
436                            }
437
438                            // use CDN default
439                            return path;
440                        }
441
442            };
443
444            Env = Y.Env;
445
446            Env._loaded[VERSION] = {};
447
448            if (G_ENV && Y !== YUI) {
449                Env._yidx = ++G_ENV._yidx;
450                Env._guidp = ('yui_' + VERSION + '_' +
451                             Env._yidx + '_' + time).replace(/[^a-z0-9_]+/g, '_');
452            } else if (YUI._YUI) {
453
454                G_ENV = YUI._YUI.Env;
455                Env._yidx += G_ENV._yidx;
456                Env._uidx += G_ENV._uidx;
457
458                for (prop in G_ENV) {
459                    if (!(prop in Env)) {
460                        Env[prop] = G_ENV[prop];
461                    }
462                }
463
464                delete YUI._YUI;
465            }
466
467            Y.id = Y.stamp(Y);
468            instances[Y.id] = Y;
469
470        }
471
472        Y.constructor = YUI;
473
474        // configuration defaults
475        Y.config = Y.config || {
476            bootstrap: true,
477            cacheUse: true,
478            debug: true,
479            doc: doc,
480            fetchCSS: true,
481            throwFail: true,
482            useBrowserConsole: true,
483            useNativeES5: true,
484            win: win
485        };
486
487        //Register the CSS stamp element
488        if (doc && !doc.getElementById(CSS_STAMP_EL)) {
489            el = doc.createElement('div');
490            el.innerHTML = '<div id="' + CSS_STAMP_EL + '" style="position: absolute !important; visibility: hidden !important"></div>';
491            YUI.Env.cssStampEl = el.firstChild;
492            if (doc.body) {
493                doc.body.appendChild(YUI.Env.cssStampEl);
494            } else {
495                docEl.insertBefore(YUI.Env.cssStampEl, docEl.firstChild);
496            }
497        } else if (doc && doc.getElementById(CSS_STAMP_EL) && !YUI.Env.cssStampEl) {
498            YUI.Env.cssStampEl = doc.getElementById(CSS_STAMP_EL);
499        }
500
501        Y.config.lang = Y.config.lang || 'en-US';
502
503        Y.config.base = YUI.config.base ||
504                (YUI.config.defaultBase && YUI.config.root && YUI.config.defaultBase + YUI.config.root) ||
505                Y.Env.getBase(Y.Env._BASE_RE);
506
507        if (!filter || (!('mindebug').indexOf(filter))) {
508            filter = 'min';
509        }
510        filter = (filter) ? '-' + filter : filter;
511        Y.config.loaderPath = YUI.config.loaderPath || 'loader/loader' + filter + '.js';
512
513    },
514
515    /**
516    This method is called after all other configuration has been applied to
517    the YUI instance.
518
519    @method _afterConfig
520    @private
521    **/
522    _afterConfig: function () {
523        var Y = this;
524
525        // We need to set up Y.config.global after the rest of the configuration
526        // so that setting it in user configuration prevents the library from
527        // using eval(). This is critical for Content Security Policy enabled
528        // sites and other environments like Chrome extensions
529        if (!Y.config.hasOwnProperty('global')) {
530            Y.config.global = Function('return this')();
531        }
532    },
533
534    /**
535    Finishes the instance setup. Attaches whatever YUI modules were defined
536    at the time that this instance was created.
537
538    @method _setup
539    @private
540    **/
541    _setup: function() {
542        var i, Y = this,
543            core = [],
544            mods = YUI.Env.mods,
545            extendedCore = Y.config.extendedCore || [],
546            extras = Y.config.core || [].concat(YUI.Env.core).concat(extendedCore); //Clone it..
547
548        for (i = 0; i < extras.length; i++) {
549            if (mods[extras[i]]) {
550                core.push(extras[i]);
551            }
552        }
553
554        Y._attach(['yui-base']);
555        Y._attach(core);
556
557        if (Y.Loader) {
558            getLoader(Y);
559        }
560
561    },
562
563    /**
564    Executes the named method on the specified YUI instance if that method is
565    whitelisted.
566
567    @method applyTo
568    @param {String} id YUI instance id.
569    @param {String} method Name of the method to execute. For example:
570        'Object.keys'.
571    @param {Array} args Arguments to apply to the method.
572    @return {Mixed} Return value from the applied method, or `null` if the
573        specified instance was not found or the method was not whitelisted.
574    **/
575    applyTo: function(id, method, args) {
576        if (!(method in APPLY_TO_AUTH)) {
577            this.log(method + ': applyTo not allowed', 'warn', 'yui');
578            return null;
579        }
580
581        var instance = instances[id], nest, m, i;
582        if (instance) {
583            nest = method.split('.');
584            m = instance;
585            for (i = 0; i < nest.length; i = i + 1) {
586                m = m[nest[i]];
587                if (!m) {
588                    this.log('applyTo not found: ' + method, 'warn', 'yui');
589                }
590            }
591            return m && m.apply(instance, args);
592        }
593
594        return null;
595    },
596
597/**
598Registers a YUI module and makes it available for use in a `YUI().use()` call or
599as a dependency for other modules.
600
601The easiest way to create a first-class YUI module is to use
602<a href="http://yui.github.com/shifter/">Shifter</a>, the YUI component build
603tool.
604
605Shifter will automatically wrap your module code in a `YUI.add()` call along
606with any configuration info required for the module.
607
608@example
609
610    YUI.add('davglass', function (Y) {
611        Y.davglass = function () {
612        };
613    }, '3.4.0', {
614        requires: ['harley-davidson', 'mt-dew']
615    });
616
617@method add
618@param {String} name Module name.
619@param {Function} fn Function containing module code. This function will be
620    executed whenever the module is attached to a specific YUI instance.
621
622    @param {YUI} fn.Y The YUI instance to which this module is attached.
623    @param {String} fn.name Name of the module
624
625@param {String} version Module version number. This is currently used only for
626    informational purposes, and is not used internally by YUI.
627
628@param {Object} [details] Module config.
629    @param {Array} [details.requires] Array of other module names that must be
630        attached before this module can be attached.
631    @param {Array} [details.optional] Array of optional module names that should
632        be attached before this module is attached if they've already been
633        loaded. If the `loadOptional` YUI option is `true`, optional modules
634        that have not yet been loaded will be loaded just as if they were hard
635        requirements.
636    @param {Array} [details.use] Array of module names that are included within
637        or otherwise provided by this module, and which should be attached
638        automatically when this module is attached. This makes it possible to
639        create "virtual rollup" modules that simply attach a collection of other
640        modules or submodules.
641
642@return {YUI} This YUI instance.
643**/
644    add: function(name, fn, version, details) {
645        details = details || {};
646        var env = YUI.Env,
647            mod = {
648                name: name,
649                fn: fn,
650                version: version,
651                details: details
652            },
653            //Instance hash so we don't apply it to the same instance twice
654            applied = {},
655            loader, inst, modInfo,
656            i, versions = env.versions;
657
658        env.mods[name] = mod;
659        versions[version] = versions[version] || {};
660        versions[version][name] = mod;
661
662        for (i in instances) {
663            if (instances.hasOwnProperty(i)) {
664                inst = instances[i];
665                if (!applied[inst.id]) {
666                    applied[inst.id] = true;
667                    loader = inst.Env._loader;
668                    if (loader) {
669                        modInfo = loader.getModuleInfo(name);
670                        if (!modInfo || modInfo.temp) {
671                            loader.addModule(details, name);
672                        }
673                    }
674                }
675            }
676        }
677
678        return this;
679    },
680
681    /**
682    Executes the callback function associated with each required module,
683    attaching the module to this YUI instance.
684
685    @method _attach
686    @param {Array} r The array of modules to attach
687    @param {Boolean} [moot=false] If `true`, don't throw a warning if the module
688        is not attached.
689    @private
690    **/
691    _attach: function(r, moot) {
692        var i, name, mod, details, req, use, after,
693            mods = YUI.Env.mods,
694            aliases = YUI.Env.aliases,
695            Y = this, j,
696            cache = YUI.Env._renderedMods,
697            loader = Y.Env._loader,
698            done = Y.Env._attached,
699            exported = Y.Env._exported,
700            len = r.length, loader, def, go,
701            c = [],
702            modArgs, esCompat, reqlen, modInfo,
703            condition,
704            __exports__, __imports__;
705
706        //Check for conditional modules (in a second+ instance) and add their requirements
707        //TODO I hate this entire method, it needs to be fixed ASAP (3.5.0) ^davglass
708        for (i = 0; i < len; i++) {
709            name = r[i];
710            mod = mods[name];
711            c.push(name);
712            if (loader && loader.conditions[name]) {
713                for (j in loader.conditions[name]) {
714                    if (loader.conditions[name].hasOwnProperty(j)) {
715                        def = loader.conditions[name][j];
716                        go = def && ((def.ua && Y.UA[def.ua]) || (def.test && def.test(Y)));
717                        if (go) {
718                            c.push(def.name);
719                        }
720                    }
721                }
722            }
723        }
724        r = c;
725        len = r.length;
726
727        for (i = 0; i < len; i++) {
728            if (!done[r[i]]) {
729                name = r[i];
730                mod = mods[name];
731
732                if (aliases && aliases[name] && !mod) {
733                    Y._attach(aliases[name]);
734                    continue;
735                }
736                if (!mod) {
737                    modInfo = loader && loader.getModuleInfo(name);
738                    if (modInfo) {
739                        mod = modInfo;
740                        moot = true;
741                    }
742
743
744                    //if (!loader || !loader.moduleInfo[name]) {
745                    //if ((!loader || !loader.moduleInfo[name]) && !moot) {
746                    if (!moot && name) {
747                        if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {
748                            Y.Env._missed.push(name);
749                            Y.Env._missed = Y.Array.dedupe(Y.Env._missed);
750                            Y.message('NOT loaded: ' + name, 'warn', 'yui');
751                        }
752                    }
753                } else {
754                    done[name] = true;
755                    //Don't like this, but in case a mod was asked for once, then we fetch it
756                    //We need to remove it from the missed list ^davglass
757                    for (j = 0; j < Y.Env._missed.length; j++) {
758                        if (Y.Env._missed[j] === name) {
759                            Y.message('Found: ' + name + ' (was reported as missing earlier)', 'warn', 'yui');
760                            Y.Env._missed.splice(j, 1);
761                        }
762                    }
763
764                    // Optional dependencies normally work by modifying the
765                    // dependency list of a module. If the dependency's test
766                    // passes it is added to the list. If not, it's not loaded.
767                    // This following check ensures that optional dependencies
768                    // are not attached when they were already loaded into the
769                    // page (when bundling for example)
770                    if (loader && !loader._canBeAttached(name)) {
771                        return true;
772                    }
773
774                    /*
775                        If it's a temp module, we need to redo it's requirements if it's already loaded
776                        since it may have been loaded by another instance and it's dependencies might
777                        have been redefined inside the fetched file.
778                    */
779                    if (loader && cache && cache[name] && cache[name].temp) {
780                        loader.getRequires(cache[name]);
781                        req = [];
782                        modInfo = loader.getModuleInfo(name);
783                        for (j in modInfo.expanded_map) {
784                            if (modInfo.expanded_map.hasOwnProperty(j)) {
785                                req.push(j);
786                            }
787                        }
788                        Y._attach(req);
789                    }
790
791                    details = mod.details;
792                    req = details.requires;
793                    esCompat = details.es;
794                    use = details.use;
795                    after = details.after;
796                    //Force Intl load if there is a language (Loader logic) @todo fix this shit
797                    if (details.lang) {
798                        req = req || [];
799                        req.unshift('intl');
800                    }
801
802                    if (req) {
803                        reqlen = req.length;
804                        for (j = 0; j < reqlen; j++) {
805                            if (!done[req[j]]) {
806                                if (!Y._attach(req)) {
807                                    return false;
808                                }
809                                break;
810                            }
811                        }
812                    }
813
814                    if (after) {
815                        for (j = 0; j < after.length; j++) {
816                            if (!done[after[j]]) {
817                                if (!Y._attach(after, true)) {
818                                    return false;
819                                }
820                                break;
821                            }
822                        }
823                    }
824
825                    if (mod.fn) {
826                        modArgs = [Y, name];
827                        if (esCompat) {
828                            __imports__ = {};
829                            __exports__ = {};
830                            // passing `exports` and `imports` onto the module function
831                            modArgs.push(__imports__, __exports__);
832                            if (req) {
833                                reqlen = req.length;
834                                for (j = 0; j < reqlen; j++) {
835                                    __imports__[req[j]] = exported.hasOwnProperty(req[j]) ? exported[req[j]] : Y;
836                                }
837                            }
838                        }
839                        if (Y.config.throwFail) {
840                            __exports__ = mod.fn.apply(esCompat ? undefined : mod, modArgs);
841                        } else {
842                            try {
843                                __exports__ = mod.fn.apply(esCompat ? undefined : mod, modArgs);
844                            } catch (e) {
845                                Y.error('Attach error: ' + name, e, name);
846                                return false;
847                            }
848                        }
849                        if (esCompat) {
850                            // store the `exports` in case others `es` modules requires it
851                            exported[name] = __exports__;
852
853                            // If an ES module is conditionally loaded and set
854                            // to be used "instead" another module, replace the
855                            // trigger module's content with the conditionally
856                            // loaded one so the values returned by require()
857                            // still makes sense
858                            condition = mod.details.condition;
859                            if (condition && condition.when === 'instead') {
860                                exported[condition.trigger] = __exports__;
861                            }
862                        }
863                    }
864
865                    if (use) {
866                        for (j = 0; j < use.length; j++) {
867                            if (!done[use[j]]) {
868                                if (!Y._attach(use)) {
869                                    return false;
870                                }
871                                break;
872                            }
873                        }
874                    }
875
876
877
878                }
879            }
880        }
881
882        return true;
883    },
884
885    /**
886    Delays the `use` callback until another event has taken place such as
887    `window.onload`, `domready`, `contentready`, or `available`.
888
889    @private
890    @method _delayCallback
891    @param {Function} cb The original `use` callback.
892    @param {String|Object} until Either an event name ('load', 'domready', etc.)
893        or an object containing event/args keys for contentready/available.
894    @return {Function}
895    **/
896    _delayCallback: function(cb, until) {
897
898        var Y = this,
899            mod = ['event-base'];
900
901        until = (Y.Lang.isObject(until) ? until : { event: until });
902
903        if (until.event === 'load') {
904            mod.push('event-synthetic');
905        }
906
907        return function() {
908            var args = arguments;
909            Y._use(mod, function() {
910                Y.on(until.event, function() {
911                    args[1].delayUntil = until.event;
912                    cb.apply(Y, args);
913                }, until.args);
914            });
915        };
916    },
917
918    /**
919    Attaches one or more modules to this YUI instance. When this is executed,
920    the requirements of the desired modules are analyzed, and one of several
921    things can happen:
922
923
924      * All required modules have already been loaded, and just need to be
925        attached to this YUI instance. In this case, the `use()` callback will
926        be executed synchronously after the modules are attached.
927
928      * One or more modules have not yet been loaded, or the Get utility is not
929        available, or the `bootstrap` config option is `false`. In this case,
930        a warning is issued indicating that modules are missing, but all
931        available modules will still be attached and the `use()` callback will
932        be executed synchronously.
933
934      * One or more modules are missing and the Loader is not available but the
935        Get utility is, and `bootstrap` is not `false`. In this case, the Get
936        utility will be used to load the Loader, and we will then proceed to
937        the following state:
938
939      * One or more modules are missing and the Loader is available. In this
940        case, the Loader will be used to resolve the dependency tree for the
941        missing modules and load them and their dependencies. When the Loader is
942        finished loading modules, the `use()` callback will be executed
943        asynchronously.
944
945    @example
946
947        // Loads and attaches dd and its dependencies.
948        YUI().use('dd', function (Y) {
949            // ...
950        });
951
952        // Loads and attaches dd and node as well as all of their dependencies.
953        YUI().use(['dd', 'node'], function (Y) {
954            // ...
955        });
956
957        // Attaches all modules that have already been loaded.
958        YUI().use('*', function (Y) {
959            // ...
960        });
961
962        // Attaches a gallery module.
963        YUI().use('gallery-yql', function (Y) {
964            // ...
965        });
966
967        // Attaches a YUI 2in3 module.
968        YUI().use('yui2-datatable', function (Y) {
969            // ...
970        });
971
972    @method use
973    @param {String|Array} modules* One or more module names to attach.
974    @param {Function} [callback] Callback function to be executed once all
975        specified modules and their dependencies have been attached.
976    @param {YUI} callback.Y The YUI instance created for this sandbox.
977    @param {Object} callback.status Object containing `success`, `msg` and
978        `data` properties.
979    @chainable
980    **/
981    use: function() {
982        var args = SLICE.call(arguments, 0),
983            callback = args[args.length - 1],
984            Y = this,
985            i = 0,
986            name,
987            Env = Y.Env,
988            provisioned = true;
989
990        // The last argument supplied to use can be a load complete callback
991        if (Y.Lang.isFunction(callback)) {
992            args.pop();
993            if (Y.config.delayUntil) {
994                callback = Y._delayCallback(callback, Y.config.delayUntil);
995            }
996        } else {
997            callback = null;
998        }
999        if (Y.Lang.isArray(args[0])) {
1000            args = args[0];
1001        }
1002
1003        if (Y.config.cacheUse) {
1004            while ((name = args[i++])) {
1005                if (!Env._attached[name]) {
1006                    provisioned = false;
1007                    break;
1008                }
1009            }
1010
1011            if (provisioned) {
1012                if (args.length) {
1013                }
1014                Y._notify(callback, ALREADY_DONE, args);
1015                return Y;
1016            }
1017        }
1018
1019        if (Y._loading) {
1020            Y._useQueue = Y._useQueue || new Y.Queue();
1021            Y._useQueue.add([args, callback]);
1022        } else {
1023            Y._use(args, function(Y, response) {
1024                Y._notify(callback, response, args);
1025            });
1026        }
1027
1028        return Y;
1029    },
1030
1031    /**
1032    Sugar for loading both legacy and ES6-based YUI modules.
1033
1034    @method require
1035    @param {String} [modules*] List of module names to import or a single
1036        module name.
1037    @param {Function} callback Callback that gets called once all the modules
1038        were loaded. Each parameter of the callback is the export value of the
1039        corresponding module in the list. If the module is a legacy YUI module,
1040        the YUI instance is used instead of the module exports.
1041    @example
1042    ```
1043    YUI().require(['es6-set'], function (Y, imports) {
1044        var Set = imports.Set,
1045            set = new Set();
1046    });
1047    ```
1048    **/
1049    require: function () {
1050        var args = SLICE.call(arguments),
1051            callback;
1052
1053        if (typeof args[args.length - 1] === 'function') {
1054            callback = args.pop();
1055
1056            // only add the callback if one was provided
1057            // YUI().require('foo'); is valid
1058            args.push(function (Y) {
1059                var i, length = args.length,
1060                    exported = Y.Env._exported,
1061                    __imports__ = {};
1062
1063                // Get only the imports requested as arguments
1064                for (i = 0; i < length; i++) {
1065                    if (exported.hasOwnProperty(args[i])) {
1066                        __imports__[args[i]] = exported[args[i]];
1067                    }
1068                }
1069
1070                // Using `undefined` because:
1071                // - Using `Y.config.global` would force the value of `this` to be
1072                //   the global object even in strict mode
1073                // - Using `Y` goes against the goal of moving away from a shared
1074                //   object and start thinking in terms of imported and exported
1075                //   objects
1076                callback.call(undefined, Y, __imports__);
1077            });
1078        }
1079        // Do not return the Y object. This makes it hard to follow this
1080        // traditional pattern:
1081        //   var Y = YUI().use(...);
1082        // This is a good idea in the light of ES6 modules, to avoid working
1083        // in the global scope.
1084        // This also leaves the door open for returning a promise, once the
1085        // YUI loader is based on the ES6 loader which uses
1086        // loader.import(...).then(...)
1087        this.use.apply(this, args);
1088    },
1089
1090    /**
1091    Handles Loader notifications about attachment/load errors.
1092
1093    @method _notify
1094    @param {Function} callback Callback to pass to `Y.config.loadErrorFn`.
1095    @param {Object} response Response returned from Loader.
1096    @param {Array} args Arguments passed from Loader.
1097    @private
1098    **/
1099    _notify: function(callback, response, args) {
1100        if (!response.success && this.config.loadErrorFn) {
1101            this.config.loadErrorFn.call(this, this, callback, response, args);
1102        } else if (callback) {
1103            if (this.Env._missed && this.Env._missed.length) {
1104                response.msg = 'Missing modules: ' + this.Env._missed.join();
1105                response.success = false;
1106            }
1107            if (this.config.throwFail) {
1108                callback(this, response);
1109            } else {
1110                try {
1111                    callback(this, response);
1112                } catch (e) {
1113                    this.error('use callback error', e, args);
1114                }
1115            }
1116        }
1117    },
1118
1119    /**
1120    Called from the `use` method queue to ensure that only one set of loading
1121    logic is performed at a time.
1122
1123    @method _use
1124    @param {String} args* One or more modules to attach.
1125    @param {Function} [callback] Function to call once all required modules have
1126        been attached.
1127    @private
1128    **/
1129    _use: function(args, callback) {
1130
1131        if (!this.Array) {
1132            this._attach(['yui-base']);
1133        }
1134
1135        var len, loader, handleBoot,
1136            Y = this,
1137            G_ENV = YUI.Env,
1138            mods = G_ENV.mods,
1139            Env = Y.Env,
1140            used = Env._used,
1141            aliases = G_ENV.aliases,
1142            queue = G_ENV._loaderQueue,
1143            firstArg = args[0],
1144            YArray = Y.Array,
1145            config = Y.config,
1146            boot = config.bootstrap,
1147            missing = [],
1148            i,
1149            r = [],
1150            ret = true,
1151            fetchCSS = config.fetchCSS,
1152            process = function(names, skip) {
1153
1154                var i = 0, a = [], name, len, m, req, use;
1155
1156                if (!names.length) {
1157                    return;
1158                }
1159
1160                if (aliases) {
1161                    len = names.length;
1162                    for (i = 0; i < len; i++) {
1163                        if (aliases[names[i]] && !mods[names[i]]) {
1164                            a = [].concat(a, aliases[names[i]]);
1165                        } else {
1166                            a.push(names[i]);
1167                        }
1168                    }
1169                    names = a;
1170                }
1171
1172                len = names.length;
1173
1174                for (i = 0; i < len; i++) {
1175                    name = names[i];
1176                    if (!skip) {
1177                        r.push(name);
1178                    }
1179
1180                    // only attach a module once
1181                    if (used[name]) {
1182                        continue;
1183                    }
1184
1185                    m = mods[name];
1186                    req = null;
1187                    use = null;
1188
1189                    if (m) {
1190                        used[name] = true;
1191                        req = m.details.requires;
1192                        use = m.details.use;
1193                    } else {
1194                        // CSS files don't register themselves, see if it has
1195                        // been loaded
1196                        if (!G_ENV._loaded[VERSION][name]) {
1197                            missing.push(name);
1198                        } else {
1199                            used[name] = true; // probably css
1200                        }
1201                    }
1202
1203                    // make sure requirements are attached
1204                    if (req && req.length) {
1205                        process(req);
1206                    }
1207
1208                    // make sure we grab the submodule dependencies too
1209                    if (use && use.length) {
1210                        process(use, 1);
1211                    }
1212                }
1213
1214            },
1215
1216            handleLoader = function(fromLoader) {
1217                var response = fromLoader || {
1218                        success: true,
1219                        msg: 'not dynamic'
1220                    },
1221                    redo, origMissing,
1222                    ret = true,
1223                    data = response.data;
1224
1225                Y._loading = false;
1226
1227                if (data) {
1228                    origMissing = missing;
1229                    missing = [];
1230                    r = [];
1231                    process(data);
1232                    redo = missing.length;
1233                    if (redo) {
1234                        if ([].concat(missing).sort().join() ==
1235                                origMissing.sort().join()) {
1236                            redo = false;
1237                        }
1238                    }
1239                }
1240
1241                if (redo && data) {
1242                    Y._loading = true;
1243                    Y._use(missing, function() {
1244                        if (Y._attach(data)) {
1245                            Y._notify(callback, response, data);
1246                        }
1247                    });
1248                } else {
1249                    if (data) {
1250                        ret = Y._attach(data);
1251                    }
1252                    if (ret) {
1253                        Y._notify(callback, response, args);
1254                    }
1255                }
1256
1257                if (Y._useQueue && Y._useQueue.size() && !Y._loading) {
1258                    Y._use.apply(Y, Y._useQueue.next());
1259                }
1260
1261            };
1262
1263
1264        // YUI().use('*'); // bind everything available
1265        if (firstArg === '*') {
1266            args = [];
1267            for (i in mods) {
1268                if (mods.hasOwnProperty(i)) {
1269                    args.push(i);
1270                }
1271            }
1272            ret = Y._attach(args);
1273            if (ret) {
1274                handleLoader();
1275            }
1276            return Y;
1277        }
1278
1279        if ((mods.loader || mods['loader-base']) && !Y.Loader) {
1280            Y._attach(['loader' + ((!mods.loader) ? '-base' : '')]);
1281        }
1282
1283
1284        // use loader to expand dependencies and sort the
1285        // requirements if it is available.
1286        if (boot && Y.Loader && args.length) {
1287            loader = getLoader(Y);
1288            loader.require(args);
1289            loader.ignoreRegistered = true;
1290            loader._boot = true;
1291            loader.calculate(null, (fetchCSS) ? null : 'js');
1292            args = loader.sorted;
1293            loader._boot = false;
1294        }
1295
1296        process(args);
1297
1298        len = missing.length;
1299
1300
1301        if (len) {
1302            missing = YArray.dedupe(missing);
1303            len = missing.length;
1304        }
1305
1306
1307        // dynamic load
1308        if (boot && len && Y.Loader) {
1309            Y._loading = true;
1310            loader = getLoader(Y);
1311            loader.onEnd = handleLoader;
1312            loader.context = Y;
1313            loader.data = args;
1314            loader.ignoreRegistered = false;
1315            loader.require(missing);
1316            loader.insert(null, (fetchCSS) ? null : 'js');
1317
1318        } else if (boot && len && Y.Get && !Env.bootstrapped) {
1319
1320            Y._loading = true;
1321
1322            handleBoot = function() {
1323                Y._loading = false;
1324                queue.running = false;
1325                Env.bootstrapped = true;
1326                G_ENV._bootstrapping = false;
1327                if (Y._attach(['loader'])) {
1328                    Y._use(args, callback);
1329                }
1330            };
1331
1332            if (G_ENV._bootstrapping) {
1333                queue.add(handleBoot);
1334            } else {
1335                G_ENV._bootstrapping = true;
1336                Y.Get.script(config.base + config.loaderPath, {
1337                    onEnd: handleBoot
1338                });
1339            }
1340
1341        } else {
1342            ret = Y._attach(args);
1343            if (ret) {
1344                handleLoader();
1345            }
1346        }
1347
1348        return Y;
1349    },
1350
1351
1352    /**
1353    Utility method for safely creating namespaces if they don't already exist.
1354    May be called statically on the YUI global object or as a method on a YUI
1355    instance.
1356
1357    When called statically, a namespace will be created on the YUI global
1358    object:
1359
1360        // Create `YUI.your.namespace.here` as nested objects, preserving any
1361        // objects that already exist instead of overwriting them.
1362        YUI.namespace('your.namespace.here');
1363
1364    When called as a method on a YUI instance, a namespace will be created on
1365    that instance:
1366
1367        // Creates `Y.property.package`.
1368        Y.namespace('property.package');
1369
1370    Dots in the input string cause `namespace` to create nested objects for each
1371    token. If any part of the requested namespace already exists, the current
1372    object will be left in place and will not be overwritten. This allows
1373    multiple calls to `namespace` to preserve existing namespaced properties.
1374
1375    If the first token in the namespace string is "YAHOO", that token is
1376    discarded. This is legacy behavior for backwards compatibility with YUI 2.
1377
1378    Be careful with namespace tokens. Reserved words may work in some browsers
1379    and not others. For instance, the following will fail in some browsers
1380    because the supported version of JavaScript reserves the word "long":
1381
1382        Y.namespace('really.long.nested.namespace');
1383
1384    Note: If you pass multiple arguments to create multiple namespaces, only the
1385    last one created is returned from this function.
1386
1387    @method namespace
1388    @param {String} namespace* One or more namespaces to create.
1389    @return {Object} Reference to the last namespace object created.
1390    **/
1391    namespace: function() {
1392        var a = arguments, o, i = 0, j, d, arg;
1393
1394        for (; i < a.length; i++) {
1395            o = this; //Reset base object per argument or it will get reused from the last
1396            arg = a[i];
1397            if (arg.indexOf(PERIOD) > -1) { //Skip this if no "." is present
1398                d = arg.split(PERIOD);
1399                for (j = (d[0] == 'YAHOO') ? 1 : 0; j < d.length; j++) {
1400                    o[d[j]] = o[d[j]] || {};
1401                    o = o[d[j]];
1402                }
1403            } else {
1404                o[arg] = o[arg] || {};
1405                o = o[arg]; //Reset base object to the new object so it's returned
1406            }
1407        }
1408        return o;
1409    },
1410
1411    // this is replaced if the log module is included
1412    log: NOOP,
1413    message: NOOP,
1414    // this is replaced if the dump module is included
1415    dump: function (o) { return ''+o; },
1416
1417    /**
1418    Reports an error.
1419
1420    The reporting mechanism is controlled by the `throwFail` configuration
1421    attribute. If `throwFail` is falsy, the message is logged. If `throwFail` is
1422    truthy, a JS exception is thrown.
1423
1424    If an `errorFn` is specified in the config it must return `true` to indicate
1425    that the exception was handled and keep it from being thrown.
1426
1427    @method error
1428    @param {String} msg Error message.
1429    @param {Error|String} [e] JavaScript error object or an error string.
1430    @param {String} [src] Source of the error (such as the name of the module in
1431        which the error occurred).
1432    @chainable
1433    **/
1434    error: function(msg, e, src) {
1435        //TODO Add check for window.onerror here
1436
1437        var Y = this, ret;
1438
1439        if (Y.config.errorFn) {
1440            ret = Y.config.errorFn.apply(Y, arguments);
1441        }
1442
1443        if (!ret) {
1444            throw (e || new Error(msg));
1445        } else {
1446            Y.message(msg, 'error', ''+src); // don't scrub this one
1447        }
1448
1449        return Y;
1450    },
1451
1452    /**
1453    Generates an id string that is unique among all YUI instances in this
1454    execution context.
1455
1456    @method guid
1457    @param {String} [pre] Prefix.
1458    @return {String} Unique id.
1459    **/
1460    guid: function(pre) {
1461        var id = this.Env._guidp + '_' + (++this.Env._uidx);
1462        return (pre) ? (pre + id) : id;
1463    },
1464
1465    /**
1466    Returns a unique id associated with the given object and (if *readOnly* is
1467    falsy) stamps the object with that id so it can be identified in the future.
1468
1469    Stamping an object involves adding a `_yuid` property to it that contains
1470    the object's id. One exception to this is that in Internet Explorer, DOM
1471    nodes have a `uniqueID` property that contains a browser-generated unique
1472    id, which will be used instead of a YUI-generated id when available.
1473
1474    @method stamp
1475    @param {Object} o Object to stamp.
1476    @param {Boolean} readOnly If truthy and the given object has not already
1477        been stamped, the object will not be modified and `null` will be
1478        returned.
1479    @return {String} Object's unique id, or `null` if *readOnly* was truthy and
1480        the given object was not already stamped.
1481    **/
1482    stamp: function(o, readOnly) {
1483        var uid;
1484        if (!o) {
1485            return o;
1486        }
1487
1488        // IE generates its own unique ID for dom nodes
1489        // The uniqueID property of a document node returns a new ID
1490        if (o.uniqueID && o.nodeType && o.nodeType !== 9) {
1491            uid = o.uniqueID;
1492        } else {
1493            uid = (typeof o === 'string') ? o : o._yuid;
1494        }
1495
1496        if (!uid) {
1497            uid = this.guid();
1498            if (!readOnly) {
1499                try {
1500                    o._yuid = uid;
1501                } catch (e) {
1502                    uid = null;
1503                }
1504            }
1505        }
1506        return uid;
1507    },
1508
1509    /**
1510    Destroys this YUI instance.
1511
1512    @method destroy
1513    @since 3.3.0
1514    **/
1515    destroy: function() {
1516        var Y = this;
1517        if (Y.Event) {
1518            Y.Event._unload();
1519        }
1520        delete instances[Y.id];
1521        delete Y.Env;
1522        delete Y.config;
1523    }
1524
1525    /**
1526    Safe `instanceof` wrapper that works around a memory leak in IE when the
1527    object being tested is `window` or `document`.
1528
1529    Unless you are testing objects that may be `window` or `document`, you
1530    should use the native `instanceof` operator instead of this method.
1531
1532    @method instanceOf
1533    @param {Object} o Object to check.
1534    @param {Object} type Class to check against.
1535    @since 3.3.0
1536    **/
1537};
1538
1539    YUI.prototype = proto;
1540
1541    // inheritance utilities are not available yet
1542    for (prop in proto) {
1543        if (proto.hasOwnProperty(prop)) {
1544            YUI[prop] = proto[prop];
1545        }
1546    }
1547
1548    /**
1549    Applies a configuration to all YUI instances in this execution context.
1550
1551    The main use case for this method is in "mashups" where several third-party
1552    scripts need to write to a global YUI config, but cannot share a single
1553    centrally-managed config object. This way they can all call
1554    `YUI.applyConfig({})` instead of overwriting the single global config.
1555
1556    @example
1557
1558        YUI.applyConfig({
1559            modules: {
1560                davglass: {
1561                    fullpath: './davglass.js'
1562                }
1563            }
1564        });
1565
1566        YUI.applyConfig({
1567            modules: {
1568                foo: {
1569                    fullpath: './foo.js'
1570                }
1571            }
1572        });
1573
1574        YUI().use('davglass', function (Y) {
1575            // Module davglass will be available here.
1576        });
1577
1578    @method applyConfig
1579    @param {Object} o Configuration object to apply.
1580    @static
1581    @since 3.5.0
1582    **/
1583    YUI.applyConfig = function(o) {
1584        if (!o) {
1585            return;
1586        }
1587        //If there is a GlobalConfig, apply it first to set the defaults
1588        if (YUI.GlobalConfig) {
1589            this.prototype.applyConfig.call(this, YUI.GlobalConfig);
1590        }
1591        //Apply this config to it
1592        this.prototype.applyConfig.call(this, o);
1593        //Reset GlobalConfig to the combined config
1594        YUI.GlobalConfig = this.config;
1595    };
1596
1597    // set up the environment
1598    YUI._init();
1599
1600    if (hasWin) {
1601        add(doc, 'DOMContentLoaded', handleReady);
1602
1603        // add a window load event at load time so we can capture
1604        // the case where it fires before dynamic loading is
1605        // complete.
1606        add(window, 'load', handleLoad);
1607    } else {
1608        handleReady();
1609        handleLoad();
1610    }
1611
1612    YUI.Env.add = add;
1613    YUI.Env.remove = remove;
1614
1615    /*global exports*/
1616    // Support the CommonJS method for exporting our single global
1617    if (typeof exports == 'object') {
1618        exports.YUI = YUI;
1619        /**
1620        * Set a method to be called when `Get.script` is called in Node.js
1621        * `Get` will open the file, then pass it's content and it's path
1622        * to this method before attaching it. Commonly used for code coverage
1623        * instrumentation. <strong>Calling this multiple times will only
1624        * attach the last hook method</strong>. This method is only
1625        * available in Node.js.
1626        * @method setLoadHook
1627        * @static
1628        * @param {Function} fn The function to set
1629        * @param {String} fn.data The content of the file
1630        * @param {String} fn.path The file path of the file
1631        */
1632        YUI.setLoadHook = function(fn) {
1633            YUI._getLoadHook = fn;
1634        };
1635        /**
1636        * Load hook for `Y.Get.script` in Node.js, see `YUI.setLoadHook`
1637        * @method _getLoadHook
1638        * @private
1639        * @param {String} data The content of the file
1640        * @param {String} path The file path of the file
1641        */
1642        YUI._getLoadHook = null;
1643    }
1644
1645    YUI.Env[VERSION] = {};
1646}());
1647
1648
1649/**
1650Config object that contains all of the configuration options for
1651this `YUI` instance.
1652
1653This object is supplied by the implementer when instantiating YUI. Some
1654properties have default values if they are not supplied by the implementer.
1655
1656This object should not be updated directly because some values are cached. Use
1657`applyConfig()` to update the config object on a YUI instance that has already
1658been configured.
1659
1660@class config
1661@static
1662**/
1663
1664/**
1665If `true` (the default), YUI will "bootstrap" the YUI Loader and module metadata
1666if they're needed to load additional dependencies and aren't already available.
1667
1668Setting this to `false` will prevent YUI from automatically loading the Loader
1669and module metadata, so you will need to manually ensure that they're available
1670or handle dependency resolution yourself.
1671
1672@property {Boolean} bootstrap
1673@default true
1674**/
1675
1676/**
1677
1678@property {Object} filters
1679**/
1680
1681/**
1682If `true`, YUI will use a combo handler to load multiple modules in as few
1683requests as possible.
1684
1685The YUI CDN (which YUI uses by default) supports combo handling, but other
1686servers may not. If the server from which you're loading YUI does not support
1687combo handling, set this to `false`.
1688
1689Providing a value for the `base` config property will cause `combine` to default
1690to `false` instead of `true`.
1691
1692@property {Boolean} combine
1693@default true
1694*/
1695
1696/**
1697Array of module names that should never be dynamically loaded.
1698
1699@property {String[]} ignore
1700**/
1701
1702/**
1703Array of module names that should always be loaded when required, even if
1704already present on the page.
1705
1706@property {String[]} force
1707**/
1708
1709/**
1710DOM element or id that should be used as the insertion point for dynamically
1711added `<script>` and `<link>` nodes.
1712
1713@property {HTMLElement|String} insertBefore
1714**/
1715
1716/**
1717Object hash containing attributes to add to dynamically added `<script>` nodes.
1718
1719@property {Object} jsAttributes
1720**/
1721
1722/**
1723Object hash containing attributes to add to dynamically added `<link>` nodes.
1724
1725@property {Object} cssAttributes
1726**/
1727
1728/**
1729Timeout in milliseconds before a dynamic JS or CSS request will be considered a
1730failure. If not set, no timeout will be enforced.
1731
1732@property {Number} timeout
1733**/
1734
1735/**
1736A hash of module definitions to add to the list of available YUI modules. These
1737modules can then be dynamically loaded via the `use()` method.
1738
1739This is a hash in which keys are module names and values are objects containing
1740module metadata.
1741
1742See `Loader.addModule()` for the supported module metadata fields. Also see
1743`groups`, which provides a way to configure the base and combo spec for a set of
1744modules.
1745
1746@example
1747
1748    modules: {
1749        mymod1: {
1750            requires: ['node'],
1751            fullpath: '/mymod1/mymod1.js'
1752        },
1753
1754        mymod2: {
1755            requires: ['mymod1'],
1756            fullpath: '/mymod2/mymod2.js'
1757        },
1758
1759        mymod3: '/js/mymod3.js',
1760        mycssmod: '/css/mycssmod.css'
1761    }
1762
1763@property {Object} modules
1764**/
1765
1766/**
1767Aliases are dynamic groups of modules that can be used as shortcuts.
1768
1769@example
1770
1771    YUI({
1772        aliases: {
1773            davglass: [ 'node', 'yql', 'dd' ],
1774            mine: [ 'davglass', 'autocomplete']
1775        }
1776    }).use('mine', function (Y) {
1777        // Node, YQL, DD & AutoComplete available here.
1778    });
1779
1780@property {Object} aliases
1781**/
1782
1783/**
1784A hash of module group definitions.
1785
1786For each group you can specify a list of modules and the base path and
1787combo spec to use when dynamically loading the modules.
1788
1789@example
1790
1791    groups: {
1792        yui2: {
1793            // specify whether or not this group has a combo service
1794            combine: true,
1795
1796            // The comboSeperator to use with this group's combo handler
1797            comboSep: ';',
1798
1799            // The maxURLLength for this server
1800            maxURLLength: 500,
1801
1802            // the base path for non-combo paths
1803            base: 'http://yui.yahooapis.com/2.8.0r4/build/',
1804
1805            // the path to the combo service
1806            comboBase: 'http://yui.yahooapis.com/combo?',
1807
1808            // a fragment to prepend to the path attribute when
1809            // when building combo urls
1810            root: '2.8.0r4/build/',
1811
1812            // the module definitions
1813            modules:  {
1814                yui2_yde: {
1815                    path: "yahoo-dom-event/yahoo-dom-event.js"
1816                },
1817                yui2_anim: {
1818                    path: "animation/animation.js",
1819                    requires: ['yui2_yde']
1820                }
1821            }
1822        }
1823    }
1824
1825@property {Object} groups
1826**/
1827
1828/**
1829Path to the Loader JS file, relative to the `base` path.
1830
1831This is used to dynamically bootstrap the Loader when it's needed and isn't yet
1832available.
1833
1834@property {String} loaderPath
1835@default "loader/loader-min.js"
1836**/
1837
1838/**
1839If `true`, YUI will attempt to load CSS dependencies and skins. Set this to
1840`false` to prevent YUI from loading any CSS, or set it to the string `"force"`
1841to force CSS dependencies to be loaded even if their associated JS modules are
1842already loaded.
1843
1844@property {Boolean|String} fetchCSS
1845@default true
1846**/
1847
1848/**
1849Default gallery version used to build gallery module urls.
1850
1851@property {String} gallery
1852@since 3.1.0
1853**/
1854
1855/**
1856Default YUI 2 version used to build YUI 2 module urls.
1857
1858This is used for intrinsic YUI 2 support via the 2in3 project. Also see the
1859`2in3` config for pulling different revisions of the wrapped YUI 2 modules.
1860
1861@property {String} yui2
1862@default "2.9.0"
1863@since 3.1.0
1864**/
1865
1866/**
1867Revision number of YUI 2in3 modules that should be used when loading YUI 2in3.
1868
1869@property {String} 2in3
1870@default "4"
1871@since 3.1.0
1872**/
1873
1874/**
1875Alternate console log function that should be used in environments without a
1876supported native console. This function is executed with the YUI instance as its
1877`this` object.
1878
1879@property {Function} logFn
1880@since 3.1.0
1881**/
1882
1883/**
1884The minimum log level to log messages for. Log levels are defined
1885incrementally. Messages greater than or equal to the level specified will
1886be shown. All others will be discarded. The order of log levels in
1887increasing priority is:
1888
1889    debug
1890    info
1891    warn
1892    error
1893
1894@property {String} logLevel
1895@default 'debug'
1896@since 3.10.0
1897**/
1898
1899/**
1900Callback to execute when `Y.error()` is called. It receives the error message
1901and a JavaScript error object if one was provided.
1902
1903This function is executed with the YUI instance as its `this` object.
1904
1905Returning `true` from this function will prevent an exception from being thrown.
1906
1907@property {Function} errorFn
1908@param {String} errorFn.msg Error message
1909@param {Object} [errorFn.err] Error object (if one was provided).
1910@since 3.2.0
1911**/
1912
1913/**
1914A callback to execute when Loader fails to load one or more resources.
1915
1916This could be because of a script load failure. It could also be because a
1917module fails to register itself when the `requireRegistration` config is `true`.
1918
1919If this function is defined, the `use()` callback will only be called when the
1920loader succeeds. Otherwise, `use()` will always executes unless there was a
1921JavaScript error when attaching a module.
1922
1923@property {Function} loadErrorFn
1924@since 3.3.0
1925**/
1926
1927/**
1928If `true`, Loader will expect all loaded scripts to be first-class YUI modules
1929that register themselves with the YUI global, and will trigger a failure if a
1930loaded script does not register a YUI module.
1931
1932@property {Boolean} requireRegistration
1933@default false
1934@since 3.3.0
1935**/
1936
1937/**
1938Cache serviced use() requests.
1939
1940@property {Boolean} cacheUse
1941@default true
1942@since 3.3.0
1943@deprecated No longer used.
1944**/
1945
1946/**
1947Whether or not YUI should use native ES5 functionality when available for
1948features like `Y.Array.each()`, `Y.Object()`, etc.
1949
1950When `false`, YUI will always use its own fallback implementations instead of
1951relying on ES5 functionality, even when ES5 functionality is available.
1952
1953@property {Boolean} useNativeES5
1954@default true
1955@since 3.5.0
1956**/
1957
1958/**
1959 * Leverage native JSON stringify if the browser has a native
1960 * implementation.  In general, this is a good idea.  See the Known Issues
1961 * section in the JSON user guide for caveats.  The default value is true
1962 * for browsers with native JSON support.
1963 *
1964 * @property useNativeJSONStringify
1965 * @type Boolean
1966 * @default true
1967 * @since 3.8.0
1968 */
1969
1970 /**
1971 * Leverage native JSON parse if the browser has a native implementation.
1972 * In general, this is a good idea.  See the Known Issues section in the
1973 * JSON user guide for caveats.  The default value is true for browsers with
1974 * native JSON support.
1975 *
1976 * @property useNativeJSONParse
1977 * @type Boolean
1978 * @default true
1979 * @since 3.8.0
1980 */
1981
1982/**
1983Delay the `use` callback until a specific event has passed (`load`, `domready`, `contentready` or `available`)
1984
1985@property {Object|String} delayUntil
1986@since 3.6.0
1987@example
1988
1989You can use `load` or `domready` strings by default:
1990
1991    YUI({
1992        delayUntil: 'domready'
1993    }, function (Y) {
1994        // This will not execute until 'domeready' occurs.
1995    });
1996
1997Or you can delay until a node is available (with `available` or `contentready`):
1998
1999    YUI({
2000        delayUntil: {
2001            event: 'available',
2002            args : '#foo'
2003        }
2004    }, function (Y) {
2005        // This will not execute until a node matching the selector "#foo" is
2006        // available in the DOM.
2007    });
2008
2009**/
2010YUI.add('yui-base', function (Y, NAME) {
2011
2012/*
2013 * YUI stub
2014 * @module yui
2015 * @submodule yui-base
2016 */
2017/**
2018 * The YUI module contains the components required for building the YUI
2019 * seed file.  This includes the script loading mechanism, a simple queue,
2020 * and the core utilities for the library.
2021 * @module yui
2022 * @submodule yui-base
2023 */
2024
2025/**
2026 * Provides core language utilites and extensions used throughout YUI.
2027 *
2028 * @class Lang
2029 * @static
2030 */
2031
2032var L = Y.Lang || (Y.Lang = {}),
2033
2034STRING_PROTO = String.prototype,
2035TOSTRING     = Object.prototype.toString,
2036
2037TYPES = {
2038    'undefined'        : 'undefined',
2039    'number'           : 'number',
2040    'boolean'          : 'boolean',
2041    'string'           : 'string',
2042    '[object Function]': 'function',
2043    '[object RegExp]'  : 'regexp',
2044    '[object Array]'   : 'array',
2045    '[object Date]'    : 'date',
2046    '[object Error]'   : 'error'
2047},
2048
2049SUBREGEX         = /\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,
2050
2051WHITESPACE       = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF",
2052WHITESPACE_CLASS = "[\x09-\x0D\x20\xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]+",
2053TRIM_LEFT_REGEX  = new RegExp("^" + WHITESPACE_CLASS),
2054TRIM_RIGHT_REGEX = new RegExp(WHITESPACE_CLASS + "$"),
2055TRIMREGEX        = new RegExp(TRIM_LEFT_REGEX.source + "|" + TRIM_RIGHT_REGEX.source, "g"),
2056
2057NATIVE_FN_REGEX  = /\{\s*\[(?:native code|function)\]\s*\}/i;
2058
2059// -- Protected Methods --------------------------------------------------------
2060
2061/**
2062Returns `true` if the given function appears to be implemented in native code,
2063`false` otherwise. Will always return `false` -- even in ES5-capable browsers --
2064if the `useNativeES5` YUI config option is set to `false`.
2065
2066This isn't guaranteed to be 100% accurate and won't work for anything other than
2067functions, but it can be useful for determining whether a function like
2068`Array.prototype.forEach` is native or a JS shim provided by another library.
2069
2070There's a great article by @kangax discussing certain flaws with this technique:
2071<http://perfectionkills.com/detecting-built-in-host-methods/>
2072
2073While his points are valid, it's still possible to benefit from this function
2074as long as it's used carefully and sparingly, and in such a way that false
2075negatives have minimal consequences. It's used internally to avoid using
2076potentially broken non-native ES5 shims that have been added to the page b
2076y
2077other libraries.
2078
2079@method _isNative
2080@param {Function} fn Function to test.
2081@return {Boolean} `true` if _fn_ appears to be native, `false` otherwise.
2082@static
2083@protected
2084@since 3.5.0
2085**/
2086L._isNative = function (fn) {
2087    return !!(Y.config.useNativeES5 && fn && NATIVE_FN_REGEX.test(fn));
2088};
2089
2090// -- Public Methods -----------------------------------------------------------
2091
2092/**
2093 * Determines whether or not the provided item is an array.
2094 *
2095 * Returns `false` for array-like collections such as the function `arguments`
2096 * collection or `HTMLElement` collections. Use `Y.Array.test()` if you want to
2097 * test for an array-like collection.
2098 *
2099 * @method isArray
2100 * @param o The object to test.
2101 * @return {boolean} true if o is an array.
2102 * @static
2103 */
2104L.isArray = L._isNative(Array.isArray) ? Array.isArray : function (o) {
2105    return L.type(o) === 'array';
2106};
2107
2108/**
2109 * Determines whether or not the provided item is a boolean.
2110 * @method isBoolean
2111 * @static
2112 * @param o The object to test.
2113 * @return {boolean} true if o is a boolean.
2114 */
2115L.isBoolean = function(o) {
2116    return typeof o === 'boolean';
2117};
2118
2119/**
2120 * Determines whether or not the supplied item is a date instance.
2121 * @method isDate
2122 * @static
2123 * @param o The object to test.
2124 * @return {boolean} true if o is a date.
2125 */
2126L.isDate = function(o) {
2127    return L.type(o) === 'date' && o.toString() !== 'Invalid Date' && !isNaN(o);
2128};
2129
2130/**
2131 * <p>
2132 * Determines whether or not the provided item is a function.
2133 * Note: Internet Explorer thinks certain functions are objects:
2134 * </p>
2135 *
2136 * <pre>
2137 * var obj = document.createElement("object");
2138 * Y.Lang.isFunction(obj.getAttribute) // reports false in IE
2139 * &nbsp;
2140 * var input = document.createElement("input"); // append to body
2141 * Y.Lang.isFunction(input.focus) // reports false in IE
2142 * </pre>
2143 *
2144 * <p>
2145 * You will have to implement additional tests if these functions
2146 * matter to you.
2147 * </p>
2148 *
2149 * @method isFunction
2150 * @static
2151 * @param o The object to test.
2152 * @return {boolean} true if o is a function.
2153 */
2154L.isFunction = function(o) {
2155    return L.type(o) === 'function';
2156};
2157
2158/**
2159 * Determines whether or not the provided item is null.
2160 * @method isNull
2161 * @static
2162 * @param o The object to test.
2163 * @return {boolean} true if o is null.
2164 */
2165L.isNull = function(o) {
2166    return o === null;
2167};
2168
2169/**
2170 * Determines whether or not the provided item is a legal number.
2171 * @method isNumber
2172 * @static
2173 * @param o The object to test.
2174 * @return {boolean} true if o is a number.
2175 */
2176L.isNumber = function(o) {
2177    return typeof o === 'number' && isFinite(o);
2178};
2179
2180/**
2181 * Determines whether or not the provided item is of type object
2182 * or function. Note that arrays are also objects, so
2183 * <code>Y.Lang.isObject([]) === true</code>.
2184 * @method isObject
2185 * @static
2186 * @param o The object to test.
2187 * @param failfn {boolean} fail if the input is a function.
2188 * @return {boolean} true if o is an object.
2189 * @see isPlainObject
2190 */
2191L.isObject = function(o, failfn) {
2192    var t = typeof o;
2193    return (o && (t === 'object' ||
2194        (!failfn && (t === 'function' || L.isFunction(o))))) || false;
2195};
2196
2197/**
2198 * Determines whether or not the provided value is a regexp.
2199 * @method isRegExp
2200 * @static
2201 * @param value The value or object to test.
2202 * @return {boolean} true if value is a regexp.
2203 */
2204L.isRegExp = function(value) {
2205    return L.type(value) === 'regexp';
2206};
2207
2208/**
2209 * Determines whether or not the provided item is a string.
2210 * @method isString
2211 * @static
2212 * @param o The object to test.
2213 * @return {boolean} true if o is a string.
2214 */
2215L.isString = function(o) {
2216    return typeof o === 'string';
2217};
2218
2219/**
2220 * Determines whether or not the provided item is undefined.
2221 * @method isUndefined
2222 * @static
2223 * @param o The object to test.
2224 * @return {boolean} true if o is undefined.
2225 */
2226L.isUndefined = function(o) {
2227    return typeof o === 'undefined';
2228};
2229
2230/**
2231 * A convenience method for detecting a legitimate non-null value.
2232 * Returns false for null/undefined/NaN, true for other values,
2233 * including 0/false/''
2234 * @method isValue
2235 * @static
2236 * @param o The item to test.
2237 * @return {boolean} true if it is not null/undefined/NaN || false.
2238 */
2239L.isValue = function(o) {
2240    var t = L.type(o);
2241
2242    switch (t) {
2243        case 'number':
2244            return isFinite(o);
2245
2246        case 'null': // fallthru
2247        case 'undefined':
2248            return false;
2249
2250        default:
2251            return !!t;
2252    }
2253};
2254
2255/**
2256 * Returns the current time in milliseconds.
2257 *
2258 * @method now
2259 * @return {Number} Current time in milliseconds.
2260 * @static
2261 * @since 3.3.0
2262 */
2263L.now = Date.now || function () {
2264    return new Date().getTime();
2265};
2266
2267/**
2268 * Performs `{placeholder}` substitution on a string. The object passed as the
2269 * second parameter provides values to replace the `{placeholder}`s.
2270 * `{placeholder}` token names must match property names of the object. For example,
2271 *
2272 *`var greeting = Y.Lang.sub("Hello, {who}!", { who: "World" });`
2273 *
2274 * `{placeholder}` tokens that are undefined on the object map will be left
2275 * in tact (leaving unsightly `{placeholder}`'s in the output string).
2276 *
2277 * @method sub
2278 * @param {string} s String to be modified.
2279 * @param {object} o Object containing replacement values.
2280 * @return {string} the substitute result.
2281 * @static
2282 * @since 3.2.0
2283 */
2284L.sub = function(s, o) {
2285
2286    /**
2287    Finds the value of `key` in given object.
2288    If the key has a 'dot' notation e.g. 'foo.bar.baz', the function will
2289    try to resolve this path if it doesn't exist as a property
2290    @example
2291        value({ 'a.b': 1, a: { b: 2 } }, 'a.b'); // 1
2292        value({ a: { b: 2 } }          , 'a.b'); // 2
2293    @param {Object} obj A key/value pairs object
2294    @param {String} key
2295    @return {Any}
2296    @private
2297    **/
2298    function value(obj, key) {
2299
2300        var subkey;
2301
2302        if ( typeof obj[key] !== 'undefined' ) {
2303            return obj[key];
2304        }
2305
2306        key    = key.split('.');         // given 'a.b.c'
2307        subkey = key.slice(1).join('.'); // 'b.c'
2308        key    = key[0];                 // 'a'
2309
2310        // special case for null as typeof returns object and we don't want that.
2311        if ( subkey && typeof obj[key] === 'object' && obj[key] !== null ) {
2312            return value(obj[key], subkey);
2313        }
2314    }
2315
2316    return s.replace ? s.replace(SUBREGEX, function (match, key) {
2317        var val = key.indexOf('.')>-1 ? value(o, key) : o[key];
2318        return typeof val === 'undefined' ? match : val;
2319    }) : s;
2320};
2321
2322/**
2323 * Returns a string without any leading or trailing whitespace.  If
2324 * the input is not a string, the input will be returned untouched.
2325 * @method trim
2326 * @static
2327 * @param s {string} the string to trim.
2328 * @return {string} the trimmed string.
2329 */
2330L.trim = L._isNative(STRING_PROTO.trim) && !WHITESPACE.trim() ? function(s) {
2331    return s && s.trim ? s.trim() : s;
2332} : function (s) {
2333    try {
2334        return s.replace(TRIMREGEX, '');
2335    } catch (e) {
2336        return s;
2337    }
2338};
2339
2340/**
2341 * Returns a string without any leading whitespace.
2342 * @method trimLeft
2343 * @static
2344 * @param s {string} the string to trim.
2345 * @return {string} the trimmed string.
2346 */
2347L.trimLeft = L._isNative(STRING_PROTO.trimLeft) && !WHITESPACE.trimLeft() ? function (s) {
2348    return s.trimLeft();
2349} : function (s) {
2350    return s.replace(TRIM_LEFT_REGEX, '');
2351};
2352
2353/**
2354 * Returns a string without any trailing whitespace.
2355 * @method trimRight
2356 * @static
2357 * @param s {string} the string to trim.
2358 * @return {string} the trimmed string.
2359 */
2360L.trimRight = L._isNative(STRING_PROTO.trimRight) && !WHITESPACE.trimRight() ? function (s) {
2361    return s.trimRight();
2362} : function (s) {
2363    return s.replace(TRIM_RIGHT_REGEX, '');
2364};
2365
2366/**
2367Returns one of the following strings, representing the type of the item passed
2368in:
2369
2370 * "array"
2371 * "boolean"
2372 * "date"
2373 * "error"
2374 * "function"
2375 * "null"
2376 * "number"
2377 * "object"
2378 * "regexp"
2379 * "string"
2380 * "undefined"
2381
2382Known issues:
2383
2384 * `typeof HTMLElementCollection` returns function in Safari, but
2385    `Y.Lang.type()` reports "object", which could be a good thing --
2386    but it actually caused the logic in <code>Y.Lang.isObject</code> to fail.
2387
2388@method type
2389@param o the item to test.
2390@return {string} the detected type.
2391@static
2392**/
2393L.type = function(o) {
2394    return TYPES[typeof o] || TYPES[TOSTRING.call(o)] || (o ? 'object' : 'null');
2395};
2396/**
2397@module yui
2398@submodule yui-base
2399*/
2400
2401var Lang   = Y.Lang,
2402    Native = Array.prototype,
2403
2404    hasOwn = Object.prototype.hasOwnProperty;
2405
2406/**
2407Provides utility methods for working with arrays. Additional array helpers can
2408be found in the `collection` and `array-extras` modules.
2409
2410`Y.Array(thing)` returns a native array created from _thing_. Depending on
2411_thing_'s type, one of the following will happen:
2412
2413  * Arrays are returned unmodified unless a non-zero _startIndex_ is
2414    specified.
2415  * Array-like collections (see `Array.test()`) are converted to arrays.
2416  * For everything else, a new array is created with _thing_ as the sole
2417    item.
2418
2419Note: elements that are also collections, such as `<form>` and `<select>`
2420elements, are not automatically converted to arrays. To force a conversion,
2421pass `true` as the value of the _force_ parameter.
2422
2423@class Array
2424@constructor
2425@param {Any} thing The thing to arrayify.
2426@param {Number} [startIndex=0] If non-zero and _thing_ is an array or array-like
2427  collection, a subset of items starting at the specified index will be
2428  returned.
2429@param {Boolean} [force=false] If `true`, _thing_ will be treated as an
2430  array-like collection no matter what.
2431@return {Array} A native array created from _thing_, according to the rules
2432  described above.
2433**/
2434function YArray(thing, startIndex, force) {
2435    var len, result;
2436
2437    /*jshint expr: true*/
2438    startIndex || (startIndex = 0);
2439
2440    if (force || YArray.test(thing)) {
2441        // IE throws when trying to slice HTMLElement collections.
2442        try {
2443            return Native.slice.call(thing, startIndex);
2444        } catch (ex) {
2445            result = [];
2446
2447            for (len = thing.length; startIndex < len; ++startIndex) {
2448                result.push(thing[startIndex]);
2449            }
2450
2451            return result;
2452        }
2453    }
2454
2455    return [thing];
2456}
2457
2458Y.Array = YArray;
2459
2460/**
2461Dedupes an array of strings, returning an array that's guaranteed to contain
2462only one copy of a given string.
2463
2464This method differs from `Array.unique()` in that it's optimized for use only
2465with arrays consisting entirely of strings or entirely of numbers, whereas
2466`unique` may be used with other value types (but is slower).
2467
2468Using `dedupe()` with values other than strings or numbers, or with arrays
2469containing a mix of strings and numbers, may result in unexpected behavior.
2470
2471@method dedupe
2472@param {String[]|Number[]} array Array of strings or numbers to dedupe.
2473@return {Array} Copy of _array_ containing no duplicate values.
2474@static
2475@since 3.4.0
2476**/
2477YArray.dedupe = Lang._isNative(Object.create) ? function (array) {
2478    var hash    = Object.create(null),
2479        results = [],
2480        i, item, len;
2481
2482    for (i = 0, len = array.length; i < len; ++i) {
2483        item = array[i];
2484
2485        if (!hash[item]) {
2486            hash[item] = 1;
2487            results.push(item);
2488        }
2489    }
2490
2491    return results;
2492} : function (array) {
2493    var hash    = {},
2494        results = [],
2495        i, item, len;
2496
2497    for (i = 0, len = array.length; i < len; ++i) {
2498        item = array[i];
2499
2500        if (!hasOwn.call(hash, item)) {
2501            hash[item] = 1;
2502            results.push(item);
2503        }
2504    }
2505
2506    return results;
2507};
2508
2509/**
2510Executes the supplied function on each item in the array. This method wraps
2511the native ES5 `Array.forEach()` method if available.
2512
2513@method each
2514@param {Array} array Array to iterate.
2515@param {Function} fn Function to execute on each item in the array. The function
2516  will receive the following arguments:
2517    @param {Any} fn.item Current array item.
2518    @param {Number} fn.index Current array index.
2519    @param {Array} fn.array Array being iterated.
2520@param {Object} [thisObj] `this` object to use when calling _fn_.
2521@return {YUI} The YUI instance.
2522@static
2523**/
2524YArray.each = YArray.forEach = Lang._isNative(Native.forEach) ? function (array, fn, thisObj) {
2525    Native.forEach.call(array || [], fn, thisObj || Y);
2526    return Y;
2527} : function (array, fn, thisObj) {
2528    for (var i = 0, len = (array && array.length) || 0; i < len; ++i) {
2529        if (i in array) {
2530            fn.call(thisObj || Y, array[i], i, array);
2531        }
2532    }
2533
2534    return Y;
2535};
2536
2537/**
2538Alias for `each()`.
2539
2540@method forEach
2541@static
2542**/
2543
2544/**
2545Returns an object using the first array as keys and the second as values. If
2546the second array is not provided, or if it doesn't contain the same number of
2547values as the first array, then `true` will be used in place of the missing
2548values.
2549
2550@example
2551
2552    Y.Array.hash(['a', 'b', 'c'], ['foo', 'bar']);
2553    // => {a: 'foo', b: 'bar', c: true}
2554
2555@method hash
2556@param {String[]} keys Array of strings to use as keys.
2557@param {Array} [values] Array to use as values.
2558@return {Object} Hash using the first array as keys and the second as values.
2559@static
2560**/
2561YArray.hash = function (keys, values) {
2562    var hash = {},
2563        vlen = (values && values.length) || 0,
2564        i, len;
2565
2566    for (i = 0, len = keys.length; i < len; ++i) {
2567        if (i in keys) {
2568            hash[keys[i]] = vlen > i && i in values ? values[i] : true;
2569        }
2570    }
2571
2572    return hash;
2573};
2574
2575/**
2576Returns the index of the first item in the array that's equal (using a strict
2577equality check) to the specified _value_, or `-1` if the value isn't found.
2578
2579This method wraps the native ES5 `Array.indexOf()` method if available.
2580
2581@method indexOf
2582@param {Array} array Array to search.
2583@param {Any} value Value to search for.
2584@param {Number} [from=0] The index at which to begin the search.
2585@return {Number} Index of the item strictly equal to _value_, or `-1` if not
2586    found.
2587@static
2588**/
2589YArray.indexOf = Lang._isNative(Native.indexOf) ? function (array, value, from) {
2590    return Native.indexOf.call(array, value, from);
2591} : function (array, value, from) {
2592    // http://es5.github.com/#x15.4.4.14
2593    var len = array.length;
2594
2595    from = +from || 0;
2596    from = (from > 0 || -1) * Math.floor(Math.abs(from));
2597
2598    if (from < 0) {
2599        from += len;
2600
2601        if (from < 0) {
2602            from = 0;
2603        }
2604    }
2605
2606    for (; from < len; ++from) {
2607        if (from in array && array[from] === value) {
2608            return from;
2609        }
2610    }
2611
2612    return -1;
2613};
2614
2615/**
2616Numeric sort convenience function.
2617
2618The native `Array.prototype.sort()` function converts values to strings and
2619sorts them in lexicographic order, which is unsuitable for sorting numeric
2620values. Provide `Array.numericSort` as a custom sort function when you want
2621to sort values in numeric order.
2622
2623@example
2624
2625    [42, 23, 8, 16, 4, 15].sort(Y.Array.numericSort);
2626    // => [4, 8, 15, 16, 23, 42]
2627
2628@method numericSort
2629@param {Number} a First value to compare.
2630@param {Number} b Second value to compare.
2631@return {Number} Difference between _a_ and _b_.
2632@static
2633**/
2634YArray.numericSort = function (a, b) {
2635    return a - b;
2636};
2637
2638/**
2639Executes the supplied function on each item in the array. Returning a truthy
2640value from the function will stop the processing of remaining items.
2641
2642@method some
2643@param {Array} array Array to iterate over.
2644@param {Function} fn Function to execute on each item. The function will receive
2645  the following arguments:
2646    @param {Any} fn.value Current array item.
2647    @param {Number} fn.index Current array index.
2648    @param {Array} fn.array Array being iterated over.
2649@param {Object} [thisObj] `this` object to use when calling _fn_.
2650@return {Boolean} `true` if the function returns a truthy value on any of the
2651  items in the array; `false` otherwise.
2652@static
2653**/
2654YArray.some = Lang._isNative(Native.some) ? function (array, fn, thisObj) {
2655    return Native.some.call(array, fn, thisObj);
2656} : function (array, fn, thisObj) {
2657    for (var i = 0, len = array.length; i < len; ++i) {
2658        if (i in array && fn.call(thisObj, array[i], i, array)) {
2659            return true;
2660        }
2661    }
2662
2663    return false;
2664};
2665
2666/**
2667Evaluates _obj_ to determine if it's an array, an array-like collection, or
2668something else. This is useful when working with the function `arguments`
2669collection and `HTMLElement` collections.
2670
2671Note: This implementation doesn't consider elements that are also
2672collections, such as `<form>` and `<select>`, to be array-like.
2673
2674@method test
2675@param {Object} obj Object to test.
2676@return {Number} A number indicating the results of the test:
2677
2678  * 0: Neither an array nor an array-like collection.
2679  * 1: Real array.
2680  * 2: Array-like collection.
2681
2682@static
2683**/
2684YArray.test = function (obj) {
2685    var result = 0;
2686
2687    if (Lang.isArray(obj)) {
2688        result = 1;
2689    } else if (Lang.isObject(obj)) {
2690        try {
2691            // indexed, but no tagName (element) or scrollTo/document (window. From DOM.isWindow test which we can't use here),
2692            // or functions without apply/call (Safari
2693            // HTMLElementCollection bug).
2694            if ('length' in obj && !obj.tagName && !(obj.scrollTo && obj.document) && !obj.apply) {
2695                result = 2;
2696            }
2697        } catch (ex) {}
2698    }
2699
2700    return result;
2701};
2702/**
2703 * The YUI module contains the components required for building the YUI
2704 * seed file.  This includes the script loading mechanism, a simple queue,
2705 * and the core utilities for the library.
2706 * @module yui
2707 * @submodule yui-base
2708 */
2709
2710/**
2711 * A simple FIFO queue.  Items are added to the Queue with add(1..n items) and
2712 * removed using next().
2713 *
2714 * @class Queue
2715 * @constructor
2716 * @param {MIXED} item* 0..n items to seed the queue.
2717 */
2718function Queue() {
2719    this._init();
2720    this.add.apply(this, arguments);
2721}
2722
2723Queue.prototype = {
2724    /**
2725     * Initialize the queue
2726     *
2727     * @method _init
2728     * @protected
2729     */
2730    _init: function() {
2731        /**
2732         * The collection of enqueued items
2733         *
2734         * @property _q
2735         * @type Array
2736         * @protected
2737         */
2738        this._q = [];
2739    },
2740
2741    /**
2742     * Get the next item in the queue. FIFO support
2743     *
2744     * @method next
2745     * @return {MIXED} the next item in the queue.
2746     */
2747    next: function() {
2748        return this._q.shift();
2749    },
2750
2751    /**
2752     * Get the last in the queue. LIFO support.
2753     *
2754     * @method last
2755     * @return {MIXED} the last item in the queue.
2756     */
2757    last: function() {
2758        return this._q.pop();
2759    },
2760
2761    /**
2762     * Add 0..n items to the end of the queue.
2763     *
2764     * @method add
2765     * @param {MIXED} item* 0..n items.
2766     * @return {object} this queue.
2767     */
2768    add: function() {
2769        this._q.push.apply(this._q, arguments);
2770
2771        return this;
2772    },
2773
2774    /**
2775     * Returns the current number of queued items.
2776     *
2777     * @method size
2778     * @return {Number} The size.
2779     */
2780    size: function() {
2781        return this._q.length;
2782    }
2783};
2784
2785Y.Queue = Queue;
2786
2787YUI.Env._loaderQueue = YUI.Env._loaderQueue || new Queue();
2788
2789/**
2790The YUI module contains the components required for building the YUI seed file.
2791This includes the script loading mechanism, a simple queue, and the core
2792utilities for the library.
2793
2794@module yui
2795@submodule yui-base
2796**/
2797
2798var CACHED_DELIMITER = '__',
2799
2800    hasOwn   = Object.prototype.hasOwnProperty,
2801    isObject = Y.Lang.isObject;
2802
2803/**
2804Returns a wrapper for a function which caches the return value of that function,
2805keyed off of the combined string representation of the argument values provided
2806when the wrapper is called.
2807
2808Calling this function again with the same arguments will return the cached value
2809rather than executing the wrapped function.
2810
2811Note that since the cache is keyed off of the string representation of arguments
2812passed to the wrapper function, arguments that aren't strings and don't provide
2813a meaningful `toString()` method may result in unexpected caching behavior. For
2814example, the objects `{}` and `{foo: 'bar'}` would both be converted to the
2815string `[object Object]` when used as a cache key.
2816
2817@method cached
2818@param {Function} source The function to memoize.
2819@param {Object} [cache={}] Object in which to store cached values. You may seed
2820  this object with pre-existing cached values if desired.
2821@param {any} [refetch] If supplied, this value is compared with the cached value
2822  using a `==` comparison. If the values are equal, the wrapped function is
2823  executed again even though a cached value exists.
2824@return {Function} Wrapped function.
2825@for YUI
2826**/
2827Y.cached = function (source, cache, refetch) {
2828    /*jshint expr: true*/
2829    cache || (cache = {});
2830
2831    return function (arg) {
2832        var key = arguments.length > 1 ?
2833                Array.prototype.join.call(arguments, CACHED_DELIMITER) :
2834                String(arg);
2835
2836        /*jshint eqeqeq: false*/
2837        if (!(key in cache) || (refetch && cache[key] == refetch)) {
2838            cache[key] = source.apply(source, arguments);
2839        }
2840
2841        return cache[key];
2842    };
2843};
2844
2845/**
2846Returns the `location` object from the window/frame in which this YUI instance
2847operates, or `undefined` when executing in a non-browser environment
2848(e.g. Node.js).
2849
2850It is _not_ recommended to hold references to the `window.location` object
2851outside of the scope of a function in which its properties are being accessed or
2852its methods are being called. This is because of a nasty bug/issue that exists
2853in both Safari and MobileSafari browsers:
2854[WebKit Bug 34679](https://bugs.webkit.org/show_bug.cgi?id=34679).
2855
2856@method getLocation
2857@return {location} The `location` object from the window/frame in which this YUI
2858    instance operates.
2859@since 3.5.0
2860**/
2861Y.getLocation = function () {
2862    // It is safer to look this up every time because yui-base is attached to a
2863    // YUI instance before a user's config is applied; i.e. `Y.config.win` does
2864    // not point the correct window object when this file is loaded.
2865    var win = Y.config.win;
2866
2867    // It is not safe to hold a reference to the `location` object outside the
2868    // scope in which it is being used. The WebKit engine used in Safari and
2869    // MobileSafari will "disconnect" the `location` object from the `window`
2870    // when a page is restored from back/forward history cache.
2871    return win && win.location;
2872};
2873
2874/**
2875Returns a new object containing all of the properties of all the supplied
2876objects. The properties from later objects will overwrite those in earlier
2877objects.
2878
2879Passing in a single object will create a shallow copy of it. For a deep copy,
2880use `clone()`.
2881
2882@method merge
2883@param {Object} objects* One or more objects to merge.
2884@return {Object} A new merged object.
2885**/
2886Y.merge = function () {
2887    var i      = 0,
2888        len    = arguments.length,
2889        result = {},
2890        key,
2891        obj;
2892
2893    for (; i < len; ++i) {
2894        obj = arguments[i];
2895
2896        for (key in obj) {
2897            if (hasOwn.call(obj, key)) {
2898                result[key] = obj[key];
2899            }
2900        }
2901    }
2902
2903    return result;
2904};
2905
2906/**
2907Mixes _supplier_'s properties into _receiver_.
2908
2909Properties on _receiver_ or _receiver_'s prototype will not be overwritten or
2910shadowed unless the _overwrite_ parameter is `true`, and will not be merged
2911unless the _merge_ parameter is `true`.
2912
2913In the default mode (0), only properties the supplier owns are copied (prototype
2914properties are not copied). The following copying modes are available:
2915
2916  * `0`: _Default_. Object to object.
2917  * `1`: Prototype to prototype.
2918  * `2`: Prototype to prototype and object to object.
2919  * `3`: Prototype to object.
2920  * `4`: Object to prototype.
2921
2922@method mix
2923@param {Function|Object} receiver The object or function to receive the mixed
2924  properties.
2925@param {Function|Object} supplier The object or function supplying the
2926  properties to be mixed.
2927@param {Boolean} [overwrite=false] If `true`, properties that already exist
2928  on the receiver will be overwritten with properties from the supplier.
2929@param {String[]} [whitelist] An array of property names to copy. If
2930  specified, only the whitelisted properties will be copied, and all others
2931  will be ignored.
2932@param {Number} [mode=0] Mix mode to use. See above for available modes.
2933@param {Boolean} [merge=false] If `true`, objects and arrays that already
2934  exist on the receiver will have the corresponding object/array from the
2935  supplier merged into them, rather than being skipped or overwritten. When
2936  both _overwrite_ and _merge_ are `true`, _merge_ takes precedence.
2937@return {Function|Object|YUI} The receiver, or the YUI instance if the
2938  specified receiver is falsy.
2939**/
2940Y.mix = function(receiver, supplier, overwrite, whitelist, mode, merge) {
2941    var alwaysOverwrite, exists, from, i, key, len, to;
2942
2943    // If no supplier is given, we return the receiver. If no receiver is given,
2944    // we return Y. Returning Y doesn't make much sense to me, but it's
2945    // grandfathered in for backcompat reasons.
2946    if (!receiver || !supplier) {
2947        return receiver || Y;
2948    }
2949
2950    if (mode) {
2951        // In mode 2 (prototype to prototype and object to object), we recurse
2952        // once to do the proto to proto mix. The object to object mix will be
2953        // handled later on.
2954        if (mode === 2) {
2955            Y.mix(receiver.prototype, supplier.prototype, overwrite,
2956                    whitelist, 0, merge);
2957        }
2958
2959        // Depending on which mode is specified, we may be copying from or to
2960        // the prototypes of the supplier and receiver.
2961        from = mode === 1 || mode === 3 ? supplier.prototype : supplier;
2962        to   = mode === 1 || mode === 4 ? receiver.prototype : receiver;
2963
2964        // If either the supplier or receiver doesn't actually have a
2965        // prototype property, then we could end up with an undefined `from`
2966        // or `to`. If that happens, we abort and return the receiver.
2967        if (!from || !to) {
2968            return receiver;
2969        }
2970    } else {
2971        from = supplier;
2972        to   = receiver;
2973    }
2974
2975    // If `overwrite` is truthy and `merge` is falsy, then we can skip a
2976    // property existence check on each iteration and save some time.
2977    alwaysOverwrite = overwrite && !merge;
2978
2979    if (whitelist) {
2980        for (i = 0, len = whitelist.length; i < len; ++i) {
2981            key = whitelist[i];
2982
2983            // We call `Object.prototype.hasOwnProperty` instead of calling
2984            // `hasOwnProperty` on the object itself, since the object's
2985            // `hasOwnProperty` method may have been overridden or removed.
2986            // Also, some native objects don't implement a `hasOwnProperty`
2987            // method.
2988            if (!hasOwn.call(from, key)) {
2989                continue;
2990            }
2991
2992            // The `key in to` check here is (sadly) intentional for backwards
2993            // compatibility reasons. It prevents undesired shadowing of
2994            // prototype members on `to`.
2995            exists = alwaysOverwrite ? false : key in to;
2996
2997            if (merge && exists && isObject(to[key], true)
2998                    && isObject(from[key], true)) {
2999                // If we're in merge mode, and the key is present on both
3000                // objects, and the value on both objects is either an object or
3001                // an array (but not a function), then we recurse to merge the
3002                // `from` value into the `to` value instead of overwriting it.
3003                //
3004                // Note: It's intentional that the whitelist isn't passed to the
3005                // recursive call here. This is legacy behavior that lots of
3006                // code still depends on.
3007                Y.mix(to[key], from[key], overwrite, null, 0, merge);
3008            } else if (overwrite || !exists) {
3009                // We're not in merge mode, so we'll only copy the `from` value
3010                // to the `to` value if we're in overwrite mode or if the
3011                // current key doesn't exist on the `to` object.
3012                to[key] = from[key];
3013            }
3014        }
3015    } else {
3016        for (key in from) {
3017            // The code duplication here is for runtime performance reasons.
3018            // Combining whitelist and non-whitelist operations into a single
3019            // loop or breaking the shared logic out into a function both result
3020            // in worse performance, and Y.mix is critical enough that the byte
3021            // tradeoff is worth it.
3022            if (!hasOwn.call(from, key)) {
3023                continue;
3024            }
3025
3026            // The `key in to` check here is (sadly) intentional for backwards
3027            // compatibility reasons. It prevents undesired shadowing of
3028            // prototype members on `to`.
3029            exists = alwaysOverwrite ? false : key in to;
3030
3031            if (merge && exists && isObject(to[key], true)
3032                    && isObject(from[key], true)) {
3033                Y.mix(to[key], from[key], overwrite, null, 0, merge);
3034            } else if (overwrite || !exists) {
3035                to[key] = from[key];
3036            }
3037        }
3038
3039        // If this is an IE browser with the JScript enumeration bug, force
3040        // enumeration of the buggy properties by making a recursive call with
3041        // the buggy properties as the whitelist.
3042        if (Y.Object._hasEnumBug) {
3043            Y.mix(to, from, overwrite, Y.Object._forceEnum, mode, merge);
3044        }
3045    }
3046
3047    return receiver;
3048};
3049/**
3050 * The YUI module contains the components required for building the YUI
3051 * seed file.  This includes the script loading mechanism, a simple queue,
3052 * and the core utilities for the library.
3053 * @module yui
3054 * @submodule yui-base
3055 */
3056
3057/**
3058 * Adds utilities to the YUI instance for working with objects.
3059 *
3060 * @class Object
3061 */
3062
3063var Lang   = Y.Lang,
3064    hasOwn = Object.prototype.hasOwnProperty,
3065
3066    UNDEFINED, // <-- Note the comma. We're still declaring vars.
3067
3068/**
3069 * Returns a new object that uses _obj_ as its prototype. This method wraps the
3070 * native ES5 `Object.create()` method if available, but doesn't currently
3071 * pass through `Object.create()`'s second argument (properties) in order to
3072 * ensure compatibility with older browsers.
3073 *
3074 * @method ()
3075 * @param {Object} obj Prototype object.
3076 * @return {Object} New object using _obj_ as its prototype.
3077 * @static
3078 */
3079O = Y.Object = Lang._isNative(Object.create) ? function (obj) {
3080    // We currently wrap the native Object.create instead of simply aliasing it
3081    // to ensure consistency with our fallback shim, which currently doesn't
3082    // support Object.create()'s second argument (properties). Once we have a
3083    // safe fallback for the properties arg, we can stop wrapping
3084    // Object.create().
3085    return Object.create(obj);
3086} : (function () {
3087    // Reusable constructor function for the Object.create() shim.
3088    function F() {}
3089
3090    // The actual shim.
3091    return function (obj) {
3092        F.prototype = obj;
3093        return new F();
3094    };
3095}()),
3096
3097/**
3098 * Property names that IE doesn't enumerate in for..in loops, even when they
3099 * should be enumerable. When `_hasEnumBug` is `true`, it's necessary to
3100 * manually enumerate these properties.
3101 *
3102 * @property _forceEnum
3103 * @type String[]
3104 * @protected
3105 * @static
3106 */
3107forceEnum = O._forceEnum = [
3108    'hasOwnProperty',
3109    'isPrototypeOf',
3110    'propertyIsEnumerable',
3111    'toString',
3112    'toLocaleString',
3113    'valueOf'
3114],
3115
3116/**
3117 * `true` if this browser has the JScript enumeration bug that prevents
3118 * enumeration of the properties named in the `_forceEnum` array, `false`
3119 * otherwise.
3120 *
3121 * See:
3122 *   - <https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug>
3123 *   - <http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation>
3124 *
3125 * @property _hasEnumBug
3126 * @type Boolean
3127 * @protected
3128 * @static
3129 */
3130hasEnumBug = O._hasEnumBug = !{valueOf: 0}.propertyIsEnumerable('valueOf'),
3131
3132/**
3133 * `true` if this browser incorrectly considers the `prototype` property of
3134 * functions to be enumerable. Currently known to affect Opera 11.50 and Android 2.3.x.
3135 *
3136 * @property _hasProtoEnumBug
3137 * @type Boolean
3138 * @protected
3139 * @static
3140 */
3141hasProtoEnumBug = O._hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype'),
3142
3143/**
3144 * Returns `true` if _key_ exists on _obj_, `false` if _key_ doesn't exist or
3145 * exists only on _obj_'s prototype. This is essentially a safer version of
3146 * `obj.hasOwnProperty()`.
3147 *
3148 * @method owns
3149 * @param {Object} obj Object to test.
3150 * @param {String} key Property name to look for.
3151 * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise.
3152 * @static
3153 */
3154owns = O.owns = function (obj, key) {
3155    return !!obj && hasOwn.call(obj, key);
3156}; // <-- End of var declarations.
3157
3158/**
3159 * Alias for `owns()`.
3160 *
3161 * @method hasKey
3162 * @param {Object} obj Object to test.
3163 * @param {String} key Property name to look for.
3164 * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise.
3165 * @static
3166 */
3167O.hasKey = owns;
3168
3169/**
3170 * Returns an array containing the object's enumerable keys. Does not include
3171 * prototype keys or non-enumerable keys.
3172 *
3173 * Note that keys are returned in enumeration order (that is, in the same order
3174 * that they would be enumerated by a `for-in` loop), which may not be the same
3175 * as the order in which they were defined.
3176 *
3177 * This method is an alias for the native ES5 `Object.keys()` method if
3178 * available and non-buggy. The Opera 11.50 and Android 2.3.x versions of
3179 * `Object.keys()` have an inconsistency as they consider `prototype` to be
3180 * enumerable, so a non-native shim is used to rectify the difference.
3181 *
3182 * @example
3183 *
3184 *     Y.Object.keys({a: 'foo', b: 'bar', c: 'baz'});
3185 *     // => ['a', 'b', 'c']
3186 *
3187 * @method keys
3188 * @param {Object} obj An object.
3189 * @return {String[]} Array of keys.
3190 * @static
3191 */
3192O.keys = Lang._isNative(Object.keys) && !hasProtoEnumBug ? Object.keys : function (obj) {
3193    if (!Lang.isObject(obj)) {
3194        throw new TypeError('Object.keys called on a non-object');
3195    }
3196
3197    var keys = [],
3198        i, key, len;
3199
3200    if (hasProtoEnumBug && typeof obj === 'function') {
3201        for (key in obj) {
3202            if (owns(obj, key) && key !== 'prototype') {
3203                keys.push(key);
3204            }
3205        }
3206    } else {
3207        for (key in obj) {
3208            if (owns(obj, key)) {
3209                keys.push(key);
3210            }
3211        }
3212    }
3213
3214    if (hasEnumBug) {
3215        for (i = 0, len = forceEnum.length; i < len; ++i) {
3216            key = forceEnum[i];
3217
3218            if (owns(obj, key)) {
3219                keys.push(key);
3220            }
3221        }
3222    }
3223
3224    return keys;
3225};
3226
3227/**
3228 * Returns an array containing the values of the object's enumerable keys.
3229 *
3230 * Note that values are returned in enumeration order (that is, in the same
3231 * order that they would be enumerated by a `for-in` loop), which may not be the
3232 * same as the order in which they were defined.
3233 *
3234 * @example
3235 *
3236 *     Y.Object.values({a: 'foo', b: 'bar', c: 'baz'});
3237 *     // => ['foo', 'bar', 'baz']
3238 *
3239 * @method values
3240 * @param {Object} obj An object.
3241 * @return {Array} Array of values.
3242 * @static
3243 */
3244O.values = function (obj) {
3245    var keys   = O.keys(obj),
3246        i      = 0,
3247        len    = keys.length,
3248        values = [];
3249
3250    for (; i < len; ++i) {
3251        values.push(obj[keys[i]]);
3252    }
3253
3254    return values;
3255};
3256
3257/**
3258 * Returns the number of enumerable keys owned by an object.
3259 *
3260 * @method size
3261 * @param {Object} obj An object.
3262 * @return {Number} The object's size.
3263 * @static
3264 */
3265O.size = function (obj) {
3266    try {
3267        return O.keys(obj).length;
3268    } catch (ex) {
3269        return 0; // Legacy behavior for non-objects.
3270    }
3271};
3272
3273/**
3274 * Returns `true` if the object owns an enumerable property with the specified
3275 * value.
3276 *
3277 * @method hasValue
3278 * @param {Object} obj An object.
3279 * @param {any} value The value to search for.
3280 * @return {Boolean} `true` if _obj_ contains _value_, `false` otherwise.
3281 * @static
3282 */
3283O.hasValue = function (obj, value) {
3284    return Y.Array.indexOf(O.values(obj), value) > -1;
3285};
3286
3287/**
3288 * Executes a function on each enumerable property in _obj_. The function
3289 * receives the value, the key, and the object itself as parameters (in that
3290 * order).
3291 *
3292 * By default, only properties owned by _obj_ are enumerated. To include
3293 * prototype properties, set the _proto_ parameter to `true`.
3294 *
3295 * @method each
3296 * @param {Object} obj Object to enumerate.
3297 * @param {Function} fn Function to execute on each enumerable property.
3298 *   @param {mixed} fn.value Value of the current property.
3299 *   @param {String} fn.key Key of the current property.
3300 *   @param {Object} fn.obj Object being enumerated.
3301 * @param {Object} [thisObj] `this` object to use when calling _fn_.
3302 * @param {Boolean} [proto=false] Include prototype properties.
3303 * @return {YUI} the YUI instance.
3304 * @chainable
3305 * @static
3306 */
3307O.each = function (obj, fn, thisObj, proto) {
3308    var key;
3309
3310    for (key in obj) {
3311        if (proto || owns(obj, key)) {
3312            fn.call(thisObj || Y, obj[key], key, obj);
3313        }
3314    }
3315
3316    return Y;
3317};
3318
3319/**
3320 * Executes a function on each enumerable property in _obj_, but halts if the
3321 * function returns a truthy value. The function receives the value, the key,
3322 * and the object itself as paramters (in that order).
3323 *
3324 * By default, only properties owned by _obj_ are enumerated. To include
3325 * prototype properties, set the _proto_ parameter to `true`.
3326 *
3327 * @method some
3328 * @param {Object} obj Object to enumerate.
3329 * @param {Function} fn Function to execute on each enumerable property.
3330 *   @param {mixed} fn.value Value of the current property.
3331 *   @param {String} fn.key Key of the current property.
3332 *   @param {Object} fn.obj Object being enumerated.
3333 * @param {Object} [thisObj] `this` object to use when calling _fn_.
3334 * @param {Boolean} [proto=false] Include prototype properties.
3335 * @return {Boolean} `true` if any execution of _fn_ returns a truthy value,
3336 *   `false` otherwise.
3337 * @static
3338 */
3339O.some = function (obj, fn, thisObj, proto) {
3340    var key;
3341
3342    for (key in obj) {
3343        if (proto || owns(obj, key)) {
3344            if (fn.call(thisObj || Y, obj[key], key, obj)) {
3345                return true;
3346            }
3347        }
3348    }
3349
3350    return false;
3351};
3352
3353/**
3354 * Retrieves the sub value at the provided path,
3355 * from the value object provided.
3356 *
3357 * @method getValue
3358 * @static
3359 * @param o The object from which to extract the property value.
3360 * @param path {Array} A path array, specifying the object traversal path
3361 * from which to obtain the sub value.
3362 * @return {Any} The value stored in the path, undefined if not found,
3363 * undefined if the source is not an object.  Returns the source object
3364 * if an empty path is provided.
3365 */
3366O.getValue = function(o, path) {
3367    if (!Lang.isObject(o)) {
3368        return UNDEFINED;
3369    }
3370
3371    var i,
3372        p = Y.Array(path),
3373        l = p.length;
3374
3375    for (i = 0; o !== UNDEFINED && i < l; i++) {
3376        o = o[p[i]];
3377    }
3378
3379    return o;
3380};
3381
3382/**
3383 * Sets the sub-attribute value at the provided path on the
3384 * value object.  Returns the modified value object, or
3385 * undefined if the path is invalid.
3386 *
3387 * @method setValue
3388 * @static
3389 * @param o             The object on which to set the sub value.
3390 * @param path {Array}  A path array, specifying the object traversal path
3391 *                      at which to set the sub value.
3392 * @param val {Any}     The new value for the sub-attribute.
3393 * @return {Object}     The modified object, with the new sub value set, or
3394 *                      undefined, if the path was invalid.
3395 */
3396O.setValue = function(o, path, val) {
3397    var i,
3398        p = Y.Array(path),
3399        leafIdx = p.length - 1,
3400        ref = o;
3401
3402    if (leafIdx >= 0) {
3403        for (i = 0; ref !== UNDEFINED && i < leafIdx; i++) {
3404            ref = ref[p[i]];
3405        }
3406
3407        if (ref !== UNDEFINED) {
3408            ref[p[i]] = val;
3409        } else {
3410            return UNDEFINED;
3411        }
3412    }
3413
3414    return o;
3415};
3416
3417/**
3418 * Returns `true` if the object has no enumerable properties of its own.
3419 *
3420 * @method isEmpty
3421 * @param {Object} obj An object.
3422 * @return {Boolean} `true` if the object is empty.
3423 * @static
3424 * @since 3.2.0
3425 */
3426O.isEmpty = function (obj) {
3427    return !O.keys(Object(obj)).length;
3428};
3429/**
3430 * The YUI module contains the components required for building the YUI seed
3431 * file.  This includes the script loading mechanism, a simple queue, and the
3432 * core utilities for the library.
3433 * @module yui
3434 * @submodule yui-base
3435 */
3436
3437/**
3438 * YUI user agent detection.
3439 * Do not fork for a browser if it can be avoided.  Use feature detection when
3440 * you can.  Use the user agent as a last resort.  For all fields listed
3441 * as @type float, UA stores a version number for the browser engine,
3442 * 0 otherwise.  This value may or may not map to the version number of
3443 * the browser using the engine.  The value is presented as a float so
3444 * that it can easily be used for boolean evaluation as well as for
3445 * looking for a particular range of versions.  Because of this,
3446 * some of the granularity of the version info may be lost.  The fields that
3447 * are @type string default to null.  The API docs list the values that
3448 * these fields can have.
3449 * @class UA
3450 * @static
3451 */
3452
3453/**
3454* Static method on `YUI.Env` for parsing a UA string.  Called at instantiation
3455* to populate `Y.UA`.
3456*
3457* @static
3458* @method parseUA
3459* @param {String} [subUA=navigator.userAgent] UA string to parse
3460* @return {Object} The Y.UA object
3461*/
3462YUI.Env.parseUA = function(subUA) {
3463
3464    var numberify = function(s) {
3465            var c = 0;
3466            return parseFloat(s.replace(/\./g, function() {
3467                return (c++ === 1) ? '' : '.';
3468            }));
3469        },
3470
3471        win = Y.config.win,
3472
3473        nav = win && win.navigator,
3474
3475        o = {
3476
3477        /**
3478         * Internet Explorer version number or 0.  Example: 6
3479         * @property ie
3480         * @type float
3481         * @static
3482         */
3483        ie: 0,
3484
3485        /**
3486         * Opera version number or 0.  Example: 9.2
3487         * @property opera
3488         * @type float
3489         * @static
3490         */
3491        opera: 0,
3492
3493        /**
3494         * Gecko engine revision number.  Will evaluate to 1 if Gecko
3495         * is detected but the revision could not be found. Other browsers
3496         * will be 0.  Example: 1.8
3497         * <pre>
3498         * Firefox 1.0.0.4: 1.7.8   <-- Reports 1.7
3499         * Firefox 1.5.0.9: 1.8.0.9 <-- 1.8
3500         * Firefox 2.0.0.3: 1.8.1.3 <-- 1.81
3501         * Firefox 3.0   <-- 1.9
3502         * Firefox 3.5   <-- 1.91
3503         * </pre>
3504         * @property gecko
3505         * @type float
3506         * @static
3507         */
3508        gecko: 0,
3509
3510        /**
3511         * AppleWebKit version.  KHTML browsers that are not WebKit browsers
3512         * will evaluate to 1, other browsers 0.  Example: 418.9
3513         * <pre>
3514         * Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the
3515         *                                   latest available for Mac OSX 10.3.
3516         * Safari 2.0.2:         416     <-- hasOwnProperty introduced
3517         * Safari 2.0.4:         418     <-- preventDefault fixed
3518         * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run
3519         *                                   different versions of webkit
3520         * Safari 2.0.4 (419.3): 419     <-- Tiger installations that have been
3521         *                                   updated, but not updated
3522         *                                   to the latest patch.
3523         * Webkit 212 nightly:   522+    <-- Safari 3.0 precursor (with native
3524         * SVG and many major issues fixed).
3525         * Safari 3.0.4 (523.12) 523.12  <-- First Tiger release - automatic
3526         * update from 2.x via the 10.4.11 OS patch.
3527         * Webkit nightly 1/2008:525+    <-- Supports DOMContentLoaded event.
3528         *                                   yahoo.com user agent hack removed.
3529         * </pre>
3530         * http://en.wikipedia.org/wiki/Safari_version_history
3531         * @property webkit
3532         * @type float
3533         * @static
3534         */
3535        webkit: 0,
3536
3537        /**
3538         * Safari will be detected as webkit, but this property will also
3539         * be populated with the Safari version number
3540         * @property safari
3541         * @type float
3542         * @static
3543         */
3544        safari: 0,
3545
3546        /**
3547         * Chrome will be detected as webkit, but this property will also
3548         * be populated with the Chrome version number
3549         * @property chrome
3550         * @type float
3551         * @static
3552         */
3553        chrome: 0,
3554
3555        /**
3556         * The mobile property will be set to a string containing any relevant
3557         * user agent information when a modern mobile browser is detected.
3558         * Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series
3559         * devices with the WebKit-based browser, and Opera Mini.
3560         * @property mobile
3561         * @type string
3562         * @default null
3563         * @static
3564         */
3565        mobile: null,
3566
3567        /**
3568         * Adobe AIR version number or 0.  Only populated if webkit is detected.
3569         * Example: 1.0
3570         * @property air
3571         * @type float
3572         */
3573        air: 0,
3574        /**
3575         * PhantomJS version number or 0.  Only populated if webkit is detected.
3576         * Example: 1.0
3577         * @property phantomjs
3578         * @type float
3579         */
3580        phantomjs: 0,
3581        /**
3582         * Detects Apple iPad's OS version
3583         * @property ipad
3584         * @type float
3585         * @static
3586         */
3587        ipad: 0,
3588        /**
3589         * Detects Apple iPhone's OS version
3590         * @property iphone
3591         * @type float
3592         * @static
3593         */
3594        iphone: 0,
3595        /**
3596         * Detects Apples iPod's OS version
3597         * @property ipod
3598         * @type float
3599         * @static
3600         */
3601        ipod: 0,
3602        /**
3603         * General truthy check for iPad, iPhone or iPod
3604         * @property ios
3605         * @type Boolean
3606         * @default null
3607         * @static
3608         */
3609        ios: null,
3610        /**
3611         * Detects Googles Android OS version
3612         * @property android
3613         * @type float
3614         * @static
3615         */
3616        android: 0,
3617        /**
3618         * Detects Kindle Silk
3619         * @property silk
3620         * @type float
3621         * @static
3622         */
3623        silk: 0,
3624        /**
3625         * Detects Ubuntu version
3626         * @property ubuntu
3627         * @type float
3628         * @static
3629         */
3630        ubuntu: 0,
3631        /**
3632         * Detects Kindle Silk Acceleration
3633         * @property accel
3634         * @type Boolean
3635         * @static
3636         */
3637        accel: false,
3638        /**
3639         * Detects Palms WebOS version
3640         * @property webos
3641         * @type float
3642         * @static
3643         */
3644        webos: 0,
3645
3646        /**
3647         * Google Caja version number or 0.
3648         * @property caja
3649         * @type float
3650         */
3651        caja: nav && nav.cajaVersion,
3652
3653        /**
3654         * Set to true if the page appears to be in SSL
3655         * @property secure
3656         * @type boolean
3657         * @static
3658         */
3659        secure: false,
3660
3661        /**
3662         * The operating system.
3663         *
3664         * Possible values are `windows`, `macintosh`, `android`, `symbos`, `linux`, `rhino` and `ios`.
3665         *
3666         * @property os
3667         * @type string
3668         * @default null
3669         * @static
3670         */
3671        os: null,
3672
3673        /**
3674         * The Nodejs Version
3675         * @property nodejs
3676         * @type float
3677         * @default 0
3678         * @static
3679         */
3680        nodejs: 0,
3681        /**
3682        * Window8/IE10 Application host environment
3683        * @property winjs
3684        * @type Boolean
3685        * @static
3686        */
3687        winjs: !!((typeof Windows !== "undefined") && Windows.System),
3688        /**
3689        * Are touch/msPointer events available on this device
3690        * @property touchEnabled
3691        * @type Boolean
3692        * @static
3693        */
3694        touchEnabled: false
3695    },
3696
3697    ua = subUA || nav && nav.userAgent,
3698
3699    loc = win && win.location,
3700
3701    href = loc && loc.href,
3702
3703    m;
3704
3705    /**
3706    * The User Agent string that was parsed
3707    * @property userAgent
3708    * @type String
3709    * @static
3710    */
3711    o.userAgent = ua;
3712
3713
3714    o.secure = href && (href.toLowerCase().indexOf('https') === 0);
3715
3716    if (ua) {
3717
3718        if ((/windows|win32/i).test(ua)) {
3719            o.os = 'windows';
3720        } else if ((/macintosh|mac_powerpc/i).test(ua)) {
3721            o.os = 'macintosh';
3722        } else if ((/android/i).test(ua)) {
3723            o.os = 'android';
3724        } else if ((/symbos/i).test(ua)) {
3725            o.os = 'symbos';
3726        } else if ((/linux/i).test(ua)) {
3727            o.os = 'linux';
3728        } else if ((/rhino/i).test(ua)) {
3729            o.os = 'rhino';
3730        }
3731
3732        // Modern KHTML browsers should qualify as Safari X-Grade
3733        if ((/KHTML/).test(ua)) {
3734            o.webkit = 1;
3735        }
3736        if ((/IEMobile|XBLWP7/).test(ua)) {
3737            o.mobile = 'windows';
3738        }
3739        if ((/Fennec/).test(ua)) {
3740            o.mobile = 'gecko';
3741        }
3742        // Modern WebKit browsers are at least X-Grade
3743        m = ua.match(/AppleWebKit\/([^\s]*)/);
3744        if (m && m[1]) {
3745            o.webkit = numberify(m[1]);
3746            o.safari = o.webkit;
3747
3748            if (/PhantomJS/.test(ua)) {
3749                m = ua.match(/PhantomJS\/([^\s]*)/);
3750                if (m && m[1]) {
3751                    o.phantomjs = numberify(m[1]);
3752                }
3753            }
3754
3755            // Mobile browser check
3756            if (/ Mobile\//.test(ua) || (/iPad|iPod|iPhone/).test(ua)) {
3757                o.mobile = 'Apple'; // iPhone or iPod Touch
3758
3759                m = ua.match(/OS ([^\s]*)/);
3760                if (m && m[1]) {
3761                    m = numberify(m[1].replace('_', '.'));
3762                }
3763                o.ios = m;
3764                o.os = 'ios';
3765                o.ipad = o.ipod = o.iphone = 0;
3766
3767                m = ua.match(/iPad|iPod|iPhone/);
3768                if (m && m[0]) {
3769                    o[m[0].toLowerCase()] = o.ios;
3770                }
3771            } else {
3772                m = ua.match(/NokiaN[^\/]*|webOS\/\d\.\d/);
3773                if (m) {
3774                    // Nokia N-series, webOS, ex: NokiaN95
3775                    o.mobile = m[0];
3776                }
3777                if (/webOS/.test(ua)) {
3778                    o.mobile = 'WebOS';
3779                    m = ua.match(/webOS\/([^\s]*);/);
3780                    if (m && m[1]) {
3781                        o.webos = numberify(m[1]);
3782                    }
3783                }
3784                if (/ Android/.test(ua)) {
3785                    o.mobile = 'Android';
3786                    m = ua.match(/Android ([^\s]*);/);
3787                    if (m && m[1]) {
3788                        o.android = numberify(m[1]);
3789                    }
3790
3791                }
3792                if (/Silk/.test(ua)) {
3793                    m = ua.match(/Silk\/([^\s]*)/);
3794                    if (m && m[1]) {
3795                        o.silk = numberify(m[1]);
3796                    }
3797                    if (!o.android) {
3798                        o.android = 2.34; //Hack for desktop mode in Kindle
3799                        o.os = 'Android';
3800                    }
3801                    if (/Accelerated=true/.test(ua)) {
3802                        o.accel = true;
3803                    }
3804                }
3805            }
3806
3807            m = ua.match(/OPR\/(\d+\.\d+)/);
3808
3809            if (m && m[1]) {
3810                // Opera 15+ with Blink (pretends to be both Chrome and Safari)
3811                o.opera = numberify(m[1]);
3812            } else {
3813                m = ua.match(/(Chrome|CrMo|CriOS)\/([^\s]*)/);
3814
3815                if (m && m[1] && m[2]) {
3816                    o.chrome = numberify(m[2]); // Chrome
3817                    o.safari = 0; //Reset safari back to 0
3818                    if (m[1] === 'CrMo') {
3819                        o.mobile = 'chrome';
3820                    }
3821                } else {
3822                    m = ua.match(/AdobeAIR\/([^\s]*)/);
3823                    if (m) {
3824                        o.air = m[0]; // Adobe AIR 1.0 or better
3825                    }
3826                }
3827            }
3828        }
3829
3830        m = ua.match(/Ubuntu\ (\d+\.\d+)/);
3831        if (m && m[1]) {
3832
3833            o.os = 'linux';
3834            o.ubuntu = numberify(m[1]);
3835
3836            m = ua.match(/\ WebKit\/([^\s]*)/);
3837            if (m && m[1]) {
3838                o.webkit = numberify(m[1]);
3839            }
3840            m = ua.match(/\ Chromium\/([^\s]*)/);
3841            if (m && m[1]) {
3842                o.chrome = numberify(m[1]);
3843            }
3844            if (/ Mobile$/.test(ua)) {
3845                o.mobile = 'Ubuntu';
3846            }
3847        }
3848
3849        if (!o.webkit) { // not webkit
3850// @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)
3851            if (/Opera/.test(ua)) {
3852                m = ua.match(/Opera[\s\/]([^\s]*)/);
3853                if (m && m[1]) {
3854                    o.opera = numberify(m[1]);
3855                }
3856                m = ua.match(/Version\/([^\s]*)/);
3857                if (m && m[1]) {
3858                    o.opera = numberify(m[1]); // opera 10+
3859                }
3860
3861                if (/Opera Mobi/.test(ua)) {
3862                    o.mobile = 'opera';
3863                    m = ua.replace('Opera Mobi', '').match(/Opera ([^\s]*)/);
3864                    if (m && m[1]) {
3865                        o.opera = numberify(m[1]);
3866                    }
3867                }
3868                m = ua.match(/Opera Mini[^;]*/);
3869
3870                if (m) {
3871                    o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316
3872                }
3873            } else { // not opera or webkit
3874                m = ua.match(/MSIE ([^;]*)|Trident.*; rv:([0-9.]+)/);
3875
3876                if (m && (m[1] || m[2])) {
3877                    o.ie = numberify(m[1] || m[2]);
3878                } else { // not opera, webkit, or ie
3879                    m = ua.match(/Gecko\/([^\s]*)/);
3880
3881                    if (m) {
3882                        o.gecko = 1; // Gecko detected, look for revision
3883                        m = ua.match(/rv:([^\s\)]*)/);
3884                        if (m && m[1]) {
3885                            o.gecko = numberify(m[1]);
3886                            if (/Mobile|Tablet/.test(ua)) {
3887                                o.mobile = "ffos";
3888                            }
3889                        }
3890                    }
3891                }
3892            }
3893        }
3894    }
3895
3896    //Check for known properties to tell if touch events are enabled on this device or if
3897    //the number of MSPointer touchpoints on this device is greater than 0.
3898    if (win && nav && !(o.chrome && o.chrome < 6)) {
3899        o.touchEnabled = (("ontouchstart" in win) || (("msMaxTouchPoints" in nav) && (nav.msMaxTouchPoints > 0)));
3900    }
3901
3902    //It was a parsed UA, do not assign the global value.
3903    if (!subUA) {
3904
3905        if (typeof process === 'object') {
3906
3907            if (process.versions && process.versions.node) {
3908                //NodeJS
3909                o.os = process.platform;
3910                o.nodejs = numberify(process.versions.node);
3911            }
3912        }
3913
3914        YUI.Env.UA = o;
3915
3916    }
3917
3918    return o;
3919};
3920
3921
3922Y.UA = YUI.Env.UA || YUI.Env.parseUA();
3923
3924/**
3925Performs a simple comparison between two version numbers, accounting for
3926standard versioning logic such as the fact that "535.8" is a lower version than
3927"535.24", even though a simple numerical comparison would indicate that it's
3928greater. Also accounts for cases such as "1.1" vs. "1.1.0", which are
3929considered equivalent.
3930
3931Returns -1 if version _a_ is lower than version _b_, 0 if they're equivalent,
39321 if _a_ is higher than _b_.
3933
3934Versions may be numbers or strings containing numbers and dots. For example,
3935both `535` and `"535.8.10"` are acceptable. A version string containing
3936non-numeric characters, like `"535.8.beta"`, may produce unexpected results.
3937
3938@method compareVersions
3939@param {Number|String} a First version number to compare.
3940@param {Number|String} b Second version number to compare.
3941@return -1 if _a_ is lower than _b_, 0 if they're equivalent, 1 if _a_ is
3942    higher than _b_.
3943**/
3944Y.UA.compareVersions = function (a, b) {
3945    var aPart, aParts, bPart, bParts, i, len;
3946
3947    if (a === b) {
3948        return 0;
3949    }
3950
3951    aParts = (a + '').split('.');
3952    bParts = (b + '').split('.');
3953
3954    for (i = 0, len = Math.max(aParts.length, bParts.length); i < len; ++i) {
3955        aPart = parseInt(aParts[i], 10);
3956        bPart = parseInt(bParts[i], 10);
3957
3958        /*jshint expr: true*/
3959        isNaN(aPart) && (aPart = 0);
3960        isNaN(bPart) && (bPart = 0);
3961
3962        if (aPart < bPart) {
3963            return -1;
3964        }
3965
3966        if (aPart > bPart) {
3967            return 1;
3968        }
3969    }
3970
3971    return 0;
3972};
3973YUI.Env.aliases = {
3974    "anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],
3975    "anim-shape-transform": ["anim-shape"],
3976    "app": ["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","model-sync-local","router","view","view-node-map"],
3977    "attribute": ["attribute-base","attribute-complex"],
3978    "attribute-events": ["attribute-observable"],
3979    "autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],
3980    "axes": ["axis-numeric","axis-category","axis-time","axis-stacked"],
3981    "axes-base": ["axis-numeric-base","axis-category-base","axis-time-base","axis-stacked-base"],
3982    "base": ["base-base","base-pluginhost","base-build"],
3983    "cache": ["cache-base","cache-offline","cache-plugin"],
3984    "charts": ["charts-base"],
3985    "collection": ["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],
3986    "color": ["color-base","color-hsl","color-harmony"],
3987    "controller": ["router"],
3988    "dataschema": ["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],
3989    "datasource": ["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],
3990    "datatable": ["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"],
3991    "datatype": ["datatype-date","datatype-number","datatype-xml"],
3992    "datatype-date": ["datatype-date-parse","datatype-date-format","datatype-date-math"],
3993    "datatype-number": ["datatype-number-parse","datatype-number-format"],
3994    "datatype-xml": ["datatype-xml-parse","datatype-xml-format"],
3995    "dd": ["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],
3996    "dom": ["dom-base","dom-screen","dom-style","selector-native","selector"],
3997    "editor": ["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],
3998    "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"],
3999    "event-custom": ["event-custom-base","event-custom-complex"],
4000    "event-gestures": ["event-flick","event-move"],
4001    "handlebars": ["handlebars-compiler"],
4002    "highlight": ["highlight-base","highlight-accentfold"],
4003    "history": ["history-base","history-hash","history-html5"],
4004    "io": ["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],
4005    "json": ["json-parse","json-stringify"],
4006    "loader": ["loader-base","loader-rollup","loader-yui3"],
4007    "loader-pathogen-encoder": ["loader-base","loader-rollup","loader-yui3","loader-pathogen-combo
4007handler"],
4008    "node": ["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],
4009    "pluginhost": ["pluginhost-base","pluginhost-config"],
4010    "querystring": ["querystring-parse","querystring-stringify"],
4011    "recordset": ["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],
4012    "resize": ["resize-base","resize-proxy","resize-constrain"],
4013    "slider": ["slider-base","slider-value-range","clickable-rail","range-slider"],
4014    "template": ["template-base","template-micro"],
4015    "text": ["text-accentfold","text-wordbreak"],
4016    "widget": ["widget-base","widget-htmlparser","widget-skin","widget-uievents"]
4017};
4018
4019
4020}, 'patched-v3.18.3', {
4021    "use": [
4022        "yui-base",
4023        "get",
4024        "features",
4025        "intl-base",
4026        "yui-log",
4027        "yui-later",
4028        "loader-base",
4029        "loader-rollup",
4030        "loader-yui3"
4031    ]
4032});
4033YUI.add('get', function (Y, NAME) {
4034
4035/*jslint boss:true, expr:true, laxbreak: true */
4036
4037/**
4038Provides dynamic loading of remote JavaScript and CSS resources.
4039
4040@module get
4041@class Get
4042@static
4043**/
4044
4045var Lang = Y.Lang,
4046
4047    CUSTOM_ATTRS, // defined lazily in Y.Get.Transaction._createNode()
4048
4049    Get, Transaction;
4050
4051Y.Get = Get = {
4052    // -- Public Properties ----------------------------------------------------
4053
4054    /**
4055    Default options for CSS requests. Options specified here will override
4056    global defaults for CSS requests.
4057
4058    See the `options` property for all available options.
4059
4060    @property cssOptions
4061    @type Object
4062    @static
4063    @since 3.5.0
4064    **/
4065    cssOptions: {
4066        attributes: {
4067            rel: 'stylesheet'
4068        },
4069
4070        doc         : Y.config.linkDoc || Y.config.doc,
4071        pollInterval: 50
4072    },
4073
4074    /**
4075    Default options for JS requests. Options specified here will override global
4076    defaults for JS requests.
4077
4078    See the `options` property for all available options.
4079
4080    @property jsOptions
4081    @type Object
4082    @static
4083    @since 3.5.0
4084    **/
4085    jsOptions: {
4086        autopurge: true,
4087        doc      : Y.config.scriptDoc || Y.config.doc
4088    },
4089
4090    /**
4091    Default options to use for all requests.
4092
4093    Note that while all available options are documented here for ease of
4094    discovery, some options (like callback functions) only make sense at the
4095    transaction level.
4096
4097    Callback functions specified via the options object or the `options`
4098    parameter of the `css()`, `js()`, or `load()` methods will receive the
4099    transaction object as a parameter. See `Y.Get.Transaction` for details on
4100    the properties and methods available on transactions.
4101
4102    @static
4103    @since 3.5.0
4104    @property {Object} options
4105
4106    @property {Boolean} [options.async=false] Whether or not to load scripts
4107        asynchronously, meaning they're requested in parallel and execution
4108        order is not guaranteed. Has no effect on CSS, since CSS is always
4109        loaded asynchronously.
4110
4111    @property {Object} [options.attributes] HTML attribute name/value pairs that
4112        should be added to inserted nodes. By default, the `charset` attribute
4113        will be set to "utf-8" and nodes will be given an auto-generated `id`
4114        attribute, but you can override these with your own values if desired.
4115
4116    @property {Boolean} [options.autopurge] Whether or not to automatically
4117        purge inserted nodes after the purge threshold is reached. This is
4118        `true` by default for JavaScript, but `false` for CSS since purging a
4119        CSS node will also remove any styling applied by the referenced file.
4120
4121    @property {Object} [options.context] `this` object to use when calling
4122        callback functions. Defaults to the transaction object.
4123
4124    @property {Mixed} [options.data] Arbitrary data object to pass to "on*"
4125        callbacks.
4126
4127    @property {Document} [options.doc] Document into which nodes should be
4128        inserted. By default, the current document is used.
4129
4130    @property {HTMLElement|String} [options.insertBefore] HTML element or id
4131        string of an element before which all generated nodes should be
4132        inserted. If not specified, Get will automatically determine the best
4133        place to insert nodes for maximum compatibility.
4134
4135    @property {Function} [options.onEnd] Callback to execute after a transaction
4136        is complete, regardless of whether it succeeded or failed.
4137
4138    @property {Function} [options.onFailure] Callback to execute after a
4139        transaction fails, times out, or is aborted.
4140
4141    @property {Function} [options.onProgress] Callback to execute after each
4142        individual request in a transaction either succeeds or fails.
4143
4144    @property {Function} [options.onSuccess] Callback to execute after a
4145        transaction completes successfully with no errors. Note that in browsers
4146        that don't support the `error` event on CSS `<link>` nodes, a failed CSS
4147        request may still be reported as a success because in these browsers
4148        it can be difficult or impossible to distinguish between success and
4149        failure for CSS resources.
4150
4151    @property {Function} [options.onTimeout] Callback to execute after a
4152        transaction times out.
4153
4154    @property {Number} [options.pollInterval=50] Polling interval (in
4155        milliseconds) for detecting CSS load completion in browsers that don't
4156        support the `load` event on `<link>` nodes. This isn't used for
4157        JavaScript.
4158
4159    @property {Number} [options.purgethreshold=20] Number of nodes to insert
4160        before triggering an automatic purge when `autopurge` is `true`.
4161
4162    @property {Number} [options.timeout] Number of milliseconds to wait before
4163        aborting a transaction. When a timeout occurs, the `onTimeout` callback
4164        is called, followed by `onFailure` and finally `onEnd`. By default,
4165        there is no timeout.
4166
4167    @property {String} [options.type] Resource type ("css" or "js"). This option
4168        is set automatically by the `css()` and `js()` functions and will be
4169        ignored there, but may be useful when using the `load()` function. If
4170        not specified, the type will be inferred from the URL, defaulting to
4171        "js" if the URL doesn't contain a recognizable file extension.
4172    **/
4173    options: {
4174        attributes: {
4175            charset: 'utf-8'
4176        },
4177
4178        purgethreshold: 20
4179    },
4180
4181    // -- Protected Properties -------------------------------------------------
4182
4183    /**
4184    Regex that matches a CSS URL. Used to guess the file type when it's not
4185    specified.
4186
4187    @property REGEX_CSS
4188    @type RegExp
4189    @final
4190    @protected
4191    @static
4192    @since 3.5.0
4193    **/
4194    REGEX_CSS: /\.css(?:[?;].*)?$/i,
4195
4196    /**
4197    Regex that matches a JS URL. Used to guess the file type when it's not
4198    specified.
4199
4200    @property REGEX_JS
4201    @type RegExp
4202    @final
4203    @protected
4204    @static
4205    @since 3.5.0
4206    **/
4207    REGEX_JS : /\.js(?:[?;].*)?$/i,
4208
4209    /**
4210    Contains information about the current environment, such as what script and
4211    link injection features it supports.
4212
4213    This object is created and populated the first time the `_getEnv()` method
4214    is called.
4215
4216    @property _env
4217    @type Object
4218    @protected
4219    @static
4220    @since 3.5.0
4221    **/
4222
4223    /**
4224    Mapping of document _yuid strings to <head> or <base> node references so we
4225    don't have to look the node up each time we want to insert a request node.
4226
4227    @property _insertCache
4228    @type Object
4229    @protected
4230    @static
4231    @since 3.5.0
4232    **/
4233    _insertCache: {},
4234
4235    /**
4236    Information about the currently pending transaction, if any.
4237
4238    This is actually an object with two properties: `callback`, containing the
4239    optional callback passed to `css()`, `load()`, or `js()`; and `transaction`,
4240    containing the actual transaction instance.
4241
4242    @property _pending
4243    @type Object
4244    @protected
4245    @static
4246    @since 3.5.0
4247    **/
4248    _pending: null,
4249
4250    /**
4251    HTML nodes eligible to be purged next time autopurge is triggered.
4252
4253    @property _purgeNodes
4254    @type HTMLElement[]
4255    @protected
4256    @static
4257    @since 3.5.0
4258    **/
4259    _purgeNodes: [],
4260
4261    /**
4262    Queued transactions and associated callbacks.
4263
4264    @property _queue
4265    @type Object[]
4266    @protected
4267    @static
4268    @since 3.5.0
4269    **/
4270    _queue: [],
4271
4272    // -- Public Methods -------------------------------------------------------
4273
4274    /**
4275    Aborts the specified transaction.
4276
4277    This will cause the transaction's `onFailure` callback to be called and
4278    will prevent any new script and link nodes from being added to the document,
4279    but any resources that have already been requested will continue loading
4280    (there's no safe way to prevent this, unfortunately).
4281
4282    *Note:* This method is deprecated as of 3.5.0, and will be removed in a
4283    future version of YUI. Use the transaction-level `abort()` method instead.
4284
4285    @method abort
4286    @param {Get.Transaction} transaction Transaction to abort.
4287    @deprecated Use the `abort()` method on the transaction instead.
4288    @static
4289    **/
4290    abort: function (transaction) {
4291        var i, id, item, len, pending;
4292
4293
4294        if (!transaction.abort) {
4295            id          = transaction;
4296            pending     = this._pending;
4297            transaction = null;
4298
4299            if (pending && pending.transaction.id === id) {
4300                transaction   = pending.transaction;
4301                this._pending = null;
4302            } else {
4303                for (i = 0, len = this._queue.length; i < len; ++i) {
4304                    item = this._queue[i].transaction;
4305
4306                    if (item.id === id) {
4307                        transaction = item;
4308                        this._queue.splice(i, 1);
4309                        break;
4310                    }
4311                }
4312            }
4313        }
4314
4315        transaction && transaction.abort();
4316    },
4317
4318    /**
4319    Loads one or more CSS files.
4320
4321    The _urls_ parameter may be provided as a URL string, a request object,
4322    or an array of URL strings and/or request objects.
4323
4324    A request object is just an object that contains a `url` property and zero
4325    or more options that should apply specifically to that request.
4326    Request-specific options take priority over transaction-level options and
4327    default options.
4328
4329    URLs may be relative or absolute, and do not have to have the same origin
4330    as the current page.
4331
4332    The `options` parameter may be omitted completely and a callback passed in
4333    its place, if desired.
4334
4335    @example
4336
4337        // Load a single CSS file and log a message on completion.
4338        Y.Get.css('foo.css', function (err) {
4339            if (err) {
4340            } else {
4341            }
4342        });
4343
4344        // Load multiple CSS files and log a message when all have finished
4345        // loading.
4346        var urls = ['foo.css', 'http://example.com/bar.css', 'baz/quux.css'];
4347
4348        Y.Get.css(urls, function (err) {
4349            if (err) {
4350            } else {
4351            }
4352        });
4353
4354        // Specify transaction-level options, which will apply to all requests
4355        // within the transaction.
4356        Y.Get.css(urls, {
4357            attributes: {'class': 'my-css'},
4358            timeout   : 5000
4359        });
4360
4361        // Specify per-request options, which override transaction-level and
4362        // default options.
4363        Y.Get.css([
4364            {url: 'foo.css', attributes: {id: 'foo'}},
4365            {url: 'bar.css', attributes: {id: 'bar', charset: 'iso-8859-1'}}
4366        ]);
4367
4368    @method css
4369    @param {String|Object|Array}
4369 urls URL string, request object, or array
4370        of URLs and/or request objects to load.
4371    @param {Object} [options] Options for this transaction. See the
4372        `Y.Get.options` property for a complete list of available options.
4373    @param {Function} [callback] Callback function to be called on completion.
4374        This is a general callback and will be called before any more granular
4375        callbacks (`onSuccess`, `onFailure`, etc.) specified in the `options`
4376        object.
4377
4378        @param {Array|null} callback.err Array of errors that occurred during
4379            the transaction, or `null` on success.
4380        @param {Get.Transaction} callback.transaction Transaction object.
4381
4382    @return {Get.Transaction} Transaction object.
4383    @static
4384    **/
4385    css: function (urls, options, callback) {
4386        return this._load('css', urls, options, callback);
4387    },
4388
4389    /**
4390    Loads one or more JavaScript resources.
4391
4392    The _urls_ parameter may be provided as a URL string, a request object,
4393    or an array of URL strings and/or request objects.
4394
4395    A request object is just an object that contains a `url` property and zero
4396    or more options that should apply specifically to that request.
4397    Request-specific options take priority over transaction-level options and
4398    default options.
4399
4400    URLs may be relative or absolute, and do not have to have the same origin
4401    as the current page.
4402
4403    The `options` parameter may be omitted completely and a callback passed in
4404    its place, if desired.
4405
4406    Scripts will be executed in the order they're specified unless the `async`
4407    option is `true`, in which case they'll be loaded in parallel and executed
4408    in whatever order they finish loading.
4409
4410    @example
4411
4412        // Load a single JS file and log a message on completion.
4413        Y.Get.js('foo.js', function (err) {
4414            if (err) {
4415            } else {
4416            }
4417        });
4418
4419        // Load multiple JS files, execute them in order, and log a message when
4420        // all have finished loading.
4421        var urls = ['foo.js', 'http://example.com/bar.js', 'baz/quux.js'];
4422
4423        Y.Get.js(urls, function (err) {
4424            if (err) {
4425            } else {
4426            }
4427        });
4428
4429        // Specify transaction-level options, which will apply to all requests
4430        // within the transaction.
4431        Y.Get.js(urls, {
4432            attributes: {'class': 'my-js'},
4433            timeout   : 5000
4434        });
4435
4436        // Specify per-request options, which override transaction-level and
4437        // default options.
4438        Y.Get.js([
4439            {url: 'foo.js', attributes: {id: 'foo'}},
4440            {url: 'bar.js', attributes: {id: 'bar', charset: 'iso-8859-1'}}
4441        ]);
4442
4443    @method js
4444    @param {String|Object|Array} urls URL string, request object, or array
4445        of URLs and/or request objects to load.
4446    @param {Object} [options] Options for this transaction. See the
4447        `Y.Get.options` property for a complete list of available options.
4448    @param {Function} [callback] Callback function to be called on completion.
4449        This is a general callback and will be called before any more granular
4450        callbacks (`onSuccess`, `onFailure`, etc.) specified in the `options`
4451        object.
4452
4453        @param {Array|null} callback.err Array of errors that occurred during
4454            the transaction, or `null` on success.
4455        @param {Get.Transaction} callback.transaction Transaction object.
4456
4457    @return {Get.Transaction} Transaction object.
4458    @since 3.5.0
4459    @static
4460    **/
4461    js: function (urls, options, callback) {
4462        return this._load('js', urls, options, callback);
4463    },
4464
4465    /**
4466    Loads one or more CSS and/or JavaScript resources in the same transaction.
4467
4468    Use this method when you want to load both CSS and JavaScript in a single
4469    transaction and be notified when all requested URLs have finished loading,
4470    regardless of type.
4471
4472    Behavior and options are the same as for the `css()` and `js()` methods. If
4473    a resource type isn't specified in per-request options or transaction-level
4474    options, Get will guess the file type based on the URL's extension (`.css`
4475    or `.js`, with or without a following query string). If the file type can't
4476    be guessed from the URL, a warning will be logged and Get will assume the
4477    URL is a JavaScript resource.
4478
4479    @example
4480
4481        // Load both CSS and JS files in a single transaction, and log a message
4482        // when all files have finished loading.
4483        Y.Get.load(['foo.css', 'bar.js', 'baz.css'], function (err) {
4484            if (err) {
4485            } else {
4486            }
4487        });
4488
4489    @method load
4490    @param {String|Object|Array}
4490 urls URL string, request object, or array
4491        of URLs and/or request objects to load.
4492    @param {Object} [options] Options for this transaction. See the
4493        `Y.Get.options` property for a complete list of available options.
4494    @param {Function} [callback] Callback function to be called on completion.
4495        This is a general callback and will be called before any more granular
4496        callbacks (`onSuccess`, `onFailure`, etc.) specified in the `options`
4497        object.
4498
4499        @param {Array|null} err Array of errors that occurred during the
4500            transaction, or `null` on success.
4501        @param {Get.Transaction} Transaction object.
4502
4503    @return {Get.Transaction} Transaction object.
4504    @since 3.5.0
4505    @static
4506    **/
4507    load: function (urls, options, callback) {
4508        return this._load(null, urls, options, callback);
4509    },
4510
4511    // -- Protected Methods ----------------------------------------------------
4512
4513    /**
4514    Triggers an automatic purge if the purge threshold has been reached.
4515
4516    @method _autoPurge
4517    @param {Number} threshold Purge threshold to use, in milliseconds.
4518    @protected
4519    @since 3.5.0
4520    @static
4521    **/
4522    _autoPurge: function (threshold) {
4523        if (threshold && this._purgeNodes.length >= threshold) {
4524            this._purge(this._purgeNodes);
4525        }
4526    },
4527
4528    /**
4529    Populates the `_env` property with information about the current
4530    environment.
4531
4532    @method _getEnv
4533    @return {Object} Environment information.
4534    @protected
4535    @since 3.5.0
4536    @static
4537    **/
4538    _getEnv: function () {
4539        var doc = Y.config.doc,
4540            ua  = Y.UA;
4541
4542        // Note: some of these checks require browser sniffs since it's not
4543        // feasible to load test files on every pageview just to perform a
4544        // feature test. I'm sorry if this makes you sad.
4545        return (this._env = {
4546
4547            // True if this is a browser that supports disabling async mode on
4548            // dynamically created script nodes. See
4549            // https://developer.mozilla.org/En/HTML/Element/Script#Attributes
4550
4551            // IE10 doesn't return true for the MDN feature test, so setting it explicitly,
4552            // because it is async by default, and allows you to disable async by setting it to false
4553            async: (doc && doc.createElement('script').async === true) || (ua.ie >= 10),
4554
4555            // True if this browser fires an event when a dynamically injected
4556            // link node fails to load. This is currently true for Firefox 9+
4557            // and WebKit 535.24+
4558            cssFail: ua.gecko >= 9 || ua.compareVersions(ua.webkit, 535.24) >= 0,
4559
4560            // True if this browser fires an event when a dynamically injected
4561            // link node finishes loading. This is currently true for IE, Opera,
4562            // Firefox 9+, and WebKit 535.24+. Note that IE versions <9 fire the
4563            // DOM 0 "onload" event, but not "load". All versions of IE fire
4564            // "onload".
4565            // davglass: Seems that Chrome on Android needs this to be false.
4566            cssLoad: (
4567                    (!ua.gecko && !ua.webkit) || ua.gecko >= 9 ||
4568                    ua.compareVersions(ua.webkit, 535.24) >= 0
4569                ) && !(ua.chrome && ua.chrome <= 18),
4570
4571            // True if this browser preserves script execution order while
4572            // loading scripts in parallel as long as the script node's `async`
4573            // attribute is set to false to explicitly disable async execution.
4574            preservesScriptOrder: !!(ua.gecko || ua.opera || (ua.ie && ua.ie >= 10))
4575        });
4576    },
4577
4578    _getTransaction: function (urls, options) {
4579        var requests = [],
4580            i, len, req, url;
4581
4582        if (!Lang.isArray(urls)) {
4583            urls = [urls];
4584        }
4585
4586        options = Y.merge(this.options, options);
4587
4588        // Clone the attributes object so we don't end up modifying it by ref.
4589        options.attributes = Y.merge(this.options.attributes,
4590                options.attributes);
4591
4592        for (i = 0, len = urls.length; i < len; ++i) {
4593            url = urls[i];
4594            req = {attributes: {}};
4595
4596            // If `url` is a string, we create a URL object for it, then mix in
4597            // global options and request-specific options. If it's an object
4598            // with a "url" property, we assume it's a request object c
4598ontaining
4599            // URL-specific options.
4600            if (typeof url === 'string') {
4601                req.url = url;
4602            } else if (url.url) {
4603                // URL-specific options override both global defaults and
4604                // request-specific options.
4605                Y.mix(req, url, false, null, 0, true);
4606                url = url.url; // Make url a string so we can use it later.
4607            } else {
4608                continue;
4609            }
4610
4611            Y.mix(req, options, false, null, 0, true);
4612
4613            // If we didn't get an explicit type for this URL either in the
4614            // request options or the URL-specific options, try to determine
4615            // one from the file extension.
4616            if (!req.type) {
4617                if (this.REGEX_CSS.test(url)) {
4618                    req.type = 'css';
4619                } else {
4620                    if (!this.REGEX_JS.test(url)) {
4621                    }
4622
4623                    req.type = 'js';
4624                }
4625            }
4626
4627            // Mix in type-specific default options, but don't overwrite any
4628            // options that have already been set.
4629            Y.mix(req, req.type === 'js' ? this.jsOptions : this.cssOptions,
4630                false, null, 0, true);
4631
4632            // Give the node an id attribute if it doesn't already have one.
4633            req.attributes.id || (req.attributes.id = Y.guid());
4634
4635            // Backcompat for <3.5.0 behavior.
4636            if (req.win) {
4637                req.doc = req.win.document;
4638            } else {
4639                req.win = req.doc.defaultView || req.doc.parentWindow;
4640            }
4641
4642            if (req.charset) {
4643                req.attributes.charset = req.charset;
4644            }
4645
4646            requests.push(req);
4647        }
4648
4649        return new Transaction(requests, options);
4650    },
4651
4652    _load: function (type, urls, options, callback) {
4653        var transaction;
4654
4655        // Allow callback as third param.
4656        if (typeof options === 'function') {
4657            callback = options;
4658            options  = {};
4659        }
4660
4661        options || (options = {});
4662        options.type = type;
4663
4664        options._onFinish = Get._onTransactionFinish;
4665
4666        if (!this._env) {
4667            this._getEnv();
4668        }
4669
4670        transaction = this._getTransaction(urls, options);
4671
4672        this._queue.push({
4673            callback   : callback,
4674            transaction: transaction
4675        });
4676
4677        this._next();
4678
4679        return transaction;
4680    },
4681
4682    _onTransactionFinish : function() {
4683        Get._pending = null;
4684        Get._next();
4685    },
4686
4687    _next: function () {
4688        var item;
4689
4690        if (this._pending) {
4691            return;
4692        }
4693
4694        item = this._queue.shift();
4695
4696        if (item) {
4697            this._pending = item;
4698            item.transaction.execute(item.callback);
4699        }
4700    },
4701
4702    _purge: function (nodes) {
4703        var purgeNodes    = this._purgeNodes,
4704            isTransaction = nodes !== purgeNodes,
4705            index, node;
4706
4707        while (node = nodes.pop()) { // assignment
4708            // Don't purge nodes that haven't finished loading (or errored out),
4709            // since this can hang the transaction.
4710            if (!node._yuiget_finished) {
4711                continue;
4712            }
4713
4714            node.parentNode && node.parentNode.removeChild(node);
4715
4716            // If this is a transaction-level purge and this node also exists in
4717            // the Get-level _purgeNodes array, we need to remove it from
4718            // _purgeNodes to avoid creating a memory leak. The indexOf lookup
4719            // sucks, but until we get WeakMaps, this is the least troublesome
4720            // way to do this (we can't just hold onto node ids because they may
4721            // not be in the same document).
4722            if (isTransaction) {
4723                index = Y.Array.indexOf(purgeNodes, node);
4724
4725                if (index > -1) {
4726                    purgeNodes.splice(index, 1);
4727                }
4728            }
4729        }
4730    }
4731};
4732
4733/**
4734Alias for `js()`.
4735
4736@method script
4737@static
4738**/
4739Get.script = Get.js;
4740
4741/**
4742Represents a Get transaction, which may contain requests for one or more JS or
4743CSS files.
4744
4745This class should not be instantiated manually. Instances will be created and
4746returned as needed by Y.Get's `css()`, `js()`, and `load()` methods.
4747
4748@class Get.Transaction
4749@constructor
4750@since 3.5.0
4751**/
4752Get.Transaction = Transaction = function (requests, options) {
4753    var self = this;
4754
4755    self.id       = Transaction._lastId += 1;
4756    self.data     = options.data;
4757    self.errors   = [];
4758    self.nodes    = [];
4759    self.options  = options;
4760    self.requests = requests;
4761
4762    self._callbacks = []; // callbacks to call after execution finishes
4763    self._queue     = [];
4764    self._reqsWaiting   = 0;
4765
4766    // Deprecated pre-3.5.0 properties.
4767    self.tId = self.id; // Use `id` instead.
4768    self.win = options.win || Y.config.win;
4769};
4770
4771/**
4772Arbitrary data object associated with this transaction.
4773
4774This object comes from the options passed to `Get.css()`, `Get.js()`, or
4775`Get.load()`, and will be `undefined` if no data object was specified.
4776
4777@property {Object} data
4778**/
4779
4780/**
4781Array of errors that have occurred during this transaction, if any. Each error
4782object has the following properties:
4783`errors.error`: Error message.
4784`errors.request`: Request object related to the error.
4785
4786@since 3.5.0
4787@property {Object[]} errors
4788**/
4789
4790/**
4791Numeric id for this transaction, unique among all transactions within the same
4792YUI sandbox in the current pageview.
4793
4794@property {Number} id
4795@since 3.5.0
4796**/
4797
4798/**
4799HTMLElement nodes (native ones, not YUI Node instances) that have been inserted
4800during the current transaction.
4801
4802@property {HTMLElement[]} nodes
4803**/
4804
4805/**
4806Options associated with this transaction.
4807
4808See `Get.options` for the full list of available options.
4809
4810@property {Object} options
4811@since 3.5.0
4812**/
4813
4814/**
4815Request objects contained in this transaction. Each request object represents
4816one CSS or JS URL that will be (or has been) requested and loaded into the page.
4817
4818@property {Object} requests
4819@since 3.5.0
4820**/
4821
4822/**
4823Id of the most recent transaction.
4824
4825@property _lastId
4826@type Number
4827@protected
4828@static
4829**/
4830Transaction._lastId = 0;
4831
4832Transaction.prototype = {
4833    // -- Public Properties ----------------------------------------------------
4834
4835    /**
4836    Current state of this transaction. One of "new", "executing", or "done".
4837
4838    @property _state
4839    @type String
4840    @protected
4841    **/
4842    _state: 'new', // "new", "executing", or "done"
4843
4844    // -- Public Methods -------------------------------------------------------
4845
4846    /**
4847    Aborts this transaction.
4848
4849    This will cause the transaction's `onFailure` callback to be called and
4850    will prevent any new script and link nodes from being added to the document,
4851    but any resources that have already been requested will continue loading
4852    (there's no safe way to prevent this, unfortunately).
4853
4854    @method abort
4855    @param {String} [msg="Aborted."] Optional message to use in the `errors`
4856        array describing why the transaction was aborted.
4857    **/
4858    abort: function (msg) {
4859        this._pending    = null;
4860        this._pendingCSS = null;
4861        this._pollTimer  = clearTimeout(this._pollTimer);
4862        this._queue      = [];
4863        this._reqsWaiting    = 0;
4864
4865        this.errors.push({error: msg || 'Aborted'});
4866        this._finish();
4867    },
4868
4869    /**
4870    Begins execting the transaction.
4871
4872    There's usually no reason to call this manually, since Get will call it
4873    automatically when other pending transactions have finished. If you really
4874    want to execute your transaction before Get does, you can, but be aware that
4875    this transaction's scripts may end up executing before the scripts in other
4876    pending transactions.
4877
4878    If the transaction is already executing, the specified callback (if any)
4879    will be queued and called after execution finishes. If the transaction has
4880    already finished, the callback will be called immediately (the transaction
4881    will not be executed again).
4882
4883    @method execute
4884    @param {Function} callback Callback function to execute after all requests
4885        in the transaction are complete, or after the transaction is aborted.
4886    **/
4887    execute: function (callback) {
4888        var self     = this,
4889            requests = self.requests,
4890            state    = self._state,
4891            i, len, queue, req;
4892
4893        if (state === 'done') {
4894            callback && callback(self.errors.length ? self.errors : null, self);
4895            return;
4896        } else {
4897            callback && self._callbacks.push(callback);
4898
4899            if (state === 'executing') {
4900                return;
4901            }
4902        }
4903
4904        self._state = 'executing';
4905        self._queue = queue = [];
4906
4907        if (self.options.timeout) {
4908            self._timeout = setTimeout(function () {
4909                self.abort('Timeout');
4910            }, self.options.timeout);
4911        }
4912
4913        self._reqsWaiting = requests.length;
4914
4915        for (i = 0, len = requests.length; i < len; ++i) {
4916            req = requests[i];
4917
4918            if (req.async || req.type === 'css') {
4919                // No need to queue CSS or fully async JS.
4920                self._insert(req);
4921            } else {
4922                queue.push(req);
4923            }
4924        }
4925
4926        self._next();
4927    },
4928
4929    /**
4930    Manually purges any `<script>` or `<link>` nodes this transaction has
4931    created.
4932
4933    Be careful when purging a transaction that contains CSS requests, since
4934    removing `<link>` nodes will also remove any styles they applied.
4935
4936    @method purge
4937    **/
4938    purge: function () {
4939        Get._purge(this.nodes);
4940    },
4941
4942    // -- Protected Methods ----------------------------------------------------
4943    _createNode: function (name, attrs, doc) {
4944        var node = doc.createElement(name),
4945            attr, testEl;
4946
4947        if (!CUSTOM_ATTRS) {
4948            // IE6 and IE7 expect property names rather than attribute names for
4949            // certain attributes. Rather than sniffing, we do a quick feature
4950            // test the first time _createNode() runs to determine whether we
4951            // need to provide a workaround.
4952            testEl = doc.createElement('div');
4953            testEl.setAttribute('class', 'a');
4954
4955            CUSTOM_ATTRS = testEl.className === 'a' ? {} : {
4956                'for'  : 'htmlFor',
4957                'class': 'className'
4958            };
4959        }
4960
4961        for (attr in attrs) {
4962            if (attrs.hasOwnProperty(attr)) {
4963                node.setAttribute(CUSTOM_ATTRS[attr] || attr, attrs[attr]);
4964            }
4965        }
4966
4967        return node;
4968    },
4969
4970    _finish: function () {
4971        var errors  = this.errors.length ? this.errors : null,
4972            options = this.options,
4973            thisObj = options.context || this,
4974            data, i, len;
4975
4976        if (this._state === 'done') {
4977            return;
4978        }
4979
4980        this._state = 'done';
4981
4982        for (i = 0, len = this._callbacks.length; i < len; ++i) {
4983            this._callbacks[i].call(thisObj, errors, this);
4984        }
4985
4986        data = this._getEventData();
4987
4988        if (errors) {
4989            if (options.onTimeout && errors[errors.length - 1].error === 'Timeout') {
4990                options.onTimeout.call(thisObj, data);
4991            }
4992
4993            if (options.onFailure) {
4994                options.onFailure.call(thisObj, data);
4995            }
4996        } else if (options.onSuccess) {
4997            options.onSuccess.call(thisObj, data);
4998        }
4999
5000        if (options.onEnd) {
5001            options.onEnd.call(thisObj, data);
5002        }
5003
5004        if (options._onFinish) {
5005            options._onFinish();
5006        }
5007    },
5008
5009    _getEventData: function (req) {
5010        if (req) {
5011            // This merge is necessary for backcompat. I hate it.
5012            return Y.merge(this, {
5013                abort  : this.abort, // have to copy these because the prototype isn't preserved
5014                purge  : this.purge,
5015                request: req,
5016                url    : req.url,
5017                win    : req.win
5018            });
5019        } else {
5020            return this;
5021        }
5022    },
5023
5024    _getInsertBefore: function (req) {
5025        var doc = req.doc,
5026            el  = req.insertBefore,
5027            cache, docStamp;
5028
5029        if (el) {
5030            return typeof el === 'string' ? doc.getElementById(el) : el;
5031        }
5032
5033        cache    = Get._insertCache;
5034        docStamp = Y.stamp(doc);
5035
5036        if ((el = cache[docStamp])) { // assignment
5037            return el;
5038        }
5039
5040        // Inserting before a <base> tag apparently works around an IE bug
5041        // (according to a comment from pre-3.5.0 Y.Get), but I'm not sure what
5042        // bug that is, exactly. Better safe than sorry?
5043        if ((el = doc.getElementsByTagName('base')[0])) { // assignment
5044            return (cache[docStamp] = el);
5045        }
5046
5047        // Look for a <head> element.
5048        el = doc.head || doc.getElementsByTagName('head')[0];
5049
5050        if (el) {
5051            // Create a marker node at the end of <head> to use as an insertion
5052            // point. Inserting before this node will ensure that all our CSS
5053            // gets inserted in the correct order, to maintain style precedence.
5054            el.appendChild(doc.createTextNode(''));
5055            return (cache[docStamp] = el.lastChild);
5056        }
5057
5058        // If all else fails, just insert before the first script node on the
5059        // page, which is virtually guaranteed to exist.
5060        return (cache[docStamp] = doc.getElementsByTagName('script')[0]);
5061    },
5062
5063    _insert: function (req) {
5064        var env          = Get._env,
5065            insertBefore = this._getInsertBefore(req),
5066            isScript     = req.type === 'js',
5067            node         = req.node,
5068            self         = this,
5069            ua           = Y.UA,
5070            cssTimeout, nodeType;
5071
5072        if (!node) {
5073            if (isScript) {
5074                nodeType = 'script';
5075            } else if (!env.cssLoad && ua.gecko) {
5076                nodeType = 'style';
5077            } else {
5078                nodeType = 'link';
5079                delete req.attributes['charset'];
5080            }
5081
5082            node = req.node = this._createNode(nodeType, req.attributes,
5083                req.doc);
5084        }
5085
5086        function onError() {
5087            self._progress('Failed to load ' + req.url, req);
5088        }
5089
5090        function onLoad() {
5091            if (cssTimeout) {
5092                clearTimeout(cssTimeout);
5093            }
5094
5095            self._progress(null, req);
5096        }
5097
5098        // Deal with script asynchronicity.
5099        if (isScript) {
5100            node.setAttribute('src', req.url);
5101
5102            if (req.async) {
5103                // Explicitly indicate that we want the browser to execute this
5104                // script asynchronously. This is necessary for older browsers
5105                // like Firefox <4.
5106                node.async = true;
5107            } else {
5108                if (env.async) {
5109                    // This browser treats injected scripts as async by default
5110                    // (standard HTML5 behavior) but asynchronous loading isn't
5111                    // desired, so tell the browser not to mark this script as
5112                    // async.
5113                    node.async = false;
5114                }
5115
5116                // If this browser doesn't preserve script execution order based
5117                // on insertion order, we'll need to avoid inserting other
5118                // scripts until this one finishes loading.
5119                if (!env.preservesScriptOrder) {
5120                    this._pending = req;
5121                }
5122            }
5123        } else {
5124            if (!env.cssLoad && ua.gecko) {
5125                // In Firefox <9, we can import the requested URL into a <style>
5126                // node and poll for the existence of node.sheet.cssRules. This
5127                // gives us a reliable way to determine CSS load completion that
5128                // also works for cross-domain stylesheets.
5129                //
5130                // Props to Zach Leatherman for calling my attention to this
5131                // technique.
5132                node.innerHTML = (req.attributes.charset ?
5133                    '@charset "' + req.attributes.charset + '";' : '') +
5134                    '@import "' + req.url + '";';
5135            } else {
5136                node.setAttribute('href', req.url);
5137            }
5138        }
5139
5140        // Inject the node.
5141        if (isScript && ua.ie && (ua.ie < 9 || (document.documentMode && document.documentMode < 9))) {
5142            // Script on IE < 9, and IE 9+ when in IE 8 or older modes, including quirks mode.
5143            node.onreadystatechange = function () {
5144                if (/loaded|complete/.test(node.readyState)) {
5145                    node.onreadystatechange = null;
5146                    onLoad();
5147                }
5148            };
5149        } else if (!isScript && !env.cssLoad) {
5150            // CSS on Firefox <9 or WebKit.
5151            this._poll(req);
5152        } else {
5153            // Script or CSS on everything else. Using DOM 0 events because that
5154            // evens the playing field with older IEs.
5155
5156            if (ua.ie >= 10) {
5157
5158                // We currently need to introduce a timeout for IE10, since it
5159                // calls onerror/onload synchronously for 304s - messing up existing
5160                // program flow.
5161
5162                // Remove this block if the following bug gets fixed by GA
5163                /*jshint maxlen: 1500 */
5164                // https://connect.microsoft.com/IE/feedback/details/763871/dynamically-loaded-scripts-with-304s-responses-interrupt-the-currently-executing-js-thread-onload
5165                node.onerror = function() { setTimeout(onError, 0); };
5166                node.onload  = function() { setTimeout(onLoad, 0); };
5167            } else {
5168                node.onerror = onError;
5169                node.onload  = onLoad;
5170            }
5171
5172            // If this browser doesn't fire an event when CSS fails to load,
5173            // fail after a timeout to avoid blocking the transaction queue.
5174            if (!env.cssFail && !isScript) {
5175                cssTimeout = setTimeout(onError, req.timeout || 3000);
5176            }
5177        }
5178
5179        this.nodes.push(node);
5180        insertBefore.parentNode.insertBefore(node, insertBefore);
5181    },
5182
5183    _next: function () {
5184        if (this._pending) {
5185            return;
5186        }
5187
5188        // If there are requests in the queue, insert the next queued request.
5189        // Otherwise, if we're waiting on already-inserted requests to finish,
5190        // wait longer. If there are no queued requests and we're not waiting
5191        // for anything to load, then we're done!
5192        if (this._queue.length) {
5193            this._insert(this._queue.shift());
5194        } else if (!this._reqsWaiting) {
5195            this._finish();
5196        }
5197    },
5198
5199    _poll: function (newReq) {
5200        var self       = this,
5201            pendingCSS = self._pendingCSS,
5202            isWebKit   = Y.UA.webkit,
5203            i, hasRules, j, nodeHref, req, sheets;
5204
5205        if (newReq) {
5206            pendingCSS || (pendingCSS = self._pendingCSS = []);
5207            pendingCSS.push(newReq);
5208
5209            if (self._pollTimer) {
5210                // A poll timeout is already pending, so no need to create a
5211                // new one.
5212                return;
5213            }
5214        }
5215
5216        self._pollTimer = null;
5217
5218        // Note: in both the WebKit and Gecko hacks below, a CSS URL that 404s
5219        // will still be treated as a success. There's no good workaround for
5220        // this.
5221
5222        for (i = 0; i < pendingCSS.length; ++i) {
5223            req = pendingCSS[i];
5224
5225            if (isWebKit) {
5226                // Look for a stylesheet matching the pending URL.
5227                sheets   = req.doc.styleSheets;
5228                j        = sheets.length;
5229                nodeHref = req.node.href;
5230
5231                while (--j >= 0) {
5232                    if (sheets[j].href === nodeHref) {
5233                        pendingCSS.splice(i, 1);
5234                        i -= 1;
5235                        self._progress(null, req);
5236                        break;
5237                    }
5238                }
5239            } else {
5240                // Many thanks to Zach Leatherman for calling my attention to
5241                // the @import-based cross-domain technique used here, and to
5242                // Oleg Slobodskoi for an earlier same-domain implementation.
5243                //
5244                // See Zach's blog for more details:
5245                // http://www.zachleat.com/web/2010/07/29/load-css-dynamically/
5246                try {
5247                    // We don't really need to store this value since we never
5248                    // use it again, but if we don't store it, Closure Compiler
5249                    // assumes the code is useless and removes it.
5250                    hasRules = !!req.node.sheet.cssRules;
5251
5252                    // If we get here, the stylesheet has loaded.
5253                    pendingCSS.splice(i, 1);
5254                    i -= 1;
5255                    self._progress(null, req);
5256                } catch (ex) {
5257                    // An exception means the stylesheet is still loading.
5258                }
5259            }
5260        }
5261
5262        if (pendingCSS.length) {
5263            self._pollTimer = setTimeout(function () {
5264                self._poll.call(self);
5265            }, self.options.pollInterval);
5266        }
5267    },
5268
5269    _progress: function (err, req) {
5270        var options = this.options;
5271
5272        if (err) {
5273            req.error = err;
5274
5275            this.errors.push({
5276                error  : err,
5277                request: req
5278            });
5279
5280        }
5281
5282        req.node._yuiget_finished = req.finished = true;
5283
5284        if (options.onProgress) {
5285            options.onProgress.call(options.context || this,
5286                this._getEventData(req));
5287        }
5288
5289        if (req.autopurge) {
5290            // Pre-3.5.0 Get always excludes the most recent node from an
5291            // autopurge. I find this odd, but I'm keeping that behavior for
5292            // the sake of backcompat.
5293            Get._autoPurge(this.options.purgethreshold);
5294            Get._purgeNodes.push(req.node);
5295        }
5296
5297        if (this._pending === req) {
5298            this._pending = null;
5299        }
5300
5301        this._reqsWaiting -= 1;
5302
5303        this._next();
5304    }
5305};
5306
5307
5308}, 'patched-v3.18.3', {"requires": ["yui-base"]});
5309YUI.add('features', function (Y, NAME) {
5310
5311var feature_tests = {};
5312
5313/**
5314Contains the core of YUI's feature test architecture.
5315@module features
5316*/
5317
5318/**
5319* Feature detection
5320* @class Features
5321* @static
5322*/
5323
5324Y.mix(Y.namespace('Features'), {
5325
5326    /**
5327    * Object hash of all registered feature tests
5328    * @property tests
5329    * @type Object
5330    */
5331    tests: feature_tests,
5332
5333    /**
5334    * Add a test to the system
5335    *
5336    *   ```
5337    *   Y.Features.add("load", "1", {});
5338    *   ```
5339    *
5340    * @method add
5341    * @param {String} cat The category, right now only 'load' is supported
5342    * @param {String} name The number sequence of the test, how it's reported in the URL or config: 1, 2, 3
5343    * @param {Object} o Object containing test properties
5344    * @param {String} o.name The name of the test
5345    * @param {Function} o.test The test function to execute, the only argument to the function is the `Y` instance
5346    * @param {String} o.trigger The module that triggers this test.
5347    */
5348    add: function(cat, name, o) {
5349        feature_tests[cat] = feature_tests[cat] || {};
5350        feature_tests[cat][name] = o;
5351    },
5352    /**
5353    * Execute all tests of a given category and return the serialized results
5354    *
5355    *   ```
5356    *   caps=1:1;2:1;3:0
5357    *   ```
5358    * @method all
5359    * @param {String} cat The category to execute
5360    * @param {Array} args The arguments to pass to the test function
5361    * @return {String} A semi-colon separated string of tests and their success/failure: 1:1;2:1;3:0
5362    */
5363    all: function(cat, args) {
5364        var cat_o = feature_tests[cat],
5365            // results = {};
5366            result = [];
5367        if (cat_o) {
5368            Y.Object.each(cat_o, function(v, k) {
5369                result.push(k + ':' + (Y.Features.test(cat, k, args) ? 1 : 0));
5370            });
5371        }
5372
5373        return (result.length) ? result.join(';') : '';
5374    },
5375    /**
5376    * Run a specific test and return a Boolean response.
5377    *
5378    *   ```
5379    *   Y.Features.test("load", "1");
5380    *   ```
5381    *
5382    * @method test
5383    * @param {String} cat The category of the test to run
5384    * @param {String} name The name of the test to run
5385    * @param {Array} args The arguments to pass to the test function
5386    * @return {Boolean} True or false if the test passed/failed.
5387    */
5388    test: function(cat, name, args) {
5389        args = args || [];
5390        var result, ua, test,
5391            cat_o = feature_tests[cat],
5392            feature = cat_o && cat_o[name];
5393
5394        if (!feature) {
5395        } else {
5396
5397            result = feature.result;
5398
5399            if (Y.Lang.isUndefined(result)) {
5400
5401                ua = feature.ua;
5402                if (ua) {
5403                    result = (Y.UA[ua]);
5404                }
5405
5406                test = feature.test;
5407                if (test && ((!ua) || result)) {
5408                    result = test.apply(Y, args);
5409                }
5410
5411                feature.result = result;
5412            }
5413        }
5414
5415        return result;
5416    }
5417});
5418
5419// Y.Features.add("load", "1", {});
5420// Y.Features.test("load", "1");
5421// caps=1:1;2:0;3:1;
5422
5423/* This file is auto-generated by (yogi loader --yes --mix --start ../) */
5424/*jshint maxlen:900, eqeqeq: false */
5425var add = Y.Features.add;
5426// app-transitions-native
5427add('load', '0', {
5428    "name": "app-transitions-native",
5429    "test": function (Y) {
5430    var doc  = Y.config.doc,
5431        node = doc ? doc.documentElement : null;
5432
5433    if (node && node.style) {
5434        return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);
5435    }
5436
5437    return false;
5438},
5439    "trigger": "app-transitions"
5440});
5441// autocomplete-list-keys
5442add('load', '1', {
5443    "name": "autocomplete-list-keys",
5444    "test": function (Y) {
5445    // Only add keyboard support to autocomplete-list if this doesn't appear to
5446    // be an iOS or Android-based mobile device.
5447    //
5448    // There's currently no feasible way to actually detect whether a device has
5449    // a hardware keyboard, so this sniff will have to do. It can easily be
5450    // overridden by manually loading the autocomplete-list-keys module.
5451    //
5452    // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari
5453    // doesn't fire the keyboard events used by AutoCompleteList, so there's
5454    // no point loading the -keys module even when a bluetooth keyboard may be
5455    // available.
5456    return !(Y.UA.ios || Y.UA.android);
5457},
5458    "trigger": "autocomplete-list"
5459});
5460// dd-gestures
5461add('load', '2', {
5462    "name": "dd-gestures",
5463    "trigger": "dd-drag",
5464    "ua": "touchEnabled"
5465});
5466// dom-style-ie
5467add('load', '3', {
5468    "name": "dom-style-ie",
5469    "test": function (Y) {
5470
5471    var testFeature = Y.Features.test,
5472        addFeature = Y.Features.add,
5473        WINDOW = Y.config.win,
5474        DOCUMENT = Y.config.doc,
5475        DOCUMENT_ELEMENT = 'documentElement',
5476        ret = false;
5477
5478    addFeature('style', 'computedStyle', {
5479        test: function() {
5480            return WINDOW && 'getComputedStyle' in WINDOW;
5481        }
5482    });
5483
5484    addFeature('style', 'opacity', {
5485        test: function() {
5486            return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style;
5487        }
5488    });
5489
5490    ret =  (!testFeature('style', 'opacity') &&
5491            !testFeature('style', 'computedStyle'));
5492
5493    return ret;
5494},
5495    "trigger": "dom-style"
5496});
5497// editor-para-ie
5498add('load', '4', {
5499    "name": "editor-para-ie",
5500    "trigger": "editor-para",
5501    "ua": "ie",
5502    "when": "instead"
5503});
5504// event-base-ie
5505add('load', '5', {
5506    "name": "event-base-ie",
5507    "test": function(Y) {
5508    var imp = Y.config.doc && Y.config.doc.implementation;
5509    return (imp && (!imp.hasFeature('Events', '2.0')));
5510},
5511    "trigger": "node-base"
5512});
5513// graphics-canvas
5514add('load', '6', {
5515    "name": "graphics-canvas",
5516    "test": function(Y) {
5517    var DOCUMENT = Y.config.doc,
5518        useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas",
5519		canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
5520        svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
5521    return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d"));
5522},
5523    "trigger": "graphics"
5524});
5525// graphics-canvas-default
5526add('load', '7', {
5527    "name": "graphics-canvas-default",
5528    "test": function(Y) {
5529    var DOCUMENT = Y.config.doc,
5530        useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas",
5531		canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
5532        svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
5533    return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d"));
5534},
5535    "trigger": "graphics"
5536});
5537// graphics-svg
5538add('load', '8', {
5539    "name": "graphics-svg",
5540    "test": function(Y) {
5541    var DOCUMENT = Y.config.doc,
5542        useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas",
5543		canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
5544        svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
5545
5546    return svg && (useSVG || !canvas);
5547},
5548    "trigger": "graphics"
5549});
5550// graphics-svg-default
5551add('load', '9', {
5552    "name": "graphics-svg-default",
5553    "test": function(Y) {
5554    var DOCUMENT = Y.config.doc,
5555        useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas",
5556		canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
5557        svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
5558
5559    return svg && (useSVG || !canvas);
5560},
5561    "trigger": "graphics"
5562});
5563// graphics-vml
5564add('load', '10', {
5565    "name": "graphics-vml",
5566    "test": function(Y) {
5567    var DOCUMENT = Y.config.doc,
5568		canvas = DOCUMENT && DOCUMENT.createElement("canvas");
5569    return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
5570},
5571    "trigger": "graphics"
5572});
5573// graphics-vml-default
5574add('load', '11', {
5575    "name": "graphics-vml-default",
5576    "test": function(Y) {
5577    var DOCUMENT = Y.config.doc,
5578		canvas = DOCUMENT && DOCUMENT.createElement("canvas");
5579    return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
5580},
5581    "trigger": "graphics"
5582});
5583// history-hash-ie
5584add('load', '12', {
5585    "name": "history-hash-ie",
5586    "test": function (Y) {
5587    var docMode = Y.config.doc && Y.config.doc.documentMode;
5588
5589    return Y.UA.ie && (!('onhashchange' in Y.config.win) ||
5590            !docMode || docMode < 8);
5591},
5592    "trigger": "history-hash"
5593});
5594// io-nodejs
5595add('load', '13', {
5596    "name": "io-nodejs",
5597    "trigger": "io-base",
5598    "ua": "nodejs"
5599});
5600// json-parse-shim
5601add('load', '14', {
5602    "name": "json-parse-shim",
5603    "test": function (Y) {
5604    var _JSON = Y.config.global.JSON,
5605        Native = Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON,
5606        nativeSupport = Y.config.useNativeJSONParse !== false && !!Native;
5607
5608    function workingNative( k, v ) {
5609        return k === "ok" ? true : v;
5610    }
5611
5612    // Double check basic functionality.  This is mainly to catch early broken
5613    // implementations of the JSON API in Firefox 3.1 beta1 and beta2
5614    if ( nativeSupport ) {
5615        try {
5616            nativeSupport = ( Native.parse( '{"ok":false}', workingNative ) ).ok;
5617        }
5618        catch ( e ) {
5619            nativeSupport = false;
5620        }
5621    }
5622
5623    return !nativeSupport;
5624},
5625    "trigger": "json-parse"
5626});
5627// json-stringify-shim
5628add('load', '15', {
5629    "name": "json-stringify-shim",
5630    "test": function (Y) {
5631    var _JSON = Y.config.global.JSON,
5632        Native = Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON,
5633        nativeSupport = Y.config.useNativeJSONStringify !== false && !!Native;
5634
5635    // Double check basic native functionality.  This is primarily to catch broken
5636    // early JSON API implementations in Firefox 3.1 beta1 and beta2.
5637    if ( nativeSupport ) {
5638        try {
5639            nativeSupport = ( '0' === Native.stringify(0) );
5640        } catch ( e ) {
5641            nativeSupport = false;
5642        }
5643    }
5644
5645
5646    return !nativeSupport;
5647},
5648    "trigger": "json-stringify"
5649});
5650// scrollview-base-ie
5651add('load', '16', {
5652    "name": "scrollview-base-ie",
5653    "trigger": "scrollview-base",
5654    "ua": "ie"
5655});
5656// selector-css2
5657add('load', '17', {
5658    "name": "selector-css2",
5659    "test": function (Y) {
5660    var DOCUMENT = Y.config.doc,
5661        ret = DOCUMENT && !('querySelectorAll' in DOCUMENT);
5662
5663    return ret;
5664},
5665    "trigger": "selector"
5666});
5667// transition-timer
5668add('load', '18', {
5669    "name": "transition-timer",
5670    "test": function (Y) {
5671    var DOCUMENT = Y.config.doc,
5672        node = (DOCUMENT) ? DOCUMENT.documentElement: null,
5673        ret = true;
5674
5675    if (node && node.style) {
5676        ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);
5677    }
5678
5679    return ret;
5680},
5681    "trigger": "transition"
5682});
5683// widget-base-ie
5684add('load', '19', {
5685    "name": "widget-base-ie",
5686    "trigger": "widget-base",
5687    "ua": "ie"
5688});
5689// yql-jsonp
5690add('load', '20', {
5691    "name": "yql-jsonp",
5692    "test": function (Y) {
5693    /* Only load the JSONP module when not in nodejs or winjs
5694    TODO Make the winjs module a CORS module
5695    */
5696    return (!Y.UA.nodejs && !Y.UA.winjs);
5697},
5698    "trigger": "yql"
5699});
5700// yql-nodejs
5701add('load', '21', {
5702    "name": "yql-nodejs",
5703    "trigger": "yql",
5704    "ua": "nodejs"
5705});
5706// yql-winjs
5707add('load', '22', {
5708    "name": "yql-winjs",
5709    "trigger": "yql",
5710    "ua": "winjs"
5711});
5712
5713}, 'patched-v3.18.3', {"requires": ["yui-base"]});
5714YUI.add('intl-base', function (Y, NAME) {
5715
5716/**
5717 * The Intl utility provides a central location for managing sets of
5718 * localized resources (strings and formatting patterns).
5719 *
5720 * @class Intl
5721 * @uses EventTarget
5722 * @static
5723 */
5724
5725var SPLIT_REGEX = /[, ]/;
5726
5727Y.mix(Y.namespace('Intl'), {
5728
5729 /**
5730    * Returns the language among those available that
5731    * best matches the preferred language list, using the Lookup
5732    * algorithm of BCP 47.
5733    * If none of the available languages meets the user's preferences,
5734    * then "" is returned.
5735    * Extended language ranges are not supported.
5736    *
5737    * @method lookupBestLang
5738    * @param {String[] | String} preferredLanguages The list of preferred
5739    * languages in descending preference order, represented as BCP 47
5740    * language tags. A string array or a comma-separated list.
5741    * @param {String[]} availableLanguages The list of languages
5742    * that the application supports, represented as BCP 47 language
5743    * tags.
5744    *
5745    * @return {String} The available language that best matches the
5746    * preferred language list, or "".
5747    * @since 3.1.0
5748    */
5749    lookupBestLang: function(preferredLanguages, availableLanguages) {
5750
5751        var i, language, result, index;
5752
5753        // check whether the list of available languages contains language;
5754        // if so return it
5755        function scan(language) {
5756            var i;
5757            for (i = 0; i < availableLanguages.length; i += 1) {
5758                if (language.toLowerCase() ===
5759                            availableLanguages[i].toLowerCase()) {
5760                    return availableLanguages[i];
5761                }
5762            }
5763        }
5764
5765        if (Y.Lang.isString(preferredLanguages)) {
5766            preferredLanguages = preferredLanguages.split(SPLIT_REGEX);
5767        }
5768
5769        for (i = 0; i < preferredLanguages.length; i += 1) {
5770            language = preferredLanguages[i];
5771            if (!language || language === '*') {
5772                continue;
5773            }
5774            // check the fallback sequence for one language
5775            while (language.length > 0) {
5776                result = scan(language);
5777                if (result) {
5778                    return result;
5779                } else {
5780                    index = language.lastIndexOf('-');
5781                    if (index >= 0) {
5782                        language = language.substring(0, index);
5783                        // one-character subtags get cut along with the
5784                        // following subtag
5785                        if (index >= 2 && language.charAt(index - 2) === '-') {
5786                            language = language.substring(0, index - 2);
5787                        }
5788                    } else {
5789                        // nothing available for this language
5790                        break;
5791                    }
5792                }
5793            }
5794        }
5795
5796        return '';
5797    }
5798});
5799
5800
5801}, 'patched-v3.18.3', {"requires": ["yui-base"]});
5802YUI.add('yui-log', function (Y, NAME) {
5803
5804/**
5805 * Provides console log capability and exposes a custom event for
5806 * console implementations. This module is a `core` YUI module,
5807 * <a href="../classes/YUI.html#method_log">it's documentation is located under the YUI class</a>.
5808 *
5809 * @module yui
5810 * @submodule yui-log
5811 */
5812
5813var INSTANCE = Y,
5814    LOGEVENT = 'yui:log',
5815    UNDEFINED = 'undefined',
5816    LEVELS = { debug: 1,
5817               info: 2,
5818               warn: 4,
5819               error: 8 };
5820
5821/**
5822 * If the 'debug' config is true, a 'yui:log' event will be
5823 * dispatched, which the Console widget and anything else
5824 * can consume.  If the 'useBrowserConsole' config is true, it will
5825 * write to the browser console if available.  YUI-specific log
5826 * messages will only be present in the -debug versions of the
5827 * JS files.  The build system is supposed to remove log statements
5828 * from the raw and minified versions of the files.
5829 *
5830 * @method log
5831 * @for YUI
5832 * @param  {String}  msg  The message to log.
5833 * @param  {String}  cat  The log category for the message.  Default
5834 *                        categories are "info", "warn", "error", "debug".
5835 *                        Custom categories can be used as well. (opt).
5836 * @param  {String}  src  The source of the the message (opt).
5837 * @param  {boolean} silent If true, the log event won't fire.
5838 * @return {YUI}      YUI instance.
5839 */
5840INSTANCE.log = function(msg, cat, src, silent) {
5841    var bail, excl, incl, m, f, minlevel,
5842        Y = INSTANCE,
5843        c = Y.config,
5844        publisher = (Y.fire) ? Y : YUI.Env.globalEvents;
5845    // suppress log message if the config is off or the event stack
5846    // or the event call stack contains a consumer of the yui:log event
5847    if (c.debug) {
5848        // apply source filters
5849        src = src || "";
5850        if (typeof src !== "undefined") {
5851            excl = c.logExclude;
5852            incl = c.logInclude;
5853            if (incl && !(src in incl)) {
5854                bail = 1;
5855            } else if (incl && (src in incl)) {
5856                bail = !incl[src];
5857            } else if (excl && (src in excl)) {
5858                bail = excl[src];
5859            }
5860
5861            // Set a default category of info if the category was not defined.
5862            if ((typeof cat === 'undefined')) {
5863                cat = 'info';
5864            }
5865
5866            // Determine the current minlevel as defined in configuration
5867            Y.config.logLevel = Y.config.logLevel || 'debug';
5868            minlevel = LEVELS[Y.config.logLevel.toLowerCase()];
5869
5870            if (cat in LEVELS && LEVELS[cat] < minlevel) {
5871                // Skip this message if the we don't meet the defined minlevel
5872                bail = 1;
5873            }
5874        }
5875        if (!bail) {
5876            if (c.useBrowserConsole) {
5877                m = (src) ? src + ': ' + msg : msg;
5878                if (Y.Lang.isFunction(c.logFn)) {
5879                    c.logFn.call(Y, msg, cat, src);
5880                } else if (typeof console !== UNDEFINED && console.log) {
5881                    f = (cat && console[cat] && (cat in LEVELS)) ? cat : 'log';
5882                    console[f](m);
5883                } else if (typeof opera !== UNDEFINED) {
5884                    opera.postError(m);
5885                }
5886            }
5887
5888            if (publisher && !silent) {
5889
5890                if (publisher === Y && (!publisher.getEvent(LOGEVENT))) {
5891                    publisher.publish(LOGEVENT, {
5892                        broadcast: 2
5893                    });
5894                }
5895
5896                publisher.fire(LOGEVENT, {
5897                    msg: msg,
5898                    cat: cat,
5899                    src: src
5900                });
5901            }
5902        }
5903    }
5904
5905    return Y;
5906};
5907
5908/**
5909 * Write a system message.  This message will be preserved in the
5910 * minified and raw versions of the YUI files, unlike log statements.
5911 * @method message
5912 * @for YUI
5913 * @param  {String}  msg  The message to log.
5914 * @param  {String}  cat  The log category for the message.  Default
5915 *                        categories are "info", "warn", "error", "debug".
5916 *                        Custom categories can be used as well. (opt).
5917 * @param  {String}  src  The source of the the message (opt).
5918 * @param  {boolean} silent If true, the log event won't fire.
5919 * @return {YUI}      YUI instance.
5920 */
5921INSTANCE.message = function() {
5922    return INSTANCE.log.apply(INSTANCE, arguments);
5923};
5924
5925
5926}, 'patched-v3.18.3', {"requires": ["yui-base"]});
5927YUI.add('yui-later', function (Y, NAME) {
5928
5929/**
5930 * Provides a setTimeout/setInterval wrapper. This module is a `core` YUI module,
5931 * <a href="../classes/YUI.html#method_later">
5931it's documentation is located under the YUI class</a>.
5932 *
5933 * @module yui
5934 * @submodule yui-later
5935 */
5936
5937var NO_ARGS = [];
5938
5939/**
5940 * Executes the supplied function in the context of the supplied
5941 * object 'when' milliseconds later.  Executes the function a
5942 * single time unless periodic is set to true.
5943 * @for YUI
5944 * @method later
5945 * @param when {Number} the number of milliseconds to wait until the fn
5946 * is executed.
5947 * @param o the context object.
5948 * @param fn {Function|String} the function to execute or the name of
5949 * the method in the 'o' object to execute.
5950 * @param data [Array] data that is provided to the function.  This
5951 * accepts either a single item or an array.  If an array is provided,
5952 * the function is executed with one parameter for each array item.
5953 * If you need to pass a single array parameter, it needs to be wrapped
5954 * in an array [myarray].
5955 *
5956 * Note: native methods in IE may not have the call and apply methods.
5957 * In this case, it will work, but you are limited to four arguments.
5958 *
5959 * @param periodic {boolean} if true, executes continuously at supplied
5960 * interval until canceled.
5961 * @return {object} a timer object. Call the cancel() method on this
5962 * object to stop the timer.
5963 */
5964Y.later = function(when, o, fn, data, periodic) {
5965    when = when || 0;
5966    data = (!Y.Lang.isUndefined(data)) ? Y.Array(data) : NO_ARGS;
5967    o = o || Y.config.win || Y;
5968
5969    var cancelled = false,
5970        method = (o && Y.Lang.isString(fn)) ? o[fn] : fn,
5971        wrapper = function() {
5972            // IE 8- may execute a setInterval callback one last time
5973            // after clearInterval was called, so in order to preserve
5974            // the cancel() === no more runny-run, we have to jump through
5975            // an extra hoop.
5976            if (!cancelled) {
5977                if (!method.apply) {
5978                    method(data[0], data[1], data[2], data[3]);
5979                } else {
5980                    method.apply(o, data || NO_ARGS);
5981                }
5982            }
5983        },
5984        id = (periodic) ? setInterval(wrapper, when) : setTimeout(wrapper, when);
5985
5986    return {
5987        id: id,
5988        interval: periodic,
5989        cancel: function() {
5990            cancelled = true;
5991            if (this.interval) {
5992                clearInterval(id);
5993            } else {
5994                clearTimeout(id);
5995            }
5996        }
5997    };
5998};
5999
6000Y.Lang.later = Y.later;
6001
6002
6003
6004}, 'patched-v3.18.3', {"requires": ["yui-base"]});
6005YUI.add('loader-base', function (Y, NAME) {
6006
6007/**
6008 * The YUI loader core
6009 * @module loader
6010 * @submodule loader-base
6011 */
6012
6013(function() {
6014    var VERSION = Y.version,
6015        BUILD = '/build/',
6016        ROOT = VERSION + '/',
6017        CDN_BASE = Y.Env.base,
6018        GALLERY_VERSION = 'gallery-2014.06.04-21-38',
6019        TNT = '2in3',
6020        TNT_VERSION = '4',
6021        YUI2_VERSION = '2.9.0',
6022        COMBO_BASE = CDN_BASE + 'combo?',
6023        META = {
6024            version: VERSION,
6025            root: ROOT,
6026            base: Y.Env.base,
6027            comboBase: COMBO_BASE,
6028            skin: {
6029                defaultSkin: 'sam',
6030                base: 'assets/skins/',
6031                path: 'skin.css',
6032                after: [
6033                    'cssreset',
6034                    'cssfonts',
6035                    'cssgrids',
6036                    'cssbase',
6037                    'cssreset-context',
6038                    'cssfonts-context'
6039                ]
6040            },
6041            groups: {},
6042            patterns: {}
6043        },
6044        groups = META.groups,
6045        yui2Update = function(tnt, yui2, config) {
6046            var root = TNT + '.' +
6047                    (tnt || TNT_VERSION) + '/' +
6048                    (yui2 || YUI2_VERSION) + BUILD,
6049                base = (config && config.base) ? config.base : CDN_BASE,
6050                combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE;
6051
6052            groups.yui2.base = base + root;
6053            groups.yui2.root = root;
6054            groups.yui2.comboBase = combo;
6055        },
6056        galleryUpdate = function(tag, config) {
6057            var root = (tag || GALLERY_VERSION) + BUILD,
6058                base = (config && config.base) ? config.base : CDN_BASE,
6059                combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE;
6060
6061            groups.gallery.base = base + root;
6062            groups.gallery.root = root;
6063            groups.gallery.comboBase = combo;
6064        };
6065
6066
6067    groups[VERSION] = {};
6068
6069    groups.gallery = {
6070        ext: false,
6071        combine: true,
6072        comboBase: COMBO_BASE,
6073        update: galleryUpdate,
6074        patterns: {
6075            'gallery-': {},
6076            'lang/gallery-': {},
6077            'gallerycss-': {
6078                type: 'css'
6079            }
6080        }
6081    };
6082
6083    groups.yui2 = {
6084        combine: true,
6085        ext: false,
6086        comboBase: COMBO_BASE,
6087        update: yui2Update,
6088        patterns: {
6089            'yui2-': {
6090                configFn: function(me) {
6091                    if (/-skin|reset|fonts|grids|base/.test(me.name)) {
6092                        me.type = 'css';
6093                        me.path = me.path.replace(/\.js/, '.css');
6094                        // this makes skins in builds earlier than
6095                        // 2.6.0 work as long as combine is false
6096                        me.path = me.path.replace(/\/yui2-skin/,
6097                                            '/assets/skins/sam/yui2-skin');
6098                    }
6099                }
6100            }
6101        }
6102    };
6103
6104    galleryUpdate();
6105    yui2Update();
6106
6107    if (YUI.Env[VERSION]) {
6108        Y.mix(META, YUI.Env[VERSION], false, [
6109            'modules',
6110            'groups',
6111            'skin'
6112        ], 0, true);
6113    }
6114
6115    YUI.Env[VERSION] = META;
6116}());
6117/*jslint forin: true, maxlen: 350 */
6118
6119/**
6120 * Loader dynamically loads script and css files.  It includes the dependency
6121 * information for the version of the library in use, and will automatically pull in
6122 * dependencies for the modules requested. It can also load the
6123 * files from the Yahoo! CDN, and it can utilize the combo service provided on
6124 * this network to reduce the number of http connections required to download
6125 * YUI files.
6126 *
6127 * @module loader
6128 * @main loader
6129 * @submodule loader-base
6130 */
6131
6132var NOT_FOUND = {},
6133    NO_REQUIREMENTS = [],
6134    MAX_URL_LENGTH = 1024,
6135    GLOBAL_ENV = YUI.Env,
6136    GLOBAL_LOADED = GLOBAL_ENV._loaded,
6137    CSS = 'css',
6138    JS = 'js',
6139    INTL = 'intl',
6140    DEFAULT_SKIN = 'sam',
6141    VERSION = Y.version,
6142    ROOT_LANG = '',
6143    YObject = Y.Object,
6144    oeach = YObject.each,
6145    yArray = Y.Array,
6146    _queue = GLOBAL_ENV._loaderQueue,
6147    META = GLOBAL_ENV[VERSION],
6148    SKIN_PREFIX = 'skin-',
6149    L = Y.Lang,
6150    ON_PAGE = GLOBAL_ENV.mods,
6151    modulekey,
6152    _path = function(dir, file, type, nomin) {
6153        var path = dir + '/' + file;
6154        if (!nomin) {
6155            path += '-min';
6156        }
6157        path += '.' + (type || CSS);
6158
6159        return path;
6160    };
6161
6162
6163    if (!YUI.Env._cssLoaded) {
6164        YUI.Env._cssLoaded = {};
6165    }
6166
6167
6168/**
6169 * The component metadata is stored in Y.Env.meta.
6170 * Part of the loader module.
6171 * @property meta
6172 * @for YUI
6173 */
6174Y.Env.meta = META;
6175
6176/**
6177 * Loader dynamically loads script and css files.  It includes the dependency
6178 * info for the version of the library in use, and will automatically pull in
6179 * dependencies for the modules requested. It can load the
6180 * files from the Yahoo! CDN, and it can utilize the combo service provided on
6181 * this network to reduce the number of http connections required to download
6182 * YUI files. You can also specify an external, custom combo service to host
6183 * your modules as well.
6184
6185        var Y = YUI();
6186        var loader = new Y.Loader({
6187            filter: 'debug',
6188            base: '../../',
6189            root: 'build/',
6190            combine: true,
6191            require: ['node', 'dd', 'console']
6192        });
6193        var out = loader.resolve(true);
6194
6195 * If the Loader needs to be patched before it is used for the first time, it
6196 * should be done through the `doBeforeLoader` hook. Simply make the patch
6197 * available via configuration before YUI is loaded:
6198
6199        YUI_config = YUI_config || {};
6200        YUI_config.doBeforeLoader = function (config) {
6201            var resolve = this.context.Loader.prototype.resolve;
6202            this.context.Loader.prototype.resolve = function () {
6203                // do something here
6204                return resolve.apply(this, arguments);
6205            };
6206        };
6207
6208 * @constructor
6209 * @class Loader
6210 * @param {Object} config an optional set of configuration options.
6211 * @param {String} config.base The base dir which to fetch this module from
6212 * @param {String} config.comboBase The Combo service base path. Ex: `http://yui.yahooapis.com/combo?`
6213 * @param {String} config.root The root path to prepend to module names for the combo service. Ex: `2.5.2/build/`
6214 * @param {String|Object} config.filter A filter to apply to result urls. <a href="#property_filter">See filter property</a>
6215 * @param {Object} config.filters Per-component filter specification.  If specified for a given component, this overrides the filter config.
6216 * @param {Boolean} config.combine Use a combo service to reduce the number of http connections required to load your dependencies
6217 * @param {Boolean} [config.async=true] Fetch files in async
6218 * @param {Array} config.ignore: A list of modules that should never be dynamically loaded
6219 * @param {Array} config.force A list of modules that should always be loaded when required, even if already present on the page
6220 * @param {HTMLElement|String} config.insertBefore Node or id for a node that should be used as the insertion point for new nodes
6221 * @param {Object} config.jsAttributes Object literal containing attributes to add to script nodes
6222 * @param {Object} config.cssAttributes Object literal containing attributes to add to link nodes
6223 * @param {Number} config.timeout The number of milliseconds before a timeout occurs when dynamically loading nodes.  If not set, there is no timeout
6224 * @param {Object} config.context Execution context for all callbacks
6225 * @param {Function} config.onSuccess Callback for the 'success' event
6226 * @param {Function} config.onFailure Callback for the 'failure' event
6227 * @param {Function} config.onTimeout Callback for the 'timeout' event
6228 * @param {Function} config.onProgress Callback executed each time a script or css file is loaded
6229 * @param {Object} config.modules A list of module definitions.  See <a href="#method_addModule">Loader.addModule</a> for the supported module metadata
6230 * @param {Object} config.groups A list of group definitions.  Each group can contain specific definitions for `base`, `comboBase`, `combine`, and accepts a list of `modules`.
6231 * @param {String} config.2in3 The version of the YUI 2 in 3 wrapper to use.  The intrinsic support for YUI 2 modules in YUI 3 relies on versions of the YUI 2 components inside YUI 3 module wrappers.  These wrappers change over time to accomodate the issues that arise from running YUI 2 in a YUI 3 sandbox.
6232 * @param {String} config.yui2 When using the 2in3 project, you can select the version of YUI 2 to use.  V
6232alid values are `2.2.2`, `2.3.1`, `2.4.1`, `2.5.2`, `2.6.0`, `2.7.0`, `2.8.0`, `2.8.1` and `2.9.0` [default] -- plus all versions of YUI 2 going forward.
6233 * @param {Function} config.doBeforeLoader An optional hook that allows for the patching of the loader instance. The `Y` instance is available as `this.context` and the only argument to the function is the Loader configuration object.
6234 */
6235Y.Loader = function(o) {
6236
6237    var self = this;
6238
6239    //Catch no config passed.
6240    o = o || {};
6241
6242    modulekey = META.md5;
6243
6244    /**
6245     * Internal callback to handle multiple internal insert() calls
6246     * so that css is inserted prior to js
6247     * @property _internalCallback
6248     * @private
6249     */
6250    // self._internalCallback = null;
6251
6252    /**
6253     * Callback that will be executed when the loader is finished
6254     * with an insert
6255     * @method onSuccess
6256     * @type function
6257     */
6258    // self.onSuccess = null;
6259
6260    /**
6261     * Callback that will be executed if there is a failure
6262     * @method onFailure
6263     * @type function
6264     */
6265    // self.onFailure = null;
6266
6267    /**
6268     * Callback executed each time a script or css file is loaded
6269     * @method onProgress
6270     * @type function
6271     */
6272    // self.onProgress = null;
6273
6274    /**
6275     * Callback that will be executed if a timeout occurs
6276     * @method onTimeout
6277     * @type function
6278     */
6279    // self.onTimeout = null;
6280
6281    /**
6282     * The execution context for all callbacks
6283     * @property context
6284     * @default {YUI} the YUI instance
6285     */
6286    self.context = Y;
6287
6288    // Hook that allows the patching of loader
6289    if (o.doBeforeLoader) {
6290        o.doBeforeLoader.apply(self, arguments);
6291    }
6292
6293    /**
6294     * Data that is passed to all callbacks
6295     * @property data
6296     */
6297    // self.data = null;
6298
6299    /**
6300     * Node reference or id where new nodes should be inserted before
6301     * @property insertBefore
6302     * @type string|HTMLElement
6303     */
6304    // self.insertBefore = null;
6305
6306    /**
6307     * The charset attribute for inserted nodes
6308     * @property charset
6309     * @type string
6310     * @deprecated , use cssAttributes or jsAttributes.
6311     */
6312    // self.charset = null;
6313
6314    /**
6315     * An object literal containing attributes to add to link nodes
6316     * @property cssAttributes
6317     * @type object
6318     */
6319    // self.cssAttributes = null;
6320
6321    /**
6322     * An object literal containing attributes to add to script nodes
6323     * @property jsAttributes
6324     * @type object
6325     */
6326    // self.jsAttributes = null;
6327
6328    /**
6329     * The base directory.
6330     * @property base
6331     * @type string
6332     * @default http://yui.yahooapis.com/[YUI VERSION]/build/
6333     */
6334    self.base = Y.Env.meta.base + Y.Env.meta.root;
6335
6336    /**
6337     * Base path for the combo service
6338     * @property comboBase
6339     * @type string
6340     * @default http://yui.yahooapis.com/combo?
6341     */
6342    self.comboBase = Y.Env.meta.comboBase;
6343
6344    /*
6345     * Base path for language packs.
6346     */
6347    // self.langBase = Y.Env.meta.langBase;
6348    // self.lang = "";
6349
6350    /**
6351     * If configured, the loader will attempt to use the combo
6352     * service for YUI resources and configured external resources.
6353     * @property combine
6354     * @type boolean
6355     * @default true if a base dir isn't in the config
6356     */
6357    self.combine = o.base &&
6358        (o.base.indexOf(self.comboBase.substr(0, 20)) > -1);
6359
6360    /**
6361    * The default seperator to use between files in a combo URL
6362    * @property comboSep
6363    * @type {String}
6364    * @default Ampersand
6365    */
6366    self.comboSep = '&';
6367    /**
6368     * Max url length for combo urls.  The default is 1024. This is the URL
6369     * limit for the Yahoo! hosted combo servers.  If consuming
6370     * a different combo service that has a different URL limit
6371     * it is possible to override this default by supplying
6372     * the maxURLLength config option.  The config option will
6373     * only take effect if lower than the default.
6374     *
6375     * @property maxURLLength
6376     * @type int
6377     */
6378    self.maxURLLength = MAX_URL_LENGTH;
6379
6380    /**
6381     * Ignore modules registered on the YUI global
6382     * @property ignoreRegistered
6383     * @default false
6384     */
6385    self.ignoreRegistered = o.ignoreRegistered;
6386
6387    /**
6388     * Root path to prepend to module path for the combo
6389     * service
6390     * @property root
6391     * @type string
6392     * @default [YUI VERSION]/build/
6393     */
6394    self.root = Y.Env.meta.root;
6395
6396    /**
6397     * Timeout value in milliseconds.  If set, self value will be used by
6398     * the get utility.  the timeout event will fire if
6399     * a timeout occurs.
6400     * @property timeout
6401     * @type int
6402     */
6403    self.timeout = 0;
6404
6405    /**
6406     * A list of modules that should not be loaded, even if
6407     * they turn up in the dependency tree
6408     * @property ignore
6409     * @type string[]
6410     */
6411    // self.ignore = null;
6412
6413    /**
6414     * A list of modules that should always be loaded, even
6415     * if they have already been inserted into the page.
6416     * @property force
6417     * @type string[]
6418     */
6419    // self.force = null;
6420
6421    self.forceMap = {};
6422
6423    /**
6424     * Should we allow rollups
6425     * @property allowRollup
6426     * @type boolean
6427     * @default false
6428     */
6429    self.allowRollup = false;
6430
6431    /**
6432     * A filter to apply to result urls.  This filter will modify the default
6433     * path for all modules.  The default path for the YUI library is the
6434     * minified version of the files (e.g., event-min.js).  The filter property
6435     * can be a predefined filter or a custom filter.  The valid predefined
6436     * filters are:
6437     * <dl>
6438     *  <dt>DEBUG</dt>
6439     *  <dd>Selects the debug versions of the library (e.g., event-debug.js).
6440     *      This option will automatically include the Logger widget</dd>
6441     *  <dt>RAW</dt>
6442     *  <dd>Selects the non-minified version of the library (e.g., event.js).
6443     *  </dd>
6444     * </dl>
6445     * You can also define a custom filter, which must be an object literal
6446     * containing a search expression and a replace string:
6447     *
6448     *      myFilter: {
6449     *          'searchExp': "-min\\.js",
6450     *          'replaceStr': "-debug.js"
6451     *      }
6452     *
6453     * @property filter
6454     * @type string| {searchExp: string, replaceStr: string}
6455     */
6456    // self.filter = null;
6457
6458    /**
6459     * per-component filter specification.  If specified for a given
6460     * component, this overrides the filter config.
6461     * @property filters
6462     * @type object
6463     */
6464    self.filters = {};
6465
6466    /**
6467     * The list of requested modules
6468     * @property required
6469     * @type {string: boolean}
6470     */
6471    self.required = {};
6472
6473    /**
6474     * If a module name is predefined when requested, it is checked againsts
6475     * the patterns provided in this property.  If there is a match, the
6476     * module is added with the default configuration.
6477     *
6478     * At the moment only supporting module prefixes, but anticipate
6479     * supporting at least regular expressions.
6480     * @property patterns
6481     * @type Object
6482     */
6483    // self.patterns = Y.merge(Y.Env.meta.patterns);
6484    self.patterns = {};
6485
6486    /**
6487     * Internal loader instance metadata. Use accessor `getModuleInfo()` instead.
6488     */
6489    self.moduleInfo = {};
6490
6491    self.groups = Y.merge(Y.Env.meta.groups);
6492
6493    /**
6494     * Provides the information used to skin the skinnable components.
6495     * The following skin definition would result in 'skin1' and 'skin2'
6496     * being loaded for calendar (if calendar was requested), and
6497     * 'sam' for all other skinnable components:
6498     *
6499     *      skin: {
6500     *          // The default skin, which is automatically applied if not
6501     *          // overriden by a component-specific skin definition.
6502     *          // Change this in to apply a different skin globally
6503     *          defaultSkin: 'sam',
6504     *
6505     *          // This is combined with the loader base property to get
6506     *          // the default root directory for a skin. ex:
6507     *          // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/
6508     *          base: 'assets/skins/',
6509     *
6510     *          // Any component-specific overrides can be specified here,
6511     *          // making it possible to load different skins for different
6512     *          // components.  It is possible to load more than one skin
6513     *          // for a given component as well.
6514     *          overrides: {
6515     *              calendar: ['skin1', 'skin2']
6516     *          }
6517     *      }
6518     * @property skin
6519     * @type {Object}
6520     */
6521    self.skin = Y.merge(Y.Env.meta.skin);
6522
6523    /*
6524     * Map of conditional modules
6525     * @since 3.2.0
6526     */
6527    self.conditions = {};
6528
6529    // map of modules with a hash of modules that meet the requirement
6530    // self.provides = {};
6531
6532    self.config = o;
6533    self._internal = true;
6534
6535    self._populateConditionsCache();
6536
6537    /**
6538     * Set when beginning to compute the dependency tree.
6539     * Composed of what YUI reports to be loaded combined
6540     * with what has been loaded by any instance on the page
6541     * with the version number specified in the metadata.
6542     * @property loaded
6543     * @type {string: boolean}
6544     */
6545    self.loaded = GLOBAL_LOADED[VERSION];
6546
6547
6548    /**
6549    * Should Loader fetch scripts in `async`, defaults to `true`
6550    * @property async
6551    */
6552
6553    self.async = true;
6554
6555    self._inspectPage();
6556
6557    self._internal = false;
6558
6559    self._config(o);
6560
6561    self.forceMap = (self.force) ? Y.Array.hash(self.force) : {};
6562
6563    self.testresults = null;
6564
6565    if (Y.config.tests) {
6566        self.testresults = Y.config.tests;
6567    }
6568
6569    /**
6570     * List of rollup files found in the library metadata
6571     * @property rollups
6572     */
6573    // self.rollups = null;
6574
6575    /**
6576     * Whether or not to load optional dependencies for
6577     * the requested modules
6578     * @property loadOptional
6579     * @type boolean
6580     * @default false
6581     */
6582    // self.loadOptional = false;
6583
6584    /**
6585     * All of the derived dependencies in sorted order, which
6586     * will be populated when either calculate() or insert()
6587     * is called
6588     * @property sorted
6589     * @type string[]
6590     */
6591    self.sorted = [];
6592
6593    /*
6594     * A list of modules to attach to the YUI instance when complete.
6595     * If not supplied, the sorted list of dependencies are applied.
6596     * @property attaching
6597     */
6598    // self.attaching = null;
6599
6600    /**
6601     * Flag to indicate the dependency tree needs to be recomputed
6602     * if insert is called again.
6603     * @property dirty
6604     * @type boolean
6605     * @default true
6606     */
6607    self.dirty = true;
6608
6609    /**
6610     * List of modules inserted by the utility
6611     * @property inserted
6612     * @type {string: boolean}
6613     */
6614    self.inserted = {};
6615
6616    /**
6617     * List of skipped modules during insert() because the module
6618     * was not defined
6619     * @property skipped
6620     */
6621    self.skipped = {};
6622
6623    // Y.on('yui:load', self.loadNext, self);
6624
6625    self.tested = {};
6626
6627    /*
6628     * Cached sorted calculate results
6629     * @property results
6630     * @since 3.2.0
6631     */
6632    //self.results = {};
6633
6634    if (self.ignoreRegistered) {
6635        //Clear inpage already processed modules.
6636        self._resetModules();
6637    }
6638
6639};
6640
6641Y.Loader.prototype = {
6642    /**
6643    * Gets the module info from the local moduleInfo hash, or from the
6644    * default metadata and populate the local moduleInfo hash.
6645    * @method getModuleInfo
6646    * @param {string} name of the module
6647    * @public
6648    */
6649    getModuleInfo: function(name) {
6650
6651        var m = this.moduleInfo[name],
6652            rawMetaModules, globalRenderedMods, internal, v;
6653
6654        if (m) {
6655            return m;
6656        }
6657
6658        rawMetaModules = META.modules;
6659        globalRenderedMods = GLOBAL_ENV._renderedMods;
6660        internal = this._internal;
6661
6662        /*
6663        The logic here is:
6664
6665        - if the `moduleInfo[name]` is avilable,
6666          then short circuit
6667        - otherwise, if the module is in the globalCache (cross Y instance),
6668          then port it from the global registry into `moduleInfo[name]`
6669        - otherwise, if the module has raw metadata (from meta modules)
6670          then add it to the global registry and to `moduleInfo[name]`
6671
6672        */
6673        if (globalRenderedMods && globalRenderedMods.hasOwnProperty(name) && !this.ignoreRegistered) {
6674            this.moduleInfo[name] = Y.merge(globalRenderedMods[name]);
6675        } else {
6676            if (rawMetaModules.hasOwnProperty(name)) {
6677                this._internal = true; // making sure that modules from raw data are marked as internal
6678                v = this.addModule(rawMetaModules[name], name);
6679                // Inspect the page for the CSS module and mark it as loaded.
6680                if (v && v.type === CSS) {
6681                    if (this.isCSSLoaded(v.name, true)) {
6682                        this.loaded[v.name] = true;
6683                    }
6684                }
6685                this._internal = internal;
6686            }
6687        }
6688        return this.moduleInfo[name];
6689    },
6690    /**
6691    * Expand the names that are aliases to other modules.
6692    * @method _expandAliases
6693    * @param {string[]} list a module name or a list of names to be expanded
6694    * @private
6695    * @return {array}
6696    */
6697    _expandAliases: function(list) {
6698        var expanded = [],
6699            aliases = YUI.Env.aliases,
6700            i, name;
6701        list = Y.Array(list);
6702        for (i = 0; i < list.length; i += 1) {
6703            name = list[i];
6704            expanded.push.apply(expanded, aliases[name] ? aliases[name] : [name]);
6705        }
6706        return expanded;
6707    },
6708    /**
6709    * Populate the conditions cache from raw modules, this is necessary
6710    * because no other module will require a conditional module, instead
6711    * the condition has to be executed and then the module is analyzed
6712    * to be included in the final requirement list. Without this cache
6713    * conditional modules will be simply ignored.
6714    * @method _populateConditionsCache
6715    * @private
6716    */
6717    _populateConditionsCache: function() {
6718        var rawMetaModules = META.modules,
6719            cache = GLOBAL_ENV._conditions,
6720            i, j, t, trigger;
6721
6722        // if we have conditions in cache and cache is enabled
6723        // we should port them to this loader instance
6724        if (cache && !this.ignoreRegistered) {
6725            for (i in cache) {
6726                if (cache.hasOwnProperty(i)) {
6727                    this.conditions[i] = Y.merge(cache[i]);
6728                }
6729            }
6730        } else {
6731            for (i in rawMetaModules) {
6732                if (rawMetaModules.hasOwnProperty(i) && rawMetaModules[i].condition) {
6733                    t = this._expandAliases(rawMetaModules[i].condition.trigger);
6734                    for (j = 0; j < t.length; j += 1) {
6735                        trigger = t[j];
6736                        this.conditions[trigger] = this.conditions[trigger] || {};
6737                        this.conditions[trigger][rawMetaModules[i].name || i] = rawMetaModules[i].condition;
6738                    }
6739                }
6740            }
6741            GLOBAL_ENV._conditions = this.conditions;
6742        }
6743    },
6744    /**
6745    * Reset modules in the module cache to a pre-processed state so additional
6746    * computations with a different skin or language will work as expected.
6747    * @method _resetModules
6748    * @private
6749    */
6750    _resetModules: function() {
6751        var self = this, i, o,
6752            mod, name, details;
6753        for (i in self.moduleInfo) {
6754            if (self.moduleInfo.hasOwnProperty(i) && self.moduleInfo[i]) {
6755                mod = self.moduleInfo[i];
6756                name = mod.name;
6757                details  = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null);
6758
6759                if (details) {
6760                    self.moduleInfo[name]._reset = true;
6761                    self.moduleInfo[name].requires = details.requires || [];
6762                    self.moduleInfo[name].optional = details.optional || [];
6763                    self.moduleInfo[name].supersedes = details.supercedes || [];
6764                }
6765
6766                if (mod.defaults) {
6767                    for (o in mod.defaults) {
6768                        if (mod.defaults.hasOwnProperty(o)) {
6769                            if (mod[o]) {
6770                                mod[o] = mod.defaults[o];
6771                            }
6772                        }
6773                    }
6774                }
6775                mod.langCache = undefined;
6776                mod.skinCache = undefined;
6777                if (mod.skinnable) {
6778                    self._addSkin(self.skin.defaultSkin, mod.name);
6779                }
6780            }
6781        }
6782    },
6783    /**
6784    Regex that matches a CSS URL. Used to guess the file type when it's not
6785    specified.
6786
6787    @property REGEX_CSS
6788    @type RegExp
6789    @final
6790    @protected
6791    @since 3.5.0
6792    **/
6793    REGEX_CSS: /\.css(?:[?;].*)?$/i,
6794
6795    /**
6796    * Default filters for raw and debug
6797    * @property FILTER_DEFS
6798    * @type Object
6799    * @final
6800    * @protected
6801    */
6802    FILTER_DEFS: {
6803        RAW: {
6804            'searchExp': '-min\\.js',
6805            'replaceStr': '.js'
6806        },
6807        DEBUG: {
6808            'searchExp': '-min\\.js',
6809            'replaceStr': '-debug.js'
6810        },
6811        COVERAGE: {
6812            'searchExp': '-min\\.js',
6813            'replaceStr': '-coverage.js'
6814        }
6815    },
6816    /*
6817    * Check the pages meta-data and cache the result.
6818    * @method _inspectPage
6819    * @private
6820    */
6821    _inspectPage: function() {
6822        var self = this, v, m, req, mr, i;
6823
6824        for (i in ON_PAGE) {
6825            if (ON_PAGE.hasOwnProperty(i)) {
6826                v = ON_PAGE[i];
6827                if (v.details) {
6828                    m = self.getModuleInfo(v.name);
6829                    req = v.details.requires;
6830                    mr = m && m.requires;
6831
6832                   if (m) {
6833                       if (!m._inspected && req && mr.length !== req.length) {
6834                           // console.log('deleting ' + m.name);
6835                           delete m.expanded;
6836                       }
6837                   } else {
6838                       m = self.addModule(v.details, i);
6839                   }
6840                   m._inspected = true;
6841               }
6842            }
6843        }
6844    },
6845    /*
6846    * returns true if b is not loaded, and is required directly or by means of modules it supersedes.
6847    * @private
6848    * @method _requires
6849    * @param {String} mod1 The first module to compare
6850    * @param {String} mod2 The second module to compare
6851    */
6852   _requires: function(mod1, mod2) {
6853
6854        var i, rm, after_map, s,
6855            m = this.getModuleInfo(mod1),
6856            other = this.getModuleInfo(mod2);
6857
6858        if (!m || !other) {
6859            return false;
6860        }
6861
6862        rm = m.expanded_map;
6863        after_map = m.after_map;
6864
6865        // check if this module should be sorted after the other
6866        // do this first to short circut circular deps
6867        if (after_map && (mod2 in after_map)) {
6868            return true;
6869        }
6870
6871        after_map = other.after_map;
6872
6873        // and vis-versa
6874        if (after_map && (mod1 in after_map)) {
6875            return false;
6876        }
6877
6878        // check if this module requires one the other supersedes
6879        s = other.supersedes;
6880        if (s) {
6881            for (i = 0; i < s.length; i++) {
6882                if (this._requires(mod1, s[i])) {
6883                    return true;
6884                }
6885            }
6886        }
6887
6888        s = m.supersedes;
6889        if (s) {
6890            for (i = 0; i < s.length; i++) {
6891                if (this._requires(mod2, s[i])) {
6892                    return false;
6893                }
6894            }
6895        }
6896
6897        // check if this module requires the other directly
6898        // if (r && yArray.indexOf(r, mod2) > -1) {
6899        if (rm && (mod2 in rm)) {
6900            return true;
6901        }
6902
6903        // external css files should be sorted below yui css
6904        if (m.ext && m.type === CSS && !other.ext && other.type === CSS) {
6905            return true;
6906        }
6907
6908        return false;
6909    },
6910    /**
6911    * Apply a new config to the Loader instance
6912    * @method _config
6913    * @private
6914    * @param {Object} o The new configuration
6915    */
6916    _config: function(o) {
6917        var i, j, val, a, f, group, groupName, self = this,
6918            mods = [], mod, modInfo;
6919        // apply config values
6920        if (o) {
6921            for (i in o) {
6922                if (o.hasOwnProperty(i)) {
6923                    val = o[i];
6924                    //TODO This should be a case
6925                    if (i === 'require') {
6926                        self.require(val);
6927                    } else if (i === 'skin') {
6928                        //If the config.skin is a string, format to the expected object
6929                        if (typeof val === 'string') {
6930                            self.skin.defaultSkin = o.skin;
6931                            val = {
6932                                defaultSkin: val
6933                            };
6934                        }
6935
6936                        Y.mix(self.skin, val, true);
6937                    } else if (i === 'groups') {
6938                        for (j in val) {
6939                            if (val.hasOwnProperty(j)) {
6940                                groupName = j;
6941                                group = val[j];
6942                                self.addGroup(group, groupName);
6943                                if (group.aliases) {
6944                                    for (a in group.aliases) {
6945                                        if (group.aliases.hasOwnProperty(a)) {
6946                                            self.addAlias(group.aliases[a], a);
6947                                        }
6948                                    }
6949                                }
6950                            }
6951                        }
6952
6953                    } else if (i === 'modules') {
6954                        // add a hash of module definitions
6955                        for (j in val) {
6956                            if (val.hasOwnProperty(j)) {
6957                                self.addModule(val[j], j);
6958                            }
6959                        }
6960                    } else if (i === 'aliases') {
6961                        for (j in val) {
6962                            if (val.hasOwnProperty(j)) {
6963                                self.addAlias(val[j], j);
6964                            }
6965                        }
6966                    } else if (i === 'gallery') {
6967                        if (this.groups.gallery.update) {
6968                            this.groups.gallery.update(val, o);
6969                        }
6970                    } else if (i === 'yui2' || i === '2in3') {
6971                        if (this.groups.yui2.update) {
6972                            this.groups.yui2.update(o['2in3'], o.yui2, o);
6973                        }
6974                    } else {
6975                        self[i] = val;
6976                    }
6977                }
6978            }
6979        }
6980
6981        // fix filter
6982        f = self.filter;
6983
6984        if (L.isString(f)) {
6985            f = f.toUpperCase();
6986            self.filterName = f;
6987            self.filter = self.FILTER_DEFS[f];
6988            if (f === 'DEBUG') {
6989                self.require('yui-log', 'dump');
6990            }
6991        }
6992
6993        if (self.filterName && self.coverage) {
6994            if (self.filterName === 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) {
6995                for (i = 0; i < self.coverage.length; i++) {
6996                    mod = self.coverage[i];
6997                    modInfo = self.getModuleInfo(mod);
6998                    if (modInfo && modInfo.use) {
6999                        mods = mods.concat(modInfo.use);
7000                    } else {
7001                        mods.push(mod);
7002                    }
7003                }
7004                self.filters = self.filters || {};
7005                Y.Array.each(mods, function(mod) {
7006                    self.filters[mod] = self.FILTER_DEFS.COVERAGE;
7007                });
7008                self.filterName = 'RAW';
7009                self.filter = self.FILTER_DEFS[self.filterName];
7010            }
7011        }
7012
7013    },
7014
7015    /**
7016     * Returns the skin module name for the specified skin name.  If a
7017     * module name is supplied, the returned skin module name is
7018     * specific to the module passed in.
7019     * @method formatSkin
7020     * @param {string} skin the name of the skin.
7021     * @param {string} mod optional: the name of a module to skin.
7022     * @return {string} the full skin module name.
7023     */
7024    formatSkin: function(skin, mod) {
7025        var s = SKIN_PREFIX + skin;
7026        if (mod) {
7027            s = s + '-' + mod;
7028        }
7029
7030        return s;
7031    },
7032
7033    /**
7034     * Adds the skin def to the module info
7035     * @method _addSkin
7036     * @param {string} skin the name of the skin.
7037     * @param {string} mod the name of the module.
7038     * @param {string} parent parent module if this is a skin of a
7039     * submodule or plugin.
7040     * @return {string} the module name for the skin.
7041     * @private
7042     */
7043    _addSkin: function(skin, mod, parent) {
7044        var pkg, name, nmod,
7045            sinf = this.skin,
7046            mdef = mod && this.getModuleInfo(mod),
7047            ext = mdef && mdef.ext;
7048
7049        // Add a module definition for the module-specific skin css
7050        if (mod) {
7051            name = this.formatSkin(skin, mod);
7052            if (!this.getModuleInfo(name)) {
7053                pkg = mdef.pkg || mod;
7054                nmod = {
7055                    skin: true,
7056                    name: name,
7057                    group: mdef.group,
7058                    type: 'css',
7059                    after: sinf.after,
7060                    path: (parent || pkg) + '/' + sinf.base + skin +
7061                          '/' + mod + '.css',
7062                    ext: ext
7063                };
7064                if (mdef.base) {
7065                    nmod.base = mdef.base;
7066                }
7067                if (mdef.configFn) {
7068                    nmod.configFn = mdef.configFn;
7069                }
7070                this.addModule(nmod, name);
7071
7072            }
7073        }
7074
7075        return name;
7076    },
7077    /**
7078    * Adds an alias module to the system
7079    * @method addAlias
7080    * @param {Array} use An array of modules that makes up this alias
7081    * @param {String} name The name of the alias
7082    * @example
7083    *       var loader = new Y.Loader({});
7084    *       loader.addAlias([ 'node', 'yql' ], 'davglass');
7085    *       loader.require(['davglass']);
7086    *       var out = loader.resolve(true);
7087    *
7088    *       //out.js will contain Node and YQL modules
7089    */
7090    addAlias: function(use, name) {
7091        YUI.Env.aliases[name] = use;
7092        this.addModule({
7093            name: name,
7094            use: use
7095        });
7096    },
7097    /**
7098     * Add a new module group
7099     * @method addGroup
7100     * @param {Object} config An object containing the group configuration data
7101     * @param {String} config.name required, the group name
7102     * @param {String} config.base The base directory for this module group
7103     * @param {String} config.root The root path to add to each combo resource path
7104     * @param {Boolean} config.combine Should the request be combined
7105     * @param {String} config.comboBase Combo service base path
7106     * @param {Object} config.modules The group of modules
7107     * @param {String} name the group name.
7108     * @example
7109     *      var loader = new Y.Loader({});
7110     *      loader.addGroup({
7111     *          name: 'davglass',
7112     *          combine: true,
7113     *          comboBase: '/combo?',
7114     *          root: '',
7115     *          modules: {
7116     *              //Module List here
7117     *          }
7118     *      }, 'davglass');
7119     */
7120    addGroup: function(o, name) {
7121        var mods = o.modules,
7122            self = this,
7123            defaultBase = o.defaultBase || Y.config.defaultBase,
7124            i, v;
7125
7126        name = name || o.name;
7127        o.name = name;
7128        self.groups[name] = o;
7129
7130        if (!o.base && defaultBase && o.root) {
7131            o.base = defaultBase + o.root;
7132        }
7133
7134        if (o.patterns) {
7135            for (i in o.patterns) {
7136                if (o.patterns.hasOwnProperty(i)) {
7137                    o.patterns[i].group = name;
7138                    self.patterns[i] = o.patterns[i];
7139                }
7140            }
7141        }
7142
7143        if (mods) {
7144            for (i in mods) {
7145                if (mods.hasOwnProperty(i)) {
7146                    v = mods[i];
7147                    if (typeof v === 'string') {
7148                        v = { name: i, fullpath: v };
7149                    }
7150                    v.group = name;
7151                    self.addModule(v, i);
7152                }
7153            }
7154        }
7155    },
7156
7157    /**
7158     * Add a new module to the component metadata.
7159     * @method addModule
7160     * @param {Object}
7160 config An object containing the module data.
7161     * @param {String} config.name Required, the component name
7162     * @param {String} config.type Required, the component type (js or css)
7163     * @param {String} config.path Required, the path to the script from `base`
7164     * @param {Array} config.requires Array of modules required by this component
7165     * @param {Array} [config.optional] Array of optional modules for this component
7166     * @param {Array} [config.supersedes] Array of the modules this component replaces
7167     * @param {Array} [config.after] Array of modules the components which, if present, should be sorted above this one
7168     * @param {Object} [config.after_map] Faster alternative to 'after' -- supply a hash instead of an array
7169     * @param {Number} [config.rollup] The number of superseded modules required for automatic rollup
7170     * @param {String} [config.fullpath] If `fullpath` is specified, this is used instead of the configured `base + path`
7171     * @param {Boolean} [config.skinnable] Flag to determine if skin assets should automatically be pulled in
7172     * @param {Object} [config.submodules] Hash of submodules
7173     * @param {String} [config.group] The group the module belongs to -- this is set automatically when it is added as part of a group configuration.
7174     * @param {Array} [config.lang] Array of BCP 47 language tags of languages for which this module has localized resource bundles, e.g., `["en-GB", "zh-Hans-CN"]`
7175     * @param {Object} [config.condition] Specifies that the module should be loaded automatically if a condition is met. This is an object with up to four fields:
7176     * @param {String} [config.condition.trigger] The name of a module that can trigger the auto-load
7177     * @param {Function} [config.condition.test] A function that returns true when the module is to be loaded.
7178     * @param {String} [config.condition.ua] The UA name of <a href="UA.html">Y.UA</a> object that returns true when the module is to be loaded. e.g., `"ie"`, `"nodejs"`.
7179     * @param {String} [config.condition.when] Specifies the load order of the conditional module
7180     *  with regard to the position of the trigger module.
7181     *  This should be one of three values: `before`, `after`, or `instead`.  The default is `after`.
7182     * @param {Object} [config.testresults] A hash of test results from `Y.Features.all()`
7183     * @param {Function} [config.configFn] A function to exectute when configuring this module
7184     * @param {Object} config.configFn.mod The module config, modifying this object will modify it's config. Returning false will delete the module's config.
7185     * @param {String[]} [config.optionalRequires] List of dependencies that
7186        may optionally be loaded by this loader. This is targeted mostly at
7187        polyfills, since they should not be in the list of requires because
7188        polyfills are assumed to be available in the global scope.
7189     * @param {Function} [config.test] Test to be called when this module is
7190        added as an optional dependency of another module. If the test function
7191        returns `false`, the module will be ignored and will not be attached to
7192        this YUI instance.
7193     * @param {String} [name] The module name, required if not in the module data.
7194     * @return {Object} the module definition or null if the object passed in did not provide all required attributes.
7195     */
7196    addModule: function(o, name) {
7197        name = name || o.name;
7198
7199        if (typeof o === 'string') {
7200            o = { name: name, fullpath: o };
7201        }
7202
7203
7204        var subs, i, l, t, sup, s, smod, plugins, plug,
7205            j, langs, packName, supName, flatSup, flatLang, lang, ret,
7206            overrides, skinname, when, g, p,
7207            modInfo = this.moduleInfo[name],
7208            conditions = this.conditions, trigger;
7209
7210        //Only merge this data if the temp flag is set
7211        //from an earlier pass from a pattern or else
7212        //an override module (YUI_config) can not be used to
7213        //replace a default module.
7214        if (modInfo && modInfo.temp) {
7215            //This catches temp modules loaded via a pattern
7216            // The module will be added twice, once from the pattern and
7217            // Once from the actual add call, this ensures that properties
7218            // that were added to the module the first time around (group: gallery)
7219            // are also added the second time around too.
7220            o = Y.merge(modInfo, o);
7221        }
7222
7223        o.name = name;
7224
7225        if (!o || !o.name) {
7226            return null;
7227        }
7228
7229        if (!o.type) {
7230            //Always assume it's javascript unless the CSS pattern is matched.
7231            o.type = JS;
7232            p = o.path || o.fullpath;
7233            if (p && this.REGEX_CSS.test(p)) {
7234                o.type = CSS;
7235            }
7236        }
7237
7238        if (!o.path && !o.fullpath) {
7239            o.path = _path(name, name, o.type);
7240        }
7241        o.supersedes = o.supersedes || o.use;
7242
7243        o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true;
7244
7245        // Handle submodule logic
7246        subs = o.submodules;
7247
7248        this.moduleInfo[name] = o;
7249
7250        o.requires = o.requires || [];
7251
7252        /*
7253        Only allowing the cascade of requires information, since
7254        optional and supersedes are far more fine grained than
7255        a blanket requires is.
7256        */
7257        if (this.requires) {
7258            for (i = 0; i < this.requires.length; i++) {
7259                o.requires.push(this.requires[i]);
7260            }
7261        }
7262        if (o.group && this.groups && this.groups[o.group]) {
7263            g = this.groups[o.group];
7264            if (g.requires) {
7265                for (i = 0; i < g.requires.length; i++) {
7266                    o.requires.push(g.requires[i]);
7267                }
7268            }
7269        }
7270
7271
7272        if (!o.defaults) {
7273            o.defaults = {
7274                requires: o.requires ? [].concat(o.requires) : null,
7275                supersedes: o.supersedes ? [].concat(o.supersedes) : null,
7276                optional: o.optional ? [].concat(o.optional) : null
7277            };
7278        }
7279
7280        if (o.skinnable && o.ext && o.temp) {
7281            skinname = this._addSkin(this.skin.defaultSkin, name);
7282            o.requires.unshift(skinname);
7283        }
7284
7285        if (o.requires.length) {
7286            o.requires = this.filterRequires(o.requires) || [];
7287        }
7288
7289        if (!o.langPack && o.lang) {
7290            // Setup root package by default as a fallback
7291            // for languages that are not defined
7292            packName = this.getLangPackName(ROOT_LANG, name);
7293            smod = this.getModuleInfo(packName);
7294
7295            if (!smod) {
7296                this._addLangPack(null, o, packName);
7297            }
7298
7299            langs = yArray(o.lang);
7300
7301            for (j = 0; j < langs.length; j++) {
7302                lang = langs[j];
7303                packName = this.getLangPackName(lang, name);
7304                smod = this.getModuleInfo(packName);
7305                if (!smod) {
7306                    smod = this._addLangPack(lang, o, packName);
7307                }
7308            }
7309        }
7310
7311
7312        if (subs) {
7313            sup = o.supersedes || [];
7314            l = 0;
7315
7316            for (i in subs) {
7317                if (subs.hasOwnProperty(i)) {
7318                    s = subs[i];
7319
7320                    s.path = s.path || _path(name, i, o.type);
7321                    s.pkg = name;
7322                    s.group = o.group;
7323
7324                    if (s.supersedes) {
7325                        sup = sup.concat(s.supersedes);
7326                    }
7327
7328                    smod = this.addModule(s, i);
7329                    sup.push(i);
7330
7331                    if (smod.skinnable) {
7332                        o.skinnable = true;
7333                        overrides = this.skin.overrides;
7334                        if (overrides && overrides[i]) {
7335                            for (j = 0; j < overrides[i].length; j++) {
7336                                skinname = this._addSkin(overrides[i][j],
7337                                         i, name);
7338                                sup.push(skinname);
7339                            }
7340                        }
7341                        skinname = this._addSkin(this.skin.defaultSkin,
7342                                        i, name);
7343                        sup.push(skinname);
7344                    }
7345
7346                    // looks like we are expected to work out the metadata
7347                    // for the parent module language packs from what is
7348                    // specified in the child modules.
7349                    if (s.lang && s.lang.length) {
7350                        // Setup root package by default as a fallback
7351                        // for languages that are not defined
7352                        packName = this.getLangPackName(ROOT_LANG, name);
7353                        smod = this.getModuleInfo(packName);
7354
7355                        if (!smod) {
7356                            this._addLangPack(null, o, packName);
7357                        }
7358
7359                        langs = yArray(s.lang);
7360
7361                        for (j = 0; j < langs.length; j++) {
7362                            lang = langs[j];
7363                            packName = this.getLangPackName(lang, name);
7364                            supName = this.getLangPackName(lang, i);
7365                            smod = this.getModuleInfo(packName);
7366
7367                            if (!smod) {
7368                                smod = this._addLangPack(lang, o, packName);
7369                            }
7370
7371                            flatSup = flatSup || yArray.hash(smod.supersedes);
7372
7373                            if (!(supName in flatSup)) {
7374                                smod.supersedes.push(supName);
7375                            }
7376
7377                            o.lang = o.lang || [];
7378
7379                            flatLang = flatLang || yArray.hash(o.lang);
7380
7381                            if (!(lang in flatLang)) {
7382                                o.lang.push(lang);
7383                            }
7384
7385// Add rollup file, need to add to supersedes list too
7386
7387                            // default packages
7388                            packName = this.getLangPackName(ROOT_LANG, name);
7389                            supName = this.getLangPackName(ROOT_LANG, i);
7390
7391                            smod = this.getModuleInfo(packName);
7392
7393                            if (!smod) {
7394                                smod = this._addLangPack(lang, o, packName);
7395                            }
7396
7397                            if (!(supName in flatSup)) {
7398                                smod.supersedes.push(supName);
7399                            }
7400
7401// Add rollup file, need to add to supersedes list too
7402
7403                        }
7404                    }
7405
7406                    l++;
7407                }
7408            }
7409            //o.supersedes = YObject.keys(yArray.hash(sup));
7410            o.supersedes = yArray.dedupe(sup);
7411            if (this.allowRollup) {
7412                o.rollup = (l < 4) ? l : Math.min(l - 1, 4);
7413            }
7414        }
7415
7416        plugins = o.plugins;
7417        if (plugins) {
7418            for (i in plugins) {
7419                if (plugins.hasOwnProperty(i)) {
7420                    plug = plugins[i];
7421                    plug.pkg = name;
7422                    plug.path = plug.path || _path(name, i, o.type);
7423                    plug.requires = plug.requires || [];
7424                    plug.group = o.group;
7425                    this.addModule(plug, i);
7426                    if (o.skinnable) {
7427                        this._addSkin(this.skin.defaultSkin, i, name);
7428                    }
7429
7430                }
7431            }
7432        }
7433
7434        if (o.condition) {
7435            t = this._expandAliases(o.condition.trigger);
7436            for (i = 0; i < t.length; i++) {
7437                trigger = t[i];
7438                when = o.condition.when;
7439                conditions[trigger] = conditions[trigger] || {};
7440                conditions[trigger][name] = o.condition;
7441                // the 'when' attribute can be 'before', 'after', or 'instead'
7442                // the default is after.
7443                if (when && when !== 'after') {
7444                    if (when === 'instead') { // replace the trigger
7445                        o.supersedes = o.supersedes || [];
7446                        o.supersedes.push(trigger);
7447                    }
7448                    // before the trigger
7449                        // the trigger requires the conditional mod,
7450                        // so it should appear before the conditional
7451                        // mod if we do not intersede.
7452                } else { // after the trigger
7453                    o.after = o.after || [];
7454                    o.after.push(trigger);
7455                }
7456            }
7457        }
7458
7459        if (o.supersedes) {
7460            o.supersedes = this.filterRequires(o.supersedes);
7461        }
7462
7463        if (o.after) {
7464            o.after = this.filterRequires(o.after);
7465            o.after_map = yArray.hash(o.after);
7466        }
7467
7468        // this.dirty = true;
7469
7470        if (o.configFn) {
7471            ret = o.configFn(o);
7472            if (ret === false) {
7473                delete this.moduleInfo[name];
7474                delete GLOBAL_ENV._renderedMods[name];
7475                o = null;
7476            }
7477        }
7478        //Add to global cache
7479        if (o) {
7480            if (!GLOBAL_ENV._renderedMods) {
7481                GLOBAL_ENV._renderedMods = {};
7482            }
7483            GLOBAL_ENV._renderedMods[name] = Y.mix(GLOBAL_ENV._renderedMods[name] || {}, o);
7484            GLOBAL_ENV._conditions = conditions;
7485        }
7486
7487        return o;
7488    },
7489
7490    /**
7491     * Add a requirement for one or more module
7492     * @method require
7493     * @param {string[] | string*} what the modules to load.
7494     */
7495    require: function(what) {
7496        var a = (typeof what === 'string') ? yArray(arguments) : what;
7497        this.dirty = true;
7498        this.required = Y.merge(this.required, yArray.hash(this.filterRequires(a)));
7499
7500        this._explodeRollups();
7501    },
7502    /**
7503    * Grab all the items that were asked for, check to see if the Loader
7504    * meta-data contains a "use" array. If it doesm remove the asked item and replace it with
7505    * the content of the "use".
7506    * This will make asking for: "dd"
7507    * Actually ask for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin"
7508    * @private
7509    * @method _explodeRollups
7510    */
7511    _explodeRollups: function() {
7512        var self = this, m, m2, i, a, v, len, len2,
7513        r = self.required;
7514
7515        if (!self.allowRollup) {
7516            for (i in r) {
7517                if (r.hasOwnProperty(i)) {
7518                    m = self.getModule(i);
7519                    if (m && m.use) {
7520                        len = m.use.length;
7521                        for (a = 0; a < len; a++) {
7522                            m2 = self.getModule(m.use[a]);
7523                            if (m2 && m2.use) {
7524                                len2 = m2.use.length;
7525                                for (v = 0; v < len2; v++) {
7526                                    r[m2.use[v]] = true;
7527                                }
7528                            } else {
7529                                r[m.use[a]] = true;
7530                            }
7531                        }
7532                    }
7533                }
7534            }
7535            self.required = r;
7536        }
7537
7538    },
7539    /**
7540    * Explodes the required array to remove aliases and replace them with real modules
7541    * @method filterRequires
7542    * @param {Array} r The original requires array
7543    * @return {Array} The new array of exploded requirements
7544    */
7545    filterRequires: function(r) {
7546        if (r) {
7547            if (!Y.Lang.isArray(r)) {
7548                r = [r];
7549            }
7550            r = Y.Array(r);
7551            var c = [], i, mod, o, m;
7552
7553            for (i = 0; i < r.length; i++) {
7554                mod = this.getModule(r[i]);
7555                if (mod && mod.use) {
7556                    for (o = 0; o < mod.use.length; o++) {
7557                        //Must walk the other modules in case a module is a rollup of rollups (datatype)
7558                        m = this.getModule(mod.use[o]);
7559                        if (m && m.use && (m.name !== mod.name)) {
7560                            c = Y.Array.dedupe([].concat(c, this.filterRequires(m.use)));
7561                        } else {
7562                            c.push(mod.use[o]);
7563                        }
7564                    }
7565                } else {
7566                    c.push(r[i]);
7567                }
7568            }
7569            r = c;
7570        }
7571        return r;
7572    },
7573
7574    /**
7575    Returns `true` if the module can be attached to the YUI instance. Runs
7576    the module's test if there is one and caches its result.
7577
7578    @method _canBeAttached
7579    @param {String} module Name of the module to check.
7580    @return {Boolean} Result of the module's test if it has one, or `true`.
7581    **/
7582    _canBeAttached: function (m) {
7583        m = this.getModule(m);
7584        if (m && m.test) {
7585            if (!m.hasOwnProperty('_testResult')) {
7586                m._testResult = m.test(Y);
7587            }
7588            return m._testResult;
7589        }
7590        // return `true` for modules not registered as Loader will know what
7591        // to do with them later on
7592        return true;
7593    },
7594
7595    /**
7596     * Returns an object containing properties for all modules required
7597     * in order to load the requested module
7598     * @method getRequires
7599     * @param {object}  mod The module definition from moduleInfo.
7600     * @return {array} the expanded requirement list.
7601     */
7602    getRequires: function(mod) {
7603
7604        if (!mod) {
7605            //console.log('returning no reqs for ' + mod.name);
7606            return NO_REQUIREMENTS;
7607        }
7608
7609        if (mod._parsed) {
7610            //console.log('returning requires for ' + mod.name, mod.requires);
7611            return mod.expanded || NO_REQUIREMENTS;
7612        }
7613
7614        //TODO add modue cache here out of scope..
7615
7616        var i, m, j, length, add, packName, lang, testresults = this.testresults,
7617            name = mod.name, cond,
7618            adddef = ON_PAGE[name] && ON_PAGE[name].details,
7619            optReqs = mod.optionalRequires,
7620            d, go, def,
7621            r, old_mod,
7622            o, skinmod, skindef, skinpar, skinname,
7623            intl = mod.lang || mod.intl,
7624            ftests = Y.Features && Y.Features.tests.load,
7625            hash, reparse;
7626
7627        // console.log(name);
7628
7629        // pattern match leaves module stub that needs to be filled out
7630        if (mod.temp && adddef) {
7631            old_mod = mod;
7632            mod = this.addModule(adddef, name);
7633            mod.group = old_mod.group;
7634            mod.pkg = old_mod.pkg;
7635            delete mod.expanded;
7636        }
7637
7638        // console.log('cache: ' + mod.langCache + ' == ' + this.lang);
7639
7640        //If a skin or a lang is different, reparse..
7641        reparse = !((!this.lang || mod.langCache === this.lang) && (mod.skinCache === this.skin.defaultSkin));
7642
7643        if (mod.expanded && !reparse) {
7644            return mod.expanded;
7645        }
7646
7647        // Optional dependencies are dependencies that may or may not be
7648        // available.
7649        // This feature was designed specifically to be used when transpiling
7650        // ES6 modules, in order to use polyfills and regular scripts that define
7651        // global variables without having to import them since they should be
7652        // available in the global scope.
7653        if (optReqs) {
7654            for (i = 0, length = optReqs.length; i < length; i++) {
7655                if (this._canBeAttached(optReqs[i])) {
7656                    mod.requires.push(optReqs[i]);
7657                }
7658            }
7659        }
7660
7661        d = [];
7662        hash = {};
7663        r = this.filterRequires(mod.requires);
7664        if (mod.lang) {
7665            //If a module has a lang attribute, auto add the intl requirement.
7666            d.unshift('intl');
7667            r.unshift('intl');
7668            intl = true;
7669        }
7670        o = this.filterRequires(mod.optional);
7671
7672
7673        mod._parsed = true;
7674        mod.langCache = this.lang;
7675        mod.skinCache = this.skin.defaultSkin;
7676
7677        for (i = 0; i < r.length; i++) {
7678            if (!hash[r[i]]) {
7679                d.push(r[i]);
7680                hash[r[i]] = true;
7681                m = this.getModule(r[i]);
7682                if (m) {
7683                    add = this.getRequires(m);
7684                    intl = intl || (m.expanded_map &&
7685                        (INTL in m.expanded_map));
7686                    for (j = 0; j < add.length; j++) {
7687                        d.push(add[j]);
7688                    }
7689                }
7690            }
7691        }
7692
7693        // get the requirements from superseded modules, if any
7694        r = this.filterRequires(mod.supersedes);
7695        if (r) {
7696            for (i = 0; i < r.length; i++) {
7697                if (!hash[r[i]]) {
7698                    // if this module has submodules, the requirements list is
7699                    // expanded to include the submodules.  This is so we can
7700                    // prevent dups when a submodule is already loaded and the
7701                    // parent is requested.
7702                    if (mod.submodules) {
7703                        d.push(r[i]);
7704                    }
7705
7706                    hash[r[i]] = true;
7707                    m = this.getModule(r[i]);
7708
7709                    if (m) {
7710                        add = this.getRequires(m);
7711                        intl = intl || (m.expanded_map &&
7712                            (INTL in m.expanded_map));
7713                        for (j = 0; j < add.length; j++) {
7714                            d.push(add[j]);
7715                        }
7716                    }
7717                }
7718            }
7719        }
7720
7721        if (o && this.loadOptional) {
7722            for (i = 0; i < o.length; i++) {
7723                if (!hash[o[i]]) {
7724                    d.push(o[i]);
7725                    hash[o[i]] = true;
7726                    m = this.getModuleInfo(o[i]);
7727                    if (m) {
7728                        add = this.getRequires(m);
7729                        intl = intl || (m.expanded_map &&
7730                            (INTL in m.expanded_map));
7731                        for (j = 0; j < add.length; j++) {
7732                            d.push(add[j]);
7733                        }
7734                    }
7735                }
7736            }
7737        }
7738
7739        cond = this.conditions[name];
7740
7741        if (cond) {
7742            //Set the module to not parsed since we have conditionals and this could change the dependency tree.
7743            mod._parsed = false;
7744            if (testresults && ftests) {
7745                oeach(testresults, function(result, id) {
7746                    var condmod = ftests[id].name;
7747                    if (!hash[condmod] && ftests[id].trigger === name) {
7748                        if (result && ftests[id]) {
7749                            hash[condmod] = true;
7750                            d.push(condmod);
7751                        }
7752                    }
7753                });
7754            } else {
7755                for (i in cond) {
7756                    if (cond.hasOwnProperty(i)) {
7757                        if (!hash[i]) {
7758                            def = cond[i];
7759                            //first see if they've specfied a ua check
7760                            //then see if they've got a test fn & if it returns true
7761                            //otherwise just having a condition block is enough
7762                            go = def && ((!def.ua && !def.test) || (def.ua && Y.UA[def.ua]) ||
7763                                        (def.test && def.test(Y, r)));
7764
7765                            if (go) {
7766                                hash[i] = true;
7767                                d.push(i);
7768                                m = this.getModule(i);
7769                                if (m) {
7770                                    add = this.getRequires(m);
7771                                    for (j = 0; j < add.length; j++) {
7772                                        d.push(add[j]);
7773                                    }
7774
7775                                }
7776                            }
7777                        }
7778                    }
7779                }
7780            }
7781        }
7782
7783        // Create skin modules
7784        if (mod.skinnable) {
7785            skindef = this.skin.overrides;
7786            for (i in YUI.Env.aliases) {
7787                if (YUI.Env.aliases.hasOwnProperty(i)) {
7788                    if (Y.Array.indexOf(YUI.Env.aliases[i], name) > -1) {
7789                        skinpar = i;
7790                    }
7791                }
7792            }
7793            if (skindef && (skindef[name] || (skinpar && skindef[skinpar]))) {
7794                skinname = name;
7795                if (skindef[skinpar]) {
7796                    skinname = skinpar;
7797                }
7798                for (i = 0; i < skindef[skinname].length; i++) {
7799                    skinmod = this._addSkin(skindef[skinname][i], name);
7800                    if (!this.isCSSLoaded(skinmod, this._boot)) {
7801                        d.push(skinmod);
7802                    }
7803                }
7804            } else {
7805                skinmod = this._addSkin(this.skin.defaultSkin, name);
7806                if (!this.isCSSLoaded(skinmod, this._boot)) {
7807                    d.push(skinmod);
7808                }
7809            }
7810        }
7811
7812        mod._parsed = false;
7813
7814        if (intl) {
7815
7816            if (mod.lang && !mod.langPack && Y.Intl) {
7817                lang = Y.Intl.lookupBestLang(this.lang || ROOT_LANG, mod.lang);
7818                packName = this.getLangPackName(lang, name);
7819                if (packName) {
7820                    d.unshift(packName);
7821                }
7822            }
7823            d.unshift(INTL);
7824        }
7825
7826        mod.expanded_map = yArray.hash(d);
7827
7828        mod.expanded = YObject.keys(mod.expanded_map);
7829
7830        return mod.expanded;
7831    },
7832    /**
7833    * Check to see if named css module is already loaded on the page
7834    * @method isCSSLoaded
7835    * @param {String} name The name of the css file
7836    * @param {Boolean} skip To skip the short-circuit for ignoreRegister
7837    * @return Boolean
7838    */
7839    isCSSLoaded: function(name, skip) {
7840        //TODO - Make this call a batching call with name being an array
7841        if (!name || !YUI.Env.cssStampEl || (!skip && this.ignoreRegistered)) {
7842            return false;
7843        }
7844        var el = YUI.Env.cssStampEl,
7845            ret = false,
7846            mod = YUI.Env._cssLoaded[name],
7847            style = el.currentStyle; //IE
7848
7849
7850        if (mod !== undefined) {
7851            return mod;
7852        }
7853
7854        //Add the classname to the element
7855        el.className = name;
7856
7857        if (!style) {
7858            style = Y.config.doc.defaultView.getComputedStyle(el, null);
7859        }
7860
7861        if (style && style.display === 'none') {
7862            ret = true;
7863        }
7864
7865
7866        el.className = ''; //Reset the classname to ''
7867
7868        YUI.Env._cssLoaded[name] = ret;
7869
7870        return ret;
7871    },
7872
7873    /**
7874     * Returns a hash of module names the supplied module satisfies.
7875     * @method getProvides
7876     * @param {string} name The name of the module.
7877     * @return {object} what this module provides.
7878     */
7879    getProvides: function(name) {
7880        var m = this.getModule(name), o, s;
7881            // supmap = this.provides;
7882
7883        if (!m) {
7884            return NOT_FOUND;
7885        }
7886
7887        if (m && !m.provides) {
7888            o = {};
7889            s = m.supersedes;
7890
7891            if (s) {
7892                yArray.each(s, function(v) {
7893                    Y.mix(o, this.getProvides(v));
7894                }, this);
7895            }
7896
7897            o[name] = true;
7898            m.provides = o;
7899
7900        }
7901
7902        return m.provides;
7903    },
7904
7905    /**
7906     * Calculates the dependency tree, the result is stored in the sorted
7907     * property.
7908     * @method calculate
7909     * @param {object} o optional options object.
7910     * @param {string} type optional argument to prune modules.
7911     */
7912    calculate: function(o, type) {
7913        if (o || type || this.dirty) {
7914
7915            if (o) {
7916                this._config(o);
7917            }
7918
7919            if (!this._init) {
7920                this._setup();
7921            }
7922
7923            this._explode();
7924
7925            if (this.allowRollup) {
7926                this._rollup();
7927            } else {
7928                this._explodeRollups();
7929            }
7930            this._reduce();
7931            this._sort();
7932        }
7933    },
7934    /**
7935    * Creates a "psuedo" package for languages provided in the lang array
7936    * @method _addLangPack
7937    * @private
7938    * @param {String} lang The language to create
7939    * @param {Object} m The module definition to create the language pack around
7940    * @param {String} packName The name of the package (e.g: lang/datatype-date-en-US)
7941    * @return {Object} The module definition
7942    */
7943    _addLangPack: function(lang, m, packName) {
7944        var name = m.name,
7945            packPath, conf,
7946            existing = this.getModuleInfo(packName);
7947
7948        if (!existing) {
7949
7950            packPath = _path((m.pkg || name), packName, JS, true);
7951
7952            conf = {
7953                path: packPath,
7954                intl: true,
7955                langPack: true,
7956                ext: m.ext,
7957                group: m.group,
7958                supersedes: []
7959            };
7960            if (m.root) {
7961                conf.root = m.root;
7962            }
7963            if (m.base) {
7964                conf.base = m.base;
7965            }
7966
7967            if (m.configFn) {
7968                conf.configFn = m.configFn;
7969            }
7970
7971            this.addModule(conf, packName);
7972
7973            if (lang) {
7974                Y.Env.lang = Y.Env.lang || {};
7975                Y.Env.lang[lang] = Y.Env.lang[lang] || {};
7976                Y.Env.lang[lang][name] = true;
7977            }
7978        }
7979
7980        return this.getModuleInfo(packName);
7981    },
7982
7983    /**
7984     * Investigates the current YUI configuration on the page.  By default,
7985     * modules already detected will not be loaded again unless a force
7986     * option is encountered.  Called by calculate()
7987     * @method _setup
7988     * @private
7989     */
7990    _setup: function() {
7991        var info = this.moduleInfo, name, i, j, m, l,
7992            packName;
7993
7994        for (name in info) {
7995            if (info.hasOwnProperty(name)) {
7996                m = info[name];
7997                if (m) {
7998
7999                    // remove dups
8000                    //m.requires = YObject.keys(yArray.hash(m.requires));
8001                    m.requires = yArray.dedupe(m.requires);
8002
8003                    // Create lang pack modules
8004                    //if (m.lang && m.lang.length) {
8005                    if (m.lang) {
8006                        // Setup root package if the module has lang defined,
8007                        // it needs to provide a root language pack
8008                        packName = this.getLangPackName(ROOT_LANG, name);
8009                        this._addLangPack(null, m, packName);
8010                    }
8011
8012                }
8013            }
8014        }
8015
8016
8017        //l = Y.merge(this.inserted);
8018        l = {};
8019
8020        // available modules
8021        if (!this.ignoreRegistered) {
8022            Y.mix(l, GLOBAL_ENV.mods);
8023        }
8024
8025        // add the ignore list to the list of loaded packages
8026        if (this.ignore) {
8027            Y.mix(l, yArray.hash(this.ignore));
8028        }
8029
8030        // expand the list to include superseded modules
8031        for (j in l) {
8032            if (l.hasOwnProperty(j)) {
8033                Y.mix(l, this.getProvides(j));
8034            }
8035        }
8036
8037        // remove modules on the force list from the loaded list
8038        if (this.force) {
8039            for (i = 0; i < this.force.length; i++) {
8040                if (this.force[i] in l) {
8041                    delete l[this.force[i]];
8042                }
8043            }
8044        }
8045
8046        Y.mix(this.loaded, l);
8047
8048        this._init = true;
8049    },
8050
8051    /**
8052     * Builds a module name for a language pack
8053     * @method getLangPackName
8054     * @param {string} lang the language code.
8055     * @param {string} mname the module to build it for.
8056     * @return {string} the language pack module name.
8057     */
8058    getLangPackName: function(lang, mname) {
8059        return ('lang/' + mname + ((lang) ? '_' + lang : ''));
8060    },
8061    /**
8062     * Inspects the required modules list looking for additional
8063     * dependencies.  Expands the required list to include all
8064     * required modules.  Called by calculate()
8065     * @method _explode
8066     * @private
8067     */
8068    _explode: function() {
8069        //TODO Move done out of scope
8070        var r = this.required, m, reqs, done = {},
8071            self = this, name, expound;
8072
8073        // the setup phase is over, all modules have been created
8074        self.dirty = false;
8075
8076        self._explodeRollups();
8077        r = self.required;
8078
8079        for (name in r) {
8080            if (r.hasOwnProperty(name)) {
8081                if (!done[name]) {
8082                    done[name] = true;
8083                    m = self.getModule(name);
8084                    if (m) {
8085                        expound = m.expound;
8086
8087                        if (expound) {
8088                            r[expound] = self.getModule(expound);
8089                            reqs = self.getRequires(r[expound]);
8090                            Y.mix(r, yArray.hash(reqs));
8091                        }
8092
8093                        reqs = self.getRequires(m);
8094                        Y.mix(r, yArray.hash(reqs));
8095                    }
8096                }
8097            }
8098        }
8099
8100    },
8101    /**
8102    * The default method used to test a module against a pattern
8103    * @method _patternTest
8104    * @private
8105    * @param {String} mname The module being tested
8106    * @param {String} pname The pattern to match
8107    */
8108    _patternTest: function(mname, pname) {
8109        return (mname.indexOf(pname) > -1);
8110    },
8111    /**
8112    * Get's the loader meta data for the requested module
8113    * @method getModule
8114    * @param {String} mname The module name to get
8115    * @return {Object} The module metadata
8116    */
8117    getModule: function(mname) {
8118        //TODO: Remove name check - it's a quick hack to fix pattern WIP
8119        if (!mname) {
8120            return null;
8121        }
8122
8123        var p, found, pname,
8124            m = this.getModuleInfo(mname),
8125            patterns = this.patterns;
8126
8127        // check the patterns library to see if we should automatically add
8128        // the module with defaults
8129        if (!m || (m && m.ext)) {
8130            for (pname in patterns) {
8131                if (patterns.hasOwnProperty(pname)) {
8132                    p = patterns[pname];
8133
8134                    //There is no test method, create a default one that tests
8135                    // the pattern against the mod name
8136                    if (!p.test) {
8137                        p.test = this._patternTest;
8138                    }
8139
8140                    if (p.test(mname, pname)) {
8141                        // use the metadata supplied for the pattern
8142                        // as the module definition.
8143                        found = p;
8144                        break;
8145                    }
8146                }
8147            }
8148        }
8149
8150        if (!m) {
8151            if (found) {
8152                if (p.action) {
8153                    p.action.call(this, mname, pname);
8154                } else {
8155                    // ext true or false?
8156                    m = this.addModule(Y.merge(found, {
8157                        test: void 0,
8158                        temp: true
8159                    }), mname);
8160                    if (m && found.configFn) {
8161                        m.configFn = found.configFn;
8162                    }
8163                }
8164            }
8165        } else {
8166            if (found && m && found.configFn && !m.configFn) {
8167                m.configFn = found.configFn;
8168                m.configFn(m);
8169            }
8170        }
8171
8172        return m;
8173    },
8174
8175    // impl in rollup submodule
8176    _rollup: function() { },
8177
8178    /**
8179     * Remove superceded modules and loaded modules.  Called by
8180     * calculate() after we have the mega list of all dependencies
8181     * @method _reduce
8182     * @return {object} the reduced dependency hash.
8183     * @private
8184     */
8185    _reduce: function(r) {
8186
8187        r = r || this.required;
8188
8189        var i, j, s, m, type = this.loadType,
8190        ignore = this.ignore ? yArray.hash(this.ignore) : false;
8191
8192        for (i in r) {
8193            if (r.hasOwnProperty(i)) {
8194                m = this.getModule(i);
8195                // remove if already loaded
8196                if (((this.loaded[i] || ON_PAGE[i]) &&
8197                        !this.forceMap[i] && !this.ignoreRegistered) ||
8198                        (type && m && m.type !== type)) {
8199                    delete r[i];
8200                }
8201                if (ignore && ignore[i]) {
8202                    delete r[i];
8203                }
8204                // remove anything this module supersedes
8205                s = m && m.supersedes;
8206                if (s) {
8207                    for (j = 0; j < s.length; j++) {
8208                        if (s[j] in r) {
8209                            delete r[s[j]];
8210                        }
8211                    }
8212                }
8213            }
8214        }
8215
8216        return r;
8217    },
8218    /**
8219    * Handles the queue when a module has been loaded for all cases
8220    * @method _finish
8221    * @private
8222    * @param {String} msg The message from Loader
8223    * @param {Boolean} success A boolean denoting success or failure
8224    */
8225    _finish: function(msg, success) {
8226
8227        _queue.running = false;
8228
8229        var onEnd = this.onEnd;
8230        if (onEnd) {
8231            onEnd.call(this.context, {
8232                msg: msg,
8233                data: this.data,
8234                success: success
8235            });
8236        }
8237        this._continue();
8238    },
8239    /**
8240    * The default Loader onSuccess handler, calls this.onSuccess with a payload
8241    * @method _onSuccess
8242    * @private
8243    */
8244    _onSuccess: function() {
8245        var self = this, skipped = Y.merge(self.skipped), fn,
8246            failed = [], rreg = self.requireRegistration,
8247            success, msg, i, mod;
8248
8249        for (i in skipped) {
8250            if (skipped.hasOwnProperty(i)) {
8251                delete self.inserted[i];
8252            }
8253        }
8254
8255        self.skipped = {};
8256
8257        for (i in self.inserted) {
8258            if (self.inserted.hasOwnProperty(i)) {
8259                mod = self.getModule(i);
8260                if (mod && rreg && mod.type === JS && !(i in YUI.Env.mods)) {
8261                    failed.push(i);
8262                } else {
8263                    Y.mix(self.loaded, self.getProvides(i));
8264                }
8265            }
8266        }
8267
8268        fn = self.onSuccess;
8269        msg = (failed.length) ? 'notregistered' : 'success';
8270        success = !(failed.length);
8271        if (fn) {
8272            fn.call(self.context, {
8273                msg: msg,
8274                data: self.data,
8275                success: success,
8276                failed: failed,
8277                skipped: skipped
8278            });
8279        }
8280        self._finish(msg, success);
8281    },
8282    /**
8283    * The default Loader onProgress handler, calls this.onProgress with a payload
8284    * @method _onProgress
8285    * @private
8286    */
8287    _onProgress: function(e) {
8288        var self = this, i;
8289        //set the internal cache to what just came in.
8290        if (e.data && e.data.length) {
8291            for (i = 0; i < e.data.length; i++) {
8292                e.data[i] = self.getModule(e.data[i].name);
8293            }
8294        }
8295        if (self.onProgress) {
8296            self.onProgress.call(self.context, {
8297                name: e.url,
8298                data: e.data
8299            });
8300        }
8301    },
8302    /**
8303    * The default Loader onFailure handler, calls this.onFailure with a payload
8304    * @method _onFailure
8305    * @private
8306    */
8307    _onFailure: function(o) {
8308        var f = this.onFailure, msg = [], i = 0, len = o.errors.length;
8309
8310        for (i; i < len; i++) {
8311            msg.push(o.errors[i].error);
8312        }
8313
8314        msg = msg.join(',');
8315
8316
8317        if (f) {
8318            f.call(this.context, {
8319                msg: msg,
8320                data: this.data,
8321                success: false
8322            });
8323        }
8324
8325        this._finish(msg, false);
8326
8327    },
8328
8329    /**
8330    * The default Loader onTimeout handler, calls this.onTimeout with a payload
8331    * @method _onTimeout
8332    * @param {Get.Transaction} transaction The Transaction object from `Y.Get`
8333    * @private
8334    */
8335    _onTimeout: function(transaction) {
8336        var f = this.onTimeout;
8337        if (f) {
8338            f.call(this.context, {
8339                msg: 'timeout',
8340                data: this.data,
8341                success: false,
8342                transaction: transaction
8343            });
8344        }
8345    },
8346
8347    /**
8348     * Sorts the dependency tree.  The last step of calculate()
8349     * @method _sort
8350     * @private
8351     */
8352    _sort: function() {
8353        var name,
8354
8355            // Object containing module names.
8356            required = this.required,
8357
8358            // Keep track of whether we've visited a module.
8359            visited = {};
8360
8361        // Will contain modules names, in the correct order,
8362        // according to dependencies.
8363        this.sorted = [];
8364
8365        for (name in required) {
8366            if (!visited[name] && required.hasOwnProperty(name)) {
8367                this._visit(name, visited);
8368            }
8369        }
8370    },
8371
8372    /**
8373     * Recursively visits the dependencies of the module name
8374     * passed in, and appends each module name to the `sorted` property.
8375     * @param {String} name The name of a module.
8376     * @param {Object} visited Keeps track of whether a module was visited.
8377     * @method _visit
8378     * @private
8379     */
8380    _visit: function (name, visited) {
8381        var required, condition, moduleInfo, dependency, dependencies,
8382            trigger, isAfter, i, l;
8383
8384        visited[name] = true;
8385        required = this.required;
8386        moduleInfo = this.moduleInfo[name];
8387        condition = this.conditions[name] || {};
8388
8389        if (moduleInfo) {
8390            // Recurse on each dependency of this module,
8391            // figuring out its dependencies, and so on.
8392            dependencies = moduleInfo.expanded || moduleInfo.requires;
8393
8394            for (i = 0, l = dependencies.length; i < l; ++i) {
8395                dependency = dependencies[i];
8396                trigger = condition[dependency];
8397
8398                // We cannot process this dependency yet if it must
8399                // appear after our current module.
8400                isAfter = trigger && (!trigger.when || trigger.when === "after");
8401
8402                // Is this module name in the required list of modules,
8403                // and have we not already visited it?
8404                if (required[dependency] && !visited[dependency] && !isAfter) {
8405                    this._visit(dependency, visited);
8406                }
8407            }
8408        }
8409
8410        this.sorted.push(name);
8411    },
8412
8413    /**
8414    * Handles the actual insertion of script/link tags
8415    * @method _insert
8416    * @private
8417    * @param {Object} source The YUI instance the request came from
8418    * @param {Object} o The metadata to include
8419    * @param {String} type JS or CSS
8420    * @param {Boolean} [skipcalc=false] Do a Loader.calculate on the meta
8421    */
8422    _insert: function(source, o, type, skipcalc) {
8423
8424
8425        // restore the state at the time of the request
8426        if (source) {
8427            this._config(source);
8428        }
8429
8430        // build the dependency list
8431        // don't include type so we can process CSS and script in
8432        // one pass when the type is not specified.
8433
8434        var modules = this.resolve(!skipcalc),
8435            self = this, comp = 0, actions = 0,
8436            mods = {}, deps, complete;
8437
8438        self._refetch = [];
8439
8440        if (type) {
8441            //Filter out the opposite type and reset the array so the checks later work
8442            modules[((type === JS) ? CSS : JS)] = [];
8443        }
8444        if (!self.fetchCSS) {
8445            modules.css = [];
8446        }
8447        if (modules.js.length) {
8448            comp++;
8449        }
8450        if (modules.css.length) {
8451            comp++;
8452        }
8453
8454        //console.log('Resolved Modules: ', modules);
8455
8456        complete = function(d) {
8457            actions++;
8458            var errs = {}, i = 0, o = 0, u = '', fn,
8459                modName, resMods;
8460
8461            if (d && d.errors) {
8462                for (i = 0; i < d.errors.length; i++) {
8463                    if (d.errors[i].request) {
8464                        u = d.errors[i].request.url;
8465                    } else {
8466                        u = d.errors[i];
8467                    }
8468                    errs[u] = u;
8469                }
8470            }
8471
8472            if (d && d.data && d.data.length && (d.type === 'success')) {
8473                for (i = 0; i < d.data.length; i++) {
8474                    self.inserted[d.data[i].name] = true;
8475                    //If the external module has a skin or a lang, reprocess it
8476                    if (d.data[i].lang || d.data[i].skinnable) {
8477                        delete self.inserted[d.data[i].name];
8478                        self._refetch.push(d.data[i].name);
8479                    }
8480                }
8481            }
8482
8483            if (actions === comp) {
8484                self._loading = null;
8485                if (self._refetch.length) {
8486                    //Get the deps for the new meta-data and reprocess
8487                    for (i = 0; i < self._refetch.length; i++) {
8488                        deps = self.getRequires(self.getModule(self._refetch[i]));
8489                        for (o = 0; o < deps.length; o++) {
8490                            if (!self.inserted[deps[o]]) {
8491                                //We wouldn't be to this point without the module being here
8492                                mods[deps[o]] = deps[o];
8493                            }
8494                        }
8495                    }
8496                    mods = Y.Object.keys(mods);
8497                    if (mods.length) {
8498                        self.require(mods);
8499                        resMods = self.resolve(true);
8500                        if (resMods.cssMods.length) {
8501                            for (i=0; i <  resMods.cssMods.length; i++) {
8502                                modName = resMods.cssMods[i].name;
8503                                delete YUI.Env._cssLoaded[modName];
8504                                if (self.isCSSLoaded(modName)) {
8505                                    self.inserted[modName] = true;
8506                                    delete self.required[modName];
8507                                }
8508                            }
8509                            self.sorted = [];
8510                            self._sort();
8511                        }
8512                        d = null; //bail
8513                        self._insert(); //insert the new deps
8514                    }
8515                }
8516                if (d && d.fn) {
8517                    fn = d.fn;
8518                    delete d.fn;
8519                    fn.call(self, d);
8520                }
8521            }
8522        };
8523
8524        this._loading = true;
8525
8526        if (!modules.js.length && !modules.css.length) {
8527            actions = -1;
8528            complete({
8529                fn: self._onSuccess
8530            });
8531            return;
8532        }
8533
8534
8535        if (modules.css.length) { //Load CSS first
8536            Y.Get.css(modules.css, {
8537                data: modules.cssMods,
8538                attributes: self.cssAttributes,
8539                insertBefore: self.insertBefore,
8540                charset: self.charset,
8541                timeout: self.timeout,
8542                context: self,
8543                onProgress: function(e) {
8544                    self._onProgress.call(self, e);
8545                },
8546                onTimeout: function(d) {
8547                    self._onTimeout.call(self, d);
8548                },
8549                onSuccess: function(d) {
8550                    d.type = 'success';
8551                    d.fn = self._onSuccess;
8552                    complete.call(self, d);
8553                },
8554                onFailure: function(d) {
8555                    d.type = 'failure';
8556                    d.fn = self._onFailure;
8557                    complete.call(self, d);
8558                }
8559            });
8560        }
8561
8562        if (modules.js.length) {
8563            Y.Get.js(modules.js, {
8564                data: modules.jsMods,
8565                insertBefore: self.insertBefore,
8566                attributes: self.jsAttributes,
8567                charset: self.charset,
8568                timeout: self.timeout,
8569                autopurge: false,
8570                context: self,
8571                async: self.async,
8572                onProgress: function(e) {
8573                    self._onProgress.call(self, e);
8574                },
8575                onTimeout: function(d) {
8576                    self._onTimeout.call(self, d);
8577                },
8578                onSuccess: function(d) {
8579                    d.type = 'success';
8580                    d.fn = self._onSuccess;
8581                    complete.call(self, d);
8582                },
8583                onFailure: function(d) {
8584                    d.type = 'failure';
8585                    d.fn = self._onFailure;
8586                    complete.call(self, d);
8587                }
8588            });
8589        }
8590    },
8591    /**
8592    * Once a loader operation is completely finished, process any additional queued items.
8593    * @method _continue
8594    * @private
8595    */
8596    _continue: function() {
8597        if (!(_queue.running) && _queue.size() > 0) {
8598            _queue.running = true;
8599            _queue.next()();
8600        }
8601    },
8602
8603    /**
8604     * inserts the requested modules and their dependencies.
8605     * <code>type</code> can be "js" or "css".  Both script and
8606     * css are inserted if type is not provided.
8607     * @method insert
8608     * @param {object} o optional options object.
8609     * @param {string} type the type of dependency to insert.
8610     */
8611    insert: function(o, type, skipsort) {
8612        var self = this, copy = Y.merge(this);
8613        delete copy.require;
8614        delete copy.dirty;
8615        _queue.add(function() {
8616            self._insert(copy, o, type, skipsort);
8617        });
8618        this._continue();
8619    },
8620
8621    /**
8622     * Executed every time a module is loaded, and if we are in a load
8623     * cycle, we attempt to load the next script.  Public so that it
8624     * is possible to call this if using a method other than
8625     * Y.register to determine when scripts are fully loaded
8626     * @method loadNext
8627     * @deprecated
8628     * @param {string} mname optional the name of the module that has
8629     * been loaded (which is usually why it is time to load the next
8630     * one).
8631     */
8632    loadNext: function() {
8633        return;
8634    },
8635
8636    /**
8637     * Apply filter defined for this instance to a url/path
8638     * @method _filter
8639     * @param {string} u the string to filter.
8640     * @param {string} name the name of the module, if we are processing
8641     * a single module as opposed to a combined url.
8642     * @return {string} the filtered string.
8643     * @private
8644     */
8645    _filter: function(u, name, group) {
8646        var f = this.filter,
8647            hasFilter = name && (name in this.filters),
8648            modFilter = hasFilter && this.filters[name],
8649            groupName = group || (this.getModuleInfo(name) || {}).group || null;
8650
8651        if (groupName && this.groups[groupName] && this.groups[groupName].filter) {
8652            modFilter = this.groups[groupName].filter;
8653            hasFilter = true;
8654        }
8655
8656        if (u) {
8657            if (hasFilter) {
8658                f = (L.isString(modFilter)) ? this.FILTER_DEFS[modFilter.toUpperCase()] || null : modFilter;
8659            }
8660            if (f) {
8661                u = u.replace(new RegExp(f.searchExp, 'g'), f.replaceStr);
8662            }
8663        }
8664        return u;
8665    },
8666
8667    /**
8668     * Generates the full url for a module
8669     * @method _url
8670     * @param {string} path the path fragment.
8671     * @param {String} name The name of the module
8672     * @param {String} [base] The base url to use. Defaults to self.base
8673     * @return {string} the full url.
8674     * @private
8675     */
8676    _url: function(path, name, base) {
8677        return this._filter((base || this.base || '') + path, name);
8678    },
8679    /**
8680    * Returns an Object hash of file arrays built from `loader.sorted` or from an arbitrary list of sorted modules.
8681    * @method resolve
8682    * @param {Boolean} [calc=false] Perform a loader.calculate() before anything else
8683    * @param {Array} [sorted=loader.sorted] An override for the loader.sorted array
8684    * @return {Object} Object hash (js and css) of two arrays of file lists
8685    * @example This method can be used as an off-line dep calculator
8686    *
8687    *        var Y = YUI();
8688    *        var loader = new Y.Loader({
8689    *            filter: 'debug',
8690    *            base: '../../',
8691    *            root: 'build/',
8692    *            combine: true,
8693    *            require: ['node', 'dd', 'console']
8694    *        });
8695    *        var out = loader.resolve(true);
8696    *
8697    */
8698    resolve: function(calc, sorted) {
8699        var self     = this,
8700            resolved = { js: [], jsMods: [], css: [], cssMods: [] },
8701            addSingle,
8702            usePathogen = Y.config.comboLoader && Y.config.customComboBase;
8703
8704        if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) {
8705            self._resetModules();
8706        }
8707
8708        if (calc) {
8709            self.calculate();
8710        }
8711        sorted = sorted || self.sorted;
8712
8713        addSingle = function(mod) {
8714            if (mod) {
8715                var group = (mod.group && self.groups[mod.group]) || NOT_FOUND,
8716                    url;
8717
8718                //Always assume it's async
8719                if (group.async === false) {
8720                    mod.async = group.async;
8721                }
8722
8723                url = (mod.fullpath) ? self._filter(mod.fullpath, mod.name) :
8724                      self._url(mod.path, mod.name, group.base || mod.base);
8725
8726                if (mod.attributes || mod.async === false) {
8727                    url = {
8728                        url: url,
8729                        async: mod.async
8730                    };
8731                    if (mod.attributes) {
8732                        url.attributes = mod.attributes;
8733                    }
8734                }
8735                resolved[mod.type].push(url);
8736                resolved[mod.type + 'Mods'].push(mod);
8737            } else {
8738            }
8739
8740        };
8741
8742        /*jslint vars: true */
8743        var inserted     = (self.ignoreRegistered) ? {}
8743 : self.inserted,
8744            comboSources,
8745            maxURLLength,
8746            comboMeta,
8747            comboBase,
8748            comboSep,
8749            group,
8750            mod,
8751            len,
8752            i,
8753            hasComboModule = false;
8754
8755        /*jslint vars: false */
8756
8757        for (i = 0, len = sorted.length; i < len; i++) {
8758            mod = self.getModule(sorted[i]);
8759            if (!mod || inserted[mod.name]) {
8760                continue;
8761            }
8762
8763            group = self.groups[mod.group];
8764
8765            comboBase = self.comboBase;
8766
8767            if (group) {
8768                if (!group.combine || mod.fullpath) {
8769                    //This is not a combo module, skip it and load it singly later.
8770                    addSingle(mod);
8771                    continue;
8772                }
8773                mod.combine = true;
8774
8775                if (typeof group.root === 'string') {
8776                    mod.root = group.root;
8777                }
8778
8779                comboBase    = group.comboBase || comboBase;
8780                comboSep     = group.comboSep;
8781                maxURLLength = group.maxURLLength;
8782            } else {
8783                if (!self.combine) {
8784                    //This is not a combo module, skip it and load it singly later.
8785                    addSingle(mod);
8786                    continue;
8787                }
8788            }
8789
8790            if (!mod.combine && mod.ext) {
8791                addSingle(mod);
8792                continue;
8793            }
8794            hasComboModule = true;
8795            comboSources = comboSources || {};
8796            comboSources[comboBase] = comboSources[comboBase] ||
8797                { js: [], jsMods: [], css: [], cssMods: [] };
8798
8799            comboMeta               = comboSources[comboBase];
8800            comboMeta.group         = mod.group;
8801            comboMeta.comboSep      = comboSep || self.comboSep;
8802            comboMeta.maxURLLength  = maxURLLength || self.maxURLLength;
8803
8804            comboMeta[mod.type + 'Mods'].push(mod);
8805            if (mod.type === JS || mod.type === CSS) {
8806                resolved[mod.type + 'Mods'].push(mod);
8807            }
8808        }
8809        //only encode if we have something to encode
8810        if (hasComboModule) {
8811            if (usePathogen) {
8812                resolved = this._pathogenEncodeComboSources(resolved);
8813            } else {
8814                resolved = this._encodeComboSources(resolved, comboSources);
8815            }
8816        }
8817        return resolved;
8818    },
8819
8820    /**
8821     * Encodes combo sources and appends them to an object hash of arrays from `loader.resolve`.
8822     *
8823     * @method _encodeComboSources
8824     * @param {Object} resolved The object hash of arrays in which to attach the encoded combo sources.
8825     * @param {Object} comboSources An object containing relevant data about modules.
8826     * @return Object
8827     * @private
8828     */
8829    _encodeComboSources: function(resolved, comboSources) {
8830        var fragSubset,
8831            modules,
8832            tmpBase,
8833            baseLen,
8834            frags,
8835            frag,
8836            type,
8837            mod,
8838            maxURLLength,
8839            comboBase,
8840            comboMeta,
8841            comboSep,
8842            i,
8843            len,
8844            self = this;
8845
8846        for (comboBase in comboSources) {
8847            if (comboSources.hasOwnProperty(comboBase)) {
8848                comboMeta    = comboSources[comboBase];
8849                comboSep     = comboMeta.comboSep;
8850                maxURLLength = comboMeta.maxURLLength;
8851                for (type in comboMeta) {
8852                    if (type === JS || type === CSS) {
8853                        modules = comboMeta[type + 'Mods'];
8854                        frags = [];
8855                        for (i = 0, len = modules.length; i < len; i += 1) {
8856                            mod = modules[i];
8857                            frag = ((typeof mod.root === 'string') ? mod.root : self.root) + (mod.path || mod.fullpath);
8858                            frags.push(
8859                                self._filter(frag, mod.name)
8860                            );
8861                        }
8862                        tmpBase = comboBase + frags.join(comboSep);
8863                        baseLen = tmpBase.length;
8864                        if (maxURLLength <= comboBase.length) {
8865                            maxURLLength = MAX_URL_LENGTH;
8866                        }
8867
8868                        if (frags.length) {
8869                            if (baseLen > maxURLLength) {
8870                                fragSubset = [];
8871                                for (i = 0, len = frags.length; i < len; i++) {
8872                                    fragSubset.push(frags[i]);
8873                                    tmpBase = comboBase + fragSubset.join(comboSep);
8874
8875                                    if (tmpBase.length > maxURLLength) {
8876                                        frag = fragSubset.pop();
8877                                        tmpBase = comboBase + fragSubset.join(comboSep);
8878                                        resolved[type].push(self._filter(tmpBase, null, comboMeta.group));
8879                                        fragSubset = [];
8880                                        if (frag) {
8881                                            fragSubset.push(frag);
8882                                        }
8883                                    }
8884                                }
8885                                if (fragSubset.length) {
8886                                    tmpBase = comboBase + fragSubset.join(comboSep);
8887                                    resolved[type].push(self._filter(tmpBase, null, comboMeta.group));
8888                                }
8889                            } else {
8890                                resolved[type].push(self._filter(tmpBase, null, comboMeta.group));
8891                            }
8892                        }
8893                    }
8894                }
8895            }
8896        }
8897        return resolved;
8898    },
8899
8900    /**
8901    Shortcut to calculate, resolve and load all modules.
8902
8903        var loader = new Y.Loader({
8904            ignoreRegistered: true,
8905            modules: {
8906                mod: {
8907                    path: 'mod.js'
8908                }
8909            },
8910            requires: [ 'mod' ]
8911        });
8912        loader.load(function() {
8913            console.log('All modules have loaded..');
8914        });
8915
8916
8917    @method load
8918    @param {Function} cb Executed after all load operations are complete
8919    */
8920    load: function(cb) {
8921        if (!cb) {
8922            return;
8923        }
8924        var self = this,
8925            out = self.resolve(true);
8926
8927        self.data = out;
8928
8929        self.onEnd = function() {
8930            cb.apply(self.context || self, arguments);
8931        };
8932
8933        self.insert();
8934    }
8935};
8936
8937
8938}, 'patched-v3.18.3', {"requires": ["get", "features"]});
8939YUI.add('loader-rollup', function (Y, NAME) {
8940
8941/**
8942 * Optional automatic rollup logic for reducing http connections
8943 * when not using a combo service.
8944 * @module loader
8945 * @submodule rollup
8946 */
8947
8948/**
8949 * Look for rollup packages to determine if all of the modules a
8950 * rollup supersedes are required.  If so, include the rollup to
8951 * help reduce the total number of connections required.  Called
8952 * by calculate().  This is an optional feature, and requires the
8953 * appropriate submodule to function.
8954 * @method _rollup
8955 * @for Loader
8956 * @private
8957 */
8958Y.Loader.prototype._rollup = function() {
8959    var i, j, m, s, r = this.required, roll,
8960        info = this.moduleInfo, rolled, c, smod;
8961
8962    // find and cache rollup modules
8963    if (this.dirty || !this.rollups) {
8964        this.rollups = {};
8965        for (i in info) {
8966            if (info.hasOwnProperty(i)) {
8967                m = this.getModule(i);
8968                // if (m && m.rollup && m.supersedes) {
8969                if (m && m.rollup) {
8970                    this.rollups[i] = m;
8971                }
8972            }
8973        }
8974    }
8975
8976    // make as many passes as needed to pick up rollup rollups
8977    for (;;) {
8978        rolled = false;
8979
8980        // go through the rollup candidates
8981        for (i in this.rollups) {
8982            if (this.rollups.hasOwnProperty(i)) {
8983                // there can be only one, unless forced
8984                if (!r[i] && ((!this.loaded[i]) || this.forceMap[i])) {
8985                    m = this.getModule(i);
8986                    s = m.supersedes || [];
8987                    roll = false;
8988
8989                    // @TODO remove continue
8990                    if (!m.rollup) {
8991                        continue;
8992                    }
8993
8994                    c = 0;
8995
8996                    // check the threshold
8997                    for (j = 0; j < s.length; j++) {
8998                        smod = info[s[j]];
8999
9000                        // if the superseded module is loaded, we can't
9001                        // load the rollup unless it has been forced.
9002                        if (this.loaded[s[j]] && !this.forceMap[s[j]]) {
9003                            roll = false;
9004                            break;
9005                        // increment the counter if this module is required.
9006                        // if we are beyond the rollup threshold, we will
9007                        // use the rollup module
9008                        } else if (r[s[j]] && m.type === smod.type) {
9009                            c++;
9010                            roll = (c >= m.rollup);
9011                            if (roll) {
9012                                break;
9013                            }
9014                        }
9015                    }
9016
9017                    if (roll) {
9018                        // add the rollup
9019                        r[i] = true;
9020                        rolled = true;
9021
9022                        // expand the rollup's dependencies
9023                        this.getRequires(m);
9024                    }
9025                }
9026            }
9027        }
9028
9029        // if we made it here w/o rolling up something, we are done
9030        if (!rolled) {
9031            break;
9032        }
9033    }
9034};
9035
9036
9037}, 'patched-v3.18.3', {"requires": ["loader-base"]});
9038YUI.add('loader-yui3', function (Y, NAME) {
9039
9040/* This file is auto-generated by (yogi loader --yes --mix --start ../) */
9041
9042/*jshint maxlen:900, eqeqeq: false */
9043
9044/**
9045 * YUI 3 module metadata
9046 * @module loader
9047 * @submodule loader-yui3
9048 */
9049YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {};
9050Y.mix(YUI.Env[Y.version].modules, {
9051    "align-plugin": {
9052        "requires": [
9053            "node-screen",
9054            "node-pluginhost"
9055        ]
9056    },
9057    "anim": {
9058        "use": [
9059            "anim-base",
9060            "anim-color",
9061            "anim-curve",
9062            "anim-easing",
9063            "anim-node-plugin",
9064            "anim-scroll",
9065            "anim-xy"
9066        ]
9067    },
9068    "anim-base": {
9069        "requires": [
9070            "base-base",
9071            "node-style",
9072            "color-base"
9073        ]
9074    },
9075    "anim-color": {
9076        "requires": [
9077            "anim-base"
9078        ]
9079    },
9080    "anim-curve": {
9081        "requires": [
9082            "anim-xy"
9083        ]
9084    },
9085    "anim-easing": {
9086        "requires": [
9087            "anim-base"
9088        ]
9089    },
9090    "anim-node-plugin": {
9091        "requires": [
9092            "node-pluginhost",
9093            "anim-base"
9094        ]
9095    },
9096    "anim-scroll": {
9097        "requires": [
9098            "anim-base"
9099        ]
9100    },
9101    "anim-shape": {
9102        "requires": [
9103            "anim-base",
9104            "anim-easing",
9105            "anim-color",
9106            "matrix"
9107        ]
9108    },
9109    "anim-shape-transform": {
9110        "use": [
9111            "anim-shape"
9112        ]
9113    },
9114    "anim-xy": {
9115        "requires": [
9116            "anim-base",
9117            "node-screen"
9118        ]
9119    },
9120    "app": {
9121        "use": [
9122            "app-base",
9123            "app-content",
9124            "app-transitions",
9125            "lazy-model-list",
9126            "model",
9127            "model-list",
9128            "model-sync-rest",
9129            "model-sync-local",
9130            "router",
9131            "view",
9132            "view-node-map"
9133        ]
9134    },
9135    "app-base": {
9136        "requires": [
9137            "classnamemanager",
9138            "pjax-base",
9139            "router",
9140            "view"
9141        ]
9142    },
9143    "app-content": {
9144        "requires": [
9145            "app-base",
9146            "pjax-content"
9147        ]
9148    },
9149    "app-transitions": {
9150        "requires": [
9151            "app-base"
9152        ]
9153    },
9154    "app-transitions-css": {
9155        "type": "css"
9156    },
9157    "app-transitions-native": {
9158        "condition": {
9159            "name": "app-transitions-native",
9160            "test": function (Y) {
9161    var doc  = Y.config.doc,
9162        node = doc ? doc.documentElement : null;
9163
9164    if (node && node.style) {
9165        return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);
9166    }
9167
9168    return false;
9169},
9170            "trigger": "app-transitions"
9171        },
9172        "requires": [
9173            "app-transitions",
9174            "app-transitions-css",
9175            "parallel",
9176            "transition"
9177        ]
9178    },
9179    "array-extras": {
9180        "requires": [
9181            "yui-base"
9182        ]
9183    },
9184    "array-invoke": {
9185        "requires": [
9186            "yui-base"
9187        ]
9188    },
9189    "arraylist": {
9190        "requires": [
9191            "yui-base"
9192        ]
9193    },
9194    "arraylist-add": {
9195        "requires": [
9196            "arraylist"
9197        ]
9198    },
9199    "arraylist-filter": {
9200        "requires": [
9201            "arraylist"
9202        ]
9203    },
9204    "arraysort": {
9205        "requires": [
9206            "yui-base"
9207        ]
9208    },
9209    "async-queue": {
9210        "requires": [
9211            "event-custom"
9212        ]
9213    },
9214    "attribute": {
9215        "use": [
9216            "attribute-base",
9217            "attribute-complex"
9218        ]
9219    },
9220    "attribute-base": {
9221        "requires": [
9222            "attribute-core",
9223            "attribute-observable",
9224            "attribute-extras"
9225        ]
9226    },
9227    "attribute-complex": {
9228        "requires": [
9229            "attribute-base"
9230        ]
9231    },
9232    "attribute-core": {
9233        "requires": [
9234            "oop"
9235        ]
9236    },
9237    "attribute-events": {
9238        "use": [
9239            "attribute-observable"
9240        ]
9241    },
9242    "attribute-extras": {
9243        "requires": [
9244            "oop"
9245        ]
9246    },
9247    "attribute-observable": {
9248        "requires": [
9249            "event-custom"
9250        ]
9251    },
9252    "autocomplete": {
9253        "use": [
9254            "autocomplete-base",
9255            "autocomplete-sources",
9256            "autocomplete-list",
9257            "autocomplete-plugin"
9258        ]
9259    },
9260    "autocomplete-base": {
9261        "optional": [
9262            "autocomplete-sources"
9263        ],
9264        "requires": [
9265            "array-extras",
9266            "base-build",
9267            "escape",
9268            "event-valuechange",
9269            "node-base"
9270        ]
9271    },
9272    "autocomplete-filters": {
9273        "requires": [
9274            "array-extras",
9275            "text-wordbreak"
9276        ]
9277    },
9278    "autocomplete-filters-accentfold": {
9279        "requires": [
9280            "array-extras",
9281            "text-accentfold",
9282            "text-wordbreak"
9283        ]
9284    },
9285    "autocomplete-highlighters": {
9286        "requires": [
9287            "array-extras",
9288            "highlight-base"
9289        ]
9290    },
9291    "autocomplete-highlighters-accentfold": {
9292        "requires": [
9293            "array-extras",
9294            "highlight-accentfold"
9295        ]
9296    },
9297    "autocomplete-list": {
9298        "after": [
9299            "autocomplete-sources"
9300        ],
9301        "lang": [
9302            "en",
9303            "es",
9304            "hu",
9305            "it"
9306        ],
9307        "requires": [
9308            "autocomplete-base",
9309            "event-resize",
9310            "node-screen",
9311            "selector-css3",
9312            "shim-plugin",
9313            "widget",
9314            "widget-position",
9315            "widget-position-align"
9316        ],
9317        "skinnable": true
9318    },
9319    "autocomplete-list-keys": {
9320        "condition": {
9321            "name": "autocomplete-list-keys",
9322            "test": function (Y) {
9323    // Only add keyboard support to autocomplete-list if this doesn't appear to
9324    // be an iOS or Android-based mobile device.
9325    //
9326    // There's currently no feasible way to actually detect whether a device has
9327    // a hardware keyboard, so this sniff will have to do. It can easily be
9328    // overridden by manually loading the autocomplete-list-keys module.
9329    //
9330    // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari
9331    // doesn't fire the keyboard events used by AutoCompleteList, so there's
9332    // no point loading the -keys module even when a bluetooth keyboard may be
9333    // available.
9334    return !(Y.UA.ios || Y.UA.android);
9335},
9336            "trigger": "autocomplete-list"
9337        },
9338        "requires": [
9339            "autocomplete-list",
9340            "base-build"
9341        ]
9342    },
9343    "autocomplete-plugin": {
9344        "requires": [
9345            "autocomplete-list",
9346            "node-pluginhost"
9347        ]
9348    },
9349    "autocomplete-sources": {
9350        "optional": [
9351            "io-base",
9352            "json-parse",
9353            "jsonp",
9354            "yql"
9355        ],
9356        "requires": [
9357            "autocomplete-base"
9358        ]
9359    },
9360    "axes": {
9361        "use": [
9362            "axis-numeric",
9363            "axis-category",
9364            "axis-time",
9365            "axis-stacked"
9366        ]
9367    },
9368    "axes-base": {
9369        "use": [
9370            "axis-numeric-base",
9371            "axis-category-base",
9372            "axis-time-base",
9373            "axis-stacked-base"
9374        ]
9375    },
9376    "axis": {
9377        "requires": [
9378            "dom",
9379            "widget",
9380            "widget-position",
9381            "widget-stack",
9382            "graphics",
9383            "axis-base"
9384        ]
9385    },
9386    "axis-base": {
9387        "requires": [
9388            "classnamemanager",
9389            "datatype-number",
9390            "datatype-date",
9391            "base",
9392            "event-custom"
9393        ]
9394    },
9395    "axis-category": {
9396        "requires": [
9397            "axis",
9398            "axis-category-base"
9399        ]
9400    },
9401    "axis-category-base": {
9402        "requires": [
9403            "axis-base"
9404        ]
9405    },
9406    "axis-numeric": {
9407        "requires": [
9408            "axis",
9409            "axis-numeric-base"
9410        ]
9411    },
9412    "axis-numeric-base": {
9413        "requires": [
9414            "axis-base"
9415        ]
9416    },
9417    "axis-stacked": {
9418        "requires": [
9419            "axis-numeric",
9420            "axis-stacked-base"
9421        ]
9422    },
9423    "axis-stacked-base": {
9424        "requires": [
9425            "axis-numeric-base"
9426        ]
9427    },
9428    "axis-time": {
9429        "requires": [
9430            "axis",
9431            "axis-time-base"
9432        ]
9433    },
9434    "axis-time-base": {
9435        "requires": [
9436            "axis-base"
9437        ]
9438    },
9439    "base": {
9440        "use": [
9441            "base-base",
9442            "base-pluginhost",
9443            "base-build"
9444        ]
9445    },
9446    "base-base": {
9447        "requires": [
9448            "attribute-base",
9449            "base-core",
9450            "base-observable"
9451        ]
9452    },
9453    "base-build": {
9454        "requires": [
9455            "base-base"
9456        ]
9457    },
9458    "base-core": {
9459        "requires": [
9460            "attribute-core"
9461        ]
9462    },
9463    "base-observable": {
9464        "requires": [
9465            "attribute-observable",
9466            "base-core"
9467        ]
9468    },
9469    "base-pluginhost": {
9470        "requires": [
9471            "base-base",
9472            "pluginhost"
9473        ]
9474    },
9475    "button": {
9476        "requires": [
9477            "button-core",
9478            "cssbutton",
9479            "widget"
9480        ]
9481    },
9482    "button-core": {
9483        "requires": [
9484            "attribute-core",
9485            "classnamemanager",
9486            "node-base",
9487            "escape"
9488        ]
9489    },
9490    "button-group": {
9491        "requires": [
9492            "button-plugin",
9493            "cssbutton",
9494            "widget"
9495        ]
9496    },
9497    "button-plugin": {
9498        "requires": [
9499            "button-core",
9500            "cssbutton",
9501            "node-pluginhost"
9502        ]
9503    },
9504    "cache": {
9505        "use": [
9506            "cache-base",
9507            "cache-offline",
9508            "cache-plugin"
9509        ]
9510    },
9511    "cache-base": {
9512        "requires": [
9513            "base"
9514        ]
9515    },
9516    "cache-offline": {
9517        "requires": [
9518            "cache-base",
9519            "json"
9520        ]
9521    },
9522    "cache-plugin": {
9523        "requires": [
9524            "plugin",
9525            "cache-base"
9526        ]
9527    },
9528    "calendar": {
9529        "requires": [
9530            "calendar-base",
9531            "calendarnavigator"
9532        ],
9533        "skinnable": true
9534    },
9535    "calendar-base": {
9536        "lang": [
9537            "ar-SA",
9538            "bg-BG",
9539            "ca-AD",
9540            "ca-ES",
9541            "cs-CZ",
9542            "da-DK",
9543            "de",
9544            "el-GR",
9545            "en-AU",
9546            "en-GB",
9547            "en",
9548            "es-AR",
9549            "es",
9550            "et-EE",
9551            "eu-ES",
9552            "fa-IR",
9553            "fr-CA",
9554            "fr",
9555            "gl-ES",
9556            "hi-IN",
9557            "hr-HR",
9558            "hu",
9559            "in-ID",
9560            "it-IT",
9561            "it",
9562            "iw-IL",
9563            "ja",
9564            "ko-KR",
9565            "lo-LA",
9566            "lt-LT",
9567            "nb-NO",
9568            "nl-BE",
9569            "nl-NL",
9570            "nl",
9571            "pl-PL",
9572            "pt-BR",
9573            "pt-PT",
9574            "ro-RO",
9575            "ru-RU",
9576            "ru",
9577            "sk-SK",
9578            "sl-SL",
9579            "sr-RS-latin",
9580            "sr-RS",
9581            "sv-SE",
9582            "th-TH",
9583            "tr-TR",
9584            "uk-UA",
9585            "vi-VN",
9586            "zh-Hans-CN",
9587            "zh-Hans",
9588            "zh-Hant-HK",
9589            "zh-HANT-TW",
9590            "zh-Hant",
9591            "zh-TW"
9592        ],
9593        "requires": [
9594            "widget",
9595            "datatype-date",
9596            "datatype-date-math",
9597            "cssgrids"
9598        ],
9599        "skinnable": true
9600    },
9601    "calendarnavigator": {
9602        "lang": [
9603            "en",
9604            "es",
9605            "es-AR",
9606            "eu-ES"
9607        ],
9608        "requires": [
9609            "plugin",
9610            "classnamemanager",
9611            "datatype-date",
9612            "node"
9613        ],
9614        "skinnable": true
9615    },
9616    "charts": {
9617        "use": [
9618            "charts-base"
9619        ]
9620    },
9621    "charts-base": {
9622        "requires": [
9623            "dom",
9624            "event-mouseenter",
9625            "event-touch",
9626            "graphics-group",
9627            "axes",
9628            "series-pie",
9629            "series-line",
9630            "series-marker",
9631            "series-area",
9632            "series-spline",
9633            "series-column",
9634            "series-bar",
9635            "series-areaspline",
9636            "series-combo",
9637            "series-combospline",
9638            "series-line-stacked",
9639            "series-marker-stacked",
9640            "series-area-stacked",
9641            "series-spline-stacked",
9642            "series-column-stacked",
9643            "series-bar-stacked",
9644            "series-areaspline-stacked",
9645            "series-combo-stacked",
9646            "series-combospline-stacked"
9647        ]
9648    },
9649    "charts-legend": {
9650        "requires": [
9651            "charts-base"
9652        ]
9653    },
9654    "classnamemanager": {
9655        "requires": [
9656            "yui-base"
9657        ]
9658    },
9659    "clickable-rail": {
9660        "requires": [
9661            "slider-base"
9662        ]
9663    },
9664    "collection": {
9665        "use": [
9666            "array-extras",
9667            "arraylist",
9668            "arraylist-add",
9669            "arraylist-filter",
9670            "array-invoke"
9671        ]
9672    },
9673    "color": {
9674        "use": [
9675            "color-base",
9676            "color-hsl",
9677            "color-harmony"
9678        ]
9679    },
9680    "color-base": {
9681        "requires": [
9682            "yui-base"
9683        ]
9684    },
9685    "color-harmony": {
9686        "requires": [
9687            "color-hsl"
9688        ]
9689    },
9690    "color-hsl": {
9691        "requires": [
9692            "color-base"
9693        ]
9694    },
9695    "color-hsv": {
9696        "requires": [
9697            "color-base"
9698        ]
9699    },
9700    "console": {
9701        "lang": [
9702            "en",
9703            "es",
9704            "hu",
9705            "it",
9706            "ja"
9707        ],
9708        "requires": [
9709            "yui-log",
9710            "widget"
9711        ],
9712        "skinnable": true
9713    },
9714    "console-filters": {
9715        "requires": [
9716            "plugin",
9717            "console"
9718        ],
9719        "skinnable": true
9720    },
9721    "content-editable": {
9722        "requires": [
9723            "node-base",
9724            "editor-selection",
9725            "stylesheet",
9726            "plugin"
9727        ]
9728    },
9729    "controller": {
9730        "use": [
9731            "router"
9732        ]
9733    },
9734    "cookie": {
9735        "requires": [
9736            "yui-base"
9737        ]
9738    },
9739    "createlink-base": {
9740        "requires": [
9741            "editor-base"
9742        ]
9743    },
9744    "cssbase": {
9745        "after": [
9746            "cssreset",
9747            "cssfonts",
9748            "cssgrids",
9749            "cssreset-context",
9750            "cssfonts-context",
9751            "cssgrids-context"
9752        ],
9753        "type": "css"
9754    },
9755    "cssbase-context": {
9756        "after": [
9757            "cssreset",
9758            "cssfonts",
9759            "cssgrids",
9760            "cssreset-context",
9761            "cssfonts-context",
9762            "cssgrids-context"
9763        ],
9764        "type": "css"
9765    },
9766    "cssbutton": {
9767        "type": "css"
9768    },
9769    "cssfonts": {
9770        "type": "css"
9771    },
9772    "cssfonts-context": {
9773        "type": "css"
9774    },
9775    "cssgrids": {
9776        "optional": [
9777            "cssnormalize"
9778        ],
9779        "type": "css"
9780    },
9781    "cssgrids-base": {
9782        "optional": [
9783            "cssnormalize"
9784        ],
9785        "type": "css"
9786    },
9787    "cssgrids-responsive": {
9788        "optional": [
9789            "cssnormalize"
9790        ],
9791        "requires": [
9792            "cssgrids",
9793            "cssgrids-responsive-base"
9794        ],
9795        "type": "css"
9796    },
9797    "cssgrids-units": {
9798        "optional": [
9799            "cssnormalize"
9800        ],
9801        "requires": [
9802            "cssgrids-base"
9803        ],
9804        "type": "css"
9805    },
9806    "cssnormalize": {
9807        "type": "css"
9808    },
9809    "cssnormalize-context": {
9810        "type": "css"
9811    },
9812    "cssreset": {
9813        "type": "css"
9814    },
9815    "cssreset-context": {
9816        "type": "css"
9817    },
9818    "dataschema": {
9819        "use": [
9820            "dataschema-base",
9821            "dataschema-json",
9822            "dataschema-xml",
9823            "dataschema-array",
9824            "dataschema-text"
9825        ]
9826    },
9827    "dataschema-array": {
9828        "requires": [
9829            "dataschema-base"
9830        ]
9831    },
9832    "dataschema-base": {
9833        "requires": [
9834            "base"
9835        ]
9836    },
9837    "dataschema-json": {
9838        "requires": [
9839            "dataschema-base",
9840            "json"
9841        ]
9842    },
9843    "dataschema-text": {
9844        "requires": [
9845            "dataschema-base"
9846        ]
9847    },
9848    "dataschema-xml": {
9849        "requires": [
9850            "dataschema-base"
9851        ]
9852    },
9853    "datasource": {
9854        "use": [
9855            "datasource-local",
9856            "datasource-io",
9857            "datasource-get",
9858            "datasource-function",
9859            "datasource-cache",
9860            "datasource-jsonschema",
9861            "datasource-xmlschema",
9862            "datasource-arrayschema",
9863            "datasource-textschema",
9864            "datasource-polling"
9865        ]
9866    },
9867    "datasource-arrayschema": {
9868        "requires": [
9869            "datasource-local",
9870            "plugin",
9871            "dataschema-array"
9872        ]
9873    },
9874    "datasource-cache": {
9875        "requires": [
9876            "datasource-local",
9877            "plugin",
9878            "cache-base"
9879        ]
9880    },
9881    "datasource-function": {
9882        "requires": [
9883            "datasource-local"
9884        ]
9885    },
9886    "datasource-get": {
9887        "requires": [
9888            "datasource-local",
9889            "get"
9890        ]
9891    },
9892    "datasource-io": {
9893        "requires": [
9894            "datasource-local",
9895            "io-base"
9896        ]
9897    },
9898    "datasource-jsonschema": {
9899        "requires": [
9900            "datasource-local",
9901            "plugin",
9902            "dataschema-json"
9903        ]
9904    },
9905    "datasource-local": {
9906        "requires": [
9907            "base"
9908        ]
9909    },
9910    "datasource-polling": {
9911        "requires": [
9912            "datasource-local"
9913        ]
9914    },
9915    "datasource-textschema": {
9916        "requires": [
9917            "datasource-local",
9918            "plugin",
9919            "dataschema-text"
9920        ]
9921    },
9922    "datasource-xmlschema": {
9923        "requires": [
9924            "datasource-local",
9925            "plugin",
9926            "datatype-xml",
9927            "dataschema-xml"
9928        ]
9929    },
9930    "datatable": {
9931        "use": [
9932            "datatable-core",
9933            "datatable-table",
9934            "datatable-head",
9935            "datatable-body",
9936            "datatable-base",
9937            "datatable-column-widths",
9938            "datatable-message",
9939            "datatable-mutable",
9940            "datatable-sort",
9941            "datatable-datasource"
9942        ]
9943    },
9944    "datatable-base": {
9945        "requires": [
9946            "datatable-core",
9947            "datatable-table",
9948            "datatable-head",
9949          
9949  "datatable-body",
9950            "base-build",
9951            "widget"
9952        ],
9953        "skinnable": true
9954    },
9955    "datatable-body": {
9956        "requires": [
9957            "datatable-core",
9958            "view",
9959            "classnamemanager"
9960        ]
9961    },
9962    "datatable-column-widths": {
9963        "requires": [
9964            "datatable-base"
9965        ]
9966    },
9967    "datatable-core": {
9968        "requires": [
9969            "escape",
9970            "model-list",
9971            "node-event-delegate"
9972        ]
9973    },
9974    "datatable-datasource": {
9975        "requires": [
9976            "datatable-base",
9977            "plugin",
9978            "datasource-local"
9979        ]
9980    },
9981    "datatable-foot": {
9982        "requires": [
9983            "datatable-core",
9984            "view"
9985        ]
9986    },
9987    "datatable-formatters": {
9988        "requires": [
9989            "datatable-body",
9990            "datatype-number-format",
9991            "datatype-date-format",
9992            "escape"
9993        ]
9994    },
9995    "datatable-head": {
9996        "requires": [
9997            "datatable-core",
9998            "view",
9999            "classnamemanager"
10000        ]
10001    },
10002    "datatable-highlight": {
10003        "requires": [
10004            "datatable-base",
10005            "event-hover"
10006        ],
10007        "skinnable": true
10008    },
10009    "datatable-keynav": {
10010        "requires": [
10011            "datatable-base"
10012        ]
10013    },
10014    "datatable-message": {
10015        "lang": [
10016            "en",
10017            "fr",
10018            "es",
10019            "hu",
10020            "it"
10021        ],
10022        "requires": [
10023            "datatable-base"
10024        ],
10025        "skinnable": true
10026    },
10027    "datatable-mutable": {
10028        "requires": [
10029            "datatable-base"
10030        ]
10031    },
10032    "datatable-paginator": {
10033        "lang": [
10034            "en",
10035            "fr"
10036        ],
10037        "requires": [
10038            "model",
10039            "view",
10040            "paginator-core",
10041            "datatable-foot",
10042            "datatable-paginator-templates"
10043        ],
10044        "skinnable": true
10045    },
10046    "datatable-paginator-templates": {
10047        "requires": [
10048            "template"
10049        ]
10050    },
10051    "datatable-scroll": {
10052        "requires": [
10053            "datatable-base",
10054            "datatable-column-widths",
10055            "dom-screen"
10056        ],
10057        "skinnable": true
10058    },
10059    "datatable-sort": {
10060        "lang": [
10061            "en",
10062            "fr",
10063            "es",
10064            "hu"
10065        ],
10066        "requires": [
10067            "datatable-base"
10068        ],
10069        "skinnable": true
10070    },
10071    "datatable-table": {
10072        "requires": [
10073            "datatable-core",
10074            "datatable-head",
10075            "datatable-body",
10076            "view",
10077            "classnamemanager"
10078        ]
10079    },
10080    "datatype": {
10081        "use": [
10082            "datatype-date",
10083            "datatype-number",
10084            "datatype-xml"
10085        ]
10086    },
10087    "datatype-date": {
10088        "use": [
10089            "datatype-date-parse",
10090            "datatype-date-format",
10091            "datatype-date-math"
10092        ]
10093    },
10094    "datatype-date-format": {
10095        "lang": [
10096            "ar",
10097            "ar-JO",
10098            "ca",
10099            "ca-ES",
10100            "da",
10101            "da-DK",
10102            "de",
10103            "de-AT",
10104            "de-DE",
10105            "el",
10106            "el-GR",
10107            "en",
10108            "en-AU",
10109            "en-CA",
10110            "en-GB",
10111            "en-IE",
10112            "en-IN",
10113            "en-JO",
10114            "en-MY",
10115            "en-NZ",
10116            "en-PH",
10117            "en-SG",
10118            "en-US",
10119            "es",
10120            "es-AR",
10121            "es-BO",
10122            "es-CL",
10123            "es-CO",
10124            "es-EC",
10125            "es-ES",
10126            "es-MX",
10127            "es-PE",
10128            "es-PY",
10129            "es-US",
10130            "es-UY",
10131            "es-VE",
10132            "fi",
10133            "fi-FI",
10134            "fr",
10135            "fr-BE",
10136            "fr-CA",
10137            "fr-FR",
10138            "hi",
10139            "hi-IN",
10140            "hu",
10141            "id",
10142            "id-ID",
10143            "it",
10144            "it-IT",
10145            "ja",
10146            "ja-JP",
10147            "ko",
10148            "ko-KR",
10149            "ms",
10150            "ms-MY",
10151            "nb",
10152            "nb-NO",
10153            "nl",
10154            "nl-BE",
10155            "nl-NL",
10156            "pl",
10157            "pl-PL",
10158            "pt",
10159            "pt-BR",
10160            "ro",
10161            "ro-RO",
10162            "ru",
10163            "ru-RU",
10164            "sv",
10165            "sv-SE",
10166            "th",
10167            "th-TH",
10168            "tr",
10169            "tr-TR",
10170            "vi",
10171            "vi-VN",
10172            "zh-Hans",
10173            "zh-Hans-CN",
10174            "zh-Hant",
10175            "zh-Hant-HK",
10176            "zh-Hant-TW"
10177        ]
10178    },
10179    "datatype-date-math": {
10180        "requires": [
10181            "yui-base"
10182        ]
10183    },
10184    "datatype-date-parse": {},
10185    "datatype-number": {
10186        "use": [
10187            "datatype-number-parse",
10188            "datatype-number-format"
10189        ]
10190    },
10191    "datatype-number-format": {},
10192    "datatype-number-parse": {
10193        "requires": [
10194            "escape"
10195        ]
10196    },
10197    "datatype-xml": {
10198        "use": [
10199            "datatype-xml-parse",
10200            "datatype-xml-format"
10201        ]
10202    },
10203    "datatype-xml-format": {},
10204    "datatype-xml-parse": {},
10205    "dd": {
10206        "use": [
10207            "dd-ddm-base",
10208            "dd-ddm",
10209            "dd-ddm-drop",
10210            "dd-drag",
10211            "dd-proxy",
10212            "dd-constrain",
10213            "dd-drop",
10214            "dd-scroll",
10215            "dd-delegate"
10216        ]
10217    },
10218    "dd-constrain": {
10219        "requires": [
10220            "dd-drag"
10221        ]
10222    },
10223    "dd-ddm": {
10224        "requires": [
10225            "dd-ddm-base",
10226            "event-resize"
10227        ]
10228    },
10229    "dd-ddm-base": {
10230        "requires": [
10231            "node",
10232            "base",
10233            "yui-throttle",
10234            "classnamemanager"
10235        ]
10236    },
10237    "dd-ddm-drop": {
10238        "requires": [
10239            "dd-ddm"
10240        ]
10241    },
10242    "dd-delegate": {
10243        "requires": [
10244            "dd-drag",
10245            "dd-drop-plugin",
10246            "event-mouseenter"
10247        ]
10248    },
10249    "dd-drag": {
10250        "requires": [
10251            "dd-ddm-base",
10252            "selector-css2"
10253        ]
10254    },
10255    "dd-drop": {
10256        "requires": [
10257            "dd-drag",
10258            "dd-ddm-drop"
10259        ]
10260    },
10261    "dd-drop-plugin": {
10262        "requires": [
10263            "dd-drop"
10264        ]
10265    },
10266    "dd-gestures": {
10267        "condition": {
10268            "name": "dd-gestures",
10269            "trigger": "dd-drag",
10270            "ua": "touchEnabled"
10271        },
10272        "requires": [
10273            "dd-drag",
10274            "event-synthetic",
10275            "event-gestures"
10276        ]
10277    },
10278    "dd-plugin": {
10279        "optional": [
10280            "dd-constrain",
10281            "dd-proxy"
10282        ],
10283        "requires": [
10284            "dd-drag"
10285        ]
10286    },
10287    "dd-proxy": {
10288        "requires": [
10289            "dd-drag"
10290        ]
10291    },
10292    "dd-scroll": {
10293        "requires": [
10294            "dd-drag"
10295        ]
10296    },
10297    "dial": {
10298        "lang": [
10299            "en",
10300            "es",
10301            "hu"
10302        ],
10303        "requires": [
10304            "widget",
10305            "dd-drag",
10306            "event-mouseenter",
10307            "event-move",
10308            "event-key",
10309            "transition",
10310            "intl"
10311        ],
10312        "skinnable": true
10313    },
10314    "dom": {
10315        "use": [
10316            "dom-base",
10317            "dom-screen",
10318            "dom-style",
10319            "selector-native",
10320            "selector"
10321        ]
10322    },
10323    "dom-base": {
10324        "requires": [
10325            "dom-core"
10326        ]
10327    },
10328    "dom-core": {
10329        "requires": [
10330            "oop",
10331            "features"
10332        ]
10333    },
10334    "dom-screen": {
10335        "requires": [
10336            "dom-base",
10337            "dom-style"
10338        ]
10339    },
10340    "dom-style": {
10341        "requires": [
10342            "dom-base"
10343        ]
10344    },
10345    "dom-style-ie": {
10346        "condition": {
10347            "name": "dom-style-ie",
10348            "test": function (Y) {
10349
10350    var testFeature = Y.Features.test,
10351        addFeature = Y.Features.add,
10352        WINDOW = Y.config.win,
10353        DOCUMENT = Y.config.doc,
10354        DOCUMENT_ELEMENT = 'documentElement',
10355        ret = false;
10356
10357    addFeature('style', 'computedStyle', {
10358        test: function() {
10359            return WINDOW && 'getComputedStyle' in WINDOW;
10360        }
10361    });
10362
10363    addFeature('style', 'opacity', {
10364        test: function() {
10365            return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style;
10366        }
10367    });
10368
10369    ret =  (!testFeature('style', 'opacity') &&
10370            !testFeature('style', 'computedStyle'));
10371
10372    return ret;
10373},
10374            "trigger": "dom-style"
10375        },
10376        "requires": [
10377            "dom-style",
10378            "color-base"
10379        ]
10380    },
10381    "dump": {
10382        "requires": [
10383            "yui-base"
10384        ]
10385    },
10386    "editor": {
10387        "use": [
10388            "frame",
10389            "editor-selection",
10390            "exec-command",
10391            "editor-base",
10392            "editor-para",
10393            "editor-br",
10394            "editor-bidi",
10395            "editor-tab",
10396            "createlink-base"
10397        ]
10398    },
10399    "editor-base": {
10400        "requires": [
10401            "base",
10402            "frame",
10403            "node",
10404            "exec-command",
10405            "editor-selection"
10406        ]
10407    },
10408    "editor-bidi": {
10409        "requires": [
10410            "editor-base"
10411        ]
10412    },
10413    "editor-br": {
10414        "requires": [
10415            "editor-base"
10416        ]
10417    },
10418    "editor-inline": {
10419        "requires": [
10420            "editor-base",
10421            "content-editable"
10422        ]
10423    },
10424    "editor-lists": {
10425        "requires": [
10426            "editor-base"
10427        ]
10428    },
10429    "editor-para": {
10430        "requires": [
10431            "editor-para-base"
10432        ]
10433    },
10434    "editor-para-base": {
10435        "requires": [
10436            "editor-base"
10437        ]
10438    },
10439    "editor-para-ie": {
10440        "condition": {
10441            "name": "editor-para-ie",
10442            "trigger": "editor-para",
10443            "ua": "ie",
10444            "when": "instead"
10445        },
10446        "requires": [
10447            "editor-para-base"
10448        ]
10449    },
10450    "editor-selection": {
10451        "requires": [
10452            "node"
10453        ]
10454    },
10455    "editor-tab": {
10456        "requires": [
10457            "editor-base"
10458        ]
10459    },
10460    "escape": {
10461        "requires": [
10462            "yui-base"
10463        ]
10464    },
10465    "event": {
10466        "after": [
10467            "node-base"
10468        ],
10469        "use": [
10470            "event-base",
10471            "event-delegate",
10472            "event-synthetic",
10473            "event-mousewheel",
10474            "event-mouseenter",
10475            "event-key",
10476            "event-focus",
10477            "event-resize",
10478            "event-hover",
10479            "event-outside",
10480            "event-touch",
10481            "event-move",
10482            "event-flick",
10483            "event-valuechange",
10484            "event-tap"
10485        ]
10486    },
10487    "event-base": {
10488        "after": [
10489            "node-base"
10490        ],
10491        "requires": [
10492            "event-custom-base"
10493        ]
10494    },
10495    "event-base-ie": {
10496        "after": [
10497            "event-base"
10498        ],
10499        "condition": {
10500            "name": "event-base-ie",
10501            "test": function(Y) {
10502    var imp = Y.config.doc && Y.config.doc.implementation;
10503    return (imp && (!imp.hasFeature('Events', '2.0')));
10504},
10505            "trigger": "node-base"
10506        },
10507        "requires": [
10508            "node-base"
10509        ]
10510    },
10511    "event-contextmenu": {
10512        "requires": [
10513            "event-synthetic",
10514            "dom-screen"
10515        ]
10516    },
10517    "event-custom": {
10518        "use": [
10519            "event-custom-base",
10520            "event-custom-complex"
10521        ]
10522    },
10523    "event-custom-base": {
10524        "requires": [
10525            "oop"
10526        ]
10527    },
10528    "event-custom-complex": {
10529        "requires": [
10530            "event-custom-base"
10531        ]
10532    },
10533    "event-delegate": {
10534        "requires": [
10535            "node-base"
10536        ]
10537    },
10538    "event-flick": {
10539        "requires": [
10540            "node-base",
10541            "event-touch",
10542            "event-synthetic"
10543        ]
10544    },
10545    "event-focus": {
10546        "requires": [
10547            "event-synthetic"
10548        ]
10549    },
10550    "event-gestures": {
10551        "use": [
10552            "event-flick",
10553            "event-move"
10554        ]
10555    },
10556    "event-hover": {
10557        "requires": [
10558            "event-mouseenter"
10559        ]
10560    },
10561    "event-key": {
10562        "requires": [
10563            "event-synthetic"
10564        ]
10565    },
10566    "event-mouseenter": {
10567        "requires": [
10568            "event-synthetic"
10569        ]
10570    },
10571    "event-mousewheel": {
10572        "requires": [
10573            "node-base"
10574        ]
10575    },
10576    "event-move": {
10577        "requires": [
10578            "node-base",
10579            "event-touch",
10580            "event-synthetic"
10581        ]
10582    },
10583    "event-outside": {
10584        "requires": [
10585            "event-synthetic"
10586        ]
10587    },
10588    "event-resize": {
10589        "requires": [
10590            "node-base",
10591            "event-synthetic"
10592        ]
10593    },
10594    "event-simulate": {
10595        "requires": [
10596            "event-base"
10597        ]
10598    },
10599    "event-synthetic": {
10600        "requires": [
10601            "node-base",
10602            "event-custom-complex"
10603        ]
10604    },
10605    "event-tap": {
10606        "requires": [
10607            "node-base",
10608            "event-base",
10609            "event-touch",
10610            "event-synthetic"
10611        ]
10612    },
10613    "event-touch": {
10614        "requires": [
10615            "node-base"
10616        ]
10617    },
10618    "event-valuechange": {
10619        "requires": [
10620            "event-focus",
10621            "event-synthetic"
10622        ]
10623    },
10624    "exec-command": {
10625        "requires": [
10626            "frame"
10627        ]
10628    },
10629    "features": {
10630        "requires": [
10631            "yui-base"
10632        ]
10633    },
10634    "file": {
10635        "requires": [
10636            "file-flash",
10637            "file-html5"
10638        ]
10639    },
10640    "file-flash": {
10641        "requires": [
10642            "base"
10643        ]
10644    },
10645    "file-html5": {
10646        "requires": [
10647            "base"
10648        ]
10649    },
10650    "frame": {
10651        "requires": [
10652            "base",
10653            "node",
10654            "plugin",
10655            "selector-css3",
10656            "yui-throttle"
10657        ]
10658    },
10659    "gesture-simulate": {
10660        "requires": [
10661            "async-queue",
10662            "event-simulate",
10663            "node-screen"
10664        ]
10665    },
10666    "get": {
10667        "requires": [
10668            "yui-base"
10669        ]
10670    },
10671    "graphics": {
10672        "requires": [
10673            "node",
10674            "event-custom",
10675            "pluginhost",
10676            "matrix",
10677            "classnamemanager"
10678        ]
10679    },
10680    "graphics-canvas": {
10681        "condition": {
10682            "name": "graphics-canvas",
10683            "test": function(Y) {
10684    var DOCUMENT = Y.config.doc,
10685        useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas",
10686		canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
10687        svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
10688    return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d"));
10689},
10690            "trigger": "graphics"
10691        },
10692        "requires": [
10693            "graphics",
10694            "color-base"
10695        ]
10696    },
10697    "graphics-canvas-default": {
10698        "condition": {
10699            "name": "graphics-canvas-default",
10700            "test": function(Y) {
10701    var DOCUMENT = Y.config.doc,
10702        useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas",
10703		canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
10704        svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
10705    return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d"));
10706},
10707            "trigger": "graphics"
10708        }
10709    },
10710    "graphics-group": {
10711        "requires": [
10712            "graphics"
10713        ]
10714    },
10715    "graphics-svg": {
10716        "condition": {
10717            "name": "graphics-svg",
10718            "test": function(Y) {
10719    var DOCUMENT = Y.config.doc,
10720        useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas",
10721		canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
10722        svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
10723
10724    return svg && (useSVG || !canvas);
10725},
10726            "trigger": "graphics"
10727        },
10728        "requires": [
10729            "graphics"
10730        ]
10731    },
10732    "graphics-svg-default": {
10733        "condition": {
10734            "name": "graphics-svg-default",
10735            "test": function(Y) {
10736    var DOCUMENT = Y.config.doc,
10737        useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas",
10738		canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
10739        svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
10740
10741    return svg && (useSVG || !canvas);
10742},
10743            "trigger": "graphics"
10744        }
10745    },
10746    "graphics-vml": {
10747        "condition": {
10748            "name": "graphics-vml",
10749            "test": function(Y) {
10750    var DOCUMENT = Y.config.doc,
10751		canvas = DOCUMENT && DOCUMENT.createElement("canvas");
10752    return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
10753},
10754            "trigger": "graphics"
10755        },
10756        "requires": [
10757            "graphics",
10758            "color-base"
10759        ]
10760    },
10761    "graphics-vml-default": {
10762        "condition": {
10763            "name": "graphics-vml-default",
10764            "test": function(Y) {
10765    var DOCUMENT = Y.config.doc,
10766		canvas = DOCUMENT && DOCUMENT.createElement("canvas");
10767    return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
10768},
10769            "trigger": "graphics"
10770        }
10771    },
10772    "handlebars": {
10773        "use": [
10774            "handlebars-compiler"
10775        ]
10776    },
10777    "handlebars-base": {
10778        "requires": []
10779    },
10780    "handlebars-compiler": {
10781        "requires": [
10782            "handlebars-base"
10783        ]
10784    },
10785    "highlight": {
10786        "use": [
10787            "highlight-base",
10788            "highlight-accentfold"
10789        ]
10790    },
10791    "highlight-accentfold": {
10792        "requires": [
10793            "highlight-base",
10794            "text-accentfold"
10795        ]
10796    },
10797    "highlight-base": {
10798        "requires": [
10799            "array-extras",
10800            "classnamemanager",
10801            "escape",
10802            "text-wordbreak"
10803        ]
10804    },
10805    "history": {
10806        "use": [
10807            "history-base",
10808            "history-hash",
10809            "history-html5"
10810        ]
10811    },
10812    "history-base": {
10813        "requires": [
10814            "event-custom-complex"
10815        ]
10816    },
10817    "history-hash": {
10818        "after": [
10819            "history-html5"
10820        ],
10821        "requires": [
10822            "event-synthetic",
10823            "history-base",
10824            "yui-later"
10825        ]
10826    },
10827    "history-hash-ie": {
10828        "condition": {
10829            "name": "history-hash-ie",
10830            "test": function (Y) {
10831    var docMode = Y.config.doc && Y.config.doc.documentMode;
10832
10833    return Y.UA.ie && (!('onhashchange' in Y.config.win) ||
10834            !docMode || docMode < 8);
10835},
10836            "trigger": "history-hash"
10837        },
10838        "requires": [
10839            "history-hash",
10840            "node-base"
10841        ]
10842    },
10843    "history-html5": {
10844        "optional": [
10845            "json"
10846        ],
10847        "requires": [
10848            "event-base",
10849            "history-base",
10850            "node-base"
10851        ]
10852    },
10853    "imageloader": {
10854        "requires": [
10855            "base-base",
10856            "node-style",
10857            "node-screen"
10858        ]
10859    },
10860    "intl": {
10861        "requires": [
10862            "intl-base",
10863            "event-custom"
10864        ]
10865    },
10866    "intl-base": {
10867        "requires": [
10868            "yui-base"
10869        ]
10870    },
10871    "io": {
10872        "use": [
10873            "io-base",
10874            "io-xdr",
10875            "io-form",
10876            "io-upload-iframe",
10877            "io-queue"
10878        ]
10879    },
10880    "io-base": {
10881        "requires": [
10882            "event-custom-base",
10883            "querystring-stringify-simple"
10884        ]
10885    },
10886    "io-form": {
10887        "requires": [
10888            "io-base",
10889            "node-base"
10890        ]
10891    },
10892    "io-nodejs": {
10893        "condition": {
10894            "name": "io-nodejs",
10895            "trigger": "io-base",
10896            "ua": "nodejs"
10897        },
10898        "requires": [
10899            "io-base"
10900        ]
10901    },
10902    "io-queue": {
10903        "requires": [
10904            "io-base",
10905            "queue-promote"
10906        ]
10907    },
10908    "io-upload-iframe": {
10909        "requires": [
10910            "io-base",
10911            "node-base"
10912        ]
10913    },
10914    "io-xdr": {
10915        "requires": [
10916            "io-base",
10917            "datatype-xml-parse"
10918        ]
10919    },
10920    "json": {
10921        "use": [
10922            "json-parse",
10923            "json-stringify"
10924        ]
10925    },
10926    "json-parse": {
10927        "requires": [
10928            "yui-base"
10929        ]
10930    },
10931    "json-parse-shim": {
10932        "condition": {
10933            "name": "json-parse-shim",
10934            "test": function (Y) {
10935    var _JSON = Y.config.global.JSON,
10936        Native = Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON,
10937        nativeSupport = Y.config.useNativeJSONParse !== false && !!Native;
10938
10939    function workingNative( k, v ) {
10940        return k === "ok" ? true : v;
10941    }
10942
10943    // Double check basic functionality.  This is mainly to catch early broken
10944    // implementations of the JSON API in Firefox 3.1 beta1 and beta2
10945    if ( nativeSupport ) {
10946        try {
10947            nativeSupport = ( Native.parse( '{"ok":false}', workingNative ) ).ok;
10948        }
10949        catch ( e ) {
10950            nativeSupport = false;
10951        }
10952    }
10953
10954    return !nativeSupport;
10955},
10956            "trigger": "json-parse"
10957        },
10958        "requires": [
10959            "json-parse"
10960        ]
10961    },
10962    "json-stringify": {
10963        "requires": [
10964            "yui-base"
10965        ]
10966    },
10967    "json-stringify-shim": {
10968        "condition": {
10969            "name": "json-stringify-shim",
10970            "test": function (Y) {
10971    var _JSON = Y.config.global.JSON,
10972        Native = Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON,
10973        nativeSupport = Y.config.useNativeJSONStringify !== false && !!Native;
10974
10975    // Double check basic native functionality.  This is primarily to catch broken
10976    // early JSON API implementations in Firefox 3.1 beta1 and beta2.
10977    if ( nativeSupport ) {
10978        try {
10979            nativeSupport = ( '0' === Native.stringify(0) );
10980        } catch ( e ) {
10981            nativeSupport = false;
10982        }
10983    }
10984
10985
10986    return !nativeSupport;
10987},
10988            "trigger": "json-stringify"
10989        },
10990        "requires": [
10991            "json-stringify"
10992        ]
10993    },
10994    "jsonp": {
10995        "requires": [
10996            "get",
10997            "oop"
10998        ]
10999    },
11000    "jsonp-url": {
11001        "requires": [
11002            "jsonp"
11003        ]
11004    },
11005    "lazy-model-list": {
11006        "requires": [
11007            "model-list"
11008        ]
11009    },
11010    "loader": {
11011        "use": [
11012            "loader-base",
11013            "loader-rollup",
11014            "loader-yui3"
11015        ]
11016    },
11017    "loader-base": {
11018        "requires": [
11019            "get",
11020            "features"
11021        ]
11022    },
11023    "loader-pathogen-combohandler": {},
11024    "loader-pathogen-encoder": {
11025        "use": [
11026            "loader-base",
11027            "loader-rollup",
11028            "loader-yui3",
11029            "loader-pathogen-combohandler"
11030        ]
11031    },
11032    "loader-rollup": {
11033        "requires": [
11034            "loader-base"
11035        ]
11036    },
11037    "loader-yui3": {
11038        "requires": [
11039            "loader-base"
11040        ]
11041    },
11042    "matrix": {
11043        "requires": [
11044            "yui-base"
11045        ]
11046    },
11047    "model": {
11048        "requires": [
11049            "base-build",
11050            "escape",
11051            "json-parse"
11052        ]
11053    },
11054    "model-list": {
11055        "requires": [
11056            "array-extras",
11057            "array-invoke",
11058            "arraylist",
11059            "base-build",
11060            "escape",
11061            "json-parse",
11062            "model"
11063        ]
11064    },
11065    "model-sync-local": {
11066        "requires": [
11067            "model",
11068            "json-stringify"
11069        ]
11070    },
11071    "model-sync-rest": {
11072        "requires": [
11073            "model",
11074            "io-base",
11075            "json-stringify"
11076        ]
11077    },
11078    "node": {
11079        "use": [
11080            "node-base",
11081            "node-event-delegate",
11082            "node-pluginhost",
11083            "node-screen",
11084            "node-style"
11085        ]
11086    },
11087    "node-base": {
11088        "requires": [
11089            "event-base",
11090            "node-core",
11091            "dom-base",
11092            "dom-style"
11093        ]
11094    },
11095    "node-core": {
11096        "requires": [
11097            "dom-core",
11098            "selector"
11099        ]
11100    },
11101    "node-event-delegate": {
11102        "requires": [
11103            "node-base",
11104            "event-delegate"
11105        ]
11106    },
11107    "node-event-html5": {
11108        "requires": [
11109            "node-base"
11110        ]
11111    },
11112    "node-event-simulate": {
11113        "requires": [
11114            "node-base",
11115            "event-simulate",
11116            "gesture-simulate"
11117        ]
11118    },
11119    "node-flick": {
11120        "requires": [
11121            "classnamemanager",
11122            "transition",
11123            "event-flick",
11124            "plugin"
11125        ],
11126        "skinnable": true
11127    },
11128    "node-focusmanager": {
11129        "requires": [
11130            "attribute",
11131            "node",
11132            "plugin",
11133            "node-event-simulate",
11134            "event-key",
11135            "event-focus"
11136        ]
11137    },
11138    "node-load": {
11139        "requires": [
11140            "node-base",
11141            "io-base"
11142        ]
11143    },
11144    "node-menunav": {
11145        "requires": [
11146            "node",
11147            "classnamemanager",
11148            "plugin",
11149            "node-focusmanager"
11150        ],
11151        "skinnable": true
11152    },
11153    "node-pluginhost": {
11154        "requires": [
11155            "node-base",
11156            "pluginhost"
11157        ]
11158    },
11159    "node-screen": {
11160        "requires": [
11161            "dom-screen",
11162            "node-base"
11163        ]
11164    },
11165    "node-scroll-info": {
11166        "requires": [
11167            "array-extras",
11168            "base-build",
11169            "event-resize",
11170            "node-pluginhost",
11171            "plugin",
11172            "selector"
11173        ]
11174    },
11175    "node-style": {
11176        "requires": [
11177            "dom-style",
11178            "node-base"
11179        ]
11180    },
11181    "oop": {
11182        "requires": [
11183            "yui-base"
11184        ]
11185    },
11186    "overlay": {
11187        "requires": [
11188            "widget",
11189            "widget-stdmod",
11190            "widget-position",
11191            "widget-position-align",
11192            "widget-stack",
11193            "widget-position-constrain"
11194        ],
11195        "skinnable": true
11196    },
11197    "paginator": {
11198        "requires": [
11199            "paginator-core"
11200        ]
11201    },
11202    "paginator-core": {
11203        "requires": [
11204            "base"
11205        ]
11206    },
11207    "paginator-url": {
11208        "requires": [
11209            "paginator"
11210        ]
11211    },
11212    "panel": {
11213        "requires": [
11214            "widget",
11215            "widget-autohide",
11216            "widget-buttons",
11217            "widget-modality",
11218            "widget-position",
11219            "widget-position-align",
11220            "widget-position-constrain",
11221            "widget-stack",
11222            "widget-stdmod"
11223        ],
11224        "skinnable": true
11225    },
11226    "parallel": {
11227        "requires": [
11228            "yui-base"
11229        ]
11230    },
11231    "pjax": {
11232        "requires": [
11233            "pjax-base",
11234            "pjax-content"
11235        ]
11236    },
11237    "pjax-base": {
11238        "requires": [
11239            "classnamemanager",
11240            "node-event-delegate",
11241            "router"
11242        ]
11243    },
11244    "pjax-content": {
11245        "requires": [
11246            "io-base",
11247            "node-base",
11248            "router"
11249        ]
11250    },
11251    "pjax-plugin": {
11252        "requires": [
11253            "node-pluginhost",
11254            "pjax",
11255            "plugin"
11256        ]
11257    },
11258    "plugin": {
11259        "requires": [
11260            "base-base"
11261        ]
11262    },
11263    "pluginhost": {
11264        "use": [
11265            "pluginhost-base",
11266            "pluginhost-config"
11267        ]
11268    },
11269    "pluginhost-base": {
11270        "requires": [
11271            "yui-base"
11272        ]
11273    },
11274    "pluginhost-config": {
11275        "requires": [
11276            "pluginhost-base"
11277        ]
11278    },
11279    "promise": {
11280        "requires": [
11281            "timers"
11282        ]
11283    },
11284    "querystring": {
11285        "use": [
11286            "querystring-parse",
11287            "querystring-stringify"
11288        ]
11289    },
11290    "querystring-parse": {
11291        "requires": [
11292            "yui-base",
11293            "array-extras"
11294        ]
11295    },
11296    "querystring-parse-simple": {
11297        "requires": [
11298            "yui-base"
11299        ]
11300    },
11301    "querystring-stringify": {
11302        "requires": [
11303            "yui-base"
11304        ]
11305    },
11306    "querystring-stringify-simple": {
11307        "requires": [
11308            "yui-base"
11309        ]
11310    },
11311    "queue-promote": {
11312        "requires": [
11313            "yui-base"
11314        ]
11315    },
11316    "range-slider": {
11317        "requires": [
11318            "slider-base",
11319            "slider-value-range",
11320            "clickable-rail"
11321        ]
11322    },
11323    "recordset": {
11324        "use": [
11325            "recordset-base",
11326            "recordset-sort",
11327            "recordset-filter",
11328            "recordset-indexer"
11329        ]
11330    },
11331    "recordset-base": {
11332        "requires": [
11333            "base",
11334            "arraylist"
11335        ]
11336    },
11337    "recordset-filter": {
11338        "requires": [
11339            "recordset-base",
11340            "array-extras",
11341            "plugin"
11342        ]
11343    },
11344    "recordset-indexer": {
11345        "requires": [
11346            "recordset-base",
11347            "plugin"
11348        ]
11349    },
11350    "recordset-sort": {
11351        "requires": [
11352            "arraysort",
11353            "recordset-base",
11354            "plugin"
11355        ]
11356    },
11357    "resize": {
11358        "use": [
11359            "resize-base",
11360            "resize-proxy",
11361            "resize-constrain"
11362        ]
11363    },
11364    "resize-base": {
11365        "requires": [
11366            "base",
11367            "widget",
11368            "event",
11369            "oop",
11370            "dd-drag",
11371            "dd-delegate",
11372            "dd-drop"
11373        ],
11374        "skinnable": true
11375    },
11376    "resize-constrain": {
11377        "requires": [
11378            "plugin",
11379            "resize-base"
11380        ]
11381    },
11382    "resize-plugin": {
11383        "optional": [
11384            "resize-constrain"
11385        ],
11386        "requires": [
11387            "resize-base",
11388            "plugin"
11389        ]
11390    },
11391    "resize-proxy": {
11392        "requires": [
11393            "plugin",
11394            "resize-base"
11395        ]
11396    },
11397    "router": {
11398        "optional": [
11399            "querystring-parse"
11400        ],
11401        "requires": [
11402            "array-extras",
11403            "base-build",
11404            "history"
11405        ]
11406    },
11407    "scrollview": {
11408        "requires": [
11409            "scrollview-base",
11410            "scrollview-scrollbars"
11411        ]
11412    },
11413    "scrollview-base": {
11414        "requires": [
11415            "widget",
11416            "event-gestures",
11417            "event-mousewheel",
11418            "transition"
11419        ],
11420        "skinnable": true
11421    },
11422    "scrollview-base-ie": {
11423        "condition": {
11424            "name": "scrollview-base-ie",
11425            "trigger": "scrollview-base",
11426            "ua": "ie"
11427        },
11428        "requires": [
11429            "scrollview-base"
11430        ]
11431    },
11432    "scrollview-list": {
11433        "requires": [
11434            "plugin",
11435            "classnamemanager"
11436        ],
11437        "skinnable": true
11438    },
11439    "scrollview-paginator": {
11440        "requires": [
11441            "plugin",
11442            "classnamemanager"
11443        ]
11444    },
11445    "scrollview-scrollbars": {
11446        "requires": [
11447            "classnamemanager",
11448            "transition",
11449            "plugin"
11450        ],
11451        "skinnable": true
11452    },
11453    "selector": {
11454        "requires": [
11455            "selector-native"
11456        ]
11457    },
11458    "selector-css2": {
11459        "condition": {
11460            "name": "selector-css2",
11461            "test": function (Y) {
11462    var DOCUMENT = Y.config.doc,
11463        ret = DOCUMENT && !('querySelectorAll' in DOCUMENT);
11464
11465    return ret;
11466},
11467            "trigger": "selector"
11468        },
11469        "requires": [
11470            "selector-native"
11471        ]
11472    },
11473    "selector-css3": {
11474        "requires": [
11475            "selector-native",
11476            "selector-css2"
11477        ]
11478    },
11479    "selector-native": {
11480        "requires": [
11481            "dom-base"
11482        ]
11483    },
11484    "series-area": {
11485        "requires": [
11486            "series-cartesian",
11487            "series-fill-util"
11488        ]
11489    },
11490    "series-area-stacked": {
11491        "requires": [
11492            "series-stacked",
11493            "series-area"
11494        ]
11495    },
11496    "series-areaspline": {
11497        "requires": [
11498            "series-area",
11499            "series-curve-util"
11500        ]
11501    },
11502    "series-areaspline-stacked": {
11503        "requires": [
11504            "series-stacked",
11505            "series-areaspline"
11506        ]
11507    },
11508    "series-bar": {
11509        "requires": [
11510            "series-marker",
11511            "series-histogram-base"
11512        ]
11513    },
11514    "series-bar-stacked": {
11515        "requires": [
11516            "series-stacked",
11517            "series-bar"
11518        ]
11519    },
11520    "series-base": {
11521        "requires": [
11522            "graphics",
11523            "axis-base"
11524        ]
11525    },
11526    "series-candlestick": {
11527        "requires": [
11528            "series-range"
11529        ]
11530    },
11531    "series-cartesian": {
11532        "requires": [
11533            "series-base"
11534        ]
11535    },
11536    "series-column": {
11537        "requires": [
11538            "series-marker",
11539            "series-histogram-base"
11540        ]
11541    },
11542    "series-column-stacked": {
11543        "requires": [
11544            "series-stacked",
11545            "series-column"
11546        ]
11547    },
11548    "series-combo": {
11549        "requires": [
11550            "series-cartesian",
11551            "series-line-util",
11552            "series-plot-util",
11553            "series-fill-util"
11554        ]
11555    },
11556    "series-combo-stacked": {
11557        "requires": [
11558            "series-stacked",
11559            "series-combo"
11560        ]
11561    },
11562    "series-combospline": {
11563        "requires": [
11564            "series-combo",
11565            "series-curve-util"
11566        ]
11567    },
11568    "series-combospline-stacked": {
11569        "requires": [
11570            "series-combo-stacked",
11571            "series-curve-util"
11572        ]
11573    },
11574    "series-curve-util": {},
11575    "series-fill-util": {},
11576    "series-histogram-base": {
11577        "requires": [
11578            "series-cartesian",
11579            "series-plot-util"
11580        ]
11581    },
11582    "series-line": {
11583        "requires": [
11584            "series-cartesian",
11585            "series-line-util"
11586        ]
11587    },
11588    "series-line-stacked": {
11589        "requires": [
11590            "series-stacked",
11591            "series-line"
11592        ]
11593    },
11594    "series-line-util": {},
11595    "series-marker": {
11596        "requires": [
11597            "series-cartesian",
11598            "series-plot-util"
11599        ]
11600    },
11601    "series-marker-stacked": {
11602        "requires": [
11603            "series-stacked",
11604            "series-marker"
11605        ]
11606    },
11607    "series-ohlc": {
11608        "requires": [
11609            "series-range"
11610        ]
11611    },
11612    "series-pie": {
11613        "requires": [
11614            "series-base",
11615            "series-plot-util"
11616        ]
11617    },
11618    "series-plot-util": {},
11619    "series-range": {
11620        "requires": [
11621            "series-cartesian"
11622        ]
11623    },
11624    "series-spline": {
11625        "requires": [
11626            "series-line",
11627            "series-curve-util"
11628        ]
11629    },
11630    "series-spline-stacked": {
11631        "requires": [
11632            "series-stacked",
11633            "series-spline"
11634        ]
11635    },
11636    "series-stacked": {
11637        "requires": [
11638            "axis-stacked"
11639        ]
11640    },
11641    "shim-plugin": {
11642        "requires": [
11643            "node-style",
11644            "node-pluginhost"
11645        ]
11646    },
11647    "slider": {
11648        "use": [
11649            "slider-base",
11650            "slider-value-range",
11651            "clickable-rail",
11652            "range-slider"
11653        ]
11654    },
11655    "slider-base": {
11656        "requires": [
11657            "widget",
11658            "dd-constrain",
11659            "event-key"
11660        ],
11661        "skinnable": true
11662    },
11663    "slider-value-range": {
11664        "requires": [
11665            "slider-base"
11666        ]
11667    },
11668    "sortable": {
11669        "requires": [
11670            "dd-delegate",
11671            "dd-drop-plugin",
11672            "dd-proxy"
11673        ]
11674    },
11675    "sortable-scroll": {
11676        "requires": [
11677            "dd-scroll",
11678            "sortable"
11679        ]
11680    },
11681    "stylesheet": {
11682        "requires": [
11683            "yui-base"
11684        ]
11685    },
11686    "substitute": {
11687        "optional": [
11688            "dump"
11689        ],
11690        "requires": [
11691            "yui-base"
11692        ]
11693    },
11694    "swf": {
11695        "requires": [
11696            "event-custom",
11697            "node",
11698            "swfdetect",
11699            "escape"
11700        ]
11701    },
11702    "swfdetect": {
11703        "requires": [
11704            "yui-base"
11705        ]
11706    },
11707    "tabview": {
11708        "requires": [
11709            "widget",
11710            "widget-parent",
11711            "widget-child",
11712            "tabview-base",
11713            "node-pluginhost",
11714            "node-focusmanager"
11715        ],
11716        "skinnable": true
11717    },
11718    "tabview-base": {
11719        "requires": [
11720            "node-event-delegate",
11721            "classnamemanager"
11722        ]
11723    },
11724    "tabview-plugin": {
11725        "requires": [
11726            "tabview-base"
11727        ]
11728    },
11729    "template": {
11730        "use": [
11731            "template-base",
11732            "template-micro"
11733        ]
11734    },
11735    "template-base": {
11736        "requires": [
11737            "yui-base"
11738        ]
11739    },
11740    "template-micro": {
11741        "requires": [
11742            "escape"
11743        ]
11744    },
11745    "test": {
11746        "requires": [
11747            "event-simulate",
11748            "event-custom",
11749            "json-stringify"
11750        ]
11751    },
11752  
11752  "test-console": {
11753        "requires": [
11754            "console-filters",
11755            "test",
11756            "array-extras"
11757        ],
11758        "skinnable": true
11759    },
11760    "text": {
11761        "use": [
11762            "text-accentfold",
11763            "text-wordbreak"
11764        ]
11765    },
11766    "text-accentfold": {
11767        "requires": [
11768            "array-extras",
11769            "text-data-accentfold"
11770        ]
11771    },
11772    "text-data-accentfold": {
11773        "requires": [
11774            "yui-base"
11775        ]
11776    },
11777    "text-data-wordbreak": {
11778        "requires": [
11779            "yui-base"
11780        ]
11781    },
11782    "text-wordbreak": {
11783        "requires": [
11784            "array-extras",
11785            "text-data-wordbreak"
11786        ]
11787    },
11788    "timers": {
11789        "requires": [
11790            "yui-base"
11791        ]
11792    },
11793    "transition": {
11794        "requires": [
11795            "node-style"
11796        ]
11797    },
11798    "transition-timer": {
11799        "condition": {
11800            "name": "transition-timer",
11801            "test": function (Y) {
11802    var DOCUMENT = Y.config.doc,
11803        node = (DOCUMENT) ? DOCUMENT.documentElement: null,
11804        ret = true;
11805
11806    if (node && node.style) {
11807        ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);
11808    }
11809
11810    return ret;
11811},
11812            "trigger": "transition"
11813        },
11814        "requires": [
11815            "transition"
11816        ]
11817    },
11818    "tree": {
11819        "requires": [
11820            "base-build",
11821            "tree-node"
11822        ]
11823    },
11824    "tree-labelable": {
11825        "requires": [
11826            "tree"
11827        ]
11828    },
11829    "tree-lazy": {
11830        "requires": [
11831            "base-pluginhost",
11832            "plugin",
11833            "tree"
11834        ]
11835    },
11836    "tree-node": {},
11837    "tree-openable": {
11838        "requires": [
11839            "tree"
11840        ]
11841    },
11842    "tree-selectable": {
11843        "requires": [
11844            "tree"
11845        ]
11846    },
11847    "tree-sortable": {
11848        "requires": [
11849            "tree"
11850        ]
11851    },
11852    "uploader": {
11853        "requires": [
11854            "uploader-html5",
11855            "uploader-flash"
11856        ]
11857    },
11858    "uploader-flash": {
11859        "requires": [
11860            "swfdetect",
11861            "escape",
11862            "widget",
11863            "base",
11864            "cssbutton",
11865            "node",
11866            "event-custom",
11867            "uploader-queue"
11868        ]
11869    },
11870    "uploader-html5": {
11871        "requires": [
11872            "widget",
11873            "node-event-simulate",
11874            "file-html5",
11875            "uploader-queue"
11876        ]
11877    },
11878    "uploader-queue": {
11879        "requires": [
11880            "base"
11881        ]
11882    },
11883    "view": {
11884        "requires": [
11885            "base-build",
11886            "node-event-delegate"
11887        ]
11888    },
11889    "view-node-map": {
11890        "requires": [
11891            "view"
11892        ]
11893    },
11894    "widget": {
11895        "use": [
11896            "widget-base",
11897            "widget-htmlparser",
11898            "widget-skin",
11899            "widget-uievents"
11900        ]
11901    },
11902    "widget-anim": {
11903        "requires": [
11904            "anim-base",
11905            "plugin",
11906            "widget"
11907        ]
11908    },
11909    "widget-autohide": {
11910        "requires": [
11911            "base-build",
11912            "event-key",
11913            "event-outside",
11914            "widget"
11915        ]
11916    },
11917    "widget-base": {
11918        "requires": [
11919            "attribute",
11920            "base-base",
11921            "base-pluginhost",
11922            "classnamemanager",
11923            "event-focus",
11924            "node-base",
11925            "node-style"
11926        ],
11927        "skinnable": true
11928    },
11929    "widget-base-ie": {
11930        "condition": {
11931            "name": "widget-base-ie",
11932            "trigger": "widget-base",
11933            "ua": "ie"
11934        },
11935        "requires": [
11936            "widget-base"
11937        ]
11938    },
11939    "widget-buttons": {
11940        "requires": [
11941            "button-plugin",
11942            "cssbutton",
11943            "widget-stdmod"
11944        ]
11945    },
11946    "widget-child": {
11947        "requires": [
11948            "base-build",
11949            "widget"
11950        ]
11951    },
11952    "widget-htmlparser": {
11953        "requires": [
11954            "widget-base"
11955        ]
11956    },
11957    "widget-modality": {
11958        "requires": [
11959            "base-build",
11960            "event-outside",
11961            "widget"
11962        ],
11963        "skinnable": true
11964    },
11965    "widget-parent": {
11966        "requires": [
11967            "arraylist",
11968            "base-build",
11969            "widget"
11970        ]
11971    },
11972    "widget-position": {
11973        "requires": [
11974            "base-build",
11975            "node-screen",
11976            "widget"
11977        ]
11978    },
11979    "widget-position-align": {
11980        "requires": [
11981            "widget-position"
11982        ]
11983    },
11984    "widget-position-constrain": {
11985        "requires": [
11986            "widget-position"
11987        ]
11988    },
11989    "widget-skin": {
11990        "requires": [
11991            "widget-base"
11992        ]
11993    },
11994    "widget-stack": {
11995        "requires": [
11996            "base-build",
11997            "widget"
11998        ],
11999        "skinnable": true
12000    },
12001    "widget-stdmod": {
12002        "requires": [
12003            "base-build",
12004            "widget"
12005        ]
12006    },
12007    "widget-uievents": {
12008        "requires": [
12009            "node-event-delegate",
12010            "widget-base"
12011        ]
12012    },
12013    "yql": {
12014        "requires": [
12015            "oop"
12016        ]
12017    },
12018    "yql-jsonp": {
12019        "condition": {
12020            "name": "yql-jsonp",
12021            "test": function (Y) {
12022    /* Only load the JSONP module when not in nodejs or winjs
12023    TODO Make the winjs module a CORS module
12024    */
12025    return (!Y.UA.nodejs && !Y.UA.winjs);
12026},
12027            "trigger": "yql"
12028        },
12029        "requires": [
12030            "yql",
12031            "jsonp",
12032            "jsonp-url"
12033        ]
12034    },
12035    "yql-nodejs": {
12036        "condition": {
12037            "name": "yql-nodejs",
12038            "trigger": "yql",
12039            "ua": "nodejs"
12040        },
12041        "requires": [
12042            "yql"
12043        ]
12044    },
12045    "yql-winjs": {
12046        "condition": {
12047            "name": "yql-winjs",
12048            "trigger": "yql",
12049            "ua": "winjs"
12050        },
12051        "requires": [
12052            "yql"
12053        ]
12054    },
12055    "yui": {},
12056    "yui-base": {},
12057    "yui-later": {
12058        "requires": [
12059            "yui-base"
12060        ]
12061    },
12062    "yui-log": {
12063        "requires": [
12064            "yui-base"
12065        ]
12066    },
12067    "yui-throttle": {
12068        "requires": [
12069            "yui-base"
12070        ]
12071    }
12072});
12073YUI.Env[Y.version].md5 = '95eb05a1b097773b5af03e0680e7dda4';
12074
12075
12076}, 'patched-v3.18.3', {"requires": ["loader-base"]});
12077YUI.add('yui', function (Y, NAME) {}, 'patched-v3.18.3', {
12078    "use": [
12079        "yui-base",
12080        "get",
12081        "features",
12082        "intl-base",
12083        "yui-log",
12084        "yui-later",
12085        "loader-base",
12086        "loader-rollup",
12087        "loader-yui3"
12088    ]
12089});
12090YUI.add('aui-base-core', function (A, NAME) {
12091
12092var Y = A;
12093YUI.Env.aliases = YUI.Env.aliases || {};
12094Y.mix(YUI.Env.aliases, {
12095    "aui-autosize": ["aui-autosize-iframe"],
12096    "aui-base": ["oop","yui-throttle","aui-classnamemanager","aui-debounce","aui-base-core","aui-base-lang","aui-node-base"],
12097    "aui-base-deprecated": ["aui-base","aui-node","aui-component","aui-delayed-task-deprecated","aui-selector","aui-event-base"],
12098    "aui-button": ["aui-button-core"],
12099    "aui-collection": ["aui-map","aui-set","aui-linkedset"],
12100    "aui-color-picker-deprecated": ["aui-color-picker-base-deprecated","aui-color-picker-grid-plugin-deprecated"],
12101    "aui-datasource-control-deprecated": ["aui-datasource-control-base-deprecated","aui-input-text-control-deprecated"],
12102    "aui-datatable": ["aui-datatable-edit","aui-datatable-highlight","aui-datatable-selection","aui-datatable-property-list"],
12103    "aui-datatable-edit": ["datatable-base","calendar","overlay","sortable","aui-datatype","aui-toolbar","aui-form-validator","aui-datatable-base-cell-editor","aui-datatable-base-options-cell-editor","aui-datatable-cell-editor-support","aui-datatable-core","aui-datatable-checkbox-cell-editor","aui-datatable-date-cell-editor","aui-datatable-dropdown-cell-editor","aui-datatable-radio-cell-editor","aui-datatable-text-cell-editor","aui-datatable-text-area-cell-editor"],
12104    "aui-datepicker-deprecated": ["aui-datepicker-base-deprecated","aui-datepicker-select-deprecated"],
12105    "aui-event": ["aui-event-base"],
12106    "aui-form-deprecated": ["aui-form-base-deprecated","aui-form-combobox-deprecated","aui-form-field-deprecated","aui-form-select-deprecated","aui-form-textarea-deprecated","aui-form-textfield-deprecated"],
12107    "aui-io": ["aui-io-request"],
12108    "aui-io-deprecated": ["aui-io-request","aui-io-plugin-deprecated"],
12109    "aui-node": ["aui-node-base"],
12110    "aui-overlay-deprecated": ["aui-overlay-base-deprecated","aui-overlay-context-deprecated","aui-overlay-context-panel-deprecated","aui-overlay-manager-deprecated","aui-overlay-mask-deprecated"],
12111    "aui-rating": ["aui-rating-base","aui-rating-thumb"],
12112    "aui-resize-deprecated": ["aui-resize-base-deprecated","aui-resize-constrain-deprecated"],
12113    "aui-scheduler": ["event-gestures","aui-scheduler-base","aui-scheduler-event-recorder","aui-scheduler-view-agenda","aui-scheduler-view-day","aui-scheduler-view-month","aui-scheduler-view-table-dd","aui-scheduler-view-table","aui-scheduler-view-week","aui-viewport"],
12114    "aui-search": ["aui-search-tst"],
12115    "aui-sortable": ["aui-sortable-layout","aui-sortable-list"],
12116    "aui-surface": ["aui-surface-app","aui-surface-screen"],
12117    "aui-toggler": ["aui-toggler-base","aui-toggler-delegate"],
12118    "aui-tooltip": ["aui-tooltip-base","aui-tooltip-delegate"],
12119    "aui-tpl-snippets-deprecated": ["aui-tpl-snippets-base-deprecated","aui-tpl-snippets-checkbox-deprecated","aui-tpl-snippets-input-deprecated","aui-tpl-snippets-select-deprecated","aui-tpl-snippets-textarea-deprecated"],
12120    "aui-tree": ["aui-tree-data","aui-tree-io","aui-tree-node","aui-tree-paginator","aui-tree-view"],
12121    "aui-widget": ["aui-widget-cssclass","aui-widget-toolbars"],
12122    "aui-widget-core": ["aui-widget-cssclass"]
12123});
12124/* This file is auto-generated by (yogi loader --yes --mix --js js/aui-loader.js --json js/aui-loader.json --start ../) */
12125
12126/*jshint maxlen:900, eqeqeq: false */
12127
12128/**
12129 * YUI 3 module metadata
12130 * @module loader
12131 * @submodule loader-yui3
12132 */
12133YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {};
12134Y.mix(YUI.Env[Y.version].modules, {
12135    "aui-ace-autocomplete-base": {
12136        "requires": [
12137            "aui-ace-editor"
12138        ]
12139    },
12140    "aui-ace-autocomplete-freemarker": {
12141        "requires": [
12142            "aui-ace-autocomplete-templateprocessor"
12143        ]
12144    },
12145    "aui-ace-autocomplete-list": {
12146        "requires": [
12147            "aui-ace-autocomplete-base",
12148            "overlay",
12149            "widget-autohide"
12150        ],
12151        "skinnable": true
12152    },
12153    "aui-ace-autocomplete-plugin": {
12154        "requires": [
12155            "aui-ace-autocomplete-list",
12156            "plugin"
12157        ]
12158    },
12159    "aui-ace-autocomplete-templateprocessor": {
12160        "requires": [
12161            "aui-ace-autocomplete-base"
12162        ]
12163    },
12164    "aui-ace-autocomplete-velocity": {
12165        "requires": [
12166            "aui-ace-autocomplete-templateprocessor"
12167        ]
12168    },
12169    "aui-ace-editor": {
12170        "requires": [
12171            "aui-node",
12172            "aui-component"
12173        ]
12174    },
12175    "aui-affix": {
12176        "requires": [
12177            "base",
12178            "node-screen",
12179            "aui-node"
12180        ]
12181    },
12182    "aui-alert": {
12183        "requires": [
12184            "aui-aria",
12185            "aui-classnamemanager",
12186            "aui-widget-cssclass",
12187            "aui-widget-transition",
12188            "timers",
12189            "widget",
12190            "widget-stdmod"
12191        ],
12192        "skinnable": true
12193    },
12194    "aui-aria": {
12195        "requires": [
12196            "plugin",
12197            "aui-component"
12198        ]
12199    },
12200    "aui-aria-table-sortable": {
12201        "requires": [
12202            "aui-aria"
12203        ]
12204    },
12205    "aui-arraysort": {
12206        "requires": [
12207            "arraysort"
12208        ]
12209    },
12210    "aui-audio": {
12211        "requires": [
12212            "aui-aria",
12213            "aui-node",
12214            "aui-component",
12215            "node-event-html5",
12216            "querystring-stringify-simple"
12217        ],
12218        "skinnable": true
12219    },
12220    "aui-autocomplete-deprecated": {
12221        "requires": [
12222            "aui-base-deprecated",
12223            "aui-overlay-base-deprecated",
12224            "datasource",
12225            "dataschema",
12226            "aui-form-combobox-deprecated"
12227        ],
12228        "skinnable": true
12229    },
12230    "aui-autosize": {
12231        "use": [
12232            "aui-autosize-iframe"
12233        ]
12234    },
12235    "aui-autosize-deprecated": {
12236        "requires": [
12237            "event-valuechange",
12238            "plugin",
12239            "aui-base-deprecated"
12240        ],
12241        "skinnable": true
12242    },
12243    "aui-autosize-iframe": {
12244        "requires": [
12245            "plugin",
12246            "aui-component",
12247            "aui-timer",
12248            "aui-node-base"
12249        ]
12250    },
12251    "aui-base": {
12252        "use": [
12253            "oop",
12254            "yui-throttle",
12255            "aui-classnamemanager",
12256            "aui-debounce",
12257            "aui-base-core",
12258            "aui-base-lang",
12259            "aui-node-base"
12260        ]
12261    },
12262    "aui-base-core": {},
12263    "aui-base-deprecated": {
12264        "use": [
12265            "aui-base",
12266            "aui-node",
12267            "aui-component",
12268            "aui-delayed-task-deprecated",
12269            "aui-selector",
12270            "aui-event-base"
12271        ]
12272    },
12273    "aui-base-html5-shiv": {
12274        "condition": {
12275            "name": "aui-base-html5-shiv",
12276            "trigger": "node-base",
12277            "ua": "ie"
12278        }
12279    },
12280    "aui-base-lang": {},
12281    "aui-boolean-data-editor": {
12282        "requires": [
12283            "aui-button-switch",
12284            "aui-data-editor"
12285        ]
12286    },
12287    "aui-button": {
12288        "use": [
12289            "aui-button-core"
12290        ]
12291    },
12292    "aui-button-core": {
12293        "requires": [
12294            "button",
12295            "button-group",
12296            "button-plugin",
12297            "aui-component",
12298            "aui-widget-cssclass",
12299            "aui-widget-toggle"
12300        ],
12301        "skinnable": true
12302    },
12303    "aui-button-item-deprecated": {
12304        "requires": [
12305            "aui-base-deprecated",
12306            "aui-state-interaction-deprecated",
12307            "widget-child"
12308        ],
12309        "skinnable": true
12310    },
12311    "aui-button-search-cancel": {
12312        "requires": [
12313            "array-invoke",
12314            "base",
12315            "base-build",
12316            "event-focus",
12317            "event-move",
12318            "event-resize",
12319            "node-screen",
12320            "node-event-delegate",
12321            "aui-node-base",
12322            "aui-classnamemanager",
12323            "aui-event-input"
12324        ]
12325    },
12326    "aui-button-switch": {
12327        "requires": [
12328            "aui-node-base",
12329            "base-build",
12330            "event-key",
12331            "transition",
12332            "widget"
12333        ],
12334        "skinnable": true
12335    },
12336    "aui-carousel": {
12337        "requires": [
12338            "anim",
12339            "aui-event",
12340            "aui-image-viewer-base",
12341            "aui-image-viewer-slideshow",
12342            "node-event-delegate",
12343            "node-focusmanager"
12344        ],
12345        "skinnable": true
12346    },
12347    "aui-carousel-mobile-touch": {
12348        "condition": {
12349            "name": "aui-carousel-mobile-touch",
12350            "test": function(A) {
12351    return A.UA.mobile && A.UA.touchEnabled;
12352},
12353            "trigger": "aui-carousel"
12354        },
12355        "requires": [
12356            "base-build",
12357            "aui-carousel"
12358        ]
12359    },
12360    "aui-carousel-swipe": {
12361        "condition": {
12362            "name": "aui-carousel-swipe",
12363            "trigger": "aui-carousel",
12364            "ua": "touchEnabled"
12365        },
12366        "requires": [
12367            "aui-carousel",
12368            "aui-widget-swipe",
12369            "base-build"
12370        ],
12371        "skinnable": true
12372    },
12373    "aui-char-counter": {
12374        "requires": [
12375            "aui-aria",
12376            "aui-node",
12377            "aui-event-input",
12378            "aui-component"
12379        ]
12380    },
12381    "aui-chart-deprecated": {
12382        "requires": [
12383            "datasource",
12384            "json",
12385            "aui-swf-deprecated"
12386        ]
12387    },
12388    "aui-classnamemanager": {
12389        "requires": [
12390            "classnamemanager"
12391        ]
12392    },
12393    "aui-collection": {
12394        "use": [
12395            "aui-map",
12396            "aui-set",
12397            "aui-linkedset"
12398        ]
12399    },
12400    "aui-color-palette": {
12401        "requires": [
12402            "array-extras",
12403            "aui-palette",
12404            "color-base",
12405            "node-core",
12406            "aui-widget-cssclass",
12407            "aui-widget-toggle"
12408        ],
12409        "skinnable": true
12410    },
12411    "aui-color-picker-base": {
12412        "requires": [
12413            "aui-color-palette",
12414            "aui-hsva-palette-modal",
12415            "event-outside"
12416        ],
12417        "skinnable": true
12418    },
12419    "aui-color-picker-base-deprecated": {
12420        "requires": [
12421            "dd-drag",
12422            "panel",
12423            "slider",
12424            "aui-button-item-deprecated",
12425            "aui-color-util-deprecated",
12426            "aui-form-base-deprecated",
12427            "aui-overlay-context-deprecated"
12428        ],
12429        "skinnable": true
12430    },
12431    "aui-color-picker-deprecated": {
12432        "use": [
12433            "aui-color-picker-base-deprecated",
12434            "aui-color-picker-grid-plugin-deprecated"
12435        ]
12436    },
12437    "aui-color-picker-grid-plugin-deprecated": {
12438        "requires": [
12439            "plugin",
12440            "aui-color-picker-base-deprecated"
12441        ],
12442        "skinnable": true
12443    },
12444    "aui-color-picker-popover": {
12445        "requires": [
12446            "aui-color-picker-base",
12447            "aui-popover",
12448            "aui-widget-cssclass",
12449            "aui-widget-toggle"
12450        ],
12451        "skinnable": true
12452    },
12453    "aui-color-util-deprecated": {
12454        "requires": []
12455    },
12456    "aui-component": {
12457        "requires": [
12458            "aui-classnamemanager",
12459            "aui-widget-cssclass",
12460            "aui-widget-toggle",
12461            "base-build",
12462            "widget-base"
12463        ]
12464    },
12465    "aui-css": {
12466        "type": "css"
12467    },
12468    "aui-data-editor": {
12469        "requires": [
12470            "aui-classnamemanager",
12471            "base-build",
12472            "node-base"
12473        ],
12474        "skinnable": true
12475    },
12476    "aui-data-set-deprecated": {
12477        "requires": [
12478            "oop",
12479            "collection",
12480            "base"
12481        ]
12482    },
12483    "aui-datasource-control-base-deprecated": {
12484        "requires": [
12485            "datasource",
12486            "dataschema",
12487            "aui-base-deprecated"
12488        ]
12489    },
12490    "aui-datasource-control-deprecated": {
12491        "use": [
12492            "aui-datasource-control-base-deprecated",
12493            "aui-input-text-control-deprecated"
12494        ]
12495    },
12496    "aui-datatable": {
12497        "use": [
12498            "aui-datatable-edit",
12499            "aui-datatable-highlight",
12500            "aui-datatable-selection",
12501            "aui-datatable-property-list"
12502        ]
12503    },
12504    "aui-datatable-base-cell-editor": {
12505        "requires": [
12506            "datatable-base",
12507            "overlay"
12508        ],
12509        "skinnable": true
12510    },
12511    "aui-datatable-base-options-cell-editor": {
12512        "requires": [
12513            "aui-datatable-base-cell-editor",
12514            "escape"
12515        ],
12516        "skinnable": true
12517    },
12518    "aui-datatable-body": {
12519        "requires": [
12520            "aui-classnamemanager",
12521            "datatable-base",
12522            "event-key",
12523            "aui-event-base"
12524        ]
12525    },
12526    "aui-datatable-cell-editor-support": {
12527        "requires": [
12528            "datatable-base"
12529        ]
12530    },
12531    "aui-datatable-checkbox-cell-editor": {
12532        "requires": [
12533            "aui-datatable-base-options-cell-editor"
12534        ]
12535    },
12536    "aui-datatable-core": {
12537        "requires": [
12538            "aui-datatable-body",
12539            "datatable-base",
12540            "event-key",
12541            "aui-event-base"
12542        ],
12543        "skinnable": true
12544    },
12545    "aui-datatable-date-cell-editor": {
12546        "requires": [
12547            "aui-datatable-base-options-cell-editor"
12548        ]
12549    },
12550    "aui-datatable-dropdown-cell-editor": {
12551        "requires": [
12552            "aui-datatable-base-options-cell-editor"
12553        ]
12554    },
12555    "aui-datatable-edit": {
12556        "use": [
12557            "datatable-base",
12558            "calendar",
12559            "overlay",
12560            "sortable",
12561            "aui-datatype",
12562            "aui-toolbar",
12563            "aui-form-validator",
12564            "aui-datatable-base-cell-editor",
12565            "aui-datatable-base-options-cell-editor",
12566            "aui-datatable-cell-editor-support",
12567            "aui-datatable-core",
12568            "aui-datatable-checkbox-cell-editor",
12569            "aui-datatable-date-cell-editor",
12570            "aui-datatable-dropdown-cell-editor",
12571            "aui-datatable-radio-cell-editor",
12572            "aui-datatable-text-cell-editor",
12573            "aui-datatable-text-area-cell-editor"
12574        ]
12575    },
12576    "aui-datatable-highlight": {
12577        "requires": [
12578            "aui-datatable-selection"
12579        ],
12580        "skinnable": true
12581    },
12582    "aui-datatable-property-list": {
12583        "requires": [
12584            "datatable-scroll",
12585            "datatable-sort",
12586            "aui-datatable-core",
12587            "aui-datatable-edit",
12588            "aui-datatable-highlight",
12589            "aui-datatable-selection",
12590            "aui-widget-cssclass",
12591            "aui-widget-toggle"
12592        ],
12593        "skinnable": true
12594    },
12595    "aui-datatable-radio-cell-editor": {
12596        "requires": [
12597            "aui-datatable-base-options-cell-editor"
12598        ]
12599    },
12600    "aui-datatable-selection": {
12601        "requires": [
12602            "aui-datatable-core"
12603        ],
12604        "skinnable": true
12605    },
12606    "aui-datatable-text-area-cell-editor": {
12607        "requires": [
12608            "aui-datatable-base-options-cell-editor"
12609        ]
12610    },
12611    "aui-datatable-text-cell-editor": {
12612        "requires": [
12613            "aui-datatable-base-options-cell-editor"
12614        ]
12615    },
12616    "aui-datatype": {
12617        "requires": [
12618            "datatype",
12619            "aui-datatype-date-parse"
12620        ]
12621    },
12622    "aui-datatype-date-parse": {
12623        "requires": [
12624            "aui-base-lang",
12625            "datatype-date-format",
12626            "datatype-date-parse",
12627            "intl"
12628        ]
12629    },
12630    "aui-datepicker": {
12631        "requires": [
12632            "aui-aria",
12633            "aui-datepicker-delegate",
12634            "aui-datepicker-popover",
12635            "base",
12636            "base-build",
12637            "calendar"
12638        ],
12639        "skinnable": true
12640    },
12641    "aui-datepicker-base-deprecated": {
12642        "requires": [
12643            "calendar",
12644            "aui-datatype",
12645            "aui-overlay-context-deprecated"
12646        ],
12647        "skinnable": true
12648    },
12649    "aui-datepicker-delegate": {
12650        "requires": [
12651            "aui-datatype-date-parse",
12652            "aui-event-input",
12653            "event-focus",
12654            "node-event-delegate"
12655        ]
12656    },
12657    "aui-datepicker-deprecated": {
12658        "skinnable": true,
12659        "use": [
12660            "aui-datepicker-base-deprecated",
12661            "aui-datepicker-select-deprecated"
12662        ]
12663    },
12664    "aui-datepicker-native": {
12665        "requires": [
12666            "aui-datepicker-delegate",
12667            "aui-node-base",
12668            "base",
12669            "base-build"
12670        ]
12671    },
12672    "aui-datepicker-popover": {
12673        "requires": [
12674            "aui-classnamemanager",
12675            "aui-popover"
12676        ]
12677    },
12678    "aui-datepicker-select-deprecated": {
12679        "requires": [
12680            "aui-datepicker-base-deprecated",
12681            "aui-button-item-deprecated"
12682        ],
12683        "skinnable": true
12684    },
12685    "aui-debounce": {},
12686    "aui-delayed-task-deprecated": {
12687        "requires": [
12688            "yui-base"
12689        ]
12690    },
12691    "aui-diagram-builder": {
12692        "requires": [
12693            "aui-aria",
12694            "aui-map",
12695            "aui-property-builder",
12696            "aui-diagram-builder-connector",
12697            "aui-property-builder-settings",
12698            "aui-diagram-node-condition",
12699            "aui-diagram-node-end",
12700            "aui-diagram-node-fork",
12701            "aui-diagram-node-join",
12702            "aui-diagram-node-start",
12703            "aui-diagram-node-state",
12704            "aui-diagram-node-task",
12705            "overlay"
12706        ],
12707        "skinnable": true
12708    },
12709    "aui-diagram-builder-connector": {
12710        "requires": [
12711            "arraylist-add",
12712            "arraylist-filter",
12713            "escape",
12714            "json",
12715            "graphics",
12716            "dd"
12717        ],
12718        "skinnable": true
12719    },
12720    "aui-diagram-node": {
12721        "requires": [
12722            "aui-aria",
12723            "aui-diagram-node-manager-base",
12724            "escape",
12725            "overlay"
12726        ]
12727    },
12728    "aui-diagram-node-condition": {
12729        "requires": [
12730            "aui-diagram-node-state"
12731        ]
12732    },
12733    "aui-diagram-node-end": {
12734        "requires": [
12735            "aui-diagram-node-state"
12736        ]
12737    },
12738    "aui-diagram-node-fork": {
12739        "requires": [
12740            "aui-diagram-node-state"
12741        ]
12742    },
12743    "aui-diagram-node-join": {
12744        "requires": [
12745            "aui-diagram-node-state"
12746        ]
12747    },
12748    "aui-diagram-node-manager-base": {
12749        "requires": [
12750            "base"
12751        ]
12752    },
12753    "aui-diagram-node-start": {
12754        "requires": [
12755            "aui-diagram-node-state"
12756        ]
12757    },
12758    "aui-diagram-node-state": {
12759        "requires": [
12760            "aui-diagram-node"
12761        ]
12762    },
12763    "aui-diagram-node-task": {
12764        "requires": [
12765            "aui-diagram-node-state"
12766        ]
12767    },
12768    "aui-dialog-iframe-deprecated": {
12769        "requires": [
12770            "plugin",
12771            "array-invoke",
12772            "aui-base-deprecated",
12773            "aui-loading-mask-deprecated"
12774        ],
12775        "skinnable": true
12776    },
12777    "aui-dropdown": {
12778        "requires": [
12779            "event-delegate",
12780            "event-key",
12781            "event-outside",
12782            "node-focusmanager",
12783            "widget",
12784            "widget-stack",
12785            "aui-classnamemanager",
12786            "aui-node",
12787            "aui-widget-cssclass",
12788            "aui-widget-toggle",
12789            "aui-widget-trigger"
12790        ],
12791        "skinnable": true
12792    },
12793    "aui-editable-deprecated": {
12794        "requires": [
12795            "aui-base-deprecated",
12796            "aui-form-combobox-deprecated",
12797            "escape",
12798            "event-resize"
12799        ],
12800        "skinnable": true
12801    },
12802    "aui-event": {
12803        "use": [
12804            "aui-event-base"
12805        ]
12806    },
12807    "aui-event-base": {
12808        "requires": [
12809            "event-base"
12810        ]
12811    },
12812    "aui-event-delegate-change": {
12813        "condition": {
12814            "name": "aui-event-delegate-change",
12815            "trigger": "event-base-ie",
12816            "ua": "ie"
12817        },
12818        "requires": [
12819            "aui-event-base",
12820            "event-delegate",
12821            "event-synthetic"
12822        ]
12823    },
12824    "aui-event-delegate-submit": {
12825        "condition": {
12826            "name": "aui-event-delegate-submit",
12827            "trigger": "event-base-ie",
12828            "ua": "ie"
12829        },
12830        "requires": [
12831            "aui-event-base",
12832            "event-delegate",
12833            "event-synthetic"
12834        ]
12835    },
12836    "aui-event-input": {
12837        "condition": {
12838            "name": "aui-event-input",
12839            "test": function(A) {
12840    var supportsDOMEvent = A.supportsDOMEvent,
12841        testFeature = A.Features.test,
12842        addFeature = A.Features.add;
12843
12844    if (testFeature('event', 'input') === undefined) {
12845        addFeature('event', 'input', {
12846            test: function() {
12847                return supportsDOMEvent(document.createElement('textarea'), 'input') && (!A.UA.ie || A.UA.ie > 9);
12848            }
12849        });
12850    }
12851
12852    return !testFeature('event', 'input');
12853},
12854            "trigger": "aui-event-base"
12855        },
12856        "requires": [
12857            "aui-event-base",
12858            "event-delegate",
12859            "event-synthetic",
12860            "timers"
12861        ]
12862    },
12863    "aui-form-base-deprecated": {
12864        "requires": [
12865            "io-form",
12866            "querystring-parse",
12867            "aui-base-deprecated",
12868            "aui-data-set-deprecated",
12869            "aui-form-field-deprecated"
12870        ]
12871    },
12872    "aui-form-builder": {
12873        "requires": [
12874            "aui-modal",
12875            "aui-layout",
12876            "aui-form-builder-field-list",
12877            "aui-form-builder-field-toolbar",
12878            "aui-form-builder-field-type",
12879            "aui-form-builder-field-types",
12880            "aui-form-builder-layout-builder",
12881            "aui-form-builder-page-manager",
12882            "aui-form-builder-settings-modal",
12883            "event-focus",
12884            "event-tap"
12885        ],
12886        "skinnable": true
12887    },
12888    "aui-form-builder-available-field-deprecated": {
12889        "requires": [
12890            "aui-property-builder-available-field"
12891        ]
12892    },
12893    "aui-form-builder-deprecated": {
12894        "requires": [
12895            "aui-button",
12896            "aui-collection",
12897            "aui-form-builder-available-field-deprecated",
12898            "aui-form-builder-field-deprecated",
12899            "aui-form-builder-field-button-deprecated",
12900            "aui-form-builder-field-checkbox-deprecated",
12901            "aui-form-builder-field-fieldset-deprecated",
12902            "aui-form-builder-field-file-upload-deprecated",
12903            "aui-form-builder-field-multiple-choice-deprecated",
12904            "aui-form-builder-field-radio-deprecated",
12905            "aui-form-builder-field-select-deprecated",
12906            "aui-form-builder-field-text-deprecated",
12907            "aui-form-builder-field-textarea-deprecated",
12908            "aui-property-builder",
12909            "aui-property-builder-settings",
12910            "aui-sortable-list",
12911            "aui-tabview",
12912            "aui-tooltip-base",
12913            "escape",
12914            "transition"
12915        ],
12916        "skinnable": true
12917    },
12918    "aui-form-builder-field-base": {
12919        "requires": [
12920            "aui-classnamemanager",
12921            "aui-node-base",
12922            "aui-text-data-editor",
12923            "aui-toggler",
12924            "base",
12925            "node-base"
12926        ],
12927        "skinnable": true
12928    },
12929    "aui-form-builder-field-button-deprecated": {
12930        "requires": [
12931            "aui-form-builder-field-deprecated"
12932        ]
12933    },
12934    "aui-form-builder-field-checkbox-deprecated": {
12935        "requires": [
12936            "aui-form-builder-field-deprecated"
12937        ]
12938    },
12939    "aui-form-builder-field-choice": {
12940        "requires": [
12941            "aui-boolean-data-editor",
12942            "aui-options-data-editor",
12943            "aui-tabs-data-editor",
12944            "aui-form-builder-field-base",
12945            "aui-form-field-choice"
12946        ]
12947    },
12948    "aui-form-builder-field-deprecated": {
12949        "requires": [
12950            "panel",
12951            "aui-datatype",
12952            "aui-datatable-edit",
12953            "aui-property-builder-field-support"
12954        ],
12955        "skinnable": true
12956    },
12957    "aui-form-builder-field-fieldset-deprecated": {
12958        "requires": [
12959            "aui-form-builder-field-deprecated"
12960        ]
12961    },
12962    "aui-form-builder-field-file-upload-deprecated": {
12963        "requires": [
12964            "aui-form-builder-field-deprecated"
12965        ]
12966    },
12967    "aui-form-builder-field-list": {
12968        "requires": [
12969            "aui-form-builder-field-type",
12970            "aui-form-builder-field-types",
12971            "aui-form-builder-layout-builder"
12972        ],
12973        "skinnable": true
12974    },
12975    "aui-form-builder-field-multiple-choice-deprecated": {
12976        "requires": [
12977            "aui-form-builder-field-deprecated"
12978        ]
12979    },
12980    "aui-form-builder-field-radio-deprecated": {
12981        "requires": [
12982            "aui-form-builder-field-deprecated"
12983        ]
12984    },
12985    "aui-form-builder-field-select-deprecated": {
12986        "requires": [
12987            "aui-form-builder-field-deprecated"
12988        ]
12989    },
12990    "aui-form-builder-field-sentence": {
12991        "requires": [
12992            "aui-form-builder-field-base",
12993            "aui-form-field"
12994        ]
12995    },
12996    "aui-form-builder-field-text": {
12997        "requires": [
12998            "aui-boolean-data-editor",
12999            "aui-radio-group-data-editor",
13000            "aui-form-builder-field-base",
13001            "aui-form-field-text"
13002        ]
13003    },
13004    "aui-form-builder-field-text-deprecated": {
13005        "requires": [
13006            "aui-form-builder-field-deprecated"
13007        ]
13008    },
13009    "aui-form-builder-field-textarea-deprecated": {
13010        "requires": [
13011            "aui-form-builder-field-deprecated"
13012        ]
13013    },
13014    "aui-form-builder-field-toolbar": {
13015        "requires": [
13016            "aui-classnamemanager",
13017            "base",
13018            "node-base"
13019        ],
13020        "skinnable": true
13021    },
13022    "aui-form-builder-field-type": {
13023        "requires": [
13024            "base",
13025            "node-base"
13026        ],
13027        "skinnable": true
13028    },
13029    "aui-form-builder-field-types": {
13030        "requires": [
13031            "aui-classnamemanager",
13032            "aui-form-builder-field-types-modal",
13033            "base",
13034            "node-base"
13035        ],
13036        "skinnable": true
13037    },
13038    "aui-form-builder-field-types-modal": {
13039        "requires": [
13040            "aui-modal"
13041        ],
13042        "skinnable": true
13043    },
13044    "aui-form-builder-layout-builder": {
13045        "requires": [
13046            "aui-classnamemanager",
13047            "aui-layout-builder",
13048            "aui-modal",
13049            "base",
13050            "node-base"
13051        ],
13052        "skinnable": true
13053    },
13054    "aui-form-builder-page-manager": {
13055        "requires": [
13056            "aui-pagination",
13057            "aui-popover",
13058            "aui-tabview",
13059            "base",
13060            "event-valuechange",
13061            "node-base"
13062        ],
13063        "skinnable": true
13064    },
13065    "aui-form-builder-settings-modal": {
13066        "requires": [
13067            "aui-classnamemanager",
13068            "aui-modal",
13069            "base",
13070            "node-base"
13071        ],
13072        "skinnable": true
13073    },
13074    "aui-form-combobox-deprecated": {
13075        "requires": [
13076            "aui-form-textarea-deprecated",
13077            "aui-toolbar"
13078        ],
13079        "skinnable": true
13080    },
13081    "aui-form-deprecated": {
13082        "use": [
13083            "aui-form-base-deprecated",
13084            "aui-form-combobox-deprecated",
13085            "aui-form-field-deprecated",
13086            "aui-form-select-deprecated",
13087            "aui-form-textarea-deprecated",
13088            "aui-form-textfield-deprecated"
13089        ]
13090    },
13091    "aui-form-field": {
13092        "requires": [
13093            "aui-classnamemanager",
13094            "aui-node-base",
13095            "base-build"
13096        ],
13097        "skinnable": true
13098    },
13099    "aui-form-field-choice": {
13100        "requires": [
13101            "aui-form-field-required"
13102        ],
13103        "skinnable": true
13104    },
13105    "aui-form-field-deprecated": {
13106        "requires": [
13107            "aui-base-deprecated",
13108            "aui-component"
13109        ]
13110    },
13111    "aui-form-field-required": {
13112        "requires": [
13113            "aui-form-field"
13114        ]
13115    },
13116    "aui-form-field-text": {
13117        "requires": [
13118            "aui-form-field-required"
13119        ],
13120        "skinnable": true
13121    },
13122    "aui-form-select-deprecated": {
13123        "requires": [
13124            "aui-form-field-deprecated"
13125        ]
13126    },
13127    "aui-form-textarea-deprecated": {
13128        "requires": [
13129            "node-pluginhost",
13130            "aui-autosize-deprecated",
13131            "aui-form-textfield-deprecated"
13132        ]
13133    },
13134    "aui-form-textfield-deprecated": {
13135        "requires": [
13136            "aui-form-field-deprecated"
13137        ]
13138    },
13139    "aui-form-validator": {
13140        "requires": [
13141            "escape",
13142            "selector-css3",
13143            "node-event-delegate",
13144            "aui-node",
13145            "aui-component",
13146            "aui-event-input"
13147        ]
13148    },
13149    "aui-hsv-palette": {
13150        "requires": [
13151            "aui-classnamemanager",
13152            "aui-widget-cssclass",
13153            "aui-widget-toggle",
13154            "aui-event-input",
13155            "base-build",
13156            "clickable-rail",
13157            "color-hsv",
13158            "dd-constrain",
13159            "slider",
13160            "widget"
13161        ],
13162        "skinnable": true
13163    },
13164    "aui-hsva-palette": {
13165        "requires": [
13166            "aui-hsv-palette"
13167        ],
13168        "skinnable": true
13169    },
13170    "aui-hsva-palette-modal": {
13171        "requires": [
13172            "aui-hsva-palette",
13173            "aui-modal"
13174        ],
13175        "skinnable": true
13176    },
13177    "aui-image-cropper": {
13178        "requires": [
13179            "resize-base",
13180            "resize-constrain",
13181            "dd-constrain",
13182            "aui-node-base",
13183            "aui-component"
13184        ],
13185        "skinnable": true
13186    },
13187    "aui-image-viewer": {
13188        "requires": [
13189            "widget",
13190            "widget-modality",
13191            "widget-position",
13192            "widget-position-align",
13193            "widget-position-constrain",
13194            "widget-stack",
13195            "widget-stdmod",
13196            "aui-event",
13197            "aui-image-viewer-base",
13198            "aui-image-viewer-multiple",
13199            "aui-image-viewer-slideshow",
13200            "aui-node-base",
13201            "aui-widget-cssclass",
13202            "aui-widget-toggle"
13203        ],
13204        "skinnable": true
13205    },
13206    "aui-image-viewer-base": {
13207        "requires": [
13208            "anim",
13209            "aui-aria",
13210            "aui-classnamemanager",
13211            "aui-node",
13212            "aui-widget-responsive",
13213            "base-build",
13214            "imageloader",
13215            "node-base",
13216            "widget",
13217            "widget-stack"
13218        ],
13219        "skinnable": true
13220    },
13221    "aui-image-viewer-media": {
13222        "requires": [
13223            "plugin",
13224            "aui-component",
13225            "aui-image-viewer"
13226        ]
13227    },
13228    "aui-image-viewer-multiple": {
13229        "requires": [
13230            "base-build",
13231            "node-base",
13232            "aui-classnamemanager",
13233            "aui-image-viewer-base"
13234        ],
13235        "skinnable": true
13236    },
13237    "aui-image-viewer-multiple-swipe": {
13238        "condition": {
13239            "name": "aui-image-viewer-multiple-swipe",
13240            "trigger": "aui-image-viewer-multiple",
13241            "ua": "touchEnabled"
13242        },
13243        "requires": [
13244            "aui-image-viewer-multiple",
13245            "aui-image-viewer-swipe"
13246        ]
13247    },
13248    "aui-image-viewer-slideshow": {
13249        "requires": [
13250            "node",
13251            "aui-classnamemanager"
13252        ]
13253    },
13254    "aui-image-viewer-swipe": {
13255        "condition": {
13256            "name": "aui-image-viewer-swipe",
13257            "trigger": "aui-image-viewer-base",
13258            "ua": "touchEnabled"
13259        },
13260        "requires": [
13261            "event-resize",
13262            "aui-image-viewer-base",
13263            "aui-widget-swipe"
13264        ]
13265    },
13266    "aui-input-text-control-deprecated": {
13267        "requires": [
13268            "aui-base-deprecated",
13269            "aui-datasource-control-base-deprecated",
13270            "aui-form-combobox-deprecated"
13271        ]
13272    },
13273    "aui-io": {
13274        "use": [
13275            "aui-io-request"
13276        ]
13277    },
13278    "aui-io-deprecated": {
13279        "use": [
13280            "aui-io-request",
13281            "aui-io-plugin-deprecated"
13282        ]
13283    },
13284    "aui-io-plugin-deprecated": {
13285        "requires": [
13286            "aui-overlay-base-deprecated",
13287            "aui-parse-content",
13288            "aui-io-request",
13289            "aui-loading-mask-deprecated"
13290        ]
13291    },
13292    "aui-io-request": {
13293        "requires": [
13294            "io-base",
13295            "json",
13296            "plugin",
13297            "querystring-stringify",
13298            "aui-component"
13299        ]
13300    },
13301    "aui-io-request-deprecated": {
13302        "requires": [
13303            "io-base",
13304            "json",
13305            "plugin",
13306            "querystring-stringify",
13307            "aui-base-deprecated"
13308        ]
13309    },
13310    "aui-layout": {
13311        "requires": [
13312            "aui-layout-col",
13313            "aui-layout-row",
13314            "aui-node-base",
13315            "base-build",
13316            "datatype-number-parse",
13317            "event-resize"
13318        ]
13319    },
13320    "aui-layout-builder": {
13321        "requires": [
13322            "aui-classnamemanager",
13323            "aui-layout",
13324            "aui-layout-builder-add-col",
13325            "aui-layout-builder-add-row",
13326            "aui-layout-builder-move",
13327            "aui-layout-builder-remove-row",
13328            "aui-layout-builder-resize-col",
13329            "aui-node-base",
13330            "base-build",
13331            "node-event-delegate",
13332            "node-screen",
13333            "node-style"
13334        ]
13335    },
13336    "aui-layout-builder-add-col": {
13337        "requires": [
13338            "event-key",
13339            "node-base"
13340        ],
13341        "skinnable": true
13342    },
13343    "aui-layout-builder-add-row": {
13344        "requires": [
13345            "aui-node-base",
13346            "base-build",
13347            "node-scroll-info"
13348        ],
13349        "skinnable": true
13350    },
13351    "aui-layout-builder-move": {
13352        "requires": [
13353            "aui-node-base",
13354            "base-build"
13355        ],
13356        "skinnable": true
13357    },
13358    "aui-layout-builder-remove-row": {
13359        "requires": [
13360            "aui-node-base",
13361            "base-build"
13362        ],
13363        "skinnable": true
13364    },
13365    "aui-layout-builder-resize-col": {
13366        "requires": [
13367            "dd-constrain",
13368            "dd-delegate",
13369            "dd-drop-plugin",
13370            "dd-proxy",
13371            "event-mouseenter",
13372            "node-base"
13373        ],
13374        "skinnable": true
13375    },
13376    "aui-layout-col": {
13377        "requires": [
13378            "aui-classnamemanager",
13379            "aui-node-base",
13380            "base-build"
13381        ],
13382        "skinnable": true
13383    },
13384    "aui-layout-row": {
13385        "requires": [
13386            "array-invoke",
13387            "aui-node-base",
13388            "base-build"
13389        ],
13390        "skinnable": true
13391    },
13392    "aui-linkedset": {
13393        "requires": [
13394            "aui-set"
13395        ]
13396    },
13397    "aui-live-search-deprecated": {
13398        "requires": [
13399            "aui-base-deprecated"
13400        ]
13401    },
13402    "aui-loading-mask-deprecated": {
13403        "requires": [
13404            "plugin",
13405            "aui-overlay-mask-deprecated"
13406        ],
13407        "skinnable": true
13408    },
13409    "aui-map": {
13410        "requires": [
13411            "base-build"
13412        ]
13413    },
13414    "aui-menu": {
13415        "requires": [
13416            "base-build",
13417            "event-mouseenter",
13418            "event-resize",
13419            "widget",
13420            "widget-position",
13421            "widget-position-align",
13422            "widget-position-constrain",
13423            "widget-stack",
13424            "aui-classnamemanager",
13425            "aui-debounce",
13426            "aui-dropdown",
13427            "aui-menu-item"
13428        ],
13429        "skinnable": true
13430    },
13431    "aui-menu-item": {
13432        "requires": [
13433            "base-build",
13434            "node-base",
13435            "aui-classnamemanager",
13436            "aui-node",
13437            "aui-widget-shortcut"
13438        ]
13439    },
13440    "aui-messaging": {
13441        "requires": [
13442            "querystring",
13443            "aui-timer"
13444        ]
13445    },
13446    "aui-modal": {
13447        "requires": [
13448            "widget",
13449            "widget-autohide",
13450            "widget-buttons",
13451            "widget-modality",
13452            "widget-position",
13453            "widget-position-align",
13454            "widget-position-constrain",
13455            "widget-stack",
13456            "widget-stdmod",
13457            "dd-plugin",
13458            "dd-constrain",
13459            "timers",
13460            "aui-classnamemanager",
13461            "aui-widget-cssclass",
13462            "aui-widget-toggle",
13463            "aui-widget-toolbars"
13464        ],
13465        "skinnable": true
13466    },
13467    "aui-modal-resize": {
13468        "condition": {
13469            "name": "aui-modal-resize",
13470            "test": function(A) {
13471    return !A.UA.mobile;
13472},
13473            "trigger": "aui-modal"
13474        },
13475        "requires": [
13476            "aui-modal",
13477            "resize-plugin"
13478        ]
13479    },
13480    "aui-node": {
13481        "use": [
13482            "aui-node-base"
13483        ]
13484    },
13485    "aui-node-accessible": {
13486        "requires": [
13487            "aui-node-base",
13488            "event-custom-base"
13489        ]
13490    },
13491    "aui-node-base": {
13492        "requires": [
13493            "array-extras",
13494            "aui-base-lang",
13495            "aui-classnamemanager",
13496            "aui-debounce",
13497            "node"
13498        ]
13499    },
13500    "aui-node-html5": {
13501        "condition": {
13502            "name": "aui-node-html5",
13503            "trigger": "aui-node",
13504            "ua": "ie"
13505        },
13506        "requires": [
13507            "collection",
13508            "aui-node-base"
13509        ]
13510    },
13511    "aui-options-data-editor": {
13512        "requires": [
13513            "aui-data-editor",
13514            "dd-constrain",
13515            "dd-delegate",
13516            "dd-drop-plugin",
13517            "dd-proxy",
13518            "event-valuechange",
13519            "node-event-delegate"
13520        ],
13521        "skinnable": true
13522    },
13523    "aui-overlay-base-deprecated": {
13524        "requires": [
13525            "widget-position",
13526            "widget-stack",
13527            "widget-position-align",
13528            "widget-position-constrain",
13529            "widget-stdmod",
13530            "aui-component"
13531        ]
13532    },
13533    "aui-overlay-context-deprecated": {
13534        "requires": [
13535            "aui-overlay-manager-deprecated",
13536            "aui-delayed-task-deprecated",
13537            "aui-aria"
13538        ]
13539    },
13540    "aui-overlay-context-panel-deprecated": {
13541        "requires": [
13542            "anim",
13543            "aui-overlay-context-deprecated"
13544        ],
13545        "skinnable": true
13546    },
13547    "aui-overlay-deprecated": {
13548        "use": [
13549            "aui-overlay-base-deprecated",
13550            "aui-overlay-context-deprecated",
13551            "aui-overlay-context-panel-deprecated",
13552            "aui-overlay-manager-deprecated",
13553            "aui-overlay-mask-deprecated"
13554        ]
13555    },
13556    "aui-overlay-manager-deprecated": {
13557        "requires": [
13558            "overlay",
13559            "plugin",
13560            "aui-base-deprecated",
13561            "aui-overlay-base-deprecated"
13562        ]
13563    },
13564    "aui-overlay-mask-deprecated": {
13565        "requires": [
13566            "event-resize",
13567            "aui-base-deprecated",
13568            "aui-overlay-base-deprecated"
13569        ],
13570        "skinnable": true
13571    },
13572    "aui-pagination": {
13573        "requires": [
13574            "node-event-delegate",
13575            "aui-node",
13576            "aui-component",
13577            "widget-htmlparser"
13578        ],
13579        "skinnable": true
13580    },
13581    "aui-palette": {
13582        "requires": [
13583            "base-build",
13584            "event-hover",
13585            "widget",
13586            "aui-classnamemanager",
13587            "aui-base",
13588            "aui-widget-cssclass",
13589            "aui-widget-toggle"
13590        ],
13591        "skinnable": true
13592    },
13593    "aui-parse-content": {
13594        "requires": [
13595            "async-queue",
13596            "plugin",
13597            "io-base",
13598            "aui-component",
13599            "aui-node-base"
13600        ]
13601    },
13602    "aui-popover": {
13603        "requires": [
13604            "event-resize",
13605            "widget",
13606            "widget-autohide",
13607            "widget-buttons",
13608            "widget-modality",
13609            "widget-position",
13610            "widget-position-align",
13611            "widget-position-constrain",
13612            "widget-stack",
13613            "widget-stdmod",
13614            "aui-classnamemanager",
13615            "aui-widget-cssclass",
13616            "aui-widget-toggle",
13617            "aui-widget-toolbars",
13618            "aui-widget-transition",
13619            "aui-widget-trigger",
13620            "aui-widget-position-align-suggestion",
13621            "aui-component",
13622            "aui-node-base"
13623        ],
13624        "skinnable": true
13625    },
13626    "aui-progressbar": {
13627        "requires": [
13628            "aui-node",
13629            "aui-component",
13630            "aui-aria"
13631        ],
13632        "skinnable": true
13633    },
13634    "aui-promise": {
13635        "requires": [
13636            "array-invoke",
13637            "promise",
13638            "oop"
13639        ]
13640    },
13641    "aui-property-builder": {
13642        "requires": [
13643            "dd",
13644            "collection",
13645            "aui-property-builder-available-field",
13646            "aui-property-builder-field-support",
13647            "aui-property-builder-settings",
13648            "aui-tabview"
13649        ],
13650        "skinnable": true
13651    },
13652    "aui-property-builder-available-field": {
13653        "requires": [
13654            "base",
13655            "aui-component",
13656            "aui-node"
13657        ]
13658    },
13659    "aui-property-builder-field-support": {},
13660    "aui-property-builder-settings": {
13661        "requires": [
13662            "aui-tabview",
13663            "aui-datatable-property-list"
13664        ]
13665    },
13666    "aui-radio-group-data-editor": {
13667        "requires": [
13668            "aui-data-editor",
13669            "node-event-delegate"
13670        ],
13671        "skinnable": true
13672    },
13673    "aui-rating": {
13674        "use": [
13675            "aui-rating-base",
13676            "aui-rating-thumb"
13677        ]
13678    },
13679    "aui-rating-base": {
13680        "requires": [
13681            "aui-component",
13682            "aui-node-base",
13683            "widget-htmlparser",
13684            "widget-uievents"
13685        ],
13686        "skinnable": true
13687    },
13688    "aui-rating-thumb": {
13689        "requires": [
13690            "aui-rating-base"
13691        ]
13692    },
13693    "aui-resize-base-deprecated": {
13694        "requires": [
13695            "dd-drag",
13696            "dd-delegate",
13697            "dd-drop",
13698            "aui-base-deprecated"
13699        ],
13700        "skinnable": true
13701    },
13702    "aui-resize-constrain-deprecated": {
13703        "requires": [
13704            "dd-constrain",
13705            "plugin",
13706            "aui-resize-base-deprecated"
13707        ]
13708    },
13709    "aui-resize-deprecated": {
13710        "skinnable": true,
13711        "use": [
13712            "aui-resize-base-deprecated",
13713            "aui-resize-constrain-deprecated"
13714        ]
13715    },
13716    "aui-scale-data-editor": {
13717        "requires": [
13718            "aui-classnamemanager",
13719            "aui-data-editor",
13720            "event-valuechange"
13721        ]
13722    },
13723    "aui-scheduler": {
13724        "use": [
13725            "event-gestures",
13726            "aui-scheduler-base",
13727            "aui-scheduler-event-recorder",
13728            "aui-scheduler-view-agenda",
13729            "aui-scheduler-view-day",
13730            "aui-scheduler-view-month",
13731            "aui-scheduler-view-table-dd",
13732            "aui-scheduler-view-table",
13733            "aui-scheduler-view-week",
13734            "aui-viewport"
13735        ]
13736    },
13737    "aui-scheduler-base": {
13738        "requires": [
13739            "model",
13740            "model-list",
13741            "widget-stdmod",
13742            "color-hsl",
13743            "aui-event-base",
13744            "aui-node-base",
13745            "aui-component",
13746            "aui-datatype",
13747            "aui-button",
13748            "node-focusmanager"
13749        ],
13750        "skinnable": true
13751    },
13752    "aui-scheduler-event-recorder": {
13753        "requires": [
13754            "querystring",
13755            "io-form",
13756            "overlay",
13757            "aui-scheduler-base",
13758            "aui-popover"
13759        ],
13760        "skinnable": true
13761    },
13762    "aui-scheduler-touch": {
13763        "condition": {
13764            "name": "aui-scheduler-touch",
13765            "trigger": "aui-scheduler",
13766            "ua": "touchEnabled"
13767        },
13768        "requires": [
13769            "base-build",
13770            "aui-scheduler"
13771        ],
13772        "skinnable": true
13773    },
13774    "aui-scheduler-view-agenda": {
13775        "requires": [
13776            "aui-scheduler-base"
13777        ],
13778        "skinnable": true
13779    },
13780    "aui-scheduler-view-day": {
13781        "requires": [
13782            "dd-drag",
13783            "dd-delegate",
13784            "dd-drop",
13785            "dd-constrain",
13786            "aui-scheduler-view-table"
13787        ],
13788        "skinnable": true
13789    },
13790    "aui-scheduler-view-month": {
13791        "requires": [
13792            "aui-scheduler-view-table"
13793        ],
13794        "skinnable": true
13795    },
13796    "aui-scheduler-view-table": {
13797        "requires": [
13798            "overlay",
13799            "aui-scheduler-base"
13800        ],
13801        "skinnable": true
13802    },
13803    "aui-scheduler-view-table-dd": {
13804        "requires": [
13805            "dd-drag",
13806            "dd-delegate",
13807            "dd-drop",
13808            "aui-scheduler-view-table"
13809        ]
13810    },
13811    "aui-scheduler-view-week": {
13812        "requires": [
13813            "aui-scheduler-view-day"
13814        ],
13815        "skinnable": true
13816    },
13817    "aui-scroller-deprecated": {
13818        "requires": [
13819            "event-mouseenter",
13820            "aui-base-deprecated",
13821            "aui-simple-anim-deprecated"
13822        ],
13823        "skinnable": true
13824    },
13825    "aui-scrollspy": {
13826        "requires": [
13827            "base-build",
13828            "node-screen",
13829            "aui-classnamemanager"
13830        ]
13831    },
13832    "aui-search": {
13833        "use": [
13834            "aui-search-tst"
13835        ]
13836    },
13837    "aui-search-tst": {
13838        "requires": [
13839            "aui-component"
13840        ]
13841    },
13842    "aui-selector": {
13843        "requires": [
13844            "selector-css3",
13845            "aui-classnamemanager"
13846        ]
13847    },
13848    "aui-set": {
13849        "requires": [
13850            "aui-map"
13851        ]
13852    },
13853    "aui-simple-anim-deprecated": {
13854        "requires": [
13855            "aui-base-deprecated"
13856        ]
13857    },
13858    "aui-skin-deprecated": {
13859        "type": "css"
13860    },
13861    "aui-sortable": {
13862        "use": [
13863            "aui-sortable-layout",
13864            "aui-sortable-list"
13865        ]
13866    },
13867    "aui-sortable-layout": {
13868        "requires": [
13869            "dd-delegate",
13870            "dd-drag",
13871            "dd-drop",
13872            "dd-proxy",
13873            "aui-node",
13874            "aui-component"
13875        ],
13876        "skinnable": true
13877    },
13878    "aui-sortable-list": {
13879        "requires": [
13880            "dd-drag",
13881            "dd-drop",
13882            "dd-proxy",
13883            "dd-scroll",
13884            "aui-node",
13885            "aui-component"
13886        ]
13887    },
13888    "aui-state-interaction-deprecated": {
13889        "requires": [
13890            "aui-base-deprecated",
13891            "plugin"
13892        ]
13893    },
13894    "aui-surface": {
13895        "use": [
13896            "aui-surface-app",
13897            "aui-surface-screen"
13898        ]
13899    },
13900    "aui-surface-app": {
13901        "requires": [
13902            "event-delegate",
13903            "node-event-html5",
13904            "aui-surface-base",
13905            "aui-surface-screen",
13906            "aui-surface-screen-route"
13907        ]
13908    },
13909    "aui-surface-base": {
13910        "requires": [
13911            "base-build",
13912            "node-style",
13913            "timers",
13914            "aui-debounce",
13915            "aui-promise",
13916            "aui-parse-content"
13917        ]
13918    },
13919    "aui-surface-screen": {
13920        "requires": [
13921            "base-build"
13922        ]
13923    },
13924    "aui-surface-screen-html": {
13925        "requires": [
13926            "aui-base",
13927            "aui-io-request",
13928            "aui-promise",
13929         
13929   "aui-surface-screen",
13930            "aui-url"
13931        ]
13932    },
13933    "aui-surface-screen-route": {
13934        "requires": [
13935            "base-build"
13936        ]
13937    },
13938    "aui-swf-deprecated": {
13939        "requires": [
13940            "querystring-parse-simple",
13941            "querystring-stringify-simple",
13942            "aui-base-deprecated"
13943        ]
13944    },
13945    "aui-tabs-data-editor": {
13946        "requires": [
13947            "aui-data-editor",
13948            "aui-tabview"
13949        ]
13950    },
13951    "aui-tabview": {
13952        "requires": [
13953            "selector-css3",
13954            "tabview",
13955            "aui-component",
13956            "aui-widget-css"
13957        ],
13958        "skinnable": true
13959    },
13960    "aui-template-deprecated": {
13961        "requires": [
13962            "aui-base-deprecated"
13963        ]
13964    },
13965    "aui-text-data-editor": {
13966        "requires": [
13967            "aui-data-editor",
13968            "event-valuechange"
13969        ],
13970        "skinnable": true
13971    },
13972    "aui-text-data-unicode": {
13973        "requires": [
13974            "text"
13975        ]
13976    },
13977    "aui-text-unicode": {
13978        "requires": [
13979            "aui-text-data-unicode"
13980        ]
13981    },
13982    "aui-textboxlist-deprecated": {
13983        "requires": [
13984            "anim-node-plugin",
13985            "aui-autocomplete-deprecated",
13986            "aui-button-item-deprecated",
13987            "aui-data-set-deprecated",
13988            "escape",
13989            "node-focusmanager"
13990        ],
13991        "skinnable": true
13992    },
13993    "aui-timepicker": {
13994        "requires": [
13995            "autocomplete",
13996            "aui-datepicker-delegate",
13997            "aui-datepicker-popover"
13998        ],
13999        "skinnable": true
14000    },
14001    "aui-timepicker-native": {
14002        "requires": [
14003            "base",
14004            "base-build",
14005            "aui-node-base",
14006            "aui-datepicker-delegate",
14007            "aui-datepicker-native"
14008        ]
14009    },
14010    "aui-timer": {
14011        "requires": [
14012            "oop"
14013        ]
14014    },
14015    "aui-toggler": {
14016        "use": [
14017            "aui-toggler-base",
14018            "aui-toggler-delegate"
14019        ]
14020    },
14021    "aui-toggler-accessibility": {
14022        "requires": [
14023            "aui-toggler-base"
14024        ]
14025    },
14026    "aui-toggler-base": {
14027        "requires": [
14028            "transition",
14029            "aui-selector",
14030            "aui-event-base",
14031            "aui-node",
14032            "aui-component",
14033            "event-tap"
14034        ],
14035        "skinnable": true
14036    },
14037    "aui-toggler-delegate": {
14038        "requires": [
14039            "array-invoke",
14040            "node-event-delegate",
14041            "aui-toggler-base"
14042        ]
14043    },
14044    "aui-toolbar": {
14045        "requires": [
14046            "arraylist",
14047            "arraylist-add",
14048            "aui-component",
14049            "aui-button-core"
14050        ]
14051    },
14052    "aui-tooltip": {
14053        "use": [
14054            "aui-tooltip-base",
14055            "aui-tooltip-delegate"
14056        ]
14057    },
14058    "aui-tooltip-base": {
14059        "requires": [
14060            "aui-aria",
14061            "aui-classnamemanager",
14062            "aui-component",
14063            "aui-debounce",
14064            "aui-node-base",
14065            "aui-widget-cssclass",
14066            "aui-widget-toggle",
14067            "aui-widget-transition",
14068            "aui-widget-trigger",
14069            "aui-widget-position-align-suggestion",
14070            "event-hover",
14071            "event-resize",
14072            "escape",
14073            "widget",
14074            "widget-autohide",
14075            "widget-position",
14076            "widget-position-align",
14077            "widget-position-constrain",
14078            "widget-stack",
14079            "widget-stdmod"
14080        ],
14081        "skinnable": true
14082    },
14083    "aui-tooltip-delegate": {
14084        "requires": [
14085            "aui-tooltip-base",
14086            "node-event-delegate"
14087        ]
14088    },
14089    "aui-tooltip-deprecated": {
14090        "requires": [
14091            "aui-overlay-context-panel-deprecated"
14092        ],
14093        "skinnable": true
14094    },
14095    "aui-tpl-snippets-base-deprecated": {
14096        "requires": [
14097            "aui-template-deprecated"
14098        ]
14099    },
14100    "aui-tpl-snippets-checkbox-deprecated": {
14101        "requires": [
14102            "aui-tpl-snippets-base-deprecated"
14103        ]
14104    },
14105    "aui-tpl-snippets-deprecated": {
14106        "use": [
14107            "aui-tpl-snippets-base-deprecated",
14108            "aui-tpl-snippets-checkbox-deprecated",
14109            "aui-tpl-snippets-input-deprecated",
14110            "aui-tpl-snippets-select-deprecated",
14111            "aui-tpl-snippets-textarea-deprecated"
14112        ]
14113    },
14114    "aui-tpl-snippets-input-deprecated": {
14115        "requires": [
14116            "aui-tpl-snippets-base-deprecated"
14117        ]
14118    },
14119    "aui-tpl-snippets-select-deprecated": {
14120        "requires": [
14121            "aui-tpl-snippets-base-deprecated"
14122        ]
14123    },
14124    "aui-tpl-snippets-textarea-deprecated": {
14125        "requires": [
14126            "aui-tpl-snippets-base-deprecated"
14127        ]
14128    },
14129    "aui-tree": {
14130        "use": [
14131            "aui-tree-data",
14132            "aui-tree-io",
14133            "aui-tree-node",
14134            "aui-tree-paginator",
14135            "aui-tree-view"
14136        ]
14137    },
14138    "aui-tree-data": {
14139        "requires": [
14140            "aui-base-core",
14141            "aui-base-lang",
14142            "aui-node-base",
14143            "aui-timer",
14144            "aui-component"
14145        ]
14146    },
14147    "aui-tree-io": {
14148        "requires": [
14149            "aui-component",
14150            "aui-io"
14151        ]
14152    },
14153    "aui-tree-node": {
14154        "requires": [
14155            "json",
14156            "querystring-stringify",
14157            "aui-tree-data",
14158            "aui-tree-io",
14159            "aui-tree-paginator",
14160            "event-key"
14161        ]
14162    },
14163    "aui-tree-paginator": {
14164        "requires": [
14165            "yui-base"
14166        ]
14167    },
14168    "aui-tree-view": {
14169        "requires": [
14170            "dd-delegate",
14171            "dd-proxy",
14172            "widget",
14173            "aui-tree-node",
14174            "aui-tree-paginator",
14175            "aui-tree-io"
14176        ],
14177        "skinnable": true
14178    },
14179    "aui-undo-redo": {
14180        "requires": [
14181            "aui-base",
14182            "base",
14183            "base-build",
14184            "event-key",
14185            "promise"
14186        ]
14187    },
14188    "aui-url": {
14189        "requires": [
14190            "oop",
14191            "querystring-parse",
14192            "querystring-stringify"
14193        ]
14194    },
14195    "aui-video": {
14196        "requires": [
14197            "event-resize",
14198            "node-event-html5",
14199            "querystring-stringify-simple",
14200            "aui-aria",
14201            "aui-node",
14202            "aui-component",
14203            "aui-debounce"
14204        ],
14205        "skinnable": true
14206    },
14207    "aui-viewport": {
14208        "requires": [
14209            "aui-node",
14210            "aui-component"
14211        ]
14212    },
14213    "aui-widget": {
14214        "use": [
14215            "aui-widget-cssclass",
14216            "aui-widget-toolbars"
14217        ]
14218    },
14219    "aui-widget-core": {
14220        "use": [
14221            "aui-widget-cssclass"
14222        ]
14223    },
14224    "aui-widget-cssclass": {
14225        "requires": [
14226            "widget-base"
14227        ]
14228    },
14229    "aui-widget-position-align-suggestion": {
14230        "requires": [
14231            "widget-position-align",
14232            "widget-stdmod"
14233        ]
14234    },
14235    "aui-widget-responsive": {
14236        "requires": [
14237            "event-resize",
14238            "widget-base"
14239        ]
14240    },
14241    "aui-widget-shortcut": {
14242        "requires": [
14243            "base"
14244        ]
14245    },
14246    "aui-widget-swipe": {
14247        "requires": [
14248            "classnamemanager",
14249            "scrollview-base",
14250            "scrollview-paginator",
14251            "timers"
14252        ]
14253    },
14254    "aui-widget-toggle": {},
14255    "aui-widget-toolbars": {
14256        "requires": [
14257            "widget-stdmod",
14258            "aui-toolbar"
14259        ]
14260    },
14261    "aui-widget-transition": {
14262        "requires": [
14263            "transition"
14264        ]
14265    },
14266    "aui-widget-trigger": {
14267        "requires": [
14268            "node"
14269        ]
14270    }
14271});
14272YUI.Env[Y.version].md5 = 'd7c627eb00edd6b6f054d8f6e7147480';
14273/*
14274 * Alloy JavaScript Library
14275 * http://alloy.liferay.com/
14276 *
14277 * Copyright (c) 2010 Liferay Inc.
14278 * http://alloy.liferay.com/LICENSE.txt
14279 *
14280 * Nate Cavanaugh ([email protected])
14281 * Eduardo Lundgren ([email protected])
14282 *
14283 * Attribution/Third-party licenses
14284 * http://alloy.liferay.com/ATTRIBUTION.txt
14285 */
14286
14287// Simple version of
14288// http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
14289
14290A.UA.edge = (function() {
14291    var edgeVersion = A.UA.userAgent.match(/Edge\/(.[0-9.]+)/);
14292
14293    if (edgeVersion) {
14294        return edgeVersion[1];
14295    }
14296
14297    return 0;
14298})();
14299
14300A.supportsDOMEvent = function(domNode, eventName) {
14301    eventName = 'on' + eventName;
14302
14303    if (!(eventName in domNode)) {
14304        if (!domNode.setAttribute) {
14305            domNode = A.config.doc.createElement('div');
14306        }
14307
14308        if (domNode.setAttribute) {
14309            domNode.setAttribute(eventName, '');
14310            return (typeof domNode[eventName] === 'function');
14311        }
14312    }
14313
14314    domNode = null;
14315
14316    return true;
14317};
14318(function() {
14319    var slice = Array.prototype.slice;
14320
14321    YUI.prototype.ready = function() {
14322        var instance = this,
14323            xargs = arguments,
14324            index = xargs.length - 1,
14325            modules = slice.call(arguments, 0, index);
14326
14327        modules.unshift('event-base');
14328        modules.push(function(instance) {
14329            var args = arguments;
14330
14331            instance.on('domready', function() {
14332                xargs[index].apply(this, args);
14333            });
14334        });
14335        instance.use.apply(instance, modules);
14336    };
14337}());
14338
14339
14340}, '3.1.0-deprecated.95');
14341YUI.add('aui', function (A, NAME) {}, '3.1.0-deprecated.95');
14342YUI.Env.core.push.apply(YUI.Env.core, ["aui-base-core"]);
14343!function(){var e=Liferay.AUI,a=e.getCombine(),r=YUI.Env.core,i=document.createElement("input"),t=e.getEditorCKEditorPath(),o="/o/frontend-js-aui-web",s="number"==typeof i.selectionStart&&"number"==typeof i.selectionEnd;
14343window.YUI_config={base:Liferay.ThemeDisplay.getCDNBaseURL()+Liferay.ThemeDisplay.getPathContext()+o+"/aui/",combine:a,comboBase:e.getComboPath(),filter:"min",groups:{editor:{base:t,combine:a,modules:{"inline-editor-ckeditor":{path:"ckeditor/main.js"}},root:t},liferay:{base:Liferay.ThemeDisplay.getCDNBaseURL()+Liferay.ThemeDisplay.getPathContext()+o+"/liferay/",combine:a,filter:Liferay.AUI.getFilterConfig(),modules:{"liferay-address":{path:"address.js",requires:[]},"liferay-alert":{path:"alert.js",requires:["aui-alert","aui-component","event-mouseenter","liferay-portlet-base","timers"]},"liferay-asset-addon-entry-selector":{path:"asset_addon_entry_selector.js",requires:["aui-component","liferay-portlet-base","liferay-util-window"]},"liferay-asset-categories-selector":{path:"asset_categories_selector.js",requires:["aui-tree","liferay-asset-tags-selector"]},"liferay-asset-tags-selector":{path:"asset_tags_selector.js",requires:["array-extras","async-queue","aui-autocomplete-deprecated","aui-io-plugin-deprecated","aui-live-search-deprecated","aui-modal","aui-template-deprecated","aui-textboxlist-deprecated","datasource-cache","liferay-service-datasource"]},"liferay-auto-fields":{path:"auto_fields.js",requires:["aui-base","aui-data-set-deprecated","aui-parse-content","base","liferay-form","liferay-menu","liferay-portlet-base","liferay-undo-manager","sortable"]},"liferay-autocomplete-input":{path:"autocomplete_input.js",requires:["aui-base","autocomplete","autocomplete-filters","autocomplete-highlighters"]},"liferay-autocomplete-input-caretindex":{condition:{name:"liferay-autocomplete-input-caretindex",test:()=>s,trigger:"liferay-autocomplete-textarea"},path:"autocomplete_input_caretindex.js",requires:["liferay-autocomplete-textarea"]},"liferay-autocomplete-input-caretindex-sel":{condition:{name:"liferay-autocomplete-input-caretindex-sel",test:()=>!s,trigger:"liferay-autocomplete-textarea"},path:"autocomplete_input_caretindex_sel.js",requires:["liferay-autocomplete-textarea"]},"liferay-autocomplete-input-caretoffset":{condition:{name:"liferay-autocomplete-input-caretoffset",test:e=>!(e.UA.ie&&e.UA.ie<9),trigger:"liferay-autocomplete-textarea"},path:"autocomplete_input_caretoffset.js",requires:["liferay-autocomplete-textarea"]},"liferay-autocomplete-input-caretoffset-sel":{condition:{name:"liferay-autocomplete-input-caretoffset-sel",test:e=>e.UA.ie&&e.UA.ie<9,trigger:"liferay-autocomplete-textarea"},path:"autocomplete_input_caretoffset_sel.js",requires:["liferay-autocomplete-textarea"]},"liferay-autocomplete-textarea":{path:"autocomplete_textarea.js",requires:["liferay-autocomplete-input"]},"liferay-browser-selectors":{path:"browser_selectors.js",requires:["yui-base"]},"liferay-cover-cropper":{path:"cover_cropper.js",requires:["aui-base","aui-component","dd-constrain","dd-drag","plugin"]},"liferay-crop-region":{path:"crop_region.js",requires:["aui-base"]},"liferay-dd-proxy":{path:"dd_proxy.js",requires:["dd-proxy"]},"liferay-dynamic-select":{path:"dynamic_select.js",requires:["aui-base"]},"liferay-form":{path:"form.js",requires:["aui-base","aui-form-validator"]},"liferay-form-placeholders":{condition:{name:"liferay-form-placeholders",test:()=>!("placeholder"in i),trigger:"liferay-form"},path:"form_placeholders.js",requires:["liferay-form","plugin"]},"liferay-fullscreen-source-editor":{path:"fullscreen_source_editor.js",requires:["liferay-source-editor"]},"liferay-history":{path:"history.js",requires:["history-hash","querystring-parse-simple"]},"liferay-history-html5":{condition:{name:"liferay-history-html5",test:function(e){var a=e.config.win,r=a.history;return r&&r.pushState&&r.replaceState&&("onpopstate"in a||e.UA.gecko>=2)},trigger:"liferay-history"},path:"history_html5.js",requires:["history-html5","liferay-history","querystring-stringify-simple"]},"liferay-history-manager":{path:"history_manager.js",requires:["liferay-history"]},"liferay-hudcrumbs":{path:"hudcrumbs.js",requires:["aui-base","aui-debounce","event-resize"]},"liferay-icon":{path:"icon.js",requires:["aui-base"]},"liferay-inline-editor-base":{path:"inline_editor_base.js",requires:["aui-base","aui-overlay-base-deprecated"]},"liferay-input-localized":{path:"input_localized.js",requires:["aui-base","aui-component","aui-event-input","aui-palette","aui-set"]},"liferay-input-move-boxes":{path:"input_move_boxes.js",plugins:{"liferay-input-move-boxes-touch":{condition:{name:"liferay-input-move-boxes-touch",test:e=>e.UA.touchEnabled&&!!e.UA.mobile,trigger:"liferay-input-move-boxes"}}},requires:["aui-base","aui-toolbar"]},"liferay-input-move-boxes-touch":{path:"input_move_boxes_touch.js",requires:["aui-base","aui-template-deprecated","liferay-input-move-boxes","sortable"]},"liferay-item-selector-dialog":{path:"item_selector_dialog.js",requires:["aui-component"]},"liferay-item-selector-repository-entry-browser":{path:"item_selector_repository_entry_browser.js",requires:["liferay-item-selector-uploader","liferay-item-viewer","liferay-notice","liferay-portlet-base"]},"liferay-item-selector-uploader":{path:"item_selector_uploader.js",requires:["aui-base","aui-progressbar","liferay-portlet-base","uploader"]},"liferay-item-selector-url":{path:"item_selector_url.js",requires:["aui-event-input","liferay-item-viewer","liferay-portlet-base"]},"liferay-item-viewer":{path:"item_viewer.js",requires:["aui-component","aui-image-viewer","liferay-portlet-url"]},"liferay-language":{path:"language.js"},"liferay-layout":{path:"layout.js"},"liferay-layout-column":{path:"layout_column.js",requires:["aui-sortable-layout","dd"]},"liferay-list-view":{path:"list_view.js",requires:["aui-base","transition"]},"liferay-logo-editor":{path:"logo_editor.js",requires:["aui-image-cropper","liferay-portlet-base"]},"liferay-logo-selector":{path:"logo_selector.js",requires:["aui-base"]},"liferay-menu":{path:"menu.js",requires:["aui-debounce","aui-node"]},"liferay-menu-filter":{path:"menu_filter.js",requires:["autocomplete-base","autocomplete-filters","autocomplete-highlighters"]},"liferay-menu-toggle":{path:"menu_toggle.js",requires:["aui-node","event-outside","event-tap","liferay-menu-filter"]},"liferay-message":{path:"message.js",requires:["aui-base"]},"liferay-navigation":{path:"navigation.js",requires:["aui-component","event-mouseenter"]},"liferay-navigation-interaction":{path:"navigation_interaction.js",plugins:{"liferay-navigation-interaction-touch":{condition:{name:"liferay-navigation-interaction-touch",test:e=>e.UA.touchEnabled,trigger:"liferay-navigation-interaction"}}},requires:["aui-base","aui-component","event-mouseenter","node-focusmanager","plugin"]},"liferay-navigation-interaction-touch":{path:"navigation_interaction_touch.js",requires:["event-tap","event-touch","liferay-navigation-interaction"]}
14343,"liferay-node":{path:"node.js",requires:["dom-base"]},"liferay-notice":{path:"notice.js",requires:["aui-base","transition"]},"liferay-notification":{path:"notification.js",requires:["liferay-alert"]},"liferay-pagination":{path:"pagination.js",requires:["aui-pagination"]},"liferay-panel-search":{path:"panel_search.js",requires:["aui-base","liferay-search-filter"]},"liferay-poller":{path:"poller.js",requires:["aui-base","json"]},"liferay-portlet-base":{path:"portlet_base.js",requires:["aui-base"]},"liferay-portlet-url":{path:"portlet_url.js",requires:["aui-base"]},"liferay-preview":{path:"preview.js",requires:["aui-base","aui-overlay-mask-deprecated","aui-toolbar","liferay-widget-zindex"]},"liferay-progress":{path:"progress.js",requires:["aui-progressbar"]},"liferay-ratings":{path:"ratings.js",requires:["aui-rating"]},"liferay-resize-rtl":{condition:{test:()=>"rtl"===document.documentElement.dir,trigger:"resize-base"},path:"resize_rtl.js"},"liferay-restore-entry":{path:"restore_entry.js",requires:["aui-io-plugin-deprecated","aui-modal","liferay-portlet-base"]},"liferay-search-container":{path:"search_container.js",requires:["aui-base","aui-datatable-core"]},"liferay-search-container-move":{path:"search_container_move.js",requires:["aui-component","dd-constrain","dd-delegate","dd-drag","dd-drop","dd-proxy","plugin"]},"liferay-search-container-select":{path:"search_container_select.js",requires:["aui-component","aui-url","plugin"]},"liferay-search-filter":{path:"search_filter.js",requires:["aui-base","autocomplete-base","autocomplete-filters"]},"liferay-service-datasource":{path:"service_datasource.js",requires:["aui-base","datasource-local"]},"liferay-session":{path:"session.js",requires:["aui-base","aui-component","aui-timer","cookie","plugin"]},"liferay-sign-in-modal":{path:"sign_in_modal.js",requires:["aui-base","aui-component","aui-parse-content","liferay-form","liferay-portlet-url","liferay-util-window","plugin"]},"liferay-social-bookmarks":{path:"social_bookmarks.js",requires:["aui-component","aui-node"]},"liferay-sortable":{path:"sortable.js",requires:["liferay-dd-proxy","sortable"]},"liferay-source-editor":{path:"source_editor.js",requires:["aui-ace-editor"]},"liferay-storage-formatter":{path:"storage_formatter.js",requires:["aui-base","datatype-number-format"]},"liferay-store":{path:"store.js"},"liferay-toggler-interaction":{path:"toggler_interaction.js",requires:["liferay-toggler-key-filter"]},"liferay-toggler-key-filter":{path:"toggler_key_filter.js",requires:["aui-event-base"]},"liferay-token-list":{path:"token_list.js",requires:["aui-base","aui-template-deprecated"]},"liferay-translation-manager":{path:"translation_manager.js",requires:["aui-base"]},"liferay-tree-view-icons":{condition:{name:"liferay-tree-view-icons",trigger:"aui-tree-view"},path:"tree_view_icons.js",requires:["aui-tree-view"]},"liferay-undo-manager":{path:"undo_manager.js",requires:["aui-data-set-deprecated","base"]},"liferay-upload":{path:"upload.js",requires:["aui-template-deprecated","collection","liferay-portlet-base","uploader"]},"liferay-util-window":{path:"util_window.js",requires:["aui-dialog-iframe-deprecated","aui-modal","aui-url","event-resize","liferay-widget-zindex"]},"liferay-widget-size-animation-plugin":{path:"widget_size_animation_plugin.js",requires:["anim-easing","plugin","widget"]},"liferay-widget-zindex":{path:"widget_zindex.js",requires:["aui-modal","plugin"]},"liferay-xml-formatter":{path:"xml_formatter.js",requires:["aui-base"]}},root:o+"/liferay/"}},insertBefore:"liferayAUICSS",lang:themeDisplay.getBCP47LanguageId(),root:o+"/aui/",useBrowserConsole:!1},r.push("liferay-browser-selectors")}();
14344//# sourceMappingURL=modules.js.map
14345!function(){var n=YUI();n.html5shiv&&n.html5shiv();var t=n.use;n.use=function(){var n=Array.prototype.slice.call(arguments,0),r=Liferay.currentURL,i=n[n.length-1];return"function"==typeof i&&(n[n.length-1]=function(){Liferay.currentURL===r&&i.apply(this,arguments)}),t.apply(this,n)},window.AUI=function(){return n},n.mix(AUI,YUI),AUI.$=window.jQuery,AUI._=window._}();
14346//# sourceMappingURL=aui_sandbox.js.map
14347YUI.add('attribute-base', function (Y, NAME) {
14348
14349    /**
14350     * The attribute module provides an augmentable Attribute implementation, which
14351     * adds configurable attributes and attribute change events to the class being
14352     * augmented. It also provides a State class, which is used internally by Attribute,
14353     * but can also be used independently to provide a name/property/value data structure to
14354     * store state.
14355     *
14356     * @module attribute
14357     */
14358
14359    /**
14360     * The attribute-base submodule provides core attribute handling support, with everything
14361     * aside from complex attribute handling in the provider's constructor.
14362     *
14363     * @module attribute
14364     * @submodule attribute-base
14365     */
14366
14367    /**
14368     * <p>
14369     * Attribute provides configurable attribute support along with attribute change events. It is designed to be
14370     * augmented on to a host class, and provides the host with the ability to configure attributes to store and retrieve state,
14371     * along with attribute change events.
14372     * </p>
14373     * <p>For example, attributes added to the host can be configured:</p>
14374     * <ul>
14375     *     <li>As read only.</li>
14376     *     <li>As write once.</li>
14377     *     <li>With a setter function, which can be used to manipulate
14378     *     values passed to Attribute's <a href="#method_set">set</a> method, before they are stored.</li>
14379     *     <li>With a getter function, which can be used to manipulate stored values,
14380     *     before they are returned by Attribute's <a href="#method_get">get</a> method.</li>
14381     *     <li>With a validator function, to validate values before they are stored.</li>
14382     * </ul>
14383     *
14384     * <p>See the <a href="#method_addAttr">addAttr</a> method, for the complete set of configuration
14385     * options available for attributes.</p>
14386     *
14387     * <p><strong>NOTE:</strong> Most implementations will be better off extending the <a href="Base.html">Base</a> class,
14388     * instead of augmenting Attribute directly. Base augments Attribute and will handle the initial configuration
14389     * of attributes for derived classes, accounting for values passed into the constructor.</p>
14390     *
14391     * @class Attribute
14392     * @param attrs {Object} The attributes to add during construction (passed through to <a href="#method_addAttrs">addAttrs</a>).
14393     *        These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor.
14394     * @param values {Object} The initial attribute values to apply (passed through to <a href="#method_addAttrs">addAttrs</a>).
14395     *        These are not merged/cloned. The caller is responsible for isolating user provided values if required.
14396     * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href="#method_addAttrs">addAttrs</a>).
14397     * @uses AttributeCore
14398     * @uses AttributeObservable
14399     * @uses EventTarget
14400     * @uses AttributeExtras
14401     */
14402    function Attribute() {
14403        Y.AttributeCore.apply(this, arguments);
14404        Y.AttributeObservable.apply(this, arguments);
14405        Y.AttributeExtras.apply(this, arguments);
14406    }
14407
14408    Y.mix(Attribute, Y.AttributeCore, false, null, 1);
14409    Y.mix(Attribute, Y.AttributeExtras, false, null, 1);
14410
14411    // Needs to be `true`, to overwrite methods from AttributeCore
14412    Y.mix(Attribute, Y.AttributeObservable, true, null, 1);
14413
14414    /**
14415     * <p>The value to return from an attribute setter in order to prevent the set from going through.</p>
14416     *
14417     * <p>You can return this value from your setter if you wish to combine validator and setter
14418     * functionality into a single setter function, which either returns the massaged value to be stored or
14419     * AttributeCore.INVALID_VALUE to prevent invalid values from being stored.</p>
14420     *
14421     * @property INVALID_VALUE
14422     * @type Object
14423     * @static
14424     * @final
14425     */
14426    Attribute.INVALID_VALUE = Y.AttributeCore.INVALID_VALUE;
14427
14428    /**
14429     * The list of properties which can be configured for
14430     * each attribute (e.g. setter, getter, writeOnce etc.).
14431     *
14432     * This property is used internally as a whitelist for faster
14433     * Y.mix operations.
14434     *
14435     * @property _ATTR_CFG
14436     * @type Array
14437     * @static
14438     * @protected
14439     */
14440    Attribute._ATTR_CFG = Y.AttributeCore._ATTR_CFG.concat(Y.AttributeObservable._ATTR_CFG);
14441
14442    /**
14443     * Utility method to protect an attribute configuration hash, by merging the
14444     * entire object and the individual attr config objects.
14445     *
14446     * @method protectAttrs
14447     * @static
14448     * @param {Object} attrs A hash of attribute to configuration object pairs.
14449     * @return {Object} A protected version of the `attrs` argument.
14450     */
14451    Attribute.protectAttrs = Y.AttributeCore.protectAttrs;
14452
14453    Y.Attribute = Attribute;
14454
14455
14456}, 'patched-v3.18.3', {"requires": ["attribute-core", "attribute-observable", "attribute-extras"]});
14457
14458YUI.add('attribute-complex', function (Y, NAME) {
14459
14460    /**
14461     * Adds support for attribute providers to handle complex attributes in the constructor
14462     *
14463     * @module attribute
14464     * @submodule attribute-complex
14465     * @for Attribute
14466     * @deprecated AttributeComplex's overrides are now part of AttributeCore.
14467     */
14468
14469    var Attribute = Y.Attribute;
14470
14471    Attribute.Complex = function() {};
14472    Attribute.Complex.prototype = {
14473
14474        /**
14475         * Utility method to split out simple attribute name/value pairs ("x")
14476         * from complex attribute name/value pairs ("x.y.z"), so that complex
14477         * attributes can be keyed by the top level attribute name.
14478         *
14479         * @method _normAttrVals
14480         * @param {Object} valueHash An object with attribute name/value pairs
14481         *
14482         * @return {Object} An object literal with 2 properties - "simple" and "complex",
14483         * containing simple and complex attribute values respectively keyed
14484         * by the top level attribute name, or null, if valueHash is falsey.
14485         *
14486         * @private
14487         */
14488        _normAttrVals : Attribute.prototype._normAttrVals,
14489
14490        /**
14491         * Returns the initial value of the given attribute from
14492         * either the default configuration provided, or the
14493         * over-ridden value if it exists in the set of initValues
14494         * provided and the attribute is not read-only.
14495         *
14496         * @param {String} attr The name of the attribute
14497         * @param {Object} cfg The attribute configuration object
14498         * @param {Object}
14498 initValues The object with simple and complex attribute name/value pairs returned from _normAttrVals
14499         *
14500         * @return {Any} The initial value of the attribute.
14501         *
14502         * @method _getAttrInitVal
14503         * @private
14504         */
14505        _getAttrInitVal : Attribute.prototype._getAttrInitVal
14506
14507    };
14508
14509    // Consistency with the rest of the Attribute addons for now.
14510    Y.AttributeComplex = Attribute.Complex;
14511
14512
14513}, 'patched-v3.18.3', {"requires": ["attribute-base"]});
14514
14515YUI.add('attribute-core', function (Y, NAME) {
14516
14517    /**
14518     * The State class maintains state for a collection of named items, with
14519     * a varying number of properties defined.
14520     *
14521     * It avoids the need to create a separate class for the item, and separate instances
14522     * of these classes for each item, by storing the state in a 2 level hash table,
14523     * improving performance when the number of items is likely to be large.
14524     *
14525     * @constructor
14526     * @class State
14527     */
14528    Y.State = function() {
14529        /**
14530         * Hash of attributes
14531         * @property data
14532         */
14533        this.data = {};
14534    };
14535
14536    Y.State.prototype = {
14537
14538        /**
14539         * Adds a property to an item.
14540         *
14541         * @method add
14542         * @param name {String} The name of the item.
14543         * @param key {String} The name of the property.
14544         * @param val {Any} The value of the property.
14545         */
14546        add: function(name, key, val) {
14547            var item = this.data[name];
14548
14549            if (!item) {
14550                item = this.data[name] = {};
14551            }
14552
14553            item[key] = val;
14554        },
14555
14556        /**
14557         * Adds multiple properties to an item.
14558         *
14559         * @method addAll
14560         * @param name {String} The name of the item.
14561         * @param obj {Object} A hash of property/value pairs.
14562         */
14563        addAll: function(name, obj) {
14564            var item = this.data[name],
14565                key;
14566
14567            if (!item) {
14568                item = this.data[name] = {};
14569            }
14570
14571            for (key in obj) {
14572                if (obj.hasOwnProperty(key)) {
14573                    item[key] = obj[key];
14574                }
14575            }
14576        },
14577
14578        /**
14579         * Removes a property from an item.
14580         *
14581         * @method remove
14582         * @param name {String} The name of the item.
14583         * @param key {String} The property to remove.
14584         */
14585        remove: function(name, key) {
14586            var item = this.data[name];
14587
14588            if (item) {
14589                delete item[key];
14590            }
14591        },
14592
14593        /**
14594         * Removes multiple properties from an item, or removes the item completely.
14595         *
14596         * @method removeAll
14597         * @param name {String} The name of the item.
14598         * @param obj {Object|Array} Collection of properties to delete. If not provided, the entire item is removed.
14599         */
14600        removeAll: function(name, obj) {
14601            var data;
14602
14603            if (!obj) {
14604                data = this.data;
14605
14606                if (name in data) {
14607                    delete data[name];
14608                }
14609            } else {
14610                Y.each(obj, function(value, key) {
14611                    this.remove(name, typeof key === 'string' ? key : value);
14612                }, this);
14613            }
14614        },
14615
14616        /**
14617         * For a given item, returns the value of the property requested, or undefined if not found.
14618         *
14619         * @method get
14620         * @param name {String} The name of the item
14621         * @param key {String} Optional. The property value to retrieve.
14622         * @return {Any} The value of the supplied property.
14623         */
14624        get: function(name, key) {
14625            var item = this.data[name];
14626
14627            if (item) {
14628                return item[key];
14629            }
14630        },
14631
14632        /**
14633         * For the given item, returns an object with all of the
14634         * item's property/value pairs. By default the object returned
14635         * is a shallow copy of the stored data, but passing in true
14636         * as the second parameter will return a reference to the stored
14637         * data.
14638         *
14639         * @method getAll
14640         * @param name {String} The name of the item
14641         * @param reference {boolean} true, if you want a reference to the stored
14642         * object
14643         * @return {Object} An object with property/value pairs for the item.
14644         */
14645        getAll : function(name, reference) {
14646            var item = this.data[name],
14647                key, obj;
14648
14649            if (reference) {
14650                obj = item;
14651            } else if (item) {
14652                obj = {};
14653
14654                for (key in item) {
14655                    if (item.hasOwnProperty(key)) {
14656                        obj[key] = item[key];
14657                    }
14658                }
14659            }
14660
14661            return obj;
14662        }
14663    };
14664    /*For log lines*/
14665    /*jshint maxlen:200*/
14666
14667    /**
14668     * The attribute module provides an augmentable Attribute implementation, which
14669     * adds configurable attributes and attribute change events to the class being
14670     * augmented. It also provides a State class, which is used internally by Attribute,
14671     * but can also be used independently to provide a name/property/value data structure to
14672     * store state.
14673     *
14674     * @module attribute
14675     */
14676
14677    /**
14678     * The attribute-core submodule provides the lightest level of attribute handling support
14679     * without Attribute change events, or lesser used methods such as reset(), modifyAttrs(),
14680     * and removeAttr().
14681     *
14682     * @module attribute
14683     * @submodule attribute-core
14684     */
14685    var O = Y.Object,
14686        Lang = Y.Lang,
14687
14688        DOT = ".",
14689
14690        // Externally configurable props
14691        GETTER = "getter",
14692        SETTER = "setter",
14693        READ_ONLY = "readOnly",
14694        WRITE_ONCE = "writeOnce",
14695        INIT_ONLY = "initOnly",
14696        VALIDATOR = "validator",
14697        VALUE = "value",
14698        VALUE_FN = "valueFn",
14699        LAZY_ADD = "lazyAdd",
14700
14701        // Used for internal state management
14702        ADDED = "added",
14703        BYPASS_PROXY = "_bypassProxy",
14704        INIT_VALUE = "initValue",
14705        LAZY = "lazy",
14706
14707        INVALID_VALUE;
14708
14709    /**
14710     * <p>
14711     * AttributeCore provides the lightest level of configurable attribute support. It is designed to be
14712     * augmented on to a host class, and provides the host with the ability to configure
14713     * attributes to store and retrieve state, <strong>but without support for attribute change events</strong>.
14714     * </p>
14715     * <p>For example, attributes added to the host can be configured:</p>
14716     * <ul>
14717     *     <li>As read only.</li>
14718     *     <li>As write once.</li>
14719     *     <li>With a setter function, which can be used to manipulate
14720     *     values passed to Attribute's <a href="#method_set">set</a> method, before they are stored.</li>
14721     *     <li>With a getter function, which can be used to manipulate stored values,
14722     *     before they are returned by Attribute's <a href="#method_get">get</a> method.</li>
14723     *     <li>With a validator function, to validate values before they are stored.</li>
14724     * </ul>
14725     *
14726     * <p>See the <a href="#method_addAttr">addAttr</a> method, for the complete set of configuration
14727     * options available for attributes.</p>
14728     *
14729     * <p>Object/Classes based on AttributeCore can augment <a href="AttributeObservable.html">AttributeObservable</a>
14730     * (with true for overwrite) and <a href="AttributeExtras.html">AttributeExtras</a> to add attribute event and
14731     * additional, less commonly used attribute methods, such as `modifyAttr`, `removeAttr` and `reset`.</p>
14732     *
14733     * @class AttributeCore
14734     * @param attrs {Object} The attributes to add during construction (passed through to <a href="#method_addAttrs">addAttrs</a>).
14735     *        These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor.
14736     * @param values {Object} The initial attribute values to apply (passed through to <a href="#method_addAttrs">addAttrs</a>).
14737     *        These are not merged/cloned. The caller is responsible for isolating user provided values if required.
14738     * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href="#method_addAttrs">addAttrs</a>).
14739     */
14740    function AttributeCore(attrs, values, lazy) {
14741        // HACK: Fix #2531929
14742        // Complete hack, to make sure the first clone of a node value in IE doesn't doesn't hurt state - maintains 3.4.1 behavior.
14743        // Too late in the release cycle to do anything about the core problem.
14744        // The root issue is that cloning a Y.Node instance results in an object which barfs in IE, when you access it's properties (since 3.3.0).
14745        this._yuievt = null;
14746
14747        this._initAttrHost(attrs, values, lazy);
14748    }
14749
14750    /**
14751     * <p>The value to return from an attribute setter in order to prevent the set from going through.</p>
14752     *
14753     * <p>You can return this value from your setter if you wish to combine validator and setter
14754     * functionality into a single setter function, which either returns the massaged value to be stored or
14755     * AttributeCore.INVALID_VALUE to prevent invalid values from being stored.</p>
14756     *
14757     * @property INVALID_VALUE
14758     * @type Object
14759     * @static
14760     * @final
14761     */
14762    AttributeCore.INVALID_VALUE = {};
14763    INVALID_VALUE = AttributeCore.INVALID_VALUE;
14764
14765    /**
14766     * The list of properties which can be configured for
14767     * each attribute (e.g. setter, getter, writeOnce etc.).
14768     *
14769     * This property is used internally as a whitelist for faster
14770     * Y.mix operations.
14771     *
14772     * @property _ATTR_CFG
14773     * @type Array
14774     * @static
14775     * @protected
14776     */
14777    AttributeCore._ATTR_CFG = [SETTER, GETTER, VALIDATOR, VALUE, VALUE_FN, WRITE_ONCE, READ_ONLY, LAZY_ADD, BYPASS_PROXY];
14778
14779    /**
14780     * Utility method to protect an attribute configuration hash, by merging the
14781     * entire object and the individual attr config objects.
14782     *
14783     * @method protectAttrs
14784     * @static
14785     * @param {Object} attrs A hash of attribute to configuration object pairs.
14786     * @return {Object} A protected version of the `attrs` argument.
14787     */
14788    AttributeCore.protectAttrs = function (attrs) {
14789        if (attrs) {
14790            attrs = Y.merge(attrs);
14791            for (var attr in attrs) {
14792                if (attrs.hasOwnProperty(attr)) {
14793                    attrs[attr] = Y.merge(attrs[attr]);
14794                }
14795            }
14796        }
14797
14798        return attrs;
14799    };
14800
14801    AttributeCore.prototype = {
14802
14803        /**
14804         * Constructor logic for attributes. Initializes the host state, and sets up the inital attributes passed to the
14805         * constructor.
14806         *
14807         * @method _initAttrHost
14808         * @param attrs {Object} The attributes to add during construction (passed through to <a href="#method_addAttrs">addAttrs</a>).
14809         *        These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor.
14810         * @param values {Object} The initial attribute values to apply (passed through to <a href="#method_addAttrs">addAttrs</a>).
14811         *        These are not merged/cloned. The caller is responsible for isolating user provided values if required.
14812         * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href="#method_addAttrs">addAttrs</a>).
14813         * @private
14814         */
14815        _initAttrHost : function(attrs, values, lazy) {
14816            this._state = new Y.State();
14817            this._initAttrs(attrs, values, lazy);
14818        },
14819
14820        /**
14821         * <p>
14822         * Adds an attribute with the provided configuration to the host object.
14823         * </p>
14824         * <p>
14825         * The config argument object supports the following properties:
14826         * </p>
14827         *
14828         * <dl>
14829         *    <dt>value &#60;Any&#62;</dt>
14830         *    <dd>The initial value to set on the attribute</dd>
14831         *
14832         *    <dt>valueFn &#60;Function | String&#62;</dt>
14833         *    <dd>
14834         *    <p>A function, which will return the initial value to set on the attribute. This is useful
14835         *    for cases where the attribute configuration is defined statically, but needs to
14836         *    reference the host instance ("this") to obtain an initial value. If both the value and valueFn properties are defined,
14837         *    the value returned by the valueFn has precedence over the value property, unless it returns undefined, in which
14838         *    case the value property is used.</p>
14839         *
14840         *    <p>valueFn can also be set to a string, representing the name of the instance method to be used to retrieve the value.</p>
14841         *    </dd>
14842         *
14843         *    <dt>readOnly &#60;boolean&#62;</dt>
14844         *    <dd>Whether or not the attribute is read only. Attributes having readOnly set to true
14845         *        cannot be modified by invoking the set method.</dd>
14846         *
14847         *    <dt>writeOnce &#60;boolean&#62; or &#60;string&#62;</dt>
14848         *    <dd>
14849         *        Whether or not the attribute is "write once". Attributes having writeOnce set to true,
14850         *        can only have their values set once, be it through the default configuration,
14851         *        constructor configuration arguments, or by invoking set.
14852         *        <p>The writeOnce attribute can also be set to the string "initOnly",
14853         *         in which case the attribute can only be set during initialization
14854         *        (when used with Base, this means it can only be set during construction)</p>
14855         *    </dd>
14856         *
14857         *    <dt>setter &#60;Function | String&#62;</dt>
14858         *    <dd>
14859         *    <p>The setter function used to massage or normalize the value passed to the set method for the attribute.
14860         *    The value returned by the setter will be the final stored value. Returning
14861         *    <a href="#property_Attribute.INVALID_VALUE">Attribute.INVALID_VALUE</a>, from the setter will prevent
14862         *    the value from being stored.
14863         *    </p>
14864         *
14865         *    <p>setter can also be set to a string, representing the name of the instance method to be used as the setter function.</p>
14866         *    </dd>
14867         *
14868         *    <dt>getter &#60;Function | String&#62;</dt>
14869         *    <dd>
14870         *    <p>
14871         *    The getter function used to massage or normalize the value returned by the get method for the attribute.
14872         *    The value returned by the getter function is the value which will be returned to the user when they
14873         *    invoke get.
14874         *    </p>
14875         *
14876         *    <p>getter can also be set to a string, representing the name of the instance method to be used as the getter function.</p>
14877         *    </dd>
14878         *
14879         *    <dt>validator &#60;Function | String&#62;</dt>
14880         *    <dd>
14881         *    <p>
14882         *    The validator function invoked prior to setting the stored value. Returning
14883         *    false from the validator function will prevent the value from being stored.
14884         *    </p>
14885         *
14886         *    <p>validator can also be set to a string, representing the name of the instance method to be used as the validator function.</p>
14887         *    </dd>
14888         *
14889         *    <dt>lazyAdd &#60;boolean&#62;</dt>
14890         *    <dd>Whether or not to delay initialization of the attribute until the first call to get/set it.
14891         *    This flag can be used to over-ride lazy initialization on a per attribute basis, when adding multiple attributes through
14892         *    the <a href="#method_addAttrs">addAttrs</a> method.</dd>
14893         *
14894         * </dl>
14895         *
14896         * <p>The setter, getter and validator are invoked with the value and name passed in as the first and second arguments, and with
14897         * the context ("this") set to the host object.</p>
14898         *
14899         * <p>Configuration properties outside of the list mentioned above are considered private properties used internally by attribute,
14900         * and are not intended for public use.</p>
14901         *
14902         * @method addAttr
14903         *
14904         * @param {String} name The name of the attribute.
14905         * @param {Object} config An object with attribute configuration property/value pairs, specifying the configuration for the attribute.
14906         *
14907         * <p>
14908         * <strong>NOTE:</strong> The configuration object is modified when adding an attribute, so if you need
14909         * to protect the original values, you will need to merge the object.
14910         * </p>
14911         *
14912         * @param {boolean} lazy (optional) Whether or not to add this attribute lazily (on the first call to get/set).
14913         *
14914         * @return {Object} A reference to the host object.
14915         *
14916         * @chainable
14917         */
14918        addAttr : function(name, config, lazy) {
14919
14920
14921            var host = this, // help compression
14922                state = host._state,
14923                data = state.data,
14924                value,
14925                added,
14926                hasValue;
14927
14928            config = config || {};
14929
14930            if (LAZY_ADD in config) {
14931                lazy = config[LAZY_ADD];
14932            }
14933
14934            added = state.get(name, ADDED);
14935
14936            if (lazy && !added) {
14937                state.data[name] = {
14938                    lazy : config,
14939                    added : true
14940                };
14941            } else {
14942
14943
14944                if (!added || config.isLazyAdd) {
14945
14946                    hasValue = (VALUE in config);
14947
14948
14949                    if (hasValue) {
14950
14951                        // We'll go through set, don't want to set value in config directly
14952
14953                        // PERF TODO: VALIDATE: See if setting this to undefined is sufficient. We use to delete before.
14954                        // In certain code paths/use cases, undefined may not be the same as not present.
14955                        // If not, we can set it to some known fixed value (like INVALID_VALUE, say INITIALIZING_VALUE) for performance,
14956                        // to avoid a delete which seems to help a lot.
14957
14958                        value = config.value;
14959                        config.value = undefined;
14960                    }
14961
14962                    config.added = true;
14963                    config.initializing = true;
14964
14965                    data[name] = config;
14966
14967                    if (hasValue) {
14968                        // Go through set, so that raw values get normalized/validated
14969                        host.set(name, value);
14970                    }
14971
14972                    config.initializing = false;
14973                }
14974            }
14975
14976            return host;
14977        },
14978
14979        /**
14980         * Checks if the given attribute has been added to the host
14981         *
14982         * @method attrAdded
14983         * @param {String} name The name of the attribute to check.
14984         * @return {boolean} true if an attribute with the given name has been added, false if it hasn't.
14985         *         This method will return true for lazily added attributes.
14986         */
14987        attrAdded: function(name) {
14988            return !!(this._state.get(name, ADDED));
14989        },
14990
14991        /**
14992         * Returns the current value of the attribute. If the attribute
14993         * has been configured with a 'getter' function, this method will delegate
14994         * to the 'getter' to obtain the value of the attribute.
14995         *
14996         * @method get
14997         *
14998         * @param {String} name The name of the attribute. If the value of the attribute is an Object,
14999         * dot notation can be used to obtain the value of a property of the object (e.g. <code>get("x.y.z")</code>)
15000         *
15001         * @return {Any} The value of the attribute
15002         */
15003        get : function(name) {
15004            return this._getAttr(name);
15005        },
15006
15007        /**
15008         * Checks whether or not the attribute is one which has been
15009         * added lazily and still requires initialization.
15010         *
15011         * @method _isLazyAttr
15012         * @private
15013         * @param {String} name The name of the attribute
15014         * @return {boolean} true if it's a lazily added attribute, false otherwise.
15015         */
15016        _isLazyAttr: function(name) {
15017            return this._state.get(name, LAZY);
15018        },
15019
15020        /**
15021         * Finishes initializing an attribute which has been lazily added.
15022         *
15023         * @method _addLazyAttr
15024         * @private
15025         * @param {Object} name The name of the attribute
15026         * @param {Object} [lazyCfg] Optional config hash for the attribute. This is added for performance
15027         * along the critical path, where the calling method has already obtained lazy config from state.
15028         */
15029        _addLazyAttr: function(name, lazyCfg) {
15030            var state = this._state;
15031
15032            lazyCfg = lazyCfg || state.get(name, LAZY);
15033
15034            if (lazyCfg) {
15035
15036                // PERF TODO: For App's id override, otherwise wouldn't be
15037                // needed. It expects to find it in the cfg for it's
15038                // addAttr override. Would like to remove, once App override is
15039                // removed.
15040                state.data[name].lazy = undefined;
15041
15042                lazyCfg.isLazyAdd = true;
15043
15044                this.addAttr(name, lazyCfg);
15045            }
15046        },
15047
15048        /**
15049         * Sets the value of an attribute.
15050         *
15051         * @method set
15052         * @chainable
15053         *
15054         * @param {String} name The name of the attribute. If the
15055         * current value of the attribute is an Object, dot notation can be used
15056         * to set the value of a property within the object (e.g. <code>set("x.y.z", 5)</code>).
15057         * @param {Any} value The value to set the attribute to.
15058         * @param {Object} [opts] Optional data providing the circumstances for the change.
15059         * @return {Object} A reference to the host object.
15060         */
15061        set : function(name, val, opts) {
15062            return this._setAttr(name, val, opts);
15063        },
15064
15065        /**
15066         * Allows setting of readOnly/writeOnce attributes. See <a href="#method_set">set</a> for argument details.
15067         *
15068         * @method _set
15069         * @protected
15070         * @chainable
15071         *
15072         * @param {String} name The name of the attribute.
15073         * @param {Any} val The value to set the attribute to.
15074         * @param {Object} [opts] Optional data providing the circumstances for the change.
15075         * @return {Object} A reference to the host object.
15076         */
15077        _set : function(name, val, opts) {
15078            return this._setAttr(name, val, opts, true);
15079        },
15080
15081        /**
15082         * Provides the common implementation for the public set and protected _set methods.
15083         *
15084         * See <a href="#method_set">set</a> for argument details.
15085         *
15086         * @method _setAttr
15087         * @protected
15088         * @chainable
15089         *
15090         * @param {String} name The name of the attribute.
15091         * @param {Any} value The value to set the attribute to.
15092         * @param {Object} [opts] Optional data providing the circumstances for the change.
15093         * @param {boolean} force If true, allows the caller to set values for
15094         * readOnly or writeOnce attributes which have already been set.
15095         *
15096         * @return {Object} A reference to the host object.
15097         */
15098        _setAttr : function(name, val, opts, force)  {
15099            var allowSet = true,
15100                state = this._state,
15101                stateProxy = this._stateProxy,
15102                tCfgs = this._tCfgs,
15103                cfg,
15104                initialSet,
15105                strPath,
15106                path,
15107                currVal,
15108                writeOnce,
15109                initializing;
15110
15111            if (name.indexOf(DOT) !== -1) {
15112                strPath = name;
15113
15114                path = name.split(DOT);
15115                name = path.shift();
15116            }
15117
15118            // On Demand - Should be rare - handles out of order valueFn, setter, getter references
15119            if (tCfgs && tCfgs[name]) {
15120                this._addOutOfOrder(name, tCfgs[name]);
15121            }
15122
15123            cfg = state.data[name] || {};
15124
15125            if (cfg.lazy) {
15126                cfg = cfg.lazy;
15127                this._addLazyAttr(name, cfg);
15128            }
15129
15130            initialSet = (cfg.value === undefined);
15131
15132            if (stateProxy && name in stateProxy && !cfg._bypassProxy) {
15133                // TODO: Value is always set for proxy. Can we do any better? Maybe take a snapshot as the initial value for the first call to set?
15134                initialSet = false;
15135            }
15136
15137            writeOnce = cfg.writeOnce;
15138            initializing = cfg.initializing;
15139
15140            if (!initialSet && !force) {
15141
15142                if (writeOnce) {
15143                    allowSet = false;
15144                }
15145
15146                if (cfg.readOnly) {
15147                    allowSet = false;
15148                }
15149            }
15150
15151            if (!initializing && !force && writeOnce === INIT_ONLY) {
15152                allowSet = false;
15153            }
15154
15155            if (allowSet) {
15156                // Don't need currVal if initialSet (might fail in custom getter if it always expects a non-undefined/non-null value)
15157                if (!initialSet) {
15158                    currVal =  this.get(name);
15159                }
15160
15161                if (path) {
15162                    var copyVal = [currVal].reduce(
15163                        function(retVal, currVal) {
15164                            Object.keys(currVal).forEach(
15165                                function(item) {
15166                                    retVal[item] = currVal[item];
15167                                }
15168                            );
15169                        return retVal;
15170                        },
15171                        {}
15172                    );
15173
15174                    var pathNode = copyVal;
15175                    var leafIdx = path.length - 1;
15176
15177                    for (var i = 0; i < leafIdx && pathNode; i++) {
15178                        pathNode = pathNode[path[i]];
15179                    }
15180
15181                    if (pathNode) {
15182                        delete pathNode[path[leafIdx]];
15183                    }
15184
15185                    val = O.setValue(Y.clone(copyVal), path, val);
15186
15187                    if (val === undefined) {
15188                        allowSet = false;
15189                    }
15190                }
15191
15192                if (allowSet) {
15193                    if (!this._fireAttrChange || initializing) {
15194                        this._setAttrVal(name, strPath, currVal, val, opts, cfg);
15195                    } else {
15196                        // HACK - no real reason core needs to know about _fireAttrChange, but
15197                        // it adds fn hops if we want to break it out. Not sure it's worth it for this critical path
15198                        this._fireAttrChange(name, strPath, currVal, val, opts, cfg);
15199                    }
15200                }
15201            }
15202
15203            return this;
15204        },
15205
15206        /**
15207         * Utility method used by get/set to add attributes
15208         * encountered out of order when calling addAttrs().
15209         *
15210         * For example, if:
15211         *
15212         *     this.addAttrs({
15213         *          foo: {
15214         *              setter: function() {
15215         *                 // make sure this bar is available when foo is added
15216         *                 this.get("bar");
15217         *              }
15218         *          },
15219         *          bar: {
15220         *              value: ...
15221         *          }
15222         *     });
15223         *
15224         * @method _addOutOfOrder
15225         * @private
15226         * @param name {String} attribute name
15227         * @param cfg {Object} attribute configuration
15228         */
15229        _addOutOfOrder : function(name, cfg) {
15230
15231            var attrs = {};
15232            attrs[name] = cfg;
15233
15234            delete this._tCfgs[name];
15235
15236            // TODO: The original code went through addAttrs, so
15237            // sticking with it for this pass. Seems like we could
15238            // just jump straight to _addAttr() and get some perf
15239            // improvement.
15240            this._addAttrs(attrs, this._tVals);
15241        },
15242
15243        /**
15244         * Provides the common implementation for the public get method,
15245         * allowing Attribute hosts to over-ride either method.
15246         *
15247         * See <a href="#method_get">get</a> for argument details.
15248         *
15249         * @method _getAttr
15250         * @protected
15251         * @chainable
15252         *
15253         * @param {String} name The name of the attribute.
15254         * @return {Any} The value of the attribute.
15255         */
15256        _getAttr : function(name) {
15257            var fullName = name,
15258                tCfgs = this._tCfgs,
15259                path,
15260                getter,
15261                val,
15262                attrCfg;
15263
15264            if (name.indexOf(DOT) !== -1) {
15265                path = name.split(DOT);
15266                name = path.shift();
15267            }
15268
15269            // On Demand - Should be rare - handles out of
15270            // order valueFn, setter, getter references
15271            if (tCfgs && tCfgs[name]) {
15272                this._addOutOfOrder(name, tCfgs[name]);
15273            }
15274
15275            attrCfg = this._state.data[name] || {};
15276
15277            // Lazy Init
15278            if (attrCfg.lazy) {
15279                attrCfg = attrCfg.lazy;
15280                this._addLazyAttr(name, attrCfg);
15281            }
15282
15283            val = this._getStateVal(name, attrCfg);
15284
15285            getter = attrCfg.getter;
15286
15287            if (getter && !getter.call) {
15288                getter = this[getter];
15289            }
15290
15291            val = (getter) ? getter.call(this, val, fullName) : val;
15292            val = (path) ? O.getValue(val, path) : val;
15293
15294            return val;
15295        },
15296
15297        /**
15298         * Gets the stored value for the attribute, from either the
15299         * internal state object, or the state proxy if it exits
15300         *
15301         * @method _getStateVal
15302         * @private
15303         * @param {String} name The name of the attribute
15304         * @param {Object} [cfg] Optional config hash for the attribute. This is added for performance along the critical path,
15305         * where the calling method has already obtained the config from state.
15306         *
15307         * @return {Any} The stored value of the attribute
15308         */
15309        _getStateVal : function(name, cfg) {
15310            var stateProxy = this._stateProxy;
15311
15312            if (!cfg) {
15313                cfg = this._state.getAll(name) || {};
15314            }
15315
15316            return (stateProxy && (name in stateProxy) && !(cfg._bypassProxy)) ? stateProxy[name] : cfg.value;
15317        },
15318
15319        /**
15320         * Sets the stored value for the attribute, in either the
15321         * internal state object, or the state proxy if it exits
15322         *
15323         * @method _setStateVal
15324         * @private
15325         * @param {String} name The name of the attribute
15326         * @param {Any} value The value of the attribute
15327         */
15328        _setStateVal : function(name, value) {
15329            var stateProxy = this._stateProxy;
15330            if (stateProxy && (name in stateProxy) && !this._state.get(name, BYPASS_PROXY)) {
15331                stateProxy[name] = value;
15332            } else {
15333                this._state.add(name, VALUE, value);
15334            }
15335        },
15336
15337        /**
15338         * Updates the stored value of the attribute in the privately held State object,
15339         * if validation and setter passes.
15340         *
15341         * @method _setAttrVal
15342         * @private
15343         * @param {String} attrName The attribute name.
15344         * @param {String} subAttrName The sub-attribute name, if setting a sub-attribute property ("x.y.z").
15345         * @param {Any} prevVal The currently stored value of the attribute.
15346         * @param {Any} newVal The value which is going to be stored.
15347         * @param {Object} [opts] Optional data providing the circumstances for the change.
15348         * @param {Object} [attrCfg] Optional config hash for the attribute. This is added for performance along the critical path,
15349         * where the calling method has already obtained the config from state.
15350         *
15351         * @return {Boolean} true if the new attribute value was stored, false if not.
15352         */
15353        _setAttrVal : function(attrName, subAttrName, prevVal, newVal, opts, attrCfg) {
15354
15355            var host = this,
15356                allowSet = true,
15357                cfg = attrCfg || this._state.data[attrName] || {},
15358                validator = cfg.validator,
15359                setter = cfg.setter,
15360                initializing = cfg.initializing,
15361                prevRawVal = this._getStateVal(attrName, cfg),
15362                name = subAttrName || attrName,
15363                retVal,
15364                valid;
15365
15366            if (validator) {
15367                if (!validator.call) {
15368                    // Assume string - trying to keep critical path tight, so avoiding Lang check
15369                    validator = this[validator];
15370                }
15371                if (validator) {
15372                    valid = validator.call(host, newVal, name, opts);
15373
15374                    if (!valid && initializing) {
15375                        newVal = cfg.defaultValue;
15376                        valid = true; // Assume it's valid, for perf.
15377                    }
15378                }
15379            }
15380
15381            if (!validator || valid) {
15382                if (setter) {
15383                    if (!setter.call) {
15384                        // Assume string - trying to keep critical path tight, so avoiding Lang check
15385                        setter = this[setter];
15386                    }
15387                    if (setter) {
15388                        retVal = setter.call(host, newVal, name, opts);
15389
15390                        if (retVal === INVALID_VALUE) {
15391                            if (initializing) {
15392                                newVal = cfg.defaultValue;
15393                            } else {
15394                                allowSet = false;
15395                            }
15396                        } else if (retVal !== undefined){
15397                            newVal = retVal;
15398                        }
15399                    }
15400                }
15401
15402                if (allowSet) {
15403                    if(!subAttrName && (newVal === prevRawVal) && !Lang.isObject(newVal)) {
15404                        allowSet = false;
15405                    } else {
15406                        // Store value
15407                        if (!(INIT_VALUE in cfg)) {
15408                            cfg.initValue = newVal;
15409                        }
15410                        host._setStateVal(attrName, newVal);
15411                    }
15412                }
15413
15414            } else {
15415                allowSet = false;
15416            }
15417
15418            return allowSet;
15419        },
15420
15421        /**
15422         * Sets multiple attribute values.
15423         *
15424         * @method setAttrs
15425         * @param {Object} attrs  An object with attributes name/value pairs.
15426         * @param {Object} [opts] Optional data providing the circumstances for the change.
15427         * @return {Object} A reference to the host object.
15428         * @chainable
15429         */
15430        setAttrs : function(attrs, opts) {
15431            return this._setAttrs(attrs, opts);
15432        },
15433
15434        /**
15435         * Implementation behind the public setAttrs method, to set multiple attribute values.
15436         *
15437         * @method _setAttrs
15438         * @protected
15439         * @param {Object} attrs  An object with attributes name/value pairs.
15440         * @param {Object} [opts] Optional data providing the circumstances for the change
15441         * @return {Object} A reference to the host object.
15442         * @chainable
15443         */
15444        _setAttrs : function(attrs, opts) {
15445            var attr;
15446            for (attr in attrs) {
15447                if ( attrs.hasOwnProperty(attr) ) {
15448                    this.set(attr, attrs[attr], opts);
15449                }
15450            }
15451            return this;
15452        },
15453
15454        /**
15455         * Gets multiple attribute values.
15456         *
15457         * @method getAttrs
15458         * @param {String[]|Boolean} attrs Optional. An array of attribute names. If omitted, all attribute values are
15459         * returned. If set to true, all attributes modified from their initial values are returned.
15460         * @return {Object} An object with attribute name/value pairs.
15461         */
15462        getAttrs : function(attrs) {
15463            return this._getAttrs(attrs);
15464        },
15465
15466        /**
15467         * Implementation behind the public getAttrs method, to get multiple attribute values.
15468         *
15469         * @method _getAttrs
15470         * @protected
15471         * @param {String[]|Boolean} attrs Optional. An array of attribute names. If omitted, all attribute values are
15472         * returned. If set to true, all attributes modified from their initial values are returned.
15473         * @return {Object} An object with attribute name/value pairs.
15474         */
15475        _getAttrs : function(attrs) {
15476            var obj = {},
15477                attr, i, len,
15478                modifiedOnly = (attrs === true);
15479
15480            // TODO - figure out how to get all "added"
15481            if (!attrs || modifiedOnly) {
15482                attrs = O.keys(this._state.data);
15483            }
15484
15485            for (i = 0, len = attrs.length; i < len; i++) {
15486                attr = attrs[i];
15487
15488                if (!modifiedOnly || this._getStateVal(attr) != this._state.get(attr, INIT_VALUE)) {
15489                    // Go through get, to honor cloning/normalization
15490                    obj[attr] = this.get(attr);
15491                }
15492            }
15493
15494            return obj;
15495        },
15496
15497        /**
15498         * Configures a group of attributes, and sets initial values.
15499         *
15500         * <p>
15501         * <strong>NOTE:</strong> This method does not isolate the configuration object by merging/cloning.
15502         * The caller is responsible for merging/cloning the configuration object if required.
15503         * </p>
15504         *
15505         * @method addAttrs
15506         * @chainable
15507         *
15508         * @param {Object} cfgs An object with attribute name/configuration pairs.
15509         * @param {Object} values An object with attribute name/value pairs, defining the initial values to apply.
15510         * Values defined in the cfgs argument will be over-written by values in this argument unless defined as read only.
15511         * @param {boolean} lazy Whether or not to delay the intialization of these attributes until the first call to get/set.
15512         * Individual attributes can over-ride this behavior by defining a lazyAdd configuration property in their configuration.
15513         * See <a href="#method_addAttr">addAttr</a>.
15514         *
15515         * @return {Object} A reference to the host object.
15516         */
15517        addAttrs : function(cfgs, values, lazy) {
15518            if (cfgs) {
15519                this._tCfgs = cfgs;
15520                this._tVals = (values) ? this._normAttrVals(values) : null;
15521                this._addAttrs(cfgs, this._tVals, lazy);
15522                this._tCfgs = this._tVals = null;
15523            }
15524
15525            return this;
15526        },
15527
15528        /**
15529         * Implementation behind the public addAttrs method.
15530         *
15531         * This method is invoked directly by get if it encounters a scenario
15532         * in which an attribute's valueFn attempts to obtain the
15533         * value an attribute in the same group of attributes, which has not yet
15534         * been added (on demand initialization).
15535         *
15536         * @method _addAttrs
15537         * @private
15538         * @param {Object} cfgs An object with attribute name/configuration pairs.
15539         * @param {Object} values An object with attribute name/value pairs, defining the initial values to apply.
15540         * Values defined in the cfgs argument will be over-written by values in this argument unless defined as read only.
15541         * @param {boolean} lazy Whether or not to delay the intialization of these attributes until the first call to get/set.
15542         * Individual attributes can over-ride this behavior by defining a lazyAdd configuration property in their configuration.
15543         * See <a href="#method_addAttr">addAttr</a>.
15544         */
15545        _addAttrs : function(cfgs, values, lazy) {
15546            var tCfgs = this._tCfgs,
15547                tVals = this._tVals,
15548                attr,
15549                attrCfg,
15550                value;
15551
15552            for (attr in cfgs) {
15553                if (cfgs.hasOwnProperty(attr)) {
15554
15555                    // Not Merging. Caller is responsible for isolating configs
15556                    attrCfg = cfgs[attr];
15557                    attrCfg.defaultValue = attrCfg.value;
15558
15559                    // Handle simple, complex and user values, accounting for read-only
15560                    value = this._getAttrInitVal(attr, attrCfg, tVals);
15561
15562                    if (value !== undefined) {
15563                        attrCfg.value = value;
15564                    }
15565
15566                    if (tCfgs[attr]) {
15567                        tCfgs[attr] = undefined;
15568                    }
15569
15570                    this.addAttr(attr, attrCfg, lazy);
15571                }
15572            }
15573        },
15574
15575        /**
15576         * Utility method to protect an attribute configuration
15577         * hash, by merging the entire object and the individual
15578         * attr config objects.
15579         *
15580         * @method _protectAttrs
15581         * @protected
15582         * @param {Object} attrs A hash of attribute to configuration object pairs.
15583         * @return {Object} A protected version of the attrs argument.
15584         * @deprecated Use `AttributeCore.protectAttrs()` or
15585         *   `Attribute.protectAttrs()` which are the same static utility method.
15586         */
15587        _protectAttrs : AttributeCore.protectAttrs,
15588
15589        /**
15590         * Utility method to normalize attribute values. The base implementation
15591         * simply merges the hash to protect the original.
15592         *
15593         * @method _normAttrVals
15594         * @param {Object} valueHash An object with attribute name/value pairs
15595         *
15596         * @return {Object} An object literal with 2 properties - "simple" and "complex",
15597         * containing simple and complex attribute values respectively keyed
15598         * by the top level attribute name, or null, if valueHash is falsey.
15599         *
15600         * @private
15601         */
15602        _normAttrVals : function(valueHash) {
15603            var vals,
15604                subvals,
15605                path,
15606                attr,
15607                v, k;
15608
15609            if (!valueHash) {
15610                return null;
15611            }
15612
15613            vals = {};
15614
15615            for (k in valueHash) {
15616                if (valueHash.hasOwnProperty(k)) {
15617                    if (k.indexOf(DOT) !== -1) {
15618                        path = k.split(DOT);
15619                        attr = path.shift();
15620
15621                        subvals = subvals || {};
15622
15623                        v = subvals[attr] = subvals[attr] || [];
15624                        v[v.length] = {
15625                            path : path,
15626                            value: valueHash[k]
15627                        };
15628                    } else {
15629                        vals[k] = valueHash[k];
15630                    }
15631                }
15632            }
15633
15634            return { simple:vals, complex:subvals };
15635        },
15636
15637        /**
15638         * Returns the initial value of the given attribute from
15639         * either the default configuration provided, or the
15640         * over-ridden value if it exists in the set of initValues
15641         * provided and the attribute is not read-only.
15642         *
15643         * @param {String} attr The name of the attribute
15644         * @param {Object} cfg The attribute configuration object
15645         * @param {Object}
15645 initValues The object with simple and complex attribute name/value pairs returned from _normAttrVals
15646         *
15647         * @return {Any} The initial value of the attribute.
15648         *
15649         * @method _getAttrInitVal
15650         * @private
15651         */
15652        _getAttrInitVal : function(attr, cfg, initValues) {
15653            var val = cfg.value,
15654                valFn = cfg.valueFn,
15655                tmpVal,
15656                initValSet = false,
15657                readOnly = cfg.readOnly,
15658                simple,
15659                complex,
15660                i,
15661                l,
15662                path,
15663                subval,
15664                subvals;
15665
15666            if (!readOnly && initValues) {
15667                // Simple Attributes
15668                simple = initValues.simple;
15669                if (simple && simple.hasOwnProperty(attr)) {
15670                    val = simple[attr];
15671                    initValSet = true;
15672                }
15673            }
15674
15675            if (valFn && !initValSet) {
15676                if (!valFn.call) {
15677                    valFn = this[valFn];
15678                }
15679                if (valFn) {
15680                    tmpVal = valFn.call(this, attr);
15681                    val = tmpVal;
15682                }
15683            }
15684
15685            if (!readOnly && initValues) {
15686
15687                // Complex Attributes (complex values applied, after simple, in case both are set)
15688                complex = initValues.complex;
15689
15690                if (complex && complex.hasOwnProperty(attr) && (val !== undefined) && (val !== null)) {
15691                    subvals = complex[attr];
15692                    for (i = 0, l = subvals.length; i < l; ++i) {
15693                        path = subvals[i].path;
15694                        subval = subvals[i].value;
15695                        O.setValue(val, path, subval);
15696                    }
15697                }
15698            }
15699
15700            return val;
15701        },
15702
15703        /**
15704         * Utility method to set up initial attributes defined during construction,
15705         * either through the constructor.ATTRS property, or explicitly passed in.
15706         *
15707         * @method _initAttrs
15708         * @protected
15709         * @param attrs {Object} The attributes to add during construction (passed through to <a href="#method_addAttrs">addAttrs</a>).
15710         *        These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor.
15711         * @param values {Object} The initial attribute values to apply (passed through to <a href="#method_addAttrs">addAttrs</a>).
15712         *        These are not merged/cloned. The caller is responsible for isolating user provided values if required.
15713         * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href="#method_addAttrs">addAttrs</a>).
15714         */
15715        _initAttrs : function(attrs, values, lazy) {
15716            // ATTRS support for Node, which is not Base based
15717            attrs = attrs || this.constructor.ATTRS;
15718
15719            var Base = Y.Base,
15720                BaseCore = Y.BaseCore,
15721                baseInst = (Base && Y.instanceOf(this, Base)),
15722                baseCoreInst = (!baseInst && BaseCore && Y.instanceOf(this, BaseCore));
15723
15724            if (attrs && !baseInst && !baseCoreInst) {
15725                this.addAttrs(Y.AttributeCore.protectAttrs(attrs), values, lazy);
15726            }
15727        }
15728    };
15729
15730    Y.AttributeCore = AttributeCore;
15731
15732
15733}, 'patched-v3.18.3', {"requires": ["oop"]});
15734
15735YUI.add('attribute-observable', function (Y, NAME) {
15736
15737    /*For log lines*/
15738    /*jshint maxlen:200*/
15739
15740
15741    /**
15742     * The attribute module provides an augmentable Attribute implementation, which
15743     * adds configurable attributes and attribute change events to the class being
15744     * augmented. It also provides a State class, which is used internally by Attribute,
15745     * but can also be used independently to provide a name/property/value data structure to
15746     * store state.
15747     *
15748     * @module attribute
15749     */
15750
15751    /**
15752     * The `attribute-observable` submodule provides augmentable attribute change event support
15753     * for AttributeCore based implementations.
15754     *
15755     * @module attribute
15756     * @submodule attribute-observable
15757     */
15758    var EventTarget = Y.EventTarget,
15759
15760        CHANGE = "Change",
15761        BROADCAST = "broadcast";
15762
15763    /**
15764     * Provides an augmentable implementation of attribute change events for
15765     * AttributeCore.
15766     *
15767     * @class AttributeObservable
15768     * @extensionfor AttributeCore
15769     * @uses EventTarget
15770     */
15771    function AttributeObservable() {
15772        // Perf tweak - avoid creating event literals if not required.
15773        this._ATTR_E_FACADE = {};
15774
15775        EventTarget.call(this, {emitFacade:true});
15776    }
15777
15778    AttributeObservable._ATTR_CFG = [BROADCAST];
15779
15780    AttributeObservable.prototype = {
15781
15782        /**
15783         * Sets the value of an attribute.
15784         *
15785         * @method set
15786         * @chainable
15787         *
15788         * @param {String} name The name of the attribute. If the
15789         * current value of the attribute is an Object, dot notation can be used
15790         * to set the value of a property within the object (e.g. <code>set("x.y.z", 5)</code>).
15791         *
15792         * @param {Any} value The value to set the attribute to.
15793         *
15794         * @param {Object} opts (Optional) Optional event data to be mixed into
15795         * the event facade passed to subscribers of the attribute's change event. This
15796         * can be used as a flexible way to identify the source of a call to set, allowing
15797         * the developer to distinguish between set called internally by the host, vs.
15798         * set called externally by the application developer.
15799         *
15800         * @return {Object} A reference to the host object.
15801         */
15802        set : function(name, val, opts) {
15803            return this._setAttr(name, val, opts);
15804        },
15805
15806        /**
15807         * Allows setting of readOnly/writeOnce attributes. See <a href="#method_set">set</a> for argument details.
15808         *
15809         * @method _set
15810         * @protected
15811         * @chainable
15812         *
15813         * @param {String} name The name of the attribute.
15814         * @param {Any} val The value to set the attribute to.
15815         * @param {Object} opts (Optional) Optional event data to be mixed into
15816         * the event facade passed to subscribers of the attribute's change event.
15817         * @return {Object} A reference to the host object.
15818         */
15819        _set : function(name, val, opts) {
15820            return this._setAttr(name, val, opts, true);
15821        },
15822
15823        /**
15824         * Sets multiple attribute values.
15825         *
15826         * @method setAttrs
15827         * @param {Object} attrs  An object with attributes name/value pairs.
15828         * @param {Object} opts  Properties to mix into the event payload. These are shared and mixed into each set
15829         * @return {Object} A reference to the host object.
15830         * @chainable
15831         */
15832        setAttrs : function(attrs, opts) {
15833            return this._setAttrs(attrs, opts);
15834        },
15835
15836        /**
15837         * Implementation behind the public setAttrs method, to set multiple attribute values.
15838         *
15839         * @method _setAttrs
15840         * @protected
15841         * @param {Object} attrs  An object with attributes name/value pairs.
15842         * @param {Object} opts  Properties to mix into the event payload. These are shared and mixed into each set
15843         * @return {Object} A reference to the host object.
15844         * @chainable
15845         */
15846        _setAttrs : function(attrs, opts) {
15847            var attr;
15848            for (attr in attrs) {
15849                if ( attrs.hasOwnProperty(attr) ) {
15850                    this.set(attr, attrs[attr], opts);
15851                }
15852            }
15853            return this;
15854        },
15855
15856        /**
15857         * Utility method to help setup the event payload and fire the attribute change event.
15858         *
15859         * @method _fireAttrChange
15860         * @private
15861         * @param {String} attrName The name of the attribute
15862         * @param {String} subAttrName The full path of the property being changed,
15863         * if this is a sub-attribute value being change. Otherwise null.
15864         * @param {Any} currVal The current value of the attribute
15865         * @param {Any} newVal The new value of the attribute
15866         * @param {Object} opts Any additional event data to mix into the attribute change event's event facade.
15867         * @param {Object} [cfg] The attribute config stored in State, if already available.
15868         */
15869        _fireAttrChange : function(attrName, subAttrName, currVal, newVal, opts, cfg) {
15870            var host = this,
15871                eventName = this._getFullType(attrName + CHANGE),
15872                state = host._state,
15873                facade,
15874                broadcast,
15875                e;
15876
15877            if (!cfg) {
15878                cfg = state.data[attrName] || {};
15879            }
15880
15881            if (!cfg.published) {
15882
15883                // PERF: Using lower level _publish() for
15884                // critical path performance
15885                e = host._publish(eventName);
15886
15887                e.emitFacade = true;
15888                e.defaultTargetOnly = true;
15889                e.defaultFn = host._defAttrChangeFn;
15890
15891                broadcast = cfg.broadcast;
15892                if (broadcast !== undefined) {
15893                    e.broadcast = broadcast;
15894                }
15895
15896                cfg.published = true;
15897            }
15898
15899            if (opts) {
15900                facade = Y.merge(opts);
15901                facade._attrOpts = opts;
15902            } else {
15903                facade = host._ATTR_E_FACADE;
15904            }
15905
15906            // Not using the single object signature for fire({type:..., newVal:...}), since
15907            // we don't want to override type. Changed to the fire(type, {newVal:...}) signature.
15908
15909            facade.attrName = attrName;
15910            facade.subAttrName = subAttrName;
15911            facade.prevVal = currVal;
15912            facade.newVal = newVal;
15913
15914            if (host._hasPotentialSubscribers(eventName)) {
15915                host.fire(eventName, facade);
15916            } else {
15917                this._setAttrVal(attrName, subAttrName, currVal, newVal, opts, cfg);
15918            }
15919        },
15920
15921        /**
15922         * Default function for attribute change events.
15923         *
15924         * @private
15925         * @method _defAttrChangeFn
15926         * @param {EventFacade} e The event object for attribute change events.
15927         * @param {boolean} eventFastPath Whether or not we're using this as a fast path in the case of no listeners or not
15928         */
15929        _defAttrChangeFn : function(e, eventFastPath) {
15930
15931            var opts = e._attrOpts;
15932            if (opts) {
15933                delete e._attrOpts;
15934            }
15935
15936            if (!this._setAttrVal(e.attrName, e.subAttrName, e.prevVal, e.newVal, opts)) {
15937
15938
15939                if (!eventFastPath) {
15940                    // Prevent "after" listeners from being invoked since nothing changed.
15941                    e.stopImmediatePropagation();
15942                }
15943
15944            } else {
15945                if (!eventFastPath) {
15946                    e.newVal = this.get(e.attrName);
15947                }
15948            }
15949        }
15950    };
15951
15952    // Basic prototype augment - no lazy constructor invocation.
15953    Y.mix(AttributeObservable, EventTarget, false, null, 1);
15954
15955    Y.AttributeObservable = AttributeObservable;
15956
15957    /**
15958    The `AttributeEvents` class extension was deprecated in YUI 3.8.0 and is now
15959    an alias for the `AttributeObservable` class extension. Use that class
15960    extnesion instead. This alias will be removed in a future version of YUI.
15961
15962    @class AttributeEvents
15963    @uses EventTarget
15964    @deprecated Use `AttributeObservable` instead.
15965    @see AttributeObservable
15966    **/
15967    Y.AttributeEvents = AttributeObservable;
15968
15969
15970}, 'patched-v3.18.3', {"requires": ["event-custom"]});
15971
15972YUI.add('attribute-extras', function (Y, NAME) {
15973
15974    /**
15975     * The attribute module provides an augmentable Attribute implementation, which
15976     * adds configurable attributes and attribute change events to the class being
15977     * augmented. It also provides a State class, which is used internally by Attribute,
15978     * but can also be used independently to provide a name/property/value data structure to
15979     * store state.
15980     *
15981     * @module attribute
15982     */
15983
15984    /**
15985     * The attribute-extras submodule provides less commonly used attribute methods, and can
15986     * be augmented/mixed into an implemention which used attribute-core.
15987     *
15988     * @module attribute
15989     * @submodule attribute-extras
15990     */
15991    var BROADCAST = "broadcast",
15992        PUBLISHED = "published",
15993        INIT_VALUE = "initValue",
15994
15995        MODIFIABLE = {
15996            readOnly:1,
15997            writeOnce:1,
15998            getter:1,
15999            broadcast:1
16000        };
16001
16002    /**
16003     * A augmentable implementation for AttributeCore, providing less frequently used
16004     * methods for Attribute management such as modifyAttrs(), removeAttr and reset()
16005     *
16006     * @class AttributeExtras
16007     * @extensionfor AttributeCore
16008     */
16009    function AttributeExtras() {}
16010
16011    AttributeExtras.prototype = {
16012
16013        /**
16014         * Updates the configuration of an attribute which has already been added.
16015         * <p>
16016         * The properties which can be modified through this interface are limited
16017         * to the following subset of attributes, which can be safely modified
16018         * after a value has already been set on the attribute:
16019         * </p>
16020         * <dl>
16021         *  <dt>readOnly;</dt>
16022         *  <dt>writeOnce;</dt>
16023         *  <dt>broadcast; and</dt>
16024         *  <dt>getter.</dt>
16025         * </dl>
16026         * <p>
16027         * Note: New attributes cannot be added using this interface. New attributes must be
16028         * added using {{#crossLink "AttributeCore/addAttr:method"}}addAttr{{/crossLink}}, or an
16029         * appropriate manner for a class which utilises Attributes (e.g. the
16030         * {{#crossLink "Base/ATTRS:property"}}ATTRS{{/crossLink}} property in
16031         * {{#crossLink "Base"}}Base{{/crossLink}}).
16032         * </p>
16033         * @method modifyAttr
16034         * @param {String} name The name of the attribute whose configuration is to be updated.
16035         * @param {Object} config An object with configuration property/value pairs, specifying the configuration properties to modify.
16036         */
16037        modifyAttr: function(name, config) {
16038            var host = this, // help compression
16039                prop, state;
16040
16041            if (host.attrAdded(name)) {
16042
16043                if (host._isLazyAttr(name)) {
16044                    host._addLazyAttr(name);
16045                }
16046
16047                state = host._state;
16048                for (prop in config) {
16049                    if (MODIFIABLE[prop] && config.hasOwnProperty(prop)) {
16050                        state.add(name, prop, config[prop]);
16051
16052                        // If we reconfigured broadcast, need to republish
16053                        if (prop === BROADCAST) {
16054                            state.remove(name, PUBLISHED);
16055                        }
16056                    }
16057                }
16058            } else {
16059            }
16060        },
16061
16062        /**
16063         * Removes an attribute from the host object
16064         *
16065         * @method removeAttr
16066         * @param {String} name The name of the attribute to be removed.
16067         */
16068        removeAttr: function(name) {
16069            this._state.removeAll(name);
16070        },
16071
16072        /**
16073         * Resets the attribute (or all attributes) to its initial value, as long as
16074         * the attribute is not readOnly, or writeOnce.
16075         *
16076         * @method reset
16077         * @param {String} name Optional. The name of the attribute to reset.  If omitted, all attributes are reset.
16078         * @return {Object} A reference to the host object.
16079         * @chainable
16080         */
16081        reset : function(name) {
16082            var host = this;  // help compression
16083
16084            if (name) {
16085                if (host._isLazyAttr(name)) {
16086                    host._addLazyAttr(name);
16087                }
16088                host.set(name, host._state.get(name, INIT_VALUE));
16089            } else {
16090                Y.Object.each(host._state.data, function(v, n) {
16091                    host.reset(n);
16092                });
16093            }
16094            return host;
16095        },
16096
16097        /**
16098         * Returns an object with the configuration properties (and value)
16099         * for the given attribute. If attrName is not provided, returns the
16100         * configuration properties for all attributes.
16101         *
16102         * @method _getAttrCfg
16103         * @protected
16104         * @param {String} name Optional. The attribute name. If not provided, the method will return the configuration for all attributes.
16105         * @return {Object} The configuration properties for the given attribute, or all attributes.
16106         */
16107        _getAttrCfg : function(name) {
16108            var o,
16109                state = this._state;
16110
16111            if (name) {
16112                o = state.getAll(name) || {};
16113            } else {
16114                o = {};
16115                Y.each(state.data, function(v, n) {
16116                    o[n] = state.getAll(n);
16117                });
16118            }
16119
16120            return o;
16121        }
16122    };
16123
16124    Y.AttributeExtras = AttributeExtras;
16125
16126
16127}, 'patched-v3.18.3', {"requires": ["oop"]});
16128
16129YUI.add('event-custom-base', function (Y, NAME) {
16130
16131/**
16132 * Custom event engine, DOM event listener abstraction layer, synthetic DOM
16133 * events.
16134 * @module event-custom
16135 */
16136
16137Y.Env.evt = {
16138    handles: {},
16139    plugins: {}
16140};
16141
16142/**
16143 * Custom event engine, DOM event listener abstraction layer, synthetic DOM
16144 * events.
16145 * @module event-custom
16146 * @submodule event-custom-base
16147 */
16148
16149/**
16150 * Allows for the insertion of methods that are executed before or after
16151 * a specified method
16152 * @class Do
16153 * @static
16154 */
16155
16156var DO_BEFORE = 0,
16157    DO_AFTER = 1,
16158
16159DO = {
16160
16161    /**
16162     * Cache of objects touched by the utility
16163     * @property objs
16164     * @static
16165     * @deprecated Since 3.6.0. The `_yuiaop` property on the AOP'd object
16166     * replaces the role of this property, but is considered to be private, and
16167     * is only mentioned to provide a migration path.
16168     *
16169     * If you have a use case which warrants migration to the _yuiaop property,
16170     * please file a ticket to let us know what it's used for and we can see if
16171     * we need to expose hooks for that functionality more formally.
16172     */
16173    objs: null,
16174
16175    /**
16176     * <p>Execute the supplied method before the specified function.  Wrapping
16177     * function may optionally return an instance of the following classes to
16178     * further alter runtime behavior:</p>
16179     * <dl>
16180     *     <dt></code>Y.Do.Halt(message, returnValue)</code></dt>
16181     *         <dd>Immediatly stop execution and return
16182     *         <code>returnValue</code>.  No other wrapping functions will be
16183     *         executed.</dd>
16184     *     <dt></code>Y.Do.AlterArgs(message, newArgArray)</code></dt>
16185     *         <dd>Replace the arguments that the original function will be
16186     *         called with.</dd>
16187     *     <dt></code>Y.Do.Prevent(message)</code></dt>
16188     *         <dd>Don't execute the wrapped function.  Other before phase
16189     *         wrappers will be executed.</dd>
16190     * </dl>
16191     *
16192     * @method before
16193     * @param fn {Function} the function to execute
16194     * @param obj the object hosting the method to displace
16195     * @param sFn {string} the name of the method to displace
16196     * @param c The execution context for fn
16197     * @param arg* {mixed} 0..n additional arguments to supply to the subscriber
16198     * when the event fires.
16199     * @return {EventHandle} handle for the subscription
16200     * @static
16201     */
16202    before: function(fn, obj, sFn, c) {
16203        var f = fn, a;
16204        if (c) {
16205            a = [fn, c].concat(Y.Array(arguments, 4, true));
16206            f = Y.rbind.apply(Y, a);
16207        }
16208
16209        return this._inject(DO_BEFORE, f, obj, sFn);
16210    },
16211
16212    /**
16213     * <p>Execute the supplied method after the specified function.  Wrapping
16214     * function may optionally return an instance of the following classes to
16215     * further alter runtime behavior:</p>
16216     * <dl>
16217     *     <dt></code>Y.Do.Halt(message, returnValue)</code></dt>
16218     *         <dd>Immediatly stop execution and return
16219     *         <code>returnValue</code>.  No other wrapping functions will be
16220     *         executed.</dd>
16221     *     <dt></code>Y.Do.AlterReturn(message, returnValue)</code></dt>
16222     *         <dd>Return <code>returnValue</code> instead of the wrapped
16223     *         method's original return value.  This can be further altered by
16224     *         other after phase wrappers.</dd>
16225     * </dl>
16226     *
16227     * <p>The static properties <code>Y.Do.originalRetVal</code> and
16228     * <code>Y.Do.currentRetVal</code> will be populated for reference.</p>
16229     *
16230     * @method after
16231     * @param fn {Function} the function to execute
16232     * @param obj the object hosting the method to displace
16233     * @param sFn {string} the name of the method to displace
16234     * @param c The execution context for fn
16235     * @param arg* {mixed} 0..n additional arguments to supply to the subscriber
16236     * @return {EventHandle} handle for the subscription
16237     * @static
16238     */
16239    after: function(fn, obj, sFn, c) {
16240        var f = fn, a;
16241        if (c) {
16242            a = [fn, c].concat(Y.Array(arguments, 4, true));
16243            f = Y.rbind.apply(Y, a);
16244        }
16245
16246        return this._inject(DO_AFTER, f, obj, sFn);
16247    },
16248
16249    /**
16250     * Execute the supplied method before or after the specified function.
16251     * Used by <code>before</code> and <code>after</code>.
16252     *
16253     * @method _inject
16254     * @param when {string} before or after
16255     * @param fn {Function} the function to execute
16256     * @param obj the object hosting the method to displace
16257     * @param sFn {string} the name of the method to displace
16258     * @param c The execution context for fn
16259     * @return {EventHandle} handle for the subscription
16260     * @private
16261     * @static
16262     */
16263    _inject: function(when, fn, obj, sFn) {
16264        // object id
16265        var id = Y.stamp(obj), o, sid;
16266
16267        if (!obj._yuiaop) {
16268            // create a map entry for the obj if it doesn't exist, to hold overridden methods
16269            obj._yuiaop = {};
16270        }
16271
16272        o = obj._yuiaop;
16273
16274        if (!o[sFn]) {
16275            // create a map entry for the method if it doesn't exist
16276            o[sFn] = new Y.Do.Method(obj, sFn);
16277
16278            // re-route the method to our wrapper
16279            obj[sFn] = function() {
16280                return o[sFn].exec.apply(o[sFn], arguments);
16281            };
16282        }
16283
16284        // subscriber id
16285        sid = id + Y.stamp(fn) + sFn;
16286
16287        // register the callback
16288        o[sFn].register(sid, fn, when);
16289
16290        return new Y.EventHandle(o[sFn], sid);
16291    },
16292
16293    /**
16294     * Detach a before or after subscription.
16295     *
16296     * @method detach
16297     * @param handle {EventHandle} the subscription handle
16298     * @static
16299     */
16300    detach: function(handle) {
16301        if (handle.detach) {
16302            handle.detach();
16303        }
16304    }
16305};
16306
16307Y.Do = DO;
16308
16309//////////////////////////////////////////////////////////////////////////
16310
16311/**
16312 * Contains the return value from the wrapped method, accessible
16313 * by 'after' event listeners.
16314 *
16315 * @property originalRetVal
16316 * @static
16317 * @since 3.2.0
16318 */
16319
16320/**
16321 * Contains the current state of the return value, consumable by
16322 * 'after' event listeners, and updated if an after subscriber
16323 * changes the return value generated by the wrapped function.
16324 *
16325 * @property currentRetVal
16326 * @static
16327 * @since 3.2.0
16328 */
16329
16330//////////////////////////////////////////////////////////////////////////
16331
16332/**
16333 * Wrapper for a displaced method with aop enabled
16334 * @class Do.Method
16335 * @constructor
16336 * @param obj The object to operate on
16337 * @param sFn The name of the method to displace
16338 */
16339DO.Method = function(obj, sFn) {
16340    this.obj = obj;
16341    this.methodName = sFn;
16342    this.method = obj[sFn];
16343    this.before = {};
16344    this.after = {};
16345};
16346
16347/**
16348 * Register a aop subscriber
16349 * @method register
16350 * @param sid {string} the subscriber id
16351 * @param fn {Function} the function to execute
16352 * @param when {string} when to execute the function
16353 */
16354DO.Method.prototype.register = function (sid, fn, when) {
16355    if (when) {
16356        this.after[sid] = fn;
16357    } else {
16358        this.before[sid] = fn;
16359    }
16360};
16361
16362/**
16363 * Unregister a aop subscriber
16364 * @method delete
16365 * @param sid {string} the subscriber id
16366 * @param fn {Function} the function to execute
16367 * @param when {string} when to execute the function
16368 */
16369DO.Method.prototype._delete = function (sid) {
16370    delete this.before[sid];
16371    delete this.after[sid];
16372};
16373
16374/**
16375 * <p>Execute the wrapped method.  All arguments are passed into the wrapping
16376 * functions.  If any of the before wrappers return an instance of
16377 * <code>Y.Do.Halt</code> or <code>Y.Do.Prevent</code>, neither the wrapped
16378 * function nor any after phase subscribers will be executed.</p>
16379 *
16380 * <p>The return value will be the return value of the wrapped function or one
16381 * provided by a wrapper function via an instance of <code>Y.Do.Halt</code> or
16382 * <code>Y.Do.AlterReturn</code>.
16383 *
16384 * @method exec
16385 * @param arg* {any} Arguments are passed to the wrapping and wrapped functions
16386 * @return {any} Return value of wrapped function unless overwritten (see above)
16387 */
16388DO.Method.prototype.exec = function () {
16389
16390    var args = Y.Array(arguments, 0, true),
16391        i, ret, newRet,
16392        bf = this.before,
16393        af = this.after,
16394        prevented = false;
16395
16396    // execute before
16397    for (i in bf) {
16398        if (bf.hasOwnProperty(i)) {
16399            ret = bf[i].apply(this.obj, args);
16400            if (ret) {
16401                switch (ret.constructor) {
16402                    case DO.Halt:
16403                        return ret.retVal;
16404                    case DO.AlterArgs:
16405                        args = ret.newArgs;
16406                        break;
16407                    case DO.Prevent:
16408                        prevented = true;
16409                        break;
16410                    default:
16411                }
16412            }
16413        }
16414    }
16415
16416    // execute method
16417    if (!prevented) {
16418        ret = this.method.apply(this.obj, args);
16419    }
16420
16421    DO.originalRetVal = ret;
16422    DO.currentRetVal = ret;
16423
16424    // execute after methods.
16425    for (i in af) {
16426        if (af.hasOwnProperty(i)) {
16427            newRet = af[i].apply(this.obj, args);
16428            // Stop processing if a Halt object is returned
16429            if (newRet && newRet.constructor === DO.Halt) {
16430                return newRet.retVal;
16431            // Check for a new return value
16432            } else if (newRet && newRet.constructor === DO.AlterReturn) {
16433                ret = newRet.newRetVal;
16434                // Update the static retval state
16435                DO.currentRetVal = ret;
16436            }
16437        }
16438    }
16439
16440    return ret;
16441};
16442
16443//////////////////////////////////////////////////////////////////////////
16444
16445/**
16446 * Return an AlterArgs object when you want to change the arguments that
16447 * were passed into the function.  Useful for Do.before subscribers.  An
16448 * example would be a service that scrubs out illegal characters prior to
16449 * executing the core business logic.
16450 * @class Do.AlterArgs
16451 * @constructor
16452 * @param msg {String} (optional) Explanation of the altered return value
16453 * @param newArgs {Array} Call parameters to be used for the original method
16454 *                        instead of the arguments originally passed in.
16455 */
16456DO.AlterArgs = function(msg, newArgs) {
16457    this.msg = msg;
16458    this.newArgs = newArgs;
16459};
16460
16461/**
16462 * Return an AlterReturn object when you want to change the result returned
16463 * from the core method to the caller.  Useful for Do.after subscribers.
16464 * @class Do.AlterReturn
16465 * @constructor
16466 * @param msg {String} (optional) Explanation of the altered return value
16467 * @param newRetVal {any} Return value passed to code that invoked the wrapped
16468 *                      function.
16469 */
16470DO.AlterReturn = function(msg, newRetVal) {
16471    this.msg = msg;
16472    this.newRetVal = newRetVal;
16473};
16474
16475/**
16476 * Return a Halt object when you want to terminate the execution
16477 * of all subsequent subscribers as well as the wrapped method
16478 * if it has not exectued yet.  Useful for Do.before subscribers.
16479 * @class Do.Halt
16480 * @constructor
16481 * @param msg {String} (optional) Explanation of why the termination was done
16482 * @param retVal {any} Return value passed to code that invoked the wrapped
16483 *                      function.
16484 */
16485DO.Halt = function(msg, retVal) {
16486    this.msg = msg;
16487    this.retVal = retVal;
16488};
16489
16490/**
16491 * Return a Prevent object when you want to prevent the wrapped function
16492 * from executing, but want the remaining listeners to execute.  Useful
16493 * for Do.before subscribers.
16494 * @class Do.Prevent
16495 * @constructor
16496 * @param msg {String} (optional) Explanation of why the termination was done
16497 */
16498DO.Prevent = function(msg) {
16499    this.msg = msg;
16500};
16501
16502/**
16503 * Return an Error object when you want to terminate the execution
16504 * of all subsequent method calls.
16505 * @class Do.Error
16506 * @constructor
16507 * @param msg {String} (optional) Explanation of the altered return value
16508 * @param retVal {any} Return value passed to code that invoked the wrapped
16509 *                      function.
16510 * @deprecated use Y.Do.Halt or Y.Do.Prevent
16511 */
16512DO.Error = DO.Halt;
16513
16514
16515//////////////////////////////////////////////////////////////////////////
16516
16517/**
16518 * Custom event engine, DOM event listener abstraction layer, synthetic DOM
16519 * events.
16520 * @module event-custom
16521 * @submodule event-custom-base
16522 */
16523
16524
16525// var onsubscribeType = "_event:onsub",
16526var YArray = Y.Array,
16527
16528    AFTER = 'after',
16529    CONFIGS = [
16530        'broadcast',
16531        'monitored',
16532        'bubbles',
16533        'context',
16534        'contextFn',
16535        'currentTarget',
16536        'defaultFn',
16537        'defaultTargetOnly',
16538        'details',
16539        'emitFacade',
16540        'fireOnce',
16541        'async',
16542        'host',
16543        'preventable',
16544        'preventedFn',
16545        'queuable',
16546        'silent',
16547        'stoppedFn',
16548        'target',
16549        'type'
16550    ],
16551
16552    CONFIGS_HASH = YArray.hash(CONFIGS),
16553
16554    nativeSlice = Array.prototype.slice,
16555
16556    YUI3_SIGNATURE = 9,
16557    YUI_LOG = 'yui:log',
16558
16559    mixConfigs = function(r, s, ov) {
16560        var p;
16561
16562        for (p in s) {
16563            if (CONFIGS_HASH[p] && (ov || !(p in r))) {
16564                r[p] = s[p];
16565            }
16566        }
16567
16568        return r;
16569    };
16570
16571/**
16572 * The CustomEvent class lets you define events for your application
16573 * that can be subscribed to by one or more independent component.
16574 *
16575 * @param {String} type The type of event, which is passed to the callback
16576 * when the event fires.
16577 * @param {object} defaults configuration object.
16578 * @class CustomEvent
16579 * @constructor
16580 */
16581
16582 /**
16583 * The type of event, returned to subscribers when the event fires
16584 * @property type
16585 * @type string
16586 */
16587
16588/**
16589 * By default all custom events are logged in the debug build, set silent
16590 * to true to disable debug outpu for this event.
16591 * @property silent
16592 * @type boolean
16593 */
16594
16595Y.CustomEvent = function(type, defaults) {
16596
16597    this._kds = Y.CustomEvent.keepDeprecatedSubs;
16598
16599    this.id = Y.guid();
16600
16601    this.type = type;
16602    this.silent = this.logSystem = (type === YUI_LOG);
16603
16604    if (this._kds) {
16605        /**
16606         * The subscribers to this event
16607         * @property subscribers
16608         * @type Subscriber {}
16609         * @deprecated
16610         */
16611
16612        /**
16613         * 'After' subscribers
16614         * @property afters
16615         * @type Subscriber {}
16616         * @deprecated
16617         */
16618        this.subscribers = {};
16619        this.afters = {};
16620    }
16621
16622    if (defaults) {
16623        mixConfigs(this, defaults, true);
16624    }
16625};
16626
16627/**
16628 * Static flag to enable population of the <a href="#property_subscribers">`subscribers`</a>
16629 * and  <a href="#property_subscribers">`afters`</a> properties held on a `CustomEvent` instance.
16630 *
16631 * These properties were changed to private properties (`_subscribers` and `_afters`), and
16632 * converted from objects to arrays for performance reasons.
16633 *
16634 * Setting this property to true will populate the deprecated `subscribers` and `afters`
16635 * properties for people who may be using them (which is expected to be rare). There will
16636 * be a performance hit, compared to the new array based implementation.
16637 *
16638 * If you are using these deprecated properties for a use case which the public API
16639 * does not support, please file an enhancement request, and we can provide an alternate
16640 * public implementation which doesn't have the performance cost required to maintiain the
16641 * properties as objects.
16642 *
16643 * @property keepDeprecatedSubs
16644 * @static
16645 * @for CustomEvent
16646 * @type boolean
16647 * @default false
16648 * @deprecated
16649 */
16650Y.CustomEvent.keepDeprecatedSubs = false;
16651
16652Y.CustomEvent.mixConfigs = mixConfigs;
16653
16654Y.CustomEvent.prototype = {
16655
16656    constructor: Y.CustomEvent,
16657
16658    /**
16659     * Monitor when an event is attached or detached.
16660     *
16661     * @property monitored
16662     * @type boolean
16663     */
16664
16665    /**
16666     * If 0, this event does not broadcast.  If 1, the YUI instance is notified
16667     * every time this event fires.  If 2, the YUI instance and the YUI global
16668     * (if event is enabled on the global) are notified every time this event
16669     * fires.
16670     * @property broadcast
16671     * @type int
16672     */
16673
16674    /**
16675     * Specifies whether this event should be queued when the host is actively
16676     * processing an event.  This will effect exectution order of the callbacks
16677     * for the various events.
16678     * @property queuable
16679     * @type boolean
16680     * @default false
16681     */
16682
16683    /**
16684     * This event has fired if true
16685     *
16686     * @property fired
16687     * @type boolean
16688     * @default false;
16689     */
16690
16691    /**
16692     * An array containing the arguments the custom event
16693     * was last fired with.
16694     * @property firedWith
16695     * @type Array
16696     */
16697
16698    /**
16699     * This event should only fire one time if true, and if
16700     * it has fired, any new subscribers should be notified
16701     * immediately.
16702     *
16703     * @property fireOnce
16704     * @type boolean
16705     * @default false;
16706     */
16707
16708    /**
16709     * fireOnce listeners will fire syncronously unless async
16710     * is set to true
16711     * @property async
16712     * @type boolean
16713     * @default false
16714     */
16715
16716    /**
16717     * Flag for stopPropagation that is modified during fire()
16718     * 1 means to stop propagation to bubble targets.  2 means
16719     * to also stop additional subscribers on this target.
16720     * @property stopped
16721     * @type int
16722     */
16723
16724    /**
16725     * Flag for preventDefault that is modified during fire().
16726     * if it is not 0, the default behavior for this event
16727     * @property prevented
16728     * @type int
16729     */
16730
16731    /**
16732     * Specifies the host for this custom event.  This is used
16733     * to enable event bubbling
16734     * @property host
16735     * @type EventTarget
16736     */
16737
16738    /**
16739     * The default function to execute after event listeners
16740     * have fire, but only if the default action was not
16741     * prevented.
16742     * @property defaultFn
16743     * @type Function
16744     */
16745
16746    /**
16747     * Flag for the default function to execute only if the
16748     * firing event is the current target. This happens only
16749     * when using custom event delegation and setting the
16750     * flag to `true` mimics the behavior of event delegation
16751     * in the DOM.
16752     *
16753     * @property defaultTargetOnly
16754     * @type Boolean
16755     * @default false
16756     */
16757
16758    /**
16759     * The function to execute if a subscriber calls
16760     * stopPropagation or stopImmediatePropagation
16761     * @property stoppedFn
16762     * @type Function
16763     */
16764
16765    /**
16766     * The function to execute if a subscriber calls
16767     * preventDefault
16768     * @property preventedFn
16769     * @type Function
16770     */
16771
16772    /**
16773     * The subscribers to this event
16774     * @property _subscribers
16775     * @type Subscriber []
16776     * @private
16777     */
16778
16779    /**
16780     * 'After' subscribers
16781     * @property _afters
16782     * @type Subscriber []
16783     * @private
16784     */
16785
16786    /**
16787     * If set to true, the custom event will deliver an EventFacade object
16788     * that is similar to a DOM event object.
16789     * @property emitFacade
16790     * @type boolean
16791     * @default false
16792     */
16793
16794    /**
16795     * Supports multiple options for listener signatures in order to
16796     * port YUI 2 apps.
16797     * @property signature
16798     * @type int
16799     * @default 9
16800     */
16801    signature : YUI3_SIGNATURE,
16802
16803    /**
16804     * The context the the event will fire from by default.  Defaults to the YUI
16805     * instance.
16806     * @property context
16807     * @type object
16808     */
16809    context : Y,
16810
16811    /**
16812     * Specifies whether or not this event's default function
16813     * can be cancelled by a subscriber by executing preventDefault()
16814     * on the event facade
16815     * @property preventable
16816     * @type boolean
16817     * @default true
16818     */
16819    preventable : true,
16820
16821    /**
16822     * Specifies whether or not a subscriber can stop the event propagation
16823     * via stopPropagation(), stopImmediatePropagation(), or halt()
16824     *
16825     * Events can only bubble if emitFacade is true.
16826     *
16827     * @property bubbles
16828     * @type boolean
16829     * @default true
16830     */
16831    bubbles : true,
16832
16833    /**
16834     * Returns the number of subscribers for this event as the sum of the on()
16835     * subscribers and after() subscribers.
16836     *
16837     * @method hasSubs
16838     * @return Number
16839     */
16840    hasSubs: function(when) {
16841        var s = 0,
16842            a = 0,
16843            subs = this._subscribers,
16844            afters = this._afters,
16845            sib = this.sibling;
16846
16847        if (subs) {
16848            s = subs.length;
16849        }
16850
16851        if (afters) {
16852            a = afters.length;
16853        }
16854
16855        if (sib) {
16856            subs = sib._subscribers;
16857            afters = sib._afters;
16858
16859            if (subs) {
16860                s += subs.length;
16861            }
16862
16863            if (afters) {
16864                a += afters.length;
16865            }
16866        }
16867
16868        if (when) {
16869            return (when === 'after') ? a : s;
16870        }
16871
16872        return (s + a);
16873    },
16874
16875    /**
16876     * Monitor the event state for the subscribed event.  The first parameter
16877     * is what should be monitored, the rest are the normal parameters when
16878     * subscribing to an event.
16879     * @method monitor
16880     * @param what {string} what to monitor ('detach', 'attach', 'publish').
16881     * @return {EventHandle} return value from the monitor event subscription.
16882     */
16883    monitor: function(what) {
16884        this.monitored = true;
16885        var type = this.id + '|' + this.type + '_' + what,
16886            args = nativeSlice.call(arguments, 0);
16887        args[0] = type;
16888        return this.host.on.apply(this.host, args);
16889    },
16890
16891    /**
16892     * Get all of the subscribers to this event and any sibling event
16893     * @method getSubs
16894     * @return {Array} first item is the on subscribers, second the after.
16895     */
16896    getSubs: function() {
16897
16898        var sibling = this.sibling,
16899            subs = this._subscribers,
16900            afters = this._afters,
16901            siblingSubs,
16902            siblingAfters;
16903
16904        if (sibling) {
16905            siblingSubs = sibling._subscribers;
16906            siblingAfters = sibling._afters;
16907        }
16908
16909        if (siblingSubs) {
16910            if (subs) {
16911                subs = subs.concat(siblingSubs);
16912            } else {
16913                subs = siblingSubs.concat();
16914            }
16915        } else {
16916            if (subs) {
16917                subs = subs.concat();
16918            } else {
16919                subs = [];
16920            }
16921        }
16922
16923        if (siblingAfters) {
16924            if (afters) {
16925                afters = afters.concat(siblingAfters);
16926            } else {
16927                afters = siblingAfters.concat();
16928            }
16929        } else {
16930            if (afters) {
16931                afters = afters.concat();
16932            } else {
16933                afters = [];
16934            }
16935        }
16936
16937        return [subs, afters];
16938    },
16939
16940    /**
16941     * Apply configuration properties.  Only applies the CONFIG whitelist
16942     * @method applyConfig
16943     * @param o hash of properties to apply.
16944     * @param force {boolean} if true, properties that exist on the event
16945     * will be overwritten.
16946     */
16947    applyConfig: function(o, force) {
16948        mixConfigs(this, o, force);
16949    },
16950
16951    /**
16952     * Create the Subscription for subscribing function, context, and bound
16953     * arguments.  If this is a fireOnce event, the subscriber is immediately
16954     * notified.
16955     *
16956     * @method _on
16957     * @param fn {Function} Subscription callback
16958     * @param [context] {Object} Override `this` in the callback
16959     * @param [args] {Array} bound arguments that will be passed to the callback after the arguments generated by fire()
16960     * @param [when] {String} "after" to slot into after subscribers
16961     * @return {EventHandle}
16962     * @protected
16963     */
16964    _on: function(fn, context, args, when) {
16965
16966
16967        var s = new Y.Subscriber(fn, context, args, when),
16968            firedWith;
16969
16970        if (this.fireOnce && this.fired) {
16971
16972            firedWith = this.firedWith;
16973
16974            // It's a little ugly for this to know about facades,
16975            // but given the current breakup, not much choice without
16976            // moving a whole lot of stuff around.
16977            if (this.emitFacade && this._addFacadeToArgs) {
16978                this._addFacadeToArgs(firedWith);
16979            }
16980
16981            if (this.async) {
16982                setTimeout(Y.bind(this._notify, this, s, firedWith), 0);
16983            } else {
16984                this._notify(s, firedWith);
16985            }
16986        }
16987
16988        if (when === AFTER) {
16989            if (!this._afters) {
16990                this._afters = [];
16991            }
16992            this._afters.push(s);
16993        } else {
16994            if (!this._subscribers) {
16995                this._subscribers = [];
16996            }
16997            this._subscribers.push(s);
16998        }
16999
17000        if (this._kds) {
17001            if (when === AFTER) {
17002                this.afters[s.id] = s;
17003            } else {
17004                this.subscribers[s.id] = s;
17005            }
17006        }
17007
17008        return new Y.EventHandle(this, s);
17009    },
17010
17011    /**
17012     * Listen for this event
17013     * @method subscribe
17014     * @param {Function} fn The function to execute.
17015     * @return {EventHandle} Unsubscribe handle.
17016     * @deprecated use on.
17017     */
17018    subscribe: function(fn, context) {
17019        var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null;
17020        return this._on(fn, context, a, true);
17021    },
17022
17023    /**
17024     * Listen for this event
17025     * @method on
17026     * @param {Function} fn The function to execute.
17027     * @param {object} context optional execution context.
17028     * @param {mixed} arg* 0..n additional arguments to supply to the subscriber
17029     * when the event fires.
17030     * @return {EventHandle} An object with a detach method to detch the handler(s).
17031     */
17032    on: function(fn, context) {
17033        var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null;
17034
17035        if (this.monitored && this.host) {
17036            this.host._monitor('attach', this, {
17037                args: arguments
17038            });
17039        }
17040        return this._on(fn, context, a, true);
17041    },
17042
17043    /**
17044     * Listen for this event after the normal subscribers have been notified and
17045     * the default behavior has been applied.  If a normal subscriber prevents the
17046     * default behavior, it also prevents after listeners from firing.
17047     * @method after
17048     * @param {Function} fn The function to execute.
17049     * @param {object} context optional execution context.
17050     * @param {mixed} arg* 0..n additional arguments to supply to the subscriber
17051     * when the event fires.
17052     * @return {EventHandle} handle Unsubscribe handle.
17053     */
17054    after: function(fn, context) {
17055        var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null;
17056        return this._on(fn, context, a, AFTER);
17057    },
17058
17059    /**
17060     * Detach listeners.
17061     * @method detach
17062     * @param {Function} fn  The subscribed function to remove, if not supplied
17063     *                       all will be removed.
17064     * @param {Object}   context The context object passed to subscribe.
17065     * @return {Number} returns the number of subscribers unsubscribed.
17066     */
17067    detach: function(fn, context) {
17068        // unsubscribe handle
17069        if (fn && fn.detach) {
17070            return fn.detach();
17071        }
17072
17073        var i, s,
17074            found = 0,
17075            subs = this._subscribers,
17076            afters = this._afters;
17077
17078        if (subs) {
17079            for (i = subs.length; i >= 0; i--) {
17080                s = subs[i];
17081                if (s && (!fn || fn === s.fn)) {
17082                    this._delete(s, subs, i);
17083                    found++;
17084                }
17085            }
17086        }
17087
17088        if (afters) {
17089            for (i = afters.length; i >= 0; i--) {
17090                s = afters[i];
17091                if (s && (!fn || fn === s.fn)) {
17092                    this._delete(s, afters, i);
17093                    found++;
17094                }
17095            }
17096        }
17097
17098        return found;
17099    },
17100
17101    /**
17102     * Detach listeners.
17103     * @method unsubscribe
17104     * @param {Function} fn  The subscribed function to remove, if not supplied
17105     *                       all will be removed.
17106     * @param {Object}   context The context object passed to subscribe.
17107     * @return {int|undefined} returns the number of subscribers unsubscribed.
17108     * @deprecated use detach.
17109     */
17110    unsubscribe: function() {
17111        return this.detach.apply(this, arguments);
17112    },
17113
17114    /**
17115     * Notify a single subscriber
17116     * @method _notify
17117     * @param {Subscriber} s the subscriber.
17118     * @param {Array} args the arguments array to apply to the listener.
17119     * @protected
17120     */
17121    _notify: function(s, args, ef) {
17122
17123
17124        var ret;
17125
17126        ret = s.notify(args, this);
17127
17128        if (false === ret || this.stopped > 1) {
17129            return false;
17130        }
17131
17132        return true;
17133    },
17134
17135    /**
17136     * Logger abstraction to centralize the application of the silent flag
17137     * @method log
17138     * @param {string} msg message to log.
17139     * @param {string} cat log category.
17140     */
17141    log: function(msg, cat) {
17142    },
17143
17144    /**
17145     * Notifies the subscribers.  The callback functions will be executed
17146     * from the context specified when the event was created, and with the
17147     * following parameters:
17148     *   <ul>
17149     *   <li>The type of event</li>
17150     *   <li>All of the arguments fire() was executed with as an array</li>
17151     *   <li>The custom object (if any) that was passed into the subscribe()
17152     *       method</li>
17153     *   </ul>
17154     * @method fire
17155     * @param {Object*} arguments an arbitrary set of parameters to pass to
17156     *                            the handler.
17157     * @return {boolean} false if one of the subscribers returned false,
17158     *                   true otherwise.
17159     *
17160     */
17161    fire: function() {
17162
17163        // push is the fastest way to go from arguments to arrays
17164        // for most browsers currently
17165        // http://jsperf.com/push-vs-concat-vs-slice/2
17166
17167        var args = [];
17168        args.push.apply(args, arguments);
17169
17170        return this._fire(args);
17171    },
17172
17173    /**
17174     * Private internal implementation for `fire`, which is can be used directly by
17175     * `EventTarget` and other event module classes which have already converted from
17176     * an `arguments` list to an array, to avoid the repeated overhead.
17177     *
17178     * @method _fire
17179     * @private
17180     * @param {Array} args The array of arguments passed to be passed to handlers.
17181     * @return {boolean} false if one of the subscribers returned false, true otherwise.
17182     */
17183    _fire: function(args) {
17184
17185        if (this.fireOnce && this.fired) {
17186            return true;
17187        } else {
17188
17189            // this doesn't happen if the event isn't published
17190            // this.host._monitor('fire', this.type, args);
17191
17192            this.fired = true;
17193
17194            if (this.fireOnce) {
17195                this.firedWith = args;
17196            }
17197
17198            if (this.emitFacade) {
17199                return this.fireComplex(args);
17200            } else {
17201                return this.fireSimple(args);
17202            }
17203        }
17204    },
17205
17206    /**
17207     * Set up for notifying subscribers of non-emitFacade events.
17208     *
17209     * @method fireSimple
17210     * @param args {Array} Arguments passed to fire()
17211     * @return Boolean false if a subscriber returned false
17212     * @protected
17213     */
17214    fireSimple: function(args) {
17215        this.stopped = 0;
17216        this.prevented = 0;
17217        if (this.hasSubs()) {
17218            var subs = this.getSubs();
17219            this._procSubs(subs[0], args);
17220            this._procSubs(subs[1], args);
17221        }
17222        if (this.broadcast) {
17223            this._broadcast(args);
17224        }
17225        return this.stopped ? false : true;
17226    },
17227
17228    // Requires the event-custom-complex module for full funcitonality.
17229    fireComplex: function(args) {
17230        args[0] = args[0] || {};
17231        return this.fireSimple(args);
17232    },
17233
17234    /**
17235     * Notifies a list of subscribers.
17236     *
17237     * @method _procSubs
17238     * @param subs {Array} List of subscribers
17239     * @param args {Array} Arguments passed to fire()
17240     * @param ef {}
17241     * @return Boolean false if a subscriber returns false or stops the event
17242     *              propagation via e.stopPropagation(),
17243     *              e.stopImmediatePropagation(), or e.halt()
17244     * @private
17245     */
17246    _procSubs: function(subs, args, ef) {
17247        var s, i, l;
17248
17249        for (i = 0, l = subs.length; i < l; i++) {
17250            s = subs[i];
17251            if (s && s.fn) {
17252                if (false === this._notify(s, args, ef)) {
17253                    this.stopped = 2;
17254                }
17255                if (this.stopped === 2) {
17256                    return false;
17257                }
17258            }
17259        }
17260
17261        return true;
17262    },
17263
17264    /**
17265     * Notifies the YUI instance if the event is configured with broadcast = 1,
17266     * and both the YUI instance and Y.Global if configured with broadcast = 2.
17267     *
17268     * @method _broadcast
17269     * @param args {Array} Arguments sent to fire()
17270     * @private
17271     */
17272    _broadcast: function(args) {
17273        if (!this.stopped && this.broadcast) {
17274
17275            var a = args.concat();
17276            a.unshift(this.type);
17277
17278            if (this.host !== Y) {
17279                Y.fire.apply(Y, a);
17280            }
17281
17282            if (this.broadcast === 2) {
17283                Y.Global.fire.apply(Y.Global, a);
17284            }
17285        }
17286    },
17287
17288    /**
17289     * Removes all listeners
17290     * @method unsubscribeAll
17291     * @return {Number} The number of listeners unsubscribed.
17292     * @deprecated use detachAll.
17293     */
17294    unsubscribeAll: function() {
17295        return this.detachAll.apply(this, arguments);
17296    },
17297
17298    /**
17299     * Removes all listeners
17300     * @method detachAll
17301     * @return {Number} The number of listeners unsubscribed.
17302     */
17303    detachAll: function() {
17304        return this.detach();
17305    },
17306
17307    /**
17308     * Deletes the subscriber from the internal store of on() and after()
17309     * subscribers.
17310     *
17311     * @method _delete
17312     * @param s subscriber object.
17313     * @param subs (optional) on or after subscriber array
17314     * @param index (optional) The index found.
17315     * @private
17316     */
17317    _delete: function(s, subs, i) {
17318        var when = s._when;
17319
17320        if (!subs) {
17321            subs = (when === AFTER) ? this._afters : this._subscribers;
17322        }
17323
17324        if (subs) {
17325            i = YArray.indexOf(subs, s, 0);
17326
17327            if (s && subs[i] === s) {
17328                subs.splice(i, 1);
17329            }
17330        }
17331
17332        if (this._kds) {
17333            if (when === AFTER) {
17334                delete this.afters[s.id];
17335            } else {
17336                delete this.subscribers[s.id];
17337            }
17338        }
17339
17340        if (this.monitored && this.host) {
17341            this.host._monitor('detach', this, {
17342                ce: this,
17343                sub: s
17344            });
17345        }
17346
17347        if (s) {
17348            s.deleted = true;
17349        }
17350    }
17351};
17352/**
17353 * Stores the subscriber information to be used when the event fires.
17354 * @param {Function} fn       The wrapped function to execute.
17355 * @param {Object}   context  The value of the keyword 'this' in the listener.
17356 * @param {Array} args*       0..n additional arguments to supply the listener.
17357 *
17358 * @class Subscriber
17359 * @constructor
17360 */
17361Y.Subscriber = function(fn, context, args, when) {
17362
17363    /**
17364     * The callback that will be execute when the event fires
17365     * This is wrapped by Y.rbind if obj was supplied.
17366     * @property fn
17367     * @type Function
17368     */
17369    this.fn = fn;
17370
17371    /**
17372     * Optional 'this' keyword for the listener
17373     * @property context
17374     * @type Object
17375     */
17376    this.context = context;
17377
17378    /**
17379     * Unique subscriber id
17380     * @property id
17381     * @type String
17382     */
17383    this.id = Y.guid();
17384
17385    /**
17386     * Additional arguments to propagate to the subscriber
17387     * @property args
17388     * @type Array
17389     */
17390    this.args = args;
17391
17392    this._when = when;
17393
17394    /**
17395     * Custom events for a given fire transaction.
17396     * @property events
17397     * @type {EventTarget}
17398     */
17399    // this.events = null;
17400
17401    /**
17402     * This listener only reacts to the event once
17403     * @property once
17404     */
17405    // this.once = false;
17406
17407};
17408
17409Y.Subscriber.prototype = {
17410    constructor: Y.Subscriber,
17411
17412    _notify: function(c, args, ce) {
17413        if (this.deleted && !this.postponed) {
17414            if (this.postponed) {
17415                delete this.fn;
17416                delete this.context;
17417            } else {
17418                delete this.postponed;
17419                return null;
17420            }
17421        }
17422        var a = this.args, ret;
17423        switch (ce.signature) {
17424            case 0:
17425                ret = this.fn.call(c, ce.type, args, c);
17426                break;
17427            case 1:
17428                ret = this.fn.call(c, args[0] || null, c);
17429                break;
17430            default:
17431                if (a || args) {
17432                    args = args || [];
17433                    a = (a) ? args.concat(a) : args;
17434                    ret = this.fn.apply(c, a);
17435                } else {
17436                    ret = this.fn.call(c);
17437                }
17438        }
17439
17440        if (this.once) {
17441            ce._delete(this);
17442        }
17443
17444        return ret;
17445    },
17446
17447    /**
17448     * Executes the subscriber.
17449     * @method notify
17450     * @param args {Array} Arguments array for the subscriber.
17451     * @param ce {CustomEvent} The custom event that sent the notification.
17452     */
17453    notify: function(args, ce) {
17454        var c = this.context,
17455            ret = true;
17456
17457        if (!c) {
17458            c = (ce.contextFn) ? ce.contextFn() : ce.context;
17459        }
17460
17461        // only catch errors if we will not re-throw them.
17462        if (Y.config && Y.config.throwFail) {
17463            ret = this._notify(c, args, ce);
17464        } else {
17465            try {
17466                ret = this._notify(c, args, ce);
17467            } catch (e) {
17468                Y.error(this + ' failed: ' + e.message, e);
17469            }
17470        }
17471
17472        return ret;
17473    },
17474
17475    /**
17476     * Returns true if the fn and obj match this objects properties.
17477     * Used by the unsubscribe method to match the right subscriber.
17478     *
17479     * @method contains
17480     * @param {Function} fn the function to execute.
17481     * @param {Object} context optional 'this' keyword for the listener.
17482     * @return {boolean} true if the supplied arguments match this
17483     *                   subscriber's signature.
17484     */
17485    contains: function(fn, context) {
17486        if (context) {
17487            return ((this.fn === fn) && this.context === context);
17488        } else {
17489            return (this.fn === fn);
17490        }
17491    },
17492
17493    valueOf : function() {
17494        return this.id;
17495    }
17496
17497};
17498/**
17499 * Return value from all subscribe operations
17500 * @class EventHandle
17501 * @constructor
17502 * @param {CustomEvent} evt the custom event.
17503 * @param {Subscriber} sub the subscriber.
17504 */
17505Y.EventHandle = function(evt, sub) {
17506
17507    /**
17508     * The custom event
17509     *
17510     * @property evt
17511     * @type CustomEvent
17512     */
17513    this.evt = evt;
17514
17515    /**
17516     * The subscriber object
17517     *
17518     * @property sub
17519     * @type Subscriber
17520     */
17521    this.sub = sub;
17522};
17523
17524Y.EventHandle.prototype = {
17525    batch: function(f, c) {
17526        f.call(c || this, this);
17527        if (Y.Lang.isArray(this.evt)) {
17528            Y.Array.each(this.evt, function(h) {
17529                h.batch.call(c || h, f);
17530            });
17531        }
17532    },
17533
17534    /**
17535     * Detaches this subscriber
17536     * @method detach
17537     * @return {Number} the number of detached listeners
17538     */
17539    detach: function() {
17540        var evt = this.evt, detached = 0, i;
17541        if (evt) {
17542            if (Y.Lang.isArray(evt)) {
17543                for (i = 0; i < evt.length; i++) {
17544                    detached += evt[i].detach();
17545                }
17546            } else {
17547                evt._delete(this.sub);
17548                detached = 1;
17549            }
17550
17551        }
17552
17553        return detached;
17554    },
17555
17556    /**
17557     * Monitor the event state for the subscribed event.  The first parameter
17558     * is what should be monitored, the rest are the normal parameters when
17559     * subscribing to an event.
17560     * @method monitor
17561     * @param what {string} what to monitor ('attach', 'detach', 'publish').
17562     * @return {EventHandle} return value from the monitor event subscription.
17563     */
17564    monitor: function(what) {
17565        return this.evt.monitor.apply(this.evt, arguments);
17566    }
17567};
17568
17569/**
17570 * Custom event engine, DOM event listener abstraction layer, synthetic DOM
17571 * events.
17572 * @module event-custom
17573 * @submodule event-custom-base
17574 */
17575
17576/**
17577 * EventTarget provides the implementation for any object to
17578 * publish, subscribe and fire to custom events, and also
17579 * alows other EventTargets to target the object with events
17580 * sourced from the other object.
17581 * EventTarget is designed to be used with Y.augment to wrap
17582 * EventCustom in an interface that allows events to be listened to
17583 * and fired by name.  This makes it possible for implementing code to
17584 * subscribe to an event that either has not been created yet, or will
17585 * not be created at all.
17586 * @class EventTarget
17587 * @param opts a configuration object
17588 * @config emitFacade {boolean} if true, all events will emit event
17589 * facade payloads by default (default false)
17590 * @config prefix {String} the prefix to apply to non-prefixed event names
17591 */
17592
17593var L = Y.Lang,
17594    PREFIX_DELIMITER = ':',
17595    CATEGORY_DELIMITER = '|',
17596    AFTER_PREFIX = '~AFTER~',
17597    WILD_TYPE_RE = /(.*?)(:)(.*?)/,
17598
17599    _wildType = Y.cached(function(type) {
17600        return type.replace(WILD_TYPE_RE, "*$2$3");
17601    }),
17602
17603    /**
17604     * If the instance has a prefix attribute and the
17605     * event type is not prefixed, the instance prefix is
17606     * applied to the supplied type.
17607     * @method _getType
17608     * @private
17609     */
17610    _getType = function(type, pre) {
17611
17612        if (!pre || (typeof type !== "string") || type.indexOf(PREFIX_DELIMITER) > -1) {
17613            return type;
17614        }
17615
17616        return pre + PREFIX_DELIMITER + type;
17617    },
17618
17619    /**
17620     * Returns an array with the detach key (if provided),
17621     * and the prefixed event name from _getType
17622     * Y.on('detachcategory| menu:click', fn)
17623     * @method _parseType
17624     * @private
17625     */
17626    _parseType = Y.cached(function(type, pre) {
17627
17628        var t = type, detachcategory, after, i;
17629
17630        if (!L.isString(t)) {
17631            return t;
17632        }
17633
17634        i = t.indexOf(AFTER_PREFIX);
17635
17636        if (i > -1) {
17637            after = true;
17638            t = t.substr(AFTER_PREFIX.length);
17639        }
17640
17641        i = t.indexOf(CATEGORY_DELIMITER);
17642
17643        if (i > -1) {
17644            detachcategory = t.substr(0, (i));
17645            t = t.substr(i+1);
17646            if (t === '*') {
17647                t = null;
17648            }
17649        }
17650
17651        // detach category, full type with instance prefix, is this an after listener, short type
17652        return [detachcategory, (pre) ? _getType(t, pre) : t, after, t];
17653    }),
17654
17655    ET = function(opts) {
17656
17657        var etState = this._yuievt,
17658            etConfig;
17659
17660        if (!etState) {
17661            etState = this._yuievt = {
17662                events: {},    // PERF: Not much point instantiating lazily. We're bound to have events
17663                targets: null, // PERF: Instantiate lazily, if user actually adds target,
17664                config: {
17665                    host: this,
17666                    context: this
17667                },
17668                chain: Y.config.chain
17669            };
17670        }
17671
17672        etConfig = etState.config;
17673
17674        if (opts) {
17675            mixConfigs(etConfig, opts, true);
17676
17677            if (opts.chain !== undefined) {
17678                etState.chain = opts.chain;
17679            }
17680
17681            if (opts.prefix) {
17682                etConfig.prefix = opts.prefix;
17683            }
17684        }
17685    };
17686
17687ET.prototype = {
17688
17689    constructor: ET,
17690
17691    /**
17692     * Listen to a custom event hosted by this object one time.
17693     * This is the equivalent to <code>on</code> except the
17694     * listener is immediatelly detached when it is executed.
17695     * @method once
17696     * @param {String} type The name of the event
17697     * @param {Function} fn The callback to execute in response to the event
17698     * @param {Object} [context] Override `this` object in callback
17699     * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber
17700     * @return {EventHandle} A subscription handle capable of detaching the
17701     *                       subscription
17702     */
17703    once: function() {
17704        var handle = this.on.apply(this, arguments);
17705        handle.batch(function(hand) {
17706            if (hand.sub) {
17707                hand.sub.once = true;
17708            }
17709        });
17710        return handle;
17711    },
17712
17713    /**
17714     * Listen to a custom event hosted by this object one time.
17715     * This is the equivalent to <code>after</code> except the
17716     * listener is immediatelly detached when it is executed.
17717     * @method onceAfter
17718     * @param {String} type The name of the event
17719     * @param {Function} fn The callback to execute in response to the event
17720     * @param {Object} [context] Override `this` object in callback
17721     * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber
17722     * @return {EventHandle} A subscription handle capable of detaching that
17723     *                       subscription
17724     */
17725    onceAfter: function() {
17726        var handle = this.after.apply(this, arguments);
17727        handle.batch(function(hand) {
17728            if (hand.sub) {
17729                hand.sub.once = true;
17730            }
17731        });
17732        return handle;
17733    },
17734
17735    /**
17736     * Takes the type parameter passed to 'on' and parses out the
17737     * various pieces that could be included in the type.  If the
17738     * event type is passed without a prefix, it will be expanded
17739     * to include the prefix one is supplied or the event target
17740     * is configured with a default prefix.
17741     * @method parseType
17742     * @param {String} type the type
17743     * @param {String} [pre] The prefix. Defaults to this._yuievt.config.prefix
17744     * @since 3.3.0
17745     * @return {Array} an array containing:
17746     *  * the detach category, if supplied,
17747     *  * the prefixed event type,
17748     *  * whether or not this is an after listener,
17749     *  * the supplied event type
17750     */
17751    parseType: function(type, pre) {
17752        return _parseType(type, pre || this._yuievt.config.prefix);
17753    },
17754
17755    /**
17756     * Subscribe a callback function to a custom event fired by this object or
17757     * from an object that bubbles its events to this object.
17758     *
17759     *      this.on("change", this._onChange, this);
17760     *
17761     * Callback functions for events published with `emitFacade = true` will
17762     * receive an `EventFacade` as the first argument (typically named "e").
17763     * These callbacks can then call `e.preventDefault()` to disable the
17764     * behavior published to that event's `defaultFn`.  See the `EventFacade`
17765     * API for all available properties and methods. Subscribers to
17766     * non-`emitFacade` events will receive the arguments passed to `fire()`
17767     * after the event name.
17768     *
17769     * To subscribe to multiple events at once, pass an object as the first
17770     * argument, where the key:value pairs correspond to the eventName:callback.
17771     *
17772     *      this.on({
17773     *          "attrChange" : this._onAttrChange,
17774     *          "change"     : this._onChange
17775     *      });
17776     *
17777     * You can also pass an array of event names as the first argument to
17778     * subscribe to all listed events with the same callback.
17779     *
17780     *      this.on([ "change", "attrChange" ], this._onChange);
17781     *
17782     * Returning `false` from a callback is supported as an alternative to
17783     * calling `e.preventDefault(); e.stopPropagation();`.  However, it is
17784     * recommended to use the event methods whenever possible.
17785     *
17786     * @method on
17787     * @param {String} type The name of the event
17788     * @param {Function} fn The callback to execute in response to the event
17789     * @param {Object} [context] Override `this` object in callback
17790     * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber
17791     * @return {EventHandle} A subscription handle capable of detaching that
17792     *                       subscription
17793     */
17794    on: function(type, fn, context) {
17795
17796        var yuievt = this._yuievt,
17797            parts = _parseType(type, yuievt.config.prefix), f, c, args, ret, ce,
17798            detachcategory, handle, store = Y.Env.evt.handles, after, adapt, shorttype,
17799            Node = Y.Node, n, domevent, isArr;
17800
17801        // full name, args, detachcategory, after
17802        this._monitor('attach', parts[1], {
17803            args: arguments,
17804            category: parts[0],
17805            after: parts[2]
17806        });
17807
17808        if (L.isObject(type)) {
17809
17810            if (L.isFunction(type)) {
17811                return Y.Do.before.apply(Y.Do, arguments);
17812            }
17813
17814            f = fn;
17815            c = context;
17816            args = nativeSlice.call(arguments, 0);
17817            ret = [];
17818
17819            if (L.isArray(type)) {
17820                isArr = true;
17821            }
17822
17823            after = type._after;
17824            delete type._after;
17825
17826            Y.each(type, function(v, k) {
17827
17828                if (L.isObject(v)) {
17829                    f = v.fn || ((L.isFunction(v)) ? v : f);
17830                    c = v.context || c;
17831                }
17832
17833                var nv = (after) ? AFTER_PREFIX : '';
17834
17835                args[0] = nv + ((isArr) ? v : k);
17836                args[1] = f;
17837                args[2] = c;
17838
17839                ret.push(this.on.apply(this, args));
17840
17841            }, this);
17842
17843            return (yuievt.chain) ? this : new Y.EventHandle(ret);
17844        }
17845
17846        detachcategory = parts[0];
17847        after = parts[2];
17848        shorttype = parts[3];
17849
17850        // extra redirection so we catch adaptor events too.  take a look at this.
17851        if (Node && Y.instanceOf(this, Node) && (shorttype in Node.DOM_EVENTS)) {
17852            args = nativeSlice.call(arguments, 0);
17853            args.splice(2, 0, Node.getDOMNode(this));
17854            return Y.on.apply(Y, args);
17855        }
17856
17857        type = parts[1];
17858
17859        if (Y.instanceOf(this, YUI)) {
17860
17861            adapt = Y.Env.evt.plugins[type];
17862            args  = nativeSlice.call(arguments, 0);
17863            args[0] = shorttype;
17864
17865            if (Node) {
17866                n = args[2];
17867
17868                if (Y.instanceOf(n, Y.NodeList)) {
17869                    n = Y.NodeList.getDOMNodes(n);
17870                } else if (Y.instanceOf(n, Node)) {
17871                    n = Node.getDOMNode(n);
17872                }
17873
17874                domevent = (shorttype in Node.DOM_EVENTS);
17875
17876                // Captures both DOM events and event plugins.
17877                if (domevent) {
17878                    args[2] = n;
17879                }
17880            }
17881
17882            // check for the existance of an event adaptor
17883            if (adapt) {
17884                handle = adapt.on.apply(Y, args);
17885            } else if ((!type) || domevent) {
17886                handle = Y.Event._attach(args);
17887            }
17888
17889        }
17890
17891        if (!handle) {
17892            ce = yuievt.events[type] || this.publish(type);
17893            handle = ce._on(fn, context, (arguments.length > 3) ? nativeSlice.call(arguments, 3) : null, (after) ? 'after' : true);
17894
17895            // TODO: More robust regex, accounting for category
17896            if (type.indexOf("*:") !== -1) {
17897                this._hasSiblings = true;
17898            }
17899        }
17900
17901        if (detachcategory) {
17902            store[detachcategory] = store[detachcategory] || {};
17903            store[detachcategory][type] = store[detachcategory][type] || [];
17904            store[detachcategory][type].push(handle);
17905        }
17906
17907        return (yuievt.chain) ? this : handle;
17908
17909    },
17910
17911    /**
17912     * subscribe to an event
17913     * @method subscribe
17914     * @deprecated use on
17915     */
17916    subscribe: function() {
17917        return this.on.apply(this, arguments);
17918    },
17919
17920    /**
17921     * Detach one or more listeners the from the specified event
17922     * @method detach
17923     * @param type {string|Object}   Either the handle to the subscriber or the
17924     *                        type of event.  If the type
17925     *                        is not specified, it will attempt to remove
17926     *                        the listener from all hosted events.
17927     * @param fn   {Function} The subscribed function to unsubscribe, if not
17928     *                          supplied, all subscribers will be removed.
17929     * @param context  {Object}   The custom object passed to subscribe.  This is
17930     *                        optional, but if supplied will be used to
17931     *                        disambiguate multiple listeners that are the same
17932     *                        (e.g., you subscribe many object using a function
17933     *                        that lives on the prototype)
17934     * @return {EventTarget} the host
17935     */
17936    detach: function(type, fn, context) {
17937
17938        var evts = this._yuievt.events,
17939            i,
17940            Node = Y.Node,
17941            isNode = Node && (Y.instanceOf(this, Node));
17942
17943        // detachAll disabled on the Y instance.
17944        if (!type && (this !== Y)) {
17945            for (i in evts) {
17946                if (evts.hasOwnProperty(i)) {
17947                    evts[i].detach(fn, context);
17948                }
17949            }
17950            if (isNode) {
17951                Y.Event.purgeElement(Node.getDOMNode(this));
17952            }
17953
17954            return this;
17955        }
17956
17957        var parts = _parseType(type, this._yuievt.config.prefix),
17958        detachcategory = L.isArray(parts) ? parts[0] : null,
17959        shorttype = (parts) ? parts[3] : null,
17960        adapt, store = Y.Env.evt.handles, detachhost, cat, args,
17961        ce,
17962
17963        keyDetacher = function(lcat, ltype, host) {
17964            var handles = lcat[ltype], ce, i;
17965            if (handles) {
17966                for (i = handles.length - 1; i >= 0; --i) {
17967                    ce = handles[i].evt;
17968                    if (ce.host === host || ce.el === host) {
17969                        handles[i].detach();
17970                    }
17971                }
17972            }
17973        };
17974
17975        if (detachcategory) {
17976
17977            cat = store[detachcategory];
17978            type = parts[1];
17979            detachhost = (isNode) ? Y.Node.getDOMNode(this) : this;
17980
17981            if (cat) {
17982                if (type) {
17983                    keyDetacher(cat, type, detachhost);
17984                } else {
17985                    for (i in cat) {
17986                        if (cat.hasOwnProperty(i)) {
17987                            keyDetacher(cat, i, detachhost);
17988                        }
17989                    }
17990                }
17991
17992                return this;
17993            }
17994
17995        // If this is an event handle, use it to detach
17996        } else if (L.isObject(type) && type.detach) {
17997            type.detach();
17998            return this;
17999        // extra redirection so we catch adaptor events too.  take a look at this.
18000        } else if (isNode && ((!shorttype) || (shorttype in Node.DOM_EVENTS))) {
18001            args = nativeSlice.call(arguments, 0);
18002            args[2] = Node.getDOMNode(this);
18003            Y.detach.apply(Y, args);
18004            return this;
18005        }
18006
18007        adapt = Y.Env.evt.plugins[shorttype];
18008
18009        // The YUI instance handles DOM events and adaptors
18010        if (Y.instanceOf(this, YUI)) {
18011            args = nativeSlice.call(arguments, 0);
18012            // use the adaptor specific detach code if
18013            if (adapt && adapt.detach) {
18014                adapt.detach.apply(Y, args);
18015                return this;
18016            // DOM event fork
18017            } else if (!type || (!adapt && Node && (type in Node.DOM_EVENTS))) {
18018                args[0] = type;
18019                Y.Event.detach.apply(Y.Event, args);
18020                return this;
18021            }
18022        }
18023
18024        // ce = evts[type];
18025        ce = evts[parts[1]];
18026        if (ce) {
18027            ce.detach(fn, context);
18028        }
18029
18030        return this;
18031    },
18032
18033    /**
18034     * detach a listener
18035     * @method unsubscribe
18036     * @deprecated use detach
18037     */
18038    unsubscribe: function() {
18039        return this.detach.apply(this, arguments);
18040    },
18041
18042    /**
18043     * Removes all listeners from the specified event.  If the event type
18044     * is not specified, all listeners from all hosted custom events will
18045     * be removed.
18046     * @method detachAll
18047     * @param type {String}   The type, or name of the event
18048     */
18049    detachAll: function(type) {
18050        return this.detach(type);
18051    },
18052
18053    /**
18054     * Removes all listeners from the specified event.  If the event type
18055     * is not specified, all listeners from all hosted custom events will
18056     * be removed.
18057     * @method unsubscribeAll
18058     * @param type {String}   The type, or name of the event
18059     * @deprecated use detachAll
18060     */
18061    unsubscribeAll: function() {
18062        return this.detachAll.apply(this, arguments);
18063    },
18064
18065    /**
18066     * Creates a new custom event of the specified type.  If a custom event
18067     * by that name already exists, it will not be re-created.  In either
18068     * case the custom event is returned.
18069     *
18070     * @method publish
18071     *
18072     * @param type {String} the type, or name of the event
18073     * @param opts {object} optional config params.  Valid properties are:
18074     * @param [opts.broadcast=false] {Boolean} whether or not the YUI instance and YUI global
18075     *      are notified when the event is fired.
18076     * @param [opts.bubbles=true] {Boolean} Whether or not this event bubbles. Events can
18077     *      only bubble if `emitFacade` is true.
18078     * @param [opts.context=this] {Object} the default execution context for the listeners.
18079     * @param [opts.defaultFn] {Function} the default function to execute when this event
18080     *      fires if preventDefault was not called.
18081     * @param [opts.emitFacade=false] {Boolean} whether or not this event emits a facade.
18082     * @param [opts.prefix] {String} the prefix for this targets events, e.g., 'menu' in 'menu:click'.
18083     * @param [opts.fireOnce=false] {Boolean} if an event is configured to fire once,
18084     *      new subscribers after the fire will be notified immediately.
18085     * @param [opts.async=false] {Boolean} fireOnce event listeners will fire synchronously
18086     *      if the event has already fired unless `async` is `true`.
18087     * @param [opts.preventable=true] {Boolean} whether or not `preventDefault()` has an effect.
18088     * @param [opts.preventedFn] {Function} a function that is executed when `preventDefault()` is called.
18089     * @param [opts.queuable=false] {Boolean} whether or not this event can be queued during bubbling.
18090     * @param [opts.silent] {Boolean} if silent is true, debug messages are not provided for this event.
18091     * @param [opts.stoppedFn] {Function} a function that is executed when stopPropagation is called.
18092     * @param [opts.monitored] {Boolean} specifies whether or not this event should send notifications about
18093     *      when the event has been attached, detached, or published.
18094     * @param [opts.type] {String} the event type (valid option if not provided as the first parameter to publish).
18095     *
18096     * @return {CustomEvent} the custom event
18097     *
18098     */
18099    publish: function(type, opts) {
18100
18101        var ret,
18102            etState = this._yuievt,
18103            etConfig = etState.config,
18104            pre = etConfig.prefix;
18105
18106        if (typeof type === "string")  {
18107            if (pre) {
18108                type = _getType(type, pre);
18109            }
18110            ret = this._publish(type, etConfig, opts);
18111        } else {
18112            ret = {};
18113
18114            Y.each(type, function(v, k) {
18115                if (pre) {
18116                    k = _getType(k, pre);
18117                }
18118                ret[k] = this._publish(k, etConfig, v || opts);
18119            }, this);
18120
18121        }
18122
18123        return ret;
18124    },
18125
18126    /**
18127     * Returns the fully qualified type, given a short type string.
18128     * That is, returns "foo:bar" when given "bar" if "foo" is the configured prefix.
18129     *
18130     * NOTE: This method, unlike _getType, does no checking of the value passed in, and
18131     * is designed to be used with the low level _publish() method, for critical path
18132     * implementations which need to fast-track publish for performance reasons.
18133     *
18134     * @method _getFullType
18135     * @private
18136     * @param {String} type The short type to prefix
18137     * @return {String} The prefixed type, if a prefix is set, otherwise the type passed in
18138     */
18139    _getFullType : function(type) {
18140
18141        var pre = this._yuievt.config.prefix;
18142
18143        if (pre) {
18144            return pre + PREFIX_DELIMITER + type;
18145        } else {
18146            return type;
18147        }
18148    },
18149
18150    /**
18151     * The low level event publish implementation. It expects all the massaging to have been done
18152     * outside of this method. e.g. the `type` to `fullType` conversion. It's designed to be a fast
18153     * path publish, which can be used by critical code paths to improve performance.
18154     *
18155     * @method _publish
18156     * @private
18157     * @param {String} fullType The prefixed type of the event to publish.
18158     * @param {Object} etOpts The EventTarget specific configuration to mix into the published event.
18159     * @param {Object} ceOpts The publish specific configuration to mix into the published event.
18160     * @return {CustomEvent} The published event. If called without `etOpts` or `ceOpts`, this will
18161     * be the default `CustomEvent` instance, and can be configured independently.
18162     */
18163    _publish : function(fullType, etOpts, ceOpts) {
18164
18165        var ce,
18166            etState = this._yuievt,
18167            etConfig = etState.config,
18168            host = etConfig.host,
18169            context = etConfig.context,
18170            events = etState.events;
18171
18172        ce = events[fullType];
18173
18174        // PERF: Hate to pull the check out of monitor, but trying to keep critical path tight.
18175        if ((etConfig.monitored && !ce) || (ce && ce.monitored)) {
18176            this._monitor('publish', fullType, {
18177                args: arguments
18178            });
18179        }
18180
18181        if (!ce) {
18182            // Publish event
18183            ce = events[fullType] = new Y.CustomEvent(fullType, etOpts);
18184
18185            if (!etOpts) {
18186                ce.host = host;
18187                ce.context = context;
18188            }
18189        }
18190
18191        if (ceOpts) {
18192            mixConfigs(ce, ceOpts, true);
18193        }
18194
18195        return ce;
18196    },
18197
18198    /**
18199     * This is the entry point for the event monitoring system.
18200     * You can monitor 'attach', 'detach', 'fire', and 'publish'.
18201     * When configured, these events generate an event.  click ->
18202     * click_attach, click_detach, click_publish -- these can
18203     * be subscribed to like other events to monitor the event
18204     * system.  Inividual published events can have monitoring
18205     * turned on or off (publish can't be turned off before it
18206     * it published) by setting the events 'monitor' config.
18207     *
18208     * @method _monitor
18209     * @param what {String} 'attach', 'detach', 'fire', or 'publish'
18210     * @param eventType {String|CustomEvent} The prefixed name of the event being monitored, or the CustomEvent object.
18211     * @param o {Object} Information about the event interaction, such as
18212     *                  fire() args, subscription category, publish config
18213     * @private
18214     */
18215    _monitor: function(what, eventType, o) {
18216        var monitorevt, ce, type;
18217
18218        if (eventType) {
18219            if (typeof eventType === "string") {
18220                type = eventType;
18221                ce = this.getEvent(eventType, true);
18222            } else {
18223                ce = eventType;
18224                type = eventType.type;
18225            }
18226
18227            if ((this._yuievt.config.monitored && (!ce || ce.monitored)) || (ce && ce.monitored)) {
18228                monitorevt = type + '_' + what;
18229                o.monitored = what;
18230                this.fire.call(this, monitorevt, o);
18231            }
18232        }
18233    },
18234
18235    /**
18236     * Fire a custom event by name.  The callback functions will be executed
18237     * from the context specified when the event was created, and with the
18238     * following parameters.
18239     *
18240     * The first argument is the event type, and any additional arguments are
18241     * passed to the listeners as parameters.  If the first of these is an
18242     * object literal, and the event is configured to emit an event facade,
18243     * that object is mixed into the event facade and the facade is provided
18244     * in place of the original object.
18245     *
18246     * If the custom event object hasn't been created, then the event hasn't
18247     * been published and it has no subscribers.  For performance sake, we
18248     * immediate exit in this case.  This means the event won't bubble, so
18249     * if the intention is that a bubble target be notified, the event must
18250     * be published on this object first.
18251     *
18252     * @method fire
18253     * @param type {String|Object} The type of the event, or an object that contains
18254     * a 'type' property.
18255     * @param arguments {Object*} an arbitrary set of parameters to pass to
18256     * the handler.  If the first of these is an object literal and the event is
18257     * configured to emit an event facade, the event facade will replace that
18258     * parameter after the properties the object literal contains are copied to
18259     * the event facade.
18260     * @return {Boolean} True if the whole lifecycle of the event went through,
18261     * false if at any point the event propagation was halted.
18262     */
18263    fire: function(type) {
18264
18265        var typeIncluded = (typeof type === "string"),
18266            argCount = arguments.length,
18267            t = type,
18268            yuievt = this._yuievt,
18269            etConfig = yuievt.config,
18270            pre = etConfig.prefix,
18271            ret,
18272            ce,
18273            ce2,
18274            args;
18275
18276        if (typeIncluded && argCount <= 3) {
18277
18278            // PERF: Try to avoid slice/iteration for the common signatures
18279
18280            // Most common
18281            if (argCount === 2) {
18282                args = [arguments[1]]; // fire("foo", {})
18283            } else if (argCount === 3) {
18284                args = [arguments[1], arguments[2]]; // fire("foo", {}, opts)
18285            } else {
18286                args = []; // fire("foo")
18287            }
18288
18289        } else {
18290            args = nativeSlice.call(arguments, ((typeIncluded) ? 1 : 0));
18291        }
18292
18293        if (!typeIncluded) {
18294            t = (type && type.type);
18295        }
18296
18297        if (pre) {
18298            t = _getType(t, pre);
18299        }
18300
18301        ce = yuievt.events[t];
18302
18303        if (this._hasSiblings) {
18304            ce2 = this.getSibling(t, ce);
18305
18306            if (ce2 && !ce) {
18307                ce = this.publish(t);
18308            }
18309        }
18310
18311        // PERF: trying to avoid function call, since this is a critical path
18312        if ((etConfig.monitored && (!ce || ce.monitored)) || (ce && ce.monitored)) {
18313            this._monitor('fire', (ce || t), {
18314                args: args
18315            });
18316        }
18317
18318        // this event has not been published or subscribed to
18319        if (!ce) {
18320            if (yuievt.hasTargets) {
18321                return this.bubble({ type: t }, args, this);
18322            }
18323
18324            // otherwise there is nothing to be done
18325            ret = true;
18326        } else {
18327
18328            if (ce2) {
18329                ce.sibling = ce2;
18330            }
18331
18332            ret = ce._fire(args);
18333        }
18334
18335        return (yuievt.chain) ? this : ret;
18336    },
18337
18338    getSibling: function(type, ce) {
18339        var ce2;
18340
18341        // delegate to *:type events if there are subscribers
18342        if (type.indexOf(PREFIX_DELIMITER) > -1) {
18343            type = _wildType(type);
18344            ce2 = this.getEvent(type, true);
18345            if (ce2) {
18346                ce2.applyConfig(ce);
18347                ce2.bubbles = false;
18348                ce2.broadcast = 0;
18349            }
18350        }
18351
18352        return ce2;
18353    },
18354
18355    /**
18356     * Returns the custom event of the provided type has been created, a
18357     * falsy value otherwise
18358     * @method getEvent
18359     * @param type {String} the type, or name of the event
18360     * @param prefixed {String} if true, the type is prefixed already
18361     * @return {CustomEvent} the custom event or null
18362     */
18363    getEvent: function(type, prefixed) {
18364        var pre, e;
18365
18366        if (!prefixed) {
18367            pre = this._yuievt.config.prefix;
18368            type = (pre) ? _getType(type, pre) : type;
18369        }
18370        e = this._yuievt.events;
18371        return e[type] || null;
18372    },
18373
18374    /**
18375     * Subscribe to a custom event hosted by this object.  The
18376     * supplied callback will execute after any listeners add
18377     * via the subscribe method, and after the default function,
18378     * if configured for the event, has executed.
18379     *
18380     * @method after
18381     * @param {String} type The name of the event
18382     * @param {Function} fn The callback to execute in response to the event
18383     * @param {Object} [context] Override `this` object in callback
18384     * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber
18385     * @return {EventHandle} A subscription handle capable of detaching the
18386     *                       subscription
18387     */
18388    after: function(type, fn) {
18389
18390        var a = nativeSlice.call(arguments, 0);
18391
18392        switch (L.type(type)) {
18393            case 'function':
18394                return Y.Do.after.apply(Y.Do, arguments);
18395            case 'array':
18396            //     YArray.each(a[0], function(v) {
18397            //         v = AFTER_PREFIX + v;
18398            //     });
18399            //     break;
18400            case 'object':
18401                a[0]._after = true;
18402                break;
18403            default:
18404                a[0] = AFTER_PREFIX + type;
18405        }
18406
18407        return this.on.apply(this, a);
18408
18409    },
18410
18411    /**
18412     * Executes the callback before a DOM event, custom event
18413     * or method.  If the first argument is a function, it
18414     * is assumed the target is a method.  For DOM and custom
18415     * events, this is an alias for Y.on.
18416     *
18417     * For DOM and custom events:
18418     * type, callback, context, 0-n arguments
18419     *
18420     * For methods:
18421     * callback, object (method host), methodName, context, 0-n arguments
18422     *
18423     * @method before
18424     * @return detach handle
18425     */
18426    before: function() {
18427        return this.on.apply(this, arguments);
18428    }
18429
18430};
18431
18432Y.EventTarget = ET;
18433
18434// make Y an event target
18435Y.mix(Y, ET.prototype);
18436ET.call(Y, { bubbles: false });
18437
18438YUI.Env.globalEvents = YUI.Env.globalEvents || new ET();
18439
18440/**
18441 * Hosts YUI page level events.  This is where events bubble to
18442 * when the broadcast config is set to 2.  This property is
18443 * only available if the custom event module is loaded.
18444 * @property Global
18445 * @type EventTarget
18446 * @for YUI
18447 */
18448Y.Global = YUI.Env.globalEvents;
18449
18450// @TODO implement a global namespace function on Y.Global?
18451
18452/**
18453`Y.on()` can do many things:
18454
18455<ul>
18456    <li>Subscribe to custom events `publish`ed and `fire`d from Y</li>
18457    <li>Subscribe to custom events `publish`ed with `broadcast` 1 or 2 and
18458        `fire`d from any object in the YUI instance sandbox</li>
18459    <li>Subscribe to DOM events</li>
18460    <li>Subscribe to the execution of a method on any object, effectively
18461    treating that method as an event</li>
18462</ul>
18463
18464For custom event subscriptions, pass the custom event name as the first argument
18465and callback as the second. The `this` object in the callback will be `Y` unless
18466an override is passed as the third argument.
18467
18468    Y.on('io:complete', function () {
18469        Y.MyApp.updateStatus('Transaction complete');
18470    });
18471
18472To subscribe to DOM events, pass the name of a DOM event as the first argument
18473and a CSS selector string as the third argument after the callback function.
18474Alternately, the third argument can be a `Node`, `NodeList`, `HTMLElement`,
18475array, or simply omitted (the default is the `window` object).
18476
18477    Y.on('click', function (e) {
18478        e.preventDefault();
18479
18480        // proceed with ajax form submission
18481        var url = this.get('action');
18482        ...
18483    }, '#my-form');
18484
18485The `this` object in DOM event callbacks will be the `Node` targeted by the CSS
18486selector or other identifier.
18487
18488`on()` subscribers for DOM events or custom events `publish`ed with a
18489`defaultFn` can prevent the default behavior with `e.preventDefault()` from the
18490event object passed as the first parameter to the subscription callback.
18491
18492To subscribe to the execution of an object method, pass arguments corresponding to the call signature for
18493<a href="../classes/Do.html#methods_before">`Y.Do.before(...)`</a>.
18494
18495NOTE: The formal parameter list below is for events, not for function
18496injection.  See `Y.Do.before` for that signature.
18497
18498@method on
18499@param {String} type DOM or custom event name
18500@param {Function} fn The callback to execute in response to the event
18501@param {Object} [context] Override `this` object in callback
18502@param {Any} [arg*] 0..n additional arguments to supply to the subscriber
18503@return {EventHandle} A subscription handle capable of detaching the
18504                      subscription
18505@see Do.before
18506@for YUI
18507**/
18508
18509/**
18510Listen for an event one time.  Equivalent to `on()`, except that
18511the listener is immediately detached when executed.
18512
18513See the <a href="#methods_on">`on()` method</a> for additional subscription
18514options.
18515
18516@see on
18517@method once
18518@param {String} type DOM or custom event name
18519@param {Function} fn The callback to execute in response to the event
18520@param {Object} [context] Override `this` object in callback
18521@param {Any} [arg*] 0..n additional arguments to supply to the subscriber
18522@return {EventHandle} A subscription handle capable of detaching the
18523                      subscription
18524@for YUI
18525**/
18526
18527/**
18528Listen for an event one time.  Equivalent to `once()`, except, like `after()`,
18529the subscription callback executes after all `on()` subscribers and the event's
18530`defaultFn` (if configured) have executed.  Like `after()` if any `on()` phase
18531subscriber calls `e.preventDefault()`, neither the `defaultFn` nor the `after()`
18532subscribers will execute.
18533
18534The listener is immediately detached when executed.
18535
18536See the <a href="#methods_on">`on()` method</a> for additional subscription
18537options.
18538
18539@see once
18540@method onceAfter
18541@param {String} type The custom event name
18542@param {Function} fn The callback to execute in response to the event
18543@param {Object} [context] Override `this` object in callback
18544@param {Any} [arg*] 0..n additional arguments to supply to the subscriber
18545@return {EventHandle} A subscription handle capable of detaching the
18546                      subscription
18547@for YUI
18548**/
18549
18550/**
18551Like `on()`, this method creates a subscription to a custom event or to the
18552execution of a method on an object.
18553
18554For events, `after()` subscribers are executed after the event's
18555`defaultFn` unless `e.preventDefault()` was called from an `on()` subscriber.
18556
18557See the <a href="#methods_on">`on()` method</a> for additional subscription
18558options.
18559
18560NOTE: The subscription signature shown is for events, not for function
18561injection.  See <a href="../classes/Do.html#methods_after">`Y.Do.after`</a>
18562for that signature.
18563
18564@see on
18565@see Do.after
18566@method after
18567@param {String} type The custom event name
18568@param {Function} fn The callback to execute in response to the event
18569@param {Object} [context] Override `this` object in callback
18570@param {Any} [args*] 0..n additional arguments to supply to the subscriber
18571@return {EventHandle} A subscription handle capable of detaching the
18572                      subscription
18573@for YUI
18574**/
18575
18576
18577}, 'patched-v3.18.3', {"requires": ["oop"]});
18578
18579YUI.add('event-custom-complex', function (Y, NAME) {
18580
18581
18582/**
18583 * Adds event facades, preventable default behavior, and bubbling.
18584 * events.
18585 * @module event-custom
18586 * @submodule event-custom-complex
18587 */
18588
18589var FACADE,
18590    FACADE_KEYS,
18591    YObject = Y.Object,
18592    key,
18593    EMPTY = {},
18594    CEProto = Y.CustomEvent.prototype,
18595    ETProto = Y.EventTarget.prototype,
18596
18597    mixFacadeProps = function(facade, payload) {
18598        var p;
18599
18600        for (p in payload) {
18601            if (!(FACADE_KEYS.hasOwnProperty(p))) {
18602                facade[p] = payload[p];
18603            }
18604        }
18605    };
18606
18607/**
18608 * Wraps and protects a custom event for use when emitFacade is set to true.
18609 * Requires the event-custom-complex module
18610 * @class EventFacade
18611 * @param e {Event} the custom event
18612 * @param currentTarget {HTMLElement} the element the listener was attached to
18613 */
18614
18615Y.EventFacade = function(e, currentTarget) {
18616
18617    if (!e) {
18618        e = EMPTY;
18619    }
18620
18621    this._event = e;
18622
18623    /**
18624     * The arguments passed to fire
18625     * @property details
18626     * @type Array
18627     */
18628    this.details = e.details;
18629
18630    /**
18631     * The event type, this can be overridden by the fire() payload
18632     * @property type
18633     * @type string
18634     */
18635    this.type = e.type;
18636
18637    /**
18638     * The real event type
18639     * @property _type
18640     * @type string
18641     * @private
18642     */
18643    this._type = e.type;
18644
18645    //////////////////////////////////////////////////////
18646
18647    /**
18648     * Node reference for the targeted eventtarget
18649     * @property target
18650     * @type Node
18651     */
18652    this.target = e.target;
18653
18654    /**
18655     * Node reference for the element that the listener was attached to.
18656     * @property currentTarget
18657     * @type Node
18658     */
18659    this.currentTarget = currentTarget;
18660
18661    /**
18662     * Node reference to the relatedTarget
18663     * @property relatedTarget
18664     * @type Node
18665     */
18666    this.relatedTarget = e.relatedTarget;
18667
18668};
18669
18670Y.mix(Y.EventFacade.prototype, {
18671
18672    /**
18673     * Stops the propagation to the next bubble target
18674     * @method stopPropagation
18675     */
18676    stopPropagation: function() {
18677        this._event.stopPropagation();
18678        this.stopped = 1;
18679    },
18680
18681    /**
18682     * Stops the propagation to the next bubble target and
18683     * prevents any additional listeners from being exectued
18684     * on the current target.
18685     * @method stopImmediatePropagation
18686     */
18687    stopImmediatePropagation: function() {
18688        this._event.stopImmediatePropagation();
18689        this.stopped = 2;
18690    },
18691
18692    /**
18693     * Prevents the event's default behavior
18694     * @method preventDefault
18695     */
18696    preventDefault: function() {
18697        this._event.preventDefault();
18698        this.prevented = 1;
18699    },
18700
18701    /**
18702     * Stops the event propagation and prevents the default
18703     * event behavior.
18704     * @method halt
18705     * @param immediate {boolean} if true additional listeners
18706     * on the current target will not be executed
18707     */
18708    halt: function(immediate) {
18709        this._event.halt(immediate);
18710        this.prevented = 1;
18711        this.stopped = (immediate) ? 2 : 1;
18712    }
18713
18714});
18715
18716CEProto.fireComplex = function(args) {
18717
18718    var es,
18719        ef,
18720        q,
18721        queue,
18722        ce,
18723        ret = true,
18724        events,
18725        subs,
18726        ons,
18727        afters,
18728        afterQueue,
18729        postponed,
18730        prevented,
18731        preventedFn,
18732        defaultFn,
18733        self = this,
18734        host = self.host || self,
18735        next,
18736        oldbubble,
18737        stack = self.stack,
18738        yuievt = host._yuievt,
18739        hasPotentialSubscribers;
18740
18741    if (stack) {
18742
18743        // queue this event if the current item in the queue bubbles
18744        if (self.queuable && self.type !== stack.next.type) {
18745
18746            if (!stack.queue) {
18747                stack.queue = [];
18748            }
18749            stack.queue.push([self, args]);
18750
18751            return true;
18752        }
18753    }
18754
18755    hasPotentialSubscribers = self.hasSubs() || yuievt.hasTargets || self.broadcast;
18756
18757    self.target = self.target || host;
18758    self.currentTarget = host;
18759
18760    self.details = args.concat();
18761
18762    if (hasPotentialSubscribers) {
18763
18764        es = stack || {
18765
18766           id: self.id, // id of the first event in the stack
18767           next: self,
18768           silent: self.silent,
18769           stopped: 0,
18770           prevented: 0,
18771           bubbling: null,
18772           type: self.type,
18773           // defaultFnQueue: new Y.Queue(),
18774           defaultTargetOnly: self.defaultTargetOnly
18775
18776        };
18777
18778        subs = self.getSubs();
18779        ons = subs[0];
18780        afters = subs[1];
18781
18782        self.stopped = (self.type !== es.type) ? 0 : es.stopped;
18783        self.prevented = (self.type !== es.type) ? 0 : es.prevented;
18784
18785        if (self.stoppedFn) {
18786            // PERF TODO: Can we replace with callback, like preventedFn. Look into history
18787            events = new Y.EventTarget({
18788                fireOnce: true,
18789                context: host
18790            });
18791            self.events = events;
18792            events.on('stopped', self.stoppedFn);
18793        }
18794
18795
18796        self._facade = null; // kill facade to eliminate stale properties
18797
18798        ef = self._createFacade(args);
18799
18800        if (ons) {
18801            self._procSubs(ons, args, ef);
18802        }
18803
18804        // bubble if this is hosted in an event target and propagation has not been stopped
18805        if (self.bubbles && host.bubble && !self.stopped) {
18806            oldbubble = es.bubbling;
18807
18808            es.bubbling = self.type;
18809
18810            if (es.type !== self.type) {
18811                es.stopped = 0;
18812                es.prevented = 0;
18813            }
18814
18815            ret = host.bubble(self, args, null, es);
18816
18817            self.stopped = Math.max(self.stopped, es.stopped);
18818            self.prevented = Math.max(self.prevented, es.prevented);
18819
18820            es.bubbling = oldbubble;
18821        }
18822
18823        prevented = self.prevented;
18824
18825        if (prevented) {
18826            preventedFn = self.preventedFn;
18827            if (preventedFn) {
18828                preventedFn.apply(host, args);
18829            }
18830        } else {
18831            defaultFn = self.defaultFn;
18832
18833            if (defaultFn && ((!self.defaultTargetOnly && !es.defaultTargetOnly) || host === ef.target)) {
18834                defaultFn.apply(host, args);
18835            }
18836        }
18837
18838        // broadcast listeners are fired as discreet events on the
18839        // YUI instance and potentially the YUI global.
18840        if (self.broadcast) {
18841            self._broadcast(args);
18842        }
18843
18844        if (afters && !self.prevented && self.stopped < 2) {
18845
18846            // Queue the after
18847            afterQueue = es.afterQueue;
18848
18849            if (es.id === self.id || self.type !== yuievt.bubbling) {
18850
18851                self._procSubs(afters, args, ef);
18852
18853                if (afterQueue) {
18854                    while ((next = afterQueue.last())) {
18855                        next();
18856                    }
18857                }
18858            } else {
18859                postponed = afters;
18860
18861                if (es.execDefaultCnt) {
18862                    postponed = Y.merge(postponed);
18863
18864                    Y.each(postponed, function(s) {
18865                        s.postponed = true;
18866                    });
18867                }
18868
18869                if (!afterQueue) {
18870                    es.afterQueue = new Y.Queue();
18871                }
18872
18873                es.afterQueue.add(function() {
18874                    self._procSubs(postponed, args, ef);
18875                });
18876            }
18877
18878        }
18879
18880        self.target = null;
18881
18882        if (es.id === self.id) {
18883
18884            queue = es.queue;
18885
18886            if (queue) {
18887                while (queue.length) {
18888                    q = queue.pop();
18889                    ce = q[0];
18890                    // set up stack to allow the next item to be processed
18891                    es.next = ce;
18892                    ce._fire(q[1]);
18893                }
18894            }
18895
18896            self.stack = null;
18897        }
18898
18899        ret = !(self.stopped);
18900
18901        if (self.type !== yuievt.bubbling) {
18902            es.stopped = 0;
18903            es.prevented = 0;
18904            self.stopped = 0;
18905            self.prevented = 0;
18906        }
18907
18908    } else {
18909        defaultFn = self.defaultFn;
18910
18911        if(defaultFn) {
18912            ef = self._createFacade(args);
18913
18914            if ((!self.defaultTargetOnly) || (host === ef.target)) {
18915                defaultFn.apply(host, args);
18916            }
18917        }
18918    }
18919
18920    // Kill the cached facade to free up memory.
18921    // Otherwise we have the facade from the last fire, sitting around forever.
18922    self._facade = null;
18923
18924    return ret;
18925};
18926
18927/**
18928 * @method _hasPotentialSubscribers
18929 * @for CustomEvent
18930 * @private
18931 * @return {boolean} Whether the event has potential subscribers or not
18932 */
18933CEProto._hasPotentialSubscribers = function() {
18934    return this.hasSubs() || this.host._yuievt.hasTargets || this.broadcast;
18935};
18936
18937/**
18938 * Internal utility method to create a new facade instance and
18939 * insert it into the fire argument list, accounting for any payload
18940 * merging which needs to happen.
18941 *
18942 * This used to be called `_getFacade`, but the name seemed inappropriate
18943 * when it was used without a need for the return value.
18944 *
18945 * @method _createFacade
18946 * @private
18947 * @param fireArgs {Array} The arguments passed to "fire", which need to be
18948 * shifted (and potentially merged) when the facade is added.
18949 * @return {EventFacade} The event facade created.
18950 */
18951
18952// TODO: Remove (private) _getFacade alias, once synthetic.js is updated.
18953CEProto._createFacade = CEProto._getFacade = function(fireArgs) {
18954
18955    var userArgs = this.details,
18956        firstArg = userArgs && userArgs[0],
18957        firstArgIsObj = (firstArg && (typeof firstArg === "object")),
18958        ef = this._facade;
18959
18960    if (!ef) {
18961        ef = new Y.EventFacade(this, this.currentTarget);
18962    }
18963
18964    if (firstArgIsObj) {
18965        // protect the event facade properties
18966        mixFacadeProps(ef, firstArg);
18967
18968        // Allow the event type to be faked http://yuilibrary.com/projects/yui3/ticket/2528376
18969        if (firstArg.type) {
18970            ef.type = firstArg.type;
18971        }
18972
18973        if (fireArgs) {
18974            fireArgs[0] = ef;
18975        }
18976    } else {
18977        if (fireArgs) {
18978            fireArgs.unshift(ef);
18979        }
18980    }
18981
18982    // update the details field with the arguments
18983    ef.details = this.details;
18984
18985    // use the original target when the event bubbled to this target
18986    ef.target = this.originalTarget || this.target;
18987
18988    ef.currentTarget = this.currentTarget;
18989    ef.stopped = 0;
18990    ef.prevented = 0;
18991
18992    this._facade = ef;
18993
18994    return this._facade;
18995};
18996
18997/**
18998 * Utility method to manipulate the args array passed in, to add the event facade,
18999 * if it's not already the first arg.
19000 *
19001 * @method _addFacadeToArgs
19002 * @private
19003 * @param {Array} The arguments to manipulate
19004 */
19005CEProto._addFacadeToArgs = function(args) {
19006    var e = args[0];
19007
19008    // Trying not to use instanceof, just to avoid potential cross Y edge case issues.
19009    if (!(e && e.halt && e.stopImmediatePropagation && e.stopPropagation && e._event)) {
19010        this._createFacade(args);
19011    }
19012};
19013
19014/**
19015 * Stop propagation to bubble targets
19016 * @for CustomEvent
19017 * @method stopPropagation
19018 */
19019CEProto.stopPropagation = function() {
19020    this.stopped = 1;
19021    if (this.stack) {
19022        this.stack.stopped = 1;
19023    }
19024    if (this.events) {
19025        this.events.fire('stopped', this);
19026    }
19027};
19028
19029/**
19030 * Stops propagation to bubble targets, and prevents any remaining
19031 * subscribers on the current target from executing.
19032 * @method stopImmediatePropagation
19033 */
19034CEProto.stopImmediatePropagation = function() {
19035    this.stopped = 2;
19036    if (this.stack) {
19037        this.stack.stopped = 2;
19038    }
19039    if (this.events) {
19040        this.events.fire('stopped', this);
19041    }
19042};
19043
19044/**
19045 * Prevents the execution of this event's defaultFn
19046 * @method preventDefault
19047 */
19048CEProto.preventDefault = function() {
19049    if (this.preventable) {
19050        this.prevented = 1;
19051        if (this.stack) {
19052            this.stack.prevented = 1;
19053        }
19054    }
19055};
19056
19057/**
19058 * Stops the event propagation and prevents the default
19059 * event behavior.
19060 * @method halt
19061 * @param immediate {boolean} if true additional listeners
19062 * on the current target will not be executed
19063 */
19064CEProto.halt = function(immediate) {
19065    if (immediate) {
19066        this.stopImmediatePropagation();
19067    } else {
19068        this.stopPropagation();
19069    }
19070    this.preventDefault();
19071};
19072
19073/**
19074 * Registers another EventTarget as a bubble target.  Bubble order
19075 * is determined by the order registered.  Multiple targets can
19076 * be specified.
19077 *
19078 * Events can only bubble if emitFacade is true.
19079 *
19080 * Included in the event-custom-complex submodule.
19081 *
19082 * @method addTarget
19083 * @chainable
19084 * @param o {EventTarget} the target to add
19085 * @for EventTarget
19086 */
19087ETProto.addTarget = function(o) {
19088    var etState = this._yuievt;
19089
19090    if (!etState.targets) {
19091        etState.targets = {};
19092    }
19093
19094    etState.targets[Y.stamp(o)] = o;
19095    etState.hasTargets = true;
19096
19097    return this;
19098};
19099
19100/**
19101 * Returns an array of bubble targets for this object.
19102 * @method getTargets
19103 * @return EventTarget[]
19104 */
19105ETProto.getTargets = function() {
19106    var targets = this._yuievt.targets;
19107    return targets ? YObject.values(targets) : [];
19108};
19109
19110/**
19111 * Removes a bubble target
19112 * @method removeTarget
19113 * @chainable
19114 * @param o {EventTarget} the target to remove
19115 * @for EventTarget
19116 */
19117ETProto.removeTarget = function(o) {
19118    var targets = this._yuievt.targets;
19119
19120    if (targets) {
19121        delete targets[Y.stamp(o, true)];
19122
19123        if (YObject.size(targets) === 0) {
19124            this._yuievt.hasTargets = false;
19125        }
19126    }
19127
19128    return this;
19129};
19130
19131/**
19132 * Propagate an event.  Requires the event-custom-complex module.
19133 * @method bubble
19134 * @param evt {CustomEvent} the custom event to propagate
19135 * @return {boolean} the aggregated return value from Event.Custom.fire
19136 * @for EventTarget
19137 */
19138ETProto.bubble = function(evt, args, target, es) {
19139
19140    var targs = this._yuievt.targets,
19141        ret = true,
19142        t,
19143        ce,
19144        i,
19145        bc,
19146        ce2,
19147        type = evt && evt.type,
19148        originalTarget = target || (evt && evt.target) || this,
19149        oldbubble;
19150
19151    if (!evt || ((!evt.stopped) && targs)) {
19152
19153        for (i in targs) {
19154            if (targs.hasOwnProperty(i)) {
19155
19156                t = targs[i];
19157
19158                ce = t._yuievt.events[type];
19159
19160                if (t._hasSiblings) {
19161                    ce2 = t.getSibling(type, ce);
19162                }
19163
19164                if (ce2 && !ce) {
19165                    ce = t.publish(type);
19166                }
19167
19168                oldbubble = t._yuievt.bubbling;
19169                t._yuievt.bubbling = type;
19170
19171                // if this event was not published on the bubble target,
19172                // continue propagating the event.
19173                if (!ce) {
19174                    if (t._yuievt.hasTargets) {
19175                        t.bubble(evt, args, originalTarget, es);
19176                    }
19177                } else {
19178
19179                    if (ce2) {
19180                        ce.sibling = ce2;
19181                    }
19182
19183                    // set the original target to that the target payload on the facade is correct.
19184                    ce.target = originalTarget;
19185                    ce.originalTarget = originalTarget;
19186                    ce.currentTarget = t;
19187                    bc = ce.broadcast;
19188                    ce.broadcast = false;
19189
19190                    // default publish may not have emitFacade true -- that
19191                    // shouldn't be what the implementer meant to do
19192                    ce.emitFacade = true;
19193
19194                    ce.stack = es;
19195
19196                    // TODO: See what's getting in the way of changing this to use
19197                    // the more performant ce._fire(args || evt.details || []).
19198
19199                    // Something in Widget Parent/Child tests is not happy if we
19200                    // change it - maybe evt.details related?
19201                    ret = ret && ce.fire.apply(ce, args || evt.details || []);
19202
19203                    ce.broadcast = bc;
19204                    ce.originalTarget = null;
19205
19206                    // stopPropagation() was called
19207                    if (ce.stopped) {
19208                        break;
19209                    }
19210                }
19211
19212                t._yuievt.bubbling = oldbubble;
19213            }
19214        }
19215    }
19216
19217    return ret;
19218};
19219
19220/**
19221 * @method _hasPotentialSubscribers
19222 * @for EventTarget
19223 * @private
19224 * @param {String} fullType The fully prefixed type name
19225 * @return {boolean} Whether the event has potential subscribers or not
19226 */
19227ETProto._hasPotentialSubscribers = function(fullType) {
19228
19229    var etState = this._yuievt,
19230        e = etState.events[fullType];
19231
19232    if (e) {
19233        return e.hasSubs() || etState.hasTargets  || e.broadcast;
19234    } else {
19235        return false;
19236    }
19237};
19238
19239FACADE = new Y.EventFacade();
19240FACADE_KEYS = {};
19241
19242// Flatten whitelist
19243for (key in FACADE) {
19244    FACADE_KEYS[key] = true;
19245}
19246
19247
19248}, 'patched-v3.18.3', {"requires": ["event-custom-base"]});
19249
19250YUI.add('oop', function (Y, NAME) {
19251
19252/**
19253Adds object inheritance and manipulation utilities to the YUI instance. This
19254module is required by most YUI components.
19255
19256@module oop
19257**/
19258
19259var L            = Y.Lang,
19260    A            = Y.Array,
19261    OP           = Object.prototype,
19262    CLONE_MARKER = '_~yuim~_',
19263
19264    hasOwn   = OP.hasOwnProperty,
19265    toString = OP.toString;
19266
19267/**
19268Calls the specified _action_ method on _o_ if it exists. Otherwise, if _o_ is an
19269array, calls the _action_ method on `Y.Array`, or if _o_ is an object, calls the
19270_action_ method on `Y.Object`.
19271
19272If _o_ is an array-like object, it will be coerced to an array.
19273
19274This is intended to be used with array/object iteration methods that share
19275signatures, such as `each()`, `some()`, etc.
19276
19277@method dispatch
19278@param {Object} o Array or object to dispatch to.
19279@param {Function} f Iteration callback.
19280    @param {Mixed} f.value Value being iterated.
19281    @param {Mixed} f.key Current object key or array index.
19282    @param {Mixed} f.object Object or array being iterated.
19283@param {Object} c `this` object to bind the iteration callback to.
19284@param {Boolean} proto If `true`, prototype properties of objects will be
19285    iterated.
19286@param {String} action Function name to be dispatched on _o_. For example:
19287    'some', 'each', etc.
19288@private
19289@return {Mixed} Returns the value returned by the chosen iteration action, which
19290    varies.
19291**/
19292function dispatch(o, f, c, proto, action) {
19293    if (o && o[action] && o !== Y) {
19294        return o[action].call(o, f, c);
19295    } else {
19296        switch (A.test(o)) {
19297            case 1:
19298                return A[action](o, f, c);
19299            case 2:
19300                return A[action](Y.Array(o, 0, true), f, c);
19301            default:
19302                return Y.Object[action](o, f, c, proto);
19303        }
19304    }
19305}
19306
19307/**
19308Augments the _receiver_ with prototype properties from the _supplier_. The
19309receiver may be a constructor function or an object. The supplier must be a
19310constructor function.
19311
19312If the _receiver_ is an object, then the _supplier_ constructor will be called
19313immediately after _receiver_ is augmented, with _receiver_ as the `this` object.
19314
19315If the _receiver_ is a constructor function, then all prototype methods of
19316_supplier_ that are copied to _receiver_ will be sequestered, and the
19317_supplier_ constructor will not be called immediately. The first time any
19318sequestered method is called on the _receiver_'s prototype, all sequestered
19319methods will be immediately copied to the _receiver_'s prototype, the
19320_supplier_'s constructor will be executed, and finally the newly unsequestered
19321method that was called will be executed.
19322
19323This sequestering logic sounds like a bunch of complicated voodoo, but it makes
19324it cheap to perform frequent augmentation by ensuring that suppliers'
19325constructors are only called if a supplied method is actually used. If none of
19326the supplied methods is ever used, then there's no need to take the performance
19327hit of calling the _supplier_'s constructor.
19328
19329@method augment
19330@param {Function|Object} receiver Object or function to be augmented.
19331@param {Function} supplier Function that supplies the prototype properties with
19332  which to augment the _receiver_.
19333@param {Boolean} [overwrite=false] If `true`, properties already on the receiver
19334  will be overwritten if found on the supplier's prototype.
19335@param {String[]} [whitelist] An array of property names. If specified,
19336  only the whitelisted prototype properties will be applied to the receiver, and
19337  all others will be ignored.
19338@param {Array|any} [args] Argument or array of arguments to pass to the
19339  supplier's constructor when initializing.
19340@return {Function} Augmented object.
19341@for YUI
19342**/
19343Y.augment = function (receiver, supplier, overwrite, whitelist, args) {
19344    var rProto    = receiver.prototype,
19345        sequester = rProto && supplier,
19346        sProto    = supplier.prototype,
19347        to        = rProto || receiver,
19348
19349        copy,
19350        newPrototype,
19351        replacements,
19352        sequestered,
19353        unsequester;
19354
19355    args = args ? Y.Array(args) : [];
19356
19357    if (sequester) {
19358        newPrototype = {};
19359        replacements = {};
19360        sequestered  = {};
19361
19362        copy = function (value, key) {
19363            if (overwrite || !(key in rProto)) {
19364                if (toString.call(value) === '[object Function]') {
19365                    sequestered[key] = value;
19366
19367                    newPrototype[key] = replacements[key] = function () {
19368                        return unsequester(this, value, arguments);
19369                    };
19370                } else {
19371                    newPrototype[key] = value;
19372                }
19373            }
19374        };
19375
19376        unsequester = function (instance, fn, fnArgs) {
19377            // Unsequester all sequestered functions.
19378            for (var key in sequestered) {
19379                if (hasOwn.call(sequestered, key)
19380                        && instance[key] === replacements[key]) {
19381
19382                    instance[key] = sequestered[key];
19383                }
19384            }
19385
19386            // Execute the supplier constructor.
19387            supplier.apply(instance, args);
19388
19389            // Finally, execute the original sequestered function.
19390            return fn.apply(instance, fnArgs);
19391        };
19392
19393        if (whitelist) {
19394            Y.Array.each(whitelist, function (name) {
19395                if (name in sProto) {
19396                    copy(sProto[name], name);
19397                }
19398            });
19399        } else {
19400            Y.Object.each(sProto, copy, null, true);
19401        }
19402    }
19403
19404    Y.mix(to, newPrototype || sProto, overwrite, whitelist);
19405
19406    if (!sequester) {
19407        supplier.apply(to, args);
19408    }
19409
19410    return receiver;
19411};
19412
19413/**
19414 * Copies object properties from the supplier to the receiver. If the target has
19415 * the property, and the property is an object, the target object will be
19416 * augmented with the supplier's value.
19417 *
19418 * @method aggregate
19419 * @param {Object} receiver Object to receive the augmentation.
19420 * @param {Object} supplier Object that supplies the properties with which to
19421 *     augment the receiver.
19422 * @param {Boolean} [overwrite=false] If `true`, properties already on the receiver
19423 *     will be overwritten if found on the supplier.
19424 * @param {String[]} [whitelist] Whitelist. If supplied, only properties in this
19425 *     list will be applied to the receiver.
19426 * @return {Object} Augmented object.
19427 */
19428Y.aggregate = function(r, s, ov, wl) {
19429    return Y.mix(r, s, ov, wl, 0, true);
19430};
19431
19432/**
19433 * Utility to set up the prototype, constructor and superclass properties to
19434 * support an inheritance strategy that can chain constructors and methods.
19435 * Static members will not be inherited.
19436 *
19437 * @method extend
19438 * @param {function} r   the object to modify.
19439 * @param {function} s the object to inherit.
19440 * @param {object} px prototype properties to add/override.
19441 * @param {object} sx static properties to add/override.
19442 * @return {object} the extended object.
19443 */
19444Y.extend = function(r, s, px, sx) {
19445    if (!s || !r) {
19446        Y.error('extend failed, verify dependencies');
19447    }
19448
19449    var sp = s.prototype, rp = Y.Object(sp);
19450    r.prototype = rp;
19451
19452    rp.constructor = r;
19453    r.superclass = sp;
19454
19455    // assign constructor property
19456    if (s != Object && sp.constructor == OP.constructor) {
19457        sp.constructor = s;
19458    }
19459
19460    // add prototype overrides
19461    if (px) {
19462        Y.mix(rp, px, true);
19463    }
19464
19465    // add object overrides
19466    if (sx) {
19467        Y.mix(r, sx, true);
19468    }
19469
19470    return r;
19471};
19472
19473/**
19474 * Executes the supplied function for each item in
19475 * a collection.  Supports arrays, objects, and
19476 * NodeLists
19477 * @method each
19478 * @param {object} o the object to iterate.
19479 * @param {function} f the function to execute.  This function
19480 * receives the value, key, and object as parameters.
19481 * @param {object} c the execution context for the function.
19482 * @param {boolean} proto if true, prototype properties are
19483 * iterated on objects.
19484 * @return {YUI} the YUI instance.
19485 */
19486Y.each = function(o, f, c, proto) {
19487    return dispatch(o, f, c, proto, 'each');
19488};
19489
19490/**
19491 * Executes the supplied function for each item in
19492 * a collection.  The operation stops if the function
19493 * returns true. Supports arrays, objects, and
19494 * NodeLists.
19495 * @method some
19496 * @param {object} o the object to iterate.
19497 * @param {function} f the function to execute.  This function
19498 * receives the value, key, and object as parameters.
19499 * @param {object} c the execution context for the function.
19500 * @param {boolean} proto if true, prototype properties are
19501 * iterated on objects.
19502 * @return {boolean} true if the function ever returns true,
19503 * false otherwise.
19504 */
19505Y.some = function(o, f, c, proto) {
19506    return dispatch(o, f, c, proto, 'some');
19507};
19508
19509/**
19510Deep object/array copy. Function clones are actually wrappers around the
19511original function. Array-like objects are treated as arrays. Primitives are
19512returned untouched. Optionally, a function can be provided to handle other data
19513types, filter keys, validate values, etc.
19514
19515**Note:** Cloning a non-trivial object is a reasonably heavy operation, due to
19516the need to recursively iterate down non-primitive properties. Clone should be
19517used only when a deep clone down to leaf level properties is explicitly
19518required. This method will also
19519
19520In many cases (for example, when trying to isolate objects used as hashes for
19521configuration properties), a shallow copy, using `Y.merge()` is normally
19522sufficient. If more than one level of isolation is required, `Y.merge()` can be
19523used selectively at each level which needs to be isolated from the original
19524without going all the way to leaf properties.
19525
19526@method clone
19527@param {object} o what to clone.
19528@param {boolean} safe if true, objects will not have prototype items from the
19529    source. If false, they will. In this case, the original is initially
19530    protected, but the clone is not completely immune from changes to the source
19531    object prototype. Also, cloned prototype items that are deleted from the
19532    clone will result in the value of the source prototype being exposed. If
19533    operating on a non-safe clone, items should be nulled out rather than
19534    deleted.
19535@param {function} f optional function to apply to each item in a collection; it
19536    will be executed prior to applying the value to the new object.
19537    Return false to prevent the copy.
19538@param {object} c optional execution context for f.
19539@param {object} owner Owner object passed when clone is iterating an object.
19540    Used to set up context for cloned functions.
19541@param {object} cloned hash of previously cloned objects to avoid multiple
19542    clones.
19543@return {Array|Object} the cloned object.
19544**/
19545Y.clone = function(o, safe, f, c, owner, cloned) {
19546    var o2, marked, stamp;
19547
19548    // Does not attempt to clone:
19549    //
19550    // * Non-typeof-object values, "primitive" values don't need cloning.
19551    //
19552    // * YUI instances, cloning complex object like YUI instances is not
19553    //   advised, this is like cloning the world.
19554    //
19555    // * DOM nodes (#2528250), common host objects like DOM nodes cannot be
19556    //   "subclassed" in Firefox and old versions of IE. Trying to use
19557    //   `Object.create()` or `Y.extend()` on a DOM node will throw an error in
19558    //   these browsers.
19559    //
19560    // Instad, the passed-in `o` will be return as-is when it matches one of the
19561    // above criteria.
19562    if (!L.isObject(o) ||
19563            Y.instanceOf(o, YUI) ||
19564            (o.addEventListener || o.attachEvent)) {
19565
19566        return o;
19567    }
19568
19569    marked = cloned || {};
19570
19571    switch (L.type(o)) {
19572        case 'date':
19573            return new Date(o);
19574        case 'regexp':
19575            // if we do this we need to set the flags too
19576            // return new RegExp(o.source);
19577            return o;
19578        case 'function':
19579            // o2 = Y.bind(o, owner);
19580            // break;
19581            return o;
19582        case 'array':
19583            o2 = [];
19584            break;
19585        default:
19586
19587            // #2528250 only one clone of a given object should be created.
19588            if (o[CLONE_MARKER]) {
19589                return marked[o[CLONE_MARKER]];
19590            }
19591
19592            stamp = Y.guid();
19593
19594            o2 = (safe) ? {} : Y.Object(o);
19595
19596            o[CLONE_MARKER] = stamp;
19597            marked[stamp] = o;
19598    }
19599
19600    Y.each(o, function(v, k) {
19601        if ((k || k === 0) && (!f || (f.call(c || this, v, k, this, o) !== false))) {
19602            if (k !== CLONE_MARKER) {
19603                if (k == 'prototype') {
19604                    // skip the prototype
19605                // } else if (o[k] === o) {
19606                //     this[k] = this;
19607                } else {
19608                    this[k] =
19609                        Y.clone(v, safe, f, c, owner || o, marked);
19610                }
19611            }
19612        }
19613    }, o2);
19614
19615    if (!cloned) {
19616        Y.Object.each(marked, function(v, k) {
19617            if (v[CLONE_MARKER]) {
19618                try {
19619                    delete v[CLONE_MARKER];
19620                } catch (e) {
19621                    v[CLONE_MARKER] = null;
19622                }
19623            }
19624        }, this);
19625        marked = null;
19626    }
19627
19628    return o2;
19629};
19630
19631/**
19632 * Returns a function that will execute the supplied function in the
19633 * supplied object's context, optionally adding any additional
19634 * supplied parameters to the beginning of the arguments collection the
19635 * supplied to the function.
19636 *
19637 * @method bind
19638 * @param {Function|String} f the function to bind, or a function name
19639 * to execute on the context object.
19640 * @param {object} c the execution context.
19641 * @param {any} args* 0..n arguments to include before the arguments the
19642 * function is executed with.
19643 * @return {function} the wrapped function.
19644 */
19645Y.bind = function(f, c) {
19646    var xargs = arguments.length > 2 ?
19647            Y.Array(arguments, 2, true) : null;
19648    return function() {
19649        var fn = L.isString(f) ? c[f] : f,
19650            args = (xargs) ?
19651                xargs.concat(Y.Array(arguments, 0, true)) : arguments;
19652        return fn.apply(c || fn, args);
19653    };
19654};
19655
19656/**
19657 * Returns a function that will execute the supplied function in the
19658 * supplied object's context, optionally adding any additional
19659 * supplied parameters to the end of the arguments the function
19660 * is executed with.
19661 *
19662 * @method rbind
19663 * @param {Function|String} f the function to bind, or a function name
19664 * to execute on the context object.
19665 * @param {object} c the execution context.
19666 * @param {any} args* 0..n arguments to append to the end of
19667 * arguments collection supplied to the function.
19668 * @return {function} the wrapped function.
19669 */
19670Y.rbind = function(f, c) {
19671    var xargs = arguments.length > 2 ? Y.Array(arguments, 2, true) : null;
19672    return function() {
19673        var fn = L.isString(f) ? c[f] : f,
19674            args = (xargs) ?
19675                Y.Array(arguments, 0, true).concat(xargs) : arguments;
19676        return fn.apply(c || fn, args);
19677    };
19678};
19679
19680
19681}, 'patched-v3.18.3', {"requires": ["yui-base"]});
19682
19683YUI.add('aui-base-lang', function (A, NAME) {
19684
19685(function() {
19686    var Lang = A.Lang,
19687        aArray = A.Array,
19688        AObject = A.Object,
19689
19690        isArray = Lang.isArray,
19691        isNumber = Lang.isNumber,
19692        isString = Lang.isString,
19693        isUndefined = Lang.isUndefined,
19694
19695        owns = AObject.owns;
19696
19697    A.fn = function(fn, context, args) {
19698        var wrappedFn,
19699            dynamicLookup;
19700
19701        // Explicitly set function arguments
19702        if (!isNumber(fn)) {
19703            var xargs = arguments;
19704
19705            if (xargs.length > 2) {
19706                xargs = aArray(xargs, 2, true);
19707            }
19708
19709            dynamicLookup = (isString(fn) && context);
19710
19711            wrappedFn = function() {
19712                var method = (!dynamicLookup) ? fn : context[fn];
19713
19714                return method.apply(context || fn, xargs);
19715            };
19716        }
19717        else {
19718            // Set function arity
19719            var argLength = fn;
19720
19721            fn = context;
19722            context = args;
19723            dynamicLookup = (isString(fn) && context);
19724
19725            wrappedFn = function() {
19726                var method = (!dynamicLookup) ? fn : context[fn],
19727                    returnValue;
19728
19729                context = context || method;
19730
19731                if (argLength > 0) {
19732                    returnValue = method.apply(context, aArray(arguments, 0, true).slice(0, argLength));
19733                }
19734                else {
19735                    returnValue = method.call(context);
19736                }
19737
19738                return returnValue;
19739            };
19740        }
19741
19742        return wrappedFn;
19743    };
19744
19745    A.mix(Lang, {
19746        constrain: function(num, min, max) {
19747            return Math.min(Math.max(num, min), max);
19748        },
19749
19750        emptyFn: function() {},
19751
19752        emptyFnFalse: function() {
19753            return false;
19754        },
19755
19756        emptyFnTrue: function() {
19757            return true;
19758        },
19759
19760        isGuid: function(id) {
19761            return String(id).indexOf(A.Env._guidp) === 0;
19762        },
19763
19764        isInteger: function(val) {
19765            return typeof val === 'number' &&
19766                isFinite(val) &&
19767                val > -9007199254740992 &&
19768                val < 9007199254740992 &&
19769                Math.floor(val) === val;
19770        },
19771
19772        isNode: function(val) {
19773            return A.instanceOf(val, A.Node);
19774        },
19775
19776        isNodeList: function(val) {
19777            return A.instanceOf(val, A.NodeList);
19778        },
19779
19780        toFloat: function(value, defaultValue) {
19781            return parseFloat(value) || defaultValue || 0;
19782        },
19783
19784        toInt: function(value, radix, defaultValue) {
19785            return parseInt(value, radix || 10) || defaultValue || 0;
19786        }
19787    });
19788
19789    A.mix(aArray, {
19790        remove: function(a, from, to) {
19791            var rest = a.slice((to || from) + 1 || a.length);
19792            a.length = (from < 0) ? (a.length + from) : from;
19793
19794            return a.push.apply(a, rest);
19795        },
19796
19797        removeItem: function(a, item) {
19798            var index = aArray.indexOf(a, item);
19799
19800            if (index > -1) {
19801                return aArray.remove(a, index);
19802            }
19803
19804            return a;
19805        }
19806    });
19807
19808    var LString = A.namespace('Lang.String'),
19809
19810        DOC = A.config.doc,
19811        REGEX_DASH = /-([a-z])/gi,
19812        REGEX_ESCAPE_REGEX = /([.*+?^$(){}|[\]\/\\])/g,
19813        REGEX_NL2BR = /\r?\n/g,
19814        REGEX_STRIP_SCRIPTS = /(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/gi,
19815        REGEX_STRIP_TAGS = /<\/?[^>]+>/gi,
19816        REGEX_UNCAMELIZE = /([a-zA-Z][a-zA-Z])([A-Z])([a-z])/g,
19817        REGEX_UNCAMELIZE_REPLACE_SEPARATOR = /([a-z])([A-Z])/g,
19818        STR_ELLIPSIS = '...',
19819
19820        htmlUnescapedValues = [],
19821
19822        MAP_HTML_CHARS_ESCAPED = {
19823            '&': '&amp;',
19824            '<': '&lt;',
19825            '>': '&gt;',
19826            '"': '&#034;',
19827            '\'': '&#039;',
19828            '/': '&#047;',
19829            '`': '&#096;'
19830        },
19831        htmlChar,
19832        MAP_HTML_CHARS_UNESCAPED = {};
19833
19834    for (htmlChar in MAP_HTML_CHARS_ESCAPED) {
19835        if (MAP_HTML_CHARS_ESCAPED.hasOwnProperty(htmlChar)) {
19836            var escapedValue = MAP_HTML_CHARS_ESCAPED[htmlChar];
19837
19838            MAP_HTML_CHARS_UNESCAPED[escapedValue] = htmlChar;
19839
19840            htmlUnescapedValues.push(htmlChar);
19841        }
19842    }
19843
19844    var REGEX_HTML_ESCAPE = new RegExp('[' + htmlUnescapedValues.join('') + ']', 'g'),
19845        REGEX_HTML_UNESCAPE = /&([^;]+);/g;
19846
19847    A.mix(LString, {
19848        camelize: A.cached(
19849            function(str, separator) {
19850                var regex = REGEX_DASH;
19851
19852                str = String(str);
19853
19854                if (separator) {
19855                    regex = new RegExp(separator + '([a-z])', 'gi');
19856                }
19857
19858                return str.replace(regex, LString._camelize);
19859            }
19860        ),
19861
19862        capitalize: A.cached(
19863            function(str) {
19864                if (str) {
19865                    str = String(str);
19866
19867                    str = str.charAt(0).toUpperCase() + str.substr(1).toLowerCase();
19868                }
19869
19870                return str;
19871            }
19872        ),
19873
19874        contains: function(str, searchString) {
19875            return str.indexOf(searchString) !== -1;
19876        },
19877
19878        defaultValue: function(str, defaultValue) {
19879            if (isUndefined(str) || str === '') {
19880                if (isUndefined(defaultValue)) {
19881                    defaultValue = '';
19882                }
19883
19884                str = defaultValue;
19885            }
19886
19887            return str;
19888        },
19889
19890        endsWith: function(str, suffix) {
19891            var length = (str.length - suffix.length);
19892
19893            return ((length >= 0) && (str.indexOf(suffix, length) === length));
19894        },
19895
19896        escapeHTML: function(str) {
19897            return str.replace(REGEX_HTML_ESCAPE, LString._escapeHTML);
19898        },
19899
19900        // Courtesy of: http://simonwillison.net/2006/Jan/20/escape/
19901        escapeRegEx: function(str) {
19902            return str.replace(REGEX_ESCAPE_REGEX, '\\$1');
19903        },
19904
19905        nl2br: function(str) {
19906            return String(str).replace(REGEX_NL2BR, '<br />');
19907        },
19908
19909        padNumber: function(num, length, precision) {
19910            var str = precision ? Number(num).toFixed(precision) : String(num);
19911            var index = str.indexOf('.');
19912
19913            if (index === -1) {
19914                index = str.length;
19915            }
19916
19917            return LString.repeat('0', Math.max(0, length - index)) + str;
19918        },
19919
19920        pluralize: function(count, singularVersion, pluralVersion) {
19921            var suffix;
19922
19923            if (count === 1) {
19924                suffix = singularVersion;
19925            }
19926            else {
19927                suffix = pluralVersion || singularVersion + 's';
19928            }
19929
19930            return count + ' ' + suffix;
19931        },
19932
19933        prefix: function(prefix, str) {
19934            str = String(str);
19935
19936            if (str.indexOf(prefix) !== 0) {
19937                str = prefix + str;
19938            }
19939
19940            return str;
19941        },
19942
19943        remove: function(str, substitute, all) {
19944            var re = new RegExp(LString.escapeRegEx(substitute), all ? 'g' : '');
19945
19946            return str.replace(re, '');
19947        },
19948
19949        removeAll: function(str, substitute) {
19950            return LString.remove(str, substitute, true);
19951        },
19952
19953        repeat: function(str, length) {
19954            return new Array(length + 1).join(str);
19955        },
19956
19957        round: function(value, precision) {
19958            value = Number(value);
19959
19960            if (isNumber(precision)) {
19961                precision = Math.pow(10, precision);
19962                value = Math.round(value * precision) / precision;
19963            }
19964
19965            return value;
19966        },
19967
19968        startsWith: function(str, prefix) {
19969            return (str.lastIndexOf(prefix, 0) === 0);
19970        },
19971
19972        stripScripts: function(str) {
19973            if (str) {
19974                str = String(str).replace(REGEX_STRIP_SCRIPTS, '');
19975            }
19976
19977            return str;
19978        },
19979
19980        stripTags: function(str) {
19981            if (str) {
19982                str = String(str).replace(REGEX_STRIP_TAGS, '');
19983            }
19984
19985            return str;
19986        },
19987
19988        substr: function(str, start, length) {
19989            return String(str).substr(start, length);
19990        },
19991
19992        uncamelize: A.cached(
19993            function(str, separator) {
19994                separator = separator || ' ';
19995
19996                str = String(str);
19997
19998                str = str.replace(REGEX_UNCAMELIZE, '$1' + separator + '$2$3');
19999                str = str.replace(REGEX_UNCAMELIZE_REPLACE_SEPARATOR, '$1' + separator + '$2');
20000
20001                return str;
20002            }
20003        ),
20004
20005        toLowerCase: function(str) {
20006            return String(str).toLowerCase();
20007        },
20008
20009        toUpperCase: function(str) {
20010            return String(str).toUpperCase();
20011        },
20012
20013        trim: Lang.trim,
20014
20015        truncate: function(str, length, where) {
20016            str = String(str);
20017
20018            var ellipsisLength = STR_ELLIPSIS.length,
20019                strLength = str.length;
20020
20021            if (length > 3) {
20022                if (str && (strLength > length)) {
20023                    where = where || 'end';
20024
20025                    if (where === 'end') {
20026                        str = str.substr(0, (length - ellipsisLength)) + STR_ELLIPSIS;
20027                    }
20028                    else if (where === 'middle') {
20029                        var middlePointA = Math.floor((length - ellipsisLength) / 2),
20030                            middlePointB = middlePointA;
20031
20032                        if (length % 2 === 0) {
20033                            middlePointA = Math.ceil((length - ellipsisLength) / 2);
20034                            middlePointB = Math.floor((length - ellipsisLength) / 2);
20035                        }
20036
20037                        str = str.substr(0, middlePointA) + STR_ELLIPSIS + str.substr(strLength - middlePointB);
20038                    }
20039                    else if (where === 'start') {
20040                        str = STR_ELLIPSIS + str.substr(strLength - length + ellipsisLength);
20041                    }
20042                }
20043            }
20044            else {
20045                str = STR_ELLIPSIS;
20046            }
20047
20048            return str;
20049        },
20050
20051        undef: function(str) {
20052            if (isUndefined(str)) {
20053                str = '';
20054            }
20055
20056            return str;
20057        },
20058
20059        // inspired from Google unescape entities
20060        unescapeEntities: function(str) {
20061            if (LString.contains(str, '&')) {
20062                if (DOC && !LString.contains(str, '<')) {
20063                    str = LString._unescapeEntitiesUsingDom(str);
20064                }
20065                else {
20066                    str = LString.unescapeHTML(str);
20067                }
20068            }
20069
20070            return str;
20071        },
20072
20073        unescapeHTML: function(str) {
20074            return str.replace(REGEX_HTML_UNESCAPE, LString._unescapeHTML);
20075        },
20076
20077        _camelize: function(match0, match1) {
20078            return match1.toUpperCase();
20079        },
20080
20081        _escapeHTML: function(match) {
20082            return MAP_HTML_CHARS_ESCAPED[match];
20083        },
20084
20085        _unescapeHTML: function(match, entity) {
20086            var value = MAP_HTML_CHARS_UNESCAPED[match] || match;
20087
20088            if (!value && entity.charAt(0) === '#') {
20089                var charCode = Number('0' + value.substr(1));
20090
20091                if (!isNaN(charCode)) {
20092                    value = String.fromCharCode(charCode);
20093                }
20094            }
20095
20096            return value;
20097        },
20098
20099        _unescapeEntitiesUsingDom: function(str) {
20100            var el = DOC.createElement('a');
20101
20102            el.innerHTML = str;
20103
20104            if (el.normalize) {
20105                el.normalize();
20106            }
20107
20108            str = el.firstChild.nodeValue;
20109
20110            el.innerHTML = '';
20111
20112            return str;
20113        }
20114    });
20115
20116    /*
20117     * Maps an object to an array, using the return value of fn as the values
20118     * for the new array.
20119     */
20120    AObject.map = function(obj, fn, context) {
20121        var map = [],
20122            i;
20123
20124        for (i in obj) {
20125            if (owns(obj, i)) {
20126                map[map.length] = fn.call(context, obj[i], i, obj);
20127            }
20128        }
20129
20130        return map;
20131    };
20132
20133    /*
20134     * Maps an array or object to a resulting array, using the return value of
20135     * fn as the values for the new array. Like A.each, this function can accept
20136     * an object or an array.
20137     */
20138    A.map = function(obj) {
20139        var module = AObject;
20140
20141        if (isArray(obj)) {
20142            module = aArray;
20143        }
20144
20145        return module.map.apply(this, arguments);
20146    };
20147}());
20148
20149
20150}, '3.1.0-deprecated.95');
20151
20152!function(){var e=AUI().use("oop"),r={},o={_getAOP:(e,r)=>e._yuiaop&&e._yuiaop[r],_proxy(e,a,i,n,p,t,d){var y,u=o._proxyLoaders[p];for(o._replaceMethod(e,a,i,n);y=u.next();)i.apply(n,y);for(var _=t.length-1;_>=0;_--)r[t[_]]=!0},_proxyLoaders:{},_replaceMethod(r,a,i){var n=o._getAOP(r,a),p=r[a];n?(p=n.method,n.method=i):r[a]=i,e.mix(i,p)},provide(a,i,n,p,t){var d;Array.isArray(p)||(p=[p]);var y=e.guid();if(e.Lang.isObject(n,!0)){var u=n;n=u.fn,d=u.before,e.Lang.isFunction(d)||(d=null)}t&&e.Lang.isFunction(a)&&(a=a.prototype),o._getAOP(a,i)&&delete a._yuiaop[i];var _=function(){var d=arguments,u=a;if(t&&(u=this),1===p.length&&p[0]in r)return o._replaceMethod(a,i,n,u),void n.apply(u,d);var _=!1,v=o._proxyLoaders[y];v||(_=!0,o._proxyLoaders[y]=new e.Queue,v=o._proxyLoaders[y]),v.add(d),_&&(p.push(e.bind(o._proxy,Liferay,a,i,n,u,y,p)),e.use.apply(e,p))};_.toString=function(){return n.toString()},a[i]=_}};Liferay.Dependency=o,Liferay.provide=o.provide}();
20153//# sourceMappingURL=dependency.js.map
20154function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
20154t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){e.use("aui-base-lang");var t=e.Lang,r="click",o={src:"hideLink"},a={_map:{},getById(e){return this._map[e]}},n={_getEditableInstance(t){var r=n._EDITABLE;return r||((r=new e.Editable({after:{contentTextChange(e){if(!e.initial){var t=this.get("node").getData("portletTitleEditOptions");n.savePortletTitle({doAsUserId:t.doAsUserId,plid:t.plid,portletId:t.portletId,title:e.newVal})}},startEditing(){var e=this,t=Liferay.Layout;t&&(e._dragListener=t.getLayoutHandler().on("drag:start",(()=>{e.fire("save")})));var r=e.get("node");e._titleListener=r.on("mouseupoutside",(e=>{var t=n._getEditableInstance(r);t.get("boundingBox").contains(e.target)||t.save()}))},stopEditing(){var e=this;e._dragListener&&e._dragListener.detach(),e._titleListener&&e._titleListener.detach()}},cssClass:"lfr-portlet-title-editable",node:t})).get("cancelButton").icon="times",r.get("saveButton").icon="check",n._EDITABLE=r),r},addInputCancel(){e.use("aui-button-search-cancel",(e=>{new e.ButtonSearchCancel({trigger:"input[type=password], input[type=search], input.clearable, input.search-query"})})),n.addInputCancel=function(){}},checkAll(e,t,r,o){if(e){let a;"string"==typeof(e=n.getDOM(e))&&(e=document.querySelector(e)),"string"==typeof(r=n.getDOM(r))&&(r=document.querySelector(r)),a=Array.isArray(t)?"input[name="+t.join("], input[name=")+"]":"input[name="+t+"]";const i=r.checked;if(Array.from(e.querySelectorAll(a)).forEach((e=>{e.disabled||(e.checked=i)})),o){const t=e.querySelector(o);i?t.classList.add("info"):t.classList.remove("info")}}},checkAllBox(e,t,r){let o=0;if(e){"string"==typeof(e=n.getDOM(e))&&(e=document.querySelector(e)),"string"==typeof(r=n.getDOM(r))&&(r=document.querySelector(r)||e.querySelector('input[name="'.concat(r,'"]')));const a=Array.from(e.querySelectorAll("input[type=checkbox]"));Array.isArray(t)||(t=[t]);let i=0;a.forEach((e=>{(e.id!==r.id||e.id!==r.name&&t.indexOf(e.name)>-1)&&(i++,e.checked&&o++)})),r.checked=i===o}return o},checkTab(e){document.all&&9===Number(window.event.keyCode)&&(e.selection=document.selection.createRange(),setTimeout((()=>{n.processTab(e.id)}),0))},disableElements(e){const t=n.getElement(e);if(t)for(var r=t.getElementsByTagName("*"),o=function(){return!1},a=r.length-1;a>=0;a--){var i=r[a];i.style.cursor="default",i.onclick=o,i.onmouseover=o,i.onmouseout=o,i.onmouseenter=o,i.onmouseleave=o,i.action="",i.disabled=!0,i.href="javascript:;",i.onsubmit=o}},disableFormButtons(t,r){t.attr("disabled",!0),t.setStyle("opacity",.5),e.UA.gecko?e.getWin().on("unload",(()=>{t.attr("disabled",!1)})):e.UA.safari&&e.use("node-event-html5",(e=>{e.getWin().on("pagehide",(()=>{n.enableFormButtons(t,r)}))}))},disableToggleBoxes(e,t,o){const a=document.getElementById(e),n=document.getElementById(t);a&&n&&(n.disabled=o&&a.checked,a.addEventListener(r,(()=>{n.disabled=!n.disabled})))},enableFormButtons(e){n._submitLocked=null,n.toggleDisabled(e,!1)},escapeCDATA:e=>e.replace(/<!\[CDATA\[|\]\]>/gi,(e=>{var t="";return"]]>"===e?t="]]&gt;":"<![CDATA["===e&&(t="&lt;![CDATA["),t})),forcePost(e){const t=n.getElement(e);if(t){const e=t.getAttribute("href");if("javascript:;"===e)return;const r="_blank"===t.getAttribute("target"),o=document.hrefFm;r&&o.setAttribute("target","_blank"),submitForm(o,e,!r),n._submitLocked=null}},getAttributes(e,t){var r=null;if(e){(e=n.getDOM(e)).jquery&&(e=e[0]),r={};
20154for(var o="function"==typeof t,a="string"==typeof t,i=e.attributes,s=i.length;s--;){var l=i[s],d=l.nodeName.toLowerCase(),c=l.nodeValue;if(a){if(0!==d.indexOf(t))continue;d=d.substr(t.length)}else if(o&&!1===(c=t(c,d,i)))continue;r[d]=c}}return r},getColumnId:e=>e.replace(/layout-column_/,""),getWindowName:()=>window.name||a._name||"",getWindowWidth:()=>window.innerWidth,isFunction:e=>"function"==typeof e,listCheckboxesExcept(e,t,r,o){"string"==typeof(e=n.getDOM(e))&&(e=document.querySelector(e));let a="input[type=checkbox]";r&&(a+="[name="+r+"]");return Array.from(e.querySelectorAll(a)).reduce(((e,r)=>{const a=r.value;return a&&r.name!==t&&r.checked===o&&!r.disabled&&e.push(a),e}),[]).join()},listCheckedExcept:(e,t,r)=>n.listCheckboxesExcept(e,t,r,!0),listSelect:(e,t)=>(e=n.getElement(e),Array.from(e.querySelectorAll("option")).reduce(((e,t)=>{const r=t.value;return r&&e.push(r),e}),[]).join(t||",")),listUncheckedExcept:(e,t,r)=>n.listCheckboxesExcept(e,t,r,!1),openInDialog(e,t){e.preventDefault();var r=n.getElement(e.currentTarget);(t=Object.assign({},Object.assign({},r.dataset),t)).uri||(t.uri=r.dataset.href||r.getAttribute("href")),t.title||(t.title=r.getAttribute("title")),Liferay.Util.openWindow(t)},processTab(e){document.all[e].selection.text=String.fromCharCode(9),document.all[e].focus()},randomInt:()=>Math.ceil(Math.random()*(new Date).getTime()),reorder(e,t){if(e=n.getElement(e))if(-1===e.getAttribute("selectedIndex"))e.setAttribute("selectedIndex",0);else{const r=Array.from(e.querySelectorAll("option:checked")),o=Array.from(e.querySelectorAll("option"));t?r.reverse().forEach((t=>{if(o.indexOf(t)===o.length-1)e.insertBefore(t,e.firstChild);else{const r=t.nextElementSibling.nextElementSibling;e.insertBefore(t,r)}})):r.forEach((t=>{0===o.indexOf(t)?e.appendChild(t):e.insertBefore(t,t.previousElementSibling)}))}},rowCheckerCheckAllBox(e,t,r,o,a){n.checkAllBox(e,r,o),t&&t.toggleClass(a)},savePortletTitle(e){var t={doAsUserId:(e=_objectSpread({doAsUserId:0,plid:0,portletId:0,title:"",url:themeDisplay.getPathMain()+"/portal/update_portlet_title"},e)).doAsUserId,p_auth:Liferay.authToken,p_l_id:e.plid,portletId:e.portletId,title:e.title};Liferay.Util.fetch(e.url,{body:Liferay.Util.objectToFormData(t),method:"POST"})},setCursorPosition(e,t){this.setSelectionRange(e,t,t)},setSelectionRange(e,t,r){if((e=n.getDOM(e)).jquery&&(e=e[0]),e.setSelectionRange)e.focus(),e.setSelectionRange(t,r);else if(e.createTextRange){var o=e.createTextRange();o.collapse(!0),o.moveEnd("character",r),o.moveEnd("character",t),o.select()}},sortByAscending:(e,t)=>
20154(e=e[1].toLowerCase())>(t=t[1].toLowerCase())?1:e<t?-1:0,submitCountdown:0,submitForm(e){e.submit()},toNumber:e=>parseInt(e,10)||0,toggleSearchContainerButton(t,o,a,i){e.one(o).delegate(r,(()=>{n.toggleDisabled(t,!n.getCheckedCheckboxes(a,i))}),"input[type=checkbox]")}};Liferay.provide(n,"afterIframeLoaded",(t=>{var a=e.Node._instances,n=t.doc,i=n._yuid;i in a&&delete a[i];var s=e.one(n),l=s.one("body"),d=t.dialog,c=l.one(".lfr-form-content");if(l.addClass("dialog-iframe-popup"),c&&l.one(".button-holder.dialog-footer")){l.addClass("dialog-with-footer");var u=l.one(".portlet-body > .lfr-portlet-message-staging-alert");u&&(u.remove(),c.prepend(u))}l.addClass(d.iframeConfig.bodyCssClass),t.win.focus();var p=t.win;if(p.Liferay.SPA){var f=p.Liferay.on("beforeScreenFlip",(()=>{p.document.body.classList.add("dialog-iframe-popup")}));p.onunload=()=>{f&&p.Liferay.detach(f)}}var g=l.delegate(r,(e=>{d.set("visible",!1,e.currentTarget.hasClass("lfr-hide-dialog")?o:null),g.detach(),s.purge(!0)}),".btn-cancel,.lfr-hide-dialog");Liferay.fire("modalIframeLoaded",{src:t.dialog.iframe.node.getAttribute("src")})}),["aui-base"]),Liferay.provide(n,"openDDMPortlet",((t,r)=>{var o={classNameId:(t=e.merge({eventName:"selectStructure"},t)).classNameId,classPK:t.classPK,doAsGroupId:t.doAsGroupId||themeDisplay.getScopeGroupId(),eventName:t.eventName,groupId:t.groupId,mvcPath:t.mvcPath||"/view.jsp",p_p_state:"pop_up",portletResourceNamespace:t.portletResourceNamespace,resourceClassNameId:t.resourceClassNameId,scopeTitle:t.title,structureAvailableFields:t.structureAvailableFields,templateId:t.templateId};"mode"in t&&(o.mode=t.mode),"navigationStartsOn"in t&&(o.navigationStartsOn=t.navigationStartsOn),"redirect"in t&&(o.redirect=t.redirect),"refererPortletName"in t&&(o.refererPortletName=t.refererPortletName),"refererWebDAVToken"in t&&(o.refererWebDAVToken=t.refererWebDAVToken),"searchRestriction"in t&&(o.searchRestriction=t.searchRestriction,o.searchRestrictionClassNameId=t.searchRestrictionClassNameId,o.searchRestrictionClassPK=t.searchRestrictionClassPK),"showAncestorScopes"in t&&(o.showAncestorScopes=t.showAncestorScopes),"showBackURL"in t&&(o.showBackURL=t.showBackURL),"showCacheableInput"in t&&(o.showCacheableInput=t.showCacheableInput),"showHeader"in t&&(o.showHeader=t.showHeader),"showManageTemplates"in t&&(o.showManageTemplates=t.showManageTemplates);var a=Liferay.Util.PortletURL.createRenderURL(t.basePortletURL,o);t.uri=a.toString();var i=t.dialog;i||(i={},t.dialog=i);var s=[];r&&s.push(Liferay.once(t.eventName,r));var l=function(r){Liferay.fire(t.eventName),r.newVal||new e.EventHandle(s).detach()};n.openWindow(t,(e=>{s.push(e.after(["destroy","visibleChange"],l))}))}),["aui-base"]),Liferay.provide(n,"openDocument",((r,o,a)=>{if(e.UA.ie)try{new e.config.win.ActiveXObject("SharePoint.OpenDocuments").EditDocument(r),t.isFunction(o)&&o()}catch(e){t.isFunction(a)&&a(e)}}),["aui-base"]),Liferay.provide(n,"selectEntityHandler",((t,o,a)=>{const i=e.one(t);if(!i)return;const s=n.getOpener().Liferay,l=i.getDOM().querySelectorAll(".selector-button");i.delegate(r,(e=>{const t=e.currentTarget.getDOM();if(t.disabled||t.dataset.preventSelection)return;if(!("true"===t.dataset.confirmSelection)||confirm(t.dataset.confirmSelectionMessage)){a&&(l.forEach((e=>{e.disabled=!1})),t.disabled=!0);const e=n.getAttributes(t,"data-");s.fire(o,e);const r=n.getWindow();r&&r.hide()}}),".selector-button"),s.on("entitySelectionRemoved",(()=>{l.forEach((e=>{e.disabled=!1}))}))}),["aui-base"]),Liferay.provide(n,"portletTitleEdit",(t=>{var o=t.obj;if(e.Event.defineOutside("mouseup"),o){var a=o.one(".portlet-title-text");a&&!a.hasClass("not-editable")&&(a.addClass("portlet-title-editable"),a.on(r,(t=>{var r=n._getEditableInstance(a),o=r.get("rendered");if(o&&r.fire("stopEditing"),r.set("node",t.currentTarget),o&&r.syncUI(),r._startEditing(t),!o){var i=e.ToolbarRenderer.prototype.TEMPLATES.icon;e.ToolbarRenderer.prototype.TEMPLATES.icon=Liferay.Util.getLexiconIconTpl("{cssClass}"),r._comboBox.icons.destroy(),r._comboBox._renderIcons(),e.ToolbarRenderer.prototype.TEMPLATES.icon=i}})),a.setData("portletTitleEditOptions",t))}}),["aui-editable-deprecated","event-outside"]),Liferay.provide(n,"editEntity",((t,r)=>{var o=n.getWindow(t.id),a=t.eventName||t.id,i=[Liferay.on(a,r)],s=function(t){t.newVal||new e.EventHandle(i).detach()};if(o)i.push(o.after(["destroy","visibleChange"],s)),o.show();else{var l=function e(r){var o=t.id,a=n.getWindow(o);a&&n.getPortletId(o)===r.portletId&&(a.destroy(),Liferay.detach("destroyPortlet",e))},d=new Liferay.Util.PortletURL.createPortletURL(t.uri,e.merge({eventName:a}
20154,t.urlParams));t.uri=d.toString(),t.dialogIframe=e.merge({bodyCssClass:"dialog-with-footer"},t.dialogIframe||{}),n.openWindow(t,(e=>{i.push(e.after(["destroy","visibleChange"],s)),Liferay.on("destroyPortlet",l)}))}}),["aui-base","liferay-util-window"]),Liferay.provide(n,"selectEntity",((t,r)=>{var o=n.getWindow(t.id),a=t.eventName||t.id,i=[Liferay.on(a,r)],s=t.selectedData;s&&(t.dialog.destroyOnHide=!0);var l=function(t){t.newVal||new e.EventHandle(i).detach()},d=function(t){var r=t.currentTarget.node.get("contentWindow.document").all(".lfr-search-container-wrapper .selector-button");s&&e.each(r,(e=>{var t=e.attr("data-entityid")||e.attr("data-entityname"),r=e.attr("data-groupid");r&&(t=r+"-"+t);var o=s.includes(t);o?e.attr("data-prevent-selection",!0):e.removeAttribute("data-prevent-selection"),n.toggleDisabled(e,o)}))};if(o)i.push(o.after(["destroy","visibleChange"],l)),o.show();else{var c=function e(r){var o=t.id,a=n.getWindow(o);a&&n.getPortletId(o)===r.portletId&&(a.destroy(),Liferay.detach("destroyPortlet",e))};n.openWindow(t,(e=>{i.push(e.after(["destroy","visibleChange"],l),e.iframe.after(["load"],d)),Liferay.on("destroyPortlet",c)}))}}),["aui-base","liferay-util-window"]),Liferay.provide(n,"_openWindowProvider",((e,r)=>{var o=a.getWindow(e);t.isFunction(r)&&r(o)}),["liferay-util-window"]),n.Window=a,Liferay.Util=n}(AUI());
20155//# sourceMappingURL=util.js.map
20156!function(){var s={_scheduledTasks:[],_taskStates:[],addTask(s){this._scheduledTasks.push(s)},addTaskState(s){this._taskStates.push(s)},reset(){this._taskStates.length=0,this._scheduledTasks.length=0},runTasks(s){for(var t=this._scheduledTasks,a=this._taskStates,e=t.length,h=a.length,d=0;d<e;d++)for(var k=t[d],n=k.params,i=0;i<h;i++){var r=a[i];k.condition(r,n,s)&&k.action(r,n,s)}}};Liferay.DOMTaskRunner=s}();
20157//# sourceMappingURL=dom_task_runner.js.map
20158!function(e){var t={},a=Liferay.Util;e.use("attribute","oop",(e=>{e.augment(Liferay,e.Attribute,!0)})),Liferay.provide(Liferay,"delegateClick",((a,i)=>{var r=e.config.doc.getElementById(a);if(r&&r.id===a){var l=e.one(r).addClass("lfr-delegate-click").guid();t[l]=i,Liferay._baseDelegateHandle||(Liferay._baseDelegateHandle=e.getBody().delegate("click",Liferay._baseDelegate,".lfr-delegate-click"))}}),["aui-base"]),Liferay._baseDelegate=function(e){var a=e.currentTarget.attr("id"),i=t[a];i&&i.apply(this,arguments)},Liferay._CLICK_EVENTS=t,Liferay.provide(window,"submitForm",((t,i,r,l)=>{a._submitLocked||(t.jquery&&(t=t[0]),Liferay.fire("submitForm",{action:i,form:e.one(t),singleSubmit:r,validate:!1!==l}))}),["aui-base","aui-form-validator","aui-url","liferay-form"]),Liferay.publish("submitForm",{defaultFn(t){var i=t.form,r=!1;if(t.validate){var l=Liferay.Form.get(i.attr("id"));if(l){var o=l.formValidator;e.instanceOf(o,e.FormValidator)&&(o.validate(),(r=o.hasErrors())&&o.focusInvalidField())}}if(!r){var n=t.action||i.getAttribute("action"),d=t.singleSubmit,f=i.all("button[type=submit], input[type=button], input[type=image], input[type=reset], input[type=submit]");const r=Array.from(f._nodes);var u,s;r.length&&r.map((e=>{e.disabled=!0,e.style.opacity=.5})),a._submitLocked=!1!==d||e.later(1e3,a,(function(e){a._submitLocked=null,a.toggleDisabled(e,!1)}),[f,i]);var y=n.indexOf("?");-1===y?(u=n,s=""):(u=n.slice(0,y),s=n.slice(y+1));var c=new URLSearchParams(s),g=c.get("p_auth")||"";g.includes("#")&&(g=g.substring(0,g.indexOf("#"))),g&&(i.append('<input name="p_auth" type="hidden" value="'+g+'" />'),c.delete("p_auth"),n=u+"?"+c.toString()),i.attr("action",n),a.submitForm(i),i.attr("target",""),a._submitLocked=null}}}),Liferay.after("closeWindow",(e=>{var t=e.id,i=a.getTop().Liferay.Util.Window.getById(t);if(i&&i.iframe){var r=i.iframe.node.get("contentWindow").getDOM().Liferay.Util.getOpener(),l=e.redirect;if(l)r.Liferay.Util.navigate(l);else{var o,n=e.refresh;if(n&&r)e.portletAjaxable||(o={portletAjaxable:!1}),r.Liferay.Portlet.refresh("#p_p_id_"+n+"_",o)}i.hide()}}))}(AUI());
20159//# sourceMappingURL=events.js.map
20160Liferay.lazyLoad=function(){var r,n,e,f=function(r){return"function"==typeof r};if(Array.isArray(arguments[0]))n=arguments[0],e=f(arguments[1])?arguments[1]:null,r=f(arguments[2])?arguments[2]:null;else{n=[];for(var i=0;i<arguments.length;++i)if("string"==typeof arguments[i])n[i]=arguments[i];else if(f(arguments[i])){e=arguments[i],r=f(arguments[++i])?arguments[i]:null;break}}return function(){for(var f=[],i=0;i<arguments.length;++i)f.push(arguments[i]);Liferay.Loader.require(n,(function(){for(var r=0;r<arguments.length;++r)f.splice(r,0,arguments[r]);e.apply(e,f)}),r)}};
20161//# sourceMappingURL=lazy_load.js.map
20162Liferay=window.Liferay||{},function(){var e=function(e){return"function"==typeof e},t=function(e){return e&&(e._node||e.jquery||e.nodeType)},r=/^get$/i;Liferay.namespace=function(e,t){void 0===t&&(t=e,e=this);for(var r,o=t.split(".");o.length&&(r=o.shift());)e=e[r]&&e[r]!==Object.prototype[r]?e[r]:e[r]={};return e};var o=function e(){var t=e.parseInvokeArgs(Array.prototype.slice.call(arguments,0));return e.invoke.apply(e,t)};function n(e){return function(){var t=Array.prototype.slice.call(arguments,0),r={method:e};return t.push(r),o.apply(o,t)}}o.URL_INVOKE=themeDisplay.getPathContext()+"/api/jsonws/invoke",o.bind=function(){var e=Array.prototype.slice.call(arguments,0);return function(){var t=Array.prototype.slice.call(arguments,0);return o.apply(o,e.concat(t))}},o.parseInvokeArgs=function(e){var t=this,r=e[0],o=t.parseIOConfig(e);
20162if("string"==typeof r){r=t.parseStringPayload(e),t.parseIOFormConfig(o,e);var n=e[e.length-1];"object"==typeof n&&n.method&&(o.method=n.method)}return[r,o]},o.parseIOConfig=function(t){var o=t[0],n=o.io||{};if(delete o.io,!n.success){var a=t.filter(e),i=a[1],p=a[0];i||(i=p),n.error=i,n.complete=function(e){if(Object.prototype.hasOwnProperty.call(e,"exception")){if(i){var t=e?e.exception:"The server returned an empty response";i.call(this,t,e)}}else p&&p.call(this,e)}}return!Object.prototype.hasOwnProperty.call(n,"cache")&&r.test(n.type)&&(n.cache=!1),n},o.parseIOFormConfig=function(e,r){var o=r[1];t(o)&&("multipart/form-data"===o.enctype&&(e.contentType="multipart/form-data"),e.formData=new FormData(o))},o.parseStringPayload=function(r){var o={},n={},a=r[1];return e(a)||t(a)||(o=a),n[r[0]]=o,n},o.invoke=function(e,t){var r=JSON.stringify(e),o=r;return t.formData&&(t.formData.append("cmd",r),o=t.formData),Liferay.Util.fetch(this.URL_INVOKE,{body:o,headers:{contentType:t.contentType},method:"POST"}).then((e=>Promise.all([Promise.resolve(e),e.json()]))).then((([e,r])=>{e.ok?t.complete(r):t.error()})).catch(t.error)},o.get=n("get"),o.del=n("delete"),o.post=n("post"),o.put=n("put"),o.update=n("update"),Liferay.Service=o,Liferay.Template={PORTLET:'<div class="portlet"><div class="portlet-topper"><div class="portlet-title"></div></div><div class="portlet-content"></div><div class="forbidden-action"></div></div>'}}();
20163//# sourceMappingURL=liferay.js.map
20164(()=>{var e={8686:(e,t,r)=>{var n,o=/[&<>"'`]/g,i=RegExp(o.source),a="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,s="object"==typeof self&&self&&self.Object===Object&&self,c=a||s||Function("return this")(),l=(n={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},function(e){return null==n?void 0:n[e]}),u=Object.prototype.toString,d=c.Symbol,f=d?d.prototype:void 0,p=f?f.toString:void 0;e.exports=function(e){var t;return(e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return p?p.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t))&&i.test(e)?e.replace(o,l):e}},1991:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(1521))&&n.__esModule?n:{default:n};function i(e,t){let r=e.indexOf('">');const n=e.substring(r);r=t.indexOf('">');const o=t.substring(r);return n<o?-1:n>o?1:0}function a(e,t,r){const n=e[t],a=document.getElementById(n.select);if(!a)return;const s=function(e){return!!Array.isArray(e)||!(!e||"object"!=typeof e||"number"!=typeof e.length||e.tagName||e.scrollTo||e.document)}(l=n.selectVal)?Array.from(l):[l],c=[];var l;for(!1!==n.selectNullable&&c.push('<option selected value="0"></option>'),r.forEach((e=>{const t=Liferay.Util.escapeHTML(e[n.selectId]),r=Liferay.Util.escapeHTML(e[n.selectDesc]);let o="";s.indexOf(t)>-1&&(o='selected="selected"'),c.push("<option ".concat(o,' value="').concat(t,'">').concat(r,"</option>"))})),n.selectSort&&c.sort(i);a.lastChild;)a.removeChild(a.lastChild);a.innerHTML=c.join(""),n.selectDisableOnEmpty&&(0,o.default)(a,!r.length)}t.default=class{constructor(e){!function(e){e.forEach(((t,r)=>{const n=t.select,o=document.getElementById(n),i=t.selectData;if(o){let t;o.setAttribute("data-componentType","dynamic_select"),r>0&&(t=e[r-1].selectVal),i((t=>{a(e,r,t)}),t),o.getAttribute("name")||o.setAttribute("name",n),o.addEventListener("change",(()=>{!function(e,t){if(t+1<e.length){const r=document.getElementById(e[t].select);(0,e[t+1].selectData)((r=>{a(e,t+1,r)}),r&&r.value)}}(e,r)}))}}))}(e)}}},3337:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={PHONE:768,TABLET:980}},2801:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.initComponentCache=t.getComponentCache=t.destroyUnfulfilledPromises=t.destroyComponents=t.destroyComponent=t.componentReady=t.component=void 0;const r={};let n={};const o={};let i={};const a={},s=["p_p_id","p_p_lifecycle"],c=["ddmStructureKey","fileEntryTypeId","folderId","navigation","status"],l="liferay.component",u=function(e){let t;if(e)t={promise:Promise.resolve(e),resolve(){}};else{let e;t={promise:new Promise((t=>{e=t})),resolve:e}}return t},d=function(e,t,r){const n=e.data;
20164Object.keys(n).forEach((e=>{const t=r.querySelector("#".concat(e));t&&(t.innerHTML=n[e].html)}))},f=function(e){const t=new URL(window.location.href),n=new URL(e.path,window.location.href);if(s.every((e=>n.searchParams.get(e)===t.searchParams.get(e)))){var a=Object.keys(o);a=a.filter((e=>{const i=o[e];if(!i)return!1;const a=r[e],s=c.every((e=>{let r=!1;if(a){const o="_".concat(a.portletId,"_").concat(e);r=n.searchParams.get(o)===t.searchParams.get(o)}return r}));return"function"==typeof i.isCacheable&&i.isCacheable(n)&&s&&a&&a.cacheState&&i.element&&i.getState})),i=a.reduce(((e,t)=>{const n=o[t],i=r[t],a=n.getState(),s=i.cacheState.reduce(((e,t)=>(e[t]=a[t],e)),{});return e[t]={html:n.element.innerHTML,state:s},e}),[]),Liferay.DOMTaskRunner.addTask({action:d,condition:e=>e.owner===l}),Liferay.DOMTaskRunner.addTaskState({data:i,owner:l})}else i={}},p=function(e,t,i){let s;if(1===arguments.length){let t=o[e];t&&"function"==typeof t&&(a[e]=t,t=t(),o[e]=t),s=t}else if(o[e]&&null!==t&&(delete r[e],delete n[e],console.warn('Component with id "'+e+'" is being registered twice. This can lead to unexpected behaviour in the "Liferay.component" and "Liferay.componentReady" APIs, as well as in the "*:registered" events.')),s=o[e]=t,null===t)delete r[e],delete n[e];else{r[e]=i,Liferay.fire(e+":registered");const o=n[e];o?o.resolve(t):n[e]=u(t)}return s};t.component=p,t.componentReady=function e(){let t,r;if(1===arguments.length)t=arguments[0];else{t=[];for(var o=0;o<arguments.length;o++)t[o]=arguments[o]}if(Array.isArray(t))r=Promise.all(t.map((t=>e(t))));else{let e=n[t];e||(n[t]=e=u()),r=e.promise}return r};const h=function(e){const t=o[e];if(t){const i=t.destroy||t.dispose;i&&i.call(t),delete r[e],delete n[e],delete a[e],delete o[e]}};t.destroyComponent=h,t.destroyComponents=function(e){var t=Object.keys(o);e&&(t=t.filter((t=>e(o[t],r[t]||{})))),t.forEach(h)},t.destroyUnfulfilledPromises=function(){n={}},t.getComponentCache=function(e){const t=i[e];return t?t.state:{}},t.initComponentCache=function(){Liferay.on("startNavigate",f)};var y=p;t.default=y},5894:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=class{constructor(){this._disposed=!1}dispose(){this._disposed||(this.disposeInternal(),this._disposed=!0)}disposeInternal(){}isDisposed(){return this._disposed}}},6454:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i(r(5894)),o=i(r(2045));function i(e){return e&&e.__esModule?e:{default:e}}const a=[0];class s extends n.default{constructor(){super(),this._events=null,this._listenerHandlers=null,this._shouldUseFacade=!1}_addHandler(e,t){return e?(Array.isArray(e)||(e=[e]),e.push(t)):e=t,e}addListener(e,t,r){this._validateListener(t);const n=this._toEventsArray(e);for(let e=0;e<n.length;e++)this._addSingleListener(n[e],t,r);return new o.default(this,e,t)}_addSingleListener(e,t,r,n){this._runListenerHandlers(e),(r||n)&&(t={default:r,fn:t,origin:n}),this._events=this._events||{},this._events[e]=this._addHandler(this._events[e],t)}_buildFacade(e){if(this.getShouldUseFacade()){const t={preventDefault(){t.preventedDefault=!0},target:this,type:e};return t}}disposeInternal(){this._events=null}emit(e){const t=this._getRawListeners(e);if(0===t.length)return!1;const r=Array.prototype.slice.call(arguments,1);return this._runListeners(t,r,this._buildFacade(e)),!0}_getRawListeners(e){return c(this._events&&this._events[e]).concat(c(this._events&&this._events["*"]))}getShouldUseFacade(){return this._shouldUseFacade}listeners(e){return this._getRawListeners(e).map((e=>e.fn?e.fn:e))}many(e,t,r){const n=this._toEventsArray(e);for(let e=0;e<n.length;e++)this._many(n[e],t,r);return new o.default(this,e,r)}_many(e,t,r){const n=this;t<=0||n._addSingleListener(e,(function o(){0==--t&&n.removeListener(e,o),r.apply(n,arguments)}),!1,r)}_matchesListener(e,t){return(e.fn||e)===t||e.origin&&e.origin===t}off(e,t){if(this._validateListener(t),!this._events)return this;const r=this._toEventsArray(e);for(let e=0;e<r.length;e++)this._events[r[e]]=this._removeMatchingListenerObjs(c(this._events[r[e]]),t);return this}on(){return this.addListener.apply(this,arguments)}onListener(e){this._listenerHandlers=this._addHandler(this._listenerHandlers,e)}once(e,t){return this.many(e,1,t)}removeAllListeners(e){if(this._events)if(e){const t=this._toEventsArray(e);for(let e=0;e<t.length;e++)this._events[t[e]]=null}else this._events=null;return this}_removeMatchingListenerObjs(e,t){const r=[];for(let n=0;n<e.length;n++)this._matchesListener(e[n],t)||r.push(e[n]);return r.length>0?r:null}removeListener(){return this.off.apply(this,arguments)}_runListenerHandlers(e){let t=this._listenerHandlers;if(t){t=c(t);for(let r=0;r<t.length;r++)t[r](e)}}_runListeners(e,t,r){r&&t.push(r);const n=[];for(let r=0;r<e.length;r++){const o=e[r].fn||e[r];e[r].default?n.push(o):o.apply(this,t)}if(!r||!r.preventedDefault)for(let e=0;e<n.length;e++)n[e].apply(this,t)}setShouldUseFacade(e){return this._shouldUseFacade=e,this}_toEventsArray(e){return"string"==typeof e&&(a[0]=e,e=a),e}_validateListener(e){if("function"!=typeof e)throw new TypeError("Listener must be a function")}}function c(e){return e=e||[],Array.isArray(e)?e:[e]}var l=s;t.default=l},2045:(e,t,r)=>
20164{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(5894))&&n.__esModule?n:{default:n};class i extends o.default{constructor(e,t,r){super(),this._emitter=e,this._event=t,this._listener=r}disposeInternal(){this.removeListener(),this._emitter=null,this._listener=null}removeListener(){this._emitter.isDisposed()||this._emitter.removeListener(this._event,this._listener)}}var a=i;t.default=a},34:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.hideLayoutPane=function(e){var t=(e=e||{}).obj,r=e.pane;t&&t.checked&&(r=document.querySelector(r))&&r.classList.add("hide")},t.getLayoutIcons=function(){return{minus:themeDisplay.getPathThemeImages()+"/arrows/01_minus.png",plus:themeDisplay.getPathThemeImages()+"/arrows/01_plus.png"}},t.proposeLayout=function(e){var t=(e=e||{}).namespace,r=e.reviewers,n='<div><form action="'+e.url+'" method="post">';if(r.length>0){n+='<textarea name="'+t+'description" style="height: 100px; width: 284px;"></textarea><br /><br />'+'Revisore'+' <select name="'+t+'reviewUserId">';for(var o=0;o<r.length;o++)n+='<option value="'+r[o].userId+'">'+r[o].fullName+"</option>";n+='</select><br /><br /><input type="submit" value="'+'Procedi'+'" />'}else n+='Nessun\x20revisore\x20è\x20stato\x20trovato\x2e'+"<br />"+'Contatta\x20il\x20coordinatore\x20per\x20assegnare\x20i\x20revisori\x2e'+"<br /><br />";n+="</form></div>",Liferay.Util.openWindow({dialog:{destroyOnHide:!0},title:n})},t.publishToLive=function(e){e=e||{},Liferay.Util.openWindow({dialog:{constrain:!0,modal:!0,on:{visibleChange(e){e.newVal||this.destroy()}}},title:e.title,uri:e.url})},t.showLayoutPane=function(e){var t=(e=e||{}).obj,r=e.pane;t&&t.checked&&(r=document.querySelector(r))&&r.classList.remove("hide")},t.toggleLayoutDetails=function(e){e=e||{};var t=document.querySelector(e.detail),r=document.querySelector(e.toggle);if(t&&r){var n=themeDisplay.getPathThemeImages()+"/arrows/01_plus.png";t.classList.contains("hide")?(t.classList.remove("hide"),n=themeDisplay.getPathThemeImages()+"/arrows/01_minus.png"):t.classList.add("hide"),r.setAttribute("src",n)}}},9356:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.showTab=function(e,t,r,n){const s=e+(0,o.default)(r),c=document.getElementById(s+"TabsId"),l=document.getElementById(s+"TabsSection");if(c&&l){const o={id:r,names:t,namespace:e,selectedTab:c,selectedTabSection:l};n&&"function"==typeof n&&n.call(this,e,t,r,o);try{Liferay.on(i,a),Liferay.fire(i,o)}finally{Liferay.detach(i,a)}}},t.applyTabSelectionDOMChanges=a;var n,o=(n=r(7639))&&n.__esModule?n:{default:n};const i="showTab";function a({id:e,names:t,namespace:r,selectedTab:n,selectedTabSection:i}){const a=n.querySelector("a");if(n&&a){const e=n.parentElement.querySelector(".active");e&&e.classList.remove("active"),a.classList.add("active")}i&&i.classList.remove("hide");const s=document.getElementById(r+"dropdownTitle");let c;s&&a&&(s.innerHTML=a.textContent),t.splice(t.indexOf(e),1);for(var l=0;l<t.length;l++)c=document.getElementById(r+(0,o.default)(t[l])+"TabsSection"),c&&c.classList.add("hide")}},1425:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.showTooltip=function(e,t){e.setAttribute("title",t),e.classList.add("lfr-portal-tooltip")}},7212:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.PortletInit=void 0;var n=l(r(8633)),o=l(r(6549)),i=l(r(889)),a=l(r(1842)),s=l(r(7737)),c=r(6134);function l(e){return e&&e.__esModule?e:{default:e}}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const f=window.history&&window.history.pushState;let p=!1;const h={},y=[];let _;class g{constructor(e){this._portletId=e,this.constants=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEac
20164h((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},s.default),_||(_=r.g.portlet.data.pageRenderState,this._updateHistory(!0)),this.portletModes=_.portlets[this._portletId].allowedPM.slice(0),this.windowStates=_.portlets[this._portletId].allowedWS.slice(0)}_executeAction(e,t){return new Promise(((r,n)=>{(0,c.getUrl)(_,"ACTION",this._portletId,e).then((e=>{const i=(0,c.generateActionUrl)(this._portletId,e,t);(0,o.default)(i.url,i).then((e=>e.text())).then((e=>{const t=this._updatePageStateFromString(e,this._portletId);r(t)})).catch((e=>{n(e)}))}))}))}_hasListener(e){return Object.keys(h).map((e=>h[e].id)).includes(e)}_reportError(e,t){Object.keys(h).map((r=>{const n=h[r];return n.id===e&&"portlet.onError"===n.type&&setTimeout((()=>{n.handler("portlet.onError",t)})),!1}))}_setPageState(e,t){if("string"!=typeof t)throw new TypeError("Invalid update string: ".concat(t));this._updatePageState(t,e).then((e=>{this._updatePortletStates(e)}),(t=>{p=!1,this._reportError(e,t)}))}
20164_setState(e){const t=(0,c.getUpdatedPublicRenderParameters)(_,this._portletId,e),r=[];Object.keys(t).forEach((e=>{const n=t[e],o=_.prpMap[e];Object.keys(o).forEach((e=>{if(e!==this._portletId){const t=o[e].split("|"),i=t[0],a=t[1];void 0===n?delete _.portlets[i].state.parameters[a]:_.portlets[i].state.parameters[a]=[...n],r.push(i)}}))}));const n=this._portletId;return _.portlets[n].state=e,r.push(n),r.forEach((e=>{_.portlets[e].renderData.content=null})),this._updateHistory(),Promise.resolve(r)}_setupAction(e,t){if(this.isInProgress())throw{message:"Operation is already in progress",name:"AccessDeniedException"};if(!this._hasListener(this._portletId))throw{message:"No onStateChange listener registered for portlet: ".concat(this._portletId),name:"NotInitializedException"};return p=!0,this._executeAction(e,t).then((e=>this._updatePortletStates(e).then((e=>(p=!1,e)))),(e=>{p=!1,this._reportError(this._portletId,e)}))}_updateHistory(e){f&&(0,c.getUrl)(_,"RENDER",null,{}).then((t=>{const r=JSON.stringify(_);if(e)history.replaceState(r,"");else try{history.pushState(r,"",t)}catch(e){}}))}_updatePageState(e){return new Promise(((t,r)=>{try{t(this._updatePageStateFromString(e,this._portletId))}catch(e){r(new Error("Partial Action decode status: ".concat(e.message)))}}))}_updatePageStateFromString(e,t){const r=(0,c.decodeUpdateString)(_,e),n=[];let o=!1;return Object.entries(r).forEach((([e,t])=>{_.portlets[e]=t,n.push(e),o=!0})),o&&t&&this._updateHistory(),n}_updatePortletStates(e){return new Promise((t=>{0===e.length?p=!1:e.forEach((e=>{this._updateStateForPortlet(e)})),t(e)}))}_updateState(e){if(p)throw{message:"Operation in progress",name:"AccessDeniedException"};if(!this._hasListener(this._portletId))throw{message:"No onStateChange listener registered for portlet: ".concat(this._portletId),name:"NotInitializedException"};p=!0,this._setState(e).then((e=>{this._updatePortletStates(e)})).catch((e=>{p=!1,this._reportError(this._portletId,e)}))}_updateStateForPortlet(e){const t=y.map((e=>e.handle));Object.entries(h).forEach((([r,n])=>{"portlet.onStateChange"===n.type&&(n.id!==e||t.includes(r)||y.push(n))})),y.length>0&&setTimeout((()=>{for(p=!0;y.length>0;){const e=y.shift(),t=e.handler,r=e.id;if(!_.portlets[r])continue;const n=_.portlets[r].renderData,o=new a.default(_.portlets[r].state);n&&n.content?t("portlet.onStateChange",o,n):t("portlet.onStateChange",o)}p=!1}))}action(...e){let t=null,r=0,n=null;return e.forEach((e=>{if(e instanceof HTMLFormElement){if(null!==n)throw new TypeError("Too many [object HTMLFormElement] arguments: ".concat(e,", ").concat(n));n=e}else if((0,i.default)(e)){if((0,c.validateParameters)(e),null!==t)throw new TypeError("Too many parameters arguments");t=e}else if(void 0!==e){const t=Object.prototype.toString.call(e);throw new TypeError("Invalid argument type. Argument ".concat(r+1," is of type ").concat(t))}r++})),n&&(0,c.validateForm)(n),this._setupAction(t,n).then((e=>{Promise.resolve(e)})).catch((e=>{Promise.reject(e)}))}addEventListener(e,t){if(arguments.length>2)throw new TypeError("Too many arguments passed to addEventListener");if("string"!=typeof e||"function"!=typeof t)throw new TypeError("Invalid arguments passed to addEventListener");const r=this._portletId;if(e.startsWith("portlet.")&&"portlet.onStateChange"!==e&&"portlet.onError"!==e)throw new TypeError("The system event type is invalid: ".concat(e));const o=(0,n.default)(),i={handle:o,handler:t,id:r,type:e};return h[o]=i,"portlet.onStateChange"===e&&this._updateStateForPortlet(this._portletId),o}createResourceUrl(e,t,r){if(arguments.length>3)throw new TypeError("Too many arguments. 3 arguments are allowed.");if(e){if(!(0,i.default)(e))throw new TypeError("Invalid argument type. Resource parameters must be a parameters object.");(0,c.validateParameters)(e)}let n=null;if(t){if("string"!=typeof t)throw new TypeError("Invalid argument type. Cacheability argument must be a string.");if("cacheLevelPage"!==t&&"cacheLevelPortlet"!==t&&"cacheLevelFull"!==t)throw new TypeError("Invalid cacheability argument: ".concat(t));n=t}if(n||(n="cacheLevelPage"),r&&"string"!=typeof r)throw new TypeError("Invalid argument type. Resource ID argument must be a string.");return(0,c.getUrl)(_,"RESOURCE",this._portletId,e,n,r)}
20164dispatchClientEvent(e,t){if((0,c.validateArguments)(arguments,2,2,["string"]),e.match(new RegExp("^portlet[.].*")))throw new TypeError("The event type is invalid: "+e);return Object.keys(h).reduce(((r,n)=>{const o=h[n];return e.match(o.type)&&(o.handler(e,t),r++),r}),0)}isInProgress(){return p}newParameters(e={}){const t={};return Object.keys(e).forEach((r=>{Array.isArray(e[r])&&(t[r]=[...e[r]])})),t}newState(e){return new a.default(e)}removeEventListener(e){if(arguments.length>1)throw new TypeError("Too many arguments passed to removeEventListener");if(null==e)throw new TypeError("The event handle provided is ".concat(typeof e));let t=!1;if((0,i.default)(h[e])&&h[e].id===this._portletId){delete h[e];const r=y.length;for(let t=0;t<r;t++){const r=y[t];r&&r.handle===e&&y.splice(t,1)}t=!0}if(!t)throw new TypeError("The event listener handle doesn't match any listeners.")}setRenderState(e){if((0,c.validateArguments)(arguments,1,1,["object"]),_.portlets&&_.portlets[this._portletId]){const t=_.portlets[this._portletId];(0,c.validateState)(e,t),this._updateState(e)}}startPartialAction(e){const t=this;let r=null;if(arguments.length>1)throw new TypeError("Too many arguments. 1 arguments are allowed");if(void 0!==e){if(!(0,i.default)(e))throw new TypeError("Invalid argument type. Argument is of type ".concat(typeof e));(0,c.validateParameters)(e),r=e}if(!0===p)throw{message:"Operation in progress",name:"AccessDeniedException"};if(!this._hasListener(this._portletId))throw{message:"No onStateChange listener registered for portlet: ".concat(this._portletId),name:"NotInitializedException"};p=!0;const n={setPageState(e){t._setPageState(t._portletId,e)},url:""};return(0,c.getUrl)(_,"PARTIAL_ACTION",this._portletId,r).then((e=>(n.url=e,n)))}}t.PortletInit=g;var v=g;t.default=v},1842:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.RenderState=void 0;var n=i(r(889)),o=i(r(7737));function i(e){return e&&e.__esModule?e:{default:e}}class a{constructor(e){(0,n.default)(e)?this.from(e):(this.parameters={},this.portletMode=o.default.VIEW,this.windowState=o.default.NORMAL)}clone(){return new a(this)}from(e){this.parameters={},Object.keys(e.parameters).forEach((t=>{Array.isArray(e.parameters[t])&&(this.parameters[t]=e.parameters[t].slice(0))})),this.setPortletMode(e.portletMode),this.setWindowState(e.windowState)}getPortletMode(){return this.portletMode}getValue(e,t){if("string"!=typeof e)throw new TypeError("Parameter name must be a string");let r=this.parameters[e];return Array.isArray(r)&&(r=r[0]),void 0===r&&void 0!==t&&(r=t),r}getValues(e,t){if("string"!=typeof e)throw new TypeError("Parameter name must be a string");return this.parameters[e]||t}getWindowState(){return this.windowState}remove(e){if("string"!=typeof e)throw new TypeError("Parameter name must be a string");void 0!==this.parameters[e]&&delete this.parameters[e]}setPortletMode(e){if("string"!=typeof e)throw new TypeError("Portlet Mode must be a string");e!==o.default.EDIT&&e!==o.default.HELP&&e!==o.default.VIEW||(this.portletMode=e)}setValue(e,t){if("string"!=typeof e)throw new TypeError("Parameter name must be a string");if("string"!=typeof t&&null!==t&&!Array.isArray(t))throw new TypeError("Parameter value must be a string, an array or null");Array.isArray(t)||(t=[t]),this.parameters[e]=t}setValues(e,t){this.setValue(e,t)}setWindowState(e){if("string"!=typeof e)throw new TypeError("Window State must be a string");e!==o.default.MAXIMIZED&&e!==o.default.MINIMIZED&&e!==o.default.NORMAL||(this.windowState=e)}}t.RenderState=a;var s=a;t.default=s},5659:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.minimizePortlet=function(e,t,r){r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({doAsUserId:themeDisplay.getDoAsUserIdEncoded(),plid:themeDisplay.getPlid()},r);const s=document.querySelector(e);
20164if(s){const e=s.querySelector(".portlet-content-container");if(e){const c=e.classList.contains("d-none");if(c?(e.classList.remove("d-none"),s.classList.remove("portlet-minimized")):(e.classList.add("d-none"),s.classList.add("portlet-minimized")),t){const e=c?'Minimizza':'Ripristina';t.setAttribute("alt",e),t.setAttribute("title",e);const r=t.querySelector(".taglib-text-icon");r&&(r.innerHTML=e);const n=t.querySelector("i");n&&(n.classList.remove("icon-minus","icon-resize-vertical"),c?(n.classList.add("icon-minus"),n.classList.remove("icon-resize-vertical")):(n.classList.add("icon-resize-vertical"),n.classList.remove("icon-minus")))}const l=(0,i.default)(s.id),u=(0,o.default)({cmd:"minimize",doAsUserId:r.doAsUserId,p_auth:Liferay.authToken,p_l_id:r.plid,p_p_id:l,p_p_restore:c,p_v_l_s_g_id:themeDisplay.getSiteGroupId()});(0,n.default)(themeDisplay.getPathMain()+"/portal/update_layout",{body:u,method:"POST"}).then((e=>{if(e.ok&&c){const e={doAsUserId:r.doAsUserId,p_l_id:r.plid,p_p_boundary:!1,p_p_id:l,p_p_isolated:!0};(0,n.default)((0,a.default)(themeDisplay.getPathMain()+"/portal/render_portlet",e)).then((e=>e.text())).then((e=>{const t=document.createRange();t.selectNode(s),s.innerHTML="";const r=t.createContextualFragment(e);s.appendChild(r)})).catch((e=>{}))}})).catch((e=>{}))}}},t.default=void 0;var n=s(r(6549)),o=s(r(7494)),i=s(r(1166)),a=s(r(4821));function s(e){return e&&e.__esModule?e:{default:e}}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var u={register:s(r(8203)).default};t.default=u},7737:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.PortletConstants=void 0;const r={EDIT:"edit",HELP:"help",VIEW:"view",MAXIMIZED:"maximized",MINIMIZED:"minimized",NORMAL:"normal",FULL:"cacheLevelFull",PAGE:"cacheLevelPage",PORTLET:"cacheLevelPortlet"};t.PortletConstants=r;var n=r;t.default=n},6134:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateState=t.validatePortletId=t.validateParameters=t.validateForm=t.validateArguments=t.getUrl=t.getUpdatedPublicRenderParameters=t.generatePortletModeAndWindowStateString=t.generateActionUrl=t.encodeFormAsString=t.decodeUpdateString=void 0;const r="p_r_p_",n="priv_r_p_",o=function(e,t){let r=!1;void 0===e&&void 0===t&&(r=!0),void 0!==e&&void 0!==t||(r=!1),e.length!==t.length&&(r=!1);for(let n=e.length-1;n>=0;n--)e[n]!==t[n]&&(r=!1);return r};t.decodeUpdateString=function(e,t){const r=e&&e.portlets?e.portlets:{};try{const n=JSON.parse(t);n.portlets&&Object.keys(r).forEach((t=>{const i=n.portlets[t].state,a=r[t].state;if(!i||!a)throw new Error("Invalid update string.\nold state=".concat(a,"\nnew state=").concat(i));(function(e,t,r){let n=!1;if(e&&e.portlets&&e.portlets[r]){const i=e.portlets[r].state;if(!t.portletMode||!t.windowState||!t.parameters)throw new Error("Error decoding state: ".concat(t));t.porletMode!==i.portletMode||t.windowState!==i.windowState?n=!0:(Object.keys(t.parameters).forEach((e=>{const r=t.parameters[e],a=i.parameters[e];o(r,a)||(n=!0)})),Object.keys(i.parameters).forEach((e=>{t.parameters[e]||(n=!0)})))}return n})(e,i,t)&&(r[t]=n.portlets[t])}))}catch(e){}return r};const i=function(e,t){const r=[];for(let n=0;n<t.elements.length;n++){const o=t.elements[n],i=o.name,a=o.nodeName.toUpperCase(),s="INPUT"===a?o.type.toUpperCase():"",c=o.value;if(i&&!o.disabled&&"FILE"!==s)if("SELECT"===a&&o.multiple)[...o.options].forEach((t=>{if(t.checked){const n=t.value,o=encodeURIComponent(e+i)+"="+encodeURIComponent(n);r.push(o)}}));else if("CHECKBOX"!==s&&"RADIO"!==s||o.checked){const t=encodeURIComponent(e+i)+"="+encodeURIComponent(c);r.push(t)}}return r.join("&")};t.encodeFormAsString=i;const a=function(e,t){let r="";return Array.isArray(t)&&(0===t.length?r+="&"+encodeURIComponent(e)+"=":t.forEach((t=>{r+="&"+encodeURIComponent(e),r+=null===t?"=":"="+encodeURIComponent(t)}))),r};t.generateActionUrl=function(e,t,r){const n={credentials:"same-origin",method:"POST",url:t};if(r)if("multipart/form-data"===r.enctype){const e=new FormData(r);n.body=e}else{const o=i(e,r);"GET"===(r.method?r.method.toUpperCase():"GET")?(t.indexOf("?")>=0?t+="&".concat(o):t+="?".concat(o),n.url=t):(n.body=o,n.headers={"Content-Type":"application/x-www-form-urlencoded"})}return n};const s=function(e,t,o,i,s){let c="";if(e.portlets&&e.portlets[t]){const l=e.portlets[t];
20164if(l&&l.state&&l.state.parameters){const e=l.state.parameters[o];void 0!==e&&(c+=a(i===r?s:i===n?t+n+o:t+o,e))}}return c},c=function(e,t){let r="";if(e.portlets){const n=e.portlets[t];if(n.state){const e=n.state;r+="&p_p_mode="+encodeURIComponent(e.portletMode),r+="&p_p_state="+encodeURIComponent(e.windowState)}}return r};t.generatePortletModeAndWindowStateString=c,t.getUpdatedPublicRenderParameters=function(e,t,r){const n={};if(e&&e.portlets){const i=e.portlets[t];if(i&&i.pubParms){const a=i.pubParms;Object.keys(a).forEach((i=>{if(!function(e,t,r,n){let i=!1;if(e&&e.portlets){const a=e.portlets[t];if(r.parameters[n]&&a.state.parameters[n]){const e=r.parameters[n],t=a.state.parameters[n];i=o(e,t)}}return i}(e,t,r,i)){const e=a[i];n[e]=r.parameters[i]}}))}}return n},t.getUrl=function(e,t,o,i,l,u){let d="cacheLevelPage",f="",p="";if(e&&e.portlets){"RENDER"===t&&void 0===o&&(o=null);const i=e.portlets[o];if(i&&("RESOURCE"===t?(p=decodeURIComponent(i.encodedResourceURL),l&&(d=l),p+="&p_p_cacheability="+encodeURIComponent(d),u&&(p+="&p_p_resource_id="+encodeURIComponent(u))):"RENDER"===t&&null!==o?p=decodeURIComponent(i.encodedRenderURL):"RENDER"===t?p=decodeURIComponent(e.encodedCurrentURL):"ACTION"===t?(p=decodeURIComponent(i.encodedActionURL),p+="&p_p_hub="+encodeURIComponent("0")):"PARTIAL_ACTION"===t&&(p=decodeURIComponent(i.encodedActionURL),p+="&p_p_hub="+encodeURIComponent("1")),"RESOURCE"!==t||"cacheLevelFull"!==d)){if(o&&(p+=c(e,o)),o&&(f="",i.state&&i.state.parameters)){const t=i.state.parameters;Object.keys(t).forEach((t=>{(function(e,t,r){let n=!1;if(e&&e.portlets){const o=e.portlets[t];o&&o.pubParms&&(n=Object.keys(o.pubParms).includes(r))}return n})(e,o,t)||(f+=s(e,o,t,n))})),p+=f}if(e.prpMap){f="";const t={};Object.keys(e.prpMap).forEach((n=>{Object.keys(e.prpMap[n]).forEach((o=>{const i=e.prpMap[n][o].split("|");Object.hasOwnProperty.call(t,n)||(t[n]=s(e,i[0],i[1],r,n),f+=t[n])}))})),p+=f}}}
20164return i&&(f="",Object.keys(i).forEach((e=>{f+=a(o+e,i[e])})),p+=f),Promise.resolve(p)},t.validateArguments=function(e=[],t=0,r=1,n=[]){if(e.length<t)throw new TypeError("Too few arguments provided: Number of arguments: ".concat(e.length));if(e.length>r)throw new TypeError("Too many arguments provided: ".concat([].join.call(e,", ")));if(Array.isArray(n)){let t=Math.min(e.length,n.length)-1;for(;t>=0;t--){if(typeof e[t]!==n[t])throw new TypeError("Parameter ".concat(t," is of type ").concat(typeof e[t]," rather than the expected type ").concat(n[t]));if(null===e[t]||void 0===e[t])throw new TypeError("Argument is ".concat(typeof e[t]))}}},t.validateForm=function(e){if(!(e instanceof HTMLFormElement))throw new TypeError("Element must be an HTMLFormElement");const t=e.method?e.method.toUpperCase():void 0;if(t&&"GET"!==t&&"POST"!==t)throw new TypeError("Invalid form method ".concat(t,". Allowed methods are GET & POST"));const r=e.enctype;if(r&&"application/x-www-form-urlencoded"!==r&&"multipart/form-data"!==r)throw new TypeError("Invalid form enctype ".concat(r,". Allowed: 'application/x-www-form-urlencoded' & 'multipart/form-data'"));if(r&&"multipart/form-data"===r&&"POST"!==t)throw new TypeError("Invalid method with multipart/form-data. Must be POST");if(!r||"application/x-www-form-urlencoded"===r){const t=e.elements.length;for(let r=0;r<t;r++)if("INPUT"===e.elements[r].nodeName.toUpperCase()&&"FILE"===e.elements[r].type.toUpperCase())throw new TypeError("Must use enctype = 'multipart/form-data' with input type FILE.")}};const l=function(e){if(null==e)throw new TypeError("The parameter object is: ".concat(typeof e));Object.keys(e).forEach((t=>{if(!Array.isArray(e[t]))throw new TypeError("".concat(t," parameter is not an array"));if(!e[t].length)throw new TypeError("".concat(t," parameter is an empty array"))}))};t.validateParameters=l,t.validatePortletId=function(e={},t=""){return e.portlets&&Object.keys(e.portlets).includes(t)},t.validateState=function(e={},t={}){l(e.parameters);const r=e.portletMode;if("string"!=typeof r)throw new TypeError("Invalid parameters. portletMode is ".concat(typeof r));{const e=t.allowedPM;if(!e.includes(r.toLowerCase()))throw new TypeError("Invalid portletMode=".concat(r," is not in ").concat(e))}const n=e.windowState;if("string"!=typeof n)throw new TypeError("Invalid parameters. windowState is ".concat(typeof n));{const e=t.allowedWS;if(!e.includes(n.toLowerCase()))throw new TypeError("Invalid windowState=".concat(n," is not in ").concat(e))}}},8203:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.register=void 0;var n,o=(n=r(7212))&&n.__esModule?n:{default:n},i=r(6134);const a=function(e){(0,i.validateArguments)(arguments,1,1,["string"]);const t=r.g.portlet.data.pageRenderState;return new Promise(((r,n)=>{(0,i.validatePortletId)(t,e)?r(new o.default(e)):n(new Error("Invalid portlet ID"))}))};t.register=a;var s=a;t.default=s},7370:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i(r(6454)),o=i(r(36));function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const l={breakpoint:576,content:".sidenav-content",gutter:"12px",loadingIndicatorTPL:'<div class="loading-animation loading-animation-md"></div>',navigation:".sidenav-menu-slider",position:"left",type:"relative",typeMobile:"relative",url:null,width:"225px"},u=new WeakMap;function d(e){if(e&&e.jquery){if(e.length>1)throw new Error("getElement(): Expected at most one element, got ".concat(e.length));e=e.get(0)}return!e||e instanceof HTMLElement||(e=e.element),e}function f(e){return e=d(e),u.get(e)}const p=[/^aria-/,/^data-/,/^type$/];function h(e,t,r=null){const n=new CustomEvent(t,{detail:r});e.dispatchEvent(n)}function y(e,t){g(e,{[t]:!0}
20164)}function _(e,t){g(e,{[t]:!1})}function g(e,t){(e=d(e))&&Object.entries(t).forEach((([t,r])=>{t.split(/\s+/).forEach((t=>{r?e.classList.add(t):e.classList.remove(t)}))}))}function v(e,t){return e=d(e),t.split(/\s+/).every((t=>e.classList.contains(t)))}function m(e,t){(e=d(e))&&Object.entries(t).forEach((([t,r])=>{e.style[t]=r}))}function b(e){return"number"==typeof e?e+"px":"string"==typeof e&&e.match(/^\s*\d+\s*$/)?e.trim()+"px":e}function w(e){return e.getBoundingClientRect().left+(e.ownerDocument.defaultView.pageOffsetX||0)}const O={};let j;function S(e,t,r){if(e){O[t]||(O[t]={},document.addEventListener(t,(e=>function(e,t){Object.keys(O[e]).forEach((r=>{let n=!1,o=t.target;for(;o&&(n=o.matches&&o.matches(r),!n);)o=o.parentNode;n&&O[e][r].emit("click",t)}))}(t,e))));const o=O[t],i="string"==typeof e?e:function(e){if((e=d(e)).id)return"#".concat(e.id);let t=e.parentNode;for(;t&&!t.id;)t=t.parentNode;const r=Array.from(e.attributes).map((({name:e,value:t})=>p.some((t=>t.test(e)))?"[".concat(e,"=").concat(JSON.stringify(t),"]"):null)).filter(Boolean).sort();return[t?"#".concat(t.id," "):"",e.tagName.toLowerCase(),...r].join("")}(e);o[i]||(o[i]=new n.default);const a=o[i].on(t,(e=>{e.defaultPrevented||r(e)}));return{dispose(){a.dispose()}}}return null}function L(e){return parseInt(e,10)||0}function P(e,t){e=d(e),this.init(e,t)}function E(){const e=document.querySelectorAll('[data-toggle="liferay-sidenav"]');Array.from(e).forEach(P.initialize)}P.TRANSITION_DURATION=500,P.prototype={_bindUI(){this._subscribeClickTrigger(),this._subscribeClickSidenavClose()},_emit(e){this._emitter.emit(e,this)},_getSidenavWidth(){const e=this.options.widthOriginal;let t=e;const r=window.innerWidth;return r<e+40&&(t=r-40),t},_getSimpleSidenavType(){const e=this._getType();return this._isDesktop()&&"fixed-push"===e?"desktop-fixed-push":this._isDesktop()||"fixed-push"!==e?"fixed":"mobile-fixed-push"},_getType(){return this._isDesktop()?this.options.type:this.options.typeMobile},_isDesktop(){return window.innerWidth>=this.options.breakpoint},_isSidenavRight(){const e=this.options,t=document.querySelector(e.container);if(t)return v(t,"sidenav-right")},_isSimpleSidenavClosed(){const e=this.options,t=e.openClass,r=document.querySelector(e.container);if(r)return!v(r,t)},_loadUrl(e,t){const r=this,n=e.querySelector(".sidebar-body");if(!r._fetchPromise&&n){for(;n.firstChild;)n.removeChild(n.firstChild);const e=document.createElement("div");y(e,"sidenav-loading"),e.innerHTML=r.options.loadingIndicatorTPL,n.appendChild(e),r._fetchPromise=Liferay.Util.fetch(t),r._fetchPromise.then((e=>{if(!e.ok)throw new Error("Failed to fetch ".concat(t));return e.text()})).then((t=>{const o=document.createRange();o.selectNode(n);const i=o.createContextualFragment(t);n.removeChild(e),n.appendChild(i),r.setHeight()})).catch((e=>{console.error(e)}))}},_onClosed(){const e=this.options,t=document.querySelector(e.container);t&&(this._handleClosed||(this._handleClosed=()=>{"relative"===this._getType()&&v(t,"open")&&_(t,"sidenav-transition")},document.addEventListener("closed.lexicon.sidenav",this._handleClosed)))},_onClosedStart(){const e=this.options,t=document.querySelector(e.container),r=document.querySelector(e.content);t&&r&&(this._handleClosedStart||(this._handleClosedStart=()=>{if("relative"===this._getType()&&v(t,"open")&&r.closest(".page-maximized")){let n=document.body.scrollWidth-r.getBoundingClientRect().right,o=e.gutter+e.width;const i=getComputedStyle(r).maxWidth||getComputedStyle(r).width;/px$/.test(i)&&(n=(document.body.scrollWidth-L(i))/2,n>e.width?o="":n>0&&n<e.width&&(o=e.gutter+e.width-n)),y(t,"sidenav-transition"),m(r,{"padding-right":b(o)})}},document.addEventListener("closedStart.lexicon.sidenav",this._handleClosedStart)))},_onOpen(){const e=this.options,t=document.querySelector(e.container);t&&(this._handleOpen||(this._handleOpen=()=>{"relative"===this._getType()&&v(t,"open")&&_(t,"sidenav-transition")},document.addEventListener("open.lexicon.sidenav",this._handleOpen)))},_onOpenStart(){const e=this.options,t=document.querySelector(e.container),r=document.querySelector(e.content);t&&r&&(this._handleOpenStart||(this._handleOpenStart=n=>{if("relative"===this._getType()&&v(t,"open")&&r.closest(".page-maximized")){const o=document.querySelector(n.detail.options.container+" .sidenav-menu");if(!o)return;const i=o.getBoundingClientRect().width,a=document.body.scrollWidth-r.getBoundingClientRect().right-i/2,s=a>0?e.width+e.gutter-a:e.width+e.gutter;y(t,"sidenav-transition"),m(r,{"padding-right":b(s)})}},document.addEventListener("openStart.lexicon.sidenav",this._handleOpenStart)))},_onScreenChange(){const e=this.options,t=document.querySelector(e.container),r=document.querySelector(e.content);if(!t||!r)return;let n=this._isDesktop();this._handleOnScreenChange||(this._handleOnScreenChange=()=>{const e=this._getType();"relative"===e&&v(t,"open")&&(this.setHeight(),this.setWidth()),this._isDesktop()!==n&&("relative"!==e?(y(t,"sidenav-fixed"),r.style.paddingRight="",r.style.minHeight=""):_(t,"sidenav-fixed"),n=this._isDesktop())},document.addEventListener("screenChange.lexicon.sidenav",this._handleOnScreenChange))},_renderNav(){const e=this.options,t=document.querySelector(e.container),r=t.querySelector(e.navigation);if(!t||!r)return;const n=r.querySelector(".sidenav-menu"),o=v(t,"closed"),i=this._isSidenavRight(),a=this._getSidenavWidth();o?(m(n,{width:b(a)}),i&&m(n,{[e.rtl?"left":"right"]:b(a)})):(this.showSidenav(),this.setHeight())},_renderUI(){const e=this.options,t=document.querySelector(e.container);if(!t)return;const r=this.toggler,n=this._getType();this.useDataAttribute||(j||(j=(0,o.default)((()=>{h(document,"screenChange.lexicon.sidenav")}),150),window.addEventListener("resize",j)),this._onClosedStart(),this._onClosed(),this._onOpenStart(),this._onOpen(),this._onScreenChange(),this._isDesktop()||(g(t,{closed:!0,open:!1}),g(r,{active:!1,open:!1})),"right"===e.position&&y(t,"sidenav-right"),"relative"!==n&&y(t,"sidenav-fixed"),this._renderNav()),m(t,{display:""})},_subscribeClickSidenavClose(){const e=this,t=e.options.container;if(!e._sidenavCloseSubscription){const r="".concat(t," .sidenav-close");e._sidenavCloseSubscription=S(r,"click",(function(t){t.preventDefault(),e.toggle(
20164)}))}},_subscribeClickTrigger(){const e=this;if(!e._togglerSubscription){const t=e.toggler;e._togglerSubscription=S(t,"click",(function(t){e.toggle(),t.preventDefault()}))}},_subscribeSidenavTransitionEnd(e,t){setTimeout((()=>{_(e,"sidenav-transition"),t()}),P.TRANSITION_DURATION)},clearHeight(){const e=this.options,t=document.querySelector(e.container);t&&[t.querySelector(e.content),t.querySelector(e.navigation),t.querySelector(".sidenav-menu")].forEach((e=>{m(e,{height:"","min-height":""})}))},destroy(){const e=this;e._sidenavCloseSubscription&&(e._sidenavCloseSubscription.dispose(),e._sidenavCloseSubscription=null),e._togglerSubscription&&(e._togglerSubscription.dispose(),e._togglerSubscription=null),u.delete(e.toggler),document.removeEventListener("closedStart.lexicon.sidenav",e._handleClosedStart),document.removeEventListener("closed.lexicon.sidenav",e._handleClosed),document.removeEventListener("openStart.lexicon.sidenav",e._handleOpenStart),document.removeEventListener("open.lexicon.sidenav",e._handleOpen),document.removeEventListener("screenChange.lexicon.sidenav",e._handleOnScreenChange),j&&(window.removeEventListener("resize",j),j=null)},hide(){this.useDataAttribute?this.hideSimpleSidenav():this.toggleNavigation(!1)},hideSidenav(){const e=this.options,t=document.querySelector(e.container);if(t){const r=t.querySelector(e.content),n=t.querySelector(e.navigation),o=n.querySelector(".sidenav-menu"),i=this._isSidenavRight();let a=e.rtl?"right":"left";i&&(a=e.rtl?"left":"right"),m(r,{["padding-"+a]:"",[a]:""}),m(n,{width:""}),i&&m(o,{[a]:b(this._getSidenavWidth())})}},hideSimpleSidenav(){const e=this,t=e.options;if(!e._isSimpleSidenavClosed()){const r=document.querySelector(t.container),n=document.querySelector(t.content);if(!r||!n)return;const o=t.closedClass,i=t.openClass,a=e.toggler,s=a.dataset.target||a.getAttribute("href");e._emit("closedStart.lexicon.sidenav"),h(document,"closedStart.lexicon.sidenav",e),e._subscribeSidenavTransitionEnd(n,(()=>{_(r,"sidenav-transition"),_(a,"sidenav-transition"),e._emit("closed.lexicon.sidenav"),h(document,"closed.lexicon.sidenav",e)})),v(n,i)&&g(n,{[o]:!0,[i]:!1,"sidenav-transition":!0}),y(r,"sidenav-transition"),y(a,"sidenav-transition"),g(r,{[o]:!0,[i]:!1});const c=document.querySelectorAll('[data-target="'.concat(s,'"], [href="').concat(s,'"]'));Array.from(c).forEach((e=>{g(e,{active:!1,[i]:!1}),g(e,{active:!1,[i]:!1})}))}},init(e,t){const r="liferay-sidenav"===e.dataset.toggle;(t=s(s({},l),t)).breakpoint=L(t.breakpoint),t.container=t.container||e.dataset.target||e.getAttribute("href"),t.gutter=L(t.gutter),t.rtl="rtl"===document.dir,t.width=L(t.width),t.widthOriginal=t.width,r&&(t.closedClass=e.dataset.closedClass||"closed",t.content=e.dataset.content,t.loadingIndicatorTPL=e.dataset.loadingIndicatorTpl||t.loadingIndicatorTPL,t.openClass=e.dataset.openClass||"open",t.type=e.dataset.type,t.typeMobile=e.dataset.typeMobile,t.url=e.dataset.url,t.width=""),this.toggler=e,this.options=t,this.useDataAttribute=r,this._emitter=new n.default,this._bindUI(),this._renderUI()},on(e,t){return this._emitter.on(e,t)},setHeight(){const e=this.options,t=document.querySelector(e.container);if(!t)return;const r=this._getType();if("fixed"!==r&&"fixed-push"!==r){const r=t.querySelector(e.content),n=t.querySelector(e.navigation),o=t.querySelector(".sidenav-menu"),i=r.closest(".page-maximized")?window.innerHeight-o.getBoundingClientRect().top:r.getBoundingClientRect().height,a=n.getBoundingClientRect().height,s=b(Math.max(i,a));m(r,{"min-height":s}),m(n,{height:"100%","min-height":s}),m(o,{height:"100%","min-height":s})}},setWidth(){const e=this.options,t=document.querySelector(e.container),r=t.querySelector(e.content),n=t.querySelector(e.navigation);if(!t||!r||!n)return;const o=n.querySelector(".sidenav-menu"),i=this._isSidenavRight(),a=this._getSidenavWidth(),s=a+e.gutter,c=e.url;c&&this._loadUrl(o,c),m(n,{width:b(a)}),m(o,{width:b(a)});let l=e.rtl?"right":"left";i&&(l=e.rtl?"left":"right");const u="padding-"+l,d=this._isDesktop()?u:l,f=this._getType();if("relative"!==f&&y(t,"sidenav-fixed"),"fixed"!==f){let o=v(t,"open")?w(n)-e.gutter:w(n)-s;const a=w(r),c=L(getComputedStyle(r).width);let l="";e.rtl&&i||!e.rtl&&"left"===e.position?(o=w(n)+s,o>a&&(l=o-a)):(e.rtl&&"left"===e.position||!e.rtl&&i)&&o<a+c&&(l=a+c-o,l>=s&&(l=s)),m(r,{[d]:b(l)}
20164)}},show(){this.useDataAttribute?this.showSimpleSidenav():this.toggleNavigation(!0)},showSidenav(){const e=this.options,t=document.querySelector(e.container),r=t.querySelector(e.navigation);if(!t||!r)return;const n=r.querySelector(".sidenav-menu"),o=e.url;o&&this._loadUrl(n,o),this.setWidth()},showSimpleSidenav(){const e=this,t=e.options;if(e._isSimpleSidenavClosed()){const r=document.querySelector(t.container),n=document.querySelector(t.content);if(!r||!n)return;const o=t.closedClass,i=t.openClass,a=e.toggler,s=a.dataset.url;s&&e._loadUrl(r,s),e._emit("openStart.lexicon.sidenav"),h(document,"openStart.lexicon.sidenav",e),e._subscribeSidenavTransitionEnd(n,(()=>{_(r,"sidenav-transition"),_(a,"sidenav-transition"),e._emit("open.lexicon.sidenav"),h(document,"open.lexicon.sidenav",e)})),g(n,{[o]:!1,[i]:!0,"sidenav-transition":!0}),g(r,{[o]:!1,[i]:!0,"sidenav-transition":!0}),g(a,{active:!0,[i]:!0,"sidenav-transition":!0})}},toggle(){this.useDataAttribute?this.toggleSimpleSidenav():this.toggleNavigation()},toggleNavigation(e){const t=this,r=t.options,n=t._getType(),o=document.querySelector(r.container),i=o.querySelector(".sidenav-menu");if(!o||!i)return;const a=t.toggler,s=r.width,c="boolean"==typeof e?e:v(o,"closed"),l=t._isSidenavRight();if(c?(t._emit("openStart.lexicon.sidenav"),h(document,"openStart.lexicon.sidenav",t)):(t._emit("closedStart.lexicon.sidenav"),h(document,"closedStart.lexicon.sidenav",t)),t._subscribeSidenavTransitionEnd(o,(()=>{const e=o.querySelector(".sidenav-menu");v(o,"closed")?(t.clearHeight(),g(a,{open:!1,"sidenav-transition":!1}),t._emit("closed.lexicon.sidenav"),h(document,"closed.lexicon.sidenav",t)):(g(a,{open:!0,"sidenav-transition":!1}),t._emit("open.lexicon.sidenav"),h(document,"open.lexicon.sidenav",t)),t._isDesktop()||e.focus()})),c){"relative"===n&&t.setHeight(),m(i,{width:b(s)});const e=r.rtl?"left":"right";l&&m(i,{[e]:""})}y(o,"sidenav-transition"),y(a,"sidenav-transition"),c?t.showSidenav():t.hideSidenav(),g(o,{closed:!c,open:c}),g(a,{active:c,open:c})},toggleSimpleSidenav(){this._isSimpleSidenavClosed()?this.showSimpleSidenav():this.hideSimpleSidenav()},visible(){let e;if(this.useDataAttribute)e=this._isSimpleSidenavClosed();else{const t=document.querySelector(this.options.container);if(!t)return;e=v(t,"sidenav-transition")?!v(t,"closed"):v(t,"closed")}return!e}},P.destroy=function(e){const t=f(e);t&&t.destroy()},P.hide=function(e){const t=f(e);t&&t.hide()},P.initialize=function(e,t={}){e=d(e);let r=u.get(e);return r||(r=new P(e,t),u.set(e,r)),r},P.instance=f,"loading"!==document.readyState?E():document.addEventListener("DOMContentLoaded",(()=>{E()}));var T=P;t.default=T},2534:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={BAD_REQUEST:400,INTERNAL_SERVER_ERROR:500,OK:200,SC_DUPLICATE_FILE_EXCEPTION:490,SC_FILE_ANTIVIRUS_EXCEPTION:494,SC_FILE_CUSTOM_EXCEPTION:499,SC_FILE_EXTENSION_EXCEPTION:491,SC_FILE_NAME_EXCEPTION:492,SC_FILE_SIZE_EXCEPTION:493,SC_UPLOAD_REQUEST_SIZE_EXCEPTION:495}},36:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){let r,n=null;return function(...o){const i=this,a=Date.now(),s=()=>{n=setTimeout((()=>{n=null}),t),r=a,e.apply(i,o)};if(null===n)s();else{const e=Math.max(r+t-a,0);clearTimeout(n),n=setTimeout(s,e)}}}},9296:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!e||"object"!=typeof e&&"string"!=typeof e)throw new TypeError("Parameter params must be an object or string");if("string"!=typeof t)throw new TypeError("Parameter baseUrl must be a string");const r=t.startsWith("/")?new URL(t,location.href):new URL(t);return"object"==typeof e?Object.entries(e).forEach((([e,t])=>{r.searchParams.append(e,t)})):new URLSearchParams(e.trim()).forEach(((e,t)=>{e?r.searchParams.append(t,e):r.searchParams.append(t,"")})),r.toString()}},3873:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("function"!=typeof e)throw new TypeError("Parameter callback must be a function");Liferay.Service("/country/get-countries",{active:!0},e)}},9094:(e,t)=>
20164{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("function"!=typeof e)throw new TypeError("Parameter callback must be a function");if("string"!=typeof t)throw new TypeError("Parameter selectKey must be a string");Liferay.Service("/region/get-regions",{active:!0,countryId:parseInt(t,10)},e)}},6549:(e,t)=>{function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t={}){e||(e="/o/");let r=e.url?e.url:e.toString();if(r.startsWith("/")){const t=Liferay.ThemeDisplay.getPathContext();t&&!r.startsWith(t)&&(r=t+r,e="string"==typeof e?r:n(n({},e),{},{url:r})),r=window.location.origin+r}const o=new URL(r),i=new Headers({}),a={};return o.origin===window.location.origin&&(i.set("x-csrf-token",Liferay.authToken),a.credentials="include"),new Headers(t.headers||{}).forEach(((e,t)=>{i.set(t,e)})),fetch(e,n(n(n({},a),t),{},{headers:i}))}},85:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(e=(0,n.default)(e),(0,o.default)(e)){const t=function(e){const t=[];for(;e.parentElement;)e.parentElement.getAttribute("disabled")&&t.push(e.parentElement),e=e.parentElement;return t}(e),r=!e.getAttribute("disabled")&&e.offsetWidth>0&&e.offsetHeight>0&&!t.length,n=e.closest("form");if(!n||r)e.focus();else if(n){const t=n.dataset.fmNamespace+"formReady",r=o=>{n.getAttribute("name")===o.formName&&(e.focus(),Liferay.detach(t,r))};Liferay.on(t,r)}}};var n=i(r(8999)),o=i(r(6515));function i(e){return e&&e.__esModule?e:{default:e}}},8002:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){let r=null;if(void 0!==e&&"FORM"===e.nodeName&&"string"==typeof t){const n=e.dataset.fmNamespace||"";r=e.elements[n+t]||null}return r}},7494:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t={},r=new FormData,n){return Object.entries(t).forEach((([t,i])=>{const a=n?"".concat(n,"[").concat(t,"]"):t;Array.isArray(i)?i.forEach((t=>{e({[a]:t},r)})):!(0,o.default)(i)||i instanceof File?r.append(a,i):e(i,r,a)})),r};var n,o=(n=r(889))&&n.__esModule?n:{default:n}},7535:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("string"==typeof e&&(e=document.querySelector(e)),e&&"FORM"===e.nodeName)if(e.setAttribute("method","post"),(0,n.default)(t)){const{data:r,url:i}=t;if(!(0,n.default)(r))return;(0,o.default)(e,r),void 0===i?submitForm(e):"string"==typeof i&&submitForm(e,i)}else submitForm(e)};var n=i(r(889)),o=i(r(5273));function i(e){return e&&e.__esModule?e:{default:e}}},5273:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){void 0!==e&&"FORM"===e.nodeName&&(0,n.default)(t)&&Object.entries(t).forEach((([t,r])=>{const n=(0,o.default)(e,t);n&&(n.value=r)}))};var n=i(r(889)),o=i(r(8002));function i(e){return e&&e.__esModule?e:{default:e}}},8206:(e,t)=>{function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}
20164Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t={}){const{addSpaceBeforeSuffix:r,decimalSeparator:o,denominator:a,suffixGB:s,suffixKB:c,suffixMB:l}=n(n({},i),t);if("number"!=typeof e)throw new TypeError("Parameter size must be a number");let u=0,d=c;(e/=a)>=a&&(d=l,e/=a,u=1),e>=a&&(d=s,e/=a,u=1);let f=e.toFixed(u);return"."!==o&&(f=f.replace(/\./,o)),f+(r?" ":"")+d};const i={addSpaceBeforeSuffix:!1,decimalSeparator:".",denominator:1024,suffixGB:"GB",suffixKB:"KB",suffixMB:"MB"}},7019:(e,t)=>{function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t={}){const{newLine:r,tagIndent:o}=n(n({},j),t);if("string"!=typeof e)throw new TypeError("Parameter content must be a string");const L=[];e=(e=(e=(e=(e=(e=e.trim()).replace(i,(e=>(L.push(e),w)))).replace(m,"><")).replace(g,"~::~<")).replace(y,"~::~$1$2")).replace(O,(()=>L.shift()));let P=0,E=!1;const T=e.split(b);let C=0,M="";return T.forEach(((e,t)=>{i.test(e)?M+=S(C,r,o)+e:s.test(e)?(M+=S(C,r,o)+e,P++,E=!0,(a.test(e)||l.test(e))&&(P--,E=0!==P)):a.test(e)?(M+=e,P--,E=0!==P):u.exec(T[t-1])&&d.exec(e)&&f.exec(T[t-1]).toString()===p.exec(e)[0].replace("/","").toString()?(M+=e,E||--C):!h.test(e)||_.test(e)||v.test(e)?h.test(e)&&_.test(e)?M+=E?e:S(C,r,o)+e:_.test(e)?M+=E?e:S(--C,r,o)+e:v.test(e)?M+=E?e:S(C,r,o)+e:(c.test(e),M+=S(C,r,o)+e):M+=E?e:S(C++,r,o)+e,new RegExp("^"+r).test(M)&&(M=M.slice(r.length))})),M};const i=/<!\[CDATA\[[\0-\uFFFF]*?\]\]>/g,a=/-->|\]>/,s=/<!/,c=/<\?/,l=/!DOCTYPE/,u=/^<\w/,d=/^<\/\w/,f=/^<[\w:\-.,]+/,p=/^<\/[\w:\-.,]+/,h=/<\w/,y=/\s*(xmlns)(:|=)/g,_=/<\//,g=/</g,v=/\/>/,m=/>\s+</g,b="~::~",w="<~::~CDATA~::~>",O=new RegExp(w,"g"),j={newLine:"\r\n",tagIndent:"\t"};function S(e,t,r){return t+new Array(e+1).join(r)}},1511:(e,t)=>{function r(e,t,r,n){e="string"==typeof e?document.querySelector(e):e._node||e;let o="input[type=checkbox]";r&&(o+="[name=".concat(r,"]"));const i=Array.from(e.querySelectorAll(o));return i.length?i.reduce(((e,r)=>{const{checked:o,disabled:i,name:a,value:s}=r;return s&&a!==t&&o===n&&!i&&e.push(s),e}),[]).join():""}Object.defineProperty(t,"__esModule",{value:!0}),t.getCheckedCheckboxes=function(e,t,n){return r(e,t,n,!0)},t.getUncheckedCheckboxes=function(e,t,n){return r(e,t,n,!1)}},7068:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!(0,o.default)(e)||(0,o.default)(e)&&"IMG"!==e.tagName)throw new TypeError("Parameter imagePreview must be an image");if(!(0,o.default)(t))throw new TypeError("Parameter region must be an object");const r=e.naturalWidth/e.offsetWidth,n=e.naturalHeight/e.offsetHeight;return{height:t.height?t.height*n:e.naturalHeight,width:t.width?t.width*r:e.naturalWidth,x:t.x?Math.max(t.x*r,0):0,y:t.y?Math.max(t.y*n,0):0}};var n,o=(n=r(889))&&n.__esModule?n:{default:n}},4968:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e._node||e._nodes?e.nodeType?e:e._node||null:e}},8999:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=(0,o.default)(e);return"string"==typeof t?document.querySelector(t):t.jquery?t[0]:t};var n,o=(n=r(4968))&&n.__esModule?n:{default:n}},775:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){e&&navigator.geolocation?navigator.geolocation.getCurrentPosition((t=>{e(t.coords.latitude,t.coords.longitude,t)}),t,r):t&&t()}},455:(e,t)=>
20164{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t=""){if(!e)throw new TypeError("Parameter icon must be provided");const r=function(e,t){return'<svg\n\t\t\t\taria-hidden="true"\n\t\t\t\tclass="lexicon-icon lexicon-icon-'.concat(e," ").concat(t,'"\n\t\t\t\tfocusable="false"\n\t\t\t\trole="presentation"\n\t\t\t>\n\t\t\t\t<use href="').concat(Liferay.Icons.spritemap,"#").concat(e,'" />\n\t\t\t</svg>')}(e,t),n=document.createElement("div");return n.innerHTML=r,n.firstChild}},7320:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t=""){return'<svg aria-hidden="true" class="lexicon-icon lexicon-icon-'.concat(e," ").concat(t,'" focusable="false" role="presentation">')+'<use href="'.concat(Liferay.Icons.spritemap,"#").concat(e,'" />')+"</svg>"}},4397:(e,t)=>{let r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){let e=r;if(!e){const t=Liferay.Util.getTop().Liferay.Util,n=Liferay.Util.getWindowName(),o=t.Window.getById(n);o&&(e=o._opener,r=e)}return e||window.opener||window.parent}},1166:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.replace(r,"$1")};const r=/^(?:p_p_id)?_(.*)_.*$/},6797:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("string"!=typeof e)throw new TypeError("portletId must be a string");return"_".concat(e,"_")}},6506:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t=","){return Array.from(e.getElementsByTagName("option")).reduce(((e,t)=>{const{value:r}=t;return r&&e.push(r),e}),[]).join(t)}},260:(e,t)=>{let r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){let e=r;if(!e){let t,n=window.parent;for(;n!==window;){try{if(void 0===n.location.href)break;t=n.themeDisplay}catch(e){break}if(!t||"simulationDeviceIframe"===window.name)break;if(!t.isStatePopUp()||n===n.parent){e=n;break}n=n.parent}e||(e=window),r=e}return e}},4612:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!themeDisplay.isAddSessionIdToURL())return e;let t=e.indexOf(";");if(t>-1)return e;const r=";jsessionid=".concat(themeDisplay.getSessionId());return t=e.indexOf("?"),t>-1?"".concat(e.substring(0,t)).concat(r).concat(e.substring(t)):(t=e.indexOf("//"),t>-1&&t+1===e.lastIndexOf("/")?"".concat(e,"/").concat(r):"".concat(e).concat(r))}},9105:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e=window.name){return(0,o.default)().Liferay.Util.Window.getById(e)};var n,o=(n=r(260))&&n.__esModule?n:{default:n}},7387:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.escapeHTML=function(e){return e.replace(i,(e=>r[e]))},t.unescapeHTML=function(e){return e.replace(a,(e=>(new DOMParser).parseFromString(e,"text/html").documentElement.textContent))},t.MAP_HTML_CHARS_ESCAPED=void 0;const r={'"':"&#034;","&":"&amp;","'":"&#039;","/":"&#047;","<":"&lt;",">":"&gt;","`":"&#096;"};t.MAP_HTML_CHARS_ESCAPED=r;const n={};Object.entries(r).forEach((([e,t])=>{n[t]=e}));const o=Object.keys(r),i=new RegExp("[".concat(o.join(""),"]"),"g"),a=/&([^\s;]+);/g},6515:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,r,n){let i=!1;if(t=(0,o.default)(t)){n||((n={left:(n=t.getBoundingClientRect()).left+window.scrollX,top:n.top+window.scrollY}).bottom=n.top+t.offsetHeight,n.right=n.left+t.offsetWidth),r||(r=window),r=(0,o.default)(r);const a={};if(a.left=r.scrollX,a.right=a.left+r.innerWidth,a.top=r.scrollY,a.bottom=a.top+r.innerHeight,i=n.bottom<=a.bottom&&n.left>=a.left&&n.right<=a.right&&n.top>=a.top,i){const o=r.frameElement;if(o){let s=o.getBoundingClientRect();s={left:s.left+window.scrollX,top:s.top+window.scrollY};const c=s.left-a.left;n.left+=c,n.right+=c;const l=s.top-a.top;n.top+=l,n.bottom+=l,i=e(t,r.parent,n)}}}return i};var n,o=(n=r(8999))&&n.__esModule?n:{default:n}},889:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=typeof e;return"object"===t&&null!==e||"function"===t}},5506:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return window.innerWidth<o.default.PHONE};var n,o=(n=r(3337))&&n.__esModule?n:{default:n}},7442:(e,t,r)=>
20164{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return window.innerWidth<o.default.TABLET};var n,o=(n=r(3337))&&n.__esModule?n:{default:n}},386:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r,n,o;let i=e;"URL"===(null==e||null===(r=e.constructor)||void 0===r?void 0:r.name)&&(i=String(e)),(null===(n=Liferay.SPA)||void 0===n||null===(o=n.app)||void 0===o?void 0:o.canNavigate(i))?(Liferay.SPA.app.navigate(i),t&&Object.keys(t).forEach((e=>{Liferay.once(e,t[e])}))):function(e){let t;try{t=e.startsWith("/")?new URL(e,window.location.origin):new URL(e)}catch(e){return!1}return"http:"===t.protocol||"https:"===t.protocol}(i)&&(window.location.href=i)}},1625:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("string"!=typeof e)throw new TypeError("parameter text must be a string");return e.replace(/[^a-z0-9_-]/gi,"-").replace(/^-+/,"").replace(/--+/,"-").toLowerCase()}},4294:(e,t,r)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){let r;return"object"!=typeof t?r=o(e,t):(r={},Object.keys(t).forEach((n=>{const i=n;n=o(e,n),r[n]=t[i]}))),r};const o=(i=(e,t)=>(void 0!==t&&0!==t.lastIndexOf(e,0)&&(t="".concat(e).concat(t)),t),(0,((n=r(8511))&&n.__esModule?n:{default:n}).default)(i,((...e)=>e.length>1?Array.prototype.join.call(e,"_"):String(e[0]))));var i},1357:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!(0,o.default)(e))throw new TypeError("Parameter obj must be an object");const t=new URLSearchParams;return Object.entries(e).forEach((([e,r])=>{if(Array.isArray(r))for(let n=0;n<r.length;n++)t.append(e,r[n]);else t.append(e,r)})),t};var n,o=(n=r(889))&&n.__esModule?n:{default:n}},742:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const r=(0,o.default)();e.openingWindow=window,r.Liferay.Util._openWindowProvider(e,t)};var n,o=(n=r(260))&&n.__esModule?n:{default:n}},1146:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t={}){return(0,o.default)(e,a(a({},t),{},{p_p_lifecycle:"1"}))};var n,o=(n=r(4821))&&n.__esModule?n:{default:n};function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},4821:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t={}){if("string"!=typeof e)throw new TypeError("basePortletURL parameter must be a string");if(!t||"object"!=typeof t)throw new TypeError("parameters argument must be an object");const r=new Set(["doAsGroupId","doAsUserId","doAsUserLanguageId","p_auth","p_auth_secret","p_f_id","p_j_a_id","p_l_id","p_l_reset","p_p_auth","p_p_cacheability","p_p_i_id","p_p_id","p_p_isolated","p_p_lifecycle","p_p_mode","p_p_resource_id","p_p_state","p_p_state_rcv","p_p_static","p_p_url_type","p_p_width","p_t_lifecycle","p_v_l_s_g_id","refererGroupId","refererPlid","saveLastPath","scroll"]);var n;0===e.indexOf(Liferay.ThemeDisplay.getPortalURL())||(n=e,i.test(n))||(e=0!==e.indexOf("/")?"".concat(Liferay.ThemeDisplay.getPortalURL(),"/").concat(e):Liferay.ThemeDisplay.getPortalURL()+e);const a=new URL(e),s=new URLSearchParams(a.search),c=t.p_p_id||s.get("p_p_id");if(Object.entries(t).length&&!c)throw new TypeError("Portlet ID must not be null if parameters are provided");let l="";return Object.entries(t).length&&(l=(0,o.default)(c)),Object.keys(t).forEach((e=>{let n;n=r.has(e)?e:"".concat(l).concat(e),s.set(n,t[e])})),a.search=s.toString(),a};var n,o=(n=r(6797))&&n.__esModule?n:{default:n};const i=/^[a-z][a-z0-9+.-]*:/i},6535:(e,t,r)=>
20164{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t={}){return(0,o.default)(e,a(a({},t),{},{p_p_lifecycle:"0"}))};var n,o=(n=r(4821))&&n.__esModule?n:{default:n};function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},576:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t={}){return(0,o.default)(e,a(a({},t),{},{p_p_lifecycle:"2"}))};var n,o=(n=r(4821))&&n.__esModule?n:{default:n};function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},2468:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,n){const i=document.getElementById("".concat(n).concat(e));i&&(i.value=0);const a=document.getElementById("".concat(n).concat(t));a&&(a.value=""),(0,o.default)(r,!0),Liferay.fire("entitySelectionRemoved")};var n,o=(n=r(1521))&&n.__esModule?n:{default:n}},4361:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const r=document.getElementById("".concat(t).concat(e.idString));r&&(r.value=e.idValue);const n=document.getElementById("".concat(t).concat(e.nameString));n&&(n.value=Liferay.Util.unescape(e.nameValue));const i=document.getElementById("".concat(t,"removeFolderButton"));i&&(0,o.default)(i,!1)};var n,o=(n=r(1521))&&n.__esModule?n:{default:n}},3833:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSessionValue=function(e,t={}){const r=a("get");return r.append("key",e),t.useHttpSession&&r.append("useHttpSession",!0),(0,o.default)(s(),{body:r,method:"POST"}).then((e=>e.text())).then((e=>{if(e.startsWith(i)){const t=e.substring(i.length);e=JSON.parse(t)}return e}))},t.setSessionValue=function(e,t,r={}){const n=a("set");return t&&"object"==typeof t&&(t=i+JSON.stringify(t)),n.append(e,t),r.useHttpSession&&n.append("useHttpSession",!0),(0,o.default)(s(),{body:n,method:"POST"})};var n,o=(n=r(6549))&&n.__esModule?n:{default:n};const i="serialize://";function a(e){const t=Liferay.ThemeDisplay.getDoAsUserIdEncoded(),r=new FormData;return r.append("cmd",e),r.append("p_auth",Liferay.authToken),t&&r.append("doAsUserId",t),r}function s(){return"".concat(Liferay.ThemeDisplay.getPortalURL()).concat(Liferay.ThemeDisplay.getPathMain(),"/portal/session_click")}},2452:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const r=document.getElementById(t);r&&(r.style.display="none",e.getModifierState("CapsLock")&&(r.style.display=""))}},8956:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(arguments.length>2||"object"!=typeof t&&"function"!=typeof t)&&(t=Array.prototype.slice.call(arguments,1)),e.replace(r,((e,r)=>void 0===t[r]?e:t[r]))};const r=/\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g},7639:(e,t,r)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=(0,((n=r(8511))&&n.__esModule?n:{default:n}).default)((e=>e.split("").map((e=>e.charCodeAt())).join("")));t.default=o},4601:(e,t)=>
20164{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,n){const o=document.getElementById(e),i=document.getElementById(t);if(o&&i){let e=o.checked;r&&(e=!e),e?i.classList.remove("hide"):i.classList.add("hide"),o.addEventListener("click",(()=>{i.classList.toggle("hide"),n&&i.querySelectorAll("input[type=checkbox]").forEach((e=>{e.checked=o.checked}))}))}}},9174:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=document.body,r=(e=e._node||t).querySelector(".toggle-controls");if(!r)return;let n="visible"===Liferay._editControlsState,s=a[n],c=r.querySelector(".lexicon-icon");c&&(s.icon=c),t.classList.add(s.cssClass),Liferay.fire("toggleControls",{enabled:n}),r.addEventListener("click",(()=>{n=!n;const e=s;s=a[n],t.classList.toggle(e.cssClass),t.classList.toggle(s.cssClass);const r=s.iconCssClass,l=s.state,u=(0,o.default)(r);s.icon=u,c.replaceWith(u),c=u,Liferay._editControlsState=l,(0,i.setSessionValue)("com.liferay.frontend.js.web_toggleControls",l),Liferay.fire("toggleControls",{enabled:n,src:"ui"})}))};var n,o=(n=r(455))&&n.__esModule?n:{default:n},i=r(3833);const a={false:{cssClass:"controls-hidden",iconCssClass:"hidden",state:"hidden"},true:{cssClass:"controls-visible",iconCssClass:"view",state:"visible"}}},1521:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){"string"==typeof e?e=document.querySelectorAll(e):e._node?e=[e._node]:e._nodes?e=e._nodes:e.nodeType===Node.ELEMENT_NODE&&(e=[e]),e.forEach((e=>{e.disabled=t,t?e.classList.add("disabled"):e.classList.remove("disabled")}))}},6544:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){const n=document.getElementById(e);if(n){let e;t&&(Array.isArray(t)&&(t=t.join(",#")),e=document.querySelectorAll("#".concat(t)),e.forEach((e=>{n.checked?e.classList.remove("hide"):e.classList.add("hide")}))),n.addEventListener("change",(()=>{e&&e.forEach((e=>{e.classList.remove("hide")})),r&&(Array.isArray(r)&&(r=r.join(",#")),document.querySelectorAll("#".concat(r)).forEach((e=>{e.classList.add("hide")})))}))}}},3111:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){const o=document.getElementById(e),i=document.getElementById(n);if(!o||!i)return;const a="function"==typeof t;r(o,i,a,t),o.addEventListener("change",(()=>r(o,i,a,t)))};const r=(e,t,r,n)=>{const o=e.value,i=r?n(o,n):n===o;t.classList.toggle("hide",!i)}},9027:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={ALERT:430,DOCK:10,DOCK_PARENT:20,DRAG_ITEM:460,DROP_AREA:440,DROP_POSITION:450,MENU:5e3,OVERLAY:1e3,POPOVER:1600,TOOLTIP:1e4,WINDOW:1200}},1593:(e,t,r)=>{e=r.nmd(e);var n="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",a="[object Array]",s="[object Boolean]",c="[object Date]",l="[object Error]",u="[object Function]",d="[object Map]",f="[object Number]",p="[object Object]",h="[object Promise]",y="[object RegExp]",_="[object Set]",g="[object String]",v="[object Symbol]",m="[object WeakMap]",b="[object ArrayBuffer]",w="[object DataView]",O=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,j=/^\w*$/,S=/^\./,L=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,P=/\\(\\)?/g,E=/^\[object .+?Constructor\]$/,T=/^(?:0|[1-9]\d*)$/,C={};C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C[i]=C[a]=C[b]=C[s]=C[w]=C[c]=C[l]=C[u]=C[d]=C[f]=C[p]=C[y]=C[_]=C[g]=C[m]=!1;var M="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,I="object"==typeof self&&self&&self.Object===Object&&self,A=M||I||Function("return this")(),U=t&&!t.nodeType&&t,x=U&&e&&!e.nodeType&&e,R=x&&x.exports===U&&M.process,D=function(){try{return R&&R.binding("util")}catch(e){}}(),k=D&&D.isTypedArray;function N(e,t,r,n){for(var o=-1,i=e?e.length:0;++o<i;){var a=e[o];t(n,a,r(a),e)}return n}function F(e,t){for(var r=-1,n=e?e.length:0;++r<n;)if(t(e[r],r,e))return!0;return!1}function q(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function H(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function B(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var W,z,V,$=Array.prototype,G=Function.prototype,X=Object.prototype,K=A["__core-js_shared__"],Z=(W=/[^.]+$/.exec(K&&K.keys&&K.keys.IE_PROTO||""))?"Symbol(sr
20164c)_1."+W:"",J=G.toString,Y=X.hasOwnProperty,Q=X.toString,ee=RegExp("^"+J.call(Y).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),te=A.Symbol,re=A.Uint8Array,ne=X.propertyIsEnumerable,oe=$.splice,ie=(z=Object.keys,V=Object,function(e){return z(V(e))}),ae=De(A,"DataView"),se=De(A,"Map"),ce=De(A,"Promise"),le=De(A,"Set"),ue=De(A,"WeakMap"),de=De(Object,"create"),fe=ze(ae),pe=ze(se),he=ze(ce),ye=ze(le),_e=ze(ue),ge=te?te.prototype:void 0,ve=ge?ge.valueOf:void 0,me=ge?ge.toString:void 0;function be(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function we(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Oe(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function je(e){var t=-1,r=e?e.length:0;for(this.__data__=new Oe;++t<r;)this.add(e[t])}function Se(e){this.__data__=new we(e)}function Le(e,t){for(var r=e.length;r--;)if(Xe(e[r][0],t))return r;return-1}function Pe(e,t,r,n){return Te(e,(function(e,o,i){t(n,e,r(e),i)})),n}be.prototype.clear=function(){this.__data__=de?de(null):{}},be.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},be.prototype.get=function(e){var t=this.__data__;if(de){var r=t[e];return r===n?void 0:r}return Y.call(t,e)?t[e]:void 0},be.prototype.has=function(e){var t=this.__data__;return de?void 0!==t[e]:Y.call(t,e)},be.prototype.set=function(e,t){return this.__data__[e]=de&&void 0===t?n:t,this},we.prototype.clear=function(){this.__data__=[]},we.prototype.delete=function(e){var t=this.__data__,r=Le(t,e);return!(r<0||(r==t.length-1?t.pop():oe.call(t,r,1),0))},we.prototype.get=function(e){var t=this.__data__,r=Le(t,e);return r<0?void 0:t[r][1]},we.prototype.has=function(e){return Le(this.__data__,e)>-1},we.prototype.set=function(e,t){var r=this.__data__,n=Le(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},Oe.prototype.clear=function(){this.__data__={hash:new be,map:new(se||we),string:new be}},Oe.prototype.delete=function(e){return Re(this,e).delete(e)},Oe.prototype.get=function(e){return Re(this,e).get(e)},Oe.prototype.has=function(e){return Re(this,e).has(e)},Oe.prototype.set=function(e,t){return Re(this,e).set(e,t),this},je.prototype.add=je.prototype.push=function(e){return this.__data__.set(e,n),this},je.prototype.has=function(e){return this.__data__.has(e)},Se.prototype.clear=function(){this.__data__=new we},Se.prototype.delete=function(e){return this.__data__.delete(e)},Se.prototype.get=function(e){return this.__data__.get(e)},Se.prototype.has=function(e){return this.__data__.has(e)},Se.prototype.set=function(e,t){var r=this.__data__;if(r instanceof we){var n=r.__data__;if(!se||n.length<199)return n.push([e,t]),this;r=this.__data__=new Oe(n)}return r.set(e,t),this};var Ee,Te=(Ee=function(e,t){return e&&Ce(e,t,ot)},function(e,t){if(null==e)return e;if(!Je(e))return Ee(e,t);for(var r=e.length,n=-1,o=Object(e);++n<r&&!1!==t(o[n],n,o););return e}),Ce=function(e,t,r){for(var n=-1,o=Object(e),i=r(e),a=i.length;a--;){var s=i[++n];if(!1===t(o[s],s,o))break}return e};function Me(e,t){for(var r=0,n=(t=Fe(t,e)?[t]:Ue(t)).length;null!=e&&r<n;)e=e[We(t[r++])];return r&&r==n?e:void 0}function Ie(e,t){return null!=e&&t in Object(e)}function Ae(e,t,r,n,o){return e===t||(null==e||null==t||!et(e)&&!tt(t)?e!=e&&t!=t:function(e,t,r,n,o,u){var h=Ze(e),m=Ze(t),O=a,j=a;h||(O=(O=ke(e))==i?p:O),m||(j=(j=ke(t))==i?p:j);var S=O==p&&!q(e),L=j==p&&!q(t),P=O==j;if(P&&!S)return u||(u=new Se),h||nt(e)?xe(e,t,r,n,o,u):function(e,t,r,n,o,i,a){switch(r){case w:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case b:return!(e.byteLength!=t.byteLength||!n(new re(e),new re(t)));case s:case c:case f:return Xe(+e,+t);case l:return e.name==t.name&&e.message==t.message;case y:case g:return e==t+"";case d:var u=H;case _:var p=2&i;if(u||(u=B),e.size!=t.size&&!p)return!1;var h=a.get(e);if(h)return h==t;i|=1,a.set(e,t);var m=xe(u(e),u(t),n,o,i,a);return a.delete(e),m;case v:if(ve)return ve.call(e)==ve.call(t)}return!1}(e,t,O,r,n,o,u);if(!(2&o)){var E=S&&Y.call(e,"__wrapped__"),T=L&&Y.call(t,"__wrapped__");
20164if(E||T){var C=E?e.value():e,M=T?t.value():t;return u||(u=new Se),r(C,M,n,o,u)}}return!!P&&(u||(u=new Se),function(e,t,r,n,o,i){var a=2&o,s=ot(e),c=s.length;if(c!=ot(t).length&&!a)return!1;for(var l=c;l--;){var u=s[l];if(!(a?u in t:Y.call(t,u)))return!1}var d=i.get(e);if(d&&i.get(t))return d==t;var f=!0;i.set(e,t),i.set(t,e);for(var p=a;++l<c;){var h=e[u=s[l]],y=t[u];if(n)var _=a?n(y,h,u,t,e,i):n(h,y,u,e,t,i);if(!(void 0===_?h===y||r(h,y,n,o,i):_)){f=!1;break}p||(p="constructor"==u)}if(f&&!p){var g=e.constructor,v=t.constructor;g==v||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof v&&v instanceof v||(f=!1)}return i.delete(e),i.delete(t),f}(e,t,r,n,o,u))}(e,t,Ae,r,n,o))}function Ue(e){return Ze(e)?e:Be(e)}function xe(e,t,r,n,o,i){var a=2&o,s=e.length,c=t.length;if(s!=c&&!(a&&c>s))return!1;var l=i.get(e);if(l&&i.get(t))return l==t;var u=-1,d=!0,f=1&o?new je:void 0;for(i.set(e,t),i.set(t,e);++u<s;){var p=e[u],h=t[u];if(n)var y=a?n(h,p,u,t,e,i):n(p,h,u,e,t,i);if(void 0!==y){if(y)continue;d=!1;break}if(f){if(!F(t,(function(e,t){if(!f.has(t)&&(p===e||r(p,e,n,o,i)))return f.add(t)}))){d=!1;break}}else if(p!==h&&!r(p,h,n,o,i)){d=!1;break}}return i.delete(e),i.delete(t),d}function Re(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function De(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!et(e)||function(e){return!!Z&&Z in e}(e))&&(Ye(e)||q(e)?ee:E).test(ze(e))}(r)?r:void 0}var ke=function(e){return Q.call(e)};function Ne(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||T.test(e))&&e>-1&&e%1==0&&e<t}function Fe(e,t){if(Ze(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!rt(e))||j.test(e)||!O.test(e)||null!=t&&e in Object(t)}function qe(e){return e==e&&!et(e)}function He(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}}(ae&&ke(new ae(new ArrayBuffer(1)))!=w||se&&ke(new se)!=d||ce&&ke(ce.resolve())!=h||le&&ke(new le)!=_||ue&&ke(new ue)!=m)&&(ke=function(e){var t=Q.call(e),r=t==p?e.constructor:void 0,n=r?ze(r):void 0;if(n)switch(n){case fe:return w;case pe:return d;case he:return h;case ye:return _;case _e:return m}return t});var Be=Ge((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(rt(e))return me?me.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var r=[];return S.test(e)&&r.push(""),e.replace(L,(function(e,t,n,o){r.push(n?o.replace(P,"$1"):t||e)})),r}));function We(e){if("string"==typeof e||rt(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ze(e){if(null!=e){try{return J.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var Ve,$e=(Ve=function(e,t,r){Y.call(e,r)?e[r].push(t):e[r]=[t]},function(e,t){var r,n,o,i,a;return(Ze(e)?N:Pe)(e,Ve,"function"==typeof(r=t)?r:null==r?it:"object"==typeof r?Ze(r)?function(e,t){return Fe(e)&&qe(t)?He(We(e),t):function(r){var n=function(e,t,r){var n=null==e?void 0:Me(e,t);return void 0===n?void 0:n}(r,e);return void 0===n&&n===t?function(e,t){return null!=e&&function(e,t,r){for(var n,o=-1,i=(t=Fe(t,e)?[t]:Ue(t)).length;++o<i;){var a=We(t[o]);if(!(n=null!=e&&r(e,a)))break;e=e[a]}return n||!!(i=e?e.length:0)&&Qe(i)&&Ne(a,i)&&(Ze(e)||Ke(e))}(e,t,Ie)}(r,e):Ae(t,n,void 0,3)}}(r[0],r[1]):1==(o=function(e){for(var t=ot(e),r=t.length;r--;){var n=t[r],o=e[n];t[r]=[n,o,qe(o)]}return t}(n=r)).length&&o[0][2]?He(o[0][0],o[0][1]):function(e){return e===n||function(e,t,r,n){var o=r.length,i=o;if(null==e)return!i;for(e=Object(e);o--;){var a=r[o];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++o<i;){var s=(a=r[o])[0],c=e[s],l=a[1];if(a[2]){if(void 0===c&&!(s in e))return!1}else if(!Ae(l,c,undefined,3,new Se))return!1}return!0}(e,0,o)}:Fe(i=r)?(a=We(i),function(e){return null==e?void 0:e[a]}):function(e){return function(t){return Me(t,e)}}(i),{})});function Ge(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a),a};return r.cache=new(Ge.Cache||Oe),r}function Xe(e,t){return e===t||e!=e&&t!=t}function Ke(e){return function(e){return tt(e)&&Je(e)}(e)&&Y.call(e,"callee")&&(!ne.call(e,"callee")||Q.call(e)==i)}Ge.Cache=Oe;var Ze=Array.isArray;function Je(e){return null!=e&&Qe(e.length)&&!Ye(e)}function Ye(e){var t=et(e)?Q.call(e):"";return t==u||"[object GeneratorFunction]"==t}function Qe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function et(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function tt(e){return!!e&&"object"==typeof e}function rt(e){return"symbol"==typeof e||tt(e)&&Q.call(e)==v}var nt=k?function(e){return function(t){return e(t)}}(k):function(e){return tt(e)&&Qe(e.length)&&!!C[Q.call(e)]};function ot(e){return Je(e)?function(e,t){var r=Ze(e)||Ke(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],n=r.length,o=!!n;for(var i in e)!Y.call(e,i)||o&&("length"==i||Ne(i,n))||r.push(i);return r}(e):function(e){if(r=(t=e)&&t.constructor,t!==("function"==typeof r&&r.prototype||X))return ie(e);var t,r,n=[];for(var o in Object(e))Y.call(e,o)&&"constructor"!=o&&n.push(o);return n}(e)}function it(e){return e}e.exports=$e},8652:(e,t,r)=>{e=r.nmd(e);var n="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",a="[object Array]",s="[object Boolean]",c="[object Date]",l="[object Error]",u="[object Function]",d="[object Map]",f="[object Number]",p="[object Object]",h="[object Promise]",y="[object RegExp]",_="[object Set]",g="[object String]",v="[object WeakMap]",m="[object ArrayBuffer]",b="[object DataView]",w=/^\[object .+?Constructor\]$/,O=/^(?:0|[1-9]\d*)$/,j={};
vendor: 9,492 bytes, line 20164
20164j["[object Float32Array]"]=j["[object Float64Array]"]=j["[object Int8Array]"]=j["[object Int16Array]"]=j["[object Int32Array]"]=j["[object Uint8Array]"]=j["[object Uint8ClampedArray]"]=j["[object Uint16Array]"]=j["[object Uint32Array]"]=!0,j[i]=j[a]=j[m]=j[s]=j[b]=j[c]=j[l]=j[u]=j[d]=j[f]=j[p]=j[y]=j[_]=j[g]=j[v]=!1;var S="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,L="object"==typeof self&&self&&self.Object===Object&&self,P=S||L||Function("return this")(),E=t&&!t.nodeType&&t,T=E&&e&&!e.nodeType&&e,C=T&&T.exports===E,M=C&&S.process,I=function(){try{return M&&M.binding&&M.binding("util")}catch(e){}}(),A=I&&I.isTypedArray;function U(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function x(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function R(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var D,k,N,F=Array.prototype,q=Function.prototype,H=Object.prototype,B=P["__core-js_shared__"],W=q.toString,z=H.hasOwnProperty,V=(D=/[^.]+$/.exec(B&&B.keys&&B.keys.IE_PROTO||""))?"Symbol(src)_1."+D:"",$=H.toString,G=RegExp("^"+W.call(z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),X=C?P.Buffer:void 0,K=P.Symbol,Z=P.Uint8Array,J=H.propertyIsEnumerable,Y=F.splice,Q=K?K.toStringTag:void 0,ee=Object.getOwnPropertySymbols,te=X?X.isBuffer:void 0,re=(k=Object.keys,N=Object,function(e){return k(N(e))}),ne=Te(P,"DataView"),oe=Te(P,"Map"),ie=Te(P,"Promise"),ae=Te(P,"Set"),se=Te(P,"WeakMap"),ce=Te(Object,"create"),le=Ae(ne),ue=Ae(oe),de=Ae(ie),fe=Ae(ae),pe=Ae(se),he=K?K.prototype:void 0,ye=he?he.valueOf:void 0;function _e(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ge(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ve(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function me(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new ve;++t<r;)this.add(e[t])}function be(e){var t=this.__data__=new ge(e);this.size=t.size}function we(e,t){for(var r=e.length;r--;)if(Ue(e[r][0],t))return r;return-1}function Oe(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Q&&Q in Object(e)?function(e){var t=z.call(e,Q),r=e[Q];try{e[Q]=void 0;var n=!0}catch(e){}var o=$.call(e);return n&&(t?e[Q]=r:delete e[Q]),o}(e):function(e){return $.call(e)}(e)}function je(e){return qe(e)&&Oe(e)==i}function Se(e,t,r,n,o){return e===t||(null==e||null==t||!qe(e)&&!qe(t)?e!=e&&t!=t:function(e,t,r,n,o,u){var h=Re(e),v=Re(t),w=h?a:Me(e),O=v?a:Me(t),j=(w=w==i?p:w)==p,S=(O=O==i?p:O)==p,L=w==O;if(L&&De(e)){if(!De(t))return!1;h=!0,j=!1}if(L&&!j)return u||(u=new be),h||He(e)?Le(e,t,r,n,o,u):function(e,t,r,n,o,i,a){switch(r){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case m:return!(e.byteLength!=t.byteLength||!i(new Z(e),new Z(t)));case s:case c:case f:return Ue(+e,+t);case l:return e.name==t.name&&e.message==t.message;case y:case g:return e==t+"";case d:var u=x;case _:var p=1&n;if(u||(u=R),e.size!=t.size&&!p)return!1;var h=a.get(e);if(h)return h==t;n|=2,a.set(e,t);var v=Le(u(e),u(t),n,o,i,a);return a.delete(e),v;case"[object Symbol]":if(ye)return ye.call(e)==ye.call(t)}return!1}(e,t,w,r,n,o,u);if(!(1&r)){var P=j&&z.call(e,"__wrapped__"),E=S&&z.call(t,"__wrapped__");if(P||E){var T=P?e.value():e,C=E?t.value():t;return u||(u=new be),o(T,C,r,n,u)}}return!!L&&(u||(u=new be),function(e,t,r,n,o,i){var a=1&r,s=Pe(e),c=s.length;if(c!=Pe(t).length&&!a)return!1;for(var l=c;l--;){var u=s[l];if(!(a?u in t:z.call(t,u)))return!1}var d=i.get(e);if(d&&i.get(t))return d==t;var f=!0;i.set(e,t),i.set(t,e);for(var p=a;++l<c;){var h=e[u=s[l]],y=t[u];if(n)var _=a?n(y,h,u,t,e,i):n(h,y,u,e,t,i);if(!(void 0===_?h===y||o(h,y,r,n,i):_)){f=!1;break}p||(p="constructor"==u)}if(f&&!p){var g=e.constructor,v=t.constructor;g==v||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof v&&v instanceof v||(f=!1)}return i.delete(e),i.delete(t),f}(e,t,r,n,o,u))}(e,t,r,n,Se,o))}function Le(e,t,r,n,o,i){var a=1&r,s=e.length,c=t.length;if(s!=c&&!(a&&c>s))return!1;var l=i.get(e);if(l&&i.get(t))return l==t;var u=-1,d=!0,f=2&r?new me:void 0;for(i.set(e,t),i.set(t,e);++u<s;){var p=e[u],h=t[u];if(n)var y=a?n(h,p,u,t,e,i):n(p,h,u,e,t,i);if(void 0!==y){if(y)continue;d=!1;break}if(f){if(!U(t,(function(e,t){if(a=t,!f.has(a)&&(p===e||o(p,e,r,n,i)))return f.push(t);var a}))){d=!1;break}}else if(p!==h&&!o(p,h,r,n,i)){d=!1;break}}return i.delete(e),i.delete(t),d}function Pe(e){return function(e,t,r){var n=t(e);return Re(e)?n:function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}(n,r(e))}(e,Be,Ce)}function Ee(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function Te(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Fe(e)||function(e){return!!V&&V in e}(e))&&(ke(e)?G:w).test(Ae(e))}(r)?r:void 0}_e.prototype.clear=function(){this.__data__=ce?ce(null):{},this.size=0},_e.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},_e.prototype.get=function(e){var t=this.__data__;if(ce){var r=t[e];return r===n?void 0:r}return z.call(t,e)?t[e]:void 0},_e.prototype.has=function(e){var t=this.__data__;return ce?void 0!==t[e]:z.call(t,e)},_e.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ce&&void 0===t?n:t,this},ge.prototype.clear=function(){this.__data__=[],this.size=0},ge.prototype.delete=function(e){var t=this.__data__,r=we(t,e);return!(r<0||(r==t.length-1?t.pop():Y.call(t,r,1),--this.size,0))},ge.prototype.get=function(e){var t=this.__data__,r=we(t,e);return r<0?void 0:t[r][1]},ge.prototype.has=function(e){return we(this.__data__,e)>-1},ge.prototype.set=function(e,t){var r=this.__data__,n=we(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},ve.prototype.clear=function(){this.size=0,this.__data__={hash:new _e,map:new(oe||ge),string:new _e}},ve.prototype.delete=function(e){var t=Ee(this,e).delete(e);return this.size-=t?1:0,t},ve.prototype.get=function(e){return Ee(this,e).get(e)},ve.prototype.has=function(e){return Ee(this,e).has(e)},ve.prototype.set=function(e,t){var r=Ee(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},me.prototype.add=me.prototype.push=function(e){return this.__data__.set(e,n),this},me.prototype.has=function(e){return this.__data__.has(e)},be.prototype.clear=function(){this.__data__=new ge,this.size=0},be.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},be.prototype.get=function(e){return this.__data__.get(e)},be.prototype.has=function(e){return this.__data__.has(e)},be.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ge){var n=r.__data__;if(!oe||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new ve(n)}return r.set(e,t),this.size=r.size,this};var Ce=ee?function(e){return null==e?[]:(e=Object(e),function(t,r){for(var n=-1,o=null==t?0:t.length,i=0,a=[];++n<o;){var s=t[n];c=s,J.call(e,c)&&(a[i++]=s)}var c;return a}(ee(e)))}:function(){return[]},Me=Oe;function Ie(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||O.test(e))&&e>-1&&e%1==0&&e<t}function Ae(e){if(null!=e){try{return W.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ue(e,t){return e===t||e!=e&&t!=t}(ne&&Me(new ne(new ArrayBuffer(1)))!=b||oe&&Me(new oe)!=d||ie&&Me(ie.resolve())!=h||ae&&Me(new ae)!=_||se&&Me(new se)!=v)&&(Me=function(e){var t=Oe(e),r=t==p?e.constructor:void 0,n=r?Ae(r):"";if(n)switch(n){case le:return b;case ue:return d;case de:return h;case fe:return _;case pe:return v}return t});var xe=je(function(){return arguments}())?je:function(e){return qe(e)&&z.call(e,"callee")&&!J.call(e,"callee")},Re=Array.isArray,De=te||function(){return!1};function ke(e){if(!Fe(e))return!1;var t=Oe(e);return t==u||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ne(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function Fe(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function qe(e){return null!=e&&"object"==typeof e}var He=A?function(e){return function(t){return e(t)}}(A):function(e){return qe(e)&&Ne(e.length)&&!!j[Oe(e)]};function Be(e){return null!=(t=e)&&Ne(t.length)&&!ke(t)?function(e,t){var r=Re(e),n=!r&&xe(e),o=!r&&!n&&De(e),i=!r&&!n&&!o&&He(e),a=r||n||o||i,s=a?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],c=s.length;for(var l in e)!z.call(e,l)||a&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Ie(l,c))||s.push(l);return s}(e):function(e){if(r=(t=e)&&t.constructor,t!==("function"==typeof r&&r.prototype||H))return re(e);var t,r,n=[];for(var o in Object(e))z.call(e,o)&&"constructor"!=o&&n.push(o);return n}(e);var t}e.exports=function(e,t){return Se(e,t)}},8511:(e,t,r)=>{var n,o="__lodash_hash_undefined__",i=/^\[object .+?Constructor\]$/,a="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,s="object"==typeof self&&self&&self.Object===Object&&self,c=a||s||Function("return this")(),l=Array.prototype,u=Function.prototype,d=Object.prototype,f=c["__core-js_shared__"],p=(n=/[^.]+$/.exec(f&&f.keys&&f.keys.IE_PROTO||""))?"Symbol(sr
20164c)_1."+n:"",h=u.toString,y=d.hasOwnProperty,_=d.toString,g=RegExp("^"+h.call(y).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),v=l.splice,m=P(c,"Map"),b=P(Object,"create");function w(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function O(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function j(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function S(e,t){for(var r,n,o=e.length;o--;)if((r=e[o][0])===(n=t)||r!=r&&n!=n)return o;return-1}function L(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function P(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!T(e)||p&&p in e)&&(function(e){var t=T(e)?_.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?g:i).test(function(e){if(null!=e){try{return h.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}(r)?r:void 0}function E(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a),a};return r.cache=new(E.Cache||j),r}function T(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}w.prototype.clear=function(){this.__data__=b?b(null):{}},w.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},w.prototype.get=function(e){var t=this.__data__;if(b){var r=t[e];return r===o?void 0:r}return y.call(t,e)?t[e]:void 0},w.prototype.has=function(e){var t=this.__data__;return b?void 0!==t[e]:y.call(t,e)},w.prototype.set=function(e,t){return this.__data__[e]=b&&void 0===t?o:t,this},O.prototype.clear=function(){this.__data__=[]},O.prototype.delete=function(e){var t=this.__data__,r=S(t,e);return!(r<0||(r==t.length-1?t.pop():v.call(t,r,1),0))},O.prototype.get=function(e){var t=this.__data__,r=S(t,e);return r<0?void 0:t[r][1]},O.prototype.has=function(e){return S(this.__data__,e)>-1},O.prototype.set=function(e,t){var r=this.__data__,n=S(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},j.prototype.clear=function(){this.__data__={hash:new w,map:new(m||O),string:new w}},j.prototype.delete=function(e){return L(this,e).delete(e)},j.prototype.get=function(e){return L(this,e).get(e)},j.prototype.has=function(e){return L(this,e).has(e)},j.prototype.set=function(e,t){return L(this,e).set(e,t),this},E.Cache=j,e.exports=E},1093:(e,t,r)=>{var n,o=/&(?:amp|lt|gt|quot|#39|#96);/g,i=RegExp(o.source),a="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,s="object"==typeof self&&self&&self.Object===Object&&self,c=a||s||Function("return this")(),l=(n={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&#96;":"`"},function(e){return null==n?void 0:n[e]}),u=Object.prototype.toString,d=c.Symbol,f=d?d.prototype:void 0,p=f?f.toString:void 0;e.exports=function(e){var t;return(e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return p?p.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t))&&i.test(e)?e.replace(o,l):e}},26:e=>{for(var t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);e.exports=function(e,r){var n=r||0,o=t;return[o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]]].join("")}},1814:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var r=new Uint8Array(16);e.exports=function(){return t(r),r}}else{var n=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}}},8633:(e,t,r)=>{var n,o,i=r(1814),a=r(26),s=0,c=0;e.exports=function(e,t,r){var l=t&&r||0,u=t||[],d=(e=e||{}).node||n,f=void 0!==e.clockseq?e.clockseq:o;if(null==d||null==f){var p=i();null==d&&(d=n=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==f&&(f=o=16383&(p[6]<<8|p[7]))}var h=void 0!==e.msecs?e.msecs:(new Date).getTime(),y=void 0!==e.nsecs?e.nsecs:c+1,_=h-s+(y-c)/1e4;if(_<0&&void 0===e.clockseq&&(f=f+1&16383),(_<0||h>s)&&void 0===e.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=h,c=y,o=f;var g=(1e4*(268435455&(h+=122192928e5))+y)%4294967296;u[l++]=g>>>24&255,u[l++]=g>>>16&255,u[l++]=g>>>8&255,u[l++]=255&g;var v=h/4294967296*1e4&268435455;u[l++]=v>>>8&255,u[l++]=255&v,u[l++]=v>>>
2016424&15|16,u[l++]=v>>>16&255,u[l++]=f>>>8|128,u[l++]=255&f;for(var m=0;m<6;++m)u[l+m]=d[m];return t||a(u)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n](i,i.exports,r),i.loaded=!0,i.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};(()=>{var e=n;Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"portlet",{enumerable:!0,get:function(){return p.default}});var t=pe(r(8686)),o=pe(r(1593)),i=pe(r(8652)),a=pe(r(1093)),s=pe(r(1991)),c=pe(r(3337)),l=r(2801),u=r(34),d=r(9356),f=r(1425),p=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=fe();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=n?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}(r(5659)),h=pe(r(7370)),y=pe(r(2534)),_=pe(r(9296)),g=pe(r(3873)),v=pe(r(9094)),m=pe(r(6549)),b=pe(r(85)),w=pe(r(8002)),O=pe(r(7494)),j=pe(r(7535)),S=pe(r(5273)),L=pe(r(8206)),P=pe(r(7019)),E=r(1511),T=pe(r(7068)),C=pe(r(4968)),M=pe(r(8999)),I=pe(r(775)),A=pe(r(455)),U=pe(r(7320)),x=pe(r(4397)),R=pe(r(1166)),D=pe(r(6797)),k=pe(r(6506)),N=pe(r(260)),F=pe(r(4612)),q=pe(r(9105)),H=r(7387),B=pe(r(6515)),W=pe(r(5506)),z=pe(r(7442)),V=pe(r(386)),$=pe(r(1625)),G=pe(r(4294)),X=pe(r(1357)),K=pe(r(742)),Z=pe(r(1146)),J=pe(r(4821)),Y=pe(r(6535)),Q=pe(r(576)),ee=pe(r(2468)),te=pe(r(4361)),re=r(3833),ne=pe(r(2452)),oe=pe(r(8956)),ie=pe(r(7639)),ae=pe(r(4601)),se=pe(r(9174)),ce=pe(r(1521)),le=pe(r(6544)),ue=pe(r(3111)),de=pe(r(9027));function fe(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return fe=function(){return e},e}function pe(e){return e&&e.__esModule?e:{default:e}}Liferay=window.Liferay||{},Liferay.BREAKPOINTS=c.default,Liferay.STATUS_CODE=y.default,Liferay.zIndex=de.default,Liferay.component=l.component,Liferay.componentReady=l.componentReady,Liferay.destroyComponent=l.destroyComponent,Liferay.destroyComponents=l.destroyComponents,Liferay.destroyUnfulfilledPromises=l.destroyUnfulfilledPromises,Liferay.getComponentCache=l.getComponentCache,Liferay.initComponentCache=l.initComponentCache,Liferay.Address={getCountries:g.default,getRegions:v.default},Liferay.DynamicSelect=s.default,Liferay.LayoutExporter={all:u.hideLayoutPane,details:u.toggleLayoutDetails,icons:(0,u.getLayoutIcons)(),proposeLayout:u.proposeLayout,publishToLive:u.publishToLive,selected:u.showLayoutPane},Liferay.Portal={Tabs:{show:d.showTab},ToolTip:{show:f.showTooltip}},Liferay.Portlet=Liferay.Portlet||{},Liferay.Portlet.minimize=p.minimizePortlet,Liferay.Portlet.openModal=(...e)=>{Liferay.Loader.require("frontend-js-web/liferay/modal/Modal",(t=>{t.openPortletModal(...e)}))},Liferay.Portlet.openWindow=(...e)=>{Liferay.Loader.require("frontend-js-web/liferay/modal/Modal",(t=>{t.openPortletWindow(...e)}))},Liferay.SideNavigation=h.default,Liferay.Util=Liferay.Util||{},Liferay.Util.MAP_HTML_CHARS_ESCAPED=H.MAP_HTML_CHARS_ESCAPED,Liferay.Util.addParams=_.default,Liferay.Util.openAlertModal=(...e)=>{Liferay.Loader.require("frontend-js-web/liferay/modal/Modal",(t=>{t.openAlertModal(...e)}))},Liferay.Util.disableEsc=()=>{document.all&&27===window.event.keyCode&&(window.event.returnValue=!1)},Liferay.Util.escape=t.default,Liferay.Util.escapeHTML=H.escapeHTML,Liferay.Util.fetch=m.default,Liferay.Util.focusFormField=b.default,Liferay.Util.formatStorage=L.default,Liferay.Util.formatXML=P.default,Liferay.Util.getCheckedCheckboxes=E.getCheckedCheckboxes,Liferay.Util.getUncheckedCheckboxes=E.getUncheckedCheckboxes,Liferay.Util.getCropRegion=T.default,Liferay.Util.getDOM=C.default,Liferay.Util.getElement=M.default,Liferay.Util.getGeolocation=I.default,Liferay.Util.getFormElement=w.default,Liferay.Util.getLexiconIcon=A.default,Liferay.Util.getLexiconIconTpl=U.default,Liferay.Util.getOpener=x.default,Liferay.Util.getPortletId=R.default,Liferay.Util.getPortletNamespace=D.default,Liferay.Util.getTop=N.default,Liferay.Util.getURLWithSessionId=F.default,Liferay.Util.getWindow=q.default,Liferay.Util.groupBy=o.default,Liferay.Util.inBrowserView=B.default,Liferay.Util.isEqual=i.default,Liferay.Util.isPhone=W.default,Liferay.Util.isTablet=z.default,Liferay.Util.getSelectedOptionValues=k.default,Liferay.Util.navigate=V.default,Liferay.Util.ns=G.default,Liferay.Util.objectToFormData=O.default,Liferay.Util.objectToURLSearchParams=X.default,Liferay.Util.normalizeFriendlyURL=$.default,Liferay.Util.PortletURL={createActionURL:Z.default,createPortletURL:J.default,createRenderURL:Y.default,createResourceURL:Q.default},Liferay.Util.postForm=j.default,Liferay.Util.setFormValues=S.default,Liferay.Util.toCharCode=ie.default,Liferay.Util.toggleDisabled=ce.default,Liferay.Util.openConfirmModal=(...e)=>{Liferay.Loader.require("frontend-js-web/liferay/modal/Modal",(t=>{t.openConfirmModal(...e)}))},Liferay.Util.openModal=(...e)=>{Liferay.Loader.require("frontend-js-web/liferay/modal/Modal",(t=>{t.openModal(...e)}))},Liferay.Util.openSelectionModal=(...e)=>{Liferay.Loader.require("frontend-js-web/liferay/modal/Modal",(t=>{t.openSelectionModal(...e)}))},Liferay.Util.openToast=(...e)=>{Liferay.Loader.require("frontend-js-web/liferay/toast/commands/OpenToast.es",(t=>{t.openToast(...e)}))},Liferay.Util.openWindow=K.default,Liferay.Util.removeEntitySelection=ee.default,Liferay.Util.selectFolder=te.default,Liferay.Util.showCapsLock=ne.default,Liferay.Util.sub=oe.default,Liferay.Util.Session={get:re.getSessionValue,set:re.setSessionValue},Liferay.Util.toggleBoxes=ae.default,Liferay.Util.toggleControls=se.default,Liferay.Util.toggleRadio=le.default,Liferay.Util.toggleSelectBox=ue.default,Liferay.Util.unescape=a.default,Liferay.Util.unescapeHTML=H.unescapeHTML})();var o=window;for(var i in n)o[i]=n[i];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})();
20165//# sourceMappingURL=global.bundle.js.map
20166function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
20166t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e){var t=e.Lang,r=Liferay.Util,a="head",o=_objectSpread(_objectSpread({},Liferay.Portlet),{},{_defCloseFn(e){if(e.portlet.remove(!0),!e.nestedPortlet){var t=Liferay.Util.objectToFormData({cmd:"delete",doAsUserId:e.doAsUserId,p_auth:Liferay.authToken,p_l_id:e.plid,p_p_id:e.portletId,p_v_l_s_g_id:themeDisplay.getSiteGroupId()});Liferay.Util.fetch(themeDisplay.getPathMain()+"/portal/update_layout",{body:t,method:"POST"}).then((e=>{e.ok&&Liferay.fire("updatedLayout")}))}},_loadMarkupHeadElements(t){var r=t.markupHeadElements;if(r&&r.length){e.one(a).append(r);var o=e.Node.create("<div />");o.plug(e.Plugin.ParseContent),o.setContent(r)}},_loadPortletFiles(t,r){var o=t.footerCssPaths||[],i=t.headerCssPaths||[],l=t.headerJavaScriptPaths||[];l=l.concat(t.footerJavaScriptPaths||[]);var d=e.one(a);i.length&&e.Get.css(i,{insertBefore:d.get("firstChild").getDOM()});var n=document.body.lastChild;o.length&&e.Get.css(o,{insertBefore:n});var s=t.portletHTML;l.length?e.Get.script(l,{onEnd(){r(s)}}):r(s)},_mergeOptions:(e,t)=>((t=t||{}).doAsUserId=t.doAsUserId||themeDisplay.getDoAsUserIdEncoded(),t.plid=t.plid||themeDisplay.getPlid(),t.portlet=e,t.portletId=e.portletId,t),_staticPortlets:{},destroyComponents(e){Liferay.destroyComponents(((t,r)=>e===r.portletId))},isStatic(e){return r.getPortletId(e.id||e)in this._staticPortlets},list:[],readyCounter:0,refreshLayout(e){},register(e){this.list.indexOf(e)<0&&this.list.push(e)}});Liferay.provide(o,"add",(function(t){var a=this;Liferay.fire("initLayout");var o=t.doAsUserId||themeDisplay.getDoAsUserIdEncoded(),i=t.plid||themeDisplay.getPlid(),l=t.portletData,d=t.portletId,n=t.portletItemId,s=t.placeHolder;s=s?e.one(s):e.Node.create('<div class="loading-animation" />');var p=t.beforePortletLoaded,f=t.onComplete,c=null;if(Liferay.Layout&&Liferay.Layout.INITIALIZED&&(c=Liferay.Layout.getActiveDropContainer()),c){var y=c.attr("id").replace(/layout-column_/,""),u=0;if(t.placeHolder){var h=s.get("parentNode");if(!h)return;s.addClass("portlet-boundary");var L=h.all(".portlet-boundary"),g=h.all(".portlet-nested-portlets");u=L.indexOf(s);var v=0;g.some((e=>{var t=L.indexOf(e);if(-1!==t&&t<u)v+=e.all(".portlet-boundary").size();else if(t>=u)return!0})),u-=v,y=r.getColumnId(h.attr("id"))}var m=themeDisplay.getPathMain()+"/portal/update_layout",P={cmd:"add",dataType:"JSON",doAsUserId:o,p_auth:Liferay.authToken,p_l_id:i,p_p_col_id:y,p_p_col_pos:u,p_p_i_id:n,p_p_id:d,p_p_isolated:!0,p_v_l_s_g_id:themeDisplay.getSiteGroupId(),portletData:l},_=c.one(".portlet-boundary"),b=_&&_.isStatic;t.placeHolder||t.plid||(b?_.placeAfter(s):c.prepend(s)),P.currentURL=Liferay.currentURL,a.addHTML({beforePortletLoaded:p,data:P,onComplete:function(e,t){f&&f(e,t),a.list.push(e.portletId),e&&e.attr("data-qa-id","app-loaded"),Liferay.fire("addPortlet",{portlet:e})},placeHolder:s,url:m})}}),["aui-base"]),Liferay.provide(o,"addHTML",(function(a){var i=this,l=null,d=a.beforePortletLoaded,n=a.data,s="HTML",p=a.onComplete,f=a.placeHolder,c=a.url;n&&t.isString(n.dataType)&&(s=n.dataType),s=s.toUpperCase();var y=function(t){var a,o=f.get("parentNode"),d=e.Node.create("<div></div>");if(d.plug(e.Plugin.ParseContent),d.setContent(t),d=d.one("> *")){var n=d.attr("id");a=r.getPortletId(n),d.portletId=a,f.hide(),f.placeAfter(d),f.remove(),i.refreshLayout(d),window.location.hash&&(window.location.href=window.location.hash),l=d;var s=Liferay.Layout;s&&s.INITIALIZED&&(s.updateCurrentPortletInfo(l),o&&s.syncEmptyColumnClassUI(o),s.syncDraggableClassUI(),s.updatePortletDropZones(l)),p&&p(l,a)}else f.remove();return a};d&&d(f),Liferay.Util.fetch(c,{body:Liferay.Util.objectToURLSearchParams(n),method:"POST"}).then((e=>"JSON"===s?e.json():e.text())).then((e=>{"HTML"===s?y(e):e.refresh?y(e.portletHTML):(o._loadMarkupHeadElements(e),o._loadPortletFiles(e,y)),n&&n.preventNotification||Liferay.fire("updatedLayout")})).catch((e=>{var t="string"==typeof e?e:'Errore\x20Inaspettato\x2e\x20Aggiorna\x20la\x20pagina\x20corrente\x2e';Liferay.Util.openToast({message:t,type:"danger"})}))}),["aui-parse-content"]),Liferay.provide(o,"close",(function(t,r,a){if((t=e.one(t))&&(r||confirm('Sei\x20sicuro\x20di\x20voler\x20rimuovere\x20questo\x20componente\x3f'))){var i=t.portletId,l=this.list.indexOf(i);l>=0&&this.list.splice(l,1),a=o._mergeOptions(t,a),o.destroyComponents(i),Liferay.fire("destroyPortlet",a),Liferay.fire("closePortlet",a)}else e.config.win.focus()}),[]),Liferay.provide(o,"destroy",((t,a)=>{if(t=e.one(t)){var i=t.portletId||r.getPortletId(t.attr("id"));o.destroyComponents(i),Liferay.fire("destroyPortlet",o._mergeOptions(t,a))}}),["aui-node-base"]),Liferay.provide(o,"onLoad",(function(t){var a=this,o=t.canEditTitle,i=t.columnPos,l="no"===t.isStatic?null:t.isStatic,d=t.namespacedId,n=t.portletId,s=t.refreshURL,p=t.refreshURLData;l&&a.registerStatic(n);var f=e.one("#"+d);if(f&&!f.portletProcessed&&(f.portletProcessed=!0,f.portletId=n,f.columnPos=i,f.isStatic=l,f.refreshURL=s,f.refreshURLData=p,o)){var c="focus";e.UA.touchEnabled||(c=["focus","mousemove"]);var y=f.on(c,(()=>{r.portletTitleEdit({doAsUserId:themeDisplay.getDoAsUserIdEncoded(),obj:f,plid:themeDisplay.getPlid(),portletId:n}),y.detach()}))}Liferay.fire("portletReady",{portlet:f,portletId:n}),a.readyCounter++,a.readyCounter===a.list.length&&Liferay.fire("allPortletsReady",{portletId:n})}),["aui-base","aui-timer","event-move"]),Liferay.provide(o,"refresh",(function(r,a,i){if
20166(r=e.one(r)){a=i?_objectSpread(_objectSpread({},r.refreshURLData||{}),a||{}):a||r.refreshURLData||{},Object.prototype.hasOwnProperty.call(a,"portletAjaxable")||(a.portletAjaxable=!0);var l=r.attr("portlet"),d=r.refreshURL,n=e.Node.create('<div class="loading-animation" id="p_p_id'+l+'" />');if(a.portletAjaxable&&d){r.placeBefore(n),r.remove(!0),o.destroyComponents(r.portletId);var s={},p=d.split("?");p.length>1&&(delete(s=e.QueryString.parse(p[1])).dataType,d=p[0]),this.addHTML({data:e.mix(s,a,!0),onComplete(e,t){e.refreshURL=d,e&&e.attr("data-qa-id","app-refreshed"),Liferay.fire(e.portletId+":portletRefreshed",{portlet:e,portletId:t})},placeHolder:n,url:d})}else if(!r.getData("pendingRefresh")){r.setData("pendingRefresh",!0);var f=t.sub('<div class="alert alert-info">{0}</div>',['Questa\x20modifica\x20sarà\x20mostrata\x20solo\x20dopo\x20l\x27aggiornamento\x20della\x20pagina\x20corrente\x2e']),c=r.one(".portlet-body");c.placeBefore(f),c.hide()}}}),["aui-base","querystring-parse"]),Liferay.provide(o,"registerStatic",(function(t){var a=e.Node;a&&t instanceof a?t=t.attr("id"):t.id&&(t=t.id);var o=r.getPortletId(t);this._staticPortlets[o]=!0}),["aui-base"]),Liferay.publish("closePortlet",{defaultFn:o._defCloseFn}),Liferay.publish("allPortletsReady",{fireOnce:!0}),o.ready=function(e){Liferay.on("portletReady",(t=>{e(t.portletId,t.portlet)}))},Liferay.Portlet=o}(AUI());
20167//# sourceMappingURL=portlet.js.map
20168Liferay.Workflow={ACTION_PUBLISH:1,ACTION_SAVE_DRAFT:2,STATUS_ANY:-1,STATUS_APPROVED:0,STATUS_DENIED:4,STATUS_DRAFT:2,STATUS_EXPIRED:3,STATUS_PENDING:1};
20169//# sourceMappingURL=workflow.js.map
20170/**
20171 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
20172 *
20173 * This library is free software; you can redistribute it and/or modify it under
20174 * the terms of the GNU Lesser General Public License as published by the Free
20175 * Software Foundation; either version 2.1 of the License, or (at your option)
20176 * any later version.
20177 *
20178 * This library is distributed in the hope that it will be useful, but WITHOUT
20179 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20180 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
20181 * details.
20182 */
20183
20184(function () {
20185	const CONTAINER_REQUESTS_SYMBOL = Symbol.for(
20186		'__LIFERAY_WEBPACK_CONTAINER_REQUESTS__'
20187	);
20188	const CONTAINERS_SYMBOL = Symbol.for('__LIFERAY_WEBPACK_CONTAINERS__');
20189	const GET_MODULE_SYMBOL = Symbol.for('__LIFERAY_WEBPACK_GET_MODULE__');
20190	const SHARED_SCOPE_SYMBOL = Symbol.for('__LIFERAY_WEBPACK_SHARED_SCOPE__');
20191	const WEBPACK_HELPERS_SYMBOL = Symbol.for('__LIFERAY_WEBPACK_HELPERS__');
20192
20193	window[CONTAINER_REQUESTS_SYMBOL] = window[CONTAINER_REQUESTS_SYMBOL] || {};
20194	window[CONTAINERS_SYMBOL] = window[CONTAINERS_SYMBOL] || {};
20195	window[SHARED_SCOPE_SYMBOL] = window[SHARED_SCOPE_SYMBOL] || {};
20196
20197	const containerRequests = window[CONTAINER_REQUESTS_SYMBOL];
20198	const sharedScope = window[SHARED_SCOPE_SYMBOL];
20199
20200	let inGetModule = false;
20201	let nextCallId = 1;
20202	const queuedGetModuleCalls = [];
20203	const serializeModuleRequests = false;
20204
20205	/**
20206	 * Create a new container request
20207	 */
20208	function createContainerRequest(url, onLoadHandler) {
20209		const script = document.createElement('script');
20210
20211		const containerRequest = {
20212
20213			// Set to the container's exported object
20214
20215			container: undefined,
20216
20217			// Set if request failed
20218
20219			error: undefined,
20220
20221			// Set to true if the .js file has been fetched from the server
20222
20223			fetched: false,
20224
20225			// Set to the exported values of each module (undefined if error set)
20226
20227			modules: undefined,
20228
20229			// Set to the <script> DOM node while it is being retrieved (undefined after)
20230
20231			script,
20232
20233			// Set to an array of functions to be invoked once the <script> loads
20234
20235			subscribers: [],
20236		};
20237
20238		script.src = url;
20239		script.onload = () => onLoadHandler(containerRequest);
20240
20241		document.head.appendChild(script);
20242
20243		return containerRequest;
20244	}
20245
20246	/**
20247	 * Log messages if `explain resolutions` option is turned on.
20248	 */
20249	function explain(...things) {
20250		if (Liferay.EXPLAIN_RESOLUTIONS) {
20251			// eslint-disable-next-line no-console
20252			console.log(...things);
20253		}
20254	}
20255
20256	/**
20257	 * Transform a webpack chunk script file name.
20258	 *
20259	 * The webpack federation runtimes for projects built with npm-scripts
20260	 * delegate to this method the logic to compose the URL to retrieve the
20261	 * chunk files from server.
20262	 */
20263	function transformChunkScriptFilename(chunkScriptFileName) {
20264		return (
20265			chunkScriptFileName +
20266			'?languageId=' +
20267			Liferay.ThemeDisplay.getLanguageId()
20268		);
20269	}
20270
20271	/**
20272	 * Compute container URL for a given containerId
20273	 */
20274	function getContainerURL(containerId) {
20275
20276		// Strip the scope to derive the context path (this can be done because
20277		// our SF rules enforce a certain structure on context and package
20278		// names, but it is not valid for the general case).
20279
20280		if (containerId[0] === '@') {
20281			const i = containerId.indexOf('/');
20282
20283			containerId = containerId.substr(i + 1);
20284		}
20285
20286		return (
20287			'/o/' +
20288			containerId +
20289			'/__generated__/container.js?languageId=' +
20290			Liferay.ThemeDisplay.getLanguageId()
20291		);
20292	}
20293
20294	/**
20295	 * Fetch a container
20296	 */
20297	function fetchContainer(callId, containerId, resolve, reject) {
20298		if (containerRequests[containerId]) {
20299			throw new Error(
20300				`A request is already registered for container ${containerId}`
20301			);
20302		}
20303
20304		const url = getContainerURL(containerId);
20305
20306		explain(callId, 'Fetching container from URL', url);
20307
20308		containerRequests[containerId] = createContainerRequest(
20309			url,
20310			(containerRequest) => {
20311				explain(callId, 'Fetched container', containerId);
20312
20313				const container = getContainer(containerId);
20314
20315				if (container) {
20316					explain(
20317						callId,
20318						'Initializing container with scope:\n',
20319						'   ',
20320						Object.entries(sharedScope)
20321							.map(
20322								([name, data]) =>
20323									`${name}: ` +
20324									Object.entries(data).map(
20325										([version, data]) =>
20326											`(${version}: ${data.from})`
20327									)
20328							)
20329							.join('\n     ')
20330					);
20331
20332					Promise.resolve(container.init(sharedScope))
20333						.then(() =>
20334							finalizeContainerRequest(
20335								callId,
20336								containerRequest,
20337								container
20338							)
20339						)
20340						.catch(reject);
20341				}
20342				else {
20343					const message =
20344						`Container ${containerId} was fetched but its script ` +
20345						`failed to register with Liferay`;
20346
20347					console.warn(message);
20348
20349					finalizeContainerRequest(
20350						callId,
20351						containerRequest,
20352						new Error(message)
20353					);
20354				}
20355			}
20356		);
20357
20358		explain(callId, 'Subscribing to container request');
20359
20360		subscribeContainerRequest(
20361			containerRequests[containerId],
20362			resolve,
20363			reject
20364		);
20365	}
20366
20367	/**
20368	 * Finalize an ongoing container request: set its result (error or
20369	 * container object) and notify all pending subscribers.
20370	 */
20371	function finalizeContainerRequest(callId, containerRequest, result) {
20372		const {script, subscribers} = containerRequest;
20373
20374		containerRequest.fetched = true;
20375		containerRequest.script = undefined;
20376		containerRequest.subscribers = undefined;
20377
20378		if (result instanceof Error) {
20379			explain(
20380				callId,
20381				'Rejecting container',
20382				script.src,
20383				'for',
20384				subscribers.length,
20385				'subscribers'
20386			);
20387
20388			containerRequest.error = result;
20389
20390			subscribers.forEach(({reject}) => reject(result));
20391		}
20392		else {
20393			explain(
20394				callId,
20395				'Resolving container',
20396				script.src,
20397				'for',
20398				subscribers.length,
20399				'subscribers'
20400			);
20401
20402			containerRequest.container = result;
20403			containerRequest.modules = {};
20404
20405			subscribers.forEach(({resolve}) => resolve(result));
20406		}
20407	}
20408
20409	/**
20410	 * Get a defined container object
20411	 */
20412	function getContainer(containerId) {
20413		if (containerId[0] === '@') {
20414			containerId = containerId.substr(1).replace('/', '!');
20415		}
20416
20417		return window[CONTAINERS_SYMBOL][containerId];
20418	}
20419
20420	/**
20421	 * Get a module (like require for webpack federation)
20422	 */
20423	function getModule(moduleName, caller) {
20424
20425		// Queue this call for later resolution if needed
20426
20427		if (serializeModuleRequests) {
20428			if (inGetModule) {
20429				return new Promise((resolve, reject) => {
20430					queuedGetModuleCalls.push(() =>
20431						getModule(moduleName, caller)
20432							.then(resolve)
20433							.catch(reject)
20434					);
20435				});
20436			}
20437			else {
20438				inGetModule = true;
20439			}
20440		}
20441
20442		const callId = `[${nextCallId++}]`;
20443
20444		caller = caller || `[${new Error().stack.split('\n')[1]}]`;
20445
20446		explain(callId, 'Getting module', moduleName, 'for', caller);
20447
20448		return new Promise((resolve, reject) => {
20449			const {containerId, path} = splitModuleName(moduleName);
20450
20451			const dispatchNextQueuedCall = () => {
20452				if (!serializeModuleRequests) {
20453					return;
20454				}
20455
20456				inGetModule = false;
20457
20458				if (queuedGetModuleCalls.length) {
20459					setTimeout(queuedGetModuleCalls.shift(), 0);
20460				}
20461			};
20462
20463			const resolveGetModuleCall = () => {
20464				const containerRequest = containerRequests[containerId];
20465				const {modules} = containerRequest;
20466				const module = modules[path];
20467
20468				if (module) {
20469					explain(callId, 'Resolving cached module');
20470
20471					resolve(module);
20472
20473					dispatchNextQueuedCall();
20474				}
20475				else {
20476					const {container} = containerRequest;
20477
20478					explain(callId, 'Getting module from container');
20479
20480					Promise.resolve(container.get(path))
20481						.then((moduleFactory) => {
20482							const module = moduleFactory();
20483
20484							modules[path] = module;
20485
20486							return module;
20487						})
20488						.then((module) => {
20489							explain(callId, 'Resolving module');
20490
20491							resolve(module);
20492
20493							dispatchNextQueuedCall();
20494						})
20495						.catch((error) => {
20496							explain(callId, 'Rejecting module', error);
20497
20498							reject(error);
20499
20500							dispatchNextQueuedCall();
20501						});
20502				}
20503			};
20504
20505			const containerRequest = containerRequests[containerId];
20506
20507			if (containerRequest) {
20508				const {fetched} = containerRequest;
20509
20510				if (!fetched) {
20511					explain(callId, 'Subscribing to container request');
20512
20513					subscribeContainerRequest(
20514						containerRequest,
20515						resolveGetModuleCall,
20516						reject
20517					);
20518
20519					return;
20520				}
20521
20522				const {error} = containerRequest;
20523
20524				if (error) {
20525					explain(callId, 'Rejecting with error', error);
20526
20527					reject(error);
20528
20529					return;
20530				}
20531
20532				resolveGetModuleCall();
20533			}
20534			else {
20535				fetchContainer(
20536					callId,
20537					containerId,
20538					resolveGetModuleCall,
20539					reject
20540				);
20541			}
20542		});
20543	}
20544
20545	/**
20546	 * Split a module name in its `containerId` and `path` parts
20547	 */
20548	function splitModuleName(moduleName) {
20549		let i = moduleName.indexOf('/');
20550
20551		// Skip first / for scoped packages
20552
20553		if (moduleName[0] === '@') {
20554			i = moduleName.indexOf('/', i + 1);
20555		}
20556
20557		let containerId;
20558		let path;
20559
20560		if (i === -1) {
20561			containerId = moduleName;
20562			path = '.';
20563		}
20564		else {
20565			containerId = moduleName.substring(0, i);
20566			path = moduleName.substring(i + 1);
20567		}
20568
20569		return {containerId, path};
20570	}
20571
20572	/**
20573	 * Subscribe to a container request (to be notified when the <script>
20574	 * finishes loading)
20575	 */
20576	function subscribeContainerRequest(containerRequest, resolve, reject) {
20577		containerRequest.subscribers.push({reject, resolve});
20578	}
20579
20580	window[GET_MODULE_SYMBOL] = getModule;
20581	window[WEBPACK_HELPERS_SYMBOL] = {
20582		transformChunkScriptFilename,
20583	};
20584})();
20585

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.