@vercel/og 0.5.18 → 0.5.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.edge.js +129 -73
- package/dist/index.edge.js.map +1 -1
- package/dist/index.node.js +129 -73
- package/dist/index.node.js.map +1 -1
- package/dist/resvg.wasm +0 -0
- package/package.json +2 -2
package/dist/index.edge.js
CHANGED
|
@@ -18135,7 +18135,7 @@ async function initYoga(t) {
|
|
|
18135
18135
|
return wrapAsm(r);
|
|
18136
18136
|
}
|
|
18137
18137
|
|
|
18138
|
-
// node_modules/.pnpm/@resvg+resvg-wasm@2.
|
|
18138
|
+
// node_modules/.pnpm/@resvg+resvg-wasm@2.5.0/node_modules/@resvg/resvg-wasm/index.mjs
|
|
18139
18139
|
var resvg_wasm_exports = {};
|
|
18140
18140
|
__export(resvg_wasm_exports, {
|
|
18141
18141
|
Resvg: () => Resvg2,
|
|
@@ -18175,7 +18175,9 @@ function getUint8Memory0() {
|
|
|
18175
18175
|
}
|
|
18176
18176
|
return cachedUint8Memory0;
|
|
18177
18177
|
}
|
|
18178
|
-
var cachedTextEncoder = new TextEncoder("utf-8")
|
|
18178
|
+
var cachedTextEncoder = typeof TextEncoder !== "undefined" ? new TextEncoder("utf-8") : { encode: () => {
|
|
18179
|
+
throw Error("TextEncoder not available");
|
|
18180
|
+
} };
|
|
18179
18181
|
var encodeString = typeof cachedTextEncoder.encodeInto === "function" ? function(arg, view) {
|
|
18180
18182
|
return cachedTextEncoder.encodeInto(arg, view);
|
|
18181
18183
|
} : function(arg, view) {
|
|
@@ -18189,13 +18191,13 @@ var encodeString = typeof cachedTextEncoder.encodeInto === "function" ? function
|
|
|
18189
18191
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
18190
18192
|
if (realloc === void 0) {
|
|
18191
18193
|
const buf = cachedTextEncoder.encode(arg);
|
|
18192
|
-
const ptr2 = malloc(buf.length);
|
|
18194
|
+
const ptr2 = malloc(buf.length, 1) >>> 0;
|
|
18193
18195
|
getUint8Memory0().subarray(ptr2, ptr2 + buf.length).set(buf);
|
|
18194
18196
|
WASM_VECTOR_LEN = buf.length;
|
|
18195
18197
|
return ptr2;
|
|
18196
18198
|
}
|
|
18197
18199
|
let len = arg.length;
|
|
18198
|
-
let ptr = malloc(len);
|
|
18200
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
18199
18201
|
const mem = getUint8Memory0();
|
|
18200
18202
|
let offset = 0;
|
|
18201
18203
|
for (; offset < len; offset++) {
|
|
@@ -18208,7 +18210,7 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
18208
18210
|
if (offset !== 0) {
|
|
18209
18211
|
arg = arg.slice(offset);
|
|
18210
18212
|
}
|
|
18211
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3);
|
|
18213
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
18212
18214
|
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
18213
18215
|
const ret = encodeString(arg, view);
|
|
18214
18216
|
offset += ret.written;
|
|
@@ -18226,9 +18228,14 @@ function getInt32Memory0() {
|
|
|
18226
18228
|
}
|
|
18227
18229
|
return cachedInt32Memory0;
|
|
18228
18230
|
}
|
|
18229
|
-
var cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true })
|
|
18230
|
-
|
|
18231
|
+
var cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
18232
|
+
throw Error("TextDecoder not available");
|
|
18233
|
+
} };
|
|
18234
|
+
if (typeof TextDecoder !== "undefined") {
|
|
18235
|
+
cachedTextDecoder.decode();
|
|
18236
|
+
}
|
|
18231
18237
|
function getStringFromWasm0(ptr, len) {
|
|
18238
|
+
ptr = ptr >>> 0;
|
|
18232
18239
|
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
18233
18240
|
}
|
|
18234
18241
|
function _assertClass(instance, klass) {
|
|
@@ -18237,15 +18244,23 @@ function _assertClass(instance, klass) {
|
|
|
18237
18244
|
}
|
|
18238
18245
|
return instance.ptr;
|
|
18239
18246
|
}
|
|
18240
|
-
|
|
18247
|
+
function handleError(f, args) {
|
|
18248
|
+
try {
|
|
18249
|
+
return f.apply(this, args);
|
|
18250
|
+
} catch (e) {
|
|
18251
|
+
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
18252
|
+
}
|
|
18253
|
+
}
|
|
18254
|
+
var BBox = class _BBox {
|
|
18241
18255
|
static __wrap(ptr) {
|
|
18242
|
-
|
|
18243
|
-
obj
|
|
18256
|
+
ptr = ptr >>> 0;
|
|
18257
|
+
const obj = Object.create(_BBox.prototype);
|
|
18258
|
+
obj.__wbg_ptr = ptr;
|
|
18244
18259
|
return obj;
|
|
18245
18260
|
}
|
|
18246
18261
|
__destroy_into_raw() {
|
|
18247
|
-
const ptr = this.
|
|
18248
|
-
this.
|
|
18262
|
+
const ptr = this.__wbg_ptr;
|
|
18263
|
+
this.__wbg_ptr = 0;
|
|
18249
18264
|
return ptr;
|
|
18250
18265
|
}
|
|
18251
18266
|
free() {
|
|
@@ -18253,43 +18268,44 @@ var BBox = class {
|
|
|
18253
18268
|
wasm.__wbg_bbox_free(ptr);
|
|
18254
18269
|
}
|
|
18255
18270
|
get x() {
|
|
18256
|
-
const ret = wasm.__wbg_get_bbox_x(this.
|
|
18271
|
+
const ret = wasm.__wbg_get_bbox_x(this.__wbg_ptr);
|
|
18257
18272
|
return ret;
|
|
18258
18273
|
}
|
|
18259
18274
|
set x(arg0) {
|
|
18260
|
-
wasm.__wbg_set_bbox_x(this.
|
|
18275
|
+
wasm.__wbg_set_bbox_x(this.__wbg_ptr, arg0);
|
|
18261
18276
|
}
|
|
18262
18277
|
get y() {
|
|
18263
|
-
const ret = wasm.__wbg_get_bbox_y(this.
|
|
18278
|
+
const ret = wasm.__wbg_get_bbox_y(this.__wbg_ptr);
|
|
18264
18279
|
return ret;
|
|
18265
18280
|
}
|
|
18266
18281
|
set y(arg0) {
|
|
18267
|
-
wasm.__wbg_set_bbox_y(this.
|
|
18282
|
+
wasm.__wbg_set_bbox_y(this.__wbg_ptr, arg0);
|
|
18268
18283
|
}
|
|
18269
18284
|
get width() {
|
|
18270
|
-
const ret = wasm.__wbg_get_bbox_width(this.
|
|
18285
|
+
const ret = wasm.__wbg_get_bbox_width(this.__wbg_ptr);
|
|
18271
18286
|
return ret;
|
|
18272
18287
|
}
|
|
18273
18288
|
set width(arg0) {
|
|
18274
|
-
wasm.__wbg_set_bbox_width(this.
|
|
18289
|
+
wasm.__wbg_set_bbox_width(this.__wbg_ptr, arg0);
|
|
18275
18290
|
}
|
|
18276
18291
|
get height() {
|
|
18277
|
-
const ret = wasm.__wbg_get_bbox_height(this.
|
|
18292
|
+
const ret = wasm.__wbg_get_bbox_height(this.__wbg_ptr);
|
|
18278
18293
|
return ret;
|
|
18279
18294
|
}
|
|
18280
18295
|
set height(arg0) {
|
|
18281
|
-
wasm.__wbg_set_bbox_height(this.
|
|
18296
|
+
wasm.__wbg_set_bbox_height(this.__wbg_ptr, arg0);
|
|
18282
18297
|
}
|
|
18283
18298
|
};
|
|
18284
|
-
var RenderedImage = class {
|
|
18299
|
+
var RenderedImage = class _RenderedImage {
|
|
18285
18300
|
static __wrap(ptr) {
|
|
18286
|
-
|
|
18287
|
-
obj
|
|
18301
|
+
ptr = ptr >>> 0;
|
|
18302
|
+
const obj = Object.create(_RenderedImage.prototype);
|
|
18303
|
+
obj.__wbg_ptr = ptr;
|
|
18288
18304
|
return obj;
|
|
18289
18305
|
}
|
|
18290
18306
|
__destroy_into_raw() {
|
|
18291
|
-
const ptr = this.
|
|
18292
|
-
this.
|
|
18307
|
+
const ptr = this.__wbg_ptr;
|
|
18308
|
+
this.__wbg_ptr = 0;
|
|
18293
18309
|
return ptr;
|
|
18294
18310
|
}
|
|
18295
18311
|
free() {
|
|
@@ -18297,17 +18313,17 @@ var RenderedImage = class {
|
|
|
18297
18313
|
wasm.__wbg_renderedimage_free(ptr);
|
|
18298
18314
|
}
|
|
18299
18315
|
get width() {
|
|
18300
|
-
const ret = wasm.renderedimage_width(this.
|
|
18316
|
+
const ret = wasm.renderedimage_width(this.__wbg_ptr);
|
|
18301
18317
|
return ret >>> 0;
|
|
18302
18318
|
}
|
|
18303
18319
|
get height() {
|
|
18304
|
-
const ret = wasm.renderedimage_height(this.
|
|
18320
|
+
const ret = wasm.renderedimage_height(this.__wbg_ptr);
|
|
18305
18321
|
return ret >>> 0;
|
|
18306
18322
|
}
|
|
18307
18323
|
asPng() {
|
|
18308
18324
|
try {
|
|
18309
18325
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
18310
|
-
wasm.renderedimage_asPng(retptr, this.
|
|
18326
|
+
wasm.renderedimage_asPng(retptr, this.__wbg_ptr);
|
|
18311
18327
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
18312
18328
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
18313
18329
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -18320,54 +18336,55 @@ var RenderedImage = class {
|
|
|
18320
18336
|
}
|
|
18321
18337
|
}
|
|
18322
18338
|
get pixels() {
|
|
18323
|
-
const ret = wasm.renderedimage_pixels(this.
|
|
18339
|
+
const ret = wasm.renderedimage_pixels(this.__wbg_ptr);
|
|
18324
18340
|
return takeObject(ret);
|
|
18325
18341
|
}
|
|
18326
18342
|
};
|
|
18327
|
-
var Resvg = class {
|
|
18343
|
+
var Resvg = class _Resvg {
|
|
18328
18344
|
static __wrap(ptr) {
|
|
18329
|
-
|
|
18330
|
-
obj
|
|
18345
|
+
ptr = ptr >>> 0;
|
|
18346
|
+
const obj = Object.create(_Resvg.prototype);
|
|
18347
|
+
obj.__wbg_ptr = ptr;
|
|
18331
18348
|
return obj;
|
|
18332
18349
|
}
|
|
18333
18350
|
__destroy_into_raw() {
|
|
18334
|
-
const ptr = this.
|
|
18335
|
-
this.
|
|
18351
|
+
const ptr = this.__wbg_ptr;
|
|
18352
|
+
this.__wbg_ptr = 0;
|
|
18336
18353
|
return ptr;
|
|
18337
18354
|
}
|
|
18338
18355
|
free() {
|
|
18339
18356
|
const ptr = this.__destroy_into_raw();
|
|
18340
18357
|
wasm.__wbg_resvg_free(ptr);
|
|
18341
18358
|
}
|
|
18342
|
-
constructor(svg, options) {
|
|
18359
|
+
constructor(svg, options, custom_font_buffers) {
|
|
18343
18360
|
try {
|
|
18344
18361
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
18345
18362
|
var ptr0 = isLikeNone(options) ? 0 : passStringToWasm0(options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
18346
18363
|
var len0 = WASM_VECTOR_LEN;
|
|
18347
|
-
wasm.resvg_new(retptr, addHeapObject(svg), ptr0, len0);
|
|
18364
|
+
wasm.resvg_new(retptr, addHeapObject(svg), ptr0, len0, isLikeNone(custom_font_buffers) ? 0 : addHeapObject(custom_font_buffers));
|
|
18348
18365
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
18349
18366
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
18350
18367
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
18351
18368
|
if (r2) {
|
|
18352
18369
|
throw takeObject(r1);
|
|
18353
18370
|
}
|
|
18354
|
-
return
|
|
18371
|
+
return _Resvg.__wrap(r0);
|
|
18355
18372
|
} finally {
|
|
18356
18373
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
18357
18374
|
}
|
|
18358
18375
|
}
|
|
18359
18376
|
get width() {
|
|
18360
|
-
const ret = wasm.resvg_width(this.
|
|
18377
|
+
const ret = wasm.resvg_width(this.__wbg_ptr);
|
|
18361
18378
|
return ret;
|
|
18362
18379
|
}
|
|
18363
18380
|
get height() {
|
|
18364
|
-
const ret = wasm.resvg_height(this.
|
|
18381
|
+
const ret = wasm.resvg_height(this.__wbg_ptr);
|
|
18365
18382
|
return ret;
|
|
18366
18383
|
}
|
|
18367
18384
|
render() {
|
|
18368
18385
|
try {
|
|
18369
18386
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
18370
|
-
wasm.resvg_render(retptr, this.
|
|
18387
|
+
wasm.resvg_render(retptr, this.__wbg_ptr);
|
|
18371
18388
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
18372
18389
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
18373
18390
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -18380,33 +18397,37 @@ var Resvg = class {
|
|
|
18380
18397
|
}
|
|
18381
18398
|
}
|
|
18382
18399
|
toString() {
|
|
18400
|
+
let deferred1_0;
|
|
18401
|
+
let deferred1_1;
|
|
18383
18402
|
try {
|
|
18384
18403
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
18385
|
-
wasm.resvg_toString(retptr, this.
|
|
18404
|
+
wasm.resvg_toString(retptr, this.__wbg_ptr);
|
|
18386
18405
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
18387
18406
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
18407
|
+
deferred1_0 = r0;
|
|
18408
|
+
deferred1_1 = r1;
|
|
18388
18409
|
return getStringFromWasm0(r0, r1);
|
|
18389
18410
|
} finally {
|
|
18390
18411
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
18391
|
-
wasm.__wbindgen_free(
|
|
18412
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
18392
18413
|
}
|
|
18393
18414
|
}
|
|
18394
18415
|
innerBBox() {
|
|
18395
|
-
const ret = wasm.resvg_innerBBox(this.
|
|
18416
|
+
const ret = wasm.resvg_innerBBox(this.__wbg_ptr);
|
|
18396
18417
|
return ret === 0 ? void 0 : BBox.__wrap(ret);
|
|
18397
18418
|
}
|
|
18398
18419
|
getBBox() {
|
|
18399
|
-
const ret = wasm.resvg_getBBox(this.
|
|
18420
|
+
const ret = wasm.resvg_getBBox(this.__wbg_ptr);
|
|
18400
18421
|
return ret === 0 ? void 0 : BBox.__wrap(ret);
|
|
18401
18422
|
}
|
|
18402
18423
|
cropByBBox(bbox) {
|
|
18403
18424
|
_assertClass(bbox, BBox);
|
|
18404
|
-
wasm.resvg_cropByBBox(this.
|
|
18425
|
+
wasm.resvg_cropByBBox(this.__wbg_ptr, bbox.__wbg_ptr);
|
|
18405
18426
|
}
|
|
18406
18427
|
imagesToResolve() {
|
|
18407
18428
|
try {
|
|
18408
18429
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
18409
|
-
wasm.resvg_imagesToResolve(retptr, this.
|
|
18430
|
+
wasm.resvg_imagesToResolve(retptr, this.__wbg_ptr);
|
|
18410
18431
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
18411
18432
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
18412
18433
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -18423,7 +18444,7 @@ var Resvg = class {
|
|
|
18423
18444
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
18424
18445
|
const ptr0 = passStringToWasm0(href, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
18425
18446
|
const len0 = WASM_VECTOR_LEN;
|
|
18426
|
-
wasm.resvg_resolveImage(retptr, this.
|
|
18447
|
+
wasm.resvg_resolveImage(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(buffer));
|
|
18427
18448
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
18428
18449
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
18429
18450
|
if (r1) {
|
|
@@ -18434,7 +18455,7 @@ var Resvg = class {
|
|
|
18434
18455
|
}
|
|
18435
18456
|
}
|
|
18436
18457
|
};
|
|
18437
|
-
async function
|
|
18458
|
+
async function __wbg_load(module, imports) {
|
|
18438
18459
|
if (typeof Response === "function" && module instanceof Response) {
|
|
18439
18460
|
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
18440
18461
|
try {
|
|
@@ -18458,10 +18479,10 @@ async function load2(module, imports) {
|
|
|
18458
18479
|
}
|
|
18459
18480
|
}
|
|
18460
18481
|
}
|
|
18461
|
-
function
|
|
18482
|
+
function __wbg_get_imports() {
|
|
18462
18483
|
const imports = {};
|
|
18463
18484
|
imports.wbg = {};
|
|
18464
|
-
imports.wbg.
|
|
18485
|
+
imports.wbg.__wbg_new_d258248ed531ff54 = function(arg0, arg1) {
|
|
18465
18486
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
18466
18487
|
return addHeapObject(ret);
|
|
18467
18488
|
};
|
|
@@ -18469,26 +18490,44 @@ function getImports() {
|
|
|
18469
18490
|
const ret = wasm.memory;
|
|
18470
18491
|
return addHeapObject(ret);
|
|
18471
18492
|
};
|
|
18472
|
-
imports.wbg.
|
|
18493
|
+
imports.wbg.__wbg_buffer_085ec1f694018c4f = function(arg0) {
|
|
18473
18494
|
const ret = getObject(arg0).buffer;
|
|
18474
18495
|
return addHeapObject(ret);
|
|
18475
18496
|
};
|
|
18476
|
-
imports.wbg.
|
|
18497
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_6da8e527659b86aa = function(arg0, arg1, arg2) {
|
|
18477
18498
|
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
18478
18499
|
return addHeapObject(ret);
|
|
18479
18500
|
};
|
|
18480
18501
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
18481
18502
|
takeObject(arg0);
|
|
18482
18503
|
};
|
|
18483
|
-
imports.wbg.
|
|
18504
|
+
imports.wbg.__wbg_new_8125e318e6245eed = function(arg0) {
|
|
18484
18505
|
const ret = new Uint8Array(getObject(arg0));
|
|
18485
18506
|
return addHeapObject(ret);
|
|
18486
18507
|
};
|
|
18487
|
-
imports.wbg.
|
|
18508
|
+
imports.wbg.__wbg_values_e80af618f92c8649 = function(arg0) {
|
|
18509
|
+
const ret = getObject(arg0).values();
|
|
18510
|
+
return addHeapObject(ret);
|
|
18511
|
+
};
|
|
18512
|
+
imports.wbg.__wbg_next_ddb3312ca1c4e32a = function() {
|
|
18513
|
+
return handleError(function(arg0) {
|
|
18514
|
+
const ret = getObject(arg0).next();
|
|
18515
|
+
return addHeapObject(ret);
|
|
18516
|
+
}, arguments);
|
|
18517
|
+
};
|
|
18518
|
+
imports.wbg.__wbg_done_5c1f01fb660d73b5 = function(arg0) {
|
|
18519
|
+
const ret = getObject(arg0).done;
|
|
18520
|
+
return ret;
|
|
18521
|
+
};
|
|
18522
|
+
imports.wbg.__wbg_value_1695675138684bd5 = function(arg0) {
|
|
18523
|
+
const ret = getObject(arg0).value;
|
|
18524
|
+
return addHeapObject(ret);
|
|
18525
|
+
};
|
|
18526
|
+
imports.wbg.__wbg_instanceof_Uint8Array_d8d9cb2b8e8ac1d4 = function(arg0) {
|
|
18488
18527
|
let result;
|
|
18489
18528
|
try {
|
|
18490
18529
|
result = getObject(arg0) instanceof Uint8Array;
|
|
18491
|
-
} catch
|
|
18530
|
+
} catch {
|
|
18492
18531
|
result = false;
|
|
18493
18532
|
}
|
|
18494
18533
|
const ret = result;
|
|
@@ -18497,12 +18536,12 @@ function getImports() {
|
|
|
18497
18536
|
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
18498
18537
|
const obj = getObject(arg1);
|
|
18499
18538
|
const ret = typeof obj === "string" ? obj : void 0;
|
|
18500
|
-
var
|
|
18501
|
-
var
|
|
18502
|
-
getInt32Memory0()[arg0 / 4 + 1] =
|
|
18503
|
-
getInt32Memory0()[arg0 / 4 + 0] =
|
|
18539
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
18540
|
+
var len1 = WASM_VECTOR_LEN;
|
|
18541
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
18542
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
18504
18543
|
};
|
|
18505
|
-
imports.wbg.
|
|
18544
|
+
imports.wbg.__wbg_new_898a68150f225f2e = function() {
|
|
18506
18545
|
const ret = new Array();
|
|
18507
18546
|
return addHeapObject(ret);
|
|
18508
18547
|
};
|
|
@@ -18510,15 +18549,15 @@ function getImports() {
|
|
|
18510
18549
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
18511
18550
|
return addHeapObject(ret);
|
|
18512
18551
|
};
|
|
18513
|
-
imports.wbg.
|
|
18552
|
+
imports.wbg.__wbg_push_ca1c26067ef907ac = function(arg0, arg1) {
|
|
18514
18553
|
const ret = getObject(arg0).push(getObject(arg1));
|
|
18515
18554
|
return ret;
|
|
18516
18555
|
};
|
|
18517
|
-
imports.wbg.
|
|
18556
|
+
imports.wbg.__wbg_length_72e2208bbc0efc61 = function(arg0) {
|
|
18518
18557
|
const ret = getObject(arg0).length;
|
|
18519
18558
|
return ret;
|
|
18520
18559
|
};
|
|
18521
|
-
imports.wbg.
|
|
18560
|
+
imports.wbg.__wbg_set_5cf90238115182c3 = function(arg0, arg1, arg2) {
|
|
18522
18561
|
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
18523
18562
|
};
|
|
18524
18563
|
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
@@ -18526,28 +18565,30 @@ function getImports() {
|
|
|
18526
18565
|
};
|
|
18527
18566
|
return imports;
|
|
18528
18567
|
}
|
|
18529
|
-
function
|
|
18568
|
+
function __wbg_init_memory(imports, maybe_memory) {
|
|
18530
18569
|
}
|
|
18531
|
-
function
|
|
18570
|
+
function __wbg_finalize_init(instance, module) {
|
|
18532
18571
|
wasm = instance.exports;
|
|
18533
|
-
|
|
18572
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
18534
18573
|
cachedInt32Memory0 = null;
|
|
18535
18574
|
cachedUint8Memory0 = null;
|
|
18536
18575
|
return wasm;
|
|
18537
18576
|
}
|
|
18538
|
-
async function
|
|
18577
|
+
async function __wbg_init(input) {
|
|
18578
|
+
if (wasm !== void 0)
|
|
18579
|
+
return wasm;
|
|
18539
18580
|
if (typeof input === "undefined") {
|
|
18540
18581
|
input = new URL("index_bg.wasm", void 0);
|
|
18541
18582
|
}
|
|
18542
|
-
const imports =
|
|
18583
|
+
const imports = __wbg_get_imports();
|
|
18543
18584
|
if (typeof input === "string" || typeof Request === "function" && input instanceof Request || typeof URL === "function" && input instanceof URL) {
|
|
18544
18585
|
input = fetch(input);
|
|
18545
18586
|
}
|
|
18546
|
-
|
|
18547
|
-
const { instance, module } = await
|
|
18548
|
-
return
|
|
18587
|
+
__wbg_init_memory(imports);
|
|
18588
|
+
const { instance, module } = await __wbg_load(await input, imports);
|
|
18589
|
+
return __wbg_finalize_init(instance, module);
|
|
18549
18590
|
}
|
|
18550
|
-
var dist_default =
|
|
18591
|
+
var dist_default = __wbg_init;
|
|
18551
18592
|
var initialized = false;
|
|
18552
18593
|
var initWasm = async (module_or_path) => {
|
|
18553
18594
|
if (initialized) {
|
|
@@ -18560,9 +18601,24 @@ var Resvg2 = class extends Resvg {
|
|
|
18560
18601
|
constructor(svg, options) {
|
|
18561
18602
|
if (!initialized)
|
|
18562
18603
|
throw new Error("Wasm has not been initialized. Call `initWasm()` function.");
|
|
18563
|
-
|
|
18604
|
+
const font = options == null ? void 0 : options.font;
|
|
18605
|
+
if (!!font && isCustomFontsOptions(font)) {
|
|
18606
|
+
const serializableOptions = {
|
|
18607
|
+
...options,
|
|
18608
|
+
font: {
|
|
18609
|
+
...font,
|
|
18610
|
+
fontBuffers: void 0
|
|
18611
|
+
}
|
|
18612
|
+
};
|
|
18613
|
+
super(svg, JSON.stringify(serializableOptions), font.fontBuffers);
|
|
18614
|
+
} else {
|
|
18615
|
+
super(svg, JSON.stringify(options));
|
|
18616
|
+
}
|
|
18564
18617
|
}
|
|
18565
18618
|
};
|
|
18619
|
+
function isCustomFontsOptions(value) {
|
|
18620
|
+
return Object.prototype.hasOwnProperty.call(value, "fontBuffers");
|
|
18621
|
+
}
|
|
18566
18622
|
|
|
18567
18623
|
// src/index.edge.ts
|
|
18568
18624
|
import resvg_wasm from "./resvg.wasm?module";
|