code_text
stringlengths 604
999k
| repo_name
stringlengths 4
100
| file_path
stringlengths 4
873
| language
stringclasses 23
values | license
stringclasses 15
values | size
int32 1.02k
999k
|
---|---|---|---|---|---|
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"\u0e01\u0e48\u0e2d\u0e19\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07",
"\u0e2b\u0e25\u0e31\u0e07\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07"
],
"DAY": [
"\u0e27\u0e31\u0e19\u0e2d\u0e32\u0e17\u0e34\u0e15\u0e22\u0e4c",
"\u0e27\u0e31\u0e19\u0e08\u0e31\u0e19\u0e17\u0e23\u0e4c",
"\u0e27\u0e31\u0e19\u0e2d\u0e31\u0e07\u0e04\u0e32\u0e23",
"\u0e27\u0e31\u0e19\u0e1e\u0e38\u0e18",
"\u0e27\u0e31\u0e19\u0e1e\u0e24\u0e2b\u0e31\u0e2a\u0e1a\u0e14\u0e35",
"\u0e27\u0e31\u0e19\u0e28\u0e38\u0e01\u0e23\u0e4c",
"\u0e27\u0e31\u0e19\u0e40\u0e2a\u0e32\u0e23\u0e4c"
],
"MONTH": [
"\u0e21\u0e01\u0e23\u0e32\u0e04\u0e21",
"\u0e01\u0e38\u0e21\u0e20\u0e32\u0e1e\u0e31\u0e19\u0e18\u0e4c",
"\u0e21\u0e35\u0e19\u0e32\u0e04\u0e21",
"\u0e40\u0e21\u0e29\u0e32\u0e22\u0e19",
"\u0e1e\u0e24\u0e29\u0e20\u0e32\u0e04\u0e21",
"\u0e21\u0e34\u0e16\u0e38\u0e19\u0e32\u0e22\u0e19",
"\u0e01\u0e23\u0e01\u0e0e\u0e32\u0e04\u0e21",
"\u0e2a\u0e34\u0e07\u0e2b\u0e32\u0e04\u0e21",
"\u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19",
"\u0e15\u0e38\u0e25\u0e32\u0e04\u0e21",
"\u0e1e\u0e24\u0e28\u0e08\u0e34\u0e01\u0e32\u0e22\u0e19",
"\u0e18\u0e31\u0e19\u0e27\u0e32\u0e04\u0e21"
],
"SHORTDAY": [
"\u0e2d\u0e32.",
"\u0e08.",
"\u0e2d.",
"\u0e1e.",
"\u0e1e\u0e24.",
"\u0e28.",
"\u0e2a."
],
"SHORTMONTH": [
"\u0e21.\u0e04.",
"\u0e01.\u0e1e.",
"\u0e21\u0e35.\u0e04.",
"\u0e40\u0e21.\u0e22.",
"\u0e1e.\u0e04.",
"\u0e21\u0e34.\u0e22.",
"\u0e01.\u0e04.",
"\u0e2a.\u0e04.",
"\u0e01.\u0e22.",
"\u0e15.\u0e04.",
"\u0e1e.\u0e22.",
"\u0e18.\u0e04."
],
"fullDate": "EEEE\u0e17\u0e35\u0e48 d MMMM G y",
"longDate": "d MMMM y",
"medium": "d MMM y H:mm:ss",
"mediumDate": "d MMM y",
"mediumTime": "H:mm:ss",
"short": "d/M/yyyy H:mm",
"shortDate": "d/M/yyyy",
"shortTime": "H:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u0e3f",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(\u00a4",
"negSuf": ")",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "th-th",
"pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;}
});
}]); | wormful/cdnjs | ajax/libs/angular.js/1.2.2/i18n/angular-locale_th-th.js | JavaScript | mit | 2,947 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"\u0635",
"\u0645"
],
"DAY": [
"\u0627\u0644\u0623\u062d\u062f",
"\u0627\u0644\u0627\u062b\u0646\u064a\u0646",
"\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621",
"\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621",
"\u0627\u0644\u062e\u0645\u064a\u0633",
"\u0627\u0644\u062c\u0645\u0639\u0629",
"\u0627\u0644\u0633\u0628\u062a"
],
"MONTH": [
"\u064a\u0646\u0627\u064a\u0631",
"\u0641\u0628\u0631\u0627\u064a\u0631",
"\u0645\u0627\u0631\u0633",
"\u0623\u0628\u0631\u064a\u0644",
"\u0645\u0627\u064a\u0648",
"\u064a\u0648\u0646\u064a\u0648",
"\u064a\u0648\u0644\u064a\u0648",
"\u0623\u063a\u0633\u0637\u0633",
"\u0633\u0628\u062a\u0645\u0628\u0631",
"\u0623\u0643\u062a\u0648\u0628\u0631",
"\u0646\u0648\u0641\u0645\u0628\u0631",
"\u062f\u064a\u0633\u0645\u0628\u0631"
],
"SHORTDAY": [
"\u0627\u0644\u0623\u062d\u062f",
"\u0627\u0644\u0627\u062b\u0646\u064a\u0646",
"\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621",
"\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621",
"\u0627\u0644\u062e\u0645\u064a\u0633",
"\u0627\u0644\u062c\u0645\u0639\u0629",
"\u0627\u0644\u0633\u0628\u062a"
],
"SHORTMONTH": [
"\u064a\u0646\u0627\u064a\u0631",
"\u0641\u0628\u0631\u0627\u064a\u0631",
"\u0645\u0627\u0631\u0633",
"\u0623\u0628\u0631\u064a\u0644",
"\u0645\u0627\u064a\u0648",
"\u064a\u0648\u0646\u064a\u0648",
"\u064a\u0648\u0644\u064a\u0648",
"\u0623\u063a\u0633\u0637\u0633",
"\u0633\u0628\u062a\u0645\u0628\u0631",
"\u0623\u0643\u062a\u0648\u0628\u0631",
"\u0646\u0648\u0641\u0645\u0628\u0631",
"\u062f\u064a\u0633\u0645\u0628\u0631"
],
"fullDate": "EEEE\u060c d MMMM\u060c y",
"longDate": "d MMMM\u060c y",
"medium": "dd\u200f/MM\u200f/yyyy h:mm:ss a",
"mediumDate": "dd\u200f/MM\u200f/yyyy",
"mediumTime": "h:mm:ss a",
"short": "d\u200f/M\u200f/yyyy h:mm a",
"shortDate": "d\u200f/M\u200f/yyyy",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u00a3",
"DECIMAL_SEP": "\u066b",
"GROUP_SEP": "\u066c",
"PATTERNS": [
{
"gSize": 0,
"lgSize": 0,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "",
"negSuf": "-",
"posPre": "",
"posSuf": ""
},
{
"gSize": 0,
"lgSize": 0,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "\u00a4\u00a0",
"negSuf": "-",
"posPre": "\u00a4\u00a0",
"posSuf": ""
}
]
},
"id": "ar-kw",
"pluralCat": function (n) { if (n == 0) { return PLURAL_CATEGORY.ZERO; } if (n == 1) { return PLURAL_CATEGORY.ONE; } if (n == 2) { return PLURAL_CATEGORY.TWO; } if (n == (n | 0) && n % 100 >= 3 && n % 100 <= 10) { return PLURAL_CATEGORY.FEW; } if (n == (n | 0) && n % 100 >= 11 && n % 100 <= 99) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
});
}]); | mikaelbr/cdnjs | ajax/libs/angular.js/1.2.24/i18n/angular-locale_ar-kw.js | JavaScript | mit | 3,408 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"AM",
"PM"
],
"DAY": [
"zondag",
"maandag",
"dinsdag",
"woensdag",
"donderdag",
"vrijdag",
"zaterdag"
],
"MONTH": [
"januari",
"februari",
"maart",
"april",
"mei",
"juni",
"juli",
"augustus",
"september",
"oktober",
"november",
"december"
],
"SHORTDAY": [
"zo",
"ma",
"di",
"wo",
"do",
"vr",
"za"
],
"SHORTMONTH": [
"jan.",
"feb.",
"mrt.",
"apr.",
"mei",
"jun.",
"jul.",
"aug.",
"sep.",
"okt.",
"nov.",
"dec."
],
"fullDate": "EEEE d MMMM y",
"longDate": "d MMMM y",
"medium": "d MMM y HH:mm:ss",
"mediumDate": "d MMM y",
"mediumTime": "HH:mm:ss",
"short": "dd-MM-yy HH:mm",
"shortDate": "dd-MM-yy",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "\u00a4\u00a0",
"negSuf": "-",
"posPre": "\u00a4\u00a0",
"posSuf": ""
}
]
},
"id": "nl-sx",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | dy-dx/cdnjs | ajax/libs/angular-i18n/1.2.0/angular-locale_nl-sx.js | JavaScript | mit | 1,934 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"vm.",
"nm."
],
"DAY": [
"Sondag",
"Maandag",
"Dinsdag",
"Woensdag",
"Donderdag",
"Vrydag",
"Saterdag"
],
"MONTH": [
"Januarie",
"Februarie",
"Maart",
"April",
"Mei",
"Junie",
"Julie",
"Augustus",
"September",
"Oktober",
"November",
"Desember"
],
"SHORTDAY": [
"So",
"Ma",
"Di",
"Wo",
"Do",
"Vr",
"Sa"
],
"SHORTMONTH": [
"Jan",
"Feb",
"Mar",
"Apr",
"Mei",
"Jun",
"Jul",
"Aug",
"Sep",
"Okt",
"Nov",
"Des"
],
"fullDate": "EEEE dd MMMM y",
"longDate": "dd MMMM y",
"medium": "dd MMM y h:mm:ss a",
"mediumDate": "dd MMM y",
"mediumTime": "h:mm:ss a",
"short": "yyyy-MM-dd h:mm a",
"shortDate": "yyyy-MM-dd",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "R",
"DECIMAL_SEP": ",",
"GROUP_SEP": "\u00a0",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(\u00a4",
"negSuf": ")",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "af",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | Sneezry/cdnjs | ajax/libs/angular-i18n/1.2.10/angular-locale_af.js | JavaScript | mit | 1,926 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"\u0635",
"\u0645"
],
"DAY": [
"\u0627\u0644\u0623\u062d\u062f",
"\u0627\u0644\u0627\u062b\u0646\u064a\u0646",
"\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621",
"\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621",
"\u0627\u0644\u062e\u0645\u064a\u0633",
"\u0627\u0644\u062c\u0645\u0639\u0629",
"\u0627\u0644\u0633\u0628\u062a"
],
"MONTH": [
"\u064a\u0646\u0627\u064a\u0631",
"\u0641\u0628\u0631\u0627\u064a\u0631",
"\u0645\u0627\u0631\u0633",
"\u0623\u0628\u0631\u064a\u0644",
"\u0645\u0627\u064a\u0648",
"\u064a\u0648\u0646\u064a\u0648",
"\u064a\u0648\u0644\u064a\u0648",
"\u0623\u063a\u0633\u0637\u0633",
"\u0633\u0628\u062a\u0645\u0628\u0631",
"\u0623\u0643\u062a\u0648\u0628\u0631",
"\u0646\u0648\u0641\u0645\u0628\u0631",
"\u062f\u064a\u0633\u0645\u0628\u0631"
],
"SHORTDAY": [
"\u0627\u0644\u0623\u062d\u062f",
"\u0627\u0644\u0627\u062b\u0646\u064a\u0646",
"\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621",
"\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621",
"\u0627\u0644\u062e\u0645\u064a\u0633",
"\u0627\u0644\u062c\u0645\u0639\u0629",
"\u0627\u0644\u0633\u0628\u062a"
],
"SHORTMONTH": [
"\u064a\u0646\u0627\u064a\u0631",
"\u0641\u0628\u0631\u0627\u064a\u0631",
"\u0645\u0627\u0631\u0633",
"\u0623\u0628\u0631\u064a\u0644",
"\u0645\u0627\u064a\u0648",
"\u064a\u0648\u0646\u064a\u0648",
"\u064a\u0648\u0644\u064a\u0648",
"\u0623\u063a\u0633\u0637\u0633",
"\u0633\u0628\u062a\u0645\u0628\u0631",
"\u0623\u0643\u062a\u0648\u0628\u0631",
"\u0646\u0648\u0641\u0645\u0628\u0631",
"\u062f\u064a\u0633\u0645\u0628\u0631"
],
"fullDate": "EEEE\u060c d MMMM\u060c y",
"longDate": "d MMMM\u060c y",
"medium": "dd\u200f/MM\u200f/yyyy h:mm:ss a",
"mediumDate": "dd\u200f/MM\u200f/yyyy",
"mediumTime": "h:mm:ss a",
"short": "d\u200f/M\u200f/yyyy h:mm a",
"shortDate": "d\u200f/M\u200f/yyyy",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u00a3",
"DECIMAL_SEP": "\u066b",
"GROUP_SEP": "\u066c",
"PATTERNS": [
{
"gSize": 0,
"lgSize": 0,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "",
"negSuf": "-",
"posPre": "",
"posSuf": ""
},
{
"gSize": 0,
"lgSize": 0,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "\u00a4\u00a0",
"negSuf": "-",
"posPre": "\u00a4\u00a0",
"posSuf": ""
}
]
},
"id": "ar-kw",
"pluralCat": function (n) { if (n == 0) { return PLURAL_CATEGORY.ZERO; } if (n == 1) { return PLURAL_CATEGORY.ONE; } if (n == 2) { return PLURAL_CATEGORY.TWO; } if (n == (n | 0) && n % 100 >= 3 && n % 100 <= 10) { return PLURAL_CATEGORY.FEW; } if (n == (n | 0) && n % 100 >= 11 && n % 100 <= 99) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
});
}]); | nolsherry/cdnjs | ajax/libs/angular.js/1.2.14/i18n/angular-locale_ar-kw.js | JavaScript | mit | 3,408 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"a.m.",
"p.m."
],
"DAY": [
"domingo",
"lunes",
"martes",
"mi\u00e9rcoles",
"jueves",
"viernes",
"s\u00e1bado"
],
"MONTH": [
"enero",
"febrero",
"marzo",
"abril",
"mayo",
"junio",
"julio",
"agosto",
"septiembre",
"octubre",
"noviembre",
"diciembre"
],
"SHORTDAY": [
"dom",
"lun",
"mar",
"mi\u00e9",
"jue",
"vie",
"s\u00e1b"
],
"SHORTMONTH": [
"ene",
"feb",
"mar",
"abr",
"may",
"jun",
"jul",
"ago",
"sep",
"oct",
"nov",
"dic"
],
"fullDate": "EEEE, d 'de' MMMM 'de' y",
"longDate": "d 'de' MMMM 'de' y",
"medium": "dd/MM/yyyy HH:mm:ss",
"mediumDate": "dd/MM/yyyy",
"mediumTime": "HH:mm:ss",
"short": "dd/MM/yy HH:mm",
"shortDate": "dd/MM/yy",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "es-ve",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | mojio/cdnjs | ajax/libs/angular-i18n/1.2.3/angular-locale_es-ve.js | JavaScript | mit | 1,976 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"AM",
"PM"
],
"DAY": [
"zondag",
"maandag",
"dinsdag",
"woensdag",
"donderdag",
"vrijdag",
"zaterdag"
],
"MONTH": [
"januari",
"februari",
"maart",
"april",
"mei",
"juni",
"juli",
"augustus",
"september",
"oktober",
"november",
"december"
],
"SHORTDAY": [
"zo",
"ma",
"di",
"wo",
"do",
"vr",
"za"
],
"SHORTMONTH": [
"jan.",
"feb.",
"mrt.",
"apr.",
"mei",
"jun.",
"jul.",
"aug.",
"sep.",
"okt.",
"nov.",
"dec."
],
"fullDate": "EEEE d MMMM y",
"longDate": "d MMMM y",
"medium": "d MMM y HH:mm:ss",
"mediumDate": "d MMM y",
"mediumTime": "HH:mm:ss",
"short": "dd-MM-yy HH:mm",
"shortDate": "dd-MM-yy",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "\u00a4\u00a0",
"negSuf": "-",
"posPre": "\u00a4\u00a0",
"posSuf": ""
}
]
},
"id": "nl-sx",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | joseluisq/cdnjs | ajax/libs/angular.js/1.2.12/i18n/angular-locale_nl-sx.js | JavaScript | mit | 1,934 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"\u0635",
"\u0645"
],
"DAY": [
"\u0627\u0644\u0623\u062d\u062f",
"\u0627\u0644\u0627\u062b\u0646\u064a\u0646",
"\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621",
"\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621",
"\u0627\u0644\u062e\u0645\u064a\u0633",
"\u0627\u0644\u062c\u0645\u0639\u0629",
"\u0627\u0644\u0633\u0628\u062a"
],
"MONTH": [
"\u064a\u0646\u0627\u064a\u0631",
"\u0641\u0628\u0631\u0627\u064a\u0631",
"\u0645\u0627\u0631\u0633",
"\u0623\u0628\u0631\u064a\u0644",
"\u0645\u0627\u064a\u0648",
"\u064a\u0648\u0646\u064a\u0648",
"\u064a\u0648\u0644\u064a\u0648",
"\u0623\u063a\u0633\u0637\u0633",
"\u0633\u0628\u062a\u0645\u0628\u0631",
"\u0623\u0643\u062a\u0648\u0628\u0631",
"\u0646\u0648\u0641\u0645\u0628\u0631",
"\u062f\u064a\u0633\u0645\u0628\u0631"
],
"SHORTDAY": [
"\u0627\u0644\u0623\u062d\u062f",
"\u0627\u0644\u0627\u062b\u0646\u064a\u0646",
"\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621",
"\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621",
"\u0627\u0644\u062e\u0645\u064a\u0633",
"\u0627\u0644\u062c\u0645\u0639\u0629",
"\u0627\u0644\u0633\u0628\u062a"
],
"SHORTMONTH": [
"\u064a\u0646\u0627\u064a\u0631",
"\u0641\u0628\u0631\u0627\u064a\u0631",
"\u0645\u0627\u0631\u0633",
"\u0623\u0628\u0631\u064a\u0644",
"\u0645\u0627\u064a\u0648",
"\u064a\u0648\u0646\u064a\u0648",
"\u064a\u0648\u0644\u064a\u0648",
"\u0623\u063a\u0633\u0637\u0633",
"\u0633\u0628\u062a\u0645\u0628\u0631",
"\u0623\u0643\u062a\u0648\u0628\u0631",
"\u0646\u0648\u0641\u0645\u0628\u0631",
"\u062f\u064a\u0633\u0645\u0628\u0631"
],
"fullDate": "EEEE\u060c d MMMM\u060c y",
"longDate": "d MMMM\u060c y",
"medium": "dd\u200f/MM\u200f/yyyy h:mm:ss a",
"mediumDate": "dd\u200f/MM\u200f/yyyy",
"mediumTime": "h:mm:ss a",
"short": "d\u200f/M\u200f/yyyy h:mm a",
"shortDate": "d\u200f/M\u200f/yyyy",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u00a3",
"DECIMAL_SEP": "\u066b",
"GROUP_SEP": "\u066c",
"PATTERNS": [
{
"gSize": 0,
"lgSize": 0,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "",
"negSuf": "-",
"posPre": "",
"posSuf": ""
},
{
"gSize": 0,
"lgSize": 0,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "\u00a4\u00a0",
"negSuf": "-",
"posPre": "\u00a4\u00a0",
"posSuf": ""
}
]
},
"id": "ar-kw",
"pluralCat": function (n) { if (n == 0) { return PLURAL_CATEGORY.ZERO; } if (n == 1) { return PLURAL_CATEGORY.ONE; } if (n == 2) { return PLURAL_CATEGORY.TWO; } if (n == (n | 0) && n % 100 >= 3 && n % 100 <= 10) { return PLURAL_CATEGORY.FEW; } if (n == (n | 0) && n % 100 >= 11 && n % 100 <= 99) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
});
}]); | laffer1/cdnjs | ajax/libs/angular.js/1.2.20/i18n/angular-locale_ar-kw.js | JavaScript | mit | 3,408 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"enne keskp\u00e4eva",
"p\u00e4rast keskp\u00e4eva"
],
"DAY": [
"p\u00fchap\u00e4ev",
"esmasp\u00e4ev",
"teisip\u00e4ev",
"kolmap\u00e4ev",
"neljap\u00e4ev",
"reede",
"laup\u00e4ev"
],
"MONTH": [
"jaanuar",
"veebruar",
"m\u00e4rts",
"aprill",
"mai",
"juuni",
"juuli",
"august",
"september",
"oktoober",
"november",
"detsember"
],
"SHORTDAY": [
"P",
"E",
"T",
"K",
"N",
"R",
"L"
],
"SHORTMONTH": [
"jaan",
"veebr",
"m\u00e4rts",
"apr",
"mai",
"juuni",
"juuli",
"aug",
"sept",
"okt",
"nov",
"dets"
],
"fullDate": "EEEE, d. MMMM y",
"longDate": "d. MMMM y",
"medium": "dd.MM.yyyy H:mm.ss",
"mediumDate": "dd.MM.yyyy",
"mediumTime": "H:mm.ss",
"short": "dd.MM.yy H:mm",
"shortDate": "dd.MM.yy",
"shortTime": "H:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"DECIMAL_SEP": ",",
"GROUP_SEP": "\u00a0",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 0,
"lgSize": 0,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(",
"negSuf": "\u00a4)",
"posPre": "",
"posSuf": "\u00a4"
}
]
},
"id": "et-ee",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | hanbyul-here/cdnjs | ajax/libs/angular.js/1.2.5/i18n/angular-locale_et-ee.js | JavaScript | mit | 2,019 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"\u043f\u0440\u0435 \u043f\u043e\u0434\u043d\u0435",
"\u043f\u043e\u043f\u043e\u0434\u043d\u0435"
],
"DAY": [
"\u043d\u0435\u0434\u0435\u0459\u0430",
"\u043f\u043e\u043d\u0435\u0434\u0435\u0459\u0430\u043a",
"\u0443\u0442\u043e\u0440\u0430\u043a",
"\u0441\u0440\u0435\u0434\u0430",
"\u0447\u0435\u0442\u0432\u0440\u0442\u0430\u043a",
"\u043f\u0435\u0442\u0430\u043a",
"\u0441\u0443\u0431\u043e\u0442\u0430"
],
"MONTH": [
"\u0458\u0430\u043d\u0443\u0430\u0440",
"\u0444\u0435\u0431\u0440\u0443\u0430\u0440",
"\u043c\u0430\u0440\u0442",
"\u0430\u043f\u0440\u0438\u043b",
"\u043c\u0430\u0458",
"\u0458\u0443\u043d",
"\u0458\u0443\u043b",
"\u0430\u0432\u0433\u0443\u0441\u0442",
"\u0441\u0435\u043f\u0442\u0435\u043c\u0431\u0430\u0440",
"\u043e\u043a\u0442\u043e\u0431\u0430\u0440",
"\u043d\u043e\u0432\u0435\u043c\u0431\u0430\u0440",
"\u0434\u0435\u0446\u0435\u043c\u0431\u0430\u0440"
],
"SHORTDAY": [
"\u043d\u0435\u0434",
"\u043f\u043e\u043d",
"\u0443\u0442\u043e",
"\u0441\u0440\u0435",
"\u0447\u0435\u0442",
"\u043f\u0435\u0442",
"\u0441\u0443\u0431"
],
"SHORTMONTH": [
"\u0458\u0430\u043d",
"\u0444\u0435\u0431",
"\u043c\u0430\u0440",
"\u0430\u043f\u0440",
"\u043c\u0430\u0458",
"\u0458\u0443\u043d",
"\u0458\u0443\u043b",
"\u0430\u0432\u0433",
"\u0441\u0435\u043f",
"\u043e\u043a\u0442",
"\u043d\u043e\u0432",
"\u0434\u0435\u0446"
],
"fullDate": "EEEE, dd. MMMM y.",
"longDate": "dd. MMMM y.",
"medium": "dd.MM.y. HH.mm.ss",
"mediumDate": "dd.MM.y.",
"mediumTime": "HH.mm.ss",
"short": "d.M.yy. HH.mm",
"shortDate": "d.M.yy.",
"shortTime": "HH.mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "din",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "sr-cyrl-rs",
"pluralCat": function (n) { if (n % 10 == 1 && n % 100 != 11) { return PLURAL_CATEGORY.ONE; } if (n == (n | 0) && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) { return PLURAL_CATEGORY.FEW; } if (n % 10 == 0 || n == (n | 0) && n % 10 >= 5 && n % 10 <= 9 || n == (n | 0) && n % 100 >= 11 && n % 100 <= 14) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
});
}]); | Teino1978-Corp/Teino1978-Corp-cdnjs | ajax/libs/angular.js/1.2.12/i18n/angular-locale_sr-cyrl-rs.js | JavaScript | mit | 3,157 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"SA",
"CH"
],
"DAY": [
"Ch\u1ee7 nh\u1eadt",
"Th\u1ee9 hai",
"Th\u1ee9 ba",
"Th\u1ee9 t\u01b0",
"Th\u1ee9 n\u0103m",
"Th\u1ee9 s\u00e1u",
"Th\u1ee9 b\u1ea3y"
],
"MONTH": [
"th\u00e1ng m\u1ed9t",
"th\u00e1ng hai",
"th\u00e1ng ba",
"th\u00e1ng t\u01b0",
"th\u00e1ng n\u0103m",
"th\u00e1ng s\u00e1u",
"th\u00e1ng b\u1ea3y",
"th\u00e1ng t\u00e1m",
"th\u00e1ng ch\u00edn",
"th\u00e1ng m\u01b0\u1eddi",
"th\u00e1ng m\u01b0\u1eddi m\u1ed9t",
"th\u00e1ng m\u01b0\u1eddi hai"
],
"SHORTDAY": [
"CN",
"Th 2",
"Th 3",
"Th 4",
"Th 5",
"Th 6",
"Th 7"
],
"SHORTMONTH": [
"thg 1",
"thg 2",
"thg 3",
"thg 4",
"thg 5",
"thg 6",
"thg 7",
"thg 8",
"thg 9",
"thg 10",
"thg 11",
"thg 12"
],
"fullDate": "EEEE, 'ng\u00e0y' dd MMMM 'n\u0103m' y",
"longDate": "'Ng\u00e0y' dd 'th\u00e1ng' M 'n\u0103m' y",
"medium": "dd-MM-yyyy HH:mm:ss",
"mediumDate": "dd-MM-yyyy",
"mediumTime": "HH:mm:ss",
"short": "dd/MM/yyyy HH:mm",
"shortDate": "dd/MM/yyyy",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ab",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "vi-vn",
"pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;}
});
}]); | ankitjamuar/cdnjs | ajax/libs/angular.js/1.2.17/i18n/angular-locale_vi-vn.js | JavaScript | mit | 2,211 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"\u4e0a\u5348",
"\u4e0b\u5348"
],
"DAY": [
"\u661f\u671f\u65e5",
"\u661f\u671f\u4e00",
"\u661f\u671f\u4e8c",
"\u661f\u671f\u4e09",
"\u661f\u671f\u56db",
"\u661f\u671f\u4e94",
"\u661f\u671f\u516d"
],
"MONTH": [
"1\u6708",
"2\u6708",
"3\u6708",
"4\u6708",
"5\u6708",
"6\u6708",
"7\u6708",
"8\u6708",
"9\u6708",
"10\u6708",
"11\u6708",
"12\u6708"
],
"SHORTDAY": [
"\u5468\u65e5",
"\u5468\u4e00",
"\u5468\u4e8c",
"\u5468\u4e09",
"\u5468\u56db",
"\u5468\u4e94",
"\u5468\u516d"
],
"SHORTMONTH": [
"1\u6708",
"2\u6708",
"3\u6708",
"4\u6708",
"5\u6708",
"6\u6708",
"7\u6708",
"8\u6708",
"9\u6708",
"10\u6708",
"11\u6708",
"12\u6708"
],
"fullDate": "y\u5e74M\u6708d\u65e5EEEE",
"longDate": "y\u5e74M\u6708d\u65e5",
"medium": "yyyy-M-d ah:mm:ss",
"mediumDate": "yyyy-M-d",
"mediumTime": "ah:mm:ss",
"short": "yy-M-d ah:mm",
"shortDate": "yy-M-d",
"shortTime": "ah:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u00a5",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(\u00a4",
"negSuf": ")",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "zh-hans-cn",
"pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;}
});
}]); | sashberd/cdnjs | ajax/libs/angular-i18n/1.2.12/angular-locale_zh-hans-cn.js | JavaScript | mit | 2,118 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"SA",
"CH"
],
"DAY": [
"Ch\u1ee7 nh\u1eadt",
"Th\u1ee9 hai",
"Th\u1ee9 ba",
"Th\u1ee9 t\u01b0",
"Th\u1ee9 n\u0103m",
"Th\u1ee9 s\u00e1u",
"Th\u1ee9 b\u1ea3y"
],
"MONTH": [
"th\u00e1ng m\u1ed9t",
"th\u00e1ng hai",
"th\u00e1ng ba",
"th\u00e1ng t\u01b0",
"th\u00e1ng n\u0103m",
"th\u00e1ng s\u00e1u",
"th\u00e1ng b\u1ea3y",
"th\u00e1ng t\u00e1m",
"th\u00e1ng ch\u00edn",
"th\u00e1ng m\u01b0\u1eddi",
"th\u00e1ng m\u01b0\u1eddi m\u1ed9t",
"th\u00e1ng m\u01b0\u1eddi hai"
],
"SHORTDAY": [
"CN",
"Th 2",
"Th 3",
"Th 4",
"Th 5",
"Th 6",
"Th 7"
],
"SHORTMONTH": [
"thg 1",
"thg 2",
"thg 3",
"thg 4",
"thg 5",
"thg 6",
"thg 7",
"thg 8",
"thg 9",
"thg 10",
"thg 11",
"thg 12"
],
"fullDate": "EEEE, 'ng\u00e0y' dd MMMM 'n\u0103m' y",
"longDate": "'Ng\u00e0y' dd 'th\u00e1ng' M 'n\u0103m' y",
"medium": "dd-MM-yyyy HH:mm:ss",
"mediumDate": "dd-MM-yyyy",
"mediumTime": "HH:mm:ss",
"short": "dd/MM/yyyy HH:mm",
"shortDate": "dd/MM/yyyy",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ab",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "vi-vn",
"pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;}
});
}]); | fastest963/cdnjs | ajax/libs/angular.js/1.2.12/i18n/angular-locale_vi-vn.js | JavaScript | mit | 2,211 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"\u4e0a\u5348",
"\u4e0b\u5348"
],
"DAY": [
"\u661f\u671f\u65e5",
"\u661f\u671f\u4e00",
"\u661f\u671f\u4e8c",
"\u661f\u671f\u4e09",
"\u661f\u671f\u56db",
"\u661f\u671f\u4e94",
"\u661f\u671f\u516d"
],
"MONTH": [
"1\u6708",
"2\u6708",
"3\u6708",
"4\u6708",
"5\u6708",
"6\u6708",
"7\u6708",
"8\u6708",
"9\u6708",
"10\u6708",
"11\u6708",
"12\u6708"
],
"SHORTDAY": [
"\u5468\u65e5",
"\u5468\u4e00",
"\u5468\u4e8c",
"\u5468\u4e09",
"\u5468\u56db",
"\u5468\u4e94",
"\u5468\u516d"
],
"SHORTMONTH": [
"1\u6708",
"2\u6708",
"3\u6708",
"4\u6708",
"5\u6708",
"6\u6708",
"7\u6708",
"8\u6708",
"9\u6708",
"10\u6708",
"11\u6708",
"12\u6708"
],
"fullDate": "y\u5e74M\u6708d\u65e5EEEE",
"longDate": "y\u5e74M\u6708d\u65e5",
"medium": "yyyy-M-d ah:mm:ss",
"mediumDate": "yyyy-M-d",
"mediumTime": "ah:mm:ss",
"short": "yy-M-d ah:mm",
"shortDate": "yy-M-d",
"shortTime": "ah:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u00a5",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(\u00a4",
"negSuf": ")",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "zh-hans-cn",
"pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;}
});
}]); | honestree/cdnjs | ajax/libs/angular-i18n/1.3.0-beta.5/angular-locale_zh-hans-cn.js | JavaScript | mit | 2,118 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"a.m.",
"p.m."
],
"DAY": [
"domingo",
"lunes",
"martes",
"mi\u00e9rcoles",
"jueves",
"viernes",
"s\u00e1bado"
],
"MONTH": [
"enero",
"febrero",
"marzo",
"abril",
"mayo",
"junio",
"julio",
"agosto",
"septiembre",
"octubre",
"noviembre",
"diciembre"
],
"SHORTDAY": [
"dom",
"lun",
"mar",
"mi\u00e9",
"jue",
"vie",
"s\u00e1b"
],
"SHORTMONTH": [
"ene",
"feb",
"mar",
"abr",
"may",
"jun",
"jul",
"ago",
"sep",
"oct",
"nov",
"dic"
],
"fullDate": "EEEE, d 'de' MMMM 'de' y",
"longDate": "d 'de' MMMM 'de' y",
"medium": "dd/MM/yyyy HH:mm:ss",
"mediumDate": "dd/MM/yyyy",
"mediumTime": "HH:mm:ss",
"short": "dd/MM/yy HH:mm",
"shortDate": "dd/MM/yy",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "es-sv",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | tjbp/cdnjs | ajax/libs/angular-i18n/1.2.13/angular-locale_es-sv.js | JavaScript | mit | 1,976 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"a.m.",
"p.m."
],
"DAY": [
"domingo",
"lunes",
"martes",
"mi\u00e9rcoles",
"jueves",
"viernes",
"s\u00e1bado"
],
"MONTH": [
"enero",
"febrero",
"marzo",
"abril",
"mayo",
"junio",
"julio",
"agosto",
"septiembre",
"octubre",
"noviembre",
"diciembre"
],
"SHORTDAY": [
"dom",
"lun",
"mar",
"mi\u00e9",
"jue",
"vie",
"s\u00e1b"
],
"SHORTMONTH": [
"ene",
"feb",
"mar",
"abr",
"may",
"jun",
"jul",
"ago",
"sep",
"oct",
"nov",
"dic"
],
"fullDate": "EEEE, d 'de' MMMM 'de' y",
"longDate": "d 'de' MMMM 'de' y",
"medium": "dd/MM/yyyy HH:mm:ss",
"mediumDate": "dd/MM/yyyy",
"mediumTime": "HH:mm:ss",
"short": "dd/MM/yy HH:mm",
"shortDate": "dd/MM/yy",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "es-bo",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | emmansun/cdnjs | ajax/libs/angular.js/1.2.19/i18n/angular-locale_es-bo.js | JavaScript | mit | 1,976 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"\u4e0a\u5348",
"\u4e0b\u5348"
],
"DAY": [
"\u661f\u671f\u65e5",
"\u661f\u671f\u4e00",
"\u661f\u671f\u4e8c",
"\u661f\u671f\u4e09",
"\u661f\u671f\u56db",
"\u661f\u671f\u4e94",
"\u661f\u671f\u516d"
],
"MONTH": [
"1\u6708",
"2\u6708",
"3\u6708",
"4\u6708",
"5\u6708",
"6\u6708",
"7\u6708",
"8\u6708",
"9\u6708",
"10\u6708",
"11\u6708",
"12\u6708"
],
"SHORTDAY": [
"\u9031\u65e5",
"\u9031\u4e00",
"\u9031\u4e8c",
"\u9031\u4e09",
"\u9031\u56db",
"\u9031\u4e94",
"\u9031\u516d"
],
"SHORTMONTH": [
"1\u6708",
"2\u6708",
"3\u6708",
"4\u6708",
"5\u6708",
"6\u6708",
"7\u6708",
"8\u6708",
"9\u6708",
"10\u6708",
"11\u6708",
"12\u6708"
],
"fullDate": "y\u5e74M\u6708d\u65e5EEEE",
"longDate": "y\u5e74M\u6708d\u65e5",
"medium": "y\u5e74M\u6708d\u65e5 ahh:mm:ss",
"mediumDate": "y\u5e74M\u6708d\u65e5",
"mediumTime": "ahh:mm:ss",
"short": "yy\u5e74M\u6708d\u65e5 ah:mm",
"shortDate": "yy\u5e74M\u6708d\u65e5",
"shortTime": "ah:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "$",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(\u00a4",
"negSuf": ")",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "zh-hk",
"pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;}
});
}]); | dickeyxxx/cdnjs | ajax/libs/angular-i18n/1.2.3/angular-locale_zh-hk.js | JavaScript | mit | 2,168 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"m.",
"p."
],
"DAY": [
"domenica",
"luned\u00ec",
"marted\u00ec",
"mercoled\u00ec",
"gioved\u00ec",
"venerd\u00ec",
"sabato"
],
"MONTH": [
"gennaio",
"febbraio",
"marzo",
"aprile",
"maggio",
"giugno",
"luglio",
"agosto",
"settembre",
"ottobre",
"novembre",
"dicembre"
],
"SHORTDAY": [
"dom",
"lun",
"mar",
"mer",
"gio",
"ven",
"sab"
],
"SHORTMONTH": [
"gen",
"feb",
"mar",
"apr",
"mag",
"giu",
"lug",
"ago",
"set",
"ott",
"nov",
"dic"
],
"fullDate": "EEEE d MMMM y",
"longDate": "dd MMMM y",
"medium": "dd/MMM/y HH:mm:ss",
"mediumDate": "dd/MMM/y",
"mediumTime": "HH:mm:ss",
"short": "dd/MM/yy HH:mm",
"shortDate": "dd/MM/yy",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "\u00a4\u00a0-",
"negSuf": "",
"posPre": "\u00a4\u00a0",
"posSuf": ""
}
]
},
"id": "it-sm",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | alexmojaki/cdnjs | ajax/libs/angular.js/1.3.0-beta.10/i18n/angular-locale_it-sm.js | JavaScript | mit | 1,962 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"a.m.",
"p.m."
],
"DAY": [
"domingo",
"lunes",
"martes",
"mi\u00e9rcoles",
"jueves",
"viernes",
"s\u00e1bado"
],
"MONTH": [
"enero",
"febrero",
"marzo",
"abril",
"mayo",
"junio",
"julio",
"agosto",
"septiembre",
"octubre",
"noviembre",
"diciembre"
],
"SHORTDAY": [
"dom",
"lun",
"mar",
"mi\u00e9",
"jue",
"vie",
"s\u00e1b"
],
"SHORTMONTH": [
"ene",
"feb",
"mar",
"abr",
"may",
"jun",
"jul",
"ago",
"sep",
"oct",
"nov",
"dic"
],
"fullDate": "EEEE, d 'de' MMMM 'de' y",
"longDate": "d 'de' MMMM 'de' y",
"medium": "dd/MM/yyyy HH:mm:ss",
"mediumDate": "dd/MM/yyyy",
"mediumTime": "HH:mm:ss",
"short": "dd/MM/yy HH:mm",
"shortDate": "dd/MM/yy",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "es-uy",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | calvinf/cdnjs | ajax/libs/angular.js/1.2.6/i18n/angular-locale_es-uy.js | JavaScript | mit | 1,976 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"a.m.",
"p.m."
],
"DAY": [
"domingo",
"lunes",
"martes",
"mi\u00e9rcoles",
"jueves",
"viernes",
"s\u00e1bado"
],
"MONTH": [
"enero",
"febrero",
"marzo",
"abril",
"mayo",
"junio",
"julio",
"agosto",
"septiembre",
"octubre",
"noviembre",
"diciembre"
],
"SHORTDAY": [
"dom",
"lun",
"mar",
"mi\u00e9",
"jue",
"vie",
"s\u00e1b"
],
"SHORTMONTH": [
"ene",
"feb",
"mar",
"abr",
"may",
"jun",
"jul",
"ago",
"sep",
"oct",
"nov",
"dic"
],
"fullDate": "EEEE, d 'de' MMMM 'de' y",
"longDate": "d 'de' MMMM 'de' y",
"medium": "dd/MM/yyyy H:mm:ss",
"mediumDate": "dd/MM/yyyy",
"mediumTime": "H:mm:ss",
"short": "dd/MM/yy H:mm",
"shortDate": "dd/MM/yy",
"shortTime": "H:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "es-ec",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | Nyhtro/AngularSeedPS | app/lib/angular/i18n/angular-locale_es-ec.js | JavaScript | mit | 1,972 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"AM",
"PM"
],
"DAY": [
"dimanche",
"lundi",
"mardi",
"mercredi",
"jeudi",
"vendredi",
"samedi"
],
"MONTH": [
"janvier",
"f\u00e9vrier",
"mars",
"avril",
"mai",
"juin",
"juillet",
"ao\u00fbt",
"septembre",
"octobre",
"novembre",
"d\u00e9cembre"
],
"SHORTDAY": [
"dim.",
"lun.",
"mar.",
"mer.",
"jeu.",
"ven.",
"sam."
],
"SHORTMONTH": [
"janv.",
"f\u00e9vr.",
"mars",
"avr.",
"mai",
"juin",
"juil.",
"ao\u00fbt",
"sept.",
"oct.",
"nov.",
"d\u00e9c."
],
"fullDate": "EEEE d MMMM y",
"longDate": "d MMMM y",
"medium": "yyyy-MM-dd HH:mm:ss",
"mediumDate": "yyyy-MM-dd",
"mediumTime": "HH:mm:ss",
"short": "yy-MM-dd HH:mm",
"shortDate": "yy-MM-dd",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "$",
"DECIMAL_SEP": ",",
"GROUP_SEP": "\u00a0",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(",
"negSuf": "\u00a0\u00a4)",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "fr-ca",
"pluralCat": function (n) { if (n >= 0 && n <= 2 && n != 2) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | noraesae/cdnjs | ajax/libs/angular.js/1.3.0-beta.8/i18n/angular-locale_fr-ca.js | JavaScript | mit | 1,999 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"a.m.",
"p.m."
],
"DAY": [
"domingo",
"lunes",
"martes",
"mi\u00e9rcoles",
"jueves",
"viernes",
"s\u00e1bado"
],
"MONTH": [
"enero",
"febrero",
"marzo",
"abril",
"mayo",
"junio",
"julio",
"agosto",
"septiembre",
"octubre",
"noviembre",
"diciembre"
],
"SHORTDAY": [
"dom",
"lun",
"mar",
"mi\u00e9",
"jue",
"vie",
"s\u00e1b"
],
"SHORTMONTH": [
"ene",
"feb",
"mar",
"abr",
"may",
"jun",
"jul",
"ago",
"sep",
"oct",
"nov",
"dic"
],
"fullDate": "EEEE, d 'de' MMMM 'de' y",
"longDate": "d 'de' MMMM 'de' y",
"medium": "dd/MM/yyyy HH:mm:ss",
"mediumDate": "dd/MM/yyyy",
"mediumTime": "HH:mm:ss",
"short": "dd/MM/yy HH:mm",
"shortDate": "dd/MM/yy",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "es-sv",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | stefanneculai/cdnjs | ajax/libs/angular-i18n/1.3.0-beta.3/angular-locale_es-sv.js | JavaScript | mit | 1,976 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"\u0e01\u0e48\u0e2d\u0e19\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07",
"\u0e2b\u0e25\u0e31\u0e07\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07"
],
"DAY": [
"\u0e27\u0e31\u0e19\u0e2d\u0e32\u0e17\u0e34\u0e15\u0e22\u0e4c",
"\u0e27\u0e31\u0e19\u0e08\u0e31\u0e19\u0e17\u0e23\u0e4c",
"\u0e27\u0e31\u0e19\u0e2d\u0e31\u0e07\u0e04\u0e32\u0e23",
"\u0e27\u0e31\u0e19\u0e1e\u0e38\u0e18",
"\u0e27\u0e31\u0e19\u0e1e\u0e24\u0e2b\u0e31\u0e2a\u0e1a\u0e14\u0e35",
"\u0e27\u0e31\u0e19\u0e28\u0e38\u0e01\u0e23\u0e4c",
"\u0e27\u0e31\u0e19\u0e40\u0e2a\u0e32\u0e23\u0e4c"
],
"MONTH": [
"\u0e21\u0e01\u0e23\u0e32\u0e04\u0e21",
"\u0e01\u0e38\u0e21\u0e20\u0e32\u0e1e\u0e31\u0e19\u0e18\u0e4c",
"\u0e21\u0e35\u0e19\u0e32\u0e04\u0e21",
"\u0e40\u0e21\u0e29\u0e32\u0e22\u0e19",
"\u0e1e\u0e24\u0e29\u0e20\u0e32\u0e04\u0e21",
"\u0e21\u0e34\u0e16\u0e38\u0e19\u0e32\u0e22\u0e19",
"\u0e01\u0e23\u0e01\u0e0e\u0e32\u0e04\u0e21",
"\u0e2a\u0e34\u0e07\u0e2b\u0e32\u0e04\u0e21",
"\u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19",
"\u0e15\u0e38\u0e25\u0e32\u0e04\u0e21",
"\u0e1e\u0e24\u0e28\u0e08\u0e34\u0e01\u0e32\u0e22\u0e19",
"\u0e18\u0e31\u0e19\u0e27\u0e32\u0e04\u0e21"
],
"SHORTDAY": [
"\u0e2d\u0e32.",
"\u0e08.",
"\u0e2d.",
"\u0e1e.",
"\u0e1e\u0e24.",
"\u0e28.",
"\u0e2a."
],
"SHORTMONTH": [
"\u0e21.\u0e04.",
"\u0e01.\u0e1e.",
"\u0e21\u0e35.\u0e04.",
"\u0e40\u0e21.\u0e22.",
"\u0e1e.\u0e04.",
"\u0e21\u0e34.\u0e22.",
"\u0e01.\u0e04.",
"\u0e2a.\u0e04.",
"\u0e01.\u0e22.",
"\u0e15.\u0e04.",
"\u0e1e.\u0e22.",
"\u0e18.\u0e04."
],
"fullDate": "EEEE\u0e17\u0e35\u0e48 d MMMM G y",
"longDate": "d MMMM y",
"medium": "d MMM y H:mm:ss",
"mediumDate": "d MMM y",
"mediumTime": "H:mm:ss",
"short": "d/M/yyyy H:mm",
"shortDate": "d/M/yyyy",
"shortTime": "H:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u0e3f",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(\u00a4",
"negSuf": ")",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "th-th",
"pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;}
});
}]); | hpneo/cdnjs | ajax/libs/angular.js/1.2.10/i18n/angular-locale_th-th.js | JavaScript | mit | 2,947 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"\u0635",
"\u0645"
],
"DAY": [
"\u0627\u0644\u0623\u062d\u062f",
"\u0627\u0644\u0627\u062b\u0646\u064a\u0646",
"\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621",
"\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621",
"\u0627\u0644\u062e\u0645\u064a\u0633",
"\u0627\u0644\u062c\u0645\u0639\u0629",
"\u0627\u0644\u0633\u0628\u062a"
],
"MONTH": [
"\u0643\u0627\u0646\u0648\u0646 \u0627\u0644\u062b\u0627\u0646\u064a",
"\u0634\u0628\u0627\u0637",
"\u0622\u0630\u0627\u0631",
"\u0646\u064a\u0633\u0627\u0646",
"\u0623\u064a\u0627\u0631",
"\u062d\u0632\u064a\u0631\u0627\u0646",
"\u062a\u0645\u0648\u0632",
"\u0622\u0628",
"\u0623\u064a\u0644\u0648\u0644",
"\u062a\u0634\u0631\u064a\u0646 \u0627\u0644\u0623\u0648\u0644",
"\u062a\u0634\u0631\u064a\u0646 \u0627\u0644\u062b\u0627\u0646\u064a",
"\u0643\u0627\u0646\u0648\u0646 \u0627\u0644\u0623\u0648\u0644"
],
"SHORTDAY": [
"\u0627\u0644\u0623\u062d\u062f",
"\u0627\u0644\u0627\u062b\u0646\u064a\u0646",
"\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621",
"\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621",
"\u0627\u0644\u062e\u0645\u064a\u0633",
"\u0627\u0644\u062c\u0645\u0639\u0629",
"\u0627\u0644\u0633\u0628\u062a"
],
"SHORTMONTH": [
"\u0643\u0627\u0646\u0648\u0646 \u0627\u0644\u062b\u0627\u0646\u064a",
"\u0634\u0628\u0627\u0637",
"\u0622\u0630\u0627\u0631",
"\u0646\u064a\u0633\u0627\u0646",
"\u0623\u064a\u0627\u0631",
"\u062d\u0632\u064a\u0631\u0627\u0646",
"\u062a\u0645\u0648\u0632",
"\u0622\u0628",
"\u0623\u064a\u0644\u0648\u0644",
"\u062a\u0634\u0631\u064a\u0646 \u0627\u0644\u0623\u0648\u0644",
"\u062a\u0634\u0631\u064a\u0646 \u0627\u0644\u062b\u0627\u0646\u064a",
"\u0643\u0627\u0646\u0648\u0646 \u0627\u0644\u0623\u0648\u0644"
],
"fullDate": "EEEE\u060c d MMMM\u060c y",
"longDate": "d MMMM\u060c y",
"medium": "dd\u200f/MM\u200f/yyyy h:mm:ss a",
"mediumDate": "dd\u200f/MM\u200f/yyyy",
"mediumTime": "h:mm:ss a",
"short": "d\u200f/M\u200f/yyyy h:mm a",
"shortDate": "d\u200f/M\u200f/yyyy",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u00a3",
"DECIMAL_SEP": "\u066b",
"GROUP_SEP": "\u066c",
"PATTERNS": [
{
"gSize": 0,
"lgSize": 0,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "",
"negSuf": "-",
"posPre": "",
"posSuf": ""
},
{
"gSize": 0,
"lgSize": 0,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "\u00a4\u00a0",
"negSuf": "-",
"posPre": "\u00a4\u00a0",
"posSuf": ""
}
]
},
"id": "ar-jo",
"pluralCat": function (n) { if (n == 0) { return PLURAL_CATEGORY.ZERO; } if (n == 1) { return PLURAL_CATEGORY.ONE; } if (n == 2) { return PLURAL_CATEGORY.TWO; } if (n == (n | 0) && n % 100 >= 3 && n % 100 <= 10) { return PLURAL_CATEGORY.FEW; } if (n == (n | 0) && n % 100 >= 11 && n % 100 <= 99) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
});
}]); | whardier/cdnjs | ajax/libs/angular.js/1.2.19/i18n/angular-locale_ar-jo.js | JavaScript | mit | 3,572 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"\u0635",
"\u0645"
],
"DAY": [
"\u0627\u0644\u0623\u062d\u062f",
"\u0627\u0644\u0627\u062b\u0646\u064a\u0646",
"\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621",
"\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621",
"\u0627\u0644\u062e\u0645\u064a\u0633",
"\u0627\u0644\u062c\u0645\u0639\u0629",
"\u0627\u0644\u0633\u0628\u062a"
],
"MONTH": [
"\u064a\u0646\u0627\u064a\u0631",
"\u0641\u0628\u0631\u0627\u064a\u0631",
"\u0645\u0627\u0631\u0633",
"\u0623\u0628\u0631\u064a\u0644",
"\u0645\u0627\u064a\u0648",
"\u064a\u0648\u0646\u064a\u0648",
"\u064a\u0648\u0644\u064a\u0648",
"\u0623\u063a\u0633\u0637\u0633",
"\u0633\u0628\u062a\u0645\u0628\u0631",
"\u0623\u0643\u062a\u0648\u0628\u0631",
"\u0646\u0648\u0641\u0645\u0628\u0631",
"\u062f\u064a\u0633\u0645\u0628\u0631"
],
"SHORTDAY": [
"\u0627\u0644\u0623\u062d\u062f",
"\u0627\u0644\u0627\u062b\u0646\u064a\u0646",
"\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621",
"\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621",
"\u0627\u0644\u062e\u0645\u064a\u0633",
"\u0627\u0644\u062c\u0645\u0639\u0629",
"\u0627\u0644\u0633\u0628\u062a"
],
"SHORTMONTH": [
"\u064a\u0646\u0627\u064a\u0631",
"\u0641\u0628\u0631\u0627\u064a\u0631",
"\u0645\u0627\u0631\u0633",
"\u0623\u0628\u0631\u064a\u0644",
"\u0645\u0627\u064a\u0648",
"\u064a\u0648\u0646\u064a\u0648",
"\u064a\u0648\u0644\u064a\u0648",
"\u0623\u063a\u0633\u0637\u0633",
"\u0633\u0628\u062a\u0645\u0628\u0631",
"\u0623\u0643\u062a\u0648\u0628\u0631",
"\u0646\u0648\u0641\u0645\u0628\u0631",
"\u062f\u064a\u0633\u0645\u0628\u0631"
],
"fullDate": "EEEE\u060c d MMMM\u060c y",
"longDate": "d MMMM\u060c y",
"medium": "dd\u200f/MM\u200f/yyyy h:mm:ss a",
"mediumDate": "dd\u200f/MM\u200f/yyyy",
"mediumTime": "h:mm:ss a",
"short": "d\u200f/M\u200f/yyyy h:mm a",
"shortDate": "d\u200f/M\u200f/yyyy",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u00a3",
"DECIMAL_SEP": "\u066b",
"GROUP_SEP": "\u066c",
"PATTERNS": [
{
"gSize": 0,
"lgSize": 0,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "",
"negSuf": "-",
"posPre": "",
"posSuf": ""
},
{
"gSize": 0,
"lgSize": 0,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "\u00a4\u00a0",
"negSuf": "-",
"posPre": "\u00a4\u00a0",
"posSuf": ""
}
]
},
"id": "ar-iq",
"pluralCat": function (n) { if (n == 0) { return PLURAL_CATEGORY.ZERO; } if (n == 1) { return PLURAL_CATEGORY.ONE; } if (n == 2) { return PLURAL_CATEGORY.TWO; } if (n == (n | 0) && n % 100 >= 3 && n % 100 <= 10) { return PLURAL_CATEGORY.FEW; } if (n == (n | 0) && n % 100 >= 11 && n % 100 <= 99) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
});
}]); | yukinying/cdnjs | ajax/libs/angular.js/1.2.14/i18n/angular-locale_ar-iq.js | JavaScript | mit | 3,408 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"am",
"pm"
],
"DAY": [
"\u0ab0\u0ab5\u0abf\u0ab5\u0abe\u0ab0",
"\u0ab8\u0acb\u0aae\u0ab5\u0abe\u0ab0",
"\u0aae\u0a82\u0a97\u0ab3\u0ab5\u0abe\u0ab0",
"\u0aac\u0ac1\u0aa7\u0ab5\u0abe\u0ab0",
"\u0a97\u0ac1\u0ab0\u0ac1\u0ab5\u0abe\u0ab0",
"\u0ab6\u0ac1\u0a95\u0acd\u0ab0\u0ab5\u0abe\u0ab0",
"\u0ab6\u0aa8\u0abf\u0ab5\u0abe\u0ab0"
],
"MONTH": [
"\u0a9c\u0abe\u0aa8\u0acd\u0aaf\u0ac1\u0a86\u0ab0\u0ac0",
"\u0aab\u0ac7\u0aac\u0acd\u0ab0\u0ac1\u0a86\u0ab0\u0ac0",
"\u0aae\u0abe\u0ab0\u0acd\u0a9a",
"\u0a8f\u0aaa\u0acd\u0ab0\u0abf\u0ab2",
"\u0aae\u0ac7",
"\u0a9c\u0ac2\u0aa8",
"\u0a9c\u0ac1\u0ab2\u0abe\u0a88",
"\u0a91\u0a97\u0ab8\u0acd\u0a9f",
"\u0ab8\u0aaa\u0acd\u0a9f\u0ac7\u0aae\u0acd\u0aac\u0ab0",
"\u0a91\u0a95\u0acd\u0a9f\u0acb\u0aac\u0ab0",
"\u0aa8\u0ab5\u0ac7\u0aae\u0acd\u0aac\u0ab0",
"\u0aa1\u0abf\u0ab8\u0ac7\u0aae\u0acd\u0aac\u0ab0"
],
"SHORTDAY": [
"\u0ab0\u0ab5\u0abf",
"\u0ab8\u0acb\u0aae",
"\u0aae\u0a82\u0a97\u0ab3",
"\u0aac\u0ac1\u0aa7",
"\u0a97\u0ac1\u0ab0\u0ac1",
"\u0ab6\u0ac1\u0a95\u0acd\u0ab0",
"\u0ab6\u0aa8\u0abf"
],
"SHORTMONTH": [
"\u0a9c\u0abe\u0aa8\u0acd\u0aaf\u0ac1",
"\u0aab\u0ac7\u0aac\u0acd\u0ab0\u0ac1",
"\u0aae\u0abe\u0ab0\u0acd\u0a9a",
"\u0a8f\u0aaa\u0acd\u0ab0\u0abf\u0ab2",
"\u0aae\u0ac7",
"\u0a9c\u0ac2\u0aa8",
"\u0a9c\u0ac1\u0ab2\u0abe\u0a88",
"\u0a91\u0a97\u0ab8\u0acd\u0a9f",
"\u0ab8\u0aaa\u0acd\u0a9f\u0ac7",
"\u0a91\u0a95\u0acd\u0a9f\u0acb",
"\u0aa8\u0ab5\u0ac7",
"\u0aa1\u0abf\u0ab8\u0ac7"
],
"fullDate": "EEEE, d MMMM, y",
"longDate": "d MMMM, y",
"medium": "d MMM, y hh:mm:ss a",
"mediumDate": "d MMM, y",
"mediumTime": "hh:mm:ss a",
"short": "d-MM-yy hh:mm a",
"shortDate": "d-MM-yy",
"shortTime": "hh:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20b9",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(\u00a4",
"negSuf": ")",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "gu-in",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | urish/cdnjs | ajax/libs/angular.js/1.2.12/i18n/angular-locale_gu-in.js | JavaScript | mit | 2,951 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"\u0635",
"\u0645"
],
"DAY": [
"\u0627\u0644\u0623\u062d\u062f",
"\u0627\u0644\u0627\u062b\u0646\u064a\u0646",
"\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621",
"\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621",
"\u0627\u0644\u062e\u0645\u064a\u0633",
"\u0627\u0644\u062c\u0645\u0639\u0629",
"\u0627\u0644\u0633\u0628\u062a"
],
"MONTH": [
"\u064a\u0646\u0627\u064a\u0631",
"\u0641\u0628\u0631\u0627\u064a\u0631",
"\u0645\u0627\u0631\u0633",
"\u0623\u0628\u0631\u064a\u0644",
"\u0645\u0627\u064a\u0648",
"\u064a\u0648\u0646\u064a\u0648",
"\u064a\u0648\u0644\u064a\u0648",
"\u0623\u063a\u0633\u0637\u0633",
"\u0633\u0628\u062a\u0645\u0628\u0631",
"\u0623\u0643\u062a\u0648\u0628\u0631",
"\u0646\u0648\u0641\u0645\u0628\u0631",
"\u062f\u064a\u0633\u0645\u0628\u0631"
],
"SHORTDAY": [
"\u0627\u0644\u0623\u062d\u062f",
"\u0627\u0644\u0627\u062b\u0646\u064a\u0646",
"\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621",
"\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621",
"\u0627\u0644\u062e\u0645\u064a\u0633",
"\u0627\u0644\u062c\u0645\u0639\u0629",
"\u0627\u0644\u0633\u0628\u062a"
],
"SHORTMONTH": [
"\u064a\u0646\u0627\u064a\u0631",
"\u0641\u0628\u0631\u0627\u064a\u0631",
"\u0645\u0627\u0631\u0633",
"\u0623\u0628\u0631\u064a\u0644",
"\u0645\u0627\u064a\u0648",
"\u064a\u0648\u0646\u064a\u0648",
"\u064a\u0648\u0644\u064a\u0648",
"\u0623\u063a\u0633\u0637\u0633",
"\u0633\u0628\u062a\u0645\u0628\u0631",
"\u0623\u0643\u062a\u0648\u0628\u0631",
"\u0646\u0648\u0641\u0645\u0628\u0631",
"\u062f\u064a\u0633\u0645\u0628\u0631"
],
"fullDate": "EEEE\u060c d MMMM\u060c y",
"longDate": "d MMMM\u060c y",
"medium": "dd\u200f/MM\u200f/yyyy h:mm:ss a",
"mediumDate": "dd\u200f/MM\u200f/yyyy",
"mediumTime": "h:mm:ss a",
"short": "d\u200f/M\u200f/yyyy h:mm a",
"shortDate": "d\u200f/M\u200f/yyyy",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u00a3",
"DECIMAL_SEP": "\u066b",
"GROUP_SEP": "\u066c",
"PATTERNS": [
{
"gSize": 0,
"lgSize": 0,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "",
"negSuf": "-",
"posPre": "",
"posSuf": ""
},
{
"gSize": 0,
"lgSize": 0,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "\u00a4\u00a0",
"negSuf": "-",
"posPre": "\u00a4\u00a0",
"posSuf": ""
}
]
},
"id": "ar-iq",
"pluralCat": function (n) { if (n == 0) { return PLURAL_CATEGORY.ZERO; } if (n == 1) { return PLURAL_CATEGORY.ONE; } if (n == 2) { return PLURAL_CATEGORY.TWO; } if (n == (n | 0) && n % 100 >= 3 && n % 100 <= 10) { return PLURAL_CATEGORY.FEW; } if (n == (n | 0) && n % 100 >= 11 && n % 100 <= 99) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
});
}]); | Piicksarn/cdnjs | ajax/libs/angular-i18n/1.2.3/angular-locale_ar-iq.js | JavaScript | mit | 3,408 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"a.m.",
"p.m."
],
"DAY": [
"domingo",
"lunes",
"martes",
"mi\u00e9rcoles",
"jueves",
"viernes",
"s\u00e1bado"
],
"MONTH": [
"enero",
"febrero",
"marzo",
"abril",
"mayo",
"junio",
"julio",
"agosto",
"septiembre",
"octubre",
"noviembre",
"diciembre"
],
"SHORTDAY": [
"dom",
"lun",
"mar",
"mi\u00e9",
"jue",
"vie",
"s\u00e1b"
],
"SHORTMONTH": [
"ene",
"feb",
"mar",
"abr",
"may",
"jun",
"jul",
"ago",
"sep",
"oct",
"nov",
"dic"
],
"fullDate": "EEEE dd 'de' MMMM 'de' y",
"longDate": "dd 'de' MMMM 'de' y",
"medium": "dd/MM/yyyy HH:mm:ss",
"mediumDate": "dd/MM/yyyy",
"mediumTime": "HH:mm:ss",
"short": "dd/MM/yy HH:mm",
"shortDate": "dd/MM/yy",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "es-hn",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | mitsuruog/cdnjs | ajax/libs/angular.js/1.2.4/i18n/angular-locale_es-hn.js | JavaScript | mit | 1,977 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"am",
"pm"
],
"DAY": [
"\u0ab0\u0ab5\u0abf\u0ab5\u0abe\u0ab0",
"\u0ab8\u0acb\u0aae\u0ab5\u0abe\u0ab0",
"\u0aae\u0a82\u0a97\u0ab3\u0ab5\u0abe\u0ab0",
"\u0aac\u0ac1\u0aa7\u0ab5\u0abe\u0ab0",
"\u0a97\u0ac1\u0ab0\u0ac1\u0ab5\u0abe\u0ab0",
"\u0ab6\u0ac1\u0a95\u0acd\u0ab0\u0ab5\u0abe\u0ab0",
"\u0ab6\u0aa8\u0abf\u0ab5\u0abe\u0ab0"
],
"MONTH": [
"\u0a9c\u0abe\u0aa8\u0acd\u0aaf\u0ac1\u0a86\u0ab0\u0ac0",
"\u0aab\u0ac7\u0aac\u0acd\u0ab0\u0ac1\u0a86\u0ab0\u0ac0",
"\u0aae\u0abe\u0ab0\u0acd\u0a9a",
"\u0a8f\u0aaa\u0acd\u0ab0\u0abf\u0ab2",
"\u0aae\u0ac7",
"\u0a9c\u0ac2\u0aa8",
"\u0a9c\u0ac1\u0ab2\u0abe\u0a88",
"\u0a91\u0a97\u0ab8\u0acd\u0a9f",
"\u0ab8\u0aaa\u0acd\u0a9f\u0ac7\u0aae\u0acd\u0aac\u0ab0",
"\u0a91\u0a95\u0acd\u0a9f\u0acb\u0aac\u0ab0",
"\u0aa8\u0ab5\u0ac7\u0aae\u0acd\u0aac\u0ab0",
"\u0aa1\u0abf\u0ab8\u0ac7\u0aae\u0acd\u0aac\u0ab0"
],
"SHORTDAY": [
"\u0ab0\u0ab5\u0abf",
"\u0ab8\u0acb\u0aae",
"\u0aae\u0a82\u0a97\u0ab3",
"\u0aac\u0ac1\u0aa7",
"\u0a97\u0ac1\u0ab0\u0ac1",
"\u0ab6\u0ac1\u0a95\u0acd\u0ab0",
"\u0ab6\u0aa8\u0abf"
],
"SHORTMONTH": [
"\u0a9c\u0abe\u0aa8\u0acd\u0aaf\u0ac1",
"\u0aab\u0ac7\u0aac\u0acd\u0ab0\u0ac1",
"\u0aae\u0abe\u0ab0\u0acd\u0a9a",
"\u0a8f\u0aaa\u0acd\u0ab0\u0abf\u0ab2",
"\u0aae\u0ac7",
"\u0a9c\u0ac2\u0aa8",
"\u0a9c\u0ac1\u0ab2\u0abe\u0a88",
"\u0a91\u0a97\u0ab8\u0acd\u0a9f",
"\u0ab8\u0aaa\u0acd\u0a9f\u0ac7",
"\u0a91\u0a95\u0acd\u0a9f\u0acb",
"\u0aa8\u0ab5\u0ac7",
"\u0aa1\u0abf\u0ab8\u0ac7"
],
"fullDate": "EEEE, d MMMM, y",
"longDate": "d MMMM, y",
"medium": "d MMM, y hh:mm:ss a",
"mediumDate": "d MMM, y",
"mediumTime": "hh:mm:ss a",
"short": "d-MM-yy hh:mm a",
"shortDate": "d-MM-yy",
"shortTime": "hh:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20b9",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(\u00a4",
"negSuf": ")",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "gu-in",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | lobbin/cdnjs | ajax/libs/angular.js/1.2.19/i18n/angular-locale_gu-in.js | JavaScript | mit | 2,951 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"a.m.",
"p.m."
],
"DAY": [
"domingo",
"lunes",
"martes",
"mi\u00e9rcoles",
"jueves",
"viernes",
"s\u00e1bado"
],
"MONTH": [
"enero",
"febrero",
"marzo",
"abril",
"mayo",
"junio",
"julio",
"agosto",
"septiembre",
"octubre",
"noviembre",
"diciembre"
],
"SHORTDAY": [
"dom",
"lun",
"mar",
"mi\u00e9",
"jue",
"vie",
"s\u00e1b"
],
"SHORTMONTH": [
"ene",
"feb",
"mar",
"abr",
"may",
"jun",
"jul",
"ago",
"sep",
"oct",
"nov",
"dic"
],
"fullDate": "EEEE, d 'de' MMMM 'de' y",
"longDate": "d 'de' MMMM 'de' y",
"medium": "dd/MM/yyyy HH:mm:ss",
"mediumDate": "dd/MM/yyyy",
"mediumTime": "HH:mm:ss",
"short": "dd/MM/yy HH:mm",
"shortDate": "dd/MM/yy",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "es-mx",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | redmunds/cdnjs | ajax/libs/angular.js/1.3.0-beta.2/i18n/angular-locale_es-mx.js | JavaScript | mit | 1,976 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"am",
"pm"
],
"DAY": [
"\u0ab0\u0ab5\u0abf\u0ab5\u0abe\u0ab0",
"\u0ab8\u0acb\u0aae\u0ab5\u0abe\u0ab0",
"\u0aae\u0a82\u0a97\u0ab3\u0ab5\u0abe\u0ab0",
"\u0aac\u0ac1\u0aa7\u0ab5\u0abe\u0ab0",
"\u0a97\u0ac1\u0ab0\u0ac1\u0ab5\u0abe\u0ab0",
"\u0ab6\u0ac1\u0a95\u0acd\u0ab0\u0ab5\u0abe\u0ab0",
"\u0ab6\u0aa8\u0abf\u0ab5\u0abe\u0ab0"
],
"MONTH": [
"\u0a9c\u0abe\u0aa8\u0acd\u0aaf\u0ac1\u0a86\u0ab0\u0ac0",
"\u0aab\u0ac7\u0aac\u0acd\u0ab0\u0ac1\u0a86\u0ab0\u0ac0",
"\u0aae\u0abe\u0ab0\u0acd\u0a9a",
"\u0a8f\u0aaa\u0acd\u0ab0\u0abf\u0ab2",
"\u0aae\u0ac7",
"\u0a9c\u0ac2\u0aa8",
"\u0a9c\u0ac1\u0ab2\u0abe\u0a88",
"\u0a91\u0a97\u0ab8\u0acd\u0a9f",
"\u0ab8\u0aaa\u0acd\u0a9f\u0ac7\u0aae\u0acd\u0aac\u0ab0",
"\u0a91\u0a95\u0acd\u0a9f\u0acb\u0aac\u0ab0",
"\u0aa8\u0ab5\u0ac7\u0aae\u0acd\u0aac\u0ab0",
"\u0aa1\u0abf\u0ab8\u0ac7\u0aae\u0acd\u0aac\u0ab0"
],
"SHORTDAY": [
"\u0ab0\u0ab5\u0abf",
"\u0ab8\u0acb\u0aae",
"\u0aae\u0a82\u0a97\u0ab3",
"\u0aac\u0ac1\u0aa7",
"\u0a97\u0ac1\u0ab0\u0ac1",
"\u0ab6\u0ac1\u0a95\u0acd\u0ab0",
"\u0ab6\u0aa8\u0abf"
],
"SHORTMONTH": [
"\u0a9c\u0abe\u0aa8\u0acd\u0aaf\u0ac1",
"\u0aab\u0ac7\u0aac\u0acd\u0ab0\u0ac1",
"\u0aae\u0abe\u0ab0\u0acd\u0a9a",
"\u0a8f\u0aaa\u0acd\u0ab0\u0abf\u0ab2",
"\u0aae\u0ac7",
"\u0a9c\u0ac2\u0aa8",
"\u0a9c\u0ac1\u0ab2\u0abe\u0a88",
"\u0a91\u0a97\u0ab8\u0acd\u0a9f",
"\u0ab8\u0aaa\u0acd\u0a9f\u0ac7",
"\u0a91\u0a95\u0acd\u0a9f\u0acb",
"\u0aa8\u0ab5\u0ac7",
"\u0aa1\u0abf\u0ab8\u0ac7"
],
"fullDate": "EEEE, d MMMM, y",
"longDate": "d MMMM, y",
"medium": "d MMM, y hh:mm:ss a",
"mediumDate": "d MMM, y",
"mediumTime": "hh:mm:ss a",
"short": "d-MM-yy hh:mm a",
"shortDate": "d-MM-yy",
"shortTime": "hh:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20b9",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(\u00a4",
"negSuf": ")",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "gu-in",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | maxklenk/cdnjs | ajax/libs/angular.js/1.3.0-beta.9/i18n/angular-locale_gu-in.js | JavaScript | mit | 2,951 |
/*! Metric parser
* Demo: http://jsfiddle.net/Mottie/abkNM/382/
* Set the metric name in the header (defaults to "m|meter"), e.g.
* <th data-metric-name="b|byte">HDD Size</th>
* <th data-metric-name="m|meter">Distance</th>
*/
/*jshint jquery:true */
;(function($){
"use strict";
var prefixes = {
// "prefix" : [ base 10, base 2 ]
// skipping IEEE 1541 defined prefixes: kibibyte, mebibyte, etc, for now.
"Y|Yotta|yotta" : [ 1e24, Math.pow(1024, 8) ], // 1024^8
"Z|Zetta|zetta" : [ 1e21, Math.pow(1024, 7) ], // 1024^7
"E|Exa|exa" : [ 1e18, Math.pow(1024, 6) ], // 1024^6
"P|Peta|peta" : [ 1e15, Math.pow(1024, 5) ], // 1024^5
"T|Tera|tera" : [ 1e12, Math.pow(1024, 4) ], // 1024^4
"G|Giga|giga" : [ 1e9, Math.pow(1024, 3) ], // 1024^3
"M|Mega|mega" : [ 1e6, Math.pow(1024, 2) ], // 1024^2
"k|Kilo|kilo" : [ 1e3, 1024 ], // 1024
// prefixes below here are rarely, if ever, used in binary
"h|hecto" : [ 1e2, 1e2 ],
"da|deka" : [ 1e1, 1e1 ],
"d|deci" : [ 1e-1, 1e-1 ],
"c|centi" : [ 1e-2, 1e-2],
"m|milli" : [ 1e-3, 1e-3 ],
"µ|micro" : [ 1e-6, 1e-6 ],
"n|nano" : [ 1e-9, 1e-9 ],
"p|pico" : [ 1e-12, 1e-12 ],
"f|femto" : [ 1e-15, 1e-15 ],
"a|atto" : [ 1e-18, 1e-18 ],
"z|zepto" : [ 1e-21, 1e-21 ],
"y|yocto" : [ 1e-24, 1e-24 ]
},
// the \\d+ will not catch digits with spaces, commas or decimals; so use the value from n instead
RegLong = "(\\d+)(\\s+)?([Zz]etta|[Ee]xa|[Pp]eta|[Tt]era|[Gg]iga|[Mm]ega|kilo|hecto|deka|deci|centi|milli|micro|nano|pico|femto|atto|zepto|yocto)(",
RegAbbr = "(\\d+)(\\s+)?(Z|E|P|T|G|M|k|h|da|d|c|m|µ|n|p|f|a|z|y)(";
$.tablesorter.addParser({
id: 'metric',
is: function() {
return false;
},
format: function(s, table, cell, cellIndex) {
var v = 'm|meter',
b, t,
// process number here to get a numerical format (us or eu)
n = $.tablesorter.formatFloat(s.replace(/[^\w,. \-()]/g, ""), table),
$t = table.config.$headers.filter('[data-column="' + cellIndex + '"]'),
m = $t.data('metric');
if (!m) {
// stored values
t = ($t.attr('data-metric-name') || v).split('|');
m = [ t[1] || t[0].substring(1), t[0] ];
m[2] = new RegExp(RegLong + m[0] + "|" + m[1] + ")");
m[3] = new RegExp(RegAbbr + m[1] + ")");
$t.data('metric', m);
}
// find match to full name or abbreviation
t = s.match(m[2]) || s.match(m[3]);
if (t) {
for (v in prefixes) {
if (t[3].match(v)) {
// exception when using binary prefix
// change base for binary use
b = /^[b|bit|byte|o|octet]/.test(t[4]) ? 1 : 0;
return n * prefixes[v][b];
}
}
}
return n;
},
type: 'numeric'
});
})(jQuery);
| MisatoTremor/cdnjs | ajax/libs/jquery.tablesorter/2.13.0/js/parsers/parser-metric.js | JavaScript | mit | 2,754 |
/*
Simple DirectMedia Layer
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <malloc.h>
#include "SDL_audio.h"
#include "SDL_error.h"
#include "SDL_timer.h"
#include "../SDL_audiomem.h"
#include "../SDL_audio_c.h"
#include "../SDL_audiodev_c.h"
#include "../SDL_sysaudio.h"
#include "SDL_pspaudio.h"
#include <pspaudio.h>
#include <pspthreadman.h>
/* The tag name used by PSP audio */
#define PSPAUD_DRIVER_NAME "psp"
static int
PSPAUD_OpenDevice(_THIS, const char *devname, int iscapture)
{
int format, mixlen, i;
this->hidden = (struct SDL_PrivateAudioData *)
SDL_malloc(sizeof(*this->hidden));
if (this->hidden == NULL) {
return SDL_OutOfMemory();
}
SDL_memset(this->hidden, 0, sizeof(*this->hidden));
switch (this->spec.format & 0xff) {
case 8:
case 16:
this->spec.format = AUDIO_S16LSB;
break;
default:
return SDL_SetError("Unsupported audio format");
}
/* The sample count must be a multiple of 64. */
this->spec.samples = PSP_AUDIO_SAMPLE_ALIGN(this->spec.samples);
this->spec.freq = 44100;
/* Update the fragment size as size in bytes. */
/* SDL_CalculateAudioSpec(this->spec); MOD */
switch (this->spec.format) {
case AUDIO_U8:
this->spec.silence = 0x80;
break;
default:
this->spec.silence = 0x00;
break;
}
this->spec.size = SDL_AUDIO_BITSIZE(this->spec.format) / 8;
this->spec.size *= this->spec.channels;
this->spec.size *= this->spec.samples;
/* ========================================== */
/* Allocate the mixing buffer. Its size and starting address must
be a multiple of 64 bytes. Our sample count is already a multiple of
64, so spec->size should be a multiple of 64 as well. */
mixlen = this->spec.size * NUM_BUFFERS;
this->hidden->rawbuf = (Uint8 *) memalign(64, mixlen);
if (this->hidden->rawbuf == NULL) {
return SDL_SetError("Couldn't allocate mixing buffer");
}
/* Setup the hardware channel. */
if (this->spec.channels == 1) {
format = PSP_AUDIO_FORMAT_MONO;
} else {
format = PSP_AUDIO_FORMAT_STEREO;
}
this->hidden->channel = sceAudioChReserve(PSP_AUDIO_NEXT_CHANNEL, this->spec.samples, format);
if (this->hidden->channel < 0) {
free(this->hidden->rawbuf);
this->hidden->rawbuf = NULL;
return SDL_SetError("Couldn't reserve hardware channel");
}
memset(this->hidden->rawbuf, 0, mixlen);
for (i = 0; i < NUM_BUFFERS; i++) {
this->hidden->mixbufs[i] = &this->hidden->rawbuf[i * this->spec.size];
}
this->hidden->next_buffer = 0;
return 0;
}
static void PSPAUD_PlayDevice(_THIS)
{
Uint8 *mixbuf = this->hidden->mixbufs[this->hidden->next_buffer];
if (this->spec.channels == 1) {
sceAudioOutputBlocking(this->hidden->channel, PSP_AUDIO_VOLUME_MAX, mixbuf);
} else {
sceAudioOutputPannedBlocking(this->hidden->channel, PSP_AUDIO_VOLUME_MAX, PSP_AUDIO_VOLUME_MAX, mixbuf);
}
this->hidden->next_buffer = (this->hidden->next_buffer + 1) % NUM_BUFFERS;
}
/* This function waits until it is possible to write a full sound buffer */
static void PSPAUD_WaitDevice(_THIS)
{
/* Because we block when sending audio, there's no need for this function to do anything. */
}
static Uint8 *PSPAUD_GetDeviceBuf(_THIS)
{
return this->hidden->mixbufs[this->hidden->next_buffer];
}
static void PSPAUD_CloseDevice(_THIS)
{
if (this->hidden->channel >= 0) {
sceAudioChRelease(this->hidden->channel);
this->hidden->channel = -1;
}
if (this->hidden->rawbuf != NULL) {
free(this->hidden->rawbuf);
this->hidden->rawbuf = NULL;
}
}
static void PSPAUD_ThreadInit(_THIS)
{
/* Increase the priority of this audio thread by 1 to put it
ahead of other SDL threads. */
SceUID thid;
SceKernelThreadInfo status;
thid = sceKernelGetThreadId();
status.size = sizeof(SceKernelThreadInfo);
if (sceKernelReferThreadStatus(thid, &status) == 0) {
sceKernelChangeThreadPriority(thid, status.currentPriority - 1);
}
}
static int
PSPAUD_Init(SDL_AudioDriverImpl * impl)
{
/* Set the function pointers */
impl->OpenDevice = PSPAUD_OpenDevice;
impl->PlayDevice = PSPAUD_PlayDevice;
impl->WaitDevice = PSPAUD_WaitDevice;
impl->GetDeviceBuf = PSPAUD_GetDeviceBuf;
impl->WaitDone = PSPAUD_WaitDevice;
impl->CloseDevice = PSPAUD_CloseDevice;
impl->ThreadInit = PSPAUD_ThreadInit;
/* PSP audio device */
impl->OnlyHasDefaultOutputDevice = 1;
/*
impl->HasCaptureSupport = 1;
impl->OnlyHasDefaultInputDevice = 1;
*/
/*
impl->DetectDevices = DSOUND_DetectDevices;
impl->Deinitialize = DSOUND_Deinitialize;
*/
return 1; /* this audio target is available. */
}
AudioBootStrap PSPAUD_bootstrap = {
"psp", "PSP audio driver", PSPAUD_Init, 0
};
/* SDL_AUDI */
| rsredsq/AtomicGameEngine | Source/ThirdParty/SDL/src/audio/psp/SDL_pspaudio.c | C | mit | 5,920 |
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
//-----------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
// Tool: AllJoynCodeGenerator.exe
//
// This tool is located in the Windows 10 SDK and the Windows 10 AllJoyn
// Visual Studio Extension in the Visual Studio Gallery.
//
// The generated code should be packaged in a Windows 10 C++/CX Runtime
// Component which can be consumed in any UWP-supported language using
// APIs that are available in Windows.Devices.AllJoyn.
//
// Using AllJoynCodeGenerator - Invoke the following command with a valid
// Introspection XML file and a writable output directory:
// AllJoynCodeGenerator -i <INPUT XML FILE> -o <OUTPUT DIRECTORY>
// </auto-generated>
//-----------------------------------------------------------------------------
#include "pch.h"
using namespace concurrency;
using namespace Microsoft::WRL;
using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Devices::AllJoyn;
using namespace org::alljoyn::Onboarding;
std::map<alljoyn_interfacedescription, WeakReference*> OnboardingConsumer::SourceInterfaces;
OnboardingConsumer::OnboardingConsumer(AllJoynBusAttachment^ busAttachment)
: m_busAttachment(busAttachment),
m_proxyBusObject(nullptr),
m_busObject(nullptr),
m_sessionListener(nullptr),
m_sessionId(0)
{
m_weak = new WeakReference(this);
m_signals = ref new OnboardingSignals();
m_nativeBusAttachment = AllJoynHelpers::GetInternalBusAttachment(m_busAttachment);
}
OnboardingConsumer::~OnboardingConsumer()
{
AllJoynBusObjectManager::ReleaseBusObject(m_nativeBusAttachment, AllJoynHelpers::PlatformToMultibyteString(ServiceObjectPath).data());
if (SessionListener != nullptr)
{
alljoyn_busattachment_setsessionlistener(m_nativeBusAttachment, m_sessionId, nullptr);
alljoyn_sessionlistener_destroy(SessionListener);
}
if (nullptr != ProxyBusObject)
{
alljoyn_proxybusobject_destroy(ProxyBusObject);
}
delete m_weak;
}
void OnboardingConsumer::OnSessionLost(_In_ alljoyn_sessionid sessionId, _In_ alljoyn_sessionlostreason reason)
{
if (sessionId == m_sessionId)
{
AllJoynSessionLostEventArgs^ args = ref new AllJoynSessionLostEventArgs(static_cast<AllJoynSessionLostReason>(reason));
SessionLost(this, args);
}
}
void OnboardingConsumer::OnSessionMemberAdded(_In_ alljoyn_sessionid sessionId, _In_ PCSTR uniqueName)
{
if (sessionId == m_sessionId)
{
auto args = ref new AllJoynSessionMemberAddedEventArgs(AllJoynHelpers::MultibyteToPlatformString(uniqueName));
SessionMemberAdded(this, args);
}
}
void OnboardingConsumer::OnSessionMemberRemoved(_In_ alljoyn_sessionid sessionId, _In_ PCSTR uniqueName)
{
if (sessionId == m_sessionId)
{
auto args = ref new AllJoynSessionMemberRemovedEventArgs(AllJoynHelpers::MultibyteToPlatformString(uniqueName));
SessionMemberRemoved(this, args);
}
}
QStatus OnboardingConsumer::AddSignalHandler(_In_ alljoyn_busattachment busAttachment, _In_ alljoyn_interfacedescription interfaceDescription, _In_ PCSTR methodName, _In_ alljoyn_messagereceiver_signalhandler_ptr handler)
{
alljoyn_interfacedescription_member member;
if (!alljoyn_interfacedescription_getmember(interfaceDescription, methodName, &member))
{
return ER_BUS_INTERFACE_NO_SUCH_MEMBER;
}
return alljoyn_busattachment_registersignalhandler(busAttachment, handler, member, NULL);
}
IAsyncOperation<OnboardingJoinSessionResult^>^ OnboardingConsumer::JoinSessionAsync(
_In_ AllJoynServiceInfo^ serviceInfo, _Inout_ OnboardingWatcher^ watcher)
{
return create_async([serviceInfo, watcher]() -> OnboardingJoinSessionResult^
{
auto result = ref new OnboardingJoinSessionResult();
result->Status = AllJoynStatus::Ok;
result->Consumer = nullptr;
result->Consumer = ref new OnboardingConsumer(watcher->BusAttachment);
result->Status = result->Consumer->JoinSession(serviceInfo);
return result;
});
}
IAsyncOperation<OnboardingConfigureWiFiResult^>^ OnboardingConsumer::ConfigureWiFiAsync(_In_ Platform::String^ interfaceMemberSSID, _In_ Platform::String^ interfaceMemberPassphrase, _In_ int16 interfaceMemberAuthType)
{
return create_async([this, interfaceMemberSSID, interfaceMemberPassphrase, interfaceMemberAuthType]() -> OnboardingConfigureWiFiResult^
{
auto result = ref new OnboardingConfigureWiFiResult();
alljoyn_message message = alljoyn_message_create(m_nativeBusAttachment);
size_t argCount = 3;
alljoyn_msgarg inputs = alljoyn_msgarg_array_create(argCount);
TypeConversionHelpers::SetAllJoynMessageArg(alljoyn_msgarg_array_element(inputs, 0), "s", interfaceMemberSSID);
TypeConversionHelpers::SetAllJoynMessageArg(alljoyn_msgarg_array_element(inputs, 1), "s", interfaceMemberPassphrase);
TypeConversionHelpers::SetAllJoynMessageArg(alljoyn_msgarg_array_element(inputs, 2), "n", interfaceMemberAuthType);
QStatus status = alljoyn_proxybusobject_methodcall(
ProxyBusObject,
"org.alljoyn.Onboarding",
"ConfigureWiFi",
inputs,
argCount,
message,
c_MessageTimeoutInMilliseconds,
0);
result->Status = static_cast<int>(status);
if (ER_OK == status)
{
result->Status = AllJoynStatus::Ok;
int16 argument0;
status = static_cast<QStatus>(TypeConversionHelpers::GetAllJoynMessageArg(alljoyn_message_getarg(message, 0), "n", &argument0));
result->Status2 = argument0;
if (status != ER_OK)
{
result->Status = static_cast<int>(status);
}
}
else if (ER_BUS_REPLY_IS_ERROR_MESSAGE == status)
{
alljoyn_msgarg errorArg = alljoyn_message_getarg(message, 1);
if (nullptr != errorArg)
{
uint16 errorStatus;
status = alljoyn_msgarg_get_uint16(errorArg, &errorStatus);
if (ER_OK == status)
{
status = static_cast<QStatus>(errorStatus);
}
}
result->Status = static_cast<int>(status);
}
alljoyn_message_destroy(message);
alljoyn_msgarg_destroy(inputs);
return result;
});
}
IAsyncOperation<OnboardingConnectResult^>^ OnboardingConsumer::ConnectAsync()
{
return create_async([this]() -> OnboardingConnectResult^
{
auto result = ref new OnboardingConnectResult();
alljoyn_message message = alljoyn_message_create(m_nativeBusAttachment);
size_t argCount = 0;
alljoyn_msgarg inputs = alljoyn_msgarg_array_create(argCount);
QStatus status = alljoyn_proxybusobject_methodcall(
ProxyBusObject,
"org.alljoyn.Onboarding",
"Connect",
inputs,
argCount,
message,
c_MessageTimeoutInMilliseconds,
0);
result->Status = static_cast<int>(status);
alljoyn_message_destroy(message);
alljoyn_msgarg_destroy(inputs);
return result;
});
}
IAsyncOperation<OnboardingOffboardResult^>^ OnboardingConsumer::OffboardAsync()
{
return create_async([this]() -> OnboardingOffboardResult^
{
auto result = ref new OnboardingOffboardResult();
alljoyn_message message = alljoyn_message_create(m_nativeBusAttachment);
size_t argCount = 0;
alljoyn_msgarg inputs = alljoyn_msgarg_array_create(argCount);
QStatus status = alljoyn_proxybusobject_methodcall(
ProxyBusObject,
"org.alljoyn.Onboarding",
"Offboard",
inputs,
argCount,
message,
c_MessageTimeoutInMilliseconds,
0);
result->Status = static_cast<int>(status);
alljoyn_message_destroy(message);
alljoyn_msgarg_destroy(inputs);
return result;
});
}
IAsyncOperation<OnboardingGetScanInfoResult^>^ OnboardingConsumer::GetScanInfoAsync()
{
return create_async([this]() -> OnboardingGetScanInfoResult^
{
auto result = ref new OnboardingGetScanInfoResult();
alljoyn_message message = alljoyn_message_create(m_nativeBusAttachment);
size_t argCount = 0;
alljoyn_msgarg inputs = alljoyn_msgarg_array_create(argCount);
QStatus status = alljoyn_proxybusobject_methodcall(
ProxyBusObject,
"org.alljoyn.Onboarding",
"GetScanInfo",
inputs,
argCount,
message,
c_MessageTimeoutInMilliseconds,
0);
result->Status = static_cast<int>(status);
if (ER_OK == status)
{
result->Status = AllJoynStatus::Ok;
uint16 argument0;
status = static_cast<QStatus>(TypeConversionHelpers::GetAllJoynMessageArg(alljoyn_message_getarg(message, 0), "q", &argument0));
result->Age = argument0;
if (status != ER_OK)
{
result->Status = static_cast<int>(status);
}
Windows::Foundation::Collections::IVector<OnboardingScanListItem^>^ argument1;
status = static_cast<QStatus>(TypeConversionHelpers::GetAllJoynMessageArg(alljoyn_message_getarg(message, 1), "a(sn)", &argument1));
result->ScanList = argument1;
if (status != ER_OK)
{
result->Status = static_cast<int>(status);
}
}
else if (ER_BUS_REPLY_IS_ERROR_MESSAGE == status)
{
alljoyn_msgarg errorArg = alljoyn_message_getarg(message, 1);
if (nullptr != errorArg)
{
uint16 errorStatus;
status = alljoyn_msgarg_get_uint16(errorArg, &errorStatus);
if (ER_OK == status)
{
status = static_cast<QStatus>(errorStatus);
}
}
result->Status = static_cast<int>(status);
}
alljoyn_message_destroy(message);
alljoyn_msgarg_destroy(inputs);
return result;
});
}
IAsyncOperation<OnboardingGetVersionResult^>^ OnboardingConsumer::GetVersionAsync()
{
return create_async([this]() -> OnboardingGetVersionResult^
{
PropertyGetContext<uint16> getContext;
alljoyn_proxybusobject_getpropertyasync(
ProxyBusObject,
"org.alljoyn.Onboarding",
"Version",
[](QStatus status, alljoyn_proxybusobject obj, const alljoyn_msgarg value, void* context)
{
UNREFERENCED_PARAMETER(obj);
auto propertyContext = static_cast<PropertyGetContext<uint16>*>(context);
if (ER_OK == status)
{
uint16 argument;
TypeConversionHelpers::GetAllJoynMessageArg(value, "q", &argument);
propertyContext->SetValue(argument);
}
propertyContext->SetStatus(status);
propertyContext->SetEvent();
},
c_MessageTimeoutInMilliseconds,
&getContext);
getContext.Wait();
auto result = ref new OnboardingGetVersionResult();
result->Status = getContext.GetStatus();
result->Version = getContext.GetValue();
return result;
});
}
IAsyncOperation<OnboardingGetStateResult^>^ OnboardingConsumer::GetStateAsync()
{
return create_async([this]() -> OnboardingGetStateResult^
{
PropertyGetContext<int16> getContext;
alljoyn_proxybusobject_getpropertyasync(
ProxyBusObject,
"org.alljoyn.Onboarding",
"State",
[](QStatus status, alljoyn_proxybusobject obj, const alljoyn_msgarg value, void* context)
{
UNREFERENCED_PARAMETER(obj);
auto propertyContext = static_cast<PropertyGetContext<int16>*>(context);
if (ER_OK == status)
{
int16 argument;
TypeConversionHelpers::GetAllJoynMessageArg(value, "n", &argument);
propertyContext->SetValue(argument);
}
propertyContext->SetStatus(status);
propertyContext->SetEvent();
},
c_MessageTimeoutInMilliseconds,
&getContext);
getContext.Wait();
auto result = ref new OnboardingGetStateResult();
result->Status = getContext.GetStatus();
result->State = getContext.GetValue();
return result;
});
}
IAsyncOperation<OnboardingGetLastErrorResult^>^ OnboardingConsumer::GetLastErrorAsync()
{
return create_async([this]() -> OnboardingGetLastErrorResult^
{
PropertyGetContext<OnboardingLastError^> getContext;
alljoyn_proxybusobject_getpropertyasync(
ProxyBusObject,
"org.alljoyn.Onboarding",
"LastError",
[](QStatus status, alljoyn_proxybusobject obj, const alljoyn_msgarg value, void* context)
{
UNREFERENCED_PARAMETER(obj);
auto propertyContext = static_cast<PropertyGetContext<OnboardingLastError^>*>(context);
if (ER_OK == status)
{
OnboardingLastError^ argument;
TypeConversionHelpers::GetAllJoynMessageArg(value, "(ns)", &argument);
propertyContext->SetValue(argument);
}
propertyContext->SetStatus(status);
propertyContext->SetEvent();
},
c_MessageTimeoutInMilliseconds,
&getContext);
getContext.Wait();
auto result = ref new OnboardingGetLastErrorResult();
result->Status = getContext.GetStatus();
result->LastError = getContext.GetValue();
return result;
});
}
void OnboardingConsumer::OnPropertyChanged(_In_ alljoyn_proxybusobject obj, _In_ PCSTR interfaceName, _In_ const alljoyn_msgarg changed, _In_ const alljoyn_msgarg invalidated)
{
UNREFERENCED_PARAMETER(obj);
UNREFERENCED_PARAMETER(interfaceName);
UNREFERENCED_PARAMETER(changed);
UNREFERENCED_PARAMETER(invalidated);
}
void OnboardingConsumer::CallConnectionResultSignalHandler(_In_ const alljoyn_interfacedescription_member* member, _In_ alljoyn_message message)
{
auto source = SourceInterfaces.find(member->iface);
if (source == SourceInterfaces.end())
{
return;
}
auto consumer = source->second->Resolve<OnboardingConsumer>();
if (consumer->Signals != nullptr)
{
auto callInfo = ref new AllJoynMessageInfo(AllJoynHelpers::MultibyteToPlatformString(alljoyn_message_getsender(message)));
auto eventArgs = ref new OnboardingConnectionResultReceivedEventArgs();
eventArgs->MessageInfo = callInfo;
Onboarding^ argument0;
TypeConversionHelpers::GetAllJoynMessageArg(alljoyn_message_getarg(message, 0), "(ns)", &argument0);
eventArgs->Arg = argument0;
consumer->Signals->CallConnectionResultReceived(consumer->Signals, eventArgs);
}
}
int32 OnboardingConsumer::JoinSession(_In_ AllJoynServiceInfo^ serviceInfo)
{
alljoyn_sessionlistener_callbacks callbacks =
{
AllJoynHelpers::SessionLostHandler<OnboardingConsumer>,
AllJoynHelpers::SessionMemberAddedHandler<OnboardingConsumer>,
AllJoynHelpers::SessionMemberRemovedHandler<OnboardingConsumer>
};
alljoyn_busattachment_enableconcurrentcallbacks(AllJoynHelpers::GetInternalBusAttachment(m_busAttachment));
SessionListener = alljoyn_sessionlistener_create(&callbacks, m_weak);
alljoyn_sessionopts sessionOpts = alljoyn_sessionopts_create(ALLJOYN_TRAFFIC_TYPE_MESSAGES, true, ALLJOYN_PROXIMITY_ANY, ALLJOYN_TRANSPORT_ANY);
std::vector<char> sessionNameUtf8 = AllJoynHelpers::PlatformToMultibyteString(serviceInfo->UniqueName);
RETURN_IF_QSTATUS_ERROR(alljoyn_busattachment_joinsession(
m_nativeBusAttachment,
&sessionNameUtf8[0],
serviceInfo->SessionPort,
SessionListener,
&m_sessionId,
sessionOpts));
alljoyn_sessionopts_destroy(sessionOpts);
ServiceObjectPath = serviceInfo->ObjectPath;
std::vector<char> objectPath = AllJoynHelpers::PlatformToMultibyteString(ServiceObjectPath);
if (objectPath.empty())
{
return AllJoynStatus::Fail;
}
ProxyBusObject = alljoyn_proxybusobject_create(m_nativeBusAttachment, &sessionNameUtf8[0], &objectPath[0], m_sessionId);
if (nullptr == ProxyBusObject)
{
return AllJoynStatus::Fail;
}
alljoyn_interfacedescription description = alljoyn_busattachment_getinterface(m_nativeBusAttachment, "org.alljoyn.Onboarding");
if (nullptr == description)
{
return AllJoynStatus::Fail;
}
unsigned int noneMechanismIndex = 0;
bool authenticationMechanismsContainsNone = m_busAttachment->AuthenticationMechanisms->IndexOf(AllJoynAuthenticationMechanism::None, &noneMechanismIndex);
QCC_BOOL interfaceIsSecure = alljoyn_interfacedescription_issecure(description);
// If the current set of AuthenticationMechanisms supports authentication,
// determine whether to secure the connection.
if (AllJoynHelpers::CanSecure(m_busAttachment->AuthenticationMechanisms))
{
// Secure the connection if the org.alljoyn.Bus.Secure XML annotation
// is specified, or if None is not present in AuthenticationMechanisms.
if (!authenticationMechanismsContainsNone || interfaceIsSecure)
{
alljoyn_proxybusobject_secureconnection(ProxyBusObject, QCC_FALSE);
}
}
else
{
// If the current set of AuthenticationMechanisms does not support authentication
// but the interface requires security, report an error.
if (interfaceIsSecure)
{
return static_cast<int32>(ER_BUS_NO_AUTHENTICATION_MECHANISM);
}
}
RETURN_IF_QSTATUS_ERROR(AllJoynBusObjectManager::GetBusObject(m_nativeBusAttachment, AllJoynHelpers::PlatformToMultibyteString(ServiceObjectPath).data(), &m_busObject));
RETURN_IF_QSTATUS_ERROR(alljoyn_proxybusobject_addinterface(ProxyBusObject, description));
if (!AllJoynBusObjectManager::BusObjectIsRegistered(m_nativeBusAttachment, m_busObject))
{
RETURN_IF_QSTATUS_ERROR(alljoyn_busobject_addinterface(BusObject, description));
}
QStatus result = AddSignalHandler(
m_nativeBusAttachment,
description,
"ConnectionResult",
[](const alljoyn_interfacedescription_member* member, PCSTR srcPath, alljoyn_message message) { UNREFERENCED_PARAMETER(srcPath); CallConnectionResultSignalHandler(member, message); });
if (result != ER_OK)
{
return static_cast<int32>(result);
}
SourceInterfaces[description] = m_weak;
RETURN_IF_QSTATUS_ERROR(AllJoynBusObjectManager::TryRegisterBusObject(m_nativeBusAttachment, BusObject, true));
m_signals->Initialize(BusObject, m_sessionId);
return AllJoynStatus::Ok;
}
| MenyusSBP/Windows-universal-samples | Samples/AllJoyn/Common/Scenario2WinRTComponent/OnboardingConsumer.cpp | C++ | mit | 20,037 |
module.exports = function(css) {
var TokenType = require('../token-types');
var tokens = [],
urlMode = false,
blockMode = 0,
c, // current character
cn, // next character
pos = 0,
tn = 0,
ln = 1,
col = 1;
var Punctuation = {
' ': TokenType.Space,
'\n': TokenType.Newline,
'\r': TokenType.Newline,
'\t': TokenType.Tab,
'!': TokenType.ExclamationMark,
'"': TokenType.QuotationMark,
'#': TokenType.NumberSign,
'$': TokenType.DollarSign,
'%': TokenType.PercentSign,
'&': TokenType.Ampersand,
'\'': TokenType.Apostrophe,
'(': TokenType.LeftParenthesis,
')': TokenType.RightParenthesis,
'*': TokenType.Asterisk,
'+': TokenType.PlusSign,
',': TokenType.Comma,
'-': TokenType.HyphenMinus,
'.': TokenType.FullStop,
'/': TokenType.Solidus,
':': TokenType.Colon,
';': TokenType.Semicolon,
'<': TokenType.LessThanSign,
'=': TokenType.EqualsSign,
'>': TokenType.GreaterThanSign,
'?': TokenType.QuestionMark,
'@': TokenType.CommercialAt,
'[': TokenType.LeftSquareBracket,
']': TokenType.RightSquareBracket,
'^': TokenType.CircumflexAccent,
'_': TokenType.LowLine,
'{': TokenType.LeftCurlyBracket,
'|': TokenType.VerticalLine,
'}': TokenType.RightCurlyBracket,
'~': TokenType.Tilde
};
/**
* Add a token to the token list
* @param {string} type
* @param {string} value
*/
function pushToken(type, value, column) {
tokens.push({
tn: tn++,
ln: ln,
col: column,
type: type,
value: value
});
}
/**
* Check if a character is a decimal digit
* @param {string} c Character
* @returns {boolean}
*/
function isDecimalDigit(c) {
return '0123456789'.indexOf(c) >= 0;
}
/**
* Parse spaces
* @param {string} css Unparsed part of CSS string
*/
function parseSpaces(css) {
var start = pos;
// Read the string until we meet a non-space character:
for (; pos < css.length; pos++) {
if (css.charAt(pos) !== ' ') break;
}
// Add a substring containing only spaces to tokens:
pushToken(TokenType.Space, css.substring(start, pos--), col);
col += (pos - start);
}
/**
* Parse a string within quotes
* @param {string} css Unparsed part of CSS string
* @param {string} q Quote (either `'` or `"`)
*/
function parseString(css, q) {
var start = pos;
// Read the string until we meet a matching quote:
for (pos++; pos < css.length; pos++) {
// Skip escaped quotes:
if (css.charAt(pos) === '\\') pos++;
else if (css.charAt(pos) === q) break;
}
// Add the string (including quotes) to tokens:
pushToken(q === '"' ? TokenType.StringDQ : TokenType.StringSQ, css.substring(start, pos + 1), col);
col += (pos - start);
}
/**
* Parse numbers
* @param {string} css Unparsed part of CSS string
*/
function parseDecimalNumber(css) {
var start = pos;
// Read the string until we meet a character that's not a digit:
for (; pos < css.length; pos++) {
if (!isDecimalDigit(css.charAt(pos))) break;
}
// Add the number to tokens:
pushToken(TokenType.DecimalNumber, css.substring(start, pos--), col);
col += (pos - start);
}
/**
* Parse identifier
* @param {string} css Unparsed part of CSS string
*/
function parseIdentifier(css) {
var start = pos;
// Skip all opening slashes:
while (css.charAt(pos) === '/') pos++;
// Read the string until we meet a punctuation mark:
for (; pos < css.length; pos++) {
// Skip all '\':
if (css.charAt(pos) === '\\') pos++;
else if (css.charAt(pos) in Punctuation) break;
}
var ident = css.substring(start, pos--);
// Enter url mode if parsed substring is `url`:
urlMode = urlMode || ident === 'url';
// Add identifier to tokens:
pushToken(TokenType.Identifier, ident, col);
col += (pos - start);
}
/**
* Parse a multiline comment
* @param {string} css Unparsed part of CSS string
*/
function parseMLComment(css) {
var start = pos;
// Read the string until we meet `*/`.
// Since we already know first 2 characters (`/*`), start reading
// from `pos + 2`:
for (pos = pos + 2; pos < css.length; pos++) {
if (css.charAt(pos) === '*' && css.charAt(pos + 1) === '/') {
pos++;
break;
}
}
// Add full comment (including `/*` and `*/`) to the list of tokens:
var comment = css.substring(start, pos + 1);
pushToken(TokenType.CommentML, comment, col);
var newlines = comment.split('\n');
if (newlines.length > 1) {
ln += newlines.length - 1;
col = newlines[newlines.length - 1].length;
} else {
col += (pos - start);
}
}
/**
* Parse a single line comment
* @param {string} css Unparsed part of CSS string
*/
function parseSLComment(css) {
var start = pos;
// Read the string until we meet line break.
// Since we already know first 2 characters (`//`), start reading
// from `pos + 2`:
for (pos+=2; pos < css.length; pos++) {
if (css.charAt(pos) === '\n' || css.charAt(pos) === '\r') {
break;
}
}
// Add comment (including `//` and line break) to the list of tokens:
pushToken(TokenType.CommentSL, css.substring(start, pos--), col);
col += pos - start;
}
/**
* Convert a CSS string to a list of tokens
* @param {string} css CSS string
* @returns {Array} List of tokens
* @private
*/
function getTokens(css) {
// Parse string, character by character:
for (pos = 0; pos < css.length; col++, pos++) {
c = css.charAt(pos);
cn = css.charAt(pos + 1);
// If we meet `/*`, it's a start of a multiline comment.
// Parse following characters as a multiline comment:
if (c === '/' && cn === '*') {
parseMLComment(css);
}
// If we meet `//` and it is not a part of url:
else if (!urlMode && c === '/' && cn === '/') {
// If we're currently inside a block, treat `//` as a start
// of identifier. Else treat `//` as a start of a single-line
// comment:
parseSLComment(css);
}
// If current character is a double or single quote, it's a start
// of a string:
else if (c === '"' || c === "'") {
parseString(css, c);
}
// If current character is a space:
else if (c === ' ') {
parseSpaces(css);
}
// If current character is a punctuation mark:
else if (c in Punctuation) {
// Add it to the list of tokens:
pushToken(Punctuation[c], c, col);
if (c === '\n' || c === '\r') {
ln++;
col = 0;
} // Go to next line
if (c === ')') urlMode = false; // exit url mode
if (c === '{') blockMode++; // enter a block
if (c === '}') blockMode--; // exit a block
}
// If current character is a decimal digit:
else if (isDecimalDigit(c)) {
parseDecimalNumber(css);
}
// If current character is anything else:
else {
parseIdentifier(css);
}
}
return tokens;
}
return getTokens(css);
};
| goodliang/bootstrap | node_modules/gonzales-pe/lib/less/tokenizer.js | JavaScript | mit | 8,221 |
import unittest
from test import support
# Skip this test if the _testcapi module isn't available.
support.import_module('_testcapi')
from _testcapi import getargs_keywords, getargs_keyword_only
try:
from _testcapi import getargs_L, getargs_K
except ImportError:
getargs_L = None # PY_LONG_LONG not available
# > How about the following counterproposal. This also changes some of
# > the other format codes to be a little more regular.
# >
# > Code C type Range check
# >
# > b unsigned char 0..UCHAR_MAX
# > h signed short SHRT_MIN..SHRT_MAX
# > B unsigned char none **
# > H unsigned short none **
# > k * unsigned long none
# > I * unsigned int 0..UINT_MAX
#
#
# > i int INT_MIN..INT_MAX
# > l long LONG_MIN..LONG_MAX
#
# > K * unsigned long long none
# > L long long LLONG_MIN..LLONG_MAX
#
# > Notes:
# >
# > * New format codes.
# >
# > ** Changed from previous "range-and-a-half" to "none"; the
# > range-and-a-half checking wasn't particularly useful.
#
# Plus a C API or two, e.g. PyInt_AsLongMask() ->
# unsigned long and PyInt_AsLongLongMask() -> unsigned
# long long (if that exists).
LARGE = 0x7FFFFFFF
VERY_LARGE = 0xFF0000121212121212121242
from _testcapi import UCHAR_MAX, USHRT_MAX, UINT_MAX, ULONG_MAX, INT_MAX, \
INT_MIN, LONG_MIN, LONG_MAX, PY_SSIZE_T_MIN, PY_SSIZE_T_MAX, \
SHRT_MIN, SHRT_MAX
# fake, they are not defined in Python's header files
LLONG_MAX = 2**63-1
LLONG_MIN = -2**63
ULLONG_MAX = 2**64-1
class Int:
def __int__(self):
return 99
class IntSubclass(int):
def __int__(self):
return 99
class BadInt:
def __int__(self):
return 1.0
class BadInt2:
def __int__(self):
return True
class BadInt3(int):
def __int__(self):
return True
class Unsigned_TestCase(unittest.TestCase):
def test_b(self):
from _testcapi import getargs_b
# b returns 'unsigned char', and does range checking (0 ... UCHAR_MAX)
self.assertRaises(TypeError, getargs_b, 3.14)
self.assertEqual(99, getargs_b(Int()))
self.assertEqual(0, getargs_b(IntSubclass()))
self.assertRaises(TypeError, getargs_b, BadInt())
with self.assertWarns(DeprecationWarning):
self.assertEqual(1, getargs_b(BadInt2()))
self.assertEqual(0, getargs_b(BadInt3()))
self.assertRaises(OverflowError, getargs_b, -1)
self.assertEqual(0, getargs_b(0))
self.assertEqual(UCHAR_MAX, getargs_b(UCHAR_MAX))
self.assertRaises(OverflowError, getargs_b, UCHAR_MAX + 1)
self.assertEqual(42, getargs_b(42))
self.assertRaises(OverflowError, getargs_b, VERY_LARGE)
def test_B(self):
from _testcapi import getargs_B
# B returns 'unsigned char', no range checking
self.assertRaises(TypeError, getargs_B, 3.14)
self.assertEqual(99, getargs_B(Int()))
self.assertEqual(0, getargs_B(IntSubclass()))
self.assertRaises(TypeError, getargs_B, BadInt())
with self.assertWarns(DeprecationWarning):
self.assertEqual(1, getargs_B(BadInt2()))
self.assertEqual(0, getargs_B(BadInt3()))
self.assertEqual(UCHAR_MAX, getargs_B(-1))
self.assertEqual(0, getargs_B(0))
self.assertEqual(UCHAR_MAX, getargs_B(UCHAR_MAX))
self.assertEqual(0, getargs_B(UCHAR_MAX+1))
self.assertEqual(42, getargs_B(42))
self.assertEqual(UCHAR_MAX & VERY_LARGE, getargs_B(VERY_LARGE))
def test_H(self):
from _testcapi import getargs_H
# H returns 'unsigned short', no range checking
self.assertRaises(TypeError, getargs_H, 3.14)
self.assertEqual(99, getargs_H(Int()))
self.assertEqual(0, getargs_H(IntSubclass()))
self.assertRaises(TypeError, getargs_H, BadInt())
with self.assertWarns(DeprecationWarning):
self.assertEqual(1, getargs_H(BadInt2()))
self.assertEqual(0, getargs_H(BadInt3()))
self.assertEqual(USHRT_MAX, getargs_H(-1))
self.assertEqual(0, getargs_H(0))
self.assertEqual(USHRT_MAX, getargs_H(USHRT_MAX))
self.assertEqual(0, getargs_H(USHRT_MAX+1))
self.assertEqual(42, getargs_H(42))
self.assertEqual(VERY_LARGE & USHRT_MAX, getargs_H(VERY_LARGE))
def test_I(self):
from _testcapi import getargs_I
# I returns 'unsigned int', no range checking
self.assertRaises(TypeError, getargs_I, 3.14)
self.assertEqual(99, getargs_I(Int()))
self.assertEqual(0, getargs_I(IntSubclass()))
self.assertRaises(TypeError, getargs_I, BadInt())
with self.assertWarns(DeprecationWarning):
self.assertEqual(1, getargs_I(BadInt2()))
self.assertEqual(0, getargs_I(BadInt3()))
self.assertEqual(UINT_MAX, getargs_I(-1))
self.assertEqual(0, getargs_I(0))
self.assertEqual(UINT_MAX, getargs_I(UINT_MAX))
self.assertEqual(0, getargs_I(UINT_MAX+1))
self.assertEqual(42, getargs_I(42))
self.assertEqual(VERY_LARGE & UINT_MAX, getargs_I(VERY_LARGE))
def test_k(self):
from _testcapi import getargs_k
# k returns 'unsigned long', no range checking
# it does not accept float, or instances with __int__
self.assertRaises(TypeError, getargs_k, 3.14)
self.assertRaises(TypeError, getargs_k, Int())
self.assertEqual(0, getargs_k(IntSubclass()))
self.assertRaises(TypeError, getargs_k, BadInt())
self.assertRaises(TypeError, getargs_k, BadInt2())
self.assertEqual(0, getargs_k(BadInt3()))
self.assertEqual(ULONG_MAX, getargs_k(-1))
self.assertEqual(0, getargs_k(0))
self.assertEqual(ULONG_MAX, getargs_k(ULONG_MAX))
self.assertEqual(0, getargs_k(ULONG_MAX+1))
self.assertEqual(42, getargs_k(42))
self.assertEqual(VERY_LARGE & ULONG_MAX, getargs_k(VERY_LARGE))
class Signed_TestCase(unittest.TestCase):
def test_h(self):
from _testcapi import getargs_h
# h returns 'short', and does range checking (SHRT_MIN ... SHRT_MAX)
self.assertRaises(TypeError, getargs_h, 3.14)
self.assertEqual(99, getargs_h(Int()))
self.assertEqual(0, getargs_h(IntSubclass()))
self.assertRaises(TypeError, getargs_h, BadInt())
with self.assertWarns(DeprecationWarning):
self.assertEqual(1, getargs_h(BadInt2()))
self.assertEqual(0, getargs_h(BadInt3()))
self.assertRaises(OverflowError, getargs_h, SHRT_MIN-1)
self.assertEqual(SHRT_MIN, getargs_h(SHRT_MIN))
self.assertEqual(SHRT_MAX, getargs_h(SHRT_MAX))
self.assertRaises(OverflowError, getargs_h, SHRT_MAX+1)
self.assertEqual(42, getargs_h(42))
self.assertRaises(OverflowError, getargs_h, VERY_LARGE)
def test_i(self):
from _testcapi import getargs_i
# i returns 'int', and does range checking (INT_MIN ... INT_MAX)
self.assertRaises(TypeError, getargs_i, 3.14)
self.assertEqual(99, getargs_i(Int()))
self.assertEqual(0, getargs_i(IntSubclass()))
self.assertRaises(TypeError, getargs_i, BadInt())
with self.assertWarns(DeprecationWarning):
self.assertEqual(1, getargs_i(BadInt2()))
self.assertEqual(0, getargs_i(BadInt3()))
self.assertRaises(OverflowError, getargs_i, INT_MIN-1)
self.assertEqual(INT_MIN, getargs_i(INT_MIN))
self.assertEqual(INT_MAX, getargs_i(INT_MAX))
self.assertRaises(OverflowError, getargs_i, INT_MAX+1)
self.assertEqual(42, getargs_i(42))
self.assertRaises(OverflowError, getargs_i, VERY_LARGE)
def test_l(self):
from _testcapi import getargs_l
# l returns 'long', and does range checking (LONG_MIN ... LONG_MAX)
self.assertRaises(TypeError, getargs_l, 3.14)
self.assertEqual(99, getargs_l(Int()))
self.assertEqual(0, getargs_l(IntSubclass()))
self.assertRaises(TypeError, getargs_l, BadInt())
with self.assertWarns(DeprecationWarning):
self.assertEqual(1, getargs_l(BadInt2()))
self.assertEqual(0, getargs_l(BadInt3()))
self.assertRaises(OverflowError, getargs_l, LONG_MIN-1)
self.assertEqual(LONG_MIN, getargs_l(LONG_MIN))
self.assertEqual(LONG_MAX, getargs_l(LONG_MAX))
self.assertRaises(OverflowError, getargs_l, LONG_MAX+1)
self.assertEqual(42, getargs_l(42))
self.assertRaises(OverflowError, getargs_l, VERY_LARGE)
def test_n(self):
from _testcapi import getargs_n
# n returns 'Py_ssize_t', and does range checking
# (PY_SSIZE_T_MIN ... PY_SSIZE_T_MAX)
self.assertRaises(TypeError, getargs_n, 3.14)
self.assertRaises(TypeError, getargs_n, Int())
self.assertEqual(0, getargs_n(IntSubclass()))
self.assertRaises(TypeError, getargs_n, BadInt())
self.assertRaises(TypeError, getargs_n, BadInt2())
self.assertEqual(0, getargs_n(BadInt3()))
self.assertRaises(OverflowError, getargs_n, PY_SSIZE_T_MIN-1)
self.assertEqual(PY_SSIZE_T_MIN, getargs_n(PY_SSIZE_T_MIN))
self.assertEqual(PY_SSIZE_T_MAX, getargs_n(PY_SSIZE_T_MAX))
self.assertRaises(OverflowError, getargs_n, PY_SSIZE_T_MAX+1)
self.assertEqual(42, getargs_n(42))
self.assertRaises(OverflowError, getargs_n, VERY_LARGE)
@unittest.skipIf(getargs_L is None, 'PY_LONG_LONG is not available')
class LongLong_TestCase(unittest.TestCase):
def test_L(self):
from _testcapi import getargs_L
# L returns 'long long', and does range checking (LLONG_MIN
# ... LLONG_MAX)
self.assertRaises(TypeError, getargs_L, 3.14)
self.assertRaises(TypeError, getargs_L, "Hello")
self.assertEqual(99, getargs_L(Int()))
self.assertEqual(0, getargs_L(IntSubclass()))
self.assertRaises(TypeError, getargs_L, BadInt())
with self.assertWarns(DeprecationWarning):
self.assertEqual(1, getargs_L(BadInt2()))
self.assertEqual(0, getargs_L(BadInt3()))
self.assertRaises(OverflowError, getargs_L, LLONG_MIN-1)
self.assertEqual(LLONG_MIN, getargs_L(LLONG_MIN))
self.assertEqual(LLONG_MAX, getargs_L(LLONG_MAX))
self.assertRaises(OverflowError, getargs_L, LLONG_MAX+1)
self.assertEqual(42, getargs_L(42))
self.assertRaises(OverflowError, getargs_L, VERY_LARGE)
def test_K(self):
from _testcapi import getargs_K
# K return 'unsigned long long', no range checking
self.assertRaises(TypeError, getargs_K, 3.14)
self.assertRaises(TypeError, getargs_K, Int())
self.assertEqual(0, getargs_K(IntSubclass()))
self.assertRaises(TypeError, getargs_K, BadInt())
self.assertRaises(TypeError, getargs_K, BadInt2())
self.assertEqual(0, getargs_K(BadInt3()))
self.assertEqual(ULLONG_MAX, getargs_K(ULLONG_MAX))
self.assertEqual(0, getargs_K(0))
self.assertEqual(0, getargs_K(ULLONG_MAX+1))
self.assertEqual(42, getargs_K(42))
self.assertEqual(VERY_LARGE & ULLONG_MAX, getargs_K(VERY_LARGE))
class Paradox:
"This statement is false."
def __bool__(self):
raise NotImplementedError
class Boolean_TestCase(unittest.TestCase):
def test_p(self):
from _testcapi import getargs_p
self.assertEqual(0, getargs_p(False))
self.assertEqual(0, getargs_p(None))
self.assertEqual(0, getargs_p(0))
self.assertEqual(0, getargs_p(0.0))
self.assertEqual(0, getargs_p(0j))
self.assertEqual(0, getargs_p(''))
self.assertEqual(0, getargs_p(()))
self.assertEqual(0, getargs_p([]))
self.assertEqual(0, getargs_p({}))
self.assertEqual(1, getargs_p(True))
self.assertEqual(1, getargs_p(1))
self.assertEqual(1, getargs_p(1.0))
self.assertEqual(1, getargs_p(1j))
self.assertEqual(1, getargs_p('x'))
self.assertEqual(1, getargs_p((1,)))
self.assertEqual(1, getargs_p([1]))
self.assertEqual(1, getargs_p({1:2}))
self.assertEqual(1, getargs_p(unittest.TestCase))
self.assertRaises(NotImplementedError, getargs_p, Paradox())
class Tuple_TestCase(unittest.TestCase):
def test_tuple(self):
from _testcapi import getargs_tuple
ret = getargs_tuple(1, (2, 3))
self.assertEqual(ret, (1,2,3))
# make sure invalid tuple arguments are handled correctly
class seq:
def __len__(self):
return 2
def __getitem__(self, n):
raise ValueError
self.assertRaises(TypeError, getargs_tuple, 1, seq())
class Keywords_TestCase(unittest.TestCase):
def test_positional_args(self):
# using all positional args
self.assertEqual(
getargs_keywords((1,2), 3, (4,(5,6)), (7,8,9), 10),
(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
)
def test_mixed_args(self):
# positional and keyword args
self.assertEqual(
getargs_keywords((1,2), 3, (4,(5,6)), arg4=(7,8,9), arg5=10),
(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
)
def test_keyword_args(self):
# all keywords
self.assertEqual(
getargs_keywords(arg1=(1,2), arg2=3, arg3=(4,(5,6)), arg4=(7,8,9), arg5=10),
(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
)
def test_optional_args(self):
# missing optional keyword args, skipping tuples
self.assertEqual(
getargs_keywords(arg1=(1,2), arg2=3, arg5=10),
(1, 2, 3, -1, -1, -1, -1, -1, -1, 10)
)
def test_required_args(self):
# required arg missing
try:
getargs_keywords(arg1=(1,2))
except TypeError as err:
self.assertEqual(str(err), "Required argument 'arg2' (pos 2) not found")
else:
self.fail('TypeError should have been raised')
def test_too_many_args(self):
try:
getargs_keywords((1,2),3,(4,(5,6)),(7,8,9),10,111)
except TypeError as err:
self.assertEqual(str(err), "function takes at most 5 arguments (6 given)")
else:
self.fail('TypeError should have been raised')
def test_invalid_keyword(self):
# extraneous keyword arg
try:
getargs_keywords((1,2),3,arg5=10,arg666=666)
except TypeError as err:
self.assertEqual(str(err), "'arg666' is an invalid keyword argument for this function")
else:
self.fail('TypeError should have been raised')
def test_surrogate_keyword(self):
try:
getargs_keywords((1,2), 3, (4,(5,6)), (7,8,9), **{'\uDC80': 10})
except TypeError as err:
self.assertEqual(str(err), "'\udc80' is an invalid keyword argument for this function")
else:
self.fail('TypeError should have been raised')
class KeywordOnly_TestCase(unittest.TestCase):
def test_positional_args(self):
# using all possible positional args
self.assertEqual(
getargs_keyword_only(1, 2),
(1, 2, -1)
)
def test_mixed_args(self):
# positional and keyword args
self.assertEqual(
getargs_keyword_only(1, 2, keyword_only=3),
(1, 2, 3)
)
def test_keyword_args(self):
# all keywords
self.assertEqual(
getargs_keyword_only(required=1, optional=2, keyword_only=3),
(1, 2, 3)
)
def test_optional_args(self):
# missing optional keyword args, skipping tuples
self.assertEqual(
getargs_keyword_only(required=1, optional=2),
(1, 2, -1)
)
self.assertEqual(
getargs_keyword_only(required=1, keyword_only=3),
(1, -1, 3)
)
def test_required_args(self):
self.assertEqual(
getargs_keyword_only(1),
(1, -1, -1)
)
self.assertEqual(
getargs_keyword_only(required=1),
(1, -1, -1)
)
# required arg missing
with self.assertRaisesRegex(TypeError,
"Required argument 'required' \(pos 1\) not found"):
getargs_keyword_only(optional=2)
with self.assertRaisesRegex(TypeError,
"Required argument 'required' \(pos 1\) not found"):
getargs_keyword_only(keyword_only=3)
def test_too_many_args(self):
with self.assertRaisesRegex(TypeError,
"Function takes at most 2 positional arguments \(3 given\)"):
getargs_keyword_only(1, 2, 3)
with self.assertRaisesRegex(TypeError,
"function takes at most 3 arguments \(4 given\)"):
getargs_keyword_only(1, 2, 3, keyword_only=5)
def test_invalid_keyword(self):
# extraneous keyword arg
with self.assertRaisesRegex(TypeError,
"'monster' is an invalid keyword argument for this function"):
getargs_keyword_only(1, 2, monster=666)
def test_surrogate_keyword(self):
with self.assertRaisesRegex(TypeError,
"'\udc80' is an invalid keyword argument for this function"):
getargs_keyword_only(1, 2, **{'\uDC80': 10})
class Bytes_TestCase(unittest.TestCase):
def test_c(self):
from _testcapi import getargs_c
self.assertRaises(TypeError, getargs_c, b'abc') # len > 1
self.assertEqual(getargs_c(b'a'), b'a')
self.assertEqual(getargs_c(bytearray(b'a')), b'a')
self.assertRaises(TypeError, getargs_c, memoryview(b'a'))
self.assertRaises(TypeError, getargs_c, 's')
self.assertRaises(TypeError, getargs_c, None)
def test_s(self):
from _testcapi import getargs_s
self.assertEqual(getargs_s('abc\xe9'), b'abc\xc3\xa9')
self.assertRaises(TypeError, getargs_s, 'nul:\0')
self.assertRaises(TypeError, getargs_s, b'bytes')
self.assertRaises(TypeError, getargs_s, bytearray(b'bytearray'))
self.assertRaises(TypeError, getargs_s, memoryview(b'memoryview'))
self.assertRaises(TypeError, getargs_s, None)
def test_s_star(self):
from _testcapi import getargs_s_star
self.assertEqual(getargs_s_star('abc\xe9'), b'abc\xc3\xa9')
self.assertEqual(getargs_s_star('nul:\0'), b'nul:\0')
self.assertEqual(getargs_s_star(b'bytes'), b'bytes')
self.assertEqual(getargs_s_star(bytearray(b'bytearray')), b'bytearray')
self.assertEqual(getargs_s_star(memoryview(b'memoryview')), b'memoryview')
self.assertRaises(TypeError, getargs_s_star, None)
def test_s_hash(self):
from _testcapi import getargs_s_hash
self.assertEqual(getargs_s_hash('abc\xe9'), b'abc\xc3\xa9')
self.assertEqual(getargs_s_hash('nul:\0'), b'nul:\0')
self.assertEqual(getargs_s_hash(b'bytes'), b'bytes')
self.assertRaises(TypeError, getargs_s_hash, bytearray(b'bytearray'))
self.assertRaises(TypeError, getargs_s_hash, memoryview(b'memoryview'))
self.assertRaises(TypeError, getargs_s_hash, None)
def test_z(self):
from _testcapi import getargs_z
self.assertEqual(getargs_z('abc\xe9'), b'abc\xc3\xa9')
self.assertRaises(TypeError, getargs_z, 'nul:\0')
self.assertRaises(TypeError, getargs_z, b'bytes')
self.assertRaises(TypeError, getargs_z, bytearray(b'bytearray'))
self.assertRaises(TypeError, getargs_z, memoryview(b'memoryview'))
self.assertIsNone(getargs_z(None))
def test_z_star(self):
from _testcapi import getargs_z_star
self.assertEqual(getargs_z_star('abc\xe9'), b'abc\xc3\xa9')
self.assertEqual(getargs_z_star('nul:\0'), b'nul:\0')
self.assertEqual(getargs_z_star(b'bytes'), b'bytes')
self.assertEqual(getargs_z_star(bytearray(b'bytearray')), b'bytearray')
self.assertEqual(getargs_z_star(memoryview(b'memoryview')), b'memoryview')
self.assertIsNone(getargs_z_star(None))
def test_z_hash(self):
from _testcapi import getargs_z_hash
self.assertEqual(getargs_z_hash('abc\xe9'), b'abc\xc3\xa9')
self.assertEqual(getargs_z_hash('nul:\0'), b'nul:\0')
self.assertEqual(getargs_z_hash(b'bytes'), b'bytes')
self.assertRaises(TypeError, getargs_z_hash, bytearray(b'bytearray'))
self.assertRaises(TypeError, getargs_z_hash, memoryview(b'memoryview'))
self.assertIsNone(getargs_z_hash(None))
def test_y(self):
from _testcapi import getargs_y
self.assertRaises(TypeError, getargs_y, 'abc\xe9')
self.assertEqual(getargs_y(b'bytes'), b'bytes')
self.assertRaises(TypeError, getargs_y, b'nul:\0')
self.assertRaises(TypeError, getargs_y, bytearray(b'bytearray'))
self.assertRaises(TypeError, getargs_y, memoryview(b'memoryview'))
self.assertRaises(TypeError, getargs_y, None)
def test_y_star(self):
from _testcapi import getargs_y_star
self.assertRaises(TypeError, getargs_y_star, 'abc\xe9')
self.assertEqual(getargs_y_star(b'bytes'), b'bytes')
self.assertEqual(getargs_y_star(b'nul:\0'), b'nul:\0')
self.assertEqual(getargs_y_star(bytearray(b'bytearray')), b'bytearray')
self.assertEqual(getargs_y_star(memoryview(b'memoryview')), b'memoryview')
self.assertRaises(TypeError, getargs_y_star, None)
def test_y_hash(self):
from _testcapi import getargs_y_hash
self.assertRaises(TypeError, getargs_y_hash, 'abc\xe9')
self.assertEqual(getargs_y_hash(b'bytes'), b'bytes')
self.assertEqual(getargs_y_hash(b'nul:\0'), b'nul:\0')
self.assertRaises(TypeError, getargs_y_hash, bytearray(b'bytearray'))
self.assertRaises(TypeError, getargs_y_hash, memoryview(b'memoryview'))
self.assertRaises(TypeError, getargs_y_hash, None)
def test_w_star(self):
# getargs_w_star() modifies first and last byte
from _testcapi import getargs_w_star
self.assertRaises(TypeError, getargs_w_star, 'abc\xe9')
self.assertRaises(TypeError, getargs_w_star, b'bytes')
self.assertRaises(TypeError, getargs_w_star, b'nul:\0')
self.assertRaises(TypeError, getargs_w_star, memoryview(b'bytes'))
self.assertEqual(getargs_w_star(bytearray(b'bytearray')), b'[ytearra]')
self.assertEqual(getargs_w_star(memoryview(bytearray(b'memoryview'))),
b'[emoryvie]')
self.assertRaises(TypeError, getargs_w_star, None)
class Unicode_TestCase(unittest.TestCase):
def test_u(self):
from _testcapi import getargs_u
self.assertEqual(getargs_u('abc\xe9'), 'abc\xe9')
self.assertRaises(TypeError, getargs_u, 'nul:\0')
self.assertRaises(TypeError, getargs_u, b'bytes')
self.assertRaises(TypeError, getargs_u, bytearray(b'bytearray'))
self.assertRaises(TypeError, getargs_u, memoryview(b'memoryview'))
self.assertRaises(TypeError, getargs_u, None)
def test_u_hash(self):
from _testcapi import getargs_u_hash
self.assertEqual(getargs_u_hash('abc\xe9'), 'abc\xe9')
self.assertEqual(getargs_u_hash('nul:\0'), 'nul:\0')
self.assertRaises(TypeError, getargs_u_hash, b'bytes')
self.assertRaises(TypeError, getargs_u_hash, bytearray(b'bytearray'))
self.assertRaises(TypeError, getargs_u_hash, memoryview(b'memoryview'))
self.assertRaises(TypeError, getargs_u_hash, None)
def test_Z(self):
from _testcapi import getargs_Z
self.assertEqual(getargs_Z('abc\xe9'), 'abc\xe9')
self.assertRaises(TypeError, getargs_Z, 'nul:\0')
self.assertRaises(TypeError, getargs_Z, b'bytes')
self.assertRaises(TypeError, getargs_Z, bytearray(b'bytearray'))
self.assertRaises(TypeError, getargs_Z, memoryview(b'memoryview'))
self.assertIsNone(getargs_Z(None))
def test_Z_hash(self):
from _testcapi import getargs_Z_hash
self.assertEqual(getargs_Z_hash('abc\xe9'), 'abc\xe9')
self.assertEqual(getargs_Z_hash('nul:\0'), 'nul:\0')
self.assertRaises(TypeError, getargs_Z_hash, b'bytes')
self.assertRaises(TypeError, getargs_Z_hash, bytearray(b'bytearray'))
self.assertRaises(TypeError, getargs_Z_hash, memoryview(b'memoryview'))
self.assertIsNone(getargs_Z_hash(None))
if __name__ == "__main__":
unittest.main()
| chidea/GoPythonDLLWrapper | bin/lib/test/test_getargs2.py | Python | mit | 24,534 |
/**
*
* Version: 0.2.6
* Author: Gianluca Guarini
* Contact: gianluca.guarini@gmail.com
* Website: http://www.gianlucaguarini.com/
* Twitter: @gianlucaguarini
*
* Copyright (c) 2013 Gianluca Guarini
*/
(function(e){e.fn.extend({BlackAndWhite:function(d){var j=this;d=e.extend({hoverEffect:!0,webworkerPath:!1,responsive:!0,invertHoverEffect:!1,speed:500,onImageReady:null},d);var y=d.hoverEffect,s=d.webworkerPath,q=d.invertHoverEffect,z=d.responsive,t=e.isPlainObject(d.speed)?d.speed.fadeIn:d.speed;e.isPlainObject(d.speed);var A=document.all&&!window.opera&&window.XMLHttpRequest?!0:!1,m={},u=function(c){if(m[c]||""===m[c])return m[c]+c;var e=document.createElement("div"),b=" Moz Webkit O ms Khtml".split(" "),
a;for(a in b)if("undefined"!==typeof e.style[b[a]+c])return m[c]=b[a],b[a]+c;return c.toLowerCase()},v,n=document.createElement("div");n.style.cssText=" -webkit- -moz- -o- -ms- ".split(" ").join("filter:blur(2px); ");v=!!n.style.length&&(void 0===document.documentMode||9<document.documentMode);var B=!!document.createElement("canvas").getContext,C=e(window),n="undefined"!==typeof Worker?!0:!1;u("Filter");var l=[],p=n&&s?new Worker(s+"BnWWorker.js"):!1,D=function(c){e(c.currentTarget).find(".BWfade").stop(!0,
!0)[!q?"fadeIn":"fadeOut"](t)},E=function(c){e(c.currentTarget).find(".BWfade").stop(!0,!0)[q?"fadeIn":"fadeOut"](t)},r=function(c){if("function"===typeof d.onImageReady)d.onImageReady(c)},w=function(){l.length&&(p.postMessage(l[0].imageData),p.onmessage=function(c){l[0].ctx.putImageData(c.data,0,0);r(l[0].img);l.splice(0,1);w()})},x=function(c,d){var b=c[0],a=b.src,g=c.width(),f=c.height(),h={position:"absolute",top:0,left:0,display:q?"none":"block",width:g,height:f};if(B&&!v){g=b.width;f=b.height;
e('<canvas class="BWfade" width="'+g+'" height="'+f+'"></canvas>').prependTo(d);a=d.find("canvas");a.css(h);h=a[0].getContext("2d");a=0;h.drawImage(b,0,0,g,f);var f=h.getImageData(0,0,g,f),k=f.data,j=k.length;if(p)l.push({imageData:f,ctx:h,img:b});else{for(;a<j;a+=4)g=0.3*k[a]+0.59*k[a+1]+0.11*k[a+2],k[a]=k[a+1]=k[a+2]=g;h.putImageData(f,0,0);r(b)}}else h[u("Filter")]="grayscale(100%)",e("<img src="+a+' width="'+g+'" height="'+f+'" class="BWFilter BWfade" /> ').prependTo(d),e(".BWFilter").css(e.extend(h,
{filter:"progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)"})),r(b)};this.init=function(){j.each(function(c,d){var b=e(d),a=b.find("img");if(a.width())x(a,b);else a.on("load",function(){x(a,b)})});p&&w();y&&(j.on("mouseleave",D),j.on("mouseenter",E));if(z)C.on("resize orientationchange",j.resizeImages)};this.resizeImages=function(){j.each(function(c,d){var b=e(d).find("img:not(.BWFilter)"),a;A?(a=e(b).prop("width"),b=e(b).prop("height")):(a=e(b).width(),b=e(b).height());e(this).find(".BWFilter, canvas").css({width:a,
height:b})})};return this.init(d)}})})(jQuery); | prosenjit-itobuz/cdnjs | ajax/libs/jQuery.BlackAndWhite/0.2.6/jquery.BlackAndWhite.min.js | JavaScript | mit | 2,832 |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Descriptor;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputOption;
/**
* JSON descriptor.
*
* @author Jean-François Simon <contact@jfsimon.fr>
*/
class JsonDescriptor extends Descriptor
{
/**
* {@inheritdoc}
*/
protected function describeInputArgument(InputArgument $argument, array $options = array())
{
$this->writeData($this->getInputArgumentData($argument), $options);
}
/**
* {@inheritdoc}
*/
protected function describeInputOption(InputOption $option, array $options = array())
{
$this->writeData($this->getInputOptionData($option), $options);
}
/**
* {@inheritdoc}
*/
protected function describeInputDefinition(InputDefinition $definition, array $options = array())
{
$this->writeData($this->getInputDefinitionData($definition), $options);
}
/**
* {@inheritdoc}
*/
protected function describeCommand(Command $command, array $options = array())
{
$this->writeData($this->getCommandData($command), $options);
}
/**
* {@inheritdoc}
*/
protected function describeApplication(Application $application, array $options = array())
{
$describedNamespace = isset($options['namespace']) ? $options['namespace'] : null;
$description = new ApplicationDescription($application, $describedNamespace);
$commands = array();
foreach ($description->getCommands() as $command) {
$commands[] = $this->getCommandData($command);
}
$data = $describedNamespace
? array('commands' => $commands, 'namespace' => $describedNamespace)
: array('commands' => $commands, 'namespaces' => array_values($description->getNamespaces()));
$this->writeData($data, $options);
}
/**
* Writes data as json.
*
* @param array $data
* @param array $options
*
* @return array|string
*/
private function writeData(array $data, array $options)
{
$this->write(json_encode($data, isset($options['json_encoding']) ? $options['json_encoding'] : 0));
}
/**
* @param InputArgument $argument
*
* @return array
*/
private function getInputArgumentData(InputArgument $argument)
{
return array(
'name' => $argument->getName(),
'is_required' => $argument->isRequired(),
'is_array' => $argument->isArray(),
'description' => $argument->getDescription(),
'default' => $argument->getDefault(),
);
}
/**
* @param InputOption $option
*
* @return array
*/
private function getInputOptionData(InputOption $option)
{
return array(
'name' => '--'.$option->getName(),
'shortcut' => $option->getShortcut() ? '-'.implode('|-', explode('|', $option->getShortcut())) : '',
'accept_value' => $option->acceptValue(),
'is_value_required' => $option->isValueRequired(),
'is_multiple' => $option->isArray(),
'description' => $option->getDescription(),
'default' => $option->getDefault(),
);
}
/**
* @param InputDefinition $definition
*
* @return array
*/
private function getInputDefinitionData(InputDefinition $definition)
{
$inputArguments = array();
foreach ($definition->getArguments() as $name => $argument) {
$inputArguments[$name] = $this->getInputArgumentData($argument);
}
$inputOptions = array();
foreach ($definition->getOptions() as $name => $option) {
$inputOptions[$name] = $this->getInputOptionData($option);
}
return array('arguments' => $inputArguments, 'options' => $inputOptions);
}
/**
* @param Command $command
*
* @return array
*/
private function getCommandData(Command $command)
{
$command->getSynopsis();
$command->mergeApplicationDefinition(false);
return array(
'name' => $command->getName(),
'usage' => $command->getSynopsis(),
'description' => $command->getDescription(),
'help' => $command->getProcessedHelp(),
'aliases' => $command->getAliases(),
'definition' => $this->getInputDefinitionData($command->getNativeDefinition()),
);
}
}
| hctr666/intra-ism | vendor/symfony/console/Symfony/Component/Console/Descriptor/JsonDescriptor.php | PHP | mit | 4,893 |
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for dist/cjs/handlebars/compiler/</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../../../../prettify.css">
<style>
body, html {
margin:0; padding: 0;
}
body {
font-family: Helvetica Neue, Helvetica,Arial;
font-size: 10pt;
}
div.header, div.footer {
background: #eee;
padding: 1em;
}
div.header {
z-index: 100;
position: fixed;
top: 0;
border-bottom: 1px solid #666;
width: 100%;
}
div.footer {
border-top: 1px solid #666;
}
div.body {
margin-top: 10em;
}
div.meta {
font-size: 90%;
text-align: center;
}
h1, h2, h3 {
font-weight: normal;
}
h1 {
font-size: 12pt;
}
h2 {
font-size: 10pt;
}
pre {
font-family: Consolas, Menlo, Monaco, monospace;
margin: 0;
padding: 0;
line-height: 14px;
font-size: 14px;
-moz-tab-size: 2;
-o-tab-size: 2;
tab-size: 2;
}
div.path { font-size: 110%; }
div.path a:link, div.path a:visited { color: #000; }
table.coverage { border-collapse: collapse; margin:0; padding: 0 }
table.coverage td {
margin: 0;
padding: 0;
color: #111;
vertical-align: top;
}
table.coverage td.line-count {
width: 50px;
text-align: right;
padding-right: 5px;
}
table.coverage td.line-coverage {
color: #777 !important;
text-align: right;
border-left: 1px solid #666;
border-right: 1px solid #666;
}
table.coverage td.text {
}
table.coverage td span.cline-any {
display: inline-block;
padding: 0 5px;
width: 40px;
}
table.coverage td span.cline-neutral {
background: #eee;
}
table.coverage td span.cline-yes {
background: #b5d592;
color: #999;
}
table.coverage td span.cline-no {
background: #fc8c84;
}
.cstat-yes { color: #111; }
.cstat-no { background: #fc8c84; color: #111; }
.fstat-no { background: #ffc520; color: #111 !important; }
.cbranch-no { background: yellow !important; color: #111; }
.cstat-skip { background: #ddd; color: #111; }
.fstat-skip { background: #ddd; color: #111 !important; }
.cbranch-skip { background: #ddd !important; color: #111; }
.missing-if-branch {
display: inline-block;
margin-right: 10px;
position: relative;
padding: 0 4px;
background: black;
color: yellow;
}
.skip-if-branch {
display: none;
margin-right: 10px;
position: relative;
padding: 0 4px;
background: #ccc;
color: white;
}
.missing-if-branch .typ, .skip-if-branch .typ {
color: inherit !important;
}
.entity, .metric { font-weight: bold; }
.metric { display: inline-block; border: 1px solid #333; padding: 0.3em; background: white; }
.metric small { font-size: 80%; font-weight: normal; color: #666; }
div.coverage-summary table { border-collapse: collapse; margin: 3em; font-size: 110%; }
div.coverage-summary td, div.coverage-summary table th { margin: 0; padding: 0.25em 1em; border-top: 1px solid #666; border-bottom: 1px solid #666; }
div.coverage-summary th { text-align: left; border: 1px solid #666; background: #eee; font-weight: normal; }
div.coverage-summary th.file { border-right: none !important; }
div.coverage-summary th.pic { border-left: none !important; text-align: right; }
div.coverage-summary th.pct { border-right: none !important; }
div.coverage-summary th.abs { border-left: none !important; text-align: right; }
div.coverage-summary td.pct { text-align: right; border-left: 1px solid #666; }
div.coverage-summary td.abs { text-align: right; font-size: 90%; color: #444; border-right: 1px solid #666; }
div.coverage-summary td.file { text-align: right; border-left: 1px solid #666; white-space: nowrap; }
div.coverage-summary td.pic { min-width: 120px !important; }
div.coverage-summary a:link { text-decoration: none; color: #000; }
div.coverage-summary a:visited { text-decoration: none; color: #333; }
div.coverage-summary a:hover { text-decoration: underline; }
div.coverage-summary tfoot td { border-top: 1px solid #666; }
div.coverage-summary .yui3-datatable-sort-indicator, div.coverage-summary .dummy-sort-indicator {
height: 10px;
width: 7px;
display: inline-block;
margin-left: 0.5em;
}
div.coverage-summary .yui3-datatable-sort-indicator {
background: url("https://yui-s.yahooapis.com/3.6.0/build/datatable-sort/assets/skins/sam/sort-arrow-sprite.png") no-repeat scroll 0 0 transparent;
}
div.coverage-summary .yui3-datatable-sorted .yui3-datatable-sort-indicator {
background-position: 0 -20px;
}
div.coverage-summary .yui3-datatable-sorted-desc .yui3-datatable-sort-indicator {
background-position: 0 -10px;
}
.high { background: #b5d592 !important; }
.medium { background: #ffe87c !important; }
.low { background: #fc8c84 !important; }
span.cover-fill, span.cover-empty {
display:inline-block;
border:1px solid #444;
background: white;
height: 12px;
}
span.cover-fill {
background: #ccc;
border-right: 1px solid #444;
}
span.cover-empty {
background: white;
border-left: none;
}
span.cover-full {
border-right: none !important;
}
pre.prettyprint {
border: none !important;
padding: 0 !important;
margin: 0 !important;
}
.com { color: #999 !important; }
.ignore-none { color: #999; font-weight: normal; }
</style>
</head>
<body>
<div class="header high">
<h1>Code coverage report for <span class="entity">dist/cjs/handlebars/compiler/</span></h1>
<h2>
Statements: <span class="metric">99.84% <small>(1269 / 1271)</small></span>
Branches: <span class="metric">99.4% <small>(660 / 664)</small></span>
Functions: <span class="metric">100% <small>(164 / 164)</small></span>
Lines: <span class="metric">99.84% <small>(1229 / 1231)</small></span>
Ignored: <span class="metric">98 statements, 9 functions, 48 branches</span>
</h2>
<div class="path"><a href="../../../../index.html">All files</a> » dist/cjs/handlebars/compiler/</div>
</div>
<div class="body">
<div class="coverage-summary">
<table>
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="ast.js"><a href="ast.js.html">ast.js</a></td>
<td data-value="100" class="pic high"><span class="cover-fill cover-full" style="width: 100px;"></span><span class="cover-empty" style="width:0px;"></span></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="107" class="abs high">(107 / 107)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="36" class="abs high">(36 / 36)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="16" class="abs high">(16 / 16)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="107" class="abs high">(107 / 107)</td>
</tr>
<tr>
<td class="file high" data-value="base.js"><a href="base.js.html">base.js</a></td>
<td data-value="100" class="pic high"><span class="cover-fill cover-full" style="width: 100px;"></span><span class="cover-empty" style="width:0px;"></span></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="13" class="abs high">(13 / 13)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">(2 / 2)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">(1 / 1)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="12" class="abs high">(12 / 12)</td>
</tr>
<tr>
<td class="file high" data-value="compiler.js"><a href="compiler.js.html">compiler.js</a></td>
<td data-value="100" class="pic high"><span class="cover-fill cover-full" style="width: 100px;"></span><span class="cover-empty" style="width:0px;"></span></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="221" class="abs high">(221 / 221)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="117" class="abs high">(117 / 117)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="35" class="abs high">(35 / 35)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="215" class="abs high">(215 / 215)</td>
</tr>
<tr>
<td class="file high" data-value="helpers.js"><a href="helpers.js.html">helpers.js</a></td>
<td data-value="100" class="pic high"><span class="cover-fill cover-full" style="width: 100px;"></span><span class="cover-empty" style="width:0px;"></span></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="82" class="abs high">(82 / 82)</td>
<td data-value="98.92" class="pct high">98.92%</td>
<td data-value="93" class="abs high">(92 / 93)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="7" class="abs high">(7 / 7)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="81" class="abs high">(81 / 81)</td>
</tr>
<tr>
<td class="file high" data-value="javascript-compiler.js"><a href="javascript-compiler.js.html">javascript-compiler.js</a></td>
<td data-value="99.45" class="pic high"><span class="cover-fill" style="width: 99px;"></span><span class="cover-empty" style="width:1px;"></span></td>
<td data-value="99.45" class="pct high">99.45%</td>
<td data-value="364" class="abs high">(362 / 364)</td>
<td data-value="98.46" class="pct high">98.46%</td>
<td data-value="195" class="abs high">(192 / 195)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="59" class="abs high">(59 / 59)</td>
<td data-value="99.45" class="pct high">99.45%</td>
<td data-value="363" class="abs high">(361 / 363)</td>
</tr>
<tr>
<td class="file high" data-value="parser.js"><a href="parser.js.html">parser.js</a></td>
<td data-value="100" class="pic high"><span class="cover-fill cover-full" style="width: 100px;"></span><span class="cover-empty" style="width:0px;"></span></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="396" class="abs high">(396 / 396)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="205" class="abs high">(205 / 205)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="27" class="abs high">(27 / 27)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="369" class="abs high">(369 / 369)</td>
</tr>
<tr>
<td class="file high" data-value="printer.js"><a href="printer.js.html">printer.js</a></td>
<td data-value="100" class="pic high"><span class="cover-fill cover-full" style="width: 100px;"></span><span class="cover-empty" style="width:0px;"></span></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="84" class="abs high">(84 / 84)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="16" class="abs high">(16 / 16)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="17" class="abs high">(17 / 17)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="80" class="abs high">(80 / 80)</td>
</tr>
<tr>
<td class="file high" data-value="visitor.js"><a href="visitor.js.html">visitor.js</a></td>
<td data-value="100" class="pic high"><span class="cover-fill cover-full" style="width: 100px;"></span><span class="cover-empty" style="width:0px;"></span></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="4" class="abs high">(4 / 4)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">(0 / 0)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">(2 / 2)</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="4" class="abs high">(4 / 4)</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Mon Sep 01 2014 21:28:55 GMT-0500 (CDT)</div>
</div>
<script src="../../../../prettify.js"></script>
<script src="https://yui-s.yahooapis.com/3.6.0/build/yui/yui-min.js"></script>
<script>
YUI().use('datatable', function (Y) {
var formatters = {
pct: function (o) {
o.className += o.record.get('classes')[o.column.key];
try {
return o.value.toFixed(2) + '%';
} catch (ex) { return o.value + '%'; }
},
html: function (o) {
o.className += o.record.get('classes')[o.column.key];
return o.record.get(o.column.key + '_html');
}
},
defaultFormatter = function (o) {
o.className += o.record.get('classes')[o.column.key];
return o.value;
};
function getColumns(theadNode) {
var colNodes = theadNode.all('tr th'),
cols = [],
col;
colNodes.each(function (colNode) {
col = {
key: colNode.getAttribute('data-col'),
label: colNode.get('innerHTML') || ' ',
sortable: !colNode.getAttribute('data-nosort'),
className: colNode.getAttribute('class'),
type: colNode.getAttribute('data-type'),
allowHTML: colNode.getAttribute('data-html') === 'true' || colNode.getAttribute('data-fmt') === 'html'
};
col.formatter = formatters[colNode.getAttribute('data-fmt')] || defaultFormatter;
cols.push(col);
});
return cols;
}
function getRowData(trNode, cols) {
var tdNodes = trNode.all('td'),
i,
row = { classes: {} },
node,
name;
for (i = 0; i < cols.length; i += 1) {
name = cols[i].key;
node = tdNodes.item(i);
row[name] = node.getAttribute('data-value') || node.get('innerHTML');
row[name + '_html'] = node.get('innerHTML');
row.classes[name] = node.getAttribute('class');
//Y.log('Name: ' + name + '; Value: ' + row[name]);
if (cols[i].type === 'number') { row[name] = row[name] * 1; }
}
//Y.log(row);
return row;
}
function getData(tbodyNode, cols) {
var data = [];
tbodyNode.all('tr').each(function (trNode) {
data.push(getRowData(trNode, cols));
});
return data;
}
function replaceTable(node) {
if (!node) { return; }
var cols = getColumns(node.one('thead')),
data = getData(node.one('tbody'), cols),
table,
parent = node.get('parentNode');
table = new Y.DataTable({
columns: cols,
data: data,
sortBy: 'file'
});
parent.set('innerHTML', '');
table.render(parent);
}
Y.on('domready', function () {
replaceTable(Y.one('div.coverage-summary table'));
if (typeof prettyPrint === 'function') {
prettyPrint();
}
});
});
</script>
</body>
</html>
| MarioGranada/bitgrayCars | node_modules/bower/node_modules/handlebars/coverage/lcov-report/dist/cjs/handlebars/compiler/index.html | HTML | mit | 17,789 |
/*
* jQuery mmenu fixedElements addon
* mmenu.frebsite.nl
*
* Copyright (c) Fred Heusschen
*/
(function( $ ) {
var _PLUGIN_ = 'mmenu',
_ADDON_ = 'fixedElements';
$[ _PLUGIN_ ].prototype[ '_init_' + _ADDON_ ] = function( $panels )
{
if ( !this.opts.offCanvas )
{
return;
}
if ( !addon_initiated )
{
_initAddon();
}
var addon_added = this.vars[ _ADDON_ + '_added' ];
this.vars[ _ADDON_ + '_added' ] = true;
if ( !addon_added )
{
this.opts[ _ADDON_ ] = extendOptions( this.opts[ _ADDON_ ] );
this.conf[ _ADDON_ ] = extendConfiguration( this.conf[ _ADDON_ ] );
}
var that = this,
opts = this.opts[ _ADDON_ ],
conf = this.conf[ _ADDON_ ];
// Refactor fixed classes
this.__refactorClass( $('div, span, a', glbl.$page), this.conf.classNames[ _ADDON_ ].fixedTop, 'fixed-top' );
this.__refactorClass( $('div, span, a', glbl.$page), this.conf.classNames[ _ADDON_ ].fixedBottom, 'fixed-bottom' );
if ( addon_added )
{
return;
}
// Position the elements
var $tops, $bots;
this.$menu
.on( _e.opening,
function( e )
{
var _top = $(window).scrollTop(),
_bot = glbl.$page.height() - _top - glbl.$wndw.height();
$tops = $('.' + _c[ 'fixed-top' ]);
$bots = $('.' + _c[ 'fixed-bottom' ]);
$tops.css({
'-webkit-transform': 'translateY( ' + _top + 'px )',
'transform': 'translateY( ' + _top + 'px )'
});
$bots.css({
'-webkit-transform': 'translateY( -' + _bot + 'px )',
'transform': 'translateY( -' + _bot + 'px )'
});
}
)
.on( _e.closed,
function( e )
{
$tops.add( $bots ).css({
'-webkit-transform': 'none',
'transform': 'none'
});
}
);
};
// Add to plugin
$[ _PLUGIN_ ].addons.push( _ADDON_ );
// Defaults
$[ _PLUGIN_ ].defaults[ _ADDON_ ] = {};
$[ _PLUGIN_ ].configuration.classNames[ _ADDON_ ] = {
fixedTop : 'FixedTop',
fixedBottom : 'FixedBottom'
};
function extendOptions( o )
{
return o;
}
function extendConfiguration( c )
{
return c;
}
function _initAddon()
{
addon_initiated = true;
_c = $[ _PLUGIN_ ]._c;
_d = $[ _PLUGIN_ ]._d;
_e = $[ _PLUGIN_ ]._e;
_c.add( 'fixed-top fixed-bottom' );
glbl = $[ _PLUGIN_ ].glbl;
}
var _c, _d, _e, glbl,
addon_initiated = false;
})( jQuery ); | froala/cdnjs | ajax/libs/jQuery.mmenu/4.5.3/js/addons/jquery.mmenu.fixedelements.js | JavaScript | mit | 2,343 |
YUI.add('autocomplete-filters', function(Y) {
/**
* Provides pre-built result matching filters for AutoComplete.
*
* @module autocomplete
* @submodule autocomplete-filters
* @class AutoCompleteFilters
* @static
*/
var YArray = Y.Array,
YObject = Y.Object,
WordBreak = Y.Text.WordBreak,
Filters = Y.mix(Y.namespace('AutoCompleteFilters'), {
// -- Public Methods -------------------------------------------------------
/**
* Returns an array of results that contain all of the characters in the
* query, in any order (not necessarily consecutive). Case-insensitive.
*
* @method charMatch
* @param {String} query Query to match
* @param {Array} results Results to filter
* @return {Array} Filtered results
* @static
*/
charMatch: function (query, results, caseSensitive) {
// The caseSensitive parameter is only intended for use by
// charMatchCase(). It's intentionally undocumented.
if (!query) { return results; }
var queryChars = YArray.unique((caseSensitive ? query :
query.toLowerCase()).split(''));
return YArray.filter(results, function (result) {
result = result.text;
if (!caseSensitive) {
result = result.toLowerCase();
}
return YArray.every(queryChars, function (chr) {
return result.indexOf(chr) !== -1;
});
});
},
/**
* Case-sensitive version of <code>charMatch()</code>.
*
* @method charMatchCase
* @param {String} query Query to match
* @param {Array} results Results to filter
* @return {Array} Filtered results
* @static
*/
charMatchCase: function (query, results) {
return Filters.charMatch(query, results, true);
},
/**
* Returns an array of results that contain the complete query as a phrase.
* Case-insensitive.
*
* @method phraseMatch
* @param {String} query Query to match
* @param {Array} results Results to filter
* @return {Array} Filtered results
* @static
*/
phraseMatch: function (query, results, caseSensitive) {
// The caseSensitive parameter is only intended for use by
// phraseMatchCase(). It's intentionally undocumented.
if (!query) { return results; }
if (!caseSensitive) {
query = query.toLowerCase();
}
return YArray.filter(results, function (result) {
return (caseSensitive ? result.text : result.text.toLowerCase()).indexOf(query) !== -1;
});
},
/**
* Case-sensitive version of <code>phraseMatch()</code>.
*
* @method phraseMatchCase
* @param {String} query Query to match
* @param {Array} results Results to filter
* @return {Array} Filtered results
* @static
*/
phraseMatchCase: function (query, results) {
return Filters.phraseMatch(query, results, true);
},
/**
* Returns an array of results that start with the complete query as a
* phrase. Case-insensitive.
*
* @method startsWith
* @param {String} query Query to match
* @param {Array} results Results to filter
* @return {Array} Filtered results
* @static
*/
startsWith: function (query, results, caseSensitive) {
// The caseSensitive parameter is only intended for use by
// startsWithCase(). It's intentionally undocumented.
if (!query) { return results; }
if (!caseSensitive) {
query = query.toLowerCase();
}
return YArray.filter(results, function (result) {
return (caseSensitive ? result.text : result.text.toLowerCase()).indexOf(query) === 0;
});
},
/**
* Case-sensitive version of <code>startsWith()</code>.
*
* @method startsWithCase
* @param {String} query Query to match
* @param {Array} results Results to filter
* @return {Array} Filtered results
* @static
*/
startsWithCase: function (query, results) {
return Filters.startsWith(query, results, true);
},
/**
* Returns an array of results in which all the words of the query match
* either whole words or parts of words in the result. Non-word characters
* like whitespace and certain punctuation are ignored. Case-insensitive.
*
* This is basically a combination of <code>wordMatch()</code> (by ignoring
* whitespace and word order) and <code>phraseMatch()</code> (by allowing
* partial matching instead of requiring the entire word to match).
*
* Example use case: Trying to find personal names independently of name
* order (Western or Eastern order) and supporting immediate feedback by
* allowing partial occurences. So queries like "J. Doe", "Doe, John", and
* "J. D." would all match "John Doe".
*
* @method subWordMatch
* @param {String} query Query to match
* @param {Array} results Results to filter
* @return {Array} Filtered results
* @static
*/
subWordMatch: function (query, results, caseSensitive) {
// The caseSensitive parameter is only intended for use by
// subWordMatchCase(). It's intentionally undocumented.
if (!query) { return results; }
var queryWords = WordBreak.getUniqueWords(query, {
ignoreCase: !caseSensitive
});
return YArray.filter(results, function (result) {
var resultText = caseSensitive ? result.text :
result.text.toLowerCase();
return YArray.every(queryWords, function (queryWord) {
return resultText.indexOf(queryWord) !== -1;
});
});
},
/**
* Case-sensitive version of <code>subWordMatch()</code>.
*
* @method subWordMatchCase
* @param {String} query Query to match
* @param {Array} results Results to filter
* @return {Array} Filtered results
* @static
*/
subWordMatchCase: function (query, results) {
return Filters.subWordMatch(query, results, true);
},
/**
* Returns an array of results that contain all of the words in the query,
* in any order. Non-word characters like whitespace and certain punctuation
* are ignored. Case-insensitive.
*
* @method wordMatch
* @param {String} query Query to match
* @param {Array} results Results to filter
* @return {Array} Filtered results
* @static
*/
wordMatch: function (query, results, caseSensitive) {
// The caseSensitive parameter is only intended for use by
// wordMatchCase(). It's intentionally undocumented.
if (!query) { return results; }
var options = {ignoreCase: !caseSensitive},
queryWords = WordBreak.getUniqueWords(query, options);
return YArray.filter(results, function (result) {
// Convert resultWords array to a hash for fast lookup.
var resultWords = YArray.hash(WordBreak.getUniqueWords(result.text,
options));
return YArray.every(queryWords, function (word) {
return YObject.owns(resultWords, word);
});
});
},
/**
* Case-sensitive version of <code>wordMatch()</code>.
*
* @method wordMatchCase
* @param {String} query Query to match
* @param {Array} results Results to filter
* @return {Array} Filtered results
* @static
*/
wordMatchCase: function (query, results) {
return Filters.wordMatch(query, results, true);
}
});
}, '@VERSION@' ,{requires:['array-extras', 'text-wordbreak']});
| RizkyAdiSaputra/cdnjs | ajax/libs/yui/3.4.0/autocomplete-filters/autocomplete-filters.js | JavaScript | mit | 7,773 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"priek\u0161pusdien\u0101",
"p\u0113cpusdien\u0101"
],
"DAY": [
"sv\u0113tdiena",
"pirmdiena",
"otrdiena",
"tre\u0161diena",
"ceturtdiena",
"piektdiena",
"sestdiena"
],
"MONTH": [
"janv\u0101ris",
"febru\u0101ris",
"marts",
"apr\u012blis",
"maijs",
"j\u016bnijs",
"j\u016blijs",
"augusts",
"septembris",
"oktobris",
"novembris",
"decembris"
],
"SHORTDAY": [
"Sv",
"Pr",
"Ot",
"Tr",
"Ce",
"Pk",
"Se"
],
"SHORTMONTH": [
"janv.",
"febr.",
"marts",
"apr.",
"maijs",
"j\u016bn.",
"j\u016bl.",
"aug.",
"sept.",
"okt.",
"nov.",
"dec."
],
"fullDate": "EEEE, y. 'gada' d. MMMM",
"longDate": "y. 'gada' d. MMMM",
"medium": "y. 'gada' d. MMM HH:mm:ss",
"mediumDate": "y. 'gada' d. MMM",
"mediumTime": "HH:mm:ss",
"short": "dd.MM.yy HH:mm",
"shortDate": "dd.MM.yy",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "Ls",
"DECIMAL_SEP": ",",
"GROUP_SEP": "\u00a0",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(\u00a4",
"negSuf": ")",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "lv",
"pluralCat": function (n) { if (n == 0) { return PLURAL_CATEGORY.ZERO; } if (n % 10 == 1 && n % 100 != 11) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | mgoldsborough/cdnjs | ajax/libs/angular-i18n/1.2.24/angular-locale_lv.js | JavaScript | mit | 2,147 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"am",
"pm"
],
"DAY": [
"\u0b9e\u0bbe\u0baf\u0bbf\u0bb1\u0bc1",
"\u0ba4\u0bbf\u0b99\u0bcd\u0b95\u0bb3\u0bcd",
"\u0b9a\u0bc6\u0bb5\u0bcd\u0bb5\u0bbe\u0baf\u0bcd",
"\u0baa\u0bc1\u0ba4\u0ba9\u0bcd",
"\u0bb5\u0bbf\u0baf\u0bbe\u0bb4\u0ba9\u0bcd",
"\u0bb5\u0bc6\u0bb3\u0bcd\u0bb3\u0bbf",
"\u0b9a\u0ba9\u0bbf"
],
"MONTH": [
"\u0b9c\u0ba9\u0bb5\u0bb0\u0bbf",
"\u0baa\u0bbf\u0baa\u0bcd\u0bb0\u0bb5\u0bb0\u0bbf",
"\u0bae\u0bbe\u0bb0\u0bcd\u0b9a\u0bcd",
"\u0b8f\u0baa\u0bcd\u0bb0\u0bb2\u0bcd",
"\u0bae\u0bc7",
"\u0b9c\u0bc2\u0ba9\u0bcd",
"\u0b9c\u0bc2\u0bb2\u0bc8",
"\u0b86\u0b95\u0bb8\u0bcd\u0b9f\u0bcd",
"\u0b9a\u0bc6\u0baa\u0bcd\u0b9f\u0bae\u0bcd\u0baa\u0bb0\u0bcd",
"\u0b85\u0b95\u0bcd\u0b9f\u0bcb\u0baa\u0bb0\u0bcd",
"\u0ba8\u0bb5\u0bae\u0bcd\u0baa\u0bb0\u0bcd",
"\u0b9f\u0bbf\u0b9a\u0bae\u0bcd\u0baa\u0bb0\u0bcd"
],
"SHORTDAY": [
"\u0b9e\u0bbe",
"\u0ba4\u0bbf",
"\u0b9a\u0bc6",
"\u0baa\u0bc1",
"\u0bb5\u0bbf",
"\u0bb5\u0bc6",
"\u0b9a"
],
"SHORTMONTH": [
"\u0b9c\u0ba9.",
"\u0baa\u0bbf\u0baa\u0bcd.",
"\u0bae\u0bbe\u0bb0\u0bcd.",
"\u0b8f\u0baa\u0bcd.",
"\u0bae\u0bc7",
"\u0b9c\u0bc2\u0ba9\u0bcd",
"\u0b9c\u0bc2\u0bb2\u0bc8",
"\u0b86\u0b95.",
"\u0b9a\u0bc6\u0baa\u0bcd.",
"\u0b85\u0b95\u0bcd.",
"\u0ba8\u0bb5.",
"\u0b9f\u0bbf\u0b9a."
],
"fullDate": "EEEE, d MMMM, y",
"longDate": "d MMMM, y",
"medium": "d MMM, y h:mm:ss a",
"mediumDate": "d MMM, y",
"mediumTime": "h:mm:ss a",
"short": "d-M-yy h:mm a",
"shortDate": "d-M-yy",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20b9",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 2,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 2,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "\u00a4\u00a0-",
"negSuf": "",
"posPre": "\u00a4\u00a0",
"posSuf": ""
}
]
},
"id": "ta",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | sujonvidia/cdnjs | ajax/libs/angular-i18n/1.2.20/angular-locale_ta.js | JavaScript | mit | 2,752 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"AM",
"PM"
],
"DAY": [
"Sonto",
"Msombuluko",
"Lwesibili",
"Lwesithathu",
"uLwesine",
"Lwesihlanu",
"Mgqibelo"
],
"MONTH": [
"Januwari",
"Februwari",
"Mashi",
"Apreli",
"Meyi",
"Juni",
"Julayi",
"Agasti",
"Septhemba",
"Okthoba",
"Novemba",
"Disemba"
],
"SHORTDAY": [
"Son",
"Mso",
"Bil",
"Tha",
"Sin",
"Hla",
"Mgq"
],
"SHORTMONTH": [
"Jan",
"Feb",
"Mas",
"Apr",
"Mey",
"Jun",
"Jul",
"Aga",
"Sep",
"Okt",
"Nov",
"Dis"
],
"fullDate": "EEEE dd MMMM y",
"longDate": "d MMMM y",
"medium": "d MMM y h:mm:ss a",
"mediumDate": "d MMM y",
"mediumTime": "h:mm:ss a",
"short": "yyyy-MM-dd h:mm a",
"shortDate": "yyyy-MM-dd",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "R",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(\u00a4",
"negSuf": ")",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "zu",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | zhangbg/cdnjs | ajax/libs/angular.js/1.2.22/i18n/angular-locale_zu.js | JavaScript | mit | 1,931 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"AM",
"PM"
],
"DAY": [
"nedjelja",
"ponedjeljak",
"utorak",
"srijeda",
"\u010detvrtak",
"petak",
"subota"
],
"MONTH": [
"sije\u010dnja",
"velja\u010de",
"o\u017eujka",
"travnja",
"svibnja",
"lipnja",
"srpnja",
"kolovoza",
"rujna",
"listopada",
"studenoga",
"prosinca"
],
"SHORTDAY": [
"ned",
"pon",
"uto",
"sri",
"\u010det",
"pet",
"sub"
],
"SHORTMONTH": [
"sij",
"velj",
"o\u017eu",
"tra",
"svi",
"lip",
"srp",
"kol",
"ruj",
"lis",
"stu",
"pro"
],
"fullDate": "EEEE, d. MMMM y.",
"longDate": "d. MMMM y.",
"medium": "d. M. y. HH:mm:ss",
"mediumDate": "d. M. y.",
"mediumTime": "HH:mm:ss",
"short": "d.M.y. HH:mm",
"shortDate": "d.M.y.",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "kn",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "hr",
"pluralCat": function (n) { if (n % 10 == 1 && n % 100 != 11) { return PLURAL_CATEGORY.ONE; } if (n == (n | 0) && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) { return PLURAL_CATEGORY.FEW; } if (n % 10 == 0 || n == (n | 0) && n % 10 >= 5 && n % 10 <= 9 || n == (n | 0) && n % 100 >= 11 && n % 100 <= 14) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
});
}]); | jdh8/cdnjs | ajax/libs/angular.js/1.2.18/i18n/angular-locale_hr.js | JavaScript | mit | 2,256 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"\u043f\u0440\u0435 \u043f\u043e\u0434\u043d\u0435",
"\u043f\u043e\u043f\u043e\u0434\u043d\u0435"
],
"DAY": [
"\u043d\u0435\u0434\u0435\u0459\u0430",
"\u043f\u043e\u043d\u0435\u0434\u0435\u0459\u0430\u043a",
"\u0443\u0442\u043e\u0440\u0430\u043a",
"\u0441\u0440\u0435\u0434\u0430",
"\u0447\u0435\u0442\u0432\u0440\u0442\u0430\u043a",
"\u043f\u0435\u0442\u0430\u043a",
"\u0441\u0443\u0431\u043e\u0442\u0430"
],
"MONTH": [
"\u0458\u0430\u043d\u0443\u0430\u0440",
"\u0444\u0435\u0431\u0440\u0443\u0430\u0440",
"\u043c\u0430\u0440\u0442",
"\u0430\u043f\u0440\u0438\u043b",
"\u043c\u0430\u0458",
"\u0458\u0443\u043d",
"\u0458\u0443\u043b",
"\u0430\u0432\u0433\u0443\u0441\u0442",
"\u0441\u0435\u043f\u0442\u0435\u043c\u0431\u0430\u0440",
"\u043e\u043a\u0442\u043e\u0431\u0430\u0440",
"\u043d\u043e\u0432\u0435\u043c\u0431\u0430\u0440",
"\u0434\u0435\u0446\u0435\u043c\u0431\u0430\u0440"
],
"SHORTDAY": [
"\u043d\u0435\u0434",
"\u043f\u043e\u043d",
"\u0443\u0442\u043e",
"\u0441\u0440\u0435",
"\u0447\u0435\u0442",
"\u043f\u0435\u0442",
"\u0441\u0443\u0431"
],
"SHORTMONTH": [
"\u0458\u0430\u043d",
"\u0444\u0435\u0431",
"\u043c\u0430\u0440",
"\u0430\u043f\u0440",
"\u043c\u0430\u0458",
"\u0458\u0443\u043d",
"\u0458\u0443\u043b",
"\u0430\u0432\u0433",
"\u0441\u0435\u043f",
"\u043e\u043a\u0442",
"\u043d\u043e\u0432",
"\u0434\u0435\u0446"
],
"fullDate": "EEEE, dd. MMMM y.",
"longDate": "dd. MMMM y.",
"medium": "dd.MM.y. HH.mm.ss",
"mediumDate": "dd.MM.y.",
"mediumTime": "HH.mm.ss",
"short": "d.M.yy. HH.mm",
"shortDate": "d.M.yy.",
"shortTime": "HH.mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "din",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "sr",
"pluralCat": function (n) { if (n % 10 == 1 && n % 100 != 11) { return PLURAL_CATEGORY.ONE; } if (n == (n | 0) && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) { return PLURAL_CATEGORY.FEW; } if (n % 10 == 0 || n == (n | 0) && n % 10 >= 5 && n % 10 <= 9 || n == (n | 0) && n % 100 >= 11 && n % 100 <= 14) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
});
}]); | XVicarious/cdnjs | ajax/libs/angular.js/1.2.4/i18n/angular-locale_sr.js | JavaScript | mit | 3,149 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"asubuhi",
"alasiri"
],
"DAY": [
"Jumapili",
"Jumatatu",
"Jumanne",
"Jumatano",
"Alhamisi",
"Ijumaa",
"Jumamosi"
],
"MONTH": [
"Januari",
"Februari",
"Machi",
"Aprili",
"Mei",
"Juni",
"Julai",
"Agosti",
"Septemba",
"Oktoba",
"Novemba",
"Desemba"
],
"SHORTDAY": [
"J2",
"J3",
"J4",
"J5",
"Alh",
"Ij",
"J1"
],
"SHORTMONTH": [
"Jan",
"Feb",
"Mac",
"Apr",
"Mei",
"Jun",
"Jul",
"Ago",
"Sep",
"Okt",
"Nov",
"Des"
],
"fullDate": "EEEE, d MMMM y",
"longDate": "d MMMM y",
"medium": "d MMM y h:mm:ss a",
"mediumDate": "d MMM y",
"mediumTime": "h:mm:ss a",
"short": "dd/MM/yyyy h:mm a",
"shortDate": "dd/MM/yyyy",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "TSh",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(\u00a4",
"negSuf": ")",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "sw",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | SaravananRajaraman/cdnjs | ajax/libs/angular-i18n/1.2.12/angular-locale_sw.js | JavaScript | mit | 1,923 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"fm",
"em"
],
"DAY": [
"s\u00f6ndag",
"m\u00e5ndag",
"tisdag",
"onsdag",
"torsdag",
"fredag",
"l\u00f6rdag"
],
"MONTH": [
"januari",
"februari",
"mars",
"april",
"maj",
"juni",
"juli",
"augusti",
"september",
"oktober",
"november",
"december"
],
"SHORTDAY": [
"s\u00f6n",
"m\u00e5n",
"tis",
"ons",
"tors",
"fre",
"l\u00f6r"
],
"SHORTMONTH": [
"jan",
"feb",
"mar",
"apr",
"maj",
"jun",
"jul",
"aug",
"sep",
"okt",
"nov",
"dec"
],
"fullDate": "EEEE'en' 'den' d:'e' MMMM y",
"longDate": "d MMMM y",
"medium": "d MMM y HH:mm:ss",
"mediumDate": "d MMM y",
"mediumTime": "HH:mm:ss",
"short": "yyyy-MM-dd HH:mm",
"shortDate": "yyyy-MM-dd",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "kr",
"DECIMAL_SEP": ",",
"GROUP_SEP": "\u00a0",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "sv",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | linjunpop/cdnjs | ajax/libs/angular.js/1.2.11/i18n/angular-locale_sv.js | JavaScript | mit | 1,966 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"dopoludnia",
"popoludn\u00ed"
],
"DAY": [
"nede\u013ea",
"pondelok",
"utorok",
"streda",
"\u0161tvrtok",
"piatok",
"sobota"
],
"MONTH": [
"janu\u00e1ra",
"febru\u00e1ra",
"marca",
"apr\u00edla",
"m\u00e1ja",
"j\u00fana",
"j\u00fala",
"augusta",
"septembra",
"okt\u00f3bra",
"novembra",
"decembra"
],
"SHORTDAY": [
"ne",
"po",
"ut",
"st",
"\u0161t",
"pi",
"so"
],
"SHORTMONTH": [
"jan",
"feb",
"mar",
"apr",
"m\u00e1j",
"j\u00fan",
"j\u00fal",
"aug",
"sep",
"okt",
"nov",
"dec"
],
"fullDate": "EEEE, d. MMMM y",
"longDate": "d. MMMM y",
"medium": "d.M.yyyy H:mm:ss",
"mediumDate": "d.M.yyyy",
"mediumTime": "H:mm:ss",
"short": "d.M.yyyy H:mm",
"shortDate": "d.M.yyyy",
"shortTime": "H:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"DECIMAL_SEP": ",",
"GROUP_SEP": "\u00a0",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "sk",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } if (n == (n | 0) && n >= 2 && n <= 4) { return PLURAL_CATEGORY.FEW; } return PLURAL_CATEGORY.OTHER;}
});
}]); | dfernandez79/cdnjs | ajax/libs/angular-i18n/1.2.5/angular-locale_sk.js | JavaScript | mit | 2,079 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"dop.",
"odp."
],
"DAY": [
"ned\u011ble",
"pond\u011bl\u00ed",
"\u00fater\u00fd",
"st\u0159eda",
"\u010dtvrtek",
"p\u00e1tek",
"sobota"
],
"MONTH": [
"ledna",
"\u00fanora",
"b\u0159ezna",
"dubna",
"kv\u011btna",
"\u010dervna",
"\u010dervence",
"srpna",
"z\u00e1\u0159\u00ed",
"\u0159\u00edjna",
"listopadu",
"prosince"
],
"SHORTDAY": [
"ne",
"po",
"\u00fat",
"st",
"\u010dt",
"p\u00e1",
"so"
],
"SHORTMONTH": [
"Led",
"\u00dano",
"B\u0159e",
"Dub",
"Kv\u011b",
"\u010cer",
"\u010cvc",
"Srp",
"Z\u00e1\u0159",
"\u0158\u00edj",
"Lis",
"Pro"
],
"fullDate": "EEEE, d. MMMM y",
"longDate": "d. MMMM y",
"medium": "d. M. yyyy H:mm:ss",
"mediumDate": "d. M. yyyy",
"mediumTime": "H:mm:ss",
"short": "dd.MM.yy H:mm",
"shortDate": "dd.MM.yy",
"shortTime": "H:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "K\u010d",
"DECIMAL_SEP": ",",
"GROUP_SEP": "\u00a0",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "cs",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } if (n == (n | 0) && n >= 2 && n <= 4) { return PLURAL_CATEGORY.FEW; } return PLURAL_CATEGORY.OTHER;}
});
}]); | dhenson02/cdnjs | ajax/libs/angular.js/1.2.6/i18n/angular-locale_cs.js | JavaScript | mit | 2,145 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"AM",
"PM"
],
"DAY": [
"Pazar",
"Pazartesi",
"Sal\u0131",
"\u00c7ar\u015famba",
"Per\u015fembe",
"Cuma",
"Cumartesi"
],
"MONTH": [
"Ocak",
"\u015eubat",
"Mart",
"Nisan",
"May\u0131s",
"Haziran",
"Temmuz",
"A\u011fustos",
"Eyl\u00fcl",
"Ekim",
"Kas\u0131m",
"Aral\u0131k"
],
"SHORTDAY": [
"Paz",
"Pzt",
"Sal",
"\u00c7ar",
"Per",
"Cum",
"Cmt"
],
"SHORTMONTH": [
"Oca",
"\u015eub",
"Mar",
"Nis",
"May",
"Haz",
"Tem",
"A\u011fu",
"Eyl",
"Eki",
"Kas",
"Ara"
],
"fullDate": "d MMMM y EEEE",
"longDate": "d MMMM y",
"medium": "d MMM y HH:mm:ss",
"mediumDate": "d MMM y",
"mediumTime": "HH:mm:ss",
"short": "dd MM yyyy HH:mm",
"shortDate": "dd MM yyyy",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "TL",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(",
"negSuf": "\u00a0\u00a4)",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "tr",
"pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;}
});
}]); | abbychau/cdnjs | ajax/libs/angular.js/1.3.0-beta.4/i18n/angular-locale_tr.js | JavaScript | mit | 1,927 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"PG",
"PTG"
],
"DAY": [
"Ahad",
"Isnin",
"Selasa",
"Rabu",
"Khamis",
"Jumaat",
"Sabtu"
],
"MONTH": [
"Januari",
"Februari",
"Mac",
"April",
"Mei",
"Jun",
"Julai",
"Ogos",
"September",
"Oktober",
"November",
"Disember"
],
"SHORTDAY": [
"Ahd",
"Isn",
"Sel",
"Rab",
"Kha",
"Jum",
"Sab"
],
"SHORTMONTH": [
"Jan",
"Feb",
"Mac",
"Apr",
"Mei",
"Jun",
"Jul",
"Ogos",
"Sep",
"Okt",
"Nov",
"Dis"
],
"fullDate": "EEEE, d MMMM y",
"longDate": "d MMMM y",
"medium": "dd/MM/yyyy h:mm:ss a",
"mediumDate": "dd/MM/yyyy",
"mediumTime": "h:mm:ss a",
"short": "d/MM/yy h:mm a",
"shortDate": "d/MM/yy",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "RM",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(\u00a4",
"negSuf": ")",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "ms-my",
"pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;}
});
}]); | GaryChamberlain/cdnjs | ajax/libs/angular.js/1.3.0-beta.1/i18n/angular-locale_ms-my.js | JavaScript | mit | 1,856 |
<!doctype html>
<html>
<head>
<title>paper-radio-group</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<script src="../platform/platform.js"></script>
<link rel="import" href="paper-radio-group.html">
<link rel="import" href="../font-roboto/roboto.html">
<style shim-shadowdom>
body {
font-family: RobotoDraft, 'Helvetica Neue', Helvetica, Arial;
margin: 0;
padding: 24px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
-webkit-touch-callout: none;
}
section {
xpadding: 20px;
xbackground-color: #f0f0f0;
}
paper-radio-group.blue paper-radio-button::shadow #ink[checked] {
color: #4285f4;
}
paper-radio-group.blue paper-radio-button::shadow #onRadio {
background-color: #4285f4;
}
</style>
</head>
<body unresolved>
<section>
<h4>Keep Wi-Fi on during sleep</h4>
<paper-radio-group selected="2">
<paper-radio-button label="Always"></paper-radio-button><br>
<paper-radio-button label="Only when plugged in"></paper-radio-button><br>
<paper-radio-button label="Never"></paper-radio-button>
</paper-radio-group>
</section>
<br>
<section>
<h4>Wi-Fi frequency band</h4>
<paper-radio-group class="blue" selected="0">
<paper-radio-button label="Auto"></paper-radio-button><br>
<paper-radio-button label="5 GHz only"></paper-radio-button><br>
<paper-radio-button label="2.4 GHz only"></paper-radio-button>
</paper-radio-group>
</section>
</body>
</html>
| farrellm/Flow | bower_components/paper-radio-group/demo.html | HTML | mit | 1,871 |
/*!
* Bootstrap-select v1.9.4 (http://silviomoreto.github.io/bootstrap-select)
*
* Copyright 2013-2016 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/.bootstrap-select{width:220px\9}.bootstrap-select>.dropdown-toggle{width:100%;padding-right:25px;z-index:1}.bootstrap-select>select{position:absolute!important;bottom:0;left:50%;width:.11px!important;height:100%!important;padding:0!important;opacity:0!important;border:none}.bootstrap-select>select.mobile-device{top:0;left:0;display:block!important;width:100%!important;z-index:2}.error .bootstrap-select .dropdown-toggle,.has-error .bootstrap-select .dropdown-toggle{border-color:#b94a48}.bootstrap-select.fit-width{width:auto!important}.bootstrap-select:not([class*=col-]):not([class*=form-control]):not(.input-group-btn){width:220px}.bootstrap-select .dropdown-toggle:focus{outline:thin dotted #333!important;outline:5px auto -webkit-focus-ring-color!important;outline-offset:-2px}.bootstrap-select.form-control{margin-bottom:0;padding:0;border:none}.bootstrap-select.form-control:not([class*=col-]){width:100%}.bootstrap-select.form-control.input-group-btn{z-index:auto}.bootstrap-select.btn-group:not(.input-group-btn),.bootstrap-select.btn-group[class*=col-]{float:none;display:inline-block;margin-left:0}.bootstrap-select.btn-group.dropdown-menu-right,.bootstrap-select.btn-group[class*=col-].dropdown-menu-right,.row .bootstrap-select.btn-group[class*=col-].dropdown-menu-right{float:right}.form-group .bootstrap-select.btn-group,.form-horizontal .bootstrap-select.btn-group,.form-inline .bootstrap-select.btn-group{margin-bottom:0}.form-group-lg .bootstrap-select.btn-group.form-control,.form-group-sm .bootstrap-select.btn-group.form-control{padding:0}.form-inline .bootstrap-select.btn-group .form-control{width:100%}.bootstrap-select.btn-group.disabled,.bootstrap-select.btn-group>.disabled{cursor:not-allowed}.bootstrap-select.btn-group.disabled:focus,.bootstrap-select.btn-group>.disabled:focus{outline:0!important}.bootstrap-select.btn-group.bs-container{position:absolute}.bootstrap-select.btn-group.bs-container .dropdown-menu{z-index:1060}.bootstrap-select.btn-group .dropdown-toggle .filter-option{display:inline-block;overflow:hidden;width:100%;text-align:left}.bootstrap-select.btn-group .dropdown-toggle .caret{position:absolute;top:50%;right:12px;margin-top:-2px;vertical-align:middle}.bootstrap-select.btn-group[class*=col-] .dropdown-toggle{width:100%}.bootstrap-select.btn-group .dropdown-menu{min-width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bootstrap-select.btn-group .dropdown-menu.inner{position:static;float:none;border:0;padding:0;margin:0;border-radius:0;-webkit-box-shadow:none;box-shadow:none}.bootstrap-select.btn-group .dropdown-menu li{position:relative}.bootstrap-select.btn-group .dropdown-menu li.active small{color:#fff}.bootstrap-select.btn-group .dropdown-menu li.disabled a{cursor:not-allowed}.bootstrap-select.btn-group .dropdown-menu li a{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.bootstrap-select.btn-group .dropdown-menu li a.opt{position:relative;padding-left:2.25em}.bootstrap-select.btn-group .dropdown-menu li a span.check-mark{display:none}.bootstrap-select.btn-group .dropdown-menu li a span.text{display:inline-block}.bootstrap-select.btn-group .dropdown-menu li small{padding-left:.5em}.bootstrap-select.btn-group .dropdown-menu .notify{position:absolute;bottom:5px;width:96%;margin:0 2%;min-height:26px;padding:3px 5px;background:#f5f5f5;border:1px solid #e3e3e3;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05);pointer-events:none;opacity:.9;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bootstrap-select.btn-group .no-results{padding:3px;background:#f5f5f5;margin:0 5px;white-space:nowrap}.bootstrap-select.btn-group.fit-width .dropdown-toggle .filter-option{position:static}.bootstrap-select.btn-group.fit-width .dropdown-toggle .caret{position:static;top:auto;margin-top:-1px}.bootstrap-select.btn-group.show-tick .dropdown-menu li.selected a span.check-mark{position:absolute;display:inline-block;right:15px;margin-top:5px}.bootstrap-select.btn-group.show-tick .dropdown-menu li a span.text{margin-right:34px}.bootstrap-select.show-menu-arrow.open>.dropdown-toggle{z-index:1061}.bootstrap-select.show-menu-arrow .dropdown-toggle:before{content:'';border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid rgba(204,204,204,.2);position:absolute;bottom:-4px;left:9px;display:none}.bootstrap-select.show-menu-arrow .dropdown-toggle:after{content:'';border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute;bottom:-4px;left:10px;display:none}.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:before{bottom:auto;top:-3px;border-top:7px solid rgba(204,204,204,.2);border-bottom:0}.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:after{bottom:auto;top:-3px;border-top:6px solid #fff;border-bottom:0}.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:before{right:12px;left:auto}.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:after{right:13px;left:auto}.bootstrap-select.show-menu-arrow.open>.dropdown-toggle:after,.bootstrap-select.show-menu-arrow.open>.dropdown-toggle:before{display:block}.bs-actionsbox,.bs-donebutton,.bs-searchbox{padding:4px 8px}.bs-actionsbox{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bs-actionsbox .btn-group button{width:50%}.bs-donebutton{float:left;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bs-donebutton .btn-group button{width:100%}.bs-searchbox+.bs-actionsbox{padding:0 8px 4px}.bs-searchbox .form-control{margin-bottom:0;width:100%;float:none} | sufuf3/cdnjs | ajax/libs/bootstrap-select/1.9.4/css/bootstrap-select.min.css | CSS | mit | 5,974 |
require_relative "../../../base"
require Vagrant.source_root.join("plugins/provisioners/file/config")
describe VagrantPlugins::FileUpload::Config do
include_context "unit"
subject { described_class.new }
let(:env) do
iso_env = isolated_environment
iso_env.vagrantfile("")
iso_env.create_vagrant_env
end
let(:machine) { double("machine", env: env) }
describe "#validate" do
it "returns an error if destination is not specified" do
existing_file = File.expand_path(__FILE__)
subject.source = existing_file
subject.finalize!
result = subject.validate(machine)
expect(result["File provisioner"]).to eql([
I18n.t("vagrant.provisioners.file.no_dest_file")
])
end
it "returns an error if source is not specified" do
subject.destination = "/tmp/foo"
subject.finalize!
result = subject.validate(machine)
expect(result["File provisioner"]).to eql([
I18n.t("vagrant.provisioners.file.no_source_file")
])
end
it "returns an error if source file does not exist" do
non_existing_file = "/this/does/not/exist"
subject.source = non_existing_file
subject.destination = "/tmp/foo"
subject.finalize!
result = subject.validate(machine)
expect(result["File provisioner"]).to eql([
I18n.t("vagrant.provisioners.file.path_invalid",
path: File.expand_path(non_existing_file))
])
end
it "passes with absolute source path" do
existing_absolute_path = File.expand_path(__FILE__)
subject.source = existing_absolute_path
subject.destination = "/tmp/foo"
subject.finalize!
result = subject.validate(machine)
expect(result["File provisioner"]).to eql([])
end
it "passes with relative source path" do
path = env.root_path.join("foo")
path.open("w+") { |f| f.write("hello") }
existing_relative_path = "foo"
subject.source = existing_relative_path
subject.destination = "/tmp/foo"
subject.finalize!
result = subject.validate(machine)
expect(result["File provisioner"]).to eql([])
end
end
end
| TheBigBear/vagrant | test/unit/plugins/provisioners/file/config_test.rb | Ruby | mit | 2,175 |
/* eslint-disable global-require */
const express = require('express');
const path = require('path');
const compression = require('compression');
const pkg = require(path.resolve(process.cwd(), 'package.json'));
// Dev middleware
const addDevMiddlewares = (app, webpackConfig) => {
const webpack = require('webpack');
const webpackDevMiddleware = require('webpack-dev-middleware');
const webpackHotMiddleware = require('webpack-hot-middleware');
const compiler = webpack(webpackConfig);
const middleware = webpackDevMiddleware(compiler, {
noInfo: true,
publicPath: webpackConfig.output.publicPath,
silent: true,
stats: 'errors-only',
});
app.use(middleware);
app.use(webpackHotMiddleware(compiler));
// Since webpackDevMiddleware uses memory-fs internally to store build
// artifacts, we use it instead
const fs = middleware.fileSystem;
if (pkg.dllPlugin) {
app.get(/\.dll\.js$/, (req, res) => {
const filename = req.path.replace(/^\//, '');
res.sendFile(path.join(process.cwd(), pkg.dllPlugin.path, filename));
});
}
app.get('*', (req, res) => {
fs.readFile(path.join(compiler.outputPath, 'index.html'), (err, file) => {
if (err) {
res.sendStatus(404);
} else {
res.send(file.toString());
}
});
});
};
// Production middlewares
const addProdMiddlewares = (app, options) => {
const publicPath = options.publicPath || '/';
const outputPath = options.outputPath || path.resolve(process.cwd(), 'build');
// compression middleware compresses your server responses which makes them
// smaller (applies also to assets). You can read more about that technique
// and other good practices on official Express.js docs http://mxs.is/googmy
app.use(compression());
app.use(publicPath, express.static(outputPath));
app.get('*', (req, res) => res.sendFile(path.resolve(outputPath, 'index.html')));
};
/**
* Front-end middleware
*/
module.exports = (app, options) => {
const isProd = process.env.NODE_ENV === 'production';
if (isProd) {
addProdMiddlewares(app, options);
} else {
const webpackConfig = require('../../internals/webpack/webpack.dev.babel');
addDevMiddlewares(app, webpackConfig);
}
return app;
};
| Allov/scorekeepr | server/middlewares/frontendMiddleware.js | JavaScript | mit | 2,257 |
/*! Popcorn Player for jPlayer 2.9.0 ~ (c) 2009-2014 Happyworm Ltd ~ MIT License */
!function(a){var b="//code.jquery.com/jquery-1.11.1.min.js",c="//code.jplayer.org/2.9.0/jplayer/jquery.jplayer.min.js",d="//code.jplayer.org/2.9.0/jplayer/jquery.jplayer.swf",e="html,flash",f=!1,g=!1,h=!1,i={mp3:{codec:"audio/mpeg",flashCanPlay:!0,media:"audio"},m4a:{codec:'audio/mp4; codecs="mp4a.40.2"',flashCanPlay:!0,media:"audio"},m3u8a:{codec:'application/vnd.apple.mpegurl; codecs="mp4a.40.2"',flashCanPlay:!1,media:"audio"},m3ua:{codec:"audio/mpegurl",flashCanPlay:!1,media:"audio"},oga:{codec:'audio/ogg; codecs="vorbis, opus"',flashCanPlay:!1,media:"audio"},flac:{codec:"audio/x-flac",flashCanPlay:!1,media:"audio"},wav:{codec:'audio/wav; codecs="1"',flashCanPlay:!1,media:"audio"},webma:{codec:'audio/webm; codecs="vorbis"',flashCanPlay:!1,media:"audio"},fla:{codec:"audio/x-flv",flashCanPlay:!0,media:"audio"},rtmpa:{codec:'audio/rtmp; codecs="rtmp"',flashCanPlay:!0,media:"audio"},m4v:{codec:'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:!0,media:"video"},m3u8v:{codec:'application/vnd.apple.mpegurl; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:!1,media:"video"},m3uv:{codec:"audio/mpegurl",flashCanPlay:!1,media:"video"},ogv:{codec:'video/ogg; codecs="theora, vorbis"',flashCanPlay:!1,media:"video"},webmv:{codec:'video/webm; codecs="vorbis, vp8"',flashCanPlay:!1,media:"video"},flv:{codec:"video/x-flv",flashCanPlay:!0,media:"video"},rtmpv:{codec:'video/rtmp; codecs="rtmp"',flashCanPlay:!0,media:"video"}},j=function(a){return a&&"object"==typeof a&&a.hasOwnProperty?!0:!1},k=function(a){var b=!1;return/\.mp3$/i.test(a)?b="mp3":/\.mp4$/i.test(a)||/\.m4v$/i.test(a)?b="m4v":/\.m4a$/i.test(a)?b="m4a":/\.ogg$/i.test(a)||/\.oga$/i.test(a)?b="oga":/\.ogv$/i.test(a)?b="ogv":/\.webm$/i.test(a)&&(b="webmv"),b},l=function(a){var b="",c="";if(j(a))for(var d in a)a.hasOwnProperty(d)&&(b+=c+d,c=",");return f&&console.log('getSupplied(): Generated: supplied = "'+b+'"'),b};a.player("jplayer",{_canPlayType:function(a,b){var c,d=a.toLowerCase(),f={media:{},options:{}},g=!1;if("video"!==d&&"audio"!==d&&("string"==typeof b?/^http.*/i.test(b)&&(c=k(b),c&&(f.media[c]=b,f.options.solution=e,f.options.supplied=c)):f=b,j(f)&&j(f.media))){j(f.options)||(f.options={}),f.options.solution||(f.options.solution=e),f.options.supplied||(f.options.supplied=l(f.media));for(var h=f.options.solution.toLowerCase().split(","),m=f.options.supplied.toLowerCase().split(","),n=0;n<h.length;n++)for(var o,p=h[n].replace(/^\s+|\s+$/g,""),q="html"===p,r="flash"===p,s=0;s<m.length;s++)if(c=m[s].replace(/^\s+|\s+$/g,""),i[c]){!o&&q&&(o=document.createElement(i[c].media));var t=!!(o&&o.canPlayType&&o.canPlayType(i[c].codec)),u=t&&q,v=i[c].flashCanPlay&&r;(u||v)&&(g={html:u,type:c},n=h.length,s=m.length)}}return g},_setup:function(){var i,m,n=this,o="unknown",p={},q={},r=!1,s=0,t=null,u=!1,v=null,w=function(){r?(f&&console.log("Dispatched event : durationchange : "+s),n.dispatchEvent("durationchange")):(f&&console.log("DELAYED EVENT (!ready) : durationchange : "+s),clearTimeout(t),t=setTimeout(w,250))},x=function(){var a=function(a){a.jPlayer.status.duration!==s&&(s=a.jPlayer.status.duration,w())},b=function(a){u||100!==a.jPlayer.status.seekPercent||(u=!0,setTimeout(function(){f&&console.log("Trigger : canplaythrough"),m._trigger($.jPlayer.event.canplaythrough)},0))};i.bind($.jPlayer.event.loadstart,function(){setTimeout(function(){f&&console.log("Trigger : loadeddata"),m._trigger($.jPlayer.event.loadeddata)},0)}).bind($.jPlayer.event.progress,function(c){a(c),b(c)}).bind($.jPlayer.event.timeupdate,function(c){a(c),b(c)}).bind($.jPlayer.event.play,function(){setTimeout(function(){f&&console.log("Trigger : playing"),m._trigger($.jPlayer.event.playing)},0)}),f&&console.log("Created CUSTOM event handlers for FLASH")},y=function(){!function(b){i=b("#"+n.id),"string"==typeof n.src?(o=k(n.src),p[o]=n.src,q.supplied=o,q.solution=e):j(n.src)&&(p=j(n.src.media)?n.src.media:{},q=j(n.src.options)?n.src.options:{},q.solution=q.solution||e,q.supplied=q.supplied||l(n.src.media)),q.swfPath=q.swfPath||d,i.bind(b.jPlayer.event.ready,function(a){a.jPlayer.flash.used&&x(),b(this).jPlayer("setMedia",p).jPlayer("load")});var c=b.jPlayer.reservedEvent+" loadeddata durationchange",g=c.split(/\s+/g),h=function(a){i.bind(b.jPlayer.event[a],function(b){f&&console.log("Dispatched event: "+a+(b&&b.jPlayer?" ("+b.jPlayer.status.currentTime+"s)":"")),n.dispatchEvent(a)}),f&&console.log("Created event handler for: "+a)};for(var t in b.jPlayer.event)if(b.jPlayer.event.hasOwnProperty(t)){var u=!0;for(var y in g)if(g.hasOwnProperty(y)&&g[y]===t){u=!1;break}u?h(t):f&&console.log("Skipped auto event handler creation for: "+t)}i.bind(b.jPlayer.event.loadeddata,function(a){f&&console.log("Dispatched event: loadeddata"+(a&&a.jPlayer?" ("+a.jPlayer.status.currentTime+"s)":"")),n.dispatchEvent("loadeddata"),r=!0}),f&&console.log("Created CUSTOM event handler for: loadeddata"),i.bind(b.jPlayer.event.durationchange,function(a){s=a.jPlayer.status.duration,w()}),f&&console.log("Created CUSTOM event handler for: durationchange"),i.bind(b.jPlayer.event.error,function(a){v=a.jPlayer.error,v.code=v.type===b.jPlayer.error.URL?4:0,f&&console.log("Dispatched event: error"),f&&console.dir(v),n.dispatchEvent("error")}),f&&console.log("Created CUSTOM event handler for: error"),a.player.defineProperty(n,"error",{set:function(){return v},get:function(){return v}}),a.player.defineProperty(n,"currentTime",{set:function(a){return m.status.paused?i.jPlayer("pause",a):i.jPlayer("play",a),a},get:function(){return m.status.currentTime}}),a.player.defineProperty(n,"duration",{set:function(){return r?s:0/0},get:function(){return r?s:0/0}}),a.player.defineProperty(n,"muted",{set:function(a){return i.jPlayer("mute",a),m.options.muted},get:function(){return m.options.muted}}),a.player.defineProperty(n,"volume",{set:function(a){return i.jPlayer("volume",a),m.options.volume},get:function(){return m.options.volume}}),a.player.defineProperty(n,"paused",{set:function(){return m.status.paused},get:function(){return m.status.paused}}),n.play=function(){i.jPlayer("play")},n.pause=function(){i.jPlayer("pause")},i.jPlayer(q),m=i.data("jPlayer")}(jQuery)},z=function(){jQuery.jPlayer?y():h?setTimeout(z,250):(h=!0,a.getScript(c,function(){h=!1,y()}))},A=function(){window.jQuery?z():g?setTimeout(A,250):(g=!0,a.getScript(b,function(){g=!1,z()}))};A()},_teardown:function(){jQuery("#"+this.id).jPlayer("destroy")}})}(Popcorn); | mgoldsborough/cdnjs | ajax/libs/jplayer/2.9.0/popcorn/popcorn.jplayer.min.js | JavaScript | mit | 6,503 |
/**
* bootbox.js v2.3.1
*
* The MIT License
*
* Copyright (C) 2011-2012 by Nick Payne <nick@kurai.co.uk>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE
*/
var bootbox=window.bootbox||function(){function j(b,a){null==a&&(a=k);return"string"==typeof h[a][b]?h[a][b]:a!=l?j(b,l):b}var k="en",l="en",o=!0,g={},f={},h={en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"OK"},fr:{OK:"OK",CANCEL:"Annuler",CONFIRM:"D'accord"},de:{OK:"OK",CANCEL:"Abbrechen",CONFIRM:"Akzeptieren"},es:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Aceptar"},br:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Sim"},nl:{OK:"OK",CANCEL:"Annuleren",CONFIRM:"Accepteren"},ru:{OK:"OK",CANCEL:"\u041e\u0442\u043c\u0435\u043d\u0430",
CONFIRM:"\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c"}};f.setLocale=function(b){for(var a in h)if(a==b){k=b;return}throw Error("Invalid locale: "+b);};f.addLocale=function(b,a){"undefined"==typeof h[b]&&(h[b]={});for(var c in a)h[b][c]=a[c]};f.setIcons=function(b){g=b;if("object"!==typeof g||null==g)g={}};f.alert=function(){var b="",a=j("OK"),c=null;switch(arguments.length){case 1:b=arguments[0];break;case 2:b=arguments[0];"function"==typeof arguments[1]?c=arguments[1]:a=arguments[1];break;
case 3:b=arguments[0];a=arguments[1];c=arguments[2];break;default:throw Error("Incorrect number of arguments: expected 1-3");}return f.dialog(b,{label:a,icon:g.OK,callback:c},{onEscape:c})};f.confirm=function(){var b="",a=j("CANCEL"),c=j("CONFIRM"),e=null;switch(arguments.length){case 1:b=arguments[0];break;case 2:b=arguments[0];"function"==typeof arguments[1]?e=arguments[1]:a=arguments[1];break;case 3:b=arguments[0];a=arguments[1];"function"==typeof arguments[2]?e=arguments[2]:c=arguments[2];break;
case 4:b=arguments[0];a=arguments[1];c=arguments[2];e=arguments[3];break;default:throw Error("Incorrect number of arguments: expected 1-4");}return f.dialog(b,[{label:a,icon:g.CANCEL,callback:function(){"function"==typeof e&&e(!1)}},{label:c,icon:g.CONFIRM,callback:function(){"function"==typeof e&&e(!0)}}])};f.prompt=function(){var b="",a=j("CANCEL"),c=j("CONFIRM"),e=null;switch(arguments.length){case 1:b=arguments[0];break;case 2:b=arguments[0];"function"==typeof arguments[1]?e=arguments[1]:a=arguments[1];
break;case 3:b=arguments[0];a=arguments[1];"function"==typeof arguments[2]?e=arguments[2]:c=arguments[2];break;case 4:b=arguments[0];a=arguments[1];c=arguments[2];e=arguments[3];break;default:throw Error("Incorrect number of arguments: expected 1-4");}var m=$("<form></form>");m.append("<input autocomplete=off type=text />");var h=f.dialog(m,[{label:a,icon:g.CANCEL,callback:function(){"function"==typeof e&&e(null)}},{label:c,icon:g.CONFIRM,callback:function(){"function"==typeof e&&e(m.find("input[type=text]").val())}}],
{header:b});h.on("shown",function(){m.find("input[type=text]").focus();m.on("submit",function(a){a.preventDefault();h.find(".btn-primary").click()})});return h};f.modal=function(){var b,a,c,e={onEscape:null,keyboard:!0,backdrop:!0};switch(arguments.length){case 1:b=arguments[0];break;case 2:b=arguments[0];"object"==typeof arguments[1]?c=arguments[1]:a=arguments[1];break;case 3:b=arguments[0];a=arguments[1];c=arguments[2];break;default:throw Error("Incorrect number of arguments: expected 1-3");}e.header=
a;c="object"==typeof c?$.extend(e,c):e;return f.dialog(b,[],c)};f.dialog=function(b,a,c){var e=null,f="",h=[],c=c||{};null==a?a=[]:"undefined"==typeof a.length&&(a=[a]);for(var d=a.length;d--;){var g=null,j=null,k="",l=null;if("undefined"==typeof a[d].label&&"undefined"==typeof a[d]["class"]&&"undefined"==typeof a[d].callback){var g=0,p=null,n;for(n in a[d])if(p=n,1<++g)break;1==g&&"function"==typeof a[d][n]&&(a[d].label=p,a[d].callback=a[d][n])}"function"==typeof a[d].callback&&(l=a[d].callback);
a[d]["class"]?j=a[d]["class"]:d==a.length-1&&2>=a.length&&(j="btn-primary");g=a[d].label?a[d].label:"Option "+(d+1);a[d].icon&&(k="<i class='"+a[d].icon+"'></i> ");f+="<a data-handler='"+d+"' class='btn "+j+"' href='#'>"+k+""+g+"</a>";h[d]=l}a=["<div class='bootbox modal'>"];if(c.header){d="";if("undefined"==typeof c.headerCloseButton||c.headerCloseButton)d="<a href='#' class='close'>×</a>";a.push("<div class='modal-header'>"+d+"<h3>"+c.header+"</h3></div>")}a.push("<div class='modal-body'></div>");
f&&a.push("<div class='modal-footer'>"+f+"</div>");a.push("</div>");var i=$(a.join("\n"));("undefined"===typeof c.animate?o:c.animate)&&i.addClass("fade");$(".modal-body",i).html(b);i.bind("hidden",function(){i.remove()});i.bind("hide",function(){if("escape"==e&&"function"==typeof c.onEscape)c.onEscape()});$(document).bind("keyup.modal",function(a){27==a.which&&(e="escape")});i.bind("shown",function(){$("a.btn-primary:last",i).focus()});i.on("click",".modal-footer a, a.close",function(a){var b=$(this).data("handler"),
b=h[b],c=null;"function"==typeof b&&(c=b());!1!==c&&(a.preventDefault(),e="button",i.modal("hide"))});null==c.keyboard&&(c.keyboard="function"==typeof c.onEscape);$("body").append(i);i.modal({backdrop:c.backdrop||!0,keyboard:c.keyboard});return i};f.hideAll=function(){$(".bootbox").modal("hide")};f.animate=function(b){o=b};return f}();
| gogoleva/cdnjs | ajax/libs/bootbox.js/2.3.1/bootbox.min.js | JavaScript | mit | 6,133 |
<?php
namespace GuzzleHttp\Psr7;
use Psr\Http\Message\MessageInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\StreamInterface;
use Psr\Http\Message\UriInterface;
/**
* Returns the string representation of an HTTP message.
*
* @param MessageInterface $message Message to convert to a string.
*
* @return string
*/
function str(MessageInterface $message)
{
if ($message instanceof RequestInterface) {
$msg = trim($message->getMethod() . ' '
. $message->getRequestTarget())
. ' HTTP/' . $message->getProtocolVersion();
if (!$message->hasHeader('host')) {
$msg .= "\r\nHost: " . $message->getUri()->getHost();
}
} elseif ($message instanceof ResponseInterface) {
$msg = 'HTTP/' . $message->getProtocolVersion() . ' '
. $message->getStatusCode() . ' '
. $message->getReasonPhrase();
} else {
throw new \InvalidArgumentException('Unknown message type');
}
foreach ($message->getHeaders() as $name => $values) {
$msg .= "\r\n{$name}: " . implode(', ', $values);
}
return "{$msg}\r\n\r\n" . $message->getBody();
}
/**
* Returns a UriInterface for the given value.
*
* This function accepts a string or {@see Psr\Http\Message\UriInterface} and
* returns a UriInterface for the given value. If the value is already a
* `UriInterface`, it is returned as-is.
*
* @param string|UriInterface $uri
*
* @return UriInterface
* @throws \InvalidArgumentException
*/
function uri_for($uri)
{
if ($uri instanceof UriInterface) {
return $uri;
} elseif (is_string($uri)) {
return new Uri($uri);
}
throw new \InvalidArgumentException('URI must be a string or UriInterface');
}
/**
* Create a new stream based on the input type.
*
* Options is an associative array that can contain the following keys:
* - metadata: Array of custom metadata.
* - size: Size of the stream.
*
* @param resource|string|null|int|float|bool|StreamInterface|callable $resource Entity body data
* @param array $options Additional options
*
* @return Stream
* @throws \InvalidArgumentException if the $resource arg is not valid.
*/
function stream_for($resource = '', array $options = [])
{
if (is_scalar($resource)) {
$stream = fopen('php://temp', 'r+');
if ($resource !== '') {
fwrite($stream, $resource);
fseek($stream, 0);
}
return new Stream($stream, $options);
}
switch (gettype($resource)) {
case 'resource':
return new Stream($resource, $options);
case 'object':
if ($resource instanceof StreamInterface) {
return $resource;
} elseif ($resource instanceof \Iterator) {
return new PumpStream(function () use ($resource) {
if (!$resource->valid()) {
return false;
}
$result = $resource->current();
$resource->next();
return $result;
}, $options);
} elseif (method_exists($resource, '__toString')) {
return stream_for((string) $resource, $options);
}
break;
case 'NULL':
return new Stream(fopen('php://temp', 'r+'), $options);
}
if (is_callable($resource)) {
return new PumpStream($resource, $options);
}
throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource));
}
/**
* Parse an array of header values containing ";" separated data into an
* array of associative arrays representing the header key value pair
* data of the header. When a parameter does not contain a value, but just
* contains a key, this function will inject a key with a '' string value.
*
* @param string|array $header Header to parse into components.
*
* @return array Returns the parsed header values.
*/
function parse_header($header)
{
static $trimmed = "\"' \n\t\r";
$params = $matches = [];
foreach (normalize_header($header) as $val) {
$part = [];
foreach (preg_split('/;(?=([^"]*"[^"]*")*[^"]*$)/', $val) as $kvp) {
if (preg_match_all('/<[^>]+>|[^=]+/', $kvp, $matches)) {
$m = $matches[0];
if (isset($m[1])) {
$part[trim($m[0], $trimmed)] = trim($m[1], $trimmed);
} else {
$part[] = trim($m[0], $trimmed);
}
}
}
if ($part) {
$params[] = $part;
}
}
return $params;
}
/**
* Converts an array of header values that may contain comma separated
* headers into an array of headers with no comma separated values.
*
* @param string|array $header Header to normalize.
*
* @return array Returns the normalized header field values.
*/
function normalize_header($header)
{
if (!is_array($header)) {
return array_map('trim', explode(',', $header));
}
$result = [];
foreach ($header as $value) {
foreach ((array) $value as $v) {
if (strpos($v, ',') === false) {
$result[] = $v;
continue;
}
foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $v) as $vv) {
$result[] = trim($vv);
}
}
}
return $result;
}
/**
* Clone and modify a request with the given changes.
*
* The changes can be one of:
* - method: (string) Changes the HTTP method.
* - set_headers: (array) Sets the given headers.
* - remove_headers: (array) Remove the given headers.
* - body: (mixed) Sets the given body.
* - uri: (UriInterface) Set the URI.
* - query: (string) Set the query string value of the URI.
* - version: (string) Set the protocol version.
*
* @param RequestInterface $request Request to clone and modify.
* @param array $changes Changes to apply.
*
* @return RequestInterface
*/
function modify_request(RequestInterface $request, array $changes)
{
if (!$changes) {
return $request;
}
$headers = $request->getHeaders();
if (!isset($changes['uri'])) {
$uri = $request->getUri();
} else {
// Remove the host header if one is on the URI
if ($host = $changes['uri']->getHost()) {
$changes['set_headers']['Host'] = $host;
if ($port = $changes['uri']->getPort()) {
$standardPorts = ['http' => 80, 'https' => 443];
$scheme = $changes['uri']->getScheme();
if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) {
$changes['set_headers']['Host'] .= ':'.$port;
}
}
}
$uri = $changes['uri'];
}
if (!empty($changes['remove_headers'])) {
$headers = _caseless_remove($changes['remove_headers'], $headers);
}
if (!empty($changes['set_headers'])) {
$headers = _caseless_remove(array_keys($changes['set_headers']), $headers);
$headers = $changes['set_headers'] + $headers;
}
if (isset($changes['query'])) {
$uri = $uri->withQuery($changes['query']);
}
if ($request instanceof ServerRequestInterface) {
return new ServerRequest(
isset($changes['method']) ? $changes['method'] : $request->getMethod(),
$uri,
$headers,
isset($changes['body']) ? $changes['body'] : $request->getBody(),
isset($changes['version'])
? $changes['version']
: $request->getProtocolVersion(),
$request->getServerParams()
);
}
return new Request(
isset($changes['method']) ? $changes['method'] : $request->getMethod(),
$uri,
$headers,
isset($changes['body']) ? $changes['body'] : $request->getBody(),
isset($changes['version'])
? $changes['version']
: $request->getProtocolVersion()
);
}
/**
* Attempts to rewind a message body and throws an exception on failure.
*
* The body of the message will only be rewound if a call to `tell()` returns a
* value other than `0`.
*
* @param MessageInterface $message Message to rewind
*
* @throws \RuntimeException
*/
function rewind_body(MessageInterface $message)
{
$body = $message->getBody();
if ($body->tell()) {
$body->rewind();
}
}
/**
* Safely opens a PHP stream resource using a filename.
*
* When fopen fails, PHP normally raises a warning. This function adds an
* error handler that checks for errors and throws an exception instead.
*
* @param string $filename File to open
* @param string $mode Mode used to open the file
*
* @return resource
* @throws \RuntimeException if the file cannot be opened
*/
function try_fopen($filename, $mode)
{
$ex = null;
set_error_handler(function () use ($filename, $mode, &$ex) {
$ex = new \RuntimeException(sprintf(
'Unable to open %s using mode %s: %s',
$filename,
$mode,
func_get_args()[1]
));
});
$handle = fopen($filename, $mode);
restore_error_handler();
if ($ex) {
/** @var $ex \RuntimeException */
throw $ex;
}
return $handle;
}
/**
* Copy the contents of a stream into a string until the given number of
* bytes have been read.
*
* @param StreamInterface $stream Stream to read
* @param int $maxLen Maximum number of bytes to read. Pass -1
* to read the entire stream.
* @return string
* @throws \RuntimeException on error.
*/
function copy_to_string(StreamInterface $stream, $maxLen = -1)
{
$buffer = '';
if ($maxLen === -1) {
while (!$stream->eof()) {
$buf = $stream->read(1048576);
// Using a loose equality here to match on '' and false.
if ($buf == null) {
break;
}
$buffer .= $buf;
}
return $buffer;
}
$len = 0;
while (!$stream->eof() && $len < $maxLen) {
$buf = $stream->read($maxLen - $len);
// Using a loose equality here to match on '' and false.
if ($buf == null) {
break;
}
$buffer .= $buf;
$len = strlen($buffer);
}
return $buffer;
}
/**
* Copy the contents of a stream into another stream until the given number
* of bytes have been read.
*
* @param StreamInterface $source Stream to read from
* @param StreamInterface $dest Stream to write to
* @param int $maxLen Maximum number of bytes to read. Pass -1
* to read the entire stream.
*
* @throws \RuntimeException on error.
*/
function copy_to_stream(
StreamInterface $source,
StreamInterface $dest,
$maxLen = -1
) {
$bufferSize = 8192;
if ($maxLen === -1) {
while (!$source->eof()) {
if (!$dest->write($source->read($bufferSize))) {
break;
}
}
} else {
$remaining = $maxLen;
while ($remaining > 0 && !$source->eof()) {
$buf = $source->read(min($bufferSize, $remaining));
$len = strlen($buf);
if (!$len) {
break;
}
$remaining -= $len;
$dest->write($buf);
}
}
}
/**
* Calculate a hash of a Stream
*
* @param StreamInterface $stream Stream to calculate the hash for
* @param string $algo Hash algorithm (e.g. md5, crc32, etc)
* @param bool $rawOutput Whether or not to use raw output
*
* @return string Returns the hash of the stream
* @throws \RuntimeException on error.
*/
function hash(
StreamInterface $stream,
$algo,
$rawOutput = false
) {
$pos = $stream->tell();
if ($pos > 0) {
$stream->rewind();
}
$ctx = hash_init($algo);
while (!$stream->eof()) {
hash_update($ctx, $stream->read(1048576));
}
$out = hash_final($ctx, (bool) $rawOutput);
$stream->seek($pos);
return $out;
}
/**
* Read a line from the stream up to the maximum allowed buffer length
*
* @param StreamInterface $stream Stream to read from
* @param int $maxLength Maximum buffer length
*
* @return string|bool
*/
function readline(StreamInterface $stream, $maxLength = null)
{
$buffer = '';
$size = 0;
while (!$stream->eof()) {
// Using a loose equality here to match on '' and false.
if (null == ($byte = $stream->read(1))) {
return $buffer;
}
$buffer .= $byte;
// Break when a new line is found or the max length - 1 is reached
if ($byte === "\n" || ++$size === $maxLength - 1) {
break;
}
}
return $buffer;
}
/**
* Parses a request message string into a request object.
*
* @param string $message Request message string.
*
* @return Request
*/
function parse_request($message)
{
$data = _parse_message($message);
$matches = [];
if (!preg_match('/^[\S]+\s+([a-zA-Z]+:\/\/|\/).*/', $data['start-line'], $matches)) {
throw new \InvalidArgumentException('Invalid request string');
}
$parts = explode(' ', $data['start-line'], 3);
$version = isset($parts[2]) ? explode('/', $parts[2])[1] : '1.1';
$request = new Request(
$parts[0],
$matches[1] === '/' ? _parse_request_uri($parts[1], $data['headers']) : $parts[1],
$data['headers'],
$data['body'],
$version
);
return $matches[1] === '/' ? $request : $request->withRequestTarget($parts[1]);
}
/**
* Parses a response message string into a response object.
*
* @param string $message Response message string.
*
* @return Response
*/
function parse_response($message)
{
$data = _parse_message($message);
// According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space
// between status-code and reason-phrase is required. But browsers accept
// responses without space and reason as well.
if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) {
throw new \InvalidArgumentException('Invalid response string');
}
$parts = explode(' ', $data['start-line'], 3);
return new Response(
$parts[1],
$data['headers'],
$data['body'],
explode('/', $parts[0])[1],
isset($parts[2]) ? $parts[2] : null
);
}
/**
* Parse a query string into an associative array.
*
* If multiple values are found for the same key, the value of that key
* value pair will become an array. This function does not parse nested
* PHP style arrays into an associative array (e.g., foo[a]=1&foo[b]=2 will
* be parsed into ['foo[a]' => '1', 'foo[b]' => '2']).
*
* @param string $str Query string to parse
* @param bool|string $urlEncoding How the query string is encoded
*
* @return array
*/
function parse_query($str, $urlEncoding = true)
{
$result = [];
if ($str === '') {
return $result;
}
if ($urlEncoding === true) {
$decoder = function ($value) {
return rawurldecode(str_replace('+', ' ', $value));
};
} elseif ($urlEncoding == PHP_QUERY_RFC3986) {
$decoder = 'rawurldecode';
} elseif ($urlEncoding == PHP_QUERY_RFC1738) {
$decoder = 'urldecode';
} else {
$decoder = function ($str) { return $str; };
}
foreach (explode('&', $str) as $kvp) {
$parts = explode('=', $kvp, 2);
$key = $decoder($parts[0]);
$value = isset($parts[1]) ? $decoder($parts[1]) : null;
if (!isset($result[$key])) {
$result[$key] = $value;
} else {
if (!is_array($result[$key])) {
$result[$key] = [$result[$key]];
}
$result[$key][] = $value;
}
}
return $result;
}
/**
* Build a query string from an array of key value pairs.
*
* This function can use the return value of parse_query() to build a query
* string. This function does not modify the provided keys when an array is
* encountered (like http_build_query would).
*
* @param array $params Query string parameters.
* @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986
* to encode using RFC3986, or PHP_QUERY_RFC1738
* to encode using RFC1738.
* @return string
*/
function build_query(array $params, $encoding = PHP_QUERY_RFC3986)
{
if (!$params) {
return '';
}
if ($encoding === false) {
$encoder = function ($str) { return $str; };
} elseif ($encoding === PHP_QUERY_RFC3986) {
$encoder = 'rawurlencode';
} elseif ($encoding === PHP_QUERY_RFC1738) {
$encoder = 'urlencode';
} else {
throw new \InvalidArgumentException('Invalid type');
}
$qs = '';
foreach ($params as $k => $v) {
$k = $encoder($k);
if (!is_array($v)) {
$qs .= $k;
if ($v !== null) {
$qs .= '=' . $encoder($v);
}
$qs .= '&';
} else {
foreach ($v as $vv) {
$qs .= $k;
if ($vv !== null) {
$qs .= '=' . $encoder($vv);
}
$qs .= '&';
}
}
}
return $qs ? (string) substr($qs, 0, -1) : '';
}
/**
* Determines the mimetype of a file by looking at its extension.
*
* @param $filename
*
* @return null|string
*/
function mimetype_from_filename($filename)
{
return mimetype_from_extension(pathinfo($filename, PATHINFO_EXTENSION));
}
/**
* Maps a file extensions to a mimetype.
*
* @param $extension string The file extension.
*
* @return string|null
* @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types
*/
function mimetype_from_extension($extension)
{
static $mimetypes = [
'7z' => 'application/x-7z-compressed',
'aac' => 'audio/x-aac',
'ai' => 'application/postscript',
'aif' => 'audio/x-aiff',
'asc' => 'text/plain',
'asf' => 'video/x-ms-asf',
'atom' => 'application/atom+xml',
'avi' => 'video/x-msvideo',
'bmp' => 'image/bmp',
'bz2' => 'application/x-bzip2',
'cer' => 'application/pkix-cert',
'crl' => 'application/pkix-crl',
'crt' => 'application/x-x509-ca-cert',
'css' => 'text/css',
'csv' => 'text/csv',
'cu' => 'application/cu-seeme',
'deb' => 'application/x-debian-package',
'doc' => 'application/msword',
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'dvi' => 'application/x-dvi',
'eot' => 'application/vnd.ms-fontobject',
'eps' => 'application/postscript',
'epub' => 'application/epub+zip',
'etx' => 'text/x-setext',
'flac' => 'audio/flac',
'flv' => 'video/x-flv',
'gif' => 'image/gif',
'gz' => 'application/gzip',
'htm' => 'text/html',
'html' => 'text/html',
'ico' => 'image/x-icon',
'ics' => 'text/calendar',
'ini' => 'text/plain',
'iso' => 'application/x-iso9660-image',
'jar' => 'application/java-archive',
'jpe' => 'image/jpeg',
'jpeg' => 'image/jpeg',
'jpg' => 'image/jpeg',
'js' => 'text/javascript',
'json' => 'application/json',
'latex' => 'application/x-latex',
'log' => 'text/plain',
'm4a' => 'audio/mp4',
'm4v' => 'video/mp4',
'mid' => 'audio/midi',
'midi' => 'audio/midi',
'mov' => 'video/quicktime',
'mp3' => 'audio/mpeg',
'mp4' => 'video/mp4',
'mp4a' => 'audio/mp4',
'mp4v' => 'video/mp4',
'mpe' => 'video/mpeg',
'mpeg' => 'video/mpeg',
'mpg' => 'video/mpeg',
'mpg4' => 'video/mp4',
'oga' => 'audio/ogg',
'ogg' => 'audio/ogg',
'ogv' => 'video/ogg',
'ogx' => 'application/ogg',
'pbm' => 'image/x-portable-bitmap',
'pdf' => 'application/pdf',
'pgm' => 'image/x-portable-graymap',
'png' => 'image/png',
'pnm' => 'image/x-portable-anymap',
'ppm' => 'image/x-portable-pixmap',
'ppt' => 'application/vnd.ms-powerpoint',
'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'ps' => 'application/postscript',
'qt' => 'video/quicktime',
'rar' => 'application/x-rar-compressed',
'ras' => 'image/x-cmu-raster',
'rss' => 'application/rss+xml',
'rtf' => 'application/rtf',
'sgm' => 'text/sgml',
'sgml' => 'text/sgml',
'svg' => 'image/svg+xml',
'swf' => 'application/x-shockwave-flash',
'tar' => 'application/x-tar',
'tif' => 'image/tiff',
'tiff' => 'image/tiff',
'torrent' => 'application/x-bittorrent',
'ttf' => 'application/x-font-ttf',
'txt' => 'text/plain',
'wav' => 'audio/x-wav',
'webm' => 'video/webm',
'wma' => 'audio/x-ms-wma',
'wmv' => 'video/x-ms-wmv',
'woff' => 'application/x-font-woff',
'wsdl' => 'application/wsdl+xml',
'xbm' => 'image/x-xbitmap',
'xls' => 'application/vnd.ms-excel',
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'xml' => 'application/xml',
'xpm' => 'image/x-xpixmap',
'xwd' => 'image/x-xwindowdump',
'yaml' => 'text/yaml',
'yml' => 'text/yaml',
'zip' => 'application/zip',
];
$extension = strtolower($extension);
return isset($mimetypes[$extension])
? $mimetypes[$extension]
: null;
}
/**
* Parses an HTTP message into an associative array.
*
* The array contains the "start-line" key containing the start line of
* the message, "headers" key containing an associative array of header
* array values, and a "body" key containing the body of the message.
*
* @param string $message HTTP request or response to parse.
*
* @return array
* @internal
*/
function _parse_message($message)
{
if (!$message) {
throw new \InvalidArgumentException('Invalid message');
}
// Iterate over each line in the message, accounting for line endings
$lines = preg_split('/(\\r?\\n)/', $message, -1, PREG_SPLIT_DELIM_CAPTURE);
$result = ['start-line' => array_shift($lines), 'headers' => [], 'body' => ''];
array_shift($lines);
for ($i = 0, $totalLines = count($lines); $i < $totalLines; $i += 2) {
$line = $lines[$i];
// If two line breaks were encountered, then this is the end of body
if (empty($line)) {
if ($i < $totalLines - 1) {
$result['body'] = implode('', array_slice($lines, $i + 2));
}
break;
}
if (strpos($line, ':')) {
$parts = explode(':', $line, 2);
$key = trim($parts[0]);
$value = isset($parts[1]) ? trim($parts[1]) : '';
$result['headers'][$key][] = $value;
}
}
return $result;
}
/**
* Constructs a URI for an HTTP request message.
*
* @param string $path Path from the start-line
* @param array $headers Array of headers (each value an array).
*
* @return string
* @internal
*/
function _parse_request_uri($path, array $headers)
{
$hostKey = array_filter(array_keys($headers), function ($k) {
return strtolower($k) === 'host';
});
// If no host is found, then a full URI cannot be constructed.
if (!$hostKey) {
return $path;
}
$host = $headers[reset($hostKey)][0];
$scheme = substr($host, -4) === ':443' ? 'https' : 'http';
return $scheme . '://' . $host . '/' . ltrim($path, '/');
}
/** @internal */
function _caseless_remove($keys, array $data)
{
$result = [];
foreach ($keys as &$key) {
$key = strtolower($key);
}
foreach ($data as $k => $v) {
if (!in_array(strtolower($k), $keys)) {
$result[$k] = $v;
}
}
return $result;
}
| SeeTheC/NFC-Based-Emergency-Response-System | WebApp/vendor/guzzlehttp/psr7/src/functions.php | PHP | mit | 24,452 |
var _ = require('lodash'),
Promise = require('bluebird'),
storage = require('../../../storage'),
replaceImage,
ImageImporter,
preProcessPosts,
preProcessTags,
preProcessUsers;
replaceImage = function (markdown, image) {
// Normalizes to include a trailing slash if there was one
var regex = new RegExp('(/)?' + image.originalPath, 'gm');
return markdown.replace(regex, image.newPath);
};
preProcessPosts = function (data, image) {
_.each(data.posts, function (post) {
post.markdown = replaceImage(post.markdown, image);
if (post.html) {
post.html = replaceImage(post.html, image);
}
if (post.image) {
post.image = replaceImage(post.image, image);
}
});
};
preProcessTags = function (data, image) {
_.each(data.tags, function (tag) {
if (tag.image) {
tag.image = replaceImage(tag.image, image);
}
});
};
preProcessUsers = function (data, image) {
_.each(data.users, function (user) {
if (user.cover) {
user.cover = replaceImage(user.cover, image);
}
if (user.image) {
user.image = replaceImage(user.image, image);
}
});
};
ImageImporter = {
type: 'images',
preProcess: function (importData) {
if (importData.images && importData.data) {
_.each(importData.images, function (image) {
preProcessPosts(importData.data.data, image);
preProcessTags(importData.data.data, image);
preProcessUsers(importData.data.data, image);
});
}
importData.preProcessedByImage = true;
return importData;
},
doImport: function (imageData) {
var store = storage.getStorage();
return Promise.map(imageData, function (image) {
return store.save(image, image.targetDir).then(function (result) {
return {originalPath: image.originalPath, newPath: image.newPath, stored: result};
});
});
}
};
module.exports = ImageImporter;
| jaswilli/Ghost | core/server/data/importer/importers/image.js | JavaScript | mit | 2,111 |
@import "https://www.github.com/cloudhead/imports/modify-this.css";
@import "https://www.github.com/cloudhead/imports/modify-again.css";
.modify {
my-url: url("https://www.github.com/cloudhead/imports/a.png");
}
.modify {
my-url: url("https://www.github.com/cloudhead/imports/b.png");
}
@font-face {
src: url("/fonts/garamond-pro.ttf");
src: local(Futura-Medium), url(https://www.github.com/cloudhead/less.js/fonts.svg#MyGeometricModern) format("svg");
}
#shorthands {
background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
}
#misc {
background-image: url(https://www.github.com/cloudhead/less.js/images/image.jpg);
}
#data-uri {
background: url(data:image/png;charset=utf-8;base64,
kiVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD/
k//+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4U
kg9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC);
background-image: url(data:image/x-png,f9difSSFIIGFIFJD1f982FSDKAA9==);
background-image: url(http://fonts.googleapis.com/css?family=\"Rokkitt\":\(400\),700);
}
#svg-data-uri {
background: transparent url('data:image/svg+xml, <svg version="1.1"><g></g></svg>');
}
.comma-delimited {
background: url(https://www.github.com/cloudhead/less.js/bg.jpg) no-repeat, url(https://www.github.com/cloudhead/less.js/bg.png) repeat-x top left, url(https://www.github.com/cloudhead/less.js/bg);
}
.values {
url: url('https://www.github.com/cloudhead/less.js/Trebuchet');
}
| esschul/udp.github.io | node_modules/less/test/browser/css/rootpath-relative/urls.css | CSS | mit | 1,468 |
YUI.add("datatable-sort",function(e,t){function l(){}var n=e.Lang,r=n.isBoolean,i=n.isString,s=n.isArray,o=n.isObject,u=e.Array,a=n.sub,f={asc:1,desc:-1,1:1,"-1":-1};l.ATTRS={sortable:{value:"auto",validator:"_validateSortable"},sortBy:{validator:"_validateSortBy",getter:"_getSortBy"},strings:{}},e.mix(l.prototype,{sort:function(t,n){return this.fire("sort",e.merge(n||{},{sortBy:t||this.get("sortBy")}))},SORTABLE_HEADER_TEMPLATE:'<div class="{className}" tabindex="0" unselectable="on"><span class="{indicatorClass}"></span></div>',toggleSort:function(t,n){var r=this._sortBy,i=[],s,o,a,f,l;for(s=0,o=r.length;s<o;++s)f={},f[r[s]._id]=r[s].sortDir,i.push(f);if(t){t=u(t);for(s=0,o=t.length;s<o;++s){f=t[s],l=-1;for(a=i.length-1;s>=0;--s)if(i[a][f]){i[a][f]*=-1;break}}}else for(s=0,o=i.length;s<o;++s)for(f in i[s])if(i[s].hasOwnProperty(f)){i[s][f]*=-1;break}return this.fire("sort",e.merge(n||{},{sortBy:i}))},_afterSortByChange:function(){this._setSortBy(),this._sortBy.length&&(this.data.comparator||(this.data.comparator=this._sortComparator),this.data.sort())},_afterSortDataChange:function(e){(e.prevVal!==e.newVal||e.newVal.hasOwnProperty("_compare"))&&this._initSortFn()},_afterSortRecordChange:function(e){var t,n;for(t=0,n=this._sortBy.length;t<n;++t)if(e.changed[this._sortBy[t].key]){this.data.sort();break}},_bindSortUI:function(){var t=this._eventHandles;t.sortAttrs||(t.sortAttrs=this.after(["sortableChange","sortByChange","columnsChange"],e.bind("_uiSetSortable",this))),!t.sortUITrigger&&this._theadNode&&(t.sortUITrigger=this.delegate(["click","keydown"],e.rbind("_onUITriggerSort",this),"."+this.getClassName("sortable","column")))},_defSortFn:function(e){this.set.apply(this,["sortBy",e.sortBy].concat(e.details))},_getSortBy:function(e,t){var n,r,i,s;t=t.slice(7);if(t==="state"){n=[];for(r=0,i=this._sortBy.length;r<i;++r)s=this._sortBy[r],n.push({column:s._id,dir:s.sortDir});return{state:n.length===1?n[0]:n}}return e},initializer:function(){var t=e.bind("_parseSortable",this);this._parseSortable(),this._setSortBy(),this._initSortFn(),this._initSortStrings(),this.after({"table:renderHeader":e.bind("_renderSortable",this),dataChange:e.bind("_afterSortDataChange",this),sortByChange:e.bind("_afterSortByChange",this),sortableChange:t,columnsChange:t}),this.data.after(this.data.model.NAME+":change",e.bind("_afterSortRecordChange",this)),this.publish("sort",{defaultFn:e.bind("_defSortFn",this)})},_initSortFn:function(){var e=this;this.data._compare=function(t,n){var r=0,i,s,o,u,a,f,l;for(i=0,s=e._sortBy.length;!r&&i<s;++i)o=e._sortBy[i],u=o.sortDir,a=o.caseSensitive,o.sortFn?r=o.sortFn(t,n,u===-1):(f=t.get(o.key)||"",l=n.get(o.key)||"",!a&&typeof f=="string"&&typeof l=="string"&&(f=f.toLowerCase(),l=l.toLowerCase()),r=f>l?u:f<l?-u:0);return r},this._sortBy.length?(this.data.comparator=this._sortComparator,this.data.sort()):delete this.data.comparator},_initSortStrings:function(){this.set("strings",e.mix(this.get("strings")||{},e.Intl.get("datatable-sort")))},_onUITriggerSort:function(e){var t=e.currentTarget.getAttribute("data-yui3-col-id"),n=t&&this.getColumn(t),r,i,s;if(e.type==="keydown"&&e.keyCode!==32)return;e.preventDefault();if(n){if(e.shiftKey){r=this.get("sortBy")||[];for(i=0,s=r.length;i<s;++i)if(t===r[i]||Math.abs(r[i][t])===1){o(r[i])||(r[i]={}),r[i][t]=-(n.sortDir||0)||1;break}i>=s&&r.push(n._id)}else r=[{}],r[0][t]=-(n.sortDir||0)||1;this.fire("sort",{originEvent:e,sortBy:r})}},_parseSortable:function(){var e=this.get("sortable"),t=[],n,r,i;if(s(e))for(n=0,r=e.length;n<r;++n){i=e[n];if(!o(i,!0)||s(i))i=this.getColumn(i);i&&t.push(i)}else if(e){t=this._displayColumns.slice();if(e==="auto")for(n=t.length-1;n>=0;--n)t[n].sortable||t.splice(n,1)}this._sortable=t},_renderSortable:function(){this._uiSetSortable(),this._bindSortUI()},_setSortBy:function(){var e=this._displayColumns,t=this.get("sortBy")||[],n=" "+this.getClassName("sorted"),r,i,s,a,l,c;this._sortBy=[];for(r=0,i=e.length;r<i;++r)c=e[r],delete c.sortDir,c.className&&(c.className=c.className.replace(n,""));t=u(t);for(r=0,i=t.length;r<i;++r){s=t[r],a=1;if(o(s)){l=s;for(s in l)if(l.hasOwnProperty(s)){a=f[l[s]];break}}s&&(c=this.getColumn(s)||{_id:s,key:s},c&&(c.sortDir=a,c.className||(c.className=""),c.className+=n,this._sortBy.push(c)))}},_sortComparator:function(e){return e},_uiSetSortable:function(){var t=this._sortable||[],n=this.getClassName("sortable","column"),r=this.getClassName("sorted"),i=this.getClassName("sorted","desc"),s=this.getClassName("sort","liner"),o=this.getClassName("sort","indicator"),u={},f,l,c,h,p,d,v;this.get("boundingBox").toggleClass(this.getClassName("sortable"),t.length);for(f=0,l=t.length;f<l;++f)u[t[f].id]=t[f];this._theadNode.all("."+n).each(function(e){var t=u[e.get("id")],a=e.one("."+s),f;t?t.sortDir||e.removeClass(r).removeClass(i):(e.removeClass(n).removeClass(r).removeClass(i),a&&a.replace(a.get("childNodes").toFrag()),f=e.one("."+o),f&&f.remove().destroy(!0))});for(f=0,l=t.length;f<l;++f)c=t[f],h=this._theadNode.one("#"+c.id),v=c.sortDir===-1,h&&(p=h.one("."+s),h.addClass(n),c.sortDir&&(h.addClass(r),h.toggleClass(i,v),h.setAttribute("aria-sort",v?"descending":"ascending")),p||(p=e.Node.create(e.Lang.sub(this.SORTABLE_HEADER_TEMPLATE,{className:s,indicatorClass:o})),p.prepend(h.get("childNodes").toFrag()),h.append(p)),d=a(this.getString(c.sortDir===1?"reverseSortBy":"sortBy"),{title:c.title||"",key:c.key||"",abbr:c.abbr||"",label:c.label||"",column:c.abbr||c.label||c.key||"column "+f}),h.setAttribute("title",d),h.setAttribute("aria-labelledby",c.id))},_validateSortable:function(e){return e==="auto"||r(e)||s(e)},_validateSortBy:function(e){return e===null||i(e)||o(e,!0)||s(e)&&(i(e[0])||o(e,!0))}},!0),e.DataTable.Sortable=l,e.Base.mix(e.DataTable,[l])},"@VERSION@",{requires:["datatable-base"],lang:["en","fr","es","hu"],skinnable:!0});
| noraesae/cdnjs | ajax/libs/yui/3.14.0/datatable-sort/datatable-sort-min.js | JavaScript | mit | 5,840 |
/* Based on Sublime Text's Monokai theme */
.cm-s-monokai.CodeMirror {background: #272822; color: #f8f8f2;}
.cm-s-monokai div.CodeMirror-selected {background: #49483E !important;}
.cm-s-monokai .CodeMirror-gutters {background: #272822; border-right: 0px;}
.cm-s-monokai .CodeMirror-linenumber {color: #d0d0d0;}
.cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;}
.cm-s-monokai span.cm-comment {color: #75715e;}
.cm-s-monokai span.cm-atom {color: #ae81ff;}
.cm-s-monokai span.cm-number {color: #ae81ff;}
.cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute {color: #a6e22e;}
.cm-s-monokai span.cm-keyword {color: #f92672;}
.cm-s-monokai span.cm-string {color: #e6db74;}
.cm-s-monokai span.cm-variable {color: #a6e22e;}
.cm-s-monokai span.cm-variable-2 {color: #9effff;}
.cm-s-monokai span.cm-def {color: #fd971f;}
.cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;}
.cm-s-monokai span.cm-bracket {color: #f8f8f2;}
.cm-s-monokai span.cm-tag {color: #f92672;}
.cm-s-monokai span.cm-link {color: #ae81ff;}
.cm-s-monokai .CodeMirror-matchingbracket {
text-decoration: underline;
color: white !important;
}
| raszi/cdnjs | ajax/libs/codemirror/3.11.1/theme/monokai.css | CSS | mit | 1,162 |
'use strict';
var LIBRARY = require('./_library')
, global = require('./_global')
, ctx = require('./_ctx')
, classof = require('./_classof')
, $export = require('./_export')
, isObject = require('./_is-object')
, aFunction = require('./_a-function')
, anInstance = require('./_an-instance')
, forOf = require('./_for-of')
, speciesConstructor = require('./_species-constructor')
, task = require('./_task').set
, microtask = require('./_microtask')()
, PROMISE = 'Promise'
, TypeError = global.TypeError
, process = global.process
, $Promise = global[PROMISE]
, process = global.process
, isNode = classof(process) == 'process'
, empty = function(){ /* empty */ }
, Internal, GenericPromiseCapability, Wrapper;
var USE_NATIVE = !!function(){
try {
// correct subclassing with @@species support
var promise = $Promise.resolve(1)
, FakePromise = (promise.constructor = {})[require('./_wks')('species')] = function(exec){ exec(empty, empty); };
// unhandled rejections tracking support, NodeJS Promise without it fails @@species test
return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise;
} catch(e){ /* empty */ }
}();
// helpers
var sameConstructor = function(a, b){
// with library wrapper special case
return a === b || a === $Promise && b === Wrapper;
};
var isThenable = function(it){
var then;
return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
};
var newPromiseCapability = function(C){
return sameConstructor($Promise, C)
? new PromiseCapability(C)
: new GenericPromiseCapability(C);
};
var PromiseCapability = GenericPromiseCapability = function(C){
var resolve, reject;
this.promise = new C(function($$resolve, $$reject){
if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor');
resolve = $$resolve;
reject = $$reject;
});
this.resolve = aFunction(resolve);
this.reject = aFunction(reject);
};
var perform = function(exec){
try {
exec();
} catch(e){
return {error: e};
}
};
var notify = function(promise, isReject){
if(promise._n)return;
promise._n = true;
var chain = promise._c;
microtask(function(){
var value = promise._v
, ok = promise._s == 1
, i = 0;
var run = function(reaction){
var handler = ok ? reaction.ok : reaction.fail
, resolve = reaction.resolve
, reject = reaction.reject
, domain = reaction.domain
, result, then;
try {
if(handler){
if(!ok){
if(promise._h == 2)onHandleUnhandled(promise);
promise._h = 1;
}
if(handler === true)result = value;
else {
if(domain)domain.enter();
result = handler(value);
if(domain)domain.exit();
}
if(result === reaction.promise){
reject(TypeError('Promise-chain cycle'));
} else if(then = isThenable(result)){
then.call(result, resolve, reject);
} else resolve(result);
} else reject(value);
} catch(e){
reject(e);
}
};
while(chain.length > i)run(chain[i++]); // variable length - can't use forEach
promise._c = [];
promise._n = false;
if(isReject && !promise._h)onUnhandled(promise);
});
};
var onUnhandled = function(promise){
task.call(global, function(){
var value = promise._v
, abrupt, handler, console;
if(isUnhandled(promise)){
abrupt = perform(function(){
if(isNode){
process.emit('unhandledRejection', value, promise);
} else if(handler = global.onunhandledrejection){
handler({promise: promise, reason: value});
} else if((console = global.console) && console.error){
console.error('Unhandled promise rejection', value);
}
});
// Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
promise._h = isNode || isUnhandled(promise) ? 2 : 1;
} promise._a = undefined;
if(abrupt)throw abrupt.error;
});
};
var isUnhandled = function(promise){
if(promise._h == 1)return false;
var chain = promise._a || promise._c
, i = 0
, reaction;
while(chain.length > i){
reaction = chain[i++];
if(reaction.fail || !isUnhandled(reaction.promise))return false;
} return true;
};
var onHandleUnhandled = function(promise){
task.call(global, function(){
var handler;
if(isNode){
process.emit('rejectionHandled', promise);
} else if(handler = global.onrejectionhandled){
handler({promise: promise, reason: promise._v});
}
});
};
var $reject = function(value){
var promise = this;
if(promise._d)return;
promise._d = true;
promise = promise._w || promise; // unwrap
promise._v = value;
promise._s = 2;
if(!promise._a)promise._a = promise._c.slice();
notify(promise, true);
};
var $resolve = function(value){
var promise = this
, then;
if(promise._d)return;
promise._d = true;
promise = promise._w || promise; // unwrap
try {
if(promise === value)throw TypeError("Promise can't be resolved itself");
if(then = isThenable(value)){
microtask(function(){
var wrapper = {_w: promise, _d: false}; // wrap
try {
then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
} catch(e){
$reject.call(wrapper, e);
}
});
} else {
promise._v = value;
promise._s = 1;
notify(promise, false);
}
} catch(e){
$reject.call({_w: promise, _d: false}, e); // wrap
}
};
// constructor polyfill
if(!USE_NATIVE){
// 25.4.3.1 Promise(executor)
$Promise = function Promise(executor){
anInstance(this, $Promise, PROMISE, '_h');
aFunction(executor);
Internal.call(this);
try {
executor(ctx($resolve, this, 1), ctx($reject, this, 1));
} catch(err){
$reject.call(this, err);
}
};
Internal = function Promise(executor){
this._c = []; // <- awaiting reactions
this._a = undefined; // <- checked in isUnhandled reactions
this._s = 0; // <- state
this._d = false; // <- done
this._v = undefined; // <- value
this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
this._n = false; // <- notify
};
Internal.prototype = require('./_redefine-all')($Promise.prototype, {
// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
then: function then(onFulfilled, onRejected){
var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
reaction.fail = typeof onRejected == 'function' && onRejected;
reaction.domain = isNode ? process.domain : undefined;
this._c.push(reaction);
if(this._a)this._a.push(reaction);
if(this._s)notify(this, false);
return reaction.promise;
},
// 25.4.5.1 Promise.prototype.catch(onRejected)
'catch': function(onRejected){
return this.then(undefined, onRejected);
}
});
PromiseCapability = function(){
var promise = new Internal;
this.promise = promise;
this.resolve = ctx($resolve, promise, 1);
this.reject = ctx($reject, promise, 1);
};
}
$export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: $Promise});
require('./_set-to-string-tag')($Promise, PROMISE);
require('./_set-species')(PROMISE);
Wrapper = require('./_core')[PROMISE];
// statics
$export($export.S + $export.F * !USE_NATIVE, PROMISE, {
// 25.4.4.5 Promise.reject(r)
reject: function reject(r){
var capability = newPromiseCapability(this)
, $$reject = capability.reject;
$$reject(r);
return capability.promise;
}
});
$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
// 25.4.4.6 Promise.resolve(x)
resolve: function resolve(x){
// instanceof instead of internal slot check because we should fix it without replacement native Promise core
if(x instanceof $Promise && sameConstructor(x.constructor, this))return x;
var capability = newPromiseCapability(this)
, $$resolve = capability.resolve;
$$resolve(x);
return capability.promise;
}
});
$export($export.S + $export.F * !(USE_NATIVE && require('./_iter-detect')(function(iter){
$Promise.all(iter)['catch'](empty);
})), PROMISE, {
// 25.4.4.1 Promise.all(iterable)
all: function all(iterable){
var C = this
, capability = newPromiseCapability(C)
, resolve = capability.resolve
, reject = capability.reject;
var abrupt = perform(function(){
var values = []
, index = 0
, remaining = 1;
forOf(iterable, false, function(promise){
var $index = index++
, alreadyCalled = false;
values.push(undefined);
remaining++;
C.resolve(promise).then(function(value){
if(alreadyCalled)return;
alreadyCalled = true;
values[$index] = value;
--remaining || resolve(values);
}, reject);
});
--remaining || resolve(values);
});
if(abrupt)reject(abrupt.error);
return capability.promise;
},
// 25.4.4.4 Promise.race(iterable)
race: function race(iterable){
var C = this
, capability = newPromiseCapability(C)
, reject = capability.reject;
var abrupt = perform(function(){
forOf(iterable, false, function(promise){
C.resolve(promise).then(capability.resolve, reject);
});
});
if(abrupt)reject(abrupt.error);
return capability.promise;
}
}); | jwilkinson/tiff16-films | node_modules/core-js/library/modules/es6.promise.js | JavaScript | mit | 9,996 |
// Copyright 2011 Joyent, Inc. All rights reserved.
var assert = require('assert-plus');
var crypto = require('crypto');
///--- Exported API
module.exports = {
/**
* Simply wraps up the node crypto operations for you, and returns
* true or false. You are expected to pass in an object that was
* returned from `parse()`.
*
* @param {Object} parsedSignature the object you got from `parse`.
* @param {String} key either an RSA private key PEM or HMAC secret.
* @return {Boolean} true if valid, false otherwise.
* @throws {TypeError} if you pass in bad arguments.
*/
verifySignature: function verifySignature(parsedSignature, key) {
assert.object(parsedSignature, 'parsedSignature');
assert.string(key, 'key');
var alg = parsedSignature.algorithm.match(/(HMAC|RSA|DSA)-(\w+)/);
if (!alg || alg.length !== 3)
throw new TypeError('parsedSignature: unsupported algorithm ' +
parsedSignature.algorithm);
if (alg[1] === 'HMAC') {
var hmac = crypto.createHmac(alg[2].toUpperCase(), key);
hmac.update(parsedSignature.signingString);
return (hmac.digest('base64') === parsedSignature.params.signature);
} else {
var verify = crypto.createVerify(alg[0]);
verify.update(parsedSignature.signingString);
return verify.verify(key, parsedSignature.params.signature, 'base64');
}
}
};
| benjystanton/F2D-Prototype | node_modules/node-sass/node_modules/pangyp/node_modules/request/node_modules/http-signature/lib/verify.js | JavaScript | mit | 1,408 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"f.h.",
"e.h."
],
"DAY": [
"sunnudagur",
"m\u00e1nudagur",
"\u00feri\u00f0judagur",
"mi\u00f0vikudagur",
"fimmtudagur",
"f\u00f6studagur",
"laugardagur"
],
"MONTH": [
"jan\u00faar",
"febr\u00faar",
"mars",
"apr\u00edl",
"ma\u00ed",
"j\u00fan\u00ed",
"j\u00fal\u00ed",
"\u00e1g\u00fast",
"september",
"okt\u00f3ber",
"n\u00f3vember",
"desember"
],
"SHORTDAY": [
"sun",
"m\u00e1n",
"\u00feri",
"mi\u00f0",
"fim",
"f\u00f6s",
"lau"
],
"SHORTMONTH": [
"jan",
"feb",
"mar",
"apr",
"ma\u00ed",
"j\u00fan",
"j\u00fal",
"\u00e1g\u00fa",
"sep",
"okt",
"n\u00f3v",
"des"
],
"fullDate": "EEEE, d. MMMM y",
"longDate": "d. MMMM y",
"medium": "d.M.yyyy HH:mm:ss",
"mediumDate": "d.M.yyyy",
"mediumTime": "HH:mm:ss",
"short": "d.M.yyyy HH:mm",
"shortDate": "d.M.yyyy",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "kr",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(\u00a4",
"negSuf": ")",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "is",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | pombredanne/cdnjs | ajax/libs/angular-i18n/1.2.10/angular-locale_is.js | JavaScript | mit | 2,072 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"AM",
"PM"
],
"DAY": [
"igandea",
"astelehena",
"asteartea",
"asteazkena",
"osteguna",
"ostirala",
"larunbata"
],
"MONTH": [
"urtarrila",
"otsaila",
"martxoa",
"apirila",
"maiatza",
"ekaina",
"uztaila",
"abuztua",
"iraila",
"urria",
"azaroa",
"abendua"
],
"SHORTDAY": [
"ig",
"al",
"as",
"az",
"og",
"or",
"lr"
],
"SHORTMONTH": [
"urt",
"ots",
"mar",
"api",
"mai",
"eka",
"uzt",
"abu",
"ira",
"urr",
"aza",
"abe"
],
"fullDate": "EEEE, y'eko' MMMM'ren' dd'a'",
"longDate": "y'eko' MMM'ren' dd'a'",
"medium": "y MMM d HH:mm:ss",
"mediumDate": "y MMM d",
"mediumTime": "HH:mm:ss",
"short": "yyyy-MM-dd HH:mm",
"shortDate": "yyyy-MM-dd",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(",
"negSuf": "\u00a0\u00a4)",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "eu",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | menuka94/cdnjs | ajax/libs/angular.js/1.2.23/i18n/angular-locale_eu.js | JavaScript | mit | 1,967 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"PD",
"MD"
],
"DAY": [
"e diel",
"e h\u00ebn\u00eb",
"e mart\u00eb",
"e m\u00ebrkur\u00eb",
"e enjte",
"e premte",
"e shtun\u00eb"
],
"MONTH": [
"janar",
"shkurt",
"mars",
"prill",
"maj",
"qershor",
"korrik",
"gusht",
"shtator",
"tetor",
"n\u00ebntor",
"dhjetor"
],
"SHORTDAY": [
"Die",
"H\u00ebn",
"Mar",
"M\u00ebr",
"Enj",
"Pre",
"Sht"
],
"SHORTMONTH": [
"Jan",
"Shk",
"Mar",
"Pri",
"Maj",
"Qer",
"Kor",
"Gsh",
"Sht",
"Tet",
"N\u00ebn",
"Dhj"
],
"fullDate": "EEEE, dd MMMM y",
"longDate": "dd MMMM y",
"medium": "yyyy-MM-dd h.mm.ss.a",
"mediumDate": "yyyy-MM-dd",
"mediumTime": "h.mm.ss.a",
"short": "yy-MM-dd h.mm.a",
"shortDate": "yy-MM-dd",
"shortTime": "h.mm.a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "Lek",
"DECIMAL_SEP": ",",
"GROUP_SEP": "\u00a0",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "\u00a4-",
"negSuf": "",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "sq",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | fk/cdnjs | ajax/libs/angular.js/1.3.0-beta.3/i18n/angular-locale_sq.js | JavaScript | mit | 1,969 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"AM",
"PM"
],
"DAY": [
"s\u00f8ndag",
"mandag",
"tirsdag",
"onsdag",
"torsdag",
"fredag",
"l\u00f8rdag"
],
"MONTH": [
"januar",
"februar",
"mars",
"april",
"mai",
"juni",
"juli",
"august",
"september",
"oktober",
"november",
"desember"
],
"SHORTDAY": [
"s\u00f8n.",
"man.",
"tir.",
"ons.",
"tor.",
"fre.",
"l\u00f8r."
],
"SHORTMONTH": [
"jan.",
"feb.",
"mars",
"apr.",
"mai",
"juni",
"juli",
"aug.",
"sep.",
"okt.",
"nov.",
"des."
],
"fullDate": "EEEE d. MMMM y",
"longDate": "d. MMMM y",
"medium": "d. MMM y HH:mm:ss",
"mediumDate": "d. MMM y",
"mediumTime": "HH:mm:ss",
"short": "dd.MM.yy HH:mm",
"shortDate": "dd.MM.yy",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "kr",
"DECIMAL_SEP": ",",
"GROUP_SEP": "\u00a0",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "\u00a4\u00a0-",
"negSuf": "",
"posPre": "\u00a4\u00a0",
"posSuf": ""
}
]
},
"id": "no",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | yinghunglai/cdnjs | ajax/libs/angular.js/1.2.15/i18n/angular-locale_no.js | JavaScript | mit | 1,957 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"a.m.",
"p.m."
],
"DAY": [
"domingo",
"lunes",
"martes",
"mi\u00e9rcoles",
"jueves",
"viernes",
"s\u00e1bado"
],
"MONTH": [
"enero",
"febrero",
"marzo",
"abril",
"mayo",
"junio",
"julio",
"agosto",
"septiembre",
"octubre",
"noviembre",
"diciembre"
],
"SHORTDAY": [
"dom",
"lun",
"mar",
"mi\u00e9",
"jue",
"vie",
"s\u00e1b"
],
"SHORTMONTH": [
"ene",
"feb",
"mar",
"abr",
"may",
"jun",
"jul",
"ago",
"sep",
"oct",
"nov",
"dic"
],
"fullDate": "EEEE, d 'de' MMMM 'de' y",
"longDate": "d 'de' MMMM 'de' y",
"medium": "dd/MM/yyyy HH:mm:ss",
"mediumDate": "dd/MM/yyyy",
"mediumTime": "HH:mm:ss",
"short": "d/MM/yy HH:mm",
"shortDate": "d/MM/yy",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "es-pe",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | RubaXa/cdnjs | ajax/libs/angular.js/1.2.21/i18n/angular-locale_es-pe.js | JavaScript | mit | 1,974 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"AM",
"PM"
],
"DAY": [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
],
"MONTH": [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
],
"SHORTDAY": [
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat"
],
"SHORTMONTH": [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
],
"fullDate": "EEEE, y MMMM dd",
"longDate": "y MMMM d",
"medium": "y MMM d HH:mm:ss",
"mediumDate": "y MMM d",
"mediumTime": "HH:mm:ss",
"short": "yyyy-MM-dd HH:mm",
"shortDate": "yyyy-MM-dd",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "$",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "(\u00a4",
"negSuf": ")",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "en-iso",
"pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); | billybonz1/cdnjs | ajax/libs/angular-i18n/1.2.0/angular-locale_en-iso.js | JavaScript | mit | 1,917 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"AM",
"PM"
],
"DAY": [
"Minggu",
"Senin",
"Selasa",
"Rabu",
"Kamis",
"Jumat",
"Sabtu"
],
"MONTH": [
"Januari",
"Februari",
"Maret",
"April",
"Mei",
"Juni",
"Juli",
"Agustus",
"September",
"Oktober",
"November",
"Desember"
],
"SHORTDAY": [
"Min",
"Sen",
"Sel",
"Rab",
"Kam",
"Jum",
"Sab"
],
"SHORTMONTH": [
"Jan",
"Feb",
"Mar",
"Apr",
"Mei",
"Jun",
"Jul",
"Agt",
"Sep",
"Okt",
"Nov",
"Des"
],
"fullDate": "EEEE, dd MMMM yyyy",
"longDate": "d MMMM yyyy",
"medium": "d MMM yyyy HH:mm:ss",
"mediumDate": "d MMM yyyy",
"mediumTime": "HH:mm:ss",
"short": "dd/MM/yy HH:mm",
"shortDate": "dd/MM/yy",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "Rp",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "\u00a4-",
"negSuf": "",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "id",
"pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;}
});
}]); | baig/cdnjs | ajax/libs/angular-i18n/1.2.5/angular-locale_id.js | JavaScript | mit | 1,860 |
<?php namespace Illuminate\Cookie;
use Symfony\Component\HttpFoundation\Cookie;
use Illuminate\Contracts\Cookie\QueueingFactory as JarContract;
class CookieJar implements JarContract {
/**
* The default path (if specified).
*
* @var string
*/
protected $path = '/';
/**
* The default domain (if specified).
*
* @var string
*/
protected $domain = null;
/**
* All of the cookies queued for sending.
*
* @var array
*/
protected $queued = array();
/**
* Create a new cookie instance.
*
* @param string $name
* @param string $value
* @param int $minutes
* @param string $path
* @param string $domain
* @param bool $secure
* @param bool $httpOnly
* @return \Symfony\Component\HttpFoundation\Cookie
*/
public function make($name, $value, $minutes = 0, $path = null, $domain = null, $secure = false, $httpOnly = true)
{
list($path, $domain) = $this->getPathAndDomain($path, $domain);
$time = ($minutes == 0) ? 0 : time() + ($minutes * 60);
return new Cookie($name, $value, $time, $path, $domain, $secure, $httpOnly);
}
/**
* Create a cookie that lasts "forever" (five years).
*
* @param string $name
* @param string $value
* @param string $path
* @param string $domain
* @param bool $secure
* @param bool $httpOnly
* @return \Symfony\Component\HttpFoundation\Cookie
*/
public function forever($name, $value, $path = null, $domain = null, $secure = false, $httpOnly = true)
{
return $this->make($name, $value, 2628000, $path, $domain, $secure, $httpOnly);
}
/**
* Expire the given cookie.
*
* @param string $name
* @param string $path
* @param string $domain
* @return \Symfony\Component\HttpFoundation\Cookie
*/
public function forget($name, $path = null, $domain = null)
{
return $this->make($name, null, -2628000, $path, $domain);
}
/**
* Determine if a cookie has been queued.
*
* @param string $key
* @return bool
*/
public function hasQueued($key)
{
return ! is_null($this->queued($key));
}
/**
* Get a queued cookie instance.
*
* @param string $key
* @param mixed $default
* @return \Symfony\Component\HttpFoundation\Cookie
*/
public function queued($key, $default = null)
{
return array_get($this->queued, $key, $default);
}
/**
* Queue a cookie to send with the next response.
*
* @param mixed
* @return void
*/
public function queue()
{
if (head(func_get_args()) instanceof Cookie)
{
$cookie = head(func_get_args());
}
else
{
$cookie = call_user_func_array(array($this, 'make'), func_get_args());
}
$this->queued[$cookie->getName()] = $cookie;
}
/**
* Remove a cookie from the queue.
*
* @param string $name
*/
public function unqueue($name)
{
unset($this->queued[$name]);
}
/**
* Get the path and domain, or the default values.
*
* @param string $path
* @param string $domain
* @return array
*/
protected function getPathAndDomain($path, $domain)
{
return array($path ?: $this->path, $domain ?: $this->domain);
}
/**
* Set the default path and domain for the jar.
*
* @param string $path
* @param string $domain
* @return $this
*/
public function setDefaultPathAndDomain($path, $domain)
{
list($this->path, $this->domain) = array($path, $domain);
return $this;
}
/**
* Get the cookies which have been queued for the next request.
*
* @return array
*/
public function getQueuedCookies()
{
return $this->queued;
}
}
| socialenemy/angular-laravel | vendor/laravel/framework/src/Illuminate/Cookie/CookieJar.php | PHP | mit | 3,539 |
/**********************************************************
************************ Hoverizr *************************
Hoverizr is an image manipulation jQuery plug in taking
advantage of the new canvas element which is getting more
and more popular.
Currently it allows you to use three different, dynamic
effects:
1. Grayscale - Default
2. Blur
3. Color Inversion
You can define your own options or following the trends
it can be responsive by default.
You can read more about Hoverizr and see some Demos at:
http://www.iliasiovis.com/hoverizr/
Fork on GitHub:
https://github.com/iliasiovis/Hoverizr/
CC 2011 - Ilias Iovis | iliasiovis.com
***********************************************************
**********************************************************/
(function( $ ){
$.fn.hoverizr = function(options) {
//Defaults
var defaults = {
'effect': "grayscale", //options include: 'grayscale', 'invert', 'blur'. 'noise' is under construction
'overlay': "top", //manipulated image can be on 'top' or 'bottom'
'container': "overlayed", //name of the class of the generated div wrapping the img and the canvas element
'width': "responsive", //can be 'responsive' fixed width, ex. 500 or 'inherit' from the image
'height': "auto", //please change the height default only if you plan to use a fixed width on your initialization
'stretch': "no", //if you set a fixed width for image and div the img aspect ratio will not change - it will crop the image and canvas outside, if set to "yes" the image and canvas will stretch to fill the fixed width and height you chose
'speedIn': "slow", // 'slow', 'fast' or time in milliseconds, ex 1500
'speedOut': "fast" // same as above
};
//inherit from provided configuration
var options = $.extend(defaults, options);
//Workaround for responsive max-width glitch when initializing the canvas element
if($('img').css('maxWidth') != "none"){
var maxwidth = 1;
$('img').css('maxWidth',"none");
} else{
var maxwidth = 0;
}
//start img manipulation for each selected img tag
this.each(function(){
//add elements and default styles
$(this).wrap('<div class="'+ options.container +'" />');
$(this).parent('.'+ options.container +'').css({'position':'relative'});
$(this).parent('.'+ options.container +'').append('<canvas class="canv"></canvas>');
$(this).next('.canv').css({'position':'absolute','top':'0','left':'0','z-index':10});
if(options.overlay == "top"){
$(this).css({'z-index':-1});
}else {
$(this).css({'z-index':1});
$(this).next('.canv').css({'display':'none'});
}
var width = $(this).width();
var height = $(this).height();
$(this).next('.canv').attr({"width": width ,"height": height});
var canvas = $(this).next('.canv').get(0);
var context = canvas.getContext("2d");
//if(options.effect != "noise"){
var image = $(this).get(0);
context.drawImage(image, 0, 0);
//}
if(options.effect != 'noise' && 'blur'){
try {
try {
var imgd = context.getImageData(0, 0, width, height)
} catch (e) {
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
var imgd = context.getImageData(0, 0, width, height)
}
} catch (e) {
throw new Error("unable to access image data: " + e)
}
//alert("Pixel an (0,0): rgba("+imgd.data[4]+", "+imgd.data[5]+", "+imgd.data[6]+","+imgd.data[6]+")");
var pix = imgd.data;
}
switch(options.effect)
{
case "invert":
//Color Inversion Effect
for (var i = 0, n = pix.length; i < n; i += 4) {
pix[i ] = 255 - pix[i ]; // red
pix[i+1] = 255 - pix[i+1]; // green
pix[i+2] = 255 - pix[i+2]; // blue
// i+3 is alpha (the fourth element)
}
break;
case "blur":
//Blur Effect
var pass, x, y;
// Loop for each blur pass.
var imgb = new Image;
imgb.src = $(this).attr('src');
context.globalAlpha = 0.0625;
//for (pass = 1; pass <= 1; pass += 1) {
for (y = -3; y < 3; y += 1) {
for (x = -3; x < 3; x += 1) {
context.drawImage(imgb, x, y);
}
}
//}
context.globalAlpha = 1;
break;
default:
//Default is set to Grayscale Effect
for (var i = 0, n = pix.length; i < n; i += 4) {
var grayscale = pix[i ] * .3 + pix[i+1] * .59 + pix[i+2] * .11; //Very luminus grayscale formula
//var grayscale = (pix[i ] + pix[i+1] + pix[i+2])/3 - average grayscale formula
//var grayscale = (pix[i ] + pix[i+1] + pix[i+2])/3 -
pix[i ] = grayscale; // red
pix[i+1] = grayscale; // green
pix[i+2] = grayscale; // blue
// i+3 is alpha (the fourth element)
}
break;
}
if(options.effect != ("blur"||"noise"))
{
context.putImageData(imgd, 0, 0);
}
if(options.width == "responsive"){
//make img div & canvas responsive - Glitchy
$(this).next('.canv').css({'max-width':'100%'});
$(this).css({'max-width':'100%'});
$(this).parent('.'+ options.container +'').css({'width':'100%'});
} else if(options.stretch == "no"){
//$(this).next('.canv').css({'width': options.width, 'height': options.height});
//$(this).css({'width': options.width, 'height': options.height});
$(this).parent('.'+ options.container +'').css({'width': options.width, 'height': options.height, overflow: "hidden"});
} else {
$(this).next('.canv').css({'width': options.width, 'height': options.height});
$(this).css({'width': options.width, 'height': options.height});
$(this).parent('.'+ options.container +'').css({'width': options.width, 'height': options.height});
}
});
//restore img max-width if responsive
if(maxwidth == 1){
$('img').css('maxWidth', "100%");
}
//hover effect
if(options.overlay == "top"){
this.parent('.'+ options.container +'').hover(function() {
$(this).children('.canv').stop(true,true).fadeOut(options.speedOut);
},function() {
$(this).children('.canv').stop(true,true).fadeIn(options.speedIn);
});
} else {
this.parent('.'+ options.container +'').hover(function() {
$(this).children('.canv').stop(true,true).fadeIn(options.speedOut);
},function() {
$(this).children('.canv').stop(true,true).fadeOut(options.speedIn);
});
}
};
})( jQuery ); | jmusicc/cdnjs | ajax/libs/Hoverizr/1.0/jquery.hoverizr.js | JavaScript | mit | 6,288 |
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.YASR=t()}}(function(){var t;return function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(t,e){e.exports=t("./main.js")},{"./main.js":39}],2:[function(e,n,r){(function(n,i,o){(function(n){"use strict";"function"==typeof t&&t.amd?t("datatables",["jquery"],n):"object"==typeof r?n(e("jquery")):jQuery&&!jQuery.fn.dataTable&&n(jQuery)})(function(t){"use strict";function e(n){var r,i,o="a aa ai ao as b fn i m o s ",a={};t.each(n,function(t){r=t.match(/^([^A-Z]+?)([A-Z])/);if(r&&-1!==o.indexOf(r[1]+" ")){i=t.replace(r[0],r[2].toLowerCase());a[i]=t;"o"===r[1]&&e(n[t])}});n._hungarianMap=a}function r(n,i,a){n._hungarianMap||e(n);var s;t.each(i,function(e){s=n._hungarianMap[e];if(s!==o&&(a||i[s]===o))if("o"===s.charAt(0)){i[s]||(i[s]={});t.extend(!0,i[s],i[e]);r(n[s],i[s],a)}else i[s]=i[e]})}function a(t){var e=$e.defaults.oLanguage,n=t.sZeroRecords;!t.sEmptyTable&&n&&"No data available in table"===e.sEmptyTable&&Oe(t,t,"sZeroRecords","sEmptyTable");!t.sLoadingRecords&&n&&"Loading..."===e.sLoadingRecords&&Oe(t,t,"sZeroRecords","sLoadingRecords");t.sInfoThousands&&(t.sThousands=t.sInfoThousands);var r=t.sDecimal;r&&Xe(r)}function s(t){yn(t,"ordering","bSort");yn(t,"orderMulti","bSortMulti");yn(t,"orderClasses","bSortClasses");yn(t,"orderCellsTop","bSortCellsTop");yn(t,"order","aaSorting");yn(t,"orderFixed","aaSortingFixed");yn(t,"paging","bPaginate");yn(t,"pagingType","sPaginationType");yn(t,"pageLength","iDisplayLength");yn(t,"searching","bFilter");var e=t.aoSearchCols;if(e)for(var n=0,i=e.length;i>n;n++)e[n]&&r($e.models.oSearch,e[n])}function l(t){yn(t,"orderable","bSortable");yn(t,"orderData","aDataSort");yn(t,"orderSequence","asSorting");yn(t,"orderDataType","sortDataType")}function u(e){var n=e.oBrowser,r=t("<div/>").css({position:"absolute",top:0,left:0,height:1,width:1,overflow:"hidden"}).append(t("<div/>").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(t('<div class="test"/>').css({width:"100%",height:10}))).appendTo("body"),i=r.find(".test");n.bScrollOversize=100===i[0].offsetWidth;n.bScrollbarLeft=1!==i.offset().left;r.remove()}function c(t,e,n,r,i,a){var s,l=r,u=!1;if(n!==o){s=n;u=!0}for(;l!==i;)if(t.hasOwnProperty(l)){s=u?e(s,t[l],l,t):t[l];u=!0;l+=a}return s}function f(e,n){var r=$e.defaults.column,o=e.aoColumns.length,a=t.extend({},$e.models.oColumn,r,{nTh:n?n:i.createElement("th"),sTitle:r.sTitle?r.sTitle:n?n.innerHTML:"",aDataSort:r.aDataSort?r.aDataSort:[o],mData:r.mData?r.mData:o,idx:o});e.aoColumns.push(a);var s=e.aoPreSearchCols;s[o]=t.extend({},$e.models.oSearch,s[o]);h(e,o,null)}function h(e,n,i){var a=e.aoColumns[n],s=e.oClasses,u=t(a.nTh);if(!a.sWidthOrig){a.sWidthOrig=u.attr("width")||null;var c=(u.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);c&&(a.sWidthOrig=c[1])}if(i!==o&&null!==i){l(i);r($e.defaults.column,i);i.mDataProp===o||i.mData||(i.mData=i.mDataProp);i.sType&&(a._sManualType=i.sType);i.className&&!i.sClass&&(i.sClass=i.className);t.extend(a,i);Oe(a,i,"sWidth","sWidthOrig");"number"==typeof i.iDataSort&&(a.aDataSort=[i.iDataSort]);Oe(a,i,"aDataSort")}var f=a.mData,h=M(f),d=a.mRender?M(a.mRender):null,p=function(t){return"string"==typeof t&&-1!==t.indexOf("@")};a._bAttrSrc=t.isPlainObject(f)&&(p(f.sort)||p(f.type)||p(f.filter));a.fnGetData=function(t,e,n){var r=h(t,e,o,n);return d&&e?d(r,e,t,n):r};a.fnSetData=function(t,e,n){return D(f)(t,e,n)};if(!e.oFeatures.bSort){a.bSortable=!1;u.addClass(s.sSortableNone)}var g=-1!==t.inArray("asc",a.asSorting),m=-1!==t.inArray("desc",a.asSorting);if(a.bSortable&&(g||m))if(g&&!m){a.sSortingClass=s.sSortableAsc;a.sSortingClassJUI=s.sSortJUIAscAllowed}else if(!g&&m){a.sSortingClass=s.sSortableDesc;a.sSortingClassJUI=s.sSortJUIDescAllowed}else{a.sSortingClass=s.sSortable;a.sSortingClassJUI=s.sSortJUI}else{a.sSortingClass=s.sSortableNone;a.sSortingClassJUI=""}}function d(t){if(t.oFeatures.bAutoWidth!==!1){var e=t.aoColumns;ye(t);for(var n=0,r=e.length;r>n;n++)e[n].nTh.style.width=e[n].sWidth}var i=t.oScroll;(""!==i.sY||""!==i.sX)&&me(t);ze(t,null,"column-sizing",[t])}function p(t,e){var n=v(t,"bVisible");return"number"==typeof n[e]?n[e]:null}function g(e,n){var r=v(e,"bVisible"),i=t.inArray(n,r);return-1!==i?i:null}function m(t){return v(t,"bVisible").length}function v(e,n){var r=[];t.map(e.aoColumns,function(t,e){t[n]&&r.push(e)});return r}function y(t){var e,n,r,i,a,s,l,u,c,f=t.aoColumns,h=t.aoData,d=$e.ext.type.detect;for(e=0,n=f.length;n>e;e++){l=f[e];c=[];if(!l.sType&&l._sManualType)l.sType=l._sManualType;else if(!l.sType){for(r=0,i=d.length;i>r;r++){for(a=0,s=h.length;s>a;a++){c[a]===o&&(c[a]=T(t,a,e,"type"));u=d[r](c[a],t);if(!u||"html"===u)break}if(u){l.sType=u;break}}l.sType||(l.sType="string")}}}function b(e,n,r,i){var a,s,l,u,c,h,d,p=e.aoColumns;if(n)for(a=n.length-1;a>=0;a--){d=n[a];var g=d.targets!==o?d.targets:d.aTargets;t.isArray(g)||(g=[g]);for(l=0,u=g.length;u>l;l++)if("number"==typeof g[l]&&g[l]>=0){for(;p.length<=g[l];)f(e);i(g[l],d)}else if("number"==typeof g[l]&&g[l]<0)i(p.length+g[l],d);else if("string"==typeof g[l])for(c=0,h=p.length;h>c;c++)("_all"==g[l]||t(p[c].nTh).hasClass(g[l]))&&i(c,d)}if(r)for(a=0,s=r.length;s>a;a++)i(a,r[a])}function x(e,n,r,i){var o=e.aoData.length,a=t.extend(!0,{},$e.models.oRow,{src:r?"dom":"data"});a._aData=n;e.aoData.push(a);for(var s=e.aoColumns,l=0,u=s.length;u>l;l++){r&&k(e,o,l,T(e,o,l));s[l].sType=null}e.aiDisplayMaster.push(o);(r||!e.oFeatures.bDeferRender)&&P(e,o,r,i);return o}function w(e,n){var r;n instanceof t||(n=t(n));return n.map(function(t,n){r=j(e,n);return x(e,r.data,n,r.cells)})}function C(t,e){return e._DT_RowIndex!==o?e._DT_RowIndex:null}function S(e,n,r){return t.inArray(r,e.aoData[n].anCells)}function T(t,e,n,r){var i=t.iDraw,a=t.aoColumns[n],s=t.aoData[e]._aData,l=a.sDefaultContent,u=a.fnGetData(s,r,{settings:t,row:e,col:n});if(u===o){if(t.iDrawError!=i&&null===l){He(t,0,"Requested unknown parameter "+("function"==typeof a.mData?"{function}":"'"+a.mData+"'")+" for row "+e,4);t.iDrawError=i}return l}if(u!==s&&null!==u||null===l){if("function"==typeof u)return u.call(s)}else u=l;return null===u&&"display"==r?"":u}function k(t,e,n,r){var i=t.aoColumns[n],o=t.aoData[e]._aData;i.fnSetData(o,r,{settings:t,row:e,col:n})}function _(e){return t.map(e.match(/(\\.|[^\.])+/g),function(t){return t.replace(/\\./g,".")})}function M(e){if(t.isPlainObject(e)){var n={};t.each(e,function(t,e){e&&(n[t]=M(e))});return function(t,e,r,i){var a=n[e]||n._;return a!==o?a(t,e,r,i):t}}if(null===e)return function(t){return t};if("function"==typeof e)return function(t,n,r,i){return e(t,n,r,i)};if("string"!=typeof e||-1===e.indexOf(".")&&-1===e.indexOf("[")&&-1===e.indexOf("("))return function(t){return t[e]};var r=function(t,e,n){var i,a,s,l;if(""!==n)for(var u=_(n),c=0,f=u.length;f>c;c++){i=u[c].match(bn);a=u[c].match(xn);if(i){u[c]=u[c].replace(bn,"");""!==u[c]&&(t=t[u[c]]);s=[];u.splice(0,c+1);l=u.join(".");for(var h=0,d=t.length;d>h;h++)s.push(r(t[h],e,l));var p=i[0].substring(1,i[0].length-1);t=""===p?s:s.join(p);break}if(a){u[c]=u[c].replace(xn,"");t=t[u[c]]()}else{if(null===t||t[u[c]]===o)return o;t=t[u[c]]}}return t};return function(t,n){return r(t,n,e)}}function D(e){if(t.isPlainObject(e))return D(e._);if(null===e)return function(){};if("function"==typeof e)return function(t,n,r){e(t,"set",n,r)};if("string"!=typeof e||-1===e.indexOf(".")&&-1===e.indexOf("[")&&-1===e.indexOf("("))return function(t,n){t[e]=n};var n=function(t,e,r){for(var i,a,s,l,u,c=_(r),f=c[c.length-1],h=0,d=c.length-1;d>h;h++){a=c[h].match(bn);s=c[h].match(xn);if(a){c[h]=c[h].replace(bn,"");t[c[h]]=[];i=c.slice();i.splice(0,h+1);u=i.join(".");for(var p=0,g=e.length;g>p;p++){l={};n(l,e[p],u);t[c[h]].push(l)}return}if(s){c[h]=c[h].replace(xn,"");t=t[c[h]](e)}(null===t[c[h]]||t[c[h]]===o)&&(t[c[h]]={});t=t[c[h]]}f.match(xn)?t=t[f.replace(xn,"")](e):t[f.replace(bn,"")]=e};return function(t,r){return n(t,r,e)}}function L(t){return dn(t.aoData,"_aData")}function A(t){t.aoData.length=0;t.aiDisplayMaster.length=0;t.aiDisplay.length=0}function N(t,e,n){for(var r=-1,i=0,a=t.length;a>i;i++)t[i]==e?r=i:t[i]>e&&t[i]--;-1!=r&&n===o&&t.splice(r,1)}function E(t,e,n,r){var i,a,s=t.aoData[e];if("dom"!==n&&(n&&"auto"!==n||"dom"!==s.src)){var l,u=s.anCells;if(u)for(i=0,a=u.length;a>i;i++){l=u[i];for(;l.childNodes.length;)l.removeChild(l.firstChild);u[i].innerHTML=T(t,e,i,"display")}}else s._aData=j(t,s).data;s._aSortData=null;s._aFilterData=null;var c=t.aoColumns;if(r!==o)c[r].sType=null;else for(i=0,a=c.length;a>i;i++)c[i].sType=null;I(s)}function j(e,n){var r,i,o,a,s=[],l=[],u=n.firstChild,c=0,f=e.aoColumns,h=function(t,e,n){if("string"==typeof t){var r=t.indexOf("@");if(-1!==r){var i=t.substring(r+1);o["@"+i]=n.getAttribute(i)}}},d=function(e){i=f[c];a=t.trim(e.innerHTML);if(i&&i._bAttrSrc){o={display:a};h(i.mData.sort,o,e);h(i.mData.type,o,e);h(i.mData.filter,o,e);s.push(o)}else s.push(a);c++};if(u)for(;u;){r=u.nodeName.toUpperCase();if("TD"==r||"TH"==r){d(u);l.push(u)}u=u.nextSibling}else{l=n.anCells;for(var p=0,g=l.length;g>p;p++)d(l[p])}return{data:s,cells:l}}function P(t,e,n,r){var o,a,s,l,u,c=t.aoData[e],f=c._aData,h=[];if(null===c.nTr){o=n||i.createElement("tr");c.nTr=o;c.anCells=h;o._DT_RowIndex=e;I(c);for(l=0,u=t.aoColumns.length;u>l;l++){s=t.aoColumns[l];a=n?r[l]:i.createElement(s.sCellType);h.push(a);(!n||s.mRender||s.mData!==l)&&(a.innerHTML=T(t,e,l,"display"));s.sClass&&(a.className+=" "+s.sClass);s.bVisible&&!n?o.appendChild(a):!s.bVisible&&n&&a.parentNode.removeChild(a);s.fnCreatedCell&&s.fnCreatedCell.call(t.oInstance,a,T(t,e,l),f,e,l)}ze(t,"aoRowCreatedCallback",null,[o,f,e])}c.nTr.setAttribute("role","row")}function I(e){var n=e.nTr,r=e._aData;if(n){r.DT_RowId&&(n.id=r.DT_RowId);if(r.DT_RowClass){var i=r.DT_RowClass.split(" ");e.__rowc=e.__rowc?vn(e.__rowc.concat(i)):i;t(n).removeClass(e.__rowc.join(" ")).addClass(r.DT_RowClass)}r.DT_RowData&&t(n).data(r.DT_RowData)}}function H(e){var n,r,i,o,a,s=e.nTHead,l=e.nTFoot,u=0===t("th, td",s).length,c=e.oClasses,f=e.aoColumns;u&&(o=t("<tr/>").appendTo(s));for(n=0,r=f.length;r>n;n++){a=f[n];i=t(a.nTh).addClass(a.sClass);u&&i.appendTo(o);if(e.oFeatures.bSort){i.addClass(a.sSortingClass);if(a.bSortable!==!1){i.attr("tabindex",e.iTabIndex).attr("aria-controls",e.sTableId);Ae(e,a.nTh,n)}}a.sTitle!=i.html()&&i.html(a.sTitle);Ue(e,"header")(e,i,a,c)}u&&z(e.aoHeader,s);t(s).find(">tr").attr("role","row");t(s).find(">tr>th, >tr>td").addClass(c.sHeaderTH);t(l).find(">tr>th, >tr>td").addClass(c.sFooterTH);if(null!==l){var h=e.aoFooter[0];for(n=0,r=h.length;r>n;n++){a=f[n];a.nTf=h[n].cell;a.sClass&&t(a.nTf).addClass(a.sClass)}}}function O(e,n,r){var i,a,s,l,u,c,f,h,d,p=[],g=[],m=e.aoColumns.length;if(n){r===o&&(r=!1);for(i=0,a=n.length;a>i;i++){p[i]=n[i].slice();p[i].nTr=n[i].nTr;for(s=m-1;s>=0;s--)e.aoColumns[s].bVisible||r||p[i].splice(s,1);g.push([])}for(i=0,a=p.length;a>i;i++){f=p[i].nTr;if(f)for(;c=f.firstChild;)f.removeChild(c);for(s=0,l=p[i].length;l>s;s++){h=1;d=1;if(g[i][s]===o){f.appendChild(p[i][s].cell);g[i][s]=1;for(;p[i+h]!==o&&p[i][s].cell==p[i+h][s].cell;){g[i+h][s]=1;h++}for(;p[i][s+d]!==o&&p[i][s].cell==p[i][s+d].cell;){for(u=0;h>u;u++)g[i+u][s+d]=1;d++}t(p[i][s].cell).attr("rowspan",h).attr("colspan",d)}}}}}function R(e){var n=ze(e,"aoPreDrawCallback","preDraw",[e]);if(-1===t.inArray(!1,n)){var r=[],i=0,a=e.asStripeClasses,s=a.length,l=(e.aoOpenRows.length,e.oLanguage),u=e.iInitDisplayStart,c="ssp"==Be(e),f=e.aiDisplay;e.bDrawing=!0;if(u!==o&&-1!==u){e._iDisplayStart=c?u:u>=e.fnRecordsDisplay()?0:u;e.iInitDisplayStart=-1}var h=e._iDisplayStart,d=e.fnDisplayEnd();if(e.bDeferLoading){e.bDeferLoading=!1;e.iDraw++;pe(e,!1)}else if(c){if(!e.bDestroying&&!B(e))return}else e.iDraw++;if(0!==f.length)for(var p=c?0:h,g=c?e.aoData.length:d,v=p;g>v;v++){var y=f[v],b=e.aoData[y];null===b.nTr&&P(e,y);var x=b.nTr;if(0!==s){var w=a[i%s];if(b._sRowStripe!=w){t(x).removeClass(b._sRowStripe).addClass(w);b._sRowStripe=w}}ze(e,"aoRowCallback",null,[x,b._aData,i,v]);r.push(x);i++}else{var C=l.sZeroRecords;1==e.iDraw&&"ajax"==Be(e)?C=l.sLoadingRecords:l.sEmptyTable&&0===e.fnRecordsTotal()&&(C=l.sEmptyTable);r[0]=t("<tr/>",{"class":s?a[0]:""}).append(t("<td />",{valign:"top",colSpan:m(e),"class":e.oClasses.sRowEmpty}).html(C))[0]}ze(e,"aoHeaderCallback","header",[t(e.nTHead).children("tr")[0],L(e),h,d,f]);ze(e,"aoFooterCallback","footer",[t(e.nTFoot).children("tr")[0],L(e),h,d,f]);var S=t(e.nTBody);S.children().detach();S.append(t(r));ze(e,"aoDrawCallback","draw",[e]);e.bSorted=!1;e.bFiltered=!1;e.bDrawing=!1}else pe(e,!1)}function F(t,e){var n=t.oFeatures,r=n.bSort,i=n.bFilter;r&&Me(t);i?Y(t,t.oPreviousSearch):t.aiDisplay=t.aiDisplayMaster.slice();e!==!0&&(t._iDisplayStart=0);t._drawHold=e;R(t);t._drawHold=!1}function W(e){var n=e.oClasses,r=t(e.nTable),i=t("<div/>").insertBefore(r),o=e.oFeatures,a=t("<div/>",{id:e.sTableId+"_wrapper","class":n.sWrapper+(e.nTFoot?"":" "+n.sNoFooter)});e.nHolding=i[0];e.nTableWrapper=a[0];e.nTableReinsertBefore=e.nTable.nextSibling;for(var s,l,u,c,f,h,d=e.sDom.split(""),p=0;p<d.length;p++){s=null;l=d[p];if("<"==l){u=t("<div/>")[0];c=d[p+1];if("'"==c||'"'==c){f="";h=2;for(;d[p+h]!=c;){f+=d[p+h];h++}"H"==f?f=n.sJUIHeader:"F"==f&&(f=n.sJUIFooter);if(-1!=f.indexOf(".")){var g=f.split(".");u.id=g[0].substr(1,g[0].length-1);u.className=g[1]}else"#"==f.charAt(0)?u.id=f.substr(1,f.length-1):u.className=f;p+=h}a.append(u);a=t(u)}else if(">"==l)a=a.parent();else if("l"==l&&o.bPaginate&&o.bLengthChange)s=ce(e);else if("f"==l&&o.bFilter)s=$(e);else if("r"==l&&o.bProcessing)s=de(e);else if("t"==l)s=ge(e);else if("i"==l&&o.bInfo)s=ie(e);else if("p"==l&&o.bPaginate)s=fe(e);else if(0!==$e.ext.feature.length)for(var m=$e.ext.feature,v=0,y=m.length;y>v;v++)if(l==m[v].cFeature){s=m[v].fnInit(e);break}if(s){var b=e.aanFeatures;b[l]||(b[l]=[]);b[l].push(s);a.append(s)}}i.replaceWith(a)}function z(e,n){var r,i,o,a,s,l,u,c,f,h,d,p=t(n).children("tr"),g=function(t,e,n){for(var r=t[e];r[n];)n++;return n};e.splice(0,e.length);for(o=0,l=p.length;l>o;o++)e.push([]);for(o=0,l=p.length;l>o;o++){r=p[o];c=0;i=r.firstChild;for(;i;){if("TD"==i.nodeName.toUpperCase()||"TH"==i.nodeName.toUpperCase()){f=1*i.getAttribute("colspan");h=1*i.getAttribute("rowspan");f=f&&0!==f&&1!==f?f:1;h=h&&0!==h&&1!==h?h:1;u=g(e,o,c);d=1===f?!0:!1;for(s=0;f>s;s++)for(a=0;h>a;a++){e[o+a][u+s]={cell:i,unique:d};e[o+a].nTr=r}}i=i.nextSibling}}}function q(t,e,n){var r=[];if(!n){n=t.aoHeader;if(e){n=[];z(n,e)}}for(var i=0,o=n.length;o>i;i++)for(var a=0,s=n[i].length;s>a;a++)!n[i][a].unique||r[a]&&t.bSortCellsTop||(r[a]=n[i][a].cell);return r}function U(e,n,r){ze(e,"aoServerParams","serverParams",[n]);if(n&&t.isArray(n)){var i={},o=/(.*?)\[\]$/;t.each(n,function(t,e){var n=e.name.match(o);if(n){var r=n[0];i[r]||(i[r]=[]);i[r].push(e.value)}else i[e.name]=e.value});n=i}var a,s=e.ajax,l=e.oInstance;if(t.isPlainObject(s)&&s.data){a=s.data;var u=t.isFunction(a)?a(n):a;n=t.isFunction(a)&&u?u:t.extend(!0,n,u);delete s.data}var c={data:n,success:function(t){var n=t.error||t.sError;n&&e.oApi._fnLog(e,0,n);e.json=t;ze(e,null,"xhr",[e,t]);r(t)},dataType:"json",cache:!1,type:e.sServerMethod,error:function(t,n){var r=e.oApi._fnLog;"parsererror"==n?r(e,0,"Invalid JSON response",1):4===t.readyState&&r(e,0,"Ajax error",7);pe(e,!1)}};e.oAjaxData=n;ze(e,null,"preXhr",[e,n]);if(e.fnServerData)e.fnServerData.call(l,e.sAjaxSource,t.map(n,function(t,e){return{name:e,value:t}}),r,e);else if(e.sAjaxSource||"string"==typeof s)e.jqXHR=t.ajax(t.extend(c,{url:s||e.sAjaxSource}));else if(t.isFunction(s))e.jqXHR=s.call(l,n,r,e);else{e.jqXHR=t.ajax(t.extend(c,s));s.data=a}}function B(t){if(t.bAjaxDataGet){t.iDraw++;pe(t,!0);U(t,V(t),function(e){X(t,e)});return!1}return!0}function V(e){var n,r,i,o,a=e.aoColumns,s=a.length,l=e.oFeatures,u=e.oPreviousSearch,c=e.aoPreSearchCols,f=[],h=_e(e),d=e._iDisplayStart,p=l.bPaginate!==!1?e._iDisplayLength:-1,g=function(t,e){f.push({name:t,value:e})};g("sEcho",e.iDraw);g("iColumns",s);g("sColumns",dn(a,"sName").join(","));g("iDisplayStart",d);g("iDisplayLength",p);var m={draw:e.iDraw,columns:[],order:[],start:d,length:p,search:{value:u.sSearch,regex:u.bRegex}};for(n=0;s>n;n++){i=a[n];o=c[n];r="function"==typeof i.mData?"function":i.mData;m.columns.push({data:r,name:i.sName,searchable:i.bSearchable,orderable:i.bSortable,search:{value:o.sSearch,regex:o.bRegex}});g("mDataProp_"+n,r);if(l.bFilter){g("sSearch_"+n,o.sSearch);g("bRegex_"+n,o.bRegex);g("bSearchable_"+n,i.bSearchable)}l.bSort&&g("bSortable_"+n,i.bSortable)}if(l.bFilter){g("sSearch",u.sSearch);g("bRegex",u.bRegex)}if(l.bSort){t.each(h,function(t,e){m.order.push({column:e.col,dir:e.dir});g("iSortCol_"+t,e.col);g("sSortDir_"+t,e.dir)});g("iSortingCols",h.length)}var v=$e.ext.legacy.ajax;return null===v?e.sAjaxSource?f:m:v?f:m}function X(t,e){var n=function(t,n){return e[t]!==o?e[t]:e[n]},r=n("sEcho","draw"),i=n("iTotalRecords","recordsTotal"),a=n("iTotalDisplayRecords","recordsFiltered");if(r){if(1*r<t.iDraw)return;t.iDraw=1*r}A(t);t._iRecordsTotal=parseInt(i,10);t._iRecordsDisplay=parseInt(a,10);for(var s=G(t,e),l=0,u=s.length;u>l;l++)x(t,s[l]);t.aiDisplay=t.aiDisplayMaster.slice();t.bAjaxDataGet=!1;R(t);t._bInitComplete||le(t,e);t.bAjaxDataGet=!0;pe(t,!1)}function G(e,n){var r=t.isPlainObject(e.ajax)&&e.ajax.dataSrc!==o?e.ajax.dataSrc:e.sAjaxDataProp;return"data"===r?n.aaData||n[r]:""!==r?M(r)(n):n}function $(e){var n=e.oClasses,r=e.sTableId,o=e.oLanguage,a=e.oPreviousSearch,s=e.aanFeatures,l='<input type="search" class="'+n.sFilterInput+'"/>',u=o.sSearch;u=u.match(/_INPUT_/)?u.replace("_INPUT_",l):u+l;var c=t("<div/>",{id:s.f?null:r+"_filter","class":n.sFilter}).append(t("<label/>").append(u)),f=function(){var t=(s.f,this.value?this.value:"");if(t!=a.sSearch){Y(e,{sSearch:t,bRegex:a.bRegex,bSmart:a.bSmart,bCaseInsensitive:a.bCaseInsensitive});e._iDisplayStart=0;R(e)}},h=t("input",c).val(a.sSearch).attr("placeholder",o.sSearchPlaceholder).bind("keyup.DT search.DT input.DT paste.DT cut.DT","ssp"===Be(e)?be(f,400):f).bind("keypress.DT",function(t){return 13==t.keyCode?!1:void 0}).attr("aria-controls",r);t(e.nTable).on("search.dt.DT",function(t,n){if(e===n)try{h[0]!==i.activeElement&&h.val(a.sSearch)}catch(r){}});return c[0]}function Y(t,e,n){var r=t.oPreviousSearch,i=t.aoPreSearchCols,a=function(t){r.sSearch=t.sSearch;r.bRegex=t.bRegex;r.bSmart=t.bSmart;r.bCaseInsensitive=t.bCaseInsensitive},s=function(t){return t.bEscapeRegex!==o?!t.bEscapeRegex:t.bRegex};y(t);if("ssp"!=Be(t)){Z(t,e.sSearch,n,s(e),e.bSmart,e.bCaseInsensitive);a(e);for(var l=0;l<i.length;l++)K(t,i[l].sSearch,l,s(i[l]),i[l].bSmart,i[l].bCaseInsensitive);J(t)}else a(e);t.bFiltered=!0;ze(t,null,"search",[t])}function J(t){for(var e,n,r=$e.ext.search,i=t.aiDisplay,o=0,a=r.length;a>o;o++){for(var s=[],l=0,u=i.length;u>l;l++){n=i[l];e=t.aoData[n];r[o](t,e._aFilterData,n,e._aData,l)&&s.push(n)}i.length=0;i.push.apply(i,s)}}function K(t,e,n,r,i,o){if(""!==e)for(var a,s=t.aiDisplay,l=Q(e,r,i,o),u=s.length-1;u>=0;u--){a=t.aoData[s[u]]._aFilterData[n];l.test(a)||s.splice(u,1)}}function Z(t,e,n,r,i,o){var a,s,l,u=Q(e,r,i,o),c=t.oPreviousSearch.sSearch,f=t.aiDisplayMaster;0!==$e.ext.search.length&&(n=!0);s=ee(t);if(e.length<=0)t.aiDisplay=f.slice();else{(s||n||c.length>e.length||0!==e.indexOf(c)||t.bSorted)&&(t.aiDisplay=f.slice());a=t.aiDisplay;for(l=a.length-1;l>=0;l--)u.test(t.aoData[a[l]]._sFilterRow)||a.splice(l,1)}}function Q(e,n,r,i){e=n?e:te(e);if(r){var o=t.map(e.match(/"[^"]+"|[^ ]+/g)||"",function(t){return'"'===t.charAt(0)?t.match(/^"(.*)"$/)[1]:t});e="^(?=.*?"+o.join(")(?=.*?")+").*$"}return new RegExp(e,i?"i":"")}function te(t){return t.replace(on,"\\$1")}function ee(t){var e,n,r,i,o,a,s,l,u=t.aoColumns,c=$e.ext.type.search,f=!1;for(n=0,i=t.aoData.length;i>n;n++){l=t.aoData[n];if(!l._aFilterData){a=[];for(r=0,o=u.length;o>r;r++){e=u[r];if(e.bSearchable){s=T(t,n,r,"filter");c[e.sType]&&(s=c[e.sType](s));null===s&&(s="");"string"!=typeof s&&s.toString&&(s=s.toString())}else s="";if(s.indexOf&&-1!==s.indexOf("&")){wn.innerHTML=s;s=Cn?wn.textContent:wn.innerText}s.replace&&(s=s.replace(/[\r\n]/g,""));a.push(s)}l._aFilterData=a;l._sFilterRow=a.join(" ");f=!0}}return f}function ne(t){return{search:t.sSearch,smart:t.bSmart,regex:t.bRegex,caseInsensitive:t.bCaseInsensitive}}function re(t){return{sSearch:t.search,bSmart:t.smart,bRegex:t.regex,bCaseInsensitive:t.caseInsensitive}}function ie(e){var n=e.sTableId,r=e.aanFeatures.i,i=t("<div/>",{"class":e.oClasses.sInfo,id:r?null:n+"_info"});if(!r){e.aoDrawCallback.push({fn:oe,sName:"information"});i.attr("role","status").attr("aria-live","polite");t(e.nTable).attr("aria-describedby",n+"_info")}return i[0]}function oe(e){var n=e.aanFeatures.i;if(0!==n.length){var r=e.oLanguage,i=e._iDisplayStart+1,o=e.fnDisplayEnd(),a=e.fnRecordsTotal(),s=e.fnRecordsDisplay(),l=s?r.sInfo:r.sInfoEmpty;s!==a&&(l+=" "+r.sInfoFiltered);l+=r.sInfoPostFix;l=ae(e,l);var u=r.fnInfoCallback;null!==u&&(l=u.call(e.oInstance,e,i,o,a,s,l));t(n).html(l)}}function ae(t,e){var n=t.fnFormatNumber,r=t._iDisplayStart+1,i=t._iDisplayLength,o=t.fnRecordsDisplay(),a=-1===i;return e.replace(/_START_/g,n.call(t,r)).replace(/_END_/g,n.call(t,t.fnDisplayEnd())).replace(/_MAX_/g,n.call(t,t.fnRecordsTotal())).replace(/_TOTAL_/g,n.call(t,o)).replace(/_PAGE_/g,n.call(t,a?1:Math.ceil(r/i))).replace(/_PAGES_/g,n.call(t,a?1:Math.ceil(o/i)))}function se(t){var e,n,r,i=t.iInitDisplayStart,o=t.aoColumns,a=t.oFeatures;if(t.bInitialised){W(t);H(t);O(t,t.aoHeader);O(t,t.aoFooter);pe(t,!0);a.bAutoWidth&&ye(t);for(e=0,n=o.length;n>e;e++){r=o[e];r.sWidth&&(r.nTh.style.width=Te(r.sWidth))}F(t);var s=Be(t);if("ssp"!=s)if("ajax"==s)U(t,[],function(n){var r=G(t,n);for(e=0;e<r.length;e++)x(t,r[e]);t.iInitDisplayStart=i;F(t);pe(t,!1);le(t,n)},t);else{pe(t,!1);le(t)}}else setTimeout(function(){se(t)},200)}function le(t,e){t._bInitComplete=!0;e&&d(t);ze(t,"aoInitComplete","init",[t,e])}function ue(t,e){var n=parseInt(e,10);t._iDisplayLength=n;qe(t);ze(t,null,"length",[t,n])}function ce(e){for(var n=e.oClasses,r=e.sTableId,i=e.aLengthMenu,o=t.isArray(i[0]),a=o?i[0]:i,s=o?i[1]:i,l=t("<select/>",{name:r+"_length","aria-controls":r,"class":n.sLengthSelect}),u=0,c=a.length;c>u;u++)l[0][u]=new Option(s[u],a[u]);var f=t("<div><label/></div>").addClass(n.sLength);e.aanFeatures.l||(f[0].id=r+"_length");f.children().append(e.oLanguage.sLengthMenu.replace("_MENU_",l[0].outerHTML));t("select",f).val(e._iDisplayLength).bind("change.DT",function(){ue(e,t(this).val());R(e)});t(e.nTable).bind("length.dt.DT",function(n,r,i){e===r&&t("select",f).val(i)});return f[0]}function fe(e){var n=e.sPaginationType,r=$e.ext.pager[n],i="function"==typeof r,o=function(t){R(t)},a=t("<div/>").addClass(e.oClasses.sPaging+n)[0],s=e.aanFeatures;i||r.fnInit(e,a,o);if(!s.p){a.id=e.sTableId+"_paginate";e.aoDrawCallback.push({fn:function(t){if(i){var e,n,a=t._iDisplayStart,l=t._iDisplayLength,u=t.fnRecordsDisplay(),c=-1===l,f=c?0:Math.ceil(a/l),h=c?1:Math.ceil(u/l),d=r(f,h);for(e=0,n=s.p.length;n>e;e++)Ue(t,"pageButton")(t,s.p[e],e,d,f,h)}else r.fnUpdate(t,o)},sName:"pagination"})}return a}function he(t,e,n){var r=t._iDisplayStart,i=t._iDisplayLength,o=t.fnRecordsDisplay();if(0===o||-1===i)r=0;else if("number"==typeof e){r=e*i;r>o&&(r=0)}else if("first"==e)r=0;else if("previous"==e){r=i>=0?r-i:0;0>r&&(r=0)}else"next"==e?o>r+i&&(r+=i):"last"==e?r=Math.floor((o-1)/i)*i:He(t,0,"Unknown paging action: "+e,5);var a=t._iDisplayStart!==r;t._iDisplayStart=r;if(a){ze(t,null,"page",[t]);n&&R(t)}return a}function de(e){return t("<div/>",{id:e.aanFeatures.r?null:e.sTableId+"_processing","class":e.oClasses.sProcessing}).html(e.oLanguage.sProcessing).insertBefore(e.nTable)[0]}function pe(e,n){e.oFeatures.bProcessing&&t(e.aanFeatures.r).css("display",n?"block":"none");ze(e,null,"processing",[e,n])}function ge(e){var n=t(e.nTable);n.attr("role","grid");var r=e.oScroll;if(""===r.sX&&""===r.sY)return e.nTable;var i=r.sX,o=r.sY,a=e.oClasses,s=n.children("caption"),l=s.length?s[0]._captionSide:null,u=t(n[0].cloneNode(!1)),c=t(n[0].cloneNode(!1)),f=n.children("tfoot"),h="<div/>",d=function(t){return t?Te(t):null};r.sX&&"100%"===n.attr("width")&&n.removeAttr("width");f.length||(f=null);var p=t(h,{"class":a.sScrollWrapper}).append(t(h,{"class":a.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:i?d(i):"100%"}).append(t(h,{"class":a.sScrollHeadInner}).css({"box-sizing":"content-box",width:r.sXInner||"100%"}).append(u.removeAttr("id").css("margin-left",0).append(n.children("thead")))).append("top"===l?s:null)).append(t(h,{"class":a.sScrollBody}).css({overflow:"auto",height:d(o),width:d(i)}).append(n));f&&p.append(t(h,{"class":a.sScrollFoot}).css({overflow:"hidden",border:0,width:i?d(i):"100%"}).append(t(h,{"class":a.sScrollFootInner}).append(c.removeAttr("id").css("margin-left",0).append(n.children("tfoot")))).append("bottom"===l?s:null));var g=p.children(),m=g[0],v=g[1],y=f?g[2]:null;i&&t(v).scroll(function(){var t=this.scrollLeft;m.scrollLeft=t;f&&(y.scrollLeft=t)});e.nScrollHead=m;e.nScrollBody=v;e.nScrollFoot=y;e.aoDrawCallback.push({fn:me,sName:"scrolling"});return p[0]}function me(e){var n,r,i,o,a,s,l,u,c,f=e.oScroll,h=f.sX,d=f.sXInner,g=f.sY,m=f.iBarWidth,v=t(e.nScrollHead),y=v[0].style,b=v.children("div"),x=b[0].style,w=b.children("table"),C=e.nScrollBody,S=t(C),T=C.style,k=t(e.nScrollFoot),_=k.children("div"),M=_.children("table"),D=t(e.nTHead),L=t(e.nTable),A=L[0],N=A.style,E=e.nTFoot?t(e.nTFoot):null,j=e.oBrowser,P=j.bScrollOversize,I=[],H=[],O=[],R=function(t){var e=t.style;e.paddingTop="0";e.paddingBottom="0";e.borderTopWidth="0";e.borderBottomWidth="0";e.height=0};L.children("thead, tfoot").remove();a=D.clone().prependTo(L);n=D.find("tr");i=a.find("tr");a.find("th, td").removeAttr("tabindex");if(E){s=E.clone().prependTo(L);r=E.find("tr");o=s.find("tr")}if(!h){T.width="100%";v[0].style.width="100%"}t.each(q(e,a),function(t,n){l=p(e,t);n.style.width=e.aoColumns[l].sWidth});E&&ve(function(t){t.style.width=""},o);f.bCollapse&&""!==g&&(T.height=S[0].offsetHeight+D[0].offsetHeight+"px");c=L.outerWidth();if(""===h){N.width="100%";P&&(L.find("tbody").height()>C.offsetHeight||"scroll"==S.css("overflow-y"))&&(N.width=Te(L.outerWidth()-m))}else if(""!==d)N.width=Te(d);else if(c==S.width()&&S.height()<L.height()){N.width=Te(c-m);L.outerWidth()>c-m&&(N.width=Te(c))}else N.width=Te(c);c=L.outerWidth();ve(R,i);ve(function(e){O.push(e.innerHTML);I.push(Te(t(e).css("width")))},i);ve(function(t,e){t.style.width=I[e]},n);t(i).height(0);if(E){ve(R,o);ve(function(e){H.push(Te(t(e).css("width")))},o);ve(function(t,e){t.style.width=H[e]},r);t(o).height(0)}ve(function(t,e){t.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+O[e]+"</div>";t.style.width=I[e]},i);E&&ve(function(t,e){t.innerHTML="";t.style.width=H[e]},o);if(L.outerWidth()<c){u=C.scrollHeight>C.offsetHeight||"scroll"==S.css("overflow-y")?c+m:c;P&&(C.scrollHeight>C.offsetHeight||"scroll"==S.css("overflow-y"))&&(N.width=Te(u-m));(""===h||""!==d)&&He(e,1,"Possible column misalignment",6)}else u="100%";T.width=Te(u);y.width=Te(u);E&&(e.nScrollFoot.style.width=Te(u));g||P&&(T.height=Te(A.offsetHeight+m));if(g&&f.bCollapse){T.height=Te(g);var F=h&&A.offsetWidth>C.offsetWidth?m:0;A.offsetHeight<C.offsetHeight&&(T.height=Te(A.offsetHeight+F))}var W=L.outerWidth();w[0].style.width=Te(W);x.width=Te(W);var z=L.height()>C.clientHeight||"scroll"==S.css("overflow-y"),U="padding"+(j.bScrollbarLeft?"Left":"Right");x[U]=z?m+"px":"0px";if(E){M[0].style.width=Te(W);_[0].style.width=Te(W);_[0].style[U]=z?m+"px":"0px"}S.scroll();!e.bSorted&&!e.bFiltered||e._drawHold||(C.scrollTop=0)}function ve(t,e,n){for(var r,i,o=0,a=0,s=e.length;s>a;){r=e[a].firstChild;i=n?n[a].firstChild:null;for(;r;){if(1===r.nodeType){n?t(r,i,o):t(r,o);o++}r=r.nextSibling;i=n?i.nextSibling:null}a++}}function ye(e){var r,i,o,a,s,l=e.nTable,u=e.aoColumns,c=e.oScroll,f=c.sY,h=c.sX,p=c.sXInner,g=u.length,y=v(e,"bVisible"),b=t("th",e.nTHead),x=l.getAttribute("width"),w=l.parentNode,C=!1;for(r=0;r<y.length;r++){i=u[y[r]];if(null!==i.sWidth){i.sWidth=xe(i.sWidthOrig,w);C=!0}}if(C||h||f||g!=m(e)||g!=b.length){var S=t(l).clone().empty().css("visibility","hidden").removeAttr("id").append(t(e.nTHead).clone(!1)).append(t(e.nTFoot).clone(!1)).append(t("<tbody><tr/></tbody>"));S.find("tfoot th, tfoot td").css("width","");var T=S.find("tbody tr");b=q(e,S.find("thead")[0]);for(r=0;r<y.length;r++){i=u[y[r]];b[r].style.width=null!==i.sWidthOrig&&""!==i.sWidthOrig?Te(i.sWidthOrig):""}if(e.aoData.length)for(r=0;r<y.length;r++){o=y[r];i=u[o];t(Ce(e,o)).clone(!1).append(i.sContentPadding).appendTo(T)}S.appendTo(w);if(h&&p)S.width(p);else if(h){S.css("width","auto");S.width()<w.offsetWidth&&S.width(w.offsetWidth)}else f?S.width(w.offsetWidth):x&&S.width(x);we(e,S[0]);if(h){var k=0;for(r=0;r<y.length;r++){i=u[y[r]];s=t(b[r]).outerWidth();k+=null===i.sWidthOrig?s:parseInt(i.sWidth,10)+s-t(b[r]).width()}S.width(Te(k));l.style.width=Te(k)}for(r=0;r<y.length;r++){i=u[y[r]];a=t(b[r]).width();a&&(i.sWidth=Te(a))}l.style.width=Te(S.css("width"));S.remove()}else for(r=0;g>r;r++)u[r].sWidth=Te(b.eq(r).width());x&&(l.style.width=Te(x));if((x||h)&&!e._reszEvt){t(n).bind("resize.DT-"+e.sInstance,be(function(){d(e)}));e._reszEvt=!0}}function be(t,e){var n,r,i=e||200;return function(){var e=this,a=+new Date,s=arguments;if(n&&n+i>a){clearTimeout(r);r=setTimeout(function(){n=o;t.apply(e,s)},i)}else if(n){n=a;t.apply(e,s)}else n=a}}function xe(e,n){if(!e)return 0;var r=t("<div/>").css("width",Te(e)).appendTo(n||i.body),o=r[0].offsetWidth;r.remove();return o}function we(e,n){var r=e.oScroll;if(r.sX||r.sY){var i=r.sX?0:r.iBarWidth;n.style.width=Te(t(n).outerWidth()-i)}}function Ce(e,n){var r=Se(e,n);if(0>r)return null;var i=e.aoData[r];return i.nTr?i.anCells[n]:t("<td/>").html(T(e,r,n,"display"))[0]}function Se(t,e){for(var n,r=-1,i=-1,o=0,a=t.aoData.length;a>o;o++){n=T(t,o,e,"display")+"";n=n.replace(Sn,"");if(n.length>r){r=n.length;i=o}}return i}function Te(t){return null===t?"0px":"number"==typeof t?0>t?"0px":t+"px":t.match(/\d$/)?t+"px":t}function ke(){if(!$e.__scrollbarWidth){var e=t("<p/>").css({width:"100%",height:200,padding:0})[0],n=t("<div/>").css({position:"absolute",top:0,left:0,width:200,height:150,padding:0,overflow:"hidden",visibility:"hidden"}).append(e).appendTo("body"),r=e.offsetWidth;n.css("overflow","scroll");var i=e.offsetWidth;r===i&&(i=n[0].clientWidth);n.remove();$e.__scrollbarWidth=r-i}return $e.__scrollbarWidth}function _e(e){var n,r,i,o,a,s,l,u=[],c=e.aoColumns,f=e.aaSortingFixed,h=t.isPlainObject(f),d=[],p=function(e){e.length&&!t.isArray(e[0])?d.push(e):d.push.apply(d,e)};t.isArray(f)&&p(f);h&&f.pre&&p(f.pre);p(e.aaSorting);h&&f.post&&p(f.post);for(n=0;n<d.length;n++){l=d[n][0];o=c[l].aDataSort;for(r=0,i=o.length;i>r;r++){a=o[r];s=c[a].sType||"string";u.push({src:l,col:a,dir:d[n][1],index:d[n][2],type:s,formatter:$e.ext.type.order[s+"-pre"]})}}return u}function Me(t){var e,n,r,i,o,a=[],s=$e.ext.type.order,l=t.aoData,u=(t.aoColumns,0),c=t.aiDisplayMaster;y(t);o=_e(t);for(e=0,n=o.length;n>e;e++){i=o[e];i.formatter&&u++;Ee(t,i.col)}if("ssp"!=Be(t)&&0!==o.length){for(e=0,r=c.length;r>e;e++)a[c[e]]=e;c.sort(u===o.length?function(t,e){var n,r,i,s,u,c=o.length,f=l[t]._aSortData,h=l[e]._aSortData;for(i=0;c>i;i++){u=o[i];n=f[u.col];r=h[u.col];s=r>n?-1:n>r?1:0;if(0!==s)return"asc"===u.dir?s:-s}n=a[t];r=a[e];return r>n?-1:n>r?1:0}:function(t,e){var n,r,i,u,c,f,h=o.length,d=l[t]._aSortData,p=l[e]._aSortData;
for(i=0;h>i;i++){c=o[i];n=d[c.col];r=p[c.col];f=s[c.type+"-"+c.dir]||s["string-"+c.dir];u=f(n,r);if(0!==u)return u}n=a[t];r=a[e];return r>n?-1:n>r?1:0})}t.bSorted=!0}function De(t){for(var e,n,r=t.aoColumns,i=_e(t),o=t.oLanguage.oAria,a=0,s=r.length;s>a;a++){var l=r[a],u=l.asSorting,c=l.sTitle.replace(/<.*?>/g,""),f=l.nTh;f.removeAttribute("aria-sort");if(l.bSortable){if(i.length>0&&i[0].col==a){f.setAttribute("aria-sort","asc"==i[0].dir?"ascending":"descending");n=u[i[0].index+1]||u[0]}else n=u[0];e=c+("asc"===n?o.sSortAscending:o.sSortDescending)}else e=c;f.setAttribute("aria-label",e)}}function Le(e,n,r,i){var a,s=e.aoColumns[n],l=e.aaSorting,u=s.asSorting,c=function(e){var n=e._idx;n===o&&(n=t.inArray(e[1],u));return n+1>=u.length?0:n+1};"number"==typeof l[0]&&(l=e.aaSorting=[l]);if(r&&e.oFeatures.bSortMulti){var f=t.inArray(n,dn(l,"0"));if(-1!==f){a=c(l[f]);l[f][1]=u[a];l[f]._idx=a}else{l.push([n,u[0],0]);l[l.length-1]._idx=0}}else if(l.length&&l[0][0]==n){a=c(l[0]);l.length=1;l[0][1]=u[a];l[0]._idx=a}else{l.length=0;l.push([n,u[0]]);l[0]._idx=0}F(e);"function"==typeof i&&i(e)}function Ae(t,e,n,r){var i=t.aoColumns[n];Fe(e,{},function(e){if(i.bSortable!==!1)if(t.oFeatures.bProcessing){pe(t,!0);setTimeout(function(){Le(t,n,e.shiftKey,r);"ssp"!==Be(t)&&pe(t,!1)},0)}else Le(t,n,e.shiftKey,r)})}function Ne(e){var n,r,i,o=e.aLastSort,a=e.oClasses.sSortColumn,s=_e(e),l=e.oFeatures;if(l.bSort&&l.bSortClasses){for(n=0,r=o.length;r>n;n++){i=o[n].src;t(dn(e.aoData,"anCells",i)).removeClass(a+(2>n?n+1:3))}for(n=0,r=s.length;r>n;n++){i=s[n].src;t(dn(e.aoData,"anCells",i)).addClass(a+(2>n?n+1:3))}}e.aLastSort=s}function Ee(t,e){var n,r=t.aoColumns[e],i=$e.ext.order[r.sSortDataType];i&&(n=i.call(t.oInstance,t,e,g(t,e)));for(var o,a,s=$e.ext.type.order[r.sType+"-pre"],l=0,u=t.aoData.length;u>l;l++){o=t.aoData[l];o._aSortData||(o._aSortData=[]);if(!o._aSortData[e]||i){a=i?n[l]:T(t,l,e,"sort");o._aSortData[e]=s?s(a):a}}}function je(e){if(e.oFeatures.bStateSave&&!e.bDestroying){var n={time:+new Date,start:e._iDisplayStart,length:e._iDisplayLength,order:t.extend(!0,[],e.aaSorting),search:ne(e.oPreviousSearch),columns:t.map(e.aoColumns,function(t,n){return{visible:t.bVisible,search:ne(e.aoPreSearchCols[n])}})};ze(e,"aoStateSaveParams","stateSaveParams",[e,n]);e.oSavedState=n;e.fnStateSaveCallback.call(e.oInstance,e,n)}}function Pe(e){var n,r,i=e.aoColumns;if(e.oFeatures.bStateSave){var o=e.fnStateLoadCallback.call(e.oInstance,e);if(o&&o.time){var a=ze(e,"aoStateLoadParams","stateLoadParams",[e,o]);if(-1===t.inArray(!1,a)){var s=e.iStateDuration;if(!(s>0&&o.time<+new Date-1e3*s)&&i.length===o.columns.length){e.oLoadedState=t.extend(!0,{},o);e._iDisplayStart=o.start;e.iInitDisplayStart=o.start;e._iDisplayLength=o.length;e.aaSorting=[];t.each(o.order,function(t,n){e.aaSorting.push(n[0]>=i.length?[0,n[1]]:n)});t.extend(e.oPreviousSearch,re(o.search));for(n=0,r=o.columns.length;r>n;n++){var l=o.columns[n];i[n].bVisible=l.visible;t.extend(e.aoPreSearchCols[n],re(l.search))}ze(e,"aoStateLoaded","stateLoaded",[e,o])}}}}}function Ie(e){var n=$e.settings,r=t.inArray(e,dn(n,"nTable"));return-1!==r?n[r]:null}function He(t,e,r,i){r="DataTables warning: "+(null!==t?"table id="+t.sTableId+" - ":"")+r;i&&(r+=". For more information about this error, please see http://datatables.net/tn/"+i);if(e)n.console&&console.log&&console.log(r);else{var o=$e.ext,a=o.sErrMode||o.errMode;if("alert"!=a)throw new Error(r);alert(r)}}function Oe(e,n,r,i){if(t.isArray(r))t.each(r,function(r,i){t.isArray(i)?Oe(e,n,i[0],i[1]):Oe(e,n,i)});else{i===o&&(i=r);n[r]!==o&&(e[i]=n[r])}}function Re(e,n,r){var i;for(var o in n)if(n.hasOwnProperty(o)){i=n[o];if(t.isPlainObject(i)){t.isPlainObject(e[o])||(e[o]={});t.extend(!0,e[o],i)}else e[o]=r&&"data"!==o&&"aaData"!==o&&t.isArray(i)?i.slice():i}return e}function Fe(e,n,r){t(e).bind("click.DT",n,function(t){e.blur();r(t)}).bind("keypress.DT",n,function(t){if(13===t.which){t.preventDefault();r(t)}}).bind("selectstart.DT",function(){return!1})}function We(t,e,n,r){n&&t[e].push({fn:n,sName:r})}function ze(e,n,r,i){var o=[];n&&(o=t.map(e[n].slice().reverse(),function(t){return t.fn.apply(e.oInstance,i)}));null!==r&&t(e.nTable).trigger(r+".dt",i);return o}function qe(t){var e=t._iDisplayStart,n=t.fnDisplayEnd(),r=t._iDisplayLength;n===t.fnRecordsDisplay()&&(e=n-r);(-1===r||0>e)&&(e=0);t._iDisplayStart=e}function Ue(e,n){var r=e.renderer,i=$e.ext.renderer[n];return t.isPlainObject(r)&&r[n]?i[r[n]]||i._:"string"==typeof r?i[r]||i._:i._}function Be(t){return t.oFeatures.bServerSide?"ssp":t.ajax||t.sAjaxSource?"ajax":"dom"}function Ve(t,e){var n=[],r=Vn.numbers_length,i=Math.floor(r/2);if(r>=e)n=gn(0,e);else if(i>=t){n=gn(0,r-2);n.push("ellipsis");n.push(e-1)}else if(t>=e-1-i){n=gn(e-(r-2),e);n.splice(0,0,"ellipsis");n.splice(0,0,0)}else{n=gn(t-1,t+2);n.push("ellipsis");n.push(e-1);n.splice(0,0,"ellipsis");n.splice(0,0,0)}n.DT_el="span";return n}function Xe(e){t.each({num:function(t){return Xn(t,e)},"num-fmt":function(t){return Xn(t,e,an)},"html-num":function(t){return Xn(t,e,en)},"html-num-fmt":function(t){return Xn(t,e,en,an)}},function(t,n){Ye.type.order[t+e+"-pre"]=n})}function Ge(t){return function(){var e=[Ie(this[$e.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return $e.ext.internal[t].apply(this,e)}}var $e,Ye,Je,Ke,Ze,Qe={},tn=/[\r\n]/g,en=/<.*?>/g,nn=/^[\w\+\-]/,rn=/[\w\+\-]$/,on=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\","$","^","-"].join("|\\")+")","g"),an=/[',$£€¥%\u2009\u202F]/g,sn=function(t){return t&&t!==!0&&"-"!==t?!1:!0},ln=function(t){var e=parseInt(t,10);return!isNaN(e)&&isFinite(t)?e:null},un=function(t,e){Qe[e]||(Qe[e]=new RegExp(te(e),"g"));return"string"==typeof t?t.replace(/\./g,"").replace(Qe[e],"."):t},cn=function(t,e,n){var r="string"==typeof t;e&&r&&(t=un(t,e));n&&r&&(t=t.replace(an,""));return sn(t)||!isNaN(parseFloat(t))&&isFinite(t)},fn=function(t){return sn(t)||"string"==typeof t},hn=function(t,e,n){if(sn(t))return!0;var r=fn(t);return r&&cn(mn(t),e,n)?!0:null},dn=function(t,e,n){var r=[],i=0,a=t.length;if(n!==o)for(;a>i;i++)t[i]&&t[i][e]&&r.push(t[i][e][n]);else for(;a>i;i++)t[i]&&r.push(t[i][e]);return r},pn=function(t,e,n,r){var i=[],a=0,s=e.length;if(r!==o)for(;s>a;a++)i.push(t[e[a]][n][r]);else for(;s>a;a++)i.push(t[e[a]][n]);return i},gn=function(t,e){var n,r=[];if(e===o){e=0;n=t}else{n=e;e=t}for(var i=e;n>i;i++)r.push(i);return r},mn=function(t){return t.replace(en,"")},vn=function(t){var e,n,r,i=[],o=t.length,a=0;t:for(n=0;o>n;n++){e=t[n];for(r=0;a>r;r++)if(i[r]===e)continue t;i.push(e);a++}return i},yn=function(t,e,n){t[e]!==o&&(t[n]=t[e])},bn=/\[.*?\]$/,xn=/\(\)$/,wn=t("<div>")[0],Cn=wn.textContent!==o,Sn=/<.*?>/g;$e=function(e){this.$=function(t,e){return this.api(!0).$(t,e)};this._=function(t,e){return this.api(!0).rows(t,e).data()};this.api=function(t){return new Je(t?Ie(this[Ye.iApiIndex]):this)};this.fnAddData=function(e,n){var r=this.api(!0),i=t.isArray(e)&&(t.isArray(e[0])||t.isPlainObject(e[0]))?r.rows.add(e):r.row.add(e);(n===o||n)&&r.draw();return i.flatten().toArray()};this.fnAdjustColumnSizing=function(t){var e=this.api(!0).columns.adjust(),n=e.settings()[0],r=n.oScroll;t===o||t?e.draw(!1):(""!==r.sX||""!==r.sY)&&me(n)};this.fnClearTable=function(t){var e=this.api(!0).clear();(t===o||t)&&e.draw()};this.fnClose=function(t){this.api(!0).row(t).child.hide()};this.fnDeleteRow=function(t,e,n){var r=this.api(!0),i=r.rows(t),a=i.settings()[0],s=a.aoData[i[0][0]];i.remove();e&&e.call(this,a,s);(n===o||n)&&r.draw();return s};this.fnDestroy=function(t){this.api(!0).destroy(t)};this.fnDraw=function(t){this.api(!0).draw(!t)};this.fnFilter=function(t,e,n,r,i,a){var s=this.api(!0);null===e||e===o?s.search(t,n,r,a):s.column(e).search(t,n,r,a);s.draw()};this.fnGetData=function(t,e){var n=this.api(!0);if(t!==o){var r=t.nodeName?t.nodeName.toLowerCase():"";return e!==o||"td"==r||"th"==r?n.cell(t,e).data():n.row(t).data()||null}return n.data().toArray()};this.fnGetNodes=function(t){var e=this.api(!0);return t!==o?e.row(t).node():e.rows().nodes().flatten().toArray()};this.fnGetPosition=function(t){var e=this.api(!0),n=t.nodeName.toUpperCase();if("TR"==n)return e.row(t).index();if("TD"==n||"TH"==n){var r=e.cell(t).index();return[r.row,r.columnVisible,r.column]}return null};this.fnIsOpen=function(t){return this.api(!0).row(t).child.isShown()};this.fnOpen=function(t,e,n){return this.api(!0).row(t).child(e,n).show().child()[0]};this.fnPageChange=function(t,e){var n=this.api(!0).page(t);(e===o||e)&&n.draw(!1)};this.fnSetColumnVis=function(t,e,n){var r=this.api(!0).column(t).visible(e);(n===o||n)&&r.columns.adjust().draw()};this.fnSettings=function(){return Ie(this[Ye.iApiIndex])};this.fnSort=function(t){this.api(!0).order(t).draw()};this.fnSortListener=function(t,e,n){this.api(!0).order.listener(t,e,n)};this.fnUpdate=function(t,e,n,r,i){var a=this.api(!0);n===o||null===n?a.row(e).data(t):a.cell(e,n).data(t);(i===o||i)&&a.columns.adjust();(r===o||r)&&a.draw();return 0};this.fnVersionCheck=Ye.fnVersionCheck;var n=this,i=e===o,c=this.length;i&&(e={});this.oApi=this.internal=Ye.internal;for(var d in $e.ext.internal)d&&(this[d]=Ge(d));this.each(function(){var d,p={},g=c>1?Re(p,e,!0):e,m=0,v=this.getAttribute("id"),y=!1,C=$e.defaults;if("table"==this.nodeName.toLowerCase()){s(C);l(C.column);r(C,C,!0);r(C.column,C.column,!0);r(C,g);var S=$e.settings;for(m=0,d=S.length;d>m;m++){if(S[m].nTable==this){var T=g.bRetrieve!==o?g.bRetrieve:C.bRetrieve,k=g.bDestroy!==o?g.bDestroy:C.bDestroy;if(i||T)return S[m].oInstance;if(k){S[m].oInstance.fnDestroy();break}He(S[m],0,"Cannot reinitialise DataTable",3);return}if(S[m].sTableId==this.id){S.splice(m,1);break}}if(null===v||""===v){v="DataTables_Table_"+$e.ext._unique++;this.id=v}var _=t.extend(!0,{},$e.models.oSettings,{nTable:this,oApi:n.internal,oInit:g,sDestroyWidth:t(this)[0].style.width,sInstance:v,sTableId:v});S.push(_);_.oInstance=1===n.length?n:t(this).dataTable();s(g);g.oLanguage&&a(g.oLanguage);g.aLengthMenu&&!g.iDisplayLength&&(g.iDisplayLength=t.isArray(g.aLengthMenu[0])?g.aLengthMenu[0][0]:g.aLengthMenu[0]);g=Re(t.extend(!0,{},C),g);Oe(_.oFeatures,g,["bPaginate","bLengthChange","bFilter","bSort","bSortMulti","bInfo","bProcessing","bAutoWidth","bSortClasses","bServerSide","bDeferRender"]);Oe(_,g,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"],["bJQueryUI","bJUI"]]);Oe(_.oScroll,g,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]);Oe(_.oLanguage,g,"fnInfoCallback");We(_,"aoDrawCallback",g.fnDrawCallback,"user");We(_,"aoServerParams",g.fnServerParams,"user");We(_,"aoStateSaveParams",g.fnStateSaveParams,"user");We(_,"aoStateLoadParams",g.fnStateLoadParams,"user");We(_,"aoStateLoaded",g.fnStateLoaded,"user");We(_,"aoRowCallback",g.fnRowCallback,"user");We(_,"aoRowCreatedCallback",g.fnCreatedRow,"user");We(_,"aoHeaderCallback",g.fnHeaderCallback,"user");We(_,"aoFooterCallback",g.fnFooterCallback,"user");We(_,"aoInitComplete",g.fnInitComplete,"user");We(_,"aoPreDrawCallback",g.fnPreDrawCallback,"user");var M=_.oClasses;if(g.bJQueryUI){t.extend(M,$e.ext.oJUIClasses,g.oClasses);g.sDom===C.sDom&&"lfrtip"===C.sDom&&(_.sDom='<"H"lfr>t<"F"ip>');_.renderer?t.isPlainObject(_.renderer)&&!_.renderer.header&&(_.renderer.header="jqueryui"):_.renderer="jqueryui"}else t.extend(M,$e.ext.classes,g.oClasses);t(this).addClass(M.sTable);(""!==_.oScroll.sX||""!==_.oScroll.sY)&&(_.oScroll.iBarWidth=ke());_.oScroll.sX===!0&&(_.oScroll.sX="100%");if(_.iInitDisplayStart===o){_.iInitDisplayStart=g.iDisplayStart;_._iDisplayStart=g.iDisplayStart}if(null!==g.iDeferLoading){_.bDeferLoading=!0;var D=t.isArray(g.iDeferLoading);_._iRecordsDisplay=D?g.iDeferLoading[0]:g.iDeferLoading;_._iRecordsTotal=D?g.iDeferLoading[1]:g.iDeferLoading}if(""!==g.oLanguage.sUrl){_.oLanguage.sUrl=g.oLanguage.sUrl;t.getJSON(_.oLanguage.sUrl,null,function(e){a(e);r(C.oLanguage,e);t.extend(!0,_.oLanguage,g.oLanguage,e);se(_)});y=!0}else t.extend(!0,_.oLanguage,g.oLanguage);null===g.asStripeClasses&&(_.asStripeClasses=[M.sStripeOdd,M.sStripeEven]);var L=_.asStripeClasses,A=t("tbody tr:eq(0)",this);if(-1!==t.inArray(!0,t.map(L,function(t){return A.hasClass(t)}))){t("tbody tr",this).removeClass(L.join(" "));_.asDestroyStripes=L.slice()}var N,E=[],P=this.getElementsByTagName("thead");if(0!==P.length){z(_.aoHeader,P[0]);E=q(_)}if(null===g.aoColumns){N=[];for(m=0,d=E.length;d>m;m++)N.push(null)}else N=g.aoColumns;for(m=0,d=N.length;d>m;m++)f(_,E?E[m]:null);b(_,g.aoColumnDefs,N,function(t,e){h(_,t,e)});if(A.length){var I=function(t,e){return t.getAttribute("data-"+e)?e:null};t.each(j(_,A[0]).cells,function(t,e){var n=_.aoColumns[t];if(n.mData===t){var r=I(e,"sort")||I(e,"order"),i=I(e,"filter")||I(e,"search");if(null!==r||null!==i){n.mData={_:t+".display",sort:null!==r?t+".@data-"+r:o,type:null!==r?t+".@data-"+r:o,filter:null!==i?t+".@data-"+i:o};h(_,t)}}})}var H=_.oFeatures;if(g.bStateSave){H.bStateSave=!0;Pe(_,g);We(_,"aoDrawCallback",je,"state_save")}if(g.aaSorting===o){var O=_.aaSorting;for(m=0,d=O.length;d>m;m++)O[m][1]=_.aoColumns[m].asSorting[0]}Ne(_);H.bSort&&We(_,"aoDrawCallback",function(){if(_.bSorted){var e=_e(_),n={};t.each(e,function(t,e){n[e.src]=e.dir});ze(_,null,"order",[_,e,n]);De(_)}});We(_,"aoDrawCallback",function(){(_.bSorted||"ssp"===Be(_)||H.bDeferRender)&&Ne(_)},"sc");u(_);var R=t(this).children("caption").each(function(){this._captionSide=t(this).css("caption-side")}),F=t(this).children("thead");0===F.length&&(F=t("<thead/>").appendTo(this));_.nTHead=F[0];var W=t(this).children("tbody");0===W.length&&(W=t("<tbody/>").appendTo(this));_.nTBody=W[0];var U=t(this).children("tfoot");0===U.length&&R.length>0&&(""!==_.oScroll.sX||""!==_.oScroll.sY)&&(U=t("<tfoot/>").appendTo(this));if(0===U.length||0===U.children().length)t(this).addClass(M.sNoFooter);else if(U.length>0){_.nTFoot=U[0];z(_.aoFooter,_.nTFoot)}if(g.aaData)for(m=0;m<g.aaData.length;m++)x(_,g.aaData[m]);else(_.bDeferLoading||"dom"==Be(_))&&w(_,t(_.nTBody).children("tr"));_.aiDisplay=_.aiDisplayMaster.slice();_.bInitialised=!0;y===!1&&se(_)}else He(null,0,"Non-table node initialisation ("+this.nodeName+")",2)});n=null;return this};var Tn=[],kn=Array.prototype,_n=function(e){var n,r,i=$e.settings,o=t.map(i,function(t){return t.nTable});if(!e)return[];if(e.nTable&&e.oApi)return[e];if(e.nodeName&&"table"===e.nodeName.toLowerCase()){n=t.inArray(e,o);return-1!==n?[i[n]]:null}if(e&&"function"==typeof e.settings)return e.settings().toArray();"string"==typeof e?r=t(e):e instanceof t&&(r=e);return r?r.map(function(){n=t.inArray(this,o);return-1!==n?i[n]:null}).toArray():void 0};Je=function(e,n){if(!this instanceof Je)throw"DT API must be constructed as a new object";var r=[],i=function(t){var e=_n(t);e&&r.push.apply(r,e)};if(t.isArray(e))for(var o=0,a=e.length;a>o;o++)i(e[o]);else i(e);this.context=vn(r);n&&this.push.apply(this,n.toArray?n.toArray():n);this.selector={rows:null,cols:null,opts:null};Je.extend(this,this,Tn)};$e.Api=Je;Je.prototype={concat:kn.concat,context:[],each:function(t){for(var e=0,n=this.length;n>e;e++)t.call(this,this[e],e,this);return this},eq:function(t){var e=this.context;return e.length>t?new Je(e[t],this[t]):null},filter:function(t){var e=[];if(kn.filter)e=kn.filter.call(this,t,this);else for(var n=0,r=this.length;r>n;n++)t.call(this,this[n],n,this)&&e.push(this[n]);return new Je(this.context,e)},flatten:function(){var t=[];return new Je(this.context,t.concat.apply(t,this.toArray()))},join:kn.join,indexOf:kn.indexOf||function(t,e){for(var n=e||0,r=this.length;r>n;n++)if(this[n]===t)return n;return-1},iterator:function(t,e,n){var r,i,a,s,l,u,c,f,h=[],d=this.context,p=this.selector;if("string"==typeof t){n=e;e=t;t=!1}for(i=0,a=d.length;a>i;i++)if("table"===e){r=n(d[i],i);r!==o&&h.push(r)}else if("columns"===e||"rows"===e){r=n(d[i],this[i],i);r!==o&&h.push(r)}else if("column"===e||"column-rows"===e||"row"===e||"cell"===e){c=this[i];"column-rows"===e&&(u=En(d[i],p.opts));for(s=0,l=c.length;l>s;s++){f=c[s];r="cell"===e?n(d[i],f.row,f.column,i,s):n(d[i],f,i,s,u);r!==o&&h.push(r)}}if(h.length){var g=new Je(d,t?h.concat.apply([],h):h),m=g.selector;m.rows=p.rows;m.cols=p.cols;m.opts=p.opts;return g}return this},lastIndexOf:kn.lastIndexOf||function(){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,map:function(t){var e=[];if(kn.map)e=kn.map.call(this,t,this);else for(var n=0,r=this.length;r>n;n++)e.push(t.call(this,this[n],n));return new Je(this.context,e)},pluck:function(t){return this.map(function(e){return e[t]})},pop:kn.pop,push:kn.push,reduce:kn.reduce||function(t,e){return c(this,t,e,0,this.length,1)},reduceRight:kn.reduceRight||function(t,e){return c(this,t,e,this.length-1,-1,-1)},reverse:kn.reverse,selector:null,shift:kn.shift,sort:kn.sort,splice:kn.splice,toArray:function(){return kn.slice.call(this)},to$:function(){return t(this)},toJQuery:function(){return t(this)},unique:function(){return new Je(this.context,vn(this))},unshift:kn.unshift};Je.extend=function(e,n,r){if(n&&(n instanceof Je||n.__dt_wrapper)){var i,o,a,s=function(t,e,n){return function(){var r=e.apply(t,arguments);Je.extend(r,r,n.methodExt);return r}};for(i=0,o=r.length;o>i;i++){a=r[i];n[a.name]="function"==typeof a.val?s(e,a.val,a):t.isPlainObject(a.val)?{}:a.val;n[a.name].__dt_wrapper=!0;Je.extend(e,n[a.name],a.propExt)}}};Je.register=Ke=function(e,n){if(t.isArray(e))for(var r=0,i=e.length;i>r;r++)Je.register(e[r],n);else{var o,a,s,l,u=e.split("."),c=Tn,f=function(t,e){for(var n=0,r=t.length;r>n;n++)if(t[n].name===e)return t[n];return null};for(o=0,a=u.length;a>o;o++){l=-1!==u[o].indexOf("()");s=l?u[o].replace("()",""):u[o];var h=f(c,s);if(!h){h={name:s,val:{},methodExt:[],propExt:[]};c.push(h)}o===a-1?h.val=n:c=l?h.methodExt:h.propExt}}};Je.registerPlural=Ze=function(e,n,r){Je.register(e,r);Je.register(n,function(){var e=r.apply(this,arguments);return e===this?this:e instanceof Je?e.length?t.isArray(e[0])?new Je(e.context,e[0]):e[0]:o:e})};var Mn=function(e,n){if("number"==typeof e)return[n[e]];var r=t.map(n,function(t){return t.nTable});return t(r).filter(e).map(function(){var e=t.inArray(this,r);return n[e]}).toArray()};Ke("tables()",function(t){return t?new Je(Mn(t,this.context)):this});Ke("table()",function(t){var e=this.tables(t),n=e.context;return n.length?new Je(n[0]):e});Ze("tables().nodes()","table().node()",function(){return this.iterator("table",function(t){return t.nTable})});Ze("tables().body()","table().body()",function(){return this.iterator("table",function(t){return t.nTBody})});Ze("tables().header()","table().header()",function(){return this.iterator("table",function(t){return t.nTHead})});Ze("tables().footer()","table().footer()",function(){return this.iterator("table",function(t){return t.nTFoot})});Ze("tables().containers()","table().container()",function(){return this.iterator("table",function(t){return t.nTableWrapper})});Ke("draw()",function(t){return this.iterator("table",function(e){F(e,t===!1)})});Ke("page()",function(t){return t===o?this.page.info().page:this.iterator("table",function(e){he(e,t)})});Ke("page.info()",function(){if(0===this.context.length)return o;var t=this.context[0],e=t._iDisplayStart,n=t._iDisplayLength,r=t.fnRecordsDisplay(),i=-1===n;return{page:i?0:Math.floor(e/n),pages:i?1:Math.ceil(r/n),start:e,end:t.fnDisplayEnd(),length:n,recordsTotal:t.fnRecordsTotal(),recordsDisplay:r}});Ke("page.len()",function(t){return t===o?0!==this.context.length?this.context[0]._iDisplayLength:o:this.iterator("table",function(e){ue(e,t)})});var Dn=function(t,e,n){if("ssp"==Be(t))F(t,e);else{pe(t,!0);U(t,[],function(n){A(t);for(var r=G(t,n),i=0,o=r.length;o>i;i++)x(t,r[i]);F(t,e);pe(t,!1)})}if(n){var r=new Je(t);r.one("draw",function(){n(r.ajax.json())})}};Ke("ajax.json()",function(){var t=this.context;return t.length>0?t[0].json:void 0});Ke("ajax.params()",function(){var t=this.context;return t.length>0?t[0].oAjaxData:void 0});Ke("ajax.reload()",function(t,e){return this.iterator("table",function(n){Dn(n,e===!1,t)})});Ke("ajax.url()",function(e){var n=this.context;if(e===o){if(0===n.length)return o;n=n[0];return n.ajax?t.isPlainObject(n.ajax)?n.ajax.url:n.ajax:n.sAjaxSource}return this.iterator("table",function(n){t.isPlainObject(n.ajax)?n.ajax.url=e:n.ajax=e})});Ke("ajax.url().load()",function(t,e){return this.iterator("table",function(n){Dn(n,e===!1,t)})});var Ln=function(e,n){var r,i,a,s,l,u,c=[];e&&"string"!=typeof e&&e.length!==o||(e=[e]);for(a=0,s=e.length;s>a;a++){i=e[a]&&e[a].split?e[a].split(","):[e[a]];for(l=0,u=i.length;u>l;l++){r=n("string"==typeof i[l]?t.trim(i[l]):i[l]);r&&r.length&&c.push.apply(c,r)}}return c},An=function(t){t||(t={});t.filter&&!t.search&&(t.search=t.filter);return{search:t.search||"none",order:t.order||"current",page:t.page||"all"}},Nn=function(t){for(var e=0,n=t.length;n>e;e++)if(t[e].length>0){t[0]=t[e];t.length=1;t.context=[t.context[e]];return t}t.length=0;return t},En=function(e,n){var r,i,o,a=[],s=e.aiDisplay,l=e.aiDisplayMaster,u=n.search,c=n.order,f=n.page;if("ssp"==Be(e))return"removed"===u?[]:gn(0,l.length);if("current"==f)for(r=e._iDisplayStart,i=e.fnDisplayEnd();i>r;r++)a.push(s[r]);else if("current"==c||"applied"==c)a="none"==u?l.slice():"applied"==u?s.slice():t.map(l,function(e){return-1===t.inArray(e,s)?e:null});else if("index"==c||"original"==c)for(r=0,i=e.aoData.length;i>r;r++)if("none"==u)a.push(r);else{o=t.inArray(r,s);(-1===o&&"removed"==u||o>=0&&"applied"==u)&&a.push(r)}return a},jn=function(e,n,r){return Ln(n,function(n){var i=ln(n);if(null!==i&&!r)return[i];var o=En(e,r);if(null!==i&&-1!==t.inArray(i,o))return[i];if(!n)return o;for(var a=[],s=0,l=o.length;l>s;s++)a.push(e.aoData[o[s]].nTr);return n.nodeName&&-1!==t.inArray(n,a)?[n._DT_RowIndex]:t(a).filter(n).map(function(){return this._DT_RowIndex}).toArray()})};Ke("rows()",function(e,n){if(e===o)e="";else if(t.isPlainObject(e)){n=e;e=""}n=An(n);var r=this.iterator("table",function(t){return jn(t,e,n)});r.selector.rows=e;r.selector.opts=n;return r});Ke("rows().nodes()",function(){return this.iterator("row",function(t,e){return t.aoData[e].nTr||o})});Ke("rows().data()",function(){return this.iterator(!0,"rows",function(t,e){return pn(t.aoData,e,"_aData")})});Ze("rows().cache()","row().cache()",function(t){return this.iterator("row",function(e,n){var r=e.aoData[n];return"search"===t?r._aFilterData:r._aSortData})});Ze("rows().invalidate()","row().invalidate()",function(t){return this.iterator("row",function(e,n){E(e,n,t)})});Ze("rows().indexes()","row().index()",function(){return this.iterator("row",function(t,e){return e})});Ze("rows().remove()","row().remove()",function(){var e=this;return this.iterator("row",function(n,r,i){var o=n.aoData;o.splice(r,1);for(var a=0,s=o.length;s>a;a++)null!==o[a].nTr&&(o[a].nTr._DT_RowIndex=a);t.inArray(r,n.aiDisplay);N(n.aiDisplayMaster,r);N(n.aiDisplay,r);N(e[i],r,!1);qe(n)})});Ke("rows.add()",function(t){var e=this.iterator("table",function(e){var n,r,i,o=[];for(r=0,i=t.length;i>r;r++){n=t[r];o.push(n.nodeName&&"TR"===n.nodeName.toUpperCase()?w(e,n)[0]:x(e,n))}return o}),n=this.rows(-1);n.pop();n.push.apply(n,e.toArray());return n});Ke("row()",function(t,e){return Nn(this.rows(t,e))});Ke("row().data()",function(t){var e=this.context;if(t===o)return e.length&&this.length?e[0].aoData[this[0]]._aData:o;e[0].aoData[this[0]]._aData=t;E(e[0],this[0],"data");return this});Ke("row().node()",function(){var t=this.context;return t.length&&this.length?t[0].aoData[this[0]].nTr||null:null});Ke("row.add()",function(e){e instanceof t&&e.length&&(e=e[0]);var n=this.iterator("table",function(t){return e.nodeName&&"TR"===e.nodeName.toUpperCase()?w(t,e)[0]:x(t,e)});return this.row(n[0])});var Pn=function(e,n,r,i){var o=[],a=function(n,r){if(n.nodeName&&"tr"===n.nodeName.toLowerCase())o.push(n);else{var i=t("<tr><td/></tr>").addClass(r);t("td",i).addClass(r).html(n)[0].colSpan=m(e);o.push(i[0])}};if(t.isArray(r)||r instanceof t)for(var s=0,l=r.length;l>s;s++)a(r[s],i);else a(r,i);n._details&&n._details.remove();n._details=t(o);n._detailsShow&&n._details.insertAfter(n.nTr)},In=function(t){var e=t.context;if(e.length&&t.length){var n=e[0].aoData[t[0]];if(n._details){n._details.remove();n._detailsShow=o;n._details=o}}},Hn=function(t,e){var n=t.context;if(n.length&&t.length){var r=n[0].aoData[t[0]];if(r._details){r._detailsShow=e;e?r._details.insertAfter(r.nTr):r._details.detach();On(n[0])}}},On=function(t){var e=new Je(t),n=".dt.DT_details",r="draw"+n,i="column-visibility"+n,o="destroy"+n,a=t.aoData;e.off(r+" "+i+" "+o);if(dn(a,"_details").length>0){e.on(r,function(n,r){t===r&&e.rows({page:"current"}).eq(0).each(function(t){var e=a[t];e._detailsShow&&e._details.insertAfter(e.nTr)})});e.on(i,function(e,n){if(t===n)for(var r,i=m(n),o=0,s=a.length;s>o;o++){r=a[o];r._details&&r._details.children("td[colspan]").attr("colspan",i)}});e.on(o,function(e,n){if(t===n)for(var r=0,i=a.length;i>r;r++)a[r]._details&&In(a[r])})}},Rn="",Fn=Rn+"row().child",Wn=Fn+"()";Ke(Wn,function(t,e){var n=this.context;if(t===o)return n.length&&this.length?n[0].aoData[this[0]]._details:o;t===!0?this.child.show():t===!1?In(this):n.length&&this.length&&Pn(n[0],n[0].aoData[this[0]],t,e);return this});Ke([Fn+".show()",Wn+".show()"],function(){Hn(this,!0);return this});Ke([Fn+".hide()",Wn+".hide()"],function(){Hn(this,!1);return this});Ke([Fn+".remove()",Wn+".remove()"],function(){In(this);return this});Ke(Fn+".isShown()",function(){var t=this.context;return t.length&&this.length?t[0].aoData[this[0]]._detailsShow||!1:!1});var zn=/^(.+):(name|visIdx|visible)$/,qn=function(e,n){var r=e.aoColumns,i=dn(r,"sName"),o=dn(r,"nTh");return Ln(n,function(n){var a=ln(n);if(""===n)return gn(r.length);if(null!==a)return[a>=0?a:r.length+a];var s="string"==typeof n?n.match(zn):"";if(!s)return t(o).filter(n).map(function(){return t.inArray(this,o)}).toArray();switch(s[2]){case"visIdx":case"visible":var l=parseInt(s[1],10);if(0>l){var u=t.map(r,function(t,e){return t.bVisible?e:null});return[u[u.length+l]]}return[p(e,l)];case"name":return t.map(i,function(t,e){return t===s[1]?e:null})}})},Un=function(e,n,r,i){var a,s,l,u,c=e.aoColumns,f=c[n],h=e.aoData;if(r===o)return f.bVisible;if(f.bVisible!==r){if(r){var p=t.inArray(!0,dn(c,"bVisible"),n+1);for(s=0,l=h.length;l>s;s++){u=h[s].nTr;a=h[s].anCells;u&&u.insertBefore(a[n],a[p]||null)}}else t(dn(e.aoData,"anCells",n)).detach();f.bVisible=r;O(e,e.aoHeader);O(e,e.aoFooter);if(i===o||i){d(e);(e.oScroll.sX||e.oScroll.sY)&&me(e)}ze(e,null,"column-visibility",[e,n,r]);je(e)}};Ke("columns()",function(e,n){if(e===o)e="";else if(t.isPlainObject(e)){n=e;e=""}n=An(n);var r=this.iterator("table",function(t){return qn(t,e,n)});r.selector.cols=e;r.selector.opts=n;return r});Ze("columns().header()","column().header()",function(){return this.iterator("column",function(t,e){return t.aoColumns[e].nTh})});Ze("columns().footer()","column().footer()",function(){return this.iterator("column",function(t,e){return t.aoColumns[e].nTf})});Ze("columns().data()","column().data()",function(){return this.iterator("column-rows",function(t,e,n,r,i){for(var o=[],a=0,s=i.length;s>a;a++)o.push(T(t,i[a],e,""));return o})});Ze("columns().cache()","column().cache()",function(t){return this.iterator("column-rows",function(e,n,r,i,o){return pn(e.aoData,o,"search"===t?"_aFilterData":"_aSortData",n)})});Ze("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(t,e,n,r,i){return pn(t.aoData,i,"anCells",e)})});Ze("columns().visible()","column().visible()",function(t,e){return this.iterator("column",function(n,r){return t===o?n.aoColumns[r].bVisible:Un(n,r,t,e)})});Ze("columns().indexes()","column().index()",function(t){return this.iterator("column",function(e,n){return"visible"===t?g(e,n):n})});Ke("columns.adjust()",function(){return this.iterator("table",function(t){d(t)})});Ke("column.index()",function(t,e){if(0!==this.context.length){var n=this.context[0];if("fromVisible"===t||"toData"===t)return p(n,e);if("fromData"===t||"toVisible"===t)return g(n,e)}});Ke("column()",function(t,e){return Nn(this.columns(t,e))});var Bn=function(e,n,r){var i,a,s,l,u,c=e.aoData,f=En(e,r),h=pn(c,f,"anCells"),d=t([].concat.apply([],h)),p=e.aoColumns.length;return Ln(n,function(e){if(null===e||e===o){a=[];for(s=0,l=f.length;l>s;s++){i=f[s];for(u=0;p>u;u++)a.push({row:i,column:u})}return a}return t.isPlainObject(e)?[e]:d.filter(e).map(function(e,n){i=n.parentNode._DT_RowIndex;return{row:i,column:t.inArray(n,c[i].anCells)}}).toArray()})};Ke("cells()",function(e,n,r){if(t.isPlainObject(e))if(typeof e.row!==o){r=n;n=null}else{r=e;e=null}if(t.isPlainObject(n)){r=n;n=null}if(null===n||n===o)return this.iterator("table",function(t){return Bn(t,e,An(r))});var i,a,s,l,u,c=this.columns(n,r),f=this.rows(e,r),h=this.iterator("table",function(t,e){i=[];for(a=0,s=f[e].length;s>a;a++)for(l=0,u=c[e].length;u>l;l++)i.push({row:f[e][a],column:c[e][l]});return i});t.extend(h.selector,{cols:n,rows:e,opts:r});return h});Ze("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(t,e,n){return t.aoData[e].anCells[n]})});Ke("cells().data()",function(){return this.iterator("cell",function(t,e,n){return T(t,e,n)})});Ze("cells().cache()","cell().cache()",function(t){t="search"===t?"_aFilterData":"_aSortData";return this.iterator("cell",function(e,n,r){return e.aoData[n][t][r]})});Ze("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(t,e,n){return{row:e,column:n,columnVisible:g(t,n)}})});Ke(["cells().invalidate()","cell().invalidate()"],function(t){var e=this.selector;this.rows(e.rows,e.opts).invalidate(t);return this});Ke("cell()",function(t,e,n){return Nn(this.cells(t,e,n))});Ke("cell().data()",function(t){var e=this.context,n=this[0];if(t===o)return e.length&&n.length?T(e[0],n[0].row,n[0].column):o;k(e[0],n[0].row,n[0].column,t);E(e[0],n[0].row,"data",n[0].column);return this});Ke("order()",function(e,n){var r=this.context;if(e===o)return 0!==r.length?r[0].aaSorting:o;"number"==typeof e?e=[[e,n]]:t.isArray(e[0])||(e=Array.prototype.slice.call(arguments));return this.iterator("table",function(t){t.aaSorting=e.slice()})});Ke("order.listener()",function(t,e,n){return this.iterator("table",function(r){Ae(r,t,e,n)})});Ke(["columns().order()","column().order()"],function(e){var n=this;return this.iterator("table",function(r,i){var o=[];t.each(n[i],function(t,n){o.push([n,e])});r.aaSorting=o})});Ke("search()",function(e,n,r,i){var a=this.context;return e===o?0!==a.length?a[0].oPreviousSearch.sSearch:o:this.iterator("table",function(o){o.oFeatures.bFilter&&Y(o,t.extend({},o.oPreviousSearch,{sSearch:e+"",bRegex:null===n?!1:n,bSmart:null===r?!0:r,bCaseInsensitive:null===i?!0:i}),1)})});Ze("columns().search()","column().search()",function(e,n,r,i){return this.iterator("column",function(a,s){var l=a.aoPreSearchCols;if(e===o)return l[s].sSearch;if(a.oFeatures.bFilter){t.extend(l[s],{sSearch:e+"",bRegex:null===n?!1:n,bSmart:null===r?!0:r,bCaseInsensitive:null===i?!0:i});Y(a,a.oPreviousSearch,1)}})});Ke("state()",function(){return this.context.length?this.context[0].oSavedState:null});Ke("state.clear()",function(){return this.iterator("table",function(t){t.fnStateSaveCallback.call(t.oInstance,t,{})})});Ke("state.loaded()",function(){return this.context.length?this.context[0].oLoadedState:null});Ke("state.save()",function(){return this.iterator("table",function(t){je(t)})});$e.versionCheck=$e.fnVersionCheck=function(t){for(var e,n,r=$e.version.split("."),i=t.split("."),o=0,a=i.length;a>o;o++){e=parseInt(r[o],10)||0;n=parseInt(i[o],10)||0;if(e!==n)return e>n}return!0};$e.isDataTable=$e.fnIsDataTable=function(e){var n=t(e).get(0),r=!1;
t.each($e.settings,function(t,e){(e.nTable===n||e.nScrollHead===n||e.nScrollFoot===n)&&(r=!0)});return r};$e.tables=$e.fnTables=function(e){return jQuery.map($e.settings,function(n){return!e||e&&t(n.nTable).is(":visible")?n.nTable:void 0})};$e.camelToHungarian=r;Ke("$()",function(e,n){var r=this.rows(n).nodes(),i=t(r);return t([].concat(i.filter(e).toArray(),i.find(e).toArray()))});t.each(["on","one","off"],function(e,n){Ke(n+"()",function(){var e=Array.prototype.slice.call(arguments);e[0].match(/\.dt\b/)||(e[0]+=".dt");var r=t(this.tables().nodes());r[n].apply(r,e);return this})});Ke("clear()",function(){return this.iterator("table",function(t){A(t)})});Ke("settings()",function(){return new Je(this.context,this.context)});Ke("data()",function(){return this.iterator("table",function(t){return dn(t.aoData,"_aData")}).flatten()});Ke("destroy()",function(e){e=e||!1;return this.iterator("table",function(r){var i,o=r.nTableWrapper.parentNode,a=r.oClasses,s=r.nTable,l=r.nTBody,u=r.nTHead,c=r.nTFoot,f=t(s),h=t(l),d=t(r.nTableWrapper),p=t.map(r.aoData,function(t){return t.nTr});r.bDestroying=!0;ze(r,"aoDestroyCallback","destroy",[r]);e||new Je(r).columns().visible(!0);d.unbind(".DT").find(":not(tbody *)").unbind(".DT");t(n).unbind(".DT-"+r.sInstance);if(s!=u.parentNode){f.children("thead").detach();f.append(u)}if(c&&s!=c.parentNode){f.children("tfoot").detach();f.append(c)}f.detach();d.detach();r.aaSorting=[];r.aaSortingFixed=[];Ne(r);t(p).removeClass(r.asStripeClasses.join(" "));t("th, td",u).removeClass(a.sSortable+" "+a.sSortableAsc+" "+a.sSortableDesc+" "+a.sSortableNone);if(r.bJUI){t("th span."+a.sSortIcon+", td span."+a.sSortIcon,u).detach();t("th, td",u).each(function(){var e=t("div."+a.sSortJUIWrapper,this);t(this).append(e.contents());e.detach()})}!e&&o&&o.insertBefore(s,r.nTableReinsertBefore);h.children().detach();h.append(p);f.css("width",r.sDestroyWidth).removeClass(a.sTable);i=r.asDestroyStripes.length;i&&h.children().each(function(e){t(this).addClass(r.asDestroyStripes[e%i])});var g=t.inArray(r,$e.settings);-1!==g&&$e.settings.splice(g,1)})});$e.version="1.10.2";$e.settings=[];$e.models={};$e.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};$e.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null};$e.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};$e.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(t){try{return JSON.parse((-1===t.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+t.sInstance+"_"+location.pathname))}catch(e){}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(t,e){try{(-1===t.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+t.sInstance+"_"+location.pathname,JSON.stringify(e))}catch(n){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:t.extend({},$e.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null};e($e.defaults);$e.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};e($e.defaults.column);$e.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:o,oAjaxData:o,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==Be(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==Be(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var t=this._iDisplayLength,e=this._iDisplayStart,n=e+t,r=this.aiDisplay.length,i=this.oFeatures,o=i.bPaginate;return i.bServerSide?o===!1||-1===t?e+r:Math.min(e+t,this._iRecordsDisplay):!o||n>r||-1===t?r:n},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{}};$e.ext=Ye={classes:{},errMode:"alert",feature:[],search:[],internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:$e.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:$e.version};t.extend(Ye,{afnFiltering:Ye.search,aTypes:Ye.type.detect,ofnSearch:Ye.type.search,oSort:Ye.type.order,afnSortData:Ye.order,aoFeatures:Ye.feature,oApi:Ye.internal,oStdClasses:Ye.classes,oPagination:Ye.pager});t.extend($e.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""});(function(){var e="";e="";var n=e+"ui-state-default",r=e+"css_right ui-icon ui-icon-",i=e+"fg-toolbar ui-toolbar ui-widget-header ui-helper-clearfix";t.extend($e.ext.oJUIClasses,$e.ext.classes,{sPageButton:"fg-button ui-button "+n,sPageButtonActive:"ui-state-disabled",sPageButtonDisabled:"ui-state-disabled",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sSortAsc:n+" sorting_asc",sSortDesc:n+" sorting_desc",sSortable:n+" sorting",sSortableAsc:n+" sorting_asc_disabled",sSortableDesc:n+" sorting_desc_disabled",sSortableNone:n+" sorting_disabled",sSortJUIAsc:r+"triangle-1-n",sSortJUIDesc:r+"triangle-1-s",sSortJUI:r+"carat-2-n-s",sSortJUIAscAllowed:r+"carat-1-n",sSortJUIDescAllowed:r+"carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",sScrollHead:"dataTables_scrollHead "+n,sScrollFoot:"dataTables_scrollFoot "+n,sHeaderTH:n,sFooterTH:n,sJUIHeader:i+" ui-corner-tl ui-corner-tr",sJUIFooter:i+" ui-corner-bl ui-corner-br"})})();var Vn=$e.ext.pager;t.extend(Vn,{simple:function(){return["previous","next"]},full:function(){return["first","previous","next","last"]},simple_numbers:function(t,e){return["previous",Ve(t,e),"next"]},full_numbers:function(t,e){return["first","previous",Ve(t,e),"next","last"]},_numbers:Ve,numbers_length:7});t.extend(!0,$e.ext.renderer,{pageButton:{_:function(e,n,r,o,a,s){var l,u,c=e.oClasses,f=e.oLanguage.oPaginate,h=0,d=function(n,i){var o,p,g,m,v=function(t){he(e,t.data.action,!0)};for(o=0,p=i.length;p>o;o++){m=i[o];if(t.isArray(m)){var y=t("<"+(m.DT_el||"div")+"/>").appendTo(n);d(y,m)}else{l="";u="";switch(m){case"ellipsis":n.append("<span>…</span>");break;case"first":l=f.sFirst;u=m+(a>0?"":" "+c.sPageButtonDisabled);break;case"previous":l=f.sPrevious;u=m+(a>0?"":" "+c.sPageButtonDisabled);break;case"next":l=f.sNext;u=m+(s-1>a?"":" "+c.sPageButtonDisabled);break;case"last":l=f.sLast;u=m+(s-1>a?"":" "+c.sPageButtonDisabled);break;default:l=m+1;u=a===m?c.sPageButtonActive:""}if(l){g=t("<a>",{"class":c.sPageButton+" "+u,"aria-controls":e.sTableId,"data-dt-idx":h,tabindex:e.iTabIndex,id:0===r&&"string"==typeof m?e.sTableId+"_"+m:null}).html(l).appendTo(n);Fe(g,{action:m},v);h++}}}};try{var p=t(i.activeElement).data("dt-idx");d(t(n).empty(),o);null!==p&&t(n).find("[data-dt-idx="+p+"]").focus()}catch(g){}}}});var Xn=function(t,e,n,r){if(!t||"-"===t)return-1/0;e&&(t=un(t,e));if(t.replace){n&&(t=t.replace(n,""));r&&(t=t.replace(r,""))}return 1*t};t.extend(Ye.type.order,{"date-pre":function(t){return Date.parse(t)||0},"html-pre":function(t){return sn(t)?"":t.replace?t.replace(/<.*?>/g,"").toLowerCase():t+""},"string-pre":function(t){return sn(t)?"":"string"==typeof t?t.toLowerCase():t.toString?t.toString():""},"string-asc":function(t,e){return e>t?-1:t>e?1:0},"string-desc":function(t,e){return e>t?1:t>e?-1:0}});Xe("");t.extend($e.ext.type.detect,[function(t,e){var n=e.oLanguage.sDecimal;return cn(t,n)?"num"+n:null},function(t){if(t&&(!nn.test(t)||!rn.test(t)))return null;var e=Date.parse(t);return null!==e&&!isNaN(e)||sn(t)?"date":null},function(t,e){var n=e.oLanguage.sDecimal;return cn(t,n,!0)?"num-fmt"+n:null},function(t,e){var n=e.oLanguage.sDecimal;return hn(t,n)?"html-num"+n:null},function(t,e){var n=e.oLanguage.sDecimal;return hn(t,n,!0)?"html-num-fmt"+n:null},function(t){return sn(t)||"string"==typeof t&&-1!==t.indexOf("<")?"html":null}]);t.extend($e.ext.type.search,{html:function(t){return sn(t)?t:"string"==typeof t?t.replace(tn," ").replace(en,""):""},string:function(t){return sn(t)?t:"string"==typeof t?t.replace(tn," "):t}});t.extend(!0,$e.ext.renderer,{header:{_:function(e,n,r,i){t(e.nTable).on("order.dt.DT",function(t,o,a,s){if(e===o){var l=r.idx;n.removeClass(r.sSortingClass+" "+i.sSortAsc+" "+i.sSortDesc).addClass("asc"==s[l]?i.sSortAsc:"desc"==s[l]?i.sSortDesc:r.sSortingClass)}})},jqueryui:function(e,n,r,i){var o=r.idx;t("<div/>").addClass(i.sSortJUIWrapper).append(n.contents()).append(t("<span/>").addClass(i.sSortIcon+" "+r.sSortingClassJUI)).appendTo(n);t(e.nTable).on("order.dt.DT",function(t,a,s,l){if(e===a){n.removeClass(i.sSortAsc+" "+i.sSortDesc).addClass("asc"==l[o]?i.sSortAsc:"desc"==l[o]?i.sSortDesc:r.sSortingClass);n.find("span."+i.sSortIcon).removeClass(i.sSortJUIAsc+" "+i.sSortJUIDesc+" "+i.sSortJUI+" "+i.sSortJUIAscAllowed+" "+i.sSortJUIDescAllowed).addClass("asc"==l[o]?i.sSortJUIAsc:"desc"==l[o]?i.sSortJUIDesc:r.sSortingClassJUI)}})}}});$e.render={number:function(t,e,n,r){return{display:function(i){var o=0>i?"-":"";i=Math.abs(parseFloat(i));var a=parseInt(i,10),s=n?e+(i-a).toFixed(n).substring(2):"";return o+(r||"")+a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,t)+s}}}};t.extend($e.ext.internal,{_fnExternApiFunc:Ge,_fnBuildAjax:U,_fnAjaxUpdate:B,_fnAjaxParameters:V,_fnAjaxUpdateDraw:X,_fnAjaxDataSrc:G,_fnAddColumn:f,_fnColumnOptions:h,_fnAdjustColumnSizing:d,_fnVisibleToColumnIndex:p,_fnColumnIndexToVisible:g,_fnVisbleColumns:m,_fnGetColumns:v,_fnColumnTypes:y,_fnApplyColumnDefs:b,_fnHungarianMap:e,_fnCamelToHungarian:r,_fnLanguageCompat:a,_fnBrowserDetect:u,_fnAddData:x,_fnAddTr:w,_fnNodeToDataIndex:C,_fnNodeToColumnIndex:S,_fnGetCellData:T,_fnSetCellData:k,_fnSplitObjNotation:_,_fnGetObjectDataFn:M,_fnSetObjectDataFn:D,_fnGetDataMaster:L,_fnClearTable:A,_fnDeleteIndex:N,_fnInvalidateRow:E,_fnGetRowElements:j,_fnCreateTr:P,_fnBuildHead:H,_fnDrawHead:O,_fnDraw:R,_fnReDraw:F,_fnAddOptionsHtml:W,_fnDetectHeader:z,_fnGetUniqueThs:q,_fnFeatureHtmlFilter:$,_fnFilterComplete:Y,_fnFilterCustom:J,_fnFilterColumn:K,_fnFilter:Z,_fnFilterCreateSearch:Q,_fnEscapeRegex:te,_fnFilterData:ee,_fnFeatureHtmlInfo:ie,_fnUpdateInfo:oe,_fnInfoMacros:ae,_fnInitialise:se,_fnInitComplete:le,_fnLengthChange:ue,_fnFeatureHtmlLength:ce,_fnFeatureHtmlPaginate:fe,_fnPageChange:he,_fnFeatureHtmlProcessing:de,_fnProcessingDisplay:pe,_fnFeatureHtmlTable:ge,_fnScrollDraw:me,_fnApplyToChildren:ve,_fnCalculateColumnWidths:ye,_fnThrottle:be,_fnConvertToWidth:xe,_fnScrollingWidthAdjust:we,_fnGetWidestNode:Ce,_fnGetMaxLenString:Se,_fnStringToCss:Te,_fnScrollBarWidth:ke,_fnSortFlatten:_e,_fnSort:Me,_fnSortAria:De,_fnSortListener:Le,_fnSortAttachListener:Ae,_fnSortingClasses:Ne,_fnSortData:Ee,_fnSaveState:je,_fnLoadState:Pe,_fnSettingsFromNode:Ie,_fnLog:He,_fnMap:Oe,_fnBindAction:Fe,_fnCallbackReg:We,_fnCallbackFire:ze,_fnLengthOverflow:qe,_fnRenderer:Ue,_fnDataSource:Be,_fnRowAttributes:I,_fnCalculateEnd:function(){}});t.fn.dataTable=$e;t.fn.dataTableSettings=$e.settings;t.fn.dataTableExt=$e.ext;t.fn.DataTable=function(e){return t(this).dataTable(e).api()};t.each($e,function(e,n){t.fn.DataTable[e]=n});return t.fn.dataTable})})(window,document)},{jquery:19}],3:[function(t){var e,n=t("jquery"),r=n(document),i=n("head"),o=null,a=[],s=0,l="id",u="px",c="JColResizer",f=parseInt,h=Math,d=navigator.userAgent.indexOf("Trident/4.0")>0;try{e=sessionStorage}catch(p){}i.append("<style type='text/css'> .JColResizer{table-layout:fixed;} .JColResizer td, .JColResizer th{overflow:hidden;padding-left:0!important; padding-right:0!important;} .JCLRgrips{ height:0px; position:relative;} .JCLRgrip{margin-left:-5px; position:absolute; z-index:5; } .JCLRgrip .JColResizer{position:absolute;background-color:red;filter:alpha(opacity=1);opacity:0;width:10px;height:100%;top:0px} .JCLRLastGrip{position:absolute; width:1px; } .JCLRgripDrag{ border-left:1px dotted black; }</style>");var g=function(t,e){var r=n(t);if(e.disable)return m(r);var i=r.id=r.attr(l)||c+s++;r.p=e.postbackSafe;if(r.is("table")&&!a[i]){r.addClass(c).attr(l,i).before('<div class="JCLRgrips"/>');r.opt=e;r.g=[];r.c=[];r.w=r.width();r.gc=r.prev();e.marginLeft&&r.gc.css("marginLeft",e.marginLeft);e.marginRight&&r.gc.css("marginRight",e.marginRight);r.cs=f(d?t.cellSpacing||t.currentStyle.borderSpacing:r.css("border-spacing"))||2;r.b=f(d?t.border||t.currentStyle.borderLeftWidth:r.css("border-left-width"))||1;a[i]=r;v(r)}},m=function(t){var e=t.attr(l),t=a[e];if(t&&t.is("table")){t.removeClass(c).gc.remove();delete a[e]}},v=function(t){var r=t.find(">thead>tr>th,>thead>tr>td");r.length||(r=t.find(">tbody>tr:first>th,>tr:first>th,>tbody>tr:first>td, >tr:first>td"));t.cg=t.find("col");t.ln=r.length;t.p&&e&&e[t.id]&&y(t,r);r.each(function(e){var r=n(this),i=n(t.gc.append('<div class="JCLRgrip"></div>')[0].lastChild);i.t=t;i.i=e;i.c=r;r.w=r.width();t.g.push(i);t.c.push(r);r.width(r.w).removeAttr("width");e<t.ln-1?i.bind("touchstart mousedown",S).append(t.opt.gripInnerHtml).append('<div class="'+c+'" style="cursor:'+t.opt.hoverCursor+'"></div>'):i.addClass("JCLRLastGrip").removeClass("JCLRgrip");i.data(c,{i:e,t:t.attr(l)})});t.cg.removeAttr("width");b(t);t.find("td, th").not(r).not("table th, table td").each(function(){n(this).removeAttr("width")})},y=function(t,n){var r,i=0,o=0,a=[];if(n){t.cg.removeAttr("width");if(t.opt.flush){e[t.id]="";return}r=e[t.id].split(";");for(;o<t.ln;o++){a.push(100*r[o]/r[t.ln]+"%");n.eq(o).css("width",a[o])}for(o=0;o<t.ln;o++)t.cg.eq(o).css("width",a[o])}else{e[t.id]="";for(;o<t.c.length;o++){r=t.c[o].width();e[t.id]+=r+";";i+=r}e[t.id]+=i}},b=function(t){t.gc.width(t.w);for(var e=0;e<t.ln;e++){var n=t.c[e];t.g[e].css({left:n.offset().left-t.offset().left+n.outerWidth(!1)+t.cs/2+u,height:t.opt.headerOnly?t.c[0].outerHeight(!1):t.outerHeight(!1)})}},x=function(t,e,n){var r=o.x-o.l,i=t.c[e],a=t.c[e+1],s=i.w+r,l=a.w-r;i.width(s+u);a.width(l+u);t.cg.eq(e).width(s+u);t.cg.eq(e+1).width(l+u);if(n){i.w=s;a.w=l}},w=function(t){if(o){var e=o.t;if(t.originalEvent.touches)var n=t.originalEvent.touches[0].pageX-o.ox+o.l;else var n=t.pageX-o.ox+o.l;var r=e.opt.minWidth,i=o.i,a=1.5*e.cs+r+e.b,s=i==e.ln-1?e.w-a:e.g[i+1].position().left-e.cs-r,l=i?e.g[i-1].position().left+e.cs+r:a;n=h.max(l,h.min(s,n));o.x=n;o.css("left",n+u);if(e.opt.liveDrag){x(e,i);b(e);var c=e.opt.onDrag;if(c){t.currentTarget=e[0];c(t)}}return!1}},C=function(t){r.unbind("touchend."+c+" mouseup."+c).unbind("touchmove."+c+" mousemove."+c);n("head :last-child").remove();if(o){o.removeClass(o.t.opt.draggingClass);var i=o.t,a=i.opt.onResize;if(o.x){x(i,o.i,!0);b(i);if(a){t.currentTarget=i[0];a(t)}}i.p&&e&&y(i);o=null}},S=function(t){var e=n(this).data(c),s=a[e.t],l=s.g[e.i];l.ox=t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX;l.l=l.position().left;r.bind("touchmove."+c+" mousemove."+c,w).bind("touchend."+c+" mouseup."+c,C);i.append("<style type='text/css'>*{cursor:"+s.opt.dragCursor+"!important}</style>");l.addClass(s.opt.draggingClass);o=l;if(s.c[e.i].l)for(var u,f=0;f<s.ln;f++){u=s.c[f];u.l=!1;u.w=u.width()}return!1},T=function(){for(e in a){var t,e=a[e],n=0;e.removeClass(c);if(e.w!=e.width()){e.w=e.width();for(t=0;t<e.ln;t++)n+=e.c[t].w;for(t=0;t<e.ln;t++)e.c[t].css("width",h.round(1e3*e.c[t].w/n)/10+"%").l=!0}b(e.addClass(c))}};n(window).bind("resize."+c,T);n.fn.extend({colResizable:function(t){var e={draggingClass:"JCLRgripDrag",gripInnerHtml:"",liveDrag:!1,minWidth:15,headerOnly:!1,hoverCursor:"e-resize",dragCursor:"e-resize",postbackSafe:!1,flush:!1,marginLeft:null,marginRight:null,disable:!1,onDrag:null,onResize:null},t=n.extend(e,t);return this.each(function(){g(this,t)})}})},{jquery:19}],4:[function(t){RegExp.escape=function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")};var e=t("jquery");e.csv={defaults:{separator:",",delimiter:'"',headers:!0},hooks:{castToScalar:function(t){var e=/\./;if(isNaN(t))return t;if(e.test(t))return parseFloat(t);var n=parseInt(t);return isNaN(n)?null:n}},parsers:{parse:function(t,e){function n(){l=0;u="";if(e.start&&e.state.rowNum<e.start){s=[];e.state.rowNum++;e.state.colNum=1}else{if(void 0===e.onParseEntry)a.push(s);else{var t=e.onParseEntry(s,e.state);t!==!1&&a.push(t)}s=[];e.end&&e.state.rowNum>=e.end&&(c=!0);e.state.rowNum++;e.state.colNum=1}}function r(){if(void 0===e.onParseValue)s.push(u);else{var t=e.onParseValue(u,e.state);t!==!1&&s.push(t)}u="";l=0;e.state.colNum++}var i=e.separator,o=e.delimiter;e.state.rowNum||(e.state.rowNum=1);e.state.colNum||(e.state.colNum=1);var a=[],s=[],l=0,u="",c=!1,f=RegExp.escape(i),h=RegExp.escape(o),d=/(D|S|\n|\r|[^DS\r\n]+)/,p=d.source;p=p.replace(/S/g,f);p=p.replace(/D/g,h);d=RegExp(p,"gm");t.replace(d,function(t){if(!c)switch(l){case 0:if(t===i){u+="";r();break}if(t===o){l=1;break}if("\n"===t){r();n();break}if(/^\r$/.test(t))break;u+=t;l=3;break;case 1:if(t===o){l=2;break}u+=t;l=1;break;case 2:if(t===o){u+=t;l=1;break}if(t===i){r();break}if("\n"===t){r();n();break}if(/^\r$/.test(t))break;throw new Error("CSVDataError: Illegal State [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");case 3:if(t===i){r();break}if("\n"===t){r();n();break}if(/^\r$/.test(t))break;if(t===o)throw new Error("CSVDataError: Illegal Quote [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");throw new Error("CSVDataError: Illegal Data [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");default:throw new Error("CSVDataError: Unknown State [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]")}});if(0!==s.length){r();n()}return a},splitLines:function(t,e){function n(){a=0;if(e.start&&e.state.rowNum<e.start){s="";e.state.rowNum++}else{if(void 0===e.onParseEntry)o.push(s);else{var t=e.onParseEntry(s,e.state);t!==!1&&o.push(t)}s="";e.end&&e.state.rowNum>=e.end&&(l=!0);e.state.rowNum++}}var r=e.separator,i=e.delimiter;e.state.rowNum||(e.state.rowNum=1);var o=[],a=0,s="",l=!1,u=RegExp.escape(r),c=RegExp.escape(i),f=/(D|S|\n|\r|[^DS\r\n]+)/,h=f.source;h=h.replace(/S/g,u);h=h.replace(/D/g,c);f=RegExp(h,"gm");t.replace(f,function(t){if(!l)switch(a){case 0:if(t===r){s+=t;a=0;break}if(t===i){s+=t;a=1;break}if("\n"===t){n();break}if(/^\r$/.test(t))break;s+=t;a=3;break;case 1:if(t===i){s+=t;a=2;break}s+=t;a=1;break;case 2:var o=s.substr(s.length-1);if(t===i&&o===i){s+=t;a=1;break}if(t===r){s+=t;a=0;break}if("\n"===t){n();break}if("\r"===t)break;throw new Error("CSVDataError: Illegal state [Row:"+e.state.rowNum+"]");case 3:if(t===r){s+=t;a=0;break}if("\n"===t){n();break}if("\r"===t)break;if(t===i)throw new Error("CSVDataError: Illegal quote [Row:"+e.state.rowNum+"]");throw new Error("CSVDataError: Illegal state [Row:"+e.state.rowNum+"]");default:throw new Error("CSVDataError: Unknown state [Row:"+e.state.rowNum+"]")}});""!==s&&n();return o},parseEntry:function(t,e){function n(){if(void 0===e.onParseValue)o.push(s);else{var t=e.onParseValue(s,e.state);t!==!1&&o.push(t)}s="";a=0;e.state.colNum++}var r=e.separator,i=e.delimiter;e.state.rowNum||(e.state.rowNum=1);e.state.colNum||(e.state.colNum=1);var o=[],a=0,s="";if(!e.match){var l=RegExp.escape(r),u=RegExp.escape(i),c=/(D|S|\n|\r|[^DS\r\n]+)/,f=c.source;f=f.replace(/S/g,l);f=f.replace(/D/g,u);e.match=RegExp(f,"gm")}t.replace(e.match,function(t){switch(a){case 0:if(t===r){s+="";n();break}if(t===i){a=1;break}if("\n"===t||"\r"===t)break;s+=t;a=3;break;case 1:if(t===i){a=2;break}s+=t;a=1;break;case 2:if(t===i){s+=t;a=1;break}if(t===r){n();break}if("\n"===t||"\r"===t)break;throw new Error("CSVDataError: Illegal State [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");case 3:if(t===r){n();break}if("\n"===t||"\r"===t)break;if(t===i)throw new Error("CSVDataError: Illegal Quote [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");throw new Error("CSVDataError: Illegal Data [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");default:throw new Error("CSVDataError: Unknown State [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]")}});n();return o}},toArray:function(t,n,r){var n=void 0!==n?n:{},i={};i.callback=void 0!==r&&"function"==typeof r?r:!1;i.separator="separator"in n?n.separator:e.csv.defaults.separator;i.delimiter="delimiter"in n?n.delimiter:e.csv.defaults.delimiter;var o=void 0!==n.state?n.state:{},n={delimiter:i.delimiter,separator:i.separator,onParseEntry:n.onParseEntry,onParseValue:n.onParseValue,state:o},a=e.csv.parsers.parseEntry(t,n);if(!i.callback)return a;i.callback("",a);return void 0},toArrays:function(t,n,r){var n=void 0!==n?n:{},i={};i.callback=void 0!==r&&"function"==typeof r?r:!1;i.separator="separator"in n?n.separator:e.csv.defaults.separator;i.delimiter="delimiter"in n?n.delimiter:e.csv.defaults.delimiter;var o=[],n={delimiter:i.delimiter,separator:i.separator,onParseEntry:n.onParseEntry,onParseValue:n.onParseValue,start:n.start,end:n.end,state:{rowNum:1,colNum:1}};o=e.csv.parsers.parse(t,n);if(!i.callback)return o;i.callback("",o);return void 0},toObjects:function(t,n,r){var n=void 0!==n?n:{},i={};i.callback=void 0!==r&&"function"==typeof r?r:!1;i.separator="separator"in n?n.separator:e.csv.defaults.separator;i.delimiter="delimiter"in n?n.delimiter:e.csv.defaults.delimiter;i.headers="headers"in n?n.headers:e.csv.defaults.headers;n.start="start"in n?n.start:1;i.headers&&n.start++;n.end&&i.headers&&n.end++;var o=[],a=[],n={delimiter:i.delimiter,separator:i.separator,onParseEntry:n.onParseEntry,onParseValue:n.onParseValue,start:n.start,end:n.end,state:{rowNum:1,colNum:1},match:!1},s={delimiter:i.delimiter,separator:i.separator,start:1,end:1,state:{rowNum:1,colNum:1}},l=e.csv.parsers.splitLines(t,s),u=e.csv.toArray(l[0],n),o=e.csv.parsers.splitLines(t,n);n.state.colNum=1;n.state.rowNum=u?2:1;for(var c=0,f=o.length;f>c;c++){var h=e.csv.toArray(o[c],n),d={};for(var p in u)d[u[p]]=h[p];a.push(d);n.state.rowNum++}if(!i.callback)return a;i.callback("",a);return void 0},fromArrays:function(t,n,r){var n=void 0!==n?n:{},o={};o.callback=void 0!==r&&"function"==typeof r?r:!1;o.separator="separator"in n?n.separator:e.csv.defaults.separator;o.delimiter="delimiter"in n?n.delimiter:e.csv.defaults.delimiter;o.escaper="escaper"in n?n.escaper:e.csv.defaults.escaper;o.experimental="experimental"in n?n.experimental:!1;if(!o.experimental)throw new Error("not implemented");var a=[];for(i in t)a.push(t[i]);if(!o.callback)return a;o.callback("",a);return void 0},fromObjects2CSV:function(t,n,r){var n=void 0!==n?n:{},o={};o.callback=void 0!==r&&"function"==typeof r?r:!1;o.separator="separator"in n?n.separator:e.csv.defaults.separator;o.delimiter="delimiter"in n?n.delimiter:e.csv.defaults.delimiter;o.experimental="experimental"in n?n.experimental:!1;if(!o.experimental)throw new Error("not implemented");var a=[];for(i in t)a.push(arrays[i]);if(!o.callback)return a;o.callback("",a);return void 0}};e.csvEntry2Array=e.csv.toArray;e.csv2Array=e.csv.toArrays;e.csv2Dictionary=e.csv.toObjects},{jquery:19}],5:[function(t,e){function n(){this._events=this._events||{};this._maxListeners=this._maxListeners||void 0}function r(t){return"function"==typeof t}function i(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function a(t){return void 0===t}e.exports=n;n.EventEmitter=n;n.prototype._events=void 0;n.prototype._maxListeners=void 0;n.defaultMaxListeners=10;n.prototype.setMaxListeners=function(t){if(!i(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");this._maxListeners=t;return this};n.prototype.emit=function(t){var e,n,i,s,l,u;this._events||(this._events={});if("error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){e=arguments[1];if(e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}n=this._events[t];if(a(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:i=arguments.length;s=new Array(i-1);for(l=1;i>l;l++)s[l-1]=arguments[l];n.apply(this,s)}else if(o(n)){i=arguments.length;s=new Array(i-1);for(l=1;i>l;l++)s[l-1]=arguments[l];u=n.slice();i=u.length;for(l=0;i>l;l++)u[l].apply(this,s)}return!0};n.prototype.addListener=function(t,e){var i;if(!r(e))throw TypeError("listener must be a function");this._events||(this._events={});this._events.newListener&&this.emit("newListener",t,r(e.listener)?e.listener:e);this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e;if(o(this._events[t])&&!this._events[t].warned){var i;i=a(this._maxListeners)?n.defaultMaxListeners:this._maxListeners;if(i&&i>0&&this._events[t].length>i){this._events[t].warned=!0;console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length);"function"==typeof console.trace&&console.trace()}}return this};n.prototype.on=n.prototype.addListener;n.prototype.once=function(t,e){function n(){this.removeListener(t,n);if(!i){i=!0;e.apply(this,arguments)}}if(!r(e))throw TypeError("listener must be a function");var i=!1;n.listener=e;this.on(t,n);return this};n.prototype.removeListener=function(t,e){var n,i,a,s;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;n=this._events[t];a=n.length;i=-1;if(n===e||r(n.listener)&&n.listener===e){delete this._events[t];this._events.removeListener&&this.emit("removeListener",t,e)}else if(o(n)){for(s=a;s-->0;)if(n[s]===e||n[s].listener&&n[s].listener===e){i=s;break}if(0>i)return this;if(1===n.length){n.length=0;delete this._events[t]}else n.splice(i,1);this._events.removeListener&&this.emit("removeListener",t,e)}return this};n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener){0===arguments.length?this._events={}:this._events[t]&&delete this._events[t];return this}if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);this.removeAllListeners("removeListener");this._events={};return this}n=this._events[t];if(r(n))this.removeListener(t,n);else for(;n.length;)this.removeListener(t,n[n.length-1]);delete this._events[t];return this};n.prototype.listeners=function(t){var e;e=this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[];return e};n.listenerCount=function(t,e){var n;n=t._events&&t._events[e]?r(t._events[e])?1:t._events[e].length:0;return n}},{}],6:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)})(function(t){function e(t,e,r,i){var o=t.getLineHandle(e.line),l=e.ch-1,u=l>=0&&s[o.text.charAt(l)]||s[o.text.charAt(++l)];if(!u)return null;var c=">"==u.charAt(1)?1:-1;if(r&&c>0!=(l==e.ch))return null;var f=t.getTokenTypeAt(a(e.line,l+1)),h=n(t,a(e.line,l+(c>0?1:0)),c,f||null,i);return null==h?null:{from:a(e.line,l),to:h&&h.pos,match:h&&h.ch==u.charAt(0),forward:c>0}}function n(t,e,n,r,i){for(var o=i&&i.maxScanLineLength||1e4,l=i&&i.maxScanLines||1e3,u=[],c=i&&i.bracketRegex?i.bracketRegex:/[(){}[\]]/,f=n>0?Math.min(e.line+l,t.lastLine()+1):Math.max(t.firstLine()-1,e.line-l),h=e.line;h!=f;h+=n){var d=t.getLine(h);if(d){var p=n>0?0:d.length-1,g=n>0?d.length:-1;if(!(d.length>o)){h==e.line&&(p=e.ch-(0>n?1:0));for(;p!=g;p+=n){var m=d.charAt(p);if(c.test(m)&&(void 0===r||t.getTokenTypeAt(a(h,p+1))==r)){var v=s[m];if(">"==v.charAt(1)==n>0)u.push(m);else{if(!u.length)return{pos:a(h,p),ch:m};u.pop()}}}}}}return h-n==(n>0?t.lastLine():t.firstLine())?!1:null}function r(t,n,r){for(var i=t.state.matchBrackets.maxHighlightLineLength||1e3,s=[],l=t.listSelections(),u=0;u<l.length;u++){var c=l[u].empty()&&e(t,l[u].head,!1,r);if(c&&t.getLine(c.from.line).length<=i){var f=c.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";s.push(t.markText(c.from,a(c.from.line,c.from.ch+1),{className:f}));c.to&&t.getLine(c.to.line).length<=i&&s.push(t.markText(c.to,a(c.to.line,c.to.ch+1),{className:f}))}}if(s.length){o&&t.state.focused&&t.display.input.focus();
var h=function(){t.operation(function(){for(var t=0;t<s.length;t++)s[t].clear()})};if(!n)return h;setTimeout(h,800)}}function i(t){t.operation(function(){if(l){l();l=null}l=r(t,!1,t.state.matchBrackets)})}var o=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),a=t.Pos,s={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},l=null;t.defineOption("matchBrackets",!1,function(e,n,r){r&&r!=t.Init&&e.off("cursorActivity",i);if(n){e.state.matchBrackets="object"==typeof n?n:{};e.on("cursorActivity",i)}});t.defineExtension("matchBrackets",function(){r(this,!0)});t.defineExtension("findMatchingBracket",function(t,n,r){return e(this,t,n,r)});t.defineExtension("scanForBracket",function(t,e,r,i){return n(this,t,e,r,i)})})},{"../../lib/codemirror":11}],7:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)})(function(t){"use strict";t.registerHelper("fold","brace",function(e,n){function r(r){for(var i=n.ch,l=0;;){var u=0>=i?-1:s.lastIndexOf(r,i-1);if(-1!=u){if(1==l&&u<n.ch)break;o=e.getTokenTypeAt(t.Pos(a,u+1));if(!/^(comment|string)/.test(o))return u+1;i=u-1}else{if(1==l)break;l=1;i=s.length}}}var i,o,a=n.line,s=e.getLine(a),l="{",u="}",i=r("{");if(null==i){l="[",u="]";i=r("[")}if(null!=i){var c,f,h=1,d=e.lastLine();t:for(var p=a;d>=p;++p)for(var g=e.getLine(p),m=p==a?i:0;;){var v=g.indexOf(l,m),y=g.indexOf(u,m);0>v&&(v=g.length);0>y&&(y=g.length);m=Math.min(v,y);if(m==g.length)break;if(e.getTokenTypeAt(t.Pos(p,m+1))==o)if(m==v)++h;else if(!--h){c=p;f=m;break t}++m}if(null!=c&&(a!=c||f!=i))return{from:t.Pos(a,i),to:t.Pos(c,f)}}});t.registerHelper("fold","import",function(e,n){function r(n){if(n<e.firstLine()||n>e.lastLine())return null;var r=e.getTokenAt(t.Pos(n,1));/\S/.test(r.string)||(r=e.getTokenAt(t.Pos(n,r.end+1)));if("keyword"!=r.type||"import"!=r.string)return null;for(var i=n,o=Math.min(e.lastLine(),n+10);o>=i;++i){var a=e.getLine(i),s=a.indexOf(";");if(-1!=s)return{startCh:r.end,end:t.Pos(i,s)}}}var i,n=n.line,o=r(n);if(!o||r(n-1)||(i=r(n-2))&&i.end.line==n-1)return null;for(var a=o.end;;){var s=r(a.line+1);if(null==s)break;a=s.end}return{from:e.clipPos(t.Pos(n,o.startCh+1)),to:a}});t.registerHelper("fold","include",function(e,n){function r(n){if(n<e.firstLine()||n>e.lastLine())return null;var r=e.getTokenAt(t.Pos(n,1));/\S/.test(r.string)||(r=e.getTokenAt(t.Pos(n,r.end+1)));return"meta"==r.type&&"#include"==r.string.slice(0,8)?r.start+8:void 0}var n=n.line,i=r(n);if(null==i||null!=r(n-1))return null;for(var o=n;;){var a=r(o+1);if(null==a)break;++o}return{from:t.Pos(n,i+1),to:e.clipPos(t.Pos(o))}})})},{"../../lib/codemirror":11}],8:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)})(function(t){"use strict";function e(e,i,o,a){function s(t){var n=l(e,i);if(!n||n.to.line-n.from.line<u)return null;for(var r=e.findMarksAt(n.from),o=0;o<r.length;++o)if(r[o].__isFold&&"fold"!==a){if(!t)return null;n.cleared=!0;r[o].clear()}return n}if(o&&o.call){var l=o;o=null}else var l=r(e,o,"rangeFinder");"number"==typeof i&&(i=t.Pos(i,0));var u=r(e,o,"minFoldSize"),c=s(!0);if(r(e,o,"scanUp"))for(;!c&&i.line>e.firstLine();){i=t.Pos(i.line-1,0);c=s(!1)}if(c&&!c.cleared&&"unfold"!==a){var f=n(e,o);t.on(f,"mousedown",function(e){h.clear();t.e_preventDefault(e)});var h=e.markText(c.from,c.to,{replacedWith:f,clearOnEnter:!0,__isFold:!0});h.on("clear",function(n,r){t.signal(e,"unfold",e,n,r)});t.signal(e,"fold",e,c.from,c.to)}}function n(t,e){var n=r(t,e,"widget");if("string"==typeof n){var i=document.createTextNode(n);n=document.createElement("span");n.appendChild(i);n.className="CodeMirror-foldmarker"}return n}function r(t,e,n){if(e&&void 0!==e[n])return e[n];var r=t.options.foldOptions;return r&&void 0!==r[n]?r[n]:i[n]}t.newFoldFunction=function(t,n){return function(r,i){e(r,i,{rangeFinder:t,widget:n})}};t.defineExtension("foldCode",function(t,n,r){e(this,t,n,r)});t.defineExtension("isFolded",function(t){for(var e=this.findMarksAt(t),n=0;n<e.length;++n)if(e[n].__isFold)return!0});t.commands.toggleFold=function(t){t.foldCode(t.getCursor())};t.commands.fold=function(t){t.foldCode(t.getCursor(),null,"fold")};t.commands.unfold=function(t){t.foldCode(t.getCursor(),null,"unfold")};t.commands.foldAll=function(e){e.operation(function(){for(var n=e.firstLine(),r=e.lastLine();r>=n;n++)e.foldCode(t.Pos(n,0),null,"fold")})};t.commands.unfoldAll=function(e){e.operation(function(){for(var n=e.firstLine(),r=e.lastLine();r>=n;n++)e.foldCode(t.Pos(n,0),null,"unfold")})};t.registerHelper("fold","combine",function(){var t=Array.prototype.slice.call(arguments,0);return function(e,n){for(var r=0;r<t.length;++r){var i=t[r](e,n);if(i)return i}}});t.registerHelper("fold","auto",function(t,e){for(var n=t.getHelpers(e,"fold"),r=0;r<n.length;r++){var i=n[r](t,e);if(i)return i}});var i={rangeFinder:t.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1};t.defineOption("foldOptions",null);t.defineExtension("foldOption",function(t,e){return r(this,t,e)})})},{"../../lib/codemirror":11}],9:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror"),e("./foldcode")):"function"==typeof t&&t.amd?t(["../../lib/codemirror","./foldcode"],i):i(CodeMirror)})(function(t){"use strict";function e(t){this.options=t;this.from=this.to=0}function n(t){t===!0&&(t={});null==t.gutter&&(t.gutter="CodeMirror-foldgutter");null==t.indicatorOpen&&(t.indicatorOpen="CodeMirror-foldgutter-open");null==t.indicatorFolded&&(t.indicatorFolded="CodeMirror-foldgutter-folded");return t}function r(t,e){for(var n=t.findMarksAt(f(e)),r=0;r<n.length;++r)if(n[r].__isFold&&n[r].find().from.line==e)return!0}function i(t){if("string"==typeof t){var e=document.createElement("div");e.className=t+" CodeMirror-guttermarker-subtle";return e}return t.cloneNode(!0)}function o(t,e,n){var o=t.state.foldGutter.options,a=e,s=t.foldOption(o,"minFoldSize"),l=t.foldOption(o,"rangeFinder");t.eachLine(e,n,function(e){var n=null;if(r(t,a))n=i(o.indicatorFolded);else{var u=f(a,0),c=l&&l(t,u);c&&c.to.line-c.from.line>=s&&(n=i(o.indicatorOpen))}t.setGutterMarker(e,o.gutter,n);++a})}function a(t){var e=t.getViewport(),n=t.state.foldGutter;if(n){t.operation(function(){o(t,e.from,e.to)});n.from=e.from;n.to=e.to}}function s(t,e,n){var r=t.state.foldGutter.options;n==r.gutter&&t.foldCode(f(e,0),r.rangeFinder)}function l(t){var e=t.state.foldGutter,n=t.state.foldGutter.options;e.from=e.to=0;clearTimeout(e.changeUpdate);e.changeUpdate=setTimeout(function(){a(t)},n.foldOnChangeTimeSpan||600)}function u(t){var e=t.state.foldGutter,n=t.state.foldGutter.options;clearTimeout(e.changeUpdate);e.changeUpdate=setTimeout(function(){var n=t.getViewport();e.from==e.to||n.from-e.to>20||e.from-n.to>20?a(t):t.operation(function(){if(n.from<e.from){o(t,n.from,e.from);e.from=n.from}if(n.to>e.to){o(t,e.to,n.to);e.to=n.to}})},n.updateViewportTimeSpan||400)}function c(t,e){var n=t.state.foldGutter,r=e.line;r>=n.from&&r<n.to&&o(t,r,r+1)}t.defineOption("foldGutter",!1,function(r,i,o){if(o&&o!=t.Init){r.clearGutter(r.state.foldGutter.options.gutter);r.state.foldGutter=null;r.off("gutterClick",s);r.off("change",l);r.off("viewportChange",u);r.off("fold",c);r.off("unfold",c);r.off("swapDoc",a)}if(i){r.state.foldGutter=new e(n(i));a(r);r.on("gutterClick",s);r.on("change",l);r.on("viewportChange",u);r.on("fold",c);r.on("unfold",c);r.on("swapDoc",a)}});var f=t.Pos})},{"../../lib/codemirror":11,"./foldcode":8}],10:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)})(function(t){"use strict";function e(t,e){return t.line-e.line||t.ch-e.ch}function n(t,e,n,r){this.line=e;this.ch=n;this.cm=t;this.text=t.getLine(e);this.min=r?r.from:t.firstLine();this.max=r?r.to-1:t.lastLine()}function r(t,e){var n=t.cm.getTokenTypeAt(h(t.line,e));return n&&/\btag\b/.test(n)}function i(t){if(!(t.line>=t.max)){t.ch=0;t.text=t.cm.getLine(++t.line);return!0}}function o(t){if(!(t.line<=t.min)){t.text=t.cm.getLine(--t.line);t.ch=t.text.length;return!0}}function a(t){for(;;){var e=t.text.indexOf(">",t.ch);if(-1==e){if(i(t))continue;return}if(r(t,e+1)){var n=t.text.lastIndexOf("/",e),o=n>-1&&!/\S/.test(t.text.slice(n+1,e));t.ch=e+1;return o?"selfClose":"regular"}t.ch=e+1}}function s(t){for(;;){var e=t.ch?t.text.lastIndexOf("<",t.ch-1):-1;if(-1==e){if(o(t))continue;return}if(r(t,e+1)){g.lastIndex=e;t.ch=e;var n=g.exec(t.text);if(n&&n.index==e)return n}else t.ch=e}}function l(t){for(;;){g.lastIndex=t.ch;var e=g.exec(t.text);if(!e){if(i(t))continue;return}if(r(t,e.index+1)){t.ch=e.index+e[0].length;return e}t.ch=e.index+1}}function u(t){for(;;){var e=t.ch?t.text.lastIndexOf(">",t.ch-1):-1;if(-1==e){if(o(t))continue;return}if(r(t,e+1)){var n=t.text.lastIndexOf("/",e),i=n>-1&&!/\S/.test(t.text.slice(n+1,e));t.ch=e+1;return i?"selfClose":"regular"}t.ch=e}}function c(t,e){for(var n=[];;){var r,i=l(t),o=t.line,s=t.ch-(i?i[0].length:0);if(!i||!(r=a(t)))return;if("selfClose"!=r)if(i[1]){for(var u=n.length-1;u>=0;--u)if(n[u]==i[2]){n.length=u;break}if(0>u&&(!e||e==i[2]))return{tag:i[2],from:h(o,s),to:h(t.line,t.ch)}}else n.push(i[2])}}function f(t,e){for(var n=[];;){var r=u(t);if(!r)return;if("selfClose"!=r){var i=t.line,o=t.ch,a=s(t);if(!a)return;if(a[1])n.push(a[2]);else{for(var l=n.length-1;l>=0;--l)if(n[l]==a[2]){n.length=l;break}if(0>l&&(!e||e==a[2]))return{tag:a[2],from:h(t.line,t.ch),to:h(i,o)}}}else s(t)}}var h=t.Pos,d="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",p=d+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",g=new RegExp("<(/?)(["+d+"]["+p+"]*)","g");t.registerHelper("fold","xml",function(t,e){for(var r=new n(t,e.line,0);;){var i,o=l(r);if(!o||r.line!=e.line||!(i=a(r)))return;if(!o[1]&&"selfClose"!=i){var e=h(r.line,r.ch),s=c(r,o[2]);return s&&{from:e,to:s.from}}}});t.findMatchingTag=function(t,r,i){var o=new n(t,r.line,r.ch,i);if(-1!=o.text.indexOf(">")||-1!=o.text.indexOf("<")){var l=a(o),u=l&&h(o.line,o.ch),d=l&&s(o);if(l&&d&&!(e(o,r)>0)){var p={from:h(o.line,o.ch),to:u,tag:d[2]};if("selfClose"==l)return{open:p,close:null,at:"open"};if(d[1])return{open:f(o,d[2]),close:p,at:"close"};o=new n(t,u.line,u.ch,i);return{open:p,close:c(o,d[2]),at:"open"}}}};t.findEnclosingTag=function(t,e,r){for(var i=new n(t,e.line,e.ch,r);;){var o=f(i);if(!o)break;var a=new n(t,e.line,e.ch,r),s=c(a,o.tag);if(s)return{open:o,close:s}}};t.scanForClosingTag=function(t,e,r,i){var o=new n(t,e.line,e.ch,i?{from:0,to:i}:null);return c(o,r)}})},{"../../lib/codemirror":11}],11:[function(e,n,r){(function(e){if("object"==typeof r&&"object"==typeof n)n.exports=e();else{if("function"==typeof t&&t.amd)return t([],e);this.CodeMirror=e()}})(function(){"use strict";function t(n,r){if(!(this instanceof t))return new t(n,r);this.options=r=r?To(r):{};To(Fa,r,!1);d(r);var i=r.value;"string"==typeof i&&(i=new us(i,r.mode));this.doc=i;var o=this.display=new e(n,i);o.wrapper.CodeMirror=this;u(this);s(this);r.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");r.autofocus&&!ga&&Nn(this);v(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new vo,keySeq:null};ia&&11>oa&&setTimeout(ko(An,this,!0),20);Pn(this);Oo();on(this);this.curOp.forceUpdate=!0;Oi(this,i);r.autofocus&&!ga||jo()==o.input?setTimeout(ko(ir,this),20):or(this);for(var a in Wa)Wa.hasOwnProperty(a)&&Wa[a](this,r[a],za);C(this);for(var l=0;l<Va.length;++l)Va[l](this);sn(this);aa&&r.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function e(t,e){var n=this,r=n.input=Lo("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none");aa?r.style.width="1000px":r.setAttribute("wrap","off");pa&&(r.style.border="1px solid black");r.setAttribute("autocorrect","off");r.setAttribute("autocapitalize","off");r.setAttribute("spellcheck","false");n.inputDiv=Lo("div",[r],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");n.scrollbarFiller=Lo("div",null,"CodeMirror-scrollbar-filler");n.scrollbarFiller.setAttribute("not-content","true");n.gutterFiller=Lo("div",null,"CodeMirror-gutter-filler");n.gutterFiller.setAttribute("not-content","true");n.lineDiv=Lo("div",null,"CodeMirror-code");n.selectionDiv=Lo("div",null,null,"position: relative; z-index: 1");n.cursorDiv=Lo("div",null,"CodeMirror-cursors");n.measure=Lo("div",null,"CodeMirror-measure");n.lineMeasure=Lo("div",null,"CodeMirror-measure");n.lineSpace=Lo("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none");n.mover=Lo("div",[Lo("div",[n.lineSpace],"CodeMirror-lines")],null,"position: relative");n.sizer=Lo("div",[n.mover],"CodeMirror-sizer");n.sizerWidth=null;n.heightForcer=Lo("div",null,null,"position: absolute; height: "+bs+"px; width: 1px;");n.gutters=Lo("div",null,"CodeMirror-gutters");n.lineGutter=null;n.scroller=Lo("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll");n.scroller.setAttribute("tabIndex","-1");n.wrapper=Lo("div",[n.inputDiv,n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror");if(ia&&8>oa){n.gutters.style.zIndex=-1;n.scroller.style.paddingRight=0}pa&&(r.style.width="0px");aa||(n.scroller.draggable=!0);if(fa){n.inputDiv.style.height="1px";n.inputDiv.style.position="absolute"}t&&(t.appendChild?t.appendChild(n.wrapper):t(n.wrapper));n.viewFrom=n.viewTo=e.first;n.reportedViewFrom=n.reportedViewTo=e.first;n.view=[];n.renderedView=null;n.externalMeasured=null;n.viewOffset=0;n.lastWrapHeight=n.lastWrapWidth=0;n.updateLineNumbers=null;n.nativeBarWidth=n.barHeight=n.barWidth=0;n.scrollbarsClipped=!1;n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null;n.prevInput="";n.alignWidgets=!1;n.pollingFast=!1;n.poll=new vo;n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null;n.inaccurateSelection=!1;n.maxLine=null;n.maxLineLength=0;n.maxLineChanged=!1;n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null;n.shift=!1;n.selForContextMenu=null}function n(e){e.doc.mode=t.getMode(e.options,e.doc.modeOption);r(e)}function r(t){t.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null);t.styles&&(t.styles=null)});t.doc.frontier=t.doc.first;Te(t,100);t.state.modeGen++;t.curOp&&xn(t)}function i(t){if(t.options.lineWrapping){Ps(t.display.wrapper,"CodeMirror-wrap");t.display.sizer.style.minWidth="";t.display.sizerWidth=null}else{js(t.display.wrapper,"CodeMirror-wrap");h(t)}a(t);xn(t);Ve(t);setTimeout(function(){y(t)},100)}function o(t){var e=nn(t.display),n=t.options.lineWrapping,r=n&&Math.max(5,t.display.scroller.clientWidth/rn(t.display)-3);return function(i){if(ui(t.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*e:o+e}}function a(t){var e=t.doc,n=o(t);e.iter(function(t){var e=n(t);e!=t.height&&zi(t,e)})}function s(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-");Ve(t)}function l(t){u(t);xn(t);setTimeout(function(){w(t)},20)}function u(t){var e=t.display.gutters,n=t.options.gutters;Ao(e);for(var r=0;r<n.length;++r){var i=n[r],o=e.appendChild(Lo("div",null,"CodeMirror-gutter "+i));if("CodeMirror-linenumbers"==i){t.display.lineGutter=o;o.style.width=(t.display.lineNumWidth||1)+"px"}}e.style.display=r?"":"none";c(t)}function c(t){var e=t.display.gutters.offsetWidth;t.display.sizer.style.marginLeft=e+"px"}function f(t){if(0==t.height)return 0;for(var e,n=t.text.length,r=t;e=ni(r);){var i=e.find(0,!0);r=i.from.line;n+=i.from.ch-i.to.ch}r=t;for(;e=ri(r);){var i=e.find(0,!0);n-=r.text.length-i.from.ch;r=i.to.line;n+=r.text.length-i.to.ch}return n}function h(t){var e=t.display,n=t.doc;e.maxLine=Ri(n,n.first);e.maxLineLength=f(e.maxLine);e.maxLineChanged=!0;n.iter(function(t){var n=f(t);if(n>e.maxLineLength){e.maxLineLength=n;e.maxLine=t}})}function d(t){var e=wo(t.gutters,"CodeMirror-linenumbers");if(-1==e&&t.lineNumbers)t.gutters=t.gutters.concat(["CodeMirror-linenumbers"]);else if(e>-1&&!t.lineNumbers){t.gutters=t.gutters.slice(0);t.gutters.splice(e,1)}}function p(t){var e=t.display,n=e.gutters.offsetWidth,r=Math.round(t.doc.height+Le(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Ne(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}function g(t,e,n){this.cm=n;var r=this.vert=Lo("div",[Lo("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=Lo("div",[Lo("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");t(r);t(i);gs(r,"scroll",function(){r.clientHeight&&e(r.scrollTop,"vertical")});gs(i,"scroll",function(){i.clientWidth&&e(i.scrollLeft,"horizontal")});this.checkedOverlay=!1;ia&&8>oa&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function m(){}function v(e){if(e.display.scrollbars){e.display.scrollbars.clear();e.display.scrollbars.addClass&&js(e.display.wrapper,e.display.scrollbars.addClass)}e.display.scrollbars=new t.scrollbarModel[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller);gs(t,"mousedown",function(){e.state.focused&&setTimeout(ko(Nn,e),0)});t.setAttribute("not-content","true")},function(t,n){"horizontal"==n?Gn(e,t):Xn(e,t)},e);e.display.scrollbars.addClass&&Ps(e.display.wrapper,e.display.scrollbars.addClass)}function y(t,e){e||(e=p(t));var n=t.display.barWidth,r=t.display.barHeight;b(t,e);for(var i=0;4>i&&n!=t.display.barWidth||r!=t.display.barHeight;i++){n!=t.display.barWidth&&t.options.lineWrapping&&N(t);b(t,p(t));n=t.display.barWidth;r=t.display.barHeight}}function b(t,e){var n=t.display,r=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px";n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px";if(r.right&&r.bottom){n.scrollbarFiller.style.display="block";n.scrollbarFiller.style.height=r.bottom+"px";n.scrollbarFiller.style.width=r.right+"px"}else n.scrollbarFiller.style.display="";if(r.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter){n.gutterFiller.style.display="block";n.gutterFiller.style.height=r.bottom+"px";n.gutterFiller.style.width=e.gutterWidth+"px"}else n.gutterFiller.style.display=""}function x(t,e,n){var r=n&&null!=n.top?Math.max(0,n.top):t.scroller.scrollTop;r=Math.floor(r-De(t));var i=n&&null!=n.bottom?n.bottom:r+t.wrapper.clientHeight,o=Ui(e,r),a=Ui(e,i);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;if(o>s){o=s;a=Ui(e,Bi(Ri(e,s))+t.wrapper.clientHeight)}else if(Math.min(l,e.lastLine())>=a){o=Ui(e,Bi(Ri(e,l))-t.wrapper.clientHeight);a=l}}return{from:o,to:Math.max(a,o+1)}}function w(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var r=T(e)-e.scroller.scrollLeft+t.doc.scrollLeft,i=e.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){t.options.fixedGutter&&n[a].gutter&&(n[a].gutter.style.left=o);var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=o}t.options.fixedGutter&&(e.gutters.style.left=r+i+"px")}}function C(t){if(!t.options.lineNumbers)return!1;var e=t.doc,n=S(t.options,e.first+e.size-1),r=t.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(Lo("div",[Lo("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;r.lineGutter.style.width="";r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a);r.lineNumWidth=r.lineNumInnerWidth+a;r.lineNumChars=r.lineNumInnerWidth?n.length:-1;r.lineGutter.style.width=r.lineNumWidth+"px";c(t);return!0}return!1}function S(t,e){return String(t.lineNumberFormatter(e+t.firstLineNumber))}function T(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function k(t,e,n){var r=t.display;this.viewport=e;this.visible=x(r,t.doc,e);this.editorIsHidden=!r.wrapper.offsetWidth;this.wrapperHeight=r.wrapper.clientHeight;this.wrapperWidth=r.wrapper.clientWidth;this.oldDisplayWidth=Ee(t);this.force=n;this.dims=j(t)}function _(t){var e=t.display;if(!e.scrollbarsClipped&&e.scroller.offsetWidth){e.nativeBarWidth=e.scroller.offsetWidth-e.scroller.clientWidth;e.heightForcer.style.height=Ne(t)+"px";e.sizer.style.marginBottom=-e.nativeBarWidth+"px";e.sizer.style.borderRightWidth=Ne(t)+"px";e.scrollbarsClipped=!0}}function M(t,e){var n=t.display,r=t.doc;if(e.editorIsHidden){Cn(t);return!1}if(!e.force&&e.visible.from>=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==_n(t))return!1;if(C(t)){Cn(t);e.dims=j(t)}var i=r.first+r.size,o=Math.max(e.visible.from-t.options.viewportMargin,r.first),a=Math.min(i,e.visible.to+t.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom));n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo));if(Ca){o=si(t.doc,o);a=li(t.doc,a)}var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;kn(t,o,a);n.viewOffset=Bi(Ri(t.doc,n.viewFrom));t.display.mover.style.top=n.viewOffset+"px";var l=_n(t);if(!s&&0==l&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=jo();l>4&&(n.lineDiv.style.display="none");P(t,n.updateLineNumbers,e.dims);l>4&&(n.lineDiv.style.display="");n.renderedView=n.view;u&&jo()!=u&&u.offsetHeight&&u.focus();Ao(n.cursorDiv);Ao(n.selectionDiv);n.gutters.style.height=0;if(s){n.lastWrapHeight=e.wrapperHeight;n.lastWrapWidth=e.wrapperWidth;Te(t,400)}n.updateLineNumbers=null;return!0}function D(t,e){for(var n=e.force,r=e.viewport,i=!0;;i=!1){if(i&&t.options.lineWrapping&&e.oldDisplayWidth!=Ee(t))n=!0;else{n=!1;r&&null!=r.top&&(r={top:Math.min(t.doc.height+Le(t.display)-je(t),r.top)});e.visible=x(t.display,t.doc,r);if(e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break}if(!M(t,e))break;N(t);var o=p(t);xe(t);A(t,o);y(t,o)}co(t,"update",t);if(t.display.viewFrom!=t.display.reportedViewFrom||t.display.viewTo!=t.display.reportedViewTo){co(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo);t.display.reportedViewFrom=t.display.viewFrom;t.display.reportedViewTo=t.display.viewTo}}function L(t,e){var n=new k(t,e);if(M(t,n)){N(t);D(t,n);var r=p(t);xe(t);A(t,r);y(t,r)}}function A(t,e){t.display.sizer.style.minHeight=e.docHeight+"px";var n=e.docHeight+t.display.barHeight;t.display.heightForcer.style.top=n+"px";t.display.gutters.style.height=Math.max(n+Ne(t),e.clientHeight)+"px"}function N(t){for(var e=t.display,n=e.lineDiv.offsetTop,r=0;r<e.view.length;r++){var i,o=e.view[r];if(!o.hidden){if(ia&&8>oa){var a=o.node.offsetTop+o.node.offsetHeight;i=a-n;n=a}else{var s=o.node.getBoundingClientRect();i=s.bottom-s.top}var l=o.line.height-i;2>i&&(i=nn(e));if(l>.001||-.001>l){zi(o.line,i);E(o.line);if(o.rest)for(var u=0;u<o.rest.length;u++)E(o.rest[u])}}}}function E(t){if(t.widgets)for(var e=0;e<t.widgets.length;++e)t.widgets[e].height=t.widgets[e].node.offsetHeight}function j(t){for(var e=t.display,n={},r={},i=e.gutters.clientLeft,o=e.gutters.firstChild,a=0;o;o=o.nextSibling,++a){n[t.options.gutters[a]]=o.offsetLeft+o.clientLeft+i;r[t.options.gutters[a]]=o.clientWidth}return{fixedPos:T(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:e.wrapper.clientWidth}}function P(t,e,n){function r(e){var n=e.nextSibling;aa&&ma&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e);return n}for(var i=t.display,o=t.options.lineNumbers,a=i.lineDiv,s=a.firstChild,l=i.view,u=i.viewFrom,c=0;c<l.length;c++){var f=l[c];if(f.hidden);else if(f.node){for(;s!=f.node;)s=r(s);var h=o&&null!=e&&u>=e&&f.lineNumber;if(f.changes){wo(f.changes,"gutter")>-1&&(h=!1);I(t,f,u,n)}if(h){Ao(f.lineNumber);f.lineNumber.appendChild(document.createTextNode(S(t.options,u)))}s=f.node.nextSibling}else{var d=U(t,f,u,n);a.insertBefore(d,s)}u+=f.size}for(;s;)s=r(s)}function I(t,e,n,r){for(var i=0;i<e.changes.length;i++){var o=e.changes[i];"text"==o?F(t,e):"gutter"==o?z(t,e,n,r):"class"==o?W(e):"widget"==o&&q(e,r)}e.changes=null}function H(t){if(t.node==t.text){t.node=Lo("div",null,null,"position: relative");t.text.parentNode&&t.text.parentNode.replaceChild(t.node,t.text);t.node.appendChild(t.text);ia&&8>oa&&(t.node.style.zIndex=2)}return t.node}function O(t){var e=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;e&&(e+=" CodeMirror-linebackground");if(t.background)if(e)t.background.className=e;else{t.background.parentNode.removeChild(t.background);t.background=null}else if(e){var n=H(t);t.background=n.insertBefore(Lo("div",null,e),n.firstChild)}}function R(t,e){var n=t.display.externalMeasured;if(n&&n.line==e.line){t.display.externalMeasured=null;e.measure=n.measure;return n.built}return ki(t,e)}function F(t,e){var n=e.text.className,r=R(t,e);e.text==e.node&&(e.node=r.pre);e.text.parentNode.replaceChild(r.pre,e.text);e.text=r.pre;if(r.bgClass!=e.bgClass||r.textClass!=e.textClass){e.bgClass=r.bgClass;e.textClass=r.textClass;W(e)}else n&&(e.text.className=n)}function W(t){O(t);t.line.wrapClass?H(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var e=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=e||""}function z(t,e,n,r){if(e.gutter){e.node.removeChild(e.gutter);e.gutter=null}var i=e.line.gutterMarkers;if(t.options.lineNumbers||i){var o=H(e),a=e.gutter=o.insertBefore(Lo("div",null,"CodeMirror-gutter-wrapper","left: "+(t.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.text);e.line.gutterClass&&(a.className+=" "+e.line.gutterClass);!t.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(e.lineNumber=a.appendChild(Lo("div",S(t.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+t.display.lineNumInnerWidth+"px")));if(i)for(var s=0;s<t.options.gutters.length;++s){var l=t.options.gutters[s],u=i.hasOwnProperty(l)&&i[l];u&&a.appendChild(Lo("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[l]+"px; width: "+r.gutterWidth[l]+"px"))}}}function q(t,e){t.alignable&&(t.alignable=null);for(var n,r=t.node.firstChild;r;r=n){var n=r.nextSibling;"CodeMirror-linewidget"==r.className&&t.node.removeChild(r)}B(t,e)}function U(t,e,n,r){var i=R(t,e);e.text=e.node=i.pre;i.bgClass&&(e.bgClass=i.bgClass);i.textClass&&(e.textClass=i.textClass);W(e);z(t,e,n,r);B(e,r);return e.node}function B(t,e){V(t.line,t,e,!0);if(t.rest)for(var n=0;n<t.rest.length;n++)V(t.rest[n],t,e,!1)}function V(t,e,n,r){if(t.widgets)for(var i=H(e),o=0,a=t.widgets;o<a.length;++o){var s=a[o],l=Lo("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||l.setAttribute("cm-ignore-events","true");X(s,l,e,n);r&&s.above?i.insertBefore(l,e.gutter||e.text):i.appendChild(l);co(s,"redraw")}}function X(t,e,n,r){if(t.noHScroll){(n.alignable||(n.alignable=[])).push(e);var i=r.wrapperWidth;e.style.left=r.fixedPos+"px";if(!t.coverGutter){i-=r.gutterTotalWidth;e.style.paddingLeft=r.gutterTotalWidth+"px"}e.style.width=i+"px"}if(t.coverGutter){e.style.zIndex=5;e.style.position="relative";t.noHScroll||(e.style.marginLeft=-r.gutterTotalWidth+"px")}}function G(t){return Sa(t.line,t.ch)}function $(t,e){return Ta(t,e)<0?e:t}function Y(t,e){return Ta(t,e)<0?t:e}function J(t,e){this.ranges=t;this.primIndex=e}function K(t,e){this.anchor=t;this.head=e}function Z(t,e){var n=t[e];t.sort(function(t,e){return Ta(t.from(),e.from())});e=wo(t,n);for(var r=1;r<t.length;r++){var i=t[r],o=t[r-1];if(Ta(o.to(),i.from())>=0){var a=Y(o.from(),i.from()),s=$(o.to(),i.to()),l=o.empty()?i.from()==i.head:o.from()==o.head;e>=r&&--e;t.splice(--r,2,new K(l?s:a,l?a:s))}}return new J(t,e)}function Q(t,e){return new J([new K(t,e||t)],0)}function te(t,e){return Math.max(t.first,Math.min(e,t.first+t.size-1))}function ee(t,e){if(e.line<t.first)return Sa(t.first,0);var n=t.first+t.size-1;return e.line>n?Sa(n,Ri(t,n).text.length):ne(e,Ri(t,e.line).text.length)}function ne(t,e){var n=t.ch;return null==n||n>e?Sa(t.line,e):0>n?Sa(t.line,0):t}function re(t,e){return e>=t.first&&e<t.first+t.size}function ie(t,e){for(var n=[],r=0;r<e.length;r++)n[r]=ee(t,e[r]);return n}function oe(t,e,n,r){if(t.cm&&t.cm.display.shift||t.extend){var i=e.anchor;if(r){var o=Ta(n,i)<0;if(o!=Ta(r,i)<0){i=n;n=r}else o!=Ta(n,r)<0&&(n=r)}return new K(i,n)}return new K(r||n,n)}function ae(t,e,n,r){he(t,new J([oe(t,t.sel.primary(),e,n)],0),r)}function se(t,e,n){for(var r=[],i=0;i<t.sel.ranges.length;i++)r[i]=oe(t,t.sel.ranges[i],e[i],null);var o=Z(r,t.sel.primIndex);he(t,o,n)}function le(t,e,n,r){var i=t.sel.ranges.slice(0);i[e]=n;he(t,Z(i,t.sel.primIndex),r)}function ue(t,e,n,r){he(t,Q(e,n),r)}function ce(t,e){var n={ranges:e.ranges,update:function(e){this.ranges=[];for(var n=0;n<e.length;n++)this.ranges[n]=new K(ee(t,e[n].anchor),ee(t,e[n].head))}};vs(t,"beforeSelectionChange",t,n);t.cm&&vs(t.cm,"beforeSelectionChange",t.cm,n);return n.ranges!=e.ranges?Z(n.ranges,n.ranges.length-1):e}function fe(t,e,n){var r=t.history.done,i=xo(r);if(i&&i.ranges){r[r.length-1]=e;de(t,e,n)}else he(t,e,n)}function he(t,e,n){de(t,e,n);Zi(t,t.sel,t.cm?t.cm.curOp.id:0/0,n)}function de(t,e,n){(go(t,"beforeSelectionChange")||t.cm&&go(t.cm,"beforeSelectionChange"))&&(e=ce(t,e));var r=n&&n.bias||(Ta(e.primary().head,t.sel.primary().head)<0?-1:1);pe(t,me(t,e,r,!0));n&&n.scroll===!1||!t.cm||kr(t.cm)}function pe(t,e){if(!e.equals(t.sel)){t.sel=e;if(t.cm){t.cm.curOp.updateInput=t.cm.curOp.selectionChanged=!0;po(t.cm)}co(t,"cursorActivity",t)}}function ge(t){pe(t,me(t,t.sel,null,!1),ws)}function me(t,e,n,r){for(var i,o=0;o<e.ranges.length;o++){var a=e.ranges[o],s=ve(t,a.anchor,n,r),l=ve(t,a.head,n,r);if(i||s!=a.anchor||l!=a.head){i||(i=e.ranges.slice(0,o));i[o]=new K(s,l)}}return i?Z(i,e.primIndex):e}function ve(t,e,n,r){var i=!1,o=e,a=n||1;t.cantEdit=!1;t:for(;;){var s=Ri(t,o.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var u=s.markedSpans[l],c=u.marker;if((null==u.from||(c.inclusiveLeft?u.from<=o.ch:u.from<o.ch))&&(null==u.to||(c.inclusiveRight?u.to>=o.ch:u.to>o.ch))){if(r){vs(c,"beforeCursorEnter");if(c.explicitlyCleared){if(s.markedSpans){--l;continue}break}}if(!c.atomic)continue;var f=c.find(0>a?-1:1);if(0==Ta(f,o)){f.ch+=a;f.ch<0?f=f.line>t.first?ee(t,Sa(f.line-1)):null:f.ch>s.text.length&&(f=f.line<t.first+t.size-1?Sa(f.line+1,0):null);if(!f){if(i){if(!r)return ve(t,e,n,!0);t.cantEdit=!0;return Sa(t.first,0)}i=!0;f=e;a=-a}}o=f;continue t}}return o}}function ye(t){for(var e=t.display,n=t.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++){var s=n.sel.ranges[a],l=s.empty();(l||t.options.showCursorWhenSelecting)&&we(t,s,i);l||Ce(t,s,o)}if(t.options.moveInputWithCursor){var u=Ke(t,n.sel.primary().head,"div"),c=e.wrapper.getBoundingClientRect(),f=e.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,u.top+f.top-c.top));r.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,u.left+f.left-c.left))}return r}function be(t,e){No(t.display.cursorDiv,e.cursors);No(t.display.selectionDiv,e.selection);if(null!=e.teTop){t.display.inputDiv.style.top=e.teTop+"px";t.display.inputDiv.style.left=e.teLeft+"px"}}function xe(t){be(t,ye(t))}function we(t,e,n){var r=Ke(t,e.head,"div",null,null,!t.options.singleCursorHeightPerLine),i=n.appendChild(Lo("div"," ","CodeMirror-cursor"));i.style.left=r.left+"px";i.style.top=r.top+"px";i.style.height=Math.max(0,r.bottom-r.top)*t.options.cursorHeight+"px";if(r.other){var o=n.appendChild(Lo("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));
o.style.display="";o.style.left=r.other.left+"px";o.style.top=r.other.top+"px";o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function Ce(t,e,n){function r(t,e,n,r){0>e&&(e=0);e=Math.round(e);r=Math.round(r);s.appendChild(Lo("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px; top: "+e+"px; width: "+(null==n?c-t:n)+"px; height: "+(r-e)+"px"))}function i(e,n,i){function o(n,r){return Je(t,Sa(e,n),"div",f,r)}var s,l,f=Ri(a,e),h=f.text.length;qo(Vi(f),n||0,null==i?h:i,function(t,e,a){var f,d,p,g=o(t,"left");if(t==e){f=g;d=p=g.left}else{f=o(e-1,"right");if("rtl"==a){var m=g;g=f;f=m}d=g.left;p=f.right}null==n&&0==t&&(d=u);if(f.top-g.top>3){r(d,g.top,null,g.bottom);d=u;g.bottom<f.top&&r(d,g.bottom,null,f.top)}null==i&&e==h&&(p=c);(!s||g.top<s.top||g.top==s.top&&g.left<s.left)&&(s=g);(!l||f.bottom>l.bottom||f.bottom==l.bottom&&f.right>l.right)&&(l=f);u+1>d&&(d=u);r(d,f.top,p-d,f.bottom)});return{start:s,end:l}}var o=t.display,a=t.doc,s=document.createDocumentFragment(),l=Ae(t.display),u=l.left,c=Math.max(o.sizerWidth,Ee(t)-o.sizer.offsetLeft)-l.right,f=e.from(),h=e.to();if(f.line==h.line)i(f.line,f.ch,h.ch);else{var d=Ri(a,f.line),p=Ri(a,h.line),g=oi(d)==oi(p),m=i(f.line,f.ch,g?d.text.length+1:null).end,v=i(h.line,g?0:null,h.ch).start;if(g)if(m.top<v.top-2){r(m.right,m.top,null,m.bottom);r(u,v.top,v.left,v.bottom)}else r(m.right,m.top,v.left-m.right,m.bottom);m.bottom<v.top&&r(u,m.bottom,null,v.top)}n.appendChild(s)}function Se(t){if(t.state.focused){var e=t.display;clearInterval(e.blinker);var n=!0;e.cursorDiv.style.visibility="";t.options.cursorBlinkRate>0?e.blinker=setInterval(function(){e.cursorDiv.style.visibility=(n=!n)?"":"hidden"},t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Te(t,e){t.doc.mode.startState&&t.doc.frontier<t.display.viewTo&&t.state.highlight.set(e,ko(ke,t))}function ke(t){var e=t.doc;e.frontier<e.first&&(e.frontier=e.first);if(!(e.frontier>=t.display.viewTo)){var n=+new Date+t.options.workTime,r=Ga(e.mode,Me(t,e.frontier)),i=[];e.iter(e.frontier,Math.min(e.first+e.size,t.display.viewTo+500),function(o){if(e.frontier>=t.display.viewFrom){var a=o.styles,s=wi(t,o,r,!0);o.styles=s.styles;var l=o.styleClasses,u=s.classes;u?o.styleClasses=u:l&&(o.styleClasses=null);for(var c=!a||a.length!=o.styles.length||l!=u&&(!l||!u||l.bgClass!=u.bgClass||l.textClass!=u.textClass),f=0;!c&&f<a.length;++f)c=a[f]!=o.styles[f];c&&i.push(e.frontier);o.stateAfter=Ga(e.mode,r)}else{Si(t,o.text,r);o.stateAfter=e.frontier%5==0?Ga(e.mode,r):null}++e.frontier;if(+new Date>n){Te(t,t.options.workDelay);return!0}});i.length&&pn(t,function(){for(var e=0;e<i.length;e++)wn(t,i[e],"text")})}}function _e(t,e,n){for(var r,i,o=t.doc,a=n?-1:e-(t.doc.mode.innerMode?1e3:100),s=e;s>a;--s){if(s<=o.first)return o.first;var l=Ri(o,s-1);if(l.stateAfter&&(!n||s<=o.frontier))return s;var u=Ts(l.text,null,t.options.tabSize);if(null==i||r>u){i=s-1;r=u}}return i}function Me(t,e,n){var r=t.doc,i=t.display;if(!r.mode.startState)return!0;var o=_e(t,e,n),a=o>r.first&&Ri(r,o-1).stateAfter;a=a?Ga(r.mode,a):$a(r.mode);r.iter(o,e,function(n){Si(t,n.text,a);var s=o==e-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;n.stateAfter=s?Ga(r.mode,a):null;++o});n&&(r.frontier=o);return a}function De(t){return t.lineSpace.offsetTop}function Le(t){return t.mover.offsetHeight-t.lineSpace.offsetHeight}function Ae(t){if(t.cachedPaddingH)return t.cachedPaddingH;var e=No(t.measure,Lo("pre","x")),n=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};isNaN(r.left)||isNaN(r.right)||(t.cachedPaddingH=r);return r}function Ne(t){return bs-t.display.nativeBarWidth}function Ee(t){return t.display.scroller.clientWidth-Ne(t)-t.display.barWidth}function je(t){return t.display.scroller.clientHeight-Ne(t)-t.display.barHeight}function Pe(t,e,n){var r=t.options.lineWrapping,i=r&&Ee(t);if(!e.measure.heights||r&&e.measure.width!=i){var o=e.measure.heights=[];if(r){e.measure.width=i;for(var a=e.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],u=a[s+1];Math.abs(l.bottom-u.bottom)>2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Ie(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};for(var r=0;r<t.rest.length;r++)if(t.rest[r]==e)return{map:t.measure.maps[r],cache:t.measure.caches[r]};for(var r=0;r<t.rest.length;r++)if(qi(t.rest[r])>n)return{map:t.measure.maps[r],cache:t.measure.caches[r],before:!0}}function He(t,e){e=oi(e);var n=qi(e),r=t.display.externalMeasured=new yn(t.doc,e,n);r.lineN=n;var i=r.built=ki(t,r);r.text=i.pre;No(t.display.lineMeasure,i.pre);return r}function Oe(t,e,n,r){return We(t,Fe(t,e),n,r)}function Re(t,e){if(e>=t.display.viewFrom&&e<t.display.viewTo)return t.display.view[Sn(t,e)];var n=t.display.externalMeasured;return n&&e>=n.lineN&&e<n.lineN+n.size?n:void 0}function Fe(t,e){var n=qi(e),r=Re(t,n);r&&!r.text?r=null:r&&r.changes&&I(t,r,n,j(t));r||(r=He(t,e));var i=Ie(r,e,n);return{line:e,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function We(t,e,n,r,i){e.before&&(n=-1);var o,a=n+(r||"");if(e.cache.hasOwnProperty(a))o=e.cache[a];else{e.rect||(e.rect=e.view.text.getBoundingClientRect());if(!e.hasHeights){Pe(t,e.view,e.rect);e.hasHeights=!0}o=ze(t,e,n,r);o.bogus||(e.cache[a]=o)}return{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function ze(t,e,n,r){for(var i,o,a,s,l=e.map,u=0;u<l.length;u+=3){var c=l[u],f=l[u+1];if(c>n){o=0;a=1;s="left"}else if(f>n){o=n-c;a=o+1}else if(u==l.length-3||n==f&&l[u+3]>n){a=f-c;o=a-1;n>=f&&(s="right")}if(null!=o){i=l[u+2];c==f&&r==(i.insertLeft?"left":"right")&&(s=r);if("left"==r&&0==o)for(;u&&l[u-2]==l[u-3]&&l[u-1].insertLeft;){i=l[(u-=3)+2];s="left"}if("right"==r&&o==f-c)for(;u<l.length-3&&l[u+3]==l[u+4]&&!l[u+5].insertLeft;){i=l[(u+=3)+2];s="right"}break}}var h;if(3==i.nodeType){for(var u=0;4>u;u++){for(;o&&Do(e.line.text.charAt(c+o));)--o;for(;f>c+a&&Do(e.line.text.charAt(c+a));)++a;if(ia&&9>oa&&0==o&&a==f-c)h=i.parentNode.getBoundingClientRect();else if(ia&&t.options.lineWrapping){var d=Ms(i,o,a).getClientRects();h=d.length?d["right"==r?d.length-1:0]:Da}else h=Ms(i,o,a).getBoundingClientRect()||Da;if(h.left||h.right||0==o)break;a=o;o-=1;s="right"}ia&&11>oa&&(h=qe(t.display.measure,h))}else{o>0&&(s=r="right");var d;h=t.options.lineWrapping&&(d=i.getClientRects()).length>1?d["right"==r?d.length-1:0]:i.getBoundingClientRect()}if(ia&&9>oa&&!o&&(!h||!h.left&&!h.right)){var p=i.parentNode.getClientRects()[0];h=p?{left:p.left,right:p.left+rn(t.display),top:p.top,bottom:p.bottom}:Da}for(var g=h.top-e.rect.top,m=h.bottom-e.rect.top,v=(g+m)/2,y=e.view.measure.heights,u=0;u<y.length-1&&!(v<y[u]);u++);var b=u?y[u-1]:0,x=y[u],w={left:("right"==s?h.right:h.left)-e.rect.left,right:("left"==s?h.left:h.right)-e.rect.left,top:b,bottom:x};h.left||h.right||(w.bogus=!0);if(!t.options.singleCursorHeightPerLine){w.rtop=g;w.rbottom=m}return w}function qe(t,e){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!zo(t))return e;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:e.left*n,right:e.right*n,top:e.top*r,bottom:e.bottom*r}}function Ue(t){if(t.measure){t.measure.cache={};t.measure.heights=null;if(t.rest)for(var e=0;e<t.rest.length;e++)t.measure.caches[e]={}}}function Be(t){t.display.externalMeasure=null;Ao(t.display.lineMeasure);for(var e=0;e<t.display.view.length;e++)Ue(t.display.view[e])}function Ve(t){Be(t);t.display.cachedCharWidth=t.display.cachedTextHeight=t.display.cachedPaddingH=null;t.options.lineWrapping||(t.display.maxLineChanged=!0);t.display.lineNumChars=null}function Xe(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Ge(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function $e(t,e,n,r){if(e.widgets)for(var i=0;i<e.widgets.length;++i)if(e.widgets[i].above){var o=hi(e.widgets[i]);n.top+=o;n.bottom+=o}if("line"==r)return n;r||(r="local");var a=Bi(e);"local"==r?a+=De(t.display):a-=t.display.viewOffset;if("page"==r||"window"==r){var s=t.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:Ge());var l=s.left+("window"==r?0:Xe());n.left+=l;n.right+=l}n.top+=a;n.bottom+=a;return n}function Ye(t,e,n){if("div"==n)return e;var r=e.left,i=e.top;if("page"==n){r-=Xe();i-=Ge()}else if("local"==n||!n){var o=t.display.sizer.getBoundingClientRect();r+=o.left;i+=o.top}var a=t.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function Je(t,e,n,r,i){r||(r=Ri(t.doc,e.line));return $e(t,r,Oe(t,r,e.ch,i),n)}function Ke(t,e,n,r,i,o){function a(e,a){var s=We(t,i,e,a?"right":"left",o);a?s.left=s.right:s.right=s.left;return $e(t,r,s,n)}function s(t,e){var n=l[e],r=n.level%2;if(t==Uo(n)&&e&&n.level<l[e-1].level){n=l[--e];t=Bo(n)-(n.level%2?0:1);r=!0}else if(t==Bo(n)&&e<l.length-1&&n.level<l[e+1].level){n=l[++e];t=Uo(n)-n.level%2;r=!1}return r&&t==n.to&&t>n.from?a(t-1):a(t,r)}r=r||Ri(t.doc,e.line);i||(i=Fe(t,r));var l=Vi(r),u=e.ch;if(!l)return a(u);var c=Ko(l,u),f=s(u,c);null!=qs&&(f.other=s(u,qs));return f}function Ze(t,e){var n=0,e=ee(t.doc,e);t.options.lineWrapping||(n=rn(t.display)*e.ch);var r=Ri(t.doc,e.line),i=Bi(r)+De(t.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Qe(t,e,n,r){var i=Sa(t,e);i.xRel=r;n&&(i.outside=!0);return i}function tn(t,e,n){var r=t.doc;n+=t.display.viewOffset;if(0>n)return Qe(r.first,0,!0,-1);var i=Ui(r,n),o=r.first+r.size-1;if(i>o)return Qe(r.first+r.size-1,Ri(r,o).text.length,!0,1);0>e&&(e=0);for(var a=Ri(r,i);;){var s=en(t,a,i,e,n),l=ri(a),u=l&&l.find(0,!0);if(!l||!(s.ch>u.from.ch||s.ch==u.from.ch&&s.xRel>0))return s;i=qi(a=u.to.line)}}function en(t,e,n,r,i){function o(r){var i=Ke(t,Sa(n,r),"line",e,u);s=!0;if(a>i.bottom)return i.left-l;if(a<i.top)return i.left+l;s=!1;return i.left}var a=i-Bi(e),s=!1,l=2*t.display.wrapper.clientWidth,u=Fe(t,e),c=Vi(e),f=e.text.length,h=Vo(e),d=Xo(e),p=o(h),g=s,m=o(d),v=s;if(r>m)return Qe(n,d,v,1);for(;;){if(c?d==h||d==Qo(e,h,1):1>=d-h){for(var y=p>r||m-r>=r-p?h:d,b=r-(y==h?p:m);Do(e.text.charAt(y));)++y;var x=Qe(n,y,y==h?g:v,-1>b?-1:b>1?1:0);return x}var w=Math.ceil(f/2),C=h+w;if(c){C=h;for(var S=0;w>S;++S)C=Qo(e,C,1)}var T=o(C);if(T>r){d=C;m=T;(v=s)&&(m+=1e3);f=w}else{h=C;p=T;g=s;f-=w}}}function nn(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==ka){ka=Lo("pre");for(var e=0;49>e;++e){ka.appendChild(document.createTextNode("x"));ka.appendChild(Lo("br"))}ka.appendChild(document.createTextNode("x"))}No(t.measure,ka);var n=ka.offsetHeight/50;n>3&&(t.cachedTextHeight=n);Ao(t.measure);return n||1}function rn(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=Lo("span","xxxxxxxxxx"),n=Lo("pre",[e]);No(t.measure,n);var r=e.getBoundingClientRect(),i=(r.right-r.left)/10;i>2&&(t.cachedCharWidth=i);return i||10}function on(t){t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++Aa};La?La.ops.push(t.curOp):t.curOp.ownsGroup=La={ops:[t.curOp],delayedCallbacks:[]}}function an(t){var e=t.delayedCallbacks,n=0;do{for(;n<e.length;n++)e[n]();for(var r=0;r<t.ops.length;r++){var i=t.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++](i.cm)}}while(n<e.length)}function sn(t){var e=t.curOp,n=e.ownsGroup;if(n)try{an(n)}finally{La=null;for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;ln(n)}}function ln(t){for(var e=t.ops,n=0;n<e.length;n++)un(e[n]);for(var n=0;n<e.length;n++)cn(e[n]);for(var n=0;n<e.length;n++)fn(e[n]);for(var n=0;n<e.length;n++)hn(e[n]);for(var n=0;n<e.length;n++)dn(e[n])}function un(t){var e=t.cm,n=e.display;_(e);t.updateMaxLine&&h(e);t.mustUpdate=t.viewChanged||t.forceUpdate||null!=t.scrollTop||t.scrollToPos&&(t.scrollToPos.from.line<n.viewFrom||t.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping;t.update=t.mustUpdate&&new k(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function cn(t){t.updatedDisplay=t.mustUpdate&&M(t.cm,t.update)}function fn(t){var e=t.cm,n=e.display;t.updatedDisplay&&N(e);t.barMeasure=p(e);if(n.maxLineChanged&&!e.options.lineWrapping){t.adjustWidthTo=Oe(e,n.maxLine,n.maxLine.text.length).left+3;e.display.sizerWidth=t.adjustWidthTo;t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+Ne(e)+e.display.barWidth);t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Ee(e))}(t.updatedDisplay||t.selectionChanged)&&(t.newSelectionNodes=ye(e))}function hn(t){var e=t.cm;if(null!=t.adjustWidthTo){e.display.sizer.style.minWidth=t.adjustWidthTo+"px";t.maxScrollLeft<e.doc.scrollLeft&&Gn(e,Math.min(e.display.scroller.scrollLeft,t.maxScrollLeft),!0);e.display.maxLineChanged=!1}t.newSelectionNodes&&be(e,t.newSelectionNodes);t.updatedDisplay&&A(e,t.barMeasure);(t.updatedDisplay||t.startHeight!=e.doc.height)&&y(e,t.barMeasure);t.selectionChanged&&Se(e);e.state.focused&&t.updateInput&&An(e,t.typing)}function dn(t){var e=t.cm,n=e.display,r=e.doc;t.updatedDisplay&&D(e,t.update);null==n.wheelStartX||null==t.scrollTop&&null==t.scrollLeft&&!t.scrollToPos||(n.wheelStartX=n.wheelStartY=null);if(null!=t.scrollTop&&(n.scroller.scrollTop!=t.scrollTop||t.forceScroll)){r.scrollTop=Math.max(0,Math.min(n.scroller.scrollHeight-n.scroller.clientHeight,t.scrollTop));n.scrollbars.setScrollTop(r.scrollTop);n.scroller.scrollTop=r.scrollTop}if(null!=t.scrollLeft&&(n.scroller.scrollLeft!=t.scrollLeft||t.forceScroll)){r.scrollLeft=Math.max(0,Math.min(n.scroller.scrollWidth-Ee(e),t.scrollLeft));n.scrollbars.setScrollLeft(r.scrollLeft);n.scroller.scrollLeft=r.scrollLeft;w(e)}if(t.scrollToPos){var i=wr(e,ee(r,t.scrollToPos.from),ee(r,t.scrollToPos.to),t.scrollToPos.margin);t.scrollToPos.isCursor&&e.state.focused&&xr(e,i)}var o=t.maybeHiddenMarkers,a=t.maybeUnhiddenMarkers;if(o)for(var s=0;s<o.length;++s)o[s].lines.length||vs(o[s],"hide");if(a)for(var s=0;s<a.length;++s)a[s].lines.length&&vs(a[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=e.display.scroller.scrollTop);t.changeObjs&&vs(e,"changes",e,t.changeObjs)}function pn(t,e){if(t.curOp)return e();on(t);try{return e()}finally{sn(t)}}function gn(t,e){return function(){if(t.curOp)return e.apply(t,arguments);on(t);try{return e.apply(t,arguments)}finally{sn(t)}}}function mn(t){return function(){if(this.curOp)return t.apply(this,arguments);on(this);try{return t.apply(this,arguments)}finally{sn(this)}}}function vn(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);on(e);try{return t.apply(this,arguments)}finally{sn(e)}}}function yn(t,e,n){this.line=e;this.rest=ai(e);this.size=this.rest?qi(xo(this.rest))-n+1:1;this.node=this.text=null;this.hidden=ui(t,e)}function bn(t,e,n){for(var r,i=[],o=e;n>o;o=r){var a=new yn(t.doc,Ri(t.doc,o),o);r=o+a.size;i.push(a)}return i}function xn(t,e,n,r){null==e&&(e=t.doc.first);null==n&&(n=t.doc.first+t.doc.size);r||(r=0);var i=t.display;r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>e)&&(i.updateLineNumbers=e);t.curOp.viewChanged=!0;if(e>=i.viewTo)Ca&&si(t.doc,e)<i.viewTo&&Cn(t);else if(n<=i.viewFrom)if(Ca&&li(t.doc,n+r)>i.viewFrom)Cn(t);else{i.viewFrom+=r;i.viewTo+=r}else if(e<=i.viewFrom&&n>=i.viewTo)Cn(t);else if(e<=i.viewFrom){var o=Tn(t,n,n+r,1);if(o){i.view=i.view.slice(o.index);i.viewFrom=o.lineN;i.viewTo+=r}else Cn(t)}else if(n>=i.viewTo){var o=Tn(t,e,e,-1);if(o){i.view=i.view.slice(0,o.index);i.viewTo=o.lineN}else Cn(t)}else{var a=Tn(t,e,e,-1),s=Tn(t,n,n+r,1);if(a&&s){i.view=i.view.slice(0,a.index).concat(bn(t,a.lineN,s.lineN)).concat(i.view.slice(s.index));i.viewTo+=r}else Cn(t)}var l=i.externalMeasured;l&&(n<l.lineN?l.lineN+=r:e<l.lineN+l.size&&(i.externalMeasured=null))}function wn(t,e,n){t.curOp.viewChanged=!0;var r=t.display,i=t.display.externalMeasured;i&&e>=i.lineN&&e<i.lineN+i.size&&(r.externalMeasured=null);if(!(e<r.viewFrom||e>=r.viewTo)){var o=r.view[Sn(t,e)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==wo(a,n)&&a.push(n)}}}function Cn(t){t.display.viewFrom=t.display.viewTo=t.doc.first;t.display.view=[];t.display.viewOffset=0}function Sn(t,e){if(e>=t.display.viewTo)return null;e-=t.display.viewFrom;if(0>e)return null;for(var n=t.display.view,r=0;r<n.length;r++){e-=n[r].size;if(0>e)return r}}function Tn(t,e,n,r){var i,o=Sn(t,e),a=t.display.view;if(!Ca||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var s=0,l=t.display.viewFrom;o>s;s++)l+=a[s].size;if(l!=e){if(r>0){if(o==a.length-1)return null;i=l+a[o].size-e;o++}else i=l-e;e+=i;n+=i}for(;si(t.doc,n)!=n;){if(o==(0>r?0:a.length-1))return null;n+=r*a[o-(0>r?1:0)].size;o+=r}return{index:o,lineN:n}}function kn(t,e,n){var r=t.display,i=r.view;if(0==i.length||e>=r.viewTo||n<=r.viewFrom){r.view=bn(t,e,n);r.viewFrom=e}else{r.viewFrom>e?r.view=bn(t,e,r.viewFrom).concat(r.view):r.viewFrom<e&&(r.view=r.view.slice(Sn(t,e)));r.viewFrom=e;r.viewTo<n?r.view=r.view.concat(bn(t,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Sn(t,n)))}r.viewTo=n}function _n(t){for(var e=t.display.view,n=0,r=0;r<e.length;r++){var i=e[r];i.hidden||i.node&&!i.changes||++n}return n}function Mn(t){t.display.pollingFast||t.display.poll.set(t.options.pollInterval,function(){Ln(t);t.state.focused&&Mn(t)})}function Dn(t){function e(){var r=Ln(t);if(r||n){t.display.pollingFast=!1;Mn(t)}else{n=!0;t.display.poll.set(60,e)}}var n=!1;t.display.pollingFast=!0;t.display.poll.set(20,e)}function Ln(t){var e=t.display.input,n=t.display.prevInput,r=t.doc;if(!t.state.focused||Rs(e)&&!n||jn(t)||t.options.disableInput||t.state.keySeq)return!1;if(t.state.pasteIncoming&&t.state.fakedLastChar){e.value=e.value.substring(0,e.value.length-1);t.state.fakedLastChar=!1}var i=e.value;if(i==n&&!t.somethingSelected())return!1;if(ia&&oa>=9&&t.display.inputHasSelection===i||ma&&/[\uf700-\uf7ff]/.test(i)){An(t);return!1}var o=!t.curOp;o&&on(t);t.display.shift=!1;8203!=i.charCodeAt(0)||r.sel!=t.display.selForContextMenu||n||(n="");for(var a=0,s=Math.min(n.length,i.length);s>a&&n.charCodeAt(a)==i.charCodeAt(a);)++a;var l=i.slice(a),u=Os(l),c=null;t.state.pasteIncoming&&r.sel.ranges.length>1&&(Na&&Na.join("\n")==l?c=r.sel.ranges.length%Na.length==0&&Co(Na,Os):u.length==r.sel.ranges.length&&(c=Co(u,function(t){return[t]})));for(var f=r.sel.ranges.length-1;f>=0;f--){var h=r.sel.ranges[f],d=h.from(),p=h.to();a<n.length?d=Sa(d.line,d.ch-(n.length-a)):t.state.overwrite&&h.empty()&&!t.state.pasteIncoming&&(p=Sa(p.line,Math.min(Ri(r,p.line).text.length,p.ch+xo(u).length)));var g=t.curOp.updateInput,m={from:d,to:p,text:c?c[f%c.length]:u,origin:t.state.pasteIncoming?"paste":t.state.cutIncoming?"cut":"+input"};dr(t.doc,m);co(t,"inputRead",t,m);if(l&&!t.state.pasteIncoming&&t.options.electricChars&&t.options.smartIndent&&h.head.ch<100&&(!f||r.sel.ranges[f-1].head.line!=h.head.line)){var v=t.getModeAt(h.head),y=Ra(m);if(v.electricChars){for(var b=0;b<v.electricChars.length;b++)if(l.indexOf(v.electricChars.charAt(b))>-1){Mr(t,y.line,"smart");break}}else v.electricInput&&v.electricInput.test(Ri(r,y.line).text.slice(0,y.ch))&&Mr(t,y.line,"smart")}}kr(t);t.curOp.updateInput=g;t.curOp.typing=!0;i.length>1e3||i.indexOf("\n")>-1?e.value=t.display.prevInput="":t.display.prevInput=i;o&&sn(t);t.state.pasteIncoming=t.state.cutIncoming=!1;return!0}function An(t,e){if(!t.display.contextMenuPending){var n,r,i=t.doc;if(t.somethingSelected()){t.display.prevInput="";var o=i.sel.primary();n=Fs&&(o.to().line-o.from().line>100||(r=t.getSelection()).length>1e3);var a=n?"-":r||t.getSelection();t.display.input.value=a;t.state.focused&&_s(t.display.input);ia&&oa>=9&&(t.display.inputHasSelection=a)}else if(!e){t.display.prevInput=t.display.input.value="";ia&&oa>=9&&(t.display.inputHasSelection=null)}t.display.inaccurateSelection=n}}function Nn(t){"nocursor"==t.options.readOnly||ga&&jo()==t.display.input||t.display.input.focus()}function En(t){if(!t.state.focused){Nn(t);ir(t)}}function jn(t){return t.options.readOnly||t.doc.cantEdit}function Pn(t){function e(e){ho(t,e)||ps(e)}function n(e){if(t.somethingSelected()){Na=t.getSelections();if(r.inaccurateSelection){r.prevInput="";r.inaccurateSelection=!1;r.input.value=Na.join("\n");_s(r.input)}}else{for(var n=[],i=[],o=0;o<t.doc.sel.ranges.length;o++){var a=t.doc.sel.ranges[o].head.line,s={anchor:Sa(a,0),head:Sa(a+1,0)};i.push(s);n.push(t.getRange(s.anchor,s.head))}if("cut"==e.type)t.setSelections(i,null,ws);else{r.prevInput="";r.input.value=n.join("\n");_s(r.input)}Na=n}"cut"==e.type&&(t.state.cutIncoming=!0)}var r=t.display;gs(r.scroller,"mousedown",gn(t,Rn));ia&&11>oa?gs(r.scroller,"dblclick",gn(t,function(e){if(!ho(t,e)){var n=On(t,e);if(n&&!Un(t,e)&&!Hn(t.display,e)){hs(e);var r=t.findWordAt(n);ae(t.doc,r.anchor,r.head)}}})):gs(r.scroller,"dblclick",function(e){ho(t,e)||hs(e)});gs(r.lineSpace,"selectstart",function(t){Hn(r,t)||hs(t)});xa||gs(r.scroller,"contextmenu",function(e){ar(t,e)});gs(r.scroller,"scroll",function(){if(r.scroller.clientHeight){Xn(t,r.scroller.scrollTop);Gn(t,r.scroller.scrollLeft,!0);vs(t,"scroll",t)}});gs(r.scroller,"mousewheel",function(e){$n(t,e)});gs(r.scroller,"DOMMouseScroll",function(e){$n(t,e)});gs(r.wrapper,"scroll",function(){r.wrapper.scrollTop=r.wrapper.scrollLeft=0});gs(r.input,"keyup",function(e){nr.call(t,e)});gs(r.input,"input",function(){ia&&oa>=9&&t.display.inputHasSelection&&(t.display.inputHasSelection=null);Ln(t)});gs(r.input,"keydown",gn(t,tr));gs(r.input,"keypress",gn(t,rr));gs(r.input,"focus",ko(ir,t));gs(r.input,"blur",ko(or,t));if(t.options.dragDrop){gs(r.scroller,"dragstart",function(e){Vn(t,e)});gs(r.scroller,"dragenter",e);gs(r.scroller,"dragover",e);gs(r.scroller,"drop",gn(t,Bn))}gs(r.scroller,"paste",function(e){if(!Hn(r,e)){t.state.pasteIncoming=!0;Nn(t);Dn(t)}});gs(r.input,"paste",function(){if(aa&&!t.state.fakedLastChar&&!(new Date-t.state.lastMiddleDown<200)){var e=r.input.selectionStart,n=r.input.selectionEnd;r.input.value+="$";r.input.selectionEnd=n;r.input.selectionStart=e;t.state.fakedLastChar=!0}t.state.pasteIncoming=!0;Dn(t)});gs(r.input,"cut",n);gs(r.input,"copy",n);fa&&gs(r.sizer,"mouseup",function(){jo()==r.input&&r.input.blur();Nn(t)})}function In(t){var e=t.display;if(e.lastWrapHeight!=e.wrapper.clientHeight||e.lastWrapWidth!=e.wrapper.clientWidth){e.cachedCharWidth=e.cachedTextHeight=e.cachedPaddingH=null;e.scrollbarsClipped=!1;t.setSize()}}function Hn(t,e){for(var n=lo(e);n!=t.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==t.sizer&&n!=t.mover)return!0}function On(t,e,n,r){var i=t.display;if(!n&&"true"==lo(e).getAttribute("not-content"))return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=e.clientX-s.left;a=e.clientY-s.top}catch(e){return null}var l,u=tn(t,o,a);if(r&&1==u.xRel&&(l=Ri(t.doc,u.line).text).length==u.ch){var c=Ts(l,l.length,t.options.tabSize)-l.length;u=Sa(u.line,Math.max(0,Math.round((o-Ae(t.display).left)/rn(t.display))-c))}return u}function Rn(t){if(!ho(this,t)){var e=this,n=e.display;n.shift=t.shiftKey;if(Hn(n,t)){if(!aa){n.scroller.draggable=!1;setTimeout(function(){n.scroller.draggable=!0},100)}}else if(!Un(e,t)){var r=On(e,t);window.focus();switch(uo(t)){case 1:r?Fn(e,t,r):lo(t)==n.scroller&&hs(t);break;case 2:aa&&(e.state.lastMiddleDown=+new Date);r&&ae(e.doc,r);setTimeout(ko(Nn,e),20);hs(t);break;case 3:xa&&ar(e,t)}}}}function Fn(t,e,n){setTimeout(ko(En,t),0);var r,i=+new Date;if(Ma&&Ma.time>i-400&&0==Ta(Ma.pos,n))r="triple";else if(_a&&_a.time>i-400&&0==Ta(_a.pos,n)){r="double";Ma={time:i,pos:n}}else{r="single";_a={time:i,pos:n}}var o,a=t.doc.sel,s=ma?e.metaKey:e.ctrlKey;t.options.dragDrop&&Hs&&!jn(t)&&"single"==r&&(o=a.contains(n))>-1&&!a.ranges[o].empty()?Wn(t,e,n,s):zn(t,e,n,r,s)}function Wn(t,e,n,r){var i=t.display,o=gn(t,function(a){aa&&(i.scroller.draggable=!1);t.state.draggingText=!1;ms(document,"mouseup",o);ms(i.scroller,"drop",o);if(Math.abs(e.clientX-a.clientX)+Math.abs(e.clientY-a.clientY)<10){hs(a);r||ae(t.doc,n);Nn(t);ia&&9==oa&&setTimeout(function(){document.body.focus();Nn(t)},20)}});aa&&(i.scroller.draggable=!0);t.state.draggingText=o;i.scroller.dragDrop&&i.scroller.dragDrop();gs(document,"mouseup",o);gs(i.scroller,"drop",o)}function zn(t,e,n,r,i){function o(e){if(0!=Ta(m,e)){m=e;if("rect"==r){for(var i=[],o=t.options.tabSize,a=Ts(Ri(u,n.line).text,n.ch,o),s=Ts(Ri(u,e.line).text,e.ch,o),l=Math.min(a,s),d=Math.max(a,s),p=Math.min(n.line,e.line),g=Math.min(t.lastLine(),Math.max(n.line,e.line));g>=p;p++){var v=Ri(u,p).text,y=yo(v,l,o);l==d?i.push(new K(Sa(p,y),Sa(p,y))):v.length>y&&i.push(new K(Sa(p,y),Sa(p,yo(v,d,o))))}i.length||i.push(new K(n,n));he(u,Z(h.ranges.slice(0,f).concat(i),f),{origin:"*mouse",scroll:!1});t.scrollIntoView(e)}else{var b=c,x=b.anchor,w=e;if("single"!=r){if("double"==r)var C=t.findWordAt(e);else var C=new K(Sa(e.line,0),ee(u,Sa(e.line+1,0)));if(Ta(C.anchor,x)>0){w=C.head;x=Y(b.from(),C.anchor)}else{w=C.anchor;x=$(b.to(),C.head)}}var i=h.ranges.slice(0);i[f]=new K(ee(u,x),w);he(u,Z(i,f),Cs)}}}function a(e){var n=++y,i=On(t,e,!0,"rect"==r);if(i)if(0!=Ta(i,m)){En(t);o(i);var s=x(l,u);(i.line>=s.to||i.line<s.from)&&setTimeout(gn(t,function(){y==n&&a(e)}),150)}else{var c=e.clientY<v.top?-20:e.clientY>v.bottom?20:0;c&&setTimeout(gn(t,function(){if(y==n){l.scroller.scrollTop+=c;a(e)}}),50)}}function s(e){y=1/0;hs(e);Nn(t);ms(document,"mousemove",b);ms(document,"mouseup",w);u.history.lastSelOrigin=null}var l=t.display,u=t.doc;hs(e);var c,f,h=u.sel,d=h.ranges;if(i&&!e.shiftKey){f=u.sel.contains(n);c=f>-1?d[f]:new K(n,n)}else c=u.sel.primary();if(e.altKey){r="rect";i||(c=new K(n,n));n=On(t,e,!0,!0);f=-1}else if("double"==r){var p=t.findWordAt(n);c=t.display.shift||u.extend?oe(u,c,p.anchor,p.head):p}else if("triple"==r){var g=new K(Sa(n.line,0),ee(u,Sa(n.line+1,0)));c=t.display.shift||u.extend?oe(u,c,g.anchor,g.head):g}else c=oe(u,c,n);if(i)if(-1==f){f=d.length;he(u,Z(d.concat([c]),f),{scroll:!1,origin:"*mouse"})}else if(d.length>1&&d[f].empty()&&"single"==r){he(u,Z(d.slice(0,f).concat(d.slice(f+1)),0));h=u.sel}else le(u,f,c,Cs);else{f=0;he(u,new J([c],0),Cs);h=u.sel}var m=n,v=l.wrapper.getBoundingClientRect(),y=0,b=gn(t,function(t){uo(t)?a(t):s(t)}),w=gn(t,s);gs(document,"mousemove",b);gs(document,"mouseup",w)}function qn(t,e,n,r,i){try{var o=e.clientX,a=e.clientY}catch(e){return!1}if(o>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;r&&hs(e);var s=t.display,l=s.lineDiv.getBoundingClientRect();if(a>l.bottom||!go(t,n))return so(e);a-=l.top-s.viewOffset;for(var u=0;u<t.options.gutters.length;++u){var c=s.gutters.childNodes[u];if(c&&c.getBoundingClientRect().right>=o){var f=Ui(t.doc,a),h=t.options.gutters[u];i(t,n,t,f,h,e);return so(e)}}}function Un(t,e){return qn(t,e,"gutterClick",!0,co)}function Bn(t){var e=this;if(!ho(e,t)&&!Hn(e.display,t)){hs(t);ia&&(Ea=+new Date);var n=On(e,t,!0),r=t.dataTransfer.files;if(n&&!jn(e))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,s=function(t,r){var s=new FileReader;s.onload=gn(e,function(){o[r]=s.result;if(++a==i){n=ee(e.doc,n);var t={from:n,to:n,text:Os(o.join("\n")),origin:"paste"};dr(e.doc,t);fe(e.doc,Q(n,Ra(t)))}});s.readAsText(t)},l=0;i>l;++l)s(r[l],l);else{if(e.state.draggingText&&e.doc.sel.contains(n)>-1){e.state.draggingText(t);setTimeout(ko(Nn,e),20);return}try{var o=t.dataTransfer.getData("Text");if(o){if(e.state.draggingText&&!(ma?t.metaKey:t.ctrlKey))var u=e.listSelections();de(e.doc,Q(n,n));if(u)for(var l=0;l<u.length;++l)br(e.doc,"",u[l].anchor,u[l].head,"drag");e.replaceSelection(o,"around","paste");Nn(e)}}catch(t){}}}}function Vn(t,e){if(ia&&(!t.state.draggingText||+new Date-Ea<100))ps(e);else if(!ho(t,e)&&!Hn(t.display,e)){e.dataTransfer.setData("Text",t.getSelection());if(e.dataTransfer.setDragImage&&!ca){var n=Lo("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";if(ua){n.width=n.height=1;t.display.wrapper.appendChild(n);n._top=n.offsetTop}e.dataTransfer.setDragImage(n,0,0);ua&&n.parentNode.removeChild(n)}}}function Xn(t,e){if(!(Math.abs(t.doc.scrollTop-e)<2)){t.doc.scrollTop=e;ea||L(t,{top:e});t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e);t.display.scrollbars.setScrollTop(e);ea&&L(t);Te(t,100)}}function Gn(t,e,n){if(!(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)){e=Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth);t.doc.scrollLeft=e;w(t);t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e);t.display.scrollbars.setScrollLeft(e)}}function $n(t,e){var n=Ia(e),r=n.x,i=n.y,o=t.display,a=o.scroller;if(r&&a.scrollWidth>a.clientWidth||i&&a.scrollHeight>a.clientHeight){if(i&&ma&&aa)t:for(var s=e.target,l=o.view;s!=a;s=s.parentNode)for(var u=0;u<l.length;u++)if(l[u].node==s){t.display.currentWheelTarget=s;break t}if(!r||ea||ua||null==Pa){if(i&&null!=Pa){var c=i*Pa,f=t.doc.scrollTop,h=f+o.wrapper.clientHeight;0>c?f=Math.max(0,f+c-50):h=Math.min(t.doc.height,h+c+50);L(t,{top:f,bottom:h})}if(20>ja)if(null==o.wheelStartX){o.wheelStartX=a.scrollLeft;o.wheelStartY=a.scrollTop;o.wheelDX=r;o.wheelDY=i;setTimeout(function(){if(null!=o.wheelStartX){var t=a.scrollLeft-o.wheelStartX,e=a.scrollTop-o.wheelStartY,n=e&&o.wheelDY&&e/o.wheelDY||t&&o.wheelDX&&t/o.wheelDX;o.wheelStartX=o.wheelStartY=null;if(n){Pa=(Pa*ja+n)/(ja+1);++ja}}},200)}else{o.wheelDX+=r;o.wheelDY+=i}}else{i&&Xn(t,Math.max(0,Math.min(a.scrollTop+i*Pa,a.scrollHeight-a.clientHeight)));Gn(t,Math.max(0,Math.min(a.scrollLeft+r*Pa,a.scrollWidth-a.clientWidth)));hs(e);o.wheelStartX=null}}}function Yn(t,e,n){if("string"==typeof e){e=Ya[e];if(!e)return!1}t.display.pollingFast&&Ln(t)&&(t.display.pollingFast=!1);var r=t.display.shift,i=!1;try{jn(t)&&(t.state.suppressEdits=!0);n&&(t.display.shift=!1);i=e(t)!=xs}finally{t.display.shift=r;t.state.suppressEdits=!1}return i}function Jn(t,e,n){for(var r=0;r<t.state.keyMaps.length;r++){var i=Ka(e,t.state.keyMaps[r],n,t);if(i)return i}return t.options.extraKeys&&Ka(e,t.options.extraKeys,n,t)||Ka(e,t.options.keyMap,n,t)}function Kn(t,e,n,r){var i=t.state.keySeq;if(i){if(Za(e))return"handled";Ha.set(50,function(){if(t.state.keySeq==i){t.state.keySeq=null;An(t)}});e=i+" "+e}var o=Jn(t,e,r);"multi"==o&&(t.state.keySeq=e);"handled"==o&&co(t,"keyHandled",t,e,n);if("handled"==o||"multi"==o){hs(n);Se(t)}if(i&&!o&&/\'$/.test(e)){hs(n);return!0}return!!o}function Zn(t,e){var n=Qa(e,!0);return n?e.shiftKey&&!t.state.keySeq?Kn(t,"Shift-"+n,e,function(e){return Yn(t,e,!0)})||Kn(t,n,e,function(e){return("string"==typeof e?/^go[A-Z]/.test(e):e.motion)?Yn(t,e):void 0}):Kn(t,n,e,function(e){return Yn(t,e)}):!1}function Qn(t,e,n){return Kn(t,"'"+n+"'",e,function(e){return Yn(t,e,!0)})}function tr(t){var e=this;En(e);if(!ho(e,t)){ia&&11>oa&&27==t.keyCode&&(t.returnValue=!1);var n=t.keyCode;e.display.shift=16==n||t.shiftKey;var r=Zn(e,t);if(ua){Oa=r?n:null;!r&&88==n&&!Fs&&(ma?t.metaKey:t.ctrlKey)&&e.replaceSelection("",null,"cut")}18!=n||/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)||er(e)}}function er(t){function e(t){if(18==t.keyCode||!t.altKey){js(n,"CodeMirror-crosshair");ms(document,"keyup",e);ms(document,"mouseover",e)}}var n=t.display.lineDiv;Ps(n,"CodeMirror-crosshair");gs(document,"keyup",e);gs(document,"mouseover",e)}function nr(t){16==t.keyCode&&(this.doc.sel.shift=!1);ho(this,t)}function rr(t){var e=this;if(!(ho(e,t)||t.ctrlKey&&!t.altKey||ma&&t.metaKey)){var n=t.keyCode,r=t.charCode;if(ua&&n==Oa){Oa=null;hs(t)}else if(!(ua&&(!t.which||t.which<10)||fa)||!Zn(e,t)){var i=String.fromCharCode(null==r?n:r);if(!Qn(e,t,i)){ia&&oa>=9&&(e.display.inputHasSelection=null);Dn(e)}}}}function ir(t){if("nocursor"!=t.options.readOnly){if(!t.state.focused){vs(t,"focus",t);t.state.focused=!0;Ps(t.display.wrapper,"CodeMirror-focused");if(!t.curOp&&t.display.selForContextMenu!=t.doc.sel){An(t);
aa&&setTimeout(ko(An,t,!0),0)}}Mn(t);Se(t)}}function or(t){if(t.state.focused){vs(t,"blur",t);t.state.focused=!1;js(t.display.wrapper,"CodeMirror-focused")}clearInterval(t.display.blinker);setTimeout(function(){t.state.focused||(t.display.shift=!1)},150)}function ar(t,e){function n(){if(null!=i.input.selectionStart){var e=t.somethingSelected(),n=i.input.value=""+(e?i.input.value:"");i.prevInput=e?"":"";i.input.selectionStart=1;i.input.selectionEnd=n.length;i.selForContextMenu=t.doc.sel}}function r(){i.contextMenuPending=!1;i.inputDiv.style.position="relative";i.input.style.cssText=l;ia&&9>oa&&i.scrollbars.setScrollTop(i.scroller.scrollTop=a);Mn(t);if(null!=i.input.selectionStart){(!ia||ia&&9>oa)&&n();var e=0,r=function(){i.selForContextMenu==t.doc.sel&&0==i.input.selectionStart?gn(t,Ya.selectAll)(t):e++<10?i.detectingSelectAll=setTimeout(r,500):An(t)};i.detectingSelectAll=setTimeout(r,200)}}if(!ho(t,e,"contextmenu")){var i=t.display;if(!Hn(i,e)&&!sr(t,e)){var o=On(t,e),a=i.scroller.scrollTop;if(o&&!ua){var s=t.options.resetSelectionOnContextMenu;s&&-1==t.doc.sel.contains(o)&&gn(t,he)(t.doc,Q(o),ws);var l=i.input.style.cssText;i.inputDiv.style.position="absolute";i.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: "+(ia?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";if(aa)var u=window.scrollY;Nn(t);aa&&window.scrollTo(null,u);An(t);t.somethingSelected()||(i.input.value=i.prevInput=" ");i.contextMenuPending=!0;i.selForContextMenu=t.doc.sel;clearTimeout(i.detectingSelectAll);ia&&oa>=9&&n();if(xa){ps(e);var c=function(){ms(window,"mouseup",c);setTimeout(r,20)};gs(window,"mouseup",c)}else setTimeout(r,50)}}}}function sr(t,e){return go(t,"gutterContextMenu")?qn(t,e,"gutterContextMenu",!1,vs):!1}function lr(t,e){if(Ta(t,e.from)<0)return t;if(Ta(t,e.to)<=0)return Ra(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,r=t.ch;t.line==e.to.line&&(r+=Ra(e).ch-e.to.ch);return Sa(n,r)}function ur(t,e){for(var n=[],r=0;r<t.sel.ranges.length;r++){var i=t.sel.ranges[r];n.push(new K(lr(i.anchor,e),lr(i.head,e)))}return Z(n,t.sel.primIndex)}function cr(t,e,n){return t.line==e.line?Sa(n.line,t.ch-e.ch+n.ch):Sa(n.line+(t.line-e.line),t.ch)}function fr(t,e,n){for(var r=[],i=Sa(t.first,0),o=i,a=0;a<e.length;a++){var s=e[a],l=cr(s.from,i,o),u=cr(Ra(s),i,o);i=s.to;o=u;if("around"==n){var c=t.sel.ranges[a],f=Ta(c.head,c.anchor)<0;r[a]=new K(f?u:l,f?l:u)}else r[a]=new K(l,l)}return new J(r,t.sel.primIndex)}function hr(t,e,n){var r={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){this.canceled=!0}};n&&(r.update=function(e,n,r,i){e&&(this.from=ee(t,e));n&&(this.to=ee(t,n));r&&(this.text=r);void 0!==i&&(this.origin=i)});vs(t,"beforeChange",t,r);t.cm&&vs(t.cm,"beforeChange",t.cm,r);return r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function dr(t,e,n){if(t.cm){if(!t.cm.curOp)return gn(t.cm,dr)(t,e,n);if(t.cm.state.suppressEdits)return}if(go(t,"beforeChange")||t.cm&&go(t.cm,"beforeChange")){e=hr(t,e,!0);if(!e)return}var r=wa&&!n&&Yr(t,e.from,e.to);if(r)for(var i=r.length-1;i>=0;--i)pr(t,{from:r[i].from,to:r[i].to,text:i?[""]:e.text});else pr(t,e)}function pr(t,e){if(1!=e.text.length||""!=e.text[0]||0!=Ta(e.from,e.to)){var n=ur(t,e);Ji(t,e,n,t.cm?t.cm.curOp.id:0/0);vr(t,e,n,Xr(t,e));var r=[];Hi(t,function(t,n){if(!n&&-1==wo(r,t.history)){ao(t.history,e);r.push(t.history)}vr(t,e,null,Xr(t,e))})}}function gr(t,e,n){if(!t.cm||!t.cm.state.suppressEdits){for(var r,i=t.history,o=t.sel,a="undo"==e?i.done:i.undone,s="undo"==e?i.undone:i.done,l=0;l<a.length;l++){r=a[l];if(n?r.ranges&&!r.equals(t.sel):!r.ranges)break}if(l!=a.length){i.lastOrigin=i.lastSelOrigin=null;for(;;){r=a.pop();if(!r.ranges)break;Qi(r,s);if(n&&!r.equals(t.sel)){he(t,r,{clearRedo:!1});return}o=r}var u=[];Qi(o,s);s.push({changes:u,generation:i.generation});i.generation=r.generation||++i.maxGeneration;for(var c=go(t,"beforeChange")||t.cm&&go(t.cm,"beforeChange"),l=r.changes.length-1;l>=0;--l){var f=r.changes[l];f.origin=e;if(c&&!hr(t,f,!1)){a.length=0;return}u.push(Gi(t,f));var h=l?ur(t,f):xo(a);vr(t,f,h,$r(t,f));!l&&t.cm&&t.cm.scrollIntoView({from:f.from,to:Ra(f)});var d=[];Hi(t,function(t,e){if(!e&&-1==wo(d,t.history)){ao(t.history,f);d.push(t.history)}vr(t,f,null,$r(t,f))})}}}}function mr(t,e){if(0!=e){t.first+=e;t.sel=new J(Co(t.sel.ranges,function(t){return new K(Sa(t.anchor.line+e,t.anchor.ch),Sa(t.head.line+e,t.head.ch))}),t.sel.primIndex);if(t.cm){xn(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,r=n.viewFrom;r<n.viewTo;r++)wn(t.cm,r,"gutter")}}}function vr(t,e,n,r){if(t.cm&&!t.cm.curOp)return gn(t.cm,vr)(t,e,n,r);if(e.to.line<t.first)mr(t,e.text.length-1-(e.to.line-e.from.line));else if(!(e.from.line>t.lastLine())){if(e.from.line<t.first){var i=e.text.length-1-(t.first-e.from.line);mr(t,i);e={from:Sa(t.first,0),to:Sa(e.to.line+i,e.to.ch),text:[xo(e.text)],origin:e.origin}}var o=t.lastLine();e.to.line>o&&(e={from:e.from,to:Sa(o,Ri(t,o).text.length),text:[e.text[0]],origin:e.origin});e.removed=Fi(t,e.from,e.to);n||(n=ur(t,e));t.cm?yr(t.cm,e,r):ji(t,e,r);de(t,n,ws)}}function yr(t,e,n){var r=t.doc,i=t.display,a=e.from,s=e.to,l=!1,u=a.line;if(!t.options.lineWrapping){u=qi(oi(Ri(r,a.line)));r.iter(u,s.line+1,function(t){if(t==i.maxLine){l=!0;return!0}})}r.sel.contains(e.from,e.to)>-1&&po(t);ji(r,e,n,o(t));if(!t.options.lineWrapping){r.iter(u,a.line+e.text.length,function(t){var e=f(t);if(e>i.maxLineLength){i.maxLine=t;i.maxLineLength=e;i.maxLineChanged=!0;l=!1}});l&&(t.curOp.updateMaxLine=!0)}r.frontier=Math.min(r.frontier,a.line);Te(t,400);var c=e.text.length-(s.line-a.line)-1;e.full?xn(t):a.line!=s.line||1!=e.text.length||Ei(t.doc,e)?xn(t,a.line,s.line+1,c):wn(t,a.line,"text");var h=go(t,"changes"),d=go(t,"change");if(d||h){var p={from:a,to:s,text:e.text,removed:e.removed,origin:e.origin};d&&co(t,"change",t,p);h&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(p)}t.display.selForContextMenu=null}function br(t,e,n,r,i){r||(r=n);if(Ta(r,n)<0){var o=r;r=n;n=o}"string"==typeof e&&(e=Os(e));dr(t,{from:n,to:r,text:e,origin:i})}function xr(t,e){if(!ho(t,"scrollCursorIntoView")){var n=t.display,r=n.sizer.getBoundingClientRect(),i=null;e.top+r.top<0?i=!0:e.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1);if(null!=i&&!da){var o=Lo("div","",null,"position: absolute; top: "+(e.top-n.viewOffset-De(t.display))+"px; height: "+(e.bottom-e.top+Ne(t)+n.barHeight)+"px; left: "+e.left+"px; width: 2px;");t.display.lineSpace.appendChild(o);o.scrollIntoView(i);t.display.lineSpace.removeChild(o)}}}function wr(t,e,n,r){null==r&&(r=0);for(var i=0;5>i;i++){var o=!1,a=Ke(t,e),s=n&&n!=e?Ke(t,n):a,l=Sr(t,Math.min(a.left,s.left),Math.min(a.top,s.top)-r,Math.max(a.left,s.left),Math.max(a.bottom,s.bottom)+r),u=t.doc.scrollTop,c=t.doc.scrollLeft;if(null!=l.scrollTop){Xn(t,l.scrollTop);Math.abs(t.doc.scrollTop-u)>1&&(o=!0)}if(null!=l.scrollLeft){Gn(t,l.scrollLeft);Math.abs(t.doc.scrollLeft-c)>1&&(o=!0)}if(!o)break}return a}function Cr(t,e,n,r,i){var o=Sr(t,e,n,r,i);null!=o.scrollTop&&Xn(t,o.scrollTop);null!=o.scrollLeft&&Gn(t,o.scrollLeft)}function Sr(t,e,n,r,i){var o=t.display,a=nn(t.display);0>n&&(n=0);var s=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:o.scroller.scrollTop,l=je(t),u={};i-n>l&&(i=n+l);var c=t.doc.height+Le(o),f=a>n,h=i>c-a;if(s>n)u.scrollTop=f?0:n;else if(i>s+l){var d=Math.min(n,(h?c:i)-l);d!=s&&(u.scrollTop=d)}var p=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:o.scroller.scrollLeft,g=Ee(t)-(t.options.fixedGutter?o.gutters.offsetWidth:0),m=r-e>g;m&&(r=e+g);10>e?u.scrollLeft=0:p>e?u.scrollLeft=Math.max(0,e-(m?0:10)):r>g+p-3&&(u.scrollLeft=r+(m?0:10)-g);return u}function Tr(t,e,n){(null!=e||null!=n)&&_r(t);null!=e&&(t.curOp.scrollLeft=(null==t.curOp.scrollLeft?t.doc.scrollLeft:t.curOp.scrollLeft)+e);null!=n&&(t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+n)}function kr(t){_r(t);var e=t.getCursor(),n=e,r=e;if(!t.options.lineWrapping){n=e.ch?Sa(e.line,e.ch-1):e;r=Sa(e.line,e.ch+1)}t.curOp.scrollToPos={from:n,to:r,margin:t.options.cursorScrollMargin,isCursor:!0}}function _r(t){var e=t.curOp.scrollToPos;if(e){t.curOp.scrollToPos=null;var n=Ze(t,e.from),r=Ze(t,e.to),i=Sr(t,Math.min(n.left,r.left),Math.min(n.top,r.top)-e.margin,Math.max(n.right,r.right),Math.max(n.bottom,r.bottom)+e.margin);t.scrollTo(i.scrollLeft,i.scrollTop)}}function Mr(t,e,n,r){var i,o=t.doc;null==n&&(n="add");"smart"==n&&(o.mode.indent?i=Me(t,e):n="prev");var a=t.options.tabSize,s=Ri(o,e),l=Ts(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n){u=o.mode.indent(i,s.text.slice(c.length),s.text);if(u==xs||u>150){if(!r)return;n="prev"}}}else{u=0;n="not"}"prev"==n?u=e>o.first?Ts(Ri(o,e-1).text,null,a):0:"add"==n?u=l+t.options.indentUnit:"subtract"==n?u=l-t.options.indentUnit:"number"==typeof n&&(u=l+n);u=Math.max(0,u);var f="",h=0;if(t.options.indentWithTabs)for(var d=Math.floor(u/a);d;--d){h+=a;f+=" "}u>h&&(f+=bo(u-h));if(f!=c)br(o,f,Sa(e,0),Sa(e,c.length),"+input");else for(var d=0;d<o.sel.ranges.length;d++){var p=o.sel.ranges[d];if(p.head.line==e&&p.head.ch<c.length){var h=Sa(e,c.length);le(o,d,new K(h,h));break}}s.stateAfter=null}function Dr(t,e,n,r){var i=e,o=e;"number"==typeof e?o=Ri(t,te(t,e)):i=qi(e);if(null==i)return null;r(o,i)&&t.cm&&wn(t.cm,i,n);return o}function Lr(t,e){for(var n=t.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=e(n[i]);r.length&&Ta(o.from,xo(r).to)<=0;){var a=r.pop();if(Ta(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}pn(t,function(){for(var e=r.length-1;e>=0;e--)br(t.doc,"",r[e].from,r[e].to,"+delete");kr(t)})}function Ar(t,e,n,r,i){function o(){var e=s+n;if(e<t.first||e>=t.first+t.size)return f=!1;s=e;return c=Ri(t,e)}function a(t){var e=(i?Qo:ta)(c,l,n,!0);if(null==e){if(t||!o())return f=!1;l=i?(0>n?Xo:Vo)(c):0>n?c.text.length:0}else l=e;return!0}var s=e.line,l=e.ch,u=n,c=Ri(t,s),f=!0;if("char"==r)a();else if("column"==r)a(!0);else if("word"==r||"group"==r)for(var h=null,d="group"==r,p=t.cm&&t.cm.getHelper(e,"wordChars"),g=!0;!(0>n)||a(!g);g=!1){var m=c.text.charAt(l)||"\n",v=_o(m,p)?"w":d&&"\n"==m?"n":!d||/\s/.test(m)?null:"p";!d||g||v||(v="s");if(h&&h!=v){if(0>n){n=1;a()}break}v&&(h=v);if(n>0&&!a(!g))break}var y=ve(t,Sa(s,l),u,!0);f||(y.hitSide=!0);return y}function Nr(t,e,n,r){var i,o=t.doc,a=e.left;if("page"==r){var s=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=e.top+n*(s-(0>n?1.5:.5)*nn(t.display))}else"line"==r&&(i=n>0?e.bottom+3:e.top-3);for(;;){var l=tn(t,a,i);if(!l.outside)break;if(0>n?0>=i:i>=o.height){l.hitSide=!0;break}i+=5*n}return l}function Er(e,n,r,i){t.defaults[e]=n;r&&(Wa[e]=i?function(t,e,n){n!=za&&r(t,e,n)}:r)}function jr(t){for(var e,n,r,i,o=t.split(/-(?!$)/),t=o[o.length-1],a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))e=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)$/i.test(s))throw new Error("Unrecognized modifier name: "+s);r=!0}}e&&(t="Alt-"+t);n&&(t="Ctrl-"+t);i&&(t="Cmd-"+t);r&&(t="Shift-"+t);return t}function Pr(t){return"string"==typeof t?Ja[t]:t}function Ir(t,e,n,r,i){if(r&&r.shared)return Hr(t,e,n,r,i);if(t.cm&&!t.cm.curOp)return gn(t.cm,Ir)(t,e,n,r,i);var o=new es(t,i),a=Ta(e,n);r&&To(r,o,!1);if(a>0||0==a&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith){o.collapsed=!0;o.widgetNode=Lo("span",[o.replacedWith],"CodeMirror-widget");r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true");r.insertLeft&&(o.widgetNode.insertLeft=!0)}if(o.collapsed){if(ii(t,e.line,e,n,o)||e.line!=n.line&&ii(t,n.line,e,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ca=!0}o.addToHistory&&Ji(t,{from:e,to:n,origin:"markText"},t.sel,0/0);var s,l=e.line,u=t.cm;t.iter(l,n.line+1,function(t){u&&o.collapsed&&!u.options.lineWrapping&&oi(t)==u.display.maxLine&&(s=!0);o.collapsed&&l!=e.line&&zi(t,0);Ur(t,new Wr(o,l==e.line?e.ch:null,l==n.line?n.ch:null));++l});o.collapsed&&t.iter(e.line,n.line+1,function(e){ui(t,e)&&zi(e,0)});o.clearOnEnter&&gs(o,"beforeCursorEnter",function(){o.clear()});if(o.readOnly){wa=!0;(t.history.done.length||t.history.undone.length)&&t.clearHistory()}if(o.collapsed){o.id=++ns;o.atomic=!0}if(u){s&&(u.curOp.updateMaxLine=!0);if(o.collapsed)xn(u,e.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var c=e.line;c<=n.line;c++)wn(u,c,"text");o.atomic&&ge(u.doc);co(u,"markerAdded",u,o)}return o}function Hr(t,e,n,r,i){r=To(r);r.shared=!1;var o=[Ir(t,e,n,r,i)],a=o[0],s=r.widgetNode;Hi(t,function(t){s&&(r.widgetNode=s.cloneNode(!0));o.push(Ir(t,ee(t,e),ee(t,n),r,i));for(var l=0;l<t.linked.length;++l)if(t.linked[l].isParent)return;a=xo(o)});return new rs(o,a)}function Or(t){return t.findMarks(Sa(t.first,0),t.clipPos(Sa(t.lastLine())),function(t){return t.parent})}function Rr(t,e){for(var n=0;n<e.length;n++){var r=e[n],i=r.find(),o=t.clipPos(i.from),a=t.clipPos(i.to);if(Ta(o,a)){var s=Ir(t,o,a,r.primary,r.primary.type);r.markers.push(s);s.parent=r}}}function Fr(t){for(var e=0;e<t.length;e++){var n=t[e],r=[n.primary.doc];Hi(n.primary.doc,function(t){r.push(t)});for(var i=0;i<n.markers.length;i++){var o=n.markers[i];if(-1==wo(r,o.doc)){o.parent=null;n.markers.splice(i--,1)}}}}function Wr(t,e,n){this.marker=t;this.from=e;this.to=n}function zr(t,e){if(t)for(var n=0;n<t.length;++n){var r=t[n];if(r.marker==e)return r}}function qr(t,e){for(var n,r=0;r<t.length;++r)t[r]!=e&&(n||(n=[])).push(t[r]);return n}function Ur(t,e){t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e];e.marker.attachLine(t)}function Br(t,e,n){if(t)for(var r,i=0;i<t.length;++i){var o=t[i],a=o.marker,s=null==o.from||(a.inclusiveLeft?o.from<=e:o.from<e);if(s||o.from==e&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var l=null==o.to||(a.inclusiveRight?o.to>=e:o.to>e);(r||(r=[])).push(new Wr(a,o.from,l?null:o.to))}}return r}function Vr(t,e,n){if(t)for(var r,i=0;i<t.length;++i){var o=t[i],a=o.marker,s=null==o.to||(a.inclusiveRight?o.to>=e:o.to>e);if(s||o.from==e&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=e:o.from<e);(r||(r=[])).push(new Wr(a,l?null:o.from-e,null==o.to?null:o.to-e))}}return r}function Xr(t,e){if(e.full)return null;var n=re(t,e.from.line)&&Ri(t,e.from.line).markedSpans,r=re(t,e.to.line)&&Ri(t,e.to.line).markedSpans;if(!n&&!r)return null;var i=e.from.ch,o=e.to.ch,a=0==Ta(e.from,e.to),s=Br(n,i,a),l=Vr(r,o,a),u=1==e.text.length,c=xo(e.text).length+(u?i:0);if(s)for(var f=0;f<s.length;++f){var h=s[f];if(null==h.to){var d=zr(l,h.marker);d?u&&(h.to=null==d.to?null:d.to+c):h.to=i}}if(l)for(var f=0;f<l.length;++f){var h=l[f];null!=h.to&&(h.to+=c);if(null==h.from){var d=zr(s,h.marker);if(!d){h.from=c;u&&(s||(s=[])).push(h)}}else{h.from+=c;u&&(s||(s=[])).push(h)}}s&&(s=Gr(s));l&&l!=s&&(l=Gr(l));var p=[s];if(!u){var g,m=e.text.length-2;if(m>0&&s)for(var f=0;f<s.length;++f)null==s[f].to&&(g||(g=[])).push(new Wr(s[f].marker,null,null));for(var f=0;m>f;++f)p.push(g);p.push(l)}return p}function Gr(t){for(var e=0;e<t.length;++e){var n=t[e];null!=n.from&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&t.splice(e--,1)}return t.length?t:null}function $r(t,e){var n=no(t,e),r=Xr(t,e);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)t:for(var s=0;s<a.length;++s){for(var l=a[s],u=0;u<o.length;++u)if(o[u].marker==l.marker)continue t;o.push(l)}else a&&(n[i]=a)}return n}function Yr(t,e,n){var r=null;t.iter(e.line,n.line+1,function(t){if(t.markedSpans)for(var e=0;e<t.markedSpans.length;++e){var n=t.markedSpans[e].marker;!n.readOnly||r&&-1!=wo(r,n)||(r||(r=[])).push(n)}});if(!r)return null;for(var i=[{from:e,to:n}],o=0;o<r.length;++o)for(var a=r[o],s=a.find(0),l=0;l<i.length;++l){var u=i[l];if(!(Ta(u.to,s.from)<0||Ta(u.from,s.to)>0)){var c=[l,1],f=Ta(u.from,s.from),h=Ta(u.to,s.to);(0>f||!a.inclusiveLeft&&!f)&&c.push({from:u.from,to:s.from});(h>0||!a.inclusiveRight&&!h)&&c.push({from:s.to,to:u.to});i.splice.apply(i,c);l+=c.length-1}}return i}function Jr(t){var e=t.markedSpans;if(e){for(var n=0;n<e.length;++n)e[n].marker.detachLine(t);t.markedSpans=null}}function Kr(t,e){if(e){for(var n=0;n<e.length;++n)e[n].marker.attachLine(t);t.markedSpans=e}}function Zr(t){return t.inclusiveLeft?-1:0}function Qr(t){return t.inclusiveRight?1:0}function ti(t,e){var n=t.lines.length-e.lines.length;if(0!=n)return n;var r=t.find(),i=e.find(),o=Ta(r.from,i.from)||Zr(t)-Zr(e);if(o)return-o;var a=Ta(r.to,i.to)||Qr(t)-Qr(e);return a?a:e.id-t.id}function ei(t,e){var n,r=Ca&&t.markedSpans;if(r)for(var i,o=0;o<r.length;++o){i=r[o];i.marker.collapsed&&null==(e?i.from:i.to)&&(!n||ti(n,i.marker)<0)&&(n=i.marker)}return n}function ni(t){return ei(t,!0)}function ri(t){return ei(t,!1)}function ii(t,e,n,r,i){var o=Ri(t,e),a=Ca&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var u=l.marker.find(0),c=Ta(u.from,n)||Zr(l.marker)-Zr(i),f=Ta(u.to,r)||Qr(l.marker)-Qr(i);if(!(c>=0&&0>=f||0>=c&&f>=0)&&(0>=c&&(Ta(u.to,n)>0||l.marker.inclusiveRight&&i.inclusiveLeft)||c>=0&&(Ta(u.from,r)<0||l.marker.inclusiveLeft&&i.inclusiveRight)))return!0}}}function oi(t){for(var e;e=ni(t);)t=e.find(-1,!0).line;return t}function ai(t){for(var e,n;e=ri(t);){t=e.find(1,!0).line;(n||(n=[])).push(t)}return n}function si(t,e){var n=Ri(t,e),r=oi(n);return n==r?e:qi(r)}function li(t,e){if(e>t.lastLine())return e;var n,r=Ri(t,e);if(!ui(t,r))return e;for(;n=ri(r);)r=n.find(1,!0).line;return qi(r)+1}function ui(t,e){var n=Ca&&e.markedSpans;if(n)for(var r,i=0;i<n.length;++i){r=n[i];if(r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&ci(t,e,r))return!0}}}function ci(t,e,n){if(null==n.to){var r=n.marker.find(1,!0);return ci(t,r.line,zr(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==e.text.length)return!0;for(var i,o=0;o<e.markedSpans.length;++o){i=e.markedSpans[o];if(i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&ci(t,e,i))return!0}}function fi(t,e,n){Bi(e)<(t.curOp&&t.curOp.scrollTop||t.doc.scrollTop)&&Tr(t,null,n)}function hi(t){if(null!=t.height)return t.height;if(!Eo(document.body,t.node)){var e="position: relative;";t.coverGutter&&(e+="margin-left: -"+t.cm.display.gutters.offsetWidth+"px;");t.noHScroll&&(e+="width: "+t.cm.display.wrapper.clientWidth+"px;");No(t.cm.display.measure,Lo("div",[t.node],null,e))}return t.height=t.node.offsetHeight}function di(t,e,n,r){var i=new is(t,n,r);i.noHScroll&&(t.display.alignWidgets=!0);Dr(t.doc,e,"widget",function(e){var n=e.widgets||(e.widgets=[]);null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i);i.line=e;if(!ui(t.doc,e)){var r=Bi(e)<t.doc.scrollTop;zi(e,e.height+hi(i));r&&Tr(t,null,i.height);t.curOp.forceUpdate=!0}return!0});return i}function pi(t,e,n,r){t.text=e;t.stateAfter&&(t.stateAfter=null);t.styles&&(t.styles=null);null!=t.order&&(t.order=null);Jr(t);Kr(t,n);var i=r?r(t):1;i!=t.height&&zi(t,i)}function gi(t){t.parent=null;Jr(t)}function mi(t,e){if(t)for(;;){var n=t.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;t=t.slice(0,n.index)+t.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==e[r]?e[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(e[r])||(e[r]+=" "+n[2])}return t}function vi(e,n){if(e.blankLine)return e.blankLine(n);if(e.innerMode){var r=t.innerMode(e,n);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function yi(e,n,r,i){for(var o=0;10>o;o++){i&&(i[0]=t.innerMode(e,r).mode);var a=e.token(n,r);if(n.pos>n.start)return a}throw new Error("Mode "+e.name+" failed to advance stream.")}function bi(t,e,n,r){function i(t){return{start:f.start,end:f.pos,string:f.current(),type:o||null,state:t?Ga(a.mode,c):c}}var o,a=t.doc,s=a.mode;e=ee(a,e);var l,u=Ri(a,e.line),c=Me(t,e.line,n),f=new ts(u.text,t.options.tabSize);r&&(l=[]);for(;(r||f.pos<e.ch)&&!f.eol();){f.start=f.pos;o=yi(s,f,c);r&&l.push(i(!0))}return r?l:i()}function xi(t,e,n,r,i,o,a){var s=n.flattenSpans;null==s&&(s=t.options.flattenSpans);var l,u=0,c=null,f=new ts(e,t.options.tabSize),h=t.options.addModeClass&&[null];""==e&&mi(vi(n,r),o);for(;!f.eol();){if(f.pos>t.options.maxHighlightLength){s=!1;a&&Si(t,e,r,f.pos);f.pos=e.length;l=null}else l=mi(yi(n,f,r,h),o);if(h){var d=h[0].name;d&&(l="m-"+(l?d+" "+l:d))}if(!s||c!=l){for(;u<f.start;){u=Math.min(f.start,u+5e4);i(u,c)}c=l}f.start=f.pos}for(;u<f.pos;){var p=Math.min(f.pos,u+5e4);i(p,c);u=p}}function wi(t,e,n,r){var i=[t.state.modeGen],o={};xi(t,e.text,t.doc.mode,n,function(t,e){i.push(t,e)},o,r);for(var a=0;a<t.state.overlays.length;++a){var s=t.state.overlays[a],l=1,u=0;xi(t,e.text,s.mode,!0,function(t,e){for(var n=l;t>u;){var r=i[l];r>t&&i.splice(l,1,t,i[l+1],r);l+=2;u=Math.min(t,r)}if(e)if(s.opaque){i.splice(n,l-n,t,"cm-overlay "+e);l=n+2}else for(;l>n;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"cm-overlay "+e}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Ci(t,e,n){if(!e.styles||e.styles[0]!=t.state.modeGen){var r=wi(t,e,e.stateAfter=Me(t,qi(e)));e.styles=r.styles;r.classes?e.styleClasses=r.classes:e.styleClasses&&(e.styleClasses=null);n===t.doc.frontier&&t.doc.frontier++}return e.styles}function Si(t,e,n,r){var i=t.doc.mode,o=new ts(e,t.options.tabSize);o.start=o.pos=r||0;""==e&&vi(i,n);for(;!o.eol()&&o.pos<=t.options.maxHighlightLength;){yi(i,o,n);o.start=o.pos}}function Ti(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?ss:as;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function ki(t,e){var n=Lo("span",null,null,aa?"padding-right: .1px":null),r={pre:Lo("pre",[n]),content:n,col:0,pos:0,cm:t};e.measure={};for(var i=0;i<=(e.rest?e.rest.length:0);i++){var o,a=i?e.rest[i-1]:e.line;r.pos=0;r.addToken=Mi;(ia||aa)&&t.getOption("lineWrapping")&&(r.addToken=Di(r.addToken));Wo(t.display.measure)&&(o=Vi(a))&&(r.addToken=Li(r.addToken,o));r.map=[];var s=e!=t.display.externalMeasured&&qi(a);Ni(a,r,Ci(t,a,s));if(a.styleClasses){a.styleClasses.bgClass&&(r.bgClass=Io(a.styleClasses.bgClass,r.bgClass||""));a.styleClasses.textClass&&(r.textClass=Io(a.styleClasses.textClass,r.textClass||""))}0==r.map.length&&r.map.push(0,0,r.content.appendChild(Fo(t.display.measure)));if(0==i){e.measure.map=r.map;e.measure.cache={}}else{(e.measure.maps||(e.measure.maps=[])).push(r.map);(e.measure.caches||(e.measure.caches=[])).push({})}}aa&&/\bcm-tab\b/.test(r.content.lastChild.className)&&(r.content.className="cm-tab-wrap-hack");vs(t,"renderLine",t,e.line,r.pre);r.pre.className&&(r.textClass=Io(r.pre.className,r.textClass||""));return r}function _i(t){var e=Lo("span","•","cm-invalidchar");e.title="\\u"+t.charCodeAt(0).toString(16);return e}function Mi(t,e,n,r,i,o,a){if(e){var s=t.cm.options.specialChars,l=!1;if(s.test(e))for(var u=document.createDocumentFragment(),c=0;;){s.lastIndex=c;var f=s.exec(e),h=f?f.index-c:e.length-c;if(h){var d=document.createTextNode(e.slice(c,c+h));u.appendChild(ia&&9>oa?Lo("span",[d]):d);t.map.push(t.pos,t.pos+h,d);t.col+=h;t.pos+=h}if(!f)break;c+=h+1;if(" "==f[0]){var p=t.cm.options.tabSize,g=p-t.col%p,d=u.appendChild(Lo("span",bo(g),"cm-tab"));t.col+=g}else{var d=t.cm.options.specialCharPlaceholder(f[0]);u.appendChild(ia&&9>oa?Lo("span",[d]):d);t.col+=1}t.map.push(t.pos,t.pos+1,d);t.pos++}else{t.col+=e.length;var u=document.createTextNode(e);t.map.push(t.pos,t.pos+e.length,u);ia&&9>oa&&(l=!0);t.pos+=e.length}if(n||r||i||l||a){var m=n||"";r&&(m+=r);i&&(m+=i);var v=Lo("span",[u],m,a);o&&(v.title=o);return t.content.appendChild(v)}t.content.appendChild(u)}}function Di(t){function e(t){for(var e=" ",n=0;n<t.length-2;++n)e+=n%2?" ":" ";e+=" ";return e}return function(n,r,i,o,a,s){t(n,r.replace(/ {3,}/g,e),i,o,a,s)}}function Li(t,e){return function(n,r,i,o,a,s){i=i?i+" cm-force-border":"cm-force-border";for(var l=n.pos,u=l+r.length;;){for(var c=0;c<e.length;c++){var f=e[c];if(f.to>l&&f.from<=l)break}if(f.to>=u)return t(n,r,i,o,a,s);t(n,r.slice(0,f.to-l),i,o,null,s);o=null;r=r.slice(f.to-l);l=f.to}}}function Ai(t,e,n,r){var i=!r&&n.widgetNode;if(i){t.map.push(t.pos,t.pos+e,i);t.content.appendChild(i)}t.pos+=e}function Ni(t,e,n){var r=t.markedSpans,i=t.text,o=0;if(r)for(var a,s,l,u,c,f,h,d=i.length,p=0,g=1,m="",v=0;;){if(v==p){l=u=c=f=s="";h=null;v=1/0;for(var y=[],b=0;b<r.length;++b){var x=r[b],w=x.marker;if(x.from<=p&&(null==x.to||x.to>p)){if(null!=x.to&&v>x.to){v=x.to;u=""}w.className&&(l+=" "+w.className);w.css&&(s=w.css);w.startStyle&&x.from==p&&(c+=" "+w.startStyle);w.endStyle&&x.to==v&&(u+=" "+w.endStyle);w.title&&!f&&(f=w.title);w.collapsed&&(!h||ti(h.marker,w)<0)&&(h=x)}else x.from>p&&v>x.from&&(v=x.from);"bookmark"==w.type&&x.from==p&&w.widgetNode&&y.push(w)}if(h&&(h.from||0)==p){Ai(e,(null==h.to?d+1:h.to)-p,h.marker,null==h.from);if(null==h.to)return}if(!h&&y.length)for(var b=0;b<y.length;++b)Ai(e,0,y[b])}if(p>=d)break;for(var C=Math.min(d,v);;){if(m){var S=p+m.length;if(!h){var T=S>C?m.slice(0,C-p):m;e.addToken(e,T,a?a+l:l,c,p+T.length==v?u:"",f,s)}if(S>=C){m=m.slice(C-p);p=C;break}p=S;c=""}m=i.slice(o,o=n[g++]);a=Ti(n[g++],e.cm.options)}}else for(var g=1;g<n.length;g+=2)e.addToken(e,i.slice(o,o=n[g]),Ti(n[g+1],e.cm.options))}function Ei(t,e){return 0==e.from.ch&&0==e.to.ch&&""==xo(e.text)&&(!t.cm||t.cm.options.wholeLineUpdateBefore)}function ji(t,e,n,r){function i(t){return n?n[t]:null}function o(t,n,i){pi(t,n,i,r);co(t,"change",t,e)}function a(t,e){for(var n=t,o=[];e>n;++n)o.push(new os(u[n],i(n),r));return o}var s=e.from,l=e.to,u=e.text,c=Ri(t,s.line),f=Ri(t,l.line),h=xo(u),d=i(u.length-1),p=l.line-s.line;if(e.full){t.insert(0,a(0,u.length));t.remove(u.length,t.size-u.length)}else if(Ei(t,e)){var g=a(0,u.length-1);o(f,f.text,d);p&&t.remove(s.line,p);g.length&&t.insert(s.line,g)}else if(c==f)if(1==u.length)o(c,c.text.slice(0,s.ch)+h+c.text.slice(l.ch),d);else{var g=a(1,u.length-1);g.push(new os(h+c.text.slice(l.ch),d,r));o(c,c.text.slice(0,s.ch)+u[0],i(0));t.insert(s.line+1,g)}else if(1==u.length){o(c,c.text.slice(0,s.ch)+u[0]+f.text.slice(l.ch),i(0));t.remove(s.line+1,p)}else{o(c,c.text.slice(0,s.ch)+u[0],i(0));o(f,h+f.text.slice(l.ch),d);var g=a(1,u.length-1);p>1&&t.remove(s.line+1,p-1);t.insert(s.line+1,g)}co(t,"change",t,e)}function Pi(t){this.lines=t;this.parent=null;for(var e=0,n=0;e<t.length;++e){t[e].parent=this;n+=t[e].height}this.height=n}function Ii(t){this.children=t;for(var e=0,n=0,r=0;r<t.length;++r){var i=t[r];e+=i.chunkSize();n+=i.height;i.parent=this}this.size=e;this.height=n;this.parent=null}function Hi(t,e,n){function r(t,i,o){if(t.linked)for(var a=0;a<t.linked.length;++a){var s=t.linked[a];if(s.doc!=i){var l=o&&s.sharedHist;if(!n||l){e(s.doc,l);r(s.doc,t,l)}}}}r(t,null,!0)}function Oi(t,e){if(e.cm)throw new Error("This document is already in use.");t.doc=e;e.cm=t;a(t);n(t);t.options.lineWrapping||h(t);t.options.mode=e.modeOption;xn(t)}function Ri(t,e){e-=t.first;if(0>e||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(o>e){n=i;break}e-=o}return n.lines[e]}function Fi(t,e,n){var r=[],i=e.line;t.iter(e.line,n.line+1,function(t){var o=t.text;i==n.line&&(o=o.slice(0,n.ch));i==e.line&&(o=o.slice(e.ch));r.push(o);++i});return r}function Wi(t,e,n){var r=[];t.iter(e,n,function(t){r.push(t.text)});return r}function zi(t,e){var n=e-t.height;if(n)for(var r=t;r;r=r.parent)r.height+=n}function qi(t){if(null==t.parent)return null;for(var e=t.parent,n=wo(e.lines,t),r=e.parent;r;e=r,r=r.parent)for(var i=0;r.children[i]!=e;++i)n+=r.children[i].chunkSize();return n+e.first}function Ui(t,e){var n=t.first;t:do{for(var r=0;r<t.children.length;++r){var i=t.children[r],o=i.height;if(o>e){t=i;continue t}e-=o;n+=i.chunkSize()}return n}while(!t.lines);for(var r=0;r<t.lines.length;++r){var a=t.lines[r],s=a.height;if(s>e)break;e-=s}return n+r}function Bi(t){t=oi(t);for(var e=0,n=t.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==t)break;e+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var r=0;r<o.children.length;++r){var a=o.children[r];if(a==n)break;e+=a.height}return e}function Vi(t){var e=t.order;null==e&&(e=t.order=Us(t.text));return e}function Xi(t){this.done=[];this.undone=[];this.undoDepth=1/0;this.lastModTime=this.lastSelTime=0;this.lastOp=this.lastSelOp=null;this.lastOrigin=this.lastSelOrigin=null;this.generation=this.maxGeneration=t||1}function Gi(t,e){var n={from:G(e.from),to:Ra(e),text:Fi(t,e.from,e.to)};to(t,n,e.from.line,e.to.line+1);Hi(t,function(t){to(t,n,e.from.line,e.to.line+1)},!0);return n}function $i(t){for(;t.length;){var e=xo(t);if(!e.ranges)break;t.pop()}}function Yi(t,e){if(e){$i(t.done);return xo(t.done)}if(t.done.length&&!xo(t.done).ranges)return xo(t.done);if(t.done.length>1&&!t.done[t.done.length-2].ranges){t.done.pop();return xo(t.done)}}function Ji(t,e,n,r){var i=t.history;i.undone.length=0;var o,a=+new Date;if((i.lastOp==r||i.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&t.cm&&i.lastModTime>a-t.cm.options.historyEventDelay||"*"==e.origin.charAt(0)))&&(o=Yi(i,i.lastOp==r))){var s=xo(o.changes);0==Ta(e.from,e.to)&&0==Ta(e.from,s.to)?s.to=Ra(e):o.changes.push(Gi(t,e))}else{var l=xo(i.done);l&&l.ranges||Qi(t.sel,i.done);o={changes:[Gi(t,e)],generation:i.generation};i.done.push(o);for(;i.done.length>i.undoDepth;){i.done.shift();i.done[0].ranges||i.done.shift()}}i.done.push(n);i.generation=++i.maxGeneration;i.lastModTime=i.lastSelTime=a;i.lastOp=i.lastSelOp=r;i.lastOrigin=i.lastSelOrigin=e.origin;s||vs(t,"historyAdded")}function Ki(t,e,n,r){var i=e.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function Zi(t,e,n,r){var i=t.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Ki(t,o,xo(i.done),e))?i.done[i.done.length-1]=e:Qi(e,i.done);i.lastSelTime=+new Date;i.lastSelOrigin=o;i.lastSelOp=n;r&&r.clearRedo!==!1&&$i(i.undone)}function Qi(t,e){var n=xo(e);n&&n.ranges&&n.equals(t)||e.push(t)}function to(t,e,n,r){var i=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,r),function(n){n.markedSpans&&((i||(i=e["spans_"+t.id]={}))[o]=n.markedSpans);++o})}function eo(t){if(!t)return null;for(var e,n=0;n<t.length;++n)t[n].marker.explicitlyCleared?e||(e=t.slice(0,n)):e&&e.push(t[n]);return e?e.length?e:null:t}function no(t,e){var n=e["spans_"+t.id];if(!n)return null;for(var r=0,i=[];r<e.text.length;++r)i.push(eo(n[r]));return i}function ro(t,e,n){for(var r=0,i=[];r<t.length;++r){var o=t[r];if(o.ranges)i.push(n?J.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];i.push({changes:s});for(var l=0;l<a.length;++l){var u,c=a[l];s.push({from:c.from,to:c.to,text:c.text});if(e)for(var f in c)if((u=f.match(/^spans_(\d+)$/))&&wo(e,Number(u[1]))>-1){xo(s)[f]=c[f];delete c[f]}}}}return i}function io(t,e,n,r){if(n<t.line)t.line+=r;else if(e<t.line){t.line=e;t.ch=0}}function oo(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i],a=!0;if(o.ranges){if(!o.copied){o=t[i]=o.deepCopy();o.copied=!0}for(var s=0;s<o.ranges.length;s++){io(o.ranges[s].anchor,e,n,r);io(o.ranges[s].head,e,n,r)}}else{for(var s=0;s<o.changes.length;++s){var l=o.changes[s];if(n<l.from.line){l.from=Sa(l.from.line+r,l.from.ch);l.to=Sa(l.to.line+r,l.to.ch)}else if(e<=l.to.line){a=!1;break}}if(!a){t.splice(0,i+1);i=0}}}}function ao(t,e){var n=e.from.line,r=e.to.line,i=e.text.length-(r-n)-1;oo(t.done,n,r,i);oo(t.undone,n,r,i)}function so(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function lo(t){return t.target||t.srcElement}function uo(t){var e=t.which;null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2));ma&&t.ctrlKey&&1==e&&(e=3);return e}function co(t,e){function n(t){return function(){t.apply(null,o)}}var r=t._handlers&&t._handlers[e];
if(r){var i,o=Array.prototype.slice.call(arguments,2);if(La)i=La.delayedCallbacks;else if(ys)i=ys;else{i=ys=[];setTimeout(fo,0)}for(var a=0;a<r.length;++a)i.push(n(r[a]))}}function fo(){var t=ys;ys=null;for(var e=0;e<t.length;++e)t[e]()}function ho(t,e,n){"string"==typeof e&&(e={type:e,preventDefault:function(){this.defaultPrevented=!0}});vs(t,n||e.type,t,e);return so(e)||e.codemirrorIgnore}function po(t){var e=t._handlers&&t._handlers.cursorActivity;if(e)for(var n=t.curOp.cursorActivityHandlers||(t.curOp.cursorActivityHandlers=[]),r=0;r<e.length;++r)-1==wo(n,e[r])&&n.push(e[r])}function go(t,e){var n=t._handlers&&t._handlers[e];return n&&n.length>0}function mo(t){t.prototype.on=function(t,e){gs(this,t,e)};t.prototype.off=function(t,e){ms(this,t,e)}}function vo(){this.id=null}function yo(t,e,n){for(var r=0,i=0;;){var o=t.indexOf(" ",r);-1==o&&(o=t.length);var a=o-r;if(o==t.length||i+a>=e)return r+Math.min(a,e-i);i+=o-r;i+=n-i%n;r=o+1;if(i>=e)return r}}function bo(t){for(;ks.length<=t;)ks.push(xo(ks)+" ");return ks[t]}function xo(t){return t[t.length-1]}function wo(t,e){for(var n=0;n<t.length;++n)if(t[n]==e)return n;return-1}function Co(t,e){for(var n=[],r=0;r<t.length;r++)n[r]=e(t[r],r);return n}function So(t,e){var n;if(Object.create)n=Object.create(t);else{var r=function(){};r.prototype=t;n=new r}e&&To(e,n);return n}function To(t,e,n){e||(e={});for(var r in t)!t.hasOwnProperty(r)||n===!1&&e.hasOwnProperty(r)||(e[r]=t[r]);return e}function ko(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e)}}function _o(t,e){return e?e.source.indexOf("\\w")>-1&&Ls(t)?!0:e.test(t):Ls(t)}function Mo(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}function Do(t){return t.charCodeAt(0)>=768&&As.test(t)}function Lo(t,e,n,r){var i=document.createElement(t);n&&(i.className=n);r&&(i.style.cssText=r);if("string"==typeof e)i.appendChild(document.createTextNode(e));else if(e)for(var o=0;o<e.length;++o)i.appendChild(e[o]);return i}function Ao(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function No(t,e){return Ao(t).appendChild(e)}function Eo(t,e){if(t.contains)return t.contains(e);for(;e=e.parentNode;)if(e==t)return!0}function jo(){return document.activeElement}function Po(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}function Io(t,e){for(var n=t.split(" "),r=0;r<n.length;r++)n[r]&&!Po(n[r]).test(e)&&(e+=" "+n[r]);return e}function Ho(t){if(document.body.getElementsByClassName)for(var e=document.body.getElementsByClassName("CodeMirror"),n=0;n<e.length;n++){var r=e[n].CodeMirror;r&&t(r)}}function Oo(){if(!Is){Ro();Is=!0}}function Ro(){var t;gs(window,"resize",function(){null==t&&(t=setTimeout(function(){t=null;Ho(In)},100))});gs(window,"blur",function(){Ho(or)})}function Fo(t){if(null==Ns){var e=Lo("span","");No(t,Lo("span",[e,document.createTextNode("x")]));0!=t.firstChild.offsetHeight&&(Ns=e.offsetWidth<=1&&e.offsetHeight>2&&!(ia&&8>oa))}return Ns?Lo("span",""):Lo("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")}function Wo(t){if(null!=Es)return Es;var e=No(t,document.createTextNode("AخA")),n=Ms(e,0,1).getBoundingClientRect();if(!n||n.left==n.right)return!1;var r=Ms(e,1,2).getBoundingClientRect();return Es=r.right-n.right<3}function zo(t){if(null!=Ws)return Ws;var e=No(t,Lo("span","x")),n=e.getBoundingClientRect(),r=Ms(e,0,1).getBoundingClientRect();return Ws=Math.abs(n.left-r.left)>1}function qo(t,e,n,r){if(!t)return r(e,n,"ltr");for(var i=!1,o=0;o<t.length;++o){var a=t[o];if(a.from<n&&a.to>e||e==n&&a.to==e){r(Math.max(a.from,e),Math.min(a.to,n),1==a.level?"rtl":"ltr");i=!0}}i||r(e,n,"ltr")}function Uo(t){return t.level%2?t.to:t.from}function Bo(t){return t.level%2?t.from:t.to}function Vo(t){var e=Vi(t);return e?Uo(e[0]):0}function Xo(t){var e=Vi(t);return e?Bo(xo(e)):t.text.length}function Go(t,e){var n=Ri(t.doc,e),r=oi(n);r!=n&&(e=qi(r));var i=Vi(r),o=i?i[0].level%2?Xo(r):Vo(r):0;return Sa(e,o)}function $o(t,e){for(var n,r=Ri(t.doc,e);n=ri(r);){r=n.find(1,!0).line;e=null}var i=Vi(r),o=i?i[0].level%2?Vo(r):Xo(r):r.text.length;return Sa(null==e?qi(r):e,o)}function Yo(t,e){var n=Go(t,e.line),r=Ri(t.doc,n.line),i=Vi(r);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),a=e.line==n.line&&e.ch<=o&&e.ch;return Sa(n.line,a?0:o)}return n}function Jo(t,e,n){var r=t[0].level;return e==r?!0:n==r?!1:n>e}function Ko(t,e){qs=null;for(var n,r=0;r<t.length;++r){var i=t[r];if(i.from<e&&i.to>e)return r;if(i.from==e||i.to==e){if(null!=n){if(Jo(t,i.level,t[n].level)){i.from!=i.to&&(qs=n);return r}i.from!=i.to&&(qs=r);return n}n=r}}return n}function Zo(t,e,n,r){if(!r)return e+n;do e+=n;while(e>0&&Do(t.text.charAt(e)));return e}function Qo(t,e,n,r){var i=Vi(t);if(!i)return ta(t,e,n,r);for(var o=Ko(i,e),a=i[o],s=Zo(t,e,a.level%2?-n:n,r);;){if(s>a.from&&s<a.to)return s;if(s==a.from||s==a.to){if(Ko(i,s)==o)return s;a=i[o+=n];return n>0==a.level%2?a.to:a.from}a=i[o+=n];if(!a)return null;s=n>0==a.level%2?Zo(t,a.to,-1,r):Zo(t,a.from,1,r)}}function ta(t,e,n,r){var i=e+n;if(r)for(;i>0&&Do(t.text.charAt(i));)i+=n;return 0>i||i>t.text.length?null:i}var ea=/gecko\/\d/i.test(navigator.userAgent),na=/MSIE \d/.test(navigator.userAgent),ra=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ia=na||ra,oa=ia&&(na?document.documentMode||6:ra[1]),aa=/WebKit\//.test(navigator.userAgent),sa=aa&&/Qt\/\d+\.\d+/.test(navigator.userAgent),la=/Chrome\//.test(navigator.userAgent),ua=/Opera\//.test(navigator.userAgent),ca=/Apple Computer/.test(navigator.vendor),fa=/KHTML\//.test(navigator.userAgent),ha=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),da=/PhantomJS/.test(navigator.userAgent),pa=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),ga=pa||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),ma=pa||/Mac/.test(navigator.platform),va=/win/i.test(navigator.platform),ya=ua&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);ya&&(ya=Number(ya[1]));if(ya&&ya>=15){ua=!1;aa=!0}var ba=ma&&(sa||ua&&(null==ya||12.11>ya)),xa=ea||ia&&oa>=9,wa=!1,Ca=!1;g.prototype=To({update:function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,r=t.nativeBarWidth;if(n){this.vert.style.display="block";this.vert.style.bottom=e?r+"px":"0";var i=t.viewHeight-(e?r:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+i)+"px"}else{this.vert.style.display="";this.vert.firstChild.style.height="0"}if(e){this.horiz.style.display="block";this.horiz.style.right=n?r+"px":"0";this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?r:0);this.horiz.firstChild.style.width=t.scrollWidth-t.clientWidth+o+"px"}else{this.horiz.style.display="";this.horiz.firstChild.style.width="0"}if(!this.checkedOverlay&&t.clientHeight>0){0==r&&this.overlayHack();this.checkedOverlay=!0}return{right:n?r:0,bottom:e?r:0}},setScrollLeft:function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t)},setScrollTop:function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t)},overlayHack:function(){var t=ma&&!ha?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=t;var e=this,n=function(t){lo(t)!=e.vert&&lo(t)!=e.horiz&&gn(e.cm,Rn)(t)};gs(this.vert,"mousedown",n);gs(this.horiz,"mousedown",n)},clear:function(){var t=this.horiz.parentNode;t.removeChild(this.horiz);t.removeChild(this.vert)}},g.prototype);m.prototype=To({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},m.prototype);t.scrollbarModel={"native":g,"null":m};var Sa=t.Pos=function(t,e){if(!(this instanceof Sa))return new Sa(t,e);this.line=t;this.ch=e},Ta=t.cmpPos=function(t,e){return t.line-e.line||t.ch-e.ch};J.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(t){if(t==this)return!0;if(t.primIndex!=this.primIndex||t.ranges.length!=this.ranges.length)return!1;for(var e=0;e<this.ranges.length;e++){var n=this.ranges[e],r=t.ranges[e];if(0!=Ta(n.anchor,r.anchor)||0!=Ta(n.head,r.head))return!1}return!0},deepCopy:function(){for(var t=[],e=0;e<this.ranges.length;e++)t[e]=new K(G(this.ranges[e].anchor),G(this.ranges[e].head));return new J(t,this.primIndex)},somethingSelected:function(){for(var t=0;t<this.ranges.length;t++)if(!this.ranges[t].empty())return!0;return!1},contains:function(t,e){e||(e=t);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(Ta(e,r.from())>=0&&Ta(t,r.to())<=0)return n}return-1}};K.prototype={from:function(){return Y(this.anchor,this.head)},to:function(){return $(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var ka,_a,Ma,Da={left:0,right:0,top:0,bottom:0},La=null,Aa=0,Na=null,Ea=0,ja=0,Pa=null;ia?Pa=-.53:ea?Pa=15:la?Pa=-.7:ca&&(Pa=-1/3);var Ia=function(t){var e=t.wheelDeltaX,n=t.wheelDeltaY;null==e&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(e=t.detail);null==n&&t.detail&&t.axis==t.VERTICAL_AXIS?n=t.detail:null==n&&(n=t.wheelDelta);return{x:e,y:n}};t.wheelEventPixels=function(t){var e=Ia(t);e.x*=Pa;e.y*=Pa;return e};var Ha=new vo,Oa=null,Ra=t.changeEnd=function(t){return t.text?Sa(t.from.line+t.text.length-1,xo(t.text).length+(1==t.text.length?t.from.ch:0)):t.to};t.prototype={constructor:t,focus:function(){window.focus();Nn(this);Dn(this)},setOption:function(t,e){var n=this.options,r=n[t];if(n[t]!=e||"mode"==t){n[t]=e;Wa.hasOwnProperty(t)&&gn(this,Wa[t])(this,e,r)}},getOption:function(t){return this.options[t]},getDoc:function(){return this.doc},addKeyMap:function(t,e){this.state.keyMaps[e?"push":"unshift"](Pr(t))},removeKeyMap:function(t){for(var e=this.state.keyMaps,n=0;n<e.length;++n)if(e[n]==t||e[n].name==t){e.splice(n,1);return!0}},addOverlay:mn(function(e,n){var r=e.token?e:t.getMode(this.options,e);if(r.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:r,modeSpec:e,opaque:n&&n.opaque});this.state.modeGen++;xn(this)}),removeOverlay:mn(function(t){for(var e=this.state.overlays,n=0;n<e.length;++n){var r=e[n].modeSpec;if(r==t||"string"==typeof t&&r.name==t){e.splice(n,1);this.state.modeGen++;xn(this);return}}}),indentLine:mn(function(t,e,n){"string"!=typeof e&&"number"!=typeof e&&(e=null==e?this.options.smartIndent?"smart":"prev":e?"add":"subtract");re(this.doc,t)&&Mr(this,t,e,n)}),indentSelection:mn(function(t){for(var e=this.doc.sel.ranges,n=-1,r=0;r<e.length;r++){var i=e[r];if(i.empty()){if(i.head.line>n){Mr(this,i.head.line,t,!0);n=i.head.line;r==this.doc.sel.primIndex&&kr(this)}}else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;n>l;++l)Mr(this,l,t);var u=this.doc.sel.ranges;0==o.ch&&e.length==u.length&&u[r].from().ch>0&&le(this.doc,r,new K(o,u[r].to()),ws)}}}),getTokenAt:function(t,e){return bi(this,t,e)},getLineTokens:function(t,e){return bi(this,Sa(t),e,!0)},getTokenTypeAt:function(t){t=ee(this.doc,t);var e,n=Ci(this,Ri(this.doc,t.line)),r=0,i=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){e=n[2*a+2];break}r=a+1}}var s=e?e.indexOf("cm-overlay "):-1;return 0>s?e:0==s?null:e.slice(0,s-1)},getModeAt:function(e){var n=this.doc.mode;return n.innerMode?t.innerMode(n,this.getTokenAt(e).state).mode:n},getHelper:function(t,e){return this.getHelpers(t,e)[0]},getHelpers:function(t,e){var n=[];if(!Xa.hasOwnProperty(e))return Xa;var r=Xa[e],i=this.getModeAt(t);if("string"==typeof i[e])r[i[e]]&&n.push(r[i[e]]);else if(i[e])for(var o=0;o<i[e].length;o++){var a=r[i[e][o]];a&&n.push(a)}else i.helperType&&r[i.helperType]?n.push(r[i.helperType]):r[i.name]&&n.push(r[i.name]);for(var o=0;o<r._global.length;o++){var s=r._global[o];s.pred(i,this)&&-1==wo(n,s.val)&&n.push(s.val)}return n},getStateAfter:function(t,e){var n=this.doc;t=te(n,null==t?n.first+n.size-1:t);return Me(this,t+1,e)},cursorCoords:function(t,e){var n,r=this.doc.sel.primary();n=null==t?r.head:"object"==typeof t?ee(this.doc,t):t?r.from():r.to();return Ke(this,n,e||"page")},charCoords:function(t,e){return Je(this,ee(this.doc,t),e||"page")},coordsChar:function(t,e){t=Ye(this,t,e||"page");return tn(this,t.left,t.top)},lineAtHeight:function(t,e){t=Ye(this,{top:t,left:0},e||"page").top;return Ui(this.doc,t+this.display.viewOffset)},heightAtLine:function(t,e){var n=!1,r=this.doc.first+this.doc.size-1;if(t<this.doc.first)t=this.doc.first;else if(t>r){t=r;n=!0}var i=Ri(this.doc,t);return $e(this,i,{top:0,left:0},e||"page").top+(n?this.doc.height-Bi(i):0)},defaultTextHeight:function(){return nn(this.display)},defaultCharWidth:function(){return rn(this.display)},setGutterMarker:mn(function(t,e,n){return Dr(this.doc,t,"gutter",function(t){var r=t.gutterMarkers||(t.gutterMarkers={});r[e]=n;!n&&Mo(r)&&(t.gutterMarkers=null);return!0})}),clearGutter:mn(function(t){var e=this,n=e.doc,r=n.first;n.iter(function(n){if(n.gutterMarkers&&n.gutterMarkers[t]){n.gutterMarkers[t]=null;wn(e,r,"gutter");Mo(n.gutterMarkers)&&(n.gutterMarkers=null)}++r})}),addLineWidget:mn(function(t,e,n){return di(this,t,e,n)}),removeLineWidget:function(t){t.clear()},lineInfo:function(t){if("number"==typeof t){if(!re(this.doc,t))return null;var e=t;t=Ri(this.doc,t);if(!t)return null}else{var e=qi(t);if(null==e)return null}return{line:e,handle:t,text:t.text,gutterMarkers:t.gutterMarkers,textClass:t.textClass,bgClass:t.bgClass,wrapClass:t.wrapClass,widgets:t.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,r,i){var o=this.display;t=Ke(this,ee(this.doc,t));var a=t.bottom,s=t.left;e.style.position="absolute";e.setAttribute("cm-ignore-events","true");o.sizer.appendChild(e);if("over"==r)a=t.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||t.bottom+e.offsetHeight>l)&&t.top>e.offsetHeight?a=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=l&&(a=t.bottom);s+e.offsetWidth>u&&(s=u-e.offsetWidth)}e.style.top=a+"px";e.style.left=e.style.right="";if("right"==i){s=o.sizer.clientWidth-e.offsetWidth;e.style.right="0px"}else{"left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-e.offsetWidth)/2);e.style.left=s+"px"}n&&Cr(this,s,a,s+e.offsetWidth,a+e.offsetHeight)},triggerOnKeyDown:mn(tr),triggerOnKeyPress:mn(rr),triggerOnKeyUp:nr,execCommand:function(t){return Ya.hasOwnProperty(t)?Ya[t](this):void 0},findPosH:function(t,e,n,r){var i=1;if(0>e){i=-1;e=-e}for(var o=0,a=ee(this.doc,t);e>o;++o){a=Ar(this.doc,a,i,n,r);if(a.hitSide)break}return a},moveH:mn(function(t,e){var n=this;n.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?Ar(n.doc,r.head,t,e,n.options.rtlMoveVisually):0>t?r.from():r.to()},Ss)}),deleteH:mn(function(t,e){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Lr(this,function(n){var i=Ar(r,n.head,t,e,!1);return 0>t?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(t,e,n,r){var i=1,o=r;if(0>e){i=-1;e=-e}for(var a=0,s=ee(this.doc,t);e>a;++a){var l=Ke(this,s,"div");null==o?o=l.left:l.left=o;s=Nr(this,l,i,n);if(s.hitSide)break}return s},moveV:mn(function(t,e){var n=this,r=this.doc,i=[],o=!n.display.shift&&!r.extend&&r.sel.somethingSelected();r.extendSelectionsBy(function(a){if(o)return 0>t?a.from():a.to();var s=Ke(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn);i.push(s.left);var l=Nr(n,s,t,e);"page"==e&&a==r.sel.primary()&&Tr(n,null,Je(n,l,"div").top-s.top);return l},Ss);if(i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]}),findWordAt:function(t){var e=this.doc,n=Ri(e,t.line).text,r=t.ch,i=t.ch;if(n){var o=this.getHelper(t,"wordChars");(t.xRel<0||i==n.length)&&r?--r:++i;for(var a=n.charAt(r),s=_o(a,o)?function(t){return _o(t,o)}:/\s/.test(a)?function(t){return/\s/.test(t)}:function(t){return!/\s/.test(t)&&!_o(t)};r>0&&s(n.charAt(r-1));)--r;for(;i<n.length&&s(n.charAt(i));)++i}return new K(Sa(t.line,r),Sa(t.line,i))},toggleOverwrite:function(t){if(null==t||t!=this.state.overwrite){(this.state.overwrite=!this.state.overwrite)?Ps(this.display.cursorDiv,"CodeMirror-overwrite"):js(this.display.cursorDiv,"CodeMirror-overwrite");vs(this,"overwriteToggle",this,this.state.overwrite)}},hasFocus:function(){return jo()==this.display.input},scrollTo:mn(function(t,e){(null!=t||null!=e)&&_r(this);null!=t&&(this.curOp.scrollLeft=t);null!=e&&(this.curOp.scrollTop=e)}),getScrollInfo:function(){var t=this.display.scroller;return{left:t.scrollLeft,top:t.scrollTop,height:t.scrollHeight-Ne(this)-this.display.barHeight,width:t.scrollWidth-Ne(this)-this.display.barWidth,clientHeight:je(this),clientWidth:Ee(this)}},scrollIntoView:mn(function(t,e){if(null==t){t={from:this.doc.sel.primary().head,to:null};null==e&&(e=this.options.cursorScrollMargin)}else"number"==typeof t?t={from:Sa(t,0),to:null}:null==t.from&&(t={from:t,to:null});t.to||(t.to=t.from);t.margin=e||0;if(null!=t.from.line){_r(this);this.curOp.scrollToPos=t}else{var n=Sr(this,Math.min(t.from.left,t.to.left),Math.min(t.from.top,t.to.top)-t.margin,Math.max(t.from.right,t.to.right),Math.max(t.from.bottom,t.to.bottom)+t.margin);this.scrollTo(n.scrollLeft,n.scrollTop)}}),setSize:mn(function(t,e){function n(t){return"number"==typeof t||/^\d+$/.test(String(t))?t+"px":t}var r=this;null!=t&&(r.display.wrapper.style.width=n(t));null!=e&&(r.display.wrapper.style.height=n(e));r.options.lineWrapping&&Be(this);var i=r.display.viewFrom;r.doc.iter(i,r.display.viewTo,function(t){if(t.widgets)for(var e=0;e<t.widgets.length;e++)if(t.widgets[e].noHScroll){wn(r,i,"widget");break}++i});r.curOp.forceUpdate=!0;vs(r,"refresh",this)}),operation:function(t){return pn(this,t)},refresh:mn(function(){var t=this.display.cachedTextHeight;xn(this);this.curOp.forceUpdate=!0;Ve(this);this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop);c(this);(null==t||Math.abs(t-nn(this.display))>.5)&&a(this);vs(this,"refresh",this)}),swapDoc:mn(function(t){var e=this.doc;e.cm=null;Oi(this,t);Ve(this);An(this);this.scrollTo(t.scrollLeft,t.scrollTop);this.curOp.forceScroll=!0;co(this,"swapDoc",this,e);return e}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};mo(t);var Fa=t.defaults={},Wa=t.optionHandlers={},za=t.Init={toString:function(){return"CodeMirror.Init"}};Er("value","",function(t,e){t.setValue(e)},!0);Er("mode",null,function(t,e){t.doc.modeOption=e;n(t)},!0);Er("indentUnit",2,n,!0);Er("indentWithTabs",!1);Er("smartIndent",!0);Er("tabSize",4,function(t){r(t);Ve(t);xn(t)},!0);Er("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,e){t.options.specialChars=new RegExp(e.source+(e.test(" ")?"":"| "),"g");t.refresh()},!0);Er("specialCharPlaceholder",_i,function(t){t.refresh()},!0);Er("electricChars",!0);Er("rtlMoveVisually",!va);Er("wholeLineUpdateBefore",!0);Er("theme","default",function(t){s(t);l(t)},!0);Er("keyMap","default",function(e,n,r){var i=Pr(n),o=r!=t.Init&&Pr(r);o&&o.detach&&o.detach(e,i);i.attach&&i.attach(e,o||null)});Er("extraKeys",null);Er("lineWrapping",!1,i,!0);Er("gutters",[],function(t){d(t.options);l(t)},!0);Er("fixedGutter",!0,function(t,e){t.display.gutters.style.left=e?T(t.display)+"px":"0";t.refresh()},!0);Er("coverGutterNextToScrollbar",!1,function(t){y(t)},!0);Er("scrollbarStyle","native",function(t){v(t);y(t);t.display.scrollbars.setScrollTop(t.doc.scrollTop);t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)},!0);Er("lineNumbers",!1,function(t){d(t.options);l(t)},!0);Er("firstLineNumber",1,l,!0);Er("lineNumberFormatter",function(t){return t},l,!0);Er("showCursorWhenSelecting",!1,xe,!0);Er("resetSelectionOnContextMenu",!0);Er("readOnly",!1,function(t,e){if("nocursor"==e){or(t);t.display.input.blur();t.display.disabled=!0}else{t.display.disabled=!1;e||An(t)}});Er("disableInput",!1,function(t,e){e||An(t)},!0);Er("dragDrop",!0);Er("cursorBlinkRate",530);Er("cursorScrollMargin",0);Er("cursorHeight",1,xe,!0);Er("singleCursorHeightPerLine",!0,xe,!0);Er("workTime",100);Er("workDelay",100);Er("flattenSpans",!0,r,!0);Er("addModeClass",!1,r,!0);Er("pollInterval",100);Er("undoDepth",200,function(t,e){t.doc.history.undoDepth=e});Er("historyEventDelay",1250);Er("viewportMargin",10,function(t){t.refresh()},!0);Er("maxHighlightLength",1e4,r,!0);Er("moveInputWithCursor",!0,function(t,e){e||(t.display.inputDiv.style.top=t.display.inputDiv.style.left=0)});Er("tabindex",null,function(t,e){t.display.input.tabIndex=e||""});Er("autofocus",null);var qa=t.modes={},Ua=t.mimeModes={};t.defineMode=function(e,n){t.defaults.mode||"null"==e||(t.defaults.mode=e);arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2));qa[e]=n};t.defineMIME=function(t,e){Ua[t]=e};t.resolveMode=function(e){if("string"==typeof e&&Ua.hasOwnProperty(e))e=Ua[e];else if(e&&"string"==typeof e.name&&Ua.hasOwnProperty(e.name)){var n=Ua[e.name];"string"==typeof n&&(n={name:n});e=So(n,e);e.name=n.name}else if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return t.resolveMode("application/xml");return"string"==typeof e?{name:e}:e||{name:"null"}};t.getMode=function(e,n){var n=t.resolveMode(n),r=qa[n.name];if(!r)return t.getMode(e,"text/plain");var i=r(e,n);if(Ba.hasOwnProperty(n.name)){var o=Ba[n.name];for(var a in o)if(o.hasOwnProperty(a)){i.hasOwnProperty(a)&&(i["_"+a]=i[a]);i[a]=o[a]}}i.name=n.name;n.helperType&&(i.helperType=n.helperType);if(n.modeProps)for(var a in n.modeProps)i[a]=n.modeProps[a];return i};t.defineMode("null",function(){return{token:function(t){t.skipToEnd()}}});t.defineMIME("text/plain","null");var Ba=t.modeExtensions={};t.extendMode=function(t,e){var n=Ba.hasOwnProperty(t)?Ba[t]:Ba[t]={};To(e,n)};t.defineExtension=function(e,n){t.prototype[e]=n};t.defineDocExtension=function(t,e){us.prototype[t]=e};t.defineOption=Er;var Va=[];t.defineInitHook=function(t){Va.push(t)};var Xa=t.helpers={};t.registerHelper=function(e,n,r){Xa.hasOwnProperty(e)||(Xa[e]=t[e]={_global:[]});Xa[e][n]=r};t.registerGlobalHelper=function(e,n,r,i){t.registerHelper(e,n,i);Xa[e]._global.push({pred:r,val:i})};var Ga=t.copyState=function(t,e){if(e===!0)return e;if(t.copyState)return t.copyState(e);var n={};for(var r in e){var i=e[r];i instanceof Array&&(i=i.concat([]));n[r]=i}return n},$a=t.startState=function(t,e,n){return t.startState?t.startState(e,n):!0};t.innerMode=function(t,e){for(;t.innerMode;){var n=t.innerMode(e);if(!n||n.mode==t)break;e=n.state;t=n.mode}return n||{mode:t,state:e}};var Ya=t.commands={selectAll:function(t){t.setSelection(Sa(t.firstLine(),0),Sa(t.lastLine()),ws)},singleSelection:function(t){t.setSelection(t.getCursor("anchor"),t.getCursor("head"),ws)},killLine:function(t){Lr(t,function(e){if(e.empty()){var n=Ri(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line<t.lastLine()?{from:e.head,to:Sa(e.head.line+1,0)}:{from:e.head,to:Sa(e.head.line,n)}}return{from:e.from(),to:e.to()}})},deleteLine:function(t){Lr(t,function(e){return{from:Sa(e.from().line,0),to:ee(t.doc,Sa(e.to().line+1,0))}})},delLineLeft:function(t){Lr(t,function(t){return{from:Sa(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(t){Lr(t,function(e){var n=t.charCoords(e.head,"div").top+5,r=t.coordsChar({left:0,top:n},"div");return{from:r,to:e.from()}})},delWrappedLineRight:function(t){Lr(t,function(e){var n=t.charCoords(e.head,"div").top+5,r=t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div");return{from:e.from(),to:r}})},undo:function(t){t.undo()},redo:function(t){t.redo()},undoSelection:function(t){t.undoSelection()},redoSelection:function(t){t.redoSelection()},goDocStart:function(t){t.extendSelection(Sa(t.firstLine(),0))},goDocEnd:function(t){t.extendSelection(Sa(t.lastLine()))},goLineStart:function(t){t.extendSelectionsBy(function(e){return Go(t,e.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(t){t.extendSelectionsBy(function(e){return Yo(t,e.head)},{origin:"+move",bias:1})},goLineEnd:function(t){t.extendSelectionsBy(function(e){return $o(t,e.head.line)},{origin:"+move",bias:-1})},goLineRight:function(t){t.extendSelectionsBy(function(e){var n=t.charCoords(e.head,"div").top+5;return t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div")},Ss)},goLineLeft:function(t){t.extendSelectionsBy(function(e){var n=t.charCoords(e.head,"div").top+5;return t.coordsChar({left:0,top:n},"div")},Ss)},goLineLeftSmart:function(t){t.extendSelectionsBy(function(e){var n=t.charCoords(e.head,"div").top+5,r=t.coordsChar({left:0,top:n},"div");return r.ch<t.getLine(r.line).search(/\S/)?Yo(t,e.head):r},Ss)},goLineUp:function(t){t.moveV(-1,"line")},goLineDown:function(t){t.moveV(1,"line")},goPageUp:function(t){t.moveV(-1,"page")},goPageDown:function(t){t.moveV(1,"page")},goCharLeft:function(t){t.moveH(-1,"char")},goCharRight:function(t){t.moveH(1,"char")},goColumnLeft:function(t){t.moveH(-1,"column")},goColumnRight:function(t){t.moveH(1,"column")},goWordLeft:function(t){t.moveH(-1,"word")},goGroupRight:function(t){t.moveH(1,"group")},goGroupLeft:function(t){t.moveH(-1,"group")},goWordRight:function(t){t.moveH(1,"word")},delCharBefore:function(t){t.deleteH(-1,"char")},delCharAfter:function(t){t.deleteH(1,"char")},delWordBefore:function(t){t.deleteH(-1,"word")},delWordAfter:function(t){t.deleteH(1,"word")},delGroupBefore:function(t){t.deleteH(-1,"group")},delGroupAfter:function(t){t.deleteH(1,"group")},indentAuto:function(t){t.indentSelection("smart")},indentMore:function(t){t.indentSelection("add")},indentLess:function(t){t.indentSelection("subtract")},insertTab:function(t){t.replaceSelection(" ")},insertSoftTab:function(t){for(var e=[],n=t.listSelections(),r=t.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=Ts(t.getLine(o.line),o.ch,r);e.push(new Array(r-a%r+1).join(" "))}t.replaceSelections(e)},defaultTab:function(t){t.somethingSelected()?t.indentSelection("add"):t.execCommand("insertTab")},transposeChars:function(t){pn(t,function(){for(var e=t.listSelections(),n=[],r=0;r<e.length;r++){var i=e[r].head,o=Ri(t.doc,i.line).text;if(o){i.ch==o.length&&(i=new Sa(i.line,i.ch-1));if(i.ch>0){i=new Sa(i.line,i.ch+1);t.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),Sa(i.line,i.ch-2),i,"+transpose")}else if(i.line>t.doc.first){var a=Ri(t.doc,i.line-1).text;a&&t.replaceRange(o.charAt(0)+"\n"+a.charAt(a.length-1),Sa(i.line-1,a.length-1),Sa(i.line,1),"+transpose")}}n.push(new K(i,i))}t.setSelections(n)})},newlineAndIndent:function(t){pn(t,function(){for(var e=t.listSelections().length,n=0;e>n;n++){var r=t.listSelections()[n];t.replaceRange("\n",r.anchor,r.head,"+input");t.indentLine(r.from().line+1,null,!0);kr(t)}})},toggleOverwrite:function(t){t.toggleOverwrite()}},Ja=t.keyMap={};Ja.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"};Ja.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"};Ja.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"};Ja.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]};Ja["default"]=ma?Ja.macDefault:Ja.pcDefault;t.normalizeKeyMap=function(t){var e={};for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete t[n];continue}for(var i=Co(n.split(" "),jr),o=0;o<i.length;o++){var a,s;if(o==i.length-1){s=n;a=r}else{s=i.slice(0,o+1).join(" ");a="..."}var l=e[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else e[s]=a}delete t[n]}for(var u in e)t[u]=e[u];return t};var Ka=t.lookupKey=function(t,e,n,r){e=Pr(e);var i=e.call?e.call(t,r):e[t];if(i===!1)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(e.fallthrough){if("[object Array]"!=Object.prototype.toString.call(e.fallthrough))return Ka(t,e.fallthrough,n,r);for(var o=0;o<e.fallthrough.length;o++){var a=Ka(t,e.fallthrough[o],n,r);if(a)return a}}},Za=t.isModifierKey=function(t){var e="string"==typeof t?t:zs[t.keyCode];return"Ctrl"==e||"Alt"==e||"Shift"==e||"Mod"==e},Qa=t.keyName=function(t,e){if(ua&&34==t.keyCode&&t["char"])return!1;var n=zs[t.keyCode],r=n;if(null==r||t.altGraphKey)return!1;t.altKey&&"Alt"!=n&&(r="Alt-"+r);(ba?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(r="Ctrl-"+r);(ba?t.ctrlKey:t.metaKey)&&"Cmd"!=n&&(r="Cmd-"+r);!e&&t.shiftKey&&"Shift"!=n&&(r="Shift-"+r);return r};t.fromTextArea=function(e,n){function r(){e.value=u.getValue()}n||(n={});n.value=e.value;!n.tabindex&&e.tabindex&&(n.tabindex=e.tabindex);!n.placeholder&&e.placeholder&&(n.placeholder=e.placeholder);if(null==n.autofocus){var i=jo();n.autofocus=i==e||null!=e.getAttribute("autofocus")&&i==document.body}if(e.form){gs(e.form,"submit",r);if(!n.leaveSubmitMethodAlone){var o=e.form,a=o.submit;try{var s=o.submit=function(){r();o.submit=a;o.submit();o.submit=s}}catch(l){}}}e.style.display="none";var u=t(function(t){e.parentNode.insertBefore(t,e.nextSibling)},n);u.save=r;u.getTextArea=function(){return e};u.toTextArea=function(){u.toTextArea=isNaN;r();e.parentNode.removeChild(u.getWrapperElement());e.style.display="";if(e.form){ms(e.form,"submit",r);"function"==typeof e.form.submit&&(e.form.submit=a)}};return u};var ts=t.StringStream=function(t,e){this.pos=this.start=0;this.string=t;this.tabSize=e||8;this.lastColumnPos=this.lastColumnValue=0;this.lineStart=0};ts.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(t){var e=this.string.charAt(this.pos);if("string"==typeof t)var n=e==t;else var n=e&&(t.test?t.test(e):t(e));if(n){++this.pos;return e}},eatWhile:function(t){for(var e=this.pos;this.eat(t););return this.pos>e},eatSpace:function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},skipToEnd:function(){this.pos=this.string.length},skipTo:function(t){var e=this.string.indexOf(t,this.pos);if(e>-1){this.pos=e;return!0}},backUp:function(t){this.pos-=t},column:function(){if(this.lastColumnPos<this.start){this.lastColumnValue=Ts(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue);
this.lastColumnPos=this.start}return this.lastColumnValue-(this.lineStart?Ts(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return Ts(this.string,null,this.tabSize)-(this.lineStart?Ts(this.string,this.lineStart,this.tabSize):0)},match:function(t,e,n){if("string"!=typeof t){var r=this.string.slice(this.pos).match(t);if(r&&r.index>0)return null;r&&e!==!1&&(this.pos+=r[0].length);return r}var i=function(t){return n?t.toLowerCase():t},o=this.string.substr(this.pos,t.length);if(i(o)==i(t)){e!==!1&&(this.pos+=t.length);return!0}},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}}};var es=t.TextMarker=function(t,e){this.lines=[];this.type=e;this.doc=t};mo(es);es.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;e&&on(t);if(go(this,"clear")){var n=this.find();n&&co(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],s=zr(a.markedSpans,this);if(t&&!this.collapsed)wn(t,qi(a),"text");else if(t){null!=s.to&&(i=qi(a));null!=s.from&&(r=qi(a))}a.markedSpans=qr(a.markedSpans,s);null==s.from&&this.collapsed&&!ui(this.doc,a)&&t&&zi(a,nn(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var o=0;o<this.lines.length;++o){var l=oi(this.lines[o]),u=f(l);if(u>t.display.maxLineLength){t.display.maxLine=l;t.display.maxLineLength=u;t.display.maxLineChanged=!0}}null!=r&&t&&this.collapsed&&xn(t,r,i+1);this.lines.length=0;this.explicitlyCleared=!0;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=!1;t&&ge(t.doc)}t&&co(t,"markerCleared",t,this);e&&sn(t);this.parent&&this.parent.clear()}};es.prototype.find=function(t,e){null==t&&"bookmark"==this.type&&(t=1);for(var n,r,i=0;i<this.lines.length;++i){var o=this.lines[i],a=zr(o.markedSpans,this);if(null!=a.from){n=Sa(e?o:qi(o),a.from);if(-1==t)return n}if(null!=a.to){r=Sa(e?o:qi(o),a.to);if(1==t)return r}}return n&&{from:n,to:r}};es.prototype.changed=function(){var t=this.find(-1,!0),e=this,n=this.doc.cm;t&&n&&pn(n,function(){var r=t.line,i=qi(t.line),o=Re(n,i);if(o){Ue(o);n.curOp.selectionChanged=n.curOp.forceUpdate=!0}n.curOp.updateMaxLine=!0;if(!ui(e.doc,r)&&null!=e.height){var a=e.height;e.height=null;var s=hi(e)-a;s&&zi(r,r.height+s)}})};es.prototype.attachLine=function(t){if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;e.maybeHiddenMarkers&&-1!=wo(e.maybeHiddenMarkers,this)||(e.maybeUnhiddenMarkers||(e.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(t)};es.prototype.detachLine=function(t){this.lines.splice(wo(this.lines,t),1);if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;(e.maybeHiddenMarkers||(e.maybeHiddenMarkers=[])).push(this)}};var ns=0,rs=t.SharedTextMarker=function(t,e){this.markers=t;this.primary=e;for(var n=0;n<t.length;++n)t[n].parent=this};mo(rs);rs.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)this.markers[t].clear();co(this,"clear")}};rs.prototype.find=function(t,e){return this.primary.find(t,e)};var is=t.LineWidget=function(t,e,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.cm=t;this.node=e};mo(is);is.prototype.clear=function(){var t=this.cm,e=this.line.widgets,n=this.line,r=qi(n);if(null!=r&&e){for(var i=0;i<e.length;++i)e[i]==this&&e.splice(i--,1);e.length||(n.widgets=null);var o=hi(this);pn(t,function(){fi(t,n,-o);wn(t,r,"widget");zi(n,Math.max(0,n.height-o))})}};is.prototype.changed=function(){var t=this.height,e=this.cm,n=this.line;this.height=null;var r=hi(this)-t;r&&pn(e,function(){e.curOp.forceUpdate=!0;fi(e,n,r);zi(n,n.height+r)})};var os=t.Line=function(t,e,n){this.text=t;Kr(this,e);this.height=n?n(this):1};mo(os);os.prototype.lineNo=function(){return qi(this)};var as={},ss={};Pi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(t,e){for(var n=t,r=t+e;r>n;++n){var i=this.lines[n];this.height-=i.height;gi(i);co(i,"delete")}this.lines.splice(t,e)},collapse:function(t){t.push.apply(t,this.lines)},insertInner:function(t,e,n){this.height+=n;this.lines=this.lines.slice(0,t).concat(e).concat(this.lines.slice(t));for(var r=0;r<e.length;++r)e[r].parent=this},iterN:function(t,e,n){for(var r=t+e;r>t;++t)if(n(this.lines[t]))return!0}};Ii.prototype={chunkSize:function(){return this.size},removeInner:function(t,e){this.size-=e;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(i>t){var o=Math.min(e,i-t),a=r.height;r.removeInner(t,o);this.height-=a-r.height;if(i==o){this.children.splice(n--,1);r.parent=null}if(0==(e-=o))break;t=0}else t-=i}if(this.size-e<25&&(this.children.length>1||!(this.children[0]instanceof Pi))){var s=[];this.collapse(s);this.children=[new Pi(s)];this.children[0].parent=this}},collapse:function(t){for(var e=0;e<this.children.length;++e)this.children[e].collapse(t)},insertInner:function(t,e,n){this.size+=e.length;this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(o>=t){i.insertInner(t,e,n);if(i.lines&&i.lines.length>50){for(;i.lines.length>50;){var a=i.lines.splice(i.lines.length-25,25),s=new Pi(a);i.height-=s.height;this.children.splice(r+1,0,s);s.parent=this}this.maybeSpill()}break}t-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var t=this;do{var e=t.children.splice(t.children.length-5,5),n=new Ii(e);if(t.parent){t.size-=n.size;t.height-=n.height;var r=wo(t.parent.children,t);t.parent.children.splice(r+1,0,n)}else{var i=new Ii(t.children);i.parent=t;t.children=[i,n];t=i}n.parent=t.parent}while(t.children.length>10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(o>t){var a=Math.min(e,o-t);if(i.iterN(t,a,n))return!0;if(0==(e-=a))break;t=0}else t-=o}}};var ls=0,us=t.Doc=function(t,e,n){if(!(this instanceof us))return new us(t,e,n);null==n&&(n=0);Ii.call(this,[new Pi([new os("",null)])]);this.first=n;this.scrollTop=this.scrollLeft=0;this.cantEdit=!1;this.cleanGeneration=1;this.frontier=n;var r=Sa(n,0);this.sel=Q(r);this.history=new Xi(null);this.id=++ls;this.modeOption=e;"string"==typeof t&&(t=Os(t));ji(this,{from:r,to:r,text:t});he(this,Q(r),ws)};us.prototype=So(Ii.prototype,{constructor:us,iter:function(t,e,n){n?this.iterN(t-this.first,e-t,n):this.iterN(this.first,this.first+this.size,t)},insert:function(t,e){for(var n=0,r=0;r<e.length;++r)n+=e[r].height;this.insertInner(t-this.first,e,n)},remove:function(t,e){this.removeInner(t-this.first,e)},getValue:function(t){var e=Wi(this,this.first,this.first+this.size);return t===!1?e:e.join(t||"\n")},setValue:vn(function(t){var e=Sa(this.first,0),n=this.first+this.size-1;dr(this,{from:e,to:Sa(n,Ri(this,n).text.length),text:Os(t),origin:"setValue",full:!0},!0);he(this,Q(e))}),replaceRange:function(t,e,n,r){e=ee(this,e);n=n?ee(this,n):e;br(this,t,e,n,r)},getRange:function(t,e,n){var r=Fi(this,ee(this,t),ee(this,e));return n===!1?r:r.join(n||"\n")},getLine:function(t){var e=this.getLineHandle(t);return e&&e.text},getLineHandle:function(t){return re(this,t)?Ri(this,t):void 0},getLineNumber:function(t){return qi(t)},getLineHandleVisualStart:function(t){"number"==typeof t&&(t=Ri(this,t));return oi(t)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(t){return ee(this,t)},getCursor:function(t){var e,n=this.sel.primary();e=null==t||"head"==t?n.head:"anchor"==t?n.anchor:"end"==t||"to"==t||t===!1?n.to():n.from();return e},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:vn(function(t,e,n){ue(this,ee(this,"number"==typeof t?Sa(t,e||0):t),null,n)}),setSelection:vn(function(t,e,n){ue(this,ee(this,t),ee(this,e||t),n)}),extendSelection:vn(function(t,e,n){ae(this,ee(this,t),e&&ee(this,e),n)}),extendSelections:vn(function(t,e){se(this,ie(this,t,e))}),extendSelectionsBy:vn(function(t,e){se(this,Co(this.sel.ranges,t),e)}),setSelections:vn(function(t,e,n){if(t.length){for(var r=0,i=[];r<t.length;r++)i[r]=new K(ee(this,t[r].anchor),ee(this,t[r].head));null==e&&(e=Math.min(t.length-1,this.sel.primIndex));he(this,Z(i,e),n)}}),addSelection:vn(function(t,e,n){var r=this.sel.ranges.slice(0);r.push(new K(ee(this,t),ee(this,e||t)));he(this,Z(r,r.length-1),n)}),getSelection:function(t){for(var e,n=this.sel.ranges,r=0;r<n.length;r++){var i=Fi(this,n[r].from(),n[r].to());e=e?e.concat(i):i}return t===!1?e:e.join(t||"\n")},getSelections:function(t){for(var e=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Fi(this,n[r].from(),n[r].to());t!==!1&&(i=i.join(t||"\n"));e[r]=i}return e},replaceSelection:function(t,e,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=t;this.replaceSelections(r,e,n||"+input")},replaceSelections:vn(function(t,e,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:Os(t[o]),origin:n}}for(var s=e&&"end"!=e&&fr(this,r,e),o=r.length-1;o>=0;o--)dr(this,r[o]);s?fe(this,s):this.cm&&kr(this.cm)}),undo:vn(function(){gr(this,"undo")}),redo:vn(function(){gr(this,"redo")}),undoSelection:vn(function(){gr(this,"undo",!0)}),redoSelection:vn(function(){gr(this,"redo",!0)}),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,r=0;r<t.done.length;r++)t.done[r].ranges||++e;for(var r=0;r<t.undone.length;r++)t.undone[r].ranges||++n;return{undo:e,redo:n}},clearHistory:function(){this.history=new Xi(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(t){t&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null);return this.history.generation},isClean:function(t){return this.history.generation==(t||this.cleanGeneration)},getHistory:function(){return{done:ro(this.history.done),undone:ro(this.history.undone)}},setHistory:function(t){var e=this.history=new Xi(this.history.maxGeneration);e.done=ro(t.done.slice(0),null,!0);e.undone=ro(t.undone.slice(0),null,!0)},addLineClass:vn(function(t,e,n){return Dr(this,t,"gutter"==e?"gutter":"class",function(t){var r="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass";if(t[r]){if(Po(n).test(t[r]))return!1;t[r]+=" "+n}else t[r]=n;return!0})}),removeLineClass:vn(function(t,e,n){return Dr(this,t,"gutter"==e?"gutter":"class",function(t){var r="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass",i=t[r];if(!i)return!1;if(null==n)t[r]=null;else{var o=i.match(Po(n));if(!o)return!1;var a=o.index+o[0].length;t[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0})}),markText:function(t,e,n){return Ir(this,ee(this,t),ee(this,e),n,"range")},setBookmark:function(t,e){var n={replacedWith:e&&(null==e.nodeType?e.widget:e),insertLeft:e&&e.insertLeft,clearWhenEmpty:!1,shared:e&&e.shared};t=ee(this,t);return Ir(this,t,t,n,"bookmark")},findMarksAt:function(t){t=ee(this,t);var e=[],n=Ri(this,t.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=t.ch)&&(null==i.to||i.to>=t.ch)&&e.push(i.marker.parent||i.marker)}return e},findMarks:function(t,e,n){t=ee(this,t);e=ee(this,e);var r=[],i=t.line;this.iter(t.line,e.line+1,function(o){var a=o.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];i==t.line&&t.ch>l.to||null==l.from&&i!=t.line||i==e.line&&l.from>e.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i});return r},getAllMarks:function(){var t=[];this.iter(function(e){var n=e.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&t.push(n[r].marker)});return t},posFromIndex:function(t){var e,n=this.first;this.iter(function(r){var i=r.text.length+1;if(i>t){e=t;return!0}t-=i;++n});return ee(this,Sa(n,e))},indexFromPos:function(t){t=ee(this,t);var e=t.ch;if(t.line<this.first||t.ch<0)return 0;this.iter(this.first,t.line,function(t){e+=t.text.length+1});return e},copy:function(t){var e=new us(Wi(this,this.first,this.first+this.size),this.modeOption,this.first);e.scrollTop=this.scrollTop;e.scrollLeft=this.scrollLeft;e.sel=this.sel;e.extend=!1;if(t){e.history.undoDepth=this.history.undoDepth;e.setHistory(this.getHistory())}return e},linkedDoc:function(t){t||(t={});var e=this.first,n=this.first+this.size;null!=t.from&&t.from>e&&(e=t.from);null!=t.to&&t.to<n&&(n=t.to);var r=new us(Wi(this,e,n),t.mode||this.modeOption,e);t.sharedHist&&(r.history=this.history);(this.linked||(this.linked=[])).push({doc:r,sharedHist:t.sharedHist});r.linked=[{doc:this,isParent:!0,sharedHist:t.sharedHist}];Rr(r,Or(this));return r},unlinkDoc:function(e){e instanceof t&&(e=e.doc);if(this.linked)for(var n=0;n<this.linked.length;++n){var r=this.linked[n];if(r.doc==e){this.linked.splice(n,1);e.unlinkDoc(this);Fr(Or(this));break}}if(e.history==this.history){var i=[e.id];Hi(e,function(t){i.push(t.id)},!0);e.history=new Xi(null);e.history.done=ro(this.history.done,i);e.history.undone=ro(this.history.undone,i)}},iterLinkedDocs:function(t){Hi(this,t)},getMode:function(){return this.mode},getEditor:function(){return this.cm}});us.prototype.eachLine=us.prototype.iter;var cs="iter insert remove copy getEditor".split(" ");for(var fs in us.prototype)us.prototype.hasOwnProperty(fs)&&wo(cs,fs)<0&&(t.prototype[fs]=function(t){return function(){return t.apply(this.doc,arguments)}}(us.prototype[fs]));mo(us);var hs=t.e_preventDefault=function(t){t.preventDefault?t.preventDefault():t.returnValue=!1},ds=t.e_stopPropagation=function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},ps=t.e_stop=function(t){hs(t);ds(t)},gs=t.on=function(t,e,n){if(t.addEventListener)t.addEventListener(e,n,!1);else if(t.attachEvent)t.attachEvent("on"+e,n);else{var r=t._handlers||(t._handlers={}),i=r[e]||(r[e]=[]);i.push(n)}},ms=t.off=function(t,e,n){if(t.removeEventListener)t.removeEventListener(e,n,!1);else if(t.detachEvent)t.detachEvent("on"+e,n);else{var r=t._handlers&&t._handlers[e];if(!r)return;for(var i=0;i<r.length;++i)if(r[i]==n){r.splice(i,1);break}}},vs=t.signal=function(t,e){var n=t._handlers&&t._handlers[e];if(n)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)},ys=null,bs=30,xs=t.Pass={toString:function(){return"CodeMirror.Pass"}},ws={scroll:!1},Cs={origin:"*mouse"},Ss={origin:"+move"};vo.prototype.set=function(t,e){clearTimeout(this.id);this.id=setTimeout(e,t)};var Ts=t.countColumn=function(t,e,n,r,i){if(null==e){e=t.search(/[^\s\u00a0]/);-1==e&&(e=t.length)}for(var o=r||0,a=i||0;;){var s=t.indexOf(" ",o);if(0>s||s>=e)return a+(e-o);a+=s-o;a+=n-a%n;o=s+1}},ks=[""],_s=function(t){t.select()};pa?_s=function(t){t.selectionStart=0;t.selectionEnd=t.value.length}:ia&&(_s=function(t){try{t.select()}catch(e){}});var Ms,Ds=/[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ls=t.isWordChar=function(t){return/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||Ds.test(t))},As=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;Ms=document.createRange?function(t,e,n){var r=document.createRange();r.setEnd(t,n);r.setStart(t,e);return r}:function(t,e,n){var r=document.body.createTextRange();try{r.moveToElementText(t.parentNode)}catch(i){return r}r.collapse(!0);r.moveEnd("character",n);r.moveStart("character",e);return r};ia&&11>oa&&(jo=function(){try{return document.activeElement}catch(t){return document.body}});var Ns,Es,js=t.rmClass=function(t,e){var n=t.className,r=Po(e).exec(n);if(r){var i=n.slice(r.index+r[0].length);t.className=n.slice(0,r.index)+(i?r[1]+i:"")}},Ps=t.addClass=function(t,e){var n=t.className;Po(e).test(n)||(t.className+=(n?" ":"")+e)},Is=!1,Hs=function(){if(ia&&9>oa)return!1;var t=Lo("div");return"draggable"in t||"dragDrop"in t}(),Os=t.splitLines=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],r=t.length;r>=e;){var i=t.indexOf("\n",e);-1==i&&(i=t.length);var o=t.slice(e,"\r"==t.charAt(i-1)?i-1:i),a=o.indexOf("\r");if(-1!=a){n.push(o.slice(0,a));e+=a+1}else{n.push(o);e=i+1}}return n}:function(t){return t.split(/\r\n?|\n/)},Rs=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(e){return!1}}:function(t){try{var e=t.ownerDocument.selection.createRange()}catch(n){}return e&&e.parentElement()==t?0!=e.compareEndPoints("StartToEnd",e):!1},Fs=function(){var t=Lo("div");if("oncopy"in t)return!0;t.setAttribute("oncopy","return;");return"function"==typeof t.oncopy}(),Ws=null,zs={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};t.keyNames=zs;(function(){for(var t=0;10>t;t++)zs[t+48]=zs[t+96]=String(t);for(var t=65;90>=t;t++)zs[t]=String.fromCharCode(t);for(var t=1;12>=t;t++)zs[t+111]=zs[t+63235]="F"+t})();var qs,Us=function(){function t(t){return 247>=t?n.charAt(t):t>=1424&&1524>=t?"R":t>=1536&&1773>=t?r.charAt(t-1536):t>=1774&&2220>=t?"r":t>=8192&&8203>=t?"w":8204==t?"b":"L"}function e(t,e,n){this.level=t;this.from=e;this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,s=/[Lb1n]/,l=/[1n]/,u="L";return function(n){if(!i.test(n))return!1;for(var r,c=n.length,f=[],h=0;c>h;++h)f.push(r=t(n.charCodeAt(h)));for(var h=0,d=u;c>h;++h){var r=f[h];"m"==r?f[h]=d:d=r}for(var h=0,p=u;c>h;++h){var r=f[h];if("1"==r&&"r"==p)f[h]="n";else if(a.test(r)){p=r;"r"==r&&(f[h]="R")}}for(var h=1,d=f[0];c-1>h;++h){var r=f[h];"+"==r&&"1"==d&&"1"==f[h+1]?f[h]="1":","!=r||d!=f[h+1]||"1"!=d&&"n"!=d||(f[h]=d);d=r}for(var h=0;c>h;++h){var r=f[h];if(","==r)f[h]="N";else if("%"==r){for(var g=h+1;c>g&&"%"==f[g];++g);for(var m=h&&"!"==f[h-1]||c>g&&"1"==f[g]?"1":"N",v=h;g>v;++v)f[v]=m;h=g-1}}for(var h=0,p=u;c>h;++h){var r=f[h];"L"==p&&"1"==r?f[h]="L":a.test(r)&&(p=r)}for(var h=0;c>h;++h)if(o.test(f[h])){for(var g=h+1;c>g&&o.test(f[g]);++g);for(var y="L"==(h?f[h-1]:u),b="L"==(c>g?f[g]:u),m=y||b?"L":"R",v=h;g>v;++v)f[v]=m;h=g-1}for(var x,w=[],h=0;c>h;)if(s.test(f[h])){var C=h;for(++h;c>h&&s.test(f[h]);++h);w.push(new e(0,C,h))}else{var S=h,T=w.length;for(++h;c>h&&"L"!=f[h];++h);for(var v=S;h>v;)if(l.test(f[v])){v>S&&w.splice(T,0,new e(1,S,v));var k=v;for(++v;h>v&&l.test(f[v]);++v);w.splice(T,0,new e(2,k,v));S=v}else++v;h>S&&w.splice(T,0,new e(1,S,h))}if(1==w[0].level&&(x=n.match(/^\s+/))){w[0].from=x[0].length;w.unshift(new e(0,0,x[0].length))}if(1==xo(w).level&&(x=n.match(/\s+$/))){xo(w).to-=x[0].length;w.push(new e(0,c-x[0].length,c))}w[0].level!=xo(w).level&&w.push(new e(w[0].level,c,c));return w}}();t.version="4.12.0";return t})},{}],12:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)})(function(t){"use strict";t.defineMode("javascript",function(e,n){function r(t){for(var e,n=!1,r=!1;null!=(e=t.next());){if(!n){if("/"==e&&!r)return;"["==e?r=!0:r&&"]"==e&&(r=!1)}n=!n&&"\\"==e}}function i(t,e,n){ge=t;me=n;return e}function o(t,e){var n=t.next();if('"'==n||"'"==n){e.tokenize=a(n);return e.tokenize(t,e)}if("."==n&&t.match(/^\d+(?:[eE][+\-]?\d+)?/))return i("number","number");if("."==n&&t.match(".."))return i("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return i(n);if("="==n&&t.eat(">"))return i("=>","operator");if("0"==n&&t.eat(/x/i)){t.eatWhile(/[\da-f]/i);return i("number","number")}if(/\d/.test(n)){t.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);return i("number","number")}if("/"==n){if(t.eat("*")){e.tokenize=s;return s(t,e)}if(t.eat("/")){t.skipToEnd();return i("comment","comment")}if("operator"==e.lastType||"keyword c"==e.lastType||"sof"==e.lastType||/^[\[{}\(,;:]$/.test(e.lastType)){r(t);t.eatWhile(/[gimy]/);return i("regexp","string-2")}t.eatWhile(Te);return i("operator","operator",t.current())}if("`"==n){e.tokenize=l;return l(t,e)}if("#"==n){t.skipToEnd();return i("error","error")}if(Te.test(n)){t.eatWhile(Te);return i("operator","operator",t.current())}if(Ce.test(n)){t.eatWhile(Ce);var o=t.current(),u=Se.propertyIsEnumerable(o)&&Se[o];return u&&"."!=e.lastType?i(u.type,u.style,o):i("variable","variable",o)}}function a(t){return function(e,n){var r,a=!1;if(be&&"@"==e.peek()&&e.match(ke)){n.tokenize=o;return i("jsonld-keyword","meta")}for(;null!=(r=e.next())&&(r!=t||a);)a=!a&&"\\"==r;a||(n.tokenize=o);return i("string","string")}}function s(t,e){for(var n,r=!1;n=t.next();){if("/"==n&&r){e.tokenize=o;break}r="*"==n}return i("comment","comment")}function l(t,e){for(var n,r=!1;null!=(n=t.next());){if(!r&&("`"==n||"$"==n&&t.eat("{"))){e.tokenize=o;break}r=!r&&"\\"==n}return i("quasi","string-2",t.current())}function u(t,e){e.fatArrowAt&&(e.fatArrowAt=null);var n=t.string.indexOf("=>",t.start);if(!(0>n)){for(var r=0,i=!1,o=n-1;o>=0;--o){var a=t.string.charAt(o),s=_e.indexOf(a);if(s>=0&&3>s){if(!r){++o;break}if(0==--r)break}else if(s>=3&&6>s)++r;else if(Ce.test(a))i=!0;else{if(/["'\/]/.test(a))return;if(i&&!r){++o;break}}}i&&!r&&(e.fatArrowAt=o)}}function c(t,e,n,r,i,o){this.indented=t;this.column=e;this.type=n;this.prev=i;this.info=o;null!=r&&(this.align=r)}function f(t,e){for(var n=t.localVars;n;n=n.next)if(n.name==e)return!0;for(var r=t.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==e)return!0}function h(t,e,n,r,i){var o=t.cc;De.state=t;De.stream=i;De.marked=null,De.cc=o;De.style=e;t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);for(;;){var a=o.length?o.pop():xe?C:w;if(a(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return De.marked?De.marked:"variable"==n&&f(t,r)?"variable-2":e}}}function d(){for(var t=arguments.length-1;t>=0;t--)De.cc.push(arguments[t])}function p(){d.apply(null,arguments);return!0}function g(t){function e(e){for(var n=e;n;n=n.next)if(n.name==t)return!0;return!1}var r=De.state;if(r.context){De.marked="def";if(e(r.localVars))return;r.localVars={name:t,next:r.localVars}}else{if(e(r.globalVars))return;n.globalVars&&(r.globalVars={name:t,next:r.globalVars})}}function m(){De.state.context={prev:De.state.context,vars:De.state.localVars};De.state.localVars=Le}function v(){De.state.localVars=De.state.context.vars;De.state.context=De.state.context.prev}function y(t,e){var n=function(){var n=De.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new c(r,De.stream.column(),t,null,n.lexical,e)};n.lex=!0;return n}function b(){var t=De.state;if(t.lexical.prev){")"==t.lexical.type&&(t.indented=t.lexical.indented);t.lexical=t.lexical.prev}}function x(t){function e(n){return n==t?p():";"==t?d():p(e)}return e}function w(t,e){if("var"==t)return p(y("vardef",e.length),U,x(";"),b);if("keyword a"==t)return p(y("form"),C,w,b);if("keyword b"==t)return p(y("form"),w,b);if("{"==t)return p(y("}"),W,b);if(";"==t)return p();if("if"==t){"else"==De.state.lexical.info&&De.state.cc[De.state.cc.length-1]==b&&De.state.cc.pop()();return p(y("form"),C,w,b,$)}return"function"==t?p(te):"for"==t?p(y("form"),Y,w,b):"variable"==t?p(y("stat"),j):"switch"==t?p(y("form"),C,y("}","switch"),x("{"),W,b,b):"case"==t?p(C,x(":")):"default"==t?p(x(":")):"catch"==t?p(y("form"),m,x("("),ee,x(")"),w,b,v):"module"==t?p(y("form"),m,ae,v,b):"class"==t?p(y("form"),ne,b):"export"==t?p(y("form"),se,b):"import"==t?p(y("form"),le,b):d(y("stat"),C,x(";"),b)}function C(t){return T(t,!1)}function S(t){return T(t,!0)}function T(t,e){if(De.state.fatArrowAt==De.stream.start){var n=e?E:N;if("("==t)return p(m,y(")"),R(B,")"),b,x("=>"),n,v);if("variable"==t)return d(m,B,x("=>"),n,v)}var r=e?D:M;return Me.hasOwnProperty(t)?p(r):"function"==t?p(te,r):"keyword c"==t?p(e?_:k):"("==t?p(y(")"),k,de,x(")"),b,r):"operator"==t||"spread"==t?p(e?S:C):"["==t?p(y("]"),fe,b,r):"{"==t?F(I,"}",null,r):"quasi"==t?d(L,r):p()}function k(t){return t.match(/[;\}\)\],]/)?d():d(C)}function _(t){return t.match(/[;\}\)\],]/)?d():d(S)}function M(t,e){return","==t?p(C):D(t,e,!1)}function D(t,e,n){var r=0==n?M:D,i=0==n?C:S;return"=>"==t?p(m,n?E:N,v):"operator"==t?/\+\+|--/.test(e)?p(r):"?"==e?p(C,x(":"),i):p(i):"quasi"==t?d(L,r):";"!=t?"("==t?F(S,")","call",r):"."==t?p(P,r):"["==t?p(y("]"),k,x("]"),b,r):void 0:void 0}function L(t,e){return"quasi"!=t?d():"${"!=e.slice(e.length-2)?p(L):p(C,A)}function A(t){if("}"==t){De.marked="string-2";De.state.tokenize=l;return p(L)}}function N(t){u(De.stream,De.state);return d("{"==t?w:C)}function E(t){u(De.stream,De.state);return d("{"==t?w:S)}function j(t){return":"==t?p(b,w):d(M,x(";"),b)}function P(t){if("variable"==t){De.marked="property";return p()}}function I(t,e){if("variable"==t||"keyword"==De.style){De.marked="property";return p("get"==e||"set"==e?H:O)}if("number"==t||"string"==t){De.marked=be?"property":De.style+" property";return p(O)}return"jsonld-keyword"==t?p(O):"["==t?p(C,x("]"),O):void 0}function H(t){if("variable"!=t)return d(O);De.marked="property";return p(te)}function O(t){return":"==t?p(S):"("==t?d(te):void 0}function R(t,e){function n(r){if(","==r){var i=De.state.lexical;"call"==i.info&&(i.pos=(i.pos||0)+1);return p(t,n)}return r==e?p():p(x(e))}return function(r){return r==e?p():d(t,n)}}function F(t,e,n){for(var r=3;r<arguments.length;r++)De.cc.push(arguments[r]);return p(y(e,n),R(t,e),b)}function W(t){return"}"==t?p():d(w,W)}function z(t){return we&&":"==t?p(q):void 0}function q(t){if("variable"==t){De.marked="variable-3";return p()}}function U(){return d(B,z,X,G)}function B(t,e){if("variable"==t){g(e);return p()}return"["==t?F(B,"]"):"{"==t?F(V,"}"):void 0}function V(t,e){if("variable"==t&&!De.stream.match(/^\s*:/,!1)){g(e);return p(X)}"variable"==t&&(De.marked="property");return p(x(":"),B,X)}function X(t,e){return"="==e?p(S):void 0}function G(t){return","==t?p(U):void 0}function $(t,e){return"keyword b"==t&&"else"==e?p(y("form","else"),w,b):void 0}function Y(t){return"("==t?p(y(")"),J,x(")"),b):void 0}function J(t){return"var"==t?p(U,x(";"),Z):";"==t?p(Z):"variable"==t?p(K):d(C,x(";"),Z)}function K(t,e){if("in"==e||"of"==e){De.marked="keyword";return p(C)}return p(M,Z)}function Z(t,e){if(";"==t)return p(Q);if("in"==e||"of"==e){De.marked="keyword";return p(C)}return d(C,x(";"),Q)}function Q(t){")"!=t&&p(C)}function te(t,e){if("*"==e){De.marked="keyword";return p(te)}if("variable"==t){g(e);return p(te)}return"("==t?p(m,y(")"),R(ee,")"),b,w,v):void 0}function ee(t){return"spread"==t?p(ee):d(B,z)}function ne(t,e){if("variable"==t){g(e);return p(re)}}function re(t,e){return"extends"==e?p(C,re):"{"==t?p(y("}"),ie,b):void 0}function ie(t,e){if("variable"==t||"keyword"==De.style){De.marked="property";return"get"==e||"set"==e?p(oe,te,ie):p(te,ie)}if("*"==e){De.marked="keyword";return p(ie)}return";"==t?p(ie):"}"==t?p():void 0}function oe(t){if("variable"!=t)return d();De.marked="property";return p()}function ae(t,e){if("string"==t)return p(w);if("variable"==t){g(e);return p(ce)}}function se(t,e){if("*"==e){De.marked="keyword";return p(ce,x(";"))}if("default"==e){De.marked="keyword";return p(C,x(";"))}return d(w)}function le(t){return"string"==t?p():d(ue,ce)}function ue(t,e){if("{"==t)return F(ue,"}");"variable"==t&&g(e);return p()}function ce(t,e){if("from"==e){De.marked="keyword";return p(C)}}function fe(t){return"]"==t?p():d(S,he)}function he(t){return"for"==t?d(de,x("]")):","==t?p(R(_,"]")):d(R(S,"]"))}function de(t){return"for"==t?p(Y,de):"if"==t?p(C,de):void 0}function pe(t,e){return"operator"==t.lastType||","==t.lastType||Te.test(e.charAt(0))||/[,.]/.test(e.charAt(0))}var ge,me,ve=e.indentUnit,ye=n.statementIndent,be=n.jsonld,xe=n.json||be,we=n.typescript,Ce=n.wordCharacters||/[\w$\xa1-\uffff]/,Se=function(){function t(t){return{type:t,style:"keyword"}}var e=t("keyword a"),n=t("keyword b"),r=t("keyword c"),i=t("operator"),o={type:"atom",style:"atom"},a={"if":t("if"),"while":e,"with":e,"else":n,"do":n,"try":n,"finally":n,"return":r,"break":r,"continue":r,"new":r,"delete":r,"throw":r,"debugger":r,"var":t("var"),"const":t("var"),let:t("var"),"function":t("function"),"catch":t("catch"),"for":t("for"),"switch":t("switch"),"case":t("case"),"default":t("default"),"in":i,"typeof":i,"instanceof":i,"true":o,"false":o,"null":o,undefined:o,NaN:o,Infinity:o,"this":t("this"),module:t("module"),"class":t("class"),"super":t("atom"),"yield":r,"export":t("export"),"import":t("import"),"extends":r};if(we){var s={type:"variable",style:"variable-3"},l={"interface":t("interface"),"extends":t("extends"),constructor:t("constructor"),"public":t("public"),"private":t("private"),"protected":t("protected"),"static":t("static"),string:s,number:s,bool:s,any:s};for(var u in l)a[u]=l[u]}return a}(),Te=/[+\-*&%=<>!?|~^]/,ke=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,_e="([{}])",Me={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},De={state:null,column:null,marked:null,cc:null},Le={name:"this",next:{name:"arguments"}};b.lex=!0;return{startState:function(t){var e={tokenize:o,lastType:"sof",cc:[],lexical:new c((t||0)-ve,0,"block",!1),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:0};n.globalVars&&"object"==typeof n.globalVars&&(e.globalVars=n.globalVars);return e},token:function(t,e){if(t.sol()){e.lexical.hasOwnProperty("align")||(e.lexical.align=!1);e.indented=t.indentation();
u(t,e)}if(e.tokenize!=s&&t.eatSpace())return null;var n=e.tokenize(t,e);if("comment"==ge)return n;e.lastType="operator"!=ge||"++"!=me&&"--"!=me?ge:"incdec";return h(e,n,ge,me,t)},indent:function(e,r){if(e.tokenize==s)return t.Pass;if(e.tokenize!=o)return 0;var i=r&&r.charAt(0),a=e.lexical;if(!/^\s*else\b/.test(r))for(var l=e.cc.length-1;l>=0;--l){var u=e.cc[l];if(u==b)a=a.prev;else if(u!=$)break}"stat"==a.type&&"}"==i&&(a=a.prev);ye&&")"==a.type&&"stat"==a.prev.type&&(a=a.prev);var c=a.type,f=i==c;return"vardef"==c?a.indented+("operator"==e.lastType||","==e.lastType?a.info+1:0):"form"==c&&"{"==i?a.indented:"form"==c?a.indented+ve:"stat"==c?a.indented+(pe(e,r)?ye||ve:0):"switch"!=a.info||f||0==n.doubleIndentSwitch?a.align?a.column+(f?0:1):a.indented+(f?0:ve):a.indented+(/^(?:case|default)\b/.test(r)?ve:2*ve)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:xe?null:"/*",blockCommentEnd:xe?null:"*/",lineComment:xe?null:"//",fold:"brace",helperType:xe?"json":"javascript",jsonldMode:be,jsonMode:xe}});t.registerHelper("wordChars","javascript",/[\w$]/);t.defineMIME("text/javascript","javascript");t.defineMIME("text/ecmascript","javascript");t.defineMIME("application/javascript","javascript");t.defineMIME("application/x-javascript","javascript");t.defineMIME("application/ecmascript","javascript");t.defineMIME("application/json",{name:"javascript",json:!0});t.defineMIME("application/x-json",{name:"javascript",json:!0});t.defineMIME("application/ld+json",{name:"javascript",jsonld:!0});t.defineMIME("text/typescript",{name:"javascript",typescript:!0});t.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},{"../../lib/codemirror":11}],13:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)})(function(t){"use strict";t.defineMode("xml",function(e,n){function r(t,e){function n(n){e.tokenize=n;return n(t,e)}var r=t.next();if("<"==r){if(t.eat("!")){if(t.eat("["))return t.match("CDATA[")?n(a("atom","]]>")):null;if(t.match("--"))return n(a("comment","-->"));if(t.match("DOCTYPE",!0,!0)){t.eatWhile(/[\w\._\-]/);return n(s(1))}return null}if(t.eat("?")){t.eatWhile(/[\w\._\-]/);e.tokenize=a("meta","?>");return"meta"}S=t.eat("/")?"closeTag":"openTag";e.tokenize=i;return"tag bracket"}if("&"==r){var o;o=t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";");return o?"atom":"error"}t.eatWhile(/[^&<]/);return null}function i(t,e){var n=t.next();if(">"==n||"/"==n&&t.eat(">")){e.tokenize=r;S=">"==n?"endTag":"selfcloseTag";return"tag bracket"}if("="==n){S="equals";return null}if("<"==n){e.tokenize=r;e.state=f;e.tagName=e.tagStart=null;var i=e.tokenize(t,e);return i?i+" tag error":"tag error"}if(/[\'\"]/.test(n)){e.tokenize=o(n);e.stringStartCol=t.column();return e.tokenize(t,e)}t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);return"word"}function o(t){var e=function(e,n){for(;!e.eol();)if(e.next()==t){n.tokenize=i;break}return"string"};e.isInAttribute=!0;return e}function a(t,e){return function(n,i){for(;!n.eol();){if(n.match(e)){i.tokenize=r;break}n.next()}return t}}function s(t){return function(e,n){for(var i;null!=(i=e.next());){if("<"==i){n.tokenize=s(t+1);return n.tokenize(e,n)}if(">"==i){if(1==t){n.tokenize=r;break}n.tokenize=s(t-1);return n.tokenize(e,n)}}return"meta"}}function l(t,e,n){this.prev=t.context;this.tagName=e;this.indent=t.indented;this.startOfLine=n;(k.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function u(t){t.context&&(t.context=t.context.prev)}function c(t,e){for(var n;;){if(!t.context)return;n=t.context.tagName;if(!k.contextGrabbers.hasOwnProperty(n)||!k.contextGrabbers[n].hasOwnProperty(e))return;u(t)}}function f(t,e,n){if("openTag"==t){n.tagStart=e.column();return h}return"closeTag"==t?d:f}function h(t,e,n){if("word"==t){n.tagName=e.current();T="tag";return m}T="error";return h}function d(t,e,n){if("word"==t){var r=e.current();n.context&&n.context.tagName!=r&&k.implicitlyClosed.hasOwnProperty(n.context.tagName)&&u(n);if(n.context&&n.context.tagName==r){T="tag";return p}T="tag error";return g}T="error";return g}function p(t,e,n){if("endTag"!=t){T="error";return p}u(n);return f}function g(t,e,n){T="error";return p(t,e,n)}function m(t,e,n){if("word"==t){T="attribute";return v}if("endTag"==t||"selfcloseTag"==t){var r=n.tagName,i=n.tagStart;n.tagName=n.tagStart=null;if("selfcloseTag"==t||k.autoSelfClosers.hasOwnProperty(r))c(n,r);else{c(n,r);n.context=new l(n,r,i==n.indented)}return f}T="error";return m}function v(t,e,n){if("equals"==t)return y;k.allowMissing||(T="error");return m(t,e,n)}function y(t,e,n){if("string"==t)return b;if("word"==t&&k.allowUnquoted){T="string";return m}T="error";return m(t,e,n)}function b(t,e,n){return"string"==t?b:m(t,e,n)}var x=e.indentUnit,w=n.multilineTagIndentFactor||1,C=n.multilineTagIndentPastTag;null==C&&(C=!0);var S,T,k=n.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1},_=n.alignCDATA;return{startState:function(){return{tokenize:r,state:f,indented:0,tagName:null,tagStart:null,context:null}},token:function(t,e){!e.tagName&&t.sol()&&(e.indented=t.indentation());if(t.eatSpace())return null;S=null;var n=e.tokenize(t,e);if((n||S)&&"comment"!=n){T=null;e.state=e.state(S||n,t,e);T&&(n="error"==T?n+" error":T)}return n},indent:function(e,n,o){var a=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+x;if(a&&a.noIndent)return t.Pass;if(e.tokenize!=i&&e.tokenize!=r)return o?o.match(/^(\s*)/)[0].length:0;if(e.tagName)return C?e.tagStart+e.tagName.length+2:e.tagStart+x*w;if(_&&/<!\[CDATA\[/.test(n))return 0;var s=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(s&&s[1])for(;a;){if(a.tagName==s[2]){a=a.prev;break}if(!k.implicitlyClosed.hasOwnProperty(a.tagName))break;a=a.prev}else if(s)for(;a;){var l=k.contextGrabbers[a.tagName];if(!l||!l.hasOwnProperty(s[2]))break;a=a.prev}for(;a&&!a.startOfLine;)a=a.prev;return a?a.indent+x:0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:n.htmlMode?"html":"xml",helperType:n.htmlMode?"html":"xml"}});t.defineMIME("text/xml","xml");t.defineMIME("application/xml","xml");t.mimeModes.hasOwnProperty("text/html")||t.defineMIME("text/html",{name:"xml",htmlMode:!0})})},{"../../lib/codemirror":11}],14:[function(e,n){!function(){function e(t){return t&&(t.ownerDocument||t.document||t).documentElement}function r(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function i(t,e){return e>t?-1:t>e?1:t>=e?0:0/0}function o(t){return null===t?0/0:+t}function a(t){return!isNaN(t)}function s(t){return{left:function(e,n,r,i){arguments.length<3&&(r=0);arguments.length<4&&(i=e.length);for(;i>r;){var o=r+i>>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){arguments.length<3&&(r=0);arguments.length<4&&(i=e.length);for(;i>r;){var o=r+i>>>1;t(e[o],n)>0?i=o:r=o+1}return r}}}function l(t){return t.length}function u(t){for(var e=1;t*e%1;)e*=10;return e}function c(t,e){for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}function f(){this._=Object.create(null)}function h(t){return(t+="")===vs||t[0]===ys?ys+t:t}function d(t){return(t+="")[0]===ys?t.slice(1):t}function p(t){return h(t)in this._}function g(t){return(t=h(t))in this._&&delete this._[t]}function m(){var t=[];for(var e in this._)t.push(d(e));return t}function v(){var t=0;for(var e in this._)++t;return t}function y(){for(var t in this._)return!1;return!0}function b(){this._=Object.create(null)}function x(t){return t}function w(t,e,n){return function(){var r=n.apply(e,arguments);return r===e?t:r}}function C(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var n=0,r=bs.length;r>n;++n){var i=bs[n]+e;if(i in t)return i}}function S(){}function T(){}function k(t){function e(){for(var e,r=n,i=-1,o=r.length;++i<o;)(e=r[i].on)&&e.apply(this,arguments);return t}var n=[],r=new f;e.on=function(e,i){var o,a=r.get(e);if(arguments.length<2)return a&&a.on;if(a){a.on=null;n=n.slice(0,o=n.indexOf(a)).concat(n.slice(o+1));r.remove(e)}i&&n.push(r.set(e,{on:i}));return t};return e}function _(){is.event.preventDefault()}function M(){for(var t,e=is.event;t=e.sourceEvent;)e=t;return e}function D(t){for(var e=new T,n=0,r=arguments.length;++n<r;)e[arguments[n]]=k(e);e.of=function(n,r){return function(i){try{var o=i.sourceEvent=is.event;i.target=t;is.event=i;e[i.type].apply(n,r)}finally{is.event=o}}};return e}function L(t){ws(t,ks);return t}function A(t){return"function"==typeof t?t:function(){return Cs(t,this)}}function N(t){return"function"==typeof t?t:function(){return Ss(t,this)}}function E(t,e){function n(){this.removeAttribute(t)}function r(){this.removeAttributeNS(t.space,t.local)}function i(){this.setAttribute(t,e)}function o(){this.setAttributeNS(t.space,t.local,e)}function a(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}function s(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}t=is.ns.qualify(t);return null==e?t.local?r:n:"function"==typeof e?t.local?s:a:t.local?o:i}function j(t){return t.trim().replace(/\s+/g," ")}function P(t){return new RegExp("(?:^|\\s+)"+is.requote(t)+"(?:\\s+|$)","g")}function I(t){return(t+"").trim().split(/^|\s+/)}function H(t,e){function n(){for(var n=-1;++n<i;)t[n](this,e)}function r(){for(var n=-1,r=e.apply(this,arguments);++n<i;)t[n](this,r)}t=I(t).map(O);var i=t.length;return"function"==typeof e?r:n}function O(t){var e=P(t);return function(n,r){if(i=n.classList)return r?i.add(t):i.remove(t);var i=n.getAttribute("class")||"";if(r){e.lastIndex=0;e.test(i)||n.setAttribute("class",j(i+" "+t))}else n.setAttribute("class",j(i.replace(e," ")))}}function R(t,e,n){function r(){this.style.removeProperty(t)}function i(){this.style.setProperty(t,e,n)}function o(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}return null==e?r:"function"==typeof e?o:i}function F(t,e){function n(){delete this[t]}function r(){this[t]=e}function i(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}return null==e?n:"function"==typeof e?i:r}function W(t){function e(){var e=this.ownerDocument,n=this.namespaceURI;return n?e.createElementNS(n,t):e.createElement(t)}function n(){return this.ownerDocument.createElementNS(t.space,t.local)}return"function"==typeof t?t:(t=is.ns.qualify(t)).local?n:e}function z(){var t=this.parentNode;t&&t.removeChild(this)}function q(t){return{__data__:t}}function U(t){return function(){return Ts(this,t)}}function B(t){arguments.length||(t=i);return function(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}}function V(t,e){for(var n=0,r=t.length;r>n;n++)for(var i,o=t[n],a=0,s=o.length;s>a;a++)(i=o[a])&&e(i,a,n);return t}function X(t){ws(t,Ms);return t}function G(t){var e,n;return function(r,i,o){var a,s=t[o].update,l=s.length;o!=n&&(n=o,e=0);i>=e&&(e=i+1);for(;!(a=s[e])&&++e<l;);return a}}function $(t,e,n){function r(){var e=this[a];if(e){this.removeEventListener(t,e,e.$);delete this[a]}}function i(){var i=l(e,as(arguments));r.call(this);this.addEventListener(t,this[a]=i,i.$=n);i._=e}function o(){var e,n=new RegExp("^__on([^.]+)"+is.requote(t)+"$");for(var r in this)if(e=r.match(n)){var i=this[r];this.removeEventListener(e[1],i,i.$);delete this[r]}}var a="__on"+t,s=t.indexOf("."),l=Y;s>0&&(t=t.slice(0,s));var u=Ds.get(t);u&&(t=u,l=J);return s?e?i:r:e?S:o}function Y(t,e){return function(n){var r=is.event;is.event=n;e[0]=this.__data__;try{t.apply(this,e)}finally{is.event=r}}}function J(t,e){var n=Y(t,e);return function(t){var e=this,r=t.relatedTarget;r&&(r===e||8&r.compareDocumentPosition(e))||n.call(e,t)}}function K(t){var n=".dragsuppress-"+ ++As,i="click"+n,o=is.select(r(t)).on("touchmove"+n,_).on("dragstart"+n,_).on("selectstart"+n,_);null==Ls&&(Ls="onselectstart"in t?!1:C(t.style,"userSelect"));if(Ls){var a=e(t).style,s=a[Ls];a[Ls]="none"}return function(t){o.on(n,null);Ls&&(a[Ls]=s);if(t){var e=function(){o.on(i,null)};o.on(i,function(){_();e()},!0);setTimeout(e,0)}}}function Z(t,e){e.changedTouches&&(e=e.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();if(0>Ns){var o=r(t);if(o.scrollX||o.scrollY){n=is.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var a=n[0][0].getScreenCTM();Ns=!(a.f||a.e);n.remove()}}Ns?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY);i=i.matrixTransform(t.getScreenCTM().inverse());return[i.x,i.y]}var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}function Q(){return is.event.changedTouches[0].identifier}function te(t){return t>0?1:0>t?-1:0}function ee(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function ne(t){return t>1?0:-1>t?Ps:Math.acos(t)}function re(t){return t>1?Os:-1>t?-Os:Math.asin(t)}function ie(t){return((t=Math.exp(t))-1/t)/2}function oe(t){return((t=Math.exp(t))+1/t)/2}function ae(t){return((t=Math.exp(2*t))-1)/(t+1)}function se(t){return(t=Math.sin(t/2))*t}function le(){}function ue(t,e,n){return this instanceof ue?void(this.h=+t,this.s=+e,this.l=+n):arguments.length<2?t instanceof ue?new ue(t.h,t.s,t.l):Se(""+t,Te,ue):new ue(t,e,n)}function ce(t,e,n){function r(t){t>360?t-=360:0>t&&(t+=360);return 60>t?o+(a-o)*t/60:180>t?a:240>t?o+(a-o)*(240-t)/60:o}function i(t){return Math.round(255*r(t))}var o,a;t=isNaN(t)?0:(t%=360)<0?t+360:t;e=isNaN(e)?0:0>e?0:e>1?1:e;n=0>n?0:n>1?1:n;a=.5>=n?n*(1+e):n+e-n*e;o=2*n-a;return new be(i(t+120),i(t),i(t-120))}function fe(t,e,n){return this instanceof fe?void(this.h=+t,this.c=+e,this.l=+n):arguments.length<2?t instanceof fe?new fe(t.h,t.c,t.l):t instanceof de?ge(t.l,t.a,t.b):ge((t=ke((t=is.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new fe(t,e,n)}function he(t,e,n){isNaN(t)&&(t=0);isNaN(e)&&(e=0);return new de(n,Math.cos(t*=Rs)*e,Math.sin(t)*e)}function de(t,e,n){return this instanceof de?void(this.l=+t,this.a=+e,this.b=+n):arguments.length<2?t instanceof de?new de(t.l,t.a,t.b):t instanceof fe?he(t.h,t.c,t.l):ke((t=be(t)).r,t.g,t.b):new de(t,e,n)}function pe(t,e,n){var r=(t+16)/116,i=r+e/500,o=r-n/200;i=me(i)*Ys;r=me(r)*Js;o=me(o)*Ks;return new be(ye(3.2404542*i-1.5371385*r-.4985314*o),ye(-.969266*i+1.8760108*r+.041556*o),ye(.0556434*i-.2040259*r+1.0572252*o))}function ge(t,e,n){return t>0?new fe(Math.atan2(n,e)*Fs,Math.sqrt(e*e+n*n),t):new fe(0/0,0/0,t)}function me(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ve(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ye(t){return Math.round(255*(.00304>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function be(t,e,n){return this instanceof be?void(this.r=~~t,this.g=~~e,this.b=~~n):arguments.length<2?t instanceof be?new be(t.r,t.g,t.b):Se(""+t,be,ce):new be(t,e,n)}function xe(t){return new be(t>>16,t>>8&255,255&t)}function we(t){return xe(t)+""}function Ce(t){return 16>t?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function Se(t,e,n){var r,i,o,a=0,s=0,l=0;r=/([a-z]+)\((.*)\)/i.exec(t);if(r){i=r[2].split(",");switch(r[1]){case"hsl":return n(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(Me(i[0]),Me(i[1]),Me(i[2]))}}if(o=tl.get(t.toLowerCase()))return e(o.r,o.g,o.b);if(null!=t&&"#"===t.charAt(0)&&!isNaN(o=parseInt(t.slice(1),16)))if(4===t.length){a=(3840&o)>>4;a=a>>4|a;s=240&o;s=s>>4|s;l=15&o;l=l<<4|l}else if(7===t.length){a=(16711680&o)>>16;s=(65280&o)>>8;l=255&o}return e(a,s,l)}function Te(t,e,n){var r,i,o=Math.min(t/=255,e/=255,n/=255),a=Math.max(t,e,n),s=a-o,l=(a+o)/2;if(s){i=.5>l?s/(a+o):s/(2-a-o);r=t==a?(e-n)/s+(n>e?6:0):e==a?(n-t)/s+2:(t-e)/s+4;r*=60}else{r=0/0;i=l>0&&1>l?0:r}return new ue(r,i,l)}function ke(t,e,n){t=_e(t);e=_e(e);n=_e(n);var r=ve((.4124564*t+.3575761*e+.1804375*n)/Ys),i=ve((.2126729*t+.7151522*e+.072175*n)/Js),o=ve((.0193339*t+.119192*e+.9503041*n)/Ks);return de(116*i-16,500*(r-i),200*(i-o))}function _e(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Me(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function De(t){return"function"==typeof t?t:function(){return t}}function Le(t){return function(e,n,r){2===arguments.length&&"function"==typeof n&&(r=n,n=null);return Ae(e,n,t,r)}}function Ae(t,e,n,r){function i(){var t,e=l.status;if(!e&&Ee(l)||e>=200&&300>e||304===e){try{t=n.call(o,l)}catch(r){a.error.call(o,r);return}a.load.call(o,t)}else a.error.call(o,l)}var o={},a=is.dispatch("beforesend","progress","load","error"),s={},l=new XMLHttpRequest,u=null;!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest);"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()};l.onprogress=function(t){var e=is.event;is.event=t;try{a.progress.call(o,l)}finally{is.event=e}};o.header=function(t,e){t=(t+"").toLowerCase();if(arguments.length<2)return s[t];null==e?delete s[t]:s[t]=e+"";return o};o.mimeType=function(t){if(!arguments.length)return e;e=null==t?null:t+"";return o};o.responseType=function(t){if(!arguments.length)return u;u=t;return o};o.response=function(t){n=t;return o};["get","post"].forEach(function(t){o[t]=function(){return o.send.apply(o,[t].concat(as(arguments)))}});o.send=function(n,r,i){2===arguments.length&&"function"==typeof r&&(i=r,r=null);l.open(n,t,!0);null==e||"accept"in s||(s.accept=e+",*/*");if(l.setRequestHeader)for(var c in s)l.setRequestHeader(c,s[c]);null!=e&&l.overrideMimeType&&l.overrideMimeType(e);null!=u&&(l.responseType=u);null!=i&&o.on("error",i).on("load",function(t){i(null,t)});a.beforesend.call(o,l);l.send(null==r?null:r);return o};o.abort=function(){l.abort();return o};is.rebind(o,a,"on");return null==r?o:o.get(Ne(r))}function Ne(t){return 1===t.length?function(e,n){t(null==e?n:null)}:t}function Ee(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function je(){var t=Pe(),e=Ie()-t;if(e>24){if(isFinite(e)){clearTimeout(il);il=setTimeout(je,e)}rl=0}else{rl=1;al(je)}}function Pe(){var t=Date.now();ol=el;for(;ol;){t>=ol.t&&(ol.f=ol.c(t-ol.t));ol=ol.n}return t}function Ie(){for(var t,e=el,n=1/0;e;)if(e.f)e=t?t.n=e.n:el=e.n;else{e.t<n&&(n=e.t);e=(t=e).n}nl=t;return n}function He(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function Oe(t,e){var n=Math.pow(10,3*ms(8-e));return{scale:e>8?function(t){return t/n}:function(t){return t*n},symbol:t}}function Re(t){var e=t.decimal,n=t.thousands,r=t.grouping,i=t.currency,o=r&&n?function(t,e){for(var i=t.length,o=[],a=0,s=r[0],l=0;i>0&&s>0;){l+s+1>e&&(s=Math.max(1,e-l));o.push(t.substring(i-=s,i+s));if((l+=s+1)>e)break;s=r[a=(a+1)%r.length]}return o.reverse().join(n)}:x;return function(t){var n=ll.exec(t),r=n[1]||" ",a=n[2]||">",s=n[3]||"-",l=n[4]||"",u=n[5],c=+n[6],f=n[7],h=n[8],d=n[9],p=1,g="",m="",v=!1,y=!0;h&&(h=+h.substring(1));if(u||"0"===r&&"="===a){u=r="0";a="="}switch(d){case"n":f=!0;d="g";break;case"%":p=100;m="%";d="f";break;case"p":p=100;m="%";d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(g="0"+d.toLowerCase());case"c":y=!1;case"d":v=!0;h=0;break;case"s":p=-1;d="r"}"$"===l&&(g=i[0],m=i[1]);"r"!=d||h||(d="g");null!=h&&("g"==d?h=Math.max(1,Math.min(21,h)):("e"==d||"f"==d)&&(h=Math.max(0,Math.min(20,h))));d=ul.get(d)||Fe;var b=u&&f;return function(t){var n=m;if(v&&t%1)return"";var i=0>t||0===t&&0>1/t?(t=-t,"-"):"-"===s?"":s;if(0>p){var l=is.formatPrefix(t,h);t=l.scale(t);n=l.symbol+m}else t*=p;t=d(t,h);var x,w,C=t.lastIndexOf(".");if(0>C){var S=y?t.lastIndexOf("e"):-1;0>S?(x=t,w=""):(x=t.substring(0,S),w=t.substring(S))}else{x=t.substring(0,C);w=e+t.substring(C+1)}!u&&f&&(x=o(x,1/0));var T=g.length+x.length+w.length+(b?0:i.length),k=c>T?new Array(T=c-T+1).join(r):"";b&&(x=o(k+x,k.length?c-w.length:1/0));i+=g;t=x+w;return("<"===a?i+t+k:">"===a?k+i+t:"^"===a?k.substring(0,T>>=1)+i+t+k.substring(T):i+(b?t:k+t))+n}}}function Fe(t){return t+""}function We(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function ze(t,e,n){function r(e){var n=t(e),r=o(n,1);return r-e>e-n?n:r}function i(n){e(n=t(new fl(n-1)),1);return n}function o(t,n){e(t=new fl(+t),n);return t}function a(t,r,o){var a=i(t),s=[];if(o>1)for(;r>a;){n(a)%o||s.push(new Date(+a));e(a,1)}else for(;r>a;)s.push(new Date(+a)),e(a,1);return s}function s(t,e,n){try{fl=We;var r=new We;r._=t;return a(r,e,n)}finally{fl=Date}}t.floor=t;t.round=r;t.ceil=i;t.offset=o;t.range=a;var l=t.utc=qe(t);l.floor=l;l.round=qe(r);l.ceil=qe(i);l.offset=qe(o);l.range=s;return t}function qe(t){return function(e,n){try{fl=We;var r=new We;r._=e;return t(r,n)._}finally{fl=Date}}}function Ue(t){function e(t){function e(e){for(var n,i,o,a=[],s=-1,l=0;++s<r;)if(37===t.charCodeAt(s)){a.push(t.slice(l,s));null!=(i=dl[n=t.charAt(++s)])&&(n=t.charAt(++s));(o=D[n])&&(n=o(e,null==i?"e"===n?" ":"0":i));a.push(n);l=s+1}a.push(t.slice(l,s));return a.join("")}var r=t.length;e.parse=function(e){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},i=n(r,t,e,0);if(i!=e.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var o=null!=r.Z&&fl!==We,a=new(o?We:fl);if("j"in r)a.setFullYear(r.y,0,r.j);else if("w"in r&&("W"in r||"U"in r)){a.setFullYear(r.y,0,1);a.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(a.getDay()+5)%7:r.w+7*r.U-(a.getDay()+6)%7)}else a.setFullYear(r.y,r.m,r.d);a.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L);return o?a._:a};e.toString=function(){return t};return e}function n(t,e,n,r){for(var i,o,a,s=0,l=e.length,u=n.length;l>s;){if(r>=u)return-1;i=e.charCodeAt(s++);if(37===i){a=e.charAt(s++);o=L[a in dl?e.charAt(s++):a];if(!o||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}function r(t,e,n){C.lastIndex=0;var r=C.exec(e.slice(n));return r?(t.w=S.get(r[0].toLowerCase()),n+r[0].length):-1}function i(t,e,n){x.lastIndex=0;var r=x.exec(e.slice(n));return r?(t.w=w.get(r[0].toLowerCase()),n+r[0].length):-1}function o(t,e,n){_.lastIndex=0;var r=_.exec(e.slice(n));return r?(t.m=M.get(r[0].toLowerCase()),n+r[0].length):-1}function a(t,e,n){T.lastIndex=0;var r=T.exec(e.slice(n));return r?(t.m=k.get(r[0].toLowerCase()),n+r[0].length):-1}function s(t,e,r){return n(t,D.c.toString(),e,r)}function l(t,e,r){return n(t,D.x.toString(),e,r)}function u(t,e,r){return n(t,D.X.toString(),e,r)}function c(t,e,n){var r=b.get(e.slice(n,n+=2).toLowerCase());return null==r?-1:(t.p=r,n)}var f=t.dateTime,h=t.date,d=t.time,p=t.periods,g=t.days,m=t.shortDays,v=t.months,y=t.shortMonths;e.utc=function(t){function n(t){try{fl=We;var e=new fl;e._=t;return r(e)}finally{fl=Date}}var r=e(t);n.parse=function(t){try{fl=We;var e=r.parse(t);return e&&e._}finally{fl=Date}};n.toString=r.toString;return n};e.multi=e.utc.multi=cn;var b=is.map(),x=Ve(g),w=Xe(g),C=Ve(m),S=Xe(m),T=Ve(v),k=Xe(v),_=Ve(y),M=Xe(y);p.forEach(function(t,e){b.set(t.toLowerCase(),e)});var D={a:function(t){return m[t.getDay()]},A:function(t){return g[t.getDay()]},b:function(t){return y[t.getMonth()]},B:function(t){return v[t.getMonth()]},c:e(f),d:function(t,e){return Be(t.getDate(),e,2)},e:function(t,e){return Be(t.getDate(),e,2)},H:function(t,e){return Be(t.getHours(),e,2)},I:function(t,e){return Be(t.getHours()%12||12,e,2)},j:function(t,e){return Be(1+cl.dayOfYear(t),e,3)},L:function(t,e){return Be(t.getMilliseconds(),e,3)},m:function(t,e){return Be(t.getMonth()+1,e,2)},M:function(t,e){return Be(t.getMinutes(),e,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,e){return Be(t.getSeconds(),e,2)},U:function(t,e){return Be(cl.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Be(cl.mondayOfYear(t),e,2)},x:e(h),X:e(d),y:function(t,e){return Be(t.getFullYear()%100,e,2)},Y:function(t,e){return Be(t.getFullYear()%1e4,e,4)},Z:ln,"%":function(){return"%"}},L={a:r,A:i,b:o,B:a,c:s,d:en,e:en,H:rn,I:rn,j:nn,L:sn,m:tn,M:on,p:c,S:an,U:$e,w:Ge,W:Ye,x:l,X:u,y:Ke,Y:Je,Z:Ze,"%":un};return e}function Be(t,e,n){var r=0>t?"-":"",i=(r?-t:t)+"",o=i.length;return r+(n>o?new Array(n-o+1).join(e)+i:i)}function Ve(t){return new RegExp("^(?:"+t.map(is.requote).join("|")+")","i")}function Xe(t){for(var e=new f,n=-1,r=t.length;++n<r;)e.set(t[n].toLowerCase(),n);return e}function Ge(t,e,n){pl.lastIndex=0;var r=pl.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function $e(t,e,n){pl.lastIndex=0;var r=pl.exec(e.slice(n));return r?(t.U=+r[0],n+r[0].length):-1}function Ye(t,e,n){pl.lastIndex=0;var r=pl.exec(e.slice(n));return r?(t.W=+r[0],n+r[0].length):-1}function Je(t,e,n){pl.lastIndex=0;var r=pl.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Ke(t,e,n){pl.lastIndex=0;var r=pl.exec(e.slice(n,n+2));return r?(t.y=Qe(+r[0]),n+r[0].length):-1}function Ze(t,e,n){return/^[+-]\d{4}$/.test(e=e.slice(n,n+5))?(t.Z=-e,n+5):-1}function Qe(t){return t+(t>68?1900:2e3)}function tn(t,e,n){pl.lastIndex=0;var r=pl.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function en(t,e,n){pl.lastIndex=0;var r=pl.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function nn(t,e,n){pl.lastIndex=0;var r=pl.exec(e.slice(n,n+3));return r?(t.j=+r[0],n+r[0].length):-1}function rn(t,e,n){pl.lastIndex=0;var r=pl.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function on(t,e,n){pl.lastIndex=0;var r=pl.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function an(t,e,n){pl.lastIndex=0;var r=pl.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function sn(t,e,n){pl.lastIndex=0;var r=pl.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function ln(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",r=ms(e)/60|0,i=ms(e)%60;return n+Be(r,"0",2)+Be(i,"0",2)}function un(t,e,n){gl.lastIndex=0;var r=gl.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function cn(t){for(var e=t.length,n=-1;++n<e;)t[n][0]=this(t[n][0]);return function(e){for(var n=0,r=t[n];!r[1](e);)r=t[++n];return r[0](e)}}function fn(){}function hn(t,e,n){var r=n.s=t+e,i=r-t,o=r-i;n.t=t-o+(e-i)}function dn(t,e){t&&bl.hasOwnProperty(t.type)&&bl[t.type](t,e)}function pn(t,e,n){var r,i=-1,o=t.length-n;e.lineStart();for(;++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function gn(t,e){var n=-1,r=t.length;e.polygonStart();for(;++n<r;)pn(t[n],e,1);e.polygonEnd()}function mn(){function t(t,e){t*=Rs;e=e*Rs/2+Ps/4;var n=t-r,a=n>=0?1:-1,s=a*n,l=Math.cos(e),u=Math.sin(e),c=o*u,f=i*l+c*Math.cos(s),h=c*a*Math.sin(s);wl.add(Math.atan2(h,f));r=t,i=l,o=u}var e,n,r,i,o;Cl.point=function(a,s){Cl.point=t;r=(e=a)*Rs,i=Math.cos(s=(n=s)*Rs/2+Ps/4),o=Math.sin(s)};Cl.lineEnd=function(){t(e,n)}}function vn(t){var e=t[0],n=t[1],r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}function yn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function bn(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function xn(t,e){t[0]+=e[0];t[1]+=e[1];t[2]+=e[2]}function wn(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Cn(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e;t[1]/=e;t[2]/=e}function Sn(t){return[Math.atan2(t[1],t[0]),re(t[2])]}function Tn(t,e){return ms(t[0]-e[0])<Es&&ms(t[1]-e[1])<Es}function kn(t,e){t*=Rs;var n=Math.cos(e*=Rs);_n(n*Math.cos(t),n*Math.sin(t),Math.sin(e))}function _n(t,e,n){++Sl;kl+=(t-kl)/Sl;_l+=(e-_l)/Sl;Ml+=(n-Ml)/Sl}function Mn(){function t(t,i){t*=Rs;var o=Math.cos(i*=Rs),a=o*Math.cos(t),s=o*Math.sin(t),l=Math.sin(i),u=Math.atan2(Math.sqrt((u=n*l-r*s)*u+(u=r*a-e*l)*u+(u=e*s-n*a)*u),e*a+n*s+r*l);Tl+=u;Dl+=u*(e+(e=a));Ll+=u*(n+(n=s));Al+=u*(r+(r=l));_n(e,n,r)}var e,n,r;Pl.point=function(i,o){i*=Rs;var a=Math.cos(o*=Rs);e=a*Math.cos(i);n=a*Math.sin(i);r=Math.sin(o);Pl.point=t;_n(e,n,r)}}function Dn(){Pl.point=kn}function Ln(){function t(t,e){t*=Rs;var n=Math.cos(e*=Rs),a=n*Math.cos(t),s=n*Math.sin(t),l=Math.sin(e),u=i*l-o*s,c=o*a-r*l,f=r*s-i*a,h=Math.sqrt(u*u+c*c+f*f),d=r*a+i*s+o*l,p=h&&-ne(d)/h,g=Math.atan2(h,d);Nl+=p*u;El+=p*c;jl+=p*f;Tl+=g;Dl+=g*(r+(r=a));Ll+=g*(i+(i=s));Al+=g*(o+(o=l));_n(r,i,o)}var e,n,r,i,o;Pl.point=function(a,s){e=a,n=s;Pl.point=t;a*=Rs;var l=Math.cos(s*=Rs);r=l*Math.cos(a);i=l*Math.sin(a);o=Math.sin(s);_n(r,i,o)};Pl.lineEnd=function(){t(e,n);Pl.lineEnd=Dn;Pl.point=kn}}function An(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}t.invert&&e.invert&&(n.invert=function(n,r){return n=e.invert(n,r),n&&t.invert(n[0],n[1])});return n}function Nn(){return!0}function En(t,e,n,r,i){var o=[],a=[];t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n=t[0],r=t[e];if(Tn(n,r)){i.lineStart();for(var s=0;e>s;++s)i.point((n=t[s])[0],n[1]);i.lineEnd()}else{var l=new Pn(n,t,null,!0),u=new Pn(n,null,l,!1);l.o=u;o.push(l);a.push(u);l=new Pn(r,t,null,!1);u=new Pn(r,null,l,!0);l.o=u;o.push(l);a.push(u)}}});a.sort(e);jn(o);jn(a);if(o.length){for(var s=0,l=n,u=a.length;u>s;++s)a[s].e=l=!l;for(var c,f,h=o[0];;){for(var d=h,p=!0;d.v;)if((d=d.n)===h)return;c=d.z;i.lineStart();do{d.v=d.o.v=!0;if(d.e){if(p)for(var s=0,u=c.length;u>s;++s)i.point((f=c[s])[0],f[1]);else r(d.x,d.n.x,1,i);d=d.n}else{if(p){c=d.p.z;for(var s=c.length-1;s>=0;--s)i.point((f=c[s])[0],f[1])}else r(d.x,d.p.x,-1,i);d=d.p}d=d.o;c=d.z;p=!p}while(!d.v);i.lineEnd()}}}function jn(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;){i.n=n=t[r];n.p=i;i=n}i.n=n=t[0];n.p=i}}function Pn(t,e,n,r){this.x=t;this.z=e;this.o=n;this.e=r;this.v=!1;this.n=this.p=null}function In(t,e,n,r){return function(i,o){function a(e,n){var r=i(e,n);t(e=r[0],n=r[1])&&o.point(e,n)}function s(t,e){var n=i(t,e);m.point(n[0],n[1])}function l(){y.point=s;m.lineStart()}function u(){y.point=a;m.lineEnd()}function c(t,e){g.push([t,e]);var n=i(t,e);x.point(n[0],n[1])}function f(){x.lineStart();g=[]}function h(){c(g[0][0],g[0][1]);x.lineEnd();var t,e=x.clean(),n=b.buffer(),r=n.length;g.pop();p.push(g);g=null;if(r)if(1&e){t=n[0];var i,r=t.length-1,a=-1;if(r>0){w||(o.polygonStart(),w=!0);o.lineStart();for(;++a<r;)o.point((i=t[a])[0],i[1]);o.lineEnd()}}else{r>1&&2&e&&n.push(n.pop().concat(n.shift()));d.push(n.filter(Hn))}}var d,p,g,m=e(o),v=i.invert(r[0],r[1]),y={point:a,lineStart:l,lineEnd:u,polygonStart:function(){y.point=c;y.lineStart=f;y.lineEnd=h;d=[];p=[]},polygonEnd:function(){y.point=a;y.lineStart=l;y.lineEnd=u;d=is.merge(d);var t=qn(v,p);if(d.length){w||(o.polygonStart(),w=!0);En(d,Rn,t,n,o)}else if(t){w||(o.polygonStart(),w=!0);o.lineStart();n(null,null,1,o);o.lineEnd()}w&&(o.polygonEnd(),w=!1);d=p=null},sphere:function(){o.polygonStart();o.lineStart();n(null,null,1,o);o.lineEnd();o.polygonEnd()}},b=On(),x=e(b),w=!1;return y}}function Hn(t){return t.length>1}function On(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:S,buffer:function(){var n=e;e=[];t=null;return n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Rn(t,e){return((t=t.x)[0]<0?t[1]-Os-Es:Os-t[1])-((e=e.x)[0]<0?e[1]-Os-Es:Os-e[1])}function Fn(t){var e,n=0/0,r=0/0,i=0/0;return{lineStart:function(){t.lineStart();e=1},point:function(o,a){var s=o>0?Ps:-Ps,l=ms(o-n);if(ms(l-Ps)<Es){t.point(n,r=(r+a)/2>0?Os:-Os);t.point(i,r);t.lineEnd();t.lineStart();t.point(s,r);t.point(o,r);e=0}else if(i!==s&&l>=Ps){ms(n-i)<Es&&(n-=i*Es);ms(o-s)<Es&&(o-=s*Es);
r=Wn(n,r,o,a);t.point(i,r);t.lineEnd();t.lineStart();t.point(s,r);e=0}t.point(n=o,r=a);i=s},lineEnd:function(){t.lineEnd();n=r=0/0},clean:function(){return 2-e}}}function Wn(t,e,n,r){var i,o,a=Math.sin(t-n);return ms(a)>Es?Math.atan((Math.sin(e)*(o=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(e))*Math.sin(t))/(i*o*a)):(e+r)/2}function zn(t,e,n,r){var i;if(null==t){i=n*Os;r.point(-Ps,i);r.point(0,i);r.point(Ps,i);r.point(Ps,0);r.point(Ps,-i);r.point(0,-i);r.point(-Ps,-i);r.point(-Ps,0);r.point(-Ps,i)}else if(ms(t[0]-e[0])>Es){var o=t[0]<e[0]?Ps:-Ps;i=n*o/2;r.point(-o,i);r.point(0,i);r.point(o,i)}else r.point(e[0],e[1])}function qn(t,e){var n=t[0],r=t[1],i=[Math.sin(n),-Math.cos(n),0],o=0,a=0;wl.reset();for(var s=0,l=e.length;l>s;++s){var u=e[s],c=u.length;if(c)for(var f=u[0],h=f[0],d=f[1]/2+Ps/4,p=Math.sin(d),g=Math.cos(d),m=1;;){m===c&&(m=0);t=u[m];var v=t[0],y=t[1]/2+Ps/4,b=Math.sin(y),x=Math.cos(y),w=v-h,C=w>=0?1:-1,S=C*w,T=S>Ps,k=p*b;wl.add(Math.atan2(k*C*Math.sin(S),g*x+k*Math.cos(S)));o+=T?w+C*Is:w;if(T^h>=n^v>=n){var _=bn(vn(f),vn(t));Cn(_);var M=bn(i,_);Cn(M);var D=(T^w>=0?-1:1)*re(M[2]);(r>D||r===D&&(_[0]||_[1]))&&(a+=T^w>=0?1:-1)}if(!m++)break;h=v,p=b,g=x,f=t}}return(-Es>o||Es>o&&0>wl)^1&a}function Un(t){function e(t,e){return Math.cos(t)*Math.cos(e)>o}function n(t){var n,o,l,u,c;return{lineStart:function(){u=l=!1;c=1},point:function(f,h){var d,p=[f,h],g=e(f,h),m=a?g?0:i(f,h):g?i(f+(0>f?Ps:-Ps),h):0;!n&&(u=l=g)&&t.lineStart();if(g!==l){d=r(n,p);if(Tn(n,d)||Tn(p,d)){p[0]+=Es;p[1]+=Es;g=e(p[0],p[1])}}if(g!==l){c=0;if(g){t.lineStart();d=r(p,n);t.point(d[0],d[1])}else{d=r(n,p);t.point(d[0],d[1]);t.lineEnd()}n=d}else if(s&&n&&a^g){var v;if(!(m&o)&&(v=r(p,n,!0))){c=0;if(a){t.lineStart();t.point(v[0][0],v[0][1]);t.point(v[1][0],v[1][1]);t.lineEnd()}else{t.point(v[1][0],v[1][1]);t.lineEnd();t.lineStart();t.point(v[0][0],v[0][1])}}}!g||n&&Tn(n,p)||t.point(p[0],p[1]);n=p,l=g,o=m},lineEnd:function(){l&&t.lineEnd();n=null},clean:function(){return c|(u&&l)<<1}}}function r(t,e,n){var r=vn(t),i=vn(e),a=[1,0,0],s=bn(r,i),l=yn(s,s),u=s[0],c=l-u*u;if(!c)return!n&&t;var f=o*l/c,h=-o*u/c,d=bn(a,s),p=wn(a,f),g=wn(s,h);xn(p,g);var m=d,v=yn(p,m),y=yn(m,m),b=v*v-y*(yn(p,p)-1);if(!(0>b)){var x=Math.sqrt(b),w=wn(m,(-v-x)/y);xn(w,p);w=Sn(w);if(!n)return w;var C,S=t[0],T=e[0],k=t[1],_=e[1];S>T&&(C=S,S=T,T=C);var M=T-S,D=ms(M-Ps)<Es,L=D||Es>M;!D&&k>_&&(C=k,k=_,_=C);if(L?D?k+_>0^w[1]<(ms(w[0]-S)<Es?k:_):k<=w[1]&&w[1]<=_:M>Ps^(S<=w[0]&&w[0]<=T)){var A=wn(m,(-v+x)/y);xn(A,p);return[w,Sn(A)]}}}function i(e,n){var r=a?t:Ps-t,i=0;-r>e?i|=1:e>r&&(i|=2);-r>n?i|=4:n>r&&(i|=8);return i}var o=Math.cos(t),a=o>0,s=ms(o)>Es,l=mr(t,6*Rs);return In(e,n,l,a?[0,-t]:[-Ps,t-Ps])}function Bn(t,e,n,r){return function(i){var o,a=i.a,s=i.b,l=a.x,u=a.y,c=s.x,f=s.y,h=0,d=1,p=c-l,g=f-u;o=t-l;if(p||!(o>0)){o/=p;if(0>p){if(h>o)return;d>o&&(d=o)}else if(p>0){if(o>d)return;o>h&&(h=o)}o=n-l;if(p||!(0>o)){o/=p;if(0>p){if(o>d)return;o>h&&(h=o)}else if(p>0){if(h>o)return;d>o&&(d=o)}o=e-u;if(g||!(o>0)){o/=g;if(0>g){if(h>o)return;d>o&&(d=o)}else if(g>0){if(o>d)return;o>h&&(h=o)}o=r-u;if(g||!(0>o)){o/=g;if(0>g){if(o>d)return;o>h&&(h=o)}else if(g>0){if(h>o)return;d>o&&(d=o)}h>0&&(i.a={x:l+h*p,y:u+h*g});1>d&&(i.b={x:l+d*p,y:u+d*g});return i}}}}}}function Vn(t,e,n,r){function i(r,i){return ms(r[0]-t)<Es?i>0?0:3:ms(r[0]-n)<Es?i>0?2:1:ms(r[1]-e)<Es?i>0?1:0:i>0?3:2}function o(t,e){return a(t.x,e.x)}function a(t,e){var n=i(t,1),r=i(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){function l(t){for(var e=0,n=m.length,r=t[1],i=0;n>i;++i)for(var o,a=1,s=m[i],l=s.length,u=s[0];l>a;++a){o=s[a];u[1]<=r?o[1]>r&&ee(u,o,t)>0&&++e:o[1]<=r&&ee(u,o,t)<0&&--e;u=o}return 0!==e}function u(o,s,l,u){var c=0,f=0;if(null==o||(c=i(o,l))!==(f=i(s,l))||a(o,s)<0^l>0){do u.point(0===c||3===c?t:n,c>1?r:e);while((c=(c+l+4)%4)!==f)}else u.point(s[0],s[1])}function c(i,o){return i>=t&&n>=i&&o>=e&&r>=o}function f(t,e){c(t,e)&&s.point(t,e)}function h(){L.point=p;m&&m.push(v=[]);T=!0;S=!1;w=C=0/0}function d(){if(g){p(y,b);x&&S&&M.rejoin();g.push(M.buffer())}L.point=f;S&&s.lineEnd()}function p(t,e){t=Math.max(-Hl,Math.min(Hl,t));e=Math.max(-Hl,Math.min(Hl,e));var n=c(t,e);m&&v.push([t,e]);if(T){y=t,b=e,x=n;T=!1;if(n){s.lineStart();s.point(t,e)}}else if(n&&S)s.point(t,e);else{var r={a:{x:w,y:C},b:{x:t,y:e}};if(D(r)){if(!S){s.lineStart();s.point(r.a.x,r.a.y)}s.point(r.b.x,r.b.y);n||s.lineEnd();k=!1}else if(n){s.lineStart();s.point(t,e);k=!1}}w=t,C=e,S=n}var g,m,v,y,b,x,w,C,S,T,k,_=s,M=On(),D=Bn(t,e,n,r),L={point:f,lineStart:h,lineEnd:d,polygonStart:function(){s=M;g=[];m=[];k=!0},polygonEnd:function(){s=_;g=is.merge(g);var e=l([t,r]),n=k&&e,i=g.length;if(n||i){s.polygonStart();if(n){s.lineStart();u(null,null,1,s);s.lineEnd()}i&&En(g,o,e,u,s);s.polygonEnd()}g=m=v=null}};return L}}function Xn(t){var e=0,n=Ps/3,r=lr(t),i=r(e,n);i.parallels=function(t){return arguments.length?r(e=t[0]*Ps/180,n=t[1]*Ps/180):[e/Ps*180,n/Ps*180]};return i}function Gn(t,e){function n(t,e){var n=Math.sqrt(o-2*i*Math.sin(e))/i;return[n*Math.sin(t*=i),a-n*Math.cos(t)]}var r=Math.sin(t),i=(r+Math.sin(e))/2,o=1+r*(2*i-r),a=Math.sqrt(o)/i;n.invert=function(t,e){var n=a-e;return[Math.atan2(t,n)/i,re((o-(t*t+n*n)*i*i)/(2*i))]};return n}function $n(){function t(t,e){Rl+=i*t-r*e;r=t,i=e}var e,n,r,i;Ul.point=function(o,a){Ul.point=t;e=r=o,n=i=a};Ul.lineEnd=function(){t(e,n)}}function Yn(t,e){Fl>t&&(Fl=t);t>zl&&(zl=t);Wl>e&&(Wl=e);e>ql&&(ql=e)}function Jn(){function t(t,e){a.push("M",t,",",e,o)}function e(t,e){a.push("M",t,",",e);s.point=n}function n(t,e){a.push("L",t,",",e)}function r(){s.point=t}function i(){a.push("Z")}var o=Kn(4.5),a=[],s={point:t,lineStart:function(){s.point=e},lineEnd:r,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=r;s.point=t},pointRadius:function(t){o=Kn(t);return s},result:function(){if(a.length){var t=a.join("");a=[];return t}}};return s}function Kn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Zn(t,e){kl+=t;_l+=e;++Ml}function Qn(){function t(t,r){var i=t-e,o=r-n,a=Math.sqrt(i*i+o*o);Dl+=a*(e+t)/2;Ll+=a*(n+r)/2;Al+=a;Zn(e=t,n=r)}var e,n;Vl.point=function(r,i){Vl.point=t;Zn(e=r,n=i)}}function tr(){Vl.point=Zn}function er(){function t(t,e){var n=t-r,o=e-i,a=Math.sqrt(n*n+o*o);Dl+=a*(r+t)/2;Ll+=a*(i+e)/2;Al+=a;a=i*t-r*e;Nl+=a*(r+t);El+=a*(i+e);jl+=3*a;Zn(r=t,i=e)}var e,n,r,i;Vl.point=function(o,a){Vl.point=t;Zn(e=r=o,n=i=a)};Vl.lineEnd=function(){t(e,n)}}function nr(t){function e(e,n){t.moveTo(e+a,n);t.arc(e,n,a,0,Is)}function n(e,n){t.moveTo(e,n);s.point=r}function r(e,n){t.lineTo(e,n)}function i(){s.point=e}function o(){t.closePath()}var a=4.5,s={point:e,lineStart:function(){s.point=n},lineEnd:i,polygonStart:function(){s.lineEnd=o},polygonEnd:function(){s.lineEnd=i;s.point=e},pointRadius:function(t){a=t;return s},result:S};return s}function rr(t){function e(t){return(s?r:n)(t)}function n(e){return ar(e,function(n,r){n=t(n,r);e.point(n[0],n[1])})}function r(e){function n(n,r){n=t(n,r);e.point(n[0],n[1])}function r(){b=0/0;T.point=o;e.lineStart()}function o(n,r){var o=vn([n,r]),a=t(n,r);i(b,x,y,w,C,S,b=a[0],x=a[1],y=n,w=o[0],C=o[1],S=o[2],s,e);e.point(b,x)}function a(){T.point=n;e.lineEnd()}function l(){r();T.point=u;T.lineEnd=c}function u(t,e){o(f=t,h=e),d=b,p=x,g=w,m=C,v=S;T.point=o}function c(){i(b,x,y,w,C,S,d,p,f,g,m,v,s,e);T.lineEnd=a;a()}var f,h,d,p,g,m,v,y,b,x,w,C,S,T={point:n,lineStart:r,lineEnd:a,polygonStart:function(){e.polygonStart();T.lineStart=l},polygonEnd:function(){e.polygonEnd();T.lineStart=r}};return T}function i(e,n,r,s,l,u,c,f,h,d,p,g,m,v){var y=c-e,b=f-n,x=y*y+b*b;if(x>4*o&&m--){var w=s+d,C=l+p,S=u+g,T=Math.sqrt(w*w+C*C+S*S),k=Math.asin(S/=T),_=ms(ms(S)-1)<Es||ms(r-h)<Es?(r+h)/2:Math.atan2(C,w),M=t(_,k),D=M[0],L=M[1],A=D-e,N=L-n,E=b*A-y*N;if(E*E/x>o||ms((y*A+b*N)/x-.5)>.3||a>s*d+l*p+u*g){i(e,n,r,s,l,u,D,L,_,w/=T,C/=T,S,m,v);v.point(D,L);i(D,L,_,w,C,S,c,f,h,d,p,g,m,v)}}}var o=.5,a=Math.cos(30*Rs),s=16;e.precision=function(t){if(!arguments.length)return Math.sqrt(o);s=(o=t*t)>0&&16;return e};return e}function ir(t){var e=rr(function(e,n){return t([e*Fs,n*Fs])});return function(t){return ur(e(t))}}function or(t){this.stream=t}function ar(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function sr(t){return lr(function(){return t})()}function lr(t){function e(t){t=s(t[0]*Rs,t[1]*Rs);return[t[0]*h+l,u-t[1]*h]}function n(t){t=s.invert((t[0]-l)/h,(u-t[1])/h);return t&&[t[0]*Fs,t[1]*Fs]}function r(){s=An(a=hr(v,y,b),o);var t=o(g,m);l=d-t[0]*h;u=p+t[1]*h;return i()}function i(){c&&(c.valid=!1,c=null);return e}var o,a,s,l,u,c,f=rr(function(t,e){t=o(t,e);return[t[0]*h+l,u-t[1]*h]}),h=150,d=480,p=250,g=0,m=0,v=0,y=0,b=0,w=Il,C=x,S=null,T=null;e.stream=function(t){c&&(c.valid=!1);c=ur(w(a,f(C(t))));c.valid=!0;return c};e.clipAngle=function(t){if(!arguments.length)return S;w=null==t?(S=t,Il):Un((S=+t)*Rs);return i()};e.clipExtent=function(t){if(!arguments.length)return T;T=t;C=t?Vn(t[0][0],t[0][1],t[1][0],t[1][1]):x;return i()};e.scale=function(t){if(!arguments.length)return h;h=+t;return r()};e.translate=function(t){if(!arguments.length)return[d,p];d=+t[0];p=+t[1];return r()};e.center=function(t){if(!arguments.length)return[g*Fs,m*Fs];g=t[0]%360*Rs;m=t[1]%360*Rs;return r()};e.rotate=function(t){if(!arguments.length)return[v*Fs,y*Fs,b*Fs];v=t[0]%360*Rs;y=t[1]%360*Rs;b=t.length>2?t[2]%360*Rs:0;return r()};is.rebind(e,f,"precision");return function(){o=t.apply(this,arguments);e.invert=o.invert&&n;return r()}}function ur(t){return ar(t,function(e,n){t.point(e*Rs,n*Rs)})}function cr(t,e){return[t,e]}function fr(t,e){return[t>Ps?t-Is:-Ps>t?t+Is:t,e]}function hr(t,e,n){return t?e||n?An(pr(t),gr(e,n)):pr(t):e||n?gr(e,n):fr}function dr(t){return function(e,n){return e+=t,[e>Ps?e-Is:-Ps>e?e+Is:e,n]}}function pr(t){var e=dr(t);e.invert=dr(-t);return e}function gr(t,e){function n(t,e){var n=Math.cos(e),s=Math.cos(t)*n,l=Math.sin(t)*n,u=Math.sin(e),c=u*r+s*i;return[Math.atan2(l*o-c*a,s*r-u*i),re(c*o+l*a)]}var r=Math.cos(t),i=Math.sin(t),o=Math.cos(e),a=Math.sin(e);n.invert=function(t,e){var n=Math.cos(e),s=Math.cos(t)*n,l=Math.sin(t)*n,u=Math.sin(e),c=u*o-l*a;return[Math.atan2(l*o+u*a,s*r+c*i),re(c*r-s*i)]};return n}function mr(t,e){var n=Math.cos(t),r=Math.sin(t);return function(i,o,a,s){var l=a*e;if(null!=i){i=vr(n,i);o=vr(n,o);(a>0?o>i:i>o)&&(i+=a*Is)}else{i=t+a*Is;o=t-.5*l}for(var u,c=i;a>0?c>o:o>c;c-=l)s.point((u=Sn([n,-r*Math.cos(c),-r*Math.sin(c)]))[0],u[1])}}function vr(t,e){var n=vn(e);n[0]-=t;Cn(n);var r=ne(-n[1]);return((-n[2]<0?-r:r)+2*Math.PI-Es)%(2*Math.PI)}function yr(t,e,n){var r=is.range(t,e-Es,n).concat(e);return function(t){return r.map(function(e){return[t,e]})}}function br(t,e,n){var r=is.range(t,e-Es,n).concat(e);return function(t){return r.map(function(e){return[e,t]})}}function xr(t){return t.source}function wr(t){return t.target}function Cr(t,e,n,r){var i=Math.cos(e),o=Math.sin(e),a=Math.cos(r),s=Math.sin(r),l=i*Math.cos(t),u=i*Math.sin(t),c=a*Math.cos(n),f=a*Math.sin(n),h=2*Math.asin(Math.sqrt(se(r-e)+i*a*se(n-t))),d=1/Math.sin(h),p=h?function(t){var e=Math.sin(t*=h)*d,n=Math.sin(h-t)*d,r=n*l+e*c,i=n*u+e*f,a=n*o+e*s;return[Math.atan2(i,r)*Fs,Math.atan2(a,Math.sqrt(r*r+i*i))*Fs]}:function(){return[t*Fs,e*Fs]};p.distance=h;return p}function Sr(){function t(t,i){var o=Math.sin(i*=Rs),a=Math.cos(i),s=ms((t*=Rs)-e),l=Math.cos(s);Xl+=Math.atan2(Math.sqrt((s=a*Math.sin(s))*s+(s=r*o-n*a*l)*s),n*o+r*a*l);e=t,n=o,r=a}var e,n,r;Gl.point=function(i,o){e=i*Rs,n=Math.sin(o*=Rs),r=Math.cos(o);Gl.point=t};Gl.lineEnd=function(){Gl.point=Gl.lineEnd=S}}function Tr(t,e){function n(e,n){var r=Math.cos(e),i=Math.cos(n),o=t(r*i);return[o*i*Math.sin(e),o*Math.sin(n)]}n.invert=function(t,n){var r=Math.sqrt(t*t+n*n),i=e(r),o=Math.sin(i),a=Math.cos(i);return[Math.atan2(t*o,r*a),Math.asin(r&&n*o/r)]};return n}function kr(t,e){function n(t,e){a>0?-Os+Es>e&&(e=-Os+Es):e>Os-Es&&(e=Os-Es);var n=a/Math.pow(i(e),o);return[n*Math.sin(o*t),a-n*Math.cos(o*t)]}var r=Math.cos(t),i=function(t){return Math.tan(Ps/4+t/2)},o=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(i(e)/i(t)),a=r*Math.pow(i(t),o)/o;if(!o)return Mr;n.invert=function(t,e){var n=a-e,r=te(o)*Math.sqrt(t*t+n*n);return[Math.atan2(t,n)/o,2*Math.atan(Math.pow(a/r,1/o))-Os]};return n}function _r(t,e){function n(t,e){var n=o-e;return[n*Math.sin(i*t),o-n*Math.cos(i*t)]}var r=Math.cos(t),i=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),o=r/i+t;if(ms(i)<Es)return cr;n.invert=function(t,e){var n=o-e;return[Math.atan2(t,n)/i,o-te(i)*Math.sqrt(t*t+n*n)]};return n}function Mr(t,e){return[t,Math.log(Math.tan(Ps/4+e/2))]}function Dr(t){var e,n=sr(t),r=n.scale,i=n.translate,o=n.clipExtent;n.scale=function(){var t=r.apply(n,arguments);return t===n?e?n.clipExtent(null):n:t};n.translate=function(){var t=i.apply(n,arguments);return t===n?e?n.clipExtent(null):n:t};n.clipExtent=function(t){var a=o.apply(n,arguments);if(a===n){if(e=null==t){var s=Ps*r(),l=i();o([[l[0]-s,l[1]-s],[l[0]+s,l[1]+s]])}}else e&&(a=null);return a};return n.clipExtent(null)}function Lr(t,e){return[Math.log(Math.tan(Ps/4+e/2)),-t]}function Ar(t){return t[0]}function Nr(t){return t[1]}function Er(t){for(var e=t.length,n=[0,1],r=2,i=2;e>i;i++){for(;r>1&&ee(t[n[r-2]],t[n[r-1]],t[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function jr(t,e){return t[0]-e[0]||t[1]-e[1]}function Pr(t,e,n){return(n[0]-e[0])*(t[1]-e[1])<(n[1]-e[1])*(t[0]-e[0])}function Ir(t,e,n,r){var i=t[0],o=n[0],a=e[0]-i,s=r[0]-o,l=t[1],u=n[1],c=e[1]-l,f=r[1]-u,h=(s*(l-u)-f*(i-o))/(f*a-s*c);return[i+h*a,l+h*c]}function Hr(t){var e=t[0],n=t[t.length-1];return!(e[0]-n[0]||e[1]-n[1])}function Or(){ii(this);this.edge=this.site=this.circle=null}function Rr(t){var e=ou.pop()||new Or;e.site=t;return e}function Fr(t){Yr(t);nu.remove(t);ou.push(t);ii(t)}function Wr(t){var e=t.circle,n=e.x,r=e.cy,i={x:n,y:r},o=t.P,a=t.N,s=[t];Fr(t);for(var l=o;l.circle&&ms(n-l.circle.x)<Es&&ms(r-l.circle.cy)<Es;){o=l.P;s.unshift(l);Fr(l);l=o}s.unshift(l);Yr(l);for(var u=a;u.circle&&ms(n-u.circle.x)<Es&&ms(r-u.circle.cy)<Es;){a=u.N;s.push(u);Fr(u);u=a}s.push(u);Yr(u);var c,f=s.length;for(c=1;f>c;++c){u=s[c];l=s[c-1];ei(u.edge,l.site,u.site,i)}l=s[0];u=s[f-1];u.edge=Qr(l.site,u.site,null,i);$r(l);$r(u)}function zr(t){for(var e,n,r,i,o=t.x,a=t.y,s=nu._;s;){r=qr(s,a)-o;if(r>Es)s=s.L;else{i=o-Ur(s,a);if(!(i>Es)){if(r>-Es){e=s.P;n=s}else if(i>-Es){e=s;n=s.N}else e=n=s;break}if(!s.R){e=s;break}s=s.R}}var l=Rr(t);nu.insert(e,l);if(e||n)if(e!==n)if(n){Yr(e);Yr(n);var u=e.site,c=u.x,f=u.y,h=t.x-c,d=t.y-f,p=n.site,g=p.x-c,m=p.y-f,v=2*(h*m-d*g),y=h*h+d*d,b=g*g+m*m,x={x:(m*y-d*b)/v+c,y:(h*b-g*y)/v+f};ei(n.edge,u,p,x);l.edge=Qr(u,t,null,x);n.edge=Qr(t,p,null,x);$r(e);$r(n)}else l.edge=Qr(e.site,l.site);else{Yr(e);n=Rr(e.site);nu.insert(l,n);l.edge=n.edge=Qr(e.site,l.site);$r(e);$r(n)}}function qr(t,e){var n=t.site,r=n.x,i=n.y,o=i-e;if(!o)return r;var a=t.P;if(!a)return-1/0;n=a.site;var s=n.x,l=n.y,u=l-e;if(!u)return s;var c=s-r,f=1/o-1/u,h=c/u;return f?(-h+Math.sqrt(h*h-2*f*(c*c/(-2*u)-l+u/2+i-o/2)))/f+r:(r+s)/2}function Ur(t,e){var n=t.N;if(n)return qr(n,e);var r=t.site;return r.y===e?r.x:1/0}function Br(t){this.site=t;this.edges=[]}function Vr(t){for(var e,n,r,i,o,a,s,l,u,c,f=t[0][0],h=t[1][0],d=t[0][1],p=t[1][1],g=eu,m=g.length;m--;){o=g[m];if(o&&o.prepare()){s=o.edges;l=s.length;a=0;for(;l>a;){c=s[a].end(),r=c.x,i=c.y;u=s[++a%l].start(),e=u.x,n=u.y;if(ms(r-e)>Es||ms(i-n)>Es){s.splice(a,0,new ni(ti(o.site,c,ms(r-f)<Es&&p-i>Es?{x:f,y:ms(e-f)<Es?n:p}:ms(i-p)<Es&&h-r>Es?{x:ms(n-p)<Es?e:h,y:p}:ms(r-h)<Es&&i-d>Es?{x:h,y:ms(e-h)<Es?n:d}:ms(i-d)<Es&&r-f>Es?{x:ms(n-d)<Es?e:f,y:d}:null),o.site,null));++l}}}}}function Xr(t,e){return e.angle-t.angle}function Gr(){ii(this);this.x=this.y=this.arc=this.site=this.cy=null}function $r(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,i=t.site,o=n.site;if(r!==o){var a=i.x,s=i.y,l=r.x-a,u=r.y-s,c=o.x-a,f=o.y-s,h=2*(l*f-u*c);if(!(h>=-js)){var d=l*l+u*u,p=c*c+f*f,g=(f*d-u*p)/h,m=(l*p-c*d)/h,f=m+s,v=au.pop()||new Gr;v.arc=t;v.site=i;v.x=g+a;v.y=f+Math.sqrt(g*g+m*m);v.cy=f;t.circle=v;for(var y=null,b=iu._;b;)if(v.y<b.y||v.y===b.y&&v.x<=b.x){if(!b.L){y=b.P;break}b=b.L}else{if(!b.R){y=b;break}b=b.R}iu.insert(y,v);y||(ru=v)}}}}function Yr(t){var e=t.circle;if(e){e.P||(ru=e.N);iu.remove(e);au.push(e);ii(e);t.circle=null}}function Jr(t){for(var e,n=tu,r=Bn(t[0][0],t[0][1],t[1][0],t[1][1]),i=n.length;i--;){e=n[i];if(!Kr(e,t)||!r(e)||ms(e.a.x-e.b.x)<Es&&ms(e.a.y-e.b.y)<Es){e.a=e.b=null;n.splice(i,1)}}}function Kr(t,e){var n=t.b;if(n)return!0;var r,i,o=t.a,a=e[0][0],s=e[1][0],l=e[0][1],u=e[1][1],c=t.l,f=t.r,h=c.x,d=c.y,p=f.x,g=f.y,m=(h+p)/2,v=(d+g)/2;if(g===d){if(a>m||m>=s)return;if(h>p){if(o){if(o.y>=u)return}else o={x:m,y:l};n={x:m,y:u}}else{if(o){if(o.y<l)return}else o={x:m,y:u};n={x:m,y:l}}}else{r=(h-p)/(g-d);i=v-r*m;if(-1>r||r>1)if(h>p){if(o){if(o.y>=u)return}else o={x:(l-i)/r,y:l};n={x:(u-i)/r,y:u}}else{if(o){if(o.y<l)return}else o={x:(u-i)/r,y:u};n={x:(l-i)/r,y:l}}else if(g>d){if(o){if(o.x>=s)return}else o={x:a,y:r*a+i};n={x:s,y:r*s+i}}else{if(o){if(o.x<a)return}else o={x:s,y:r*s+i};n={x:a,y:r*a+i}}}t.a=o;t.b=n;return!0}function Zr(t,e){this.l=t;this.r=e;this.a=this.b=null}function Qr(t,e,n,r){var i=new Zr(t,e);tu.push(i);n&&ei(i,t,e,n);r&&ei(i,e,t,r);eu[t.i].edges.push(new ni(i,t,e));eu[e.i].edges.push(new ni(i,e,t));return i}function ti(t,e,n){var r=new Zr(t,null);r.a=e;r.b=n;tu.push(r);return r}function ei(t,e,n,r){if(t.a||t.b)t.l===n?t.b=r:t.a=r;else{t.a=r;t.l=e;t.r=n}}function ni(t,e,n){var r=t.a,i=t.b;this.edge=t;this.site=e;this.angle=n?Math.atan2(n.y-e.y,n.x-e.x):t.l===e?Math.atan2(i.x-r.x,r.y-i.y):Math.atan2(r.x-i.x,i.y-r.y)}function ri(){this._=null}function ii(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function oi(t,e){var n=e,r=e.R,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r;r.U=i;n.U=r;n.R=r.L;n.R&&(n.R.U=n);r.L=n}function ai(t,e){var n=e,r=e.L,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r;r.U=i;n.U=r;n.L=r.R;n.L&&(n.L.U=n);r.R=n}function si(t){for(;t.L;)t=t.L;return t}function li(t,e){var n,r,i,o=t.sort(ui).pop();tu=[];eu=new Array(t.length);nu=new ri;iu=new ri;for(;;){i=ru;if(o&&(!i||o.y<i.y||o.y===i.y&&o.x<i.x)){if(o.x!==n||o.y!==r){eu[o.i]=new Br(o);zr(o);n=o.x,r=o.y}o=t.pop()}else{if(!i)break;Wr(i.arc)}}e&&(Jr(e),Vr(e));var a={cells:eu,edges:tu};nu=iu=tu=eu=null;return a}function ui(t,e){return e.y-t.y||e.x-t.x}function ci(t,e,n){return(t.x-n.x)*(e.y-t.y)-(t.x-e.x)*(n.y-t.y)}function fi(t){return t.x}function hi(t){return t.y}function di(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function pi(t,e,n,r,i,o){if(!t(e,n,r,i,o)){var a=.5*(n+i),s=.5*(r+o),l=e.nodes;l[0]&&pi(t,l[0],n,r,a,s);l[1]&&pi(t,l[1],a,r,i,s);l[2]&&pi(t,l[2],n,s,a,o);l[3]&&pi(t,l[3],a,s,i,o)}}function gi(t,e,n,r,i,o,a){var s,l=1/0;(function u(t,c,f,h,d){if(!(c>o||f>a||r>h||i>d)){if(p=t.point){var p,g=e-t.x,m=n-t.y,v=g*g+m*m;if(l>v){var y=Math.sqrt(l=v);r=e-y,i=n-y;o=e+y,a=n+y;s=p}}for(var b=t.nodes,x=.5*(c+h),w=.5*(f+d),C=e>=x,S=n>=w,T=S<<1|C,k=T+4;k>T;++T)if(t=b[3&T])switch(3&T){case 0:u(t,c,f,x,w);break;case 1:u(t,x,f,h,w);break;case 2:u(t,c,w,x,d);break;case 3:u(t,x,w,h,d)}}})(t,r,i,o,a);return s}function mi(t,e){t=is.rgb(t);e=is.rgb(e);var n=t.r,r=t.g,i=t.b,o=e.r-n,a=e.g-r,s=e.b-i;return function(t){return"#"+Ce(Math.round(n+o*t))+Ce(Math.round(r+a*t))+Ce(Math.round(i+s*t))}}function vi(t,e){var n,r={},i={};for(n in t)n in e?r[n]=xi(t[n],e[n]):i[n]=t[n];for(n in e)n in t||(i[n]=e[n]);return function(t){for(n in r)i[n]=r[n](t);return i}}function yi(t,e){t=+t,e=+e;return function(n){return t*(1-n)+e*n}}function bi(t,e){var n,r,i,o=lu.lastIndex=uu.lastIndex=0,a=-1,s=[],l=[];t+="",e+="";for(;(n=lu.exec(t))&&(r=uu.exec(e));){if((i=r.index)>o){i=e.slice(o,i);s[a]?s[a]+=i:s[++a]=i}if((n=n[0])===(r=r[0]))s[a]?s[a]+=r:s[++a]=r;else{s[++a]=null;l.push({i:a,x:yi(n,r)})}o=uu.lastIndex}if(o<e.length){i=e.slice(o);s[a]?s[a]+=i:s[++a]=i}return s.length<2?l[0]?(e=l[0].x,function(t){return e(t)+""}):function(){return e}:(e=l.length,function(t){for(var n,r=0;e>r;++r)s[(n=l[r]).i]=n.x(t);return s.join("")})}function xi(t,e){for(var n,r=is.interpolators.length;--r>=0&&!(n=is.interpolators[r](t,e)););return n}function wi(t,e){var n,r=[],i=[],o=t.length,a=e.length,s=Math.min(t.length,e.length);for(n=0;s>n;++n)r.push(xi(t[n],e[n]));for(;o>n;++n)i[n]=t[n];for(;a>n;++n)i[n]=e[n];return function(t){for(n=0;s>n;++n)i[n]=r[n](t);return i}}function Ci(t){return function(e){return 0>=e?0:e>=1?1:t(e)}}function Si(t){return function(e){return 1-t(1-e)}}function Ti(t){return function(e){return.5*(.5>e?t(2*e):2-t(2-2*e))}}function ki(t){return t*t}function _i(t){return t*t*t}function Mi(t){if(0>=t)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(.5>t?n:3*(t-e)+n-.75)}function Di(t){return function(e){return Math.pow(e,t)}}function Li(t){return 1-Math.cos(t*Os)}function Ai(t){return Math.pow(2,10*(t-1))}function Ni(t){return 1-Math.sqrt(1-t*t)}function Ei(t,e){var n;arguments.length<2&&(e=.45);arguments.length?n=e/Is*Math.asin(1/t):(t=1,n=e/4);return function(r){return 1+t*Math.pow(2,-10*r)*Math.sin((r-n)*Is/e)}}function ji(t){t||(t=1.70158);return function(e){return e*e*((t+1)*e-t)}}function Pi(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Ii(t,e){t=is.hcl(t);e=is.hcl(e);var n=t.h,r=t.c,i=t.l,o=e.h-n,a=e.c-r,s=e.l-i;isNaN(a)&&(a=0,r=isNaN(r)?e.c:r);isNaN(o)?(o=0,n=isNaN(n)?e.h:n):o>180?o-=360:-180>o&&(o+=360);return function(t){return he(n+o*t,r+a*t,i+s*t)+""}}function Hi(t,e){t=is.hsl(t);e=is.hsl(e);var n=t.h,r=t.s,i=t.l,o=e.h-n,a=e.s-r,s=e.l-i;isNaN(a)&&(a=0,r=isNaN(r)?e.s:r);isNaN(o)?(o=0,n=isNaN(n)?e.h:n):o>180?o-=360:-180>o&&(o+=360);return function(t){return ce(n+o*t,r+a*t,i+s*t)+""}}function Oi(t,e){t=is.lab(t);e=is.lab(e);var n=t.l,r=t.a,i=t.b,o=e.l-n,a=e.a-r,s=e.b-i;return function(t){return pe(n+o*t,r+a*t,i+s*t)+""}}function Ri(t,e){e-=t;return function(n){return Math.round(t+e*n)}}function Fi(t){var e=[t.a,t.b],n=[t.c,t.d],r=zi(e),i=Wi(e,n),o=zi(qi(n,e,-i))||0;if(e[0]*n[1]<n[0]*e[1]){e[0]*=-1;e[1]*=-1;r*=-1;i*=-1}this.rotate=(r?Math.atan2(e[1],e[0]):Math.atan2(-n[0],n[1]))*Fs;this.translate=[t.e,t.f];this.scale=[r,o];this.skew=o?Math.atan2(i,o)*Fs:0}function Wi(t,e){return t[0]*e[0]+t[1]*e[1]}function zi(t){var e=Math.sqrt(Wi(t,t));if(e){t[0]/=e;t[1]/=e}return e}function qi(t,e,n){t[0]+=n*e[0];t[1]+=n*e[1];return t}function Ui(t,e){var n,r=[],i=[],o=is.transform(t),a=is.transform(e),s=o.translate,l=a.translate,u=o.rotate,c=a.rotate,f=o.skew,h=a.skew,d=o.scale,p=a.scale;if(s[0]!=l[0]||s[1]!=l[1]){r.push("translate(",null,",",null,")");i.push({i:1,x:yi(s[0],l[0])},{i:3,x:yi(s[1],l[1])})}else r.push(l[0]||l[1]?"translate("+l+")":"");if(u!=c){u-c>180?c+=360:c-u>180&&(u+=360);i.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:yi(u,c)})}else c&&r.push(r.pop()+"rotate("+c+")");f!=h?i.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:yi(f,h)}):h&&r.push(r.pop()+"skewX("+h+")");if(d[0]!=p[0]||d[1]!=p[1]){n=r.push(r.pop()+"scale(",null,",",null,")");i.push({i:n-4,x:yi(d[0],p[0])},{i:n-2,x:yi(d[1],p[1])})}else(1!=p[0]||1!=p[1])&&r.push(r.pop()+"scale("+p+")");n=i.length;return function(t){for(var e,o=-1;++o<n;)r[(e=i[o]).i]=e.x(t);return r.join("")}}function Bi(t,e){e=(e-=t=+t)||1/e;return function(n){return(n-t)/e}}function Vi(t,e){e=(e-=t=+t)||1/e;return function(n){return Math.max(0,Math.min(1,(n-t)/e))}}function Xi(t){for(var e=t.source,n=t.target,r=$i(e,n),i=[e];e!==r;){e=e.parent;i.push(e)}for(var o=i.length;n!==r;){i.splice(o,0,n);n=n.parent}return i}function Gi(t){for(var e=[],n=t.parent;null!=n;){e.push(t);t=n;n=n.parent}e.push(t);return e}function $i(t,e){if(t===e)return t;for(var n=Gi(t),r=Gi(e),i=n.pop(),o=r.pop(),a=null;i===o;){a=i;i=n.pop();o=r.pop()}return a}function Yi(t){t.fixed|=2}function Ji(t){t.fixed&=-7}function Ki(t){t.fixed|=4;t.px=t.x,t.py=t.y}function Zi(t){t.fixed&=-5}function Qi(t,e,n){var r=0,i=0;t.charge=0;if(!t.leaf)for(var o,a=t.nodes,s=a.length,l=-1;++l<s;){o=a[l];if(null!=o){Qi(o,e,n);t.charge+=o.charge;r+=o.charge*o.cx;i+=o.charge*o.cy}}if(t.point){if(!t.leaf){t.point.x+=Math.random()-.5;t.point.y+=Math.random()-.5}var u=e*n[t.point.index];t.charge+=t.pointCharge=u;r+=u*t.point.x;i+=u*t.point.y}t.cx=r/t.charge;t.cy=i/t.charge}function to(t,e){is.rebind(t,e,"sort","children","value");t.nodes=t;t.links=ao;return t}function eo(t,e){for(var n=[t];null!=(t=n.pop());){e(t);if((i=t.children)&&(r=i.length))for(var r,i;--r>=0;)n.push(i[r])}}function no(t,e){for(var n=[t],r=[];null!=(t=n.pop());){r.push(t);if((o=t.children)&&(i=o.length))for(var i,o,a=-1;++a<i;)n.push(o[a])}for(;null!=(t=r.pop());)e(t)}function ro(t){return t.children}function io(t){return t.value}function oo(t,e){return e.value-t.value}function ao(t){return is.merge(t.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}function so(t){return t.x}function lo(t){return t.y}function uo(t,e,n){t.y0=e;t.y=n}function co(t){return is.range(t.length)}function fo(t){for(var e=-1,n=t[0].length,r=[];++e<n;)r[e]=0;return r}function ho(t){for(var e,n=1,r=0,i=t[0][1],o=t.length;o>n;++n)if((e=t[n][1])>i){r=n;i=e}return r}function po(t){return t.reduce(go,0)}function go(t,e){return t+e[1]}function mo(t,e){return vo(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function vo(t,e){for(var n=-1,r=+t[0],i=(t[1]-r)/e,o=[];++n<=e;)o[n]=i*n+r;return o}function yo(t){return[is.min(t),is.max(t)]}function bo(t,e){return t.value-e.value}function xo(t,e){var n=t._pack_next;t._pack_next=e;e._pack_prev=t;e._pack_next=n;n._pack_prev=e}function wo(t,e){t._pack_next=e;e._pack_prev=t}function Co(t,e){var n=e.x-t.x,r=e.y-t.y,i=t.r+e.r;return.999*i*i>n*n+r*r}function So(t){function e(t){c=Math.min(t.x-t.r,c);f=Math.max(t.x+t.r,f);h=Math.min(t.y-t.r,h);d=Math.max(t.y+t.r,d)}if((n=t.children)&&(u=n.length)){var n,r,i,o,a,s,l,u,c=1/0,f=-1/0,h=1/0,d=-1/0;n.forEach(To);r=n[0];r.x=-r.r;r.y=0;e(r);if(u>1){i=n[1];i.x=i.r;i.y=0;e(i);if(u>2){o=n[2];Mo(r,i,o);e(o);xo(r,o);r._pack_prev=o;xo(o,i);i=r._pack_next;for(a=3;u>a;a++){Mo(r,i,o=n[a]);var p=0,g=1,m=1;for(s=i._pack_next;s!==i;s=s._pack_next,g++)if(Co(s,o)){p=1;break}if(1==p)for(l=r._pack_prev;l!==s._pack_prev&&!Co(l,o);l=l._pack_prev,m++);if(p){m>g||g==m&&i.r<r.r?wo(r,i=s):wo(r=l,i);a--}else{xo(r,o);i=o;e(o)}}}}var v=(c+f)/2,y=(h+d)/2,b=0;for(a=0;u>a;a++){o=n[a];o.x-=v;o.y-=y;b=Math.max(b,o.r+Math.sqrt(o.x*o.x+o.y*o.y))}t.r=b;n.forEach(ko)}}function To(t){t._pack_next=t._pack_prev=t}function ko(t){delete t._pack_next;delete t._pack_prev}function _o(t,e,n,r){var i=t.children;t.x=e+=r*t.x;t.y=n+=r*t.y;t.r*=r;if(i)for(var o=-1,a=i.length;++o<a;)_o(i[o],e,n,r)}function Mo(t,e,n){var r=t.r+n.r,i=e.x-t.x,o=e.y-t.y;if(r&&(i||o)){var a=e.r+n.r,s=i*i+o*o;a*=a;r*=r;var l=.5+(r-a)/(2*s),u=Math.sqrt(Math.max(0,2*a*(r+s)-(r-=s)*r-a*a))/(2*s);n.x=t.x+l*i+u*o;n.y=t.y+l*o-u*i}else{n.x=t.x+r;n.y=t.y}}function Do(t,e){return t.parent==e.parent?1:2}function Lo(t){var e=t.children;return e.length?e[0]:t.t}function Ao(t){var e,n=t.children;return(e=n.length)?n[e-1]:t.t}function No(t,e,n){var r=n/(e.i-t.i);e.c-=r;e.s+=n;t.c+=r;e.z+=n;e.m+=n}function Eo(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;){e=i[o];e.z+=n;e.m+=n;n+=e.s+(r+=e.c)}}function jo(t,e,n){return t.a.parent===e.parent?t.a:n}function Po(t){return 1+is.max(t,function(t){return t.y})}function Io(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Ho(t){var e=t.children;return e&&e.length?Ho(e[0]):t}function Oo(t){var e,n=t.children;return n&&(e=n.length)?Oo(n[e-1]):t}function Ro(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Fo(t,e){var n=t.x+e[3],r=t.y+e[0],i=t.dx-e[1]-e[3],o=t.dy-e[0]-e[2];if(0>i){n+=i/2;i=0}if(0>o){r+=o/2;o=0}return{x:n,y:r,dx:i,dy:o}}function Wo(t){var e=t[0],n=t[t.length-1];return n>e?[e,n]:[n,e]}function zo(t){return t.rangeExtent?t.rangeExtent():Wo(t.range())}function qo(t,e,n,r){var i=n(t[0],t[1]),o=r(e[0],e[1]);return function(t){return o(i(t))}}function Uo(t,e){var n,r=0,i=t.length-1,o=t[r],a=t[i];if(o>a){n=r,r=i,i=n;n=o,o=a,a=n}t[r]=e.floor(o);t[i]=e.ceil(a);return t}function Bo(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:xu}function Vo(t,e,n,r){var i=[],o=[],a=0,s=Math.min(t.length,e.length)-1;if(t[s]<t[0]){t=t.slice().reverse();e=e.slice().reverse()}for(;++a<=s;){i.push(n(t[a-1],t[a]));o.push(r(e[a-1],e[a]))}return function(e){var n=is.bisect(t,e,1,s)-1;return o[n](i[n](e))}}function Xo(t,e,n,r){function i(){var i=Math.min(t.length,e.length)>2?Vo:qo,l=r?Vi:Bi;a=i(t,e,l,n);s=i(e,t,l,xi);return o}function o(t){return a(t)}var a,s;o.invert=function(t){return s(t)};o.domain=function(e){if(!arguments.length)return t;t=e.map(Number);return i()};o.range=function(t){if(!arguments.length)return e;e=t;return i()};o.rangeRound=function(t){return o.range(t).interpolate(Ri)};o.clamp=function(t){if(!arguments.length)return r;r=t;return i()};o.interpolate=function(t){if(!arguments.length)return n;n=t;return i()};o.ticks=function(e){return Jo(t,e)};o.tickFormat=function(e,n){return Ko(t,e,n)};o.nice=function(e){$o(t,e);return i()};o.copy=function(){return Xo(t,e,n,r)};return i()}function Go(t,e){return is.rebind(t,e,"range","rangeRound","interpolate","clamp")}function $o(t,e){return Uo(t,Bo(Yo(t,e)[2]))}function Yo(t,e){null==e&&(e=10);var n=Wo(t),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/e)/Math.LN10)),o=e/r*i;.15>=o?i*=10:.35>=o?i*=5:.75>=o&&(i*=2);n[0]=Math.ceil(n[0]/i)*i;n[1]=Math.floor(n[1]/i)*i+.5*i;n[2]=i;return n}function Jo(t,e){return is.range.apply(is,Yo(t,e))}function Ko(t,e,n){var r=Yo(t,e);if(n){var i=ll.exec(n);i.shift();if("s"===i[8]){var o=is.formatPrefix(Math.max(ms(r[0]),ms(r[1])));i[7]||(i[7]="."+Zo(o.scale(r[2])));i[8]="f";n=is.format(i.join(""));return function(t){return n(o.scale(t))+o.symbol}}i[7]||(i[7]="."+Qo(i[8],r));n=i.join("")}else n=",."+Zo(r[2])+"f";return is.format(n)}function Zo(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function Qo(t,e){var n=Zo(e[2]);return t in wu?Math.abs(n-Zo(Math.max(ms(e[0]),ms(e[1]))))+ +("e"!==t):n-2*("%"===t)}function ta(t,e,n,r){function i(t){return(n?Math.log(0>t?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function o(t){return n?Math.pow(e,t):-Math.pow(e,-t)}function a(e){return t(i(e))}a.invert=function(e){return o(t.invert(e))};a.domain=function(e){if(!arguments.length)return r;n=e[0]>=0;t.domain((r=e.map(Number)).map(i));return a};a.base=function(n){if(!arguments.length)return e;e=+n;t.domain(r.map(i));return a};a.nice=function(){var e=Uo(r.map(i),n?Math:Su);t.domain(e);r=e.map(o);return a};a.ticks=function(){var t=Wo(r),a=[],s=t[0],l=t[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),f=e%1?2:e;if(isFinite(c-u)){if(n){for(;c>u;u++)for(var h=1;f>h;h++)a.push(o(u)*h);a.push(o(u))}else{a.push(o(u));for(;u++<c;)for(var h=f-1;h>0;h--)a.push(o(u)*h)}for(u=0;a[u]<s;u++);for(c=a.length;a[c-1]>l;c--);a=a.slice(u,c)}return a};a.tickFormat=function(t,e){if(!arguments.length)return Cu;arguments.length<2?e=Cu:"function"!=typeof e&&(e=is.format(e));var r,s=Math.max(.1,t/a.ticks().length),l=n?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(t){return t/o(l(i(t)+r))<=s?e(t):""}};a.copy=function(){return ta(t.copy(),e,n,r)};return Go(a,t)}function ea(t,e,n){function r(e){return t(i(e))}var i=na(e),o=na(1/e);r.invert=function(e){return o(t.invert(e))};r.domain=function(e){if(!arguments.length)return n;t.domain((n=e.map(Number)).map(i));return r};r.ticks=function(t){return Jo(n,t)};r.tickFormat=function(t,e){return Ko(n,t,e)};r.nice=function(t){return r.domain($o(n,t))};r.exponent=function(a){if(!arguments.length)return e;i=na(e=a);o=na(1/e);t.domain(n.map(i));return r};r.copy=function(){return ea(t.copy(),e,n)};return Go(r,t)}function na(t){return function(e){return 0>e?-Math.pow(-e,t):Math.pow(e,t)}}function ra(t,e){function n(n){return o[((i.get(n)||("range"===e.t?i.set(n,t.push(n)):0/0))-1)%o.length]}function r(e,n){return is.range(t.length).map(function(t){return e+n*t
})}var i,o,a;n.domain=function(r){if(!arguments.length)return t;t=[];i=new f;for(var o,a=-1,s=r.length;++a<s;)i.has(o=r[a])||i.set(o,t.push(o));return n[e.t].apply(n,e.a)};n.range=function(t){if(!arguments.length)return o;o=t;a=0;e={t:"range",a:arguments};return n};n.rangePoints=function(i,s){arguments.length<2&&(s=0);var l=i[0],u=i[1],c=t.length<2?(l=(l+u)/2,0):(u-l)/(t.length-1+s);o=r(l+c*s/2,c);a=0;e={t:"rangePoints",a:arguments};return n};n.rangeRoundPoints=function(i,s){arguments.length<2&&(s=0);var l=i[0],u=i[1],c=t.length<2?(l=u=Math.round((l+u)/2),0):(u-l)/(t.length-1+s)|0;o=r(l+Math.round(c*s/2+(u-l-(t.length-1+s)*c)/2),c);a=0;e={t:"rangeRoundPoints",a:arguments};return n};n.rangeBands=function(i,s,l){arguments.length<2&&(s=0);arguments.length<3&&(l=s);var u=i[1]<i[0],c=i[u-0],f=i[1-u],h=(f-c)/(t.length-s+2*l);o=r(c+h*l,h);u&&o.reverse();a=h*(1-s);e={t:"rangeBands",a:arguments};return n};n.rangeRoundBands=function(i,s,l){arguments.length<2&&(s=0);arguments.length<3&&(l=s);var u=i[1]<i[0],c=i[u-0],f=i[1-u],h=Math.floor((f-c)/(t.length-s+2*l));o=r(c+Math.round((f-c-(t.length-s)*h)/2),h);u&&o.reverse();a=Math.round(h*(1-s));e={t:"rangeRoundBands",a:arguments};return n};n.rangeBand=function(){return a};n.rangeExtent=function(){return Wo(e.a[0])};n.copy=function(){return ra(t,e)};return n.domain(t)}function ia(t,e){function n(){var n=0,i=e.length;s=[];for(;++n<i;)s[n-1]=is.quantile(t,n/i);return r}function r(t){return isNaN(t=+t)?void 0:e[is.bisect(s,t)]}var s;r.domain=function(e){if(!arguments.length)return t;t=e.map(o).filter(a).sort(i);return n()};r.range=function(t){if(!arguments.length)return e;e=t;return n()};r.quantiles=function(){return s};r.invertExtent=function(n){n=e.indexOf(n);return 0>n?[0/0,0/0]:[n>0?s[n-1]:t[0],n<s.length?s[n]:t[t.length-1]]};r.copy=function(){return ia(t,e)};return n()}function oa(t,e,n){function r(e){return n[Math.max(0,Math.min(a,Math.floor(o*(e-t))))]}function i(){o=n.length/(e-t);a=n.length-1;return r}var o,a;r.domain=function(n){if(!arguments.length)return[t,e];t=+n[0];e=+n[n.length-1];return i()};r.range=function(t){if(!arguments.length)return n;n=t;return i()};r.invertExtent=function(e){e=n.indexOf(e);e=0>e?0/0:e/o+t;return[e,e+1/o]};r.copy=function(){return oa(t,e,n)};return i()}function aa(t,e){function n(n){return n>=n?e[is.bisect(t,n)]:void 0}n.domain=function(e){if(!arguments.length)return t;t=e;return n};n.range=function(t){if(!arguments.length)return e;e=t;return n};n.invertExtent=function(n){n=e.indexOf(n);return[t[n-1],t[n]]};n.copy=function(){return aa(t,e)};return n}function sa(t){function e(t){return+t}e.invert=e;e.domain=e.range=function(n){if(!arguments.length)return t;t=n.map(e);return e};e.ticks=function(e){return Jo(t,e)};e.tickFormat=function(e,n){return Ko(t,e,n)};e.copy=function(){return sa(t)};return e}function la(){return 0}function ua(t){return t.innerRadius}function ca(t){return t.outerRadius}function fa(t){return t.startAngle}function ha(t){return t.endAngle}function da(t){return t&&t.padAngle}function pa(t,e,n,r){return(t-n)*e-(e-r)*t>0?0:1}function ga(t,e,n,r,i){var o=t[0]-e[0],a=t[1]-e[1],s=(i?r:-r)/Math.sqrt(o*o+a*a),l=s*a,u=-s*o,c=t[0]+l,f=t[1]+u,h=e[0]+l,d=e[1]+u,p=(c+h)/2,g=(f+d)/2,m=h-c,v=d-f,y=m*m+v*v,b=n-r,x=c*d-h*f,w=(0>v?-1:1)*Math.sqrt(b*b*y-x*x),C=(x*v-m*w)/y,S=(-x*m-v*w)/y,T=(x*v+m*w)/y,k=(-x*m+v*w)/y,_=C-p,M=S-g,D=T-p,L=k-g;_*_+M*M>D*D+L*L&&(C=T,S=k);return[[C-l,S-u],[C*n/b,S*n/b]]}function ma(t){function e(e){function a(){u.push("M",o(t(c),s))}for(var l,u=[],c=[],f=-1,h=e.length,d=De(n),p=De(r);++f<h;)if(i.call(this,l=e[f],f))c.push([+d.call(this,l,f),+p.call(this,l,f)]);else if(c.length){a();c=[]}c.length&&a();return u.length?u.join(""):null}var n=Ar,r=Nr,i=Nn,o=va,a=o.key,s=.7;e.x=function(t){if(!arguments.length)return n;n=t;return e};e.y=function(t){if(!arguments.length)return r;r=t;return e};e.defined=function(t){if(!arguments.length)return i;i=t;return e};e.interpolate=function(t){if(!arguments.length)return a;a="function"==typeof t?o=t:(o=Lu.get(t)||va).key;return e};e.tension=function(t){if(!arguments.length)return s;s=t;return e};return e}function va(t){return t.join("L")}function ya(t){return va(t)+"Z"}function ba(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e<n;)i.push("H",(r[0]+(r=t[e])[0])/2,"V",r[1]);n>1&&i.push("H",r[0]);return i.join("")}function xa(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e<n;)i.push("V",(r=t[e])[1],"H",r[0]);return i.join("")}function wa(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e<n;)i.push("H",(r=t[e])[0],"V",r[1]);return i.join("")}function Ca(t,e){return t.length<4?va(t):t[1]+ka(t.slice(1,-1),_a(t,e))}function Sa(t,e){return t.length<3?va(t):t[0]+ka((t.push(t[0]),t),_a([t[t.length-2]].concat(t,[t[1]]),e))}function Ta(t,e){return t.length<3?va(t):t[0]+ka(t,_a(t,e))}function ka(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return va(t);var n=t.length!=e.length,r="",i=t[0],o=t[1],a=e[0],s=a,l=1;if(n){r+="Q"+(o[0]-2*a[0]/3)+","+(o[1]-2*a[1]/3)+","+o[0]+","+o[1];i=t[1];l=2}if(e.length>1){s=e[1];o=t[l];l++;r+="C"+(i[0]+a[0])+","+(i[1]+a[1])+","+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1];for(var u=2;u<e.length;u++,l++){o=t[l];s=e[u];r+="S"+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1]}}if(n){var c=t[l];r+="Q"+(o[0]+2*s[0]/3)+","+(o[1]+2*s[1]/3)+","+c[0]+","+c[1]}return r}function _a(t,e){for(var n,r=[],i=(1-e)/2,o=t[0],a=t[1],s=1,l=t.length;++s<l;){n=o;o=a;a=t[s];r.push([i*(a[0]-n[0]),i*(a[1]-n[1])])}return r}function Ma(t){if(t.length<3)return va(t);var e=1,n=t.length,r=t[0],i=r[0],o=r[1],a=[i,i,i,(r=t[1])[0]],s=[o,o,o,r[1]],l=[i,",",o,"L",Na(Eu,a),",",Na(Eu,s)];t.push(t[n-1]);for(;++e<=n;){r=t[e];a.shift();a.push(r[0]);s.shift();s.push(r[1]);Ea(l,a,s)}t.pop();l.push("L",r);return l.join("")}function Da(t){if(t.length<4)return va(t);for(var e,n=[],r=-1,i=t.length,o=[0],a=[0];++r<3;){e=t[r];o.push(e[0]);a.push(e[1])}n.push(Na(Eu,o)+","+Na(Eu,a));--r;for(;++r<i;){e=t[r];o.shift();o.push(e[0]);a.shift();a.push(e[1]);Ea(n,o,a)}return n.join("")}function La(t){for(var e,n,r=-1,i=t.length,o=i+4,a=[],s=[];++r<4;){n=t[r%i];a.push(n[0]);s.push(n[1])}e=[Na(Eu,a),",",Na(Eu,s)];--r;for(;++r<o;){n=t[r%i];a.shift();a.push(n[0]);s.shift();s.push(n[1]);Ea(e,a,s)}return e.join("")}function Aa(t,e){var n=t.length-1;if(n)for(var r,i,o=t[0][0],a=t[0][1],s=t[n][0]-o,l=t[n][1]-a,u=-1;++u<=n;){r=t[u];i=u/n;r[0]=e*r[0]+(1-e)*(o+i*s);r[1]=e*r[1]+(1-e)*(a+i*l)}return Ma(t)}function Na(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Ea(t,e,n){t.push("C",Na(Au,e),",",Na(Au,n),",",Na(Nu,e),",",Na(Nu,n),",",Na(Eu,e),",",Na(Eu,n))}function ja(t,e){return(e[1]-t[1])/(e[0]-t[0])}function Pa(t){for(var e=0,n=t.length-1,r=[],i=t[0],o=t[1],a=r[0]=ja(i,o);++e<n;)r[e]=(a+(a=ja(i=o,o=t[e+1])))/2;r[e]=a;return r}function Ia(t){for(var e,n,r,i,o=[],a=Pa(t),s=-1,l=t.length-1;++s<l;){e=ja(t[s],t[s+1]);if(ms(e)<Es)a[s]=a[s+1]=0;else{n=a[s]/e;r=a[s+1]/e;i=n*n+r*r;if(i>9){i=3*e/Math.sqrt(i);a[s]=i*n;a[s+1]=i*r}}}s=-1;for(;++s<=l;){i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+a[s]*a[s]));o.push([i||0,a[s]*i||0])}return o}function Ha(t){return t.length<3?va(t):t[0]+ka(t,Ia(t))}function Oa(t){for(var e,n,r,i=-1,o=t.length;++i<o;){e=t[i];n=e[0];r=e[1]-Os;e[0]=n*Math.cos(r);e[1]=n*Math.sin(r)}return t}function Ra(t){function e(e){function l(){g.push("M",s(t(v),f),c,u(t(m.reverse()),f),"Z")}for(var h,d,p,g=[],m=[],v=[],y=-1,b=e.length,x=De(n),w=De(i),C=n===r?function(){return d}:De(r),S=i===o?function(){return p}:De(o);++y<b;)if(a.call(this,h=e[y],y)){m.push([d=+x.call(this,h,y),p=+w.call(this,h,y)]);v.push([+C.call(this,h,y),+S.call(this,h,y)])}else if(m.length){l();m=[];v=[]}m.length&&l();return g.length?g.join(""):null}var n=Ar,r=Ar,i=0,o=Nr,a=Nn,s=va,l=s.key,u=s,c="L",f=.7;e.x=function(t){if(!arguments.length)return r;n=r=t;return e};e.x0=function(t){if(!arguments.length)return n;n=t;return e};e.x1=function(t){if(!arguments.length)return r;r=t;return e};e.y=function(t){if(!arguments.length)return o;i=o=t;return e};e.y0=function(t){if(!arguments.length)return i;i=t;return e};e.y1=function(t){if(!arguments.length)return o;o=t;return e};e.defined=function(t){if(!arguments.length)return a;a=t;return e};e.interpolate=function(t){if(!arguments.length)return l;l="function"==typeof t?s=t:(s=Lu.get(t)||va).key;u=s.reverse||s;c=s.closed?"M":"L";return e};e.tension=function(t){if(!arguments.length)return f;f=t;return e};return e}function Fa(t){return t.radius}function Wa(t){return[t.x,t.y]}function za(t){return function(){var e=t.apply(this,arguments),n=e[0],r=e[1]-Os;return[n*Math.cos(r),n*Math.sin(r)]}}function qa(){return 64}function Ua(){return"circle"}function Ba(t){var e=Math.sqrt(t/Ps);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}function Va(t){return function(){var e,n;if((e=this[t])&&(n=e[e.active])){--e.count?delete e[e.active]:delete this[t];e.active+=.5;n.event&&n.event.interrupt.call(this,this.__data__,n.index)}}}function Xa(t,e,n){ws(t,Fu);t.namespace=e;t.id=n;return t}function Ga(t,e,n,r){var i=t.id,o=t.namespace;return V(t,"function"==typeof n?function(t,a,s){t[o][i].tween.set(e,r(n.call(t,t.__data__,a,s)))}:(n=r(n),function(t){t[o][i].tween.set(e,n)}))}function $a(t){null==t&&(t="");return function(){this.textContent=t}}function Ya(t){return null==t?"__transition__":"__transition_"+t+"__"}function Ja(t,e,n,r,i){var o=t[n]||(t[n]={active:0,count:0}),a=o[r];if(!a){var s=i.time;a=o[r]={tween:new f,time:s,delay:i.delay,duration:i.duration,ease:i.ease,index:e};i=null;++o.count;is.timer(function(i){function l(n){if(o.active>r)return c();var i=o[o.active];if(i){--o.count;delete o[o.active];i.event&&i.event.interrupt.call(t,t.__data__,i.index)}o.active=r;a.event&&a.event.start.call(t,t.__data__,e);a.tween.forEach(function(n,r){(r=r.call(t,t.__data__,e))&&g.push(r)});h=a.ease;f=a.duration;is.timer(function(){p.c=u(n||1)?Nn:u;return 1},0,s)}function u(n){if(o.active!==r)return 1;for(var i=n/f,s=h(i),l=g.length;l>0;)g[--l].call(t,s);if(i>=1){a.event&&a.event.end.call(t,t.__data__,e);return c()}}function c(){--o.count?delete o[r]:delete t[n];return 1}var f,h,d=a.delay,p=ol,g=[];p.t=d+s;if(i>=d)return l(i-d);p.c=l;return void 0},0,s)}}function Ka(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate("+(isFinite(r)?r:n(t))+",0)"})}function Za(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate(0,"+(isFinite(r)?r:n(t))+")"})}function Qa(t){return t.toISOString()}function ts(t,e,n){function r(e){return t(e)}function i(t,n){var r=t[1]-t[0],i=r/n,o=is.bisect($u,i);return o==$u.length?[e.year,Yo(t.map(function(t){return t/31536e6}),n)[2]]:o?e[i/$u[o-1]<$u[o]/i?o-1:o]:[Ku,Yo(t,n)[2]]}r.invert=function(e){return es(t.invert(e))};r.domain=function(e){if(!arguments.length)return t.domain().map(es);t.domain(e);return r};r.nice=function(t,e){function n(n){return!isNaN(n)&&!t.range(n,es(+n+1),e).length}var o=r.domain(),a=Wo(o),s=null==t?i(a,10):"number"==typeof t&&i(a,t);s&&(t=s[0],e=s[1]);return r.domain(Uo(o,e>1?{floor:function(e){for(;n(e=t.floor(e));)e=es(e-1);return e},ceil:function(e){for(;n(e=t.ceil(e));)e=es(+e+1);return e}}:t))};r.ticks=function(t,e){var n=Wo(r.domain()),o=null==t?i(n,10):"number"==typeof t?i(n,t):!t.range&&[{range:t},e];o&&(t=o[0],e=o[1]);return t.range(n[0],es(+n[1]+1),1>e?1:e)};r.tickFormat=function(){return n};r.copy=function(){return ts(t.copy(),e,n)};return Go(r,t)}function es(t){return new Date(t)}function ns(t){return JSON.parse(t.responseText)}function rs(t){var e=ss.createRange();e.selectNode(ss.body);return e.createContextualFragment(t.responseText)}var is={version:"3.5.5"},os=[].slice,as=function(t){return os.call(t)},ss=this.document;if(ss)try{as(ss.documentElement.childNodes)[0].nodeType}catch(ls){as=function(t){for(var e=t.length,n=new Array(e);e--;)n[e]=t[e];return n}}Date.now||(Date.now=function(){return+new Date});if(ss)try{ss.createElement("DIV").style.setProperty("opacity",0,"")}catch(us){var cs=this.Element.prototype,fs=cs.setAttribute,hs=cs.setAttributeNS,ds=this.CSSStyleDeclaration.prototype,ps=ds.setProperty;cs.setAttribute=function(t,e){fs.call(this,t,e+"")};cs.setAttributeNS=function(t,e,n){hs.call(this,t,e,n+"")};ds.setProperty=function(t,e,n){ps.call(this,t,e+"",n)}}is.ascending=i;is.descending=function(t,e){return t>e?-1:e>t?1:e>=t?0:0/0};is.min=function(t,e){var n,r,i=-1,o=t.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=t[i])&&r>=r){n=r;break}for(;++i<o;)null!=(r=t[i])&&n>r&&(n=r)}else{for(;++i<o;)if(null!=(r=e.call(t,t[i],i))&&r>=r){n=r;break}for(;++i<o;)null!=(r=e.call(t,t[i],i))&&n>r&&(n=r)}return n};is.max=function(t,e){var n,r,i=-1,o=t.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=t[i])&&r>=r){n=r;break}for(;++i<o;)null!=(r=t[i])&&r>n&&(n=r)}else{for(;++i<o;)if(null!=(r=e.call(t,t[i],i))&&r>=r){n=r;break}for(;++i<o;)null!=(r=e.call(t,t[i],i))&&r>n&&(n=r)}return n};is.extent=function(t,e){var n,r,i,o=-1,a=t.length;if(1===arguments.length){for(;++o<a;)if(null!=(r=t[o])&&r>=r){n=i=r;break}for(;++o<a;)if(null!=(r=t[o])){n>r&&(n=r);r>i&&(i=r)}}else{for(;++o<a;)if(null!=(r=e.call(t,t[o],o))&&r>=r){n=i=r;break}for(;++o<a;)if(null!=(r=e.call(t,t[o],o))){n>r&&(n=r);r>i&&(i=r)}}return[n,i]};is.sum=function(t,e){var n,r=0,i=t.length,o=-1;if(1===arguments.length)for(;++o<i;)a(n=+t[o])&&(r+=n);else for(;++o<i;)a(n=+e.call(t,t[o],o))&&(r+=n);return r};is.mean=function(t,e){var n,r=0,i=t.length,s=-1,l=i;if(1===arguments.length)for(;++s<i;)a(n=o(t[s]))?r+=n:--l;else for(;++s<i;)a(n=o(e.call(t,t[s],s)))?r+=n:--l;return l?r/l:void 0};is.quantile=function(t,e){var n=(t.length-1)*e+1,r=Math.floor(n),i=+t[r-1],o=n-r;return o?i+o*(t[r]-i):i};is.median=function(t,e){var n,r=[],s=t.length,l=-1;if(1===arguments.length)for(;++l<s;)a(n=o(t[l]))&&r.push(n);else for(;++l<s;)a(n=o(e.call(t,t[l],l)))&&r.push(n);return r.length?is.quantile(r.sort(i),.5):void 0};is.variance=function(t,e){var n,r,i=t.length,s=0,l=0,u=-1,c=0;if(1===arguments.length){for(;++u<i;)if(a(n=o(t[u]))){r=n-s;s+=r/++c;l+=r*(n-s)}}else for(;++u<i;)if(a(n=o(e.call(t,t[u],u)))){r=n-s;s+=r/++c;l+=r*(n-s)}return c>1?l/(c-1):void 0};is.deviation=function(){var t=is.variance.apply(this,arguments);return t?Math.sqrt(t):t};var gs=s(i);is.bisectLeft=gs.left;is.bisect=is.bisectRight=gs.right;is.bisector=function(t){return s(1===t.length?function(e,n){return i(t(e),n)}:t)};is.shuffle=function(t,e,n){if((o=arguments.length)<3){n=t.length;2>o&&(e=0)}for(var r,i,o=n-e;o;){i=Math.random()*o--|0;r=t[o+e],t[o+e]=t[i+e],t[i+e]=r}return t};is.permute=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r};is.pairs=function(t){for(var e,n=0,r=t.length-1,i=t[0],o=new Array(0>r?0:r);r>n;)o[n]=[e=i,i=t[++n]];return o};is.zip=function(){if(!(r=arguments.length))return[];for(var t=-1,e=is.min(arguments,l),n=new Array(e);++t<e;)for(var r,i=-1,o=n[t]=new Array(r);++i<r;)o[i]=arguments[i][t];return n};is.transpose=function(t){return is.zip.apply(is,t)};is.keys=function(t){var e=[];for(var n in t)e.push(n);return e};is.values=function(t){var e=[];for(var n in t)e.push(t[n]);return e};is.entries=function(t){var e=[];for(var n in t)e.push({key:n,value:t[n]});return e};is.merge=function(t){for(var e,n,r,i=t.length,o=-1,a=0;++o<i;)a+=t[o].length;n=new Array(a);for(;--i>=0;){r=t[i];e=r.length;for(;--e>=0;)n[--a]=r[e]}return n};var ms=Math.abs;is.range=function(t,e,n){if(arguments.length<3){n=1;if(arguments.length<2){e=t;t=0}}if((e-t)/n===1/0)throw new Error("infinite range");var r,i=[],o=u(ms(n)),a=-1;t*=o,e*=o,n*=o;if(0>n)for(;(r=t+n*++a)>e;)i.push(r/o);else for(;(r=t+n*++a)<e;)i.push(r/o);return i};is.map=function(t,e){var n=new f;if(t instanceof f)t.forEach(function(t,e){n.set(t,e)});else if(Array.isArray(t)){var r,i=-1,o=t.length;if(1===arguments.length)for(;++i<o;)n.set(i,t[i]);else for(;++i<o;)n.set(e.call(t,r=t[i],i),r)}else for(var a in t)n.set(a,t[a]);return n};var vs="__proto__",ys="\x00";c(f,{has:p,get:function(t){return this._[h(t)]},set:function(t,e){return this._[h(t)]=e},remove:g,keys:m,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:d(e),value:this._[e]});return t},size:v,empty:y,forEach:function(t){for(var e in this._)t.call(this,d(e),this._[e])}});is.nest=function(){function t(e,a,s){if(s>=o.length)return r?r.call(i,a):n?a.sort(n):a;for(var l,u,c,h,d=-1,p=a.length,g=o[s++],m=new f;++d<p;)(h=m.get(l=g(u=a[d])))?h.push(u):m.set(l,[u]);if(e){u=e();c=function(n,r){u.set(n,t(e,r,s))}}else{u={};c=function(n,r){u[n]=t(e,r,s)}}m.forEach(c);return u}function e(t,n){if(n>=o.length)return t;var r=[],i=a[n++];t.forEach(function(t,i){r.push({key:t,values:e(i,n)})});return i?r.sort(function(t,e){return i(t.key,e.key)}):r}var n,r,i={},o=[],a=[];i.map=function(e,n){return t(n,e,0)};i.entries=function(n){return e(t(is.map,n,0),0)};i.key=function(t){o.push(t);return i};i.sortKeys=function(t){a[o.length-1]=t;return i};i.sortValues=function(t){n=t;return i};i.rollup=function(t){r=t;return i};return i};is.set=function(t){var e=new b;if(t)for(var n=0,r=t.length;r>n;++n)e.add(t[n]);return e};c(b,{has:p,add:function(t){this._[h(t+="")]=!0;return t},remove:g,values:m,size:v,empty:y,forEach:function(t){for(var e in this._)t.call(this,d(e))}});is.behavior={};is.rebind=function(t,e){for(var n,r=1,i=arguments.length;++r<i;)t[n=arguments[r]]=w(t,e,e[n]);return t};var bs=["webkit","ms","moz","Moz","o","O"];is.dispatch=function(){for(var t=new T,e=-1,n=arguments.length;++e<n;)t[arguments[e]]=k(t);return t};T.prototype.on=function(t,e){var n=t.indexOf("."),r="";if(n>=0){r=t.slice(n+1);t=t.slice(0,n)}if(t)return arguments.length<2?this[t].on(r):this[t].on(r,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(r,null);return this}};is.event=null;is.requote=function(t){return t.replace(xs,"\\$&")};var xs=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ws={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]},Cs=function(t,e){return e.querySelector(t)},Ss=function(t,e){return e.querySelectorAll(t)},Ts=function(t,e){var n=t.matches||t[C(t,"matchesSelector")];Ts=function(t,e){return n.call(t,e)};return Ts(t,e)};if("function"==typeof Sizzle){Cs=function(t,e){return Sizzle(t,e)[0]||null};Ss=Sizzle;Ts=Sizzle.matchesSelector}is.selection=function(){return is.select(ss.documentElement)};var ks=is.selection.prototype=[];ks.select=function(t){var e,n,r,i,o=[];t=A(t);for(var a=-1,s=this.length;++a<s;){o.push(e=[]);e.parentNode=(r=this[a]).parentNode;for(var l=-1,u=r.length;++l<u;)if(i=r[l]){e.push(n=t.call(i,i.__data__,l,a));n&&"__data__"in i&&(n.__data__=i.__data__)}else e.push(null)}return L(o)};ks.selectAll=function(t){var e,n,r=[];t=N(t);for(var i=-1,o=this.length;++i<o;)for(var a=this[i],s=-1,l=a.length;++s<l;)if(n=a[s]){r.push(e=as(t.call(n,n.__data__,s,i)));e.parentNode=n}return L(r)};var _s={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};is.ns={prefix:_s,qualify:function(t){var e=t.indexOf(":"),n=t;if(e>=0){n=t.slice(0,e);t=t.slice(e+1)}return _s.hasOwnProperty(n)?{space:_s[n],local:t}:t}};ks.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node();t=is.ns.qualify(t);return t.local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(e in t)this.each(E(e,t[e]));return this}return this.each(E(t,e))};ks.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node(),r=(t=I(t)).length,i=-1;if(e=n.classList){for(;++i<r;)if(!e.contains(t[i]))return!1}else{e=n.getAttribute("class");for(;++i<r;)if(!P(t[i]).test(e))return!1}return!0}for(e in t)this.each(H(e,t[e]));return this}return this.each(H(t,e))};ks.style=function(t,e,n){var i=arguments.length;if(3>i){if("string"!=typeof t){2>i&&(e="");for(n in t)this.each(R(n,t[n],e));return this}if(2>i){var o=this.node();return r(o).getComputedStyle(o,null).getPropertyValue(t)}n=""}return this.each(R(t,e,n))};ks.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(F(e,t[e]));return this}return this.each(F(t,e))};ks.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent};ks.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML};ks.append=function(t){t=W(t);return this.select(function(){return this.appendChild(t.apply(this,arguments))})};ks.insert=function(t,e){t=W(t);e=A(e);return this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})};ks.remove=function(){return this.each(z)};ks.data=function(t,e){function n(t,n){var r,i,o,a=t.length,c=n.length,h=Math.min(a,c),d=new Array(c),p=new Array(c),g=new Array(a);if(e){var m,v=new f,y=new Array(a);for(r=-1;++r<a;){v.has(m=e.call(i=t[r],i.__data__,r))?g[r]=i:v.set(m,i);y[r]=m}for(r=-1;++r<c;){if(i=v.get(m=e.call(n,o=n[r],r))){if(i!==!0){d[r]=i;i.__data__=o}}else p[r]=q(o);v.set(m,!0)}for(r=-1;++r<a;)v.get(y[r])!==!0&&(g[r]=t[r])}else{for(r=-1;++r<h;){i=t[r];o=n[r];if(i){i.__data__=o;d[r]=i}else p[r]=q(o)}for(;c>r;++r)p[r]=q(n[r]);for(;a>r;++r)g[r]=t[r]}p.update=d;p.parentNode=d.parentNode=g.parentNode=t.parentNode;s.push(p);l.push(d);u.push(g)}var r,i,o=-1,a=this.length;if(!arguments.length){t=new Array(a=(r=this[0]).length);for(;++o<a;)(i=r[o])&&(t[o]=i.__data__);return t}var s=X([]),l=L([]),u=L([]);if("function"==typeof t)for(;++o<a;)n(r=this[o],t.call(r,r.parentNode.__data__,o));else for(;++o<a;)n(r=this[o],t);l.enter=function(){return s};l.exit=function(){return u};return l};ks.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")};ks.filter=function(t){var e,n,r,i=[];"function"!=typeof t&&(t=U(t));for(var o=0,a=this.length;a>o;o++){i.push(e=[]);e.parentNode=(n=this[o]).parentNode;for(var s=0,l=n.length;l>s;s++)(r=n[s])&&t.call(r,r.__data__,s,o)&&e.push(r)}return L(i)};ks.order=function(){for(var t=-1,e=this.length;++t<e;)for(var n,r=this[t],i=r.length-1,o=r[i];--i>=0;)if(n=r[i]){o&&o!==n.nextSibling&&o.parentNode.insertBefore(n,o);o=n}return this};ks.sort=function(t){t=B.apply(this,arguments);for(var e=-1,n=this.length;++e<n;)this[e].sort(t);return this.order()};ks.each=function(t){return V(this,function(e,n,r){t.call(e,e.__data__,n,r)})};ks.call=function(t){var e=as(arguments);t.apply(e[0]=this,e);return this};ks.empty=function(){return!this.node()};ks.node=function(){for(var t=0,e=this.length;e>t;t++)for(var n=this[t],r=0,i=n.length;i>r;r++){var o=n[r];if(o)return o}return null};ks.size=function(){var t=0;V(this,function(){++t});return t};var Ms=[];is.selection.enter=X;is.selection.enter.prototype=Ms;Ms.append=ks.append;Ms.empty=ks.empty;Ms.node=ks.node;Ms.call=ks.call;Ms.size=ks.size;Ms.select=function(t){for(var e,n,r,i,o,a=[],s=-1,l=this.length;++s<l;){r=(i=this[s]).update;a.push(e=[]);e.parentNode=i.parentNode;for(var u=-1,c=i.length;++u<c;)if(o=i[u]){e.push(r[u]=n=t.call(i.parentNode,o.__data__,u,s));n.__data__=o.__data__}else e.push(null)}return L(a)};Ms.insert=function(t,e){arguments.length<2&&(e=G(this));return ks.insert.call(this,t,e)};is.select=function(t){var n;if("string"==typeof t){n=[Cs(t,ss)];n.parentNode=ss.documentElement}else{n=[t];n.parentNode=e(t)}return L([n])};is.selectAll=function(t){var e;if("string"==typeof t){e=as(Ss(t,ss));e.parentNode=ss.documentElement}else{e=t;e.parentNode=null}return L([e])};ks.on=function(t,e,n){var r=arguments.length;if(3>r){if("string"!=typeof t){2>r&&(e=!1);for(n in t)this.each($(n,t[n],e));return this}if(2>r)return(r=this.node()["__on"+t])&&r._;n=!1}return this.each($(t,e,n))};var Ds=is.map({mouseenter:"mouseover",mouseleave:"mouseout"});ss&&Ds.forEach(function(t){"on"+t in ss&&Ds.remove(t)});var Ls,As=0;is.mouse=function(t){return Z(t,M())};var Ns=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;is.touch=function(t,e,n){arguments.length<3&&(n=e,e=M().changedTouches);if(e)for(var r,i=0,o=e.length;o>i;++i)if((r=e[i]).identifier===n)return Z(t,r)};is.behavior.drag=function(){function t(){this.on("mousedown.drag",o).on("touchstart.drag",a)}function e(t,e,r,o,a){return function(){function s(){var t,n,r=e(h,g);if(r){t=r[0]-b[0];n=r[1]-b[1];p|=t|n;b=r;d({type:"drag",x:r[0]+u[0],y:r[1]+u[1],dx:t,dy:n})}}function l(){if(e(h,g)){v.on(o+m,null).on(a+m,null);y(p&&is.event.target===f);d({type:"dragend"})}}var u,c=this,f=is.event.target,h=c.parentNode,d=n.of(c,arguments),p=0,g=t(),m=".drag"+(null==g?"":"-"+g),v=is.select(r(f)).on(o+m,s).on(a+m,l),y=K(f),b=e(h,g);if(i){u=i.apply(c,arguments);u=[u.x-b[0],u.y-b[1]]}else u=[0,0];d({type:"dragstart"})}}var n=D(t,"drag","dragstart","dragend"),i=null,o=e(S,is.mouse,r,"mousemove","mouseup"),a=e(Q,is.touch,x,"touchmove","touchend");t.origin=function(e){if(!arguments.length)return i;i=e;return t};return is.rebind(t,n,"on")};is.touches=function(t,e){arguments.length<2&&(e=M().touches);return e?as(e).map(function(e){var n=Z(t,e);n.identifier=e.identifier;return n}):[]};var Es=1e-6,js=Es*Es,Ps=Math.PI,Is=2*Ps,Hs=Is-Es,Os=Ps/2,Rs=Ps/180,Fs=180/Ps,Ws=Math.SQRT2,zs=2,qs=4;is.interpolateZoom=function(t,e){function n(t){var e=t*y;if(v){var n=oe(g),a=o/(zs*h)*(n*ae(Ws*e+g)-ie(g));return[r+a*u,i+a*c,o*n/oe(Ws*e+g)]}return[r+t*u,i+t*c,o*Math.exp(Ws*e)]}var r=t[0],i=t[1],o=t[2],a=e[0],s=e[1],l=e[2],u=a-r,c=s-i,f=u*u+c*c,h=Math.sqrt(f),d=(l*l-o*o+qs*f)/(2*o*zs*h),p=(l*l-o*o-qs*f)/(2*l*zs*h),g=Math.log(Math.sqrt(d*d+1)-d),m=Math.log(Math.sqrt(p*p+1)-p),v=m-g,y=(v||Math.log(l/o))/Ws;n.duration=1e3*y;return n};is.behavior.zoom=function(){function t(t){t.on(N,f).on(Bs+".zoom",d).on("dblclick.zoom",p).on(P,h)}function e(t){return[(t[0]-T.x)/T.k,(t[1]-T.y)/T.k]}function n(t){return[t[0]*T.k+T.x,t[1]*T.k+T.y]}function i(t){T.k=Math.max(M[0],Math.min(M[1],t))}function o(t,e){e=n(e);T.x+=t[0]-e[0];T.y+=t[1]-e[1]}function a(e,n,r,a){e.__chart__={x:T.x,y:T.y,k:T.k};i(Math.pow(2,a));o(m=n,r);e=is.select(e);L>0&&(e=e.transition().duration(L));e.call(t.event)}function s(){w&&w.domain(x.range().map(function(t){return(t-T.x)/T.k}).map(x.invert));S&&S.domain(C.range().map(function(t){return(t-T.y)/T.k}).map(C.invert))}function l(t){A++||t({type:"zoomstart"})}function u(t){s();t({type:"zoom",scale:T.k,translate:[T.x,T.y]})}function c(t){--A||t({type:"zoomend"});m=null}function f(){function t(){f=1;o(is.mouse(i),d);u(s)}function n(){h.on(E,null).on(j,null);p(f&&is.event.target===a);c(s)}var i=this,a=is.event.target,s=I.of(i,arguments),f=0,h=is.select(r(i)).on(E,t).on(j,n),d=e(is.mouse(i)),p=K(i);Ru.call(i);l(s)}function h(){function t(){var t=is.touches(p);d=T.k;t.forEach(function(t){t.identifier in m&&(m[t.identifier]=e(t))});return t}function n(){var e=is.event.target;is.select(e).on(x,r).on(w,s);C.push(e);for(var n=is.event.changedTouches,i=0,o=n.length;o>i;++i)m[n[i].identifier]=null;var l=t(),u=Date.now();if(1===l.length){if(500>u-b){var c=l[0];a(p,c,m[c.identifier],Math.floor(Math.log(T.k)/Math.LN2)+1);_()}b=u}else if(l.length>1){var c=l[0],f=l[1],h=c[0]-f[0],d=c[1]-f[1];v=h*h+d*d}}function r(){var t,e,n,r,a=is.touches(p);Ru.call(p);for(var s=0,l=a.length;l>s;++s,r=null){n=a[s];if(r=m[n.identifier]){if(e)break;t=n,e=r}}if(r){var c=(c=n[0]-t[0])*c+(c=n[1]-t[1])*c,f=v&&Math.sqrt(c/v);t=[(t[0]+n[0])/2,(t[1]+n[1])/2];e=[(e[0]+r[0])/2,(e[1]+r[1])/2];i(f*d)}b=null;o(t,e);u(g)}function s(){if(is.event.touches.length){for(var e=is.event.changedTouches,n=0,r=e.length;r>n;++n)delete m[e[n].identifier];for(var i in m)return void t()}is.selectAll(C).on(y,null);S.on(N,f).on(P,h);k();c(g)}var d,p=this,g=I.of(p,arguments),m={},v=0,y=".zoom-"+is.event.changedTouches[0].identifier,x="touchmove"+y,w="touchend"+y,C=[],S=is.select(p),k=K(p);n();l(g);S.on(N,null).on(P,n)}function d(){var t=I.of(this,arguments);y?clearTimeout(y):(g=e(m=v||is.mouse(this)),Ru.call(this),l(t));y=setTimeout(function(){y=null;c(t)},50);_();i(Math.pow(2,.002*Us())*T.k);o(m,g);u(t)}function p(){var t=is.mouse(this),n=Math.log(T.k)/Math.LN2;a(this,t,e(t),is.event.shiftKey?Math.ceil(n)-1:Math.floor(n)+1)}var g,m,v,y,b,x,w,C,S,T={x:0,y:0,k:1},k=[960,500],M=Vs,L=250,A=0,N="mousedown.zoom",E="mousemove.zoom",j="mouseup.zoom",P="touchstart.zoom",I=D(t,"zoomstart","zoom","zoomend");Bs||(Bs="onwheel"in ss?(Us=function(){return-is.event.deltaY*(is.event.deltaMode?120:1)},"wheel"):"onmousewheel"in ss?(Us=function(){return is.event.wheelDelta},"mousewheel"):(Us=function(){return-is.event.detail},"MozMousePixelScroll"));t.event=function(t){t.each(function(){var t=I.of(this,arguments),e=T;if(Hu)is.select(this).transition().each("start.zoom",function(){T=this.__chart__||{x:0,y:0,k:1};l(t)}).tween("zoom:zoom",function(){var n=k[0],r=k[1],i=m?m[0]:n/2,o=m?m[1]:r/2,a=is.interpolateZoom([(i-T.x)/T.k,(o-T.y)/T.k,n/T.k],[(i-e.x)/e.k,(o-e.y)/e.k,n/e.k]);return function(e){var r=a(e),s=n/r[2];this.__chart__=T={x:i-r[0]*s,y:o-r[1]*s,k:s};u(t)}}).each("interrupt.zoom",function(){c(t)}).each("end.zoom",function(){c(t)});else{this.__chart__=T;l(t);u(t);c(t)}})};t.translate=function(e){if(!arguments.length)return[T.x,T.y];T={x:+e[0],y:+e[1],k:T.k};s();return t};t.scale=function(e){if(!arguments.length)return T.k;T={x:T.x,y:T.y,k:+e};s();return t};t.scaleExtent=function(e){if(!arguments.length)return M;M=null==e?Vs:[+e[0],+e[1]];return t};t.center=function(e){if(!arguments.length)return v;v=e&&[+e[0],+e[1]];return t};t.size=function(e){if(!arguments.length)return k;k=e&&[+e[0],+e[1]];return t};t.duration=function(e){if(!arguments.length)return L;L=+e;return t};t.x=function(e){if(!arguments.length)return w;w=e;x=e.copy();T={x:0,y:0,k:1};return t};t.y=function(e){if(!arguments.length)return S;S=e;C=e.copy();T={x:0,y:0,k:1};return t};return is.rebind(t,I,"on")};var Us,Bs,Vs=[0,1/0];is.color=le;le.prototype.toString=function(){return this.rgb()+""};is.hsl=ue;var Xs=ue.prototype=new le;Xs.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);return new ue(this.h,this.s,this.l/t)};Xs.darker=function(t){t=Math.pow(.7,arguments.length?t:1);return new ue(this.h,this.s,t*this.l)};Xs.rgb=function(){return ce(this.h,this.s,this.l)};is.hcl=fe;var Gs=fe.prototype=new le;Gs.brighter=function(t){return new fe(this.h,this.c,Math.min(100,this.l+$s*(arguments.length?t:1)))};Gs.darker=function(t){return new fe(this.h,this.c,Math.max(0,this.l-$s*(arguments.length?t:1)))};Gs.rgb=function(){return he(this.h,this.c,this.l).rgb()};is.lab=de;var $s=18,Ys=.95047,Js=1,Ks=1.08883,Zs=de.prototype=new le;Zs.brighter=function(t){return new de(Math.min(100,this.l+$s*(arguments.length?t:1)),this.a,this.b)};Zs.darker=function(t){return new de(Math.max(0,this.l-$s*(arguments.length?t:1)),this.a,this.b)};Zs.rgb=function(){return pe(this.l,this.a,this.b)};is.rgb=be;var Qs=be.prototype=new le;Qs.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,n=this.g,r=this.b,i=30;if(!e&&!n&&!r)return new be(i,i,i);e&&i>e&&(e=i);n&&i>n&&(n=i);r&&i>r&&(r=i);return new be(Math.min(255,e/t),Math.min(255,n/t),Math.min(255,r/t))};Qs.darker=function(t){t=Math.pow(.7,arguments.length?t:1);return new be(t*this.r,t*this.g,t*this.b)};Qs.hsl=function(){return Te(this.r,this.g,this.b)};Qs.toString=function(){return"#"+Ce(this.r)+Ce(this.g)+Ce(this.b)};var tl=is.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});
tl.forEach(function(t,e){tl.set(t,xe(e))});is.functor=De;is.xhr=Le(x);is.dsv=function(t,e){function n(t,n,o){arguments.length<3&&(o=n,n=null);var a=Ae(t,e,null==n?r:i(n),o);a.row=function(t){return arguments.length?a.response(null==(n=t)?r:i(t)):n};return a}function r(t){return n.parse(t.responseText)}function i(t){return function(e){return n.parse(e.responseText,t)}}function o(e){return e.map(a).join(t)}function a(t){return s.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var s=new RegExp('["'+t+"\n]"),l=t.charCodeAt(0);n.parse=function(t,e){var r;return n.parseRows(t,function(t,n){if(r)return r(t,n-1);var i=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");r=e?function(t,n){return e(i(t),n)}:i})};n.parseRows=function(t,e){function n(){if(c>=u)return a;if(i)return i=!1,o;var e=c;if(34===t.charCodeAt(e)){for(var n=e;n++<u;)if(34===t.charCodeAt(n)){if(34!==t.charCodeAt(n+1))break;++n}c=n+2;var r=t.charCodeAt(n+1);if(13===r){i=!0;10===t.charCodeAt(n+2)&&++c}else 10===r&&(i=!0);return t.slice(e+1,n).replace(/""/g,'"')}for(;u>c;){var r=t.charCodeAt(c++),s=1;if(10===r)i=!0;else if(13===r){i=!0;10===t.charCodeAt(c)&&(++c,++s)}else if(r!==l)continue;return t.slice(e,c-s)}return t.slice(e)}for(var r,i,o={},a={},s=[],u=t.length,c=0,f=0;(r=n())!==a;){for(var h=[];r!==o&&r!==a;){h.push(r);r=n()}e&&null==(h=e(h,f++))||s.push(h)}return s};n.format=function(e){if(Array.isArray(e[0]))return n.formatRows(e);var r=new b,i=[];e.forEach(function(t){for(var e in t)r.has(e)||i.push(r.add(e))});return[i.map(a).join(t)].concat(e.map(function(e){return i.map(function(t){return a(e[t])}).join(t)})).join("\n")};n.formatRows=function(t){return t.map(o).join("\n")};return n};is.csv=is.dsv(",","text/csv");is.tsv=is.dsv(" ","text/tab-separated-values");var el,nl,rl,il,ol,al=this[C(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};is.timer=function(t,e,n){var r=arguments.length;2>r&&(e=0);3>r&&(n=Date.now());var i=n+e,o={c:t,t:i,f:!1,n:null};nl?nl.n=o:el=o;nl=o;if(!rl){il=clearTimeout(il);rl=1;al(je)}};is.timer.flush=function(){Pe();Ie()};is.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var sl=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Oe);is.formatPrefix=function(t,e){var n=0;if(t){0>t&&(t*=-1);e&&(t=is.round(t,He(t,e)));n=1+Math.floor(1e-12+Math.log(t)/Math.LN10);n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))}return sl[8+n/3]};var ll=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,ul=is.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=is.round(t,He(t,e))).toFixed(Math.max(0,Math.min(20,He(t*(1+1e-15),e))))}}),cl=is.time={},fl=Date;We.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){hl.setUTCDate.apply(this._,arguments)},setDay:function(){hl.setUTCDay.apply(this._,arguments)},setFullYear:function(){hl.setUTCFullYear.apply(this._,arguments)},setHours:function(){hl.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){hl.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){hl.setUTCMinutes.apply(this._,arguments)},setMonth:function(){hl.setUTCMonth.apply(this._,arguments)},setSeconds:function(){hl.setUTCSeconds.apply(this._,arguments)},setTime:function(){hl.setTime.apply(this._,arguments)}};var hl=Date.prototype;cl.year=ze(function(t){t=cl.day(t);t.setMonth(0,1);return t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()});cl.years=cl.year.range;cl.years.utc=cl.year.utc.range;cl.day=ze(function(t){var e=new fl(2e3,0);e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate());return e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1});cl.days=cl.day.range;cl.days.utc=cl.day.utc.range;cl.dayOfYear=function(t){var e=cl.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)};["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var n=cl[t]=ze(function(t){(t=cl.day(t)).setDate(t.getDate()-(t.getDay()+e)%7);return t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var n=cl.year(t).getDay();return Math.floor((cl.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});cl[t+"s"]=n.range;cl[t+"s"].utc=n.utc.range;cl[t+"OfYear"]=function(t){var n=cl.year(t).getDay();return Math.floor((cl.dayOfYear(t)+(n+e)%7)/7)}});cl.week=cl.sunday;cl.weeks=cl.sunday.range;cl.weeks.utc=cl.sunday.utc.range;cl.weekOfYear=cl.sundayOfYear;var dl={"-":"",_:" ",0:"0"},pl=/^\s*\d+/,gl=/^%/;is.locale=function(t){return{numberFormat:Re(t),timeFormat:Ue(t)}};var ml=is.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});is.format=ml.numberFormat;is.geo={};fn.prototype={s:0,t:0,add:function(t){hn(t,this.t,vl);hn(vl.s,this.s,this);this.s?this.t+=vl.t:this.s=vl.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var vl=new fn;is.geo.stream=function(t,e){t&&yl.hasOwnProperty(t.type)?yl[t.type](t,e):dn(t,e)};var yl={Feature:function(t,e){dn(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)dn(n[r].geometry,e)}},bl={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates;e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){pn(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)pn(n[r],e,0)},Polygon:function(t,e){gn(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)gn(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)dn(n[r],e)}};is.geo.area=function(t){xl=0;is.geo.stream(t,Cl);return xl};var xl,wl=new fn,Cl={sphere:function(){xl+=4*Ps},point:S,lineStart:S,lineEnd:S,polygonStart:function(){wl.reset();Cl.lineStart=mn},polygonEnd:function(){var t=2*wl;xl+=0>t?4*Ps+t:t;Cl.lineStart=Cl.lineEnd=Cl.point=S}};is.geo.bounds=function(){function t(t,e){b.push(x=[c=t,h=t]);f>e&&(f=e);e>d&&(d=e)}function e(e,n){var r=vn([e*Rs,n*Rs]);if(v){var i=bn(v,r),o=[i[1],-i[0],0],a=bn(o,i);Cn(a);a=Sn(a);var l=e-p,u=l>0?1:-1,g=a[0]*Fs*u,m=ms(l)>180;if(m^(g>u*p&&u*e>g)){var y=a[1]*Fs;y>d&&(d=y)}else if(g=(g+360)%360-180,m^(g>u*p&&u*e>g)){var y=-a[1]*Fs;f>y&&(f=y)}else{f>n&&(f=n);n>d&&(d=n)}if(m)p>e?s(c,e)>s(c,h)&&(h=e):s(e,h)>s(c,h)&&(c=e);else if(h>=c){c>e&&(c=e);e>h&&(h=e)}else e>p?s(c,e)>s(c,h)&&(h=e):s(e,h)>s(c,h)&&(c=e)}else t(e,n);v=r,p=e}function n(){w.point=e}function r(){x[0]=c,x[1]=h;w.point=t;v=null}function i(t,n){if(v){var r=t-p;y+=ms(r)>180?r+(r>0?360:-360):r}else g=t,m=n;Cl.point(t,n);e(t,n)}function o(){Cl.lineStart()}function a(){i(g,m);Cl.lineEnd();ms(y)>Es&&(c=-(h=180));x[0]=c,x[1]=h;v=null}function s(t,e){return(e-=t)<0?e+360:e}function l(t,e){return t[0]-e[0]}function u(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}var c,f,h,d,p,g,m,v,y,b,x,w={point:t,lineStart:n,lineEnd:r,polygonStart:function(){w.point=i;w.lineStart=o;w.lineEnd=a;y=0;Cl.polygonStart()},polygonEnd:function(){Cl.polygonEnd();w.point=t;w.lineStart=n;w.lineEnd=r;0>wl?(c=-(h=180),f=-(d=90)):y>Es?d=90:-Es>y&&(f=-90);x[0]=c,x[1]=h}};return function(t){d=h=-(c=f=1/0);b=[];is.geo.stream(t,w);var e=b.length;if(e){b.sort(l);for(var n,r=1,i=b[0],o=[i];e>r;++r){n=b[r];if(u(n[0],i)||u(n[1],i)){s(i[0],n[1])>s(i[0],i[1])&&(i[1]=n[1]);s(n[0],i[1])>s(i[0],i[1])&&(i[0]=n[0])}else o.push(i=n)}for(var a,n,p=-1/0,e=o.length-1,r=0,i=o[e];e>=r;i=n,++r){n=o[r];(a=s(i[1],n[0]))>p&&(p=a,c=n[0],h=i[1])}}b=x=null;return 1/0===c||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[c,f],[h,d]]}}();is.geo.centroid=function(t){Sl=Tl=kl=_l=Ml=Dl=Ll=Al=Nl=El=jl=0;is.geo.stream(t,Pl);var e=Nl,n=El,r=jl,i=e*e+n*n+r*r;if(js>i){e=Dl,n=Ll,r=Al;Es>Tl&&(e=kl,n=_l,r=Ml);i=e*e+n*n+r*r;if(js>i)return[0/0,0/0]}return[Math.atan2(n,e)*Fs,re(r/Math.sqrt(i))*Fs]};var Sl,Tl,kl,_l,Ml,Dl,Ll,Al,Nl,El,jl,Pl={sphere:S,point:kn,lineStart:Mn,lineEnd:Dn,polygonStart:function(){Pl.lineStart=Ln},polygonEnd:function(){Pl.lineStart=Mn}},Il=In(Nn,Fn,zn,[-Ps,-Ps/2]),Hl=1e9;is.geo.clipExtent=function(){var t,e,n,r,i,o,a={stream:function(t){i&&(i.valid=!1);i=o(t);i.valid=!0;return i},extent:function(s){if(!arguments.length)return[[t,e],[n,r]];o=Vn(t=+s[0][0],e=+s[0][1],n=+s[1][0],r=+s[1][1]);i&&(i.valid=!1,i=null);return a}};return a.extent([[0,0],[960,500]])};(is.geo.conicEqualArea=function(){return Xn(Gn)}).raw=Gn;is.geo.albers=function(){return is.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)};is.geo.albersUsa=function(){function t(t){var o=t[0],a=t[1];e=null;(n(o,a),e)||(r(o,a),e)||i(o,a);return e}var e,n,r,i,o=is.geo.albers(),a=is.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=is.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,n){e=[t,n]}};t.invert=function(t){var e=o.scale(),n=o.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?a:i>=.166&&.234>i&&r>=-.214&&-.115>r?s:o).invert(t)};t.stream=function(t){var e=o.stream(t),n=a.stream(t),r=s.stream(t);return{point:function(t,i){e.point(t,i);n.point(t,i);r.point(t,i)},sphere:function(){e.sphere();n.sphere();r.sphere()},lineStart:function(){e.lineStart();n.lineStart();r.lineStart()},lineEnd:function(){e.lineEnd();n.lineEnd();r.lineEnd()},polygonStart:function(){e.polygonStart();n.polygonStart();r.polygonStart()},polygonEnd:function(){e.polygonEnd();n.polygonEnd();r.polygonEnd()}}};t.precision=function(e){if(!arguments.length)return o.precision();o.precision(e);a.precision(e);s.precision(e);return t};t.scale=function(e){if(!arguments.length)return o.scale();o.scale(e);a.scale(.35*e);s.scale(e);return t.translate(o.translate())};t.translate=function(e){if(!arguments.length)return o.translate();var u=o.scale(),c=+e[0],f=+e[1];n=o.translate(e).clipExtent([[c-.455*u,f-.238*u],[c+.455*u,f+.238*u]]).stream(l).point;r=a.translate([c-.307*u,f+.201*u]).clipExtent([[c-.425*u+Es,f+.12*u+Es],[c-.214*u-Es,f+.234*u-Es]]).stream(l).point;i=s.translate([c-.205*u,f+.212*u]).clipExtent([[c-.214*u+Es,f+.166*u+Es],[c-.115*u-Es,f+.234*u-Es]]).stream(l).point;return t};return t.scale(1070)};var Ol,Rl,Fl,Wl,zl,ql,Ul={point:S,lineStart:S,lineEnd:S,polygonStart:function(){Rl=0;Ul.lineStart=$n},polygonEnd:function(){Ul.lineStart=Ul.lineEnd=Ul.point=S;Ol+=ms(Rl/2)}},Bl={point:Yn,lineStart:S,lineEnd:S,polygonStart:S,polygonEnd:S},Vl={point:Zn,lineStart:Qn,lineEnd:tr,polygonStart:function(){Vl.lineStart=er},polygonEnd:function(){Vl.point=Zn;Vl.lineStart=Qn;Vl.lineEnd=tr}};is.geo.path=function(){function t(t){if(t){"function"==typeof s&&o.pointRadius(+s.apply(this,arguments));a&&a.valid||(a=i(o));is.geo.stream(t,a)}return o.result()}function e(){a=null;return t}var n,r,i,o,a,s=4.5;t.area=function(t){Ol=0;is.geo.stream(t,i(Ul));return Ol};t.centroid=function(t){kl=_l=Ml=Dl=Ll=Al=Nl=El=jl=0;is.geo.stream(t,i(Vl));return jl?[Nl/jl,El/jl]:Al?[Dl/Al,Ll/Al]:Ml?[kl/Ml,_l/Ml]:[0/0,0/0]};t.bounds=function(t){zl=ql=-(Fl=Wl=1/0);is.geo.stream(t,i(Bl));return[[Fl,Wl],[zl,ql]]};t.projection=function(t){if(!arguments.length)return n;i=(n=t)?t.stream||ir(t):x;return e()};t.context=function(t){if(!arguments.length)return r;o=null==(r=t)?new Jn:new nr(t);"function"!=typeof s&&o.pointRadius(s);return e()};t.pointRadius=function(e){if(!arguments.length)return s;s="function"==typeof e?e:(o.pointRadius(+e),+e);return t};return t.projection(is.geo.albersUsa()).context(null)};is.geo.transform=function(t){return{stream:function(e){var n=new or(e);for(var r in t)n[r]=t[r];return n}}};or.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};is.geo.projection=sr;is.geo.projectionMutator=lr;(is.geo.equirectangular=function(){return sr(cr)}).raw=cr.invert=cr;is.geo.rotation=function(t){function e(e){e=t(e[0]*Rs,e[1]*Rs);return e[0]*=Fs,e[1]*=Fs,e}t=hr(t[0]%360*Rs,t[1]*Rs,t.length>2?t[2]*Rs:0);e.invert=function(e){e=t.invert(e[0]*Rs,e[1]*Rs);return e[0]*=Fs,e[1]*=Fs,e};return e};fr.invert=cr;is.geo.circle=function(){function t(){var t="function"==typeof r?r.apply(this,arguments):r,e=hr(-t[0]*Rs,-t[1]*Rs,0).invert,i=[];n(null,null,1,{point:function(t,n){i.push(t=e(t,n));t[0]*=Fs,t[1]*=Fs}});return{type:"Polygon",coordinates:[i]}}var e,n,r=[0,0],i=6;t.origin=function(e){if(!arguments.length)return r;r=e;return t};t.angle=function(r){if(!arguments.length)return e;n=mr((e=+r)*Rs,i*Rs);return t};t.precision=function(r){if(!arguments.length)return i;n=mr(e*Rs,(i=+r)*Rs);return t};return t.angle(90)};is.geo.distance=function(t,e){var n,r=(e[0]-t[0])*Rs,i=t[1]*Rs,o=e[1]*Rs,a=Math.sin(r),s=Math.cos(r),l=Math.sin(i),u=Math.cos(i),c=Math.sin(o),f=Math.cos(o);return Math.atan2(Math.sqrt((n=f*a)*n+(n=u*c-l*f*s)*n),l*c+u*f*s)};is.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return is.range(Math.ceil(o/m)*m,i,m).map(h).concat(is.range(Math.ceil(u/v)*v,l,v).map(d)).concat(is.range(Math.ceil(r/p)*p,n,p).filter(function(t){return ms(t%m)>Es}).map(c)).concat(is.range(Math.ceil(s/g)*g,a,g).filter(function(t){return ms(t%v)>Es}).map(f))}var n,r,i,o,a,s,l,u,c,f,h,d,p=10,g=p,m=90,v=360,y=2.5;t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})};t.outline=function(){return{type:"Polygon",coordinates:[h(o).concat(d(l).slice(1),h(i).reverse().slice(1),d(u).reverse().slice(1))]}};t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()};t.majorExtent=function(e){if(!arguments.length)return[[o,u],[i,l]];o=+e[0][0],i=+e[1][0];u=+e[0][1],l=+e[1][1];o>i&&(e=o,o=i,i=e);u>l&&(e=u,u=l,l=e);return t.precision(y)};t.minorExtent=function(e){if(!arguments.length)return[[r,s],[n,a]];r=+e[0][0],n=+e[1][0];s=+e[0][1],a=+e[1][1];r>n&&(e=r,r=n,n=e);s>a&&(e=s,s=a,a=e);return t.precision(y)};t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()};t.majorStep=function(e){if(!arguments.length)return[m,v];m=+e[0],v=+e[1];return t};t.minorStep=function(e){if(!arguments.length)return[p,g];p=+e[0],g=+e[1];return t};t.precision=function(e){if(!arguments.length)return y;y=+e;c=yr(s,a,90);f=br(r,n,y);h=yr(u,l,90);d=br(o,i,y);return t};return t.majorExtent([[-180,-90+Es],[180,90-Es]]).minorExtent([[-180,-80-Es],[180,80+Es]])};is.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||r.apply(this,arguments),n||i.apply(this,arguments)]}}var e,n,r=xr,i=wr;t.distance=function(){return is.geo.distance(e||r.apply(this,arguments),n||i.apply(this,arguments))};t.source=function(n){if(!arguments.length)return r;r=n,e="function"==typeof n?null:n;return t};t.target=function(e){if(!arguments.length)return i;i=e,n="function"==typeof e?null:e;return t};t.precision=function(){return arguments.length?t:0};return t};is.geo.interpolate=function(t,e){return Cr(t[0]*Rs,t[1]*Rs,e[0]*Rs,e[1]*Rs)};is.geo.length=function(t){Xl=0;is.geo.stream(t,Gl);return Xl};var Xl,Gl={sphere:S,point:S,lineStart:Sr,lineEnd:S,polygonStart:S,polygonEnd:S},$l=Tr(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(is.geo.azimuthalEqualArea=function(){return sr($l)}).raw=$l;var Yl=Tr(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},x);(is.geo.azimuthalEquidistant=function(){return sr(Yl)}).raw=Yl;(is.geo.conicConformal=function(){return Xn(kr)}).raw=kr;(is.geo.conicEquidistant=function(){return Xn(_r)}).raw=_r;var Jl=Tr(function(t){return 1/t},Math.atan);(is.geo.gnomonic=function(){return sr(Jl)}).raw=Jl;Mr.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Os]};(is.geo.mercator=function(){return Dr(Mr)}).raw=Mr;var Kl=Tr(function(){return 1},Math.asin);(is.geo.orthographic=function(){return sr(Kl)}).raw=Kl;var Zl=Tr(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(is.geo.stereographic=function(){return sr(Zl)}).raw=Zl;Lr.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Os]};(is.geo.transverseMercator=function(){var t=Dr(Lr),e=t.center,n=t.rotate;t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])};t.rotate=function(t){return t?n([t[0],t[1],t.length>2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])};return n([0,0,90])}).raw=Lr;is.geom={};is.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=De(n),o=De(r),a=t.length,s=[],l=[];for(e=0;a>e;e++)s.push([+i.call(this,t[e],e),+o.call(this,t[e],e),e]);s.sort(jr);for(e=0;a>e;e++)l.push([s[e][0],-s[e][1]]);var u=Er(s),c=Er(l),f=c[0]===u[0],h=c[c.length-1]===u[u.length-1],d=[];for(e=u.length-1;e>=0;--e)d.push(t[s[u[e]][2]]);for(e=+f;e<c.length-h;++e)d.push(t[s[c[e]][2]]);return d}var n=Ar,r=Nr;if(arguments.length)return e(t);e.x=function(t){return arguments.length?(n=t,e):n};e.y=function(t){return arguments.length?(r=t,e):r};return e};is.geom.polygon=function(t){ws(t,Ql);return t};var Ql=is.geom.polygon.prototype=[];Ql.area=function(){for(var t,e=-1,n=this.length,r=this[n-1],i=0;++e<n;){t=r;r=this[e];i+=t[1]*r[0]-t[0]*r[1]}return.5*i};Ql.centroid=function(t){var e,n,r=-1,i=this.length,o=0,a=0,s=this[i-1];arguments.length||(t=-1/(6*this.area()));for(;++r<i;){e=s;s=this[r];n=e[0]*s[1]-s[0]*e[1];o+=(e[0]+s[0])*n;a+=(e[1]+s[1])*n}return[o*t,a*t]};Ql.clip=function(t){for(var e,n,r,i,o,a,s=Hr(t),l=-1,u=this.length-Hr(this),c=this[u-1];++l<u;){e=t.slice();t.length=0;i=this[l];o=e[(r=e.length-s)-1];n=-1;for(;++n<r;){a=e[n];if(Pr(a,c,i)){Pr(o,c,i)||t.push(Ir(o,a,c,i));t.push(a)}else Pr(o,c,i)&&t.push(Ir(o,a,c,i));o=a}s&&t.push(t[0]);c=i}return t};var tu,eu,nu,ru,iu,ou=[],au=[];Br.prototype.prepare=function(){for(var t,e=this.edges,n=e.length;n--;){t=e[n].edge;t.b&&t.a||e.splice(n,1)}e.sort(Xr);return e.length};ni.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}};ri.prototype={insert:function(t,e){var n,r,i;if(t){e.P=t;e.N=t.N;t.N&&(t.N.P=e);t.N=e;if(t.R){t=t.R;for(;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else if(this._){t=si(this._);e.P=null;e.N=t;t.P=t.L=e;n=t}else{e.P=e.N=null;this._=e;n=null}e.L=e.R=null;e.U=n;e.C=!0;t=e;for(;n&&n.C;){r=n.U;if(n===r.L){i=r.R;if(i&&i.C){n.C=i.C=!1;r.C=!0;t=r}else{if(t===n.R){oi(this,n);t=n;n=t.U}n.C=!1;r.C=!0;ai(this,r)}}else{i=r.L;if(i&&i.C){n.C=i.C=!1;r.C=!0;t=r}else{if(t===n.L){ai(this,n);t=n;n=t.U}n.C=!1;r.C=!0;oi(this,r)}}n=t.U}this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P);t.P&&(t.P.N=t.N);t.N=t.P=null;var e,n,r,i=t.U,o=t.L,a=t.R;n=o?a?si(a):o:a;i?i.L===t?i.L=n:i.R=n:this._=n;if(o&&a){r=n.C;n.C=t.C;n.L=o;o.U=n;if(n!==a){i=n.U;n.U=t.U;t=n.R;i.L=t;n.R=a;a.U=n}else{n.U=i;i=n;t=n.R}}else{r=t.C;t=n}t&&(t.U=i);if(!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){e=i.R;if(e.C){e.C=!1;i.C=!0;oi(this,i);e=i.R}if(e.L&&e.L.C||e.R&&e.R.C){if(!e.R||!e.R.C){e.L.C=!1;e.C=!0;ai(this,e);e=i.R}e.C=i.C;i.C=e.R.C=!1;oi(this,i);t=this._;break}}else{e=i.L;if(e.C){e.C=!1;i.C=!0;ai(this,i);e=i.L}if(e.L&&e.L.C||e.R&&e.R.C){if(!e.L||!e.L.C){e.R.C=!1;e.C=!0;oi(this,e);e=i.L}e.C=i.C;i.C=e.L.C=!1;ai(this,i);t=this._;break}}e.C=!0;t=i;i=i.U}while(!t.C);t&&(t.C=!1)}}};is.geom.voronoi=function(t){function e(t){var e=new Array(t.length),r=s[0][0],i=s[0][1],o=s[1][0],a=s[1][1];li(n(t),s).cells.forEach(function(n,s){var l=n.edges,u=n.site,c=e[s]=l.length?l.map(function(t){var e=t.start();return[e.x,e.y]}):u.x>=r&&u.x<=o&&u.y>=i&&u.y<=a?[[r,a],[o,a],[o,i],[r,i]]:[];c.point=t[s]});return e}function n(t){return t.map(function(t,e){return{x:Math.round(o(t,e)/Es)*Es,y:Math.round(a(t,e)/Es)*Es,i:e}})}var r=Ar,i=Nr,o=r,a=i,s=su;if(t)return e(t);e.links=function(t){return li(n(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})};e.triangles=function(t){var e=[];li(n(t)).cells.forEach(function(n,r){for(var i,o,a=n.site,s=n.edges.sort(Xr),l=-1,u=s.length,c=s[u-1].edge,f=c.l===a?c.r:c.l;++l<u;){i=c;o=f;c=s[l].edge;f=c.l===a?c.r:c.l;r<o.i&&r<f.i&&ci(a,o,f)<0&&e.push([t[r],t[o.i],t[f.i]])}});return e};e.x=function(t){return arguments.length?(o=De(r=t),e):r};e.y=function(t){return arguments.length?(a=De(i=t),e):i};e.clipExtent=function(t){if(!arguments.length)return s===su?null:s;s=null==t?su:t;return e};e.size=function(t){return arguments.length?e.clipExtent(t&&[[0,0],t]):s===su?null:s&&s[1]};return e};var su=[[-1e6,-1e6],[1e6,1e6]];is.geom.delaunay=function(t){return is.geom.voronoi().triangles(t)};is.geom.quadtree=function(t,e,n,r,i){function o(t){function o(t,e,n,r,i,o,a,s){if(!isNaN(n)&&!isNaN(r))if(t.leaf){var l=t.x,c=t.y;if(null!=l)if(ms(l-n)+ms(c-r)<.01)u(t,e,n,r,i,o,a,s);else{var f=t.point;t.x=t.y=t.point=null;u(t,f,l,c,i,o,a,s);u(t,e,n,r,i,o,a,s)}else t.x=n,t.y=r,t.point=e}else u(t,e,n,r,i,o,a,s)}function u(t,e,n,r,i,a,s,l){var u=.5*(i+s),c=.5*(a+l),f=n>=u,h=r>=c,d=h<<1|f;t.leaf=!1;t=t.nodes[d]||(t.nodes[d]=di());f?i=u:s=u;h?a=c:l=c;o(t,e,n,r,i,a,s,l)}var c,f,h,d,p,g,m,v,y,b=De(s),x=De(l);if(null!=e)g=e,m=n,v=r,y=i;else{v=y=-(g=m=1/0);f=[],h=[];p=t.length;if(a)for(d=0;p>d;++d){c=t[d];c.x<g&&(g=c.x);c.y<m&&(m=c.y);c.x>v&&(v=c.x);c.y>y&&(y=c.y);f.push(c.x);h.push(c.y)}else for(d=0;p>d;++d){var w=+b(c=t[d],d),C=+x(c,d);g>w&&(g=w);m>C&&(m=C);w>v&&(v=w);C>y&&(y=C);f.push(w);h.push(C)}}var S=v-g,T=y-m;S>T?y=m+S:v=g+T;var k=di();k.add=function(t){o(k,t,+b(t,++d),+x(t,d),g,m,v,y)};k.visit=function(t){pi(t,k,g,m,v,y)};k.find=function(t){return gi(k,t[0],t[1],g,m,v,y)};d=-1;if(null==e){for(;++d<p;)o(k,t[d],f[d],h[d],g,m,v,y);--d}else t.forEach(k.add);f=h=t=c=null;return k}var a,s=Ar,l=Nr;if(a=arguments.length){s=fi;l=hi;if(3===a){i=n;r=e;n=e=0}return o(t)}o.x=function(t){return arguments.length?(s=t,o):s};o.y=function(t){return arguments.length?(l=t,o):l};o.extent=function(t){if(!arguments.length)return null==e?null:[[e,n],[r,i]];null==t?e=n=r=i=null:(e=+t[0][0],n=+t[0][1],r=+t[1][0],i=+t[1][1]);return o};o.size=function(t){if(!arguments.length)return null==e?null:[r-e,i-n];null==t?e=n=r=i=null:(e=n=0,r=+t[0],i=+t[1]);return o};return o};is.interpolateRgb=mi;is.interpolateObject=vi;is.interpolateNumber=yi;is.interpolateString=bi;var lu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,uu=new RegExp(lu.source,"g");is.interpolate=xi;is.interpolators=[function(t,e){var n=typeof e;return("string"===n?tl.has(e)||/^(#|rgb\(|hsl\()/.test(e)?mi:bi:e instanceof le?mi:Array.isArray(e)?wi:"object"===n&&isNaN(e)?vi:yi)(t,e)}];is.interpolateArray=wi;var cu=function(){return x},fu=is.map({linear:cu,poly:Di,quad:function(){return ki},cubic:function(){return _i},sin:function(){return Li},exp:function(){return Ai},circle:function(){return Ni},elastic:Ei,back:ji,bounce:function(){return Pi}}),hu=is.map({"in":x,out:Si,"in-out":Ti,"out-in":function(t){return Ti(Si(t))}});is.ease=function(t){var e=t.indexOf("-"),n=e>=0?t.slice(0,e):t,r=e>=0?t.slice(e+1):"in";n=fu.get(n)||cu;r=hu.get(r)||x;return Ci(r(n.apply(null,os.call(arguments,1))))};is.interpolateHcl=Ii;is.interpolateHsl=Hi;is.interpolateLab=Oi;is.interpolateRound=Ri;is.transform=function(t){var e=ss.createElementNS(is.ns.prefix.svg,"g");return(is.transform=function(t){if(null!=t){e.setAttribute("transform",t);var n=e.transform.baseVal.consolidate()}return new Fi(n?n.matrix:du)})(t)};Fi.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var du={a:1,b:0,c:0,d:1,e:0,f:0};is.interpolateTransform=Ui;is.layout={};is.layout.bundle=function(){return function(t){for(var e=[],n=-1,r=t.length;++n<r;)e.push(Xi(t[n]));return e}};is.layout.chord=function(){function t(){var t,u,f,h,d,p={},g=[],m=is.range(o),v=[];n=[];r=[];t=0,h=-1;for(;++h<o;){u=0,d=-1;for(;++d<o;)u+=i[h][d];g.push(u);v.push(is.range(o));t+=u}a&&m.sort(function(t,e){return a(g[t],g[e])});s&&v.forEach(function(t,e){t.sort(function(t,n){return s(i[e][t],i[e][n])})});t=(Is-c*o)/t;u=0,h=-1;for(;++h<o;){f=u,d=-1;for(;++d<o;){var y=m[h],b=v[y][d],x=i[y][b],w=u,C=u+=x*t;p[y+"-"+b]={index:y,subindex:b,startAngle:w,endAngle:C,value:x}}r[y]={index:y,startAngle:f,endAngle:u,value:(u-f)/t};u+=c}h=-1;for(;++h<o;){d=h-1;for(;++d<o;){var S=p[h+"-"+d],T=p[d+"-"+h];(S.value||T.value)&&n.push(S.value<T.value?{source:T,target:S}:{source:S,target:T})}}l&&e()}function e(){n.sort(function(t,e){return l((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}var n,r,i,o,a,s,l,u={},c=0;u.matrix=function(t){if(!arguments.length)return i;o=(i=t)&&i.length;n=r=null;return u};u.padding=function(t){if(!arguments.length)return c;c=t;n=r=null;return u};u.sortGroups=function(t){if(!arguments.length)return a;a=t;n=r=null;return u};u.sortSubgroups=function(t){if(!arguments.length)return s;s=t;n=null;return u};u.sortChords=function(t){if(!arguments.length)return l;l=t;n&&e();return u};u.chords=function(){n||t();return n};u.groups=function(){r||t();return r};return u};is.layout.force=function(){function t(t){return function(e,n,r,i){if(e.point!==t){var o=e.cx-t.x,a=e.cy-t.y,s=i-n,l=o*o+a*a;if(l>s*s/m){if(p>l){var u=e.charge/l;t.px-=o*u;t.py-=a*u}return!0}if(e.point&&l&&p>l){var u=e.pointCharge/l;t.px-=o*u;t.py-=a*u}}return!e.charge}}function e(t){t.px=is.event.x,t.py=is.event.y;s.resume()}var n,r,i,o,a,s={},l=is.dispatch("start","tick","end"),u=[1,1],c=.9,f=pu,h=gu,d=-30,p=mu,g=.1,m=.64,v=[],y=[];s.tick=function(){if((r*=.99)<.005){l.end({type:"end",alpha:r=0});return!0}var e,n,s,f,h,p,m,b,x,w=v.length,C=y.length;for(n=0;C>n;++n){s=y[n];f=s.source;h=s.target;b=h.x-f.x;x=h.y-f.y;if(p=b*b+x*x){p=r*o[n]*((p=Math.sqrt(p))-i[n])/p;b*=p;x*=p;h.x-=b*(m=f.weight/(h.weight+f.weight));h.y-=x*m;f.x+=b*(m=1-m);f.y+=x*m}}if(m=r*g){b=u[0]/2;x=u[1]/2;n=-1;if(m)for(;++n<w;){s=v[n];s.x+=(b-s.x)*m;s.y+=(x-s.y)*m}}if(d){Qi(e=is.geom.quadtree(v),r,a);n=-1;for(;++n<w;)(s=v[n]).fixed||e.visit(t(s))}n=-1;for(;++n<w;){s=v[n];if(s.fixed){s.x=s.px;s.y=s.py}else{s.x-=(s.px-(s.px=s.x))*c;s.y-=(s.py-(s.py=s.y))*c}}l.tick({type:"tick",alpha:r})};s.nodes=function(t){if(!arguments.length)return v;v=t;return s};s.links=function(t){if(!arguments.length)return y;y=t;return s};s.size=function(t){if(!arguments.length)return u;u=t;return s};s.linkDistance=function(t){if(!arguments.length)return f;f="function"==typeof t?t:+t;return s};s.distance=s.linkDistance;s.linkStrength=function(t){if(!arguments.length)return h;h="function"==typeof t?t:+t;return s};s.friction=function(t){if(!arguments.length)return c;c=+t;return s};s.charge=function(t){if(!arguments.length)return d;d="function"==typeof t?t:+t;return s};s.chargeDistance=function(t){if(!arguments.length)return Math.sqrt(p);p=t*t;return s};s.gravity=function(t){if(!arguments.length)return g;g=+t;return s};s.theta=function(t){if(!arguments.length)return Math.sqrt(m);m=t*t;return s};s.alpha=function(t){if(!arguments.length)return r;t=+t;if(r)r=t>0?t:0;else if(t>0){l.start({type:"start",alpha:r=t});is.timer(s.tick)}return s};s.start=function(){function t(t,r){if(!n){n=new Array(l);for(s=0;l>s;++s)n[s]=[];for(s=0;c>s;++s){var i=y[s];n[i.source.index].push(i.target);n[i.target.index].push(i.source)}}for(var o,a=n[e],s=-1,u=a.length;++s<u;)if(!isNaN(o=a[s][t]))return o;return Math.random()*r}var e,n,r,l=v.length,c=y.length,p=u[0],g=u[1];for(e=0;l>e;++e){(r=v[e]).index=e;r.weight=0}for(e=0;c>e;++e){r=y[e];"number"==typeof r.source&&(r.source=v[r.source]);"number"==typeof r.target&&(r.target=v[r.target]);++r.source.weight;++r.target.weight}for(e=0;l>e;++e){r=v[e];isNaN(r.x)&&(r.x=t("x",p));isNaN(r.y)&&(r.y=t("y",g));isNaN(r.px)&&(r.px=r.x);isNaN(r.py)&&(r.py=r.y)}i=[];if("function"==typeof f)for(e=0;c>e;++e)i[e]=+f.call(this,y[e],e);else for(e=0;c>e;++e)i[e]=f;o=[];if("function"==typeof h)for(e=0;c>e;++e)o[e]=+h.call(this,y[e],e);else for(e=0;c>e;++e)o[e]=h;a=[];if("function"==typeof d)for(e=0;l>e;++e)a[e]=+d.call(this,v[e],e);else for(e=0;l>e;++e)a[e]=d;return s.resume()};s.resume=function(){return s.alpha(.1)};s.stop=function(){return s.alpha(0)};s.drag=function(){n||(n=is.behavior.drag().origin(x).on("dragstart.force",Yi).on("drag.force",e).on("dragend.force",Ji));if(!arguments.length)return n;this.on("mouseover.force",Ki).on("mouseout.force",Zi).call(n);return void 0};return is.rebind(s,l,"on")};var pu=20,gu=1,mu=1/0;is.layout.hierarchy=function(){function t(i){var o,a=[i],s=[];i.depth=0;for(;null!=(o=a.pop());){s.push(o);if((u=n.call(t,o,o.depth))&&(l=u.length)){for(var l,u,c;--l>=0;){a.push(c=u[l]);c.parent=o;c.depth=o.depth+1}r&&(o.value=0);o.children=u}else{r&&(o.value=+r.call(t,o,o.depth)||0);delete o.children}}no(i,function(t){var n,i;e&&(n=t.children)&&n.sort(e);r&&(i=t.parent)&&(i.value+=t.value)});return s}var e=oo,n=ro,r=io;t.sort=function(n){if(!arguments.length)return e;e=n;return t};t.children=function(e){if(!arguments.length)return n;n=e;return t};t.value=function(e){if(!arguments.length)return r;r=e;return t};t.revalue=function(e){if(r){eo(e,function(t){t.children&&(t.value=0)});no(e,function(e){var n;e.children||(e.value=+r.call(t,e,e.depth)||0);(n=e.parent)&&(n.value+=e.value)})}return e};return t};is.layout.partition=function(){function t(e,n,r,i){var o=e.children;e.x=n;e.y=e.depth*i;e.dx=r;e.dy=i;if(o&&(a=o.length)){var a,s,l,u=-1;r=e.value?r/e.value:0;for(;++u<a;){t(s=o[u],n,l=s.value*r,i);n+=l}}}function e(t){var n=t.children,r=0;if(n&&(i=n.length))for(var i,o=-1;++o<i;)r=Math.max(r,e(n[o]));return 1+r}function n(n,o){var a=r.call(this,n,o);t(a[0],0,i[0],i[1]/e(a[0]));return a}var r=is.layout.hierarchy(),i=[1,1];n.size=function(t){if(!arguments.length)return i;i=t;return n};return to(n,r)};is.layout.pie=function(){function t(a){var s,l=a.length,u=a.map(function(n,r){return+e.call(t,n,r)}),c=+("function"==typeof r?r.apply(this,arguments):r),f=("function"==typeof i?i.apply(this,arguments):i)-c,h=Math.min(Math.abs(f)/l,+("function"==typeof o?o.apply(this,arguments):o)),d=h*(0>f?-1:1),p=(f-l*d)/is.sum(u),g=is.range(l),m=[];null!=n&&g.sort(n===vu?function(t,e){return u[e]-u[t]}:function(t,e){return n(a[t],a[e])});g.forEach(function(t){m[t]={data:a[t],value:s=u[t],startAngle:c,endAngle:c+=s*p+d,padAngle:h}});return m}var e=Number,n=vu,r=0,i=Is,o=0;t.value=function(n){if(!arguments.length)return e;e=n;return t};t.sort=function(e){if(!arguments.length)return n;n=e;return t};t.startAngle=function(e){if(!arguments.length)return r;r=e;return t};t.endAngle=function(e){if(!arguments.length)return i;i=e;return t};t.padAngle=function(e){if(!arguments.length)return o;o=e;return t};return t};var vu={};is.layout.stack=function(){function t(s,l){if(!(h=s.length))return s;var u=s.map(function(n,r){return e.call(t,n,r)}),c=u.map(function(e){return e.map(function(e,n){return[o.call(t,e,n),a.call(t,e,n)]})}),f=n.call(t,c,l);u=is.permute(u,f);c=is.permute(c,f);var h,d,p,g,m=r.call(t,c,l),v=u[0].length;
for(p=0;v>p;++p){i.call(t,u[0][p],g=m[p],c[0][p][1]);for(d=1;h>d;++d)i.call(t,u[d][p],g+=c[d-1][p][1],c[d][p][1])}return s}var e=x,n=co,r=fo,i=uo,o=so,a=lo;t.values=function(n){if(!arguments.length)return e;e=n;return t};t.order=function(e){if(!arguments.length)return n;n="function"==typeof e?e:yu.get(e)||co;return t};t.offset=function(e){if(!arguments.length)return r;r="function"==typeof e?e:bu.get(e)||fo;return t};t.x=function(e){if(!arguments.length)return o;o=e;return t};t.y=function(e){if(!arguments.length)return a;a=e;return t};t.out=function(e){if(!arguments.length)return i;i=e;return t};return t};var yu=is.map({"inside-out":function(t){var e,n,r=t.length,i=t.map(ho),o=t.map(po),a=is.range(r).sort(function(t,e){return i[t]-i[e]}),s=0,l=0,u=[],c=[];for(e=0;r>e;++e){n=a[e];if(l>s){s+=o[n];u.push(n)}else{l+=o[n];c.push(n)}}return c.reverse().concat(u)},reverse:function(t){return is.range(t.length).reverse()},"default":co}),bu=is.map({silhouette:function(t){var e,n,r,i=t.length,o=t[0].length,a=[],s=0,l=[];for(n=0;o>n;++n){for(e=0,r=0;i>e;e++)r+=t[e][n][1];r>s&&(s=r);a.push(r)}for(n=0;o>n;++n)l[n]=(s-a[n])/2;return l},wiggle:function(t){var e,n,r,i,o,a,s,l,u,c=t.length,f=t[0],h=f.length,d=[];d[0]=l=u=0;for(n=1;h>n;++n){for(e=0,i=0;c>e;++e)i+=t[e][n][1];for(e=0,o=0,s=f[n][0]-f[n-1][0];c>e;++e){for(r=0,a=(t[e][n][1]-t[e][n-1][1])/(2*s);e>r;++r)a+=(t[r][n][1]-t[r][n-1][1])/s;o+=a*t[e][n][1]}d[n]=l-=i?o/i*s:0;u>l&&(u=l)}for(n=0;h>n;++n)d[n]-=u;return d},expand:function(t){var e,n,r,i=t.length,o=t[0].length,a=1/i,s=[];for(n=0;o>n;++n){for(e=0,r=0;i>e;e++)r+=t[e][n][1];if(r)for(e=0;i>e;e++)t[e][n][1]/=r;else for(e=0;i>e;e++)t[e][n][1]=a}for(n=0;o>n;++n)s[n]=0;return s},zero:fo});is.layout.histogram=function(){function t(t,o){for(var a,s,l=[],u=t.map(n,this),c=r.call(this,u,o),f=i.call(this,c,u,o),o=-1,h=u.length,d=f.length-1,p=e?1:1/h;++o<d;){a=l[o]=[];a.dx=f[o+1]-(a.x=f[o]);a.y=0}if(d>0){o=-1;for(;++o<h;){s=u[o];if(s>=c[0]&&s<=c[1]){a=l[is.bisect(f,s,1,d)-1];a.y+=p;a.push(t[o])}}}return l}var e=!0,n=Number,r=yo,i=mo;t.value=function(e){if(!arguments.length)return n;n=e;return t};t.range=function(e){if(!arguments.length)return r;r=De(e);return t};t.bins=function(e){if(!arguments.length)return i;i="number"==typeof e?function(t){return vo(t,e)}:De(e);return t};t.frequency=function(n){if(!arguments.length)return e;e=!!n;return t};return t};is.layout.pack=function(){function t(t,o){var a=n.call(this,t,o),s=a[0],l=i[0],u=i[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};s.x=s.y=0;no(s,function(t){t.r=+c(t.value)});no(s,So);if(r){var f=r*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;no(s,function(t){t.r+=f});no(s,So);no(s,function(t){t.r-=f})}_o(s,l/2,u/2,e?1:1/Math.max(2*s.r/l,2*s.r/u));return a}var e,n=is.layout.hierarchy().sort(bo),r=0,i=[1,1];t.size=function(e){if(!arguments.length)return i;i=e;return t};t.radius=function(n){if(!arguments.length)return e;e=null==n||"function"==typeof n?n:+n;return t};t.padding=function(e){if(!arguments.length)return r;r=+e;return t};return to(t,n)};is.layout.tree=function(){function t(t,i){var c=a.call(this,t,i),f=c[0],h=e(f);no(h,n),h.parent.m=-h.z;eo(h,r);if(u)eo(f,o);else{var d=f,p=f,g=f;eo(f,function(t){t.x<d.x&&(d=t);t.x>p.x&&(p=t);t.depth>g.depth&&(g=t)});var m=s(d,p)/2-d.x,v=l[0]/(p.x+s(p,d)/2+m),y=l[1]/(g.depth||1);eo(f,function(t){t.x=(t.x+m)*v;t.y=t.depth*y})}return c}function e(t){for(var e,n={A:null,children:[t]},r=[n];null!=(e=r.pop());)for(var i,o=e.children,a=0,s=o.length;s>a;++a)r.push((o[a]=i={_:o[a],parent:e,children:(i=o[a].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:a}).a=i);return n.children[0]}function n(t){var e=t.children,n=t.parent.children,r=t.i?n[t.i-1]:null;if(e.length){Eo(t);var o=(e[0].z+e[e.length-1].z)/2;if(r){t.z=r.z+s(t._,r._);t.m=t.z-o}else t.z=o}else r&&(t.z=r.z+s(t._,r._));t.parent.A=i(t,r,t.parent.A||n[0])}function r(t){t._.x=t.z+t.parent.m;t.m+=t.parent.m}function i(t,e,n){if(e){for(var r,i=t,o=t,a=e,l=i.parent.children[0],u=i.m,c=o.m,f=a.m,h=l.m;a=Ao(a),i=Lo(i),a&&i;){l=Lo(l);o=Ao(o);o.a=t;r=a.z+f-i.z-u+s(a._,i._);if(r>0){No(jo(a,t,n),t,r);u+=r;c+=r}f+=a.m;u+=i.m;h+=l.m;c+=o.m}if(a&&!Ao(o)){o.t=a;o.m+=f-c}if(i&&!Lo(l)){l.t=i;l.m+=u-h;n=t}}return n}function o(t){t.x*=l[0];t.y=t.depth*l[1]}var a=is.layout.hierarchy().sort(null).value(null),s=Do,l=[1,1],u=null;t.separation=function(e){if(!arguments.length)return s;s=e;return t};t.size=function(e){if(!arguments.length)return u?null:l;u=null==(l=e)?o:null;return t};t.nodeSize=function(e){if(!arguments.length)return u?l:null;u=null==(l=e)?null:o;return t};return to(t,a)};is.layout.cluster=function(){function t(t,o){var a,s=e.call(this,t,o),l=s[0],u=0;no(l,function(t){var e=t.children;if(e&&e.length){t.x=Io(e);t.y=Po(e)}else{t.x=a?u+=n(t,a):0;t.y=0;a=t}});var c=Ho(l),f=Oo(l),h=c.x-n(c,f)/2,d=f.x+n(f,c)/2;no(l,i?function(t){t.x=(t.x-l.x)*r[0];t.y=(l.y-t.y)*r[1]}:function(t){t.x=(t.x-h)/(d-h)*r[0];t.y=(1-(l.y?t.y/l.y:1))*r[1]});return s}var e=is.layout.hierarchy().sort(null).value(null),n=Do,r=[1,1],i=!1;t.separation=function(e){if(!arguments.length)return n;n=e;return t};t.size=function(e){if(!arguments.length)return i?null:r;i=null==(r=e);return t};t.nodeSize=function(e){if(!arguments.length)return i?r:null;i=null!=(r=e);return t};return to(t,e)};is.layout.treemap=function(){function t(t,e){for(var n,r,i=-1,o=t.length;++i<o;){r=(n=t[i]).value*(0>e?0:e);n.area=isNaN(r)||0>=r?0:r}}function e(n){var o=n.children;if(o&&o.length){var a,s,l,u=f(n),c=[],h=o.slice(),p=1/0,g="slice"===d?u.dx:"dice"===d?u.dy:"slice-dice"===d?1&n.depth?u.dy:u.dx:Math.min(u.dx,u.dy);t(h,u.dx*u.dy/n.value);c.area=0;for(;(l=h.length)>0;){c.push(a=h[l-1]);c.area+=a.area;if("squarify"!==d||(s=r(c,g))<=p){h.pop();p=s}else{c.area-=c.pop().area;i(c,g,u,!1);g=Math.min(u.dx,u.dy);c.length=c.area=0;p=1/0}}if(c.length){i(c,g,u,!0);c.length=c.area=0}o.forEach(e)}}function n(e){var r=e.children;if(r&&r.length){var o,a=f(e),s=r.slice(),l=[];t(s,a.dx*a.dy/e.value);l.area=0;for(;o=s.pop();){l.push(o);l.area+=o.area;if(null!=o.z){i(l,o.z?a.dx:a.dy,a,!s.length);l.length=l.area=0}}r.forEach(n)}}function r(t,e){for(var n,r=t.area,i=0,o=1/0,a=-1,s=t.length;++a<s;)if(n=t[a].area){o>n&&(o=n);n>i&&(i=n)}r*=r;e*=e;return r?Math.max(e*i*p/r,r/(e*o*p)):1/0}function i(t,e,n,r){var i,o=-1,a=t.length,s=n.x,u=n.y,c=e?l(t.area/e):0;if(e==n.dx){(r||c>n.dy)&&(c=n.dy);for(;++o<a;){i=t[o];i.x=s;i.y=u;i.dy=c;s+=i.dx=Math.min(n.x+n.dx-s,c?l(i.area/c):0)}i.z=!0;i.dx+=n.x+n.dx-s;n.y+=c;n.dy-=c}else{(r||c>n.dx)&&(c=n.dx);for(;++o<a;){i=t[o];i.x=s;i.y=u;i.dx=c;u+=i.dy=Math.min(n.y+n.dy-u,c?l(i.area/c):0)}i.z=!1;i.dy+=n.y+n.dy-u;n.x+=c;n.dx-=c}}function o(r){var i=a||s(r),o=i[0];o.x=0;o.y=0;o.dx=u[0];o.dy=u[1];a&&s.revalue(o);t([o],o.dx*o.dy/o.value);(a?n:e)(o);h&&(a=i);return i}var a,s=is.layout.hierarchy(),l=Math.round,u=[1,1],c=null,f=Ro,h=!1,d="squarify",p=.5*(1+Math.sqrt(5));o.size=function(t){if(!arguments.length)return u;u=t;return o};o.padding=function(t){function e(e){var n=t.call(o,e,e.depth);return null==n?Ro(e):Fo(e,"number"==typeof n?[n,n,n,n]:n)}function n(e){return Fo(e,t)}if(!arguments.length)return c;var r;f=null==(c=t)?Ro:"function"==(r=typeof t)?e:"number"===r?(t=[t,t,t,t],n):n;return o};o.round=function(t){if(!arguments.length)return l!=Number;l=t?Math.round:Number;return o};o.sticky=function(t){if(!arguments.length)return h;h=t;a=null;return o};o.ratio=function(t){if(!arguments.length)return p;p=t;return o};o.mode=function(t){if(!arguments.length)return d;d=t+"";return o};return to(o,s)};is.random={normal:function(t,e){var n=arguments.length;2>n&&(e=1);1>n&&(t=0);return function(){var n,r,i;do{n=2*Math.random()-1;r=2*Math.random()-1;i=n*n+r*r}while(!i||i>1);return t+e*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=is.random.normal.apply(is,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=is.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,n=0;t>n;n++)e+=Math.random();return e}}};is.scale={};var xu={floor:x,ceil:x};is.scale.linear=function(){return Xo([0,1],[0,1],xi,!1)};var wu={s:1,g:1,p:1,r:1,e:1};is.scale.log=function(){return ta(is.scale.linear().domain([0,1]),10,!0,[1,10])};var Cu=is.format(".0e"),Su={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};is.scale.pow=function(){return ea(is.scale.linear(),1,[0,1])};is.scale.sqrt=function(){return is.scale.pow().exponent(.5)};is.scale.ordinal=function(){return ra([],{t:"range",a:[[]]})};is.scale.category10=function(){return is.scale.ordinal().range(Tu)};is.scale.category20=function(){return is.scale.ordinal().range(ku)};is.scale.category20b=function(){return is.scale.ordinal().range(_u)};is.scale.category20c=function(){return is.scale.ordinal().range(Mu)};var Tu=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(we),ku=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(we),_u=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(we),Mu=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(we);is.scale.quantile=function(){return ia([],[])};is.scale.quantize=function(){return oa(0,1,[0,1])};is.scale.threshold=function(){return aa([.5],[0,1])};is.scale.identity=function(){return sa([0,1])};is.svg={};is.svg.arc=function(){function t(){var t=Math.max(0,+n.apply(this,arguments)),u=Math.max(0,+r.apply(this,arguments)),c=a.apply(this,arguments)-Os,f=s.apply(this,arguments)-Os,h=Math.abs(f-c),d=c>f?0:1;t>u&&(p=u,u=t,t=p);if(h>=Hs)return e(u,d)+(t?e(t,1-d):"")+"Z";var p,g,m,v,y,b,x,w,C,S,T,k,_=0,M=0,D=[];if(v=(+l.apply(this,arguments)||0)/2){m=o===Du?Math.sqrt(t*t+u*u):+o.apply(this,arguments);d||(M*=-1);u&&(M=re(m/u*Math.sin(v)));t&&(_=re(m/t*Math.sin(v)))}if(u){y=u*Math.cos(c+M);b=u*Math.sin(c+M);x=u*Math.cos(f-M);w=u*Math.sin(f-M);var L=Math.abs(f-c-2*M)<=Ps?0:1;if(M&&pa(y,b,x,w)===d^L){var A=(c+f)/2;y=u*Math.cos(A);b=u*Math.sin(A);x=w=null}}else y=b=0;if(t){C=t*Math.cos(f-_);S=t*Math.sin(f-_);T=t*Math.cos(c+_);k=t*Math.sin(c+_);var N=Math.abs(c-f+2*_)<=Ps?0:1;if(_&&pa(C,S,T,k)===1-d^N){var E=(c+f)/2;C=t*Math.cos(E);S=t*Math.sin(E);T=k=null}}else C=S=0;if((p=Math.min(Math.abs(u-t)/2,+i.apply(this,arguments)))>.001){g=u>t^d?0:1;var j=null==T?[C,S]:null==x?[y,b]:Ir([y,b],[T,k],[x,w],[C,S]),P=y-j[0],I=b-j[1],H=x-j[0],O=w-j[1],R=1/Math.sin(Math.acos((P*H+I*O)/(Math.sqrt(P*P+I*I)*Math.sqrt(H*H+O*O)))/2),F=Math.sqrt(j[0]*j[0]+j[1]*j[1]);if(null!=x){var W=Math.min(p,(u-F)/(R+1)),z=ga(null==T?[C,S]:[T,k],[y,b],u,W,d),q=ga([x,w],[C,S],u,W,d);p===W?D.push("M",z[0],"A",W,",",W," 0 0,",g," ",z[1],"A",u,",",u," 0 ",1-d^pa(z[1][0],z[1][1],q[1][0],q[1][1]),",",d," ",q[1],"A",W,",",W," 0 0,",g," ",q[0]):D.push("M",z[0],"A",W,",",W," 0 1,",g," ",q[0])}else D.push("M",y,",",b);if(null!=T){var U=Math.min(p,(t-F)/(R-1)),B=ga([y,b],[T,k],t,-U,d),V=ga([C,S],null==x?[y,b]:[x,w],t,-U,d);p===U?D.push("L",V[0],"A",U,",",U," 0 0,",g," ",V[1],"A",t,",",t," 0 ",d^pa(V[1][0],V[1][1],B[1][0],B[1][1]),",",1-d," ",B[1],"A",U,",",U," 0 0,",g," ",B[0]):D.push("L",V[0],"A",U,",",U," 0 0,",g," ",B[0])}else D.push("L",C,",",S)}else{D.push("M",y,",",b);null!=x&&D.push("A",u,",",u," 0 ",L,",",d," ",x,",",w);D.push("L",C,",",S);null!=T&&D.push("A",t,",",t," 0 ",N,",",1-d," ",T,",",k)}D.push("Z");return D.join("")}function e(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}var n=ua,r=ca,i=la,o=Du,a=fa,s=ha,l=da;t.innerRadius=function(e){if(!arguments.length)return n;n=De(e);return t};t.outerRadius=function(e){if(!arguments.length)return r;r=De(e);return t};t.cornerRadius=function(e){if(!arguments.length)return i;i=De(e);return t};t.padRadius=function(e){if(!arguments.length)return o;o=e==Du?Du:De(e);return t};t.startAngle=function(e){if(!arguments.length)return a;a=De(e);return t};t.endAngle=function(e){if(!arguments.length)return s;s=De(e);return t};t.padAngle=function(e){if(!arguments.length)return l;l=De(e);return t};t.centroid=function(){var t=(+n.apply(this,arguments)+ +r.apply(this,arguments))/2,e=(+a.apply(this,arguments)+ +s.apply(this,arguments))/2-Os;return[Math.cos(e)*t,Math.sin(e)*t]};return t};var Du="auto";is.svg.line=function(){return ma(x)};var Lu=is.map({linear:va,"linear-closed":ya,step:ba,"step-before":xa,"step-after":wa,basis:Ma,"basis-open":Da,"basis-closed":La,bundle:Aa,cardinal:Ta,"cardinal-open":Ca,"cardinal-closed":Sa,monotone:Ha});Lu.forEach(function(t,e){e.key=t;e.closed=/-closed$/.test(t)});var Au=[0,2/3,1/3,0],Nu=[0,1/3,2/3,0],Eu=[0,1/6,2/3,1/6];is.svg.line.radial=function(){var t=ma(Oa);t.radius=t.x,delete t.x;t.angle=t.y,delete t.y;return t};xa.reverse=wa;wa.reverse=xa;is.svg.area=function(){return Ra(x)};is.svg.area.radial=function(){var t=Ra(Oa);t.radius=t.x,delete t.x;t.innerRadius=t.x0,delete t.x0;t.outerRadius=t.x1,delete t.x1;t.angle=t.y,delete t.y;t.startAngle=t.y0,delete t.y0;t.endAngle=t.y1,delete t.y1;return t};is.svg.chord=function(){function t(t,s){var l=e(this,o,t,s),u=e(this,a,t,s);return"M"+l.p0+r(l.r,l.p1,l.a1-l.a0)+(n(l,u)?i(l.r,l.p1,l.r,l.p0):i(l.r,l.p1,u.r,u.p0)+r(u.r,u.p1,u.a1-u.a0)+i(u.r,u.p1,l.r,l.p0))+"Z"}function e(t,e,n,r){var i=e.call(t,n,r),o=s.call(t,i,r),a=l.call(t,i,r)-Os,c=u.call(t,i,r)-Os;return{r:o,a0:a,a1:c,p0:[o*Math.cos(a),o*Math.sin(a)],p1:[o*Math.cos(c),o*Math.sin(c)]}}function n(t,e){return t.a0==e.a0&&t.a1==e.a1}function r(t,e,n){return"A"+t+","+t+" 0 "+ +(n>Ps)+",1 "+e}function i(t,e,n,r){return"Q 0,0 "+r}var o=xr,a=wr,s=Fa,l=fa,u=ha;t.radius=function(e){if(!arguments.length)return s;s=De(e);return t};t.source=function(e){if(!arguments.length)return o;o=De(e);return t};t.target=function(e){if(!arguments.length)return a;a=De(e);return t};t.startAngle=function(e){if(!arguments.length)return l;l=De(e);return t};t.endAngle=function(e){if(!arguments.length)return u;u=De(e);return t};return t};is.svg.diagonal=function(){function t(t,i){var o=e.call(this,t,i),a=n.call(this,t,i),s=(o.y+a.y)/2,l=[o,{x:o.x,y:s},{x:a.x,y:s},a];l=l.map(r);return"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var e=xr,n=wr,r=Wa;t.source=function(n){if(!arguments.length)return e;e=De(n);return t};t.target=function(e){if(!arguments.length)return n;n=De(e);return t};t.projection=function(e){if(!arguments.length)return r;r=e;return t};return t};is.svg.diagonal.radial=function(){var t=is.svg.diagonal(),e=Wa,n=t.projection;t.projection=function(t){return arguments.length?n(za(e=t)):e};return t};is.svg.symbol=function(){function t(t,r){return(ju.get(e.call(this,t,r))||Ba)(n.call(this,t,r))}var e=Ua,n=qa;t.type=function(n){if(!arguments.length)return e;e=De(n);return t};t.size=function(e){if(!arguments.length)return n;n=De(e);return t};return t};var ju=is.map({circle:Ba,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Iu)),n=e*Iu;return"M0,"+-e+"L"+n+",0 0,"+e+" "+-n+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/Pu),n=e*Pu/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Pu),n=e*Pu/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});is.svg.symbolTypes=ju.keys();var Pu=Math.sqrt(3),Iu=Math.tan(30*Rs);ks.transition=function(t){for(var e,n,r=Hu||++Wu,i=Ya(t),o=[],a=Ou||{time:Date.now(),ease:Mi,delay:0,duration:250},s=-1,l=this.length;++s<l;){o.push(e=[]);for(var u=this[s],c=-1,f=u.length;++c<f;){(n=u[c])&&Ja(n,c,i,r,a);e.push(n)}}return Xa(o,i,r)};ks.interrupt=function(t){return this.each(null==t?Ru:Va(Ya(t)))};var Hu,Ou,Ru=Va(Ya()),Fu=[],Wu=0;Fu.call=ks.call;Fu.empty=ks.empty;Fu.node=ks.node;Fu.size=ks.size;is.transition=function(t,e){return t&&t.transition?Hu?t.transition(e):t:is.selection().transition(t)};is.transition.prototype=Fu;Fu.select=function(t){var e,n,r,i=this.id,o=this.namespace,a=[];t=A(t);for(var s=-1,l=this.length;++s<l;){a.push(e=[]);for(var u=this[s],c=-1,f=u.length;++c<f;)if((r=u[c])&&(n=t.call(r,r.__data__,c,s))){"__data__"in r&&(n.__data__=r.__data__);Ja(n,c,o,i,r[o][i]);e.push(n)}else e.push(null)}return Xa(a,o,i)};Fu.selectAll=function(t){var e,n,r,i,o,a=this.id,s=this.namespace,l=[];t=N(t);for(var u=-1,c=this.length;++u<c;)for(var f=this[u],h=-1,d=f.length;++h<d;)if(r=f[h]){o=r[s][a];n=t.call(r,r.__data__,h,u);l.push(e=[]);for(var p=-1,g=n.length;++p<g;){(i=n[p])&&Ja(i,p,s,a,o);e.push(i)}}return Xa(l,s,a)};Fu.filter=function(t){var e,n,r,i=[];"function"!=typeof t&&(t=U(t));for(var o=0,a=this.length;a>o;o++){i.push(e=[]);for(var n=this[o],s=0,l=n.length;l>s;s++)(r=n[s])&&t.call(r,r.__data__,s,o)&&e.push(r)}return Xa(i,this.namespace,this.id)};Fu.tween=function(t,e){var n=this.id,r=this.namespace;return arguments.length<2?this.node()[r][n].tween.get(t):V(this,null==e?function(e){e[r][n].tween.remove(t)}:function(i){i[r][n].tween.set(t,e)})};Fu.attr=function(t,e){function n(){this.removeAttribute(s)}function r(){this.removeAttributeNS(s.space,s.local)}function i(t){return null==t?n:(t+="",function(){var e,n=this.getAttribute(s);return n!==t&&(e=a(n,t),function(t){this.setAttribute(s,e(t))})})}function o(t){return null==t?r:(t+="",function(){var e,n=this.getAttributeNS(s.space,s.local);return n!==t&&(e=a(n,t),function(t){this.setAttributeNS(s.space,s.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var a="transform"==t?Ui:xi,s=is.ns.qualify(t);return Ga(this,"attr."+t,e,s.local?o:i)};Fu.attrTween=function(t,e){function n(t,n){var r=e.call(this,t,n,this.getAttribute(i));return r&&function(t){this.setAttribute(i,r(t))}}function r(t,n){var r=e.call(this,t,n,this.getAttributeNS(i.space,i.local));return r&&function(t){this.setAttributeNS(i.space,i.local,r(t))}}var i=is.ns.qualify(t);return this.tween("attr."+t,i.local?r:n)};Fu.style=function(t,e,n){function i(){this.style.removeProperty(t)}function o(e){return null==e?i:(e+="",function(){var i,o=r(this).getComputedStyle(this,null).getPropertyValue(t);return o!==e&&(i=xi(o,e),function(e){this.style.setProperty(t,i(e),n)})})}var a=arguments.length;if(3>a){if("string"!=typeof t){2>a&&(e="");for(n in t)this.style(n,t[n],e);return this}n=""}return Ga(this,"style."+t,e,o)};Fu.styleTween=function(t,e,n){function i(i,o){var a=e.call(this,i,o,r(this).getComputedStyle(this,null).getPropertyValue(t));return a&&function(e){this.style.setProperty(t,a(e),n)}}arguments.length<3&&(n="");return this.tween("style."+t,i)};Fu.text=function(t){return Ga(this,"text",t,$a)};Fu.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})};Fu.ease=function(t){var e=this.id,n=this.namespace;if(arguments.length<1)return this.node()[n][e].ease;"function"!=typeof t&&(t=is.ease.apply(is,arguments));return V(this,function(r){r[n][e].ease=t})};Fu.delay=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].delay:V(this,"function"==typeof t?function(r,i,o){r[n][e].delay=+t.call(r,r.__data__,i,o)}:(t=+t,function(r){r[n][e].delay=t}))};Fu.duration=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].duration:V(this,"function"==typeof t?function(r,i,o){r[n][e].duration=Math.max(1,t.call(r,r.__data__,i,o))}:(t=Math.max(1,t),function(r){r[n][e].duration=t}))};Fu.each=function(t,e){var n=this.id,r=this.namespace;if(arguments.length<2){var i=Ou,o=Hu;try{Hu=n;V(this,function(e,i,o){Ou=e[r][n];t.call(e,e.__data__,i,o)})}finally{Ou=i;Hu=o}}else V(this,function(i){var o=i[r][n];(o.event||(o.event=is.dispatch("start","end","interrupt"))).on(t,e)});return this};Fu.transition=function(){for(var t,e,n,r,i=this.id,o=++Wu,a=this.namespace,s=[],l=0,u=this.length;u>l;l++){s.push(t=[]);for(var e=this[l],c=0,f=e.length;f>c;c++){if(n=e[c]){r=n[a][i];Ja(n,c,a,o,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})}t.push(n)}}return Xa(s,a,o)};is.svg.axis=function(){function t(t){t.each(function(){var t,u=is.select(this),c=this.__chart__||n,f=this.__chart__=n.copy(),h=null==l?f.ticks?f.ticks.apply(f,s):f.domain():l,d=null==e?f.tickFormat?f.tickFormat.apply(f,s):x:e,p=u.selectAll(".tick").data(h,f),g=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Es),m=is.transition(p.exit()).style("opacity",Es).remove(),v=is.transition(p.order()).style("opacity",1),y=Math.max(i,0)+a,b=zo(f),w=u.selectAll(".domain").data([0]),C=(w.enter().append("path").attr("class","domain"),is.transition(w));g.append("line");g.append("text");var S,T,k,_,M=g.select("line"),D=v.select("line"),L=p.select("text").text(d),A=g.select("text"),N=v.select("text"),E="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r){t=Ka,S="x",k="y",T="x2",_="y2";L.attr("dy",0>E?"0em":".71em").style("text-anchor","middle");C.attr("d","M"+b[0]+","+E*o+"V0H"+b[1]+"V"+E*o)}else{t=Za,S="y",k="x",T="y2",_="x2";L.attr("dy",".32em").style("text-anchor",0>E?"end":"start");C.attr("d","M"+E*o+","+b[0]+"H0V"+b[1]+"H"+E*o)}M.attr(_,E*i);A.attr(k,E*y);D.attr(T,0).attr(_,E*i);N.attr(S,0).attr(k,E*y);if(f.rangeBand){var j=f,P=j.rangeBand()/2;c=f=function(t){return j(t)+P}}else c.rangeBand?c=f:m.call(t,f,c);g.call(t,c,f);v.call(t,f,f)})}var e,n=is.scale.linear(),r=zu,i=6,o=6,a=3,s=[10],l=null;t.scale=function(e){if(!arguments.length)return n;n=e;return t};t.orient=function(e){if(!arguments.length)return r;r=e in qu?e+"":zu;return t};t.ticks=function(){if(!arguments.length)return s;s=arguments;return t};t.tickValues=function(e){if(!arguments.length)return l;l=e;return t};t.tickFormat=function(n){if(!arguments.length)return e;e=n;return t};t.tickSize=function(e){var n=arguments.length;if(!n)return i;i=+e;o=+arguments[n-1];return t};t.innerTickSize=function(e){if(!arguments.length)return i;i=+e;return t};t.outerTickSize=function(e){if(!arguments.length)return o;o=+e;return t};t.tickPadding=function(e){if(!arguments.length)return a;a=+e;return t};t.tickSubdivide=function(){return arguments.length&&t};return t};var zu="bottom",qu={top:1,right:1,bottom:1,left:1};is.svg.brush=function(){function t(r){r.each(function(){var r=is.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",o).on("touchstart.brush",o),a=r.selectAll(".background").data([0]);a.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair");r.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var s=r.selectAll(".resize").data(g,x);s.exit().remove();s.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Uu[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden");s.style("display",t.empty()?"none":null);var l,f=is.transition(r),h=is.transition(a);if(u){l=zo(u);h.attr("x",l[0]).attr("width",l[1]-l[0]);n(f)}if(c){l=zo(c);h.attr("y",l[0]).attr("height",l[1]-l[0]);i(f)}e(f)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+f[+/e$/.test(t)]+","+h[+/^s/.test(t)]+")"})}function n(t){t.select(".extent").attr("x",f[0]);t.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function i(t){t.select(".extent").attr("y",h[0]);t.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function o(){function o(){if(32==is.event.keyCode){if(!L){b=null;N[0]-=f[1];N[1]-=h[1];L=2}_()}}function g(){if(32==is.event.keyCode&&2==L){N[0]+=f[1];N[1]+=h[1];L=0;_()}}function m(){var t=is.mouse(w),r=!1;if(x){t[0]+=x[0];t[1]+=x[1]}if(!L)if(is.event.altKey){b||(b=[(f[0]+f[1])/2,(h[0]+h[1])/2]);N[0]=f[+(t[0]<b[0])];N[1]=h[+(t[1]<b[1])]}else b=null;if(M&&v(t,u,0)){n(T);r=!0}if(D&&v(t,c,1)){i(T);r=!0}if(r){e(T);S({type:"brush",mode:L?"move":"resize"})}}function v(t,e,n){var r,i,o=zo(e),l=o[0],u=o[1],c=N[n],g=n?h:f,m=g[1]-g[0];if(L){l-=c;u-=m+c}r=(n?p:d)?Math.max(l,Math.min(u,t[n])):t[n];if(L)i=(r+=c)+m;else{b&&(c=Math.max(l,Math.min(u,2*b[n]-r)));if(r>c){i=r;r=c}else i=c}if(g[0]!=r||g[1]!=i){n?s=null:a=null;g[0]=r;g[1]=i;return!0}}function y(){m();T.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null);is.select("body").style("cursor",null);E.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null);A();S({type:"brushend"})}var b,x,w=this,C=is.select(is.event.target),S=l.of(w,arguments),T=is.select(w),k=C.datum(),M=!/^(n|s)$/.test(k)&&u,D=!/^(e|w)$/.test(k)&&c,L=C.classed("extent"),A=K(w),N=is.mouse(w),E=is.select(r(w)).on("keydown.brush",o).on("keyup.brush",g);is.event.changedTouches?E.on("touchmove.brush",m).on("touchend.brush",y):E.on("mousemove.brush",m).on("mouseup.brush",y);T.interrupt().selectAll("*").interrupt();if(L){N[0]=f[0]-N[0];N[1]=h[0]-N[1]}else if(k){var j=+/w$/.test(k),P=+/^n/.test(k);x=[f[1-j]-N[0],h[1-P]-N[1]];N[0]=f[j];N[1]=h[P]}else is.event.altKey&&(b=N.slice());T.style("pointer-events","none").selectAll(".resize").style("display",null);is.select("body").style("cursor",C.style("cursor"));S({type:"brushstart"});m()}var a,s,l=D(t,"brushstart","brush","brushend"),u=null,c=null,f=[0,0],h=[0,0],d=!0,p=!0,g=Bu[0];t.event=function(t){t.each(function(){var t=l.of(this,arguments),e={x:f,y:h,i:a,j:s},n=this.__chart__||e;this.__chart__=e;if(Hu)is.select(this).transition().each("start.brush",function(){a=n.i;s=n.j;f=n.x;h=n.y;t({type:"brushstart"})}).tween("brush:brush",function(){var n=wi(f,e.x),r=wi(h,e.y);a=s=null;return function(i){f=e.x=n(i);h=e.y=r(i);t({type:"brush",mode:"resize"})}}).each("end.brush",function(){a=e.i;s=e.j;t({type:"brush",mode:"resize"});t({type:"brushend"})});else{t({type:"brushstart"});t({type:"brush",mode:"resize"});t({type:"brushend"})}})};t.x=function(e){if(!arguments.length)return u;u=e;g=Bu[!u<<1|!c];return t};t.y=function(e){if(!arguments.length)return c;c=e;g=Bu[!u<<1|!c];return t};t.clamp=function(e){if(!arguments.length)return u&&c?[d,p]:u?d:c?p:null;u&&c?(d=!!e[0],p=!!e[1]):u?d=!!e:c&&(p=!!e);return t};t.extent=function(e){var n,r,i,o,l;if(!arguments.length){if(u)if(a)n=a[0],r=a[1];else{n=f[0],r=f[1];u.invert&&(n=u.invert(n),r=u.invert(r));n>r&&(l=n,n=r,r=l)}if(c)if(s)i=s[0],o=s[1];else{i=h[0],o=h[1];c.invert&&(i=c.invert(i),o=c.invert(o));i>o&&(l=i,i=o,o=l)}return u&&c?[[n,i],[r,o]]:u?[n,r]:c&&[i,o]}if(u){n=e[0],r=e[1];c&&(n=n[0],r=r[0]);a=[n,r];u.invert&&(n=u(n),r=u(r));n>r&&(l=n,n=r,r=l);(n!=f[0]||r!=f[1])&&(f=[n,r])}if(c){i=e[0],o=e[1];u&&(i=i[1],o=o[1]);s=[i,o];c.invert&&(i=c(i),o=c(o));i>o&&(l=i,i=o,o=l);(i!=h[0]||o!=h[1])&&(h=[i,o])}return t};t.clear=function(){if(!t.empty()){f=[0,0],h=[0,0];a=s=null}return t};t.empty=function(){return!!u&&f[0]==f[1]||!!c&&h[0]==h[1]};return is.rebind(t,l,"on")};var Uu={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Bu=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Vu=cl.format=ml.timeFormat,Xu=Vu.utc,Gu=Xu("%Y-%m-%dT%H:%M:%S.%LZ");Vu.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Qa:Gu;Qa.parse=function(t){var e=new Date(t);return isNaN(e)?null:e};Qa.toString=Gu.toString;cl.second=ze(function(t){return new fl(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()});cl.seconds=cl.second.range;cl.seconds.utc=cl.second.utc.range;cl.minute=ze(function(t){return new fl(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()});cl.minutes=cl.minute.range;cl.minutes.utc=cl.minute.utc.range;cl.hour=ze(function(t){var e=t.getTimezoneOffset()/60;return new fl(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()});cl.hours=cl.hour.range;cl.hours.utc=cl.hour.utc.range;cl.month=ze(function(t){t=cl.day(t);t.setDate(1);return t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()});cl.months=cl.month.range;cl.months.utc=cl.month.utc.range;var $u=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Yu=[[cl.second,1],[cl.second,5],[cl.second,15],[cl.second,30],[cl.minute,1],[cl.minute,5],[cl.minute,15],[cl.minute,30],[cl.hour,1],[cl.hour,3],[cl.hour,6],[cl.hour,12],[cl.day,1],[cl.day,2],[cl.week,1],[cl.month,1],[cl.month,3],[cl.year,1]],Ju=Vu.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Nn]]),Ku={range:function(t,e,n){return is.range(Math.ceil(t/n)*n,+e,n).map(es)},floor:x,ceil:x};Yu.year=cl.year;cl.scale=function(){return ts(is.scale.linear(),Yu,Ju)};var Zu=Yu.map(function(t){return[t[0].utc,t[1]]}),Qu=Xu.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Nn]]);Zu.year=cl.year.utc;cl.scale.utc=function(){return ts(is.scale.linear(),Zu,Qu)};is.text=Le(function(t){return t.responseText});is.json=function(t,e){return Ae(t,"application/json",ns,e)};is.html=function(t,e){return Ae(t,"text/html",rs,e)};is.xml=Le(function(t){return t.responseXML});"function"==typeof t&&t.amd?t(is):"object"==typeof n&&n.exports&&(n.exports=is);this.d3=is}()},{}],15:[function(t){var e=t("jquery");(function(t,e){function n(e,n){var i,o,a,s=e.nodeName.toLowerCase();if("area"===s){i=e.parentNode;o=i.name;if(!e.href||!o||"map"!==i.nodeName.toLowerCase())return!1;a=t("img[usemap=#"+o+"]")[0];return!!a&&r(a)}return(/input|select|textarea|button|object/.test(s)?!e.disabled:"a"===s?e.href||n:n)&&r(e)}function r(e){return t.expr.filters.visible(e)&&!t(e).parents().addBack().filter(function(){return"hidden"===t.css(this,"visibility")}).length}var i=0,o=/^ui-id-\d+$/;t.ui=t.ui||{};t.extend(t.ui,{version:"1.10.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}});t.fn.extend({focus:function(e){return function(n,r){return"number"==typeof n?this.each(function(){var e=this;setTimeout(function(){t(e).focus();r&&r.call(e)},n)}):e.apply(this,arguments)}}(t.fn.focus),scrollParent:function(){var e;e=t.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(t.css(this,"position"))&&/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0);return/fixed/.test(this.css("position"))||!e.length?t(document):e},zIndex:function(n){if(n!==e)return this.css("zIndex",n);if(this.length)for(var r,i,o=t(this[0]);o.length&&o[0]!==document;){r=o.css("position");if("absolute"===r||"relative"===r||"fixed"===r){i=parseInt(o.css("zIndex"),10);if(!isNaN(i)&&0!==i)return i}o=o.parent()
}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++i)})},removeUniqueId:function(){return this.each(function(){o.test(this.id)&&t(this).removeAttr("id")})}});t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(n){return!!t.data(n,e)}}):function(e,n,r){return!!t.data(e,r[3])},focusable:function(e){return n(e,!isNaN(t.attr(e,"tabindex")))},tabbable:function(e){var r=t.attr(e,"tabindex"),i=isNaN(r);return(i||r>=0)&&n(e,!i)}});t("<a>").outerWidth(1).jquery||t.each(["Width","Height"],function(n,r){function i(e,n,r,i){t.each(o,function(){n-=parseFloat(t.css(e,"padding"+this))||0;r&&(n-=parseFloat(t.css(e,"border"+this+"Width"))||0);i&&(n-=parseFloat(t.css(e,"margin"+this))||0)});return n}var o="Width"===r?["Left","Right"]:["Top","Bottom"],a=r.toLowerCase(),s={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+r]=function(n){return n===e?s["inner"+r].call(this):this.each(function(){t(this).css(a,i(this,n)+"px")})};t.fn["outer"+r]=function(e,n){return"number"!=typeof e?s["outer"+r].call(this,e):this.each(function(){t(this).css(a,i(this,e,!0,n)+"px")})}});t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))});t("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(n){return arguments.length?e.call(this,t.camelCase(n)):e.call(this)}}(t.fn.removeData));t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());t.support.selectstart="onselectstart"in document.createElement("div");t.fn.extend({disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(t){t.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});t.extend(t.ui,{plugin:{add:function(e,n,r){var i,o=t.ui[e].prototype;for(i in r){o.plugins[i]=o.plugins[i]||[];o.plugins[i].push([n,r[i]])}},call:function(t,e,n){var r,i=t.plugins[e];if(i&&t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType)for(r=0;r<i.length;r++)t.options[i[r][0]]&&i[r][1].apply(t.element,n)}},hasScroll:function(e,n){if("hidden"===t(e).css("overflow"))return!1;var r=n&&"left"===n?"scrollLeft":"scrollTop",i=!1;if(e[r]>0)return!0;e[r]=1;i=e[r]>0;e[r]=0;return i}})})(e)},{jquery:19}],16:[function(t){var e=t("jquery");t("./widget");(function(t){var e=!1;t(document).mouseup(function(){e=!1});t.widget("ui.mouse",{version:"1.10.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(n){if(!0===t.data(n.target,e.widgetName+".preventClickEvent")){t.removeData(n.target,e.widgetName+".preventClickEvent");n.stopImmediatePropagation();return!1}});this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(n){if(!e){this._mouseStarted&&this._mouseUp(n);this._mouseDownEvent=n;var r=this,i=1===n.which,o="string"==typeof this.options.cancel&&n.target.nodeName?t(n.target).closest(this.options.cancel).length:!1;if(!i||o||!this._mouseCapture(n))return!0;this.mouseDelayMet=!this.options.delay;this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){r.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(n)&&this._mouseDelayMet(n)){this._mouseStarted=this._mouseStart(n)!==!1;if(!this._mouseStarted){n.preventDefault();return!0}}!0===t.data(n.target,this.widgetName+".preventClickEvent")&&t.removeData(n.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(t){return r._mouseMove(t)};this._mouseUpDelegate=function(t){return r._mouseUp(t)};t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);n.preventDefault();e=!0;return!0}},_mouseMove:function(e){if(t.ui.ie&&(!document.documentMode||document.documentMode<9)&&!e.button)return this._mouseUp(e);if(this._mouseStarted){this._mouseDrag(e);return e.preventDefault()}if(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)){this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1;this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)}return!this._mouseStarted},_mouseUp:function(e){t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=!1;e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0);this._mouseStop(e)}return!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(e)},{"./widget":18,jquery:19}],17:[function(t){var e=t("jquery");t("./core");t("./mouse");t("./widget");(function(t){function e(t,e,n){return t>e&&e+n>t}function n(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))}t.widget("ui.sortable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var t=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?"x"===t.axis||n(this.items[0].item):!1;this.offset=this.element.offset();this._mouseInit();this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled");this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,n){if("disabled"===e){this.options[e]=n;this.widget().toggleClass("ui-sortable-disabled",!!n)}else t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,n){var r=null,i=!1,o=this;if(this.reverting)return!1;if(this.options.disabled||"static"===this.options.type)return!1;this._refreshItems(e);t(e.target).parents().each(function(){if(t.data(this,o.widgetName+"-item")===o){r=t(this);return!1}});t.data(e.target,o.widgetName+"-item")===o&&(r=t(e.target));if(!r)return!1;if(this.options.handle&&!n){t(this.options.handle,r).find("*").addBack().each(function(){this===e.target&&(i=!0)});if(!i)return!1}this.currentItem=r;this._removeCurrentsFromItems();return!0},_mouseStart:function(e,n,r){var i,o,a=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(e);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");this.originalPosition=this._generatePosition(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!==this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();a.containment&&this._setContainment();if(a.cursor&&"auto"!==a.cursor){o=this.document.find("body");this.storedCursor=o.css("cursor");o.css("cursor",a.cursor);this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)}if(a.opacity){this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity"));this.helper.css("opacity",a.opacity)}if(a.zIndex){this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex"));this.helper.css("zIndex",a.zIndex)}this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset());this._trigger("start",e,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!r)for(i=this.containers.length-1;i>=0;i--)this.containers[i]._trigger("activate",e,this._uiHash(this));t.ui.ddmanager&&(t.ui.ddmanager.current=this);t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e);this.dragging=!0;this.helper.addClass("ui-sortable-helper");this._mouseDrag(e);return!0},_mouseDrag:function(e){var n,r,i,o,a=this.options,s=!1;this.position=this._generatePosition(e);this.positionAbs=this._convertPositionTo("absolute");this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){if(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName){this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=s=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=s=this.scrollParent[0].scrollTop-a.scrollSpeed);this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=s=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=s=this.scrollParent[0].scrollLeft-a.scrollSpeed)}else{e.pageY-t(document).scrollTop()<a.scrollSensitivity?s=t(document).scrollTop(t(document).scrollTop()-a.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<a.scrollSensitivity&&(s=t(document).scrollTop(t(document).scrollTop()+a.scrollSpeed));e.pageX-t(document).scrollLeft()<a.scrollSensitivity?s=t(document).scrollLeft(t(document).scrollLeft()-a.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<a.scrollSensitivity&&(s=t(document).scrollLeft(t(document).scrollLeft()+a.scrollSpeed))}s!==!1&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)}this.positionAbs=this._convertPositionTo("absolute");this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px");this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px");for(n=this.items.length-1;n>=0;n--){r=this.items[n];i=r.item[0];o=this._intersectsWithPointer(r);if(o&&r.instance===this.currentContainer&&i!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==i&&!t.contains(this.placeholder[0],i)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],i):!0)){this.direction=1===o?"down":"up";if("pointer"!==this.options.tolerance&&!this._intersectsWithSides(r))break;this._rearrange(e,r);this._trigger("change",e,this._uiHash());break}}this._contactContainers(e);t.ui.ddmanager&&t.ui.ddmanager.drag(this,e);this._trigger("sort",e,this._uiHash());this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(e,n){if(e){t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e);if(this.options.revert){var r=this,i=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=i.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft));o&&"y"!==o||(a.top=i.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop));this.reverting=!0;t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){r._clear(e)})}else this._clear(e,n);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null});"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--){this.containers[e]._trigger("deactivate",null,this._uiHash(this));if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",null,this._uiHash(this));this.containers[e].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove();t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null});this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(e){var n=this._getItemsAsjQuery(e&&e.connected),r=[];e=e||{};t(n).each(function(){var n=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);n&&r.push((e.key||n[1]+"[]")+"="+(e.key&&e.expression?n[1]:n[2]))});!r.length&&e.key&&r.push(e.key+"=");return r.join("&")},toArray:function(e){var n=this._getItemsAsjQuery(e&&e.connected),r=[];e=e||{};n.each(function(){r.push(t(e.item||this).attr(e.attribute||"id")||"")});return r},_intersectsWith:function(t){var e=this.positionAbs.left,n=e+this.helperProportions.width,r=this.positionAbs.top,i=r+this.helperProportions.height,o=t.left,a=o+t.width,s=t.top,l=s+t.height,u=this.offset.click.top,c=this.offset.click.left,f="x"===this.options.axis||r+u>s&&l>r+u,h="y"===this.options.axis||e+c>o&&a>e+c,d=f&&h;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?d:o<e+this.helperProportions.width/2&&n-this.helperProportions.width/2<a&&s<r+this.helperProportions.height/2&&i-this.helperProportions.height/2<l},_intersectsWithPointer:function(t){var n="x"===this.options.axis||e(this.positionAbs.top+this.offset.click.top,t.top,t.height),r="y"===this.options.axis||e(this.positionAbs.left+this.offset.click.left,t.left,t.width),i=n&&r,o=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return i?this.floating?a&&"right"===a||"down"===o?2:1:o&&("down"===o?2:1):!1},_intersectsWithSides:function(t){var n=e(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),r=e(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),i=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return this.floating&&o?"right"===o&&r||"left"===o&&!r:i&&("down"===i&&n||"up"===i&&!n)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){this._refreshItems(t);this.refreshPositions();return this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function n(){s.push(this)}var r,i,o,a,s=[],l=[],u=this._connectWith();if(u&&e)for(r=u.length-1;r>=0;r--){o=t(u[r]);for(i=o.length-1;i>=0;i--){a=t.data(o[i],this.widgetFullName);a&&a!==this&&!a.options.disabled&&l.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a])}}l.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(r=l.length-1;r>=0;r--)l[r][0].each(n);return t(s)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var n=0;n<e.length;n++)if(e[n]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[];this.containers=[this];var n,r,i,o,a,s,l,u,c=this.items,f=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],h=this._connectWith();if(h&&this.ready)for(n=h.length-1;n>=0;n--){i=t(h[n]);for(r=i.length-1;r>=0;r--){o=t.data(i[r],this.widgetFullName);if(o&&o!==this&&!o.options.disabled){f.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]);this.containers.push(o)}}}for(n=f.length-1;n>=0;n--){a=f[n][1];s=f[n][0];for(r=0,u=s.length;u>r;r++){l=t(s[r]);l.data(this.widgetName+"-item",a);c.push({item:l,instance:a,width:0,height:0,left:0,top:0})}}},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var n,r,i,o;for(n=this.items.length-1;n>=0;n--){r=this.items[n];if(r.instance===this.currentContainer||!this.currentContainer||r.item[0]===this.currentItem[0]){i=this.options.toleranceElement?t(this.options.toleranceElement,r.item):r.item;if(!e){r.width=i.outerWidth();r.height=i.outerHeight()}o=i.offset();r.left=o.left;r.top=o.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(n=this.containers.length-1;n>=0;n--){o=this.containers[n].element.offset();this.containers[n].containerCache.left=o.left;this.containers[n].containerCache.top=o.top;this.containers[n].containerCache.width=this.containers[n].element.outerWidth();this.containers[n].containerCache.height=this.containers[n].element.outerHeight()}return this},_createPlaceholder:function(e){e=e||this;var n,r=e.options;if(!r.placeholder||r.placeholder.constructor===String){n=r.placeholder;r.placeholder={element:function(){var r=e.currentItem[0].nodeName.toLowerCase(),i=t("<"+r+">",e.document[0]).addClass(n||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");"tr"===r?e.currentItem.children().each(function(){t("<td> </td>",e.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)}):"img"===r&&i.attr("src",e.currentItem.attr("src"));n||i.css("visibility","hidden");return i},update:function(t,i){if(!n||r.forcePlaceholderSize){i.height()||i.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10));i.width()||i.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10))}}}}e.placeholder=t(r.placeholder.element.call(e.element,e.currentItem));e.currentItem.after(e.placeholder);r.placeholder.update(e,e.placeholder)},_contactContainers:function(r){var i,o,a,s,l,u,c,f,h,d,p=null,g=null;for(i=this.containers.length-1;i>=0;i--)if(!t.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(p&&t.contains(this.containers[i].element[0],p.element[0]))continue;p=this.containers[i];g=i}else if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",r,this._uiHash(this));this.containers[i].containerCache.over=0}if(p)if(1===this.containers.length){if(!this.containers[g].containerCache.over){this.containers[g]._trigger("over",r,this._uiHash(this));this.containers[g].containerCache.over=1}}else{a=1e4;s=null;d=p.floating||n(this.currentItem);l=d?"left":"top";u=d?"width":"height";c=this.positionAbs[l]+this.offset.click[l];for(o=this.items.length-1;o>=0;o--)if(t.contains(this.containers[g].element[0],this.items[o].item[0])&&this.items[o].item[0]!==this.currentItem[0]&&(!d||e(this.positionAbs.top+this.offset.click.top,this.items[o].top,this.items[o].height))){f=this.items[o].item.offset()[l];h=!1;if(Math.abs(f-c)>Math.abs(f+this.items[o][u]-c)){h=!0;f+=this.items[o][u]}if(Math.abs(f-c)<a){a=Math.abs(f-c);s=this.items[o];this.direction=h?"up":"down"}}if(!s&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[g])return;s?this._rearrange(r,s,null,!0):this._rearrange(r,null,this.containers[g].element,!0);this._trigger("change",r,this._uiHash());this.containers[g]._trigger("change",r,this._uiHash(this));this.currentContainer=this.containers[g];this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[g]._trigger("over",r,this._uiHash(this));this.containers[g].containerCache.over=1}},_createHelper:function(e){var n=this.options,r=t.isFunction(n.helper)?t(n.helper.apply(this.element[0],[e,this.currentItem])):"clone"===n.helper?this.currentItem.clone():this.currentItem;r.parents("body").length||t("parent"!==n.appendTo?n.appendTo:this.currentItem[0].parentNode)[0].appendChild(r[0]);r[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")});(!r[0].style.width||n.forceHelperSize)&&r.width(this.currentItem.width());(!r[0].style.height||n.forceHelperSize)&&r.height(this.currentItem.height());return r},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" "));t.isArray(e)&&(e={left:+e[0],top:+e[1]||0});"left"in e&&(this.offset.click.left=e.left+this.margins.left);"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left);"top"in e&&(this.offset.click.top=e.top+this.margins.top);"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();if("absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])){e.left+=this.scrollParent.scrollLeft();e.top+=this.scrollParent.scrollTop()}(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0});return{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,n,r,i=this.options;"parent"===i.containment&&(i.containment=this.helper[0].parentNode);("document"===i.containment||"window"===i.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"===i.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"===i.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]);if(!/^(document|window|parent)$/.test(i.containment)){e=t(i.containment)[0];n=t(i.containment).offset();r="hidden"!==t(e).css("overflow");this.containment=[n.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,n.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,n.left+(r?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,n.top+(r?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(e,n){n||(n=this.position);var r="absolute"===e?1:-1,i="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(i[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:i.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:i.scrollLeft())*r}},_generatePosition:function(e){var n,r,i=this.options,o=e.pageX,a=e.pageY,s="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=/(html|body)/i.test(s[0].tagName);"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset());if(this.originalPosition){if(this.containment){e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left);e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top);e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left);e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)}if(i.grid){n=this.originalPageY+Math.round((a-this.originalPageY)/i.grid[1])*i.grid[1];a=this.containment?n-this.offset.click.top>=this.containment[1]&&n-this.offset.click.top<=this.containment[3]?n:n-this.offset.click.top>=this.containment[1]?n-i.grid[1]:n+i.grid[1]:n;r=this.originalPageX+Math.round((o-this.originalPageX)/i.grid[0])*i.grid[0];o=this.containment?r-this.offset.click.left>=this.containment[0]&&r-this.offset.click.left<=this.containment[2]?r:r-this.offset.click.left>=this.containment[0]?r-i.grid[0]:r+i.grid[0]:r}}return{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():l?0:s.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():l?0:s.scrollLeft())}},_rearrange:function(t,e,n,r){n?n[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var i=this.counter;this._delay(function(){i===this.counter&&this.refreshPositions(!r)})},_clear:function(t,e){function n(t,e,n){return function(r){n._trigger(t,r,e._uiHash(e))}}this.reverting=!1;var r,i=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]===this.currentItem[0]){for(r in this._storedCSS)("auto"===this._storedCSS[r]||"static"===this._storedCSS[r])&&(this._storedCSS[r]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!e&&i.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))});!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||i.push(function(t){this._trigger("update",t,this._uiHash())});if(this!==this.currentContainer&&!e){i.push(function(t){this._trigger("remove",t,this._uiHash())});i.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer));i.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer))}for(r=this.containers.length-1;r>=0;r--){e||i.push(n("deactivate",this,this.containers[r]));if(this.containers[r].containerCache.over){i.push(n("out",this,this.containers[r]));this.containers[r].containerCache.over=0}}if(this.storedCursor){this.document.find("body").css("cursor",this.storedCursor);this.storedStylesheet.remove()}this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex);this.dragging=!1;if(this.cancelHelperRemoval){if(!e){this._trigger("beforeStop",t,this._uiHash());for(r=0;r<i.length;r++)i[r].call(this,t);this._trigger("stop",t,this._uiHash())}this.fromOutside=!1;return!1}e||this._trigger("beforeStop",t,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!==this.currentItem[0]&&this.helper.remove();this.helper=null;if(!e){for(r=0;r<i.length;r++)i[r].call(this,t);this._trigger("stop",t,this._uiHash())}this.fromOutside=!1;return!0},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var n=e||this;return{helper:n.helper,placeholder:n.placeholder||t([]),position:n.position,originalPosition:n.originalPosition,offset:n.positionAbs,item:n.currentItem,sender:e?e.element:null}}})})(e)},{"./core":15,"./mouse":16,"./widget":18,jquery:19}],18:[function(t){var e=t("jquery");(function(t,e){var n=0,r=Array.prototype.slice,i=t.cleanData;t.cleanData=function(e){for(var n,r=0;null!=(n=e[r]);r++)try{t(n).triggerHandler("remove")}catch(o){}i(e)};t.widget=function(e,n,r){var i,o,a,s,l={},u=e.split(".")[0];e=e.split(".")[1];i=u+"-"+e;if(!r){r=n;n=t.Widget}t.expr[":"][i.toLowerCase()]=function(e){return!!t.data(e,i)};t[u]=t[u]||{};o=t[u][e];a=t[u][e]=function(t,e){if(!this._createWidget)return new a(t,e);arguments.length&&this._createWidget(t,e);return void 0};t.extend(a,o,{version:r.version,_proto:t.extend({},r),_childConstructors:[]});s=new n;s.options=t.widget.extend({},s.options);t.each(r,function(e,r){l[e]=t.isFunction(r)?function(){var t=function(){return n.prototype[e].apply(this,arguments)},i=function(t){return n.prototype[e].apply(this,t)};return function(){var e,n=this._super,o=this._superApply;this._super=t;this._superApply=i;e=r.apply(this,arguments);this._super=n;this._superApply=o;return e}}():r});a.prototype=t.widget.extend(s,{widgetEventPrefix:o?s.widgetEventPrefix||e:e},l,{constructor:a,namespace:u,widgetName:e,widgetFullName:i});if(o){t.each(o._childConstructors,function(e,n){var r=n.prototype;t.widget(r.namespace+"."+r.widgetName,a,n._proto)});delete o._childConstructors}else n._childConstructors.push(a);t.widget.bridge(e,a)};t.widget.extend=function(n){for(var i,o,a=r.call(arguments,1),s=0,l=a.length;l>s;s++)for(i in a[s]){o=a[s][i];a[s].hasOwnProperty(i)&&o!==e&&(n[i]=t.isPlainObject(o)?t.isPlainObject(n[i])?t.widget.extend({},n[i],o):t.widget.extend({},o):o)}return n};t.widget.bridge=function(n,i){var o=i.prototype.widgetFullName||n;t.fn[n]=function(a){var s="string"==typeof a,l=r.call(arguments,1),u=this;a=!s&&l.length?t.widget.extend.apply(null,[a].concat(l)):a;this.each(s?function(){var r,i=t.data(this,o);if(!i)return t.error("cannot call methods on "+n+" prior to initialization; attempted to call method '"+a+"'");if(!t.isFunction(i[a])||"_"===a.charAt(0))return t.error("no such method '"+a+"' for "+n+" widget instance");r=i[a].apply(i,l);if(r!==i&&r!==e){u=r&&r.jquery?u.pushStack(r.get()):r;return!1}}:function(){var e=t.data(this,o);e?e.option(a||{})._init():t.data(this,o,new i(a,this))});return u}};t.Widget=function(){};t.Widget._childConstructors=[];t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,r){r=t(r||this.defaultElement||this)[0];this.element=t(r);this.uuid=n++;this.eventNamespace="."+this.widgetName+this.uuid;this.options=t.widget.extend({},this.options,this._getCreateOptions(),e);
this.bindings=t();this.hoverable=t();this.focusable=t();if(r!==this){t.data(r,this.widgetFullName,this);this._on(!0,this.element,{remove:function(t){t.target===r&&this.destroy()}});this.document=t(r.style?r.ownerDocument:r.document||r);this.window=t(this.document[0].defaultView||this.document[0].parentWindow)}this._create();this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy();this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName));this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled");this.bindings.unbind(this.eventNamespace);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(n,r){var i,o,a,s=n;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof n){s={};i=n.split(".");n=i.shift();if(i.length){o=s[n]=t.widget.extend({},this.options[n]);for(a=0;a<i.length-1;a++){o[i[a]]=o[i[a]]||{};o=o[i[a]]}n=i.pop();if(1===arguments.length)return o[n]===e?null:o[n];o[n]=r}else{if(1===arguments.length)return this.options[n]===e?null:this.options[n];s[n]=r}}this._setOptions(s);return this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){this.options[t]=e;if("disabled"===t){this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus")}return this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(e,n,r){var i,o=this;if("boolean"!=typeof e){r=n;n=e;e=!1}if(r){n=i=t(n);this.bindings=this.bindings.add(n)}else{r=n;n=this.element;i=this.widget()}t.each(r,function(r,a){function s(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(s.guid=a.guid=a.guid||s.guid||t.guid++);var l=r.match(/^(\w+)\s*(.*)$/),u=l[1]+o.eventNamespace,c=l[2];c?i.delegate(c,u,s):n.bind(u,s)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;t.unbind(e).undelegate(e)},_delay:function(t,e){function n(){return("string"==typeof t?r[t]:t).apply(r,arguments)}var r=this;return setTimeout(n,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e);this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e);this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,n,r){var i,o,a=this.options[e];r=r||{};n=t.Event(n);n.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase();n.target=this.element[0];o=n.originalEvent;if(o)for(i in o)i in n||(n[i]=o[i]);this.element.trigger(n,r);return!(t.isFunction(a)&&a.apply(this.element[0],[n].concat(r))===!1||n.isDefaultPrevented())}};t.each({show:"fadeIn",hide:"fadeOut"},function(e,n){t.Widget.prototype["_"+e]=function(r,i,o){"string"==typeof i&&(i={effect:i});var a,s=i?i===!0||"number"==typeof i?n:i.effect||n:e;i=i||{};"number"==typeof i&&(i={duration:i});a=!t.isEmptyObject(i);i.complete=o;i.delay&&r.delay(i.delay);a&&t.effects&&t.effects.effect[s]?r[e](i):s!==e&&r[s]?r[s](i.duration,i.easing,o):r.queue(function(n){t(this)[e]();o&&o.call(r[0]);n()})}})})(e)},{jquery:19}],19:[function(e,n){(function(t,e){"object"==typeof n&&"object"==typeof n.exports?n.exports=t.document?e(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return e(t)}:e(t)})("undefined"!=typeof window?window:this,function(e,n){function r(t){var e=t.length,n=oe.type(t);return"function"===n||oe.isWindow(t)?!1:1===t.nodeType&&e?!0:"array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t}function i(t,e,n){if(oe.isFunction(e))return oe.grep(t,function(t,r){return!!e.call(t,r,t)!==n});if(e.nodeType)return oe.grep(t,function(t){return t===e!==n});if("string"==typeof e){if(de.test(e))return oe.filter(e,t,n);e=oe.filter(e,t)}return oe.grep(t,function(t){return oe.inArray(t,e)>=0!==n})}function o(t,e){do t=t[e];while(t&&1!==t.nodeType);return t}function a(t){var e=we[t]={};oe.each(t.match(xe)||[],function(t,n){e[n]=!0});return e}function s(){if(ge.addEventListener){ge.removeEventListener("DOMContentLoaded",l,!1);e.removeEventListener("load",l,!1)}else{ge.detachEvent("onreadystatechange",l);e.detachEvent("onload",l)}}function l(){if(ge.addEventListener||"load"===event.type||"complete"===ge.readyState){s();oe.ready()}}function u(t,e,n){if(void 0===n&&1===t.nodeType){var r="data-"+e.replace(_e,"-$1").toLowerCase();n=t.getAttribute(r);if("string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:ke.test(n)?oe.parseJSON(n):n}catch(i){}oe.data(t,e,n)}else n=void 0}return n}function c(t){var e;for(e in t)if(("data"!==e||!oe.isEmptyObject(t[e]))&&"toJSON"!==e)return!1;return!0}function f(t,e,n,r){if(oe.acceptData(t)){var i,o,a=oe.expando,s=t.nodeType,l=s?oe.cache:t,u=s?t[a]:t[a]&&a;if(u&&l[u]&&(r||l[u].data)||void 0!==n||"string"!=typeof e){u||(u=s?t[a]=Y.pop()||oe.guid++:a);l[u]||(l[u]=s?{}:{toJSON:oe.noop});("object"==typeof e||"function"==typeof e)&&(r?l[u]=oe.extend(l[u],e):l[u].data=oe.extend(l[u].data,e));o=l[u];if(!r){o.data||(o.data={});o=o.data}void 0!==n&&(o[oe.camelCase(e)]=n);if("string"==typeof e){i=o[e];null==i&&(i=o[oe.camelCase(e)])}else i=o;return i}}}function h(t,e,n){if(oe.acceptData(t)){var r,i,o=t.nodeType,a=o?oe.cache:t,s=o?t[oe.expando]:oe.expando;if(a[s]){if(e){r=n?a[s]:a[s].data;if(r){if(oe.isArray(e))e=e.concat(oe.map(e,oe.camelCase));else if(e in r)e=[e];else{e=oe.camelCase(e);e=e in r?[e]:e.split(" ")}i=e.length;for(;i--;)delete r[e[i]];if(n?!c(r):!oe.isEmptyObject(r))return}}if(!n){delete a[s].data;if(!c(a[s]))return}o?oe.cleanData([t],!0):re.deleteExpando||a!=a.window?delete a[s]:a[s]=null}}}function d(){return!0}function p(){return!1}function g(){try{return ge.activeElement}catch(t){}}function m(t){var e=Oe.split("|"),n=t.createDocumentFragment();if(n.createElement)for(;e.length;)n.createElement(e.pop());return n}function v(t,e){var n,r,i=0,o=typeof t.getElementsByTagName!==Te?t.getElementsByTagName(e||"*"):typeof t.querySelectorAll!==Te?t.querySelectorAll(e||"*"):void 0;if(!o)for(o=[],n=t.childNodes||t;null!=(r=n[i]);i++)!e||oe.nodeName(r,e)?o.push(r):oe.merge(o,v(r,e));return void 0===e||e&&oe.nodeName(t,e)?oe.merge([t],o):o}function y(t){Ne.test(t.type)&&(t.defaultChecked=t.checked)}function b(t,e){return oe.nodeName(t,"table")&&oe.nodeName(11!==e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function x(t){t.type=(null!==oe.find.attr(t,"type"))+"/"+t.type;return t}function w(t){var e=$e.exec(t.type);e?t.type=e[1]:t.removeAttribute("type");return t}function C(t,e){for(var n,r=0;null!=(n=t[r]);r++)oe._data(n,"globalEval",!e||oe._data(e[r],"globalEval"))}function S(t,e){if(1===e.nodeType&&oe.hasData(t)){var n,r,i,o=oe._data(t),a=oe._data(e,o),s=o.events;if(s){delete a.handle;a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)oe.event.add(e,n,s[n][r])}a.data&&(a.data=oe.extend({},a.data))}}function T(t,e){var n,r,i;if(1===e.nodeType){n=e.nodeName.toLowerCase();if(!re.noCloneEvent&&e[oe.expando]){i=oe._data(e);for(r in i.events)oe.removeEvent(e,r,i.handle);e.removeAttribute(oe.expando)}if("script"===n&&e.text!==t.text){x(e).text=t.text;w(e)}else if("object"===n){e.parentNode&&(e.outerHTML=t.outerHTML);re.html5Clone&&t.innerHTML&&!oe.trim(e.innerHTML)&&(e.innerHTML=t.innerHTML)}else if("input"===n&&Ne.test(t.type)){e.defaultChecked=e.checked=t.checked;e.value!==t.value&&(e.value=t.value)}else"option"===n?e.defaultSelected=e.selected=t.defaultSelected:("input"===n||"textarea"===n)&&(e.defaultValue=t.defaultValue)}}function k(t,n){var r,i=oe(n.createElement(t)).appendTo(n.body),o=e.getDefaultComputedStyle&&(r=e.getDefaultComputedStyle(i[0]))?r.display:oe.css(i[0],"display");i.detach();return o}function _(t){var e=ge,n=tn[t];if(!n){n=k(t,e);if("none"===n||!n){Qe=(Qe||oe("<iframe frameborder='0' width='0' height='0'/>")).appendTo(e.documentElement);e=(Qe[0].contentWindow||Qe[0].contentDocument).document;e.write();e.close();n=k(t,e);Qe.detach()}tn[t]=n}return n}function M(t,e){return{get:function(){var n=t();if(null!=n){if(!n)return(this.get=e).apply(this,arguments);delete this.get}}}}function D(t,e){if(e in t)return e;for(var n=e.charAt(0).toUpperCase()+e.slice(1),r=e,i=pn.length;i--;){e=pn[i]+n;if(e in t)return e}return r}function L(t,e){for(var n,r,i,o=[],a=0,s=t.length;s>a;a++){r=t[a];if(r.style){o[a]=oe._data(r,"olddisplay");n=r.style.display;if(e){o[a]||"none"!==n||(r.style.display="");""===r.style.display&&Le(r)&&(o[a]=oe._data(r,"olddisplay",_(r.nodeName)))}else{i=Le(r);(n&&"none"!==n||!i)&&oe._data(r,"olddisplay",i?n:oe.css(r,"display"))}}}for(a=0;s>a;a++){r=t[a];r.style&&(e&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=e?o[a]||"":"none"))}return t}function A(t,e,n){var r=cn.exec(e);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):e}function N(t,e,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===e?1:0,a=0;4>o;o+=2){"margin"===n&&(a+=oe.css(t,n+De[o],!0,i));if(r){"content"===n&&(a-=oe.css(t,"padding"+De[o],!0,i));"margin"!==n&&(a-=oe.css(t,"border"+De[o]+"Width",!0,i))}else{a+=oe.css(t,"padding"+De[o],!0,i);"padding"!==n&&(a+=oe.css(t,"border"+De[o]+"Width",!0,i))}}return a}function E(t,e,n){var r=!0,i="width"===e?t.offsetWidth:t.offsetHeight,o=en(t),a=re.boxSizing&&"border-box"===oe.css(t,"boxSizing",!1,o);if(0>=i||null==i){i=nn(t,e,o);(0>i||null==i)&&(i=t.style[e]);if(on.test(i))return i;r=a&&(re.boxSizingReliable()||i===t.style[e]);i=parseFloat(i)||0}return i+N(t,e,n||(a?"border":"content"),r,o)+"px"}function j(t,e,n,r,i){return new j.prototype.init(t,e,n,r,i)}function P(){setTimeout(function(){gn=void 0});return gn=oe.now()}function I(t,e){var n,r={height:t},i=0;e=e?1:0;for(;4>i;i+=2-e){n=De[i];r["margin"+n]=r["padding"+n]=t}e&&(r.opacity=r.width=t);return r}function H(t,e,n){for(var r,i=(wn[e]||[]).concat(wn["*"]),o=0,a=i.length;a>o;o++)if(r=i[o].call(n,e,t))return r}function O(t,e,n){var r,i,o,a,s,l,u,c,f=this,h={},d=t.style,p=t.nodeType&&Le(t),g=oe._data(t,"fxshow");if(!n.queue){s=oe._queueHooks(t,"fx");if(null==s.unqueued){s.unqueued=0;l=s.empty.fire;s.empty.fire=function(){s.unqueued||l()}}s.unqueued++;f.always(function(){f.always(function(){s.unqueued--;oe.queue(t,"fx").length||s.empty.fire()})})}if(1===t.nodeType&&("height"in e||"width"in e)){n.overflow=[d.overflow,d.overflowX,d.overflowY];u=oe.css(t,"display");c="none"===u?oe._data(t,"olddisplay")||_(t.nodeName):u;"inline"===c&&"none"===oe.css(t,"float")&&(re.inlineBlockNeedsLayout&&"inline"!==_(t.nodeName)?d.zoom=1:d.display="inline-block")}if(n.overflow){d.overflow="hidden";re.shrinkWrapBlocks()||f.always(function(){d.overflow=n.overflow[0];d.overflowX=n.overflow[1];d.overflowY=n.overflow[2]})}for(r in e){i=e[r];if(vn.exec(i)){delete e[r];o=o||"toggle"===i;if(i===(p?"hide":"show")){if("show"!==i||!g||void 0===g[r])continue;p=!0}h[r]=g&&g[r]||oe.style(t,r)}else u=void 0}if(oe.isEmptyObject(h))"inline"===("none"===u?_(t.nodeName):u)&&(d.display=u);else{g?"hidden"in g&&(p=g.hidden):g=oe._data(t,"fxshow",{});o&&(g.hidden=!p);p?oe(t).show():f.done(function(){oe(t).hide()});f.done(function(){var e;oe._removeData(t,"fxshow");for(e in h)oe.style(t,e,h[e])});for(r in h){a=H(p?g[r]:0,r,f);if(!(r in g)){g[r]=a.start;if(p){a.end=a.start;a.start="width"===r||"height"===r?1:0}}}}}function R(t,e){var n,r,i,o,a;for(n in t){r=oe.camelCase(n);i=e[r];o=t[n];if(oe.isArray(o)){i=o[1];o=t[n]=o[0]}if(n!==r){t[r]=o;delete t[n]}a=oe.cssHooks[r];if(a&&"expand"in a){o=a.expand(o);delete t[r];for(n in o)if(!(n in t)){t[n]=o[n];e[n]=i}}else e[r]=i}}function F(t,e,n){var r,i,o=0,a=xn.length,s=oe.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;for(var e=gn||P(),n=Math.max(0,u.startTime+u.duration-e),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;l>a;a++)u.tweens[a].run(o);s.notifyWith(t,[u,o,n]);if(1>o&&l)return n;s.resolveWith(t,[u]);return!1},u=s.promise({elem:t,props:oe.extend({},e),opts:oe.extend(!0,{specialEasing:{}},n),originalProperties:e,originalOptions:n,startTime:gn||P(),duration:n.duration,tweens:[],createTween:function(e,n){var r=oe.Tween(t,u.opts,e,n,u.opts.specialEasing[e]||u.opts.easing);u.tweens.push(r);return r},stop:function(e){var n=0,r=e?u.tweens.length:0;if(i)return this;i=!0;for(;r>n;n++)u.tweens[n].run(1);e?s.resolveWith(t,[u,e]):s.rejectWith(t,[u,e]);return this}}),c=u.props;R(c,u.opts.specialEasing);for(;a>o;o++){r=xn[o].call(u,t,c,u.opts);if(r)return r}oe.map(c,H,u);oe.isFunction(u.opts.start)&&u.opts.start.call(t,u);oe.fx.timer(oe.extend(l,{elem:t,anim:u,queue:u.opts.queue}));return u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function W(t){return function(e,n){if("string"!=typeof e){n=e;e="*"}var r,i=0,o=e.toLowerCase().match(xe)||[];if(oe.isFunction(n))for(;r=o[i++];)if("+"===r.charAt(0)){r=r.slice(1)||"*";(t[r]=t[r]||[]).unshift(n)}else(t[r]=t[r]||[]).push(n)}}function z(t,e,n,r){function i(s){var l;o[s]=!0;oe.each(t[s]||[],function(t,s){var u=s(e,n,r);if("string"==typeof u&&!a&&!o[u]){e.dataTypes.unshift(u);i(u);return!1}return a?!(l=u):void 0});return l}var o={},a=t===Vn;return i(e.dataTypes[0])||!o["*"]&&i("*")}function q(t,e){var n,r,i=oe.ajaxSettings.flatOptions||{};for(r in e)void 0!==e[r]&&((i[r]?t:n||(n={}))[r]=e[r]);n&&oe.extend(!0,t,n);return t}function U(t,e,n){for(var r,i,o,a,s=t.contents,l=t.dataTypes;"*"===l[0];){l.shift();void 0===i&&(i=t.mimeType||e.getResponseHeader("Content-Type"))}if(i)for(a in s)if(s[a]&&s[a].test(i)){l.unshift(a);break}if(l[0]in n)o=l[0];else{for(a in n){if(!l[0]||t.converters[a+" "+l[0]]){o=a;break}r||(r=a)}o=o||r}if(o){o!==l[0]&&l.unshift(o);return n[o]}}function B(t,e,n,r){var i,o,a,s,l,u={},c=t.dataTypes.slice();if(c[1])for(a in t.converters)u[a.toLowerCase()]=t.converters[a];o=c.shift();for(;o;){t.responseFields[o]&&(n[t.responseFields[o]]=e);!l&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType));l=o;o=c.shift();if(o)if("*"===o)o=l;else if("*"!==l&&l!==o){a=u[l+" "+o]||u["* "+o];if(!a)for(i in u){s=i.split(" ");if(s[1]===o){a=u[l+" "+s[0]]||u["* "+s[0]];if(a){if(a===!0)a=u[i];else if(u[i]!==!0){o=s[0];c.unshift(s[1])}break}}}if(a!==!0)if(a&&t["throws"])e=a(e);else try{e=a(e)}catch(f){return{state:"parsererror",error:a?f:"No conversion from "+l+" to "+o}}}}return{state:"success",data:e}}function V(t,e,n,r){var i;if(oe.isArray(e))oe.each(e,function(e,i){n||Yn.test(t)?r(t,i):V(t+"["+("object"==typeof i?e:"")+"]",i,n,r)});else if(n||"object"!==oe.type(e))r(t,e);else for(i in e)V(t+"["+i+"]",e[i],n,r)}function X(){try{return new e.XMLHttpRequest}catch(t){}}function G(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function $(t){return oe.isWindow(t)?t:9===t.nodeType?t.defaultView||t.parentWindow:!1}var Y=[],J=Y.slice,K=Y.concat,Z=Y.push,Q=Y.indexOf,te={},ee=te.toString,ne=te.hasOwnProperty,re={},ie="1.11.2",oe=function(t,e){return new oe.fn.init(t,e)},ae=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,se=/^-ms-/,le=/-([\da-z])/gi,ue=function(t,e){return e.toUpperCase()};oe.fn=oe.prototype={jquery:ie,constructor:oe,selector:"",length:0,toArray:function(){return J.call(this)},get:function(t){return null!=t?0>t?this[t+this.length]:this[t]:J.call(this)},pushStack:function(t){var e=oe.merge(this.constructor(),t);e.prevObject=this;e.context=this.context;return e},each:function(t,e){return oe.each(this,t,e)},map:function(t){return this.pushStack(oe.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return this.pushStack(J.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,n=+t+(0>t?e:0);return this.pushStack(n>=0&&e>n?[this[n]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:Z,sort:Y.sort,splice:Y.splice};oe.extend=oe.fn.extend=function(){var t,e,n,r,i,o,a=arguments[0]||{},s=1,l=arguments.length,u=!1;if("boolean"==typeof a){u=a;a=arguments[s]||{};s++}"object"==typeof a||oe.isFunction(a)||(a={});if(s===l){a=this;s--}for(;l>s;s++)if(null!=(i=arguments[s]))for(r in i){t=a[r];n=i[r];if(a!==n)if(u&&n&&(oe.isPlainObject(n)||(e=oe.isArray(n)))){if(e){e=!1;o=t&&oe.isArray(t)?t:[]}else o=t&&oe.isPlainObject(t)?t:{};a[r]=oe.extend(u,o,n)}else void 0!==n&&(a[r]=n)}return a};oe.extend({expando:"jQuery"+(ie+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isFunction:function(t){return"function"===oe.type(t)},isArray:Array.isArray||function(t){return"array"===oe.type(t)},isWindow:function(t){return null!=t&&t==t.window},isNumeric:function(t){return!oe.isArray(t)&&t-parseFloat(t)+1>=0},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},isPlainObject:function(t){var e;if(!t||"object"!==oe.type(t)||t.nodeType||oe.isWindow(t))return!1;try{if(t.constructor&&!ne.call(t,"constructor")&&!ne.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(re.ownLast)for(e in t)return ne.call(t,e);for(e in t);return void 0===e||ne.call(t,e)},type:function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?te[ee.call(t)]||"object":typeof t},globalEval:function(t){t&&oe.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(t){return t.replace(se,"ms-").replace(le,ue)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,e,n){var i,o=0,a=t.length,s=r(t);if(n)if(s)for(;a>o;o++){i=e.apply(t[o],n);if(i===!1)break}else for(o in t){i=e.apply(t[o],n);if(i===!1)break}else if(s)for(;a>o;o++){i=e.call(t[o],o,t[o]);if(i===!1)break}else for(o in t){i=e.call(t[o],o,t[o]);if(i===!1)break}return t},trim:function(t){return null==t?"":(t+"").replace(ae,"")},makeArray:function(t,e){var n=e||[];null!=t&&(r(Object(t))?oe.merge(n,"string"==typeof t?[t]:t):Z.call(n,t));return n},inArray:function(t,e,n){var r;if(e){if(Q)return Q.call(e,t,n);r=e.length;n=n?0>n?Math.max(0,r+n):n:0;for(;r>n;n++)if(n in e&&e[n]===t)return n}return-1},merge:function(t,e){for(var n=+e.length,r=0,i=t.length;n>r;)t[i++]=e[r++];if(n!==n)for(;void 0!==e[r];)t[i++]=e[r++];t.length=i;return t},grep:function(t,e,n){for(var r,i=[],o=0,a=t.length,s=!n;a>o;o++){r=!e(t[o],o);r!==s&&i.push(t[o])}return i},map:function(t,e,n){var i,o=0,a=t.length,s=r(t),l=[];if(s)for(;a>o;o++){i=e(t[o],o,n);null!=i&&l.push(i)}else for(o in t){i=e(t[o],o,n);null!=i&&l.push(i)}return K.apply([],l)},guid:1,proxy:function(t,e){var n,r,i;if("string"==typeof e){i=t[e];e=t;t=i}if(!oe.isFunction(t))return void 0;n=J.call(arguments,2);r=function(){return t.apply(e||this,n.concat(J.call(arguments)))};r.guid=t.guid=t.guid||oe.guid++;return r},now:function(){return+new Date},support:re});oe.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(t,e){te["[object "+e+"]"]=e.toLowerCase()});var ce=function(t){function e(t,e,n,r){var i,o,a,s,l,u,f,d,p,g;(e?e.ownerDocument||e:W)!==E&&N(e);e=e||E;n=n||[];s=e.nodeType;if("string"!=typeof t||!t||1!==s&&9!==s&&11!==s)return n;if(!r&&P){if(11!==s&&(i=ye.exec(t)))if(a=i[1]){if(9===s){o=e.getElementById(a);if(!o||!o.parentNode)return n;if(o.id===a){n.push(o);return n}}else if(e.ownerDocument&&(o=e.ownerDocument.getElementById(a))&&R(e,o)&&o.id===a){n.push(o);return n}}else{if(i[2]){Z.apply(n,e.getElementsByTagName(t));return n}if((a=i[3])&&w.getElementsByClassName){Z.apply(n,e.getElementsByClassName(a));return n}}if(w.qsa&&(!I||!I.test(t))){d=f=F;p=e;g=1!==s&&t;if(1===s&&"object"!==e.nodeName.toLowerCase()){u=k(t);(f=e.getAttribute("id"))?d=f.replace(xe,"\\$&"):e.setAttribute("id",d);d="[id='"+d+"'] ";l=u.length;for(;l--;)u[l]=d+h(u[l]);p=be.test(t)&&c(e.parentNode)||e;g=u.join(",")}if(g)try{Z.apply(n,p.querySelectorAll(g));return n}catch(m){}finally{f||e.removeAttribute("id")}}}return M(t.replace(le,"$1"),e,n,r)}function n(){function t(n,r){e.push(n+" ")>C.cacheLength&&delete t[e.shift()];return t[n+" "]=r}var e=[];return t}function r(t){t[F]=!0;return t}function i(t){var e=E.createElement("div");try{return!!t(e)}catch(n){return!1}finally{e.parentNode&&e.parentNode.removeChild(e);e=null}}function o(t,e){for(var n=t.split("|"),r=t.length;r--;)C.attrHandle[n[r]]=e}function a(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||G)-(~t.sourceIndex||G);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function s(t){return function(e){var n=e.nodeName.toLowerCase();return"input"===n&&e.type===t}}function l(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function u(t){return r(function(e){e=+e;return r(function(n,r){for(var i,o=t([],n.length,e),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function c(t){return t&&"undefined"!=typeof t.getElementsByTagName&&t}function f(){}function h(t){for(var e=0,n=t.length,r="";n>e;e++)r+=t[e].value;return r}function d(t,e,n){var r=e.dir,i=n&&"parentNode"===r,o=q++;return e.first?function(e,n,o){for(;e=e[r];)if(1===e.nodeType||i)return t(e,n,o)}:function(e,n,a){var s,l,u=[z,o];if(a){for(;e=e[r];)if((1===e.nodeType||i)&&t(e,n,a))return!0}else for(;e=e[r];)if(1===e.nodeType||i){l=e[F]||(e[F]={});if((s=l[r])&&s[0]===z&&s[1]===o)return u[2]=s[2];l[r]=u;if(u[2]=t(e,n,a))return!0}}}function p(t){return t.length>1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function g(t,n,r){for(var i=0,o=n.length;o>i;i++)e(t,n[i],r);return r}function m(t,e,n,r,i){for(var o,a=[],s=0,l=t.length,u=null!=e;l>s;s++)if((o=t[s])&&(!n||n(o,r,i))){a.push(o);u&&e.push(s)}return a}function v(t,e,n,i,o,a){i&&!i[F]&&(i=v(i));o&&!o[F]&&(o=v(o,a));return r(function(r,a,s,l){var u,c,f,h=[],d=[],p=a.length,v=r||g(e||"*",s.nodeType?[s]:s,[]),y=!t||!r&&e?v:m(v,h,t,s,l),b=n?o||(r?t:p||i)?[]:a:y;n&&n(y,b,s,l);if(i){u=m(b,d);i(u,[],s,l);c=u.length;for(;c--;)(f=u[c])&&(b[d[c]]=!(y[d[c]]=f))}if(r){if(o||t){if(o){u=[];c=b.length;for(;c--;)(f=b[c])&&u.push(y[c]=f);o(null,b=[],u,l)}c=b.length;for(;c--;)(f=b[c])&&(u=o?te(r,f):h[c])>-1&&(r[u]=!(a[u]=f))}}else{b=m(b===a?b.splice(p,b.length):b);o?o(null,a,b,l):Z.apply(a,b)}})}function y(t){for(var e,n,r,i=t.length,o=C.relative[t[0].type],a=o||C.relative[" "],s=o?1:0,l=d(function(t){return t===e},a,!0),u=d(function(t){return te(e,t)>-1},a,!0),c=[function(t,n,r){var i=!o&&(r||n!==D)||((e=n).nodeType?l(t,n,r):u(t,n,r));e=null;return i}];i>s;s++)if(n=C.relative[t[s].type])c=[d(p(c),n)];else{n=C.filter[t[s].type].apply(null,t[s].matches);if(n[F]){r=++s;for(;i>r&&!C.relative[t[r].type];r++);return v(s>1&&p(c),s>1&&h(t.slice(0,s-1).concat({value:" "===t[s-2].type?"*":""})).replace(le,"$1"),n,r>s&&y(t.slice(s,r)),i>r&&y(t=t.slice(r)),i>r&&h(t))}c.push(n)}return p(c)}function b(t,n){var i=n.length>0,o=t.length>0,a=function(r,a,s,l,u){var c,f,h,d=0,p="0",g=r&&[],v=[],y=D,b=r||o&&C.find.TAG("*",u),x=z+=null==y?1:Math.random()||.1,w=b.length;u&&(D=a!==E&&a);for(;p!==w&&null!=(c=b[p]);p++){if(o&&c){f=0;for(;h=t[f++];)if(h(c,a,s)){l.push(c);break}u&&(z=x)}if(i){(c=!h&&c)&&d--;r&&g.push(c)}}d+=p;if(i&&p!==d){f=0;for(;h=n[f++];)h(g,v,a,s);if(r){if(d>0)for(;p--;)g[p]||v[p]||(v[p]=J.call(l));v=m(v)}Z.apply(l,v);u&&!r&&v.length>0&&d+n.length>1&&e.uniqueSort(l)}if(u){z=x;D=y}return g};return i?r(a):a}var x,w,C,S,T,k,_,M,D,L,A,N,E,j,P,I,H,O,R,F="sizzle"+1*new Date,W=t.document,z=0,q=0,U=n(),B=n(),V=n(),X=function(t,e){t===e&&(A=!0);return 0},G=1<<31,$={}.hasOwnProperty,Y=[],J=Y.pop,K=Y.push,Z=Y.push,Q=Y.slice,te=function(t,e){for(var n=0,r=t.length;r>n;n++)if(t[n]===e)return n;return-1},ee="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ne="[\\x20\\t\\r\\n\\f]",re="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ie=re.replace("w","w#"),oe="\\["+ne+"*("+re+")(?:"+ne+"*([*^$|!~]?=)"+ne+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ie+"))|)"+ne+"*\\]",ae=":("+re+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+oe+")*)|.*)\\)|)",se=new RegExp(ne+"+","g"),le=new RegExp("^"+ne+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ne+"+$","g"),ue=new RegExp("^"+ne+"*,"+ne+"*"),ce=new RegExp("^"+ne+"*([>+~]|"+ne+")"+ne+"*"),fe=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),he=new RegExp(ae),de=new RegExp("^"+ie+"$"),pe={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re.replace("w","w*")+")"),ATTR:new RegExp("^"+oe),PSEUDO:new RegExp("^"+ae),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+ee+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},ge=/^(?:input|select|textarea|button)$/i,me=/^h\d$/i,ve=/^[^{]+\{\s*\[native \w/,ye=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,be=/[+~]/,xe=/'|\\/g,we=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),Ce=function(t,e,n){var r="0x"+e-65536;return r!==r||n?e:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},Se=function(){N()};try{Z.apply(Y=Q.call(W.childNodes),W.childNodes);Y[W.childNodes.length].nodeType}catch(Te){Z={apply:Y.length?function(t,e){K.apply(t,Q.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}w=e.support={};T=e.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return e?"HTML"!==e.nodeName:!1};N=e.setDocument=function(t){var e,n,r=t?t.ownerDocument||t:W;if(r===E||9!==r.nodeType||!r.documentElement)return E;E=r;j=r.documentElement;n=r.defaultView;n&&n!==n.top&&(n.addEventListener?n.addEventListener("unload",Se,!1):n.attachEvent&&n.attachEvent("onunload",Se));P=!T(r);w.attributes=i(function(t){t.className="i";return!t.getAttribute("className")});w.getElementsByTagName=i(function(t){t.appendChild(r.createComment(""));return!t.getElementsByTagName("*").length});w.getElementsByClassName=ve.test(r.getElementsByClassName);w.getById=i(function(t){j.appendChild(t).id=F;return!r.getElementsByName||!r.getElementsByName(F).length});if(w.getById){C.find.ID=function(t,e){if("undefined"!=typeof e.getElementById&&P){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}};C.filter.ID=function(t){var e=t.replace(we,Ce);return function(t){return t.getAttribute("id")===e}}}else{delete C.find.ID;C.filter.ID=function(t){var e=t.replace(we,Ce);return function(t){var n="undefined"!=typeof t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}}}C.find.TAG=w.getElementsByTagName?function(t,e){return"undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t):w.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],i=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o};C.find.CLASS=w.getElementsByClassName&&function(t,e){return P?e.getElementsByClassName(t):void 0};H=[];I=[];if(w.qsa=ve.test(r.querySelectorAll)){i(function(t){j.appendChild(t).innerHTML="<a id='"+F+"'></a><select id='"+F+"-\f]' msallowcapture=''><option selected=''></option></select>";t.querySelectorAll("[msallowcapture^='']").length&&I.push("[*^$]="+ne+"*(?:''|\"\")");t.querySelectorAll("[selected]").length||I.push("\\["+ne+"*(?:value|"+ee+")");t.querySelectorAll("[id~="+F+"-]").length||I.push("~=");t.querySelectorAll(":checked").length||I.push(":checked");t.querySelectorAll("a#"+F+"+*").length||I.push(".#.+[+~]")});i(function(t){var e=r.createElement("input");e.setAttribute("type","hidden");t.appendChild(e).setAttribute("name","D");t.querySelectorAll("[name=d]").length&&I.push("name"+ne+"*[*^$|!~]?=");t.querySelectorAll(":enabled").length||I.push(":enabled",":disabled");t.querySelectorAll("*,:x");I.push(",.*:")})}(w.matchesSelector=ve.test(O=j.matches||j.webkitMatchesSelector||j.mozMatchesSelector||j.oMatchesSelector||j.msMatchesSelector))&&i(function(t){w.disconnectedMatch=O.call(t,"div");O.call(t,"[s!='']:x");H.push("!=",ae)});I=I.length&&new RegExp(I.join("|"));H=H.length&&new RegExp(H.join("|"));e=ve.test(j.compareDocumentPosition);R=e||ve.test(j.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1};X=e?function(t,e){if(t===e){A=!0;return 0}var n=!t.compareDocumentPosition-!e.compareDocumentPosition;if(n)return n;n=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1;return 1&n||!w.sortDetached&&e.compareDocumentPosition(t)===n?t===r||t.ownerDocument===W&&R(W,t)?-1:e===r||e.ownerDocument===W&&R(W,e)?1:L?te(L,t)-te(L,e):0:4&n?-1:1}:function(t,e){if(t===e){A=!0;return 0}var n,i=0,o=t.parentNode,s=e.parentNode,l=[t],u=[e];if(!o||!s)return t===r?-1:e===r?1:o?-1:s?1:L?te(L,t)-te(L,e):0;if(o===s)return a(t,e);n=t;for(;n=n.parentNode;)l.unshift(n);n=e;for(;n=n.parentNode;)u.unshift(n);for(;l[i]===u[i];)i++;return i?a(l[i],u[i]):l[i]===W?-1:u[i]===W?1:0};return r};e.matches=function(t,n){return e(t,null,null,n)};e.matchesSelector=function(t,n){(t.ownerDocument||t)!==E&&N(t);n=n.replace(fe,"='$1']");if(!(!w.matchesSelector||!P||H&&H.test(n)||I&&I.test(n)))try{var r=O.call(t,n);if(r||w.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(i){}return e(n,E,null,[t]).length>0};e.contains=function(t,e){(t.ownerDocument||t)!==E&&N(t);return R(t,e)};e.attr=function(t,e){(t.ownerDocument||t)!==E&&N(t);var n=C.attrHandle[e.toLowerCase()],r=n&&$.call(C.attrHandle,e.toLowerCase())?n(t,e,!P):void 0;return void 0!==r?r:w.attributes||!P?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null};e.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)};e.uniqueSort=function(t){var e,n=[],r=0,i=0;A=!w.detectDuplicates;L=!w.sortStable&&t.slice(0);t.sort(X);if(A){for(;e=t[i++];)e===t[i]&&(r=n.push(i));for(;r--;)t.splice(n[r],1)}L=null;return t};S=e.getText=function(t){var e,n="",r=0,i=t.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=S(t)}else if(3===i||4===i)return t.nodeValue}else for(;e=t[r++];)n+=S(e);return n};C=e.selectors={cacheLength:50,createPseudo:r,match:pe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){t[1]=t[1].replace(we,Ce);t[3]=(t[3]||t[4]||t[5]||"").replace(we,Ce);"~="===t[2]&&(t[3]=" "+t[3]+" ");return t.slice(0,4)},CHILD:function(t){t[1]=t[1].toLowerCase();if("nth"===t[1].slice(0,3)){t[3]||e.error(t[0]);t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3]));t[5]=+(t[7]+t[8]||"odd"===t[3])}else t[3]&&e.error(t[0]);return t},PSEUDO:function(t){var e,n=!t[6]&&t[2];if(pe.CHILD.test(t[0]))return null;if(t[3])t[2]=t[4]||t[5]||"";else if(n&&he.test(n)&&(e=k(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)){t[0]=t[0].slice(0,e);t[2]=n.slice(0,e)}return t.slice(0,3)}},filter:{TAG:function(t){var e=t.replace(we,Ce).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=U[t+" "];return e||(e=new RegExp("(^|"+ne+")"+t+"("+ne+"|$)"))&&U(t,function(t){return e.test("string"==typeof t.className&&t.className||"undefined"!=typeof t.getAttribute&&t.getAttribute("class")||"")
})},ATTR:function(t,n,r){return function(i){var o=e.attr(i,t);if(null==o)return"!="===n;if(!n)return!0;o+="";return"="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(se," ")+" ").indexOf(r)>-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1}},CHILD:function(t,e,n,r,i){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,l){var u,c,f,h,d,p,g=o!==a?"nextSibling":"previousSibling",m=e.parentNode,v=s&&e.nodeName.toLowerCase(),y=!l&&!s;if(m){if(o){for(;g;){f=e;for(;f=f[g];)if(s?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;p=g="only"===t&&!p&&"nextSibling"}return!0}p=[a?m.firstChild:m.lastChild];if(a&&y){c=m[F]||(m[F]={});u=c[t]||[];d=u[0]===z&&u[1];h=u[0]===z&&u[2];f=d&&m.childNodes[d];for(;f=++d&&f&&f[g]||(h=d=0)||p.pop();)if(1===f.nodeType&&++h&&f===e){c[t]=[z,d,h];break}}else if(y&&(u=(e[F]||(e[F]={}))[t])&&u[0]===z)h=u[1];else for(;f=++d&&f&&f[g]||(h=d=0)||p.pop();)if((s?f.nodeName.toLowerCase()===v:1===f.nodeType)&&++h){y&&((f[F]||(f[F]={}))[t]=[z,h]);if(f===e)break}h-=i;return h===r||h%r===0&&h/r>=0}}},PSEUDO:function(t,n){var i,o=C.pseudos[t]||C.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);if(o[F])return o(n);if(o.length>1){i=[t,t,"",n];return C.setFilters.hasOwnProperty(t.toLowerCase())?r(function(t,e){for(var r,i=o(t,n),a=i.length;a--;){r=te(t,i[a]);t[r]=!(e[r]=i[a])}}):function(t){return o(t,0,i)}}return o}},pseudos:{not:r(function(t){var e=[],n=[],i=_(t.replace(le,"$1"));return i[F]?r(function(t,e,n,r){for(var o,a=i(t,null,r,[]),s=t.length;s--;)(o=a[s])&&(t[s]=!(e[s]=o))}):function(t,r,o){e[0]=t;i(e,null,o,n);e[0]=null;return!n.pop()}}),has:r(function(t){return function(n){return e(t,n).length>0}}),contains:r(function(t){t=t.replace(we,Ce);return function(e){return(e.textContent||e.innerText||S(e)).indexOf(t)>-1}}),lang:r(function(t){de.test(t||"")||e.error("unsupported lang: "+t);t=t.replace(we,Ce).toLowerCase();return function(e){var n;do if(n=P?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang")){n=n.toLowerCase();return n===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===j},focus:function(t){return t===E.activeElement&&(!E.hasFocus||E.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return t.disabled===!1},disabled:function(t){return t.disabled===!0},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){t.parentNode&&t.parentNode.selectedIndex;return t.selected===!0},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!C.pseudos.empty(t)},header:function(t){return me.test(t.nodeName)},input:function(t){return ge.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:u(function(){return[0]}),last:u(function(t,e){return[e-1]}),eq:u(function(t,e,n){return[0>n?n+e:n]}),even:u(function(t,e){for(var n=0;e>n;n+=2)t.push(n);return t}),odd:u(function(t,e){for(var n=1;e>n;n+=2)t.push(n);return t}),lt:u(function(t,e,n){for(var r=0>n?n+e:n;--r>=0;)t.push(r);return t}),gt:u(function(t,e,n){for(var r=0>n?n+e:n;++r<e;)t.push(r);return t})}};C.pseudos.nth=C.pseudos.eq;for(x in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})C.pseudos[x]=s(x);for(x in{submit:!0,reset:!0})C.pseudos[x]=l(x);f.prototype=C.filters=C.pseudos;C.setFilters=new f;k=e.tokenize=function(t,n){var r,i,o,a,s,l,u,c=B[t+" "];if(c)return n?0:c.slice(0);s=t;l=[];u=C.preFilter;for(;s;){if(!r||(i=ue.exec(s))){i&&(s=s.slice(i[0].length)||s);l.push(o=[])}r=!1;if(i=ce.exec(s)){r=i.shift();o.push({value:r,type:i[0].replace(le," ")});s=s.slice(r.length)}for(a in C.filter)if((i=pe[a].exec(s))&&(!u[a]||(i=u[a](i)))){r=i.shift();o.push({value:r,type:a,matches:i});s=s.slice(r.length)}if(!r)break}return n?s.length:s?e.error(t):B(t,l).slice(0)};_=e.compile=function(t,e){var n,r=[],i=[],o=V[t+" "];if(!o){e||(e=k(t));n=e.length;for(;n--;){o=y(e[n]);o[F]?r.push(o):i.push(o)}o=V(t,b(i,r));o.selector=t}return o};M=e.select=function(t,e,n,r){var i,o,a,s,l,u="function"==typeof t&&t,f=!r&&k(t=u.selector||t);n=n||[];if(1===f.length){o=f[0]=f[0].slice(0);if(o.length>2&&"ID"===(a=o[0]).type&&w.getById&&9===e.nodeType&&P&&C.relative[o[1].type]){e=(C.find.ID(a.matches[0].replace(we,Ce),e)||[])[0];if(!e)return n;u&&(e=e.parentNode);t=t.slice(o.shift().value.length)}i=pe.needsContext.test(t)?0:o.length;for(;i--;){a=o[i];if(C.relative[s=a.type])break;if((l=C.find[s])&&(r=l(a.matches[0].replace(we,Ce),be.test(o[0].type)&&c(e.parentNode)||e))){o.splice(i,1);t=r.length&&h(o);if(!t){Z.apply(n,r);return n}break}}}(u||_(t,f))(r,e,!P,n,be.test(t)&&c(e.parentNode)||e);return n};w.sortStable=F.split("").sort(X).join("")===F;w.detectDuplicates=!!A;N();w.sortDetached=i(function(t){return 1&t.compareDocumentPosition(E.createElement("div"))});i(function(t){t.innerHTML="<a href='#'></a>";return"#"===t.firstChild.getAttribute("href")})||o("type|href|height|width",function(t,e,n){return n?void 0:t.getAttribute(e,"type"===e.toLowerCase()?1:2)});w.attributes&&i(function(t){t.innerHTML="<input/>";t.firstChild.setAttribute("value","");return""===t.firstChild.getAttribute("value")})||o("value",function(t,e,n){return n||"input"!==t.nodeName.toLowerCase()?void 0:t.defaultValue});i(function(t){return null==t.getAttribute("disabled")})||o(ee,function(t,e,n){var r;return n?void 0:t[e]===!0?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null});return e}(e);oe.find=ce;oe.expr=ce.selectors;oe.expr[":"]=oe.expr.pseudos;oe.unique=ce.uniqueSort;oe.text=ce.getText;oe.isXMLDoc=ce.isXML;oe.contains=ce.contains;var fe=oe.expr.match.needsContext,he=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,de=/^.[^:#\[\.,]*$/;oe.filter=function(t,e,n){var r=e[0];n&&(t=":not("+t+")");return 1===e.length&&1===r.nodeType?oe.find.matchesSelector(r,t)?[r]:[]:oe.find.matches(t,oe.grep(e,function(t){return 1===t.nodeType}))};oe.fn.extend({find:function(t){var e,n=[],r=this,i=r.length;if("string"!=typeof t)return this.pushStack(oe(t).filter(function(){for(e=0;i>e;e++)if(oe.contains(r[e],this))return!0}));for(e=0;i>e;e++)oe.find(t,r[e],n);n=this.pushStack(i>1?oe.unique(n):n);n.selector=this.selector?this.selector+" "+t:t;return n},filter:function(t){return this.pushStack(i(this,t||[],!1))},not:function(t){return this.pushStack(i(this,t||[],!0))},is:function(t){return!!i(this,"string"==typeof t&&fe.test(t)?oe(t):t||[],!1).length}});var pe,ge=e.document,me=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ve=oe.fn.init=function(t,e){var n,r;if(!t)return this;if("string"==typeof t){n="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:me.exec(t);if(!n||!n[1]&&e)return!e||e.jquery?(e||pe).find(t):this.constructor(e).find(t);if(n[1]){e=e instanceof oe?e[0]:e;oe.merge(this,oe.parseHTML(n[1],e&&e.nodeType?e.ownerDocument||e:ge,!0));if(he.test(n[1])&&oe.isPlainObject(e))for(n in e)oe.isFunction(this[n])?this[n](e[n]):this.attr(n,e[n]);return this}r=ge.getElementById(n[2]);if(r&&r.parentNode){if(r.id!==n[2])return pe.find(t);this.length=1;this[0]=r}this.context=ge;this.selector=t;return this}if(t.nodeType){this.context=this[0]=t;this.length=1;return this}if(oe.isFunction(t))return"undefined"!=typeof pe.ready?pe.ready(t):t(oe);if(void 0!==t.selector){this.selector=t.selector;this.context=t.context}return oe.makeArray(t,this)};ve.prototype=oe.fn;pe=oe(ge);var ye=/^(?:parents|prev(?:Until|All))/,be={children:!0,contents:!0,next:!0,prev:!0};oe.extend({dir:function(t,e,n){for(var r=[],i=t[e];i&&9!==i.nodeType&&(void 0===n||1!==i.nodeType||!oe(i).is(n));){1===i.nodeType&&r.push(i);i=i[e]}return r},sibling:function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n}});oe.fn.extend({has:function(t){var e,n=oe(t,this),r=n.length;return this.filter(function(){for(e=0;r>e;e++)if(oe.contains(this,n[e]))return!0})},closest:function(t,e){for(var n,r=0,i=this.length,o=[],a=fe.test(t)||"string"!=typeof t?oe(t,e||this.context):0;i>r;r++)for(n=this[r];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&oe.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?oe.unique(o):o)},index:function(t){return t?"string"==typeof t?oe.inArray(this[0],oe(t)):oe.inArray(t.jquery?t[0]:t,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(oe.unique(oe.merge(this.get(),oe(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}});oe.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return oe.dir(t,"parentNode")},parentsUntil:function(t,e,n){return oe.dir(t,"parentNode",n)},next:function(t){return o(t,"nextSibling")},prev:function(t){return o(t,"previousSibling")},nextAll:function(t){return oe.dir(t,"nextSibling")},prevAll:function(t){return oe.dir(t,"previousSibling")},nextUntil:function(t,e,n){return oe.dir(t,"nextSibling",n)},prevUntil:function(t,e,n){return oe.dir(t,"previousSibling",n)},siblings:function(t){return oe.sibling((t.parentNode||{}).firstChild,t)},children:function(t){return oe.sibling(t.firstChild)},contents:function(t){return oe.nodeName(t,"iframe")?t.contentDocument||t.contentWindow.document:oe.merge([],t.childNodes)}},function(t,e){oe.fn[t]=function(n,r){var i=oe.map(this,e,n);"Until"!==t.slice(-5)&&(r=n);r&&"string"==typeof r&&(i=oe.filter(r,i));if(this.length>1){be[t]||(i=oe.unique(i));ye.test(t)&&(i=i.reverse())}return this.pushStack(i)}});var xe=/\S+/g,we={};oe.Callbacks=function(t){t="string"==typeof t?we[t]||a(t):oe.extend({},t);var e,n,r,i,o,s,l=[],u=!t.once&&[],c=function(a){n=t.memory&&a;r=!0;o=s||0;s=0;i=l.length;e=!0;for(;l&&i>o;o++)if(l[o].apply(a[0],a[1])===!1&&t.stopOnFalse){n=!1;break}e=!1;l&&(u?u.length&&c(u.shift()):n?l=[]:f.disable())},f={add:function(){if(l){var r=l.length;(function o(e){oe.each(e,function(e,n){var r=oe.type(n);"function"===r?t.unique&&f.has(n)||l.push(n):n&&n.length&&"string"!==r&&o(n)})})(arguments);if(e)i=l.length;else if(n){s=r;c(n)}}return this},remove:function(){l&&oe.each(arguments,function(t,n){for(var r;(r=oe.inArray(n,l,r))>-1;){l.splice(r,1);if(e){i>=r&&i--;o>=r&&o--}}});return this},has:function(t){return t?oe.inArray(t,l)>-1:!(!l||!l.length)},empty:function(){l=[];i=0;return this},disable:function(){l=u=n=void 0;return this},disabled:function(){return!l},lock:function(){u=void 0;n||f.disable();return this},locked:function(){return!u},fireWith:function(t,n){if(l&&(!r||u)){n=n||[];n=[t,n.slice?n.slice():n];e?u.push(n):c(n)}return this},fire:function(){f.fireWith(this,arguments);return this},fired:function(){return!!r}};return f};oe.extend({Deferred:function(t){var e=[["resolve","done",oe.Callbacks("once memory"),"resolved"],["reject","fail",oe.Callbacks("once memory"),"rejected"],["notify","progress",oe.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){i.done(arguments).fail(arguments);return this},then:function(){var t=arguments;return oe.Deferred(function(n){oe.each(e,function(e,o){var a=oe.isFunction(t[e])&&t[e];i[o[1]](function(){var t=a&&a.apply(this,arguments);t&&oe.isFunction(t.promise)?t.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o[0]+"With"](this===r?n.promise():this,a?[t]:arguments)})});t=null}).promise()},promise:function(t){return null!=t?oe.extend(t,r):r}},i={};r.pipe=r.then;oe.each(e,function(t,o){var a=o[2],s=o[3];r[o[1]]=a.add;s&&a.add(function(){n=s},e[1^t][2].disable,e[2][2].lock);i[o[0]]=function(){i[o[0]+"With"](this===i?r:this,arguments);return this};i[o[0]+"With"]=a.fireWith});r.promise(i);t&&t.call(i,i);return i},when:function(t){var e,n,r,i=0,o=J.call(arguments),a=o.length,s=1!==a||t&&oe.isFunction(t.promise)?a:0,l=1===s?t:oe.Deferred(),u=function(t,n,r){return function(i){n[t]=this;r[t]=arguments.length>1?J.call(arguments):i;r===e?l.notifyWith(n,r):--s||l.resolveWith(n,r)}};if(a>1){e=new Array(a);n=new Array(a);r=new Array(a);for(;a>i;i++)o[i]&&oe.isFunction(o[i].promise)?o[i].promise().done(u(i,r,o)).fail(l.reject).progress(u(i,n,e)):--s}s||l.resolveWith(r,o);return l.promise()}});var Ce;oe.fn.ready=function(t){oe.ready.promise().done(t);return this};oe.extend({isReady:!1,readyWait:1,holdReady:function(t){t?oe.readyWait++:oe.ready(!0)},ready:function(t){if(t===!0?!--oe.readyWait:!oe.isReady){if(!ge.body)return setTimeout(oe.ready);oe.isReady=!0;if(!(t!==!0&&--oe.readyWait>0)){Ce.resolveWith(ge,[oe]);if(oe.fn.triggerHandler){oe(ge).triggerHandler("ready");oe(ge).off("ready")}}}}});oe.ready.promise=function(t){if(!Ce){Ce=oe.Deferred();if("complete"===ge.readyState)setTimeout(oe.ready);else if(ge.addEventListener){ge.addEventListener("DOMContentLoaded",l,!1);e.addEventListener("load",l,!1)}else{ge.attachEvent("onreadystatechange",l);e.attachEvent("onload",l);var n=!1;try{n=null==e.frameElement&&ge.documentElement}catch(r){}n&&n.doScroll&&function i(){if(!oe.isReady){try{n.doScroll("left")}catch(t){return setTimeout(i,50)}s();oe.ready()}}()}}return Ce.promise(t)};var Se,Te="undefined";for(Se in oe(re))break;re.ownLast="0"!==Se;re.inlineBlockNeedsLayout=!1;oe(function(){var t,e,n,r;n=ge.getElementsByTagName("body")[0];if(n&&n.style){e=ge.createElement("div");r=ge.createElement("div");r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px";n.appendChild(r).appendChild(e);if(typeof e.style.zoom!==Te){e.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1";re.inlineBlockNeedsLayout=t=3===e.offsetWidth;t&&(n.style.zoom=1)}n.removeChild(r)}});(function(){var t=ge.createElement("div");if(null==re.deleteExpando){re.deleteExpando=!0;try{delete t.test}catch(e){re.deleteExpando=!1}}t=null})();oe.acceptData=function(t){var e=oe.noData[(t.nodeName+" ").toLowerCase()],n=+t.nodeType||1;return 1!==n&&9!==n?!1:!e||e!==!0&&t.getAttribute("classid")===e};var ke=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,_e=/([A-Z])/g;oe.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(t){t=t.nodeType?oe.cache[t[oe.expando]]:t[oe.expando];return!!t&&!c(t)},data:function(t,e,n){return f(t,e,n)},removeData:function(t,e){return h(t,e)},_data:function(t,e,n){return f(t,e,n,!0)},_removeData:function(t,e){return h(t,e,!0)}});oe.fn.extend({data:function(t,e){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===t){if(this.length){i=oe.data(o);if(1===o.nodeType&&!oe._data(o,"parsedAttrs")){n=a.length;for(;n--;)if(a[n]){r=a[n].name;if(0===r.indexOf("data-")){r=oe.camelCase(r.slice(5));u(o,r,i[r])}}oe._data(o,"parsedAttrs",!0)}}return i}return"object"==typeof t?this.each(function(){oe.data(this,t)}):arguments.length>1?this.each(function(){oe.data(this,t,e)}):o?u(o,t,oe.data(o,t)):void 0},removeData:function(t){return this.each(function(){oe.removeData(this,t)})}});oe.extend({queue:function(t,e,n){var r;if(t){e=(e||"fx")+"queue";r=oe._data(t,e);n&&(!r||oe.isArray(n)?r=oe._data(t,e,oe.makeArray(n)):r.push(n));return r||[]}},dequeue:function(t,e){e=e||"fx";var n=oe.queue(t,e),r=n.length,i=n.shift(),o=oe._queueHooks(t,e),a=function(){oe.dequeue(t,e)};if("inprogress"===i){i=n.shift();r--}if(i){"fx"===e&&n.unshift("inprogress");delete o.stop;i.call(t,a,o)}!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return oe._data(t,n)||oe._data(t,n,{empty:oe.Callbacks("once memory").add(function(){oe._removeData(t,e+"queue");oe._removeData(t,n)})})}});oe.fn.extend({queue:function(t,e){var n=2;if("string"!=typeof t){e=t;t="fx";n--}return arguments.length<n?oe.queue(this[0],t):void 0===e?this:this.each(function(){var n=oe.queue(this,t,e);oe._queueHooks(this,t);"fx"===t&&"inprogress"!==n[0]&&oe.dequeue(this,t)})},dequeue:function(t){return this.each(function(){oe.dequeue(this,t)})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,r=1,i=oe.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};if("string"!=typeof t){e=t;t=void 0}t=t||"fx";for(;a--;){n=oe._data(o[a],t+"queueHooks");if(n&&n.empty){r++;n.empty.add(s)}}s();return i.promise(e)}});var Me=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,De=["Top","Right","Bottom","Left"],Le=function(t,e){t=e||t;return"none"===oe.css(t,"display")||!oe.contains(t.ownerDocument,t)},Ae=oe.access=function(t,e,n,r,i,o,a){var s=0,l=t.length,u=null==n;if("object"===oe.type(n)){i=!0;for(s in n)oe.access(t,e,s,n[s],!0,o,a)}else if(void 0!==r){i=!0;oe.isFunction(r)||(a=!0);if(u)if(a){e.call(t,r);e=null}else{u=e;e=function(t,e,n){return u.call(oe(t),n)}}if(e)for(;l>s;s++)e(t[s],n,a?r:r.call(t[s],s,e(t[s],n)))}return i?t:u?e.call(t):l?e(t[0],n):o},Ne=/^(?:checkbox|radio)$/i;(function(){var t=ge.createElement("input"),e=ge.createElement("div"),n=ge.createDocumentFragment();e.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";re.leadingWhitespace=3===e.firstChild.nodeType;re.tbody=!e.getElementsByTagName("tbody").length;re.htmlSerialize=!!e.getElementsByTagName("link").length;re.html5Clone="<:nav></:nav>"!==ge.createElement("nav").cloneNode(!0).outerHTML;t.type="checkbox";t.checked=!0;n.appendChild(t);re.appendChecked=t.checked;e.innerHTML="<textarea>x</textarea>";re.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue;n.appendChild(e);e.innerHTML="<input type='radio' checked='checked' name='t'/>";re.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked;re.noCloneEvent=!0;if(e.attachEvent){e.attachEvent("onclick",function(){re.noCloneEvent=!1});e.cloneNode(!0).click()}if(null==re.deleteExpando){re.deleteExpando=!0;try{delete e.test}catch(r){re.deleteExpando=!1}}})();(function(){var t,n,r=ge.createElement("div");for(t in{submit:!0,change:!0,focusin:!0}){n="on"+t;if(!(re[t+"Bubbles"]=n in e)){r.setAttribute(n,"t");re[t+"Bubbles"]=r.attributes[n].expando===!1}}r=null})();var Ee=/^(?:input|select|textarea)$/i,je=/^key/,Pe=/^(?:mouse|pointer|contextmenu)|click/,Ie=/^(?:focusinfocus|focusoutblur)$/,He=/^([^.]*)(?:\.(.+)|)$/;oe.event={global:{},add:function(t,e,n,r,i){var o,a,s,l,u,c,f,h,d,p,g,m=oe._data(t);if(m){if(n.handler){l=n;n=l.handler;i=l.selector}n.guid||(n.guid=oe.guid++);(a=m.events)||(a=m.events={});if(!(c=m.handle)){c=m.handle=function(t){return typeof oe===Te||t&&oe.event.triggered===t.type?void 0:oe.event.dispatch.apply(c.elem,arguments)};c.elem=t}e=(e||"").match(xe)||[""];s=e.length;for(;s--;){o=He.exec(e[s])||[];d=g=o[1];p=(o[2]||"").split(".").sort();if(d){u=oe.event.special[d]||{};d=(i?u.delegateType:u.bindType)||d;u=oe.event.special[d]||{};f=oe.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&oe.expr.match.needsContext.test(i),namespace:p.join(".")},l);if(!(h=a[d])){h=a[d]=[];h.delegateCount=0;u.setup&&u.setup.call(t,r,p,c)!==!1||(t.addEventListener?t.addEventListener(d,c,!1):t.attachEvent&&t.attachEvent("on"+d,c))}if(u.add){u.add.call(t,f);f.handler.guid||(f.handler.guid=n.guid)}i?h.splice(h.delegateCount++,0,f):h.push(f);oe.event.global[d]=!0}}t=null}},remove:function(t,e,n,r,i){var o,a,s,l,u,c,f,h,d,p,g,m=oe.hasData(t)&&oe._data(t);if(m&&(c=m.events)){e=(e||"").match(xe)||[""];u=e.length;for(;u--;){s=He.exec(e[u])||[];d=g=s[1];p=(s[2]||"").split(".").sort();if(d){f=oe.event.special[d]||{};d=(r?f.delegateType:f.bindType)||d;h=c[d]||[];s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)");l=o=h.length;for(;o--;){a=h[o];if(!(!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector))){h.splice(o,1);a.selector&&h.delegateCount--;f.remove&&f.remove.call(t,a)}}if(l&&!h.length){f.teardown&&f.teardown.call(t,p,m.handle)!==!1||oe.removeEvent(t,d,m.handle);delete c[d]}}else for(d in c)oe.event.remove(t,d+e[u],n,r,!0)}if(oe.isEmptyObject(c)){delete m.handle;oe._removeData(t,"events")}}},trigger:function(t,n,r,i){var o,a,s,l,u,c,f,h=[r||ge],d=ne.call(t,"type")?t.type:t,p=ne.call(t,"namespace")?t.namespace.split("."):[];s=c=r=r||ge;if(3!==r.nodeType&&8!==r.nodeType&&!Ie.test(d+oe.event.triggered)){if(d.indexOf(".")>=0){p=d.split(".");d=p.shift();p.sort()}a=d.indexOf(":")<0&&"on"+d;t=t[oe.expando]?t:new oe.Event(d,"object"==typeof t&&t);t.isTrigger=i?2:3;t.namespace=p.join(".");t.namespace_re=t.namespace?new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;t.result=void 0;t.target||(t.target=r);n=null==n?[t]:oe.makeArray(n,[t]);u=oe.event.special[d]||{};if(i||!u.trigger||u.trigger.apply(r,n)!==!1){if(!i&&!u.noBubble&&!oe.isWindow(r)){l=u.delegateType||d;Ie.test(l+d)||(s=s.parentNode);for(;s;s=s.parentNode){h.push(s);c=s}c===(r.ownerDocument||ge)&&h.push(c.defaultView||c.parentWindow||e)}f=0;for(;(s=h[f++])&&!t.isPropagationStopped();){t.type=f>1?l:u.bindType||d;o=(oe._data(s,"events")||{})[t.type]&&oe._data(s,"handle");o&&o.apply(s,n);o=a&&s[a];if(o&&o.apply&&oe.acceptData(s)){t.result=o.apply(s,n);t.result===!1&&t.preventDefault()}}t.type=d;if(!i&&!t.isDefaultPrevented()&&(!u._default||u._default.apply(h.pop(),n)===!1)&&oe.acceptData(r)&&a&&r[d]&&!oe.isWindow(r)){c=r[a];c&&(r[a]=null);oe.event.triggered=d;try{r[d]()}catch(g){}oe.event.triggered=void 0;c&&(r[a]=c)}return t.result}}},dispatch:function(t){t=oe.event.fix(t);var e,n,r,i,o,a=[],s=J.call(arguments),l=(oe._data(this,"events")||{})[t.type]||[],u=oe.event.special[t.type]||{};s[0]=t;t.delegateTarget=this;if(!u.preDispatch||u.preDispatch.call(this,t)!==!1){a=oe.event.handlers.call(this,t,l);e=0;for(;(i=a[e++])&&!t.isPropagationStopped();){t.currentTarget=i.elem;o=0;for(;(r=i.handlers[o++])&&!t.isImmediatePropagationStopped();)if(!t.namespace_re||t.namespace_re.test(r.namespace)){t.handleObj=r;t.data=r.data;n=((oe.event.special[r.origType]||{}).handle||r.handler).apply(i.elem,s);if(void 0!==n&&(t.result=n)===!1){t.preventDefault();t.stopPropagation()}}}u.postDispatch&&u.postDispatch.call(this,t);return t.result}},handlers:function(t,e){var n,r,i,o,a=[],s=e.delegateCount,l=t.target;if(s&&l.nodeType&&(!t.button||"click"!==t.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==t.type)){i=[];for(o=0;s>o;o++){r=e[o];n=r.selector+" ";void 0===i[n]&&(i[n]=r.needsContext?oe(n,this).index(l)>=0:oe.find(n,this,null,[l]).length);i[n]&&i.push(r)}i.length&&a.push({elem:l,handlers:i})}s<e.length&&a.push({elem:this,handlers:e.slice(s)});return a},fix:function(t){if(t[oe.expando])return t;var e,n,r,i=t.type,o=t,a=this.fixHooks[i];a||(this.fixHooks[i]=a=Pe.test(i)?this.mouseHooks:je.test(i)?this.keyHooks:{});r=a.props?this.props.concat(a.props):this.props;t=new oe.Event(o);e=r.length;for(;e--;){n=r[e];t[n]=o[n]}t.target||(t.target=o.srcElement||ge);3===t.target.nodeType&&(t.target=t.target.parentNode);t.metaKey=!!t.metaKey;return a.filter?a.filter(t,o):t},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(t,e){null==t.which&&(t.which=null!=e.charCode?e.charCode:e.keyCode);return t}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(t,e){var n,r,i,o=e.button,a=e.fromElement;if(null==t.pageX&&null!=e.clientX){r=t.target.ownerDocument||ge;i=r.documentElement;n=r.body;t.pageX=e.clientX+(i&&i.scrollLeft||n&&n.scrollLeft||0)-(i&&i.clientLeft||n&&n.clientLeft||0);t.pageY=e.clientY+(i&&i.scrollTop||n&&n.scrollTop||0)-(i&&i.clientTop||n&&n.clientTop||0)}!t.relatedTarget&&a&&(t.relatedTarget=a===t.target?e.toElement:a);t.which||void 0===o||(t.which=1&o?1:2&o?3:4&o?2:0);return t}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==g()&&this.focus)try{this.focus();return!1}catch(t){}},delegateType:"focusin"},blur:{trigger:function(){if(this===g()&&this.blur){this.blur();return!1}},delegateType:"focusout"},click:{trigger:function(){if(oe.nodeName(this,"input")&&"checkbox"===this.type&&this.click){this.click();return!1}},_default:function(t){return oe.nodeName(t.target,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}},simulate:function(t,e,n,r){var i=oe.extend(new oe.Event,n,{type:t,isSimulated:!0,originalEvent:{}});r?oe.event.trigger(i,null,e):oe.event.dispatch.call(e,i);i.isDefaultPrevented()&&n.preventDefault()}};oe.removeEvent=ge.removeEventListener?function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n,!1)}:function(t,e,n){var r="on"+e;if(t.detachEvent){typeof t[r]===Te&&(t[r]=null);t.detachEvent(r,n)}};oe.Event=function(t,e){if(!(this instanceof oe.Event))return new oe.Event(t,e);if(t&&t.type){this.originalEvent=t;this.type=t.type;this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&t.returnValue===!1?d:p}else this.type=t;e&&oe.extend(this,e);this.timeStamp=t&&t.timeStamp||oe.now();this[oe.expando]=!0};oe.Event.prototype={isDefaultPrevented:p,isPropagationStopped:p,isImmediatePropagationStopped:p,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=d;t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=d;if(t){t.stopPropagation&&t.stopPropagation();t.cancelBubble=!0}},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=d;t&&t.stopImmediatePropagation&&t.stopImmediatePropagation();this.stopPropagation()}};oe.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(t,e){oe.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,r=this,i=t.relatedTarget,o=t.handleObj;if(!i||i!==r&&!oe.contains(r,i)){t.type=o.origType;n=o.handler.apply(this,arguments);t.type=e}return n}}});re.submitBubbles||(oe.event.special.submit={setup:function(){if(oe.nodeName(this,"form"))return!1;oe.event.add(this,"click._submit keypress._submit",function(t){var e=t.target,n=oe.nodeName(e,"input")||oe.nodeName(e,"button")?e.form:void 0;if(n&&!oe._data(n,"submitBubbles")){oe.event.add(n,"submit._submit",function(t){t._submit_bubble=!0});oe._data(n,"submitBubbles",!0)}});return void 0},postDispatch:function(t){if(t._submit_bubble){delete t._submit_bubble;this.parentNode&&!t.isTrigger&&oe.event.simulate("submit",this.parentNode,t,!0)}},teardown:function(){if(oe.nodeName(this,"form"))return!1;oe.event.remove(this,"._submit");return void 0}});re.changeBubbles||(oe.event.special.change={setup:function(){if(Ee.test(this.nodeName)){if("checkbox"===this.type||"radio"===this.type){oe.event.add(this,"propertychange._change",function(t){"checked"===t.originalEvent.propertyName&&(this._just_changed=!0)});oe.event.add(this,"click._change",function(t){this._just_changed&&!t.isTrigger&&(this._just_changed=!1);oe.event.simulate("change",this,t,!0)})}return!1}oe.event.add(this,"beforeactivate._change",function(t){var e=t.target;if(Ee.test(e.nodeName)&&!oe._data(e,"changeBubbles")){oe.event.add(e,"change._change",function(t){!this.parentNode||t.isSimulated||t.isTrigger||oe.event.simulate("change",this.parentNode,t,!0)});oe._data(e,"changeBubbles",!0)}})},handle:function(t){var e=t.target;return this!==e||t.isSimulated||t.isTrigger||"radio"!==e.type&&"checkbox"!==e.type?t.handleObj.handler.apply(this,arguments):void 0},teardown:function(){oe.event.remove(this,"._change");return!Ee.test(this.nodeName)}});re.focusinBubbles||oe.each({focus:"focusin",blur:"focusout"},function(t,e){var n=function(t){oe.event.simulate(e,t.target,oe.event.fix(t),!0)};oe.event.special[e]={setup:function(){var r=this.ownerDocument||this,i=oe._data(r,e);i||r.addEventListener(t,n,!0);oe._data(r,e,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=oe._data(r,e)-1;if(i)oe._data(r,e,i);else{r.removeEventListener(t,n,!0);oe._removeData(r,e)}}}});oe.fn.extend({on:function(t,e,n,r,i){var o,a;if("object"==typeof t){if("string"!=typeof e){n=n||e;e=void 0}for(o in t)this.on(o,e,n,t[o],i);return this}if(null==n&&null==r){r=e;n=e=void 0}else if(null==r)if("string"==typeof e){r=n;n=void 0}else{r=n;n=e;e=void 0}if(r===!1)r=p;else if(!r)return this;if(1===i){a=r;r=function(t){oe().off(t);return a.apply(this,arguments)};r.guid=a.guid||(a.guid=oe.guid++)}return this.each(function(){oe.event.add(this,t,r,n,e)})},one:function(t,e,n,r){return this.on(t,e,n,r,1)},off:function(t,e,n){var r,i;if(t&&t.preventDefault&&t.handleObj){r=t.handleObj;oe(t.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler);return this}if("object"==typeof t){for(i in t)this.off(i,e,t[i]);return this}if(e===!1||"function"==typeof e){n=e;e=void 0}n===!1&&(n=p);return this.each(function(){oe.event.remove(this,t,n,e)})},trigger:function(t,e){return this.each(function(){oe.event.trigger(t,e,this)})},triggerHandler:function(t,e){var n=this[0];return n?oe.event.trigger(t,e,n,!0):void 0}});var Oe="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Re=/ jQuery\d+="(?:null|\d+)"/g,Fe=new RegExp("<(?:"+Oe+")[\\s/>]","i"),We=/^\s+/,ze=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,qe=/<([\w:]+)/,Ue=/<tbody/i,Be=/<|&#?\w+;/,Ve=/<(?:script|style|link)/i,Xe=/checked\s*(?:[^=]|=\s*.checked.)/i,Ge=/^$|\/(?:java|ecma)script/i,$e=/^true\/(.*)/,Ye=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Je={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:re.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},Ke=m(ge),Ze=Ke.appendChild(ge.createElement("div"));Je.optgroup=Je.option;Je.tbody=Je.tfoot=Je.colgroup=Je.caption=Je.thead;Je.th=Je.td;oe.extend({clone:function(t,e,n){var r,i,o,a,s,l=oe.contains(t.ownerDocument,t);if(re.html5Clone||oe.isXMLDoc(t)||!Fe.test("<"+t.nodeName+">"))o=t.cloneNode(!0);else{Ze.innerHTML=t.outerHTML;Ze.removeChild(o=Ze.firstChild)}if(!(re.noCloneEvent&&re.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||oe.isXMLDoc(t))){r=v(o);s=v(t);for(a=0;null!=(i=s[a]);++a)r[a]&&T(i,r[a])}if(e)if(n){s=s||v(t);r=r||v(o);for(a=0;null!=(i=s[a]);a++)S(i,r[a])}else S(t,o);r=v(o,"script");r.length>0&&C(r,!l&&v(t,"script"));r=s=i=null;return o},buildFragment:function(t,e,n,r){for(var i,o,a,s,l,u,c,f=t.length,h=m(e),d=[],p=0;f>p;p++){o=t[p];if(o||0===o)if("object"===oe.type(o))oe.merge(d,o.nodeType?[o]:o);else if(Be.test(o)){s=s||h.appendChild(e.createElement("div"));l=(qe.exec(o)||["",""])[1].toLowerCase();c=Je[l]||Je._default;s.innerHTML=c[1]+o.replace(ze,"<$1></$2>")+c[2];i=c[0];for(;i--;)s=s.lastChild;!re.leadingWhitespace&&We.test(o)&&d.push(e.createTextNode(We.exec(o)[0]));if(!re.tbody){o="table"!==l||Ue.test(o)?"<table>"!==c[1]||Ue.test(o)?0:s:s.firstChild;i=o&&o.childNodes.length;for(;i--;)oe.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}oe.merge(d,s.childNodes);s.textContent="";for(;s.firstChild;)s.removeChild(s.firstChild);s=h.lastChild}else d.push(e.createTextNode(o))}s&&h.removeChild(s);re.appendChecked||oe.grep(v(d,"input"),y);p=0;for(;o=d[p++];)if(!r||-1===oe.inArray(o,r)){a=oe.contains(o.ownerDocument,o);s=v(h.appendChild(o),"script");a&&C(s);if(n){i=0;for(;o=s[i++];)Ge.test(o.type||"")&&n.push(o)}}s=null;return h},cleanData:function(t,e){for(var n,r,i,o,a=0,s=oe.expando,l=oe.cache,u=re.deleteExpando,c=oe.event.special;null!=(n=t[a]);a++)if(e||oe.acceptData(n)){i=n[s];o=i&&l[i];if(o){if(o.events)for(r in o.events)c[r]?oe.event.remove(n,r):oe.removeEvent(n,r,o.handle);
if(l[i]){delete l[i];u?delete n[s]:typeof n.removeAttribute!==Te?n.removeAttribute(s):n[s]=null;Y.push(i)}}}}});oe.fn.extend({text:function(t){return Ae(this,function(t){return void 0===t?oe.text(this):this.empty().append((this[0]&&this[0].ownerDocument||ge).createTextNode(t))},null,t,arguments.length)},append:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=b(this,t);e.appendChild(t)}})},prepend:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=b(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},remove:function(t,e){for(var n,r=t?oe.filter(t,this):this,i=0;null!=(n=r[i]);i++){e||1!==n.nodeType||oe.cleanData(v(n));if(n.parentNode){e&&oe.contains(n.ownerDocument,n)&&C(v(n,"script"));n.parentNode.removeChild(n)}}return this},empty:function(){for(var t,e=0;null!=(t=this[e]);e++){1===t.nodeType&&oe.cleanData(v(t,!1));for(;t.firstChild;)t.removeChild(t.firstChild);t.options&&oe.nodeName(t,"select")&&(t.options.length=0)}return this},clone:function(t,e){t=null==t?!1:t;e=null==e?t:e;return this.map(function(){return oe.clone(this,t,e)})},html:function(t){return Ae(this,function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t)return 1===e.nodeType?e.innerHTML.replace(Re,""):void 0;if(!("string"!=typeof t||Ve.test(t)||!re.htmlSerialize&&Fe.test(t)||!re.leadingWhitespace&&We.test(t)||Je[(qe.exec(t)||["",""])[1].toLowerCase()])){t=t.replace(ze,"<$1></$2>");try{for(;r>n;n++){e=this[n]||{};if(1===e.nodeType){oe.cleanData(v(e,!1));e.innerHTML=t}}e=0}catch(i){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=arguments[0];this.domManip(arguments,function(e){t=this.parentNode;oe.cleanData(v(this));t&&t.replaceChild(e,this)});return t&&(t.length||t.nodeType)?this:this.remove()},detach:function(t){return this.remove(t,!0)},domManip:function(t,e){t=K.apply([],t);var n,r,i,o,a,s,l=0,u=this.length,c=this,f=u-1,h=t[0],d=oe.isFunction(h);if(d||u>1&&"string"==typeof h&&!re.checkClone&&Xe.test(h))return this.each(function(n){var r=c.eq(n);d&&(t[0]=h.call(this,n,r.html()));r.domManip(t,e)});if(u){s=oe.buildFragment(t,this[0].ownerDocument,!1,this);n=s.firstChild;1===s.childNodes.length&&(s=n);if(n){o=oe.map(v(s,"script"),x);i=o.length;for(;u>l;l++){r=s;if(l!==f){r=oe.clone(r,!0,!0);i&&oe.merge(o,v(r,"script"))}e.call(this[l],r,l)}if(i){a=o[o.length-1].ownerDocument;oe.map(o,w);for(l=0;i>l;l++){r=o[l];Ge.test(r.type||"")&&!oe._data(r,"globalEval")&&oe.contains(a,r)&&(r.src?oe._evalUrl&&oe._evalUrl(r.src):oe.globalEval((r.text||r.textContent||r.innerHTML||"").replace(Ye,"")))}}s=n=null}}return this}});oe.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){oe.fn[t]=function(t){for(var n,r=0,i=[],o=oe(t),a=o.length-1;a>=r;r++){n=r===a?this:this.clone(!0);oe(o[r])[e](n);Z.apply(i,n.get())}return this.pushStack(i)}});var Qe,tn={};(function(){var t;re.shrinkWrapBlocks=function(){if(null!=t)return t;t=!1;var e,n,r;n=ge.getElementsByTagName("body")[0];if(n&&n.style){e=ge.createElement("div");r=ge.createElement("div");r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px";n.appendChild(r).appendChild(e);if(typeof e.style.zoom!==Te){e.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1";e.appendChild(ge.createElement("div")).style.width="5px";t=3!==e.offsetWidth}n.removeChild(r);return t}}})();var en,nn,rn=/^margin/,on=new RegExp("^("+Me+")(?!px)[a-z%]+$","i"),an=/^(top|right|bottom|left)$/;if(e.getComputedStyle){en=function(t){return t.ownerDocument.defaultView.opener?t.ownerDocument.defaultView.getComputedStyle(t,null):e.getComputedStyle(t,null)};nn=function(t,e,n){var r,i,o,a,s=t.style;n=n||en(t);a=n?n.getPropertyValue(e)||n[e]:void 0;if(n){""!==a||oe.contains(t.ownerDocument,t)||(a=oe.style(t,e));if(on.test(a)&&rn.test(e)){r=s.width;i=s.minWidth;o=s.maxWidth;s.minWidth=s.maxWidth=s.width=a;a=n.width;s.width=r;s.minWidth=i;s.maxWidth=o}}return void 0===a?a:a+""}}else if(ge.documentElement.currentStyle){en=function(t){return t.currentStyle};nn=function(t,e,n){var r,i,o,a,s=t.style;n=n||en(t);a=n?n[e]:void 0;null==a&&s&&s[e]&&(a=s[e]);if(on.test(a)&&!an.test(e)){r=s.left;i=t.runtimeStyle;o=i&&i.left;o&&(i.left=t.currentStyle.left);s.left="fontSize"===e?"1em":a;a=s.pixelLeft+"px";s.left=r;o&&(i.left=o)}return void 0===a?a:a+""||"auto"}}(function(){function t(){var t,n,r,i;n=ge.getElementsByTagName("body")[0];if(n&&n.style){t=ge.createElement("div");r=ge.createElement("div");r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px";n.appendChild(r).appendChild(t);t.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute";o=a=!1;l=!0;if(e.getComputedStyle){o="1%"!==(e.getComputedStyle(t,null)||{}).top;a="4px"===(e.getComputedStyle(t,null)||{width:"4px"}).width;i=t.appendChild(ge.createElement("div"));i.style.cssText=t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0";i.style.marginRight=i.style.width="0";t.style.width="1px";l=!parseFloat((e.getComputedStyle(i,null)||{}).marginRight);t.removeChild(i)}t.innerHTML="<table><tr><td></td><td>t</td></tr></table>";i=t.getElementsByTagName("td");i[0].style.cssText="margin:0;border:0;padding:0;display:none";s=0===i[0].offsetHeight;if(s){i[0].style.display="";i[1].style.display="none";s=0===i[0].offsetHeight}n.removeChild(r)}}var n,r,i,o,a,s,l;n=ge.createElement("div");n.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";i=n.getElementsByTagName("a")[0];r=i&&i.style;if(r){r.cssText="float:left;opacity:.5";re.opacity="0.5"===r.opacity;re.cssFloat=!!r.cssFloat;n.style.backgroundClip="content-box";n.cloneNode(!0).style.backgroundClip="";re.clearCloneStyle="content-box"===n.style.backgroundClip;re.boxSizing=""===r.boxSizing||""===r.MozBoxSizing||""===r.WebkitBoxSizing;oe.extend(re,{reliableHiddenOffsets:function(){null==s&&t();return s},boxSizingReliable:function(){null==a&&t();return a},pixelPosition:function(){null==o&&t();return o},reliableMarginRight:function(){null==l&&t();return l}})}})();oe.swap=function(t,e,n,r){var i,o,a={};for(o in e){a[o]=t.style[o];t.style[o]=e[o]}i=n.apply(t,r||[]);for(o in e)t.style[o]=a[o];return i};var sn=/alpha\([^)]*\)/i,ln=/opacity\s*=\s*([^)]*)/,un=/^(none|table(?!-c[ea]).+)/,cn=new RegExp("^("+Me+")(.*)$","i"),fn=new RegExp("^([+-])=("+Me+")","i"),hn={position:"absolute",visibility:"hidden",display:"block"},dn={letterSpacing:"0",fontWeight:"400"},pn=["Webkit","O","Moz","ms"];oe.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=nn(t,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":re.cssFloat?"cssFloat":"styleFloat"},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var i,o,a,s=oe.camelCase(e),l=t.style;e=oe.cssProps[s]||(oe.cssProps[s]=D(l,s));a=oe.cssHooks[e]||oe.cssHooks[s];if(void 0===n)return a&&"get"in a&&void 0!==(i=a.get(t,!1,r))?i:l[e];o=typeof n;if("string"===o&&(i=fn.exec(n))){n=(i[1]+1)*i[2]+parseFloat(oe.css(t,e));o="number"}if(null!=n&&n===n){"number"!==o||oe.cssNumber[s]||(n+="px");re.clearCloneStyle||""!==n||0!==e.indexOf("background")||(l[e]="inherit");if(!(a&&"set"in a&&void 0===(n=a.set(t,n,r))))try{l[e]=n}catch(u){}}}},css:function(t,e,n,r){var i,o,a,s=oe.camelCase(e);e=oe.cssProps[s]||(oe.cssProps[s]=D(t.style,s));a=oe.cssHooks[e]||oe.cssHooks[s];a&&"get"in a&&(o=a.get(t,!0,n));void 0===o&&(o=nn(t,e,r));"normal"===o&&e in dn&&(o=dn[e]);if(""===n||n){i=parseFloat(o);return n===!0||oe.isNumeric(i)?i||0:o}return o}});oe.each(["height","width"],function(t,e){oe.cssHooks[e]={get:function(t,n,r){return n?un.test(oe.css(t,"display"))&&0===t.offsetWidth?oe.swap(t,hn,function(){return E(t,e,r)}):E(t,e,r):void 0},set:function(t,n,r){var i=r&&en(t);return A(t,n,r?N(t,e,r,re.boxSizing&&"border-box"===oe.css(t,"boxSizing",!1,i),i):0)}}});re.opacity||(oe.cssHooks.opacity={get:function(t,e){return ln.test((e&&t.currentStyle?t.currentStyle.filter:t.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":e?"1":""},set:function(t,e){var n=t.style,r=t.currentStyle,i=oe.isNumeric(e)?"alpha(opacity="+100*e+")":"",o=r&&r.filter||n.filter||"";n.zoom=1;if((e>=1||""===e)&&""===oe.trim(o.replace(sn,""))&&n.removeAttribute){n.removeAttribute("filter");if(""===e||r&&!r.filter)return}n.filter=sn.test(o)?o.replace(sn,i):o+" "+i}});oe.cssHooks.marginRight=M(re.reliableMarginRight,function(t,e){return e?oe.swap(t,{display:"inline-block"},nn,[t,"marginRight"]):void 0});oe.each({margin:"",padding:"",border:"Width"},function(t,e){oe.cssHooks[t+e]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[t+De[r]+e]=o[r]||o[r-2]||o[0];return i}};rn.test(t)||(oe.cssHooks[t+e].set=A)});oe.fn.extend({css:function(t,e){return Ae(this,function(t,e,n){var r,i,o={},a=0;if(oe.isArray(e)){r=en(t);i=e.length;for(;i>a;a++)o[e[a]]=oe.css(t,e[a],!1,r);return o}return void 0!==n?oe.style(t,e,n):oe.css(t,e)},t,e,arguments.length>1)},show:function(){return L(this,!0)},hide:function(){return L(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){Le(this)?oe(this).show():oe(this).hide()})}});oe.Tween=j;j.prototype={constructor:j,init:function(t,e,n,r,i,o){this.elem=t;this.prop=n;this.easing=i||"swing";this.options=e;this.start=this.now=this.cur();this.end=r;this.unit=o||(oe.cssNumber[n]?"":"px")},cur:function(){var t=j.propHooks[this.prop];return t&&t.get?t.get(this):j.propHooks._default.get(this)},run:function(t){var e,n=j.propHooks[this.prop];this.pos=e=this.options.duration?oe.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):t;this.now=(this.end-this.start)*e+this.start;this.options.step&&this.options.step.call(this.elem,this.now,this);n&&n.set?n.set(this):j.propHooks._default.set(this);return this}};j.prototype.init.prototype=j.prototype;j.propHooks={_default:{get:function(t){var e;if(null!=t.elem[t.prop]&&(!t.elem.style||null==t.elem.style[t.prop]))return t.elem[t.prop];e=oe.css(t.elem,t.prop,"");return e&&"auto"!==e?e:0},set:function(t){oe.fx.step[t.prop]?oe.fx.step[t.prop](t):t.elem.style&&(null!=t.elem.style[oe.cssProps[t.prop]]||oe.cssHooks[t.prop])?oe.style(t.elem,t.prop,t.now+t.unit):t.elem[t.prop]=t.now}}};j.propHooks.scrollTop=j.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}};oe.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2}};oe.fx=j.prototype.init;oe.fx.step={};var gn,mn,vn=/^(?:toggle|show|hide)$/,yn=new RegExp("^(?:([+-])=|)("+Me+")([a-z%]*)$","i"),bn=/queueHooks$/,xn=[O],wn={"*":[function(t,e){var n=this.createTween(t,e),r=n.cur(),i=yn.exec(e),o=i&&i[3]||(oe.cssNumber[t]?"":"px"),a=(oe.cssNumber[t]||"px"!==o&&+r)&&yn.exec(oe.css(n.elem,t)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3];i=i||[];a=+r||1;do{s=s||".5";a/=s;oe.style(n.elem,t,a+o)}while(s!==(s=n.cur()/r)&&1!==s&&--l)}if(i){a=n.start=+a||+r||0;n.unit=o;n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]}return n}]};oe.Animation=oe.extend(F,{tweener:function(t,e){if(oe.isFunction(t)){e=t;t=["*"]}else t=t.split(" ");for(var n,r=0,i=t.length;i>r;r++){n=t[r];wn[n]=wn[n]||[];wn[n].unshift(e)}},prefilter:function(t,e){e?xn.unshift(t):xn.push(t)}});oe.speed=function(t,e,n){var r=t&&"object"==typeof t?oe.extend({},t):{complete:n||!n&&e||oe.isFunction(t)&&t,duration:t,easing:n&&e||e&&!oe.isFunction(e)&&e};r.duration=oe.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in oe.fx.speeds?oe.fx.speeds[r.duration]:oe.fx.speeds._default;(null==r.queue||r.queue===!0)&&(r.queue="fx");r.old=r.complete;r.complete=function(){oe.isFunction(r.old)&&r.old.call(this);r.queue&&oe.dequeue(this,r.queue)};return r};oe.fn.extend({fadeTo:function(t,e,n,r){return this.filter(Le).css("opacity",0).show().end().animate({opacity:e},t,n,r)},animate:function(t,e,n,r){var i=oe.isEmptyObject(t),o=oe.speed(e,n,r),a=function(){var e=F(this,oe.extend({},t),o);(i||oe._data(this,"finish"))&&e.stop(!0)};a.finish=a;return i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(t,e,n){var r=function(t){var e=t.stop;delete t.stop;e(n)};if("string"!=typeof t){n=e;e=t;t=void 0}e&&t!==!1&&this.queue(t||"fx",[]);return this.each(function(){var e=!0,i=null!=t&&t+"queueHooks",o=oe.timers,a=oe._data(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&bn.test(i)&&r(a[i]);for(i=o.length;i--;)if(o[i].elem===this&&(null==t||o[i].queue===t)){o[i].anim.stop(n);e=!1;o.splice(i,1)}(e||!n)&&oe.dequeue(this,t)})},finish:function(t){t!==!1&&(t=t||"fx");return this.each(function(){var e,n=oe._data(this),r=n[t+"queue"],i=n[t+"queueHooks"],o=oe.timers,a=r?r.length:0;n.finish=!0;oe.queue(this,t,[]);i&&i.stop&&i.stop.call(this,!0);for(e=o.length;e--;)if(o[e].elem===this&&o[e].queue===t){o[e].anim.stop(!0);o.splice(e,1)}for(e=0;a>e;e++)r[e]&&r[e].finish&&r[e].finish.call(this);delete n.finish})}});oe.each(["toggle","show","hide"],function(t,e){var n=oe.fn[e];oe.fn[e]=function(t,r,i){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(I(e,!0),t,r,i)}});oe.each({slideDown:I("show"),slideUp:I("hide"),slideToggle:I("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){oe.fn[t]=function(t,n,r){return this.animate(e,t,n,r)}});oe.timers=[];oe.fx.tick=function(){var t,e=oe.timers,n=0;gn=oe.now();for(;n<e.length;n++){t=e[n];t()||e[n]!==t||e.splice(n--,1)}e.length||oe.fx.stop();gn=void 0};oe.fx.timer=function(t){oe.timers.push(t);t()?oe.fx.start():oe.timers.pop()};oe.fx.interval=13;oe.fx.start=function(){mn||(mn=setInterval(oe.fx.tick,oe.fx.interval))};oe.fx.stop=function(){clearInterval(mn);mn=null};oe.fx.speeds={slow:600,fast:200,_default:400};oe.fn.delay=function(t,e){t=oe.fx?oe.fx.speeds[t]||t:t;e=e||"fx";return this.queue(e,function(e,n){var r=setTimeout(e,t);n.stop=function(){clearTimeout(r)}})};(function(){var t,e,n,r,i;e=ge.createElement("div");e.setAttribute("className","t");e.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";r=e.getElementsByTagName("a")[0];n=ge.createElement("select");i=n.appendChild(ge.createElement("option"));t=e.getElementsByTagName("input")[0];r.style.cssText="top:1px";re.getSetAttribute="t"!==e.className;re.style=/top/.test(r.getAttribute("style"));re.hrefNormalized="/a"===r.getAttribute("href");re.checkOn=!!t.value;re.optSelected=i.selected;re.enctype=!!ge.createElement("form").enctype;n.disabled=!0;re.optDisabled=!i.disabled;t=ge.createElement("input");t.setAttribute("value","");re.input=""===t.getAttribute("value");t.value="t";t.setAttribute("type","radio");re.radioValue="t"===t.value})();var Cn=/\r/g;oe.fn.extend({val:function(t){var e,n,r,i=this[0];if(arguments.length){r=oe.isFunction(t);return this.each(function(n){var i;if(1===this.nodeType){i=r?t.call(this,n,oe(this).val()):t;null==i?i="":"number"==typeof i?i+="":oe.isArray(i)&&(i=oe.map(i,function(t){return null==t?"":t+""}));e=oe.valHooks[this.type]||oe.valHooks[this.nodeName.toLowerCase()];e&&"set"in e&&void 0!==e.set(this,i,"value")||(this.value=i)}})}if(i){e=oe.valHooks[i.type]||oe.valHooks[i.nodeName.toLowerCase()];if(e&&"get"in e&&void 0!==(n=e.get(i,"value")))return n;n=i.value;return"string"==typeof n?n.replace(Cn,""):null==n?"":n}}});oe.extend({valHooks:{option:{get:function(t){var e=oe.find.attr(t,"value");return null!=e?e:oe.trim(oe.text(t))}},select:{get:function(t){for(var e,n,r=t.options,i=t.selectedIndex,o="select-one"===t.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;s>l;l++){n=r[l];if(!(!n.selected&&l!==i||(re.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&oe.nodeName(n.parentNode,"optgroup"))){e=oe(n).val();if(o)return e;a.push(e)}}return a},set:function(t,e){for(var n,r,i=t.options,o=oe.makeArray(e),a=i.length;a--;){r=i[a];if(oe.inArray(oe.valHooks.option.get(r),o)>=0)try{r.selected=n=!0}catch(s){r.scrollHeight}else r.selected=!1}n||(t.selectedIndex=-1);return i}}}});oe.each(["radio","checkbox"],function(){oe.valHooks[this]={set:function(t,e){return oe.isArray(e)?t.checked=oe.inArray(oe(t).val(),e)>=0:void 0}};re.checkOn||(oe.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var Sn,Tn,kn=oe.expr.attrHandle,_n=/^(?:checked|selected)$/i,Mn=re.getSetAttribute,Dn=re.input;oe.fn.extend({attr:function(t,e){return Ae(this,oe.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){oe.removeAttr(this,t)})}});oe.extend({attr:function(t,e,n){var r,i,o=t.nodeType;if(t&&3!==o&&8!==o&&2!==o){if(typeof t.getAttribute===Te)return oe.prop(t,e,n);if(1!==o||!oe.isXMLDoc(t)){e=e.toLowerCase();r=oe.attrHooks[e]||(oe.expr.match.bool.test(e)?Tn:Sn)}if(void 0===n){if(r&&"get"in r&&null!==(i=r.get(t,e)))return i;i=oe.find.attr(t,e);return null==i?void 0:i}if(null!==n){if(r&&"set"in r&&void 0!==(i=r.set(t,n,e)))return i;t.setAttribute(e,n+"");return n}oe.removeAttr(t,e)}},removeAttr:function(t,e){var n,r,i=0,o=e&&e.match(xe);if(o&&1===t.nodeType)for(;n=o[i++];){r=oe.propFix[n]||n;oe.expr.match.bool.test(n)?Dn&&Mn||!_n.test(n)?t[r]=!1:t[oe.camelCase("default-"+n)]=t[r]=!1:oe.attr(t,n,"");t.removeAttribute(Mn?n:r)}},attrHooks:{type:{set:function(t,e){if(!re.radioValue&&"radio"===e&&oe.nodeName(t,"input")){var n=t.value;t.setAttribute("type",e);n&&(t.value=n);return e}}}}});Tn={set:function(t,e,n){e===!1?oe.removeAttr(t,n):Dn&&Mn||!_n.test(n)?t.setAttribute(!Mn&&oe.propFix[n]||n,n):t[oe.camelCase("default-"+n)]=t[n]=!0;return n}};oe.each(oe.expr.match.bool.source.match(/\w+/g),function(t,e){var n=kn[e]||oe.find.attr;kn[e]=Dn&&Mn||!_n.test(e)?function(t,e,r){var i,o;if(!r){o=kn[e];kn[e]=i;i=null!=n(t,e,r)?e.toLowerCase():null;kn[e]=o}return i}:function(t,e,n){return n?void 0:t[oe.camelCase("default-"+e)]?e.toLowerCase():null}});Dn&&Mn||(oe.attrHooks.value={set:function(t,e,n){if(!oe.nodeName(t,"input"))return Sn&&Sn.set(t,e,n);t.defaultValue=e;return void 0}});if(!Mn){Sn={set:function(t,e,n){var r=t.getAttributeNode(n);r||t.setAttributeNode(r=t.ownerDocument.createAttribute(n));r.value=e+="";return"value"===n||e===t.getAttribute(n)?e:void 0}};kn.id=kn.name=kn.coords=function(t,e,n){var r;return n?void 0:(r=t.getAttributeNode(e))&&""!==r.value?r.value:null};oe.valHooks.button={get:function(t,e){var n=t.getAttributeNode(e);return n&&n.specified?n.value:void 0},set:Sn.set};oe.attrHooks.contenteditable={set:function(t,e,n){Sn.set(t,""===e?!1:e,n)}};oe.each(["width","height"],function(t,e){oe.attrHooks[e]={set:function(t,n){if(""===n){t.setAttribute(e,"auto");return n}}}})}re.style||(oe.attrHooks.style={get:function(t){return t.style.cssText||void 0},set:function(t,e){return t.style.cssText=e+""}});var Ln=/^(?:input|select|textarea|button|object)$/i,An=/^(?:a|area)$/i;oe.fn.extend({prop:function(t,e){return Ae(this,oe.prop,t,e,arguments.length>1)},removeProp:function(t){t=oe.propFix[t]||t;return this.each(function(){try{this[t]=void 0;delete this[t]}catch(e){}})}});oe.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(t,e,n){var r,i,o,a=t.nodeType;if(t&&3!==a&&8!==a&&2!==a){o=1!==a||!oe.isXMLDoc(t);if(o){e=oe.propFix[e]||e;i=oe.propHooks[e]}return void 0!==n?i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:t[e]=n:i&&"get"in i&&null!==(r=i.get(t,e))?r:t[e]}},propHooks:{tabIndex:{get:function(t){var e=oe.find.attr(t,"tabindex");return e?parseInt(e,10):Ln.test(t.nodeName)||An.test(t.nodeName)&&t.href?0:-1}}}});re.hrefNormalized||oe.each(["href","src"],function(t,e){oe.propHooks[e]={get:function(t){return t.getAttribute(e,4)}}});re.optSelected||(oe.propHooks.selected={get:function(t){var e=t.parentNode;if(e){e.selectedIndex;e.parentNode&&e.parentNode.selectedIndex}return null}});oe.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){oe.propFix[this.toLowerCase()]=this});re.enctype||(oe.propFix.enctype="encoding");var Nn=/[\t\r\n\f]/g;oe.fn.extend({addClass:function(t){var e,n,r,i,o,a,s=0,l=this.length,u="string"==typeof t&&t;if(oe.isFunction(t))return this.each(function(e){oe(this).addClass(t.call(this,e,this.className))});if(u){e=(t||"").match(xe)||[];for(;l>s;s++){n=this[s];r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(Nn," "):" ");if(r){o=0;for(;i=e[o++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");a=oe.trim(r);n.className!==a&&(n.className=a)}}}return this},removeClass:function(t){var e,n,r,i,o,a,s=0,l=this.length,u=0===arguments.length||"string"==typeof t&&t;if(oe.isFunction(t))return this.each(function(e){oe(this).removeClass(t.call(this,e,this.className))});if(u){e=(t||"").match(xe)||[];for(;l>s;s++){n=this[s];r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(Nn," "):"");if(r){o=0;for(;i=e[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");a=t?oe.trim(r):"";n.className!==a&&(n.className=a)}}}return this},toggleClass:function(t,e){var n=typeof t;return"boolean"==typeof e&&"string"===n?e?this.addClass(t):this.removeClass(t):this.each(oe.isFunction(t)?function(n){oe(this).toggleClass(t.call(this,n,this.className,e),e)}:function(){if("string"===n)for(var e,r=0,i=oe(this),o=t.match(xe)||[];e=o[r++];)i.hasClass(e)?i.removeClass(e):i.addClass(e);else if(n===Te||"boolean"===n){this.className&&oe._data(this,"__className__",this.className);this.className=this.className||t===!1?"":oe._data(this,"__className__")||""}})},hasClass:function(t){for(var e=" "+t+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(Nn," ").indexOf(e)>=0)return!0;return!1}});oe.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(t,e){oe.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}});oe.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)},bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,r){return this.on(e,t,n,r)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)}});var En=oe.now(),jn=/\?/,Pn=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;oe.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,r=null,i=oe.trim(t+"");return i&&!oe.trim(i.replace(Pn,function(t,e,i,o){n&&e&&(r=0);if(0===r)return t;n=i||e;r+=!o-!i;return""}))?Function("return "+i)():oe.error("Invalid JSON: "+t)};oe.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{if(e.DOMParser){r=new DOMParser;n=r.parseFromString(t,"text/xml")}else{n=new ActiveXObject("Microsoft.XMLDOM");n.async="false";n.loadXML(t)}}catch(i){n=void 0}n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||oe.error("Invalid XML: "+t);return n};var In,Hn,On=/#.*$/,Rn=/([?&])_=[^&]*/,Fn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Wn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,zn=/^(?:GET|HEAD)$/,qn=/^\/\//,Un=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Bn={},Vn={},Xn="*/".concat("*");try{Hn=location.href}catch(Gn){Hn=ge.createElement("a");Hn.href="";Hn=Hn.href}In=Un.exec(Hn.toLowerCase())||[];oe.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Hn,type:"GET",isLocal:Wn.test(In[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Xn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":oe.parseJSON,"text xml":oe.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?q(q(t,oe.ajaxSettings),e):q(oe.ajaxSettings,t)},ajaxPrefilter:W(Bn),ajaxTransport:W(Vn),ajax:function(t,e){function n(t,e,n,r){var i,c,v,y,x,C=e;if(2!==b){b=2;s&&clearTimeout(s);u=void 0;a=r||"";w.readyState=t>0?4:0;i=t>=200&&300>t||304===t;n&&(y=U(f,w,n));y=B(f,y,w,i);if(i){if(f.ifModified){x=w.getResponseHeader("Last-Modified");x&&(oe.lastModified[o]=x);x=w.getResponseHeader("etag");x&&(oe.etag[o]=x)}if(204===t||"HEAD"===f.type)C="nocontent";else if(304===t)C="notmodified";else{C=y.state;c=y.data;v=y.error;i=!v}}else{v=C;if(t||!C){C="error";0>t&&(t=0)}}w.status=t;w.statusText=(e||C)+"";i?p.resolveWith(h,[c,C,w]):p.rejectWith(h,[w,C,v]);w.statusCode(m);m=void 0;l&&d.trigger(i?"ajaxSuccess":"ajaxError",[w,f,i?c:v]);g.fireWith(h,[w,C]);if(l){d.trigger("ajaxComplete",[w,f]);--oe.active||oe.event.trigger("ajaxStop")}}}if("object"==typeof t){e=t;t=void 0}e=e||{};var r,i,o,a,s,l,u,c,f=oe.ajaxSetup({},e),h=f.context||f,d=f.context&&(h.nodeType||h.jquery)?oe(h):oe.event,p=oe.Deferred(),g=oe.Callbacks("once memory"),m=f.statusCode||{},v={},y={},b=0,x="canceled",w={readyState:0,getResponseHeader:function(t){var e;if(2===b){if(!c){c={};for(;e=Fn.exec(a);)c[e[1].toLowerCase()]=e[2]}e=c[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(t,e){var n=t.toLowerCase();if(!b){t=y[n]=y[n]||t;v[t]=e}return this},overrideMimeType:function(t){b||(f.mimeType=t);return this},statusCode:function(t){var e;if(t)if(2>b)for(e in t)m[e]=[m[e],t[e]];else w.always(t[w.status]);return this},abort:function(t){var e=t||x;u&&u.abort(e);n(0,e);return this}};p.promise(w).complete=g.add;w.success=w.done;w.error=w.fail;f.url=((t||f.url||Hn)+"").replace(On,"").replace(qn,In[1]+"//");f.type=e.method||e.type||f.method||f.type;f.dataTypes=oe.trim(f.dataType||"*").toLowerCase().match(xe)||[""];if(null==f.crossDomain){r=Un.exec(f.url.toLowerCase());f.crossDomain=!(!r||r[1]===In[1]&&r[2]===In[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(In[3]||("http:"===In[1]?"80":"443")))}f.data&&f.processData&&"string"!=typeof f.data&&(f.data=oe.param(f.data,f.traditional));z(Bn,f,e,w);if(2===b)return w;l=oe.event&&f.global;l&&0===oe.active++&&oe.event.trigger("ajaxStart");f.type=f.type.toUpperCase();f.hasContent=!zn.test(f.type);o=f.url;if(!f.hasContent){if(f.data){o=f.url+=(jn.test(o)?"&":"?")+f.data;delete f.data}f.cache===!1&&(f.url=Rn.test(o)?o.replace(Rn,"$1_="+En++):o+(jn.test(o)?"&":"?")+"_="+En++)}if(f.ifModified){oe.lastModified[o]&&w.setRequestHeader("If-Modified-Since",oe.lastModified[o]);oe.etag[o]&&w.setRequestHeader("If-None-Match",oe.etag[o])}(f.data&&f.hasContent&&f.contentType!==!1||e.contentType)&&w.setRequestHeader("Content-Type",f.contentType);w.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Xn+"; q=0.01":""):f.accepts["*"]);for(i in f.headers)w.setRequestHeader(i,f.headers[i]);if(f.beforeSend&&(f.beforeSend.call(h,w,f)===!1||2===b))return w.abort();x="abort";for(i in{success:1,error:1,complete:1})w[i](f[i]);u=z(Vn,f,e,w);if(u){w.readyState=1;l&&d.trigger("ajaxSend",[w,f]);f.async&&f.timeout>0&&(s=setTimeout(function(){w.abort("timeout")},f.timeout));try{b=1;u.send(v,n)}catch(C){if(!(2>b))throw C;n(-1,C)}}else n(-1,"No Transport");return w},getJSON:function(t,e,n){return oe.get(t,e,n,"json")},getScript:function(t,e){return oe.get(t,void 0,e,"script")}});oe.each(["get","post"],function(t,e){oe[e]=function(t,n,r,i){if(oe.isFunction(n)){i=i||r;r=n;n=void 0}return oe.ajax({url:t,type:e,dataType:i,data:n,success:r})}});oe._evalUrl=function(t){return oe.ajax({url:t,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})};oe.fn.extend({wrapAll:function(t){if(oe.isFunction(t))return this.each(function(e){oe(this).wrapAll(t.call(this,e))});if(this[0]){var e=oe(t,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&e.insertBefore(this[0]);e.map(function(){for(var t=this;t.firstChild&&1===t.firstChild.nodeType;)t=t.firstChild;return t}).append(this)}return this},wrapInner:function(t){return this.each(oe.isFunction(t)?function(e){oe(this).wrapInner(t.call(this,e))}:function(){var e=oe(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=oe.isFunction(t);return this.each(function(n){oe(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(){return this.parent().each(function(){oe.nodeName(this,"body")||oe(this).replaceWith(this.childNodes)}).end()}});oe.expr.filters.hidden=function(t){return t.offsetWidth<=0&&t.offsetHeight<=0||!re.reliableHiddenOffsets()&&"none"===(t.style&&t.style.display||oe.css(t,"display"))};oe.expr.filters.visible=function(t){return!oe.expr.filters.hidden(t)};var $n=/%20/g,Yn=/\[\]$/,Jn=/\r?\n/g,Kn=/^(?:submit|button|image|reset|file)$/i,Zn=/^(?:input|select|textarea|keygen)/i;oe.param=function(t,e){var n,r=[],i=function(t,e){e=oe.isFunction(e)?e():null==e?"":e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};void 0===e&&(e=oe.ajaxSettings&&oe.ajaxSettings.traditional);if(oe.isArray(t)||t.jquery&&!oe.isPlainObject(t))oe.each(t,function(){i(this.name,this.value)});else for(n in t)V(n,t[n],e,i);return r.join("&").replace($n,"+")};oe.fn.extend({serialize:function(){return oe.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=oe.prop(this,"elements");return t?oe.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!oe(this).is(":disabled")&&Zn.test(this.nodeName)&&!Kn.test(t)&&(this.checked||!Ne.test(t))}).map(function(t,e){var n=oe(this).val();return null==n?null:oe.isArray(n)?oe.map(n,function(t){return{name:e.name,value:t.replace(Jn,"\r\n")}}):{name:e.name,value:n.replace(Jn,"\r\n")}}).get()}});oe.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&X()||G()}:X;var Qn=0,tr={},er=oe.ajaxSettings.xhr();e.attachEvent&&e.attachEvent("onunload",function(){for(var t in tr)tr[t](void 0,!0)});re.cors=!!er&&"withCredentials"in er;er=re.ajax=!!er;er&&oe.ajaxTransport(function(t){if(!t.crossDomain||re.cors){var e;return{send:function(n,r){var i,o=t.xhr(),a=++Qn;o.open(t.type,t.url,t.async,t.username,t.password);if(t.xhrFields)for(i in t.xhrFields)o[i]=t.xhrFields[i];t.mimeType&&o.overrideMimeType&&o.overrideMimeType(t.mimeType);t.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)void 0!==n[i]&&o.setRequestHeader(i,n[i]+"");o.send(t.hasContent&&t.data||null);e=function(n,i){var s,l,u;if(e&&(i||4===o.readyState)){delete tr[a];e=void 0;o.onreadystatechange=oe.noop;if(i)4!==o.readyState&&o.abort();else{u={};s=o.status;"string"==typeof o.responseText&&(u.text=o.responseText);try{l=o.statusText}catch(c){l=""}s||!t.isLocal||t.crossDomain?1223===s&&(s=204):s=u.text?200:404}}u&&r(s,l,u,o.getAllResponseHeaders())};t.async?4===o.readyState?setTimeout(e):o.onreadystatechange=tr[a]=e:e()},abort:function(){e&&e(void 0,!0)}}}});oe.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(t){oe.globalEval(t);return t}}});oe.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1);if(t.crossDomain){t.type="GET";t.global=!1}});oe.ajaxTransport("script",function(t){if(t.crossDomain){var e,n=ge.head||oe("head")[0]||ge.documentElement;
return{send:function(r,i){e=ge.createElement("script");e.async=!0;t.scriptCharset&&(e.charset=t.scriptCharset);e.src=t.url;e.onload=e.onreadystatechange=function(t,n){if(n||!e.readyState||/loaded|complete/.test(e.readyState)){e.onload=e.onreadystatechange=null;e.parentNode&&e.parentNode.removeChild(e);e=null;n||i(200,"success")}};n.insertBefore(e,n.firstChild)},abort:function(){e&&e.onload(void 0,!0)}}}});var nr=[],rr=/(=)\?(?=&|$)|\?\?/;oe.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=nr.pop()||oe.expando+"_"+En++;this[t]=!0;return t}});oe.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=t.jsonp!==!1&&(rr.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&rr.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0]){i=t.jsonpCallback=oe.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback;s?t[s]=t[s].replace(rr,"$1"+i):t.jsonp!==!1&&(t.url+=(jn.test(t.url)?"&":"?")+t.jsonp+"="+i);t.converters["script json"]=function(){a||oe.error(i+" was not called");return a[0]};t.dataTypes[0]="json";o=e[i];e[i]=function(){a=arguments};r.always(function(){e[i]=o;if(t[i]){t.jsonpCallback=n.jsonpCallback;nr.push(i)}a&&oe.isFunction(o)&&o(a[0]);a=o=void 0});return"script"}});oe.parseHTML=function(t,e,n){if(!t||"string"!=typeof t)return null;if("boolean"==typeof e){n=e;e=!1}e=e||ge;var r=he.exec(t),i=!n&&[];if(r)return[e.createElement(r[1])];r=oe.buildFragment([t],e,i);i&&i.length&&oe(i).remove();return oe.merge([],r.childNodes)};var ir=oe.fn.load;oe.fn.load=function(t,e,n){if("string"!=typeof t&&ir)return ir.apply(this,arguments);var r,i,o,a=this,s=t.indexOf(" ");if(s>=0){r=oe.trim(t.slice(s,t.length));t=t.slice(0,s)}if(oe.isFunction(e)){n=e;e=void 0}else e&&"object"==typeof e&&(o="POST");a.length>0&&oe.ajax({url:t,type:o,dataType:"html",data:e}).done(function(t){i=arguments;a.html(r?oe("<div>").append(oe.parseHTML(t)).find(r):t)}).complete(n&&function(t,e){a.each(n,i||[t.responseText,e,t])});return this};oe.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){oe.fn[e]=function(t){return this.on(e,t)}});oe.expr.filters.animated=function(t){return oe.grep(oe.timers,function(e){return t===e.elem}).length};var or=e.document.documentElement;oe.offset={setOffset:function(t,e,n){var r,i,o,a,s,l,u,c=oe.css(t,"position"),f=oe(t),h={};"static"===c&&(t.style.position="relative");s=f.offset();o=oe.css(t,"top");l=oe.css(t,"left");u=("absolute"===c||"fixed"===c)&&oe.inArray("auto",[o,l])>-1;if(u){r=f.position();a=r.top;i=r.left}else{a=parseFloat(o)||0;i=parseFloat(l)||0}oe.isFunction(e)&&(e=e.call(t,n,s));null!=e.top&&(h.top=e.top-s.top+a);null!=e.left&&(h.left=e.left-s.left+i);"using"in e?e.using.call(t,h):f.css(h)}};oe.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){oe.offset.setOffset(this,t,e)});var e,n,r={top:0,left:0},i=this[0],o=i&&i.ownerDocument;if(o){e=o.documentElement;if(!oe.contains(e,i))return r;typeof i.getBoundingClientRect!==Te&&(r=i.getBoundingClientRect());n=$(o);return{top:r.top+(n.pageYOffset||e.scrollTop)-(e.clientTop||0),left:r.left+(n.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}}},position:function(){if(this[0]){var t,e,n={top:0,left:0},r=this[0];if("fixed"===oe.css(r,"position"))e=r.getBoundingClientRect();else{t=this.offsetParent();e=this.offset();oe.nodeName(t[0],"html")||(n=t.offset());n.top+=oe.css(t[0],"borderTopWidth",!0);n.left+=oe.css(t[0],"borderLeftWidth",!0)}return{top:e.top-n.top-oe.css(r,"marginTop",!0),left:e.left-n.left-oe.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||or;t&&!oe.nodeName(t,"html")&&"static"===oe.css(t,"position");)t=t.offsetParent;return t||or})}});oe.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var n=/Y/.test(e);oe.fn[t]=function(r){return Ae(this,function(t,r,i){var o=$(t);if(void 0===i)return o?e in o?o[e]:o.document.documentElement[r]:t[r];o?o.scrollTo(n?oe(o).scrollLeft():i,n?i:oe(o).scrollTop()):t[r]=i;return void 0},t,r,arguments.length,null)}});oe.each(["top","left"],function(t,e){oe.cssHooks[e]=M(re.pixelPosition,function(t,n){if(n){n=nn(t,e);return on.test(n)?oe(t).position()[e]+"px":n}})});oe.each({Height:"height",Width:"width"},function(t,e){oe.each({padding:"inner"+t,content:e,"":"outer"+t},function(n,r){oe.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||i===!0?"margin":"border");return Ae(this,function(e,n,r){var i;if(oe.isWindow(e))return e.document.documentElement["client"+t];if(9===e.nodeType){i=e.documentElement;return Math.max(e.body["scroll"+t],i["scroll"+t],e.body["offset"+t],i["offset"+t],i["client"+t])}return void 0===r?oe.css(e,n,a):oe.style(e,n,r,a)},e,o?r:void 0,o,null)}})});oe.fn.size=function(){return this.length};oe.fn.andSelf=oe.fn.addBack;"function"==typeof t&&t.amd&&t("jquery",[],function(){return oe});var ar=e.jQuery,sr=e.$;oe.noConflict=function(t){e.$===oe&&(e.$=sr);t&&e.jQuery===oe&&(e.jQuery=ar);return oe};typeof n===Te&&(e.jQuery=e.$=oe);return oe})},{}],20:[function(e,n,r){(function(){var i;i=function(i){return"object"==typeof r&&"object"==typeof n?i(e("jquery")):"function"==typeof t&&t.amd?t(["jquery"],i):i(jQuery)};i(function(t){return t.pivotUtilities.d3_renderers={Treemap:function(e,n){var r,i,o,a,s,l,u,c,f,h,d,p,g,m;o={localeStrings:{}};n=t.extend(o,n);l=t("<div style='width: 100%; height: 100%;'>");c={name:"All",children:[]};r=function(t,e,n){var i,o,a,s,l,u;if(0!==e.length){null==t.children&&(t.children=[]);a=e.shift();u=t.children;for(s=0,l=u.length;l>s;s++){i=u[s];if(i.name===a){r(i,e,n);return}}o={name:a};r(o,e,n);return t.children.push(o)}t.value=n};m=e.getRowKeys();for(p=0,g=m.length;g>p;p++){u=m[p];h=e.getAggregator(u,[]).value();null!=h&&r(c,u,h)}i=d3.scale.category10();d=t(window).width()/1.4;a=t(window).height()/1.4;s=10;f=d3.layout.treemap().size([d,a]).sticky(!0).value(function(t){return t.size});d3.select(l[0]).append("div").style("position","relative").style("width",d+2*s+"px").style("height",a+2*s+"px").style("left",s+"px").style("top",s+"px").datum(c).selectAll(".node").data(f.padding([15,0,0,0]).value(function(t){return t.value}).nodes).enter().append("div").attr("class","node").style("background",function(t){return null!=t.children?"lightgrey":i(t.name)}).text(function(t){return t.name}).call(function(){this.style("left",function(t){return t.x+"px"}).style("top",function(t){return t.y+"px"}).style("width",function(t){return Math.max(0,t.dx-1)+"px"}).style("height",function(t){return Math.max(0,t.dy-1)+"px"})});return l}}})}).call(this)},{jquery:19}],21:[function(e,n,r){(function(){var i;i=function(i){return"object"==typeof r&&"object"==typeof n?i(e("jquery")):"function"==typeof t&&t.amd?t(["jquery"],i):i(jQuery)};i(function(t){var e;e=function(e,n){return function(r,i){var o,a,s,l,u,c,f,h,d,p,g,m,v,y,b,x,w,C,S,T,k,_,M,D,L;c={localeStrings:{vs:"vs",by:"by"}};i=t.extend(c,i);w=r.getRowKeys();0===w.length&&w.push([]);s=r.getColKeys();0===s.length&&s.push([]);p=function(){var t,e,n;n=[];for(t=0,e=w.length;e>t;t++){h=w[t];n.push(h.join("-"))}return n}();p.unshift("");m=0;l=[p];for(_=0,D=s.length;D>_;_++){a=s[_];b=[a.join("-")];m+=b[0].length;for(M=0,L=w.length;L>M;M++){x=w[M];o=r.getAggregator(x,a);b.push(null!=o.value()?o.value():null)}l.push(b)}C=T=r.aggregatorName+(r.valAttrs.length?"("+r.valAttrs.join(", ")+")":"");d=r.colAttrs.join("-");""!==d&&(C+=" "+i.localeStrings.vs+" "+d);f=r.rowAttrs.join("-");""!==f&&(C+=" "+i.localeStrings.by+" "+f);v={width:t(window).width()/1.4,height:t(window).height()/1.4,title:C,hAxis:{title:d,slantedText:m>50},vAxis:{title:T}};2===l[0].length&&""===l[0][1]&&(v.legend={position:"none"});for(g in n){S=n[g];v[g]=S}u=google.visualization.arrayToDataTable(l);y=t("<div style='width: 100%; height: 100%;'>");k=new google.visualization.ChartWrapper({dataTable:u,chartType:e,options:v});k.draw(y[0]);y.bind("dblclick",function(){var t;t=new google.visualization.ChartEditor;google.visualization.events.addListener(t,"ok",function(){return t.getChartWrapper().draw(y[0])});return t.openDialog(k)});return y}};return t.pivotUtilities.gchart_renderers={"Line Chart":e("LineChart"),"Bar Chart":e("ColumnChart"),"Stacked Bar Chart":e("ColumnChart",{isStacked:!0}),"Area Chart":e("AreaChart",{isStacked:!0})}})}).call(this)},{jquery:19}],22:[function(e,n,r){(function(){var i,o=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},a=[].slice,s=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;i=function(i){return"object"==typeof r&&"object"==typeof n?i(e("jquery")):"function"==typeof t&&t.amd?t(["jquery"],i):i(jQuery)};i(function(t){var e,n,r,i,u,c,f,h,d,p,g,m,v,y,b,x;n=function(t,e,n){var r,i,o,a;t+="";i=t.split(".");o=i[0];a=i.length>1?n+i[1]:"";r=/(\d+)(\d{3})/;for(;r.test(o);)o=o.replace(r,"$1"+e+"$2");return o+a};p=function(e){var r;r={digitsAfterDecimal:2,scaler:1,thousandsSep:",",decimalSep:".",prefix:"",suffix:"",showZero:!1};e=t.extend(r,e);return function(t){var r;if(isNaN(t)||!isFinite(t))return"";if(0===t&&!e.showZero)return"";r=n((e.scaler*t).toFixed(e.digitsAfterDecimal),e.thousandsSep,e.decimalSep);return""+e.prefix+r+e.suffix}};v=p();y=p({digitsAfterDecimal:0});b=p({digitsAfterDecimal:1,scaler:100,suffix:"%"});r={count:function(t){null==t&&(t=y);return function(){return function(){return{count:0,push:function(){return this.count++},value:function(){return this.count},format:t}}}},countUnique:function(t){null==t&&(t=y);return function(e){var n;n=e[0];return function(){return{uniq:[],push:function(t){var e;return e=t[n],o.call(this.uniq,e)<0?this.uniq.push(t[n]):void 0},value:function(){return this.uniq.length},format:t,numInputs:null!=n?0:1}}}},listUnique:function(t){return function(e){var n;n=e[0];return function(){return{uniq:[],push:function(t){var e;return e=t[n],o.call(this.uniq,e)<0?this.uniq.push(t[n]):void 0},value:function(){return this.uniq.join(t)},format:function(t){return t},numInputs:null!=n?0:1}}}},sum:function(t){null==t&&(t=v);return function(e){var n;n=e[0];return function(){return{sum:0,push:function(t){return isNaN(parseFloat(t[n]))?void 0:this.sum+=parseFloat(t[n])},value:function(){return this.sum},format:t,numInputs:null!=n?0:1}}}},average:function(t){null==t&&(t=v);return function(e){var n;n=e[0];return function(){return{sum:0,len:0,push:function(t){if(!isNaN(parseFloat(t[n]))){this.sum+=parseFloat(t[n]);return this.len++}},value:function(){return this.sum/this.len},format:t,numInputs:null!=n?0:1}}}},sumOverSum:function(t){null==t&&(t=v);return function(e){var n,r;r=e[0],n=e[1];return function(){return{sumNum:0,sumDenom:0,push:function(t){isNaN(parseFloat(t[r]))||(this.sumNum+=parseFloat(t[r]));return isNaN(parseFloat(t[n]))?void 0:this.sumDenom+=parseFloat(t[n])},value:function(){return this.sumNum/this.sumDenom},format:t,numInputs:null!=r&&null!=n?0:2}}}},sumOverSumBound80:function(t,e){null==t&&(t=!0);null==e&&(e=v);return function(n){var r,i;i=n[0],r=n[1];return function(){return{sumNum:0,sumDenom:0,push:function(t){isNaN(parseFloat(t[i]))||(this.sumNum+=parseFloat(t[i]));return isNaN(parseFloat(t[r]))?void 0:this.sumDenom+=parseFloat(t[r])},value:function(){var e;e=t?1:-1;return(.821187207574908/this.sumDenom+this.sumNum/this.sumDenom+1.2815515655446004*e*Math.sqrt(.410593603787454/(this.sumDenom*this.sumDenom)+this.sumNum*(1-this.sumNum/this.sumDenom)/(this.sumDenom*this.sumDenom)))/(1+1.642374415149816/this.sumDenom)},format:e,numInputs:null!=i&&null!=r?0:2}}}},fractionOf:function(t,e,n){null==e&&(e="total");null==n&&(n=b);return function(){var r;r=1<=arguments.length?a.call(arguments,0):[];return function(i,o,a){return{selector:{total:[[],[]],row:[o,[]],col:[[],a]}[e],inner:t.apply(null,r)(i,o,a),push:function(t){return this.inner.push(t)},format:n,value:function(){return this.inner.value()/i.getAggregator.apply(i,this.selector).inner.value()},numInputs:t.apply(null,r)().numInputs}}}}};i=function(t){return{Count:t.count(y),"Count Unique Values":t.countUnique(y),"List Unique Values":t.listUnique(", "),Sum:t.sum(v),"Integer Sum":t.sum(y),Average:t.average(v),"Sum over Sum":t.sumOverSum(v),"80% Upper Bound":t.sumOverSumBound80(!0,v),"80% Lower Bound":t.sumOverSumBound80(!1,v),"Sum as Fraction of Total":t.fractionOf(t.sum(),"total",b),"Sum as Fraction of Rows":t.fractionOf(t.sum(),"row",b),"Sum as Fraction of Columns":t.fractionOf(t.sum(),"col",b),"Count as Fraction of Total":t.fractionOf(t.count(),"total",b),"Count as Fraction of Rows":t.fractionOf(t.count(),"row",b),"Count as Fraction of Columns":t.fractionOf(t.count(),"col",b)}}(r);m={Table:function(t,e){return g(t,e)},"Table Barchart":function(e,n){return t(g(e,n)).barchart()},Heatmap:function(e,n){return t(g(e,n)).heatmap()},"Row Heatmap":function(e,n){return t(g(e,n)).heatmap("rowheatmap")},"Col Heatmap":function(e,n){return t(g(e,n)).heatmap("colheatmap")}};f={en:{aggregators:i,renderers:m,localeStrings:{renderError:"An error occurred rendering the PivotTable results.",computeError:"An error occurred computing the PivotTable results.",uiRenderError:"An error occurred rendering the PivotTable UI.",selectAll:"Select All",selectNone:"Select None",tooMany:"(too many to list)",filterResults:"Filter results",totals:"Totals",vs:"vs",by:"by"}}};h=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];u=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];x=function(t){return("0"+t).substr(-2,2)};c={bin:function(t,e){return function(n){return n[t]-n[t]%e}},dateFormat:function(t,e,n,r){null==n&&(n=h);null==r&&(r=u);return function(i){var o;o=new Date(Date.parse(i[t]));return isNaN(o)?"":e.replace(/%(.)/g,function(t,e){switch(e){case"y":return o.getFullYear();case"m":return x(o.getMonth()+1);case"n":return n[o.getMonth()];case"d":return x(o.getDate());case"w":return r[o.getDay()];case"x":return o.getDay();case"H":return x(o.getHours());case"M":return x(o.getMinutes());case"S":return x(o.getSeconds());default:return"%"+e}})}}};d=function(){return function(t,e){var n,r,i,o,a,s,l;s=/(\d+)|(\D+)/g;a=/\d/;l=/^0/;if("number"==typeof t||"number"==typeof e)return isNaN(t)?1:isNaN(e)?-1:t-e;n=String(t).toLowerCase();i=String(e).toLowerCase();if(n===i)return 0;if(!a.test(n)||!a.test(i))return n>i?1:-1;n=n.match(s);i=i.match(s);for(;n.length&&i.length;){r=n.shift();o=i.shift();if(r!==o)return a.test(r)&&a.test(o)?r.replace(l,".0")-o.replace(l,".0"):r>o?1:-1}return n.length-i.length}}(this);t.pivotUtilities={aggregatorTemplates:r,aggregators:i,renderers:m,derivers:c,locales:f,naturalSort:d,numberFormat:p};e=function(){function e(t,n){this.getAggregator=s(this.getAggregator,this);this.getRowKeys=s(this.getRowKeys,this);this.getColKeys=s(this.getColKeys,this);this.sortKeys=s(this.sortKeys,this);this.arrSort=s(this.arrSort,this);this.natSort=s(this.natSort,this);this.aggregator=n.aggregator;this.aggregatorName=n.aggregatorName;this.colAttrs=n.cols;this.rowAttrs=n.rows;this.valAttrs=n.vals;this.tree={};this.rowKeys=[];this.colKeys=[];this.rowTotals={};this.colTotals={};this.allTotal=this.aggregator(this,[],[]);this.sorted=!1;e.forEachRecord(t,n.derivedAttributes,function(t){return function(e){return n.filter(e)?t.processRecord(e):void 0}}(this))}e.forEachRecord=function(e,n,r){var i,o,a,s,u,c,f,h,d,p,g,m;i=t.isEmptyObject(n)?r:function(t){var e,i,o;for(e in n){i=n[e];t[e]=null!=(o=i(t))?o:t[e]}return r(t)};if(t.isFunction(e))return e(i);if(t.isArray(e)){if(t.isArray(e[0])){g=[];for(a in e)if(l.call(e,a)){o=e[a];if(a>0){c={};p=e[0];for(s in p)if(l.call(p,s)){u=p[s];c[u]=o[s]}g.push(i(c))}}return g}m=[];for(h=0,d=e.length;d>h;h++){c=e[h];m.push(i(c))}return m}if(e instanceof jQuery){f=[];t("thead > tr > th",e).each(function(){return f.push(t(this).text())});return t("tbody > tr",e).each(function(){c={};t("td",this).each(function(e){return c[f[e]]=t(this).text()});return i(c)})}throw new Error("unknown input format")};e.convertToArray=function(t){var n;n=[];e.forEachRecord(t,{},function(t){return n.push(t)});return n};e.prototype.natSort=function(t,e){return d(t,e)};e.prototype.arrSort=function(t,e){return this.natSort(t.join(),e.join())};e.prototype.sortKeys=function(){if(!this.sorted){this.rowKeys.sort(this.arrSort);this.colKeys.sort(this.arrSort)}return this.sorted=!0};e.prototype.getColKeys=function(){this.sortKeys();return this.colKeys};e.prototype.getRowKeys=function(){this.sortKeys();return this.rowKeys};e.prototype.processRecord=function(t){var e,n,r,i,o,a,s,l,u,c,f,h,d;e=[];i=[];c=this.colAttrs;for(a=0,l=c.length;l>a;a++){o=c[a];e.push(null!=(f=t[o])?f:"null")}h=this.rowAttrs;for(s=0,u=h.length;u>s;s++){o=h[s];i.push(null!=(d=t[o])?d:"null")}r=i.join(String.fromCharCode(0));n=e.join(String.fromCharCode(0));this.allTotal.push(t);if(0!==i.length){if(!this.rowTotals[r]){this.rowKeys.push(i);this.rowTotals[r]=this.aggregator(this,i,[])}this.rowTotals[r].push(t)}if(0!==e.length){if(!this.colTotals[n]){this.colKeys.push(e);this.colTotals[n]=this.aggregator(this,[],e)}this.colTotals[n].push(t)}if(0!==e.length&&0!==i.length){this.tree[r]||(this.tree[r]={});this.tree[r][n]||(this.tree[r][n]=this.aggregator(this,i,e));return this.tree[r][n].push(t)}};e.prototype.getAggregator=function(t,e){var n,r,i;i=t.join(String.fromCharCode(0));r=e.join(String.fromCharCode(0));n=0===t.length&&0===e.length?this.allTotal:0===t.length?this.colTotals[r]:0===e.length?this.rowTotals[i]:this.tree[i][r];return null!=n?n:{value:function(){return null},format:function(){return""}}};return e}();g=function(e,n){var r,i,o,a,s,u,c,f,h,d,p,g,m,v,y,b,x,w,C,S,T;u={localeStrings:{totals:"Totals"}};n=t.extend(u,n);o=e.colAttrs;p=e.rowAttrs;m=e.getRowKeys();s=e.getColKeys();d=document.createElement("table");d.className="pvtTable";v=function(t,e,n){var r,i,o,a,s,l;if(0!==e){i=!0;for(a=s=0;n>=0?n>=s:s>=n;a=n>=0?++s:--s)t[e-1][a]!==t[e][a]&&(i=!1);if(i)return-1}r=0;for(;e+r<t.length;){o=!1;for(a=l=0;n>=0?n>=l:l>=n;a=n>=0?++l:--l)t[e][a]!==t[e+r][a]&&(o=!0);if(o)break;r++}return r};for(f in o)if(l.call(o,f)){i=o[f];w=document.createElement("tr");if(0===parseInt(f)&&0!==p.length){b=document.createElement("th");b.setAttribute("colspan",p.length);b.setAttribute("rowspan",o.length);w.appendChild(b)}b=document.createElement("th");b.className="pvtAxisLabel";b.textContent=i;w.appendChild(b);for(c in s)if(l.call(s,c)){a=s[c];T=v(s,parseInt(c),parseInt(f));if(-1!==T){b=document.createElement("th");b.className="pvtColLabel";b.textContent=a[f];b.setAttribute("colspan",T);parseInt(f)===o.length-1&&0!==p.length&&b.setAttribute("rowspan",2);w.appendChild(b)}}if(0===parseInt(f)){b=document.createElement("th");b.className="pvtTotalLabel";b.innerHTML=n.localeStrings.totals;b.setAttribute("rowspan",o.length+(0===p.length?0:1));w.appendChild(b)}d.appendChild(w)}if(0!==p.length){w=document.createElement("tr");for(c in p)if(l.call(p,c)){h=p[c];b=document.createElement("th");b.className="pvtAxisLabel";b.textContent=h;w.appendChild(b)}b=document.createElement("th");if(0===o.length){b.className="pvtTotalLabel";b.innerHTML=n.localeStrings.totals}w.appendChild(b);d.appendChild(w)}for(c in m)if(l.call(m,c)){g=m[c];w=document.createElement("tr");for(f in g)if(l.call(g,f)){C=g[f];T=v(m,parseInt(c),parseInt(f));if(-1!==T){b=document.createElement("th");b.className="pvtRowLabel";b.textContent=C;b.setAttribute("rowspan",T);parseInt(f)===p.length-1&&0!==o.length&&b.setAttribute("colspan",2);w.appendChild(b)}}for(f in s)if(l.call(s,f)){a=s[f];r=e.getAggregator(g,a);S=r.value();y=document.createElement("td");y.className="pvtVal row"+c+" col"+f;y.innerHTML=r.format(S);y.setAttribute("data-value",S);w.appendChild(y)}x=e.getAggregator(g,[]);S=x.value();y=document.createElement("td");y.className="pvtTotal rowTotal";y.innerHTML=x.format(S);y.setAttribute("data-value",S);y.setAttribute("data-for","row"+c);w.appendChild(y);d.appendChild(w)}w=document.createElement("tr");b=document.createElement("th");b.className="pvtTotalLabel";b.innerHTML=n.localeStrings.totals;b.setAttribute("colspan",p.length+(0===o.length?0:1));w.appendChild(b);for(f in s)if(l.call(s,f)){a=s[f];x=e.getAggregator([],a);S=x.value();y=document.createElement("td");y.className="pvtTotal colTotal";y.innerHTML=x.format(S);y.setAttribute("data-value",S);y.setAttribute("data-for","col"+f);w.appendChild(y)}x=e.getAggregator([],[]);S=x.value();y=document.createElement("td");y.className="pvtGrandTotal";y.innerHTML=x.format(S);y.setAttribute("data-value",S);w.appendChild(y);d.appendChild(w);d.setAttribute("data-numrows",m.length);d.setAttribute("data-numcols",s.length);return d};t.fn.pivot=function(n,i){var o,a,s,l,u;o={cols:[],rows:[],filter:function(){return!0},aggregator:r.count()(),aggregatorName:"Count",derivedAttributes:{},renderer:g,rendererOptions:null,localeStrings:f.en.localeStrings};i=t.extend(o,i);l=null;try{s=new e(n,i);try{l=i.renderer(s,i.rendererOptions)}catch(c){a=c;"undefined"!=typeof console&&null!==console&&console.error(a.stack);l=t("<span>").html(i.localeStrings.renderError)}}catch(c){a=c;"undefined"!=typeof console&&null!==console&&console.error(a.stack);l=t("<span>").html(i.localeStrings.computeError)}u=this[0];for(;u.hasChildNodes();)u.removeChild(u.lastChild);return this.append(l)};t.fn.pivotUI=function(n,r,i,a){var s,u,c,h,p,g,m,v,y,b,x,w,C,S,T,k,_,M,D,L,A,N,E,j,P,I,H,O,R,F,W,z,q,U,B,V,X,G,$;null==i&&(i=!1);null==a&&(a="en");m={derivedAttributes:{},aggregators:f[a].aggregators,renderers:f[a].renderers,hiddenAttributes:[],menuLimit:200,cols:[],rows:[],vals:[],exclusions:{},unusedAttrsVertical:"auto",autoSortUnusedAttrs:!1,rendererOptions:{localeStrings:f[a].localeStrings},onRefresh:null,filter:function(){return!0},localeStrings:f[a].localeStrings};y=this.data("pivotUIOptions");C=null==y||i?t.extend(m,r):y;try{n=e.convertToArray(n);L=function(){var t,e;t=n[0];e=[];for(w in t)l.call(t,w)&&e.push(w);return e}();B=C.derivedAttributes;for(p in B)l.call(B,p)&&o.call(L,p)<0&&L.push(p);h={};for(H=0,W=L.length;W>H;H++){P=L[H];h[P]={}}e.forEachRecord(n,C.derivedAttributes,function(t){var e,n,r;r=[];for(w in t)if(l.call(t,w)){e=t[w];if(C.filter(t)){null==e&&(e="null");null==(n=h[w])[e]&&(n[e]=0);r.push(h[w][e]++)}}return r});E=t("<table cellpadding='5'>");M=t("<td>");_=t("<select class='pvtRenderer'>").appendTo(M).bind("change",function(){return T()});V=C.renderers;for(P in V)l.call(V,P)&&t("<option>").val(P).html(P).appendTo(_);g=t("<td class='pvtAxisContainer pvtUnused'>");D=function(){var t,e,n;n=[];for(t=0,e=L.length;e>t;t++){p=L[t];o.call(C.hiddenAttributes,p)<0&&n.push(p)}return n}();j=!1;if("auto"===C.unusedAttrsVertical){c=0;for(O=0,z=D.length;z>O;O++){s=D[O];c+=s.length}j=c>120}g.addClass(C.unusedAttrsVertical===!0||j?"pvtVertList":"pvtHorizList");I=function(e){var n,r,i,a,s,l,u,c,f,p,m,v,y,x,S;u=function(){var t;t=[];for(w in h[e])t.push(w);return t}();l=!1;v=t("<div>").addClass("pvtFilterBox").hide();v.append(t("<h4>").text(""+e+" ("+u.length+")"));if(u.length>C.menuLimit)v.append(t("<p>").html(C.localeStrings.tooMany));else{r=t("<p>").appendTo(v);r.append(t("<button>").html(C.localeStrings.selectAll).bind("click",function(){return v.find("input:visible").prop("checked",!0)}));r.append(t("<button>").html(C.localeStrings.selectNone).bind("click",function(){return v.find("input:visible").prop("checked",!1)}));r.append(t("<input>").addClass("pvtSearch").attr("placeholder",C.localeStrings.filterResults).bind("keyup",function(){var e;e=t(this).val().toLowerCase();return t(this).parents(".pvtFilterBox").find("label span").each(function(){var n;n=t(this).text().toLowerCase().indexOf(e);return-1!==n?t(this).parent().show():t(this).parent().hide()})}));i=t("<div>").addClass("pvtCheckContainer").appendTo(v);S=u.sort(d);for(y=0,x=S.length;x>y;y++){w=S[y];m=h[e][w];a=t("<label>");s=C.exclusions[e]?o.call(C.exclusions[e],w)>=0:!1;l||(l=s);t("<input type='checkbox' class='pvtFilter'>").attr("checked",!s).data("filter",[e,w]).appendTo(a);a.append(t("<span>").text(""+w+" ("+m+")"));i.append(t("<p>").append(a))}}p=function(){var e;e=t(v).find("[type='checkbox']").length-t(v).find("[type='checkbox']:checked").length;e>0?n.addClass("pvtFilteredAttribute"):n.removeClass("pvtFilteredAttribute");return u.length>C.menuLimit?v.toggle():v.toggle(0,T)};t("<p>").appendTo(v).append(t("<button>").text("OK").bind("click",p));c=function(e){v.css({left:e.pageX,top:e.pageY}).toggle();t(".pvtSearch").val("");return t("label").show()};f=t("<span class='pvtTriangle'>").html(" ▾").bind("click",c);n=t("<li class='axis_"+b+"'>").append(t("<span class='pvtAttr'>").text(e).data("attrName",e).append(f));l&&n.addClass("pvtFilteredAttribute");g.append(n).append(v);return n.bind("dblclick",c)};for(b in D){p=D[b];I(p)}A=t("<tr>").appendTo(E);u=t("<select class='pvtAggregator'>").bind("change",function(){return T()});X=C.aggregators;for(P in X)l.call(X,P)&&u.append(t("<option>").val(P).html(P));t("<td class='pvtVals'>").appendTo(A).append(u).append(t("<br>"));t("<td class='pvtAxisContainer pvtHorizList pvtCols'>").appendTo(A);N=t("<tr>").appendTo(E);N.append(t("<td valign='top' class='pvtAxisContainer pvtRows'>"));S=t("<td valign='top' class='pvtRendererArea'>").appendTo(N);if(C.unusedAttrsVertical===!0||j){E.find("tr:nth-child(1)").prepend(M);E.find("tr:nth-child(2)").prepend(g)}else E.prepend(t("<tr>").append(M).append(g));this.html(E);G=C.cols;for(R=0,q=G.length;q>R;R++){P=G[R];this.find(".pvtCols").append(this.find(".axis_"+D.indexOf(P)))}$=C.rows;for(F=0,U=$.length;U>F;F++){P=$[F];this.find(".pvtRows").append(this.find(".axis_"+D.indexOf(P)))}null!=C.aggregatorName&&this.find(".pvtAggregator").val(C.aggregatorName);null!=C.rendererName&&this.find(".pvtRenderer").val(C.rendererName);x=!0;k=function(e){return function(){var r,i,a,s,l,c,f,h,d,p,g,m,v,y;h={derivedAttributes:C.derivedAttributes,localeStrings:C.localeStrings,rendererOptions:C.rendererOptions,cols:[],rows:[]};l=null!=(y=C.aggregators[u.val()]([])().numInputs)?y:0;p=[];e.find(".pvtRows li span.pvtAttr").each(function(){return h.rows.push(t(this).data("attrName"))});e.find(".pvtCols li span.pvtAttr").each(function(){return h.cols.push(t(this).data("attrName"))});e.find(".pvtVals select.pvtAttrDropdown").each(function(){if(0===l)return t(this).remove();l--;return""!==t(this).val()?p.push(t(this).val()):void 0});if(0!==l){f=e.find(".pvtVals");for(P=m=0;l>=0?l>m:m>l;P=l>=0?++m:--m){s=t("<select class='pvtAttrDropdown'>").append(t("<option>")).bind("change",function(){return T()});for(v=0,g=D.length;g>v;v++){r=D[v];s.append(t("<option>").val(r).text(r))}f.append(s)}}if(x){p=C.vals;b=0;e.find(".pvtVals select.pvtAttrDropdown").each(function(){t(this).val(p[b]);return b++});x=!1}h.aggregatorName=u.val();h.vals=p;h.aggregator=C.aggregators[u.val()](p);h.renderer=C.renderers[_.val()];i={};e.find("input.pvtFilter").not(":checked").each(function(){var e;e=t(this).data("filter");return null!=i[e[0]]?i[e[0]].push(e[1]):i[e[0]]=[e[1]]});h.filter=function(t){var e,n;if(!C.filter(t))return!1;for(w in i){e=i[w];if(n=""+t[w],o.call(e,n)>=0)return!1}return!0};S.pivot(n,h);c=t.extend(C,{cols:h.cols,rows:h.rows,vals:p,exclusions:i,aggregatorName:u.val(),rendererName:_.val()});e.data("pivotUIOptions",c);if(C.autoSortUnusedAttrs){a=t.pivotUtilities.naturalSort;d=e.find("td.pvtUnused.pvtAxisContainer");t(d).children("li").sort(function(e,n){return a(t(e).text(),t(n).text())}).appendTo(d)}S.css("opacity",1);return null!=C.onRefresh?C.onRefresh(c):void 0}}(this);T=function(){return function(){S.css("opacity",.5);return setTimeout(k,10)}}(this);T();this.find(".pvtAxisContainer").sortable({update:function(t,e){return null==e.sender?T():void 0},connectWith:this.find(".pvtAxisContainer"),items:"li",placeholder:"pvtPlaceholder"})}catch(Y){v=Y;"undefined"!=typeof console&&null!==console&&console.error(v.stack);this.html(C.localeStrings.uiRenderError)}return this};t.fn.heatmap=function(e){var n,r,i,o,a,s,l,u;null==e&&(e="heatmap");s=this.data("numrows");a=this.data("numcols");n=function(t,e,n){var r;r=function(){switch(t){case"red":return function(t){return"ff"+t+t};case"green":return function(t){return""+t+"ff"+t};case"blue":return function(t){return""+t+t+"ff"}}}();return function(t){var i,o;o=255-Math.round(255*(t-e)/(n-e));i=o.toString(16).split(".")[0];1===i.length&&(i=0+i);return r(i)}};r=function(e){return function(r,i){var o,a,s;a=function(n){return e.find(r).each(function(){var e;e=t(this).data("value");return null!=e&&isFinite(e)?n(e,t(this)):void 0})};s=[];a(function(t){return s.push(t)});o=n(i,Math.min.apply(Math,s),Math.max.apply(Math,s));return a(function(t,e){return e.css("background-color","#"+o(t))})}}(this);switch(e){case"heatmap":r(".pvtVal","red");break;case"rowheatmap":for(i=l=0;s>=0?s>l:l>s;i=s>=0?++l:--l)r(".pvtVal.row"+i,"red");break;case"colheatmap":for(o=u=0;a>=0?a>u:u>a;o=a>=0?++u:--u)r(".pvtVal.col"+o,"red")}r(".pvtTotal.rowTotal","red");r(".pvtTotal.colTotal","red");return this};return t.fn.barchart=function(){var e,n,r,i,o;i=this.data("numrows");r=this.data("numcols");e=function(e){return function(n){var r,i,o,a;r=function(r){return e.find(n).each(function(){var e;e=t(this).data("value");return null!=e&&isFinite(e)?r(e,t(this)):void 0})};a=[];r(function(t){return a.push(t)});i=Math.max.apply(Math,a);o=function(t){return 100*t/(1.4*i)};return r(function(e,n){var r,i;r=n.text();i=t("<div>").css({position:"relative",height:"55px"});i.append(t("<div>").css({position:"absolute",bottom:0,left:0,right:0,height:o(e)+"%","background-color":"gray"}));i.append(t("<div>").text(r).css({position:"relative","padding-left":"5px","padding-right":"5px"}));return n.css({padding:0,"padding-top":"5px","text-align":"center"}).html(i)})}}(this);for(n=o=0;i>=0?i>o:o>i;n=i>=0?++o:--o)e(".pvtVal.row"+n);e(".pvtTotal.colTotal");return this}})}).call(this)},{jquery:19}],23:[function(e,n){(function(e){function r(){try{return l in e&&e[l]}catch(t){return!1}}function i(t){return t.replace(/^d/,"___$&").replace(p,"___")}var o,a={},s=e.document,l="localStorage",u="script";a.disabled=!1;a.version="1.3.17";a.set=function(){};a.get=function(){};a.has=function(t){return void 0!==a.get(t)};a.remove=function(){};a.clear=function(){};a.transact=function(t,e,n){if(null==n){n=e;e=null}null==e&&(e={});var r=a.get(t,e);n(r);a.set(t,r)};a.getAll=function(){};a.forEach=function(){};a.serialize=function(t){return JSON.stringify(t)};a.deserialize=function(t){if("string"!=typeof t)return void 0;try{return JSON.parse(t)}catch(e){return t||void 0}};if(r()){o=e[l];a.set=function(t,e){if(void 0===e)return a.remove(t);o.setItem(t,a.serialize(e));return e};a.get=function(t,e){var n=a.deserialize(o.getItem(t));return void 0===n?e:n};a.remove=function(t){o.removeItem(t)};a.clear=function(){o.clear()};a.getAll=function(){var t={};a.forEach(function(e,n){t[e]=n});return t};a.forEach=function(t){for(var e=0;e<o.length;e++){var n=o.key(e);t(n,a.get(n))}}}else if(s.documentElement.addBehavior){var c,f;try{f=new ActiveXObject("htmlfile");f.open();f.write("<"+u+">document.w=window</"+u+'><iframe src="/favicon.ico"></iframe>');f.close();c=f.w.frames[0].document;o=c.createElement("div")}catch(h){o=s.createElement("div");c=s.body}var d=function(t){return function(){var e=Array.prototype.slice.call(arguments,0);e.unshift(o);c.appendChild(o);o.addBehavior("#default#userData");o.load(l);var n=t.apply(a,e);c.removeChild(o);return n}},p=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");a.set=d(function(t,e,n){e=i(e);if(void 0===n)return a.remove(e);t.setAttribute(e,a.serialize(n));t.save(l);return n});a.get=d(function(t,e,n){e=i(e);var r=a.deserialize(t.getAttribute(e));return void 0===r?n:r});a.remove=d(function(t,e){e=i(e);t.removeAttribute(e);t.save(l)});a.clear=d(function(t){var e=t.XMLDocument.documentElement.attributes;t.load(l);for(var n,r=0;n=e[r];r++)t.removeAttribute(n.name);t.save(l)});a.getAll=function(){var t={};a.forEach(function(e,n){t[e]=n});return t};a.forEach=d(function(t,e){for(var n,r=t.XMLDocument.documentElement.attributes,i=0;n=r[i];++i)e(n.name,a.deserialize(t.getAttribute(n.name)))
})}try{var g="__storejs__";a.set(g,g);a.get(g)!=g&&(a.disabled=!0);a.remove(g)}catch(h){a.disabled=!0}a.enabled=!a.disabled;"undefined"!=typeof n&&n.exports&&this.module!==n?n.exports=a:"function"==typeof t&&t.amd?t(a):e.store=a})(Function("return this")())},{}],24:[function(t,e){e.exports={name:"yasgui-utils",version:"1.6.0",description:"Utils for YASGUI libs",main:"src/main.js",repository:{type:"git",url:"git://github.com/YASGUI/Utils.git"},licenses:[{type:"MIT",url:"http://yasgui.github.io/license.txt"}],author:"Laurens Rietveld",maintainers:[{name:"Laurens Rietveld",email:"laurens.rietveld@gmail.com",web:"http://laurensrietveld.nl"}],bugs:{url:"https://github.com/YASGUI/Utils/issues"},homepage:"https://github.com/YASGUI/Utils",dependencies:{store:"^1.3.14"}}},{}],25:[function(t,e){window.console=window.console||{log:function(){}};e.exports={storage:t("./storage.js"),svg:t("./svg.js"),version:{"yasgui-utils":t("../package.json").version},nestedExists:function(t){for(var e=Array.prototype.slice.call(arguments,1),n=0;n<e.length;n++){if(!t||!t.hasOwnProperty(e[n]))return!1;t=t[e[n]]}return!0}}},{"../package.json":24,"./storage.js":26,"./svg.js":27}],26:[function(t,e){var n=t("store"),r={day:function(){return 864e5},month:function(){30*r.day()},year:function(){12*r.month()}},i=e.exports={set:function(t,e,i){if(n.enabled&&t&&void 0!==e){"string"==typeof i&&(i=r[i]());e.documentElement&&(e=(new XMLSerializer).serializeToString(e.documentElement));n.set(t,{val:e,exp:i,time:(new Date).getTime()})}},remove:function(t){n.enabled&&t&&n.remove(t)},removeAll:function(t){if(n.enabled&&"function"==typeof t)for(var e in n.getAll())t(e,i.get(e))&&i.remove(e)},get:function(t){if(!n.enabled)return null;if(t){var e=n.get(t);return e?e.exp&&(new Date).getTime()-e.time>e.exp?null:e.val:null}return null}}},{store:23}],27:[function(t,e){e.exports={draw:function(t,n){if(t){var r=e.exports.getElement(n);r&&(t.append?t.append(r):t.appendChild(r))}},getElement:function(t){if(t&&0==t.indexOf("<svg")){var e=new DOMParser,n=e.parseFromString(t,"text/xml"),r=n.documentElement,i=document.createElement("div");i.className="svgImg";i.appendChild(r);return i}return!1}}},{}],28:[function(t,e){e.exports={name:"yasgui-yasr",description:"Yet Another SPARQL Resultset GUI",version:"2.5.3",main:"src/main.js",licenses:[{type:"MIT",url:"http://yasr.yasgui.org/license.txt"}],author:"Laurens Rietveld",homepage:"http://yasr.yasgui.org",devDependencies:{browserify:"^6.1.0",gulp:"~3.6.0","gulp-bump":"^0.1.11","gulp-concat":"^2.4.1","gulp-connect":"^2.0.5","gulp-embedlr":"^0.5.2","gulp-filter":"^1.0.2","gulp-git":"^0.5.2","gulp-jsvalidate":"^0.2.0","gulp-livereload":"^1.3.1","gulp-minify-css":"0.3.11","gulp-notify":"^2.0.1","gulp-rename":"^1.2.0","gulp-streamify":"0.0.5","gulp-tag-version":"^1.1.0","gulp-uglify":"^1.0.1","require-dir":"^0.1.0","run-sequence":"^1.0.1","vinyl-buffer":"^1.0.0","vinyl-source-stream":"~0.1.1",watchify:"^0.6.4","gulp-sourcemaps":"^1.2.8",exorcist:"^0.1.6","vinyl-transform":"0.0.1","gulp-sass":"^1.2.2","bootstrap-sass":"^3.3.1","browserify-transform-tools":"^1.2.1","gulp-cssimport":"^1.3.1","gulp-html-replace":"^1.4.1","browserify-shim":"^3.8.1"},bugs:"https://github.com/YASGUI/YASR/issues/",keywords:["JavaScript","SPARQL","Editor","Semantic Web","Linked Data"],maintainers:[{name:"Laurens Rietveld",email:"laurens.rietveld@gmail.com",web:"http://laurensrietveld.nl"}],repository:{type:"git",url:"https://github.com/YASGUI/YASR.git"},dependencies:{jquery:"~ 1.11.0",codemirror:"^4.7.0","yasgui-utils":"^1.4.1",pivottable:"^1.2.2","jquery-ui":"^1.10.5",d3:"^3.4.13"},"browserify-shim":{google:"global:google"},browserify:{transform:["browserify-shim"]},optionalShim:{codemirror:{require:"codemirror",global:"CodeMirror"},jquery:{require:"jquery",global:"jQuery"},"../../lib/codemirror":{require:"codemirror",global:"CodeMirror"},"../lib/DataTables/media/js/jquery.dataTables.js":{require:"datatables",global:"jQuery"},datatables:{require:"datatables",global:"jQuery"},d3:{require:"d3",global:"d3"},"jquery-ui/sortable":{require:"jquery-ui/sortable",global:"jQuery"},pivottable:{require:"pivottable",global:"jQuery"}}}},{}],29:[function(t,e){"use strict";e.exports=function(t){var e='"',n=",",r="\n",i=t.head.vars,o=t.results.bindings,a=function(){for(var t=0;t<i.length;t++)u(i[t]);f+=r},s=function(){for(var t=0;t<o.length;t++){l(o[t]);f+=r}},l=function(t){for(var e=0;e<i.length;e++){var n=i[e];u(t.hasOwnProperty(n)?t[n].value:"")}},u=function(t){t.replace(e,e+e);c(t)&&(t=e+t+e);f+=" "+t+" "+n},c=function(t){var r=!1;t.match("[\\w|"+n+"|"+e+"]")&&(r=!0);return r},f="";a();s();return f}},{}],30:[function(t,e){"use strict";var n=t("jquery"),r=e.exports=function(e){var r=n("<div class='booleanResult'></div>"),i=function(){r.empty().appendTo(e.resultsContainer);var i=e.results.getBoolean(),o=null,a=null;if(i===!0){o="check";a="True"}else if(i===!1){o="cross";a="False"}else{r.width("140");a="Could not find boolean value in response"}o&&t("yasgui-utils").svg.draw(r,t("./imgs.js")[o]);n("<span></span>").text(a).appendTo(r)},o=function(){return e.results.getBoolean&&(e.results.getBoolean()===!0||0==e.results.getBoolean())};return{name:null,draw:i,hideFromSelection:!0,getPriority:10,canHandleResults:o}};r.version={"YASR-boolean":t("../package.json").version,jquery:n.fn.jquery}},{"../package.json":28,"./imgs.js":36,jquery:19,"yasgui-utils":25}],31:[function(t,e){"use strict";var n=t("jquery");e.exports={output:"table",useGoogleCharts:!0,outputPlugins:["table","error","boolean","rawResponse"],drawOutputSelector:!0,drawDownloadIcon:!0,getUsedPrefixes:null,persistency:{prefix:function(t){return"yasr_"+n(t.container).closest("[id]").attr("id")+"_"},outputSelector:function(){return"selector"},results:{id:function(t){return"results_"+n(t.container).closest("[id]").attr("id")},key:"results",maxSize:1e5}}}},{jquery:19}],32:[function(t,e){"use strict";var n=t("jquery"),r=e.exports=function(t){var e=n("<div class='errorResult'></div>"),i=n.extend(!0,{},r.defaults),o=function(){var t=null;if(i.tryQueryLink){var e=i.tryQueryLink();t=n("<button>",{"class":"yasr_btn yasr_tryQuery"}).text("Try query in new browser window").click(function(){window.open(e,"_blank");n(this).blur()})}return t},a=function(){var r=t.results.getException();e.empty().appendTo(t.resultsContainer);var a=n("<div>",{"class":"errorHeader"}).appendTo(e);if(0!==r.status){var s="Error";r.statusText&&r.statusText.length<100&&(s=r.statusText);s+=" (#"+r.status+")";a.append(n("<span>",{"class":"exception"}).text(s)).append(o());var l=null;r.responseText?l=r.responseText:"string"==typeof r&&(l=r);l&&e.append(n("<pre>").text(l))}else{a.append(o());e.append(n("<div>",{"class":"corsMessage"}).append(i.corsMessage))}},s=function(t){return t.results.getException()||!1};return{name:null,draw:a,getPriority:20,hideFromSelection:!0,canHandleResults:s}};r.defaults={corsMessage:"Unable to get response from endpoint",tryQueryLink:null}},{jquery:19}],33:[function(t,e){e.exports={GoogleTypeException:function(t,e){this.foundTypes=t;this.varName=e;this.toString=function(){var t="Conflicting data types found for variable "+this.varName+'. Assuming all values of this variable are "string".';t+=" To avoid this issue, cast the values in your SPARQL query to the intended xsd datatype";return t};this.toHtml=function(){var t="Conflicting data types found for variable <i>"+this.varName+'</i>. Assuming all values of this variable are "string".';t+=" As a result, several Google Charts will not render values of this particular variable.";t+=" To avoid this issue, cast the values in your SPARQL query to the intended xsd datatype";return t}}}},{}],34:[function(t,e){(function(n){var r=t("events").EventEmitter,i=(t("jquery"),!1),o=!1,a=function(){r.call(this);var t=this;this.init=function(){if(o||("undefined"!=typeof window?window.google:"undefined"!=typeof n?n.google:null)||i)("undefined"!=typeof window?window.google:"undefined"!=typeof n?n.google:null)?t.emit("initDone"):o&&t.emit("initError");else{i=!0;s("http://google.com/jsapi",function(){i=!1;t.emit("initDone")});var e=100,r=6e3,a=+new Date,l=function(){if(!("undefined"!=typeof window?window.google:"undefined"!=typeof n?n.google:null))if(+new Date-a>r){o=!0;i=!1;t.emit("initError")}else setTimeout(l,e)};l()}};this.googleLoad=function(){var e=function(){("undefined"!=typeof window?window.google:"undefined"!=typeof n?n.google:null).load("visualization","1",{packages:["corechart","charteditor"],callback:function(){t.emit("done")}})};if(i){t.once("initDone",e);t.once("initError",function(){t.emit("error","Could not load google loader")})}else if("undefined"!=typeof window?window.google:"undefined"!=typeof n?n.google:null)e();else if(o)t.emit("error","Could not load google loader");else{t.once("initDone",e);t.once("initError",function(){t.emit("error","Could not load google loader")})}}},s=function(t,e){var n=document.createElement("script");n.type="text/javascript";n.readyState?n.onreadystatechange=function(){if("loaded"==n.readyState||"complete"==n.readyState){n.onreadystatechange=null;e()}}:n.onload=function(){e()};n.src=t;document.body.appendChild(n)};a.prototype=new r;e.exports=new a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{events:5,jquery:19}],35:[function(t,e){(function(n){"use strict";var r=t("jquery"),i=t("./utils.js"),o=(t("yasgui-utils"),e.exports=function(e){var a=r.extend(!0,{},o.defaults),s=e.container.closest("[id]").attr("id"),l=null,u=null,c=function(t){var r="undefined"!=typeof window?window.google:"undefined"!=typeof n?n.google:null;u=new r.visualization.ChartEditor;r.visualization.events.addListener(u,"ok",function(){var t;l=u.getChartWrapper();t=l.getDataTable();l.setDataTable(null);a.chartConfig=JSON.parse(l.toJSON());a.chartConfig.containerId&&delete a.chartConfig.containerId;e.store();l.setDataTable(t);l.setOption("width",a.width);l.setOption("height",a.height);l.draw();e.updateHeader()});t&&t()};return{name:"Google Chart",hideFromSelection:!1,priority:7,options:a,getPersistentSettings:function(){return{chartConfig:a.chartConfig,motionChartState:a.motionChartState}},setPersistentSettings:function(t){t.chartConfig&&(a.chartConfig=t.chartConfig);t.motionChartState&&(a.motionChartState=t.motionChartState)},canHandleResults:function(t){var e,n;return null!=(e=t.results)&&(n=e.getVariables())&&n.length>0},getDownloadInfo:function(){if(!e.results)return null;var t=e.resultsContainer.find("svg");if(t.length>0)return{getContent:function(){return t[0].outerHTML?t[0].outerHTML:r("<div>").append(t.clone()).html()},filename:"queryResults.svg",contentType:"image/svg+xml",buttonTitle:"Download SVG Image"};var n=e.resultsContainer.find(".google-visualization-table-table");return n.length>0?{getContent:function(){return n.tableToCsv()},filename:"queryResults.csv",contentType:"text/csv",buttonTitle:"Download as CSV"}:void 0},getEmbedHtml:function(){if(!e.results)return null;var t=e.resultsContainer.find("svg").clone().removeAttr("height").removeAttr("width").css("height","").css("width","");if(0==t.length)return null;var n=t[0].outerHTML;n||(n=r("<div>").append(t.clone()).html());return'<div style="width: 800px; height: 600px;">\n'+n+"\n</div>"},draw:function(){var o=function(){e.resultsContainer.empty();var n=s+"_gchartWrapper";e.resultsContainer.append(r("<button>",{"class":"openGchartBtn yasr_btn"}).text("Chart Config").click(function(){u.openDialog(l)})).append(r("<div>",{id:n,"class":"gchartWrapper"}));var o=new google.visualization.DataTable,c=e.results.getAsJson();c.head.vars.forEach(function(n){var r="string";try{r=i.getGoogleTypeForBindings(c.results.bindings,n)}catch(a){if(!(a instanceof t("./exceptions.js").GoogleTypeException))throw a;e.warn(a.toHtml())}o.addColumn(r,n)});var f=null;e.options.getUsedPrefixes&&(f="function"==typeof e.options.getUsedPrefixes?e.options.getUsedPrefixes(e):e.options.getUsedPrefixes);c.results.bindings.forEach(function(t){var e=[];c.head.vars.forEach(function(n,r){e.push(i.castGoogleType(t[n],f,o.getColumnType(r)))});o.addRow(e)});if(a.chartConfig&&a.chartConfig.chartType){a.chartConfig.containerId=n;l=new google.visualization.ChartWrapper(a.chartConfig);if("MotionChart"===l.getChartType()&&a.motionChartState){l.setOption("state",a.motionChartState);google.visualization.events.addListener(l,"ready",function(){var t;t=l.getChart();google.visualization.events.addListener(t,"statechange",function(){a.motionChartState=t.getState();e.store()})})}l.setDataTable(o)}else l=new google.visualization.ChartWrapper({chartType:"Table",dataTable:o,containerId:n});l.setOption("width",a.width);l.setOption("height",a.height);l.draw();google.visualization.events.addListener(l,"ready",e.updateHeader)};("undefined"!=typeof window?window.google:"undefined"!=typeof n?n.google:null)&&("undefined"!=typeof window?window.google:"undefined"!=typeof n?n.google:null).visualization&&u?o():t("./gChartLoader.js").on("done",function(){c();o()}).on("error",function(){}).googleLoad()}}});o.defaults={height:"100%",width:"100%",persistencyId:"gchart",chartConfig:null,motionChartState:null}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./exceptions.js":33,"./gChartLoader.js":34,"./utils.js":49,jquery:19,"yasgui-utils":25}],36:[function(t,e){"use strict";e.exports={cross:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" width="30px" height="30px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><g> <path d="M83.288,88.13c-2.114,2.112-5.575,2.112-7.689,0L53.659,66.188c-2.114-2.112-5.573-2.112-7.687,0L24.251,87.907 c-2.113,2.114-5.571,2.114-7.686,0l-4.693-4.691c-2.114-2.114-2.114-5.573,0-7.688l21.719-21.721c2.113-2.114,2.113-5.573,0-7.686 L11.872,24.4c-2.114-2.113-2.114-5.571,0-7.686l4.842-4.842c2.113-2.114,5.571-2.114,7.686,0L46.12,33.591 c2.114,2.114,5.572,2.114,7.688,0l21.721-21.719c2.114-2.114,5.573-2.114,7.687,0l4.695,4.695c2.111,2.113,2.111,5.571-0.003,7.686 L66.188,45.973c-2.112,2.114-2.112,5.573,0,7.686L88.13,75.602c2.112,2.111,2.112,5.572,0,7.687L83.288,88.13z"/></g></svg>',check:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" width="30px" height="30px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><path fill="#000000" d="M14.301,49.982l22.606,17.047L84.361,4.903c2.614-3.733,7.76-4.64,11.493-2.026l0.627,0.462 c3.732,2.614,4.64,7.758,2.025,11.492l-51.783,79.77c-1.955,2.791-3.896,3.762-7.301,3.988c-3.405,0.225-5.464-1.039-7.508-3.084 L2.447,61.814c-3.263-3.262-3.263-8.553,0-11.814l0.041-0.019C5.75,46.718,11.039,46.718,14.301,49.982z"/></svg>',unsorted:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" id="Layer_1" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 54.552711 113.78478" enable-background="new 0 0 100 100" xml:space="preserve"><g id="g5" transform="matrix(-0.70522156,-0.70898699,-0.70898699,0.70522156,97.988199,55.081205)"><path style="fill:#000000" inkscape:connector-curvature="0" id="path7" d="M 57.911,66.915 45.808,55.063 42.904,52.238 31.661,41.25 31.435,41.083 31.131,40.775 30.794,40.523 30.486,40.3 30.069,40.05 29.815,39.911 29.285,39.659 29.089,39.576 28.474,39.326 28.363,39.297 H 28.336 L 27.665,39.128 27.526,39.1 26.94,38.99 26.714,38.961 26.212,38.934 h -0.31 -0.444 l -0.339,0.027 c -1.45,0.139 -2.876,0.671 -4.11,1.564 l -0.223,0.141 -0.279,0.25 -0.335,0.308 -0.054,0.029 -0.171,0.194 -0.334,0.364 -0.224,0.279 -0.25,0.336 -0.225,0.362 -0.192,0.308 -0.197,0.421 -0.142,0.279 -0.193,0.477 -0.084,0.222 -12.441,38.414 c -0.814,2.458 -0.313,5.029 1.115,6.988 v 0.026 l 0.418,0.532 0.17,0.165 0.251,0.281 0.084,0.079 0.283,0.281 0.25,0.194 0.474,0.367 0.083,0.053 c 2.015,1.371 4.641,1.874 7.131,1.094 L 55.228,80.776 c 4.303,-1.342 6.679,-5.814 5.308,-10.006 -0.387,-1.259 -1.086,-2.35 -1.979,-3.215 l -0.368,-0.337 -0.278,-0.303 z m -6.318,5.896 0.079,0.114 -37.369,11.57 11.854,-36.538 10.565,10.317 2.876,2.825 11.995,11.712 z" /></g><path style="fill:#000000" inkscape:connector-curvature="0" id="path7-9" d="m 8.8748339,52.571766 16.9382111,-0.222584 4.050851,-0.06665 15.719154,-0.222166 0.27778,-0.04246 0.43276,0.0017 0.41632,-0.06121 0.37532,-0.0611 0.47132,-0.119342 0.27767,-0.08206 0.55244,-0.198047 0.19707,-0.08043 0.61095,-0.259721 0.0988,-0.05825 0.019,-0.01914 0.59303,-0.356548 0.11787,-0.0788 0.49125,-0.337892 0.17994,-0.139779 0.37317,-0.336871 0.21862,-0.219786 0.31311,-0.31479 0.21993,-0.259387 c 0.92402,-1.126057 1.55249,-2.512251 1.78961,-4.016904 l 0.0573,-0.25754 0.0195,-0.374113 0.0179,-0.454719 0.0175,-0.05874 -0.0169,-0.258049 -0.0225,-0.493503 -0.0398,-0.355569 -0.0619,-0.414201 -0.098,-0.414812 -0.083,-0.353334 L 53.23955,41.1484 53.14185,40.850967 52.93977,40.377742 52.84157,40.161628 34.38021,4.2507375 C 33.211567,1.9401875 31.035446,0.48226552 28.639484,0.11316952 l -0.01843,-0.01834 -0.671963,-0.07882 -0.236871,0.0042 L 27.335984,-4.7826577e-7 27.220736,0.00379952 l -0.398804,0.0025 -0.313848,0.04043 -0.594474,0.07724 -0.09611,0.02147 C 23.424549,0.60716252 21.216017,2.1142355 20.013025,4.4296865 L 0.93967491,40.894479 c -2.08310801,3.997178 -0.588125,8.835482 3.35080799,10.819749 1.165535,0.613495 2.43199,0.88731 3.675026,0.864202 l 0.49845,-0.02325 0.410875,0.01658 z M 9.1502369,43.934401 9.0136999,43.910011 27.164145,9.2564625 44.70942,43.42818 l -14.765289,0.214677 -4.031106,0.0468 -16.7627881,0.244744 z" /></svg>',sortDesc:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" id="Layer_1" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 54.552711 113.78478" enable-background="new 0 0 100 100" xml:space="preserve"><g id="g5" transform="matrix(-0.70522156,-0.70898699,-0.70898699,0.70522156,97.988199,55.081205)"><path style="fill:#000000" inkscape:connector-curvature="0" id="path7" d="M 57.911,66.915 45.808,55.063 42.904,52.238 31.661,41.25 31.435,41.083 31.131,40.775 30.794,40.523 30.486,40.3 30.069,40.05 29.815,39.911 29.285,39.659 29.089,39.576 28.474,39.326 28.363,39.297 H 28.336 L 27.665,39.128 27.526,39.1 26.94,38.99 26.714,38.961 26.212,38.934 h -0.31 -0.444 l -0.339,0.027 c -1.45,0.139 -2.876,0.671 -4.11,1.564 l -0.223,0.141 -0.279,0.25 -0.335,0.308 -0.054,0.029 -0.171,0.194 -0.334,0.364 -0.224,0.279 -0.25,0.336 -0.225,0.362 -0.192,0.308 -0.197,0.421 -0.142,0.279 -0.193,0.477 -0.084,0.222 -12.441,38.414 c -0.814,2.458 -0.313,5.029 1.115,6.988 v 0.026 l 0.418,0.532 0.17,0.165 0.251,0.281 0.084,0.079 0.283,0.281 0.25,0.194 0.474,0.367 0.083,0.053 c 2.015,1.371 4.641,1.874 7.131,1.094 L 55.228,80.776 c 4.303,-1.342 6.679,-5.814 5.308,-10.006 -0.387,-1.259 -1.086,-2.35 -1.979,-3.215 l -0.368,-0.337 -0.278,-0.303 z m -6.318,5.896 0.079,0.114 -37.369,11.57 11.854,-36.538 10.565,10.317 2.876,2.825 11.995,11.712 z" /></g><path style="fill:#000000" inkscape:connector-curvature="0" id="path9" d="m 27.813273,0.12823506 0.09753,0.02006 c 2.39093,0.458209 4.599455,1.96811104 5.80244,4.28639004 L 52.785897,40.894525 c 2.088044,4.002139 0.590949,8.836902 -3.348692,10.821875 -1.329078,0.688721 -2.766603,0.943695 -4.133174,0.841768 l -0.454018,0.02 L 27.910392,52.354171 23.855313,52.281851 8.14393,52.061827 7.862608,52.021477 7.429856,52.021738 7.014241,51.959818 6.638216,51.900838 6.164776,51.779369 5.889216,51.699439 5.338907,51.500691 5.139719,51.419551 4.545064,51.145023 4.430618,51.105123 4.410168,51.084563 3.817138,50.730843 3.693615,50.647783 3.207314,50.310611 3.028071,50.174369 2.652795,49.833957 2.433471,49.613462 2.140099,49.318523 1.901127,49.041407 C 0.97781,47.916059 0.347935,46.528448 0.11153,45.021676 L 0.05352,44.766255 0.05172,44.371683 0.01894,43.936017 0,43.877277 0.01836,43.62206 0.03666,43.122889 0.0765,42.765905 0.13912,42.352413 0.23568,41.940425 0.32288,41.588517 0.481021,41.151945 0.579391,40.853806 0.77369,40.381268 0.876097,40.162336 19.338869,4.2542801 c 1.172169,-2.308419 3.34759,-3.76846504 5.740829,-4.17716604 l 0.01975,0.01985 0.69605,-0.09573 0.218437,0.0225 0.490791,-0.02132 0.39809,0.0046 0.315972,0.03973 0.594462,0.08149 z" /></svg>',sortAsc:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" id="Layer_1" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 54.552711 113.78478" enable-background="new 0 0 100 100" xml:space="preserve"><g id="g5" transform="matrix(-0.70522156,0.70898699,-0.70898699,-0.70522156,97.988199,58.704807)"><path style="fill:#000000" inkscape:connector-curvature="0" id="path7" d="M 57.911,66.915 45.808,55.063 42.904,52.238 31.661,41.25 31.435,41.083 31.131,40.775 30.794,40.523 30.486,40.3 30.069,40.05 29.815,39.911 29.285,39.659 29.089,39.576 28.474,39.326 28.363,39.297 H 28.336 L 27.665,39.128 27.526,39.1 26.94,38.99 26.714,38.961 26.212,38.934 h -0.31 -0.444 l -0.339,0.027 c -1.45,0.139 -2.876,0.671 -4.11,1.564 l -0.223,0.141 -0.279,0.25 -0.335,0.308 -0.054,0.029 -0.171,0.194 -0.334,0.364 -0.224,0.279 -0.25,0.336 -0.225,0.362 -0.192,0.308 -0.197,0.421 -0.142,0.279 -0.193,0.477 -0.084,0.222 -12.441,38.414 c -0.814,2.458 -0.313,5.029 1.115,6.988 v 0.026 l 0.418,0.532 0.17,0.165 0.251,0.281 0.084,0.079 0.283,0.281 0.25,0.194 0.474,0.367 0.083,0.053 c 2.015,1.371 4.641,1.874 7.131,1.094 L 55.228,80.776 c 4.303,-1.342 6.679,-5.814 5.308,-10.006 -0.387,-1.259 -1.086,-2.35 -1.979,-3.215 l -0.368,-0.337 -0.278,-0.303 z m -6.318,5.896 0.079,0.114 -37.369,11.57 11.854,-36.538 10.565,10.317 2.876,2.825 11.995,11.712 z" /></g><path style="fill:#000000" inkscape:connector-curvature="0" id="path9" d="m 27.813273,113.65778 0.09753,-0.0201 c 2.39093,-0.45821 4.599455,-1.96811 5.80244,-4.28639 L 52.785897,72.891487 c 2.088044,-4.002139 0.590949,-8.836902 -3.348692,-10.821875 -1.329078,-0.688721 -2.766603,-0.943695 -4.133174,-0.841768 l -0.454018,-0.02 -16.939621,0.223997 -4.055079,0.07232 -15.711383,0.220024 -0.281322,0.04035 -0.432752,-2.61e-4 -0.415615,0.06192 -0.376025,0.05898 -0.47344,0.121469 -0.27556,0.07993 -0.550309,0.198748 -0.199188,0.08114 -0.594655,0.274528 -0.114446,0.0399 -0.02045,0.02056 -0.59303,0.35372 -0.123523,0.08306 -0.486301,0.337172 -0.179243,0.136242 -0.375276,0.340412 -0.219324,0.220495 -0.293372,0.294939 -0.238972,0.277116 C 0.97781,65.869953 0.347935,67.257564 0.11153,68.764336 L 0.05352,69.019757 0.05172,69.414329 0.01894,69.849995 0,69.908735 l 0.01836,0.255217 0.0183,0.499171 0.03984,0.356984 0.06262,0.413492 0.09656,0.411988 0.0872,0.351908 0.158141,0.436572 0.09837,0.298139 0.194299,0.472538 0.102407,0.218932 18.462772,35.908054 c 1.172169,2.30842 3.34759,3.76847 5.740829,4.17717 l 0.01975,-0.0199 0.69605,0.0957 0.218437,-0.0225 0.490791,0.0213 0.39809,-0.005 0.315972,-0.0397 0.594462,-0.0815 z" /></svg>',download:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="tiny" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 100 100" xml:space="preserve"><g id="Captions"></g><g id="Your_Icon"> <path fill-rule="evenodd" fill="#000000" d="M88,84v-2c0-2.961-0.859-4-4-4H16c-2.961,0-4,0.98-4,4v2c0,3.102,1.039,4,4,4h68 C87.02,88,88,87.039,88,84z M58,12H42c-5,0-6,0.941-6,6v22H16l34,34l34-34H64V18C64,12.941,62.939,12,58,12z"/></g></svg>',move:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" id="Layer_1" x="0px" y="0px" width="100%" height="100%" viewBox="5 -10 74.074074 100" enable-background="new 0 0 100 100" xml:space="preserve" inkscape:version="0.48.4 r9939" sodipodi:docname="noun_11656_cc.svg"><metadata ><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs /><sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="753" inkscape:window-height="480" showgrid="false" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0" inkscape:zoom="2.36" inkscape:cx="44.101509" inkscape:cy="31.481481" inkscape:window-x="287" inkscape:window-y="249" inkscape:window-maximized="0" inkscape:current-layer="Layer_1" /><polygon points="33,83 50,100 67,83 54,83 54,17 67,17 50,0 33,17 46,17 46,83 " transform="translate(-7.962963,-10)" /><polygon points="83,67 100,50 83,33 83,46 17,46 17,33 0,50 17,67 17,54 83,54 " transform="translate(-7.962963,-10)" /></svg>',fullscreen:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" x="0px" y="0px" width="100%" height="100%" viewBox="5 -10 74.074074 100" enable-background="new 0 0 100 100" xml:space="preserve" inkscape:version="0.48.4 r9939" sodipodi:docname="noun_2186_cc.svg"><metadata ><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs /><sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="640" inkscape:window-height="480" showgrid="false" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0" inkscape:zoom="2.36" inkscape:cx="44.101509" inkscape:cy="31.481481" inkscape:window-x="65" inkscape:window-y="24" inkscape:window-maximized="0" inkscape:current-layer="Layer_1" /><path d="m -7.962963,-10 v 38.889 l 16.667,-16.667 16.667,16.667 5.555,-5.555 -16.667,-16.667 16.667,-16.667 h -38.889 z" inkscape:connector-curvature="0" style="fill:#010101" /><path d="m 92.037037,-10 v 38.889 l -16.667,-16.667 -16.666,16.667 -5.556,-5.555 16.666,-16.667 -16.666,-16.667 h 38.889 z" inkscape:connector-curvature="0" style="fill:#010101" /><path d="M -7.962963,90 V 51.111 l 16.667,16.666 16.667,-16.666 5.555,5.556 -16.667,16.666 16.667,16.667 h -38.889 z" inkscape:connector-curvature="0" style="fill:#010101" /><path d="M 92.037037,90 V 51.111 l -16.667,16.666 -16.666,-16.666 -5.556,5.556 16.666,16.666 -16.666,16.667 h 38.889 z" inkscape:connector-curvature="0" style="fill:#010101" /></svg>',smallscreen:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" x="0px" y="0px" width="100%" height="100%" viewBox="5 -10 74.074074 100" enable-background="new 0 0 100 100" xml:space="preserve" inkscape:version="0.48.4 r9939" sodipodi:docname="noun_2186_cc.svg"><metadata ><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs /><sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="1855" inkscape:window-height="1056" showgrid="false" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0" inkscape:zoom="2.36" inkscape:cx="44.101509" inkscape:cy="31.481481" inkscape:window-x="65" inkscape:window-y="24" inkscape:window-maximized="1" inkscape:current-layer="Layer_1" /><path d="m 30.926037,28.889 0,-38.889 -16.667,16.667 -16.667,-16.667 -5.555,5.555 16.667,16.667 -16.667,16.667 38.889,0 z" inkscape:connector-curvature="0" style="fill:#010101" /><path d="m 53.148037,28.889 0,-38.889 16.667,16.667 16.666,-16.667 5.556,5.555 -16.666,16.667 16.666,16.667 -38.889,0 z" inkscape:connector-curvature="0" style="fill:#010101" /><path d="m 30.926037,51.111 0,38.889 -16.667,-16.666 -16.667,16.666 -5.555,-5.556 16.667,-16.666 -16.667,-16.667 38.889,0 z" inkscape:connector-curvature="0" style="fill:#010101" /><path d="m 53.148037,51.111 0,38.889 16.667,-16.666 16.666,16.666 5.556,-5.556 -16.666,-16.666 16.666,-16.667 -38.889,0 z" inkscape:connector-curvature="0" style="fill:#010101" /></svg>'}},{}],37:[function(t){t("./tableToCsv.js")},{"./tableToCsv.js":38}],38:[function(t){"use strict";var e=t("jquery");e.fn.tableToCsv=function(t){var n="";t=e.extend({quote:'"',delimiter:",",lineBreak:"\n"},t);var r=function(e){var n=!1;e.match("[\\w|"+t.delimiter+"|"+t.quote+"]")&&(n=!0);return n},i=function(e){e.replace(t.quote,t.quote+t.quote);r(e)&&(e=t.quote+e+t.quote);n+=" "+e+" "+t.delimiter},o=function(e){e.forEach(function(t){i(t)});n+=t.lineBreak},a=e(this),s={},l=0;a.find("tr:first *").each(function(){e(this).attr("colspan")?l+=+e(this).attr("colspan"):l++});a.find("tr").each(function(t,n){for(var r=e(n),i=[],a=0,u=0;l>u+a;u++)if(s[u]){i.push(s[u].text);s[u].rowSpan--;s[u].rowSpan||delete s[u]}else{var c=r.find(":nth-child("+(u+1)+")");console.log(c);var f=c.attr("colspan"),h=c.attr("rowspan");if(f&&!isNaN(f)){for(var d=0;f>d;d++)i.push(c.text());a+=f-1}else if(h&&!isNaN(h)){s[u+a]={rowSpan:h-1,text:c.text()};i.push(c.text());a++}else i.push(c.text())}o(i)});return n}},{jquery:19}],39:[function(t,e){"use strict";var n=t("jquery"),r=t("yasgui-utils");console=console||{log:function(){}};t("./jquery/extendJquery.js");var i=e.exports=function(e,o,a){var s={};s.options=n.extend(!0,{},i.defaults,o);s.container=n("<div class='yasr'></div>").appendTo(e);s.header=n("<div class='yasr_header'></div>").appendTo(s.container);s.resultsContainer=n("<div class='yasr_results'></div>").appendTo(s.container);
s.storage=r.storage;var l=null;s.getPersistencyId=function(t){null===l&&(l=s.options.persistency&&s.options.persistency.prefix?"string"==typeof s.options.persistency.prefix?s.options.persistency.prefix:s.options.persistency.prefix(s):!1);return l&&null!=t?l+("string"==typeof t?t:t(s)):null};s.options.useGoogleCharts&&t("./gChartLoader.js").once("initError",function(){s.options.useGoogleCharts=!1}).init();s.plugins={};for(var u in i.plugins)(s.options.useGoogleCharts||"gchart"!=u)&&(s.plugins[u]=new i.plugins[u](s));s.updateHeader=function(){var t=s.header.find(".yasr_downloadIcon").removeAttr("title"),e=s.header.find(".yasr_embedBtn"),n=s.plugins[s.options.output];if(n){var r=n.getDownloadInfo?n.getDownloadInfo():null;if(r){r.buttonTitle&&t.attr("title",r.buttonTitle);t.prop("disabled",!1);t.find("path").each(function(){this.style.fill="black"})}else{t.prop("disabled",!0).prop("title","Download not supported for this result representation");t.find("path").each(function(){this.style.fill="gray"})}var i=null;n.getEmbedHtml&&(i=n.getEmbedHtml());i&&i.length>0?e.show():e.hide()}};s.draw=function(t){if(!s.results)return!1;t||(t=s.options.output);var e=null,r=-1,i=[];for(var o in s.plugins)if(s.plugins[o].canHandleResults(s)){var a=s.plugins[o].getPriority;"function"==typeof a&&(a=a(s));if(null!=a&&void 0!=a&&a>r){r=a;e=o}}else i.push(o);c(i);var l=null;t in s.plugins&&s.plugins[t].canHandleResults(s)?l=t:e&&(l=e);if(l){n(s.resultsContainer).empty();s.plugins[l].draw();return!0}return!1};var c=function(t){s.header.find(".yasr_btnGroup .yasr_btn").removeClass("disabled");t.forEach(function(t){s.header.find(".yasr_btnGroup .select_"+t).addClass("disabled")})};s.somethingDrawn=function(){return!s.resultsContainer.is(":empty")};s.setResponse=function(e,n,i){try{s.results=t("./parsers/wrapper.js")(e,n,i)}catch(o){s.results={getException:function(){return o}}}s.draw();var a=s.getPersistencyId(s.options.persistency.results.key);a&&(s.results.getOriginalResponseAsString&&s.results.getOriginalResponseAsString().length<s.options.persistency.results.maxSize?r.storage.set(a,s.results.getAsStoreObject(),"month"):r.storage.remove(a))};var f=null,h=null,d=null;s.warn=function(t){if(!f){f=n("<div>",{"class":"toggableWarning"}).prependTo(s.container).hide();h=n("<span>",{"class":"toggleWarning"}).html("×").click(function(){f.hide(400)}).appendTo(f);d=n("<span>",{"class":"toggableMsg"}).appendTo(f)}d.empty();t instanceof n?d.append(t):d.html(t);f.show(400)};var p=null,g=function(){if(null===p){var t=window.URL||window.webkitURL||window.mozURL||window.msURL;p=t&&Blob}return p},m=null,v=function(e){var r=function(){var t=n('<div class="yasr_btnGroup"></div>');n.each(e.plugins,function(r,i){if(!i.hideFromSelection){var o=i.name||r,a=n("<button class='yasr_btn'></button>").text(o).addClass("select_"+r).click(function(){t.find("button.selected").removeClass("selected");n(this).addClass("selected");e.options.output=r;e.store();f&&f.hide(400);e.draw();e.updateHeader()}).appendTo(t);e.options.output==r&&a.addClass("selected")}});t.children().length>1&&e.header.append(t)},i=function(){var r=function(t,e){var n=null,r=window.URL||window.webkitURL||window.mozURL||window.msURL;if(r&&Blob){var i=new Blob([t],{type:e});n=r.createObjectURL(i)}return n},i=n("<button class='yasr_btn yasr_downloadIcon btn_icon'></button>").append(t("yasgui-utils").svg.getElement(t("./imgs.js").download)).click(function(){var i=e.plugins[e.options.output];if(i&&i.getDownloadInfo){var o=i.getDownloadInfo(),a=r(o.getContent(),o.contentType?o.contentType:"text/plain"),s=n("<a></a>",{href:a,download:o.filename});t("./utils.js").fireClick(s)}});e.header.append(i)},o=function(){var r=n("<button class='yasr_btn btn_fullscreen btn_icon'></button>").append(t("yasgui-utils").svg.getElement(t("./imgs.js").fullscreen)).click(function(){e.container.addClass("yasr_fullscreen")});e.header.append(r)},a=function(){var r=n("<button class='yasr_btn btn_smallscreen btn_icon'></button>").append(t("yasgui-utils").svg.getElement(t("./imgs.js").smallscreen)).click(function(){e.container.removeClass("yasr_fullscreen")});e.header.append(r)},s=function(){m=n("<button>",{"class":"yasr_btn yasr_embedBtn",title:"Get HTML snippet to embed results on a web page"}).text("</>").click(function(t){var r=e.plugins[e.options.output];if(r&&r.getEmbedHtml){var i=r.getEmbedHtml();t.stopPropagation();var o=n("<div class='yasr_embedPopup'></div>").appendTo(e.header);n("html").click(function(){o&&o.remove()});o.click(function(t){t.stopPropagation()});var a=n("<textarea>").val(i);a.focus(function(){var t=n(this);t.select();t.mouseup(function(){t.unbind("mouseup");return!1})});o.empty().append(a);var s=m.position(),l=s.top+m.outerHeight()+"px",u=Math.max(s.left+m.outerWidth()-o.outerWidth(),0)+"px";o.css("top",l).css("left",u)}});e.header.append(m)};o();a();e.options.drawOutputSelector&&r();e.options.drawDownloadIcon&&g()&&i();s()},y=null;s.store=function(){y||(y=s.getPersistencyId("main"));y&&r.storage.set(y,s.getPersistentSettings())};s.load=function(){y||(y=s.getPersistencyId("main"));s.setPersistentSettings(r.storage.get(y))};s.setPersistentSettings=function(t){if(t){t.output&&(s.options.output=t.output);for(var e in t.plugins)s.plugins[e]&&s.plugins[e].setPersistentSettings&&s.plugins[e].setPersistentSettings(t.plugins[e])}};s.getPersistentSettings=function(){var t={output:s.options.output,plugins:{}};for(var e in s.plugins)s.plugins[e].getPersistentSettings&&(t.plugins[e]=s.plugins[e].getPersistentSettings());return t};s.load();v(s);if(!a&&s.options.persistency&&s.options.persistency.results){var b,x=s.getPersistencyId(s.options.persistency.results.key);x&&(b=r.storage.get(x));if(!b&&s.options.persistency.results.id){var w="string"==typeof s.options.persistency.results.id?s.options.persistency.results.id:s.options.persistency.results.id(s);if(w){b=r.storage.get(w);b&&r.storage.remove(w)}}b&&(n.isArray(b)?s.setResponse.apply(this,b):s.setResponse(b))}a&&s.setResponse(a);s.updateHeader();return s};i.plugins={};i.registerOutput=function(t,e){i.plugins[t]=e};i.defaults=t("./defaults.js");i.version={YASR:t("../package.json").version,jquery:n.fn.jquery,"yasgui-utils":t("yasgui-utils").version};i.$=n;try{i.registerOutput("boolean",t("./boolean.js"))}catch(o){}try{i.registerOutput("rawResponse",t("./rawResponse.js"))}catch(o){}try{i.registerOutput("table",t("./table.js"))}catch(o){}try{i.registerOutput("error",t("./error.js"))}catch(o){}try{i.registerOutput("pivot",t("./pivot.js"))}catch(o){}try{i.registerOutput("gchart",t("./gchart.js"))}catch(o){}},{"../package.json":28,"./boolean.js":30,"./defaults.js":31,"./error.js":32,"./gChartLoader.js":34,"./gchart.js":35,"./imgs.js":36,"./jquery/extendJquery.js":37,"./parsers/wrapper.js":44,"./pivot.js":46,"./rawResponse.js":47,"./table.js":48,"./utils.js":49,jquery:19,"yasgui-utils":25}],40:[function(t,e){"use strict";t("jquery"),e.exports=function(e){return t("./dlv.js")(e,",")}},{"./dlv.js":41,jquery:19}],41:[function(t,e){"use strict";var n=t("jquery");t("../../lib/jquery.csv-0.71.js");e.exports=function(t,e){var r={},i=n.csv.toArrays(t,{separator:e}),o=function(t){return 0==t.indexOf("http")?"uri":null},a=function(){if(2==i.length&&1==i[0].length&&1==i[1].length&&"boolean"==i[0][0]&&("1"==i[1][0]||"0"==i[1][0])){r["boolean"]="1"==i[1][0]?!0:!1;return!0}return!1},s=function(){if(i.length>0&&i[0].length>0){r.head={vars:i[0]};return!0}return!1},l=function(){if(i.length>1){r.results={bindings:[]};for(var t=1;t<i.length;t++){for(var e={},n=0;n<i[t].length;n++){var a=r.head.vars[n];if(a){var s=i[t][n],l=o(s);e[a]={value:s};l&&(e[a].type=l)}}r.results.bindings.push(e)}r.head={vars:i[0]};return!0}return!1},u=a();if(!u){var c=s();c&&l()}return r}},{"../../lib/jquery.csv-0.71.js":4,jquery:19}],42:[function(t,e){"use strict";t("jquery"),e.exports=function(t){if("string"==typeof t)try{return JSON.parse(t)}catch(e){return!1}return"object"==typeof t&&t.constructor==={}.constructor?t:!1}},{jquery:19}],43:[function(t,e){"use strict";t("jquery"),e.exports=function(e){return t("./dlv.js")(e," ")}},{"./dlv.js":41,jquery:19}],44:[function(t,e){"use strict";t("jquery"),e.exports=function(e,n,r){var i={xml:t("./xml.js"),json:t("./json.js"),tsv:t("./tsv.js"),csv:t("./csv.js")},o=null,a=null,s=null,l=null,u=null,c=function(){if("object"==typeof e){if(e.exception)u=e.exception;else if(void 0!=e.status&&(e.status>=300||0===e.status)){u={status:e.status};"string"==typeof r&&(u.errorString=r);e.responseText&&(u.responseText=e.responseText);e.statusText&&(u.statusText=e.statusText)}if(e.contentType)o=e.contentType.toLowerCase();else if(e.getResponseHeader&&e.getResponseHeader("content-type")){var t=e.getResponseHeader("content-type").trim().toLowerCase();t.length>0&&(o=t)}e.response?a=e.response:n||r||(a=e)}u||a||(a=e.responseText?e.responseText:e)},f=function(){if(s)return s;if(s===!1||u)return!1;var t=function(){if(o)if(o.indexOf("json")>-1){try{s=i.json(a)}catch(t){u=t}l="json"}else if(o.indexOf("xml")>-1){try{s=i.xml(a)}catch(t){u=t}l="xml"}else if(o.indexOf("csv")>-1){try{s=i.csv(a)}catch(t){u=t}l="csv"}else if(o.indexOf("tab-separated")>-1){try{s=i.tsv(a)}catch(t){u=t}l="tsv"}},e=function(){s=i.json(a);if(s)l="json";else try{s=i.xml(a);s&&(l="xml")}catch(t){}};t();s||e();s||(s=!1);return s},h=function(){var t=f();return t&&"head"in t?t.head.vars:null},d=function(){var t=f();return t&&"results"in t?t.results.bindings:null},p=function(){var t=f();return t&&"boolean"in t?t["boolean"]:null},g=function(){return a},m=function(){var t="";"string"==typeof a?t=a:"json"==l?t=JSON.stringify(a,void 0,2):"xml"==l&&(t=(new XMLSerializer).serializeToString(a));return t},v=function(){return u},y=function(){null==l&&f();return l},b=function(){var t={};if(e.status){t.status=e.status;t.responseText=e.responseText;t.statusText=e.statusText;t.contentType=o}else t=e;var i=n,a=void 0;"string"==typeof r&&(a=r);return[t,i,a]};c();s=f();return{getAsStoreObject:b,getAsJson:f,getOriginalResponse:g,getOriginalResponseAsString:m,getOriginalContentType:function(){return o},getVariables:h,getBindings:d,getBoolean:p,getType:y,getException:v}}},{"./csv.js":40,"./json.js":42,"./tsv.js":43,"./xml.js":45,jquery:19}],45:[function(t,e){"use strict";{var n=t("jquery");e.exports=function(t){var e=function(t){a.head={};for(var e=0;e<t.childNodes.length;e++){var n=t.childNodes[e];if("variable"==n.nodeName){a.head.vars||(a.head.vars=[]);var r=n.getAttribute("name");r&&a.head.vars.push(r)}}},r=function(t){a.results={};a.results.bindings=[];for(var e=0;e<t.childNodes.length;e++){for(var n=t.childNodes[e],r=null,i=0;i<n.childNodes.length;i++){var o=n.childNodes[i];if("binding"==o.nodeName){var s=o.getAttribute("name");if(s){r=r||{};r[s]={};for(var l=0;l<o.childNodes.length;l++){var u=o.childNodes[l],c=u.nodeName;if("#text"!=c){r[s].type=c;r[s].value=u.innerHTML;var f=u.getAttribute("datatype");f&&(r[s].datatype=f)}}}}}r&&a.results.bindings.push(r)}},i=function(t){a["boolean"]="true"==t.innerHTML?!0:!1},o=null;"string"==typeof t?o=n.parseXML(t):n.isXMLDoc(t)&&(o=t);var t=null;if(!(o.childNodes.length>0))return null;t=o.childNodes[0];for(var a={},s=0;s<t.childNodes.length;s++){var l=t.childNodes[s];"head"==l.nodeName&&e(l);"results"==l.nodeName&&r(l);"boolean"==l.nodeName&&i(l)}return a}}},{jquery:19}],46:[function(t,e){"use strict";var n=t("jquery"),r=t("./utils.js"),i=t("yasgui-utils"),o=t("./imgs.js");t("jquery-ui/sortable");t("pivottable");if(!n.fn.pivotUI)throw new Error("Pivot lib not loaded");var a=e.exports=function(e){var s=n.extend(!0,{},a.defaults);if(s.useD3Chart){try{var l=t("d3");l&&t("../node_modules/pivottable/dist/d3_renderers.js")}catch(u){}n.pivotUtilities.d3_renderers&&n.extend(!0,n.pivotUtilities.renderers,n.pivotUtilities.d3_renderers)}var c,f=null,h=function(){var t=e.results.getVariables();if(!s.mergeLabelsWithUris)return t;var n=[];f="string"==typeof s.mergeLabelsWithUris?s.mergeLabelsWithUris:"Label";t.forEach(function(e){-1!==e.indexOf(f,e.length-f.length)&&t.indexOf(e.substring(0,e.length-f.length))>=0||n.push(e)});return n},d=function(t){var n=h(),i=null;e.options.getUsedPrefixes&&(i="function"==typeof e.options.getUsedPrefixes?e.options.getUsedPrefixes(e):e.options.getUsedPrefixes);e.results.getBindings().forEach(function(e){var o={};n.forEach(function(t){if(t in e){var n=e[t].value;f&&e[t+f]?n=e[t+f].value:"uri"==e[t].type&&(n=r.uriToPrefixed(i,n));o[t]=n}else o[t]=null});t(o)})},p=function(t){if(t){if(e.results){var r=e.results.getVariables(),i=!0;t.cols.forEach(function(t){r.indexOf(t)<0&&(i=!1)});i&&pivotOptionse.rows.forEach(function(t){r.indexOf(t)<0&&(i=!1)});if(!i){t.cols=[];t.rows=[]}n.pivotUtilities.renderers[settings.rendererName]||delete t.rendererName}}else t={};return t},g=function(){var r=function(){var t=function(t){s.pivotTable.cols=t.cols;s.pivotTable.rows=t.rows;s.pivotTable.rendererName=t.rendererName;s.pivotTable.aggregatorName=t.aggregatorName;s.pivotTable.vals=t.vals;e.store();t.rendererName.toLowerCase().indexOf(" chart")>=0?r.show():r.hide();e.updateHeader()},r=n("<button>",{"class":"openPivotGchart yasr_btn"}).text("Chart Config").click(function(){c.find('div[dir="ltr"]').dblclick()}).appendTo(e.resultsContainer);c=n("<div>",{"class":"pivotTable"}).appendTo(n(e.resultsContainer));s.pivotTable.onRefresh=function(){var e=s.pivotTable.onRefresh;return function(n){t(n);e&&e(n)}}();window.pivot=c.pivotUI(d,s.pivotTable);var a=n(i.svg.getElement(o.move));c.find(".pvtTriangle").replaceWith(a);n(".pvtCols").prepend(n("<div>",{"class":"containerHeader"}).text("Columns"));n(".pvtRows").prepend(n("<div>",{"class":"containerHeader"}).text("Rows"));n(".pvtUnused").prepend(n("<div>",{"class":"containerHeader"}).text("Available Variables"));n(".pvtVals").prepend(n("<div>",{"class":"containerHeader"}).text("Cells"));setTimeout(e.updateHeader,400)};e.options.useGoogleCharts&&s.useGoogleCharts&&!n.pivotUtilities.gchart_renderers?t("./gChartLoader.js").on("done",function(){try{t("../node_modules/pivottable/dist/gchart_renderers.js");n.extend(!0,n.pivotUtilities.renderers,n.pivotUtilities.gchart_renderers)}catch(e){s.useGoogleCharts=!1}r()}).on("error",function(){console.log("could not load gchart");s.useGoogleCharts=!1;r()}).googleLoad():r()},m=function(){return e.results&&e.results.getVariables&&e.results.getVariables()&&e.results.getVariables().length>0},v=function(){if(!e.results)return null;var t=e.resultsContainer.find(".pvtRendererArea svg");if(t.length>0)return{getContent:function(){return t[0].outerHTML?t[0].outerHTML:n("<div>").append(t.clone()).html()},filename:"queryResults.svg",contentType:"image/svg+xml",buttonTitle:"Download SVG Image"};var r=e.resultsContainer.find(".pvtRendererArea table");return r.length>0?{getContent:function(){return r.tableToCsv()},filename:"queryResults.csv",contentType:"text/csv",buttonTitle:"Download as CSV"}:void 0},y=function(){if(!e.results)return null;var t=e.resultsContainer.find(".pvtRendererArea svg").clone().removeAttr("height").removeAttr("width").css("height","").css("width","");if(0==t.length)return null;var r=t[0].outerHTML;r||(r=n("<div>").append(t.clone()).html());return'<div style="width: 800px; height: 600px;">\n'+r+"\n</div>"};return{getPersistentSettings:function(){return{pivotTable:s.pivotTable}},setPersistentSettings:function(t){t.pivotTable&&(s.pivotTable=p(t.pivotTable))},getDownloadInfo:v,getEmbedHtml:y,options:s,draw:g,name:"Pivot Table",canHandleResults:m,getPriority:4}};a.defaults={mergeLabelsWithUris:!1,useGoogleCharts:!0,useD3Chart:!0,persistencyId:"pivot",pivotTable:{}};a.version={"YASR-rawResponse":t("../package.json").version,jquery:n.fn.jquery}},{"../node_modules/pivottable/dist/d3_renderers.js":20,"../node_modules/pivottable/dist/gchart_renderers.js":21,"../package.json":28,"./gChartLoader.js":34,"./imgs.js":36,"./utils.js":49,d3:14,jquery:19,"jquery-ui/sortable":17,pivottable:22,"yasgui-utils":25}],47:[function(t,e){"use strict";var n=t("jquery"),r=t("codemirror");t("codemirror/addon/fold/foldcode.js");t("codemirror/addon/fold/foldgutter.js");t("codemirror/addon/fold/xml-fold.js");t("codemirror/addon/fold/brace-fold.js");t("codemirror/addon/edit/matchbrackets.js");t("codemirror/mode/xml/xml.js");t("codemirror/mode/javascript/javascript.js");var i=e.exports=function(t){var e=n.extend(!0,{},i.defaults),o=null,a=function(){var n=e.CodeMirror;n.value=t.results.getOriginalResponseAsString();var i=t.results.getType();if(i){"json"==i&&(i={name:"javascript",json:!0});n.mode=i}o=r(t.resultsContainer.get()[0],n);o.on("fold",function(){o.refresh()});o.on("unfold",function(){o.refresh()})},s=function(){if(!t.results)return!1;if(!t.results.getOriginalResponseAsString)return!1;var e=t.results.getOriginalResponseAsString();return e&&0!=e.length||!t.results.getException()?!0:!1},l=function(){if(!t.results)return null;var e=t.results.getOriginalContentType(),n=t.results.getType();return{getContent:function(){return t.results.getOriginalResponse()},filename:"queryResults"+(n?"."+n:""),contentType:e?e:"text/plain",buttonTitle:"Download raw response"}};return{draw:a,name:"Raw Response",canHandleResults:s,getPriority:2,getDownloadInfo:l}};i.defaults={CodeMirror:{readOnly:!0,lineNumbers:!0,lineWrapping:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"]}};i.version={"YASR-rawResponse":t("../package.json").version,jquery:n.fn.jquery,CodeMirror:r.version}},{"../package.json":28,codemirror:11,"codemirror/addon/edit/matchbrackets.js":6,"codemirror/addon/fold/brace-fold.js":7,"codemirror/addon/fold/foldcode.js":8,"codemirror/addon/fold/foldgutter.js":9,"codemirror/addon/fold/xml-fold.js":10,"codemirror/mode/javascript/javascript.js":12,"codemirror/mode/xml/xml.js":13,jquery:19}],48:[function(t,e){"use strict";var n=t("jquery"),r=t("yasgui-utils"),i=t("./utils.js"),o=t("./imgs.js");t("../lib/DataTables/media/js/jquery.dataTables.js");t("../lib/colResizable-1.4.js");var a=e.exports=function(e){var i=null,s={name:"Table",getPriority:10},l=s.options=n.extend(!0,{},a.defaults),c=l.persistency?e.getPersistencyId(l.persistency.tableLength):null,f=function(){var t=[],n=e.results.getBindings(),r=e.results.getVariables(),i=null;e.options.getUsedPrefixes&&(i="function"==typeof e.options.getUsedPrefixes?e.options.getUsedPrefixes(e):e.options.getUsedPrefixes);for(var o=0;o<n.length;o++){var a=[];a.push("");for(var u=n[o],c=0;c<r.length;c++){var f=r[c];a.push(f in u?l.getCellContent?l.getCellContent(e,s,u,f,{rowId:o,colId:c,usedPrefixes:i}):"":"")}t.push(a)}return t},h=e.getPersistencyId("eventId")||"yasr_"+n(e.container).closest("[id]").attr("id"),d=function(){i.on("order.dt",function(){p()});c&&i.on("length.dt",function(t,e,n){r.storage.set(c,n,"month")});n.extend(!0,l.callbacks,l.handlers);i.delegate("td","click",function(t){if(l.callbacks&&l.callbacks.onCellClick){var e=l.callbacks.onCellClick(this,t);if(e===!1)return!1}}).delegate("td","mouseenter",function(t){l.callbacks&&l.callbacks.onCellMouseEnter&&l.callbacks.onCellMouseEnter(this,t);var e=n(this);l.fetchTitlesFromPreflabel&&void 0===e.attr("title")&&0==e.text().trim().indexOf("http")&&u(e)}).delegate("td","mouseleave",function(t){l.callbacks&&l.callbacks.onCellMouseLeave&&l.callbacks.onCellMouseLeave(this,t)});n(window).off("resize."+h);n(window).on("resize."+h,g);g()};s.draw=function(){i=n('<table cellpadding="0" cellspacing="0" border="0" class="resultsTable"></table>');n(e.resultsContainer).html(i);var t=l.datatable;t.data=f();t.columns=l.getColumns(e,s);var o=r.storage.get(c);o&&(t.pageLength=o);i.DataTable(n.extend(!0,{},t));p();d();i.colResizable();i.find("thead").outerHeight();n(e.resultsContainer).find(".JCLRgrip").height(i.find("thead").outerHeight());var a=e.header.outerHeight()-5;if(a>0){e.resultsContainer.find(".dataTables_wrapper").css("position","relative").css("top","-"+a+"px").css("margin-bottom","-"+a+"px");n(e.resultsContainer).find(".JCLRgrip").css("marginTop",a+"px")}};var p=function(){var t={sorting:"unsorted",sorting_asc:"sortAsc",sorting_desc:"sortDesc"};i.find(".sortIcons").remove();for(var e in t){var a=n("<div class='sortIcons'></div>");r.svg.draw(a,o[t[e]]);i.find("th."+e).append(a)}};s.canHandleResults=function(){return e.results&&e.results.getVariables&&e.results.getVariables()&&e.results.getVariables().length>0};s.getDownloadInfo=function(){return e.results?{getContent:function(){return t("./bindingsToCsv.js")(e.results.getAsJson())},filename:"queryResults.csv",contentType:"text/csv",buttonTitle:"Download as CSV"}:null};var g=function(){var t=!0,n=e.container.find(".yasr_downloadIcon"),r=e.container.find(".dataTables_filter"),i=n.offset().left;if(i>0){var o=i+n.outerWidth(),a=r.offset().left;a>0&&o>a&&(t=!1)}t?r.css("visibility","visible"):r.css("visibility","hidden")};return s},s=function(t,e,n){var r=i.escapeHtmlEntities(n.value);if(n["xml:lang"])r='"'+r+'"<sup>@'+n["xml:lang"]+"</sup>";else if(n.datatype){var o="http://www.w3.org/2001/XMLSchema#",a=n.datatype;a=0===a.indexOf(o)?"xsd:"+a.substring(o.length):"<"+a+">";r='"'+r+'"<sup>^^'+a+"</sup>"}return r},l=function(t,e,n,r,i){var o=n[r],a=null;if("uri"==o.type){var l=null,u=o.value,c=u;if(i.usedPrefixes)for(var f in i.usedPrefixes)if(0==c.indexOf(i.usedPrefixes[f])){c=f+":"+u.substring(i.usedPrefixes[f].length);break}if(e.options.mergeLabelsWithUris){var h="string"==typeof e.options.mergeLabelsWithUris?e.options.mergeLabelsWithUris:"Label";if(n[r+h]){c=s(t,e,n[r+h]);l=u}}a="<a "+(l?"title='"+u+"' ":"")+"class='uri' target='_blank' href='"+u+"'>"+c+"</a>"}else a="<span class='nonUri'>"+s(t,e,o)+"</span>";return"<div>"+a+"</div>"},u=function(t){var e=function(){t.attr("title","")};n.get("http://preflabel.org/api/v1/label/"+encodeURIComponent(t.text())+"?silent=true").success(function(n){"object"==typeof n&&n.label?t.attr("title",n.label):"string"==typeof n&&n.length>0?t.attr("title",n):e()}).fail(e)};a.defaults={getCellContent:l,persistency:{tableLength:"tableLength"},getColumns:function(t,e){var n=function(n){if(!e.options.mergeLabelsWithUris)return!0;var r="string"==typeof e.options.mergeLabelsWithUris?e.options.mergeLabelsWithUris:"Label";return-1!==n.indexOf(r,n.length-r.length)&&t.results.getVariables().indexOf(n.substring(0,n.length-r.length))>=0?!1:!0},r=[];r.push({title:""});t.results.getVariables().forEach(function(t){r.push({title:"<span>"+t+"</span>",visible:n(t)})});return r},fetchTitlesFromPreflabel:!0,mergeLabelsWithUris:!1,callbacks:{onCellMouseEnter:null,onCellMouseLeave:null,onCellClick:null},datatable:{autoWidth:!1,order:[],pageLength:50,lengthMenu:[[10,50,100,1e3,-1],[10,50,100,1e3,"All"]],lengthChange:!0,pagingType:"full_numbers",drawCallback:function(t){for(var e=0;e<t.aiDisplay.length;e++)n("td:eq(0)",t.aoData[t.aiDisplay[e]].nTr).html(e+1);var r=!1;n(t.nTableWrapper).find(".paginate_button").each(function(){-1==n(this).attr("class").indexOf("current")&&-1==n(this).attr("class").indexOf("disabled")&&(r=!0)});r?n(t.nTableWrapper).find(".dataTables_paginate").show():n(t.nTableWrapper).find(".dataTables_paginate").hide()},columnDefs:[{width:"32px",orderable:!1,targets:0}]}};a.version={"YASR-table":t("../package.json").version,jquery:n.fn.jquery,"jquery-datatables":n.fn.DataTable.version}},{"../lib/DataTables/media/js/jquery.dataTables.js":2,"../lib/colResizable-1.4.js":3,"../package.json":28,"./bindingsToCsv.js":29,"./imgs.js":36,"./utils.js":49,jquery:19,"yasgui-utils":25}],49:[function(t,e){"use strict";var n=t("jquery"),r=t("./exceptions.js").GoogleTypeException;e.exports={escapeHtmlEntities:function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},uriToPrefixed:function(t,e){if(t)for(var n in t)if(0==e.indexOf(t[n])){e=n+":"+e.substring(t[n].length);break}return e},getGoogleTypeForBinding:function(t){if(null==t)return null;if(null==t.type||"typed-literal"!==t.type&&"literal"!==t.type)return"string";switch(t.datatype){case"http://www.w3.org/2001/XMLSchema#float":case"http://www.w3.org/2001/XMLSchema#decimal":case"http://www.w3.org/2001/XMLSchema#int":case"http://www.w3.org/2001/XMLSchema#integer":case"http://www.w3.org/2001/XMLSchema#long":case"http://www.w3.org/2001/XMLSchema#gYearMonth":case"http://www.w3.org/2001/XMLSchema#gYear":case"http://www.w3.org/2001/XMLSchema#gMonthDay":case"http://www.w3.org/2001/XMLSchema#gDay":case"http://www.w3.org/2001/XMLSchema#gMonth":return"number";case"http://www.w3.org/2001/XMLSchema#date":return"date";case"http://www.w3.org/2001/XMLSchema#dateTime":return"datetime";case"http://www.w3.org/2001/XMLSchema#time":return"timeofday";default:return"string"}},getGoogleTypeForBindings:function(t,n){var i={},o=0;t.forEach(function(t){var r=e.exports.getGoogleTypeForBinding(t[n]);if(null!=r){if(!(r in i)){i[r]=0;o++}i[r]++}});if(0==o)return"string";if(1!=o)throw new r(i,n);for(var a in i)return a},castGoogleType:function(t,n,r){if(null==t)return null;if("string"==r||null==t.type||"typed-literal"!==t.type&&"literal"!==t.type)return(t.type="uri")?e.exports.uriToPrefixed(n,t.value):t.value;switch(t.datatype){case"http://www.w3.org/2001/XMLSchema#float":case"http://www.w3.org/2001/XMLSchema#decimal":case"http://www.w3.org/2001/XMLSchema#int":case"http://www.w3.org/2001/XMLSchema#integer":case"http://www.w3.org/2001/XMLSchema#long":case"http://www.w3.org/2001/XMLSchema#gYearMonth":case"http://www.w3.org/2001/XMLSchema#gYear":case"http://www.w3.org/2001/XMLSchema#gMonthDay":case"http://www.w3.org/2001/XMLSchema#gDay":case"http://www.w3.org/2001/XMLSchema#gMonth":return Number(t.value);case"http://www.w3.org/2001/XMLSchema#date":var o=i(t.value);if(o)return o;case"http://www.w3.org/2001/XMLSchema#dateTime":case"http://www.w3.org/2001/XMLSchema#time":return new Date(t.value);default:return t.value}},fireClick:function(t){t&&t.each(function(t,e){var r=n(e);if(document.dispatchEvent){var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!0,window,1,1,1,1,1,!1,!1,!1,!1,0,r[0]);r[0].dispatchEvent(i)}else document.fireEvent&&r[0].click()})}};var i=function(t){var e=new Date(t.replace(/(\d)([\+-]\d{2}:\d{2})/,"$1Z$2"));return isNaN(e)?null:e}},{"./exceptions.js":33,jquery:19}]},{},[1])(1)});
//# sourceMappingURL=yasr.bundled.min.js.map | him2him2/cdnjs | ajax/libs/yasr/2.5.3/yasr.bundled.min.js | JavaScript | mit | 636,873 |
<!DOCTYPE html>
<!--
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<title>Full Page Editing — CKEditor Sample</title>
<meta charset="utf-8">
<script src="../../../ckeditor.js"></script>
<script src="../../../samples/sample.js"></script>
<link rel="stylesheet" href="../../../samples/sample.css">
<meta name="ckeditor-sample-required-plugins" content="sourcearea">
<meta name="ckeditor-sample-name" content="Full page support">
<meta name="ckeditor-sample-group" content="Plugins">
<meta name="ckeditor-sample-description" content="CKEditor inserted with a JavaScript call and used to edit the whole page from <html> to </html>.">
</head>
<body>
<h1 class="samples">
<a href="../../../samples/index.html">CKEditor Samples</a> » Full Page Editing
</h1>
<div class="description">
<p>
This sample shows how to configure CKEditor to edit entire HTML pages, from the
<code><html></code> tag to the <code></html></code> tag.
</p>
<p>
The CKEditor instance below is inserted with a JavaScript call using the following code:
</p>
<pre class="samples">
CKEDITOR.replace( '<em>textarea_id</em>', {
<strong>fullPage: true</strong>,
<strong>allowedContent: true</strong>
});
</pre>
<p>
Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of
the <code><textarea></code> element to be replaced.
</p>
<p>
The <code><em>allowedContent</em></code> in the code above is set to <code>true</code> to disable content filtering.
Setting this option is not obligatory, but in full page mode there is a strong chance that one may want be able to freely enter any HTML content in source mode without any limitations.
</p>
</div>
<form action="../../../samples/sample_posteddata.php" method="post">
<label for="editor1">
CKEditor output the entire page including content outside of
<code><body></code> element, so content like meta and title can be changed:
</label>
<textarea cols="80" id="editor1" name="editor1" rows="10">
<h1><img alt="Saturn V carrying Apollo 11" align="right" src="../../../samples/assets/sample.jpg"/> Apollo 11</h1> <p><b>Apollo 11</b> was the spaceflight that landed the first humans, Americans <a href="http://en.wikipedia.org/wiki/Neil_Armstrong" title="Neil Armstrong">Neil Armstrong</a> and <a href="http://en.wikipedia.org/wiki/Buzz_Aldrin" title="Buzz Aldrin">Buzz Aldrin</a>, on the Moon on July 20, 1969, at 20:18 UTC. Armstrong became the first to step onto the lunar surface 6 hours later on July 21 at 02:56 UTC.</p> <p>Armstrong spent about <s>three and a half</s> two and a half hours outside the spacecraft, Aldrin slightly less; and together they collected 47.5 pounds (21.5&nbsp;kg) of lunar material for return to Earth. A third member of the mission, <a href="http://en.wikipedia.org/wiki/Michael_Collins_(astronaut)" title="Michael Collins (astronaut)">Michael Collins</a>, piloted the <a href="http://en.wikipedia.org/wiki/Apollo_Command/Service_Module" title="Apollo Command/Service Module">command</a> spacecraft alone in lunar orbit until Armstrong and Aldrin returned to it for the trip back to Earth.</p> <h2>Broadcasting and <em>quotes</em> <a id="quotes" name="quotes"></a></h2> <p>Broadcast on live TV to a world-wide audience, Armstrong stepped onto the lunar surface and described the event as:</p> <blockquote><p>One small step for [a] man, one giant leap for mankind.</p></blockquote> <p>Apollo 11 effectively ended the <a href="http://en.wikipedia.org/wiki/Space_Race" title="Space Race">Space Race</a> and fulfilled a national goal proposed in 1961 by the late U.S. President <a href="http://en.wikipedia.org/wiki/John_F._Kennedy" title="John F. Kennedy">John F. Kennedy</a> in a speech before the United States Congress:</p> <blockquote><p>[...] before this decade is out, of landing a man on the Moon and returning him safely to the Earth.</p></blockquote> <h2>Technical details <a id="tech-details" name="tech-details"></a></h2> <table align="right" border="1" bordercolor="#ccc" cellpadding="5" cellspacing="0" style="border-collapse:collapse;margin:10px 0 10px 15px;"> <caption><strong>Mission crew</strong></caption> <thead> <tr> <th scope="col">Position</th> <th scope="col">Astronaut</th> </tr> </thead> <tbody> <tr> <td>Commander</td> <td>Neil A. Armstrong</td> </tr> <tr> <td>Command Module Pilot</td> <td>Michael Collins</td> </tr> <tr> <td>Lunar Module Pilot</td> <td>Edwin &quot;Buzz&quot; E. Aldrin, Jr.</td> </tr> </tbody> </table> <p>Launched by a <strong>Saturn V</strong> rocket from <a href="http://en.wikipedia.org/wiki/Kennedy_Space_Center" title="Kennedy Space Center">Kennedy Space Center</a> in Merritt Island, Florida on July 16, Apollo 11 was the fifth manned mission of <a href="http://en.wikipedia.org/wiki/NASA" title="NASA">NASA</a>&#39;s Apollo program. The Apollo spacecraft had three parts:</p> <ol> <li><strong>Command Module</strong> with a cabin for the three astronauts which was the only part which landed back on Earth</li> <li><strong>Service Module</strong> which supported the Command Module with propulsion, electrical power, oxygen and water</li> <li><strong>Lunar Module</strong> for landing on the Moon.</li> </ol> <p>After being sent to the Moon by the Saturn V&#39;s upper stage, the astronauts separated the spacecraft from it and travelled for three days until they entered into lunar orbit. Armstrong and Aldrin then moved into the Lunar Module and landed in the <a href="http://en.wikipedia.org/wiki/Mare_Tranquillitatis" title="Mare Tranquillitatis">Sea of Tranquility</a>. They stayed a total of about 21 and a half hours on the lunar surface. After lifting off in the upper part of the Lunar Module and rejoining Collins in the Command Module, they returned to Earth and landed in the <a href="http://en.wikipedia.org/wiki/Pacific_Ocean" title="Pacific Ocean">Pacific Ocean</a> on July 24.</p> <hr/> <p style="text-align: right;"><small>Source: <a href="http://en.wikipedia.org/wiki/Apollo_11">Wikipedia.org</a></small></p>
</textarea>
<script>
CKEDITOR.replace( 'editor1', {
fullPage: true,
allowedContent: true,
extraPlugins: 'wysiwygarea'
});
</script>
<p>
<input type="submit" value="Submit">
</p>
</form>
<div id="footer">
<hr>
<p>
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright © 2003-2013, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
Knabben. All rights reserved.
</p>
</div>
</body>
</html>
| hansenmakangiras/disperindag | static/assets/libs/js/ckeditor/samples/plugins/wysiwygarea/fullpage.html | HTML | mit | 7,818 |
/*!
* Velocity.js: Accelerated JavaScript animation.
* @version 0.0.22
* @docs http://velocityjs.org
* @license Copyright 2014 Julian Shapiro. MIT License: http://en.wikipedia.org/wiki/MIT_License
*/
!function(a,b,c,d){function e(a){for(var b=-1,c=a?a.length:0,d=[];++b<c;){var e=a[b];e&&d.push(e)}return d}function f(a){return"[object Function]"===Object.prototype.toString.call(a)}function g(a){var b=Object.prototype.toString.call(a);return"object"==typeof a&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(b)&&a.length!==d&&(0===a.length||"object"==typeof a[0]&&a[0].nodeType>0)}function h(a){return a&&(a.jquery||b.Zepto&&b.Zepto.zepto.isZ(a))}function i(a,b){var c=a;return q(a)?t.Easings[a]||(c=!1):c=r(a)&&2===a.length?v.apply(null,a.concat([b])):r(a)&&4===a.length?u.apply(null,a):!1,c===!1&&(c=t.Easings[t.defaults.easing]?t.defaults.easing:n),c}function j(a){if(a)for(var b=(new Date).getTime(),c=0,e=t.State.calls.length;e>c;c++)if(t.State.calls[c]){var f=t.State.calls[c],g=f[0],h=f[2],i=f[3];i||(i=t.State.calls[c][3]=b-16);for(var m=Math.min((b-i)/h.duration,1),n=0,o=g.length;o>n;n++){var r=g[n],u=r.element;if(s.data(u,l)){var v=!1;h.display&&"none"!==h.display&&w.setPropertyValue(u,"display",h.display);for(var x in r)if("element"!==x){var y,z=r[x],A=q(z.easing)?t.Easings[z.easing]:z.easing;if(y=1===m?z.endValue:z.startValue+(z.endValue-z.startValue)*A(m),z.currentValue=y,w.Hooks.registered[x]){var B=w.Hooks.getRoot(x),C=s.data(u,l).rootPropertyValueCache[B];C&&(z.rootPropertyValue=C)}var D=w.setPropertyValue(u,x,z.currentValue+(0===parseFloat(y)?"":z.unitType),z.rootPropertyValue,z.scrollData);w.Hooks.registered[x]&&(s.data(u,l).rootPropertyValueCache[B]=w.Normalizations.registered[B]?w.Normalizations.registered[B]("extract",null,D[1]):D[1]),"transform"===D[0]&&(v=!0)}h.mobileHA&&s.data(u,l).transformCache.translate3d===d&&(s.data(u,l).transformCache.translate3d="(0px, 0px, 0px)",v=!0),v&&w.flushTransformCache(u)}}h.display&&"none"!==h.display&&(t.State.calls[c][2].display=!1),h.progress&&h.progress.call(f[1],f[1],m,Math.max(0,i+h.duration-b),i),1===m&&k(c)}t.State.isTicking&&p(j)}function k(a){for(var b=t.State.calls[a][0],c=t.State.calls[a][1],e=t.State.calls[a][2],f=!1,g=0,h=b.length;h>g;g++){var i=b[g].element;if("none"!==e.display||e.loop||w.setPropertyValue(i,"display",e.display),(s.queue(i)[1]===d||!/\.velocityQueueEntryFlag/i.test(s.queue(i)[1]))&&s.data(i,l)){s.data(i,l).isAnimating=!1,s.data(i,l).rootPropertyValueCache={};var j,k=["transformPerspective","translateZ","rotateX","rotateY"],m=!1;for(var n in k)j=k[n],/^\(0[^.]/.test(s.data(i,l).transformCache[j])&&(m=!0,delete s.data(i,l).transformCache[j]);e.mobileHA&&(m=!0,delete s.data(i,l).transformCache.translate3d),m&&w.flushTransformCache(i)}e.complete&&!e.loop&&g===h-1&&e.complete.call(c,c),e.queue!==!1&&s.dequeue(i,e.queue)}t.State.calls[a]=!1;for(var o=0,p=t.State.calls.length;p>o;o++)if(t.State.calls[o]!==!1){f=!0;break}f===!1&&(t.State.isTicking=!1,delete t.State.calls,t.State.calls=[])}var l="velocity",m=400,n="swing",o=function(){if(c.documentMode)return c.documentMode;for(var a=7;a>4;a--){var b=c.createElement("div");if(b.innerHTML="<!--[if IE "+a+"]><span></span><![endif]-->",b.getElementsByTagName("span").length)return b=null,a}return d}(),p=b.requestAnimationFrame||function(){var a=0;return b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame||function(b){var c,d=(new Date).getTime();return c=Math.max(0,16-(d-a)),a=d+c,setTimeout(function(){b(d+c)},c)}}(),q=function(a){return"string"==typeof a},r=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},s=b.jQuery||a.Velocity&&a.Velocity.Utilities;if(!s)throw new Error("Velocity: Either jQuery or Velocity's jQuery shim must first be loaded.");if(a.Velocity!==d&&!a.Velocity.Utilities)throw new Error("Velocity: Namespace is occupied.");if(7>=o){if(b.jQuery)return void(b.jQuery.fn.velocity=b.jQuery.fn.animate);throw new Error("Velocity: For IE<=7, Velocity falls back to jQuery, which must first be loaded.")}if(8===o&&!b.jQuery)throw new Error("Velocity: For IE8, Velocity requires jQuery to be loaded. (Velocity's jQuery shim does not work with IE8.)");var t=a.Velocity=a.velocity={State:{isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),isAndroid:/Android/i.test(navigator.userAgent),isGingerbread:/Android 2\.3\.[3-7]/i.test(navigator.userAgent),prefixElement:c.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[]},CSS:{},Utilities:b.jQuery?{}:s,Sequences:{},Easings:{},defaults:{queue:"",duration:m,easing:n,begin:null,complete:null,progress:null,display:null,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0},animate:function(){},debug:!1};b.pageYOffset!==d?(t.State.scrollAnchor=b,t.State.scrollPropertyLeft="pageXOffset",t.State.scrollPropertyTop="pageYOffset"):(t.State.scrollAnchor=c.documentElement||c.body.parentNode||c.body,t.State.scrollPropertyLeft="scrollLeft",t.State.scrollPropertyTop="scrollTop");var u=function(){function a(a,b){return 1-3*b+3*a}function b(a,b){return 3*b-6*a}function c(a){return 3*a}function d(d,e,f){return((a(e,f)*d+b(e,f))*d+c(e))*d}function e(d,e,f){return 3*a(e,f)*d*d+2*b(e,f)*d+c(e)}return function(a,b,c,f){function g(b){for(var f=b,g=0;8>g;++g){var h=e(f,a,c);if(0===h)return f;var i=d(f,a,c)-b;f-=i/h}return f}if(4!==arguments.length)return!1;for(var h=0;4>h;++h)if("number"!=typeof arguments[h]||isNaN(arguments[h])||!isFinite(arguments[h]))return!1;return a=Math.min(a,1),c=Math.min(c,1),a=Math.max(a,0),c=Math.max(c,0),function(e){return a===b&&c===f?e:d(g(e),b,f)}}}(),v=function(){function a(a){return-a.tension*a.x-a.friction*a.v}function b(b,c,d){var e={x:b.x+d.dx*c,v:b.v+d.dv*c,tension:b.tension,friction:b.friction};return{dx:e.v,dv:a(e)}}function c(c,d){var e={dx:c.v,dv:a(c)},f=b(c,.5*d,e),g=b(c,.5*d,f),h=b(c,d,g),i=1/6*(e.dx+2*(f.dx+g.dx)+h.dx),j=1/6*(e.dv+2*(f.dv+g.dv)+h.dv);return c.x=c.x+i*d,c.v=c.v+j*d,c}return function d(a,b,e){var f,g,h,i={x:-1,v:0,tension:null,friction:null},j=[0],k=0,l=1e-4,m=.016;for(a=parseFloat(a)||600,b=parseFloat(b)||20,e=e||null,i.tension=a,i.friction=b,f=null!==e,f?(k=d(a,b),g=k/e*m):g=m;;)if(h=c(h||i,g),j.push(1+h.x),k+=16,!(Math.abs(h.x)>l&&Math.abs(h.v)>l))break;return f?function(a){return j[a*(j.length-1)|0]}:k}}();!function(){t.Easings.linear=function(a){return a},t.Easings.swing=function(a){return.5-Math.cos(a*Math.PI)/2},t.Easings.ease=u(.25,.1,.25,1),t.Easings["ease-in"]=u(.42,0,1,1),t.Easings["ease-out"]=u(0,0,.58,1),t.Easings["ease-in-out"]=u(.42,0,.58,1);var a={};s.each(["Quad","Cubic","Quart","Quint","Expo"],function(b,c){a[c]=function(a){return Math.pow(a,b+2)}}),s.extend(a,{Sine:function(a){return 1-Math.cos(a*Math.PI/2)},Circ:function(a){return 1-Math.sqrt(1-a*a)},Elastic:function(a){return 0===a||1===a?a:-Math.pow(2,8*(a-1))*Math.sin((80*(a-1)-7.5)*Math.PI/15)},Back:function(a){return a*a*(3*a-2)},Bounce:function(a){for(var b,c=4;a<((b=Math.pow(2,--c))-1)/11;);return 1/Math.pow(4,3-c)-7.5625*Math.pow((3*b-2)/22-a,2)}}),s.each(a,function(a,b){t.Easings["easeIn"+a]=b,t.Easings["easeOut"+a]=function(a){return 1-b(1-a)},t.Easings["easeInOut"+a]=function(a){return.5>a?b(2*a)/2:1-b(-2*a+2)/2}}),t.Easings.spring=function(a){return 1-Math.cos(4.5*a*Math.PI)*Math.exp(6*-a)}}();var w=t.CSS={RegEx:{valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/gi},Hooks:{templates:{color:["Red Green Blue Alpha","255 255 255 1"],backgroundColor:["Red Green Blue Alpha","255 255 255 1"],borderColor:["Red Green Blue Alpha","255 255 255 1"],borderTopColor:["Red Green Blue Alpha","255 255 255 1"],borderRightColor:["Red Green Blue Alpha","255 255 255 1"],borderBottomColor:["Red Green Blue Alpha","255 255 255 1"],borderLeftColor:["Red Green Blue Alpha","255 255 255 1"],outlineColor:["Red Green Blue Alpha","255 255 255 1"],textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0%"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){var a,b,c;if(o)for(a in w.Hooks.templates){b=w.Hooks.templates[a],c=b[0].split(" ");var d=b[1].match(w.RegEx.valueSplit);"Color"===c[0]&&(c.push(c.shift()),d.push(d.shift()),w.Hooks.templates[a]=[c.join(" "),d.join(" ")])}for(a in w.Hooks.templates){b=w.Hooks.templates[a],c=b[0].split(" ");for(var e in c){var f=a+c[e],g=e;w.Hooks.registered[f]=[a,g]}}},getRoot:function(a){var b=w.Hooks.registered[a];return b?b[0]:a},cleanRootPropertyValue:function(a,b){return w.RegEx.valueUnwrap.test(b)&&(b=b.match(w.Hooks.RegEx.valueUnwrap)[1]),w.Values.isCSSNullValue(b)&&(b=w.Hooks.templates[a][1]),b},extractValue:function(a,b){var c=w.Hooks.registered[a];if(c){var d=c[0],e=c[1];return b=w.Hooks.cleanRootPropertyValue(d,b),b.toString().match(w.RegEx.valueSplit)[e]}return b},injectValue:function(a,b,c){var d=w.Hooks.registered[a];if(d){var e,f,g=d[0],h=d[1];return c=w.Hooks.cleanRootPropertyValue(g,c),e=c.toString().match(w.RegEx.valueSplit),e[h]=b,f=e.join(" ")}return c}},Normalizations:{registered:{clip:function(a,b,c){switch(a){case"name":return"clip";case"extract":var d;return w.RegEx.wrappedValueAlreadyExtracted.test(c)?d=c:(d=c.toString().match(w.RegEx.valueUnwrap),d=d?d[1].replace(/,(\s+)?/g," "):c),d;case"inject":return"rect("+c+")"}},opacity:function(a,b,c){if(8>=o)switch(a){case"name":return"filter";case"extract":var d=c.toString().match(/alpha\(opacity=(.*)\)/i);return c=d?d[1]/100:1;case"inject":return b.style.zoom=1,parseFloat(c)>=1?"":"alpha(opacity="+parseInt(100*parseFloat(c),10)+")"}else switch(a){case"name":return"opacity";case"extract":return c;case"inject":return c}}},register:function(){function a(a){var b,c=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,d=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;return a=a.replace(c,function(a,b,c,d){return b+b+c+c+d+d}),b=d.exec(a),b?"rgb("+(parseInt(b[1],16)+" "+parseInt(b[2],16)+" "+parseInt(b[3],16))+")":"rgb(0 0 0)"}var b=["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"];9>=o||t.State.isGingerbread||(b=b.concat(["transformPerspective","translateZ","scaleZ","rotateX","rotateY"]));for(var c=0,e=b.length;e>c;c++)!function(){var a=b[c];w.Normalizations.registered[a]=function(b,c,e){switch(b){case"name":return"transform";case"extract":return s.data(c,l).transformCache[a]===d?/^scale/i.test(a)?1:0:s.data(c,l).transformCache[a].replace(/[()]/g,"");case"inject":var f=!1;switch(a.substr(0,a.length-1)){case"translate":f=!/(%|px|em|rem|\d)$/i.test(e);break;case"scal":case"scale":t.State.isAndroid&&s.data(c,l).transformCache[a]===d&&(e=1),f=!/(\d)$/i.test(e);break;case"skew":f=!/(deg|\d)$/i.test(e);break;case"rotate":f=!/(deg|\d)$/i.test(e)}return f||(s.data(c,l).transformCache[a]="("+e+")"),s.data(c,l).transformCache[a]}}}();for(var f=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],c=0,g=f.length;g>c;c++)!function(){var b=f[c];w.Normalizations.registered[b]=function(c,e,f){switch(c){case"name":return b;case"extract":var g;if(w.RegEx.wrappedValueAlreadyExtracted.test(f))g=f;else{var h,i={aqua:"rgb(0, 255, 255);",black:"rgb(0, 0, 0)",blue:"rgb(0, 0, 255)",fuchsia:"rgb(255, 0, 255)",gray:"rgb(128, 128, 128)",green:"rgb(0, 128, 0)",lime:"rgb(0, 255, 0)",maroon:"rgb(128, 0, 0)",navy:"rgb(0, 0, 128)",olive:"rgb(128, 128, 0)",purple:"rgb(128, 0, 128)",red:"rgb(255, 0, 0)",silver:"rgb(192, 192, 192)",teal:"rgb(0, 128, 128)",white:"rgb(255, 255, 255)",yellow:"rgb(255, 255, 0)"};/^[A-z]+$/i.test(f)?h=i[f]!==d?i[f]:i.black:/^#([A-f\d]{3}){1,2}$/i.test(f)?h=a(f):/^rgba?\(/i.test(f)||(h=i.black),g=(h||f).toString().match(w.RegEx.valueUnwrap)[1].replace(/,(\s+)?/g," ")}return 8>=o||3!==g.split(" ").length||(g+=" 1"),g;case"inject":return 8>=o?4===f.split(" ").length&&(f=f.split(/\s+/).slice(0,3).join(" ")):3===f.split(" ").length&&(f+=" 1"),(8>=o?"rgb":"rgba")+"("+f.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")"}}}()}},Names:{camelCase:function(a){return a.replace(/-(\w)/g,function(a,b){return b.toUpperCase()})},prefixCheck:function(a){if(t.State.prefixMatches[a])return[t.State.prefixMatches[a],!0];for(var b=["","Webkit","Moz","ms","O"],c=0,d=b.length;d>c;c++){var e;if(e=0===c?a:b[c]+a.replace(/^\w/,function(a){return a.toUpperCase()}),q(t.State.prefixElement.style[e]))return t.State.prefixMatches[a]=e,[e,!0]}return[a,!1]}},Values:{isCSSNullValue:function(a){return 0==a||/^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(a)},getUnitType:function(a){return/^(rotate|skew)/i.test(a)?"deg":/(^(scale|scaleX|scaleY|scaleZ|opacity|alpha|fillOpacity|flexGrow|flexHeight|zIndex|fontWeight)$)|color/i.test(a)?"":"px"},getDisplayType:function(a){var b=a.tagName.toString().toLowerCase();return/^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(b)?"inline":/^(li)$/i.test(b)?"list-item":/^(tr)$/i.test(b)?"table-row":"block"}},getPropertyValue:function(a,c,e,f){function g(a,c){var e=0;if(8>=o)e=s.css(a,c);else{if(!f){if("height"===c&&"border-box"!==w.getPropertyValue(a,"boxSizing").toString().toLowerCase())return a.offsetHeight-(parseFloat(w.getPropertyValue(a,"borderTopWidth"))||0)-(parseFloat(w.getPropertyValue(a,"borderBottomWidth"))||0)-(parseFloat(w.getPropertyValue(a,"paddingTop"))||0)-(parseFloat(w.getPropertyValue(a,"paddingBottom"))||0);if("width"===c&&"border-box"!==w.getPropertyValue(a,"boxSizing").toString().toLowerCase())return a.offsetWidth-(parseFloat(w.getPropertyValue(a,"borderLeftWidth"))||0)-(parseFloat(w.getPropertyValue(a,"borderRightWidth"))||0)-(parseFloat(w.getPropertyValue(a,"paddingLeft"))||0)-(parseFloat(w.getPropertyValue(a,"paddingRight"))||0)}var h;h=s.data(a,l)===d?b.getComputedStyle(a,null):s.data(a,l).computedStyle?s.data(a,l).computedStyle:s.data(a,l).computedStyle=b.getComputedStyle(a,null),o&&"borderColor"===c&&(c="borderTopColor"),e=9===o&&"filter"===c?h.getPropertyValue(c):h[c],(""===e||null===e)&&(e=a.style[c])}if("auto"===e&&/^(top|right|bottom|left)$/i.test(c)){var i=g(a,"position");("fixed"===i||"absolute"===i&&/top|left/i.test(c))&&(e=s(a).position()[c]+"px")}return e}var h;if(w.Hooks.registered[c]){var i=c,j=w.Hooks.getRoot(i);e===d&&(e=w.getPropertyValue(a,w.Names.prefixCheck(j)[0])),w.Normalizations.registered[j]&&(e=w.Normalizations.registered[j]("extract",a,e)),h=w.Hooks.extractValue(i,e)}else if(w.Normalizations.registered[c]){var k,m;k=w.Normalizations.registered[c]("name",a),"transform"!==k&&(m=g(a,w.Names.prefixCheck(k)[0]),w.Values.isCSSNullValue(m)&&w.Hooks.templates[c]&&(m=w.Hooks.templates[c][1])),h=w.Normalizations.registered[c]("extract",a,m)}return/^[\d-]/.test(h)||(h=g(a,w.Names.prefixCheck(c)[0])),w.Values.isCSSNullValue(h)&&(h=0),t.debug>=2&&console.log("Get "+c+": "+h),h},setPropertyValue:function(a,c,d,e,f){var g=c;if("scroll"===c)f.container?f.container["scroll"+f.direction]=d:"Left"===f.direction?b.scrollTo(d,f.alternateValue):b.scrollTo(f.alternateValue,d);else if(w.Normalizations.registered[c]&&"transform"===w.Normalizations.registered[c]("name",a))w.Normalizations.registered[c]("inject",a,d),g="transform",d=s.data(a,l).transformCache[c];else{if(w.Hooks.registered[c]){var h=c,i=w.Hooks.getRoot(c);e=e||w.getPropertyValue(a,i),d=w.Hooks.injectValue(h,d,e),c=i}if(w.Normalizations.registered[c]&&(d=w.Normalizations.registered[c]("inject",a,d),c=w.Normalizations.registered[c]("name",a)),g=w.Names.prefixCheck(c)[0],8>=o)try{a.style[g]=d}catch(j){console.log("Error setting ["+g+"] to ["+d+"]")}else a.style[g]=d;t.debug>=2&&console.log("Set "+c+" ("+g+"): "+d)}return[g,d]},flushTransformCache:function(a){var b,c,d,e="";for(b in s.data(a,l).transformCache)c=s.data(a,l).transformCache[b],"transformPerspective"!==b?(9===o&&"rotateZ"===b&&(b="rotate"),e+=b+c+" "):d=c;d&&(e="perspective"+d+" "+e),w.setPropertyValue(a,"transform",e)}};w.Hooks.register(),w.Normalizations.register(),t.animate=function(){function a(){function a(){function a(a){var c=d,e=d,h=d;return r(a)?(c=a[0],!r(a[1])&&/^[\d-]/.test(a[1])||f(a[1])?h=a[1]:(q(a[1])||r(a[1]))&&(e=i(a[1],g.duration),a[2]&&(h=a[2]))):c=a,e=e||g.easing,f(c)&&(c=c.call(b,y,x)),f(h)&&(h=h.call(b,y,x)),[c||0,e,h]}function k(a,b){var c,d;return d=(b||0).toString().toLowerCase().replace(/[%A-z]+$/,function(a){return c=a,""}),c||(c=w.Values.getUnitType(a)),[d,c]}function m(){var a={parent:b.parentNode,position:w.getPropertyValue(b,"position"),fontSize:w.getPropertyValue(b,"fontSize")},d=a.position===E.lastPosition&&a.parent===E.lastParent,e=a.fontSize===E.lastFontSize&&a.parent===E.lastParent;E.lastParent=a.parent,E.lastPosition=a.position,E.lastFontSize=a.fontSize,null===E.remToPxRatio&&(E.remToPxRatio=parseFloat(w.getPropertyValue(c.body,"fontSize"))||16);var f={overflowX:null,overflowY:null,boxSizing:null,width:null,minWidth:null,maxWidth:null,height:null,minHeight:null,maxHeight:null,paddingLeft:null},g={},h=10;if(g.remToPxRatio=E.remToPxRatio,o)var i=/^auto$/i.test(b.currentStyle.width),j=/^auto$/i.test(b.currentStyle.height);d&&e||(f.overflowX=w.getPropertyValue(b,"overflowX"),f.overflowY=w.getPropertyValue(b,"overflowY"),f.boxSizing=w.getPropertyValue(b,"boxSizing"),f.width=w.getPropertyValue(b,"width",null,!0),f.minWidth=w.getPropertyValue(b,"minWidth"),f.maxWidth=w.getPropertyValue(b,"maxWidth")||"none",f.height=w.getPropertyValue(b,"height",null,!0),f.minHeight=w.getPropertyValue(b,"minHeight"),f.maxHeight=w.getPropertyValue(b,"maxHeight")||"none",f.paddingLeft=w.getPropertyValue(b,"paddingLeft")),d?(g.percentToPxRatioWidth=E.lastPercentToPxWidth,g.percentToPxRatioHeight=E.lastPercentToPxHeight):(w.setPropertyValue(b,"overflowX","hidden"),w.setPropertyValue(b,"overflowY","hidden"),w.setPropertyValue(b,"boxSizing","content-box"),w.setPropertyValue(b,"width",h+"%"),w.setPropertyValue(b,"minWidth",h+"%"),w.setPropertyValue(b,"maxWidth",h+"%"),w.setPropertyValue(b,"height",h+"%"),w.setPropertyValue(b,"minHeight",h+"%"),w.setPropertyValue(b,"maxHeight",h+"%")),e?g.emToPxRatio=E.lastEmToPx:w.setPropertyValue(b,"paddingLeft",h+"em"),d||(g.percentToPxRatioWidth=E.lastPercentToPxWidth=(parseFloat(w.getPropertyValue(b,"width",null,!0))||1)/h,g.percentToPxRatioHeight=E.lastPercentToPxHeight=(parseFloat(w.getPropertyValue(b,"height",null,!0))||1)/h),e||(g.emToPxRatio=E.lastEmToPx=(parseFloat(w.getPropertyValue(b,"paddingLeft"))||1)/h);for(var k in f)null!==f[k]&&w.setPropertyValue(b,k,f[k]);return o?(i&&w.setPropertyValue(b,"width","auto"),j&&w.setPropertyValue(b,"height","auto")):(w.setPropertyValue(b,"height","auto"),f.height!==w.getPropertyValue(b,"height",null,!0)&&w.setPropertyValue(b,"height",f.height),w.setPropertyValue(b,"width","auto"),f.width!==w.getPropertyValue(b,"width",null,!0)&&w.setPropertyValue(b,"width",f.width)),t.debug>=1&&console.log("Unit ratios: "+JSON.stringify(g),b),g}if(g.begin&&0===y&&g.begin.call(n,n),"scroll"===B){var v,z,A,C=/^x$/i.test(g.axis)?"Left":"Top",D=parseFloat(g.offset)||0;g.container?g.container.jquery||g.container.nodeType?(g.container=g.container[0]||g.container,v=g.container["scroll"+C],A=v+s(b).position()[C.toLowerCase()]+D):g.container=null:(v=t.State.scrollAnchor[t.State["scrollProperty"+C]],z=t.State.scrollAnchor[t.State["scrollProperty"+("Left"===C?"Top":"Left")]],A=s(b).offset()[C.toLowerCase()]+D),h={scroll:{rootPropertyValue:!1,startValue:v,currentValue:v,endValue:A,unitType:"",easing:g.easing,scrollData:{container:g.container,direction:C,alternateValue:z}},element:b}}else if("reverse"===B){if(!s.data(b,l).tweensContainer)return void s.dequeue(b,g.queue);"none"===s.data(b,l).opts.display&&(s.data(b,l).opts.display="block"),s.data(b,l).opts.loop=!1,s.data(b,l).opts.begin=null,s.data(b,l).opts.complete=null,u.easing||delete g.easing,u.duration||delete g.duration,g=s.extend({},s.data(b,l).opts,g);var G=s.extend(!0,{},s.data(b,l).tweensContainer);for(var H in G)if("element"!==H){var I=G[H].startValue;G[H].startValue=G[H].currentValue=G[H].endValue,G[H].endValue=I,u&&(G[H].easing=g.easing)}h=G}else if("start"===B){var G;s.data(b,l).tweensContainer&&s.data(b,l).isAnimating===!0&&(G=s.data(b,l).tweensContainer);for(var J in p){var K=a(p[J]),L=K[0],M=K[1],N=K[2];J=w.Names.camelCase(J);var O=w.Hooks.getRoot(J),P=!1;if(w.Names.prefixCheck(O)[1]!==!1||w.Normalizations.registered[O]!==d){g.display&&"none"!==g.display&&/opacity|filter/.test(J)&&!N&&0!==L&&(N=0),g._cacheValues&&G&&G[J]?(N===d&&(N=G[J].endValue+G[J].unitType),P=s.data(b,l).rootPropertyValueCache[O]):w.Hooks.registered[J]?N===d?(P=w.getPropertyValue(b,O),N=w.getPropertyValue(b,J,P)):P=w.Hooks.templates[O][1]:N===d&&(N=w.getPropertyValue(b,J));var Q,R,S,T;Q=k(J,N),N=Q[0],S=Q[1],Q=k(J,L),L=Q[0].replace(/^([+-\/*])=/,function(a,b){return T=b,""}),R=Q[1],N=parseFloat(N)||0,L=parseFloat(L)||0;var U;if("%"===R&&(/^(fontSize|lineHeight)$/.test(J)?(L/=100,R="em"):/^scale/.test(J)?(L/=100,R=""):/(Red|Green|Blue)$/i.test(J)&&(L=L/100*255,R="")),/[\/*]/.test(T))R=S;else if(S!==R&&0!==N)if(0===L)R=S;else{U=U||m();var V=/margin|padding|left|right|width|text|word|letter/i.test(J)||/X$/.test(J)?"x":"y";switch(S){case"%":N*="x"===V?U.percentToPxRatioWidth:U.percentToPxRatioHeight;break;case"em":N*=U.emToPxRatio;break;case"rem":N*=U.remToPxRatio;break;case"px":}switch(R){case"%":N*=1/("x"===V?U.percentToPxRatioWidth:U.percentToPxRatioHeight);break;case"em":N*=1/U.emToPxRatio;break;case"rem":N*=1/U.remToPxRatio;break;case"px":}}switch(T){case"+":L=N+L;break;case"-":L=N-L;break;case"*":L=N*L;break;case"/":L=N/L}h[J]={rootPropertyValue:P,startValue:N,currentValue:N,endValue:L,unitType:R,easing:M},t.debug&&console.log("tweensContainer ("+J+"): "+JSON.stringify(h[J]),b)}else t.debug&&console.log("Skipping ["+O+"] due to a lack of browser support.")}h.element=b}h.element&&(F.push(h),s.data(b,l).tweensContainer=h,s.data(b,l).opts=g,s.data(b,l).isAnimating=!0,y===x-1?(t.State.calls.length>1e4&&(t.State.calls=e(t.State.calls)),t.State.calls.push([F,n,g]),t.State.isTicking===!1&&(t.State.isTicking=!0,j())):y++)}var b=this,g=s.extend({},t.defaults,u),h={};if("stop"===B)return s.queue(b,q(u)?u:"",[]),!0;switch(s.data(b,l)===d&&s.data(b,l,{isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}}),/^\d/.test(g.delay)&&g.queue!==!1&&s.queue(b,g.queue,function(a){t.velocityQueueEntryFlag=!0,setTimeout(a,parseFloat(g.delay))}),g.duration.toString().toLowerCase()){case"fast":g.duration=200;break;case"normal":g.duration=m;break;case"slow":g.duration=600;break;default:g.duration=parseFloat(g.duration)||1}g.easing=i(g.easing,g.duration),g.begin&&!f(g.begin)&&(g.begin=null),g.progress&&!f(g.progress)&&(g.progress=null),g.complete&&!f(g.complete)&&(g.complete=null),g.display&&(g.display=g.display.toString().toLowerCase()),g.mobileHA=g.mobileHA&&t.State.isMobile&&!t.State.isGingerbread,g.queue===!1?g.delay?setTimeout(a,g.delay):a():s.queue(b,g.queue,function(b){t.velocityQueueEntryFlag=!0,a(b)}),""!==g.queue&&"fx"!==g.queue||"inprogress"===s.queue(b)[0]||s.dequeue(b)}var b,k,n,p,u,v=arguments[0]&&(s.isPlainObject(arguments[0].properties)&&!arguments[0].properties.names||q(arguments[0].properties));if(h(this)?(k=0,n=this,b=this):(k=1,n=v?arguments[0].elements:arguments[0]),n=h(n)?[].slice.call(n):n){v?(p=arguments[0].properties,u=arguments[0].options):(p=arguments[k],u=arguments[k+1]);var x=g(n)||r(n)?n.length:1,y=0;if("stop"!==p&&!s.isPlainObject(u)){var z=k+1;u={};for(var A=z;A<arguments.length;A++)!r(arguments[A])&&/^\d/.test(arguments[A])?u.duration=parseFloat(arguments[A]):q(arguments[A])?u.easing=arguments[A]:!r(arguments[A])||2!==arguments[A].length&&4!==arguments[A].length?f(arguments[A])&&(u.complete=arguments[A]):u.easing=arguments[A]}var B;switch(p){case"scroll":B="scroll";break;case"reverse":B="reverse";break;case"stop":B="stop";break;default:if(!s.isPlainObject(p)||s.isEmptyObject(p)){if(q(p)&&t.Sequences[p]){var C=n,D=u.duration;return u.backwards===!0&&(n=(n.jquery?[].slice.call(n):n).reverse()),s.each(n,function(a,b){parseFloat(u.stagger)&&(u.delay=parseFloat(u.stagger)*a),u.drag&&(u.duration=parseFloat(D)||(/^(callout|transition)/.test(p)?1e3:m),u.duration=Math.max(u.duration*(u.backwards?1-a/x:(a+1)/x),.75*u.duration,200)),t.Sequences[p].call(b,b,u||{},a,x)}),b||C}return console.log("First argument was not a property map, a known action, or a registered sequence. Aborting."),b||n}B="start"}var E={lastParent:null,lastPosition:null,lastFontSize:null,lastPercentToPxWidth:null,lastPercentToPxHeight:null,lastEmToPx:null,remToPxRatio:null},F=[];n.nodeType?a.call(n):s.each(n,function(b,c){c.nodeType&&a.call(c)});var G,H=s.extend({},t.defaults,u);if(H.loop=parseInt(H.loop),G=2*H.loop-1,H.loop)for(var I=0;G>I;I++){var J={delay:H.delay};H.complete&&I===G-1&&(J.complete=H.complete),t.animate(n,"reverse",J)}return b||n}};var x=b.jQuery||b.Zepto;x&&(x.fn.velocity=t.animate,x.fn.velocity.defaults=t.defaults),"undefined"!=typeof define&&define.amd?define(function(){return t}):"undefined"!=typeof module&&module.exports&&(module.exports=t),s.each(["Down","Up"],function(a,b){t.Sequences["slide"+b]=function(a,c){var d=s.extend({},c),e={height:null,marginTop:null,marginBottom:null,paddingTop:null,paddingBottom:null,overflow:null,overflowX:null,overflowY:null},f=d.begin,g=d.complete,h=!1;null!==d.display&&(d.display="Down"===b?d.display||t.CSS.Values.getDisplayType(a):d.display||"none"),d.begin=function(){function c(){a.style.display="block",e.height=t.CSS.getPropertyValue(a,"height"),a.style.height="auto",t.CSS.getPropertyValue(a,"height")===e.height&&(h=!0),t.CSS.setPropertyValue(a,"height",e.height+"px")}if("Down"===b){e.overflow=[t.CSS.getPropertyValue(a,"overflow"),0],e.overflowX=[t.CSS.getPropertyValue(a,"overflowX"),0],e.overflowY=[t.CSS.getPropertyValue(a,"overflowY"),0],a.style.overflow="hidden",a.style.overflowX="visible",a.style.overflowY="hidden",c();for(var d in e)/^overflow/.test(d)||(e[d]=[t.CSS.getPropertyValue(a,d),0]);a.style.display="none"}else{c();for(var d in e)e[d]=[0,t.CSS.getPropertyValue(a,d)];a.style.overflow="hidden",a.style.overflowX="visible",a.style.overflowY="hidden"}f&&f.call(a,a)},d.complete=function(a){var c="Down"===b?0:1;h===!0?e.height[c]="auto":e.height[c]+="px";for(var d in e)a.style[d]=e[d][c];g&&g.call(a,a)},t.animate(a,e,d)}}),s.each(["In","Out"],function(a,b){t.Sequences["fade"+b]=function(a,c,d,e){var f=s.extend({},c),g={opacity:"In"===b?1:0};d!==e-1&&(f.complete=f.begin=null),null!==f.display&&(f.display="In"===b?t.CSS.Values.getDisplayType(a):"none"),t.animate(this,g,f)}})}(window.jQuery||window.Zepto||window,window,document); | tresni/cdnjs | ajax/libs/velocity/0.0.22/jquery.velocity.min.js | JavaScript | mit | 26,839 |
/*
Copyright (c) 2010-2012, CloudMade, Vladimir Agafonkin
Leaflet is an open-source JavaScript library for mobile-friendly interactive maps.
http://leaflet.cloudmade.com
*/
(function(e,t){var n,r;typeof exports!=t+""?n=exports:(r=e.L,n={},n.noConflict=function(){return e.L=r,this},e.L=n),n.version="0.4.5",n.Util={extend:function(e){var t=Array.prototype.slice.call(arguments,1);for(var n=0,r=t.length,i;n<r;n++){i=t[n]||{};for(var s in i)i.hasOwnProperty(s)&&(e[s]=i[s])}return e},bind:function(e,t){var n=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return e.apply(t,n||arguments)}},stamp:function(){var e=0,t="_leaflet_id";return function(n){return n[t]=n[t]||++e,n[t]}}(),limitExecByInterval:function(e,t,n){var r,i;return function s(){var o=arguments;if(r){i=!0;return}r=!0,setTimeout(function(){r=!1,i&&(s.apply(n,o),i=!1)},t),e.apply(n,o)}},falseFn:function(){return!1},formatNum:function(e,t){var n=Math.pow(10,t||5);return Math.round(e*n)/n},splitWords:function(e){return e.replace(/^\s+|\s+$/g,"").split(/\s+/)},setOptions:function(e,t){return e.options=n.Util.extend({},e.options,t),e.options},getParamString:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n+"="+e[n]);return"?"+t.join("&")},template:function(e,t){return e.replace(/\{ *([\w_]+) *\}/g,function(e,n){var r=t[n];if(!t.hasOwnProperty(n))throw Error("No value provided for variable "+e);return r})},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function t(t){var n,r,i=["webkit","moz","o","ms"];for(n=0;n<i.length&&!r;n++)r=e[i[n]+t];return r}function r(t){return e.setTimeout(t,1e3/60)}var i=e.requestAnimationFrame||t("RequestAnimationFrame")||r,s=e.cancelAnimationFrame||t("CancelAnimationFrame")||t("CancelRequestAnimationFrame")||function(t){e.clearTimeout(t)};n.Util.requestAnimFrame=function(t,s,o,u){t=n.Util.bind(t,s);if(!o||i!==r)return i.call(e,t,u);t()},n.Util.cancelAnimFrame=function(t){t&&s.call(e,t)}}(),n.Class=function(){},n.Class.extend=function(e){var t=function(){this.initialize&&this.initialize.apply(this,arguments)},r=function(){};r.prototype=this.prototype;var i=new r;i.constructor=t,t.prototype=i;for(var s in this)this.hasOwnProperty(s)&&s!=="prototype"&&(t[s]=this[s]);return e.statics&&(n.Util.extend(t,e.statics),delete e.statics),e.includes&&(n.Util.extend.apply(null,[i].concat(e.includes)),delete e.includes),e.options&&i.options&&(e.options=n.Util.extend({},i.options,e.options)),n.Util.extend(i,e),t},n.Class.include=function(e){n.Util.extend(this.prototype,e)},n.Class.mergeOptions=function(e){n.Util.extend(this.prototype.options,e)};var i="_leaflet_events";n.Mixin={},n.Mixin.Events={addEventListener:function(e,t,r){var s=this[i]=this[i]||{},o,u,a;if(typeof e=="object"){for(o in e)e.hasOwnProperty(o)&&this.addEventListener(o,e[o],t);return this}e=n.Util.splitWords(e);for(u=0,a=e.length;u<a;u++)s[e[u]]=s[e[u]]||[],s[e[u]].push({action:t,context:r||this});return this},hasEventListeners:function(e){return i in this&&e in this[i]&&this[i][e].length>0},removeEventListener:function(e,t,r){var s=this[i],o,u,a,f,l;if(typeof e=="object"){for(o in e)e.hasOwnProperty(o)&&this.removeEventListener(o,e[o],t);return this}e=n.Util.splitWords(e);for(u=0,a=e.length;u<a;u++)if(this.hasEventListeners(e[u])){f=s[e[u]];for(l=f.length-1;l>=0;l--)(!t||f[l].action===t)&&(!r||f[l].context===r)&&f.splice(l,1)}return this},fireEvent:function(e,t){if(!this.hasEventListeners(e))return this;var r=n.Util.extend({type:e,target:this},t),s=this[i][e].slice();for(var o=0,u=s.length;o<u;o++)s[o].action.call(s[o].context||this,r);return this}},n.Mixin.Events.on=n.Mixin.Events.addEventListener,n.Mixin.Events.off=n.Mixin.Events.removeEventListener,n.Mixin.Events.fire=n.Mixin.Events.fireEvent,function(){var r=navigator.userAgent.toLowerCase(),i=!!e.ActiveXObject,s=i&&!e.XMLHttpRequest,o=r.indexOf("webkit")!==-1,u=r.indexOf("gecko")!==-1,a=r.indexOf("chrome")!==-1,f=e.opera,l=r.indexOf("android")!==-1,c=r.search("android [23]")!==-1,h=typeof orientation!=t+""?!0:!1,p=document.documentElement,d=i&&"transition"in p.style,v=o&&"WebKitCSSMatrix"in e&&"m11"in new e.WebKitCSSMatrix,m=u&&"MozPerspective"in p.style,g=f&&"OTransition"in p.style,y=!e.L_NO_TOUCH&&function(){var e="ontouchstart";if(e in p)return!0;var t=document.createElement("div"),n=!1;return t.setAttribute?(t.setAttribute(e,"return;"),typeof t[e]=="function"&&(n=!0),t.removeAttribute(e),t=null,n):!1}(),b="devicePixelRatio"in e&&e.devicePixelRatio>1||"matchMedia"in e&&e.matchMedia("(min-resolution:144dpi)").matches;n.Browser={ua:r,ie:i,ie6:s,webkit:o,gecko:u,opera:f,android:l,android23:c,chrome:a,ie3d:d,webkit3d:v,gecko3d:m,opera3d:g,any3d:!e.L_DISABLE_3D&&(d||v||m||g),mobile:h,mobileWebkit:h&&o,mobileWebkit3d:h&&v,mobileOpera:h&&f,touch:y,retina:b}}(),n.Point=function(e,t,n){this.x=n?Math.round(e):e,this.y=n?Math.round(t):t},n.Point.prototype={add:function(e){return this.clone()._add(n.point(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(n.point(e))},_subtract:function(e){return this.x-=e.x,this.y-=e.y,this},divideBy:function(e,t){return new n.Point(this.x/e,this.y/e,t)},multiplyBy:function(e,t){return new n.Point(this.x*e,this.y*e,t)},distanceTo:function(e){e=n.point(e);var t=e.x-this.x,r=e.y-this.y;return Math.sqrt(t*t+r*r)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},clone:function(){return new n.Point(this.x,this.y)},toString:function(){return"Point("+n.Util.formatNum(this.x)+", "+n.Util.formatNum(this.y)+")"}},n.point=function(e,t,r){return e instanceof n.Point?e:e instanceof Array?new n.Point(e[0],e[1]):isNaN(e)?e:new n.Point(e,t,r)},n.Bounds=n.Class.extend({initialize:function(e,t){if(!e)return;var n=t?[e,t]:e;for(var r=0,i=n.length;r<i;r++)this.extend(n[r])},extend:function(e){return e=n.point(e),!this.min&&!this.max?(this.min=e.clone(),this.max=e.clone()):(this.min.x=Math.min(e.x,this.min.x),this.max.x=Math.max(e.x,this.max.x),this.min.y=Math.min(e.y,this.min.y),this.max.y=Math.max(e.y,this.max.y)),this},getCenter:function(e){return new n.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,e)},getBottomLeft:function(){return new n.Point(this.min.x,this.max.y)},getTopRight:function(){return new n.Point(this.max.x,this.min.y)},contains:function(e){var t,r;return typeof e[0]=="number"||e instanceof n.Point?e=n.point(e):e=n.bounds(e),e instanceof n.Bounds?(t=e.min,r=e.max):t=r=e,t.x>=this.min.x&&r.x<=this.max.x&&t.y>=this.min.y&&r.y<=this.max.y},intersects:function(e){e=n.bounds(e);var t=this.min,r=this.max,i=e.min,s=e.max,o=s.x>=t.x&&i.x<=r.x,u=s.y>=t.y&&i.y<=r.y;return o&&u}}),n.bounds=function(e,t){return!e||e instanceof n.Bounds?e:new n.Bounds(e,t)},n.Transformation=n.Class.extend({initialize:function(e,t,n,r){this._a=e,this._b=t,this._c=n,this._d=r},transform:function(e,t){return this._transform(e.clone(),t)},_transform:function(e,t){return t=t||1,e.x=t*(this._a*e.x+this._b),e.y=t*(this._c*e.y+this._d),e},untransform:function(e,t){return t=t||1,new n.Point((e.x/t-this._b)/this._a,(e.y/t-this._d)/this._c)}}),n.DomUtil={get:function(e){return typeof e=="string"?document.getElementById(e):e},getStyle:function(e,t){var n=e.style[t];!n&&e.currentStyle&&(n=e.currentStyle[t]);if(!n||n==="auto"){var r=document.defaultView.getComputedStyle(e,null);n=r?r[t]:null}return n==="auto"?null:n},getViewportOffset:function(e){var t=0,r=0,i=e,s=document.body;do{t+=i.offsetTop||0,r+=i.offsetLeft||0;if(i.offsetParent===s&&n.DomUtil.getStyle(i,"position")==="absolute")break;if(n.DomUtil.getStyle(i,"position")==="fixed"){t+=s.scrollTop||0,r+=s.scrollLeft||0;break}i=i.offsetParent}while(i);i=e;do{if(i===s)break;t-=i.scrollTop||0,r-=i.scrollLeft||0,i=i.parentNode}while(i);return new n.Point(r,t)},create:function(e,t,n){var r=document.createElement(e);return r.className=t,n&&n.appendChild(r),r},disableTextSelection:function(){document.selection&&document.selection.empty&&document.selection.empty(),this._onselectstart||(this._onselectstart=document.onselectstart,document.onselectstart=n.Util.falseFn)},enableTextSelection:function(){document.onselectstart=this._onselectstart,this._onselectstart=null},hasClass:function(e,t){return e.className.length>0&&RegExp("(^|\\s)"+t+"(\\s|$)").test(e.className)},addClass:function(e,t){n.DomUtil.hasClass(e,t)||(e.className+=(e.className?" ":"")+t)},removeClass:function(e,t){function n(e,n){return n===t?"":e}e.className=e.className.replace(/(\S+)\s*/g,n).replace(/(^\s+|\s+$)/,"")},setOpacity:function(e,t){if("opacity"in e.style)e.style.opacity=t;else if(n.Browser.ie){var r=!1,i="DXImageTransform.Microsoft.Alpha";try{r=e.filters.item(i)}catch(s){}t=Math.round(t*100),r?(r.Enabled=t!==100,r.Opacity=t):e.style.filter+=" progid:"+i+"(opacity="+t+")"}},testProp:function(e){var t=document.documentElement.style;for(var n=0;n<e.length;n++)if(e[n]in t)return e[n];return!1},getTranslateString:function(e){var t=n.Browser.webkit3d,r="translate"+(t?"3d":"")+"(",i=(t?",0":"")+")";return r+e.x+"px,"+e.y+"px"+i},getScaleString:function(e,t){var r=n.DomUtil.getTranslateString(t.add(t.multiplyBy(-1*e))),i=" scale("+e+") ";return r+i},setPosition:function(e,t,r){e._leaflet_pos=t,!r&&n.Browser.any3d?(e.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(t),n.Browser.mobileWebkit3d&&(e.style.WebkitBackfaceVisibility="hidden")):(e.style.left=t.x+"px",e.style.top=t.y+"px")},getPosition:function(e){return e._leaflet_pos}},n.Util.extend(n.DomUtil,{TRANSITION:n.DomUtil.testProp(["transition","webkitTransition","OTransition","MozTransition","msTransition"]),TRANSFORM:n.DomUtil.testProp(["transform","WebkitTransform","OTransform","MozTransform","msTransform"])}),n.LatLng=function(e,t,n){var r=parseFloat(e),i=parseFloat(t);if(isNaN(r)||isNaN(i))throw Error("Invalid LatLng object: ("+e+", "+t+")");n!==!0&&(r=Math.max(Math.min(r,90),-90),i=(i+180)%360+(i<-180||i===180?180:-180)),this.lat=r,this.lng=i},n.Util.extend(n.LatLng,{DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,MAX_MARGIN:1e-9}),n.LatLng.prototype={equals:function(e){if(!e)return!1;e=n.latLng(e);var t=Math.max(Math.abs(this.lat-e.lat),Math.abs(this.lng-e.lng));return t<=n.LatLng.MAX_MARGIN},toString:function(){return"LatLng("+n.Util.formatNum(this.lat)+", "+n.Util.formatNum(this.lng)+")"},distanceTo:function(e){e=n.latLng(e);var t=6378137,r=n.LatLng.DEG_TO_RAD,i=(e.lat-this.lat)*r,s=(e.lng-this.lng)*r,o=this.lat*r,u=e.lat*r,a=Math.sin(i/2),f=Math.sin(s/2),l=a*a+f*f*Math.cos(o)*Math.cos(u);return t*2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}},n.latLng=function(e,t,r){return e instanceof n.LatLng?e:e instanceof Array?new n.LatLng(e[0],e[1]):isNaN(e)?e:new n.LatLng(e,t,r)},n.LatLngBounds=n.Class.extend({initialize:function(e,t){if(!e)return;var n=t?[e,t]:e;for(var r=0,i=n.length;r<i;r++)this.extend(n[r])},extend:function(e){return typeof e[0]=="number"||e instanceof n.LatLng?e=n.latLng(e):e=n.latLngBounds(e),e instanceof n.LatLng?!this._southWest&&!this._northEast?(this._southWest=new n.LatLng(e.lat,e.lng,!0),this._northEast=new n.LatLng(e.lat,e.lng,!0)):(this._southWest.lat=Math.min(e.lat,this._southWest.lat),this._southWest.lng=Math.min(e.lng,this._southWest.lng),this._northEast.lat=Math.max(e.lat,this._northEast.lat),this._northEast.lng=Math.max(e.lng,this._northEast.lng)):e instanceof n.LatLngBounds&&(this.extend(e._southWest),this.extend(e._northEast)),this},pad:function(e){var t=this._southWest,r=this._northEast,i=Math.abs(t.lat-r.lat)*e,s=Math.abs(t.lng-r.lng)*e;return new n.LatLngBounds(new n.LatLng(t.lat-i,t.lng-s),new n.LatLng(r.lat+i,r.lng+s))},getCenter:function(){return new n.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new n.LatLng(this._northEast.lat,this._southWest.lng,!0)},getSouthEast:function(){return new n.LatLng(this._southWest.lat,this._northEast.lng,!0)},contains:function(e){typeof e[0]=="number"||e instanceof n.LatLng?e=n.latLng(e):e=n.latLngBounds(e);var t=this._southWest,r=this._northEast,i,s;return e instanceof n.LatLngBounds?(i=e.getSouthWest(),s=e.getNorthEast()):i=s=e,i.lat>=t.lat&&s.lat<=r.lat&&i.lng>=t.lng&&s.lng<=r.lng},intersects:function(e){e=n.latLngBounds(e);var t=this._southWest,r=this._northEast,i=e.getSouthWest(),s=e.getNorthEast(),o=s.lat>=t.lat&&i.lat<=r.lat,u=s.lng>=t.lng&&i.lng<=r.lng;return o&&u},toBBoxString:function(){var e=this._southWest,t=this._northEast;return[e.lng,e.lat,t.lng,t.lat].join(",")},equals:function(e){return e?(e=n.latLngBounds(e),this._southWest.equals(e.getSouthWest())&&this._northEast.equals(e.getNorthEast())):!1}}),n.latLngBounds=function(e,t){return!e||e instanceof n.LatLngBounds?e:new n.LatLngBounds(e,t)},n.Projection={},n.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(e){var t=n.LatLng.DEG_TO_RAD,r=this.MAX_LATITUDE,i=Math.max(Math.min(r,e.lat),-r),s=e.lng*t,o=i*t;return o=Math.log(Math.tan(Math.PI/4+o/2)),new n.Point(s,o)},unproject:function(e){var t=n.LatLng.RAD_TO_DEG,r=e.x*t,i=(2*Math.atan(Math.exp(e.y))-Math.PI/2)*t;return new n.LatLng(i,r,!0)}},n.Projection.LonLat={project:function(e){return new n.Point(e.lng,e.lat)},unproject:function(e){return new n.LatLng(e.y,e.x,!0)}},n.CRS={latLngToPoint:function(e,t){var n=this.projection.project(e),r=this.scale(t);return this.transformation._transform(n,r)},pointToLatLng:function(e,t){var n=this.scale(t),r=this.transformation.untransform(e,n);return this.projection.unproject(r)},project:function(e){return this.projection.project(e)},scale:function(e){return 256*Math.pow(2,e)}},n.CRS.EPSG3857=n.Util.extend({},n.CRS,{code:"EPSG:3857",projection:n.Projection.SphericalMercator,transformation:new n.Transformation(.5/Math.PI,.5,-0.5/Math.PI,.5),project:function(e){var t=this.projection.project(e),n=6378137;return t.multiplyBy(n)}}),n.CRS.EPSG900913=n.Util.extend({},n.CRS.EPSG3857,{code:"EPSG:900913"}),n.CRS.EPSG4326=n.Util.extend({},n.CRS,{code:"EPSG:4326",projection:n.Projection.LonLat,transformation:new n.Transformation(1/360,.5,-1/360,.5)}),n.Map=n.Class.extend({includes:n.Mixin.Events,options:{crs:n.CRS.EPSG3857,fadeAnimation:n.DomUtil.TRANSITION&&!n.Browser.android23,trackResize:!0,markerZoomAnimation:n.DomUtil.TRANSITION&&n.Browser.any3d},initialize:function(e,r){r=n.Util.setOptions(this,r),this._initContainer(e),this._initLayout(),this._initHooks(),this._initEvents(),r.maxBounds&&this.setMaxBounds(r.maxBounds),r.center&&r.zoom!==t&&this.setView(n.latLng(r.center),r.zoom,!0),this._initLayers(r.layers)},setView:function(e,t){return this._resetView(n.latLng(e),this._limitZoom(t)),this},setZoom:function(e){return this.setView(this.getCenter(),e)},zoomIn:function(){return this.setZoom(this._zoom+1)},zoomOut:function(){return this.setZoom(this._zoom-1)},fitBounds:function(e){var t=this.getBoundsZoom(e);return this.setView(n.latLngBounds(e).getCenter(),t)},fitWorld:function(){var e=new n.LatLng(-60,-170),t=new n.LatLng(85,179);return this.fitBounds(new n.LatLngBounds(e,t))},panTo:function(e){return this.setView(e,this._zoom)},panBy:function(e){return this.fire("movestart"),this._rawPanBy(n.point(e)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(e){e=n.latLngBounds(e),this.options.maxBounds=e;if(!e)return this._boundsMinZoom=null,this;var t=this.getBoundsZoom(e,!0);return this._boundsMinZoom=t,this._loaded&&(this._zoom<t?this.setView(e.getCenter(),t):this.panInsideBounds(e)),this},panInsideBounds:function(e){e=n.latLngBounds(e);var t=this.getBounds(),r=this.project(t.getSouthWest()),i=this.project(t.getNorthEast()),s=this.project(e.getSouthWest()),o=this.project(e.getNorthEast()),u=0,a=0;return i.y<o.y&&(a=o.y-i.y),i.x>o.x&&(u=o.x-i.x),r.y>s.y&&(a=s.y-r.y),r.x<s.x&&(u=s.x-r.x),this.panBy(new n.Point(u,a,!0))},addLayer:function(e){var t=n.Util.stamp(e);if(this._layers[t])return this;this._layers[t]=e,e.options&&!isNaN(e.options.maxZoom)&&(this._layersMaxZoom=Math.max(this._layersMaxZoom||0,e.options.maxZoom)),e.options&&!isNaN(e.options.minZoom)&&(this._layersMinZoom=Math.min(this._layersMinZoom||Infinity,e.options.minZoom)),this.options.zoomAnimation&&n.TileLayer&&e instanceof n.TileLayer&&(this._tileLayersNum++,this._tileLayersToLoad++,e.on("load",this._onTileLayerLoad,this));var r=function(){e.onAdd(this),this.fire("layeradd",{layer:e})};return this._loaded?r.call(this):this.on("load",r,this),this},removeLayer:function(e){var t=n.Util.stamp(e);if(!this._layers[t])return;return e.onRemove(this),delete this._layers[t],this.options.zoomAnimation&&n.TileLayer&&e instanceof n.TileLayer&&(this._tileLayersNum--,this._tileLayersToLoad--,e.off("load",this._onTileLayerLoad,this)),this.fire("layerremove",{layer:e})},hasLayer:function(e){var t=n.Util.stamp(e);return this._layers.hasOwnProperty(t)},invalidateSize:function(e){var t=this.getSize();this._sizeChanged=!0,this.options.maxBounds&&this.setMaxBounds(this.options.maxBounds);if(!this._loaded)return this;var r=t.subtract(this.getSize()).divideBy(2,!0);return e===!0?this.panBy(r):(this._rawPanBy(r),this.fire("move"),clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(n.Util.bind(this.fire,this,"moveend"),200)),this},addHandler:function(e,t){if(!t)return;return this[e]=new t(this),this.options[e]&&this[e].enable(),this},getCenter:function(){return this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var e=this.getPixelBounds(),t=this.unproject(e.getBottomLeft()),r=this.unproject(e.getTopRight());return new n.LatLngBounds(t,r)},getMinZoom:function(){var e=this.options.minZoom||0,t=this._layersMinZoom||0,n=this._boundsMinZoom||0;return Math.max(e,t,n)},getMaxZoom:function(){var e=this.options.maxZoom===t?Infinity:this.options.maxZoom,n=this._layersMaxZoom===t?Infinity:this._layersMaxZoom;return Math.min(e,n)},getBoundsZoom:function(e,t){e=n.latLngBounds(e);var r=this.getSize(),i=this.options.minZoom||0,s=this.getMaxZoom(),o=e.getNorthEast(),u=e.getSouthWest(),a,f,l,c=!0;t&&i--;do i++,f=this.project(o,i),l=this.project(u,i),a=new n.Point(Math.abs(f.x-l.x),Math.abs(l.y-f.y)),t?c=a.x<r.x||a.y<r.y:c=a.x<=r.x&&a.y<=r.y;while(c&&i<=s);return c&&t?null:t?i:i-1},getSize:function(){if(!this._size||this._sizeChanged)this._size=new n.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1;return this._size},getPixelBounds:function(){var e=this._getTopLeftPoint();return new n.Bounds(e,e.add(this.getSize()))},getPixelOrigin:function(){return this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e){var t=this.options.crs;return t.scale(e)/t.scale(this._zoom)},getScaleZoom:function(e){return this._zoom+Math.log(e)/Math.LN2},project:function(e,r){return r=r===t?this._zoom:r,this.options.crs.latLngToPoint(n.latLng(e),r)},unproject:function(e,r){return r=r===t?this._zoom:r,this.options.crs.pointToLatLng(n.point(e),r)},layerPointToLatLng:function(e){var t=n.point(e).add(this._initialTopLeftPoint);return this.unproject(t)},latLngToLayerPoint:function(e){var t=this.project(n.latLng(e))._round();return t._subtract(this._initialTopLeftPoint)},containerPointToLayerPoint:function(e){return n.point(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return n.point(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var t=this.containerPointToLayerPoint(n.point(e));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(n.latLng(e)))},mouseEventToContainerPoint:function(e){return n.DomEvent.getMousePosition(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(e){var t=this._container=n.DomUtil.get(e);if(t._leaflet)throw Error("Map container is already initialized.");t._leaflet=!0},_initLayout:function(){var e=this._container;e.innerHTML="",n.DomUtil.addClass(e,"leaflet-container"),n.Browser.touch&&n.DomUtil.addClass(e,"leaflet-touch"),this.options.fadeAnimation&&n.DomUtil.addClass(e,"leaflet-fade-anim");var t=n.DomUtil.getStyle(e,"position");t!=="absolute"&&t!=="relative"&&t!=="fixed"&&(e.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._mapPane=e.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=e.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),this._objectsPane=e.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),e.shadowPane=this._createPane("leaflet-shadow-pane"),e.overlayPane=this._createPane("leaflet-overlay-pane"),e.markerPane=this._createPane("leaflet-marker-pane"),e.popupPane=this._createPane("leaflet-popup-pane");var t=" leaflet-zoom-hide";this.options.markerZoomAnimation||(n.DomUtil.addClass(e.markerPane,t),n.DomUtil.addClass(e.shadowPane,t),n.DomUtil.addClass(e.popupPane,t))},_createPane:function(e,t){return n.DomUtil.create("div",e,t||this._objectsPane)},_initializers:[],_initHooks:function(){var e,t;for(e=0,t=this._initializers.length;e<t;e++)this._initializers[e].call(this)},_initLayers:function(e){e=e?e instanceof Array?e:[e]:[],this._layers={},this._tileLayersNum=0;var t,n;for(t=0,n=e.length;t<n;t++)this.addLayer(e[t])},_resetView:function(e,t,r,i){var s=this._zoom!==t;i||(this.fire("movestart"),s&&this.fire("zoomstart")),this._zoom=t,this._initialTopLeftPoint=this._getNewTopLeftPoint(e),r?this._initialTopLeftPoint._add(this._getMapPanePos()):n.DomUtil.setPosition(this._mapPane,new n.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum,this.fire("viewreset",{hard:!r}),this.fire("move"),(s||i)&&this.fire("zoomend"),this.fire("moveend",{hard:!r}),this._loaded||(this._loaded=!0,this.fire("load"))},_rawPanBy:function(e){n.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(e))},_initEvents:function(){if(!n.DomEvent)return;n.DomEvent.on(this._container,"click",this._onMouseClick,this);var t=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"],r,i;for(r=0,i=t.length;r<i;r++)n.DomEvent.on(this._container,t[r],this._fireMouseEvent,this);this.options.trackResize&&n.DomEvent.on(e,"resize",this._onResize,this)},_onResize:function(){n.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=n.Util.requestAnimFrame(this.invalidateSize,this,!1,this._container)},_onMouseClick:function(e){if(!this._loaded||this.dragging&&this.dragging.moved())return;this.fire("preclick"),this._fireMouseEvent(e)},_fireMouseEvent:function(e){if(!this._loaded)return;var t=e.type;t=t==="mouseenter"?"mouseover":t==="mouseleave"?"mouseout":t;if(!this.hasEventListeners(t))return;t==="contextmenu"&&n.DomEvent.preventDefault(e);var r=this.mouseEventToContainerPoint(e),i=this.containerPointToLayerPoint(r),s=this.layerPointToLatLng(i);this.fire(t,{latlng:s,layerPoint:i,containerPoint:r,originalEvent:e})},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this._tileBg&&(clearTimeout(this._clearTileBgTimer),this._clearTileBgTimer=setTimeout(n.Util.bind(this._clearTileBg,this),500))},_getMapPanePos:function(){return n.DomUtil.getPosition(this._mapPane)},_getTopLeftPoint:function(){if(!this._loaded)throw Error("Set map center and zoom first.");return this._initialTopLeftPoint.subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(e,t){var n=this.getSize().divideBy(2);return this.project(e,t)._subtract(n)._round()},_latLngToNewLayerPoint:function(e,t,n){var r=this._getNewTopLeftPoint(n,t).add(this._getMapPanePos());return this.project(e,t)._subtract(r)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize().divideBy(2))},_getCenterOffset:function(e){return this.latLngToLayerPoint(e).subtract(this._getCenterLayerPoint())},_limitZoom:function(e){var t=this.getMinZoom(),n=this.getMaxZoom();return Math.max(t,Math.min(n,e))}}),n.Map.addInitHook=function(e){var t=Array.prototype.slice.call(arguments,1),n=typeof e=="function"?e:function(){this[e].apply(this,t)};this.prototype._initializers.push(n)},n.map=function(e,t){return new n.Map(e,t)},n.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.3142,R_MAJOR:6378137,project:function(e){var t=n.LatLng.DEG_TO_RAD,r=this.MAX_LATITUDE,i=Math.max(Math.min(r,e.lat),-r),s=this.R_MAJOR,o=this.R_MINOR,u=e.lng*t*s,a=i*t,f=o/s,l=Math.sqrt(1-f*f),c=l*Math.sin(a);c=Math.pow((1-c)/(1+c),l*.5);var h=Math.tan(.5*(Math.PI*.5-a))/c;return a=-o*Math.log(h),new n.Point(u,a)},unproject:function(e){var t=n.LatLng.RAD_TO_DEG,r=this.R_MAJOR,i=this.R_MINOR,s=e.x*t/r,o=i/r,u=Math.sqrt(1-o*o),a=Math.exp(-e.y/i),f=Math.PI/2-2*Math.atan(a),l=15,c=1e-7,h=l,p=.1,d;while(Math.abs(p)>c&&--h>0)d=u*Math.sin(f),p=Math.PI/2-2*Math.atan(a*Math.pow((1-d)/(1+d),.5*u))-f,f+=p;return new n.LatLng(f*t,s,!0)}},n.CRS.EPSG3395=n.Util.extend({},n.CRS,{code:"EPSG:3395",projection:n.Projection.Mercator,transformation:function(){var e=n.Projection.Mercator,t=e.R_MAJOR,r=e.R_MINOR;return new n.Transformation(.5/(Math.PI*t),.5,-0.5/(Math.PI*r),.5)}()}),n.TileLayer=n.Class.extend({includes:n.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:n.Browser.mobile,updateWhenIdle:n.Browser.mobile},initialize:function(e,t){t=n.Util.setOptions(this,t),t.detectRetina&&n.Browser.retina&&t.maxZoom>0&&(t.tileSize=Math.floor(t.tileSize/2),t.zoomOffset++,t.minZoom>0&&t.minZoom--,this.options.maxZoom--),this._url=e;var r=this.options.subdomains;typeof r=="string"&&(this.options.subdomains=r.split(""))},onAdd:function(e){this._map=e,this._initContainer(),this._createTileProto(),e.on({viewreset:this._resetCallback,moveend:this._update},this),this.options.updateWhenIdle||(this._limitedUpdate=n.Util.limitExecByInterval(this._update,150,this),e.on("move",this._limitedUpdate,this)),this._reset(),this._update()},addTo:function(e){return e.addLayer(this),this},onRemove:function(e){e._panes.tilePane.removeChild(this._container),e.off({viewreset:this._resetCallback,moveend:this._update},this),this.options.updateWhenIdle||e.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var e=this._map._panes.tilePane;return this._container&&(e.appendChild(this._container),this._setAutoZIndex(e,Math.max)),this},bringToBack:function(){var e=this._map._panes.tilePane;return this._container&&(e.insertBefore(this._container,e.firstChild),this._setAutoZIndex(e,Math.min)),this},getAttribution:function(){return this.options.attribution},setOpacity:function(e){return this.options.opacity=e,this._map&&this._updateOpacity(),this},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},setUrl:function(e,t){return this._url=e,t||this.redraw(),this},redraw:function(){return this._map&&(this._map._panes.tilePane.empty=!1,this._reset(!0),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==t&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(e,t){var n=e.getElementsByClassName("leaflet-layer"),r=-t(Infinity,-Infinity),i;for(var s=0,o=n.length;s<o;s++)n[s]!==this._container&&(i=parseInt(n[s].style.zIndex,10),isNaN(i)||(r=t(r,i)));this._container.style.zIndex=isFinite(r)?r+t(1,-1):""},_updateOpacity:function(){n.DomUtil.setOpacity(this._container,this.options.opacity);var e,t=this._tiles;if(n.Browser.webkit)for(e in t)t.hasOwnProperty(e)&&(t[e].style.webkitTransform+=" translate(0,0)")},_initContainer:function(){var e=this._map._panes.tilePane;if(!this._container||e.empty)this._container=n.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),e.appendChild(this._container),this.options.opacity<1&&this._updateOpacity()},_resetCallback:function(e){this._reset(e.hard)},_reset:function(e){var t,n=this._tiles;for(t in n)n.hasOwnProperty(t)&&this.fire("tileunload",{tile:n[t]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),e&&this._container&&(this._container.innerHTML=""),this._initContainer()},_update:function(e){if(this._map._panTransition&&this._map._panTransition._inProgress)return;var t=this._map.getPixelBounds(),r=this._map.getZoom(),i=this.options.tileSize;if(r>this.options.maxZoom||r<this.options.minZoom)return;var s=new n.Point(Math.floor(t.min.x/i),Math.floor(t.min.y/i)),o=new n.Point(Math.floor(t.max.x/i),Math.floor(t.max.y/i)),u=new n.Bounds(s,o);this._addTilesFromCenterOut(u),(this.options.unloadInvisibleTiles||this.options.reuseTiles)&&this._removeOtherTiles(u)},_addTilesFromCenterOut:function(e){var t=[],r=e.getCenter(),i,s,o;for(i=e.min.y;i<=e.max.y;i++)for(s=e.min.x;s<=e.max.x;s++)o=new n.Point(s,i),this._tileShouldBeLoaded(o)&&t.push(o);var u=t.length;if(u===0)return;t.sort(function(e,t){return e.distanceTo(r)-t.distanceTo(r)});var a=document.createDocumentFragment();this._tilesToLoad||this.fire("loading"),this._tilesToLoad+=u;for(s=0;s<u;s++)this._addTile(t[s],a);this._container.appendChild(a)},_tileShouldBeLoaded:function(e){if(e.x+":"+e.y in this._tiles)return!1;if(!this.options.continuousWorld){var t=this._getWrapTileNum();if(this.options.noWrap&&(e.x<0||e.x>=t)||e.y<0||e.y>=t)return!1}return!0},_removeOtherTiles:function(e){var t,n,r,i;for(i in this._tiles)this._tiles.hasOwnProperty(i)&&(t=i.split(":"),n=parseInt(t[0],10),r=parseInt(t[1],10),(n<e.min.x||n>e.max.x||r<e.min.y||r>e.max.y)&&this._removeTile(i))},_removeTile:function(e){var t=this._tiles[e];this.fire("tileunload",{tile:t,url:t.src}),this.options.reuseTiles?(n.DomUtil.removeClass(t,"leaflet-tile-loaded"),this._unusedTiles.push(t)):t.parentNode===this._container&&this._container.removeChild(t),n.Browser.android||(t.src=n.Util.emptyImageUrl),delete this._tiles[e]},_addTile:function(e,t){var r=this._getTilePos(e),i=this._getTile();n.DomUtil.setPosition(i,r,n.Browser.chrome||n.Browser.android23),this._tiles[e.x+":"+e.y]=i,this._loadTile(i,e),i.parentNode!==this._container&&t.appendChild(i)},_getZoomForUrl:function(){var e=this.options,t=this._map.getZoom();return e.zoomReverse&&(t=e.maxZoom-t),t+e.zoomOffset},_getTilePos:function(e){var t=this._map.getPixelOrigin(),n=this.options.tileSize;return e.multiplyBy(n).subtract(t)},getTileUrl:function(e){return this._adjustTilePoint(e),n.Util.template(this._url,n.Util.extend({s:this._getSubdomain(e),z:this._getZoomForUrl(),x:e.x,y:e.y},this.options))},_getWrapTileNum:function(){return Math.pow(2,this._getZoomForUrl())},_adjustTilePoint:function(e){var t=this._getWrapTileNum();!this.options.continuousWorld&&!this.options.noWrap&&(e.x=(e.x%t+t)%t),this.options.tms&&(e.y=t-e.y-1)},_getSubdomain:function(e){var t=(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[t]},_createTileProto:function(){var e=this._tileImg=n.DomUtil.create("img","leaflet-tile");e.galleryimg="no";var t=this.options.tileSize;e.style.width=t+"px",e.style.height=t+"px"},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var e=this._unusedTiles.pop();return this._resetTile(e),e}return this._createTile()},_resetTile:function(e){},_createTile:function(){var e=this._tileImg.cloneNode(!1);return e.onselectstart=e.onmousemove=n.Util.falseFn,e},_loadTile:function(e,t){e._layer=this,e.onload=this._tileOnLoad,e.onerror=this._tileOnError,e.src=this.getTileUrl(t)},_tileLoaded:function(){this._tilesToLoad--,this._tilesToLoad||this.fire("load")},_tileOnLoad:function(e){var t=this._layer;this.src!==n.Util.emptyImageUrl&&(n.DomUtil.addClass(this,"leaflet-tile-loaded"),t.fire("tileload",{tile:this,url:this.src})),t._tileLoaded()},_tileOnError:function(e){var t=this._layer;t.fire("tileerror",{tile:this,url:this.src});var n=t.options.errorTileUrl;n&&(this.src=n),t._tileLoaded()}}),n.tileLayer=function(e,t){return new n.TileLayer(e,t)},n.TileLayer.WMS=n.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(e,t){this._url=e;var r=n.Util.extend({},this.defaultWmsParams);t.detectRetina&&n.Browser.retina?r.width=r.height=this.options.tileSize*2:r.width=r.height=this.options.tileSize;for(var i in t)this.options.hasOwnProperty(i)||(r[i]=t[i]);this.wmsParams=r,n.Util.setOptions(this,t)},onAdd:function(e){var t=parseFloat(this.wmsParams.version)>=1.3?"crs":"srs";this.wmsParams[t]=e.options.crs.code,n.TileLayer.prototype.onAdd.call(this,e)},getTileUrl:function(e,t){var r=this._map,i=r.options.crs,s=this.options.tileSize,o=e.multiplyBy(s),u=o.add(new n.Point(s,s)),a=i.project(r.unproject(o,t)),f=i.project(r.unproject(u,t)),l=[a.x,f.y,f.x,a.y].join(","),c=n.Util.template(this._url,{s:this._getSubdomain(e)});return c+n.Util.getParamString(this.wmsParams)+"&bbox="+l},setParams:function(e,t){return n.Util.extend(this.wmsParams,e),t||this.redraw(),this}}),n.tileLayer.wms=function(e,t){return new n.TileLayer.WMS(e,t)},n.TileLayer.Canvas=n.TileLayer.extend({options:{async:!1},initialize:function(e){n.Util.setOptions(this,e)},redraw:function(){var e,t=this._tiles;for(e in t)t.hasOwnProperty(e)&&this._redrawTile(t[e])},_redrawTile:function(e){this.drawTile(e,e._tilePoint,e._zoom)},_createTileProto:function(){var e=this._canvasProto=n.DomUtil.create("canvas","leaflet-tile"),t=this.options.tileSize;e.width=t,e.height=t},_createTile:function(){var e=this._canvasProto.cloneNode(!1);return e.onselectstart=e.onmousemove=n.Util.falseFn,e},_loadTile:function(e,t,n){e._layer=this,e._tilePoint=t,e._zoom=n,this.drawTile(e,t,n),this.options.async||this.tileDrawn(e)},drawTile:function(e,t,n){},tileDrawn:function(e){this._tileOnLoad.call(e)}}),n.tileLayer.canvas=function(e){return new n.TileLayer.Canvas(e)},n.ImageOverlay=n.Class.extend({includes:n.Mixin.Events,options:{opacity:1},initialize:function(e,t,r){this._url=e,this._bounds=n.latLngBounds(t),n.Util.setOptions(this,r)},onAdd:function(e){this._map=e,this._image||this._initImage(),e._panes.overlayPane.appendChild(this._image),e.on("viewreset",this._reset,this),e.options.zoomAnimation&&n.Browser.any3d&&e.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(e){e.getPanes().overlayPane.removeChild(this._image),e.off("viewreset",this._reset,this),e.options.zoomAnimation&&e.off("zoomanim",this._animateZoom,this)},addTo:function(e){return e.addLayer(this),this},setOpacity:function(e){return this.options.opacity=e,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var e=this._map._panes.overlayPane;return this._image&&e.insertBefore(this._image,e.firstChild),this},_initImage:function(){this._image=n.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&n.Browser.any3d?n.DomUtil.addClass(this._image,"leaflet-zoom-animated"):n.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),n.Util.extend(this._image,{galleryimg:"no",onselectstart:n.Util.falseFn,onmousemove:n.Util.falseFn,onload:n.Util.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(e){var t=this._map,r=this._image,i=t.getZoomScale(e.zoom),s=this._bounds.getNorthWest(),o=this._bounds.getSouthEast(),u=t._latLngToNewLayerPoint(s,e.zoom,e.center),a=t._latLngToNewLayerPoint(o,e.zoom,e.center).subtract(u),f=t.latLngToLayerPoint(o).subtract(t.latLngToLayerPoint(s)),l=u.add(a.subtract(f).divideBy(2));r.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(l)+" scale("+i+") "},_reset:function(){var e=this._image,t=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),r=this._map.latLngToLayerPoint(this._bounds.getSouthEast()).subtract(t);n.DomUtil.setPosition(e,t),e.style.width=r.x+"px",e.style.height=r.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){n.DomUtil.setOpacity(this._image,this.options.opacity)}}),n.imageOverlay=function(e,t,r){return new n.ImageOverlay(e,t,r)},n.Icon=n.Class.extend({options:{className:""},initialize:function(e){n.Util.setOptions(this,e)},createIcon:function(){return this._createIcon("icon")},createShadow:function(){return this._createIcon("shadow")},_createIcon:function(e){var t=this._getIconUrl(e);if(!t){if(e==="icon")throw Error("iconUrl not set in Icon options (see the docs).");return null}var n=this._createImg(t);return this._setIconStyles(n,e),n},_setIconStyles:function(e,t){var r=this.options,i=n.point(r[t+"Size"]),s;t==="shadow"?s=n.point(r.shadowAnchor||r.iconAnchor):s=n.point(r.iconAnchor),!s&&i&&(s=i.divideBy(2,!0)),e.className="leaflet-marker-"+t+" "+r.className,s&&(e.style.marginLeft=-s.x+"px",e.style.marginTop=-s.y+"px"),i&&(e.style.width=i.x+"px",e.style.height=i.y+"px")},_createImg:function(e){var t;return n.Browser.ie6?(t=document.createElement("div"),t.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+e+'")'):(t=document.createElement("img"),t.src=e),t},_getIconUrl:function(e){return this.options[e+"Url"]}}),n.icon=function(e){return new n.Icon(e)},n.Icon.Default=n.Icon.extend({options:{iconSize:new n.Point(25,41),iconAnchor:new n.Point(13,41),popupAnchor:new n.Point(1,-34),shadowSize:new n.Point(41,41)},_getIconUrl:function(e){var t=e+"Url";if(this.options[t])return this.options[t];var r=n.Icon.Default.imagePath;if(!r)throw Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return r+"/marker-"+e+".png"}}),n.Icon.Default.imagePath=function(){var e=document.getElementsByTagName("script"),t=/\/?leaflet[\-\._]?([\w\-\._]*)\.js\??/,n,r,i,s;for(n=0,r=e.length;n<r;n++){i=e[n].src,s=i.match(t);if(s)return i.split(t)[0]+"/images"}}(),n.Marker=n.Class.extend({includes:n.Mixin.Events,options:{icon:new n.Icon.Default,title:"",clickable:!0,draggable:!1,zIndexOffset:0,opacity:1},initialize:function(e,t){n.Util.setOptions(this,t),this._latlng=n.latLng(e)},onAdd:function(e){this._map=e,e.on("viewreset",this.update,this),this._initIcon(),this.update(),e.options.zoomAnimation&&e.options.markerZoomAnimation&&e.on("zoomanim",this._animateZoom,this)},addTo:function(e){return e.addLayer(this),this},onRemove:function(e){this._removeIcon(),this.closePopup&&this.closePopup(),e.off({viewreset:this.update,zoomanim:this._animateZoom},this),this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(e){this._latlng=n.latLng(e),this.update(),this._popup&&this._popup.setLatLng(e)},setZIndexOffset:function(e){this.options.zIndexOffset=e,this.update()},setIcon:function(e){this._map&&this._removeIcon(),this.options.icon=e,this._map&&(this._initIcon(),this.update())},update:function(){if(!this._icon)return;var e=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(e)},_initIcon:function(){var e=this.options,t=this._map,r=t.options.zoomAnimation&&t.options.markerZoomAnimation,i=r?"leaflet-zoom-animated":"leaflet-zoom-hide",s=!1;this._icon||(this._icon=e.icon.createIcon(),e.title&&(this._icon.title=e.title),this._initInteraction(),s=this.options.opacity<1,n.DomUtil.addClass(this._icon,i)),this._shadow||(this._shadow=e.icon.createShadow(),this._shadow&&(n.DomUtil.addClass(this._shadow,i),s=this.options.opacity<1)),s&&this._updateOpacity();var o=this._map._panes;o.markerPane.appendChild(this._icon),this._shadow&&o.shadowPane.appendChild(this._shadow)},_removeIcon:function(){var e=this._map._panes;e.markerPane.removeChild(this._icon),this._shadow&&e.shadowPane.removeChild(this._shadow),this._icon=this._shadow=null},_setPos:function(e){n.DomUtil.setPosition(this._icon,e),this._shadow&&n.DomUtil.setPosition(this._shadow,e),this._icon.style.zIndex=e.y+this.options.zIndexOffset},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center);this._setPos(t)},_initInteraction:function(){if(!this.options.clickable)return;var e=this._icon,t=["dblclick","mousedown","mouseover","mouseout"];n.DomUtil.addClass(e,"leaflet-clickable"),n.DomEvent.on(e,"click",this._onMouseClick,this);for(var r=0;r<t.length;r++)n.DomEvent.on(e,t[r],this._fireMouseEvent,this);n.Handler.MarkerDrag&&(this.dragging=new n.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())},_onMouseClick:function(e){n.DomEvent.stopPropagation(e);if(this.dragging&&this.dragging.moved())return;if(this._map.dragging&&this._map.dragging.moved())return;this.fire(e.type,{originalEvent:e})},_fireMouseEvent:function(e){this.fire(e.type,{originalEvent:e}),e.type!=="mousedown"&&n.DomEvent.stopPropagation(e)},setOpacity:function(e){this.options.opacity=e,this._map&&this._updateOpacity()},_updateOpacity:function(){n.DomUtil.setOpacity(this._icon,this.options.opacity),this._shadow&&n.DomUtil.setOpacity(this._shadow,this.options.opacity)}}),n.marker=function(e,t){return new n.Marker(e,t)},n.DivIcon=n.Icon.extend({options:{iconSize:new n.Point(12,12),className:"leaflet-div-icon"},createIcon:function(){var e=document.createElement("div"),t=this.options;return t.html&&(e.innerHTML=t.html),t.bgPos&&(e.style.backgroundPosition=-t.bgPos.x+"px "+ -t.bgPos.y+"px"),this._setIconStyles(e,"icon"),e},createShadow:function(){return null}}),n.divIcon=function(e){return new n.DivIcon(e)},n.Map.mergeOptions({closePopupOnClick:!0}),n.Popup=n.Class.extend({includes:n.Mixin.Events,options:{minWidth:50,maxWidth:300,maxHeight:null,autoPan:!0,closeButton:!0,offset:new n.Point(0,6),autoPanPadding:new n.Point(5,5),className:""},initialize:function(e,t){n.Util.setOptions(this,e),this._source=t},onAdd:function(e){this._map=e,this._container||this._initLayout(),this._updateContent();var t=e.options.fadeAnimation;t&&n.DomUtil.setOpacity(this._container,0),e._panes.popupPane.appendChild(this._container),e.on("viewreset",this._updatePosition,this),n.Browser.any3d&&e.on("zoomanim",this._zoomAnimation,this),e.options.closePopupOnClick&&e.on("preclick",this._close,this),this._update(),t&&n.DomUtil.setOpacity(this._container,1)},addTo:function(e){return e.addLayer(this),this},openOn:function(e){return e.openPopup(this),this},onRemove:function(e){e._panes.popupPane.removeChild(this._container),n.Util.falseFn(this._container.offsetWidth),e.off({viewreset:this._updatePosition,preclick:this._close,zoomanim:this._zoomAnimation},this),e.options.fadeAnimation&&n.DomUtil.setOpacity(this._container,0),this._map=null},setLatLng:function(e){return this._latlng=n.latLng(e),this._update(),this},setContent:function(e){return this._content=e,this._update(),this},_close:function(){var e=this._map;e&&(e._popup=null,e.removeLayer(this).fire("popupclose",{popup:this}))},_initLayout:function(){var e="leaflet-popup",t=this._container=n.DomUtil.create("div",e+" "+this.options.className+" leaflet-zoom-animated"),r;this.options.closeButton&&(r=this._closeButton=n.DomUtil.create("a",e+"-close-button",t),r.href="#close",r.innerHTML="×",n.DomEvent.on(r,"click",this._onCloseButtonClick,this));var i=this._wrapper=n.DomUtil.create("div",e+"-content-wrapper",t);n.DomEvent.disableClickPropagation(i),this._contentNode=n.DomUtil.create("div",e+"-content",i),n.DomEvent.on(this._contentNode,"mousewheel",n.DomEvent.stopPropagation),this._tipContainer=n.DomUtil.create("div",e+"-tip-container",t),this._tip=n.DomUtil.create("div",e+"-tip",this._tipContainer)},_update:function(){if(!this._map)return;this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan()},_updateContent:function(){if(!this._content)return;if(typeof this._content=="string")this._contentNode.innerHTML=this._content;else{while(this._contentNode.hasChildNodes())this._contentNode.removeChild(this._contentNode.firstChild);this._contentNode.appendChild(this._content)}this.fire("contentupdate")},_updateLayout:function(){var e=this._contentNode,t=e.style;t.width="",t.whiteSpace="nowrap";var r=e.offsetWidth;r=Math.min(r,this.options.maxWidth),r=Math.max(r,this.options.minWidth),t.width=r+1+"px",t.whiteSpace="",t.height="";var i=e.offsetHeight,s=this.options.maxHeight,o="leaflet-popup-scrolled";s&&i>s?(t.height=s+"px",n.DomUtil.addClass(e,o)):n.DomUtil.removeClass(e,o),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){var e=this._map.latLngToLayerPoint(this._latlng),t=n.Browser.any3d,r=this.options.offset;t&&n.DomUtil.setPosition(this._container,e),this._containerBottom=-r.y-(t?0:e.y),this._containerLeft=-Math.round(this._containerWidth/2)+r.x+(t?0:e.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"},_zoomAnimation:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center);n.DomUtil.setPosition(this._container,t)},_adjustPan:function(){if(!this.options.autoPan)return;var e=this._map,t=this._container.offsetHeight,r=this._containerWidth,i=new n.Point(this._containerLeft,-t-this._containerBottom);n.Browser.any3d&&i._add(n.DomUtil.getPosition(this._container));var s=e.layerPointToContainerPoint(i),o=this.options.autoPanPadding,u=e.getSize(),a=0,f=0;s.x<0&&(a=s.x-o.x),s.x+r>u.x&&(a=s.x+r-u.x+o.x),s.y<0&&(f=s.y-o.y),s.y+t>u.y&&(f=s.y+t-u.y+o.y),(a||f)&&e.panBy(new n.Point(a,f))},_onCloseButtonClick:function(e){this._close(),n.DomEvent.stop(e)}}),n.popup=function(e,t){return new n.Popup(e,t)},n.Marker.include({openPopup:function(){return this._popup&&this._map&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},bindPopup:function(e,t){var r=n.point(this.options.icon.options.popupAnchor)||new n.Point(0,0);return r=r.add(n.Popup.prototype.options.offset),t&&t.offset&&(r=r.add(t.offset)),t=n.Util.extend({offset:r},t),this._popup||this.on("click",this.openPopup,this),this._popup=(new n.Popup(t,this)).setContent(e),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.openPopup)),this}}),n.Map.include({openPopup:function(e){return this.closePopup(),this._popup=e,this.addLayer(e).fire("popupopen",{popup:this._popup})},closePopup:function(){return this._popup&&this._popup._close(),this}}),n.LayerGroup=n.Class.extend({initialize:function(e){this._layers={};var t,n;if(e)for(t=0,n=e.length;t<n;t++)this.addLayer(e[t])},addLayer:function(e){var t=n.Util.stamp(e);return this._layers[t]=e,this._map&&this._map.addLayer(e),this},removeLayer:function(e){var t=n.Util.stamp(e);return delete this._layers[t],this._map&&this._map.removeLayer(e),this},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(e){var t=Array.prototype.slice.call(arguments,1),n,r;for(n in this._layers)this._layers.hasOwnProperty(n)&&(r=this._layers[n],r[e]&&r[e].apply(r,t));return this},onAdd:function(e){this._map=e,this.eachLayer(e.addLayer,e)},onRemove:function(e){this.eachLayer(e.removeLayer,e),this._map=null},addTo:function(e){return e.addLayer(this),this},eachLayer:function(e,t){for(var n in this._layers)this._layers.hasOwnProperty(n)&&e.call(t,this._layers[n])}}),n.layerGroup=function(e){return new n.LayerGroup(e)},n.FeatureGroup=n.LayerGroup.extend({includes:n.Mixin.Events,addLayer:function(e){return this._layers[n.Util.stamp(e)]?this:(e.on("click dblclick mouseover mouseout mousemove contextmenu",this._propagateEvent,this),n.LayerGroup.prototype.addLayer.call(this,e),this._popupContent&&e.bindPopup&&e.bindPopup(this._popupContent),this)},removeLayer:function(e){return e.off("click dblclick mouseover mouseout mousemove contextmenu",this._propagateEvent,this),n.LayerGroup.prototype.removeLayer.call(this,e),this._popupContent?this.invoke("unbindPopup"):this},bindPopup:function(e){return this._popupContent=e,this.invoke("bindPopup",e)},setStyle:function(e){return this.invoke("setStyle",e)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var e=new n.LatLngBounds;return this.eachLayer(function(t){e.extend(t instanceof n.Marker?t.getLatLng():t.getBounds())},this),e},_propagateEvent:function(e){e.layer=e.target,e.target=this,this.fire(e.type,e)}}),n.featureGroup=function(e){return new n.FeatureGroup(e)},n.Path=n.Class.extend({includes:[n.Mixin.Events],statics:{CLIP_PADDING:n.Browser.mobile?Math.max(0,Math.min(.5,(1280/Math.max(e.innerWidth,e.innerHeight)-1)/2)):.5},options:{stroke:!0,color:"#0033ff",dashArray:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(e){n.Util.setOptions(this,e)},onAdd:function(e){this._map=e,this._container||(this._initElements(),this._initEvents()),this.projectLatlngs(),this._updatePath(),this._container&&this._map._pathRoot.appendChild(this._container),e.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(e){return e.addLayer(this),this},onRemove:function(e){e._pathRoot.removeChild(this._container),this._map=null,n.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null),e.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(e){return n.Util.setOptions(this,e),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}}),n.Map.include({_updatePathViewport:function(){var e=n.Path.CLIP_PADDING,t=this.getSize(),r=n.DomUtil.getPosition(this._mapPane),i=r.multiplyBy(-1)._subtract(t.multiplyBy(e)),s=i.add(t.multiplyBy(1+e*2));this._pathViewport=new n.Bounds(i,s)}}),n.Path.SVG_NS="http://www.w3.org/2000/svg",n.Browser.svg=!!document.createElementNS&&!!document.createElementNS(n.Path.SVG_NS,"svg").createSVGRect,n.Path=n.Path.extend({statics:{SVG:n.Browser.svg},bringToFront:function(){return this._container&&this._map._pathRoot.appendChild(this._container),this},bringToBack:function(){if(this._container){var e=this._map._pathRoot;e.insertBefore(this._container,e.firstChild)}return this},getPathString:function(){},_createElement:function(e){return document.createElementNS(n.Path.SVG_NS,e)},_initElements:function(){this._map._initPathRoot(),this._initPath(),this._initStyle()},_initPath:function(){this._container=this._createElement("g"),this._path=this._createElement("path"),this._container.appendChild(this._path)},_initStyle:function(){this.options.stroke&&(this._path.setAttribute("stroke-linejoin","round"),this._path.setAttribute("stroke-linecap","round")),this.options.fill&&this._path.setAttribute("fill-rule","evenodd"),this._updateStyle()},_updateStyle:function(){this.options.stroke?(this._path.setAttribute("stroke",this.options.color),this._path.setAttribute("stroke-opacity",this.options.opacity),this._path.setAttribute("stroke-width",this.options.weight),this.options.dashArray?this._path.setAttribute("stroke-dasharray",this.options.dashArray):this._path.removeAttribute("stroke-dasharray")):this._path.setAttribute("stroke","none"),this.options.fill?(this._path.setAttribute("fill",this.options.fillColor||this.options.color),this._path.setAttribute("fill-opacity",this.options.fillOpacity)):this._path.setAttribute("fill","none")},_updatePath:function(){var e=this.getPathString();e||(e="M0 0"),this._path.setAttribute("d",e)},_initEvents:function(){if(this.options.clickable){(n.Browser.svg||!n.Browser.vml)&&this._path.setAttribute("class","leaflet-clickable"),n.DomEvent.on(this._container,"click",this._onMouseClick,this);var e=["dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"];for(var t=0;t<e.length;t++)n.DomEvent.on(this._container,e[t],this._fireMouseEvent,this)}},_onMouseClick:function(e){if(this._map.dragging&&this._map.dragging.moved())return;this._fireMouseEvent(e),n.DomEvent.stopPropagation(e)},_fireMouseEvent:function(e){if(!this.hasEventListeners(e.type))return;e.type==="contextmenu"&&n.DomEvent.preventDefault(e);var t=this._map,r=t.mouseEventToContainerPoint(e),i=t.containerPointToLayerPoint(r),s=t.layerPointToLatLng(i);this.fire(e.type,{latlng:s,layerPoint:i,containerPoint:r,originalEvent:e})}}),n.Map.include({_initPathRoot:function(){this._pathRoot||(this._pathRoot=n.Path.prototype._createElement("svg"),this._panes.overlayPane.appendChild(this._pathRoot),this.options.zoomAnimation&&n.Browser.any3d?(this._pathRoot.setAttribute("class"," leaflet-zoom-animated"),this.on({zoomanim:this._animatePathZoom,zoomend:this._endPathZoom})):this._pathRoot.setAttribute("class"," leaflet-zoom-hide"),this.on("moveend",this._updateSvgViewport),this._updateSvgViewport())},_animatePathZoom:function(e){var t=this.getZoomScale(e.zoom),r=this._getCenterOffset(e.center).divideBy(1-1/t),i=this.containerPointToLayerPoint(this.getSize().multiplyBy(-n.Path.CLIP_PADDING)),s=i.add(r).round();this._pathRoot.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(s.multiplyBy(-1).add(n.DomUtil.getPosition(this._pathRoot)).multiplyBy(t).add(s))+" scale("+t+") ",this._pathZooming=!0},_endPathZoom:function(){this._pathZooming=!1},_updateSvgViewport:function(){if(this._pathZooming)return;this._updatePathViewport();var e=this._pathViewport,t=e.min,r=e.max,i=r.x-t.x,s=r.y-t.y,o=this._pathRoot,u=this._panes.overlayPane;n.Browser.mobileWebkit&&u.removeChild(o),n.DomUtil.setPosition(o,t),o.setAttribute("width",i),o.setAttribute("height",s),o.setAttribute("viewBox",[t.x,t.y,i,s].join(" ")),n.Browser.mobileWebkit&&u.appendChild(o)}}),n.Path.include({bindPopup:function(e,t){if(!this._popup||this._popup.options!==t)this._popup=new n.Popup(t,this);return this._popup.setContent(e),this._openPopupAdded||(this.on("click",this._openPopup,this),this._openPopupAdded=!0),this},openPopup:function(e){return this._popup&&(e=e||this._latlng||this._latlngs[Math.floor(this._latlngs.length/2)],this._openPopup({latlng:e})),this},_openPopup:function(e){this._popup.setLatLng(e.latlng),this._map.openPopup(this._popup)}}),n.Browser.vml=function(){try{var e=document.createElement("div");e.innerHTML='<v:shape adj="1"/>';var t=e.firstChild;return t.style.behavior="url(#default#VML)",t&&typeof t.adj=="object"}catch(n){return!1}}(),n.Path=n.Browser.svg||!n.Browser.vml?n.Path:n.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(e){return document.createElement("<lvml:"+e+' class="lvml">')}}catch(e){return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var e=this._container=this._createElement("shape");n.DomUtil.addClass(e,"leaflet-vml-shape"),this.options.clickable&&n.DomUtil.addClass(e,"leaflet-clickable"),e.coordsize="1 1",this._path=this._createElement("path"),e.appendChild(this._path),this._map._pathRoot.appendChild(e)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var e=this._stroke,t=this._fill,n=this.options,r=this._container;r.stroked=n.stroke,r.filled=n.fill,n.stroke?(e||(e=this._stroke=this._createElement("stroke"),e.endcap="round",r.appendChild(e)),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=n.dashArray.replace(/ *, */g," "):e.dashStyle=""):e&&(r.removeChild(e),this._stroke=null),n.fill?(t||(t=this._fill=this._createElement("fill"),r.appendChild(t)),t.color=n.fillColor||n.color,t.opacity=n.fillOpacity):t&&(r.removeChild(t),this._fill=null)},_updatePath:function(){var e=this._container.style;e.display="none",this._path.v=this.getPathString()+" ",e.display=""}}),n.Map.include(n.Browser.svg||!n.Browser.vml?{}:{_initPathRoot:function(){if(this._pathRoot)return;var e=this._pathRoot=document.createElement("div");e.className="leaflet-vml-container",this._panes.overlayPane.appendChild(e),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}),n.Browser.canvas=function(){return!!document.createElement("canvas").getContext}(),n.Path=n.Path.SVG&&!e.L_PREFER_CANVAS||!n.Browser.canvas?n.Path:n.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(e){return n.Util.setOptions(this,e),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(e){e.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this._requestUpdate(),this._map=null},_requestUpdate:function(){this._map&&(n.Util.cancelAnimFrame(this._fireMapMoveEnd),this._updateRequest=n.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var e=this.options;e.stroke&&(this._ctx.lineWidth=e.weight,this._ctx.strokeStyle=e.color),e.fill&&(this._ctx.fillStyle=e.fillColor||e.color)},_drawPath:function(){var e,t,r,i,s,o;this._ctx.beginPath();for(e=0,r=this._parts.length;e<r;e++){for(t=0,i=this._parts[e].length;t<i;t++)s=this._parts[e][t],o=(t===0?"move":"line")+"To",this._ctx[o](s.x,s.y);this instanceof n.Polygon&&this._ctx.closePath()}},_checkIfEmpty:function(){return!this._parts.length},_updatePath:function(){if(this._checkIfEmpty())return;var e=this._ctx,t=this.options;this._drawPath(),e.save(),this._updateStyle(),t.fill&&(t.fillOpacity<1&&(e.globalAlpha=t.fillOpacity),e.fill()),t.stroke&&(t.opacity<1&&(e.globalAlpha=t.opacity),e.stroke()),e.restore()},_initEvents:function(){this.options.clickable&&this._map.on("click",this._onClick,this)},_onClick:function(e){this._containsPoint(e.layerPoint)&&this.fire("click",e)}}),n.Map.include(n.Path.SVG&&!e.L_PREFER_CANVAS||!n.Browser.canvas?{}:{_initPathRoot:function(){var e=this._pathRoot,t;e||(e=this._pathRoot=document.createElement("canvas"),e.style.position="absolute",t=this._canvasCtx=e.getContext("2d"),t.lineCap="round",t.lineJoin="round",this._panes.overlayPane.appendChild(e),this.options.zoomAnimation&&(this._pathRoot.className="leaflet-zoom-animated",this.on("zoomanim",this._animatePathZoom),this.on("zoomend",this._endPathZoom)),this.on("moveend",this._updateCanvasViewport),this._updateCanvasViewport())},_updateCanvasViewport:function(){if(this._pathZooming)return;this._updatePathViewport();var e=this._pathViewport,t=e.min,r=e.max.subtract(t),i=this._pathRoot;n.DomUtil.setPosition(i,t),i.width=r.x,i.height=r.y,i.getContext("2d").translate(-t.x,-t.y)}}),n.LineUtil={simplify:function(e,t){if(!t||!e.length)return e.slice();var n=t*t;return e=this._reducePoints(e,n),e=this._simplifyDP(e,n),e},pointToSegmentDistance:function(e,t,n){return Math.sqrt(this._sqClosestPointOnSegment(e,t,n,!0))},closestPointOnSegment:function(e,t,n){return this._sqClosestPointOnSegment(e,t,n)},_simplifyDP:function(e,n){var r=e.length,i=typeof Uint8Array!=t+""?Uint8Array:Array,s=new i(r);s[0]=s[r-1]=1,this._simplifyDPStep(e,s,n,0,r-1);var o,u=[];for(o=0;o<r;o++)s[o]&&u.push(e[o]);return u},_simplifyDPStep:function(e,t,n,r,i){var s=0,o,u,a;for(u=r+1;u<=i-1;u++)a=this._sqClosestPointOnSegment(e[u],e[r],e[i],!0),a>s&&(o=u,s=a);s>n&&(t[o]=1,this._simplifyDPStep(e,t,n,r,o),this._simplifyDPStep(e,t,n,o,i))},_reducePoints:function(e,t){var n=[e[0]];for(var r=1,i=0,s=e.length;r<s;r++)this._sqDist(e[r],e[i])>t&&(n.push(e[r]),i=r);return i<s-1&&n.push(e[s-1]),n},clipSegment:function(e,t,n,r){var i=n.min,s=n.max,o=r?this._lastCode:this._getBitCode(e,n),u=this._getBitCode(t,n);this._lastCode=u;for(;;){if(!(o|u))return[e,t];if(o&u)return!1;var a=o||u,f=this._getEdgeIntersection(e,t,a,n),l=this._getBitCode(f,n);a===o?(e=f,o=l):(t=f,u=l)}},_getEdgeIntersection:function(e,t,r,i){var s=t.x-e.x,o=t.y-e.y,u=i.min,a=i.max;if(r&8)return new n.Point(e.x+s*(a.y-e.y)/o,a.y);if(r&4)return new n.Point(e.x+s*(u.y-e.y)/o,u.y);if(r&2)return new n.Point(a.x,e.y+o*(a.x-e.x)/s);if(r&1)return new n.Point(u.x,e.y+o*(u.x-e.x)/s)},_getBitCode:function(e,t){var n=0;return e.x<t.min.x?n|=1:e.x>t.max.x&&(n|=2),e.y<t.min.y?n|=4:e.y>t.max.y&&(n|=8),n},_sqDist:function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},_sqClosestPointOnSegment:function(e,t,r,i){var s=t.x,o=t.y,u=r.x-s,a=r.y-o,f=u*u+a*a,l;return f>0&&(l=((e.x-s)*u+(e.y-o)*a)/f,l>1?(s=r.x,o=r.y):l>0&&(s+=u*l,o+=a*l)),u=e.x-s,a=e.y-o,i?u*u+a*a:new n.Point(s,o)}},n.Polyline=n.Path.extend({initialize:function(e,t){n.Path.prototype.initialize.call(this,t),this._latlngs=this._convertLatLngs(e),n.Handler.PolyEdit&&(this.editing=new n.Handler.PolyEdit(this),this.options.editable&&this.editing.enable())},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var e=0,t=this._latlngs.length;e<t;e++)this._originalPoints[e]=this._map.latLngToLayerPoint(this._latlngs[e])},getPathString:function(){for(var e=0,t=this._parts.length,n="";e<t;e++)n+=this._getPathPartStr(this._parts[e]);return n},getLatLngs:function(){return this._latlngs},setLatLngs:function(e){return this._latlngs=this._convertLatLngs(e),this.redraw()},addLatLng:function(e){return this._latlngs.push(n.latLng(e)),this.redraw()},spliceLatLngs:function(e,t){var n=[].splice.apply(this._latlngs,arguments);return this._convertLatLngs(this._latlngs),this.redraw(),n},closestLayerPoint:function(e){var t=Infinity,r=this._parts,i,s,o=null;for(var u=0,a=r.length;u<a;u++){var f=r[u];for(var l=1,c=f.length;l<c;l++){i=f[l-1],s=f[l];var h=n.LineUtil._sqClosestPointOnSegment(e,i,s,!0);h<t&&(t=h,o=n.LineUtil._sqClosestPointOnSegment(e,i,s))}}return o&&(o.distance=Math.sqrt(t)),o},getBounds:function(){var e=new n.LatLngBounds,t=this.getLatLngs();for(var r=0,i=t.length;r<i;r++)e.extend(t[r]);return e},onAdd:function(e){n.Path.prototype.onAdd.call(this,e),this.editing&&this.editing.enabled()&&this.editing.addHooks()},onRemove:function(e){this.editing&&this.editing.enabled()&&this.editing.removeHooks(),n.Path.prototype.onRemove.call(this,e)},_convertLatLngs:function(e){var t,r;for(t=0,r=e.length;t<r;t++){if(e[t]instanceof Array&&typeof e[t][0]!="number")return;e[t]=n.latLng(e[t])}return e},_initEvents:function(){n.Path.prototype._initEvents.call(this)},_getPathPartStr:function(e){var t=n.Path.VML;for(var r=0,i=e.length,s="",o;r<i;r++)o=e[r],t&&o._round(),s+=(r?"L":"M")+o.x+" "+o.y;return s},_clipPoints:function(){var e=this._originalPoints,t=e.length,r,i,s;if(this.options.noClip){this._parts=[e];return}this._parts=[];var o=this._parts,u=this._map._pathViewport,a=n.LineUtil;for(r=0,i=0;r<t-1;r++){s=a.clipSegment(e[r],e[r+1],u,r);if(!s)continue;o[i]=o[i]||[],o[i].push(s[0]);if(s[1]!==e[r+1]||r===t-2)o[i].push(s[1]),i++}},_simplifyPoints:function(){var e=this._parts,t=n.LineUtil;for(var r=0,i=e.length;r<i;r++)e[r]=t.simplify(e[r],this.options.smoothFactor)},_updatePath:function(){if(!this._map)return;this._clipPoints(),this._simplifyPoints(),n.Path.prototype._updatePath.call(this)}}),n.polyline=function(e,t){return new n.Polyline(e,t)},n.PolyUtil={},n.PolyUtil.clipPolygon=function(e,t){var r=t.min,i=t.max,s,o=[1,4,2,8],u,a,f,l,c,h,p,d,v=n.LineUtil;for(u=0,h=e.length;u<h;u++)e[u]._code=v._getBitCode(e[u],t);for(f=0;f<4;f++){p=o[f],s=[];for(u=0,h=e.length,a=h-1;u<h;a=u++)l=e[u],c=e[a],l._code&p?c._code&p||(d=v._getEdgeIntersection(c,l,p,t),d._code=v._getBitCode(d,t),s.push(d)):(c._code&p&&(d=v._getEdgeIntersection(c,l,p,t),d._code=v._getBitCode(d,t),s.push(d)),s.push(l));e=s}return e},n.Polygon=n.Polyline.extend({options:{fill:!0},initialize:function(e,t){n.Polyline.prototype.initialize.call(this,e,t),e&&e[0]instanceof Array&&typeof e[0][0]!="number"&&(this._latlngs=this._convertLatLngs(e[0]),this._holes=e.slice(1))},projectLatlngs:function(){n.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[];if(!this._holes)return;for(var e=0,t=this._holes.length,r;e<t;e++){this._holePoints[e]=[];for(var i=0,s=this._holes[e].length;i<s;i++)this._holePoints[e][i]=this._map.latLngToLayerPoint(this._holes[e][i])}},_clipPoints:function(){var e=this._originalPoints,t=[];this._parts=[e].concat(this._holePoints);if(this.options.noClip)return;for(var r=0,i=this._parts.length;r<i;r++){var s=n.PolyUtil.clipPolygon(this._parts[r],this._map._pathViewport);if(!s.length)continue;t.push(s)}this._parts=t},_getPathPartStr:function(e){var t=n.Polyline.prototype._getPathPartStr.call(this,e);return t+(n.Browser.svg?"z":"x")}}),n.polygon=function(e,t){return new n.Polygon(e,t)},function(){function e(e){return n.FeatureGroup.extend({initialize:function(e,t){this._layers={},this._options=t,this.setLatLngs(e)},setLatLngs:function(t){var n=0,r=t.length;this.eachLayer(function(e){n<r?e.setLatLngs(t[n++]):this.removeLayer(e)},this);while(n<r)this.addLayer(new e(t[n++],this._options));return this}})}n.MultiPolyline=e(n.Polyline),n.MultiPolygon=e(n.Polygon),n.multiPolyline=function(e,t){return new n.MultiPolyline(e,t)},n.multiPolygon=function(e,t){return new n.MultiPolygon(e,t)}}(),n.Rectangle=n.Polygon.extend({initialize:function(e,t){n.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(e),t)},setBounds:function(e){this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return e=n.latLngBounds(e),[e.getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast(),e.getSouthWest()]}}),n.rectangle=function(e,t){return new n.Rectangle(e,t)},n.Circle=n.Path.extend({initialize:function(e,t,r){n.Path.prototype.initialize.call(this,r),this._latlng=n.latLng(e),this._mRadius=t},options:{fill:!0},setLatLng:function(e){return this._latlng=n.latLng(e),this.redraw()},setRadius:function(e){return this._mRadius=e,this.redraw()},projectLatlngs:function(){var e=this._getLngRadius(),t=new n.LatLng(this._latlng.lat,this._latlng.lng-e,!0),r=this._map.latLngToLayerPoint(t);this._point=this._map.latLngToLayerPoint(this._latlng),this._radius=Math.max(Math.round(this._point.x-r.x),1)},getBounds:function(){var e=this._map,t=this._radius*Math.cos(Math.PI/4),r=e.project(this._latlng),i=new n.Point(r.x-t,r.y+t),s=new n.Point(r.x+t,r.y-t),o=e.unproject(i),u=e.unproject(s);return new n.LatLngBounds(o,u)},getLatLng:function(){return this._latlng},getPathString:function(){var e=this._point,t=this._radius;return this._checkIfEmpty()?"":n.Browser.svg?"M"+e.x+","+(e.y-t)+"A"+t+","+t+",0,1,1,"+(e.x-.1)+","+(e.y-t)+" z":(e._round(),t=Math.round(t),"AL "+e.x+","+e.y+" "+t+","+t+" 0,"+23592600)},getRadius:function(){return this._mRadius},_getLngRadius:function(){var e=40075017,t=e*Math.cos(n.LatLng.DEG_TO_RAD*this._latlng.lat);return this._mRadius/t*360},_checkIfEmpty:function(){if(!this._map)return!1;var e=this._map._pathViewport,t=this._radius,n=this._point;return n.x-t>e.max.x||n.y-t>e.max.y||n.x+t<e.min.x||n.y+t<e.min.y}}),n.circle=function(e,t,r){return new n.Circle(e,t,r)},n.CircleMarker=n.Circle.extend({options:{radius:10,weight:2},initialize:function(e,t){n.Circle.prototype.initialize.call(this,e,null,t),this._radius=this.options.radius},projectLatlngs:function(){this._point=this._map.latLngToLayerPoint(this._latlng)},setRadius:function(e){return this._radius=e,this.redraw()}}),n.circleMarker=function(e,t){return new n.CircleMarker(e,t)},n.Polyline.include(n.Path.CANVAS?{_containsPoint:function(e,t){var r,i,s,o,u,a,f,l=this.options.weight/2;n.Browser.touch&&(l+=10);for(r=0,o=this._parts.length;r<o;r++){f=this._parts[r];for(i=0,u=f.length,s=u-1;i<u;s=i++){if(!t&&i===0)continue;a=n.LineUtil.pointToSegmentDistance(e,f[s],f[i]);if(a<=l)return!0}}return!1}}:{}),n.Polygon.include(n.Path.CANVAS?{_containsPoint:function(e){var t=!1,r,i,s,o,u,a,f,l;if(n.Polyline.prototype._containsPoint.call(this,e,!0))return!0;for(o=0,f=this._parts.length;o<f;o++){r=this._parts[o];for(u=0,l=r.length,a=l-1;u<l;a=u++)i=r[u],s=r[a],i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(t=!t)}return t}}:{}),n.Circle.include(n.Path.CANVAS?{_drawPath:function(){var e=this._point;this._ctx.beginPath(),this._ctx.arc(e.x,e.y,this._radius,0,Math.PI*2,!1)},_containsPoint:function(e){var t=this._point,n=this.options.stroke?this.options.weight/2:0;return e.distanceTo(t)<=this._radius+n}}:{}),n.GeoJSON=n.FeatureGroup.extend({initialize:function(e,t){n.Util.setOptions(this,t),this._layers={},e&&this.addData(e)},addData:function(e){var t=e instanceof Array?e:e.features,r,i;if(t){for(r=0,i=t.length;r<i;r++)this.addData(t[r]);return this}var s=this.options;if(s.filter&&!s.filter(e))return;var o=n.GeoJSON.geometryToLayer(e,s.pointToLayer);return o.feature=e,this.resetStyle(o),s.onEachFeature&&s.onEachFeature(e,o),this.addLayer(o)},resetStyle:function(e){var t=this.options.style;t&&this._setLayerStyle(e,t)},setStyle:function(e){this.eachLayer(function(t){this._setLayerStyle(t,e)},this)},_setLayerStyle:function(e,t){typeof t=="function"&&(t=t(e.feature)),e.setStyle&&e.setStyle(t)}}),n.Util.extend(n.GeoJSON,{geometryToLayer:function(e,t){var r=e.type==="Feature"?e.geometry:e,i=r.coordinates,s=[],o,u,a,f,l;switch(r.type){case"Point":return o=this.coordsToLatLng(i),t?t(e,o):new n.Marker(o);case"MultiPoint":for(a=0,f=i.length;a<f;a++)o=this.coordsToLatLng(i[a]),l=t?t(e,o):new n.Marker(o),s.push(l);return new n.FeatureGroup(s);case"LineString":return u=this.coordsToLatLngs(i),new n.Polyline(u);case"Polygon":return u=this.coordsToLatLngs(i,1),new n.Polygon(u);case"MultiLineString":return u=this.coordsToLatLngs(i,1),new n.MultiPolyline(u);case"MultiPolygon":return u=this.coordsToLatLngs(i,2),new n.MultiPolygon(u);case"GeometryCollection":for(a=0,f=r.geometries.length;a<f;a++)l=this.geometryToLayer(r.geometries[a],t),s.push(l);return new n.FeatureGroup(s);default:throw Error("Invalid GeoJSON object.")}},coordsToLatLng:function(e,t){var r=parseFloat(e[t?0:1]),i=parseFloat(e[t?1:0]);return new n.LatLng(r,i,!0)},coordsToLatLngs:function(e,t,n){var r,i=[],s,o;for(s=0,o=e.length;s<o;s++)r=t?this.coordsToLatLngs(e[s],t-1,n):this.coordsToLatLng(e[s],n),i.push(r);return i}}),n.geoJson=function(e,t){return new n.GeoJSON(e,t)},n.DomEvent={addListener:function(e,t,r,i){var s=n.Util.stamp(r),o="_leaflet_"+t+s,u,a,f;return e[o]?this:(u=function(t){return r.call(i||e,t||n.DomEvent._getEvent())},n.Browser.touch&&t==="dblclick"&&this.addDoubleTapListener?this.addDoubleTapListener(e,u,s):("addEventListener"in e?t==="mousewheel"?(e.addEventListener("DOMMouseScroll",u,!1),e.addEventListener(t,u,!1)):t==="mouseenter"||t==="mouseleave"?(a=u,f=t==="mouseenter"?"mouseover":"mouseout",u=function(t){if(!n.DomEvent._checkMouse(e,t))return;return a(t)},e.addEventListener(f,u,!1)):e.addEventListener(t,u,!1):"attachEvent"in e&&e.attachEvent("on"+t,u),e[o]=u,this))},removeListener:function(e,t,r){var i=n.Util.stamp(r),s="_leaflet_"+t+i,o=e[s];if(!o)return;return n.Browser.touch&&t==="dblclick"&&this.removeDoubleTapListener?this.removeDoubleTapListener(e,i):"removeEventListener"in e?t==="mousewheel"?(e.removeEventListener("DOMMouseScroll",o,!1),e.removeEventListener(t,o,!1)):t==="mouseenter"||t==="mouseleave"?e.removeEventListener(t==="mouseenter"?"mouseover":"mouseout",o,!1):e.removeEventListener(t,o,!1):"detachEvent"in e&&e.detachEvent("on"+t,o),e[s]=null,this},stopPropagation:function(e){return e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,this},disableClickPropagation:function(e){var t=n.DomEvent.stopPropagation;return n.DomEvent.addListener(e,n.Draggable.START,t).addListener(e,"click",t).addListener(e,"dblclick",t)},preventDefault:function(e){return e.preventDefault?e.preventDefault():e.returnValue=!1,this},stop:function(e){return n.DomEvent.preventDefault(e).stopPropagation(e)},getMousePosition:function(e,t){var r=document.body,i=document.documentElement,s=e.pageX?e.pageX:e.clientX+r.scrollLeft+i.scrollLeft,o=e.pageY?e.pageY:e.clientY+r.scrollTop+i.scrollTop,u=new n.Point(s,o);return t?u._subtract(n.DomUtil.getViewportOffset(t)):u},getWheelDelta:function(e){var t=0;return e.wheelDelta&&(t=e.wheelDelta/120),e.detail&&(t=-e.detail/3),t},_checkMouse:function(e,t){var n=t.relatedTarget;if(!n)return!0;try{while(n&&n!==e)n=n.parentNode}catch(r){return!1}return n!==e},_getEvent:function(){var t=e.event;if(!t){var n=arguments.callee.caller;while(n){t=n.arguments[0];if(t&&e.Event===t.constructor)break;n=n.caller}}return t}},n.DomEvent.on=n.DomEvent.addListener,n.DomEvent.off=n.DomEvent.removeListener,n.Draggable=n.Class.extend({includes:n.Mixin.Events,statics:{START:n.Browser.touch?"touchstart":"mousedown",END:n.Browser.touch?"touchend":"mouseup",MOVE:n.Browser.touch?"touchmove":"mousemove",TAP_TOLERANCE:15},initialize:function(e,t){this._element=e,this._dragStartTarget=t||e},enable:function(){if(this._enabled)return;n.DomEvent.on(this._dragStartTarget,n.Draggable.START,this._onDown,this),this._enabled=!0},disable:function(){if(!this._enabled)return;n.DomEvent.off(this._dragStartTarget,n.Draggable.START,this._onDown),this._enabled=!1,this._moved=!1},_onDown:function(e){if(!n.Browser.touch&&e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)return;this._simulateClick=!0;if(e.touches&&e.touches.length>1){this._simulateClick=!1;return}var t=e.touches&&e.touches.length===1?e.touches[0]:e,r=t.target;n.DomEvent.preventDefault(e),n.Browser.touch&&r.tagName.toLowerCase()==="a"&&n.DomUtil.addClass(r,"leaflet-active"),this._moved=!1;if(this._moving)return;this._startPos=this._newPos=n.DomUtil.getPosition(this._element),this._startPoint=new n.Point(t.clientX,t.clientY),n.DomEvent.on(document,n.Draggable.MOVE,this._onMove,this),n.DomEvent.on(document,n.Draggable.END,this._onUp,this)},_onMove:function(e){if(e.touches&&e.touches.length>1)return;var t=e.touches&&e.touches.length===1?e.touches[0]:e,r=new n.Point(t.clientX,t.clientY),i=r.subtract(this._startPoint);if(!i.x&&!i.y)return;n.DomEvent.preventDefault(e),this._moved||(this.fire("dragstart"),this._moved=!0,n.Browser.touch||(n.DomUtil.disableTextSelection(),this._setMovingCursor())),this._newPos=this._startPos.add(i),this._moving=!0,n.Util.cancelAnimFrame(this._animRequest),this._animRequest=n.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget)},_updatePosition:function(){this.fire("predrag"),n.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(e){if(this._simulateClick&&e.changedTouches){var t=e.changedTouches[0],r=t.target,i=this._newPos&&this._newPos.distanceTo(this._startPos)||0;r.tagName.toLowerCase()==="a"&&n.DomUtil.removeClass(r,"leaflet-active"),i<n.Draggable.TAP_TOLERANCE&&this._simulateEvent("click",t)}n.Browser.touch||(n.DomUtil.enableTextSelection(),this._restoreCursor()),n.DomEvent.off(document,n.Draggable.MOVE,this._onMove),n.DomEvent.off(document,n.Draggable.END,this._onUp),this._moved&&(n.Util.cancelAnimFrame(this._animRequest),this.fire("dragend")),this._moving=!1},_setMovingCursor:function(){n.DomUtil.addClass(document.body,"leaflet-dragging")},_restoreCursor:function(){n.DomUtil.removeClass(document.body,"leaflet-dragging")},_simulateEvent:function(t,n){var r=document.createEvent("MouseEvents");r.initMouseEvent(t,!0,!0,e,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(r)}}),n.Handler=n.Class.extend({initialize:function(e){this._map=e},enable:function(){if(this._enabled)return;this._enabled=!0,this.addHooks()},disable:function(){if(!this._enabled)return;this._enabled=!1,this.removeHooks()},enabled:function(){return!!this._enabled}}),n.Map.mergeOptions({dragging:!0,inertia:!n.Browser.android23,inertiaDeceleration:3e3,inertiaMaxSpeed:1500,inertiaThreshold:n.Browser.touch?32:14,worldCopyJump:!0}),n.Map.Drag=n.Handler.extend({addHooks:function(){if(!this._draggable){this._draggable=new n.Draggable(this._map._mapPane,this._map._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this);var e=this._map.options;e.worldCopyJump&&(this._draggable.on("predrag",this._onPreDrag,this),this._map.on("viewreset",this._onViewReset,this))}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){var e=this._map;e.fire("movestart").fire("dragstart"),e._panTransition&&e._panTransition._onTransitionEnd(!0),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(){if(this._map.options.inertia){var e=this._lastTime=+(new Date),t=this._lastPos=this._draggable._newPos;this._positions.push(t),this._times.push(e),e-this._times[0]>200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var e=this._map.getSize().divideBy(2),t=this._map.latLngToLayerPoint(new n.LatLng(0,0));this._initialWorldOffset=t.subtract(e).x,this._worldWidth=this._map.project(new n.LatLng(0,180)).x},_onPreDrag:function(){var e=this._map,t=this._worldWidth,n=Math.round(t/2),r=this._initialWorldOffset,i=this._draggable._newPos.x,s=(i-n+r)%t+n-r,o=(i+n+r)%t-n-r,u=Math.abs(s+r)<Math.abs(o+r)?s:o;this._draggable._newPos.x=u},_onDragEnd:function(){var e=this._map,r=e.options,i=+(new Date)-this._lastTime,s=!r.inertia||i>r.inertiaThreshold||this._positions[0]===t;if(s)e.fire("moveend");else{var o=this._lastPos.subtract(this._positions[0]),u=(this._lastTime+i-this._times[0])/1e3,a=o.multiplyBy(.58/u),f=a.distanceTo(new n.Point(0,0)),l=Math.min(r.inertiaMaxSpeed,f),c=a.multiplyBy(l/f),h=l/r.inertiaDeceleration,p=c.multiplyBy(-h/2).round(),d={duration:h,easing:"ease-out"};n.Util.requestAnimFrame(n.Util.bind(function(){this._map.panBy(p,d)},this))}e.fire("dragend"),r.maxBounds&&n.Util.requestAnimFrame(this._panInsideMaxBounds,e,!0,e._container)},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)}}),n.Map.addInitHook("addHandler","dragging",n.Map.Drag),n.Map.mergeOptions({doubleClickZoom:!0}),n.Map.DoubleClickZoom=n.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick)},_onDoubleClick:function(e){this.setView(e.latlng,this._zoom+1)}}),n.Map.addInitHook("addHandler","doubleClickZoom",n.Map.DoubleClickZoom),n.Map.mergeOptions({scrollWheelZoom:!n.Browser.touch}),n.Map.ScrollWheelZoom=n.Handler.extend({addHooks:function(){n.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){n.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll)},_onWheelScroll:function(e){var t=n.DomEvent.getWheelDelta(e);this._delta+=t,this._lastMousePos=this._map.mouseEventToContainerPoint(e),clearTimeout(this._timer),this._timer=setTimeout(n.Util.bind(this._performZoom,this),40),n.DomEvent.preventDefault(e)},_performZoom:function(){var e=this._map,t=Math.round(this._delta),n=e.getZoom();t=Math.max(Math.min(t,4),-4),t=e._limitZoom(n+t)-n,this._delta=0;if(!t)return;var r=n+t,i=this._getCenterForScrollWheelZoom(this._lastMousePos,r);e.setView(i,r)},_getCenterForScrollWheelZoom:function(e,t){var n=this._map,r=n.getZoomScale(t),i=n.getSize().divideBy(2),s=e.subtract(i).multiplyBy(1-1/r),o=n._getTopLeftPoint().add(i).add(s);return n.unproject(o)}}),n.Map.addInitHook("addHandler","scrollWheelZoom",n.Map.ScrollWheelZoom),n.Util.extend(n.DomEvent,{addDoubleTapListener:function(e,t,n){function l(e){if(e.touches.length!==1)return;var t=Date.now(),n=t-(r||t);o=e.touches[0],i=n>0&&n<=s,r=t}function c(e){i&&(o.type="dblclick",t(o),r=null)}var r,i=!1,s=250,o,u="_leaflet_",a="touchstart",f="touchend";return e[u+a+n]=l,e[u+f+n]=c,e.addEventListener(a,l,!1),e.addEventListener(f,c,!1),this},removeDoubleTapListener:function(e,t){var n="_leaflet_";return e.removeEventListener(e,e[n+"touchstart"+t],!1),e.removeEventListener(e,e[n+"touchend"+t],!1),this}}),n.Map.mergeOptions({touchZoom:n.Browser.touch&&!n.Browser.android23}),n.Map.TouchZoom=n.Handler.extend({addHooks:function(){n.DomEvent.on(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){n.DomEvent.off(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(e){var t=this._map;if(!e.touches||e.touches.length!==2||t._animatingZoom||this._zooming)return;var r=t.mouseEventToLayerPoint(e.touches[0]),i=t.mouseEventToLayerPoint(e.touches[1]),s=t._getCenterLayerPoint();this._startCenter=r.add(i).divideBy(2,!0),this._startDist=r.distanceTo(i),this._moved=!1,this._zooming=!0,this._centerOffset=s.subtract(this._startCenter),n.DomEvent.on(document,"touchmove",this._onTouchMove,this).on(document,"touchend",this._onTouchEnd,this),n.DomEvent.preventDefault(e)},_onTouchMove:function(e){if(!e.touches||e.touches.length!==2)return;var t=this._map,r=t.mouseEventToLayerPoint(e.touches[0]),i=t.mouseEventToLayerPoint(e.touches[1]);this._scale=r.distanceTo(i)/this._startDist,this._delta=r.add(i).divideBy(2,!0).subtract(this._startCenter);if(this._scale===1)return;this._moved||(n.DomUtil.addClass(t._mapPane,"leaflet-zoom-anim leaflet-touching"),t.fire("movestart").fire("zoomstart")._prepareTileBg(),this._moved=!0),n.Util.cancelAnimFrame(this._animRequest),this._animRequest=n.Util.requestAnimFrame(this._updateOnMove,this,!0,this._map._container),n.DomEvent.preventDefault(e)},_updateOnMove:function(){var e=this._map,t=this._getScaleOrigin(),r=e.layerPointToLatLng(t);e.fire("zoomanim",{center:r,zoom:e.getScaleZoom(this._scale)}),e._tileBg.style[n.DomUtil.TRANSFORM]=n.DomUtil.getTranslateString(this._delta)+" "+n.DomUtil.getScaleString(this._scale,this._startCenter)},_onTouchEnd:function(e){if(!this._moved||!this._zooming)return;var t=this._map;this._zooming=!1,n.DomUtil.removeClass(t._mapPane,"leaflet-touching"),n.DomEvent.off(document,"touchmove",this._onTouchMove).off(document,"touchend",this._onTouchEnd);var r=this._getScaleOrigin(),i=t.layerPointToLatLng(r),s=t.getZoom(),o=t.getScaleZoom(this._scale)-s,u=o>0?Math.ceil(o):Math.floor(o),a=t._limitZoom(s+u);t.fire("zoomanim",{center:i,zoom:a}),t._runAnimation(i,a,t.getZoomScale(a)/this._scale,r,!0)},_getScaleOrigin:function(){var e=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(e)}}),n.Map.addInitHook("addHandler","touchZoom",n.Map.TouchZoom),n.Map.mergeOptions({boxZoom:!0}),n.Map.BoxZoom=n.Handler.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane},addHooks:function(){n.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){n.DomEvent.off(this._container,"mousedown",this._onMouseDown)},_onMouseDown:function(e){if(!e.shiftKey||e.which!==1&&e.button!==1)return!1;n.DomUtil.disableTextSelection(),this._startLayerPoint=this._map.mouseEventToLayerPoint(e),this._box=n.DomUtil.create("div","leaflet-zoom-box",this._pane),n.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",n.DomEvent.on(document,"mousemove",this._onMouseMove,this).on(document,"mouseup",this._onMouseUp,this).preventDefault(e),this._map.fire("boxzoomstart")},_onMouseMove:function(e){var t=this._startLayerPoint,r=this._box,i=this._map.mouseEventToLayerPoint(e),s=i.subtract(t),o=new n.Point(Math.min(i.x,t.x),Math.min(i.y,t.y));n.DomUtil.setPosition(r,o),r.style.width=Math.abs(s.x)-4+"px",r.style.height=Math.abs(s.y)-4+"px"},_onMouseUp:function(e){this._pane.removeChild(this._box),this._container.style.cursor="",n.DomUtil.enableTextSelection(),n.DomEvent.off(document,"mousemove",this._onMouseMove).off(document,"mouseup",this._onMouseUp);var t=this._map,r=t.mouseEventToLayerPoint(e),i=new n.LatLngBounds(t.layerPointToLatLng(this._startLayerPoint),t.layerPointToLatLng(r));t.fitBounds(i),t.fire("boxzoomend",{boxZoomBounds:i})}}),n.Map.addInitHook("addHandler","boxZoom",n.Map.BoxZoom),n.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),n.Map.Keyboard=n.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61],zoomOut:[189,109]},initialize:function(e){this._map=e,this._setPanOffset(e.options.keyboardPanOffset),this._setZoomOffset(e.options.keyboardZoomOffset)},addHooks:function(){var e=this._map._container;e.tabIndex===-1&&(e.tabIndex="0"),n.DomEvent.addListener(e,"focus",this._onFocus,this).addListener(e,"blur",this._onBlur,this).addListener(e,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var e=this._map._container;n.DomEvent.removeListener(e,"focus",this._onFocus,this).removeListener(e,"blur",this._onBlur,this).removeListener(e,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){this._focused||this._map._container.focus()},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(e){var t=this._panKeys={},n=this.keyCodes,r,i;for(r=0,i=n.left.length;r<i;r++)t[n.left[r]]=[-1*e,0];for(r=0,i=n.right.length;r<i;r++)t[n.right[r]]=[e,0];for(r=0,i=n.down.length;r<i;r++)t[n.down[r]]=[0,e];for(r=0,i=n.up.length;r<i;r++)t[n.up[r]]=[0,-1*e]},_setZoomOffset:function(e){var t=this._zoomKeys={},n=this.keyCodes,r,i;for(r=0,i=n.zoomIn.length;r<i;r++)t[n.zoomIn[r]]=e;for(r=0,i=n.zoomOut.length;r<i;r++)t[n.zoomOut[r]]=-e},_addHooks:function(){n.DomEvent.addListener(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){n.DomEvent.removeListener(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(e){var t=e.keyCode;if(this._panKeys.hasOwnProperty(t))this._map.panBy(this._panKeys[t]);else{if(!this._zoomKeys.hasOwnProperty(t))return;this._map.setZoom(this._map.getZoom()+this._zoomKeys[t])}n.DomEvent.stop(e)}}),n.Map.addInitHook("addHandler","keyboard",n.Map.Keyboard),n.Handler.MarkerDrag=n.Handler.extend({initialize:function(e){this._marker=e},addHooks:function(){var e=this._marker._icon;this._draggable||(this._draggable=(new n.Draggable(e,e)).on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this)),this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(e){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(e){var t=n.DomUtil.getPosition(this._marker._icon);this._marker._shadow&&n.DomUtil.setPosition(this._marker._shadow,t),this._marker._latlng=this._marker._map.layerPointToLatLng(t),this._marker.fire("move").fire("drag")},_onDragEnd:function(){this._marker.fire("moveend").fire("dragend")}}),n.Handler.PolyEdit=n.Handler.extend({options:{icon:new n.DivIcon({iconSize:new n.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"})},initialize:function(e,t){this._poly=e,n.Util.setOptions(this,t)},addHooks:function(){this._poly._map&&(this._markerGroup||this._initMarkers(),this._poly._map.addLayer(this._markerGroup))},removeHooks:function(){this._poly._map&&(this._poly._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers)},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new n.LayerGroup),this._markers=[];var e=this._poly._latlngs,t,r,i,s;for(t=0,i=e.length;t<i;t++)s=this._createMarker(e[t],t),s.on("click",this._onMarkerClick,this),this._markers.push(s);var o,u;for(t=0,r=i-1;t<i;r=t++){if(t===0&&!(n.Polygon&&this._poly instanceof n.Polygon))continue;o=this._markers[r],u=this._markers[t],this._createMiddleMarker(o,u),this._updatePrevNext(o,u)}},_createMarker:function(e,t){var r=new n.Marker(e,{draggable:!0,icon:this.options.icon});return r._origLatLng=e,r._index=t,r.on("drag",this._onMarkerDrag,this),r.on("dragend",this._fireEdit,this),this._markerGroup.addLayer(r),r},_fireEdit:function(){this._poly.fire("edit")},_onMarkerDrag:function(e){var t=e.target;n.Util.extend(t._origLatLng,t._latlng),t._middleLeft&&t._middleLeft.setLatLng(this._getMiddleLatLng(t._prev,t)),t._middleRight&&t._middleRight.setLatLng(this._getMiddleLatLng(t,t._next)),this._poly.redraw()},_onMarkerClick:function(e){if(this._poly._latlngs.length<3)return;var t=e.target,n=t._index;t._prev&&t._next&&(this._createMiddleMarker(t._prev,t._next),this._updatePrevNext(t._prev,t._next)),this._markerGroup.removeLayer(t),t._middleLeft&&this._markerGroup.removeLayer(t._middleLeft),t._middleRight&&this._markerGroup.removeLayer(t._middleRight),this._markers.splice(n,1),this._poly.spliceLatLngs(n,1),this._updateIndexes(n,-1),this._poly.fire("edit")},_updateIndexes:function(e,t){this._markerGroup.eachLayer(function(n){n._index>e&&(n._index+=t)})},_createMiddleMarker:function(e,t){var n=this._getMiddleLatLng(e,t),r=this._createMarker(n),i,s,o;r.setOpacity(.6),e._middleRight=t._middleLeft=r,s=function(){var s=t._index;r._index=s,r.off("click",i).on("click",this._onMarkerClick,this),n.lat=r.getLatLng().lat,n.lng=r.getLatLng().lng,this._poly.spliceLatLngs(s,0,n),this._markers.splice(s,0,r),r.setOpacity(1),this._updateIndexes(s,1),t._index++,this._updatePrevNext(e,r),this._updatePrevNext(r,t)},o=function(){r.off("dragstart",s,this),r.off("dragend",o,this),this._createMiddleMarker(e,r),this._createMiddleMarker(r,t)},i=function(){s.call(this),o.call(this),this._poly.fire("edit")},r.on("click",i,this).on("dragstart",s,this).on("dragend",o,this),this._markerGroup.addLayer(r)},_updatePrevNext:function(e,t){e._next=t,t._prev=e},_getMiddleLatLng:function(e,t){var n=this._poly._map,r=n.latLngToLayerPoint(e.getLatLng()),i=n.latLngToLayerPoint(t.getLatLng());return n.layerPointToLatLng(r._add(i).divideBy(2))}}),n.Control=n.Class.extend({options:{position:"topright"},initialize:function(e){n.Util.setOptions(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var t=this._map;return t&&t.removeControl(this),this.options.position=e,t&&t.addControl(this),this},addTo:function(e){this._map=e;var t=this._container=this.onAdd(e),r=this.getPosition(),i=e._controlCorners[r];return n.DomUtil.addClass(t,"leaflet-control"),r.indexOf("bottom")!==-1?i.insertBefore(t,i.firstChild):i.appendChild(t),this},removeFrom:function(e){var t=this.getPosition(),n=e._controlCorners[t];return n.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(e),this}}),n.control=function(e){return new n.Control(e)},n.Map.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.removeFrom(this),this},_initControlPos:function(){function i(i,s){var o=t+i+" "+t+s;e[i+s]=n.DomUtil.create("div",o,r)}var e=this._controlCorners={},t="leaflet-",r=this._controlContainer=n.DomUtil.create("div",t+"control-container",this._container);i("top","left"),i("top","right"),i("bottom","left"),i("bottom","right")}}),n.Control.Zoom=n.Control.extend({options:{position:"topleft"},onAdd:function(e){var t="leaflet-control-zoom",r=n.DomUtil.create("div",t);return this._createButton("Zoom in",t+"-in",r,e.zoomIn,e),this._createButton("Zoom out",t+"-out",r,e.zoomOut,e),r},_createButton:function(e,t,r,i,s){var o=n.DomUtil.create("a",t,r);return o.href="#",o.title=e,n.DomEvent.on(o,"click",n.DomEvent.stopPropagation).on(o,"click",n.DomEvent.preventDefault).on(o,"click",i,s).on(o,"dblclick",n.DomEvent.stopPropagation),o}}),n.Map.mergeOptions({zoomControl:!0}),n.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new n.Control.Zoom,this.addControl(this.zoomControl))}),n.control.zoom=function(e){return new n.Control.Zoom(e)},n.Control.Attribution=n.Control.extend({options:{position:"bottomright",prefix:'Powered by <a href="http://leaflet.cloudmade.com">Leaflet</a>'},initialize:function(e){n.Util.setOptions(this,e),this._attributions={}},onAdd:function(e){return this._container=n.DomUtil.create("div","leaflet-control-attribution"),n.DomEvent.disableClickPropagation(this._container),e.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(e){e.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){if(!e)return;return this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this},removeAttribution:function(e){if(!e)return;return this._attributions[e]--,this._update(),this},_update:function(){if(!this._map)return;var e=[];for(var t in this._attributions)this._attributions.hasOwnProperty(t)&&this._attributions[t]&&e.push(t);var n=[];this.options.prefix&&n.push(this.options.prefix),e.length&&n.push(e.join(", ")),this._container.innerHTML=n.join(" — ")},_onLayerAdd:function(e){e.layer.getAttribution&&this.addAttribution(e.layer.getAttribution())},_onLayerRemove:function(e){e.layer.getAttribution&&this.removeAttribution(e.layer.getAttribution())}}),n.Map.mergeOptions({attributionControl:!0}),n.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new n.Control.Attribution).addTo(this))}),n.control.attribution=function(e){return new n.Control.Attribution(e)},n.Control.Scale=n.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(e){this._map=e;var t="leaflet-control-scale",r=n.DomUtil.create("div",t),i=this.options;return this._addScales(i,t,r),e.on(i.updateWhenIdle?"moveend":"move",this._update,this),this._update(),r},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,t,r){e.metric&&(this._mScale=n.DomUtil.create("div",t+"-line",r)),e.imperial&&(this._iScale=n.DomUtil.create("div",t+"-line",r))},_update:function(){var e=this._map.getBounds(),t=e.getCenter().lat,n=6378137*Math.PI*Math.cos(t*Math.PI/180),r=n*(e.getNorthEast().lng-e.getSouthWest().lng)/180,i=this._map.getSize(),s=this.options,o=0;i.x>0&&(o=r*(s.maxWidth/i.x)),this._updateScales(s,o)},_updateScales:function(e,t){e.metric&&t&&this._updateMetric(t),e.imperial&&t&&this._updateImperial(t)},_updateMetric:function(e){var t=this._getRoundNum(e);this._mScale.style.width=this._getScaleWidth(t/e)+"px",this._mScale.innerHTML=t<1e3?t+" m":t/1e3+" km"},_updateImperial:function(e){var t=e*3.2808399,n=this._iScale,r,i,s;t>5280?(r=t/5280,i=this._getRoundNum(r),n.style.width=this._getScaleWidth(i/r)+"px",n.innerHTML=i+" mi"):(s=this._getRoundNum(t),n.style.width=this._getScaleWidth(s/t)+"px",n.innerHTML=s+" ft")},_getScaleWidth:function(e){return Math.round(this.options.maxWidth*e)-10},_getRoundNum:function(e){var t=Math.pow(10,(Math.floor(e)+"").length-1),n=e/t;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1,t*n}}),n.control.scale=function(e){return new n.Control.Scale(e)},n.Control.Layers=n.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(e,t,r){n.Util.setOptions(this,r),this._layers={},this._lastZIndex=0;for(var i in e)e.hasOwnProperty(i)&&this._addLayer(e[i],i);for(i in t)t.hasOwnProperty(i)&&this._addLayer(t[i],i,!0)},onAdd:function(e){return this._initLayout(),this._update(),this._container},addBaseLayer:function(e,t){return this._addLayer(e,t),this._update(),this},addOverlay:function(e,t){return this._addLayer(e,t,!0),this._update(),this},removeLayer:function(e){var t=n.Util.stamp(e);return delete this._layers[t],this._update(),this},_initLayout:function(){var e="leaflet-control-layers",t=this._container=n.DomUtil.create("div",e);n.Browser.touch?n.DomEvent.on(t,"click",n.DomEvent.stopPropagation):n.DomEvent.disableClickPropagation(t);var r=this._form=n.DomUtil.create("form",e+"-list");if(this.options.collapsed){n.DomEvent.on(t,"mouseover",this._expand,this).on(t,"mouseout",this._collapse,this);var i=this._layersLink=n.DomUtil.create("a",e+"-toggle",t);i.href="#",i.title="Layers",n.Browser.touch?n.DomEvent.on(i,"click",n.DomEvent.stopPropagation).on(i,"click",n.DomEvent.preventDefault).on(i,"click",this._expand,this):n.DomEvent.on(i,"focus",this._expand,this),this._map.on("movestart",this._collapse,this)}else this._expand();this._baseLayersList=n.DomUtil.create("div",e+"-base",r),this._separator=n.DomUtil.create("div",e+"-separator",r),this._overlaysList=n.DomUtil.create("div",e+"-overlays",r),t.appendChild(r)},_addLayer:function(e,t,r){var i=n.Util.stamp(e);this._layers[i]={layer:e,name:t,overlay:r},this.options.autoZIndex&&e.setZIndex&&(this._lastZIndex++,e.setZIndex(this._lastZIndex))},_update:function(){if(!this._container)return;this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var e=!1,t=!1;for(var n in this._layers)if(this._layers.hasOwnProperty(n)){var r=this._layers[n];this._addItem(r),t=t||r.overlay,e=e||!r.overlay}this._separator.style.display=t&&e?"":"none"},_createRadioElement:function(e,t){var n='<input type="radio" name="'+e+'"';t&&(n+=' checked="checked"'),n+="/>";var r=document.createElement("div");return r.innerHTML=n,r.firstChild},_addItem:function(e){var t=document.createElement("label"),r,i=this._map.hasLayer(e.layer);e.overlay?(r=document.createElement("input"),r.type="checkbox",r.defaultChecked=i):r=this._createRadioElement("leaflet-base-layers",i),r.layerId=n.Util.stamp(e.layer),n.DomEvent.on(r,"click",this._onInputClick,this);var s=document.createTextNode(" "+e.name);t.appendChild(r),t.appendChild(s);var o=e.overlay?this._overlaysList:this._baseLayersList;o.appendChild(t)},_onInputClick:function(){var e,t,n,r=this._form.getElementsByTagName("input"),i=r.length;for(e=0;e<i;e++)t=r[e],n=this._layers[t.layerId],t.checked?this._map.addLayer(n.layer,!n.overlay):this._map.removeLayer(n.layer)},_expand:function(){n.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-layers-expanded","")}}),n.control.layers=function(e,t,r){return new n.Control.Layers(e,t,r)},n.Transition=n.Class.extend({includes:n.Mixin.Events,statics:{CUSTOM_PROPS_SETTERS:{position:n.DomUtil.setPosition},implemented:function(){return n.Transition.NATIVE||n.Transition.TIMER}},options:{easing:"ease",duration:.5},_setProperty:function(e,t){var r=n.Transition.CUSTOM_PROPS_SETTERS;e in r?r[e](this._el,t):this._el.style[e]=t}}),n.Transition=n.Transition.extend({statics:function(){var e=n.DomUtil.TRANSITION,t=e==="webkitTransition"||e==="OTransition"?e+"End":"transitionend";return{NATIVE:!!e,TRANSITION:e,PROPERTY:e+"Property",DURATION:e+"Duration",EASING:e+"TimingFunction",END:t,CUSTOM_PROPS_PROPERTIES:{position:n.Browser.any3d?n.DomUtil.TRANSFORM:"top, left"}}}(),options:{fakeStepInterval:100},initialize:function(e,t){this._el=e,n.Util.setOptions(this,t),n.DomEvent.on(e,n.Transition.END,this._onTransitionEnd,this),this._onFakeStep=n.Util.bind(this._onFakeStep,this)},run:function(e){var t,r=[],i=n.Transition.CUSTOM_PROPS_PROPERTIES;for(t in e)e.hasOwnProperty(t)&&(t=i[t]?i[t]:t,t=this._dasherize(t),r.push(t));this._el.style[n.Transition.DURATION]=this.options.duration+"s",this._el.style[n.Transition.EASING]=this.options.easing,this._el.style[n.Transition.PROPERTY]="all";for(t in e)e.hasOwnProperty(t)&&this._setProperty(t,e[t]);n.Util.falseFn(this._el.offsetWidth),this._inProgress=!0,n.Browser.mobileWebkit&&(this.backupEventFire=setTimeout(n.Util.bind(this._onBackupFireEnd,this),this.options.duration*1.2*1e3)),n.Transition.NATIVE?(clearInterval(this._timer),this._timer=setInterval(this._onFakeStep,this.options.fakeStepInterval)):this._onTransitionEnd()},_dasherize:function(){function t(e){return"-"+e.toLowerCase()}var e=/([A-Z])/g;return function(n){return n.replace(e,t)}}(),_onFakeStep:function(){this.fire("step")},_onTransitionEnd:function(e){this._inProgress&&(this._inProgress=!1,clearInterval(this._timer),this._el.style[n.Transition.TRANSITION]="",clearTimeout(this.backupEventFire),delete this.backupEventFire,this.fire("step"),e&&e.type&&this.fire("end"))},_onBackupFireEnd:function(){var e=document.createEvent("Event");e.initEvent(n.Transition.END,!0,!1),this._el.dispatchEvent(e)}}),n.Transition=n.Transition.NATIVE?n.Transition:n.Transition.extend({statics:{getTime:Date.now||function(){return+(new Date)},TIMER:!0,EASINGS:{linear:function(e){return e},"ease-out":function(e){return e*(2-e)}},CUSTOM_PROPS_GETTERS:{position:n.DomUtil.getPosition},UNIT_RE:/^[\d\.]+(\D*)$/},options:{fps:50},initialize:function(e,t){this._el=e,n.Util.extend(this.options,t),this._easing=n.Transition.EASINGS[this.options.easing]||n.Transition.EASINGS["ease-out"],this._step=n.Util.bind(this._step,this),this._interval=Math.round(1e3/this.options.fps)},run:function(e){this._props={};var t=n.Transition.CUSTOM_PROPS_GETTERS,r=n.Transition.UNIT_RE;this.fire("start");for(var i in e)if(e.hasOwnProperty(i)){var s={};if(i in t)s.from=t[i](this._el);else{var o=this._el.style[i].match(r);s.from=parseFloat(o[0]),s.unit=o[1]}s.to=e[i],this._props[i]=s}clearInterval(this._timer),this._timer=setInterval(this._step,this._interval),this._startTime=n.Transition.getTime()},_step:function(){var e=n.Transition.getTime(),t=e-this._startTime,r=this.options.duration*1e3;t<r?this._runFrame(this._easing(t/r)):(this._runFrame(1),this._complete())},_runFrame:function(e){var t=n.Transition.CUSTOM_PROPS_SETTERS,r,i,s;for(r in this._props)this._props.hasOwnProperty(r)&&(i=this._props[r],r in t?(s=i.to.subtract(i.from).multiplyBy(e).add(i.from),t[r](this._el,s)):this._el.style[r]=(i.to-i.from)*e+i.from+i.unit);this.fire("step")},_complete:function(){clearInterval(this._timer),this.fire("end")}}),n.Map.include(!n.Transition||!n.Transition.implemented()?{}:{setView:function(e,t,n){t=this._limitZoom(t);var r=this._zoom!==t;if(this._loaded&&!n&&this._layers){var i=r?this._zoomToIfClose&&this._zoomToIfClose(e,t):this._panByIfClose(e);if(i)return clearTimeout(this._sizeTimer),this}return this._resetView(e,t),this},panBy:function(e,t){return e=n.point(e),!e.x&&!e.y?this:(this._panTransition||(this._panTransition=new n.Transition(this._mapPane),this._panTransition.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),n.Util.setOptions(this._panTransition,n.Util.extend({duration:.25},t)),this.fire("movestart"),n.DomUtil.addClass(this._mapPane,"leaflet-pan-anim"),this._panTransition.run({position:n.DomUtil.getPosition(this._mapPane).subtract(e)}),this)},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){n.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_panByIfClose:function(e){var t=this._getCenterOffset(e)._floor();return this._offsetIsWithinView(t)?(this.panBy(t),!0):!1},_offsetIsWithinView:function(e,t){var n=t||1,r=this.getSize();return Math.abs(e.x)<=r.x*n&&Math.abs(e.y)<=r.y*n}}),n.Map.mergeOptions({zoomAnimation:n.DomUtil.TRANSITION&&!n.Browser.android23&&!n.Browser.mobileOpera}),n.DomUtil.TRANSITION&&n.Map.addInitHook(function(){n.DomEvent.on(this._mapPane,n.Transition.END,this._catchTransitionEnd,this)}),n.Map.include(n.DomUtil.TRANSITION?{_zoomToIfClose:function(e,t){if(this._animatingZoom)return!0;if(!this.options.zoomAnimation)return!1;var r=this.getZoomScale(t),i=this._getCenterOffset(e).divideBy(1-1/r);if(!this._offsetIsWithinView(i,1))return!1;n.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this.fire("movestart").fire("zoomstart"),this.fire("zoomanim",{center:e,zoom:t});var s=this._getCenterLayerPoint().add(i);return this._prepareTileBg(),this._runAnimation(e,t,r,s),!0},_catchTransitionEnd:function(e){this._animatingZoom&&this._onZoomTransitionEnd()},_runAnimation:function(e,t,r,i,s){this._animateToCenter=e,this._animateToZoom=t,this._animatingZoom=!0;var o=n.DomUtil.TRANSFORM,u=this._tileBg;clearTimeout(this._clearTileBgTimer),n.Util.falseFn(u.offsetWidth);var a=n.DomUtil.getScaleString(r,i),f=u.style[o];u.style[o]=s?f+" "+a:a+" "+f},_prepareTileBg:function(){var e=this._tilePane,t=this._tileBg;if(t&&this._getLoadedTilesPercentage(t)>.5&&this._getLoadedTilesPercentage(e)<.5){e.style.visibility="hidden",e.empty=!0,this._stopLoadingImages(e);return}t||(t=this._tileBg=this._createPane("leaflet-tile-pane",this._mapPane),t.style.zIndex=1),t.style[n.DomUtil.TRANSFORM]="",t.style.visibility="hidden",t.empty=!0,e.empty=!1,this._tilePane=this._panes.tilePane=t;var r=this._tileBg=e;n.DomUtil.addClass(r,"leaflet-zoom-animated"),this._stopLoadingImages(r)},_getLoadedTilesPercentage:function(e){var t=e.getElementsByTagName("img"),n,r,i=0;for(n=0,r=t.length;n<r;n++)t[n].complete&&i++;return i/r},_stopLoadingImages:function(e){var t=Array.prototype.slice.call(e.getElementsByTagName("img")),r,i,s;for(r=0,i=t.length;r<i;r++)s=t[r],s.complete||(s.onload=n.Util.falseFn,s.onerror=n.Util.falseFn,s.src=n.Util.emptyImageUrl,s.parentNode.removeChild(s))},_onZoomTransitionEnd:function(){this._restoreTileFront(),n.Util.falseFn(this._tileBg.offsetWidth),this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),n.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1},_restoreTileFront:function(){this._tilePane.innerHTML="",this._tilePane.style.visibility="",this._tilePane.style.zIndex=2,this._tileBg.style.zIndex=1},_clearTileBg:function(){!this._animatingZoom&&!this.touchZoom._zooming&&(this._tileBg.innerHTML="")}}:{}),n.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:Infinity,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(e){e=this._locationOptions=n.Util.extend(this._defaultLocateOptions,e);if(!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var t=n.Util.bind(this._handleGeolocationResponse,this),r=n.Util.bind(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(t,r,e):navigator.geolocation.getCurrentPosition(t,r,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch(this._locationWatchId),this},_handleGeolocationError:function(e){var t=e.code,n=e.message||(t===1?"permission denied":t===2?"position unavailable":"timeout");this._locationOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:t,message:"Geolocation error: "+n+"."})},_handleGeolocationResponse:function(e){var t=180*e.coords.accuracy/4e7,r=t*2,i=e.coords.latitude,s=e.coords.longitude,o=new n.LatLng(i,s),u=new n.LatLng(i-t,s-r),a=new n.LatLng(i+t,s+r),f=new n.LatLngBounds(u,a),l=this._locationOptions;if(l.setView){var c=Math.min(this.getBoundsZoom(f),l.maxZoom);this.setView(o,c)}this.fire("locationfound",{latlng:o,bounds:f,accuracy:e.coords.accuracy})}})})(this); | dy-dx/cdnjs | ajax/libs/leaflet/0.4.5/leaflet.js | JavaScript | mit | 106,308 |
YUI.add('recordset-indexer', function(Y) {
/**
* Provides the ability to store multiple custom hash tables referencing records in the recordset.
* @module recordset
* @submodule recordset-indexer
*/
/**
* Plugin that provides the ability to store multiple custom hash tables referencing records in the recordset.
* This utility does not support any collision handling. New hash table entries with a used key overwrite older ones.
* @class RecordsetIndexer
*/
function RecordsetIndexer(config) {
RecordsetIndexer.superclass.constructor.apply(this, arguments);
}
Y.mix(RecordsetIndexer, {
NS: "indexer",
NAME: "recordsetIndexer",
ATTRS: {
/**
* @description Collection of all the hashTables created by the plugin.
* The individual tables can be accessed by the key they are hashing against.
*
* @attribute hashTables
* @public
* @type object
*/
hashTables: {
value: {
}
},
keys: {
value: {
}
}
}
});
Y.extend(RecordsetIndexer, Y.Plugin.Base, {
initializer: function(config) {
var host = this.get('host');
//setup listeners on recordset events
this.onHostEvent('add', Y.bind("_defAddHash", this), host);
this.onHostEvent('remove', Y.bind('_defRemoveHash', this), host);
this.onHostEvent('update', Y.bind('_defUpdateHash', this), host);
},
destructor: function(config) {
},
/**
* @description Setup the hash table for a given key with all existing records in the recordset
*
* @method _setHashTable
* @param key {string} A key to hash by.
* @return obj {object} The created hash table
* @private
*/
_setHashTable: function(key) {
var host = this.get('host'),
obj = {},
i = 0,
len = host.getLength();
for (; i < len; i++) {
obj[host._items[i].getValue(key)] = host._items[i];
}
return obj;
},
//---------------------------------------------
// Syncing Methods
//---------------------------------------------
/**
* @description Updates all hash tables when a record is added to the recordset
*
* @method _defAddHash
* @private
*/
_defAddHash: function(e) {
var tbl = this.get('hashTables');
//Go through every hashtable that is stored.
//in each hashtable, look to see if the key is represented in the object being added.
Y.each(tbl,
function(v, key) {
Y.each(e.added || e.updated,
function(o) {
//if the object being added has a key which is being stored by hashtable v, add it into the table.
if (o.getValue(key)) {
v[o.getValue(key)] = o;
}
});
});
},
/**
* @description Updates all hash tables when a record is removed from the recordset
*
* @method _defRemoveHash
* @private
*/
_defRemoveHash: function(e) {
var tbl = this.get('hashTables'),
reckey;
//Go through every hashtable that is stored.
//in each hashtable, look to see if the key is represented in the object being deleted.
Y.each(tbl,
function(v, key) {
Y.each(e.removed || e.overwritten,
function(o) {
reckey = o.getValue(key);
//if the hashtable has a key storing a record, and the key and the record both match the record being deleted, delete that row from the hashtable
if (reckey && v[reckey] === o) {
delete v[reckey];
}
});
});
},
/**
* @description Updates all hash tables when the recordset is updated (a combination of add and remove)
*
* @method _defUpdateHash
* @private
*/
_defUpdateHash: function(e) {
//TODO: It will be more performant to create a new method rather than using _defAddHash, _defRemoveHash, due to the number of loops. See commented code.
e.added = e.updated;
e.removed = e.overwritten;
this._defAddHash(e);
this._defRemoveHash(e);
/*
var tbl = this.get('hashTables'), reckey;
Y.each(tbl, function(v, key) {
Y.each(e.updated, function(o, i) {
//delete record from hashtable if it has been overwritten
reckey = o.getValue(key);
if (reckey) {
v[reckey] = o;
}
//the undefined case is if more records are updated than currently exist in the recordset.
if (e.overwritten[i] && (v[e.overwritten[i].getValue(key)] === e.overwritten[i])) {
delete v[e.overwritten[i].getValue(key)];
}
// if (v[reckey] === o) {
// delete v[reckey];
// }
//
// //add the new updated record if it has a key that corresponds to a hash table
// if (o.getValue(key)) {
// v[o.getValue(key)] = o;
// }
});
});
*/
},
//---------------------------------------------
// Public Methods
//---------------------------------------------
/**
* @description Creates a new hash table.
*
* @method createTable
* @param key {string} A key to hash by.
* @return tbls[key] {object} The created hash table
* @public
*/
createTable: function(key) {
var tbls = this.get('hashTables');
tbls[key] = this._setHashTable(key);
this.set('hashTables', tbls);
return tbls[key];
},
/**
* @description Get a hash table that hashes records by a given key.
*
* @method getTable
* @param key {string} A key to hash by.
* @return table {object} The created hash table
* @public
*/
getTable: function(key) {
return this.get('hashTables')[key];
}
});
Y.namespace("Plugin").RecordsetIndexer = RecordsetIndexer;
}, '@VERSION@' ,{requires:['recordset-base','plugin']});
| nouveller/cdnjs | ajax/libs/yui/3.3.0/recordset/recordset-indexer.js | JavaScript | mit | 6,092 |
/* Port of TextMate's Blackboard theme */
.cm-s-blackboard.CodeMirror { background: #0C1021; color: #F8F8F8; }
.cm-s-blackboard .CodeMirror-selected { background: #253B76 !important; }
.cm-s-blackboard .CodeMirror-gutters { background: #0C1021; border-right: 0; }
.cm-s-blackboard .CodeMirror-guttermarker { color: #FBDE2D; }
.cm-s-blackboard .CodeMirror-guttermarker-subtle { color: #888; }
.cm-s-blackboard .CodeMirror-linenumber { color: #888; }
.cm-s-blackboard .CodeMirror-cursor { border-left: 1px solid #A7A7A7 !important; }
.cm-s-blackboard .cm-keyword { color: #FBDE2D; }
.cm-s-blackboard .cm-atom { color: #D8FA3C; }
.cm-s-blackboard .cm-number { color: #D8FA3C; }
.cm-s-blackboard .cm-def { color: #8DA6CE; }
.cm-s-blackboard .cm-variable { color: #FF6400; }
.cm-s-blackboard .cm-operator { color: #FBDE2D;}
.cm-s-blackboard .cm-comment { color: #AEAEAE; }
.cm-s-blackboard .cm-string { color: #61CE3C; }
.cm-s-blackboard .cm-string-2 { color: #61CE3C; }
.cm-s-blackboard .cm-meta { color: #D8FA3C; }
.cm-s-blackboard .cm-builtin { color: #8DA6CE; }
.cm-s-blackboard .cm-tag { color: #8DA6CE; }
.cm-s-blackboard .cm-attribute { color: #8DA6CE; }
.cm-s-blackboard .cm-header { color: #FF6400; }
.cm-s-blackboard .cm-hr { color: #AEAEAE; }
.cm-s-blackboard .cm-link { color: #8DA6CE; }
.cm-s-blackboard .cm-error { background: #9D1E15; color: #F8F8F8; }
.cm-s-blackboard .CodeMirror-activeline-background {background: #3C3636 !important;}
.cm-s-blackboard .CodeMirror-matchingbracket {outline:1px solid grey;color:white !important} | ektx/screencasts | bower_components/codemirror/theme/blackboard.css | CSS | mit | 1,543 |
/**
* @license
* Lo-Dash 2.4.1 (Custom Build) <http://lodash.com/>
* Build: `lodash -o ./dist/lodash.compat.js`
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <http://lodash.com/license>
*/
;(function() {
/** Used as a safe reference for `undefined` in pre ES5 environments */
var undefined;
/** Used to pool arrays and objects used internally */
var arrayPool = [],
objectPool = [];
/** Used to generate unique IDs */
var idCounter = 0;
/** Used internally to indicate various things */
var indicatorObject = {};
/** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */
var keyPrefix = +new Date + '';
/** Used as the size when optimizations are enabled for large arrays */
var largeArraySize = 75;
/** Used as the max size of the `arrayPool` and `objectPool` */
var maxPoolSize = 40;
/** Used to detect and test whitespace */
var whitespace = (
// whitespace
' \t\x0B\f\xA0\ufeff' +
// line terminators
'\n\r\u2028\u2029' +
// unicode category "Zs" space separators
'\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000'
);
/** Used to match empty string literals in compiled template source */
var reEmptyStringLeading = /\b__p \+= '';/g,
reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
/**
* Used to match ES6 template delimiters
* http://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-string-literals
*/
var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
/** Used to match regexp flags from their coerced string values */
var reFlags = /\w*$/;
/** Used to detected named functions */
var reFuncName = /^\s*function[ \n\r\t]+\w/;
/** Used to match "interpolate" template delimiters */
var reInterpolate = /<%=([\s\S]+?)%>/g;
/** Used to match leading whitespace and zeros to be removed */
var reLeadingSpacesAndZeros = RegExp('^[' + whitespace + ']*0+(?=.$)');
/** Used to ensure capturing order of template delimiters */
var reNoMatch = /($^)/;
/** Used to detect functions containing a `this` reference */
var reThis = /\bthis\b/;
/** Used to match unescaped characters in compiled string literals */
var reUnescapedString = /['\n\r\t\u2028\u2029\\]/g;
/** Used to assign default `context` object properties */
var contextProps = [
'Array', 'Boolean', 'Date', 'Error', 'Function', 'Math', 'Number', 'Object',
'RegExp', 'String', '_', 'attachEvent', 'clearTimeout', 'isFinite', 'isNaN',
'parseInt', 'setTimeout'
];
/** Used to fix the JScript [[DontEnum]] bug */
var shadowedProps = [
'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable',
'toLocaleString', 'toString', 'valueOf'
];
/** Used to make template sourceURLs easier to identify */
var templateCounter = 0;
/** `Object#toString` result shortcuts */
var argsClass = '[object Arguments]',
arrayClass = '[object Array]',
boolClass = '[object Boolean]',
dateClass = '[object Date]',
errorClass = '[object Error]',
funcClass = '[object Function]',
numberClass = '[object Number]',
objectClass = '[object Object]',
regexpClass = '[object RegExp]',
stringClass = '[object String]';
/** Used to identify object classifications that `_.clone` supports */
var cloneableClasses = {};
cloneableClasses[funcClass] = false;
cloneableClasses[argsClass] = cloneableClasses[arrayClass] =
cloneableClasses[boolClass] = cloneableClasses[dateClass] =
cloneableClasses[numberClass] = cloneableClasses[objectClass] =
cloneableClasses[regexpClass] = cloneableClasses[stringClass] = true;
/** Used as an internal `_.debounce` options object */
var debounceOptions = {
'leading': false,
'maxWait': 0,
'trailing': false
};
/** Used as the property descriptor for `__bindData__` */
var descriptor = {
'configurable': false,
'enumerable': false,
'value': null,
'writable': false
};
/** Used as the data object for `iteratorTemplate` */
var iteratorData = {
'args': '',
'array': null,
'bottom': '',
'firstArg': '',
'init': '',
'keys': null,
'loop': '',
'shadowedProps': null,
'support': null,
'top': '',
'useHas': false
};
/** Used to determine if values are of the language type Object */
var objectTypes = {
'boolean': false,
'function': true,
'object': true,
'number': false,
'string': false,
'undefined': false
};
/** Used to escape characters for inclusion in compiled string literals */
var stringEscapes = {
'\\': '\\',
"'": "'",
'\n': 'n',
'\r': 'r',
'\t': 't',
'\u2028': 'u2028',
'\u2029': 'u2029'
};
/** Used as a reference to the global object */
var root = (objectTypes[typeof window] && window) || this;
/** Detect free variable `exports` */
var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;
/** Detect free variable `module` */
var freeModule = objectTypes[typeof module] && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports` */
var moduleExports = freeModule && freeModule.exports === freeExports && freeExports;
/** Detect free variable `global` from Node.js or Browserified code and use it as `root` */
var freeGlobal = objectTypes[typeof global] && global;
if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
root = freeGlobal;
}
/*--------------------------------------------------------------------------*/
/**
* The base implementation of `_.indexOf` without support for binary searches
* or `fromIndex` constraints.
*
* @private
* @param {Array} array The array to search.
* @param {*} value The value to search for.
* @param {number} [fromIndex=0] The index to search from.
* @returns {number} Returns the index of the matched value or `-1`.
*/
function baseIndexOf(array, value, fromIndex) {
var index = (fromIndex || 0) - 1,
length = array ? array.length : 0;
while (++index < length) {
if (array[index] === value) {
return index;
}
}
return -1;
}
/**
* An implementation of `_.contains` for cache objects that mimics the return
* signature of `_.indexOf` by returning `0` if the value is found, else `-1`.
*
* @private
* @param {Object} cache The cache object to inspect.
* @param {*} value The value to search for.
* @returns {number} Returns `0` if `value` is found, else `-1`.
*/
function cacheIndexOf(cache, value) {
var type = typeof value;
cache = cache.cache;
if (type == 'boolean' || value == null) {
return cache[value] ? 0 : -1;
}
if (type != 'number' && type != 'string') {
type = 'object';
}
var key = type == 'number' ? value : keyPrefix + value;
cache = (cache = cache[type]) && cache[key];
return type == 'object'
? (cache && baseIndexOf(cache, value) > -1 ? 0 : -1)
: (cache ? 0 : -1);
}
/**
* Adds a given value to the corresponding cache object.
*
* @private
* @param {*} value The value to add to the cache.
*/
function cachePush(value) {
var cache = this.cache,
type = typeof value;
if (type == 'boolean' || value == null) {
cache[value] = true;
} else {
if (type != 'number' && type != 'string') {
type = 'object';
}
var key = type == 'number' ? value : keyPrefix + value,
typeCache = cache[type] || (cache[type] = {});
if (type == 'object') {
(typeCache[key] || (typeCache[key] = [])).push(value);
} else {
typeCache[key] = true;
}
}
}
/**
* Used by `_.max` and `_.min` as the default callback when a given
* collection is a string value.
*
* @private
* @param {string} value The character to inspect.
* @returns {number} Returns the code unit of given character.
*/
function charAtCallback(value) {
return value.charCodeAt(0);
}
/**
* Used by `sortBy` to compare transformed `collection` elements, stable sorting
* them in ascending order.
*
* @private
* @param {Object} a The object to compare to `b`.
* @param {Object} b The object to compare to `a`.
* @returns {number} Returns the sort order indicator of `1` or `-1`.
*/
function compareAscending(a, b) {
var ac = a.criteria,
bc = b.criteria,
index = -1,
length = ac.length;
while (++index < length) {
var value = ac[index],
other = bc[index];
if (value !== other) {
if (value > other || typeof value == 'undefined') {
return 1;
}
if (value < other || typeof other == 'undefined') {
return -1;
}
}
}
// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
// that causes it, under certain circumstances, to return the same value for
// `a` and `b`. See https://github.com/jashkenas/underscore/pull/1247
//
// This also ensures a stable sort in V8 and other engines.
// See http://code.google.com/p/v8/issues/detail?id=90
return a.index - b.index;
}
/**
* Creates a cache object to optimize linear searches of large arrays.
*
* @private
* @param {Array} [array=[]] The array to search.
* @returns {null|Object} Returns the cache object or `null` if caching should not be used.
*/
function createCache(array) {
var index = -1,
length = array.length,
first = array[0],
mid = array[(length / 2) | 0],
last = array[length - 1];
if (first && typeof first == 'object' &&
mid && typeof mid == 'object' && last && typeof last == 'object') {
return false;
}
var cache = getObject();
cache['false'] = cache['null'] = cache['true'] = cache['undefined'] = false;
var result = getObject();
result.array = array;
result.cache = cache;
result.push = cachePush;
while (++index < length) {
result.push(array[index]);
}
return result;
}
/**
* Used by `template` to escape characters for inclusion in compiled
* string literals.
*
* @private
* @param {string} match The matched character to escape.
* @returns {string} Returns the escaped character.
*/
function escapeStringChar(match) {
return '\\' + stringEscapes[match];
}
/**
* Gets an array from the array pool or creates a new one if the pool is empty.
*
* @private
* @returns {Array} The array from the pool.
*/
function getArray() {
return arrayPool.pop() || [];
}
/**
* Gets an object from the object pool or creates a new one if the pool is empty.
*
* @private
* @returns {Object} The object from the pool.
*/
function getObject() {
return objectPool.pop() || {
'array': null,
'cache': null,
'criteria': null,
'false': false,
'index': 0,
'null': false,
'number': null,
'object': null,
'push': null,
'string': null,
'true': false,
'undefined': false,
'value': null
};
}
/**
* Checks if `value` is a DOM node in IE < 9.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if the `value` is a DOM node, else `false`.
*/
function isNode(value) {
// IE < 9 presents DOM nodes as `Object` objects except they have `toString`
// methods that are `typeof` "string" and still can coerce nodes to strings
return typeof value.toString != 'function' && typeof (value + '') == 'string';
}
/**
* Releases the given array back to the array pool.
*
* @private
* @param {Array} [array] The array to release.
*/
function releaseArray(array) {
array.length = 0;
if (arrayPool.length < maxPoolSize) {
arrayPool.push(array);
}
}
/**
* Releases the given object back to the object pool.
*
* @private
* @param {Object} [object] The object to release.
*/
function releaseObject(object) {
var cache = object.cache;
if (cache) {
releaseObject(cache);
}
object.array = object.cache = object.criteria = object.object = object.number = object.string = object.value = null;
if (objectPool.length < maxPoolSize) {
objectPool.push(object);
}
}
/**
* Slices the `collection` from the `start` index up to, but not including,
* the `end` index.
*
* Note: This function is used instead of `Array#slice` to support node lists
* in IE < 9 and to ensure dense arrays are returned.
*
* @private
* @param {Array|Object|string} collection The collection to slice.
* @param {number} start The start index.
* @param {number} end The end index.
* @returns {Array} Returns the new array.
*/
function slice(array, start, end) {
start || (start = 0);
if (typeof end == 'undefined') {
end = array ? array.length : 0;
}
var index = -1,
length = end - start || 0,
result = Array(length < 0 ? 0 : length);
while (++index < length) {
result[index] = array[start + index];
}
return result;
}
/*--------------------------------------------------------------------------*/
/**
* Create a new `lodash` function using the given context object.
*
* @static
* @memberOf _
* @category Utilities
* @param {Object} [context=root] The context object.
* @returns {Function} Returns the `lodash` function.
*/
function runInContext(context) {
// Avoid issues with some ES3 environments that attempt to use values, named
// after built-in constructors like `Object`, for the creation of literals.
// ES5 clears this up by stating that literals must use built-in constructors.
// See http://es5.github.io/#x11.1.5.
context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root;
/** Native constructor references */
var Array = context.Array,
Boolean = context.Boolean,
Date = context.Date,
Error = context.Error,
Function = context.Function,
Math = context.Math,
Number = context.Number,
Object = context.Object,
RegExp = context.RegExp,
String = context.String,
TypeError = context.TypeError;
/**
* Used for `Array` method references.
*
* Normally `Array.prototype` would suffice, however, using an array literal
* avoids issues in Narwhal.
*/
var arrayRef = [];
/** Used for native method references */
var errorProto = Error.prototype,
objectProto = Object.prototype,
stringProto = String.prototype;
/** Used to restore the original `_` reference in `noConflict` */
var oldDash = context._;
/** Used to resolve the internal [[Class]] of values */
var toString = objectProto.toString;
/** Used to detect if a method is native */
var reNative = RegExp('^' +
String(toString)
.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
.replace(/toString| for [^\]]+/g, '.*?') + '$'
);
/** Native method shortcuts */
var ceil = Math.ceil,
clearTimeout = context.clearTimeout,
floor = Math.floor,
fnToString = Function.prototype.toString,
getPrototypeOf = isNative(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf,
hasOwnProperty = objectProto.hasOwnProperty,
push = arrayRef.push,
propertyIsEnumerable = objectProto.propertyIsEnumerable,
setTimeout = context.setTimeout,
splice = arrayRef.splice,
unshift = arrayRef.unshift;
/** Used to set meta data on functions */
var defineProperty = (function() {
// IE 8 only accepts DOM elements
try {
var o = {},
func = isNative(func = Object.defineProperty) && func,
result = func(o, o, o) && func;
} catch(e) { }
return result;
}());
/* Native method shortcuts for methods with the same name as other `lodash` methods */
var nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate,
nativeIsArray = isNative(nativeIsArray = Array.isArray) && nativeIsArray,
nativeIsFinite = context.isFinite,
nativeIsNaN = context.isNaN,
nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys,
nativeMax = Math.max,
nativeMin = Math.min,
nativeParseInt = context.parseInt,
nativeRandom = Math.random;
/** Used to lookup a built-in constructor by [[Class]] */
var ctorByClass = {};
ctorByClass[arrayClass] = Array;
ctorByClass[boolClass] = Boolean;
ctorByClass[dateClass] = Date;
ctorByClass[funcClass] = Function;
ctorByClass[objectClass] = Object;
ctorByClass[numberClass] = Number;
ctorByClass[regexpClass] = RegExp;
ctorByClass[stringClass] = String;
/** Used to avoid iterating non-enumerable properties in IE < 9 */
var nonEnumProps = {};
nonEnumProps[arrayClass] = nonEnumProps[dateClass] = nonEnumProps[numberClass] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true };
nonEnumProps[boolClass] = nonEnumProps[stringClass] = { 'constructor': true, 'toString': true, 'valueOf': true };
nonEnumProps[errorClass] = nonEnumProps[funcClass] = nonEnumProps[regexpClass] = { 'constructor': true, 'toString': true };
nonEnumProps[objectClass] = { 'constructor': true };
(function() {
var length = shadowedProps.length;
while (length--) {
var key = shadowedProps[length];
for (var className in nonEnumProps) {
if (hasOwnProperty.call(nonEnumProps, className) && !hasOwnProperty.call(nonEnumProps[className], key)) {
nonEnumProps[className][key] = false;
}
}
}
}());
/*--------------------------------------------------------------------------*/
/**
* Creates a `lodash` object which wraps the given value to enable intuitive
* method chaining.
*
* In addition to Lo-Dash methods, wrappers also have the following `Array` methods:
* `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, `splice`,
* and `unshift`
*
* Chaining is supported in custom builds as long as the `value` method is
* implicitly or explicitly included in the build.
*
* The chainable wrapper functions are:
* `after`, `assign`, `bind`, `bindAll`, `bindKey`, `chain`, `compact`,
* `compose`, `concat`, `countBy`, `create`, `createCallback`, `curry`,
* `debounce`, `defaults`, `defer`, `delay`, `difference`, `filter`, `flatten`,
* `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`,
* `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`,
* `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`,
* `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `pull`, `push`,
* `range`, `reject`, `remove`, `rest`, `reverse`, `shuffle`, `slice`, `sort`,
* `sortBy`, `splice`, `tap`, `throttle`, `times`, `toArray`, `transform`,
* `union`, `uniq`, `unshift`, `unzip`, `values`, `where`, `without`, `wrap`,
* and `zip`
*
* The non-chainable wrapper functions are:
* `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `findIndex`,
* `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `has`, `identity`,
* `indexOf`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`,
* `isEmpty`, `isEqual`, `isFinite`, `isFunction`, `isNaN`, `isNull`, `isNumber`,
* `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, `join`,
* `lastIndexOf`, `mixin`, `noConflict`, `parseInt`, `pop`, `random`, `reduce`,
* `reduceRight`, `result`, `shift`, `size`, `some`, `sortedIndex`, `runInContext`,
* `template`, `unescape`, `uniqueId`, and `value`
*
* The wrapper functions `first` and `last` return wrapped values when `n` is
* provided, otherwise they return unwrapped values.
*
* Explicit chaining can be enabled by using the `_.chain` method.
*
* @name _
* @constructor
* @category Chaining
* @param {*} value The value to wrap in a `lodash` instance.
* @returns {Object} Returns a `lodash` instance.
* @example
*
* var wrapped = _([1, 2, 3]);
*
* // returns an unwrapped value
* wrapped.reduce(function(sum, num) {
* return sum + num;
* });
* // => 6
*
* // returns a wrapped value
* var squares = wrapped.map(function(num) {
* return num * num;
* });
*
* _.isArray(squares);
* // => false
*
* _.isArray(squares.value());
* // => true
*/
function lodash(value) {
// don't wrap if already wrapped, even if wrapped by a different `lodash` constructor
return (value && typeof value == 'object' && !isArray(value) && hasOwnProperty.call(value, '__wrapped__'))
? value
: new lodashWrapper(value);
}
/**
* A fast path for creating `lodash` wrapper objects.
*
* @private
* @param {*} value The value to wrap in a `lodash` instance.
* @param {boolean} chainAll A flag to enable chaining for all methods
* @returns {Object} Returns a `lodash` instance.
*/
function lodashWrapper(value, chainAll) {
this.__chain__ = !!chainAll;
this.__wrapped__ = value;
}
// ensure `new lodashWrapper` is an instance of `lodash`
lodashWrapper.prototype = lodash.prototype;
/**
* An object used to flag environments features.
*
* @static
* @memberOf _
* @type Object
*/
var support = lodash.support = {};
(function() {
var ctor = function() { this.x = 1; },
object = { '0': 1, 'length': 1 },
props = [];
ctor.prototype = { 'valueOf': 1, 'y': 1 };
for (var key in new ctor) { props.push(key); }
for (key in arguments) { }
/**
* Detect if an `arguments` object's [[Class]] is resolvable (all but Firefox < 4, IE < 9).
*
* @memberOf _.support
* @type boolean
*/
support.argsClass = toString.call(arguments) == argsClass;
/**
* Detect if `arguments` objects are `Object` objects (all but Narwhal and Opera < 10.5).
*
* @memberOf _.support
* @type boolean
*/
support.argsObject = arguments.constructor == Object && !(arguments instanceof Array);
/**
* Detect if `name` or `message` properties of `Error.prototype` are
* enumerable by default. (IE < 9, Safari < 5.1)
*
* @memberOf _.support
* @type boolean
*/
support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || propertyIsEnumerable.call(errorProto, 'name');
/**
* Detect if `prototype` properties are enumerable by default.
*
* Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1
* (if the prototype or a property on the prototype has been set)
* incorrectly sets a function's `prototype` property [[Enumerable]]
* value to `true`.
*
* @memberOf _.support
* @type boolean
*/
support.enumPrototypes = propertyIsEnumerable.call(ctor, 'prototype');
/**
* Detect if functions can be decompiled by `Function#toString`
* (all but PS3 and older Opera mobile browsers & avoided in Windows 8 apps).
*
* @memberOf _.support
* @type boolean
*/
support.funcDecomp = !isNative(context.WinRTError) && reThis.test(runInContext);
/**
* Detect if `Function#name` is supported (all but IE).
*
* @memberOf _.support
* @type boolean
*/
support.funcNames = typeof Function.name == 'string';
/**
* Detect if `arguments` object indexes are non-enumerable
* (Firefox < 4, IE < 9, PhantomJS, Safari < 5.1).
*
* @memberOf _.support
* @type boolean
*/
support.nonEnumArgs = key != 0;
/**
* Detect if properties shadowing those on `Object.prototype` are non-enumerable.
*
* In IE < 9 an objects own properties, shadowing non-enumerable ones, are
* made non-enumerable as well (a.k.a the JScript [[DontEnum]] bug).
*
* @memberOf _.support
* @type boolean
*/
support.nonEnumShadows = !/valueOf/.test(props);
/**
* Detect if own properties are iterated after inherited properties (all but IE < 9).
*
* @memberOf _.support
* @type boolean
*/
support.ownLast = props[0] != 'x';
/**
* Detect if `Array#shift` and `Array#splice` augment array-like objects correctly.
*
* Firefox < 10, IE compatibility mode, and IE < 9 have buggy Array `shift()`
* and `splice()` functions that fail to remove the last element, `value[0]`,
* of array-like objects even though the `length` property is set to `0`.
* The `shift()` method is buggy in IE 8 compatibility mode, while `splice()`
* is buggy regardless of mode in IE < 9 and buggy in compatibility mode in IE 9.
*
* @memberOf _.support
* @type boolean
*/
support.spliceObjects = (arrayRef.splice.call(object, 0, 1), !object[0]);
/**
* Detect lack of support for accessing string characters by index.
*
* IE < 8 can't access characters by index and IE 8 can only access
* characters by index on string literals.
*
* @memberOf _.support
* @type boolean
*/
support.unindexedChars = ('x'[0] + Object('x')[0]) != 'xx';
/**
* Detect if a DOM node's [[Class]] is resolvable (all but IE < 9)
* and that the JS engine errors when attempting to coerce an object to
* a string without a `toString` function.
*
* @memberOf _.support
* @type boolean
*/
try {
support.nodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + ''));
} catch(e) {
support.nodeClass = true;
}
}(1));
/**
* By default, the template delimiters used by Lo-Dash are similar to those in
* embedded Ruby (ERB). Change the following template settings to use alternative
* delimiters.
*
* @static
* @memberOf _
* @type Object
*/
lodash.templateSettings = {
/**
* Used to detect `data` property values to be HTML-escaped.
*
* @memberOf _.templateSettings
* @type RegExp
*/
'escape': /<%-([\s\S]+?)%>/g,
/**
* Used to detect code to be evaluated.
*
* @memberOf _.templateSettings
* @type RegExp
*/
'evaluate': /<%([\s\S]+?)%>/g,
/**
* Used to detect `data` property values to inject.
*
* @memberOf _.templateSettings
* @type RegExp
*/
'interpolate': reInterpolate,
/**
* Used to reference the data object in the template text.
*
* @memberOf _.templateSettings
* @type string
*/
'variable': '',
/**
* Used to import variables into the compiled template.
*
* @memberOf _.templateSettings
* @type Object
*/
'imports': {
/**
* A reference to the `lodash` function.
*
* @memberOf _.templateSettings.imports
* @type Function
*/
'_': lodash
}
};
/*--------------------------------------------------------------------------*/
/**
* The template used to create iterator functions.
*
* @private
* @param {Object} data The data object used to populate the text.
* @returns {string} Returns the interpolated text.
*/
var iteratorTemplate = function(obj) {
var __p = 'var index, iterable = ' +
(obj.firstArg) +
', result = ' +
(obj.init) +
';\nif (!iterable) return result;\n' +
(obj.top) +
';';
if (obj.array) {
__p += '\nvar length = iterable.length; index = -1;\nif (' +
(obj.array) +
') { ';
if (support.unindexedChars) {
__p += '\n if (isString(iterable)) {\n iterable = iterable.split(\'\')\n } ';
}
__p += '\n while (++index < length) {\n ' +
(obj.loop) +
';\n }\n}\nelse { ';
} else if (support.nonEnumArgs) {
__p += '\n var length = iterable.length; index = -1;\n if (length && isArguments(iterable)) {\n while (++index < length) {\n index += \'\';\n ' +
(obj.loop) +
';\n }\n } else { ';
}
if (support.enumPrototypes) {
__p += '\n var skipProto = typeof iterable == \'function\';\n ';
}
if (support.enumErrorProps) {
__p += '\n var skipErrorProps = iterable === errorProto || iterable instanceof Error;\n ';
}
var conditions = []; if (support.enumPrototypes) { conditions.push('!(skipProto && index == "prototype")'); } if (support.enumErrorProps) { conditions.push('!(skipErrorProps && (index == "message" || index == "name"))'); }
if (obj.useHas && obj.keys) {
__p += '\n var ownIndex = -1,\n ownProps = objectTypes[typeof iterable] && keys(iterable),\n length = ownProps ? ownProps.length : 0;\n\n while (++ownIndex < length) {\n index = ownProps[ownIndex];\n';
if (conditions.length) {
__p += ' if (' +
(conditions.join(' && ')) +
') {\n ';
}
__p +=
(obj.loop) +
'; ';
if (conditions.length) {
__p += '\n }';
}
__p += '\n } ';
} else {
__p += '\n for (index in iterable) {\n';
if (obj.useHas) { conditions.push("hasOwnProperty.call(iterable, index)"); } if (conditions.length) {
__p += ' if (' +
(conditions.join(' && ')) +
') {\n ';
}
__p +=
(obj.loop) +
'; ';
if (conditions.length) {
__p += '\n }';
}
__p += '\n } ';
if (support.nonEnumShadows) {
__p += '\n\n if (iterable !== objectProto) {\n var ctor = iterable.constructor,\n isProto = iterable === (ctor && ctor.prototype),\n className = iterable === stringProto ? stringClass : iterable === errorProto ? errorClass : toString.call(iterable),\n nonEnum = nonEnumProps[className];\n ';
for (k = 0; k < 7; k++) {
__p += '\n index = \'' +
(obj.shadowedProps[k]) +
'\';\n if ((!(isProto && nonEnum[index]) && hasOwnProperty.call(iterable, index))';
if (!obj.useHas) {
__p += ' || (!nonEnum[index] && iterable[index] !== objectProto[index])';
}
__p += ') {\n ' +
(obj.loop) +
';\n } ';
}
__p += '\n } ';
}
}
if (obj.array || support.nonEnumArgs) {
__p += '\n}';
}
__p +=
(obj.bottom) +
';\nreturn result';
return __p
};
/*--------------------------------------------------------------------------*/
/**
* The base implementation of `_.bind` that creates the bound function and
* sets its meta data.
*
* @private
* @param {Array} bindData The bind data array.
* @returns {Function} Returns the new bound function.
*/
function baseBind(bindData) {
var func = bindData[0],
partialArgs = bindData[2],
thisArg = bindData[4];
function bound() {
// `Function#bind` spec
// http://es5.github.io/#x15.3.4.5
if (partialArgs) {
// avoid `arguments` object deoptimizations by using `slice` instead
// of `Array.prototype.slice.call` and not assigning `arguments` to a
// variable as a ternary expression
var args = slice(partialArgs);
push.apply(args, arguments);
}
// mimic the constructor's `return` behavior
// http://es5.github.io/#x13.2.2
if (this instanceof bound) {
// ensure `new bound` is an instance of `func`
var thisBinding = baseCreate(func.prototype),
result = func.apply(thisBinding, args || arguments);
return isObject(result) ? result : thisBinding;
}
return func.apply(thisArg, args || arguments);
}
setBindData(bound, bindData);
return bound;
}
/**
* The base implementation of `_.clone` without argument juggling or support
* for `thisArg` binding.
*
* @private
* @param {*} value The value to clone.
* @param {boolean} [isDeep=false] Specify a deep clone.
* @param {Function} [callback] The function to customize cloning values.
* @param {Array} [stackA=[]] Tracks traversed source objects.
* @param {Array} [stackB=[]] Associates clones with source counterparts.
* @returns {*} Returns the cloned value.
*/
function baseClone(value, isDeep, callback, stackA, stackB) {
if (callback) {
var result = callback(value);
if (typeof result != 'undefined') {
return result;
}
}
// inspect [[Class]]
var isObj = isObject(value);
if (isObj) {
var className = toString.call(value);
if (!cloneableClasses[className] || (!support.nodeClass && isNode(value))) {
return value;
}
var ctor = ctorByClass[className];
switch (className) {
case boolClass:
case dateClass:
return new ctor(+value);
case numberClass:
case stringClass:
return new ctor(value);
case regexpClass:
result = ctor(value.source, reFlags.exec(value));
result.lastIndex = value.lastIndex;
return result;
}
} else {
return value;
}
var isArr = isArray(value);
if (isDeep) {
// check for circular references and return corresponding clone
var initedStack = !stackA;
stackA || (stackA = getArray());
stackB || (stackB = getArray());
var length = stackA.length;
while (length--) {
if (stackA[length] == value) {
return stackB[length];
}
}
result = isArr ? ctor(value.length) : {};
}
else {
result = isArr ? slice(value) : assign({}, value);
}
// add array properties assigned by `RegExp#exec`
if (isArr) {
if (hasOwnProperty.call(value, 'index')) {
result.index = value.index;
}
if (hasOwnProperty.call(value, 'input')) {
result.input = value.input;
}
}
// exit for shallow clone
if (!isDeep) {
return result;
}
// add the source value to the stack of traversed objects
// and associate it with its clone
stackA.push(value);
stackB.push(result);
// recursively populate clone (susceptible to call stack limits)
(isArr ? baseEach : forOwn)(value, function(objValue, key) {
result[key] = baseClone(objValue, isDeep, callback, stackA, stackB);
});
if (initedStack) {
releaseArray(stackA);
releaseArray(stackB);
}
return result;
}
/**
* The base implementation of `_.create` without support for assigning
* properties to the created object.
*
* @private
* @param {Object} prototype The object to inherit from.
* @returns {Object} Returns the new object.
*/
function baseCreate(prototype, properties) {
return isObject(prototype) ? nativeCreate(prototype) : {};
}
// fallback for browsers without `Object.create`
if (!nativeCreate) {
baseCreate = (function() {
function Object() {}
return function(prototype) {
if (isObject(prototype)) {
Object.prototype = prototype;
var result = new Object;
Object.prototype = null;
}
return result || context.Object();
};
}());
}
/**
* The base implementation of `_.createCallback` without support for creating
* "_.pluck" or "_.where" style callbacks.
*
* @private
* @param {*} [func=identity] The value to convert to a callback.
* @param {*} [thisArg] The `this` binding of the created callback.
* @param {number} [argCount] The number of arguments the callback accepts.
* @returns {Function} Returns a callback function.
*/
function baseCreateCallback(func, thisArg, argCount) {
if (typeof func != 'function') {
return identity;
}
// exit early for no `thisArg` or already bound by `Function#bind`
if (typeof thisArg == 'undefined' || !('prototype' in func)) {
return func;
}
var bindData = func.__bindData__;
if (typeof bindData == 'undefined') {
if (support.funcNames) {
bindData = !func.name;
}
bindData = bindData || !support.funcDecomp;
if (!bindData) {
var source = fnToString.call(func);
if (!support.funcNames) {
bindData = !reFuncName.test(source);
}
if (!bindData) {
// checks if `func` references the `this` keyword and stores the result
bindData = reThis.test(source);
setBindData(func, bindData);
}
}
}
// exit early if there are no `this` references or `func` is bound
if (bindData === false || (bindData !== true && bindData[1] & 1)) {
return func;
}
switch (argCount) {
case 1: return function(value) {
return func.call(thisArg, value);
};
case 2: return function(a, b) {
return func.call(thisArg, a, b);
};
case 3: return function(value, index, collection) {
return func.call(thisArg, value, index, collection);
};
case 4: return function(accumulator, value, index, collection) {
return func.call(thisArg, accumulator, value, index, collection);
};
}
return bind(func, thisArg);
}
/**
* The base implementation of `createWrapper` that creates the wrapper and
* sets its meta data.
*
* @private
* @param {Array} bindData The bind data array.
* @returns {Function} Returns the new function.
*/
function baseCreateWrapper(bindData) {
var func = bindData[0],
bitmask = bindData[1],
partialArgs = bindData[2],
partialRightArgs = bindData[3],
thisArg = bindData[4],
arity = bindData[5];
var isBind = bitmask & 1,
isBindKey = bitmask & 2,
isCurry = bitmask & 4,
isCurryBound = bitmask & 8,
key = func;
function bound() {
var thisBinding = isBind ? thisArg : this;
if (partialArgs) {
var args = slice(partialArgs);
push.apply(args, arguments);
}
if (partialRightArgs || isCurry) {
args || (args = slice(arguments));
if (partialRightArgs) {
push.apply(args, partialRightArgs);
}
if (isCurry && args.length < arity) {
bitmask |= 16 & ~32;
return baseCreateWrapper([func, (isCurryBound ? bitmask : bitmask & ~3), args, null, thisArg, arity]);
}
}
args || (args = arguments);
if (isBindKey) {
func = thisBinding[key];
}
if (this instanceof bound) {
thisBinding = baseCreate(func.prototype);
var result = func.apply(thisBinding, args);
return isObject(result) ? result : thisBinding;
}
return func.apply(thisBinding, args);
}
setBindData(bound, bindData);
return bound;
}
/**
* The base implementation of `_.difference` that accepts a single array
* of values to exclude.
*
* @private
* @param {Array} array The array to process.
* @param {Array} [values] The array of values to exclude.
* @returns {Array} Returns a new array of filtered values.
*/
function baseDifference(array, values) {
var index = -1,
indexOf = getIndexOf(),
length = array ? array.length : 0,
isLarge = length >= largeArraySize && indexOf === baseIndexOf,
result = [];
if (isLarge) {
var cache = createCache(values);
if (cache) {
indexOf = cacheIndexOf;
values = cache;
} else {
isLarge = false;
}
}
while (++index < length) {
var value = array[index];
if (indexOf(values, value) < 0) {
result.push(value);
}
}
if (isLarge) {
releaseObject(values);
}
return result;
}
/**
* The base implementation of `_.flatten` without support for callback
* shorthands or `thisArg` binding.
*
* @private
* @param {Array} array The array to flatten.
* @param {boolean} [isShallow=false] A flag to restrict flattening to a single level.
* @param {boolean} [isStrict=false] A flag to restrict flattening to arrays and `arguments` objects.
* @param {number} [fromIndex=0] The index to start from.
* @returns {Array} Returns a new flattened array.
*/
function baseFlatten(array, isShallow, isStrict, fromIndex) {
var index = (fromIndex || 0) - 1,
length = array ? array.length : 0,
result = [];
while (++index < length) {
var value = array[index];
if (value && typeof value == 'object' && typeof value.length == 'number'
&& (isArray(value) || isArguments(value))) {
// recursively flatten arrays (susceptible to call stack limits)
if (!isShallow) {
value = baseFlatten(value, isShallow, isStrict);
}
var valIndex = -1,
valLength = value.length,
resIndex = result.length;
result.length += valLength;
while (++valIndex < valLength) {
result[resIndex++] = value[valIndex];
}
} else if (!isStrict) {
result.push(value);
}
}
return result;
}
/**
* The base implementation of `_.isEqual`, without support for `thisArg` binding,
* that allows partial "_.where" style comparisons.
*
* @private
* @param {*} a The value to compare.
* @param {*} b The other value to compare.
* @param {Function} [callback] The function to customize comparing values.
* @param {Function} [isWhere=false] A flag to indicate performing partial comparisons.
* @param {Array} [stackA=[]] Tracks traversed `a` objects.
* @param {Array} [stackB=[]] Tracks traversed `b` objects.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
*/
function baseIsEqual(a, b, callback, isWhere, stackA, stackB) {
// used to indicate that when comparing objects, `a` has at least the properties of `b`
if (callback) {
var result = callback(a, b);
if (typeof result != 'undefined') {
return !!result;
}
}
// exit early for identical values
if (a === b) {
// treat `+0` vs. `-0` as not equal
return a !== 0 || (1 / a == 1 / b);
}
var type = typeof a,
otherType = typeof b;
// exit early for unlike primitive values
if (a === a &&
!(a && objectTypes[type]) &&
!(b && objectTypes[otherType])) {
return false;
}
// exit early for `null` and `undefined` avoiding ES3's Function#call behavior
// http://es5.github.io/#x15.3.4.4
if (a == null || b == null) {
return a === b;
}
// compare [[Class]] names
var className = toString.call(a),
otherClass = toString.call(b);
if (className == argsClass) {
className = objectClass;
}
if (otherClass == argsClass) {
otherClass = objectClass;
}
if (className != otherClass) {
return false;
}
switch (className) {
case boolClass:
case dateClass:
// coerce dates and booleans to numbers, dates to milliseconds and booleans
// to `1` or `0` treating invalid dates coerced to `NaN` as not equal
return +a == +b;
case numberClass:
// treat `NaN` vs. `NaN` as equal
return (a != +a)
? b != +b
// but treat `+0` vs. `-0` as not equal
: (a == 0 ? (1 / a == 1 / b) : a == +b);
case regexpClass:
case stringClass:
// coerce regexes to strings (http://es5.github.io/#x15.10.6.4)
// treat string primitives and their corresponding object instances as equal
return a == String(b);
}
var isArr = className == arrayClass;
if (!isArr) {
// unwrap any `lodash` wrapped values
var aWrapped = hasOwnProperty.call(a, '__wrapped__'),
bWrapped = hasOwnProperty.call(b, '__wrapped__');
if (aWrapped || bWrapped) {
return baseIsEqual(aWrapped ? a.__wrapped__ : a, bWrapped ? b.__wrapped__ : b, callback, isWhere, stackA, stackB);
}
// exit for functions and DOM nodes
if (className != objectClass || (!support.nodeClass && (isNode(a) || isNode(b)))) {
return false;
}
// in older versions of Opera, `arguments` objects have `Array` constructors
var ctorA = !support.argsObject && isArguments(a) ? Object : a.constructor,
ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor;
// non `Object` object instances with different constructors are not equal
if (ctorA != ctorB &&
!(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) &&
('constructor' in a && 'constructor' in b)
) {
return false;
}
}
// assume cyclic structures are equal
// the algorithm for detecting cyclic structures is adapted from ES 5.1
// section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3)
var initedStack = !stackA;
stackA || (stackA = getArray());
stackB || (stackB = getArray());
var length = stackA.length;
while (length--) {
if (stackA[length] == a) {
return stackB[length] == b;
}
}
var size = 0;
result = true;
// add `a` and `b` to the stack of traversed objects
stackA.push(a);
stackB.push(b);
// recursively compare objects and arrays (susceptible to call stack limits)
if (isArr) {
// compare lengths to determine if a deep comparison is necessary
length = a.length;
size = b.length;
result = size == length;
if (result || isWhere) {
// deep compare the contents, ignoring non-numeric properties
while (size--) {
var index = length,
value = b[size];
if (isWhere) {
while (index--) {
if ((result = baseIsEqual(a[index], value, callback, isWhere, stackA, stackB))) {
break;
}
}
} else if (!(result = baseIsEqual(a[size], value, callback, isWhere, stackA, stackB))) {
break;
}
}
}
}
else {
// deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys`
// which, in this case, is more costly
forIn(b, function(value, key, b) {
if (hasOwnProperty.call(b, key)) {
// count the number of properties.
size++;
// deep compare each property value.
return (result = hasOwnProperty.call(a, key) && baseIsEqual(a[key], value, callback, isWhere, stackA, stackB));
}
});
if (result && !isWhere) {
// ensure both objects have the same number of properties
forIn(a, function(value, key, a) {
if (hasOwnProperty.call(a, key)) {
// `size` will be `-1` if `a` has more properties than `b`
return (result = --size > -1);
}
});
}
}
stackA.pop();
stackB.pop();
if (initedStack) {
releaseArray(stackA);
releaseArray(stackB);
}
return result;
}
/**
* The base implementation of `_.merge` without argument juggling or support
* for `thisArg` binding.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @param {Function} [callback] The function to customize merging properties.
* @param {Array} [stackA=[]] Tracks traversed source objects.
* @param {Array} [stackB=[]] Associates values with source counterparts.
*/
function baseMerge(object, source, callback, stackA, stackB) {
(isArray(source) ? forEach : forOwn)(source, function(source, key) {
var found,
isArr,
result = source,
value = object[key];
if (source && ((isArr = isArray(source)) || isPlainObject(source))) {
// avoid merging previously merged cyclic sources
var stackLength = stackA.length;
while (stackLength--) {
if ((found = stackA[stackLength] == source)) {
value = stackB[stackLength];
break;
}
}
if (!found) {
var isShallow;
if (callback) {
result = callback(value, source);
if ((isShallow = typeof result != 'undefined')) {
value = result;
}
}
if (!isShallow) {
value = isArr
? (isArray(value) ? value : [])
: (isPlainObject(value) ? value : {});
}
// add `source` and associated `value` to the stack of traversed objects
stackA.push(source);
stackB.push(value);
// recursively merge objects and arrays (susceptible to call stack limits)
if (!isShallow) {
baseMerge(value, source, callback, stackA, stackB);
}
}
}
else {
if (callback) {
result = callback(value, source);
if (typeof result == 'undefined') {
result = source;
}
}
if (typeof result != 'undefined') {
value = result;
}
}
object[key] = value;
});
}
/**
* The base implementation of `_.random` without argument juggling or support
* for returning floating-point numbers.
*
* @private
* @param {number} min The minimum possible value.
* @param {number} max The maximum possible value.
* @returns {number} Returns a random number.
*/
function baseRandom(min, max) {
return min + floor(nativeRandom() * (max - min + 1));
}
/**
* The base implementation of `_.uniq` without support for callback shorthands
* or `thisArg` binding.
*
* @private
* @param {Array} array The array to process.
* @param {boolean} [isSorted=false] A flag to indicate that `array` is sorted.
* @param {Function} [callback] The function called per iteration.
* @returns {Array} Returns a duplicate-value-free array.
*/
function baseUniq(array, isSorted, callback) {
var index = -1,
indexOf = getIndexOf(),
length = array ? array.length : 0,
result = [];
var isLarge = !isSorted && length >= largeArraySize && indexOf === baseIndexOf,
seen = (callback || isLarge) ? getArray() : result;
if (isLarge) {
var cache = createCache(seen);
indexOf = cacheIndexOf;
seen = cache;
}
while (++index < length) {
var value = array[index],
computed = callback ? callback(value, index, array) : value;
if (isSorted
? !index || seen[seen.length - 1] !== computed
: indexOf(seen, computed) < 0
) {
if (callback || isLarge) {
seen.push(computed);
}
result.push(value);
}
}
if (isLarge) {
releaseArray(seen.array);
releaseObject(seen);
} else if (callback) {
releaseArray(seen);
}
return result;
}
/**
* Creates a function that aggregates a collection, creating an object composed
* of keys generated from the results of running each element of the collection
* through a callback. The given `setter` function sets the keys and values
* of the composed object.
*
* @private
* @param {Function} setter The setter function.
* @returns {Function} Returns the new aggregator function.
*/
function createAggregator(setter) {
return function(collection, callback, thisArg) {
var result = {};
callback = lodash.createCallback(callback, thisArg, 3);
if (isArray(collection)) {
var index = -1,
length = collection.length;
while (++index < length) {
var value = collection[index];
setter(result, value, callback(value, index, collection), collection);
}
} else {
baseEach(collection, function(value, key, collection) {
setter(result, value, callback(value, key, collection), collection);
});
}
return result;
};
}
/**
* Creates a function that, when called, either curries or invokes `func`
* with an optional `this` binding and partially applied arguments.
*
* @private
* @param {Function|string} func The function or method name to reference.
* @param {number} bitmask The bitmask of method flags to compose.
* The bitmask may be composed of the following flags:
* 1 - `_.bind`
* 2 - `_.bindKey`
* 4 - `_.curry`
* 8 - `_.curry` (bound)
* 16 - `_.partial`
* 32 - `_.partialRight`
* @param {Array} [partialArgs] An array of arguments to prepend to those
* provided to the new function.
* @param {Array} [partialRightArgs] An array of arguments to append to those
* provided to the new function.
* @param {*} [thisArg] The `this` binding of `func`.
* @param {number} [arity] The arity of `func`.
* @returns {Function} Returns the new function.
*/
function createWrapper(func, bitmask, partialArgs, partialRightArgs, thisArg, arity) {
var isBind = bitmask & 1,
isBindKey = bitmask & 2,
isCurry = bitmask & 4,
isCurryBound = bitmask & 8,
isPartial = bitmask & 16,
isPartialRight = bitmask & 32;
if (!isBindKey && !isFunction(func)) {
throw new TypeError;
}
if (isPartial && !partialArgs.length) {
bitmask &= ~16;
isPartial = partialArgs = false;
}
if (isPartialRight && !partialRightArgs.length) {
bitmask &= ~32;
isPartialRight = partialRightArgs = false;
}
var bindData = func && func.__bindData__;
if (bindData && bindData !== true) {
// clone `bindData`
bindData = slice(bindData);
if (bindData[2]) {
bindData[2] = slice(bindData[2]);
}
if (bindData[3]) {
bindData[3] = slice(bindData[3]);
}
// set `thisBinding` is not previously bound
if (isBind && !(bindData[1] & 1)) {
bindData[4] = thisArg;
}
// set if previously bound but not currently (subsequent curried functions)
if (!isBind && bindData[1] & 1) {
bitmask |= 8;
}
// set curried arity if not yet set
if (isCurry && !(bindData[1] & 4)) {
bindData[5] = arity;
}
// append partial left arguments
if (isPartial) {
push.apply(bindData[2] || (bindData[2] = []), partialArgs);
}
// append partial right arguments
if (isPartialRight) {
unshift.apply(bindData[3] || (bindData[3] = []), partialRightArgs);
}
// merge flags
bindData[1] |= bitmask;
return createWrapper.apply(null, bindData);
}
// fast path for `_.bind`
var creater = (bitmask == 1 || bitmask === 17) ? baseBind : baseCreateWrapper;
return creater([func, bitmask, partialArgs, partialRightArgs, thisArg, arity]);
}
/**
* Creates compiled iteration functions.
*
* @private
* @param {...Object} [options] The compile options object(s).
* @param {string} [options.array] Code to determine if the iterable is an array or array-like.
* @param {boolean} [options.useHas] Specify using `hasOwnProperty` checks in the object loop.
* @param {Function} [options.keys] A reference to `_.keys` for use in own property iteration.
* @param {string} [options.args] A comma separated string of iteration function arguments.
* @param {string} [options.top] Code to execute before the iteration branches.
* @param {string} [options.loop] Code to execute in the object loop.
* @param {string} [options.bottom] Code to execute after the iteration branches.
* @returns {Function} Returns the compiled function.
*/
function createIterator() {
// data properties
iteratorData.shadowedProps = shadowedProps;
// iterator options
iteratorData.array = iteratorData.bottom = iteratorData.loop = iteratorData.top = '';
iteratorData.init = 'iterable';
iteratorData.useHas = true;
// merge options into a template data object
for (var object, index = 0; object = arguments[index]; index++) {
for (var key in object) {
iteratorData[key] = object[key];
}
}
var args = iteratorData.args;
iteratorData.firstArg = /^[^,]+/.exec(args)[0];
// create the function factory
var factory = Function(
'baseCreateCallback, errorClass, errorProto, hasOwnProperty, ' +
'indicatorObject, isArguments, isArray, isString, keys, objectProto, ' +
'objectTypes, nonEnumProps, stringClass, stringProto, toString',
'return function(' + args + ') {\n' + iteratorTemplate(iteratorData) + '\n}'
);
// return the compiled function
return factory(
baseCreateCallback, errorClass, errorProto, hasOwnProperty,
indicatorObject, isArguments, isArray, isString, iteratorData.keys, objectProto,
objectTypes, nonEnumProps, stringClass, stringProto, toString
);
}
/**
* Used by `escape` to convert characters to HTML entities.
*
* @private
* @param {string} match The matched character to escape.
* @returns {string} Returns the escaped character.
*/
function escapeHtmlChar(match) {
return htmlEscapes[match];
}
/**
* Gets the appropriate "indexOf" function. If the `_.indexOf` method is
* customized, this method returns the custom method, otherwise it returns
* the `baseIndexOf` function.
*
* @private
* @returns {Function} Returns the "indexOf" function.
*/
function getIndexOf() {
var result = (result = lodash.indexOf) === indexOf ? baseIndexOf : result;
return result;
}
/**
* Checks if `value` is a native function.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if the `value` is a native function, else `false`.
*/
function isNative(value) {
return typeof value == 'function' && reNative.test(value);
}
/**
* Sets `this` binding data on a given function.
*
* @private
* @param {Function} func The function to set data on.
* @param {Array} value The data array to set.
*/
var setBindData = !defineProperty ? noop : function(func, value) {
descriptor.value = value;
defineProperty(func, '__bindData__', descriptor);
};
/**
* A fallback implementation of `isPlainObject` which checks if a given value
* is an object created by the `Object` constructor, assuming objects created
* by the `Object` constructor have no inherited enumerable properties and that
* there are no `Object.prototype` extensions.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
*/
function shimIsPlainObject(value) {
var ctor,
result;
// avoid non Object objects, `arguments` objects, and DOM elements
if (!(value && toString.call(value) == objectClass) ||
(ctor = value.constructor, isFunction(ctor) && !(ctor instanceof ctor)) ||
(!support.argsClass && isArguments(value)) ||
(!support.nodeClass && isNode(value))) {
return false;
}
// IE < 9 iterates inherited properties before own properties. If the first
// iterated property is an object's own property then there are no inherited
// enumerable properties.
if (support.ownLast) {
forIn(value, function(value, key, object) {
result = hasOwnProperty.call(object, key);
return false;
});
return result !== false;
}
// In most environments an object's own properties are iterated before
// its inherited properties. If the last iterated property is an object's
// own property then there are no inherited enumerable properties.
forIn(value, function(value, key) {
result = key;
});
return typeof result == 'undefined' || hasOwnProperty.call(value, result);
}
/**
* Used by `unescape` to convert HTML entities to characters.
*
* @private
* @param {string} match The matched character to unescape.
* @returns {string} Returns the unescaped character.
*/
function unescapeHtmlChar(match) {
return htmlUnescapes[match];
}
/*--------------------------------------------------------------------------*/
/**
* Checks if `value` is an `arguments` object.
*
* @static
* @memberOf _
* @category Objects
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if the `value` is an `arguments` object, else `false`.
* @example
*
* (function() { return _.isArguments(arguments); })(1, 2, 3);
* // => true
*
* _.isArguments([1, 2, 3]);
* // => false
*/
function isArguments(value) {
return value && typeof value == 'object' && typeof value.length == 'number' &&
toString.call(value) == argsClass || false;
}
// fallback for browsers that can't detect `arguments` objects by [[Class]]
if (!support.argsClass) {
isArguments = function(value) {
return value && typeof value == 'object' && typeof value.length == 'number' &&
hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee') || false;
};
}
/**
* Checks if `value` is an array.
*
* @static
* @memberOf _
* @type Function
* @category Objects
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if the `value` is an array, else `false`.
* @example
*
* (function() { return _.isArray(arguments); })();
* // => false
*
* _.isArray([1, 2, 3]);
* // => true
*/
var isArray = nativeIsArray || function(value) {
return value && typeof value == 'object' && typeof value.length == 'number' &&
toString.call(value) == arrayClass || false;
};
/**
* A fallback implementation of `Object.keys` which produces an array of the
* given object's own enumerable property names.
*
* @private
* @type Function
* @param {Object} object The object to inspect.
* @returns {Array} Returns an array of property names.
*/
var shimKeys = createIterator({
'args': 'object',
'init': '[]',
'top': 'if (!(objectTypes[typeof object])) return result',
'loop': 'result.push(index)'
});
/**
* Creates an array composed of the own enumerable property names of an object.
*
* @static
* @memberOf _
* @category Objects
* @param {Object} object The object to inspect.
* @returns {Array} Returns an array of property names.
* @example
*
* _.keys({ 'one': 1, 'two': 2, 'three': 3 });
* // => ['one', 'two', 'three'] (property order is not guaranteed across environments)
*/
var keys = !nativeKeys ? shimKeys : function(object) {
if (!isObject(object)) {
return [];
}
if ((support.enumPrototypes && typeof object == 'function') ||
(support.nonEnumArgs && object.length && isArguments(object))) {
return shimKeys(object);
}
return nativeKeys(object);
};
/** Reusable iterator options shared by `each`, `forIn`, and `forOwn` */
var eachIteratorOptions = {
'args': 'collection, callback, thisArg',
'top': "callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3)",
'array': "typeof length == 'number'",
'keys': keys,
'loop': 'if (callback(iterable[index], index, collection) === false) return result'
};
/** Reusable iterator options for `assign` and `defaults` */
var defaultsIteratorOptions = {
'args': 'object, source, guard',
'top':
'var args = arguments,\n' +
' argsIndex = 0,\n' +
" argsLength = typeof guard == 'number' ? 2 : args.length;\n" +
'while (++argsIndex < argsLength) {\n' +
' iterable = args[argsIndex];\n' +
' if (iterable && objectTypes[typeof iterable]) {',
'keys': keys,
'loop': "if (typeof result[index] == 'undefined') result[index] = iterable[index]",
'bottom': ' }\n}'
};
/** Reusable iterator options for `forIn` and `forOwn` */
var forOwnIteratorOptions = {
'top': 'if (!objectTypes[typeof iterable]) return result;\n' + eachIteratorOptions.top,
'array': false
};
/**
* Used to convert characters to HTML entities:
*
* Though the `>` character is escaped for symmetry, characters like `>` and `/`
* don't require escaping in HTML and have no special meaning unless they're part
* of a tag or an unquoted attribute value.
* http://mathiasbynens.be/notes/ambiguous-ampersands (under "semi-related fun fact")
*/
var htmlEscapes = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": '''
};
/** Used to convert HTML entities to characters */
var htmlUnescapes = invert(htmlEscapes);
/** Used to match HTML entities and HTML characters */
var reEscapedHtml = RegExp('(' + keys(htmlUnescapes).join('|') + ')', 'g'),
reUnescapedHtml = RegExp('[' + keys(htmlEscapes).join('') + ']', 'g');
/**
* A function compiled to iterate `arguments` objects, arrays, objects, and
* strings consistenly across environments, executing the callback for each
* element in the collection. The callback is bound to `thisArg` and invoked
* with three arguments; (value, index|key, collection). Callbacks may exit
* iteration early by explicitly returning `false`.
*
* @private
* @type Function
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Array|Object|string} Returns `collection`.
*/
var baseEach = createIterator(eachIteratorOptions);
/*--------------------------------------------------------------------------*/
/**
* Assigns own enumerable properties of source object(s) to the destination
* object. Subsequent sources will overwrite property assignments of previous
* sources. If a callback is provided it will be executed to produce the
* assigned values. The callback is bound to `thisArg` and invoked with two
* arguments; (objectValue, sourceValue).
*
* @static
* @memberOf _
* @type Function
* @alias extend
* @category Objects
* @param {Object} object The destination object.
* @param {...Object} [source] The source objects.
* @param {Function} [callback] The function to customize assigning values.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Object} Returns the destination object.
* @example
*
* _.assign({ 'name': 'fred' }, { 'employer': 'slate' });
* // => { 'name': 'fred', 'employer': 'slate' }
*
* var defaults = _.partialRight(_.assign, function(a, b) {
* return typeof a == 'undefined' ? b : a;
* });
*
* var object = { 'name': 'barney' };
* defaults(object, { 'name': 'fred', 'employer': 'slate' });
* // => { 'name': 'barney', 'employer': 'slate' }
*/
var assign = createIterator(defaultsIteratorOptions, {
'top':
defaultsIteratorOptions.top.replace(';',
';\n' +
"if (argsLength > 3 && typeof args[argsLength - 2] == 'function') {\n" +
' var callback = baseCreateCallback(args[--argsLength - 1], args[argsLength--], 2);\n' +
"} else if (argsLength > 2 && typeof args[argsLength - 1] == 'function') {\n" +
' callback = args[--argsLength];\n' +
'}'
),
'loop': 'result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]'
});
/**
* Creates a clone of `value`. If `isDeep` is `true` nested objects will also
* be cloned, otherwise they will be assigned by reference. If a callback
* is provided it will be executed to produce the cloned values. If the
* callback returns `undefined` cloning will be handled by the method instead.
* The callback is bound to `thisArg` and invoked with one argument; (value).
*
* @static
* @memberOf _
* @category Objects
* @param {*} value The value to clone.
* @param {boolean} [isDeep=false] Specify a deep clone.
* @param {Function} [callback] The function to customize cloning values.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {*} Returns the cloned value.
* @example
*
* var characters = [
* { 'name': 'barney', 'age': 36 },
* { 'name': 'fred', 'age': 40 }
* ];
*
* var shallow = _.clone(characters);
* shallow[0] === characters[0];
* // => true
*
* var deep = _.clone(characters, true);
* deep[0] === characters[0];
* // => false
*
* _.mixin({
* 'clone': _.partialRight(_.clone, function(value) {
* return _.isElement(value) ? value.cloneNode(false) : undefined;
* })
* });
*
* var clone = _.clone(document.body);
* clone.childNodes.length;
* // => 0
*/
function clone(value, isDeep, callback, thisArg) {
// allows working with "Collections" methods without using their `index`
// and `collection` arguments for `isDeep` and `callback`
if (typeof isDeep != 'boolean' && isDeep != null) {
thisArg = callback;
callback = isDeep;
isDeep = false;
}
return baseClone(value, isDeep, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1));
}
/**
* Creates a deep clone of `value`. If a callback is provided it will be
* executed to produce the cloned values. If the callback returns `undefined`
* cloning will be handled by the method instead. The callback is bound to
* `thisArg` and invoked with one argument; (value).
*
* Note: This method is loosely based on the structured clone algorithm. Functions
* and DOM nodes are **not** cloned. The enumerable properties of `arguments` objects and
* objects created by constructors other than `Object` are cloned to plain `Object` objects.
* See http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm.
*
* @static
* @memberOf _
* @category Objects
* @param {*} value The value to deep clone.
* @param {Function} [callback] The function to customize cloning values.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {*} Returns the deep cloned value.
* @example
*
* var characters = [
* { 'name': 'barney', 'age': 36 },
* { 'name': 'fred', 'age': 40 }
* ];
*
* var deep = _.cloneDeep(characters);
* deep[0] === characters[0];
* // => false
*
* var view = {
* 'label': 'docs',
* 'node': element
* };
*
* var clone = _.cloneDeep(view, function(value) {
* return _.isElement(value) ? value.cloneNode(true) : undefined;
* });
*
* clone.node == view.node;
* // => false
*/
function cloneDeep(value, callback, thisArg) {
return baseClone(value, true, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1));
}
/**
* Creates an object that inherits from the given `prototype` object. If a
* `properties` object is provided its own enumerable properties are assigned
* to the created object.
*
* @static
* @memberOf _
* @category Objects
* @param {Object} prototype The object to inherit from.
* @param {Object} [properties] The properties to assign to the object.
* @returns {Object} Returns the new object.
* @example
*
* function Shape() {
* this.x = 0;
* this.y = 0;
* }
*
* function Circle() {
* Shape.call(this);
* }
*
* Circle.prototype = _.create(Shape.prototype, { 'constructor': Circle });
*
* var circle = new Circle;
* circle instanceof Circle;
* // => true
*
* circle instanceof Shape;
* // => true
*/
function create(prototype, properties) {
var result = baseCreate(prototype);
return properties ? assign(result, properties) : result;
}
/**
* Assigns own enumerable properties of source object(s) to the destination
* object for all destination properties that resolve to `undefined`. Once a
* property is set, additional defaults of the same property will be ignored.
*
* @static
* @memberOf _
* @type Function
* @category Objects
* @param {Object} object The destination object.
* @param {...Object} [source] The source objects.
* @param- {Object} [guard] Allows working with `_.reduce` without using its
* `key` and `object` arguments as sources.
* @returns {Object} Returns the destination object.
* @example
*
* var object = { 'name': 'barney' };
* _.defaults(object, { 'name': 'fred', 'employer': 'slate' });
* // => { 'name': 'barney', 'employer': 'slate' }
*/
var defaults = createIterator(defaultsIteratorOptions);
/**
* This method is like `_.findIndex` except that it returns the key of the
* first element that passes the callback check, instead of the element itself.
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Objects
* @param {Object} object The object to search.
* @param {Function|Object|string} [callback=identity] The function called per
* iteration. If a property name or object is provided it will be used to
* create a "_.pluck" or "_.where" style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {string|undefined} Returns the key of the found element, else `undefined`.
* @example
*
* var characters = {
* 'barney': { 'age': 36, 'blocked': false },
* 'fred': { 'age': 40, 'blocked': true },
* 'pebbles': { 'age': 1, 'blocked': false }
* };
*
* _.findKey(characters, function(chr) {
* return chr.age < 40;
* });
* // => 'barney' (property order is not guaranteed across environments)
*
* // using "_.where" callback shorthand
* _.findKey(characters, { 'age': 1 });
* // => 'pebbles'
*
* // using "_.pluck" callback shorthand
* _.findKey(characters, 'blocked');
* // => 'fred'
*/
function findKey(object, callback, thisArg) {
var result;
callback = lodash.createCallback(callback, thisArg, 3);
forOwn(object, function(value, key, object) {
if (callback(value, key, object)) {
result = key;
return false;
}
});
return result;
}
/**
* This method is like `_.findKey` except that it iterates over elements
* of a `collection` in the opposite order.
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Objects
* @param {Object} object The object to search.
* @param {Function|Object|string} [callback=identity] The function called per
* iteration. If a property name or object is provided it will be used to
* create a "_.pluck" or "_.where" style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {string|undefined} Returns the key of the found element, else `undefined`.
* @example
*
* var characters = {
* 'barney': { 'age': 36, 'blocked': true },
* 'fred': { 'age': 40, 'blocked': false },
* 'pebbles': { 'age': 1, 'blocked': true }
* };
*
* _.findLastKey(characters, function(chr) {
* return chr.age < 40;
* });
* // => returns `pebbles`, assuming `_.findKey` returns `barney`
*
* // using "_.where" callback shorthand
* _.findLastKey(characters, { 'age': 40 });
* // => 'fred'
*
* // using "_.pluck" callback shorthand
* _.findLastKey(characters, 'blocked');
* // => 'pebbles'
*/
function findLastKey(object, callback, thisArg) {
var result;
callback = lodash.createCallback(callback, thisArg, 3);
forOwnRight(object, function(value, key, object) {
if (callback(value, key, object)) {
result = key;
return false;
}
});
return result;
}
/**
* Iterates over own and inherited enumerable properties of an object,
* executing the callback for each property. The callback is bound to `thisArg`
* and invoked with three arguments; (value, key, object). Callbacks may exit
* iteration early by explicitly returning `false`.
*
* @static
* @memberOf _
* @type Function
* @category Objects
* @param {Object} object The object to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Object} Returns `object`.
* @example
*
* function Shape() {
* this.x = 0;
* this.y = 0;
* }
*
* Shape.prototype.move = function(x, y) {
* this.x += x;
* this.y += y;
* };
*
* _.forIn(new Shape, function(value, key) {
* console.log(key);
* });
* // => logs 'x', 'y', and 'move' (property order is not guaranteed across environments)
*/
var forIn = createIterator(eachIteratorOptions, forOwnIteratorOptions, {
'useHas': false
});
/**
* This method is like `_.forIn` except that it iterates over elements
* of a `collection` in the opposite order.
*
* @static
* @memberOf _
* @category Objects
* @param {Object} object The object to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Object} Returns `object`.
* @example
*
* function Shape() {
* this.x = 0;
* this.y = 0;
* }
*
* Shape.prototype.move = function(x, y) {
* this.x += x;
* this.y += y;
* };
*
* _.forInRight(new Shape, function(value, key) {
* console.log(key);
* });
* // => logs 'move', 'y', and 'x' assuming `_.forIn ` logs 'x', 'y', and 'move'
*/
function forInRight(object, callback, thisArg) {
var pairs = [];
forIn(object, function(value, key) {
pairs.push(key, value);
});
var length = pairs.length;
callback = baseCreateCallback(callback, thisArg, 3);
while (length--) {
if (callback(pairs[length--], pairs[length], object) === false) {
break;
}
}
return object;
}
/**
* Iterates over own enumerable properties of an object, executing the callback
* for each property. The callback is bound to `thisArg` and invoked with three
* arguments; (value, key, object). Callbacks may exit iteration early by
* explicitly returning `false`.
*
* @static
* @memberOf _
* @type Function
* @category Objects
* @param {Object} object The object to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Object} Returns `object`.
* @example
*
* _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) {
* console.log(key);
* });
* // => logs '0', '1', and 'length' (property order is not guaranteed across environments)
*/
var forOwn = createIterator(eachIteratorOptions, forOwnIteratorOptions);
/**
* This method is like `_.forOwn` except that it iterates over elements
* of a `collection` in the opposite order.
*
* @static
* @memberOf _
* @category Objects
* @param {Object} object The object to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Object} Returns `object`.
* @example
*
* _.forOwnRight({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) {
* console.log(key);
* });
* // => logs 'length', '1', and '0' assuming `_.forOwn` logs '0', '1', and 'length'
*/
function forOwnRight(object, callback, thisArg) {
var props = keys(object),
length = props.length;
callback = baseCreateCallback(callback, thisArg, 3);
while (length--) {
var key = props[length];
if (callback(object[key], key, object) === false) {
break;
}
}
return object;
}
/**
* Creates a sorted array of property names of all enumerable properties,
* own and inherited, of `object` that have function values.
*
* @static
* @memberOf _
* @alias methods
* @category Objects
* @param {Object} object The object to inspect.
* @returns {Array} Returns an array of property names that have function values.
* @example
*
* _.functions(_);
* // => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...]
*/
function functions(object) {
var result = [];
forIn(object, function(value, key) {
if (isFunction(value)) {
result.push(key);
}
});
return result.sort();
}
/**
* Checks if the specified property name exists as a direct property of `object`,
* instead of an inherited property.
*
* @static
* @memberOf _
* @category Objects
* @param {Object} object The object to inspect.
* @param {string} key The name of the property to check.
* @returns {boolean} Returns `true` if key is a direct property, else `false`.
* @example
*
* _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b');
* // => true
*/
function has(object, key) {
return object ? hasOwnProperty.call(object, key) : false;
}
/**
* Creates an object composed of the inverted keys and values of the given object.
*
* @static
* @memberOf _
* @category Objects
* @param {Object} object The object to invert.
* @returns {Object} Returns the created inverted object.
* @example
*
* _.invert({ 'first': 'fred', 'second': 'barney' });
* // => { 'fred': 'first', 'barney': 'second' }
*/
function invert(object) {
var index = -1,
props = keys(object),
length = props.length,
result = {};
while (++index < length) {
var key = props[index];
result[object[key]] = key;
}
return result;
}
/**
* Checks if `value` is a boolean value.
*
* @static
* @memberOf _
* @category Objects
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if the `value` is a boolean value, else `false`.
* @example
*
* _.isBoolean(null);
* // => false
*/
function isBoolean(value) {
return value === true || value === false ||
value && typeof value == 'object' && toString.call(value) == boolClass || false;
}
/**
* Checks if `value` is a date.
*
* @static
* @memberOf _
* @category Objects
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if the `value` is a date, else `false`.
* @example
*
* _.isDate(new Date);
* // => true
*/
function isDate(value) {
return value && typeof value == 'object' && toString.call(value) == dateClass || false;
}
/**
* Checks if `value` is a DOM element.
*
* @static
* @memberOf _
* @category Objects
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if the `value` is a DOM element, else `false`.
* @example
*
* _.isElement(document.body);
* // => true
*/
function isElement(value) {
return value && value.nodeType === 1 || false;
}
/**
* Checks if `value` is empty. Arrays, strings, or `arguments` objects with a
* length of `0` and objects with no own enumerable properties are considered
* "empty".
*
* @static
* @memberOf _
* @category Objects
* @param {Array|Object|string} value The value to inspect.
* @returns {boolean} Returns `true` if the `value` is empty, else `false`.
* @example
*
* _.isEmpty([1, 2, 3]);
* // => false
*
* _.isEmpty({});
* // => true
*
* _.isEmpty('');
* // => true
*/
function isEmpty(value) {
var result = true;
if (!value) {
return result;
}
var className = toString.call(value),
length = value.length;
if ((className == arrayClass || className == stringClass ||
(support.argsClass ? className == argsClass : isArguments(value))) ||
(className == objectClass && typeof length == 'number' && isFunction(value.splice))) {
return !length;
}
forOwn(value, function() {
return (result = false);
});
return result;
}
/**
* Performs a deep comparison between two values to determine if they are
* equivalent to each other. If a callback is provided it will be executed
* to compare values. If the callback returns `undefined` comparisons will
* be handled by the method instead. The callback is bound to `thisArg` and
* invoked with two arguments; (a, b).
*
* @static
* @memberOf _
* @category Objects
* @param {*} a The value to compare.
* @param {*} b The other value to compare.
* @param {Function} [callback] The function to customize comparing values.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'name': 'fred' };
* var copy = { 'name': 'fred' };
*
* object == copy;
* // => false
*
* _.isEqual(object, copy);
* // => true
*
* var words = ['hello', 'goodbye'];
* var otherWords = ['hi', 'goodbye'];
*
* _.isEqual(words, otherWords, function(a, b) {
* var reGreet = /^(?:hello|hi)$/i,
* aGreet = _.isString(a) && reGreet.test(a),
* bGreet = _.isString(b) && reGreet.test(b);
*
* return (aGreet || bGreet) ? (aGreet == bGreet) : undefined;
* });
* // => true
*/
function isEqual(a, b, callback, thisArg) {
return baseIsEqual(a, b, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 2));
}
/**
* Checks if `value` is, or can be coerced to, a finite number.
*
* Note: This is not the same as native `isFinite` which will return true for
* booleans and empty strings. See http://es5.github.io/#x15.1.2.5.
*
* @static
* @memberOf _
* @category Objects
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if the `value` is finite, else `false`.
* @example
*
* _.isFinite(-101);
* // => true
*
* _.isFinite('10');
* // => true
*
* _.isFinite(true);
* // => false
*
* _.isFinite('');
* // => false
*
* _.isFinite(Infinity);
* // => false
*/
function isFinite(value) {
return nativeIsFinite(value) && !nativeIsNaN(parseFloat(value));
}
/**
* Checks if `value` is a function.
*
* @static
* @memberOf _
* @category Objects
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if the `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*/
function isFunction(value) {
return typeof value == 'function';
}
// fallback for older versions of Chrome and Safari
if (isFunction(/x/)) {
isFunction = function(value) {
return typeof value == 'function' && toString.call(value) == funcClass;
};
}
/**
* Checks if `value` is the language type of Object.
* (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @category Objects
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if the `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(1);
* // => false
*/
function isObject(value) {
// check if the value is the ECMAScript language type of Object
// http://es5.github.io/#x8
// and avoid a V8 bug
// http://code.google.com/p/v8/issues/detail?id=2291
return !!(value && objectTypes[typeof value]);
}
/**
* Checks if `value` is `NaN`.
*
* Note: This is not the same as native `isNaN` which will return `true` for
* `undefined` and other non-numeric values. See http://es5.github.io/#x15.1.2.4.
*
* @static
* @memberOf _
* @category Objects
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if the `value` is `NaN`, else `false`.
* @example
*
* _.isNaN(NaN);
* // => true
*
* _.isNaN(new Number(NaN));
* // => true
*
* isNaN(undefined);
* // => true
*
* _.isNaN(undefined);
* // => false
*/
function isNaN(value) {
// `NaN` as a primitive is the only value that is not equal to itself
// (perform the [[Class]] check first to avoid errors with some host objects in IE)
return isNumber(value) && value != +value;
}
/**
* Checks if `value` is `null`.
*
* @static
* @memberOf _
* @category Objects
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if the `value` is `null`, else `false`.
* @example
*
* _.isNull(null);
* // => true
*
* _.isNull(undefined);
* // => false
*/
function isNull(value) {
return value === null;
}
/**
* Checks if `value` is a number.
*
* Note: `NaN` is considered a number. See http://es5.github.io/#x8.5.
*
* @static
* @memberOf _
* @category Objects
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if the `value` is a number, else `false`.
* @example
*
* _.isNumber(8.4 * 5);
* // => true
*/
function isNumber(value) {
return typeof value == 'number' ||
value && typeof value == 'object' && toString.call(value) == numberClass || false;
}
/**
* Checks if `value` is an object created by the `Object` constructor.
*
* @static
* @memberOf _
* @category Objects
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
* @example
*
* function Shape() {
* this.x = 0;
* this.y = 0;
* }
*
* _.isPlainObject(new Shape);
* // => false
*
* _.isPlainObject([1, 2, 3]);
* // => false
*
* _.isPlainObject({ 'x': 0, 'y': 0 });
* // => true
*/
var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) {
if (!(value && toString.call(value) == objectClass) || (!support.argsClass && isArguments(value))) {
return false;
}
var valueOf = value.valueOf,
objProto = isNative(valueOf) && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto);
return objProto
? (value == objProto || getPrototypeOf(value) == objProto)
: shimIsPlainObject(value);
};
/**
* Checks if `value` is a regular expression.
*
* @static
* @memberOf _
* @category Objects
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if the `value` is a regular expression, else `false`.
* @example
*
* _.isRegExp(/fred/);
* // => true
*/
function isRegExp(value) {
return value && objectTypes[typeof value] && toString.call(value) == regexpClass || false;
}
/**
* Checks if `value` is a string.
*
* @static
* @memberOf _
* @category Objects
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if the `value` is a string, else `false`.
* @example
*
* _.isString('fred');
* // => true
*/
function isString(value) {
return typeof value == 'string' ||
value && typeof value == 'object' && toString.call(value) == stringClass || false;
}
/**
* Checks if `value` is `undefined`.
*
* @static
* @memberOf _
* @category Objects
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if the `value` is `undefined`, else `false`.
* @example
*
* _.isUndefined(void 0);
* // => true
*/
function isUndefined(value) {
return typeof value == 'undefined';
}
/**
* Creates an object with the same keys as `object` and values generated by
* running each own enumerable property of `object` through the callback.
* The callback is bound to `thisArg` and invoked with three arguments;
* (value, key, object).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Objects
* @param {Object} object The object to iterate over.
* @param {Function|Object|string} [callback=identity] The function called
* per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a new object with values of the results of each `callback` execution.
* @example
*
* _.mapValues({ 'a': 1, 'b': 2, 'c': 3} , function(num) { return num * 3; });
* // => { 'a': 3, 'b': 6, 'c': 9 }
*
* var characters = {
* 'fred': { 'name': 'fred', 'age': 40 },
* 'pebbles': { 'name': 'pebbles', 'age': 1 }
* };
*
* // using "_.pluck" callback shorthand
* _.mapValues(characters, 'age');
* // => { 'fred': 40, 'pebbles': 1 }
*/
function mapValues(object, callback, thisArg) {
var result = {};
callback = lodash.createCallback(callback, thisArg, 3);
forOwn(object, function(value, key, object) {
result[key] = callback(value, key, object);
});
return result;
}
/**
* Recursively merges own enumerable properties of the source object(s), that
* don't resolve to `undefined` into the destination object. Subsequent sources
* will overwrite property assignments of previous sources. If a callback is
* provided it will be executed to produce the merged values of the destination
* and source properties. If the callback returns `undefined` merging will
* be handled by the method instead. The callback is bound to `thisArg` and
* invoked with two arguments; (objectValue, sourceValue).
*
* @static
* @memberOf _
* @category Objects
* @param {Object} object The destination object.
* @param {...Object} [source] The source objects.
* @param {Function} [callback] The function to customize merging properties.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Object} Returns the destination object.
* @example
*
* var names = {
* 'characters': [
* { 'name': 'barney' },
* { 'name': 'fred' }
* ]
* };
*
* var ages = {
* 'characters': [
* { 'age': 36 },
* { 'age': 40 }
* ]
* };
*
* _.merge(names, ages);
* // => { 'characters': [{ 'name': 'barney', 'age': 36 }, { 'name': 'fred', 'age': 40 }] }
*
* var food = {
* 'fruits': ['apple'],
* 'vegetables': ['beet']
* };
*
* var otherFood = {
* 'fruits': ['banana'],
* 'vegetables': ['carrot']
* };
*
* _.merge(food, otherFood, function(a, b) {
* return _.isArray(a) ? a.concat(b) : undefined;
* });
* // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot] }
*/
function merge(object) {
var args = arguments,
length = 2;
if (!isObject(object)) {
return object;
}
// allows working with `_.reduce` and `_.reduceRight` without using
// their `index` and `collection` arguments
if (typeof args[2] != 'number') {
length = args.length;
}
if (length > 3 && typeof args[length - 2] == 'function') {
var callback = baseCreateCallback(args[--length - 1], args[length--], 2);
} else if (length > 2 && typeof args[length - 1] == 'function') {
callback = args[--length];
}
var sources = slice(arguments, 1, length),
index = -1,
stackA = getArray(),
stackB = getArray();
while (++index < length) {
baseMerge(object, sources[index], callback, stackA, stackB);
}
releaseArray(stackA);
releaseArray(stackB);
return object;
}
/**
* Creates a shallow clone of `object` excluding the specified properties.
* Property names may be specified as individual arguments or as arrays of
* property names. If a callback is provided it will be executed for each
* property of `object` omitting the properties the callback returns truey
* for. The callback is bound to `thisArg` and invoked with three arguments;
* (value, key, object).
*
* @static
* @memberOf _
* @category Objects
* @param {Object} object The source object.
* @param {Function|...string|string[]} [callback] The properties to omit or the
* function called per iteration.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Object} Returns an object without the omitted properties.
* @example
*
* _.omit({ 'name': 'fred', 'age': 40 }, 'age');
* // => { 'name': 'fred' }
*
* _.omit({ 'name': 'fred', 'age': 40 }, function(value) {
* return typeof value == 'number';
* });
* // => { 'name': 'fred' }
*/
function omit(object, callback, thisArg) {
var result = {};
if (typeof callback != 'function') {
var props = [];
forIn(object, function(value, key) {
props.push(key);
});
props = baseDifference(props, baseFlatten(arguments, true, false, 1));
var index = -1,
length = props.length;
while (++index < length) {
var key = props[index];
result[key] = object[key];
}
} else {
callback = lodash.createCallback(callback, thisArg, 3);
forIn(object, function(value, key, object) {
if (!callback(value, key, object)) {
result[key] = value;
}
});
}
return result;
}
/**
* Creates a two dimensional array of an object's key-value pairs,
* i.e. `[[key1, value1], [key2, value2]]`.
*
* @static
* @memberOf _
* @category Objects
* @param {Object} object The object to inspect.
* @returns {Array} Returns new array of key-value pairs.
* @example
*
* _.pairs({ 'barney': 36, 'fred': 40 });
* // => [['barney', 36], ['fred', 40]] (property order is not guaranteed across environments)
*/
function pairs(object) {
var index = -1,
props = keys(object),
length = props.length,
result = Array(length);
while (++index < length) {
var key = props[index];
result[index] = [key, object[key]];
}
return result;
}
/**
* Creates a shallow clone of `object` composed of the specified properties.
* Property names may be specified as individual arguments or as arrays of
* property names. If a callback is provided it will be executed for each
* property of `object` picking the properties the callback returns truey
* for. The callback is bound to `thisArg` and invoked with three arguments;
* (value, key, object).
*
* @static
* @memberOf _
* @category Objects
* @param {Object} object The source object.
* @param {Function|...string|string[]} [callback] The function called per
* iteration or property names to pick, specified as individual property
* names or arrays of property names.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Object} Returns an object composed of the picked properties.
* @example
*
* _.pick({ 'name': 'fred', '_userid': 'fred1' }, 'name');
* // => { 'name': 'fred' }
*
* _.pick({ 'name': 'fred', '_userid': 'fred1' }, function(value, key) {
* return key.charAt(0) != '_';
* });
* // => { 'name': 'fred' }
*/
function pick(object, callback, thisArg) {
var result = {};
if (typeof callback != 'function') {
var index = -1,
props = baseFlatten(arguments, true, false, 1),
length = isObject(object) ? props.length : 0;
while (++index < length) {
var key = props[index];
if (key in object) {
result[key] = object[key];
}
}
} else {
callback = lodash.createCallback(callback, thisArg, 3);
forIn(object, function(value, key, object) {
if (callback(value, key, object)) {
result[key] = value;
}
});
}
return result;
}
/**
* An alternative to `_.reduce` this method transforms `object` to a new
* `accumulator` object which is the result of running each of its own
* enumerable properties through a callback, with each callback execution
* potentially mutating the `accumulator` object. The callback is bound to
* `thisArg` and invoked with four arguments; (accumulator, value, key, object).
* Callbacks may exit iteration early by explicitly returning `false`.
*
* @static
* @memberOf _
* @category Objects
* @param {Array|Object} object The object to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {*} [accumulator] The custom accumulator value.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {*} Returns the accumulated value.
* @example
*
* var squares = _.transform([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], function(result, num) {
* num *= num;
* if (num % 2) {
* return result.push(num) < 3;
* }
* });
* // => [1, 9, 25]
*
* var mapped = _.transform({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) {
* result[key] = num * 3;
* });
* // => { 'a': 3, 'b': 6, 'c': 9 }
*/
function transform(object, callback, accumulator, thisArg) {
var isArr = isArray(object);
if (accumulator == null) {
if (isArr) {
accumulator = [];
} else {
var ctor = object && object.constructor,
proto = ctor && ctor.prototype;
accumulator = baseCreate(proto);
}
}
if (callback) {
callback = lodash.createCallback(callback, thisArg, 4);
(isArr ? baseEach : forOwn)(object, function(value, index, object) {
return callback(accumulator, value, index, object);
});
}
return accumulator;
}
/**
* Creates an array composed of the own enumerable property values of `object`.
*
* @static
* @memberOf _
* @category Objects
* @param {Object} object The object to inspect.
* @returns {Array} Returns an array of property values.
* @example
*
* _.values({ 'one': 1, 'two': 2, 'three': 3 });
* // => [1, 2, 3] (property order is not guaranteed across environments)
*/
function values(object) {
var index = -1,
props = keys(object),
length = props.length,
result = Array(length);
while (++index < length) {
result[index] = object[props[index]];
}
return result;
}
/*--------------------------------------------------------------------------*/
/**
* Creates an array of elements from the specified indexes, or keys, of the
* `collection`. Indexes may be specified as individual arguments or as arrays
* of indexes.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|string} collection The collection to iterate over.
* @param {...(number|number[]|string|string[])} [index] The indexes of `collection`
* to retrieve, specified as individual indexes or arrays of indexes.
* @returns {Array} Returns a new array of elements corresponding to the
* provided indexes.
* @example
*
* _.at(['a', 'b', 'c', 'd', 'e'], [0, 2, 4]);
* // => ['a', 'c', 'e']
*
* _.at(['fred', 'barney', 'pebbles'], 0, 2);
* // => ['fred', 'pebbles']
*/
function at(collection) {
var args = arguments,
index = -1,
props = baseFlatten(args, true, false, 1),
length = (args[2] && args[2][args[1]] === collection) ? 1 : props.length,
result = Array(length);
if (support.unindexedChars && isString(collection)) {
collection = collection.split('');
}
while(++index < length) {
result[index] = collection[props[index]];
}
return result;
}
/**
* Checks if a given value is present in a collection using strict equality
* for comparisons, i.e. `===`. If `fromIndex` is negative, it is used as the
* offset from the end of the collection.
*
* @static
* @memberOf _
* @alias include
* @category Collections
* @param {Array|Object|string} collection The collection to iterate over.
* @param {*} target The value to check for.
* @param {number} [fromIndex=0] The index to search from.
* @returns {boolean} Returns `true` if the `target` element is found, else `false`.
* @example
*
* _.contains([1, 2, 3], 1);
* // => true
*
* _.contains([1, 2, 3], 1, 2);
* // => false
*
* _.contains({ 'name': 'fred', 'age': 40 }, 'fred');
* // => true
*
* _.contains('pebbles', 'eb');
* // => true
*/
function contains(collection, target, fromIndex) {
var index = -1,
indexOf = getIndexOf(),
length = collection ? collection.length : 0,
result = false;
fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex) || 0;
if (isArray(collection)) {
result = indexOf(collection, target, fromIndex) > -1;
} else if (typeof length == 'number') {
result = (isString(collection) ? collection.indexOf(target, fromIndex) : indexOf(collection, target, fromIndex)) > -1;
} else {
baseEach(collection, function(value) {
if (++index >= fromIndex) {
return !(result = value === target);
}
});
}
return result;
}
/**
* Creates an object composed of keys generated from the results of running
* each element of `collection` through the callback. The corresponding value
* of each key is the number of times the key was returned by the callback.
* The callback is bound to `thisArg` and invoked with three arguments;
* (value, index|key, collection).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|Object|string} [callback=identity] The function called
* per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Object} Returns the composed aggregate object.
* @example
*
* _.countBy([4.3, 6.1, 6.4], function(num) { return Math.floor(num); });
* // => { '4': 1, '6': 2 }
*
* _.countBy([4.3, 6.1, 6.4], function(num) { return this.floor(num); }, Math);
* // => { '4': 1, '6': 2 }
*
* _.countBy(['one', 'two', 'three'], 'length');
* // => { '3': 2, '5': 1 }
*/
var countBy = createAggregator(function(result, value, key) {
(hasOwnProperty.call(result, key) ? result[key]++ : result[key] = 1);
});
/**
* Checks if the given callback returns truey value for **all** elements of
* a collection. The callback is bound to `thisArg` and invoked with three
* arguments; (value, index|key, collection).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias all
* @category Collections
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|Object|string} [callback=identity] The function called
* per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {boolean} Returns `true` if all elements passed the callback check,
* else `false`.
* @example
*
* _.every([true, 1, null, 'yes']);
* // => false
*
* var characters = [
* { 'name': 'barney', 'age': 36 },
* { 'name': 'fred', 'age': 40 }
* ];
*
* // using "_.pluck" callback shorthand
* _.every(characters, 'age');
* // => true
*
* // using "_.where" callback shorthand
* _.every(characters, { 'age': 36 });
* // => false
*/
function every(collection, callback, thisArg) {
var result = true;
callback = lodash.createCallback(callback, thisArg, 3);
if (isArray(collection)) {
var index = -1,
length = collection.length;
while (++index < length) {
if (!(result = !!callback(collection[index], index, collection))) {
break;
}
}
} else {
baseEach(collection, function(value, index, collection) {
return (result = !!callback(value, index, collection));
});
}
return result;
}
/**
* Iterates over elements of a collection, returning an array of all elements
* the callback returns truey for. The callback is bound to `thisArg` and
* invoked with three arguments; (value, index|key, collection).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias select
* @category Collections
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|Object|string} [callback=identity] The function called
* per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a new array of elements that passed the callback check.
* @example
*
* var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
* // => [2, 4, 6]
*
* var characters = [
* { 'name': 'barney', 'age': 36, 'blocked': false },
* { 'name': 'fred', 'age': 40, 'blocked': true }
* ];
*
* // using "_.pluck" callback shorthand
* _.filter(characters, 'blocked');
* // => [{ 'name': 'fred', 'age': 40, 'blocked': true }]
*
* // using "_.where" callback shorthand
* _.filter(characters, { 'age': 36 });
* // => [{ 'name': 'barney', 'age': 36, 'blocked': false }]
*/
function filter(collection, callback, thisArg) {
var result = [];
callback = lodash.createCallback(callback, thisArg, 3);
if (isArray(collection)) {
var index = -1,
length = collection.length;
while (++index < length) {
var value = collection[index];
if (callback(value, index, collection)) {
result.push(value);
}
}
} else {
baseEach(collection, function(value, index, collection) {
if (callback(value, index, collection)) {
result.push(value);
}
});
}
return result;
}
/**
* Iterates over elements of a collection, returning the first element that
* the callback returns truey for. The callback is bound to `thisArg` and
* invoked with three arguments; (value, index|key, collection).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias detect, findWhere
* @category Collections
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|Object|string} [callback=identity] The function called
* per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {*} Returns the found element, else `undefined`.
* @example
*
* var characters = [
* { 'name': 'barney', 'age': 36, 'blocked': false },
* { 'name': 'fred', 'age': 40, 'blocked': true },
* { 'name': 'pebbles', 'age': 1, 'blocked': false }
* ];
*
* _.find(characters, function(chr) {
* return chr.age < 40;
* });
* // => { 'name': 'barney', 'age': 36, 'blocked': false }
*
* // using "_.where" callback shorthand
* _.find(characters, { 'age': 1 });
* // => { 'name': 'pebbles', 'age': 1, 'blocked': false }
*
* // using "_.pluck" callback shorthand
* _.find(characters, 'blocked');
* // => { 'name': 'fred', 'age': 40, 'blocked': true }
*/
function find(collection, callback, thisArg) {
callback = lodash.createCallback(callback, thisArg, 3);
if (isArray(collection)) {
var index = -1,
length = collection.length;
while (++index < length) {
var value = collection[index];
if (callback(value, index, collection)) {
return value;
}
}
} else {
var result;
baseEach(collection, function(value, index, collection) {
if (callback(value, index, collection)) {
result = value;
return false;
}
});
return result;
}
}
/**
* This method is like `_.find` except that it iterates over elements
* of a `collection` from right to left.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|Object|string} [callback=identity] The function called
* per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {*} Returns the found element, else `undefined`.
* @example
*
* _.findLast([1, 2, 3, 4], function(num) {
* return num % 2 == 1;
* });
* // => 3
*/
function findLast(collection, callback, thisArg) {
var result;
callback = lodash.createCallback(callback, thisArg, 3);
forEachRight(collection, function(value, index, collection) {
if (callback(value, index, collection)) {
result = value;
return false;
}
});
return result;
}
/**
* Iterates over elements of a collection, executing the callback for each
* element. The callback is bound to `thisArg` and invoked with three arguments;
* (value, index|key, collection). Callbacks may exit iteration early by
* explicitly returning `false`.
*
* Note: As with other "Collections" methods, objects with a `length` property
* are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`
* may be used for object iteration.
*
* @static
* @memberOf _
* @alias each
* @category Collections
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Array|Object|string} Returns `collection`.
* @example
*
* _([1, 2, 3]).forEach(function(num) { console.log(num); }).join(',');
* // => logs each number and returns '1,2,3'
*
* _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); });
* // => logs each number and returns the object (property order is not guaranteed across environments)
*/
function forEach(collection, callback, thisArg) {
if (callback && typeof thisArg == 'undefined' && isArray(collection)) {
var index = -1,
length = collection.length;
while (++index < length) {
if (callback(collection[index], index, collection) === false) {
break;
}
}
} else {
baseEach(collection, callback, thisArg);
}
return collection;
}
/**
* This method is like `_.forEach` except that it iterates over elements
* of a `collection` from right to left.
*
* @static
* @memberOf _
* @alias eachRight
* @category Collections
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Array|Object|string} Returns `collection`.
* @example
*
* _([1, 2, 3]).forEachRight(function(num) { console.log(num); }).join(',');
* // => logs each number from right to left and returns '3,2,1'
*/
function forEachRight(collection, callback, thisArg) {
var iterable = collection,
length = collection ? collection.length : 0;
callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3);
if (isArray(collection)) {
while (length--) {
if (callback(collection[length], length, collection) === false) {
break;
}
}
} else {
if (typeof length != 'number') {
var props = keys(collection);
length = props.length;
} else if (support.unindexedChars && isString(collection)) {
iterable = collection.split('');
}
baseEach(collection, function(value, key, collection) {
key = props ? props[--length] : --length;
return callback(iterable[key], key, collection);
});
}
return collection;
}
/**
* Creates an object composed of keys generated from the results of running
* each element of a collection through the callback. The corresponding value
* of each key is an array of the elements responsible for generating the key.
* The callback is bound to `thisArg` and invoked with three arguments;
* (value, index|key, collection).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|Object|string} [callback=identity] The function called
* per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Object} Returns the composed aggregate object.
* @example
*
* _.groupBy([4.2, 6.1, 6.4], function(num) { return Math.floor(num); });
* // => { '4': [4.2], '6': [6.1, 6.4] }
*
* _.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math);
* // => { '4': [4.2], '6': [6.1, 6.4] }
*
* // using "_.pluck" callback shorthand
* _.groupBy(['one', 'two', 'three'], 'length');
* // => { '3': ['one', 'two'], '5': ['three'] }
*/
var groupBy = createAggregator(function(result, value, key) {
(hasOwnProperty.call(result, key) ? result[key] : result[key] = []).push(value);
});
/**
* Creates an object composed of keys generated from the results of running
* each element of the collection through the given callback. The corresponding
* value of each key is the last element responsible for generating the key.
* The callback is bound to `thisArg` and invoked with three arguments;
* (value, index|key, collection).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|Object|string} [callback=identity] The function called
* per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Object} Returns the composed aggregate object.
* @example
*
* var keys = [
* { 'dir': 'left', 'code': 97 },
* { 'dir': 'right', 'code': 100 }
* ];
*
* _.indexBy(keys, 'dir');
* // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
*
* _.indexBy(keys, function(key) { return String.fromCharCode(key.code); });
* // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
*
* _.indexBy(characters, function(key) { this.fromCharCode(key.code); }, String);
* // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
*/
var indexBy = createAggregator(function(result, value, key) {
result[key] = value;
});
/**
* Invokes the method named by `methodName` on each element in the `collection`
* returning an array of the results of each invoked method. Additional arguments
* will be provided to each invoked method. If `methodName` is a function it
* will be invoked for, and `this` bound to, each element in the `collection`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|string} methodName The name of the method to invoke or
* the function invoked per iteration.
* @param {...*} [arg] Arguments to invoke the method with.
* @returns {Array} Returns a new array of the results of each invoked method.
* @example
*
* _.invoke([[5, 1, 7], [3, 2, 1]], 'sort');
* // => [[1, 5, 7], [1, 2, 3]]
*
* _.invoke([123, 456], String.prototype.split, '');
* // => [['1', '2', '3'], ['4', '5', '6']]
*/
function invoke(collection, methodName) {
var args = slice(arguments, 2),
index = -1,
isFunc = typeof methodName == 'function',
length = collection ? collection.length : 0,
result = Array(typeof length == 'number' ? length : 0);
forEach(collection, function(value) {
result[++index] = (isFunc ? methodName : value[methodName]).apply(value, args);
});
return result;
}
/**
* Creates an array of values by running each element in the collection
* through the callback. The callback is bound to `thisArg` and invoked with
* three arguments; (value, index|key, collection).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias collect
* @category Collections
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|Object|string} [callback=identity] The function called
* per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a new array of the results of each `callback` execution.
* @example
*
* _.map([1, 2, 3], function(num) { return num * 3; });
* // => [3, 6, 9]
*
* _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; });
* // => [3, 6, 9] (property order is not guaranteed across environments)
*
* var characters = [
* { 'name': 'barney', 'age': 36 },
* { 'name': 'fred', 'age': 40 }
* ];
*
* // using "_.pluck" callback shorthand
* _.map(characters, 'name');
* // => ['barney', 'fred']
*/
function map(collection, callback, thisArg) {
var index = -1,
length = collection ? collection.length : 0,
result = Array(typeof length == 'number' ? length : 0);
callback = lodash.createCallback(callback, thisArg, 3);
if (isArray(collection)) {
while (++index < length) {
result[index] = callback(collection[index], index, collection);
}
} else {
baseEach(collection, function(value, key, collection) {
result[++index] = callback(value, key, collection);
});
}
return result;
}
/**
* Retrieves the maximum value of a collection. If the collection is empty or
* falsey `-Infinity` is returned. If a callback is provided it will be executed
* for each value in the collection to generate the criterion by which the value
* is ranked. The callback is bound to `thisArg` and invoked with three
* arguments; (value, index, collection).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|Object|string} [callback=identity] The function called
* per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {*} Returns the maximum value.
* @example
*
* _.max([4, 2, 8, 6]);
* // => 8
*
* var characters = [
* { 'name': 'barney', 'age': 36 },
* { 'name': 'fred', 'age': 40 }
* ];
*
* _.max(characters, function(chr) { return chr.age; });
* // => { 'name': 'fred', 'age': 40 };
*
* // using "_.pluck" callback shorthand
* _.max(characters, 'age');
* // => { 'name': 'fred', 'age': 40 };
*/
function max(collection, callback, thisArg) {
var computed = -Infinity,
result = computed;
// allows working with functions like `_.map` without using
// their `index` argument as a callback
if (typeof callback != 'function' && thisArg && thisArg[callback] === collection) {
callback = null;
}
if (callback == null && isArray(collection)) {
var index = -1,
length = collection.length;
while (++index < length) {
var value = collection[index];
if (value > result) {
result = value;
}
}
} else {
callback = (callback == null && isString(collection))
? charAtCallback
: lodash.createCallback(callback, thisArg, 3);
baseEach(collection, function(value, index, collection) {
var current = callback(value, index, collection);
if (current > computed) {
computed = current;
result = value;
}
});
}
return result;
}
/**
* Retrieves the minimum value of a collection. If the collection is empty or
* falsey `Infinity` is returned. If a callback is provided it will be executed
* for each value in the collection to generate the criterion by which the value
* is ranked. The callback is bound to `thisArg` and invoked with three
* arguments; (value, index, collection).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|Object|string} [callback=identity] The function called
* per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {*} Returns the minimum value.
* @example
*
* _.min([4, 2, 8, 6]);
* // => 2
*
* var characters = [
* { 'name': 'barney', 'age': 36 },
* { 'name': 'fred', 'age': 40 }
* ];
*
* _.min(characters, function(chr) { return chr.age; });
* // => { 'name': 'barney', 'age': 36 };
*
* // using "_.pluck" callback shorthand
* _.min(characters, 'age');
* // => { 'name': 'barney', 'age': 36 };
*/
function min(collection, callback, thisArg) {
var computed = Infinity,
result = computed;
// allows working with functions like `_.map` without using
// their `index` argument as a callback
if (typeof callback != 'function' && thisArg && thisArg[callback] === collection) {
callback = null;
}
if (callback == null && isArray(collection)) {
var index = -1,
length = collection.length;
while (++index < length) {
var value = collection[index];
if (value < result) {
result = value;
}
}
} else {
callback = (callback == null && isString(collection))
? charAtCallback
: lodash.createCallback(callback, thisArg, 3);
baseEach(collection, function(value, index, collection) {
var current = callback(value, index, collection);
if (current < computed) {
computed = current;
result = value;
}
});
}
return result;
}
/**
* Retrieves the value of a specified property from all elements in the collection.
*
* @static
* @memberOf _
* @type Function
* @category Collections
* @param {Array|Object|string} collection The collection to iterate over.
* @param {string} property The name of the property to pluck.
* @returns {Array} Returns a new array of property values.
* @example
*
* var characters = [
* { 'name': 'barney', 'age': 36 },
* { 'name': 'fred', 'age': 40 }
* ];
*
* _.pluck(characters, 'name');
* // => ['barney', 'fred']
*/
var pluck = map;
/**
* Reduces a collection to a value which is the accumulated result of running
* each element in the collection through the callback, where each successive
* callback execution consumes the return value of the previous execution. If
* `accumulator` is not provided the first element of the collection will be
* used as the initial `accumulator` value. The callback is bound to `thisArg`
* and invoked with four arguments; (accumulator, value, index|key, collection).
*
* @static
* @memberOf _
* @alias foldl, inject
* @category Collections
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {*} [accumulator] Initial value of the accumulator.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {*} Returns the accumulated value.
* @example
*
* var sum = _.reduce([1, 2, 3], function(sum, num) {
* return sum + num;
* });
* // => 6
*
* var mapped = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) {
* result[key] = num * 3;
* return result;
* }, {});
* // => { 'a': 3, 'b': 6, 'c': 9 }
*/
function reduce(collection, callback, accumulator, thisArg) {
var noaccum = arguments.length < 3;
callback = lodash.createCallback(callback, thisArg, 4);
if (isArray(collection)) {
var index = -1,
length = collection.length;
if (noaccum) {
accumulator = collection[++index];
}
while (++index < length) {
accumulator = callback(accumulator, collection[index], index, collection);
}
} else {
baseEach(collection, function(value, index, collection) {
accumulator = noaccum
? (noaccum = false, value)
: callback(accumulator, value, index, collection)
});
}
return accumulator;
}
/**
* This method is like `_.reduce` except that it iterates over elements
* of a `collection` from right to left.
*
* @static
* @memberOf _
* @alias foldr
* @category Collections
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {*} [accumulator] Initial value of the accumulator.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {*} Returns the accumulated value.
* @example
*
* var list = [[0, 1], [2, 3], [4, 5]];
* var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []);
* // => [4, 5, 2, 3, 0, 1]
*/
function reduceRight(collection, callback, accumulator, thisArg) {
var noaccum = arguments.length < 3;
callback = lodash.createCallback(callback, thisArg, 4);
forEachRight(collection, function(value, index, collection) {
accumulator = noaccum
? (noaccum = false, value)
: callback(accumulator, value, index, collection);
});
return accumulator;
}
/**
* The opposite of `_.filter` this method returns the elements of a
* collection that the callback does **not** return truey for.
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|Object|string} [callback=identity] The function called
* per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a new array of elements that failed the callback check.
* @example
*
* var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
* // => [1, 3, 5]
*
* var characters = [
* { 'name': 'barney', 'age': 36, 'blocked': false },
* { 'name': 'fred', 'age': 40, 'blocked': true }
* ];
*
* // using "_.pluck" callback shorthand
* _.reject(characters, 'blocked');
* // => [{ 'name': 'barney', 'age': 36, 'blocked': false }]
*
* // using "_.where" callback shorthand
* _.reject(characters, { 'age': 36 });
* // => [{ 'name': 'fred', 'age': 40, 'blocked': true }]
*/
function reject(collection, callback, thisArg) {
callback = lodash.createCallback(callback, thisArg, 3);
return filter(collection, function(value, index, collection) {
return !callback(value, index, collection);
});
}
/**
* Retrieves a random element or `n` random elements from a collection.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|string} collection The collection to sample.
* @param {number} [n] The number of elements to sample.
* @param- {Object} [guard] Allows working with functions like `_.map`
* without using their `index` arguments as `n`.
* @returns {Array} Returns the random sample(s) of `collection`.
* @example
*
* _.sample([1, 2, 3, 4]);
* // => 2
*
* _.sample([1, 2, 3, 4], 2);
* // => [3, 1]
*/
function sample(collection, n, guard) {
if (collection && typeof collection.length != 'number') {
collection = values(collection);
} else if (support.unindexedChars && isString(collection)) {
collection = collection.split('');
}
if (n == null || guard) {
return collection ? collection[baseRandom(0, collection.length - 1)] : undefined;
}
var result = shuffle(collection);
result.length = nativeMin(nativeMax(0, n), result.length);
return result;
}
/**
* Creates an array of shuffled values, using a version of the Fisher-Yates
* shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|string} collection The collection to shuffle.
* @returns {Array} Returns a new shuffled collection.
* @example
*
* _.shuffle([1, 2, 3, 4, 5, 6]);
* // => [4, 1, 6, 3, 5, 2]
*/
function shuffle(collection) {
var index = -1,
length = collection ? collection.length : 0,
result = Array(typeof length == 'number' ? length : 0);
forEach(collection, function(value) {
var rand = baseRandom(0, ++index);
result[index] = result[rand];
result[rand] = value;
});
return result;
}
/**
* Gets the size of the `collection` by returning `collection.length` for arrays
* and array-like objects or the number of own enumerable properties for objects.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|string} collection The collection to inspect.
* @returns {number} Returns `collection.length` or number of own enumerable properties.
* @example
*
* _.size([1, 2]);
* // => 2
*
* _.size({ 'one': 1, 'two': 2, 'three': 3 });
* // => 3
*
* _.size('pebbles');
* // => 7
*/
function size(collection) {
var length = collection ? collection.length : 0;
return typeof length == 'number' ? length : keys(collection).length;
}
/**
* Checks if the callback returns a truey value for **any** element of a
* collection. The function returns as soon as it finds a passing value and
* does not iterate over the entire collection. The callback is bound to
* `thisArg` and invoked with three arguments; (value, index|key, collection).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias any
* @category Collections
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|Object|string} [callback=identity] The function called
* per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {boolean} Returns `true` if any element passed the callback check,
* else `false`.
* @example
*
* _.some([null, 0, 'yes', false], Boolean);
* // => true
*
* var characters = [
* { 'name': 'barney', 'age': 36, 'blocked': false },
* { 'name': 'fred', 'age': 40, 'blocked': true }
* ];
*
* // using "_.pluck" callback shorthand
* _.some(characters, 'blocked');
* // => true
*
* // using "_.where" callback shorthand
* _.some(characters, { 'age': 1 });
* // => false
*/
function some(collection, callback, thisArg) {
var result;
callback = lodash.createCallback(callback, thisArg, 3);
if (isArray(collection)) {
var index = -1,
length = collection.length;
while (++index < length) {
if ((result = callback(collection[index], index, collection))) {
break;
}
}
} else {
baseEach(collection, function(value, index, collection) {
return !(result = callback(value, index, collection));
});
}
return !!result;
}
/**
* Creates an array of elements, sorted in ascending order by the results of
* running each element in a collection through the callback. This method
* performs a stable sort, that is, it will preserve the original sort order
* of equal elements. The callback is bound to `thisArg` and invoked with
* three arguments; (value, index|key, collection).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an array of property names is provided for `callback` the collection
* will be sorted by each property value.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Array|Function|Object|string} [callback=identity] The function called
* per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a new array of sorted elements.
* @example
*
* _.sortBy([1, 2, 3], function(num) { return Math.sin(num); });
* // => [3, 1, 2]
*
* _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math);
* // => [3, 1, 2]
*
* var characters = [
* { 'name': 'barney', 'age': 36 },
* { 'name': 'fred', 'age': 40 },
* { 'name': 'barney', 'age': 26 },
* { 'name': 'fred', 'age': 30 }
* ];
*
* // using "_.pluck" callback shorthand
* _.map(_.sortBy(characters, 'age'), _.values);
* // => [['barney', 26], ['fred', 30], ['barney', 36], ['fred', 40]]
*
* // sorting by multiple properties
* _.map(_.sortBy(characters, ['name', 'age']), _.values);
* // = > [['barney', 26], ['barney', 36], ['fred', 30], ['fred', 40]]
*/
function sortBy(collection, callback, thisArg) {
var index = -1,
isArr = isArray(callback),
length = collection ? collection.length : 0,
result = Array(typeof length == 'number' ? length : 0);
if (!isArr) {
callback = lodash.createCallback(callback, thisArg, 3);
}
forEach(collection, function(value, key, collection) {
var object = result[++index] = getObject();
if (isArr) {
object.criteria = map(callback, function(key) { return value[key]; });
} else {
(object.criteria = getArray())[0] = callback(value, key, collection);
}
object.index = index;
object.value = value;
});
length = result.length;
result.sort(compareAscending);
while (length--) {
var object = result[length];
result[length] = object.value;
if (!isArr) {
releaseArray(object.criteria);
}
releaseObject(object);
}
return result;
}
/**
* Converts the `collection` to an array.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|string} collection The collection to convert.
* @returns {Array} Returns the new converted array.
* @example
*
* (function() { return _.toArray(arguments).slice(1); })(1, 2, 3, 4);
* // => [2, 3, 4]
*/
function toArray(collection) {
if (collection && typeof collection.length == 'number') {
return (support.unindexedChars && isString(collection))
? collection.split('')
: slice(collection);
}
return values(collection);
}
/**
* Performs a deep comparison of each element in a `collection` to the given
* `properties` object, returning an array of all elements that have equivalent
* property values.
*
* @static
* @memberOf _
* @type Function
* @category Collections
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Object} props The object of property values to filter by.
* @returns {Array} Returns a new array of elements that have the given properties.
* @example
*
* var characters = [
* { 'name': 'barney', 'age': 36, 'pets': ['hoppy'] },
* { 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] }
* ];
*
* _.where(characters, { 'age': 36 });
* // => [{ 'name': 'barney', 'age': 36, 'pets': ['hoppy'] }]
*
* _.where(characters, { 'pets': ['dino'] });
* // => [{ 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] }]
*/
var where = filter;
/*--------------------------------------------------------------------------*/
/**
* Creates an array with all falsey values removed. The values `false`, `null`,
* `0`, `""`, `undefined`, and `NaN` are all falsey.
*
* @static
* @memberOf _
* @category Arrays
* @param {Array} array The array to compact.
* @returns {Array} Returns a new array of filtered values.
* @example
*
* _.compact([0, 1, false, 2, '', 3]);
* // => [1, 2, 3]
*/
function compact(array) {
var index = -1,
length = array ? array.length : 0,
result = [];
while (++index < length) {
var value = array[index];
if (value) {
result.push(value);
}
}
return result;
}
/**
* Creates an array excluding all values of the provided arrays using strict
* equality for comparisons, i.e. `===`.
*
* @static
* @memberOf _
* @category Arrays
* @param {Array} array The array to process.
* @param {...Array} [values] The arrays of values to exclude.
* @returns {Array} Returns a new array of filtered values.
* @example
*
* _.difference([1, 2, 3, 4, 5], [5, 2, 10]);
* // => [1, 3, 4]
*/
function difference(array) {
return baseDifference(array, baseFlatten(arguments, true, true, 1));
}
/**
* This method is like `_.find` except that it returns the index of the first
* element that passes the callback check, instead of the element itself.
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Arrays
* @param {Array} array The array to search.
* @param {Function|Object|string} [callback=identity] The function called
* per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {number} Returns the index of the found element, else `-1`.
* @example
*
* var characters = [
* { 'name': 'barney', 'age': 36, 'blocked': false },
* { 'name': 'fred', 'age': 40, 'blocked': true },
* { 'name': 'pebbles', 'age': 1, 'blocked': false }
* ];
*
* _.findIndex(characters, function(chr) {
* return chr.age < 20;
* });
* // => 2
*
* // using "_.where" callback shorthand
* _.findIndex(characters, { 'age': 36 });
* // => 0
*
* // using "_.pluck" callback shorthand
* _.findIndex(characters, 'blocked');
* // => 1
*/
function findIndex(array, callback, thisArg) {
var index = -1,
length = array ? array.length : 0;
callback = lodash.createCallback(callback, thisArg, 3);
while (++index < length) {
if (callback(array[index], index, array)) {
return index;
}
}
return -1;
}
/**
* This method is like `_.findIndex` except that it iterates over elements
* of a `collection` from right to left.
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Arrays
* @param {Array} array The array to search.
* @param {Function|Object|string} [callback=identity] The function called
* per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {number} Returns the index of the found element, else `-1`.
* @example
*
* var characters = [
* { 'name': 'barney', 'age': 36, 'blocked': true },
* { 'name': 'fred', 'age': 40, 'blocked': false },
* { 'name': 'pebbles', 'age': 1, 'blocked': true }
* ];
*
* _.findLastIndex(characters, function(chr) {
* return chr.age > 30;
* });
* // => 1
*
* // using "_.where" callback shorthand
* _.findLastIndex(characters, { 'age': 36 });
* // => 0
*
* // using "_.pluck" callback shorthand
* _.findLastIndex(characters, 'blocked');
* // => 2
*/
function findLastIndex(array, callback, thisArg) {
var length = array ? array.length : 0;
callback = lodash.createCallback(callback, thisArg, 3);
while (length--) {
if (callback(array[length], length, array)) {
return length;
}
}
return -1;
}
/**
* Gets the first element or first `n` elements of an array. If a callback
* is provided elements at the beginning of the array are returned as long
* as the callback returns truey. The callback is bound to `thisArg` and
* invoked with three arguments; (value, index, array).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias head, take
* @category Arrays
* @param {Array} array The array to query.
* @param {Function|Object|number|string} [callback] The function called
* per element or the number of elements to return. If a property name or
* object is provided it will be used to create a "_.pluck" or "_.where"
* style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {*} Returns the first element(s) of `array`.
* @example
*
* _.first([1, 2, 3]);
* // => 1
*
* _.first([1, 2, 3], 2);
* // => [1, 2]
*
* _.first([1, 2, 3], function(num) {
* return num < 3;
* });
* // => [1, 2]
*
* var characters = [
* { 'name': 'barney', 'blocked': true, 'employer': 'slate' },
* { 'name': 'fred', 'blocked': false, 'employer': 'slate' },
* { 'name': 'pebbles', 'blocked': true, 'employer': 'na' }
* ];
*
* // using "_.pluck" callback shorthand
* _.first(characters, 'blocked');
* // => [{ 'name': 'barney', 'blocked': true, 'employer': 'slate' }]
*
* // using "_.where" callback shorthand
* _.pluck(_.first(characters, { 'employer': 'slate' }), 'name');
* // => ['barney', 'fred']
*/
function first(array, callback, thisArg) {
var n = 0,
length = array ? array.length : 0;
if (typeof callback != 'number' && callback != null) {
var index = -1;
callback = lodash.createCallback(callback, thisArg, 3);
while (++index < length && callback(array[index], index, array)) {
n++;
}
} else {
n = callback;
if (n == null || thisArg) {
return array ? array[0] : undefined;
}
}
return slice(array, 0, nativeMin(nativeMax(0, n), length));
}
/**
* Flattens a nested array (the nesting can be to any depth). If `isShallow`
* is truey, the array will only be flattened a single level. If a callback
* is provided each element of the array is passed through the callback before
* flattening. The callback is bound to `thisArg` and invoked with three
* arguments; (value, index, array).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Arrays
* @param {Array} array The array to flatten.
* @param {boolean} [isShallow=false] A flag to restrict flattening to a single level.
* @param {Function|Object|string} [callback=identity] The function called
* per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a new flattened array.
* @example
*
* _.flatten([1, [2], [3, [[4]]]]);
* // => [1, 2, 3, 4];
*
* _.flatten([1, [2], [3, [[4]]]], true);
* // => [1, 2, 3, [[4]]];
*
* var characters = [
* { 'name': 'barney', 'age': 30, 'pets': ['hoppy'] },
* { 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] }
* ];
*
* // using "_.pluck" callback shorthand
* _.flatten(characters, 'pets');
* // => ['hoppy', 'baby puss', 'dino']
*/
function flatten(array, isShallow, callback, thisArg) {
// juggle arguments
if (typeof isShallow != 'boolean' && isShallow != null) {
thisArg = callback;
callback = (typeof isShallow != 'function' && thisArg && thisArg[isShallow] === array) ? null : isShallow;
isShallow = false;
}
if (callback != null) {
array = map(array, callback, thisArg);
}
return baseFlatten(array, isShallow);
}
/**
* Gets the index at which the first occurrence of `value` is found using
* strict equality for comparisons, i.e. `===`. If the array is already sorted
* providing `true` for `fromIndex` will run a faster binary search.
*
* @static
* @memberOf _
* @category Arrays
* @param {Array} array The array to search.
* @param {*} value The value to search for.
* @param {boolean|number} [fromIndex=0] The index to search from or `true`
* to perform a binary search on a sorted array.
* @returns {number} Returns the index of the matched value or `-1`.
* @example
*
* _.indexOf([1, 2, 3, 1, 2, 3], 2);
* // => 1
*
* _.indexOf([1, 2, 3, 1, 2, 3], 2, 3);
* // => 4
*
* _.indexOf([1, 1, 2, 2, 3, 3], 2, true);
* // => 2
*/
function indexOf(array, value, fromIndex) {
if (typeof fromIndex == 'number') {
var length = array ? array.length : 0;
fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0);
} else if (fromIndex) {
var index = sortedIndex(array, value);
return array[index] === value ? index : -1;
}
return baseIndexOf(array, value, fromIndex);
}
/**
* Gets all but the last element or last `n` elements of an array. If a
* callback is provided elements at the end of the array are excluded from
* the result as long as the callback returns truey. The callback is bound
* to `thisArg` and invoked with three arguments; (value, index, array).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Arrays
* @param {Array} array The array to query.
* @param {Function|Object|number|string} [callback=1] The function called
* per element or the number of elements to exclude. If a property name or
* object is provided it will be used to create a "_.pluck" or "_.where"
* style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a slice of `array`.
* @example
*
* _.initial([1, 2, 3]);
* // => [1, 2]
*
* _.initial([1, 2, 3], 2);
* // => [1]
*
* _.initial([1, 2, 3], function(num) {
* return num > 1;
* });
* // => [1]
*
* var characters = [
* { 'name': 'barney', 'blocked': false, 'employer': 'slate' },
* { 'name': 'fred', 'blocked': true, 'employer': 'slate' },
* { 'name': 'pebbles', 'blocked': true, 'employer': 'na' }
* ];
*
* // using "_.pluck" callback shorthand
* _.initial(characters, 'blocked');
* // => [{ 'name': 'barney', 'blocked': false, 'employer': 'slate' }]
*
* // using "_.where" callback shorthand
* _.pluck(_.initial(characters, { 'employer': 'na' }), 'name');
* // => ['barney', 'fred']
*/
function initial(array, callback, thisArg) {
var n = 0,
length = array ? array.length : 0;
if (typeof callback != 'number' && callback != null) {
var index = length;
callback = lodash.createCallback(callback, thisArg, 3);
while (index-- && callback(array[index], index, array)) {
n++;
}
} else {
n = (callback == null || thisArg) ? 1 : callback || n;
}
return slice(array, 0, nativeMin(nativeMax(0, length - n), length));
}
/**
* Creates an array of unique values present in all provided arrays using
* strict equality for comparisons, i.e. `===`.
*
* @static
* @memberOf _
* @category Arrays
* @param {...Array} [array] The arrays to inspect.
* @returns {Array} Returns an array of shared values.
* @example
*
* _.intersection([1, 2, 3], [5, 2, 1, 4], [2, 1]);
* // => [1, 2]
*/
function intersection() {
var args = [],
argsIndex = -1,
argsLength = arguments.length,
caches = getArray(),
indexOf = getIndexOf(),
trustIndexOf = indexOf === baseIndexOf,
seen = getArray();
while (++argsIndex < argsLength) {
var value = arguments[argsIndex];
if (isArray(value) || isArguments(value)) {
args.push(value);
caches.push(trustIndexOf && value.length >= largeArraySize &&
createCache(argsIndex ? args[argsIndex] : seen));
}
}
var array = args[0],
index = -1,
length = array ? array.length : 0,
result = [];
outer:
while (++index < length) {
var cache = caches[0];
value = array[index];
if ((cache ? cacheIndexOf(cache, value) : indexOf(seen, value)) < 0) {
argsIndex = argsLength;
(cache || seen).push(value);
while (--argsIndex) {
cache = caches[argsIndex];
if ((cache ? cacheIndexOf(cache, value) : indexOf(args[argsIndex], value)) < 0) {
continue outer;
}
}
result.push(value);
}
}
while (argsLength--) {
cache = caches[argsLength];
if (cache) {
releaseObject(cache);
}
}
releaseArray(caches);
releaseArray(seen);
return result;
}
/**
* Gets the last element or last `n` elements of an array. If a callback is
* provided elements at the end of the array are returned as long as the
* callback returns truey. The callback is bound to `thisArg` and invoked
* with three arguments; (value, index, array).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Arrays
* @param {Array} array The array to query.
* @param {Function|Object|number|string} [callback] The function called
* per element or the number of elements to return. If a property name or
* object is provided it will be used to create a "_.pluck" or "_.where"
* style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {*} Returns the last element(s) of `array`.
* @example
*
* _.last([1, 2, 3]);
* // => 3
*
* _.last([1, 2, 3], 2);
* // => [2, 3]
*
* _.last([1, 2, 3], function(num) {
* return num > 1;
* });
* // => [2, 3]
*
* var characters = [
* { 'name': 'barney', 'blocked': false, 'employer': 'slate' },
* { 'name': 'fred', 'blocked': true, 'employer': 'slate' },
* { 'name': 'pebbles', 'blocked': true, 'employer': 'na' }
* ];
*
* // using "_.pluck" callback shorthand
* _.pluck(_.last(characters, 'blocked'), 'name');
* // => ['fred', 'pebbles']
*
* // using "_.where" callback shorthand
* _.last(characters, { 'employer': 'na' });
* // => [{ 'name': 'pebbles', 'blocked': true, 'employer': 'na' }]
*/
function last(array, callback, thisArg) {
var n = 0,
length = array ? array.length : 0;
if (typeof callback != 'number' && callback != null) {
var index = length;
callback = lodash.createCallback(callback, thisArg, 3);
while (index-- && callback(array[index], index, array)) {
n++;
}
} else {
n = callback;
if (n == null || thisArg) {
return array ? array[length - 1] : undefined;
}
}
return slice(array, nativeMax(0, length - n));
}
/**
* Gets the index at which the last occurrence of `value` is found using strict
* equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used
* as the offset from the end of the collection.
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Arrays
* @param {Array} array The array to search.
* @param {*} value The value to search for.
* @param {number} [fromIndex=array.length-1] The index to search from.
* @returns {number} Returns the index of the matched value or `-1`.
* @example
*
* _.lastIndexOf([1, 2, 3, 1, 2, 3], 2);
* // => 4
*
* _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3);
* // => 1
*/
function lastIndexOf(array, value, fromIndex) {
var index = array ? array.length : 0;
if (typeof fromIndex == 'number') {
index = (fromIndex < 0 ? nativeMax(0, index + fromIndex) : nativeMin(fromIndex, index - 1)) + 1;
}
while (index--) {
if (array[index] === value) {
return index;
}
}
return -1;
}
/**
* Removes all provided values from the given array using strict equality for
* comparisons, i.e. `===`.
*
* @static
* @memberOf _
* @category Arrays
* @param {Array} array The array to modify.
* @param {...*} [value] The values to remove.
* @returns {Array} Returns `array`.
* @example
*
* var array = [1, 2, 3, 1, 2, 3];
* _.pull(array, 2, 3);
* console.log(array);
* // => [1, 1]
*/
function pull(array) {
var args = arguments,
argsIndex = 0,
argsLength = args.length,
length = array ? array.length : 0;
while (++argsIndex < argsLength) {
var index = -1,
value = args[argsIndex];
while (++index < length) {
if (array[index] === value) {
splice.call(array, index--, 1);
length--;
}
}
}
return array;
}
/**
* Creates an array of numbers (positive and/or negative) progressing from
* `start` up to but not including `end`. If `start` is less than `stop` a
* zero-length range is created unless a negative `step` is specified.
*
* @static
* @memberOf _
* @category Arrays
* @param {number} [start=0] The start of the range.
* @param {number} end The end of the range.
* @param {number} [step=1] The value to increment or decrement by.
* @returns {Array} Returns a new range array.
* @example
*
* _.range(4);
* // => [0, 1, 2, 3]
*
* _.range(1, 5);
* // => [1, 2, 3, 4]
*
* _.range(0, 20, 5);
* // => [0, 5, 10, 15]
*
* _.range(0, -4, -1);
* // => [0, -1, -2, -3]
*
* _.range(1, 4, 0);
* // => [1, 1, 1]
*
* _.range(0);
* // => []
*/
function range(start, end, step) {
start = +start || 0;
step = typeof step == 'number' ? step : (+step || 1);
if (end == null) {
end = start;
start = 0;
}
// use `Array(length)` so engines like Chakra and V8 avoid slower modes
// http://youtu.be/XAqIpGU8ZZk#t=17m25s
var index = -1,
length = nativeMax(0, ceil((end - start) / (step || 1))),
result = Array(length);
while (++index < length) {
result[index] = start;
start += step;
}
return result;
}
/**
* Removes all elements from an array that the callback returns truey for
* and returns an array of removed elements. The callback is bound to `thisArg`
* and invoked with three arguments; (value, index, array).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Arrays
* @param {Array} array The array to modify.
* @param {Function|Object|string} [callback=identity] The function called
* per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a new array of removed elements.
* @example
*
* var array = [1, 2, 3, 4, 5, 6];
* var evens = _.remove(array, function(num) { return num % 2 == 0; });
*
* console.log(array);
* // => [1, 3, 5]
*
* console.log(evens);
* // => [2, 4, 6]
*/
function remove(array, callback, thisArg) {
var index = -1,
length = array ? array.length : 0,
result = [];
callback = lodash.createCallback(callback, thisArg, 3);
while (++index < length) {
var value = array[index];
if (callback(value, index, array)) {
result.push(value);
splice.call(array, index--, 1);
length--;
}
}
return result;
}
/**
* The opposite of `_.initial` this method gets all but the first element or
* first `n` elements of an array. If a callback function is provided elements
* at the beginning of the array are excluded from the result as long as the
* callback returns truey. The callback is bound to `thisArg` and invoked
* with three arguments; (value, index, array).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias drop, tail
* @category Arrays
* @param {Array} array The array to query.
* @param {Function|Object|number|string} [callback=1] The function called
* per element or the number of elements to exclude. If a property name or
* object is provided it will be used to create a "_.pluck" or "_.where"
* style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a slice of `array`.
* @example
*
* _.rest([1, 2, 3]);
* // => [2, 3]
*
* _.rest([1, 2, 3], 2);
* // => [3]
*
* _.rest([1, 2, 3], function(num) {
* return num < 3;
* });
* // => [3]
*
* var characters = [
* { 'name': 'barney', 'blocked': true, 'employer': 'slate' },
* { 'name': 'fred', 'blocked': false, 'employer': 'slate' },
* { 'name': 'pebbles', 'blocked': true, 'employer': 'na' }
* ];
*
* // using "_.pluck" callback shorthand
* _.pluck(_.rest(characters, 'blocked'), 'name');
* // => ['fred', 'pebbles']
*
* // using "_.where" callback shorthand
* _.rest(characters, { 'employer': 'slate' });
* // => [{ 'name': 'pebbles', 'blocked': true, 'employer': 'na' }]
*/
function rest(array, callback, thisArg) {
if (typeof callback != 'number' && callback != null) {
var n = 0,
index = -1,
length = array ? array.length : 0;
callback = lodash.createCallback(callback, thisArg, 3);
while (++index < length && callback(array[index], index, array)) {
n++;
}
} else {
n = (callback == null || thisArg) ? 1 : nativeMax(0, callback);
}
return slice(array, n);
}
/**
* Uses a binary search to determine the smallest index at which a value
* should be inserted into a given sorted array in order to maintain the sort
* order of the array. If a callback is provided it will be executed for
* `value` and each element of `array` to compute their sort ranking. The
* callback is bound to `thisArg` and invoked with one argument; (value).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Arrays
* @param {Array} array The array to inspect.
* @param {*} value The value to evaluate.
* @param {Function|Object|string} [callback=identity] The function called
* per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {number} Returns the index at which `value` should be inserted
* into `array`.
* @example
*
* _.sortedIndex([20, 30, 50], 40);
* // => 2
*
* // using "_.pluck" callback shorthand
* _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x');
* // => 2
*
* var dict = {
* 'wordToNumber': { 'twenty': 20, 'thirty': 30, 'fourty': 40, 'fifty': 50 }
* };
*
* _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) {
* return dict.wordToNumber[word];
* });
* // => 2
*
* _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) {
* return this.wordToNumber[word];
* }, dict);
* // => 2
*/
function sortedIndex(array, value, callback, thisArg) {
var low = 0,
high = array ? array.length : low;
// explicitly reference `identity` for better inlining in Firefox
callback = callback ? lodash.createCallback(callback, thisArg, 1) : identity;
value = callback(value);
while (low < high) {
var mid = (low + high) >>> 1;
(callback(array[mid]) < value)
? low = mid + 1
: high = mid;
}
return low;
}
/**
* Creates an array of unique values, in order, of the provided arrays using
* strict equality for comparisons, i.e. `===`.
*
* @static
* @memberOf _
* @category Arrays
* @param {...Array} [array] The arrays to inspect.
* @returns {Array} Returns an array of combined values.
* @example
*
* _.union([1, 2, 3], [5, 2, 1, 4], [2, 1]);
* // => [1, 2, 3, 5, 4]
*/
function union() {
return baseUniq(baseFlatten(arguments, true, true));
}
/**
* Creates a duplicate-value-free version of an array using strict equality
* for comparisons, i.e. `===`. If the array is sorted, providing
* `true` for `isSorted` will use a faster algorithm. If a callback is provided
* each element of `array` is passed through the callback before uniqueness
* is computed. The callback is bound to `thisArg` and invoked with three
* arguments; (value, index, array).
*
* If a property name is provided for `callback` the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is provided for `callback` the created "_.where" style callback
* will return `true` for elements that have the properties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias unique
* @category Arrays
* @param {Array} array The array to process.
* @param {boolean} [isSorted=false] A flag to indicate that `array` is sorted.
* @param {Function|Object|string} [callback=identity] The function called
* per iteration. If a property name or object is provided it will be used
* to create a "_.pluck" or "_.where" style callback, respectively.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a duplicate-value-free array.
* @example
*
* _.uniq([1, 2, 1, 3, 1]);
* // => [1, 2, 3]
*
* _.uniq([1, 1, 2, 2, 3], true);
* // => [1, 2, 3]
*
* _.uniq(['A', 'b', 'C', 'a', 'B', 'c'], function(letter) { return letter.toLowerCase(); });
* // => ['A', 'b', 'C']
*
* _.uniq([1, 2.5, 3, 1.5, 2, 3.5], function(num) { return this.floor(num); }, Math);
* // => [1, 2.5, 3]
*
* // using "_.pluck" callback shorthand
* _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 1 }, { 'x': 2 }]
*/
function uniq(array, isSorted, callback, thisArg) {
// juggle arguments
if (typeof isSorted != 'boolean' && isSorted != null) {
thisArg = callback;
callback = (typeof isSorted != 'function' && thisArg && thisArg[isSorted] === array) ? null : isSorted;
isSorted = false;
}
if (callback != null) {
callback = lodash.createCallback(callback, thisArg, 3);
}
return baseUniq(array, isSorted, callback);
}
/**
* Creates an array excluding all provided values using strict equality for
* comparisons, i.e. `===`.
*
* @static
* @memberOf _
* @category Arrays
* @param {Array} array The array to filter.
* @param {...*} [value] The values to exclude.
* @returns {Array} Returns a new array of filtered values.
* @example
*
* _.without([1, 2, 1, 0, 3, 1, 4], 0, 1);
* // => [2, 3, 4]
*/
function without(array) {
return baseDifference(array, slice(arguments, 1));
}
/**
* Creates an array that is the symmetric difference of the provided arrays.
* See http://en.wikipedia.org/wiki/Symmetric_difference.
*
* @static
* @memberOf _
* @category Arrays
* @param {...Array} [array] The arrays to inspect.
* @returns {Array} Returns an array of values.
* @example
*
* _.xor([1, 2, 3], [5, 2, 1, 4]);
* // => [3, 5, 4]
*
* _.xor([1, 2, 5], [2, 3, 5], [3, 4, 5]);
* // => [1, 4, 5]
*/
function xor() {
var index = -1,
length = arguments.length;
while (++index < length) {
var array = arguments[index];
if (isArray(array) || isArguments(array)) {
var result = result
? baseUniq(baseDifference(result, array).concat(baseDifference(array, result)))
: array;
}
}
return result || [];
}
/**
* Creates an array of grouped elements, the first of which contains the first
* elements of the given arrays, the second of which contains the second
* elements of the given arrays, and so on.
*
* @static
* @memberOf _
* @alias unzip
* @category Arrays
* @param {...Array} [array] Arrays to process.
* @returns {Array} Returns a new array of grouped elements.
* @example
*
* _.zip(['fred', 'barney'], [30, 40], [true, false]);
* // => [['fred', 30, true], ['barney', 40, false]]
*/
function zip() {
var array = arguments.length > 1 ? arguments : arguments[0],
index = -1,
length = array ? max(pluck(array, 'length')) : 0,
result = Array(length < 0 ? 0 : length);
while (++index < length) {
result[index] = pluck(array, index);
}
return result;
}
/**
* Creates an object composed from arrays of `keys` and `values`. Provide
* either a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]`
* or two arrays, one of `keys` and one of corresponding `values`.
*
* @static
* @memberOf _
* @alias object
* @category Arrays
* @param {Array} keys The array of keys.
* @param {Array} [values=[]] The array of values.
* @returns {Object} Returns an object composed of the given keys and
* corresponding values.
* @example
*
* _.zipObject(['fred', 'barney'], [30, 40]);
* // => { 'fred': 30, 'barney': 40 }
*/
function zipObject(keys, values) {
var index = -1,
length = keys ? keys.length : 0,
result = {};
if (!values && length && !isArray(keys[0])) {
values = [];
}
while (++index < length) {
var key = keys[index];
if (values) {
result[key] = values[index];
} else if (key) {
result[key[0]] = key[1];
}
}
return result;
}
/*--------------------------------------------------------------------------*/
/**
* Creates a function that executes `func`, with the `this` binding and
* arguments of the created function, only after being called `n` times.
*
* @static
* @memberOf _
* @category Functions
* @param {number} n The number of times the function must be called before
* `func` is executed.
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
*
* var saves = ['profile', 'settings'];
*
* var done = _.after(saves.length, function() {
* console.log('Done saving!');
* });
*
* _.forEach(saves, function(type) {
* asyncSave({ 'type': type, 'complete': done });
* });
* // => logs 'Done saving!', after all saves have completed
*/
function after(n, func) {
if (!isFunction(func)) {
throw new TypeError;
}
return function() {
if (--n < 1) {
return func.apply(this, arguments);
}
};
}
/**
* Creates a function that, when called, invokes `func` with the `this`
* binding of `thisArg` and prepends any additional `bind` arguments to those
* provided to the bound function.
*
* @static
* @memberOf _
* @category Functions
* @param {Function} func The function to bind.
* @param {*} [thisArg] The `this` binding of `func`.
* @param {...*} [arg] Arguments to be partially applied.
* @returns {Function} Returns the new bound function.
* @example
*
* var func = function(greeting) {
* return greeting + ' ' + this.name;
* };
*
* func = _.bind(func, { 'name': 'fred' }, 'hi');
* func();
* // => 'hi fred'
*/
function bind(func, thisArg) {
return arguments.length > 2
? createWrapper(func, 17, slice(arguments, 2), null, thisArg)
: createWrapper(func, 1, null, null, thisArg);
}
/**
* Binds methods of an object to the object itself, overwriting the existing
* method. Method names may be specified as individual arguments or as arrays
* of method names. If no method names are provided all the function properties
* of `object` will be bound.
*
* @static
* @memberOf _
* @category Functions
* @param {Object} object The object to bind and assign the bound methods to.
* @param {...string} [methodName] The object method names to
* bind, specified as individual method names or arrays of method names.
* @returns {Object} Returns `object`.
* @example
*
* var view = {
* 'label': 'docs',
* 'onClick': function() { console.log('clicked ' + this.label); }
* };
*
* _.bindAll(view);
* jQuery('#docs').on('click', view.onClick);
* // => logs 'clicked docs', when the button is clicked
*/
function bindAll(object) {
var funcs = arguments.length > 1 ? baseFlatten(arguments, true, false, 1) : functions(object),
index = -1,
length = funcs.length;
while (++index < length) {
var key = funcs[index];
object[key] = createWrapper(object[key], 1, null, null, object);
}
return object;
}
/**
* Creates a function that, when called, invokes the method at `object[key]`
* and prepends any additional `bindKey` arguments to those provided to the bound
* function. This method differs from `_.bind` by allowing bound functions to
* reference methods that will be redefined or don't yet exist.
* See http://michaux.ca/articles/lazy-function-definition-pattern.
*
* @static
* @memberOf _
* @category Functions
* @param {Object} object The object the method belongs to.
* @param {string} key The key of the method.
* @param {...*} [arg] Arguments to be partially applied.
* @returns {Function} Returns the new bound function.
* @example
*
* var object = {
* 'name': 'fred',
* 'greet': function(greeting) {
* return greeting + ' ' + this.name;
* }
* };
*
* var func = _.bindKey(object, 'greet', 'hi');
* func();
* // => 'hi fred'
*
* object.greet = function(greeting) {
* return greeting + 'ya ' + this.name + '!';
* };
*
* func();
* // => 'hiya fred!'
*/
function bindKey(object, key) {
return arguments.length > 2
? createWrapper(key, 19, slice(arguments, 2), null, object)
: createWrapper(key, 3, null, null, object);
}
/**
* Creates a function that is the composition of the provided functions,
* where each function consumes the return value of the function that follows.
* For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`.
* Each function is executed with the `this` binding of the composed function.
*
* @static
* @memberOf _
* @category Functions
* @param {...Function} [func] Functions to compose.
* @returns {Function} Returns the new composed function.
* @example
*
* var realNameMap = {
* 'pebbles': 'penelope'
* };
*
* var format = function(name) {
* name = realNameMap[name.toLowerCase()] || name;
* return name.charAt(0).toUpperCase() + name.slice(1).toLowerCase();
* };
*
* var greet = function(formatted) {
* return 'Hiya ' + formatted + '!';
* };
*
* var welcome = _.compose(greet, format);
* welcome('pebbles');
* // => 'Hiya Penelope!'
*/
function compose() {
var funcs = arguments,
length = funcs.length;
while (length--) {
if (!isFunction(funcs[length])) {
throw new TypeError;
}
}
return function() {
var args = arguments,
length = funcs.length;
while (length--) {
args = [funcs[length].apply(this, args)];
}
return args[0];
};
}
/**
* Creates a function which accepts one or more arguments of `func` that when
* invoked either executes `func` returning its result, if all `func` arguments
* have been provided, or returns a function that accepts one or more of the
* remaining `func` arguments, and so on. The arity of `func` can be specified
* if `func.length` is not sufficient.
*
* @static
* @memberOf _
* @category Functions
* @param {Function} func The function to curry.
* @param {number} [arity=func.length] The arity of `func`.
* @returns {Function} Returns the new curried function.
* @example
*
* var curried = _.curry(function(a, b, c) {
* console.log(a + b + c);
* });
*
* curried(1)(2)(3);
* // => 6
*
* curried(1, 2)(3);
* // => 6
*
* curried(1, 2, 3);
* // => 6
*/
function curry(func, arity) {
arity = typeof arity == 'number' ? arity : (+arity || func.length);
return createWrapper(func, 4, null, null, null, arity);
}
/**
* Creates a function that will delay the execution of `func` until after
* `wait` milliseconds have elapsed since the last time it was invoked.
* Provide an options object to indicate that `func` should be invoked on
* the leading and/or trailing edge of the `wait` timeout. Subsequent calls
* to the debounced function will return the result of the last `func` call.
*
* Note: If `leading` and `trailing` options are `true` `func` will be called
* on the trailing edge of the timeout only if the the debounced function is
* invoked more than once during the `wait` timeout.
*
* @static
* @memberOf _
* @category Functions
* @param {Function} func The function to debounce.
* @param {number} wait The number of milliseconds to delay.
* @param {Object} [options] The options object.
* @param {boolean} [options.leading=false] Specify execution on the leading edge of the timeout.
* @param {number} [options.maxWait] The maximum time `func` is allowed to be delayed before it's called.
* @param {boolean} [options.trailing=true] Specify execution on the trailing edge of the timeout.
* @returns {Function} Returns the new debounced function.
* @example
*
* // avoid costly calculations while the window size is in flux
* var lazyLayout = _.debounce(calculateLayout, 150);
* jQuery(window).on('resize', lazyLayout);
*
* // execute `sendMail` when the click event is fired, debouncing subsequent calls
* jQuery('#postbox').on('click', _.debounce(sendMail, 300, {
* 'leading': true,
* 'trailing': false
* });
*
* // ensure `batchLog` is executed once after 1 second of debounced calls
* var source = new EventSource('/stream');
* source.addEventListener('message', _.debounce(batchLog, 250, {
* 'maxWait': 1000
* }, false);
*/
function debounce(func, wait, options) {
var args,
maxTimeoutId,
result,
stamp,
thisArg,
timeoutId,
trailingCall,
lastCalled = 0,
maxWait = false,
trailing = true;
if (!isFunction(func)) {
throw new TypeError;
}
wait = nativeMax(0, wait) || 0;
if (options === true) {
var leading = true;
trailing = false;
} else if (isObject(options)) {
leading = options.leading;
maxWait = 'maxWait' in options && (nativeMax(wait, options.maxWait) || 0);
trailing = 'trailing' in options ? options.trailing : trailing;
}
var delayed = function() {
var remaining = wait - (now() - stamp);
if (remaining <= 0) {
if (maxTimeoutId) {
clearTimeout(maxTimeoutId);
}
var isCalled = trailingCall;
maxTimeoutId = timeoutId = trailingCall = undefined;
if (isCalled) {
lastCalled = now();
result = func.apply(thisArg, args);
if (!timeoutId && !maxTimeoutId) {
args = thisArg = null;
}
}
} else {
timeoutId = setTimeout(delayed, remaining);
}
};
var maxDelayed = function() {
if (timeoutId) {
clearTimeout(timeoutId);
}
maxTimeoutId = timeoutId = trailingCall = undefined;
if (trailing || (maxWait !== wait)) {
lastCalled = now();
result = func.apply(thisArg, args);
if (!timeoutId && !maxTimeoutId) {
args = thisArg = null;
}
}
};
return function() {
args = arguments;
stamp = now();
thisArg = this;
trailingCall = trailing && (timeoutId || !leading);
if (maxWait === false) {
var leadingCall = leading && !timeoutId;
} else {
if (!maxTimeoutId && !leading) {
lastCalled = stamp;
}
var remaining = maxWait - (stamp - lastCalled),
isCalled = remaining <= 0;
if (isCalled) {
if (maxTimeoutId) {
maxTimeoutId = clearTimeout(maxTimeoutId);
}
lastCalled = stamp;
result = func.apply(thisArg, args);
}
else if (!maxTimeoutId) {
maxTimeoutId = setTimeout(maxDelayed, remaining);
}
}
if (isCalled && timeoutId) {
timeoutId = clearTimeout(timeoutId);
}
else if (!timeoutId && wait !== maxWait) {
timeoutId = setTimeout(delayed, wait);
}
if (leadingCall) {
isCalled = true;
result = func.apply(thisArg, args);
}
if (isCalled && !timeoutId && !maxTimeoutId) {
args = thisArg = null;
}
return result;
};
}
/**
* Defers executing the `func` function until the current call stack has cleared.
* Additional arguments will be provided to `func` when it is invoked.
*
* @static
* @memberOf _
* @category Functions
* @param {Function} func The function to defer.
* @param {...*} [arg] Arguments to invoke the function with.
* @returns {number} Returns the timer id.
* @example
*
* _.defer(function(text) { console.log(text); }, 'deferred');
* // logs 'deferred' after one or more milliseconds
*/
function defer(func) {
if (!isFunction(func)) {
throw new TypeError;
}
var args = slice(arguments, 1);
return setTimeout(function() { func.apply(undefined, args); }, 1);
}
/**
* Executes the `func` function after `wait` milliseconds. Additional arguments
* will be provided to `func` when it is invoked.
*
* @static
* @memberOf _
* @category Functions
* @param {Function} func The function to delay.
* @param {number} wait The number of milliseconds to delay execution.
* @param {...*} [arg] Arguments to invoke the function with.
* @returns {number} Returns the timer id.
* @example
*
* _.delay(function(text) { console.log(text); }, 1000, 'later');
* // => logs 'later' after one second
*/
function delay(func, wait) {
if (!isFunction(func)) {
throw new TypeError;
}
var args = slice(arguments, 2);
return setTimeout(function() { func.apply(undefined, args); }, wait);
}
/**
* Creates a function that memoizes the result of `func`. If `resolver` is
* provided it will be used to determine the cache key for storing the result
* based on the arguments provided to the memoized function. By default, the
* first argument provided to the memoized function is used as the cache key.
* The `func` is executed with the `this` binding of the memoized function.
* The result cache is exposed as the `cache` property on the memoized function.
*
* @static
* @memberOf _
* @category Functions
* @param {Function} func The function to have its output memoized.
* @param {Function} [resolver] A function used to resolve the cache key.
* @returns {Function} Returns the new memoizing function.
* @example
*
* var fibonacci = _.memoize(function(n) {
* return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2);
* });
*
* fibonacci(9)
* // => 34
*
* var data = {
* 'fred': { 'name': 'fred', 'age': 40 },
* 'pebbles': { 'name': 'pebbles', 'age': 1 }
* };
*
* // modifying the result cache
* var get = _.memoize(function(name) { return data[name]; }, _.identity);
* get('pebbles');
* // => { 'name': 'pebbles', 'age': 1 }
*
* get.cache.pebbles.name = 'penelope';
* get('pebbles');
* // => { 'name': 'penelope', 'age': 1 }
*/
function memoize(func, resolver) {
if (!isFunction(func)) {
throw new TypeError;
}
var memoized = function() {
var cache = memoized.cache,
key = resolver ? resolver.apply(this, arguments) : keyPrefix + arguments[0];
return hasOwnProperty.call(cache, key)
? cache[key]
: (cache[key] = func.apply(this, arguments));
}
memoized.cache = {};
return memoized;
}
/**
* Creates a function that is restricted to execute `func` once. Repeat calls to
* the function will return the value of the first call. The `func` is executed
* with the `this` binding of the created function.
*
* @static
* @memberOf _
* @category Functions
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
*
* var initialize = _.once(createApplication);
* initialize();
* initialize();
* // `initialize` executes `createApplication` once
*/
function once(func) {
var ran,
result;
if (!isFunction(func)) {
throw new TypeError;
}
return function() {
if (ran) {
return result;
}
ran = true;
result = func.apply(this, arguments);
// clear the `func` variable so the function may be garbage collected
func = null;
return result;
};
}
/**
* Creates a function that, when called, invokes `func` with any additional
* `partial` arguments prepended to those provided to the new function. This
* method is similar to `_.bind` except it does **not** alter the `this` binding.
*
* @static
* @memberOf _
* @category Functions
* @param {Function} func The function to partially apply arguments to.
* @param {...*} [arg] Arguments to be partially applied.
* @returns {Function} Returns the new partially applied function.
* @example
*
* var greet = function(greeting, name) { return greeting + ' ' + name; };
* var hi = _.partial(greet, 'hi');
* hi('fred');
* // => 'hi fred'
*/
function partial(func) {
return createWrapper(func, 16, slice(arguments, 1));
}
/**
* This method is like `_.partial` except that `partial` arguments are
* appended to those provided to the new function.
*
* @static
* @memberOf _
* @category Functions
* @param {Function} func The function to partially apply arguments to.
* @param {...*} [arg] Arguments to be partially applied.
* @returns {Function} Returns the new partially applied function.
* @example
*
* var defaultsDeep = _.partialRight(_.merge, _.defaults);
*
* var options = {
* 'variable': 'data',
* 'imports': { 'jq': $ }
* };
*
* defaultsDeep(options, _.templateSettings);
*
* options.variable
* // => 'data'
*
* options.imports
* // => { '_': _, 'jq': $ }
*/
function partialRight(func) {
return createWrapper(func, 32, null, slice(arguments, 1));
}
/**
* Creates a function that, when executed, will only call the `func` function
* at most once per every `wait` milliseconds. Provide an options object to
* indicate that `func` should be invoked on the leading and/or trailing edge
* of the `wait` timeout. Subsequent calls to the throttled function will
* return the result of the last `func` call.
*
* Note: If `leading` and `trailing` options are `true` `func` will be called
* on the trailing edge of the timeout only if the the throttled function is
* invoked more than once during the `wait` timeout.
*
* @static
* @memberOf _
* @category Functions
* @param {Function} func The function to throttle.
* @param {number} wait The number of milliseconds to throttle executions to.
* @param {Object} [options] The options object.
* @param {boolean} [options.leading=true] Specify execution on the leading edge of the timeout.
* @param {boolean} [options.trailing=true] Specify execution on the trailing edge of the timeout.
* @returns {Function} Returns the new throttled function.
* @example
*
* // avoid excessively updating the position while scrolling
* var throttled = _.throttle(updatePosition, 100);
* jQuery(window).on('scroll', throttled);
*
* // execute `renewToken` when the click event is fired, but not more than once every 5 minutes
* jQuery('.interactive').on('click', _.throttle(renewToken, 300000, {
* 'trailing': false
* }));
*/
function throttle(func, wait, options) {
var leading = true,
trailing = true;
if (!isFunction(func)) {
throw new TypeError;
}
if (options === false) {
leading = false;
} else if (isObject(options)) {
leading = 'leading' in options ? options.leading : leading;
trailing = 'trailing' in options ? options.trailing : trailing;
}
debounceOptions.leading = leading;
debounceOptions.maxWait = wait;
debounceOptions.trailing = trailing;
return debounce(func, wait, debounceOptions);
}
/**
* Creates a function that provides `value` to the wrapper function as its
* first argument. Additional arguments provided to the function are appended
* to those provided to the wrapper function. The wrapper is executed with
* the `this` binding of the created function.
*
* @static
* @memberOf _
* @category Functions
* @param {*} value The value to wrap.
* @param {Function} wrapper The wrapper function.
* @returns {Function} Returns the new function.
* @example
*
* var p = _.wrap(_.escape, function(func, text) {
* return '<p>' + func(text) + '</p>';
* });
*
* p('Fred, Wilma, & Pebbles');
* // => '<p>Fred, Wilma, & Pebbles</p>'
*/
function wrap(value, wrapper) {
return createWrapper(wrapper, 16, [value]);
}
/*--------------------------------------------------------------------------*/
/**
* Creates a function that returns `value`.
*
* @static
* @memberOf _
* @category Utilities
* @param {*} value The value to return from the new function.
* @returns {Function} Returns the new function.
* @example
*
* var object = { 'name': 'fred' };
* var getter = _.constant(object);
* getter() === object;
* // => true
*/
function constant(value) {
return function() {
return value;
};
}
/**
* Produces a callback bound to an optional `thisArg`. If `func` is a property
* name the created callback will return the property value for a given element.
* If `func` is an object the created callback will return `true` for elements
* that contain the equivalent object properties, otherwise it will return `false`.
*
* @static
* @memberOf _
* @category Utilities
* @param {*} [func=identity] The value to convert to a callback.
* @param {*} [thisArg] The `this` binding of the created callback.
* @param {number} [argCount] The number of arguments the callback accepts.
* @returns {Function} Returns a callback function.
* @example
*
* var characters = [
* { 'name': 'barney', 'age': 36 },
* { 'name': 'fred', 'age': 40 }
* ];
*
* // wrap to create custom callback shorthands
* _.createCallback = _.wrap(_.createCallback, function(func, callback, thisArg) {
* var match = /^(.+?)__([gl]t)(.+)$/.exec(callback);
* return !match ? func(callback, thisArg) : function(object) {
* return match[2] == 'gt' ? object[match[1]] > match[3] : object[match[1]] < match[3];
* };
* });
*
* _.filter(characters, 'age__gt38');
* // => [{ 'name': 'fred', 'age': 40 }]
*/
function createCallback(func, thisArg, argCount) {
var type = typeof func;
if (func == null || type == 'function') {
return baseCreateCallback(func, thisArg, argCount);
}
// handle "_.pluck" style callback shorthands
if (type != 'object') {
return property(func);
}
var props = keys(func),
key = props[0],
a = func[key];
// handle "_.where" style callback shorthands
if (props.length == 1 && a === a && !isObject(a)) {
// fast path the common case of providing an object with a single
// property containing a primitive value
return function(object) {
var b = object[key];
return a === b && (a !== 0 || (1 / a == 1 / b));
};
}
return function(object) {
var length = props.length,
result = false;
while (length--) {
if (!(result = baseIsEqual(object[props[length]], func[props[length]], null, true))) {
break;
}
}
return result;
};
}
/**
* Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their
* corresponding HTML entities.
*
* @static
* @memberOf _
* @category Utilities
* @param {string} string The string to escape.
* @returns {string} Returns the escaped string.
* @example
*
* _.escape('Fred, Wilma, & Pebbles');
* // => 'Fred, Wilma, & Pebbles'
*/
function escape(string) {
return string == null ? '' : String(string).replace(reUnescapedHtml, escapeHtmlChar);
}
/**
* This method returns the first argument provided to it.
*
* @static
* @memberOf _
* @category Utilities
* @param {*} value Any value.
* @returns {*} Returns `value`.
* @example
*
* var object = { 'name': 'fred' };
* _.identity(object) === object;
* // => true
*/
function identity(value) {
return value;
}
/**
* Adds function properties of a source object to the destination object.
* If `object` is a function methods will be added to its prototype as well.
*
* @static
* @memberOf _
* @category Utilities
* @param {Function|Object} [object=lodash] object The destination object.
* @param {Object} source The object of functions to add.
* @param {Object} [options] The options object.
* @param {boolean} [options.chain=true] Specify whether the functions added are chainable.
* @example
*
* function capitalize(string) {
* return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
* }
*
* _.mixin({ 'capitalize': capitalize });
* _.capitalize('fred');
* // => 'Fred'
*
* _('fred').capitalize().value();
* // => 'Fred'
*
* _.mixin({ 'capitalize': capitalize }, { 'chain': false });
* _('fred').capitalize();
* // => 'Fred'
*/
function mixin(object, source, options) {
var chain = true,
methodNames = source && functions(source);
if (!source || (!options && !methodNames.length)) {
if (options == null) {
options = source;
}
ctor = lodashWrapper;
source = object;
object = lodash;
methodNames = functions(source);
}
if (options === false) {
chain = false;
} else if (isObject(options) && 'chain' in options) {
chain = options.chain;
}
var ctor = object,
isFunc = isFunction(ctor);
forEach(methodNames, function(methodName) {
var func = object[methodName] = source[methodName];
if (isFunc) {
ctor.prototype[methodName] = function() {
var chainAll = this.__chain__,
value = this.__wrapped__,
args = [value];
push.apply(args, arguments);
var result = func.apply(object, args);
if (chain || chainAll) {
if (value === result && isObject(result)) {
return this;
}
result = new ctor(result);
result.__chain__ = chainAll;
}
return result;
};
}
});
}
/**
* Reverts the '_' variable to its previous value and returns a reference to
* the `lodash` function.
*
* @static
* @memberOf _
* @category Utilities
* @returns {Function} Returns the `lodash` function.
* @example
*
* var lodash = _.noConflict();
*/
function noConflict() {
context._ = oldDash;
return this;
}
/**
* A no-operation function.
*
* @static
* @memberOf _
* @category Utilities
* @example
*
* var object = { 'name': 'fred' };
* _.noop(object) === undefined;
* // => true
*/
function noop() {
// no operation performed
}
/**
* Gets the number of milliseconds that have elapsed since the Unix epoch
* (1 January 1970 00:00:00 UTC).
*
* @static
* @memberOf _
* @category Utilities
* @example
*
* var stamp = _.now();
* _.defer(function() { console.log(_.now() - stamp); });
* // => logs the number of milliseconds it took for the deferred function to be called
*/
var now = isNative(now = Date.now) && now || function() {
return new Date().getTime();
};
/**
* Converts the given value into an integer of the specified radix.
* If `radix` is `undefined` or `0` a `radix` of `10` is used unless the
* `value` is a hexadecimal, in which case a `radix` of `16` is used.
*
* Note: This method avoids differences in native ES3 and ES5 `parseInt`
* implementations. See http://es5.github.io/#E.
*
* @static
* @memberOf _
* @category Utilities
* @param {string} value The value to parse.
* @param {number} [radix] The radix used to interpret the value to parse.
* @returns {number} Returns the new integer value.
* @example
*
* _.parseInt('08');
* // => 8
*/
var parseInt = nativeParseInt(whitespace + '08') == 8 ? nativeParseInt : function(value, radix) {
// Firefox < 21 and Opera < 15 follow the ES3 specified implementation of `parseInt`
return nativeParseInt(isString(value) ? value.replace(reLeadingSpacesAndZeros, '') : value, radix || 0);
};
/**
* Creates a "_.pluck" style function, which returns the `key` value of a
* given object.
*
* @static
* @memberOf _
* @category Utilities
* @param {string} key The name of the property to retrieve.
* @returns {Function} Returns the new function.
* @example
*
* var characters = [
* { 'name': 'fred', 'age': 40 },
* { 'name': 'barney', 'age': 36 }
* ];
*
* var getName = _.property('name');
*
* _.map(characters, getName);
* // => ['barney', 'fred']
*
* _.sortBy(characters, getName);
* // => [{ 'name': 'barney', 'age': 36 }, { 'name': 'fred', 'age': 40 }]
*/
function property(key) {
return function(object) {
return object[key];
};
}
/**
* Produces a random number between `min` and `max` (inclusive). If only one
* argument is provided a number between `0` and the given number will be
* returned. If `floating` is truey or either `min` or `max` are floats a
* floating-point number will be returned instead of an integer.
*
* @static
* @memberOf _
* @category Utilities
* @param {number} [min=0] The minimum possible value.
* @param {number} [max=1] The maximum possible value.
* @param {boolean} [floating=false] Specify returning a floating-point number.
* @returns {number} Returns a random number.
* @example
*
* _.random(0, 5);
* // => an integer between 0 and 5
*
* _.random(5);
* // => also an integer between 0 and 5
*
* _.random(5, true);
* // => a floating-point number between 0 and 5
*
* _.random(1.2, 5.2);
* // => a floating-point number between 1.2 and 5.2
*/
function random(min, max, floating) {
var noMin = min == null,
noMax = max == null;
if (floating == null) {
if (typeof min == 'boolean' && noMax) {
floating = min;
min = 1;
}
else if (!noMax && typeof max == 'boolean') {
floating = max;
noMax = true;
}
}
if (noMin && noMax) {
max = 1;
}
min = +min || 0;
if (noMax) {
max = min;
min = 0;
} else {
max = +max || 0;
}
if (floating || min % 1 || max % 1) {
var rand = nativeRandom();
return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand +'').length - 1)))), max);
}
return baseRandom(min, max);
}
/**
* Resolves the value of property `key` on `object`. If `key` is a function
* it will be invoked with the `this` binding of `object` and its result returned,
* else the property value is returned. If `object` is falsey then `undefined`
* is returned.
*
* @static
* @memberOf _
* @category Utilities
* @param {Object} object The object to inspect.
* @param {string} key The name of the property to resolve.
* @returns {*} Returns the resolved value.
* @example
*
* var object = {
* 'cheese': 'crumpets',
* 'stuff': function() {
* return 'nonsense';
* }
* };
*
* _.result(object, 'cheese');
* // => 'crumpets'
*
* _.result(object, 'stuff');
* // => 'nonsense'
*/
function result(object, key) {
if (object) {
var value = object[key];
return isFunction(value) ? object[key]() : value;
}
}
/**
* A micro-templating method that handles arbitrary delimiters, preserves
* whitespace, and correctly escapes quotes within interpolated code.
*
* Note: In the development build, `_.template` utilizes sourceURLs for easier
* debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl
*
* For more information on precompiling templates see:
* http://lodash.com/custom-builds
*
* For more information on Chrome extension sandboxes see:
* http://developer.chrome.com/stable/extensions/sandboxingEval.html
*
* @static
* @memberOf _
* @category Utilities
* @param {string} text The template text.
* @param {Object} data The data object used to populate the text.
* @param {Object} [options] The options object.
* @param {RegExp} [options.escape] The "escape" delimiter.
* @param {RegExp} [options.evaluate] The "evaluate" delimiter.
* @param {Object} [options.imports] An object to import into the template as local variables.
* @param {RegExp} [options.interpolate] The "interpolate" delimiter.
* @param {string} [sourceURL] The sourceURL of the template's compiled source.
* @param {string} [variable] The data object variable name.
* @returns {Function|string} Returns a compiled function when no `data` object
* is given, else it returns the interpolated text.
* @example
*
* // using the "interpolate" delimiter to create a compiled template
* var compiled = _.template('hello <%= name %>');
* compiled({ 'name': 'fred' });
* // => 'hello fred'
*
* // using the "escape" delimiter to escape HTML in data property values
* _.template('<b><%- value %></b>', { 'value': '<script>' });
* // => '<b><script></b>'
*
* // using the "evaluate" delimiter to generate HTML
* var list = '<% _.forEach(people, function(name) { %><li><%- name %></li><% }); %>';
* _.template(list, { 'people': ['fred', 'barney'] });
* // => '<li>fred</li><li>barney</li>'
*
* // using the ES6 delimiter as an alternative to the default "interpolate" delimiter
* _.template('hello ${ name }', { 'name': 'pebbles' });
* // => 'hello pebbles'
*
* // using the internal `print` function in "evaluate" delimiters
* _.template('<% print("hello " + name); %>!', { 'name': 'barney' });
* // => 'hello barney!'
*
* // using a custom template delimiters
* _.templateSettings = {
* 'interpolate': /{{([\s\S]+?)}}/g
* };
*
* _.template('hello {{ name }}!', { 'name': 'mustache' });
* // => 'hello mustache!'
*
* // using the `imports` option to import jQuery
* var list = '<% jq.each(people, function(name) { %><li><%- name %></li><% }); %>';
* _.template(list, { 'people': ['fred', 'barney'] }, { 'imports': { 'jq': jQuery } });
* // => '<li>fred</li><li>barney</li>'
*
* // using the `sourceURL` option to specify a custom sourceURL for the template
* var compiled = _.template('hello <%= name %>', null, { 'sourceURL': '/basic/greeting.jst' });
* compiled(data);
* // => find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector
*
* // using the `variable` option to ensure a with-statement isn't used in the compiled template
* var compiled = _.template('hi <%= data.name %>!', null, { 'variable': 'data' });
* compiled.source;
* // => function(data) {
* var __t, __p = '', __e = _.escape;
* __p += 'hi ' + ((__t = ( data.name )) == null ? '' : __t) + '!';
* return __p;
* }
*
* // using the `source` property to inline compiled templates for meaningful
* // line numbers in error messages and a stack trace
* fs.writeFileSync(path.join(cwd, 'jst.js'), '\
* var JST = {\
* "main": ' + _.template(mainText).source + '\
* };\
* ');
*/
function template(text, data, options) {
// based on John Resig's `tmpl` implementation
// http://ejohn.org/blog/javascript-micro-templating/
// and Laura Doktorova's doT.js
// https://github.com/olado/doT
var settings = lodash.templateSettings;
text = String(text || '');
// avoid missing dependencies when `iteratorTemplate` is not defined
options = defaults({}, options, settings);
var imports = defaults({}, options.imports, settings.imports),
importsKeys = keys(imports),
importsValues = values(imports);
var isEvaluating,
index = 0,
interpolate = options.interpolate || reNoMatch,
source = "__p += '";
// compile the regexp to match each delimiter
var reDelimiters = RegExp(
(options.escape || reNoMatch).source + '|' +
interpolate.source + '|' +
(interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
(options.evaluate || reNoMatch).source + '|$'
, 'g');
text.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
interpolateValue || (interpolateValue = esTemplateValue);
// escape characters that cannot be included in string literals
source += text.slice(index, offset).replace(reUnescapedString, escapeStringChar);
// replace delimiters with snippets
if (escapeValue) {
source += "' +\n__e(" + escapeValue + ") +\n'";
}
if (evaluateValue) {
isEvaluating = true;
source += "';\n" + evaluateValue + ";\n__p += '";
}
if (interpolateValue) {
source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
}
index = offset + match.length;
// the JS engine embedded in Adobe products requires returning the `match`
// string in order to produce the correct `offset` value
return match;
});
source += "';\n";
// if `variable` is not specified, wrap a with-statement around the generated
// code to add the data object to the top of the scope chain
var variable = options.variable,
hasVariable = variable;
if (!hasVariable) {
variable = 'obj';
source = 'with (' + variable + ') {\n' + source + '\n}\n';
}
// cleanup code by stripping empty strings
source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
.replace(reEmptyStringMiddle, '$1')
.replace(reEmptyStringTrailing, '$1;');
// frame code as the function body
source = 'function(' + variable + ') {\n' +
(hasVariable ? '' : variable + ' || (' + variable + ' = {});\n') +
"var __t, __p = '', __e = _.escape" +
(isEvaluating
? ', __j = Array.prototype.join;\n' +
"function print() { __p += __j.call(arguments, '') }\n"
: ';\n'
) +
source +
'return __p\n}';
// Use a sourceURL for easier debugging.
// http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl
var sourceURL = '\n/*\n//# sourceURL=' + (options.sourceURL || '/lodash/template/source[' + (templateCounter++) + ']') + '\n*/';
try {
var result = Function(importsKeys, 'return ' + source + sourceURL).apply(undefined, importsValues);
} catch(e) {
e.source = source;
throw e;
}
if (data) {
return result(data);
}
// provide the compiled function's source by its `toString` method, in
// supported environments, or the `source` property as a convenience for
// inlining compiled templates during the build process
result.source = source;
return result;
}
/**
* Executes the callback `n` times, returning an array of the results
* of each callback execution. The callback is bound to `thisArg` and invoked
* with one argument; (index).
*
* @static
* @memberOf _
* @category Utilities
* @param {number} n The number of times to execute the callback.
* @param {Function} callback The function called per iteration.
* @param {*} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns an array of the results of each `callback` execution.
* @example
*
* var diceRolls = _.times(3, _.partial(_.random, 1, 6));
* // => [3, 6, 4]
*
* _.times(3, function(n) { mage.castSpell(n); });
* // => calls `mage.castSpell(n)` three times, passing `n` of `0`, `1`, and `2` respectively
*
* _.times(3, function(n) { this.cast(n); }, mage);
* // => also calls `mage.castSpell(n)` three times
*/
function times(n, callback, thisArg) {
n = (n = +n) > -1 ? n : 0;
var index = -1,
result = Array(n);
callback = baseCreateCallback(callback, thisArg, 1);
while (++index < n) {
result[index] = callback(index);
}
return result;
}
/**
* The inverse of `_.escape` this method converts the HTML entities
* `&`, `<`, `>`, `"`, and `'` in `string` to their
* corresponding characters.
*
* @static
* @memberOf _
* @category Utilities
* @param {string} string The string to unescape.
* @returns {string} Returns the unescaped string.
* @example
*
* _.unescape('Fred, Barney & Pebbles');
* // => 'Fred, Barney & Pebbles'
*/
function unescape(string) {
return string == null ? '' : String(string).replace(reEscapedHtml, unescapeHtmlChar);
}
/**
* Generates a unique ID. If `prefix` is provided the ID will be appended to it.
*
* @static
* @memberOf _
* @category Utilities
* @param {string} [prefix] The value to prefix the ID with.
* @returns {string} Returns the unique ID.
* @example
*
* _.uniqueId('contact_');
* // => 'contact_104'
*
* _.uniqueId();
* // => '105'
*/
function uniqueId(prefix) {
var id = ++idCounter;
return String(prefix == null ? '' : prefix) + id;
}
/*--------------------------------------------------------------------------*/
/**
* Creates a `lodash` object that wraps the given value with explicit
* method chaining enabled.
*
* @static
* @memberOf _
* @category Chaining
* @param {*} value The value to wrap.
* @returns {Object} Returns the wrapper object.
* @example
*
* var characters = [
* { 'name': 'barney', 'age': 36 },
* { 'name': 'fred', 'age': 40 },
* { 'name': 'pebbles', 'age': 1 }
* ];
*
* var youngest = _.chain(characters)
* .sortBy('age')
* .map(function(chr) { return chr.name + ' is ' + chr.age; })
* .first()
* .value();
* // => 'pebbles is 1'
*/
function chain(value) {
value = new lodashWrapper(value);
value.__chain__ = true;
return value;
}
/**
* Invokes `interceptor` with the `value` as the first argument and then
* returns `value`. The purpose of this method is to "tap into" a method
* chain in order to perform operations on intermediate results within
* the chain.
*
* @static
* @memberOf _
* @category Chaining
* @param {*} value The value to provide to `interceptor`.
* @param {Function} interceptor The function to invoke.
* @returns {*} Returns `value`.
* @example
*
* _([1, 2, 3, 4])
* .tap(function(array) { array.pop(); })
* .reverse()
* .value();
* // => [3, 2, 1]
*/
function tap(value, interceptor) {
interceptor(value);
return value;
}
/**
* Enables explicit method chaining on the wrapper object.
*
* @name chain
* @memberOf _
* @category Chaining
* @returns {*} Returns the wrapper object.
* @example
*
* var characters = [
* { 'name': 'barney', 'age': 36 },
* { 'name': 'fred', 'age': 40 }
* ];
*
* // without explicit chaining
* _(characters).first();
* // => { 'name': 'barney', 'age': 36 }
*
* // with explicit chaining
* _(characters).chain()
* .first()
* .pick('age')
* .value();
* // => { 'age': 36 }
*/
function wrapperChain() {
this.__chain__ = true;
return this;
}
/**
* Produces the `toString` result of the wrapped value.
*
* @name toString
* @memberOf _
* @category Chaining
* @returns {string} Returns the string result.
* @example
*
* _([1, 2, 3]).toString();
* // => '1,2,3'
*/
function wrapperToString() {
return String(this.__wrapped__);
}
/**
* Extracts the wrapped value.
*
* @name valueOf
* @memberOf _
* @alias value
* @category Chaining
* @returns {*} Returns the wrapped value.
* @example
*
* _([1, 2, 3]).valueOf();
* // => [1, 2, 3]
*/
function wrapperValueOf() {
return this.__wrapped__;
}
/*--------------------------------------------------------------------------*/
// add functions that return wrapped values when chaining
lodash.after = after;
lodash.assign = assign;
lodash.at = at;
lodash.bind = bind;
lodash.bindAll = bindAll;
lodash.bindKey = bindKey;
lodash.chain = chain;
lodash.compact = compact;
lodash.compose = compose;
lodash.constant = constant;
lodash.countBy = countBy;
lodash.create = create;
lodash.createCallback = createCallback;
lodash.curry = curry;
lodash.debounce = debounce;
lodash.defaults = defaults;
lodash.defer = defer;
lodash.delay = delay;
lodash.difference = difference;
lodash.filter = filter;
lodash.flatten = flatten;
lodash.forEach = forEach;
lodash.forEachRight = forEachRight;
lodash.forIn = forIn;
lodash.forInRight = forInRight;
lodash.forOwn = forOwn;
lodash.forOwnRight = forOwnRight;
lodash.functions = functions;
lodash.groupBy = groupBy;
lodash.indexBy = indexBy;
lodash.initial = initial;
lodash.intersection = intersection;
lodash.invert = invert;
lodash.invoke = invoke;
lodash.keys = keys;
lodash.map = map;
lodash.mapValues = mapValues;
lodash.max = max;
lodash.memoize = memoize;
lodash.merge = merge;
lodash.min = min;
lodash.omit = omit;
lodash.once = once;
lodash.pairs = pairs;
lodash.partial = partial;
lodash.partialRight = partialRight;
lodash.pick = pick;
lodash.pluck = pluck;
lodash.property = property;
lodash.pull = pull;
lodash.range = range;
lodash.reject = reject;
lodash.remove = remove;
lodash.rest = rest;
lodash.shuffle = shuffle;
lodash.sortBy = sortBy;
lodash.tap = tap;
lodash.throttle = throttle;
lodash.times = times;
lodash.toArray = toArray;
lodash.transform = transform;
lodash.union = union;
lodash.uniq = uniq;
lodash.values = values;
lodash.where = where;
lodash.without = without;
lodash.wrap = wrap;
lodash.xor = xor;
lodash.zip = zip;
lodash.zipObject = zipObject;
// add aliases
lodash.collect = map;
lodash.drop = rest;
lodash.each = forEach;
lodash.eachRight = forEachRight;
lodash.extend = assign;
lodash.methods = functions;
lodash.object = zipObject;
lodash.select = filter;
lodash.tail = rest;
lodash.unique = uniq;
lodash.unzip = zip;
// add functions to `lodash.prototype`
mixin(lodash);
/*--------------------------------------------------------------------------*/
// add functions that return unwrapped values when chaining
lodash.clone = clone;
lodash.cloneDeep = cloneDeep;
lodash.contains = contains;
lodash.escape = escape;
lodash.every = every;
lodash.find = find;
lodash.findIndex = findIndex;
lodash.findKey = findKey;
lodash.findLast = findLast;
lodash.findLastIndex = findLastIndex;
lodash.findLastKey = findLastKey;
lodash.has = has;
lodash.identity = identity;
lodash.indexOf = indexOf;
lodash.isArguments = isArguments;
lodash.isArray = isArray;
lodash.isBoolean = isBoolean;
lodash.isDate = isDate;
lodash.isElement = isElement;
lodash.isEmpty = isEmpty;
lodash.isEqual = isEqual;
lodash.isFinite = isFinite;
lodash.isFunction = isFunction;
lodash.isNaN = isNaN;
lodash.isNull = isNull;
lodash.isNumber = isNumber;
lodash.isObject = isObject;
lodash.isPlainObject = isPlainObject;
lodash.isRegExp = isRegExp;
lodash.isString = isString;
lodash.isUndefined = isUndefined;
lodash.lastIndexOf = lastIndexOf;
lodash.mixin = mixin;
lodash.noConflict = noConflict;
lodash.noop = noop;
lodash.now = now;
lodash.parseInt = parseInt;
lodash.random = random;
lodash.reduce = reduce;
lodash.reduceRight = reduceRight;
lodash.result = result;
lodash.runInContext = runInContext;
lodash.size = size;
lodash.some = some;
lodash.sortedIndex = sortedIndex;
lodash.template = template;
lodash.unescape = unescape;
lodash.uniqueId = uniqueId;
// add aliases
lodash.all = every;
lodash.any = some;
lodash.detect = find;
lodash.findWhere = find;
lodash.foldl = reduce;
lodash.foldr = reduceRight;
lodash.include = contains;
lodash.inject = reduce;
mixin(function() {
var source = {}
forOwn(lodash, function(func, methodName) {
if (!lodash.prototype[methodName]) {
source[methodName] = func;
}
});
return source;
}(), false);
/*--------------------------------------------------------------------------*/
// add functions capable of returning wrapped and unwrapped values when chaining
lodash.first = first;
lodash.last = last;
lodash.sample = sample;
// add aliases
lodash.take = first;
lodash.head = first;
forOwn(lodash, function(func, methodName) {
var callbackable = methodName !== 'sample';
if (!lodash.prototype[methodName]) {
lodash.prototype[methodName]= function(n, guard) {
var chainAll = this.__chain__,
result = func(this.__wrapped__, n, guard);
return !chainAll && (n == null || (guard && !(callbackable && typeof n == 'function')))
? result
: new lodashWrapper(result, chainAll);
};
}
});
/*--------------------------------------------------------------------------*/
/**
* The semantic version number.
*
* @static
* @memberOf _
* @type string
*/
lodash.VERSION = '2.4.1';
// add "Chaining" functions to the wrapper
lodash.prototype.chain = wrapperChain;
lodash.prototype.toString = wrapperToString;
lodash.prototype.value = wrapperValueOf;
lodash.prototype.valueOf = wrapperValueOf;
// add `Array` functions that return unwrapped values
baseEach(['join', 'pop', 'shift'], function(methodName) {
var func = arrayRef[methodName];
lodash.prototype[methodName] = function() {
var chainAll = this.__chain__,
result = func.apply(this.__wrapped__, arguments);
return chainAll
? new lodashWrapper(result, chainAll)
: result;
};
});
// add `Array` functions that return the existing wrapped value
baseEach(['push', 'reverse', 'sort', 'unshift'], function(methodName) {
var func = arrayRef[methodName];
lodash.prototype[methodName] = function() {
func.apply(this.__wrapped__, arguments);
return this;
};
});
// add `Array` functions that return new wrapped values
baseEach(['concat', 'slice', 'splice'], function(methodName) {
var func = arrayRef[methodName];
lodash.prototype[methodName] = function() {
return new lodashWrapper(func.apply(this.__wrapped__, arguments), this.__chain__);
};
});
// avoid array-like object bugs with `Array#shift` and `Array#splice`
// in IE < 9, Firefox < 10, Narwhal, and RingoJS
if (!support.spliceObjects) {
baseEach(['pop', 'shift', 'splice'], function(methodName) {
var func = arrayRef[methodName],
isSplice = methodName == 'splice';
lodash.prototype[methodName] = function() {
var chainAll = this.__chain__,
value = this.__wrapped__,
result = func.apply(value, arguments);
if (value.length === 0) {
delete value[0];
}
return (chainAll || isSplice)
? new lodashWrapper(result, chainAll)
: result;
};
});
}
return lodash;
}
/*--------------------------------------------------------------------------*/
// expose Lo-Dash
var _ = runInContext();
// some AMD build optimizers like r.js check for condition patterns like the following:
if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
// Expose Lo-Dash to the global object even when an AMD loader is present in
// case Lo-Dash is loaded with a RequireJS shim config.
// See http://requirejs.org/docs/api.html#config-shim
root._ = _;
// define as an anonymous module so, through path mapping, it can be
// referenced as the "underscore" module
define(function() {
return _;
});
}
// check for `exports` after `define` in case a build optimizer adds an `exports` object
else if (freeExports && freeModule) {
// in Node.js or RingoJS
if (moduleExports) {
(freeModule.exports = _)._ = _;
}
// in Narwhal or Rhino -require
else {
freeExports._ = _;
}
}
else {
// in a browser or Rhino
root._ = _;
}
}.call(this));
| jeroen-corteville/izegem | node_modules/karma/node_modules/lodash/dist/lodash.compat.js | JavaScript | mit | 244,097 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Swiper demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<!-- Link Swiper's CSS -->
<link rel="stylesheet" href="../dist/css/swiper.min.css">
<!-- Demo styles -->
<style>
html, body {
position: relative;
height: 100%;
}
body {
background: #fff;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
font-size: 14px;
color:#000;
margin: 0;
padding: 0;
}
.swiper-container {
width: 100%;
height: 100%;
}
.swiper-slide {
font-size: 18px;
height: auto;
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding: 30px;
}
</style>
</head>
<body>
<!-- Swiper -->
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide">
<h4>Scroll Container</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In luctus, ex eu sagittis faucibus, ligula ipsum sagittis magna, et imperdiet dolor lectus eu libero. Vestibulum venenatis eget turpis sed faucibus. Maecenas in ullamcorper orci, eu ullamcorper sem. Etiam elit ante, luctus non ante sit amet, sodales vulputate odio. Aenean tristique nisl tellus, sit amet fringilla nisl volutpat cursus. Quisque dignissim lectus ac nunc consectetur mattis. Proin vel hendrerit ipsum, et lobortis dolor. Vestibulum convallis, nibh et tincidunt tristique, nisl risus facilisis lectus, ut interdum orci nisl ac nunc. Cras et aliquam felis. Quisque vel ipsum at elit sodales posuere eget non est. Fusce convallis vestibulum dolor non volutpat. Vivamus vestibulum quam ut ultricies pretium.</p>
<p>Suspendisse rhoncus fringilla nisl. Mauris eget lorem ac urna consectetur convallis non vel mi. Donec libero dolor, volutpat ut urna sit amet, aliquet molestie purus. Phasellus faucibus, leo vel scelerisque lobortis, ipsum leo sollicitudin metus, eget sagittis ante orci eu ipsum. Nulla ac mauris eu risus sagittis scelerisque iaculis bibendum mauris. Cras ut egestas orci. Cras odio risus, sagittis ut nunc vitae, aliquam consectetur purus. Vivamus ornare nunc vel tellus facilisis, quis dictum elit tincidunt. Donec accumsan nisi at laoreet sodales. Cras at ullamcorper massa. Maecenas at facilisis ex. Nam mollis dignissim purus id efficitur.</p>
<p>Curabitur eget aliquam erat. Curabitur a neque vitae purus volutpat elementum. Vivamus quis vestibulum leo, efficitur ullamcorper velit. Integer tincidunt finibus metus vel porta. Mauris sed mauris congue, pretium est nec, malesuada purus. Nulla hendrerit consectetur arcu et lacinia. Suspendisse augue justo, convallis eget arcu in, pretium tempor ligula. Nullam vulputate tincidunt est ut ullamcorper.</p>
<p>Curabitur sed sodales leo. Nulla facilisi. Etiam condimentum, nisi id tempor vulputate, nisi justo cursus justo, pellentesque condimentum diam arcu sit amet leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In placerat tellus a posuere vehicula. Donec diam massa, efficitur vitae mattis et, pretium in augue. Fusce iaculis mi quis ante venenatis, sit amet pellentesque orci aliquam. Vestibulum elementum posuere vehicula.</p>
<p>Sed tincidunt diam a massa pharetra faucibus. Praesent condimentum id arcu nec fringilla. Maecenas faucibus, ante et venenatis interdum, erat mi eleifend dui, at convallis nisl est nec arcu. Duis vitae arcu rhoncus, faucibus magna ut, tempus metus. Cras in nibh sed ipsum consequat rhoncus. Proin fringilla nulla ut augue tempor fermentum. Nunc hendrerit non nisi vitae finibus. Donec eget ornare libero. Aliquam auctor erat enim, a semper risus semper at. In ut dui in metus tincidunt euismod eget et lacus. Aenean et dictum urna, sed rhoncus lorem. Duis pharetra sagittis odio. Etiam a libero ut nisi feugiat tincidunt vel vitae turpis. Maecenas vel orci sit amet lorem hendrerit venenatis sollicitudin ut dui. Quisque rhoncus nibh in massa pretium scelerisque.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In luctus, ex eu sagittis faucibus, ligula ipsum sagittis magna, et imperdiet dolor lectus eu libero. Vestibulum venenatis eget turpis sed faucibus. Maecenas in ullamcorper orci, eu ullamcorper sem. Etiam elit ante, luctus non ante sit amet, sodales vulputate odio. Aenean tristique nisl tellus, sit amet fringilla nisl volutpat cursus. Quisque dignissim lectus ac nunc consectetur mattis. Proin vel hendrerit ipsum, et lobortis dolor. Vestibulum convallis, nibh et tincidunt tristique, nisl risus facilisis lectus, ut interdum orci nisl ac nunc. Cras et aliquam felis. Quisque vel ipsum at elit sodales posuere eget non est. Fusce convallis vestibulum dolor non volutpat. Vivamus vestibulum quam ut ultricies pretium.</p>
<p>Suspendisse rhoncus fringilla nisl. Mauris eget lorem ac urna consectetur convallis non vel mi. Donec libero dolor, volutpat ut urna sit amet, aliquet molestie purus. Phasellus faucibus, leo vel scelerisque lobortis, ipsum leo sollicitudin metus, eget sagittis ante orci eu ipsum. Nulla ac mauris eu risus sagittis scelerisque iaculis bibendum mauris. Cras ut egestas orci. Cras odio risus, sagittis ut nunc vitae, aliquam consectetur purus. Vivamus ornare nunc vel tellus facilisis, quis dictum elit tincidunt. Donec accumsan nisi at laoreet sodales. Cras at ullamcorper massa. Maecenas at facilisis ex. Nam mollis dignissim purus id efficitur.</p>
<p>Curabitur eget aliquam erat. Curabitur a neque vitae purus volutpat elementum. Vivamus quis vestibulum leo, efficitur ullamcorper velit. Integer tincidunt finibus metus vel porta. Mauris sed mauris congue, pretium est nec, malesuada purus. Nulla hendrerit consectetur arcu et lacinia. Suspendisse augue justo, convallis eget arcu in, pretium tempor ligula. Nullam vulputate tincidunt est ut ullamcorper.</p>
<p>Curabitur sed sodales leo. Nulla facilisi. Etiam condimentum, nisi id tempor vulputate, nisi justo cursus justo, pellentesque condimentum diam arcu sit amet leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In placerat tellus a posuere vehicula. Donec diam massa, efficitur vitae mattis et, pretium in augue. Fusce iaculis mi quis ante venenatis, sit amet pellentesque orci aliquam. Vestibulum elementum posuere vehicula.</p>
<p>Sed tincidunt diam a massa pharetra faucibus. Praesent condimentum id arcu nec fringilla. Maecenas faucibus, ante et venenatis interdum, erat mi eleifend dui, at convallis nisl est nec arcu. Duis vitae arcu rhoncus, faucibus magna ut, tempus metus. Cras in nibh sed ipsum consequat rhoncus. Proin fringilla nulla ut augue tempor fermentum. Nunc hendrerit non nisi vitae finibus. Donec eget ornare libero. Aliquam auctor erat enim, a semper risus semper at. In ut dui in metus tincidunt euismod eget et lacus. Aenean et dictum urna, sed rhoncus lorem. Duis pharetra sagittis odio. Etiam a libero ut nisi feugiat tincidunt vel vitae turpis. Maecenas vel orci sit amet lorem hendrerit venenatis sollicitudin ut dui. Quisque rhoncus nibh in massa pretium scelerisque.</p>
</div>
</div>
<!-- Add Scroll Bar -->
<div class="swiper-scrollbar"></div>
</div>
<!-- Swiper JS -->
<script src="../dist/js/swiper.min.js"></script>
<!-- Initialize Swiper -->
<script>
var swiper = new Swiper('.swiper-container', {
scrollbar: '.swiper-scrollbar',
direction: 'vertical',
slidesPerView: 'auto',
mousewheelControl: true,
freeMode: true
});
</script>
</body>
</html> | MeteorPackaging/Swiper | demos/32-scroll-container.html | HTML | mit | 7,872 |
.flatpickr-input {
cursor: pointer;
z-index: 1;
}
.flatpickr-mobileInput {
opacity: 0;
visibility: hidden;
position: absolute;
width: 0;
height: 0;
box-sizing: border-box;
padding: 0;
}
.flatpickr-calendar {
background: transparent;
overflow: hidden;
max-height: 0;
opacity: 0;
visibility: hidden;
text-align: center;
padding: 0;
animation: none;
direction: rtl;
border: 0;
font-size: 14px;
line-height: 24px;
border-radius: 5px;
position: absolute;
width: 293.75px;
box-sizing: border-box;
transition: top cubic-bezier(0, 1, 0.5, 1) 100ms;
box-shadow: 0 3px 13px rgba(0,0,0,0.08);
z-index: 999;
}
.flatpickr-calendar.open,
.flatpickr-calendar.inline {
opacity: 1;
visibility: visible;
overflow: visible;
max-height: 640px;
}
.flatpickr-calendar.open {
display: inline-block;
z-index: 99999;
animation: flatpickrFadeInDown 300ms cubic-bezier(0, 1, 0.5, 1);
}
.flatpickr-calendar.inline {
display: block;
position: relative;
}
.flatpickr-calendar.static {
position: relative;
top: 2px;
}
.flatpickr-calendar.static.open {
display: block;
}
.flatpickr-calendar.hasWeeks {
width: auto;
}
.flatpickr-calendar.dateIsPicked.hasTime .flatpickr-time {
height: 40px;
}
.flatpickr-calendar.noCalendar.hasTime .flatpickr-time {
height: auto;
}
.flatpickr-calendar:before,
.flatpickr-calendar:after {
position: absolute;
display: block;
pointer-events: none;
border: solid transparent;
content: '';
height: 0;
width: 0;
right: 22px;
}
.flatpickr-calendar.rightMost:before,
.flatpickr-calendar.rightMost:after {
right: auto;
left: 22px;
}
.flatpickr-calendar:before {
border-width: 5px;
margin: 0 -5px;
}
.flatpickr-calendar:after {
border-width: 4px;
margin: 0 -4px;
}
.flatpickr-calendar.arrowTop:before,
.flatpickr-calendar.arrowTop:after {
bottom: 100%;
}
.flatpickr-calendar.arrowTop:before {
border-bottom-color: rgba(255,138,101,0.2);
}
.flatpickr-calendar.arrowTop:after {
border-bottom-color: #ff8a65;
}
.flatpickr-calendar.arrowBottom:before,
.flatpickr-calendar.arrowBottom:after {
top: 100%;
}
.flatpickr-calendar.arrowBottom:before {
border-top-color: rgba(255,138,101,0.2);
}
.flatpickr-calendar.arrowBottom:after {
border-top-color: #ff8a65;
}
.flatpickr-month {
border-radius: 5px 5px 0 0;
background: #ff8a65;
color: #fff;
fill: #fff;
height: 28px;
line-height: 24px;
text-align: center;
position: relative;
user-select: none;
z-index: 2;
}
.flatpickr-prev-month,
.flatpickr-next-month {
text-decoration: none;
cursor: pointer;
position: absolute;
top: 10px;
height: 16px;
line-height: 16px;
}
.flatpickr-prev-month i,
.flatpickr-next-month i {
position: relative;
}
.flatpickr-prev-month.flatpickr-prev-month,
.flatpickr-next-month.flatpickr-prev-month {
/*
/*rtl:begin:ignore*/
/*
*/
right: calc(3.57% - 1.5px);
/*
/*rtl:end:ignore*/
/*
*/
}
/*
/*rtl:begin:ignore*/
/*
/*rtl:end:ignore*/
.flatpickr-prev-month.flatpickr-next-month,
.flatpickr-next-month.flatpickr-next-month {
/*
/*rtl:begin:ignore*/
/*
*/
left: calc(3.57% - 1.5px);
/*
/*rtl:end:ignore*/
/*
*/
}
/*
/*rtl:begin:ignore*/
/*
/*rtl:end:ignore*/
.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
color: #bbb;
}
.flatpickr-prev-month:hover svg,
.flatpickr-next-month:hover svg {
fill: #f64747;
}
.flatpickr-prev-month svg,
.flatpickr-next-month svg {
width: 14px;
}
.flatpickr-prev-month svg path,
.flatpickr-next-month svg path {
transition: fill 0.1s;
fill: inherit;
}
.numInputWrapper {
position: relative;
height: auto;
}
.numInputWrapper input,
.numInputWrapper span {
display: inline-block;
}
.numInputWrapper input {
width: 100%;
}
.numInputWrapper span {
position: absolute;
left: 0;
width: 14px;
padding: 0 2px 0 4px;
height: 50%;
line-height: 50%;
opacity: 0;
z-index: 9;
cursor: pointer;
border: 1px solid rgba(72,72,72,0.05);
box-sizing: border-box;
}
.numInputWrapper span:hover {
background: rgba(0,0,0,0.1);
}
.numInputWrapper span:active {
background: rgba(0,0,0,0.2);
}
.numInputWrapper span:after {
display: block;
content: "";
position: absolute;
top: 33%;
}
.numInputWrapper span.arrowUp {
top: 0;
border-bottom: 0;
}
.numInputWrapper span.arrowUp:after {
border-right: 4px solid transparent;
border-left: 4px solid transparent;
border-bottom: 4px solid rgba(72,72,72,0.6);
}
.numInputWrapper span.arrowDown {
top: 50%;
}
.numInputWrapper span.arrowDown:after {
border-right: 4px solid transparent;
border-left: 4px solid transparent;
border-top: 4px solid rgba(72,72,72,0.6);
}
.numInputWrapper span svg {
width: inherit;
height: auto;
}
.numInputWrapper span svg path {
fill: rgba(255,255,255,0.5);
}
.numInputWrapper:hover {
background: rgba(0,0,0,0.05);
}
.numInputWrapper:hover span {
opacity: 1;
}
.flatpickr-current-month {
font-size: 135%;
line-height: inherit;
font-weight: 300;
color: inherit;
position: absolute;
width: 75%;
right: 12.5%;
top: 5px;
display: inline-block;
text-align: center;
}
.flatpickr-current-month span.cur-month {
font-family: inherit;
font-weight: 700;
color: inherit;
display: inline-block;
padding-right: 7px;
}
.flatpickr-current-month .numInputWrapper {
width: 6ch;
width: 7ch\0;
display: inline-block;
}
.flatpickr-current-month .numInputWrapper span.arrowUp:after {
border-bottom-color: #fff;
}
.flatpickr-current-month .numInputWrapper span.arrowDown:after {
border-top-color: #fff;
}
.flatpickr-current-month input.cur-year {
background: transparent;
box-sizing: border-box;
color: inherit;
cursor: default;
padding: 0 0.5ch 0 0;
margin: 0;
display: inline;
font-size: inherit;
font-family: inherit;
font-weight: 300;
line-height: inherit;
height: initial;
border: 0;
border-radius: 0;
vertical-align: initial;
}
.flatpickr-current-month input.cur-year:focus {
outline: 0;
}
.flatpickr-current-month input.cur-year[disabled],
.flatpickr-current-month input.cur-year[disabled]:hover {
font-size: 100%;
color: rgba(255,255,255,0.5);
background: transparent;
pointer-events: none;
}
.flatpickr-weekdays {
background: #ff8a65;
text-align: center;
overflow: hidden;
}
.flatpickr-days {
padding: 0 2.375px;
outline: 0;
text-align: right;
width: 293.75px;
box-sizing: border-box;
display: inline-block;
display: flex;
flex-wrap: wrap;
border-left: 1px solid rgba(255,138,101,0.2);
border-right: 1px solid rgba(255,138,101,0.2);
}
.flatpickr-day {
background: none;
border: 1px solid transparent;
border-radius: 150px;
box-sizing: border-box;
color: #484848;
cursor: pointer;
font-weight: 400;
width: 14.2857143%;
flex-basis: 14.2857143%;
max-width: 38px;
height: 38px;
line-height: 38px;
margin: 0px 1.5px;
display: inline-block;
display: inline-block\9;
position: relative;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
text-align: center;
}
.flatpickr-day.inRange,
.flatpickr-day.prevMonthDay.inRange,
.flatpickr-day.nextMonthDay.inRange,
.flatpickr-day.today.inRange,
.flatpickr-day.prevMonthDay.today.inRange,
.flatpickr-day.nextMonthDay.today.inRange,
.flatpickr-day:hover,
.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover,
.flatpickr-day:focus,
.flatpickr-day.prevMonthDay:focus,
.flatpickr-day.nextMonthDay:focus {
cursor: pointer;
outline: 0;
background: #e2e2e2;
border-color: #e2e2e2;
}
.flatpickr-day.today {
border-color: #bbb;
}
.flatpickr-day.today:hover,
.flatpickr-day.today:focus {
border-color: #bbb;
background: #bbb;
color: #fff;
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:focus,
.flatpickr-day.startRange:focus,
.flatpickr-day.endRange:focus,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover,
.flatpickr-day.selected.prevMonthDay,
.flatpickr-day.startRange.prevMonthDay,
.flatpickr-day.endRange.prevMonthDay,
.flatpickr-day.selected.nextMonthDay,
.flatpickr-day.startRange.nextMonthDay,
.flatpickr-day.endRange.nextMonthDay {
background: #ff8a65;
color: #fff;
border-color: #ff8a65;
}
.flatpickr-day.selected.startRange,
.flatpickr-day.startRange.startRange,
.flatpickr-day.endRange.startRange {
border-radius: 0 50px 50px 0;
}
.flatpickr-day.selected.endRange,
.flatpickr-day.startRange.endRange,
.flatpickr-day.endRange.endRange {
border-radius: 50px 0 0 50px;
}
.flatpickr-day.inRange {
border-radius: 0;
box-shadow: 3.75px 0 0 #e2e2e2, -3.75px 0 0 #e2e2e2;
}
.flatpickr-day.disabled,
.flatpickr-day.disabled:hover {
pointer-events: none;
}
.flatpickr-day.disabled,
.flatpickr-day.disabled:hover,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay,
.flatpickr-day.notAllowed,
.flatpickr-day.notAllowed.prevMonthDay,
.flatpickr-day.notAllowed.nextMonthDay {
color: rgba(72,72,72,0.3);
background: transparent;
border-color: transparent;
cursor: default;
}
span.flatpickr-weekday {
cursor: default;
font-size: 90%;
color: rgba(0,0,0,0.54);
height: 27.166666666666668px;
line-height: 24px;
margin: 0;
background: #ff8a65;
text-align: center;
display: block;
float: right;
width: 14.28%;
font-weight: bold;
margin: 0;
padding-top: 3.166666666666667px;
}
.rangeMode .flatpickr-day {
margin-top: 1px;
}
.flatpickr-weekwrapper {
display: inline-block;
float: right;
z-index: 2;
}
.flatpickr-weekwrapper .flatpickr-weeks {
padding: 0 12px;
border-right: 1px solid rgba(255,138,101,0.2);
box-shadow: -1px 0 0 rgba(255,138,101,0.2);
}
.flatpickr-weekwrapper .flatpickr-weekday {
float: none;
width: 100%;
}
.flatpickr-weekwrapper span.flatpickr-day {
display: block;
width: 100%;
max-width: none;
margin: 0;
border: 0;
}
.flatpickr-innerContainer {
display: block;
display: flex;
box-sizing: border-box;
overflow: hidden;
background: #fff;
}
.flatpickr-rContainer {
display: inline-block;
padding: 0;
box-sizing: border-box;
z-index: 2;
}
.flatpickr-time {
text-align: center;
outline: 0;
display: block;
height: 0;
line-height: 40px;
max-height: 40px;
box-sizing: border-box;
overflow: hidden;
transition: height 0.33s cubic-bezier(0, 1, 0.5, 1);
display: flex;
background: #fff;
border-radius: 0 0 5px 5px;
border: 1px solid rgba(255,138,101,0.2);
}
.flatpickr-time:after {
content: "";
display: table;
clear: both;
}
.flatpickr-time .numInputWrapper {
flex: 1;
width: 40%;
height: 40px;
float: right;
z-index: 3;
}
.flatpickr-time .numInputWrapper span.arrowUp:after {
border-bottom-color: #484848;
}
.flatpickr-time .numInputWrapper span.arrowDown:after {
border-top-color: #484848;
}
.flatpickr-time.hasSeconds .numInputWrapper {
width: 26%;
}
.flatpickr-time.time24hr .numInputWrapper {
width: 49%;
}
.flatpickr-time input {
background: transparent;
box-shadow: none;
border: 0;
border-radius: 0;
text-align: center;
margin: 0;
padding: 0;
height: inherit;
line-height: inherit;
cursor: pointer;
color: #484848;
font-size: 14px;
position: relative;
box-sizing: border-box;
}
.flatpickr-time input.flatpickr-hour {
font-weight: bold;
}
.flatpickr-time input.flatpickr-minute,
.flatpickr-time input.flatpickr-second {
font-weight: 400;
}
.flatpickr-time input:focus {
outline: 0;
border: 0;
}
.flatpickr-time .flatpickr-time-separator,
.flatpickr-time .flatpickr-am-pm {
height: inherit;
display: inline-block;
float: right;
line-height: inherit;
color: #484848;
font-weight: bold;
width: 2%;
z-index: 3;
user-select: none;
}
.flatpickr-time .flatpickr-am-pm {
outline: 0;
width: 18%;
cursor: pointer;
text-align: center;
font-weight: 400;
}
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time .flatpickr-am-pm:focus {
background: #ececec;
}
.hasWeeks .flatpickr-days,
.hasTime .flatpickr-days {
border-bottom: 0;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.hasWeeks .flatpickr-days {
border-right: 0;
}
@media all and (-ms-high-contrast: none) {
.flatpickr-month {
padding: 0;
}
.flatpickr-month svg {
top: 0 !important;
}
}
@-moz-keyframes flatpickrFadeInDown {
from {
opacity: 0;
transform: translate3d(0, -20px, 0);
}
to {
opacity: 1;
transform: none;
}
}
@-webkit-keyframes flatpickrFadeInDown {
from {
opacity: 0;
transform: translate3d(0, -20px, 0);
}
to {
opacity: 1;
transform: none;
}
}
@-o-keyframes flatpickrFadeInDown {
from {
opacity: 0;
transform: translate3d(0, -20px, 0);
}
to {
opacity: 1;
transform: none;
}
}
@keyframes flatpickrFadeInDown {
from {
opacity: 0;
transform: translate3d(0, -20px, 0);
}
to {
opacity: 1;
transform: none;
}
}
| hare1039/cdnjs | ajax/libs/flatpickr/2.2.6/rtl/themes/material_orange.rtl.css | CSS | mit | 12,935 |
/*! formstone v0.8.22 [grid.css] 2015-10-19 | MIT License | formstone.it */
/**
* @grid
* @name Grid
* @description A responsive CSS grid.
*/
.fs_grid_row,
.fs-grid .fs-row {
width: 300px;
margin-left: auto;
margin-right: auto;
}
@media screen and (min-width: 500px) {
.fs_grid_row,
.fs-grid .fs-row {
width: 480px;
}
}
@media screen and (min-width: 740px) {
.fs_grid_row,
.fs-grid .fs-row {
width: 720px;
}
}
@media screen and (min-width: 980px) {
.fs_grid_row,
.fs-grid .fs-row {
width: 960px;
}
}
@media screen and (min-width: 1220px) {
.fs_grid_row,
.fs-grid .fs-row {
width: 1200px;
}
}
.fs_grid_row:after,
.fs-grid .fs-row:after {
height: 0;
clear: both;
content: ".";
display: block;
line-height: 0;
visibility: hidden;
}
.fs_grid_row_fluid,
.fs-grid-fluid .fs-row {
width: 96%;
width: -webkit-calc(100% - 40px);
width: calc(100% - 40px);
}
@media screen and (max-width: 739px) {
.fs_grid_row_fluid_sm,
.fs-grid-sm-fluid .fs-row {
width: 96%;
width: -webkit-calc(100% - 40px);
width: calc(100% - 40px);
}
}
.fs_grid_row_row,
.fs-grid .fs-row .fs-row {
width: 102.08333333%;
margin-left: -1.04166667%;
margin-right: -1.04166667%;
}
.fs_grid_row_row_contained,
.fs-grid .fs-row [class*="fs-cell"][class*="-contained"] .fs-row {
width: 100%;
margin-left: 0;
margin-right: 0;
}
.fs_grid_cell,
.fs-grid .fs-row [class*="fs-cell"] {
width: 97.91666667%;
float: left;
margin-left: 1.04166667%;
margin-right: 1.04166667%;
}
.fs_grid_cell_centered,
.fs-grid .fs-row [class*="fs-cell"][class*="-centered"] {
float: none;
margin-left: auto;
margin-right: auto;
}
.fs_grid_cell_padded,
.fs-grid .fs-row [class*="fs-cell"][class*="-padded"] {
box-sizing: content-box;
margin-left: 0;
margin-right: 0;
padding-left: 1.04166667%;
padding-right: 1.04166667%;
}
.fs_grid_cell_contained,
.fs-grid .fs-row [class*="fs-cell"][class*="-contained"] {
margin-left: 0;
margin-right: 0;
}
.fs_grid_cell_right,
.fs-grid .fs-row [class*="fs-cell"][class*="-right"] {
float: right;
}
* {
box-sizing: border-box;
}
*:before,
*:after {
box-sizing: inherit;
}
.fs-grid .fs-row .fs-all-fifth {
width: 17.91666667%;
}
.fs-grid .fs-row .fs-all-fourth {
width: 22.91666667%;
}
.fs-grid .fs-row .fs-all-third {
width: 31.25%;
}
.fs-grid .fs-row .fs-all-half {
width: 47.91666667%;
}
.fs-grid .fs-row .fs-all-full {
width: 97.91666667%;
}
.fs-grid .fs-row .fs-all-push-fifth {
margin-left: 21.04166667%;
}
.fs-grid .fs-row .fs-all-push-fourth {
margin-left: 26.04166667%;
}
.fs-grid .fs-row .fs-all-push-third {
margin-left: 34.375%;
}
.fs-grid .fs-row .fs-all-push-half {
margin-left: 51.04166667%;
}
.fs-grid .fs-row [class*="-contained"].fs-all-fifth {
width: 20%;
}
.fs-grid .fs-row [class*="-contained"].fs-all-fourth {
width: 25%;
}
.fs-grid .fs-row [class*="-contained"].fs-all-third {
width: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-all-half {
width: 50%;
}
.fs-grid .fs-row [class*="-contained"].fs-all-full {
width: 100%;
}
.fs-grid .fs-row [class*="-contained"].fs-all-push-fifth {
margin-left: 20%;
}
.fs-grid .fs-row [class*="-contained"].fs-all-push-fourth {
margin-left: 25%;
}
.fs-grid .fs-row [class*="-contained"].fs-all-push-third {
margin-left: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-all-push-half {
margin-left: 50%;
}
.fs-grid .fs-row .fs-all-hide {
display: none;
}
@media screen and (max-width: 739px) {
.fs-grid .fs-row .fs-sm-1 {
width: 31.25%;
}
.fs-grid .fs-row .fs-sm-2 {
width: 64.58333333%;
}
.fs-grid .fs-row .fs-sm-3 {
width: 97.91666667%;
}
.fs-grid .fs-row .fs-sm-push-1 {
margin-left: 34.375%;
}
.fs-grid .fs-row .fs-sm-push-2 {
margin-left: 67.70833333%;
}
.fs-grid .fs-row [class*="-contained"].fs-sm-1 {
width: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-sm-2 {
width: 66.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-sm-3 {
width: 100%;
}
.fs-grid .fs-row [class*="-contained"].fs-sm-push-1 {
margin-left: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-sm-push-2 {
margin-left: 66.66666667%;
}
.fs-grid .fs-row .fs-sm-fifth {
width: 17.91666667%;
}
.fs-grid .fs-row .fs-sm-fourth {
width: 22.91666667%;
}
.fs-grid .fs-row .fs-sm-third {
width: 31.25%;
}
.fs-grid .fs-row .fs-sm-half {
width: 47.91666667%;
}
.fs-grid .fs-row .fs-sm-full {
width: 97.91666667%;
}
.fs-grid .fs-row .fs-sm-push-fifth {
margin-left: 21.04166667%;
}
.fs-grid .fs-row .fs-sm-push-fourth {
margin-left: 26.04166667%;
}
.fs-grid .fs-row .fs-sm-push-third {
margin-left: 34.375%;
}
.fs-grid .fs-row .fs-sm-push-half {
margin-left: 51.04166667%;
}
.fs-grid .fs-row [class*="-contained"].fs-sm-fifth {
width: 20%;
}
.fs-grid .fs-row [class*="-contained"].fs-sm-fourth {
width: 25%;
}
.fs-grid .fs-row [class*="-contained"].fs-sm-third {
width: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-sm-half {
width: 50%;
}
.fs-grid .fs-row [class*="-contained"].fs-sm-full {
width: 100%;
}
.fs-grid .fs-row [class*="-contained"].fs-sm-push-fifth {
margin-left: 20%;
}
.fs-grid .fs-row [class*="-contained"].fs-sm-push-fourth {
margin-left: 25%;
}
.fs-grid .fs-row [class*="-contained"].fs-sm-push-third {
margin-left: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-sm-push-half {
margin-left: 50%;
}
.fs-grid .fs-row .fs-sm-hide {
display: none;
}
}
@media screen and (max-width: 499px) {
.fs-grid .fs-row .fs-xs-1 {
width: 31.25%;
}
.fs-grid .fs-row .fs-xs-2 {
width: 64.58333333%;
}
.fs-grid .fs-row .fs-xs-3 {
width: 97.91666667%;
}
.fs-grid .fs-row .fs-xs-push-1 {
margin-left: 34.375%;
}
.fs-grid .fs-row .fs-xs-push-2 {
margin-left: 67.70833333%;
}
.fs-grid .fs-row [class*="-contained"].fs-xs-1 {
width: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-xs-2 {
width: 66.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-xs-3 {
width: 100%;
}
.fs-grid .fs-row [class*="-contained"].fs-xs-push-1 {
margin-left: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-xs-push-2 {
margin-left: 66.66666667%;
}
.fs-grid .fs-row .fs-xs-fifth {
width: 17.91666667%;
}
.fs-grid .fs-row .fs-xs-fourth {
width: 22.91666667%;
}
.fs-grid .fs-row .fs-xs-third {
width: 31.25%;
}
.fs-grid .fs-row .fs-xs-half {
width: 47.91666667%;
}
.fs-grid .fs-row .fs-xs-full {
width: 97.91666667%;
}
.fs-grid .fs-row .fs-xs-push-fifth {
margin-left: 21.04166667%;
}
.fs-grid .fs-row .fs-xs-push-fourth {
margin-left: 26.04166667%;
}
.fs-grid .fs-row .fs-xs-push-third {
margin-left: 34.375%;
}
.fs-grid .fs-row .fs-xs-push-half {
margin-left: 51.04166667%;
}
.fs-grid .fs-row [class*="-contained"].fs-xs-fifth {
width: 20%;
}
.fs-grid .fs-row [class*="-contained"].fs-xs-fourth {
width: 25%;
}
.fs-grid .fs-row [class*="-contained"].fs-xs-third {
width: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-xs-half {
width: 50%;
}
.fs-grid .fs-row [class*="-contained"].fs-xs-full {
width: 100%;
}
.fs-grid .fs-row [class*="-contained"].fs-xs-push-fifth {
margin-left: 20%;
}
.fs-grid .fs-row [class*="-contained"].fs-xs-push-fourth {
margin-left: 25%;
}
.fs-grid .fs-row [class*="-contained"].fs-xs-push-third {
margin-left: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-xs-push-half {
margin-left: 50%;
}
.fs-grid .fs-row .fs-xs-hide {
display: none;
}
}
@media screen and (min-width: 740px) and (max-width: 979px) {
.fs-grid .fs-row .fs-md-1 {
width: 14.58333333%;
}
.fs-grid .fs-row .fs-md-2 {
width: 31.25%;
}
.fs-grid .fs-row .fs-md-3 {
width: 47.91666667%;
}
.fs-grid .fs-row .fs-md-4 {
width: 64.58333333%;
}
.fs-grid .fs-row .fs-md-5 {
width: 81.25%;
}
.fs-grid .fs-row .fs-md-6 {
width: 97.91666667%;
}
.fs-grid .fs-row .fs-md-push-1 {
margin-left: 17.70833333%;
}
.fs-grid .fs-row .fs-md-push-2 {
margin-left: 34.375%;
}
.fs-grid .fs-row .fs-md-push-3 {
margin-left: 51.04166667%;
}
.fs-grid .fs-row .fs-md-push-4 {
margin-left: 67.70833333%;
}
.fs-grid .fs-row .fs-md-push-5 {
margin-left: 84.375%;
}
.fs-grid .fs-row [class*="-contained"].fs-md-1 {
width: 16.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-md-2 {
width: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-md-3 {
width: 50%;
}
.fs-grid .fs-row [class*="-contained"].fs-md-4 {
width: 66.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-md-5 {
width: 83.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-md-6 {
width: 100%;
}
.fs-grid .fs-row [class*="-contained"].fs-md-push-1 {
margin-left: 16.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-md-push-2 {
margin-left: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-md-push-3 {
margin-left: 50%;
}
.fs-grid .fs-row [class*="-contained"].fs-md-push-4 {
margin-left: 66.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-md-push-5 {
margin-left: 83.33333333%;
}
.fs-grid .fs-row .fs-md-fifth {
width: 17.91666667%;
}
.fs-grid .fs-row .fs-md-fourth {
width: 22.91666667%;
}
.fs-grid .fs-row .fs-md-third {
width: 31.25%;
}
.fs-grid .fs-row .fs-md-half {
width: 47.91666667%;
}
.fs-grid .fs-row .fs-md-full {
width: 97.91666667%;
}
.fs-grid .fs-row .fs-md-push-fifth {
margin-left: 21.04166667%;
}
.fs-grid .fs-row .fs-md-push-fourth {
margin-left: 26.04166667%;
}
.fs-grid .fs-row .fs-md-push-third {
margin-left: 34.375%;
}
.fs-grid .fs-row .fs-md-push-half {
margin-left: 51.04166667%;
}
.fs-grid .fs-row [class*="-contained"].fs-md-fifth {
width: 20%;
}
.fs-grid .fs-row [class*="-contained"].fs-md-fourth {
width: 25%;
}
.fs-grid .fs-row [class*="-contained"].fs-md-third {
width: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-md-half {
width: 50%;
}
.fs-grid .fs-row [class*="-contained"].fs-md-full {
width: 100%;
}
.fs-grid .fs-row [class*="-contained"].fs-md-push-fifth {
margin-left: 20%;
}
.fs-grid .fs-row [class*="-contained"].fs-md-push-fourth {
margin-left: 25%;
}
.fs-grid .fs-row [class*="-contained"].fs-md-push-third {
margin-left: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-md-push-half {
margin-left: 50%;
}
.fs-grid .fs-row .fs-md-hide {
display: none;
}
}
@media screen and (min-width: 980px) {
.fs-grid .fs-row .fs-lg-1 {
width: 6.25%;
}
.fs-grid .fs-row .fs-lg-2 {
width: 14.58333333%;
}
.fs-grid .fs-row .fs-lg-3 {
width: 22.91666667%;
}
.fs-grid .fs-row .fs-lg-4 {
width: 31.25%;
}
.fs-grid .fs-row .fs-lg-5 {
width: 39.58333333%;
}
.fs-grid .fs-row .fs-lg-6 {
width: 47.91666667%;
}
.fs-grid .fs-row .fs-lg-7 {
width: 56.25%;
}
.fs-grid .fs-row .fs-lg-8 {
width: 64.58333333%;
}
.fs-grid .fs-row .fs-lg-9 {
width: 72.91666667%;
}
.fs-grid .fs-row .fs-lg-10 {
width: 81.25%;
}
.fs-grid .fs-row .fs-lg-11 {
width: 89.58333333%;
}
.fs-grid .fs-row .fs-lg-12 {
width: 97.91666667%;
}
.fs-grid .fs-row .fs-lg-push-1 {
margin-left: 9.375%;
}
.fs-grid .fs-row .fs-lg-push-2 {
margin-left: 17.70833333%;
}
.fs-grid .fs-row .fs-lg-push-3 {
margin-left: 26.04166667%;
}
.fs-grid .fs-row .fs-lg-push-4 {
margin-left: 34.375%;
}
.fs-grid .fs-row .fs-lg-push-5 {
margin-left: 42.70833333%;
}
.fs-grid .fs-row .fs-lg-push-6 {
margin-left: 51.04166667%;
}
.fs-grid .fs-row .fs-lg-push-7 {
margin-left: 59.375%;
}
.fs-grid .fs-row .fs-lg-push-8 {
margin-left: 67.70833333%;
}
.fs-grid .fs-row .fs-lg-push-9 {
margin-left: 76.04166667%;
}
.fs-grid .fs-row .fs-lg-push-10 {
margin-left: 84.375%;
}
.fs-grid .fs-row .fs-lg-push-11 {
margin-left: 92.70833333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-1 {
width: 8.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-2 {
width: 16.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-3 {
width: 25%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-4 {
width: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-5 {
width: 41.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-6 {
width: 50%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-7 {
width: 58.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-8 {
width: 66.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-9 {
width: 75%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-10 {
width: 83.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-11 {
width: 91.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-12 {
width: 100%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-1 {
margin-left: 8.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-2 {
margin-left: 16.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-3 {
margin-left: 25%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-4 {
margin-left: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-5 {
margin-left: 41.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-6 {
margin-left: 50%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-7 {
margin-left: 58.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-8 {
margin-left: 66.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-9 {
margin-left: 75%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-10 {
margin-left: 83.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-11 {
margin-left: 91.66666667%;
}
.fs-grid .fs-row .fs-lg-fifth {
width: 17.91666667%;
}
.fs-grid .fs-row .fs-lg-fourth {
width: 22.91666667%;
}
.fs-grid .fs-row .fs-lg-third {
width: 31.25%;
}
.fs-grid .fs-row .fs-lg-half {
width: 47.91666667%;
}
.fs-grid .fs-row .fs-lg-full {
width: 97.91666667%;
}
.fs-grid .fs-row .fs-lg-push-fifth {
margin-left: 21.04166667%;
}
.fs-grid .fs-row .fs-lg-push-fourth {
margin-left: 26.04166667%;
}
.fs-grid .fs-row .fs-lg-push-third {
margin-left: 34.375%;
}
.fs-grid .fs-row .fs-lg-push-half {
margin-left: 51.04166667%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-fifth {
width: 20%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-fourth {
width: 25%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-third {
width: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-half {
width: 50%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-full {
width: 100%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-fifth {
margin-left: 20%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-fourth {
margin-left: 25%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-third {
margin-left: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-lg-push-half {
margin-left: 50%;
}
.fs-grid .fs-row .fs-lg-hide {
display: none;
}
}
@media screen and (min-width: 1220px) {
.fs-grid .fs-row .fs-xl-1 {
width: 6.25%;
}
.fs-grid .fs-row .fs-xl-2 {
width: 14.58333333%;
}
.fs-grid .fs-row .fs-xl-3 {
width: 22.91666667%;
}
.fs-grid .fs-row .fs-xl-4 {
width: 31.25%;
}
.fs-grid .fs-row .fs-xl-5 {
width: 39.58333333%;
}
.fs-grid .fs-row .fs-xl-6 {
width: 47.91666667%;
}
.fs-grid .fs-row .fs-xl-7 {
width: 56.25%;
}
.fs-grid .fs-row .fs-xl-8 {
width: 64.58333333%;
}
.fs-grid .fs-row .fs-xl-9 {
width: 72.91666667%;
}
.fs-grid .fs-row .fs-xl-10 {
width: 81.25%;
}
.fs-grid .fs-row .fs-xl-11 {
width: 89.58333333%;
}
.fs-grid .fs-row .fs-xl-12 {
width: 97.91666667%;
}
.fs-grid .fs-row .fs-xl-push-1 {
margin-left: 9.375%;
}
.fs-grid .fs-row .fs-xl-push-2 {
margin-left: 17.70833333%;
}
.fs-grid .fs-row .fs-xl-push-3 {
margin-left: 26.04166667%;
}
.fs-grid .fs-row .fs-xl-push-4 {
margin-left: 34.375%;
}
.fs-grid .fs-row .fs-xl-push-5 {
margin-left: 42.70833333%;
}
.fs-grid .fs-row .fs-xl-push-6 {
margin-left: 51.04166667%;
}
.fs-grid .fs-row .fs-xl-push-7 {
margin-left: 59.375%;
}
.fs-grid .fs-row .fs-xl-push-8 {
margin-left: 67.70833333%;
}
.fs-grid .fs-row .fs-xl-push-9 {
margin-left: 76.04166667%;
}
.fs-grid .fs-row .fs-xl-push-10 {
margin-left: 84.375%;
}
.fs-grid .fs-row .fs-xl-push-11 {
margin-left: 92.70833333%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-1 {
width: 8.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-2 {
width: 16.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-3 {
width: 25%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-4 {
width: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-5 {
width: 41.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-6 {
width: 50%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-7 {
width: 58.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-8 {
width: 66.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-9 {
width: 75%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-10 {
width: 83.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-11 {
width: 91.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-12 {
width: 100%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-push-1 {
margin-left: 8.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-push-2 {
margin-left: 16.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-push-3 {
margin-left: 25%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-push-4 {
margin-left: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-push-5 {
margin-left: 41.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-push-6 {
margin-left: 50%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-push-7 {
margin-left: 58.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-push-8 {
margin-left: 66.66666667%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-push-9 {
margin-left: 75%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-push-10 {
margin-left: 83.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-push-11 {
margin-left: 91.66666667%;
}
.fs-grid .fs-row .fs-xl-fifth {
width: 17.91666667%;
}
.fs-grid .fs-row .fs-xl-fourth {
width: 22.91666667%;
}
.fs-grid .fs-row .fs-xl-third {
width: 31.25%;
}
.fs-grid .fs-row .fs-xl-half {
width: 47.91666667%;
}
.fs-grid .fs-row .fs-xl-full {
width: 97.91666667%;
}
.fs-grid .fs-row .fs-xl-push-fifth {
margin-left: 21.04166667%;
}
.fs-grid .fs-row .fs-xl-push-fourth {
margin-left: 26.04166667%;
}
.fs-grid .fs-row .fs-xl-push-third {
margin-left: 34.375%;
}
.fs-grid .fs-row .fs-xl-push-half {
margin-left: 51.04166667%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-fifth {
width: 20%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-fourth {
width: 25%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-third {
width: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-half {
width: 50%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-full {
width: 100%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-push-fifth {
margin-left: 20%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-push-fourth {
margin-left: 25%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-push-third {
margin-left: 33.33333333%;
}
.fs-grid .fs-row [class*="-contained"].fs-xl-push-half {
margin-left: 50%;
}
.fs-grid .fs-row .fs-xl-hide {
display: none;
}
}
| jonobr1/cdnjs | ajax/libs/formstone/0.8.23/css/grid.css | CSS | mit | 20,370 |
function tokenize(input, callback) {
while(input.length > 0) {
callback(input.match(/^[\/\.\?]|[^\/\.\?]+/)[0]);
input = input.replace(/^[\/\.\?]|[^\/\.\?]+/, '');
}
}
var graph = d3.select("#chart-2 svg");
var svg_edges = {};
var svg_nodes = {};
graph.selectAll("g.edge").each(function() {
var node = d3.select(this);
var index = node.select("title").text().split("->");
var left = parseInt(index[0]);
var right = parseInt(index[1]);
if(!svg_edges[left]) { svg_edges[left] = {} }
svg_edges[left][right] = node;
});
graph.selectAll("g.node").each(function() {
var node = d3.select(this);
var index = parseInt(node.select("title").text());
svg_nodes[index] = node;
});
function reset_graph() {
for(var key in svg_edges) {
for(var mkey in svg_edges[key]) {
var node = svg_edges[key][mkey];
var path = node.select("path");
var arrow = node.select("polygon");
path.style("stroke", "black");
arrow.style("stroke", "black").style("fill", "black");
}
}
for(var key in svg_nodes) {
var node = svg_nodes[key];
node.select('ellipse').style("fill", "white");
node.select('polygon').style("fill", "white");
}
return false;
}
function highlight_edge(from, to) {
var node = svg_edges[from][to];
var path = node.select("path");
var arrow = node.select("polygon");
path
.transition().duration(500)
.style("stroke", "green");
arrow
.transition().duration(500)
.style("stroke", "green").style("fill", "green");
}
function highlight_state(index, color) {
if(!color) { color = "green"; }
svg_nodes[index].select('ellipse')
.style("fill", "white")
.transition().duration(500)
.style("fill", color);
}
function highlight_finish(index) {
svg_nodes[index].select('polygon')
.style("fill", "while")
.transition().duration(500)
.style("fill", "blue");
}
function match(input) {
reset_graph();
var table = tt();
var states = [0];
var regexp_states = table['regexp_states'];
var string_states = table['string_states'];
var accepting = table['accepting'];
highlight_state(0);
tokenize(input, function(token) {
var new_states = [];
for(var key in states) {
var state = states[key];
if(string_states[state] && string_states[state][token]) {
var new_state = string_states[state][token];
highlight_edge(state, new_state);
highlight_state(new_state);
new_states.push(new_state);
}
if(regexp_states[state]) {
for(var key in regexp_states[state]) {
var re = new RegExp("^" + key + "$");
if(re.test(token)) {
var new_state = regexp_states[state][key];
highlight_edge(state, new_state);
highlight_state(new_state);
new_states.push(new_state);
}
}
}
}
if(new_states.length == 0) {
return;
}
states = new_states;
});
for(var key in states) {
var state = states[key];
if(accepting[state]) {
for(var mkey in svg_edges[state]) {
if(!regexp_states[mkey] && !string_states[mkey]) {
highlight_edge(state, mkey);
highlight_finish(mkey);
}
}
} else {
highlight_state(state, "red");
}
}
return false;
}
| odedniv/rails | actionpack/lib/action_dispatch/journey/visualizer/fsm.js | JavaScript | mit | 3,323 |
angular.module('DocsController', [])
.controller('DocsController', [
'$scope', '$rootScope', '$location', '$window', '$cookies', 'openPlunkr',
'NG_PAGES', 'NG_NAVIGATION', 'NG_VERSION',
function($scope, $rootScope, $location, $window, $cookies, openPlunkr,
NG_PAGES, NG_NAVIGATION, NG_VERSION) {
$scope.openPlunkr = openPlunkr;
$scope.docsVersion = NG_VERSION.isSnapshot ? 'snapshot' : NG_VERSION.version;
$scope.navClass = function(navItem) {
return {
active: navItem.href && this.currentPage && this.currentPage.path,
current: this.currentPage && this.currentPage.path === navItem.href,
'nav-index-section': navItem.type === 'section'
};
};
$scope.$on('$includeContentLoaded', function() {
var pagePath = $scope.currentPage ? $scope.currentPage.path : $location.path();
$window._gaq.push(['_trackPageview', pagePath]);
});
$scope.$watch(function docsPathWatch() {return $location.path(); }, function docsPathWatchAction(path) {
path = path.replace(/^\/?(.+?)(\/index)?\/?$/, '$1');
currentPage = $scope.currentPage = NG_PAGES[path];
if ( currentPage ) {
$scope.partialPath = 'partials/' + path + '.html';
$scope.currentArea = NG_NAVIGATION[currentPage.area];
var pathParts = currentPage.path.split('/');
var breadcrumb = $scope.breadcrumb = [];
var breadcrumbPath = '';
angular.forEach(pathParts, function(part) {
breadcrumbPath += part;
breadcrumb.push({ name: (NG_PAGES[breadcrumbPath]&&NG_PAGES[breadcrumbPath].name) || part, url: breadcrumbPath });
breadcrumbPath += '/';
});
} else {
$scope.currentArea = NG_NAVIGATION['api'];
$scope.breadcrumb = [];
$scope.partialPath = 'Error404.html';
}
});
/**********************************
Initialize
***********************************/
$scope.versionNumber = angular.version.full;
$scope.version = angular.version.full + " " + angular.version.codeName;
$scope.loading = 0;
var INDEX_PATH = /^(\/|\/index[^\.]*.html)$/;
if (!$location.path() || INDEX_PATH.test($location.path())) {
$location.path('/api').replace();
}
}]);
| Abhik29/MySecondRepoTrying | docs/app/src/docs.js | JavaScript | mit | 2,207 |
Prism.languages.lolcode = {
'comment': [
/\bOBTW\s+[\s\S]*?\s+TLDR\b/,
/\bBTW.+/
],
'string': {
pattern: /"(?::.|[^"])*"/,
inside: {
'variable': /:\{[^}]+\}/,
'symbol': [
/:\([a-f\d]+\)/i,
/:\[[^\]]+\]/,
/:[)>o":]/
]
}
},
'number': /(-|\b)\d*\.?\d+/,
'symbol': {
pattern: /(^|\s)(?:A )?(?:YARN|NUMBR|NUMBAR|TROOF|BUKKIT|NOOB)(?=\s|,|$)/,
lookbehind: true,
inside: {
'keyword': /A(?=\s)/
}
},
'label': {
pattern: /((?:^|\s)(?:IM IN YR|IM OUTTA YR) )[a-zA-Z]\w*/,
lookbehind: true,
alias: 'string'
},
'function': {
pattern: /((?:^|\s)(?:I IZ|HOW IZ I|IZ) )[a-zA-Z]\w*/,
lookbehind: true
},
'keyword': [
{
pattern: /(^|\s)(?:O HAI IM|KTHX|HAI|KTHXBYE|I HAS A|ITZ(?: A)?|R|AN|MKAY|SMOOSH|MAEK|IS NOW(?: A)?|VISIBLE|GIMMEH|O RLY\?|YA RLY|NO WAI|OIC|MEBBE|WTF\?|OMG|OMGWTF|GTFO|IM IN YR|IM OUTTA YR|FOUND YR|YR|TIL|WILE|UPPIN|NERFIN|I IZ|HOW IZ I|IF U SAY SO|SRS|HAS A|LIEK(?: A)?|IZ)(?=\s|,|$)/,
lookbehind: true
},
/'Z(?=\s|,|$)/
],
'boolean': {
pattern: /(^|\s)(?:WIN|FAIL)(?=\s|,|$)/,
lookbehind: true
},
'variable': {
pattern: /(^|\s)IT(?=\s|,|$)/,
lookbehind: true
},
'operator': {
pattern: /(^|\s)(?:NOT|BOTH SAEM|DIFFRINT|(?:SUM|DIFF|PRODUKT|QUOSHUNT|MOD|BIGGR|SMALLR|BOTH|EITHER|WON|ALL|ANY) OF)(?=\s|,|$)/,
lookbehind: true
},
'punctuation': /\.{3}|…|,|!/
}; | BitsyCode/cdnjs | ajax/libs/prism/1.1.0/components/prism-lolcode.js | JavaScript | mit | 1,360 |
/*
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
*
* Uses the built in easing capabilities added In jQuery 1.1
* to offer multiple easing options
*
* TERMS OF USE - jQuery Easing
*
* Open source under the BSD License.
*
* Copyright В© 2008 George McGinley Smith
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* Neither the name of the author nor the names of contributors may be used to endorse
* or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];
jQuery.extend( jQuery.easing,
{
def: 'easeOutQuad',
swing: function (x, t, b, c, d) {
//alert(jQuery.easing.default);
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
},
easeInQuad: function (x, t, b, c, d) {
return c*(t/=d)*t + b;
},
easeOutQuad: function (x, t, b, c, d) {
return -c *(t/=d)*(t-2) + b;
},
easeInOutQuad: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t + b;
return -c/2 * ((--t)*(t-2) - 1) + b;
},
easeInCubic: function (x, t, b, c, d) {
return c*(t/=d)*t*t + b;
},
easeOutCubic: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t + 1) + b;
},
easeInOutCubic: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t + b;
return c/2*((t-=2)*t*t + 2) + b;
},
easeInQuart: function (x, t, b, c, d) {
return c*(t/=d)*t*t*t + b;
},
easeOutQuart: function (x, t, b, c, d) {
return -c * ((t=t/d-1)*t*t*t - 1) + b;
},
easeInOutQuart: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
return -c/2 * ((t-=2)*t*t*t - 2) + b;
},
easeInQuint: function (x, t, b, c, d) {
return c*(t/=d)*t*t*t*t + b;
},
easeOutQuint: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t*t*t + 1) + b;
},
easeInOutQuint: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
return c/2*((t-=2)*t*t*t*t + 2) + b;
},
easeInSine: function (x, t, b, c, d) {
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
},
easeOutSine: function (x, t, b, c, d) {
return c * Math.sin(t/d * (Math.PI/2)) + b;
},
easeInOutSine: function (x, t, b, c, d) {
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
},
easeInExpo: function (x, t, b, c, d) {
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
},
easeOutExpo: function (x, t, b, c, d) {
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
},
easeInOutExpo: function (x, t, b, c, d) {
if (t==0) return b;
if (t==d) return b+c;
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
},
easeInCirc: function (x, t, b, c, d) {
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
},
easeOutCirc: function (x, t, b, c, d) {
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
},
easeInOutCirc: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
},
easeInElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
},
easeOutElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
},
easeInOutElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
},
easeInBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c*(t/=d)*t*((s+1)*t - s) + b;
},
easeOutBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
},
easeInOutBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
},
easeInBounce: function (x, t, b, c, d) {
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
},
easeOutBounce: function (x, t, b, c, d) {
if ((t/=d) < (1/2.75)) {
return c*(7.5625*t*t) + b;
} else if (t < (2/2.75)) {
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
} else if (t < (2.5/2.75)) {
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
} else {
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
}
},
easeInOutBounce: function (x, t, b, c, d) {
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
}
});
/*
*
* TERMS OF USE - EASING EQUATIONS
*
* Open source under the BSD License.
*
* Copyright В© 2001 Robert Penner
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* Neither the name of the author nor the names of contributors may be used to endorse
* or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/ | WakilaFarzan/laravel_hw | resources/views/global/plugins/jquery.easing.js | JavaScript | mit | 8,101 |
/**
machina
Author: Jim Cowart (http://freshbrewedcode.com/jimcowart)
License: Dual licensed MIT (http://www.opensource.org/licenses/mit-license) & GPL (http://www.opensource.org/licenses/gpl-license)
Version 0.3.4
*/
(function(t,e){"object"==typeof module&&module.exports?module.exports=function(t){return t=t||require("underscore"),e(t)}:"function"==typeof define&&define.amd?define(["underscore"],function(i){return e(i,t)}):t.machina=e(t._,t)})(this,function(t,e,i){var n=[].slice,s="transition",r="handler",a="handling",o="handled",u="nohandler",c="transition",h="invalidstate",l="deferred",f="newfsm",p={makeFsmNamespace:function(){var t=0;return function(){return"fsm."+t++}}(),getDefaultOptions:function(){return{initialState:"uninitialized",eventListeners:{"*":[]},states:{},eventQueue:[],namespace:p.makeFsmNamespace(),targetReplayState:"",state:i,priorState:i,_priorAction:"",_currentAction:""}}};if(!t.deepExtend){var v={"*":function(t,e,i){t[e]=i},object:function(t,e,i){t[e]=m({},t[e]||{},i)},array:function(e,i,n){e[i]=[],t.each(n,function(t,n){v[g(t)](e[i],n,t)},this)}},d=function(e){return t.isArray(e)?"array":t.isDate(e)?"date":t.isRegExp(e)?"regex":typeof e},g=function(t){var e=d(t);return v[e]?e:"*"},m=function(e){return t.each(n.call(arguments,1),function(i){t.each(i,function(t,i){v[g(t)](e,i,t)})}),e};t.mixin({deepExtend:m})}var y=function(e){t.extend(this,e),t.defaults(this,p.getDefaultOptions()),this.initialize.apply(this,arguments),L.emit(f,this),this.initialState&&this.transition(this.initialState)};t.extend(y.prototype,{initialize:function(){},emit:function(e){var s=arguments;this.eventListeners["*"]&&t.each(this.eventListeners["*"],function(t){try{t.apply(this,n.call(s,0))}catch(e){console&&console.log!==i&&console.log(""+e)}},this),this.eventListeners[e]&&t.each(this.eventListeners[e],function(t){try{t.apply(this,n.call(s,1))}catch(e){console&&console.log!==i&&console.log(""+e)}},this)},handle:function(e){if(!this.inExitHandler){var s,c,h,l,f=this.states,p=this.state,v=n.call(arguments,0);this.currentActionArgs=v,f[p][e]||f[p]["*"]||this["*"]?(s=f[p][e]?e:"*",h="*"===s,f[p][s]?(c=f[p][s],l=p+"."+s):(c=this["*"],l="*"),this._currentAction||(this._currentAction=l),this.emit.call(this,a,{inputType:e,args:v.slice(1)}),t.isFunction(c)&&(c=c.apply(this,h?v:v.slice(1))),t.isString(c)&&this.transition(c),this.emit.call(this,o,{inputType:e,args:v.slice(1)}),this._priorAction=this._currentAction,this._currentAction="",this.processQueue(r)):this.emit.call(this,u,{inputType:e,args:v.slice(1)}),this.currentActionArgs=i}},transition:function(t){if(!this.inExitHandler&&t!==this.state){var e;if(this.states[t])return this.targetReplayState=t,this.priorState=this.state,this.state=t,e=this.priorState,this.states[e]&&this.states[e]._onExit&&(this.inExitHandler=!0,this.states[e]._onExit.call(this),this.inExitHandler=!1),this.emit.call(this,c,{fromState:e,action:this._currentAction,toState:t}),this.states[t]._onEnter&&this.states[t]._onEnter.call(this),this.targetReplayState===t&&this.processQueue(s),i;this.emit.call(this,h,{state:this.state,attemptedState:t})}},processQueue:function(e){var i=e===s?function(t){return t.type===s&&(!t.untilState||t.untilState===this.state)}:function(t){return t.type===r},n=t.filter(this.eventQueue,i,this);this.eventQueue=t.difference(this.eventQueue,n),t.each(n,function(t){this.handle.apply(this,t.args)},this)},clearQueue:function(e,i){if(e){var n;e===s?n=function(t){return t.type===s&&(i?t.untilState===i:!0)}:e===r&&(n=function(t){return t.type===r}),this.eventQueue=t.filter(this.eventQueue,n)}else this.eventQueue=[]},deferUntilTransition:function(t){if(this.currentActionArgs){var e={type:s,untilState:t,args:this.currentActionArgs};this.eventQueue.push(e),this.emit.call(this,l,{state:this.state,queuedArgs:e})}},deferUntilNextHandler:function(){if(this.currentActionArgs){var t={type:s,args:this.currentActionArgs};this.eventQueue.push(t),this.emit.call(this,l,{state:this.state,queuedArgs:t})}},on:function(t,e){var i=this;return i.eventListeners[t]||(i.eventListeners[t]=[]),i.eventListeners[t].push(e),{eventName:t,callback:e,off:function(){i.off(t,e)}}},off:function(e,i){e?this.eventListeners[e]&&(this.eventListeners[e]=i?t.without(this.eventListeners[e],i):[]):this.eventListeners={}}}),y.prototype.trigger=y.prototype.emit;var A=function(){},x=function(e,i,n){var s;return s=i&&i.hasOwnProperty("constructor")?i.constructor:function(){e.apply(this,arguments)},t.deepExtend(s,e),A.prototype=e.prototype,s.prototype=new A,i&&t.deepExtend(s.prototype,i),n&&t.deepExtend(s,n),s.prototype.constructor=s,s.__super__=e.prototype,s};y.extend=function(t,e){var i=x(this,t,e);return i.extend=this.extend,i};var L={Fsm:y,utils:p,on:function(t,e){return this.eventListeners[t]||(this.eventListeners[t]=[]),this.eventListeners[t].push(e),e},off:function(e,i){this.eventListeners[e]&&(this.eventListeners[e]=t.without(this.eventListeners[e],i))},trigger:function(e){var i=arguments,s=this.eventListeners[e]||[];s&&s.length&&t.each(s,function(t){t.apply(null,n.call(i,1))})},eventListeners:{newFsm:[]}};return L.emit=L.trigger,L}); | chrisyip/cdnjs | ajax/libs/machina.js/0.3.4/machina.min.js | JavaScript | mit | 5,122 |
if (typeof _yuitest_coverage == "undefined"){
_yuitest_coverage = {};
_yuitest_coverline = function(src, line){
var coverage = _yuitest_coverage[src];
if (!coverage.lines[line]){
coverage.calledLines++;
}
coverage.lines[line]++;
};
_yuitest_coverfunc = function(src, name, line){
var coverage = _yuitest_coverage[src],
funcId = name + ":" + line;
if (!coverage.functions[funcId]){
coverage.calledFunctions++;
}
coverage.functions[funcId]++;
};
}
_yuitest_coverage["build/io-base/io-base.js"] = {
lines: {},
functions: {},
coveredLines: 0,
calledLines: 0,
coveredFunctions: 0,
calledFunctions: 0,
path: "build/io-base/io-base.js",
code: []
};
_yuitest_coverage["build/io-base/io-base.js"].code=["YUI.add('io-base', function (Y, NAME) {","","/**","Base IO functionality. Provides basic XHR transport support.","","@module io","@submodule io-base","@for IO","**/","","var // List of events that comprise the IO event lifecycle."," EVENTS = ['start', 'complete', 'end', 'success', 'failure', 'progress'],",""," // Whitelist of used XHR response object properties."," XHR_PROPS = ['status', 'statusText', 'responseText', 'responseXML'],",""," win = Y.config.win,"," uid = 0;","","/**","The IO class is a utility that brokers HTTP requests through a simplified","interface. Specifically, it allows JavaScript to make HTTP requests to","a resource without a page reload. The underlying transport for making","same-domain requests is the XMLHttpRequest object. IO can also use","Flash, if specified as a transport, for cross-domain requests.","","@class IO","@constructor","@param {Object} config Object of EventTarget's publish method configurations"," used to configure IO's events.","**/","function IO (config) {"," var io = this;",""," io._uid = 'io:' + uid++;"," io._init(config);"," Y.io._map[io._uid] = io;","}","","IO.prototype = {"," //--------------------------------------"," // Properties"," //--------------------------------------",""," /**"," * A counter that increments for each transaction."," *"," * @property _id"," * @private"," * @type {Number}"," */"," _id: 0,",""," /**"," * Object of IO HTTP headers sent with each transaction."," *"," * @property _headers"," * @private"," * @type {Object}"," */"," _headers: {"," 'X-Requested-With' : 'XMLHttpRequest'"," },",""," /**"," * Object that stores timeout values for any transaction with a defined"," * \"timeout\" configuration property."," *"," * @property _timeout"," * @private"," * @type {Object}"," */"," _timeout: {},",""," //--------------------------------------"," // Methods"," //--------------------------------------",""," _init: function(config) {"," var io = this, i, len;",""," io.cfg = config || {};",""," Y.augment(io, Y.EventTarget);"," for (i = 0, len = EVENTS.length; i < len; ++i) {"," // Publish IO global events with configurations, if any."," // IO global events are set to broadcast by default."," // These events use the \"io:\" namespace."," io.publish('io:' + EVENTS[i], Y.merge({ broadcast: 1 }, config));"," // Publish IO transaction events with configurations, if"," // any. These events use the \"io-trn:\" namespace."," io.publish('io-trn:' + EVENTS[i], config);"," }"," },",""," /**"," * Method that creates a unique transaction object for each request."," *"," * @method _create"," * @private"," * @param {Object} cfg Configuration object subset to determine if"," * the transaction is an XDR or file upload,"," * requiring an alternate transport."," * @param {Number} id Transaction id"," * @return {Object} The transaction object"," */"," _create: function(config, id) {"," var io = this,"," transaction = {"," id : Y.Lang.isNumber(id) ? id : io._id++,"," uid: io._uid"," },"," alt = config.xdr ? config.xdr.use : null,"," form = config.form && config.form.upload ? 'iframe' : null,"," use;",""," if (alt === 'native') {"," // Non-IE can use XHR level 2 and not rely on an"," // external transport."," alt = Y.UA.ie ? 'xdr' : null;",""," // Prevent \"pre-flight\" OPTIONS request by removing the"," // `X-Requested-With` HTTP header from CORS requests. This header"," // can be added back on a per-request basis, if desired."," io.setHeader('X-Requested-With');"," }",""," use = alt || form;"," transaction = use ? Y.merge(Y.IO.customTransport(use), transaction) :"," Y.merge(Y.IO.defaultTransport(), transaction);",""," if (transaction.notify) {"," config.notify = function (e, t, c) { io.notify(e, t, c); };"," }",""," if (!use) {"," if (win && win.FormData && config.data instanceof win.FormData) {"," transaction.c.upload.onprogress = function (e) {"," io.progress(transaction, e, config);"," };"," transaction.c.onload = function (e) {"," io.load(transaction, e, config);"," };"," transaction.c.onerror = function (e) {"," io.error(transaction, e, config);"," };"," transaction.upload = true;"," }"," }",""," return transaction;"," },",""," _destroy: function(transaction) {"," if (win && !transaction.notify && !transaction.xdr) {"," if (XHR && !transaction.upload) {"," transaction.c.onreadystatechange = null;"," } else if (transaction.upload) {"," transaction.c.upload.onprogress = null;"," transaction.c.onload = null;"," transaction.c.onerror = null;"," } else if (Y.UA.ie && !transaction.e) {"," // IE, when using XMLHttpRequest as an ActiveX Object, will throw"," // a \"Type Mismatch\" error if the event handler is set to \"null\"."," transaction.c.abort();"," }"," }",""," transaction = transaction.c = null;"," },",""," /**"," * Method for creating and firing events."," *"," * @method _evt"," * @private"," * @param {String} eventName Event to be published."," * @param {Object} transaction Transaction object."," * @param {Object} config Configuration data subset for event subscription."," */"," _evt: function(eventName, transaction, config) {"," var io = this, params,"," args = config['arguments'],"," emitFacade = io.cfg.emitFacade,"," globalEvent = \"io:\" + eventName,"," trnEvent = \"io-trn:\" + eventName;",""," // Workaround for #2532107"," this.detach(trnEvent);",""," if (transaction.e) {"," transaction.c = { status: 0, statusText: transaction.e };"," }",""," // Fire event with parameters or an Event Facade."," params = [ emitFacade ?"," {"," id: transaction.id,"," data: transaction.c,"," cfg: config,"," 'arguments': args"," } :"," transaction.id"," ];",""," if (!emitFacade) {"," if (eventName === EVENTS[0] || eventName === EVENTS[2]) {"," if (args) {"," params.push(args);"," }"," } else {"," if (transaction.evt) {"," params.push(transaction.evt);"," } else {"," params.push(transaction.c);"," }"," if (args) {"," params.push(args);"," }"," }"," }",""," params.unshift(globalEvent);"," // Fire global events."," io.fire.apply(io, params);"," // Fire transaction events, if receivers are defined."," if (config.on) {"," params[0] = trnEvent;"," io.once(trnEvent, config.on[eventName], config.context || Y);"," io.fire.apply(io, params);"," }"," },",""," /**"," * Fires event \"io:start\" and creates, fires a transaction-specific"," * start event, if `config.on.start` is defined."," *"," * @method start"," * @param {Object} transaction Transaction object."," * @param {Object} config Configuration object for the transaction."," */"," start: function(transaction, config) {"," /**"," * Signals the start of an IO request."," * @event io:start"," */"," this._evt(EVENTS[0], transaction, config);"," },",""," /**"," * Fires event \"io:complete\" and creates, fires a"," * transaction-specific \"complete\" event, if config.on.complete is"," * defined."," *"," * @method complete"," * @param {Object} transaction Transaction object."," * @param {Object} config Configuration object for the transaction."," */"," complete: function(transaction, config) {"," /**"," * Signals the completion of the request-response phase of a"," * transaction. Response status and data are accessible, if"," * available, in this event."," * @event io:complete"," */"," this._evt(EVENTS[1], transaction, config);"," },",""," /**"," * Fires event \"io:end\" and creates, fires a transaction-specific \"end\""," * event, if config.on.end is defined."," *"," * @method end"," * @param {Object} transaction Transaction object."," * @param {Object} config Configuration object for the transaction."," */"," end: function(transaction, config) {"," /**"," * Signals the end of the transaction lifecycle."," * @event io:end"," */"," this._evt(EVENTS[2], transaction, config);"," this._destroy(transaction);"," },",""," /**"," * Fires event \"io:success\" and creates, fires a transaction-specific"," * \"success\" event, if config.on.success is defined."," *"," * @method success"," * @param {Object} transaction Transaction object."," * @param {Object} config Configuration object for the transaction."," */"," success: function(transaction, config) {"," /**"," * Signals an HTTP response with status in the 2xx range."," * Fires after io:complete."," * @event io:success"," */"," this._evt(EVENTS[3], transaction, config);"," this.end(transaction, config);"," },",""," /**"," * Fires event \"io:failure\" and creates, fires a transaction-specific"," * \"failure\" event, if config.on.failure is defined."," *"," * @method failure"," * @param {Object} transaction Transaction object."," * @param {Object} config Configuration object for the transaction."," */"," failure: function(transaction, config) {"," /**"," * Signals an HTTP response with status outside of the 2xx range."," * Fires after io:complete."," * @event io:failure"," */"," this._evt(EVENTS[4], transaction, config);"," this.end(transaction, config);"," },",""," /**"," * Fires event \"io:progress\" and creates, fires a transaction-specific"," * \"progress\" event -- for XMLHttpRequest file upload -- if"," * config.on.progress is defined."," *"," * @method progress"," * @param {Object} transaction Transaction object."," * @param {Object} progress event."," * @param {Object} config Configuration object for the transaction."," */"," progress: function(transaction, e, config) {"," /**"," * Signals the interactive state during a file upload transaction."," * This event fires after io:start and before io:complete."," * @event io:progress"," */"," transaction.evt = e;"," this._evt(EVENTS[5], transaction, config);"," },",""," /**"," * Fires event \"io:complete\" and creates, fires a transaction-specific"," * \"complete\" event -- for XMLHttpRequest file upload -- if"," * config.on.complete is defined."," *"," * @method load"," * @param {Object} transaction Transaction object."," * @param {Object} load event."," * @param {Object} config Configuration object for the transaction."," */"," load: function (transaction, e, config) {"," transaction.evt = e.target;"," this._evt(EVENTS[1], transaction, config);"," },",""," /**"," * Fires event \"io:failure\" and creates, fires a transaction-specific"," * \"failure\" event -- for XMLHttpRequest file upload -- if"," * config.on.failure is defined."," *"," * @method error"," * @param {Object} transaction Transaction object."," * @param {Object} error event."," * @param {Object} config Configuration object for the transaction."," */"," error: function (transaction, e, config) {"," transaction.evt = e;"," this._evt(EVENTS[4], transaction, config);"," },",""," /**"," * Retry an XDR transaction, using the Flash tranport, if the native"," * transport fails."," *"," * @method _retry"," * @private"," * @param {Object} transaction Transaction object."," * @param {String} uri Qualified path to transaction resource."," * @param {Object} config Configuration object for the transaction."," */"," _retry: function(transaction, uri, config) {"," this._destroy(transaction);"," config.xdr.use = 'flash';"," return this.send(uri, config, transaction.id);"," },",""," /**"," * Method that concatenates string data for HTTP GET transactions."," *"," * @method _concat"," * @private"," * @param {String} uri URI or root data."," * @param {String} data Data to be concatenated onto URI."," * @return {String}"," */"," _concat: function(uri, data) {"," uri += (uri.indexOf('?') === -1 ? '?' : '&') + data;"," return uri;"," },",""," /**"," * Stores default client headers for all transactions. If a label is"," * passed with no value argument, the header will be deleted."," *"," * @method setHeader"," * @param {String} name HTTP header"," * @param {String} value HTTP header value"," */"," setHeader: function(name, value) {"," if (value) {"," this._headers[name] = value;"," } else {"," delete this._headers[name];"," }"," },",""," /**"," * Method that sets all HTTP headers to be sent in a transaction."," *"," * @method _setHeaders"," * @private"," * @param {Object} transaction - XHR instance for the specific transaction."," * @param {Object} headers - HTTP headers for the specific transaction, as"," * defined in the configuration object passed to YUI.io()."," */"," _setHeaders: function(transaction, headers) {"," headers = Y.merge(this._headers, headers);"," Y.Object.each(headers, function(value, name) {"," if (value !== 'disable') {"," transaction.setRequestHeader(name, headers[name]);"," }"," });"," },",""," /**"," * Starts timeout count if the configuration object has a defined"," * timeout property."," *"," * @method _startTimeout"," * @private"," * @param {Object} transaction Transaction object generated by _create()."," * @param {Object} timeout Timeout in milliseconds."," */"," _startTimeout: function(transaction, timeout) {"," var io = this;",""," io._timeout[transaction.id] = setTimeout(function() {"," io._abort(transaction, 'timeout');"," }, timeout);"," },",""," /**"," * Clears the timeout interval started by _startTimeout()."," *"," * @method _clearTimeout"," * @private"," * @param {Number} id - Transaction id."," */"," _clearTimeout: function(id) {"," clearTimeout(this._timeout[id]);"," delete this._timeout[id];"," },",""," /**"," * Method that determines if a transaction response qualifies as success"," * or failure, based on the response HTTP status code, and fires the"," * appropriate success or failure events."," *"," * @method _result"," * @private"," * @static"," * @param {Object} transaction Transaction object generated by _create()."," * @param {Object} config Configuration object passed to io()."," */"," _result: function(transaction, config) {"," var status;"," // Firefox will throw an exception if attempting to access"," // an XHR object's status property, after a request is aborted."," try {"," status = transaction.c.status;"," } catch(e) {"," status = 0;"," }",""," // IE reports HTTP 204 as HTTP 1223."," if (status >= 200 && status < 300 || status === 304 || status === 1223) {"," this.success(transaction, config);"," } else {"," this.failure(transaction, config);"," }"," },",""," /**"," * Event handler bound to onreadystatechange."," *"," * @method _rS"," * @private"," * @param {Object} transaction Transaction object generated by _create()."," * @param {Object} config Configuration object passed to YUI.io()."," */"," _rS: function(transaction, config) {"," var io = this;",""," if (transaction.c.readyState === 4) {"," if (config.timeout) {"," io._clearTimeout(transaction.id);"," }",""," // Yield in the event of request timeout or abort."," setTimeout(function() {"," io.complete(transaction, config);"," io._result(transaction, config);"," }, 0);"," }"," },",""," /**"," * Terminates a transaction due to an explicit abort or timeout."," *"," * @method _abort"," * @private"," * @param {Object} transaction Transaction object generated by _create()."," * @param {String} type Identifies timed out or aborted transaction."," */"," _abort: function(transaction, type) {"," if (transaction && transaction.c) {"," transaction.e = type;"," transaction.c.abort();"," }"," },",""," /**"," * Requests a transaction. `send()` is implemented as `Y.io()`. Each"," * transaction may include a configuration object. Its properties are:"," *"," * <dl>"," * <dt>method</dt>"," * <dd>HTTP method verb (e.g., GET or POST). If this property is not"," * not defined, the default value will be GET.</dd>"," *"," * <dt>data</dt>"," * <dd>This is the name-value string that will be sent as the"," * transaction data. If the request is HTTP GET, the data become"," * part of querystring. If HTTP POST, the data are sent in the"," * message body.</dd>"," *"," * <dt>xdr</dt>"," * <dd>Defines the transport to be used for cross-domain requests."," * By setting this property, the transaction will use the specified"," * transport instead of XMLHttpRequest. The properties of the"," * transport object are:"," * <dl>"," * <dt>use</dt>"," * <dd>The transport to be used: 'flash' or 'native'</dd>"," * <dt>dataType</dt>"," * <dd>Set the value to 'XML' if that is the expected response"," * content type.</dd>"," * </dl></dd>"," *"," * <dt>form</dt>"," * <dd>Form serialization configuration object. Its properties are:"," * <dl>"," * <dt>id</dt>"," * <dd>Node object or id of HTML form</dd>"," * <dt>useDisabled</dt>"," * <dd>`true` to also serialize disabled form field values"," * (defaults to `false`)</dd>"," * </dl></dd>"," *"," * <dt>on</dt>"," * <dd>Assigns transaction event subscriptions. Available events are:"," * <dl>"," * <dt>start</dt>"," * <dd>Fires when a request is sent to a resource.</dd>"," * <dt>complete</dt>"," * <dd>Fires when the transaction is complete.</dd>"," * <dt>success</dt>"," * <dd>Fires when the HTTP response status is within the 2xx"," * range.</dd>"," * <dt>failure</dt>"," * <dd>Fires when the HTTP response status is outside the 2xx"," * range, if an exception occurs, if the transation is aborted,"," * or if the transaction exceeds a configured `timeout`.</dd>"," * <dt>end</dt>"," * <dd>Fires at the conclusion of the transaction"," * lifecycle, after `success` or `failure`.</dd>"," * </dl>"," *"," * <p>Callback functions for `start` and `end` receive the id of the"," * transaction as a first argument. For `complete`, `success`, and"," * `failure`, callbacks receive the id and the response object"," * (usually the XMLHttpRequest instance). If the `arguments`"," * property was included in the configuration object passed to"," * `Y.io()`, the configured data will be passed to all callbacks as"," * the last argument.</p>"," * </dd>"," *"," * <dt>sync</dt>"," * <dd>Pass `true` to make a same-domain transaction synchronous."," * <strong>CAVEAT</strong>: This will negatively impact the user"," * experience. Have a <em>very</em> good reason if you intend to use"," * this.</dd>"," *"," * <dt>context</dt>"," * <dd>The \"`this'\" object for all configured event handlers. If a"," * specific context is needed for individual callbacks, bind the"," * callback to a context using `Y.bind()`.</dd>"," *"," * <dt>headers</dt>"," * <dd>Object map of transaction headers to send to the server. The"," * object keys are the header names and the values are the header"," * values.</dd>"," *"," * <dt>timeout</dt>"," * <dd>Millisecond threshold for the transaction before being"," * automatically aborted.</dd>"," *"," * <dt>arguments</dt>"," * <dd>User-defined data passed to all registered event handlers."," * This value is available as the second argument in the \"start\" and"," * \"end\" event handlers. It is the third argument in the \"complete\","," * \"success\", and \"failure\" event handlers. <strong>Be sure to quote"," * this property name in the transaction configuration as"," * \"arguments\" is a reserved word in JavaScript</strong> (e.g."," * `Y.io({ ..., \"arguments\": stuff })`).</dd>"," * </dl>"," *"," * @method send"," * @public"," * @param {String} uri Qualified path to transaction resource."," * @param {Object} config Configuration object for the transaction."," * @param {Number} id Transaction id, if already set."," * @return {Object}"," */"," send: function(uri, config, id) {"," var transaction, method, i, len, sync, data,"," io = this,"," u = uri,"," response = {};",""," config = config ? Y.Object(config) : {};"," transaction = io._create(config, id);"," method = config.method ? config.method.toUpperCase() : 'GET';"," sync = config.sync;"," data = config.data;",""," // Serialize an map object into a key-value string using"," // querystring-stringify-simple."," if ((Y.Lang.isObject(data) && !data.nodeType) && !transaction.upload) {"," data = Y.QueryString.stringify(data);"," }",""," if (config.form) {"," if (config.form.upload) {"," // This is a file upload transaction, calling"," // upload() in io-upload-iframe."," return io.upload(transaction, uri, config);"," } else {"," // Serialize HTML form data into a key-value string."," data = io._serialize(config.form, data);"," }"," }",""," if (data) {"," switch (method) {"," case 'GET':"," case 'HEAD':"," case 'DELETE':"," u = io._concat(u, data);"," data = '';"," break;"," case 'POST':"," case 'PUT':"," // If Content-Type is defined in the configuration object, or"," // or as a default header, it will be used instead of"," // 'application/x-www-form-urlencoded; charset=UTF-8'"," config.headers = Y.merge({"," 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'"," }, config.headers);"," break;"," }"," }",""," if (transaction.xdr) {"," // Route data to io-xdr module for flash and XDomainRequest."," return io.xdr(u, transaction, config);"," }"," else if (transaction.notify) {"," // Route data to custom transport"," return transaction.c.send(transaction, uri, config);"," }",""," if (!sync && !transaction.upload) {"," transaction.c.onreadystatechange = function() {"," io._rS(transaction, config);"," };"," }",""," try {"," // Determine if request is to be set as"," // synchronous or asynchronous."," transaction.c.open(method, u, !sync, config.username || null, config.password || null);"," io._setHeaders(transaction.c, config.headers || {});"," io.start(transaction, config);",""," // Will work only in browsers that implement the"," // Cross-Origin Resource Sharing draft."," if (config.xdr && config.xdr.credentials) {"," if (!Y.UA.ie) {"," transaction.c.withCredentials = true;"," }"," }",""," // Using \"null\" with HTTP POST will result in a request"," // with no Content-Length header defined."," transaction.c.send(data);",""," if (sync) {"," // Create a response object for synchronous transactions,"," // mixing id and arguments properties with the xhr"," // properties whitelist."," for (i = 0, len = XHR_PROPS.length; i < len; ++i) {"," response[XHR_PROPS[i]] = transaction.c[XHR_PROPS[i]];"," }",""," response.getAllResponseHeaders = function() {"," return transaction.c.getAllResponseHeaders();"," };",""," response.getResponseHeader = function(name) {"," return transaction.c.getResponseHeader(name);"," };",""," io.complete(transaction, config);"," io._result(transaction, config);",""," return response;"," }"," } catch(e) {"," if (transaction.xdr) {"," // This exception is usually thrown by browsers"," // that do not support XMLHttpRequest Level 2."," // Retry the request with the XDR transport set"," // to 'flash'. If the Flash transport is not"," // initialized or available, the transaction"," // will resolve to a transport error."," return io._retry(transaction, uri, config);"," } else {"," io.complete(transaction, config);"," io._result(transaction, config);"," }"," }",""," // If config.timeout is defined, and the request is standard XHR,"," // initialize timeout polling."," if (config.timeout) {"," io._startTimeout(transaction, config.timeout);"," }",""," return {"," id: transaction.id,"," abort: function() {"," return transaction.c ? io._abort(transaction, 'abort') : false;"," },"," isInProgress: function() {"," return transaction.c ? (transaction.c.readyState % 4) : false;"," },"," io: io"," };"," }","};","","/**","Method for initiating an ajax call. The first argument is the url end","point for the call. The second argument is an object to configure the","transaction and attach event subscriptions. The configuration object","supports the following properties:","","<dl>"," <dt>method</dt>"," <dd>HTTP method verb (e.g., GET or POST). If this property is not"," not defined, the default value will be GET.</dd>",""," <dt>data</dt>"," <dd>This is the name-value string that will be sent as the"," transaction data. If the request is HTTP GET, the data become"," part of querystring. If HTTP POST, the data are sent in the"," message body.</dd>",""," <dt>xdr</dt>"," <dd>Defines the transport to be used for cross-domain requests."," By setting this property, the transaction will use the specified"," transport instead of XMLHttpRequest. The properties of the"," transport object are:"," <dl>"," <dt>use</dt>"," <dd>The transport to be used: 'flash' or 'native'</dd>"," <dt>dataType</dt>"," <dd>Set the value to 'XML' if that is the expected response"," content type.</dd>"," </dl></dd>",""," <dt>form</dt>"," <dd>Form serialization configuration object. Its properties are:"," <dl>"," <dt>id</dt>"," <dd>Node object or id of HTML form</dd>"," <dt>useDisabled</dt>"," <dd>`true` to also serialize disabled form field values"," (defaults to `false`)</dd>"," </dl></dd>",""," <dt>on</dt>"," <dd>Assigns transaction event subscriptions. Available events are:"," <dl>"," <dt>start</dt>"," <dd>Fires when a request is sent to a resource.</dd>"," <dt>complete</dt>"," <dd>Fires when the transaction is complete.</dd>"," <dt>success</dt>"," <dd>Fires when the HTTP response status is within the 2xx"," range.</dd>"," <dt>failure</dt>"," <dd>Fires when the HTTP response status is outside the 2xx"," range, if an exception occurs, if the transation is aborted,"," or if the transaction exceeds a configured `timeout`.</dd>"," <dt>end</dt>"," <dd>Fires at the conclusion of the transaction"," lifecycle, after `success` or `failure`.</dd>"," </dl>",""," <p>Callback functions for `start` and `end` receive the id of the"," transaction as a first argument. For `complete`, `success`, and"," `failure`, callbacks receive the id and the response object"," (usually the XMLHttpRequest instance). If the `arguments`"," property was included in the configuration object passed to"," `Y.io()`, the configured data will be passed to all callbacks as"," the last argument.</p>"," </dd>",""," <dt>sync</dt>"," <dd>Pass `true` to make a same-domain transaction synchronous."," <strong>CAVEAT</strong>: This will negatively impact the user"," experience. Have a <em>very</em> good reason if you intend to use"," this.</dd>",""," <dt>context</dt>"," <dd>The \"`this'\" object for all configured event handlers. If a"," specific context is needed for individual callbacks, bind the"," callback to a context using `Y.bind()`.</dd>",""," <dt>headers</dt>"," <dd>Object map of transaction headers to send to the server. The"," object keys are the header names and the values are the header"," values.</dd>",""," <dt>timeout</dt>"," <dd>Millisecond threshold for the transaction before being"," automatically aborted.</dd>",""," <dt>arguments</dt>"," <dd>User-defined data passed to all registered event handlers."," This value is available as the second argument in the \"start\" and"," \"end\" event handlers. It is the third argument in the \"complete\","," \"success\", and \"failure\" event handlers. <strong>Be sure to quote"," this property name in the transaction configuration as"," \"arguments\" is a reserved word in JavaScript</strong> (e.g."," `Y.io({ ..., \"arguments\": stuff })`).</dd>","</dl>","","@method io","@static","@param {String} url qualified path to transaction resource.","@param {Object} config configuration object for the transaction.","@return {Object}","@for YUI","**/","Y.io = function(url, config) {"," // Calling IO through the static interface will use and reuse"," // an instance of IO."," var transaction = Y.io._map['io:0'] || new IO();"," return transaction.send.apply(transaction, [url, config]);","};","","/**","Method for setting and deleting IO HTTP headers to be sent with every","request.","","Hosted as a property on the `io` function (e.g. `Y.io.header`).","","@method header","@param {String} name HTTP header","@param {String} value HTTP header value","@static","**/","Y.io.header = function(name, value) {"," // Calling IO through the static interface will use and reuse"," // an instance of IO."," var transaction = Y.io._map['io:0'] || new IO();"," transaction.setHeader(name, value);","};","","Y.IO = IO;","// Map of all IO instances created.","Y.io._map = {};","var XHR = win && win.XMLHttpRequest,"," XDR = win && win.XDomainRequest,"," AX = win && win.ActiveXObject;","","","Y.mix(Y.IO, {"," /**"," * The ID of the default IO transport, defaults to `xhr`"," * @property _default"," * @type {String}"," * @static"," */"," _default: 'xhr',"," /**"," *"," * @method defaultTransport"," * @static"," * @param {String} [id] The transport to set as the default, if empty a new transport is created."," * @return {Object} The transport object with a `send` method"," */"," defaultTransport: function(id) {"," if (id) {"," Y.IO._default = id;"," } else {"," var o = {"," c: Y.IO.transports[Y.IO._default](),"," notify: Y.IO._default === 'xhr' ? false : true"," };"," return o;"," }"," },"," /**"," * An object hash of custom transports available to IO"," * @property transports"," * @type {Object}"," * @static"," */"," transports: {"," xhr: function () {"," return XHR ? new XMLHttpRequest() :"," AX ? new ActiveXObject('Microsoft.XMLHTTP') : null;"," },"," xdr: function () {"," return XDR ? new XDomainRequest() : null;"," },"," iframe: function () { return {}; },"," flash: null,"," nodejs: null"," },"," /**"," * Create a custom transport of type and return it's object"," * @method customTransport"," * @param {String} id The id of the transport to create."," * @static"," */"," customTransport: function(id) {"," var o = { c: Y.IO.transports[id]() };",""," o[(id === 'xdr' || id === 'flash') ? 'xdr' : 'notify'] = true;"," return o;"," }","});","","Y.mix(Y.IO.prototype, {"," /**"," * Fired from the notify method of the transport which in turn fires"," * the event on the IO object."," * @method notify"," * @param {String} event The name of the event"," * @param {Object} transaction The transaction object"," * @param {Object} config The configuration object for this transaction"," */"," notify: function(event, transaction, config) {"," var io = this;",""," switch (event) {"," case 'timeout':"," case 'abort':"," case 'transport error':"," transaction.c = { status: 0, statusText: event };"," event = 'failure';"," default:"," io[event].apply(io, [transaction, config]);"," }"," }","});","","","","","}, '@VERSION@', {\"requires\": [\"event-custom-base\", \"querystring-stringify-simple\"]});"];
_yuitest_coverage["build/io-base/io-base.js"].lines = {"1":0,"11":0,"32":0,"33":0,"35":0,"36":0,"37":0,"40":0,"80":0,"82":0,"84":0,"85":0,"89":0,"92":0,"108":0,"117":0,"120":0,"125":0,"128":0,"129":0,"132":0,"133":0,"136":0,"137":0,"138":0,"139":0,"141":0,"142":0,"144":0,"145":0,"147":0,"151":0,"155":0,"156":0,"157":0,"158":0,"159":0,"160":0,"161":0,"162":0,"165":0,"169":0,"182":0,"189":0,"191":0,"192":0,"196":0,"206":0,"207":0,"208":0,"209":0,"212":0,"213":0,"215":0,"217":0,"218":0,"223":0,"225":0,"227":0,"228":0,"229":0,"230":0,"247":0,"266":0,"282":0,"283":0,"300":0,"301":0,"318":0,"319":0,"338":0,"339":0,"353":0,"354":0,"368":0,"369":0,"383":0,"384":0,"385":0,"398":0,"399":0,"411":0,"412":0,"414":0,"428":0,"429":0,"430":0,"431":0,"446":0,"448":0,"449":0,"461":0,"462":0,"477":0,"480":0,"481":0,"483":0,"487":0,"488":0,"490":0,"503":0,"505":0,"506":0,"507":0,"511":0,"512":0,"513":0,"527":0,"528":0,"529":0,"637":0,"642":0,"643":0,"644":0,"645":0,"646":0,"650":0,"651":0,"654":0,"655":0,"658":0,"661":0,"665":0,"666":0,"670":0,"671":0,"672":0,"678":0,"681":0,"685":0,"687":0,"689":0,"691":0,"694":0,"695":0,"696":0,"700":0,"703":0,"704":0,"705":0,"709":0,"710":0,"711":0,"717":0,"719":0,"723":0,"724":0,"727":0,"728":0,"731":0,"732":0,"735":0,"736":0,"738":0,"741":0,"748":0,"750":0,"751":0,"757":0,"758":0,"761":0,"764":0,"767":0,"879":0,"882":0,"883":0,"897":0,"900":0,"901":0,"904":0,"906":0,"907":0,"912":0,"928":0,"929":0,"931":0,"935":0,"946":0,"950":0,"952":0,"963":0,"965":0,"966":0,"970":0,"980":0,"982":0,"986":0,"987":0,"989":0};
_yuitest_coverage["build/io-base/io-base.js"].functions = {"IO:32":0,"_init:79":0,"notify:133":0,"onprogress:138":0,"onload:141":0,"onerror:144":0,"_create:107":0,"_destroy:154":0,"_evt:181":0,"start:242":0,"complete:259":0,"end:277":0,"success:294":0,"failure:312":0,"progress:332":0,"load:352":0,"error:367":0,"_retry:382":0,"_concat:397":0,"setHeader:410":0,"(anonymous 2):429":0,"_setHeaders:427":0,"(anonymous 3):448":0,"_startTimeout:445":0,"_clearTimeout:460":0,"_result:476":0,"(anonymous 4):511":0,"_rS:502":0,"_abort:526":0,"onreadystatechange:695":0,"getAllResponseHeaders:727":0,"getResponseHeader:731":0,"abort:763":0,"isInProgress:766":0,"send:636":0,"io:879":0,"header:897":0,"defaultTransport:927":0,"xhr:945":0,"xdr:949":0,"iframe:952":0,"customTransport:962":0,"notify:979":0,"(anonymous 1):1":0};
_yuitest_coverage["build/io-base/io-base.js"].coveredLines = 189;
_yuitest_coverage["build/io-base/io-base.js"].coveredFunctions = 44;
_yuitest_coverline("build/io-base/io-base.js", 1);
YUI.add('io-base', function (Y, NAME) {
/**
Base IO functionality. Provides basic XHR transport support.
@module io
@submodule io-base
@for IO
**/
_yuitest_coverfunc("build/io-base/io-base.js", "(anonymous 1)", 1);
_yuitest_coverline("build/io-base/io-base.js", 11);
var // List of events that comprise the IO event lifecycle.
EVENTS = ['start', 'complete', 'end', 'success', 'failure', 'progress'],
// Whitelist of used XHR response object properties.
XHR_PROPS = ['status', 'statusText', 'responseText', 'responseXML'],
win = Y.config.win,
uid = 0;
/**
The IO class is a utility that brokers HTTP requests through a simplified
interface. Specifically, it allows JavaScript to make HTTP requests to
a resource without a page reload. The underlying transport for making
same-domain requests is the XMLHttpRequest object. IO can also use
Flash, if specified as a transport, for cross-domain requests.
@class IO
@constructor
@param {Object} config Object of EventTarget's publish method configurations
used to configure IO's events.
**/
_yuitest_coverline("build/io-base/io-base.js", 32);
function IO (config) {
_yuitest_coverfunc("build/io-base/io-base.js", "IO", 32);
_yuitest_coverline("build/io-base/io-base.js", 33);
var io = this;
_yuitest_coverline("build/io-base/io-base.js", 35);
io._uid = 'io:' + uid++;
_yuitest_coverline("build/io-base/io-base.js", 36);
io._init(config);
_yuitest_coverline("build/io-base/io-base.js", 37);
Y.io._map[io._uid] = io;
}
_yuitest_coverline("build/io-base/io-base.js", 40);
IO.prototype = {
//--------------------------------------
// Properties
//--------------------------------------
/**
* A counter that increments for each transaction.
*
* @property _id
* @private
* @type {Number}
*/
_id: 0,
/**
* Object of IO HTTP headers sent with each transaction.
*
* @property _headers
* @private
* @type {Object}
*/
_headers: {
'X-Requested-With' : 'XMLHttpRequest'
},
/**
* Object that stores timeout values for any transaction with a defined
* "timeout" configuration property.
*
* @property _timeout
* @private
* @type {Object}
*/
_timeout: {},
//--------------------------------------
// Methods
//--------------------------------------
_init: function(config) {
_yuitest_coverfunc("build/io-base/io-base.js", "_init", 79);
_yuitest_coverline("build/io-base/io-base.js", 80);
var io = this, i, len;
_yuitest_coverline("build/io-base/io-base.js", 82);
io.cfg = config || {};
_yuitest_coverline("build/io-base/io-base.js", 84);
Y.augment(io, Y.EventTarget);
_yuitest_coverline("build/io-base/io-base.js", 85);
for (i = 0, len = EVENTS.length; i < len; ++i) {
// Publish IO global events with configurations, if any.
// IO global events are set to broadcast by default.
// These events use the "io:" namespace.
_yuitest_coverline("build/io-base/io-base.js", 89);
io.publish('io:' + EVENTS[i], Y.merge({ broadcast: 1 }, config));
// Publish IO transaction events with configurations, if
// any. These events use the "io-trn:" namespace.
_yuitest_coverline("build/io-base/io-base.js", 92);
io.publish('io-trn:' + EVENTS[i], config);
}
},
/**
* Method that creates a unique transaction object for each request.
*
* @method _create
* @private
* @param {Object} cfg Configuration object subset to determine if
* the transaction is an XDR or file upload,
* requiring an alternate transport.
* @param {Number} id Transaction id
* @return {Object} The transaction object
*/
_create: function(config, id) {
_yuitest_coverfunc("build/io-base/io-base.js", "_create", 107);
_yuitest_coverline("build/io-base/io-base.js", 108);
var io = this,
transaction = {
id : Y.Lang.isNumber(id) ? id : io._id++,
uid: io._uid
},
alt = config.xdr ? config.xdr.use : null,
form = config.form && config.form.upload ? 'iframe' : null,
use;
_yuitest_coverline("build/io-base/io-base.js", 117);
if (alt === 'native') {
// Non-IE can use XHR level 2 and not rely on an
// external transport.
_yuitest_coverline("build/io-base/io-base.js", 120);
alt = Y.UA.ie ? 'xdr' : null;
// Prevent "pre-flight" OPTIONS request by removing the
// `X-Requested-With` HTTP header from CORS requests. This header
// can be added back on a per-request basis, if desired.
_yuitest_coverline("build/io-base/io-base.js", 125);
io.setHeader('X-Requested-With');
}
_yuitest_coverline("build/io-base/io-base.js", 128);
use = alt || form;
_yuitest_coverline("build/io-base/io-base.js", 129);
transaction = use ? Y.merge(Y.IO.customTransport(use), transaction) :
Y.merge(Y.IO.defaultTransport(), transaction);
_yuitest_coverline("build/io-base/io-base.js", 132);
if (transaction.notify) {
_yuitest_coverline("build/io-base/io-base.js", 133);
config.notify = function (e, t, c) { _yuitest_coverfunc("build/io-base/io-base.js", "notify", 133);
io.notify(e, t, c); };
}
_yuitest_coverline("build/io-base/io-base.js", 136);
if (!use) {
_yuitest_coverline("build/io-base/io-base.js", 137);
if (win && win.FormData && config.data instanceof win.FormData) {
_yuitest_coverline("build/io-base/io-base.js", 138);
transaction.c.upload.onprogress = function (e) {
_yuitest_coverfunc("build/io-base/io-base.js", "onprogress", 138);
_yuitest_coverline("build/io-base/io-base.js", 139);
io.progress(transaction, e, config);
};
_yuitest_coverline("build/io-base/io-base.js", 141);
transaction.c.onload = function (e) {
_yuitest_coverfunc("build/io-base/io-base.js", "onload", 141);
_yuitest_coverline("build/io-base/io-base.js", 142);
io.load(transaction, e, config);
};
_yuitest_coverline("build/io-base/io-base.js", 144);
transaction.c.onerror = function (e) {
_yuitest_coverfunc("build/io-base/io-base.js", "onerror", 144);
_yuitest_coverline("build/io-base/io-base.js", 145);
io.error(transaction, e, config);
};
_yuitest_coverline("build/io-base/io-base.js", 147);
transaction.upload = true;
}
}
_yuitest_coverline("build/io-base/io-base.js", 151);
return transaction;
},
_destroy: function(transaction) {
_yuitest_coverfunc("build/io-base/io-base.js", "_destroy", 154);
_yuitest_coverline("build/io-base/io-base.js", 155);
if (win && !transaction.notify && !transaction.xdr) {
_yuitest_coverline("build/io-base/io-base.js", 156);
if (XHR && !transaction.upload) {
_yuitest_coverline("build/io-base/io-base.js", 157);
transaction.c.onreadystatechange = null;
} else {_yuitest_coverline("build/io-base/io-base.js", 158);
if (transaction.upload) {
_yuitest_coverline("build/io-base/io-base.js", 159);
transaction.c.upload.onprogress = null;
_yuitest_coverline("build/io-base/io-base.js", 160);
transaction.c.onload = null;
_yuitest_coverline("build/io-base/io-base.js", 161);
transaction.c.onerror = null;
} else {_yuitest_coverline("build/io-base/io-base.js", 162);
if (Y.UA.ie && !transaction.e) {
// IE, when using XMLHttpRequest as an ActiveX Object, will throw
// a "Type Mismatch" error if the event handler is set to "null".
_yuitest_coverline("build/io-base/io-base.js", 165);
transaction.c.abort();
}}}
}
_yuitest_coverline("build/io-base/io-base.js", 169);
transaction = transaction.c = null;
},
/**
* Method for creating and firing events.
*
* @method _evt
* @private
* @param {String} eventName Event to be published.
* @param {Object} transaction Transaction object.
* @param {Object} config Configuration data subset for event subscription.
*/
_evt: function(eventName, transaction, config) {
_yuitest_coverfunc("build/io-base/io-base.js", "_evt", 181);
_yuitest_coverline("build/io-base/io-base.js", 182);
var io = this, params,
args = config['arguments'],
emitFacade = io.cfg.emitFacade,
globalEvent = "io:" + eventName,
trnEvent = "io-trn:" + eventName;
// Workaround for #2532107
_yuitest_coverline("build/io-base/io-base.js", 189);
this.detach(trnEvent);
_yuitest_coverline("build/io-base/io-base.js", 191);
if (transaction.e) {
_yuitest_coverline("build/io-base/io-base.js", 192);
transaction.c = { status: 0, statusText: transaction.e };
}
// Fire event with parameters or an Event Facade.
_yuitest_coverline("build/io-base/io-base.js", 196);
params = [ emitFacade ?
{
id: transaction.id,
data: transaction.c,
cfg: config,
'arguments': args
} :
transaction.id
];
_yuitest_coverline("build/io-base/io-base.js", 206);
if (!emitFacade) {
_yuitest_coverline("build/io-base/io-base.js", 207);
if (eventName === EVENTS[0] || eventName === EVENTS[2]) {
_yuitest_coverline("build/io-base/io-base.js", 208);
if (args) {
_yuitest_coverline("build/io-base/io-base.js", 209);
params.push(args);
}
} else {
_yuitest_coverline("build/io-base/io-base.js", 212);
if (transaction.evt) {
_yuitest_coverline("build/io-base/io-base.js", 213);
params.push(transaction.evt);
} else {
_yuitest_coverline("build/io-base/io-base.js", 215);
params.push(transaction.c);
}
_yuitest_coverline("build/io-base/io-base.js", 217);
if (args) {
_yuitest_coverline("build/io-base/io-base.js", 218);
params.push(args);
}
}
}
_yuitest_coverline("build/io-base/io-base.js", 223);
params.unshift(globalEvent);
// Fire global events.
_yuitest_coverline("build/io-base/io-base.js", 225);
io.fire.apply(io, params);
// Fire transaction events, if receivers are defined.
_yuitest_coverline("build/io-base/io-base.js", 227);
if (config.on) {
_yuitest_coverline("build/io-base/io-base.js", 228);
params[0] = trnEvent;
_yuitest_coverline("build/io-base/io-base.js", 229);
io.once(trnEvent, config.on[eventName], config.context || Y);
_yuitest_coverline("build/io-base/io-base.js", 230);
io.fire.apply(io, params);
}
},
/**
* Fires event "io:start" and creates, fires a transaction-specific
* start event, if `config.on.start` is defined.
*
* @method start
* @param {Object} transaction Transaction object.
* @param {Object} config Configuration object for the transaction.
*/
start: function(transaction, config) {
/**
* Signals the start of an IO request.
* @event io:start
*/
_yuitest_coverfunc("build/io-base/io-base.js", "start", 242);
_yuitest_coverline("build/io-base/io-base.js", 247);
this._evt(EVENTS[0], transaction, config);
},
/**
* Fires event "io:complete" and creates, fires a
* transaction-specific "complete" event, if config.on.complete is
* defined.
*
* @method complete
* @param {Object} transaction Transaction object.
* @param {Object} config Configuration object for the transaction.
*/
complete: function(transaction, config) {
/**
* Signals the completion of the request-response phase of a
* transaction. Response status and data are accessible, if
* available, in this event.
* @event io:complete
*/
_yuitest_coverfunc("build/io-base/io-base.js", "complete", 259);
_yuitest_coverline("build/io-base/io-base.js", 266);
this._evt(EVENTS[1], transaction, config);
},
/**
* Fires event "io:end" and creates, fires a transaction-specific "end"
* event, if config.on.end is defined.
*
* @method end
* @param {Object} transaction Transaction object.
* @param {Object} config Configuration object for the transaction.
*/
end: function(transaction, config) {
/**
* Signals the end of the transaction lifecycle.
* @event io:end
*/
_yuitest_coverfunc("build/io-base/io-base.js", "end", 277);
_yuitest_coverline("build/io-base/io-base.js", 282);
this._evt(EVENTS[2], transaction, config);
_yuitest_coverline("build/io-base/io-base.js", 283);
this._destroy(transaction);
},
/**
* Fires event "io:success" and creates, fires a transaction-specific
* "success" event, if config.on.success is defined.
*
* @method success
* @param {Object} transaction Transaction object.
* @param {Object} config Configuration object for the transaction.
*/
success: function(transaction, config) {
/**
* Signals an HTTP response with status in the 2xx range.
* Fires after io:complete.
* @event io:success
*/
_yuitest_coverfunc("build/io-base/io-base.js", "success", 294);
_yuitest_coverline("build/io-base/io-base.js", 300);
this._evt(EVENTS[3], transaction, config);
_yuitest_coverline("build/io-base/io-base.js", 301);
this.end(transaction, config);
},
/**
* Fires event "io:failure" and creates, fires a transaction-specific
* "failure" event, if config.on.failure is defined.
*
* @method failure
* @param {Object} transaction Transaction object.
* @param {Object} config Configuration object for the transaction.
*/
failure: function(transaction, config) {
/**
* Signals an HTTP response with status outside of the 2xx range.
* Fires after io:complete.
* @event io:failure
*/
_yuitest_coverfunc("build/io-base/io-base.js", "failure", 312);
_yuitest_coverline("build/io-base/io-base.js", 318);
this._evt(EVENTS[4], transaction, config);
_yuitest_coverline("build/io-base/io-base.js", 319);
this.end(transaction, config);
},
/**
* Fires event "io:progress" and creates, fires a transaction-specific
* "progress" event -- for XMLHttpRequest file upload -- if
* config.on.progress is defined.
*
* @method progress
* @param {Object} transaction Transaction object.
* @param {Object} progress event.
* @param {Object} config Configuration object for the transaction.
*/
progress: function(transaction, e, config) {
/**
* Signals the interactive state during a file upload transaction.
* This event fires after io:start and before io:complete.
* @event io:progress
*/
_yuitest_coverfunc("build/io-base/io-base.js", "progress", 332);
_yuitest_coverline("build/io-base/io-base.js", 338);
transaction.evt = e;
_yuitest_coverline("build/io-base/io-base.js", 339);
this._evt(EVENTS[5], transaction, config);
},
/**
* Fires event "io:complete" and creates, fires a transaction-specific
* "complete" event -- for XMLHttpRequest file upload -- if
* config.on.complete is defined.
*
* @method load
* @param {Object} transaction Transaction object.
* @param {Object} load event.
* @param {Object} config Configuration object for the transaction.
*/
load: function (transaction, e, config) {
_yuitest_coverfunc("build/io-base/io-base.js", "load", 352);
_yuitest_coverline("build/io-base/io-base.js", 353);
transaction.evt = e.target;
_yuitest_coverline("build/io-base/io-base.js", 354);
this._evt(EVENTS[1], transaction, config);
},
/**
* Fires event "io:failure" and creates, fires a transaction-specific
* "failure" event -- for XMLHttpRequest file upload -- if
* config.on.failure is defined.
*
* @method error
* @param {Object} transaction Transaction object.
* @param {Object} error event.
* @param {Object} config Configuration object for the transaction.
*/
error: function (transaction, e, config) {
_yuitest_coverfunc("build/io-base/io-base.js", "error", 367);
_yuitest_coverline("build/io-base/io-base.js", 368);
transaction.evt = e;
_yuitest_coverline("build/io-base/io-base.js", 369);
this._evt(EVENTS[4], transaction, config);
},
/**
* Retry an XDR transaction, using the Flash tranport, if the native
* transport fails.
*
* @method _retry
* @private
* @param {Object} transaction Transaction object.
* @param {String} uri Qualified path to transaction resource.
* @param {Object} config Configuration object for the transaction.
*/
_retry: function(transaction, uri, config) {
_yuitest_coverfunc("build/io-base/io-base.js", "_retry", 382);
_yuitest_coverline("build/io-base/io-base.js", 383);
this._destroy(transaction);
_yuitest_coverline("build/io-base/io-base.js", 384);
config.xdr.use = 'flash';
_yuitest_coverline("build/io-base/io-base.js", 385);
return this.send(uri, config, transaction.id);
},
/**
* Method that concatenates string data for HTTP GET transactions.
*
* @method _concat
* @private
* @param {String} uri URI or root data.
* @param {String} data Data to be concatenated onto URI.
* @return {String}
*/
_concat: function(uri, data) {
_yuitest_coverfunc("build/io-base/io-base.js", "_concat", 397);
_yuitest_coverline("build/io-base/io-base.js", 398);
uri += (uri.indexOf('?') === -1 ? '?' : '&') + data;
_yuitest_coverline("build/io-base/io-base.js", 399);
return uri;
},
/**
* Stores default client headers for all transactions. If a label is
* passed with no value argument, the header will be deleted.
*
* @method setHeader
* @param {String} name HTTP header
* @param {String} value HTTP header value
*/
setHeader: function(name, value) {
_yuitest_coverfunc("build/io-base/io-base.js", "setHeader", 410);
_yuitest_coverline("build/io-base/io-base.js", 411);
if (value) {
_yuitest_coverline("build/io-base/io-base.js", 412);
this._headers[name] = value;
} else {
_yuitest_coverline("build/io-base/io-base.js", 414);
delete this._headers[name];
}
},
/**
* Method that sets all HTTP headers to be sent in a transaction.
*
* @method _setHeaders
* @private
* @param {Object} transaction - XHR instance for the specific transaction.
* @param {Object} headers - HTTP headers for the specific transaction, as
* defined in the configuration object passed to YUI.io().
*/
_setHeaders: function(transaction, headers) {
_yuitest_coverfunc("build/io-base/io-base.js", "_setHeaders", 427);
_yuitest_coverline("build/io-base/io-base.js", 428);
headers = Y.merge(this._headers, headers);
_yuitest_coverline("build/io-base/io-base.js", 429);
Y.Object.each(headers, function(value, name) {
_yuitest_coverfunc("build/io-base/io-base.js", "(anonymous 2)", 429);
_yuitest_coverline("build/io-base/io-base.js", 430);
if (value !== 'disable') {
_yuitest_coverline("build/io-base/io-base.js", 431);
transaction.setRequestHeader(name, headers[name]);
}
});
},
/**
* Starts timeout count if the configuration object has a defined
* timeout property.
*
* @method _startTimeout
* @private
* @param {Object} transaction Transaction object generated by _create().
* @param {Object} timeout Timeout in milliseconds.
*/
_startTimeout: function(transaction, timeout) {
_yuitest_coverfunc("build/io-base/io-base.js", "_startTimeout", 445);
_yuitest_coverline("build/io-base/io-base.js", 446);
var io = this;
_yuitest_coverline("build/io-base/io-base.js", 448);
io._timeout[transaction.id] = setTimeout(function() {
_yuitest_coverfunc("build/io-base/io-base.js", "(anonymous 3)", 448);
_yuitest_coverline("build/io-base/io-base.js", 449);
io._abort(transaction, 'timeout');
}, timeout);
},
/**
* Clears the timeout interval started by _startTimeout().
*
* @method _clearTimeout
* @private
* @param {Number} id - Transaction id.
*/
_clearTimeout: function(id) {
_yuitest_coverfunc("build/io-base/io-base.js", "_clearTimeout", 460);
_yuitest_coverline("build/io-base/io-base.js", 461);
clearTimeout(this._timeout[id]);
_yuitest_coverline("build/io-base/io-base.js", 462);
delete this._timeout[id];
},
/**
* Method that determines if a transaction response qualifies as success
* or failure, based on the response HTTP status code, and fires the
* appropriate success or failure events.
*
* @method _result
* @private
* @static
* @param {Object} transaction Transaction object generated by _create().
* @param {Object} config Configuration object passed to io().
*/
_result: function(transaction, config) {
_yuitest_coverfunc("build/io-base/io-base.js", "_result", 476);
_yuitest_coverline("build/io-base/io-base.js", 477);
var status;
// Firefox will throw an exception if attempting to access
// an XHR object's status property, after a request is aborted.
_yuitest_coverline("build/io-base/io-base.js", 480);
try {
_yuitest_coverline("build/io-base/io-base.js", 481);
status = transaction.c.status;
} catch(e) {
_yuitest_coverline("build/io-base/io-base.js", 483);
status = 0;
}
// IE reports HTTP 204 as HTTP 1223.
_yuitest_coverline("build/io-base/io-base.js", 487);
if (status >= 200 && status < 300 || status === 304 || status === 1223) {
_yuitest_coverline("build/io-base/io-base.js", 488);
this.success(transaction, config);
} else {
_yuitest_coverline("build/io-base/io-base.js", 490);
this.failure(transaction, config);
}
},
/**
* Event handler bound to onreadystatechange.
*
* @method _rS
* @private
* @param {Object} transaction Transaction object generated by _create().
* @param {Object} config Configuration object passed to YUI.io().
*/
_rS: function(transaction, config) {
_yuitest_coverfunc("build/io-base/io-base.js", "_rS", 502);
_yuitest_coverline("build/io-base/io-base.js", 503);
var io = this;
_yuitest_coverline("build/io-base/io-base.js", 505);
if (transaction.c.readyState === 4) {
_yuitest_coverline("build/io-base/io-base.js", 506);
if (config.timeout) {
_yuitest_coverline("build/io-base/io-base.js", 507);
io._clearTimeout(transaction.id);
}
// Yield in the event of request timeout or abort.
_yuitest_coverline("build/io-base/io-base.js", 511);
setTimeout(function() {
_yuitest_coverfunc("build/io-base/io-base.js", "(anonymous 4)", 511);
_yuitest_coverline("build/io-base/io-base.js", 512);
io.complete(transaction, config);
_yuitest_coverline("build/io-base/io-base.js", 513);
io._result(transaction, config);
}, 0);
}
},
/**
* Terminates a transaction due to an explicit abort or timeout.
*
* @method _abort
* @private
* @param {Object} transaction Transaction object generated by _create().
* @param {String} type Identifies timed out or aborted transaction.
*/
_abort: function(transaction, type) {
_yuitest_coverfunc("build/io-base/io-base.js", "_abort", 526);
_yuitest_coverline("build/io-base/io-base.js", 527);
if (transaction && transaction.c) {
_yuitest_coverline("build/io-base/io-base.js", 528);
transaction.e = type;
_yuitest_coverline("build/io-base/io-base.js", 529);
transaction.c.abort();
}
},
/**
* Requests a transaction. `send()` is implemented as `Y.io()`. Each
* transaction may include a configuration object. Its properties are:
*
* <dl>
* <dt>method</dt>
* <dd>HTTP method verb (e.g., GET or POST). If this property is not
* not defined, the default value will be GET.</dd>
*
* <dt>data</dt>
* <dd>This is the name-value string that will be sent as the
* transaction data. If the request is HTTP GET, the data become
* part of querystring. If HTTP POST, the data are sent in the
* message body.</dd>
*
* <dt>xdr</dt>
* <dd>Defines the transport to be used for cross-domain requests.
* By setting this property, the transaction will use the specified
* transport instead of XMLHttpRequest. The properties of the
* transport object are:
* <dl>
* <dt>use</dt>
* <dd>The transport to be used: 'flash' or 'native'</dd>
* <dt>dataType</dt>
* <dd>Set the value to 'XML' if that is the expected response
* content type.</dd>
* </dl></dd>
*
* <dt>form</dt>
* <dd>Form serialization configuration object. Its properties are:
* <dl>
* <dt>id</dt>
* <dd>Node object or id of HTML form</dd>
* <dt>useDisabled</dt>
* <dd>`true` to also serialize disabled form field values
* (defaults to `false`)</dd>
* </dl></dd>
*
* <dt>on</dt>
* <dd>Assigns transaction event subscriptions. Available events are:
* <dl>
* <dt>start</dt>
* <dd>Fires when a request is sent to a resource.</dd>
* <dt>complete</dt>
* <dd>Fires when the transaction is complete.</dd>
* <dt>success</dt>
* <dd>Fires when the HTTP response status is within the 2xx
* range.</dd>
* <dt>failure</dt>
* <dd>Fires when the HTTP response status is outside the 2xx
* range, if an exception occurs, if the transation is aborted,
* or if the transaction exceeds a configured `timeout`.</dd>
* <dt>end</dt>
* <dd>Fires at the conclusion of the transaction
* lifecycle, after `success` or `failure`.</dd>
* </dl>
*
* <p>Callback functions for `start` and `end` receive the id of the
* transaction as a first argument. For `complete`, `success`, and
* `failure`, callbacks receive the id and the response object
* (usually the XMLHttpRequest instance). If the `arguments`
* property was included in the configuration object passed to
* `Y.io()`, the configured data will be passed to all callbacks as
* the last argument.</p>
* </dd>
*
* <dt>sync</dt>
* <dd>Pass `true` to make a same-domain transaction synchronous.
* <strong>CAVEAT</strong>: This will negatively impact the user
* experience. Have a <em>very</em> good reason if you intend to use
* this.</dd>
*
* <dt>context</dt>
* <dd>The "`this'" object for all configured event handlers. If a
* specific context is needed for individual callbacks, bind the
* callback to a context using `Y.bind()`.</dd>
*
* <dt>headers</dt>
* <dd>Object map of transaction headers to send to the server. The
* object keys are the header names and the values are the header
* values.</dd>
*
* <dt>timeout</dt>
* <dd>Millisecond threshold for the transaction before being
* automatically aborted.</dd>
*
* <dt>arguments</dt>
* <dd>User-defined data passed to all registered event handlers.
* This value is available as the second argument in the "start" and
* "end" event handlers. It is the third argument in the "complete",
* "success", and "failure" event handlers. <strong>Be sure to quote
* this property name in the transaction configuration as
* "arguments" is a reserved word in JavaScript</strong> (e.g.
* `Y.io({ ..., "arguments": stuff })`).</dd>
* </dl>
*
* @method send
* @public
* @param {String} uri Qualified path to transaction resource.
* @param {Object} config Configuration object for the transaction.
* @param {Number} id Transaction id, if already set.
* @return {Object}
*/
send: function(uri, config, id) {
_yuitest_coverfunc("build/io-base/io-base.js", "send", 636);
_yuitest_coverline("build/io-base/io-base.js", 637);
var transaction, method, i, len, sync, data,
io = this,
u = uri,
response = {};
_yuitest_coverline("build/io-base/io-base.js", 642);
config = config ? Y.Object(config) : {};
_yuitest_coverline("build/io-base/io-base.js", 643);
transaction = io._create(config, id);
_yuitest_coverline("build/io-base/io-base.js", 644);
method = config.method ? config.method.toUpperCase() : 'GET';
_yuitest_coverline("build/io-base/io-base.js", 645);
sync = config.sync;
_yuitest_coverline("build/io-base/io-base.js", 646);
data = config.data;
// Serialize an map object into a key-value string using
// querystring-stringify-simple.
_yuitest_coverline("build/io-base/io-base.js", 650);
if ((Y.Lang.isObject(data) && !data.nodeType) && !transaction.upload) {
_yuitest_coverline("build/io-base/io-base.js", 651);
data = Y.QueryString.stringify(data);
}
_yuitest_coverline("build/io-base/io-base.js", 654);
if (config.form) {
_yuitest_coverline("build/io-base/io-base.js", 655);
if (config.form.upload) {
// This is a file upload transaction, calling
// upload() in io-upload-iframe.
_yuitest_coverline("build/io-base/io-base.js", 658);
return io.upload(transaction, uri, config);
} else {
// Serialize HTML form data into a key-value string.
_yuitest_coverline("build/io-base/io-base.js", 661);
data = io._serialize(config.form, data);
}
}
_yuitest_coverline("build/io-base/io-base.js", 665);
if (data) {
_yuitest_coverline("build/io-base/io-base.js", 666);
switch (method) {
case 'GET':
case 'HEAD':
case 'DELETE':
_yuitest_coverline("build/io-base/io-base.js", 670);
u = io._concat(u, data);
_yuitest_coverline("build/io-base/io-base.js", 671);
data = '';
_yuitest_coverline("build/io-base/io-base.js", 672);
break;
case 'POST':
case 'PUT':
// If Content-Type is defined in the configuration object, or
// or as a default header, it will be used instead of
// 'application/x-www-form-urlencoded; charset=UTF-8'
_yuitest_coverline("build/io-base/io-base.js", 678);
config.headers = Y.merge({
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
}, config.headers);
_yuitest_coverline("build/io-base/io-base.js", 681);
break;
}
}
_yuitest_coverline("build/io-base/io-base.js", 685);
if (transaction.xdr) {
// Route data to io-xdr module for flash and XDomainRequest.
_yuitest_coverline("build/io-base/io-base.js", 687);
return io.xdr(u, transaction, config);
}
else {_yuitest_coverline("build/io-base/io-base.js", 689);
if (transaction.notify) {
// Route data to custom transport
_yuitest_coverline("build/io-base/io-base.js", 691);
return transaction.c.send(transaction, uri, config);
}}
_yuitest_coverline("build/io-base/io-base.js", 694);
if (!sync && !transaction.upload) {
_yuitest_coverline("build/io-base/io-base.js", 695);
transaction.c.onreadystatechange = function() {
_yuitest_coverfunc("build/io-base/io-base.js", "onreadystatechange", 695);
_yuitest_coverline("build/io-base/io-base.js", 696);
io._rS(transaction, config);
};
}
_yuitest_coverline("build/io-base/io-base.js", 700);
try {
// Determine if request is to be set as
// synchronous or asynchronous.
_yuitest_coverline("build/io-base/io-base.js", 703);
transaction.c.open(method, u, !sync, config.username || null, config.password || null);
_yuitest_coverline("build/io-base/io-base.js", 704);
io._setHeaders(transaction.c, config.headers || {});
_yuitest_coverline("build/io-base/io-base.js", 705);
io.start(transaction, config);
// Will work only in browsers that implement the
// Cross-Origin Resource Sharing draft.
_yuitest_coverline("build/io-base/io-base.js", 709);
if (config.xdr && config.xdr.credentials) {
_yuitest_coverline("build/io-base/io-base.js", 710);
if (!Y.UA.ie) {
_yuitest_coverline("build/io-base/io-base.js", 711);
transaction.c.withCredentials = true;
}
}
// Using "null" with HTTP POST will result in a request
// with no Content-Length header defined.
_yuitest_coverline("build/io-base/io-base.js", 717);
transaction.c.send(data);
_yuitest_coverline("build/io-base/io-base.js", 719);
if (sync) {
// Create a response object for synchronous transactions,
// mixing id and arguments properties with the xhr
// properties whitelist.
_yuitest_coverline("build/io-base/io-base.js", 723);
for (i = 0, len = XHR_PROPS.length; i < len; ++i) {
_yuitest_coverline("build/io-base/io-base.js", 724);
response[XHR_PROPS[i]] = transaction.c[XHR_PROPS[i]];
}
_yuitest_coverline("build/io-base/io-base.js", 727);
response.getAllResponseHeaders = function() {
_yuitest_coverfunc("build/io-base/io-base.js", "getAllResponseHeaders", 727);
_yuitest_coverline("build/io-base/io-base.js", 728);
return transaction.c.getAllResponseHeaders();
};
_yuitest_coverline("build/io-base/io-base.js", 731);
response.getResponseHeader = function(name) {
_yuitest_coverfunc("build/io-base/io-base.js", "getResponseHeader", 731);
_yuitest_coverline("build/io-base/io-base.js", 732);
return transaction.c.getResponseHeader(name);
};
_yuitest_coverline("build/io-base/io-base.js", 735);
io.complete(transaction, config);
_yuitest_coverline("build/io-base/io-base.js", 736);
io._result(transaction, config);
_yuitest_coverline("build/io-base/io-base.js", 738);
return response;
}
} catch(e) {
_yuitest_coverline("build/io-base/io-base.js", 741);
if (transaction.xdr) {
// This exception is usually thrown by browsers
// that do not support XMLHttpRequest Level 2.
// Retry the request with the XDR transport set
// to 'flash'. If the Flash transport is not
// initialized or available, the transaction
// will resolve to a transport error.
_yuitest_coverline("build/io-base/io-base.js", 748);
return io._retry(transaction, uri, config);
} else {
_yuitest_coverline("build/io-base/io-base.js", 750);
io.complete(transaction, config);
_yuitest_coverline("build/io-base/io-base.js", 751);
io._result(transaction, config);
}
}
// If config.timeout is defined, and the request is standard XHR,
// initialize timeout polling.
_yuitest_coverline("build/io-base/io-base.js", 757);
if (config.timeout) {
_yuitest_coverline("build/io-base/io-base.js", 758);
io._startTimeout(transaction, config.timeout);
}
_yuitest_coverline("build/io-base/io-base.js", 761);
return {
id: transaction.id,
abort: function() {
_yuitest_coverfunc("build/io-base/io-base.js", "abort", 763);
_yuitest_coverline("build/io-base/io-base.js", 764);
return transaction.c ? io._abort(transaction, 'abort') : false;
},
isInProgress: function() {
_yuitest_coverfunc("build/io-base/io-base.js", "isInProgress", 766);
_yuitest_coverline("build/io-base/io-base.js", 767);
return transaction.c ? (transaction.c.readyState % 4) : false;
},
io: io
};
}
};
/**
Method for initiating an ajax call. The first argument is the url end
point for the call. The second argument is an object to configure the
transaction and attach event subscriptions. The configuration object
supports the following properties:
<dl>
<dt>method</dt>
<dd>HTTP method verb (e.g., GET or POST). If this property is not
not defined, the default value will be GET.</dd>
<dt>data</dt>
<dd>This is the name-value string that will be sent as the
transaction data. If the request is HTTP GET, the data become
part of querystring. If HTTP POST, the data are sent in the
message body.</dd>
<dt>xdr</dt>
<dd>Defines the transport to be used for cross-domain requests.
By setting this property, the transaction will use the specified
transport instead of XMLHttpRequest. The properties of the
transport object are:
<dl>
<dt>use</dt>
<dd>The transport to be used: 'flash' or 'native'</dd>
<dt>dataType</dt>
<dd>Set the value to 'XML' if that is the expected response
content type.</dd>
</dl></dd>
<dt>form</dt>
<dd>Form serialization configuration object. Its properties are:
<dl>
<dt>id</dt>
<dd>Node object or id of HTML form</dd>
<dt>useDisabled</dt>
<dd>`true` to also serialize disabled form field values
(defaults to `false`)</dd>
</dl></dd>
<dt>on</dt>
<dd>Assigns transaction event subscriptions. Available events are:
<dl>
<dt>start</dt>
<dd>Fires when a request is sent to a resource.</dd>
<dt>complete</dt>
<dd>Fires when the transaction is complete.</dd>
<dt>success</dt>
<dd>Fires when the HTTP response status is within the 2xx
range.</dd>
<dt>failure</dt>
<dd>Fires when the HTTP response status is outside the 2xx
range, if an exception occurs, if the transation is aborted,
or if the transaction exceeds a configured `timeout`.</dd>
<dt>end</dt>
<dd>Fires at the conclusion of the transaction
lifecycle, after `success` or `failure`.</dd>
</dl>
<p>Callback functions for `start` and `end` receive the id of the
transaction as a first argument. For `complete`, `success`, and
`failure`, callbacks receive the id and the response object
(usually the XMLHttpRequest instance). If the `arguments`
property was included in the configuration object passed to
`Y.io()`, the configured data will be passed to all callbacks as
the last argument.</p>
</dd>
<dt>sync</dt>
<dd>Pass `true` to make a same-domain transaction synchronous.
<strong>CAVEAT</strong>: This will negatively impact the user
experience. Have a <em>very</em> good reason if you intend to use
this.</dd>
<dt>context</dt>
<dd>The "`this'" object for all configured event handlers. If a
specific context is needed for individual callbacks, bind the
callback to a context using `Y.bind()`.</dd>
<dt>headers</dt>
<dd>Object map of transaction headers to send to the server. The
object keys are the header names and the values are the header
values.</dd>
<dt>timeout</dt>
<dd>Millisecond threshold for the transaction before being
automatically aborted.</dd>
<dt>arguments</dt>
<dd>User-defined data passed to all registered event handlers.
This value is available as the second argument in the "start" and
"end" event handlers. It is the third argument in the "complete",
"success", and "failure" event handlers. <strong>Be sure to quote
this property name in the transaction configuration as
"arguments" is a reserved word in JavaScript</strong> (e.g.
`Y.io({ ..., "arguments": stuff })`).</dd>
</dl>
@method io
@static
@param {String} url qualified path to transaction resource.
@param {Object} config configuration object for the transaction.
@return {Object}
@for YUI
**/
_yuitest_coverline("build/io-base/io-base.js", 879);
Y.io = function(url, config) {
// Calling IO through the static interface will use and reuse
// an instance of IO.
_yuitest_coverfunc("build/io-base/io-base.js", "io", 879);
_yuitest_coverline("build/io-base/io-base.js", 882);
var transaction = Y.io._map['io:0'] || new IO();
_yuitest_coverline("build/io-base/io-base.js", 883);
return transaction.send.apply(transaction, [url, config]);
};
/**
Method for setting and deleting IO HTTP headers to be sent with every
request.
Hosted as a property on the `io` function (e.g. `Y.io.header`).
@method header
@param {String} name HTTP header
@param {String} value HTTP header value
@static
**/
_yuitest_coverline("build/io-base/io-base.js", 897);
Y.io.header = function(name, value) {
// Calling IO through the static interface will use and reuse
// an instance of IO.
_yuitest_coverfunc("build/io-base/io-base.js", "header", 897);
_yuitest_coverline("build/io-base/io-base.js", 900);
var transaction = Y.io._map['io:0'] || new IO();
_yuitest_coverline("build/io-base/io-base.js", 901);
transaction.setHeader(name, value);
};
_yuitest_coverline("build/io-base/io-base.js", 904);
Y.IO = IO;
// Map of all IO instances created.
_yuitest_coverline("build/io-base/io-base.js", 906);
Y.io._map = {};
_yuitest_coverline("build/io-base/io-base.js", 907);
var XHR = win && win.XMLHttpRequest,
XDR = win && win.XDomainRequest,
AX = win && win.ActiveXObject;
_yuitest_coverline("build/io-base/io-base.js", 912);
Y.mix(Y.IO, {
/**
* The ID of the default IO transport, defaults to `xhr`
* @property _default
* @type {String}
* @static
*/
_default: 'xhr',
/**
*
* @method defaultTransport
* @static
* @param {String} [id] The transport to set as the default, if empty a new transport is created.
* @return {Object} The transport object with a `send` method
*/
defaultTransport: function(id) {
_yuitest_coverfunc("build/io-base/io-base.js", "defaultTransport", 927);
_yuitest_coverline("build/io-base/io-base.js", 928);
if (id) {
_yuitest_coverline("build/io-base/io-base.js", 929);
Y.IO._default = id;
} else {
_yuitest_coverline("build/io-base/io-base.js", 931);
var o = {
c: Y.IO.transports[Y.IO._default](),
notify: Y.IO._default === 'xhr' ? false : true
};
_yuitest_coverline("build/io-base/io-base.js", 935);
return o;
}
},
/**
* An object hash of custom transports available to IO
* @property transports
* @type {Object}
* @static
*/
transports: {
xhr: function () {
_yuitest_coverfunc("build/io-base/io-base.js", "xhr", 945);
_yuitest_coverline("build/io-base/io-base.js", 946);
return XHR ? new XMLHttpRequest() :
AX ? new ActiveXObject('Microsoft.XMLHTTP') : null;
},
xdr: function () {
_yuitest_coverfunc("build/io-base/io-base.js", "xdr", 949);
_yuitest_coverline("build/io-base/io-base.js", 950);
return XDR ? new XDomainRequest() : null;
},
iframe: function () { _yuitest_coverfunc("build/io-base/io-base.js", "iframe", 952);
_yuitest_coverline("build/io-base/io-base.js", 952);
return {}; },
flash: null,
nodejs: null
},
/**
* Create a custom transport of type and return it's object
* @method customTransport
* @param {String} id The id of the transport to create.
* @static
*/
customTransport: function(id) {
_yuitest_coverfunc("build/io-base/io-base.js", "customTransport", 962);
_yuitest_coverline("build/io-base/io-base.js", 963);
var o = { c: Y.IO.transports[id]() };
_yuitest_coverline("build/io-base/io-base.js", 965);
o[(id === 'xdr' || id === 'flash') ? 'xdr' : 'notify'] = true;
_yuitest_coverline("build/io-base/io-base.js", 966);
return o;
}
});
_yuitest_coverline("build/io-base/io-base.js", 970);
Y.mix(Y.IO.prototype, {
/**
* Fired from the notify method of the transport which in turn fires
* the event on the IO object.
* @method notify
* @param {String} event The name of the event
* @param {Object} transaction The transaction object
* @param {Object} config The configuration object for this transaction
*/
notify: function(event, transaction, config) {
_yuitest_coverfunc("build/io-base/io-base.js", "notify", 979);
_yuitest_coverline("build/io-base/io-base.js", 980);
var io = this;
_yuitest_coverline("build/io-base/io-base.js", 982);
switch (event) {
case 'timeout':
case 'abort':
case 'transport error':
_yuitest_coverline("build/io-base/io-base.js", 986);
transaction.c = { status: 0, statusText: event };
_yuitest_coverline("build/io-base/io-base.js", 987);
event = 'failure';
default:
_yuitest_coverline("build/io-base/io-base.js", 989);
io[event].apply(io, [transaction, config]);
}
}
});
}, '@VERSION@', {"requires": ["event-custom-base", "querystring-stringify-simple"]});
| pombredanne/cdnjs | ajax/libs/yui/3.7.0pr2/io-base/io-base-coverage.js | JavaScript | mit | 85,294 |
YUI.add("charts-legend",function(e,t){var n=e.config.doc,r="top",i="right",s="bottom",o="left",u="external",a="horizontal",f="vertical",l="width",c="height",h="position",p="x",d="y",v="px",m,g={setter:function(t){var n=this.get("legend");return n&&n.destroy(!0),t instanceof e.ChartLegend?(n=t,n.set("chart",this)):(t.chart=this,t.hasOwnProperty("render")||(t.render=this.get("contentBox"),t.includeInChartLayout=!0),n=new e.ChartLegend(t)),n}},y={_positionLegendItems:function(e,t,n,r,i,s,o,u,a){var f=0,l=0,c,h,p,d,m,g=this.get("width"),b,w,E,S,x,T=s.top-u,N=g-(s.left+s.right),C,k,L,A;y._setRowArrays(e,N,o),b=y.rowArray,S=y.totalWidthArray,w=b.length;for(;l<w;++l){T+=u,E=b[l],m=E.length,x=y.getStartPoint(g,S[l],a,s);for(f=0;f<m;++f)c=E[f],h=c.node,p=c.width,d=c.height,c.x=x,c.y=0,C=isNaN(C)?x:Math.min(C,x),k=isNaN(k)?T:Math.min(k,T),L=isNaN(L)?x+p:Math.max(x+p,L),A=isNaN(A)?T+d:Math.max(T+d,A),h.setStyle("left",x+v),h.setStyle("top",T+v),x+=p+o;T+=c.height}this._contentRect={left:C,top:k,right:L,bottom:A},this.get("includeInChartLayout")&&this.set("height",T+s.bottom)},_setRowArrays:function(e,t,n){var r=e[0],i=[[r]],s=1,o=0,u=e.length,a=r.width,f,l=[[a]];for(;s<u;++s)r=e[s],f=r.width,a+n+f<=t?(a+=n+f,i[o].push(r)):(a=n+f,i[o]&&(o+=1),i[o]=[r]),l[o]=a;y.rowArray=i,y.totalWidthArray=l},getStartPoint:function(e,t,n,r){var s;switch(n){case o:s=r.left;break;case"center":s=(e-t)*.5;break;case i:s=e-t-r.right}return s}},b={_positionLegendItems:function(e,t,n,r,i,s,o,u,a){var f=0,l=0,c,h,p,d,m,g=this.get("height"),y,w,E,S,x,T=s.left-o,N,C=g-(s.top+s.bottom),k,L,A,O;b._setColumnArrays(e,C,u),y=b.columnArray,S=b.totalHeightArray,w=y.length;for(;l<w;++l){T+=o,E=y[l],m=E.length,x=b.getStartPoint(g,S[l],a,s),N=0;for(f=0;f<m;++f)c=E[f],h=c.node,p=c.height,d=c.width,c.y=x,c.x=T,k=isNaN(k)?T:Math.min(k,T),L=isNaN(L)?x:Math.min(L,x),A=isNaN(A)?T+d:Math.max(T+d,A),O=isNaN(O)?x+p:Math.max(x+p,O),h.setStyle("left",T+v),h.setStyle("top",x+v),x+=p+u,N=Math.max(N,c.width);T+=N}this._contentRect={left:k,top:L,right:A,bottom:O},this.get("includeInChartLayout")&&this.set("width",T+s.right)},_setColumnArrays:function(e,t,n){var r=e[0],i=[[r]],s=1,o=0,u=e.length,a=r.height,f,l=[[a]];for(;s<u;++s)r=e[s],f=r.height,a+n+f<=t?(a+=n+f,i[o].push(r)):(a=n+f,i[o]&&(o+=1),i[o]=[r]),l[o]=a;b.columnArray=i,b.totalHeightArray=l},getStartPoint:function(e,t,n,i){var o;switch(n){case r:o=i.top;break;case"middle":o=(e-t)*.5;break;case s:o=e-t-i.bottom}return o}},w=e.Base.create("cartesianChartLegend",e.CartesianChart,[],{_redraw:function(){if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1;var e=this.get("width"),t=this.get("height"),n=this._getLayoutBoxDimensions(),r=n.left,i=n.right,s=n.top,o=n.bottom,u=this.get("leftAxesCollection"),a=this.get("rightAxesCollection"),f=this.get("topAxesCollection"),l=this.get("bottomAxesCollection"),c=0,h,p,d="visible",m=this.get("graph"),g,y,b,w,E,S,x,T,N=this.get("allowContentOverflow"),C,k,L,A,O,M=this.get("legend"),_={};if(u){L=[],h=u.length;for(c=h-1;c>-1;--c)L.unshift(r),r+=u[c].get("width")}if(a){k=[],h=a.length,c=0;for(c=h-1;c>-1;--c)i+=a[c].get("width"),k.unshift(e-i)}if(f){A=[],h=f.length;for(c=h-1;c>-1;--c)A.unshift(s),s+=f[c].get("height")}if(l){O=[],h=l.length;for(c=h-1;c>-1;--c)o+=l[c].get("height"),O.unshift(t-o)}E=e-(r+i),S=t-(o+s),_.left=r,_.top=s,_.bottom=t-o,_.right=e-i;if(!N){g=this._getTopOverflow(u,a),y=this._getBottomOverflow(u,a),b=this._getLeftOverflow(l,f),w=this._getRightOverflow(l,f),C=g-s;if(C>0){_.top=g;if(A){c=0,h=A.length;for(;c<h;++c)A[c]+=C}}C=y-o;if(C>0){_.bottom=t-y;if(O){c=0,h=O.length;for(;c<h;++c)O[c]-=C}}C=b-r;if(C>0){_.left=b;if(L){c=0,h=L.length;for(;c<h;++c)L[c]+=C}}C=w-i;if(C>0){_.right=e-w;if(k){c=0,h=k.length;for(;c<h;++c)k[c]-=C}}}E=_.right-_.left,S=_.bottom-_.top,x=_.left,T=_.top;if(M&&M.get("includeInChartLayout"))switch(M.get("position")){case"left":M.set("y",T),M.set("height",S);break;case"top":M.set("x",x),M.set("width",E);break;case"bottom":M.set("x",x),M.set("width",E);break;case"right":M.set("y",T),M.set("height",S)}if(f){h=f.length,c=0;for(;c<h;c++)p=f[c],p.get("width")!==E&&p.set("width",E),p.get("boundingBox").setStyle("left",x+v),p.get("boundingBox").setStyle("top",A[c]+v);p._hasDataOverflow()&&(d="hidden")}if(l){h=l.length,c=0;for(;c<h;c++)p=l[c],p.get("width")!==E&&p.set("width",E),p.get("boundingBox").setStyle("left",x+v),p.get("boundingBox").setStyle("top",O[c]+v);p._hasDataOverflow()&&(d="hidden")}if(u){h=u.length,c=0;for(;c<h;++c)p=u[c],p.get("boundingBox").setStyle("top",T+v),p.get("boundingBox").setStyle("left",L[c]+v),p.get("height")!==S&&p.set("height",S);p._hasDataOverflow()&&(d="hidden")}if(a){h=a.length,c=0;for(;c<h;++c)p=a[c],p.get("boundingBox").setStyle("top",T+v),p.get("boundingBox").setStyle("left",k[c]+v),p.get("height")!==S&&p.set("height",S);p._hasDataOverflow()&&(d="hidden")}this._drawing=!1;if(this._callLater){this._redraw();return}m&&(m.get("boundingBox").setStyle("left",x+v),m.get("boundingBox").setStyle("top",T+v),m.set("width",E),m.set("height",S),m.get("boundingBox").setStyle("overflow",d)),this._overlay&&(this._overlay.setStyle("left",x+v),this._overlay.setStyle("top",T+v),this._overlay.setStyle("width",E+v),this._overlay.setStyle("height",S+v))},_getLayoutBoxDimensions:function(){var e={top:0,right:0,bottom:0,left:0},t=this.get("legend"),n,f,v,m,g=this.get(l),y=this.get(c),b;if(t&&t.get("includeInChartLayout")){b=t.get("styles").gap,n=t.get(h);if(n!==u){f=t.get("direction"),v=f===a?c:l,m=t.get(v),e[n]=m+b;switch(n){case r:t.set(d,0);break;case s:t.set(d,y-m);break;case i:t.set(p,g-m);break;case o:t.set(p,0)}}}return e},destructor:function(){var e=this.get("legend");e&&e.destroy(!0)}},{ATTRS:{legend:g}});e.CartesianChart=w,m=e.Base.create("pieChartLegend",e.PieChart,[],{_redraw:function(){if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1;var e=this.get("graph"),t=this.get("width"),n=this.get("height"),u,a,f=this.get("legend"),h=0,v=0,m=0,g=0,y,b,w,E,S,x;if(
e)if(f){S=f.get("position"),x=f.get("direction"),u=e.get("width"),a=e.get("height"),y=f.get("width"),b=f.get("height"),E=f.get("styles").gap;if(x==="vertical"&&u+y+E!==t||x==="horizontal"&&a+b+E!==n){switch(f.get("position")){case o:w=Math.min(t-(y+E),n),b=n,h=y+E,f.set(c,b);break;case r:w=Math.min(n-(b+E),t),y=t,v=b+E,f.set(l,y);break;case i:w=Math.min(t-(y+E),n),b=n,m=w+E,f.set(c,b);break;case s:w=Math.min(n-(b+E),t),y=t,g=w+E,f.set(l,y)}e.set(l,w),e.set(c,w)}else switch(f.get("position")){case o:h=y+E;break;case r:v=b+E;break;case i:m=u+E;break;case s:g=a+E}}else e.set(p,0),e.set(d,0),e.set(l,t),e.set(c,n);this._drawing=!1;if(this._callLater){this._redraw();return}e&&(e.set(p,h),e.set(d,v)),f&&(f.set(p,m),f.set(d,g))}},{ATTRS:{legend:g}}),e.PieChart=m,e.ChartLegend=e.Base.create("chartlegend",e.Widget,[e.Renderer],{initializer:function(){this._items=[]},renderUI:function(){var t=this.get("boundingBox"),n=this.get("contentBox"),r=this.get("styles").background,i=new e.Rect({graphic:n,fill:r.fill,stroke:r.border});t.setStyle("display","block"),t.setStyle("position","absolute"),this.set("background",i)},bindUI:function(){this.get("chart").after("seriesCollectionChange",e.bind(this._updateHandler,this)),this.after("stylesChange",this._updateHandler),this.after("positionChange",this._positionChangeHandler),this.after("widthChange",this._handleSizeChange),this.after("heightChange",this._handleSizeChange)},syncUI:function(){var e=this.get("width"),t=this.get("height");isFinite(e)&&isFinite(t)&&e>0&&t>0&&this._drawLegend()},_updateHandler:function(){this.get("rendered")&&this._drawLegend()},_positionChangeHandler:function(){var e=this.get("chart"),t=this._parentNode;t&&e&&this.get("includeInChartLayout")?this.fire("legendRendered"):this.get("rendered")&&this._drawLegend()},_handleSizeChange:function(e){var t=e.attrName,n=this.get(h),u=n===o||n===i,a=n===s||n===r;(a&&t===l||u&&t===c)&&this._drawLegend()},_drawLegend:function(){if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1,this.get("includeInChartLayout")&&this.get("chart")._itemRenderQueue.unshift(this);var t=this.get("chart"),n=this.get("contentBox"),r=t.get("seriesCollection"),i,s=this.get("styles"),o=s.padding,u=s.item,a,f=u.hSpacing,l=u.vSpacing,c=this.get("direction"),h=c==="vertical"?s.vAlign:s.hAlign,p=s.marker,d=u.label,v,m=this._layout[c],g,y,b,w,E,S,x,T,N,C,k,L=[],A=p.width,O=p.height,M=0-f,_=0-l,D=0,P=0,H,B;p&&p.shape&&(w=p.shape),this._destroyLegendItems();if(t instanceof e.PieChart){i=r[0],v=i.get("categoryAxis").getDataByKey(i.get("categoryKey")),a=i.get("styles").marker,N=a.fill.colors,C=a.border.colors,k=a.border.weight,g=0,y=v.length,w=w||e.Circle,b=e.Lang.isArray(w);for(;g<y;++g)w=b?w[g]:w,x={color:N[g]},T={colors:C[g],weight:k},v=t.getSeriesItems(i,g).category.value,S=this._getLegendItem(n,this._getShapeClass(w),x,T,d,A,O,v),H=S.width,B=S.height,D=Math.max(D,H),P=Math.max(P,B),M+=H+f,_+=B+l,L.push(S)}else{g=0,y=r.length;for(;g<y;++g)i=r[g],a=this._getStylesBySeriesType(i,w),w||(w=a.shape,w||(w=e.Circle)),E=e.Lang.isArray(w)?w[g]:w,S=this._getLegendItem(n,this._getShapeClass(w),a.fill,a.border,d,A,O,i.get("valueDisplayName")),H=S.width,B=S.height,D=Math.max(D,H),P=Math.max(P,B),M+=H+f,_+=B+l,L.push(S)}this._drawing=!1,this._callLater?this._drawLegend():(m._positionLegendItems.apply(this,[L,D,P,M,_,o,f,l,h]),this._updateBackground(s),this.fire("legendRendered"))},_updateBackground:function(e){var t=e.background,n=this._contentRect,r=e.padding,i=n.left-r.left,s=n.top-r.top,o=n.right-i+r.right,u=n.bottom-s+r.bottom;this.get("background").set({fill:t.fill,stroke:t.border,width:o,height:u,x:i,y:s})},_getStylesBySeriesType:function(t){var n=t.get("styles"),r;return t instanceof e.LineSeries||t instanceof e.StackedLineSeries?(n=t.get("styles").line,r=n.color||t._getDefaultColor(t.get("graphOrder"),"line"),{border:{weight:1,color:r},fill:{color:r}}):t instanceof e.AreaSeries||t instanceof e.StackedAreaSeries?(n=t.get("styles").area,r=n.color||t._getDefaultColor(t.get("graphOrder"),"slice"),{border:{weight:1,color:r},fill:{color:r}}):(n=t.get("styles").marker,{fill:n.fill,border:{weight:n.border.weight,color:n.border.color,shape:n.shape},shape:n.shape})},_getLegendItem:function(t,r,i,s,o,u,a,f){var l=e.one(n.createElement("div")),c=e.one(n.createElement("span")),p,d,m,g,y,b=r;return l.setStyle(h,"absolute"),c.setStyle(h,"absolute"),c.setStyles(o),c.appendChild(n.createTextNode(f)),l.appendChild(c),t.appendChild(l),d=c.get("offsetHeight"),m=d-a,g=u+m+2,c.setStyle("left",g+v),l.setStyle("height",d+v),l.setStyle("width",g+c.get("offsetWidth")+v),p=new b({fill:i,stroke:s,width:u,height:a,x:m*.5,y:m*.5,w:u,h:a,graphic:l}),c.setStyle("left",d+v),y={node:l,width:l.get("offsetWidth"),height:l.get("offsetHeight"),shape:p,textNode:c,text:f},this._items.push(y),y},_getShapeClass:function(){var e=this.get("background").get("graphic");return e._getShapeClass.apply(e,arguments)},_getDefaultStyles:function(){var e={padding:{top:8,right:8,bottom:8,left:9},gap:10,hAlign:"center",vAlign:"top",marker:this._getPlotDefaults(),item:{hSpacing:10,vSpacing:5,label:{color:"#808080",fontSize:"85%",whiteSpace:"nowrap"}},background:{shape:"rect",fill:{color:"#faf9f2"},border:{color:"#dad8c9",weight:1}}};return e},_getPlotDefaults:function(){var e={width:10,height:10};return e},_destroyLegendItems:function(){var e;if(this._items)while(this._items.length>0)e=this._items.shift(),e.shape.get("graphic").destroy(),e.node.empty(),e.node.destroy(!0),e.node=null,e=null;this._items=[]},_layout:{vertical:b,horizontal:y},destructor:function(){var e=this.get("background"),t;this._destroyLegendItems(),e&&(t=e.get("graphic"),t?t.destroy():e.destroy())}},{ATTRS:{includeInChartLayout:{value:!1},chart:{setter:function(t){return this.after("legendRendered",e.bind(t._itemRendered,t)),t}},direction:{value:"vertical"},position:{lazyAdd:!1,value:"right",setter:function(e){return e===r||e===s?this.set("direction",a):(e===o||e===i)&&this.set("direction",f)
,e}},width:{getter:function(){var e=this.get("chart"),t=this._parentNode;return t?e&&this.get("includeInChartLayout")||this._width?(this._width||(this._width=0),this._width):t.get("offsetWidth"):""},setter:function(e){return this._width=e,e}},height:{valueFn:"_heightGetter",getter:function(){var e=this.get("chart"),t=this._parentNode;return t?e&&this.get("includeInChartLayout")||this._height?(this._height||(this._height=0),this._height):t.get("offsetHeight"):""},setter:function(e){return this._height=e,e}},x:{lazyAdd:!1,value:0,setter:function(e){var t=this.get("boundingBox");return t&&t.setStyle(o,e+v),e}},y:{lazyAdd:!1,value:0,setter:function(e){var t=this.get("boundingBox");return t&&t.setStyle(r,e+v),e}},items:{getter:function(){return this._items}},background:{}}})},"@VERSION@",{requires:["charts-base"]});
| timnew/cdnjs | ajax/libs/yui/3.10.1/charts-legend/charts-legend-min.js | JavaScript | mit | 12,829 |
if (typeof _yuitest_coverage == "undefined"){
_yuitest_coverage = {};
_yuitest_coverline = function(src, line){
var coverage = _yuitest_coverage[src];
if (!coverage.lines[line]){
coverage.calledLines++;
}
coverage.lines[line]++;
};
_yuitest_coverfunc = function(src, name, line){
var coverage = _yuitest_coverage[src],
funcId = name + ":" + line;
if (!coverage.functions[funcId]){
coverage.calledFunctions++;
}
coverage.functions[funcId]++;
};
}
_yuitest_coverage["build/transition/transition.js"] = {
lines: {},
functions: {},
coveredLines: 0,
calledLines: 0,
coveredFunctions: 0,
calledFunctions: 0,
path: "build/transition/transition.js",
code: []
};
_yuitest_coverage["build/transition/transition.js"].code=["YUI.add('transition', function (Y, NAME) {","","/**","* Provides the transition method for Node.","* Transition has no API of its own, but adds the transition method to Node.","*","* @module transition","* @requires node-style","*/","","var CAMEL_VENDOR_PREFIX = '',"," VENDOR_PREFIX = '',"," DOCUMENT = Y.config.doc,"," DOCUMENT_ELEMENT = 'documentElement',"," TRANSITION = 'transition',"," TRANSITION_CAMEL = 'Transition',"," TRANSITION_PROPERTY_CAMEL,"," TRANSITION_PROPERTY,"," TRANSITION_DURATION,"," TRANSITION_TIMING_FUNCTION,"," TRANSITION_DELAY,"," TRANSITION_END,"," ON_TRANSITION_END,"," TRANSFORM_CAMEL,",""," EMPTY_OBJ = {},",""," VENDORS = ["," 'Webkit',"," 'Moz'"," ],",""," VENDOR_TRANSITION_END = {"," Webkit: 'webkitTransitionEnd'"," },","","/**"," * A class for constructing transition instances."," * Adds the \"transition\" method to Node."," * @class Transition"," * @constructor"," */","","Transition = function() {"," this.init.apply(this, arguments);","};","","Transition._toCamel = function(property) {"," property = property.replace(/-([a-z])/gi, function(m0, m1) {"," return m1.toUpperCase();"," });",""," return property;","};","","Transition._toHyphen = function(property) {"," property = property.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g, function(m0, m1, m2, m3) {"," var str = ((m1) ? '-' + m1.toLowerCase() : '') + m2;"," "," if (m3) {"," str += '-' + m3.toLowerCase();"," }",""," return str;"," }); ",""," return property;","};","","Transition.SHOW_TRANSITION = 'fadeIn';","Transition.HIDE_TRANSITION = 'fadeOut';","","Transition.useNative = false;","","Y.Array.each(VENDORS, function(val) { // then vendor specific"," var property = val + TRANSITION_CAMEL;"," if (property in DOCUMENT[DOCUMENT_ELEMENT].style) {"," CAMEL_VENDOR_PREFIX = val;"," VENDOR_PREFIX = Transition._toHyphen(val) + '-';",""," Transition.useNative = true;"," Transition.supported = true; // TODO: remove"," Transition._VENDOR_PREFIX = val;"," }","});","","TRANSITION_CAMEL = CAMEL_VENDOR_PREFIX + TRANSITION_CAMEL;","TRANSITION_PROPERTY_CAMEL = CAMEL_VENDOR_PREFIX + 'TransitionProperty';","TRANSITION_PROPERTY = VENDOR_PREFIX + 'transition-property';","TRANSITION_DURATION = VENDOR_PREFIX + 'transition-duration';","TRANSITION_TIMING_FUNCTION = VENDOR_PREFIX + 'transition-timing-function';","TRANSITION_DELAY = VENDOR_PREFIX + 'transition-delay';","TRANSITION_END = 'transitionend';","ON_TRANSITION_END = 'on' + CAMEL_VENDOR_PREFIX.toLowerCase() + 'transitionend';","","TRANSITION_END = VENDOR_TRANSITION_END[CAMEL_VENDOR_PREFIX] || TRANSITION_END;","","TRANSFORM_CAMEL = CAMEL_VENDOR_PREFIX + 'Transform';","","Transition.fx = {};","Transition.toggles = {};","","Transition._hasEnd = {};","","Transition._reKeywords = /^(?:node|duration|iterations|easing|delay|on|onstart|onend)$/i;","","Y.Node.DOM_EVENTS[TRANSITION_END] = 1; ","","Transition.NAME = 'transition';","","Transition.DEFAULT_EASING = 'ease';","Transition.DEFAULT_DURATION = 0.5;","Transition.DEFAULT_DELAY = 0;","","Transition._nodeAttrs = {};","","Transition.prototype = {"," constructor: Transition,"," init: function(node, config) {"," var anim = this;"," anim._node = node;"," if (!anim._running && config) {"," anim._config = config;"," node._transition = anim; // cache for reuse",""," anim._duration = ('duration' in config) ?"," config.duration: anim.constructor.DEFAULT_DURATION;",""," anim._delay = ('delay' in config) ?"," config.delay: anim.constructor.DEFAULT_DELAY;",""," anim._easing = config.easing || anim.constructor.DEFAULT_EASING;"," anim._count = 0; // track number of animated properties"," anim._running = false;",""," }",""," return anim;"," },",""," addProperty: function(prop, config) {"," var anim = this,"," node = this._node,"," uid = Y.stamp(node),"," nodeInstance = Y.one(node),"," attrs = Transition._nodeAttrs[uid],"," computed,"," compareVal,"," dur,"," attr,"," val;",""," if (!attrs) {"," attrs = Transition._nodeAttrs[uid] = {};"," }",""," attr = attrs[prop];",""," // might just be a value"," if (config && config.value !== undefined) {"," val = config.value;"," } else if (config !== undefined) {"," val = config; "," config = EMPTY_OBJ;"," }",""," if (typeof val === 'function') {"," val = val.call(nodeInstance, nodeInstance);"," }",""," if (attr && attr.transition) {"," // take control if another transition owns this property"," if (attr.transition !== anim) {"," attr.transition._count--; // remapping attr to this transition"," }"," } ",""," anim._count++; // properties per transition",""," // make 0 async and fire events"," dur = ((typeof config.duration != 'undefined') ? config.duration :"," anim._duration) || 0.0001;",""," attrs[prop] = {"," value: val,"," duration: dur,"," delay: (typeof config.delay != 'undefined') ? config.delay :"," anim._delay,",""," easing: config.easing || anim._easing,",""," transition: anim"," };",""," // native end event doesnt fire when setting to same value"," // supplementing with timer"," // val may be a string or number (height: 0, etc), but computedStyle is always string"," computed = Y.DOM.getComputedStyle(node, prop);"," compareVal = (typeof val === 'string') ? computed : parseFloat(computed);",""," if (Transition.useNative && compareVal === val) {"," setTimeout(function() {"," anim._onNativeEnd.call(node, {"," propertyName: prop,"," elapsedTime: dur"," });"," }, dur * 1000);"," }"," },",""," removeProperty: function(prop) {"," var anim = this,"," attrs = Transition._nodeAttrs[Y.stamp(anim._node)];",""," if (attrs && attrs[prop]) {"," delete attrs[prop];"," anim._count--;"," }",""," },",""," initAttrs: function(config) {"," var attr,"," node = this._node;",""," if (config.transform && !config[TRANSFORM_CAMEL]) {"," config[TRANSFORM_CAMEL] = config.transform;"," delete config.transform; // TODO: copy"," }",""," for (attr in config) {"," if (config.hasOwnProperty(attr) && !Transition._reKeywords.test(attr)) {"," this.addProperty(attr, config[attr]);",""," // when size is auto or % webkit starts from zero instead of computed "," // (https://bugs.webkit.org/show_bug.cgi?id=16020)"," // TODO: selective set"," if (node.style[attr] === '') {"," Y.DOM.setStyle(node, attr, Y.DOM.getComputedStyle(node, attr));"," }"," }"," }"," },",""," /**"," * Starts or an animation."," * @method run"," * @chainable"," * @private"," */ "," run: function(callback) {"," var anim = this,"," node = anim._node,"," config = anim._config,"," data = {"," type: 'transition:start',"," config: config"," };","",""," if (!anim._running) {"," anim._running = true;",""," if (config.on && config.on.start) {"," config.on.start.call(Y.one(node), data);"," }",""," anim.initAttrs(anim._config);",""," anim._callback = callback;"," anim._start();"," }","",""," return anim;"," },",""," _start: function() {"," this._runNative();"," },",""," _prepDur: function(dur) {"," dur = parseFloat(dur);",""," return dur + 's';"," },",""," _runNative: function(time) {"," var anim = this,"," node = anim._node,"," uid = Y.stamp(node),"," style = node.style,"," computed = node.ownerDocument.defaultView.getComputedStyle(node),"," attrs = Transition._nodeAttrs[uid],"," cssText = '',"," cssTransition = computed[Transition._toCamel(TRANSITION_PROPERTY)],",""," transitionText = TRANSITION_PROPERTY + ': ',"," duration = TRANSITION_DURATION + ': ',"," easing = TRANSITION_TIMING_FUNCTION + ': ',"," delay = TRANSITION_DELAY + ': ',"," hyphy,"," attr,"," name;",""," // preserve existing transitions"," if (cssTransition !== 'all') {"," transitionText += cssTransition + ',';"," duration += computed[Transition._toCamel(TRANSITION_DURATION)] + ',';"," easing += computed[Transition._toCamel(TRANSITION_TIMING_FUNCTION)] + ',';"," delay += computed[Transition._toCamel(TRANSITION_DELAY)] + ',';",""," }",""," // run transitions mapped to this instance"," for (name in attrs) {"," hyphy = Transition._toHyphen(name);"," attr = attrs[name];"," if ((attr = attrs[name]) && attr.transition === anim) {"," if (name in node.style) { // only native styles allowed"," duration += anim._prepDur(attr.duration) + ',';"," delay += anim._prepDur(attr.delay) + ',';"," easing += (attr.easing) + ',';",""," transitionText += hyphy + ',';"," cssText += hyphy + ': ' + attr.value + '; ';"," } else {"," this.removeProperty(name);"," }"," }"," }",""," transitionText = transitionText.replace(/,$/, ';');"," duration = duration.replace(/,$/, ';');"," easing = easing.replace(/,$/, ';');"," delay = delay.replace(/,$/, ';');",""," // only one native end event per node"," if (!Transition._hasEnd[uid]) {"," node.addEventListener(TRANSITION_END, anim._onNativeEnd, '');"," Transition._hasEnd[uid] = true;",""," }"," "," style.cssText += transitionText + duration + easing + delay + cssText;",""," },",""," _end: function(elapsed) {"," var anim = this,"," node = anim._node,"," callback = anim._callback,"," config = anim._config,"," data = {"," type: 'transition:end',"," config: config,"," elapsedTime: elapsed "," },",""," nodeInstance = Y.one(node); ",""," anim._running = false;"," anim._callback = null;",""," if (node) {"," if (config.on && config.on.end) {"," setTimeout(function() { // IE: allow previous update to finish"," config.on.end.call(nodeInstance, data);",""," // nested to ensure proper fire order"," if (callback) {"," callback.call(nodeInstance, data);"," }",""," }, 1);"," } else if (callback) {"," setTimeout(function() { // IE: allow previous update to finish"," callback.call(nodeInstance, data);"," }, 1);"," }"," }",""," },",""," _endNative: function(name) {"," var node = this._node,"," value = node.ownerDocument.defaultView.getComputedStyle(node, '')[Transition._toCamel(TRANSITION_PROPERTY)];",""," name = Transition._toHyphen(name);"," if (typeof value === 'string') {"," value = value.replace(new RegExp('(?:^|,\\\\s)' + name + ',?'), ',');"," value = value.replace(/^,|,$/, '');"," node.style[TRANSITION_CAMEL] = value;"," }"," },",""," _onNativeEnd: function(e) {"," var node = this,"," uid = Y.stamp(node),"," event = e,//e._event,"," name = Transition._toCamel(event.propertyName),"," elapsed = event.elapsedTime,"," attrs = Transition._nodeAttrs[uid],"," attr = attrs[name],"," anim = (attr) ? attr.transition : null,"," data,"," config;",""," if (anim) {"," anim.removeProperty(name);"," anim._endNative(name);"," config = anim._config[name];",""," data = {"," type: 'propertyEnd',"," propertyName: name,"," elapsedTime: elapsed,"," config: config"," };",""," if (config && config.on && config.on.end) {"," config.on.end.call(Y.one(node), data);"," }",""," if (anim._count <= 0) { // after propertyEnd fires"," anim._end(elapsed);"," node.style[TRANSITION_PROPERTY_CAMEL] = ''; // clean up style"," }"," }"," },",""," destroy: function() {"," var anim = this,"," node = anim._node;",""," if (node) {"," node.removeEventListener(TRANSITION_END, anim._onNativeEnd, false);"," anim._node = null;"," }"," }","};","","Y.Transition = Transition;","Y.TransitionNative = Transition; // TODO: remove","","/** "," * Animate one or more css properties to a given value. Requires the \"transition\" module."," * <pre>example usage:"," * Y.one('#demo').transition({"," * duration: 1, // in seconds, default is 0.5"," * easing: 'ease-out', // default is 'ease'"," * delay: '1', // delay start for 1 second, default is 0"," *"," * height: '10px',"," * width: '10px',"," *"," * opacity: { // per property"," * value: 0,"," * duration: 2,"," * delay: 2,"," * easing: 'ease-in'"," * }"," * });"," * </pre>"," * @for Node"," * @method transition"," * @param {Object} config An object containing one or more style properties, a duration and an easing."," * @param {Function} callback A function to run after the transition has completed. "," * @chainable","*/","Y.Node.prototype.transition = function(name, config, callback) {"," var "," transitionAttrs = Transition._nodeAttrs[Y.stamp(this._node)],"," anim = (transitionAttrs) ? transitionAttrs.transition || null : null,"," fxConfig,"," prop;"," "," if (typeof name === 'string') { // named effect, pull config from registry"," if (typeof config === 'function') {"," callback = config;"," config = null;"," }",""," fxConfig = Transition.fx[name];",""," if (config && typeof config !== 'boolean') {"," config = Y.clone(config);",""," for (prop in fxConfig) {"," if (fxConfig.hasOwnProperty(prop)) {"," if (! (prop in config)) {"," config[prop] = fxConfig[prop]; "," }"," }"," }"," } else {"," config = fxConfig;"," }",""," } else { // name is a config, config is a callback or undefined"," callback = config;"," config = name;"," }",""," if (anim && !anim._running) {"," anim.init(this, config);"," } else {"," anim = new Transition(this._node, config);"," }",""," anim.run(callback);"," return this;","};","","Y.Node.prototype.show = function(name, config, callback) {"," this._show(); // show prior to transition"," if (name && Y.Transition) {"," if (typeof name !== 'string' && !name.push) { // named effect or array of effects supercedes default"," if (typeof config === 'function') {"," callback = config;"," config = name;"," }"," name = Transition.SHOW_TRANSITION; "," } "," this.transition(name, config, callback);"," } "," return this;","};","","var _wrapCallBack = function(anim, fn, callback) {"," return function() {"," if (fn) {"," fn.call(anim);"," }"," if (callback) {"," callback.apply(anim._node, arguments);"," }"," };","};","","Y.Node.prototype.hide = function(name, config, callback) {"," if (name && Y.Transition) {"," if (typeof config === 'function') {"," callback = config;"," config = null;"," }",""," callback = _wrapCallBack(this, this._hide, callback); // wrap with existing callback"," if (typeof name !== 'string' && !name.push) { // named effect or array of effects supercedes default"," if (typeof config === 'function') {"," callback = config;"," config = name;"," }"," name = Transition.HIDE_TRANSITION; "," } "," this.transition(name, config, callback);"," } else {"," this._hide();"," } "," return this;","}; ","","/** "," * Animate one or more css properties to a given value. Requires the \"transition\" module."," * <pre>example usage:"," * Y.all('.demo').transition({"," * duration: 1, // in seconds, default is 0.5"," * easing: 'ease-out', // default is 'ease'"," * delay: '1', // delay start for 1 second, default is 0"," *"," * height: '10px',"," * width: '10px',"," *"," * opacity: { // per property"," * value: 0,"," * duration: 2,"," * delay: 2,"," * easing: 'ease-in'"," * }"," * });"," * </pre>"," * @for NodeList"," * @method transition"," * @param {Object} config An object containing one or more style properties, a duration and an easing."," * @param {Function} callback A function to run after the transition has completed. The callback fires"," * once per item in the NodeList."," * @chainable","*/","Y.NodeList.prototype.transition = function(config, callback) {"," var nodes = this._nodes,"," i = 0,"," node;",""," while ((node = nodes[i++])) {"," Y.one(node).transition(config, callback);"," }",""," return this;","};","","Y.Node.prototype.toggleView = function(name, on, callback) {"," this._toggles = this._toggles || [];"," callback = arguments[arguments.length - 1];",""," if (typeof name == 'boolean') { // no transition, just toggle"," on = name;"," name = null;"," }",""," name = name || Y.Transition.DEFAULT_TOGGLE;",""," if (typeof on == 'undefined' && name in this._toggles) { // reverse current toggle"," on = ! this._toggles[name];"," }",""," on = (on) ? 1 : 0;"," if (on) {"," this._show();"," } else {"," callback = _wrapCallBack(this, this._hide, callback);"," }",""," this._toggles[name] = on;"," this.transition(Y.Transition.toggles[name][on], callback);",""," return this;","};","","Y.NodeList.prototype.toggleView = function(name, on, callback) {"," var nodes = this._nodes,"," i = 0,"," node;",""," while ((node = nodes[i++])) {"," Y.one(node).toggleView(name, on, callback);"," }",""," return this;","};","","Y.mix(Transition.fx, {"," fadeOut: {"," opacity: 0,"," duration: 0.5,"," easing: 'ease-out'"," },",""," fadeIn: {"," opacity: 1,"," duration: 0.5,"," easing: 'ease-in'"," },",""," sizeOut: {"," height: 0,"," width: 0,"," duration: 0.75,"," easing: 'ease-out'"," },",""," sizeIn: {"," height: function(node) {"," return node.get('scrollHeight') + 'px';"," },"," width: function(node) {"," return node.get('scrollWidth') + 'px';"," },"," duration: 0.5,"," easing: 'ease-in',"," "," on: {"," start: function() {"," var overflow = this.getStyle('overflow');"," if (overflow !== 'hidden') { // enable scrollHeight/Width"," this.setStyle('overflow', 'hidden');"," this._transitionOverflow = overflow;"," }"," },",""," end: function() {"," if (this._transitionOverflow) { // revert overridden value"," this.setStyle('overflow', this._transitionOverflow);"," delete this._transitionOverflow;"," }"," }"," } "," }","});","","Y.mix(Transition.toggles, {"," size: ['sizeOut', 'sizeIn'],"," fade: ['fadeOut', 'fadeIn']","});","","Transition.DEFAULT_TOGGLE = 'fade';","","","","}, '@VERSION@', {\"requires\": [\"node-style\"]});"];
_yuitest_coverage["build/transition/transition.js"].lines = {"1":0,"11":0,"45":0,"48":0,"49":0,"50":0,"53":0,"56":0,"57":0,"58":0,"60":0,"61":0,"64":0,"67":0,"70":0,"71":0,"73":0,"75":0,"76":0,"77":0,"78":0,"79":0,"81":0,"82":0,"83":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"96":0,"98":0,"100":0,"101":0,"103":0,"105":0,"107":0,"109":0,"111":0,"112":0,"113":0,"115":0,"117":0,"120":0,"121":0,"122":0,"123":0,"124":0,"126":0,"129":0,"132":0,"133":0,"134":0,"138":0,"142":0,"153":0,"154":0,"157":0,"160":0,"161":0,"162":0,"163":0,"164":0,"167":0,"168":0,"171":0,"173":0,"174":0,"178":0,"181":0,"184":0,"198":0,"199":0,"201":0,"202":0,"203":0,"212":0,"215":0,"216":0,"217":0,"223":0,"226":0,"227":0,"228":0,"231":0,"232":0,"233":0,"238":0,"239":0,"252":0,"261":0,"262":0,"264":0,"265":0,"268":0,"270":0,"271":0,"275":0,"279":0,"283":0,"285":0,"289":0,"307":0,"308":0,"309":0,"310":0,"311":0,"316":0,"317":0,"318":0,"319":0,"320":0,"321":0,"322":0,"323":0,"325":0,"326":0,"328":0,"333":0,"334":0,"335":0,"336":0,"339":0,"340":0,"341":0,"345":0,"350":0,"362":0,"363":0,"365":0,"366":0,"367":0,"368":0,"371":0,"372":0,"376":0,"377":0,"378":0,"386":0,"389":0,"390":0,"391":0,"392":0,"393":0,"398":0,"409":0,"410":0,"411":0,"412":0,"414":0,"421":0,"422":0,"425":0,"426":0,"427":0,"433":0,"436":0,"437":0,"438":0,"443":0,"444":0,"471":0,"472":0,"478":0,"479":0,"480":0,"481":0,"484":0,"486":0,"487":0,"489":0,"490":0,"491":0,"492":0,"497":0,"501":0,"502":0,"505":0,"506":0,"508":0,"511":0,"512":0,"515":0,"516":0,"517":0,"518":0,"519":0,"520":0,"521":0,"523":0,"525":0,"527":0,"530":0,"531":0,"532":0,"533":0,"535":0,"536":0,"541":0,"542":0,"543":0,"544":0,"545":0,"548":0,"549":0,"550":0,"551":0,"552":0,"554":0,"556":0,"558":0,"560":0,"589":0,"590":0,"594":0,"595":0,"598":0,"601":0,"602":0,"603":0,"605":0,"606":0,"607":0,"610":0,"612":0,"613":0,"616":0,"617":0,"618":0,"620":0,"623":0,"624":0,"626":0,"629":0,"630":0,"634":0,"635":0,"638":0,"641":0,"663":0,"666":0,"673":0,"674":0,"675":0,"676":0,"681":0,"682":0,"683":0,"690":0,"695":0};
_yuitest_coverage["build/transition/transition.js"].functions = {"Transition:44":0,"(anonymous 2):49":0,"_toCamel:48":0,"(anonymous 3):57":0,"_toHyphen:56":0,"(anonymous 4):75":0,"init:119":0,"(anonymous 5):202":0,"addProperty:141":0,"removeProperty:211":0,"initAttrs:222":0,"run:251":0,"_start:278":0,"_prepDur:282":0,"_runNative:288":0,"(anonymous 6):367":0,"(anonymous 7):377":0,"_end:349":0,"_endNative:385":0,"_onNativeEnd:397":0,"destroy:432":0,"transition:471":0,"show:515":0,"(anonymous 8):531":0,"_wrapCallBack:530":0,"hide:541":0,"transition:589":0,"toggleView:601":0,"toggleView:629":0,"height:662":0,"width:665":0,"start:672":0,"end:680":0,"(anonymous 1):1":0};
_yuitest_coverage["build/transition/transition.js"].coveredLines = 253;
_yuitest_coverage["build/transition/transition.js"].coveredFunctions = 34;
_yuitest_coverline("build/transition/transition.js", 1);
YUI.add('transition', function (Y, NAME) {
/**
* Provides the transition method for Node.
* Transition has no API of its own, but adds the transition method to Node.
*
* @module transition
* @requires node-style
*/
_yuitest_coverfunc("build/transition/transition.js", "(anonymous 1)", 1);
_yuitest_coverline("build/transition/transition.js", 11);
var CAMEL_VENDOR_PREFIX = '',
VENDOR_PREFIX = '',
DOCUMENT = Y.config.doc,
DOCUMENT_ELEMENT = 'documentElement',
TRANSITION = 'transition',
TRANSITION_CAMEL = 'Transition',
TRANSITION_PROPERTY_CAMEL,
TRANSITION_PROPERTY,
TRANSITION_DURATION,
TRANSITION_TIMING_FUNCTION,
TRANSITION_DELAY,
TRANSITION_END,
ON_TRANSITION_END,
TRANSFORM_CAMEL,
EMPTY_OBJ = {},
VENDORS = [
'Webkit',
'Moz'
],
VENDOR_TRANSITION_END = {
Webkit: 'webkitTransitionEnd'
},
/**
* A class for constructing transition instances.
* Adds the "transition" method to Node.
* @class Transition
* @constructor
*/
Transition = function() {
_yuitest_coverfunc("build/transition/transition.js", "Transition", 44);
_yuitest_coverline("build/transition/transition.js", 45);
this.init.apply(this, arguments);
};
_yuitest_coverline("build/transition/transition.js", 48);
Transition._toCamel = function(property) {
_yuitest_coverfunc("build/transition/transition.js", "_toCamel", 48);
_yuitest_coverline("build/transition/transition.js", 49);
property = property.replace(/-([a-z])/gi, function(m0, m1) {
_yuitest_coverfunc("build/transition/transition.js", "(anonymous 2)", 49);
_yuitest_coverline("build/transition/transition.js", 50);
return m1.toUpperCase();
});
_yuitest_coverline("build/transition/transition.js", 53);
return property;
};
_yuitest_coverline("build/transition/transition.js", 56);
Transition._toHyphen = function(property) {
_yuitest_coverfunc("build/transition/transition.js", "_toHyphen", 56);
_yuitest_coverline("build/transition/transition.js", 57);
property = property.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g, function(m0, m1, m2, m3) {
_yuitest_coverfunc("build/transition/transition.js", "(anonymous 3)", 57);
_yuitest_coverline("build/transition/transition.js", 58);
var str = ((m1) ? '-' + m1.toLowerCase() : '') + m2;
_yuitest_coverline("build/transition/transition.js", 60);
if (m3) {
_yuitest_coverline("build/transition/transition.js", 61);
str += '-' + m3.toLowerCase();
}
_yuitest_coverline("build/transition/transition.js", 64);
return str;
});
_yuitest_coverline("build/transition/transition.js", 67);
return property;
};
_yuitest_coverline("build/transition/transition.js", 70);
Transition.SHOW_TRANSITION = 'fadeIn';
_yuitest_coverline("build/transition/transition.js", 71);
Transition.HIDE_TRANSITION = 'fadeOut';
_yuitest_coverline("build/transition/transition.js", 73);
Transition.useNative = false;
_yuitest_coverline("build/transition/transition.js", 75);
Y.Array.each(VENDORS, function(val) { // then vendor specific
_yuitest_coverfunc("build/transition/transition.js", "(anonymous 4)", 75);
_yuitest_coverline("build/transition/transition.js", 76);
var property = val + TRANSITION_CAMEL;
_yuitest_coverline("build/transition/transition.js", 77);
if (property in DOCUMENT[DOCUMENT_ELEMENT].style) {
_yuitest_coverline("build/transition/transition.js", 78);
CAMEL_VENDOR_PREFIX = val;
_yuitest_coverline("build/transition/transition.js", 79);
VENDOR_PREFIX = Transition._toHyphen(val) + '-';
_yuitest_coverline("build/transition/transition.js", 81);
Transition.useNative = true;
_yuitest_coverline("build/transition/transition.js", 82);
Transition.supported = true; // TODO: remove
_yuitest_coverline("build/transition/transition.js", 83);
Transition._VENDOR_PREFIX = val;
}
});
_yuitest_coverline("build/transition/transition.js", 87);
TRANSITION_CAMEL = CAMEL_VENDOR_PREFIX + TRANSITION_CAMEL;
_yuitest_coverline("build/transition/transition.js", 88);
TRANSITION_PROPERTY_CAMEL = CAMEL_VENDOR_PREFIX + 'TransitionProperty';
_yuitest_coverline("build/transition/transition.js", 89);
TRANSITION_PROPERTY = VENDOR_PREFIX + 'transition-property';
_yuitest_coverline("build/transition/transition.js", 90);
TRANSITION_DURATION = VENDOR_PREFIX + 'transition-duration';
_yuitest_coverline("build/transition/transition.js", 91);
TRANSITION_TIMING_FUNCTION = VENDOR_PREFIX + 'transition-timing-function';
_yuitest_coverline("build/transition/transition.js", 92);
TRANSITION_DELAY = VENDOR_PREFIX + 'transition-delay';
_yuitest_coverline("build/transition/transition.js", 93);
TRANSITION_END = 'transitionend';
_yuitest_coverline("build/transition/transition.js", 94);
ON_TRANSITION_END = 'on' + CAMEL_VENDOR_PREFIX.toLowerCase() + 'transitionend';
_yuitest_coverline("build/transition/transition.js", 96);
TRANSITION_END = VENDOR_TRANSITION_END[CAMEL_VENDOR_PREFIX] || TRANSITION_END;
_yuitest_coverline("build/transition/transition.js", 98);
TRANSFORM_CAMEL = CAMEL_VENDOR_PREFIX + 'Transform';
_yuitest_coverline("build/transition/transition.js", 100);
Transition.fx = {};
_yuitest_coverline("build/transition/transition.js", 101);
Transition.toggles = {};
_yuitest_coverline("build/transition/transition.js", 103);
Transition._hasEnd = {};
_yuitest_coverline("build/transition/transition.js", 105);
Transition._reKeywords = /^(?:node|duration|iterations|easing|delay|on|onstart|onend)$/i;
_yuitest_coverline("build/transition/transition.js", 107);
Y.Node.DOM_EVENTS[TRANSITION_END] = 1;
_yuitest_coverline("build/transition/transition.js", 109);
Transition.NAME = 'transition';
_yuitest_coverline("build/transition/transition.js", 111);
Transition.DEFAULT_EASING = 'ease';
_yuitest_coverline("build/transition/transition.js", 112);
Transition.DEFAULT_DURATION = 0.5;
_yuitest_coverline("build/transition/transition.js", 113);
Transition.DEFAULT_DELAY = 0;
_yuitest_coverline("build/transition/transition.js", 115);
Transition._nodeAttrs = {};
_yuitest_coverline("build/transition/transition.js", 117);
Transition.prototype = {
constructor: Transition,
init: function(node, config) {
_yuitest_coverfunc("build/transition/transition.js", "init", 119);
_yuitest_coverline("build/transition/transition.js", 120);
var anim = this;
_yuitest_coverline("build/transition/transition.js", 121);
anim._node = node;
_yuitest_coverline("build/transition/transition.js", 122);
if (!anim._running && config) {
_yuitest_coverline("build/transition/transition.js", 123);
anim._config = config;
_yuitest_coverline("build/transition/transition.js", 124);
node._transition = anim; // cache for reuse
_yuitest_coverline("build/transition/transition.js", 126);
anim._duration = ('duration' in config) ?
config.duration: anim.constructor.DEFAULT_DURATION;
_yuitest_coverline("build/transition/transition.js", 129);
anim._delay = ('delay' in config) ?
config.delay: anim.constructor.DEFAULT_DELAY;
_yuitest_coverline("build/transition/transition.js", 132);
anim._easing = config.easing || anim.constructor.DEFAULT_EASING;
_yuitest_coverline("build/transition/transition.js", 133);
anim._count = 0; // track number of animated properties
_yuitest_coverline("build/transition/transition.js", 134);
anim._running = false;
}
_yuitest_coverline("build/transition/transition.js", 138);
return anim;
},
addProperty: function(prop, config) {
_yuitest_coverfunc("build/transition/transition.js", "addProperty", 141);
_yuitest_coverline("build/transition/transition.js", 142);
var anim = this,
node = this._node,
uid = Y.stamp(node),
nodeInstance = Y.one(node),
attrs = Transition._nodeAttrs[uid],
computed,
compareVal,
dur,
attr,
val;
_yuitest_coverline("build/transition/transition.js", 153);
if (!attrs) {
_yuitest_coverline("build/transition/transition.js", 154);
attrs = Transition._nodeAttrs[uid] = {};
}
_yuitest_coverline("build/transition/transition.js", 157);
attr = attrs[prop];
// might just be a value
_yuitest_coverline("build/transition/transition.js", 160);
if (config && config.value !== undefined) {
_yuitest_coverline("build/transition/transition.js", 161);
val = config.value;
} else {_yuitest_coverline("build/transition/transition.js", 162);
if (config !== undefined) {
_yuitest_coverline("build/transition/transition.js", 163);
val = config;
_yuitest_coverline("build/transition/transition.js", 164);
config = EMPTY_OBJ;
}}
_yuitest_coverline("build/transition/transition.js", 167);
if (typeof val === 'function') {
_yuitest_coverline("build/transition/transition.js", 168);
val = val.call(nodeInstance, nodeInstance);
}
_yuitest_coverline("build/transition/transition.js", 171);
if (attr && attr.transition) {
// take control if another transition owns this property
_yuitest_coverline("build/transition/transition.js", 173);
if (attr.transition !== anim) {
_yuitest_coverline("build/transition/transition.js", 174);
attr.transition._count--; // remapping attr to this transition
}
}
_yuitest_coverline("build/transition/transition.js", 178);
anim._count++; // properties per transition
// make 0 async and fire events
_yuitest_coverline("build/transition/transition.js", 181);
dur = ((typeof config.duration != 'undefined') ? config.duration :
anim._duration) || 0.0001;
_yuitest_coverline("build/transition/transition.js", 184);
attrs[prop] = {
value: val,
duration: dur,
delay: (typeof config.delay != 'undefined') ? config.delay :
anim._delay,
easing: config.easing || anim._easing,
transition: anim
};
// native end event doesnt fire when setting to same value
// supplementing with timer
// val may be a string or number (height: 0, etc), but computedStyle is always string
_yuitest_coverline("build/transition/transition.js", 198);
computed = Y.DOM.getComputedStyle(node, prop);
_yuitest_coverline("build/transition/transition.js", 199);
compareVal = (typeof val === 'string') ? computed : parseFloat(computed);
_yuitest_coverline("build/transition/transition.js", 201);
if (Transition.useNative && compareVal === val) {
_yuitest_coverline("build/transition/transition.js", 202);
setTimeout(function() {
_yuitest_coverfunc("build/transition/transition.js", "(anonymous 5)", 202);
_yuitest_coverline("build/transition/transition.js", 203);
anim._onNativeEnd.call(node, {
propertyName: prop,
elapsedTime: dur
});
}, dur * 1000);
}
},
removeProperty: function(prop) {
_yuitest_coverfunc("build/transition/transition.js", "removeProperty", 211);
_yuitest_coverline("build/transition/transition.js", 212);
var anim = this,
attrs = Transition._nodeAttrs[Y.stamp(anim._node)];
_yuitest_coverline("build/transition/transition.js", 215);
if (attrs && attrs[prop]) {
_yuitest_coverline("build/transition/transition.js", 216);
delete attrs[prop];
_yuitest_coverline("build/transition/transition.js", 217);
anim._count--;
}
},
initAttrs: function(config) {
_yuitest_coverfunc("build/transition/transition.js", "initAttrs", 222);
_yuitest_coverline("build/transition/transition.js", 223);
var attr,
node = this._node;
_yuitest_coverline("build/transition/transition.js", 226);
if (config.transform && !config[TRANSFORM_CAMEL]) {
_yuitest_coverline("build/transition/transition.js", 227);
config[TRANSFORM_CAMEL] = config.transform;
_yuitest_coverline("build/transition/transition.js", 228);
delete config.transform; // TODO: copy
}
_yuitest_coverline("build/transition/transition.js", 231);
for (attr in config) {
_yuitest_coverline("build/transition/transition.js", 232);
if (config.hasOwnProperty(attr) && !Transition._reKeywords.test(attr)) {
_yuitest_coverline("build/transition/transition.js", 233);
this.addProperty(attr, config[attr]);
// when size is auto or % webkit starts from zero instead of computed
// (https://bugs.webkit.org/show_bug.cgi?id=16020)
// TODO: selective set
_yuitest_coverline("build/transition/transition.js", 238);
if (node.style[attr] === '') {
_yuitest_coverline("build/transition/transition.js", 239);
Y.DOM.setStyle(node, attr, Y.DOM.getComputedStyle(node, attr));
}
}
}
},
/**
* Starts or an animation.
* @method run
* @chainable
* @private
*/
run: function(callback) {
_yuitest_coverfunc("build/transition/transition.js", "run", 251);
_yuitest_coverline("build/transition/transition.js", 252);
var anim = this,
node = anim._node,
config = anim._config,
data = {
type: 'transition:start',
config: config
};
_yuitest_coverline("build/transition/transition.js", 261);
if (!anim._running) {
_yuitest_coverline("build/transition/transition.js", 262);
anim._running = true;
_yuitest_coverline("build/transition/transition.js", 264);
if (config.on && config.on.start) {
_yuitest_coverline("build/transition/transition.js", 265);
config.on.start.call(Y.one(node), data);
}
_yuitest_coverline("build/transition/transition.js", 268);
anim.initAttrs(anim._config);
_yuitest_coverline("build/transition/transition.js", 270);
anim._callback = callback;
_yuitest_coverline("build/transition/transition.js", 271);
anim._start();
}
_yuitest_coverline("build/transition/transition.js", 275);
return anim;
},
_start: function() {
_yuitest_coverfunc("build/transition/transition.js", "_start", 278);
_yuitest_coverline("build/transition/transition.js", 279);
this._runNative();
},
_prepDur: function(dur) {
_yuitest_coverfunc("build/transition/transition.js", "_prepDur", 282);
_yuitest_coverline("build/transition/transition.js", 283);
dur = parseFloat(dur);
_yuitest_coverline("build/transition/transition.js", 285);
return dur + 's';
},
_runNative: function(time) {
_yuitest_coverfunc("build/transition/transition.js", "_runNative", 288);
_yuitest_coverline("build/transition/transition.js", 289);
var anim = this,
node = anim._node,
uid = Y.stamp(node),
style = node.style,
computed = node.ownerDocument.defaultView.getComputedStyle(node),
attrs = Transition._nodeAttrs[uid],
cssText = '',
cssTransition = computed[Transition._toCamel(TRANSITION_PROPERTY)],
transitionText = TRANSITION_PROPERTY + ': ',
duration = TRANSITION_DURATION + ': ',
easing = TRANSITION_TIMING_FUNCTION + ': ',
delay = TRANSITION_DELAY + ': ',
hyphy,
attr,
name;
// preserve existing transitions
_yuitest_coverline("build/transition/transition.js", 307);
if (cssTransition !== 'all') {
_yuitest_coverline("build/transition/transition.js", 308);
transitionText += cssTransition + ',';
_yuitest_coverline("build/transition/transition.js", 309);
duration += computed[Transition._toCamel(TRANSITION_DURATION)] + ',';
_yuitest_coverline("build/transition/transition.js", 310);
easing += computed[Transition._toCamel(TRANSITION_TIMING_FUNCTION)] + ',';
_yuitest_coverline("build/transition/transition.js", 311);
delay += computed[Transition._toCamel(TRANSITION_DELAY)] + ',';
}
// run transitions mapped to this instance
_yuitest_coverline("build/transition/transition.js", 316);
for (name in attrs) {
_yuitest_coverline("build/transition/transition.js", 317);
hyphy = Transition._toHyphen(name);
_yuitest_coverline("build/transition/transition.js", 318);
attr = attrs[name];
_yuitest_coverline("build/transition/transition.js", 319);
if ((attr = attrs[name]) && attr.transition === anim) {
_yuitest_coverline("build/transition/transition.js", 320);
if (name in node.style) { // only native styles allowed
_yuitest_coverline("build/transition/transition.js", 321);
duration += anim._prepDur(attr.duration) + ',';
_yuitest_coverline("build/transition/transition.js", 322);
delay += anim._prepDur(attr.delay) + ',';
_yuitest_coverline("build/transition/transition.js", 323);
easing += (attr.easing) + ',';
_yuitest_coverline("build/transition/transition.js", 325);
transitionText += hyphy + ',';
_yuitest_coverline("build/transition/transition.js", 326);
cssText += hyphy + ': ' + attr.value + '; ';
} else {
_yuitest_coverline("build/transition/transition.js", 328);
this.removeProperty(name);
}
}
}
_yuitest_coverline("build/transition/transition.js", 333);
transitionText = transitionText.replace(/,$/, ';');
_yuitest_coverline("build/transition/transition.js", 334);
duration = duration.replace(/,$/, ';');
_yuitest_coverline("build/transition/transition.js", 335);
easing = easing.replace(/,$/, ';');
_yuitest_coverline("build/transition/transition.js", 336);
delay = delay.replace(/,$/, ';');
// only one native end event per node
_yuitest_coverline("build/transition/transition.js", 339);
if (!Transition._hasEnd[uid]) {
_yuitest_coverline("build/transition/transition.js", 340);
node.addEventListener(TRANSITION_END, anim._onNativeEnd, '');
_yuitest_coverline("build/transition/transition.js", 341);
Transition._hasEnd[uid] = true;
}
_yuitest_coverline("build/transition/transition.js", 345);
style.cssText += transitionText + duration + easing + delay + cssText;
},
_end: function(elapsed) {
_yuitest_coverfunc("build/transition/transition.js", "_end", 349);
_yuitest_coverline("build/transition/transition.js", 350);
var anim = this,
node = anim._node,
callback = anim._callback,
config = anim._config,
data = {
type: 'transition:end',
config: config,
elapsedTime: elapsed
},
nodeInstance = Y.one(node);
_yuitest_coverline("build/transition/transition.js", 362);
anim._running = false;
_yuitest_coverline("build/transition/transition.js", 363);
anim._callback = null;
_yuitest_coverline("build/transition/transition.js", 365);
if (node) {
_yuitest_coverline("build/transition/transition.js", 366);
if (config.on && config.on.end) {
_yuitest_coverline("build/transition/transition.js", 367);
setTimeout(function() { // IE: allow previous update to finish
_yuitest_coverfunc("build/transition/transition.js", "(anonymous 6)", 367);
_yuitest_coverline("build/transition/transition.js", 368);
config.on.end.call(nodeInstance, data);
// nested to ensure proper fire order
_yuitest_coverline("build/transition/transition.js", 371);
if (callback) {
_yuitest_coverline("build/transition/transition.js", 372);
callback.call(nodeInstance, data);
}
}, 1);
} else {_yuitest_coverline("build/transition/transition.js", 376);
if (callback) {
_yuitest_coverline("build/transition/transition.js", 377);
setTimeout(function() { // IE: allow previous update to finish
_yuitest_coverfunc("build/transition/transition.js", "(anonymous 7)", 377);
_yuitest_coverline("build/transition/transition.js", 378);
callback.call(nodeInstance, data);
}, 1);
}}
}
},
_endNative: function(name) {
_yuitest_coverfunc("build/transition/transition.js", "_endNative", 385);
_yuitest_coverline("build/transition/transition.js", 386);
var node = this._node,
value = node.ownerDocument.defaultView.getComputedStyle(node, '')[Transition._toCamel(TRANSITION_PROPERTY)];
_yuitest_coverline("build/transition/transition.js", 389);
name = Transition._toHyphen(name);
_yuitest_coverline("build/transition/transition.js", 390);
if (typeof value === 'string') {
_yuitest_coverline("build/transition/transition.js", 391);
value = value.replace(new RegExp('(?:^|,\\s)' + name + ',?'), ',');
_yuitest_coverline("build/transition/transition.js", 392);
value = value.replace(/^,|,$/, '');
_yuitest_coverline("build/transition/transition.js", 393);
node.style[TRANSITION_CAMEL] = value;
}
},
_onNativeEnd: function(e) {
_yuitest_coverfunc("build/transition/transition.js", "_onNativeEnd", 397);
_yuitest_coverline("build/transition/transition.js", 398);
var node = this,
uid = Y.stamp(node),
event = e,//e._event,
name = Transition._toCamel(event.propertyName),
elapsed = event.elapsedTime,
attrs = Transition._nodeAttrs[uid],
attr = attrs[name],
anim = (attr) ? attr.transition : null,
data,
config;
_yuitest_coverline("build/transition/transition.js", 409);
if (anim) {
_yuitest_coverline("build/transition/transition.js", 410);
anim.removeProperty(name);
_yuitest_coverline("build/transition/transition.js", 411);
anim._endNative(name);
_yuitest_coverline("build/transition/transition.js", 412);
config = anim._config[name];
_yuitest_coverline("build/transition/transition.js", 414);
data = {
type: 'propertyEnd',
propertyName: name,
elapsedTime: elapsed,
config: config
};
_yuitest_coverline("build/transition/transition.js", 421);
if (config && config.on && config.on.end) {
_yuitest_coverline("build/transition/transition.js", 422);
config.on.end.call(Y.one(node), data);
}
_yuitest_coverline("build/transition/transition.js", 425);
if (anim._count <= 0) { // after propertyEnd fires
_yuitest_coverline("build/transition/transition.js", 426);
anim._end(elapsed);
_yuitest_coverline("build/transition/transition.js", 427);
node.style[TRANSITION_PROPERTY_CAMEL] = ''; // clean up style
}
}
},
destroy: function() {
_yuitest_coverfunc("build/transition/transition.js", "destroy", 432);
_yuitest_coverline("build/transition/transition.js", 433);
var anim = this,
node = anim._node;
_yuitest_coverline("build/transition/transition.js", 436);
if (node) {
_yuitest_coverline("build/transition/transition.js", 437);
node.removeEventListener(TRANSITION_END, anim._onNativeEnd, false);
_yuitest_coverline("build/transition/transition.js", 438);
anim._node = null;
}
}
};
_yuitest_coverline("build/transition/transition.js", 443);
Y.Transition = Transition;
_yuitest_coverline("build/transition/transition.js", 444);
Y.TransitionNative = Transition; // TODO: remove
/**
* Animate one or more css properties to a given value. Requires the "transition" module.
* <pre>example usage:
* Y.one('#demo').transition({
* duration: 1, // in seconds, default is 0.5
* easing: 'ease-out', // default is 'ease'
* delay: '1', // delay start for 1 second, default is 0
*
* height: '10px',
* width: '10px',
*
* opacity: { // per property
* value: 0,
* duration: 2,
* delay: 2,
* easing: 'ease-in'
* }
* });
* </pre>
* @for Node
* @method transition
* @param {Object} config An object containing one or more style properties, a duration and an easing.
* @param {Function} callback A function to run after the transition has completed.
* @chainable
*/
_yuitest_coverline("build/transition/transition.js", 471);
Y.Node.prototype.transition = function(name, config, callback) {
_yuitest_coverfunc("build/transition/transition.js", "transition", 471);
_yuitest_coverline("build/transition/transition.js", 472);
var
transitionAttrs = Transition._nodeAttrs[Y.stamp(this._node)],
anim = (transitionAttrs) ? transitionAttrs.transition || null : null,
fxConfig,
prop;
_yuitest_coverline("build/transition/transition.js", 478);
if (typeof name === 'string') { // named effect, pull config from registry
_yuitest_coverline("build/transition/transition.js", 479);
if (typeof config === 'function') {
_yuitest_coverline("build/transition/transition.js", 480);
callback = config;
_yuitest_coverline("build/transition/transition.js", 481);
config = null;
}
_yuitest_coverline("build/transition/transition.js", 484);
fxConfig = Transition.fx[name];
_yuitest_coverline("build/transition/transition.js", 486);
if (config && typeof config !== 'boolean') {
_yuitest_coverline("build/transition/transition.js", 487);
config = Y.clone(config);
_yuitest_coverline("build/transition/transition.js", 489);
for (prop in fxConfig) {
_yuitest_coverline("build/transition/transition.js", 490);
if (fxConfig.hasOwnProperty(prop)) {
_yuitest_coverline("build/transition/transition.js", 491);
if (! (prop in config)) {
_yuitest_coverline("build/transition/transition.js", 492);
config[prop] = fxConfig[prop];
}
}
}
} else {
_yuitest_coverline("build/transition/transition.js", 497);
config = fxConfig;
}
} else { // name is a config, config is a callback or undefined
_yuitest_coverline("build/transition/transition.js", 501);
callback = config;
_yuitest_coverline("build/transition/transition.js", 502);
config = name;
}
_yuitest_coverline("build/transition/transition.js", 505);
if (anim && !anim._running) {
_yuitest_coverline("build/transition/transition.js", 506);
anim.init(this, config);
} else {
_yuitest_coverline("build/transition/transition.js", 508);
anim = new Transition(this._node, config);
}
_yuitest_coverline("build/transition/transition.js", 511);
anim.run(callback);
_yuitest_coverline("build/transition/transition.js", 512);
return this;
};
_yuitest_coverline("build/transition/transition.js", 515);
Y.Node.prototype.show = function(name, config, callback) {
_yuitest_coverfunc("build/transition/transition.js", "show", 515);
_yuitest_coverline("build/transition/transition.js", 516);
this._show(); // show prior to transition
_yuitest_coverline("build/transition/transition.js", 517);
if (name && Y.Transition) {
_yuitest_coverline("build/transition/transition.js", 518);
if (typeof name !== 'string' && !name.push) { // named effect or array of effects supercedes default
_yuitest_coverline("build/transition/transition.js", 519);
if (typeof config === 'function') {
_yuitest_coverline("build/transition/transition.js", 520);
callback = config;
_yuitest_coverline("build/transition/transition.js", 521);
config = name;
}
_yuitest_coverline("build/transition/transition.js", 523);
name = Transition.SHOW_TRANSITION;
}
_yuitest_coverline("build/transition/transition.js", 525);
this.transition(name, config, callback);
}
_yuitest_coverline("build/transition/transition.js", 527);
return this;
};
_yuitest_coverline("build/transition/transition.js", 530);
var _wrapCallBack = function(anim, fn, callback) {
_yuitest_coverfunc("build/transition/transition.js", "_wrapCallBack", 530);
_yuitest_coverline("build/transition/transition.js", 531);
return function() {
_yuitest_coverfunc("build/transition/transition.js", "(anonymous 8)", 531);
_yuitest_coverline("build/transition/transition.js", 532);
if (fn) {
_yuitest_coverline("build/transition/transition.js", 533);
fn.call(anim);
}
_yuitest_coverline("build/transition/transition.js", 535);
if (callback) {
_yuitest_coverline("build/transition/transition.js", 536);
callback.apply(anim._node, arguments);
}
};
};
_yuitest_coverline("build/transition/transition.js", 541);
Y.Node.prototype.hide = function(name, config, callback) {
_yuitest_coverfunc("build/transition/transition.js", "hide", 541);
_yuitest_coverline("build/transition/transition.js", 542);
if (name && Y.Transition) {
_yuitest_coverline("build/transition/transition.js", 543);
if (typeof config === 'function') {
_yuitest_coverline("build/transition/transition.js", 544);
callback = config;
_yuitest_coverline("build/transition/transition.js", 545);
config = null;
}
_yuitest_coverline("build/transition/transition.js", 548);
callback = _wrapCallBack(this, this._hide, callback); // wrap with existing callback
_yuitest_coverline("build/transition/transition.js", 549);
if (typeof name !== 'string' && !name.push) { // named effect or array of effects supercedes default
_yuitest_coverline("build/transition/transition.js", 550);
if (typeof config === 'function') {
_yuitest_coverline("build/transition/transition.js", 551);
callback = config;
_yuitest_coverline("build/transition/transition.js", 552);
config = name;
}
_yuitest_coverline("build/transition/transition.js", 554);
name = Transition.HIDE_TRANSITION;
}
_yuitest_coverline("build/transition/transition.js", 556);
this.transition(name, config, callback);
} else {
_yuitest_coverline("build/transition/transition.js", 558);
this._hide();
}
_yuitest_coverline("build/transition/transition.js", 560);
return this;
};
/**
* Animate one or more css properties to a given value. Requires the "transition" module.
* <pre>example usage:
* Y.all('.demo').transition({
* duration: 1, // in seconds, default is 0.5
* easing: 'ease-out', // default is 'ease'
* delay: '1', // delay start for 1 second, default is 0
*
* height: '10px',
* width: '10px',
*
* opacity: { // per property
* value: 0,
* duration: 2,
* delay: 2,
* easing: 'ease-in'
* }
* });
* </pre>
* @for NodeList
* @method transition
* @param {Object} config An object containing one or more style properties, a duration and an easing.
* @param {Function} callback A function to run after the transition has completed. The callback fires
* once per item in the NodeList.
* @chainable
*/
_yuitest_coverline("build/transition/transition.js", 589);
Y.NodeList.prototype.transition = function(config, callback) {
_yuitest_coverfunc("build/transition/transition.js", "transition", 589);
_yuitest_coverline("build/transition/transition.js", 590);
var nodes = this._nodes,
i = 0,
node;
_yuitest_coverline("build/transition/transition.js", 594);
while ((node = nodes[i++])) {
_yuitest_coverline("build/transition/transition.js", 595);
Y.one(node).transition(config, callback);
}
_yuitest_coverline("build/transition/transition.js", 598);
return this;
};
_yuitest_coverline("build/transition/transition.js", 601);
Y.Node.prototype.toggleView = function(name, on, callback) {
_yuitest_coverfunc("build/transition/transition.js", "toggleView", 601);
_yuitest_coverline("build/transition/transition.js", 602);
this._toggles = this._toggles || [];
_yuitest_coverline("build/transition/transition.js", 603);
callback = arguments[arguments.length - 1];
_yuitest_coverline("build/transition/transition.js", 605);
if (typeof name == 'boolean') { // no transition, just toggle
_yuitest_coverline("build/transition/transition.js", 606);
on = name;
_yuitest_coverline("build/transition/transition.js", 607);
name = null;
}
_yuitest_coverline("build/transition/transition.js", 610);
name = name || Y.Transition.DEFAULT_TOGGLE;
_yuitest_coverline("build/transition/transition.js", 612);
if (typeof on == 'undefined' && name in this._toggles) { // reverse current toggle
_yuitest_coverline("build/transition/transition.js", 613);
on = ! this._toggles[name];
}
_yuitest_coverline("build/transition/transition.js", 616);
on = (on) ? 1 : 0;
_yuitest_coverline("build/transition/transition.js", 617);
if (on) {
_yuitest_coverline("build/transition/transition.js", 618);
this._show();
} else {
_yuitest_coverline("build/transition/transition.js", 620);
callback = _wrapCallBack(this, this._hide, callback);
}
_yuitest_coverline("build/transition/transition.js", 623);
this._toggles[name] = on;
_yuitest_coverline("build/transition/transition.js", 624);
this.transition(Y.Transition.toggles[name][on], callback);
_yuitest_coverline("build/transition/transition.js", 626);
return this;
};
_yuitest_coverline("build/transition/transition.js", 629);
Y.NodeList.prototype.toggleView = function(name, on, callback) {
_yuitest_coverfunc("build/transition/transition.js", "toggleView", 629);
_yuitest_coverline("build/transition/transition.js", 630);
var nodes = this._nodes,
i = 0,
node;
_yuitest_coverline("build/transition/transition.js", 634);
while ((node = nodes[i++])) {
_yuitest_coverline("build/transition/transition.js", 635);
Y.one(node).toggleView(name, on, callback);
}
_yuitest_coverline("build/transition/transition.js", 638);
return this;
};
_yuitest_coverline("build/transition/transition.js", 641);
Y.mix(Transition.fx, {
fadeOut: {
opacity: 0,
duration: 0.5,
easing: 'ease-out'
},
fadeIn: {
opacity: 1,
duration: 0.5,
easing: 'ease-in'
},
sizeOut: {
height: 0,
width: 0,
duration: 0.75,
easing: 'ease-out'
},
sizeIn: {
height: function(node) {
_yuitest_coverfunc("build/transition/transition.js", "height", 662);
_yuitest_coverline("build/transition/transition.js", 663);
return node.get('scrollHeight') + 'px';
},
width: function(node) {
_yuitest_coverfunc("build/transition/transition.js", "width", 665);
_yuitest_coverline("build/transition/transition.js", 666);
return node.get('scrollWidth') + 'px';
},
duration: 0.5,
easing: 'ease-in',
on: {
start: function() {
_yuitest_coverfunc("build/transition/transition.js", "start", 672);
_yuitest_coverline("build/transition/transition.js", 673);
var overflow = this.getStyle('overflow');
_yuitest_coverline("build/transition/transition.js", 674);
if (overflow !== 'hidden') { // enable scrollHeight/Width
_yuitest_coverline("build/transition/transition.js", 675);
this.setStyle('overflow', 'hidden');
_yuitest_coverline("build/transition/transition.js", 676);
this._transitionOverflow = overflow;
}
},
end: function() {
_yuitest_coverfunc("build/transition/transition.js", "end", 680);
_yuitest_coverline("build/transition/transition.js", 681);
if (this._transitionOverflow) { // revert overridden value
_yuitest_coverline("build/transition/transition.js", 682);
this.setStyle('overflow', this._transitionOverflow);
_yuitest_coverline("build/transition/transition.js", 683);
delete this._transitionOverflow;
}
}
}
}
});
_yuitest_coverline("build/transition/transition.js", 690);
Y.mix(Transition.toggles, {
size: ['sizeOut', 'sizeIn'],
fade: ['fadeOut', 'fadeIn']
});
_yuitest_coverline("build/transition/transition.js", 695);
Transition.DEFAULT_TOGGLE = 'fade';
}, '@VERSION@', {"requires": ["node-style"]});
| rivanvx/cdnjs | ajax/libs/yui/3.7.2/transition/transition-coverage.js | JavaScript | mit | 62,094 |
if (typeof _yuitest_coverage == "undefined"){
_yuitest_coverage = {};
_yuitest_coverline = function(src, line){
var coverage = _yuitest_coverage[src];
if (!coverage.lines[line]){
coverage.calledLines++;
}
coverage.lines[line]++;
};
_yuitest_coverfunc = function(src, name, line){
var coverage = _yuitest_coverage[src],
funcId = name + ":" + line;
if (!coverage.functions[funcId]){
coverage.calledFunctions++;
}
coverage.functions[funcId]++;
};
}
_yuitest_coverage["build/io-queue/io-queue.js"] = {
lines: {},
functions: {},
coveredLines: 0,
calledLines: 0,
coveredFunctions: 0,
calledFunctions: 0,
path: "build/io-queue/io-queue.js",
code: []
};
_yuitest_coverage["build/io-queue/io-queue.js"].code=["YUI.add('io-queue', function (Y, NAME) {","","/**","Extends IO to implement Queue for synchronous","transaction processing.","@module io","@submodule io-queue","@for IO","**/","var io = Y.io._map['io:0'] || new Y.IO();","","Y.mix(Y.IO.prototype, {"," /**"," * Array of transactions queued for processing"," *"," * @property _q"," * @private"," * @static"," * @type {Object}"," */"," _q: new Y.Queue(),"," _qActiveId: null,"," _qInit: false,"," /**"," * Property to determine whether the queue is set to"," * 1 (active) or 0 (inactive). When inactive, transactions"," * will be stored in the queue until the queue is set to active."," *"," * @property _qState"," * @private"," * @static"," * @type {Number}"," */"," _qState: 1,",""," /**"," * Method Process the first transaction from the"," * queue in FIFO order."," *"," * @method _qShift"," * @private"," * @static"," */"," _qShift: function() {"," var io = this,"," o = io._q.next();",""," io._qActiveId = o.id;"," io._qState = 0;"," io.send(o.uri, o.cfg, o.id);"," },",""," /**"," * Method for queueing a transaction before the request is sent to the"," * resource, to ensure sequential processing."," *"," * @method queue"," * @static"," * @return {Object}"," */"," queue: function(uri, c) {"," var io = this,"," o = { uri: uri, cfg:c, id: this._id++ };",""," if(!io._qInit) {"," Y.on('io:complete', function(id, o) { io._qNext(id); }, io);"," io._qInit = true;"," }",""," io._q.add(o);"," if (io._qState === 1) {"," io._qShift();"," }",""," return o;"," },",""," _qNext: function(id) {"," var io = this;"," io._qState = 1;"," if (io._qActiveId === id && io._q.size() > 0) {"," io._qShift();"," }"," },",""," /**"," * Method for promoting a transaction to the top of the queue."," *"," * @method promote"," * @static"," */"," qPromote: function(o) {"," this._q.promote(o);"," },",""," /**"," * Method for removing a specific, pending transaction from"," * the queue."," *"," * @method remove"," * @private"," * @static"," */"," qRemove: function(o) {"," this._q.remove(o);"," },",""," qStart: function() {"," var io = this;"," io._qState = 1;",""," if (io._q.size() > 0) {"," io._qShift();"," }"," },",""," /**"," * Method for setting queue processing to inactive."," * Transaction requests to YUI.io.queue() will be stored in the queue, but"," * not processed until the queue is reset to \"active\"."," *"," * @method _stop"," * @private"," * @static"," */"," qStop: function() {"," this._qState = 0;"," },",""," /**"," * Method to query the current size of the queue."," *"," * @method _size"," * @private"," * @static"," * @return {Number}"," */"," qSize: function() {"," return this._q.size();"," }","","}, true);","","function _queue(u, c) {"," return io.queue.apply(io, [u, c]);","}","","_queue.start = function () { io.qStart(); };","_queue.stop = function () { io.qStop(); };","_queue.promote = function (o) { io.qPromote(o); };","_queue.remove = function (o) { io.qRemove(o); };","_queue.size = function () { io.qSize(); };","Y.io.queue = _queue;","","","}, '@VERSION@', {\"requires\": [\"io-base\", \"queue-promote\"]});"];
_yuitest_coverage["build/io-queue/io-queue.js"].lines = {"1":0,"10":0,"12":0,"45":0,"48":0,"49":0,"50":0,"62":0,"65":0,"66":0,"67":0,"70":0,"71":0,"72":0,"75":0,"79":0,"80":0,"81":0,"82":0,"93":0,"105":0,"109":0,"110":0,"112":0,"113":0,"127":0,"139":0,"144":0,"145":0,"148":0,"149":0,"150":0,"151":0,"152":0,"153":0};
_yuitest_coverage["build/io-queue/io-queue.js"].functions = {"_qShift:44":0,"(anonymous 2):66":0,"queue:61":0,"_qNext:78":0,"qPromote:92":0,"qRemove:104":0,"qStart:108":0,"qStop:126":0,"qSize:138":0,"_queue:144":0,"start:148":0,"stop:149":0,"promote:150":0,"remove:151":0,"size:152":0,"(anonymous 1):1":0};
_yuitest_coverage["build/io-queue/io-queue.js"].coveredLines = 35;
_yuitest_coverage["build/io-queue/io-queue.js"].coveredFunctions = 16;
_yuitest_coverline("build/io-queue/io-queue.js", 1);
YUI.add('io-queue', function (Y, NAME) {
/**
Extends IO to implement Queue for synchronous
transaction processing.
@module io
@submodule io-queue
@for IO
**/
_yuitest_coverfunc("build/io-queue/io-queue.js", "(anonymous 1)", 1);
_yuitest_coverline("build/io-queue/io-queue.js", 10);
var io = Y.io._map['io:0'] || new Y.IO();
_yuitest_coverline("build/io-queue/io-queue.js", 12);
Y.mix(Y.IO.prototype, {
/**
* Array of transactions queued for processing
*
* @property _q
* @private
* @static
* @type {Object}
*/
_q: new Y.Queue(),
_qActiveId: null,
_qInit: false,
/**
* Property to determine whether the queue is set to
* 1 (active) or 0 (inactive). When inactive, transactions
* will be stored in the queue until the queue is set to active.
*
* @property _qState
* @private
* @static
* @type {Number}
*/
_qState: 1,
/**
* Method Process the first transaction from the
* queue in FIFO order.
*
* @method _qShift
* @private
* @static
*/
_qShift: function() {
_yuitest_coverfunc("build/io-queue/io-queue.js", "_qShift", 44);
_yuitest_coverline("build/io-queue/io-queue.js", 45);
var io = this,
o = io._q.next();
_yuitest_coverline("build/io-queue/io-queue.js", 48);
io._qActiveId = o.id;
_yuitest_coverline("build/io-queue/io-queue.js", 49);
io._qState = 0;
_yuitest_coverline("build/io-queue/io-queue.js", 50);
io.send(o.uri, o.cfg, o.id);
},
/**
* Method for queueing a transaction before the request is sent to the
* resource, to ensure sequential processing.
*
* @method queue
* @static
* @return {Object}
*/
queue: function(uri, c) {
_yuitest_coverfunc("build/io-queue/io-queue.js", "queue", 61);
_yuitest_coverline("build/io-queue/io-queue.js", 62);
var io = this,
o = { uri: uri, cfg:c, id: this._id++ };
_yuitest_coverline("build/io-queue/io-queue.js", 65);
if(!io._qInit) {
_yuitest_coverline("build/io-queue/io-queue.js", 66);
Y.on('io:complete', function(id, o) { _yuitest_coverfunc("build/io-queue/io-queue.js", "(anonymous 2)", 66);
io._qNext(id); }, io);
_yuitest_coverline("build/io-queue/io-queue.js", 67);
io._qInit = true;
}
_yuitest_coverline("build/io-queue/io-queue.js", 70);
io._q.add(o);
_yuitest_coverline("build/io-queue/io-queue.js", 71);
if (io._qState === 1) {
_yuitest_coverline("build/io-queue/io-queue.js", 72);
io._qShift();
}
_yuitest_coverline("build/io-queue/io-queue.js", 75);
return o;
},
_qNext: function(id) {
_yuitest_coverfunc("build/io-queue/io-queue.js", "_qNext", 78);
_yuitest_coverline("build/io-queue/io-queue.js", 79);
var io = this;
_yuitest_coverline("build/io-queue/io-queue.js", 80);
io._qState = 1;
_yuitest_coverline("build/io-queue/io-queue.js", 81);
if (io._qActiveId === id && io._q.size() > 0) {
_yuitest_coverline("build/io-queue/io-queue.js", 82);
io._qShift();
}
},
/**
* Method for promoting a transaction to the top of the queue.
*
* @method promote
* @static
*/
qPromote: function(o) {
_yuitest_coverfunc("build/io-queue/io-queue.js", "qPromote", 92);
_yuitest_coverline("build/io-queue/io-queue.js", 93);
this._q.promote(o);
},
/**
* Method for removing a specific, pending transaction from
* the queue.
*
* @method remove
* @private
* @static
*/
qRemove: function(o) {
_yuitest_coverfunc("build/io-queue/io-queue.js", "qRemove", 104);
_yuitest_coverline("build/io-queue/io-queue.js", 105);
this._q.remove(o);
},
qStart: function() {
_yuitest_coverfunc("build/io-queue/io-queue.js", "qStart", 108);
_yuitest_coverline("build/io-queue/io-queue.js", 109);
var io = this;
_yuitest_coverline("build/io-queue/io-queue.js", 110);
io._qState = 1;
_yuitest_coverline("build/io-queue/io-queue.js", 112);
if (io._q.size() > 0) {
_yuitest_coverline("build/io-queue/io-queue.js", 113);
io._qShift();
}
},
/**
* Method for setting queue processing to inactive.
* Transaction requests to YUI.io.queue() will be stored in the queue, but
* not processed until the queue is reset to "active".
*
* @method _stop
* @private
* @static
*/
qStop: function() {
_yuitest_coverfunc("build/io-queue/io-queue.js", "qStop", 126);
_yuitest_coverline("build/io-queue/io-queue.js", 127);
this._qState = 0;
},
/**
* Method to query the current size of the queue.
*
* @method _size
* @private
* @static
* @return {Number}
*/
qSize: function() {
_yuitest_coverfunc("build/io-queue/io-queue.js", "qSize", 138);
_yuitest_coverline("build/io-queue/io-queue.js", 139);
return this._q.size();
}
}, true);
_yuitest_coverline("build/io-queue/io-queue.js", 144);
function _queue(u, c) {
_yuitest_coverfunc("build/io-queue/io-queue.js", "_queue", 144);
_yuitest_coverline("build/io-queue/io-queue.js", 145);
return io.queue.apply(io, [u, c]);
}
_yuitest_coverline("build/io-queue/io-queue.js", 148);
_queue.start = function () { _yuitest_coverfunc("build/io-queue/io-queue.js", "start", 148);
io.qStart(); };
_yuitest_coverline("build/io-queue/io-queue.js", 149);
_queue.stop = function () { _yuitest_coverfunc("build/io-queue/io-queue.js", "stop", 149);
io.qStop(); };
_yuitest_coverline("build/io-queue/io-queue.js", 150);
_queue.promote = function (o) { _yuitest_coverfunc("build/io-queue/io-queue.js", "promote", 150);
io.qPromote(o); };
_yuitest_coverline("build/io-queue/io-queue.js", 151);
_queue.remove = function (o) { _yuitest_coverfunc("build/io-queue/io-queue.js", "remove", 151);
io.qRemove(o); };
_yuitest_coverline("build/io-queue/io-queue.js", 152);
_queue.size = function () { _yuitest_coverfunc("build/io-queue/io-queue.js", "size", 152);
io.qSize(); };
_yuitest_coverline("build/io-queue/io-queue.js", 153);
Y.io.queue = _queue;
}, '@VERSION@', {"requires": ["io-base", "queue-promote"]});
| bgrins/cdnjs | ajax/libs/yui/3.7.2/io-queue/io-queue-coverage.js | JavaScript | mit | 11,399 |
.yui3-g {
letter-spacing: -0.31em; /* webkit: collapse white-space between units */
*letter-spacing: normal; /* reset IE < 8 */
word-spacing: -0.43em; /* IE < 8 && gecko: collapse white-space between units */
}
.yui3-u {
display: inline-block;
zoom: 1; *display: inline; /* IE < 8: fake inline-block */
letter-spacing: normal;
word-spacing: normal;
vertical-align: top;
}
.yui3-u-1,
.yui3-u-1-2,
.yui3-u-1-3,
.yui3-u-2-3,
.yui3-u-1-4,
.yui3-u-3-4,
.yui3-u-1-5,
.yui3-u-2-5,
.yui3-u-3-5,
.yui3-u-4-5,
.yui3-u-1-6,
.yui3-u-5-6,
.yui3-u-1-8,
.yui3-u-3-8,
.yui3-u-5-8,
.yui3-u-7-8,
.yui3-u-1-12,
.yui3-u-5-12,
.yui3-u-7-12,
.yui3-u-11-12,
.yui3-u-1-24,
.yui3-u-5-24,
.yui3-u-7-24,
.yui3-u-11-24,
.yui3-u-13-24,
.yui3-u-17-24,
.yui3-u-19-24,
.yui3-u-23-24 {
display: inline-block;
zoom: 1; *display: inline; /* IE < 8: fake inline-block */
letter-spacing: normal;
word-spacing: normal;
vertical-align: top;
}
.yui3-u-1 {
display: block;
}
.yui3-u-1-2 {
width: 50%;
}
.yui3-u-1-3 {
width: 33.33333%;
}
.yui3-u-2-3 {
width: 66.66666%;
}
.yui3-u-1-4 {
width: 25%;
}
.yui3-u-3-4 {
width: 75%;
}
.yui3-u-1-5 {
width: 20%;
}
.yui3-u-2-5 {
width: 40%;
}
.yui3-u-3-5 {
width: 60%;
}
.yui3-u-4-5 {
width: 80%;
}
.yui3-u-1-6 {
width: 16.656%;
}
.yui3-u-5-6 {
width: 83.33%;
}
.yui3-u-1-8 {
width: 12.5%;
}
.yui3-u-3-8 {
width: 37.5%;
}
.yui3-u-5-8 {
width: 62.5%;
}
.yui3-u-7-8 {
width: 87.5%;
}
.yui3-u-1-12 {
width: 8.3333%;
}
.yui3-u-5-12 {
width: 41.6666%;
}
.yui3-u-7-12 {
width: 58.3333%;
}
.yui3-u-11-12 {
width: 91.6666%;
}
.yui3-u-1-24 {
width: 4.1666%;
}
.yui3-u-5-24 {
width: 20.8333%;
}
.yui3-u-7-24 {
width: 29.1666%;
}
.yui3-u-11-24 {
width: 45.8333%;
}
.yui3-u-13-24 {
width: 54.1666%;
}
.yui3-u-17-24 {
width: 70.8333%;
}
.yui3-u-19-24 {
width: 79.1666%;
}
.yui3-u-23-24 {
width: 95.8333%;
}
/* YUI CSS Detection Stamp */
#yui3-css-stamp.cssgrids { display: none; }
| gogoleva/cdnjs | ajax/libs/yui/3.7.1/cssgrids/cssgrids.css | CSS | mit | 2,061 |
YUI.add('datatable-mutable', function (Y, NAME) {
/**
Adds mutation convenience methods such as `table.addRow(data)` to `Y.DataTable`. (or other built class).
@module datatable
@submodule datatable-mutable
@since 3.5.0
**/
var toArray = Y.Array,
YLang = Y.Lang,
isString = YLang.isString,
isArray = YLang.isArray,
isObject = YLang.isObject,
isNumber = YLang.isNumber,
arrayIndex = Y.Array.indexOf,
Mutable;
/**
_API docs for this extension are included in the DataTable class._
Class extension to add mutation convenience methods to `Y.DataTable` (or other
built class).
Column mutation methods are paired with new custom events:
* addColumn
* removeColumn
* modifyColumn
* moveColumn
Row mutation events are bubbled from the DataTable's `data` ModelList through
the DataTable instance.
@class DataTable.Mutable
@for DataTable
@since 3.5.0
**/
Y.namespace('DataTable').Mutable = Mutable = function () {};
Mutable.ATTRS = {
/**
Controls whether `addRow`, `removeRow`, and `modifyRow` should trigger the
underlying Model's sync layer by default.
When `true`, it is unnecessary to pass the "sync" configuration property to
those methods to trigger per-operation sync.
@attribute autoSync
@type {Boolean}
@default `false`
@since 3.5.0
**/
autoSync: {
value: false,
validator: YLang.isBoolean
}
};
Y.mix(Mutable.prototype, {
/**
Adds the column configuration to the DataTable's `columns` configuration.
If the `index` parameter is supplied, it is injected at that index. If the
table has nested headers, inject a subcolumn by passing an array of indexes
to identify the new column's final location.
The `index` parameter is required if adding a nested column.
This method is a convienience method for fetching the DataTable's `columns`
attribute, updating it, and calling
`table.set('columns', _updatedColumnsDefs_)`
For example:
<pre><code>// Becomes last column
table.addColumn('name');
// Inserted after the current second column, moving the current third column
// to index 4
table.addColumn({ key: 'price', formatter: currencyFormatter }, 2 );
// Insert a new column in a set of headers three rows deep. The index array
// translates to
// [ 2, -- in the third column's children
// 1, -- in the second child's children
// 3 ] -- as the fourth child column
table.addColumn({ key: 'age', sortable: true }, [ 2, 1, 3 ]);
</code></pre>
@method addColumn
@param {Object|String} config The new column configuration object
@param {Number|Number[]} [index] the insertion index
@return {DataTable}
@chainable
@since 3.5.0
**/
addColumn: function (config, index) {
if (isString(config)) {
config = { key: config };
}
if (config) {
if (arguments.length < 2 || (!isNumber(index) && !isArray(index))) {
index = this.get('columns').length;
}
this.fire('addColumn', {
column: config,
index: index
});
}
return this;
},
/**
Updates an existing column definition. Fires the `modifyColumn` event.
For example:
<pre><code>// Add a formatter to the existing 'price' column definition
table.modifyColumn('price', { formatter: currencyFormatter });
// Change the label on a header cell in a set of nested headers three rows
// deep. The index array translates to
// [ 2, -- in the third column's children
// 1, -- the second child
// 3 ] -- the fourth child column
table.modifyColumn([2, 1, 3], { label: 'Experience' });
</code></pre>
@method modifyColumn
@param {String|Number|Number[]|Object} name The column key, name, index, or
current configuration object
@param {Object} config The new column configuration properties
@return {DataTable}
@chainable
@since 3.5.0
**/
modifyColumn: function (name, config) {
if (isString(config)) {
config = { key: config };
}
if (isObject(config)) {
this.fire('modifyColumn', {
column: name,
newColumnDef: config
});
}
return this;
},
/**
Moves an existing column to a new location. Fires the `moveColumn` event.
The destination index can be a number or array of numbers to place a column
header in a nested header row.
@method moveColumn
@param {String|Number|Number[]|Object} name The column key, name, index, or
current configuration object
@param {Number|Number[]} index The destination index of the column
@return {DataTable}
@chainable
@since 3.5.0
**/
moveColumn: function (name, index) {
if (name !== undefined && (isNumber(index) || isArray(index))) {
this.fire('moveColumn', {
column: name,
index: index
});
}
return this;
},
/**
Removes an existing column. Fires the `removeColumn` event.
@method removeColumn
@param {String|Number|Number[]|Object} name The column key, name, index, or
current configuration object
@return {DataTable}
@chainable
@since 3.5.0
**/
removeColumn: function (name) {
if (name !== undefined) {
this.fire('removeColumn', {
column: name
});
}
return this;
},
/**
Adds a new record to the DataTable's `data` ModelList. Record data can be
an object of field values or an instance of the DataTable's configured
`recordType` class.
This relays all parameters to the `data` ModelList's `add` method.
If a configuration object is passed as a second argument, and that object
has `sync: true` set, the underlying Model will be `save()`d.
If the DataTable's `autoSync` attribute is set to `true`, the additional
argument is not needed.
If syncing and the last argument is a function, that function will be used
as a callback to the Model's `save()` method.
@method addRow
@param {Object} data The data or Model instance for the new record
@param {Object} [config] Configuration to pass along
@param {Function} [callback] Callback function for Model's `save()`
@param {Error|null} callback.err If an error occurred or validation
failed, this parameter will contain the error. If the sync operation
succeeded, _err_ will be `null`.
@param {Any} callback.response The server's response. This value will
be passed to the `parse()` method, which is expected to parse it and
return an attribute hash.
@return {DataTable}
@chainable
@since 3.5.0
**/
addRow: function (data, config) {
// Allow autoSync: true + addRow({ data }, { sync: false })
var sync = (config && ('sync' in config)) ?
config.sync :
this.get('autoSync'),
models, model, i, len, args;
if (data && this.data) {
models = this.data.add.apply(this.data, arguments);
if (sync) {
models = toArray(models);
args = toArray(arguments, 1, true);
for (i = 0, len = models.length; i < len; ++i) {
model = models[i];
if (model.isNew()) {
models[i].save.apply(models[i], args);
}
}
}
}
return this;
},
/**
Removes a record from the DataTable's `data` ModelList. The record can be
provided explicitly or targeted by it's `id` (see ModelList's `getById`
method), `clientId`, or index in the ModelList.
After locating the target Model, this relays the Model and all other passed
arguments to the `data` ModelList's `remove` method.
If a configuration object is passed as a second argument, and that object
has `sync: true` set, the underlying Model will be destroyed, passing
`{ delete: true }` to trigger calling the Model's sync layer.
If the DataTable's `autoSync` attribute is set to `true`, the additional
argument is not needed.
If syncing and the last argument is a function, that function will be used
as a callback to the Model's `destroy()` method.
@method removeRow
@param {Object|String|Number} id The Model instance or identifier
@param {Object} [config] Configuration to pass along
@param {Function} [callback] Callback function for Model's `save()`
@param {Error|null} callback.err If an error occurred or validation
failed, this parameter will contain the error. If the sync operation
succeeded, _err_ will be `null`.
@param {Any} callback.response The server's response. This value will
be passed to the `parse()` method, which is expected to parse it and
return an attribute hash.
@return {DataTable}
@chainable
@since 3.5.0
**/
removeRow: function (id, config) {
var modelList = this.data,
// Allow autoSync: true + addRow({ data }, { sync: false })
sync = (config && ('sync' in config)) ?
config.sync :
this.get('autoSync'),
models, model, i, len, args;
// TODO: support removing via DOM element. This should be relayed to View
if (isObject(id) && id instanceof this.get('recordType')) {
model = id;
} else if (modelList && id !== undefined) {
model = modelList.getById(id) ||
modelList.getByClientId(id) ||
modelList.item(id);
}
if (model) {
args = toArray(arguments, 1, true);
models = modelList.remove.apply(modelList,
[model].concat(args));
if (sync) {
if (!isObject(args[0])) {
args.unshift({});
}
args[0]['delete'] = true;
models = toArray(models);
for (i = 0, len = models.length; i < len; ++i) {
model = models[i];
model.destroy.apply(model, args);
}
}
}
return this;
},
/**
Updates an existing record in the DataTable's `data` ModelList. The record
can be provided explicitly or targeted by it's `id` (see ModelList's
`getById` method), `clientId`, or index in the ModelList.
After locating the target Model, this relays the all other passed
arguments to the Model's `setAttrs` method.
If a configuration object is passed as a second argument, and that object
has `sync: true` set, the underlying Model will be `save()`d.
If the DataTable's `autoSync` attribute is set to `true`, the additional
argument is not needed.
If syncing and the last argument is a function, that function will be used
as a callback to the Model's `save()` method.
@method modifyRow
@param {Object|String|Number} id The Model instance or identifier
@param {Object} data New data values for the Model
@param {Object} [config] Configuration to pass along to `setAttrs()`
@param {Function} [callback] Callback function for Model's `save()`
@param {Error|null} callback.err If an error occurred or validation
failed, this parameter will contain the error. If the sync operation
succeeded, _err_ will be `null`.
@param {Any} callback.response The server's response. This value will
be passed to the `parse()` method, which is expected to parse it and
return an attribute hash.
@return {DataTable}
@chainable
@since 3.5.0
**/
modifyRow: function (id, data, config) {
var modelList = this.data,
// Allow autoSync: true + addRow({ data }, { sync: false })
sync = (config && ('sync' in config)) ?
config.sync :
this.get('autoSync'),
model, args;
if (isObject(id) && id instanceof this.get('recordType')) {
model = id;
} else if (modelList && id !== undefined) {
model = modelList.getById(id) ||
modelList.getByClientId(id) ||
modelList.item(id);
}
if (model && isObject(data)) {
args = toArray(arguments, 1, true);
model.setAttrs.apply(model, args);
if (sync && !model.isNew()) {
model.save.apply(model, args);
}
}
return this;
},
// --------------------------------------------------------------------------
// Protected properties and methods
// --------------------------------------------------------------------------
/**
Default function for the `addColumn` event.
Inserts the specified column at the provided index.
@method _defAddColumnFn
@param {EventFacade} e The `addColumn` event
@param {Object} e.column The new column definition object
@param {Number|Number[]} e.index The array index to insert the new column
@protected
@since 3.5.0
**/
_defAddColumnFn: function (e) {
var index = toArray(e.index),
columns = this.get('columns'),
cols = columns,
i, len;
for (i = 0, len = index.length - 1; cols && i < len; ++i) {
cols = cols[index[i]] && cols[index[i]].children;
}
if (cols) {
cols.splice(index[i], 0, e.column);
this.set('columns', columns, { originEvent: e });
}
},
/**
Default function for the `modifyColumn` event.
Mixes the new column properties into the specified column definition.
@method _defModifyColumnFn
@param {EventFacade} e The `modifyColumn` event
@param {Object|String|Number|Number[]} e.column The column definition object or identifier
@param {Object} e.newColumnDef The properties to assign to the column
@protected
@since 3.5.0
**/
_defModifyColumnFn: function (e) {
var columns = this.get('columns'),
column = this.getColumn(e.column);
if (column) {
Y.mix(column, e.newColumnDef, true);
this.set('columns', columns, { originEvent: e });
}
},
/**
Default function for the `moveColumn` event.
Removes the specified column from its current location and inserts it at the
specified array index (may be an array of indexes for nested headers).
@method _defMoveColumnFn
@param {EventFacade} e The `moveColumn` event
@param {Object|String|Number|Number[]} e.column The column definition object or identifier
@param {Object} e.index The destination index to move to
@protected
@since 3.5.0
**/
_defMoveColumnFn: function (e) {
var columns = this.get('columns'),
column = this.getColumn(e.column),
toIndex = toArray(e.index),
fromCols, fromIndex, toCols, i, len;
if (column) {
fromCols = column._parent ? column._parent.children : columns;
fromIndex = arrayIndex(fromCols, column);
if (fromIndex > -1) {
toCols = columns;
for (i = 0, len = toIndex.length - 1; toCols && i < len; ++i) {
toCols = toCols[toIndex[i]] && toCols[toIndex[i]].children;
}
if (toCols) {
len = toCols.length;
fromCols.splice(fromIndex, 1);
toIndex = toIndex[i];
if (len > toCols.lenth) {
// spliced off the same array, so adjust destination
// index if necessary
if (fromIndex < toIndex) {
toIndex--;
}
}
toCols.splice(toIndex, 0, column);
this.set('columns', columns, { originEvent: e });
}
}
}
},
/**
Default function for the `removeColumn` event.
Splices the specified column from its containing columns array.
@method _defRemoveColumnFn
@param {EventFacade} e The `removeColumn` event
@param {Object|String|Number|Number[]} e.column The column definition object or identifier
@protected
@since 3.5.0
**/
_defRemoveColumnFn: function (e) {
var columns = this.get('columns'),
column = this.getColumn(e.column),
cols, index;
if (column) {
cols = column._parent ? column._parent.children : columns;
index = Y.Array.indexOf(cols, column);
if (index > -1) {
cols.splice(index, 1);
this.set('columns', columns, { originEvent: e });
}
}
},
/**
Publishes the events used by the mutation methods:
* addColumn
* removeColumn
* modifyColumn
* moveColumn
@method initializer
@protected
@since 3.5.0
**/
initializer: function () {
this.publish({
addColumn: { defaultFn: Y.bind('_defAddColumnFn', this) },
removeColumn: { defaultFn: Y.bind('_defRemoveColumnFn', this) },
moveColumn: { defaultFn: Y.bind('_defMoveColumnFn', this) },
modifyColumn: { defaultFn: Y.bind('_defModifyColumnFn', this) }
});
}
});
/**
Adds an array of new records to the DataTable's `data` ModelList. Record data
can be an array of objects containing field values or an array of instance of
the DataTable's configured `recordType` class.
This relays all parameters to the `data` ModelList's `add` method.
Technically, this is an alias to `addRow`, but please use the appropriately
named method for readability.
If a configuration object is passed as a second argument, and that object
has `sync: true` set, the underlying Models will be `save()`d.
If the DataTable's `autoSync` attribute is set to `true`, the additional
argument is not needed.
If syncing and the last argument is a function, that function will be used
as a callback to each Model's `save()` method.
@method addRows
@param {Object[]} data The data or Model instances to add
@param {Object} [config] Configuration to pass along
@param {Function} [callback] Callback function for each Model's `save()`
@param {Error|null} callback.err If an error occurred or validation
failed, this parameter will contain the error. If the sync operation
succeeded, _err_ will be `null`.
@param {Any} callback.response The server's response. This value will
be passed to the `parse()` method, which is expected to parse it and
return an attribute hash.
@return {DataTable}
@chainable
@since 3.5.0
**/
Mutable.prototype.addRows = Mutable.prototype.addRow;
// Add feature APIs to public Y.DataTable class
if (YLang.isFunction(Y.DataTable)) {
Y.Base.mix(Y.DataTable, [Mutable]);
}
/**
Fired by the `addColumn` method.
@event addColumn
@preventable _defAddColumnFn
@param {Object} column The new column definition object
@param {Number|Number[]} index The array index to insert the new column
@since 3.5.0
**/
/**
Fired by the `removeColumn` method.
@event removeColumn
@preventable _defRemoveColumnFn
@param {Object|String|Number|Number[]} column The column definition object or identifier
@since 3.5.0
**/
/**
Fired by the `modifyColumn` method.
@event modifyColumn
@preventable _defModifyColumnFn
@param {Object|String|Number|Number[]} column The column definition object or identifier
@param {Object} newColumnDef The properties to assign to the column
@since 3.5.0
**/
/**
Fired by the `moveColumn` method.
@event moveColumn
@preventable _defMoveColumnFn
@param {Object|String|Number|Number[]} column The column definition object or identifier
@param {Object} index The destination index to move to
@since 3.5.0
**/
}, '@VERSION@', {"requires": ["datatable-base"]});
| fastest963/cdnjs | ajax/libs/yui/3.7.1/datatable-mutable/datatable-mutable.js | JavaScript | mit | 20,324 |
if (typeof _yuitest_coverage == "undefined"){
_yuitest_coverage = {};
_yuitest_coverline = function(src, line){
var coverage = _yuitest_coverage[src];
if (!coverage.lines[line]){
coverage.calledLines++;
}
coverage.lines[line]++;
};
_yuitest_coverfunc = function(src, name, line){
var coverage = _yuitest_coverage[src],
funcId = name + ":" + line;
if (!coverage.functions[funcId]){
coverage.calledFunctions++;
}
coverage.functions[funcId]++;
};
}
_yuitest_coverage["build/datatable-datasource/datatable-datasource.js"] = {
lines: {},
functions: {},
coveredLines: 0,
calledLines: 0,
coveredFunctions: 0,
calledFunctions: 0,
path: "build/datatable-datasource/datatable-datasource.js",
code: []
};
_yuitest_coverage["build/datatable-datasource/datatable-datasource.js"].code=["YUI.add('datatable-datasource', function (Y, NAME) {","","/**"," * Plugs DataTable with DataSource integration."," *"," * @module datatable"," * @submodule datatable-datasource"," */","","/**"," * Adds DataSource integration to DataTable."," * @class Plugin.DataTableDataSource"," * @extends Plugin.Base"," */","function DataTableDataSource() {"," DataTableDataSource.superclass.constructor.apply(this, arguments);","}","","/////////////////////////////////////////////////////////////////////////////","//","// STATIC PROPERTIES","//","/////////////////////////////////////////////////////////////////////////////","Y.mix(DataTableDataSource, {"," /**"," * The namespace for the plugin. This will be the property on the host which"," * references the plugin instance."," *"," * @property NS"," * @type String"," * @static"," * @final"," * @value \"datasource\""," */"," NS: \"datasource\",",""," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataTableDataSource\""," */"," NAME: \"dataTableDataSource\",","","/////////////////////////////////////////////////////////////////////////////","//","// ATTRIBUTES","//","/////////////////////////////////////////////////////////////////////////////"," ATTRS: {"," /**"," * @attribute datasource"," * @description Pointer to DataSource instance."," * @type {DataSource}"," */"," datasource: {"," setter: \"_setDataSource\""," },"," "," /**"," * @attribute initialRequest"," * @description Request sent to DataSource immediately upon initialization."," * @type Object"," */"," initialRequest: {"," setter: \"_setInitialRequest\""," }"," }","});","","/////////////////////////////////////////////////////////////////////////////","//","// PROTOTYPE","//","/////////////////////////////////////////////////////////////////////////////","Y.extend(DataTableDataSource, Y.Plugin.Base, {"," /////////////////////////////////////////////////////////////////////////////"," //"," // ATTRIBUTE HELPERS"," //"," /////////////////////////////////////////////////////////////////////////////"," /**"," * @method _setDataSource"," * @description Creates new DataSource instance if one is not provided."," * @param ds {Object | Y.DataSource}"," * @return {DataSource}"," * @private"," */"," _setDataSource: function(ds) {"," return ds || new Y.DataSource.Local(ds);"," },",""," /**"," * @method _setInitialRequest"," * @description Sends request to DataSource."," * @param request {Object} DataSource request."," * @private"," */"," _setInitialRequest: function(request) {"," },",""," /////////////////////////////////////////////////////////////////////////////"," //"," // METHODS"," //"," /////////////////////////////////////////////////////////////////////////////"," /**"," * Initializer."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," if(!Y.Lang.isUndefined(config.initialRequest)) {"," this.load({request:config.initialRequest});"," }"," },",""," ////////////////////////////////////////////////////////////////////////////"," //"," // DATA"," //"," ////////////////////////////////////////////////////////////////////////////",""," /**"," * Load data by calling DataSource's sendRequest() method under the hood."," *"," * @method load"," * @param config {object} Optional configuration parameters:"," *"," * <dl>"," * <dt>request</dt><dd>Pass in a new request, or initialRequest is used.</dd>"," * <dt>callback</dt><dd>Pass in DataSource callback object, or the following default is used:"," * <dl>"," * <dt>success</dt><dd>datatable.onDataReturnInitializeTable</dd>"," * <dt>failure</dt><dd>datatable.onDataReturnInitializeTable</dd>"," * <dt>scope</dt><dd>datatable</dd>"," * <dt>argument</dt><dd>datatable.getState()</dd>"," * </dl>"," * </dd>"," * <dt>datasource</dt><dd>Pass in a new DataSource instance to override the current DataSource for this transaction.</dd>"," * </dl>"," */"," load: function(config) {"," config = config || {};"," config.request = config.request || this.get(\"initialRequest\");"," config.callback = config.callback || {"," success: Y.bind(this.onDataReturnInitializeTable, this),"," failure: Y.bind(this.onDataReturnInitializeTable, this),"," argument: this.get(\"host\").get(\"state\") //TODO"," };",""," var ds = (config.datasource || this.get(\"datasource\"));"," if(ds) {"," ds.sendRequest(config);"," }"," },",""," /**"," * Callback function passed to DataSource's sendRequest() method populates"," * an entire DataTable with new data, clearing previous data, if any."," *"," * @method onDataReturnInitializeTable"," * @param e {Event.Facade} DataSource Event Facade object."," */"," onDataReturnInitializeTable : function(e) {"," var records = (e.response && e.response.results) || [];",""," this.get(\"host\").set(\"data\", records);"," }","});","","Y.namespace(\"Plugin\").DataTableDataSource = DataTableDataSource;","","","}, '@VERSION@', {\"requires\": [\"datatable-base\", \"plugin\", \"datasource-local\"]});"];
_yuitest_coverage["build/datatable-datasource/datatable-datasource.js"].lines = {"1":0,"15":0,"16":0,"24":0,"79":0,"93":0,"118":0,"119":0,"149":0,"150":0,"151":0,"157":0,"158":0,"159":0,"171":0,"173":0,"177":0};
_yuitest_coverage["build/datatable-datasource/datatable-datasource.js"].functions = {"DataTableDataSource:15":0,"_setDataSource:92":0,"initializer:117":0,"load:148":0,"onDataReturnInitializeTable:170":0,"(anonymous 1):1":0};
_yuitest_coverage["build/datatable-datasource/datatable-datasource.js"].coveredLines = 17;
_yuitest_coverage["build/datatable-datasource/datatable-datasource.js"].coveredFunctions = 6;
_yuitest_coverline("build/datatable-datasource/datatable-datasource.js", 1);
YUI.add('datatable-datasource', function (Y, NAME) {
/**
* Plugs DataTable with DataSource integration.
*
* @module datatable
* @submodule datatable-datasource
*/
/**
* Adds DataSource integration to DataTable.
* @class Plugin.DataTableDataSource
* @extends Plugin.Base
*/
_yuitest_coverfunc("build/datatable-datasource/datatable-datasource.js", "(anonymous 1)", 1);
_yuitest_coverline("build/datatable-datasource/datatable-datasource.js", 15);
function DataTableDataSource() {
_yuitest_coverfunc("build/datatable-datasource/datatable-datasource.js", "DataTableDataSource", 15);
_yuitest_coverline("build/datatable-datasource/datatable-datasource.js", 16);
DataTableDataSource.superclass.constructor.apply(this, arguments);
}
/////////////////////////////////////////////////////////////////////////////
//
// STATIC PROPERTIES
//
/////////////////////////////////////////////////////////////////////////////
_yuitest_coverline("build/datatable-datasource/datatable-datasource.js", 24);
Y.mix(DataTableDataSource, {
/**
* The namespace for the plugin. This will be the property on the host which
* references the plugin instance.
*
* @property NS
* @type String
* @static
* @final
* @value "datasource"
*/
NS: "datasource",
/**
* Class name.
*
* @property NAME
* @type String
* @static
* @final
* @value "dataTableDataSource"
*/
NAME: "dataTableDataSource",
/////////////////////////////////////////////////////////////////////////////
//
// ATTRIBUTES
//
/////////////////////////////////////////////////////////////////////////////
ATTRS: {
/**
* @attribute datasource
* @description Pointer to DataSource instance.
* @type {DataSource}
*/
datasource: {
setter: "_setDataSource"
},
/**
* @attribute initialRequest
* @description Request sent to DataSource immediately upon initialization.
* @type Object
*/
initialRequest: {
setter: "_setInitialRequest"
}
}
});
/////////////////////////////////////////////////////////////////////////////
//
// PROTOTYPE
//
/////////////////////////////////////////////////////////////////////////////
_yuitest_coverline("build/datatable-datasource/datatable-datasource.js", 79);
Y.extend(DataTableDataSource, Y.Plugin.Base, {
/////////////////////////////////////////////////////////////////////////////
//
// ATTRIBUTE HELPERS
//
/////////////////////////////////////////////////////////////////////////////
/**
* @method _setDataSource
* @description Creates new DataSource instance if one is not provided.
* @param ds {Object | Y.DataSource}
* @return {DataSource}
* @private
*/
_setDataSource: function(ds) {
_yuitest_coverfunc("build/datatable-datasource/datatable-datasource.js", "_setDataSource", 92);
_yuitest_coverline("build/datatable-datasource/datatable-datasource.js", 93);
return ds || new Y.DataSource.Local(ds);
},
/**
* @method _setInitialRequest
* @description Sends request to DataSource.
* @param request {Object} DataSource request.
* @private
*/
_setInitialRequest: function(request) {
},
/////////////////////////////////////////////////////////////////////////////
//
// METHODS
//
/////////////////////////////////////////////////////////////////////////////
/**
* Initializer.
*
* @method initializer
* @param config {Object} Config object.
* @private
*/
initializer: function(config) {
_yuitest_coverfunc("build/datatable-datasource/datatable-datasource.js", "initializer", 117);
_yuitest_coverline("build/datatable-datasource/datatable-datasource.js", 118);
if(!Y.Lang.isUndefined(config.initialRequest)) {
_yuitest_coverline("build/datatable-datasource/datatable-datasource.js", 119);
this.load({request:config.initialRequest});
}
},
////////////////////////////////////////////////////////////////////////////
//
// DATA
//
////////////////////////////////////////////////////////////////////////////
/**
* Load data by calling DataSource's sendRequest() method under the hood.
*
* @method load
* @param config {object} Optional configuration parameters:
*
* <dl>
* <dt>request</dt><dd>Pass in a new request, or initialRequest is used.</dd>
* <dt>callback</dt><dd>Pass in DataSource callback object, or the following default is used:
* <dl>
* <dt>success</dt><dd>datatable.onDataReturnInitializeTable</dd>
* <dt>failure</dt><dd>datatable.onDataReturnInitializeTable</dd>
* <dt>scope</dt><dd>datatable</dd>
* <dt>argument</dt><dd>datatable.getState()</dd>
* </dl>
* </dd>
* <dt>datasource</dt><dd>Pass in a new DataSource instance to override the current DataSource for this transaction.</dd>
* </dl>
*/
load: function(config) {
_yuitest_coverfunc("build/datatable-datasource/datatable-datasource.js", "load", 148);
_yuitest_coverline("build/datatable-datasource/datatable-datasource.js", 149);
config = config || {};
_yuitest_coverline("build/datatable-datasource/datatable-datasource.js", 150);
config.request = config.request || this.get("initialRequest");
_yuitest_coverline("build/datatable-datasource/datatable-datasource.js", 151);
config.callback = config.callback || {
success: Y.bind(this.onDataReturnInitializeTable, this),
failure: Y.bind(this.onDataReturnInitializeTable, this),
argument: this.get("host").get("state") //TODO
};
_yuitest_coverline("build/datatable-datasource/datatable-datasource.js", 157);
var ds = (config.datasource || this.get("datasource"));
_yuitest_coverline("build/datatable-datasource/datatable-datasource.js", 158);
if(ds) {
_yuitest_coverline("build/datatable-datasource/datatable-datasource.js", 159);
ds.sendRequest(config);
}
},
/**
* Callback function passed to DataSource's sendRequest() method populates
* an entire DataTable with new data, clearing previous data, if any.
*
* @method onDataReturnInitializeTable
* @param e {Event.Facade} DataSource Event Facade object.
*/
onDataReturnInitializeTable : function(e) {
_yuitest_coverfunc("build/datatable-datasource/datatable-datasource.js", "onDataReturnInitializeTable", 170);
_yuitest_coverline("build/datatable-datasource/datatable-datasource.js", 171);
var records = (e.response && e.response.results) || [];
_yuitest_coverline("build/datatable-datasource/datatable-datasource.js", 173);
this.get("host").set("data", records);
}
});
_yuitest_coverline("build/datatable-datasource/datatable-datasource.js", 177);
Y.namespace("Plugin").DataTableDataSource = DataTableDataSource;
}, '@VERSION@', {"requires": ["datatable-base", "plugin", "datasource-local"]});
| algolia/cdnjs | ajax/libs/yui/3.8.0pr1/datatable-datasource/datatable-datasource-coverage.js | JavaScript | mit | 14,376 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"\u0434\u043e \u043f\u043e\u043b\u0443\u0434\u043d\u044f",
"\u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0434\u043d\u044f"
],
"DAY": [
"\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435",
"\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a",
"\u0432\u0442\u043e\u0440\u043d\u0438\u043a",
"\u0441\u0440\u0435\u0434\u0430",
"\u0447\u0435\u0442\u0432\u0435\u0440\u0433",
"\u043f\u044f\u0442\u043d\u0438\u0446\u0430",
"\u0441\u0443\u0431\u0431\u043e\u0442\u0430"
],
"MONTH": [
"\u044f\u043d\u0432\u0430\u0440\u044f",
"\u0444\u0435\u0432\u0440\u0430\u043b\u044f",
"\u043c\u0430\u0440\u0442\u0430",
"\u0430\u043f\u0440\u0435\u043b\u044f",
"\u043c\u0430\u044f",
"\u0438\u044e\u043d\u044f",
"\u0438\u044e\u043b\u044f",
"\u0430\u0432\u0433\u0443\u0441\u0442\u0430",
"\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f",
"\u043e\u043a\u0442\u044f\u0431\u0440\u044f",
"\u043d\u043e\u044f\u0431\u0440\u044f",
"\u0434\u0435\u043a\u0430\u0431\u0440\u044f"
],
"SHORTDAY": [
"\u0432\u0441",
"\u043f\u043d",
"\u0432\u0442",
"\u0441\u0440",
"\u0447\u0442",
"\u043f\u0442",
"\u0441\u0431"
],
"SHORTMONTH": [
"\u044f\u043d\u0432.",
"\u0444\u0435\u0432\u0440.",
"\u043c\u0430\u0440\u0442\u0430",
"\u0430\u043f\u0440.",
"\u043c\u0430\u044f",
"\u0438\u044e\u043d\u044f",
"\u0438\u044e\u043b\u044f",
"\u0430\u0432\u0433.",
"\u0441\u0435\u043d\u0442.",
"\u043e\u043a\u0442.",
"\u043d\u043e\u044f\u0431.",
"\u0434\u0435\u043a."
],
"fullDate": "EEEE, d MMMM y\u00a0'\u0433'.",
"longDate": "d MMMM y\u00a0'\u0433'.",
"medium": "dd.MM.yyyy H:mm:ss",
"mediumDate": "dd.MM.yyyy",
"mediumTime": "H:mm:ss",
"short": "dd.MM.yy H:mm",
"shortDate": "dd.MM.yy",
"shortTime": "H:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u0440\u0443\u0431.",
"DECIMAL_SEP": ",",
"GROUP_SEP": "\u00a0",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "ru-ru",
"pluralCat": function (n) { if (n % 10 == 1 && n % 100 != 11) { return PLURAL_CATEGORY.ONE; } if (n == (n | 0) && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) { return PLURAL_CATEGORY.FEW; } if (n % 10 == 0 || n == (n | 0) && n % 10 >= 5 && n % 10 <= 9 || n == (n | 0) && n % 100 >= 11 && n % 100 <= 14) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
});
}]); | pvnr0082t/cdnjs | ajax/libs/angular-i18n/1.2.6/angular-locale_ru-ru.js | JavaScript | mit | 3,310 |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"\u0434\u043e \u043f\u043e\u043b\u0443\u0434\u043d\u044f",
"\u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0434\u043d\u044f"
],
"DAY": [
"\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435",
"\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a",
"\u0432\u0442\u043e\u0440\u043d\u0438\u043a",
"\u0441\u0440\u0435\u0434\u0430",
"\u0447\u0435\u0442\u0432\u0435\u0440\u0433",
"\u043f\u044f\u0442\u043d\u0438\u0446\u0430",
"\u0441\u0443\u0431\u0431\u043e\u0442\u0430"
],
"MONTH": [
"\u044f\u043d\u0432\u0430\u0440\u044f",
"\u0444\u0435\u0432\u0440\u0430\u043b\u044f",
"\u043c\u0430\u0440\u0442\u0430",
"\u0430\u043f\u0440\u0435\u043b\u044f",
"\u043c\u0430\u044f",
"\u0438\u044e\u043d\u044f",
"\u0438\u044e\u043b\u044f",
"\u0430\u0432\u0433\u0443\u0441\u0442\u0430",
"\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f",
"\u043e\u043a\u0442\u044f\u0431\u0440\u044f",
"\u043d\u043e\u044f\u0431\u0440\u044f",
"\u0434\u0435\u043a\u0430\u0431\u0440\u044f"
],
"SHORTDAY": [
"\u0432\u0441",
"\u043f\u043d",
"\u0432\u0442",
"\u0441\u0440",
"\u0447\u0442",
"\u043f\u0442",
"\u0441\u0431"
],
"SHORTMONTH": [
"\u044f\u043d\u0432.",
"\u0444\u0435\u0432\u0440.",
"\u043c\u0430\u0440\u0442\u0430",
"\u0430\u043f\u0440.",
"\u043c\u0430\u044f",
"\u0438\u044e\u043d\u044f",
"\u0438\u044e\u043b\u044f",
"\u0430\u0432\u0433.",
"\u0441\u0435\u043d\u0442.",
"\u043e\u043a\u0442.",
"\u043d\u043e\u044f\u0431.",
"\u0434\u0435\u043a."
],
"fullDate": "EEEE, d MMMM y\u00a0'\u0433'.",
"longDate": "d MMMM y\u00a0'\u0433'.",
"medium": "dd.MM.yyyy H:mm:ss",
"mediumDate": "dd.MM.yyyy",
"mediumTime": "H:mm:ss",
"short": "dd.MM.yy H:mm",
"shortDate": "dd.MM.yy",
"shortTime": "H:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u0440\u0443\u0431.",
"DECIMAL_SEP": ",",
"GROUP_SEP": "\u00a0",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "ru-ru",
"pluralCat": function (n) { if (n % 10 == 1 && n % 100 != 11) { return PLURAL_CATEGORY.ONE; } if (n == (n | 0) && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14)) { return PLURAL_CATEGORY.FEW; } if (n % 10 == 0 || n == (n | 0) && n % 10 >= 5 && n % 10 <= 9 || n == (n | 0) && n % 100 >= 11 && n % 100 <= 14) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;}
});
}]); | senekis/cdnjs | ajax/libs/angular.js/1.2.8/i18n/angular-locale_ru-ru.js | JavaScript | mit | 3,310 |
var tap = require("tap")
var origCwd = process.cwd()
process.chdir(__dirname)
tap.test("changing cwd and searching for **/d", function (t) {
var glob = require('../')
var path = require('path')
t.test('.', function (t) {
glob('**/d', function (er, matches) {
t.ifError(er)
t.like(matches, [ 'a/b/c/d', 'a/c/d' ])
t.end()
})
})
t.test('a', function (t) {
glob('**/d', {cwd:path.resolve('a')}, function (er, matches) {
t.ifError(er)
t.like(matches, [ 'b/c/d', 'c/d' ])
t.end()
})
})
t.test('a/b', function (t) {
glob('**/d', {cwd:path.resolve('a/b')}, function (er, matches) {
t.ifError(er)
t.like(matches, [ 'c/d' ])
t.end()
})
})
t.test('a/b/', function (t) {
glob('**/d', {cwd:path.resolve('a/b/')}, function (er, matches) {
t.ifError(er)
t.like(matches, [ 'c/d' ])
t.end()
})
})
t.test('.', function (t) {
glob('**/d', {cwd: process.cwd()}, function (er, matches) {
t.ifError(er)
t.like(matches, [ 'a/b/c/d', 'a/c/d' ])
t.end()
})
})
t.test('cd -', function (t) {
process.chdir(origCwd)
t.end()
})
t.end()
})
| ant-mej/MEANtwit | node_modules/grunt/node_modules/glob/test/cwd-test.js | JavaScript | mit | 1,187 |
var tap = require("tap")
var origCwd = process.cwd()
process.chdir(__dirname)
tap.test("changing cwd and searching for **/d", function (t) {
var glob = require('../')
var path = require('path')
t.test('.', function (t) {
glob('**/d', function (er, matches) {
t.ifError(er)
t.like(matches, [ 'a/b/c/d', 'a/c/d' ])
t.end()
})
})
t.test('a', function (t) {
glob('**/d', {cwd:path.resolve('a')}, function (er, matches) {
t.ifError(er)
t.like(matches, [ 'b/c/d', 'c/d' ])
t.end()
})
})
t.test('a/b', function (t) {
glob('**/d', {cwd:path.resolve('a/b')}, function (er, matches) {
t.ifError(er)
t.like(matches, [ 'c/d' ])
t.end()
})
})
t.test('a/b/', function (t) {
glob('**/d', {cwd:path.resolve('a/b/')}, function (er, matches) {
t.ifError(er)
t.like(matches, [ 'c/d' ])
t.end()
})
})
t.test('.', function (t) {
glob('**/d', {cwd: process.cwd()}, function (er, matches) {
t.ifError(er)
t.like(matches, [ 'a/b/c/d', 'a/c/d' ])
t.end()
})
})
t.test('cd -', function (t) {
process.chdir(origCwd)
t.end()
})
t.end()
})
| rquellh/thewanderingconsultant | node_modules/matchdep/node_modules/findup-sync/node_modules/glob/test/cwd-test.js | JavaScript | mit | 1,187 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.