/* html2canvas 0.5.0-beta4 Copyright (c) 2017 Niklas von Hertzen Released under License */ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.html2canvas = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 0x80 (not a basic code point)', 'invalid-input': 'Invalid input' }, /** Convenience shortcuts */ baseMinusTMin = base - tMin, floor = Math.floor, stringFromCharCode = String.fromCharCode, /** Temporary variable */ key; /*--------------------------------------------------------------------------*/ /** * A generic error utility function. * @private * @param {String} type The error type. * @returns {Error} Throws a `RangeError` with the applicable error message. */ function error(type) { throw new RangeError(errors[type]); } /** * A generic `Array#map` utility function. * @private * @param {Array} array The array to iterate over. * @param {Function} callback The function that gets called for every array * item. * @returns {Array} A new array of values returned by the callback function. */ function map(array, fn) { var length = array.length; var result = []; while (length--) { result[length] = fn(array[length]); } return result; } /** * A simple `Array#map`-like wrapper to work with domain name strings or email * addresses. * @private * @param {String} domain The domain name or email address. * @param {Function} callback The function that gets called for every * character. * @returns {Array} A new string of characters returned by the callback * function. */ function mapDomain(string, fn) { var parts = string.split('@'); var result = ''; if (parts.length > 1) { // In email addresses, only the domain name should be punycoded. Leave // the local part (i.e. everything up to `@`) intact. result = parts[0] + '@'; string = parts[1]; } // Avoid `split(regex)` for IE8 compatibility. See #17. string = string.replace(regexSeparators, '\x2E'); var labels = string.split('.'); var encoded = map(labels, fn).join('.'); return result + encoded; } /** * Creates an array containing the numeric code points of each Unicode * character in the string. While JavaScript uses UCS-2 internally, * this function will convert a pair of surrogate halves (each of which * UCS-2 exposes as separate characters) into a single code point, * matching UTF-16. * @see `punycode.ucs2.encode` * @see * @memberOf punycode.ucs2 * @name decode * @param {String} string The Unicode input string (UCS-2). * @returns {Array} The new array of code points. */ function ucs2decode(string) { var output = [], counter = 0, length = string.length, value, extra; while (counter < length) { value = string.charCodeAt(counter++); if (value >= 0xD800 && value <= 0xDBFF && counter < length) { // high surrogate, and there is a next character extra = string.charCodeAt(counter++); if ((extra & 0xFC00) == 0xDC00) { // low surrogate output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); } else { // unmatched surrogate; only append this code unit, in case the next // code unit is the high surrogate of a surrogate pair output.push(value); counter--; } } else { output.push(value); } } return output; } /** * Creates a string based on an array of numeric code points. * @see `punycode.ucs2.decode` * @memberOf punycode.ucs2 * @name encode * @param {Array} codePoints The array of numeric code points. * @returns {String} The new Unicode string (UCS-2). */ function ucs2encode(array) { return map(array, function(value) { var output = ''; if (value > 0xFFFF) { value -= 0x10000; output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); value = 0xDC00 | value & 0x3FF; } output += stringFromCharCode(value); return output; }).join(''); } /** * Converts a basic code point into a digit/integer. * @see `digitToBasic()` * @private * @param {Number} codePoint The basic numeric code point value. * @returns {Number} The numeric value of a basic code point (for use in * representing integers) in the range `0` to `base - 1`, or `base` if * the code point does not represent a value. */ function basicToDigit(codePoint) { if (codePoint - 48 < 10) { return codePoint - 22; } if (codePoint - 65 < 26) { return codePoint - 65; } if (codePoint - 97 < 26) { return codePoint - 97; } return base; } /** * Converts a digit/integer into a basic code point. * @see `basicToDigit()` * @private * @param {Number} digit The numeric value of a basic code point. * @returns {Number} The basic code point whose value (when used for * representing integers) is `digit`, which needs to be in the range * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is * used; else, the lowercase form is used. The behavior is undefined * if `flag` is non-zero and `digit` has no uppercase form. */ function digitToBasic(digit, flag) { // 0..25 map to ASCII a..z or A..Z // 26..35 map to ASCII 0..9 return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); } /** * Bias adaptation function as per section 3.4 of RFC 3492. * https://tools.ietf.org/html/rfc3492#section-3.4 * @private */ function adapt(delta, numPoints, firstTime) { var k = 0; delta = firstTime ? floor(delta / damp) : delta >> 1; delta += floor(delta / numPoints); for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { delta = floor(delta / baseMinusTMin); } return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); } /** * Converts a Punycode string of ASCII-only symbols to a string of Unicode * symbols. * @memberOf punycode * @param {String} input The Punycode string of ASCII-only symbols. * @returns {String} The resulting string of Unicode symbols. */ function decode(input) { // Don't use UCS-2 var output = [], inputLength = input.length, out, i = 0, n = initialN, bias = initialBias, basic, j, index, oldi, w, k, digit, t, /** Cached calculation results */ baseMinusT; // Handle the basic code points: let `basic` be the number of input code // points before the last delimiter, or `0` if there is none, then copy // the first basic code points to the output. basic = input.lastIndexOf(delimiter); if (basic < 0) { basic = 0; } for (j = 0; j < basic; ++j) { // if it's not a basic code point if (input.charCodeAt(j) >= 0x80) { error('not-basic'); } output.push(input.charCodeAt(j)); } // Main decoding loop: start just after the last delimiter if any basic code // points were copied; start at the beginning otherwise. for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { // `index` is the index of the next character to be consumed. // Decode a generalized variable-length integer into `delta`, // which gets added to `i`. The overflow checking is easier // if we increase `i` as we go, then subtract off its starting // value at the end to obtain `delta`. for (oldi = i, w = 1, k = base; /* no condition */; k += base) { if (index >= inputLength) { error('invalid-input'); } digit = basicToDigit(input.charCodeAt(index++)); if (digit >= base || digit > floor((maxInt - i) / w)) { error('overflow'); } i += digit * w; t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); if (digit < t) { break; } baseMinusT = base - t; if (w > floor(maxInt / baseMinusT)) { error('overflow'); } w *= baseMinusT; } out = output.length + 1; bias = adapt(i - oldi, out, oldi == 0); // `i` was supposed to wrap around from `out` to `0`, // incrementing `n` each time, so we'll fix that now: if (floor(i / out) > maxInt - n) { error('overflow'); } n += floor(i / out); i %= out; // Insert `n` at position `i` of the output output.splice(i++, 0, n); } return ucs2encode(output); } /** * Converts a string of Unicode symbols (e.g. a domain name label) to a * Punycode string of ASCII-only symbols. * @memberOf punycode * @param {String} input The string of Unicode symbols. * @returns {String} The resulting Punycode string of ASCII-only symbols. */ function encode(input) { var n, delta, handledCPCount, basicLength, bias, j, m, q, k, t, currentValue, output = [], /** `inputLength` will hold the number of code points in `input`. */ inputLength, /** Cached calculation results */ handledCPCountPlusOne, baseMinusT, qMinusT; // Convert the input in UCS-2 to Unicode input = ucs2decode(input); // Cache the length inputLength = input.length; // Initialize the state n = initialN; delta = 0; bias = initialBias; // Handle the basic code points for (j = 0; j < inputLength; ++j) { currentValue = input[j]; if (currentValue < 0x80) { output.push(stringFromCharCode(currentValue)); } } handledCPCount = basicLength = output.length; // `handledCPCount` is the number of code points that have been handled; // `basicLength` is the number of basic code points. // Finish the basic string - if it is not empty - with a delimiter if (basicLength) { output.push(delimiter); } // Main encoding loop: while (handledCPCount < inputLength) { // All non-basic code points < n have been handled already. Find the next // larger one: for (m = maxInt, j = 0; j < inputLength; ++j) { currentValue = input[j]; if (currentValue >= n && currentValue < m) { m = currentValue; } } // Increase `delta` enough to advance the decoder's state to , // but guard against overflow handledCPCountPlusOne = handledCPCount + 1; if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { error('overflow'); } delta += (m - n) * handledCPCountPlusOne; n = m; for (j = 0; j < inputLength; ++j) { currentValue = input[j]; if (currentValue < n && ++delta > maxInt) { error('overflow'); } if (currentValue == n) { // Represent delta as a generalized variable-length integer for (q = delta, k = base; /* no condition */; k += base) { t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); if (q < t) { break; } qMinusT = q - t; baseMinusT = base - t; output.push( stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) ); q = floor(qMinusT / baseMinusT); } output.push(stringFromCharCode(digitToBasic(q, 0))); bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); delta = 0; ++handledCPCount; } } ++delta; ++n; } return output.join(''); } /** * Converts a Punycode string representing a domain name or an email address * to Unicode. Only the Punycoded parts of the input will be converted, i.e. * it doesn't matter if you call it on a string that has already been * converted to Unicode. * @memberOf punycode * @param {String} input The Punycoded domain name or email address to * convert to Unicode. * @returns {String} The Unicode representation of the given Punycode * string. */ function toUnicode(input) { return mapDomain(input, function(string) { return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; }); } /** * Converts a Unicode string representing a domain name or an email address to * Punycode. Only the non-ASCII parts of the domain name will be converted, * i.e. it doesn't matter if you call it with a domain that's already in * ASCII. * @memberOf punycode * @param {String} input The domain name or email address to convert, as a * Unicode string. * @returns {String} The Punycode representation of the given domain name or * email address. */ function toASCII(input) { return mapDomain(input, function(string) { return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; }); } /*--------------------------------------------------------------------------*/ /** Define the public API */ punycode = { /** * A string representing the current Punycode.js version number. * @memberOf punycode * @type String */ 'version': '1.4.1', /** * An object of methods to convert from JavaScript's internal character * representation (UCS-2) to Unicode code points, and back. * @see * @memberOf punycode * @type Object */ 'ucs2': { 'decode': ucs2decode, 'encode': ucs2encode }, 'decode': decode, 'encode': encode, 'toASCII': toASCII, 'toUnicode': toUnicode }; /** Expose `punycode` */ // Some AMD build optimizers, like r.js, check for specific condition patterns // like the following: if ( typeof define == 'function' && typeof define.amd == 'object' && define.amd ) { define('punycode', function() { return punycode; }); } else if (freeExports && freeModule) { if (module.exports == freeExports) { // in Node.js, io.js, or RingoJS v0.8.0+ freeModule.exports = punycode; } else { // in Narwhal or RingoJS v0.7.0- for (key in punycode) { punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); } } } else { // in Rhino or a web browser root.punycode = punycode; } }(this)); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],2:[function(_dereq_,module,exports){ function toAlphabetic(value, alphabet) { // make the value 0-based, and don't do anything for value <= 0 --value; if (value < 0) return null; // determine the number of "digits" and the offset for the place-value system var lenAlphabet = alphabet.length; var numDigits = 1; var offset = 0; for ( ; ; numDigits++) { var newOffset = (offset + 1) * lenAlphabet; if (value < newOffset) break; offset = newOffset; } // use value - offset to convert to a "number" in the place-value system with base lenAlphabet value -= offset; var ret = ''; for (var i = 0; i < numDigits; i++) { ret = alphabet.charAt(value % lenAlphabet) + ret; value = Math.floor(value / lenAlphabet); } return ret; } module.exports.toAlphabetic = toAlphabetic; var ALPHABET = { LOWER_LATIN: 'abcdefghijklmnopqrstuvwxyz', UPPER_LATIN: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', LOWER_GREEK: 'αβγδεζηθικλμνξοπρστυφχψω', UPPER_GREEK: 'ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ', HIRAGANA: 'あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん', HIRAGANA_IROHA: 'いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす', KATAKANA: 'アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン', KATAKANA_IROHA: 'イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス' }; module.exports.ALPHABET = ALPHABET; module.exports.toLowerLatin = function(value) { return toAlphabetic(value, ALPHABET.LOWER_LATIN); }; module.exports.toUpperLatin = function(value) { return toAlphabetic(value, ALPHABET.UPPER_LATIN); }; module.exports.toLowerGreek = function(value) { return toAlphabetic(value, ALPHABET.LOWER_GREEK); }; module.exports.toUpperGreek = function(value) { return toAlphabetic(value, ALPHABET.UPPER_GREEK); }; module.exports.toHiragana = function(value) { return toAlphabetic(value, ALPHABET.HIRAGANA); }; module.exports.toHiraganaIroha = function(value) { return toAlphabetic(value, ALPHABET.HIRAGANA_IROHA); }; module.exports.toKatakana = function(value) { return toAlphabetic(value, ALPHABET.KATAKANA); }; module.exports.toKatakanaIroha = function(value) { return toAlphabetic(value, ALPHABET.KATAKANA_IROHA); }; },{}],3:[function(_dereq_,module,exports){ function toCJK(value, digits, multipliers, negativeSign, tenHasCoefficient, tenHasCoefficientIfHighNumber, hundredHasCoefficient, usesZero) { if (value <= 0 && !negativeSign) return null; var val = Math.abs(Math.floor(value)); if (val === 0) return digits.charAt(0); var ret = ''; var maxExponent = multipliers.length; var exponent = 0; for (var exponent = 0; val > 0 && exponent <= maxExponent; exponent++) { var coeff = val % 10; if (coeff === 0 && usesZero && ret !== '') ret = digits.charAt(coeff) + ret; else if (coeff > 1 || (coeff === 1 && exponent === 0) || (coeff === 1 && exponent === 1 && tenHasCoefficient) || (coeff === 1 && exponent === 1 && tenHasCoefficientIfHighNumber && value > 100) || (coeff === 1 && exponent > 1 && hundredHasCoefficient)) { ret = digits.charAt(coeff) + (exponent > 0 ? multipliers.charAt(exponent - 1) : '') + ret; } else if (coeff === 1 && exponent > 0) ret = multipliers.charAt(exponent - 1) + ret; val = Math.floor(val / 10); } return (value < 0 ? negativeSign : '') + ret; }; module.exports.toCJK = toCJK; var NUMERAL = { CJK_IDEOGRAPHIC: { DIGITS: '零一二三四五六七八九', MULTIPLIERS: '十百千萬', NEGATIVE: '負' }, TRAD_CHINESE_INFORMAL: { DIGITS: '零一二三四五六七八九', MULTIPLIERS: '十百千萬', NEGATIVE: '負' }, TRAD_CHINESE_FORMAL: { DIGITS: '零壹貳參肆伍陸柒捌玖', MULTIPLIERS: '拾佰仟萬', NEGATIVE: '負' }, SIMP_CHINESE_INFORMAL: { DIGITS: '零一二三四五六七八九', MULTIPLIERS: '十百千萬', NEGATIVE: '负' }, SIMP_CHINESE_FORMAL: { DIGITS: '零壹贰叁肆伍陆柒捌玖', MULTIPLIERS: '拾佰仟萬', NEGATIVE: '负' }, JAPANESE_INFORMAL: { DIGITS: '〇一二三四五六七八九', MULTIPLIERS: '十百千万', NEGATIVE: 'マイナス' }, JAPANESE_FORMAL: { DIGITS: '零壱弐参四伍六七八九', MULTIPLIERS: '拾百千万', NEGATIVE: 'マイナス' }, KOREAN_HANGUL: { DIGITS: '영일이삼사오육칠팔구', MULTIPLIERS: '십백천만', NEGATIVE: '마이너스' }, KOREAN_HANJA_INFORMAL: { DIGITS: '零一二三四五六七八九', MULTIPLIERS: '十百千萬', NEGATIVE: '마이너스' }, KOREAN_HANJA_FORMAL: { //DIGITS: ' 壹貳參肆伍陸柒捌玖', DIGITS: '零壹貳參四五六七八九', //MULTIPLIERS: '拾佰仟' MULTIPLIERS: '拾百千', NEGATIVE: '마이너스' } }; module.exports.NUMERAL = NUMERAL; module.exports.toCJKIdeographic = function(value) { return toCJK(value, NUMERAL.CJK_IDEOGRAPHIC.DIGITS, NUMERAL.CJK_IDEOGRAPHIC.MULTIPLIERS, NUMERAL.CJK_IDEOGRAPHIC.NEGATIVE, false, true, true, true); }; module.exports.toTraditionalChineseInformal = function(value) { return toCJK(value, NUMERAL.TRAD_CHINESE_INFORMAL.DIGITS, NUMERAL.TRAD_CHINESE_INFORMAL.MULTIPLIERS, NUMERAL.TRAD_CHINESE_INFORMAL.NEGATIVE, false, true, true, true); }; module.exports.toTraditionalChineseFormal = function(value) { return toCJK(value, NUMERAL.TRAD_CHINESE_FORMAL.DIGITS, NUMERAL.TRAD_CHINESE_FORMAL.MULTIPLIERS, NUMERAL.TRAD_CHINESE_FORMAL.NEGATIVE, true, true, true, true); }; module.exports.toSimplifiedChineseInformal = function(value) { return toCJK(value, NUMERAL.SIMP_CHINESE_INFORMAL.DIGITS, NUMERAL.SIMP_CHINESE_INFORMAL.MULTIPLIERS, NUMERAL.SIMP_CHINESE_INFORMAL.NEGATIVE, false, true, true, true); }; module.exports.toSimplifiedChineseFormal = function(value) { return toCJK(value, NUMERAL.SIMP_CHINESE_FORMAL.DIGITS, NUMERAL.SIMP_CHINESE_FORMAL.MULTIPLIERS, NUMERAL.SIMP_CHINESE_FORMAL.NEGATIVE, true, true, true, true); }; module.exports.toJapaneseInformal = function(value) { return toCJK(value, NUMERAL.JAPANESE_INFORMAL.DIGITS, NUMERAL.JAPANESE_INFORMAL.MULTIPLIERS, NUMERAL.JAPANESE_INFORMAL.NEGATIVE, false, false, false, false); }; module.exports.toJapaneseFormal = function(value) { return toCJK(value, NUMERAL.JAPANESE_FORMAL.DIGITS, NUMERAL.JAPANESE_FORMAL.MULTIPLIERS, NUMERAL.JAPANESE_FORMAL.NEGATIVE, true, true, true, false); }; module.exports.toKoreanHangul = function(value) { return toCJK(value, NUMERAL.KOREAN_HANGUL.DIGITS, NUMERAL.KOREAN_HANGUL.MULTIPLIERS, NUMERAL.KOREAN_HANGUL.NEGATIVE, true, true, true, false); }; module.exports.toKoreanHanjaInformal = function(value) { return toCJK(value, NUMERAL.KOREAN_HANJA_INFORMAL.DIGITS, NUMERAL.KOREAN_HANJA_INFORMAL.MULTIPLIERS, NUMERAL.KOREAN_HANJA_INFORMAL.NEGATIVE, false, false, false, false); }; module.exports.toKoreanHanjaFormal = function(value) { return toCJK(value, NUMERAL.KOREAN_HANJA_FORMAL.DIGITS, NUMERAL.KOREAN_HANJA_FORMAL.MULTIPLIERS, NUMERAL.KOREAN_HANJA_FORMAL.NEGATIVE, true, true, true, false); }; },{}],4:[function(_dereq_,module,exports){ function toLetterSystem(value, letters) { if (value <= 0) return null; var ret = ''; for (var b in letters) { var num = letters[b]; var q = Math.floor(value / num); value -= q * num; for (var i = 0; i < q; i++) ret += b; } return ret; } module.exports.toLetterSystem = toLetterSystem; var LETTER_SYSTEM = { ROMAN_UPPER: { M: 1000, CM: 900, D: 500, CD: 400, C: 100, XC: 90, L: 50, XL: 40, X: 10, IX: 9, V: 5, IV: 4, I: 1 }, ROMAN_LOWER: { m: 1000, cm: 900, d: 500, cd: 400, c: 100, xc: 90, l: 50, xl: 40, x: 10, ix: 9, v: 5, iv: 4, i: 1 }, HEBREW: { 'א׳א׳': 1000000, 'א׳ק': 100000, 'א׳י': 10000, 'ט׳': 9000, 'ח׳': 8000, 'ז׳': 7000, 'ו׳': 6000, 'ה׳': 5000, 'ד׳': 4000, 'ג׳': 3000, 'ב׳': 2000, 'א׳': 1000, 'ת': 400, 'ש': 300, 'ר': 200, 'ק': 100, 'צ': 90, 'פ': 80, 'ע': 70, 'ס': 60, 'נ': 50, 'מ‎': 40, 'ל': 30, 'כ': 20, 'טז': 16, 'טו': 15, 'י': 10, 'ט': 9, 'ח‎': 8, 'ז': 7, 'ו': 6, 'ה': 5, 'ד': 4, 'ג': 3, 'ב': 2, 'א': 1 }, GEORGIAN: { 'ჵ': 10000, 'ჰ': 9000, 'ჯ': 8000, 'ჴ': 7000, 'ხ': 6000, 'ჭ': 5000, 'წ': 4000, 'ძ': 3000, 'ც': 2000, 'ჩ': 1000, 'შ': 900, 'ყ': 800, 'ღ': 700, 'ქ': 600, 'ფ': 500, 'ჳ': 400, 'ტ': 300, 'ს': 200, 'რ': 100, 'ჟ': 90, 'პ': 80, 'ო': 70, 'ჲ': 60, 'ნ': 50, 'მ': 40, 'ლ': 30, 'კ': 20, 'ი': 10, 'თ': 9, 'ჱ': 8, 'ზ': 7, 'ვ': 6, 'ე': 5, 'დ': 4, 'გ': 3, 'ბ': 2, 'ა': 1 }, ARMENIAN_UPPER: { 'Ք': 9000, 'Փ': 8000, 'Ւ': 7000, 'Ց': 6000, 'Ր': 5000, 'Տ': 4000, 'Վ': 3000, 'Ս': 2000, 'Ռ': 1000, 'Ջ': 900, 'Պ': 800, 'Չ': 700, 'Ո': 600, 'Շ': 500, 'Ն': 400, 'Յ': 300, 'Մ': 200, 'Ճ': 100, 'Ղ': 90, 'Ձ': 80, 'Հ': 70, 'Կ': 60, 'Ծ': 50, 'Խ': 40, 'Լ': 30, 'Ի': 20, 'Ժ': 10, 'Թ': 9, 'Ը': 8, 'Է': 7, 'Զ': 6, 'Ե': 5, 'Դ': 4, 'Գ': 3, 'Բ': 2, 'Ա': 1 }, ARMENIAN_LOWER: { 'ք': 9000, 'փ': 8000, 'ւ': 7000, 'ց': 6000, 'ր': 5000, 'տ': 4000, 'վ': 3000, 'ս': 2000, 'ռ': 1000, 'ջ': 900, 'պ': 800, 'չ': 700, 'ո': 600, 'շ': 500, 'ն': 400, 'յ': 300, 'մ': 200, 'ճ': 100, 'ղ': 90, 'ձ': 80, 'հ': 70, 'կ': 60, 'ծ': 50, 'խ': 40, 'լ': 30, 'ի': 20, 'ժ': 10, 'թ': 9, 'ը': 8, 'է': 7, 'զ': 6, 'ե': 5, 'դ': 4, 'գ': 3, 'բ': 2, 'ա': 1 } }; module.exports.LETTER_SYSTEM = LETTER_SYSTEM; module.exports.toUpperRoman = function(value) { return toLetterSystem(value, LETTER_SYSTEM.ROMAN_UPPER); }; module.exports.toLowerRoman = function(value) { return toLetterSystem(value, LETTER_SYSTEM.ROMAN_LOWER); }; module.exports.toHebrew = function(value) { return toLetterSystem(value, LETTER_SYSTEM.HEBREW); }; module.exports.toGeorgian = function(value) { return toLetterSystem(value, LETTER_SYSTEM.GEORGIAN); }; module.exports.toUpperArmenian = function(value) { return toLetterSystem(value, LETTER_SYSTEM.ARMENIAN_UPPER); }; module.exports.toLowerArmenian = function(value) { return toLetterSystem(value, LETTER_SYSTEM.ARMENIAN_LOWER); }; },{}],5:[function(_dereq_,module,exports){ function toPlaceValue(value, digits, hasNegativeNumbers, minusSign) { if (hasNegativeNumbers === false && value < 0) return null; if (!minusSign) minusSign = '-'; var sign = ''; if (value < 0) sign = minusSign; if (-1 < value && value < 1) return sign + digits.charAt(0); var ret = ''; var numDigits = digits.length; value = Math.abs(value); while (value) { ret = digits.charAt(value % numDigits) + ret; value = Math.floor(value / numDigits); } return sign + ret; }; module.exports.toPlaceValue = toPlaceValue; function toOneBasedPlaceValue(value, digits) { if (value <= 0) return null; var ret = ''; var numDigits = digits.length; while (value) { var v = value % numDigits; ret = digits.charAt(v === 0 ? numDigits - 1 : v - 1) + ret; value = Math.floor(value / numDigits) - (v === 0 ? 1 : 0); } return ret; }; var DIGITS = { ARABIC_INDIC: '٠١٢٣٤٥٦٧٨٩', BENGALI: '০১২৩৪৫৬৭৮৯', CJK_DECIMAL: '〇一二三四五六七八九', CJK_EARTHLY_BRANCH: '子丑寅卯辰巳午未申酉戌亥', CJK_HEAVENLY_STEM: '甲乙丙丁戊己庚辛壬癸', DEVANAGARI: '०१२३४५६७८९', GUJARATI: '૦૧૨૩૪૫૬૭૮૯', GURMUKHI: '੦੧੨੩੪੫੬੭੮੯', KANNADA: '೦೧೨೩೪೫೬೭೮೯', KHMER: '០១២៣៤៥៦៧៨៩', LAO: '໐໑໒໓໔໕໖໗໘໙', MALAYALAM: '൦൧൨൩൪൫൬൭൮൯', MONGILIAN: '᠐᠑᠒᠓᠔᠕᠖᠗᠘᠙', MYANMAR: '၀၁၂၃၄၅၆၇၈၉', ORIYA: '୦୧୨୩୪୫୬୭୮୯', PERSIAN: '۰۱۲۳۴۵۶۷۸۹', TAMIL: '௦௧௨௩௪௫௬௭௮௯', TELUGU: '౦౧౨౩౪౫౬౭౮౯', THAI: '๐๑๒๓๔๕๖๗๘๙', TIBETAN: '༠༡༢༣༤༥༦༧༨༩' }; module.exports.DIGITS = DIGITS; module.exports.toArabicIndic = function(v) { return toPlaceValue(v, DIGITS.ARABIC_INDIC); }; module.exports.toBengali = function(v) { return toPlaceValue(v, DIGITS.BENGALI); }; module.exports.toCJKDecimal = function(v) { return toPlaceValue(v, DIGITS.CJK_DECIMAL, false); }; module.exports.toCJKEarthlyBranch = function(v) { return toOneBasedPlaceValue(v, DIGITS.CJK_EARTHLY_BRANCH); }; module.exports.toCJKHeavenlyStem = function(v) { return toOneBasedPlaceValue(v, DIGITS.CJK_HEAVENLY_STEM); }; module.exports.toDevanagari = function(v) { return toPlaceValue(v, DIGITS.DEVANAGARI); }; module.exports.toGujarati = function(v) { return toPlaceValue(v, DIGITS.GUJARATI); }; module.exports.toGurmukhi = function(v) { return toPlaceValue(v, DIGITS.GURMUKHI); }; module.exports.toKannada = function(v) { return toPlaceValue(v, DIGITS.KANNADA); }; module.exports.toKhmer = function(v) { return toPlaceValue(v, DIGITS.KHMER); }; module.exports.toLao = function(v) { return toPlaceValue(v, DIGITS.LAO); }; module.exports.toMalayalam = function(v) { return toPlaceValue(v, DIGITS.MALAYALAM); }; module.exports.toMongolian = function(v) { return toPlaceValue(v, DIGITS.MONGILIAN); }; module.exports.toMyanmar = function(v) { return toPlaceValue(v, DIGITS.MYANMAR); }; module.exports.toOriya = function(v) { return toPlaceValue(v, DIGITS.ORIYA); }; module.exports.toPersian = function(v) { return toPlaceValue(v, DIGITS.PERSIAN); }; module.exports.toTamil = function(v) { return toPlaceValue(v, DIGITS.TAMIL); }; module.exports.toTelugu = function(v) { return toPlaceValue(v, DIGITS.TELUGU); }; module.exports.toThai = function(v) { return toPlaceValue(v, DIGITS.THAI); }; module.exports.toTibetan = function(v) { return toPlaceValue(v, DIGITS.TIBETAN); }; },{}],6:[function(_dereq_,module,exports){ /** * http://www.geez.org/Numerals/ * http://metaappz.com/Geez_Numbers_Converter/Default.aspx */ module.exports.toEthiopic = function(value) { if (value <= 0) return null; var ONES = '፩፪፫፬፭፮፯፰፱'; var TENS = '፲፳፴፵፶፷፸፹፺'; var HUNDRED = '፻'; var TENTHOUSAND = '፼'; var ret = ''; var sep = ''; value = Math.floor(value); for (var i = 0; value > 0; i++) { var one = value % 10; var ten = Math.floor(value / 10) % 10; if ((one === 1 && ten === 0 && i > 0) || (one === 0 && ten === 0 && i > 1)) ret = sep + ret; else if (one > 0 || ten > 0) { ret = (ten > 0 ? TENS.charAt(ten - 1) : '') + (one > 0 ? ONES.charAt(one - 1) : '') + sep + ret; } value = Math.floor(value / 100); sep = i % 2 ? TENTHOUSAND : HUNDRED; } return ret; }; },{}],7:[function(_dereq_,module,exports){ /////////////////////////////////////////////////////////////////////////////// // Import Packages var Alpha = _dereq_('./converters/alpha'); var Letter = _dereq_('./converters/letter'); var PlaceValue = _dereq_('./converters/placevalue'); var CJK = _dereq_('./converters/cjk'); var Special = _dereq_('./converters/special'); /////////////////////////////////////////////////////////////////////////////// // Private Functions function addDot(s, dot) { if (dot === undefined) dot = '.'; return s === null ? s : s + dot; } /////////////////////////////////////////////////////////////////////////////// // Module Constants // formatter specifications var formatters = { 'none': '', 'disc': '•', 'circle': '◦', 'square': '■', 'decimal': Math.floor, 'cjk-decimal': { function: PlaceValue.toCJKDecimal, dot: '、' }, 'decimal-leading-zero': function(v) { v = Math.floor(v); if (0 <= v && v < 10) return '0' + v; if (-10 < v && v < 0) return '-0' + Math.abs(v); return v; }, 'lower-roman': Letter.toLowerRoman, 'upper-roman': Letter.toUpperRoman, 'lower-greek': Alpha.toLowerGreek, 'lower-alpha': Alpha.toLowerLatin, 'upper-alpha': Alpha.toUpperLatin, 'arabic-indic': PlaceValue.toArabicIndic, 'armenian': Letter.toUpperArmenian, 'bengali': PlaceValue.toBengali, 'cambodian': PlaceValue.toKhmer, 'cjk-earthly-branch': { function: PlaceValue.toCJKEarthlyBranch, dot: '、' }, 'cjk-heavenly-stem': { function: PlaceValue.toCJKHeavenlyStem, dot: '、' }, 'cjk-ideographic': { function: CJK.toCJKIdeographic, dot: '、' }, 'devanagari': PlaceValue.toDevanagari, 'ethiopic-numeric': { function: Special.toEthiopic, dot: '' }, 'georgian': Letter.toGeorgian, 'gujarati': PlaceValue.toGujarati, 'gurmukhi': PlaceValue.toGurmukhi, 'hebrew': Letter.toHebrew, 'hiragana': Alpha.toHiragana, 'hiragana-iroha': Alpha.toHiraganaIroha, 'japanese-formal': { function: CJK.toJapaneseFormal, dot: '、' }, 'japanese-informal': { function: CJK.toJapaneseInformal, dot: '、' }, 'kannada': PlaceValue.toKannada, 'katakana': Alpha.toKatakana, 'katakana-iroha': Alpha.toKatakanaIroha, 'khmer': PlaceValue.toKhmer, 'korean-hangul-formal': { function: CJK.toKoreanHangul, dot: '、' }, 'korean-hanja-formal': { function: CJK.toKoreanHanjaFormal, dot: '、' }, 'korean-hanja-informal': { function: CJK.toKoreanHanjaInformal, dot: '、' }, 'lao': PlaceValue.toLao, 'lower-armenian': Letter.toLowerArmenian, 'malayalam': PlaceValue.toMalayalam, 'mongolian': PlaceValue.toMongolian, 'myanmar': PlaceValue.toMyanmar, 'oriya': PlaceValue.toOriya, 'persian': PlaceValue.toPersian, 'simp-chinese-formal': { function: CJK.toSimplifiedChineseFormal, dot: '、' }, 'simp-chinese-informal': { function: CJK.toSimplifiedChineseInformal, dot: '、' }, 'tamil': PlaceValue.toTamil, 'telugu': PlaceValue.toTelugu, 'thai': PlaceValue.toThai, 'tibetan': PlaceValue.toTibetan, 'trad-chinese-formal': { function: CJK.toTraditionalChineseFormal, dot: '、' }, 'trad-chinese-informal': { function: CJK.toTraditionalChineseInformal, dot: '、' }, 'upper-armenian': Letter.toUpperArmenian }; // define aliases formatters['lower-latin'] = formatters['lower-alpha']; formatters['upper-latin'] = formatters['upper-alpha']; formatters['-moz-arabic-indic'] = formatters['arabic-indic']; formatters['-moz-bengali'] = formatters['bengali']; formatters['-moz-cjk-earthly-branch'] = formatters['cjk-earthly-branch']; formatters['-moz-cjk-heavenly-stem'] = formatters['cjk-heavenly-stem']; formatters['-moz-devanagari'] = formatters['devanagari']; formatters['-moz-gujarati'] = formatters['gujarati']; formatters['-moz-gurmukhi'] = formatters['gurmukhi']; formatters['-moz-kannada'] = formatters['kannada']; formatters['-moz-khmer'] = formatters['khmer']; formatters['-moz-lao'] = formatters['lao']; formatters['-moz-malayalam'] = formatters['malayalam']; formatters['-moz-myanmar'] = formatters['myanmar']; formatters['-moz-oriya'] = formatters['oriya']; formatters['-moz-persian'] = formatters['persian']; formatters['-moz-tamil'] = formatters['tamil']; formatters['-moz-telugu'] = formatters['telugu']; formatters['-moz-thai'] = formatters['thai']; // set the default formatter var defaultFormatter = formatters.decimal; /////////////////////////////////////////////////////////////////////////////// // Implementation function formatInternal(value, formatter, appendDot) { switch (typeof formatter) { case 'function': return appendDot ? addDot(formatter(value)) : formatter(value); case 'object': return appendDot ? addDot(formatter.function(value), formatter.dot) : formatter.function(value); case 'string': return formatter; } return undefined; } /** * Formats the number "value" according to the CSS list-style-type format "format". * https://developer.mozilla.org/en/docs/Web/CSS/list-style-type * * @param value * The number to format * * @param format * The format string to use, the ones listed here: * https://developer.mozilla.org/en/docs/Web/CSS/list-style-type * * @param appendDot * Optional flag indicating if an enumeration symbol (typically, a dot) is to be * appended to the formatted number. * Defaults to true. */ module.exports.format = function(value, format, appendDot /* optional */) { if (appendDot === undefined) appendDot = true; var ret = formatInternal( value, format in formatters ? formatters[format] : defaultFormatter, appendDot ); return (ret === null || ret === undefined) ? formatInternal(value, defaultFormatter, appendDot) : ret; }; /** * Export a global object in the browser. */ if (typeof window !== 'undefined') { window.ListStyleTypeFormatter = { format: module.exports.format }; } },{"./converters/alpha":2,"./converters/cjk":3,"./converters/letter":4,"./converters/placevalue":5,"./converters/special":6}],8:[function(_dereq_,module,exports){ /* global Areion: true */ function ProxyImageContainer(src, proxy) { var self = this; this.src = src; this.image = new Image(); this.tainted = null; this.promise = new Promise(function(resolve, reject) { self.image.onload = resolve; self.image.onerror = reject; self.image.src = Areion.rewriteUrl(src); if (self.image.complete === true) { resolve(self.image); } }); } module.exports = ProxyImageContainer; },{}],9:[function(_dereq_,module,exports){ /* global Areion: true */ function ProxyVideoContainer(imageData) { var video = imageData.args[0]; this.src = video.currentSrc || video.src; // Adding index to identify the video element as