2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
(()=>{"use strict";var e,t,r={3023:(e,t,r)=>{e.exports=r.p+"rlottie-wasm.f013598f1b2ba719f25e.js"},37836:(e,t,r)=>{function a(e){return function(e,t){let r,a=!1;return(...o)=>{r=o,a||(a=!0,e((()=>{a=!1,t(...r)})))}}(s,e)}r.d(t,{Fe:()=>a,v7:()=>o});const o=e=>new Promise((t=>{setTimeout((()=>t()),e)}));let i;function s(e){i?i.push(e):(i=[e],Promise.resolve().then((()=>{const e=i;i=void 0,e.forEach((e=>e()))})))}},49443:(e,t,r)=>{var a=r(87784),o=r(49357);let i;importScripts(new URL(r(3023),r.b));const s=new Promise((e=>{Module.onRuntimeInitialized=()=>{i={init:Module.cwrap("lottie_init","",[]),destroy:Module.cwrap("lottie_destroy","",["number"]),resize:Module.cwrap("lottie_resize","",["number","number","number"]),buffer:Module.cwrap("lottie_buffer","number",["number"]),render:Module.cwrap("lottie_render","",["number","number"]),loadFromData:Module.cwrap("lottie_load_from_data","number",["number","number"])},e()}})),n=new Map;async function c(e){const t=await fetch(e),r=t.headers.get("Content-Type");if(r?.startsWith("text/"))return t.text();const o=await t.arrayBuffer();return(0,a.inflate)(o,{to:"string"})}function l(e,t,r){const a=t?30:60,o=JSON.parse(e).fr||a,i=o%a===0?o/a:1;return{reduceFactor:i,msPerFrame:1e3/(o/i),reducedFramesCount:Math.ceil(r/i)}}const d={"rlottie:init":async function(e,t,r,a,o,d){i||await s;const u=await c(t),f=allocate(intArrayFromString(u),"i8",0),m=i.init(),h=i.loadFromData(m,f);i.resize(m,r,r);const p=new ImageData(r,r),{reduceFactor:g,msPerFrame:w,reducedFramesCount:v}=l(u,a,h);n.set(e,{imgSize:r,reduceFactor:g,handle:m,imageData:p,customColor:o}),d(g,w,v)},"rlottie:changeData":async function(e,t,r,a){i||await s;const o=await c(t),d=allocate(intArrayFromString(o),"i8",0),{handle:u}=n.get(e),f=i.loadFromData(u,d),{reduceFactor:m,msPerFrame:h,reducedFramesCount:p}=l(o,r,f);a(m,h,p)},"rlottie:renderFrames":async function(e,t,r){i||await s;const{imgSize:a,reduceFactor:o,handle:c,imageData:l,customColor:d}=n.get(e),u=t*o;i.render(c,u);const f=i.buffer(c),m=Module.HEAPU8.subarray(f,f+a*a*4);if(d){const e=new Uint8ClampedArray(m);!function(e,t){for(let r=0;r<e.length;r+=4)e[r]=t[0],e[r+1]=t[1],e[r+2]=t[2]}(e,d),l.data.set(e)}else l.data.set(m);r(t,await createImageBitmap(l))},"rlottie:destroy":function e(t,r=!1){try{const e=n.get(t);i.destroy(e.handle),n.delete(t)}catch(a){r||setTimeout((()=>e(t,!0)),1e3)}}};(0,o.C)(d,"media");var u=r(65905),f=r(37836);const m=new Map;self.addEventListener("message",(e=>{const{type:t,messageId:r,result:a}=e.data;if("partResponse"===t){const e=m.get(r);e&&e.resolve(a)}}));const h=1024;var p=function(e){return e.loading="loading",e.ready="ready",e.closed="closed",e}(p||{});class g{status=p.loading;decodedSamples=new Set;lastSample=0;constructor(e,{onConfig:t,onChunk:r,stepOffset:a,stepMultiplier:o,isPolyfill:i,maxFrames:s}){this.url=e,this.stepOffset=a,this.stepMultiplier=o,this.maxFrames=s,this.isPolyfill=i,this.onConfig=t,this.onChunk=r,this.file=u.createFile(),this.file.onError=e=>{console.error(e)},this.file.onReady=this.onReady.bind(this),this.file.onSamples=this.onSamples.bind(this),this.loadMetadata()}async loadMetadata(){let e=0;for(;void 0!==e;){try{e=await this.requestPart(e,131072)}catch(e){console.error(e)}if(this.status===p.ready)break}}async loadNextFrames(e,t,r){let a=e*this.stepOffset,o=0,i=this.file.seek(a,!0);for(;this.status!==p.closed;)try{if(await this.requestPart(i.offset,r),a>t)break;this.lastSample>1&&o<this.lastSample&&(a+=e*this.stepMultiplier,o=this.lastSample),i=this.file.seek(a,!0)}catch(e){console.error(e)}this.file.flush()}async requestPart(e,t,r=!0){const a=e%h,o=e-a,i=o+t-1;let s=await function(e){const t=Date.now().toString(36)+Math.random().toString(36).slice(2),r={};let a=!1;const o=Promise.race([(0,f.v7)(3e4).then((()=>a?void 0:Promise.reject(new Error("ERROR_PART_TIMEOUT")))),new Promise(((e,t)=>{Object.assign(r,{resolve:e,reject:t})}))]);return m.set(t,r),o.catch((()=>{})).finally((()=>{m.delete(t),a=!0})),postMessage({type:"requestPart",messageId:t,params:e}),o}({url:this.url,start:o,end:i});if(!s)return;a&&(s=s.slice(a)),s.fileStart=e;const n=this.file.appendBuffer(s);return r?n:e+s.byteLength}description(e){const t=this.file.getTrackById(e.id);for(const e of t.mdia.minf.stbl.stsd.entries)if(e.avcC||e.hvcC||e.av1C){const t=new u.DataStream(void 0,0,u.DataStream.BIG_ENDIAN);return e.avcC?e.avcC.write(t):e.hvcC?e.hvcC.write(t):e.av1C&&e.av1C.write(t),new Uint8Array(t.buffer,8)}throw new Error("avcC, hvcC ro av1C not found")}onReady(e){const t=e.videoTracks[0];let r=t.codec;r.startsWith("avc1")&&(r="avc1.4d001f"),this.onConfig({codec:r,codedHeight:t.video.height,codedWidth:t.video.width,description:this.description(t)});const a=e.duration/e.timescale,o=this.isPolyfill?24:12,i=(s=t.bitrate/o)+h-s%h;var s;const n=function(e,t){return Math.round((e+t)/t)}(a,this.maxFrames);this.file.setExtractionOptions(t.id,void 0,{nbSamples:1}),this.file.start(),this.status=p.ready,this.loadNextFrames(n,a,i)}onSamples(e,t,r){if(this.status===p.ready)for(const t of r){const r=t.cts/t.timescale,a=t.is_sync?"key":"delta",o=`${a}${t.number}`;this.decodedSamples.has(o)||(this.onChunk(new EncodedVideoChunk({type:a,timestamp:1e6*r,duration:1e6*t.duration/t.timescale,data:t.data})),this.decodedSamples.add(o),this.lastSample=parseInt(t.number,10),t.is_sync&&this.file.releaseUsedSamples(e,t.number))}}close(){this.file.flush(),this.file.stop(),this.status=p.closed}}let w,v,b;const y={"video-preview:init":function(e,t,r,a,o){const i="VideoDecoder"in globalThis;if(!i)return console.log("[Video Preview] WebCodecs not supported"),new Promise((e=>{b=e}));const s=new Set;return w=new VideoDecoder({async output(e){const t=e.timestamp/1e6,r=Math.floor(t);if(!s.has(r)){const t=await createImageBitmap(e);s.add(r),o(r,t)}e.close()},error(e){console.error("[Video Preview] error",e)}}),v=new g(e,{stepOffset:r,stepMultiplier:a,isPolyfill:!i,maxFrames:t,onConfig(e){w?.configure(e)},onChunk(e){"configured"===w?.state&&w?.decode(e)}}),new Promise((e=>{b=e}))},"video-preview:destroy":function(){try{w?.close(),v?.close()}catch{}w=void 0,v=void 0,b?.()}};(0,o.C)(y,"media");const C=[1,57,41,21,203,34,97,73,227,91,149,62,105,45,39,137,241,107,3,173,39,71,65,238,219,101,187,87,81,151,141,133,249,117,221,209,197,187,177,169,5,153,73,139,133,127,243,233,223,107,103,99,191,23,177,171,165,159,77,149,9,139,135,131,253,245,119,231,224,109,211,103,25,195,189,23,45,175,171,83,81,79,155,151,147,9,141,137,67,131,129,251,123,30,235,115,113,221,217,53,13,51,50,49,193,189,185,91,179,175,43,169,83,163,5,79,155,19,75,147,145,143,35,69,17,67,33,65,255,251,247,243,239,59,29,229,113,111,219,27,213,105,207,51,201,199,49,193,191,47,93,183,181,179,11,87,43,85,167,165,163,161,159,157,155,77,19,75,37,73,145,143,141,35,138,137,135,67,33,131,129,255,63,250,247,61,121,239,237,117,29,229,227,225,111,55,109,216,213,211,209,207,205,203,201,199,197,195,193,48,190,47,93,185,183,181,179,178,176,175,173,171,85,21,167,165,41,163,161,5,79,157,78,154,153,19,75,149,74,147,73,144,143,71,141,140,139,137,17,135,134,133,66,131,65,129,1],S=[0,9,10,10,14,12,14,14,16,15,16,15,16,15,15,17,18,17,12,18,16,17,17,19,19,18,19,18,18,19,19,19,20,19,20,20,20,20,20,20,15,20,19,20,20,20,21,21,21,20,20,20,21,18,21,21,21,21,20,21,17,21,21,21,22,22,21,22,22,21,22,21,19,22,22,19,20,22,22,21,21,21,22,22,22,18,22,22,21,22,22,23,22,20,23,22,22,23,23,21,19,21,21,21,23,23,23,22,23,23,21,23,22,23,18,22,23,20,22,23,23,23,21,22,20,22,21,22,24,24,24,24,24,22,21,24,23,23,24,21,24,23,24,22,24,24,22,24,24,22,23,24,24,24,20,23,22,23,24,24,24,24,24,24,24,23,21,23,22,23,24,24,24,22,24,24,24,23,22,24,24,25,23,25,25,23,24,25,25,24,22,25,25,25,24,23,24,25,25,25,25,25,25,25,25,25,25,25,25,23,25,23,24,25,25,25,25,25,25,25,25,25,24,22,25,25,23,25,25,20,24,25,24,25,25,22,24,25,24,25,24,25,25,24,25,25,25,25,22,25,25,25,24,25,24,25,18];async function P(e){const t=await fetch(e),r=await t.blob();return createImageBitmap(r)}const F={"offscreen-canvas:blurThumb":async function(e,t,r){const a=t.startsWith("data:")?await function(e){const t=atob(e.split(",")[1]),r=e.split(",")[0].split(":")[1].split(";")[0],a=new ArrayBuffer(t.length),o=new Uint8Array(a);for(let e=0;e<t.length;e++)o[e]=t.charCodeAt(e);const i=new Blob([a],{type:r});return createImageBitmap(i)}(t):await P(t),{width:o,height:i}=e,s=e.getContext("2d"),n="filter"in s;n&&(s.filter=`blur(${r}px)`),s.drawImage(a,2*-r,2*-r,o+4*r,i+4*r),n||function(e,t,r,a,o,i,s){if(Number.isNaN(i)||i<1)return;i|=0,Number.isNaN(s)&&(s=1),(s|=0)>3&&(s=3),s<1&&(s=1);const n=e.getImageData(0,0,a,o),c=n.data;let l,d,u,f,m,h,p,g,w,v,b,y,P=a-1,F=o-1,x=i+1,M=[],I=[],O=[],k=C[i],D=S[i],_=[],T=[];for(;s-- >0;){for(y=b=0,m=0;m<o;m++){for(l=c[y]*x,d=c[y+1]*x,u=c[y+2]*x,h=1;h<=i;h++)p=y+((h>P?P:h)<<2),l+=c[p++],d+=c[p++],u+=c[p++];for(f=0;f<a;f++)M[b]=l,I[b]=d,O[b]=u,0==m&&(_[f]=((p=f+x)<P?p:P)<<2,T[f]=(p=f-i)>0?p<<2:0),g=y+_[f],w=y+T[f],l+=c[g++]-c[w++],d+=c[g++]-c[w++],u+=c[g++]-c[w++],b++;y+=a<<2}for(f=0;f<a;f++){for(v=f,l=M[v]*x,d=I[v]*x,u=O[v]*x,h=1;h<=i;h++)v+=h>F?0:a,l+=M[v],d+=I[v],u+=O[v];for(b=f<<2,m=0;m<o;m++)c[b]=l*k>>>D,c[b+1]=d*k>>>D,c[b+2]=u*k>>>D,0==f&&(_[m]=((p=m+x)<F?p:F)*a,T[m]=(p=m-i)>0?p*a:0),g=f+_[m],w=f+T[m],l+=M[g]-M[w],d+=I[g]-I[w],u+=O[g]-O[w],b+=a<<2}}e.putImageData(n,0,0)}(s,0,0,o,i,r,2)},"offscreen-canvas:getAppendixColorFromImage":async function(e,t){const r=await P(e),{width:a,height:o}=r,i=new OffscreenCanvas(a,o).getContext("2d");i.drawImage(r,0,0,a,o);const s=t?a-1:0,n=o-1;return`rgba(${Array.from(i.getImageData(s,n,1,1).data).join(",")})`}};(0,o.C)(F,"media")}},a={};function o(e){var t=a[e];if(void 0!==t)return t.exports;var i=a[e]={exports:{}};return r[e].call(i.exports,i,i.exports,o),i.exports}o.m=r,o.x=()=>{var e=o.O(void 0,[7784,5905,9357],(()=>o(49443)));return o.O(e)},e=[],o.O=(t,r,a,i)=>{if(!r){var s=1/0;for(d=0;d<e.length;d++){for(var[r,a,i]=e[d],n=!0,c=0;c<r.length;c++)(!1&i||s>=i)&&Object.keys(o.O).every((e=>o.O[e](r[c])))?r.splice(c--,1):(n=!1,i<s&&(s=i));if(n){e.splice(d--,1);var l=a();void 0!==l&&(t=l)}}return t}i=i||0;for(var d=e.length;d>0&&e[d-1][2]>i;d--)e[d]=e[d-1];e[d]=[r,a,i]},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,r)=>(o.f[r](e,t),t)),[])),o.u=e=>e+"."+{5905:"04b286b6eff2126d05dc",7784:"2a486dcaaaf47415a095",9357:"89506103b029b3e748cd"}[e]+".js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var a=r.length-1;a>-1&&(!e||!/^http(s?):/.test(e));)e=r[a--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{o.b=self.location+"";var e={9443:1};o.f.i=(t,r)=>{e[t]||importScripts(o.p+o.u(t))};var t=self.webpackChunktelegram_t=self.webpackChunktelegram_t||[],r=t.push.bind(t);t.push=t=>{var[a,i,s]=t;for(var n in i)o.o(i,n)&&(o.m[n]=i[n]);for(s&&s(o);a.length;)e[a.pop()]=1;r(t)}})(),t=o.x,o.x=()=>Promise.all([7784,5905,9357].map(o.e,o)).then(t),o.x()})();
|
|
//# sourceMappingURL=9443.322b5bd2c39fc3620a4b.js.map
|