{"action":"opened","issue":{"url":"https://api.github.com/repos/SheetJS/js-xlsx/issues/156","labels_url":"https://api.github.com/repos/SheetJS/js-xlsx/issues/156/labels{/name}","comments_url":"https://api.github.com/repos/SheetJS/js-xlsx/issues/156/comments","events_url":"https://api.github.com/repos/SheetJS/js-xlsx/issues/156/events","html_url":"https://github.com/SheetJS/js-xlsx/issues/156","id":53223255,"number":156,"title":"When writing hyperlink cell & save the wb, cell created as simple text","user":{"login":"MayaGi","id":5850000,"avatar_url":"https://avatars.githubusercontent.com/u/5850000?v=3","gravatar_id":"","url":"https://api.github.com/users/MayaGi","html_url":"https://github.com/MayaGi","followers_url":"https://api.github.com/users/MayaGi/followers","following_url":"https://api.github.com/users/MayaGi/following{/other_user}","gists_url":"https://api.github.com/users/MayaGi/gists{/gist_id}","starred_url":"https://api.github.com/users/MayaGi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MayaGi/subscriptions","organizations_url":"https://api.github.com/users/MayaGi/orgs","repos_url":"https://api.github.com/users/MayaGi/repos","events_url":"https://api.github.com/users/MayaGi/events{/privacy}","received_events_url":"https://api.github.com/users/MayaGi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-01T16:37:15Z","updated_at":"2015-01-01T16:37:15Z","closed_at":null,"body":"Hi,\r\nWhen creating the workbook from scratch, creating a hyperlink text according to the docs, cell is created as a simple text.\r\n\r\nhere is the code:\r\n<!-- HTML generated using hilite.me --><div style=\"background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;\"><table><tr><td><pre style=\"margin: 0; line-height: 125%\">  1\r\n  2\r\n  3\r\n  4\r\n  5\r\n  6\r\n  7\r\n  8\r\n  9\r\n 10\r\n 11\r\n 12\r\n 13\r\n 14\r\n 15\r\n 16\r\n 17\r\n 18\r\n 19\r\n 20\r\n 21\r\n 22\r\n 23\r\n 24\r\n 25\r\n 26\r\n 27\r\n 28\r\n 29\r\n 30\r\n 31\r\n 32\r\n 33\r\n 34\r\n 35\r\n 36\r\n 37\r\n 38\r\n 39\r\n 40\r\n 41\r\n 42\r\n 43\r\n 44\r\n 45\r\n 46\r\n 47\r\n 48\r\n 49\r\n 50\r\n 51\r\n 52\r\n 53\r\n 54\r\n 55\r\n 56\r\n 57\r\n 58\r\n 59\r\n 60\r\n 61\r\n 62\r\n 63\r\n 64\r\n 65\r\n 66\r\n 67\r\n 68\r\n 69\r\n 70\r\n 71\r\n 72\r\n 73\r\n 74\r\n 75\r\n 76\r\n 77\r\n 78\r\n 79\r\n 80\r\n 81\r\n 82\r\n 83\r\n 84\r\n 85\r\n 86\r\n 87\r\n 88\r\n 89\r\n 90\r\n 91\r\n 92\r\n 93\r\n 94\r\n 95\r\n 96\r\n 97\r\n 98\r\n 99\r\n100\r\n101\r\n102\r\n103\r\n104\r\n105\r\n106\r\n107\r\n108\r\n109\r\n110\r\n111</pre></td><td><pre style=\"margin: 0; line-height: 125%\">        <span style=\"color: #888888\">/* writing feature test -- look for TEST: in comments */</span>\r\n        <span style=\"color: #888888\">/* vim: set ts=2: */</span>\r\n\r\n        <span style=\"color: #008800; font-weight: bold\">function</span> Hyperlink() {\r\n            <span style=\"color: #008800; font-weight: bold\">this</span>.target <span style=\"color: #333333\">=</span> <span style=\"background-color: #fff0f0\">&quot;&quot;</span>;\r\n            <span style=\"color: #008800; font-weight: bold\">this</span>.display <span style=\"color: #333333\">=</span> <span style=\"background-color: #fff0f0\">&quot;&quot;</span>;\r\n        }\r\n\r\n        <span style=\"color: #008800; font-weight: bold\">var</span> x <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">new</span> Hyperlink();\r\n        x.target <span style=\"color: #333333\">=</span> <span style=\"background-color: #fff0f0\">&quot;http://localhost:9980/HEXA3_FA/index.html#/fm/s/unassociated_failures&quot;</span>;\r\n        x.display <span style=\"color: #333333\">=</span> <span style=\"background-color: #fff0f0\">&quot;link&quot;</span>;\r\n\r\n        <span style=\"color: #888888\">/* original data */</span>\r\n        <span style=\"color: #008800; font-weight: bold\">var</span> data <span style=\"color: #333333\">=</span> [\r\n            [<span style=\"color: #0000DD; font-weight: bold\">1</span>, <span style=\"color: #0000DD; font-weight: bold\">2</span>, <span style=\"color: #0000DD; font-weight: bold\">3</span>],\r\n            [<span style=\"color: #008800; font-weight: bold\">true</span>, <span style=\"color: #008800; font-weight: bold\">false</span>, <span style=\"color: #008800; font-weight: bold\">null</span>, <span style=\"background-color: #fff0f0\">&quot;sheetjs&quot;</span>],\r\n            [<span style=\"background-color: #fff0f0\">&quot;foo&quot;</span>, <span style=\"background-color: #fff0f0\">&quot;bar&quot;</span>, <span style=\"color: #008800; font-weight: bold\">new</span> <span style=\"color: #007020\">Date</span>(<span style=\"background-color: #fff0f0\">&quot;2014-02-19T14:30Z&quot;</span>), <span style=\"background-color: #fff0f0\">&quot;0.3&quot;</span>],\r\n            [<span style=\"background-color: #fff0f0\">&quot;baz&quot;</span>, <span style=\"color: #008800; font-weight: bold\">null</span>, x]\r\n        ];\r\n\r\n        <span style=\"color: #008800; font-weight: bold\">var</span> ws_name <span style=\"color: #333333\">=</span> <span style=\"background-color: #fff0f0\">&quot;SheetJS&quot;</span>;\r\n\r\n        <span style=\"color: #008800; font-weight: bold\">var</span> wscols <span style=\"color: #333333\">=</span> [\r\n            { wch<span style=\"color: #333333\">:</span> <span style=\"color: #0000DD; font-weight: bold\">6</span> },\r\n            { wch<span style=\"color: #333333\">:</span> <span style=\"color: #0000DD; font-weight: bold\">7</span> },\r\n            { wch<span style=\"color: #333333\">:</span> <span style=\"color: #0000DD; font-weight: bold\">10</span> },\r\n            { wch<span style=\"color: #333333\">:</span> <span style=\"color: #0000DD; font-weight: bold\">20</span> }\r\n        ];\r\n\r\n\r\n        console.log(<span style=\"background-color: #fff0f0\">&quot;Sheet Name: &quot;</span> <span style=\"color: #333333\">+</span> ws_name);\r\n        console.log(<span style=\"background-color: #fff0f0\">&quot;Data: &quot;</span>); <span style=\"color: #008800; font-weight: bold\">for</span> (<span style=\"color: #008800; font-weight: bold\">var</span> i <span style=\"color: #333333\">=</span> <span style=\"color: #0000DD; font-weight: bold\">0</span>; i <span style=\"color: #333333\">!=</span> data.length; <span style=\"color: #333333\">++</span>i) console.log(data[i]);\r\n        console.log(<span style=\"background-color: #fff0f0\">&quot;Columns :&quot;</span>); <span style=\"color: #008800; font-weight: bold\">for</span> (i <span style=\"color: #333333\">=</span> <span style=\"color: #0000DD; font-weight: bold\">0</span>; i <span style=\"color: #333333\">!=</span> wscols.length; <span style=\"color: #333333\">++</span>i) console.log(wscols[i]);\r\n\r\n\r\n\r\n        <span style=\"color: #888888\">/* require XLSX */</span>\r\n        <span style=\"color: #008800; font-weight: bold\">if</span> (<span style=\"color: #008800; font-weight: bold\">typeof</span> XLSX <span style=\"color: #333333\">===</span> <span style=\"background-color: #fff0f0\">&quot;undefined&quot;</span>) { <span style=\"color: #008800; font-weight: bold\">try</span> { XLSX <span style=\"color: #333333\">=</span> require(<span style=\"background-color: #fff0f0\">&#39;./&#39;</span>); } <span style=\"color: #008800; font-weight: bold\">catch</span> (e) { XLSX <span style=\"color: #333333\">=</span> require(<span style=\"background-color: #fff0f0\">&#39;../&#39;</span>); } }\r\n\r\n        <span style=\"color: #888888\">/* dummy workbook constructor */</span>\r\n        <span style=\"color: #008800; font-weight: bold\">function</span> Workbook() {\r\n            <span style=\"color: #008800; font-weight: bold\">if</span> (<span style=\"color: #333333\">!</span>(<span style=\"color: #008800; font-weight: bold\">this</span> <span style=\"color: #008800; font-weight: bold\">instanceof</span> Workbook)) <span style=\"color: #008800; font-weight: bold\">return</span> <span style=\"color: #008800; font-weight: bold\">new</span> Workbook();\r\n            <span style=\"color: #008800; font-weight: bold\">this</span>.SheetNames <span style=\"color: #333333\">=</span> [];\r\n            <span style=\"color: #008800; font-weight: bold\">this</span>.Sheets <span style=\"color: #333333\">=</span> {};\r\n        }\r\n        <span style=\"color: #008800; font-weight: bold\">var</span> wb <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">new</span> Workbook();\r\n\r\n\r\n        <span style=\"color: #888888\">/* TODO: date1904 logic */</span>\r\n        <span style=\"color: #008800; font-weight: bold\">function</span> datenum(v, date1904) {\r\n            <span style=\"color: #008800; font-weight: bold\">if</span> (date1904) v <span style=\"color: #333333\">+=</span> <span style=\"color: #0000DD; font-weight: bold\">1462</span>;\r\n            <span style=\"color: #008800; font-weight: bold\">var</span> epoch <span style=\"color: #333333\">=</span> <span style=\"color: #007020\">Date</span>.parse(v);\r\n            <span style=\"color: #008800; font-weight: bold\">return</span> (epoch <span style=\"color: #333333\">-</span> <span style=\"color: #008800; font-weight: bold\">new</span> <span style=\"color: #007020\">Date</span>(<span style=\"color: #007020\">Date</span>.UTC(<span style=\"color: #0000DD; font-weight: bold\">1899</span>, <span style=\"color: #0000DD; font-weight: bold\">11</span>, <span style=\"color: #0000DD; font-weight: bold\">30</span>))) <span style=\"color: #333333\">/</span> (<span style=\"color: #0000DD; font-weight: bold\">24</span> <span style=\"color: #333333\">*</span> <span style=\"color: #0000DD; font-weight: bold\">60</span> <span style=\"color: #333333\">*</span> <span style=\"color: #0000DD; font-weight: bold\">60</span> <span style=\"color: #333333\">*</span> <span style=\"color: #0000DD; font-weight: bold\">1000</span>);\r\n        }\r\n\r\n        <span style=\"color: #888888\">/* convert an array of arrays in JS to a CSF spreadsheet */</span>\r\n        <span style=\"color: #008800; font-weight: bold\">function</span> sheet_from_array_of_arrays(data, opts) {\r\n            <span style=\"color: #008800; font-weight: bold\">var</span> ws <span style=\"color: #333333\">=</span> {};\r\n            <span style=\"color: #008800; font-weight: bold\">var</span> range <span style=\"color: #333333\">=</span> { s<span style=\"color: #333333\">:</span> { c<span style=\"color: #333333\">:</span> <span style=\"color: #0000DD; font-weight: bold\">10000000</span>, r<span style=\"color: #333333\">:</span> <span style=\"color: #0000DD; font-weight: bold\">10000000</span> }, e<span style=\"color: #333333\">:</span> { c<span style=\"color: #333333\">:</span> <span style=\"color: #0000DD; font-weight: bold\">0</span>, r<span style=\"color: #333333\">:</span> <span style=\"color: #0000DD; font-weight: bold\">0</span> } };\r\n            <span style=\"color: #008800; font-weight: bold\">for</span> (<span style=\"color: #008800; font-weight: bold\">var</span> R <span style=\"color: #333333\">=</span> <span style=\"color: #0000DD; font-weight: bold\">0</span>; R <span style=\"color: #333333\">!=</span> data.length; <span style=\"color: #333333\">++</span>R) {\r\n                <span style=\"color: #008800; font-weight: bold\">for</span> (<span style=\"color: #008800; font-weight: bold\">var</span> C <span style=\"color: #333333\">=</span> <span style=\"color: #0000DD; font-weight: bold\">0</span>; C <span style=\"color: #333333\">!=</span> data[R].length; <span style=\"color: #333333\">++</span>C) {\r\n                    <span style=\"color: #008800; font-weight: bold\">if</span> (range.s.r <span style=\"color: #333333\">&gt;</span> R) range.s.r <span style=\"color: #333333\">=</span> R;\r\n                    <span style=\"color: #008800; font-weight: bold\">if</span> (range.s.c <span style=\"color: #333333\">&gt;</span> C) range.s.c <span style=\"color: #333333\">=</span> C;\r\n                    <span style=\"color: #008800; font-weight: bold\">if</span> (range.e.r <span style=\"color: #333333\">&lt;</span> R) range.e.r <span style=\"color: #333333\">=</span> R;\r\n                    <span style=\"color: #008800; font-weight: bold\">if</span> (range.e.c <span style=\"color: #333333\">&lt;</span> C) range.e.c <span style=\"color: #333333\">=</span> C;\r\n                    <span style=\"color: #008800; font-weight: bold\">var</span> cell <span style=\"color: #333333\">=</span> { v<span style=\"color: #333333\">:</span> data[R][C] };\r\n                    <span style=\"color: #008800; font-weight: bold\">if</span> (cell.v <span style=\"color: #333333\">==</span> <span style=\"color: #008800; font-weight: bold\">null</span>) <span style=\"color: #008800; font-weight: bold\">continue</span>;\r\n                    <span style=\"color: #008800; font-weight: bold\">var</span> cell_ref <span style=\"color: #333333\">=</span> XLSX.utils.encode_cell({ c<span style=\"color: #333333\">:</span> C, r<span style=\"color: #333333\">:</span> R });\r\n\r\n                    <span style=\"color: #888888\">/* TEST: proper cell types and value handling */</span>\r\n                    <span style=\"color: #008800; font-weight: bold\">if</span> (<span style=\"color: #008800; font-weight: bold\">typeof</span> cell.v <span style=\"color: #333333\">===</span> <span style=\"background-color: #fff0f0\">&#39;number&#39;</span>) cell.t <span style=\"color: #333333\">=</span> <span style=\"background-color: #fff0f0\">&#39;n&#39;</span>;\r\n                    <span style=\"color: #008800; font-weight: bold\">else</span> <span style=\"color: #008800; font-weight: bold\">if</span> (<span style=\"color: #008800; font-weight: bold\">typeof</span> cell.v <span style=\"color: #333333\">===</span> <span style=\"background-color: #fff0f0\">&#39;boolean&#39;</span>) cell.t <span style=\"color: #333333\">=</span> <span style=\"background-color: #fff0f0\">&#39;b&#39;</span>;\r\n                    <span style=\"color: #008800; font-weight: bold\">else</span> <span style=\"color: #008800; font-weight: bold\">if</span> (cell.v <span style=\"color: #008800; font-weight: bold\">instanceof</span> <span style=\"color: #007020\">Date</span>) {\r\n                        cell.t <span style=\"color: #333333\">=</span> <span style=\"background-color: #fff0f0\">&#39;n&#39;</span>; cell.z <span style=\"color: #333333\">=</span> XLSX.SSF._table[<span style=\"color: #0000DD; font-weight: bold\">14</span>];\r\n                        cell.v <span style=\"color: #333333\">=</span> datenum(cell.v);\r\n                    }\r\n                    <span style=\"color: #008800; font-weight: bold\">else</span> <span style=\"color: #008800; font-weight: bold\">if</span> (cell.v <span style=\"color: #008800; font-weight: bold\">instanceof</span> Hyperlink) {\r\n                        cell.l <span style=\"color: #333333\">=</span> { Target<span style=\"color: #333333\">:</span> cell.v.target, tooltip<span style=\"color: #333333\">:</span> cell.v.display },\r\n                        cell.v <span style=\"color: #333333\">=</span> cell.v.display;\r\n                    }\r\n                    <span style=\"color: #008800; font-weight: bold\">else</span> cell.t <span style=\"color: #333333\">=</span> <span style=\"background-color: #fff0f0\">&#39;s&#39;</span>;\r\n                    ws[cell_ref] <span style=\"color: #333333\">=</span> cell;\r\n                }\r\n            }\r\n\r\n            <span style=\"color: #888888\">/* TEST: proper range */</span>\r\n            <span style=\"color: #008800; font-weight: bold\">if</span> (range.s.c <span style=\"color: #333333\">&lt;</span> <span style=\"color: #0000DD; font-weight: bold\">10000000</span>) ws[<span style=\"background-color: #fff0f0\">&#39;!ref&#39;</span>] <span style=\"color: #333333\">=</span> XLSX.utils.encode_range(range);\r\n            <span style=\"color: #008800; font-weight: bold\">return</span> ws;\r\n        }\r\n        <span style=\"color: #008800; font-weight: bold\">var</span> ws <span style=\"color: #333333\">=</span> sheet_from_array_of_arrays(data);\r\n\r\n        <span style=\"color: #888888\">/* TEST: add worksheet to workbook */</span>\r\n        wb.SheetNames.push(ws_name);\r\n        wb.Sheets[ws_name] <span style=\"color: #333333\">=</span> ws;\r\n\r\n        <span style=\"color: #888888\">/* TEST: column widths */</span>\r\n        ws[<span style=\"background-color: #fff0f0\">&#39;!cols&#39;</span>] <span style=\"color: #333333\">=</span> wscols;\r\n\r\n        <span style=\"color: #888888\">/* write file */</span>\r\n        <span style=\"color: #888888\">//XLSX.writeFile(wb, &#39;sheetjs.xlsx&#39;);</span>\r\n        <span style=\"color: #008800; font-weight: bold\">var</span> wbout <span style=\"color: #333333\">=</span> XLSX.write(wb, { bookType<span style=\"color: #333333\">:</span> <span style=\"background-color: #fff0f0\">&quot;xlsx&quot;</span>, bookSST<span style=\"color: #333333\">:</span> <span style=\"color: #008800; font-weight: bold\">true</span>, type<span style=\"color: #333333\">:</span> <span style=\"background-color: #fff0f0\">&#39;binary&#39;</span> });\r\n        console.log(<span style=\"background-color: #fff0f0\">&quot;wbout: &quot;</span> <span style=\"color: #333333\">+</span> wbout);\r\n        <span style=\"color: #008800; font-weight: bold\">var</span> s2ab <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">function</span>(s) {\r\n            <span style=\"color: #008800; font-weight: bold\">var</span> buf <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">new</span> ArrayBuffer(s.length);\r\n            <span style=\"color: #008800; font-weight: bold\">var</span> view <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">new</span> Uint8Array(buf);\r\n            <span style=\"color: #008800; font-weight: bold\">for</span> (<span style=\"color: #008800; font-weight: bold\">var</span> i <span style=\"color: #333333\">=</span> <span style=\"color: #0000DD; font-weight: bold\">0</span>; i <span style=\"color: #333333\">!=</span> s.length; <span style=\"color: #333333\">++</span>i) view[i] <span style=\"color: #333333\">=</span> s.charCodeAt(i) <span style=\"color: #333333\">&amp;</span> <span style=\"color: #005588; font-weight: bold\">0xFF</span>;\r\n            <span style=\"color: #008800; font-weight: bold\">return</span> buf;\r\n        };\r\n\r\n        <span style=\"color: #008800; font-weight: bold\">var</span> saveAs <span style=\"color: #333333\">=</span> saveAs <span style=\"color: #333333\">||</span> (<span style=\"color: #008800; font-weight: bold\">typeof</span> navigator <span style=\"color: #333333\">!==</span> <span style=\"background-color: #fff0f0\">&quot;undefined&quot;</span> <span style=\"color: #333333\">&amp;&amp;</span> navigator.msSaveOrOpenBlob <span style=\"color: #333333\">&amp;&amp;</span> navigator.msSaveOrOpenBlob.bind(navigator)) <span style=\"color: #333333\">||</span> (<span style=\"color: #008800; font-weight: bold\">function</span> (h) { <span style=\"color: #008800; font-weight: bold\">if</span> (<span style=\"color: #008800; font-weight: bold\">typeof</span> navigator <span style=\"color: #333333\">!==</span> <span style=\"background-color: #fff0f0\">&quot;undefined&quot;</span> <span style=\"color: #333333\">&amp;&amp;</span> <span style=\"color: #000000; background-color: #fff0ff\">/MSIE [1-9]\\./</span>.test(navigator.userAgent)) { <span style=\"color: #008800; font-weight: bold\">return</span> } <span style=\"color: #008800; font-weight: bold\">var</span> r <span style=\"color: #333333\">=</span> h.<span style=\"color: #007020\">document</span>, l <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">function</span> () { <span style=\"color: #008800; font-weight: bold\">return</span> h.URL <span style=\"color: #333333\">||</span> h.webkitURL <span style=\"color: #333333\">||</span> h }, e <span style=\"color: #333333\">=</span> h.URL <span style=\"color: #333333\">||</span> h.webkitURL <span style=\"color: #333333\">||</span> h, n <span style=\"color: #333333\">=</span> r.createElementNS(<span style=\"background-color: #fff0f0\">&quot;http://www.w3.org/1999/xhtml&quot;</span>, <span style=\"background-color: #fff0f0\">&quot;a&quot;</span>), g <span style=\"color: #333333\">=</span> <span style=\"color: #333333\">!</span>h.externalHost <span style=\"color: #333333\">&amp;&amp;</span> <span style=\"background-color: #fff0f0\">&quot;download&quot;</span> <span style=\"color: #008800; font-weight: bold\">in</span> n, j <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">function</span> (t) { <span style=\"color: #008800; font-weight: bold\">var</span> s <span style=\"color: #333333\">=</span> r.createEvent(<span style=\"background-color: #fff0f0\">&quot;MouseEvents&quot;</span>); s.initMouseEvent(<span style=\"background-color: #fff0f0\">&quot;click&quot;</span>, <span style=\"color: #008800; font-weight: bold\">true</span>, <span style=\"color: #008800; font-weight: bold\">false</span>, h, <span style=\"color: #0000DD; font-weight: bold\">0</span>, <span style=\"color: #0000DD; font-weight: bold\">0</span>, <span style=\"color: #0000DD; font-weight: bold\">0</span>, <span style=\"color: #0000DD; font-weight: bold\">0</span>, <span style=\"color: #0000DD; font-weight: bold\">0</span>, <span style=\"color: #008800; font-weight: bold\">false</span>, <span style=\"color: #008800; font-weight: bold\">false</span>, <span style=\"color: #008800; font-weight: bold\">false</span>, <span style=\"color: #008800; font-weight: bold\">false</span>, <span style=\"color: #0000DD; font-weight: bold\">0</span>, <span style=\"color: #008800; font-weight: bold\">null</span>); t.dispatchEvent(s) }, o <span style=\"color: #333333\">=</span> h.webkitRequestFileSystem, p <span style=\"color: #333333\">=</span> h.requestFileSystem <span style=\"color: #333333\">||</span> o <span style=\"color: #333333\">||</span> h.mozRequestFileSystem, m <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">function</span> (s) { (h.setImmediate <span style=\"color: #333333\">||</span> h.setTimeout)(<span style=\"color: #008800; font-weight: bold\">function</span> () { <span style=\"color: #008800; font-weight: bold\">throw</span> s }, <span style=\"color: #0000DD; font-weight: bold\">0</span>) }, c <span style=\"color: #333333\">=</span> <span style=\"background-color: #fff0f0\">&quot;application/octet-stream&quot;</span>, k <span style=\"color: #333333\">=</span> <span style=\"color: #0000DD; font-weight: bold\">0</span>, b <span style=\"color: #333333\">=</span> [], i <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">function</span> () { <span style=\"color: #008800; font-weight: bold\">var</span> t <span style=\"color: #333333\">=</span> b.length; <span style=\"color: #008800; font-weight: bold\">while</span> (t<span style=\"color: #333333\">--</span>) { <span style=\"color: #008800; font-weight: bold\">var</span> s <span style=\"color: #333333\">=</span> b[t]; <span style=\"color: #008800; font-weight: bold\">if</span> (<span style=\"color: #008800; font-weight: bold\">typeof</span> s <span style=\"color: #333333\">===</span> <span style=\"background-color: #fff0f0\">&quot;string&quot;</span>) { e.revokeObjectURL(s) } <span style=\"color: #008800; font-weight: bold\">else</span> { s.remove() } } b.length <span style=\"color: #333333\">=</span> <span style=\"color: #0000DD; font-weight: bold\">0</span> }, q <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">function</span> (t, s, w) { s <span style=\"color: #333333\">=</span> [].concat(s); <span style=\"color: #008800; font-weight: bold\">var</span> v <span style=\"color: #333333\">=</span> s.length; <span style=\"color: #008800; font-weight: bold\">while</span> (v<span style=\"color: #333333\">--</span>) { <span style=\"color: #008800; font-weight: bold\">var</span> x <span style=\"color: #333333\">=</span> t[<span style=\"background-color: #fff0f0\">&quot;on&quot;</span> <span style=\"color: #333333\">+</span> s[v]]; <span style=\"color: #008800; font-weight: bold\">if</span> (<span style=\"color: #008800; font-weight: bold\">typeof</span> x <span style=\"color: #333333\">===</span> <span style=\"background-color: #fff0f0\">&quot;function&quot;</span>) { <span style=\"color: #008800; font-weight: bold\">try</span> { x.call(t, w <span style=\"color: #333333\">||</span> t) } <span style=\"color: #008800; font-weight: bold\">catch</span> (u) { m(u) } } } }, f <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">function</span> (t, v) { <span style=\"color: #008800; font-weight: bold\">var</span> w <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">this</span>, C <span style=\"color: #333333\">=</span> t.type, F <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">false</span>, y, x, s <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">function</span> () { <span style=\"color: #008800; font-weight: bold\">var</span> G <span style=\"color: #333333\">=</span> l().createObjectURL(t); b.push(G); <span style=\"color: #008800; font-weight: bold\">return</span> G }, B <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">function</span> () { q(w, <span style=\"background-color: #fff0f0\">&quot;writestart progress write writeend&quot;</span>.split(<span style=\"background-color: #fff0f0\">&quot; &quot;</span>)) }, E <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">function</span> () { <span style=\"color: #008800; font-weight: bold\">if</span> (F <span style=\"color: #333333\">||</span> <span style=\"color: #333333\">!</span>y) { y <span style=\"color: #333333\">=</span> s(t) } <span style=\"color: #008800; font-weight: bold\">if</span> (x) { x.location.href <span style=\"color: #333333\">=</span> y } <span style=\"color: #008800; font-weight: bold\">else</span> { <span style=\"color: #008800; font-weight: bold\">if</span> (navigator.userAgent.match(<span style=\"color: #000000; background-color: #fff0ff\">/7\\.[\\d\\s\\.]+Safari/</span>) <span style=\"color: #333333\">&amp;&amp;</span> <span style=\"color: #008800; font-weight: bold\">typeof</span> <span style=\"color: #007020\">window</span>.FileReader <span style=\"color: #333333\">!==</span> <span style=\"background-color: #fff0f0\">&quot;undefined&quot;</span> <span style=\"color: #333333\">&amp;&amp;</span> t.size <span style=\"color: #333333\">&lt;=</span> <span style=\"color: #0000DD; font-weight: bold\">1024</span> <span style=\"color: #333333\">*</span> <span style=\"color: #0000DD; font-weight: bold\">1024</span> <span style=\"color: #333333\">*</span> <span style=\"color: #0000DD; font-weight: bold\">150</span>) { <span style=\"color: #008800; font-weight: bold\">var</span> G <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">new</span> <span style=\"color: #007020\">window</span>.FileReader(); G.readAsDataURL(t); G.onloadend <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">function</span> () { <span style=\"color: #008800; font-weight: bold\">var</span> H <span style=\"color: #333333\">=</span> r.createElement(<span style=\"background-color: #fff0f0\">&quot;iframe&quot;</span>); H.src <span style=\"color: #333333\">=</span> G.result; H.style.display <span style=\"color: #333333\">=</span> <span style=\"background-color: #fff0f0\">&quot;none&quot;</span>; r.body.appendChild(H); B(); <span style=\"color: #008800; font-weight: bold\">return</span> }; w.readyState <span style=\"color: #333333\">=</span> w.DONE; w.savedAs <span style=\"color: #333333\">=</span> w.SAVEDASUNKNOWN; <span style=\"color: #008800; font-weight: bold\">return</span> } <span style=\"color: #008800; font-weight: bold\">else</span> { <span style=\"color: #007020\">window</span>.open(y, <span style=\"background-color: #fff0f0\">&quot;_blank&quot;</span>); w.readyState <span style=\"color: #333333\">=</span> w.DONE; w.savedAs <span style=\"color: #333333\">=</span> w.SAVEDASBLOB; B(); <span style=\"color: #008800; font-weight: bold\">return</span> } } }, A <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">function</span> (G) { <span style=\"color: #008800; font-weight: bold\">return</span> <span style=\"color: #008800; font-weight: bold\">function</span> () { <span style=\"color: #008800; font-weight: bold\">if</span> (w.readyState <span style=\"color: #333333\">!==</span> w.DONE) { <span style=\"color: #008800; font-weight: bold\">return</span> G.apply(<span style=\"color: #008800; font-weight: bold\">this</span>, arguments) } } }, z <span style=\"color: #333333\">=</span> { create<span style=\"color: #333333\">:</span> <span style=\"color: #008800; font-weight: bold\">true</span>, exclusive<span style=\"color: #333333\">:</span> <span style=\"color: #008800; font-weight: bold\">false</span> }, D; w.readyState <span style=\"color: #333333\">=</span> w.INIT; <span style=\"color: #008800; font-weight: bold\">if</span> (<span style=\"color: #333333\">!</span>v) { v <span style=\"color: #333333\">=</span> <span style=\"background-color: #fff0f0\">&quot;download&quot;</span> } <span style=\"color: #008800; font-weight: bold\">if</span> (g) { y <span style=\"color: #333333\">=</span> s(t); r <span style=\"color: #333333\">=</span> h.<span style=\"color: #007020\">document</span>; n <span style=\"color: #333333\">=</span> r.createElementNS(<span style=\"background-color: #fff0f0\">&quot;http://www.w3.org/1999/xhtml&quot;</span>, <span style=\"background-color: #fff0f0\">&quot;a&quot;</span>); n.href <span style=\"color: #333333\">=</span> y; n.download <span style=\"color: #333333\">=</span> v; <span style=\"color: #008800; font-weight: bold\">var</span> u <span style=\"color: #333333\">=</span> r.createEvent(<span style=\"background-color: #fff0f0\">&quot;MouseEvents&quot;</span>); u.initMouseEvent(<span style=\"background-color: #fff0f0\">&quot;click&quot;</span>, <span style=\"color: #008800; font-weight: bold\">true</span>, <span style=\"color: #008800; font-weight: bold\">false</span>, h, <span style=\"color: #0000DD; font-weight: bold\">0</span>, <span style=\"color: #0000DD; font-weight: bold\">0</span>, <span style=\"color: #0000DD; font-weight: bold\">0</span>, <span style=\"color: #0000DD; font-weight: bold\">0</span>, <span style=\"color: #0000DD; font-weight: bold\">0</span>, <span style=\"color: #008800; font-weight: bold\">false</span>, <span style=\"color: #008800; font-weight: bold\">false</span>, <span style=\"color: #008800; font-weight: bold\">false</span>, <span style=\"color: #008800; font-weight: bold\">false</span>, <span style=\"color: #0000DD; font-weight: bold\">0</span>, <span style=\"color: #008800; font-weight: bold\">null</span>); n.dispatchEvent(u); w.readyState <span style=\"color: #333333\">=</span> w.DONE; w.savedAs <span style=\"color: #333333\">=</span> w.SAVEDASBLOB; B(); <span style=\"color: #008800; font-weight: bold\">return</span> } <span style=\"color: #008800; font-weight: bold\">if</span> (h.chrome <span style=\"color: #333333\">&amp;&amp;</span> C <span style=\"color: #333333\">&amp;&amp;</span> C <span style=\"color: #333333\">!==</span> c) { D <span style=\"color: #333333\">=</span> t.slice <span style=\"color: #333333\">||</span> t.webkitSlice; t <span style=\"color: #333333\">=</span> D.call(t, <span style=\"color: #0000DD; font-weight: bold\">0</span>, t.size, c); F <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">true</span> } <span style=\"color: #008800; font-weight: bold\">if</span> (o <span style=\"color: #333333\">&amp;&amp;</span> v <span style=\"color: #333333\">!==</span> <span style=\"background-color: #fff0f0\">&quot;download&quot;</span>) { v <span style=\"color: #333333\">+=</span> <span style=\"background-color: #fff0f0\">&quot;.download&quot;</span> } <span style=\"color: #008800; font-weight: bold\">if</span> (C <span style=\"color: #333333\">===</span> c <span style=\"color: #333333\">||</span> o) { x <span style=\"color: #333333\">=</span> h } <span style=\"color: #008800; font-weight: bold\">if</span> (<span style=\"color: #333333\">!</span>p) { E(); <span style=\"color: #008800; font-weight: bold\">return</span> } k <span style=\"color: #333333\">+=</span> t.size; p(h.TEMPORARY, k, A(<span style=\"color: #008800; font-weight: bold\">function</span> (G) { G.root.getDirectory(<span style=\"background-color: #fff0f0\">&quot;saved&quot;</span>, z, A(<span style=\"color: #008800; font-weight: bold\">function</span> (H) { <span style=\"color: #008800; font-weight: bold\">var</span> I <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">function</span> () { H.getFile(v, z, A(<span style=\"color: #008800; font-weight: bold\">function</span> (J) { J.createWriter(A(<span style=\"color: #008800; font-weight: bold\">function</span> (K) { K.onwriteend <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">function</span> (L) { x.location.href <span style=\"color: #333333\">=</span> J.toURL(); b.push(J); w.readyState <span style=\"color: #333333\">=</span> w.DONE; w.savedAs <span style=\"color: #333333\">=</span> w.SAVEDASBLOB; q(w, <span style=\"background-color: #fff0f0\">&quot;writeend&quot;</span>, L) }; K.onerror <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">function</span> () { <span style=\"color: #008800; font-weight: bold\">var</span> L <span style=\"color: #333333\">=</span> K.error; <span style=\"color: #008800; font-weight: bold\">if</span> (L.code <span style=\"color: #333333\">!==</span> L.ABORT_ERR) { E() } }; <span style=\"background-color: #fff0f0\">&quot;writestart progress write abort&quot;</span>.split(<span style=\"background-color: #fff0f0\">&quot; &quot;</span>).forEach(<span style=\"color: #008800; font-weight: bold\">function</span> (L) { K[<span style=\"background-color: #fff0f0\">&quot;on&quot;</span> <span style=\"color: #333333\">+</span> L] <span style=\"color: #333333\">=</span> w[<span style=\"background-color: #fff0f0\">&quot;on&quot;</span> <span style=\"color: #333333\">+</span> L] }); K.write(t); w.abort <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">function</span> () { K.abort(); w.readyState <span style=\"color: #333333\">=</span> w.DONE; w.savedAs <span style=\"color: #333333\">=</span> w.FAILED }; w.readyState <span style=\"color: #333333\">=</span> w.WRITING }), E) }), E) }; H.getFile(v, { create<span style=\"color: #333333\">:</span> <span style=\"color: #008800; font-weight: bold\">false</span> }, A(<span style=\"color: #008800; font-weight: bold\">function</span> (J) { J.remove(); I() }), A(<span style=\"color: #008800; font-weight: bold\">function</span> (J) { <span style=\"color: #008800; font-weight: bold\">if</span> (J.code <span style=\"color: #333333\">===</span> J.NOT_FOUND_ERR) { I() } <span style=\"color: #008800; font-weight: bold\">else</span> { E() } })) }), E) }), E) }, d <span style=\"color: #333333\">=</span> f.prototype, a <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">function</span> (s, t) { <span style=\"color: #008800; font-weight: bold\">return</span> <span style=\"color: #008800; font-weight: bold\">new</span> f(s, t) }; d.abort <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">function</span> () { <span style=\"color: #008800; font-weight: bold\">var</span> s <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">this</span>; s.readyState <span style=\"color: #333333\">=</span> s.DONE; s.savedAs <span style=\"color: #333333\">=</span> s.FAILED; q(s, <span style=\"background-color: #fff0f0\">&quot;abort&quot;</span>) }; d.readyState <span style=\"color: #333333\">=</span> d.INIT <span style=\"color: #333333\">=</span> <span style=\"color: #0000DD; font-weight: bold\">0</span>; d.WRITING <span style=\"color: #333333\">=</span> <span style=\"color: #0000DD; font-weight: bold\">1</span>; d.DONE <span style=\"color: #333333\">=</span> <span style=\"color: #0000DD; font-weight: bold\">2</span>; d.FAILED <span style=\"color: #333333\">=</span> <span style=\"color: #333333\">-</span><span style=\"color: #0000DD; font-weight: bold\">1</span>; d.SAVEDASBLOB <span style=\"color: #333333\">=</span> <span style=\"color: #0000DD; font-weight: bold\">1</span>; d.SAVEDASURI <span style=\"color: #333333\">=</span> <span style=\"color: #0000DD; font-weight: bold\">2</span>; d.SAVEDASUNKNOWN <span style=\"color: #333333\">=</span> <span style=\"color: #0000DD; font-weight: bold\">3</span>; d.error <span style=\"color: #333333\">=</span> d.onwritestart <span style=\"color: #333333\">=</span> d.onprogress <span style=\"color: #333333\">=</span> d.onwrite <span style=\"color: #333333\">=</span> d.onabort <span style=\"color: #333333\">=</span> d.onerror <span style=\"color: #333333\">=</span> d.onwriteend <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">null</span>; h.addEventListener(<span style=\"background-color: #fff0f0\">&quot;unload&quot;</span>, i, <span style=\"color: #008800; font-weight: bold\">false</span>); a.unload <span style=\"color: #333333\">=</span> <span style=\"color: #008800; font-weight: bold\">function</span> () { i(); h.removeEventListener(<span style=\"background-color: #fff0f0\">&quot;unload&quot;</span>, i, <span style=\"color: #008800; font-weight: bold\">false</span>) }; <span style=\"color: #008800; font-weight: bold\">return</span> a }(<span style=\"color: #008800; font-weight: bold\">typeof</span> self <span style=\"color: #333333\">!==</span> <span style=\"background-color: #fff0f0\">&quot;undefined&quot;</span> <span style=\"color: #333333\">&amp;&amp;</span> self <span style=\"color: #333333\">||</span> <span style=\"color: #008800; font-weight: bold\">typeof</span> <span style=\"color: #007020\">window</span> <span style=\"color: #333333\">!==</span> <span style=\"background-color: #fff0f0\">&quot;undefined&quot;</span> <span style=\"color: #333333\">&amp;&amp;</span> <span style=\"color: #007020\">window</span> <span style=\"color: #333333\">||</span> <span style=\"color: #008800; font-weight: bold\">this</span>.content));\r\n        saveAs(<span style=\"color: #008800; font-weight: bold\">new</span> Blob([s2ab(wbout)], { type<span style=\"color: #333333\">:</span> <span style=\"background-color: #fff0f0\">&quot;application/octet-stream&quot;</span> }), <span style=\"background-color: #fff0f0\">&#39;sheetjs.xlsx&#39;</span>);\r\n</pre></td></tr></table></div>\r\n"}}