~smagoun/whoopsie/whoopsie-lp1017637

« back to all changes in this revision

Viewing changes to backend/stats/static/js/yui/build/yui-nodejs/yui-nodejs-debug.js

  • Committer: Evan Dandrea
  • Date: 2012-05-09 05:53:45 UTC
  • Revision ID: evan.dandrea@canonical.com-20120509055345-z2j41tmcbf4as5uf
The backend now lives in lp:daisy and the website (errors.ubuntu.com) now lives in lp:errors.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
YUI 3.5.0 (build 5089)
3
 
Copyright 2012 Yahoo! Inc. All rights reserved.
4
 
Licensed under the BSD License.
5
 
http://yuilibrary.com/license/
6
 
*/
7
 
/**
8
 
 * The YUI module contains the components required for building the YUI seed
9
 
 * file.  This includes the script loading mechanism, a simple queue, and
10
 
 * the core utilities for the library.
11
 
 * @module yui
12
 
 * @submodule yui-base
13
 
 */
14
 
 
15
 
if (typeof YUI != 'undefined') {
16
 
    YUI._YUI = YUI;
17
 
}
18
 
 
19
 
/**
20
 
The YUI global namespace object.  If YUI is already defined, the
21
 
existing YUI object will not be overwritten so that defined
22
 
namespaces are preserved.  It is the constructor for the object
23
 
the end user interacts with.  As indicated below, each instance
24
 
has full custom event support, but only if the event system
25
 
is available.  This is a self-instantiable factory function.  You
26
 
can invoke it directly like this:
27
 
 
28
 
     YUI().use('*', function(Y) {
29
 
         // ready
30
 
     });
31
 
 
32
 
But it also works like this:
33
 
 
34
 
     var Y = YUI();
35
 
 
36
 
Configuring the YUI object:
37
 
 
38
 
    YUI({
39
 
        debug: true,
40
 
        combine: false
41
 
    }).use('node', function(Y) {
42
 
        //Node is ready to use
43
 
    });
44
 
 
45
 
See the API docs for the <a href="config.html">Config</a> class
46
 
for the complete list of supported configuration properties accepted
47
 
by the YUI constuctor.
48
 
 
49
 
@class YUI
50
 
@constructor
51
 
@global
52
 
@uses EventTarget
53
 
@param [o]* {Object} 0..n optional configuration objects.  these values
54
 
are store in Y.config.  See <a href="config.html">Config</a> for the list of supported
55
 
properties.
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
 
                YUI.GlobalConfig is a master configuration that might span
77
 
                multiple contexts in a non-browser environment.  It is applied
78
 
                first to all instances in all contexts.
79
 
                @property GlobalConfig
80
 
                @type {Object}
81
 
                @global
82
 
                @static
83
 
                @example
84
 
 
85
 
 
86
 
                    YUI.GlobalConfig = {
87
 
                        filter: 'debug'
88
 
                    };
89
 
 
90
 
                    YUI().use('node', function(Y) {
91
 
                        //debug files used here
92
 
                    });
93
 
 
94
 
                    YUI({
95
 
                        filter: 'min'
96
 
                    }).use('node', function(Y) {
97
 
                        //min files used here
98
 
                    });
99
 
 
100
 
            */
101
 
            if (YUI.GlobalConfig) {
102
 
                Y.applyConfig(YUI.GlobalConfig);
103
 
            }
104
 
 
105
 
            /**
106
 
                YUI_config is a page-level config.  It is applied to all
107
 
                instances created on the page.  This is applied after
108
 
                YUI.GlobalConfig, and before the instance level configuration
109
 
                objects.
110
 
                @global
111
 
                @property YUI_config
112
 
                @type {Object}
113
 
                @example
114
 
 
115
 
 
116
 
                    //Single global var to include before YUI seed file
117
 
                    YUI_config = {
118
 
                        filter: 'debug'
119
 
                    };
120
 
 
121
 
                    YUI().use('node', function(Y) {
122
 
                        //debug files used here
123
 
                    });
124
 
 
125
 
                    YUI({
126
 
                        filter: 'min'
127
 
                    }).use('node', function(Y) {
128
 
                        //min files used here
129
 
                    });
130
 
            */
131
 
            if (gconf) {
132
 
                Y.applyConfig(gconf);
133
 
            }
134
 
 
135
 
            // bind the specified additional modules for this instance
136
 
            if (!l) {
137
 
                Y._setup();
138
 
            }
139
 
        }
140
 
 
141
 
        if (l) {
142
 
            // Each instance can accept one or more configuration objects.
143
 
            // These are applied after YUI.GlobalConfig and YUI_Config,
144
 
            // overriding values set in those config files if there is a '
145
 
            // matching property.
146
 
            for (; i < l; i++) {
147
 
                Y.applyConfig(args[i]);
148
 
            }
149
 
 
150
 
            Y._setup();
151
 
        }
152
 
 
153
 
        Y.instanceOf = instanceOf;
154
 
 
155
 
        return Y;
156
 
    };
157
 
 
158
 
(function() {
159
 
 
160
 
    var proto, prop,
161
 
        VERSION = '3.5.0',
162
 
        PERIOD = '.',
163
 
        BASE = 'http://yui.yahooapis.com/',
164
 
        DOC_LABEL = 'yui3-js-enabled',
165
 
        CSS_STAMP_EL = 'yui3-css-stamp',
166
 
        NOOP = function() {},
167
 
        SLICE = Array.prototype.slice,
168
 
        APPLY_TO_AUTH = { 'io.xdrReady': 1,   // the functions applyTo
169
 
                          'io.xdrResponse': 1,   // can call. this should
170
 
                          'SWF.eventHandler': 1 }, // be done at build time
171
 
        hasWin = (typeof window != 'undefined'),
172
 
        win = (hasWin) ? window : null,
173
 
        doc = (hasWin) ? win.document : null,
174
 
        docEl = doc && doc.documentElement,
175
 
        docClass = docEl && docEl.className,
176
 
        instances = {},
177
 
        time = new Date().getTime(),
178
 
        add = function(el, type, fn, capture) {
179
 
            if (el && el.addEventListener) {
180
 
                el.addEventListener(type, fn, capture);
181
 
            } else if (el && el.attachEvent) {
182
 
                el.attachEvent('on' + type, fn);
183
 
            }
184
 
        },
185
 
        remove = function(el, type, fn, capture) {
186
 
            if (el && el.removeEventListener) {
187
 
                // this can throw an uncaught exception in FF
188
 
                try {
189
 
                    el.removeEventListener(type, fn, capture);
190
 
                } catch (ex) {}
191
 
            } else if (el && el.detachEvent) {
192
 
                el.detachEvent('on' + type, fn);
193
 
            }
194
 
        },
195
 
        handleLoad = function() {
196
 
            YUI.Env.windowLoaded = true;
197
 
            YUI.Env.DOMReady = true;
198
 
            if (hasWin) {
199
 
                remove(window, 'load', handleLoad);
200
 
            }
201
 
        },
202
 
        getLoader = function(Y, o) {
203
 
            var loader = Y.Env._loader;
204
 
            if (loader) {
205
 
                //loader._config(Y.config);
206
 
                loader.ignoreRegistered = false;
207
 
                loader.onEnd = null;
208
 
                loader.data = null;
209
 
                loader.required = [];
210
 
                loader.loadType = null;
211
 
            } else {
212
 
                loader = new Y.Loader(Y.config);
213
 
                Y.Env._loader = loader;
214
 
            }
215
 
            YUI.Env.core = Y.Array.dedupe([].concat(YUI.Env.core, [ 'loader-base', 'loader-rollup', 'loader-yui3' ]));
216
 
 
217
 
            return loader;
218
 
        },
219
 
 
220
 
        clobber = function(r, s) {
221
 
            for (var i in s) {
222
 
                if (s.hasOwnProperty(i)) {
223
 
                    r[i] = s[i];
224
 
                }
225
 
            }
226
 
        },
227
 
 
228
 
        ALREADY_DONE = { success: true };
229
 
 
230
 
//  Stamp the documentElement (HTML) with a class of "yui-loaded" to
231
 
//  enable styles that need to key off of JS being enabled.
232
 
if (docEl && docClass.indexOf(DOC_LABEL) == -1) {
233
 
    if (docClass) {
234
 
        docClass += ' ';
235
 
    }
236
 
    docClass += DOC_LABEL;
237
 
    docEl.className = docClass;
238
 
}
239
 
 
240
 
if (VERSION.indexOf('@') > -1) {
241
 
    VERSION = '3.3.0'; // dev time hack for cdn test
242
 
}
243
 
 
244
 
proto = {
245
 
    /**
246
 
     * Applies a new configuration object to the YUI instance config.
247
 
     * This will merge new group/module definitions, and will also
248
 
     * update the loader cache if necessary.  Updating Y.config directly
249
 
     * will not update the cache.
250
 
     * @method applyConfig
251
 
     * @param {Object} o the configuration object.
252
 
     * @since 3.2.0
253
 
     */
254
 
    applyConfig: function(o) {
255
 
 
256
 
        o = o || NOOP;
257
 
 
258
 
        var attr,
259
 
            name,
260
 
            // detail,
261
 
            config = this.config,
262
 
            mods = config.modules,
263
 
            groups = config.groups,
264
 
            aliases = config.aliases,
265
 
            loader = this.Env._loader;
266
 
 
267
 
        for (name in o) {
268
 
            if (o.hasOwnProperty(name)) {
269
 
                attr = o[name];
270
 
                if (mods && name == 'modules') {
271
 
                    clobber(mods, attr);
272
 
                } else if (aliases && name == 'aliases') {
273
 
                    clobber(aliases, attr);
274
 
                } else if (groups && name == 'groups') {
275
 
                    clobber(groups, attr);
276
 
                } else if (name == 'win') {
277
 
                    config[name] = (attr && attr.contentWindow) || attr;
278
 
                    config.doc = config[name] ? config[name].document : null;
279
 
                } else if (name == '_yuid') {
280
 
                    // preserve the guid
281
 
                } else {
282
 
                    config[name] = attr;
283
 
                }
284
 
            }
285
 
        }
286
 
 
287
 
        if (loader) {
288
 
            loader._config(o);
289
 
        }
290
 
 
291
 
    },
292
 
    /**
293
 
    * Old way to apply a config to the instance (calls `applyConfig` under the hood)
294
 
    * @private
295
 
    * @method _config
296
 
    * @param {Object} o The config to apply
297
 
    */
298
 
    _config: function(o) {
299
 
        this.applyConfig(o);
300
 
    },
301
 
 
302
 
    /**
303
 
     * Initialize this YUI instance
304
 
     * @private
305
 
     * @method _init
306
 
     */
307
 
    _init: function() {
308
 
        var filter, el,
309
 
            Y = this,
310
 
            G_ENV = YUI.Env,
311
 
            Env = Y.Env,
312
 
            prop;
313
 
 
314
 
        /**
315
 
         * The version number of the YUI instance.
316
 
         * @property version
317
 
         * @type string
318
 
         */
319
 
        Y.version = VERSION;
320
 
 
321
 
        if (!Env) {
322
 
            Y.Env = {
323
 
                core: ['get','features','intl-base','yui-log', 'yui-log-nodejs', 'yui-later','loader-base', 'loader-rollup', 'loader-yui3'],
324
 
                mods: {}, // flat module map
325
 
                versions: {}, // version module map
326
 
                base: BASE,
327
 
                cdn: BASE + VERSION + '/build/',
328
 
                // bootstrapped: false,
329
 
                _idx: 0,
330
 
                _used: {},
331
 
                _attached: {},
332
 
                _missed: [],
333
 
                _yidx: 0,
334
 
                _uidx: 0,
335
 
                _guidp: 'y',
336
 
                _loaded: {},
337
 
                // serviced: {},
338
 
                // Regex in English:
339
 
                // I'll start at the \b(simpleyui).
340
 
                // 1. Look in the test string for "simpleyui" or "yui" or
341
 
                //    "yui-base" or "yui-davglass" or "yui-foobar" that comes after a word break.  That is, it
342
 
                //    can't match "foyui" or "i_heart_simpleyui". This can be anywhere in the string.
343
 
                // 2. After #1 must come a forward slash followed by the string matched in #1, so
344
 
                //    "yui-base/yui-base" or "simpleyui/simpleyui" or "yui-pants/yui-pants".
345
 
                // 3. The second occurence of the #1 token can optionally be followed by "-debug" or "-min",
346
 
                //    so "yui/yui-min", "yui/yui-debug", "yui-base/yui-base-debug". NOT "yui/yui-tshirt".
347
 
                // 4. This is followed by ".js", so "yui/yui.js", "simpleyui/simpleyui-min.js"
348
 
                // 0. Going back to the beginning, now. If all that stuff in 1-4 comes after a "?" in the string,
349
 
                //    then capture the junk between the LAST "&" and the string in 1-4.  So
350
 
                //    "blah?foo/yui/yui.js" will capture "foo/" and "blah?some/thing.js&3.3.0/build/yui-davglass/yui-davglass.js"
351
 
                //    will capture "3.3.0/build/"
352
 
                //
353
 
                // Regex Exploded:
354
 
                // (?:\?             Find a ?
355
 
                //   (?:[^&]*&)      followed by 0..n characters followed by an &
356
 
                //   *               in fact, find as many sets of characters followed by a & as you can
357
 
                //   ([^&]*)         capture the stuff after the last & in \1
358
 
                // )?                but it's ok if all this ?junk&more_junk stuff isn't even there
359
 
                // \b(simpleyui|     after a word break find either the string "simpleyui" or
360
 
                //    yui(?:-\w+)?   the string "yui" optionally followed by a -, then more characters
361
 
                // )                 and store the simpleyui or yui-* string in \2
362
 
                // \/\2              then comes a / followed by the simpleyui or yui-* string in \2
363
 
                // (?:-(min|debug))? optionally followed by "-min" or "-debug"
364
 
                // .js               and ending in ".js"
365
 
                _BASE_RE: /(?:\?(?:[^&]*&)*([^&]*))?\b(simpleyui|yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,
366
 
                parseBasePath: function(src, pattern) {
367
 
                    var match = src.match(pattern),
368
 
                        path, filter;
369
 
 
370
 
                    if (match) {
371
 
                        path = RegExp.leftContext || src.slice(0, src.indexOf(match[0]));
372
 
 
373
 
                        // this is to set up the path to the loader.  The file
374
 
                        // filter for loader should match the yui include.
375
 
                        filter = match[3];
376
 
 
377
 
                        // extract correct path for mixed combo urls
378
 
                        // http://yuilibrary.com/projects/yui3/ticket/2528423
379
 
                        if (match[1]) {
380
 
                            path += '?' + match[1];
381
 
                        }
382
 
                        path = {
383
 
                            filter: filter,
384
 
                            path: path
385
 
                        }
386
 
                    }
387
 
                    return path;
388
 
                },
389
 
                getBase: G_ENV && G_ENV.getBase ||
390
 
                        function(pattern) {
391
 
                            var nodes = (doc && doc.getElementsByTagName('script')) || [],
392
 
                                path = Env.cdn, parsed,
393
 
                                i, len, src;
394
 
 
395
 
                            for (i = 0, len = nodes.length; i < len; ++i) {
396
 
                                src = nodes[i].src;
397
 
                                if (src) {
398
 
                                    parsed = Y.Env.parseBasePath(src, pattern);
399
 
                                    if (parsed) {
400
 
                                        filter = parsed.filter;
401
 
                                        path = parsed.path;
402
 
                                        break;
403
 
                                    }
404
 
                                }
405
 
                            }
406
 
 
407
 
                            // use CDN default
408
 
                            return path;
409
 
                        }
410
 
 
411
 
            };
412
 
 
413
 
            Env = Y.Env;
414
 
 
415
 
            Env._loaded[VERSION] = {};
416
 
 
417
 
            if (G_ENV && Y !== YUI) {
418
 
                Env._yidx = ++G_ENV._yidx;
419
 
                Env._guidp = ('yui_' + VERSION + '_' +
420
 
                             Env._yidx + '_' + time).replace(/\./g, '_');
421
 
            } else if (YUI._YUI) {
422
 
 
423
 
                G_ENV = YUI._YUI.Env;
424
 
                Env._yidx += G_ENV._yidx;
425
 
                Env._uidx += G_ENV._uidx;
426
 
 
427
 
                for (prop in G_ENV) {
428
 
                    if (!(prop in Env)) {
429
 
                        Env[prop] = G_ENV[prop];
430
 
                    }
431
 
                }
432
 
 
433
 
                delete YUI._YUI;
434
 
            }
435
 
 
436
 
            Y.id = Y.stamp(Y);
437
 
            instances[Y.id] = Y;
438
 
 
439
 
        }
440
 
 
441
 
        Y.constructor = YUI;
442
 
 
443
 
        // configuration defaults
444
 
        Y.config = Y.config || {
445
 
            bootstrap: true,
446
 
            cacheUse: true,
447
 
            debug: true,
448
 
            doc: doc,
449
 
            fetchCSS: true,
450
 
            throwFail: true,
451
 
            useBrowserConsole: true,
452
 
            useNativeES5: true,
453
 
            win: win
454
 
        };
455
 
 
456
 
        //Register the CSS stamp element
457
 
        if (doc && !doc.getElementById(CSS_STAMP_EL)) {
458
 
            el = doc.createElement('div');
459
 
            el.innerHTML = '<div id="' + CSS_STAMP_EL + '" style="position: absolute !important; visibility: hidden !important"></div>';
460
 
            YUI.Env.cssStampEl = el.firstChild;
461
 
            docEl.insertBefore(YUI.Env.cssStampEl, docEl.firstChild);
462
 
        }
463
 
 
464
 
        Y.config.lang = Y.config.lang || 'en-US';
465
 
 
466
 
        Y.config.base = YUI.config.base || Y.Env.getBase(Y.Env._BASE_RE);
467
 
 
468
 
        if (!filter || (!('mindebug').indexOf(filter))) {
469
 
            filter = 'min';
470
 
        }
471
 
        filter = (filter) ? '-' + filter : filter;
472
 
        Y.config.loaderPath = YUI.config.loaderPath || 'loader/loader' + filter + '.js';
473
 
 
474
 
    },
475
 
 
476
 
    /**
477
 
     * Finishes the instance setup. Attaches whatever modules were defined
478
 
     * when the yui modules was registered.
479
 
     * @method _setup
480
 
     * @private
481
 
     */
482
 
    _setup: function(o) {
483
 
        var i, Y = this,
484
 
            core = [],
485
 
            mods = YUI.Env.mods,
486
 
            //extras = Y.config.core || ['get','features','intl-base','yui-log', 'yui-log-nodejs', 'yui-later','loader-base', 'loader-rollup', 'loader-yui3'];
487
 
            extras = Y.config.core || [].concat(YUI.Env.core); //Clone it..
488
 
 
489
 
        for (i = 0; i < extras.length; i++) {
490
 
            if (mods[extras[i]]) {
491
 
                core.push(extras[i]);
492
 
            }
493
 
        }
494
 
 
495
 
        Y._attach(['yui-base']);
496
 
        Y._attach(core);
497
 
 
498
 
        if (Y.Loader) {
499
 
            getLoader(Y);
500
 
        }
501
 
 
502
 
        // Y.log(Y.id + ' initialized', 'info', 'yui');
503
 
    },
504
 
 
505
 
    /**
506
 
     * Executes a method on a YUI instance with
507
 
     * the specified id if the specified method is whitelisted.
508
 
     * @method applyTo
509
 
     * @param id {String} the YUI instance id.
510
 
     * @param method {String} the name of the method to exectute.
511
 
     * Ex: 'Object.keys'.
512
 
     * @param args {Array} the arguments to apply to the method.
513
 
     * @return {Object} the return value from the applied method or null.
514
 
     */
515
 
    applyTo: function(id, method, args) {
516
 
        if (!(method in APPLY_TO_AUTH)) {
517
 
            this.log(method + ': applyTo not allowed', 'warn', 'yui');
518
 
            return null;
519
 
        }
520
 
 
521
 
        var instance = instances[id], nest, m, i;
522
 
        if (instance) {
523
 
            nest = method.split('.');
524
 
            m = instance;
525
 
            for (i = 0; i < nest.length; i = i + 1) {
526
 
                m = m[nest[i]];
527
 
                if (!m) {
528
 
                    this.log('applyTo not found: ' + method, 'warn', 'yui');
529
 
                }
530
 
            }
531
 
            return m && m.apply(instance, args);
532
 
        }
533
 
 
534
 
        return null;
535
 
    },
536
 
 
537
 
/**
538
 
Registers a module with the YUI global.  The easiest way to create a
539
 
first-class YUI module is to use the YUI component build tool.
540
 
 
541
 
http://yuilibrary.com/projects/builder
542
 
 
543
 
The build system will produce the `YUI.add` wrapper for you module, along
544
 
with any configuration info required for the module.
545
 
@method add
546
 
@param name {String} module name.
547
 
@param fn {Function} entry point into the module that is used to bind module to the YUI instance.
548
 
@param {YUI} fn.Y The YUI instance this module is executed in.
549
 
@param {String} fn.name The name of the module
550
 
@param version {String} version string.
551
 
@param details {Object} optional config data:
552
 
@param details.requires {Array} features that must be present before this module can be attached.
553
 
@param details.optional {Array} optional features that should be present if loadOptional
554
 
 is defined.  Note: modules are not often loaded this way in YUI 3,
555
 
 but this field is still useful to inform the user that certain
556
 
 features in the component will require additional dependencies.
557
 
@param details.use {Array} features that are included within this module which need to
558
 
 be attached automatically when this module is attached.  This
559
 
 supports the YUI 3 rollup system -- a module with submodules
560
 
 defined will need to have the submodules listed in the 'use'
561
 
 config.  The YUI component build tool does this for you.
562
 
@return {YUI} the YUI instance.
563
 
@example
564
 
 
565
 
    YUI.add('davglass', function(Y, name) {
566
 
        Y.davglass = function() {
567
 
            alert('Dav was here!');
568
 
        };
569
 
    }, '3.4.0', { requires: ['yui-base', 'harley-davidson', 'mt-dew'] });
570
 
 
571
 
*/
572
 
    add: function(name, fn, version, details) {
573
 
        details = details || {};
574
 
        var env = YUI.Env,
575
 
            mod = {
576
 
                name: name,
577
 
                fn: fn,
578
 
                version: version,
579
 
                details: details
580
 
            },
581
 
            loader,
582
 
            i, versions = env.versions;
583
 
 
584
 
        env.mods[name] = mod;
585
 
        versions[version] = versions[version] || {};
586
 
        versions[version][name] = mod;
587
 
 
588
 
        for (i in instances) {
589
 
            if (instances.hasOwnProperty(i)) {
590
 
                loader = instances[i].Env._loader;
591
 
                if (loader) {
592
 
                    if (!loader.moduleInfo[name] || loader.moduleInfo[name].temp) {
593
 
                        loader.addModule(details, name);
594
 
                    }
595
 
                }
596
 
            }
597
 
        }
598
 
 
599
 
        return this;
600
 
    },
601
 
 
602
 
    /**
603
 
     * Executes the function associated with each required
604
 
     * module, binding the module to the YUI instance.
605
 
     * @param {Array} r The array of modules to attach
606
 
     * @param {Boolean} [moot=false] Don't throw a warning if the module is not attached
607
 
     * @method _attach
608
 
     * @private
609
 
     */
610
 
    _attach: function(r, moot) {
611
 
        var i, name, mod, details, req, use, after,
612
 
            mods = YUI.Env.mods,
613
 
            aliases = YUI.Env.aliases,
614
 
            Y = this, j,
615
 
            loader = Y.Env._loader,
616
 
            done = Y.Env._attached,
617
 
            len = r.length, loader,
618
 
            c = [];
619
 
 
620
 
        //Check for conditional modules (in a second+ instance) and add their requirements
621
 
        //TODO I hate this entire method, it needs to be fixed ASAP (3.5.0) ^davglass
622
 
        for (i = 0; i < len; i++) {
623
 
            name = r[i];
624
 
            mod = mods[name];
625
 
            c.push(name);
626
 
            if (loader && loader.conditions[name]) {
627
 
                Y.Object.each(loader.conditions[name], function(def) {
628
 
                    var go = def && ((def.ua && Y.UA[def.ua]) || (def.test && def.test(Y)));
629
 
                    if (go) {
630
 
                        c.push(def.name);
631
 
                    }
632
 
                });
633
 
            }
634
 
        }
635
 
        r = c;
636
 
        len = r.length;
637
 
 
638
 
        for (i = 0; i < len; i++) {
639
 
            if (!done[r[i]]) {
640
 
                name = r[i];
641
 
                mod = mods[name];
642
 
 
643
 
                if (aliases && aliases[name]) {
644
 
                    Y._attach(aliases[name]);
645
 
                    continue;
646
 
                }
647
 
                if (!mod) {
648
 
                    if (loader && loader.moduleInfo[name]) {
649
 
                        mod = loader.moduleInfo[name];
650
 
                        moot = true;
651
 
                    }
652
 
 
653
 
                    // Y.log('no js def for: ' + name, 'info', 'yui');
654
 
 
655
 
                    //if (!loader || !loader.moduleInfo[name]) {
656
 
                    //if ((!loader || !loader.moduleInfo[name]) && !moot) {
657
 
                    if (!moot && name) {
658
 
                        if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {
659
 
                            Y.Env._missed.push(name);
660
 
                            Y.Env._missed = Y.Array.dedupe(Y.Env._missed);
661
 
                            Y.message('NOT loaded: ' + name, 'warn', 'yui');
662
 
                        }
663
 
                    }
664
 
                } else {
665
 
                    done[name] = true;
666
 
                    //Don't like this, but in case a mod was asked for once, then we fetch it
667
 
                    //We need to remove it from the missed list ^davglass
668
 
                    for (j = 0; j < Y.Env._missed.length; j++) {
669
 
                        if (Y.Env._missed[j] === name) {
670
 
                            Y.message('Found: ' + name + ' (was reported as missing earlier)', 'warn', 'yui');
671
 
                            Y.Env._missed.splice(j, 1);
672
 
                        }
673
 
                    }
674
 
                    details = mod.details;
675
 
                    req = details.requires;
676
 
                    use = details.use;
677
 
                    after = details.after;
678
 
 
679
 
                    if (req) {
680
 
                        for (j = 0; j < req.length; j++) {
681
 
                            if (!done[req[j]]) {
682
 
                                if (!Y._attach(req)) {
683
 
                                    return false;
684
 
                                }
685
 
                                break;
686
 
                            }
687
 
                        }
688
 
                    }
689
 
 
690
 
                    if (after) {
691
 
                        for (j = 0; j < after.length; j++) {
692
 
                            if (!done[after[j]]) {
693
 
                                if (!Y._attach(after, true)) {
694
 
                                    return false;
695
 
                                }
696
 
                                break;
697
 
                            }
698
 
                        }
699
 
                    }
700
 
 
701
 
                    if (mod.fn) {
702
 
                        try {
703
 
                            mod.fn(Y, name);
704
 
                        } catch (e) {
705
 
                            Y.error('Attach error: ' + name, e, name);
706
 
                            return false;
707
 
                        }
708
 
                    }
709
 
 
710
 
                    if (use) {
711
 
                        for (j = 0; j < use.length; j++) {
712
 
                            if (!done[use[j]]) {
713
 
                                if (!Y._attach(use)) {
714
 
                                    return false;
715
 
                                }
716
 
                                break;
717
 
                            }
718
 
                        }
719
 
                    }
720
 
 
721
 
 
722
 
 
723
 
                }
724
 
            }
725
 
        }
726
 
 
727
 
        return true;
728
 
    },
729
 
 
730
 
    /**
731
 
     * Attaches one or more modules to the YUI instance.  When this
732
 
     * is executed, the requirements are analyzed, and one of
733
 
     * several things can happen:
734
 
     *
735
 
     *  * All requirements are available on the page --  The modules
736
 
     *   are attached to the instance.  If supplied, the use callback
737
 
     *   is executed synchronously.
738
 
     *
739
 
     *  * Modules are missing, the Get utility is not available OR
740
 
     *   the 'bootstrap' config is false -- A warning is issued about
741
 
     *   the missing modules and all available modules are attached.
742
 
     *
743
 
     *  * Modules are missing, the Loader is not available but the Get
744
 
     *   utility is and boostrap is not false -- The loader is bootstrapped
745
 
     *   before doing the following....
746
 
     *
747
 
     *  * Modules are missing and the Loader is available -- The loader
748
 
     *   expands the dependency tree and fetches missing modules.  When
749
 
     *   the loader is finshed the callback supplied to use is executed
750
 
     *   asynchronously.
751
 
     *
752
 
     * @method use
753
 
     * @param modules* {String|Array} 1-n modules to bind (uses arguments array).
754
 
     * @param [callback] {Function} callback function executed when
755
 
     * the instance has the required functionality.  If included, it
756
 
     * must be the last parameter.
757
 
     * @param callback.Y {YUI} The `YUI` instance created for this sandbox
758
 
     * @param callback.data {Object} Object data returned from `Loader`.
759
 
     *
760
 
     * @example
761
 
     *      // loads and attaches dd and its dependencies
762
 
     *      YUI().use('dd', function(Y) {});
763
 
     *
764
 
     *      // loads and attaches dd and node as well as all of their dependencies (since 3.4.0)
765
 
     *      YUI().use(['dd', 'node'], function(Y) {});
766
 
     *
767
 
     *      // attaches all modules that are available on the page
768
 
     *      YUI().use('*', function(Y) {});
769
 
     *
770
 
     *      // intrinsic YUI gallery support (since 3.1.0)
771
 
     *      YUI().use('gallery-yql', function(Y) {});
772
 
     *
773
 
     *      // intrinsic YUI 2in3 support (since 3.1.0)
774
 
     *      YUI().use('yui2-datatable', function(Y) {});
775
 
     *
776
 
     * @return {YUI} the YUI instance.
777
 
     */
778
 
    use: function() {
779
 
        var args = SLICE.call(arguments, 0),
780
 
            callback = args[args.length - 1],
781
 
            Y = this,
782
 
            i = 0,
783
 
            a = [],
784
 
            name,
785
 
            Env = Y.Env,
786
 
            provisioned = true;
787
 
 
788
 
        // The last argument supplied to use can be a load complete callback
789
 
        if (Y.Lang.isFunction(callback)) {
790
 
            args.pop();
791
 
        } else {
792
 
            callback = null;
793
 
        }
794
 
        if (Y.Lang.isArray(args[0])) {
795
 
            args = args[0];
796
 
        }
797
 
 
798
 
        if (Y.config.cacheUse) {
799
 
            while ((name = args[i++])) {
800
 
                if (!Env._attached[name]) {
801
 
                    provisioned = false;
802
 
                    break;
803
 
                }
804
 
            }
805
 
 
806
 
            if (provisioned) {
807
 
                if (args.length) {
808
 
                    Y.log('already provisioned: ' + args, 'info', 'yui');
809
 
                }
810
 
                Y._notify(callback, ALREADY_DONE, args);
811
 
                return Y;
812
 
            }
813
 
        }
814
 
 
815
 
        if (Y._loading) {
816
 
            Y._useQueue = Y._useQueue || new Y.Queue();
817
 
            Y._useQueue.add([args, callback]);
818
 
        } else {
819
 
            Y._use(args, function(Y, response) {
820
 
                Y._notify(callback, response, args);
821
 
            });
822
 
        }
823
 
 
824
 
        return Y;
825
 
    },
826
 
    /**
827
 
    * Notify handler from Loader for attachment/load errors
828
 
    * @method _notify
829
 
    * @param callback {Function} The callback to pass to the `Y.config.loadErrorFn`
830
 
    * @param response {Object} The response returned from Loader
831
 
    * @param args {Array} The aruments passed from Loader
832
 
    * @private
833
 
    */
834
 
    _notify: function(callback, response, args) {
835
 
        if (!response.success && this.config.loadErrorFn) {
836
 
            this.config.loadErrorFn.call(this, this, callback, response, args);
837
 
        } else if (callback) {
838
 
            try {
839
 
                callback(this, response);
840
 
            } catch (e) {
841
 
                this.error('use callback error', e, args);
842
 
            }
843
 
        }
844
 
    },
845
 
 
846
 
    /**
847
 
    * This private method is called from the `use` method queue. To ensure that only one set of loading
848
 
    * logic is performed at a time.
849
 
    * @method _use
850
 
    * @private
851
 
    * @param args* {String} 1-n modules to bind (uses arguments array).
852
 
    * @param *callback {Function} callback function executed when
853
 
    * the instance has the required functionality.  If included, it
854
 
    * must be the last parameter.
855
 
    */
856
 
    _use: function(args, callback) {
857
 
 
858
 
        if (!this.Array) {
859
 
            this._attach(['yui-base']);
860
 
        }
861
 
 
862
 
        var len, loader, handleBoot, handleRLS,
863
 
            Y = this,
864
 
            G_ENV = YUI.Env,
865
 
            mods = G_ENV.mods,
866
 
            Env = Y.Env,
867
 
            used = Env._used,
868
 
            aliases = G_ENV.aliases,
869
 
            queue = G_ENV._loaderQueue,
870
 
            firstArg = args[0],
871
 
            YArray = Y.Array,
872
 
            config = Y.config,
873
 
            boot = config.bootstrap,
874
 
            missing = [],
875
 
            r = [],
876
 
            ret = true,
877
 
            fetchCSS = config.fetchCSS,
878
 
            process = function(names, skip) {
879
 
 
880
 
                var i = 0, a = [];
881
 
 
882
 
                if (!names.length) {
883
 
                    return;
884
 
                }
885
 
 
886
 
                if (aliases) {
887
 
                    for (i = 0; i < names.length; i++) {
888
 
                        if (aliases[names[i]]) {
889
 
                            a = [].concat(a, aliases[names[i]]);
890
 
                        } else {
891
 
                            a.push(names[i]);
892
 
                        }
893
 
                    }
894
 
                    names = a;
895
 
                }
896
 
 
897
 
                YArray.each(names, function(name) {
898
 
 
899
 
                    // add this module to full list of things to attach
900
 
                    if (!skip) {
901
 
                        r.push(name);
902
 
                    }
903
 
 
904
 
                    // only attach a module once
905
 
                    if (used[name]) {
906
 
                        return;
907
 
                    }
908
 
 
909
 
                    var m = mods[name], req, use;
910
 
 
911
 
                    if (m) {
912
 
                        used[name] = true;
913
 
                        req = m.details.requires;
914
 
                        use = m.details.use;
915
 
                    } else {
916
 
                        // CSS files don't register themselves, see if it has
917
 
                        // been loaded
918
 
                        if (!G_ENV._loaded[VERSION][name]) {
919
 
                            missing.push(name);
920
 
                        } else {
921
 
                            used[name] = true; // probably css
922
 
                        }
923
 
                    }
924
 
 
925
 
                    // make sure requirements are attached
926
 
                    if (req && req.length) {
927
 
                        process(req);
928
 
                    }
929
 
 
930
 
                    // make sure we grab the submodule dependencies too
931
 
                    if (use && use.length) {
932
 
                        process(use, 1);
933
 
                    }
934
 
                });
935
 
            },
936
 
 
937
 
            handleLoader = function(fromLoader) {
938
 
                var response = fromLoader || {
939
 
                        success: true,
940
 
                        msg: 'not dynamic'
941
 
                    },
942
 
                    redo, origMissing,
943
 
                    ret = true,
944
 
                    data = response.data;
945
 
 
946
 
                Y._loading = false;
947
 
 
948
 
                if (data) {
949
 
                    origMissing = missing;
950
 
                    missing = [];
951
 
                    r = [];
952
 
                    process(data);
953
 
                    redo = missing.length;
954
 
                    if (redo) {
955
 
                        if (missing.sort().join() ==
956
 
                                origMissing.sort().join()) {
957
 
                            redo = false;
958
 
                        }
959
 
                    }
960
 
                }
961
 
 
962
 
                if (redo && data) {
963
 
                    Y._loading = true;
964
 
                    Y._use(missing, function() {
965
 
                        Y.log('Nested use callback: ' + data, 'info', 'yui');
966
 
                        if (Y._attach(data)) {
967
 
                            Y._notify(callback, response, data);
968
 
                        }
969
 
                    });
970
 
                } else {
971
 
                    if (data) {
972
 
                        // Y.log('attaching from loader: ' + data, 'info', 'yui');
973
 
                        ret = Y._attach(data);
974
 
                    }
975
 
                    if (ret) {
976
 
                        Y._notify(callback, response, args);
977
 
                    }
978
 
                }
979
 
 
980
 
                if (Y._useQueue && Y._useQueue.size() && !Y._loading) {
981
 
                    Y._use.apply(Y, Y._useQueue.next());
982
 
                }
983
 
 
984
 
            };
985
 
 
986
 
// Y.log(Y.id + ': use called: ' + a + ' :: ' + callback, 'info', 'yui');
987
 
 
988
 
        // YUI().use('*'); // bind everything available
989
 
        if (firstArg === '*') {
990
 
            ret = Y._attach(Y.Object.keys(mods));
991
 
            if (ret) {
992
 
                handleLoader();
993
 
            }
994
 
            return Y;
995
 
        }
996
 
 
997
 
        if (mods['loader'] && !Y.Loader) {
998
 
            Y.log('Loader was found in meta, but it is not attached. Attaching..', 'info', 'yui');
999
 
            Y._attach(['loader']);
1000
 
        }
1001
 
 
1002
 
        // Y.log('before loader requirements: ' + args, 'info', 'yui');
1003
 
 
1004
 
        // use loader to expand dependencies and sort the
1005
 
        // requirements if it is available.
1006
 
        if (boot && Y.Loader && args.length) {
1007
 
            loader = getLoader(Y);
1008
 
            loader.require(args);
1009
 
            loader.ignoreRegistered = true;
1010
 
            loader._boot = true;
1011
 
            loader.calculate(null, (fetchCSS) ? null : 'js');
1012
 
            args = loader.sorted;
1013
 
            loader._boot = false;
1014
 
        }
1015
 
 
1016
 
        // process each requirement and any additional requirements
1017
 
        // the module metadata specifies
1018
 
        process(args);
1019
 
 
1020
 
        len = missing.length;
1021
 
 
1022
 
        if (len) {
1023
 
            missing = Y.Object.keys(YArray.hash(missing));
1024
 
            len = missing.length;
1025
 
Y.log('Modules missing: ' + missing + ', ' + missing.length, 'info', 'yui');
1026
 
        }
1027
 
 
1028
 
 
1029
 
        // dynamic load
1030
 
        if (boot && len && Y.Loader) {
1031
 
// Y.log('Using loader to fetch missing deps: ' + missing, 'info', 'yui');
1032
 
            Y.log('Using Loader', 'info', 'yui');
1033
 
            Y._loading = true;
1034
 
            loader = getLoader(Y);
1035
 
            loader.onEnd = handleLoader;
1036
 
            loader.context = Y;
1037
 
            loader.data = args;
1038
 
            loader.ignoreRegistered = false;
1039
 
            loader.require(args);
1040
 
            loader.insert(null, (fetchCSS) ? null : 'js');
1041
 
 
1042
 
        } else if (boot && len && Y.Get && !Env.bootstrapped) {
1043
 
 
1044
 
            Y._loading = true;
1045
 
 
1046
 
            handleBoot = function() {
1047
 
                Y._loading = false;
1048
 
                queue.running = false;
1049
 
                Env.bootstrapped = true;
1050
 
                G_ENV._bootstrapping = false;
1051
 
                if (Y._attach(['loader'])) {
1052
 
                    Y._use(args, callback);
1053
 
                }
1054
 
            };
1055
 
 
1056
 
            if (G_ENV._bootstrapping) {
1057
 
Y.log('Waiting for loader', 'info', 'yui');
1058
 
                queue.add(handleBoot);
1059
 
            } else {
1060
 
                G_ENV._bootstrapping = true;
1061
 
Y.log('Fetching loader: ' + config.base + config.loaderPath, 'info', 'yui');
1062
 
                Y.Get.script(config.base + config.loaderPath, {
1063
 
                    onEnd: handleBoot
1064
 
                });
1065
 
            }
1066
 
 
1067
 
        } else {
1068
 
            Y.log('Attaching available dependencies: ' + args, 'info', 'yui');
1069
 
            ret = Y._attach(args);
1070
 
            if (ret) {
1071
 
                handleLoader();
1072
 
            }
1073
 
        }
1074
 
 
1075
 
        return Y;
1076
 
    },
1077
 
 
1078
 
 
1079
 
    /**
1080
 
    Adds a namespace object onto the YUI global if called statically.
1081
 
 
1082
 
        // creates YUI.your.namespace.here as nested objects
1083
 
        YUI.namespace("your.namespace.here");
1084
 
 
1085
 
    If called as a method on a YUI <em>instance</em>, it creates the
1086
 
    namespace on the instance.
1087
 
 
1088
 
         // creates Y.property.package
1089
 
         Y.namespace("property.package");
1090
 
 
1091
 
    Dots in the input string cause `namespace` to create nested objects for
1092
 
    each token. If any part of the requested namespace already exists, the
1093
 
    current object will be left in place.  This allows multiple calls to
1094
 
    `namespace` to preserve existing namespaced properties.
1095
 
 
1096
 
    If the first token in the namespace string is "YAHOO", the token is
1097
 
    discarded.
1098
 
 
1099
 
    Be careful with namespace tokens. Reserved words may work in some browsers
1100
 
    and not others. For instance, the following will fail in some browsers
1101
 
    because the supported version of JavaScript reserves the word "long":
1102
 
 
1103
 
         Y.namespace("really.long.nested.namespace");
1104
 
 
1105
 
    <em>Note: If you pass multiple arguments to create multiple namespaces, only
1106
 
    the last one created is returned from this function.</em>
1107
 
 
1108
 
    @method namespace
1109
 
    @param  {String} namespace* namespaces to create.
1110
 
    @return {Object}  A reference to the last namespace object created.
1111
 
    **/
1112
 
    namespace: function() {
1113
 
        var a = arguments, o, i = 0, j, d, arg;
1114
 
 
1115
 
        for (; i < a.length; i++) {
1116
 
            o = this; //Reset base object per argument or it will get reused from the last
1117
 
            arg = a[i];
1118
 
            if (arg.indexOf(PERIOD) > -1) { //Skip this if no "." is present
1119
 
                d = arg.split(PERIOD);
1120
 
                for (j = (d[0] == 'YAHOO') ? 1 : 0; j < d.length; j++) {
1121
 
                    o[d[j]] = o[d[j]] || {};
1122
 
                    o = o[d[j]];
1123
 
                }
1124
 
            } else {
1125
 
                o[arg] = o[arg] || {};
1126
 
                o = o[arg]; //Reset base object to the new object so it's returned
1127
 
            }
1128
 
        }
1129
 
        return o;
1130
 
    },
1131
 
 
1132
 
    // this is replaced if the log module is included
1133
 
    log: NOOP,
1134
 
    message: NOOP,
1135
 
    // this is replaced if the dump module is included
1136
 
    dump: function (o) { return ''+o; },
1137
 
 
1138
 
    /**
1139
 
     * Report an error.  The reporting mechanism is controlled by
1140
 
     * the `throwFail` configuration attribute.  If throwFail is
1141
 
     * not specified, the message is written to the Logger, otherwise
1142
 
     * a JS error is thrown. If an `errorFn` is specified in the config
1143
 
     * it must return `true` to keep the error from being thrown.
1144
 
     * @method error
1145
 
     * @param msg {String} the error message.
1146
 
     * @param e {Error|String} Optional JS error that was caught, or an error string.
1147
 
     * @param src Optional additional info (passed to `Y.config.errorFn` and `Y.message`)
1148
 
     * and `throwFail` is specified, this error will be re-thrown.
1149
 
     * @return {YUI} this YUI instance.
1150
 
     */
1151
 
    error: function(msg, e, src) {
1152
 
        //TODO Add check for window.onerror here
1153
 
 
1154
 
        var Y = this, ret;
1155
 
 
1156
 
        if (Y.config.errorFn) {
1157
 
            ret = Y.config.errorFn.apply(Y, arguments);
1158
 
        }
1159
 
 
1160
 
        if (Y.config.throwFail && !ret) {
1161
 
            throw (e || new Error(msg));
1162
 
        } else {
1163
 
            Y.message(msg, 'error', ''+src); // don't scrub this one
1164
 
        }
1165
 
 
1166
 
        return Y;
1167
 
    },
1168
 
 
1169
 
    /**
1170
 
     * Generate an id that is unique among all YUI instances
1171
 
     * @method guid
1172
 
     * @param pre {String} optional guid prefix.
1173
 
     * @return {String} the guid.
1174
 
     */
1175
 
    guid: function(pre) {
1176
 
        var id = this.Env._guidp + '_' + (++this.Env._uidx);
1177
 
        return (pre) ? (pre + id) : id;
1178
 
    },
1179
 
 
1180
 
    /**
1181
 
     * Returns a `guid` associated with an object.  If the object
1182
 
     * does not have one, a new one is created unless `readOnly`
1183
 
     * is specified.
1184
 
     * @method stamp
1185
 
     * @param o {Object} The object to stamp.
1186
 
     * @param readOnly {Boolean} if `true`, a valid guid will only
1187
 
     * be returned if the object has one assigned to it.
1188
 
     * @return {String} The object's guid or null.
1189
 
     */
1190
 
    stamp: function(o, readOnly) {
1191
 
        var uid;
1192
 
        if (!o) {
1193
 
            return o;
1194
 
        }
1195
 
 
1196
 
        // IE generates its own unique ID for dom nodes
1197
 
        // The uniqueID property of a document node returns a new ID
1198
 
        if (o.uniqueID && o.nodeType && o.nodeType !== 9) {
1199
 
            uid = o.uniqueID;
1200
 
        } else {
1201
 
            uid = (typeof o === 'string') ? o : o._yuid;
1202
 
        }
1203
 
 
1204
 
        if (!uid) {
1205
 
            uid = this.guid();
1206
 
            if (!readOnly) {
1207
 
                try {
1208
 
                    o._yuid = uid;
1209
 
                } catch (e) {
1210
 
                    uid = null;
1211
 
                }
1212
 
            }
1213
 
        }
1214
 
        return uid;
1215
 
    },
1216
 
 
1217
 
    /**
1218
 
     * Destroys the YUI instance
1219
 
     * @method destroy
1220
 
     * @since 3.3.0
1221
 
     */
1222
 
    destroy: function() {
1223
 
        var Y = this;
1224
 
        if (Y.Event) {
1225
 
            Y.Event._unload();
1226
 
        }
1227
 
        delete instances[Y.id];
1228
 
        delete Y.Env;
1229
 
        delete Y.config;
1230
 
    }
1231
 
 
1232
 
    /**
1233
 
     * instanceof check for objects that works around
1234
 
     * memory leak in IE when the item tested is
1235
 
     * window/document
1236
 
     * @method instanceOf
1237
 
     * @param o {Object} The object to check.
1238
 
     * @param type {Object} The class to check against.
1239
 
     * @since 3.3.0
1240
 
     */
1241
 
};
1242
 
 
1243
 
    YUI.prototype = proto;
1244
 
 
1245
 
    // inheritance utilities are not available yet
1246
 
    for (prop in proto) {
1247
 
        if (proto.hasOwnProperty(prop)) {
1248
 
            YUI[prop] = proto[prop];
1249
 
        }
1250
 
    }
1251
 
 
1252
 
    /**
1253
 
Static method on the Global YUI object to apply a config to all YUI instances.
1254
 
It's main use case is "mashups" where several third party scripts are trying to write to
1255
 
a global YUI config at the same time. This way they can all call `YUI.applyConfig({})` instead of
1256
 
overwriting other scripts configs.
1257
 
@static
1258
 
@since 3.5.0
1259
 
@method applyConfig
1260
 
@param {Object} o the configuration object.
1261
 
@example
1262
 
 
1263
 
    YUI.applyConfig({
1264
 
        modules: {
1265
 
            davglass: {
1266
 
                fullpath: './davglass.js'
1267
 
            }
1268
 
        }
1269
 
    });
1270
 
 
1271
 
    YUI.applyConfig({
1272
 
        modules: {
1273
 
            foo: {
1274
 
                fullpath: './foo.js'
1275
 
            }
1276
 
        }
1277
 
    });
1278
 
 
1279
 
    YUI().use('davglass', function(Y) {
1280
 
        //Module davglass will be available here..
1281
 
    });
1282
 
 
1283
 
    */
1284
 
    YUI.applyConfig = function(o) {
1285
 
        if (!o) {
1286
 
            return;
1287
 
        }
1288
 
        //If there is a GlobalConfig, apply it first to set the defaults
1289
 
        if (YUI.GlobalConfig) {
1290
 
            this.prototype.applyConfig.call(this, YUI.GlobalConfig);
1291
 
        }
1292
 
        //Apply this config to it
1293
 
        this.prototype.applyConfig.call(this, o);
1294
 
        //Reset GlobalConfig to the combined config
1295
 
        YUI.GlobalConfig = this.config;
1296
 
    };
1297
 
 
1298
 
    // set up the environment
1299
 
    YUI._init();
1300
 
 
1301
 
    if (hasWin) {
1302
 
        // add a window load event at load time so we can capture
1303
 
        // the case where it fires before dynamic loading is
1304
 
        // complete.
1305
 
        add(window, 'load', handleLoad);
1306
 
    } else {
1307
 
        handleLoad();
1308
 
    }
1309
 
 
1310
 
    YUI.Env.add = add;
1311
 
    YUI.Env.remove = remove;
1312
 
 
1313
 
    /*global exports*/
1314
 
    // Support the CommonJS method for exporting our single global
1315
 
    if (typeof exports == 'object') {
1316
 
        exports.YUI = YUI;
1317
 
    }
1318
 
 
1319
 
}());
1320
 
 
1321
 
 
1322
 
/**
1323
 
 * The config object contains all of the configuration options for
1324
 
 * the `YUI` instance.  This object is supplied by the implementer
1325
 
 * when instantiating a `YUI` instance.  Some properties have default
1326
 
 * values if they are not supplied by the implementer.  This should
1327
 
 * not be updated directly because some values are cached.  Use
1328
 
 * `applyConfig()` to update the config object on a YUI instance that
1329
 
 * has already been configured.
1330
 
 *
1331
 
 * @class config
1332
 
 * @static
1333
 
 */
1334
 
 
1335
 
/**
1336
 
 * Allows the YUI seed file to fetch the loader component and library
1337
 
 * metadata to dynamically load additional dependencies.
1338
 
 *
1339
 
 * @property bootstrap
1340
 
 * @type boolean
1341
 
 * @default true
1342
 
 */
1343
 
 
1344
 
/**
1345
 
 * Turns on writing Ylog messages to the browser console.
1346
 
 *
1347
 
 * @property debug
1348
 
 * @type boolean
1349
 
 * @default true
1350
 
 */
1351
 
 
1352
 
/**
1353
 
 * Log to the browser console if debug is on and the browser has a
1354
 
 * supported console.
1355
 
 *
1356
 
 * @property useBrowserConsole
1357
 
 * @type boolean
1358
 
 * @default true
1359
 
 */
1360
 
 
1361
 
/**
1362
 
 * A hash of log sources that should be logged.  If specified, only
1363
 
 * log messages from these sources will be logged.
1364
 
 *
1365
 
 * @property logInclude
1366
 
 * @type object
1367
 
 */
1368
 
 
1369
 
/**
1370
 
 * A hash of log sources that should be not be logged.  If specified,
1371
 
 * all sources are logged if not on this list.
1372
 
 *
1373
 
 * @property logExclude
1374
 
 * @type object
1375
 
 */
1376
 
 
1377
 
/**
1378
 
 * Set to true if the yui seed file was dynamically loaded in
1379
 
 * order to bootstrap components relying on the window load event
1380
 
 * and the `domready` custom event.
1381
 
 *
1382
 
 * @property injected
1383
 
 * @type boolean
1384
 
 * @default false
1385
 
 */
1386
 
 
1387
 
/**
1388
 
 * If `throwFail` is set, `Y.error` will generate or re-throw a JS Error.
1389
 
 * Otherwise the failure is logged.
1390
 
 *
1391
 
 * @property throwFail
1392
 
 * @type boolean
1393
 
 * @default true
1394
 
 */
1395
 
 
1396
 
/**
1397
 
 * The window/frame that this instance should operate in.
1398
 
 *
1399
 
 * @property win
1400
 
 * @type Window
1401
 
 * @default the window hosting YUI
1402
 
 */
1403
 
 
1404
 
/**
1405
 
 * The document associated with the 'win' configuration.
1406
 
 *
1407
 
 * @property doc
1408
 
 * @type Document
1409
 
 * @default the document hosting YUI
1410
 
 */
1411
 
 
1412
 
/**
1413
 
 * A list of modules that defines the YUI core (overrides the default list).
1414
 
 *
1415
 
 * @property core
1416
 
 * @type Array
1417
 
 * @default [ get,features,intl-base,yui-log,yui-later,loader-base, loader-rollup, loader-yui3 ]
1418
 
 */
1419
 
 
1420
 
/**
1421
 
 * A list of languages in order of preference. This list is matched against
1422
 
 * the list of available languages in modules that the YUI instance uses to
1423
 
 * determine the best possible localization of language sensitive modules.
1424
 
 * Languages are represented using BCP 47 language tags, such as "en-GB" for
1425
 
 * English as used in the United Kingdom, or "zh-Hans-CN" for simplified
1426
 
 * Chinese as used in China. The list can be provided as a comma-separated
1427
 
 * list or as an array.
1428
 
 *
1429
 
 * @property lang
1430
 
 * @type string|string[]
1431
 
 */
1432
 
 
1433
 
/**
1434
 
 * The default date format
1435
 
 * @property dateFormat
1436
 
 * @type string
1437
 
 * @deprecated use configuration in `DataType.Date.format()` instead.
1438
 
 */
1439
 
 
1440
 
/**
1441
 
 * The default locale
1442
 
 * @property locale
1443
 
 * @type string
1444
 
 * @deprecated use `config.lang` instead.
1445
 
 */
1446
 
 
1447
 
/**
1448
 
 * The default interval when polling in milliseconds.
1449
 
 * @property pollInterval
1450
 
 * @type int
1451
 
 * @default 20
1452
 
 */
1453
 
 
1454
 
/**
1455
 
 * The number of dynamic nodes to insert by default before
1456
 
 * automatically removing them.  This applies to script nodes
1457
 
 * because removing the node will not make the evaluated script
1458
 
 * unavailable.  Dynamic CSS is not auto purged, because removing
1459
 
 * a linked style sheet will also remove the style definitions.
1460
 
 * @property purgethreshold
1461
 
 * @type int
1462
 
 * @default 20
1463
 
 */
1464
 
 
1465
 
/**
1466
 
 * The default interval when polling in milliseconds.
1467
 
 * @property windowResizeDelay
1468
 
 * @type int
1469
 
 * @default 40
1470
 
 */
1471
 
 
1472
 
/**
1473
 
 * Base directory for dynamic loading
1474
 
 * @property base
1475
 
 * @type string
1476
 
 */
1477
 
 
1478
 
/*
1479
 
 * The secure base dir (not implemented)
1480
 
 * For dynamic loading.
1481
 
 * @property secureBase
1482
 
 * @type string
1483
 
 */
1484
 
 
1485
 
/**
1486
 
 * The YUI combo service base dir. Ex: `http://yui.yahooapis.com/combo?`
1487
 
 * For dynamic loading.
1488
 
 * @property comboBase
1489
 
 * @type string
1490
 
 */
1491
 
 
1492
 
/**
1493
 
 * The root path to prepend to module path for the combo service.
1494
 
 * Ex: 3.0.0b1/build/
1495
 
 * For dynamic loading.
1496
 
 * @property root
1497
 
 * @type string
1498
 
 */
1499
 
 
1500
 
/**
1501
 
 * A filter to apply to result urls.  This filter will modify the default
1502
 
 * path for all modules.  The default path for the YUI library is the
1503
 
 * minified version of the files (e.g., event-min.js).  The filter property
1504
 
 * can be a predefined filter or a custom filter.  The valid predefined
1505
 
 * filters are:
1506
 
 * <dl>
1507
 
 *  <dt>DEBUG</dt>
1508
 
 *  <dd>Selects the debug versions of the library (e.g., event-debug.js).
1509
 
 *      This option will automatically include the Logger widget</dd>
1510
 
 *  <dt>RAW</dt>
1511
 
 *  <dd>Selects the non-minified version of the library (e.g., event.js).</dd>
1512
 
 * </dl>
1513
 
 * You can also define a custom filter, which must be an object literal
1514
 
 * containing a search expression and a replace string:
1515
 
 *
1516
 
 *      myFilter: {
1517
 
 *          'searchExp': "-min\\.js",
1518
 
 *          'replaceStr': "-debug.js"
1519
 
 *      }
1520
 
 *
1521
 
 * For dynamic loading.
1522
 
 *
1523
 
 * @property filter
1524
 
 * @type string|object
1525
 
 */
1526
 
 
1527
 
/**
1528
 
 * The `skin` config let's you configure application level skin
1529
 
 * customizations.  It contains the following attributes which
1530
 
 * can be specified to override the defaults:
1531
 
 *
1532
 
 *      // The default skin, which is automatically applied if not
1533
 
 *      // overriden by a component-specific skin definition.
1534
 
 *      // Change this in to apply a different skin globally
1535
 
 *      defaultSkin: 'sam',
1536
 
 *
1537
 
 *      // This is combined with the loader base property to get
1538
 
 *      // the default root directory for a skin.
1539
 
 *      base: 'assets/skins/',
1540
 
 *
1541
 
 *      // Any component-specific overrides can be specified here,
1542
 
 *      // making it possible to load different skins for different
1543
 
 *      // components.  It is possible to load more than one skin
1544
 
 *      // for a given component as well.
1545
 
 *      overrides: {
1546
 
 *          slider: ['capsule', 'round']
1547
 
 *      }
1548
 
 *
1549
 
 * For dynamic loading.
1550
 
 *
1551
 
 *  @property skin
1552
 
 */
1553
 
 
1554
 
/**
1555
 
 * Hash of per-component filter specification.  If specified for a given
1556
 
 * component, this overrides the filter config.
1557
 
 *
1558
 
 * For dynamic loading.
1559
 
 *
1560
 
 * @property filters
1561
 
 */
1562
 
 
1563
 
/**
1564
 
 * Use the YUI combo service to reduce the number of http connections
1565
 
 * required to load your dependencies.  Turning this off will
1566
 
 * disable combo handling for YUI and all module groups configured
1567
 
 * with a combo service.
1568
 
 *
1569
 
 * For dynamic loading.
1570
 
 *
1571
 
 * @property combine
1572
 
 * @type boolean
1573
 
 * @default true if 'base' is not supplied, false if it is.
1574
 
 */
1575
 
 
1576
 
/**
1577
 
 * A list of modules that should never be dynamically loaded
1578
 
 *
1579
 
 * @property ignore
1580
 
 * @type string[]
1581
 
 */
1582
 
 
1583
 
/**
1584
 
 * A list of modules that should always be loaded when required, even if already
1585
 
 * present on the page.
1586
 
 *
1587
 
 * @property force
1588
 
 * @type string[]
1589
 
 */
1590
 
 
1591
 
/**
1592
 
 * Node or id for a node that should be used as the insertion point for new
1593
 
 * nodes.  For dynamic loading.
1594
 
 *
1595
 
 * @property insertBefore
1596
 
 * @type string
1597
 
 */
1598
 
 
1599
 
/**
1600
 
 * Object literal containing attributes to add to dynamically loaded script
1601
 
 * nodes.
1602
 
 * @property jsAttributes
1603
 
 * @type string
1604
 
 */
1605
 
 
1606
 
/**
1607
 
 * Object literal containing attributes to add to dynamically loaded link
1608
 
 * nodes.
1609
 
 * @property cssAttributes
1610
 
 * @type string
1611
 
 */
1612
 
 
1613
 
/**
1614
 
 * Number of milliseconds before a timeout occurs when dynamically
1615
 
 * loading nodes. If not set, there is no timeout.
1616
 
 * @property timeout
1617
 
 * @type int
1618
 
 */
1619
 
 
1620
 
/**
1621
 
 * Callback for the 'CSSComplete' event.  When dynamically loading YUI
1622
 
 * components with CSS, this property fires when the CSS is finished
1623
 
 * loading but script loading is still ongoing.  This provides an
1624
 
 * opportunity to enhance the presentation of a loading page a little
1625
 
 * bit before the entire loading process is done.
1626
 
 *
1627
 
 * @property onCSS
1628
 
 * @type function
1629
 
 */
1630
 
 
1631
 
/**
1632
 
 * A hash of module definitions to add to the list of YUI components.
1633
 
 * These components can then be dynamically loaded side by side with
1634
 
 * YUI via the `use()` method. This is a hash, the key is the module
1635
 
 * name, and the value is an object literal specifying the metdata
1636
 
 * for the module.  See `Loader.addModule` for the supported module
1637
 
 * metadata fields.  Also see groups, which provides a way to
1638
 
 * configure the base and combo spec for a set of modules.
1639
 
 *
1640
 
 *      modules: {
1641
 
 *          mymod1: {
1642
 
 *              requires: ['node'],
1643
 
 *              fullpath: '/mymod1/mymod1.js'
1644
 
 *          },
1645
 
 *          mymod2: {
1646
 
 *              requires: ['mymod1'],
1647
 
 *              fullpath: '/mymod2/mymod2.js'
1648
 
 *          },
1649
 
 *          mymod3: '/js/mymod3.js',
1650
 
 *          mycssmod: '/css/mycssmod.css'
1651
 
 *      }
1652
 
 *
1653
 
 *
1654
 
 * @property modules
1655
 
 * @type object
1656
 
 */
1657
 
 
1658
 
/**
1659
 
 * Aliases are dynamic groups of modules that can be used as
1660
 
 * shortcuts.
1661
 
 *
1662
 
 *      YUI({
1663
 
 *          aliases: {
1664
 
 *              davglass: [ 'node', 'yql', 'dd' ],
1665
 
 *              mine: [ 'davglass', 'autocomplete']
1666
 
 *          }
1667
 
 *      }).use('mine', function(Y) {
1668
 
 *          //Node, YQL, DD &amp; AutoComplete available here..
1669
 
 *      });
1670
 
 *
1671
 
 * @property aliases
1672
 
 * @type object
1673
 
 */
1674
 
 
1675
 
/**
1676
 
 * A hash of module group definitions.  It for each group you
1677
 
 * can specify a list of modules and the base path and
1678
 
 * combo spec to use when dynamically loading the modules.
1679
 
 *
1680
 
 *      groups: {
1681
 
 *          yui2: {
1682
 
 *              // specify whether or not this group has a combo service
1683
 
 *              combine: true,
1684
 
 *
1685
 
 *              // The comboSeperator to use with this group's combo handler
1686
 
 *              comboSep: ';',
1687
 
 *
1688
 
 *              // The maxURLLength for this server
1689
 
 *              maxURLLength: 500,
1690
 
 *
1691
 
 *              // the base path for non-combo paths
1692
 
 *              base: 'http://yui.yahooapis.com/2.8.0r4/build/',
1693
 
 *
1694
 
 *              // the path to the combo service
1695
 
 *              comboBase: 'http://yui.yahooapis.com/combo?',
1696
 
 *
1697
 
 *              // a fragment to prepend to the path attribute when
1698
 
 *              // when building combo urls
1699
 
 *              root: '2.8.0r4/build/',
1700
 
 *
1701
 
 *              // the module definitions
1702
 
 *              modules:  {
1703
 
 *                  yui2_yde: {
1704
 
 *                      path: "yahoo-dom-event/yahoo-dom-event.js"
1705
 
 *                  },
1706
 
 *                  yui2_anim: {
1707
 
 *                      path: "animation/animation.js",
1708
 
 *                      requires: ['yui2_yde']
1709
 
 *                  }
1710
 
 *              }
1711
 
 *          }
1712
 
 *      }
1713
 
 *
1714
 
 * @property groups
1715
 
 * @type object
1716
 
 */
1717
 
 
1718
 
/**
1719
 
 * The loader 'path' attribute to the loader itself.  This is combined
1720
 
 * with the 'base' attribute to dynamically load the loader component
1721
 
 * when boostrapping with the get utility alone.
1722
 
 *
1723
 
 * @property loaderPath
1724
 
 * @type string
1725
 
 * @default loader/loader-min.js
1726
 
 */
1727
 
 
1728
 
/**
1729
 
 * Specifies whether or not YUI().use(...) will attempt to load CSS
1730
 
 * resources at all.  Any truthy value will cause CSS dependencies
1731
 
 * to load when fetching script.  The special value 'force' will
1732
 
 * cause CSS dependencies to be loaded even if no script is needed.
1733
 
 *
1734
 
 * @property fetchCSS
1735
 
 * @type boolean|string
1736
 
 * @default true
1737
 
 */
1738
 
 
1739
 
/**
1740
 
 * The default gallery version to build gallery module urls
1741
 
 * @property gallery
1742
 
 * @type string
1743
 
 * @since 3.1.0
1744
 
 */
1745
 
 
1746
 
/**
1747
 
 * The default YUI 2 version to build yui2 module urls.  This is for
1748
 
 * intrinsic YUI 2 support via the 2in3 project.  Also see the '2in3'
1749
 
 * config for pulling different revisions of the wrapped YUI 2
1750
 
 * modules.
1751
 
 * @since 3.1.0
1752
 
 * @property yui2
1753
 
 * @type string
1754
 
 * @default 2.9.0
1755
 
 */
1756
 
 
1757
 
/**
1758
 
 * The 2in3 project is a deployment of the various versions of YUI 2
1759
 
 * deployed as first-class YUI 3 modules.  Eventually, the wrapper
1760
 
 * for the modules will change (but the underlying YUI 2 code will
1761
 
 * be the same), and you can select a particular version of
1762
 
 * the wrapper modules via this config.
1763
 
 * @since 3.1.0
1764
 
 * @property 2in3
1765
 
 * @type string
1766
 
 * @default 4
1767
 
 */
1768
 
 
1769
 
/**
1770
 
 * Alternative console log function for use in environments without
1771
 
 * a supported native console.  The function is executed in the
1772
 
 * YUI instance context.
1773
 
 * @since 3.1.0
1774
 
 * @property logFn
1775
 
 * @type Function
1776
 
 */
1777
 
 
1778
 
/**
1779
 
 * A callback to execute when Y.error is called.  It receives the
1780
 
 * error message and an javascript error object if Y.error was
1781
 
 * executed because a javascript error was caught.  The function
1782
 
 * is executed in the YUI instance context. Returning `true` from this
1783
 
 * function will stop the Error from being thrown.
1784
 
 *
1785
 
 * @since 3.2.0
1786
 
 * @property errorFn
1787
 
 * @type Function
1788
 
 */
1789
 
 
1790
 
/**
1791
 
 * A callback to execute when the loader fails to load one or
1792
 
 * more resource.  This could be because of a script load
1793
 
 * failure.  It can also fail if a javascript module fails
1794
 
 * to register itself, but only when the 'requireRegistration'
1795
 
 * is true.  If this function is defined, the use() callback will
1796
 
 * only be called when the loader succeeds, otherwise it always
1797
 
 * executes unless there was a javascript error when attaching
1798
 
 * a module.
1799
 
 *
1800
 
 * @since 3.3.0
1801
 
 * @property loadErrorFn
1802
 
 * @type Function
1803
 
 */
1804
 
 
1805
 
/**
1806
 
 * When set to true, the YUI loader will expect that all modules
1807
 
 * it is responsible for loading will be first-class YUI modules
1808
 
 * that register themselves with the YUI global.  If this is
1809
 
 * set to true, loader will fail if the module registration fails
1810
 
 * to happen after the script is loaded.
1811
 
 *
1812
 
 * @since 3.3.0
1813
 
 * @property requireRegistration
1814
 
 * @type boolean
1815
 
 * @default false
1816
 
 */
1817
 
 
1818
 
/**
1819
 
 * Cache serviced use() requests.
1820
 
 * @since 3.3.0
1821
 
 * @property cacheUse
1822
 
 * @type boolean
1823
 
 * @default true
1824
 
 * @deprecated no longer used
1825
 
 */
1826
 
 
1827
 
/**
1828
 
 * Whether or not YUI should use native ES5 functionality when available for
1829
 
 * features like `Y.Array.each()`, `Y.Object()`, etc. When `false`, YUI will
1830
 
 * always use its own fallback implementations instead of relying on ES5
1831
 
 * functionality, even when it's available.
1832
 
 *
1833
 
 * @method useNativeES5
1834
 
 * @type Boolean
1835
 
 * @default true
1836
 
 * @since 3.5.0
1837
 
 */
1838
 
YUI.add('yui-base', function(Y) {
1839
 
 
1840
 
/*
1841
 
 * YUI stub
1842
 
 * @module yui
1843
 
 * @submodule yui-base
1844
 
 */
1845
 
/**
1846
 
 * The YUI module contains the components required for building the YUI
1847
 
 * seed file.  This includes the script loading mechanism, a simple queue,
1848
 
 * and the core utilities for the library.
1849
 
 * @module yui
1850
 
 * @submodule yui-base
1851
 
 */
1852
 
 
1853
 
/**
1854
 
 * Provides core language utilites and extensions used throughout YUI.
1855
 
 *
1856
 
 * @class Lang
1857
 
 * @static
1858
 
 */
1859
 
 
1860
 
var L = Y.Lang || (Y.Lang = {}),
1861
 
 
1862
 
STRING_PROTO = String.prototype,
1863
 
TOSTRING     = Object.prototype.toString,
1864
 
 
1865
 
TYPES = {
1866
 
    'undefined'        : 'undefined',
1867
 
    'number'           : 'number',
1868
 
    'boolean'          : 'boolean',
1869
 
    'string'           : 'string',
1870
 
    '[object Function]': 'function',
1871
 
    '[object RegExp]'  : 'regexp',
1872
 
    '[object Array]'   : 'array',
1873
 
    '[object Date]'    : 'date',
1874
 
    '[object Error]'   : 'error'
1875
 
},
1876
 
 
1877
 
SUBREGEX        = /\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,
1878
 
TRIMREGEX       = /^\s+|\s+$/g,
1879
 
NATIVE_FN_REGEX = /\{\s*\[(?:native code|function)\]\s*\}/i;
1880
 
 
1881
 
// -- Protected Methods --------------------------------------------------------
1882
 
 
1883
 
/**
1884
 
Returns `true` if the given function appears to be implemented in native code,
1885
 
`false` otherwise. Will always return `false` -- even in ES5-capable browsers --
1886
 
if the `useNativeES5` YUI config option is set to `false`.
1887
 
 
1888
 
This isn't guaranteed to be 100% accurate and won't work for anything other than
1889
 
functions, but it can be useful for determining whether a function like
1890
 
`Array.prototype.forEach` is native or a JS shim provided by another library.
1891
 
 
1892
 
There's a great article by @kangax discussing certain flaws with this technique:
1893
 
<http://perfectionkills.com/detecting-built-in-host-methods/>
1894
 
 
1895
 
While his points are valid, it's still possible to benefit from this function
1896
 
as long as it's used carefully and sparingly, and in such a way that false
1897
 
negatives have minimal consequences. It's used internally to avoid using
1898
 
potentially broken non-native ES5 shims that have been added to the page by
1899
 
other libraries.
1900
 
 
1901
 
@method _isNative
1902
 
@param {Function} fn Function to test.
1903
 
@return {Boolean} `true` if _fn_ appears to be native, `false` otherwise.
1904
 
@static
1905
 
@protected
1906
 
@since 3.5.0
1907
 
**/
1908
 
L._isNative = function (fn) {
1909
 
    return !!(Y.config.useNativeES5 && fn && NATIVE_FN_REGEX.test(fn));
1910
 
};
1911
 
 
1912
 
// -- Public Methods -----------------------------------------------------------
1913
 
 
1914
 
/**
1915
 
 * Determines whether or not the provided item is an array.
1916
 
 *
1917
 
 * Returns `false` for array-like collections such as the function `arguments`
1918
 
 * collection or `HTMLElement` collections. Use `Y.Array.test()` if you want to
1919
 
 * test for an array-like collection.
1920
 
 *
1921
 
 * @method isArray
1922
 
 * @param o The object to test.
1923
 
 * @return {boolean} true if o is an array.
1924
 
 * @static
1925
 
 */
1926
 
L.isArray = L._isNative(Array.isArray) ? Array.isArray : function (o) {
1927
 
    return L.type(o) === 'array';
1928
 
};
1929
 
 
1930
 
/**
1931
 
 * Determines whether or not the provided item is a boolean.
1932
 
 * @method isBoolean
1933
 
 * @static
1934
 
 * @param o The object to test.
1935
 
 * @return {boolean} true if o is a boolean.
1936
 
 */
1937
 
L.isBoolean = function(o) {
1938
 
    return typeof o === 'boolean';
1939
 
};
1940
 
 
1941
 
/**
1942
 
 * Determines whether or not the supplied item is a date instance.
1943
 
 * @method isDate
1944
 
 * @static
1945
 
 * @param o The object to test.
1946
 
 * @return {boolean} true if o is a date.
1947
 
 */
1948
 
L.isDate = function(o) {
1949
 
    return L.type(o) === 'date' && o.toString() !== 'Invalid Date' && !isNaN(o);
1950
 
};
1951
 
 
1952
 
/**
1953
 
 * <p>
1954
 
 * Determines whether or not the provided item is a function.
1955
 
 * Note: Internet Explorer thinks certain functions are objects:
1956
 
 * </p>
1957
 
 *
1958
 
 * <pre>
1959
 
 * var obj = document.createElement("object");
1960
 
 * Y.Lang.isFunction(obj.getAttribute) // reports false in IE
1961
 
 * &nbsp;
1962
 
 * var input = document.createElement("input"); // append to body
1963
 
 * Y.Lang.isFunction(input.focus) // reports false in IE
1964
 
 * </pre>
1965
 
 *
1966
 
 * <p>
1967
 
 * You will have to implement additional tests if these functions
1968
 
 * matter to you.
1969
 
 * </p>
1970
 
 *
1971
 
 * @method isFunction
1972
 
 * @static
1973
 
 * @param o The object to test.
1974
 
 * @return {boolean} true if o is a function.
1975
 
 */
1976
 
L.isFunction = function(o) {
1977
 
    return L.type(o) === 'function';
1978
 
};
1979
 
 
1980
 
/**
1981
 
 * Determines whether or not the provided item is null.
1982
 
 * @method isNull
1983
 
 * @static
1984
 
 * @param o The object to test.
1985
 
 * @return {boolean} true if o is null.
1986
 
 */
1987
 
L.isNull = function(o) {
1988
 
    return o === null;
1989
 
};
1990
 
 
1991
 
/**
1992
 
 * Determines whether or not the provided item is a legal number.
1993
 
 * @method isNumber
1994
 
 * @static
1995
 
 * @param o The object to test.
1996
 
 * @return {boolean} true if o is a number.
1997
 
 */
1998
 
L.isNumber = function(o) {
1999
 
    return typeof o === 'number' && isFinite(o);
2000
 
};
2001
 
 
2002
 
/**
2003
 
 * Determines whether or not the provided item is of type object
2004
 
 * or function. Note that arrays are also objects, so
2005
 
 * <code>Y.Lang.isObject([]) === true</code>.
2006
 
 * @method isObject
2007
 
 * @static
2008
 
 * @param o The object to test.
2009
 
 * @param failfn {boolean} fail if the input is a function.
2010
 
 * @return {boolean} true if o is an object.
2011
 
 * @see isPlainObject
2012
 
 */
2013
 
L.isObject = function(o, failfn) {
2014
 
    var t = typeof o;
2015
 
    return (o && (t === 'object' ||
2016
 
        (!failfn && (t === 'function' || L.isFunction(o))))) || false;
2017
 
};
2018
 
 
2019
 
/**
2020
 
 * Determines whether or not the provided item is a string.
2021
 
 * @method isString
2022
 
 * @static
2023
 
 * @param o The object to test.
2024
 
 * @return {boolean} true if o is a string.
2025
 
 */
2026
 
L.isString = function(o) {
2027
 
    return typeof o === 'string';
2028
 
};
2029
 
 
2030
 
/**
2031
 
 * Determines whether or not the provided item is undefined.
2032
 
 * @method isUndefined
2033
 
 * @static
2034
 
 * @param o The object to test.
2035
 
 * @return {boolean} true if o is undefined.
2036
 
 */
2037
 
L.isUndefined = function(o) {
2038
 
    return typeof o === 'undefined';
2039
 
};
2040
 
 
2041
 
/**
2042
 
 * A convenience method for detecting a legitimate non-null value.
2043
 
 * Returns false for null/undefined/NaN, true for other values,
2044
 
 * including 0/false/''
2045
 
 * @method isValue
2046
 
 * @static
2047
 
 * @param o The item to test.
2048
 
 * @return {boolean} true if it is not null/undefined/NaN || false.
2049
 
 */
2050
 
L.isValue = function(o) {
2051
 
    var t = L.type(o);
2052
 
 
2053
 
    switch (t) {
2054
 
        case 'number':
2055
 
            return isFinite(o);
2056
 
 
2057
 
        case 'null': // fallthru
2058
 
        case 'undefined':
2059
 
            return false;
2060
 
 
2061
 
        default:
2062
 
            return !!t;
2063
 
    }
2064
 
};
2065
 
 
2066
 
/**
2067
 
 * Returns the current time in milliseconds.
2068
 
 *
2069
 
 * @method now
2070
 
 * @return {Number} Current time in milliseconds.
2071
 
 * @static
2072
 
 * @since 3.3.0
2073
 
 */
2074
 
L.now = Date.now || function () {
2075
 
    return new Date().getTime();
2076
 
};
2077
 
 
2078
 
/**
2079
 
 * Lightweight version of <code>Y.substitute</code>. Uses the same template
2080
 
 * structure as <code>Y.substitute</code>, but doesn't support recursion,
2081
 
 * auto-object coersion, or formats.
2082
 
 * @method sub
2083
 
 * @param {string} s String to be modified.
2084
 
 * @param {object} o Object containing replacement values.
2085
 
 * @return {string} the substitute result.
2086
 
 * @static
2087
 
 * @since 3.2.0
2088
 
 */
2089
 
L.sub = function(s, o) {
2090
 
    return s.replace ? s.replace(SUBREGEX, function (match, key) {
2091
 
        return L.isUndefined(o[key]) ? match : o[key];
2092
 
    }) : s;
2093
 
};
2094
 
 
2095
 
/**
2096
 
 * Returns a string without any leading or trailing whitespace.  If
2097
 
 * the input is not a string, the input will be returned untouched.
2098
 
 * @method trim
2099
 
 * @static
2100
 
 * @param s {string} the string to trim.
2101
 
 * @return {string} the trimmed string.
2102
 
 */
2103
 
L.trim = STRING_PROTO.trim ? function(s) {
2104
 
    return s && s.trim ? s.trim() : s;
2105
 
} : function (s) {
2106
 
    try {
2107
 
        return s.replace(TRIMREGEX, '');
2108
 
    } catch (e) {
2109
 
        return s;
2110
 
    }
2111
 
};
2112
 
 
2113
 
/**
2114
 
 * Returns a string without any leading whitespace.
2115
 
 * @method trimLeft
2116
 
 * @static
2117
 
 * @param s {string} the string to trim.
2118
 
 * @return {string} the trimmed string.
2119
 
 */
2120
 
L.trimLeft = STRING_PROTO.trimLeft ? function (s) {
2121
 
    return s.trimLeft();
2122
 
} : function (s) {
2123
 
    return s.replace(/^\s+/, '');
2124
 
};
2125
 
 
2126
 
/**
2127
 
 * Returns a string without any trailing whitespace.
2128
 
 * @method trimRight
2129
 
 * @static
2130
 
 * @param s {string} the string to trim.
2131
 
 * @return {string} the trimmed string.
2132
 
 */
2133
 
L.trimRight = STRING_PROTO.trimRight ? function (s) {
2134
 
    return s.trimRight();
2135
 
} : function (s) {
2136
 
    return s.replace(/\s+$/, '');
2137
 
};
2138
 
 
2139
 
/**
2140
 
Returns one of the following strings, representing the type of the item passed
2141
 
in:
2142
 
 
2143
 
 * "array"
2144
 
 * "boolean"
2145
 
 * "date"
2146
 
 * "error"
2147
 
 * "function"
2148
 
 * "null"
2149
 
 * "number"
2150
 
 * "object"
2151
 
 * "regexp"
2152
 
 * "string"
2153
 
 * "undefined"
2154
 
 
2155
 
Known issues:
2156
 
 
2157
 
 * `typeof HTMLElementCollection` returns function in Safari, but
2158
 
    `Y.Lang.type()` reports "object", which could be a good thing --
2159
 
    but it actually caused the logic in <code>Y.Lang.isObject</code> to fail.
2160
 
 
2161
 
@method type
2162
 
@param o the item to test.
2163
 
@return {string} the detected type.
2164
 
@static
2165
 
**/
2166
 
L.type = function(o) {
2167
 
    return TYPES[typeof o] || TYPES[TOSTRING.call(o)] || (o ? 'object' : 'null');
2168
 
};
2169
 
/**
2170
 
@module yui
2171
 
@submodule yui-base
2172
 
*/
2173
 
 
2174
 
var Lang   = Y.Lang,
2175
 
    Native = Array.prototype,
2176
 
 
2177
 
    hasOwn = Object.prototype.hasOwnProperty;
2178
 
 
2179
 
/**
2180
 
Provides utility methods for working with arrays. Additional array helpers can
2181
 
be found in the `collection` and `array-extras` modules.
2182
 
 
2183
 
`Y.Array(thing)` returns a native array created from _thing_. Depending on
2184
 
_thing_'s type, one of the following will happen:
2185
 
 
2186
 
  * Arrays are returned unmodified unless a non-zero _startIndex_ is
2187
 
    specified.
2188
 
  * Array-like collections (see `Array.test()`) are converted to arrays.
2189
 
  * For everything else, a new array is created with _thing_ as the sole
2190
 
    item.
2191
 
 
2192
 
Note: elements that are also collections, such as `<form>` and `<select>`
2193
 
elements, are not automatically converted to arrays. To force a conversion,
2194
 
pass `true` as the value of the _force_ parameter.
2195
 
 
2196
 
@class Array
2197
 
@constructor
2198
 
@param {Any} thing The thing to arrayify.
2199
 
@param {Number} [startIndex=0] If non-zero and _thing_ is an array or array-like
2200
 
  collection, a subset of items starting at the specified index will be
2201
 
  returned.
2202
 
@param {Boolean} [force=false] If `true`, _thing_ will be treated as an
2203
 
  array-like collection no matter what.
2204
 
@return {Array} A native array created from _thing_, according to the rules
2205
 
  described above.
2206
 
**/
2207
 
function YArray(thing, startIndex, force) {
2208
 
    var len, result;
2209
 
 
2210
 
    startIndex || (startIndex = 0);
2211
 
 
2212
 
    if (force || YArray.test(thing)) {
2213
 
        // IE throws when trying to slice HTMLElement collections.
2214
 
        try {
2215
 
            return Native.slice.call(thing, startIndex);
2216
 
        } catch (ex) {
2217
 
            result = [];
2218
 
 
2219
 
            for (len = thing.length; startIndex < len; ++startIndex) {
2220
 
                result.push(thing[startIndex]);
2221
 
            }
2222
 
 
2223
 
            return result;
2224
 
        }
2225
 
    }
2226
 
 
2227
 
    return [thing];
2228
 
}
2229
 
 
2230
 
Y.Array = YArray;
2231
 
 
2232
 
/**
2233
 
Dedupes an array of strings, returning an array that's guaranteed to contain
2234
 
only one copy of a given string.
2235
 
 
2236
 
This method differs from `Array.unique()` in that it's optimized for use only
2237
 
with strings, whereas `unique` may be used with other types (but is slower).
2238
 
Using `dedupe()` with non-string values may result in unexpected behavior.
2239
 
 
2240
 
@method dedupe
2241
 
@param {String[]} array Array of strings to dedupe.
2242
 
@return {Array} Deduped copy of _array_.
2243
 
@static
2244
 
@since 3.4.0
2245
 
**/
2246
 
YArray.dedupe = function (array) {
2247
 
    var hash    = {},
2248
 
        results = [],
2249
 
        i, item, len;
2250
 
 
2251
 
    for (i = 0, len = array.length; i < len; ++i) {
2252
 
        item = array[i];
2253
 
 
2254
 
        if (!hasOwn.call(hash, item)) {
2255
 
            hash[item] = 1;
2256
 
            results.push(item);
2257
 
        }
2258
 
    }
2259
 
 
2260
 
    return results;
2261
 
};
2262
 
 
2263
 
/**
2264
 
Executes the supplied function on each item in the array. This method wraps
2265
 
the native ES5 `Array.forEach()` method if available.
2266
 
 
2267
 
@method each
2268
 
@param {Array} array Array to iterate.
2269
 
@param {Function} fn Function to execute on each item in the array. The function
2270
 
  will receive the following arguments:
2271
 
    @param {Any} fn.item Current array item.
2272
 
    @param {Number} fn.index Current array index.
2273
 
    @param {Array} fn.array Array being iterated.
2274
 
@param {Object} [thisObj] `this` object to use when calling _fn_.
2275
 
@return {YUI} The YUI instance.
2276
 
@static
2277
 
**/
2278
 
YArray.each = YArray.forEach = Lang._isNative(Native.forEach) ? function (array, fn, thisObj) {
2279
 
    Native.forEach.call(array || [], fn, thisObj || Y);
2280
 
    return Y;
2281
 
} : function (array, fn, thisObj) {
2282
 
    for (var i = 0, len = (array && array.length) || 0; i < len; ++i) {
2283
 
        if (i in array) {
2284
 
            fn.call(thisObj || Y, array[i], i, array);
2285
 
        }
2286
 
    }
2287
 
 
2288
 
    return Y;
2289
 
};
2290
 
 
2291
 
/**
2292
 
Alias for `each()`.
2293
 
 
2294
 
@method forEach
2295
 
@static
2296
 
**/
2297
 
 
2298
 
/**
2299
 
Returns an object using the first array as keys and the second as values. If
2300
 
the second array is not provided, or if it doesn't contain the same number of
2301
 
values as the first array, then `true` will be used in place of the missing
2302
 
values.
2303
 
 
2304
 
@example
2305
 
 
2306
 
    Y.Array.hash(['a', 'b', 'c'], ['foo', 'bar']);
2307
 
    // => {a: 'foo', b: 'bar', c: true}
2308
 
 
2309
 
@method hash
2310
 
@param {String[]} keys Array of strings to use as keys.
2311
 
@param {Array} [values] Array to use as values.
2312
 
@return {Object} Hash using the first array as keys and the second as values.
2313
 
@static
2314
 
**/
2315
 
YArray.hash = function (keys, values) {
2316
 
    var hash = {},
2317
 
        vlen = (values && values.length) || 0,
2318
 
        i, len;
2319
 
 
2320
 
    for (i = 0, len = keys.length; i < len; ++i) {
2321
 
        if (i in keys) {
2322
 
            hash[keys[i]] = vlen > i && i in values ? values[i] : true;
2323
 
        }
2324
 
    }
2325
 
 
2326
 
    return hash;
2327
 
};
2328
 
 
2329
 
/**
2330
 
Returns the index of the first item in the array that's equal (using a strict
2331
 
equality check) to the specified _value_, or `-1` if the value isn't found.
2332
 
 
2333
 
This method wraps the native ES5 `Array.indexOf()` method if available.
2334
 
 
2335
 
@method indexOf
2336
 
@param {Array} array Array to search.
2337
 
@param {Any} value Value to search for.
2338
 
@param {Number} [from=0] The index at which to begin the search.
2339
 
@return {Number} Index of the item strictly equal to _value_, or `-1` if not
2340
 
    found.
2341
 
@static
2342
 
**/
2343
 
YArray.indexOf = Lang._isNative(Native.indexOf) ? function (array, value, from) {
2344
 
    return Native.indexOf.call(array, value, from);
2345
 
} : function (array, value, from) {
2346
 
    // http://es5.github.com/#x15.4.4.14
2347
 
    var len = array.length;
2348
 
 
2349
 
    from = +from || 0;
2350
 
    from = (from > 0 || -1) * Math.floor(Math.abs(from));
2351
 
 
2352
 
    if (from < 0) {
2353
 
        from += len;
2354
 
 
2355
 
        if (from < 0) {
2356
 
            from = 0;
2357
 
        }
2358
 
    }
2359
 
 
2360
 
    for (; from < len; ++from) {
2361
 
        if (from in array && array[from] === value) {
2362
 
            return from;
2363
 
        }
2364
 
    }
2365
 
 
2366
 
    return -1;
2367
 
};
2368
 
 
2369
 
/**
2370
 
Numeric sort convenience function.
2371
 
 
2372
 
The native `Array.prototype.sort()` function converts values to strings and
2373
 
sorts them in lexicographic order, which is unsuitable for sorting numeric
2374
 
values. Provide `Array.numericSort` as a custom sort function when you want
2375
 
to sort values in numeric order.
2376
 
 
2377
 
@example
2378
 
 
2379
 
    [42, 23, 8, 16, 4, 15].sort(Y.Array.numericSort);
2380
 
    // => [4, 8, 15, 16, 23, 42]
2381
 
 
2382
 
@method numericSort
2383
 
@param {Number} a First value to compare.
2384
 
@param {Number} b Second value to compare.
2385
 
@return {Number} Difference between _a_ and _b_.
2386
 
@static
2387
 
**/
2388
 
YArray.numericSort = function (a, b) {
2389
 
    return a - b;
2390
 
};
2391
 
 
2392
 
/**
2393
 
Executes the supplied function on each item in the array. Returning a truthy
2394
 
value from the function will stop the processing of remaining items.
2395
 
 
2396
 
@method some
2397
 
@param {Array} array Array to iterate over.
2398
 
@param {Function} fn Function to execute on each item. The function will receive
2399
 
  the following arguments:
2400
 
    @param {Any} fn.value Current array item.
2401
 
    @param {Number} fn.index Current array index.
2402
 
    @param {Array} fn.array Array being iterated over.
2403
 
@param {Object} [thisObj] `this` object to use when calling _fn_.
2404
 
@return {Boolean} `true` if the function returns a truthy value on any of the
2405
 
  items in the array; `false` otherwise.
2406
 
@static
2407
 
**/
2408
 
YArray.some = Lang._isNative(Native.some) ? function (array, fn, thisObj) {
2409
 
    return Native.some.call(array, fn, thisObj);
2410
 
} : function (array, fn, thisObj) {
2411
 
    for (var i = 0, len = array.length; i < len; ++i) {
2412
 
        if (i in array && fn.call(thisObj, array[i], i, array)) {
2413
 
            return true;
2414
 
        }
2415
 
    }
2416
 
 
2417
 
    return false;
2418
 
};
2419
 
 
2420
 
/**
2421
 
Evaluates _obj_ to determine if it's an array, an array-like collection, or
2422
 
something else. This is useful when working with the function `arguments`
2423
 
collection and `HTMLElement` collections.
2424
 
 
2425
 
Note: This implementation doesn't consider elements that are also
2426
 
collections, such as `<form>` and `<select>`, to be array-like.
2427
 
 
2428
 
@method test
2429
 
@param {Object} obj Object to test.
2430
 
@return {Number} A number indicating the results of the test:
2431
 
 
2432
 
  * 0: Neither an array nor an array-like collection.
2433
 
  * 1: Real array.
2434
 
  * 2: Array-like collection.
2435
 
 
2436
 
@static
2437
 
**/
2438
 
YArray.test = function (obj) {
2439
 
    var result = 0;
2440
 
 
2441
 
    if (Lang.isArray(obj)) {
2442
 
        result = 1;
2443
 
    } else if (Lang.isObject(obj)) {
2444
 
        try {
2445
 
            // indexed, but no tagName (element) or alert (window),
2446
 
            // or functions without apply/call (Safari
2447
 
            // HTMLElementCollection bug).
2448
 
            if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {
2449
 
                result = 2;
2450
 
            }
2451
 
        } catch (ex) {}
2452
 
    }
2453
 
 
2454
 
    return result;
2455
 
};
2456
 
/**
2457
 
 * The YUI module contains the components required for building the YUI
2458
 
 * seed file.  This includes the script loading mechanism, a simple queue,
2459
 
 * and the core utilities for the library.
2460
 
 * @module yui
2461
 
 * @submodule yui-base
2462
 
 */
2463
 
 
2464
 
/**
2465
 
 * A simple FIFO queue.  Items are added to the Queue with add(1..n items) and
2466
 
 * removed using next().
2467
 
 *
2468
 
 * @class Queue
2469
 
 * @constructor
2470
 
 * @param {MIXED} item* 0..n items to seed the queue.
2471
 
 */
2472
 
function Queue() {
2473
 
    this._init();
2474
 
    this.add.apply(this, arguments);
2475
 
}
2476
 
 
2477
 
Queue.prototype = {
2478
 
    /**
2479
 
     * Initialize the queue
2480
 
     *
2481
 
     * @method _init
2482
 
     * @protected
2483
 
     */
2484
 
    _init: function() {
2485
 
        /**
2486
 
         * The collection of enqueued items
2487
 
         *
2488
 
         * @property _q
2489
 
         * @type Array
2490
 
         * @protected
2491
 
         */
2492
 
        this._q = [];
2493
 
    },
2494
 
 
2495
 
    /**
2496
 
     * Get the next item in the queue. FIFO support
2497
 
     *
2498
 
     * @method next
2499
 
     * @return {MIXED} the next item in the queue.
2500
 
     */
2501
 
    next: function() {
2502
 
        return this._q.shift();
2503
 
    },
2504
 
 
2505
 
    /**
2506
 
     * Get the last in the queue. LIFO support.
2507
 
     *
2508
 
     * @method last
2509
 
     * @return {MIXED} the last item in the queue.
2510
 
     */
2511
 
    last: function() {
2512
 
        return this._q.pop();
2513
 
    },
2514
 
 
2515
 
    /**
2516
 
     * Add 0..n items to the end of the queue.
2517
 
     *
2518
 
     * @method add
2519
 
     * @param {MIXED} item* 0..n items.
2520
 
     * @return {object} this queue.
2521
 
     */
2522
 
    add: function() {
2523
 
        this._q.push.apply(this._q, arguments);
2524
 
 
2525
 
        return this;
2526
 
    },
2527
 
 
2528
 
    /**
2529
 
     * Returns the current number of queued items.
2530
 
     *
2531
 
     * @method size
2532
 
     * @return {Number} The size.
2533
 
     */
2534
 
    size: function() {
2535
 
        return this._q.length;
2536
 
    }
2537
 
};
2538
 
 
2539
 
Y.Queue = Queue;
2540
 
 
2541
 
YUI.Env._loaderQueue = YUI.Env._loaderQueue || new Queue();
2542
 
 
2543
 
/**
2544
 
The YUI module contains the components required for building the YUI seed file.
2545
 
This includes the script loading mechanism, a simple queue, and the core
2546
 
utilities for the library.
2547
 
 
2548
 
@module yui
2549
 
@submodule yui-base
2550
 
**/
2551
 
 
2552
 
var CACHED_DELIMITER = '__',
2553
 
 
2554
 
    hasOwn   = Object.prototype.hasOwnProperty,
2555
 
    isObject = Y.Lang.isObject;
2556
 
 
2557
 
/**
2558
 
Returns a wrapper for a function which caches the return value of that function,
2559
 
keyed off of the combined string representation of the argument values provided
2560
 
when the wrapper is called.
2561
 
 
2562
 
Calling this function again with the same arguments will return the cached value
2563
 
rather than executing the wrapped function.
2564
 
 
2565
 
Note that since the cache is keyed off of the string representation of arguments
2566
 
passed to the wrapper function, arguments that aren't strings and don't provide
2567
 
a meaningful `toString()` method may result in unexpected caching behavior. For
2568
 
example, the objects `{}` and `{foo: 'bar'}` would both be converted to the
2569
 
string `[object Object]` when used as a cache key.
2570
 
 
2571
 
@method cached
2572
 
@param {Function} source The function to memoize.
2573
 
@param {Object} [cache={}] Object in which to store cached values. You may seed
2574
 
  this object with pre-existing cached values if desired.
2575
 
@param {any} [refetch] If supplied, this value is compared with the cached value
2576
 
  using a `==` comparison. If the values are equal, the wrapped function is
2577
 
  executed again even though a cached value exists.
2578
 
@return {Function} Wrapped function.
2579
 
@for YUI
2580
 
**/
2581
 
Y.cached = function (source, cache, refetch) {
2582
 
    cache || (cache = {});
2583
 
 
2584
 
    return function (arg) {
2585
 
        var key = arguments.length > 1 ?
2586
 
                Array.prototype.join.call(arguments, CACHED_DELIMITER) :
2587
 
                String(arg);
2588
 
 
2589
 
        if (!(key in cache) || (refetch && cache[key] == refetch)) {
2590
 
            cache[key] = source.apply(source, arguments);
2591
 
        }
2592
 
 
2593
 
        return cache[key];
2594
 
    };
2595
 
};
2596
 
 
2597
 
/**
2598
 
Returns the `location` object from the window/frame in which this YUI instance
2599
 
operates, or `undefined` when executing in a non-browser environment
2600
 
(e.g. Node.js).
2601
 
 
2602
 
It is _not_ recommended to hold references to the `window.location` object
2603
 
outside of the scope of a function in which its properties are being accessed or
2604
 
its methods are being called. This is because of a nasty bug/issue that exists
2605
 
in both Safari and MobileSafari browsers:
2606
 
[WebKit Bug 34679](https://bugs.webkit.org/show_bug.cgi?id=34679).
2607
 
 
2608
 
@method getLocation
2609
 
@return {location} The `location` object from the window/frame in which this YUI
2610
 
    instance operates.
2611
 
@since 3.5.0
2612
 
**/
2613
 
Y.getLocation = function () {
2614
 
    // It is safer to look this up every time because yui-base is attached to a
2615
 
    // YUI instance before a user's config is applied; i.e. `Y.config.win` does
2616
 
    // not point the correct window object when this file is loaded.
2617
 
    var win = Y.config.win;
2618
 
 
2619
 
    // It is not safe to hold a reference to the `location` object outside the
2620
 
    // scope in which it is being used. The WebKit engine used in Safari and
2621
 
    // MobileSafari will "disconnect" the `location` object from the `window`
2622
 
    // when a page is restored from back/forward history cache.
2623
 
    return win && win.location;
2624
 
};
2625
 
 
2626
 
/**
2627
 
Returns a new object containing all of the properties of all the supplied
2628
 
objects. The properties from later objects will overwrite those in earlier
2629
 
objects.
2630
 
 
2631
 
Passing in a single object will create a shallow copy of it. For a deep copy,
2632
 
use `clone()`.
2633
 
 
2634
 
@method merge
2635
 
@param {Object} objects* One or more objects to merge.
2636
 
@return {Object} A new merged object.
2637
 
**/
2638
 
Y.merge = function () {
2639
 
    var args   = arguments,
2640
 
        i      = 0,
2641
 
        len    = args.length,
2642
 
        result = {};
2643
 
 
2644
 
    for (; i < len; ++i) {
2645
 
        Y.mix(result, args[i], true);
2646
 
    }
2647
 
 
2648
 
    return result;
2649
 
};
2650
 
 
2651
 
/**
2652
 
Mixes _supplier_'s properties into _receiver_.
2653
 
 
2654
 
Properties on _receiver_ or _receiver_'s prototype will not be overwritten or
2655
 
shadowed unless the _overwrite_ parameter is `true`, and will not be merged
2656
 
unless the _merge_ parameter is `true`.
2657
 
 
2658
 
In the default mode (0), only properties the supplier owns are copied (prototype
2659
 
properties are not copied). The following copying modes are available:
2660
 
 
2661
 
  * `0`: _Default_. Object to object.
2662
 
  * `1`: Prototype to prototype.
2663
 
  * `2`: Prototype to prototype and object to object.
2664
 
  * `3`: Prototype to object.
2665
 
  * `4`: Object to prototype.
2666
 
 
2667
 
@method mix
2668
 
@param {Function|Object} receiver The object or function to receive the mixed
2669
 
  properties.
2670
 
@param {Function|Object} supplier The object or function supplying the
2671
 
  properties to be mixed.
2672
 
@param {Boolean} [overwrite=false] If `true`, properties that already exist
2673
 
  on the receiver will be overwritten with properties from the supplier.
2674
 
@param {String[]} [whitelist] An array of property names to copy. If
2675
 
  specified, only the whitelisted properties will be copied, and all others
2676
 
  will be ignored.
2677
 
@param {Number} [mode=0] Mix mode to use. See above for available modes.
2678
 
@param {Boolean} [merge=false] If `true`, objects and arrays that already
2679
 
  exist on the receiver will have the corresponding object/array from the
2680
 
  supplier merged into them, rather than being skipped or overwritten. When
2681
 
  both _overwrite_ and _merge_ are `true`, _merge_ takes precedence.
2682
 
@return {Function|Object|YUI} The receiver, or the YUI instance if the
2683
 
  specified receiver is falsy.
2684
 
**/
2685
 
Y.mix = function(receiver, supplier, overwrite, whitelist, mode, merge) {
2686
 
    var alwaysOverwrite, exists, from, i, key, len, to;
2687
 
 
2688
 
    // If no supplier is given, we return the receiver. If no receiver is given,
2689
 
    // we return Y. Returning Y doesn't make much sense to me, but it's
2690
 
    // grandfathered in for backcompat reasons.
2691
 
    if (!receiver || !supplier) {
2692
 
        return receiver || Y;
2693
 
    }
2694
 
 
2695
 
    if (mode) {
2696
 
        // In mode 2 (prototype to prototype and object to object), we recurse
2697
 
        // once to do the proto to proto mix. The object to object mix will be
2698
 
        // handled later on.
2699
 
        if (mode === 2) {
2700
 
            Y.mix(receiver.prototype, supplier.prototype, overwrite,
2701
 
                    whitelist, 0, merge);
2702
 
        }
2703
 
 
2704
 
        // Depending on which mode is specified, we may be copying from or to
2705
 
        // the prototypes of the supplier and receiver.
2706
 
        from = mode === 1 || mode === 3 ? supplier.prototype : supplier;
2707
 
        to   = mode === 1 || mode === 4 ? receiver.prototype : receiver;
2708
 
 
2709
 
        // If either the supplier or receiver doesn't actually have a
2710
 
        // prototype property, then we could end up with an undefined `from`
2711
 
        // or `to`. If that happens, we abort and return the receiver.
2712
 
        if (!from || !to) {
2713
 
            return receiver;
2714
 
        }
2715
 
    } else {
2716
 
        from = supplier;
2717
 
        to   = receiver;
2718
 
    }
2719
 
 
2720
 
    // If `overwrite` is truthy and `merge` is falsy, then we can skip a
2721
 
    // property existence check on each iteration and save some time.
2722
 
    alwaysOverwrite = overwrite && !merge;
2723
 
 
2724
 
    if (whitelist) {
2725
 
        for (i = 0, len = whitelist.length; i < len; ++i) {
2726
 
            key = whitelist[i];
2727
 
 
2728
 
            // We call `Object.prototype.hasOwnProperty` instead of calling
2729
 
            // `hasOwnProperty` on the object itself, since the object's
2730
 
            // `hasOwnProperty` method may have been overridden or removed.
2731
 
            // Also, some native objects don't implement a `hasOwnProperty`
2732
 
            // method.
2733
 
            if (!hasOwn.call(from, key)) {
2734
 
                continue;
2735
 
            }
2736
 
 
2737
 
            // The `key in to` check here is (sadly) intentional for backwards
2738
 
            // compatibility reasons. It prevents undesired shadowing of
2739
 
            // prototype members on `to`.
2740
 
            exists = alwaysOverwrite ? false : key in to;
2741
 
 
2742
 
            if (merge && exists && isObject(to[key], true)
2743
 
                    && isObject(from[key], true)) {
2744
 
                // If we're in merge mode, and the key is present on both
2745
 
                // objects, and the value on both objects is either an object or
2746
 
                // an array (but not a function), then we recurse to merge the
2747
 
                // `from` value into the `to` value instead of overwriting it.
2748
 
                //
2749
 
                // Note: It's intentional that the whitelist isn't passed to the
2750
 
                // recursive call here. This is legacy behavior that lots of
2751
 
                // code still depends on.
2752
 
                Y.mix(to[key], from[key], overwrite, null, 0, merge);
2753
 
            } else if (overwrite || !exists) {
2754
 
                // We're not in merge mode, so we'll only copy the `from` value
2755
 
                // to the `to` value if we're in overwrite mode or if the
2756
 
                // current key doesn't exist on the `to` object.
2757
 
                to[key] = from[key];
2758
 
            }
2759
 
        }
2760
 
    } else {
2761
 
        for (key in from) {
2762
 
            // The code duplication here is for runtime performance reasons.
2763
 
            // Combining whitelist and non-whitelist operations into a single
2764
 
            // loop or breaking the shared logic out into a function both result
2765
 
            // in worse performance, and Y.mix is critical enough that the byte
2766
 
            // tradeoff is worth it.
2767
 
            if (!hasOwn.call(from, key)) {
2768
 
                continue;
2769
 
            }
2770
 
 
2771
 
            // The `key in to` check here is (sadly) intentional for backwards
2772
 
            // compatibility reasons. It prevents undesired shadowing of
2773
 
            // prototype members on `to`.
2774
 
            exists = alwaysOverwrite ? false : key in to;
2775
 
 
2776
 
            if (merge && exists && isObject(to[key], true)
2777
 
                    && isObject(from[key], true)) {
2778
 
                Y.mix(to[key], from[key], overwrite, null, 0, merge);
2779
 
            } else if (overwrite || !exists) {
2780
 
                to[key] = from[key];
2781
 
            }
2782
 
        }
2783
 
 
2784
 
        // If this is an IE browser with the JScript enumeration bug, force
2785
 
        // enumeration of the buggy properties by making a recursive call with
2786
 
        // the buggy properties as the whitelist.
2787
 
        if (Y.Object._hasEnumBug) {
2788
 
            Y.mix(to, from, overwrite, Y.Object._forceEnum, mode, merge);
2789
 
        }
2790
 
    }
2791
 
 
2792
 
    return receiver;
2793
 
};
2794
 
/**
2795
 
 * The YUI module contains the components required for building the YUI
2796
 
 * seed file.  This includes the script loading mechanism, a simple queue,
2797
 
 * and the core utilities for the library.
2798
 
 * @module yui
2799
 
 * @submodule yui-base
2800
 
 */
2801
 
 
2802
 
/**
2803
 
 * Adds utilities to the YUI instance for working with objects.
2804
 
 *
2805
 
 * @class Object
2806
 
 */
2807
 
 
2808
 
var Lang   = Y.Lang,
2809
 
    hasOwn = Object.prototype.hasOwnProperty,
2810
 
 
2811
 
    UNDEFINED, // <-- Note the comma. We're still declaring vars.
2812
 
 
2813
 
/**
2814
 
 * Returns a new object that uses _obj_ as its prototype. This method wraps the
2815
 
 * native ES5 `Object.create()` method if available, but doesn't currently
2816
 
 * pass through `Object.create()`'s second argument (properties) in order to
2817
 
 * ensure compatibility with older browsers.
2818
 
 *
2819
 
 * @method ()
2820
 
 * @param {Object} obj Prototype object.
2821
 
 * @return {Object} New object using _obj_ as its prototype.
2822
 
 * @static
2823
 
 */
2824
 
O = Y.Object = Lang._isNative(Object.create) ? function (obj) {
2825
 
    // We currently wrap the native Object.create instead of simply aliasing it
2826
 
    // to ensure consistency with our fallback shim, which currently doesn't
2827
 
    // support Object.create()'s second argument (properties). Once we have a
2828
 
    // safe fallback for the properties arg, we can stop wrapping
2829
 
    // Object.create().
2830
 
    return Object.create(obj);
2831
 
} : (function () {
2832
 
    // Reusable constructor function for the Object.create() shim.
2833
 
    function F() {}
2834
 
 
2835
 
    // The actual shim.
2836
 
    return function (obj) {
2837
 
        F.prototype = obj;
2838
 
        return new F();
2839
 
    };
2840
 
}()),
2841
 
 
2842
 
/**
2843
 
 * Property names that IE doesn't enumerate in for..in loops, even when they
2844
 
 * should be enumerable. When `_hasEnumBug` is `true`, it's necessary to
2845
 
 * manually enumerate these properties.
2846
 
 *
2847
 
 * @property _forceEnum
2848
 
 * @type String[]
2849
 
 * @protected
2850
 
 * @static
2851
 
 */
2852
 
forceEnum = O._forceEnum = [
2853
 
    'hasOwnProperty',
2854
 
    'isPrototypeOf',
2855
 
    'propertyIsEnumerable',
2856
 
    'toString',
2857
 
    'toLocaleString',
2858
 
    'valueOf'
2859
 
],
2860
 
 
2861
 
/**
2862
 
 * `true` if this browser has the JScript enumeration bug that prevents
2863
 
 * enumeration of the properties named in the `_forceEnum` array, `false`
2864
 
 * otherwise.
2865
 
 *
2866
 
 * See:
2867
 
 *   - <https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug>
2868
 
 *   - <http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation>
2869
 
 *
2870
 
 * @property _hasEnumBug
2871
 
 * @type Boolean
2872
 
 * @protected
2873
 
 * @static
2874
 
 */
2875
 
hasEnumBug = O._hasEnumBug = !{valueOf: 0}.propertyIsEnumerable('valueOf'),
2876
 
 
2877
 
/**
2878
 
 * `true` if this browser incorrectly considers the `prototype` property of
2879
 
 * functions to be enumerable. Currently known to affect Opera 11.50.
2880
 
 *
2881
 
 * @property _hasProtoEnumBug
2882
 
 * @type Boolean
2883
 
 * @protected
2884
 
 * @static
2885
 
 */
2886
 
hasProtoEnumBug = O._hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype'),
2887
 
 
2888
 
/**
2889
 
 * Returns `true` if _key_ exists on _obj_, `false` if _key_ doesn't exist or
2890
 
 * exists only on _obj_'s prototype. This is essentially a safer version of
2891
 
 * `obj.hasOwnProperty()`.
2892
 
 *
2893
 
 * @method owns
2894
 
 * @param {Object} obj Object to test.
2895
 
 * @param {String} key Property name to look for.
2896
 
 * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise.
2897
 
 * @static
2898
 
 */
2899
 
owns = O.owns = function (obj, key) {
2900
 
    return !!obj && hasOwn.call(obj, key);
2901
 
}; // <-- End of var declarations.
2902
 
 
2903
 
/**
2904
 
 * Alias for `owns()`.
2905
 
 *
2906
 
 * @method hasKey
2907
 
 * @param {Object} obj Object to test.
2908
 
 * @param {String} key Property name to look for.
2909
 
 * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise.
2910
 
 * @static
2911
 
 */
2912
 
O.hasKey = owns;
2913
 
 
2914
 
/**
2915
 
 * Returns an array containing the object's enumerable keys. Does not include
2916
 
 * prototype keys or non-enumerable keys.
2917
 
 *
2918
 
 * Note that keys are returned in enumeration order (that is, in the same order
2919
 
 * that they would be enumerated by a `for-in` loop), which may not be the same
2920
 
 * as the order in which they were defined.
2921
 
 *
2922
 
 * This method is an alias for the native ES5 `Object.keys()` method if
2923
 
 * available.
2924
 
 *
2925
 
 * @example
2926
 
 *
2927
 
 *     Y.Object.keys({a: 'foo', b: 'bar', c: 'baz'});
2928
 
 *     // => ['a', 'b', 'c']
2929
 
 *
2930
 
 * @method keys
2931
 
 * @param {Object} obj An object.
2932
 
 * @return {String[]} Array of keys.
2933
 
 * @static
2934
 
 */
2935
 
O.keys = Lang._isNative(Object.keys) ? Object.keys : function (obj) {
2936
 
    if (!Lang.isObject(obj)) {
2937
 
        throw new TypeError('Object.keys called on a non-object');
2938
 
    }
2939
 
 
2940
 
    var keys = [],
2941
 
        i, key, len;
2942
 
 
2943
 
    if (hasProtoEnumBug && typeof obj === 'function') {
2944
 
        for (key in obj) {
2945
 
            if (owns(obj, key) && key !== 'prototype') {
2946
 
                keys.push(key);
2947
 
            }
2948
 
        }
2949
 
    } else {
2950
 
        for (key in obj) {
2951
 
            if (owns(obj, key)) {
2952
 
                keys.push(key);
2953
 
            }
2954
 
        }
2955
 
    }
2956
 
 
2957
 
    if (hasEnumBug) {
2958
 
        for (i = 0, len = forceEnum.length; i < len; ++i) {
2959
 
            key = forceEnum[i];
2960
 
 
2961
 
            if (owns(obj, key)) {
2962
 
                keys.push(key);
2963
 
            }
2964
 
        }
2965
 
    }
2966
 
 
2967
 
    return keys;
2968
 
};
2969
 
 
2970
 
/**
2971
 
 * Returns an array containing the values of the object's enumerable keys.
2972
 
 *
2973
 
 * Note that values are returned in enumeration order (that is, in the same
2974
 
 * order that they would be enumerated by a `for-in` loop), which may not be the
2975
 
 * same as the order in which they were defined.
2976
 
 *
2977
 
 * @example
2978
 
 *
2979
 
 *     Y.Object.values({a: 'foo', b: 'bar', c: 'baz'});
2980
 
 *     // => ['foo', 'bar', 'baz']
2981
 
 *
2982
 
 * @method values
2983
 
 * @param {Object} obj An object.
2984
 
 * @return {Array} Array of values.
2985
 
 * @static
2986
 
 */
2987
 
O.values = function (obj) {
2988
 
    var keys   = O.keys(obj),
2989
 
        i      = 0,
2990
 
        len    = keys.length,
2991
 
        values = [];
2992
 
 
2993
 
    for (; i < len; ++i) {
2994
 
        values.push(obj[keys[i]]);
2995
 
    }
2996
 
 
2997
 
    return values;
2998
 
};
2999
 
 
3000
 
/**
3001
 
 * Returns the number of enumerable keys owned by an object.
3002
 
 *
3003
 
 * @method size
3004
 
 * @param {Object} obj An object.
3005
 
 * @return {Number} The object's size.
3006
 
 * @static
3007
 
 */
3008
 
O.size = function (obj) {
3009
 
    try {
3010
 
        return O.keys(obj).length;
3011
 
    } catch (ex) {
3012
 
        return 0; // Legacy behavior for non-objects.
3013
 
    }
3014
 
};
3015
 
 
3016
 
/**
3017
 
 * Returns `true` if the object owns an enumerable property with the specified
3018
 
 * value.
3019
 
 *
3020
 
 * @method hasValue
3021
 
 * @param {Object} obj An object.
3022
 
 * @param {any} value The value to search for.
3023
 
 * @return {Boolean} `true` if _obj_ contains _value_, `false` otherwise.
3024
 
 * @static
3025
 
 */
3026
 
O.hasValue = function (obj, value) {
3027
 
    return Y.Array.indexOf(O.values(obj), value) > -1;
3028
 
};
3029
 
 
3030
 
/**
3031
 
 * Executes a function on each enumerable property in _obj_. The function
3032
 
 * receives the value, the key, and the object itself as parameters (in that
3033
 
 * order).
3034
 
 *
3035
 
 * By default, only properties owned by _obj_ are enumerated. To include
3036
 
 * prototype properties, set the _proto_ parameter to `true`.
3037
 
 *
3038
 
 * @method each
3039
 
 * @param {Object} obj Object to enumerate.
3040
 
 * @param {Function} fn Function to execute on each enumerable property.
3041
 
 *   @param {mixed} fn.value Value of the current property.
3042
 
 *   @param {String} fn.key Key of the current property.
3043
 
 *   @param {Object} fn.obj Object being enumerated.
3044
 
 * @param {Object} [thisObj] `this` object to use when calling _fn_.
3045
 
 * @param {Boolean} [proto=false] Include prototype properties.
3046
 
 * @return {YUI} the YUI instance.
3047
 
 * @chainable
3048
 
 * @static
3049
 
 */
3050
 
O.each = function (obj, fn, thisObj, proto) {
3051
 
    var key;
3052
 
 
3053
 
    for (key in obj) {
3054
 
        if (proto || owns(obj, key)) {
3055
 
            fn.call(thisObj || Y, obj[key], key, obj);
3056
 
        }
3057
 
    }
3058
 
 
3059
 
    return Y;
3060
 
};
3061
 
 
3062
 
/**
3063
 
 * Executes a function on each enumerable property in _obj_, but halts if the
3064
 
 * function returns a truthy value. The function receives the value, the key,
3065
 
 * and the object itself as paramters (in that order).
3066
 
 *
3067
 
 * By default, only properties owned by _obj_ are enumerated. To include
3068
 
 * prototype properties, set the _proto_ parameter to `true`.
3069
 
 *
3070
 
 * @method some
3071
 
 * @param {Object} obj Object to enumerate.
3072
 
 * @param {Function} fn Function to execute on each enumerable property.
3073
 
 *   @param {mixed} fn.value Value of the current property.
3074
 
 *   @param {String} fn.key Key of the current property.
3075
 
 *   @param {Object} fn.obj Object being enumerated.
3076
 
 * @param {Object} [thisObj] `this` object to use when calling _fn_.
3077
 
 * @param {Boolean} [proto=false] Include prototype properties.
3078
 
 * @return {Boolean} `true` if any execution of _fn_ returns a truthy value,
3079
 
 *   `false` otherwise.
3080
 
 * @static
3081
 
 */
3082
 
O.some = function (obj, fn, thisObj, proto) {
3083
 
    var key;
3084
 
 
3085
 
    for (key in obj) {
3086
 
        if (proto || owns(obj, key)) {
3087
 
            if (fn.call(thisObj || Y, obj[key], key, obj)) {
3088
 
                return true;
3089
 
            }
3090
 
        }
3091
 
    }
3092
 
 
3093
 
    return false;
3094
 
};
3095
 
 
3096
 
/**
3097
 
 * Retrieves the sub value at the provided path,
3098
 
 * from the value object provided.
3099
 
 *
3100
 
 * @method getValue
3101
 
 * @static
3102
 
 * @param o The object from which to extract the property value.
3103
 
 * @param path {Array} A path array, specifying the object traversal path
3104
 
 * from which to obtain the sub value.
3105
 
 * @return {Any} The value stored in the path, undefined if not found,
3106
 
 * undefined if the source is not an object.  Returns the source object
3107
 
 * if an empty path is provided.
3108
 
 */
3109
 
O.getValue = function(o, path) {
3110
 
    if (!Lang.isObject(o)) {
3111
 
        return UNDEFINED;
3112
 
    }
3113
 
 
3114
 
    var i,
3115
 
        p = Y.Array(path),
3116
 
        l = p.length;
3117
 
 
3118
 
    for (i = 0; o !== UNDEFINED && i < l; i++) {
3119
 
        o = o[p[i]];
3120
 
    }
3121
 
 
3122
 
    return o;
3123
 
};
3124
 
 
3125
 
/**
3126
 
 * Sets the sub-attribute value at the provided path on the
3127
 
 * value object.  Returns the modified value object, or
3128
 
 * undefined if the path is invalid.
3129
 
 *
3130
 
 * @method setValue
3131
 
 * @static
3132
 
 * @param o             The object on which to set the sub value.
3133
 
 * @param path {Array}  A path array, specifying the object traversal path
3134
 
 *                      at which to set the sub value.
3135
 
 * @param val {Any}     The new value for the sub-attribute.
3136
 
 * @return {Object}     The modified object, with the new sub value set, or
3137
 
 *                      undefined, if the path was invalid.
3138
 
 */
3139
 
O.setValue = function(o, path, val) {
3140
 
    var i,
3141
 
        p = Y.Array(path),
3142
 
        leafIdx = p.length - 1,
3143
 
        ref = o;
3144
 
 
3145
 
    if (leafIdx >= 0) {
3146
 
        for (i = 0; ref !== UNDEFINED && i < leafIdx; i++) {
3147
 
            ref = ref[p[i]];
3148
 
        }
3149
 
 
3150
 
        if (ref !== UNDEFINED) {
3151
 
            ref[p[i]] = val;
3152
 
        } else {
3153
 
            return UNDEFINED;
3154
 
        }
3155
 
    }
3156
 
 
3157
 
    return o;
3158
 
};
3159
 
 
3160
 
/**
3161
 
 * Returns `true` if the object has no enumerable properties of its own.
3162
 
 *
3163
 
 * @method isEmpty
3164
 
 * @param {Object} obj An object.
3165
 
 * @return {Boolean} `true` if the object is empty.
3166
 
 * @static
3167
 
 * @since 3.2.0
3168
 
 */
3169
 
O.isEmpty = function (obj) {
3170
 
    return !O.keys(Object(obj)).length;
3171
 
};
3172
 
/**
3173
 
 * The YUI module contains the components required for building the YUI seed
3174
 
 * file.  This includes the script loading mechanism, a simple queue, and the
3175
 
 * core utilities for the library.
3176
 
 * @module yui
3177
 
 * @submodule yui-base
3178
 
 */
3179
 
 
3180
 
/**
3181
 
 * YUI user agent detection.
3182
 
 * Do not fork for a browser if it can be avoided.  Use feature detection when
3183
 
 * you can.  Use the user agent as a last resort.  For all fields listed
3184
 
 * as @type float, UA stores a version number for the browser engine,
3185
 
 * 0 otherwise.  This value may or may not map to the version number of
3186
 
 * the browser using the engine.  The value is presented as a float so
3187
 
 * that it can easily be used for boolean evaluation as well as for
3188
 
 * looking for a particular range of versions.  Because of this,
3189
 
 * some of the granularity of the version info may be lost.  The fields that
3190
 
 * are @type string default to null.  The API docs list the values that
3191
 
 * these fields can have.
3192
 
 * @class UA
3193
 
 * @static
3194
 
 */
3195
 
 
3196
 
/**
3197
 
* Static method on `YUI.Env` for parsing a UA string.  Called at instantiation
3198
 
* to populate `Y.UA`.
3199
 
*
3200
 
* @static
3201
 
* @method parseUA
3202
 
* @param {String} [subUA=navigator.userAgent] UA string to parse
3203
 
* @return {Object} The Y.UA object
3204
 
*/
3205
 
YUI.Env.parseUA = function(subUA) {
3206
 
 
3207
 
    var numberify = function(s) {
3208
 
            var c = 0;
3209
 
            return parseFloat(s.replace(/\./g, function() {
3210
 
                return (c++ == 1) ? '' : '.';
3211
 
            }));
3212
 
        },
3213
 
 
3214
 
        win = Y.config.win,
3215
 
 
3216
 
        nav = win && win.navigator,
3217
 
 
3218
 
        o = {
3219
 
 
3220
 
        /**
3221
 
         * Internet Explorer version number or 0.  Example: 6
3222
 
         * @property ie
3223
 
         * @type float
3224
 
         * @static
3225
 
         */
3226
 
        ie: 0,
3227
 
 
3228
 
        /**
3229
 
         * Opera version number or 0.  Example: 9.2
3230
 
         * @property opera
3231
 
         * @type float
3232
 
         * @static
3233
 
         */
3234
 
        opera: 0,
3235
 
 
3236
 
        /**
3237
 
         * Gecko engine revision number.  Will evaluate to 1 if Gecko
3238
 
         * is detected but the revision could not be found. Other browsers
3239
 
         * will be 0.  Example: 1.8
3240
 
         * <pre>
3241
 
         * Firefox 1.0.0.4: 1.7.8   <-- Reports 1.7
3242
 
         * Firefox 1.5.0.9: 1.8.0.9 <-- 1.8
3243
 
         * Firefox 2.0.0.3: 1.8.1.3 <-- 1.81
3244
 
         * Firefox 3.0   <-- 1.9
3245
 
         * Firefox 3.5   <-- 1.91
3246
 
         * </pre>
3247
 
         * @property gecko
3248
 
         * @type float
3249
 
         * @static
3250
 
         */
3251
 
        gecko: 0,
3252
 
 
3253
 
        /**
3254
 
         * AppleWebKit version.  KHTML browsers that are not WebKit browsers
3255
 
         * will evaluate to 1, other browsers 0.  Example: 418.9
3256
 
         * <pre>
3257
 
         * Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the
3258
 
         *                                   latest available for Mac OSX 10.3.
3259
 
         * Safari 2.0.2:         416     <-- hasOwnProperty introduced
3260
 
         * Safari 2.0.4:         418     <-- preventDefault fixed
3261
 
         * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run
3262
 
         *                                   different versions of webkit
3263
 
         * Safari 2.0.4 (419.3): 419     <-- Tiger installations that have been
3264
 
         *                                   updated, but not updated
3265
 
         *                                   to the latest patch.
3266
 
         * Webkit 212 nightly:   522+    <-- Safari 3.0 precursor (with native
3267
 
         * SVG and many major issues fixed).
3268
 
         * Safari 3.0.4 (523.12) 523.12  <-- First Tiger release - automatic
3269
 
         * update from 2.x via the 10.4.11 OS patch.
3270
 
         * Webkit nightly 1/2008:525+    <-- Supports DOMContentLoaded event.
3271
 
         *                                   yahoo.com user agent hack removed.
3272
 
         * </pre>
3273
 
         * http://en.wikipedia.org/wiki/Safari_version_history
3274
 
         * @property webkit
3275
 
         * @type float
3276
 
         * @static
3277
 
         */
3278
 
        webkit: 0,
3279
 
 
3280
 
        /**
3281
 
         * Safari will be detected as webkit, but this property will also
3282
 
         * be populated with the Safari version number
3283
 
         * @property safari
3284
 
         * @type float
3285
 
         * @static
3286
 
         */
3287
 
        safari: 0,
3288
 
 
3289
 
        /**
3290
 
         * Chrome will be detected as webkit, but this property will also
3291
 
         * be populated with the Chrome version number
3292
 
         * @property chrome
3293
 
         * @type float
3294
 
         * @static
3295
 
         */
3296
 
        chrome: 0,
3297
 
 
3298
 
        /**
3299
 
         * The mobile property will be set to a string containing any relevant
3300
 
         * user agent information when a modern mobile browser is detected.
3301
 
         * Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series
3302
 
         * devices with the WebKit-based browser, and Opera Mini.
3303
 
         * @property mobile
3304
 
         * @type string
3305
 
         * @default null
3306
 
         * @static
3307
 
         */
3308
 
        mobile: null,
3309
 
 
3310
 
        /**
3311
 
         * Adobe AIR version number or 0.  Only populated if webkit is detected.
3312
 
         * Example: 1.0
3313
 
         * @property air
3314
 
         * @type float
3315
 
         */
3316
 
        air: 0,
3317
 
        /**
3318
 
         * Detects Apple iPad's OS version
3319
 
         * @property ipad
3320
 
         * @type float
3321
 
         * @static
3322
 
         */
3323
 
        ipad: 0,
3324
 
        /**
3325
 
         * Detects Apple iPhone's OS version
3326
 
         * @property iphone
3327
 
         * @type float
3328
 
         * @static
3329
 
         */
3330
 
        iphone: 0,
3331
 
        /**
3332
 
         * Detects Apples iPod's OS version
3333
 
         * @property ipod
3334
 
         * @type float
3335
 
         * @static
3336
 
         */
3337
 
        ipod: 0,
3338
 
        /**
3339
 
         * General truthy check for iPad, iPhone or iPod
3340
 
         * @property ios
3341
 
         * @type float
3342
 
         * @default null
3343
 
         * @static
3344
 
         */
3345
 
        ios: null,
3346
 
        /**
3347
 
         * Detects Googles Android OS version
3348
 
         * @property android
3349
 
         * @type float
3350
 
         * @static
3351
 
         */
3352
 
        android: 0,
3353
 
        /**
3354
 
         * Detects Kindle Silk
3355
 
         * @property silk
3356
 
         * @type float
3357
 
         * @static
3358
 
         */
3359
 
        silk: 0,
3360
 
        /**
3361
 
         * Detects Kindle Silk Acceleration
3362
 
         * @property accel
3363
 
         * @type Boolean
3364
 
         * @static
3365
 
         */
3366
 
        accel: false,
3367
 
        /**
3368
 
         * Detects Palms WebOS version
3369
 
         * @property webos
3370
 
         * @type float
3371
 
         * @static
3372
 
         */
3373
 
        webos: 0,
3374
 
 
3375
 
        /**
3376
 
         * Google Caja version number or 0.
3377
 
         * @property caja
3378
 
         * @type float
3379
 
         */
3380
 
        caja: nav && nav.cajaVersion,
3381
 
 
3382
 
        /**
3383
 
         * Set to true if the page appears to be in SSL
3384
 
         * @property secure
3385
 
         * @type boolean
3386
 
         * @static
3387
 
         */
3388
 
        secure: false,
3389
 
 
3390
 
        /**
3391
 
         * The operating system.  Currently only detecting windows or macintosh
3392
 
         * @property os
3393
 
         * @type string
3394
 
         * @default null
3395
 
         * @static
3396
 
         */
3397
 
        os: null,
3398
 
 
3399
 
        /**
3400
 
         * The Nodejs Version
3401
 
         * @property nodejs
3402
 
         * @type float
3403
 
         * @default 0
3404
 
         * @static
3405
 
         */
3406
 
        nodejs: 0
3407
 
    },
3408
 
 
3409
 
    ua = subUA || nav && nav.userAgent,
3410
 
 
3411
 
    loc = win && win.location,
3412
 
 
3413
 
    href = loc && loc.href,
3414
 
 
3415
 
    m;
3416
 
 
3417
 
    /**
3418
 
    * The User Agent string that was parsed
3419
 
    * @property userAgent
3420
 
    * @type String
3421
 
    * @static
3422
 
    */
3423
 
    o.userAgent = ua;
3424
 
 
3425
 
 
3426
 
    o.secure = href && (href.toLowerCase().indexOf('https') === 0);
3427
 
 
3428
 
    if (ua) {
3429
 
 
3430
 
        if ((/windows|win32/i).test(ua)) {
3431
 
            o.os = 'windows';
3432
 
        } else if ((/macintosh|mac_powerpc/i).test(ua)) {
3433
 
            o.os = 'macintosh';
3434
 
        } else if ((/android/i).test(ua)) {
3435
 
            o.os = 'android';
3436
 
        } else if ((/symbos/i).test(ua)) {
3437
 
            o.os = 'symbos';
3438
 
        } else if ((/linux/i).test(ua)) {
3439
 
            o.os = 'linux';
3440
 
        } else if ((/rhino/i).test(ua)) {
3441
 
            o.os = 'rhino';
3442
 
        }
3443
 
 
3444
 
        // Modern KHTML browsers should qualify as Safari X-Grade
3445
 
        if ((/KHTML/).test(ua)) {
3446
 
            o.webkit = 1;
3447
 
        }
3448
 
        if ((/IEMobile|XBLWP7/).test(ua)) {
3449
 
            o.mobile = 'windows';
3450
 
        }
3451
 
        if ((/Fennec/).test(ua)) {
3452
 
            o.mobile = 'gecko';
3453
 
        }
3454
 
        // Modern WebKit browsers are at least X-Grade
3455
 
        m = ua.match(/AppleWebKit\/([^\s]*)/);
3456
 
        if (m && m[1]) {
3457
 
            o.webkit = numberify(m[1]);
3458
 
            o.safari = o.webkit;
3459
 
 
3460
 
            // Mobile browser check
3461
 
            if (/ Mobile\//.test(ua) || (/iPad|iPod|iPhone/).test(ua)) {
3462
 
                o.mobile = 'Apple'; // iPhone or iPod Touch
3463
 
 
3464
 
                m = ua.match(/OS ([^\s]*)/);
3465
 
                if (m && m[1]) {
3466
 
                    m = numberify(m[1].replace('_', '.'));
3467
 
                }
3468
 
                o.ios = m;
3469
 
                o.os = 'ios';
3470
 
                o.ipad = o.ipod = o.iphone = 0;
3471
 
 
3472
 
                m = ua.match(/iPad|iPod|iPhone/);
3473
 
                if (m && m[0]) {
3474
 
                    o[m[0].toLowerCase()] = o.ios;
3475
 
                }
3476
 
            } else {
3477
 
                m = ua.match(/NokiaN[^\/]*|webOS\/\d\.\d/);
3478
 
                if (m) {
3479
 
                    // Nokia N-series, webOS, ex: NokiaN95
3480
 
                    o.mobile = m[0];
3481
 
                }
3482
 
                if (/webOS/.test(ua)) {
3483
 
                    o.mobile = 'WebOS';
3484
 
                    m = ua.match(/webOS\/([^\s]*);/);
3485
 
                    if (m && m[1]) {
3486
 
                        o.webos = numberify(m[1]);
3487
 
                    }
3488
 
                }
3489
 
                if (/ Android/.test(ua)) {
3490
 
                    if (/Mobile/.test(ua)) {
3491
 
                        o.mobile = 'Android';
3492
 
                    }
3493
 
                    m = ua.match(/Android ([^\s]*);/);
3494
 
                    if (m && m[1]) {
3495
 
                        o.android = numberify(m[1]);
3496
 
                    }
3497
 
 
3498
 
                }
3499
 
                if (/Silk/.test(ua)) {
3500
 
                    m = ua.match(/Silk\/([^\s]*)\)/);
3501
 
                    if (m && m[1]) {
3502
 
                        o.silk = numberify(m[1]);
3503
 
                    }
3504
 
                    if (!o.android) {
3505
 
                        o.android = 2.34; //Hack for desktop mode in Kindle
3506
 
                        o.os = 'Android';
3507
 
                    }
3508
 
                    if (/Accelerated=true/.test(ua)) {
3509
 
                        o.accel = true;
3510
 
                    }
3511
 
                }
3512
 
            }
3513
 
            
3514
 
            m = ua.match(/(Chrome|CrMo)\/([^\s]*)/);
3515
 
            if (m && m[1] && m[2]) {
3516
 
                o.chrome = numberify(m[2]); // Chrome
3517
 
                o.safari = 0; //Reset safari back to 0
3518
 
                if (m[1] === 'CrMo') {
3519
 
                    o.mobile = 'chrome';
3520
 
                }
3521
 
            } else {
3522
 
                m = ua.match(/AdobeAIR\/([^\s]*)/);
3523
 
                if (m) {
3524
 
                    o.air = m[0]; // Adobe AIR 1.0 or better
3525
 
                }
3526
 
            }
3527
 
        }
3528
 
 
3529
 
        if (!o.webkit) { // not webkit
3530
 
// @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)
3531
 
            if (/Opera/.test(ua)) {
3532
 
                m = ua.match(/Opera[\s\/]([^\s]*)/);
3533
 
                if (m && m[1]) {
3534
 
                    o.opera = numberify(m[1]);
3535
 
                }
3536
 
                m = ua.match(/Version\/([^\s]*)/);
3537
 
                if (m && m[1]) {
3538
 
                    o.opera = numberify(m[1]); // opera 10+
3539
 
                }
3540
 
 
3541
 
                if (/Opera Mobi/.test(ua)) {
3542
 
                    o.mobile = 'opera';
3543
 
                    m = ua.replace('Opera Mobi', '').match(/Opera ([^\s]*)/);
3544
 
                    if (m && m[1]) {
3545
 
                        o.opera = numberify(m[1]);
3546
 
                    }
3547
 
                }
3548
 
                m = ua.match(/Opera Mini[^;]*/);
3549
 
 
3550
 
                if (m) {
3551
 
                    o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316
3552
 
                }
3553
 
            } else { // not opera or webkit
3554
 
                m = ua.match(/MSIE\s([^;]*)/);
3555
 
                if (m && m[1]) {
3556
 
                    o.ie = numberify(m[1]);
3557
 
                } else { // not opera, webkit, or ie
3558
 
                    m = ua.match(/Gecko\/([^\s]*)/);
3559
 
                    if (m) {
3560
 
                        o.gecko = 1; // Gecko detected, look for revision
3561
 
                        m = ua.match(/rv:([^\s\)]*)/);
3562
 
                        if (m && m[1]) {
3563
 
                            o.gecko = numberify(m[1]);
3564
 
                        }
3565
 
                    }
3566
 
                }
3567
 
            }
3568
 
        }
3569
 
    }
3570
 
 
3571
 
    //It was a parsed UA, do not assign the global value.
3572
 
    if (!subUA) {
3573
 
 
3574
 
        if (typeof process == 'object') {
3575
 
 
3576
 
            if (process.versions && process.versions.node) {
3577
 
                //NodeJS
3578
 
                o.os = process.platform;
3579
 
                o.nodejs = process.versions.node;
3580
 
            }
3581
 
        }
3582
 
 
3583
 
        YUI.Env.UA = o;
3584
 
 
3585
 
    }
3586
 
 
3587
 
    return o;
3588
 
};
3589
 
 
3590
 
 
3591
 
Y.UA = YUI.Env.UA || YUI.Env.parseUA();
3592
 
YUI.Env.aliases = {
3593
 
    "anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],
3594
 
    "app": ["app-base","app-transitions","model","model-list","router","view"],
3595
 
    "attribute": ["attribute-base","attribute-complex"],
3596
 
    "autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],
3597
 
    "base": ["base-base","base-pluginhost","base-build"],
3598
 
    "cache": ["cache-base","cache-offline","cache-plugin"],
3599
 
    "collection": ["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],
3600
 
    "controller": ["router"],
3601
 
    "dataschema": ["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],
3602
 
    "datasource": ["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],
3603
 
    "datatable": ["datatable-core","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"],
3604
 
    "datatable-deprecated": ["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],
3605
 
    "datatype": ["datatype-number","datatype-date","datatype-xml"],
3606
 
    "datatype-date": ["datatype-date-parse","datatype-date-format"],
3607
 
    "datatype-number": ["datatype-number-parse","datatype-number-format"],
3608
 
    "datatype-xml": ["datatype-xml-parse","datatype-xml-format"],
3609
 
    "dd": ["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],
3610
 
    "dom": ["dom-base","dom-screen","dom-style","selector-native","selector"],
3611
 
    "editor": ["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],
3612
 
    "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"],
3613
 
    "event-custom": ["event-custom-base","event-custom-complex"],
3614
 
    "event-gestures": ["event-flick","event-move"],
3615
 
    "handlebars": ["handlebars-compiler"],
3616
 
    "highlight": ["highlight-base","highlight-accentfold"],
3617
 
    "history": ["history-base","history-hash","history-hash-ie","history-html5"],
3618
 
    "io": ["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],
3619
 
    "json": ["json-parse","json-stringify"],
3620
 
    "loader": ["loader-base","loader-rollup","loader-yui3"],
3621
 
    "node": ["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],
3622
 
    "pluginhost": ["pluginhost-base","pluginhost-config"],
3623
 
    "querystring": ["querystring-parse","querystring-stringify"],
3624
 
    "recordset": ["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],
3625
 
    "resize": ["resize-base","resize-proxy","resize-constrain"],
3626
 
    "slider": ["slider-base","slider-value-range","clickable-rail","range-slider"],
3627
 
    "text": ["text-accentfold","text-wordbreak"],
3628
 
    "widget": ["widget-base","widget-htmlparser","widget-skin","widget-uievents"]
3629
 
};
3630
 
 
3631
 
 
3632
 
}, '3.5.0' );
3633
 
YUI.add('get', function(Y) {
3634
 
 
3635
 
    /**
3636
 
    * NodeJS specific Get module used to load remote resources. It contains the same signature as the default Get module so there is no code change needed.
3637
 
    * @module get-nodejs
3638
 
    * @class GetNodeJS
3639
 
    */
3640
 
        
3641
 
    var path = require('path'),
3642
 
        vm = require('vm'),
3643
 
        fs = require('fs'),
3644
 
        request = require('request');
3645
 
 
3646
 
 
3647
 
    Y.Get = function() {
3648
 
    };
3649
 
 
3650
 
    //Setup the default config base path
3651
 
    Y.config.base = path.join(__dirname, '../');
3652
 
 
3653
 
    YUI.require = require;
3654
 
    YUI.process = process;
3655
 
    
3656
 
    /**
3657
 
    * Escape the path for Windows, they need to be double encoded when used as `__dirname` or `__filename`
3658
 
    * @method escapeWinPath
3659
 
    * @protected
3660
 
    * @param {String} p The path to modify
3661
 
    * @return {String} The encoded path
3662
 
    */
3663
 
    var escapeWinPath = function(p) {
3664
 
        return p.replace(/\\/g, '\\\\');
3665
 
    };
3666
 
 
3667
 
    /**
3668
 
    * Takes the raw JS files and wraps them to be executed in the YUI context so they can be loaded
3669
 
    * into the YUI object
3670
 
    * @method _exec
3671
 
    * @private
3672
 
    * @param {String} data The JS to execute
3673
 
    * @param {String} url The path to the file that was parsed
3674
 
    * @param {Callback} cb The callback to execute when this is completed
3675
 
    * @param {Error} cb.err=null Error object
3676
 
    * @param {String} cb.url The URL that was just parsed
3677
 
    */
3678
 
 
3679
 
    Y.Get._exec = function(data, url, cb) {
3680
 
        var dirName = escapeWinPath(path.dirname(url));
3681
 
        var fileName = escapeWinPath(url);
3682
 
 
3683
 
        if (dirName.match(/^https?:\/\//)) {
3684
 
            dirName = '.';
3685
 
            fileName = 'remoteResource';
3686
 
        }
3687
 
 
3688
 
        var mod = "(function(YUI) { var __dirname = '" + dirName + "'; "+
3689
 
            "var __filename = '" + fileName + "'; " +
3690
 
            "var process = YUI.process;" +
3691
 
            "var require = function(file) {" +
3692
 
            " if (file.indexOf('./') === 0) {" +
3693
 
            "   file = __dirname + file.replace('./', '/'); }" +
3694
 
            " return YUI.require(file); }; " +
3695
 
            data + " ;return YUI; })";
3696
 
    
3697
 
        //var mod = "(function(YUI) { " + data + ";return YUI; })";
3698
 
        var script = vm.createScript(mod, url);
3699
 
        var fn = script.runInThisContext(mod);
3700
 
        YUI = fn(YUI);
3701
 
        cb(null, url);
3702
 
    };
3703
 
    
3704
 
    /**
3705
 
    * Fetches the content from a remote URL or a file from disc and passes the content
3706
 
    * off to `_exec` for parsing
3707
 
    * @method _include
3708
 
    * @private
3709
 
    * @param {String} url The URL/File path to fetch the content from
3710
 
    * @param {Callback} cb The callback to fire once the content has been executed via `_exec`
3711
 
    */
3712
 
    Y.Get._include = function(url, cb) {
3713
 
        var self = this;
3714
 
 
3715
 
        if (url.match(/^https?:\/\//)) {
3716
 
            var cfg = {
3717
 
                url: url,
3718
 
                timeout: self.timeout
3719
 
            };
3720
 
            request(cfg, function (err, response, body) {
3721
 
                if (err) {
3722
 
                    Y.log(err, 'error', 'get');
3723
 
                    cb(err, url);
3724
 
                } else {
3725
 
                    Y.Get._exec(body, url, cb);
3726
 
                }
3727
 
            });
3728
 
        } else {
3729
 
            if (Y.config.useSync) {
3730
 
                //Needs to be in useSync
3731
 
                if (path.existsSync(url)) {
3732
 
                    var mod = fs.readFileSync(url,'utf8');
3733
 
                    Y.Get._exec(mod, url, cb);
3734
 
                } else {
3735
 
                    cb('Path does not exist: ' + url, url);
3736
 
                }
3737
 
            } else {
3738
 
                fs.readFile(url, 'utf8', function(err, mod) {
3739
 
                    if (err) {
3740
 
                        cb(err, url);
3741
 
                    } else {
3742
 
                        Y.Get._exec(mod, url, cb);
3743
 
                    }
3744
 
                });
3745
 
            }
3746
 
        }
3747
 
        
3748
 
    };
3749
 
 
3750
 
 
3751
 
    var end = function(cb, msg, result) {
3752
 
        //Y.log('Get end: ' + cb.onEnd);
3753
 
        if (Y.Lang.isFunction(cb.onEnd)) {
3754
 
            cb.onEnd.call(Y, msg, result);
3755
 
        }
3756
 
    }, pass = function(cb) {
3757
 
        //Y.log('Get pass: ' + cb.onSuccess);
3758
 
        if (Y.Lang.isFunction(cb.onSuccess)) {
3759
 
            cb.onSuccess.call(Y, cb);
3760
 
        }
3761
 
        end(cb, 'success', 'success');
3762
 
    }, fail = function(cb, er) {
3763
 
        //Y.log('Get fail: ' + er);
3764
 
        if (Y.Lang.isFunction(cb.onFailure)) {
3765
 
            cb.onFailure.call(Y, er, cb);
3766
 
        }
3767
 
        end(cb, er, 'fail');
3768
 
    };
3769
 
 
3770
 
 
3771
 
    /**
3772
 
    * Override for Get.script for loading local or remote YUI modules.
3773
 
    * @method js
3774
 
    * @param {Array|String} s The URL's to load into this context
3775
 
    * @param {Object} options Transaction options
3776
 
    */
3777
 
    Y.Get.js = function(s, options) {
3778
 
        var A = Y.Array,
3779
 
            self = this,
3780
 
            urls = A(s), url, i, l = urls.length, c= 0,
3781
 
            check = function() {
3782
 
                if (c === l) {
3783
 
                    pass(options);
3784
 
                }
3785
 
            };
3786
 
 
3787
 
 
3788
 
 
3789
 
        for (i=0; i<l; i++) {
3790
 
            url = urls[i];
3791
 
            if (Y.Lang.isObject(url)) {
3792
 
                url = url.url;
3793
 
            }
3794
 
 
3795
 
            url = url.replace(/'/g, '%27');
3796
 
            Y.log('URL: ' + url, 'info', 'get');
3797
 
            Y.Get._include(url, function(err, url) {
3798
 
                if (!Y.config) {
3799
 
                    Y.config = {
3800
 
                        debug: true
3801
 
                    };
3802
 
                }
3803
 
                if (options.onProgress) {
3804
 
                    options.onProgress.call(options.context || Y, url);
3805
 
                }
3806
 
                Y.log('After Load: ' + url, 'info', 'get');
3807
 
                if (err) {
3808
 
                    fail(options, err);
3809
 
                    Y.log('----------------------------------------------------------', 'error', 'get');
3810
 
                    Y.log(err, 'error', 'get');
3811
 
                    Y.log('----------------------------------------------------------', 'error', 'get');
3812
 
                } else {
3813
 
                    c++;
3814
 
                    check();
3815
 
                }
3816
 
            });
3817
 
        }
3818
 
    };
3819
 
    
3820
 
    /**
3821
 
    * Alias for `Y.Get.js`
3822
 
    * @method script
3823
 
    */
3824
 
    Y.Get.script = Y.Get.js;
3825
 
    
3826
 
    //Place holder for SS Dom access
3827
 
    Y.Get.css = function(s, cb) {
3828
 
        Y.log('Y.Get.css is not supported, just reporting that it has loaded but not fetching.', 'warn', 'get');
3829
 
        pass(cb);
3830
 
    };
3831
 
 
3832
 
 
3833
 
 
3834
 
}, '3.5.0' ,{requires:['yui-base']});
3835
 
YUI.add('features', function(Y) {
3836
 
 
3837
 
var feature_tests = {};
3838
 
 
3839
 
/**
3840
 
Contains the core of YUI's feature test architecture.
3841
 
@module features
3842
 
*/
3843
 
 
3844
 
/**
3845
 
* Feature detection
3846
 
* @class Features
3847
 
* @static
3848
 
*/
3849
 
 
3850
 
Y.mix(Y.namespace('Features'), {
3851
 
    
3852
 
    /**
3853
 
    * Object hash of all registered feature tests
3854
 
    * @property tests
3855
 
    * @type Object
3856
 
    */
3857
 
    tests: feature_tests,
3858
 
    
3859
 
    /**
3860
 
    * Add a test to the system
3861
 
    * 
3862
 
    *   ```
3863
 
    *   Y.Features.add("load", "1", {});
3864
 
    *   ```
3865
 
    * 
3866
 
    * @method add
3867
 
    * @param {String} cat The category, right now only 'load' is supported
3868
 
    * @param {String} name The number sequence of the test, how it's reported in the URL or config: 1, 2, 3
3869
 
    * @param {Object} o Object containing test properties
3870
 
    * @param {String} o.name The name of the test
3871
 
    * @param {Function} o.test The test function to execute, the only argument to the function is the `Y` instance
3872
 
    * @param {String} o.trigger The module that triggers this test.
3873
 
    */
3874
 
    add: function(cat, name, o) {
3875
 
        feature_tests[cat] = feature_tests[cat] || {};
3876
 
        feature_tests[cat][name] = o;
3877
 
    },
3878
 
    /**
3879
 
    * Execute all tests of a given category and return the serialized results
3880
 
    *
3881
 
    *   ```
3882
 
    *   caps=1:1;2:1;3:0
3883
 
    *   ```
3884
 
    * @method all
3885
 
    * @param {String} cat The category to execute
3886
 
    * @param {Array} args The arguments to pass to the test function
3887
 
    * @return {String} A semi-colon separated string of tests and their success/failure: 1:1;2:1;3:0
3888
 
    */
3889
 
    all: function(cat, args) {
3890
 
        var cat_o = feature_tests[cat],
3891
 
            // results = {};
3892
 
            result = [];
3893
 
        if (cat_o) {
3894
 
            Y.Object.each(cat_o, function(v, k) {
3895
 
                result.push(k + ':' + (Y.Features.test(cat, k, args) ? 1 : 0));
3896
 
            });
3897
 
        }
3898
 
 
3899
 
        return (result.length) ? result.join(';') : '';
3900
 
    },
3901
 
    /**
3902
 
    * Run a sepecific test and return a Boolean response.
3903
 
    *
3904
 
    *   ```
3905
 
    *   Y.Features.test("load", "1");
3906
 
    *   ```
3907
 
    *
3908
 
    * @method test
3909
 
    * @param {String} cat The category of the test to run
3910
 
    * @param {String} name The name of the test to run
3911
 
    * @param {Array} args The arguments to pass to the test function
3912
 
    * @return {Boolean} True or false if the test passed/failed.
3913
 
    */
3914
 
    test: function(cat, name, args) {
3915
 
        args = args || [];
3916
 
        var result, ua, test,
3917
 
            cat_o = feature_tests[cat],
3918
 
            feature = cat_o && cat_o[name];
3919
 
 
3920
 
        if (!feature) {
3921
 
            Y.log('Feature test ' + cat + ', ' + name + ' not found');
3922
 
        } else {
3923
 
 
3924
 
            result = feature.result;
3925
 
 
3926
 
            if (Y.Lang.isUndefined(result)) {
3927
 
 
3928
 
                ua = feature.ua;
3929
 
                if (ua) {
3930
 
                    result = (Y.UA[ua]);
3931
 
                }
3932
 
 
3933
 
                test = feature.test;
3934
 
                if (test && ((!ua) || result)) {
3935
 
                    result = test.apply(Y, args);
3936
 
                }
3937
 
 
3938
 
                feature.result = result;
3939
 
            }
3940
 
        }
3941
 
 
3942
 
        return result;
3943
 
    }
3944
 
});
3945
 
 
3946
 
// Y.Features.add("load", "1", {});
3947
 
// Y.Features.test("load", "1");
3948
 
// caps=1:1;2:0;3:1;
3949
 
 
3950
 
/* This file is auto-generated by src/loader/scripts/meta_join.py */
3951
 
var add = Y.Features.add;
3952
 
// io-nodejs
3953
 
add('load', '0', {
3954
 
    "name": "io-nodejs", 
3955
 
    "trigger": "io-base", 
3956
 
    "ua": "nodejs"
3957
 
});
3958
 
// graphics-canvas-default
3959
 
add('load', '1', {
3960
 
    "name": "graphics-canvas-default", 
3961
 
    "test": function(Y) {
3962
 
    var DOCUMENT = Y.config.doc,
3963
 
        useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas",
3964
 
                canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
3965
 
        svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
3966
 
    return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d"));
3967
 
}, 
3968
 
    "trigger": "graphics"
3969
 
});
3970
 
// autocomplete-list-keys
3971
 
add('load', '2', {
3972
 
    "name": "autocomplete-list-keys", 
3973
 
    "test": function (Y) {
3974
 
    // Only add keyboard support to autocomplete-list if this doesn't appear to
3975
 
    // be an iOS or Android-based mobile device.
3976
 
    //
3977
 
    // There's currently no feasible way to actually detect whether a device has
3978
 
    // a hardware keyboard, so this sniff will have to do. It can easily be
3979
 
    // overridden by manually loading the autocomplete-list-keys module.
3980
 
    //
3981
 
    // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari
3982
 
    // doesn't fire the keyboard events used by AutoCompleteList, so there's
3983
 
    // no point loading the -keys module even when a bluetooth keyboard may be
3984
 
    // available.
3985
 
    return !(Y.UA.ios || Y.UA.android);
3986
 
}, 
3987
 
    "trigger": "autocomplete-list"
3988
 
});
3989
 
// graphics-svg
3990
 
add('load', '3', {
3991
 
    "name": "graphics-svg", 
3992
 
    "test": function(Y) {
3993
 
    var DOCUMENT = Y.config.doc,
3994
 
        useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas",
3995
 
                canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
3996
 
        svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
3997
 
    
3998
 
    return svg && (useSVG || !canvas);
3999
 
}, 
4000
 
    "trigger": "graphics"
4001
 
});
4002
 
// editor-para-ie
4003
 
add('load', '4', {
4004
 
    "name": "editor-para-ie", 
4005
 
    "trigger": "editor-para", 
4006
 
    "ua": "ie", 
4007
 
    "when": "instead"
4008
 
});
4009
 
// graphics-vml-default
4010
 
add('load', '5', {
4011
 
    "name": "graphics-vml-default", 
4012
 
    "test": function(Y) {
4013
 
    var DOCUMENT = Y.config.doc,
4014
 
                canvas = DOCUMENT && DOCUMENT.createElement("canvas");
4015
 
    return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
4016
 
}, 
4017
 
    "trigger": "graphics"
4018
 
});
4019
 
// graphics-svg-default
4020
 
add('load', '6', {
4021
 
    "name": "graphics-svg-default", 
4022
 
    "test": function(Y) {
4023
 
    var DOCUMENT = Y.config.doc,
4024
 
        useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas",
4025
 
                canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
4026
 
        svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
4027
 
    
4028
 
    return svg && (useSVG || !canvas);
4029
 
}, 
4030
 
    "trigger": "graphics"
4031
 
});
4032
 
// history-hash-ie
4033
 
add('load', '7', {
4034
 
    "name": "history-hash-ie", 
4035
 
    "test": function (Y) {
4036
 
    var docMode = Y.config.doc && Y.config.doc.documentMode;
4037
 
 
4038
 
    return Y.UA.ie && (!('onhashchange' in Y.config.win) ||
4039
 
            !docMode || docMode < 8);
4040
 
}, 
4041
 
    "trigger": "history-hash"
4042
 
});
4043
 
// transition-timer
4044
 
add('load', '8', {
4045
 
    "name": "transition-timer", 
4046
 
    "test": function (Y) {
4047
 
    var DOCUMENT = Y.config.doc,
4048
 
        node = (DOCUMENT) ? DOCUMENT.documentElement: null,
4049
 
        ret = true;
4050
 
 
4051
 
    if (node && node.style) {
4052
 
        ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);
4053
 
    } 
4054
 
 
4055
 
    return ret;
4056
 
}, 
4057
 
    "trigger": "transition"
4058
 
});
4059
 
// dom-style-ie
4060
 
add('load', '9', {
4061
 
    "name": "dom-style-ie", 
4062
 
    "test": function (Y) {
4063
 
 
4064
 
    var testFeature = Y.Features.test,
4065
 
        addFeature = Y.Features.add,
4066
 
        WINDOW = Y.config.win,
4067
 
        DOCUMENT = Y.config.doc,
4068
 
        DOCUMENT_ELEMENT = 'documentElement',
4069
 
        ret = false;
4070
 
 
4071
 
    addFeature('style', 'computedStyle', {
4072
 
        test: function() {
4073
 
            return WINDOW && 'getComputedStyle' in WINDOW;
4074
 
        }
4075
 
    });
4076
 
 
4077
 
    addFeature('style', 'opacity', {
4078
 
        test: function() {
4079
 
            return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style;
4080
 
        }
4081
 
    });
4082
 
 
4083
 
    ret =  (!testFeature('style', 'opacity') &&
4084
 
            !testFeature('style', 'computedStyle'));
4085
 
 
4086
 
    return ret;
4087
 
}, 
4088
 
    "trigger": "dom-style"
4089
 
});
4090
 
// selector-css2
4091
 
add('load', '10', {
4092
 
    "name": "selector-css2", 
4093
 
    "test": function (Y) {
4094
 
    var DOCUMENT = Y.config.doc,
4095
 
        ret = DOCUMENT && !('querySelectorAll' in DOCUMENT);
4096
 
 
4097
 
    return ret;
4098
 
}, 
4099
 
    "trigger": "selector"
4100
 
});
4101
 
// widget-base-ie
4102
 
add('load', '11', {
4103
 
    "name": "widget-base-ie", 
4104
 
    "trigger": "widget-base", 
4105
 
    "ua": "ie"
4106
 
});
4107
 
// event-base-ie
4108
 
add('load', '12', {
4109
 
    "name": "event-base-ie", 
4110
 
    "test": function(Y) {
4111
 
    var imp = Y.config.doc && Y.config.doc.implementation;
4112
 
    return (imp && (!imp.hasFeature('Events', '2.0')));
4113
 
}, 
4114
 
    "trigger": "node-base"
4115
 
});
4116
 
// dd-gestures
4117
 
add('load', '13', {
4118
 
    "name": "dd-gestures", 
4119
 
    "test": function(Y) {
4120
 
    return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));
4121
 
}, 
4122
 
    "trigger": "dd-drag"
4123
 
});
4124
 
// scrollview-base-ie
4125
 
add('load', '14', {
4126
 
    "name": "scrollview-base-ie", 
4127
 
    "trigger": "scrollview-base", 
4128
 
    "ua": "ie"
4129
 
});
4130
 
// app-transitions-native
4131
 
add('load', '15', {
4132
 
    "name": "app-transitions-native", 
4133
 
    "test": function (Y) {
4134
 
    var doc  = Y.config.doc,
4135
 
        node = doc ? doc.documentElement : null;
4136
 
 
4137
 
    if (node && node.style) {
4138
 
        return ('MozTransition' in node.style || 'WebkitTransition' in node.style);
4139
 
    }
4140
 
 
4141
 
    return false;
4142
 
}, 
4143
 
    "trigger": "app-transitions"
4144
 
});
4145
 
// graphics-canvas
4146
 
add('load', '16', {
4147
 
    "name": "graphics-canvas", 
4148
 
    "test": function(Y) {
4149
 
    var DOCUMENT = Y.config.doc,
4150
 
        useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas",
4151
 
                canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
4152
 
        svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
4153
 
    return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d"));
4154
 
}, 
4155
 
    "trigger": "graphics"
4156
 
});
4157
 
// graphics-vml
4158
 
add('load', '17', {
4159
 
    "name": "graphics-vml", 
4160
 
    "test": function(Y) {
4161
 
    var DOCUMENT = Y.config.doc,
4162
 
                canvas = DOCUMENT && DOCUMENT.createElement("canvas");
4163
 
    return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
4164
 
}, 
4165
 
    "trigger": "graphics"
4166
 
});
4167
 
 
4168
 
 
4169
 
}, '3.5.0' ,{requires:['yui-base']});
4170
 
YUI.add('intl-base', function(Y) {
4171
 
 
4172
 
/**
4173
 
 * The Intl utility provides a central location for managing sets of
4174
 
 * localized resources (strings and formatting patterns).
4175
 
 *
4176
 
 * @class Intl
4177
 
 * @uses EventTarget
4178
 
 * @static
4179
 
 */
4180
 
 
4181
 
var SPLIT_REGEX = /[, ]/;
4182
 
 
4183
 
Y.mix(Y.namespace('Intl'), {
4184
 
 
4185
 
 /**
4186
 
    * Returns the language among those available that
4187
 
    * best matches the preferred language list, using the Lookup
4188
 
    * algorithm of BCP 47.
4189
 
    * If none of the available languages meets the user's preferences,
4190
 
    * then "" is returned.
4191
 
    * Extended language ranges are not supported.
4192
 
    *
4193
 
    * @method lookupBestLang
4194
 
    * @param {String[] | String} preferredLanguages The list of preferred
4195
 
    * languages in descending preference order, represented as BCP 47
4196
 
    * language tags. A string array or a comma-separated list.
4197
 
    * @param {String[]} availableLanguages The list of languages
4198
 
    * that the application supports, represented as BCP 47 language
4199
 
    * tags.
4200
 
    *
4201
 
    * @return {String} The available language that best matches the
4202
 
    * preferred language list, or "".
4203
 
    * @since 3.1.0
4204
 
    */
4205
 
    lookupBestLang: function(preferredLanguages, availableLanguages) {
4206
 
 
4207
 
        var i, language, result, index;
4208
 
 
4209
 
        // check whether the list of available languages contains language;
4210
 
        // if so return it
4211
 
        function scan(language) {
4212
 
            var i;
4213
 
            for (i = 0; i < availableLanguages.length; i += 1) {
4214
 
                if (language.toLowerCase() ===
4215
 
                            availableLanguages[i].toLowerCase()) {
4216
 
                    return availableLanguages[i];
4217
 
                }
4218
 
            }
4219
 
        }
4220
 
 
4221
 
        if (Y.Lang.isString(preferredLanguages)) {
4222
 
            preferredLanguages = preferredLanguages.split(SPLIT_REGEX);
4223
 
        }
4224
 
 
4225
 
        for (i = 0; i < preferredLanguages.length; i += 1) {
4226
 
            language = preferredLanguages[i];
4227
 
            if (!language || language === '*') {
4228
 
                continue;
4229
 
            }
4230
 
            // check the fallback sequence for one language
4231
 
            while (language.length > 0) {
4232
 
                result = scan(language);
4233
 
                if (result) {
4234
 
                    return result;
4235
 
                } else {
4236
 
                    index = language.lastIndexOf('-');
4237
 
                    if (index >= 0) {
4238
 
                        language = language.substring(0, index);
4239
 
                        // one-character subtags get cut along with the
4240
 
                        // following subtag
4241
 
                        if (index >= 2 && language.charAt(index - 2) === '-') {
4242
 
                            language = language.substring(0, index - 2);
4243
 
                        }
4244
 
                    } else {
4245
 
                        // nothing available for this language
4246
 
                        break;
4247
 
                    }
4248
 
                }
4249
 
            }
4250
 
        }
4251
 
 
4252
 
        return '';
4253
 
    }
4254
 
});
4255
 
 
4256
 
 
4257
 
}, '3.5.0' ,{requires:['yui-base']});
4258
 
YUI.add('yui-log', function(Y) {
4259
 
 
4260
 
/**
4261
 
 * Provides console log capability and exposes a custom event for
4262
 
 * console implementations. This module is a `core` YUI module, <a href="../classes/YUI.html#method_log">it's documentation is located under the YUI class</a>.
4263
 
 *
4264
 
 * @module yui
4265
 
 * @submodule yui-log
4266
 
 */
4267
 
 
4268
 
var INSTANCE = Y,
4269
 
    LOGEVENT = 'yui:log',
4270
 
    UNDEFINED = 'undefined',
4271
 
    LEVELS = { debug: 1,
4272
 
               info: 1,
4273
 
               warn: 1,
4274
 
               error: 1 };
4275
 
 
4276
 
/**
4277
 
 * If the 'debug' config is true, a 'yui:log' event will be
4278
 
 * dispatched, which the Console widget and anything else
4279
 
 * can consume.  If the 'useBrowserConsole' config is true, it will
4280
 
 * write to the browser console if available.  YUI-specific log
4281
 
 * messages will only be present in the -debug versions of the
4282
 
 * JS files.  The build system is supposed to remove log statements
4283
 
 * from the raw and minified versions of the files.
4284
 
 *
4285
 
 * @method log
4286
 
 * @for YUI
4287
 
 * @param  {String}  msg  The message to log.
4288
 
 * @param  {String}  cat  The log category for the message.  Default
4289
 
 *                        categories are "info", "warn", "error", time".
4290
 
 *                        Custom categories can be used as well. (opt).
4291
 
 * @param  {String}  src  The source of the the message (opt).
4292
 
 * @param  {boolean} silent If true, the log event won't fire.
4293
 
 * @return {YUI}      YUI instance.
4294
 
 */
4295
 
INSTANCE.log = function(msg, cat, src, silent) {
4296
 
    var bail, excl, incl, m, f,
4297
 
        Y = INSTANCE,
4298
 
        c = Y.config,
4299
 
        publisher = (Y.fire) ? Y : YUI.Env.globalEvents;
4300
 
    // suppress log message if the config is off or the event stack
4301
 
    // or the event call stack contains a consumer of the yui:log event
4302
 
    if (c.debug) {
4303
 
        // apply source filters
4304
 
        if (src) {
4305
 
            excl = c.logExclude;
4306
 
            incl = c.logInclude;
4307
 
            if (incl && !(src in incl)) {
4308
 
                bail = 1;
4309
 
            } else if (incl && (src in incl)) {
4310
 
                bail = !incl[src];
4311
 
            } else if (excl && (src in excl)) {
4312
 
                bail = excl[src];
4313
 
            }
4314
 
        }
4315
 
        if (!bail) {
4316
 
            if (c.useBrowserConsole) {
4317
 
                m = (src) ? src + ': ' + msg : msg;
4318
 
                if (Y.Lang.isFunction(c.logFn)) {
4319
 
                    c.logFn.call(Y, msg, cat, src);
4320
 
                } else if (typeof console != UNDEFINED && console.log) {
4321
 
                    f = (cat && console[cat] && (cat in LEVELS)) ? cat : 'log';
4322
 
                    console[f](m);
4323
 
                } else if (typeof opera != UNDEFINED) {
4324
 
                    opera.postError(m);
4325
 
                }
4326
 
            }
4327
 
 
4328
 
            if (publisher && !silent) {
4329
 
 
4330
 
                if (publisher == Y && (!publisher.getEvent(LOGEVENT))) {
4331
 
                    publisher.publish(LOGEVENT, {
4332
 
                        broadcast: 2
4333
 
                    });
4334
 
                }
4335
 
 
4336
 
                publisher.fire(LOGEVENT, {
4337
 
                    msg: msg,
4338
 
                    cat: cat,
4339
 
                    src: src
4340
 
                });
4341
 
            }
4342
 
        }
4343
 
    }
4344
 
 
4345
 
    return Y;
4346
 
};
4347
 
 
4348
 
/**
4349
 
 * Write a system message.  This message will be preserved in the
4350
 
 * minified and raw versions of the YUI files, unlike log statements.
4351
 
 * @method message
4352
 
 * @for YUI
4353
 
 * @param  {String}  msg  The message to log.
4354
 
 * @param  {String}  cat  The log category for the message.  Default
4355
 
 *                        categories are "info", "warn", "error", time".
4356
 
 *                        Custom categories can be used as well. (opt).
4357
 
 * @param  {String}  src  The source of the the message (opt).
4358
 
 * @param  {boolean} silent If true, the log event won't fire.
4359
 
 * @return {YUI}      YUI instance.
4360
 
 */
4361
 
INSTANCE.message = function() {
4362
 
    return INSTANCE.log.apply(INSTANCE, arguments);
4363
 
};
4364
 
 
4365
 
 
4366
 
}, '3.5.0' ,{requires:['yui-base']});
4367
 
YUI.add('yui-log-nodejs', function(Y) {
4368
 
 
4369
 
var sys = require(process.binding('natives').util ? 'util' : 'sys'),
4370
 
    hasColor = false;
4371
 
 
4372
 
try {
4373
 
    var stdio = require("stdio");
4374
 
    hasColor = stdio.isStderrATTY();
4375
 
} catch (ex) {
4376
 
    hasColor = true;
4377
 
}
4378
 
 
4379
 
Y.config.useColor = hasColor;
4380
 
 
4381
 
Y.consoleColor = function(str, num) {
4382
 
    if (!this.config.useColor) {
4383
 
        return str;
4384
 
    }
4385
 
    if (!num) {
4386
 
        num = '32';
4387
 
    }
4388
 
    return "\033[" + num +"m" + str + "\033[0m"
4389
 
};
4390
 
 
4391
 
 
4392
 
var logFn = function(str, t, m) {
4393
 
    var id = '';
4394
 
    if (this.id) {
4395
 
        id = '[' + this.id + ']:';
4396
 
    }
4397
 
    t = t || 'info';
4398
 
    m = (m) ? this.consoleColor(' (' +  m.toLowerCase() + '):', 35) : '';
4399
 
    
4400
 
    if (str === null) {
4401
 
        str = 'null';
4402
 
    }
4403
 
 
4404
 
    if ((typeof str === 'object') || str instanceof Array) {
4405
 
        try {
4406
 
            //Should we use this?
4407
 
            if (str.tagName || str._yuid || str._query) {
4408
 
                str = str.toString();
4409
 
            } else {
4410
 
                str = sys.inspect(str);
4411
 
            }
4412
 
        } catch (e) {
4413
 
            //Fail catcher
4414
 
        }
4415
 
    }
4416
 
 
4417
 
    var lvl = '37;40', mLvl = ((str) ? '' : 31);
4418
 
    t = t+''; //Force to a string..
4419
 
    switch (t.toLowerCase()) {
4420
 
        case 'error':
4421
 
            lvl = mLvl = 31;
4422
 
            break;
4423
 
        case 'warn':
4424
 
            lvl = 33;
4425
 
            break;
4426
 
        case 'debug':
4427
 
            lvl = 34;
4428
 
            break;
4429
 
    }
4430
 
    if (typeof str === 'string') {
4431
 
        if (str && str.indexOf("\n") !== -1) {
4432
 
            str = "\n" + str;
4433
 
        }
4434
 
    }
4435
 
 
4436
 
    // output log messages to stderr
4437
 
    sys.error(this.consoleColor(t.toLowerCase() + ':', lvl) + m + ' ' + this.consoleColor(str, mLvl));
4438
 
};
4439
 
 
4440
 
if (!Y.config.logFn) {
4441
 
    Y.config.logFn = logFn;
4442
 
}
4443
 
 
4444
 
 
4445
 
 
4446
 
}, '3.5.0' ,{requires:['yui-log']});
4447
 
YUI.add('yui-later', function(Y) {
4448
 
 
4449
 
/**
4450
 
 * Provides a setTimeout/setInterval wrapper. This module is a `core` YUI module, <a href="../classes/YUI.html#method_later">it's documentation is located under the YUI class</a>.
4451
 
 *
4452
 
 * @module yui
4453
 
 * @submodule yui-later
4454
 
 */
4455
 
 
4456
 
var NO_ARGS = [];
4457
 
 
4458
 
/**
4459
 
 * Executes the supplied function in the context of the supplied
4460
 
 * object 'when' milliseconds later.  Executes the function a
4461
 
 * single time unless periodic is set to true.
4462
 
 * @for YUI
4463
 
 * @method later
4464
 
 * @param when {int} the number of milliseconds to wait until the fn
4465
 
 * is executed.
4466
 
 * @param o the context object.
4467
 
 * @param fn {Function|String} the function to execute or the name of
4468
 
 * the method in the 'o' object to execute.
4469
 
 * @param data [Array] data that is provided to the function.  This
4470
 
 * accepts either a single item or an array.  If an array is provided,
4471
 
 * the function is executed with one parameter for each array item.
4472
 
 * If you need to pass a single array parameter, it needs to be wrapped
4473
 
 * in an array [myarray].
4474
 
 *
4475
 
 * Note: native methods in IE may not have the call and apply methods.
4476
 
 * In this case, it will work, but you are limited to four arguments.
4477
 
 *
4478
 
 * @param periodic {boolean} if true, executes continuously at supplied
4479
 
 * interval until canceled.
4480
 
 * @return {object} a timer object. Call the cancel() method on this
4481
 
 * object to stop the timer.
4482
 
 */
4483
 
Y.later = function(when, o, fn, data, periodic) {
4484
 
    when = when || 0;
4485
 
    data = (!Y.Lang.isUndefined(data)) ? Y.Array(data) : NO_ARGS;
4486
 
    o = o || Y.config.win || Y;
4487
 
 
4488
 
    var cancelled = false,
4489
 
        method = (o && Y.Lang.isString(fn)) ? o[fn] : fn,
4490
 
        wrapper = function() {
4491
 
            // IE 8- may execute a setInterval callback one last time
4492
 
            // after clearInterval was called, so in order to preserve
4493
 
            // the cancel() === no more runny-run, we have to jump through
4494
 
            // an extra hoop.
4495
 
            if (!cancelled) {
4496
 
                if (!method.apply) {
4497
 
                    method(data[0], data[1], data[2], data[3]);
4498
 
                } else {
4499
 
                    method.apply(o, data || NO_ARGS);
4500
 
                }
4501
 
            }
4502
 
        },
4503
 
        id = (periodic) ? setInterval(wrapper, when) : setTimeout(wrapper, when);
4504
 
 
4505
 
    return {
4506
 
        id: id,
4507
 
        interval: periodic,
4508
 
        cancel: function() {
4509
 
            cancelled = true;
4510
 
            if (this.interval) {
4511
 
                clearInterval(id);
4512
 
            } else {
4513
 
                clearTimeout(id);
4514
 
            }
4515
 
        }
4516
 
    };
4517
 
};
4518
 
 
4519
 
Y.Lang.later = Y.later;
4520
 
 
4521
 
 
4522
 
 
4523
 
}, '3.5.0' ,{requires:['yui-base']});
4524
 
YUI.add('loader-base', function(Y) {
4525
 
 
4526
 
/**
4527
 
 * The YUI loader core
4528
 
 * @module loader
4529
 
 * @submodule loader-base
4530
 
 */
4531
 
 
4532
 
if (!YUI.Env[Y.version]) {
4533
 
 
4534
 
    (function() {
4535
 
        var VERSION = Y.version,
4536
 
            BUILD = '/build/',
4537
 
            ROOT = VERSION + BUILD,
4538
 
            CDN_BASE = Y.Env.base,
4539
 
            GALLERY_VERSION = '${loader.gallery}',
4540
 
            TNT = '2in3',
4541
 
            TNT_VERSION = '${loader.tnt}',
4542
 
            YUI2_VERSION = '${loader.yui2}',
4543
 
            COMBO_BASE = CDN_BASE + 'combo?',
4544
 
            META = { version: VERSION,
4545
 
                              root: ROOT,
4546
 
                              base: Y.Env.base,
4547
 
                              comboBase: COMBO_BASE,
4548
 
                              skin: { defaultSkin: 'sam',
4549
 
                                           base: 'assets/skins/',
4550
 
                                           path: 'skin.css',
4551
 
                                           after: ['cssreset',
4552
 
                                                          'cssfonts',
4553
 
                                                          'cssgrids',
4554
 
                                                          'cssbase',
4555
 
                                                          'cssreset-context',
4556
 
                                                          'cssfonts-context']},
4557
 
                              groups: {},
4558
 
                              patterns: {} },
4559
 
            groups = META.groups,
4560
 
            yui2Update = function(tnt, yui2, config) {
4561
 
                    
4562
 
                var root = TNT + '.' +
4563
 
                        (tnt || TNT_VERSION) + '/' +
4564
 
                        (yui2 || YUI2_VERSION) + BUILD,
4565
 
                    base = (config && config.base) ? config.base : CDN_BASE,
4566
 
                    combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE;
4567
 
 
4568
 
                groups.yui2.base = base + root;
4569
 
                groups.yui2.root = root;
4570
 
                groups.yui2.comboBase = combo;
4571
 
            },
4572
 
            galleryUpdate = function(tag, config) {
4573
 
                var root = (tag || GALLERY_VERSION) + BUILD,
4574
 
                    base = (config && config.base) ? config.base : CDN_BASE,
4575
 
                    combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE;
4576
 
 
4577
 
                groups.gallery.base = base + root;
4578
 
                groups.gallery.root = root;
4579
 
                groups.gallery.comboBase = combo;
4580
 
            };
4581
 
 
4582
 
 
4583
 
        groups[VERSION] = {};
4584
 
 
4585
 
        groups.gallery = {
4586
 
            ext: false,
4587
 
            combine: true,
4588
 
            comboBase: COMBO_BASE,
4589
 
            update: galleryUpdate,
4590
 
            patterns: { 'gallery-': { },
4591
 
                        'lang/gallery-': {},
4592
 
                        'gallerycss-': { type: 'css' } }
4593
 
        };
4594
 
 
4595
 
        groups.yui2 = {
4596
 
            combine: true,
4597
 
            ext: false,
4598
 
            comboBase: COMBO_BASE,
4599
 
            update: yui2Update,
4600
 
            patterns: {
4601
 
                'yui2-': {
4602
 
                    configFn: function(me) {
4603
 
                        if (/-skin|reset|fonts|grids|base/.test(me.name)) {
4604
 
                            me.type = 'css';
4605
 
                            me.path = me.path.replace(/\.js/, '.css');
4606
 
                            // this makes skins in builds earlier than
4607
 
                            // 2.6.0 work as long as combine is false
4608
 
                            me.path = me.path.replace(/\/yui2-skin/,
4609
 
                                             '/assets/skins/sam/yui2-skin');
4610
 
                        }
4611
 
                    }
4612
 
                }
4613
 
            }
4614
 
        };
4615
 
 
4616
 
        galleryUpdate();
4617
 
        yui2Update();
4618
 
 
4619
 
        YUI.Env[VERSION] = META;
4620
 
    }());
4621
 
}
4622
 
 
4623
 
 
4624
 
/**
4625
 
 * Loader dynamically loads script and css files.  It includes the dependency
4626
 
 * information for the version of the library in use, and will automatically pull in
4627
 
 * dependencies for the modules requested. It can also load the
4628
 
 * files from the Yahoo! CDN, and it can utilize the combo service provided on
4629
 
 * this network to reduce the number of http connections required to download
4630
 
 * YUI files.
4631
 
 *
4632
 
 * @module loader
4633
 
 * @main loader
4634
 
 * @submodule loader-base
4635
 
 */
4636
 
 
4637
 
var NOT_FOUND = {},
4638
 
    NO_REQUIREMENTS = [],
4639
 
    MAX_URL_LENGTH = 1024,
4640
 
    GLOBAL_ENV = YUI.Env,
4641
 
    GLOBAL_LOADED = GLOBAL_ENV._loaded,
4642
 
    CSS = 'css',
4643
 
    JS = 'js',
4644
 
    INTL = 'intl',
4645
 
    VERSION = Y.version,
4646
 
    ROOT_LANG = '',
4647
 
    YObject = Y.Object,
4648
 
    oeach = YObject.each,
4649
 
    YArray = Y.Array,
4650
 
    _queue = GLOBAL_ENV._loaderQueue,
4651
 
    META = GLOBAL_ENV[VERSION],
4652
 
    SKIN_PREFIX = 'skin-',
4653
 
    L = Y.Lang,
4654
 
    ON_PAGE = GLOBAL_ENV.mods,
4655
 
    modulekey,
4656
 
    cache,
4657
 
    _path = function(dir, file, type, nomin) {
4658
 
                        var path = dir + '/' + file;
4659
 
                        if (!nomin) {
4660
 
                            path += '-min';
4661
 
                        }
4662
 
                        path += '.' + (type || CSS);
4663
 
 
4664
 
                        return path;
4665
 
                    };
4666
 
 
4667
 
/**
4668
 
 * The component metadata is stored in Y.Env.meta.
4669
 
 * Part of the loader module.
4670
 
 * @property meta
4671
 
 * @for YUI
4672
 
 */
4673
 
Y.Env.meta = META;
4674
 
 
4675
 
/**
4676
 
 * Loader dynamically loads script and css files.  It includes the dependency
4677
 
 * info for the version of the library in use, and will automatically pull in
4678
 
 * dependencies for the modules requested. It can load the
4679
 
 * files from the Yahoo! CDN, and it can utilize the combo service provided on
4680
 
 * this network to reduce the number of http connections required to download
4681
 
 * YUI files. You can also specify an external, custom combo service to host
4682
 
 * your modules as well.
4683
 
 
4684
 
        var Y = YUI();
4685
 
        var loader = new Y.Loader({
4686
 
            filter: 'debug',
4687
 
            base: '../../',
4688
 
            root: 'build/',
4689
 
            combine: true,
4690
 
            require: ['node', 'dd', 'console']
4691
 
        });
4692
 
        var out = loader.resolve(true);
4693
 
 
4694
 
 * @constructor
4695
 
 * @class Loader
4696
 
 * @param {Object} config an optional set of configuration options.
4697
 
 * @param {String} config.base The base dir which to fetch this module from
4698
 
 * @param {String} config.comboBase The Combo service base path. Ex: `http://yui.yahooapis.com/combo?`
4699
 
 * @param {String} config.root The root path to prepend to module names for the combo service. Ex: `2.5.2/build/`
4700
 
 * @param {String|Object} config.filter A filter to apply to result urls. <a href="#property_filter">See filter property</a>
4701
 
 * @param {Object} config.filters Per-component filter specification.  If specified for a given component, this overrides the filter config.
4702
 
 * @param {Boolean} config.combine Use a combo service to reduce the number of http connections required to load your dependencies
4703
 
 * @param {Array} config.ignore: A list of modules that should never be dynamically loaded
4704
 
 * @param {Array} config.force A list of modules that should always be loaded when required, even if already present on the page
4705
 
 * @param {HTMLElement|String} config.insertBefore Node or id for a node that should be used as the insertion point for new nodes
4706
 
 * @param {Object} config.jsAttributes Object literal containing attributes to add to script nodes
4707
 
 * @param {Object} config.cssAttributes Object literal containing attributes to add to link nodes
4708
 
 * @param {Number} config.timeout The number of milliseconds before a timeout occurs when dynamically loading nodes.  If not set, there is no timeout
4709
 
 * @param {Object} config.context Execution context for all callbacks
4710
 
 * @param {Function} config.onSuccess Callback for the 'success' event
4711
 
 * @param {Function} config.onFailure Callback for the 'failure' event
4712
 
 * @param {Function} config.onCSS Callback for the 'CSSComplete' event.  When loading YUI components with CSS the CSS is loaded first, then the script.  This provides a moment you can tie into to improve the presentation of the page while the script is loading.
4713
 
 * @param {Function} config.onTimeout Callback for the 'timeout' event
4714
 
 * @param {Function} config.onProgress Callback executed each time a script or css file is loaded
4715
 
 * @param {Object} config.modules A list of module definitions.  See <a href="#method_addModule">Loader.addModule</a> for the supported module metadata
4716
 
 * @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`.
4717
 
 * @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.
4718
 
 * @param {String} config.yui2 When using the 2in3 project, you can select the version of YUI 2 to use.  Valid 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.
4719
 
 */
4720
 
Y.Loader = function(o) {
4721
 
 
4722
 
    var defaults = META.modules,
4723
 
        self = this;
4724
 
    
4725
 
    //Catch no config passed.
4726
 
    o = o || {};
4727
 
 
4728
 
    modulekey = META.md5;
4729
 
 
4730
 
    /**
4731
 
     * Internal callback to handle multiple internal insert() calls
4732
 
     * so that css is inserted prior to js
4733
 
     * @property _internalCallback
4734
 
     * @private
4735
 
     */
4736
 
    // self._internalCallback = null;
4737
 
 
4738
 
    /**
4739
 
     * Callback that will be executed when the loader is finished
4740
 
     * with an insert
4741
 
     * @method onSuccess
4742
 
     * @type function
4743
 
     */
4744
 
    // self.onSuccess = null;
4745
 
 
4746
 
    /**
4747
 
     * Callback that will be executed if there is a failure
4748
 
     * @method onFailure
4749
 
     * @type function
4750
 
     */
4751
 
    // self.onFailure = null;
4752
 
 
4753
 
    /**
4754
 
     * Callback for the 'CSSComplete' event.  When loading YUI components
4755
 
     * with CSS the CSS is loaded first, then the script.  This provides
4756
 
     * a moment you can tie into to improve the presentation of the page
4757
 
     * while the script is loading.
4758
 
     * @method onCSS
4759
 
     * @type function
4760
 
     */
4761
 
    // self.onCSS = null;
4762
 
 
4763
 
    /**
4764
 
     * Callback executed each time a script or css file is loaded
4765
 
     * @method onProgress
4766
 
     * @type function
4767
 
     */
4768
 
    // self.onProgress = null;
4769
 
 
4770
 
    /**
4771
 
     * Callback that will be executed if a timeout occurs
4772
 
     * @method onTimeout
4773
 
     * @type function
4774
 
     */
4775
 
    // self.onTimeout = null;
4776
 
 
4777
 
    /**
4778
 
     * The execution context for all callbacks
4779
 
     * @property context
4780
 
     * @default {YUI} the YUI instance
4781
 
     */
4782
 
    self.context = Y;
4783
 
 
4784
 
    /**
4785
 
     * Data that is passed to all callbacks
4786
 
     * @property data
4787
 
     */
4788
 
    // self.data = null;
4789
 
 
4790
 
    /**
4791
 
     * Node reference or id where new nodes should be inserted before
4792
 
     * @property insertBefore
4793
 
     * @type string|HTMLElement
4794
 
     */
4795
 
    // self.insertBefore = null;
4796
 
 
4797
 
    /**
4798
 
     * The charset attribute for inserted nodes
4799
 
     * @property charset
4800
 
     * @type string
4801
 
     * @deprecated , use cssAttributes or jsAttributes.
4802
 
     */
4803
 
    // self.charset = null;
4804
 
 
4805
 
    /**
4806
 
     * An object literal containing attributes to add to link nodes
4807
 
     * @property cssAttributes
4808
 
     * @type object
4809
 
     */
4810
 
    // self.cssAttributes = null;
4811
 
 
4812
 
    /**
4813
 
     * An object literal containing attributes to add to script nodes
4814
 
     * @property jsAttributes
4815
 
     * @type object
4816
 
     */
4817
 
    // self.jsAttributes = null;
4818
 
 
4819
 
    /**
4820
 
     * The base directory.
4821
 
     * @property base
4822
 
     * @type string
4823
 
     * @default http://yui.yahooapis.com/[YUI VERSION]/build/
4824
 
     */
4825
 
    self.base = Y.Env.meta.base + Y.Env.meta.root;
4826
 
 
4827
 
    /**
4828
 
     * Base path for the combo service
4829
 
     * @property comboBase
4830
 
     * @type string
4831
 
     * @default http://yui.yahooapis.com/combo?
4832
 
     */
4833
 
    self.comboBase = Y.Env.meta.comboBase;
4834
 
 
4835
 
    /*
4836
 
     * Base path for language packs.
4837
 
     */
4838
 
    // self.langBase = Y.Env.meta.langBase;
4839
 
    // self.lang = "";
4840
 
 
4841
 
    /**
4842
 
     * If configured, the loader will attempt to use the combo
4843
 
     * service for YUI resources and configured external resources.
4844
 
     * @property combine
4845
 
     * @type boolean
4846
 
     * @default true if a base dir isn't in the config
4847
 
     */
4848
 
    self.combine = o.base &&
4849
 
        (o.base.indexOf(self.comboBase.substr(0, 20)) > -1);
4850
 
    
4851
 
    /**
4852
 
    * The default seperator to use between files in a combo URL
4853
 
    * @property comboSep
4854
 
    * @type {String}
4855
 
    * @default Ampersand
4856
 
    */
4857
 
    self.comboSep = '&';
4858
 
    /**
4859
 
     * Max url length for combo urls.  The default is 2048. This is the URL
4860
 
     * limit for the Yahoo! hosted combo servers.  If consuming
4861
 
     * a different combo service that has a different URL limit
4862
 
     * it is possible to override this default by supplying
4863
 
     * the maxURLLength config option.  The config option will
4864
 
     * only take effect if lower than the default.
4865
 
     *
4866
 
     * @property maxURLLength
4867
 
     * @type int
4868
 
     */
4869
 
    self.maxURLLength = MAX_URL_LENGTH;
4870
 
 
4871
 
    /**
4872
 
     * Ignore modules registered on the YUI global
4873
 
     * @property ignoreRegistered
4874
 
     * @default false
4875
 
     */
4876
 
    //self.ignoreRegistered = false;
4877
 
 
4878
 
    /**
4879
 
     * Root path to prepend to module path for the combo
4880
 
     * service
4881
 
     * @property root
4882
 
     * @type string
4883
 
     * @default [YUI VERSION]/build/
4884
 
     */
4885
 
    self.root = Y.Env.meta.root;
4886
 
 
4887
 
    /**
4888
 
     * Timeout value in milliseconds.  If set, self value will be used by
4889
 
     * the get utility.  the timeout event will fire if
4890
 
     * a timeout occurs.
4891
 
     * @property timeout
4892
 
     * @type int
4893
 
     */
4894
 
    self.timeout = 0;
4895
 
 
4896
 
    /**
4897
 
     * A list of modules that should not be loaded, even if
4898
 
     * they turn up in the dependency tree
4899
 
     * @property ignore
4900
 
     * @type string[]
4901
 
     */
4902
 
    // self.ignore = null;
4903
 
 
4904
 
    /**
4905
 
     * A list of modules that should always be loaded, even
4906
 
     * if they have already been inserted into the page.
4907
 
     * @property force
4908
 
     * @type string[]
4909
 
     */
4910
 
    // self.force = null;
4911
 
 
4912
 
    self.forceMap = {};
4913
 
 
4914
 
    /**
4915
 
     * Should we allow rollups
4916
 
     * @property allowRollup
4917
 
     * @type boolean
4918
 
     * @default false
4919
 
     */
4920
 
    self.allowRollup = false;
4921
 
 
4922
 
    /**
4923
 
     * A filter to apply to result urls.  This filter will modify the default
4924
 
     * path for all modules.  The default path for the YUI library is the
4925
 
     * minified version of the files (e.g., event-min.js).  The filter property
4926
 
     * can be a predefined filter or a custom filter.  The valid predefined
4927
 
     * filters are:
4928
 
     * <dl>
4929
 
     *  <dt>DEBUG</dt>
4930
 
     *  <dd>Selects the debug versions of the library (e.g., event-debug.js).
4931
 
     *      This option will automatically include the Logger widget</dd>
4932
 
     *  <dt>RAW</dt>
4933
 
     *  <dd>Selects the non-minified version of the library (e.g., event.js).
4934
 
     *  </dd>
4935
 
     * </dl>
4936
 
     * You can also define a custom filter, which must be an object literal
4937
 
     * containing a search expression and a replace string:
4938
 
     *
4939
 
     *      myFilter: {
4940
 
     *          'searchExp': "-min\\.js",
4941
 
     *          'replaceStr': "-debug.js"
4942
 
     *      }
4943
 
     *
4944
 
     * @property filter
4945
 
     * @type string| {searchExp: string, replaceStr: string}
4946
 
     */
4947
 
    // self.filter = null;
4948
 
 
4949
 
    /**
4950
 
     * per-component filter specification.  If specified for a given
4951
 
     * component, this overrides the filter config.
4952
 
     * @property filters
4953
 
     * @type object
4954
 
     */
4955
 
    self.filters = {};
4956
 
 
4957
 
    /**
4958
 
     * The list of requested modules
4959
 
     * @property required
4960
 
     * @type {string: boolean}
4961
 
     */
4962
 
    self.required = {};
4963
 
 
4964
 
    /**
4965
 
     * If a module name is predefined when requested, it is checked againsts
4966
 
     * the patterns provided in this property.  If there is a match, the
4967
 
     * module is added with the default configuration.
4968
 
     *
4969
 
     * At the moment only supporting module prefixes, but anticipate
4970
 
     * supporting at least regular expressions.
4971
 
     * @property patterns
4972
 
     * @type Object
4973
 
     */
4974
 
    // self.patterns = Y.merge(Y.Env.meta.patterns);
4975
 
    self.patterns = {};
4976
 
 
4977
 
    /**
4978
 
     * The library metadata
4979
 
     * @property moduleInfo
4980
 
     */
4981
 
    // self.moduleInfo = Y.merge(Y.Env.meta.moduleInfo);
4982
 
    self.moduleInfo = {};
4983
 
 
4984
 
    self.groups = Y.merge(Y.Env.meta.groups);
4985
 
 
4986
 
    /**
4987
 
     * Provides the information used to skin the skinnable components.
4988
 
     * The following skin definition would result in 'skin1' and 'skin2'
4989
 
     * being loaded for calendar (if calendar was requested), and
4990
 
     * 'sam' for all other skinnable components:
4991
 
     *
4992
 
     *      skin: {
4993
 
     *          // The default skin, which is automatically applied if not
4994
 
     *          // overriden by a component-specific skin definition.
4995
 
     *          // Change this in to apply a different skin globally
4996
 
     *          defaultSkin: 'sam',
4997
 
     *
4998
 
     *          // This is combined with the loader base property to get
4999
 
     *          // the default root directory for a skin. ex:
5000
 
     *          // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/
5001
 
     *          base: 'assets/skins/',
5002
 
     *          
5003
 
     *          // Any component-specific overrides can be specified here,
5004
 
     *          // making it possible to load different skins for different
5005
 
     *          // components.  It is possible to load more than one skin
5006
 
     *          // for a given component as well.
5007
 
     *          overrides: {
5008
 
     *              calendar: ['skin1', 'skin2']
5009
 
     *          }
5010
 
     *      }
5011
 
     * @property skin
5012
 
     * @type {Object}
5013
 
     */
5014
 
    self.skin = Y.merge(Y.Env.meta.skin);
5015
 
 
5016
 
    /*
5017
 
     * Map of conditional modules
5018
 
     * @since 3.2.0
5019
 
     */
5020
 
    self.conditions = {};
5021
 
 
5022
 
    // map of modules with a hash of modules that meet the requirement
5023
 
    // self.provides = {};
5024
 
 
5025
 
    self.config = o;
5026
 
    self._internal = true;
5027
 
 
5028
 
 
5029
 
    cache = GLOBAL_ENV._renderedMods;
5030
 
 
5031
 
    if (cache) {
5032
 
        oeach(cache, function modCache(v, k) {
5033
 
            self.moduleInfo[k] = Y.merge(v);
5034
 
        });
5035
 
 
5036
 
        cache = GLOBAL_ENV._conditions;
5037
 
 
5038
 
        oeach(cache, function condCache(v, k) {
5039
 
            self.conditions[k] = Y.merge(v);
5040
 
        });
5041
 
 
5042
 
    } else {
5043
 
        oeach(defaults, self.addModule, self);
5044
 
    }
5045
 
 
5046
 
 
5047
 
    /**
5048
 
     * Set when beginning to compute the dependency tree.
5049
 
     * Composed of what YUI reports to be loaded combined
5050
 
     * with what has been loaded by any instance on the page
5051
 
     * with the version number specified in the metadata.
5052
 
     * @property loaded
5053
 
     * @type {string: boolean}
5054
 
     */
5055
 
    self.loaded = GLOBAL_LOADED[VERSION];
5056
 
 
5057
 
 
5058
 
    self._inspectPage();
5059
 
 
5060
 
    self._internal = false;
5061
 
 
5062
 
    self._config(o);
5063
 
 
5064
 
    self.forceMap = (self.force) ? Y.Array.hash(self.force) : {};       
5065
 
 
5066
 
    self.testresults = null;
5067
 
 
5068
 
    if (Y.config.tests) {
5069
 
        self.testresults = Y.config.tests;
5070
 
    }
5071
 
 
5072
 
    /**
5073
 
     * List of rollup files found in the library metadata
5074
 
     * @property rollups
5075
 
     */
5076
 
    // self.rollups = null;
5077
 
 
5078
 
    /**
5079
 
     * Whether or not to load optional dependencies for
5080
 
     * the requested modules
5081
 
     * @property loadOptional
5082
 
     * @type boolean
5083
 
     * @default false
5084
 
     */
5085
 
    // self.loadOptional = false;
5086
 
 
5087
 
    /**
5088
 
     * All of the derived dependencies in sorted order, which
5089
 
     * will be populated when either calculate() or insert()
5090
 
     * is called
5091
 
     * @property sorted
5092
 
     * @type string[]
5093
 
     */
5094
 
    self.sorted = [];
5095
 
 
5096
 
    /*
5097
 
     * A list of modules to attach to the YUI instance when complete.
5098
 
     * If not supplied, the sorted list of dependencies are applied.
5099
 
     * @property attaching
5100
 
     */
5101
 
    // self.attaching = null;
5102
 
 
5103
 
    /**
5104
 
     * Flag to indicate the dependency tree needs to be recomputed
5105
 
     * if insert is called again.
5106
 
     * @property dirty
5107
 
     * @type boolean
5108
 
     * @default true
5109
 
     */
5110
 
    self.dirty = true;
5111
 
 
5112
 
    /**
5113
 
     * List of modules inserted by the utility
5114
 
     * @property inserted
5115
 
     * @type {string: boolean}
5116
 
     */
5117
 
    self.inserted = {};
5118
 
 
5119
 
    /**
5120
 
     * List of skipped modules during insert() because the module
5121
 
     * was not defined
5122
 
     * @property skipped
5123
 
     */
5124
 
    self.skipped = {};
5125
 
 
5126
 
    // Y.on('yui:load', self.loadNext, self);
5127
 
 
5128
 
    self.tested = {};
5129
 
 
5130
 
    /*
5131
 
     * Cached sorted calculate results
5132
 
     * @property results
5133
 
     * @since 3.2.0
5134
 
     */
5135
 
    //self.results = {};
5136
 
 
5137
 
};
5138
 
 
5139
 
Y.Loader.prototype = {
5140
 
    /**
5141
 
    Regex that matches a CSS URL. Used to guess the file type when it's not
5142
 
    specified.
5143
 
 
5144
 
    @property REGEX_CSS
5145
 
    @type RegExp
5146
 
    @final
5147
 
    @protected
5148
 
    @since 3.5.0
5149
 
    **/
5150
 
    REGEX_CSS: /\.css(?:[?;].*)?$/i,
5151
 
    
5152
 
    /**
5153
 
    * Default filters for raw and debug
5154
 
    * @property FILTER_DEFS
5155
 
    * @type Object
5156
 
    * @final
5157
 
    * @protected
5158
 
    */
5159
 
    FILTER_DEFS: {
5160
 
        RAW: {
5161
 
            'searchExp': '-min\\.js',
5162
 
            'replaceStr': '.js'
5163
 
        },
5164
 
        DEBUG: {
5165
 
            'searchExp': '-min\\.js',
5166
 
            'replaceStr': '-debug.js'
5167
 
        }
5168
 
    },
5169
 
    /*
5170
 
    * Check the pages meta-data and cache the result.
5171
 
    * @method _inspectPage
5172
 
    * @private
5173
 
    */
5174
 
    _inspectPage: function() {
5175
 
        
5176
 
        //Inspect the page for CSS only modules and mark them as loaded.
5177
 
        oeach(this.moduleInfo, function(v, k) {
5178
 
            if (v.type && v.type === CSS) {
5179
 
                if (this.isCSSLoaded(v.name)) {
5180
 
                    Y.log('Found CSS module on page: ' + v.name, 'info', 'loader');
5181
 
                    this.loaded[k] = true;
5182
 
                }
5183
 
            }
5184
 
        }, this);
5185
 
        
5186
 
        oeach(ON_PAGE, function(v, k) {
5187
 
           if (v.details) {
5188
 
               var m = this.moduleInfo[k],
5189
 
                   req = v.details.requires,
5190
 
                   mr = m && m.requires;
5191
 
               if (m) {
5192
 
                   if (!m._inspected && req && mr.length != req.length) {
5193
 
                       // console.log('deleting ' + m.name);
5194
 
                       delete m.expanded;
5195
 
                   }
5196
 
               } else {
5197
 
                   m = this.addModule(v.details, k);
5198
 
               }
5199
 
               m._inspected = true;
5200
 
           }
5201
 
       }, this);
5202
 
    },
5203
 
    /*
5204
 
    * returns true if b is not loaded, and is required directly or by means of modules it supersedes.
5205
 
    * @private
5206
 
    * @method _requires
5207
 
    * @param {String} mod1 The first module to compare
5208
 
    * @param {String} mod2 The second module to compare
5209
 
    */
5210
 
   _requires: function(mod1, mod2) {
5211
 
 
5212
 
        var i, rm, after_map, s,
5213
 
            info = this.moduleInfo,
5214
 
            m = info[mod1],
5215
 
            other = info[mod2];
5216
 
 
5217
 
        if (!m || !other) {
5218
 
            return false;
5219
 
        }
5220
 
 
5221
 
        rm = m.expanded_map;
5222
 
        after_map = m.after_map;
5223
 
 
5224
 
        // check if this module should be sorted after the other
5225
 
        // do this first to short circut circular deps
5226
 
        if (after_map && (mod2 in after_map)) {
5227
 
            return true;
5228
 
        }
5229
 
 
5230
 
        after_map = other.after_map;
5231
 
 
5232
 
        // and vis-versa
5233
 
        if (after_map && (mod1 in after_map)) {
5234
 
            return false;
5235
 
        }
5236
 
 
5237
 
        // check if this module requires one the other supersedes
5238
 
        s = info[mod2] && info[mod2].supersedes;
5239
 
        if (s) {
5240
 
            for (i = 0; i < s.length; i++) {
5241
 
                if (this._requires(mod1, s[i])) {
5242
 
                    return true;
5243
 
                }
5244
 
            }
5245
 
        }
5246
 
 
5247
 
        s = info[mod1] && info[mod1].supersedes;
5248
 
        if (s) {
5249
 
            for (i = 0; i < s.length; i++) {
5250
 
                if (this._requires(mod2, s[i])) {
5251
 
                    return false;
5252
 
                }
5253
 
            }
5254
 
        }
5255
 
 
5256
 
        // check if this module requires the other directly
5257
 
        // if (r && YArray.indexOf(r, mod2) > -1) {
5258
 
        if (rm && (mod2 in rm)) {
5259
 
            return true;
5260
 
        }
5261
 
 
5262
 
        // external css files should be sorted below yui css
5263
 
        if (m.ext && m.type == CSS && !other.ext && other.type == CSS) {
5264
 
            return true;
5265
 
        }
5266
 
 
5267
 
        return false;
5268
 
    },
5269
 
    /**
5270
 
    * Apply a new config to the Loader instance
5271
 
    * @method _config
5272
 
    * @private
5273
 
    * @param {Object} o The new configuration
5274
 
    */
5275
 
    _config: function(o) {
5276
 
        var i, j, val, f, group, groupName, self = this;
5277
 
        // apply config values
5278
 
        if (o) {
5279
 
            for (i in o) {
5280
 
                if (o.hasOwnProperty(i)) {
5281
 
                    val = o[i];
5282
 
                    if (i == 'require') {
5283
 
                        self.require(val);
5284
 
                    } else if (i == 'skin') {
5285
 
                        //If the config.skin is a string, format to the expected object
5286
 
                        if (typeof val === 'string') {
5287
 
                            self.skin.defaultSkin = o.skin;
5288
 
                            val = {
5289
 
                                defaultSkin: val
5290
 
                            };
5291
 
                        }
5292
 
 
5293
 
                        Y.mix(self.skin, val, true);
5294
 
                    } else if (i == 'groups') {
5295
 
                        for (j in val) {
5296
 
                            if (val.hasOwnProperty(j)) {
5297
 
                                // Y.log('group: ' + j);
5298
 
                                groupName = j;
5299
 
                                group = val[j];
5300
 
                                self.addGroup(group, groupName);
5301
 
                                if (group.aliases) {
5302
 
                                    oeach(group.aliases, self.addAlias, self);
5303
 
                                }
5304
 
                            }
5305
 
                        }
5306
 
 
5307
 
                    } else if (i == 'modules') {
5308
 
                        // add a hash of module definitions
5309
 
                        oeach(val, self.addModule, self);
5310
 
                    } else if (i === 'aliases') {
5311
 
                        oeach(val, self.addAlias, self);
5312
 
                    } else if (i == 'gallery') {
5313
 
                        this.groups.gallery.update(val, o);
5314
 
                    } else if (i == 'yui2' || i == '2in3') {
5315
 
                        this.groups.yui2.update(o['2in3'], o.yui2, o);
5316
 
                    } else {
5317
 
                        self[i] = val;
5318
 
                    }
5319
 
                }
5320
 
            }
5321
 
        }
5322
 
 
5323
 
        // fix filter
5324
 
        f = self.filter;
5325
 
 
5326
 
        if (L.isString(f)) {
5327
 
            f = f.toUpperCase();
5328
 
            self.filterName = f;
5329
 
            self.filter = self.FILTER_DEFS[f];
5330
 
            if (f == 'DEBUG') {
5331
 
                self.require('yui-log', 'dump');
5332
 
            }
5333
 
        }
5334
 
        
5335
 
 
5336
 
        if (self.lang) {
5337
 
            //Removed this so that when Loader is invoked
5338
 
            //it doesn't request what it doesn't need.
5339
 
            //self.require('intl-base', 'intl');
5340
 
        }
5341
 
 
5342
 
    },
5343
 
 
5344
 
    /**
5345
 
     * Returns the skin module name for the specified skin name.  If a
5346
 
     * module name is supplied, the returned skin module name is
5347
 
     * specific to the module passed in.
5348
 
     * @method formatSkin
5349
 
     * @param {string} skin the name of the skin.
5350
 
     * @param {string} mod optional: the name of a module to skin.
5351
 
     * @return {string} the full skin module name.
5352
 
     */
5353
 
    formatSkin: function(skin, mod) {
5354
 
        var s = SKIN_PREFIX + skin;
5355
 
        if (mod) {
5356
 
            s = s + '-' + mod;
5357
 
        }
5358
 
 
5359
 
        return s;
5360
 
    },
5361
 
 
5362
 
    /**
5363
 
     * Adds the skin def to the module info
5364
 
     * @method _addSkin
5365
 
     * @param {string} skin the name of the skin.
5366
 
     * @param {string} mod the name of the module.
5367
 
     * @param {string} parent parent module if this is a skin of a
5368
 
     * submodule or plugin.
5369
 
     * @return {string} the module name for the skin.
5370
 
     * @private
5371
 
     */
5372
 
    _addSkin: function(skin, mod, parent) {
5373
 
        var mdef, pkg, name, nmod,
5374
 
            info = this.moduleInfo,
5375
 
            sinf = this.skin,
5376
 
            ext = info[mod] && info[mod].ext;
5377
 
 
5378
 
        // Add a module definition for the module-specific skin css
5379
 
        if (mod) {
5380
 
            name = this.formatSkin(skin, mod);
5381
 
            if (!info[name]) {
5382
 
                mdef = info[mod];
5383
 
                pkg = mdef.pkg || mod;
5384
 
                nmod = {
5385
 
                    name: name,
5386
 
                    group: mdef.group,
5387
 
                    type: 'css',
5388
 
                    after: sinf.after,
5389
 
                    path: (parent || pkg) + '/' + sinf.base + skin +
5390
 
                          '/' + mod + '.css',
5391
 
                    ext: ext
5392
 
                };
5393
 
                if (mdef.base) {
5394
 
                    nmod.base = mdef.base;
5395
 
                }
5396
 
                if (mdef.configFn) {
5397
 
                    nmod.configFn = mdef.configFn;
5398
 
                }
5399
 
                this.addModule(nmod, name);
5400
 
 
5401
 
                Y.log('Adding skin (' + name + '), ' + parent + ', ' + pkg + ', ' + info[name].path, 'info', 'loader');
5402
 
            }
5403
 
        }
5404
 
 
5405
 
        return name;
5406
 
    },
5407
 
    /**
5408
 
    * Adds an alias module to the system
5409
 
    * @method addAlias
5410
 
    * @param {Array} use An array of modules that makes up this alias
5411
 
    * @param {String} name The name of the alias
5412
 
    * @example
5413
 
    *       var loader = new Y.Loader({});
5414
 
    *       loader.addAlias([ 'node', 'yql' ], 'davglass');
5415
 
    *       loader.require(['davglass']);
5416
 
    *       var out = loader.resolve(true);
5417
 
    *
5418
 
    *       //out.js will contain Node and YQL modules
5419
 
    */
5420
 
    addAlias: function(use, name) {
5421
 
        YUI.Env.aliases[name] = use;
5422
 
        this.addModule({
5423
 
            name: name,
5424
 
            use: use
5425
 
        });
5426
 
    },
5427
 
    /**
5428
 
     * Add a new module group
5429
 
     * @method addGroup
5430
 
     * @param {Object} config An object containing the group configuration data
5431
 
     * @param {String} config.name required, the group name
5432
 
     * @param {String} config.base The base directory for this module group
5433
 
     * @param {String} config.root The root path to add to each combo resource path
5434
 
     * @param {Boolean} config.combine Should the request be combined
5435
 
     * @param {String} config.comboBase Combo service base path
5436
 
     * @param {Object} config.modules The group of modules
5437
 
     * @param {String} name the group name.
5438
 
     * @example
5439
 
     *      var loader = new Y.Loader({});
5440
 
     *      loader.addGroup({
5441
 
     *          name: 'davglass',
5442
 
     *          combine: true,
5443
 
     *          comboBase: '/combo?',
5444
 
     *          root: '',
5445
 
     *          modules: {
5446
 
     *              //Module List here
5447
 
     *          }
5448
 
     *      }, 'davglass');
5449
 
     */
5450
 
    addGroup: function(o, name) {
5451
 
        var mods = o.modules,
5452
 
            self = this;
5453
 
        name = name || o.name;
5454
 
        o.name = name;
5455
 
        self.groups[name] = o;
5456
 
 
5457
 
        if (o.patterns) {
5458
 
            oeach(o.patterns, function(v, k) {
5459
 
                v.group = name;
5460
 
                self.patterns[k] = v;
5461
 
            });
5462
 
        }
5463
 
 
5464
 
        if (mods) {
5465
 
            oeach(mods, function(v, k) {
5466
 
                if (typeof v === 'string') {
5467
 
                    v = { name: k, fullpath: v };
5468
 
                }
5469
 
                v.group = name;
5470
 
                self.addModule(v, k);
5471
 
            }, self);
5472
 
        }
5473
 
    },
5474
 
 
5475
 
    /**
5476
 
     * Add a new module to the component metadata.
5477
 
     * @method addModule
5478
 
     * @param {Object} config An object containing the module data.
5479
 
     * @param {String} config.name Required, the component name
5480
 
     * @param {String} config.type Required, the component type (js or css)
5481
 
     * @param {String} config.path Required, the path to the script from `base`
5482
 
     * @param {Array} config.requires Array of modules required by this component
5483
 
     * @param {Array} [config.optional] Array of optional modules for this component
5484
 
     * @param {Array} [config.supersedes] Array of the modules this component replaces
5485
 
     * @param {Array} [config.after] Array of modules the components which, if present, should be sorted above this one
5486
 
     * @param {Object} [config.after_map] Faster alternative to 'after' -- supply a hash instead of an array
5487
 
     * @param {Number} [config.rollup] The number of superseded modules required for automatic rollup
5488
 
     * @param {String} [config.fullpath] If `fullpath` is specified, this is used instead of the configured `base + path`
5489
 
     * @param {Boolean} [config.skinnable] Flag to determine if skin assets should automatically be pulled in
5490
 
     * @param {Object} [config.submodules] Hash of submodules
5491
 
     * @param {String} [config.group] The group the module belongs to -- this is set automatically when it is added as part of a group configuration.
5492
 
     * @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"]`
5493
 
     * @param {Object} [config.condition] Specifies that the module should be loaded automatically if a condition is met.  This is an object with up to three fields:
5494
 
     * @param {String} [config.condition.trigger] The name of a module that can trigger the auto-load
5495
 
     * @param {Function} [config.condition.test] A function that returns true when the module is to be loaded.
5496
 
     * @param {String} [config.condition.when] Specifies the load order of the conditional module
5497
 
     *  with regard to the position of the trigger module.
5498
 
     *  This should be one of three values: `before`, `after`, or `instead`.  The default is `after`.
5499
 
     * @param {Object} [config.testresults] A hash of test results from `Y.Features.all()`
5500
 
     * @param {Function} [config.configFn] A function to exectute when configuring this module
5501
 
     * @param {Object} config.configFn.mod The module config, modifying this object will modify it's config. Returning false will delete the module's config.
5502
 
     * @param {String} [name] The module name, required if not in the module data.
5503
 
     * @return {Object} the module definition or null if the object passed in did not provide all required attributes.
5504
 
     */
5505
 
    addModule: function(o, name) {
5506
 
        name = name || o.name;
5507
 
 
5508
 
        if (typeof o === 'string') {
5509
 
            o = { name: name, fullpath: o };
5510
 
        }
5511
 
        
5512
 
        //Only merge this data if the temp flag is set
5513
 
        //from an earlier pass from a pattern or else
5514
 
        //an override module (YUI_config) can not be used to
5515
 
        //replace a default module.
5516
 
        if (this.moduleInfo[name] && this.moduleInfo[name].temp) {
5517
 
            //This catches temp modules loaded via a pattern
5518
 
            // The module will be added twice, once from the pattern and
5519
 
            // Once from the actual add call, this ensures that properties
5520
 
            // that were added to the module the first time around (group: gallery)
5521
 
            // are also added the second time around too.
5522
 
            o = Y.merge(this.moduleInfo[name], o);
5523
 
        }
5524
 
 
5525
 
        o.name = name;
5526
 
 
5527
 
        if (!o || !o.name) {
5528
 
            return null;
5529
 
        }
5530
 
 
5531
 
        if (!o.type) {
5532
 
            //Always assume it's javascript unless the CSS pattern is matched.
5533
 
            o.type = JS;
5534
 
            var p = o.path || o.fullpath;
5535
 
            if (p && this.REGEX_CSS.test(p)) {
5536
 
                Y.log('Auto determined module type as CSS', 'warn', 'loader');
5537
 
                o.type = CSS;
5538
 
            }
5539
 
        }
5540
 
 
5541
 
        if (!o.path && !o.fullpath) {
5542
 
            o.path = _path(name, name, o.type);
5543
 
        }
5544
 
        o.supersedes = o.supersedes || o.use;
5545
 
 
5546
 
        o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true;
5547
 
 
5548
 
        // Handle submodule logic
5549
 
        var subs = o.submodules, i, l, t, sup, s, smod, plugins, plug,
5550
 
            j, langs, packName, supName, flatSup, flatLang, lang, ret,
5551
 
            overrides, skinname, when,
5552
 
            conditions = this.conditions, trigger;
5553
 
            // , existing = this.moduleInfo[name], newr;
5554
 
        
5555
 
        this.moduleInfo[name] = o;
5556
 
 
5557
 
        o.requires = o.requires || [];
5558
 
 
5559
 
        if (o.skinnable) {
5560
 
            skinname = this._addSkin(this.skin.defaultSkin, name);
5561
 
            o.requires.unshift(skinname);
5562
 
        }
5563
 
 
5564
 
        o.requires = this.filterRequires(o.requires) || [];
5565
 
 
5566
 
        if (!o.langPack && o.lang) {
5567
 
            langs = YArray(o.lang);
5568
 
            for (j = 0; j < langs.length; j++) {
5569
 
                lang = langs[j];
5570
 
                packName = this.getLangPackName(lang, name);
5571
 
                smod = this.moduleInfo[packName];
5572
 
                if (!smod) {
5573
 
                    smod = this._addLangPack(lang, o, packName);
5574
 
                }
5575
 
            }
5576
 
        }
5577
 
 
5578
 
 
5579
 
        if (subs) {
5580
 
            sup = o.supersedes || [];
5581
 
            l = 0;
5582
 
 
5583
 
            for (i in subs) {
5584
 
                if (subs.hasOwnProperty(i)) {
5585
 
                    s = subs[i];
5586
 
 
5587
 
                    s.path = s.path || _path(name, i, o.type);
5588
 
                    s.pkg = name;
5589
 
                    s.group = o.group;
5590
 
 
5591
 
                    if (s.supersedes) {
5592
 
                        sup = sup.concat(s.supersedes);
5593
 
                    }
5594
 
 
5595
 
                    smod = this.addModule(s, i);
5596
 
                    sup.push(i);
5597
 
 
5598
 
                    if (smod.skinnable) {
5599
 
                        o.skinnable = true;
5600
 
                        overrides = this.skin.overrides;
5601
 
                        if (overrides && overrides[i]) {
5602
 
                            for (j = 0; j < overrides[i].length; j++) {
5603
 
                                skinname = this._addSkin(overrides[i][j],
5604
 
                                         i, name);
5605
 
                                sup.push(skinname);
5606
 
                            }
5607
 
                        }
5608
 
                        skinname = this._addSkin(this.skin.defaultSkin,
5609
 
                                        i, name);
5610
 
                        sup.push(skinname);
5611
 
                    }
5612
 
 
5613
 
                    // looks like we are expected to work out the metadata
5614
 
                    // for the parent module language packs from what is
5615
 
                    // specified in the child modules.
5616
 
                    if (s.lang && s.lang.length) {
5617
 
 
5618
 
                        langs = YArray(s.lang);
5619
 
                        for (j = 0; j < langs.length; j++) {
5620
 
                            lang = langs[j];
5621
 
                            packName = this.getLangPackName(lang, name);
5622
 
                            supName = this.getLangPackName(lang, i);
5623
 
                            smod = this.moduleInfo[packName];
5624
 
 
5625
 
                            if (!smod) {
5626
 
                                smod = this._addLangPack(lang, o, packName);
5627
 
                            }
5628
 
 
5629
 
                            flatSup = flatSup || YArray.hash(smod.supersedes);
5630
 
 
5631
 
                            if (!(supName in flatSup)) {
5632
 
                                smod.supersedes.push(supName);
5633
 
                            }
5634
 
 
5635
 
                            o.lang = o.lang || [];
5636
 
 
5637
 
                            flatLang = flatLang || YArray.hash(o.lang);
5638
 
 
5639
 
                            if (!(lang in flatLang)) {
5640
 
                                o.lang.push(lang);
5641
 
                            }
5642
 
 
5643
 
// Y.log('pack ' + packName + ' should supersede ' + supName);
5644
 
// Add rollup file, need to add to supersedes list too
5645
 
 
5646
 
                            // default packages
5647
 
                            packName = this.getLangPackName(ROOT_LANG, name);
5648
 
                            supName = this.getLangPackName(ROOT_LANG, i);
5649
 
 
5650
 
                            smod = this.moduleInfo[packName];
5651
 
 
5652
 
                            if (!smod) {
5653
 
                                smod = this._addLangPack(lang, o, packName);
5654
 
                            }
5655
 
 
5656
 
                            if (!(supName in flatSup)) {
5657
 
                                smod.supersedes.push(supName);
5658
 
                            }
5659
 
 
5660
 
// Y.log('pack ' + packName + ' should supersede ' + supName);
5661
 
// Add rollup file, need to add to supersedes list too
5662
 
 
5663
 
                        }
5664
 
                    }
5665
 
 
5666
 
                    l++;
5667
 
                }
5668
 
            }
5669
 
            //o.supersedes = YObject.keys(YArray.hash(sup));
5670
 
            o.supersedes = YArray.dedupe(sup);
5671
 
            if (this.allowRollup) {
5672
 
                o.rollup = (l < 4) ? l : Math.min(l - 1, 4);
5673
 
            }
5674
 
        }
5675
 
 
5676
 
        plugins = o.plugins;
5677
 
        if (plugins) {
5678
 
            for (i in plugins) {
5679
 
                if (plugins.hasOwnProperty(i)) {
5680
 
                    plug = plugins[i];
5681
 
                    plug.pkg = name;
5682
 
                    plug.path = plug.path || _path(name, i, o.type);
5683
 
                    plug.requires = plug.requires || [];
5684
 
                    plug.group = o.group;
5685
 
                    this.addModule(plug, i);
5686
 
                    if (o.skinnable) {
5687
 
                        this._addSkin(this.skin.defaultSkin, i, name);
5688
 
                    }
5689
 
 
5690
 
                }
5691
 
            }
5692
 
        }
5693
 
 
5694
 
        if (o.condition) {
5695
 
            t = o.condition.trigger;
5696
 
            if (YUI.Env.aliases[t]) {
5697
 
                t = YUI.Env.aliases[t];
5698
 
            }
5699
 
            if (!Y.Lang.isArray(t)) {
5700
 
                t = [t];
5701
 
            }
5702
 
 
5703
 
            for (i = 0; i < t.length; i++) {
5704
 
                trigger = t[i];
5705
 
                when = o.condition.when;
5706
 
                conditions[trigger] = conditions[trigger] || {};
5707
 
                conditions[trigger][name] = o.condition;
5708
 
                // the 'when' attribute can be 'before', 'after', or 'instead'
5709
 
                // the default is after.
5710
 
                if (when && when != 'after') {
5711
 
                    if (when == 'instead') { // replace the trigger
5712
 
                        o.supersedes = o.supersedes || [];
5713
 
                        o.supersedes.push(trigger);
5714
 
                    } else { // before the trigger
5715
 
                        // the trigger requires the conditional mod,
5716
 
                        // so it should appear before the conditional
5717
 
                        // mod if we do not intersede.
5718
 
                    }
5719
 
                } else { // after the trigger
5720
 
                    o.after = o.after || [];
5721
 
                    o.after.push(trigger);
5722
 
                }
5723
 
            }
5724
 
        }
5725
 
 
5726
 
        if (o.supersedes) {
5727
 
            o.supersedes = this.filterRequires(o.supersedes);
5728
 
        }
5729
 
 
5730
 
        if (o.after) {
5731
 
            o.after = this.filterRequires(o.after);
5732
 
            o.after_map = YArray.hash(o.after);
5733
 
        }
5734
 
 
5735
 
        // this.dirty = true;
5736
 
 
5737
 
        if (o.configFn) {
5738
 
            ret = o.configFn(o);
5739
 
            if (ret === false) {
5740
 
                Y.log('Config function returned false for ' + name + ', skipping.', 'info', 'loader');
5741
 
                delete this.moduleInfo[name];
5742
 
                delete GLOBAL_ENV._renderedMods[name];
5743
 
                o = null;
5744
 
            }
5745
 
        }
5746
 
        //Add to global cache
5747
 
        if (o) {
5748
 
            if (!GLOBAL_ENV._renderedMods) {
5749
 
                GLOBAL_ENV._renderedMods = {};
5750
 
            }
5751
 
            GLOBAL_ENV._renderedMods[name] = Y.merge(o);
5752
 
            GLOBAL_ENV._conditions = conditions;
5753
 
        }
5754
 
 
5755
 
        return o;
5756
 
    },
5757
 
 
5758
 
    /**
5759
 
     * Add a requirement for one or more module
5760
 
     * @method require
5761
 
     * @param {string[] | string*} what the modules to load.
5762
 
     */
5763
 
    require: function(what) {
5764
 
        var a = (typeof what === 'string') ? YArray(arguments) : what;
5765
 
        this.dirty = true;
5766
 
        this.required = Y.merge(this.required, YArray.hash(this.filterRequires(a)));
5767
 
 
5768
 
        this._explodeRollups();
5769
 
    },
5770
 
    /**
5771
 
    * Grab all the items that were asked for, check to see if the Loader
5772
 
    * meta-data contains a "use" array. If it doesm remove the asked item and replace it with 
5773
 
    * the content of the "use".
5774
 
    * This will make asking for: "dd"
5775
 
    * Actually ask for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin"
5776
 
    * @private
5777
 
    * @method _explodeRollups
5778
 
    */
5779
 
    _explodeRollups: function() {
5780
 
        var self = this, m,
5781
 
        r = self.required;
5782
 
        if (!self.allowRollup) {
5783
 
            oeach(r, function(v, name) {
5784
 
                m = self.getModule(name);
5785
 
                if (m && m.use) {
5786
 
                    //delete r[name];
5787
 
                    YArray.each(m.use, function(v) {
5788
 
                        m = self.getModule(v);
5789
 
                        if (m && m.use) {
5790
 
                            //delete r[v];
5791
 
                            YArray.each(m.use, function(v) {
5792
 
                                r[v] = true;
5793
 
                            });
5794
 
                        } else {
5795
 
                            r[v] = true;
5796
 
                        }
5797
 
                    });
5798
 
                }
5799
 
            });
5800
 
            self.required = r;
5801
 
        }
5802
 
 
5803
 
    },
5804
 
    /**
5805
 
    * Explodes the required array to remove aliases and replace them with real modules
5806
 
    * @method filterRequires
5807
 
    * @param {Array} r The original requires array
5808
 
    * @return {Array} The new array of exploded requirements
5809
 
    */
5810
 
    filterRequires: function(r) {
5811
 
        if (r) {
5812
 
            if (!Y.Lang.isArray(r)) {
5813
 
                r = [r];
5814
 
            }
5815
 
            r = Y.Array(r);
5816
 
            var c = [], i, mod, o, m;
5817
 
 
5818
 
            for (i = 0; i < r.length; i++) {
5819
 
                mod = this.getModule(r[i]);
5820
 
                if (mod && mod.use) {
5821
 
                    for (o = 0; o < mod.use.length; o++) {
5822
 
                        //Must walk the other modules in case a module is a rollup of rollups (datatype)
5823
 
                        m = this.getModule(mod.use[o]);
5824
 
                        if (m && m.use) {
5825
 
                            c = Y.Array.dedupe([].concat(c, this.filterRequires(m.use)));
5826
 
                        } else {
5827
 
                            c.push(mod.use[o]);
5828
 
                        }
5829
 
                    }
5830
 
                } else {
5831
 
                    c.push(r[i]);
5832
 
                }
5833
 
            }
5834
 
            r = c;
5835
 
        }
5836
 
        return r;
5837
 
    },
5838
 
    /**
5839
 
     * Returns an object containing properties for all modules required
5840
 
     * in order to load the requested module
5841
 
     * @method getRequires
5842
 
     * @param {object}  mod The module definition from moduleInfo.
5843
 
     * @return {array} the expanded requirement list.
5844
 
     */
5845
 
    getRequires: function(mod) {
5846
 
 
5847
 
        if (!mod) {
5848
 
            //console.log('returning no reqs for ' + mod.name);
5849
 
            return NO_REQUIREMENTS;
5850
 
        }
5851
 
 
5852
 
        if (mod._parsed) {
5853
 
            //console.log('returning requires for ' + mod.name, mod.requires);
5854
 
            return mod.expanded || NO_REQUIREMENTS;
5855
 
        }
5856
 
 
5857
 
        //TODO add modue cache here out of scope..
5858
 
 
5859
 
        var i, m, j, add, packName, lang, testresults = this.testresults,
5860
 
            name = mod.name, cond,
5861
 
            adddef = ON_PAGE[name] && ON_PAGE[name].details,
5862
 
            d, k, m1,
5863
 
            r, old_mod,
5864
 
            o, skinmod, skindef, skinpar, skinname,
5865
 
            intl = mod.lang || mod.intl,
5866
 
            info = this.moduleInfo,
5867
 
            ftests = Y.Features && Y.Features.tests.load,
5868
 
            hash;
5869
 
 
5870
 
        // console.log(name);
5871
 
 
5872
 
        // pattern match leaves module stub that needs to be filled out
5873
 
        if (mod.temp && adddef) {
5874
 
            old_mod = mod;
5875
 
            mod = this.addModule(adddef, name);
5876
 
            mod.group = old_mod.group;
5877
 
            mod.pkg = old_mod.pkg;
5878
 
            delete mod.expanded;
5879
 
        }
5880
 
 
5881
 
        // console.log('cache: ' + mod.langCache + ' == ' + this.lang);
5882
 
 
5883
 
        // if (mod.expanded && (!mod.langCache || mod.langCache == this.lang)) {
5884
 
        if (mod.expanded && (!this.lang || mod.langCache === this.lang)) {
5885
 
            //Y.log('Already expanded ' + name + ', ' + mod.expanded);
5886
 
            return mod.expanded;
5887
 
        }
5888
 
        
5889
 
 
5890
 
        d = [];
5891
 
        hash = {};
5892
 
        r = this.filterRequires(mod.requires);
5893
 
        if (mod.lang) {
5894
 
            //If a module has a lang attribute, auto add the intl requirement.
5895
 
            d.unshift('intl');
5896
 
            r.unshift('intl');
5897
 
            intl = true;
5898
 
        }
5899
 
        o = this.filterRequires(mod.optional);
5900
 
 
5901
 
        // Y.log("getRequires: " + name + " (dirty:" + this.dirty +
5902
 
        // ", expanded:" + mod.expanded + ")");
5903
 
 
5904
 
        mod._parsed = true;
5905
 
        mod.langCache = this.lang;
5906
 
 
5907
 
        for (i = 0; i < r.length; i++) {
5908
 
            //Y.log(name + ' requiring ' + r[i], 'info', 'loader');
5909
 
            if (!hash[r[i]]) {
5910
 
                d.push(r[i]);
5911
 
                hash[r[i]] = true;
5912
 
                m = this.getModule(r[i]);
5913
 
                if (m) {
5914
 
                    add = this.getRequires(m);
5915
 
                    intl = intl || (m.expanded_map &&
5916
 
                        (INTL in m.expanded_map));
5917
 
                    for (j = 0; j < add.length; j++) {
5918
 
                        d.push(add[j]);
5919
 
                    }
5920
 
                }
5921
 
            }
5922
 
        }
5923
 
 
5924
 
        // get the requirements from superseded modules, if any
5925
 
        r = this.filterRequires(mod.supersedes);
5926
 
        if (r) {
5927
 
            for (i = 0; i < r.length; i++) {
5928
 
                if (!hash[r[i]]) {
5929
 
                    // if this module has submodules, the requirements list is
5930
 
                    // expanded to include the submodules.  This is so we can
5931
 
                    // prevent dups when a submodule is already loaded and the
5932
 
                    // parent is requested.
5933
 
                    if (mod.submodules) {
5934
 
                        d.push(r[i]);
5935
 
                    }
5936
 
 
5937
 
                    hash[r[i]] = true;
5938
 
                    m = this.getModule(r[i]);
5939
 
 
5940
 
                    if (m) {
5941
 
                        add = this.getRequires(m);
5942
 
                        intl = intl || (m.expanded_map &&
5943
 
                            (INTL in m.expanded_map));
5944
 
                        for (j = 0; j < add.length; j++) {
5945
 
                            d.push(add[j]);
5946
 
                        }
5947
 
                    }
5948
 
                }
5949
 
            }
5950
 
        }
5951
 
 
5952
 
        if (o && this.loadOptional) {
5953
 
            for (i = 0; i < o.length; i++) {
5954
 
                if (!hash[o[i]]) {
5955
 
                    d.push(o[i]);
5956
 
                    hash[o[i]] = true;
5957
 
                    m = info[o[i]];
5958
 
                    if (m) {
5959
 
                        add = this.getRequires(m);
5960
 
                        intl = intl || (m.expanded_map &&
5961
 
                            (INTL in m.expanded_map));
5962
 
                        for (j = 0; j < add.length; j++) {
5963
 
                            d.push(add[j]);
5964
 
                        }
5965
 
                    }
5966
 
                }
5967
 
            }
5968
 
        }
5969
 
 
5970
 
        cond = this.conditions[name];
5971
 
 
5972
 
        if (cond) {
5973
 
            //Set the module to not parsed since we have conditionals and this could change the dependency tree.
5974
 
            mod._parsed = false;
5975
 
            if (testresults && ftests) {
5976
 
                oeach(testresults, function(result, id) {
5977
 
                    var condmod = ftests[id].name;
5978
 
                    if (!hash[condmod] && ftests[id].trigger == name) {
5979
 
                        if (result && ftests[id]) {
5980
 
                            hash[condmod] = true;
5981
 
                            d.push(condmod);
5982
 
                        }
5983
 
                    }
5984
 
                });
5985
 
            } else {
5986
 
                oeach(cond, function(def, condmod) {
5987
 
                    if (!hash[condmod]) {
5988
 
                        //first see if they've specfied a ua check
5989
 
                        //then see if they've got a test fn & if it returns true
5990
 
                        //otherwise just having a condition block is enough
5991
 
                        var go = def && ((!def.ua && !def.test) || (def.ua && Y.UA[def.ua]) ||
5992
 
                                    (def.test && def.test(Y, r)));
5993
 
 
5994
 
                        if (go) {
5995
 
                            hash[condmod] = true;
5996
 
                            d.push(condmod);
5997
 
                            m = this.getModule(condmod);
5998
 
                            if (m) {
5999
 
                                add = this.getRequires(m);
6000
 
                                for (j = 0; j < add.length; j++) {
6001
 
                                    d.push(add[j]);
6002
 
                                }
6003
 
 
6004
 
                            }
6005
 
                        }
6006
 
                    }
6007
 
                }, this);
6008
 
            }
6009
 
        }
6010
 
 
6011
 
        // Create skin modules
6012
 
        if (mod.skinnable) {
6013
 
            skindef = this.skin.overrides;
6014
 
            oeach(YUI.Env.aliases, function(o, n) {
6015
 
                if (Y.Array.indexOf(o, name) > -1) {
6016
 
                    skinpar = n;
6017
 
                }
6018
 
            });
6019
 
            if (skindef && (skindef[name] || (skinpar && skindef[skinpar]))) {
6020
 
                skinname = name;
6021
 
                if (skindef[skinpar]) {
6022
 
                    skinname = skinpar;
6023
 
                }
6024
 
                for (i = 0; i < skindef[skinname].length; i++) {
6025
 
                    skinmod = this._addSkin(skindef[skinname][i], name);
6026
 
                    if (!this.isCSSLoaded(skinmod, this._boot)) {
6027
 
                        d.push(skinmod);
6028
 
                    }
6029
 
                }
6030
 
            } else {
6031
 
                skinmod = this._addSkin(this.skin.defaultSkin, name);
6032
 
                if (!this.isCSSLoaded(skinmod, this._boot)) {
6033
 
                    d.push(skinmod);
6034
 
                }
6035
 
            }
6036
 
        }
6037
 
 
6038
 
        mod._parsed = false;
6039
 
 
6040
 
        if (intl) {
6041
 
 
6042
 
            if (mod.lang && !mod.langPack && Y.Intl) {
6043
 
                lang = Y.Intl.lookupBestLang(this.lang || ROOT_LANG, mod.lang);
6044
 
                //Y.log('Best lang: ' + lang + ', this.lang: ' + this.lang + ', mod.lang: ' + mod.lang);
6045
 
                packName = this.getLangPackName(lang, name);
6046
 
                if (packName) {
6047
 
                    d.unshift(packName);
6048
 
                }
6049
 
            }
6050
 
            d.unshift(INTL);
6051
 
        }
6052
 
 
6053
 
        mod.expanded_map = YArray.hash(d);
6054
 
 
6055
 
        mod.expanded = YObject.keys(mod.expanded_map);
6056
 
 
6057
 
        return mod.expanded;
6058
 
    },
6059
 
    /**
6060
 
    * Check to see if named css module is already loaded on the page
6061
 
    * @method isCSSLoaded
6062
 
    * @param {String} name The name of the css file
6063
 
    * @return Boolean
6064
 
    */
6065
 
    isCSSLoaded: function(name, skip) {
6066
 
        //TODO - Make this call a batching call with name being an array
6067
 
        if (!name || !YUI.Env.cssStampEl || (!skip && this.ignoreRegistered)) {
6068
 
            Y.log('isCSSLoaded was skipped for ' + name, 'warn', 'loader');
6069
 
            return false;
6070
 
        }
6071
 
 
6072
 
        var el = YUI.Env.cssStampEl,
6073
 
            ret = false,
6074
 
            style = el.currentStyle; //IE
6075
 
 
6076
 
        //Add the classname to the element
6077
 
        el.className = name;
6078
 
 
6079
 
        if (!style) {
6080
 
            style = Y.config.doc.defaultView.getComputedStyle(el, null);
6081
 
        }
6082
 
 
6083
 
        if (style && style['display'] === 'none') {
6084
 
            ret = true;
6085
 
        }
6086
 
 
6087
 
        Y.log('Has Skin? ' + name + ' : ' + ret, 'info', 'loader');
6088
 
 
6089
 
        el.className = ''; //Reset the classname to ''
6090
 
        return ret;
6091
 
    },
6092
 
 
6093
 
    /**
6094
 
     * Returns a hash of module names the supplied module satisfies.
6095
 
     * @method getProvides
6096
 
     * @param {string} name The name of the module.
6097
 
     * @return {object} what this module provides.
6098
 
     */
6099
 
    getProvides: function(name) {
6100
 
        var m = this.getModule(name), o, s;
6101
 
            // supmap = this.provides;
6102
 
 
6103
 
        if (!m) {
6104
 
            return NOT_FOUND;
6105
 
        }
6106
 
 
6107
 
        if (m && !m.provides) {
6108
 
            o = {};
6109
 
            s = m.supersedes;
6110
 
 
6111
 
            if (s) {
6112
 
                YArray.each(s, function(v) {
6113
 
                    Y.mix(o, this.getProvides(v));
6114
 
                }, this);
6115
 
            }
6116
 
 
6117
 
            o[name] = true;
6118
 
            m.provides = o;
6119
 
 
6120
 
        }
6121
 
 
6122
 
        return m.provides;
6123
 
    },
6124
 
 
6125
 
    /**
6126
 
     * Calculates the dependency tree, the result is stored in the sorted
6127
 
     * property.
6128
 
     * @method calculate
6129
 
     * @param {object} o optional options object.
6130
 
     * @param {string} type optional argument to prune modules.
6131
 
     */
6132
 
    calculate: function(o, type) {
6133
 
        if (o || type || this.dirty) {
6134
 
 
6135
 
            if (o) {
6136
 
                this._config(o);
6137
 
            }
6138
 
 
6139
 
            if (!this._init) {
6140
 
                this._setup();
6141
 
            }
6142
 
 
6143
 
            this._explode();
6144
 
 
6145
 
            if (this.allowRollup) {
6146
 
                this._rollup();
6147
 
            } else {
6148
 
                this._explodeRollups();
6149
 
            }
6150
 
            this._reduce();
6151
 
            this._sort();
6152
 
        }
6153
 
    },
6154
 
    /**
6155
 
    * Creates a "psuedo" package for languages provided in the lang array
6156
 
    * @method _addLangPack
6157
 
    * @private
6158
 
    * @param {String} lang The language to create
6159
 
    * @param {Object} m The module definition to create the language pack around
6160
 
    * @param {String} packName The name of the package (e.g: lang/datatype-date-en-US)
6161
 
    * @return {Object} The module definition
6162
 
    */
6163
 
    _addLangPack: function(lang, m, packName) {
6164
 
        var name = m.name,
6165
 
            packPath, conf,
6166
 
            existing = this.moduleInfo[packName];
6167
 
 
6168
 
        if (!existing) {
6169
 
 
6170
 
            packPath = _path((m.pkg || name), packName, JS, true);
6171
 
 
6172
 
            conf = {
6173
 
                path: packPath,
6174
 
                intl: true,
6175
 
                langPack: true,
6176
 
                ext: m.ext,
6177
 
                group: m.group,
6178
 
                supersedes: []
6179
 
            };
6180
 
 
6181
 
            if (m.configFn) {
6182
 
                conf.configFn = m.configFn;
6183
 
            }
6184
 
 
6185
 
            this.addModule(conf, packName);
6186
 
 
6187
 
            if (lang) {
6188
 
                Y.Env.lang = Y.Env.lang || {};
6189
 
                Y.Env.lang[lang] = Y.Env.lang[lang] || {};
6190
 
                Y.Env.lang[lang][name] = true;
6191
 
            }
6192
 
        }
6193
 
 
6194
 
        return this.moduleInfo[packName];
6195
 
    },
6196
 
 
6197
 
    /**
6198
 
     * Investigates the current YUI configuration on the page.  By default,
6199
 
     * modules already detected will not be loaded again unless a force
6200
 
     * option is encountered.  Called by calculate()
6201
 
     * @method _setup
6202
 
     * @private
6203
 
     */
6204
 
    _setup: function() {
6205
 
        var info = this.moduleInfo, name, i, j, m, l,
6206
 
            packName;
6207
 
 
6208
 
        for (name in info) {
6209
 
            if (info.hasOwnProperty(name)) {
6210
 
                m = info[name];
6211
 
                if (m) {
6212
 
 
6213
 
                    // remove dups
6214
 
                    //m.requires = YObject.keys(YArray.hash(m.requires));
6215
 
                    m.requires = YArray.dedupe(m.requires);
6216
 
 
6217
 
                    // Create lang pack modules
6218
 
                    if (m.lang && m.lang.length) {
6219
 
                        // Setup root package if the module has lang defined,
6220
 
                        // it needs to provide a root language pack
6221
 
                        packName = this.getLangPackName(ROOT_LANG, name);
6222
 
                        this._addLangPack(null, m, packName);
6223
 
                    }
6224
 
 
6225
 
                }
6226
 
            }
6227
 
        }
6228
 
 
6229
 
 
6230
 
        //l = Y.merge(this.inserted);
6231
 
        l = {};
6232
 
 
6233
 
        // available modules
6234
 
        if (!this.ignoreRegistered) {
6235
 
            Y.mix(l, GLOBAL_ENV.mods);
6236
 
        }
6237
 
 
6238
 
        // add the ignore list to the list of loaded packages
6239
 
        if (this.ignore) {
6240
 
            Y.mix(l, YArray.hash(this.ignore));
6241
 
        }
6242
 
 
6243
 
        // expand the list to include superseded modules
6244
 
        for (j in l) {
6245
 
            if (l.hasOwnProperty(j)) {
6246
 
                Y.mix(l, this.getProvides(j));
6247
 
            }
6248
 
        }
6249
 
 
6250
 
        // remove modules on the force list from the loaded list
6251
 
        if (this.force) {
6252
 
            for (i = 0; i < this.force.length; i++) {
6253
 
                if (this.force[i] in l) {
6254
 
                    delete l[this.force[i]];
6255
 
                }
6256
 
            }
6257
 
        }
6258
 
 
6259
 
        Y.mix(this.loaded, l);
6260
 
 
6261
 
        this._init = true;
6262
 
    },
6263
 
 
6264
 
    /**
6265
 
     * Builds a module name for a language pack
6266
 
     * @method getLangPackName
6267
 
     * @param {string} lang the language code.
6268
 
     * @param {string} mname the module to build it for.
6269
 
     * @return {string} the language pack module name.
6270
 
     */
6271
 
    getLangPackName: function(lang, mname) {
6272
 
        return ('lang/' + mname + ((lang) ? '_' + lang : ''));
6273
 
    },
6274
 
    /**
6275
 
     * Inspects the required modules list looking for additional
6276
 
     * dependencies.  Expands the required list to include all
6277
 
     * required modules.  Called by calculate()
6278
 
     * @method _explode
6279
 
     * @private
6280
 
     */
6281
 
    _explode: function() {
6282
 
        //TODO Move done out of scope
6283
 
        var r = this.required, m, reqs, done = {},
6284
 
            self = this;
6285
 
 
6286
 
        // the setup phase is over, all modules have been created
6287
 
        self.dirty = false;
6288
 
 
6289
 
        self._explodeRollups();
6290
 
        r = self.required;
6291
 
        
6292
 
        oeach(r, function(v, name) {
6293
 
            if (!done[name]) {
6294
 
                done[name] = true;
6295
 
                m = self.getModule(name);
6296
 
                if (m) {
6297
 
                    var expound = m.expound;
6298
 
 
6299
 
                    if (expound) {
6300
 
                        r[expound] = self.getModule(expound);
6301
 
                        reqs = self.getRequires(r[expound]);
6302
 
                        Y.mix(r, YArray.hash(reqs));
6303
 
                    }
6304
 
 
6305
 
                    reqs = self.getRequires(m);
6306
 
                    Y.mix(r, YArray.hash(reqs));
6307
 
                }
6308
 
            }
6309
 
        });
6310
 
 
6311
 
        // Y.log('After explode: ' + YObject.keys(r));
6312
 
    },
6313
 
    /**
6314
 
    * Get's the loader meta data for the requested module
6315
 
    * @method getModule
6316
 
    * @param {String} mname The module name to get
6317
 
    * @return {Object} The module metadata
6318
 
    */
6319
 
    getModule: function(mname) {
6320
 
        //TODO: Remove name check - it's a quick hack to fix pattern WIP
6321
 
        if (!mname) {
6322
 
            return null;
6323
 
        }
6324
 
 
6325
 
        var p, found, pname,
6326
 
            m = this.moduleInfo[mname],
6327
 
            patterns = this.patterns;
6328
 
 
6329
 
        // check the patterns library to see if we should automatically add
6330
 
        // the module with defaults
6331
 
        if (!m) {
6332
 
           // Y.log('testing patterns ' + YObject.keys(patterns));
6333
 
            for (pname in patterns) {
6334
 
                if (patterns.hasOwnProperty(pname)) {
6335
 
                    // Y.log('testing pattern ' + i);
6336
 
                    p = patterns[pname];
6337
 
                    
6338
 
                    //There is no test method, create a default one that tests
6339
 
                    // the pattern against the mod name
6340
 
                    if (!p.test) {
6341
 
                        p.test = function(mname, pname) {
6342
 
                            return (mname.indexOf(pname) > -1);
6343
 
                        };
6344
 
                    }
6345
 
 
6346
 
                    if (p.test(mname, pname)) {
6347
 
                        // use the metadata supplied for the pattern
6348
 
                        // as the module definition.
6349
 
                        found = p;
6350
 
                        break;
6351
 
                    }
6352
 
                }
6353
 
            }
6354
 
 
6355
 
            if (found) {
6356
 
                if (p.action) {
6357
 
                    // Y.log('executing pattern action: ' + pname);
6358
 
                    p.action.call(this, mname, pname);
6359
 
                } else {
6360
 
Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
6361
 
    pname, 'info', 'loader');
6362
 
                    // ext true or false?
6363
 
                    m = this.addModule(Y.merge(found), mname);
6364
 
                    m.temp = true;
6365
 
                }
6366
 
            }
6367
 
        }
6368
 
 
6369
 
        return m;
6370
 
    },
6371
 
 
6372
 
    // impl in rollup submodule
6373
 
    _rollup: function() { },
6374
 
 
6375
 
    /**
6376
 
     * Remove superceded modules and loaded modules.  Called by
6377
 
     * calculate() after we have the mega list of all dependencies
6378
 
     * @method _reduce
6379
 
     * @return {object} the reduced dependency hash.
6380
 
     * @private
6381
 
     */
6382
 
    _reduce: function(r) {
6383
 
 
6384
 
        r = r || this.required;
6385
 
 
6386
 
        var i, j, s, m, type = this.loadType,
6387
 
        ignore = this.ignore ? YArray.hash(this.ignore) : false;
6388
 
 
6389
 
        for (i in r) {
6390
 
            if (r.hasOwnProperty(i)) {
6391
 
                m = this.getModule(i);
6392
 
                // remove if already loaded
6393
 
                if (((this.loaded[i] || ON_PAGE[i]) &&
6394
 
                        !this.forceMap[i] && !this.ignoreRegistered) ||
6395
 
                        (type && m && m.type != type)) {
6396
 
                    delete r[i];
6397
 
                }
6398
 
                if (ignore && ignore[i]) {
6399
 
                    delete r[i];
6400
 
                }
6401
 
                // remove anything this module supersedes
6402
 
                s = m && m.supersedes;
6403
 
                if (s) {
6404
 
                    for (j = 0; j < s.length; j++) {
6405
 
                        if (s[j] in r) {
6406
 
                            delete r[s[j]];
6407
 
                        }
6408
 
                    }
6409
 
                }
6410
 
            }
6411
 
        }
6412
 
 
6413
 
        return r;
6414
 
    },
6415
 
    /**
6416
 
    * Handles the queue when a module has been loaded for all cases
6417
 
    * @method _finish
6418
 
    * @private
6419
 
    * @param {String} msg The message from Loader
6420
 
    * @param {Boolean} success A boolean denoting success or failure
6421
 
    */
6422
 
    _finish: function(msg, success) {
6423
 
        Y.log('loader finishing: ' + msg + ', ' + Y.id + ', ' +
6424
 
            this.data, 'info', 'loader');
6425
 
 
6426
 
        _queue.running = false;
6427
 
 
6428
 
        var onEnd = this.onEnd;
6429
 
        if (onEnd) {
6430
 
            onEnd.call(this.context, {
6431
 
                msg: msg,
6432
 
                data: this.data,
6433
 
                success: success
6434
 
            });
6435
 
        }
6436
 
        this._continue();
6437
 
    },
6438
 
    /**
6439
 
    * The default Loader onSuccess handler, calls this.onSuccess with a payload
6440
 
    * @method _onSuccess
6441
 
    * @private
6442
 
    */
6443
 
    _onSuccess: function() {
6444
 
        var self = this, skipped = Y.merge(self.skipped), fn,
6445
 
            failed = [], rreg = self.requireRegistration,
6446
 
            success, msg;
6447
 
 
6448
 
        oeach(skipped, function(k) {
6449
 
            delete self.inserted[k];
6450
 
        });
6451
 
 
6452
 
        self.skipped = {};
6453
 
 
6454
 
        oeach(self.inserted, function(v, k) {
6455
 
            var mod = self.getModule(k);
6456
 
            if (mod && rreg && mod.type == JS && !(k in YUI.Env.mods)) {
6457
 
                failed.push(k);
6458
 
            } else {
6459
 
                Y.mix(self.loaded, self.getProvides(k));
6460
 
            }
6461
 
        });
6462
 
 
6463
 
        fn = self.onSuccess;
6464
 
        msg = (failed.length) ? 'notregistered' : 'success';
6465
 
        success = !(failed.length);
6466
 
        if (fn) {
6467
 
            fn.call(self.context, {
6468
 
                msg: msg,
6469
 
                data: self.data,
6470
 
                success: success,
6471
 
                failed: failed,
6472
 
                skipped: skipped
6473
 
            });
6474
 
        }
6475
 
        self._finish(msg, success);
6476
 
    },
6477
 
    /**
6478
 
    * The default Loader onProgress handler, calls this.onProgress with a payload
6479
 
    * @method _onProgress
6480
 
    * @private
6481
 
    */
6482
 
    _onProgress: function(e) {
6483
 
        var self = this;
6484
 
        if (self.onProgress) {
6485
 
            self.onProgress.call(self.context, {
6486
 
                name: e.url,
6487
 
                data: e.data
6488
 
            });
6489
 
        }
6490
 
    },
6491
 
    /**
6492
 
    * The default Loader onFailure handler, calls this.onFailure with a payload
6493
 
    * @method _onFailure
6494
 
    * @private
6495
 
    */
6496
 
    _onFailure: function(o) {
6497
 
        var f = this.onFailure, msg = [], i = 0, len = o.errors.length;
6498
 
        
6499
 
        for (i; i < len; i++) {
6500
 
            msg.push(o.errors[i].error);
6501
 
        }
6502
 
 
6503
 
        msg = msg.join(',');
6504
 
 
6505
 
        Y.log('load error: ' + msg + ', ' + Y.id, 'error', 'loader');
6506
 
        
6507
 
        if (f) {
6508
 
            f.call(this.context, {
6509
 
                msg: msg,
6510
 
                data: this.data,
6511
 
                success: false
6512
 
            });
6513
 
        }
6514
 
        
6515
 
        this._finish(msg, false);
6516
 
 
6517
 
    },
6518
 
 
6519
 
    /**
6520
 
    * The default Loader onTimeout handler, calls this.onTimeout with a payload
6521
 
    * @method _onTimeout
6522
 
    * @private
6523
 
    */
6524
 
    _onTimeout: function() {
6525
 
        Y.log('loader timeout: ' + Y.id, 'error', 'loader');
6526
 
        var f = this.onTimeout;
6527
 
        if (f) {
6528
 
            f.call(this.context, {
6529
 
                msg: 'timeout',
6530
 
                data: this.data,
6531
 
                success: false
6532
 
            });
6533
 
        }
6534
 
    },
6535
 
 
6536
 
    /**
6537
 
     * Sorts the dependency tree.  The last step of calculate()
6538
 
     * @method _sort
6539
 
     * @private
6540
 
     */
6541
 
    _sort: function() {
6542
 
 
6543
 
        // create an indexed list
6544
 
        var s = YObject.keys(this.required),
6545
 
            // loaded = this.loaded,
6546
 
            //TODO Move this out of scope
6547
 
            done = {},
6548
 
            p = 0, l, a, b, j, k, moved, doneKey;
6549
 
 
6550
 
        // keep going until we make a pass without moving anything
6551
 
        for (;;) {
6552
 
 
6553
 
            l = s.length;
6554
 
            moved = false;
6555
 
 
6556
 
            // start the loop after items that are already sorted
6557
 
            for (j = p; j < l; j++) {
6558
 
 
6559
 
                // check the next module on the list to see if its
6560
 
                // dependencies have been met
6561
 
                a = s[j];
6562
 
 
6563
 
                // check everything below current item and move if we
6564
 
                // find a requirement for the current item
6565
 
                for (k = j + 1; k < l; k++) {
6566
 
                    doneKey = a + s[k];
6567
 
 
6568
 
                    if (!done[doneKey] && this._requires(a, s[k])) {
6569
 
 
6570
 
                        // extract the dependency so we can move it up
6571
 
                        b = s.splice(k, 1);
6572
 
 
6573
 
                        // insert the dependency above the item that
6574
 
                        // requires it
6575
 
                        s.splice(j, 0, b[0]);
6576
 
 
6577
 
                        // only swap two dependencies once to short circut
6578
 
                        // circular dependencies
6579
 
                        done[doneKey] = true;
6580
 
 
6581
 
                        // keep working
6582
 
                        moved = true;
6583
 
 
6584
 
                        break;
6585
 
                    }
6586
 
                }
6587
 
 
6588
 
                // jump out of loop if we moved something
6589
 
                if (moved) {
6590
 
                    break;
6591
 
                // this item is sorted, move our pointer and keep going
6592
 
                } else {
6593
 
                    p++;
6594
 
                }
6595
 
            }
6596
 
 
6597
 
            // when we make it here and moved is false, we are
6598
 
            // finished sorting
6599
 
            if (!moved) {
6600
 
                break;
6601
 
            }
6602
 
 
6603
 
        }
6604
 
 
6605
 
        this.sorted = s;
6606
 
    },
6607
 
 
6608
 
    /**
6609
 
    * Handles the actual insertion of script/link tags
6610
 
    * @method _insert
6611
 
    * @private
6612
 
    * @param {Object} source The YUI instance the request came from
6613
 
    * @param {Object} o The metadata to include
6614
 
    * @param {String} type JS or CSS
6615
 
    * @param {Boolean} [skipcalc=false] Do a Loader.calculate on the meta
6616
 
    */
6617
 
    _insert: function(source, o, type, skipcalc) {
6618
 
 
6619
 
        Y.log('private _insert() ' + (type || '') + ', ' + Y.id, "info", "loader");
6620
 
 
6621
 
        // restore the state at the time of the request
6622
 
        if (source) {
6623
 
            this._config(source);
6624
 
        }
6625
 
 
6626
 
        // build the dependency list
6627
 
        // don't include type so we can process CSS and script in
6628
 
        // one pass when the type is not specified.
6629
 
        if (!skipcalc) {
6630
 
            this.calculate(o);
6631
 
        }
6632
 
 
6633
 
        var modules = this.resolve(),
6634
 
            self = this, comp = 0, actions = 0;
6635
 
 
6636
 
        if (type) {
6637
 
            //Filter out the opposite type and reset the array so the checks later work
6638
 
            modules[((type === JS) ? CSS : JS)] = [];
6639
 
        }
6640
 
        if (modules.js.length) {
6641
 
            comp++;
6642
 
        }
6643
 
        if (modules.css.length) {
6644
 
            comp++;
6645
 
        }
6646
 
 
6647
 
        //console.log('Resolved Modules: ', modules);
6648
 
 
6649
 
        var complete = function(d) {
6650
 
            actions++;
6651
 
            var errs = {}, i = 0, u = '', fn;
6652
 
 
6653
 
            if (d && d.errors) {
6654
 
                for (i = 0; i < d.errors.length; i++) {
6655
 
                    if (d.errors[i].request) {
6656
 
                        u = d.errors[i].request.url;
6657
 
                    } else {
6658
 
                        u = d.errors[i];
6659
 
                    }
6660
 
                    errs[u] = u;
6661
 
                }
6662
 
            }
6663
 
            
6664
 
            if (d && d.data && d.data.length && (d.type === 'success')) {
6665
 
                for (i = 0; i < d.data.length; i++) {
6666
 
                    self.inserted[d.data[i].name] = true;
6667
 
                }
6668
 
            }
6669
 
 
6670
 
            if (actions === comp) {
6671
 
                self._loading = null;
6672
 
                Y.log('Loader actions complete!', 'info', 'loader');
6673
 
                if (d && d.fn) {
6674
 
                    Y.log('Firing final Loader callback!', 'info', 'loader');
6675
 
                    fn = d.fn;
6676
 
                    delete d.fn;
6677
 
                    fn.call(self, d);
6678
 
                }
6679
 
            }
6680
 
        };
6681
 
 
6682
 
        this._loading = true;
6683
 
 
6684
 
        if (!modules.js.length && !modules.css.length) {
6685
 
            Y.log('No modules resolved..', 'warn', 'loader');
6686
 
            actions = -1;
6687
 
            complete({
6688
 
                fn: self._onSuccess
6689
 
            });
6690
 
            return;
6691
 
        }
6692
 
        
6693
 
 
6694
 
        if (modules.css.length) { //Load CSS first
6695
 
            Y.log('Loading CSS modules', 'info', 'loader');
6696
 
            Y.Get.css(modules.css, {
6697
 
                data: modules.cssMods,
6698
 
                attributes: self.cssAttributes,
6699
 
                insertBefore: self.insertBefore,
6700
 
                charset: self.charset,
6701
 
                timeout: self.timeout,
6702
 
                context: self,
6703
 
                onProgress: function(e) {
6704
 
                    self._onProgress.call(self, e);
6705
 
                },
6706
 
                onTimeout: function(d) {
6707
 
                    self._onTimeout.call(self, d);
6708
 
                },
6709
 
                onSuccess: function(d) {
6710
 
                    d.type = 'success';
6711
 
                    d.fn = self._onSuccess;
6712
 
                    complete.call(self, d);
6713
 
                },
6714
 
                onFailure: function(d) {
6715
 
                    d.type = 'failure';
6716
 
                    d.fn = self._onFailure;
6717
 
                    complete.call(self, d);
6718
 
                }
6719
 
            });
6720
 
        }
6721
 
 
6722
 
        if (modules.js.length) {
6723
 
            Y.log('Loading JS modules', 'info', 'loader');
6724
 
            Y.Get.js(modules.js, {
6725
 
                data: modules.jsMods,
6726
 
                insertBefore: self.insertBefore,
6727
 
                attributes: self.jsAttributes,
6728
 
                charset: self.charset,
6729
 
                timeout: self.timeout,
6730
 
                autopurge: false,
6731
 
                context: self,
6732
 
                async: true,
6733
 
                onProgress: function(e) {
6734
 
                    self._onProgress.call(self, e);
6735
 
                },
6736
 
                onTimeout: function(d) {
6737
 
                    self._onTimeout.call(self, d);
6738
 
                },
6739
 
                onSuccess: function(d) {
6740
 
                    d.type = 'success';
6741
 
                    d.fn = self._onSuccess;
6742
 
                    complete.call(self, d);
6743
 
                },
6744
 
                onFailure: function(d) {
6745
 
                    d.type = 'failure';
6746
 
                    d.fn = self._onFailure;
6747
 
                    complete.call(self, d);
6748
 
                }
6749
 
            });
6750
 
        }
6751
 
    },
6752
 
    /**
6753
 
    * Once a loader operation is completely finished, process any additional queued items.
6754
 
    * @method _continue
6755
 
    * @private
6756
 
    */
6757
 
    _continue: function() {
6758
 
        if (!(_queue.running) && _queue.size() > 0) {
6759
 
            _queue.running = true;
6760
 
            _queue.next()();
6761
 
        }
6762
 
    },
6763
 
 
6764
 
    /**
6765
 
     * inserts the requested modules and their dependencies.
6766
 
     * <code>type</code> can be "js" or "css".  Both script and
6767
 
     * css are inserted if type is not provided.
6768
 
     * @method insert
6769
 
     * @param {object} o optional options object.
6770
 
     * @param {string} type the type of dependency to insert.
6771
 
     */
6772
 
    insert: function(o, type, skipsort) {
6773
 
         Y.log('public insert() ' + (type || '') + ', ' +
6774
 
         Y.Object.keys(this.required), "info", "loader");
6775
 
        var self = this, copy = Y.merge(this);
6776
 
        delete copy.require;
6777
 
        delete copy.dirty;
6778
 
        _queue.add(function() {
6779
 
            self._insert(copy, o, type, skipsort);
6780
 
        });
6781
 
        this._continue();
6782
 
    },
6783
 
 
6784
 
    /**
6785
 
     * Executed every time a module is loaded, and if we are in a load
6786
 
     * cycle, we attempt to load the next script.  Public so that it
6787
 
     * is possible to call this if using a method other than
6788
 
     * Y.register to determine when scripts are fully loaded
6789
 
     * @method loadNext
6790
 
     * @deprecated
6791
 
     * @param {string} mname optional the name of the module that has
6792
 
     * been loaded (which is usually why it is time to load the next
6793
 
     * one).
6794
 
     */
6795
 
    loadNext: function(mname) {
6796
 
        Y.log('loadNext was called..', 'error', 'loader');
6797
 
        return;
6798
 
    },
6799
 
 
6800
 
    /**
6801
 
     * Apply filter defined for this instance to a url/path
6802
 
     * @method _filter
6803
 
     * @param {string} u the string to filter.
6804
 
     * @param {string} name the name of the module, if we are processing
6805
 
     * a single module as opposed to a combined url.
6806
 
     * @return {string} the filtered string.
6807
 
     * @private
6808
 
     */
6809
 
    _filter: function(u, name, group) {
6810
 
        var f = this.filter,
6811
 
            hasFilter = name && (name in this.filters),
6812
 
            modFilter = hasFilter && this.filters[name],
6813
 
                groupName = group || (this.moduleInfo[name] ? this.moduleInfo[name].group : null);
6814
 
 
6815
 
            if (groupName && this.groups[groupName] && this.groups[groupName].filter) {         
6816
 
                    modFilter = this.groups[groupName].filter;
6817
 
                    hasFilter = true;           
6818
 
            };
6819
 
 
6820
 
        if (u) {
6821
 
            if (hasFilter) {
6822
 
                f = (L.isString(modFilter)) ?
6823
 
                    this.FILTER_DEFS[modFilter.toUpperCase()] || null :
6824
 
                    modFilter;
6825
 
            }
6826
 
            if (f) {
6827
 
                u = u.replace(new RegExp(f.searchExp, 'g'), f.replaceStr);
6828
 
            }
6829
 
        }
6830
 
 
6831
 
        return u;
6832
 
    },
6833
 
 
6834
 
    /**
6835
 
     * Generates the full url for a module
6836
 
     * @method _url
6837
 
     * @param {string} path the path fragment.
6838
 
     * @param {String} name The name of the module
6839
 
     * @param {String} [base=self.base] The base url to use
6840
 
     * @return {string} the full url.
6841
 
     * @private
6842
 
     */
6843
 
    _url: function(path, name, base) {
6844
 
        return this._filter((base || this.base || '') + path, name);
6845
 
    },
6846
 
    /**
6847
 
    * Returns an Object hash of file arrays built from `loader.sorted` or from an arbitrary list of sorted modules.
6848
 
    * @method resolve
6849
 
    * @param {Boolean} [calc=false] Perform a loader.calculate() before anything else
6850
 
    * @param {Array} [s=loader.sorted] An override for the loader.sorted array
6851
 
    * @return {Object} Object hash (js and css) of two arrays of file lists
6852
 
    * @example This method can be used as an off-line dep calculator
6853
 
    *
6854
 
    *        var Y = YUI();
6855
 
    *        var loader = new Y.Loader({
6856
 
    *            filter: 'debug',
6857
 
    *            base: '../../',
6858
 
    *            root: 'build/',
6859
 
    *            combine: true,
6860
 
    *            require: ['node', 'dd', 'console']
6861
 
    *        });
6862
 
    *        var out = loader.resolve(true);
6863
 
    *
6864
 
    */
6865
 
    resolve: function(calc, s) {
6866
 
 
6867
 
        var len, i, m, url, fn, msg, attr, group, groupName, j, frag,
6868
 
            comboSource, comboSources, mods, comboBase,
6869
 
            base, urls, u = [], tmpBase, baseLen, resCombos = {},
6870
 
            self = this, comboSep, maxURLLength, singles = [],
6871
 
            inserted = (self.ignoreRegistered) ? {} : self.inserted,
6872
 
            resolved = { js: [], jsMods: [], css: [], cssMods: [] },
6873
 
            type = self.loadType || 'js';
6874
 
 
6875
 
        if (calc) {
6876
 
            self.calculate();
6877
 
        }
6878
 
        s = s || self.sorted;
6879
 
 
6880
 
        var addSingle = function(m) {
6881
 
            
6882
 
            if (m) {
6883
 
                group = (m.group && self.groups[m.group]) || NOT_FOUND;
6884
 
                
6885
 
                //Always assume it's async
6886
 
                if (group.async === false) {
6887
 
                    m.async = group.async;
6888
 
                }
6889
 
 
6890
 
                url = (m.fullpath) ? self._filter(m.fullpath, s[i]) :
6891
 
                      self._url(m.path, s[i], group.base || m.base);
6892
 
                
6893
 
                if (m.attributes || m.async === false) {
6894
 
                    url = {
6895
 
                        url: url,
6896
 
                        async: m.async
6897
 
                    };
6898
 
                    if (m.attributes) {
6899
 
                        url.attributes = m.attributes
6900
 
                    }
6901
 
                }
6902
 
                resolved[m.type].push(url);
6903
 
                resolved[m.type + 'Mods'].push(m);
6904
 
            } else {
6905
 
                Y.log('Undefined Module', 'warn', 'loader');
6906
 
            }
6907
 
            
6908
 
        };
6909
 
 
6910
 
        len = s.length;
6911
 
 
6912
 
        // the default combo base
6913
 
        comboBase = self.comboBase;
6914
 
 
6915
 
        url = comboBase;
6916
 
 
6917
 
        comboSources = {};
6918
 
 
6919
 
        for (i = 0; i < len; i++) {
6920
 
            comboSource = comboBase;
6921
 
            m = self.getModule(s[i]);
6922
 
            groupName = m && m.group;
6923
 
            group = self.groups[groupName];
6924
 
            if (groupName && group) {
6925
 
 
6926
 
                if (!group.combine || m.fullpath) {
6927
 
                    //This is not a combo module, skip it and load it singly later.
6928
 
                    //singles.push(s[i]);
6929
 
                    addSingle(m);
6930
 
                    continue;
6931
 
                }
6932
 
                m.combine = true;
6933
 
                if (group.comboBase) {
6934
 
                    comboSource = group.comboBase;
6935
 
                }
6936
 
 
6937
 
                if ("root" in group && L.isValue(group.root)) {
6938
 
                    m.root = group.root;
6939
 
                }
6940
 
                m.comboSep = group.comboSep || self.comboSep;
6941
 
                m.maxURLLength = group.maxURLLength || self.maxURLLength;
6942
 
            } else {
6943
 
                if (!self.combine) {
6944
 
                    //This is not a combo module, skip it and load it singly later.
6945
 
                    //singles.push(s[i]);
6946
 
                    addSingle(m);
6947
 
                    continue;
6948
 
                }
6949
 
            }
6950
 
 
6951
 
            comboSources[comboSource] = comboSources[comboSource] || [];
6952
 
            comboSources[comboSource].push(m);
6953
 
        }
6954
 
 
6955
 
        for (j in comboSources) {
6956
 
            if (comboSources.hasOwnProperty(j)) {
6957
 
                resCombos[j] = resCombos[j] || { js: [], jsMods: [], css: [], cssMods: [] };
6958
 
                url = j;
6959
 
                mods = comboSources[j];
6960
 
                len = mods.length;
6961
 
                
6962
 
                if (len) {
6963
 
                    for (i = 0; i < len; i++) {
6964
 
                        if (inserted[mods[i]]) {
6965
 
                            continue;
6966
 
                        }
6967
 
                        m = mods[i];
6968
 
                        // Do not try to combine non-yui JS unless combo def
6969
 
                        // is found
6970
 
                        if (m && (m.combine || !m.ext)) {
6971
 
                            resCombos[j].comboSep = m.comboSep;
6972
 
                            resCombos[j].group = m.group;
6973
 
                            resCombos[j].maxURLLength = m.maxURLLength;
6974
 
                            frag = ((L.isValue(m.root)) ? m.root : self.root) + (m.path || m.fullpath);
6975
 
                            frag = self._filter(frag, m.name);
6976
 
                            resCombos[j][m.type].push(frag);
6977
 
                            resCombos[j][m.type + 'Mods'].push(m);
6978
 
                        } else {
6979
 
                            //Add them to the next process..
6980
 
                            if (mods[i]) {
6981
 
                                //singles.push(mods[i].name);
6982
 
                                addSingle(mods[i]);
6983
 
                            }
6984
 
                        }
6985
 
 
6986
 
                    }
6987
 
                }
6988
 
            }
6989
 
        }
6990
 
 
6991
 
 
6992
 
        for (j in resCombos) {
6993
 
            base = j;
6994
 
            comboSep = resCombos[base].comboSep || self.comboSep;
6995
 
            maxURLLength = resCombos[base].maxURLLength || self.maxURLLength;
6996
 
            Y.log('Using maxURLLength of ' + maxURLLength, 'info', 'loader');
6997
 
            for (type in resCombos[base]) {
6998
 
                if (type === JS || type === CSS) {
6999
 
                    urls = resCombos[base][type];
7000
 
                    mods = resCombos[base][type + 'Mods'];
7001
 
                    len = urls.length;
7002
 
                    tmpBase = base + urls.join(comboSep);
7003
 
                    baseLen = tmpBase.length;
7004
 
                    if (maxURLLength <= base.length) {
7005
 
                        Y.log('maxURLLength (' + maxURLLength + ') is lower than the comboBase length (' + base.length + '), resetting to default (' + MAX_URL_LENGTH + ')', 'error', 'loader');
7006
 
                        maxURLLength = MAX_URL_LENGTH;
7007
 
                    }
7008
 
                    
7009
 
                    if (len) {
7010
 
                        if (baseLen > maxURLLength) {
7011
 
                            Y.log('Exceeded maxURLLength (' + maxURLLength + ') for ' + type + ', splitting', 'info', 'loader');
7012
 
                            u = [];
7013
 
                            for (s = 0; s < len; s++) {
7014
 
                                u.push(urls[s]);
7015
 
                                tmpBase = base + u.join(comboSep);
7016
 
 
7017
 
                                if (tmpBase.length > maxURLLength) {
7018
 
                                    m = u.pop();
7019
 
                                    tmpBase = base + u.join(comboSep)
7020
 
                                    resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));
7021
 
                                    u = [];
7022
 
                                    if (m) {
7023
 
                                        u.push(m);
7024
 
                                    }
7025
 
                                }
7026
 
                            }
7027
 
                            if (u.length) {
7028
 
                                tmpBase = base + u.join(comboSep);
7029
 
                                resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));
7030
 
                            }
7031
 
                        } else {
7032
 
                            resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));
7033
 
                        }
7034
 
                    }
7035
 
                    resolved[type + 'Mods'] = resolved[type + 'Mods'].concat(mods);
7036
 
                }
7037
 
            }
7038
 
        }
7039
 
 
7040
 
        resCombos = null;
7041
 
 
7042
 
        return resolved;
7043
 
    },
7044
 
    /**
7045
 
    Shortcut to calculate, resolve and load all modules.
7046
 
 
7047
 
        var loader = new Y.Loader({
7048
 
            ignoreRegistered: true,
7049
 
            modules: {
7050
 
                mod: {
7051
 
                    path: 'mod.js'
7052
 
                }
7053
 
            },
7054
 
            requires: [ 'mod' ]
7055
 
        });
7056
 
        loader.load(function() {
7057
 
            console.log('All modules have loaded..');
7058
 
        });
7059
 
 
7060
 
 
7061
 
    @method load
7062
 
    @param {Callback} cb Executed after all load operations are complete
7063
 
    */
7064
 
    load: function(cb) {
7065
 
        if (!cb) {
7066
 
            Y.log('No callback supplied to load()', 'error', 'loader');
7067
 
            return;
7068
 
        }
7069
 
        var self = this,
7070
 
            out = self.resolve(true);
7071
 
        
7072
 
        self.data = out;
7073
 
 
7074
 
        self.onEnd = function() {
7075
 
            cb.apply(self.context || self, arguments);
7076
 
        };
7077
 
 
7078
 
        self.insert();
7079
 
    }
7080
 
};
7081
 
 
7082
 
 
7083
 
 
7084
 
}, '3.5.0' ,{requires:['get', 'features']});
7085
 
YUI.add('loader-rollup', function(Y) {
7086
 
 
7087
 
/**
7088
 
 * Optional automatic rollup logic for reducing http connections
7089
 
 * when not using a combo service.
7090
 
 * @module loader
7091
 
 * @submodule rollup
7092
 
 */
7093
 
 
7094
 
/**
7095
 
 * Look for rollup packages to determine if all of the modules a
7096
 
 * rollup supersedes are required.  If so, include the rollup to
7097
 
 * help reduce the total number of connections required.  Called
7098
 
 * by calculate().  This is an optional feature, and requires the
7099
 
 * appropriate submodule to function.
7100
 
 * @method _rollup
7101
 
 * @for Loader
7102
 
 * @private
7103
 
 */
7104
 
Y.Loader.prototype._rollup = function() {
7105
 
    var i, j, m, s, r = this.required, roll,
7106
 
        info = this.moduleInfo, rolled, c, smod;
7107
 
 
7108
 
    // find and cache rollup modules
7109
 
    if (this.dirty || !this.rollups) {
7110
 
        this.rollups = {};
7111
 
        for (i in info) {
7112
 
            if (info.hasOwnProperty(i)) {
7113
 
                m = this.getModule(i);
7114
 
                // if (m && m.rollup && m.supersedes) {
7115
 
                if (m && m.rollup) {
7116
 
                    this.rollups[i] = m;
7117
 
                }
7118
 
            }
7119
 
        }
7120
 
    }
7121
 
 
7122
 
    // make as many passes as needed to pick up rollup rollups
7123
 
    for (;;) {
7124
 
        rolled = false;
7125
 
 
7126
 
        // go through the rollup candidates
7127
 
        for (i in this.rollups) {
7128
 
            if (this.rollups.hasOwnProperty(i)) {
7129
 
                // there can be only one, unless forced
7130
 
                if (!r[i] && ((!this.loaded[i]) || this.forceMap[i])) {
7131
 
                    m = this.getModule(i);
7132
 
                    s = m.supersedes || [];
7133
 
                    roll = false;
7134
 
 
7135
 
                    // @TODO remove continue
7136
 
                    if (!m.rollup) {
7137
 
                        continue;
7138
 
                    }
7139
 
 
7140
 
                    c = 0;
7141
 
 
7142
 
                    // check the threshold
7143
 
                    for (j = 0; j < s.length; j++) {
7144
 
                        smod = info[s[j]];
7145
 
 
7146
 
                        // if the superseded module is loaded, we can't
7147
 
                        // load the rollup unless it has been forced.
7148
 
                        if (this.loaded[s[j]] && !this.forceMap[s[j]]) {
7149
 
                            roll = false;
7150
 
                            break;
7151
 
                        // increment the counter if this module is required.
7152
 
                        // if we are beyond the rollup threshold, we will
7153
 
                        // use the rollup module
7154
 
                        } else if (r[s[j]] && m.type == smod.type) {
7155
 
                            c++;
7156
 
                            // Y.log("adding to thresh: " + c + ", " + s[j]);
7157
 
                            roll = (c >= m.rollup);
7158
 
                            if (roll) {
7159
 
                                // Y.log("over thresh " + c + ", " + s[j]);
7160
 
                                break;
7161
 
                            }
7162
 
                        }
7163
 
                    }
7164
 
 
7165
 
                    if (roll) {
7166
 
                        // Y.log("adding rollup: " +  i);
7167
 
                        // add the rollup
7168
 
                        r[i] = true;
7169
 
                        rolled = true;
7170
 
 
7171
 
                        // expand the rollup's dependencies
7172
 
                        this.getRequires(m);
7173
 
                    }
7174
 
                }
7175
 
            }
7176
 
        }
7177
 
 
7178
 
        // if we made it here w/o rolling up something, we are done
7179
 
        if (!rolled) {
7180
 
            break;
7181
 
        }
7182
 
    }
7183
 
};
7184
 
 
7185
 
 
7186
 
}, '3.5.0' ,{requires:['loader-base']});
7187
 
YUI.add('loader-yui3', function(Y) {
7188
 
 
7189
 
/* This file is auto-generated by src/loader/scripts/meta_join.py */
7190
 
 
7191
 
/**
7192
 
 * YUI 3 module metadata
7193
 
 * @module loader
7194
 
 * @submodule yui3
7195
 
 */
7196
 
YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {
7197
 
    "align-plugin": {
7198
 
        "requires": [
7199
 
            "node-screen", 
7200
 
            "node-pluginhost"
7201
 
        ]
7202
 
    }, 
7203
 
    "anim": {
7204
 
        "use": [
7205
 
            "anim-base", 
7206
 
            "anim-color", 
7207
 
            "anim-curve", 
7208
 
            "anim-easing", 
7209
 
            "anim-node-plugin", 
7210
 
            "anim-scroll", 
7211
 
            "anim-xy"
7212
 
        ]
7213
 
    }, 
7214
 
    "anim-base": {
7215
 
        "requires": [
7216
 
            "base-base", 
7217
 
            "node-style"
7218
 
        ]
7219
 
    }, 
7220
 
    "anim-color": {
7221
 
        "requires": [
7222
 
            "anim-base"
7223
 
        ]
7224
 
    }, 
7225
 
    "anim-curve": {
7226
 
        "requires": [
7227
 
            "anim-xy"
7228
 
        ]
7229
 
    }, 
7230
 
    "anim-easing": {
7231
 
        "requires": [
7232
 
            "anim-base"
7233
 
        ]
7234
 
    }, 
7235
 
    "anim-node-plugin": {
7236
 
        "requires": [
7237
 
            "node-pluginhost", 
7238
 
            "anim-base"
7239
 
        ]
7240
 
    }, 
7241
 
    "anim-scroll": {
7242
 
        "requires": [
7243
 
            "anim-base"
7244
 
        ]
7245
 
    }, 
7246
 
    "anim-shape-transform": {
7247
 
        "requires": [
7248
 
            "anim-base", 
7249
 
            "anim-easing", 
7250
 
            "matrix"
7251
 
        ]
7252
 
    }, 
7253
 
    "anim-xy": {
7254
 
        "requires": [
7255
 
            "anim-base", 
7256
 
            "node-screen"
7257
 
        ]
7258
 
    }, 
7259
 
    "app": {
7260
 
        "use": [
7261
 
            "app-base", 
7262
 
            "app-transitions", 
7263
 
            "model", 
7264
 
            "model-list", 
7265
 
            "router", 
7266
 
            "view"
7267
 
        ]
7268
 
    }, 
7269
 
    "app-base": {
7270
 
        "requires": [
7271
 
            "classnamemanager", 
7272
 
            "pjax-base", 
7273
 
            "router", 
7274
 
            "view"
7275
 
        ]
7276
 
    }, 
7277
 
    "app-transitions": {
7278
 
        "requires": [
7279
 
            "app-base"
7280
 
        ]
7281
 
    }, 
7282
 
    "app-transitions-css": {
7283
 
        "type": "css"
7284
 
    }, 
7285
 
    "app-transitions-native": {
7286
 
        "condition": {
7287
 
            "name": "app-transitions-native", 
7288
 
            "test": function (Y) {
7289
 
    var doc  = Y.config.doc,
7290
 
        node = doc ? doc.documentElement : null;
7291
 
 
7292
 
    if (node && node.style) {
7293
 
        return ('MozTransition' in node.style || 'WebkitTransition' in node.style);
7294
 
    }
7295
 
 
7296
 
    return false;
7297
 
}, 
7298
 
            "trigger": "app-transitions"
7299
 
        }, 
7300
 
        "requires": [
7301
 
            "app-transitions", 
7302
 
            "app-transitions-css", 
7303
 
            "parallel", 
7304
 
            "transition"
7305
 
        ]
7306
 
    }, 
7307
 
    "array-extras": {
7308
 
        "requires": [
7309
 
            "yui-base"
7310
 
        ]
7311
 
    }, 
7312
 
    "array-invoke": {
7313
 
        "requires": [
7314
 
            "yui-base"
7315
 
        ]
7316
 
    }, 
7317
 
    "arraylist": {
7318
 
        "requires": [
7319
 
            "yui-base"
7320
 
        ]
7321
 
    }, 
7322
 
    "arraylist-add": {
7323
 
        "requires": [
7324
 
            "arraylist"
7325
 
        ]
7326
 
    }, 
7327
 
    "arraylist-filter": {
7328
 
        "requires": [
7329
 
            "arraylist"
7330
 
        ]
7331
 
    }, 
7332
 
    "arraysort": {
7333
 
        "requires": [
7334
 
            "yui-base"
7335
 
        ]
7336
 
    }, 
7337
 
    "async-queue": {
7338
 
        "requires": [
7339
 
            "event-custom"
7340
 
        ]
7341
 
    }, 
7342
 
    "attribute": {
7343
 
        "use": [
7344
 
            "attribute-base", 
7345
 
            "attribute-complex"
7346
 
        ]
7347
 
    }, 
7348
 
    "attribute-base": {
7349
 
        "requires": [
7350
 
            "attribute-core", 
7351
 
            "attribute-events", 
7352
 
            "attribute-extras"
7353
 
        ]
7354
 
    }, 
7355
 
    "attribute-complex": {
7356
 
        "requires": [
7357
 
            "attribute-base"
7358
 
        ]
7359
 
    }, 
7360
 
    "attribute-core": {
7361
 
        "requires": [
7362
 
            "yui-base"
7363
 
        ]
7364
 
    }, 
7365
 
    "attribute-events": {
7366
 
        "requires": [
7367
 
            "event-custom"
7368
 
        ]
7369
 
    }, 
7370
 
    "attribute-extras": {
7371
 
        "requires": [
7372
 
            "yui-base"
7373
 
        ]
7374
 
    }, 
7375
 
    "autocomplete": {
7376
 
        "use": [
7377
 
            "autocomplete-base", 
7378
 
            "autocomplete-sources", 
7379
 
            "autocomplete-list", 
7380
 
            "autocomplete-plugin"
7381
 
        ]
7382
 
    }, 
7383
 
    "autocomplete-base": {
7384
 
        "optional": [
7385
 
            "autocomplete-sources"
7386
 
        ], 
7387
 
        "requires": [
7388
 
            "array-extras", 
7389
 
            "base-build", 
7390
 
            "escape", 
7391
 
            "event-valuechange", 
7392
 
            "node-base"
7393
 
        ]
7394
 
    }, 
7395
 
    "autocomplete-filters": {
7396
 
        "requires": [
7397
 
            "array-extras", 
7398
 
            "text-wordbreak"
7399
 
        ]
7400
 
    }, 
7401
 
    "autocomplete-filters-accentfold": {
7402
 
        "requires": [
7403
 
            "array-extras", 
7404
 
            "text-accentfold", 
7405
 
            "text-wordbreak"
7406
 
        ]
7407
 
    }, 
7408
 
    "autocomplete-highlighters": {
7409
 
        "requires": [
7410
 
            "array-extras", 
7411
 
            "highlight-base"
7412
 
        ]
7413
 
    }, 
7414
 
    "autocomplete-highlighters-accentfold": {
7415
 
        "requires": [
7416
 
            "array-extras", 
7417
 
            "highlight-accentfold"
7418
 
        ]
7419
 
    }, 
7420
 
    "autocomplete-list": {
7421
 
        "after": [
7422
 
            "autocomplete-sources"
7423
 
        ], 
7424
 
        "lang": [
7425
 
            "en"
7426
 
        ], 
7427
 
        "requires": [
7428
 
            "autocomplete-base", 
7429
 
            "event-resize", 
7430
 
            "node-screen", 
7431
 
            "selector-css3", 
7432
 
            "shim-plugin", 
7433
 
            "widget", 
7434
 
            "widget-position", 
7435
 
            "widget-position-align"
7436
 
        ], 
7437
 
        "skinnable": true
7438
 
    }, 
7439
 
    "autocomplete-list-keys": {
7440
 
        "condition": {
7441
 
            "name": "autocomplete-list-keys", 
7442
 
            "test": function (Y) {
7443
 
    // Only add keyboard support to autocomplete-list if this doesn't appear to
7444
 
    // be an iOS or Android-based mobile device.
7445
 
    //
7446
 
    // There's currently no feasible way to actually detect whether a device has
7447
 
    // a hardware keyboard, so this sniff will have to do. It can easily be
7448
 
    // overridden by manually loading the autocomplete-list-keys module.
7449
 
    //
7450
 
    // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari
7451
 
    // doesn't fire the keyboard events used by AutoCompleteList, so there's
7452
 
    // no point loading the -keys module even when a bluetooth keyboard may be
7453
 
    // available.
7454
 
    return !(Y.UA.ios || Y.UA.android);
7455
 
}, 
7456
 
            "trigger": "autocomplete-list"
7457
 
        }, 
7458
 
        "requires": [
7459
 
            "autocomplete-list", 
7460
 
            "base-build"
7461
 
        ]
7462
 
    }, 
7463
 
    "autocomplete-plugin": {
7464
 
        "requires": [
7465
 
            "autocomplete-list", 
7466
 
            "node-pluginhost"
7467
 
        ]
7468
 
    }, 
7469
 
    "autocomplete-sources": {
7470
 
        "optional": [
7471
 
            "io-base", 
7472
 
            "json-parse", 
7473
 
            "jsonp", 
7474
 
            "yql"
7475
 
        ], 
7476
 
        "requires": [
7477
 
            "autocomplete-base"
7478
 
        ]
7479
 
    }, 
7480
 
    "base": {
7481
 
        "use": [
7482
 
            "base-base", 
7483
 
            "base-pluginhost", 
7484
 
            "base-build"
7485
 
        ]
7486
 
    }, 
7487
 
    "base-base": {
7488
 
        "after": [
7489
 
            "attribute-complex"
7490
 
        ], 
7491
 
        "requires": [
7492
 
            "base-core", 
7493
 
            "attribute-base"
7494
 
        ]
7495
 
    }, 
7496
 
    "base-build": {
7497
 
        "requires": [
7498
 
            "base-base"
7499
 
        ]
7500
 
    }, 
7501
 
    "base-core": {
7502
 
        "requires": [
7503
 
            "attribute-core"
7504
 
        ]
7505
 
    }, 
7506
 
    "base-pluginhost": {
7507
 
        "requires": [
7508
 
            "base-base", 
7509
 
            "pluginhost"
7510
 
        ]
7511
 
    }, 
7512
 
    "button": {
7513
 
        "requires": [
7514
 
            "button-core", 
7515
 
            "cssbutton", 
7516
 
            "widget"
7517
 
        ]
7518
 
    }, 
7519
 
    "button-core": {
7520
 
        "requires": [
7521
 
            "attribute-core", 
7522
 
            "classnamemanager", 
7523
 
            "node-base"
7524
 
        ]
7525
 
    }, 
7526
 
    "button-group": {
7527
 
        "requires": [
7528
 
            "button-plugin", 
7529
 
            "cssbutton", 
7530
 
            "widget"
7531
 
        ]
7532
 
    }, 
7533
 
    "button-plugin": {
7534
 
        "requires": [
7535
 
            "button-core", 
7536
 
            "cssbutton", 
7537
 
            "node-pluginhost"
7538
 
        ]
7539
 
    }, 
7540
 
    "cache": {
7541
 
        "use": [
7542
 
            "cache-base", 
7543
 
            "cache-offline", 
7544
 
            "cache-plugin"
7545
 
        ]
7546
 
    }, 
7547
 
    "cache-base": {
7548
 
        "requires": [
7549
 
            "base"
7550
 
        ]
7551
 
    }, 
7552
 
    "cache-offline": {
7553
 
        "requires": [
7554
 
            "cache-base", 
7555
 
            "json"
7556
 
        ]
7557
 
    }, 
7558
 
    "cache-plugin": {
7559
 
        "requires": [
7560
 
            "plugin", 
7561
 
            "cache-base"
7562
 
        ]
7563
 
    }, 
7564
 
    "calendar": {
7565
 
        "lang": [
7566
 
            "de", 
7567
 
            "en", 
7568
 
            "fr", 
7569
 
            "ja", 
7570
 
            "nb-NO", 
7571
 
            "pt-BR", 
7572
 
            "ru", 
7573
 
            "zh-HANT-TW"
7574
 
        ], 
7575
 
        "requires": [
7576
 
            "calendar-base", 
7577
 
            "calendarnavigator"
7578
 
        ], 
7579
 
        "skinnable": true
7580
 
    }, 
7581
 
    "calendar-base": {
7582
 
        "lang": [
7583
 
            "de", 
7584
 
            "en", 
7585
 
            "fr", 
7586
 
            "ja", 
7587
 
            "nb-NO", 
7588
 
            "pt-BR", 
7589
 
            "ru", 
7590
 
            "zh-HANT-TW"
7591
 
        ], 
7592
 
        "requires": [
7593
 
            "widget", 
7594
 
            "substitute", 
7595
 
            "datatype-date", 
7596
 
            "datatype-date-math", 
7597
 
            "cssgrids"
7598
 
        ], 
7599
 
        "skinnable": true
7600
 
    }, 
7601
 
    "calendarnavigator": {
7602
 
        "requires": [
7603
 
            "plugin", 
7604
 
            "classnamemanager", 
7605
 
            "datatype-date", 
7606
 
            "node", 
7607
 
            "substitute"
7608
 
        ], 
7609
 
        "skinnable": true
7610
 
    }, 
7611
 
    "charts": {
7612
 
        "requires": [
7613
 
            "charts-base"
7614
 
        ]
7615
 
    }, 
7616
 
    "charts-base": {
7617
 
        "requires": [
7618
 
            "dom", 
7619
 
            "datatype-number", 
7620
 
            "datatype-date", 
7621
 
            "event-custom", 
7622
 
            "event-mouseenter", 
7623
 
            "event-touch", 
7624
 
            "widget", 
7625
 
            "widget-position", 
7626
 
            "widget-stack", 
7627
 
            "graphics"
7628
 
        ]
7629
 
    }, 
7630
 
    "charts-legend": {
7631
 
        "requires": [
7632
 
            "charts-base"
7633
 
        ]
7634
 
    }, 
7635
 
    "classnamemanager": {
7636
 
        "requires": [
7637
 
            "yui-base"
7638
 
        ]
7639
 
    }, 
7640
 
    "clickable-rail": {
7641
 
        "requires": [
7642
 
            "slider-base"
7643
 
        ]
7644
 
    }, 
7645
 
    "collection": {
7646
 
        "use": [
7647
 
            "array-extras", 
7648
 
            "arraylist", 
7649
 
            "arraylist-add", 
7650
 
            "arraylist-filter", 
7651
 
            "array-invoke"
7652
 
        ]
7653
 
    }, 
7654
 
    "console": {
7655
 
        "lang": [
7656
 
            "en", 
7657
 
            "es", 
7658
 
            "ja"
7659
 
        ], 
7660
 
        "requires": [
7661
 
            "yui-log", 
7662
 
            "widget", 
7663
 
            "substitute"
7664
 
        ], 
7665
 
        "skinnable": true
7666
 
    }, 
7667
 
    "console-filters": {
7668
 
        "requires": [
7669
 
            "plugin", 
7670
 
            "console"
7671
 
        ], 
7672
 
        "skinnable": true
7673
 
    }, 
7674
 
    "controller": {
7675
 
        "use": [
7676
 
            "router"
7677
 
        ]
7678
 
    }, 
7679
 
    "cookie": {
7680
 
        "requires": [
7681
 
            "yui-base"
7682
 
        ]
7683
 
    }, 
7684
 
    "createlink-base": {
7685
 
        "requires": [
7686
 
            "editor-base"
7687
 
        ]
7688
 
    }, 
7689
 
    "cssbase": {
7690
 
        "after": [
7691
 
            "cssreset", 
7692
 
            "cssfonts", 
7693
 
            "cssgrids", 
7694
 
            "cssreset-context", 
7695
 
            "cssfonts-context", 
7696
 
            "cssgrids-context"
7697
 
        ], 
7698
 
        "type": "css"
7699
 
    }, 
7700
 
    "cssbase-context": {
7701
 
        "after": [
7702
 
            "cssreset", 
7703
 
            "cssfonts", 
7704
 
            "cssgrids", 
7705
 
            "cssreset-context", 
7706
 
            "cssfonts-context", 
7707
 
            "cssgrids-context"
7708
 
        ], 
7709
 
        "type": "css"
7710
 
    }, 
7711
 
    "cssbutton": {
7712
 
        "type": "css"
7713
 
    }, 
7714
 
    "cssfonts": {
7715
 
        "type": "css"
7716
 
    }, 
7717
 
    "cssfonts-context": {
7718
 
        "type": "css"
7719
 
    }, 
7720
 
    "cssgrids": {
7721
 
        "optional": [
7722
 
            "cssreset", 
7723
 
            "cssfonts"
7724
 
        ], 
7725
 
        "type": "css"
7726
 
    }, 
7727
 
    "cssgrids-base": {
7728
 
        "optional": [
7729
 
            "cssreset", 
7730
 
            "cssfonts"
7731
 
        ], 
7732
 
        "type": "css"
7733
 
    }, 
7734
 
    "cssgrids-units": {
7735
 
        "optional": [
7736
 
            "cssreset", 
7737
 
            "cssfonts"
7738
 
        ], 
7739
 
        "requires": [
7740
 
            "cssgrids-base"
7741
 
        ], 
7742
 
        "type": "css"
7743
 
    }, 
7744
 
    "cssreset": {
7745
 
        "type": "css"
7746
 
    }, 
7747
 
    "cssreset-context": {
7748
 
        "type": "css"
7749
 
    }, 
7750
 
    "dataschema": {
7751
 
        "use": [
7752
 
            "dataschema-base", 
7753
 
            "dataschema-json", 
7754
 
            "dataschema-xml", 
7755
 
            "dataschema-array", 
7756
 
            "dataschema-text"
7757
 
        ]
7758
 
    }, 
7759
 
    "dataschema-array": {
7760
 
        "requires": [
7761
 
            "dataschema-base"
7762
 
        ]
7763
 
    }, 
7764
 
    "dataschema-base": {
7765
 
        "requires": [
7766
 
            "base"
7767
 
        ]
7768
 
    }, 
7769
 
    "dataschema-json": {
7770
 
        "requires": [
7771
 
            "dataschema-base", 
7772
 
            "json"
7773
 
        ]
7774
 
    }, 
7775
 
    "dataschema-text": {
7776
 
        "requires": [
7777
 
            "dataschema-base"
7778
 
        ]
7779
 
    }, 
7780
 
    "dataschema-xml": {
7781
 
        "requires": [
7782
 
            "dataschema-base"
7783
 
        ]
7784
 
    }, 
7785
 
    "datasource": {
7786
 
        "use": [
7787
 
            "datasource-local", 
7788
 
            "datasource-io", 
7789
 
            "datasource-get", 
7790
 
            "datasource-function", 
7791
 
            "datasource-cache", 
7792
 
            "datasource-jsonschema", 
7793
 
            "datasource-xmlschema", 
7794
 
            "datasource-arrayschema", 
7795
 
            "datasource-textschema", 
7796
 
            "datasource-polling"
7797
 
        ]
7798
 
    }, 
7799
 
    "datasource-arrayschema": {
7800
 
        "requires": [
7801
 
            "datasource-local", 
7802
 
            "plugin", 
7803
 
            "dataschema-array"
7804
 
        ]
7805
 
    }, 
7806
 
    "datasource-cache": {
7807
 
        "requires": [
7808
 
            "datasource-local", 
7809
 
            "plugin", 
7810
 
            "cache-base"
7811
 
        ]
7812
 
    }, 
7813
 
    "datasource-function": {
7814
 
        "requires": [
7815
 
            "datasource-local"
7816
 
        ]
7817
 
    }, 
7818
 
    "datasource-get": {
7819
 
        "requires": [
7820
 
            "datasource-local", 
7821
 
            "get"
7822
 
        ]
7823
 
    }, 
7824
 
    "datasource-io": {
7825
 
        "requires": [
7826
 
            "datasource-local", 
7827
 
            "io-base"
7828
 
        ]
7829
 
    }, 
7830
 
    "datasource-jsonschema": {
7831
 
        "requires": [
7832
 
            "datasource-local", 
7833
 
            "plugin", 
7834
 
            "dataschema-json"
7835
 
        ]
7836
 
    }, 
7837
 
    "datasource-local": {
7838
 
        "requires": [
7839
 
            "base"
7840
 
        ]
7841
 
    }, 
7842
 
    "datasource-polling": {
7843
 
        "requires": [
7844
 
            "datasource-local"
7845
 
        ]
7846
 
    }, 
7847
 
    "datasource-textschema": {
7848
 
        "requires": [
7849
 
            "datasource-local", 
7850
 
            "plugin", 
7851
 
            "dataschema-text"
7852
 
        ]
7853
 
    }, 
7854
 
    "datasource-xmlschema": {
7855
 
        "requires": [
7856
 
            "datasource-local", 
7857
 
            "plugin", 
7858
 
            "dataschema-xml"
7859
 
        ]
7860
 
    }, 
7861
 
    "datatable": {
7862
 
        "use": [
7863
 
            "datatable-core", 
7864
 
            "datatable-head", 
7865
 
            "datatable-body", 
7866
 
            "datatable-base", 
7867
 
            "datatable-column-widths", 
7868
 
            "datatable-message", 
7869
 
            "datatable-mutable", 
7870
 
            "datatable-sort", 
7871
 
            "datatable-datasource"
7872
 
        ]
7873
 
    }, 
7874
 
    "datatable-base": {
7875
 
        "requires": [
7876
 
            "datatable-core", 
7877
 
            "datatable-head", 
7878
 
            "datatable-body", 
7879
 
            "base-build", 
7880
 
            "widget"
7881
 
        ], 
7882
 
        "skinnable": true
7883
 
    }, 
7884
 
    "datatable-base-deprecated": {
7885
 
        "requires": [
7886
 
            "recordset-base", 
7887
 
            "widget", 
7888
 
            "substitute", 
7889
 
            "event-mouseenter"
7890
 
        ], 
7891
 
        "skinnable": true
7892
 
    }, 
7893
 
    "datatable-body": {
7894
 
        "requires": [
7895
 
            "datatable-core", 
7896
 
            "view", 
7897
 
            "classnamemanager"
7898
 
        ]
7899
 
    }, 
7900
 
    "datatable-column-widths": {
7901
 
        "requires": [
7902
 
            "datatable-base"
7903
 
        ]
7904
 
    }, 
7905
 
    "datatable-core": {
7906
 
        "requires": [
7907
 
            "escape", 
7908
 
            "model-list", 
7909
 
            "node-event-delegate"
7910
 
        ]
7911
 
    }, 
7912
 
    "datatable-datasource": {
7913
 
        "requires": [
7914
 
            "datatable-base", 
7915
 
            "plugin", 
7916
 
            "datasource-local"
7917
 
        ]
7918
 
    }, 
7919
 
    "datatable-datasource-deprecated": {
7920
 
        "requires": [
7921
 
            "datatable-base-deprecated", 
7922
 
            "plugin", 
7923
 
            "datasource-local"
7924
 
        ]
7925
 
    }, 
7926
 
    "datatable-deprecated": {
7927
 
        "use": [
7928
 
            "datatable-base-deprecated", 
7929
 
            "datatable-datasource-deprecated", 
7930
 
            "datatable-sort-deprecated", 
7931
 
            "datatable-scroll-deprecated"
7932
 
        ]
7933
 
    }, 
7934
 
    "datatable-head": {
7935
 
        "requires": [
7936
 
            "datatable-core", 
7937
 
            "view", 
7938
 
            "classnamemanager"
7939
 
        ]
7940
 
    }, 
7941
 
    "datatable-message": {
7942
 
        "lang": [
7943
 
            "en"
7944
 
        ], 
7945
 
        "requires": [
7946
 
            "datatable-base"
7947
 
        ], 
7948
 
        "skinnable": true
7949
 
    }, 
7950
 
    "datatable-mutable": {
7951
 
        "requires": [
7952
 
            "datatable-base"
7953
 
        ]
7954
 
    }, 
7955
 
    "datatable-scroll": {
7956
 
        "requires": [
7957
 
            "datatable-base", 
7958
 
            "datatable-column-widths", 
7959
 
            "dom-screen"
7960
 
        ], 
7961
 
        "skinnable": true
7962
 
    }, 
7963
 
    "datatable-scroll-deprecated": {
7964
 
        "requires": [
7965
 
            "datatable-base-deprecated", 
7966
 
            "plugin"
7967
 
        ]
7968
 
    }, 
7969
 
    "datatable-sort": {
7970
 
        "lang": [
7971
 
            "en"
7972
 
        ], 
7973
 
        "requires": [
7974
 
            "datatable-base"
7975
 
        ], 
7976
 
        "skinnable": true
7977
 
    }, 
7978
 
    "datatable-sort-deprecated": {
7979
 
        "lang": [
7980
 
            "en"
7981
 
        ], 
7982
 
        "requires": [
7983
 
            "datatable-base-deprecated", 
7984
 
            "plugin", 
7985
 
            "recordset-sort"
7986
 
        ]
7987
 
    }, 
7988
 
    "datatype": {
7989
 
        "use": [
7990
 
            "datatype-number", 
7991
 
            "datatype-date", 
7992
 
            "datatype-xml"
7993
 
        ]
7994
 
    }, 
7995
 
    "datatype-date": {
7996
 
        "supersedes": [
7997
 
            "datatype-date-format"
7998
 
        ], 
7999
 
        "use": [
8000
 
            "datatype-date-parse", 
8001
 
            "datatype-date-format"
8002
 
        ]
8003
 
    }, 
8004
 
    "datatype-date-format": {
8005
 
        "lang": [
8006
 
            "ar", 
8007
 
            "ar-JO", 
8008
 
            "ca", 
8009
 
            "ca-ES", 
8010
 
            "da", 
8011
 
            "da-DK", 
8012
 
            "de", 
8013
 
            "de-AT", 
8014
 
            "de-DE", 
8015
 
            "el", 
8016
 
            "el-GR", 
8017
 
            "en", 
8018
 
            "en-AU", 
8019
 
            "en-CA", 
8020
 
            "en-GB", 
8021
 
            "en-IE", 
8022
 
            "en-IN", 
8023
 
            "en-JO", 
8024
 
            "en-MY", 
8025
 
            "en-NZ", 
8026
 
            "en-PH", 
8027
 
            "en-SG", 
8028
 
            "en-US", 
8029
 
            "es", 
8030
 
            "es-AR", 
8031
 
            "es-BO", 
8032
 
            "es-CL", 
8033
 
            "es-CO", 
8034
 
            "es-EC", 
8035
 
            "es-ES", 
8036
 
            "es-MX", 
8037
 
            "es-PE", 
8038
 
            "es-PY", 
8039
 
            "es-US", 
8040
 
            "es-UY", 
8041
 
            "es-VE", 
8042
 
            "fi", 
8043
 
            "fi-FI", 
8044
 
            "fr", 
8045
 
            "fr-BE", 
8046
 
            "fr-CA", 
8047
 
            "fr-FR", 
8048
 
            "hi", 
8049
 
            "hi-IN", 
8050
 
            "id", 
8051
 
            "id-ID", 
8052
 
            "it", 
8053
 
            "it-IT", 
8054
 
            "ja", 
8055
 
            "ja-JP", 
8056
 
            "ko", 
8057
 
            "ko-KR", 
8058
 
            "ms", 
8059
 
            "ms-MY", 
8060
 
            "nb", 
8061
 
            "nb-NO", 
8062
 
            "nl", 
8063
 
            "nl-BE", 
8064
 
            "nl-NL", 
8065
 
            "pl", 
8066
 
            "pl-PL", 
8067
 
            "pt", 
8068
 
            "pt-BR", 
8069
 
            "ro", 
8070
 
            "ro-RO", 
8071
 
            "ru", 
8072
 
            "ru-RU", 
8073
 
            "sv", 
8074
 
            "sv-SE", 
8075
 
            "th", 
8076
 
            "th-TH", 
8077
 
            "tr", 
8078
 
            "tr-TR", 
8079
 
            "vi", 
8080
 
            "vi-VN", 
8081
 
            "zh-Hans", 
8082
 
            "zh-Hans-CN", 
8083
 
            "zh-Hant", 
8084
 
            "zh-Hant-HK", 
8085
 
            "zh-Hant-TW"
8086
 
        ]
8087
 
    }, 
8088
 
    "datatype-date-math": {
8089
 
        "requires": [
8090
 
            "yui-base"
8091
 
        ]
8092
 
    }, 
8093
 
    "datatype-date-parse": {}, 
8094
 
    "datatype-number": {
8095
 
        "use": [
8096
 
            "datatype-number-parse", 
8097
 
            "datatype-number-format"
8098
 
        ]
8099
 
    }, 
8100
 
    "datatype-number-format": {}, 
8101
 
    "datatype-number-parse": {}, 
8102
 
    "datatype-xml": {
8103
 
        "use": [
8104
 
            "datatype-xml-parse", 
8105
 
            "datatype-xml-format"
8106
 
        ]
8107
 
    }, 
8108
 
    "datatype-xml-format": {}, 
8109
 
    "datatype-xml-parse": {}, 
8110
 
    "dd": {
8111
 
        "use": [
8112
 
            "dd-ddm-base", 
8113
 
            "dd-ddm", 
8114
 
            "dd-ddm-drop", 
8115
 
            "dd-drag", 
8116
 
            "dd-proxy", 
8117
 
            "dd-constrain", 
8118
 
            "dd-drop", 
8119
 
            "dd-scroll", 
8120
 
            "dd-delegate"
8121
 
        ]
8122
 
    }, 
8123
 
    "dd-constrain": {
8124
 
        "requires": [
8125
 
            "dd-drag"
8126
 
        ]
8127
 
    }, 
8128
 
    "dd-ddm": {
8129
 
        "requires": [
8130
 
            "dd-ddm-base", 
8131
 
            "event-resize"
8132
 
        ]
8133
 
    }, 
8134
 
    "dd-ddm-base": {
8135
 
        "requires": [
8136
 
            "node", 
8137
 
            "base", 
8138
 
            "yui-throttle", 
8139
 
            "classnamemanager"
8140
 
        ]
8141
 
    }, 
8142
 
    "dd-ddm-drop": {
8143
 
        "requires": [
8144
 
            "dd-ddm"
8145
 
        ]
8146
 
    }, 
8147
 
    "dd-delegate": {
8148
 
        "requires": [
8149
 
            "dd-drag", 
8150
 
            "dd-drop-plugin", 
8151
 
            "event-mouseenter"
8152
 
        ]
8153
 
    }, 
8154
 
    "dd-drag": {
8155
 
        "requires": [
8156
 
            "dd-ddm-base"
8157
 
        ]
8158
 
    }, 
8159
 
    "dd-drop": {
8160
 
        "requires": [
8161
 
            "dd-drag", 
8162
 
            "dd-ddm-drop"
8163
 
        ]
8164
 
    }, 
8165
 
    "dd-drop-plugin": {
8166
 
        "requires": [
8167
 
            "dd-drop"
8168
 
        ]
8169
 
    }, 
8170
 
    "dd-gestures": {
8171
 
        "condition": {
8172
 
            "name": "dd-gestures", 
8173
 
            "test": function(Y) {
8174
 
    return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));
8175
 
}, 
8176
 
            "trigger": "dd-drag"
8177
 
        }, 
8178
 
        "requires": [
8179
 
            "dd-drag", 
8180
 
            "event-synthetic", 
8181
 
            "event-gestures"
8182
 
        ]
8183
 
    }, 
8184
 
    "dd-plugin": {
8185
 
        "optional": [
8186
 
            "dd-constrain", 
8187
 
            "dd-proxy"
8188
 
        ], 
8189
 
        "requires": [
8190
 
            "dd-drag"
8191
 
        ]
8192
 
    }, 
8193
 
    "dd-proxy": {
8194
 
        "requires": [
8195
 
            "dd-drag"
8196
 
        ]
8197
 
    }, 
8198
 
    "dd-scroll": {
8199
 
        "requires": [
8200
 
            "dd-drag"
8201
 
        ]
8202
 
    }, 
8203
 
    "dial": {
8204
 
        "lang": [
8205
 
            "en", 
8206
 
            "es"
8207
 
        ], 
8208
 
        "requires": [
8209
 
            "widget", 
8210
 
            "dd-drag", 
8211
 
            "substitute", 
8212
 
            "event-mouseenter", 
8213
 
            "event-move", 
8214
 
            "event-key", 
8215
 
            "transition", 
8216
 
            "intl"
8217
 
        ], 
8218
 
        "skinnable": true
8219
 
    }, 
8220
 
    "dom": {
8221
 
        "use": [
8222
 
            "dom-base", 
8223
 
            "dom-screen", 
8224
 
            "dom-style", 
8225
 
            "selector-native", 
8226
 
            "selector"
8227
 
        ]
8228
 
    }, 
8229
 
    "dom-base": {
8230
 
        "requires": [
8231
 
            "dom-core"
8232
 
        ]
8233
 
    }, 
8234
 
    "dom-core": {
8235
 
        "requires": [
8236
 
            "oop", 
8237
 
            "features"
8238
 
        ]
8239
 
    }, 
8240
 
    "dom-deprecated": {
8241
 
        "requires": [
8242
 
            "dom-base"
8243
 
        ]
8244
 
    }, 
8245
 
    "dom-screen": {
8246
 
        "requires": [
8247
 
            "dom-base", 
8248
 
            "dom-style"
8249
 
        ]
8250
 
    }, 
8251
 
    "dom-style": {
8252
 
        "requires": [
8253
 
            "dom-base"
8254
 
        ]
8255
 
    }, 
8256
 
    "dom-style-ie": {
8257
 
        "condition": {
8258
 
            "name": "dom-style-ie", 
8259
 
            "test": function (Y) {
8260
 
 
8261
 
    var testFeature = Y.Features.test,
8262
 
        addFeature = Y.Features.add,
8263
 
        WINDOW = Y.config.win,
8264
 
        DOCUMENT = Y.config.doc,
8265
 
        DOCUMENT_ELEMENT = 'documentElement',
8266
 
        ret = false;
8267
 
 
8268
 
    addFeature('style', 'computedStyle', {
8269
 
        test: function() {
8270
 
            return WINDOW && 'getComputedStyle' in WINDOW;
8271
 
        }
8272
 
    });
8273
 
 
8274
 
    addFeature('style', 'opacity', {
8275
 
        test: function() {
8276
 
            return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style;
8277
 
        }
8278
 
    });
8279
 
 
8280
 
    ret =  (!testFeature('style', 'opacity') &&
8281
 
            !testFeature('style', 'computedStyle'));
8282
 
 
8283
 
    return ret;
8284
 
}, 
8285
 
            "trigger": "dom-style"
8286
 
        }, 
8287
 
        "requires": [
8288
 
            "dom-style"
8289
 
        ]
8290
 
    }, 
8291
 
    "dump": {
8292
 
        "requires": [
8293
 
            "yui-base"
8294
 
        ]
8295
 
    }, 
8296
 
    "editor": {
8297
 
        "use": [
8298
 
            "frame", 
8299
 
            "editor-selection", 
8300
 
            "exec-command", 
8301
 
            "editor-base", 
8302
 
            "editor-para", 
8303
 
            "editor-br", 
8304
 
            "editor-bidi", 
8305
 
            "editor-tab", 
8306
 
            "createlink-base"
8307
 
        ]
8308
 
    }, 
8309
 
    "editor-base": {
8310
 
        "requires": [
8311
 
            "base", 
8312
 
            "frame", 
8313
 
            "node", 
8314
 
            "exec-command", 
8315
 
            "editor-selection"
8316
 
        ]
8317
 
    }, 
8318
 
    "editor-bidi": {
8319
 
        "requires": [
8320
 
            "editor-base"
8321
 
        ]
8322
 
    }, 
8323
 
    "editor-br": {
8324
 
        "requires": [
8325
 
            "editor-base"
8326
 
        ]
8327
 
    }, 
8328
 
    "editor-lists": {
8329
 
        "requires": [
8330
 
            "editor-base"
8331
 
        ]
8332
 
    }, 
8333
 
    "editor-para": {
8334
 
        "requires": [
8335
 
            "editor-para-base"
8336
 
        ]
8337
 
    }, 
8338
 
    "editor-para-base": {
8339
 
        "requires": [
8340
 
            "editor-base"
8341
 
        ]
8342
 
    }, 
8343
 
    "editor-para-ie": {
8344
 
        "condition": {
8345
 
            "name": "editor-para-ie", 
8346
 
            "trigger": "editor-para", 
8347
 
            "ua": "ie", 
8348
 
            "when": "instead"
8349
 
        }, 
8350
 
        "requires": [
8351
 
            "editor-para-base"
8352
 
        ]
8353
 
    }, 
8354
 
    "editor-selection": {
8355
 
        "requires": [
8356
 
            "node"
8357
 
        ]
8358
 
    }, 
8359
 
    "editor-tab": {
8360
 
        "requires": [
8361
 
            "editor-base"
8362
 
        ]
8363
 
    }, 
8364
 
    "escape": {
8365
 
        "requires": [
8366
 
            "yui-base"
8367
 
        ]
8368
 
    }, 
8369
 
    "event": {
8370
 
        "after": [
8371
 
            "node-base"
8372
 
        ], 
8373
 
        "use": [
8374
 
            "event-base", 
8375
 
            "event-delegate", 
8376
 
            "event-synthetic", 
8377
 
            "event-mousewheel", 
8378
 
            "event-mouseenter", 
8379
 
            "event-key", 
8380
 
            "event-focus", 
8381
 
            "event-resize", 
8382
 
            "event-hover", 
8383
 
            "event-outside", 
8384
 
            "event-touch", 
8385
 
            "event-move", 
8386
 
            "event-flick", 
8387
 
            "event-valuechange"
8388
 
        ]
8389
 
    }, 
8390
 
    "event-base": {
8391
 
        "after": [
8392
 
            "node-base"
8393
 
        ], 
8394
 
        "requires": [
8395
 
            "event-custom-base"
8396
 
        ]
8397
 
    }, 
8398
 
    "event-base-ie": {
8399
 
        "after": [
8400
 
            "event-base"
8401
 
        ], 
8402
 
        "condition": {
8403
 
            "name": "event-base-ie", 
8404
 
            "test": function(Y) {
8405
 
    var imp = Y.config.doc && Y.config.doc.implementation;
8406
 
    return (imp && (!imp.hasFeature('Events', '2.0')));
8407
 
}, 
8408
 
            "trigger": "node-base"
8409
 
        }, 
8410
 
        "requires": [
8411
 
            "node-base"
8412
 
        ]
8413
 
    }, 
8414
 
    "event-contextmenu": {
8415
 
        "requires": [
8416
 
            "event-synthetic", 
8417
 
            "dom-screen"
8418
 
        ]
8419
 
    }, 
8420
 
    "event-custom": {
8421
 
        "use": [
8422
 
            "event-custom-base", 
8423
 
            "event-custom-complex"
8424
 
        ]
8425
 
    }, 
8426
 
    "event-custom-base": {
8427
 
        "requires": [
8428
 
            "oop"
8429
 
        ]
8430
 
    }, 
8431
 
    "event-custom-complex": {
8432
 
        "requires": [
8433
 
            "event-custom-base"
8434
 
        ]
8435
 
    }, 
8436
 
    "event-delegate": {
8437
 
        "requires": [
8438
 
            "node-base"
8439
 
        ]
8440
 
    }, 
8441
 
    "event-flick": {
8442
 
        "requires": [
8443
 
            "node-base", 
8444
 
            "event-touch", 
8445
 
            "event-synthetic"
8446
 
        ]
8447
 
    }, 
8448
 
    "event-focus": {
8449
 
        "requires": [
8450
 
            "event-synthetic"
8451
 
        ]
8452
 
    }, 
8453
 
    "event-gestures": {
8454
 
        "use": [
8455
 
            "event-flick", 
8456
 
            "event-move"
8457
 
        ]
8458
 
    }, 
8459
 
    "event-hover": {
8460
 
        "requires": [
8461
 
            "event-mouseenter"
8462
 
        ]
8463
 
    }, 
8464
 
    "event-key": {
8465
 
        "requires": [
8466
 
            "event-synthetic"
8467
 
        ]
8468
 
    }, 
8469
 
    "event-mouseenter": {
8470
 
        "requires": [
8471
 
            "event-synthetic"
8472
 
        ]
8473
 
    }, 
8474
 
    "event-mousewheel": {
8475
 
        "requires": [
8476
 
            "node-base"
8477
 
        ]
8478
 
    }, 
8479
 
    "event-move": {
8480
 
        "requires": [
8481
 
            "node-base", 
8482
 
            "event-touch", 
8483
 
            "event-synthetic"
8484
 
        ]
8485
 
    }, 
8486
 
    "event-outside": {
8487
 
        "requires": [
8488
 
            "event-synthetic"
8489
 
        ]
8490
 
    }, 
8491
 
    "event-resize": {
8492
 
        "requires": [
8493
 
            "node-base", 
8494
 
            "event-synthetic"
8495
 
        ]
8496
 
    }, 
8497
 
    "event-simulate": {
8498
 
        "requires": [
8499
 
            "event-base"
8500
 
        ]
8501
 
    }, 
8502
 
    "event-synthetic": {
8503
 
        "requires": [
8504
 
            "node-base", 
8505
 
            "event-custom-complex"
8506
 
        ]
8507
 
    }, 
8508
 
    "event-touch": {
8509
 
        "requires": [
8510
 
            "node-base"
8511
 
        ]
8512
 
    }, 
8513
 
    "event-valuechange": {
8514
 
        "requires": [
8515
 
            "event-focus", 
8516
 
            "event-synthetic"
8517
 
        ]
8518
 
    }, 
8519
 
    "exec-command": {
8520
 
        "requires": [
8521
 
            "frame"
8522
 
        ]
8523
 
    }, 
8524
 
    "features": {
8525
 
        "requires": [
8526
 
            "yui-base"
8527
 
        ]
8528
 
    }, 
8529
 
    "file": {
8530
 
        "requires": [
8531
 
            "file-flash", 
8532
 
            "file-html5"
8533
 
        ]
8534
 
    }, 
8535
 
    "file-flash": {
8536
 
        "requires": [
8537
 
            "base"
8538
 
        ]
8539
 
    }, 
8540
 
    "file-html5": {
8541
 
        "requires": [
8542
 
            "base"
8543
 
        ]
8544
 
    }, 
8545
 
    "frame": {
8546
 
        "requires": [
8547
 
            "base", 
8548
 
            "node", 
8549
 
            "selector-css3", 
8550
 
            "substitute", 
8551
 
            "yui-throttle"
8552
 
        ]
8553
 
    }, 
8554
 
    "get": {
8555
 
        "requires": [
8556
 
            "yui-base"
8557
 
        ]
8558
 
    }, 
8559
 
    "graphics": {
8560
 
        "requires": [
8561
 
            "node", 
8562
 
            "event-custom", 
8563
 
            "pluginhost", 
8564
 
            "matrix"
8565
 
        ]
8566
 
    }, 
8567
 
    "graphics-canvas": {
8568
 
        "condition": {
8569
 
            "name": "graphics-canvas", 
8570
 
            "test": function(Y) {
8571
 
    var DOCUMENT = Y.config.doc,
8572
 
        useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas",
8573
 
                canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
8574
 
        svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
8575
 
    return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d"));
8576
 
}, 
8577
 
            "trigger": "graphics"
8578
 
        }, 
8579
 
        "requires": [
8580
 
            "graphics"
8581
 
        ]
8582
 
    }, 
8583
 
    "graphics-canvas-default": {
8584
 
        "condition": {
8585
 
            "name": "graphics-canvas-default", 
8586
 
            "test": function(Y) {
8587
 
    var DOCUMENT = Y.config.doc,
8588
 
        useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas",
8589
 
                canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
8590
 
        svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
8591
 
    return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d"));
8592
 
}, 
8593
 
            "trigger": "graphics"
8594
 
        }
8595
 
    }, 
8596
 
    "graphics-svg": {
8597
 
        "condition": {
8598
 
            "name": "graphics-svg", 
8599
 
            "test": function(Y) {
8600
 
    var DOCUMENT = Y.config.doc,
8601
 
        useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas",
8602
 
                canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
8603
 
        svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
8604
 
    
8605
 
    return svg && (useSVG || !canvas);
8606
 
}, 
8607
 
            "trigger": "graphics"
8608
 
        }, 
8609
 
        "requires": [
8610
 
            "graphics"
8611
 
        ]
8612
 
    }, 
8613
 
    "graphics-svg-default": {
8614
 
        "condition": {
8615
 
            "name": "graphics-svg-default", 
8616
 
            "test": function(Y) {
8617
 
    var DOCUMENT = Y.config.doc,
8618
 
        useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas",
8619
 
                canvas = DOCUMENT && DOCUMENT.createElement("canvas"),
8620
 
        svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));
8621
 
    
8622
 
    return svg && (useSVG || !canvas);
8623
 
}, 
8624
 
            "trigger": "graphics"
8625
 
        }
8626
 
    }, 
8627
 
    "graphics-vml": {
8628
 
        "condition": {
8629
 
            "name": "graphics-vml", 
8630
 
            "test": function(Y) {
8631
 
    var DOCUMENT = Y.config.doc,
8632
 
                canvas = DOCUMENT && DOCUMENT.createElement("canvas");
8633
 
    return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
8634
 
}, 
8635
 
            "trigger": "graphics"
8636
 
        }, 
8637
 
        "requires": [
8638
 
            "graphics"
8639
 
        ]
8640
 
    }, 
8641
 
    "graphics-vml-default": {
8642
 
        "condition": {
8643
 
            "name": "graphics-vml-default", 
8644
 
            "test": function(Y) {
8645
 
    var DOCUMENT = Y.config.doc,
8646
 
                canvas = DOCUMENT && DOCUMENT.createElement("canvas");
8647
 
    return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d")));
8648
 
}, 
8649
 
            "trigger": "graphics"
8650
 
        }
8651
 
    }, 
8652
 
    "handlebars": {
8653
 
        "use": [
8654
 
            "handlebars-compiler"
8655
 
        ]
8656
 
    }, 
8657
 
    "handlebars-base": {
8658
 
        "requires": [
8659
 
            "escape"
8660
 
        ]
8661
 
    }, 
8662
 
    "handlebars-compiler": {
8663
 
        "requires": [
8664
 
            "handlebars-base"
8665
 
        ]
8666
 
    }, 
8667
 
    "highlight": {
8668
 
        "use": [
8669
 
            "highlight-base", 
8670
 
            "highlight-accentfold"
8671
 
        ]
8672
 
    }, 
8673
 
    "highlight-accentfold": {
8674
 
        "requires": [
8675
 
            "highlight-base", 
8676
 
            "text-accentfold"
8677
 
        ]
8678
 
    }, 
8679
 
    "highlight-base": {
8680
 
        "requires": [
8681
 
            "array-extras", 
8682
 
            "classnamemanager", 
8683
 
            "escape", 
8684
 
            "text-wordbreak"
8685
 
        ]
8686
 
    }, 
8687
 
    "history": {
8688
 
        "use": [
8689
 
            "history-base", 
8690
 
            "history-hash", 
8691
 
            "history-hash-ie", 
8692
 
            "history-html5"
8693
 
        ]
8694
 
    }, 
8695
 
    "history-base": {
8696
 
        "requires": [
8697
 
            "event-custom-complex"
8698
 
        ]
8699
 
    }, 
8700
 
    "history-hash": {
8701
 
        "after": [
8702
 
            "history-html5"
8703
 
        ], 
8704
 
        "requires": [
8705
 
            "event-synthetic", 
8706
 
            "history-base", 
8707
 
            "yui-later"
8708
 
        ]
8709
 
    }, 
8710
 
    "history-hash-ie": {
8711
 
        "condition": {
8712
 
            "name": "history-hash-ie", 
8713
 
            "test": function (Y) {
8714
 
    var docMode = Y.config.doc && Y.config.doc.documentMode;
8715
 
 
8716
 
    return Y.UA.ie && (!('onhashchange' in Y.config.win) ||
8717
 
            !docMode || docMode < 8);
8718
 
}, 
8719
 
            "trigger": "history-hash"
8720
 
        }, 
8721
 
        "requires": [
8722
 
            "history-hash", 
8723
 
            "node-base"
8724
 
        ]
8725
 
    }, 
8726
 
    "history-html5": {
8727
 
        "optional": [
8728
 
            "json"
8729
 
        ], 
8730
 
        "requires": [
8731
 
            "event-base", 
8732
 
            "history-base", 
8733
 
            "node-base"
8734
 
        ]
8735
 
    }, 
8736
 
    "imageloader": {
8737
 
        "requires": [
8738
 
            "base-base", 
8739
 
            "node-style", 
8740
 
            "node-screen"
8741
 
        ]
8742
 
    }, 
8743
 
    "intl": {
8744
 
        "requires": [
8745
 
            "intl-base", 
8746
 
            "event-custom"
8747
 
        ]
8748
 
    }, 
8749
 
    "intl-base": {
8750
 
        "requires": [
8751
 
            "yui-base"
8752
 
        ]
8753
 
    }, 
8754
 
    "io": {
8755
 
        "use": [
8756
 
            "io-base", 
8757
 
            "io-xdr", 
8758
 
            "io-form", 
8759
 
            "io-upload-iframe", 
8760
 
            "io-queue"
8761
 
        ]
8762
 
    }, 
8763
 
    "io-base": {
8764
 
        "requires": [
8765
 
            "event-custom-base", 
8766
 
            "querystring-stringify-simple"
8767
 
        ]
8768
 
    }, 
8769
 
    "io-form": {
8770
 
        "requires": [
8771
 
            "io-base", 
8772
 
            "node-base"
8773
 
        ]
8774
 
    }, 
8775
 
    "io-nodejs": {
8776
 
        "condition": {
8777
 
            "name": "io-nodejs", 
8778
 
            "trigger": "io-base", 
8779
 
            "ua": "nodejs"
8780
 
        }, 
8781
 
        "requires": [
8782
 
            "io-base"
8783
 
        ]
8784
 
    }, 
8785
 
    "io-queue": {
8786
 
        "requires": [
8787
 
            "io-base", 
8788
 
            "queue-promote"
8789
 
        ]
8790
 
    }, 
8791
 
    "io-upload-iframe": {
8792
 
        "requires": [
8793
 
            "io-base", 
8794
 
            "node-base"
8795
 
        ]
8796
 
    }, 
8797
 
    "io-xdr": {
8798
 
        "requires": [
8799
 
            "io-base", 
8800
 
            "datatype-xml-parse"
8801
 
        ]
8802
 
    }, 
8803
 
    "json": {
8804
 
        "use": [
8805
 
            "json-parse", 
8806
 
            "json-stringify"
8807
 
        ]
8808
 
    }, 
8809
 
    "json-parse": {
8810
 
        "requires": [
8811
 
            "yui-base"
8812
 
        ]
8813
 
    }, 
8814
 
    "json-stringify": {
8815
 
        "requires": [
8816
 
            "yui-base"
8817
 
        ]
8818
 
    }, 
8819
 
    "jsonp": {
8820
 
        "requires": [
8821
 
            "get", 
8822
 
            "oop"
8823
 
        ]
8824
 
    }, 
8825
 
    "jsonp-url": {
8826
 
        "requires": [
8827
 
            "jsonp"
8828
 
        ]
8829
 
    }, 
8830
 
    "loader": {
8831
 
        "use": [
8832
 
            "loader-base", 
8833
 
            "loader-rollup", 
8834
 
            "loader-yui3"
8835
 
        ]
8836
 
    }, 
8837
 
    "loader-base": {
8838
 
        "requires": [
8839
 
            "get", 
8840
 
            "features"
8841
 
        ]
8842
 
    }, 
8843
 
    "loader-rollup": {
8844
 
        "requires": [
8845
 
            "loader-base"
8846
 
        ]
8847
 
    }, 
8848
 
    "loader-yui3": {
8849
 
        "requires": [
8850
 
            "loader-base"
8851
 
        ]
8852
 
    }, 
8853
 
    "matrix": {
8854
 
        "requires": [
8855
 
            "yui-base"
8856
 
        ]
8857
 
    }, 
8858
 
    "model": {
8859
 
        "requires": [
8860
 
            "base-build", 
8861
 
            "escape", 
8862
 
            "json-parse"
8863
 
        ]
8864
 
    }, 
8865
 
    "model-list": {
8866
 
        "requires": [
8867
 
            "array-extras", 
8868
 
            "array-invoke", 
8869
 
            "arraylist", 
8870
 
            "base-build", 
8871
 
            "escape", 
8872
 
            "json-parse", 
8873
 
            "model"
8874
 
        ]
8875
 
    }, 
8876
 
    "node": {
8877
 
        "use": [
8878
 
            "node-base", 
8879
 
            "node-event-delegate", 
8880
 
            "node-pluginhost", 
8881
 
            "node-screen", 
8882
 
            "node-style"
8883
 
        ]
8884
 
    }, 
8885
 
    "node-base": {
8886
 
        "requires": [
8887
 
            "event-base", 
8888
 
            "node-core", 
8889
 
            "dom-base"
8890
 
        ]
8891
 
    }, 
8892
 
    "node-core": {
8893
 
        "requires": [
8894
 
            "dom-core", 
8895
 
            "selector"
8896
 
        ]
8897
 
    }, 
8898
 
    "node-deprecated": {
8899
 
        "requires": [
8900
 
            "node-base"
8901
 
        ]
8902
 
    }, 
8903
 
    "node-event-delegate": {
8904
 
        "requires": [
8905
 
            "node-base", 
8906
 
            "event-delegate"
8907
 
        ]
8908
 
    }, 
8909
 
    "node-event-html5": {
8910
 
        "requires": [
8911
 
            "node-base"
8912
 
        ]
8913
 
    }, 
8914
 
    "node-event-simulate": {
8915
 
        "requires": [
8916
 
            "node-base", 
8917
 
            "event-simulate"
8918
 
        ]
8919
 
    }, 
8920
 
    "node-flick": {
8921
 
        "requires": [
8922
 
            "classnamemanager", 
8923
 
            "transition", 
8924
 
            "event-flick", 
8925
 
            "plugin"
8926
 
        ], 
8927
 
        "skinnable": true
8928
 
    }, 
8929
 
    "node-focusmanager": {
8930
 
        "requires": [
8931
 
            "attribute", 
8932
 
            "node", 
8933
 
            "plugin", 
8934
 
            "node-event-simulate", 
8935
 
            "event-key", 
8936
 
            "event-focus"
8937
 
        ]
8938
 
    }, 
8939
 
    "node-load": {
8940
 
        "requires": [
8941
 
            "node-base", 
8942
 
            "io-base"
8943
 
        ]
8944
 
    }, 
8945
 
    "node-menunav": {
8946
 
        "requires": [
8947
 
            "node", 
8948
 
            "classnamemanager", 
8949
 
            "plugin", 
8950
 
            "node-focusmanager"
8951
 
        ], 
8952
 
        "skinnable": true
8953
 
    }, 
8954
 
    "node-pluginhost": {
8955
 
        "requires": [
8956
 
            "node-base", 
8957
 
            "pluginhost"
8958
 
        ]
8959
 
    }, 
8960
 
    "node-screen": {
8961
 
        "requires": [
8962
 
            "dom-screen", 
8963
 
            "node-base"
8964
 
        ]
8965
 
    }, 
8966
 
    "node-style": {
8967
 
        "requires": [
8968
 
            "dom-style", 
8969
 
            "node-base"
8970
 
        ]
8971
 
    }, 
8972
 
    "oop": {
8973
 
        "requires": [
8974
 
            "yui-base"
8975
 
        ]
8976
 
    }, 
8977
 
    "overlay": {
8978
 
        "requires": [
8979
 
            "widget", 
8980
 
            "widget-stdmod", 
8981
 
            "widget-position", 
8982
 
            "widget-position-align", 
8983
 
            "widget-stack", 
8984
 
            "widget-position-constrain"
8985
 
        ], 
8986
 
        "skinnable": true
8987
 
    }, 
8988
 
    "panel": {
8989
 
        "requires": [
8990
 
            "widget", 
8991
 
            "widget-autohide", 
8992
 
            "widget-buttons", 
8993
 
            "widget-modality", 
8994
 
            "widget-position", 
8995
 
            "widget-position-align", 
8996
 
            "widget-position-constrain", 
8997
 
            "widget-stack", 
8998
 
            "widget-stdmod"
8999
 
        ], 
9000
 
        "skinnable": true
9001
 
    }, 
9002
 
    "parallel": {
9003
 
        "requires": [
9004
 
            "yui-base"
9005
 
        ]
9006
 
    }, 
9007
 
    "pjax": {
9008
 
        "requires": [
9009
 
            "pjax-base", 
9010
 
            "io-base"
9011
 
        ]
9012
 
    }, 
9013
 
    "pjax-base": {
9014
 
        "requires": [
9015
 
            "classnamemanager", 
9016
 
            "node-event-delegate", 
9017
 
            "router"
9018
 
        ]
9019
 
    }, 
9020
 
    "pjax-plugin": {
9021
 
        "requires": [
9022
 
            "node-pluginhost", 
9023
 
            "pjax", 
9024
 
            "plugin"
9025
 
        ]
9026
 
    }, 
9027
 
    "plugin": {
9028
 
        "requires": [
9029
 
            "base-base"
9030
 
        ]
9031
 
    }, 
9032
 
    "pluginhost": {
9033
 
        "use": [
9034
 
            "pluginhost-base", 
9035
 
            "pluginhost-config"
9036
 
        ]
9037
 
    }, 
9038
 
    "pluginhost-base": {
9039
 
        "requires": [
9040
 
            "yui-base"
9041
 
        ]
9042
 
    }, 
9043
 
    "pluginhost-config": {
9044
 
        "requires": [
9045
 
            "pluginhost-base"
9046
 
        ]
9047
 
    }, 
9048
 
    "profiler": {
9049
 
        "requires": [
9050
 
            "yui-base"
9051
 
        ]
9052
 
    }, 
9053
 
    "querystring": {
9054
 
        "use": [
9055
 
            "querystring-parse", 
9056
 
            "querystring-stringify"
9057
 
        ]
9058
 
    }, 
9059
 
    "querystring-parse": {
9060
 
        "requires": [
9061
 
            "yui-base", 
9062
 
            "array-extras"
9063
 
        ]
9064
 
    }, 
9065
 
    "querystring-parse-simple": {
9066
 
        "requires": [
9067
 
            "yui-base"
9068
 
        ]
9069
 
    }, 
9070
 
    "querystring-stringify": {
9071
 
        "requires": [
9072
 
            "yui-base"
9073
 
        ]
9074
 
    }, 
9075
 
    "querystring-stringify-simple": {
9076
 
        "requires": [
9077
 
            "yui-base"
9078
 
        ]
9079
 
    }, 
9080
 
    "queue-promote": {
9081
 
        "requires": [
9082
 
            "yui-base"
9083
 
        ]
9084
 
    }, 
9085
 
    "range-slider": {
9086
 
        "requires": [
9087
 
            "slider-base", 
9088
 
            "slider-value-range", 
9089
 
            "clickable-rail"
9090
 
        ]
9091
 
    }, 
9092
 
    "recordset": {
9093
 
        "use": [
9094
 
            "recordset-base", 
9095
 
            "recordset-sort", 
9096
 
            "recordset-filter", 
9097
 
            "recordset-indexer"
9098
 
        ]
9099
 
    }, 
9100
 
    "recordset-base": {
9101
 
        "requires": [
9102
 
            "base", 
9103
 
            "arraylist"
9104
 
        ]
9105
 
    }, 
9106
 
    "recordset-filter": {
9107
 
        "requires": [
9108
 
            "recordset-base", 
9109
 
            "array-extras", 
9110
 
            "plugin"
9111
 
        ]
9112
 
    }, 
9113
 
    "recordset-indexer": {
9114
 
        "requires": [
9115
 
            "recordset-base", 
9116
 
            "plugin"
9117
 
        ]
9118
 
    }, 
9119
 
    "recordset-sort": {
9120
 
        "requires": [
9121
 
            "arraysort", 
9122
 
            "recordset-base", 
9123
 
            "plugin"
9124
 
        ]
9125
 
    }, 
9126
 
    "resize": {
9127
 
        "use": [
9128
 
            "resize-base", 
9129
 
            "resize-proxy", 
9130
 
            "resize-constrain"
9131
 
        ]
9132
 
    }, 
9133
 
    "resize-base": {
9134
 
        "requires": [
9135
 
            "base", 
9136
 
            "widget", 
9137
 
            "substitute", 
9138
 
            "event", 
9139
 
            "oop", 
9140
 
            "dd-drag", 
9141
 
            "dd-delegate", 
9142
 
            "dd-drop"
9143
 
        ], 
9144
 
        "skinnable": true
9145
 
    }, 
9146
 
    "resize-constrain": {
9147
 
        "requires": [
9148
 
            "plugin", 
9149
 
            "resize-base"
9150
 
        ]
9151
 
    }, 
9152
 
    "resize-plugin": {
9153
 
        "optional": [
9154
 
            "resize-constrain"
9155
 
        ], 
9156
 
        "requires": [
9157
 
            "resize-base", 
9158
 
            "plugin"
9159
 
        ]
9160
 
    }, 
9161
 
    "resize-proxy": {
9162
 
        "requires": [
9163
 
            "plugin", 
9164
 
            "resize-base"
9165
 
        ]
9166
 
    }, 
9167
 
    "rls": {
9168
 
        "requires": [
9169
 
            "get", 
9170
 
            "features"
9171
 
        ]
9172
 
    }, 
9173
 
    "router": {
9174
 
        "optional": [
9175
 
            "querystring-parse"
9176
 
        ], 
9177
 
        "requires": [
9178
 
            "array-extras", 
9179
 
            "base-build", 
9180
 
            "history"
9181
 
        ]
9182
 
    }, 
9183
 
    "scrollview": {
9184
 
        "requires": [
9185
 
            "scrollview-base", 
9186
 
            "scrollview-scrollbars"
9187
 
        ]
9188
 
    }, 
9189
 
    "scrollview-base": {
9190
 
        "requires": [
9191
 
            "widget", 
9192
 
            "event-gestures", 
9193
 
            "event-mousewheel", 
9194
 
            "transition"
9195
 
        ], 
9196
 
        "skinnable": true
9197
 
    }, 
9198
 
    "scrollview-base-ie": {
9199
 
        "condition": {
9200
 
            "name": "scrollview-base-ie", 
9201
 
            "trigger": "scrollview-base", 
9202
 
            "ua": "ie"
9203
 
        }, 
9204
 
        "requires": [
9205
 
            "scrollview-base"
9206
 
        ]
9207
 
    }, 
9208
 
    "scrollview-list": {
9209
 
        "requires": [
9210
 
            "plugin", 
9211
 
            "classnamemanager"
9212
 
        ], 
9213
 
        "skinnable": true
9214
 
    }, 
9215
 
    "scrollview-paginator": {
9216
 
        "requires": [
9217
 
            "plugin"
9218
 
        ]
9219
 
    }, 
9220
 
    "scrollview-scrollbars": {
9221
 
        "requires": [
9222
 
            "classnamemanager", 
9223
 
            "transition", 
9224
 
            "plugin"
9225
 
        ], 
9226
 
        "skinnable": true
9227
 
    }, 
9228
 
    "selector": {
9229
 
        "requires": [
9230
 
            "selector-native"
9231
 
        ]
9232
 
    }, 
9233
 
    "selector-css2": {
9234
 
        "condition": {
9235
 
            "name": "selector-css2", 
9236
 
            "test": function (Y) {
9237
 
    var DOCUMENT = Y.config.doc,
9238
 
        ret = DOCUMENT && !('querySelectorAll' in DOCUMENT);
9239
 
 
9240
 
    return ret;
9241
 
}, 
9242
 
            "trigger": "selector"
9243
 
        }, 
9244
 
        "requires": [
9245
 
            "selector-native"
9246
 
        ]
9247
 
    }, 
9248
 
    "selector-css3": {
9249
 
        "requires": [
9250
 
            "selector-native", 
9251
 
            "selector-css2"
9252
 
        ]
9253
 
    }, 
9254
 
    "selector-native": {
9255
 
        "requires": [
9256
 
            "dom-base"
9257
 
        ]
9258
 
    }, 
9259
 
    "shim-plugin": {
9260
 
        "requires": [
9261
 
            "node-style", 
9262
 
            "node-pluginhost"
9263
 
        ]
9264
 
    }, 
9265
 
    "slider": {
9266
 
        "use": [
9267
 
            "slider-base", 
9268
 
            "slider-value-range", 
9269
 
            "clickable-rail", 
9270
 
            "range-slider"
9271
 
        ]
9272
 
    }, 
9273
 
    "slider-base": {
9274
 
        "requires": [
9275
 
            "widget", 
9276
 
            "dd-constrain", 
9277
 
            "substitute", 
9278
 
            "event-key"
9279
 
        ], 
9280
 
        "skinnable": true
9281
 
    }, 
9282
 
    "slider-value-range": {
9283
 
        "requires": [
9284
 
            "slider-base"
9285
 
        ]
9286
 
    }, 
9287
 
    "sortable": {
9288
 
        "requires": [
9289
 
            "dd-delegate", 
9290
 
            "dd-drop-plugin", 
9291
 
            "dd-proxy"
9292
 
        ]
9293
 
    }, 
9294
 
    "sortable-scroll": {
9295
 
        "requires": [
9296
 
            "dd-scroll", 
9297
 
            "sortable"
9298
 
        ]
9299
 
    }, 
9300
 
    "stylesheet": {
9301
 
        "requires": [
9302
 
            "yui-base"
9303
 
        ]
9304
 
    }, 
9305
 
    "substitute": {
9306
 
        "optional": [
9307
 
            "dump"
9308
 
        ], 
9309
 
        "requires": [
9310
 
            "yui-base"
9311
 
        ]
9312
 
    }, 
9313
 
    "swf": {
9314
 
        "requires": [
9315
 
            "event-custom", 
9316
 
            "node", 
9317
 
            "swfdetect", 
9318
 
            "escape"
9319
 
        ]
9320
 
    }, 
9321
 
    "swfdetect": {
9322
 
        "requires": [
9323
 
            "yui-base"
9324
 
        ]
9325
 
    }, 
9326
 
    "tabview": {
9327
 
        "requires": [
9328
 
            "widget", 
9329
 
            "widget-parent", 
9330
 
            "widget-child", 
9331
 
            "tabview-base", 
9332
 
            "node-pluginhost", 
9333
 
            "node-focusmanager"
9334
 
        ], 
9335
 
        "skinnable": true
9336
 
    }, 
9337
 
    "tabview-base": {
9338
 
        "requires": [
9339
 
            "node-event-delegate", 
9340
 
            "classnamemanager", 
9341
 
            "skin-sam-tabview"
9342
 
        ]
9343
 
    }, 
9344
 
    "tabview-plugin": {
9345
 
        "requires": [
9346
 
            "tabview-base"
9347
 
        ]
9348
 
    }, 
9349
 
    "test": {
9350
 
        "requires": [
9351
 
            "event-simulate", 
9352
 
            "event-custom", 
9353
 
            "substitute", 
9354
 
            "json-stringify"
9355
 
        ], 
9356
 
        "skinnable": true
9357
 
    }, 
9358
 
    "test-console": {
9359
 
        "requires": [
9360
 
            "console-filters", 
9361
 
            "test"
9362
 
        ], 
9363
 
        "skinnable": true
9364
 
    }, 
9365
 
    "text": {
9366
 
        "use": [
9367
 
            "text-accentfold", 
9368
 
            "text-wordbreak"
9369
 
        ]
9370
 
    }, 
9371
 
    "text-accentfold": {
9372
 
        "requires": [
9373
 
            "array-extras", 
9374
 
            "text-data-accentfold"
9375
 
        ]
9376
 
    }, 
9377
 
    "text-data-accentfold": {
9378
 
        "requires": [
9379
 
            "yui-base"
9380
 
        ]
9381
 
    }, 
9382
 
    "text-data-wordbreak": {
9383
 
        "requires": [
9384
 
            "yui-base"
9385
 
        ]
9386
 
    }, 
9387
 
    "text-wordbreak": {
9388
 
        "requires": [
9389
 
            "array-extras", 
9390
 
            "text-data-wordbreak"
9391
 
        ]
9392
 
    }, 
9393
 
    "transition": {
9394
 
        "requires": [
9395
 
            "node-style"
9396
 
        ]
9397
 
    }, 
9398
 
    "transition-timer": {
9399
 
        "condition": {
9400
 
            "name": "transition-timer", 
9401
 
            "test": function (Y) {
9402
 
    var DOCUMENT = Y.config.doc,
9403
 
        node = (DOCUMENT) ? DOCUMENT.documentElement: null,
9404
 
        ret = true;
9405
 
 
9406
 
    if (node && node.style) {
9407
 
        ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);
9408
 
    } 
9409
 
 
9410
 
    return ret;
9411
 
}, 
9412
 
            "trigger": "transition"
9413
 
        }, 
9414
 
        "requires": [
9415
 
            "transition"
9416
 
        ]
9417
 
    }, 
9418
 
    "uploader": {
9419
 
        "requires": [
9420
 
            "uploader-html5", 
9421
 
            "uploader-flash"
9422
 
        ]
9423
 
    }, 
9424
 
    "uploader-deprecated": {
9425
 
        "requires": [
9426
 
            "event-custom", 
9427
 
            "node", 
9428
 
            "base", 
9429
 
            "swf"
9430
 
        ]
9431
 
    }, 
9432
 
    "uploader-flash": {
9433
 
        "requires": [
9434
 
            "swf", 
9435
 
            "widget", 
9436
 
            "substitute", 
9437
 
            "base", 
9438
 
            "cssbutton", 
9439
 
            "node", 
9440
 
            "event-custom", 
9441
 
            "file-flash", 
9442
 
            "uploader-queue"
9443
 
        ]
9444
 
    }, 
9445
 
    "uploader-html5": {
9446
 
        "requires": [
9447
 
            "widget", 
9448
 
            "node-event-simulate", 
9449
 
            "substitute", 
9450
 
            "file-html5", 
9451
 
            "uploader-queue"
9452
 
        ]
9453
 
    }, 
9454
 
    "uploader-queue": {
9455
 
        "requires": [
9456
 
            "base"
9457
 
        ]
9458
 
    }, 
9459
 
    "view": {
9460
 
        "requires": [
9461
 
            "base-build", 
9462
 
            "node-event-delegate"
9463
 
        ]
9464
 
    }, 
9465
 
    "view-node-map": {
9466
 
        "requires": [
9467
 
            "view"
9468
 
        ]
9469
 
    }, 
9470
 
    "widget": {
9471
 
        "use": [
9472
 
            "widget-base", 
9473
 
            "widget-htmlparser", 
9474
 
            "widget-skin", 
9475
 
            "widget-uievents"
9476
 
        ]
9477
 
    }, 
9478
 
    "widget-anim": {
9479
 
        "requires": [
9480
 
            "anim-base", 
9481
 
            "plugin", 
9482
 
            "widget"
9483
 
        ]
9484
 
    }, 
9485
 
    "widget-autohide": {
9486
 
        "requires": [
9487
 
            "base-build", 
9488
 
            "event-key", 
9489
 
            "event-outside", 
9490
 
            "widget"
9491
 
        ]
9492
 
    }, 
9493
 
    "widget-base": {
9494
 
        "requires": [
9495
 
            "attribute", 
9496
 
            "base-base", 
9497
 
            "base-pluginhost", 
9498
 
            "classnamemanager", 
9499
 
            "event-focus", 
9500
 
            "node-base", 
9501
 
            "node-style"
9502
 
        ], 
9503
 
        "skinnable": true
9504
 
    }, 
9505
 
    "widget-base-ie": {
9506
 
        "condition": {
9507
 
            "name": "widget-base-ie", 
9508
 
            "trigger": "widget-base", 
9509
 
            "ua": "ie"
9510
 
        }, 
9511
 
        "requires": [
9512
 
            "widget-base"
9513
 
        ]
9514
 
    }, 
9515
 
    "widget-buttons": {
9516
 
        "requires": [
9517
 
            "button-plugin", 
9518
 
            "cssbutton", 
9519
 
            "widget-stdmod"
9520
 
        ]
9521
 
    }, 
9522
 
    "widget-child": {
9523
 
        "requires": [
9524
 
            "base-build", 
9525
 
            "widget"
9526
 
        ]
9527
 
    }, 
9528
 
    "widget-htmlparser": {
9529
 
        "requires": [
9530
 
            "widget-base"
9531
 
        ]
9532
 
    }, 
9533
 
    "widget-locale": {
9534
 
        "requires": [
9535
 
            "widget-base"
9536
 
        ]
9537
 
    }, 
9538
 
    "widget-modality": {
9539
 
        "requires": [
9540
 
            "base-build", 
9541
 
            "event-outside", 
9542
 
            "widget"
9543
 
        ], 
9544
 
        "skinnable": true
9545
 
    }, 
9546
 
    "widget-parent": {
9547
 
        "requires": [
9548
 
            "arraylist", 
9549
 
            "base-build", 
9550
 
            "widget"
9551
 
        ]
9552
 
    }, 
9553
 
    "widget-position": {
9554
 
        "requires": [
9555
 
            "base-build", 
9556
 
            "node-screen", 
9557
 
            "widget"
9558
 
        ]
9559
 
    }, 
9560
 
    "widget-position-align": {
9561
 
        "requires": [
9562
 
            "widget-position"
9563
 
        ]
9564
 
    }, 
9565
 
    "widget-position-constrain": {
9566
 
        "requires": [
9567
 
            "widget-position"
9568
 
        ]
9569
 
    }, 
9570
 
    "widget-skin": {
9571
 
        "requires": [
9572
 
            "widget-base"
9573
 
        ]
9574
 
    }, 
9575
 
    "widget-stack": {
9576
 
        "requires": [
9577
 
            "base-build", 
9578
 
            "widget"
9579
 
        ], 
9580
 
        "skinnable": true
9581
 
    }, 
9582
 
    "widget-stdmod": {
9583
 
        "requires": [
9584
 
            "base-build", 
9585
 
            "widget"
9586
 
        ]
9587
 
    }, 
9588
 
    "widget-uievents": {
9589
 
        "requires": [
9590
 
            "node-event-delegate", 
9591
 
            "widget-base"
9592
 
        ]
9593
 
    }, 
9594
 
    "yql": {
9595
 
        "requires": [
9596
 
            "jsonp", 
9597
 
            "jsonp-url"
9598
 
        ]
9599
 
    }, 
9600
 
    "yui": {}, 
9601
 
    "yui-base": {}, 
9602
 
    "yui-later": {
9603
 
        "requires": [
9604
 
            "yui-base"
9605
 
        ]
9606
 
    }, 
9607
 
    "yui-log": {
9608
 
        "requires": [
9609
 
            "yui-base"
9610
 
        ]
9611
 
    }, 
9612
 
    "yui-rls": {}, 
9613
 
    "yui-throttle": {
9614
 
        "requires": [
9615
 
            "yui-base"
9616
 
        ]
9617
 
    }
9618
 
};
9619
 
YUI.Env[Y.version].md5 = 'f5a3bc9bda2441a3b15fb52c567fc1f7';
9620
 
 
9621
 
 
9622
 
}, '3.5.0' ,{requires:['loader-base']});
9623
 
 
9624
 
 
9625
 
YUI.add('yui', function(Y){}, '3.5.0' ,{use:['yui-base','get','features','intl-base','yui-log','yui-log-nodejs','yui-later','loader-base', 'loader-rollup', 'loader-yui3']});
9626