file-saver.js 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. import {
  2. __commonJS,
  3. init_define_APP_INFO
  4. } from "./chunk-XY75H3MP.js";
  5. // node_modules/file-saver/dist/FileSaver.min.js
  6. var require_FileSaver_min = __commonJS({
  7. "node_modules/file-saver/dist/FileSaver.min.js"(exports, module) {
  8. init_define_APP_INFO();
  9. (function(a, b) {
  10. if ("function" == typeof define && define.amd)
  11. define([], b);
  12. else if ("undefined" != typeof exports)
  13. b();
  14. else {
  15. b(), a.FileSaver = { exports: {} }.exports;
  16. }
  17. })(exports, function() {
  18. "use strict";
  19. function b(a2, b2) {
  20. return "undefined" == typeof b2 ? b2 = { autoBom: false } : "object" != typeof b2 && (console.warn("Deprecated: Expected third argument to be a object"), b2 = { autoBom: !b2 }), b2.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a2.type) ? new Blob(["\uFEFF", a2], { type: a2.type }) : a2;
  21. }
  22. function c(a2, b2, c2) {
  23. var d2 = new XMLHttpRequest();
  24. d2.open("GET", a2), d2.responseType = "blob", d2.onload = function() {
  25. g(d2.response, b2, c2);
  26. }, d2.onerror = function() {
  27. console.error("could not download file");
  28. }, d2.send();
  29. }
  30. function d(a2) {
  31. var b2 = new XMLHttpRequest();
  32. b2.open("HEAD", a2, false);
  33. try {
  34. b2.send();
  35. } catch (a3) {
  36. }
  37. return 200 <= b2.status && 299 >= b2.status;
  38. }
  39. function e(a2) {
  40. try {
  41. a2.dispatchEvent(new MouseEvent("click"));
  42. } catch (c2) {
  43. var b2 = document.createEvent("MouseEvents");
  44. b2.initMouseEvent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null), a2.dispatchEvent(b2);
  45. }
  46. }
  47. var f = "object" == typeof window && window.window === window ? window : "object" == typeof self && self.self === self ? self : "object" == typeof global && global.global === global ? global : void 0, a = f.navigator && /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent), g = f.saveAs || ("object" != typeof window || window !== f ? function() {
  48. } : "download" in HTMLAnchorElement.prototype && !a ? function(b2, g2, h) {
  49. var i = f.URL || f.webkitURL, j = document.createElement("a");
  50. g2 = g2 || b2.name || "download", j.download = g2, j.rel = "noopener", "string" == typeof b2 ? (j.href = b2, j.origin === location.origin ? e(j) : d(j.href) ? c(b2, g2, h) : e(j, j.target = "_blank")) : (j.href = i.createObjectURL(b2), setTimeout(function() {
  51. i.revokeObjectURL(j.href);
  52. }, 4e4), setTimeout(function() {
  53. e(j);
  54. }, 0));
  55. } : "msSaveOrOpenBlob" in navigator ? function(f2, g2, h) {
  56. if (g2 = g2 || f2.name || "download", "string" != typeof f2)
  57. navigator.msSaveOrOpenBlob(b(f2, h), g2);
  58. else if (d(f2))
  59. c(f2, g2, h);
  60. else {
  61. var i = document.createElement("a");
  62. i.href = f2, i.target = "_blank", setTimeout(function() {
  63. e(i);
  64. });
  65. }
  66. } : function(b2, d2, e2, g2) {
  67. if (g2 = g2 || open("", "_blank"), g2 && (g2.document.title = g2.document.body.innerText = "downloading..."), "string" == typeof b2)
  68. return c(b2, d2, e2);
  69. var h = "application/octet-stream" === b2.type, i = /constructor/i.test(f.HTMLElement) || f.safari, j = /CriOS\/[\d]+/.test(navigator.userAgent);
  70. if ((j || h && i || a) && "undefined" != typeof FileReader) {
  71. var k = new FileReader();
  72. k.onloadend = function() {
  73. var a2 = k.result;
  74. a2 = j ? a2 : a2.replace(/^data:[^;]*;/, "data:attachment/file;"), g2 ? g2.location.href = a2 : location = a2, g2 = null;
  75. }, k.readAsDataURL(b2);
  76. } else {
  77. var l = f.URL || f.webkitURL, m = l.createObjectURL(b2);
  78. g2 ? g2.location = m : location.href = m, g2 = null, setTimeout(function() {
  79. l.revokeObjectURL(m);
  80. }, 4e4);
  81. }
  82. });
  83. f.saveAs = g.saveAs = g, "undefined" != typeof module && (module.exports = g);
  84. });
  85. }
  86. });
  87. // dep:file-saver
  88. init_define_APP_INFO();
  89. var file_saver_default = require_FileSaver_min();
  90. export {
  91. file_saver_default as default
  92. };
  93. //# sourceMappingURL=file-saver.js.map