shinkom 1.1.0 → 1.1.2

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.
Files changed (85) hide show
  1. package/README.md +0 -18
  2. package/dist/bundles/_virtual/_rolldown/runtime.js +14 -14
  3. package/dist/bundles/core/constants.d.ts +15 -15
  4. package/dist/bundles/core/constants.js +23 -23
  5. package/dist/bundles/core/elements/compat-view-element.d.ts +99 -99
  6. package/dist/bundles/core/elements/compat-view-element.js +440 -440
  7. package/dist/bundles/core/elements/control-panel-element.d.ts +44 -44
  8. package/dist/bundles/core/elements/control-panel-element.js +99 -99
  9. package/dist/bundles/core/elements/index.d.ts +12 -12
  10. package/dist/bundles/core/elements/index.js +13 -13
  11. package/dist/bundles/core/elements/inspector-element.d.ts +26 -26
  12. package/dist/bundles/core/elements/inspector-element.js +58 -58
  13. package/dist/bundles/core/elements/recent-result-item.js +46 -46
  14. package/dist/bundles/core/elements/results-history-item.js +46 -46
  15. package/dist/bundles/core/elements/templates/compat-view.templates.js +462 -462
  16. package/dist/bundles/core/elements/templates/control-panel.templates.js +335 -335
  17. package/dist/bundles/core/elements/templates/root-styles.template.js +40 -40
  18. package/dist/bundles/core/event-bus.d.ts +46 -46
  19. package/dist/bundles/core/event-bus.js +49 -49
  20. package/dist/bundles/core/helpers.js +47 -47
  21. package/dist/bundles/core/index.d.ts +14 -14
  22. package/dist/bundles/core/index.js +16 -16
  23. package/dist/bundles/core/state-service.d.ts +56 -56
  24. package/dist/bundles/core/state-service.js +91 -80
  25. package/dist/bundles/core/ui-component.d.ts +63 -63
  26. package/dist/bundles/core/ui-component.js +71 -71
  27. package/dist/bundles/engine/engine.d.ts +108 -108
  28. package/dist/bundles/engine/engine.js +238 -238
  29. package/dist/bundles/engine/index.js +8 -8
  30. package/dist/bundles/gen/index.js +14 -14
  31. package/dist/bundles/index.d.ts +19 -19
  32. package/dist/bundles/index.js +23 -23
  33. package/dist/bundles/pkg/shinkore.d.ts +40 -50
  34. package/dist/bundles/pkg/shinkore.js +465 -465
  35. package/dist/bundles/pkg/shinkore_bg.wasm +0 -0
  36. package/dist/bundles/shinkom.d.ts +41 -41
  37. package/dist/bundles/shinkom.js +80 -80
  38. package/dist/bundles/ui/compat-ui/compat-ui.d.ts +42 -42
  39. package/dist/bundles/ui/compat-ui/compat-ui.js +59 -59
  40. package/dist/bundles/ui/compat-ui/index.js +8 -8
  41. package/dist/bundles/ui/compatibility-view/compatibility-view.d.ts +41 -41
  42. package/dist/bundles/ui/compatibility-view/compatibility-view.js +229 -229
  43. package/dist/bundles/ui/compatibility-view/index.js +8 -8
  44. package/dist/bundles/ui/control-panel/control-panel.d.ts +52 -52
  45. package/dist/bundles/ui/control-panel/control-panel.js +320 -320
  46. package/dist/bundles/ui/control-panel/index.js +8 -8
  47. package/dist/bundles/ui/index.d.ts +11 -11
  48. package/dist/bundles/ui/index.js +16 -16
  49. package/dist/bundles/ui/inspector/index.js +8 -8
  50. package/dist/bundles/ui/inspector/inspector.d.ts +97 -97
  51. package/dist/bundles/ui/inspector/inspector.js +394 -394
  52. package/dist/modules/core/constants.cjs +17 -17
  53. package/dist/modules/core/elements/compat-view-element.cjs +434 -434
  54. package/dist/modules/core/elements/control-panel-element.cjs +93 -93
  55. package/dist/modules/core/elements/index.cjs +11 -11
  56. package/dist/modules/core/elements/inspector-element.cjs +52 -52
  57. package/dist/modules/core/elements/recent-result-item.cjs +39 -39
  58. package/dist/modules/core/elements/results-history-item.cjs +39 -39
  59. package/dist/modules/core/elements/templates/compat-view.templates.cjs +458 -458
  60. package/dist/modules/core/elements/templates/control-panel.templates.cjs +332 -332
  61. package/dist/modules/core/elements/templates/root-styles.template.cjs +33 -33
  62. package/dist/modules/core/event-bus.cjs +43 -43
  63. package/dist/modules/core/helpers.cjs +41 -41
  64. package/dist/modules/core/index.cjs +16 -16
  65. package/dist/modules/core/state-service.cjs +85 -74
  66. package/dist/modules/core/ui-component.cjs +65 -65
  67. package/dist/modules/engine/engine.cjs +232 -232
  68. package/dist/modules/gen/browser-data.cjs +100 -100
  69. package/dist/modules/gen/browser-usage-data.cjs +675 -675
  70. package/dist/modules/gen/compat-data.cjs +31015 -31015
  71. package/dist/modules/gen/index.cjs +7 -7
  72. package/dist/modules/index.cjs +27 -27
  73. package/dist/modules/pkg/shinkore.cjs +459 -459
  74. package/dist/modules/pkg/shinkore_bg.wasm +0 -0
  75. package/dist/modules/shinkom.cjs +73 -73
  76. package/dist/modules/ui/compat-ui/compat-ui.cjs +53 -53
  77. package/dist/modules/ui/compat-ui/index.cjs +1 -1
  78. package/dist/modules/ui/compatibility-view/compatibility-view.cjs +223 -223
  79. package/dist/modules/ui/compatibility-view/index.cjs +1 -1
  80. package/dist/modules/ui/control-panel/control-panel.cjs +314 -314
  81. package/dist/modules/ui/control-panel/index.cjs +1 -1
  82. package/dist/modules/ui/index.cjs +13 -13
  83. package/dist/modules/ui/inspector/index.cjs +1 -1
  84. package/dist/modules/ui/inspector/inspector.cjs +388 -388
  85. package/package.json +100 -100
