@contentauth/c2pa-web 0.5.4 → 0.5.5
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { channel as F, transfer as E } from "highgain";
|
|
2
|
-
import { merge as
|
|
3
|
-
const { createTx: j, rx: H } = F(), { createTx: K, rx: z } = F("worker"), I = '(function(){"use strict";let o,S=null;function M(){return(S===null||S.byteLength===0)&&(S=new Uint8Array(o.memory.buffer)),S}let j=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});j.decode();const C=2146435072;let x=0;function V(n,e){return x+=e,x>=C&&(j=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),j.decode(),x=e),j.decode(M().subarray(n,n+e))}function l(n,e){return n=n>>>0,V(n,e)}function y(n){return n==null}let A=null;function m(){return(A===null||A.buffer.detached===!0||A.buffer.detached===void 0&&A.buffer!==o.memory.buffer)&&(A=new DataView(o.memory.buffer)),A}function E(n){const e=typeof n;if(e=="number"||e=="boolean"||n==null)return`${n}`;if(e=="string")return`"${n}"`;if(e=="symbol"){const _=n.description;return _==null?"Symbol":`Symbol(${_})`}if(e=="function"){const _=n.name;return typeof _=="string"&&_.length>0?`Function(${_})`:"Function"}if(Array.isArray(n)){const _=n.length;let c="[";_>0&&(c+=E(n[0]));for(let s=1;s<_;s++)c+=", "+E(n[s]);return c+="]",c}const t=/\\[object ([^\\]]+)\\]/.exec(toString.call(n));let r;if(t&&t.length>1)r=t[1];else return toString.call(n);if(r=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message}\n${n.stack}`:r}let u=0;const R=new TextEncoder;"encodeInto"in R||(R.encodeInto=function(n,e){const t=R.encode(n);return e.set(t),{read:n.length,written:t.length}});function d(n,e,t){if(t===void 0){const i=R.encode(n),b=e(i.length,1)>>>0;return M().subarray(b,b+i.length).set(i),u=i.length,b}let r=n.length,_=e(r,1)>>>0;const c=M();let s=0;for(;s<r;s++){const i=n.charCodeAt(s);if(i>127)break;c[_+s]=i}if(s!==r){s!==0&&(n=n.slice(s)),_=t(_,r,r=s+n.length*3,1)>>>0;const i=M().subarray(_+s,_+r),b=R.encodeInto(n,i);s+=b.written,_=t(_,r,s,1)>>>0}return u=s,_}function T(n){const e=o.__externref_table_alloc();return o.__wbindgen_externrefs.set(e,n),e}function f(n,e){try{return n.apply(this,e)}catch(t){const r=T(t);o.__wbindgen_exn_store(r)}}function I(n,e){return n=n>>>0,M().subarray(n/1,n/1+e)}const O=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>n.dtor(n.a,n.b));function N(n,e,t,r){const _={a:n,b:e,cnt:1,dtor:t},c=(...s)=>{_.cnt++;const i=_.a;_.a=0;try{return r(i,_.b,...s)}finally{_.a=i,c._wbg_cb_unref()}};return c._wbg_cb_unref=()=>{--_.cnt===0&&(_.dtor(_.a,_.b),_.a=0,O.unregister(_))},O.register(c,_,_),c}function a(n){const e=o.__wbindgen_externrefs.get(n);return o.__externref_table_dealloc(n),e}function G(n){const e=d(n,o.__wbindgen_malloc,o.__wbindgen_realloc),t=u,r=o.loadSettings(e,t);if(r[1])throw a(r[0])}function P(n,e,t){o.wasm_bindgen__convert__closures_____invoke__hedbe22ff1e6181ec(n,e,t)}function $(n,e){o.wasm_bindgen__convert__closures_____invoke__hbb73f02d9cb5eeb0(n,e)}function J(n,e,t,r){o.wasm_bindgen__convert__closures_____invoke__h1fd2c9ff95892b8d(n,e,t,r)}const H=["default","no-store","reload","no-cache","force-cache","only-if-cached"],X=["omit","same-origin","include"],Y=["same-origin","no-cors","cors","navigate"],k=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>o.__wbg_wasmbuilder_free(n>>>0,1));class h{static __wrap(e){e=e>>>0;const t=Object.create(h.prototype);return t.__wbg_ptr=e,k.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,k.unregister(this),e}free(){const e=this.__destroy_into_raw();o.__wbg_wasmbuilder_free(e,0)}addAction(e){const t=o.wasmbuilder_addAction(this.__wbg_ptr,e);if(t[1])throw a(t[0])}setIntent(e){const t=o.wasmbuilder_setIntent(this.__wbg_ptr,e);if(t[1])throw a(t[0])}toArchive(){const e=o.wasmbuilder_toArchive(this.__wbg_ptr);if(e[2])throw a(e[1]);return a(e[0])}static fromArchive(e){const t=o.wasmbuilder_fromArchive(e);if(t[2])throw a(t[1]);return h.__wrap(t[0])}setNoEmbed(e){o.wasmbuilder_setNoEmbed(this.__wbg_ptr,e)}addIngredient(e){const t=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),r=u,_=o.wasmbuilder_addIngredient(this.__wbg_ptr,t,r);if(_[1])throw a(_[0])}getDefinition(){const e=o.wasmbuilder_getDefinition(this.__wbg_ptr);if(e[2])throw a(e[1]);return a(e[0])}setRemoteUrl(e){const t=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),r=u;o.wasmbuilder_setRemoteUrl(this.__wbg_ptr,t,r)}addResourceFromBlob(e,t){const r=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u,c=o.wasmbuilder_addResourceFromBlob(this.__wbg_ptr,r,_,t);if(c[1])throw a(c[0])}setThumbnailFromBlob(e,t){const r=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u,c=o.wasmbuilder_setThumbnailFromBlob(this.__wbg_ptr,r,_,t);if(c[1])throw a(c[0])}addIngredientFromBlob(e,t,r){const _=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u,s=d(t,o.__wbindgen_malloc,o.__wbindgen_realloc),i=u,b=o.wasmbuilder_addIngredientFromBlob(this.__wbg_ptr,_,c,s,i,r);if(b[1])throw a(b[0])}signAndGetManifestBytes(e,t,r){const _=d(t,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;return o.wasmbuilder_signAndGetManifestBytes(this.__wbg_ptr,e,_,c,r)}static new(){const e=o.wasmbuilder_new();if(e[2])throw a(e[1]);return h.__wrap(e[0])}sign(e,t,r){const _=d(t,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;return o.wasmbuilder_sign(this.__wbg_ptr,e,_,c,r)}static fromJson(e){const t=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),r=u,_=o.wasmbuilder_fromJson(t,r);if(_[2])throw a(_[1]);return h.__wrap(_[0])}}Symbol.dispose&&(h.prototype[Symbol.dispose]=h.prototype.free);const z=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>o.__wbg_wasmreader_free(n>>>0,1));class v{static __wrap(e){e=e>>>0;const t=Object.create(v.prototype);return t.__wbg_ptr=e,z.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,z.unregister(this),e}free(){const e=this.__destroy_into_raw();o.__wbg_wasmreader_free(e,0)}activeLabel(){const e=o.wasmreader_activeLabel(this.__wbg_ptr);let t;return e[0]!==0&&(t=l(e[0],e[1]).slice(),o.__wbindgen_free(e[0],e[1]*1,1)),t}manifestStore(){const e=o.wasmreader_manifestStore(this.__wbg_ptr);if(e[2])throw a(e[1]);return a(e[0])}activeManifest(){const e=o.wasmreader_activeManifest(this.__wbg_ptr);if(e[2])throw a(e[1]);return a(e[0])}resourceToBytes(e){const t=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),r=u,_=o.wasmreader_resourceToBytes(this.__wbg_ptr,t,r);if(_[2])throw a(_[1]);return a(_[0])}static fromBlobFragment(e,t,r){const _=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;return o.wasmreader_fromBlobFragment(_,c,t,r)}json(){let e,t;try{const r=o.wasmreader_json(this.__wbg_ptr);return e=r[0],t=r[1],l(r[0],r[1])}finally{o.__wbindgen_free(e,t,1)}}static fromBlob(e,t){const r=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u;return o.wasmreader_fromBlob(r,_,t)}}Symbol.dispose&&(v.prototype[Symbol.dispose]=v.prototype.free),typeof FinalizationRegistry>"u"||new FinalizationRegistry(n=>o.__wbg_wasmsigner_free(n>>>0,1));function K(){const n={};return n.wbg={},n.wbg.__wbg_Error_e83987f665cf5504=function(e,t){return Error(l(e,t))},n.wbg.__wbg_Number_bb48ca12f395cd08=function(e){return Number(e)},n.wbg.__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd=function(e,t){const r=t,_=typeof r=="bigint"?r:void 0;m().setBigInt64(e+8,y(_)?BigInt(0):_,!0),m().setInt32(e+0,!y(_),!0)},n.wbg.__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68=function(e){const t=e,r=typeof t=="boolean"?t:void 0;return y(r)?16777215:r?1:0},n.wbg.__wbg___wbindgen_debug_string_df47ffb5e35e6763=function(e,t){const r=E(t),_=d(r,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},n.wbg.__wbg___wbindgen_in_bb933bd9e1b3bc0f=function(e,t){return e in t},n.wbg.__wbg___wbindgen_is_bigint_cb320707dcd35f0b=function(e){return typeof e=="bigint"},n.wbg.__wbg___wbindgen_is_function_ee8a6c5833c90377=function(e){return typeof e=="function"},n.wbg.__wbg___wbindgen_is_object_c818261d21f283a4=function(e){const t=e;return typeof t=="object"&&t!==null},n.wbg.__wbg___wbindgen_is_string_fbb76cb2940daafd=function(e){return typeof e=="string"},n.wbg.__wbg___wbindgen_is_undefined_2d472862bd29a478=function(e){return e===void 0},n.wbg.__wbg___wbindgen_jsval_eq_6b13ab83478b1c50=function(e,t){return e===t},n.wbg.__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147=function(e,t){return e==t},n.wbg.__wbg___wbindgen_number_get_a20bf9b85341449d=function(e,t){const r=t,_=typeof r=="number"?r:void 0;m().setFloat64(e+8,y(_)?0:_,!0),m().setInt32(e+0,!y(_),!0)},n.wbg.__wbg___wbindgen_string_get_e4f06c90489ad01b=function(e,t){const r=t,_=typeof r=="string"?r:void 0;var c=y(_)?0:d(_,o.__wbindgen_malloc,o.__wbindgen_realloc),s=u;m().setInt32(e+4,s,!0),m().setInt32(e+0,c,!0)},n.wbg.__wbg___wbindgen_throw_b855445ff6a94295=function(e,t){throw new Error(l(e,t))},n.wbg.__wbg__wbg_cb_unref_2454a539ea5790d9=function(e){e._wbg_cb_unref()},n.wbg.__wbg_abort_28ad55c5825b004d=function(e,t){e.abort(t)},n.wbg.__wbg_abort_e7eb059f72f9ed0c=function(e){e.abort()},n.wbg.__wbg_append_b577eb3a177bc0fa=function(){return f(function(e,t,r,_,c){e.append(l(t,r),l(_,c))},arguments)},n.wbg.__wbg_arrayBuffer_b375eccb84b4ddf3=function(){return f(function(e){return e.arrayBuffer()},arguments)},n.wbg.__wbg_byteLength_bcd42e4025299788=function(e){return e.byteLength},n.wbg.__wbg_call_525440f72fbfc0ea=function(){return f(function(e,t,r){return e.call(t,r)},arguments)},n.wbg.__wbg_call_e762c39fa8ea36bf=function(){return f(function(e,t){return e.call(t)},arguments)},n.wbg.__wbg_clearTimeout_7a42b49784aea641=function(e){return clearTimeout(e)},n.wbg.__wbg_crypto_574e78ad8b13b65f=function(e){return e.crypto},n.wbg.__wbg_done_2042aa2670fb1db1=function(e){return e.done},n.wbg.__wbg_entries_e171b586f8f6bdbf=function(e){return Object.entries(e)},n.wbg.__wbg_error_7534b8e9a36f1ab4=function(e,t){let r,_;try{r=e,_=t,console.error(l(e,t))}finally{o.__wbindgen_free(r,_,1)}},n.wbg.__wbg_fetch_74a3e84ebd2c9a0e=function(e){return fetch(e)},n.wbg.__wbg_fetch_f8ba0e29a9d6de0d=function(e,t){return e.fetch(t)},n.wbg.__wbg_from_a4ad7cbddd0d7135=function(e){return Array.from(e)},n.wbg.__wbg_getRandomValues_38a1ff1ea09f6cc7=function(){return f(function(e,t){globalThis.crypto.getRandomValues(I(e,t))},arguments)},n.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e=function(){return f(function(e,t){e.getRandomValues(t)},arguments)},n.wbg.__wbg_getTime_14776bfb48a1bff9=function(e){return e.getTime()},n.wbg.__wbg_get_7bed016f185add81=function(e,t){return e[t>>>0]},n.wbg.__wbg_get_efcb449f58ec27c2=function(){return f(function(e,t){return Reflect.get(e,t)},arguments)},n.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe=function(e,t){return e[t]},n.wbg.__wbg_has_787fafc980c3ccdb=function(){return f(function(e,t){return Reflect.has(e,t)},arguments)},n.wbg.__wbg_headers_b87d7eaba61c3278=function(e){return e.headers},n.wbg.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38=function(e){let t;try{t=e instanceof ArrayBuffer}catch{t=!1}return t},n.wbg.__wbg_instanceof_Map_8579b5e2ab5437c7=function(e){let t;try{t=e instanceof Map}catch{t=!1}return t},n.wbg.__wbg_instanceof_Promise_001fdd42afa1b7ef=function(e){let t;try{t=e instanceof Promise}catch{t=!1}return t},n.wbg.__wbg_instanceof_Response_f4f3e87e07f3135c=function(e){let t;try{t=e instanceof Response}catch{t=!1}return t},n.wbg.__wbg_instanceof_Uint8Array_20c8e73002f7af98=function(e){let t;try{t=e instanceof Uint8Array}catch{t=!1}return t},n.wbg.__wbg_isArray_96e0af9891d0945d=function(e){return Array.isArray(e)},n.wbg.__wbg_isSafeInteger_d216eda7911dde36=function(e){return Number.isSafeInteger(e)},n.wbg.__wbg_iterator_e5822695327a3c39=function(){return Symbol.iterator},n.wbg.__wbg_length_69bca3cb64fc8748=function(e){return e.length},n.wbg.__wbg_length_cdd215e10d9dd507=function(e){return e.length},n.wbg.__wbg_msCrypto_a61aeb35a24c1329=function(e){return e.msCrypto},n.wbg.__wbg_new_0_f9740686d739025c=function(){return new Date},n.wbg.__wbg_new_0d96c0bf6ceac0b0=function(){return f(function(){return new FileReaderSync},arguments)},n.wbg.__wbg_new_1acc0b6eea89d040=function(){return new Object},n.wbg.__wbg_new_2531773dac38ebb3=function(){return f(function(){return new AbortController},arguments)},n.wbg.__wbg_new_3c3d849046688a66=function(e,t){try{var r={a:e,b:t},_=(s,i)=>{const b=r.a;r.a=0;try{return J(b,r.b,s,i)}finally{r.a=b}};return new Promise(_)}finally{r.a=r.b=0}},n.wbg.__wbg_new_5a79be3ab53b8aa5=function(e){return new Uint8Array(e)},n.wbg.__wbg_new_68651c719dcda04e=function(){return new Map},n.wbg.__wbg_new_8a6f238a6ece86ea=function(){return new Error},n.wbg.__wbg_new_9edf9838a2def39c=function(){return f(function(){return new Headers},arguments)},n.wbg.__wbg_new_a7442b4b19c1a356=function(e,t){return new Error(l(e,t))},n.wbg.__wbg_new_e17d9f43105b08be=function(){return new Array},n.wbg.__wbg_new_from_slice_92f4d78ca282a2d2=function(e,t){return new Uint8Array(I(e,t))},n.wbg.__wbg_new_no_args_ee98eee5275000a4=function(e,t){return new Function(l(e,t))},n.wbg.__wbg_new_with_length_01aa0dc35aa13543=function(e){return new Uint8Array(e>>>0)},n.wbg.__wbg_new_with_str_and_init_0ae7728b6ec367b1=function(){return f(function(e,t,r){return new Request(l(e,t),r)},arguments)},n.wbg.__wbg_next_020810e0ae8ebcb0=function(){return f(function(e){return e.next()},arguments)},n.wbg.__wbg_next_2c826fe5dfec6b6a=function(e){return e.next},n.wbg.__wbg_node_905d3e251edff8a2=function(e){return e.node},n.wbg.__wbg_now_793306c526e2e3b6=function(){return Date.now()},n.wbg.__wbg_process_dc0fbacc7c1c06f7=function(e){return e.process},n.wbg.__wbg_prototypesetcall_2a6620b6922694b2=function(e,t,r){Uint8Array.prototype.set.call(I(e,t),r)},n.wbg.__wbg_queueMicrotask_34d692c25c47d05b=function(e){return e.queueMicrotask},n.wbg.__wbg_queueMicrotask_9d76cacb20c84d58=function(e){queueMicrotask(e)},n.wbg.__wbg_randomFillSync_ac0988aba3254290=function(){return f(function(e,t){e.randomFillSync(t)},arguments)},n.wbg.__wbg_readAsArrayBuffer_36927e3348e676c3=function(){return f(function(e,t){return e.readAsArrayBuffer(t)},arguments)},n.wbg.__wbg_require_60cc747a6bc5215a=function(){return f(function(){return module.require},arguments)},n.wbg.__wbg_resolve_caf97c30b83f7053=function(e){return Promise.resolve(e)},n.wbg.__wbg_setTimeout_7bb3429662ab1e70=function(e,t){return setTimeout(e,t)},n.wbg.__wbg_set_3f1d0b984ed272ed=function(e,t,r){e[t]=r},n.wbg.__wbg_set_907fb406c34a251d=function(e,t,r){return e.set(t,r)},n.wbg.__wbg_set_9e6516df7b7d0f19=function(e,t,r){e.set(I(t,r))},n.wbg.__wbg_set_body_3c365989753d61f4=function(e,t){e.body=t},n.wbg.__wbg_set_c213c871859d6500=function(e,t,r){e[t>>>0]=r},n.wbg.__wbg_set_cache_2f9deb19b92b81e3=function(e,t){e.cache=H[t]},n.wbg.__wbg_set_credentials_f621cd2d85c0c228=function(e,t){e.credentials=X[t]},n.wbg.__wbg_set_headers_6926da238cd32ee4=function(e,t){e.headers=t},n.wbg.__wbg_set_method_c02d8cbbe204ac2d=function(e,t,r){e.method=l(t,r)},n.wbg.__wbg_set_mode_52ef73cfa79639cb=function(e,t){e.mode=Y[t]},n.wbg.__wbg_set_signal_dda2cf7ccb6bee0f=function(e,t){e.signal=t},n.wbg.__wbg_signal_4db5aa055bf9eb9a=function(e){return e.signal},n.wbg.__wbg_size_0a5a003dbf5dfee8=function(e){return e.size},n.wbg.__wbg_slice_4947c0e051116da5=function(){return f(function(e,t,r){return e.slice(t,r)},arguments)},n.wbg.__wbg_stack_0ed75d68575b0f3c=function(e,t){const r=t.stack,_=d(r,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},n.wbg.__wbg_static_accessor_GLOBAL_89e1d9ac6a1b250e=function(){const e=typeof global>"u"?null:global;return y(e)?0:T(e)},n.wbg.__wbg_static_accessor_GLOBAL_THIS_8b530f326a9e48ac=function(){const e=typeof globalThis>"u"?null:globalThis;return y(e)?0:T(e)},n.wbg.__wbg_static_accessor_SELF_6fdf4b64710cc91b=function(){const e=typeof self>"u"?null:self;return y(e)?0:T(e)},n.wbg.__wbg_static_accessor_WINDOW_b45bfc5a37f6cfa2=function(){const e=typeof window>"u"?null:window;return y(e)?0:T(e)},n.wbg.__wbg_status_de7eed5a7a5bfd5d=function(e){return e.status},n.wbg.__wbg_stringify_b5fb28f6465d9c3e=function(){return f(function(e){return JSON.stringify(e)},arguments)},n.wbg.__wbg_subarray_480600f3d6a9f26c=function(e,t,r){return e.subarray(t>>>0,r>>>0)},n.wbg.__wbg_then_4f46f6544e6b4a28=function(e,t){return e.then(t)},n.wbg.__wbg_then_70d05cf780a18d77=function(e,t,r){return e.then(t,r)},n.wbg.__wbg_url_b36d2a5008eb056f=function(e,t){const r=t.url,_=d(r,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},n.wbg.__wbg_valueOf_e1f2752ef9caddb2=function(e){return e.valueOf()},n.wbg.__wbg_value_692627309814bb8c=function(e){return e.value},n.wbg.__wbg_versions_c01dfd4722a88165=function(e){return e.versions},n.wbg.__wbg_wasmreader_new=function(e){return v.__wrap(e)},n.wbg.__wbindgen_cast_2241b6af4c4b2941=function(e,t){return l(e,t)},n.wbg.__wbindgen_cast_2ddd8a25ff58642a=function(e,t){return BigInt.asUintN(64,e)|t<<BigInt(64)},n.wbg.__wbindgen_cast_3f8afe4d69afce15=function(e,t){return N(e,t,o.wasm_bindgen__closure__destroy__h4e2af4dd32e0f9a7,P)},n.wbg.__wbindgen_cast_4625c577ab2ec9ee=function(e){return BigInt.asUintN(64,e)},n.wbg.__wbindgen_cast_77bc3e92745e9a35=function(e,t){var r=I(e,t).slice();return o.__wbindgen_free(e,t*1,1),r},n.wbg.__wbindgen_cast_9ae0607507abb057=function(e){return e},n.wbg.__wbindgen_cast_cb9088102bce6b30=function(e,t){return I(e,t)},n.wbg.__wbindgen_cast_d6cd19b81560fd6e=function(e){return e},n.wbg.__wbindgen_cast_eea71553507a2f52=function(e,t){return N(e,t,o.wasm_bindgen__closure__destroy__h3685db4568587cc8,$)},n.wbg.__wbindgen_init_externref_table=function(){const e=o.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)},n}function Q(n,e){return o=n.exports,A=null,S=null,o.__wbindgen_start(),o}function Z(n){if(o!==void 0)return o;typeof n<"u"&&(Object.getPrototypeOf(n)===Object.prototype?{module:n}=n:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const e=K();n instanceof WebAssembly.Module||(n=new WebAssembly.Module(n));const t=new WebAssembly.Instance(n,e);return Q(t)}function D(){let n=0;const e=new Map;return{add(t){const r=n++;return e.set(r,t),r},get(t){const r=e.get(t);if(!r)throw new Error("Attempted to use an object that has been freed");return r},remove(t){return e.delete(t)}}}const L=Symbol("transfer");function F(n,e){return{type:L,value:n,transfer:e?Array.isArray(e)?e:[e]:[n]}}function U(n){return!!(n&&typeof n=="object"&&Reflect.get(n,"type")===L)}function q(n="default"){return{createTx(e){const t=new Map,r=e??self;return r.addEventListener("message",_=>{const{data:c}=_;if(c.channelName!==n)return;const{id:s,result:i,error:b}=c,w=t.get(s);w&&(b?w.reject(b):w.resolve(i),t.delete(s))}),new Proxy({},{get(_,c){return(...s)=>{const i=ee(),b=[],w=[];return s.forEach(B=>{U(B)?(b.push(B.value),w.push(...B.transfer)):b.push(B)}),r.postMessage({method:c,args:b,id:i,channelName:n},{transfer:w}),new Promise((B,re)=>{t.set(i,{resolve:B,reject:re})})}}})},rx(e,t){const r=t??self;r.addEventListener("message",async _=>{const{data:c}=_;if(c.channelName!==n)return;const{method:s,args:i,id:b}=c;try{const w=await e[s](...i);U(w)?r.postMessage({result:w.value,id:b,channelName:n},{transfer:w.transfer}):r.postMessage({result:w,id:b,channelName:n})}catch(w){r.postMessage({error:w,id:b,channelName:n})}})}}}function ee(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const{rx:te}=q(),{createTx:ne}=q("worker"),p=D(),g=D(),W=ne();te({async initWorker(n,e){Z({module:n}),e&&G(e)},async reader_fromBlob(n,e){const t=await v.fromBlob(n,e);return p.add(t)},async reader_fromBlobFragment(n,e,t){const r=await v.fromBlobFragment(n,e,t);return p.add(r)},reader_activeLabel(n){return p.get(n).activeLabel()??null},reader_manifestStore(n){return p.get(n).manifestStore()},reader_activeManifest(n){return p.get(n).activeManifest()},reader_json(n){return p.get(n).json()},reader_resourceToBytes(n,e){const r=p.get(n).resourceToBytes(e);return F(r,r.buffer)},reader_free(n){p.get(n).free(),p.remove(n)},builder_new(){const n=h.new();return g.add(n)},builder_fromJson(n){const e=h.fromJson(n);return g.add(e)},builder_fromArchive(n){const e=h.fromArchive(n);return g.add(e)},builder_setIntent(n,e){g.get(n).setIntent(e)},builder_addAction(n,e){g.get(n).addAction(e)},builder_setRemoteUrl(n,e){g.get(n).setRemoteUrl(e)},builder_setNoEmbed(n,e){g.get(n).setNoEmbed(e)},builder_setThumbnailFromBlob(n,e,t){g.get(n).setThumbnailFromBlob(e,t)},builder_addIngredient(n,e){g.get(n).addIngredient(e)},builder_addIngredientFromBlob(n,e,t,r){g.get(n).addIngredientFromBlob(e,t,r)},builder_addResourceFromBlob(n,e,t){g.get(n).addResourceFromBlob(e,t)},builder_getDefinition(n){return g.get(n).getDefinition()},builder_toArchive(n){const t=g.get(n).toArchive();return F(t,t.buffer)},async builder_sign(n,e,t,r,_){const s=await g.get(n).sign({reserveSize:t.reserveSize,alg:t.alg,sign:async i=>await W.sign(e,F(i,i.buffer),t.reserveSize)},r,_);return F(s,s.buffer)},async builder_signAndGetManifestBytes(n,e,t,r,_){const c=g.get(n),{manifest:s,asset:i}=await c.signAndGetManifestBytes({reserveSize:t.reserveSize,alg:t.alg,sign:async b=>await W.sign(e,F(b,b.buffer),t.reserveSize)},r,_);return F({manifest:s,asset:i},[s.buffer,i.buffer])},builder_free(n){g.get(n).free(),g.remove(n)}})})();\n', l = typeof self < "u" && self.Blob && new Blob([I], { type: "text/javascript;charset=utf-8" });
|
|
4
|
-
function
|
|
2
|
+
import { merge as j } from "ts-deepmerge";
|
|
3
|
+
const { createTx: M, rx: X } = F(), { createTx: K, rx: z } = F("worker"), x = '(function(){"use strict";let o,S=null;function M(){return(S===null||S.byteLength===0)&&(S=new Uint8Array(o.memory.buffer)),S}let j=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});j.decode();const C=2146435072;let x=0;function V(n,e){return x+=e,x>=C&&(j=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),j.decode(),x=e),j.decode(M().subarray(n,n+e))}function l(n,e){return n=n>>>0,V(n,e)}function y(n){return n==null}let A=null;function m(){return(A===null||A.buffer.detached===!0||A.buffer.detached===void 0&&A.buffer!==o.memory.buffer)&&(A=new DataView(o.memory.buffer)),A}function E(n){const e=typeof n;if(e=="number"||e=="boolean"||n==null)return`${n}`;if(e=="string")return`"${n}"`;if(e=="symbol"){const _=n.description;return _==null?"Symbol":`Symbol(${_})`}if(e=="function"){const _=n.name;return typeof _=="string"&&_.length>0?`Function(${_})`:"Function"}if(Array.isArray(n)){const _=n.length;let c="[";_>0&&(c+=E(n[0]));for(let s=1;s<_;s++)c+=", "+E(n[s]);return c+="]",c}const t=/\\[object ([^\\]]+)\\]/.exec(toString.call(n));let r;if(t&&t.length>1)r=t[1];else return toString.call(n);if(r=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message}\n${n.stack}`:r}let u=0;const R=new TextEncoder;"encodeInto"in R||(R.encodeInto=function(n,e){const t=R.encode(n);return e.set(t),{read:n.length,written:t.length}});function d(n,e,t){if(t===void 0){const i=R.encode(n),b=e(i.length,1)>>>0;return M().subarray(b,b+i.length).set(i),u=i.length,b}let r=n.length,_=e(r,1)>>>0;const c=M();let s=0;for(;s<r;s++){const i=n.charCodeAt(s);if(i>127)break;c[_+s]=i}if(s!==r){s!==0&&(n=n.slice(s)),_=t(_,r,r=s+n.length*3,1)>>>0;const i=M().subarray(_+s,_+r),b=R.encodeInto(n,i);s+=b.written,_=t(_,r,s,1)>>>0}return u=s,_}function T(n){const e=o.__externref_table_alloc();return o.__wbindgen_externrefs.set(e,n),e}function f(n,e){try{return n.apply(this,e)}catch(t){const r=T(t);o.__wbindgen_exn_store(r)}}function I(n,e){return n=n>>>0,M().subarray(n/1,n/1+e)}const O=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>n.dtor(n.a,n.b));function N(n,e,t,r){const _={a:n,b:e,cnt:1,dtor:t},c=(...s)=>{_.cnt++;const i=_.a;_.a=0;try{return r(i,_.b,...s)}finally{_.a=i,c._wbg_cb_unref()}};return c._wbg_cb_unref=()=>{--_.cnt===0&&(_.dtor(_.a,_.b),_.a=0,O.unregister(_))},O.register(c,_,_),c}function a(n){const e=o.__wbindgen_externrefs.get(n);return o.__externref_table_dealloc(n),e}function G(n){const e=d(n,o.__wbindgen_malloc,o.__wbindgen_realloc),t=u,r=o.loadSettings(e,t);if(r[1])throw a(r[0])}function P(n,e){o.wasm_bindgen__convert__closures_____invoke__hdf1f749d9d792007(n,e)}function $(n,e,t){o.wasm_bindgen__convert__closures_____invoke__h884a8dd4f703e8e7(n,e,t)}function J(n,e,t,r){o.wasm_bindgen__convert__closures_____invoke__h98db2739737cd92d(n,e,t,r)}const H=["default","no-store","reload","no-cache","force-cache","only-if-cached"],X=["omit","same-origin","include"],Y=["same-origin","no-cors","cors","navigate"],k=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>o.__wbg_wasmbuilder_free(n>>>0,1));class h{static __wrap(e){e=e>>>0;const t=Object.create(h.prototype);return t.__wbg_ptr=e,k.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,k.unregister(this),e}free(){const e=this.__destroy_into_raw();o.__wbg_wasmbuilder_free(e,0)}addAction(e){const t=o.wasmbuilder_addAction(this.__wbg_ptr,e);if(t[1])throw a(t[0])}setIntent(e){const t=o.wasmbuilder_setIntent(this.__wbg_ptr,e);if(t[1])throw a(t[0])}toArchive(){const e=o.wasmbuilder_toArchive(this.__wbg_ptr);if(e[2])throw a(e[1]);return a(e[0])}static fromArchive(e){const t=o.wasmbuilder_fromArchive(e);if(t[2])throw a(t[1]);return h.__wrap(t[0])}setNoEmbed(e){o.wasmbuilder_setNoEmbed(this.__wbg_ptr,e)}addIngredient(e){const t=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),r=u,_=o.wasmbuilder_addIngredient(this.__wbg_ptr,t,r);if(_[1])throw a(_[0])}getDefinition(){const e=o.wasmbuilder_getDefinition(this.__wbg_ptr);if(e[2])throw a(e[1]);return a(e[0])}setRemoteUrl(e){const t=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),r=u;o.wasmbuilder_setRemoteUrl(this.__wbg_ptr,t,r)}addResourceFromBlob(e,t){const r=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u,c=o.wasmbuilder_addResourceFromBlob(this.__wbg_ptr,r,_,t);if(c[1])throw a(c[0])}setThumbnailFromBlob(e,t){const r=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u,c=o.wasmbuilder_setThumbnailFromBlob(this.__wbg_ptr,r,_,t);if(c[1])throw a(c[0])}addIngredientFromBlob(e,t,r){const _=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u,s=d(t,o.__wbindgen_malloc,o.__wbindgen_realloc),i=u,b=o.wasmbuilder_addIngredientFromBlob(this.__wbg_ptr,_,c,s,i,r);if(b[1])throw a(b[0])}signAndGetManifestBytes(e,t,r){const _=d(t,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;return o.wasmbuilder_signAndGetManifestBytes(this.__wbg_ptr,e,_,c,r)}static new(){const e=o.wasmbuilder_new();if(e[2])throw a(e[1]);return h.__wrap(e[0])}sign(e,t,r){const _=d(t,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;return o.wasmbuilder_sign(this.__wbg_ptr,e,_,c,r)}static fromJson(e){const t=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),r=u,_=o.wasmbuilder_fromJson(t,r);if(_[2])throw a(_[1]);return h.__wrap(_[0])}}Symbol.dispose&&(h.prototype[Symbol.dispose]=h.prototype.free);const z=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>o.__wbg_wasmreader_free(n>>>0,1));class v{static __wrap(e){e=e>>>0;const t=Object.create(v.prototype);return t.__wbg_ptr=e,z.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,z.unregister(this),e}free(){const e=this.__destroy_into_raw();o.__wbg_wasmreader_free(e,0)}activeLabel(){const e=o.wasmreader_activeLabel(this.__wbg_ptr);let t;return e[0]!==0&&(t=l(e[0],e[1]).slice(),o.__wbindgen_free(e[0],e[1]*1,1)),t}manifestStore(){const e=o.wasmreader_manifestStore(this.__wbg_ptr);if(e[2])throw a(e[1]);return a(e[0])}activeManifest(){const e=o.wasmreader_activeManifest(this.__wbg_ptr);if(e[2])throw a(e[1]);return a(e[0])}resourceToBytes(e){const t=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),r=u,_=o.wasmreader_resourceToBytes(this.__wbg_ptr,t,r);if(_[2])throw a(_[1]);return a(_[0])}static fromBlobFragment(e,t,r){const _=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;return o.wasmreader_fromBlobFragment(_,c,t,r)}json(){let e,t;try{const r=o.wasmreader_json(this.__wbg_ptr);return e=r[0],t=r[1],l(r[0],r[1])}finally{o.__wbindgen_free(e,t,1)}}static fromBlob(e,t){const r=d(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u;return o.wasmreader_fromBlob(r,_,t)}}Symbol.dispose&&(v.prototype[Symbol.dispose]=v.prototype.free),typeof FinalizationRegistry>"u"||new FinalizationRegistry(n=>o.__wbg_wasmsigner_free(n>>>0,1));function K(){const n={};return n.wbg={},n.wbg.__wbg_Error_e83987f665cf5504=function(e,t){return Error(l(e,t))},n.wbg.__wbg_Number_bb48ca12f395cd08=function(e){return Number(e)},n.wbg.__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd=function(e,t){const r=t,_=typeof r=="bigint"?r:void 0;m().setBigInt64(e+8,y(_)?BigInt(0):_,!0),m().setInt32(e+0,!y(_),!0)},n.wbg.__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68=function(e){const t=e,r=typeof t=="boolean"?t:void 0;return y(r)?16777215:r?1:0},n.wbg.__wbg___wbindgen_debug_string_df47ffb5e35e6763=function(e,t){const r=E(t),_=d(r,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},n.wbg.__wbg___wbindgen_in_bb933bd9e1b3bc0f=function(e,t){return e in t},n.wbg.__wbg___wbindgen_is_bigint_cb320707dcd35f0b=function(e){return typeof e=="bigint"},n.wbg.__wbg___wbindgen_is_function_ee8a6c5833c90377=function(e){return typeof e=="function"},n.wbg.__wbg___wbindgen_is_object_c818261d21f283a4=function(e){const t=e;return typeof t=="object"&&t!==null},n.wbg.__wbg___wbindgen_is_string_fbb76cb2940daafd=function(e){return typeof e=="string"},n.wbg.__wbg___wbindgen_is_undefined_2d472862bd29a478=function(e){return e===void 0},n.wbg.__wbg___wbindgen_jsval_eq_6b13ab83478b1c50=function(e,t){return e===t},n.wbg.__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147=function(e,t){return e==t},n.wbg.__wbg___wbindgen_number_get_a20bf9b85341449d=function(e,t){const r=t,_=typeof r=="number"?r:void 0;m().setFloat64(e+8,y(_)?0:_,!0),m().setInt32(e+0,!y(_),!0)},n.wbg.__wbg___wbindgen_string_get_e4f06c90489ad01b=function(e,t){const r=t,_=typeof r=="string"?r:void 0;var c=y(_)?0:d(_,o.__wbindgen_malloc,o.__wbindgen_realloc),s=u;m().setInt32(e+4,s,!0),m().setInt32(e+0,c,!0)},n.wbg.__wbg___wbindgen_throw_b855445ff6a94295=function(e,t){throw new Error(l(e,t))},n.wbg.__wbg__wbg_cb_unref_2454a539ea5790d9=function(e){e._wbg_cb_unref()},n.wbg.__wbg_abort_28ad55c5825b004d=function(e,t){e.abort(t)},n.wbg.__wbg_abort_e7eb059f72f9ed0c=function(e){e.abort()},n.wbg.__wbg_append_b577eb3a177bc0fa=function(){return f(function(e,t,r,_,c){e.append(l(t,r),l(_,c))},arguments)},n.wbg.__wbg_arrayBuffer_b375eccb84b4ddf3=function(){return f(function(e){return e.arrayBuffer()},arguments)},n.wbg.__wbg_byteLength_bcd42e4025299788=function(e){return e.byteLength},n.wbg.__wbg_call_525440f72fbfc0ea=function(){return f(function(e,t,r){return e.call(t,r)},arguments)},n.wbg.__wbg_call_e762c39fa8ea36bf=function(){return f(function(e,t){return e.call(t)},arguments)},n.wbg.__wbg_clearTimeout_7a42b49784aea641=function(e){return clearTimeout(e)},n.wbg.__wbg_crypto_574e78ad8b13b65f=function(e){return e.crypto},n.wbg.__wbg_done_2042aa2670fb1db1=function(e){return e.done},n.wbg.__wbg_entries_e171b586f8f6bdbf=function(e){return Object.entries(e)},n.wbg.__wbg_error_7534b8e9a36f1ab4=function(e,t){let r,_;try{r=e,_=t,console.error(l(e,t))}finally{o.__wbindgen_free(r,_,1)}},n.wbg.__wbg_fetch_74a3e84ebd2c9a0e=function(e){return fetch(e)},n.wbg.__wbg_fetch_f8ba0e29a9d6de0d=function(e,t){return e.fetch(t)},n.wbg.__wbg_from_a4ad7cbddd0d7135=function(e){return Array.from(e)},n.wbg.__wbg_getRandomValues_38a1ff1ea09f6cc7=function(){return f(function(e,t){globalThis.crypto.getRandomValues(I(e,t))},arguments)},n.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e=function(){return f(function(e,t){e.getRandomValues(t)},arguments)},n.wbg.__wbg_getTime_14776bfb48a1bff9=function(e){return e.getTime()},n.wbg.__wbg_get_7bed016f185add81=function(e,t){return e[t>>>0]},n.wbg.__wbg_get_efcb449f58ec27c2=function(){return f(function(e,t){return Reflect.get(e,t)},arguments)},n.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe=function(e,t){return e[t]},n.wbg.__wbg_has_787fafc980c3ccdb=function(){return f(function(e,t){return Reflect.has(e,t)},arguments)},n.wbg.__wbg_headers_b87d7eaba61c3278=function(e){return e.headers},n.wbg.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38=function(e){let t;try{t=e instanceof ArrayBuffer}catch{t=!1}return t},n.wbg.__wbg_instanceof_Map_8579b5e2ab5437c7=function(e){let t;try{t=e instanceof Map}catch{t=!1}return t},n.wbg.__wbg_instanceof_Promise_001fdd42afa1b7ef=function(e){let t;try{t=e instanceof Promise}catch{t=!1}return t},n.wbg.__wbg_instanceof_Response_f4f3e87e07f3135c=function(e){let t;try{t=e instanceof Response}catch{t=!1}return t},n.wbg.__wbg_instanceof_Uint8Array_20c8e73002f7af98=function(e){let t;try{t=e instanceof Uint8Array}catch{t=!1}return t},n.wbg.__wbg_isArray_96e0af9891d0945d=function(e){return Array.isArray(e)},n.wbg.__wbg_isSafeInteger_d216eda7911dde36=function(e){return Number.isSafeInteger(e)},n.wbg.__wbg_iterator_e5822695327a3c39=function(){return Symbol.iterator},n.wbg.__wbg_length_69bca3cb64fc8748=function(e){return e.length},n.wbg.__wbg_length_cdd215e10d9dd507=function(e){return e.length},n.wbg.__wbg_msCrypto_a61aeb35a24c1329=function(e){return e.msCrypto},n.wbg.__wbg_new_0_f9740686d739025c=function(){return new Date},n.wbg.__wbg_new_0d96c0bf6ceac0b0=function(){return f(function(){return new FileReaderSync},arguments)},n.wbg.__wbg_new_1acc0b6eea89d040=function(){return new Object},n.wbg.__wbg_new_2531773dac38ebb3=function(){return f(function(){return new AbortController},arguments)},n.wbg.__wbg_new_3c3d849046688a66=function(e,t){try{var r={a:e,b:t},_=(s,i)=>{const b=r.a;r.a=0;try{return J(b,r.b,s,i)}finally{r.a=b}};return new Promise(_)}finally{r.a=r.b=0}},n.wbg.__wbg_new_5a79be3ab53b8aa5=function(e){return new Uint8Array(e)},n.wbg.__wbg_new_68651c719dcda04e=function(){return new Map},n.wbg.__wbg_new_8a6f238a6ece86ea=function(){return new Error},n.wbg.__wbg_new_9edf9838a2def39c=function(){return f(function(){return new Headers},arguments)},n.wbg.__wbg_new_a7442b4b19c1a356=function(e,t){return new Error(l(e,t))},n.wbg.__wbg_new_e17d9f43105b08be=function(){return new Array},n.wbg.__wbg_new_from_slice_92f4d78ca282a2d2=function(e,t){return new Uint8Array(I(e,t))},n.wbg.__wbg_new_no_args_ee98eee5275000a4=function(e,t){return new Function(l(e,t))},n.wbg.__wbg_new_with_length_01aa0dc35aa13543=function(e){return new Uint8Array(e>>>0)},n.wbg.__wbg_new_with_str_and_init_0ae7728b6ec367b1=function(){return f(function(e,t,r){return new Request(l(e,t),r)},arguments)},n.wbg.__wbg_next_020810e0ae8ebcb0=function(){return f(function(e){return e.next()},arguments)},n.wbg.__wbg_next_2c826fe5dfec6b6a=function(e){return e.next},n.wbg.__wbg_node_905d3e251edff8a2=function(e){return e.node},n.wbg.__wbg_now_793306c526e2e3b6=function(){return Date.now()},n.wbg.__wbg_process_dc0fbacc7c1c06f7=function(e){return e.process},n.wbg.__wbg_prototypesetcall_2a6620b6922694b2=function(e,t,r){Uint8Array.prototype.set.call(I(e,t),r)},n.wbg.__wbg_queueMicrotask_34d692c25c47d05b=function(e){return e.queueMicrotask},n.wbg.__wbg_queueMicrotask_9d76cacb20c84d58=function(e){queueMicrotask(e)},n.wbg.__wbg_randomFillSync_ac0988aba3254290=function(){return f(function(e,t){e.randomFillSync(t)},arguments)},n.wbg.__wbg_readAsArrayBuffer_36927e3348e676c3=function(){return f(function(e,t){return e.readAsArrayBuffer(t)},arguments)},n.wbg.__wbg_require_60cc747a6bc5215a=function(){return f(function(){return module.require},arguments)},n.wbg.__wbg_resolve_caf97c30b83f7053=function(e){return Promise.resolve(e)},n.wbg.__wbg_setTimeout_7bb3429662ab1e70=function(e,t){return setTimeout(e,t)},n.wbg.__wbg_set_3f1d0b984ed272ed=function(e,t,r){e[t]=r},n.wbg.__wbg_set_907fb406c34a251d=function(e,t,r){return e.set(t,r)},n.wbg.__wbg_set_9e6516df7b7d0f19=function(e,t,r){e.set(I(t,r))},n.wbg.__wbg_set_body_3c365989753d61f4=function(e,t){e.body=t},n.wbg.__wbg_set_c213c871859d6500=function(e,t,r){e[t>>>0]=r},n.wbg.__wbg_set_cache_2f9deb19b92b81e3=function(e,t){e.cache=H[t]},n.wbg.__wbg_set_credentials_f621cd2d85c0c228=function(e,t){e.credentials=X[t]},n.wbg.__wbg_set_headers_6926da238cd32ee4=function(e,t){e.headers=t},n.wbg.__wbg_set_method_c02d8cbbe204ac2d=function(e,t,r){e.method=l(t,r)},n.wbg.__wbg_set_mode_52ef73cfa79639cb=function(e,t){e.mode=Y[t]},n.wbg.__wbg_set_signal_dda2cf7ccb6bee0f=function(e,t){e.signal=t},n.wbg.__wbg_signal_4db5aa055bf9eb9a=function(e){return e.signal},n.wbg.__wbg_size_0a5a003dbf5dfee8=function(e){return e.size},n.wbg.__wbg_slice_4947c0e051116da5=function(){return f(function(e,t,r){return e.slice(t,r)},arguments)},n.wbg.__wbg_stack_0ed75d68575b0f3c=function(e,t){const r=t.stack,_=d(r,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},n.wbg.__wbg_static_accessor_GLOBAL_89e1d9ac6a1b250e=function(){const e=typeof global>"u"?null:global;return y(e)?0:T(e)},n.wbg.__wbg_static_accessor_GLOBAL_THIS_8b530f326a9e48ac=function(){const e=typeof globalThis>"u"?null:globalThis;return y(e)?0:T(e)},n.wbg.__wbg_static_accessor_SELF_6fdf4b64710cc91b=function(){const e=typeof self>"u"?null:self;return y(e)?0:T(e)},n.wbg.__wbg_static_accessor_WINDOW_b45bfc5a37f6cfa2=function(){const e=typeof window>"u"?null:window;return y(e)?0:T(e)},n.wbg.__wbg_status_de7eed5a7a5bfd5d=function(e){return e.status},n.wbg.__wbg_stringify_b5fb28f6465d9c3e=function(){return f(function(e){return JSON.stringify(e)},arguments)},n.wbg.__wbg_subarray_480600f3d6a9f26c=function(e,t,r){return e.subarray(t>>>0,r>>>0)},n.wbg.__wbg_then_4f46f6544e6b4a28=function(e,t){return e.then(t)},n.wbg.__wbg_then_70d05cf780a18d77=function(e,t,r){return e.then(t,r)},n.wbg.__wbg_url_b36d2a5008eb056f=function(e,t){const r=t.url,_=d(r,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},n.wbg.__wbg_valueOf_e1f2752ef9caddb2=function(e){return e.valueOf()},n.wbg.__wbg_value_692627309814bb8c=function(e){return e.value},n.wbg.__wbg_versions_c01dfd4722a88165=function(e){return e.versions},n.wbg.__wbg_wasmreader_new=function(e){return v.__wrap(e)},n.wbg.__wbindgen_cast_2241b6af4c4b2941=function(e,t){return l(e,t)},n.wbg.__wbindgen_cast_2ddd8a25ff58642a=function(e,t){return BigInt.asUintN(64,e)|t<<BigInt(64)},n.wbg.__wbindgen_cast_4625c577ab2ec9ee=function(e){return BigInt.asUintN(64,e)},n.wbg.__wbindgen_cast_505e03f50ba186b5=function(e,t){return N(e,t,o.wasm_bindgen__closure__destroy__h8ae0486d46b28893,$)},n.wbg.__wbindgen_cast_77bc3e92745e9a35=function(e,t){var r=I(e,t).slice();return o.__wbindgen_free(e,t*1,1),r},n.wbg.__wbindgen_cast_9ae0607507abb057=function(e){return e},n.wbg.__wbindgen_cast_cae4d789fdd03135=function(e,t){return N(e,t,o.wasm_bindgen__closure__destroy__h04b2b36c174d4459,P)},n.wbg.__wbindgen_cast_cb9088102bce6b30=function(e,t){return I(e,t)},n.wbg.__wbindgen_cast_d6cd19b81560fd6e=function(e){return e},n.wbg.__wbindgen_init_externref_table=function(){const e=o.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)},n}function Q(n,e){return o=n.exports,A=null,S=null,o.__wbindgen_start(),o}function Z(n){if(o!==void 0)return o;typeof n<"u"&&(Object.getPrototypeOf(n)===Object.prototype?{module:n}=n:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const e=K();n instanceof WebAssembly.Module||(n=new WebAssembly.Module(n));const t=new WebAssembly.Instance(n,e);return Q(t)}function D(){let n=0;const e=new Map;return{add(t){const r=n++;return e.set(r,t),r},get(t){const r=e.get(t);if(!r)throw new Error("Attempted to use an object that has been freed");return r},remove(t){return e.delete(t)}}}const L=Symbol("transfer");function F(n,e){return{type:L,value:n,transfer:e?Array.isArray(e)?e:[e]:[n]}}function U(n){return!!(n&&typeof n=="object"&&Reflect.get(n,"type")===L)}function q(n="default"){return{createTx(e){const t=new Map,r=e??self;return r.addEventListener("message",_=>{const{data:c}=_;if(c.channelName!==n)return;const{id:s,result:i,error:b}=c,w=t.get(s);w&&(b?w.reject(b):w.resolve(i),t.delete(s))}),new Proxy({},{get(_,c){return(...s)=>{const i=ee(),b=[],w=[];return s.forEach(B=>{U(B)?(b.push(B.value),w.push(...B.transfer)):b.push(B)}),r.postMessage({method:c,args:b,id:i,channelName:n},{transfer:w}),new Promise((B,re)=>{t.set(i,{resolve:B,reject:re})})}}})},rx(e,t){const r=t??self;r.addEventListener("message",async _=>{const{data:c}=_;if(c.channelName!==n)return;const{method:s,args:i,id:b}=c;try{const w=await e[s](...i);U(w)?r.postMessage({result:w.value,id:b,channelName:n},{transfer:w.transfer}):r.postMessage({result:w,id:b,channelName:n})}catch(w){r.postMessage({error:w,id:b,channelName:n})}})}}}function ee(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const{rx:te}=q(),{createTx:ne}=q("worker"),p=D(),g=D(),W=ne();te({async initWorker(n,e){Z({module:n}),e&&G(e)},async reader_fromBlob(n,e){const t=await v.fromBlob(n,e);return p.add(t)},async reader_fromBlobFragment(n,e,t){const r=await v.fromBlobFragment(n,e,t);return p.add(r)},reader_activeLabel(n){return p.get(n).activeLabel()??null},reader_manifestStore(n){return p.get(n).manifestStore()},reader_activeManifest(n){return p.get(n).activeManifest()},reader_json(n){return p.get(n).json()},reader_resourceToBytes(n,e){const r=p.get(n).resourceToBytes(e);return F(r,r.buffer)},reader_free(n){p.get(n).free(),p.remove(n)},builder_new(){const n=h.new();return g.add(n)},builder_fromJson(n){const e=h.fromJson(n);return g.add(e)},builder_fromArchive(n){const e=h.fromArchive(n);return g.add(e)},builder_setIntent(n,e){g.get(n).setIntent(e)},builder_addAction(n,e){g.get(n).addAction(e)},builder_setRemoteUrl(n,e){g.get(n).setRemoteUrl(e)},builder_setNoEmbed(n,e){g.get(n).setNoEmbed(e)},builder_setThumbnailFromBlob(n,e,t){g.get(n).setThumbnailFromBlob(e,t)},builder_addIngredient(n,e){g.get(n).addIngredient(e)},builder_addIngredientFromBlob(n,e,t,r){g.get(n).addIngredientFromBlob(e,t,r)},builder_addResourceFromBlob(n,e,t){g.get(n).addResourceFromBlob(e,t)},builder_getDefinition(n){return g.get(n).getDefinition()},builder_toArchive(n){const t=g.get(n).toArchive();return F(t,t.buffer)},async builder_sign(n,e,t,r,_){const s=await g.get(n).sign({reserveSize:t.reserveSize,alg:t.alg,sign:async i=>await W.sign(e,F(i,i.buffer),t.reserveSize)},r,_);return F(s,s.buffer)},async builder_signAndGetManifestBytes(n,e,t,r,_){const c=g.get(n),{manifest:s,asset:i}=await c.signAndGetManifestBytes({reserveSize:t.reserveSize,alg:t.alg,sign:async b=>await W.sign(e,F(b,b.buffer),t.reserveSize)},r,_);return F({manifest:s,asset:i},[s.buffer,i.buffer])},builder_free(n){g.get(n).free(),g.remove(n)}})})();\n', l = typeof self < "u" && self.Blob && new Blob([x], { type: "text/javascript;charset=utf-8" });
|
|
4
|
+
function O(e) {
|
|
5
5
|
let n;
|
|
6
6
|
try {
|
|
7
7
|
if (n = l && (self.URL || self.webkitURL).createObjectURL(l), !n) throw "";
|
|
@@ -13,7 +13,7 @@ function N(e) {
|
|
|
13
13
|
}), _;
|
|
14
14
|
} catch {
|
|
15
15
|
return new Worker(
|
|
16
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
16
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(x),
|
|
17
17
|
{
|
|
18
18
|
name: e == null ? void 0 : e.name
|
|
19
19
|
}
|
|
@@ -25,7 +25,7 @@ function N(e) {
|
|
|
25
25
|
async function U(e) {
|
|
26
26
|
const { wasm: n, settingsString: _ } = e;
|
|
27
27
|
let r = 0;
|
|
28
|
-
const t = new
|
|
28
|
+
const t = new O(), o = M(t), i = /* @__PURE__ */ new Map();
|
|
29
29
|
z(
|
|
30
30
|
{
|
|
31
31
|
sign: async (s, c, T) => {
|
|
@@ -51,7 +51,7 @@ async function U(e) {
|
|
|
51
51
|
class m extends Error {
|
|
52
52
|
constructor(n) {
|
|
53
53
|
super(
|
|
54
|
-
`The provided asset was too large. Size: ${n} bytes. Maximum: ${
|
|
54
|
+
`The provided asset was too large. Size: ${n} bytes. Maximum: ${g}.`
|
|
55
55
|
), this.name = "AssetTooLargeError";
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -60,7 +60,7 @@ class y extends Error {
|
|
|
60
60
|
super(`Unsupported format: ${n}.`), this.name = "UnsupportedFormatError";
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
const
|
|
63
|
+
const L = [
|
|
64
64
|
"jpg",
|
|
65
65
|
"video/mp4",
|
|
66
66
|
"image/heif",
|
|
@@ -119,19 +119,19 @@ const O = [
|
|
|
119
119
|
"nef",
|
|
120
120
|
"heif"
|
|
121
121
|
];
|
|
122
|
-
function
|
|
123
|
-
return
|
|
122
|
+
function h(e) {
|
|
123
|
+
return L.includes(e);
|
|
124
124
|
}
|
|
125
|
-
const
|
|
126
|
-
function
|
|
125
|
+
const g = 10 ** 9;
|
|
126
|
+
function N(e) {
|
|
127
127
|
const { tx: n } = e, _ = new FinalizationRegistry(async (r) => {
|
|
128
128
|
await n.reader_free(r);
|
|
129
129
|
});
|
|
130
130
|
return {
|
|
131
131
|
async fromBlob(r, t) {
|
|
132
|
-
if (!
|
|
132
|
+
if (!h(r))
|
|
133
133
|
throw new y(r);
|
|
134
|
-
if (t.size >
|
|
134
|
+
if (t.size > g)
|
|
135
135
|
throw new m(t.size);
|
|
136
136
|
try {
|
|
137
137
|
const o = await n.reader_fromBlob(r, t), i = v(e, o, () => {
|
|
@@ -139,13 +139,13 @@ function L(e) {
|
|
|
139
139
|
});
|
|
140
140
|
return _.register(i, o, i), i;
|
|
141
141
|
} catch (o) {
|
|
142
|
-
return
|
|
142
|
+
return p(o);
|
|
143
143
|
}
|
|
144
144
|
},
|
|
145
145
|
async fromBlobFragment(r, t, o) {
|
|
146
|
-
if (!
|
|
146
|
+
if (!h(r))
|
|
147
147
|
throw new y(r);
|
|
148
|
-
if (t.size >
|
|
148
|
+
if (t.size > g)
|
|
149
149
|
throw new m(t.size);
|
|
150
150
|
try {
|
|
151
151
|
const i = await n.reader_fromBlobFragment(
|
|
@@ -157,12 +157,12 @@ function L(e) {
|
|
|
157
157
|
});
|
|
158
158
|
return _.register(a, i, a), a;
|
|
159
159
|
} catch (i) {
|
|
160
|
-
return
|
|
160
|
+
return p(i);
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function p(e) {
|
|
166
166
|
if (e instanceof Error && e.message === "C2pa(JumbfNotFound)")
|
|
167
167
|
return null;
|
|
168
168
|
throw e;
|
|
@@ -191,7 +191,7 @@ function v(e, n, _) {
|
|
|
191
191
|
}
|
|
192
192
|
};
|
|
193
193
|
}
|
|
194
|
-
let
|
|
194
|
+
let f, k = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 });
|
|
195
195
|
k.decode();
|
|
196
196
|
const b = new TextEncoder();
|
|
197
197
|
"encodeInto" in b || (b.encodeInto = function(e, n) {
|
|
@@ -202,21 +202,21 @@ const b = new TextEncoder();
|
|
|
202
202
|
};
|
|
203
203
|
});
|
|
204
204
|
typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => e.dtor(e.a, e.b));
|
|
205
|
-
typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) =>
|
|
206
|
-
typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) =>
|
|
207
|
-
typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) =>
|
|
208
|
-
const D = "sha512-
|
|
205
|
+
typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => f.__wbg_wasmbuilder_free(e >>> 0, 1));
|
|
206
|
+
typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => f.__wbg_wasmreader_free(e >>> 0, 1));
|
|
207
|
+
typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => f.__wbg_wasmsigner_free(e >>> 0, 1));
|
|
208
|
+
const D = "sha512-947rplCljh/q5xOwPUBGyZVBEdjPkb8mXDAqfe6dF8230n/duxKtiTW2bGME79TjV2mYuIyss1Y7+XgvKVgLXg==", W = {
|
|
209
209
|
builder: {
|
|
210
210
|
generateC2paArchive: !0
|
|
211
211
|
}
|
|
212
212
|
};
|
|
213
|
-
async function
|
|
214
|
-
const n =
|
|
215
|
-
return n.trust && _.push(A(n.trust)), n.cawgTrust && _.push(A(n.cawgTrust)), await Promise.all(_), JSON.stringify(
|
|
213
|
+
async function q(e) {
|
|
214
|
+
const n = j(W, e), _ = [];
|
|
215
|
+
return n.trust && _.push(A(n.trust)), n.cawgTrust && _.push(A(n.cawgTrust)), await Promise.all(_), JSON.stringify(I(n));
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function I(e) {
|
|
218
218
|
return Object.entries(e).reduce(
|
|
219
|
-
(_, [r, t]) => (_[C(r)] = typeof t == "object" ?
|
|
219
|
+
(_, [r, t]) => (_[C(r)] = typeof t == "object" ? I(t) : t, _),
|
|
220
220
|
{}
|
|
221
221
|
);
|
|
222
222
|
}
|
|
@@ -229,14 +229,14 @@ async function A(e) {
|
|
|
229
229
|
if (Array.isArray(r)) {
|
|
230
230
|
const t = r.map(async (a) => {
|
|
231
231
|
const c = await (await fetch(a)).text();
|
|
232
|
-
if (R(_) && !
|
|
232
|
+
if (R(_) && !B(c))
|
|
233
233
|
throw new Error(`Error parsing PEM file at: ${a}`);
|
|
234
234
|
return c;
|
|
235
235
|
}), i = (await Promise.all(t)).join("");
|
|
236
236
|
e[_] = i;
|
|
237
|
-
} else if (r &&
|
|
237
|
+
} else if (r && P(r)) {
|
|
238
238
|
const o = await (await fetch(r)).text();
|
|
239
|
-
if (R(_) && !
|
|
239
|
+
if (R(_) && !B(o))
|
|
240
240
|
throw new Error(`Error parsing PEM file at: ${r}`);
|
|
241
241
|
e[_] = o;
|
|
242
242
|
} else
|
|
@@ -247,8 +247,8 @@ async function A(e) {
|
|
|
247
247
|
throw new Error("Failed to resolve trust settings.", { cause: n });
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
|
-
const R = (e) => ["userAnchors", "trustAnchors"].includes(e),
|
|
251
|
-
async function
|
|
250
|
+
const R = (e) => ["userAnchors", "trustAnchors"].includes(e), B = (e) => e.includes("-----BEGIN CERTIFICATE-----"), P = (e) => e.startsWith("http");
|
|
251
|
+
async function S(e) {
|
|
252
252
|
const { alg: n } = e;
|
|
253
253
|
return {
|
|
254
254
|
reserveSize: await e.reserveSize(),
|
|
@@ -316,7 +316,7 @@ function u(e, n, _) {
|
|
|
316
316
|
return await r.builder_toArchive(n);
|
|
317
317
|
},
|
|
318
318
|
async sign(t, o, i) {
|
|
319
|
-
const a = await
|
|
319
|
+
const a = await S(t), s = e.registerSignReceiver(t.sign);
|
|
320
320
|
return await r.builder_sign(
|
|
321
321
|
n,
|
|
322
322
|
s,
|
|
@@ -326,7 +326,7 @@ function u(e, n, _) {
|
|
|
326
326
|
);
|
|
327
327
|
},
|
|
328
328
|
async signAndGetManifestBytes(t, o, i) {
|
|
329
|
-
const a = await
|
|
329
|
+
const a = await S(t), s = e.registerSignReceiver(t.sign);
|
|
330
330
|
return await r.builder_signAndGetManifestBytes(
|
|
331
331
|
n,
|
|
332
332
|
s,
|
|
@@ -340,10 +340,10 @@ function u(e, n, _) {
|
|
|
340
340
|
}
|
|
341
341
|
};
|
|
342
342
|
}
|
|
343
|
-
async function
|
|
344
|
-
const { wasmSrc: n, settings: _ } = e, r = typeof n == "string" ? await G(n) : n, t = _ ? await
|
|
343
|
+
async function Y(e) {
|
|
344
|
+
const { wasmSrc: n, settings: _ } = e, r = typeof n == "string" ? await G(n) : n, t = _ ? await q(_) : void 0, o = await U({ wasm: r, settingsString: t });
|
|
345
345
|
return {
|
|
346
|
-
reader:
|
|
346
|
+
reader: N(o),
|
|
347
347
|
builder: J(o),
|
|
348
348
|
dispose: o.terminate
|
|
349
349
|
};
|
|
@@ -353,7 +353,7 @@ async function G(e) {
|
|
|
353
353
|
return await WebAssembly.compileStreaming(n);
|
|
354
354
|
}
|
|
355
355
|
export {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
356
|
+
L as R,
|
|
357
|
+
Y as c,
|
|
358
|
+
h as i
|
|
359
359
|
};
|
package/dist/index.js
CHANGED