You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
171 lines
111 KiB
Plaintext
171 lines
111 KiB
Plaintext
11 months ago
|
/**
|
||
|
* jsPDF - PDF Document creation from JavaScript
|
||
|
* Version 1.0.198-git Built on 2014-07-17T20:58
|
||
|
* CommitID 8fb976ef54
|
||
|
*
|
||
|
* Copyright (c) 2010-2014 James Hall, https://github.com/MrRio/jsPDF
|
||
|
* 2010 Aaron Spike, https://github.com/acspike
|
||
|
* 2012 Willow Systems Corporation, willow-systems.com
|
||
|
* 2012 Pablo Hess, https://github.com/pablohess
|
||
|
* 2012 Florian Jenett, https://github.com/fjenett
|
||
|
* 2013 Warren Weckesser, https://github.com/warrenweckesser
|
||
|
* 2013 Youssef Beddad, https://github.com/lifof
|
||
|
* 2013 Lee Driscoll, https://github.com/lsdriscoll
|
||
|
* 2013 Stefan Slonevskiy, https://github.com/stefslon
|
||
|
* 2013 Jeremy Morel, https://github.com/jmorel
|
||
|
* 2013 Christoph Hartmann, https://github.com/chris-rock
|
||
|
* 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
|
||
|
* 2014 James Makes, https://github.com/dollaruw
|
||
|
* 2014 Diego Casorran, https://github.com/diegocr
|
||
|
*
|
||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||
|
* a copy of this software and associated documentation files (the
|
||
|
* "Software"), to deal in the Software without restriction, including
|
||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||
|
* the following conditions:
|
||
|
*
|
||
|
* The above copyright notice and this permission notice shall be
|
||
|
* included in all copies or substantial portions of the Software.
|
||
|
*
|
||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||
|
*
|
||
|
* Contributor(s):
|
||
|
* siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango,
|
||
|
* kim3er, mfo, alnorth,
|
||
|
*/
|
||
|
/**
|
||
|
* jsPDF addHTML PlugIn
|
||
|
* Copyright (c) 2014 Diego Casorran
|
||
|
* Licensed under the MIT License.
|
||
|
* http://opensource.org/licenses/mit-license
|
||
|
*/
|
||
|
/**
|
||
|
* jsPDF addImage plugin
|
||
|
* Copyright (c) 2012 Jason Siefken, https://github.com/siefkenj/
|
||
|
* 2013 Chris Dowling, https://github.com/gingerchris
|
||
|
* 2013 Trinh Ho, https://github.com/ineedfat
|
||
|
* 2013 Edwin Alejandro Perez, https://github.com/eaparango
|
||
|
* 2013 Norah Smith, https://github.com/burnburnrocket
|
||
|
* 2014 Diego Casorran, https://github.com/diegocr
|
||
|
* 2014 James Robb, https://github.com/jamesbrobb
|
||
|
*/
|
||
|
/**
|
||
|
* jsPDF Cell plugin
|
||
|
* Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com
|
||
|
* 2013 Eduardo Menezes de Morais, eduardo.morais@usp.br
|
||
|
* 2013 Lee Driscoll, https://github.com/lsdriscoll
|
||
|
* 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
|
||
|
* 2014 James Hall, james@parall.ax
|
||
|
* 2014 Diego Casorran, https://github.com/diegocr
|
||
|
*/
|
||
|
/**
|
||
|
* jsPDF fromHTML plugin. BETA stage. API subject to change. Needs browser
|
||
|
* Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
|
||
|
* 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
|
||
|
* 2014 Diego Casorran, https://github.com/diegocr
|
||
|
* 2014 Daniel Husar, https://github.com/danielhusar
|
||
|
* 2014 Wolfgang Gassler, https://github.com/woolfg
|
||
|
*/
|
||
|
/**
|
||
|
* jsPDF JavaScript plugin
|
||
|
* Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com
|
||
|
*/
|
||
|
/**
|
||
|
* jsPDF PNG PlugIn
|
||
|
* Copyright (c) 2014 James Robb, https://github.com/jamesbrobb
|
||
|
*/
|
||
|
/**
|
||
|
jsPDF Silly SVG plugin
|
||
|
Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
|
||
|
*/
|
||
|
/**
|
||
|
* jsPDF split_text_to_size plugin - MIT license.
|
||
|
* Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
|
||
|
* 2014 Diego Casorran, https://github.com/diegocr
|
||
|
*/
|
||
|
/**
|
||
|
jsPDF standard_fonts_metrics plugin
|
||
|
Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
|
||
|
MIT license.
|
||
|
*/
|
||
|
/**
|
||
|
* jsPDF total_pages plugin
|
||
|
* Copyright (c) 2013 Eduardo Menezes de Morais, eduardo.morais@usp.br
|
||
|
*/
|
||
|
/* Blob.js
|
||
|
* A Blob implementation.
|
||
|
* 2014-07-01
|
||
|
* By Eli Grey, http://eligrey.com
|
||
|
* By Devin Samarin, https://github.com/eboyjr
|
||
|
* License: X11/MIT
|
||
|
* See https://github.com/eligrey/Blob.js/blob/master/LICENSE.md
|
||
|
*/
|
||
|
/* FileSaver.js
|
||
|
* A saveAs() FileSaver implementation.
|
||
|
* 2014-05-27
|
||
|
* By Eli Grey, http://eligrey.com
|
||
|
* License: X11/MIT
|
||
|
* See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md
|
||
|
*/
|
||
|
/*
|
||
|
* Copyright (c) 2012 chick307 <chick307@gmail.com>
|
||
|
* Licensed under the MIT License.
|
||
|
* http://opensource.org/licenses/mit-license
|
||
|
*/
|
||
|
/*
|
||
|
Deflate.js - https://github.com/gildas-lormeau/zip.js
|
||
|
Copyright (c) 2013 Gildas Lormeau. All rights reserved.
|
||
|
Redistribution and use in source and binary forms, with or without
|
||
|
modification, are permitted provided that the following conditions are met:
|
||
|
1. Redistributions of source code must retain the above copyright notice,
|
||
|
this list of conditions and the following disclaimer.
|
||
|
2. Redistributions in binary form must reproduce the above copyright
|
||
|
notice, this list of conditions and the following disclaimer in
|
||
|
the documentation and/or other materials provided with the distribution.
|
||
|
3. The names of the authors may not be used to endorse or promote products
|
||
|
derived from this software without specific prior written permission.
|
||
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
|
||
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||
|
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
|
||
|
INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||
|
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||
|
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||
|
*/
|
||
|
/*
|
||
|
# PNG.js
|
||
|
# Copyright (c) 2011 Devon Govett
|
||
|
# MIT LICENSE
|
||
|
#
|
||
|
*/
|
||
|
/*
|
||
|
* Extracted from pdf.js
|
||
|
* https://github.com/andreasgal/pdf.js
|
||
|
* Copyright (c) 2011 Mozilla Foundation
|
||
|
* Contributors: Andreas Gal <gal@mozilla.com>
|
||
|
* Chris G Jones <cjones@mozilla.com>
|
||
|
* Shaon Barman <shaon.barman@gmail.com>
|
||
|
* Vivien Nicolas <21@vingtetun.org>
|
||
|
* Justin D'Arcangelo <justindarc@gmail.com>
|
||
|
* Yury Delendik
|
||
|
*/
|
||
|
/**
|
||
|
* JavaScript Polyfill functions for jsPDF
|
||
|
* Collected from public resources by
|
||
|
* https://github.com/diegocr
|
||
|
*/
|
||
|
!function(t,e){e["true"]=t;var n=function(t){"use strict";function e(e){var n={};this.subscribe=function(t,e,r){if("function"!=typeof e)return!1;n.hasOwnProperty(t)||(n[t]={});var s=Math.random().toString(35);return n[t][s]=[e,!!r],s},this.unsubscribe=function(t){for(var e in n)if(n[e][t])return delete n[e][t],!0;return!1},this.publish=function(r){if(n.hasOwnProperty(r)){var s=Array.prototype.slice.call(arguments,1),i=[];for(var o in n[r]){var a=n[r][o];try{a[0].apply(e,s)}catch(u){t.console&&console.error("jsPDF PubSub Error",u.message,u)}a[1]&&i.push(o)}i.length&&i.forEach(this.unsubscribe)}}}function n(a,u,c,l){var f={};"object"==typeof a&&(f=a,a=f.orientation,u=f.unit||u,c=f.format||c,l=f.compress||f.compressPdf||l),u=u||"mm",c=c||"a4",a=(""+(a||"P")).toLowerCase();var d,h,p,m,w,g=(""+c).toLowerCase(),y=!!l&&"function"==typeof Uint8Array,v=f.textColor||"0 g",b=f.drawColor||"0 G",q=f.fontSize||16,x=f.lineHeight||1.15,k=f.lineWidth||.200025,_=2,A=!1,C=[],S={},E={},z=0,T=[],I=[],B=0,O=0,P=0,F={title:"",subject:"",author:"",keywords:"",creator:""},D={},R=new e(D),U=function(t){return t.toFixed(2)},L=function(t){return t.toFixed(3)},N=function(t){return("0"+parseInt(t)).slice(-2)},j=function(t){A?T[z].push(t):(P+=t.length+1,I.push(t))},M=function(){return _++,C[_]=P,j(_+" 0 obj"),_},H=function(t){j("stream"),j(t),j("endstream")},G=function(){var e,r,i,o,a,u,c,l=m*h,f=w*h;for(c=t.adler32cs||n.adler32cs,y&&"undefined"==typeof c&&(y=!1),e=1;z>=e;e++){if(M(),j("<</Type /Page"),j("/Parent 1 0 R"),j("/Resources 2 0 R"),j("/Contents "+(_+1)+" 0 R>>"),j("endobj"),r=T[e].join("\n"),M(),y){for(i=[],o=r.length;o--;)i[o]=r.charCodeAt(o);u=c.from(r),a=new s(6),a.append(new Uint8Array(i)),r=a.flush(),i=new Uint8Array(r.length+6),i.set(new Uint8Array([120,156])),i.set(r,2),i.set(new Uint8Array([255&u,u>>8&255,u>>16&255,u>>24&255]),r.length+2),r=String.fromCharCode.apply(null,i),j("<</Length "+r.length+" /Filter [/FlateDecode]>>")}else j("<</Length "+r.length+">>");H(r),j("endobj")}C[1]=P,j("1 0 obj"),j("<</Type /Pages");var d="/Kids [";for(o=0;z>o;o++)d+=3+2*o+" 0 R ";j(d+"]"),j("/Count "+z),j("/MediaBox [0 0 "+U(l)+" "+U(f)+"]"),j(">>"),j("endobj")},W=function(t){t.objectNumber=M(),j("<</BaseFont/"+t.PostScriptName+"/Type/Font"),"string"==typeof t.encoding&&j("/Encoding/"+t.encoding),j("/Subtype/Type1>>"),j("endobj")},V=function(){for(var t in S)S.hasOwnProperty(t)&&W(S[t])},J=function(){R.publish("putXobjectDict")},X=function(){j("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),j("/Font <<");for(var t in S)S.hasOwnProperty(t)&&j("/"+t+" "+S[t].objectNumber+" 0 R");j(">>"),j("/XObject <<"),J(),j(">>")},Y=function(){V(),R.publish("putResources"),C[2]=P,j("2 0 obj"),j("<<"),X(),j(">>"),j("endobj"),R.publish("postPutResources")},K=function(t,e,n){E.hasOwnProperty(e)||(E[e]={}),E[e][n]=t},Q=function(t,e,n,r){var s="F"+(Object.keys(S).length+1).toString(10),i=S[s]={id:s,PostScriptName:t,fontName:e,fontStyle:n,encoding:r,metadata:{}};return K(s,e,n),R.publish("addFont",i),s},$=function(){for(var t="helvetica",e="times",n="courier",r="normal",s="bold",i="italic",o="bolditalic",a="StandardEncoding",u=[["Helvetica",t,r],["Helvetica-Bold",t,s],["Helvetica-Oblique",t,i],["Helvetica-BoldOblique",t,o],["Courier",n,r],["Courier-Bold",n,s],["Courier-Oblique",n,i],["Courier-BoldOblique",n,o],["Times-Roman",e,r],["Times-Bold",e,s],["Times-Italic",e,i],["Times-BoldItalic",e,o]],c=0,l=u.length;l>c;c++){var f=Q(u[c][0],u[c][1],u[c][2],a),d=u[c][0].split("-");K(f,d[0],d[1]||"")}R.publish("addFonts",{fonts:S,dictionary:E})},Z=function(e){return e.foo=function(){try{return e.apply(this,arguments)}catch(n){var r=n.stack||"";~r.indexOf(" at ")&&(r=r.split(" at ")[1]);var s="Error in function "+r.split("\n")[0].split("<")[0]+": "+n.message;if(!t.console)throw new Error(s);console.log(s,n),t.alert&&alert(s),console.trace()}},e.foo.bar=e,e.foo},te=function(t,e){var n,r,s,i,o,a,u,c,l;if(e=e||{},s=e.sourceEncoding||"Unicode",o=e.outputEncoding,(e.autoencode||o)&&S[d].metadata&&S[d].metadata[s]&&S[d].metadata[s].encoding&&(i=S[d].metadata[s].encoding,!o&&S[d].encod
|
||
|
}.bind(this,e.y+s.height,e.pdf.internal.getNumberOfPages())),e.settings.width-=s.width+S+E,"left"===_["float"]&&(e.x+=s.width+S+E)):e.y+=s.height+T}else if("TABLE"===s.nodeName)d=v(s,e),e.y+=10,e.pdf.table(e.x,e.y,d.rows,d.headers,{autoSize:!1,printHeaders:!0,margins:e.pdf.margins_doc}),e.y=e.pdf.lastCellPos.y+e.pdf.lastCellPos.h+20;else if("OL"===s.nodeName||"UL"===s.nodeName)q=1,p(s,e,r)||n(s,e,r),e.y+=10;else if("LI"===s.nodeName){var I=e.x;e.x+="UL"===s.parentNode.nodeName?22:10,e.y+=3,p(s,e,r)||n(s,e,r),e.x=I}else p(s,e,r)||n(s,e,r)}a++}return c?e.setBlockBoundary(h):void 0},m={},w=function(t,e,n,r){function s(){e.pdf.internal.events.publish("imagesLoaded"),r()}function i(t,e,n){if(t){var r=new Image;++u,r.crossOrigin="",r.onerror=r.onload=function(){r.complete&&(0===r.src.indexOf("data:image/")&&(r.width=e||r.width||0,r.height=n||r.height||0),r.width+r.height&&(m[t]=m[t]||r)),--u||s()},r.src=t}}for(var o=t.getElementsByTagName("img"),a=o.length,u=0;a--;)i(o[a].getAttribute("src"),o[a].width,o[a].height);return u||s()},g=function(t,e,r,s){var i=t.getElementsByTagName("footer");if(i.length>0){i=i[0];var o=e.pdf.internal.write,a=e.y;e.pdf.internal.write=function(){},n(i,e,r);var u=Math.ceil(e.y-a)+5;e.y=a,e.pdf.internal.write=o,e.pdf.margins_doc.bottom+=u;for(var c=function(t){var s=void 0!==t?t.pageNumber:1,o=e.y;e.y=e.pdf.internal.pageSize.height-e.pdf.margins_doc.bottom,e.pdf.margins_doc.bottom-=u;for(var a=i.getElementsByTagName("span"),c=0;c<a.length;++c)(" "+a[c].className+" ").replace(/[\n\t]/g," ").indexOf(" pageCounter ")>-1&&(a[c].innerHTML=s),(" "+a[c].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")>-1&&(a[c].innerHTML="###jsPDFVarTotalPages###");n(i,e,r),e.pdf.margins_doc.bottom+=u,e.y=o},l=i.getElementsByTagName("span"),f=0;f<l.length;++f)(" "+l[f].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")>-1&&e.pdf.internal.events.subscribe("htmlRenderingFinished",e.pdf.putTotalPages.bind(e.pdf,"###jsPDFVarTotalPages###"),!0);e.pdf.internal.events.subscribe("addPage",c,!1),c(),b.FOOTER=1}s()},y=function(t,e,r,s,i,o){if(!e)return!1;"string"==typeof e||e.parentNode||(e=""+e.innerHTML),"string"==typeof e&&(e=function(t){var e,n,r,s;return r="jsPDFhtmlText"+Date.now().toString()+(1e3*Math.random()).toFixed(0),s="position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;",n=document.createElement("div"),n.style.cssText=s,n.innerHTML='<iframe style="height:1px;width:1px" name="'+r+'" />',document.body.appendChild(n),e=window.frames[r],e.document.body.innerHTML=t,e.document.body}(e.replace(/<\/?script[^>]*?>/gi,"")));var a=new l(t,r,s,i);return o=o||function(){},w.call(this,e,a,i.elementHandlers,function(){g.call(this,e,a,i.elementHandlers,function(){n(e,a,i.elementHandlers),a.pdf.internal.events.publish("htmlRenderingFinished"),o(a.dispose())})}),a.dispose()},l.prototype.init=function(){return this.paragraph={text:[],style:[]},this.pdf.internal.write("q")},l.prototype.dispose=function(){return this.pdf.internal.write("Q"),{x:this.x,y:this.y}},l.prototype.executeWatchFunctions=function(t){var e=!1,n=[];if(this.watchFunctions.length>0){for(var r=0;r<this.watchFunctions.length;++r)this.watchFunctions[r](t)===!0?e=!0:n.push(this.watchFunctions[r]);this.watchFunctions=n}return e},l.prototype.splitFragmentsIntoLines=function(t,n){var r,s,i,o,a,u,c,l,f,d,h,p,m,w,g;for(s=12,h=this.pdf.internal.scaleFactor,a={},i=void 0,d=void 0,o=void 0,u=void 0,g=void 0,f=void 0,l=void 0,c=void 0,p=[],m=[p],r=0,w=this.settings.width;t.length;)if(u=t.shift(),g=n.shift(),u)if(i=g["font-family"],d=g["font-style"],o=a[i+d],o||(o=this.pdf.internal.getFont(i,d).metadata.Unicode,a[i+d]=o),f={widths:o.widths,kerning:o.kerning,fontSize:g["font-size"]*s,textIndent:r},l=this.pdf.getStringUnitWidth(u,f)*f.fontSize/h,r+l>w){for(c=this.pdf.splitTextToSize(u,w,f),p.push([c.shift(),g]);c.length;)p=[[c.shift(),g]],m.push(p);r=this.pdf.getStringUnitWidth(p[0][0],f)*
|
||
|
return this}}(n.API),function(t){"use strict";if(t.URL=t.URL||t.webkitURL,t.Blob&&t.URL)try{return new Blob,void 0}catch(e){}var n=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||function(t){var e=function(t){return Object.prototype.toString.call(t).match(/^\[object\s(.*)\]$/)[1]},n=function(){this.data=[]},r=function(t,e,n){this.data=t,this.size=t.length,this.type=e,this.encoding=n},s=n.prototype,i=r.prototype,o=t.FileReaderSync,a=function(t){this.code=this[this.name=t]},u="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),c=u.length,l=t.URL||t.webkitURL||t,f=l.createObjectURL,d=l.revokeObjectURL,h=l,p=t.btoa,m=t.atob,w=t.ArrayBuffer,g=t.Uint8Array;for(r.fake=i.fake=!0;c--;)a.prototype[u[c]]=c+1;return l.createObjectURL||(h=t.URL={}),h.createObjectURL=function(t){var e,n=t.type;return null===n&&(n="application/octet-stream"),t instanceof r?(e="data:"+n,"base64"===t.encoding?e+";base64,"+t.data:"URI"===t.encoding?e+","+decodeURIComponent(t.data):p?e+";base64,"+p(t.data):e+","+encodeURIComponent(t.data)):f?f.call(l,t):void 0},h.revokeObjectURL=function(t){"data:"!==t.substring(0,5)&&d&&d.call(l,t)},s.append=function(t){var n=this.data;if(g&&(t instanceof w||t instanceof g)){for(var s="",i=new g(t),u=0,c=i.length;c>u;u++)s+=String.fromCharCode(i[u]);n.push(s)}else if("Blob"===e(t)||"File"===e(t)){if(!o)throw new a("NOT_READABLE_ERR");var l=new o;n.push(l.readAsBinaryString(t))}else t instanceof r?"base64"===t.encoding&&m?n.push(m(t.data)):"URI"===t.encoding?n.push(decodeURIComponent(t.data)):"raw"===t.encoding&&n.push(t.data):("string"!=typeof t&&(t+=""),n.push(unescape(encodeURIComponent(t))))},s.getBlob=function(t){return arguments.length||(t=null),new r(this.data.join(""),t,"raw")},s.toString=function(){return"[object BlobBuilder]"},i.slice=function(t,e,n){var s=arguments.length;return 3>s&&(n=null),new r(this.data.slice(t,s>1?e:this.data.length),n,this.encoding)},i.toString=function(){return"[object Blob]"},i.close=function(){this.size=0,delete this.data},n}(t);t.Blob=function(t,e){var r=e?e.type||"":"",s=new n;if(t)for(var i=0,o=t.length;o>i;i++)s.append(t[i]);return s.getBlob(r)}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content||this);var r=r||"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob.bind(navigator)||function(t){"use strict";if("undefined"==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"),s=!t.externalHost&&"download"in r,i=function(n){var r=e.createEvent("MouseEvents");r.initMouseEvent("click",!0,!1,t,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(r)},o=t.webkitRequestFileSystem,a=t.requestFileSystem||o||t.mozRequestFileSystem,u=function(e){(t.setImmediate||t.setTimeout)(function(){throw e},0)},c="application/octet-stream",l=0,f=[],d=function(){for(var t=f.length;t--;){var e=f[t];"string"==typeof e?n().revokeObjectURL(e):e.remove()}f.length=0},h=function(t,e,n){e=[].concat(e);for(var r=e.length;r--;){var s=t["on"+e[r]];if("function"==typeof s)try{s.call(t,n||t)}catch(i){u(i)}}},p=function(e,u){var d,p,m,w=this,g=e.type,y=!1,v=function(){var t=n().createObjectURL(e);return f.push(t),t},b=function(){h(w,"writestart progress write writeend".split(" "))},q=function(){(y||!d)&&(d=v(e)),p?p.location.href=d:window.open(d,"_blank"),w.readyState=w.DONE,b()},x=function(t){return function(){return w.readyState!==w.DONE?t.apply(this,arguments):void 0}},k={create:!0,exclusive:!1};return w.readyState=w.INIT,u||(u="download"),s?(d=v(e),r.href=d,r.download=u,i(r),w.readyState=w.DONE,b(),void 0):(t.chrome&&g&&g!==c&&(m=e.slice||e.webkitSlice,e=m.call(e,0,e.size,c),y=!0),o&&"download"!==u&&(u+=".download"),(g===c||o)&&(p=t),a?(l+=e.size,a(t.TEMPORARY,l,x(function(t){t.root.getDirectory("saved",k,x(function(t){var n=function(){t.getFile(u,k,x(function(t){t.createWriter(x(function(n){n.onwriteend=function(e){p.location.href=t.toURL(),f.push(t)
|
||
|
return this.buffer=s},getByte:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return this.buffer[this.pos++]},getBytes:function(t){var e=this.pos;if(t){this.ensureBuffer(e+t);for(var n=e+t;!this.eof&&this.bufferLength<n;)this.readBlock();var r=this.bufferLength;n>r&&(n=r)}else{for(;!this.eof;)this.readBlock();var n=this.bufferLength}return this.pos=n,this.buffer.subarray(e,n)},lookChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(t,e,n){for(var r=t+e;this.bufferLength<=r&&!this.eof;)this.readBlock();return new Stream(this.buffer,t,e,n)},skip:function(t){t||(t=1),this.pos+=t},reset:function(){this.pos=0}},t}(),o=function(){function t(t){throw new Error(t)}function e(e){var n=0,r=e[n++],s=e[n++];(-1==r||-1==s)&&t("Invalid header in flate stream"),8!=(15&r)&&t("Unknown compression method in flate stream"),((r<<8)+s)%31!=0&&t("Bad FCHECK in flate stream"),32&s&&t("FDICT bit set in flate stream"),this.bytes=e,this.bytesPos=n,this.codeSize=0,this.codeBuf=0,i.call(this)}if("undefined"==typeof Uint32Array)return void 0;var n=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),r=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),s=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),o=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,52430
|