@@ -1,459 +1,459 @@
1
- //#region pkg/shinkore.js
2
- /**
3
- * The [`CompatEngine`] struct stores the compatibility data
4
- * and acts as an entry-point for the Rust/WASM engine.
5
- */
6
- var CompatEngine = class {
7
- __destroy_into_raw() {
8
- const ptr = this.__wbg_ptr;
9
- this.__wbg_ptr = 0;
10
- CompatEngineFinalization.unregister(this);
11
- return ptr;
12
- }
13
- free() {
14
- const ptr = this.__destroy_into_raw();
15
- wasm.__wbg_compatengine_free(ptr, 0);
16
- }
17
- /**
18
- * Used for checking the compatibility of a single element and its attributes.
19
- * @param {string} html
20
- * @returns {any}
21
- */
22
- check_element(html) {
23
- const ptr0 = passStringToWasm0(html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
24
- const len0 = WASM_VECTOR_LEN;
25
- const ret = wasm.compatengine_check_element(this.__wbg_ptr, ptr0, len0);
26
- if (ret[2]) throw takeFromExternrefTable0(ret[1]);
27
- return takeFromExternrefTable0(ret[0]);
28
- }
29
- /**
30
- * Used for checking the compatibility of multiple elements and their attributes
31
- *
32
- * `depth_level` is used to control how far down in a nested HTML structure to go before
33
- * returning element tags.
34
- *
35
- * See [`preprocess::pre_process_html`] to learn more about how `depth_level` works.
36
- * @param {string} html
37
- * @param {number} depth_level
38
- * @returns {any}
39
- */
40
- check_elements(html, depth_level) {
41
- const ptr0 = passStringToWasm0(html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
42
- const len0 = WASM_VECTOR_LEN;
43
- const ret = wasm.compatengine_check_elements(this.__wbg_ptr, ptr0, len0, depth_level);
44
- if (ret[2]) throw takeFromExternrefTable0(ret[1]);
45
- return takeFromExternrefTable0(ret[0]);
46
- }
47
- /**
48
- * Used for performing a full page compatibility check.
49
- * @param {string} html
50
- * @returns {any}
51
- */
52
- full_inspect(html) {
53
- const ptr0 = passStringToWasm0(html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
54
- const len0 = WASM_VECTOR_LEN;
55
- const ret = wasm.compatengine_full_inspect(this.__wbg_ptr, ptr0, len0);
56
- if (ret[2]) throw takeFromExternrefTable0(ret[1]);
57
- return takeFromExternrefTable0(ret[0]);
58
- }
59
- /**
60
- * Constructs an new engine instance
61
- * @param {any} bcd_html_data
62
- * @param {any} bcd_svg_data
63
- * @param {any} bcd_browser_data
64
- * @param {any} ciu_usage_data
65
- */
66
- constructor(bcd_html_data, bcd_svg_data, bcd_browser_data, ciu_usage_data) {
67
- this.__wbg_ptr = wasm.compatengine_new(bcd_html_data, bcd_svg_data, bcd_browser_data, ciu_usage_data) >>> 0;
68
- CompatEngineFinalization.register(this, this.__wbg_ptr, this);
69
- return this;
70
- }
71
- };
72
- if (Symbol.dispose) CompatEngine.prototype[Symbol.dispose] = CompatEngine.prototype.free;
73
- function __wbg_get_imports() {
74
- const import0 = {
75
- __proto__: null,
76
- __wbg_Error_960c155d3d49e4c2: function(arg0, arg1) {
77
- return Error(getStringFromWasm0(arg0, arg1));
78
- },
79
- __wbg_String_8564e559799eccda: function(arg0, arg1) {
80
- const ptr1 = passStringToWasm0(String(arg1), wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
81
- const len1 = WASM_VECTOR_LEN;
82
- getDataViewMemory0().setInt32(arg0 + 4, len1, true);
83
- getDataViewMemory0().setInt32(arg0 + 0, ptr1, true);
84
- },
85
- __wbg___wbindgen_bigint_get_as_i64_3d3aba5d616c6a51: function(arg0, arg1) {
86
- const v = arg1;
87
- const ret = typeof v === "bigint" ? v : void 0;
88
- getDataViewMemory0().setBigInt64(arg0 + 8, isLikeNone(ret) ? BigInt(0) : ret, true);
89
- getDataViewMemory0().setInt32(arg0 + 0, !isLikeNone(ret), true);
90
- },
91
- __wbg___wbindgen_boolean_get_6ea149f0a8dcc5ff: function(arg0) {
92
- const v = arg0;
93
- const ret = typeof v === "boolean" ? v : void 0;
94
- return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
95
- },
96
- __wbg___wbindgen_debug_string_ab4b34d23d6778bd: function(arg0, arg1) {
97
- const ptr1 = passStringToWasm0(debugString(arg1), wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
98
- const len1 = WASM_VECTOR_LEN;
99
- getDataViewMemory0().setInt32(arg0 + 4, len1, true);
100
- getDataViewMemory0().setInt32(arg0 + 0, ptr1, true);
101
- },
102
- __wbg___wbindgen_in_a5d8b22e52b24dd1: function(arg0, arg1) {
103
- return arg0 in arg1;
104
- },
105
- __wbg___wbindgen_is_bigint_ec25c7f91b4d9e93: function(arg0) {
106
- return typeof arg0 === "bigint";
107
- },
108
- __wbg___wbindgen_is_function_3baa9db1a987f47d: function(arg0) {
109
- return typeof arg0 === "function";
110
- },
111
- __wbg___wbindgen_is_object_63322ec0cd6ea4ef: function(arg0) {
112
- const val = arg0;
113
- return typeof val === "object" && val !== null;
114
- },
115
- __wbg___wbindgen_is_string_6df3bf7ef1164ed3: function(arg0) {
116
- return typeof arg0 === "string";
117
- },
118
- __wbg___wbindgen_is_undefined_29a43b4d42920abd: function(arg0) {
119
- return arg0 === void 0;
120
- },
121
- __wbg___wbindgen_jsval_eq_d3465d8a07697228: function(arg0, arg1) {
122
- return arg0 === arg1;
123
- },
124
- __wbg___wbindgen_jsval_loose_eq_cac3565e89b4134c: function(arg0, arg1) {
125
- return arg0 == arg1;
126
- },
127
- __wbg___wbindgen_number_get_c7f42aed0525c451: function(arg0, arg1) {
128
- const obj = arg1;
129
- const ret = typeof obj === "number" ? obj : void 0;
130
- getDataViewMemory0().setFloat64(arg0 + 8, isLikeNone(ret) ? 0 : ret, true);
131
- getDataViewMemory0().setInt32(arg0 + 0, !isLikeNone(ret), true);
132
- },
133
- __wbg___wbindgen_string_get_7ed5322991caaec5: function(arg0, arg1) {
134
- const obj = arg1;
135
- const ret = typeof obj === "string" ? obj : void 0;
136
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
137
- var len1 = WASM_VECTOR_LEN;
138
- getDataViewMemory0().setInt32(arg0 + 4, len1, true);
139
- getDataViewMemory0().setInt32(arg0 + 0, ptr1, true);
140
- },
141
- __wbg___wbindgen_throw_6b64449b9b9ed33c: function(arg0, arg1) {
142
- throw new Error(getStringFromWasm0(arg0, arg1));
143
- },
144
- __wbg_call_14b169f759b26747: function() {
145
- return handleError(function(arg0, arg1) {
146
- return arg0.call(arg1);
147
- }, arguments);
148
- },
149
- __wbg_done_9158f7cc8751ba32: function(arg0) {
150
- return arg0.done;
151
- },
152
- __wbg_entries_e0b73aa8571ddb56: function(arg0) {
153
- return Object.entries(arg0);
154
- },
155
- __wbg_error_2001591ad2463697: function(arg0) {
156
- console.error(arg0);
157
- },
158
- __wbg_get_1affdbdd5573b16a: function() {
159
- return handleError(function(arg0, arg1) {
160
- return Reflect.get(arg0, arg1);
161
- }, arguments);
162
- },
163
- __wbg_get_8360291721e2339f: function(arg0, arg1) {
164
- return arg0[arg1 >>> 0];
165
- },
166
- __wbg_get_unchecked_17f53dad852b9588: function(arg0, arg1) {
167
- return arg0[arg1 >>> 0];
168
- },
169
- __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
170
- return arg0[arg1];
171
- },
172
- __wbg_instanceof_ArrayBuffer_7c8433c6ed14ffe3: function(arg0) {
173
- let result;
174
- try {
175
- result = arg0 instanceof ArrayBuffer;
176
- } catch (_) {
177
- result = false;
178
- }
179
- return result;
180
- },
181
- __wbg_instanceof_Map_1b76fd4635be43eb: function(arg0) {
182
- let result;
183
- try {
184
- result = arg0 instanceof Map;
185
- } catch (_) {
186
- result = false;
187
- }
188
- return result;
189
- },
190
- __wbg_instanceof_Uint8Array_152ba1f289edcf3f: function(arg0) {
191
- let result;
192
- try {
193
- result = arg0 instanceof Uint8Array;
194
- } catch (_) {
195
- result = false;
196
- }
197
- return result;
198
- },
199
- __wbg_isArray_c3109d14ffc06469: function(arg0) {
200
- return Array.isArray(arg0);
201
- },
202
- __wbg_isSafeInteger_4fc213d1989d6d2a: function(arg0) {
203
- return Number.isSafeInteger(arg0);
204
- },
205
- __wbg_iterator_013bc09ec998c2a7: function() {
206
- return Symbol.iterator;
207
- },
208
- __wbg_length_3d4ecd04bd8d22f1: function(arg0) {
209
- return arg0.length;
210
- },
211
- __wbg_length_9f1775224cf1d815: function(arg0) {
212
- return arg0.length;
213
- },
214
- __wbg_new_0c7403db6e782f19: function(arg0) {
215
- return new Uint8Array(arg0);
216
- },
217
- __wbg_new_34d45cc8e36aaead: function() {
218
- return /* @__PURE__ */ new Map();
219
- },
220
- __wbg_new_682678e2f47e32bc: function() {
221
- return new Array();
222
- },
223
- __wbg_new_aa8d0fa9762c29bd: function() {
224
- return /* @__PURE__ */ new Object();
225
- },
226
- __wbg_next_0340c4ae324393c3: function() {
227
- return handleError(function(arg0) {
228
- return arg0.next();
229
- }, arguments);
230
- },
231
- __wbg_next_7646edaa39458ef7: function(arg0) {
232
- return arg0.next;
233
- },
234
- __wbg_prototypesetcall_a6b02eb00b0f4ce2: function(arg0, arg1, arg2) {
235
- Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
236
- },
237
- __wbg_set_3bf1de9fab0cd644: function(arg0, arg1, arg2) {
238
- arg0[arg1 >>> 0] = arg2;
239
- },
240
- __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
241
- arg0[arg1] = arg2;
242
- },
243
- __wbg_set_fde2cec06c23692b: function(arg0, arg1, arg2) {
244
- return arg0.set(arg1, arg2);
245
- },
246
- __wbg_value_ee3a06f4579184fa: function(arg0) {
247
- return arg0.value;
248
- },
249
- __wbg_warn_3cc416af27dbdc02: function(arg0) {
250
- console.warn(arg0);
251
- },
252
- __wbindgen_cast_0000000000000001: function(arg0) {
253
- return arg0;
254
- },
255
- __wbindgen_cast_0000000000000002: function(arg0) {
256
- return arg0;
257
- },
258
- __wbindgen_cast_0000000000000003: function(arg0, arg1) {
259
- return getStringFromWasm0(arg0, arg1);
260
- },
261
- __wbindgen_cast_0000000000000004: function(arg0) {
262
- return BigInt.asUintN(64, arg0);
263
- },
264
- __wbindgen_init_externref_table: function() {
265
- const table = wasm.__wbindgen_externrefs;
266
- const offset = table.grow(4);
267
- table.set(0, void 0);
268
- table.set(offset + 0, void 0);
269
- table.set(offset + 1, null);
270
- table.set(offset + 2, true);
271
- table.set(offset + 3, false);
272
- }
273
- };
274
- return {
275
- __proto__: null,
276
- "./shinkore_bg.js": import0
277
- };
278
- }
279
- const CompatEngineFinalization = typeof FinalizationRegistry === "undefined" ? {
280
- register: () => {},
281
- unregister: () => {}
282
- } : new FinalizationRegistry((ptr) => wasm.__wbg_compatengine_free(ptr >>> 0, 1));
283
- function addToExternrefTable0(obj) {
284
- const idx = wasm.__externref_table_alloc();
285
- wasm.__wbindgen_externrefs.set(idx, obj);
286
- return idx;
287
- }
288
- function debugString(val) {
289
- const type = typeof val;
290
- if (type == "number" || type == "boolean" || val == null) return `${val}`;
291
- if (type == "string") return `"${val}"`;
292
- if (type == "symbol") {
293
- const description = val.description;
294
- if (description == null) return "Symbol";
295
- else return `Symbol(${description})`;
296
- }
297
- if (type == "function") {
298
- const name = val.name;
299
- if (typeof name == "string" && name.length > 0) return `Function(${name})`;
300
- else return "Function";
301
- }
302
- if (Array.isArray(val)) {
303
- const length = val.length;
304
- let debug = "[";
305
- if (length > 0) debug += debugString(val[0]);
306
- for (let i = 1; i < length; i++) debug += ", " + debugString(val[i]);
307
- debug += "]";
308
- return debug;
309
- }
310
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
311
- let className;
312
- if (builtInMatches && builtInMatches.length > 1) className = builtInMatches[1];
313
- else return toString.call(val);
314
- if (className == "Object") try {
315
- return "Object(" + JSON.stringify(val) + ")";
316
- } catch (_) {
317
- return "Object";
318
- }
319
- if (val instanceof Error) return `${val.name}: ${val.message}\n${val.stack}`;
320
- return className;
321
- }
322
- function getArrayU8FromWasm0(ptr, len) {
323
- ptr = ptr >>> 0;
324
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
325
- }
326
- let cachedDataViewMemory0 = null;
327
- function getDataViewMemory0() {
328
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
329
- return cachedDataViewMemory0;
330
- }
331
- function getStringFromWasm0(ptr, len) {
332
- ptr = ptr >>> 0;
333
- return decodeText(ptr, len);
334
- }
335
- let cachedUint8ArrayMemory0 = null;
336
- function getUint8ArrayMemory0() {
337
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
338
- return cachedUint8ArrayMemory0;
339
- }
340
- function handleError(f, args) {
341
- try {
342
- return f.apply(this, args);
343
- } catch (e) {
344
- const idx = addToExternrefTable0(e);
345
- wasm.__wbindgen_exn_store(idx);
346
- }
347
- }
348
- function isLikeNone(x) {
349
- return x === void 0 || x === null;
350
- }
351
- function passStringToWasm0(arg, malloc, realloc) {
352
- if (realloc === void 0) {
353
- const buf = cachedTextEncoder.encode(arg);
354
- const ptr = malloc(buf.length, 1) >>> 0;
355
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
356
- WASM_VECTOR_LEN = buf.length;
357
- return ptr;
358
- }
359
- let len = arg.length;
360
- let ptr = malloc(len, 1) >>> 0;
361
- const mem = getUint8ArrayMemory0();
362
- let offset = 0;
363
- for (; offset < len; offset++) {
364
- const code = arg.charCodeAt(offset);
365
- if (code > 127) break;
366
- mem[ptr + offset] = code;
367
- }
368
- if (offset !== len) {
369
- if (offset !== 0) arg = arg.slice(offset);
370
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
371
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
372
- const ret = cachedTextEncoder.encodeInto(arg, view);
373
- offset += ret.written;
374
- ptr = realloc(ptr, len, offset, 1) >>> 0;
375
- }
376
- WASM_VECTOR_LEN = offset;
377
- return ptr;
378
- }
379
- function takeFromExternrefTable0(idx) {
380
- const value = wasm.__wbindgen_externrefs.get(idx);
381
- wasm.__externref_table_dealloc(idx);
382
- return value;
383
- }
384
- let cachedTextDecoder = new TextDecoder("utf-8", {
385
- ignoreBOM: true,
386
- fatal: true
387
- });
388
- cachedTextDecoder.decode();
389
- const MAX_SAFARI_DECODE_BYTES = 2146435072;
390
- let numBytesDecoded = 0;
391
- function decodeText(ptr, len) {
392
- numBytesDecoded += len;
393
- if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
394
- cachedTextDecoder = new TextDecoder("utf-8", {
395
- ignoreBOM: true,
396
- fatal: true
397
- });
398
- cachedTextDecoder.decode();
399
- numBytesDecoded = len;
400
- }
401
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
402
- }
403
- const cachedTextEncoder = new TextEncoder();
404
- if (!("encodeInto" in cachedTextEncoder)) cachedTextEncoder.encodeInto = function(arg, view) {
405
- const buf = cachedTextEncoder.encode(arg);
406
- view.set(buf);
407
- return {
408
- read: arg.length,
409
- written: buf.length
410
- };
411
- };
412
- let WASM_VECTOR_LEN = 0, wasm;
413
- function __wbg_finalize_init(instance, module) {
414
- wasm = instance.exports;
415
- cachedDataViewMemory0 = null;
416
- cachedUint8ArrayMemory0 = null;
417
- wasm.__wbindgen_start();
418
- return wasm;
419
- }
420
- async function __wbg_load(module, imports) {
421
- if (typeof Response === "function" && module instanceof Response) {
422
- if (typeof WebAssembly.instantiateStreaming === "function") try {
423
- return await WebAssembly.instantiateStreaming(module, imports);
424
- } catch (e) {
425
- if (module.ok && expectedResponseType(module.type) && module.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", e);
426
- else throw e;
427
- }
428
- const bytes = await module.arrayBuffer();
429
- return await WebAssembly.instantiate(bytes, imports);
430
- } else {
431
- const instance = await WebAssembly.instantiate(module, imports);
432
- if (instance instanceof WebAssembly.Instance) return {
433
- instance,
434
- module
435
- };
436
- else return instance;
437
- }
438
- function expectedResponseType(type) {
439
- switch (type) {
440
- case "basic":
441
- case "cors":
442
- case "default": return true;
443
- }
444
- return false;
445
- }
446
- }
447
- async function __wbg_init(module_or_path) {
448
- if (wasm !== void 0) return wasm;
449
- if (module_or_path !== void 0) if (Object.getPrototypeOf(module_or_path) === Object.prototype) ({module_or_path} = module_or_path);
450
- else console.warn("using deprecated parameters for the initialization function; pass a single object instead");
451
- if (module_or_path === void 0) module_or_path = new URL("shinkore_bg.wasm", {}.url);
452
- const imports = __wbg_get_imports();
453
- if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) module_or_path = fetch(module_or_path);
454
- const { instance, module } = await __wbg_load(await module_or_path, imports);
455
- return __wbg_finalize_init(instance, module);
456
- }
457
- //#endregion
458
- exports.CompatEngine = CompatEngine;
459
- exports.__wbg_init = __wbg_init;
1
+ //#region pkg/shinkore.js
2
+ /**
3
+ * The [`CompatEngine`] struct stores the compatibility data
4
+ * and acts as an entry-point for the Rust/WASM engine.
5
+ */
6
+ var CompatEngine = class {
7
+ __destroy_into_raw() {
8
+ const ptr = this.__wbg_ptr;
9
+ this.__wbg_ptr = 0;
10
+ CompatEngineFinalization.unregister(this);
11
+ return ptr;
12
+ }
13
+ free() {
14
+ const ptr = this.__destroy_into_raw();
15
+ wasm.__wbg_compatengine_free(ptr, 0);
16
+ }
17
+ /**
18
+ * Used for checking the compatibility of a single element and its attributes.
19
+ * @param {string} html
20
+ * @returns {any}
21
+ */
22
+ check_element(html) {
23
+ const ptr0 = passStringToWasm0(html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
24
+ const len0 = WASM_VECTOR_LEN;
25
+ const ret = wasm.compatengine_check_element(this.__wbg_ptr, ptr0, len0);
26
+ if (ret[2]) throw takeFromExternrefTable0(ret[1]);
27
+ return takeFromExternrefTable0(ret[0]);
28
+ }
29
+ /**
30
+ * Used for checking the compatibility of multiple elements and their attributes
31
+ *
32
+ * `depth_level` is used to control how far down in a nested HTML structure to go before
33
+ * returning element tags.
34
+ *
35
+ * See [`preprocess::pre_process_html`] to learn more about how `depth_level` works.
36
+ * @param {string} html
37
+ * @param {number} depth_level
38
+ * @returns {any}
39
+ */
40
+ check_elements(html, depth_level) {
41
+ const ptr0 = passStringToWasm0(html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
42
+ const len0 = WASM_VECTOR_LEN;
43
+ const ret = wasm.compatengine_check_elements(this.__wbg_ptr, ptr0, len0, depth_level);
44
+ if (ret[2]) throw takeFromExternrefTable0(ret[1]);
45
+ return takeFromExternrefTable0(ret[0]);
46
+ }
47
+ /**
48
+ * Used for performing a full page compatibility check.
49
+ * @param {string} html
50
+ * @returns {any}
51
+ */
52
+ full_inspect(html) {
53
+ const ptr0 = passStringToWasm0(html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
54
+ const len0 = WASM_VECTOR_LEN;
55
+ const ret = wasm.compatengine_full_inspect(this.__wbg_ptr, ptr0, len0);
56
+ if (ret[2]) throw takeFromExternrefTable0(ret[1]);
57
+ return takeFromExternrefTable0(ret[0]);
58
+ }
59
+ /**
60
+ * Constructs an new engine instance
61
+ * @param {any} bcd_html_data
62
+ * @param {any} bcd_svg_data
63
+ * @param {any} bcd_browser_data
64
+ * @param {any} ciu_usage_data
65
+ */
66
+ constructor(bcd_html_data, bcd_svg_data, bcd_browser_data, ciu_usage_data) {
67
+ const ret = wasm.compatengine_new(bcd_html_data, bcd_svg_data, bcd_browser_data, ciu_usage_data);
68
+ this.__wbg_ptr = ret >>> 0;
69
+ CompatEngineFinalization.register(this, this.__wbg_ptr, this);
70
+ return this;
71
+ }
72
+ };
73
+ if (Symbol.dispose) CompatEngine.prototype[Symbol.dispose] = CompatEngine.prototype.free;
74
+ function __wbg_get_imports() {
75
+ return {
76
+ __proto__: null,
77
+ "./shinkore_bg.js": {
78
+ __proto__: null,
79
+ __wbg_Error_960c155d3d49e4c2: function(arg0, arg1) {
80
+ return Error(getStringFromWasm0(arg0, arg1));
81
+ },
82
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
83
+ const ptr1 = passStringToWasm0(String(arg1), wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
84
+ const len1 = WASM_VECTOR_LEN;
85
+ getDataViewMemory0().setInt32(arg0 + 4, len1, true);
86
+ getDataViewMemory0().setInt32(arg0 + 0, ptr1, true);
87
+ },
88
+ __wbg___wbindgen_bigint_get_as_i64_3d3aba5d616c6a51: function(arg0, arg1) {
89
+ const v = arg1;
90
+ const ret = typeof v === "bigint" ? v : void 0;
91
+ getDataViewMemory0().setBigInt64(arg0 + 8, isLikeNone(ret) ? BigInt(0) : ret, true);
92
+ getDataViewMemory0().setInt32(arg0 + 0, !isLikeNone(ret), true);
93
+ },
94
+ __wbg___wbindgen_boolean_get_6ea149f0a8dcc5ff: function(arg0) {
95
+ const v = arg0;
96
+ const ret = typeof v === "boolean" ? v : void 0;
97
+ return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
98
+ },
99
+ __wbg___wbindgen_debug_string_ab4b34d23d6778bd: function(arg0, arg1) {
100
+ const ptr1 = passStringToWasm0(debugString(arg1), wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
101
+ const len1 = WASM_VECTOR_LEN;
102
+ getDataViewMemory0().setInt32(arg0 + 4, len1, true);
103
+ getDataViewMemory0().setInt32(arg0 + 0, ptr1, true);
104
+ },
105
+ __wbg___wbindgen_in_a5d8b22e52b24dd1: function(arg0, arg1) {
106
+ return arg0 in arg1;
107
+ },
108
+ __wbg___wbindgen_is_bigint_ec25c7f91b4d9e93: function(arg0) {
109
+ return typeof arg0 === "bigint";
110
+ },
111
+ __wbg___wbindgen_is_function_3baa9db1a987f47d: function(arg0) {
112
+ return typeof arg0 === "function";
113
+ },
114
+ __wbg___wbindgen_is_object_63322ec0cd6ea4ef: function(arg0) {
115
+ const val = arg0;
116
+ return typeof val === "object" && val !== null;
117
+ },
118
+ __wbg___wbindgen_is_string_6df3bf7ef1164ed3: function(arg0) {
119
+ return typeof arg0 === "string";
120
+ },
121
+ __wbg___wbindgen_is_undefined_29a43b4d42920abd: function(arg0) {
122
+ return arg0 === void 0;
123
+ },
124
+ __wbg___wbindgen_jsval_eq_d3465d8a07697228: function(arg0, arg1) {
125
+ return arg0 === arg1;
126
+ },
127
+ __wbg___wbindgen_jsval_loose_eq_cac3565e89b4134c: function(arg0, arg1) {
128
+ return arg0 == arg1;
129
+ },
130
+ __wbg___wbindgen_number_get_c7f42aed0525c451: function(arg0, arg1) {
131
+ const obj = arg1;
132
+ const ret = typeof obj === "number" ? obj : void 0;
133
+ getDataViewMemory0().setFloat64(arg0 + 8, isLikeNone(ret) ? 0 : ret, true);
134
+ getDataViewMemory0().setInt32(arg0 + 0, !isLikeNone(ret), true);
135
+ },
136
+ __wbg___wbindgen_string_get_7ed5322991caaec5: function(arg0, arg1) {
137
+ const obj = arg1;
138
+ const ret = typeof obj === "string" ? obj : void 0;
139
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
140
+ var len1 = WASM_VECTOR_LEN;
141
+ getDataViewMemory0().setInt32(arg0 + 4, len1, true);
142
+ getDataViewMemory0().setInt32(arg0 + 0, ptr1, true);
143
+ },
144
+ __wbg___wbindgen_throw_6b64449b9b9ed33c: function(arg0, arg1) {
145
+ throw new Error(getStringFromWasm0(arg0, arg1));
146
+ },
147
+ __wbg_call_14b169f759b26747: function() {
148
+ return handleError(function(arg0, arg1) {
149
+ return arg0.call(arg1);
150
+ }, arguments);
151
+ },
152
+ __wbg_done_9158f7cc8751ba32: function(arg0) {
153
+ return arg0.done;
154
+ },
155
+ __wbg_entries_e0b73aa8571ddb56: function(arg0) {
156
+ return Object.entries(arg0);
157
+ },
158
+ __wbg_error_2001591ad2463697: function(arg0) {
159
+ console.error(arg0);
160
+ },
161
+ __wbg_get_1affdbdd5573b16a: function() {
162
+ return handleError(function(arg0, arg1) {
163
+ return Reflect.get(arg0, arg1);
164
+ }, arguments);
165
+ },
166
+ __wbg_get_8360291721e2339f: function(arg0, arg1) {
167
+ return arg0[arg1 >>> 0];
168
+ },
169
+ __wbg_get_unchecked_17f53dad852b9588: function(arg0, arg1) {
170
+ return arg0[arg1 >>> 0];
171
+ },
172
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
173
+ return arg0[arg1];
174
+ },
175
+ __wbg_instanceof_ArrayBuffer_7c8433c6ed14ffe3: function(arg0) {
176
+ let result;
177
+ try {
178
+ result = arg0 instanceof ArrayBuffer;
179
+ } catch (_) {
180
+ result = false;
181
+ }
182
+ return result;
183
+ },
184
+ __wbg_instanceof_Map_1b76fd4635be43eb: function(arg0) {
185
+ let result;
186
+ try {
187
+ result = arg0 instanceof Map;
188
+ } catch (_) {
189
+ result = false;
190
+ }
191
+ return result;
192
+ },
193
+ __wbg_instanceof_Uint8Array_152ba1f289edcf3f: function(arg0) {
194
+ let result;
195
+ try {
196
+ result = arg0 instanceof Uint8Array;
197
+ } catch (_) {
198
+ result = false;
199
+ }
200
+ return result;
201
+ },
202
+ __wbg_isArray_c3109d14ffc06469: function(arg0) {
203
+ return Array.isArray(arg0);
204
+ },
205
+ __wbg_isSafeInteger_4fc213d1989d6d2a: function(arg0) {
206
+ return Number.isSafeInteger(arg0);
207
+ },
208
+ __wbg_iterator_013bc09ec998c2a7: function() {
209
+ return Symbol.iterator;
210
+ },
211
+ __wbg_length_3d4ecd04bd8d22f1: function(arg0) {
212
+ return arg0.length;
213
+ },
214
+ __wbg_length_9f1775224cf1d815: function(arg0) {
215
+ return arg0.length;
216
+ },
217
+ __wbg_new_0c7403db6e782f19: function(arg0) {
218
+ return new Uint8Array(arg0);
219
+ },
220
+ __wbg_new_34d45cc8e36aaead: function() {
221
+ return /* @__PURE__ */ new Map();
222
+ },
223
+ __wbg_new_682678e2f47e32bc: function() {
224
+ return new Array();
225
+ },
226
+ __wbg_new_aa8d0fa9762c29bd: function() {
227
+ return /* @__PURE__ */ new Object();
228
+ },
229
+ __wbg_next_0340c4ae324393c3: function() {
230
+ return handleError(function(arg0) {
231
+ return arg0.next();
232
+ }, arguments);
233
+ },
234
+ __wbg_next_7646edaa39458ef7: function(arg0) {
235
+ return arg0.next;
236
+ },
237
+ __wbg_prototypesetcall_a6b02eb00b0f4ce2: function(arg0, arg1, arg2) {
238
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
239
+ },
240
+ __wbg_set_3bf1de9fab0cd644: function(arg0, arg1, arg2) {
241
+ arg0[arg1 >>> 0] = arg2;
242
+ },
243
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
244
+ arg0[arg1] = arg2;
245
+ },
246
+ __wbg_set_fde2cec06c23692b: function(arg0, arg1, arg2) {
247
+ return arg0.set(arg1, arg2);
248
+ },
249
+ __wbg_value_ee3a06f4579184fa: function(arg0) {
250
+ return arg0.value;
251
+ },
252
+ __wbg_warn_3cc416af27dbdc02: function(arg0) {
253
+ console.warn(arg0);
254
+ },
255
+ __wbindgen_cast_0000000000000001: function(arg0) {
256
+ return arg0;
257
+ },
258
+ __wbindgen_cast_0000000000000002: function(arg0) {
259
+ return arg0;
260
+ },
261
+ __wbindgen_cast_0000000000000003: function(arg0, arg1) {
262
+ return getStringFromWasm0(arg0, arg1);
263
+ },
264
+ __wbindgen_cast_0000000000000004: function(arg0) {
265
+ return BigInt.asUintN(64, arg0);
266
+ },
267
+ __wbindgen_init_externref_table: function() {
268
+ const table = wasm.__wbindgen_externrefs;
269
+ const offset = table.grow(4);
270
+ table.set(0, void 0);
271
+ table.set(offset + 0, void 0);
272
+ table.set(offset + 1, null);
273
+ table.set(offset + 2, true);
274
+ table.set(offset + 3, false);
275
+ }
276
+ }
277
+ };
278
+ }
279
+ const CompatEngineFinalization = typeof FinalizationRegistry === "undefined" ? {
280
+ register: () => {},
281
+ unregister: () => {}
282
+ } : new FinalizationRegistry((ptr) => wasm.__wbg_compatengine_free(ptr >>> 0, 1));
283
+ function addToExternrefTable0(obj) {
284
+ const idx = wasm.__externref_table_alloc();
285
+ wasm.__wbindgen_externrefs.set(idx, obj);
286
+ return idx;
287
+ }
288
+ function debugString(val) {
289
+ const type = typeof val;
290
+ if (type == "number" || type == "boolean" || val == null) return `${val}`;
291
+ if (type == "string") return `"${val}"`;
292
+ if (type == "symbol") {
293
+ const description = val.description;
294
+ if (description == null) return "Symbol";
295
+ else return `Symbol(${description})`;
296
+ }
297
+ if (type == "function") {
298
+ const name = val.name;
299
+ if (typeof name == "string" && name.length > 0) return `Function(${name})`;
300
+ else return "Function";
301
+ }
302
+ if (Array.isArray(val)) {
303
+ const length = val.length;
304
+ let debug = "[";
305
+ if (length > 0) debug += debugString(val[0]);
306
+ for (let i = 1; i < length; i++) debug += ", " + debugString(val[i]);
307
+ debug += "]";
308
+ return debug;
309
+ }
310
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
311
+ let className;
312
+ if (builtInMatches && builtInMatches.length > 1) className = builtInMatches[1];
313
+ else return toString.call(val);
314
+ if (className == "Object") try {
315
+ return "Object(" + JSON.stringify(val) + ")";
316
+ } catch (_) {
317
+ return "Object";
318
+ }
319
+ if (val instanceof Error) return `${val.name}: ${val.message}\n${val.stack}`;
320
+ return className;
321
+ }
322
+ function getArrayU8FromWasm0(ptr, len) {
323
+ ptr = ptr >>> 0;
324
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
325
+ }
326
+ let cachedDataViewMemory0 = null;
327
+ function getDataViewMemory0() {
328
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
329
+ return cachedDataViewMemory0;
330
+ }
331
+ function getStringFromWasm0(ptr, len) {
332
+ ptr = ptr >>> 0;
333
+ return decodeText(ptr, len);
334
+ }
335
+ let cachedUint8ArrayMemory0 = null;
336
+ function getUint8ArrayMemory0() {
337
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
338
+ return cachedUint8ArrayMemory0;
339
+ }
340
+ function handleError(f, args) {
341
+ try {
342
+ return f.apply(this, args);
343
+ } catch (e) {
344
+ const idx = addToExternrefTable0(e);
345
+ wasm.__wbindgen_exn_store(idx);
346
+ }
347
+ }
348
+ function isLikeNone(x) {
349
+ return x === void 0 || x === null;
350
+ }
351
+ function passStringToWasm0(arg, malloc, realloc) {
352
+ if (realloc === void 0) {
353
+ const buf = cachedTextEncoder.encode(arg);
354
+ const ptr = malloc(buf.length, 1) >>> 0;
355
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
356
+ WASM_VECTOR_LEN = buf.length;
357
+ return ptr;
358
+ }
359
+ let len = arg.length;
360
+ let ptr = malloc(len, 1) >>> 0;
361
+ const mem = getUint8ArrayMemory0();
362
+ let offset = 0;
363
+ for (; offset < len; offset++) {
364
+ const code = arg.charCodeAt(offset);
365
+ if (code > 127) break;
366
+ mem[ptr + offset] = code;
367
+ }
368
+ if (offset !== len) {
369
+ if (offset !== 0) arg = arg.slice(offset);
370
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
371
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
372
+ const ret = cachedTextEncoder.encodeInto(arg, view);
373
+ offset += ret.written;
374
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
375
+ }
376
+ WASM_VECTOR_LEN = offset;
377
+ return ptr;
378
+ }
379
+ function takeFromExternrefTable0(idx) {
380
+ const value = wasm.__wbindgen_externrefs.get(idx);
381
+ wasm.__externref_table_dealloc(idx);
382
+ return value;
383
+ }
384
+ let cachedTextDecoder = new TextDecoder("utf-8", {
385
+ ignoreBOM: true,
386
+ fatal: true
387
+ });
388
+ cachedTextDecoder.decode();
389
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
390
+ let numBytesDecoded = 0;
391
+ function decodeText(ptr, len) {
392
+ numBytesDecoded += len;
393
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
394
+ cachedTextDecoder = new TextDecoder("utf-8", {
395
+ ignoreBOM: true,
396
+ fatal: true
397
+ });
398
+ cachedTextDecoder.decode();
399
+ numBytesDecoded = len;
400
+ }
401
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
402
+ }
403
+ const cachedTextEncoder = new TextEncoder();
404
+ if (!("encodeInto" in cachedTextEncoder)) cachedTextEncoder.encodeInto = function(arg, view) {
405
+ const buf = cachedTextEncoder.encode(arg);
406
+ view.set(buf);
407
+ return {
408
+ read: arg.length,
409
+ written: buf.length
410
+ };
411
+ };
412
+ let WASM_VECTOR_LEN = 0, wasm;
413
+ function __wbg_finalize_init(instance, module) {
414
+ wasm = instance.exports;
415
+ cachedDataViewMemory0 = null;
416
+ cachedUint8ArrayMemory0 = null;
417
+ wasm.__wbindgen_start();
418
+ return wasm;
419
+ }
420
+ async function __wbg_load(module, imports) {
421
+ if (typeof Response === "function" && module instanceof Response) {
422
+ if (typeof WebAssembly.instantiateStreaming === "function") try {
423
+ return await WebAssembly.instantiateStreaming(module, imports);
424
+ } catch (e) {
425
+ if (module.ok && expectedResponseType(module.type) && module.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", e);
426
+ else throw e;
427
+ }
428
+ const bytes = await module.arrayBuffer();
429
+ return await WebAssembly.instantiate(bytes, imports);
430
+ } else {
431
+ const instance = await WebAssembly.instantiate(module, imports);
432
+ if (instance instanceof WebAssembly.Instance) return {
433
+ instance,
434
+ module
435
+ };
436
+ else return instance;
437
+ }
438
+ function expectedResponseType(type) {
439
+ switch (type) {
440
+ case "basic":
441
+ case "cors":
442
+ case "default": return true;
443
+ }
444
+ return false;
445
+ }
446
+ }
447
+ async function __wbg_init(module_or_path) {
448
+ if (wasm !== void 0) return wasm;
449
+ if (module_or_path !== void 0) if (Object.getPrototypeOf(module_or_path) === Object.prototype) ({module_or_path} = module_or_path);
450
+ else console.warn("using deprecated parameters for the initialization function; pass a single object instead");
451
+ if (module_or_path === void 0) module_or_path = new URL("shinkore_bg.wasm", {}.url);
452
+ const imports = __wbg_get_imports();
453
+ if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) module_or_path = fetch(module_or_path);
454
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
455
+ return __wbg_finalize_init(instance, module);
456
+ }
457
+ //#endregion
458
+ exports.CompatEngine = CompatEngine;
459
+ exports.__wbg_init = __wbg_init;