4.js 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. (window["webpackJsonp"] = window["webpackJsonp"] || []).push([[4],{
  2. /***/ "../../node_modules/charenc/charenc.js":
  3. /*!********************************************************************!*\
  4. !*** /Users/bill/word/4dkankan_v4/node_modules/charenc/charenc.js ***!
  5. \********************************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports) {
  8. eval("var charenc = {\n // UTF-8 encoding\n utf8: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));\n }\n },\n\n // Binary encoding\n bin: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n for (var bytes = [], i = 0; i < str.length; i++)\n bytes.push(str.charCodeAt(i) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n for (var str = [], i = 0; i < bytes.length; i++)\n str.push(String.fromCharCode(bytes[i]));\n return str.join('');\n }\n }\n};\n\nmodule.exports = charenc;\n\n\n//# sourceURL=webpack:////Users/bill/word/4dkankan_v4/node_modules/charenc/charenc.js?");
  9. /***/ }),
  10. /***/ "../../node_modules/crypt/crypt.js":
  11. /*!****************************************************************!*\
  12. !*** /Users/bill/word/4dkankan_v4/node_modules/crypt/crypt.js ***!
  13. \****************************************************************/
  14. /*! no static exports found */
  15. /***/ (function(module, exports) {
  16. eval("(function() {\n var base64map\n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n\n crypt = {\n // Bit-wise rotation left\n rotl: function(n, b) {\n return (n << b) | (n >>> (32 - b));\n },\n\n // Bit-wise rotation right\n rotr: function(n, b) {\n return (n << (32 - b)) | (n >>> b);\n },\n\n // Swap big-endian to little-endian and vice versa\n endian: function(n) {\n // If number given, swap endian\n if (n.constructor == Number) {\n return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;\n }\n\n // Else, assume array and swap all items\n for (var i = 0; i < n.length; i++)\n n[i] = crypt.endian(n[i]);\n return n;\n },\n\n // Generate an array of any length of random bytes\n randomBytes: function(n) {\n for (var bytes = []; n > 0; n--)\n bytes.push(Math.floor(Math.random() * 256));\n return bytes;\n },\n\n // Convert a byte array to big-endian 32-bit words\n bytesToWords: function(bytes) {\n for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)\n words[b >>> 5] |= bytes[i] << (24 - b % 32);\n return words;\n },\n\n // Convert big-endian 32-bit words to a byte array\n wordsToBytes: function(words) {\n for (var bytes = [], b = 0; b < words.length * 32; b += 8)\n bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a hex string\n bytesToHex: function(bytes) {\n for (var hex = [], i = 0; i < bytes.length; i++) {\n hex.push((bytes[i] >>> 4).toString(16));\n hex.push((bytes[i] & 0xF).toString(16));\n }\n return hex.join('');\n },\n\n // Convert a hex string to a byte array\n hexToBytes: function(hex) {\n for (var bytes = [], c = 0; c < hex.length; c += 2)\n bytes.push(parseInt(hex.substr(c, 2), 16));\n return bytes;\n },\n\n // Convert a byte array to a base-64 string\n bytesToBase64: function(bytes) {\n for (var base64 = [], i = 0; i < bytes.length; i += 3) {\n var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];\n for (var j = 0; j < 4; j++)\n if (i * 8 + j * 6 <= bytes.length * 8)\n base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));\n else\n base64.push('=');\n }\n return base64.join('');\n },\n\n // Convert a base-64 string to a byte array\n base64ToBytes: function(base64) {\n // Remove non-base-64 characters\n base64 = base64.replace(/[^A-Z0-9+\\/]/ig, '');\n\n for (var bytes = [], i = 0, imod4 = 0; i < base64.length;\n imod4 = ++i % 4) {\n if (imod4 == 0) continue;\n bytes.push(((base64map.indexOf(base64.charAt(i - 1))\n & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))\n | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));\n }\n return bytes;\n }\n };\n\n module.exports = crypt;\n})();\n\n\n//# sourceURL=webpack:////Users/bill/word/4dkankan_v4/node_modules/crypt/crypt.js?");
  17. /***/ }),
  18. /***/ "../../node_modules/is-buffer/index.js":
  19. /*!********************************************************************!*\
  20. !*** /Users/bill/word/4dkankan_v4/node_modules/is-buffer/index.js ***!
  21. \********************************************************************/
  22. /*! no static exports found */
  23. /***/ (function(module, exports) {
  24. eval("/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh <https://feross.org>\n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n\n\n//# sourceURL=webpack:////Users/bill/word/4dkankan_v4/node_modules/is-buffer/index.js?");
  25. /***/ }),
  26. /***/ "../../node_modules/md5/md5.js":
  27. /*!************************************************************!*\
  28. !*** /Users/bill/word/4dkankan_v4/node_modules/md5/md5.js ***!
  29. \************************************************************/
  30. /*! no static exports found */
  31. /***/ (function(module, exports, __webpack_require__) {
  32. eval("(function(){\r\n var crypt = __webpack_require__(/*! crypt */ \"../../node_modules/crypt/crypt.js\"),\r\n utf8 = __webpack_require__(/*! charenc */ \"../../node_modules/charenc/charenc.js\").utf8,\r\n isBuffer = __webpack_require__(/*! is-buffer */ \"../../node_modules/is-buffer/index.js\"),\r\n bin = __webpack_require__(/*! charenc */ \"../../node_modules/charenc/charenc.js\").bin,\r\n\r\n // The core\r\n md5 = function (message, options) {\r\n // Convert to byte array\r\n if (message.constructor == String)\r\n if (options && options.encoding === 'binary')\r\n message = bin.stringToBytes(message);\r\n else\r\n message = utf8.stringToBytes(message);\r\n else if (isBuffer(message))\r\n message = Array.prototype.slice.call(message, 0);\r\n else if (!Array.isArray(message) && message.constructor !== Uint8Array)\r\n message = message.toString();\r\n // else, assume byte array already\r\n\r\n var m = crypt.bytesToWords(message),\r\n l = message.length * 8,\r\n a = 1732584193,\r\n b = -271733879,\r\n c = -1732584194,\r\n d = 271733878;\r\n\r\n // Swap endian\r\n for (var i = 0; i < m.length; i++) {\r\n m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |\r\n ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;\r\n }\r\n\r\n // Padding\r\n m[l >>> 5] |= 0x80 << (l % 32);\r\n m[(((l + 64) >>> 9) << 4) + 14] = l;\r\n\r\n // Method shortcuts\r\n var FF = md5._ff,\r\n GG = md5._gg,\r\n HH = md5._hh,\r\n II = md5._ii;\r\n\r\n for (var i = 0; i < m.length; i += 16) {\r\n\r\n var aa = a,\r\n bb = b,\r\n cc = c,\r\n dd = d;\r\n\r\n a = FF(a, b, c, d, m[i+ 0], 7, -680876936);\r\n d = FF(d, a, b, c, m[i+ 1], 12, -389564586);\r\n c = FF(c, d, a, b, m[i+ 2], 17, 606105819);\r\n b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);\r\n a = FF(a, b, c, d, m[i+ 4], 7, -176418897);\r\n d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);\r\n c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);\r\n b = FF(b, c, d, a, m[i+ 7], 22, -45705983);\r\n a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);\r\n d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);\r\n c = FF(c, d, a, b, m[i+10], 17, -42063);\r\n b = FF(b, c, d, a, m[i+11], 22, -1990404162);\r\n a = FF(a, b, c, d, m[i+12], 7, 1804603682);\r\n d = FF(d, a, b, c, m[i+13], 12, -40341101);\r\n c = FF(c, d, a, b, m[i+14], 17, -1502002290);\r\n b = FF(b, c, d, a, m[i+15], 22, 1236535329);\r\n\r\n a = GG(a, b, c, d, m[i+ 1], 5, -165796510);\r\n d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);\r\n c = GG(c, d, a, b, m[i+11], 14, 643717713);\r\n b = GG(b, c, d, a, m[i+ 0], 20, -373897302);\r\n a = GG(a, b, c, d, m[i+ 5], 5, -701558691);\r\n d = GG(d, a, b, c, m[i+10], 9, 38016083);\r\n c = GG(c, d, a, b, m[i+15], 14, -660478335);\r\n b = GG(b, c, d, a, m[i+ 4], 20, -405537848);\r\n a = GG(a, b, c, d, m[i+ 9], 5, 568446438);\r\n d = GG(d, a, b, c, m[i+14], 9, -1019803690);\r\n c = GG(c, d, a, b, m[i+ 3], 14, -187363961);\r\n b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);\r\n a = GG(a, b, c, d, m[i+13], 5, -1444681467);\r\n d = GG(d, a, b, c, m[i+ 2], 9, -51403784);\r\n c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);\r\n b = GG(b, c, d, a, m[i+12], 20, -1926607734);\r\n\r\n a = HH(a, b, c, d, m[i+ 5], 4, -378558);\r\n d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);\r\n c = HH(c, d, a, b, m[i+11], 16, 1839030562);\r\n b = HH(b, c, d, a, m[i+14], 23, -35309556);\r\n a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);\r\n d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);\r\n c = HH(c, d, a, b, m[i+ 7], 16, -155497632);\r\n b = HH(b, c, d, a, m[i+10], 23, -1094730640);\r\n a = HH(a, b, c, d, m[i+13], 4, 681279174);\r\n d = HH(d, a, b, c, m[i+ 0], 11, -358537222);\r\n c = HH(c, d, a, b, m[i+ 3], 16, -722521979);\r\n b = HH(b, c, d, a, m[i+ 6], 23, 76029189);\r\n a = HH(a, b, c, d, m[i+ 9], 4, -640364487);\r\n d = HH(d, a, b, c, m[i+12], 11, -421815835);\r\n c = HH(c, d, a, b, m[i+15], 16, 530742520);\r\n b = HH(b, c, d, a, m[i+ 2], 23, -995338651);\r\n\r\n a = II(a, b, c, d, m[i+ 0], 6, -198630844);\r\n d = II(d, a, b, c, m[i+ 7], 10, 1126891415);\r\n c = II(c, d, a, b, m[i+14], 15, -1416354905);\r\n b = II(b, c, d, a, m[i+ 5], 21, -57434055);\r\n a = II(a, b, c, d, m[i+12], 6, 1700485571);\r\n d = II(d, a, b, c, m[i+ 3], 10, -1894986606);\r\n c = II(c, d, a, b, m[i+10], 15, -1051523);\r\n b = II(b, c, d, a, m[i+ 1], 21, -2054922799);\r\n a = II(a, b, c, d, m[i+ 8], 6, 1873313359);\r\n d = II(d, a, b, c, m[i+15], 10, -30611744);\r\n c = II(c, d, a, b, m[i+ 6], 15, -1560198380);\r\n b = II(b, c, d, a, m[i+13], 21, 1309151649);\r\n a = II(a, b, c, d, m[i+ 4], 6, -145523070);\r\n d = II(d, a, b, c, m[i+11], 10, -1120210379);\r\n c = II(c, d, a, b, m[i+ 2], 15, 718787259);\r\n b = II(b, c, d, a, m[i+ 9], 21, -343485551);\r\n\r\n a = (a + aa) >>> 0;\r\n b = (b + bb) >>> 0;\r\n c = (c + cc) >>> 0;\r\n d = (d + dd) >>> 0;\r\n }\r\n\r\n return crypt.endian([a, b, c, d]);\r\n };\r\n\r\n // Auxiliary functions\r\n md5._ff = function (a, b, c, d, x, s, t) {\r\n var n = a + (b & c | ~b & d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._gg = function (a, b, c, d, x, s, t) {\r\n var n = a + (b & d | c & ~d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._hh = function (a, b, c, d, x, s, t) {\r\n var n = a + (b ^ c ^ d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._ii = function (a, b, c, d, x, s, t) {\r\n var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n\r\n // Package private blocksize\r\n md5._blocksize = 16;\r\n md5._digestsize = 16;\r\n\r\n module.exports = function (message, options) {\r\n if (message === undefined || message === null)\r\n throw new Error('Illegal argument ' + message);\r\n\r\n var digestbytes = crypt.wordsToBytes(md5(message, options));\r\n return options && options.asBytes ? digestbytes :\r\n options && options.asString ? bin.bytesToString(digestbytes) :\r\n crypt.bytesToHex(digestbytes);\r\n };\r\n\r\n})();\r\n\n\n//# sourceURL=webpack:////Users/bill/word/4dkankan_v4/node_modules/md5/md5.js?");
  33. /***/ }),
  34. /***/ "./src/store/download.ts":
  35. /*!*******************************!*\
  36. !*** ./src/store/download.ts ***!
  37. \*******************************/
  38. /*! exports provided: DownItemStatus, downloads, downIdsSuccess, request, poolReuqest, downloadCheck, useDownload, downFile */
  39. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40. "use strict";
  41. eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DownItemStatus\", function() { return DownItemStatus; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"downloads\", function() { return downloads; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"downIdsSuccess\", function() { return downIdsSuccess; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"request\", function() { return request; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"poolReuqest\", function() { return poolReuqest; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"downloadCheck\", function() { return downloadCheck; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"useDownload\", function() { return useDownload; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"downFile\", function() { return downFile; });\n/* harmony import */ var core_js_modules_es_error_cause_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.error.cause.js */ \"../../node_modules/core-js/modules/es.error.cause.js\");\n/* harmony import */ var core_js_modules_es_error_cause_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_error_cause_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"../../node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _request__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/request */ \"./src/request/index.ts\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vue */ \"../../node_modules/vue/dist/vue.runtime.esm-bundler.js\");\n/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! md5 */ \"../../node_modules/md5/md5.js\");\n/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(md5__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _hook__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/hook */ \"./src/hook/index.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/utils */ \"./src/utils/index.ts\");\n/* harmony import */ var _lang__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/lang */ \"./src/lang/index.ts\");\n\n\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = undefined && undefined.__generator || function (thisArg, body) {\n var _ = {\n label: 0,\n sent: function () {\n if (t[0] & 1) throw t[1];\n return t[1];\n },\n trys: [],\n ops: []\n },\n f,\n y,\n t,\n g;\n return g = {\n next: verb(0),\n \"throw\": verb(1),\n \"return\": verb(2)\n }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function () {\n return this;\n }), g;\n function verb(n) {\n return function (v) {\n return step([n, v]);\n };\n }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0:\n case 1:\n t = op;\n break;\n case 4:\n _.label++;\n return {\n value: op[1],\n done: false\n };\n case 5:\n _.label++;\n y = op[1];\n op = [0];\n continue;\n case 7:\n op = _.ops.pop();\n _.trys.pop();\n continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n _ = 0;\n continue;\n }\n if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {\n _.label = op[1];\n break;\n }\n if (op[0] === 6 && _.label < t[1]) {\n _.label = t[1];\n t = op;\n break;\n }\n if (t && _.label < t[2]) {\n _.label = t[2];\n _.ops.push(op);\n break;\n }\n if (t[2]) _.ops.pop();\n _.trys.pop();\n continue;\n }\n op = body.call(thisArg, _);\n } catch (e) {\n op = [6, e];\n y = 0;\n } finally {\n f = t = 0;\n }\n if (op[0] & 5) throw op[1];\n return {\n value: op[0] ? op[1] : void 0,\n done: true\n };\n }\n};\n\n\n\n\n\n\nvar DownItemStatus;\n(function (DownItemStatus) {\n DownItemStatus[DownItemStatus[\"ing\"] = 0] = \"ing\";\n DownItemStatus[DownItemStatus[\"success\"] = 1] = \"success\";\n DownItemStatus[DownItemStatus[\"error\"] = 2] = \"error\";\n})(DownItemStatus || (DownItemStatus = {}));\nvar downloads = Object(vue__WEBPACK_IMPORTED_MODULE_3__[\"ref\"])([]);\nvar downIdsSuccess = Object(vue__WEBPACK_IMPORTED_MODULE_3__[\"computed\"])(function () {\n return downloads.value.filter(function (item) {\n return item.status === DownItemStatus.success;\n }).map(function (item) {\n return item.id;\n });\n});\nvar getSpaceStr = function (space) {\n var k = space / 1024;\n if (k < 1024) {\n return Object(_utils__WEBPACK_IMPORTED_MODULE_6__[\"round\"])(k, 2) + 'KB';\n }\n var m = k / 1024;\n if (m < 1024) {\n return Object(_utils__WEBPACK_IMPORTED_MODULE_6__[\"round\"])(m, 2) + 'MB';\n }\n var g = m / 1024;\n return Object(_utils__WEBPACK_IMPORTED_MODULE_6__[\"round\"])(g, 2) + 'GB';\n};\nvar request = function () {\n return __awaiter(void 0, void 0, void 0, function () {\n var res;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n return [4 /*yield*/, _request__WEBPACK_IMPORTED_MODULE_2__[\"axios\"].post(_request__WEBPACK_IMPORTED_MODULE_2__[\"URL\"].downloadList)];\n case 1:\n res = _a.sent();\n downloads.value = res.map(function (item) {\n return __assign(__assign({}, item), {\n type: item.modelType,\n size: item.success ? getSpaceStr(item.space) : 'un',\n time: item.start_time,\n status: item.success ? DownItemStatus.success : DownItemStatus.ing,\n url: item.output_file\n });\n });\n return [2 /*return*/];\n }\n });\n });\n};\n\nvar timeout;\nvar stopWatch = false;\nvar poolReuqest = function () {\n stopWatch = false;\n clearTimeout(timeout);\n request().then(function () {\n for (var _i = 0, _a = downloads.value; _i < _a.length; _i++) {\n var item = _a[_i];\n if (item.status === DownItemStatus.ing) {\n return true;\n }\n }\n return false;\n }).then(function (poll) {\n if (poll && !stopWatch) {\n timeout = setTimeout(poolReuqest, 5000);\n }\n });\n return function () {\n stopWatch = true;\n clearTimeout(timeout);\n };\n};\nvar downloadCheck = function (md5) {\n return __awaiter(void 0, void 0, void 0, function () {\n var res;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n return [4 /*yield*/, _request__WEBPACK_IMPORTED_MODULE_2__[\"axios\"].post(_request__WEBPACK_IMPORTED_MODULE_2__[\"URL\"].downloadCheck, {\n md5: md5\n })];\n case 1:\n res = _a.sent();\n return [2 /*return*/, res.data ? res.data : false];\n }\n });\n });\n};\nvar getCheckData = function (data) {\n if (Array.isArray(data)) {\n return data.map(getCheckData);\n } else if (data && typeof data === 'object') {\n return Object.fromEntries(Object.entries(data).map(function (_a) {\n var k = _a[0],\n v = _a[1];\n return [k, getCheckData(v)];\n }));\n } else if (typeof data === 'number') {\n return Object(_utils__WEBPACK_IMPORTED_MODULE_6__[\"round\"])(data, 2);\n } else {\n return data;\n }\n};\n// downloadDateSet\n// cropDateSet\n// downloadEarthwork\nvar useDownload = function (data, fn) {\n return __awaiter(void 0, void 0, Promise, function () {\n var md5Str, checkRes, url, _a, item, res;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n md5Str = md5__WEBPACK_IMPORTED_MODULE_4___default()(JSON.stringify(getCheckData(data)));\n return [4 /*yield*/, _request__WEBPACK_IMPORTED_MODULE_2__[\"axios\"].post(_request__WEBPACK_IMPORTED_MODULE_2__[\"URL\"].downloadCheck, {\n md5: md5Str\n })];\n case 1:\n checkRes = _b.sent();\n if (!(checkRes.code === 8013)) return [3 /*break*/, 3];\n return [4 /*yield*/, Object(_hook__WEBPACK_IMPORTED_MODULE_5__[\"useAlert\"])(_lang__WEBPACK_IMPORTED_MODULE_7__[\"ui18n\"].t('sys.downloadLog.exixtsPackMsg'))];\n case 2:\n return [2 /*return*/, _b.sent()];\n case 3:\n url = checkRes.data;\n _a = url;\n if (!_a) return [3 /*break*/, 5];\n return [4 /*yield*/, Object(_hook__WEBPACK_IMPORTED_MODULE_5__[\"useConfirm\"])({\n hideClose: true,\n content: _lang__WEBPACK_IMPORTED_MODULE_7__[\"ui18n\"].t('sys.downloadLog.exixtsMsg'),\n okText: _lang__WEBPACK_IMPORTED_MODULE_7__[\"ui18n\"].t('sys.downloadLog.exixtsOk'),\n noText: _lang__WEBPACK_IMPORTED_MODULE_7__[\"ui18n\"].t('sys.downloadLog.exixtsCancel')\n })];\n case 4:\n _a = _b.sent();\n _b.label = 5;\n case 5:\n if (!_a) return [3 /*break*/, 7];\n item = downloads.value.find(function (item) {\n return item.url === url;\n });\n return [4 /*yield*/, downFile(url, item === null || item === void 0 ? void 0 : item.name)];\n case 6:\n _b.sent();\n return [2 /*return*/];\n case 7:\n return [4 /*yield*/, fn(data, md5Str)];\n case 8:\n res = _b.sent();\n poolReuqest();\n return [4 /*yield*/, Object(_hook__WEBPACK_IMPORTED_MODULE_5__[\"useAlert\"])({\n content: _lang__WEBPACK_IMPORTED_MODULE_7__[\"ui18n\"].t('sys.downloadLog.packTip'),\n okText: _lang__WEBPACK_IMPORTED_MODULE_7__[\"ui18n\"].t('sys.ok')\n })];\n case 9:\n _b.sent();\n return [2 /*return*/, res];\n }\n });\n });\n};\nvar downContent = Object(vue__WEBPACK_IMPORTED_MODULE_3__[\"ref\"])('');\nvar downFile = Object(_hook__WEBPACK_IMPORTED_MODULE_5__[\"genUseLoading\"])(function (url, name) {\n return __awaiter(void 0, void 0, void 0, function () {\n var ext, _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n downContent.value = _lang__WEBPACK_IMPORTED_MODULE_7__[\"ui18n\"].t('earthwork.downIng') + 0 + '%';\n ext = url.substring(url.lastIndexOf('.'));\n _b.label = 1;\n case 1:\n _b.trys.push([1, 3,, 4]);\n return [4 /*yield*/, Object(_utils__WEBPACK_IMPORTED_MODULE_6__[\"saveAs\"])(url, name + ext, undefined, function (step) {\n downContent.value = _lang__WEBPACK_IMPORTED_MODULE_7__[\"ui18n\"].t('earthwork.downIng') + Object(_utils__WEBPACK_IMPORTED_MODULE_6__[\"round\"])(step * 100, 2) + '%';\n })];\n case 2:\n _b.sent();\n downContent.value = '';\n return [3 /*break*/, 4];\n case 3:\n _a = _b.sent();\n location.href = url;\n return [3 /*break*/, 4];\n case 4:\n return [2 /*return*/];\n }\n });\n });\n}, {\n content: downContent\n});\n\n//# sourceURL=webpack:///./src/store/download.ts?");
  42. /***/ })
  43. }]);