@undp/carbon-library 1.0.62 → 1.0.64
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.js +3540 -198
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/Components/Common/CoBenifits/assessment.d.ts +3 -0
- package/dist/cjs/types/Components/Common/CoBenifits/coBenifits.d.ts +14 -0
- package/dist/cjs/types/Components/Common/CoBenifits/economic.d.ts +3 -0
- package/dist/cjs/types/Components/Common/CoBenifits/environmental.d.ts +3 -0
- package/dist/cjs/types/Components/Common/CoBenifits/genderParity.d.ts +3 -0
- package/dist/cjs/types/Components/Common/CoBenifits/safeguards.d.ts +3 -0
- package/dist/cjs/types/Components/Common/CoBenifits/sdgGoals.d.ts +3 -0
- package/dist/cjs/types/Components/Common/CoBenifits/social.d.ts +3 -0
- package/dist/cjs/types/Components/Common/NdcActionDetails/ndcActionDetails.d.ts +13 -0
- package/dist/cjs/types/Components/NdcActions/AddNdcAction/addNdcActionComponent.d.ts +3 -0
- package/dist/cjs/types/Definitions/Definitions/programme.definitions.d.ts +2 -0
- package/dist/cjs/types/Definitions/Enums/commonEnums.d.ts +23 -0
- package/dist/cjs/types/Definitions/Enums/consumerGroups.enum.d.ts +4 -0
- package/dist/cjs/types/Definitions/Enums/energyGenerationUnits.enum.d.ts +13 -0
- package/dist/cjs/types/Definitions/Enums/landAreaUnits.enum.d.ts +15 -0
- package/dist/cjs/types/Definitions/Enums/mitigation.types.enum.d.ts +1 -0
- package/dist/cjs/types/Definitions/Enums/sdgGoals.enum.d.ts +19 -0
- package/dist/cjs/types/Definitions/Enums/sector.enum.d.ts +12 -0
- package/dist/cjs/types/Definitions/index.d.ts +7 -0
- package/dist/esm/index.js +3481 -145
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/Components/Common/CoBenifits/assessment.d.ts +3 -0
- package/dist/esm/types/Components/Common/CoBenifits/coBenifits.d.ts +14 -0
- package/dist/esm/types/Components/Common/CoBenifits/economic.d.ts +3 -0
- package/dist/esm/types/Components/Common/CoBenifits/environmental.d.ts +3 -0
- package/dist/esm/types/Components/Common/CoBenifits/genderParity.d.ts +3 -0
- package/dist/esm/types/Components/Common/CoBenifits/safeguards.d.ts +3 -0
- package/dist/esm/types/Components/Common/CoBenifits/sdgGoals.d.ts +3 -0
- package/dist/esm/types/Components/Common/CoBenifits/social.d.ts +3 -0
- package/dist/esm/types/Components/Common/NdcActionDetails/ndcActionDetails.d.ts +13 -0
- package/dist/esm/types/Components/NdcActions/AddNdcAction/addNdcActionComponent.d.ts +3 -0
- package/dist/esm/types/Definitions/Definitions/programme.definitions.d.ts +2 -0
- package/dist/esm/types/Definitions/Enums/commonEnums.d.ts +23 -0
- package/dist/esm/types/Definitions/Enums/consumerGroups.enum.d.ts +4 -0
- package/dist/esm/types/Definitions/Enums/energyGenerationUnits.enum.d.ts +13 -0
- package/dist/esm/types/Definitions/Enums/landAreaUnits.enum.d.ts +15 -0
- package/dist/esm/types/Definitions/Enums/mitigation.types.enum.d.ts +1 -0
- package/dist/esm/types/Definitions/Enums/sdgGoals.enum.d.ts +19 -0
- package/dist/esm/types/Definitions/Enums/sector.enum.d.ts +12 -0
- package/dist/esm/types/Definitions/index.d.ts +7 -0
- package/dist/index.d.ts +116 -1
- package/package.json +2 -1
package/dist/cjs/index.js
CHANGED
@@ -372,6 +372,14 @@ var sumArray = function (arrList) {
|
|
372
372
|
}
|
373
373
|
return arrList.reduce(function (a, b) { return Number(a) + Number(b); }, 0);
|
374
374
|
};
|
375
|
+
var getBase64 = function (file) {
|
376
|
+
return new Promise(function (resolve, reject) {
|
377
|
+
var reader = new FileReader();
|
378
|
+
reader.readAsDataURL(file);
|
379
|
+
reader.onload = function () { return resolve(reader.result); };
|
380
|
+
reader.onerror = function (error) { return reject(error); };
|
381
|
+
});
|
382
|
+
};
|
375
383
|
|
376
384
|
var Action;
|
377
385
|
(function (Action) {
|
@@ -418,7 +426,7 @@ var ProfileIcon = function (props) {
|
|
418
426
|
return (React.createElement("span", { className: "profile-icon", style: { backgroundColor: bg } }, isBase64(icon) ? (React.createElement("img", { alt: "profile-icon", src: 'data:image/jpeg;base64,' + icon })) : icon ? (React.createElement("img", { alt: "profile-icon", src: icon })) : name ? (name.charAt(0).toUpperCase()) : ('A')));
|
419
427
|
};
|
420
428
|
|
421
|
-
|
429
|
+
exports.CompanyRole = void 0;
|
422
430
|
(function (CompanyRole) {
|
423
431
|
CompanyRole["ACADEMICS"] = "Academics";
|
424
432
|
CompanyRole["SERVICE_PROVIDER"] = "ServiceProvider";
|
@@ -437,7 +445,7 @@ var CompanyRole;
|
|
437
445
|
CompanyRole["GOVERNMENT"] = "Government";
|
438
446
|
CompanyRole["MINISTRY"] = "Ministry";
|
439
447
|
CompanyRole["API"] = "API";
|
440
|
-
})(CompanyRole || (CompanyRole = {}));
|
448
|
+
})(exports.CompanyRole || (exports.CompanyRole = {}));
|
441
449
|
|
442
450
|
var Search$2 = antd.Input.Search;
|
443
451
|
var CompanyManagementComponent = function (props) {
|
@@ -479,8 +487,8 @@ var CompanyManagementComponent = function (props) {
|
|
479
487
|
};
|
480
488
|
var getCompanyRoleComponent = function (item) {
|
481
489
|
return (React.createElement("div", { style: { display: "flex", alignItems: "center" } },
|
482
|
-
item === CompanyRole.GOVERNMENT ? (React.createElement(RoleIcon, { icon: React.createElement(icons.BankOutlined, null), bg: GovBGColor, color: GovColor })) : item === CompanyRole.CERTIFIER ? (React.createElement(RoleIcon, { icon: React.createElement(icons.SafetyOutlined, null), bg: CertBGColor, color: CertColor })) : item === CompanyRole.MINISTRY ? (React.createElement(RoleIcon, { icon: React.createElement(icons.AuditOutlined, null), bg: MinBGColor, color: MinColor })) : (React.createElement(RoleIcon, { icon: React.createElement(icons.ExperimentOutlined, null), bg: DevBGColor, color: DevColor })),
|
483
|
-
item === CompanyRole.PROGRAMME_DEVELOPER ? (React.createElement("div", null, t("company:developer"))) : (React.createElement("div", null, item))));
|
490
|
+
item === exports.CompanyRole.GOVERNMENT ? (React.createElement(RoleIcon, { icon: React.createElement(icons.BankOutlined, null), bg: GovBGColor, color: GovColor })) : item === exports.CompanyRole.CERTIFIER ? (React.createElement(RoleIcon, { icon: React.createElement(icons.SafetyOutlined, null), bg: CertBGColor, color: CertColor })) : item === exports.CompanyRole.MINISTRY ? (React.createElement(RoleIcon, { icon: React.createElement(icons.AuditOutlined, null), bg: MinBGColor, color: MinColor })) : (React.createElement(RoleIcon, { icon: React.createElement(icons.ExperimentOutlined, null), bg: DevBGColor, color: DevColor })),
|
491
|
+
item === exports.CompanyRole.PROGRAMME_DEVELOPER ? (React.createElement("div", null, t("company:developer"))) : (React.createElement("div", null, item))));
|
484
492
|
};
|
485
493
|
var handleFilterVisibleChange = function () {
|
486
494
|
setFilterVisible(true);
|
@@ -641,7 +649,7 @@ var CompanyManagementComponent = function (props) {
|
|
641
649
|
case 2:
|
642
650
|
response = _c.sent();
|
643
651
|
if (response && response.data) {
|
644
|
-
availableCompanies = response.data.filter(function (company) { return company.companyRole !== CompanyRole.API; });
|
652
|
+
availableCompanies = response.data.filter(function (company) { return company.companyRole !== exports.CompanyRole.API; });
|
645
653
|
setTableData(availableCompanies);
|
646
654
|
setTotalCompany((_b = (_a = response === null || response === void 0 ? void 0 : response.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.total);
|
647
655
|
}
|
@@ -913,6 +921,68 @@ var mitigationTypeList = [
|
|
913
921
|
{ value: exports.MitigationTypes.TRANSPORT.valueOf(), label: "Transport" },
|
914
922
|
{ value: exports.MitigationTypes.WIND.valueOf(), label: "Wind" },
|
915
923
|
];
|
924
|
+
var sectorMitigationTypesListMapped = {
|
925
|
+
Energy: [
|
926
|
+
{
|
927
|
+
value: exports.MitigationTypes.BIOMASS_ENERGY.valueOf(),
|
928
|
+
label: "Biomass energy",
|
929
|
+
},
|
930
|
+
{
|
931
|
+
value: exports.MitigationTypes.COAL_MINE.valueOf(),
|
932
|
+
label: "Coal bed/mine methane",
|
933
|
+
},
|
934
|
+
{ value: exports.MitigationTypes.EE_HOUSEHOLDS.valueOf(), label: "EE households" },
|
935
|
+
{ value: exports.MitigationTypes.EE_INDUSTRY.valueOf(), label: "EE industry" },
|
936
|
+
{
|
937
|
+
value: exports.MitigationTypes.EE_OWN_GENERATION.valueOf(),
|
938
|
+
label: "EE own generation",
|
939
|
+
},
|
940
|
+
{ value: exports.MitigationTypes.EE_SERVICE.valueOf(), label: "EE service" },
|
941
|
+
{
|
942
|
+
value: exports.MitigationTypes.EE_SUPPLY_SIDE.valueOf(),
|
943
|
+
label: "EE supply side",
|
944
|
+
},
|
945
|
+
{
|
946
|
+
value: exports.MitigationTypes.ENERGY_DISTRIBUTION.valueOf(),
|
947
|
+
label: "Energy distribution",
|
948
|
+
},
|
949
|
+
{
|
950
|
+
value: exports.MitigationTypes.FOSSIL_FUEL.valueOf(),
|
951
|
+
label: "Fossil fuel switch",
|
952
|
+
},
|
953
|
+
{ value: exports.MitigationTypes.GEOTHERMAL.valueOf(), label: "Geothermal" },
|
954
|
+
{ value: exports.MitigationTypes.HYDRO.valueOf(), label: "Hydro" },
|
955
|
+
{ value: exports.MitigationTypes.SOLAR.valueOf(), label: "Solar" },
|
956
|
+
{ value: exports.MitigationTypes.WIND.valueOf(), label: "Wind" },
|
957
|
+
],
|
958
|
+
Health: [],
|
959
|
+
Education: [],
|
960
|
+
Transport: [
|
961
|
+
{ value: exports.MitigationTypes.TRANSPORT.valueOf(), label: "Transport" },
|
962
|
+
],
|
963
|
+
Manufacturing: [
|
964
|
+
{ value: exports.MitigationTypes.CEMENT.valueOf(), label: "Cement" },
|
965
|
+
{ value: exports.MitigationTypes.CCS.valueOf(), label: "CCS" },
|
966
|
+
{ value: exports.MitigationTypes.HFC_PFCS_SF6.valueOf(), label: "HFCs, PFCs, SF6" },
|
967
|
+
],
|
968
|
+
Hospitality: [],
|
969
|
+
Forestry: [{ value: exports.MitigationTypes.FORESTRY.valueOf(), label: "Forestry" }],
|
970
|
+
Waste: [
|
971
|
+
{ value: exports.MitigationTypes.LANDFILLS.valueOf(), label: "Landfills" },
|
972
|
+
{ value: exports.MitigationTypes.FUGITIVE.valueOf(), label: "Fugitive" },
|
973
|
+
{
|
974
|
+
value: exports.MitigationTypes.METHANE_AVOIDANCE.valueOf(),
|
975
|
+
label: "Methane avoidance",
|
976
|
+
},
|
977
|
+
],
|
978
|
+
Agriculture: [
|
979
|
+
{ value: exports.MitigationTypes.AGRICULTURE.valueOf(), label: "Agriculture" },
|
980
|
+
],
|
981
|
+
Other: [
|
982
|
+
{ value: exports.MitigationTypes.MARINE.valueOf(), label: "Marine" },
|
983
|
+
{ value: exports.MitigationTypes.N20.valueOf(), label: "N2O" },
|
984
|
+
],
|
985
|
+
};
|
916
986
|
|
917
987
|
exports.ESGType = void 0;
|
918
988
|
(function (ESGType) {
|
@@ -1014,161 +1084,3427 @@ exports.RetireType = void 0;
|
|
1014
1084
|
RetireType["OTHER"] = "2";
|
1015
1085
|
})(exports.RetireType || (exports.RetireType = {}));
|
1016
1086
|
|
1017
|
-
exports.
|
1018
|
-
(function (
|
1019
|
-
|
1020
|
-
|
1087
|
+
exports.EnergyGenerationUnits = void 0;
|
1088
|
+
(function (EnergyGenerationUnits) {
|
1089
|
+
EnergyGenerationUnits["Wh"] = "Wh/year/unit";
|
1090
|
+
EnergyGenerationUnits["mWh"] = "mWh/year/unit";
|
1091
|
+
EnergyGenerationUnits["kWh"] = "kWh/year/unit";
|
1092
|
+
EnergyGenerationUnits["MWh"] = "MWh/year/unit";
|
1093
|
+
EnergyGenerationUnits["GWh"] = "GWh/year/unit";
|
1094
|
+
EnergyGenerationUnits["J"] = "J/year/unit";
|
1095
|
+
EnergyGenerationUnits["KJ"] = "kJ/year/unit";
|
1096
|
+
})(exports.EnergyGenerationUnits || (exports.EnergyGenerationUnits = {}));
|
1097
|
+
var energyGenerationUnitList = [
|
1098
|
+
{ value: exports.EnergyGenerationUnits.Wh.valueOf(), label: "Wh" },
|
1099
|
+
{ value: exports.EnergyGenerationUnits.mWh.valueOf(), label: "mWh" },
|
1100
|
+
{ value: exports.EnergyGenerationUnits.kWh.valueOf(), label: "kWh" },
|
1101
|
+
{ value: exports.EnergyGenerationUnits.MWh.valueOf(), label: "MWh" },
|
1102
|
+
{ value: exports.EnergyGenerationUnits.GWh.valueOf(), label: "GWh" },
|
1103
|
+
{ value: exports.EnergyGenerationUnits.J.valueOf(), label: "J" },
|
1104
|
+
{ value: exports.EnergyGenerationUnits.KJ.valueOf(), label: "KJ" },
|
1105
|
+
];
|
1021
1106
|
|
1022
|
-
exports.
|
1023
|
-
(function (
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1107
|
+
exports.LandAreaUnits = void 0;
|
1108
|
+
(function (LandAreaUnits) {
|
1109
|
+
LandAreaUnits["mm2"] = "mm2";
|
1110
|
+
LandAreaUnits["cm2"] = "cm2";
|
1111
|
+
LandAreaUnits["m2"] = "m2";
|
1112
|
+
LandAreaUnits["ha"] = "ha";
|
1113
|
+
LandAreaUnits["km2"] = "km2";
|
1114
|
+
LandAreaUnits["in2"] = "in2";
|
1115
|
+
LandAreaUnits["ft2"] = "ft2";
|
1116
|
+
LandAreaUnits["ac"] = "ac";
|
1117
|
+
LandAreaUnits["Mi2"] = "Mi2";
|
1118
|
+
})(exports.LandAreaUnits || (exports.LandAreaUnits = {}));
|
1119
|
+
var landAreaUnitList = [
|
1120
|
+
{ value: exports.LandAreaUnits.mm2.valueOf(), label: "mm2" },
|
1121
|
+
{ value: exports.LandAreaUnits.cm2.valueOf(), label: "cm2" },
|
1122
|
+
{ value: exports.LandAreaUnits.m2.valueOf(), label: "m2" },
|
1123
|
+
{ value: exports.LandAreaUnits.ha.valueOf(), label: "ha" },
|
1124
|
+
{ value: exports.LandAreaUnits.km2.valueOf(), label: "km2" },
|
1125
|
+
{ value: exports.LandAreaUnits.in2.valueOf(), label: "in2" },
|
1126
|
+
{ value: exports.LandAreaUnits.ft2.valueOf(), label: "ft2" },
|
1127
|
+
{ value: exports.LandAreaUnits.ac.valueOf(), label: "ac" },
|
1128
|
+
{ value: exports.LandAreaUnits.Mi2.valueOf(), label: "Mi2" },
|
1129
|
+
];
|
1027
1130
|
|
1028
|
-
var
|
1029
|
-
|
1131
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
1132
|
+
|
1133
|
+
var cjs = {};
|
1134
|
+
|
1135
|
+
var calculator = {};
|
1136
|
+
|
1137
|
+
var agricultureCal = {};
|
1138
|
+
|
1139
|
+
/**
|
1140
|
+
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
1141
|
+
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
1142
|
+
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
1143
|
+
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
1144
|
+
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
1145
|
+
* Available under MIT license <http://lodash.com/license>
|
1146
|
+
*/
|
1147
|
+
|
1148
|
+
/** Used to determine if values are of the language type Object */
|
1149
|
+
var objectTypes$3 = {
|
1150
|
+
'boolean': false,
|
1151
|
+
'function': true,
|
1152
|
+
'object': true,
|
1153
|
+
'number': false,
|
1154
|
+
'string': false,
|
1155
|
+
'undefined': false
|
1156
|
+
};
|
1157
|
+
|
1158
|
+
var lodash__objecttypes = objectTypes$3;
|
1159
|
+
|
1160
|
+
/**
|
1161
|
+
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
1162
|
+
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
1163
|
+
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
1164
|
+
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
1165
|
+
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
1166
|
+
* Available under MIT license <http://lodash.com/license>
|
1167
|
+
*/
|
1168
|
+
|
1169
|
+
var objectTypes$2 = lodash__objecttypes;
|
1170
|
+
|
1171
|
+
/**
|
1172
|
+
* Checks if `value` is the language type of Object.
|
1173
|
+
* (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
1174
|
+
*
|
1175
|
+
* @static
|
1176
|
+
* @memberOf _
|
1177
|
+
* @category Objects
|
1178
|
+
* @param {*} value The value to check.
|
1179
|
+
* @returns {boolean} Returns `true` if the `value` is an object, else `false`.
|
1180
|
+
* @example
|
1181
|
+
*
|
1182
|
+
* _.isObject({});
|
1183
|
+
* // => true
|
1184
|
+
*
|
1185
|
+
* _.isObject([1, 2, 3]);
|
1186
|
+
* // => true
|
1187
|
+
*
|
1188
|
+
* _.isObject(1);
|
1189
|
+
* // => false
|
1190
|
+
*/
|
1191
|
+
function isObject$4(value) {
|
1192
|
+
// check if the value is the ECMAScript language type of Object
|
1193
|
+
// http://es5.github.io/#x8
|
1194
|
+
// and avoid a V8 bug
|
1195
|
+
// http://code.google.com/p/v8/issues/detail?id=2291
|
1196
|
+
return !!(value && objectTypes$2[typeof value]);
|
1197
|
+
}
|
1198
|
+
|
1199
|
+
var lodash_isobject = isObject$4;
|
1200
|
+
|
1201
|
+
/**
|
1202
|
+
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
1203
|
+
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
1204
|
+
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
1205
|
+
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
1206
|
+
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
1207
|
+
* Available under MIT license <http://lodash.com/license>
|
1208
|
+
*/
|
1209
|
+
|
1210
|
+
/** Used for native method references */
|
1211
|
+
var objectProto$1 = Object.prototype;
|
1212
|
+
|
1213
|
+
/** Used to resolve the internal [[Class]] of values */
|
1214
|
+
var toString = objectProto$1.toString;
|
1215
|
+
|
1216
|
+
/** Used to detect if a method is native */
|
1217
|
+
var reNative$4 = RegExp('^' +
|
1218
|
+
String(toString)
|
1219
|
+
.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
1220
|
+
.replace(/toString| for [^\]]+/g, '.*?') + '$'
|
1221
|
+
);
|
1222
|
+
|
1223
|
+
var lodash__renative = reNative$4;
|
1224
|
+
|
1225
|
+
/**
|
1226
|
+
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
1227
|
+
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
1228
|
+
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
1229
|
+
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
1230
|
+
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
1231
|
+
* Available under MIT license <http://lodash.com/license>
|
1232
|
+
*/
|
1233
|
+
|
1234
|
+
var objectTypes$1 = lodash__objecttypes;
|
1235
|
+
|
1236
|
+
/** Used for native method references */
|
1237
|
+
var objectProto = Object.prototype;
|
1238
|
+
|
1239
|
+
/** Native method shortcuts */
|
1240
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
1241
|
+
|
1242
|
+
/**
|
1243
|
+
* A fallback implementation of `Object.keys` which produces an array of the
|
1244
|
+
* given object's own enumerable property names.
|
1245
|
+
*
|
1246
|
+
* @private
|
1247
|
+
* @type Function
|
1248
|
+
* @param {Object} object The object to inspect.
|
1249
|
+
* @returns {Array} Returns an array of property names.
|
1250
|
+
*/
|
1251
|
+
var shimKeys$1 = function(object) {
|
1252
|
+
var index, iterable = object, result = [];
|
1253
|
+
if (!iterable) return result;
|
1254
|
+
if (!(objectTypes$1[typeof object])) return result;
|
1255
|
+
for (index in iterable) {
|
1256
|
+
if (hasOwnProperty.call(iterable, index)) {
|
1257
|
+
result.push(index);
|
1258
|
+
}
|
1030
1259
|
}
|
1031
|
-
|
1260
|
+
return result
|
1261
|
+
};
|
1262
|
+
|
1263
|
+
var lodash__shimkeys = shimKeys$1;
|
1264
|
+
|
1265
|
+
/**
|
1266
|
+
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
1267
|
+
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
1268
|
+
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
1269
|
+
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
1270
|
+
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
1271
|
+
* Available under MIT license <http://lodash.com/license>
|
1272
|
+
*/
|
1273
|
+
|
1274
|
+
var isObject$3 = lodash_isobject,
|
1275
|
+
reNative$3 = lodash__renative,
|
1276
|
+
shimKeys = lodash__shimkeys;
|
1277
|
+
|
1278
|
+
/* Native method shortcuts for methods with the same name as other `lodash` methods */
|
1279
|
+
var nativeKeys = reNative$3.test(nativeKeys = Object.keys) && nativeKeys;
|
1280
|
+
|
1281
|
+
/**
|
1282
|
+
* Creates an array composed of the own enumerable property names of an object.
|
1283
|
+
*
|
1284
|
+
* @static
|
1285
|
+
* @memberOf _
|
1286
|
+
* @category Objects
|
1287
|
+
* @param {Object} object The object to inspect.
|
1288
|
+
* @returns {Array} Returns an array of property names.
|
1289
|
+
* @example
|
1290
|
+
*
|
1291
|
+
* _.keys({ 'one': 1, 'two': 2, 'three': 3 });
|
1292
|
+
* // => ['one', 'two', 'three'] (property order is not guaranteed across environments)
|
1293
|
+
*/
|
1294
|
+
var keys$2 = !nativeKeys ? shimKeys : function(object) {
|
1295
|
+
if (!isObject$3(object)) {
|
1296
|
+
return [];
|
1297
|
+
}
|
1298
|
+
return nativeKeys(object);
|
1299
|
+
};
|
1300
|
+
|
1301
|
+
var lodash_keys = keys$2;
|
1302
|
+
|
1303
|
+
/**
|
1304
|
+
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
1305
|
+
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
1306
|
+
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
1307
|
+
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
1308
|
+
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
1309
|
+
* Available under MIT license <http://lodash.com/license>
|
1310
|
+
*/
|
1311
|
+
|
1312
|
+
/**
|
1313
|
+
* A no-operation function.
|
1314
|
+
*
|
1315
|
+
* @static
|
1316
|
+
* @memberOf _
|
1317
|
+
* @category Utilities
|
1318
|
+
* @example
|
1319
|
+
*
|
1320
|
+
* var object = { 'name': 'fred' };
|
1321
|
+
* _.noop(object) === undefined;
|
1322
|
+
* // => true
|
1323
|
+
*/
|
1324
|
+
function noop$1() {
|
1325
|
+
// no operation performed
|
1326
|
+
}
|
1327
|
+
|
1328
|
+
var lodash_noop = noop$1;
|
1329
|
+
|
1330
|
+
/**
|
1331
|
+
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
1332
|
+
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
1333
|
+
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
1334
|
+
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
1335
|
+
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
1336
|
+
* Available under MIT license <http://lodash.com/license>
|
1337
|
+
*/
|
1338
|
+
|
1339
|
+
var isObject$2 = lodash_isobject,
|
1340
|
+
reNative$2 = lodash__renative;
|
1341
|
+
|
1342
|
+
/* Native method shortcuts for methods with the same name as other `lodash` methods */
|
1343
|
+
var nativeCreate = reNative$2.test(nativeCreate = Object.create) && nativeCreate;
|
1344
|
+
|
1345
|
+
/**
|
1346
|
+
* The base implementation of `_.create` without support for assigning
|
1347
|
+
* properties to the created object.
|
1348
|
+
*
|
1349
|
+
* @private
|
1350
|
+
* @param {Object} prototype The object to inherit from.
|
1351
|
+
* @returns {Object} Returns the new object.
|
1352
|
+
*/
|
1353
|
+
function baseCreate$2(prototype, properties) {
|
1354
|
+
return isObject$2(prototype) ? nativeCreate(prototype) : {};
|
1355
|
+
}
|
1356
|
+
// fallback for browsers without `Object.create`
|
1357
|
+
if (!nativeCreate) {
|
1358
|
+
baseCreate$2 = (function() {
|
1359
|
+
function Object() {}
|
1360
|
+
return function(prototype) {
|
1361
|
+
if (isObject$2(prototype)) {
|
1362
|
+
Object.prototype = prototype;
|
1363
|
+
var result = new Object;
|
1364
|
+
Object.prototype = null;
|
1365
|
+
}
|
1366
|
+
return result || commonjsGlobal.Object();
|
1367
|
+
};
|
1368
|
+
}());
|
1369
|
+
}
|
1370
|
+
|
1371
|
+
var lodash__basecreate = baseCreate$2;
|
1372
|
+
|
1373
|
+
/**
|
1374
|
+
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
1375
|
+
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
1376
|
+
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
1377
|
+
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
1378
|
+
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
1379
|
+
* Available under MIT license <http://lodash.com/license>
|
1380
|
+
*/
|
1381
|
+
|
1382
|
+
var noop = lodash_noop,
|
1383
|
+
reNative$1 = lodash__renative;
|
1384
|
+
|
1385
|
+
/** Used as the property descriptor for `__bindData__` */
|
1386
|
+
var descriptor = {
|
1387
|
+
'configurable': false,
|
1388
|
+
'enumerable': false,
|
1389
|
+
'value': null,
|
1390
|
+
'writable': false
|
1391
|
+
};
|
1392
|
+
|
1393
|
+
/** Used to set meta data on functions */
|
1394
|
+
var defineProperty = (function() {
|
1395
|
+
// IE 8 only accepts DOM elements
|
1396
|
+
try {
|
1397
|
+
var o = {},
|
1398
|
+
func = reNative$1.test(func = Object.defineProperty) && func,
|
1399
|
+
result = func(o, o, o) && func;
|
1400
|
+
} catch(e) { }
|
1401
|
+
return result;
|
1032
1402
|
}());
|
1033
1403
|
|
1034
|
-
|
1035
|
-
|
1404
|
+
/**
|
1405
|
+
* Sets `this` binding data on a given function.
|
1406
|
+
*
|
1407
|
+
* @private
|
1408
|
+
* @param {Function} func The function to set data on.
|
1409
|
+
* @param {Array} value The data array to set.
|
1410
|
+
*/
|
1411
|
+
var setBindData$3 = !defineProperty ? noop : function(func, value) {
|
1412
|
+
descriptor.value = value;
|
1413
|
+
defineProperty(func, '__bindData__', descriptor);
|
1414
|
+
};
|
1415
|
+
|
1416
|
+
var lodash__setbinddata = setBindData$3;
|
1417
|
+
|
1418
|
+
/**
|
1419
|
+
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
1420
|
+
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
1421
|
+
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
1422
|
+
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
1423
|
+
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
1424
|
+
* Available under MIT license <http://lodash.com/license>
|
1425
|
+
*/
|
1426
|
+
|
1427
|
+
var baseCreate$1 = lodash__basecreate,
|
1428
|
+
isObject$1 = lodash_isobject,
|
1429
|
+
setBindData$2 = lodash__setbinddata;
|
1430
|
+
|
1431
|
+
/**
|
1432
|
+
* Used for `Array` method references.
|
1433
|
+
*
|
1434
|
+
* Normally `Array.prototype` would suffice, however, using an array literal
|
1435
|
+
* avoids issues in Narwhal.
|
1436
|
+
*/
|
1437
|
+
var arrayRef$2 = [];
|
1438
|
+
|
1439
|
+
/** Native method shortcuts */
|
1440
|
+
var push$2 = arrayRef$2.push;
|
1441
|
+
|
1442
|
+
/**
|
1443
|
+
* The base implementation of `_.bind` that creates the bound function and
|
1444
|
+
* sets its meta data.
|
1445
|
+
*
|
1446
|
+
* @private
|
1447
|
+
* @param {Array} bindData The bind data array.
|
1448
|
+
* @returns {Function} Returns the new bound function.
|
1449
|
+
*/
|
1450
|
+
function baseBind$1(bindData) {
|
1451
|
+
var func = bindData[0],
|
1452
|
+
partialArgs = bindData[2],
|
1453
|
+
thisArg = bindData[4];
|
1454
|
+
|
1455
|
+
function bound() {
|
1456
|
+
// `Function#bind` spec
|
1457
|
+
// http://es5.github.io/#x15.3.4.5
|
1458
|
+
if (partialArgs) {
|
1459
|
+
var args = partialArgs.slice();
|
1460
|
+
push$2.apply(args, arguments);
|
1036
1461
|
}
|
1037
|
-
return
|
1038
|
-
|
1462
|
+
// mimic the constructor's `return` behavior
|
1463
|
+
// http://es5.github.io/#x13.2.2
|
1464
|
+
if (this instanceof bound) {
|
1465
|
+
// ensure `new bound` is an instance of `func`
|
1466
|
+
var thisBinding = baseCreate$1(func.prototype),
|
1467
|
+
result = func.apply(thisBinding, args || arguments);
|
1468
|
+
return isObject$1(result) ? result : thisBinding;
|
1469
|
+
}
|
1470
|
+
return func.apply(thisArg, args || arguments);
|
1471
|
+
}
|
1472
|
+
setBindData$2(bound, bindData);
|
1473
|
+
return bound;
|
1474
|
+
}
|
1039
1475
|
|
1040
|
-
var
|
1041
|
-
|
1476
|
+
var lodash__basebind = baseBind$1;
|
1477
|
+
|
1478
|
+
/**
|
1479
|
+
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
1480
|
+
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
1481
|
+
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
1482
|
+
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
1483
|
+
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
1484
|
+
* Available under MIT license <http://lodash.com/license>
|
1485
|
+
*/
|
1486
|
+
|
1487
|
+
/**
|
1488
|
+
* Slices the `collection` from the `start` index up to, but not including,
|
1489
|
+
* the `end` index.
|
1490
|
+
*
|
1491
|
+
* Note: This function is used instead of `Array#slice` to support node lists
|
1492
|
+
* in IE < 9 and to ensure dense arrays are returned.
|
1493
|
+
*
|
1494
|
+
* @private
|
1495
|
+
* @param {Array|Object|string} collection The collection to slice.
|
1496
|
+
* @param {number} start The start index.
|
1497
|
+
* @param {number} end The end index.
|
1498
|
+
* @returns {Array} Returns the new array.
|
1499
|
+
*/
|
1500
|
+
function slice$2(array, start, end) {
|
1501
|
+
start || (start = 0);
|
1502
|
+
if (typeof end == 'undefined') {
|
1503
|
+
end = array ? array.length : 0;
|
1504
|
+
}
|
1505
|
+
var index = -1,
|
1506
|
+
length = end - start || 0,
|
1507
|
+
result = Array(length < 0 ? 0 : length);
|
1508
|
+
|
1509
|
+
while (++index < length) {
|
1510
|
+
result[index] = array[start + index];
|
1511
|
+
}
|
1512
|
+
return result;
|
1513
|
+
}
|
1514
|
+
|
1515
|
+
var lodash__slice = slice$2;
|
1516
|
+
|
1517
|
+
/**
|
1518
|
+
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
1519
|
+
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
1520
|
+
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
1521
|
+
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
1522
|
+
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
1523
|
+
* Available under MIT license <http://lodash.com/license>
|
1524
|
+
*/
|
1525
|
+
|
1526
|
+
var baseCreate = lodash__basecreate,
|
1527
|
+
isObject = lodash_isobject,
|
1528
|
+
setBindData$1 = lodash__setbinddata,
|
1529
|
+
slice$1 = lodash__slice;
|
1530
|
+
|
1531
|
+
/**
|
1532
|
+
* Used for `Array` method references.
|
1533
|
+
*
|
1534
|
+
* Normally `Array.prototype` would suffice, however, using an array literal
|
1535
|
+
* avoids issues in Narwhal.
|
1536
|
+
*/
|
1537
|
+
var arrayRef$1 = [];
|
1538
|
+
|
1539
|
+
/** Native method shortcuts */
|
1540
|
+
var push$1 = arrayRef$1.push;
|
1541
|
+
|
1542
|
+
/**
|
1543
|
+
* The base implementation of `createWrapper` that creates the wrapper and
|
1544
|
+
* sets its meta data.
|
1545
|
+
*
|
1546
|
+
* @private
|
1547
|
+
* @param {Array} bindData The bind data array.
|
1548
|
+
* @returns {Function} Returns the new function.
|
1549
|
+
*/
|
1550
|
+
function baseCreateWrapper$1(bindData) {
|
1551
|
+
var func = bindData[0],
|
1552
|
+
bitmask = bindData[1],
|
1553
|
+
partialArgs = bindData[2],
|
1554
|
+
partialRightArgs = bindData[3],
|
1555
|
+
thisArg = bindData[4],
|
1556
|
+
arity = bindData[5];
|
1557
|
+
|
1558
|
+
var isBind = bitmask & 1,
|
1559
|
+
isBindKey = bitmask & 2,
|
1560
|
+
isCurry = bitmask & 4,
|
1561
|
+
isCurryBound = bitmask & 8,
|
1562
|
+
key = func;
|
1563
|
+
|
1564
|
+
function bound() {
|
1565
|
+
var thisBinding = isBind ? thisArg : this;
|
1566
|
+
if (partialArgs) {
|
1567
|
+
var args = partialArgs.slice();
|
1568
|
+
push$1.apply(args, arguments);
|
1042
1569
|
}
|
1043
|
-
|
1044
|
-
|
1570
|
+
if (partialRightArgs || isCurry) {
|
1571
|
+
args || (args = slice$1(arguments));
|
1572
|
+
if (partialRightArgs) {
|
1573
|
+
push$1.apply(args, partialRightArgs);
|
1574
|
+
}
|
1575
|
+
if (isCurry && args.length < arity) {
|
1576
|
+
bitmask |= 16 & ~32;
|
1577
|
+
return baseCreateWrapper$1([func, (isCurryBound ? bitmask : bitmask & ~3), args, null, thisArg, arity]);
|
1578
|
+
}
|
1579
|
+
}
|
1580
|
+
args || (args = arguments);
|
1581
|
+
if (isBindKey) {
|
1582
|
+
func = thisBinding[key];
|
1583
|
+
}
|
1584
|
+
if (this instanceof bound) {
|
1585
|
+
thisBinding = baseCreate(func.prototype);
|
1586
|
+
var result = func.apply(thisBinding, args);
|
1587
|
+
return isObject(result) ? result : thisBinding;
|
1588
|
+
}
|
1589
|
+
return func.apply(thisBinding, args);
|
1590
|
+
}
|
1591
|
+
setBindData$1(bound, bindData);
|
1592
|
+
return bound;
|
1593
|
+
}
|
1045
1594
|
|
1046
|
-
var
|
1047
|
-
|
1595
|
+
var lodash__basecreatewrapper = baseCreateWrapper$1;
|
1596
|
+
|
1597
|
+
/**
|
1598
|
+
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
1599
|
+
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
1600
|
+
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
1601
|
+
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
1602
|
+
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
1603
|
+
* Available under MIT license <http://lodash.com/license>
|
1604
|
+
*/
|
1605
|
+
|
1606
|
+
/**
|
1607
|
+
* Checks if `value` is a function.
|
1608
|
+
*
|
1609
|
+
* @static
|
1610
|
+
* @memberOf _
|
1611
|
+
* @category Objects
|
1612
|
+
* @param {*} value The value to check.
|
1613
|
+
* @returns {boolean} Returns `true` if the `value` is a function, else `false`.
|
1614
|
+
* @example
|
1615
|
+
*
|
1616
|
+
* _.isFunction(_);
|
1617
|
+
* // => true
|
1618
|
+
*/
|
1619
|
+
function isFunction$1(value) {
|
1620
|
+
return typeof value == 'function';
|
1621
|
+
}
|
1622
|
+
|
1623
|
+
var lodash_isfunction = isFunction$1;
|
1624
|
+
|
1625
|
+
/**
|
1626
|
+
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
1627
|
+
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
1628
|
+
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
1629
|
+
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
1630
|
+
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
1631
|
+
* Available under MIT license <http://lodash.com/license>
|
1632
|
+
*/
|
1633
|
+
|
1634
|
+
var baseBind = lodash__basebind,
|
1635
|
+
baseCreateWrapper = lodash__basecreatewrapper,
|
1636
|
+
isFunction = lodash_isfunction;
|
1637
|
+
|
1638
|
+
/**
|
1639
|
+
* Used for `Array` method references.
|
1640
|
+
*
|
1641
|
+
* Normally `Array.prototype` would suffice, however, using an array literal
|
1642
|
+
* avoids issues in Narwhal.
|
1643
|
+
*/
|
1644
|
+
var arrayRef = [];
|
1645
|
+
|
1646
|
+
/** Native method shortcuts */
|
1647
|
+
var push = arrayRef.push;
|
1648
|
+
|
1649
|
+
/**
|
1650
|
+
* Creates a function that, when called, either curries or invokes `func`
|
1651
|
+
* with an optional `this` binding and partially applied arguments.
|
1652
|
+
*
|
1653
|
+
* @private
|
1654
|
+
* @param {Function|string} func The function or method name to reference.
|
1655
|
+
* @param {number} bitmask The bitmask of method flags to compose.
|
1656
|
+
* The bitmask may be composed of the following flags:
|
1657
|
+
* 1 - `_.bind`
|
1658
|
+
* 2 - `_.bindKey`
|
1659
|
+
* 4 - `_.curry`
|
1660
|
+
* 8 - `_.curry` (bound)
|
1661
|
+
* 16 - `_.partial`
|
1662
|
+
* 32 - `_.partialRight`
|
1663
|
+
* @param {Array} [partialArgs] An array of arguments to prepend to those
|
1664
|
+
* provided to the new function.
|
1665
|
+
* @param {Array} [partialRightArgs] An array of arguments to append to those
|
1666
|
+
* provided to the new function.
|
1667
|
+
* @param {*} [thisArg] The `this` binding of `func`.
|
1668
|
+
* @param {number} [arity] The arity of `func`.
|
1669
|
+
* @returns {Function} Returns the new function.
|
1670
|
+
*/
|
1671
|
+
function createWrapper$1(func, bitmask, partialArgs, partialRightArgs, thisArg, arity) {
|
1672
|
+
var isBind = bitmask & 1,
|
1673
|
+
isBindKey = bitmask & 2,
|
1674
|
+
isCurry = bitmask & 4,
|
1675
|
+
isPartial = bitmask & 16,
|
1676
|
+
isPartialRight = bitmask & 32;
|
1677
|
+
|
1678
|
+
if (!isBindKey && !isFunction(func)) {
|
1679
|
+
throw new TypeError;
|
1680
|
+
}
|
1681
|
+
if (isPartial && !partialArgs.length) {
|
1682
|
+
bitmask &= ~16;
|
1683
|
+
isPartial = partialArgs = false;
|
1684
|
+
}
|
1685
|
+
if (isPartialRight && !partialRightArgs.length) {
|
1686
|
+
bitmask &= ~32;
|
1687
|
+
isPartialRight = partialRightArgs = false;
|
1688
|
+
}
|
1689
|
+
var bindData = func && func.__bindData__;
|
1690
|
+
if (bindData && bindData !== true) {
|
1691
|
+
bindData = bindData.slice();
|
1692
|
+
|
1693
|
+
// set `thisBinding` is not previously bound
|
1694
|
+
if (isBind && !(bindData[1] & 1)) {
|
1695
|
+
bindData[4] = thisArg;
|
1048
1696
|
}
|
1049
|
-
|
1050
|
-
|
1697
|
+
// set if previously bound but not currently (subsequent curried functions)
|
1698
|
+
if (!isBind && bindData[1] & 1) {
|
1699
|
+
bitmask |= 8;
|
1700
|
+
}
|
1701
|
+
// set curried arity if not yet set
|
1702
|
+
if (isCurry && !(bindData[1] & 4)) {
|
1703
|
+
bindData[5] = arity;
|
1704
|
+
}
|
1705
|
+
// append partial left arguments
|
1706
|
+
if (isPartial) {
|
1707
|
+
push.apply(bindData[2] || (bindData[2] = []), partialArgs);
|
1708
|
+
}
|
1709
|
+
// append partial right arguments
|
1710
|
+
if (isPartialRight) {
|
1711
|
+
push.apply(bindData[3] || (bindData[3] = []), partialRightArgs);
|
1712
|
+
}
|
1713
|
+
// merge flags
|
1714
|
+
bindData[1] |= bitmask;
|
1715
|
+
return createWrapper$1.apply(null, bindData);
|
1716
|
+
}
|
1717
|
+
// fast path for `_.bind`
|
1718
|
+
var creater = (bitmask == 1 || bitmask === 17) ? baseBind : baseCreateWrapper;
|
1719
|
+
return creater([func, bitmask, partialArgs, partialRightArgs, thisArg, arity]);
|
1720
|
+
}
|
1051
1721
|
|
1052
|
-
var
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1722
|
+
var lodash__createwrapper = createWrapper$1;
|
1723
|
+
|
1724
|
+
/**
|
1725
|
+
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
1726
|
+
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
1727
|
+
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
1728
|
+
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
1729
|
+
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
1730
|
+
* Available under MIT license <http://lodash.com/license>
|
1731
|
+
*/
|
1732
|
+
|
1733
|
+
var createWrapper = lodash__createwrapper,
|
1734
|
+
slice = lodash__slice;
|
1735
|
+
|
1736
|
+
/**
|
1737
|
+
* Creates a function that, when called, invokes `func` with the `this`
|
1738
|
+
* binding of `thisArg` and prepends any additional `bind` arguments to those
|
1739
|
+
* provided to the bound function.
|
1740
|
+
*
|
1741
|
+
* @static
|
1742
|
+
* @memberOf _
|
1743
|
+
* @category Functions
|
1744
|
+
* @param {Function} func The function to bind.
|
1745
|
+
* @param {*} [thisArg] The `this` binding of `func`.
|
1746
|
+
* @param {...*} [arg] Arguments to be partially applied.
|
1747
|
+
* @returns {Function} Returns the new bound function.
|
1748
|
+
* @example
|
1749
|
+
*
|
1750
|
+
* var func = function(greeting) {
|
1751
|
+
* return greeting + ' ' + this.name;
|
1752
|
+
* };
|
1753
|
+
*
|
1754
|
+
* func = _.bind(func, { 'name': 'fred' }, 'hi');
|
1755
|
+
* func();
|
1756
|
+
* // => 'hi fred'
|
1757
|
+
*/
|
1758
|
+
function bind$1(func, thisArg) {
|
1759
|
+
return arguments.length > 2
|
1760
|
+
? createWrapper(func, 17, slice(arguments, 2), null, thisArg)
|
1761
|
+
: createWrapper(func, 1, null, null, thisArg);
|
1762
|
+
}
|
1763
|
+
|
1764
|
+
var lodash_bind = bind$1;
|
1765
|
+
|
1766
|
+
/**
|
1767
|
+
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
1768
|
+
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
1769
|
+
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
1770
|
+
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
1771
|
+
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
1772
|
+
* Available under MIT license <http://lodash.com/license>
|
1773
|
+
*/
|
1774
|
+
|
1775
|
+
/**
|
1776
|
+
* This method returns the first argument provided to it.
|
1777
|
+
*
|
1778
|
+
* @static
|
1779
|
+
* @memberOf _
|
1780
|
+
* @category Utilities
|
1781
|
+
* @param {*} value Any value.
|
1782
|
+
* @returns {*} Returns `value`.
|
1783
|
+
* @example
|
1784
|
+
*
|
1785
|
+
* var object = { 'name': 'fred' };
|
1786
|
+
* _.identity(object) === object;
|
1787
|
+
* // => true
|
1788
|
+
*/
|
1789
|
+
function identity$1(value) {
|
1790
|
+
return value;
|
1791
|
+
}
|
1792
|
+
|
1793
|
+
var lodash_identity = identity$1;
|
1794
|
+
|
1795
|
+
/**
|
1796
|
+
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
1797
|
+
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
1798
|
+
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
1799
|
+
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
1800
|
+
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
1801
|
+
* Available under MIT license <http://lodash.com/license>
|
1802
|
+
*/
|
1803
|
+
|
1804
|
+
var reNative = lodash__renative;
|
1805
|
+
|
1806
|
+
/** Used to detect functions containing a `this` reference */
|
1807
|
+
var reThis$1 = /\bthis\b/;
|
1808
|
+
|
1809
|
+
/**
|
1810
|
+
* An object used to flag environments features.
|
1811
|
+
*
|
1812
|
+
* @static
|
1813
|
+
* @memberOf _
|
1814
|
+
* @type Object
|
1815
|
+
*/
|
1816
|
+
var support$1 = {};
|
1817
|
+
|
1818
|
+
/**
|
1819
|
+
* Detect if functions can be decompiled by `Function#toString`
|
1820
|
+
* (all but PS3 and older Opera mobile browsers & avoided in Windows 8 apps).
|
1821
|
+
*
|
1822
|
+
* @memberOf _.support
|
1823
|
+
* @type boolean
|
1824
|
+
*/
|
1825
|
+
support$1.funcDecomp = !reNative.test(commonjsGlobal.WinRTError) && reThis$1.test(function() { return this; });
|
1826
|
+
|
1827
|
+
/**
|
1828
|
+
* Detect if `Function#name` is supported (all but IE).
|
1829
|
+
*
|
1830
|
+
* @memberOf _.support
|
1831
|
+
* @type boolean
|
1832
|
+
*/
|
1833
|
+
support$1.funcNames = typeof Function.name == 'string';
|
1834
|
+
|
1835
|
+
var lodash_support = support$1;
|
1836
|
+
|
1837
|
+
/**
|
1838
|
+
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
1839
|
+
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
1840
|
+
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
1841
|
+
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
1842
|
+
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
1843
|
+
* Available under MIT license <http://lodash.com/license>
|
1844
|
+
*/
|
1845
|
+
|
1846
|
+
var bind = lodash_bind,
|
1847
|
+
identity = lodash_identity,
|
1848
|
+
setBindData = lodash__setbinddata,
|
1849
|
+
support = lodash_support;
|
1850
|
+
|
1851
|
+
/** Used to detected named functions */
|
1852
|
+
var reFuncName = /^\s*function[ \n\r\t]+\w/;
|
1853
|
+
|
1854
|
+
/** Used to detect functions containing a `this` reference */
|
1855
|
+
var reThis = /\bthis\b/;
|
1856
|
+
|
1857
|
+
/** Native method shortcuts */
|
1858
|
+
var fnToString = Function.prototype.toString;
|
1859
|
+
|
1860
|
+
/**
|
1861
|
+
* The base implementation of `_.createCallback` without support for creating
|
1862
|
+
* "_.pluck" or "_.where" style callbacks.
|
1863
|
+
*
|
1864
|
+
* @private
|
1865
|
+
* @param {*} [func=identity] The value to convert to a callback.
|
1866
|
+
* @param {*} [thisArg] The `this` binding of the created callback.
|
1867
|
+
* @param {number} [argCount] The number of arguments the callback accepts.
|
1868
|
+
* @returns {Function} Returns a callback function.
|
1869
|
+
*/
|
1870
|
+
function baseCreateCallback$2(func, thisArg, argCount) {
|
1871
|
+
if (typeof func != 'function') {
|
1872
|
+
return identity;
|
1873
|
+
}
|
1874
|
+
// exit early for no `thisArg` or already bound by `Function#bind`
|
1875
|
+
if (typeof thisArg == 'undefined' || !('prototype' in func)) {
|
1876
|
+
return func;
|
1877
|
+
}
|
1878
|
+
var bindData = func.__bindData__;
|
1879
|
+
if (typeof bindData == 'undefined') {
|
1880
|
+
if (support.funcNames) {
|
1881
|
+
bindData = !func.name;
|
1882
|
+
}
|
1883
|
+
bindData = bindData || !support.funcDecomp;
|
1884
|
+
if (!bindData) {
|
1885
|
+
var source = fnToString.call(func);
|
1886
|
+
if (!support.funcNames) {
|
1887
|
+
bindData = !reFuncName.test(source);
|
1888
|
+
}
|
1889
|
+
if (!bindData) {
|
1890
|
+
// checks if `func` references the `this` keyword and stores the result
|
1891
|
+
bindData = reThis.test(source);
|
1892
|
+
setBindData(func, bindData);
|
1893
|
+
}
|
1894
|
+
}
|
1895
|
+
}
|
1896
|
+
// exit early if there are no `this` references or `func` is bound
|
1897
|
+
if (bindData === false || (bindData !== true && bindData[1] & 1)) {
|
1898
|
+
return func;
|
1899
|
+
}
|
1900
|
+
switch (argCount) {
|
1901
|
+
case 1: return function(value) {
|
1902
|
+
return func.call(thisArg, value);
|
1903
|
+
};
|
1904
|
+
case 2: return function(a, b) {
|
1905
|
+
return func.call(thisArg, a, b);
|
1906
|
+
};
|
1907
|
+
case 3: return function(value, index, collection) {
|
1908
|
+
return func.call(thisArg, value, index, collection);
|
1909
|
+
};
|
1910
|
+
case 4: return function(accumulator, value, index, collection) {
|
1911
|
+
return func.call(thisArg, accumulator, value, index, collection);
|
1912
|
+
};
|
1913
|
+
}
|
1914
|
+
return bind(func, thisArg);
|
1915
|
+
}
|
1916
|
+
|
1917
|
+
var lodash__basecreatecallback = baseCreateCallback$2;
|
1918
|
+
|
1919
|
+
/**
|
1920
|
+
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
1921
|
+
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
1922
|
+
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
1923
|
+
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
1924
|
+
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
1925
|
+
* Available under MIT license <http://lodash.com/license>
|
1926
|
+
*/
|
1927
|
+
|
1928
|
+
var baseCreateCallback$1 = lodash__basecreatecallback,
|
1929
|
+
keys$1 = lodash_keys,
|
1930
|
+
objectTypes = lodash__objecttypes;
|
1931
|
+
|
1932
|
+
/**
|
1933
|
+
* Iterates over own enumerable properties of an object, executing the callback
|
1934
|
+
* for each property. The callback is bound to `thisArg` and invoked with three
|
1935
|
+
* arguments; (value, key, object). Callbacks may exit iteration early by
|
1936
|
+
* explicitly returning `false`.
|
1937
|
+
*
|
1938
|
+
* @static
|
1939
|
+
* @memberOf _
|
1940
|
+
* @type Function
|
1941
|
+
* @category Objects
|
1942
|
+
* @param {Object} object The object to iterate over.
|
1943
|
+
* @param {Function} [callback=identity] The function called per iteration.
|
1944
|
+
* @param {*} [thisArg] The `this` binding of `callback`.
|
1945
|
+
* @returns {Object} Returns `object`.
|
1946
|
+
* @example
|
1947
|
+
*
|
1948
|
+
* _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) {
|
1949
|
+
* console.log(key);
|
1950
|
+
* });
|
1951
|
+
* // => logs '0', '1', and 'length' (property order is not guaranteed across environments)
|
1952
|
+
*/
|
1953
|
+
var forOwn$1 = function(collection, callback, thisArg) {
|
1954
|
+
var index, iterable = collection, result = iterable;
|
1955
|
+
if (!iterable) return result;
|
1956
|
+
if (!objectTypes[typeof iterable]) return result;
|
1957
|
+
callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback$1(callback, thisArg, 3);
|
1958
|
+
var ownIndex = -1,
|
1959
|
+
ownProps = objectTypes[typeof iterable] && keys$1(iterable),
|
1960
|
+
length = ownProps ? ownProps.length : 0;
|
1961
|
+
|
1962
|
+
while (++ownIndex < length) {
|
1963
|
+
index = ownProps[ownIndex];
|
1964
|
+
if (callback(iterable[index], index, collection) === false) return result;
|
1965
|
+
}
|
1966
|
+
return result
|
1967
|
+
};
|
1968
|
+
|
1969
|
+
var lodash_forown = forOwn$1;
|
1970
|
+
|
1971
|
+
/**
|
1972
|
+
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
1973
|
+
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
1974
|
+
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
1975
|
+
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
1976
|
+
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
1977
|
+
* Available under MIT license <http://lodash.com/license>
|
1978
|
+
*/
|
1979
|
+
|
1980
|
+
var baseCreateCallback = lodash__basecreatecallback,
|
1981
|
+
forOwn = lodash_forown;
|
1982
|
+
|
1983
|
+
/**
|
1984
|
+
* Iterates over elements of a collection, executing the callback for each
|
1985
|
+
* element. The callback is bound to `thisArg` and invoked with three arguments;
|
1986
|
+
* (value, index|key, collection). Callbacks may exit iteration early by
|
1987
|
+
* explicitly returning `false`.
|
1988
|
+
*
|
1989
|
+
* Note: As with other "Collections" methods, objects with a `length` property
|
1990
|
+
* are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`
|
1991
|
+
* may be used for object iteration.
|
1992
|
+
*
|
1993
|
+
* @static
|
1994
|
+
* @memberOf _
|
1995
|
+
* @alias each
|
1996
|
+
* @category Collections
|
1997
|
+
* @param {Array|Object|string} collection The collection to iterate over.
|
1998
|
+
* @param {Function} [callback=identity] The function called per iteration.
|
1999
|
+
* @param {*} [thisArg] The `this` binding of `callback`.
|
2000
|
+
* @returns {Array|Object|string} Returns `collection`.
|
2001
|
+
* @example
|
2002
|
+
*
|
2003
|
+
* _([1, 2, 3]).forEach(function(num) { console.log(num); }).join(',');
|
2004
|
+
* // => logs each number and returns '1,2,3'
|
2005
|
+
*
|
2006
|
+
* _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); });
|
2007
|
+
* // => logs each number and returns the object (property order is not guaranteed across environments)
|
2008
|
+
*/
|
2009
|
+
function forEach(collection, callback, thisArg) {
|
2010
|
+
var index = -1,
|
2011
|
+
length = collection ? collection.length : 0;
|
2012
|
+
|
2013
|
+
callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3);
|
2014
|
+
if (typeof length == 'number') {
|
2015
|
+
while (++index < length) {
|
2016
|
+
if (callback(collection[index], index, collection) === false) {
|
2017
|
+
break;
|
2018
|
+
}
|
2019
|
+
}
|
2020
|
+
} else {
|
2021
|
+
forOwn(collection, callback);
|
2022
|
+
}
|
2023
|
+
return collection;
|
2024
|
+
}
|
2025
|
+
|
2026
|
+
var lodash_foreach = forEach;
|
2027
|
+
|
2028
|
+
var metric$b,
|
2029
|
+
imperial$9;
|
2030
|
+
|
2031
|
+
metric$b = {
|
2032
|
+
mm: {
|
2033
|
+
name: {
|
2034
|
+
singular: 'Millimeter',
|
2035
|
+
plural: 'Millimeters'
|
2036
|
+
},
|
2037
|
+
to_anchor: 1/1000
|
2038
|
+
},
|
2039
|
+
cm: {
|
2040
|
+
name: {
|
2041
|
+
singular: 'Centimeter',
|
2042
|
+
plural: 'Centimeters'
|
2043
|
+
},
|
2044
|
+
to_anchor: 1/100
|
2045
|
+
},
|
2046
|
+
m: {
|
2047
|
+
name: {
|
2048
|
+
singular: 'Meter',
|
2049
|
+
plural: 'Meters'
|
2050
|
+
},
|
2051
|
+
to_anchor: 1
|
2052
|
+
},
|
2053
|
+
km: {
|
2054
|
+
name: {
|
2055
|
+
singular: 'Kilometer',
|
2056
|
+
plural: 'Kilometers'
|
2057
|
+
},
|
2058
|
+
to_anchor: 1000
|
2059
|
+
}
|
2060
|
+
};
|
2061
|
+
|
2062
|
+
imperial$9 = {
|
2063
|
+
'in': {
|
2064
|
+
name: {
|
2065
|
+
singular: 'Inch',
|
2066
|
+
plural: 'Inches'
|
2067
|
+
},
|
2068
|
+
to_anchor: 1/12
|
2069
|
+
},
|
2070
|
+
yd: {
|
2071
|
+
name: {
|
2072
|
+
singular: 'Yard',
|
2073
|
+
plural: 'Yards'
|
2074
|
+
},
|
2075
|
+
to_anchor: 3
|
2076
|
+
},
|
2077
|
+
'ft-us': {
|
2078
|
+
name: {
|
2079
|
+
singular: 'US Survey Foot',
|
2080
|
+
plural: 'US Survey Feet'
|
2081
|
+
},
|
2082
|
+
to_anchor: 1.000002
|
2083
|
+
},
|
2084
|
+
ft: {
|
2085
|
+
name: {
|
2086
|
+
singular: 'Foot',
|
2087
|
+
plural: 'Feet'
|
2088
|
+
},
|
2089
|
+
to_anchor: 1
|
2090
|
+
},
|
2091
|
+
mi: {
|
2092
|
+
name: {
|
2093
|
+
singular: 'Mile',
|
2094
|
+
plural: 'Miles'
|
2095
|
+
},
|
2096
|
+
to_anchor: 5280
|
2097
|
+
}
|
2098
|
+
};
|
2099
|
+
|
2100
|
+
var length = {
|
2101
|
+
metric: metric$b,
|
2102
|
+
imperial: imperial$9,
|
2103
|
+
_anchors: {
|
2104
|
+
metric: {
|
2105
|
+
unit: 'm',
|
2106
|
+
ratio: 3.28084
|
2107
|
+
},
|
2108
|
+
imperial: {
|
2109
|
+
unit: 'ft',
|
2110
|
+
ratio: 1/3.28084
|
2111
|
+
}
|
2112
|
+
}
|
2113
|
+
};
|
2114
|
+
|
2115
|
+
var metric$a
|
2116
|
+
, imperial$8;
|
2117
|
+
|
2118
|
+
metric$a = {
|
2119
|
+
mm2: {
|
2120
|
+
name: {
|
2121
|
+
singular: 'Square Millimeter'
|
2122
|
+
, plural: 'Square Millimeters'
|
2123
|
+
}
|
2124
|
+
, to_anchor: 1/1000000
|
2125
|
+
}
|
2126
|
+
, cm2: {
|
2127
|
+
name: {
|
2128
|
+
singular: 'Centimeter'
|
2129
|
+
, plural: 'Centimeters'
|
2130
|
+
}
|
2131
|
+
, to_anchor: 1/10000
|
2132
|
+
}
|
2133
|
+
, m2: {
|
2134
|
+
name: {
|
2135
|
+
singular: 'Square Meter'
|
2136
|
+
, plural: 'Square Meters'
|
2137
|
+
}
|
2138
|
+
, to_anchor: 1
|
2139
|
+
}
|
2140
|
+
, ha: {
|
2141
|
+
name: {
|
2142
|
+
singular: 'Hectare'
|
2143
|
+
, plural: 'Hectares'
|
2144
|
+
}
|
2145
|
+
, to_anchor: 10000
|
2146
|
+
}
|
2147
|
+
, km2: {
|
2148
|
+
name: {
|
2149
|
+
singular: 'Square Kilometer'
|
2150
|
+
, plural: 'Square Kilometers'
|
2151
|
+
}
|
2152
|
+
, to_anchor: 1000000
|
2153
|
+
}
|
2154
|
+
};
|
2155
|
+
|
2156
|
+
imperial$8 = {
|
2157
|
+
'in2': {
|
2158
|
+
name: {
|
2159
|
+
singular: 'Square Inch'
|
2160
|
+
, plural: 'Square Inches'
|
2161
|
+
}
|
2162
|
+
, to_anchor: 1/144
|
2163
|
+
}
|
2164
|
+
, yd2: {
|
2165
|
+
name: {
|
2166
|
+
singular: 'Square Yard'
|
2167
|
+
, plural: 'Square Yards'
|
2168
|
+
}
|
2169
|
+
, to_anchor: 9
|
2170
|
+
}
|
2171
|
+
, ft2: {
|
2172
|
+
name: {
|
2173
|
+
singular: 'Square Foot'
|
2174
|
+
, plural: 'Square Feet'
|
2175
|
+
}
|
2176
|
+
, to_anchor: 1
|
2177
|
+
}
|
2178
|
+
, ac: {
|
2179
|
+
name: {
|
2180
|
+
singular: 'Acre'
|
2181
|
+
, plural: 'Acres'
|
2182
|
+
}
|
2183
|
+
, to_anchor: 43560
|
2184
|
+
}
|
2185
|
+
, mi2: {
|
2186
|
+
name: {
|
2187
|
+
singular: 'Square Mile'
|
2188
|
+
, plural: 'Square Miles'
|
2189
|
+
}
|
2190
|
+
, to_anchor: 27878400
|
2191
|
+
}
|
2192
|
+
};
|
2193
|
+
|
2194
|
+
var area = {
|
2195
|
+
metric: metric$a
|
2196
|
+
, imperial: imperial$8
|
2197
|
+
, _anchors: {
|
2198
|
+
metric: {
|
2199
|
+
unit: 'm2'
|
2200
|
+
, ratio: 10.7639
|
2201
|
+
}
|
2202
|
+
, imperial: {
|
2203
|
+
unit: 'ft2'
|
2204
|
+
, ratio: 1/10.7639
|
2205
|
+
}
|
2206
|
+
}
|
2207
|
+
};
|
2208
|
+
|
2209
|
+
var metric$9
|
2210
|
+
, imperial$7;
|
2211
|
+
|
2212
|
+
metric$9 = {
|
2213
|
+
mcg: {
|
2214
|
+
name: {
|
2215
|
+
singular: 'Microgram'
|
2216
|
+
, plural: 'Micrograms'
|
2217
|
+
}
|
2218
|
+
, to_anchor: 1/1000000
|
2219
|
+
}
|
2220
|
+
, mg: {
|
2221
|
+
name: {
|
2222
|
+
singular: 'Milligram'
|
2223
|
+
, plural: 'Milligrams'
|
2224
|
+
}
|
2225
|
+
, to_anchor: 1/1000
|
2226
|
+
}
|
2227
|
+
, g: {
|
2228
|
+
name: {
|
2229
|
+
singular: 'Gram'
|
2230
|
+
, plural: 'Grams'
|
2231
|
+
}
|
2232
|
+
, to_anchor: 1
|
2233
|
+
}
|
2234
|
+
, kg: {
|
2235
|
+
name: {
|
2236
|
+
singular: 'Kilogram'
|
2237
|
+
, plural: 'Kilograms'
|
2238
|
+
}
|
2239
|
+
, to_anchor: 1000
|
2240
|
+
}
|
2241
|
+
, mt: {
|
2242
|
+
name: {
|
2243
|
+
singular: 'Metric Tonne'
|
2244
|
+
, plural: 'Metric Tonnes'
|
2245
|
+
}
|
2246
|
+
, to_anchor: 1000000
|
2247
|
+
}
|
2248
|
+
};
|
2249
|
+
|
2250
|
+
imperial$7 = {
|
2251
|
+
oz: {
|
2252
|
+
name: {
|
2253
|
+
singular: 'Ounce'
|
2254
|
+
, plural: 'Ounces'
|
2255
|
+
}
|
2256
|
+
, to_anchor: 1/16
|
2257
|
+
}
|
2258
|
+
, lb: {
|
2259
|
+
name: {
|
2260
|
+
singular: 'Pound'
|
2261
|
+
, plural: 'Pounds'
|
2262
|
+
}
|
2263
|
+
, to_anchor: 1
|
2264
|
+
}, t: {
|
2265
|
+
name: {
|
2266
|
+
singular: 'Ton',
|
2267
|
+
plural: 'Tons',
|
2268
|
+
},
|
2269
|
+
to_anchor: 2000,
|
2270
|
+
},
|
2271
|
+
};
|
2272
|
+
|
2273
|
+
var mass = {
|
2274
|
+
metric: metric$9
|
2275
|
+
, imperial: imperial$7
|
2276
|
+
, _anchors: {
|
2277
|
+
metric: {
|
2278
|
+
unit: 'g'
|
2279
|
+
, ratio: 1/453.592
|
2280
|
+
}
|
2281
|
+
, imperial: {
|
2282
|
+
unit: 'lb'
|
2283
|
+
, ratio: 453.592
|
2284
|
+
}
|
2285
|
+
}
|
2286
|
+
};
|
2287
|
+
|
2288
|
+
var metric$8
|
2289
|
+
, imperial$6;
|
2290
|
+
|
2291
|
+
metric$8 = {
|
2292
|
+
mm3: {
|
2293
|
+
name: {
|
2294
|
+
singular: 'Cubic Millimeter'
|
2295
|
+
, plural: 'Cubic Millimeters'
|
2296
|
+
}
|
2297
|
+
, to_anchor: 1/1000000
|
2298
|
+
}
|
2299
|
+
, cm3: {
|
2300
|
+
name: {
|
2301
|
+
singular: 'Cubic Centimeter'
|
2302
|
+
, plural: 'Cubic Centimeters'
|
2303
|
+
}
|
2304
|
+
, to_anchor: 1/1000
|
2305
|
+
}
|
2306
|
+
, ml: {
|
2307
|
+
name: {
|
2308
|
+
singular: 'Millilitre'
|
2309
|
+
, plural: 'Millilitres'
|
2310
|
+
}
|
2311
|
+
, to_anchor: 1/1000
|
2312
|
+
}
|
2313
|
+
, cl: {
|
2314
|
+
name: {
|
2315
|
+
singular: 'Centilitre'
|
2316
|
+
, plural: 'Centilitres'
|
2317
|
+
}
|
2318
|
+
, to_anchor: 1/100
|
2319
|
+
}
|
2320
|
+
, dl: {
|
2321
|
+
name: {
|
2322
|
+
singular: 'Decilitre'
|
2323
|
+
, plural: 'Decilitres'
|
2324
|
+
}
|
2325
|
+
, to_anchor: 1/10
|
2326
|
+
}
|
2327
|
+
, l: {
|
2328
|
+
name: {
|
2329
|
+
singular: 'Litre'
|
2330
|
+
, plural: 'Litres'
|
2331
|
+
}
|
2332
|
+
, to_anchor: 1
|
2333
|
+
}
|
2334
|
+
, kl: {
|
2335
|
+
name: {
|
2336
|
+
singular: 'Kilolitre'
|
2337
|
+
, plural: 'Kilolitres'
|
2338
|
+
}
|
2339
|
+
, to_anchor: 1000
|
2340
|
+
}
|
2341
|
+
, m3: {
|
2342
|
+
name: {
|
2343
|
+
singular: 'Cubic meter'
|
2344
|
+
, plural: 'Cubic meters'
|
2345
|
+
}
|
2346
|
+
, to_anchor: 1000
|
2347
|
+
}
|
2348
|
+
, km3: {
|
2349
|
+
name: {
|
2350
|
+
singular: 'Cubic kilometer'
|
2351
|
+
, plural: 'Cubic kilometers'
|
2352
|
+
}
|
2353
|
+
, to_anchor: 1000000000000
|
2354
|
+
}
|
2355
|
+
|
2356
|
+
// Swedish units
|
2357
|
+
, krm: {
|
2358
|
+
name: {
|
2359
|
+
singular: 'Matsked'
|
2360
|
+
, plural: 'Matskedar'
|
2361
|
+
}
|
2362
|
+
, to_anchor: 1/1000
|
2363
|
+
}
|
2364
|
+
, tsk: {
|
2365
|
+
name: {
|
2366
|
+
singular: 'Tesked'
|
2367
|
+
, plural: 'Teskedar'
|
2368
|
+
}
|
2369
|
+
, to_anchor: 5/1000
|
2370
|
+
}
|
2371
|
+
, msk: {
|
2372
|
+
name: {
|
2373
|
+
singular: 'Matsked'
|
2374
|
+
, plural: 'Matskedar'
|
2375
|
+
}
|
2376
|
+
, to_anchor: 15/1000
|
2377
|
+
}
|
2378
|
+
, kkp: {
|
2379
|
+
name: {
|
2380
|
+
singular: 'Kaffekopp'
|
2381
|
+
, plural: 'Kaffekoppar'
|
2382
|
+
}
|
2383
|
+
, to_anchor: 150/1000
|
2384
|
+
}
|
2385
|
+
, glas: {
|
2386
|
+
name: {
|
2387
|
+
singular: 'Glas'
|
2388
|
+
, plural: 'Glas'
|
2389
|
+
}
|
2390
|
+
, to_anchor: 200/1000
|
2391
|
+
}
|
2392
|
+
, kanna: {
|
2393
|
+
name: {
|
2394
|
+
singular: 'Kanna'
|
2395
|
+
, plural: 'Kannor'
|
2396
|
+
}
|
2397
|
+
, to_anchor: 2.617
|
2398
|
+
}
|
2399
|
+
};
|
2400
|
+
|
2401
|
+
imperial$6 = {
|
2402
|
+
tsp: {
|
2403
|
+
name: {
|
2404
|
+
singular: 'Teaspoon'
|
2405
|
+
, plural: 'Teaspoons'
|
2406
|
+
}
|
2407
|
+
, to_anchor: 1/6
|
2408
|
+
}
|
2409
|
+
, Tbs: {
|
2410
|
+
name: {
|
2411
|
+
singular: 'Tablespoon'
|
2412
|
+
, plural: 'Tablespoons'
|
2413
|
+
}
|
2414
|
+
, to_anchor: 1/2
|
2415
|
+
}
|
2416
|
+
, in3: {
|
2417
|
+
name: {
|
2418
|
+
singular: 'Cubic inch'
|
2419
|
+
, plural: 'Cubic inches'
|
2420
|
+
}
|
2421
|
+
, to_anchor: 0.55411
|
2422
|
+
}
|
2423
|
+
, 'fl-oz': {
|
2424
|
+
name: {
|
2425
|
+
singular: 'Fluid Ounce'
|
2426
|
+
, plural: 'Fluid Ounces'
|
2427
|
+
}
|
2428
|
+
, to_anchor: 1
|
2429
|
+
}
|
2430
|
+
, cup: {
|
2431
|
+
name: {
|
2432
|
+
singular: 'Cup'
|
2433
|
+
, plural: 'Cups'
|
2434
|
+
}
|
2435
|
+
, to_anchor: 8
|
2436
|
+
}
|
2437
|
+
, pnt: {
|
2438
|
+
name: {
|
2439
|
+
singular: 'Pint'
|
2440
|
+
, plural: 'Pints'
|
2441
|
+
}
|
2442
|
+
, to_anchor: 16
|
2443
|
+
}
|
2444
|
+
, qt: {
|
2445
|
+
name: {
|
2446
|
+
singular: 'Quart'
|
2447
|
+
, plural: 'Quarts'
|
2448
|
+
}
|
2449
|
+
, to_anchor: 32
|
2450
|
+
}
|
2451
|
+
, gal: {
|
2452
|
+
name: {
|
2453
|
+
singular: 'Gallon'
|
2454
|
+
, plural: 'Gallons'
|
2455
|
+
}
|
2456
|
+
, to_anchor: 128
|
2457
|
+
}
|
2458
|
+
, ft3: {
|
2459
|
+
name: {
|
2460
|
+
singular: 'Cubic foot'
|
2461
|
+
, plural: 'Cubic feet'
|
2462
|
+
}
|
2463
|
+
, to_anchor: 957.506
|
2464
|
+
}
|
2465
|
+
, yd3: {
|
2466
|
+
name: {
|
2467
|
+
singular: 'Cubic yard'
|
2468
|
+
, plural: 'Cubic yards'
|
2469
|
+
}
|
2470
|
+
, to_anchor: 25852.7
|
2471
|
+
}
|
2472
|
+
};
|
2473
|
+
|
2474
|
+
var volume = {
|
2475
|
+
metric: metric$8
|
2476
|
+
, imperial: imperial$6
|
2477
|
+
, _anchors: {
|
2478
|
+
metric: {
|
2479
|
+
unit: 'l'
|
2480
|
+
, ratio: 33.8140226
|
2481
|
+
}
|
2482
|
+
, imperial: {
|
2483
|
+
unit: 'fl-oz'
|
2484
|
+
, ratio: 1/33.8140226
|
2485
|
+
}
|
2486
|
+
}
|
2487
|
+
};
|
2488
|
+
|
2489
|
+
var metric$7
|
2490
|
+
;
|
2491
|
+
|
2492
|
+
metric$7 = {
|
2493
|
+
ea: {
|
2494
|
+
name: {
|
2495
|
+
singular: 'Each'
|
2496
|
+
, plural: 'Each'
|
2497
|
+
}
|
2498
|
+
, to_anchor: 1
|
2499
|
+
},
|
2500
|
+
dz: {
|
2501
|
+
name: {
|
2502
|
+
singular: 'Dozen'
|
2503
|
+
, plural: 'Dozens'
|
2504
|
+
}
|
2505
|
+
, to_anchor: 12
|
2506
|
+
}
|
2507
|
+
};
|
2508
|
+
|
2509
|
+
var each$1 = {
|
2510
|
+
metric: metric$7
|
2511
|
+
, imperial: {}
|
2512
|
+
, _anchors: {
|
2513
|
+
metric: {
|
2514
|
+
unit: 'ea'
|
2515
|
+
, ratio: 1
|
2516
|
+
}
|
2517
|
+
}
|
2518
|
+
};
|
2519
|
+
|
2520
|
+
var metric$6
|
2521
|
+
, imperial$5;
|
2522
|
+
|
2523
|
+
metric$6 = {
|
2524
|
+
C: {
|
2525
|
+
name: {
|
2526
|
+
singular: 'degree Celsius'
|
2527
|
+
, plural: 'degrees Celsius'
|
2528
|
+
}
|
2529
|
+
, to_anchor: 1
|
2530
|
+
, anchor_shift: 0
|
2531
|
+
},
|
2532
|
+
K: {
|
2533
|
+
name: {
|
2534
|
+
singular: 'degree Kelvin'
|
2535
|
+
, plural: 'degrees Kelvin'
|
2536
|
+
}
|
2537
|
+
, to_anchor: 1
|
2538
|
+
, anchor_shift: 273.15
|
2539
|
+
}
|
2540
|
+
};
|
2541
|
+
|
2542
|
+
imperial$5 = {
|
2543
|
+
F: {
|
2544
|
+
name: {
|
2545
|
+
singular: 'degree Fahrenheit'
|
2546
|
+
, plural: 'degrees Fahrenheit'
|
2547
|
+
}
|
2548
|
+
, to_anchor: 1
|
2549
|
+
},
|
2550
|
+
R: {
|
2551
|
+
name: {
|
2552
|
+
singular: 'degree Rankine'
|
2553
|
+
, plural: 'degrees Rankine'
|
2554
|
+
}
|
2555
|
+
, to_anchor: 1
|
2556
|
+
, anchor_shift: 459.67
|
2557
|
+
}
|
2558
|
+
};
|
2559
|
+
|
2560
|
+
var temperature = {
|
2561
|
+
metric: metric$6
|
2562
|
+
, imperial: imperial$5
|
2563
|
+
, _anchors: {
|
2564
|
+
metric: {
|
2565
|
+
unit: 'C'
|
2566
|
+
, transform: function (C) { return C / (5/9) + 32 }
|
2567
|
+
}
|
2568
|
+
, imperial: {
|
2569
|
+
unit: 'F'
|
2570
|
+
, transform: function (F) { return (F - 32) * (5/9) }
|
2571
|
+
}
|
2572
|
+
}
|
2573
|
+
};
|
2574
|
+
|
2575
|
+
var time;
|
2576
|
+
var daysInYear = 365.25;
|
2577
|
+
|
2578
|
+
time = {
|
2579
|
+
ns: {
|
2580
|
+
name: {
|
2581
|
+
singular: 'Nanosecond'
|
2582
|
+
, plural: 'Nanoseconds'
|
2583
|
+
}
|
2584
|
+
, to_anchor: 1/1000000000
|
2585
|
+
}
|
2586
|
+
, mu: {
|
2587
|
+
name: {
|
2588
|
+
singular: 'Microsecond'
|
2589
|
+
, plural: 'Microseconds'
|
2590
|
+
}
|
2591
|
+
, to_anchor: 1/1000000
|
2592
|
+
}
|
2593
|
+
, ms: {
|
2594
|
+
name: {
|
2595
|
+
singular: 'Millisecond'
|
2596
|
+
, plural: 'Milliseconds'
|
2597
|
+
}
|
2598
|
+
, to_anchor: 1/1000
|
2599
|
+
}
|
2600
|
+
, s: {
|
2601
|
+
name: {
|
2602
|
+
singular: 'Second'
|
2603
|
+
, plural: 'Seconds'
|
2604
|
+
}
|
2605
|
+
, to_anchor: 1
|
2606
|
+
}
|
2607
|
+
, min: {
|
2608
|
+
name: {
|
2609
|
+
singular: 'Minute'
|
2610
|
+
, plural: 'Minutes'
|
2611
|
+
}
|
2612
|
+
, to_anchor: 60
|
2613
|
+
}
|
2614
|
+
, h: {
|
2615
|
+
name: {
|
2616
|
+
singular: 'Hour'
|
2617
|
+
, plural: 'Hours'
|
2618
|
+
}
|
2619
|
+
, to_anchor: 60 * 60
|
2620
|
+
}
|
2621
|
+
, d: {
|
2622
|
+
name: {
|
2623
|
+
singular: 'Day'
|
2624
|
+
, plural: 'Days'
|
2625
|
+
}
|
2626
|
+
, to_anchor: 60 * 60 * 24
|
2627
|
+
}
|
2628
|
+
, week: {
|
2629
|
+
name: {
|
2630
|
+
singular: 'Week'
|
2631
|
+
, plural: 'Weeks'
|
2632
|
+
}
|
2633
|
+
, to_anchor: 60 * 60 * 24 * 7
|
2634
|
+
}
|
2635
|
+
, month: {
|
2636
|
+
name: {
|
2637
|
+
singular: 'Month'
|
2638
|
+
, plural: 'Months'
|
2639
|
+
}
|
2640
|
+
, to_anchor: 60 * 60 * 24 * daysInYear / 12
|
2641
|
+
}
|
2642
|
+
, year: {
|
2643
|
+
name: {
|
2644
|
+
singular: 'Year'
|
2645
|
+
, plural: 'Years'
|
2646
|
+
}
|
2647
|
+
, to_anchor: 60 * 60 * 24 * daysInYear
|
2648
|
+
}
|
2649
|
+
};
|
2650
|
+
|
2651
|
+
|
2652
|
+
var time_1 = {
|
2653
|
+
metric: time
|
2654
|
+
, _anchors: {
|
2655
|
+
metric: {
|
2656
|
+
unit: 's'
|
2657
|
+
, ratio: 1
|
2658
|
+
}
|
2659
|
+
}
|
2660
|
+
};
|
2661
|
+
|
2662
|
+
var bits
|
2663
|
+
, bytes;
|
2664
|
+
|
2665
|
+
bits = {
|
2666
|
+
b: {
|
2667
|
+
name: {
|
2668
|
+
singular: 'Bit'
|
2669
|
+
, plural: 'Bits'
|
2670
|
+
}
|
2671
|
+
, to_anchor: 1
|
2672
|
+
}
|
2673
|
+
, Kb: {
|
2674
|
+
name: {
|
2675
|
+
singular: 'Kilobit'
|
2676
|
+
, plural: 'Kilobits'
|
2677
|
+
}
|
2678
|
+
, to_anchor: 1024
|
2679
|
+
}
|
2680
|
+
, Mb: {
|
2681
|
+
name: {
|
2682
|
+
singular: 'Megabit'
|
2683
|
+
, plural: 'Megabits'
|
2684
|
+
}
|
2685
|
+
, to_anchor: 1048576
|
2686
|
+
}
|
2687
|
+
, Gb: {
|
2688
|
+
name: {
|
2689
|
+
singular: 'Gigabit'
|
2690
|
+
, plural: 'Gigabits'
|
2691
|
+
}
|
2692
|
+
, to_anchor: 1073741824
|
2693
|
+
}
|
2694
|
+
, Tb: {
|
2695
|
+
name: {
|
2696
|
+
singular: 'Terabit'
|
2697
|
+
, plural: 'Terabits'
|
2698
|
+
}
|
2699
|
+
, to_anchor: 1099511627776
|
2700
|
+
}
|
2701
|
+
};
|
2702
|
+
|
2703
|
+
bytes = {
|
2704
|
+
B: {
|
2705
|
+
name: {
|
2706
|
+
singular: 'Byte'
|
2707
|
+
, plural: 'Bytes'
|
2708
|
+
}
|
2709
|
+
, to_anchor: 1
|
2710
|
+
}
|
2711
|
+
, KB: {
|
2712
|
+
name: {
|
2713
|
+
singular: 'Kilobyte'
|
2714
|
+
, plural: 'Kilobytes'
|
2715
|
+
}
|
2716
|
+
, to_anchor: 1024
|
2717
|
+
}
|
2718
|
+
, MB: {
|
2719
|
+
name: {
|
2720
|
+
singular: 'Megabyte'
|
2721
|
+
, plural: 'Megabytes'
|
2722
|
+
}
|
2723
|
+
, to_anchor: 1048576
|
2724
|
+
}
|
2725
|
+
, GB: {
|
2726
|
+
name: {
|
2727
|
+
singular: 'Gigabyte'
|
2728
|
+
, plural: 'Gigabytes'
|
2729
|
+
}
|
2730
|
+
, to_anchor: 1073741824
|
2731
|
+
}
|
2732
|
+
, TB: {
|
2733
|
+
name: {
|
2734
|
+
singular: 'Terabyte'
|
2735
|
+
, plural: 'Terabytes'
|
2736
|
+
}
|
2737
|
+
, to_anchor: 1099511627776
|
2738
|
+
}
|
2739
|
+
};
|
2740
|
+
|
2741
|
+
var digital = {
|
2742
|
+
bits: bits
|
2743
|
+
, bytes: bytes
|
2744
|
+
, _anchors: {
|
2745
|
+
bits: {
|
2746
|
+
unit: 'b'
|
2747
|
+
, ratio: 1/8
|
2748
|
+
}
|
2749
|
+
, bytes: {
|
2750
|
+
unit: 'B'
|
2751
|
+
, ratio: 8
|
2752
|
+
}
|
2753
|
+
}
|
2754
|
+
};
|
2755
|
+
|
2756
|
+
var metric$5
|
2757
|
+
;
|
2758
|
+
|
2759
|
+
metric$5 = {
|
2760
|
+
ppm: {
|
2761
|
+
name: {
|
2762
|
+
singular: 'Part-per Million'
|
2763
|
+
, plural: 'Parts-per Million'
|
2764
|
+
}
|
2765
|
+
, to_anchor: 1
|
2766
|
+
}
|
2767
|
+
, ppb: {
|
2768
|
+
name: {
|
2769
|
+
singular: 'Part-per Billion'
|
2770
|
+
, plural: 'Parts-per Billion'
|
2771
|
+
}
|
2772
|
+
, to_anchor: .001
|
2773
|
+
}
|
2774
|
+
, ppt: {
|
2775
|
+
name: {
|
2776
|
+
singular: 'Part-per Trillion'
|
2777
|
+
, plural: 'Parts-per Trillion'
|
2778
|
+
}
|
2779
|
+
, to_anchor: .000001
|
2780
|
+
}
|
2781
|
+
, ppq: {
|
2782
|
+
name: {
|
2783
|
+
singular: 'Part-per Quadrillion'
|
2784
|
+
, plural: 'Parts-per Quadrillion'
|
2785
|
+
}
|
2786
|
+
, to_anchor: .000000001
|
2787
|
+
}
|
2788
|
+
};
|
2789
|
+
|
2790
|
+
var partsPer = {
|
2791
|
+
metric: metric$5
|
2792
|
+
, imperial: {}
|
2793
|
+
, _anchors: {
|
2794
|
+
metric: {
|
2795
|
+
unit: 'ppm'
|
2796
|
+
, ratio: .000001
|
2797
|
+
}
|
2798
|
+
}
|
2799
|
+
};
|
2800
|
+
|
2801
|
+
var metric$4
|
2802
|
+
, imperial$4;
|
2803
|
+
|
2804
|
+
metric$4 = {
|
2805
|
+
'm/s': {
|
2806
|
+
name: {
|
2807
|
+
singular: 'Metre per second'
|
2808
|
+
, plural: 'Metres per second'
|
2809
|
+
}
|
2810
|
+
, to_anchor: 3.6
|
2811
|
+
}
|
2812
|
+
, 'km/h': {
|
2813
|
+
name: {
|
2814
|
+
singular: 'Kilometre per hour'
|
2815
|
+
, plural: 'Kilometres per hour'
|
2816
|
+
}
|
2817
|
+
, to_anchor: 1
|
2818
|
+
}
|
2819
|
+
};
|
2820
|
+
|
2821
|
+
imperial$4 = {
|
2822
|
+
'm/h': {
|
2823
|
+
name: {
|
2824
|
+
singular: 'Mile per hour'
|
2825
|
+
, plural: 'Miles per hour'
|
2826
|
+
}
|
2827
|
+
, to_anchor: 1
|
2828
|
+
}
|
2829
|
+
, knot: {
|
2830
|
+
name: {
|
2831
|
+
singular: 'Knot'
|
2832
|
+
, plural: 'Knots'
|
2833
|
+
}
|
2834
|
+
, to_anchor: 1.150779
|
2835
|
+
}
|
2836
|
+
, 'ft/s': {
|
2837
|
+
name: {
|
2838
|
+
singular: 'Foot per second'
|
2839
|
+
, plural: 'Feet per second'
|
2840
|
+
}
|
2841
|
+
, to_anchor: 0.681818
|
2842
|
+
}
|
2843
|
+
};
|
2844
|
+
|
2845
|
+
var speed = {
|
2846
|
+
metric: metric$4
|
2847
|
+
, imperial: imperial$4
|
2848
|
+
, _anchors: {
|
2849
|
+
metric: {
|
2850
|
+
unit: 'km/h'
|
2851
|
+
, ratio: 1/1.609344
|
2852
|
+
}
|
2853
|
+
, imperial: {
|
2854
|
+
unit: 'm/h'
|
2855
|
+
, ratio: 1.609344
|
2856
|
+
}
|
2857
|
+
}
|
2858
|
+
};
|
2859
|
+
|
2860
|
+
var metric$3
|
2861
|
+
, imperial$3;
|
2862
|
+
|
2863
|
+
metric$3 = {
|
2864
|
+
'min/km': {
|
2865
|
+
name: {
|
2866
|
+
singular: 'Minute per kilometre'
|
2867
|
+
, plural: 'Minutes per kilometre'
|
2868
|
+
}
|
2869
|
+
, to_anchor: 0.06
|
2870
|
+
}
|
2871
|
+
,'s/m': {
|
2872
|
+
name: {
|
2873
|
+
singular: 'Second per metre'
|
2874
|
+
, plural: 'Seconds per metre'
|
2875
|
+
}
|
2876
|
+
, to_anchor: 1
|
2877
|
+
}
|
2878
|
+
};
|
2879
|
+
|
2880
|
+
imperial$3 = {
|
2881
|
+
'min/mi': {
|
2882
|
+
name: {
|
2883
|
+
singular: 'Minute per mile'
|
2884
|
+
, plural: 'Minutes per mile'
|
2885
|
+
}
|
2886
|
+
, to_anchor: 0.0113636
|
2887
|
+
}
|
2888
|
+
, 's/ft': {
|
2889
|
+
name: {
|
2890
|
+
singular: 'Second per foot'
|
2891
|
+
, plural: 'Seconds per foot'
|
2892
|
+
}
|
2893
|
+
, to_anchor: 1
|
2894
|
+
}
|
2895
|
+
};
|
2896
|
+
|
2897
|
+
var pace = {
|
2898
|
+
metric: metric$3
|
2899
|
+
, imperial: imperial$3
|
2900
|
+
, _anchors: {
|
2901
|
+
metric: {
|
2902
|
+
unit: 's/m'
|
2903
|
+
, ratio: 0.3048
|
2904
|
+
}
|
2905
|
+
, imperial: {
|
2906
|
+
unit: 's/ft'
|
2907
|
+
, ratio: 1/0.3048
|
2908
|
+
}
|
2909
|
+
}
|
2910
|
+
};
|
2911
|
+
|
2912
|
+
var metric$2
|
2913
|
+
, imperial$2;
|
2914
|
+
|
2915
|
+
metric$2 = {
|
2916
|
+
Pa: {
|
2917
|
+
name: {
|
2918
|
+
singular: 'pascal'
|
2919
|
+
, plural: 'pascals'
|
2920
|
+
}
|
2921
|
+
, to_anchor: 1/1000
|
2922
|
+
}
|
2923
|
+
, kPa: {
|
2924
|
+
name: {
|
2925
|
+
singular: 'kilopascal'
|
2926
|
+
, plural: 'kilopascals'
|
2927
|
+
}
|
2928
|
+
, to_anchor: 1
|
2929
|
+
}
|
2930
|
+
, MPa: {
|
2931
|
+
name: {
|
2932
|
+
singular: 'megapascal'
|
2933
|
+
, plural: 'megapascals'
|
2934
|
+
}
|
2935
|
+
, to_anchor: 1000
|
2936
|
+
}
|
2937
|
+
, hPa: {
|
2938
|
+
name: {
|
2939
|
+
singular: 'hectopascal'
|
2940
|
+
, plural: 'hectopascals'
|
2941
|
+
}
|
2942
|
+
, to_anchor: 1/10
|
2943
|
+
}
|
2944
|
+
, bar: {
|
2945
|
+
name: {
|
2946
|
+
singular: 'bar'
|
2947
|
+
, plural: 'bar'
|
2948
|
+
}
|
2949
|
+
, to_anchor: 100
|
2950
|
+
}
|
2951
|
+
, torr: {
|
2952
|
+
name: {
|
2953
|
+
singular: 'torr'
|
2954
|
+
, plural: 'torr'
|
2955
|
+
}
|
2956
|
+
, to_anchor: 101325/760000
|
2957
|
+
}
|
2958
|
+
};
|
2959
|
+
|
2960
|
+
imperial$2 = {
|
2961
|
+
psi: {
|
2962
|
+
name: {
|
2963
|
+
singular: 'pound per square inch'
|
2964
|
+
, plural: 'pounds per square inch'
|
2965
|
+
}
|
2966
|
+
, to_anchor: 1/1000
|
2967
|
+
}
|
2968
|
+
, ksi: {
|
2969
|
+
name: {
|
2970
|
+
singular: 'kilopound per square inch'
|
2971
|
+
, plural: 'kilopound per square inch'
|
2972
|
+
}
|
2973
|
+
, to_anchor: 1
|
2974
|
+
}
|
2975
|
+
};
|
2976
|
+
|
2977
|
+
var pressure = {
|
2978
|
+
metric: metric$2
|
2979
|
+
, imperial: imperial$2
|
2980
|
+
, _anchors: {
|
2981
|
+
metric: {
|
2982
|
+
unit: 'kPa'
|
2983
|
+
, ratio: 0.00014503768078
|
2984
|
+
}
|
2985
|
+
, imperial: {
|
2986
|
+
unit: 'psi'
|
2987
|
+
, ratio: 1/0.00014503768078
|
2988
|
+
}
|
2989
|
+
}
|
2990
|
+
};
|
2991
|
+
|
2992
|
+
var current;
|
2993
|
+
|
2994
|
+
current = {
|
2995
|
+
A: {
|
2996
|
+
name: {
|
2997
|
+
singular: 'Ampere'
|
2998
|
+
, plural: 'Amperes'
|
2999
|
+
}
|
3000
|
+
, to_anchor: 1
|
3001
|
+
}
|
3002
|
+
, mA: {
|
3003
|
+
name: {
|
3004
|
+
singular: 'Milliampere'
|
3005
|
+
, plural: 'Milliamperes'
|
3006
|
+
}
|
3007
|
+
, to_anchor: .001
|
3008
|
+
}
|
3009
|
+
, kA: {
|
3010
|
+
name: {
|
3011
|
+
singular: 'Kiloampere'
|
3012
|
+
, plural: 'Kiloamperes'
|
3013
|
+
}
|
3014
|
+
, to_anchor: 1000
|
3015
|
+
}
|
3016
|
+
};
|
3017
|
+
|
3018
|
+
var current_1 = {
|
3019
|
+
metric: current
|
3020
|
+
, _anchors: {
|
3021
|
+
metric: {
|
3022
|
+
unit: 'A'
|
3023
|
+
, ratio: 1
|
3024
|
+
}
|
3025
|
+
}
|
3026
|
+
};
|
3027
|
+
|
3028
|
+
var voltage;
|
3029
|
+
|
3030
|
+
voltage = {
|
3031
|
+
V: {
|
3032
|
+
name: {
|
3033
|
+
singular: 'Volt'
|
3034
|
+
, plural: 'Volts'
|
3035
|
+
}
|
3036
|
+
, to_anchor: 1
|
3037
|
+
}
|
3038
|
+
, mV: {
|
3039
|
+
name: {
|
3040
|
+
singular: 'Millivolt'
|
3041
|
+
, plural: 'Millivolts'
|
3042
|
+
}
|
3043
|
+
, to_anchor: .001
|
3044
|
+
}
|
3045
|
+
, kV: {
|
3046
|
+
name: {
|
3047
|
+
singular: 'Kilovolt'
|
3048
|
+
, plural: 'Kilovolts'
|
3049
|
+
}
|
3050
|
+
, to_anchor: 1000
|
3051
|
+
}
|
3052
|
+
};
|
3053
|
+
|
3054
|
+
var voltage_1 = {
|
3055
|
+
metric: voltage
|
3056
|
+
, _anchors: {
|
3057
|
+
metric: {
|
3058
|
+
unit: 'V'
|
3059
|
+
, ratio: 1
|
3060
|
+
}
|
3061
|
+
}
|
3062
|
+
};
|
3063
|
+
|
3064
|
+
var power;
|
3065
|
+
|
3066
|
+
power = {
|
3067
|
+
W: {
|
3068
|
+
name: {
|
3069
|
+
singular: 'Watt'
|
3070
|
+
, plural: 'Watts'
|
3071
|
+
}
|
3072
|
+
, to_anchor: 1
|
3073
|
+
}
|
3074
|
+
, mW: {
|
3075
|
+
name: {
|
3076
|
+
singular: 'Milliwatt'
|
3077
|
+
, plural: 'Milliwatts'
|
3078
|
+
}
|
3079
|
+
, to_anchor: .001
|
3080
|
+
}
|
3081
|
+
, kW: {
|
3082
|
+
name: {
|
3083
|
+
singular: 'Kilowatt'
|
3084
|
+
, plural: 'Kilowatts'
|
3085
|
+
}
|
3086
|
+
, to_anchor: 1000
|
3087
|
+
}
|
3088
|
+
, MW: {
|
3089
|
+
name: {
|
3090
|
+
singular: 'Megawatt'
|
3091
|
+
, plural: 'Megawatts'
|
3092
|
+
}
|
3093
|
+
, to_anchor: 1000000
|
3094
|
+
}
|
3095
|
+
, GW: {
|
3096
|
+
name: {
|
3097
|
+
singular: 'Gigawatt'
|
3098
|
+
, plural: 'Gigawatts'
|
3099
|
+
}
|
3100
|
+
, to_anchor: 1000000000
|
3101
|
+
}
|
3102
|
+
};
|
3103
|
+
|
3104
|
+
var power_1 = {
|
3105
|
+
metric: power
|
3106
|
+
, _anchors: {
|
3107
|
+
metric: {
|
3108
|
+
unit: 'W'
|
3109
|
+
, ratio: 1
|
3110
|
+
}
|
3111
|
+
}
|
3112
|
+
};
|
3113
|
+
|
3114
|
+
var reactivePower;
|
3115
|
+
|
3116
|
+
reactivePower = {
|
3117
|
+
VAR: {
|
3118
|
+
name: {
|
3119
|
+
singular: 'Volt-Ampere Reactive'
|
3120
|
+
, plural: 'Volt-Amperes Reactive'
|
3121
|
+
}
|
3122
|
+
, to_anchor: 1
|
3123
|
+
}
|
3124
|
+
, mVAR: {
|
3125
|
+
name: {
|
3126
|
+
singular: 'Millivolt-Ampere Reactive'
|
3127
|
+
, plural: 'Millivolt-Amperes Reactive'
|
3128
|
+
}
|
3129
|
+
, to_anchor: .001
|
3130
|
+
}
|
3131
|
+
, kVAR: {
|
3132
|
+
name: {
|
3133
|
+
singular: 'Kilovolt-Ampere Reactive'
|
3134
|
+
, plural: 'Kilovolt-Amperes Reactive'
|
3135
|
+
}
|
3136
|
+
, to_anchor: 1000
|
3137
|
+
}
|
3138
|
+
, MVAR: {
|
3139
|
+
name: {
|
3140
|
+
singular: 'Megavolt-Ampere Reactive'
|
3141
|
+
, plural: 'Megavolt-Amperes Reactive'
|
3142
|
+
}
|
3143
|
+
, to_anchor: 1000000
|
3144
|
+
}
|
3145
|
+
, GVAR: {
|
3146
|
+
name: {
|
3147
|
+
singular: 'Gigavolt-Ampere Reactive'
|
3148
|
+
, plural: 'Gigavolt-Amperes Reactive'
|
3149
|
+
}
|
3150
|
+
, to_anchor: 1000000000
|
3151
|
+
}
|
3152
|
+
};
|
3153
|
+
|
3154
|
+
var reactivePower_1 = {
|
3155
|
+
metric: reactivePower
|
3156
|
+
, _anchors: {
|
3157
|
+
metric: {
|
3158
|
+
unit: 'VAR'
|
3159
|
+
, ratio: 1
|
3160
|
+
}
|
3161
|
+
}
|
3162
|
+
};
|
3163
|
+
|
3164
|
+
var apparentPower;
|
3165
|
+
|
3166
|
+
apparentPower = {
|
3167
|
+
VA: {
|
3168
|
+
name: {
|
3169
|
+
singular: 'Volt-Ampere'
|
3170
|
+
, plural: 'Volt-Amperes'
|
3171
|
+
}
|
3172
|
+
, to_anchor: 1
|
3173
|
+
}
|
3174
|
+
, mVA: {
|
3175
|
+
name: {
|
3176
|
+
singular: 'Millivolt-Ampere'
|
3177
|
+
, plural: 'Millivolt-Amperes'
|
3178
|
+
}
|
3179
|
+
, to_anchor: .001
|
3180
|
+
}
|
3181
|
+
, kVA: {
|
3182
|
+
name: {
|
3183
|
+
singular: 'Kilovolt-Ampere'
|
3184
|
+
, plural: 'Kilovolt-Amperes'
|
3185
|
+
}
|
3186
|
+
, to_anchor: 1000
|
3187
|
+
}
|
3188
|
+
, MVA: {
|
3189
|
+
name: {
|
3190
|
+
singular: 'Megavolt-Ampere'
|
3191
|
+
, plural: 'Megavolt-Amperes'
|
3192
|
+
}
|
3193
|
+
, to_anchor: 1000000
|
3194
|
+
}
|
3195
|
+
, GVA: {
|
3196
|
+
name: {
|
3197
|
+
singular: 'Gigavolt-Ampere'
|
3198
|
+
, plural: 'Gigavolt-Amperes'
|
3199
|
+
}
|
3200
|
+
, to_anchor: 1000000000
|
3201
|
+
}
|
3202
|
+
};
|
3203
|
+
|
3204
|
+
var apparentPower_1 = {
|
3205
|
+
metric: apparentPower
|
3206
|
+
, _anchors: {
|
3207
|
+
metric: {
|
3208
|
+
unit: 'VA'
|
3209
|
+
, ratio: 1
|
3210
|
+
}
|
3211
|
+
}
|
3212
|
+
};
|
3213
|
+
|
3214
|
+
var energy;
|
3215
|
+
|
3216
|
+
energy = {
|
3217
|
+
Wh: {
|
3218
|
+
name: {
|
3219
|
+
singular: 'Watt-hour'
|
3220
|
+
, plural: 'Watt-hours'
|
3221
|
+
}
|
3222
|
+
, to_anchor: 3600
|
3223
|
+
}
|
3224
|
+
, mWh: {
|
3225
|
+
name: {
|
3226
|
+
singular: 'Milliwatt-hour'
|
3227
|
+
, plural: 'Milliwatt-hours'
|
3228
|
+
}
|
3229
|
+
, to_anchor: 3.6
|
3230
|
+
}
|
3231
|
+
, kWh: {
|
3232
|
+
name: {
|
3233
|
+
singular: 'Kilowatt-hour'
|
3234
|
+
, plural: 'Kilowatt-hours'
|
3235
|
+
}
|
3236
|
+
, to_anchor: 3600000
|
3237
|
+
}
|
3238
|
+
, MWh: {
|
3239
|
+
name: {
|
3240
|
+
singular: 'Megawatt-hour'
|
3241
|
+
, plural: 'Megawatt-hours'
|
3242
|
+
}
|
3243
|
+
, to_anchor: 3600000000
|
3244
|
+
}
|
3245
|
+
, GWh: {
|
3246
|
+
name: {
|
3247
|
+
singular: 'Gigawatt-hour'
|
3248
|
+
, plural: 'Gigawatt-hours'
|
3249
|
+
}
|
3250
|
+
, to_anchor: 3600000000000
|
3251
|
+
}
|
3252
|
+
, J: {
|
3253
|
+
name: {
|
3254
|
+
singular: 'Joule'
|
3255
|
+
, plural: 'Joules'
|
3256
|
+
}
|
3257
|
+
, to_anchor: 1
|
3258
|
+
}
|
3259
|
+
, kJ: {
|
3260
|
+
name: {
|
3261
|
+
singular: 'Kilojoule'
|
3262
|
+
, plural: 'Kilojoules'
|
3263
|
+
}
|
3264
|
+
, to_anchor: 1000
|
3265
|
+
}
|
3266
|
+
};
|
3267
|
+
|
3268
|
+
var energy_1 = {
|
3269
|
+
metric: energy
|
3270
|
+
, _anchors: {
|
3271
|
+
metric: {
|
3272
|
+
unit: 'J'
|
3273
|
+
, ratio: 1
|
3274
|
+
}
|
3275
|
+
}
|
3276
|
+
};
|
3277
|
+
|
3278
|
+
var reactiveEnergy;
|
3279
|
+
|
3280
|
+
reactiveEnergy = {
|
3281
|
+
VARh: {
|
3282
|
+
name: {
|
3283
|
+
singular: 'Volt-Ampere Reactive Hour'
|
3284
|
+
, plural: 'Volt-Amperes Reactive Hour'
|
3285
|
+
}
|
3286
|
+
, to_anchor: 1
|
3287
|
+
}
|
3288
|
+
, mVARh: {
|
3289
|
+
name: {
|
3290
|
+
singular: 'Millivolt-Ampere Reactive Hour'
|
3291
|
+
, plural: 'Millivolt-Amperes Reactive Hour'
|
3292
|
+
}
|
3293
|
+
, to_anchor: .001
|
3294
|
+
}
|
3295
|
+
, kVARh: {
|
3296
|
+
name: {
|
3297
|
+
singular: 'Kilovolt-Ampere Reactive Hour'
|
3298
|
+
, plural: 'Kilovolt-Amperes Reactive Hour'
|
3299
|
+
}
|
3300
|
+
, to_anchor: 1000
|
3301
|
+
}
|
3302
|
+
, MVARh: {
|
3303
|
+
name: {
|
3304
|
+
singular: 'Megavolt-Ampere Reactive Hour'
|
3305
|
+
, plural: 'Megavolt-Amperes Reactive Hour'
|
3306
|
+
}
|
3307
|
+
, to_anchor: 1000000
|
3308
|
+
}
|
3309
|
+
, GVARh: {
|
3310
|
+
name: {
|
3311
|
+
singular: 'Gigavolt-Ampere Reactive Hour'
|
3312
|
+
, plural: 'Gigavolt-Amperes Reactive Hour'
|
3313
|
+
}
|
3314
|
+
, to_anchor: 1000000000
|
3315
|
+
}
|
3316
|
+
};
|
3317
|
+
|
3318
|
+
var reactiveEnergy_1 = {
|
3319
|
+
metric: reactiveEnergy
|
3320
|
+
, _anchors: {
|
3321
|
+
metric: {
|
3322
|
+
unit: 'VARh'
|
3323
|
+
, ratio: 1
|
3324
|
+
}
|
3325
|
+
}
|
3326
|
+
};
|
3327
|
+
|
3328
|
+
var metric$1
|
3329
|
+
, imperial$1;
|
3330
|
+
|
3331
|
+
metric$1 = {
|
3332
|
+
'mm3/s': {
|
3333
|
+
name: {
|
3334
|
+
singular: 'Cubic Millimeter per second'
|
3335
|
+
, plural: 'Cubic Millimeters per second'
|
3336
|
+
}
|
3337
|
+
, to_anchor: 1/1000000
|
3338
|
+
}
|
3339
|
+
, 'cm3/s': {
|
3340
|
+
name: {
|
3341
|
+
singular: 'Cubic Centimeter per second'
|
3342
|
+
, plural: 'Cubic Centimeters per second'
|
3343
|
+
}
|
3344
|
+
, to_anchor: 1/1000
|
3345
|
+
}
|
3346
|
+
, 'ml/s': {
|
3347
|
+
name: {
|
3348
|
+
singular: 'Millilitre per second'
|
3349
|
+
, plural: 'Millilitres per second'
|
3350
|
+
}
|
3351
|
+
, to_anchor: 1/1000
|
3352
|
+
}
|
3353
|
+
, 'cl/s': {
|
3354
|
+
name: {
|
3355
|
+
singular: 'Centilitre per second'
|
3356
|
+
, plural: 'Centilitres per second'
|
3357
|
+
}
|
3358
|
+
, to_anchor: 1/100
|
3359
|
+
}
|
3360
|
+
, 'dl/s': {
|
3361
|
+
name: {
|
3362
|
+
singular: 'Decilitre per second'
|
3363
|
+
, plural: 'Decilitres per second'
|
3364
|
+
}
|
3365
|
+
, to_anchor: 1/10
|
3366
|
+
}
|
3367
|
+
, 'l/s': {
|
3368
|
+
name: {
|
3369
|
+
singular: 'Litre per second'
|
3370
|
+
, plural: 'Litres per second'
|
3371
|
+
}
|
3372
|
+
, to_anchor: 1
|
3373
|
+
}
|
3374
|
+
, 'l/min': {
|
3375
|
+
name: {
|
3376
|
+
singular: 'Litre per minute'
|
3377
|
+
, plural: 'Litres per minute'
|
3378
|
+
}
|
3379
|
+
, to_anchor: 1/60
|
3380
|
+
}
|
3381
|
+
, 'l/h': {
|
3382
|
+
name: {
|
3383
|
+
singular: 'Litre per hour'
|
3384
|
+
, plural: 'Litres per hour'
|
3385
|
+
}
|
3386
|
+
, to_anchor: 1/3600
|
3387
|
+
}
|
3388
|
+
, 'kl/s': {
|
3389
|
+
name: {
|
3390
|
+
singular: 'Kilolitre per second'
|
3391
|
+
, plural: 'Kilolitres per second'
|
3392
|
+
}
|
3393
|
+
, to_anchor: 1000
|
3394
|
+
}
|
3395
|
+
, 'kl/min': {
|
3396
|
+
name: {
|
3397
|
+
singular: 'Kilolitre per minute'
|
3398
|
+
, plural: 'Kilolitres per minute'
|
3399
|
+
}
|
3400
|
+
, to_anchor: 50/3
|
3401
|
+
}
|
3402
|
+
, 'kl/h': {
|
3403
|
+
name: {
|
3404
|
+
singular: 'Kilolitre per hour'
|
3405
|
+
, plural: 'Kilolitres per hour'
|
3406
|
+
}
|
3407
|
+
, to_anchor: 5/18
|
3408
|
+
}
|
3409
|
+
, 'm3/s': {
|
3410
|
+
name: {
|
3411
|
+
singular: 'Cubic meter per second'
|
3412
|
+
, plural: 'Cubic meters per second'
|
3413
|
+
}
|
3414
|
+
, to_anchor: 1000
|
3415
|
+
}
|
3416
|
+
, 'm3/min': {
|
3417
|
+
name: {
|
3418
|
+
singular: 'Cubic meter per minute'
|
3419
|
+
, plural: 'Cubic meters per minute'
|
3420
|
+
}
|
3421
|
+
, to_anchor: 50/3
|
3422
|
+
}
|
3423
|
+
, 'm3/h': {
|
3424
|
+
name: {
|
3425
|
+
singular: 'Cubic meter per hour'
|
3426
|
+
, plural: 'Cubic meters per hour'
|
3427
|
+
}
|
3428
|
+
, to_anchor: 5/18
|
3429
|
+
}
|
3430
|
+
, 'km3/s': {
|
3431
|
+
name: {
|
3432
|
+
singular: 'Cubic kilometer per second'
|
3433
|
+
, plural: 'Cubic kilometers per second'
|
3434
|
+
}
|
3435
|
+
, to_anchor: 1000000000000
|
3436
|
+
}
|
3437
|
+
};
|
3438
|
+
|
3439
|
+
imperial$1 = {
|
3440
|
+
'tsp/s': {
|
3441
|
+
name: {
|
3442
|
+
singular: 'Teaspoon per second'
|
3443
|
+
, plural: 'Teaspoons per second'
|
3444
|
+
}
|
3445
|
+
, to_anchor: 1/6
|
3446
|
+
}
|
3447
|
+
, 'Tbs/s': {
|
3448
|
+
name: {
|
3449
|
+
singular: 'Tablespoon per second'
|
3450
|
+
, plural: 'Tablespoons per second'
|
3451
|
+
}
|
3452
|
+
, to_anchor: 1/2
|
3453
|
+
}
|
3454
|
+
, 'in3/s': {
|
3455
|
+
name: {
|
3456
|
+
singular: 'Cubic inch per second'
|
3457
|
+
, plural: 'Cubic inches per second'
|
3458
|
+
}
|
3459
|
+
, to_anchor: 0.55411
|
3460
|
+
}
|
3461
|
+
, 'in3/min': {
|
3462
|
+
name: {
|
3463
|
+
singular: 'Cubic inch per minute'
|
3464
|
+
, plural: 'Cubic inches per minute'
|
3465
|
+
}
|
3466
|
+
, to_anchor: 0.55411/60
|
3467
|
+
}
|
3468
|
+
, 'in3/h': {
|
3469
|
+
name: {
|
3470
|
+
singular: 'Cubic inch per hour'
|
3471
|
+
, plural: 'Cubic inches per hour'
|
3472
|
+
}
|
3473
|
+
, to_anchor: 0.55411/3600
|
3474
|
+
}
|
3475
|
+
, 'fl-oz/s': {
|
3476
|
+
name: {
|
3477
|
+
singular: 'Fluid Ounce per second'
|
3478
|
+
, plural: 'Fluid Ounces per second'
|
3479
|
+
}
|
3480
|
+
, to_anchor: 1
|
3481
|
+
}
|
3482
|
+
, 'fl-oz/min': {
|
3483
|
+
name: {
|
3484
|
+
singular: 'Fluid Ounce per minute'
|
3485
|
+
, plural: 'Fluid Ounces per minute'
|
3486
|
+
}
|
3487
|
+
, to_anchor: 1/60
|
3488
|
+
}
|
3489
|
+
, 'fl-oz/h': {
|
3490
|
+
name: {
|
3491
|
+
singular: 'Fluid Ounce per hour'
|
3492
|
+
, plural: 'Fluid Ounces per hour'
|
3493
|
+
}
|
3494
|
+
, to_anchor: 1/3600
|
3495
|
+
}
|
3496
|
+
, 'cup/s': {
|
3497
|
+
name: {
|
3498
|
+
singular: 'Cup per second'
|
3499
|
+
, plural: 'Cups per second'
|
3500
|
+
}
|
3501
|
+
, to_anchor: 8
|
3502
|
+
}
|
3503
|
+
, 'pnt/s': {
|
3504
|
+
name: {
|
3505
|
+
singular: 'Pint per second'
|
3506
|
+
, plural: 'Pints per second'
|
3507
|
+
}
|
3508
|
+
, to_anchor: 16
|
3509
|
+
}
|
3510
|
+
, 'pnt/min': {
|
3511
|
+
name: {
|
3512
|
+
singular: 'Pint per minute'
|
3513
|
+
, plural: 'Pints per minute'
|
3514
|
+
}
|
3515
|
+
, to_anchor: 4/15
|
3516
|
+
}
|
3517
|
+
, 'pnt/h': {
|
3518
|
+
name: {
|
3519
|
+
singular: 'Pint per hour'
|
3520
|
+
, plural: 'Pints per hour'
|
3521
|
+
}
|
3522
|
+
, to_anchor: 1/225
|
3523
|
+
}
|
3524
|
+
, 'qt/s': {
|
3525
|
+
name: {
|
3526
|
+
singular: 'Quart per second'
|
3527
|
+
, plural: 'Quarts per second'
|
3528
|
+
}
|
3529
|
+
, to_anchor: 32
|
3530
|
+
}
|
3531
|
+
, 'gal/s': {
|
3532
|
+
name: {
|
3533
|
+
singular: 'Gallon per second'
|
3534
|
+
, plural: 'Gallons per second'
|
3535
|
+
}
|
3536
|
+
, to_anchor: 128
|
3537
|
+
}
|
3538
|
+
, 'gal/min': {
|
3539
|
+
name: {
|
3540
|
+
singular: 'Gallon per minute'
|
3541
|
+
, plural: 'Gallons per minute'
|
3542
|
+
}
|
3543
|
+
, to_anchor: 32/15
|
3544
|
+
}
|
3545
|
+
, 'gal/h': {
|
3546
|
+
name: {
|
3547
|
+
singular: 'Gallon per hour'
|
3548
|
+
, plural: 'Gallons per hour'
|
3549
|
+
}
|
3550
|
+
, to_anchor: 8/225
|
3551
|
+
}
|
3552
|
+
, 'ft3/s': {
|
3553
|
+
name: {
|
3554
|
+
singular: 'Cubic foot per second'
|
3555
|
+
, plural: 'Cubic feet per second'
|
3556
|
+
}
|
3557
|
+
, to_anchor: 957.506
|
3558
|
+
}
|
3559
|
+
, 'ft3/min': {
|
3560
|
+
name: {
|
3561
|
+
singular: 'Cubic foot per minute'
|
3562
|
+
, plural: 'Cubic feet per minute'
|
3563
|
+
}
|
3564
|
+
, to_anchor: 957.506/60
|
3565
|
+
}
|
3566
|
+
, 'ft3/h': {
|
3567
|
+
name: {
|
3568
|
+
singular: 'Cubic foot per hour'
|
3569
|
+
, plural: 'Cubic feet per hour'
|
3570
|
+
}
|
3571
|
+
, to_anchor: 957.506/3600
|
3572
|
+
}
|
3573
|
+
, 'yd3/s': {
|
3574
|
+
name: {
|
3575
|
+
singular: 'Cubic yard per second'
|
3576
|
+
, plural: 'Cubic yards per second'
|
3577
|
+
}
|
3578
|
+
, to_anchor: 25852.7
|
3579
|
+
}
|
3580
|
+
, 'yd3/min': {
|
3581
|
+
name: {
|
3582
|
+
singular: 'Cubic yard per minute'
|
3583
|
+
, plural: 'Cubic yards per minute'
|
3584
|
+
}
|
3585
|
+
, to_anchor: 25852.7/60
|
3586
|
+
}
|
3587
|
+
, 'yd3/h': {
|
3588
|
+
name: {
|
3589
|
+
singular: 'Cubic yard per hour'
|
3590
|
+
, plural: 'Cubic yards per hour'
|
3591
|
+
}
|
3592
|
+
, to_anchor: 25852.7/3600
|
3593
|
+
}
|
3594
|
+
};
|
3595
|
+
|
3596
|
+
var volumeFlowRate = {
|
3597
|
+
metric: metric$1
|
3598
|
+
, imperial: imperial$1
|
3599
|
+
, _anchors: {
|
3600
|
+
metric: {
|
3601
|
+
unit: 'l/s'
|
3602
|
+
, ratio: 33.8140227
|
3603
|
+
}
|
3604
|
+
, imperial: {
|
3605
|
+
unit: 'fl-oz/s'
|
3606
|
+
, ratio: 1/33.8140227
|
3607
|
+
}
|
3608
|
+
}
|
3609
|
+
};
|
3610
|
+
|
3611
|
+
var metric,
|
3612
|
+
imperial;
|
3613
|
+
|
3614
|
+
metric = {
|
3615
|
+
'lx': {
|
3616
|
+
name: {
|
3617
|
+
singular: 'Lux',
|
3618
|
+
plural: 'Lux'
|
3619
|
+
},
|
3620
|
+
to_anchor: 1
|
3621
|
+
}
|
3622
|
+
};
|
3623
|
+
|
3624
|
+
imperial = {
|
3625
|
+
'ft-cd': {
|
3626
|
+
name: {
|
3627
|
+
singular: 'Foot-candle',
|
3628
|
+
plural: 'Foot-candles'
|
3629
|
+
},
|
3630
|
+
to_anchor: 1
|
3631
|
+
}
|
3632
|
+
};
|
3633
|
+
|
3634
|
+
var illuminance = {
|
3635
|
+
metric: metric,
|
3636
|
+
imperial: imperial,
|
3637
|
+
_anchors: {
|
3638
|
+
metric: {
|
3639
|
+
unit: 'lx',
|
3640
|
+
ratio: 1/10.76391
|
3641
|
+
},
|
3642
|
+
imperial: {
|
3643
|
+
unit: 'ft-cd',
|
3644
|
+
ratio: 10.76391
|
3645
|
+
}
|
3646
|
+
}
|
3647
|
+
};
|
3648
|
+
|
3649
|
+
var frequency;
|
3650
|
+
|
3651
|
+
frequency = {
|
3652
|
+
mHz: {
|
3653
|
+
name: {
|
3654
|
+
singular: 'millihertz'
|
3655
|
+
, plural: 'millihertz'
|
3656
|
+
}
|
3657
|
+
, to_anchor: 1/1000
|
3658
|
+
}
|
3659
|
+
, Hz: {
|
3660
|
+
name: {
|
3661
|
+
singular: 'hertz'
|
3662
|
+
, plural: 'hertz'
|
3663
|
+
}
|
3664
|
+
, to_anchor: 1
|
3665
|
+
}
|
3666
|
+
, kHz: {
|
3667
|
+
name: {
|
3668
|
+
singular: 'kilohertz'
|
3669
|
+
, plural: 'kilohertz'
|
3670
|
+
}
|
3671
|
+
, to_anchor: 1000
|
3672
|
+
}
|
3673
|
+
, MHz: {
|
3674
|
+
name: {
|
3675
|
+
singular: 'megahertz'
|
3676
|
+
, plural: 'megahertz'
|
3677
|
+
}
|
3678
|
+
, to_anchor: 1000 * 1000
|
3679
|
+
}
|
3680
|
+
, GHz: {
|
3681
|
+
name: {
|
3682
|
+
singular: 'gigahertz'
|
3683
|
+
, plural: 'gigahertz'
|
3684
|
+
}
|
3685
|
+
, to_anchor: 1000 * 1000 * 1000
|
3686
|
+
}
|
3687
|
+
, THz: {
|
3688
|
+
name: {
|
3689
|
+
singular: 'terahertz'
|
3690
|
+
, plural: 'terahertz'
|
3691
|
+
}
|
3692
|
+
, to_anchor: 1000 * 1000 * 1000 * 1000
|
3693
|
+
}
|
3694
|
+
, rpm: {
|
3695
|
+
name: {
|
3696
|
+
singular: 'rotation per minute'
|
3697
|
+
, plural: 'rotations per minute'
|
3698
|
+
}
|
3699
|
+
, to_anchor: 1/60
|
3700
|
+
}
|
3701
|
+
, "deg/s": {
|
3702
|
+
name: {
|
3703
|
+
singular: 'degree per second'
|
3704
|
+
, plural: 'degrees per second'
|
3705
|
+
}
|
3706
|
+
, to_anchor: 1/360
|
3707
|
+
}
|
3708
|
+
, "rad/s": {
|
3709
|
+
name: {
|
3710
|
+
singular: 'radian per second'
|
3711
|
+
, plural: 'radians per second'
|
3712
|
+
}
|
3713
|
+
, to_anchor: 1/(Math.PI * 2)
|
3714
|
+
}
|
3715
|
+
};
|
3716
|
+
|
3717
|
+
|
3718
|
+
var frequency_1 = {
|
3719
|
+
metric: frequency
|
3720
|
+
, _anchors: {
|
3721
|
+
frequency: {
|
3722
|
+
unit: 'hz'
|
3723
|
+
, ratio: 1
|
3724
|
+
}
|
3725
|
+
}
|
3726
|
+
};
|
3727
|
+
|
3728
|
+
var angle;
|
3729
|
+
|
3730
|
+
angle = {
|
3731
|
+
rad: {
|
3732
|
+
name: {
|
3733
|
+
singular: 'radian'
|
3734
|
+
, plural: 'radians'
|
3735
|
+
}
|
3736
|
+
, to_anchor: 180/Math.PI
|
3737
|
+
}
|
3738
|
+
, deg: {
|
3739
|
+
name: {
|
3740
|
+
singular: 'degree'
|
3741
|
+
, plural: 'degrees'
|
3742
|
+
}
|
3743
|
+
, to_anchor: 1
|
3744
|
+
}
|
3745
|
+
, grad: {
|
3746
|
+
name: {
|
3747
|
+
singular: 'gradian'
|
3748
|
+
, plural: 'gradians'
|
3749
|
+
}
|
3750
|
+
, to_anchor: 9/10
|
3751
|
+
}
|
3752
|
+
, arcmin: {
|
3753
|
+
name: {
|
3754
|
+
singular: 'arcminute'
|
3755
|
+
, plural: 'arcminutes'
|
3756
|
+
}
|
3757
|
+
, to_anchor: 1/60
|
3758
|
+
}
|
3759
|
+
, arcsec: {
|
3760
|
+
name: {
|
3761
|
+
singular: 'arcsecond'
|
3762
|
+
, plural: 'arcseconds'
|
3763
|
+
}
|
3764
|
+
, to_anchor: 1/3600
|
3765
|
+
}
|
3766
|
+
};
|
3767
|
+
|
3768
|
+
var angle_1 = {
|
3769
|
+
metric: angle
|
3770
|
+
, _anchors: {
|
3771
|
+
metric: {
|
3772
|
+
unit: 'deg'
|
3773
|
+
, ratio: 1
|
3774
|
+
}
|
3775
|
+
}
|
3776
|
+
};
|
3777
|
+
|
3778
|
+
var convert
|
3779
|
+
, keys = lodash_keys
|
3780
|
+
, each = lodash_foreach
|
3781
|
+
, measures = {
|
3782
|
+
length: length
|
3783
|
+
, area: area
|
3784
|
+
, mass: mass
|
3785
|
+
, volume: volume
|
3786
|
+
, each: each$1
|
3787
|
+
, temperature: temperature
|
3788
|
+
, time: time_1
|
3789
|
+
, digital: digital
|
3790
|
+
, partsPer: partsPer
|
3791
|
+
, speed: speed
|
3792
|
+
, pace: pace
|
3793
|
+
, pressure: pressure
|
3794
|
+
, current: current_1
|
3795
|
+
, voltage: voltage_1
|
3796
|
+
, power: power_1
|
3797
|
+
, reactivePower: reactivePower_1
|
3798
|
+
, apparentPower: apparentPower_1
|
3799
|
+
, energy: energy_1
|
3800
|
+
, reactiveEnergy: reactiveEnergy_1
|
3801
|
+
, volumeFlowRate: volumeFlowRate
|
3802
|
+
, illuminance: illuminance
|
3803
|
+
, frequency: frequency_1
|
3804
|
+
, angle : angle_1
|
3805
|
+
}
|
3806
|
+
, Converter;
|
3807
|
+
|
3808
|
+
Converter = function (numerator, denominator) {
|
3809
|
+
if(denominator)
|
3810
|
+
this.val = numerator / denominator;
|
3811
|
+
else
|
3812
|
+
this.val = numerator;
|
3813
|
+
};
|
3814
|
+
|
3815
|
+
/**
|
3816
|
+
* Lets the converter know the source unit abbreviation
|
3817
|
+
*/
|
3818
|
+
Converter.prototype.from = function (from) {
|
3819
|
+
if(this.destination)
|
3820
|
+
throw new Error('.from must be called before .to');
|
3821
|
+
|
3822
|
+
this.origin = this.getUnit(from);
|
3823
|
+
|
3824
|
+
if(!this.origin) {
|
3825
|
+
this.throwUnsupportedUnitError(from);
|
3826
|
+
}
|
3827
|
+
|
3828
|
+
return this;
|
3829
|
+
};
|
3830
|
+
|
3831
|
+
/**
|
3832
|
+
* Converts the unit and returns the value
|
3833
|
+
*/
|
3834
|
+
Converter.prototype.to = function (to) {
|
3835
|
+
if(!this.origin)
|
3836
|
+
throw new Error('.to must be called after .from');
|
3837
|
+
|
3838
|
+
this.destination = this.getUnit(to);
|
3839
|
+
|
3840
|
+
var result
|
3841
|
+
, transform;
|
3842
|
+
|
3843
|
+
if(!this.destination) {
|
3844
|
+
this.throwUnsupportedUnitError(to);
|
3845
|
+
}
|
3846
|
+
|
3847
|
+
// Don't change the value if origin and destination are the same
|
3848
|
+
if (this.origin.abbr === this.destination.abbr) {
|
3849
|
+
return this.val;
|
3850
|
+
}
|
3851
|
+
|
3852
|
+
// You can't go from liquid to mass, for example
|
3853
|
+
if(this.destination.measure != this.origin.measure) {
|
3854
|
+
throw new Error('Cannot convert incompatible measures of '
|
3855
|
+
+ this.destination.measure + ' and ' + this.origin.measure);
|
3856
|
+
}
|
3857
|
+
|
3858
|
+
/**
|
3859
|
+
* Convert from the source value to its anchor inside the system
|
3860
|
+
*/
|
3861
|
+
result = this.val * this.origin.unit.to_anchor;
|
3862
|
+
|
3863
|
+
/**
|
3864
|
+
* For some changes it's a simple shift (C to K)
|
3865
|
+
* So we'll add it when convering into the unit (later)
|
3866
|
+
* and subtract it when converting from the unit
|
3867
|
+
*/
|
3868
|
+
if (this.origin.unit.anchor_shift) {
|
3869
|
+
result -= this.origin.unit.anchor_shift;
|
3870
|
+
}
|
3871
|
+
|
3872
|
+
/**
|
3873
|
+
* Convert from one system to another through the anchor ratio. Some conversions
|
3874
|
+
* aren't ratio based or require more than a simple shift. We can provide a custom
|
3875
|
+
* transform here to provide the direct result
|
3876
|
+
*/
|
3877
|
+
if(this.origin.system != this.destination.system) {
|
3878
|
+
transform = measures[this.origin.measure]._anchors[this.origin.system].transform;
|
3879
|
+
if (typeof transform === 'function') {
|
3880
|
+
result = transform(result);
|
3881
|
+
}
|
3882
|
+
else {
|
3883
|
+
result *= measures[this.origin.measure]._anchors[this.origin.system].ratio;
|
3884
|
+
}
|
3885
|
+
}
|
3886
|
+
|
3887
|
+
/**
|
3888
|
+
* This shift has to be done after the system conversion business
|
3889
|
+
*/
|
3890
|
+
if (this.destination.unit.anchor_shift) {
|
3891
|
+
result += this.destination.unit.anchor_shift;
|
3892
|
+
}
|
3893
|
+
|
3894
|
+
/**
|
3895
|
+
* Convert to another unit inside the destination system
|
3896
|
+
*/
|
3897
|
+
return result / this.destination.unit.to_anchor;
|
3898
|
+
};
|
3899
|
+
|
3900
|
+
/**
|
3901
|
+
* Converts the unit to the best available unit.
|
3902
|
+
*/
|
3903
|
+
Converter.prototype.toBest = function(options) {
|
3904
|
+
if(!this.origin)
|
3905
|
+
throw new Error('.toBest must be called after .from');
|
3906
|
+
|
3907
|
+
var options = Object.assign({
|
3908
|
+
exclude: [],
|
3909
|
+
cutOffNumber: 1,
|
3910
|
+
}, options);
|
3911
|
+
|
3912
|
+
var best;
|
3913
|
+
/**
|
3914
|
+
Looks through every possibility for the 'best' available unit.
|
3915
|
+
i.e. Where the value has the fewest numbers before the decimal point,
|
3916
|
+
but is still higher than 1.
|
3917
|
+
*/
|
3918
|
+
each(this.possibilities(), function(possibility) {
|
3919
|
+
var unit = this.describe(possibility);
|
3920
|
+
var isIncluded = options.exclude.indexOf(possibility) === -1;
|
3921
|
+
|
3922
|
+
if (isIncluded && unit.system === this.origin.system) {
|
3923
|
+
var result = this.to(possibility);
|
3924
|
+
if (!best || (result >= options.cutOffNumber && result < best.val)) {
|
3925
|
+
best = {
|
3926
|
+
val: result,
|
3927
|
+
unit: possibility,
|
3928
|
+
singular: unit.singular,
|
3929
|
+
plural: unit.plural
|
3930
|
+
};
|
3931
|
+
}
|
3932
|
+
}
|
3933
|
+
}.bind(this));
|
3934
|
+
|
3935
|
+
return best;
|
3936
|
+
};
|
3937
|
+
|
3938
|
+
/**
|
3939
|
+
* Finds the unit
|
3940
|
+
*/
|
3941
|
+
Converter.prototype.getUnit = function (abbr) {
|
3942
|
+
var found;
|
3943
|
+
|
3944
|
+
each(measures, function (systems, measure) {
|
3945
|
+
each(systems, function (units, system) {
|
3946
|
+
if(system == '_anchors')
|
3947
|
+
return false;
|
3948
|
+
|
3949
|
+
each(units, function (unit, testAbbr) {
|
3950
|
+
if(testAbbr == abbr) {
|
3951
|
+
found = {
|
3952
|
+
abbr: abbr
|
3953
|
+
, measure: measure
|
3954
|
+
, system: system
|
3955
|
+
, unit: unit
|
3956
|
+
};
|
3957
|
+
return false;
|
3958
|
+
}
|
3959
|
+
});
|
3960
|
+
|
3961
|
+
if(found)
|
3962
|
+
return false;
|
3963
|
+
});
|
3964
|
+
|
3965
|
+
if(found)
|
3966
|
+
return false;
|
3967
|
+
});
|
3968
|
+
|
3969
|
+
return found;
|
3970
|
+
};
|
3971
|
+
|
3972
|
+
var describe = function(resp) {
|
3973
|
+
return {
|
3974
|
+
abbr: resp.abbr
|
3975
|
+
, measure: resp.measure
|
3976
|
+
, system: resp.system
|
3977
|
+
, singular: resp.unit.name.singular
|
3978
|
+
, plural: resp.unit.name.plural
|
3979
|
+
};
|
3980
|
+
};
|
3981
|
+
|
3982
|
+
/**
|
3983
|
+
* An alias for getUnit
|
3984
|
+
*/
|
3985
|
+
Converter.prototype.describe = function (abbr) {
|
3986
|
+
var resp = Converter.prototype.getUnit(abbr);
|
3987
|
+
var desc = null;
|
3988
|
+
|
3989
|
+
try {
|
3990
|
+
desc = describe(resp);
|
3991
|
+
} catch(err) {
|
3992
|
+
this.throwUnsupportedUnitError(abbr);
|
3993
|
+
}
|
3994
|
+
|
3995
|
+
return desc;
|
3996
|
+
};
|
3997
|
+
|
3998
|
+
/**
|
3999
|
+
* Detailed list of all supported units
|
4000
|
+
*/
|
4001
|
+
Converter.prototype.list = function (measure) {
|
4002
|
+
var list = [];
|
4003
|
+
|
4004
|
+
each(measures, function (systems, testMeasure) {
|
4005
|
+
if(measure && measure !== testMeasure)
|
4006
|
+
return;
|
4007
|
+
|
4008
|
+
each(systems, function (units, system) {
|
4009
|
+
if(system == '_anchors')
|
4010
|
+
return false;
|
4011
|
+
|
4012
|
+
each(units, function (unit, abbr) {
|
4013
|
+
list = list.concat(describe({
|
4014
|
+
abbr: abbr,
|
4015
|
+
measure: testMeasure
|
4016
|
+
, system: system
|
4017
|
+
, unit: unit
|
4018
|
+
}));
|
4019
|
+
});
|
4020
|
+
});
|
4021
|
+
});
|
4022
|
+
|
4023
|
+
return list;
|
4024
|
+
};
|
4025
|
+
|
4026
|
+
Converter.prototype.throwUnsupportedUnitError = function (what) {
|
4027
|
+
var validUnits = [];
|
4028
|
+
|
4029
|
+
each(measures, function (systems, measure) {
|
4030
|
+
each(systems, function (units, system) {
|
4031
|
+
if(system == '_anchors')
|
4032
|
+
return false;
|
4033
|
+
|
4034
|
+
validUnits = validUnits.concat(keys(units));
|
4035
|
+
});
|
4036
|
+
});
|
4037
|
+
|
4038
|
+
throw new Error('Unsupported unit ' + what + ', use one of: ' + validUnits.join(', '));
|
4039
|
+
};
|
4040
|
+
|
4041
|
+
/**
|
4042
|
+
* Returns the abbreviated measures that the value can be
|
4043
|
+
* converted to.
|
4044
|
+
*/
|
4045
|
+
Converter.prototype.possibilities = function (measure) {
|
4046
|
+
var possibilities = [];
|
4047
|
+
if(!this.origin && !measure) {
|
4048
|
+
each(keys(measures), function (measure){
|
4049
|
+
each(measures[measure], function (units, system) {
|
4050
|
+
if(system == '_anchors')
|
4051
|
+
return false;
|
4052
|
+
|
4053
|
+
possibilities = possibilities.concat(keys(units));
|
4054
|
+
});
|
4055
|
+
});
|
4056
|
+
} else {
|
4057
|
+
measure = measure || this.origin.measure;
|
4058
|
+
each(measures[measure], function (units, system) {
|
4059
|
+
if(system == '_anchors')
|
4060
|
+
return false;
|
4061
|
+
|
4062
|
+
possibilities = possibilities.concat(keys(units));
|
4063
|
+
});
|
4064
|
+
}
|
4065
|
+
|
4066
|
+
return possibilities;
|
4067
|
+
};
|
4068
|
+
|
4069
|
+
/**
|
4070
|
+
* Returns the abbreviated measures that the value can be
|
4071
|
+
* converted to.
|
4072
|
+
*/
|
4073
|
+
Converter.prototype.measures = function () {
|
4074
|
+
return keys(measures);
|
4075
|
+
};
|
4076
|
+
|
4077
|
+
convert = function (value) {
|
4078
|
+
return new Converter(value);
|
4079
|
+
};
|
4080
|
+
|
4081
|
+
var lib = convert;
|
4082
|
+
|
4083
|
+
var hasRequiredAgricultureCal;
|
4084
|
+
|
4085
|
+
function requireAgricultureCal () {
|
4086
|
+
if (hasRequiredAgricultureCal) return agricultureCal;
|
4087
|
+
hasRequiredAgricultureCal = 1;
|
4088
|
+
Object.defineProperty(agricultureCal, "__esModule", { value: true });
|
4089
|
+
agricultureCal.AgricultureCal = void 0;
|
4090
|
+
const calculator_1 = requireCalculator();
|
4091
|
+
var convert = lib;
|
4092
|
+
class AgricultureCal {
|
4093
|
+
static calculate(req) {
|
4094
|
+
const constants = req.agricultureConstants;
|
4095
|
+
const unitParts = constants.emissionFactorUnit.split('/');
|
4096
|
+
if (unitParts.length != 3) {
|
4097
|
+
throw Error("Invalid emission factor unit " + constants.emissionFactorUnit);
|
4098
|
+
}
|
4099
|
+
const landArea = convert(req.landArea).from(req.landAreaUnit).to(unitParts[1]);
|
4100
|
+
const duration = convert(req.duration).from(req.durationUnit).to(unitParts[2]);
|
4101
|
+
return Number((constants.emissionFactor * landArea * duration).toFixed(calculator_1.PRECISION));
|
4102
|
+
}
|
4103
|
+
}
|
4104
|
+
agricultureCal.AgricultureCal = AgricultureCal;
|
4105
|
+
return agricultureCal;
|
4106
|
+
}
|
4107
|
+
|
4108
|
+
var solarCal = {};
|
4109
|
+
|
4110
|
+
var hasRequiredSolarCal;
|
4111
|
+
|
4112
|
+
function requireSolarCal () {
|
4113
|
+
if (hasRequiredSolarCal) return solarCal;
|
4114
|
+
hasRequiredSolarCal = 1;
|
4115
|
+
Object.defineProperty(solarCal, "__esModule", { value: true });
|
4116
|
+
solarCal.SolarCal = void 0;
|
4117
|
+
const calculator_1 = requireCalculator();
|
4118
|
+
var convert = lib;
|
4119
|
+
class SolarCal {
|
4120
|
+
static calculate(req) {
|
4121
|
+
const constants = req.solarConstants;
|
4122
|
+
const emissionUnitParts = constants.emissionFactorUnit.split('/');
|
4123
|
+
if (emissionUnitParts.length != 2) {
|
4124
|
+
throw Error("Invalid emission factor unit " + constants.emissionFactorUnit);
|
4125
|
+
}
|
4126
|
+
const measuredUnitParts = req.energyGenerationUnit.split('/');
|
4127
|
+
if (measuredUnitParts.length != 3) {
|
4128
|
+
throw Error("Invalid measured unit " + req.energyGenerationUnit);
|
4129
|
+
}
|
4130
|
+
let threshold = constants.buildingTypes[req.buildingType];
|
4131
|
+
if (!threshold) {
|
4132
|
+
throw Error("Invalid building type " + req.buildingType);
|
4133
|
+
}
|
4134
|
+
if (req.energyGenerationUnit != constants.thresholdUnit) {
|
4135
|
+
const thresholdUnitParts = constants.thresholdUnit.split('/');
|
4136
|
+
if (thresholdUnitParts.length != 2) {
|
4137
|
+
throw Error("Invalid threshold unit " + constants.thresholdUnit);
|
4138
|
+
}
|
4139
|
+
let factor = convert(1).from(thresholdUnitParts[0]).to(measuredUnitParts[0]);
|
4140
|
+
factor = factor / convert(1).from(thresholdUnitParts[1]).to(measuredUnitParts[1]);
|
4141
|
+
threshold = Number(threshold * factor);
|
4142
|
+
}
|
4143
|
+
const unitX = convert(1).from(measuredUnitParts[0]).to(emissionUnitParts[1]);
|
4144
|
+
const highFactor = Number(constants.highEmissionFactor * unitX);
|
4145
|
+
const lowFactor = Number(constants.lowEmissionFactor * unitX);
|
4146
|
+
let value;
|
4147
|
+
if (req.energyGeneration < threshold) {
|
4148
|
+
value = req.energyGeneration * highFactor;
|
4149
|
+
}
|
4150
|
+
else {
|
4151
|
+
value = threshold * highFactor + (req.energyGeneration - threshold) * lowFactor;
|
4152
|
+
}
|
4153
|
+
return Number(value.toFixed(calculator_1.PRECISION));
|
4154
|
+
}
|
4155
|
+
}
|
4156
|
+
solarCal.SolarCal = SolarCal;
|
4157
|
+
return solarCal;
|
4158
|
+
}
|
4159
|
+
|
4160
|
+
var agricultureCreationRequest = {};
|
4161
|
+
|
4162
|
+
var agricultureConstants = {};
|
4163
|
+
|
4164
|
+
Object.defineProperty(agricultureConstants, "__esModule", { value: true });
|
4165
|
+
agricultureConstants.AgricultureConstants = void 0;
|
4166
|
+
class AgricultureConstants {
|
4167
|
+
constructor() {
|
4168
|
+
this.emissionFactor = 0.046;
|
4169
|
+
this.emissionFactorUnit = "tCO2e/ha/d";
|
4170
|
+
}
|
4171
|
+
}
|
4172
|
+
agricultureConstants.AgricultureConstants = AgricultureConstants;
|
4173
|
+
|
4174
|
+
Object.defineProperty(agricultureCreationRequest, "__esModule", { value: true });
|
4175
|
+
agricultureCreationRequest.AgricultureCreationRequest = void 0;
|
4176
|
+
const agricultureConstants_1 = agricultureConstants;
|
4177
|
+
class AgricultureCreationRequest {
|
4178
|
+
constructor() {
|
4179
|
+
this.agricultureConstants = new agricultureConstants_1.AgricultureConstants();
|
4180
|
+
}
|
4181
|
+
}
|
4182
|
+
agricultureCreationRequest.AgricultureCreationRequest = AgricultureCreationRequest;
|
4183
|
+
|
4184
|
+
var solarCreationRequest = {};
|
4185
|
+
|
4186
|
+
var solarConstants = {};
|
4187
|
+
|
4188
|
+
Object.defineProperty(solarConstants, "__esModule", { value: true });
|
4189
|
+
solarConstants.SolarConstants = void 0;
|
4190
|
+
class SolarConstants {
|
4191
|
+
constructor() {
|
4192
|
+
this.highEmissionFactor = 6.8;
|
4193
|
+
this.lowEmissionFactor = 1.3;
|
4194
|
+
this.emissionFactorUnit = "tCO2/MWh";
|
4195
|
+
this.thresholdUnit = "kWh/year";
|
4196
|
+
this.buildingTypes = {
|
4197
|
+
Household: 55,
|
4198
|
+
HealthCenter: 825,
|
4199
|
+
Dispensary: 825,
|
4200
|
+
School: 275,
|
4201
|
+
PrimarySchool: 275,
|
4202
|
+
SecondarySchool: 275,
|
4203
|
+
PublicAdministration: 55,
|
4204
|
+
TradingPlace: 825,
|
4205
|
+
BusStop: 200,
|
4206
|
+
};
|
4207
|
+
}
|
4208
|
+
}
|
4209
|
+
solarConstants.SolarConstants = SolarConstants;
|
4210
|
+
|
4211
|
+
Object.defineProperty(solarCreationRequest, "__esModule", { value: true });
|
4212
|
+
solarCreationRequest.SolarCreationRequest = void 0;
|
4213
|
+
const solarConstants_1 = solarConstants;
|
4214
|
+
class SolarCreationRequest {
|
4215
|
+
constructor() {
|
4216
|
+
this.solarConstants = new solarConstants_1.SolarConstants();
|
4217
|
+
}
|
4218
|
+
}
|
4219
|
+
solarCreationRequest.SolarCreationRequest = SolarCreationRequest;
|
4220
|
+
|
4221
|
+
var hasRequiredCalculator;
|
4222
|
+
|
4223
|
+
function requireCalculator () {
|
4224
|
+
if (hasRequiredCalculator) return calculator;
|
4225
|
+
hasRequiredCalculator = 1;
|
4226
|
+
Object.defineProperty(calculator, "__esModule", { value: true });
|
4227
|
+
calculator.calculateCredit = calculator.PRECISION = void 0;
|
4228
|
+
const agricultureCal_1 = requireAgricultureCal();
|
4229
|
+
const solarCal_1 = requireSolarCal();
|
4230
|
+
const agricultureCreationRequest_1 = agricultureCreationRequest;
|
4231
|
+
const solarCreationRequest_1 = solarCreationRequest;
|
4232
|
+
calculator.PRECISION = 2;
|
4233
|
+
const calculateCredit = (request) => {
|
4234
|
+
if (request instanceof agricultureCreationRequest_1.AgricultureCreationRequest) {
|
4235
|
+
return agricultureCal_1.AgricultureCal.calculate(request);
|
4236
|
+
}
|
4237
|
+
else if (request instanceof solarCreationRequest_1.SolarCreationRequest) {
|
4238
|
+
return solarCal_1.SolarCal.calculate(request);
|
4239
|
+
}
|
4240
|
+
else {
|
4241
|
+
throw Error("Not implemented");
|
4242
|
+
}
|
4243
|
+
};
|
4244
|
+
calculator.calculateCredit = calculateCredit;
|
4245
|
+
return calculator;
|
4246
|
+
}
|
4247
|
+
|
4248
|
+
var building_type_enum = {};
|
4249
|
+
|
4250
|
+
(function (exports) {
|
4251
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4252
|
+
exports.BuildingType = void 0;
|
4253
|
+
(function (BuildingType) {
|
4254
|
+
BuildingType["Household"] = "Household";
|
4255
|
+
BuildingType["HealthCenter"] = "HealthCenter";
|
4256
|
+
BuildingType["Dispensary"] = "Dispensary";
|
4257
|
+
BuildingType["School"] = "School";
|
4258
|
+
BuildingType["PrimarySchool"] = "PrimarySchool";
|
4259
|
+
BuildingType["SecondarySchool"] = "SecondarySchool";
|
4260
|
+
BuildingType["PublicAdministration"] = "PublicAdministration";
|
4261
|
+
BuildingType["TradingPlace"] = "TradingPlace";
|
4262
|
+
BuildingType["BusStop"] = "BusStop";
|
4263
|
+
})(exports.BuildingType || (exports.BuildingType = {}));
|
4264
|
+
} (building_type_enum));
|
4265
|
+
|
4266
|
+
(function (exports) {
|
4267
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4268
|
+
exports.BuildingType = exports.SolarConstants = exports.AgricultureConstants = exports.AgricultureCreationRequest = exports.SolarCreationRequest = exports.calculateCredit = void 0;
|
4269
|
+
const calculator_1 = requireCalculator();
|
4270
|
+
Object.defineProperty(exports, "calculateCredit", { enumerable: true, get: function () { return calculator_1.calculateCredit; } });
|
4271
|
+
const agricultureConstants_1 = agricultureConstants;
|
4272
|
+
Object.defineProperty(exports, "AgricultureConstants", { enumerable: true, get: function () { return agricultureConstants_1.AgricultureConstants; } });
|
4273
|
+
const building_type_enum_1 = building_type_enum;
|
4274
|
+
Object.defineProperty(exports, "BuildingType", { enumerable: true, get: function () { return building_type_enum_1.BuildingType; } });
|
4275
|
+
const solarConstants_1 = solarConstants;
|
4276
|
+
Object.defineProperty(exports, "SolarConstants", { enumerable: true, get: function () { return solarConstants_1.SolarConstants; } });
|
4277
|
+
const agricultureCreationRequest_1 = agricultureCreationRequest;
|
4278
|
+
Object.defineProperty(exports, "AgricultureCreationRequest", { enumerable: true, get: function () { return agricultureCreationRequest_1.AgricultureCreationRequest; } });
|
4279
|
+
const solarCreationRequest_1 = solarCreationRequest;
|
4280
|
+
Object.defineProperty(exports, "SolarCreationRequest", { enumerable: true, get: function () { return solarCreationRequest_1.SolarCreationRequest; } });
|
4281
|
+
} (cjs));
|
4282
|
+
|
4283
|
+
var consumerGroupList = [
|
4284
|
+
{ value: cjs.BuildingType.Household.valueOf(), label: "Household" },
|
4285
|
+
{ value: cjs.BuildingType.HealthCenter.valueOf(), label: "Health Center" },
|
4286
|
+
{ value: cjs.BuildingType.Dispensary.valueOf(), label: "Dispensary" },
|
4287
|
+
{ value: cjs.BuildingType.School.valueOf(), label: "School" },
|
4288
|
+
{ value: cjs.BuildingType.PrimarySchool.valueOf(), label: "Primary School" },
|
4289
|
+
{ value: cjs.BuildingType.SecondarySchool.valueOf(), label: "Secondary School" },
|
4290
|
+
{
|
4291
|
+
value: cjs.BuildingType.PublicAdministration.valueOf(),
|
4292
|
+
label: "Public Administration",
|
4293
|
+
},
|
4294
|
+
{ value: cjs.BuildingType.TradingPlace.valueOf(), label: "Trading Place" },
|
4295
|
+
{ value: cjs.BuildingType.BusStop.valueOf(), label: "Bus Stop" },
|
4296
|
+
];
|
4297
|
+
|
4298
|
+
exports.Sector = void 0;
|
4299
|
+
(function (Sector) {
|
4300
|
+
Sector["Energy"] = "Energy";
|
4301
|
+
Sector["Health"] = "Health";
|
4302
|
+
Sector["Education"] = "Education";
|
4303
|
+
Sector["Transport"] = "Transport";
|
4304
|
+
Sector["Manufacturing"] = "Manufacturing";
|
4305
|
+
Sector["Hospitality"] = "Hospitality";
|
4306
|
+
Sector["Forestry"] = "Forestry";
|
4307
|
+
Sector["Waste"] = "Waste";
|
4308
|
+
Sector["Agriculture"] = "Agriculture";
|
4309
|
+
Sector["Other"] = "Other";
|
4310
|
+
})(exports.Sector || (exports.Sector = {}));
|
4311
|
+
|
4312
|
+
exports.RadioButtonStatus = void 0;
|
4313
|
+
(function (RadioButtonStatus) {
|
4314
|
+
RadioButtonStatus["YES"] = "YES";
|
4315
|
+
RadioButtonStatus["NO"] = "NO";
|
4316
|
+
RadioButtonStatus["NA"] = "N/A";
|
4317
|
+
})(exports.RadioButtonStatus || (exports.RadioButtonStatus = {}));
|
4318
|
+
exports.RadioButtonStatus2 = void 0;
|
4319
|
+
(function (RadioButtonStatus2) {
|
4320
|
+
RadioButtonStatus2["YES"] = "YES";
|
4321
|
+
RadioButtonStatus2["NO"] = "NO";
|
4322
|
+
RadioButtonStatus2["MAYBE"] = "MAYBE";
|
4323
|
+
})(exports.RadioButtonStatus2 || (exports.RadioButtonStatus2 = {}));
|
4324
|
+
exports.Titles = void 0;
|
4325
|
+
(function (Titles) {
|
4326
|
+
Titles["Mr"] = "Mr";
|
4327
|
+
Titles["Mrs"] = "Mrs";
|
4328
|
+
})(exports.Titles || (exports.Titles = {}));
|
4329
|
+
var titleList = [
|
4330
|
+
{ value: exports.Titles.Mr, label: "Mr" },
|
4331
|
+
{ value: exports.Titles.Mrs, label: "Mrs" },
|
4332
|
+
];
|
4333
|
+
exports.FormElementType = void 0;
|
4334
|
+
(function (FormElementType) {
|
4335
|
+
FormElementType[FormElementType["Radio"] = 0] = "Radio";
|
4336
|
+
FormElementType[FormElementType["Label"] = 1] = "Label";
|
4337
|
+
FormElementType[FormElementType["Input"] = 2] = "Input";
|
4338
|
+
})(exports.FormElementType || (exports.FormElementType = {}));
|
4339
|
+
|
4340
|
+
exports.SdgGoals = void 0;
|
4341
|
+
(function (SdgGoals) {
|
4342
|
+
SdgGoals["noPoverty"] = "No Poverty";
|
4343
|
+
SdgGoals["zeroHunger"] = "Zero Hunger";
|
4344
|
+
SdgGoals["gdHealth"] = "Good Health and Well-being";
|
4345
|
+
SdgGoals["qualityEducation"] = "Quality Education";
|
4346
|
+
SdgGoals["genderEq"] = "Gender Equality";
|
4347
|
+
SdgGoals["cleanWatr"] = "Clean Water and Sanitation";
|
4348
|
+
SdgGoals["affEnergy"] = "Affordable and Clean Energy";
|
4349
|
+
SdgGoals["decentWork"] = "Decent Work and Economic Growth";
|
4350
|
+
SdgGoals["industry"] = "Industry, Innovation and Infrastructure";
|
4351
|
+
SdgGoals["reducedInEq"] = "Reduced Inequalities";
|
4352
|
+
SdgGoals["sustainableCities"] = "Sustainable Cities and Communities";
|
4353
|
+
SdgGoals["responsibleConsumption"] = "Responsible Consumption and Production";
|
4354
|
+
SdgGoals["climateAction"] = "Climate Action";
|
4355
|
+
SdgGoals["lifeBelowWater"] = "Life Below Water";
|
4356
|
+
SdgGoals["lifeOnLand"] = "Life On Land";
|
4357
|
+
SdgGoals["peace"] = "Peace, Justice and Strong Institutions";
|
4358
|
+
SdgGoals["partnership"] = "Partnerships for the Goals";
|
4359
|
+
})(exports.SdgGoals || (exports.SdgGoals = {}));
|
4360
|
+
|
4361
|
+
exports.ConfigurationSettingsType = void 0;
|
4362
|
+
(function (ConfigurationSettingsType) {
|
4363
|
+
ConfigurationSettingsType[ConfigurationSettingsType["isTransferFrozen"] = 0] = "isTransferFrozen";
|
4364
|
+
})(exports.ConfigurationSettingsType || (exports.ConfigurationSettingsType = {}));
|
4365
|
+
|
4366
|
+
exports.MapTypes = void 0;
|
4367
|
+
(function (MapTypes) {
|
4368
|
+
MapTypes["Mapbox"] = "Mapbox";
|
4369
|
+
MapTypes["None"] = "None";
|
4370
|
+
})(exports.MapTypes || (exports.MapTypes = {}));
|
4371
|
+
|
4372
|
+
var BaseEntity = /** @class */ (function () {
|
4373
|
+
function BaseEntity() {
|
4374
|
+
}
|
4375
|
+
return BaseEntity;
|
4376
|
+
}());
|
4377
|
+
|
4378
|
+
var ProgrammeTransfer = /** @class */ (function () {
|
4379
|
+
function ProgrammeTransfer() {
|
4380
|
+
}
|
4381
|
+
return ProgrammeTransfer;
|
4382
|
+
}());
|
4383
|
+
|
4384
|
+
var User = /** @class */ (function () {
|
4385
|
+
function User() {
|
4386
|
+
}
|
4387
|
+
return User;
|
4388
|
+
}());
|
4389
|
+
|
4390
|
+
var ProgrammeEntity = /** @class */ (function () {
|
4391
|
+
function ProgrammeEntity() {
|
4392
|
+
}
|
4393
|
+
return ProgrammeEntity;
|
4394
|
+
}());
|
4395
|
+
|
4396
|
+
var AddNewCompanyComponent = function (props) {
|
4397
|
+
var _a;
|
4398
|
+
var t = props.t, onNavigateToCompanyManagement = props.onNavigateToCompanyManagement, maximumImageSize = props.maximumImageSize, useConnection = props.useConnection, useUserContext = props.useUserContext, useLocation = props.useLocation, regionField = props.regionField;
|
4399
|
+
var formOne = antd.Form.useForm()[0];
|
4400
|
+
var formTwo = antd.Form.useForm()[0];
|
4401
|
+
var _b = React.useState(), stepOneData = _b[0], setStepOneData = _b[1];
|
4402
|
+
var _c = React.useState(false), loading = _c[0], setLoading = _c[1];
|
4403
|
+
var contactNoInput = React.useState()[0];
|
4404
|
+
var _d = React.useState(0), current = _d[0], setCurrent = _d[1];
|
4405
|
+
var _e = React.useState(false), isUpdate = _e[0], setIsUpdate = _e[1];
|
4406
|
+
var _f = useConnection(), put = _f.put, get = _f.get, post = _f.post;
|
4407
|
+
var _g = useUserContext(), setUserInfo = _g.setUserInfo, userInfoState = _g.userInfoState;
|
4408
|
+
var state = useLocation().state;
|
4409
|
+
var _h = React.useState([]), fileList = _h[0], setFileList = _h[1];
|
4410
|
+
var _j = React.useState([]), countries = _j[0], setCountries = _j[1];
|
4411
|
+
var _k = React.useState(false), loadingList = _k[0], setLoadingList = _k[1];
|
4412
|
+
var _l = React.useState([]), regionsList = _l[0], setRegionsList = _l[1];
|
4413
|
+
var _m = React.useState((_a = state === null || state === void 0 ? void 0 : state.record) === null || _a === void 0 ? void 0 : _a.companyRole), companyRole = _m[0], setCompanyRole = _m[1];
|
4414
|
+
var getCountryList = function () { return __awaiter(void 0, void 0, void 0, function () {
|
4415
|
+
var response, alpha2Names;
|
4416
|
+
return __generator(this, function (_a) {
|
4417
|
+
switch (_a.label) {
|
4418
|
+
case 0: return [4 /*yield*/, get("national/organisation/countries")];
|
4419
|
+
case 1:
|
4420
|
+
response = _a.sent();
|
4421
|
+
if (response.data) {
|
4422
|
+
alpha2Names = response.data.map(function (item) {
|
4423
|
+
return item.alpha2;
|
4424
|
+
});
|
4425
|
+
setCountries(alpha2Names);
|
4426
|
+
}
|
4427
|
+
return [2 /*return*/];
|
4428
|
+
}
|
4429
|
+
});
|
4430
|
+
}); };
|
4431
|
+
var getRegionList = function () { return __awaiter(void 0, void 0, void 0, function () {
|
4432
|
+
var response, regionNames, error_1;
|
4433
|
+
return __generator(this, function (_a) {
|
4434
|
+
switch (_a.label) {
|
4435
|
+
case 0:
|
4436
|
+
setLoadingList(true);
|
4437
|
+
_a.label = 1;
|
4438
|
+
case 1:
|
4439
|
+
_a.trys.push([1, 3, 4, 5]);
|
4440
|
+
return [4 /*yield*/, post("national/organisation/regions", {
|
4441
|
+
page: 1,
|
4442
|
+
size: 100,
|
4443
|
+
filterAnd: [
|
4444
|
+
{
|
4445
|
+
key: "lang",
|
4446
|
+
operation: "=",
|
4447
|
+
value: "en",
|
4448
|
+
},
|
4449
|
+
],
|
4450
|
+
})];
|
4451
|
+
case 2:
|
4452
|
+
response = _a.sent();
|
4453
|
+
if (response.data) {
|
4454
|
+
regionNames = response.data.map(function (item) { return item.regionName; });
|
4455
|
+
setRegionsList(__spreadArray([t("national")], regionNames, true));
|
4456
|
+
}
|
4457
|
+
return [3 /*break*/, 5];
|
4458
|
+
case 3:
|
4459
|
+
error_1 = _a.sent();
|
4460
|
+
console.log("Error in getting regions list", error_1);
|
4461
|
+
return [3 /*break*/, 5];
|
4462
|
+
case 4:
|
4463
|
+
setLoadingList(false);
|
4464
|
+
return [7 /*endfinally*/];
|
4465
|
+
case 5: return [2 /*return*/];
|
4466
|
+
}
|
4467
|
+
});
|
4468
|
+
}); };
|
4469
|
+
React.useEffect(function () {
|
4470
|
+
var _a, _b, _c;
|
4471
|
+
setIsUpdate((state === null || state === void 0 ? void 0 : state.record) ? true : false);
|
4472
|
+
getCountryList();
|
4473
|
+
getRegionList();
|
4474
|
+
if ((_a = state === null || state === void 0 ? void 0 : state.record) === null || _a === void 0 ? void 0 : _a.logo) {
|
4475
|
+
setFileList([
|
4476
|
+
{
|
4477
|
+
uid: "1",
|
4478
|
+
name: "".concat((_b = state === null || state === void 0 ? void 0 : state.record) === null || _b === void 0 ? void 0 : _b.name, ".png"),
|
4479
|
+
status: "done",
|
4480
|
+
url: (_c = state === null || state === void 0 ? void 0 : state.record) === null || _c === void 0 ? void 0 : _c.logo,
|
4481
|
+
type: "image/png",
|
4482
|
+
},
|
4483
|
+
]);
|
4484
|
+
}
|
4485
|
+
}, []);
|
4486
|
+
var normFile = function (e) {
|
4487
|
+
if (Array.isArray(e)) {
|
4488
|
+
return e;
|
4489
|
+
}
|
4490
|
+
return e === null || e === void 0 ? void 0 : e.fileList;
|
4491
|
+
};
|
4492
|
+
var nextOne = function (val) {
|
4493
|
+
setCurrent(current + 1);
|
4494
|
+
setStepOneData(val);
|
4495
|
+
};
|
4496
|
+
var prevOne = function () {
|
4497
|
+
setCurrent(current - 1);
|
4498
|
+
};
|
4499
|
+
var onFinishStepOne = function (values) {
|
4500
|
+
nextOne(values);
|
4501
|
+
};
|
4502
|
+
var onChangeRegion = function (values) {
|
4503
|
+
if (values.includes(t("national"))) {
|
4504
|
+
var buyerCountryValues = regionsList;
|
4505
|
+
var newBuyerValues = buyerCountryValues === null || buyerCountryValues === void 0 ? void 0 : buyerCountryValues.filter(function (item) { return item !== t("national"); });
|
4506
|
+
formOne.setFieldValue("regions", __spreadArray([], newBuyerValues, true));
|
4507
|
+
}
|
1172
4508
|
};
|
1173
4509
|
var onFinishStepTwo = function (values) { return __awaiter(void 0, void 0, void 0, function () {
|
1174
4510
|
var requestData, logoBase64, logoUrls, response, error_2;
|
@@ -1268,11 +4604,11 @@ var AddNewCompanyComponent = function (props) {
|
|
1268
4604
|
companyRole: (_d = state === null || state === void 0 ? void 0 : state.record) === null || _d === void 0 ? void 0 : _d.companyRole,
|
1269
4605
|
};
|
1270
4606
|
}
|
1271
|
-
if (((_e = state === null || state === void 0 ? void 0 : state.record) === null || _e === void 0 ? void 0 : _e.companyRole) !== CompanyRole.GOVERNMENT &&
|
1272
|
-
((_f = state === null || state === void 0 ? void 0 : state.record) === null || _f === void 0 ? void 0 : _f.companyRole) !== CompanyRole.MINISTRY) {
|
4607
|
+
if (((_e = state === null || state === void 0 ? void 0 : state.record) === null || _e === void 0 ? void 0 : _e.companyRole) !== exports.CompanyRole.GOVERNMENT &&
|
4608
|
+
((_f = state === null || state === void 0 ? void 0 : state.record) === null || _f === void 0 ? void 0 : _f.companyRole) !== exports.CompanyRole.MINISTRY) {
|
1273
4609
|
values.taxId = formOneValues.taxId;
|
1274
4610
|
}
|
1275
|
-
if (((_g = state === null || state === void 0 ? void 0 : state.record) === null || _g === void 0 ? void 0 : _g.companyRole) === CompanyRole.MINISTRY) {
|
4611
|
+
if (((_g = state === null || state === void 0 ? void 0 : state.record) === null || _g === void 0 ? void 0 : _g.companyRole) === exports.CompanyRole.MINISTRY) {
|
1276
4612
|
values.sectoralScope = formOneValues.sectoralScope;
|
1277
4613
|
values.nameOfMinister = formOneValues.nameOfMinister;
|
1278
4614
|
}
|
@@ -1330,11 +4666,11 @@ var AddNewCompanyComponent = function (props) {
|
|
1330
4666
|
};
|
1331
4667
|
var CompanyDetailsForm = function () {
|
1332
4668
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
1333
|
-
var companyRoleClassName = companyRole === CompanyRole.CERTIFIER
|
4669
|
+
var companyRoleClassName = companyRole === exports.CompanyRole.CERTIFIER
|
1334
4670
|
? "certifier"
|
1335
|
-
: companyRole === CompanyRole.PROGRAMME_DEVELOPER
|
4671
|
+
: companyRole === exports.CompanyRole.PROGRAMME_DEVELOPER
|
1336
4672
|
? "dev"
|
1337
|
-
: companyRole === CompanyRole.MINISTRY
|
4673
|
+
: companyRole === exports.CompanyRole.MINISTRY
|
1338
4674
|
? "minister"
|
1339
4675
|
: "gov";
|
1340
4676
|
return (React.createElement("div", { className: "company-details-form-container" },
|
@@ -1363,10 +4699,10 @@ var AddNewCompanyComponent = function (props) {
|
|
1363
4699
|
},
|
1364
4700
|
] },
|
1365
4701
|
React.createElement(antd.Input, { size: "large" })),
|
1366
|
-
companyRole !== CompanyRole.MINISTRY
|
4702
|
+
companyRole !== exports.CompanyRole.MINISTRY
|
1367
4703
|
? (!isUpdate ||
|
1368
4704
|
(isUpdate &&
|
1369
|
-
companyRole !== CompanyRole.GOVERNMENT)) && (React.createElement(antd.Form.Item, { label: "Tax ID", initialValue: (_b = state === null || state === void 0 ? void 0 : state.record) === null || _b === void 0 ? void 0 : _b.taxId, name: "taxId", rules: [
|
4705
|
+
companyRole !== exports.CompanyRole.GOVERNMENT)) && (React.createElement(antd.Form.Item, { label: "Tax ID", initialValue: (_b = state === null || state === void 0 ? void 0 : state.record) === null || _b === void 0 ? void 0 : _b.taxId, name: "taxId", rules: [
|
1370
4706
|
{
|
1371
4707
|
required: true,
|
1372
4708
|
message: "",
|
@@ -1479,7 +4815,7 @@ var AddNewCompanyComponent = function (props) {
|
|
1479
4815
|
return false;
|
1480
4816
|
}, className: "logo-upload-section", name: "logo", action: "/upload.do", listType: "picture", multiple: false, defaultFileList: fileList, maxCount: 1 },
|
1481
4817
|
React.createElement(antd.Button, { size: "large", icon: React.createElement(icons.UploadOutlined, null) }, "Upload"))),
|
1482
|
-
companyRole === CompanyRole.MINISTRY && (React.createElement(antd.Form.Item, { name: "address", label: "Address", initialValue: (_f = state === null || state === void 0 ? void 0 : state.record) === null || _f === void 0 ? void 0 : _f.address, rules: [
|
4818
|
+
companyRole === exports.CompanyRole.MINISTRY && (React.createElement(antd.Form.Item, { name: "address", label: "Address", initialValue: (_f = state === null || state === void 0 ? void 0 : state.record) === null || _f === void 0 ? void 0 : _f.address, rules: [
|
1483
4819
|
{ required: true, message: "" },
|
1484
4820
|
{
|
1485
4821
|
validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
|
@@ -1506,11 +4842,11 @@ var AddNewCompanyComponent = function (props) {
|
|
1506
4842
|
] },
|
1507
4843
|
React.createElement(antd.Radio.Group, { size: "large", disabled: isUpdate, onChange: onChangeCompanyRole }, isUpdate ? (React.createElement("div", { className: "".concat(companyRoleClassName, "-radio-container") },
|
1508
4844
|
React.createElement(antd.Radio.Button, { className: companyRoleClassName, value: companyRole },
|
1509
|
-
companyRole === CompanyRole.CERTIFIER ? (React.createElement(icons.SafetyOutlined, { className: "role-icons" })) : companyRole ===
|
1510
|
-
CompanyRole.PROGRAMME_DEVELOPER ? (React.createElement(icons.ExperimentOutlined, { className: "role-icons" })) : companyRole === CompanyRole.MINISTRY ? (React.createElement(icons.AuditOutlined, { className: "role-icons" })) : (React.createElement(icons.BankOutlined, { className: "role-icons" })),
|
4845
|
+
companyRole === exports.CompanyRole.CERTIFIER ? (React.createElement(icons.SafetyOutlined, { className: "role-icons" })) : companyRole ===
|
4846
|
+
exports.CompanyRole.PROGRAMME_DEVELOPER ? (React.createElement(icons.ExperimentOutlined, { className: "role-icons" })) : companyRole === exports.CompanyRole.MINISTRY ? (React.createElement(icons.AuditOutlined, { className: "role-icons" })) : (React.createElement(icons.BankOutlined, { className: "role-icons" })),
|
1511
4847
|
companyRole))) : (React.createElement(React.Fragment, null,
|
1512
4848
|
React.createElement("div", { className: "certifier-radio-container", style: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) ===
|
1513
|
-
CompanyRole.MINISTRY
|
4849
|
+
exports.CompanyRole.MINISTRY
|
1514
4850
|
? {
|
1515
4851
|
width: "45%",
|
1516
4852
|
}
|
@@ -1520,7 +4856,7 @@ var AddNewCompanyComponent = function (props) {
|
|
1520
4856
|
React.createElement(icons.SafetyOutlined, { className: "role-icons" }),
|
1521
4857
|
"Certifier"))),
|
1522
4858
|
React.createElement("div", { className: "dev-radio-container", style: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) ===
|
1523
|
-
CompanyRole.MINISTRY
|
4859
|
+
exports.CompanyRole.MINISTRY
|
1524
4860
|
? {
|
1525
4861
|
width: "45%",
|
1526
4862
|
}
|
@@ -1530,12 +4866,12 @@ var AddNewCompanyComponent = function (props) {
|
|
1530
4866
|
React.createElement(icons.ExperimentOutlined, { className: "role-icons" }),
|
1531
4867
|
"Developer"))),
|
1532
4868
|
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) !==
|
1533
|
-
CompanyRole.MINISTRY && (React.createElement("div", { className: "minister-radio-container" },
|
4869
|
+
exports.CompanyRole.MINISTRY && (React.createElement("div", { className: "minister-radio-container" },
|
1534
4870
|
React.createElement(antd.Tooltip, { placement: "top", title: "Permitted to perform all programme-related actions within the Ministry" },
|
1535
4871
|
React.createElement(antd.Radio.Button, { className: "minister", value: "Ministry" },
|
1536
4872
|
React.createElement(icons.AuditOutlined, { className: "role-icons" }),
|
1537
4873
|
"Ministry")))))))),
|
1538
|
-
companyRole === CompanyRole.MINISTRY && (React.createElement(antd.Form.Item, { label: "Name of the Minister", name: "nameOfMinister", initialValue: (_g = state === null || state === void 0 ? void 0 : state.record) === null || _g === void 0 ? void 0 : _g.nameOfMinister, rules: [
|
4874
|
+
companyRole === exports.CompanyRole.MINISTRY && (React.createElement(antd.Form.Item, { label: "Name of the Minister", name: "nameOfMinister", initialValue: (_g = state === null || state === void 0 ? void 0 : state.record) === null || _g === void 0 ? void 0 : _g.nameOfMinister, rules: [
|
1539
4875
|
{
|
1540
4876
|
required: true,
|
1541
4877
|
message: "",
|
@@ -1555,7 +4891,7 @@ var AddNewCompanyComponent = function (props) {
|
|
1555
4891
|
},
|
1556
4892
|
] },
|
1557
4893
|
React.createElement(antd.Input, { size: "large" }))),
|
1558
|
-
companyRole === CompanyRole.MINISTRY && (React.createElement(antd.Form.Item, { label: "Sectoral Scope", name: "sectoralScope", rules: [
|
4894
|
+
companyRole === exports.CompanyRole.MINISTRY && (React.createElement(antd.Form.Item, { label: "Sectoral Scope", name: "sectoralScope", rules: [
|
1559
4895
|
{
|
1560
4896
|
required: true,
|
1561
4897
|
message: "Sectoral Scope ".concat(t("isRequired")),
|
@@ -1603,7 +4939,7 @@ var AddNewCompanyComponent = function (props) {
|
|
1603
4939
|
},
|
1604
4940
|
] },
|
1605
4941
|
React.createElement(antd.Select, { mode: "multiple", size: "large", maxTagCount: 2, onChange: onChangeRegion, loading: loadingList, allowClear: true }, regionsList.map(function (region) { return (React.createElement(antd.Select.Option, { value: region }, region)); })))),
|
1606
|
-
companyRole !== CompanyRole.MINISTRY && (React.createElement(antd.Form.Item, { name: "address", label: "Address", initialValue: (_l = state === null || state === void 0 ? void 0 : state.record) === null || _l === void 0 ? void 0 : _l.address, rules: [
|
4942
|
+
companyRole !== exports.CompanyRole.MINISTRY && (React.createElement(antd.Form.Item, { name: "address", label: "Address", initialValue: (_l = state === null || state === void 0 ? void 0 : state.record) === null || _l === void 0 ? void 0 : _l.address, rules: [
|
1607
4943
|
{ required: true, message: "" },
|
1608
4944
|
{
|
1609
4945
|
validator: function (rule, value) { return __awaiter(void 0, void 0, void 0, function () {
|
@@ -1954,7 +5290,7 @@ var CompanyProfileComponent = function (props) {
|
|
1954
5290
|
React.createElement(antd.Col, { span: 12, className: "field-key" }, t("companyProfile:companyRole")),
|
1955
5291
|
React.createElement(antd.Col, { span: 12, className: "field-value" },
|
1956
5292
|
React.createElement(CompanyRoleIcon, { role: companyDetails.companyRole }))),
|
1957
|
-
(companyDetails === null || companyDetails === void 0 ? void 0 : companyDetails.companyRole) === CompanyRole.MINISTRY && (React.createElement(React.Fragment, null,
|
5293
|
+
(companyDetails === null || companyDetails === void 0 ? void 0 : companyDetails.companyRole) === exports.CompanyRole.MINISTRY && (React.createElement(React.Fragment, null,
|
1958
5294
|
React.createElement(antd.Row, { className: "field" },
|
1959
5295
|
React.createElement(antd.Col, { span: 12, className: "field-key" }, t("companyProfile:ministerName")),
|
1960
5296
|
React.createElement(antd.Col, { span: 12, className: "field-value" }, companyDetails.nameOfMinister
|
@@ -2304,7 +5640,7 @@ var ProgrammeManagementComponent = function (props) {
|
|
2304
5640
|
case 2:
|
2305
5641
|
response = _g.sent();
|
2306
5642
|
if (response && response.data) {
|
2307
|
-
if (((_a = response === null || response === void 0 ? void 0 : response.data[0]) === null || _a === void 0 ? void 0 : _a.companyRole) === CompanyRole.MINISTRY &&
|
5643
|
+
if (((_a = response === null || response === void 0 ? void 0 : response.data[0]) === null || _a === void 0 ? void 0 : _a.companyRole) === exports.CompanyRole.MINISTRY &&
|
2308
5644
|
((_b = response === null || response === void 0 ? void 0 : response.data[0]) === null || _b === void 0 ? void 0 : _b.company) &&
|
2309
5645
|
((_d = (_c = response === null || response === void 0 ? void 0 : response.data[0]) === null || _c === void 0 ? void 0 : _c.company) === null || _d === void 0 ? void 0 : _d.sectoralScope)) {
|
2310
5646
|
setMinistrySectoralScope((_f = (_e = response === null || response === void 0 ? void 0 : response.data[0]) === null || _e === void 0 ? void 0 : _e.company) === null || _f === void 0 ? void 0 : _f.sectoralScope);
|
@@ -2346,7 +5682,7 @@ var ProgrammeManagementComponent = function (props) {
|
|
2346
5682
|
ministryLevelFilter,
|
2347
5683
|
]);
|
2348
5684
|
React.useEffect(function () {
|
2349
|
-
if ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.MINISTRY) {
|
5685
|
+
if ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY) {
|
2350
5686
|
getUserDetails();
|
2351
5687
|
}
|
2352
5688
|
}, []);
|
@@ -2382,7 +5718,7 @@ var ProgrammeManagementComponent = function (props) {
|
|
2382
5718
|
React.createElement("div", { className: "filter-section" },
|
2383
5719
|
React.createElement("div", { className: "search-filter" },
|
2384
5720
|
React.createElement(antd.Checkbox, { className: "label", onChange: function (v) {
|
2385
|
-
if (userInfoState.companyRole === CompanyRole.MINISTRY) {
|
5721
|
+
if (userInfoState.companyRole === exports.CompanyRole.MINISTRY) {
|
2386
5722
|
if (v.target.checked) {
|
2387
5723
|
setMinistryLevelFilter(true);
|
2388
5724
|
}
|
@@ -2399,7 +5735,7 @@ var ProgrammeManagementComponent = function (props) {
|
|
2399
5735
|
}
|
2400
5736
|
: undefined);
|
2401
5737
|
}
|
2402
|
-
} }, userInfoState.companyRole === CompanyRole.MINISTRY
|
5738
|
+
} }, userInfoState.companyRole === exports.CompanyRole.MINISTRY
|
2403
5739
|
? t("view:ministryLevel")
|
2404
5740
|
: t("view:seeMine"))),
|
2405
5741
|
React.createElement("div", { className: "search-bar" },
|
@@ -2632,7 +5968,7 @@ var ProgrammeTransferForm = function (props) {
|
|
2632
5968
|
userCompanyId !== Number(programme.companyId[index])) ||
|
2633
5969
|
(!toCompanyDefault &&
|
2634
5970
|
(userCompanyId === Number(programme.companyId[index]) ||
|
2635
|
-
companyRole === CompanyRole.GOVERNMENT))) &&
|
5971
|
+
companyRole === exports.CompanyRole.GOVERNMENT))) &&
|
2636
5972
|
parseInt(companies[Number(programme.companyId[index])].state) ===
|
2637
5973
|
CompanyState.ACTIVE.valueOf()) {
|
2638
5974
|
var companyAvailableTotal = ((programme.creditBalance -
|
@@ -3975,7 +7311,7 @@ var ProgrammeViewComponent = function (props) {
|
|
3975
7311
|
var actionBtns = [];
|
3976
7312
|
if ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.userRole) !== "ViewOnly") {
|
3977
7313
|
if (data.currentStage.toString() === "AwaitingAuthorization") {
|
3978
|
-
if ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT) {
|
7314
|
+
if ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT) {
|
3979
7315
|
actionBtns.push(React.createElement(antd.Button, { danger: true, onClick: function () {
|
3980
7316
|
setActionInfo({
|
3981
7317
|
action: "Reject",
|
@@ -4008,7 +7344,7 @@ var ProgrammeViewComponent = function (props) {
|
|
4008
7344
|
}
|
4009
7345
|
else if (data.currentStage.toString() !== exports.ProgrammeStage.Rejected &&
|
4010
7346
|
Number(data.creditEst) > Number(data.creditIssued)) {
|
4011
|
-
if ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT) {
|
7347
|
+
if ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT) {
|
4012
7348
|
if (Number(data.creditEst) > Number(data.creditIssued)) {
|
4013
7349
|
actionBtns.push(React.createElement(antd.Button, { type: "primary", onClick: function () {
|
4014
7350
|
setActionInfo({
|
@@ -4068,7 +7404,7 @@ var ProgrammeViewComponent = function (props) {
|
|
4068
7404
|
if (userInfoState &&
|
4069
7405
|
userInfoState.companyState !== CompanyState.SUSPENDED.valueOf() &&
|
4070
7406
|
data.certifier &&
|
4071
|
-
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.CERTIFIER &&
|
7407
|
+
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.CERTIFIER &&
|
4072
7408
|
!data.certifier.map(function (e) { return e.companyId; }).includes(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyId)) {
|
4073
7409
|
actionBtns.push(React.createElement(antd.Button, { type: "primary", onClick: function () {
|
4074
7410
|
setActionInfo({
|
@@ -4086,11 +7422,11 @@ var ProgrammeViewComponent = function (props) {
|
|
4086
7422
|
userInfoState.companyState !== CompanyState.SUSPENDED.valueOf() &&
|
4087
7423
|
data.certifier &&
|
4088
7424
|
data.certifier.length > 0 &&
|
4089
|
-
(((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.CERTIFIER &&
|
7425
|
+
(((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.CERTIFIER &&
|
4090
7426
|
data.certifier
|
4091
7427
|
.map(function (e) { return e.companyId; })
|
4092
7428
|
.includes(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyId)) ||
|
4093
|
-
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.GOVERNMENT)) {
|
7429
|
+
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.GOVERNMENT)) {
|
4094
7430
|
actionBtns.push(React.createElement(antd.Button, { danger: true, onClick: function () {
|
4095
7431
|
setActionInfo({
|
4096
7432
|
action: "Revoke",
|
@@ -4104,7 +7440,7 @@ var ProgrammeViewComponent = function (props) {
|
|
4104
7440
|
setComment(undefined);
|
4105
7441
|
}, actionBtnText: t("view:revoke"), onFinish: function (body) {
|
4106
7442
|
return onPopupAction(body, "revoke", t("view:successRevokeCertifcate"), put, updateProgrammeData);
|
4107
|
-
}, showCertifiers: userInfoState.companyRole === CompanyRole.GOVERNMENT, t: t })),
|
7443
|
+
}, showCertifiers: userInfoState.companyRole === exports.CompanyRole.GOVERNMENT, t: t })),
|
4108
7444
|
});
|
4109
7445
|
showModal();
|
4110
7446
|
} }, t("view:revoke")));
|
@@ -4302,7 +7638,7 @@ var ProgrammeViewComponent = function (props) {
|
|
4302
7638
|
0 &&
|
4303
7639
|
!isTransferFrozen && (React.createElement("div", null,
|
4304
7640
|
(((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) ===
|
4305
|
-
CompanyRole.GOVERNMENT &&
|
7641
|
+
exports.CompanyRole.GOVERNMENT &&
|
4306
7642
|
!isAllOwnersDeactivated) ||
|
4307
7643
|
(data.companyId
|
4308
7644
|
.map(function (e) { return Number(e); })
|
@@ -4318,7 +7654,7 @@ var ProgrammeViewComponent = function (props) {
|
|
4318
7654
|
remark: true,
|
4319
7655
|
icon: React.createElement(Icon__namespace.Save, null),
|
4320
7656
|
contentComp: (React.createElement(ProgrammeRetireForm, { hideType: (userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) !==
|
4321
|
-
CompanyRole.GOVERNMENT, myCompanyId: userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyId, programme: data, onCancel: function () {
|
7657
|
+
exports.CompanyRole.GOVERNMENT, myCompanyId: userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyId, programme: data, onCancel: function () {
|
4322
7658
|
setOpenModal(false);
|
4323
7659
|
setComment(undefined);
|
4324
7660
|
}, actionBtnText: t("view:retire"), onFinish: function (body) {
|
@@ -5028,7 +8364,7 @@ var UserProfileComponent = function (props) {
|
|
5028
8364
|
React.createElement(antd.Col, { span: 12, className: "field-value" },
|
5029
8365
|
React.createElement(CompanyRoleIcon, { role: organisationDetails.companyRole }))),
|
5030
8366
|
(organisationDetails === null || organisationDetails === void 0 ? void 0 : organisationDetails.companyRole) ===
|
5031
|
-
CompanyRole.MINISTRY && (React.createElement(React.Fragment, null,
|
8367
|
+
exports.CompanyRole.MINISTRY && (React.createElement(React.Fragment, null,
|
5032
8368
|
React.createElement(antd.Row, { className: "field" },
|
5033
8369
|
React.createElement(antd.Col, { span: 12, className: "field-key" }, t("userProfile:ministerName")),
|
5034
8370
|
React.createElement(antd.Col, { span: 12, className: "field-value" }, organisationDetails.nameOfMinister
|
@@ -5132,8 +8468,8 @@ var UserManagementComponent = function (props) {
|
|
5132
8468
|
? item === null || item === void 0 ? void 0 : item.companyRole
|
5133
8469
|
: null;
|
5134
8470
|
return (React.createElement("div", { style: { display: "flex", alignItems: "center" } },
|
5135
|
-
role === CompanyRole.GOVERNMENT ? (React.createElement(RoleIcon, { icon: React.createElement(icons.BankOutlined, null), bg: GovBGColor, color: GovColor })) : role === CompanyRole.CERTIFIER ? (React.createElement(RoleIcon, { icon: React.createElement(icons.SafetyOutlined, null), bg: CertBGColor, color: CertColor })) : role === CompanyRole.MINISTRY ? (React.createElement(RoleIcon, { icon: React.createElement(icons.AuditOutlined, null), bg: MinBGColor, color: MinColor })) : (React.createElement(RoleIcon, { icon: React.createElement(icons.ExperimentOutlined, null), bg: DevBGColor, color: DevColor })),
|
5136
|
-
role === CompanyRole.PROGRAMME_DEVELOPER ? (React.createElement("div", null, "Developer")) : (React.createElement("div", null, role))));
|
8471
|
+
role === exports.CompanyRole.GOVERNMENT ? (React.createElement(RoleIcon, { icon: React.createElement(icons.BankOutlined, null), bg: GovBGColor, color: GovColor })) : role === exports.CompanyRole.CERTIFIER ? (React.createElement(RoleIcon, { icon: React.createElement(icons.SafetyOutlined, null), bg: CertBGColor, color: CertColor })) : role === exports.CompanyRole.MINISTRY ? (React.createElement(RoleIcon, { icon: React.createElement(icons.AuditOutlined, null), bg: MinBGColor, color: MinColor })) : (React.createElement(RoleIcon, { icon: React.createElement(icons.ExperimentOutlined, null), bg: DevBGColor, color: DevColor })),
|
8472
|
+
role === exports.CompanyRole.PROGRAMME_DEVELOPER ? (React.createElement("div", null, "Developer")) : (React.createElement("div", null, role))));
|
5137
8473
|
};
|
5138
8474
|
var deleteUser = function (record) { return __awaiter(void 0, void 0, void 0, function () {
|
5139
8475
|
var response, temp, index, error_1;
|
@@ -5446,7 +8782,7 @@ var UserManagementComponent = function (props) {
|
|
5446
8782
|
case 2:
|
5447
8783
|
response = _c.sent();
|
5448
8784
|
if (response && response.data) {
|
5449
|
-
availableUsers = response.data.filter(function (user) { return user.companyRole !== CompanyRole.API; });
|
8785
|
+
availableUsers = response.data.filter(function (user) { return user.companyRole !== exports.CompanyRole.API; });
|
5450
8786
|
setTableData(availableUsers);
|
5451
8787
|
setTotalUser((_b = (_a = response === null || response === void 0 ? void 0 : response.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.total);
|
5452
8788
|
}
|
@@ -5649,10 +8985,10 @@ var InvestmentCreationComponent = function (props) {
|
|
5649
8985
|
{
|
5650
8986
|
key: "companyRole",
|
5651
8987
|
operation: "=",
|
5652
|
-
value: CompanyRole.PROGRAMME_DEVELOPER.toString(),
|
8988
|
+
value: exports.CompanyRole.PROGRAMME_DEVELOPER.toString(),
|
5653
8989
|
},
|
5654
8990
|
];
|
5655
|
-
if ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.PROGRAMME_DEVELOPER) {
|
8991
|
+
if ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.PROGRAMME_DEVELOPER) {
|
5656
8992
|
filterAnd.push({
|
5657
8993
|
key: "companyId",
|
5658
8994
|
operation: "!=",
|
@@ -6326,7 +9662,7 @@ var InvestmentManagementComponent = function (props) {
|
|
6326
9662
|
case 2:
|
6327
9663
|
response = _g.sent();
|
6328
9664
|
if (response && response.data) {
|
6329
|
-
if (((_a = response === null || response === void 0 ? void 0 : response.data[0]) === null || _a === void 0 ? void 0 : _a.companyRole) === CompanyRole.MINISTRY &&
|
9665
|
+
if (((_a = response === null || response === void 0 ? void 0 : response.data[0]) === null || _a === void 0 ? void 0 : _a.companyRole) === exports.CompanyRole.MINISTRY &&
|
6330
9666
|
((_b = response === null || response === void 0 ? void 0 : response.data[0]) === null || _b === void 0 ? void 0 : _b.company) &&
|
6331
9667
|
((_d = (_c = response === null || response === void 0 ? void 0 : response.data[0]) === null || _c === void 0 ? void 0 : _c.company) === null || _d === void 0 ? void 0 : _d.sectoralScope)) {
|
6332
9668
|
setMinistrySectoralScope((_f = (_e = response === null || response === void 0 ? void 0 : response.data[0]) === null || _e === void 0 ? void 0 : _e.company) === null || _f === void 0 ? void 0 : _f.sectoralScope);
|
@@ -6344,7 +9680,7 @@ var InvestmentManagementComponent = function (props) {
|
|
6344
9680
|
});
|
6345
9681
|
}); };
|
6346
9682
|
React.useEffect(function () {
|
6347
|
-
if ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.MINISTRY) {
|
9683
|
+
if ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY) {
|
6348
9684
|
getUserDetails();
|
6349
9685
|
}
|
6350
9686
|
}, []);
|
@@ -6649,9 +9985,9 @@ var InvestmentManagementComponent = function (props) {
|
|
6649
9985
|
React.createElement(antd.Checkbox.Group, { options: statusOptions, defaultValue: statusOptions.map(function (e) { return e.value; }), value: selectedStatus, onChange: onStatusQuery }))),
|
6650
9986
|
React.createElement(antd.Col, { lg: { span: 9 }, md: { span: 10 } },
|
6651
9987
|
React.createElement("div", { className: "filter-section" },
|
6652
|
-
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.MINISTRY && (React.createElement("div", { className: "search-filter" },
|
9988
|
+
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY && (React.createElement("div", { className: "search-filter" },
|
6653
9989
|
React.createElement(antd.Checkbox, { className: "label", onChange: function (v) {
|
6654
|
-
if (userInfoState.companyRole === CompanyRole.MINISTRY) {
|
9990
|
+
if (userInfoState.companyRole === exports.CompanyRole.MINISTRY) {
|
6655
9991
|
if (v.target.checked) {
|
6656
9992
|
setMinistryLevelFilter(true);
|
6657
9993
|
}
|
@@ -6938,7 +10274,7 @@ var NdcActionManagementComponent = function (props) {
|
|
6938
10274
|
case 2:
|
6939
10275
|
response = _g.sent();
|
6940
10276
|
if (response && response.data) {
|
6941
|
-
if (((_a = response === null || response === void 0 ? void 0 : response.data[0]) === null || _a === void 0 ? void 0 : _a.companyRole) === CompanyRole.MINISTRY &&
|
10277
|
+
if (((_a = response === null || response === void 0 ? void 0 : response.data[0]) === null || _a === void 0 ? void 0 : _a.companyRole) === exports.CompanyRole.MINISTRY &&
|
6942
10278
|
((_b = response === null || response === void 0 ? void 0 : response.data[0]) === null || _b === void 0 ? void 0 : _b.company) &&
|
6943
10279
|
((_d = (_c = response === null || response === void 0 ? void 0 : response.data[0]) === null || _c === void 0 ? void 0 : _c.company) === null || _d === void 0 ? void 0 : _d.sectoralScope)) {
|
6944
10280
|
setMinistrySectoralScope((_f = (_e = response === null || response === void 0 ? void 0 : response.data[0]) === null || _e === void 0 ? void 0 : _e.company) === null || _f === void 0 ? void 0 : _f.sectoralScope);
|
@@ -6956,7 +10292,7 @@ var NdcActionManagementComponent = function (props) {
|
|
6956
10292
|
});
|
6957
10293
|
}); };
|
6958
10294
|
React.useEffect(function () {
|
6959
|
-
if ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.MINISTRY) {
|
10295
|
+
if ((userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY) {
|
6960
10296
|
getUserDetails();
|
6961
10297
|
}
|
6962
10298
|
}, []);
|
@@ -7034,9 +10370,9 @@ var NdcActionManagementComponent = function (props) {
|
|
7034
10370
|
React.createElement(antd.Checkbox.Group, { options: statusOptions, defaultValue: statusOptions.map(function (e) { return e.value; }), value: selectedStatus, onChange: onStatusQuery }))),
|
7035
10371
|
React.createElement(antd.Col, { lg: { span: 9 }, md: { span: 10 } },
|
7036
10372
|
React.createElement("div", { className: "filter-section" },
|
7037
|
-
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === CompanyRole.MINISTRY && (React.createElement("div", { className: "search-filter" },
|
10373
|
+
(userInfoState === null || userInfoState === void 0 ? void 0 : userInfoState.companyRole) === exports.CompanyRole.MINISTRY && (React.createElement("div", { className: "search-filter" },
|
7038
10374
|
React.createElement(antd.Checkbox, { className: "label", onChange: function (v) {
|
7039
|
-
if (userInfoState.companyRole === CompanyRole.MINISTRY) {
|
10375
|
+
if (userInfoState.companyRole === exports.CompanyRole.MINISTRY) {
|
7040
10376
|
if (v.target.checked) {
|
7041
10377
|
setMinistryLevelFilter(true);
|
7042
10378
|
}
|
@@ -7105,7 +10441,7 @@ var StatsCardsTypes;
|
|
7105
10441
|
|
7106
10442
|
var toolTipTextGen = function (companyRole, cardType, mine) {
|
7107
10443
|
var text = '';
|
7108
|
-
if (companyRole === CompanyRole.GOVERNMENT) {
|
10444
|
+
if (companyRole === exports.CompanyRole.GOVERNMENT) {
|
7109
10445
|
if (cardType === StatsCardsTypes.PROGRAMMES_PENDING) {
|
7110
10446
|
text = 'Pending state programmes awaiting authorisation';
|
7111
10447
|
}
|
@@ -7153,7 +10489,7 @@ var toolTipTextGen = function (companyRole, cardType, mine) {
|
|
7153
10489
|
'Locations of credits of international transfer requests recognised during the specified period';
|
7154
10490
|
}
|
7155
10491
|
}
|
7156
|
-
else if (companyRole === CompanyRole.PROGRAMME_DEVELOPER) {
|
10492
|
+
else if (companyRole === exports.CompanyRole.PROGRAMME_DEVELOPER) {
|
7157
10493
|
if (cardType === StatsCardsTypes.TRANSFER_REQUEST_RECEIVED) {
|
7158
10494
|
text = 'Pending credit transfer requests received by your organisation';
|
7159
10495
|
}
|
@@ -7200,7 +10536,7 @@ var toolTipTextGen = function (companyRole, cardType, mine) {
|
|
7200
10536
|
'Locations of credits international transfer requests of programmes owned by your organisation recognised during the specified period';
|
7201
10537
|
}
|
7202
10538
|
}
|
7203
|
-
else if (companyRole === CompanyRole.CERTIFIER && mine === true) {
|
10539
|
+
else if (companyRole === exports.CompanyRole.CERTIFIER && mine === true) {
|
7204
10540
|
if (cardType === StatsCardsTypes.PROGRAMMES_UNCERTIFIED) {
|
7205
10541
|
text =
|
7206
10542
|
'Number of programmes not yet certified including certificates revoked by your organisation';
|
@@ -7248,7 +10584,7 @@ var toolTipTextGen = function (companyRole, cardType, mine) {
|
|
7248
10584
|
'Locations of credits of international transfer requests of programmes certified by your organisation recognised during the specified period';
|
7249
10585
|
}
|
7250
10586
|
}
|
7251
|
-
else if (companyRole === CompanyRole.CERTIFIER && !mine) {
|
10587
|
+
else if (companyRole === exports.CompanyRole.CERTIFIER && !mine) {
|
7252
10588
|
if (cardType === StatsCardsTypes.PROGRAMMES_UNCERTIFIED) {
|
7253
10589
|
text =
|
7254
10590
|
'Number of programmes not yet certified including certificates revoked by your organisation';
|
@@ -7347,6 +10683,9 @@ exports.addCommSep = addCommSep;
|
|
7347
10683
|
exports.addCommSepRound = addCommSepRound;
|
7348
10684
|
exports.addRoundNumber = addRoundNumber;
|
7349
10685
|
exports.addSpaces = addSpaces;
|
10686
|
+
exports.consumerGroupList = consumerGroupList;
|
10687
|
+
exports.energyGenerationUnitList = energyGenerationUnitList;
|
10688
|
+
exports.getBase64 = getBase64;
|
7350
10689
|
exports.getCompanyBgColor = getCompanyBgColor;
|
7351
10690
|
exports.getCreditStageVal = getCreditStageVal;
|
7352
10691
|
exports.getFinancialFields = getFinancialFields;
|
@@ -7362,7 +10701,10 @@ exports.getStageTransferEnumVal = getStageTransferEnumVal;
|
|
7362
10701
|
exports.getStatusTagType = getStatusTagType;
|
7363
10702
|
exports.getTransferStageTagType = getTransferStageTagType;
|
7364
10703
|
exports.isBase64 = isBase64;
|
10704
|
+
exports.landAreaUnitList = landAreaUnitList;
|
7365
10705
|
exports.mitigationTypeList = mitigationTypeList;
|
7366
10706
|
exports.ndcActionTypeList = ndcActionTypeList;
|
10707
|
+
exports.sectorMitigationTypesListMapped = sectorMitigationTypesListMapped;
|
7367
10708
|
exports.sumArray = sumArray;
|
10709
|
+
exports.titleList = titleList;
|
7368
10710
|
//# sourceMappingURL=index.js.map
|