mirror of
https://github.com/danog/telegram-tt.git
synced 2024-12-15 18:57:12 +01:00
2 lines
4.8 KiB
JavaScript
2 lines
4.8 KiB
JavaScript
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return n}));e.env.APP_VERSION;const n=!1;new Set(["newMessage","newScheduledMessage","deleteMessages","deleteScheduledMessages","deleteHistory"]),"undefined"!=typeof window&&window.innerHeight}).call(this,r(1))},function(e,t){var r,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var u,c=[],l=!1,d=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):d=-1,c.length&&m())}function m(){if(!l){var e=a(f);l=!0;for(var t=c.length;t;){for(u=c,c=[];++d<t;)u&&u[d].run();d=-1,t=c.length}u=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function h(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new p(e,t)),1!==c.length||l||a(m)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=h,o.addListener=h,o.once=h,o.off=h,o.removeListener=h,o.removeAllListeners=h,o.emit=h,o.prependListener=h,o.prependOnceListener=h,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,r){"use strict";r.r(t);var n=r(0);self.onerror=e=>{console.error(e),i({type:"unhandledError",error:{message:e.error.message||"Uncaught exception in worker"}})},self.addEventListener("unhandledrejection",e=>{console.error(e),i({type:"unhandledError",error:{message:e.reason.message||"Uncaught rejection in worker"}})});const o=new Map;function i(e,t){t?postMessage(e,t):postMessage(e)}let s;self.importScripts("rlottie-wasm.js");const a=new Promise(e=>{Module.onRuntimeInitialized=()=>{s={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()}}),u=new Map;var c;c={init:async function(e,t,r,n,o,i){s||await a;const c=JSON.stringify(t),l=allocate(intArrayFromString(c),"i8",0),d=s.init(),f=s.loadFromData(d,l);s.resize(d,r,r),u.set(e,{imgSize:r,reduceFactor:o,handle:d}),i(Math.ceil(f/o))},renderFrames:async function(e,t,r,n){s||await a;const{imgSize:o,reduceFactor:i,handle:c}=u.get(e);for(let e=t;e<=r;e++){const t=e*i;s.render(c,t);const r=s.buffer(c),a=Module.HEAPU8.subarray(r,r+o*o*4);n(e,new Uint8ClampedArray(a).buffer)}},destroy:function(e){const t=u.get(e);s.destroy(t.handle),u.delete(e)}},onmessage=async e=>{const{data:t}=e;switch(t.type){case"callMethod":{const{messageId:e,name:r,args:s}=t;try{if(e){const t=(...t)=>{const r=t[t.length-1];i({type:"methodCallback",messageId:e,callbackArgs:t},r instanceof ArrayBuffer?[r]:void 0)};o.set(e,t),s.push(t)}const[t,n]=await c[r](...s)||[];e&&i({type:"methodResponse",messageId:e,response:t},n)}catch(t){n.a&&console.error(t),e&&i({type:"methodResponse",messageId:e,error:{message:t.message}})}e&&o.delete(e);break}case"cancelProgress":{const e=o.get(t.messageId);e&&(e.isCanceled=!0);break}}}}]);
|
|
//# sourceMappingURL=d4b2f5604ae145bf131b.worker.js.map
|