735 lines
459 KiB
JavaScript
735 lines
459 KiB
JavaScript
![]() |
(function webpackUniversalModuleDefinition(root, factory) {
|
||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||
|
module.exports = factory();
|
||
|
else if(typeof define === 'function' && define.amd)
|
||
|
define([], factory);
|
||
|
else if(typeof exports === 'object')
|
||
|
exports["IsoCountriesLanguages"] = factory();
|
||
|
else
|
||
|
root["IsoCountriesLanguages"] = factory();
|
||
|
})(this, function() {
|
||
|
return /******/ (function(modules) { // webpackBootstrap
|
||
|
/******/ // The module cache
|
||
|
/******/ var installedModules = {};
|
||
|
|
||
|
/******/ // The require function
|
||
|
/******/ function __webpack_require__(moduleId) {
|
||
|
|
||
|
/******/ // Check if module is in cache
|
||
|
/******/ if(installedModules[moduleId])
|
||
|
/******/ return installedModules[moduleId].exports;
|
||
|
|
||
|
/******/ // Create a new module (and put it into the cache)
|
||
|
/******/ var module = installedModules[moduleId] = {
|
||
|
/******/ exports: {},
|
||
|
/******/ id: moduleId,
|
||
|
/******/ loaded: false
|
||
|
/******/ };
|
||
|
|
||
|
/******/ // Execute the module function
|
||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||
|
|
||
|
/******/ // Flag the module as loaded
|
||
|
/******/ module.loaded = true;
|
||
|
|
||
|
/******/ // Return the exports of the module
|
||
|
/******/ return module.exports;
|
||
|
/******/ }
|
||
|
|
||
|
|
||
|
/******/ // expose the modules object (__webpack_modules__)
|
||
|
/******/ __webpack_require__.m = modules;
|
||
|
|
||
|
/******/ // expose the module cache
|
||
|
/******/ __webpack_require__.c = installedModules;
|
||
|
|
||
|
/******/ // __webpack_public_path__
|
||
|
/******/ __webpack_require__.p = "";
|
||
|
|
||
|
/******/ // Load entry module and return exports
|
||
|
/******/ return __webpack_require__(0);
|
||
|
/******/ })
|
||
|
/************************************************************************/
|
||
|
/******/ ([
|
||
|
/* 0 */
|
||
|
/***/ function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var packagedJson = JSON.parse(__webpack_require__(1));
|
||
|
var supportedLangs = __webpack_require__(3);
|
||
|
|
||
|
/**
|
||
|
* Returns the list of supported languages
|
||
|
* @return {Array} The list of all the supported languages
|
||
|
*/
|
||
|
var getSupportedLangs = function(){
|
||
|
return supportedLangs;
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* Returns the ISO 3166-1 list of countries translated in the language passed as a parameter
|
||
|
* @param {String} lang The desired language for the translation
|
||
|
* @return {Array} The countries list
|
||
|
*/
|
||
|
var getCountries = function(lang){
|
||
|
return packagedJson.countries[lang];
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* Returns the translation for the country code passed as a parameter in the language passed as a parameter
|
||
|
* @param {String} lang The languages desired for the translation
|
||
|
* @param {String} countryCode The country code for which to return the country name
|
||
|
* @return {String} The translated country name
|
||
|
*/
|
||
|
var getCountry = function(lang, countryCode){
|
||
|
return packagedJson.countries[lang][countryCode];
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* Returns the ISO 639-1 list of languages translated in the language passed as a parameter
|
||
|
* @param {String} lang The desired language for the translation
|
||
|
* @return {Array} The language list
|
||
|
*/
|
||
|
var getLanguages = function(lang){
|
||
|
return packagedJson.languages[lang];
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* Returns the translation for the language code passed as a parameter in the language passed as a parameter
|
||
|
* @param {String} lang The languages desired for the translation
|
||
|
* @param {String} langCode The language code for which to return the cuntry name
|
||
|
* @return {String} The translated country name
|
||
|
*/
|
||
|
var getLanguage = function(lang, langCode){
|
||
|
return packagedJson.languages[lang][langCode];
|
||
|
};
|
||
|
|
||
|
module.exports = {
|
||
|
|
||
|
getSupportedLangs: getSupportedLangs,
|
||
|
|
||
|
getCountries: getCountries,
|
||
|
|
||
|
getCountry: getCountry,
|
||
|
|
||
|
getLanguages: getLanguages,
|
||
|
|
||
|
getLanguage: getLanguage
|
||
|
|
||
|
};
|
||
|
|
||
|
/***/ },
|
||
|
/* 1 */
|
||
|
/***/ function(module, exports, __webpack_require__) {
|
||
|
|
||
|
|
||
|
var lzstr = __webpack_require__(2);
|
||
|
module.exports = lzstr.decompressFromBase64("N4IgNghgdg5grhGBTAziAXKCAzDWBGGIAgvgMYAWEAXgJYqVIgA0IEERAakgE4tu50JbD1oBrdlDSsIYosQlR+KAI7yw+aKiYyAtvN1VRqfhD5DiPCPlomZSi1ZgB7KNv4UAnvJ66kSKR02NAsUFAg/OzYAN3los1oyUyYLaNQAF2hTbwtPXTMOGWp5FF58JFoAEwAraGkQfH0hACEIzSt+TSJWlAoxWj5WJDhuiBR+qPKiAHVadM6HEGaAmAgwWmYAAlbYSE6KbtojWk6TlvpIfM6QpecUKFtSzvMlniR013r8GG64MFWzE9WLocksBvk6kEyBwhABpCCZSB1fiUIgAYSoumcPB4zhRKRAABUUNV3iT/IF+FBQRjEhQkAB3CBbDGM5mbAAiznytCUrGoByEtLcQJAZFiQoocHivX4YgZ6OxD1lrDIeLh2JQ4kk9TILzRbyCFBesNxCMeKJuxNJMBgFtYlRhIA5FNFlQlztoaQoG05Pu9voAsmtKl6glAwEQOXA5vVKsUhBzqK4YGIqPwAkQAKKwJBgepIdUgLMoAAOvGgHwz8yEJfSDyi/iIAHlnCdWNgiwAxMzOdwd6pELtVaq0HVBbBnEDDykdl5dqxSfjYQTTv7srvrihbAAK697pYoriQWwAyki+SAYJGhABxNb0e0gCREW+Fnh2/sgSoE6OxjM3iAt7GGI9QwIst4IIu7ZXiMd5wLUVjpDBFA1iAAASEBzI8WyYdhqCbAahZgEaTqYXA4QeAS6FIPghoUR4CYYbwvB4qwPpEOhvKhh4RZcaImyBs46QjOxcEYSm7A8PUY5EAAklA6S8OssAIPwVTyVAlTHlqX62JpSk8Cp8BBKs8m8DJPxCHJMD4GxIDiPIIjasirC0EWcnaepNwAJooJAWkyWhcmImOrkOeJClwGIyEifMrC1EQABSEClloUTVB6KXxOFYiAfCSJgOsKBwOkWzARSAWhkkrBiIs8JQFAECOnKJrQHAohyjc8IkroAyimIchwjQsgHLVTQ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ABQyIAO6RQNm4M19gkgAAZFA8lhDAEiCcexzBz7rBwKvigtAAAt/wOlQhACQyIAYGRQOACckajqFOJYQjVAXC8e2mETeJXUiRB5upcAMlIKHACQSFRIggBVpEAKZI7n5tIcAKTIjFOIsW6yADiQhABISAhwAj0gx74gMWgglhJfylEQQAAEgBcq+pJ0ClDLGTCQ5VZdOEOADekQAKUiAFOkQTbkCTj+UryEyQenSAFEkNHVPV8OTuoAMCRADpSLh9SpsoqaIgGoNypPKdU82Njy7qXyPZaR5sVz83vJEEAxXi1mjtRnMEQOdoFs9upJFFANFLFKVPwIlEIGHoAMrIS2IAmUyUbcWgA0+UawaixUpU5UhoEYDqhytUiwDW2eFOJubUMBnUtU3UjifU9Bz4psDWgA20hOZygTT76H5yjzRrQrR7KCEbTIoLRgybQOqHRiCgjwybAUZUZyiXTXRyh3RXTzK1RFicaAB1SDBkfmIOJLwfobArCADODMDKDIDBDE6K5pHi7lTGvMrNjLjM4PjDtkTCTGTPzAwLttTEIGTpXpflTFOLzJzHaL0OzHzKsInjzBzOTLNELIzFvngYLEWAEUEeAGhHnoAC5IAmaBYASsp6asCId6WsRArmgArkiABWSLbt7vrNAEbMCKbORoABVIc+xGxstseBDs3gwINw5GP+VWgEAx/Grml2VWaEnGVOgADEiACEyIANNIgAHkiACzSPYSAKHEIBHFHMbC8ORu5tHknCnOnNnLnGHAXCOsXIsIAHhICGgAcMjBZUhOitwdSgxUgtxYEdxdxYFgp3yrIn6ABpSGfOPEAlPEQAvsgQ8Y3HdGPJJFSGvP8aBoADNI+mC
|
||
|
|
||
|
|
||
|
/***/ },
|
||
|
/* 2 */
|
||
|
/***/ function(module, exports, __webpack_require__) {
|
||
|
|
||
|
var __WEBPACK_AMD_DEFINE_RESULT__;// Copyright (c) 2013 Pieroxy <pieroxy@pieroxy.net>
|
||
|
// This work is free. You can redistribute it and/or modify it
|
||
|
// under the terms of the WTFPL, Version 2
|
||
|
// For more information see LICENSE.txt or http://www.wtfpl.net/
|
||
|
//
|
||
|
// For more information, the home page:
|
||
|
// http://pieroxy.net/blog/pages/lz-string/testing.html
|
||
|
//
|
||
|
// LZ-based compression algorithm, version 1.4.4
|
||
|
var LZString = (function() {
|
||
|
|
||
|
// private property
|
||
|
var f = String.fromCharCode;
|
||
|
var keyStrBase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||
|
var keyStrUriSafe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$";
|
||
|
var baseReverseDic = {};
|
||
|
|
||
|
function getBaseValue(alphabet, character) {
|
||
|
if (!baseReverseDic[alphabet]) {
|
||
|
baseReverseDic[alphabet] = {};
|
||
|
for (var i=0 ; i<alphabet.length ; i++) {
|
||
|
baseReverseDic[alphabet][alphabet.charAt(i)] = i;
|
||
|
}
|
||
|
}
|
||
|
return baseReverseDic[alphabet][character];
|
||
|
}
|
||
|
|
||
|
var LZString = {
|
||
|
compressToBase64 : function (input) {
|
||
|
if (input == null) return "";
|
||
|
var res = LZString._compress(input, 6, function(a){return keyStrBase64.charAt(a);});
|
||
|
switch (res.length % 4) { // To produce valid Base64
|
||
|
default: // When could this happen ?
|
||
|
case 0 : return res;
|
||
|
case 1 : return res+"===";
|
||
|
case 2 : return res+"==";
|
||
|
case 3 : return res+"=";
|
||
|
}
|
||
|
},
|
||
|
|
||
|
decompressFromBase64 : function (input) {
|
||
|
if (input == null) return "";
|
||
|
if (input == "") return null;
|
||
|
return LZString._decompress(input.length, 32, function(index) { return getBaseValue(keyStrBase64, input.charAt(index)); });
|
||
|
},
|
||
|
|
||
|
compressToUTF16 : function (input) {
|
||
|
if (input == null) return "";
|
||
|
return LZString._compress(input, 15, function(a){return f(a+32);}) + " ";
|
||
|
},
|
||
|
|
||
|
decompressFromUTF16: function (compressed) {
|
||
|
if (compressed == null) return "";
|
||
|
if (compressed == "") return null;
|
||
|
return LZString._decompress(compressed.length, 16384, function(index) { return compressed.charCodeAt(index) - 32; });
|
||
|
},
|
||
|
|
||
|
//compress into uint8array (UCS-2 big endian format)
|
||
|
compressToUint8Array: function (uncompressed) {
|
||
|
var compressed = LZString.compress(uncompressed);
|
||
|
var buf=new Uint8Array(compressed.length*2); // 2 bytes per character
|
||
|
|
||
|
for (var i=0, TotalLen=compressed.length; i<TotalLen; i++) {
|
||
|
var current_value = compressed.charCodeAt(i);
|
||
|
buf[i*2] = current_value >>> 8;
|
||
|
buf[i*2+1] = current_value % 256;
|
||
|
}
|
||
|
return buf;
|
||
|
},
|
||
|
|
||
|
//decompress from uint8array (UCS-2 big endian format)
|
||
|
decompressFromUint8Array:function (compressed) {
|
||
|
if (compressed===null || compressed===undefined){
|
||
|
return LZString.decompress(compressed);
|
||
|
} else {
|
||
|
var buf=new Array(compressed.length/2); // 2 bytes per character
|
||
|
for (var i=0, TotalLen=buf.length; i<TotalLen; i++) {
|
||
|
buf[i]=compressed[i*2]*256+compressed[i*2+1];
|
||
|
}
|
||
|
|
||
|
var result = [];
|
||
|
buf.forEach(function (c) {
|
||
|
result.push(f(c));
|
||
|
});
|
||
|
return LZString.decompress(result.join(''));
|
||
|
|
||
|
}
|
||
|
|
||
|
},
|
||
|
|
||
|
|
||
|
//compress into a string that is already URI encoded
|
||
|
compressToEncodedURIComponent: function (input) {
|
||
|
if (input == null) return "";
|
||
|
return LZString._compress(input, 6, function(a){return keyStrUriSafe.charAt(a);});
|
||
|
},
|
||
|
|
||
|
//decompress from an output of compressToEncodedURIComponent
|
||
|
decompressFromEncodedURIComponent:function (input) {
|
||
|
if (input == null) return "";
|
||
|
if (input == "") return null;
|
||
|
input = input.replace(/ /g, "+");
|
||
|
return LZString._decompress(input.length, 32, function(index) { return getBaseValue(keyStrUriSafe, input.charAt(index)); });
|
||
|
},
|
||
|
|
||
|
compress: function (uncompressed) {
|
||
|
return LZString._compress(uncompressed, 16, function(a){return f(a);});
|
||
|
},
|
||
|
_compress: function (uncompressed, bitsPerChar, getCharFromInt) {
|
||
|
if (uncompressed == null) return "";
|
||
|
var i, value,
|
||
|
context_dictionary= {},
|
||
|
context_dictionaryToCreate= {},
|
||
|
context_c="",
|
||
|
context_wc="",
|
||
|
context_w="",
|
||
|
context_enlargeIn= 2, // Compensate for the first entry which should not count
|
||
|
context_dictSize= 3,
|
||
|
context_numBits= 2,
|
||
|
context_data=[],
|
||
|
context_data_val=0,
|
||
|
context_data_position=0,
|
||
|
ii;
|
||
|
|
||
|
for (ii = 0; ii < uncompressed.length; ii += 1) {
|
||
|
context_c = uncompressed.charAt(ii);
|
||
|
if (!Object.prototype.hasOwnProperty.call(context_dictionary,context_c)) {
|
||
|
context_dictionary[context_c] = context_dictSize++;
|
||
|
context_dictionaryToCreate[context_c] = true;
|
||
|
}
|
||
|
|
||
|
context_wc = context_w + context_c;
|
||
|
if (Object.prototype.hasOwnProperty.call(context_dictionary,context_wc)) {
|
||
|
context_w = context_wc;
|
||
|
} else {
|
||
|
if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)) {
|
||
|
if (context_w.charCodeAt(0)<256) {
|
||
|
for (i=0 ; i<context_numBits ; i++) {
|
||
|
context_data_val = (context_data_val << 1);
|
||
|
if (context_data_position == bitsPerChar-1) {
|
||
|
context_data_position = 0;
|
||
|
context_data.push(getCharFromInt(context_data_val));
|
||
|
context_data_val = 0;
|
||
|
} else {
|
||
|
context_data_position++;
|
||
|
}
|
||
|
}
|
||
|
value = context_w.charCodeAt(0);
|
||
|
for (i=0 ; i<8 ; i++) {
|
||
|
context_data_val = (context_data_val << 1) | (value&1);
|
||
|
if (context_data_position == bitsPerChar-1) {
|
||
|
context_data_position = 0;
|
||
|
context_data.push(getCharFromInt(context_data_val));
|
||
|
context_data_val = 0;
|
||
|
} else {
|
||
|
context_data_position++;
|
||
|
}
|
||
|
value = value >> 1;
|
||
|
}
|
||
|
} else {
|
||
|
value = 1;
|
||
|
for (i=0 ; i<context_numBits ; i++) {
|
||
|
context_data_val = (context_data_val << 1) | value;
|
||
|
if (context_data_position ==bitsPerChar-1) {
|
||
|
context_data_position = 0;
|
||
|
context_data.push(getCharFromInt(context_data_val));
|
||
|
context_data_val = 0;
|
||
|
} else {
|
||
|
context_data_position++;
|
||
|
}
|
||
|
value = 0;
|
||
|
}
|
||
|
value = context_w.charCodeAt(0);
|
||
|
for (i=0 ; i<16 ; i++) {
|
||
|
context_data_val = (context_data_val << 1) | (value&1);
|
||
|
if (context_data_position == bitsPerChar-1) {
|
||
|
context_data_position = 0;
|
||
|
context_data.push(getCharFromInt(context_data_val));
|
||
|
context_data_val = 0;
|
||
|
} else {
|
||
|
context_data_position++;
|
||
|
}
|
||
|
value = value >> 1;
|
||
|
}
|
||
|
}
|
||
|
context_enlargeIn--;
|
||
|
if (context_enlargeIn == 0) {
|
||
|
context_enlargeIn = Math.pow(2, context_numBits);
|
||
|
context_numBits++;
|
||
|
}
|
||
|
delete context_dictionaryToCreate[context_w];
|
||
|
} else {
|
||
|
value = context_dictionary[context_w];
|
||
|
for (i=0 ; i<context_numBits ; i++) {
|
||
|
context_data_val = (context_data_val << 1) | (value&1);
|
||
|
if (context_data_position == bitsPerChar-1) {
|
||
|
context_data_position = 0;
|
||
|
context_data.push(getCharFromInt(context_data_val));
|
||
|
context_data_val = 0;
|
||
|
} else {
|
||
|
context_data_position++;
|
||
|
}
|
||
|
value = value >> 1;
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
context_enlargeIn--;
|
||
|
if (context_enlargeIn == 0) {
|
||
|
context_enlargeIn = Math.pow(2, context_numBits);
|
||
|
context_numBits++;
|
||
|
}
|
||
|
// Add wc to the dictionary.
|
||
|
context_dictionary[context_wc] = context_dictSize++;
|
||
|
context_w = String(context_c);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Output the code for w.
|
||
|
if (context_w !== "") {
|
||
|
if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)) {
|
||
|
if (context_w.charCodeAt(0)<256) {
|
||
|
for (i=0 ; i<context_numBits ; i++) {
|
||
|
context_data_val = (context_data_val << 1);
|
||
|
if (context_data_position == bitsPerChar-1) {
|
||
|
context_data_position = 0;
|
||
|
context_data.push(getCharFromInt(context_data_val));
|
||
|
context_data_val = 0;
|
||
|
} else {
|
||
|
context_data_position++;
|
||
|
}
|
||
|
}
|
||
|
value = context_w.charCodeAt(0);
|
||
|
for (i=0 ; i<8 ; i++) {
|
||
|
context_data_val = (context_data_val << 1) | (value&1);
|
||
|
if (context_data_position == bitsPerChar-1) {
|
||
|
context_data_position = 0;
|
||
|
context_data.push(getCharFromInt(context_data_val));
|
||
|
context_data_val = 0;
|
||
|
} else {
|
||
|
context_data_position++;
|
||
|
}
|
||
|
value = value >> 1;
|
||
|
}
|
||
|
} else {
|
||
|
value = 1;
|
||
|
for (i=0 ; i<context_numBits ; i++) {
|
||
|
context_data_val = (context_data_val << 1) | value;
|
||
|
if (context_data_position == bitsPerChar-1) {
|
||
|
context_data_position = 0;
|
||
|
context_data.push(getCharFromInt(context_data_val));
|
||
|
context_data_val = 0;
|
||
|
} else {
|
||
|
context_data_position++;
|
||
|
}
|
||
|
value = 0;
|
||
|
}
|
||
|
value = context_w.charCodeAt(0);
|
||
|
for (i=0 ; i<16 ; i++) {
|
||
|
context_data_val = (context_data_val << 1) | (value&1);
|
||
|
if (context_data_position == bitsPerChar-1) {
|
||
|
context_data_position = 0;
|
||
|
context_data.push(getCharFromInt(context_data_val));
|
||
|
context_data_val = 0;
|
||
|
} else {
|
||
|
context_data_position++;
|
||
|
}
|
||
|
value = value >> 1;
|
||
|
}
|
||
|
}
|
||
|
context_enlargeIn--;
|
||
|
if (context_enlargeIn == 0) {
|
||
|
context_enlargeIn = Math.pow(2, context_numBits);
|
||
|
context_numBits++;
|
||
|
}
|
||
|
delete context_dictionaryToCreate[context_w];
|
||
|
} else {
|
||
|
value = context_dictionary[context_w];
|
||
|
for (i=0 ; i<context_numBits ; i++) {
|
||
|
context_data_val = (context_data_val << 1) | (value&1);
|
||
|
if (context_data_position == bitsPerChar-1) {
|
||
|
context_data_position = 0;
|
||
|
context_data.push(getCharFromInt(context_data_val));
|
||
|
context_data_val = 0;
|
||
|
} else {
|
||
|
context_data_position++;
|
||
|
}
|
||
|
value = value >> 1;
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
context_enlargeIn--;
|
||
|
if (context_enlargeIn == 0) {
|
||
|
context_enlargeIn = Math.pow(2, context_numBits);
|
||
|
context_numBits++;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Mark the end of the stream
|
||
|
value = 2;
|
||
|
for (i=0 ; i<context_numBits ; i++) {
|
||
|
context_data_val = (context_data_val << 1) | (value&1);
|
||
|
if (context_data_position == bitsPerChar-1) {
|
||
|
context_data_position = 0;
|
||
|
context_data.push(getCharFromInt(context_data_val));
|
||
|
context_data_val = 0;
|
||
|
} else {
|
||
|
context_data_position++;
|
||
|
}
|
||
|
value = value >> 1;
|
||
|
}
|
||
|
|
||
|
// Flush the last char
|
||
|
while (true) {
|
||
|
context_data_val = (context_data_val << 1);
|
||
|
if (context_data_position == bitsPerChar-1) {
|
||
|
context_data.push(getCharFromInt(context_data_val));
|
||
|
break;
|
||
|
}
|
||
|
else context_data_position++;
|
||
|
}
|
||
|
return context_data.join('');
|
||
|
},
|
||
|
|
||
|
decompress: function (compressed) {
|
||
|
if (compressed == null) return "";
|
||
|
if (compressed == "") return null;
|
||
|
return LZString._decompress(compressed.length, 32768, function(index) { return compressed.charCodeAt(index); });
|
||
|
},
|
||
|
|
||
|
_decompress: function (length, resetValue, getNextValue) {
|
||
|
var dictionary = [],
|
||
|
next,
|
||
|
enlargeIn = 4,
|
||
|
dictSize = 4,
|
||
|
numBits = 3,
|
||
|
entry = "",
|
||
|
result = [],
|
||
|
i,
|
||
|
w,
|
||
|
bits, resb, maxpower, power,
|
||
|
c,
|
||
|
data = {val:getNextValue(0), position:resetValue, index:1};
|
||
|
|
||
|
for (i = 0; i < 3; i += 1) {
|
||
|
dictionary[i] = i;
|
||
|
}
|
||
|
|
||
|
bits = 0;
|
||
|
maxpower = Math.pow(2,2);
|
||
|
power=1;
|
||
|
while (power!=maxpower) {
|
||
|
resb = data.val & data.position;
|
||
|
data.position >>= 1;
|
||
|
if (data.position == 0) {
|
||
|
data.position = resetValue;
|
||
|
data.val = getNextValue(data.index++);
|
||
|
}
|
||
|
bits |= (resb>0 ? 1 : 0) * power;
|
||
|
power <<= 1;
|
||
|
}
|
||
|
|
||
|
switch (next = bits) {
|
||
|
case 0:
|
||
|
bits = 0;
|
||
|
maxpower = Math.pow(2,8);
|
||
|
power=1;
|
||
|
while (power!=maxpower) {
|
||
|
resb = data.val & data.position;
|
||
|
data.position >>= 1;
|
||
|
if (data.position == 0) {
|
||
|
data.position = resetValue;
|
||
|
data.val = getNextValue(data.index++);
|
||
|
}
|
||
|
bits |= (resb>0 ? 1 : 0) * power;
|
||
|
power <<= 1;
|
||
|
}
|
||
|
c = f(bits);
|
||
|
break;
|
||
|
case 1:
|
||
|
bits = 0;
|
||
|
maxpower = Math.pow(2,16);
|
||
|
power=1;
|
||
|
while (power!=maxpower) {
|
||
|
resb = data.val & data.position;
|
||
|
data.position >>= 1;
|
||
|
if (data.position == 0) {
|
||
|
data.position = resetValue;
|
||
|
data.val = getNextValue(data.index++);
|
||
|
}
|
||
|
bits |= (resb>0 ? 1 : 0) * power;
|
||
|
power <<= 1;
|
||
|
}
|
||
|
c = f(bits);
|
||
|
break;
|
||
|
case 2:
|
||
|
return "";
|
||
|
}
|
||
|
dictionary[3] = c;
|
||
|
w = c;
|
||
|
result.push(c);
|
||
|
while (true) {
|
||
|
if (data.index > length) {
|
||
|
return "";
|
||
|
}
|
||
|
|
||
|
bits = 0;
|
||
|
maxpower = Math.pow(2,numBits);
|
||
|
power=1;
|
||
|
while (power!=maxpower) {
|
||
|
resb = data.val & data.position;
|
||
|
data.position >>= 1;
|
||
|
if (data.position == 0) {
|
||
|
data.position = resetValue;
|
||
|
data.val = getNextValue(data.index++);
|
||
|
}
|
||
|
bits |= (resb>0 ? 1 : 0) * power;
|
||
|
power <<= 1;
|
||
|
}
|
||
|
|
||
|
switch (c = bits) {
|
||
|
case 0:
|
||
|
bits = 0;
|
||
|
maxpower = Math.pow(2,8);
|
||
|
power=1;
|
||
|
while (power!=maxpower) {
|
||
|
resb = data.val & data.position;
|
||
|
data.position >>= 1;
|
||
|
if (data.position == 0) {
|
||
|
data.position = resetValue;
|
||
|
data.val = getNextValue(data.index++);
|
||
|
}
|
||
|
bits |= (resb>0 ? 1 : 0) * power;
|
||
|
power <<= 1;
|
||
|
}
|
||
|
|
||
|
dictionary[dictSize++] = f(bits);
|
||
|
c = dictSize-1;
|
||
|
enlargeIn--;
|
||
|
break;
|
||
|
case 1:
|
||
|
bits = 0;
|
||
|
maxpower = Math.pow(2,16);
|
||
|
power=1;
|
||
|
while (power!=maxpower) {
|
||
|
resb = data.val & data.position;
|
||
|
data.position >>= 1;
|
||
|
if (data.position == 0) {
|
||
|
data.position = resetValue;
|
||
|
data.val = getNextValue(data.index++);
|
||
|
}
|
||
|
bits |= (resb>0 ? 1 : 0) * power;
|
||
|
power <<= 1;
|
||
|
}
|
||
|
dictionary[dictSize++] = f(bits);
|
||
|
c = dictSize-1;
|
||
|
enlargeIn--;
|
||
|
break;
|
||
|
case 2:
|
||
|
return result.join('');
|
||
|
}
|
||
|
|
||
|
if (enlargeIn == 0) {
|
||
|
enlargeIn = Math.pow(2, numBits);
|
||
|
numBits++;
|
||
|
}
|
||
|
|
||
|
if (dictionary[c]) {
|
||
|
entry = dictionary[c];
|
||
|
} else {
|
||
|
if (c === dictSize) {
|
||
|
entry = w + w.charAt(0);
|
||
|
} else {
|
||
|
return null;
|
||
|
}
|
||
|
}
|
||
|
result.push(entry);
|
||
|
|
||
|
// Add w+entry[0] to the dictionary.
|
||
|
dictionary[dictSize++] = w + entry.charAt(0);
|
||
|
enlargeIn--;
|
||
|
|
||
|
w = entry;
|
||
|
|
||
|
if (enlargeIn == 0) {
|
||
|
enlargeIn = Math.pow(2, numBits);
|
||
|
numBits++;
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
return LZString;
|
||
|
})();
|
||
|
|
||
|
if (true) {
|
||
|
!(__WEBPACK_AMD_DEFINE_RESULT__ = function () { return LZString; }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
||
|
} else if( typeof module !== 'undefined' && module != null ) {
|
||
|
module.exports = LZString
|
||
|
}
|
||
|
|
||
|
|
||
|
/***/ },
|
||
|
/* 3 */
|
||
|
/***/ function(module, exports) {
|
||
|
|
||
|
module.exports = [
|
||
|
"af",
|
||
|
"am",
|
||
|
"ar",
|
||
|
"az",
|
||
|
"ba",
|
||
|
"be",
|
||
|
"bg",
|
||
|
"bn",
|
||
|
"bs",
|
||
|
"ca",
|
||
|
"ceb",
|
||
|
"cs",
|
||
|
"cy",
|
||
|
"da",
|
||
|
"de",
|
||
|
"el",
|
||
|
"en",
|
||
|
"eo",
|
||
|
"es",
|
||
|
"et",
|
||
|
"eu",
|
||
|
"fa",
|
||
|
"fi",
|
||
|
"fr",
|
||
|
"ga",
|
||
|
"gd",
|
||
|
"gl",
|
||
|
"gu",
|
||
|
"he",
|
||
|
"hi",
|
||
|
"hr",
|
||
|
"ht",
|
||
|
"hu",
|
||
|
"hy",
|
||
|
"id",
|
||
|
"is",
|
||
|
"it",
|
||
|
"ja",
|
||
|
"jv",
|
||
|
"ka",
|
||
|
"kk",
|
||
|
"kn",
|
||
|
"ko",
|
||
|
"ky",
|
||
|
"la",
|
||
|
"lt",
|
||
|
"lv",
|
||
|
"mg",
|
||
|
"mhr",
|
||
|
"mi",
|
||
|
"mk",
|
||
|
"ml",
|
||
|
"mn",
|
||
|
"mr",
|
||
|
"mrj",
|
||
|
"ms",
|
||
|
"mt",
|
||
|
"ne",
|
||
|
"nl",
|
||
|
"no",
|
||
|
"pa",
|
||
|
"pap",
|
||
|
"pl",
|
||
|
"pt",
|
||
|
"ro",
|
||
|
"ru",
|
||
|
"si",
|
||
|
"sk",
|
||
|
"sl",
|
||
|
"sq",
|
||
|
"sr",
|
||
|
"su",
|
||
|
"sv",
|
||
|
"sw",
|
||
|
"ta",
|
||
|
"te",
|
||
|
"tg",
|
||
|
"th",
|
||
|
"tl",
|
||
|
"tr",
|
||
|
"tt",
|
||
|
"udm",
|
||
|
"uk",
|
||
|
"ur",
|
||
|
"uz",
|
||
|
"vi",
|
||
|
"xh",
|
||
|
"yi",
|
||
|
"zh"
|
||
|
];
|
||
|
|
||
|
/***/ }
|
||
|
/******/ ])
|
||
|
});
|
||
|
;
|