telegram-tt/dist/76e9262c236097e81874.worker.js
Alexander Zinchuk 73d2bc0696 [Build]
2021-07-21 17:46:08 +03:00

2 lines
3.1 KiB
JavaScript

!function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=0)}([function(e,r,t){"use strict";t.r(r);"undefined"!=typeof window&&window.innerHeight,Math.round(425),new Set(["newMessage","newScheduledMessage","deleteMessages","deleteScheduledMessages","deleteHistory"]),new Set(["image/png","image/gif","image/jpeg","video/mp4","video/avi","video/quicktime"]);self.onerror=e=>{console.error(e),o({type:"unhandledError",error:{message:e.error.message||"Uncaught exception in worker"}})},self.addEventListener("unhandledrejection",e=>{console.error(e),o({type:"unhandledError",error:{message:e.reason.message||"Uncaught rejection in worker"}})});const n=new Map;function o(e,r){r?postMessage(e,r):postMessage(e)}let a;self.importScripts("rlottie-wasm.js");const s=new Promise(e=>{Module.onRuntimeInitialized=()=>{a={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()}}),i=new Map;var d;d={init:async function(e,r,t,n,o,d){a||await s;const c=JSON.stringify(r),u=allocate(intArrayFromString(c),"i8",0),l=a.init(),f=a.loadFromData(l,u);a.resize(l,t,t),i.set(e,{imgSize:t,reduceFactor:o,handle:l}),d(Math.ceil(f/o))},renderFrames:async function(e,r,t,n){a||await s;const{imgSize:o,reduceFactor:d,handle:c}=i.get(e);for(let e=r;e<=t;e++){const r=e*d;a.render(c,r);const t=a.buffer(c),s=Module.HEAPU8.subarray(t,t+o*o*4);n(e,new Uint8ClampedArray(s).buffer)}},destroy:function(e){const r=i.get(e);a.destroy(r.handle),i.delete(e)}},onmessage=async e=>{const{data:r}=e;switch(r.type){case"callMethod":{const{messageId:e,name:t,args:a}=r;try{if(e){const r=(...r)=>{const t=r[r.length-1];o({type:"methodCallback",messageId:e,callbackArgs:r},t instanceof ArrayBuffer?[t]:void 0)};n.set(e,r),a.push(r)}const[r,s]=await d[t](...a)||[];e&&o({type:"methodResponse",messageId:e,response:r},s)}catch(r){e&&o({type:"methodResponse",messageId:e,error:{message:r.message}})}e&&n.delete(e);break}case"cancelProgress":{const e=n.get(r.messageId);e&&(e.isCanceled=!0);break}}}}]);
//# sourceMappingURL=76e9262c236097e81874.worker.js.map