(function(){var e;function aa(a){var b=16,c;if(a){b||(b=16);if("$"==a.charAt(0))b=16,a=a.substr(1);else if("0x"==a.substr(0,2))b=16,a=a.substr(2);else{var d=a.charAt(a.length-1).toLowerCase();"h"==d?(b=16,d=null):"."==d&&(b=10,d=null);null==d&&(a=a.substr(0,a.length-1))}var f,d=a,g=b;(g&&10!=g?16==g?null!==d.match(/^[0-9a-f]+$/i):2==g&&null!==d.match(/^[01]+$/i):null!==d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c} function n(a,b){var c="";void 0===b?b=8:8=d?48:55),c=String.fromCharCode(d)+c;a>>=4}return c}function ba(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function fa(a){return a.replace(/[&<>"']/g,function(a){return ea[a]})}var p=Date.now||function(){return+new Date};function ga(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function q(a,b,c,d){var f=0,g=null,k=null;if("object"==typeof resources&&(g=resources[a]))return d&&d(a,g,f),[g,f];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),k;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(g=h.responseText,200==h.status||!h.status&&g.length&&"file:"==(window?window.location.protocol:"file:")||(f=h.status||-1),d&&d(a,g,f))});if(b&&"object"== typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(l)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(g=h.responseText,200!=h.status&&(f=h.status||-1),d&&d(a,g,f),k=[g,f]);return k}function t(){return"http://"+(window?window.location.host:"www.pcjs.org")} function u(a){window&&window.alert(a)}function ha(a){var b=!1;window&&(b=window.confirm(a));return b}var ia=null;function ja(){if(null==ia){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}ia=a}return ia}function ka(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b} function la(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function ma(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var v={init:[],show:[],exit:[]},na=!1,oa=!0;function qa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function w(a){v.init.push(a)} function ra(a){if(oa)try{for(var b=0;b=this.m?12:24>=this.m?14:15;this.h=1<>2;this.s=this.h-1;this.f=this.i/this.h|0;a=new L;Ga(a,this.B);this.b=Array(this.f);for(b=0;b>>a.o;0a.h?a.h:c;if(g&&g.size){if(g.type==d){if(b+c<=g.ia)return g.Ca+=g.ia-b,g.ia=b,!0;if(b>=g.ia+g.Ca){h=g.size-(b-k);h>c&&(h=c);g.Ca=b-g.ia+h;c-=h;b=k+a.h;continue}}return Ia(1,b,c)}g=a.b[f];b=new L(b,h,a.h,d);Ga(b,a.B,g);a.b[f++]=b;b=k+a.h;c-=h}return 0>=c?!0:Ia(2,b,c)}function Ia(a,b,c){u("Memory block error ("+a+": "+n(b)+","+n(c)+")");return!1}var Ja; if(J){var Ka=new ArrayBuffer(2);(new DataView(Ka)).setUint16(0,256,!0);Ja=256===(new Uint16Array(Ka))[0]}else Ja=!1;var La=Ja; function L(a,b,c,d){this.id=Ma+=2;this.a=null;this.ia=a;this.Ca=b;this.size=c||0;this.type=d||Na;this.h=d==Oa;Ga(this);this.O=this.eb=!1;if(c)if(J)this.j=new ArrayBuffer(c),this.f=new DataView(this.j,0,c),this.b=new Uint8Array(this.j,0,c),this.i=new Uint16Array(this.j,0,c>>1),this.a=new Int32Array(this.j,0,c>>2),Pa(this,La?Qa:Ra);else{this.a=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},F:function(a){return this.a[a>> 2]>>>((a&3)<<3)&255},N:function(a){var b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},Z:function(a,b){var c=a>>2,d=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2,d=(a&3)<<3;24>d?this.a[c]=this.a[c]&~(65535<>8);this.O=!0},A:function(a,b){return this.D(a,b)},H:function(a,b){return this.K(a,b)},T:function(a,b,c){this.h||this.Za(a,b,c)},aa:function(a,b, c){this.h||this.ta(a,b,c)},u:function(a){return this.b[a]},C:function(a){return this.b[a]},G:function(a){return this.f.getUint16(a,!0)},L:function(a){return a&1?this.b[a]|this.b[a+1]<<8:this.i[a>>1]},S:function(a,b){this.b[a]=b;this.O=!0},Y:function(a,b){this.b[a]=b;this.O=!0},$:function(a,b){this.f.setUint16(a,b,!0);this.O=!0},ua:function(a,b){a&1?(this.b[a]=b,this.b[a+1]=b>>8):this.i[a>>1]=b;this.O=!0}};function Ga(a,b,c){a.B=b;a.m=a.g=0;c&&((a.m=c.m)&&Ta(a,Ua,!1),(a.g=c.g)&&Va(a,Ua,!1))} function Va(a,b,c){c&&a.g||(a.Ja=!a.h&&b[2]||a.s);if(c||void 0===c)a.Za=b[2]||a.s,a.ta=b[3]||a.ba}function Ta(a,b,c){c&&a.m||(a.sa=b[0]||a.l,a.gb=b[1]||a.o);if(c||void 0===c)a.D=b[0]||a.l,a.K=b[1]||a.o}function Pa(a,b){b||(b=Wa);Ta(a,b,void 0);Va(a,b,void 0)}var Wa=[],Sa=[L.prototype.F,L.prototype.N,L.prototype.Z,L.prototype.va],Ua=[L.prototype.A,L.prototype.H,L.prototype.T,L.prototype.aa]; if(J)var Ra=[L.prototype.u,L.prototype.G,L.prototype.S,L.prototype.$],Qa=[L.prototype.C,L.prototype.L,L.prototype.Y,L.prototype.ua]; function M(a,b){y.call(this,"CPU",a,M);var c=a.cycles||b,d=a.multiplier||1;this.a={};this.a.ha=c;this.a.ga=d;this.a.Fa=Math.round(this.a.ha/1E4)/100;this.a.da=this.a.Fa*this.a.ga;this.c.M=!1;this.c.Ra=!1;this.c.Pa=a.autoStart;this.c.Qa=!1;this.c.wa=!1;this.a.Aa=this.a.fa=0;this.a.Ba=a.csStart;this.a.la=a.csInterval;this.a.ma=a.csStop;this.bb=this.Ia.bind(this);I(this)}B(M);var Xa=["power","reset"];e=M.prototype; e.ka=function(a,b,c,d){this.f=a;this.m=b;this.B=d;for(b=0;bc&&(c=60);2>c&&(c=2);var d=1;b&&1a.a.V/a.a.da&&(b=1);a.a.ga=b;var c=a.a.Fa*a.a.ga;if(a.a.da!=c){a.a.da=c;var c=a.a.da.toFixed(2)+"Mhz",d=a.j.setSpeed;d&&(d.textContent=c);a.I("target speed: "+c)}}cb(a,a.D);a.D=0;a.a.ea=p();a.a.W=0;db(a)} e.Ia=function(){if(Aa(this,!0)){if(!this.c.M){O(this);this.f&&this.f.start(this.a.ea,P(this));this.c.M=!0;this.c.Ra=!0;this.l&&this.l.hb();var a=this.j.run;a&&(a.textContent="Halt");this.f&&this.f.X(!0)}this.a.Ha>=this.a.ha&&db(this,!0);this.a.qa=0;this.a.za=p();this.a.W&&(a=this.a.za-this.a.W,a>this.a.Ta&&(this.a.ea+=a,this.a.ea>this.a.za&&(this.a.ea=this.a.za)));try{do{var b=this.c.wa?1:this.a.fb;this.l&&(this.l.Ya(),b=this.l.jb(0,b),b=this.l.ib(b));try{this.Xa(b)}catch(f){if("number"!=typeof f)throw f; }var c=this.F-this.b;this.D+=c;this.a.qa+=c;cb(this,0,!0);a=c;if(this.c.wa){var d=!1;this.a.Aa=this.a.Aa+this.Sa()|0;this.a.fa-=a;0>=this.a.fa&&(this.a.fa+=this.a.la,d=!0);0<=this.a.ma&&this.a.ma<=P(this)&&(this.a.la=this.a.ma=-1,$a(this),N(this),d=!0);d&&this.I(P(this)+" cycles: checksum="+n(this.a.Aa))}this.a.oa-=c;0>=this.a.oa&&(this.a.oa+=this.a.Va);this.a.na-=c;0>=this.a.na&&(this.a.na+=this.a.Ua,this.f&&this.f.X());this.a.pa-=c;if(0>=this.a.pa){this.a.pa+=this.a.Ga;break}}while(this.c.M)}catch(f){N(this); ab(this);this.f&&this.f.stop(p(),P(this));Aa(this,!1);b=f.stack||f.message;this.c.U=!0;this.w(b);return}b=setTimeout;c=this.bb;this.a.W=p();a=this.a.Ta;this.a.qa&&(a=Math.round(a*this.a.qa/this.a.Ga));a-=this.a.W-this.a.za;if(d=this.a.W-this.a.ea)this.a.V=Math.round(this.D/(10*d))/100,864E5<=d&&(this.G=0,this.l&&this.l.Ya(!0),O(this));if(0>a||this.a.V>>a.o].sa(b&a.N,b)}function kb(a){var b=jb(a,a.s);a.s=a.s+1&65535;return b}function S(a,b,c,d){d=d||2;a.j[b]&&(void 0===c&&(a.c.U=!0,a.w("Value for "+b+" is invalid"),N(a)),c=!a.c.M||a.c.Qa?n(c,d):"--------".substr(0,d),a.j[b].textContent!=c&&(a.j[b].textContent=c))} e.X=function(a){this.va&&(a||!this.c.M||this.c.Qa)&&(S(this,"A",this.C),S(this,"B",this.g),S(this,"C",this.u),S(this,"D",this.$),S(this,"E",this.aa),S(this,"H",this.K),S(this,"L",this.L),S(this,"SP",this.ba,4),S(this,"PC",this.s,4),a=ib(this),S(this,"F",a,2),S(this,"S",a&128,1),S(this,"Z",a&64,1),S(this,"A",a&16,1),S(this,"P",a&4,1),S(this,"C",a&1,1));if(a=this.j.speed)a.textContent=this.c.M&&this.a.V?this.a.V.toFixed(2)+"Mhz":"Stopped"}; e.Xa=function(a){this.c.xa=!0;this.c.cb=!1;this.c.Ra=!1;this.F=this.b=a;this.l&&!a&&this.l.Ya();a||(this.S|=4);do{if(this.Z&&this.Z&4){this.S=this.b=0;break}this.S=0;this.$a[kb(this)].call(this)}while(0>>this.o;b>8&255;this.u=a&255;this.b-=10},function(){var a=this.g<<8|this.u;this.H[(a&this.Y)>>>this.o].Ja(a&this.N,this.C&255,a);this.b-=7},function(){var a=(this.g<<8|this.u)+1;this.g=a>>8&255;this.u=a&255;this.b-=5},function(){var a=this.g;this.T=a;a=(this.A=a+1)&255;this.i=this.i&-256|a;this.g=a;this.b-=5},function(){var a= this.g;this.T=a;a=(this.A=a-1)&255;this.i=this.i&-256|a;this.g=a;this.b-=5},function(){this.g=kb(this);this.b-=7},function(){var a=this.C<<1;this.C=a&255|a>>8;this.i=this.i&255|a&256;this.b-=4},lb,function(){var a,b=a=(this.K<<8|this.L)+(this.g<<8|this.u);this.K=b>>8&255;this.L=b&255;this.i=this.i&255|a>>8&256;this.b-=10},function(){this.C=jb(this,this.g<<8|this.u);this.b-=7},T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T, T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T]; function U(a){y.call(this,"ROM",a,U);this.b=null;this.l=a.addr;this.f=a.size;this.g=a.alias;this.h=a.file;this.o=ba(this.h);if(this.h){a=this.h;var b=ca(this.o);"json"!=b&&"hex"!=b&&(a=t()+"/api/v1/dump?file="+this.h+"&format=bytes&decimal=true");var c=this;q(a,null,!0,function(a,b,g){mb(c,a,b,g)})}}B(U);U.prototype.ka=function(a,b,c,d){this.m=b;this.a=c;this.B=d;nb(this)};U.prototype.R=function(){this.i&&(this.B&&this.B.a(this.id,this.l,this.f,this.i),delete this.i);return!0};U.prototype.P=function(){return!0}; function mb(a,b,c,d){if(d)a.w("Unable to load system ROM (error "+d+": "+b+")");else{za(a.Ma,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var f=eval("("+c+")"),g=f.bytes,k=f.data;if(g)a.b=g;else if(k)for(a.b=Array(4*k.length),d=c=0;c>8&255,a.b[d++]=k[c]>>16&255,a.b[d++]=k[c]>>24&255;else a.b=f;a.i=f.symbols;if(!a.b.length){u("Empty ROM: "+b);return}if(1==a.b.length){u(a.b[0]);return}}catch(h){a.w("ROM data error: "+h.message);return}else for(b=c.replace(/\n/gm, " ").replace(/ +$/,"").split(" "),a.b=Array(b.length),f=0;f>>d.o].Za(f&d.s,a.b[c]&255,f)}b=!0}else b=!1;if(b){b=[];"number"==typeof a.g?b.push(a.g):null!=a.g&&a.g.length&&(b=a.g);for(c=0;c>>f.o;0>>=f.o;0Missing <canvas> support. Please try a newer web browser.";break}f.setAttribute("class","pcjs-canvas");f.setAttribute("width",d.screenWidth);f.setAttribute("height",d.screenHeight);f.style.backgroundColor=d.screenColor;f.style.height="auto";0<=(window?window.navigator.userAgent:"").indexOf("MSIE")&&(c.onresize=function(a, b,c,d){return function(){b.style.height=(a.clientWidth*d/c|0)+"px"}}(c,f,d.screenWidth,d.screenHeight),c.onresize());var g=+(d.aspect||ua.aspect);g&&.3<=g&&3.33>=g&&(qa("onresize",function(a,b,c){return function(){b.style.height=(a.clientWidth/c|0)+"px"}}(c,f,g)),window.onresize());c.appendChild(f);g=document.createElement("textarea");ma("iOS")&&(g.setAttribute("autocapitalize","off"),g.setAttribute("autocorrect","off"));c.appendChild(g);f.getContext("2d");d=new qb(d);G(d,c)}}); function Q(a,b,c){this.id=a.id;this.key=rb(a,b,c);this.B=a.B;sb(this,a.Wa)}function rb(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0X){if(V(d,this.u)){this.i=new Q(this,Y,"failsafe");V(this.i)&&(Ab(this,d),a=2,sb(this.i));R(this.i,"timestamp",ga());tb(this.i);var f=this.b&&!this.l;if(1==a||ha("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=ub(d)){var g=W(d,"code"),k=W(d,"data");g&&("ok"==g?V(d,k):("error"==g&&"no machine state"!=k? (this.w("Error: "+k),"unable to verify user"==k&&(la("user",""),this.f=null)):this.I(g+": "+k),sb(d),V(d)?(c=ub(d),f=!0):c=!1))}f&&zb(this,c?d:null)}else 2==a&&d.clear()}else zb(this);delete this.u;delete this.A}f=D(this.id);for(g=0;ga[1];a=a[2];this.c.v=!0;var d=this.j.power;d&&(d.textContent="Shutdown");this.F||(this.I("PC8080 v"+Y+"\nCopyright \u00a9 2012-2016 Jeff Parsons \nLicense: GPL version 3 or later "),this.F=!0);this.a&&(Bb(this,this.a,b,c,a),bb(this.a));this.G&&(Ab(this,b),b.clear());!c&&this.i&&(this.i.clear(),delete this.i);this.g=0}; function Ab(a,b){if(ha("There may be a problem with your PC8080 machine.\n\nTo help us diagnose it, click OK to send this PC8080 machine state to http://www.pcjs.org.")){var c=a.L,d=a.f||"",f=b.toString(),g={app:"PC8080"};g.ver=Y;g.url=c;g.user=d;g.type="bug";g.data=f;q("http://www.pcjs.org/api/v1/report",g,!0)}} function Cb(a,b,c){var d,f="none";if(a.g)return null;a.g--;var g=new Q(a,Y),k=new Q(a,Y,"validate"),h=ga();R(k,"timestamp",h);R(g,"timestamp",h);R(g,"version","1.21.7");R(g,"url",window?window.location.href:null);R(g,"browser",window?window.navigator.userAgent:"");a.a&&a.a.P&&(c&&N(a.a),d=a.a.P(b,c),"object"===typeof d&&R(g,a.a.id,d),c&&(a.a.c.v=!1,!1===d&&(f=null)));for(var h=D(a.id),l=0;lh.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(h=window.location.pathname+h);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(h?' url="'+h+'"':""))}f||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1pc8080$2")); h=null;if("<"==a.charAt(0))try{f||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(h=new window.ActiveXObject("Microsoft.XMLDOM"),h.async=!1,h.loadXML(a)):h=(new window.DOMParser).parseFromString(a,"text/xml")}catch(r){h=null,a=r.message}else a="unrecognized XML: "+(255/g.exec(a)){var f=d[2];b("Loading "+f+"...");q(f,null,!0,function(g,k,h){if(h||!k)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(g=d[3])if(h=k.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,A=/( [a-z]+=)(['"])(.*?)\2/g;m=A.exec(g);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(k=k.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+f);return}k=k.replace(/<\?xml[^>]*>[\r\n]*/, "");a=a.replace(d[0],k);Ib(a,b,c)}})}else c(a,null)} function Jb(a,b,c,d){function f(a){if(void 0===h){var b=k&&H(k,"machine-warning");h=b&&b[0]||k}h&&(h.innerHTML=fa(a))}function g(a){f("Error: "+a);l&&(--Fb||x(!0));l=!1}var k,h,l=!0;Fb++;C[a]={};try{if(k=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var A=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));A.appendChild(r)}c||(c= "/versions/pc8080/1.21.7/components.xsl");m=function(d,h){h?Gb(c,null,null,!1,f,function(d,m){if(m)if(za(a,c,d),f("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window){var l=h.transformNode(m);l?(k.outerHTML=l,--Fb||x(!0)):g("transformNodeToObject failed")}else document.implementation&&document.implementation.createDocument?(l=new XSLTProcessor,l.importStylesheet(m),(l=l.transformToFragment(h,document))?k.parentNode?(k.parentNode.replaceChild(l,k),--Fb||x(!0)):g("invalid machine element: "+ a):g("transformToFragment failed")):g("unable to transform XML: unsupported browser");else g(d)}):g(d)};"<"!=b.charAt(0)?Gb(b,a,d,!0,f,m):Hb(b,null,a,d,!1,f,m)}else g("missing machine element: "+a)}catch(pa){g(pa.message)}return l}window.embedPC8080=function(a,b,c,d){x(!1);return Jb(a,b,c,d)};window.enableEvents=x;window.sendEvent=sa; function Kb(a,b,c,d){if(!c&&b){d.push(b);a=C[d[0]];b=null;for(var f in a)if(da(f,"components.xsl")){b=f.replace(".xsl",".css");break}b?q(b,null,!0,function(a,b){Lb(b,d)}):Lb(null,d)}else u("Error ("+c+") requesting "+a)} function Lb(a,b){var c,d,f,g=b[0],k=b[1];c=b[4];c=c.match(/^(\s*\(function\(\)\{)([\s\S]*)(}\)\(\);\s*)$/);var h=C[g],l={},m;for(m in h){var A=h[m],r=ca(m);if("xml"==r){for(r=/[ \t]*]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=r.exec(h[m]);){var pa=d[2];pa&&(h[pa]||(A=A.replace(d[0],"")))}d=m=ba(m)}else"xsl"==r&&(f=m=ba(m));l[m]=A}a&&(l[m="css"]=a);b[2]&&(l[m="parms"]=b[2]);b[3]&&(l[m="state"]=b[3]);d&&f?(m=JSON.stringify(l),k+=".js",c=c[1]+"var resources="+m+";"+c[2]+c[3],c=c.replace(/\u00A9/g, "©"),m=k,h=null,l="data:application/javascript,",l=ma("Firefox")?l+encodeURIComponent(c):l+encodeURI(c),m&&(h=document.createElement("a"),"string"!=typeof h.download&&(h=null)),h?(h.href=l,h.download=m,document.body.appendChild(h),h.click(),document.body.removeChild(h),c="Check your Downloads folder for "+m+"."):(window.open(l),c="Check your browser for a new window/tab containing the requested data"+(m?" ("+m+")":"")+"."),c+=', copy it to your web server as "'+k+'", and then add the following to your web page:\n\n', c+='
\n',c+="...\n",c+='