OSDN Git Service

update version
[bytom/Byone.git] / js / 6.js
1 // [AIV_SHORT]  Build version: 2.2.0 - Thursday, June 4th, 2020, 2:31:20 PM  
2  webpackJsonp([6],{
3
4 /***/ 532:
5 /***/ (function(module, exports, __webpack_require__) {
6
7 "use strict";
8
9
10 exports.__esModule = true;
11
12 var _assign = __webpack_require__(69);
13
14 var _assign2 = _interopRequireDefault(_assign);
15
16 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
18 exports.default = _assign2.default || function (target) {
19   for (var i = 1; i < arguments.length; i++) {
20     var source = arguments[i];
21
22     for (var key in source) {
23       if (Object.prototype.hasOwnProperty.call(source, key)) {
24         target[key] = source[key];
25       }
26     }
27   }
28
29   return target;
30 };
31
32 /***/ }),
33
34 /***/ 545:
35 /***/ (function(module, __webpack_exports__, __webpack_require__) {
36
37 "use strict";
38 Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
39 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_voteConfirm_vue__ = __webpack_require__(602);
40 /* empty harmony namespace reexport */
41 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_59f3fab1_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_voteConfirm_vue__ = __webpack_require__(652);
42 function injectStyle (ssrContext) {
43   __webpack_require__(650)
44 }
45 var normalizeComponent = __webpack_require__(266)
46 /* script */
47
48
49 /* template */
50
51 /* template functional */
52 var __vue_template_functional__ = false
53 /* styles */
54 var __vue_styles__ = injectStyle
55 /* scopeId */
56 var __vue_scopeId__ = "data-v-59f3fab1"
57 /* moduleIdentifier (server only) */
58 var __vue_module_identifier__ = null
59 var Component = normalizeComponent(
60   __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_voteConfirm_vue__["a" /* default */],
61   __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_59f3fab1_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_voteConfirm_vue__["a" /* default */],
62   __vue_template_functional__,
63   __vue_styles__,
64   __vue_scopeId__,
65   __vue_module_identifier__
66 )
67
68 /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
69
70
71 /***/ }),
72
73 /***/ 576:
74 /***/ (function(module, exports, __webpack_require__) {
75
76 var __WEBPACK_AMD_DEFINE_RESULT__;;(function (globalObject) {\r
77   'use strict';\r
78 \r
79 /*\r
80  *      bignumber.js v9.0.0\r
81  *      A JavaScript library for arbitrary-precision arithmetic.\r
82  *      https://github.com/MikeMcl/bignumber.js\r
83  *      Copyright (c) 2019 Michael Mclaughlin <M8ch88l@gmail.com>\r
84  *      MIT Licensed.\r
85  *\r
86  *      BigNumber.prototype methods     |  BigNumber methods\r
87  *                                      |\r
88  *      absoluteValue            abs    |  clone\r
89  *      comparedTo                      |  config               set\r
90  *      decimalPlaces            dp     |      DECIMAL_PLACES\r
91  *      dividedBy                div    |      ROUNDING_MODE\r
92  *      dividedToIntegerBy       idiv   |      EXPONENTIAL_AT\r
93  *      exponentiatedBy          pow    |      RANGE\r
94  *      integerValue                    |      CRYPTO\r
95  *      isEqualTo                eq     |      MODULO_MODE\r
96  *      isFinite                        |      POW_PRECISION\r
97  *      isGreaterThan            gt     |      FORMAT\r
98  *      isGreaterThanOrEqualTo   gte    |      ALPHABET\r
99  *      isInteger                       |  isBigNumber\r
100  *      isLessThan               lt     |  maximum              max\r
101  *      isLessThanOrEqualTo      lte    |  minimum              min\r
102  *      isNaN                           |  random\r
103  *      isNegative                      |  sum\r
104  *      isPositive                      |\r
105  *      isZero                          |\r
106  *      minus                           |\r
107  *      modulo                   mod    |\r
108  *      multipliedBy             times  |\r
109  *      negated                         |\r
110  *      plus                            |\r
111  *      precision                sd     |\r
112  *      shiftedBy                       |\r
113  *      squareRoot               sqrt   |\r
114  *      toExponential                   |\r
115  *      toFixed                         |\r
116  *      toFormat                        |\r
117  *      toFraction                      |\r
118  *      toJSON                          |\r
119  *      toNumber                        |\r
120  *      toPrecision                     |\r
121  *      toString                        |\r
122  *      valueOf                         |\r
123  *\r
124  */\r
125 \r
126 \r
127   var BigNumber,\r
128     isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,\r
129     mathceil = Math.ceil,\r
130     mathfloor = Math.floor,\r
131 \r
132     bignumberError = '[BigNumber Error] ',\r
133     tooManyDigits = bignumberError + 'Number primitive has more than 15 significant digits: ',\r
134 \r
135     BASE = 1e14,\r
136     LOG_BASE = 14,\r
137     MAX_SAFE_INTEGER = 0x1fffffffffffff,         // 2^53 - 1\r
138     // MAX_INT32 = 0x7fffffff,                   // 2^31 - 1\r
139     POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13],\r
140     SQRT_BASE = 1e7,\r
141 \r
142     // EDITABLE\r
143     // The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and\r
144     // the arguments to toExponential, toFixed, toFormat, and toPrecision.\r
145     MAX = 1E9;                                   // 0 to MAX_INT32\r
146 \r
147 \r
148   /*\r
149    * Create and return a BigNumber constructor.\r
150    */\r
151   function clone(configObject) {\r
152     var div, convertBase, parseNumeric,\r
153       P = BigNumber.prototype = { constructor: BigNumber, toString: null, valueOf: null },\r
154       ONE = new BigNumber(1),\r
155 \r
156 \r
157       //----------------------------- EDITABLE CONFIG DEFAULTS -------------------------------\r
158 \r
159 \r
160       // The default values below must be integers within the inclusive ranges stated.\r
161       // The values can also be changed at run-time using BigNumber.set.\r
162 \r
163       // The maximum number of decimal places for operations involving division.\r
164       DECIMAL_PLACES = 20,                     // 0 to MAX\r
165 \r
166       // The rounding mode used when rounding to the above decimal places, and when using\r
167       // toExponential, toFixed, toFormat and toPrecision, and round (default value).\r
168       // UP         0 Away from zero.\r
169       // DOWN       1 Towards zero.\r
170       // CEIL       2 Towards +Infinity.\r
171       // FLOOR      3 Towards -Infinity.\r
172       // HALF_UP    4 Towards nearest neighbour. If equidistant, up.\r
173       // HALF_DOWN  5 Towards nearest neighbour. If equidistant, down.\r
174       // HALF_EVEN  6 Towards nearest neighbour. If equidistant, towards even neighbour.\r
175       // HALF_CEIL  7 Towards nearest neighbour. If equidistant, towards +Infinity.\r
176       // HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\r
177       ROUNDING_MODE = 4,                       // 0 to 8\r
178 \r
179       // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS]\r
180 \r
181       // The exponent value at and beneath which toString returns exponential notation.\r
182       // Number type: -7\r
183       TO_EXP_NEG = -7,                         // 0 to -MAX\r
184 \r
185       // The exponent value at and above which toString returns exponential notation.\r
186       // Number type: 21\r
187       TO_EXP_POS = 21,                         // 0 to MAX\r
188 \r
189       // RANGE : [MIN_EXP, MAX_EXP]\r
190 \r
191       // The minimum exponent value, beneath which underflow to zero occurs.\r
192       // Number type: -324  (5e-324)\r
193       MIN_EXP = -1e7,                          // -1 to -MAX\r
194 \r
195       // The maximum exponent value, above which overflow to Infinity occurs.\r
196       // Number type:  308  (1.7976931348623157e+308)\r
197       // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow.\r
198       MAX_EXP = 1e7,                           // 1 to MAX\r
199 \r
200       // Whether to use cryptographically-secure random number generation, if available.\r
201       CRYPTO = false,                          // true or false\r
202 \r
203       // The modulo mode used when calculating the modulus: a mod n.\r
204       // The quotient (q = a / n) is calculated according to the corresponding rounding mode.\r
205       // The remainder (r) is calculated as: r = a - n * q.\r
206       //\r
207       // UP        0 The remainder is positive if the dividend is negative, else is negative.\r
208       // DOWN      1 The remainder has the same sign as the dividend.\r
209       //             This modulo mode is commonly known as 'truncated division' and is\r
210       //             equivalent to (a % n) in JavaScript.\r
211       // FLOOR     3 The remainder has the same sign as the divisor (Python %).\r
212       // HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function.\r
213       // EUCLID    9 Euclidian division. q = sign(n) * floor(a / abs(n)).\r
214       //             The remainder is always positive.\r
215       //\r
216       // The truncated division, floored division, Euclidian division and IEEE 754 remainder\r
217       // modes are commonly used for the modulus operation.\r
218       // Although the other rounding modes can also be used, they may not give useful results.\r
219       MODULO_MODE = 1,                         // 0 to 9\r
220 \r
221       // The maximum number of significant digits of the result of the exponentiatedBy operation.\r
222       // If POW_PRECISION is 0, there will be unlimited significant digits.\r
223       POW_PRECISION = 0,                    // 0 to MAX\r
224 \r
225       // The format specification used by the BigNumber.prototype.toFormat method.\r
226       FORMAT = {\r
227         prefix: '',\r
228         groupSize: 3,\r
229         secondaryGroupSize: 0,\r
230         groupSeparator: ',',\r
231         decimalSeparator: '.',\r
232         fractionGroupSize: 0,\r
233         fractionGroupSeparator: '\xA0',      // non-breaking space\r
234         suffix: ''\r
235       },\r
236 \r
237       // The alphabet used for base conversion. It must be at least 2 characters long, with no '+',\r
238       // '-', '.', whitespace, or repeated character.\r
239       // '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_'\r
240       ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyz';\r
241 \r
242 \r
243     //------------------------------------------------------------------------------------------\r
244 \r
245 \r
246     // CONSTRUCTOR\r
247 \r
248 \r
249     /*\r
250      * The BigNumber constructor and exported function.\r
251      * Create and return a new instance of a BigNumber object.\r
252      *\r
253      * v {number|string|BigNumber} A numeric value.\r
254      * [b] {number} The base of v. Integer, 2 to ALPHABET.length inclusive.\r
255      */\r
256     function BigNumber(v, b) {\r
257       var alphabet, c, caseChanged, e, i, isNum, len, str,\r
258         x = this;\r
259 \r
260       // Enable constructor call without `new`.\r
261       if (!(x instanceof BigNumber)) return new BigNumber(v, b);\r
262 \r
263       if (b == null) {\r
264 \r
265         if (v && v._isBigNumber === true) {\r
266           x.s = v.s;\r
267 \r
268           if (!v.c || v.e > MAX_EXP) {\r
269             x.c = x.e = null;\r
270           } else if (v.e < MIN_EXP) {\r
271             x.c = [x.e = 0];\r
272           } else {\r
273             x.e = v.e;\r
274             x.c = v.c.slice();\r
275           }\r
276 \r
277           return;\r
278         }\r
279 \r
280         if ((isNum = typeof v == 'number') && v * 0 == 0) {\r
281 \r
282           // Use `1 / n` to handle minus zero also.\r
283           x.s = 1 / v < 0 ? (v = -v, -1) : 1;\r
284 \r
285           // Fast path for integers, where n < 2147483648 (2**31).\r
286           if (v === ~~v) {\r
287             for (e = 0, i = v; i >= 10; i /= 10, e++);\r
288 \r
289             if (e > MAX_EXP) {\r
290               x.c = x.e = null;\r
291             } else {\r
292               x.e = e;\r
293               x.c = [v];\r
294             }\r
295 \r
296             return;\r
297           }\r
298 \r
299           str = String(v);\r
300         } else {\r
301 \r
302           if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum);\r
303 \r
304           x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1;\r
305         }\r
306 \r
307         // Decimal point?\r
308         if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r
309 \r
310         // Exponential form?\r
311         if ((i = str.search(/e/i)) > 0) {\r
312 \r
313           // Determine exponent.\r
314           if (e < 0) e = i;\r
315           e += +str.slice(i + 1);\r
316           str = str.substring(0, i);\r
317         } else if (e < 0) {\r
318 \r
319           // Integer.\r
320           e = str.length;\r
321         }\r
322 \r
323       } else {\r
324 \r
325         // '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}'\r
326         intCheck(b, 2, ALPHABET.length, 'Base');\r
327 \r
328         // Allow exponential notation to be used with base 10 argument, while\r
329         // also rounding to DECIMAL_PLACES as with other bases.\r
330         if (b == 10) {\r
331           x = new BigNumber(v);\r
332           return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);\r
333         }\r
334 \r
335         str = String(v);\r
336 \r
337         if (isNum = typeof v == 'number') {\r
338 \r
339           // Avoid potential interpretation of Infinity and NaN as base 44+ values.\r
340           if (v * 0 != 0) return parseNumeric(x, str, isNum, b);\r
341 \r
342           x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1;\r
343 \r
344           // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}'\r
345           if (BigNumber.DEBUG && str.replace(/^0\.0*|\./, '').length > 15) {\r
346             throw Error\r
347              (tooManyDigits + v);\r
348           }\r
349         } else {\r
350           x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;\r
351         }\r
352 \r
353         alphabet = ALPHABET.slice(0, b);\r
354         e = i = 0;\r
355 \r
356         // Check that str is a valid base b number.\r
357         // Don't use RegExp, so alphabet can contain special characters.\r
358         for (len = str.length; i < len; i++) {\r
359           if (alphabet.indexOf(c = str.charAt(i)) < 0) {\r
360             if (c == '.') {\r
361 \r
362               // If '.' is not the first character and it has not be found before.\r
363               if (i > e) {\r
364                 e = len;\r
365                 continue;\r
366               }\r
367             } else if (!caseChanged) {\r
368 \r
369               // Allow e.g. hexadecimal 'FF' as well as 'ff'.\r
370               if (str == str.toUpperCase() && (str = str.toLowerCase()) ||\r
371                   str == str.toLowerCase() && (str = str.toUpperCase())) {\r
372                 caseChanged = true;\r
373                 i = -1;\r
374                 e = 0;\r
375                 continue;\r
376               }\r
377             }\r
378 \r
379             return parseNumeric(x, String(v), isNum, b);\r
380           }\r
381         }\r
382 \r
383         // Prevent later check for length on converted number.\r
384         isNum = false;\r
385         str = convertBase(str, b, 10, x.s);\r
386 \r
387         // Decimal point?\r
388         if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r
389         else e = str.length;\r
390       }\r
391 \r
392       // Determine leading zeros.\r
393       for (i = 0; str.charCodeAt(i) === 48; i++);\r
394 \r
395       // Determine trailing zeros.\r
396       for (len = str.length; str.charCodeAt(--len) === 48;);\r
397 \r
398       if (str = str.slice(i, ++len)) {\r
399         len -= i;\r
400 \r
401         // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}'\r
402         if (isNum && BigNumber.DEBUG &&\r
403           len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) {\r
404             throw Error\r
405              (tooManyDigits + (x.s * v));\r
406         }\r
407 \r
408          // Overflow?\r
409         if ((e = e - i - 1) > MAX_EXP) {\r
410 \r
411           // Infinity.\r
412           x.c = x.e = null;\r
413 \r
414         // Underflow?\r
415         } else if (e < MIN_EXP) {\r
416 \r
417           // Zero.\r
418           x.c = [x.e = 0];\r
419         } else {\r
420           x.e = e;\r
421           x.c = [];\r
422 \r
423           // Transform base\r
424 \r
425           // e is the base 10 exponent.\r
426           // i is where to slice str to get the first element of the coefficient array.\r
427           i = (e + 1) % LOG_BASE;\r
428           if (e < 0) i += LOG_BASE;  // i < 1\r
429 \r
430           if (i < len) {\r
431             if (i) x.c.push(+str.slice(0, i));\r
432 \r
433             for (len -= LOG_BASE; i < len;) {\r
434               x.c.push(+str.slice(i, i += LOG_BASE));\r
435             }\r
436 \r
437             i = LOG_BASE - (str = str.slice(i)).length;\r
438           } else {\r
439             i -= len;\r
440           }\r
441 \r
442           for (; i--; str += '0');\r
443           x.c.push(+str);\r
444         }\r
445       } else {\r
446 \r
447         // Zero.\r
448         x.c = [x.e = 0];\r
449       }\r
450     }\r
451 \r
452 \r
453     // CONSTRUCTOR PROPERTIES\r
454 \r
455 \r
456     BigNumber.clone = clone;\r
457 \r
458     BigNumber.ROUND_UP = 0;\r
459     BigNumber.ROUND_DOWN = 1;\r
460     BigNumber.ROUND_CEIL = 2;\r
461     BigNumber.ROUND_FLOOR = 3;\r
462     BigNumber.ROUND_HALF_UP = 4;\r
463     BigNumber.ROUND_HALF_DOWN = 5;\r
464     BigNumber.ROUND_HALF_EVEN = 6;\r
465     BigNumber.ROUND_HALF_CEIL = 7;\r
466     BigNumber.ROUND_HALF_FLOOR = 8;\r
467     BigNumber.EUCLID = 9;\r
468 \r
469 \r
470     /*\r
471      * Configure infrequently-changing library-wide settings.\r
472      *\r
473      * Accept an object with the following optional properties (if the value of a property is\r
474      * a number, it must be an integer within the inclusive range stated):\r
475      *\r
476      *   DECIMAL_PLACES   {number}           0 to MAX\r
477      *   ROUNDING_MODE    {number}           0 to 8\r
478      *   EXPONENTIAL_AT   {number|number[]}  -MAX to MAX  or  [-MAX to 0, 0 to MAX]\r
479      *   RANGE            {number|number[]}  -MAX to MAX (not zero)  or  [-MAX to -1, 1 to MAX]\r
480      *   CRYPTO           {boolean}          true or false\r
481      *   MODULO_MODE      {number}           0 to 9\r
482      *   POW_PRECISION       {number}           0 to MAX\r
483      *   ALPHABET         {string}           A string of two or more unique characters which does\r
484      *                                       not contain '.'.\r
485      *   FORMAT           {object}           An object with some of the following properties:\r
486      *     prefix                 {string}\r
487      *     groupSize              {number}\r
488      *     secondaryGroupSize     {number}\r
489      *     groupSeparator         {string}\r
490      *     decimalSeparator       {string}\r
491      *     fractionGroupSize      {number}\r
492      *     fractionGroupSeparator {string}\r
493      *     suffix                 {string}\r
494      *\r
495      * (The values assigned to the above FORMAT object properties are not checked for validity.)\r
496      *\r
497      * E.g.\r
498      * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 })\r
499      *\r
500      * Ignore properties/parameters set to null or undefined, except for ALPHABET.\r
501      *\r
502      * Return an object with the properties current values.\r
503      */\r
504     BigNumber.config = BigNumber.set = function (obj) {\r
505       var p, v;\r
506 \r
507       if (obj != null) {\r
508 \r
509         if (typeof obj == 'object') {\r
510 \r
511           // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive.\r
512           // '[BigNumber Error] DECIMAL_PLACES {not a primitive number|not an integer|out of range}: {v}'\r
513           if (obj.hasOwnProperty(p = 'DECIMAL_PLACES')) {\r
514             v = obj[p];\r
515             intCheck(v, 0, MAX, p);\r
516             DECIMAL_PLACES = v;\r
517           }\r
518 \r
519           // ROUNDING_MODE {number} Integer, 0 to 8 inclusive.\r
520           // '[BigNumber Error] ROUNDING_MODE {not a primitive number|not an integer|out of range}: {v}'\r
521           if (obj.hasOwnProperty(p = 'ROUNDING_MODE')) {\r
522             v = obj[p];\r
523             intCheck(v, 0, 8, p);\r
524             ROUNDING_MODE = v;\r
525           }\r
526 \r
527           // EXPONENTIAL_AT {number|number[]}\r
528           // Integer, -MAX to MAX inclusive or\r
529           // [integer -MAX to 0 inclusive, 0 to MAX inclusive].\r
530           // '[BigNumber Error] EXPONENTIAL_AT {not a primitive number|not an integer|out of range}: {v}'\r
531           if (obj.hasOwnProperty(p = 'EXPONENTIAL_AT')) {\r
532             v = obj[p];\r
533             if (v && v.pop) {\r
534               intCheck(v[0], -MAX, 0, p);\r
535               intCheck(v[1], 0, MAX, p);\r
536               TO_EXP_NEG = v[0];\r
537               TO_EXP_POS = v[1];\r
538             } else {\r
539               intCheck(v, -MAX, MAX, p);\r
540               TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);\r
541             }\r
542           }\r
543 \r
544           // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or\r
545           // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive].\r
546           // '[BigNumber Error] RANGE {not a primitive number|not an integer|out of range|cannot be zero}: {v}'\r
547           if (obj.hasOwnProperty(p = 'RANGE')) {\r
548             v = obj[p];\r
549             if (v && v.pop) {\r
550               intCheck(v[0], -MAX, -1, p);\r
551               intCheck(v[1], 1, MAX, p);\r
552               MIN_EXP = v[0];\r
553               MAX_EXP = v[1];\r
554             } else {\r
555               intCheck(v, -MAX, MAX, p);\r
556               if (v) {\r
557                 MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);\r
558               } else {\r
559                 throw Error\r
560                  (bignumberError + p + ' cannot be zero: ' + v);\r
561               }\r
562             }\r
563           }\r
564 \r
565           // CRYPTO {boolean} true or false.\r
566           // '[BigNumber Error] CRYPTO not true or false: {v}'\r
567           // '[BigNumber Error] crypto unavailable'\r
568           if (obj.hasOwnProperty(p = 'CRYPTO')) {\r
569             v = obj[p];\r
570             if (v === !!v) {\r
571               if (v) {\r
572                 if (typeof crypto != 'undefined' && crypto &&\r
573                  (crypto.getRandomValues || crypto.randomBytes)) {\r
574                   CRYPTO = v;\r
575                 } else {\r
576                   CRYPTO = !v;\r
577                   throw Error\r
578                    (bignumberError + 'crypto unavailable');\r
579                 }\r
580               } else {\r
581                 CRYPTO = v;\r
582               }\r
583             } else {\r
584               throw Error\r
585                (bignumberError + p + ' not true or false: ' + v);\r
586             }\r
587           }\r
588 \r
589           // MODULO_MODE {number} Integer, 0 to 9 inclusive.\r
590           // '[BigNumber Error] MODULO_MODE {not a primitive number|not an integer|out of range}: {v}'\r
591           if (obj.hasOwnProperty(p = 'MODULO_MODE')) {\r
592             v = obj[p];\r
593             intCheck(v, 0, 9, p);\r
594             MODULO_MODE = v;\r
595           }\r
596 \r
597           // POW_PRECISION {number} Integer, 0 to MAX inclusive.\r
598           // '[BigNumber Error] POW_PRECISION {not a primitive number|not an integer|out of range}: {v}'\r
599           if (obj.hasOwnProperty(p = 'POW_PRECISION')) {\r
600             v = obj[p];\r
601             intCheck(v, 0, MAX, p);\r
602             POW_PRECISION = v;\r
603           }\r
604 \r
605           // FORMAT {object}\r
606           // '[BigNumber Error] FORMAT not an object: {v}'\r
607           if (obj.hasOwnProperty(p = 'FORMAT')) {\r
608             v = obj[p];\r
609             if (typeof v == 'object') FORMAT = v;\r
610             else throw Error\r
611              (bignumberError + p + ' not an object: ' + v);\r
612           }\r
613 \r
614           // ALPHABET {string}\r
615           // '[BigNumber Error] ALPHABET invalid: {v}'\r
616           if (obj.hasOwnProperty(p = 'ALPHABET')) {\r
617             v = obj[p];\r
618 \r
619             // Disallow if only one character,\r
620             // or if it contains '+', '-', '.', whitespace, or a repeated character.\r
621             if (typeof v == 'string' && !/^.$|[+-.\s]|(.).*\1/.test(v)) {\r
622               ALPHABET = v;\r
623             } else {\r
624               throw Error\r
625                (bignumberError + p + ' invalid: ' + v);\r
626             }\r
627           }\r
628 \r
629         } else {\r
630 \r
631           // '[BigNumber Error] Object expected: {v}'\r
632           throw Error\r
633            (bignumberError + 'Object expected: ' + obj);\r
634         }\r
635       }\r
636 \r
637       return {\r
638         DECIMAL_PLACES: DECIMAL_PLACES,\r
639         ROUNDING_MODE: ROUNDING_MODE,\r
640         EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS],\r
641         RANGE: [MIN_EXP, MAX_EXP],\r
642         CRYPTO: CRYPTO,\r
643         MODULO_MODE: MODULO_MODE,\r
644         POW_PRECISION: POW_PRECISION,\r
645         FORMAT: FORMAT,\r
646         ALPHABET: ALPHABET\r
647       };\r
648     };\r
649 \r
650 \r
651     /*\r
652      * Return true if v is a BigNumber instance, otherwise return false.\r
653      *\r
654      * If BigNumber.DEBUG is true, throw if a BigNumber instance is not well-formed.\r
655      *\r
656      * v {any}\r
657      *\r
658      * '[BigNumber Error] Invalid BigNumber: {v}'\r
659      */\r
660     BigNumber.isBigNumber = function (v) {\r
661       if (!v || v._isBigNumber !== true) return false;\r
662       if (!BigNumber.DEBUG) return true;\r
663 \r
664       var i, n,\r
665         c = v.c,\r
666         e = v.e,\r
667         s = v.s;\r
668 \r
669       out: if ({}.toString.call(c) == '[object Array]') {\r
670 \r
671         if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {\r
672 \r
673           // If the first element is zero, the BigNumber value must be zero.\r
674           if (c[0] === 0) {\r
675             if (e === 0 && c.length === 1) return true;\r
676             break out;\r
677           }\r
678 \r
679           // Calculate number of digits that c[0] should have, based on the exponent.\r
680           i = (e + 1) % LOG_BASE;\r
681           if (i < 1) i += LOG_BASE;\r
682 \r
683           // Calculate number of digits of c[0].\r
684           //if (Math.ceil(Math.log(c[0] + 1) / Math.LN10) == i) {\r
685           if (String(c[0]).length == i) {\r
686 \r
687             for (i = 0; i < c.length; i++) {\r
688               n = c[i];\r
689               if (n < 0 || n >= BASE || n !== mathfloor(n)) break out;\r
690             }\r
691 \r
692             // Last element cannot be zero, unless it is the only element.\r
693             if (n !== 0) return true;\r
694           }\r
695         }\r
696 \r
697       // Infinity/NaN\r
698       } else if (c === null && e === null && (s === null || s === 1 || s === -1)) {\r
699         return true;\r
700       }\r
701 \r
702       throw Error\r
703         (bignumberError + 'Invalid BigNumber: ' + v);\r
704     };\r
705 \r
706 \r
707     /*\r
708      * Return a new BigNumber whose value is the maximum of the arguments.\r
709      *\r
710      * arguments {number|string|BigNumber}\r
711      */\r
712     BigNumber.maximum = BigNumber.max = function () {\r
713       return maxOrMin(arguments, P.lt);\r
714     };\r
715 \r
716 \r
717     /*\r
718      * Return a new BigNumber whose value is the minimum of the arguments.\r
719      *\r
720      * arguments {number|string|BigNumber}\r
721      */\r
722     BigNumber.minimum = BigNumber.min = function () {\r
723       return maxOrMin(arguments, P.gt);\r
724     };\r
725 \r
726 \r
727     /*\r
728      * Return a new BigNumber with a random value equal to or greater than 0 and less than 1,\r
729      * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing\r
730      * zeros are produced).\r
731      *\r
732      * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r
733      *\r
734      * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp}'\r
735      * '[BigNumber Error] crypto unavailable'\r
736      */\r
737     BigNumber.random = (function () {\r
738       var pow2_53 = 0x20000000000000;\r
739 \r
740       // Return a 53 bit integer n, where 0 <= n < 9007199254740992.\r
741       // Check if Math.random() produces more than 32 bits of randomness.\r
742       // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits.\r
743       // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1.\r
744       var random53bitInt = (Math.random() * pow2_53) & 0x1fffff\r
745        ? function () { return mathfloor(Math.random() * pow2_53); }\r
746        : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) +\r
747          (Math.random() * 0x800000 | 0); };\r
748 \r
749       return function (dp) {\r
750         var a, b, e, k, v,\r
751           i = 0,\r
752           c = [],\r
753           rand = new BigNumber(ONE);\r
754 \r
755         if (dp == null) dp = DECIMAL_PLACES;\r
756         else intCheck(dp, 0, MAX);\r
757 \r
758         k = mathceil(dp / LOG_BASE);\r
759 \r
760         if (CRYPTO) {\r
761 \r
762           // Browsers supporting crypto.getRandomValues.\r
763           if (crypto.getRandomValues) {\r
764 \r
765             a = crypto.getRandomValues(new Uint32Array(k *= 2));\r
766 \r
767             for (; i < k;) {\r
768 \r
769               // 53 bits:\r
770               // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2)\r
771               // 11111 11111111 11111111 11111111 11100000 00000000 00000000\r
772               // ((Math.pow(2, 32) - 1) >>> 11).toString(2)\r
773               //                                     11111 11111111 11111111\r
774               // 0x20000 is 2^21.\r
775               v = a[i] * 0x20000 + (a[i + 1] >>> 11);\r
776 \r
777               // Rejection sampling:\r
778               // 0 <= v < 9007199254740992\r
779               // Probability that v >= 9e15, is\r
780               // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251\r
781               if (v >= 9e15) {\r
782                 b = crypto.getRandomValues(new Uint32Array(2));\r
783                 a[i] = b[0];\r
784                 a[i + 1] = b[1];\r
785               } else {\r
786 \r
787                 // 0 <= v <= 8999999999999999\r
788                 // 0 <= (v % 1e14) <= 99999999999999\r
789                 c.push(v % 1e14);\r
790                 i += 2;\r
791               }\r
792             }\r
793             i = k / 2;\r
794 \r
795           // Node.js supporting crypto.randomBytes.\r
796           } else if (crypto.randomBytes) {\r
797 \r
798             // buffer\r
799             a = crypto.randomBytes(k *= 7);\r
800 \r
801             for (; i < k;) {\r
802 \r
803               // 0x1000000000000 is 2^48, 0x10000000000 is 2^40\r
804               // 0x100000000 is 2^32, 0x1000000 is 2^24\r
805               // 11111 11111111 11111111 11111111 11111111 11111111 11111111\r
806               // 0 <= v < 9007199254740992\r
807               v = ((a[i] & 31) * 0x1000000000000) + (a[i + 1] * 0x10000000000) +\r
808                  (a[i + 2] * 0x100000000) + (a[i + 3] * 0x1000000) +\r
809                  (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6];\r
810 \r
811               if (v >= 9e15) {\r
812                 crypto.randomBytes(7).copy(a, i);\r
813               } else {\r
814 \r
815                 // 0 <= (v % 1e14) <= 99999999999999\r
816                 c.push(v % 1e14);\r
817                 i += 7;\r
818               }\r
819             }\r
820             i = k / 7;\r
821           } else {\r
822             CRYPTO = false;\r
823             throw Error\r
824              (bignumberError + 'crypto unavailable');\r
825           }\r
826         }\r
827 \r
828         // Use Math.random.\r
829         if (!CRYPTO) {\r
830 \r
831           for (; i < k;) {\r
832             v = random53bitInt();\r
833             if (v < 9e15) c[i++] = v % 1e14;\r
834           }\r
835         }\r
836 \r
837         k = c[--i];\r
838         dp %= LOG_BASE;\r
839 \r
840         // Convert trailing digits to zeros according to dp.\r
841         if (k && dp) {\r
842           v = POWS_TEN[LOG_BASE - dp];\r
843           c[i] = mathfloor(k / v) * v;\r
844         }\r
845 \r
846         // Remove trailing elements which are zero.\r
847         for (; c[i] === 0; c.pop(), i--);\r
848 \r
849         // Zero?\r
850         if (i < 0) {\r
851           c = [e = 0];\r
852         } else {\r
853 \r
854           // Remove leading elements which are zero and adjust exponent accordingly.\r
855           for (e = -1 ; c[0] === 0; c.splice(0, 1), e -= LOG_BASE);\r
856 \r
857           // Count the digits of the first element of c to determine leading zeros, and...\r
858           for (i = 1, v = c[0]; v >= 10; v /= 10, i++);\r
859 \r
860           // adjust the exponent accordingly.\r
861           if (i < LOG_BASE) e -= LOG_BASE - i;\r
862         }\r
863 \r
864         rand.e = e;\r
865         rand.c = c;\r
866         return rand;\r
867       };\r
868     })();\r
869 \r
870 \r
871     /*\r
872      * Return a BigNumber whose value is the sum of the arguments.\r
873      *\r
874      * arguments {number|string|BigNumber}\r
875      */\r
876     BigNumber.sum = function () {\r
877       var i = 1,\r
878         args = arguments,\r
879         sum = new BigNumber(args[0]);\r
880       for (; i < args.length;) sum = sum.plus(args[i++]);\r
881       return sum;\r
882     };\r
883 \r
884 \r
885     // PRIVATE FUNCTIONS\r
886 \r
887 \r
888     // Called by BigNumber and BigNumber.prototype.toString.\r
889     convertBase = (function () {\r
890       var decimal = '0123456789';\r
891 \r
892       /*\r
893        * Convert string of baseIn to an array of numbers of baseOut.\r
894        * Eg. toBaseOut('255', 10, 16) returns [15, 15].\r
895        * Eg. toBaseOut('ff', 16, 10) returns [2, 5, 5].\r
896        */\r
897       function toBaseOut(str, baseIn, baseOut, alphabet) {\r
898         var j,\r
899           arr = [0],\r
900           arrL,\r
901           i = 0,\r
902           len = str.length;\r
903 \r
904         for (; i < len;) {\r
905           for (arrL = arr.length; arrL--; arr[arrL] *= baseIn);\r
906 \r
907           arr[0] += alphabet.indexOf(str.charAt(i++));\r
908 \r
909           for (j = 0; j < arr.length; j++) {\r
910 \r
911             if (arr[j] > baseOut - 1) {\r
912               if (arr[j + 1] == null) arr[j + 1] = 0;\r
913               arr[j + 1] += arr[j] / baseOut | 0;\r
914               arr[j] %= baseOut;\r
915             }\r
916           }\r
917         }\r
918 \r
919         return arr.reverse();\r
920       }\r
921 \r
922       // Convert a numeric string of baseIn to a numeric string of baseOut.\r
923       // If the caller is toString, we are converting from base 10 to baseOut.\r
924       // If the caller is BigNumber, we are converting from baseIn to base 10.\r
925       return function (str, baseIn, baseOut, sign, callerIsToString) {\r
926         var alphabet, d, e, k, r, x, xc, y,\r
927           i = str.indexOf('.'),\r
928           dp = DECIMAL_PLACES,\r
929           rm = ROUNDING_MODE;\r
930 \r
931         // Non-integer.\r
932         if (i >= 0) {\r
933           k = POW_PRECISION;\r
934 \r
935           // Unlimited precision.\r
936           POW_PRECISION = 0;\r
937           str = str.replace('.', '');\r
938           y = new BigNumber(baseIn);\r
939           x = y.pow(str.length - i);\r
940           POW_PRECISION = k;\r
941 \r
942           // Convert str as if an integer, then restore the fraction part by dividing the\r
943           // result by its base raised to a power.\r
944 \r
945           y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e, '0'),\r
946            10, baseOut, decimal);\r
947           y.e = y.c.length;\r
948         }\r
949 \r
950         // Convert the number as integer.\r
951 \r
952         xc = toBaseOut(str, baseIn, baseOut, callerIsToString\r
953          ? (alphabet = ALPHABET, decimal)\r
954          : (alphabet = decimal, ALPHABET));\r
955 \r
956         // xc now represents str as an integer and converted to baseOut. e is the exponent.\r
957         e = k = xc.length;\r
958 \r
959         // Remove trailing zeros.\r
960         for (; xc[--k] == 0; xc.pop());\r
961 \r
962         // Zero?\r
963         if (!xc[0]) return alphabet.charAt(0);\r
964 \r
965         // Does str represent an integer? If so, no need for the division.\r
966         if (i < 0) {\r
967           --e;\r
968         } else {\r
969           x.c = xc;\r
970           x.e = e;\r
971 \r
972           // The sign is needed for correct rounding.\r
973           x.s = sign;\r
974           x = div(x, y, dp, rm, baseOut);\r
975           xc = x.c;\r
976           r = x.r;\r
977           e = x.e;\r
978         }\r
979 \r
980         // xc now represents str converted to baseOut.\r
981 \r
982         // THe index of the rounding digit.\r
983         d = e + dp + 1;\r
984 \r
985         // The rounding digit: the digit to the right of the digit that may be rounded up.\r
986         i = xc[d];\r
987 \r
988         // Look at the rounding digits and mode to determine whether to round up.\r
989 \r
990         k = baseOut / 2;\r
991         r = r || d < 0 || xc[d + 1] != null;\r
992 \r
993         r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r
994               : i > k || i == k &&(rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\r
995                rm == (x.s < 0 ? 8 : 7));\r
996 \r
997         // If the index of the rounding digit is not greater than zero, or xc represents\r
998         // zero, then the result of the base conversion is zero or, if rounding up, a value\r
999         // such as 0.00001.\r
1000         if (d < 1 || !xc[0]) {\r
1001 \r
1002           // 1^-dp or 0\r
1003           str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);\r
1004         } else {\r
1005 \r
1006           // Truncate xc to the required number of decimal places.\r
1007           xc.length = d;\r
1008 \r
1009           // Round up?\r
1010           if (r) {\r
1011 \r
1012             // Rounding up may mean the previous digit has to be rounded up and so on.\r
1013             for (--baseOut; ++xc[--d] > baseOut;) {\r
1014               xc[d] = 0;\r
1015 \r
1016               if (!d) {\r
1017                 ++e;\r
1018                 xc = [1].concat(xc);\r
1019               }\r
1020             }\r
1021           }\r
1022 \r
1023           // Determine trailing zeros.\r
1024           for (k = xc.length; !xc[--k];);\r
1025 \r
1026           // E.g. [4, 11, 15] becomes 4bf.\r
1027           for (i = 0, str = ''; i <= k; str += alphabet.charAt(xc[i++]));\r
1028 \r
1029           // Add leading zeros, decimal point and trailing zeros as required.\r
1030           str = toFixedPoint(str, e, alphabet.charAt(0));\r
1031         }\r
1032 \r
1033         // The caller will add the sign.\r
1034         return str;\r
1035       };\r
1036     })();\r
1037 \r
1038 \r
1039     // Perform division in the specified base. Called by div and convertBase.\r
1040     div = (function () {\r
1041 \r
1042       // Assume non-zero x and k.\r
1043       function multiply(x, k, base) {\r
1044         var m, temp, xlo, xhi,\r
1045           carry = 0,\r
1046           i = x.length,\r
1047           klo = k % SQRT_BASE,\r
1048           khi = k / SQRT_BASE | 0;\r
1049 \r
1050         for (x = x.slice(); i--;) {\r
1051           xlo = x[i] % SQRT_BASE;\r
1052           xhi = x[i] / SQRT_BASE | 0;\r
1053           m = khi * xlo + xhi * klo;\r
1054           temp = klo * xlo + ((m % SQRT_BASE) * SQRT_BASE) + carry;\r
1055           carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi;\r
1056           x[i] = temp % base;\r
1057         }\r
1058 \r
1059         if (carry) x = [carry].concat(x);\r
1060 \r
1061         return x;\r
1062       }\r
1063 \r
1064       function compare(a, b, aL, bL) {\r
1065         var i, cmp;\r
1066 \r
1067         if (aL != bL) {\r
1068           cmp = aL > bL ? 1 : -1;\r
1069         } else {\r
1070 \r
1071           for (i = cmp = 0; i < aL; i++) {\r
1072 \r
1073             if (a[i] != b[i]) {\r
1074               cmp = a[i] > b[i] ? 1 : -1;\r
1075               break;\r
1076             }\r
1077           }\r
1078         }\r
1079 \r
1080         return cmp;\r
1081       }\r
1082 \r
1083       function subtract(a, b, aL, base) {\r
1084         var i = 0;\r
1085 \r
1086         // Subtract b from a.\r
1087         for (; aL--;) {\r
1088           a[aL] -= i;\r
1089           i = a[aL] < b[aL] ? 1 : 0;\r
1090           a[aL] = i * base + a[aL] - b[aL];\r
1091         }\r
1092 \r
1093         // Remove leading zeros.\r
1094         for (; !a[0] && a.length > 1; a.splice(0, 1));\r
1095       }\r
1096 \r
1097       // x: dividend, y: divisor.\r
1098       return function (x, y, dp, rm, base) {\r
1099         var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0,\r
1100           yL, yz,\r
1101           s = x.s == y.s ? 1 : -1,\r
1102           xc = x.c,\r
1103           yc = y.c;\r
1104 \r
1105         // Either NaN, Infinity or 0?\r
1106         if (!xc || !xc[0] || !yc || !yc[0]) {\r
1107 \r
1108           return new BigNumber(\r
1109 \r
1110            // Return NaN if either NaN, or both Infinity or 0.\r
1111            !x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN :\r
1112 \r
1113             // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.\r
1114             xc && xc[0] == 0 || !yc ? s * 0 : s / 0\r
1115          );\r
1116         }\r
1117 \r
1118         q = new BigNumber(s);\r
1119         qc = q.c = [];\r
1120         e = x.e - y.e;\r
1121         s = dp + e + 1;\r
1122 \r
1123         if (!base) {\r
1124           base = BASE;\r
1125           e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE);\r
1126           s = s / LOG_BASE | 0;\r
1127         }\r
1128 \r
1129         // Result exponent may be one less then the current value of e.\r
1130         // The coefficients of the BigNumbers from convertBase may have trailing zeros.\r
1131         for (i = 0; yc[i] == (xc[i] || 0); i++);\r
1132 \r
1133         if (yc[i] > (xc[i] || 0)) e--;\r
1134 \r
1135         if (s < 0) {\r
1136           qc.push(1);\r
1137           more = true;\r
1138         } else {\r
1139           xL = xc.length;\r
1140           yL = yc.length;\r
1141           i = 0;\r
1142           s += 2;\r
1143 \r
1144           // Normalise xc and yc so highest order digit of yc is >= base / 2.\r
1145 \r
1146           n = mathfloor(base / (yc[0] + 1));\r
1147 \r
1148           // Not necessary, but to handle odd bases where yc[0] == (base / 2) - 1.\r
1149           // if (n > 1 || n++ == 1 && yc[0] < base / 2) {\r
1150           if (n > 1) {\r
1151             yc = multiply(yc, n, base);\r
1152             xc = multiply(xc, n, base);\r
1153             yL = yc.length;\r
1154             xL = xc.length;\r
1155           }\r
1156 \r
1157           xi = yL;\r
1158           rem = xc.slice(0, yL);\r
1159           remL = rem.length;\r
1160 \r
1161           // Add zeros to make remainder as long as divisor.\r
1162           for (; remL < yL; rem[remL++] = 0);\r
1163           yz = yc.slice();\r
1164           yz = [0].concat(yz);\r
1165           yc0 = yc[0];\r
1166           if (yc[1] >= base / 2) yc0++;\r
1167           // Not necessary, but to prevent trial digit n > base, when using base 3.\r
1168           // else if (base == 3 && yc0 == 1) yc0 = 1 + 1e-15;\r
1169 \r
1170           do {\r
1171             n = 0;\r
1172 \r
1173             // Compare divisor and remainder.\r
1174             cmp = compare(yc, rem, yL, remL);\r
1175 \r
1176             // If divisor < remainder.\r
1177             if (cmp < 0) {\r
1178 \r
1179               // Calculate trial digit, n.\r
1180 \r
1181               rem0 = rem[0];\r
1182               if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);\r
1183 \r
1184               // n is how many times the divisor goes into the current remainder.\r
1185               n = mathfloor(rem0 / yc0);\r
1186 \r
1187               //  Algorithm:\r
1188               //  product = divisor multiplied by trial digit (n).\r
1189               //  Compare product and remainder.\r
1190               //  If product is greater than remainder:\r
1191               //    Subtract divisor from product, decrement trial digit.\r
1192               //  Subtract product from remainder.\r
1193               //  If product was less than remainder at the last compare:\r
1194               //    Compare new remainder and divisor.\r
1195               //    If remainder is greater than divisor:\r
1196               //      Subtract divisor from remainder, increment trial digit.\r
1197 \r
1198               if (n > 1) {\r
1199 \r
1200                 // n may be > base only when base is 3.\r
1201                 if (n >= base) n = base - 1;\r
1202 \r
1203                 // product = divisor * trial digit.\r
1204                 prod = multiply(yc, n, base);\r
1205                 prodL = prod.length;\r
1206                 remL = rem.length;\r
1207 \r
1208                 // Compare product and remainder.\r
1209                 // If product > remainder then trial digit n too high.\r
1210                 // n is 1 too high about 5% of the time, and is not known to have\r
1211                 // ever been more than 1 too high.\r
1212                 while (compare(prod, rem, prodL, remL) == 1) {\r
1213                   n--;\r
1214 \r
1215                   // Subtract divisor from product.\r
1216                   subtract(prod, yL < prodL ? yz : yc, prodL, base);\r
1217                   prodL = prod.length;\r
1218                   cmp = 1;\r
1219                 }\r
1220               } else {\r
1221 \r
1222                 // n is 0 or 1, cmp is -1.\r
1223                 // If n is 0, there is no need to compare yc and rem again below,\r
1224                 // so change cmp to 1 to avoid it.\r
1225                 // If n is 1, leave cmp as -1, so yc and rem are compared again.\r
1226                 if (n == 0) {\r
1227 \r
1228                   // divisor < remainder, so n must be at least 1.\r
1229                   cmp = n = 1;\r
1230                 }\r
1231 \r
1232                 // product = divisor\r
1233                 prod = yc.slice();\r
1234                 prodL = prod.length;\r
1235               }\r
1236 \r
1237               if (prodL < remL) prod = [0].concat(prod);\r
1238 \r
1239               // Subtract product from remainder.\r
1240               subtract(rem, prod, remL, base);\r
1241               remL = rem.length;\r
1242 \r
1243                // If product was < remainder.\r
1244               if (cmp == -1) {\r
1245 \r
1246                 // Compare divisor and new remainder.\r
1247                 // If divisor < new remainder, subtract divisor from remainder.\r
1248                 // Trial digit n too low.\r
1249                 // n is 1 too low about 5% of the time, and very rarely 2 too low.\r
1250                 while (compare(yc, rem, yL, remL) < 1) {\r
1251                   n++;\r
1252 \r
1253                   // Subtract divisor from remainder.\r
1254                   subtract(rem, yL < remL ? yz : yc, remL, base);\r
1255                   remL = rem.length;\r
1256                 }\r
1257               }\r
1258             } else if (cmp === 0) {\r
1259               n++;\r
1260               rem = [0];\r
1261             } // else cmp === 1 and n will be 0\r
1262 \r
1263             // Add the next digit, n, to the result array.\r
1264             qc[i++] = n;\r
1265 \r
1266             // Update the remainder.\r
1267             if (rem[0]) {\r
1268               rem[remL++] = xc[xi] || 0;\r
1269             } else {\r
1270               rem = [xc[xi]];\r
1271               remL = 1;\r
1272             }\r
1273           } while ((xi++ < xL || rem[0] != null) && s--);\r
1274 \r
1275           more = rem[0] != null;\r
1276 \r
1277           // Leading zero?\r
1278           if (!qc[0]) qc.splice(0, 1);\r
1279         }\r
1280 \r
1281         if (base == BASE) {\r
1282 \r
1283           // To calculate q.e, first get the number of digits of qc[0].\r
1284           for (i = 1, s = qc[0]; s >= 10; s /= 10, i++);\r
1285 \r
1286           round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more);\r
1287 \r
1288         // Caller is convertBase.\r
1289         } else {\r
1290           q.e = e;\r
1291           q.r = +more;\r
1292         }\r
1293 \r
1294         return q;\r
1295       };\r
1296     })();\r
1297 \r
1298 \r
1299     /*\r
1300      * Return a string representing the value of BigNumber n in fixed-point or exponential\r
1301      * notation rounded to the specified decimal places or significant digits.\r
1302      *\r
1303      * n: a BigNumber.\r
1304      * i: the index of the last digit required (i.e. the digit that may be rounded up).\r
1305      * rm: the rounding mode.\r
1306      * id: 1 (toExponential) or 2 (toPrecision).\r
1307      */\r
1308     function format(n, i, rm, id) {\r
1309       var c0, e, ne, len, str;\r
1310 \r
1311       if (rm == null) rm = ROUNDING_MODE;\r
1312       else intCheck(rm, 0, 8);\r
1313 \r
1314       if (!n.c) return n.toString();\r
1315 \r
1316       c0 = n.c[0];\r
1317       ne = n.e;\r
1318 \r
1319       if (i == null) {\r
1320         str = coeffToString(n.c);\r
1321         str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS)\r
1322          ? toExponential(str, ne)\r
1323          : toFixedPoint(str, ne, '0');\r
1324       } else {\r
1325         n = round(new BigNumber(n), i, rm);\r
1326 \r
1327         // n.e may have changed if the value was rounded up.\r
1328         e = n.e;\r
1329 \r
1330         str = coeffToString(n.c);\r
1331         len = str.length;\r
1332 \r
1333         // toPrecision returns exponential notation if the number of significant digits\r
1334         // specified is less than the number of digits necessary to represent the integer\r
1335         // part of the value in fixed-point notation.\r
1336 \r
1337         // Exponential notation.\r
1338         if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) {\r
1339 \r
1340           // Append zeros?\r
1341           for (; len < i; str += '0', len++);\r
1342           str = toExponential(str, e);\r
1343 \r
1344         // Fixed-point notation.\r
1345         } else {\r
1346           i -= ne;\r
1347           str = toFixedPoint(str, e, '0');\r
1348 \r
1349           // Append zeros?\r
1350           if (e + 1 > len) {\r
1351             if (--i > 0) for (str += '.'; i--; str += '0');\r
1352           } else {\r
1353             i += e - len;\r
1354             if (i > 0) {\r
1355               if (e + 1 == len) str += '.';\r
1356               for (; i--; str += '0');\r
1357             }\r
1358           }\r
1359         }\r
1360       }\r
1361 \r
1362       return n.s < 0 && c0 ? '-' + str : str;\r
1363     }\r
1364 \r
1365 \r
1366     // Handle BigNumber.max and BigNumber.min.\r
1367     function maxOrMin(args, method) {\r
1368       var n,\r
1369         i = 1,\r
1370         m = new BigNumber(args[0]);\r
1371 \r
1372       for (; i < args.length; i++) {\r
1373         n = new BigNumber(args[i]);\r
1374 \r
1375         // If any number is NaN, return NaN.\r
1376         if (!n.s) {\r
1377           m = n;\r
1378           break;\r
1379         } else if (method.call(m, n)) {\r
1380           m = n;\r
1381         }\r
1382       }\r
1383 \r
1384       return m;\r
1385     }\r
1386 \r
1387 \r
1388     /*\r
1389      * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP.\r
1390      * Called by minus, plus and times.\r
1391      */\r
1392     function normalise(n, c, e) {\r
1393       var i = 1,\r
1394         j = c.length;\r
1395 \r
1396        // Remove trailing zeros.\r
1397       for (; !c[--j]; c.pop());\r
1398 \r
1399       // Calculate the base 10 exponent. First get the number of digits of c[0].\r
1400       for (j = c[0]; j >= 10; j /= 10, i++);\r
1401 \r
1402       // Overflow?\r
1403       if ((e = i + e * LOG_BASE - 1) > MAX_EXP) {\r
1404 \r
1405         // Infinity.\r
1406         n.c = n.e = null;\r
1407 \r
1408       // Underflow?\r
1409       } else if (e < MIN_EXP) {\r
1410 \r
1411         // Zero.\r
1412         n.c = [n.e = 0];\r
1413       } else {\r
1414         n.e = e;\r
1415         n.c = c;\r
1416       }\r
1417 \r
1418       return n;\r
1419     }\r
1420 \r
1421 \r
1422     // Handle values that fail the validity test in BigNumber.\r
1423     parseNumeric = (function () {\r
1424       var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i,\r
1425         dotAfter = /^([^.]+)\.$/,\r
1426         dotBefore = /^\.([^.]+)$/,\r
1427         isInfinityOrNaN = /^-?(Infinity|NaN)$/,\r
1428         whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g;\r
1429 \r
1430       return function (x, str, isNum, b) {\r
1431         var base,\r
1432           s = isNum ? str : str.replace(whitespaceOrPlus, '');\r
1433 \r
1434         // No exception on ±Infinity or NaN.\r
1435         if (isInfinityOrNaN.test(s)) {\r
1436           x.s = isNaN(s) ? null : s < 0 ? -1 : 1;\r
1437         } else {\r
1438           if (!isNum) {\r
1439 \r
1440             // basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i\r
1441             s = s.replace(basePrefix, function (m, p1, p2) {\r
1442               base = (p2 = p2.toLowerCase()) == 'x' ? 16 : p2 == 'b' ? 2 : 8;\r
1443               return !b || b == base ? p1 : m;\r
1444             });\r
1445 \r
1446             if (b) {\r
1447               base = b;\r
1448 \r
1449               // E.g. '1.' to '1', '.1' to '0.1'\r
1450               s = s.replace(dotAfter, '$1').replace(dotBefore, '0.$1');\r
1451             }\r
1452 \r
1453             if (str != s) return new BigNumber(s, base);\r
1454           }\r
1455 \r
1456           // '[BigNumber Error] Not a number: {n}'\r
1457           // '[BigNumber Error] Not a base {b} number: {n}'\r
1458           if (BigNumber.DEBUG) {\r
1459             throw Error\r
1460               (bignumberError + 'Not a' + (b ? ' base ' + b : '') + ' number: ' + str);\r
1461           }\r
1462 \r
1463           // NaN\r
1464           x.s = null;\r
1465         }\r
1466 \r
1467         x.c = x.e = null;\r
1468       }\r
1469     })();\r
1470 \r
1471 \r
1472     /*\r
1473      * Round x to sd significant digits using rounding mode rm. Check for over/under-flow.\r
1474      * If r is truthy, it is known that there are more digits after the rounding digit.\r
1475      */\r
1476     function round(x, sd, rm, r) {\r
1477       var d, i, j, k, n, ni, rd,\r
1478         xc = x.c,\r
1479         pows10 = POWS_TEN;\r
1480 \r
1481       // if x is not Infinity or NaN...\r
1482       if (xc) {\r
1483 \r
1484         // rd is the rounding digit, i.e. the digit after the digit that may be rounded up.\r
1485         // n is a base 1e14 number, the value of the element of array x.c containing rd.\r
1486         // ni is the index of n within x.c.\r
1487         // d is the number of digits of n.\r
1488         // i is the index of rd within n including leading zeros.\r
1489         // j is the actual index of rd within n (if < 0, rd is a leading zero).\r
1490         out: {\r
1491 \r
1492           // Get the number of digits of the first element of xc.\r
1493           for (d = 1, k = xc[0]; k >= 10; k /= 10, d++);\r
1494           i = sd - d;\r
1495 \r
1496           // If the rounding digit is in the first element of xc...\r
1497           if (i < 0) {\r
1498             i += LOG_BASE;\r
1499             j = sd;\r
1500             n = xc[ni = 0];\r
1501 \r
1502             // Get the rounding digit at index j of n.\r
1503             rd = n / pows10[d - j - 1] % 10 | 0;\r
1504           } else {\r
1505             ni = mathceil((i + 1) / LOG_BASE);\r
1506 \r
1507             if (ni >= xc.length) {\r
1508 \r
1509               if (r) {\r
1510 \r
1511                 // Needed by sqrt.\r
1512                 for (; xc.length <= ni; xc.push(0));\r
1513                 n = rd = 0;\r
1514                 d = 1;\r
1515                 i %= LOG_BASE;\r
1516                 j = i - LOG_BASE + 1;\r
1517               } else {\r
1518                 break out;\r
1519               }\r
1520             } else {\r
1521               n = k = xc[ni];\r
1522 \r
1523               // Get the number of digits of n.\r
1524               for (d = 1; k >= 10; k /= 10, d++);\r
1525 \r
1526               // Get the index of rd within n.\r
1527               i %= LOG_BASE;\r
1528 \r
1529               // Get the index of rd within n, adjusted for leading zeros.\r
1530               // The number of leading zeros of n is given by LOG_BASE - d.\r
1531               j = i - LOG_BASE + d;\r
1532 \r
1533               // Get the rounding digit at index j of n.\r
1534               rd = j < 0 ? 0 : n / pows10[d - j - 1] % 10 | 0;\r
1535             }\r
1536           }\r
1537 \r
1538           r = r || sd < 0 ||\r
1539 \r
1540           // Are there any non-zero digits after the rounding digit?\r
1541           // The expression  n % pows10[d - j - 1]  returns all digits of n to the right\r
1542           // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.\r
1543            xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]);\r
1544 \r
1545           r = rm < 4\r
1546            ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r
1547            : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 &&\r
1548 \r
1549             // Check whether the digit to the left of the rounding digit is odd.\r
1550             ((i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10) & 1 ||\r
1551              rm == (x.s < 0 ? 8 : 7));\r
1552 \r
1553           if (sd < 1 || !xc[0]) {\r
1554             xc.length = 0;\r
1555 \r
1556             if (r) {\r
1557 \r
1558               // Convert sd to decimal places.\r
1559               sd -= x.e + 1;\r
1560 \r
1561               // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r
1562               xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE];\r
1563               x.e = -sd || 0;\r
1564             } else {\r
1565 \r
1566               // Zero.\r
1567               xc[0] = x.e = 0;\r
1568             }\r
1569 \r
1570             return x;\r
1571           }\r
1572 \r
1573           // Remove excess digits.\r
1574           if (i == 0) {\r
1575             xc.length = ni;\r
1576             k = 1;\r
1577             ni--;\r
1578           } else {\r
1579             xc.length = ni + 1;\r
1580             k = pows10[LOG_BASE - i];\r
1581 \r
1582             // E.g. 56700 becomes 56000 if 7 is the rounding digit.\r
1583             // j > 0 means i > number of leading zeros of n.\r
1584             xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0;\r
1585           }\r
1586 \r
1587           // Round up?\r
1588           if (r) {\r
1589 \r
1590             for (; ;) {\r
1591 \r
1592               // If the digit to be rounded up is in the first element of xc...\r
1593               if (ni == 0) {\r
1594 \r
1595                 // i will be the length of xc[0] before k is added.\r
1596                 for (i = 1, j = xc[0]; j >= 10; j /= 10, i++);\r
1597                 j = xc[0] += k;\r
1598                 for (k = 1; j >= 10; j /= 10, k++);\r
1599 \r
1600                 // if i != k the length has increased.\r
1601                 if (i != k) {\r
1602                   x.e++;\r
1603                   if (xc[0] == BASE) xc[0] = 1;\r
1604                 }\r
1605 \r
1606                 break;\r
1607               } else {\r
1608                 xc[ni] += k;\r
1609                 if (xc[ni] != BASE) break;\r
1610                 xc[ni--] = 0;\r
1611                 k = 1;\r
1612               }\r
1613             }\r
1614           }\r
1615 \r
1616           // Remove trailing zeros.\r
1617           for (i = xc.length; xc[--i] === 0; xc.pop());\r
1618         }\r
1619 \r
1620         // Overflow? Infinity.\r
1621         if (x.e > MAX_EXP) {\r
1622           x.c = x.e = null;\r
1623 \r
1624         // Underflow? Zero.\r
1625         } else if (x.e < MIN_EXP) {\r
1626           x.c = [x.e = 0];\r
1627         }\r
1628       }\r
1629 \r
1630       return x;\r
1631     }\r
1632 \r
1633 \r
1634     function valueOf(n) {\r
1635       var str,\r
1636         e = n.e;\r
1637 \r
1638       if (e === null) return n.toString();\r
1639 \r
1640       str = coeffToString(n.c);\r
1641 \r
1642       str = e <= TO_EXP_NEG || e >= TO_EXP_POS\r
1643         ? toExponential(str, e)\r
1644         : toFixedPoint(str, e, '0');\r
1645 \r
1646       return n.s < 0 ? '-' + str : str;\r
1647     }\r
1648 \r
1649 \r
1650     // PROTOTYPE/INSTANCE METHODS\r
1651 \r
1652 \r
1653     /*\r
1654      * Return a new BigNumber whose value is the absolute value of this BigNumber.\r
1655      */\r
1656     P.absoluteValue = P.abs = function () {\r
1657       var x = new BigNumber(this);\r
1658       if (x.s < 0) x.s = 1;\r
1659       return x;\r
1660     };\r
1661 \r
1662 \r
1663     /*\r
1664      * Return\r
1665      *   1 if the value of this BigNumber is greater than the value of BigNumber(y, b),\r
1666      *   -1 if the value of this BigNumber is less than the value of BigNumber(y, b),\r
1667      *   0 if they have the same value,\r
1668      *   or null if the value of either is NaN.\r
1669      */\r
1670     P.comparedTo = function (y, b) {\r
1671       return compare(this, new BigNumber(y, b));\r
1672     };\r
1673 \r
1674 \r
1675     /*\r
1676      * If dp is undefined or null or true or false, return the number of decimal places of the\r
1677      * value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN.\r
1678      *\r
1679      * Otherwise, if dp is a number, return a new BigNumber whose value is the value of this\r
1680      * BigNumber rounded to a maximum of dp decimal places using rounding mode rm, or\r
1681      * ROUNDING_MODE if rm is omitted.\r
1682      *\r
1683      * [dp] {number} Decimal places: integer, 0 to MAX inclusive.\r
1684      * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r
1685      *\r
1686      * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r
1687      */\r
1688     P.decimalPlaces = P.dp = function (dp, rm) {\r
1689       var c, n, v,\r
1690         x = this;\r
1691 \r
1692       if (dp != null) {\r
1693         intCheck(dp, 0, MAX);\r
1694         if (rm == null) rm = ROUNDING_MODE;\r
1695         else intCheck(rm, 0, 8);\r
1696 \r
1697         return round(new BigNumber(x), dp + x.e + 1, rm);\r
1698       }\r
1699 \r
1700       if (!(c = x.c)) return null;\r
1701       n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;\r
1702 \r
1703       // Subtract the number of trailing zeros of the last number.\r
1704       if (v = c[v]) for (; v % 10 == 0; v /= 10, n--);\r
1705       if (n < 0) n = 0;\r
1706 \r
1707       return n;\r
1708     };\r
1709 \r
1710 \r
1711     /*\r
1712      *  n / 0 = I\r
1713      *  n / N = N\r
1714      *  n / I = 0\r
1715      *  0 / n = 0\r
1716      *  0 / 0 = N\r
1717      *  0 / N = N\r
1718      *  0 / I = 0\r
1719      *  N / n = N\r
1720      *  N / 0 = N\r
1721      *  N / N = N\r
1722      *  N / I = N\r
1723      *  I / n = I\r
1724      *  I / 0 = I\r
1725      *  I / N = N\r
1726      *  I / I = N\r
1727      *\r
1728      * Return a new BigNumber whose value is the value of this BigNumber divided by the value of\r
1729      * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE.\r
1730      */\r
1731     P.dividedBy = P.div = function (y, b) {\r
1732       return div(this, new BigNumber(y, b), DECIMAL_PLACES, ROUNDING_MODE);\r
1733     };\r
1734 \r
1735 \r
1736     /*\r
1737      * Return a new BigNumber whose value is the integer part of dividing the value of this\r
1738      * BigNumber by the value of BigNumber(y, b).\r
1739      */\r
1740     P.dividedToIntegerBy = P.idiv = function (y, b) {\r
1741       return div(this, new BigNumber(y, b), 0, 1);\r
1742     };\r
1743 \r
1744 \r
1745     /*\r
1746      * Return a BigNumber whose value is the value of this BigNumber exponentiated by n.\r
1747      *\r
1748      * If m is present, return the result modulo m.\r
1749      * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE.\r
1750      * If POW_PRECISION is non-zero and m is not present, round to POW_PRECISION using ROUNDING_MODE.\r
1751      *\r
1752      * The modular power operation works efficiently when x, n, and m are integers, otherwise it\r
1753      * is equivalent to calculating x.exponentiatedBy(n).modulo(m) with a POW_PRECISION of 0.\r
1754      *\r
1755      * n {number|string|BigNumber} The exponent. An integer.\r
1756      * [m] {number|string|BigNumber} The modulus.\r
1757      *\r
1758      * '[BigNumber Error] Exponent not an integer: {n}'\r
1759      */\r
1760     P.exponentiatedBy = P.pow = function (n, m) {\r
1761       var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y,\r
1762         x = this;\r
1763 \r
1764       n = new BigNumber(n);\r
1765 \r
1766       // Allow NaN and ±Infinity, but not other non-integers.\r
1767       if (n.c && !n.isInteger()) {\r
1768         throw Error\r
1769           (bignumberError + 'Exponent not an integer: ' + valueOf(n));\r
1770       }\r
1771 \r
1772       if (m != null) m = new BigNumber(m);\r
1773 \r
1774       // Exponent of MAX_SAFE_INTEGER is 15.\r
1775       nIsBig = n.e > 14;\r
1776 \r
1777       // If x is NaN, ±Infinity, ±0 or ±1, or n is ±Infinity, NaN or ±0.\r
1778       if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) {\r
1779 \r
1780         // The sign of the result of pow when x is negative depends on the evenness of n.\r
1781         // If +n overflows to ±Infinity, the evenness of n would be not be known.\r
1782         y = new BigNumber(Math.pow(+valueOf(x), nIsBig ? 2 - isOdd(n) : +valueOf(n)));\r
1783         return m ? y.mod(m) : y;\r
1784       }\r
1785 \r
1786       nIsNeg = n.s < 0;\r
1787 \r
1788       if (m) {\r
1789 \r
1790         // x % m returns NaN if abs(m) is zero, or m is NaN.\r
1791         if (m.c ? !m.c[0] : !m.s) return new BigNumber(NaN);\r
1792 \r
1793         isModExp = !nIsNeg && x.isInteger() && m.isInteger();\r
1794 \r
1795         if (isModExp) x = x.mod(m);\r
1796 \r
1797       // Overflow to ±Infinity: >=2**1e10 or >=1.0000024**1e15.\r
1798       // Underflow to ±0: <=0.79**1e10 or <=0.9999975**1e15.\r
1799       } else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0\r
1800         // [1, 240000000]\r
1801         ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7\r
1802         // [80000000000000]  [99999750000000]\r
1803         : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) {\r
1804 \r
1805         // If x is negative and n is odd, k = -0, else k = 0.\r
1806         k = x.s < 0 && isOdd(n) ? -0 : 0;\r
1807 \r
1808         // If x >= 1, k = ±Infinity.\r
1809         if (x.e > -1) k = 1 / k;\r
1810 \r
1811         // If n is negative return ±0, else return ±Infinity.\r
1812         return new BigNumber(nIsNeg ? 1 / k : k);\r
1813 \r
1814       } else if (POW_PRECISION) {\r
1815 \r
1816         // Truncating each coefficient array to a length of k after each multiplication\r
1817         // equates to truncating significant digits to POW_PRECISION + [28, 41],\r
1818         // i.e. there will be a minimum of 28 guard digits retained.\r
1819         k = mathceil(POW_PRECISION / LOG_BASE + 2);\r
1820       }\r
1821 \r
1822       if (nIsBig) {\r
1823         half = new BigNumber(0.5);\r
1824         if (nIsNeg) n.s = 1;\r
1825         nIsOdd = isOdd(n);\r
1826       } else {\r
1827         i = Math.abs(+valueOf(n));\r
1828         nIsOdd = i % 2;\r
1829       }\r
1830 \r
1831       y = new BigNumber(ONE);\r
1832 \r
1833       // Performs 54 loop iterations for n of 9007199254740991.\r
1834       for (; ;) {\r
1835 \r
1836         if (nIsOdd) {\r
1837           y = y.times(x);\r
1838           if (!y.c) break;\r
1839 \r
1840           if (k) {\r
1841             if (y.c.length > k) y.c.length = k;\r
1842           } else if (isModExp) {\r
1843             y = y.mod(m);    //y = y.minus(div(y, m, 0, MODULO_MODE).times(m));\r
1844           }\r
1845         }\r
1846 \r
1847         if (i) {\r
1848           i = mathfloor(i / 2);\r
1849           if (i === 0) break;\r
1850           nIsOdd = i % 2;\r
1851         } else {\r
1852           n = n.times(half);\r
1853           round(n, n.e + 1, 1);\r
1854 \r
1855           if (n.e > 14) {\r
1856             nIsOdd = isOdd(n);\r
1857           } else {\r
1858             i = +valueOf(n);\r
1859             if (i === 0) break;\r
1860             nIsOdd = i % 2;\r
1861           }\r
1862         }\r
1863 \r
1864         x = x.times(x);\r
1865 \r
1866         if (k) {\r
1867           if (x.c && x.c.length > k) x.c.length = k;\r
1868         } else if (isModExp) {\r
1869           x = x.mod(m);    //x = x.minus(div(x, m, 0, MODULO_MODE).times(m));\r
1870         }\r
1871       }\r
1872 \r
1873       if (isModExp) return y;\r
1874       if (nIsNeg) y = ONE.div(y);\r
1875 \r
1876       return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y;\r
1877     };\r
1878 \r
1879 \r
1880     /*\r
1881      * Return a new BigNumber whose value is the value of this BigNumber rounded to an integer\r
1882      * using rounding mode rm, or ROUNDING_MODE if rm is omitted.\r
1883      *\r
1884      * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r
1885      *\r
1886      * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {rm}'\r
1887      */\r
1888     P.integerValue = function (rm) {\r
1889       var n = new BigNumber(this);\r
1890       if (rm == null) rm = ROUNDING_MODE;\r
1891       else intCheck(rm, 0, 8);\r
1892       return round(n, n.e + 1, rm);\r
1893     };\r
1894 \r
1895 \r
1896     /*\r
1897      * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b),\r
1898      * otherwise return false.\r
1899      */\r
1900     P.isEqualTo = P.eq = function (y, b) {\r
1901       return compare(this, new BigNumber(y, b)) === 0;\r
1902     };\r
1903 \r
1904 \r
1905     /*\r
1906      * Return true if the value of this BigNumber is a finite number, otherwise return false.\r
1907      */\r
1908     P.isFinite = function () {\r
1909       return !!this.c;\r
1910     };\r
1911 \r
1912 \r
1913     /*\r
1914      * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b),\r
1915      * otherwise return false.\r
1916      */\r
1917     P.isGreaterThan = P.gt = function (y, b) {\r
1918       return compare(this, new BigNumber(y, b)) > 0;\r
1919     };\r
1920 \r
1921 \r
1922     /*\r
1923      * Return true if the value of this BigNumber is greater than or equal to the value of\r
1924      * BigNumber(y, b), otherwise return false.\r
1925      */\r
1926     P.isGreaterThanOrEqualTo = P.gte = function (y, b) {\r
1927       return (b = compare(this, new BigNumber(y, b))) === 1 || b === 0;\r
1928 \r
1929     };\r
1930 \r
1931 \r
1932     /*\r
1933      * Return true if the value of this BigNumber is an integer, otherwise return false.\r
1934      */\r
1935     P.isInteger = function () {\r
1936       return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;\r
1937     };\r
1938 \r
1939 \r
1940     /*\r
1941      * Return true if the value of this BigNumber is less than the value of BigNumber(y, b),\r
1942      * otherwise return false.\r
1943      */\r
1944     P.isLessThan = P.lt = function (y, b) {\r
1945       return compare(this, new BigNumber(y, b)) < 0;\r
1946     };\r
1947 \r
1948 \r
1949     /*\r
1950      * Return true if the value of this BigNumber is less than or equal to the value of\r
1951      * BigNumber(y, b), otherwise return false.\r
1952      */\r
1953     P.isLessThanOrEqualTo = P.lte = function (y, b) {\r
1954       return (b = compare(this, new BigNumber(y, b))) === -1 || b === 0;\r
1955     };\r
1956 \r
1957 \r
1958     /*\r
1959      * Return true if the value of this BigNumber is NaN, otherwise return false.\r
1960      */\r
1961     P.isNaN = function () {\r
1962       return !this.s;\r
1963     };\r
1964 \r
1965 \r
1966     /*\r
1967      * Return true if the value of this BigNumber is negative, otherwise return false.\r
1968      */\r
1969     P.isNegative = function () {\r
1970       return this.s < 0;\r
1971     };\r
1972 \r
1973 \r
1974     /*\r
1975      * Return true if the value of this BigNumber is positive, otherwise return false.\r
1976      */\r
1977     P.isPositive = function () {\r
1978       return this.s > 0;\r
1979     };\r
1980 \r
1981 \r
1982     /*\r
1983      * Return true if the value of this BigNumber is 0 or -0, otherwise return false.\r
1984      */\r
1985     P.isZero = function () {\r
1986       return !!this.c && this.c[0] == 0;\r
1987     };\r
1988 \r
1989 \r
1990     /*\r
1991      *  n - 0 = n\r
1992      *  n - N = N\r
1993      *  n - I = -I\r
1994      *  0 - n = -n\r
1995      *  0 - 0 = 0\r
1996      *  0 - N = N\r
1997      *  0 - I = -I\r
1998      *  N - n = N\r
1999      *  N - 0 = N\r
2000      *  N - N = N\r
2001      *  N - I = N\r
2002      *  I - n = I\r
2003      *  I - 0 = I\r
2004      *  I - N = N\r
2005      *  I - I = N\r
2006      *\r
2007      * Return a new BigNumber whose value is the value of this BigNumber minus the value of\r
2008      * BigNumber(y, b).\r
2009      */\r
2010     P.minus = function (y, b) {\r
2011       var i, j, t, xLTy,\r
2012         x = this,\r
2013         a = x.s;\r
2014 \r
2015       y = new BigNumber(y, b);\r
2016       b = y.s;\r
2017 \r
2018       // Either NaN?\r
2019       if (!a || !b) return new BigNumber(NaN);\r
2020 \r
2021       // Signs differ?\r
2022       if (a != b) {\r
2023         y.s = -b;\r
2024         return x.plus(y);\r
2025       }\r
2026 \r
2027       var xe = x.e / LOG_BASE,\r
2028         ye = y.e / LOG_BASE,\r
2029         xc = x.c,\r
2030         yc = y.c;\r
2031 \r
2032       if (!xe || !ye) {\r
2033 \r
2034         // Either Infinity?\r
2035         if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber(yc ? x : NaN);\r
2036 \r
2037         // Either zero?\r
2038         if (!xc[0] || !yc[0]) {\r
2039 \r
2040           // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.\r
2041           return yc[0] ? (y.s = -b, y) : new BigNumber(xc[0] ? x :\r
2042 \r
2043            // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity\r
2044            ROUNDING_MODE == 3 ? -0 : 0);\r
2045         }\r
2046       }\r
2047 \r
2048       xe = bitFloor(xe);\r
2049       ye = bitFloor(ye);\r
2050       xc = xc.slice();\r
2051 \r
2052       // Determine which is the bigger number.\r
2053       if (a = xe - ye) {\r
2054 \r
2055         if (xLTy = a < 0) {\r
2056           a = -a;\r
2057           t = xc;\r
2058         } else {\r
2059           ye = xe;\r
2060           t = yc;\r
2061         }\r
2062 \r
2063         t.reverse();\r
2064 \r
2065         // Prepend zeros to equalise exponents.\r
2066         for (b = a; b--; t.push(0));\r
2067         t.reverse();\r
2068       } else {\r
2069 \r
2070         // Exponents equal. Check digit by digit.\r
2071         j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b;\r
2072 \r
2073         for (a = b = 0; b < j; b++) {\r
2074 \r
2075           if (xc[b] != yc[b]) {\r
2076             xLTy = xc[b] < yc[b];\r
2077             break;\r
2078           }\r
2079         }\r
2080       }\r
2081 \r
2082       // x < y? Point xc to the array of the bigger number.\r
2083       if (xLTy) t = xc, xc = yc, yc = t, y.s = -y.s;\r
2084 \r
2085       b = (j = yc.length) - (i = xc.length);\r
2086 \r
2087       // Append zeros to xc if shorter.\r
2088       // No need to add zeros to yc if shorter as subtract only needs to start at yc.length.\r
2089       if (b > 0) for (; b--; xc[i++] = 0);\r
2090       b = BASE - 1;\r
2091 \r
2092       // Subtract yc from xc.\r
2093       for (; j > a;) {\r
2094 \r
2095         if (xc[--j] < yc[j]) {\r
2096           for (i = j; i && !xc[--i]; xc[i] = b);\r
2097           --xc[i];\r
2098           xc[j] += BASE;\r
2099         }\r
2100 \r
2101         xc[j] -= yc[j];\r
2102       }\r
2103 \r
2104       // Remove leading zeros and adjust exponent accordingly.\r
2105       for (; xc[0] == 0; xc.splice(0, 1), --ye);\r
2106 \r
2107       // Zero?\r
2108       if (!xc[0]) {\r
2109 \r
2110         // Following IEEE 754 (2008) 6.3,\r
2111         // n - n = +0  but  n - n = -0  when rounding towards -Infinity.\r
2112         y.s = ROUNDING_MODE == 3 ? -1 : 1;\r
2113         y.c = [y.e = 0];\r
2114         return y;\r
2115       }\r
2116 \r
2117       // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity\r
2118       // for finite x and y.\r
2119       return normalise(y, xc, ye);\r
2120     };\r
2121 \r
2122 \r
2123     /*\r
2124      *   n % 0 =  N\r
2125      *   n % N =  N\r
2126      *   n % I =  n\r
2127      *   0 % n =  0\r
2128      *  -0 % n = -0\r
2129      *   0 % 0 =  N\r
2130      *   0 % N =  N\r
2131      *   0 % I =  0\r
2132      *   N % n =  N\r
2133      *   N % 0 =  N\r
2134      *   N % N =  N\r
2135      *   N % I =  N\r
2136      *   I % n =  N\r
2137      *   I % 0 =  N\r
2138      *   I % N =  N\r
2139      *   I % I =  N\r
2140      *\r
2141      * Return a new BigNumber whose value is the value of this BigNumber modulo the value of\r
2142      * BigNumber(y, b). The result depends on the value of MODULO_MODE.\r
2143      */\r
2144     P.modulo = P.mod = function (y, b) {\r
2145       var q, s,\r
2146         x = this;\r
2147 \r
2148       y = new BigNumber(y, b);\r
2149 \r
2150       // Return NaN if x is Infinity or NaN, or y is NaN or zero.\r
2151       if (!x.c || !y.s || y.c && !y.c[0]) {\r
2152         return new BigNumber(NaN);\r
2153 \r
2154       // Return x if y is Infinity or x is zero.\r
2155       } else if (!y.c || x.c && !x.c[0]) {\r
2156         return new BigNumber(x);\r
2157       }\r
2158 \r
2159       if (MODULO_MODE == 9) {\r
2160 \r
2161         // Euclidian division: q = sign(y) * floor(x / abs(y))\r
2162         // r = x - qy    where  0 <= r < abs(y)\r
2163         s = y.s;\r
2164         y.s = 1;\r
2165         q = div(x, y, 0, 3);\r
2166         y.s = s;\r
2167         q.s *= s;\r
2168       } else {\r
2169         q = div(x, y, 0, MODULO_MODE);\r
2170       }\r
2171 \r
2172       y = x.minus(q.times(y));\r
2173 \r
2174       // To match JavaScript %, ensure sign of zero is sign of dividend.\r
2175       if (!y.c[0] && MODULO_MODE == 1) y.s = x.s;\r
2176 \r
2177       return y;\r
2178     };\r
2179 \r
2180 \r
2181     /*\r
2182      *  n * 0 = 0\r
2183      *  n * N = N\r
2184      *  n * I = I\r
2185      *  0 * n = 0\r
2186      *  0 * 0 = 0\r
2187      *  0 * N = N\r
2188      *  0 * I = N\r
2189      *  N * n = N\r
2190      *  N * 0 = N\r
2191      *  N * N = N\r
2192      *  N * I = N\r
2193      *  I * n = I\r
2194      *  I * 0 = N\r
2195      *  I * N = N\r
2196      *  I * I = I\r
2197      *\r
2198      * Return a new BigNumber whose value is the value of this BigNumber multiplied by the value\r
2199      * of BigNumber(y, b).\r
2200      */\r
2201     P.multipliedBy = P.times = function (y, b) {\r
2202       var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc,\r
2203         base, sqrtBase,\r
2204         x = this,\r
2205         xc = x.c,\r
2206         yc = (y = new BigNumber(y, b)).c;\r
2207 \r
2208       // Either NaN, ±Infinity or ±0?\r
2209       if (!xc || !yc || !xc[0] || !yc[0]) {\r
2210 \r
2211         // Return NaN if either is NaN, or one is 0 and the other is Infinity.\r
2212         if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {\r
2213           y.c = y.e = y.s = null;\r
2214         } else {\r
2215           y.s *= x.s;\r
2216 \r
2217           // Return ±Infinity if either is ±Infinity.\r
2218           if (!xc || !yc) {\r
2219             y.c = y.e = null;\r
2220 \r
2221           // Return ±0 if either is ±0.\r
2222           } else {\r
2223             y.c = [0];\r
2224             y.e = 0;\r
2225           }\r
2226         }\r
2227 \r
2228         return y;\r
2229       }\r
2230 \r
2231       e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE);\r
2232       y.s *= x.s;\r
2233       xcL = xc.length;\r
2234       ycL = yc.length;\r
2235 \r
2236       // Ensure xc points to longer array and xcL to its length.\r
2237       if (xcL < ycL) zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i;\r
2238 \r
2239       // Initialise the result array with zeros.\r
2240       for (i = xcL + ycL, zc = []; i--; zc.push(0));\r
2241 \r
2242       base = BASE;\r
2243       sqrtBase = SQRT_BASE;\r
2244 \r
2245       for (i = ycL; --i >= 0;) {\r
2246         c = 0;\r
2247         ylo = yc[i] % sqrtBase;\r
2248         yhi = yc[i] / sqrtBase | 0;\r
2249 \r
2250         for (k = xcL, j = i + k; j > i;) {\r
2251           xlo = xc[--k] % sqrtBase;\r
2252           xhi = xc[k] / sqrtBase | 0;\r
2253           m = yhi * xlo + xhi * ylo;\r
2254           xlo = ylo * xlo + ((m % sqrtBase) * sqrtBase) + zc[j] + c;\r
2255           c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi;\r
2256           zc[j--] = xlo % base;\r
2257         }\r
2258 \r
2259         zc[j] = c;\r
2260       }\r
2261 \r
2262       if (c) {\r
2263         ++e;\r
2264       } else {\r
2265         zc.splice(0, 1);\r
2266       }\r
2267 \r
2268       return normalise(y, zc, e);\r
2269     };\r
2270 \r
2271 \r
2272     /*\r
2273      * Return a new BigNumber whose value is the value of this BigNumber negated,\r
2274      * i.e. multiplied by -1.\r
2275      */\r
2276     P.negated = function () {\r
2277       var x = new BigNumber(this);\r
2278       x.s = -x.s || null;\r
2279       return x;\r
2280     };\r
2281 \r
2282 \r
2283     /*\r
2284      *  n + 0 = n\r
2285      *  n + N = N\r
2286      *  n + I = I\r
2287      *  0 + n = n\r
2288      *  0 + 0 = 0\r
2289      *  0 + N = N\r
2290      *  0 + I = I\r
2291      *  N + n = N\r
2292      *  N + 0 = N\r
2293      *  N + N = N\r
2294      *  N + I = N\r
2295      *  I + n = I\r
2296      *  I + 0 = I\r
2297      *  I + N = N\r
2298      *  I + I = I\r
2299      *\r
2300      * Return a new BigNumber whose value is the value of this BigNumber plus the value of\r
2301      * BigNumber(y, b).\r
2302      */\r
2303     P.plus = function (y, b) {\r
2304       var t,\r
2305         x = this,\r
2306         a = x.s;\r
2307 \r
2308       y = new BigNumber(y, b);\r
2309       b = y.s;\r
2310 \r
2311       // Either NaN?\r
2312       if (!a || !b) return new BigNumber(NaN);\r
2313 \r
2314       // Signs differ?\r
2315        if (a != b) {\r
2316         y.s = -b;\r
2317         return x.minus(y);\r
2318       }\r
2319 \r
2320       var xe = x.e / LOG_BASE,\r
2321         ye = y.e / LOG_BASE,\r
2322         xc = x.c,\r
2323         yc = y.c;\r
2324 \r
2325       if (!xe || !ye) {\r
2326 \r
2327         // Return ±Infinity if either ±Infinity.\r
2328         if (!xc || !yc) return new BigNumber(a / 0);\r
2329 \r
2330         // Either zero?\r
2331         // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.\r
2332         if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber(xc[0] ? x : a * 0);\r
2333       }\r
2334 \r
2335       xe = bitFloor(xe);\r
2336       ye = bitFloor(ye);\r
2337       xc = xc.slice();\r
2338 \r
2339       // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts.\r
2340       if (a = xe - ye) {\r
2341         if (a > 0) {\r
2342           ye = xe;\r
2343           t = yc;\r
2344         } else {\r
2345           a = -a;\r
2346           t = xc;\r
2347         }\r
2348 \r
2349         t.reverse();\r
2350         for (; a--; t.push(0));\r
2351         t.reverse();\r
2352       }\r
2353 \r
2354       a = xc.length;\r
2355       b = yc.length;\r
2356 \r
2357       // Point xc to the longer array, and b to the shorter length.\r
2358       if (a - b < 0) t = yc, yc = xc, xc = t, b = a;\r
2359 \r
2360       // Only start adding at yc.length - 1 as the further digits of xc can be ignored.\r
2361       for (a = 0; b;) {\r
2362         a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0;\r
2363         xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;\r
2364       }\r
2365 \r
2366       if (a) {\r
2367         xc = [a].concat(xc);\r
2368         ++ye;\r
2369       }\r
2370 \r
2371       // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r
2372       // ye = MAX_EXP + 1 possible\r
2373       return normalise(y, xc, ye);\r
2374     };\r
2375 \r
2376 \r
2377     /*\r
2378      * If sd is undefined or null or true or false, return the number of significant digits of\r
2379      * the value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN.\r
2380      * If sd is true include integer-part trailing zeros in the count.\r
2381      *\r
2382      * Otherwise, if sd is a number, return a new BigNumber whose value is the value of this\r
2383      * BigNumber rounded to a maximum of sd significant digits using rounding mode rm, or\r
2384      * ROUNDING_MODE if rm is omitted.\r
2385      *\r
2386      * sd {number|boolean} number: significant digits: integer, 1 to MAX inclusive.\r
2387      *                     boolean: whether to count integer-part trailing zeros: true or false.\r
2388      * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r
2389      *\r
2390      * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}'\r
2391      */\r
2392     P.precision = P.sd = function (sd, rm) {\r
2393       var c, n, v,\r
2394         x = this;\r
2395 \r
2396       if (sd != null && sd !== !!sd) {\r
2397         intCheck(sd, 1, MAX);\r
2398         if (rm == null) rm = ROUNDING_MODE;\r
2399         else intCheck(rm, 0, 8);\r
2400 \r
2401         return round(new BigNumber(x), sd, rm);\r
2402       }\r
2403 \r
2404       if (!(c = x.c)) return null;\r
2405       v = c.length - 1;\r
2406       n = v * LOG_BASE + 1;\r
2407 \r
2408       if (v = c[v]) {\r
2409 \r
2410         // Subtract the number of trailing zeros of the last element.\r
2411         for (; v % 10 == 0; v /= 10, n--);\r
2412 \r
2413         // Add the number of digits of the first element.\r
2414         for (v = c[0]; v >= 10; v /= 10, n++);\r
2415       }\r
2416 \r
2417       if (sd && x.e + 1 > n) n = x.e + 1;\r
2418 \r
2419       return n;\r
2420     };\r
2421 \r
2422 \r
2423     /*\r
2424      * Return a new BigNumber whose value is the value of this BigNumber shifted by k places\r
2425      * (powers of 10). Shift to the right if n > 0, and to the left if n < 0.\r
2426      *\r
2427      * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive.\r
2428      *\r
2429      * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {k}'\r
2430      */\r
2431     P.shiftedBy = function (k) {\r
2432       intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);\r
2433       return this.times('1e' + k);\r
2434     };\r
2435 \r
2436 \r
2437     /*\r
2438      *  sqrt(-n) =  N\r
2439      *  sqrt(N) =  N\r
2440      *  sqrt(-I) =  N\r
2441      *  sqrt(I) =  I\r
2442      *  sqrt(0) =  0\r
2443      *  sqrt(-0) = -0\r
2444      *\r
2445      * Return a new BigNumber whose value is the square root of the value of this BigNumber,\r
2446      * rounded according to DECIMAL_PLACES and ROUNDING_MODE.\r
2447      */\r
2448     P.squareRoot = P.sqrt = function () {\r
2449       var m, n, r, rep, t,\r
2450         x = this,\r
2451         c = x.c,\r
2452         s = x.s,\r
2453         e = x.e,\r
2454         dp = DECIMAL_PLACES + 4,\r
2455         half = new BigNumber('0.5');\r
2456 \r
2457       // Negative/NaN/Infinity/zero?\r
2458       if (s !== 1 || !c || !c[0]) {\r
2459         return new BigNumber(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0);\r
2460       }\r
2461 \r
2462       // Initial estimate.\r
2463       s = Math.sqrt(+valueOf(x));\r
2464 \r
2465       // Math.sqrt underflow/overflow?\r
2466       // Pass x to Math.sqrt as integer, then adjust the exponent of the result.\r
2467       if (s == 0 || s == 1 / 0) {\r
2468         n = coeffToString(c);\r
2469         if ((n.length + e) % 2 == 0) n += '0';\r
2470         s = Math.sqrt(+n);\r
2471         e = bitFloor((e + 1) / 2) - (e < 0 || e % 2);\r
2472 \r
2473         if (s == 1 / 0) {\r
2474           n = '1e' + e;\r
2475         } else {\r
2476           n = s.toExponential();\r
2477           n = n.slice(0, n.indexOf('e') + 1) + e;\r
2478         }\r
2479 \r
2480         r = new BigNumber(n);\r
2481       } else {\r
2482         r = new BigNumber(s + '');\r
2483       }\r
2484 \r
2485       // Check for zero.\r
2486       // r could be zero if MIN_EXP is changed after the this value was created.\r
2487       // This would cause a division by zero (x/t) and hence Infinity below, which would cause\r
2488       // coeffToString to throw.\r
2489       if (r.c[0]) {\r
2490         e = r.e;\r
2491         s = e + dp;\r
2492         if (s < 3) s = 0;\r
2493 \r
2494         // Newton-Raphson iteration.\r
2495         for (; ;) {\r
2496           t = r;\r
2497           r = half.times(t.plus(div(x, t, dp, 1)));\r
2498 \r
2499           if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) {\r
2500 \r
2501             // The exponent of r may here be one less than the final result exponent,\r
2502             // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits\r
2503             // are indexed correctly.\r
2504             if (r.e < e) --s;\r
2505             n = n.slice(s - 3, s + 1);\r
2506 \r
2507             // The 4th rounding digit may be in error by -1 so if the 4 rounding digits\r
2508             // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the\r
2509             // iteration.\r
2510             if (n == '9999' || !rep && n == '4999') {\r
2511 \r
2512               // On the first iteration only, check to see if rounding up gives the\r
2513               // exact result as the nines may infinitely repeat.\r
2514               if (!rep) {\r
2515                 round(t, t.e + DECIMAL_PLACES + 2, 0);\r
2516 \r
2517                 if (t.times(t).eq(x)) {\r
2518                   r = t;\r
2519                   break;\r
2520                 }\r
2521               }\r
2522 \r
2523               dp += 4;\r
2524               s += 4;\r
2525               rep = 1;\r
2526             } else {\r
2527 \r
2528               // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact\r
2529               // result. If not, then there are further digits and m will be truthy.\r
2530               if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r
2531 \r
2532                 // Truncate to the first rounding digit.\r
2533                 round(r, r.e + DECIMAL_PLACES + 2, 1);\r
2534                 m = !r.times(r).eq(x);\r
2535               }\r
2536 \r
2537               break;\r
2538             }\r
2539           }\r
2540         }\r
2541       }\r
2542 \r
2543       return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m);\r
2544     };\r
2545 \r
2546 \r
2547     /*\r
2548      * Return a string representing the value of this BigNumber in exponential notation and\r
2549      * rounded using ROUNDING_MODE to dp fixed decimal places.\r
2550      *\r
2551      * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r
2552      * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r
2553      *\r
2554      * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r
2555      */\r
2556     P.toExponential = function (dp, rm) {\r
2557       if (dp != null) {\r
2558         intCheck(dp, 0, MAX);\r
2559         dp++;\r
2560       }\r
2561       return format(this, dp, rm, 1);\r
2562     };\r
2563 \r
2564 \r
2565     /*\r
2566      * Return a string representing the value of this BigNumber in fixed-point notation rounding\r
2567      * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted.\r
2568      *\r
2569      * Note: as with JavaScript's number type, (-0).toFixed(0) is '0',\r
2570      * but e.g. (-0.00001).toFixed(0) is '-0'.\r
2571      *\r
2572      * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r
2573      * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r
2574      *\r
2575      * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r
2576      */\r
2577     P.toFixed = function (dp, rm) {\r
2578       if (dp != null) {\r
2579         intCheck(dp, 0, MAX);\r
2580         dp = dp + this.e + 1;\r
2581       }\r
2582       return format(this, dp, rm);\r
2583     };\r
2584 \r
2585 \r
2586     /*\r
2587      * Return a string representing the value of this BigNumber in fixed-point notation rounded\r
2588      * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties\r
2589      * of the format or FORMAT object (see BigNumber.set).\r
2590      *\r
2591      * The formatting object may contain some or all of the properties shown below.\r
2592      *\r
2593      * FORMAT = {\r
2594      *   prefix: '',\r
2595      *   groupSize: 3,\r
2596      *   secondaryGroupSize: 0,\r
2597      *   groupSeparator: ',',\r
2598      *   decimalSeparator: '.',\r
2599      *   fractionGroupSize: 0,\r
2600      *   fractionGroupSeparator: '\xA0',      // non-breaking space\r
2601      *   suffix: ''\r
2602      * };\r
2603      *\r
2604      * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r
2605      * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r
2606      * [format] {object} Formatting options. See FORMAT pbject above.\r
2607      *\r
2608      * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r
2609      * '[BigNumber Error] Argument not an object: {format}'\r
2610      */\r
2611     P.toFormat = function (dp, rm, format) {\r
2612       var str,\r
2613         x = this;\r
2614 \r
2615       if (format == null) {\r
2616         if (dp != null && rm && typeof rm == 'object') {\r
2617           format = rm;\r
2618           rm = null;\r
2619         } else if (dp && typeof dp == 'object') {\r
2620           format = dp;\r
2621           dp = rm = null;\r
2622         } else {\r
2623           format = FORMAT;\r
2624         }\r
2625       } else if (typeof format != 'object') {\r
2626         throw Error\r
2627           (bignumberError + 'Argument not an object: ' + format);\r
2628       }\r
2629 \r
2630       str = x.toFixed(dp, rm);\r
2631 \r
2632       if (x.c) {\r
2633         var i,\r
2634           arr = str.split('.'),\r
2635           g1 = +format.groupSize,\r
2636           g2 = +format.secondaryGroupSize,\r
2637           groupSeparator = format.groupSeparator || '',\r
2638           intPart = arr[0],\r
2639           fractionPart = arr[1],\r
2640           isNeg = x.s < 0,\r
2641           intDigits = isNeg ? intPart.slice(1) : intPart,\r
2642           len = intDigits.length;\r
2643 \r
2644         if (g2) i = g1, g1 = g2, g2 = i, len -= i;\r
2645 \r
2646         if (g1 > 0 && len > 0) {\r
2647           i = len % g1 || g1;\r
2648           intPart = intDigits.substr(0, i);\r
2649           for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1);\r
2650           if (g2 > 0) intPart += groupSeparator + intDigits.slice(i);\r
2651           if (isNeg) intPart = '-' + intPart;\r
2652         }\r
2653 \r
2654         str = fractionPart\r
2655          ? intPart + (format.decimalSeparator || '') + ((g2 = +format.fractionGroupSize)\r
2656           ? fractionPart.replace(new RegExp('\\d{' + g2 + '}\\B', 'g'),\r
2657            '$&' + (format.fractionGroupSeparator || ''))\r
2658           : fractionPart)\r
2659          : intPart;\r
2660       }\r
2661 \r
2662       return (format.prefix || '') + str + (format.suffix || '');\r
2663     };\r
2664 \r
2665 \r
2666     /*\r
2667      * Return an array of two BigNumbers representing the value of this BigNumber as a simple\r
2668      * fraction with an integer numerator and an integer denominator.\r
2669      * The denominator will be a positive non-zero value less than or equal to the specified\r
2670      * maximum denominator. If a maximum denominator is not specified, the denominator will be\r
2671      * the lowest value necessary to represent the number exactly.\r
2672      *\r
2673      * [md] {number|string|BigNumber} Integer >= 1, or Infinity. The maximum denominator.\r
2674      *\r
2675      * '[BigNumber Error] Argument {not an integer|out of range} : {md}'\r
2676      */\r
2677     P.toFraction = function (md) {\r
2678       var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s,\r
2679         x = this,\r
2680         xc = x.c;\r
2681 \r
2682       if (md != null) {\r
2683         n = new BigNumber(md);\r
2684 \r
2685         // Throw if md is less than one or is not an integer, unless it is Infinity.\r
2686         if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {\r
2687           throw Error\r
2688             (bignumberError + 'Argument ' +\r
2689               (n.isInteger() ? 'out of range: ' : 'not an integer: ') + valueOf(n));\r
2690         }\r
2691       }\r
2692 \r
2693       if (!xc) return new BigNumber(x);\r
2694 \r
2695       d = new BigNumber(ONE);\r
2696       n1 = d0 = new BigNumber(ONE);\r
2697       d1 = n0 = new BigNumber(ONE);\r
2698       s = coeffToString(xc);\r
2699 \r
2700       // Determine initial denominator.\r
2701       // d is a power of 10 and the minimum max denominator that specifies the value exactly.\r
2702       e = d.e = s.length - x.e - 1;\r
2703       d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp];\r
2704       md = !md || n.comparedTo(d) > 0 ? (e > 0 ? d : n1) : n;\r
2705 \r
2706       exp = MAX_EXP;\r
2707       MAX_EXP = 1 / 0;\r
2708       n = new BigNumber(s);\r
2709 \r
2710       // n0 = d1 = 0\r
2711       n0.c[0] = 0;\r
2712 \r
2713       for (; ;)  {\r
2714         q = div(n, d, 0, 1);\r
2715         d2 = d0.plus(q.times(d1));\r
2716         if (d2.comparedTo(md) == 1) break;\r
2717         d0 = d1;\r
2718         d1 = d2;\r
2719         n1 = n0.plus(q.times(d2 = n1));\r
2720         n0 = d2;\r
2721         d = n.minus(q.times(d2 = d));\r
2722         n = d2;\r
2723       }\r
2724 \r
2725       d2 = div(md.minus(d0), d1, 0, 1);\r
2726       n0 = n0.plus(d2.times(n1));\r
2727       d0 = d0.plus(d2.times(d1));\r
2728       n0.s = n1.s = x.s;\r
2729       e = e * 2;\r
2730 \r
2731       // Determine which fraction is closer to x, n0/d0 or n1/d1\r
2732       r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo(\r
2733           div(n0, d0, e, ROUNDING_MODE).minus(x).abs()) < 1 ? [n1, d1] : [n0, d0];\r
2734 \r
2735       MAX_EXP = exp;\r
2736 \r
2737       return r;\r
2738     };\r
2739 \r
2740 \r
2741     /*\r
2742      * Return the value of this BigNumber converted to a number primitive.\r
2743      */\r
2744     P.toNumber = function () {\r
2745       return +valueOf(this);\r
2746     };\r
2747 \r
2748 \r
2749     /*\r
2750      * Return a string representing the value of this BigNumber rounded to sd significant digits\r
2751      * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits\r
2752      * necessary to represent the integer part of the value in fixed-point notation, then use\r
2753      * exponential notation.\r
2754      *\r
2755      * [sd] {number} Significant digits. Integer, 1 to MAX inclusive.\r
2756      * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r
2757      *\r
2758      * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}'\r
2759      */\r
2760     P.toPrecision = function (sd, rm) {\r
2761       if (sd != null) intCheck(sd, 1, MAX);\r
2762       return format(this, sd, rm, 2);\r
2763     };\r
2764 \r
2765 \r
2766     /*\r
2767      * Return a string representing the value of this BigNumber in base b, or base 10 if b is\r
2768      * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and\r
2769      * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent\r
2770      * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than\r
2771      * TO_EXP_NEG, return exponential notation.\r
2772      *\r
2773      * [b] {number} Integer, 2 to ALPHABET.length inclusive.\r
2774      *\r
2775      * '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}'\r
2776      */\r
2777     P.toString = function (b) {\r
2778       var str,\r
2779         n = this,\r
2780         s = n.s,\r
2781         e = n.e;\r
2782 \r
2783       // Infinity or NaN?\r
2784       if (e === null) {\r
2785         if (s) {\r
2786           str = 'Infinity';\r
2787           if (s < 0) str = '-' + str;\r
2788         } else {\r
2789           str = 'NaN';\r
2790         }\r
2791       } else {\r
2792         if (b == null) {\r
2793           str = e <= TO_EXP_NEG || e >= TO_EXP_POS\r
2794            ? toExponential(coeffToString(n.c), e)\r
2795            : toFixedPoint(coeffToString(n.c), e, '0');\r
2796         } else if (b === 10) {\r
2797           n = round(new BigNumber(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);\r
2798           str = toFixedPoint(coeffToString(n.c), n.e, '0');\r
2799         } else {\r
2800           intCheck(b, 2, ALPHABET.length, 'Base');\r
2801           str = convertBase(toFixedPoint(coeffToString(n.c), e, '0'), 10, b, s, true);\r
2802         }\r
2803 \r
2804         if (s < 0 && n.c[0]) str = '-' + str;\r
2805       }\r
2806 \r
2807       return str;\r
2808     };\r
2809 \r
2810 \r
2811     /*\r
2812      * Return as toString, but do not accept a base argument, and include the minus sign for\r
2813      * negative zero.\r
2814      */\r
2815     P.valueOf = P.toJSON = function () {\r
2816       return valueOf(this);\r
2817     };\r
2818 \r
2819 \r
2820     P._isBigNumber = true;\r
2821 \r
2822     if (configObject != null) BigNumber.set(configObject);\r
2823 \r
2824     return BigNumber;\r
2825   }\r
2826 \r
2827 \r
2828   // PRIVATE HELPER FUNCTIONS\r
2829 \r
2830   // These functions don't need access to variables,\r
2831   // e.g. DECIMAL_PLACES, in the scope of the `clone` function above.\r
2832 \r
2833 \r
2834   function bitFloor(n) {\r
2835     var i = n | 0;\r
2836     return n > 0 || n === i ? i : i - 1;\r
2837   }\r
2838 \r
2839 \r
2840   // Return a coefficient array as a string of base 10 digits.\r
2841   function coeffToString(a) {\r
2842     var s, z,\r
2843       i = 1,\r
2844       j = a.length,\r
2845       r = a[0] + '';\r
2846 \r
2847     for (; i < j;) {\r
2848       s = a[i++] + '';\r
2849       z = LOG_BASE - s.length;\r
2850       for (; z--; s = '0' + s);\r
2851       r += s;\r
2852     }\r
2853 \r
2854     // Determine trailing zeros.\r
2855     for (j = r.length; r.charCodeAt(--j) === 48;);\r
2856 \r
2857     return r.slice(0, j + 1 || 1);\r
2858   }\r
2859 \r
2860 \r
2861   // Compare the value of BigNumbers x and y.\r
2862   function compare(x, y) {\r
2863     var a, b,\r
2864       xc = x.c,\r
2865       yc = y.c,\r
2866       i = x.s,\r
2867       j = y.s,\r
2868       k = x.e,\r
2869       l = y.e;\r
2870 \r
2871     // Either NaN?\r
2872     if (!i || !j) return null;\r
2873 \r
2874     a = xc && !xc[0];\r
2875     b = yc && !yc[0];\r
2876 \r
2877     // Either zero?\r
2878     if (a || b) return a ? b ? 0 : -j : i;\r
2879 \r
2880     // Signs differ?\r
2881     if (i != j) return i;\r
2882 \r
2883     a = i < 0;\r
2884     b = k == l;\r
2885 \r
2886     // Either Infinity?\r
2887     if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1;\r
2888 \r
2889     // Compare exponents.\r
2890     if (!b) return k > l ^ a ? 1 : -1;\r
2891 \r
2892     j = (k = xc.length) < (l = yc.length) ? k : l;\r
2893 \r
2894     // Compare digit by digit.\r
2895     for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;\r
2896 \r
2897     // Compare lengths.\r
2898     return k == l ? 0 : k > l ^ a ? 1 : -1;\r
2899   }\r
2900 \r
2901 \r
2902   /*\r
2903    * Check that n is a primitive number, an integer, and in range, otherwise throw.\r
2904    */\r
2905   function intCheck(n, min, max, name) {\r
2906     if (n < min || n > max || n !== mathfloor(n)) {\r
2907       throw Error\r
2908        (bignumberError + (name || 'Argument') + (typeof n == 'number'\r
2909          ? n < min || n > max ? ' out of range: ' : ' not an integer: '\r
2910          : ' not a primitive number: ') + String(n));\r
2911     }\r
2912   }\r
2913 \r
2914 \r
2915   // Assumes finite n.\r
2916   function isOdd(n) {\r
2917     var k = n.c.length - 1;\r
2918     return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0;\r
2919   }\r
2920 \r
2921 \r
2922   function toExponential(str, e) {\r
2923     return (str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str) +\r
2924      (e < 0 ? 'e' : 'e+') + e;\r
2925   }\r
2926 \r
2927 \r
2928   function toFixedPoint(str, e, z) {\r
2929     var len, zs;\r
2930 \r
2931     // Negative exponent?\r
2932     if (e < 0) {\r
2933 \r
2934       // Prepend zeros.\r
2935       for (zs = z + '.'; ++e; zs += z);\r
2936       str = zs + str;\r
2937 \r
2938     // Positive exponent\r
2939     } else {\r
2940       len = str.length;\r
2941 \r
2942       // Append zeros.\r
2943       if (++e > len) {\r
2944         for (zs = z, e -= len; --e; zs += z);\r
2945         str += zs;\r
2946       } else if (e < len) {\r
2947         str = str.slice(0, e) + '.' + str.slice(e);\r
2948       }\r
2949     }\r
2950 \r
2951     return str;\r
2952   }\r
2953 \r
2954 \r
2955   // EXPORT\r
2956 \r
2957 \r
2958   BigNumber = clone();\r
2959   BigNumber['default'] = BigNumber.BigNumber = BigNumber;\r
2960 \r
2961   // AMD.\r
2962   if (true) {\r
2963     !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () { return BigNumber; }).call(exports, __webpack_require__, exports, module),
2964                                 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\r
2965 \r
2966   // Node.js and other environments that support module.exports.\r
2967   } else if (typeof module != 'undefined' && module.exports) {\r
2968     module.exports = BigNumber;\r
2969 \r
2970   // Browser.\r
2971   } else {\r
2972     if (!globalObject) {\r
2973       globalObject = typeof self != 'undefined' && self ? self : window;\r
2974     }\r
2975 \r
2976     globalObject.BigNumber = BigNumber;\r
2977   }\r
2978 })(this);\r
2979
2980
2981 /***/ }),
2982
2983 /***/ 577:
2984 /***/ (function(module, __webpack_exports__, __webpack_require__) {
2985
2986 "use strict";
2987 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify__ = __webpack_require__(144);
2988 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify__);
2989 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise__ = __webpack_require__(76);
2990 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise__);
2991 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bytom__ = __webpack_require__(436);
2992 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_utils__ = __webpack_require__(578);
2993
2994
2995
2996
2997
2998 var transaction = {};
2999
3000 transaction.list = function (guid, asset_id, start, limit, tx_types) {
3001   var filter = { asset_id: asset_id };
3002   if (tx_types) {
3003     filter.tx_types = tx_types;
3004   }
3005   return __WEBPACK_IMPORTED_MODULE_2__bytom__["a" /* default */].transaction.list(guid, filter, null, start, limit);
3006 };
3007
3008 transaction.convertArgument = function (argArray) {
3009   var fn = function asyncConvert(object) {
3010     var type = object.type;
3011     var value = object.value;
3012     return __WEBPACK_IMPORTED_MODULE_2__bytom__["a" /* default */].transaction.convertArgument(type, value).then(function (resp) {
3013       return resp.value;
3014     });
3015   };
3016
3017   var actionFunction = argArray.map(fn);
3018   return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a.all(actionFunction);
3019 };
3020
3021 transaction.chainStatus = function () {
3022   return __WEBPACK_IMPORTED_MODULE_2__bytom__["a" /* default */].query.getblockcount();
3023 };
3024
3025 transaction.asset = function (asset_id) {
3026   return __WEBPACK_IMPORTED_MODULE_2__bytom__["a" /* default */].query.asset(asset_id);
3027 };
3028
3029 transaction.build = function (address, to, asset, amount, fee, confirmations) {
3030   var retPromise = new __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a(function (resolve, reject) {
3031     __WEBPACK_IMPORTED_MODULE_2__bytom__["a" /* default */].transaction.buildPayment(address, to, asset, amount.toString(), fee, confirmations).then(function (res) {
3032       resolve(res);
3033     }).catch(function (error) {
3034       reject(error);
3035     });
3036   });
3037   return retPromise;
3038 };
3039
3040 transaction.buildCrossChain = function (address, to, asset, amount, confirmations) {
3041   var retPromise = new __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a(function (resolve, reject) {
3042     __WEBPACK_IMPORTED_MODULE_2__bytom__["a" /* default */].transaction.buildCrossChain(address, to, asset, amount.toString(), confirmations).then(function (res) {
3043       resolve(res);
3044     }).catch(function (error) {
3045       reject(error);
3046     });
3047   });
3048   return retPromise;
3049 };
3050
3051 transaction.buildVote = function (address, vote, amount, confirmations, memo) {
3052   var retPromise = new __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a(function (resolve, reject) {
3053     __WEBPACK_IMPORTED_MODULE_2__bytom__["a" /* default */].transaction.buildVote(address, vote, amount.toString(), confirmations, memo).then(function (res) {
3054       resolve(res);
3055     }).catch(function (error) {
3056       reject(error);
3057     });
3058   });
3059   return retPromise;
3060 };
3061
3062 transaction.buildVeto = function (address, vote, amount, confirmations, memo) {
3063   var retPromise = new __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a(function (resolve, reject) {
3064     __WEBPACK_IMPORTED_MODULE_2__bytom__["a" /* default */].transaction.buildVeto(address, vote, amount.toString(), confirmations, memo).then(function (res) {
3065       resolve(res);
3066     }).catch(function (error) {
3067       reject(error);
3068     });
3069   });
3070   return retPromise;
3071 };
3072
3073 transaction.buildTransaction = function (address, inputs, outputs, gas, confirmations) {
3074   var retPromise = new __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a(function (resolve, reject) {
3075     __WEBPACK_IMPORTED_MODULE_2__bytom__["a" /* default */].transaction.buildTransaction(address, inputs, outputs, gas, confirmations).then(function (res) {
3076       resolve(res);
3077     }).catch(function (error) {
3078       reject(error);
3079     });
3080   });
3081   return retPromise;
3082 };
3083
3084 transaction.signTransaction = function (guid, transaction, password) {
3085   var retPromise = new __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a(function (resolve, reject) {
3086     __WEBPACK_IMPORTED_MODULE_2__bytom__["a" /* default */].transaction.signTransaction(guid, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(Object(__WEBPACK_IMPORTED_MODULE_3__utils_utils__["b" /* snakeize */])(transaction)), password).then(function (res) {
3087       resolve(res);
3088     }).catch(function (error) {
3089       reject(error);
3090     });
3091   });
3092   return retPromise;
3093 };
3094
3095 transaction.transfer = function (guid, transaction, password, address) {
3096   var retPromise = new __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a(function (resolve, reject) {
3097     __WEBPACK_IMPORTED_MODULE_2__bytom__["a" /* default */].transaction.signTransaction(guid, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(Object(__WEBPACK_IMPORTED_MODULE_3__utils_utils__["b" /* snakeize */])(transaction)), password).then(function (ret) {
3098       __WEBPACK_IMPORTED_MODULE_2__bytom__["a" /* default */].transaction.submitPayment(address, ret.raw_transaction, ret.signatures).then(function (res3) {
3099         var object = {
3100           transactionHash: res3.txHash
3101         };
3102         resolve(object);
3103       }).catch(function (error) {
3104         reject(error);
3105       });
3106     }).catch(function (error) {
3107       reject(error);
3108     });
3109   });
3110
3111   return retPromise;
3112 };
3113
3114 transaction.signMessage = function (message, password, address) {
3115   return __WEBPACK_IMPORTED_MODULE_2__bytom__["a" /* default */].keys.signMessage(message, password, address);
3116 };
3117
3118 transaction.advancedTransfer = function (guid, transaction, password, arrayData, address) {
3119   var retPromise = new __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_promise___default.a(function (resolve, reject) {
3120     __WEBPACK_IMPORTED_MODULE_2__bytom__["a" /* default */].transaction.signTransaction(guid, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_json_stringify___default()(Object(__WEBPACK_IMPORTED_MODULE_3__utils_utils__["b" /* snakeize */])(transaction)), password).then(function (ret) {
3121       var signatures = ret.signatures;
3122       if (arrayData) {
3123         signatures[0] = arrayData;
3124       }
3125       __WEBPACK_IMPORTED_MODULE_2__bytom__["a" /* default */].transaction.submitPayment(address, ret.raw_transaction, signatures).then(function (res3) {
3126         var object = {
3127           transactionHash: res3.txHash
3128         };
3129         resolve(object);
3130       }).catch(function (error) {
3131         reject(error);
3132       });
3133     }).catch(function (error) {
3134       reject(error);
3135     });
3136   });
3137
3138   return retPromise;
3139 };
3140
3141 /* harmony default export */ __webpack_exports__["a"] = (transaction);
3142
3143 /***/ }),
3144
3145 /***/ 578:
3146 /***/ (function(module, __webpack_exports__, __webpack_require__) {
3147
3148 "use strict";
3149 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return camelize; });
3150 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return snakeize; });
3151 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof__ = __webpack_require__(145);
3152 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof__);
3153
3154 var camelize = function camelize(object) {
3155   if ((typeof object === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(object)) == 'object') {
3156     for (var key in object) {
3157       var value = object[key];
3158       var newKey = key;
3159
3160       if (/_/.test(key)) {
3161         newKey = key.replace(/([_][a-z])/g, function (v) {
3162           return v[1].toUpperCase();
3163         });
3164         delete object[key];
3165       }
3166
3167       if ((typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) == 'object') {
3168         value = camelize(value);
3169       }
3170
3171       object[newKey] = value;
3172     }
3173
3174     return object;
3175   } else {
3176     return object.replace(/([_][a-z])/g, function (v) {
3177       return v[1].toUpperCase();
3178     });
3179   }
3180 };
3181
3182 var snakeize = function snakeize(object) {
3183   for (var key in object) {
3184     var value = object[key];
3185     var newKey = key;
3186
3187     // Skip all-caps keys
3188     if (/^[A-Z]+$/.test(key)) {
3189       continue;
3190     }
3191
3192     if (/[A-Z]/.test(key)) {
3193       newKey = key.replace(/([A-Z])/g, function (v) {
3194         return '_' + v.toLowerCase();
3195       });
3196       delete object[key];
3197     }
3198
3199     if ((typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) == 'object') {
3200       value = snakeize(value);
3201     }
3202
3203     object[newKey] = value;
3204   }
3205
3206   return object;
3207 };
3208
3209 /***/ }),
3210
3211 /***/ 579:
3212 /***/ (function(module, __webpack_exports__, __webpack_require__) {
3213
3214 "use strict";
3215 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cn__ = __webpack_require__(581);
3216
3217
3218 var sdkLang = {
3219     cn: __WEBPACK_IMPORTED_MODULE_0__cn__["a" /* default */]
3220 };
3221
3222 function getLang(str, lang) {
3223     if (sdkLang[lang] && sdkLang[lang][str]) {
3224         return sdkLang[lang][str];
3225     }
3226     return str;
3227 }
3228
3229 /* harmony default export */ __webpack_exports__["a"] = (getLang);
3230
3231 /***/ }),
3232
3233 /***/ 581:
3234 /***/ (function(module, __webpack_exports__, __webpack_require__) {
3235
3236 "use strict";
3237 var cn = {
3238     "key alias already exists": "秘钥别名已经存在",
3239     "db insert error": "数据库写入异常",
3240     "db get error": "数据库查询异常",
3241     "not found by XPub": "未找到私钥数据",
3242     "db update error": "数据库更新失败",
3243     "db update error: not found by rootXPub": "数据库更新失败:未找到相应的私钥数据",
3244     "duplicate account alias": "账户别名已存在",
3245     "The wallet already has account data. Can't restore.": "当前钱包存在数据,无法从备份覆盖恢复",
3246     "could not decrypt key with given passphrase": "无法解密私钥,请检查密码是否正确",
3247     "unknown address type": "未知的地址类型"
3248 };
3249
3250 /* harmony default export */ __webpack_exports__["a"] = (cn);
3251
3252 /***/ }),
3253
3254 /***/ 582:
3255 /***/ (function(module, __webpack_exports__, __webpack_require__) {
3256
3257 "use strict";
3258 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(532);
3259 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
3260 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__assets_language__ = __webpack_require__(438);
3261 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vuex__ = __webpack_require__(433);
3262
3263 //
3264 //
3265 //
3266 //
3267 //
3268 //
3269 //
3270 //
3271 //
3272 //
3273 //
3274 //
3275 //
3276 //
3277 //
3278 //
3279 //
3280 //
3281 //
3282 //
3283 //
3284 //
3285 //
3286 //
3287 //
3288 //
3289 //
3290 //
3291 //
3292 //
3293 //
3294 //
3295 //
3296 //
3297 //
3298 //
3299 //
3300 //
3301 //
3302 //
3303 //
3304 //
3305 //
3306 //
3307 //
3308 //
3309 //
3310 //
3311 //
3312 //
3313 //
3314
3315
3316
3317
3318 var CLASS_CN = "form-item-content form-item-content-cn";
3319 var CLASS_EN = "form-item-content form-item-content-en";
3320 /* harmony default export */ __webpack_exports__["a"] = ({
3321     data: function data() {
3322         return {
3323             show: false,
3324             passwd: ""
3325         };
3326     },
3327
3328     props: {
3329         i18n: {
3330             type: String,
3331             default: 'cn'
3332         }
3333     },
3334     computed: __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({
3335         passwdStyle: function passwdStyle() {
3336             if (this.i18n == "cn") {
3337                 return CLASS_CN;
3338             } else if (this.i18n == "en") {
3339                 return CLASS_EN;
3340             }
3341             return CLASS_CN;
3342         }
3343     }, Object(__WEBPACK_IMPORTED_MODULE_2_vuex__["c" /* mapGetters */])(['language'])),
3344     methods: {
3345         open: function open() {
3346             this.i18n = Object(__WEBPACK_IMPORTED_MODULE_1__assets_language__["b" /* getLanguage */])(this.language);
3347             this.show = true;
3348             this.passwd = "";
3349         },
3350         close: function close() {
3351             this.show = false;
3352         },
3353         confirm: function confirm() {
3354             if (this.passwd == "") {
3355                 this.$dialog.show({
3356                     body: this.$t("transfer.emptyPassword")
3357                 });
3358                 return;
3359             }
3360
3361             this.close();
3362             this.$emit("confirm", this.passwd);
3363         }
3364     }
3365 });
3366
3367 /***/ }),
3368
3369 /***/ 584:
3370 /***/ (function(module, __webpack_exports__, __webpack_require__) {
3371
3372 "use strict";
3373 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_modal_passwd_vue__ = __webpack_require__(582);
3374 /* unused harmony namespace reexport */
3375 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_2a9f9bf0_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_modal_passwd_vue__ = __webpack_require__(587);
3376 function injectStyle (ssrContext) {
3377   __webpack_require__(585)
3378 }
3379 var normalizeComponent = __webpack_require__(266)
3380 /* script */
3381
3382
3383 /* template */
3384
3385 /* template functional */
3386 var __vue_template_functional__ = false
3387 /* styles */
3388 var __vue_styles__ = injectStyle
3389 /* scopeId */
3390 var __vue_scopeId__ = "data-v-2a9f9bf0"
3391 /* moduleIdentifier (server only) */
3392 var __vue_module_identifier__ = null
3393 var Component = normalizeComponent(
3394   __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_modal_passwd_vue__["a" /* default */],
3395   __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_2a9f9bf0_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_modal_passwd_vue__["a" /* default */],
3396   __vue_template_functional__,
3397   __vue_styles__,
3398   __vue_scopeId__,
3399   __vue_module_identifier__
3400 )
3401
3402 /* harmony default export */ __webpack_exports__["a"] = (Component.exports);
3403
3404
3405 /***/ }),
3406
3407 /***/ 585:
3408 /***/ (function(module, exports, __webpack_require__) {
3409
3410 // style-loader: Adds some css to the DOM by adding a <style> tag
3411
3412 // load the styles
3413 var content = __webpack_require__(586);
3414 if(typeof content === 'string') content = [[module.i, content, '']];
3415 if(content.locals) module.exports = content.locals;
3416 // add the styles to the DOM
3417 var update = __webpack_require__(84)("c3761858", content, true, {});
3418
3419 /***/ }),
3420
3421 /***/ 586:
3422 /***/ (function(module, exports, __webpack_require__) {
3423
3424 exports = module.exports = __webpack_require__(83)(false);
3425 // imports
3426
3427
3428 // module
3429 exports.push([module.i, ".mask[data-v-2a9f9bf0]{z-index:3!important;top:60px!important}.confirm[data-v-2a9f9bf0]{padding:10px 20px;position:fixed;width:310px;left:0;bottom:0;right:0;z-index:4}.btn-inline[data-v-2a9f9bf0]{display:flex;padding:0}.btn-inline .btn[data-v-2a9f9bf0]{margin:10px 15px}.form-item-content-en[data-v-2a9f9bf0]{margin-left:145px}.form-item-content-cn[data-v-2a9f9bf0]{margin-left:85px}", ""]);
3430
3431 // exports
3432
3433
3434 /***/ }),
3435
3436 /***/ 587:
3437 /***/ (function(module, __webpack_exports__, __webpack_require__) {
3438
3439 "use strict";
3440 var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('section',{directives:[{name:"show",rawName:"v-show",value:(_vm.show),expression:"show"}],staticClass:"mask"}),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.show),expression:"show"}],staticClass:"confirm form bg-gray"},[_c('div',{staticClass:"form-item"},[_c('label',{staticClass:"form-item-label"},[_vm._v(_vm._s(_vm.$t('transfer.confirmPassword')))]),_vm._v(" "),_c('div',{class:_vm.passwdStyle},[_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.passwd),expression:"passwd"}],attrs:{"type":"password","autofocus":""},domProps:{"value":(_vm.passwd)},on:{"input":function($event){if($event.target.composing){ return; }_vm.passwd=$event.target.value}}})])]),_vm._v(" "),_c('div',{staticClass:"btn-group btn-inline"},[_c('div',{staticClass:"btn bg-green",on:{"click":_vm.confirm}},[_vm._v(_vm._s(_vm.$t('welcome.confirm')))]),_vm._v(" "),_c('div',{staticClass:"btn bg-red",on:{"click":_vm.close}},[_vm._v(_vm._s(_vm.$t('welcome.cancel')))])])])])}
3441 var staticRenderFns = []
3442 var esExports = { render: render, staticRenderFns: staticRenderFns }
3443 /* harmony default export */ __webpack_exports__["a"] = (esExports);
3444
3445 /***/ }),
3446
3447 /***/ 602:
3448 /***/ (function(module, __webpack_exports__, __webpack_require__) {
3449
3450 "use strict";
3451 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_promise__ = __webpack_require__(76);
3452 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_promise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_promise__);
3453 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__ = __webpack_require__(532);
3454 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends__);
3455 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_address__ = __webpack_require__(437);
3456 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__models_transaction__ = __webpack_require__(577);
3457 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_bignumber_js__ = __webpack_require__(576);
3458 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_bignumber_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_bignumber_js__);
3459 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__models_account__ = __webpack_require__(435);
3460 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__components_modal_passwd__ = __webpack_require__(584);
3461 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__assets_language_sdk__ = __webpack_require__(579);
3462 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_extension_streams__ = __webpack_require__(137);
3463 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_extension_streams___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_extension_streams__);
3464 /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_vuex__ = __webpack_require__(433);
3465
3466
3467 //
3468 //
3469 //
3470 //
3471 //
3472 //
3473 //
3474 //
3475 //
3476 //
3477 //
3478 //
3479 //
3480 //
3481 //
3482 //
3483 //
3484 //
3485 //
3486 //
3487 //
3488 //
3489 //
3490 //
3491 //
3492 //
3493 //
3494 //
3495 //
3496 //
3497 //
3498 //
3499 //
3500 //
3501 //
3502 //
3503 //
3504 //
3505 //
3506 //
3507 //
3508 //
3509 //
3510 //
3511 //
3512 //
3513 //
3514 //
3515 //
3516 //
3517 //
3518 //
3519 //
3520 //
3521 //
3522 //
3523 //
3524 //
3525 //
3526 //
3527 //
3528 //
3529 //
3530 //
3531 //
3532 //
3533 //
3534 //
3535 //
3536 //
3537 //
3538 //
3539 //
3540 //
3541 //
3542 //
3543 //
3544 //
3545 //
3546 //
3547 //
3548 //
3549 //
3550 //
3551 //
3552 //
3553 //
3554 //
3555 //
3556 //
3557 //
3558 //
3559 //
3560 //
3561 //
3562 //
3563 //
3564 //
3565 //
3566 //
3567 //
3568 //
3569 //
3570 //
3571 //
3572 //
3573 //
3574 //
3575 //
3576 //
3577 //
3578 //
3579 //
3580 //
3581 //
3582 //
3583 //
3584 //
3585 //
3586 //
3587 //
3588 //
3589 //
3590 //
3591 //
3592 //
3593 //
3594 //
3595 //
3596 //
3597 //
3598 //
3599 //
3600 //
3601 //
3602 //
3603 //
3604 //
3605 //
3606 //
3607 //
3608 //
3609 //
3610 //
3611 //
3612 //
3613 //
3614 //
3615 //
3616 //
3617 //
3618 //
3619 //
3620 //
3621 //
3622 //
3623 //
3624 //
3625 //
3626 //
3627 //
3628 //
3629 //
3630 //
3631 //
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642 /* harmony default export */ __webpack_exports__["a"] = ({
3643   components: {
3644     modalPasswd: __WEBPACK_IMPORTED_MODULE_6__components_modal_passwd__["a" /* default */]
3645   },
3646   data: function data() {
3647     return {
3648       full: false,
3649       title: null,
3650       accountLabel: this.$t('listVote.voteAccount'),
3651       rawData: {},
3652       account: {},
3653       transaction: {
3654         to: "",
3655         toShort: "",
3656         amount: 0,
3657         fee: ""
3658       },
3659       password: '',
3660       assetAlias: null
3661     };
3662   },
3663   beforeRouteEnter: function beforeRouteEnter(to, from, next) {
3664     next(function (vm) {
3665       if (from.name === 'veto') {
3666         vm.title = vm.$t('vote.vetoDetials');
3667         vm.accountLabel = vm.$t('listVote.vetoAccount');
3668       }
3669
3670       next();
3671     });
3672   },
3673
3674   computed: __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_extends___default()({
3675     totalAmount: function totalAmount() {
3676       if (this.assetAlias && this.assetAlias.toUpperCase() === 'BTM') {
3677         var n = new __WEBPACK_IMPORTED_MODULE_4_bignumber_js___default.a(this.transaction.amount);
3678         return n.plus(this.transaction.fee).toNumber();
3679       } else {
3680         return Number(this.transaction.amount);
3681       }
3682     }
3683   }, Object(__WEBPACK_IMPORTED_MODULE_9_vuex__["d" /* mapState */])(['selectVote']), Object(__WEBPACK_IMPORTED_MODULE_9_vuex__["c" /* mapGetters */])(['language', 'net'])),
3684   methods: {
3685     shortAddress: function shortAddress(add) {
3686       return __WEBPACK_IMPORTED_MODULE_2__utils_address__["a" /* default */].short(add);
3687     },
3688     transfer: function transfer() {
3689       var _this = this;
3690
3691       if (this.password == "") {
3692         this.$dialog.show({
3693           body: this.$t("transfer.emptyPassword")
3694         });
3695         return;
3696       }
3697       var loader = this.$loading.show({
3698         // Optional parameters
3699         container: null,
3700         canCancel: true,
3701         onCancel: this.onCancel
3702       });
3703
3704       __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_promise___default.a.all(this.rawData.map(function (rawdata) {
3705         return __WEBPACK_IMPORTED_MODULE_3__models_transaction__["a" /* default */].transfer(_this.account.guid, rawdata, _this.password, _this.account.vpAddress);
3706       })).then(function (ret) {
3707         loader.hide();
3708         if (_this.$route.params.type == 'popup') {
3709           __WEBPACK_IMPORTED_MODULE_8_extension_streams__["LocalStream"].send({ method: 'transfer', action: 'success', message: ret[ret.length - 1] });
3710           window.close();
3711         }
3712         _this.$dialog.show({
3713           type: 'success',
3714           body: _this.$t("transfer.success")
3715         });
3716         _this.$router.push('/');
3717         if (_this.transaction.type === 'toVapor') {
3718           __WEBPACK_IMPORTED_MODULE_5__models_account__["a" /* default */].setupNet(_this.net + "vapor");
3719         }
3720       }).catch(function (error) {
3721         loader.hide();
3722         _this.$dialog.show({
3723           body: Object(__WEBPACK_IMPORTED_MODULE_7__assets_language_sdk__["a" /* default */])(error.message, _this.language)
3724         });
3725       });
3726     }
3727   }, mounted: function mounted() {
3728     var params = this.$route.params;
3729
3730     this.account = params.account;
3731     this.transaction = params.transaction;
3732     this.transaction.toShort = params.transaction.to;
3733     this.rawData = params.rawData;
3734
3735     this.assetAlias = params.assetAlias;
3736   }
3737 });
3738
3739 /***/ }),
3740
3741 /***/ 650:
3742 /***/ (function(module, exports, __webpack_require__) {
3743
3744 // style-loader: Adds some css to the DOM by adding a <style> tag
3745
3746 // load the styles
3747 var content = __webpack_require__(651);
3748 if(typeof content === 'string') content = [[module.i, content, '']];
3749 if(content.locals) module.exports = content.locals;
3750 // add the styles to the DOM
3751 var update = __webpack_require__(84)("62272a1a", content, true, {});
3752
3753 /***/ }),
3754
3755 /***/ 651:
3756 /***/ (function(module, exports, __webpack_require__) {
3757
3758 exports = module.exports = __webpack_require__(83)(false);
3759 // imports
3760
3761
3762 // module
3763 exports.push([module.i, ".warp[data-v-59f3fab1]{position:absolute;top:0;left:0;right:0;height:600px;z-index:2}.header[data-v-59f3fab1]{display:flex}.header p[data-v-59f3fab1]{text-align:center;width:270px;padding-top:17px}.content[data-v-59f3fab1]{margin:20px;padding:20px;overflow:hidden;border-radius:4px;width:280px}.ft[data-v-59f3fab1]{border-radius:5px;padding:0 20px!important;line-height:45px;margin-bottom:20px}.ft .from[data-v-59f3fab1]{overflow-x:hidden;width:90px}.ft .to[data-v-59f3fab1]{overflow-x:hidden;padding-left:20px;float:right}.right-arrow[data-v-59f3fab1]{width:32px;height:32px;border-top:12px solid #3c454b;border-right:12px solid #3c454b;transform:rotate(45deg);position:absolute;left:105px}.divider[data-v-59f3fab1]{margin:15px 0}.value .uint[data-v-59f3fab1]{font-size:12px;margin-left:3px;text-transform:uppercase}.fee-intro[data-v-59f3fab1]{font-size:10px}.btn-inline[data-v-59f3fab1]{display:flex;padding:0}.btn-inline .btn[data-v-59f3fab1]{margin:10px 15px}.row[data-v-59f3fab1]{word-break:break-all}.col[data-v-59f3fab1]{font-size:14px;width:35%}.label[data-v-59f3fab1]{color:#7b7b7b}.value[data-v-59f3fab1]{color:#282828;width:60%}.asset[data-v-59f3fab1]{text-transform:uppercase}table[data-v-59f3fab1]{width:100%}.form-item[data-v-59f3fab1]{padding:0;margin:0;margin-bottom:10px}.scorll-panel[data-v-59f3fab1]{overflow:scroll;height:545px}.view-link[data-v-59f3fab1]{font-size:14px;color:#035bd4}", ""]);
3764
3765 // exports
3766
3767
3768 /***/ }),
3769
3770 /***/ 652:
3771 /***/ (function(module, __webpack_exports__, __webpack_require__) {
3772
3773 "use strict";
3774 var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"warp bg-gray"},[_c('section',{staticClass:"header bg-header"},[_c('i',{staticClass:"iconfont icon-back",on:{"click":function($event){_vm.$router.go(-1)}}}),_vm._v(" "),_c('p',[_vm._v(_vm._s(_vm.title || _vm.$t('vote.voteDetials')))])]),_vm._v(" "),_c('div',{staticClass:"scorll-panel"},[_c('section',{staticClass:"content bg-white"},[_c('table',[_c('tbody',[_c('tr',{staticClass:"row"},[_c('td',{staticClass:"col label"},[_vm._v(_vm._s(_vm.accountLabel))]),_vm._v(" "),_c('td',{staticClass:"col value"},[_vm._v(_vm._s(_vm.account.alias))])]),_vm._v(" "),(_vm.selectVote.name)?_c('tr',{staticClass:"row"},[_c('td',{staticClass:"col label"},[_vm._v(_vm._s(_vm.$t('listVote.bpName')))]),_vm._v(" "),_c('td',{staticClass:"col value"},[_vm._v(_vm._s(_vm.selectVote.name))])]):_c('tr',{staticClass:"row"},[_c('td',{staticClass:"col label"},[_vm._v(_vm._s(_vm.$t('listVote.bpPubkey')))]),_vm._v(" "),_c('td',{staticClass:"col value"},[_vm._v(_vm._s(_vm.transaction.toShort))])]),_vm._v(" "),_c('div',{staticClass:"divider"}),_vm._v(" "),_c('tr',{staticClass:"row"},[_c('td',{staticClass:"col label"},[_vm._v(_vm._s(_vm.$t('listVote.votes')))]),_vm._v(" "),_c('td',{staticClass:"col value"},[_vm._v(_vm._s(_vm.transaction.amount)),(_vm.assetAlias)?_c('span',{staticClass:"uint"},[_vm._v(_vm._s(_vm.assetAlias))]):_vm._e()])]),_vm._v(" "),_c('tr',{staticClass:"row"},[_c('td',{staticClass:"col label"},[_vm._v(_vm._s(_vm.$t('transfer.fee')))]),_vm._v(" "),_c('td',{staticClass:"col value"},[_vm._v(_vm._s(_vm.transaction.fee)),_c('span',{staticClass:"uint"},[_vm._v("BTM")])])])])])]),_vm._v(" "),_c('section',{staticClass:"content bg-white"},[_c('div',{staticClass:"form"},[_c('div',{staticClass:"form-item"},[_c('label',{staticClass:"form-item-label"},[_vm._v(_vm._s(_vm.$t('transfer.confirmPassword')))]),_vm._v(" "),_c('div',{staticClass:"form-item-content"},[_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.password),expression:"password"}],attrs:{"type":"password","autofocus":""},domProps:{"value":(_vm.password)},on:{"input":function($event){if($event.target.composing){ return; }_vm.password=$event.target.value}}})])])])]),_vm._v(" "),_c('div',{staticClass:"row",staticStyle:{"margin":"20px"}},[_c('div',{staticClass:"btn bg-green",on:{"click":_vm.transfer}},[_vm._v(_vm._s(_vm.$t('transfer.confirm')))])])])])}
3775 var staticRenderFns = []
3776 var esExports = { render: render, staticRenderFns: staticRenderFns }
3777 /* harmony default export */ __webpack_exports__["a"] = (esExports);
3778
3779 /***/ })
3780
3781 });
3782 //# sourceMappingURL=6.js.map