@css-inline/css-inline-wasm 0.12.0
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 +24 -0
- package/index.d.ts +24 -0
- package/index.js +416 -0
- package/index.min.js +2 -0
- package/index.mjs +393 -0
- package/index_bg.wasm +0 -0
- package/package.json +51 -0
package/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# css-inline
|
|
2
|
+
|
|
3
|
+
## @css-inline/css-inline-wasm
|
|
4
|
+
|
|
5
|
+
[<img alt="build status" src="https://img.shields.io/github/actions/workflow/status/Stranger6667/css-inline/build.yml?style=flat-square&labelColor=555555&logo=github" height="20">](https://github.com/Stranger6667/css-inline/actions/workflows/build.yml)
|
|
6
|
+
[<img alt="npm" src="https://img.shields.io/npm/v/@css-inline/css-inline-wasm.svg?style=flat-square" height="20">](https://www.npmjs.com/package/@css-inline/css-inline-wasm)
|
|
7
|
+
[<img alt="codecov.io" src="https://img.shields.io/codecov/c/gh/Stranger6667/css-inline?logo=codecov&style=flat-square&token=tOzvV4kDY0" height="20">](https://app.codecov.io/github/Stranger6667/css-inline)
|
|
8
|
+
[<img alt="gitter" src="https://img.shields.io/gitter/room/Stranger6667/css-inline?style=flat-square" height="20">](https://gitter.im/Stranger6667/css-inline)
|
|
9
|
+
|
|
10
|
+
`css-inline` is a high-performance library for inlining CSS into HTML 'style' attributes.
|
|
11
|
+
|
|
12
|
+
This is the **WebAssembly** module for [`css-inline`](https://github.com/Stranger6667/css-inline)
|
|
13
|
+
|
|
14
|
+
## Playground
|
|
15
|
+
|
|
16
|
+
If you'd like to try `css-inline`, you can check the WebAssembly-powered [playground](https://css-inline.org/) to see the results instantly.
|
|
17
|
+
|
|
18
|
+
## Restrictions
|
|
19
|
+
|
|
20
|
+
WASM module currently lacks support for fetching stylesheets from network or filesystem.
|
|
21
|
+
|
|
22
|
+
## License
|
|
23
|
+
|
|
24
|
+
This project is licensed under the terms of the [MIT license](https://opensource.org/licenses/MIT).
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Generated by dts-bundle-generator v9.1.0
|
|
2
|
+
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
export interface InlineOptions {
|
|
6
|
+
inlineStyleTags?: boolean;
|
|
7
|
+
keepStyleTags?: boolean;
|
|
8
|
+
keepLinkTags?: boolean;
|
|
9
|
+
baseUrl?: string;
|
|
10
|
+
loadRemoteStylesheets?: boolean;
|
|
11
|
+
extraCss?: string;
|
|
12
|
+
preallocateNodeCapacity?: number;
|
|
13
|
+
}
|
|
14
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
15
|
+
/**
|
|
16
|
+
* Initialize Wasm module
|
|
17
|
+
* @param module_or_path WebAssembly Module or .wasm url
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
export declare const initWasm: (module_or_path: Promise<InitInput> | InitInput) => Promise<void>;
|
|
21
|
+
export declare function inline(html: string, options?: InlineOptions): string;
|
|
22
|
+
export declare function version(): string;
|
|
23
|
+
|
|
24
|
+
export {};
|
package/index.js
ADDED
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// wasm-binding.ts
|
|
21
|
+
var wasm_binding_exports = {};
|
|
22
|
+
__export(wasm_binding_exports, {
|
|
23
|
+
initWasm: () => initWasm,
|
|
24
|
+
inline: () => inline2,
|
|
25
|
+
version: () => version2
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(wasm_binding_exports);
|
|
28
|
+
|
|
29
|
+
// wasm/dist/index.js
|
|
30
|
+
var wasm;
|
|
31
|
+
var heap = new Array(128).fill(void 0);
|
|
32
|
+
heap.push(void 0, null, true, false);
|
|
33
|
+
function getObject(idx) {
|
|
34
|
+
return heap[idx];
|
|
35
|
+
}
|
|
36
|
+
var WASM_VECTOR_LEN = 0;
|
|
37
|
+
var cachedUint8Memory0 = null;
|
|
38
|
+
function getUint8Memory0() {
|
|
39
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
40
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
41
|
+
}
|
|
42
|
+
return cachedUint8Memory0;
|
|
43
|
+
}
|
|
44
|
+
var cachedTextEncoder = typeof TextEncoder !== "undefined" ? new TextEncoder("utf-8") : { encode: () => {
|
|
45
|
+
throw Error("TextEncoder not available");
|
|
46
|
+
} };
|
|
47
|
+
var encodeString = typeof cachedTextEncoder.encodeInto === "function" ? function(arg, view) {
|
|
48
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
49
|
+
} : function(arg, view) {
|
|
50
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
51
|
+
view.set(buf);
|
|
52
|
+
return {
|
|
53
|
+
read: arg.length,
|
|
54
|
+
written: buf.length
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
58
|
+
if (realloc === void 0) {
|
|
59
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
60
|
+
const ptr2 = malloc(buf.length, 1) >>> 0;
|
|
61
|
+
getUint8Memory0().subarray(ptr2, ptr2 + buf.length).set(buf);
|
|
62
|
+
WASM_VECTOR_LEN = buf.length;
|
|
63
|
+
return ptr2;
|
|
64
|
+
}
|
|
65
|
+
let len = arg.length;
|
|
66
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
67
|
+
const mem = getUint8Memory0();
|
|
68
|
+
let offset = 0;
|
|
69
|
+
for (; offset < len; offset++) {
|
|
70
|
+
const code = arg.charCodeAt(offset);
|
|
71
|
+
if (code > 127)
|
|
72
|
+
break;
|
|
73
|
+
mem[ptr + offset] = code;
|
|
74
|
+
}
|
|
75
|
+
if (offset !== len) {
|
|
76
|
+
if (offset !== 0) {
|
|
77
|
+
arg = arg.slice(offset);
|
|
78
|
+
}
|
|
79
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
80
|
+
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
81
|
+
const ret = encodeString(arg, view);
|
|
82
|
+
offset += ret.written;
|
|
83
|
+
}
|
|
84
|
+
WASM_VECTOR_LEN = offset;
|
|
85
|
+
return ptr;
|
|
86
|
+
}
|
|
87
|
+
function isLikeNone(x) {
|
|
88
|
+
return x === void 0 || x === null;
|
|
89
|
+
}
|
|
90
|
+
var cachedInt32Memory0 = null;
|
|
91
|
+
function getInt32Memory0() {
|
|
92
|
+
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
93
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
94
|
+
}
|
|
95
|
+
return cachedInt32Memory0;
|
|
96
|
+
}
|
|
97
|
+
var cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
98
|
+
throw Error("TextDecoder not available");
|
|
99
|
+
} };
|
|
100
|
+
if (typeof TextDecoder !== "undefined") {
|
|
101
|
+
cachedTextDecoder.decode();
|
|
102
|
+
}
|
|
103
|
+
function getStringFromWasm0(ptr, len) {
|
|
104
|
+
ptr = ptr >>> 0;
|
|
105
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
106
|
+
}
|
|
107
|
+
var heap_next = heap.length;
|
|
108
|
+
function addHeapObject(obj) {
|
|
109
|
+
if (heap_next === heap.length)
|
|
110
|
+
heap.push(heap.length + 1);
|
|
111
|
+
const idx = heap_next;
|
|
112
|
+
heap_next = heap[idx];
|
|
113
|
+
heap[idx] = obj;
|
|
114
|
+
return idx;
|
|
115
|
+
}
|
|
116
|
+
function dropObject(idx) {
|
|
117
|
+
if (idx < 132)
|
|
118
|
+
return;
|
|
119
|
+
heap[idx] = heap_next;
|
|
120
|
+
heap_next = idx;
|
|
121
|
+
}
|
|
122
|
+
function takeObject(idx) {
|
|
123
|
+
const ret = getObject(idx);
|
|
124
|
+
dropObject(idx);
|
|
125
|
+
return ret;
|
|
126
|
+
}
|
|
127
|
+
var cachedFloat64Memory0 = null;
|
|
128
|
+
function getFloat64Memory0() {
|
|
129
|
+
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
130
|
+
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
131
|
+
}
|
|
132
|
+
return cachedFloat64Memory0;
|
|
133
|
+
}
|
|
134
|
+
function debugString(val) {
|
|
135
|
+
const type = typeof val;
|
|
136
|
+
if (type == "number" || type == "boolean" || val == null) {
|
|
137
|
+
return `${val}`;
|
|
138
|
+
}
|
|
139
|
+
if (type == "string") {
|
|
140
|
+
return `"${val}"`;
|
|
141
|
+
}
|
|
142
|
+
if (type == "symbol") {
|
|
143
|
+
const description = val.description;
|
|
144
|
+
if (description == null) {
|
|
145
|
+
return "Symbol";
|
|
146
|
+
} else {
|
|
147
|
+
return `Symbol(${description})`;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (type == "function") {
|
|
151
|
+
const name = val.name;
|
|
152
|
+
if (typeof name == "string" && name.length > 0) {
|
|
153
|
+
return `Function(${name})`;
|
|
154
|
+
} else {
|
|
155
|
+
return "Function";
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
if (Array.isArray(val)) {
|
|
159
|
+
const length = val.length;
|
|
160
|
+
let debug = "[";
|
|
161
|
+
if (length > 0) {
|
|
162
|
+
debug += debugString(val[0]);
|
|
163
|
+
}
|
|
164
|
+
for (let i = 1; i < length; i++) {
|
|
165
|
+
debug += ", " + debugString(val[i]);
|
|
166
|
+
}
|
|
167
|
+
debug += "]";
|
|
168
|
+
return debug;
|
|
169
|
+
}
|
|
170
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
171
|
+
let className;
|
|
172
|
+
if (builtInMatches.length > 1) {
|
|
173
|
+
className = builtInMatches[1];
|
|
174
|
+
} else {
|
|
175
|
+
return toString.call(val);
|
|
176
|
+
}
|
|
177
|
+
if (className == "Object") {
|
|
178
|
+
try {
|
|
179
|
+
return "Object(" + JSON.stringify(val) + ")";
|
|
180
|
+
} catch (_) {
|
|
181
|
+
return "Object";
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
if (val instanceof Error) {
|
|
185
|
+
return `${val.name}: ${val.message}
|
|
186
|
+
${val.stack}`;
|
|
187
|
+
}
|
|
188
|
+
return className;
|
|
189
|
+
}
|
|
190
|
+
function inline(html, options) {
|
|
191
|
+
let deferred3_0;
|
|
192
|
+
let deferred3_1;
|
|
193
|
+
try {
|
|
194
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
195
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
196
|
+
const len0 = WASM_VECTOR_LEN;
|
|
197
|
+
wasm.inline(retptr, ptr0, len0, addHeapObject(options));
|
|
198
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
199
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
200
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
201
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
202
|
+
var ptr2 = r0;
|
|
203
|
+
var len2 = r1;
|
|
204
|
+
if (r3) {
|
|
205
|
+
ptr2 = 0;
|
|
206
|
+
len2 = 0;
|
|
207
|
+
throw takeObject(r2);
|
|
208
|
+
}
|
|
209
|
+
deferred3_0 = ptr2;
|
|
210
|
+
deferred3_1 = len2;
|
|
211
|
+
return getStringFromWasm0(ptr2, len2);
|
|
212
|
+
} finally {
|
|
213
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
214
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
function version() {
|
|
218
|
+
let deferred1_0;
|
|
219
|
+
let deferred1_1;
|
|
220
|
+
try {
|
|
221
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
222
|
+
wasm.version(retptr);
|
|
223
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
224
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
225
|
+
deferred1_0 = r0;
|
|
226
|
+
deferred1_1 = r1;
|
|
227
|
+
return getStringFromWasm0(r0, r1);
|
|
228
|
+
} finally {
|
|
229
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
230
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
async function __wbg_load(module2, imports) {
|
|
234
|
+
if (typeof Response === "function" && module2 instanceof Response) {
|
|
235
|
+
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
236
|
+
try {
|
|
237
|
+
return await WebAssembly.instantiateStreaming(module2, imports);
|
|
238
|
+
} catch (e) {
|
|
239
|
+
if (module2.headers.get("Content-Type") != "application/wasm") {
|
|
240
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
241
|
+
} else {
|
|
242
|
+
throw e;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
const bytes = await module2.arrayBuffer();
|
|
247
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
248
|
+
} else {
|
|
249
|
+
const instance = await WebAssembly.instantiate(module2, imports);
|
|
250
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
251
|
+
return { instance, module: module2 };
|
|
252
|
+
} else {
|
|
253
|
+
return instance;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
function __wbg_get_imports() {
|
|
258
|
+
const imports = {};
|
|
259
|
+
imports.wbg = {};
|
|
260
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
261
|
+
const ret = getObject(arg0) === void 0;
|
|
262
|
+
return ret;
|
|
263
|
+
};
|
|
264
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
265
|
+
const obj = getObject(arg1);
|
|
266
|
+
const ret = typeof obj === "string" ? obj : void 0;
|
|
267
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
268
|
+
var len1 = WASM_VECTOR_LEN;
|
|
269
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
270
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
271
|
+
};
|
|
272
|
+
imports.wbg.__wbindgen_boolean_get = function(arg0) {
|
|
273
|
+
const v = getObject(arg0);
|
|
274
|
+
const ret = typeof v === "boolean" ? v ? 1 : 0 : 2;
|
|
275
|
+
return ret;
|
|
276
|
+
};
|
|
277
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
278
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
279
|
+
return addHeapObject(ret);
|
|
280
|
+
};
|
|
281
|
+
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
282
|
+
const val = getObject(arg0);
|
|
283
|
+
const ret = typeof val === "object" && val !== null;
|
|
284
|
+
return ret;
|
|
285
|
+
};
|
|
286
|
+
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
287
|
+
const ret = getObject(arg0);
|
|
288
|
+
return addHeapObject(ret);
|
|
289
|
+
};
|
|
290
|
+
imports.wbg.__wbg_getwithrefkey_4a92a5eca60879b9 = function(arg0, arg1) {
|
|
291
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
292
|
+
return addHeapObject(ret);
|
|
293
|
+
};
|
|
294
|
+
imports.wbg.__wbindgen_in = function(arg0, arg1) {
|
|
295
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
296
|
+
return ret;
|
|
297
|
+
};
|
|
298
|
+
imports.wbg.__wbg_isSafeInteger_f93fde0dca9820f8 = function(arg0) {
|
|
299
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
300
|
+
return ret;
|
|
301
|
+
};
|
|
302
|
+
imports.wbg.__wbindgen_as_number = function(arg0) {
|
|
303
|
+
const ret = +getObject(arg0);
|
|
304
|
+
return ret;
|
|
305
|
+
};
|
|
306
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
307
|
+
takeObject(arg0);
|
|
308
|
+
};
|
|
309
|
+
imports.wbg.__wbg_length_1d25fa9e4ac21ce7 = function(arg0) {
|
|
310
|
+
const ret = getObject(arg0).length;
|
|
311
|
+
return ret;
|
|
312
|
+
};
|
|
313
|
+
imports.wbg.__wbindgen_memory = function() {
|
|
314
|
+
const ret = wasm.memory;
|
|
315
|
+
return addHeapObject(ret);
|
|
316
|
+
};
|
|
317
|
+
imports.wbg.__wbg_buffer_a448f833075b71ba = function(arg0) {
|
|
318
|
+
const ret = getObject(arg0).buffer;
|
|
319
|
+
return addHeapObject(ret);
|
|
320
|
+
};
|
|
321
|
+
imports.wbg.__wbg_new_8f67e318f15d7254 = function(arg0) {
|
|
322
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
323
|
+
return addHeapObject(ret);
|
|
324
|
+
};
|
|
325
|
+
imports.wbg.__wbg_set_2357bf09366ee480 = function(arg0, arg1, arg2) {
|
|
326
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
327
|
+
};
|
|
328
|
+
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
329
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
330
|
+
return addHeapObject(ret);
|
|
331
|
+
};
|
|
332
|
+
imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
|
333
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
334
|
+
return ret;
|
|
335
|
+
};
|
|
336
|
+
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
337
|
+
const obj = getObject(arg1);
|
|
338
|
+
const ret = typeof obj === "number" ? obj : void 0;
|
|
339
|
+
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
340
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
341
|
+
};
|
|
342
|
+
imports.wbg.__wbg_instanceof_Uint8Array_bced6f43aed8c1aa = function(arg0) {
|
|
343
|
+
let result;
|
|
344
|
+
try {
|
|
345
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
346
|
+
} catch (_) {
|
|
347
|
+
result = false;
|
|
348
|
+
}
|
|
349
|
+
const ret = result;
|
|
350
|
+
return ret;
|
|
351
|
+
};
|
|
352
|
+
imports.wbg.__wbg_instanceof_ArrayBuffer_e7d53d51371448e2 = function(arg0) {
|
|
353
|
+
let result;
|
|
354
|
+
try {
|
|
355
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
356
|
+
} catch (_) {
|
|
357
|
+
result = false;
|
|
358
|
+
}
|
|
359
|
+
const ret = result;
|
|
360
|
+
return ret;
|
|
361
|
+
};
|
|
362
|
+
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
363
|
+
const ret = debugString(getObject(arg1));
|
|
364
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
365
|
+
const len1 = WASM_VECTOR_LEN;
|
|
366
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
367
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
368
|
+
};
|
|
369
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
370
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
371
|
+
};
|
|
372
|
+
return imports;
|
|
373
|
+
}
|
|
374
|
+
function __wbg_init_memory(imports, maybe_memory) {
|
|
375
|
+
}
|
|
376
|
+
function __wbg_finalize_init(instance, module2) {
|
|
377
|
+
wasm = instance.exports;
|
|
378
|
+
__wbg_init.__wbindgen_wasm_module = module2;
|
|
379
|
+
cachedFloat64Memory0 = null;
|
|
380
|
+
cachedInt32Memory0 = null;
|
|
381
|
+
cachedUint8Memory0 = null;
|
|
382
|
+
return wasm;
|
|
383
|
+
}
|
|
384
|
+
async function __wbg_init(input) {
|
|
385
|
+
if (wasm !== void 0)
|
|
386
|
+
return wasm;
|
|
387
|
+
if (typeof input === "undefined") {
|
|
388
|
+
input = new URL("index_bg.wasm", void 0);
|
|
389
|
+
}
|
|
390
|
+
const imports = __wbg_get_imports();
|
|
391
|
+
if (typeof input === "string" || typeof Request === "function" && input instanceof Request || typeof URL === "function" && input instanceof URL) {
|
|
392
|
+
input = fetch(input);
|
|
393
|
+
}
|
|
394
|
+
__wbg_init_memory(imports);
|
|
395
|
+
const { instance, module: module2 } = await __wbg_load(await input, imports);
|
|
396
|
+
return __wbg_finalize_init(instance, module2);
|
|
397
|
+
}
|
|
398
|
+
var dist_default = __wbg_init;
|
|
399
|
+
|
|
400
|
+
// wasm-binding.ts
|
|
401
|
+
var initialized = false;
|
|
402
|
+
var initWasm = async (module_or_path) => {
|
|
403
|
+
if (initialized) {
|
|
404
|
+
throw new Error(
|
|
405
|
+
"Already initialized. The `initWasm()` function can be used only once."
|
|
406
|
+
);
|
|
407
|
+
}
|
|
408
|
+
await dist_default(await module_or_path);
|
|
409
|
+
initialized = true;
|
|
410
|
+
};
|
|
411
|
+
function inline2(html, options) {
|
|
412
|
+
return inline(html, options);
|
|
413
|
+
}
|
|
414
|
+
function version2() {
|
|
415
|
+
return version();
|
|
416
|
+
}
|
package/index.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var cssInline=(()=>{var S=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var B=(e,n)=>{for(var t in n)S(e,t,{get:n[t],enumerable:!0})},q=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of D(n))!N.call(e,i)&&i!==t&&S(e,i,{get:()=>n[i],enumerable:!(r=$(n,i))||r.enumerable});return e};var z=e=>q(S({},"__esModule",{value:!0}),e);var Y={};B(Y,{initWasm:()=>K,inline:()=>Q,version:()=>X});var c,b=new Array(128).fill(void 0);b.push(void 0,null,!0,!1);function o(e){return b[e]}var h=0,g=null;function A(){return(g===null||g.byteLength===0)&&(g=new Uint8Array(c.memory.buffer)),g}var I=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},C=typeof I.encodeInto=="function"?function(e,n){return I.encodeInto(e,n)}:function(e,n){let t=I.encode(e);return n.set(t),{read:e.length,written:t.length}};function W(e,n,t){if(t===void 0){let _=I.encode(e),a=n(_.length,1)>>>0;return A().subarray(a,a+_.length).set(_),h=_.length,a}let r=e.length,i=n(r,1)>>>0,f=A(),s=0;for(;s<r;s++){let _=e.charCodeAt(s);if(_>127)break;f[i+s]=_}if(s!==r){s!==0&&(e=e.slice(s)),i=t(i,r,r=s+e.length*3,1)>>>0;let _=A().subarray(i+s,i+r),a=C(e,_);s+=a.written}return h=s,i}function j(e){return e==null}var w=null;function u(){return(w===null||w.byteLength===0)&&(w=new Int32Array(c.memory.buffer)),w}var M=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&M.decode();function m(e,n){return e=e>>>0,M.decode(A().subarray(e,e+n))}var p=b.length;function l(e){p===b.length&&b.push(b.length+1);let n=p;return p=b[n],b[n]=e,n}function P(e){e<132||(b[e]=p,p=e)}function O(e){let n=o(e);return P(e),n}var y=null;function H(){return(y===null||y.byteLength===0)&&(y=new Float64Array(c.memory.buffer)),y}function E(e){let n=typeof e;if(n=="number"||n=="boolean"||e==null)return`${e}`;if(n=="string")return`"${e}"`;if(n=="symbol"){let i=e.description;return i==null?"Symbol":`Symbol(${i})`}if(n=="function"){let i=e.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(e)){let i=e.length,f="[";i>0&&(f+=E(e[0]));for(let s=1;s<i;s++)f+=", "+E(e[s]);return f+="]",f}let t=/\[object ([^\]]+)\]/.exec(toString.call(e)),r;if(t.length>1)r=t[1];else return toString.call(e);if(r=="Object")try{return"Object("+JSON.stringify(e)+")"}catch{return"Object"}return e instanceof Error?`${e.name}: ${e.message}
|
|
2
|
+
${e.stack}`:r}function T(e,n){let t,r;try{let d=c.__wbindgen_add_to_stack_pointer(-16),L=W(e,c.__wbindgen_malloc,c.__wbindgen_realloc),R=h;c.inline(d,L,R,l(n));var i=u()[d/4+0],f=u()[d/4+1],s=u()[d/4+2],_=u()[d/4+3],a=i,x=f;if(_)throw a=0,x=0,O(s);return t=a,r=x,m(a,x)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_free(t,r,1)}}function k(){let e,n;try{let i=c.__wbindgen_add_to_stack_pointer(-16);c.version(i);var t=u()[i/4+0],r=u()[i/4+1];return e=t,n=r,m(t,r)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_free(e,n,1)}}async function J(e,n){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,n)}catch(r){if(e.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let t=await e.arrayBuffer();return await WebAssembly.instantiate(t,n)}else{let t=await WebAssembly.instantiate(e,n);return t instanceof WebAssembly.Instance?{instance:t,module:e}:t}}function V(){let e={};return e.wbg={},e.wbg.__wbindgen_is_undefined=function(n){return o(n)===void 0},e.wbg.__wbindgen_string_get=function(n,t){let r=o(t),i=typeof r=="string"?r:void 0;var f=j(i)?0:W(i,c.__wbindgen_malloc,c.__wbindgen_realloc),s=h;u()[n/4+1]=s,u()[n/4+0]=f},e.wbg.__wbindgen_boolean_get=function(n){let t=o(n);return typeof t=="boolean"?t?1:0:2},e.wbg.__wbindgen_string_new=function(n,t){let r=m(n,t);return l(r)},e.wbg.__wbindgen_is_object=function(n){let t=o(n);return typeof t=="object"&&t!==null},e.wbg.__wbindgen_object_clone_ref=function(n){let t=o(n);return l(t)},e.wbg.__wbg_getwithrefkey_4a92a5eca60879b9=function(n,t){let r=o(n)[o(t)];return l(r)},e.wbg.__wbindgen_in=function(n,t){return o(n)in o(t)},e.wbg.__wbg_isSafeInteger_f93fde0dca9820f8=function(n){return Number.isSafeInteger(o(n))},e.wbg.__wbindgen_as_number=function(n){return+o(n)},e.wbg.__wbindgen_object_drop_ref=function(n){O(n)},e.wbg.__wbg_length_1d25fa9e4ac21ce7=function(n){return o(n).length},e.wbg.__wbindgen_memory=function(){let n=c.memory;return l(n)},e.wbg.__wbg_buffer_a448f833075b71ba=function(n){let t=o(n).buffer;return l(t)},e.wbg.__wbg_new_8f67e318f15d7254=function(n){let t=new Uint8Array(o(n));return l(t)},e.wbg.__wbg_set_2357bf09366ee480=function(n,t,r){o(n).set(o(t),r>>>0)},e.wbg.__wbindgen_error_new=function(n,t){let r=new Error(m(n,t));return l(r)},e.wbg.__wbindgen_jsval_loose_eq=function(n,t){return o(n)==o(t)},e.wbg.__wbindgen_number_get=function(n,t){let r=o(t),i=typeof r=="number"?r:void 0;H()[n/8+1]=j(i)?0:i,u()[n/4+0]=!j(i)},e.wbg.__wbg_instanceof_Uint8Array_bced6f43aed8c1aa=function(n){let t;try{t=o(n)instanceof Uint8Array}catch{t=!1}return t},e.wbg.__wbg_instanceof_ArrayBuffer_e7d53d51371448e2=function(n){let t;try{t=o(n)instanceof ArrayBuffer}catch{t=!1}return t},e.wbg.__wbindgen_debug_string=function(n,t){let r=E(o(t)),i=W(r,c.__wbindgen_malloc,c.__wbindgen_realloc),f=h;u()[n/4+1]=f,u()[n/4+0]=i},e.wbg.__wbindgen_throw=function(n,t){throw new Error(m(n,t))},e}function G(e,n){return c=e.exports,U.__wbindgen_wasm_module=n,y=null,w=null,g=null,c}async function U(e){if(c!==void 0)return c;typeof e>"u"&&(e=new URL("index_bg.wasm",void 0));let n=V();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:t,module:r}=await J(await e,n);return G(t,r)}var v=U;var F=!1,K=async e=>{if(F)throw new Error("Already initialized. The `initWasm()` function can be used only once.");await v(await e),F=!0};function Q(e,n){return T(e,n)}function X(){return k()}return z(Y);})();
|
package/index.mjs
ADDED
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
// wasm/dist/index.js
|
|
2
|
+
var wasm;
|
|
3
|
+
var heap = new Array(128).fill(void 0);
|
|
4
|
+
heap.push(void 0, null, true, false);
|
|
5
|
+
function getObject(idx) {
|
|
6
|
+
return heap[idx];
|
|
7
|
+
}
|
|
8
|
+
var WASM_VECTOR_LEN = 0;
|
|
9
|
+
var cachedUint8Memory0 = null;
|
|
10
|
+
function getUint8Memory0() {
|
|
11
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
12
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
13
|
+
}
|
|
14
|
+
return cachedUint8Memory0;
|
|
15
|
+
}
|
|
16
|
+
var cachedTextEncoder = typeof TextEncoder !== "undefined" ? new TextEncoder("utf-8") : { encode: () => {
|
|
17
|
+
throw Error("TextEncoder not available");
|
|
18
|
+
} };
|
|
19
|
+
var encodeString = typeof cachedTextEncoder.encodeInto === "function" ? function(arg, view) {
|
|
20
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
21
|
+
} : function(arg, view) {
|
|
22
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
23
|
+
view.set(buf);
|
|
24
|
+
return {
|
|
25
|
+
read: arg.length,
|
|
26
|
+
written: buf.length
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
30
|
+
if (realloc === void 0) {
|
|
31
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
32
|
+
const ptr2 = malloc(buf.length, 1) >>> 0;
|
|
33
|
+
getUint8Memory0().subarray(ptr2, ptr2 + buf.length).set(buf);
|
|
34
|
+
WASM_VECTOR_LEN = buf.length;
|
|
35
|
+
return ptr2;
|
|
36
|
+
}
|
|
37
|
+
let len = arg.length;
|
|
38
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
39
|
+
const mem = getUint8Memory0();
|
|
40
|
+
let offset = 0;
|
|
41
|
+
for (; offset < len; offset++) {
|
|
42
|
+
const code = arg.charCodeAt(offset);
|
|
43
|
+
if (code > 127)
|
|
44
|
+
break;
|
|
45
|
+
mem[ptr + offset] = code;
|
|
46
|
+
}
|
|
47
|
+
if (offset !== len) {
|
|
48
|
+
if (offset !== 0) {
|
|
49
|
+
arg = arg.slice(offset);
|
|
50
|
+
}
|
|
51
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
52
|
+
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
53
|
+
const ret = encodeString(arg, view);
|
|
54
|
+
offset += ret.written;
|
|
55
|
+
}
|
|
56
|
+
WASM_VECTOR_LEN = offset;
|
|
57
|
+
return ptr;
|
|
58
|
+
}
|
|
59
|
+
function isLikeNone(x) {
|
|
60
|
+
return x === void 0 || x === null;
|
|
61
|
+
}
|
|
62
|
+
var cachedInt32Memory0 = null;
|
|
63
|
+
function getInt32Memory0() {
|
|
64
|
+
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
65
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
66
|
+
}
|
|
67
|
+
return cachedInt32Memory0;
|
|
68
|
+
}
|
|
69
|
+
var cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
70
|
+
throw Error("TextDecoder not available");
|
|
71
|
+
} };
|
|
72
|
+
if (typeof TextDecoder !== "undefined") {
|
|
73
|
+
cachedTextDecoder.decode();
|
|
74
|
+
}
|
|
75
|
+
function getStringFromWasm0(ptr, len) {
|
|
76
|
+
ptr = ptr >>> 0;
|
|
77
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
78
|
+
}
|
|
79
|
+
var heap_next = heap.length;
|
|
80
|
+
function addHeapObject(obj) {
|
|
81
|
+
if (heap_next === heap.length)
|
|
82
|
+
heap.push(heap.length + 1);
|
|
83
|
+
const idx = heap_next;
|
|
84
|
+
heap_next = heap[idx];
|
|
85
|
+
heap[idx] = obj;
|
|
86
|
+
return idx;
|
|
87
|
+
}
|
|
88
|
+
function dropObject(idx) {
|
|
89
|
+
if (idx < 132)
|
|
90
|
+
return;
|
|
91
|
+
heap[idx] = heap_next;
|
|
92
|
+
heap_next = idx;
|
|
93
|
+
}
|
|
94
|
+
function takeObject(idx) {
|
|
95
|
+
const ret = getObject(idx);
|
|
96
|
+
dropObject(idx);
|
|
97
|
+
return ret;
|
|
98
|
+
}
|
|
99
|
+
var cachedFloat64Memory0 = null;
|
|
100
|
+
function getFloat64Memory0() {
|
|
101
|
+
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
102
|
+
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
103
|
+
}
|
|
104
|
+
return cachedFloat64Memory0;
|
|
105
|
+
}
|
|
106
|
+
function debugString(val) {
|
|
107
|
+
const type = typeof val;
|
|
108
|
+
if (type == "number" || type == "boolean" || val == null) {
|
|
109
|
+
return `${val}`;
|
|
110
|
+
}
|
|
111
|
+
if (type == "string") {
|
|
112
|
+
return `"${val}"`;
|
|
113
|
+
}
|
|
114
|
+
if (type == "symbol") {
|
|
115
|
+
const description = val.description;
|
|
116
|
+
if (description == null) {
|
|
117
|
+
return "Symbol";
|
|
118
|
+
} else {
|
|
119
|
+
return `Symbol(${description})`;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (type == "function") {
|
|
123
|
+
const name = val.name;
|
|
124
|
+
if (typeof name == "string" && name.length > 0) {
|
|
125
|
+
return `Function(${name})`;
|
|
126
|
+
} else {
|
|
127
|
+
return "Function";
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (Array.isArray(val)) {
|
|
131
|
+
const length = val.length;
|
|
132
|
+
let debug = "[";
|
|
133
|
+
if (length > 0) {
|
|
134
|
+
debug += debugString(val[0]);
|
|
135
|
+
}
|
|
136
|
+
for (let i = 1; i < length; i++) {
|
|
137
|
+
debug += ", " + debugString(val[i]);
|
|
138
|
+
}
|
|
139
|
+
debug += "]";
|
|
140
|
+
return debug;
|
|
141
|
+
}
|
|
142
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
143
|
+
let className;
|
|
144
|
+
if (builtInMatches.length > 1) {
|
|
145
|
+
className = builtInMatches[1];
|
|
146
|
+
} else {
|
|
147
|
+
return toString.call(val);
|
|
148
|
+
}
|
|
149
|
+
if (className == "Object") {
|
|
150
|
+
try {
|
|
151
|
+
return "Object(" + JSON.stringify(val) + ")";
|
|
152
|
+
} catch (_) {
|
|
153
|
+
return "Object";
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (val instanceof Error) {
|
|
157
|
+
return `${val.name}: ${val.message}
|
|
158
|
+
${val.stack}`;
|
|
159
|
+
}
|
|
160
|
+
return className;
|
|
161
|
+
}
|
|
162
|
+
function inline(html, options) {
|
|
163
|
+
let deferred3_0;
|
|
164
|
+
let deferred3_1;
|
|
165
|
+
try {
|
|
166
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
167
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
168
|
+
const len0 = WASM_VECTOR_LEN;
|
|
169
|
+
wasm.inline(retptr, ptr0, len0, addHeapObject(options));
|
|
170
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
171
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
172
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
173
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
174
|
+
var ptr2 = r0;
|
|
175
|
+
var len2 = r1;
|
|
176
|
+
if (r3) {
|
|
177
|
+
ptr2 = 0;
|
|
178
|
+
len2 = 0;
|
|
179
|
+
throw takeObject(r2);
|
|
180
|
+
}
|
|
181
|
+
deferred3_0 = ptr2;
|
|
182
|
+
deferred3_1 = len2;
|
|
183
|
+
return getStringFromWasm0(ptr2, len2);
|
|
184
|
+
} finally {
|
|
185
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
186
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
function version() {
|
|
190
|
+
let deferred1_0;
|
|
191
|
+
let deferred1_1;
|
|
192
|
+
try {
|
|
193
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
194
|
+
wasm.version(retptr);
|
|
195
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
196
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
197
|
+
deferred1_0 = r0;
|
|
198
|
+
deferred1_1 = r1;
|
|
199
|
+
return getStringFromWasm0(r0, r1);
|
|
200
|
+
} finally {
|
|
201
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
202
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
async function __wbg_load(module, imports) {
|
|
206
|
+
if (typeof Response === "function" && module instanceof Response) {
|
|
207
|
+
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
208
|
+
try {
|
|
209
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
210
|
+
} catch (e) {
|
|
211
|
+
if (module.headers.get("Content-Type") != "application/wasm") {
|
|
212
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
213
|
+
} else {
|
|
214
|
+
throw e;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
const bytes = await module.arrayBuffer();
|
|
219
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
220
|
+
} else {
|
|
221
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
222
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
223
|
+
return { instance, module };
|
|
224
|
+
} else {
|
|
225
|
+
return instance;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
function __wbg_get_imports() {
|
|
230
|
+
const imports = {};
|
|
231
|
+
imports.wbg = {};
|
|
232
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
233
|
+
const ret = getObject(arg0) === void 0;
|
|
234
|
+
return ret;
|
|
235
|
+
};
|
|
236
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
237
|
+
const obj = getObject(arg1);
|
|
238
|
+
const ret = typeof obj === "string" ? obj : void 0;
|
|
239
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
240
|
+
var len1 = WASM_VECTOR_LEN;
|
|
241
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
242
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
243
|
+
};
|
|
244
|
+
imports.wbg.__wbindgen_boolean_get = function(arg0) {
|
|
245
|
+
const v = getObject(arg0);
|
|
246
|
+
const ret = typeof v === "boolean" ? v ? 1 : 0 : 2;
|
|
247
|
+
return ret;
|
|
248
|
+
};
|
|
249
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
250
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
251
|
+
return addHeapObject(ret);
|
|
252
|
+
};
|
|
253
|
+
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
254
|
+
const val = getObject(arg0);
|
|
255
|
+
const ret = typeof val === "object" && val !== null;
|
|
256
|
+
return ret;
|
|
257
|
+
};
|
|
258
|
+
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
259
|
+
const ret = getObject(arg0);
|
|
260
|
+
return addHeapObject(ret);
|
|
261
|
+
};
|
|
262
|
+
imports.wbg.__wbg_getwithrefkey_4a92a5eca60879b9 = function(arg0, arg1) {
|
|
263
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
264
|
+
return addHeapObject(ret);
|
|
265
|
+
};
|
|
266
|
+
imports.wbg.__wbindgen_in = function(arg0, arg1) {
|
|
267
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
268
|
+
return ret;
|
|
269
|
+
};
|
|
270
|
+
imports.wbg.__wbg_isSafeInteger_f93fde0dca9820f8 = function(arg0) {
|
|
271
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
272
|
+
return ret;
|
|
273
|
+
};
|
|
274
|
+
imports.wbg.__wbindgen_as_number = function(arg0) {
|
|
275
|
+
const ret = +getObject(arg0);
|
|
276
|
+
return ret;
|
|
277
|
+
};
|
|
278
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
279
|
+
takeObject(arg0);
|
|
280
|
+
};
|
|
281
|
+
imports.wbg.__wbg_length_1d25fa9e4ac21ce7 = function(arg0) {
|
|
282
|
+
const ret = getObject(arg0).length;
|
|
283
|
+
return ret;
|
|
284
|
+
};
|
|
285
|
+
imports.wbg.__wbindgen_memory = function() {
|
|
286
|
+
const ret = wasm.memory;
|
|
287
|
+
return addHeapObject(ret);
|
|
288
|
+
};
|
|
289
|
+
imports.wbg.__wbg_buffer_a448f833075b71ba = function(arg0) {
|
|
290
|
+
const ret = getObject(arg0).buffer;
|
|
291
|
+
return addHeapObject(ret);
|
|
292
|
+
};
|
|
293
|
+
imports.wbg.__wbg_new_8f67e318f15d7254 = function(arg0) {
|
|
294
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
295
|
+
return addHeapObject(ret);
|
|
296
|
+
};
|
|
297
|
+
imports.wbg.__wbg_set_2357bf09366ee480 = function(arg0, arg1, arg2) {
|
|
298
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
299
|
+
};
|
|
300
|
+
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
301
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
302
|
+
return addHeapObject(ret);
|
|
303
|
+
};
|
|
304
|
+
imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
|
305
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
306
|
+
return ret;
|
|
307
|
+
};
|
|
308
|
+
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
309
|
+
const obj = getObject(arg1);
|
|
310
|
+
const ret = typeof obj === "number" ? obj : void 0;
|
|
311
|
+
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
312
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
313
|
+
};
|
|
314
|
+
imports.wbg.__wbg_instanceof_Uint8Array_bced6f43aed8c1aa = function(arg0) {
|
|
315
|
+
let result;
|
|
316
|
+
try {
|
|
317
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
318
|
+
} catch (_) {
|
|
319
|
+
result = false;
|
|
320
|
+
}
|
|
321
|
+
const ret = result;
|
|
322
|
+
return ret;
|
|
323
|
+
};
|
|
324
|
+
imports.wbg.__wbg_instanceof_ArrayBuffer_e7d53d51371448e2 = function(arg0) {
|
|
325
|
+
let result;
|
|
326
|
+
try {
|
|
327
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
328
|
+
} catch (_) {
|
|
329
|
+
result = false;
|
|
330
|
+
}
|
|
331
|
+
const ret = result;
|
|
332
|
+
return ret;
|
|
333
|
+
};
|
|
334
|
+
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
335
|
+
const ret = debugString(getObject(arg1));
|
|
336
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
337
|
+
const len1 = WASM_VECTOR_LEN;
|
|
338
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
339
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
340
|
+
};
|
|
341
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
342
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
343
|
+
};
|
|
344
|
+
return imports;
|
|
345
|
+
}
|
|
346
|
+
function __wbg_init_memory(imports, maybe_memory) {
|
|
347
|
+
}
|
|
348
|
+
function __wbg_finalize_init(instance, module) {
|
|
349
|
+
wasm = instance.exports;
|
|
350
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
351
|
+
cachedFloat64Memory0 = null;
|
|
352
|
+
cachedInt32Memory0 = null;
|
|
353
|
+
cachedUint8Memory0 = null;
|
|
354
|
+
return wasm;
|
|
355
|
+
}
|
|
356
|
+
async function __wbg_init(input) {
|
|
357
|
+
if (wasm !== void 0)
|
|
358
|
+
return wasm;
|
|
359
|
+
if (typeof input === "undefined") {
|
|
360
|
+
input = new URL("index_bg.wasm", void 0);
|
|
361
|
+
}
|
|
362
|
+
const imports = __wbg_get_imports();
|
|
363
|
+
if (typeof input === "string" || typeof Request === "function" && input instanceof Request || typeof URL === "function" && input instanceof URL) {
|
|
364
|
+
input = fetch(input);
|
|
365
|
+
}
|
|
366
|
+
__wbg_init_memory(imports);
|
|
367
|
+
const { instance, module } = await __wbg_load(await input, imports);
|
|
368
|
+
return __wbg_finalize_init(instance, module);
|
|
369
|
+
}
|
|
370
|
+
var dist_default = __wbg_init;
|
|
371
|
+
|
|
372
|
+
// wasm-binding.ts
|
|
373
|
+
var initialized = false;
|
|
374
|
+
var initWasm = async (module_or_path) => {
|
|
375
|
+
if (initialized) {
|
|
376
|
+
throw new Error(
|
|
377
|
+
"Already initialized. The `initWasm()` function can be used only once."
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
await dist_default(await module_or_path);
|
|
381
|
+
initialized = true;
|
|
382
|
+
};
|
|
383
|
+
function inline2(html, options) {
|
|
384
|
+
return inline(html, options);
|
|
385
|
+
}
|
|
386
|
+
function version2() {
|
|
387
|
+
return version();
|
|
388
|
+
}
|
|
389
|
+
export {
|
|
390
|
+
initWasm,
|
|
391
|
+
inline2 as inline,
|
|
392
|
+
version2 as version
|
|
393
|
+
};
|
package/index_bg.wasm
ADDED
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@css-inline/css-inline-wasm",
|
|
3
|
+
"version": "0.12.0",
|
|
4
|
+
"description": "High-performance library for inlining CSS into HTML 'style' attributes",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"css",
|
|
7
|
+
"html",
|
|
8
|
+
"email",
|
|
9
|
+
"stylesheet",
|
|
10
|
+
"inlining"
|
|
11
|
+
],
|
|
12
|
+
"repository": "https://github.com/Stranger6667/css-inline",
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"registry": "https://registry.npmjs.org/",
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
17
|
+
"main": "index.js",
|
|
18
|
+
"unpkg": "index.min.js",
|
|
19
|
+
"types": "index.d.ts",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"import": "./index.mjs",
|
|
23
|
+
"default": "./index.js"
|
|
24
|
+
},
|
|
25
|
+
"./index_bg.wasm": "./index_bg.wasm"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"index_bg.wasm",
|
|
29
|
+
"index.js",
|
|
30
|
+
"index.mjs",
|
|
31
|
+
"index.min.js",
|
|
32
|
+
"index.d.ts"
|
|
33
|
+
],
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">= 10"
|
|
37
|
+
},
|
|
38
|
+
"ava": {
|
|
39
|
+
"require": [
|
|
40
|
+
"@swc-node/register"
|
|
41
|
+
],
|
|
42
|
+
"typescript": {
|
|
43
|
+
"rewritePaths": {
|
|
44
|
+
"src/": "build/"
|
|
45
|
+
},
|
|
46
|
+
"compile": false
|
|
47
|
+
},
|
|
48
|
+
"timeout": "3m"
|
|
49
|
+
},
|
|
50
|
+
"sideEffects": false
|
|
51
|
+
}
|