@contentauth/c2pa-web 0.8.1 → 0.8.3
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/README.md +11 -5
- package/dist/{c2pa-DKxSS-my.js → c2pa-DTIgRMfD.js} +155 -135
- package/dist/index.js +1 -1
- package/dist/inline.js +7 -7
- package/dist/lib/settings.d.ts +1 -0
- package/dist/lib/settings.d.ts.map +1 -1
- package/dist/resources/c2pa_bg.wasm +0 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ npm install @contentauth/c2pa-web
|
|
|
12
12
|
|
|
13
13
|
## Importing the library
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Due to [specific requirements](https://developer.mozilla.org/en-US/docs/WebAssembly/Guides/Loading_and_running) for handling Wasm modules, there are two ways to import the library:
|
|
16
16
|
|
|
17
17
|
- Using a separate Wasm binary, which provides better performance.
|
|
18
18
|
- Using an inline Wasm binary, which is more convenient.
|
|
@@ -22,7 +22,7 @@ There are two ways to import the library, due to [specific requirements](https:/
|
|
|
22
22
|
The recommended way to import the library is to fetch the Wasm binary over the network at runtime.
|
|
23
23
|
This requires that the Wasm binary be hosted separately.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
Use a solution appropriate to your tooling; for example, using Vite:
|
|
26
26
|
|
|
27
27
|
```typescript
|
|
28
28
|
import { createC2pa } from '@contentauth/c2pa-web';
|
|
@@ -32,7 +32,7 @@ import wasmSrc from '@contentauth/c2pa-web/resources/c2pa.wasm?url';
|
|
|
32
32
|
const c2pa = createC2pa({ wasmSrc });
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
Alternatively, you can request the binary from a CDN:
|
|
36
36
|
|
|
37
37
|
```typescript
|
|
38
38
|
import { createC2pa } from '@contentauth/c2pa-web';
|
|
@@ -288,9 +288,15 @@ For the full list, see the [API reference](https://contentauth.github.io/c2pa-js
|
|
|
288
288
|
|
|
289
289
|
### Prerequisites
|
|
290
290
|
|
|
291
|
-
Ensure the repo-wide prerequisites
|
|
291
|
+
Ensure the repo-wide prerequisites are installed:
|
|
292
292
|
|
|
293
|
-
|
|
293
|
+
- [Node.js](https://nodejs.org/) v22.22+
|
|
294
|
+
- [NX](https://nx.dev/getting-started/intro)
|
|
295
|
+
- [pnpm](https://pnpm.io/)
|
|
296
|
+
|
|
297
|
+
See the [c2pa-js README](../../README.md#prerequisites) for details.
|
|
298
|
+
|
|
299
|
+
Then, install [the additional prerequisites for `c2pa-wasm`](../c2pa-wasm/README.md#prerequisites).
|
|
294
300
|
|
|
295
301
|
### Building
|
|
296
302
|
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import { channel as
|
|
1
|
+
import { channel as x, transfer as z } from "highgain";
|
|
2
2
|
import { merge as O } from "ts-deepmerge";
|
|
3
|
-
const { createTx: z, rx: H } = I(), { createTx: Y, rx: N } = I("worker"), T = '(function(){"use strict";class p{static __wrap(e){const t=Object.create(p.prototype);return t.__wbg_ptr=e,x.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,x.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 b(t[0])}addIngredient(e){const t=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),n=u,_=o.wasmbuilder_addIngredient(this.__wbg_ptr,t,n);if(_[1])throw b(_[0])}addIngredientFromBlob(e,t,n){const _=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u,i=f(t,o.__wbindgen_malloc,o.__wbindgen_realloc),s=u;return o.wasmbuilder_addIngredientFromBlob(this.__wbg_ptr,_,c,i,s,n)}addRedaction(e,t){const n=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u,c=o.wasmbuilder_addRedaction(this.__wbg_ptr,n,_,t);if(c[1])throw b(c[0])}addResourceFromBlob(e,t){const n=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u,c=o.wasmbuilder_addResourceFromBlob(this.__wbg_ptr,n,_,t);if(c[1])throw b(c[0])}static fromArchive(e,t){var n=g(t)?0:f(t,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u;const c=o.wasmbuilder_fromArchive(e,n,_);if(c[2])throw b(c[1]);return p.__wrap(c[0])}static fromJson(e,t){const n=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u;var c=g(t)?0:f(t,o.__wbindgen_malloc,o.__wbindgen_realloc),i=u;const s=o.wasmbuilder_fromJson(n,_,c,i);if(s[2])throw b(s[1]);return p.__wrap(s[0])}getDefinition(){const e=o.wasmbuilder_getDefinition(this.__wbg_ptr);if(e[2])throw b(e[1]);return b(e[0])}static new(e){var t=g(e)?0:f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),n=u;const _=o.wasmbuilder_new(t,n);if(_[2])throw b(_[1]);return p.__wrap(_[0])}setIntent(e){const t=o.wasmbuilder_setIntent(this.__wbg_ptr,e);if(t[1])throw b(t[0])}setNoEmbed(e){o.wasmbuilder_setNoEmbed(this.__wbg_ptr,e)}setRemoteUrl(e){const t=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),n=u;o.wasmbuilder_setRemoteUrl(this.__wbg_ptr,t,n)}setThumbnailFromBlob(e,t){const n=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u,c=o.wasmbuilder_setThumbnailFromBlob(this.__wbg_ptr,n,_,t);if(c[1])throw b(c[0])}sign(e,t,n){const _=f(t,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;return o.wasmbuilder_sign(this.__wbg_ptr,e,_,c,n)}signAndGetManifestBytes(e,t,n){const _=f(t,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;return o.wasmbuilder_signAndGetManifestBytes(this.__wbg_ptr,e,_,c,n)}toArchive(){const e=o.wasmbuilder_toArchive(this.__wbg_ptr);if(e[2])throw b(e[1]);return b(e[0])}}Symbol.dispose&&(p.prototype[Symbol.dispose]=p.prototype.free);class v{static __wrap(e){const t=Object.create(v.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_wasmreader_free(e,0)}activeLabel(){const e=o.wasmreader_activeLabel(this.__wbg_ptr);let t;return e[0]!==0&&(t=y(e[0],e[1]).slice(),o.__wbindgen_free(e[0],e[1]*1,1)),t}activeManifest(){const e=o.wasmreader_activeManifest(this.__wbg_ptr);if(e[2])throw b(e[1]);return b(e[0])}crJson(){let e,t;try{const n=o.wasmreader_crJson(this.__wbg_ptr);return e=n[0],t=n[1],y(n[0],n[1])}finally{o.__wbindgen_free(e,t,1)}}static fromBlob(e,t,n){const _=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;var i=g(n)?0:f(n,o.__wbindgen_malloc,o.__wbindgen_realloc),s=u;return o.wasmreader_fromBlob(_,c,t,i,s)}static fromBlobFragment(e,t,n,_){const c=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),i=u;var s=g(_)?0:f(_,o.__wbindgen_malloc,o.__wbindgen_realloc),a=u;return o.wasmreader_fromBlobFragment(c,i,t,n,s,a)}json(){let e,t;try{const n=o.wasmreader_json(this.__wbg_ptr);return e=n[0],t=n[1],y(n[0],n[1])}finally{o.__wbindgen_free(e,t,1)}}manifestStore(){const e=o.wasmreader_manifestStore(this.__wbg_ptr);if(e[2])throw b(e[1]);return b(e[0])}resourceToBytes(e){const t=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),n=u,_=o.wasmreader_resourceToBytes(this.__wbg_ptr,t,n);if(_[2])throw b(_[1]);return b(_[0])}}Symbol.dispose&&(v.prototype[Symbol.dispose]=v.prototype.free);function C(r){const e=f(r,o.__wbindgen_malloc,o.__wbindgen_realloc),t=u,n=o.loadSettings(e,t);if(n[1])throw b(n[0])}function J(){return{__proto__:null,"./c2pa_bg.js":{__proto__:null,__wbg_Error_3639a60ed15f87e7:function(e,t){return Error(y(e,t))},__wbg_Number_a3d737fd183f7dca:function(e){return Number(e)},__wbg___wbindgen_bigint_get_as_i64_3af6d4ca77193a4b:function(e,t){const n=t,_=typeof n=="bigint"?n:void 0;m().setBigInt64(e+8,g(_)?BigInt(0):_,!0),m().setInt32(e+0,!g(_),!0)},__wbg___wbindgen_boolean_get_c3dd5c39f1b5a12b:function(e){const t=e,n=typeof t=="boolean"?t:void 0;return g(n)?16777215:n?1:0},__wbg___wbindgen_debug_string_07cb72cfcc952e2b:function(e,t){const n=j(t),_=f(n,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},__wbg___wbindgen_in_2617fa76397620d3:function(e,t){return e in t},__wbg___wbindgen_is_bigint_d6a8167cac401b95:function(e){return typeof e=="bigint"},__wbg___wbindgen_is_function_2f0fd7ceb86e64c5:function(e){return typeof e=="function"},__wbg___wbindgen_is_object_5b22ff2418063a9c:function(e){const t=e;return typeof t=="object"&&t!==null},__wbg___wbindgen_is_string_eddc07a3efad52e6:function(e){return typeof e=="string"},__wbg___wbindgen_is_undefined_244a92c34d3b6ec0:function(e){return e===void 0},__wbg___wbindgen_jsval_eq_403eaa3610500a25:function(e,t){return e===t},__wbg___wbindgen_jsval_loose_eq_1978f1e77b4bce62:function(e,t){return e==t},__wbg___wbindgen_number_get_dd6d69a6079f26f1:function(e,t){const n=t,_=typeof n=="number"?n:void 0;m().setFloat64(e+8,g(_)?0:_,!0),m().setInt32(e+0,!g(_),!0)},__wbg___wbindgen_string_get_965592073e5d848c:function(e,t){const n=t,_=typeof n=="string"?n:void 0;var c=g(_)?0:f(_,o.__wbindgen_malloc,o.__wbindgen_realloc),i=u;m().setInt32(e+4,i,!0),m().setInt32(e+0,c,!0)},__wbg___wbindgen_throw_9c75d47bf9e7731e:function(e,t){throw new Error(y(e,t))},__wbg__wbg_cb_unref_158e43e869788cdc:function(e){e._wbg_cb_unref()},__wbg_abort_43913e33ecb83d0d:function(e,t){e.abort(t)},__wbg_abort_87eb7f23cf4b73d1:function(e){e.abort()},__wbg_append_8df396311184f750:function(){return d(function(e,t,n,_,c){e.append(y(t,n),y(_,c))},arguments)},__wbg_arrayBuffer_87e3ac06d961f7a0:function(){return d(function(e){return e.arrayBuffer()},arguments)},__wbg_byteLength_1f57c71e64ee0180:function(e){return e.byteLength},__wbg_call_a41d6421b30a32c5:function(){return d(function(e,t,n){return e.call(t,n)},arguments)},__wbg_call_add9e5a76382e668:function(){return d(function(e,t){return e.call(t)},arguments)},__wbg_clearTimeout_6b8d9a38b9263d65:function(e){return clearTimeout(e)},__wbg_crypto_38df2bab126b63dc:function(e){return e.crypto},__wbg_done_b1afd6201ac045e0:function(e){return e.done},__wbg_entries_bb9843ba73dc70d6:function(e){return Object.entries(e)},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,_;try{n=e,_=t,console.error(y(e,t))}finally{o.__wbindgen_free(n,_,1)}},__wbg_fetch_1a030943aa8e0c38:function(e,t){return e.fetch(t)},__wbg_fetch_9dad4fe911207b37:function(e){return fetch(e)},__wbg_from_ff141b1e4c69b979:function(e){return Array.from(e)},__wbg_getRandomValues_3f44b700395062e5:function(){return d(function(e,t){globalThis.crypto.getRandomValues(A(e,t))},arguments)},__wbg_getRandomValues_c44a50d8cfdaebeb:function(){return d(function(e,t){e.getRandomValues(t)},arguments)},__wbg_getRandomValues_ef12552bf5acd2fe:function(){return d(function(e,t){globalThis.crypto.getRandomValues(A(e,t))},arguments)},__wbg_getTime_e599bee315e19eba:function(e){return e.getTime()},__wbg_get_41476db20fef99a8:function(){return d(function(e,t){return Reflect.get(e,t)},arguments)},__wbg_get_652f640b3b0b6e3e:function(e,t){return e[t>>>0]},__wbg_get_9cfea9b7bbf12a15:function(){return d(function(e,t){return Reflect.get(e,t)},arguments)},__wbg_get_unchecked_be562b1421656321:function(e,t){return e[t>>>0]},__wbg_get_with_ref_key_6412cf3094599694:function(e,t){return e[t]},__wbg_has_3a6f31f647e0ba22:function(){return d(function(e,t){return Reflect.has(e,t)},arguments)},__wbg_headers_de17f740bce997ae:function(e){return e.headers},__wbg_instanceof_ArrayBuffer_eab9f28fbec23477:function(e){let t;try{t=e instanceof ArrayBuffer}catch{t=!1}return t},__wbg_instanceof_Map_10d4edf60fcf9327:function(e){let t;try{t=e instanceof Map}catch{t=!1}return t},__wbg_instanceof_Promise_1208ac2399c33e10:function(e){let t;try{t=e instanceof Promise}catch{t=!1}return t},__wbg_instanceof_Response_370b83aa6c17e88a:function(e){let t;try{t=e instanceof Response}catch{t=!1}return t},__wbg_instanceof_Uint8Array_57d77acd50e4c44d:function(e){let t;try{t=e instanceof Uint8Array}catch{t=!1}return t},__wbg_isArray_c6c6ef8308995bcf:function(e){return Array.isArray(e)},__wbg_isSafeInteger_3c56c421a5b4cce4:function(e){return Number.isSafeInteger(e)},__wbg_iterator_9d68985a1d096fc2:function(){return Symbol.iterator},__wbg_length_0a6ce016dc1460b0:function(e){return e.length},__wbg_length_ba3c032602efe310:function(e){return e.length},__wbg_msCrypto_bd5a034af96bcba6:function(e){return e.msCrypto},__wbg_new_0_e486ec9936f7edbf:function(){return new Date},__wbg_new_18865c63fa645c6f:function(){return d(function(){return new Headers},arguments)},__wbg_new_227d7c05414eb861:function(){return new Error},__wbg_new_2fad8ca02fd00684:function(){return new Object},__wbg_new_3baa8d9866155c79:function(){return new Array},__wbg_new_46ae4e4ff2a07a64:function(){return new Map},__wbg_new_51ff470dc2f61e27:function(){return d(function(){return new AbortController},arguments)},__wbg_new_8454eee672b2ba6e:function(e){return new Uint8Array(e)},__wbg_new_b440b9ba53cb2554:function(){return d(function(){return new FileReaderSync},arguments)},__wbg_new_from_slice_5a173c243af2e823:function(e,t){return new Uint8Array(A(e,t))},__wbg_new_typed_1137602701dc87d4:function(e,t){try{var n={a:e,b:t},_=(i,s)=>{const a=n.a;n.a=0;try{return P(a,n.b,i,s)}finally{n.a=a}};return new Promise(_)}finally{n.a=0}},__wbg_new_with_length_9011f5da794bf5d9:function(e){return new Uint8Array(e>>>0)},__wbg_new_with_str_and_init_da311e12114f4d1e:function(){return d(function(e,t,n){return new Request(y(e,t),n)},arguments)},__wbg_next_261c3c48c6e309a5:function(e){return e.next},__wbg_next_aacee310bcfe6461:function(){return d(function(e){return e.next()},arguments)},__wbg_node_84ea875411254db1:function(e){return e.node},__wbg_now_4f457f10f864aec5:function(){return Date.now()},__wbg_process_44c7a14e11e9f69e:function(e){return e.process},__wbg_prototypesetcall_fd4050e806e1d519:function(e,t,n){Uint8Array.prototype.set.call(A(e,t),n)},__wbg_queueMicrotask_40ac6ffc2848ba77:function(e){queueMicrotask(e)},__wbg_queueMicrotask_74d092439f6494c1:function(e){return e.queueMicrotask},__wbg_randomFillSync_6c25eac9869eb53c:function(){return d(function(e,t){e.randomFillSync(t)},arguments)},__wbg_readAsArrayBuffer_952b5bb25ca28be4:function(){return d(function(e,t){return e.readAsArrayBuffer(t)},arguments)},__wbg_require_b4edbdcf3e2a1ef0:function(){return d(function(){return module.require},arguments)},__wbg_resolve_9feb5d906ca62419:function(e){return Promise.resolve(e)},__wbg_setTimeout_f757f00851f76c42:function(e,t){return setTimeout(e,t)},__wbg_set_6be42768c690e380:function(e,t,n){e[t]=n},__wbg_set_82f7a370f604db70:function(e,t,n){return e.set(t,n)},__wbg_set_b0d9dc239ecdb765:function(e,t,n){e.set(A(t,n))},__wbg_set_body_aaff4f5f9991f342:function(e,t){e.body=t},__wbg_set_cache_d1f2b7b4dfa39317:function(e,t){e.cache=$[t]},__wbg_set_credentials_f31e4d30b974ce14:function(e,t){e.credentials=H[t]},__wbg_set_f614f6a0608d1d1d:function(e,t,n){e[t>>>0]=n},__wbg_set_headers_ae96049ea40e9eef:function(e,t){e.headers=t},__wbg_set_method_0eea8a5597775fa1:function(e,t,n){e.method=y(t,n)},__wbg_set_mode_9fe47bff60a1580d:function(e,t){e.mode=X[t]},__wbg_set_signal_8c5cf4c3b27bd8a8:function(e,t){e.signal=t},__wbg_signal_4643ce883b92b553:function(e){return e.signal},__wbg_size_7aa12780f92a63e8:function(e){return e.size},__wbg_slice_4fa1187be1acab2b:function(){return d(function(e,t,n){return e.slice(t,n)},arguments)},__wbg_stack_3b0d974bbf31e44f:function(e,t){const n=t.stack,_=f(n,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},__wbg_static_accessor_GLOBAL_THIS_1c7f1bd6c6941fdb:function(){const e=typeof globalThis>"u"?null:globalThis;return g(e)?0:S(e)},__wbg_static_accessor_GLOBAL_e039bc914f83e74e:function(){const e=typeof global>"u"?null:global;return g(e)?0:S(e)},__wbg_static_accessor_SELF_8bf8c48c28420ad5:function(){const e=typeof self>"u"?null:self;return g(e)?0:S(e)},__wbg_static_accessor_WINDOW_6aeee9b51652ee0f:function(){const e=typeof window>"u"?null:window;return g(e)?0:S(e)},__wbg_status_157e67ab07d01f8a:function(e){return e.status},__wbg_stringify_7fd5cae8859a6f10:function(){return d(function(e){return JSON.stringify(e)},arguments)},__wbg_subarray_fbe3cef290e1fa43:function(e,t,n){return e.subarray(t>>>0,n>>>0)},__wbg_then_20a157d939b514f5:function(e,t){return e.then(t)},__wbg_then_5ef9b762bc91555c:function(e,t,n){return e.then(t,n)},__wbg_url_a0e994e7d0317efc:function(e,t){const n=t.url,_=f(n,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},__wbg_valueOf_96c1596174cf4ec4:function(e){return e.valueOf()},__wbg_value_f852716acdeb3e82:function(e){return e.value},__wbg_versions_276b2795b1c6a219:function(e){return e.versions},__wbg_wasmreader_new:function(e){return v.__wrap(e)},__wbindgen_cast_0000000000000001:function(e,t){return z(e,t,G)},__wbindgen_cast_0000000000000002:function(e,t){return z(e,t,V)},__wbindgen_cast_0000000000000003:function(e){return e},__wbindgen_cast_0000000000000004:function(e){return e},__wbindgen_cast_0000000000000005:function(e,t){return A(e,t)},__wbindgen_cast_0000000000000006:function(e,t){return y(e,t)},__wbindgen_cast_0000000000000007:function(e){return BigInt.asUintN(64,e)},__wbindgen_cast_0000000000000008:function(e,t){var n=A(e,t).slice();return o.__wbindgen_free(e,t*1,1),n},__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)}}}}function V(r,e){o.wasm_bindgen__convert__closures_____invoke__h35494838f8d5430a(r,e)}function G(r,e,t){const n=o.wasm_bindgen__convert__closures_____invoke__he257aae3ff151ab1(r,e,t);if(n[1])throw b(n[0])}function P(r,e,t,n){o.wasm_bindgen__convert__closures_____invoke__h11522b9e21207e0e(r,e,t,n)}const $=["default","no-store","reload","no-cache","force-cache","only-if-cached"],H=["omit","same-origin","include"],X=["same-origin","no-cors","cors","navigate"],x=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>o.__wbg_wasmbuilder_free(r,1)),k=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>o.__wbg_wasmreader_free(r,1));typeof FinalizationRegistry>"u"||new FinalizationRegistry(r=>o.__wbg_wasmsigner_free(r,1));function S(r){const e=o.__externref_table_alloc();return o.__wbindgen_externrefs.set(e,r),e}const N=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>o.__wbindgen_destroy_closure(r.a,r.b));function j(r){const e=typeof r;if(e=="number"||e=="boolean"||r==null)return`${r}`;if(e=="string")return`"${r}"`;if(e=="symbol"){const _=r.description;return _==null?"Symbol":`Symbol(${_})`}if(e=="function"){const _=r.name;return typeof _=="string"&&_.length>0?`Function(${_})`:"Function"}if(Array.isArray(r)){const _=r.length;let c="[";_>0&&(c+=j(r[0]));for(let i=1;i<_;i++)c+=", "+j(r[i]);return c+="]",c}const t=/\\[object ([^\\]]+)\\]/.exec(toString.call(r));let n;if(t&&t.length>1)n=t[1];else return toString.call(r);if(n=="Object")try{return"Object("+JSON.stringify(r)+")"}catch{return"Object"}return r instanceof Error?`${r.name}: ${r.message}\n${r.stack}`:n}function A(r,e){return r=r>>>0,M().subarray(r/1,r/1+e)}let F=null;function m(){return(F===null||F.buffer.detached===!0||F.buffer.detached===void 0&&F.buffer!==o.memory.buffer)&&(F=new DataView(o.memory.buffer)),F}function y(r,e){return K(r>>>0,e)}let B=null;function M(){return(B===null||B.byteLength===0)&&(B=new Uint8Array(o.memory.buffer)),B}function d(r,e){try{return r.apply(this,e)}catch(t){const n=S(t);o.__wbindgen_exn_store(n)}}function g(r){return r==null}function z(r,e,t){const n={a:r,b:e,cnt:1},_=(...c)=>{n.cnt++;const i=n.a;n.a=0;try{return t(i,n.b,...c)}finally{n.a=i,_._wbg_cb_unref()}};return _._wbg_cb_unref=()=>{--n.cnt===0&&(o.__wbindgen_destroy_closure(n.a,n.b),n.a=0,N.unregister(n))},N.register(_,n,n),_}function f(r,e,t){if(t===void 0){const s=T.encode(r),a=e(s.length,1)>>>0;return M().subarray(a,a+s.length).set(s),u=s.length,a}let n=r.length,_=e(n,1)>>>0;const c=M();let i=0;for(;i<n;i++){const s=r.charCodeAt(i);if(s>127)break;c[_+i]=s}if(i!==n){i!==0&&(r=r.slice(i)),_=t(_,n,n=i+r.length*3,1)>>>0;const s=M().subarray(_+i,_+n),a=T.encodeInto(r,s);i+=a.written,_=t(_,n,i,1)>>>0}return u=i,_}function b(r){const e=o.__wbindgen_externrefs.get(r);return o.__externref_table_dealloc(r),e}let E=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});E.decode();const Y=2146435072;let O=0;function K(r,e){return O+=e,O>=Y&&(E=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),E.decode(),O=e),E.decode(M().subarray(r,r+e))}const T=new TextEncoder;"encodeInto"in T||(T.encodeInto=function(r,e){const t=T.encode(r);return e.set(t),{read:r.length,written:t.length}});let u=0,o;function Q(r,e){return o=r.exports,F=null,B=null,o.__wbindgen_start(),o}function Z(r){if(o!==void 0)return o;r!==void 0&&(Object.getPrototypeOf(r)===Object.prototype?{module:r}=r:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const e=J();r instanceof WebAssembly.Module||(r=new WebAssembly.Module(r));const t=new WebAssembly.Instance(r,e);return Q(t)}function D(){let r=0;const e=new Map;return{add(t){const n=r++;return e.set(n,t),n},get(t){const n=e.get(t);if(!n)throw new Error("Attempted to use an object that has been freed");return n},remove(t){return e.delete(t)}}}const L=Symbol("transfer");function I(r,e){return{type:L,value:r,transfer:e?Array.isArray(e)?e:[e]:[r]}}function U(r){return!!(r&&typeof r=="object"&&Reflect.get(r,"type")===L)}function q(r="default"){return{createTx(e){const t=new Map,n=e??self;return n.addEventListener("message",_=>{const{data:c}=_;if(c.channelName!==r)return;const{id:i,result:s,error:a}=c,w=t.get(i);w&&(a?w.reject(a):w.resolve(s),t.delete(i))}),new Proxy({},{get(_,c){return(...i)=>{const s=ee(),a=[],w=[];return i.forEach(R=>{U(R)?(a.push(R.value),w.push(...R.transfer)):a.push(R)}),n.postMessage({method:c,args:a,id:s,channelName:r},{transfer:w}),new Promise((R,_e)=>{t.set(s,{resolve:R,reject:_e})})}}})},rx(e,t){const n=t??self;n.addEventListener("message",async _=>{const{data:c}=_;if(c.channelName!==r)return;const{method:i,args:s,id:a}=c;try{const w=await e[i](...s);U(w)?n.postMessage({result:w.value,id:a,channelName:r},{transfer:w.transfer}):n.postMessage({result:w,id:a,channelName:r})}catch(w){n.postMessage({error:w,id:a,channelName:r})}})}}}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"),h=D(),l=D(),W=ne();te(re({async initWorker(r,e){Z({module:r}),e&&C(e)},async reader_fromBlob(r,e,t){const n=await v.fromBlob(r,e,t);return h.add(n)},async reader_fromBlobFragment(r,e,t,n){const _=await v.fromBlobFragment(r,e,t,n);return h.add(_)},reader_activeLabel(r){return h.get(r).activeLabel()??null},reader_manifestStore(r){return h.get(r).manifestStore()},reader_activeManifest(r){return h.get(r).activeManifest()},reader_json(r){return h.get(r).json()},reader_crJson(r){return h.get(r).crJson()},reader_resourceToBytes(r,e){const n=h.get(r).resourceToBytes(e);return I(n,n.buffer)},reader_free(r){h.get(r).free(),h.remove(r)},builder_new(r){const e=p.new(r);return l.add(e)},builder_fromJson(r,e){const t=p.fromJson(r,e);return l.add(t)},builder_fromArchive(r,e){const t=p.fromArchive(r,e);return l.add(t)},builder_setIntent(r,e){l.get(r).setIntent(e)},builder_addAction(r,e){l.get(r).addAction(e)},builder_addRedaction(r,e,t){l.get(r).addRedaction(e,t)},builder_setRemoteUrl(r,e){l.get(r).setRemoteUrl(e)},builder_setNoEmbed(r,e){l.get(r).setNoEmbed(e)},builder_setThumbnailFromBlob(r,e,t){l.get(r).setThumbnailFromBlob(e,t)},builder_addIngredient(r,e){l.get(r).addIngredient(e)},async builder_addIngredientFromBlob(r,e,t,n){await l.get(r).addIngredientFromBlob(e,t,n)},builder_addResourceFromBlob(r,e,t){l.get(r).addResourceFromBlob(e,t)},builder_getDefinition(r){return l.get(r).getDefinition()},builder_toArchive(r){const t=l.get(r).toArchive();return I(t,t.buffer)},async builder_sign(r,e,t,n,_){const i=await l.get(r).sign({reserveSize:t.reserveSize,alg:t.alg,sign:async s=>await W.sign(e,I(s,s.buffer),t.reserveSize)},n,_);return I(i,i.buffer)},async builder_signAndGetManifestBytes(r,e,t,n,_){const c=l.get(r),{manifest:i,asset:s}=await c.signAndGetManifestBytes({reserveSize:t.reserveSize,alg:t.alg,sign:async a=>await W.sign(e,I(a,a.buffer),t.reserveSize)},n,_);return I({manifest:i,asset:s},[i.buffer,s.buffer])},builder_free(r){l.get(r).free(),l.remove(r)}}));function re(r){const e={};for(const[t,n]of Object.entries(r))e[t]=async(..._)=>{try{return await n(..._)}catch(c){throw typeof c=="string"?new Error(c):c}};return e}})();\n', m = typeof self < "u" && self.Blob && new Blob([T], { type: "text/javascript;charset=utf-8" });
|
|
4
|
-
function L(
|
|
5
|
-
let
|
|
3
|
+
const { createTx: N, rx: Z } = x(), { createTx: Q, rx: U } = x("worker"), T = '(function(){"use strict";class p{static __wrap(e){const t=Object.create(p.prototype);return t.__wbg_ptr=e,x.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,x.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 b(t[0])}addIngredient(e){const t=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),n=u,_=o.wasmbuilder_addIngredient(this.__wbg_ptr,t,n);if(_[1])throw b(_[0])}addIngredientFromBlob(e,t,n){const _=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u,i=f(t,o.__wbindgen_malloc,o.__wbindgen_realloc),s=u;return o.wasmbuilder_addIngredientFromBlob(this.__wbg_ptr,_,c,i,s,n)}addRedaction(e,t){const n=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u,c=o.wasmbuilder_addRedaction(this.__wbg_ptr,n,_,t);if(c[1])throw b(c[0])}addResourceFromBlob(e,t){const n=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u,c=o.wasmbuilder_addResourceFromBlob(this.__wbg_ptr,n,_,t);if(c[1])throw b(c[0])}static fromArchive(e,t){var n=g(t)?0:f(t,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u;const c=o.wasmbuilder_fromArchive(e,n,_);if(c[2])throw b(c[1]);return p.__wrap(c[0])}static fromJson(e,t){const n=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u;var c=g(t)?0:f(t,o.__wbindgen_malloc,o.__wbindgen_realloc),i=u;const s=o.wasmbuilder_fromJson(n,_,c,i);if(s[2])throw b(s[1]);return p.__wrap(s[0])}getDefinition(){const e=o.wasmbuilder_getDefinition(this.__wbg_ptr);if(e[2])throw b(e[1]);return b(e[0])}static new(e){var t=g(e)?0:f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),n=u;const _=o.wasmbuilder_new(t,n);if(_[2])throw b(_[1]);return p.__wrap(_[0])}setIntent(e){const t=o.wasmbuilder_setIntent(this.__wbg_ptr,e);if(t[1])throw b(t[0])}setNoEmbed(e){o.wasmbuilder_setNoEmbed(this.__wbg_ptr,e)}setRemoteUrl(e){const t=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),n=u;o.wasmbuilder_setRemoteUrl(this.__wbg_ptr,t,n)}setThumbnailFromBlob(e,t){const n=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u,c=o.wasmbuilder_setThumbnailFromBlob(this.__wbg_ptr,n,_,t);if(c[1])throw b(c[0])}sign(e,t,n){const _=f(t,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;return o.wasmbuilder_sign(this.__wbg_ptr,e,_,c,n)}signAndGetManifestBytes(e,t,n){const _=f(t,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;return o.wasmbuilder_signAndGetManifestBytes(this.__wbg_ptr,e,_,c,n)}toArchive(){const e=o.wasmbuilder_toArchive(this.__wbg_ptr);if(e[2])throw b(e[1]);return b(e[0])}}Symbol.dispose&&(p.prototype[Symbol.dispose]=p.prototype.free);class v{static __wrap(e){const t=Object.create(v.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_wasmreader_free(e,0)}activeLabel(){const e=o.wasmreader_activeLabel(this.__wbg_ptr);let t;return e[0]!==0&&(t=y(e[0],e[1]).slice(),o.__wbindgen_free(e[0],e[1]*1,1)),t}activeManifest(){const e=o.wasmreader_activeManifest(this.__wbg_ptr);if(e[2])throw b(e[1]);return b(e[0])}crJson(){let e,t;try{const n=o.wasmreader_crJson(this.__wbg_ptr);return e=n[0],t=n[1],y(n[0],n[1])}finally{o.__wbindgen_free(e,t,1)}}static fromBlob(e,t,n){const _=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;var i=g(n)?0:f(n,o.__wbindgen_malloc,o.__wbindgen_realloc),s=u;return o.wasmreader_fromBlob(_,c,t,i,s)}static fromBlobFragment(e,t,n,_){const c=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),i=u;var s=g(_)?0:f(_,o.__wbindgen_malloc,o.__wbindgen_realloc),a=u;return o.wasmreader_fromBlobFragment(c,i,t,n,s,a)}json(){let e,t;try{const n=o.wasmreader_json(this.__wbg_ptr);return e=n[0],t=n[1],y(n[0],n[1])}finally{o.__wbindgen_free(e,t,1)}}manifestStore(){const e=o.wasmreader_manifestStore(this.__wbg_ptr);if(e[2])throw b(e[1]);return b(e[0])}resourceToBytes(e){const t=f(e,o.__wbindgen_malloc,o.__wbindgen_realloc),n=u,_=o.wasmreader_resourceToBytes(this.__wbg_ptr,t,n);if(_[2])throw b(_[1]);return b(_[0])}}Symbol.dispose&&(v.prototype[Symbol.dispose]=v.prototype.free);function C(r){const e=f(r,o.__wbindgen_malloc,o.__wbindgen_realloc),t=u,n=o.loadSettings(e,t);if(n[1])throw b(n[0])}function J(){return{__proto__:null,"./c2pa_bg.js":{__proto__:null,__wbg_Error_3639a60ed15f87e7:function(e,t){return Error(y(e,t))},__wbg_Number_a3d737fd183f7dca:function(e){return Number(e)},__wbg___wbindgen_bigint_get_as_i64_3af6d4ca77193a4b:function(e,t){const n=t,_=typeof n=="bigint"?n:void 0;m().setBigInt64(e+8,g(_)?BigInt(0):_,!0),m().setInt32(e+0,!g(_),!0)},__wbg___wbindgen_boolean_get_c3dd5c39f1b5a12b:function(e){const t=e,n=typeof t=="boolean"?t:void 0;return g(n)?16777215:n?1:0},__wbg___wbindgen_debug_string_07cb72cfcc952e2b:function(e,t){const n=j(t),_=f(n,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},__wbg___wbindgen_in_2617fa76397620d3:function(e,t){return e in t},__wbg___wbindgen_is_bigint_d6a8167cac401b95:function(e){return typeof e=="bigint"},__wbg___wbindgen_is_function_2f0fd7ceb86e64c5:function(e){return typeof e=="function"},__wbg___wbindgen_is_object_5b22ff2418063a9c:function(e){const t=e;return typeof t=="object"&&t!==null},__wbg___wbindgen_is_string_eddc07a3efad52e6:function(e){return typeof e=="string"},__wbg___wbindgen_is_undefined_244a92c34d3b6ec0:function(e){return e===void 0},__wbg___wbindgen_jsval_eq_403eaa3610500a25:function(e,t){return e===t},__wbg___wbindgen_jsval_loose_eq_1978f1e77b4bce62:function(e,t){return e==t},__wbg___wbindgen_number_get_dd6d69a6079f26f1:function(e,t){const n=t,_=typeof n=="number"?n:void 0;m().setFloat64(e+8,g(_)?0:_,!0),m().setInt32(e+0,!g(_),!0)},__wbg___wbindgen_string_get_965592073e5d848c:function(e,t){const n=t,_=typeof n=="string"?n:void 0;var c=g(_)?0:f(_,o.__wbindgen_malloc,o.__wbindgen_realloc),i=u;m().setInt32(e+4,i,!0),m().setInt32(e+0,c,!0)},__wbg___wbindgen_throw_9c75d47bf9e7731e:function(e,t){throw new Error(y(e,t))},__wbg__wbg_cb_unref_158e43e869788cdc:function(e){e._wbg_cb_unref()},__wbg_abort_43913e33ecb83d0d:function(e,t){e.abort(t)},__wbg_abort_87eb7f23cf4b73d1:function(e){e.abort()},__wbg_append_8df396311184f750:function(){return d(function(e,t,n,_,c){e.append(y(t,n),y(_,c))},arguments)},__wbg_arrayBuffer_87e3ac06d961f7a0:function(){return d(function(e){return e.arrayBuffer()},arguments)},__wbg_byteLength_1f57c71e64ee0180:function(e){return e.byteLength},__wbg_call_a41d6421b30a32c5:function(){return d(function(e,t,n){return e.call(t,n)},arguments)},__wbg_call_add9e5a76382e668:function(){return d(function(e,t){return e.call(t)},arguments)},__wbg_clearTimeout_6b8d9a38b9263d65:function(e){return clearTimeout(e)},__wbg_crypto_38df2bab126b63dc:function(e){return e.crypto},__wbg_done_b1afd6201ac045e0:function(e){return e.done},__wbg_entries_bb9843ba73dc70d6:function(e){return Object.entries(e)},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,_;try{n=e,_=t,console.error(y(e,t))}finally{o.__wbindgen_free(n,_,1)}},__wbg_fetch_1a030943aa8e0c38:function(e,t){return e.fetch(t)},__wbg_fetch_9dad4fe911207b37:function(e){return fetch(e)},__wbg_from_ff141b1e4c69b979:function(e){return Array.from(e)},__wbg_getRandomValues_3f44b700395062e5:function(){return d(function(e,t){globalThis.crypto.getRandomValues(A(e,t))},arguments)},__wbg_getRandomValues_c44a50d8cfdaebeb:function(){return d(function(e,t){e.getRandomValues(t)},arguments)},__wbg_getRandomValues_ef12552bf5acd2fe:function(){return d(function(e,t){globalThis.crypto.getRandomValues(A(e,t))},arguments)},__wbg_getTime_e599bee315e19eba:function(e){return e.getTime()},__wbg_get_41476db20fef99a8:function(){return d(function(e,t){return Reflect.get(e,t)},arguments)},__wbg_get_652f640b3b0b6e3e:function(e,t){return e[t>>>0]},__wbg_get_9cfea9b7bbf12a15:function(){return d(function(e,t){return Reflect.get(e,t)},arguments)},__wbg_get_unchecked_be562b1421656321:function(e,t){return e[t>>>0]},__wbg_get_with_ref_key_6412cf3094599694:function(e,t){return e[t]},__wbg_has_3a6f31f647e0ba22:function(){return d(function(e,t){return Reflect.has(e,t)},arguments)},__wbg_headers_de17f740bce997ae:function(e){return e.headers},__wbg_instanceof_ArrayBuffer_eab9f28fbec23477:function(e){let t;try{t=e instanceof ArrayBuffer}catch{t=!1}return t},__wbg_instanceof_Map_10d4edf60fcf9327:function(e){let t;try{t=e instanceof Map}catch{t=!1}return t},__wbg_instanceof_Promise_1208ac2399c33e10:function(e){let t;try{t=e instanceof Promise}catch{t=!1}return t},__wbg_instanceof_Response_370b83aa6c17e88a:function(e){let t;try{t=e instanceof Response}catch{t=!1}return t},__wbg_instanceof_Uint8Array_57d77acd50e4c44d:function(e){let t;try{t=e instanceof Uint8Array}catch{t=!1}return t},__wbg_isArray_c6c6ef8308995bcf:function(e){return Array.isArray(e)},__wbg_isSafeInteger_3c56c421a5b4cce4:function(e){return Number.isSafeInteger(e)},__wbg_iterator_9d68985a1d096fc2:function(){return Symbol.iterator},__wbg_length_0a6ce016dc1460b0:function(e){return e.length},__wbg_length_ba3c032602efe310:function(e){return e.length},__wbg_msCrypto_bd5a034af96bcba6:function(e){return e.msCrypto},__wbg_new_0_e486ec9936f7edbf:function(){return new Date},__wbg_new_18865c63fa645c6f:function(){return d(function(){return new Headers},arguments)},__wbg_new_227d7c05414eb861:function(){return new Error},__wbg_new_2fad8ca02fd00684:function(){return new Object},__wbg_new_3baa8d9866155c79:function(){return new Array},__wbg_new_46ae4e4ff2a07a64:function(){return new Map},__wbg_new_51ff470dc2f61e27:function(){return d(function(){return new AbortController},arguments)},__wbg_new_8454eee672b2ba6e:function(e){return new Uint8Array(e)},__wbg_new_b440b9ba53cb2554:function(){return d(function(){return new FileReaderSync},arguments)},__wbg_new_from_slice_5a173c243af2e823:function(e,t){return new Uint8Array(A(e,t))},__wbg_new_typed_1137602701dc87d4:function(e,t){try{var n={a:e,b:t},_=(i,s)=>{const a=n.a;n.a=0;try{return P(a,n.b,i,s)}finally{n.a=a}};return new Promise(_)}finally{n.a=0}},__wbg_new_with_length_9011f5da794bf5d9:function(e){return new Uint8Array(e>>>0)},__wbg_new_with_str_and_init_da311e12114f4d1e:function(){return d(function(e,t,n){return new Request(y(e,t),n)},arguments)},__wbg_next_261c3c48c6e309a5:function(e){return e.next},__wbg_next_aacee310bcfe6461:function(){return d(function(e){return e.next()},arguments)},__wbg_node_84ea875411254db1:function(e){return e.node},__wbg_now_4f457f10f864aec5:function(){return Date.now()},__wbg_process_44c7a14e11e9f69e:function(e){return e.process},__wbg_prototypesetcall_fd4050e806e1d519:function(e,t,n){Uint8Array.prototype.set.call(A(e,t),n)},__wbg_queueMicrotask_40ac6ffc2848ba77:function(e){queueMicrotask(e)},__wbg_queueMicrotask_74d092439f6494c1:function(e){return e.queueMicrotask},__wbg_randomFillSync_6c25eac9869eb53c:function(){return d(function(e,t){e.randomFillSync(t)},arguments)},__wbg_readAsArrayBuffer_952b5bb25ca28be4:function(){return d(function(e,t){return e.readAsArrayBuffer(t)},arguments)},__wbg_require_b4edbdcf3e2a1ef0:function(){return d(function(){return module.require},arguments)},__wbg_resolve_9feb5d906ca62419:function(e){return Promise.resolve(e)},__wbg_setTimeout_f757f00851f76c42:function(e,t){return setTimeout(e,t)},__wbg_set_6be42768c690e380:function(e,t,n){e[t]=n},__wbg_set_82f7a370f604db70:function(e,t,n){return e.set(t,n)},__wbg_set_b0d9dc239ecdb765:function(e,t,n){e.set(A(t,n))},__wbg_set_body_aaff4f5f9991f342:function(e,t){e.body=t},__wbg_set_cache_d1f2b7b4dfa39317:function(e,t){e.cache=$[t]},__wbg_set_credentials_f31e4d30b974ce14:function(e,t){e.credentials=H[t]},__wbg_set_f614f6a0608d1d1d:function(e,t,n){e[t>>>0]=n},__wbg_set_headers_ae96049ea40e9eef:function(e,t){e.headers=t},__wbg_set_method_0eea8a5597775fa1:function(e,t,n){e.method=y(t,n)},__wbg_set_mode_9fe47bff60a1580d:function(e,t){e.mode=X[t]},__wbg_set_signal_8c5cf4c3b27bd8a8:function(e,t){e.signal=t},__wbg_signal_4643ce883b92b553:function(e){return e.signal},__wbg_size_7aa12780f92a63e8:function(e){return e.size},__wbg_slice_4fa1187be1acab2b:function(){return d(function(e,t,n){return e.slice(t,n)},arguments)},__wbg_stack_3b0d974bbf31e44f:function(e,t){const n=t.stack,_=f(n,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},__wbg_static_accessor_GLOBAL_THIS_1c7f1bd6c6941fdb:function(){const e=typeof globalThis>"u"?null:globalThis;return g(e)?0:S(e)},__wbg_static_accessor_GLOBAL_e039bc914f83e74e:function(){const e=typeof global>"u"?null:global;return g(e)?0:S(e)},__wbg_static_accessor_SELF_8bf8c48c28420ad5:function(){const e=typeof self>"u"?null:self;return g(e)?0:S(e)},__wbg_static_accessor_WINDOW_6aeee9b51652ee0f:function(){const e=typeof window>"u"?null:window;return g(e)?0:S(e)},__wbg_status_157e67ab07d01f8a:function(e){return e.status},__wbg_stringify_7fd5cae8859a6f10:function(){return d(function(e){return JSON.stringify(e)},arguments)},__wbg_subarray_fbe3cef290e1fa43:function(e,t,n){return e.subarray(t>>>0,n>>>0)},__wbg_then_20a157d939b514f5:function(e,t){return e.then(t)},__wbg_then_5ef9b762bc91555c:function(e,t,n){return e.then(t,n)},__wbg_url_a0e994e7d0317efc:function(e,t){const n=t.url,_=f(n,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},__wbg_valueOf_96c1596174cf4ec4:function(e){return e.valueOf()},__wbg_value_f852716acdeb3e82:function(e){return e.value},__wbg_versions_276b2795b1c6a219:function(e){return e.versions},__wbg_wasmreader_new:function(e){return v.__wrap(e)},__wbindgen_cast_0000000000000001:function(e,t){return z(e,t,G)},__wbindgen_cast_0000000000000002:function(e,t){return z(e,t,V)},__wbindgen_cast_0000000000000003:function(e){return e},__wbindgen_cast_0000000000000004:function(e){return e},__wbindgen_cast_0000000000000005:function(e,t){return A(e,t)},__wbindgen_cast_0000000000000006:function(e,t){return y(e,t)},__wbindgen_cast_0000000000000007:function(e){return BigInt.asUintN(64,e)},__wbindgen_cast_0000000000000008:function(e,t){var n=A(e,t).slice();return o.__wbindgen_free(e,t*1,1),n},__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)}}}}function V(r,e){o.wasm_bindgen__convert__closures_____invoke__hb660c60820732a9e(r,e)}function G(r,e,t){const n=o.wasm_bindgen__convert__closures_____invoke__h4aa26a54fe4da3a7(r,e,t);if(n[1])throw b(n[0])}function P(r,e,t,n){o.wasm_bindgen__convert__closures_____invoke__h71c2fa3b316ba280(r,e,t,n)}const $=["default","no-store","reload","no-cache","force-cache","only-if-cached"],H=["omit","same-origin","include"],X=["same-origin","no-cors","cors","navigate"],x=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>o.__wbg_wasmbuilder_free(r,1)),k=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>o.__wbg_wasmreader_free(r,1));typeof FinalizationRegistry>"u"||new FinalizationRegistry(r=>o.__wbg_wasmsigner_free(r,1));function S(r){const e=o.__externref_table_alloc();return o.__wbindgen_externrefs.set(e,r),e}const N=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>o.__wbindgen_destroy_closure(r.a,r.b));function j(r){const e=typeof r;if(e=="number"||e=="boolean"||r==null)return`${r}`;if(e=="string")return`"${r}"`;if(e=="symbol"){const _=r.description;return _==null?"Symbol":`Symbol(${_})`}if(e=="function"){const _=r.name;return typeof _=="string"&&_.length>0?`Function(${_})`:"Function"}if(Array.isArray(r)){const _=r.length;let c="[";_>0&&(c+=j(r[0]));for(let i=1;i<_;i++)c+=", "+j(r[i]);return c+="]",c}const t=/\\[object ([^\\]]+)\\]/.exec(toString.call(r));let n;if(t&&t.length>1)n=t[1];else return toString.call(r);if(n=="Object")try{return"Object("+JSON.stringify(r)+")"}catch{return"Object"}return r instanceof Error?`${r.name}: ${r.message}\n${r.stack}`:n}function A(r,e){return r=r>>>0,M().subarray(r/1,r/1+e)}let F=null;function m(){return(F===null||F.buffer.detached===!0||F.buffer.detached===void 0&&F.buffer!==o.memory.buffer)&&(F=new DataView(o.memory.buffer)),F}function y(r,e){return K(r>>>0,e)}let B=null;function M(){return(B===null||B.byteLength===0)&&(B=new Uint8Array(o.memory.buffer)),B}function d(r,e){try{return r.apply(this,e)}catch(t){const n=S(t);o.__wbindgen_exn_store(n)}}function g(r){return r==null}function z(r,e,t){const n={a:r,b:e,cnt:1},_=(...c)=>{n.cnt++;const i=n.a;n.a=0;try{return t(i,n.b,...c)}finally{n.a=i,_._wbg_cb_unref()}};return _._wbg_cb_unref=()=>{--n.cnt===0&&(o.__wbindgen_destroy_closure(n.a,n.b),n.a=0,N.unregister(n))},N.register(_,n,n),_}function f(r,e,t){if(t===void 0){const s=T.encode(r),a=e(s.length,1)>>>0;return M().subarray(a,a+s.length).set(s),u=s.length,a}let n=r.length,_=e(n,1)>>>0;const c=M();let i=0;for(;i<n;i++){const s=r.charCodeAt(i);if(s>127)break;c[_+i]=s}if(i!==n){i!==0&&(r=r.slice(i)),_=t(_,n,n=i+r.length*3,1)>>>0;const s=M().subarray(_+i,_+n),a=T.encodeInto(r,s);i+=a.written,_=t(_,n,i,1)>>>0}return u=i,_}function b(r){const e=o.__wbindgen_externrefs.get(r);return o.__externref_table_dealloc(r),e}let E=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});E.decode();const Y=2146435072;let O=0;function K(r,e){return O+=e,O>=Y&&(E=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),E.decode(),O=e),E.decode(M().subarray(r,r+e))}const T=new TextEncoder;"encodeInto"in T||(T.encodeInto=function(r,e){const t=T.encode(r);return e.set(t),{read:r.length,written:t.length}});let u=0,o;function Q(r,e){return o=r.exports,F=null,B=null,o.__wbindgen_start(),o}function Z(r){if(o!==void 0)return o;r!==void 0&&(Object.getPrototypeOf(r)===Object.prototype?{module:r}=r:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const e=J();r instanceof WebAssembly.Module||(r=new WebAssembly.Module(r));const t=new WebAssembly.Instance(r,e);return Q(t)}function D(){let r=0;const e=new Map;return{add(t){const n=r++;return e.set(n,t),n},get(t){const n=e.get(t);if(!n)throw new Error("Attempted to use an object that has been freed");return n},remove(t){return e.delete(t)}}}const L=Symbol("transfer");function I(r,e){return{type:L,value:r,transfer:e?Array.isArray(e)?e:[e]:[r]}}function U(r){return!!(r&&typeof r=="object"&&Reflect.get(r,"type")===L)}function q(r="default"){return{createTx(e){const t=new Map,n=e??self;return n.addEventListener("message",_=>{const{data:c}=_;if(c.channelName!==r)return;const{id:i,result:s,error:a}=c,w=t.get(i);w&&(a?w.reject(a):w.resolve(s),t.delete(i))}),new Proxy({},{get(_,c){return(...i)=>{const s=ee(),a=[],w=[];return i.forEach(R=>{U(R)?(a.push(R.value),w.push(...R.transfer)):a.push(R)}),n.postMessage({method:c,args:a,id:s,channelName:r},{transfer:w}),new Promise((R,_e)=>{t.set(s,{resolve:R,reject:_e})})}}})},rx(e,t){const n=t??self;n.addEventListener("message",async _=>{const{data:c}=_;if(c.channelName!==r)return;const{method:i,args:s,id:a}=c;try{const w=await e[i](...s);U(w)?n.postMessage({result:w.value,id:a,channelName:r},{transfer:w.transfer}):n.postMessage({result:w,id:a,channelName:r})}catch(w){n.postMessage({error:w,id:a,channelName:r})}})}}}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"),h=D(),l=D(),W=ne();te(re({async initWorker(r,e){Z({module:r}),e&&C(e)},async reader_fromBlob(r,e,t){const n=await v.fromBlob(r,e,t);return h.add(n)},async reader_fromBlobFragment(r,e,t,n){const _=await v.fromBlobFragment(r,e,t,n);return h.add(_)},reader_activeLabel(r){return h.get(r).activeLabel()??null},reader_manifestStore(r){return h.get(r).manifestStore()},reader_activeManifest(r){return h.get(r).activeManifest()},reader_json(r){return h.get(r).json()},reader_crJson(r){return h.get(r).crJson()},reader_resourceToBytes(r,e){const n=h.get(r).resourceToBytes(e);return I(n,n.buffer)},reader_free(r){h.get(r).free(),h.remove(r)},builder_new(r){const e=p.new(r);return l.add(e)},builder_fromJson(r,e){const t=p.fromJson(r,e);return l.add(t)},builder_fromArchive(r,e){const t=p.fromArchive(r,e);return l.add(t)},builder_setIntent(r,e){l.get(r).setIntent(e)},builder_addAction(r,e){l.get(r).addAction(e)},builder_addRedaction(r,e,t){l.get(r).addRedaction(e,t)},builder_setRemoteUrl(r,e){l.get(r).setRemoteUrl(e)},builder_setNoEmbed(r,e){l.get(r).setNoEmbed(e)},builder_setThumbnailFromBlob(r,e,t){l.get(r).setThumbnailFromBlob(e,t)},builder_addIngredient(r,e){l.get(r).addIngredient(e)},async builder_addIngredientFromBlob(r,e,t,n){await l.get(r).addIngredientFromBlob(e,t,n)},builder_addResourceFromBlob(r,e,t){l.get(r).addResourceFromBlob(e,t)},builder_getDefinition(r){return l.get(r).getDefinition()},builder_toArchive(r){const t=l.get(r).toArchive();return I(t,t.buffer)},async builder_sign(r,e,t,n,_){const i=await l.get(r).sign({reserveSize:t.reserveSize,alg:t.alg,sign:async s=>await W.sign(e,I(s,s.buffer),t.reserveSize)},n,_);return I(i,i.buffer)},async builder_signAndGetManifestBytes(r,e,t,n,_){const c=l.get(r),{manifest:i,asset:s}=await c.signAndGetManifestBytes({reserveSize:t.reserveSize,alg:t.alg,sign:async a=>await W.sign(e,I(a,a.buffer),t.reserveSize)},n,_);return I({manifest:i,asset:s},[i.buffer,s.buffer])},builder_free(r){l.get(r).free(),l.remove(r)}}));function re(r){const e={};for(const[t,n]of Object.entries(r))e[t]=async(..._)=>{try{return await n(..._)}catch(c){throw typeof c=="string"?new Error(c):c}};return e}})();\n', m = typeof self < "u" && self.Blob && new Blob([T], { type: "text/javascript;charset=utf-8" });
|
|
4
|
+
function L(t) {
|
|
5
|
+
let e;
|
|
6
6
|
try {
|
|
7
|
-
if (
|
|
8
|
-
const _ = new Worker(
|
|
9
|
-
name:
|
|
7
|
+
if (e = m && (self.URL || self.webkitURL).createObjectURL(m), !e) throw "";
|
|
8
|
+
const _ = new Worker(e, {
|
|
9
|
+
name: t == null ? void 0 : t.name
|
|
10
10
|
});
|
|
11
11
|
return _.addEventListener("error", () => {
|
|
12
|
-
(self.URL || self.webkitURL).revokeObjectURL(
|
|
12
|
+
(self.URL || self.webkitURL).revokeObjectURL(e);
|
|
13
13
|
}), _;
|
|
14
14
|
} catch {
|
|
15
15
|
return new Worker(
|
|
16
16
|
"data:text/javascript;charset=utf-8," + encodeURIComponent(T),
|
|
17
17
|
{
|
|
18
|
-
name:
|
|
18
|
+
name: t == null ? void 0 : t.name
|
|
19
19
|
}
|
|
20
20
|
);
|
|
21
21
|
} finally {
|
|
22
|
-
|
|
22
|
+
e && (self.URL || self.webkitURL).revokeObjectURL(e);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
async function
|
|
26
|
-
const { wasm:
|
|
25
|
+
async function k(t) {
|
|
26
|
+
const { wasm: e, settingsString: _ } = t;
|
|
27
27
|
let r = 0;
|
|
28
|
-
const n = new L(), o =
|
|
29
|
-
|
|
28
|
+
const n = new L(), o = N(n), i = /* @__PURE__ */ new Map();
|
|
29
|
+
U(
|
|
30
30
|
{
|
|
31
|
-
sign: async (
|
|
32
|
-
const l = i.get(
|
|
33
|
-
if (i.delete(
|
|
31
|
+
sign: async (s, c, j) => {
|
|
32
|
+
const l = i.get(s);
|
|
33
|
+
if (i.delete(s), !l)
|
|
34
34
|
throw new Error("No signer registered for request");
|
|
35
|
-
const w = await l(
|
|
36
|
-
return
|
|
35
|
+
const w = await l(c, j);
|
|
36
|
+
return z(w, w.buffer);
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
n
|
|
40
40
|
);
|
|
41
|
-
function a(
|
|
42
|
-
const
|
|
43
|
-
return i.set(
|
|
41
|
+
function a(s) {
|
|
42
|
+
const c = r++;
|
|
43
|
+
return i.set(c, s), c;
|
|
44
44
|
}
|
|
45
|
-
return await o.initWorker(
|
|
45
|
+
return await o.initWorker(e, _), {
|
|
46
46
|
tx: o,
|
|
47
47
|
registerSignReceiver: a,
|
|
48
48
|
terminate: () => n.terminate()
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
class y extends Error {
|
|
52
|
-
constructor(
|
|
52
|
+
constructor(e) {
|
|
53
53
|
super(
|
|
54
|
-
`The provided asset was too large. Size: ${
|
|
54
|
+
`The provided asset was too large. Size: ${e} bytes. Maximum: ${g}.`
|
|
55
55
|
), this.name = "AssetTooLargeError";
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
class
|
|
59
|
-
constructor(
|
|
60
|
-
super(`Unsupported format: ${
|
|
58
|
+
class h extends Error {
|
|
59
|
+
constructor(e) {
|
|
60
|
+
super(`Unsupported format: ${e}.`), this.name = "UnsupportedFormatError";
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
const J = [
|
|
@@ -119,254 +119,274 @@ const J = [
|
|
|
119
119
|
"nef",
|
|
120
120
|
"heif"
|
|
121
121
|
];
|
|
122
|
-
function
|
|
123
|
-
return J.includes(
|
|
122
|
+
function p(t) {
|
|
123
|
+
return J.includes(t);
|
|
124
124
|
}
|
|
125
|
-
const
|
|
125
|
+
const W = {
|
|
126
|
+
userAnchors: !0,
|
|
127
|
+
trustAnchors: !0,
|
|
128
|
+
trustConfig: !0,
|
|
129
|
+
allowedList: !0
|
|
130
|
+
}, C = Object.keys(W), P = {
|
|
126
131
|
builder: {
|
|
127
132
|
generateC2paArchive: !0
|
|
128
133
|
}
|
|
129
|
-
};
|
|
130
|
-
async function u(
|
|
131
|
-
const
|
|
132
|
-
return
|
|
134
|
+
}, v = 1 * 1024 * 1024;
|
|
135
|
+
async function u(t) {
|
|
136
|
+
const e = O(P, t), _ = [];
|
|
137
|
+
return e.trust && _.push(R(e.trust)), e.cawgTrust && _.push(R(e.cawgTrust)), await Promise.all(_), JSON.stringify(M(e));
|
|
133
138
|
}
|
|
134
|
-
function
|
|
135
|
-
return Object.entries(
|
|
136
|
-
(_, [r, n]) => (_[
|
|
139
|
+
function M(t) {
|
|
140
|
+
return Object.entries(t).reduce(
|
|
141
|
+
(_, [r, n]) => (_[D(r)] = typeof n == "object" && n !== null ? M(n) : n, _),
|
|
137
142
|
{}
|
|
138
143
|
);
|
|
139
144
|
}
|
|
140
|
-
function
|
|
141
|
-
return
|
|
145
|
+
function D(t) {
|
|
146
|
+
return t.replace(/[A-Z]/g, (e) => `_${e.toLowerCase()}`);
|
|
142
147
|
}
|
|
143
|
-
async function
|
|
148
|
+
async function R(t) {
|
|
144
149
|
try {
|
|
145
|
-
const
|
|
146
|
-
if (Array.isArray(r)) {
|
|
150
|
+
const e = Object.entries(t).filter(([_]) => C.includes(_)).map(async ([_, r]) => {
|
|
151
|
+
if (r && typeof r == "object" && Array.isArray(r)) {
|
|
147
152
|
const n = r.map(async (a) => {
|
|
148
|
-
|
|
149
|
-
|
|
153
|
+
if (typeof a != "string")
|
|
154
|
+
throw new Error("Expected a string value for array item");
|
|
155
|
+
const s = await F(a);
|
|
156
|
+
if (S(_) && !A(s))
|
|
150
157
|
throw new Error(`Error parsing PEM file at: ${a}`);
|
|
151
|
-
return
|
|
158
|
+
return s;
|
|
152
159
|
}), i = (await Promise.all(n)).join("");
|
|
153
|
-
|
|
154
|
-
} else if (r &&
|
|
155
|
-
const n = await
|
|
156
|
-
if (
|
|
160
|
+
t[_] = i;
|
|
161
|
+
} else if (r && typeof r == "string" && $(r)) {
|
|
162
|
+
const n = await F(r);
|
|
163
|
+
if (S(_) && !A(n))
|
|
157
164
|
throw new Error(`Error parsing PEM file at: ${r}`);
|
|
158
|
-
|
|
165
|
+
t[_] = n;
|
|
159
166
|
} else
|
|
160
167
|
return r;
|
|
161
168
|
});
|
|
162
|
-
await Promise.all(
|
|
163
|
-
} catch (
|
|
164
|
-
|
|
169
|
+
await Promise.all(e);
|
|
170
|
+
} catch (e) {
|
|
171
|
+
const _ = e instanceof Error ? e.message : String(e);
|
|
172
|
+
throw new Error(`Failed to resolve trust settings. ${_}`, { cause: e });
|
|
165
173
|
}
|
|
166
174
|
}
|
|
167
|
-
const
|
|
168
|
-
async function
|
|
169
|
-
|
|
175
|
+
const S = (t) => ["userAnchors", "trustAnchors"].includes(t), A = (t) => t.includes("-----BEGIN CERTIFICATE-----"), $ = (t) => t.startsWith("http");
|
|
176
|
+
async function F(t) {
|
|
177
|
+
let e;
|
|
178
|
+
try {
|
|
179
|
+
e = await fetch(t);
|
|
180
|
+
} catch (r) {
|
|
181
|
+
const n = r instanceof Error ? r.message : String(r);
|
|
182
|
+
throw new Error(`Network error fetching ${t}: ${n}`, { cause: r });
|
|
183
|
+
}
|
|
184
|
+
if (!e.ok)
|
|
185
|
+
throw new Error(`Failed to fetch ${t}: ${e.status} ${e.statusText}`);
|
|
186
|
+
const _ = await e.text();
|
|
187
|
+
if (_.length > v)
|
|
188
|
+
throw new Error(`Response from ${t} is too large. Max size is ${v} bytes.`);
|
|
189
|
+
return _;
|
|
170
190
|
}
|
|
171
191
|
const g = 10 ** 9;
|
|
172
|
-
function
|
|
173
|
-
const { tx:
|
|
174
|
-
await
|
|
192
|
+
function q(t) {
|
|
193
|
+
const { tx: e } = t, _ = new FinalizationRegistry(async (r) => {
|
|
194
|
+
await e.reader_free(r);
|
|
175
195
|
});
|
|
176
196
|
return {
|
|
177
197
|
async fromBlob(r, n, o) {
|
|
178
|
-
if (!
|
|
179
|
-
throw new
|
|
198
|
+
if (!p(r))
|
|
199
|
+
throw new h(r);
|
|
180
200
|
if (n.size > g)
|
|
181
201
|
throw new y(n.size);
|
|
182
202
|
try {
|
|
183
|
-
const i = o && await u(o), a = await
|
|
184
|
-
_.unregister(
|
|
203
|
+
const i = o && await u(o), a = await e.reader_fromBlob(r, n, i), s = E(t, a, () => {
|
|
204
|
+
_.unregister(s);
|
|
185
205
|
});
|
|
186
|
-
return _.register(
|
|
206
|
+
return _.register(s, a, s), s;
|
|
187
207
|
} catch (i) {
|
|
188
208
|
return B(i);
|
|
189
209
|
}
|
|
190
210
|
},
|
|
191
211
|
async fromBlobFragment(r, n, o, i) {
|
|
192
|
-
if (!
|
|
193
|
-
throw new
|
|
212
|
+
if (!p(r))
|
|
213
|
+
throw new h(r);
|
|
194
214
|
if (n.size > g)
|
|
195
215
|
throw new y(n.size);
|
|
196
216
|
try {
|
|
197
|
-
const a = i && await u(i),
|
|
217
|
+
const a = i && await u(i), s = await e.reader_fromBlobFragment(
|
|
198
218
|
r,
|
|
199
219
|
n,
|
|
200
220
|
o,
|
|
201
221
|
a
|
|
202
|
-
),
|
|
203
|
-
_.unregister(
|
|
222
|
+
), c = E(t, s, () => {
|
|
223
|
+
_.unregister(c);
|
|
204
224
|
});
|
|
205
|
-
return _.register(s, c
|
|
225
|
+
return _.register(c, s, c), c;
|
|
206
226
|
} catch (a) {
|
|
207
227
|
return B(a);
|
|
208
228
|
}
|
|
209
229
|
}
|
|
210
230
|
};
|
|
211
231
|
}
|
|
212
|
-
function B(
|
|
213
|
-
if (
|
|
232
|
+
function B(t) {
|
|
233
|
+
if (t instanceof Error && t.message === "C2pa(JumbfNotFound)")
|
|
214
234
|
return null;
|
|
215
|
-
throw
|
|
235
|
+
throw t;
|
|
216
236
|
}
|
|
217
|
-
function
|
|
218
|
-
const { tx: r } =
|
|
237
|
+
function E(t, e, _) {
|
|
238
|
+
const { tx: r } = t;
|
|
219
239
|
return {
|
|
220
240
|
async activeLabel() {
|
|
221
|
-
return await r.reader_activeLabel(
|
|
241
|
+
return await r.reader_activeLabel(e);
|
|
222
242
|
},
|
|
223
243
|
async manifestStore() {
|
|
224
|
-
return await r.reader_manifestStore(
|
|
244
|
+
return await r.reader_manifestStore(e);
|
|
225
245
|
},
|
|
226
246
|
async activeManifest() {
|
|
227
|
-
return await r.reader_activeManifest(
|
|
247
|
+
return await r.reader_activeManifest(e);
|
|
228
248
|
},
|
|
229
249
|
async json() {
|
|
230
|
-
const n = await r.reader_json(
|
|
250
|
+
const n = await r.reader_json(e);
|
|
231
251
|
return JSON.parse(n);
|
|
232
252
|
},
|
|
233
253
|
async crJson() {
|
|
234
|
-
const n = await r.reader_crJson(
|
|
254
|
+
const n = await r.reader_crJson(e);
|
|
235
255
|
return JSON.parse(n);
|
|
236
256
|
},
|
|
237
257
|
async resourceToBytes(n) {
|
|
238
|
-
return await r.reader_resourceToBytes(
|
|
258
|
+
return await r.reader_resourceToBytes(e, n);
|
|
239
259
|
},
|
|
240
260
|
async free() {
|
|
241
|
-
_(), await r.reader_free(
|
|
261
|
+
_(), await r.reader_free(e);
|
|
242
262
|
}
|
|
243
263
|
};
|
|
244
264
|
}
|
|
245
|
-
typeof FinalizationRegistry > "u" || new FinalizationRegistry((
|
|
246
|
-
typeof FinalizationRegistry > "u" || new FinalizationRegistry((
|
|
247
|
-
typeof FinalizationRegistry > "u" || new FinalizationRegistry((
|
|
248
|
-
typeof FinalizationRegistry > "u" || new FinalizationRegistry((
|
|
249
|
-
let
|
|
250
|
-
|
|
265
|
+
typeof FinalizationRegistry > "u" || new FinalizationRegistry((t) => f.__wbg_wasmbuilder_free(t, 1));
|
|
266
|
+
typeof FinalizationRegistry > "u" || new FinalizationRegistry((t) => f.__wbg_wasmreader_free(t, 1));
|
|
267
|
+
typeof FinalizationRegistry > "u" || new FinalizationRegistry((t) => f.__wbg_wasmsigner_free(t, 1));
|
|
268
|
+
typeof FinalizationRegistry > "u" || new FinalizationRegistry((t) => f.__wbindgen_destroy_closure(t.a, t.b));
|
|
269
|
+
let G = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 });
|
|
270
|
+
G.decode();
|
|
251
271
|
const b = new TextEncoder();
|
|
252
|
-
"encodeInto" in b || (b.encodeInto = function(
|
|
253
|
-
const _ = b.encode(
|
|
254
|
-
return
|
|
255
|
-
read:
|
|
272
|
+
"encodeInto" in b || (b.encodeInto = function(t, e) {
|
|
273
|
+
const _ = b.encode(t);
|
|
274
|
+
return e.set(_), {
|
|
275
|
+
read: t.length,
|
|
256
276
|
written: _.length
|
|
257
277
|
};
|
|
258
278
|
});
|
|
259
279
|
let f;
|
|
260
|
-
const
|
|
261
|
-
async function
|
|
262
|
-
const { alg:
|
|
280
|
+
const V = "sha512-85H5W9PEIFDMXW7vSiWM4cqQYBgtKPq8rpdLBgPVu2nvzjLBDqm4AmPFCUgzd9WCRRCzMidMsO5C0E4Uj11dug==";
|
|
281
|
+
async function I(t) {
|
|
282
|
+
const { alg: e } = t;
|
|
263
283
|
return {
|
|
264
|
-
reserveSize: await
|
|
265
|
-
alg:
|
|
284
|
+
reserveSize: await t.reserveSize(),
|
|
285
|
+
alg: e
|
|
266
286
|
};
|
|
267
287
|
}
|
|
268
|
-
function
|
|
269
|
-
const { tx:
|
|
270
|
-
|
|
288
|
+
function K(t) {
|
|
289
|
+
const { tx: e } = t, _ = new FinalizationRegistry((r) => {
|
|
290
|
+
e.builder_free(r);
|
|
271
291
|
});
|
|
272
292
|
return {
|
|
273
293
|
async new(r) {
|
|
274
|
-
const n = r && await u(r), o = await
|
|
294
|
+
const n = r && await u(r), o = await e.builder_new(n), i = d(t, o, () => {
|
|
275
295
|
_.unregister(i);
|
|
276
296
|
});
|
|
277
297
|
return _.register(i, o, i), i;
|
|
278
298
|
},
|
|
279
299
|
async fromDefinition(r, n) {
|
|
280
|
-
const o = JSON.stringify(r), i = n && await u(n), a = await
|
|
281
|
-
_.unregister(
|
|
300
|
+
const o = JSON.stringify(r), i = n && await u(n), a = await e.builder_fromJson(o, i), s = d(t, a, () => {
|
|
301
|
+
_.unregister(s);
|
|
282
302
|
});
|
|
283
|
-
return _.register(
|
|
303
|
+
return _.register(s, a, s), s;
|
|
284
304
|
},
|
|
285
305
|
async fromArchive(r, n) {
|
|
286
|
-
const o = n && await u(n), i = await
|
|
306
|
+
const o = n && await u(n), i = await e.builder_fromArchive(r, o), a = d(t, i, () => {
|
|
287
307
|
_.unregister(a);
|
|
288
308
|
});
|
|
289
309
|
return _.register(a, i, a), a;
|
|
290
310
|
}
|
|
291
311
|
};
|
|
292
312
|
}
|
|
293
|
-
function d(
|
|
294
|
-
const { tx: r } =
|
|
313
|
+
function d(t, e, _) {
|
|
314
|
+
const { tx: r } = t;
|
|
295
315
|
return {
|
|
296
316
|
async setIntent(n) {
|
|
297
|
-
await r.builder_setIntent(
|
|
317
|
+
await r.builder_setIntent(e, n);
|
|
298
318
|
},
|
|
299
319
|
async addAction(n) {
|
|
300
|
-
await r.builder_addAction(
|
|
320
|
+
await r.builder_addAction(e, n);
|
|
301
321
|
},
|
|
302
322
|
async addRedaction(n, o) {
|
|
303
|
-
await r.builder_addRedaction(
|
|
323
|
+
await r.builder_addRedaction(e, n, o);
|
|
304
324
|
},
|
|
305
325
|
async setRemoteUrl(n) {
|
|
306
|
-
await r.builder_setRemoteUrl(
|
|
326
|
+
await r.builder_setRemoteUrl(e, n);
|
|
307
327
|
},
|
|
308
328
|
async setNoEmbed(n) {
|
|
309
|
-
await r.builder_setNoEmbed(
|
|
329
|
+
await r.builder_setNoEmbed(e, n);
|
|
310
330
|
},
|
|
311
331
|
async setThumbnailFromBlob(n, o) {
|
|
312
|
-
await r.builder_setThumbnailFromBlob(
|
|
332
|
+
await r.builder_setThumbnailFromBlob(e, n, o);
|
|
313
333
|
},
|
|
314
334
|
async addIngredient(n) {
|
|
315
335
|
const o = JSON.stringify(n);
|
|
316
|
-
await r.builder_addIngredient(
|
|
336
|
+
await r.builder_addIngredient(e, o);
|
|
317
337
|
},
|
|
318
338
|
async addIngredientFromBlob(n, o, i) {
|
|
319
339
|
const a = JSON.stringify(n);
|
|
320
|
-
await r.builder_addIngredientFromBlob(
|
|
340
|
+
await r.builder_addIngredientFromBlob(e, a, o, i);
|
|
321
341
|
},
|
|
322
342
|
async addResourceFromBlob(n, o) {
|
|
323
|
-
await r.builder_addResourceFromBlob(
|
|
343
|
+
await r.builder_addResourceFromBlob(e, n, o);
|
|
324
344
|
},
|
|
325
345
|
async getDefinition() {
|
|
326
|
-
return await r.builder_getDefinition(
|
|
346
|
+
return await r.builder_getDefinition(e);
|
|
327
347
|
},
|
|
328
348
|
async toArchive() {
|
|
329
|
-
return await r.builder_toArchive(
|
|
349
|
+
return await r.builder_toArchive(e);
|
|
330
350
|
},
|
|
331
351
|
async sign(n, o, i) {
|
|
332
|
-
const a = await
|
|
352
|
+
const a = await I(n), s = t.registerSignReceiver(n.sign);
|
|
333
353
|
return await r.builder_sign(
|
|
334
|
-
|
|
335
|
-
|
|
354
|
+
e,
|
|
355
|
+
s,
|
|
336
356
|
a,
|
|
337
357
|
o,
|
|
338
358
|
i
|
|
339
359
|
);
|
|
340
360
|
},
|
|
341
361
|
async signAndGetManifestBytes(n, o, i) {
|
|
342
|
-
const a = await
|
|
362
|
+
const a = await I(n), s = t.registerSignReceiver(n.sign);
|
|
343
363
|
return await r.builder_signAndGetManifestBytes(
|
|
344
|
-
|
|
345
|
-
|
|
364
|
+
e,
|
|
365
|
+
s,
|
|
346
366
|
a,
|
|
347
367
|
o,
|
|
348
368
|
i
|
|
349
369
|
);
|
|
350
370
|
},
|
|
351
371
|
async free() {
|
|
352
|
-
_(), await r.builder_free(
|
|
372
|
+
_(), await r.builder_free(e);
|
|
353
373
|
}
|
|
354
374
|
};
|
|
355
375
|
}
|
|
356
|
-
async function
|
|
357
|
-
const { wasmSrc:
|
|
376
|
+
async function ee(t) {
|
|
377
|
+
const { wasmSrc: e, settings: _ } = t, r = typeof e == "string" ? await X(e) : e, n = _ ? await u(_) : void 0, o = await k({ wasm: r, settingsString: n });
|
|
358
378
|
return {
|
|
359
|
-
reader:
|
|
360
|
-
builder:
|
|
379
|
+
reader: q(o),
|
|
380
|
+
builder: K(o),
|
|
361
381
|
dispose: o.terminate
|
|
362
382
|
};
|
|
363
383
|
}
|
|
364
|
-
async function
|
|
365
|
-
const
|
|
366
|
-
return await WebAssembly.compileStreaming(
|
|
384
|
+
async function X(t) {
|
|
385
|
+
const e = await fetch(t, { integrity: V });
|
|
386
|
+
return await WebAssembly.compileStreaming(e);
|
|
367
387
|
}
|
|
368
388
|
export {
|
|
369
389
|
J as R,
|
|
370
|
-
|
|
371
|
-
|
|
390
|
+
ee as c,
|
|
391
|
+
p as i
|
|
372
392
|
};
|
package/dist/index.js
CHANGED