Build 533169stable
Module 522579
3,020 characters · in f91f2de0fbd0d11b.js, 4c3c9a548e67a0a1.js, 4a2385af63bf5778.js, 9ead4104846accc8.jsDependencies
Source Raw
function(t){var e=e||function(t){"use strict";if(!("u">typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))){var e=t.document,n=function(){return t.URL||t.webkitURL||t},r=e.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in r,i=function(t){var e=new MouseEvent("click");t.dispatchEvent(e)},a=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),s=t.webkitRequestFileSystem,u=t.requestFileSystem||s||t.mozRequestFileSystem,l=function(e){(t.setImmediate||t.setTimeout)(function(){throw e},0)},c="application/octet-stream",d=0,f=function(t){setTimeout(function(){"string"==typeof t?n().revokeObjectURL(t):t.remove()},4e4)},p=function(t,e,n){for(var r=(e=[].concat(e)).length;r--;){var o=t["on"+e[r]];if("function"==typeof o)try{o.call(t,n||t)}catch(t){l(t)}}},w=function(t){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\xef\xbb\xbf",t],{type:t.type}):t},b=function(e,l,b){b||(e=w(e));var y,g,v=this,h=e.type,m=!1,S=function(){p(v,"writestart progress write writeend".split(" "))},A=function(){if(g&&a&&"u">typeof FileReader){var r=new FileReader;r.onloadend=function(){var t=r.result;g.location.href="data:attachment/file"+t.slice(t.search(/[,;]/)),v.readyState=v.DONE,S()},r.readAsDataURL(e),v.readyState=v.INIT;return}(m||!y)&&(y=n().createObjectURL(e)),g?g.location.href=y:void 0===t.open(y,"_blank")&&a&&(t.location.href=y),v.readyState=v.DONE,S(),f(y)},O=function(t){return function(){if(v.readyState!==v.DONE)return t.apply(this,arguments)}},x={create:!0,exclusive:!1};if(v.readyState=v.INIT,l||(l="download"),o){y=n().createObjectURL(e),setTimeout(function(){r.href=y,r.download=l,i(r),S(),f(y),v.readyState=v.DONE});return}(t.chrome&&h&&h!==c&&(e=(e.slice||e.webkitSlice).call(e,0,e.size,c),m=!0),s&&"download"!==l&&(l+=".download"),(h===c||s)&&(g=t),u)?(d+=e.size,u(t.TEMPORARY,d,O(function(t){t.root.getDirectory("saved",x,O(function(t){var n=function(){t.getFile(l,x,O(function(t){t.createWriter(O(function(n){n.onwriteend=function(e){g.location.href=t.toURL(),v.readyState=v.DONE,p(v,"writeend",e),f(t)},n.onerror=function(){var t=n.error;t.code!==t.ABORT_ERR&&A()},"writestart progress write abort".split(" ").forEach(function(t){n["on"+t]=v["on"+t]}),n.write(e),v.abort=function(){n.abort(),v.readyState=v.DONE},v.readyState=v.WRITING}),A)}),A)};t.getFile(l,{create:!1},O(function(t){t.remove(),n()}),O(function(t){t.code===t.NOT_FOUND_ERR?n():A()}))}),A)}),A)):A()},y=b.prototype;return"u">typeof navigator&&navigator.msSaveOrOpenBlob?function(t,e,n){return n||(t=w(t)),navigator.msSaveOrOpenBlob(t,e||"download")}:(y.abort=function(){this.readyState=this.DONE,p(this,"abort")},y.readyState=y.INIT=0,y.WRITING=1,y.DONE=2,y.error=y.onwritestart=y.onprogress=y.onwrite=y.onabort=y.onerror=y.onwriteend=null,function(t,e,n){return new b(t,e,n)})}}("u">typeof self&&self||"u">typeof window&&window||this.content);t.exports?t.exports.saveAs=e:"u">typeof define&&null!==define&&null!==define.amd&&define([],function(){return e})}