/*! * js-table2excel v1.1.2 * Released under the MIT License. * repository: https://github.com/hxj9102/table2excel.git */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Table2Excel=t()}(this,(function(){"use strict";var e=function(e,o){var i;"ie"==((i=window.navigator.userAgent).indexOf("MSIE")>=0?"ie":i.indexOf("Firefox")>=0?"Firefox":i.indexOf("Chrome")>=0?"Chrome":i.indexOf("Opera")>=0?"Opera":i.indexOf("Safari")>=0?"Safari":void 0)?t(e):n(e,o)},t=function(e,t){var n=e,o=new ActiveXObject("Excel.Application"),i=o.Workbooks.Add(),c=i.Worksheets(1),a=document.body.createTextRange();a.moveToElementText(n),a.select,a.execCommand("Copy"),c.Paste(),o.Visible=!0;try{o.Application.GetSaveAsFilename("Excel.xls","Excel Spreadsheets (*.xls), *.xls")}catch(e){print("Nested catch caught "+e)}finally{i.SaveAs(fname),i.Close(savechanges=!1),o.Quit(),o=null,window.setInterval("Cleanup();",1),window.setInterval("Cleanup();",1)}},n=function(e,t){var n,o="data:application/vnd.ms-excel;base64,"+function(e){return window.btoa(unescape(encodeURIComponent(e)))}((n={worksheet:t,table:e},'\x3c!--[if gte mso 9]>{worksheet}{table}
'.replace(/{(\w+)}/g,(function(e,t){return n[t]}))));if(navigator.userAgent.indexOf("Firefox")>-1)window.location.href=o;else{var i,c=document.createElement("a");c.href=o,c.download=t||"",window.MouseEvent?i=new MouseEvent("click"):(i=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),c.dispatchEvent(i)}};return function(){for(var t={image:function(e,t){return t=Object.assign({width:40,height:60},t),''.concat(e,"")}},n=arguments.length,o=new Array(n),i=0;i'.concat(s,""):"",h=a.reduce((function(e,t){return e+="".concat(t.title,"")}),"");h="".concat(h,"");var x=r.reduce((function(e,n){var o=a.reduce((function(e,o){var i={};return"image"===o.type&&(n.size?(i.width=n.size[0],i.height=n.size[1]):(o.width&&(i.width=o.width),o.height&&(i.height=o.height))),e+=t[o.type||"text"](n[o.key],i)}),"");return e+="".concat(o,"")}),"");x="".concat(x,""),e(d+h+x,l)}}));