@myoc/element 0.19.544 → 0.19.545
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev/gif.worker.js +321 -0
- package/dist/dev/gif.worker.js.map +7 -0
- package/dist/dev/index.js +334 -500
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/squoosh_gif_bg.wasm +0 -0
- package/dist/prod/gif.worker.js +1 -0
- package/dist/prod/index.js +16 -16
- package/dist/prod/squoosh_gif_bg.wasm +0 -0
- package/dist/types/element/src/gif.worker.d.ts +1 -0
- package/package.json +6 -6
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var l=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,D.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,D.unregister(this),t}free(){let t=this.__destroy_into_raw();i.__wbg_gifframe_free(t,0)}get duration(){return i.gifframe_duration(this.__wbg_ptr)>>>0}get imageData(){let t=i.gifframe_imageData(this.__wbg_ptr);return b(t)}};Symbol.dispose&&(l.prototype[Symbol.dispose]=l.prototype.free);function M(e){try{let a=i.__wbindgen_add_to_stack_pointer(-16),o=O(e,i.__wbindgen_malloc),_=R;i.decodeAnimated(a,o,_);var t=y().getInt32(a+4*0,!0),n=y().getInt32(a+4*1,!0),r=x(t,n).slice();return i.__wbindgen_free(t,n*4,4),r}finally{i.__wbindgen_add_to_stack_pointer(16)}}function G(){return{__proto__:null,"./squoosh_gif_bg.js":{__proto__:null,__wbg___wbindgen_throw_9c31b086c2b26051:function(t,n){throw new Error(j(t,n))},__wbg_gifframe_new:function(t){let n=l.__wrap(t);return p(n)},__wbg_new_with_owned_u8_clamped_array_and_sh_9b06742b45807291:function(t,n,r,a){var o=U(t,n).slice();i.__wbindgen_free(t,n*1,1);let _=new ImageData(o,r>>>0,a>>>0);return p(_)},__wbindgen_object_clone_ref:function(t){let n=I(t);return p(n)},__wbindgen_object_drop_ref:function(t){b(t)}}}}var D=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>i.__wbg_gifframe_free(e,1));function p(e){d===s.length&&s.push(s.length+1);let t=d;return d=s[t],s[t]=e,t}function S(e){e<1028||(s[e]=d,d=e)}function x(e,t){e=e>>>0;let n=y(),r=[];for(let a=e;a<e+4*t;a+=4)r.push(b(n.getUint32(a,!0)));return r}function U(e,t){return e=e>>>0,v().subarray(e/1,e/1+t)}var c=null;function y(){return(c===null||c.buffer.detached===!0||c.buffer.detached===void 0&&c.buffer!==i.memory.buffer)&&(c=new DataView(i.memory.buffer)),c}function j(e,t){return E(e>>>0,t)}var f=null;function F(){return(f===null||f.byteLength===0)&&(f=new Uint8Array(i.memory.buffer)),f}var u=null;function v(){return(u===null||u.byteLength===0)&&(u=new Uint8ClampedArray(i.memory.buffer)),u}function I(e){return s[e]}var s=new Array(1024).fill(void 0);s.push(void 0,null,!0,!1);var d=s.length;function O(e,t){let n=t(e.length*1,1)>>>0;return F().set(e,n/1),R=e.length,n}function b(e){let t=I(e);return S(e),t}var g=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});g.decode();var T=2146435072,m=0;function E(e,t){return m+=t,m>=T&&(g=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),g.decode(),m=t),g.decode(F().subarray(e,e+t))}var R=0,C,B,i;function L(e,t){return B=e,i=e.exports,C=t,c=null,f=null,u=null,i}async function q(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(a){if(e.ok&&n(e.type)&&e.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",a);else throw a}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let r=await WebAssembly.instantiate(e,t);return r instanceof WebAssembly.Instance?{instance:r,module:e}:r}function n(r){switch(r){case"basic":case"cors":case"default":return!0}return!1}}async function k(e){if(i!==void 0)return i;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),e===void 0&&(e=new URL("squoosh_gif_bg.wasm",import.meta.url));let t=G();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await q(await e,t);return L(n,r)}var V=globalThis.ServiceWorkerGlobalScope!==void 0,z=V&&typeof self<"u"&&globalThis.caches&&globalThis.caches.default!==void 0,N=typeof process=="object"&&process.release&&process.release.name==="node";(z||N)&&(globalThis.ImageData||(globalThis.ImageData=class{constructor(t,n,r){this.data=t,this.width=n,this.height=r}}),import.meta.url===void 0&&(import.meta.url="https://localhost"),typeof self<"u"&&self.location===void 0&&(self.location={href:""}));var h;function P(e){let t=new Uint8Array(e,0,6),n=String.fromCharCode(...t);if(n!=="GIF87a"&&n!=="GIF89a")throw new Error(`Not a valid GIF file (expected GIF87a/GIF89a header, got "${n.replace(/[^\x20-\x7E]/g,"?")}")`)}async function H(e){return h||(h=k(e)),h}async function A(e){P(e),await H();let t=M(new Uint8Array(e));if(!t)throw new Error("Decoding error");return t}var W=globalThis,J=e=>{if(e.byteLength<10)return null;let t=new DataView(e);return{width:t.getUint16(6,!0),height:t.getUint16(8,!0)}},X=e=>e instanceof Error?e.message:String(e);W.onmessage=async e=>{let t=[];try{let n=J(e.data);t=await A(e.data);let r=t.map(a=>{let o=a.imageData;return{width:o.width,height:o.height,delay:a.duration,data:o.data.buffer}});W.postMessage({type:"success",frames:r,width:n?.width??t[0]?.imageData.width??0,height:n?.height??t[0]?.imageData.height??0},r.map(a=>a.data))}catch(n){W.postMessage({type:"error",message:X(n)})}finally{t.forEach(n=>n.free())}};
|