// Input 0 /* @licstart The JavaScript code in this page is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License (GNU AGPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The code is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. As additional permission under GNU AGPL version 3 section 7, you may distribute non-source (e.g., minimized or compacted) forms of that code without the copy of the GNU GPL normally required by section 4, provided you include this license notice and a URL through which recipients can access the Corresponding Source. As a special exception to the AGPL, any HTML file which merely makes function calls to this code, and for that purpose includes it by reference shall be deemed a separate work for copyright law purposes. In addition, the copyright holders of this code give you permission to combine this code with free software libraries that are released under the GNU LGPL. You may copy and distribute such a system following the terms of the GNU AGPL for this code and the LGPL for the libraries. If you modify this code, you may extend this exception to your version of the code, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. This license applies to this entire compilation. @licend @source: http://www.webodf.org/ @source: http://gitorious.org/odfkit/webodf/ */ var core={},gui={},xmldom={},odf={}; // Input 1 function Runtime(){}Runtime.ByteArray=function(){};Runtime.ByteArray.prototype.slice=function(){};Runtime.prototype.byteArrayFromArray=function(){};Runtime.prototype.byteArrayFromString=function(){};Runtime.prototype.byteArrayToString=function(){};Runtime.prototype.concatByteArrays=function(){};Runtime.prototype.read=function(){};Runtime.prototype.readFile=function(){};Runtime.prototype.readFileSync=function(){};Runtime.prototype.loadXML=function(){};Runtime.prototype.writeFile=function(){}; Runtime.prototype.isFile=function(){};Runtime.prototype.getFileSize=function(){};Runtime.prototype.deleteFile=function(){};Runtime.prototype.log=function(){};Runtime.prototype.setTimeout=function(){};Runtime.prototype.libraryPaths=function(){};Runtime.prototype.type=function(){};Runtime.prototype.getDOMImplementation=function(){};Runtime.prototype.getWindow=function(){};var IS_COMPILED_CODE=!0; Runtime.byteArrayToString=function(j,l){function f(c){var b="",d,a=c.length;for(d=0;de?b+=String.fromCharCode(e):(d+=1,i=c[d],224>e?b+=String.fromCharCode((e&31)<<6|i&63):(d+=1,h=c[d],b+=String.fromCharCode((e&15)<<12|(i&63)<<6|h&63)));return b}var a;"utf8"===l?a=g(j):("binary"!==l&&this.log("Unsupported encoding: "+l),a=f(j));return a}; Runtime.getFunctionName=function(j){return void 0===j.name?(j=/function\s+(\w+)/.exec(j))&&j[1]:j.name}; function BrowserRuntime(j){function l(c,b){var d,a,e;b?e=c:b=c;j?(a=j.ownerDocument,e&&(d=a.createElement("span"),d.className=e,d.appendChild(a.createTextNode(e)),j.appendChild(d),j.appendChild(a.createTextNode(" "))),d=a.createElement("span"),d.appendChild(a.createTextNode(b)),j.appendChild(d),j.appendChild(a.createElement("br"))):console&&console.log(b)}var f=this,g={},a=window.ArrayBuffer&&window.Uint8Array;this.ByteArray=a?function(c){Uint8Array.prototype.slice=function(b,c){void 0===c&&(void 0=== b&&(b=0),c=this.length);var a=this.subarray(b,c),e,i,c=c-b;e=new Uint8Array(new ArrayBuffer(c));for(i=0;ii?(a[h]=i,h+=1):2048>i?(a[h]=192|i>>>6,a[h+1]=128|i&63,h+=2):(a[h]=224|i>>>12&15,a[h+1]=128|i>>>6&63,a[h+2]=128|i&63,h+=3)}else{"binary"!==b&&f.log("unknown encoding: "+b);d=c.length;a=new f.ByteArray(d);for(e=0;ek.status||0===k.status?a(null):a("Status "+k.status+": "+k.responseText||k.statusText))};b=b.buffer&&!k.sendAsBinary?b.buffer:f.byteArrayToString(b,"binary");try{k.sendAsBinary?k.sendAsBinary(b):k.send(b)}catch(e){f.log("HUH? "+e+" "+b),a(e.message)}};this.deleteFile=function(a,b){var d=new XMLHttpRequest;d.open("DELETE",a,!0);d.onreadystatechange=function(){4===d.readyState&&(200>d.status&&300<= d.status?b(d.responseText):b(null))};d.send(null)};this.loadXML=function(a,b){var d=new XMLHttpRequest;d.open("GET",a,!0);d.overrideMimeType&&d.overrideMimeType("text/xml");d.onreadystatechange=function(){4===d.readyState&&(0===d.status&&!d.responseText?b("File "+a+" is empty."):200===d.status||0===d.status?b(null,d.responseXML):b(d.responseText))};try{d.send(null)}catch(k){b(k.message)}};this.isFile=function(a,b){f.getFileSize(a,function(a){b(-1!==a)})};this.getFileSize=function(a,b){var d=new XMLHttpRequest; d.open("HEAD",a,!0);d.onreadystatechange=function(){if(4===d.readyState){var a=d.getResponseHeader("Content-Length");a?b(parseInt(a,10)):b(-1)}};d.send(null)};this.log=l;this.setTimeout=function(a,b){setTimeout(function(){a()},b)};this.libraryPaths=function(){return["lib"]};this.setCurrentDirectory=function(){};this.type=function(){return"BrowserRuntime"};this.getDOMImplementation=function(){return window.document.implementation};this.exit=function(a){l("Calling exit with code "+a+", but exit() is not implemented.")}; this.getWindow=function(){return window}} function NodeJSRuntime(){var j=require("fs"),l="";this.ByteArray=function(f){return new Buffer(f)};this.byteArrayFromArray=function(f){var g=new Buffer(f.length),a,c=f.length;for(a=0;a>>18],c+=u[b>>>12&63],c+=u[b>>>6&63],c+=u[b&63];e===d+1?(b=a[e]<<4,c+=u[b>>>6],c+=u[b&63],c+="=="):e===d&&(b=a[e]<<10|a[e+1]<<2,c+=u[b>>>12],c+=u[b>>>6&63],c+=u[b&63],c+="=");return c}function f(a){var a=a.replace(/[^A-Za-z0-9+\/]+/g,""),b=[],c=a.length%4,e,d=a.length,i;for(e=0;e>16,i>>8&255,i&255);b.length-=[0,0,2,1][c];return b}function g(a){var b=[],c,e=a.length,d;for(c=0;cd?b.push(d):2048>d?b.push(192|d>>>6,128|d&63):b.push(224|d>>>12&15,128|d>>>6&63,128|d&63);return b}function a(a){var b=[],c,e=a.length,d,i,m;for(c=0;cd?b.push(d):(c+=1,i=a[c],224>d?b.push((d&31)<<6|i&63):(c+=1,m=a[c],b.push((d&15)<<12|(i&63)<<6|m&63)));return b}function c(a){return l(j(a))} function b(a){return String.fromCharCode.apply(String,f(a))}function d(b){return a(j(b))}function k(b){for(var b=a(b),c="",e=0;eb?e+=String.fromCharCode(b):(m+=1,d=a.charCodeAt(m)&255,224>b?e+=String.fromCharCode((b&31)<<6|d&63):(m+=1,i=a.charCodeAt(m)&255,e+=String.fromCharCode((b&15)<<12|(d&63)<<6|i&63)));return e}function i(a,b){function c(){var m= n+d;m>a.length&&(m=a.length);i+=e(a,n,m);n=m;m=n===a.length;b(i,m)&&!m&&runtime.setTimeout(c,0)}var d=1E5,i="",n=0;a.lengthb;b+=1)a.push(65+b);for(b=0;26>b;b+=1)a.push(97+b);for(b= 0;10>b;b+=1)a.push(48+b);a.push(43);a.push(47);return a})();var s=function(a){var b={},c,e;c=0;for(e=a.length;c>>8):(la(b&255),la(b>>>8))},na=function(){q=(q<<5^o[m+3-1]&255)&8191;x=p[32768+q];p[m&32767]=x;p[32768+q]=m},Q=function(a,b){B>16-b?(w|=a<>16-B,B+=b-16):(w|=a<a;a++)o[a]=o[a+32768];t-=32768;m-=32768;A-=32768;for(a=0;8192>a;a++)b=p[32768+a],p[32768+a]=32768<=b?b-32768:0;for(a=0;32768>a;a++)b=p[a],p[a]=32768<=b?b-32768:0;c+=32768}r||(a=xa(o,m+y,c),0>=a?r=!0:y+=a)},ya=function(a){var b=L,c=m,e,d=F,i=32506=N&&(b>>=2);do if(e=a,!(o[e+d]!==h||o[e+d-1]!==n||o[e]!==o[c]||o[++e]!==o[c+1])){c+=2;e++;do++c; while(o[c]===o[++e]&&o[++c]===o[++e]&&o[++c]===o[++e]&&o[++c]===o[++e]&&o[++c]===o[++e]&&o[++c]===o[++e]&&o[++c]===o[++e]&&o[++c]===o[++e]&&cd){t=a;d=e;if(258<=e)break;n=o[c+d-1];h=o[c+d]}}while((a=p[a&32767])>i&&0!==--b);return d},ga=function(a,b){s[P++]=b;0===a?v[b].fc++:(a--,v[$[b]+256+1].fc++,J[(256>a?Y[a]:Y[256+(a>>7)])&255].fc++,u[ia++]=a,aa|=ea);ea<<=1;0===(P&7)&&(da[pa++]=aa,aa=0,ea=1);if(2d;d++)c+=J[d].fc*(5+fa[d]); c>>=3;if(ia>=1,c<<=1;while(0<--b);return c>>1},Aa=function(a,b){var c=[];c.length=16;var e=0,d;for(d=1;15>=d;d++)e=e+M[d-1]<<1,c[d]=e;for(e=0;e<=b;e++)d=a[e].dl,0!==d&&(a[e].fc=za(c[d]++,d))},ua=function(a){var b=a.dyn_tree,c=a.static_tree,e=a.elems,d,m=-1,i=e;V=0; Z=573;for(d=0;dV;)d=I[++V]=2>m?++m:0,b[d].fc=1,S[d]=0,W--,null!==c&&(ba-=c[d].dl);a.max_code=m;for(d=V>>1;1<=d;d--)ta(b,d);do d=I[1],I[1]=I[V--],ta(b,1),c=I[1],I[--Z]=d,I[--Z]=c,b[i].fc=b[d].fc+b[c].fc,S[i]=S[d]>S[c]+1?S[d]:S[c]+1,b[d].dl=b[c].dl=i,I[1]=i++,ta(b,1);while(2<=V);I[--Z]=I[1];i=a.dyn_tree;d=a.extra_bits;var e=a.extra_base,c=a.max_code,r=a.max_length,n=a.static_tree,t,h,f,k,q=0;for(h=0;15>=h;h++)M[h]=0;i[I[Z]].dl=0;for(a=Z+1;573> a;a++)if(t=I[a],h=i[i[t].dl].dl+1,h>r&&(h=r,q++),i[t].dl=h,!(t>c))M[h]++,f=0,t>=e&&(f=d[t-e]),k=i[t].fc,W+=k*(h+f),null!==n&&(ba+=k*(n[t].dl+f));if(0!==q){do{for(h=r-1;0===M[h];)h--;M[h]--;M[h+1]+=2;M[r]--;q-=2}while(0c||(i[d].dl!==h&&(W+=(h-i[d].dl)*i[d].fc,i[d].fc=h),t--)}Aa(b,m)},Ba=function(a,b){var c,e=-1,d,m=a[0].dl,i=0,h=7,r=4;0===m&&(h=138,r=3);a[b+1].dl=65535;for(c=0;c<=b;c++)if(d=m,m=a[c+1].dl,!(++i=i?K[17].fc++:K[18].fc++,i=0,e=d,0===m)?(h=138,r=3):d===m?(h=6,r=3):(h=7,r=4)},Ca=function(){8c?Y[c]:Y[256+(c>>7)])&255,X(h,b),r=fa[h],0!==r)c-=ca[h],Q(c,r);i>>=1}while(e=i?(X(17,K),Q(i-3,3)):(X(18,K),Q(i-11,7));i=0;e=d;0===m?(h=138,r=3):d===m?(h=6,r=3):(h=7,r=4)}},Fa=function(){var a;for(a=0;286>a;a++)v[a].fc=0;for(a=0;30>a;a++)J[a].fc=0;for(a=0;19>a;a++)K[a].fc=0;v[256].fc=1;aa=P=ia=pa=W=ba=0;ea=1},oa=function(a){var b,c,e,d;d=m-A;da[pa]=aa;ua(H);ua(D);Ba(v,H.max_code);Ba(J,D.max_code);ua(U);for(e=18;3<=e&&0===K[va[e]].dl;e--);W+= 3*(e+1)+14;b=W+3+7>>3;c=ba+3+7>>3;c<=b&&(b=c);if(d+4<=b&&0<=A){Q(0+a,3);Ca();ma(d);ma(~d);for(e=0;eb.len&&(t=b.len);for(n=0;ni-h&&(t=i-h);for(n=0;ng;g++){ha[g]=f;for(d= 0;d<1<g;g++){ca[g]=f;for(d=0;d<1<>=7;30>g;g++){ca[g]=f<<7;for(d=0;d<1<=d;d++)M[d]=0;for(d=0;143>=d;)G[d++].dl=8,M[8]++;for(;255>=d;)G[d++].dl=9,M[9]++;for(;279>=d;)G[d++].dl=7,M[7]++;for(;287>=d;)G[d++].dl=8,M[8]++;Aa(G,287);for(d=0;30>d;d++)R[d].dl=5,R[d].fc=za(d,5);Fa()}for(d=0;8192>d;d++)p[32768+d]=0;T=ka[O].max_lazy;N=ka[O].good_length;L=ka[O].max_chain;A=m=0;y=xa(o,0,65536);if(0>=y)r=!0,y= 0;else{for(r=!1;262>y&&!r;)sa();for(d=q=0;2>d;d++)q=(q<<5^o[d]&255)&8191}b=null;h=i=0;3>=O?(F=2,z=0):(z=2,C=0);n=!1}k=!0;if(0===y)return n=!0,0}if((d=Ga(a,c,e))===e)return e;if(n)return d;if(3>=O)for(;0!==y&&null===b;){na();0!==x&&32506>=m-x&&(z=ya(x),z>y&&(z=y));if(3<=z)if(g=ga(m-t,z-3),y-=z,z<=T){z--;do m++,na();while(0!==--z);m++}else m+=z,z=0,q=o[m]&255,q=(q<<5^o[m+1]&255)&8191;else g=ga(0,o[m]&255),y--,m++;g&&(oa(0),A=m);for(;262>y&&!r;)sa()}else for(;0!==y&&null===b;){na();F=z;E=t;z=2;0!==x&& F=m-x&&(z=ya(x),z>y&&(z=y),3===z&&4096y&&!r;)sa()}0===y&&(0!==C&&ga(0,o[m-1]&255),oa(1),n=!0);return d+Ga(a,d+c,e-d)};this.deflate=function(m,i){var h,t;ja=m;qa=0;"undefined"===typeof i&&(i=6);(h=i)?1>h?h=1:9h;h++)v[h]=new j;J=[];J.length=61;for(h=0;61>h;h++)J[h]=new j;G=[];G.length=288;for(h=0;288>h;h++)G[h]=new j;R=[];R.length=30;for(h=0;30>h;h++)R[h]=new j;K=[];K.length=39;for(h=0;39>h;h++)K[h]=new j;H=new l;D=new l;U=new l;M=[];M.length=16;I=[];I.length=573;S=[];S.length=573;$=[];$.length=256;Y=[];Y.length=512;ha=[];ha.length=29;ca=[];ca.length=30;da=[];da.length=1024}for(var n=Array(1024),f=[];0<(h=Ia(n,0,n.length));){var g=[];g.length=h;for(t= 0;t>8&255])};this.appendUInt32LE=function(f){l.appendArray([f&255,f>>8&255,f>>16&255,f>>24&255])};this.appendString=function(g){f=runtime.concatByteArrays(f, runtime.byteArrayFromString(g,j))};this.getLength=function(){return f.length};this.getByteArray=function(){return f}}; // Input 6 core.RawInflate=function(){var j,l,f=null,g,a,c,b,d,k,e,i,h,n,o,u,s,p,w=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],B=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],A=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,99,99],q=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],x=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],E=[16,17,18, 0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],C=function(){this.list=this.next=null},z=function(){this.n=this.b=this.e=0;this.t=null},F=function(a,b,c,d,e,m){this.BMAX=16;this.N_MAX=288;this.status=0;this.root=null;this.m=0;var h=Array(this.BMAX+1),i,r,t,n,f,k,g,q=Array(this.BMAX+1),o,j,p,y=new z,x=Array(this.BMAX);n=Array(this.N_MAX);var E,s=Array(this.BMAX+1),B,A,u;u=this.root=null;for(f=0;ff&&(m=f);for(B=1<(B-=h[k])){this.status=2;this.m=m;return}if(0>(B-=h[f]))this.status=2,this.m=m;else{h[f]+=B;s[1]=k=0;o=h;j=1;for(p=2;0<--f;)s[p++]=k+=o[j++];o=a;f=j=0;do if(0!=(k=o[j++]))n[s[k]++]=f;while(++fE+q[1+n];){E+=q[1+n];n++;A=(A=t-E)>m?m:A;if((r=1<<(k=g-E))>a+1){r-=a+1;for(p=g;++ki&&E>E-q[n],x[n-1][k].e=y.e,x[n-1][k].b=y.b,x[n-1][k].n=y.n,x[n-1][k].t=y.t)}y.b=g-E;j>=b?y.e=99:o[j]o[j]?16:15,y.n=o[j++]): (y.e=e[o[j]-c],y.n=d[o[j++]-c]);r=1<>E;k>=1)f^=k;for(f^=k;(f&(1<>=a;b-=a},y=function(a,b,c){var f,k,g;if(0==c)return 0;for(g=0;;){m(o);k=h.list[t(o)];for(f=k.e;16e;e++)p[E[e]]= 0;o=7;e=new F(p,19,19,null,null,o);if(0!=e.status)return-1;h=e.root;o=e.m;i=g+j;for(d=f=0;de)p[d++]=f=e;else if(16==e){m(2);e=3+t(2);r(2);if(d+e>i)return-1;for(;0i)return-1;for(;0D;D++)H[D]=8;for(;256>D;D++)H[D]=9;for(;280>D;D++)H[D]=7;for(;288>D;D++)H[D]=8;a=7;D=new F(H,288,257,B,A,a);if(0!=D.status){alert("HufBuild error: "+D.status);G=-1;break b}f=D.root;a=D.m;for(D=0;30>D;D++)H[D]=5;L=5;D=new F(H,30,0,q,x,L);if(1e&&k.setStart(i,k.startOffset-1);k.endContainer===a?k.setEnd(i,e):k.endContainer===i&&k.endOffset>e&&k.setEnd(i,k.endOffset-1)}if(d){for(c=0;c1/f?"-0":""+f)+"."):j(c+" should be "+a+" (of type "+typeof a+"). Was "+f+" (of type "+typeof f+").")}var g=0;this.shouldBeNull=function(a,c){f(a,c,"null")};this.shouldBeNonNull=function(a,c){var b,d;try{d=eval(c)}catch(f){b=f}b?j(c+" should be non-null. Threw exception "+b):null!==d?runtime.log("pass",c+" is non-null."):j(c+" should be non-null. Was "+ d)};this.shouldBe=f;this.countFailedTests=function(){return g}}; core.UnitTester=function(){var j=0,l={};this.runTests=function(f,g){function a(b){if(0===b.length)l[c]=e,j+=d.countFailedTests(),g();else{h=b[0];var f=Runtime.getFunctionName(h);runtime.log("Running "+f);o=d.countFailedTests();k.setUp();h(function(){k.tearDown();e[f]=o===d.countFailedTests();a(b.slice(1))})}}var c=Runtime.getFunctionName(f),b,d=new core.UnitTestRunner,k=new f(d),e={},i,h,n,o;if(c.hasOwnProperty(l))runtime.log("Test "+c+" has already run.");else{runtime.log("Running "+c+": "+k.description()); n=k.tests();for(i=0;i>>8^f;return c^-1}function g(a){return new Date((a>>25&127)+1980,(a>>21&15)-1,a>>16&31,a>>11&15,a>>5&63,(a&31)<<1)}function a(a){var b=a.getFullYear();return 1980>b?0:b-1980<< 25|a.getMonth()+1<<21|a.getDate()<<16|a.getHours()<<11|a.getMinutes()<<5|a.getSeconds()>>1}function c(a,b){var c,e,d,f,h,i,m,n=this;this.load=function(b){if(void 0!==n.data)b(null,n.data);else{var d=h+34+c+e+256;d+m>o&&(d=o-m);runtime.read(a,m,d,function(c,e){if(c)b(c,e);else a:{var d=e,m=new core.ByteArray(d),k=m.readUInt32LE(),g;if(67324752!==k)b("File entry signature is wrong."+k.toString()+" "+d.length.toString(),null);else{m.pos+=22;k=m.readUInt16LE();g=m.readUInt16LE();m.pos+=k+g;if(f){d=d.slice(m.pos, m.pos+h);if(h!==d.length){b("The amount of compressed bytes read was "+d.length.toString()+" instead of "+h.toString()+" for "+n.filename+" in "+a+".",null);break a}d=s(d,i)}else d=d.slice(m.pos,m.pos+i);i!==d.length?b("The amount of bytes read was "+d.length.toString()+" instead of "+i.toString()+" for "+n.filename+" in "+a+".",null):(n.data=d,b(null,d))}}})}};this.set=function(a,b,c,e){n.filename=a;n.data=b;n.compressed=c;n.date=e};this.error=null;b&&(33639248!==b.readUInt32LE()?this.error="Central directory entry has wrong signature at position "+ (b.pos-4).toString()+' for file "'+a+'": '+b.data.length.toString():(b.pos+=6,f=b.readUInt16LE(),this.date=g(b.readUInt32LE()),b.readUInt32LE(),h=b.readUInt32LE(),i=b.readUInt32LE(),c=b.readUInt16LE(),e=b.readUInt16LE(),d=b.readUInt16LE(),b.pos+=8,m=b.readUInt32LE(),this.filename=runtime.byteArrayToString(b.data.slice(b.pos,b.pos+c),"utf8"),b.pos+=c+e+d))}function b(a,b){if(22!==a.length)b("Central directory length should be 22.",p);else{var e=new core.ByteArray(a),d;d=e.readUInt32LE();101010256!== d?b("Central directory signature is wrong: "+d.toString(),p):0!==e.readUInt16LE()?b("Zip files with non-zero disk numbers are not supported.",p):0!==e.readUInt16LE()?b("Zip files with non-zero disk numbers are not supported.",p):(d=e.readUInt16LE(),u=e.readUInt16LE(),d!==u?b("Number of entries is inconsistent.",p):(d=e.readUInt32LE(),e=e.readUInt16LE(),e=o-22-d,runtime.read(j,e,o-e,function(a,e){a:{var d=new core.ByteArray(e),f,m;n=[];for(f=0;fo?l("File '"+ j+"' cannot be read.",p):runtime.read(j,o-22,22,function(a,c){a||null===l?l(a,p):b(c,l)})})}; // Input 12 xmldom.LSSerializerFilter=function(){}; // Input 13 "function"!==typeof Object.create&&(Object.create=function(j){var l=function(){};l.prototype=j;return new l}); xmldom.LSSerializer=function(){function j(f,g){var a="",c=Object.create(f),b=l.filter?l.filter.acceptNode(g):1,d;if(1===b){d="";var k=g.attributes,e,i,h,n="",o;if(k){c[g.namespaceURI]!==g.prefix&&(c[g.namespaceURI]=g.prefix);d+="<"+g.nodeName;e=k.length;for(i=0;i"}a+=d}if(1===b||3===b){for(d=g.firstChild;d;)a+=j(c,d),d=d.nextSibling;g.nodeValue&&(a+=g.nodeValue)}1===b&&(c="",1===g.nodeType&&(c+=""),a+=c);return a}var l=this;this.filter=null;this.writeToString=function(f,g){if(!f)return"";var a;if(g){a=g;var c={},b;for(b in a)a.hasOwnProperty(b)&&(c[a[b]]=b);a=c}else a={};return j(a, f)}}; // Input 14 xmldom.RelaxNGParser=function(){function j(a,b){this.message=function(){b&&(a+=1===b.nodeType?" Element ":" Node ",a+=b.nodeName,b.nodeValue&&(a+=" with value '"+b.nodeValue+"'"),a+=".");return a}}function l(a){if(2>=a.e.length)return a;var b={name:a.name,e:a.e.slice(0,2)};return l({name:a.name,e:[b].concat(a.e.slice(2))})}function f(a){var a=a.split(":",2),b="",c;1===a.length?a=["",a[0]]:b=a[0];for(c in d)d[c]===b&&(a[0]=c);return a}function g(a,b){for(var c=0,d,k,j=a.name;a.e&&c=c.length)return b;0===f&&(f=0);for(var h=c.item(f);h.namespaceURI===e;){f+=1;if(f>=c.length)return b;h=c.item(f)}return h=d(a,b.attDeriv(a,c.item(f)),c,f+1)}function k(a,b,c){c.e[0].a?(a.push(c.e[0].text),b.push(c.e[0].a.ns)):k(a,b,c.e[0]);c.e[1].a?(a.push(c.e[1].text),b.push(c.e[1].a.ns)): k(a,b,c.e[1])}var e="http://www.w3.org/2000/xmlns/",i,h,n,o,u,s,p,w,B,A,q={type:"notAllowed",nullable:!1,hash:"notAllowed",textDeriv:function(){return q},startTagOpenDeriv:function(){return q},attDeriv:function(){return q},startTagCloseDeriv:function(){return q},endTagDeriv:function(){return q}},x={type:"empty",nullable:!0,hash:"empty",textDeriv:function(){return q},startTagOpenDeriv:function(){return q},attDeriv:function(){return q},startTagCloseDeriv:function(){return x},endTagDeriv:function(){return q}}, E={type:"text",nullable:!0,hash:"text",textDeriv:function(){return E},startTagOpenDeriv:function(){return q},attDeriv:function(){return q},startTagCloseDeriv:function(){return E},endTagDeriv:function(){return q}},C,z,F;i=g("choice",function(a,b){if(a===q)return b;if(b===q||a===b)return a},function(b,c){var d={},e;a(d,{p1:b,p2:c});c=b=void 0;for(e in d)d.hasOwnProperty(e)&&(void 0===b?b=d[e]:c=void 0===c?d[e]:i(c,d[e]));return function(a,b){return{type:"choice",p1:a,p2:b,nullable:a.nullable||b.nullable, textDeriv:function(c,d){return i(a.textDeriv(c,d),b.textDeriv(c,d))},startTagOpenDeriv:f(function(c){return i(a.startTagOpenDeriv(c),b.startTagOpenDeriv(c))}),attDeriv:function(c,d){return i(a.attDeriv(c,d),b.attDeriv(c,d))},startTagCloseDeriv:j(function(){return i(a.startTagCloseDeriv(),b.startTagCloseDeriv())}),endTagDeriv:j(function(){return i(a.endTagDeriv(),b.endTagDeriv())})}}(b,c)});h=function(a,b,c){return function(){var d={},e=0;return function(f,h){var i=b&&b(f,h),k,g;if(void 0!==i)return i; i=f.hash||f.toString();k=h.hash||h.toString();i=f&&b.push(l(a.substring(c,d)))):"["===a[d]&&(0>=f&&(c=d+1),f+=1),d+=1;return d};f.prototype.next=function(){};f.prototype.reset=function(){};i=function(b,e,f){var g,h,i,j;for(g= 0;g text|list-item > text|list",c-=1;try{a.insertRule(b+ " > list-item:before{"+d+"}",a.cssRules.length)}catch(e){throw e;}}function e(a,f,g,j){if("list"===f)for(var l=j.firstChild,m,t;l;){if(l.namespaceURI===n)if(m=l,"list-level-style-number"===l.localName){t=m;var r=t.getAttributeNS(h,"num-format"),o=t.getAttributeNS(h,"num-suffix"),s="",s={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"},u="",u=t.getAttributeNS(h,"num-prefix")||"",u=s.hasOwnProperty(r)?u+(" counter(list, "+s[r]+")"):r?u+("'"+r+"';"):u+" ''";o&&(u+=" '"+o+ "'");t=s="content: "+u+";";k(a,g,m,t)}else"list-level-style-image"===l.localName?(t="content: none;",k(a,g,m,t)):"list-level-style-bullet"===l.localName&&(t="content: '"+m.getAttributeNS(n,"bullet-char")+"';",k(a,g,m,t));l=l.nextSibling}else{g=c(f,g,j).join(",");l="";if(m=b(j,h,"text-properties")){t=""+d(m,p);r=m.getAttributeNS(h,"text-underline-style");"solid"===r&&(t+="text-decoration: underline;");if(r=m.getAttributeNS(h,"font-name"))(r='"'+r+'"')&&(t+="font-family: "+r+";");l+=t}if(m=b(j,h,"paragraph-properties")){t= m;m=""+d(t,B);t=t.getElementsByTagNameNS(h,"background-image");if(0c)break;e=e.nextSibling}a.insertBefore(b,e)}}}function a(a){this.OdfContainer=a}function c(a,b,c){var d=this;this.size=0;this.type=null;this.name=a;this.container=b;this.onchange=this.onreadystatechange=this.document=this.mimetype=this.url=null;this.EMPTY=0;this.LOADING=1;this.DONE=2;this.state=this.EMPTY;this.load=function(){var b=u[a];this.mimetype=b;c.loadAsDataURL(a,b,function(a,b){d.url=b;if(d.onchange)d.onchange(d);if(d.onstatereadychange)d.onstatereadychange(d)})}; this.abort=function(){}}function b(){this.length=0;this.item=function(){}}var d=new odf.StyleInfo,k=new odf.Style2CSS,e="urn:oasis:names:tc:opendocument:xmlns:office:1.0",i="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0",h="meta,settings,scripts,font-face-decls,styles,automatic-styles,master-styles,body".split(","),n=new core.Base64,o=new odf.FontLoader,u={};a.prototype=new function(){};a.prototype.constructor=a;a.namespaceURI=e;a.localName="document";c.prototype.load=function(){};c.prototype.getUrl= function(){return this.data?"data:;base64,"+n.toBase64(this.data):null};odf.OdfContainer=function p(d,h){function l(a){for(var b=a.firstChild,c;b;)c=b.nextSibling,1===b.nodeType?l(b):7===b.nodeType&&a.removeChild(b),b=c}function n(a){var b=v.rootElement.ownerDocument,c;if(a){l(a.documentElement);try{c=b.importNode(a.documentElement,!0)}catch(d){}}return c}function x(a){v.state=a;if(v.onchange)v.onchange(v);if(v.onstatereadychange)v.onstatereadychange(v)}function E(a){var a=n(a),b=v.rootElement;!a|| "document-styles"!==a.localName||a.namespaceURI!==e?x(p.INVALID):(b.fontFaceDecls=j(a,e,"font-face-decls"),g(b,b.fontFaceDecls),b.styles=j(a,e,"styles"),g(b,b.styles),b.automaticStyles=j(a,e,"automatic-styles"),g(b,b.automaticStyles),b.masterStyles=j(a,e,"master-styles"),g(b,b.masterStyles),o.loadFonts(b.fontFaceDecls,J,null))}function C(a){var a=n(a),b,c,d;if(!a||"document-content"!==a.localName||a.namespaceURI!==e)x(p.INVALID);else{b=v.rootElement;c=j(a,e,"font-face-decls");if(b.fontFaceDecls&& c)for(d=c.firstChild;d;)b.fontFaceDecls.appendChild(d),d=c.firstChild;else c&&(b.fontFaceDecls=c,g(b,c));c=j(a,e,"automatic-styles");if(b.automaticStyles&&c)for(d=c.firstChild;d;)b.automaticStyles.appendChild(d),d=c.firstChild;else c&&(b.automaticStyles=c,g(b,c));b.body=j(a,e,"body");g(b,b.body)}}function z(a){var a=n(a),b;if(a&&!("document-meta"!==a.localName||a.namespaceURI!==e))b=v.rootElement,b.meta=j(a,e,"meta"),g(b,b.meta)}function F(a){var a=n(a),b;if(a&&!("document-settings"!==a.localName|| a.namespaceURI!==e))b=v.rootElement,b.settings=j(a,e,"settings"),g(b,b.settings)}function m(a,b){J.loadAsDOM(a,b)}function t(){m("styles.xml",function(a,b){E(b);v.state!==p.INVALID&&m("content.xml",function(a,b){C(b);v.state!==p.INVALID&&m("meta.xml",function(a,b){z(b);v.state!==p.INVALID&&m("settings.xml",function(a,b){b&&F(b);m("META-INF/manifest.xml",function(a,b){if(b){var c=n(b),d;if(c&&!("manifest"!==c.localName||c.namespaceURI!==i)){d=v.rootElement;d.manifest=c;for(c=d.manifest.firstChild;c;)1=== c.nodeType&&"file-entry"===c.localName&&c.namespaceURI===i&&(u[c.getAttributeNS(i,"full-path")]=c.getAttributeNS(i,"media-type")),c=c.nextSibling}}v.state!==p.INVALID&&x(p.DONE)})})})})})}function r(a,b){var c="",d;for(d in b)b.hasOwnProperty(d)&&(c+=" xmlns:"+d+'="'+b[d]+'"');return''}function y(){var a=k.namespaces,b=new xmldom.LSSerializer,c=r("document-meta",a);b.filter=new f(v.rootElement);c+=b.writeToString(v.rootElement.meta, a);return c+""}function L(){var a=k.namespaces,b=new xmldom.LSSerializer,c=r("document-settings",a);b.filter=new f(v.rootElement);c+=b.writeToString(v.rootElement.settings,a);return c+""}function T(){var a=k.namespaces,b=new xmldom.LSSerializer,c=r("document-styles",a);b.filter=new f(v.rootElement,v.rootElement.masterStyles);c+=b.writeToString(v.rootElement.fontFaceDecls,a);c+=b.writeToString(v.rootElement.styles,a);c+=b.writeToString(v.rootElement.automaticStyles, a);c+=b.writeToString(v.rootElement.masterStyles,a);return c+""}function O(){var a=k.namespaces,b=new xmldom.LSSerializer,c=r("document-content",a);b.filter=new f(v.rootElement,v.rootElement.body);c+=b.writeToString(v.rootElement.automaticStyles,a);c+=b.writeToString(v.rootElement.body,a);return c+""}function N(a,b){runtime.loadXML(a,function(a,c){if(a)b(a);else{var d=n(c);!d||"document"!==d.localName||d.namespaceURI!==e?x(p.INVALID):(v.rootElement= d,d.fontFaceDecls=j(d,e,"font-face-decls"),d.styles=j(d,e,"styles"),d.automaticStyles=j(d,e,"automatic-styles"),d.masterStyles=j(d,e,"master-styles"),d.body=j(d,e,"body"),d.meta=j(d,e,"meta"),x(p.DONE))}})}var v=this,J=null;this.onstatereadychange=h;this.parts=this.rootElement=this.state=this.onchange=null;this.getPart=function(a){return new c(a,v,J)};this.save=function(a){var b;b=runtime.byteArrayFromString(L(),"utf8");J.save("settings.xml",b,!0,new Date);b=runtime.byteArrayFromString(y(),"utf8"); J.save("meta.xml",b,!0,new Date);b=runtime.byteArrayFromString(T(),"utf8");J.save("styles.xml",b,!0,new Date);b=runtime.byteArrayFromString(O(),"utf8");J.save("content.xml",b,!0,new Date);J.write(function(b){a(b)})};this.state=p.LOADING;this.rootElement=function(a){var b=document.createElementNS(a.namespaceURI,a.localName),c,a=new a;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}(a);this.parts=new b(this);J=new core.Zip(d,function(a,b){J=b;a?N(d,function(b){a&&(J.error=a+"\n"+b,x(p.INVALID))}): t()})};odf.OdfContainer.EMPTY=0;odf.OdfContainer.LOADING=1;odf.OdfContainer.DONE=2;odf.OdfContainer.INVALID=3;odf.OdfContainer.SAVING=4;odf.OdfContainer.MODIFIED=5;odf.OdfContainer.getContainer=function(a){return new odf.OdfContainer(a,null)};return odf.OdfContainer}(); // Input 24 odf.Formatting=function(){function j(f){function g(a,b){for(var d=a&&a.firstChild;d&&b;)d=d.nextSibling,b-=1;return d}var a=g(f.startContainer,f.startOffset);g(f.endContainer,f.endOffset);this.next=function(){return null===a?a:null}}var l=new odf.StyleInfo;this.setOdfContainer=function(){};this.isCompletelyBold=function(){return!1};this.getAlignment=function(f){this.getParagraphStyles(f)};this.getParagraphStyles=function(f){var g,a,c,b=[];for(g=0;ga?-1:a-1})};a.slideChange=function(c){var b=a.getPages(a.odf_canvas.odfContainer().rootElement),d=-1,f=0;b.forEach(function(a){a=a[1];a.hasAttribute("slide_current")&&(d=f,a.removeAttribute("slide_current"));f+=1});c=c(d,b.length);-1===c&&(c=d); b[c][1].setAttribute("slide_current","1");document.getElementById("pagelist").selectedIndex=c;"cont"===a.slide_mode&&window.scrollBy(0,b[c][1].getBoundingClientRect().top-30)};a.selectSlide=function(c){a.slideChange(function(a,d){return c>=d||0>c?-1:c})};a.scrollIntoContView=function(c){var b=a.getPages(a.odf_canvas.odfContainer().rootElement);0!==b.length&&window.scrollBy(0,b[c][1].getBoundingClientRect().top-30)};a.getPages=function(a){var a=a.getElementsByTagNameNS(f("draw"),"page"),b=[],d;for(d= 0;dd}}var a=l.node().ownerDocument,c=new core.Cursor(j,a);this.movePointForward=function(a){f(a,l.stepForward)};this.movePointBackward=function(a){f(a,l.stepBackward)};this.moveLineForward=function(a){j.modify?j.modify(a?"extend":"move","forward", "line"):f(a,g)};this.moveLineBackward=function(a){j.modify?j.modify(a?"extend":"move","backward","line"):f(a,function(){})};return this}; // Input 29 runtime.loadClass("core.PointWalker");runtime.loadClass("core.Cursor"); gui.XMLEdit=function(j,l){function f(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):a["on"+b]=c}function g(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function a(){var a=j.ownerDocument.defaultView.getSelection();a&&!(0>=a.rangeCount)&&s&&(a=a.getRangeAt(0),s.setPoint(a.startContainer,a.startOffset))}function c(){var a=j.ownerDocument.defaultView.getSelection(),b,c;a.removeAllRanges();s&&s.node()&&(b=s.node(),c=b.ownerDocument.createRange(), c.setStart(b,s.position()),c.collapse(!0),a.addRange(c))}function b(b){var d=b.charCode||b.keyCode;if(s=null,s&&37===d)a(),s.stepBackward(),c();else if(16<=d&&20>=d||33<=d&&40>=d)return;g(b)}function d(){}function k(a){j.ownerDocument.defaultView.getSelection().getRangeAt(0);g(a)}function e(a){for(var b=a.firstChild;b&&b!==a;)1===b.nodeType&&e(b),b=b.nextSibling||b.parentNode;var c,d,f,b=a.attributes;c="";for(f=b.length-1;0<=f;f-=1)d=b.item(f),c=c+" "+d.nodeName+'="'+d.nodeValue+'"';a.setAttribute("customns_name", a.nodeName);a.setAttribute("customns_atts",c);b=a.firstChild;for(d=/^\s*$/;b&&b!==a;)c=b,b=b.nextSibling||b.parentNode,3===c.nodeType&&d.test(c.nodeValue)&&c.parentNode.removeChild(c)}function i(a,b){for(var c=a.firstChild,d,e,f;c&&c!==a;){if(1===c.nodeType){i(c,b);d=c.attributes;for(f=d.length-1;0<=f;f-=1)e=d.item(f),"http://www.w3.org/2000/xmlns/"===e.namespaceURI&&!b[e.nodeValue]&&(b[e.nodeValue]=e.localName)}c=c.nextSibling||c.parentNode}}function h(){var a=j.ownerDocument.createElement("style"), b;b={};i(j,b);var c={},d,e,f=0;for(d in b)if(b.hasOwnProperty(d)&&d){e=b[d];if(!e||c.hasOwnProperty(e)||"xmlns"===e){do e="ns"+f,f+=1;while(c.hasOwnProperty(e));b[d]=e}c[e]=!0}a.type="text/css";b="@namespace customns url(customns);\n"+n;a.appendChild(j.ownerDocument.createTextNode(b));l=l.parentNode.replaceChild(a,l)}var n,o,u,s=null;j.id||(j.id="xml"+(""+Math.random()).substring(2));o="#"+j.id+" ";n=o+"*,"+o+":visited, "+o+":link {display:block; margin: 0px; margin-left: 10px; font-size: medium; color: black; background: white; font-variant: normal; font-weight: normal; font-style: normal; font-family: sans-serif; text-decoration: none; white-space: pre-wrap; height: auto; width: auto}\n"+ o+":before {color: blue; content: '<' attr(customns_name) attr(customns_atts) '>';}\n"+o+":after {color: blue; content: '';}\n"+o+"{overflow: auto;}\n";(function(a){f(a,"click",k);f(a,"keydown",b);f(a,"keypress",d);f(a,"drop",g);f(a,"dragend",g);f(a,"beforepaste",g);f(a,"paste",g)})(j);this.updateCSS=h;this.setXML=function(a){a=a.documentElement||a;u=a=j.ownerDocument.importNode(a,true);for(e(a);j.lastChild;)j.removeChild(j.lastChild);j.appendChild(a);h();s=new core.PointWalker(a)}; this.getXML=function(){return u}}; // Input 30 (function(){return"core/Async.js,core/Base64.js,core/ByteArray.js,core/ByteArrayWriter.js,core/Cursor.js,core/JSLint.js,core/PointWalker.js,core/RawDeflate.js,core/RawInflate.js,core/UnitTester.js,core/Zip.js,gui/Caret.js,gui/SelectionMover.js,gui/XMLEdit.js,gui/PresenterUI.js,odf/FontLoader.js,odf/Formatting.js,odf/OdfCanvas.js,odf/OdfContainer.js,odf/Style2CSS.js,odf/StyleInfo.js,xmldom/LSSerializer.js,xmldom/LSSerializerFilter.js,xmldom/OperationalTransformDOM.js,xmldom/OperationalTransformInterface.js,xmldom/RelaxNG.js,xmldom/RelaxNG2.js,xmldom/RelaxNGParser.js,xmldom/XPath.js".split(",")})();