月球大数据地理空间分析展示平台-【中台】
WX
2023-07-19 e815dad728f0aba7b2bb2b2087dad4c36e68652f
1
(()=>{var le={};(function(D,M){D.SuperGif=M()})(le,function(){var D=function(a){return a.reduce(function(e,p){return e*2+p},0)},M=function(a){for(var e=[],p=7;p>=0;p--)e.push(!!(a&1<<p));return e},Y=function(a){this.data=a,this.len=this.data.length,this.pos=0,this.readByte=function(){if(this.pos>=this.data.length)throw new Error("Attempted to read past end of stream.");return a instanceof Uint8Array?a[this.pos++]:a.charCodeAt(this.pos++)&255},this.readBytes=function(e){for(var p=[],_=0;_<e;_++)p.push(this.readByte());return p},this.read=function(e){for(var p="",_=0;_<e;_++)p+=String.fromCharCode(this.readByte());return p},this.readUnsigned=function(){var e=this.readBytes(2);return(e[1]<<8)+e[0]}},ue=function(a,e){for(var p=0,_=function(u){for(var g=0,x=0;x<u;x++)e.charCodeAt(p>>3)&1<<(p&7)&&(g|=1<<x),p++;return g},l=[],S=1<<a,A=S+1,P=a+1,d=[],t=function(){d=[],P=a+1;for(var u=0;u<S;u++)d[u]=[u];d[S]=[],d[A]=null},i,c;;){if(c=i,i=_(P),i===S){t();continue}if(i===A)break;if(i<d.length)c!==S&&d.push(d[c].concat(d[i][0]));else{if(i!==d.length)throw new Error("Invalid LZW code.");d.push(d[c].concat(d[c][0]))}l.push.apply(l,d[i]),d.length===1<<P&&P<12&&P++}return l},fe=function(a,e){e||(e={});var p=function(t){for(var i=[],c=0;c<t;c++)i.push(a.readBytes(3));return i},_=function(){var t,i;i="";do t=a.readByte(),i+=a.read(t);while(t!==0);return i},l=function(){var t={};if(t.sig=a.read(3),t.ver=a.read(3),t.sig!=="GIF")throw new Error("Not a GIF file.");t.width=a.readUnsigned(),t.height=a.readUnsigned();var i=M(a.readByte());t.gctFlag=i.shift(),t.colorRes=D(i.splice(0,3)),t.sorted=i.shift(),t.gctSize=D(i.splice(0,3)),t.bgColor=a.readByte(),t.pixelAspectRatio=a.readByte(),t.gctFlag&&(t.gct=p(1<<t.gctSize+1)),e.hdr&&e.hdr(t)},S=function(t){var i=function(o){var E=a.readByte(),v=M(a.readByte());o.reserved=v.splice(0,3),o.disposalMethod=D(v.splice(0,3)),o.userInput=v.shift(),o.transparencyGiven=v.shift(),o.delayTime=a.readUnsigned(),o.transparencyIndex=a.readByte(),o.terminator=a.readByte(),e.gce&&e.gce(o)},c=function(o){o.comment=_(),e.com&&e.com(o)},u=function(o){var E=a.readByte();o.ptHeader=a.readBytes(12),o.ptData=_(),e.pte&&e.pte(o)},g=function(o){var E=function(s){var O=a.readByte();s.unknown=a.readByte(),s.iterations=a.readUnsigned(),s.terminator=a.readByte(),e.app&&e.app.NETSCAPE&&e.app.NETSCAPE(s)},v=function(s){s.appData=_(),e.app&&e.app[s.identifier]&&e.app[s.identifier](s)},I=a.readByte();switch(o.identifier=a.read(8),o.authCode=a.read(3),o.identifier){case"NETSCAPE":E(o);break;default:v(o);break}},x=function(o){o.data=_(),e.unknown&&e.unknown(o)};switch(t.label=a.readByte(),t.label){case 249:t.extType="gce",i(t);break;case 254:t.extType="com",c(t);break;case 1:t.extType="pte",u(t);break;case 255:t.extType="app",g(t);break;default:t.extType="unknown",x(t);break}},A=function(t){var i=function(g,x){for(var o=new Array(g.length),E=g.length/x,v=function(L,j){var q=g.slice(j*x,(j+1)*x);o.splice.apply(o,[L*x,x].concat(q))},I=[0,4,2,1],s=[8,8,4,2],O=0,G=0;G<4;G++)for(var R=I[G];R<E;R+=s[G])v(R,O),O++;return o};t.leftPos=a.readUnsigned(),t.topPos=a.readUnsigned(),t.width=a.readUnsigned(),t.height=a.readUnsigned();var c=M(a.readByte());t.lctFlag=c.shift(),t.interlaced=c.shift(),t.sorted=c.shift(),t.reserved=c.splice(0,2),t.lctSize=D(c.splice(0,3)),t.lctFlag&&(t.lct=p(1<<t.lctSize+1)),t.lzwMinCodeSize=a.readByte();var u=_();t.pixels=ue(t.lzwMinCodeSize,u),t.interlaced&&(t.pixels=i(t.pixels,t.width)),e.img&&e.img(t)},P=function(){var t={};switch(t.sentinel=a.readByte(),String.fromCharCode(t.sentinel)){case"!":t.type="ext",S(t);break;case",":t.type="img",A(t);break;case";":t.type="eof",e.eof&&e.eof(t);break;default:throw new Error("Unknown block: 0x"+t.sentinel.toString(16))}t.type!=="eof"&&setTimeout(P,0)},d=function(){l(),setTimeout(P,0)};d()},pe=function(a){var e={vp_l:0,vp_t:0,vp_w:null,vp_h:null,c_w:null,c_h:null};for(var p in a)e[p]=a[p];e.vp_w&&e.vp_h&&(e.is_vp=!0);var _,l,S=null,A=!1,P=null,d=null,t=null,i=null,c=null,u=null,g=null,x=!0,o=!0,E=!1,v=[],I=[],s=e.gif;typeof e.auto_play>"u"&&(e.auto_play=!s.getAttribute("rel:auto_play")||s.getAttribute("rel:auto_play")=="1");var O=e.hasOwnProperty("on_end")?e.on_end:null,G=e.hasOwnProperty("loop_delay")?e.loop_delay:0,R=e.hasOwnProperty("loop_mode")?e.loop_mode:"auto",L=e.hasOwnProperty("draw_while_loading")?e.draw_while_loading:!0,j=L?e.hasOwnProperty("show_progress_bar")?e.show_progress_bar:!0:!1,q=e.hasOwnProperty("progressbar_height")?e.progressbar_height:25,ce=e.hasOwnProperty("progressbar_background_color")?e.progressbar_background_color:"rgba(255,255,255,0.4)",de=e.hasOwnProperty("progressbar_foreground_color")?e.progressbar_foreground_color:"rgba(255,0,22,.8)",$=function(){P=null,d=null,c=t,t=null,u=null},ee=function(){try{fe(_,ye)}catch{V("parse")}},xe=function(r){U.innerHTML=r,U.style.visibility="visible"},re=function(r,n){C.width=r*y(),C.height=n*y(),U.style.minWidth=r*y()+"px",F.width=r,F.height=n,F.style.width=r+"px",F.style.height=n+"px",F.getContext("2d").setTransform(1,0,0,1,0,0)},ve=function(r,n){if(!I[r]){I[r]=n;return}typeof n.x<"u"&&(I[r].x=n.x),typeof n.y<"u"&&(I[r].y=n.y)},te=function(r,n,h){if(h&&j){var f=q,m,T,b,z;if(e.is_vp){if(E?(b=(e.vp_t+e.vp_h-f)/y(),f=f/y(),m=e.vp_l/y(),T=m+r/n*(e.vp_w/y()),z=C.width/y()):(b=e.vp_t+e.vp_h-f,f=f,m=e.vp_l,T=m+r/n*e.vp_w,z=C.width),!1)if(E)var Z,J,B,K;else var Z,J,B,K}else b=(C.height-f)/(E?y():1),T=r/n*C.width/(E?y():1),z=C.width/(E?y():1),f/=E?y():1;w.fillStyle=ce,w.fillRect(T,b,z-T,f),w.fillStyle=de,w.fillRect(0,b,T,f)}},V=function(r){var n=function(){w.fillStyle="black",w.fillRect(0,0,e.c_w?e.c_w:l.width,e.c_h?e.c_h:l.height),w.strokeStyle="red",w.lineWidth=3,w.moveTo(0,0),w.lineTo(e.c_w?e.c_w:l.width,e.c_h?e.c_h:l.height),w.moveTo(0,e.c_h?e.c_h:l.height),w.lineTo(e.c_w?e.c_w:l.width,0),w.stroke()};S=r,l={width:s.width,height:s.height},v=[],n()},he=function(r){l=r,re(l.width,l.height)},_e=function(r){ae(),$(),P=r.transparencyGiven?r.transparencyIndex:null,d=r.delayTime,t=r.disposalMethod},ae=function(){!u||(v.push({data:u.getImageData(0,0,l.width,l.height),delay:d}),I.push({x:0,y:0}))},ge=function(r){u||(u=F.getContext("2d"));var n=v.length,h=r.lctFlag?r.lct:l.gct;n>0&&(c===3?i!==null?u.putImageData(v[i].data,0,0):u.clearRect(g.leftPos,g.topPos,g.width,g.height):i=n-1,c===2&&u.clearRect(g.leftPos,g.topPos,g.width,g.height));var f=u.getImageData(r.leftPos,r.topPos,r.width,r.height);r.pixels.forEach(function(m,T){m!==P&&(f.data[T*4+0]=h[m][0],f.data[T*4+1]=h[m][1],f.data[T*4+2]=h[m][2],f.data[T*4+3]=255)}),u.putImageData(f,r.leftPos,r.topPos),E||(w.scale(y(),y()),E=!0),L&&(w.drawImage(F,0,0),L=e.auto_play),g=r},N=function(){var r=-1,n=0,h=!1,f=!1,m=function(){var B=o?1:-1;return(r+B+v.length)%v.length},T=function(B){r=r+B,z()},b=function(){var B=!1,K=function(){O!==null&&O(s),n++,R!==!1||n<0?Q():(B=!1,x=!1)},Q=function(){if(B=x,!!B){T(1);var W=v[r].delay*10;W||(W=100);var we=m();we===0?(W+=G,setTimeout(K,W)):setTimeout(Q,W)}};return function(){B||setTimeout(Q,0)}}(),z=function(){var B;r=parseInt(r,10),r>v.length-1&&(r=0),r<0&&(r=0),B=I[r],F.getContext("2d").putImageData(v[r].data,B.x,B.y),w.globalCompositeOperation="copy",w.drawImage(F,0,0)},Z=function(){x=!0,b()},J=function(){x=!1};return{init:function(){S||(e.c_w&&e.c_h||w.scale(y(),y()),e.auto_play?b():(r=0,z()))},step:b,play:Z,pause:J,playing:x,move_relative:T,current_frame:function(){return r},length:function(){return v.length},move_to:function(B){r=B,z()}}}(),ne=function(r){te(_.pos,_.data.length,r)},oe=function(){},H=function(r,n){return function(h){r(h),ne(n)}},ye={hdr:H(he),gce:H(_e),com:H(oe),app:{NETSCAPE:H(oe)},img:H(ge,!0),eof:function(r){ae(),ne(!1),e.c_w&&e.c_h||(C.width=l.width*y(),C.height=l.height*y()),N.init(),A=!1,k&&k(s)}},ie=function(){var r=s.parentNode,n=document.createElement("div");C=document.createElement("canvas"),w=C.getContext("2d"),U=document.createElement("div"),F=document.createElement("canvas"),n.width=C.width=s.width,n.height=C.height=s.height,U.style.minWidth=s.width+"px",n.className="jsgif",U.className="jsgif_toolbar",n.appendChild(C),n.appendChild(U),r.insertBefore(n,s),r.removeChild(s),e.c_w&&e.c_h&&re(e.c_w,e.c_h),X=!0},y=function(){var r;return e.max_width&&l&&l.width>e.max_width?r=e.max_width/l.width:r=1,r},C,w,U,F,X=!1,k=!1,se=function(r){return A?!1:(r?k=r:k=!1,A=!0,v=[],$(),i=null,c=null,u=null,g=null,!0)};return{play:N.play,pause:N.pause,move_relative:N.move_relative,move_to:N.move_to,get_playing:function(){return x},get_canvas:function(){return C},get_canvas_scale:function(){return y()},get_loading:function(){return A},get_auto_play:function(){return e.auto_play},get_length:function(){return N.length()},get_current_frame:function(){return N.current_frame()},load_url:function(r,n){if(!!se(n)){var h=new XMLHttpRequest;h.open("GET",r,!0),"overrideMimeType"in h?h.overrideMimeType("text/plain; charset=x-user-defined"):"responseType"in h?h.responseType="arraybuffer":h.setRequestHeader("Accept-Charset","x-user-defined"),h.onloadstart=function(){X||ie()},h.onload=function(f){this.status!=200&&V("xhr - response"),"response"in this||(this.response=new VBArray(this.responseText).toArray().map(String.fromCharCode).join(""));var m=this.response;m.toString().indexOf("ArrayBuffer")>0&&(m=new Uint8Array(m)),_=new Y(m),setTimeout(ee,0)},h.onprogress=function(f){f.lengthComputable&&te(f.loaded,f.total,!0)},h.onerror=function(){V("xhr")},h.send()}},load:function(r){this.load_url(s.getAttribute("rel:animated_src")||s.src,r)},load_raw:function(r,n){!se(n)||(X||ie(),_=new Y(r),setTimeout(ee,0))},set_frame_offset:ve}};return pe});var me=le.SuperGif;})();