@labpics/colors 0.10.0 → 1.0.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.
package/pkg/labcolors.js CHANGED
@@ -1,196 +1,713 @@
1
1
  /* @ts-self-types="./labcolors.d.ts" */
2
+ import { bindingFailure, certificateError, certificateProjection, programError, programFailure } from './snippets/labcolors-wasm-9fb8b927594c3d6f/inline0.js';
2
3
 
3
- /**
4
- * A contrast engine over a consumer-supplied design system. Construct with
5
- * [`LabColors::new`], load a config with [`loadConfig`](LabColors::load_config),
6
- * then call [`resolve_theme`](LabColors::resolve_theme) many times; identical
7
- * calls are served from the contract cache.
8
- */
9
- export class LabColors {
4
+
5
+ export class AttachedMaterializationAuthority {
6
+ static __wrap(ptr) {
7
+ const obj = Object.create(AttachedMaterializationAuthority.prototype);
8
+ obj.__wbg_ptr = ptr;
9
+ AttachedMaterializationAuthorityFinalization.register(obj, obj.__wbg_ptr, obj);
10
+ return obj;
11
+ }
12
+ __destroy_into_raw() {
13
+ const ptr = this.__wbg_ptr;
14
+ this.__wbg_ptr = 0;
15
+ AttachedMaterializationAuthorityFinalization.unregister(this);
16
+ return ptr;
17
+ }
18
+ free() {
19
+ const ptr = this.__destroy_into_raw();
20
+ wasm.__wbg_attachedmaterializationauthority_free(ptr, 0);
21
+ }
22
+ /**
23
+ * @returns {bigint}
24
+ */
25
+ bindingEpoch() {
26
+ const ret = wasm.attachedmaterializationauthority_bindingEpoch(this.__wbg_ptr);
27
+ return BigInt.asUintN(64, ret);
28
+ }
29
+ /**
30
+ * @returns {Uint8Array}
31
+ */
32
+ contentIdentity() {
33
+ try {
34
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
35
+ wasm.attachedmaterializationauthority_contentIdentity(retptr, this.__wbg_ptr);
36
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
37
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
38
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
39
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
40
+ return v1;
41
+ } finally {
42
+ wasm.__wbindgen_add_to_stack_pointer(16);
43
+ }
44
+ }
45
+ /**
46
+ * @returns {Uint8Array}
47
+ */
48
+ contextIdentity() {
49
+ try {
50
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
51
+ wasm.attachedmaterializationauthority_contextIdentity(retptr, this.__wbg_ptr);
52
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
53
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
54
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
55
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
56
+ return v1;
57
+ } finally {
58
+ wasm.__wbindgen_add_to_stack_pointer(16);
59
+ }
60
+ }
61
+ /**
62
+ * @returns {number}
63
+ */
64
+ occurrence() {
65
+ const ret = wasm.attachedmaterializationauthority_occurrence(this.__wbg_ptr);
66
+ return ret >>> 0;
67
+ }
68
+ /**
69
+ * @returns {number}
70
+ */
71
+ outputOpacity() {
72
+ const ret = wasm.attachedmaterializationauthority_outputOpacity(this.__wbg_ptr);
73
+ return ret;
74
+ }
75
+ /**
76
+ * @returns {Uint8Array}
77
+ */
78
+ outputRgb() {
79
+ try {
80
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
81
+ wasm.attachedmaterializationauthority_outputRgb(retptr, this.__wbg_ptr);
82
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
83
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
84
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
85
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
86
+ return v1;
87
+ } finally {
88
+ wasm.__wbindgen_add_to_stack_pointer(16);
89
+ }
90
+ }
91
+ /**
92
+ * @returns {number}
93
+ */
94
+ outputSlot() {
95
+ const ret = wasm.attachedmaterializationauthority_outputSlot(this.__wbg_ptr);
96
+ return ret >>> 0;
97
+ }
98
+ /**
99
+ * @returns {string}
100
+ */
101
+ physicalIdentity() {
102
+ let deferred1_0;
103
+ let deferred1_1;
104
+ try {
105
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
106
+ wasm.attachedmaterializationauthority_physicalIdentity(retptr, this.__wbg_ptr);
107
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
108
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
109
+ deferred1_0 = r0;
110
+ deferred1_1 = r1;
111
+ return getStringFromWasm0(r0, r1);
112
+ } finally {
113
+ wasm.__wbindgen_add_to_stack_pointer(16);
114
+ wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
115
+ }
116
+ }
117
+ /**
118
+ * @returns {number}
119
+ */
120
+ presentationRoot() {
121
+ const ret = wasm.attachedmaterializationauthority_presentationRoot(this.__wbg_ptr);
122
+ return ret >>> 0;
123
+ }
124
+ /**
125
+ * @returns {string}
126
+ */
127
+ rendererProvenance() {
128
+ let deferred1_0;
129
+ let deferred1_1;
130
+ try {
131
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
132
+ wasm.attachedmaterializationauthority_rendererProvenance(retptr, this.__wbg_ptr);
133
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
134
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
135
+ deferred1_0 = r0;
136
+ deferred1_1 = r1;
137
+ return getStringFromWasm0(r0, r1);
138
+ } finally {
139
+ wasm.__wbindgen_add_to_stack_pointer(16);
140
+ wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
141
+ }
142
+ }
143
+ /**
144
+ * @returns {bigint}
145
+ */
146
+ revision() {
147
+ const ret = wasm.attachedmaterializationauthority_revision(this.__wbg_ptr);
148
+ return BigInt.asUintN(64, ret);
149
+ }
150
+ /**
151
+ * @returns {bigint}
152
+ */
153
+ sinkSequence() {
154
+ const ret = wasm.attachedmaterializationauthority_sinkSequence(this.__wbg_ptr);
155
+ return BigInt.asUintN(64, ret);
156
+ }
157
+ /**
158
+ * @returns {Uint8Array}
159
+ */
160
+ terminalCompositeRgb() {
161
+ try {
162
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
163
+ wasm.attachedmaterializationauthority_terminalCompositeRgb(retptr, this.__wbg_ptr);
164
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
165
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
166
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
167
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
168
+ return v1;
169
+ } finally {
170
+ wasm.__wbindgen_add_to_stack_pointer(16);
171
+ }
172
+ }
173
+ }
174
+ if (Symbol.dispose) AttachedMaterializationAuthority.prototype[Symbol.dispose] = AttachedMaterializationAuthority.prototype.free;
175
+
176
+ export class ProgramAttachedRender {
177
+ static __wrap(ptr) {
178
+ const obj = Object.create(ProgramAttachedRender.prototype);
179
+ obj.__wbg_ptr = ptr;
180
+ ProgramAttachedRenderFinalization.register(obj, obj.__wbg_ptr, obj);
181
+ return obj;
182
+ }
183
+ __destroy_into_raw() {
184
+ const ptr = this.__wbg_ptr;
185
+ this.__wbg_ptr = 0;
186
+ ProgramAttachedRenderFinalization.unregister(this);
187
+ return ptr;
188
+ }
189
+ free() {
190
+ const ptr = this.__destroy_into_raw();
191
+ wasm.__wbg_programattachedrender_free(ptr, 0);
192
+ }
193
+ /**
194
+ * @returns {bigint}
195
+ */
196
+ bindingEpoch() {
197
+ const ret = wasm.programattachedrender_bindingEpoch(this.__wbg_ptr);
198
+ return BigInt.asUintN(64, ret);
199
+ }
200
+ /**
201
+ * @returns {Uint8Array}
202
+ */
203
+ contentIdentity() {
204
+ try {
205
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
206
+ wasm.programattachedrender_contentIdentity(retptr, this.__wbg_ptr);
207
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
208
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
209
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
210
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
211
+ return v1;
212
+ } finally {
213
+ wasm.__wbindgen_add_to_stack_pointer(16);
214
+ }
215
+ }
216
+ /**
217
+ * @returns {Uint8Array}
218
+ */
219
+ contextIdentity() {
220
+ try {
221
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
222
+ wasm.programattachedrender_contextIdentity(retptr, this.__wbg_ptr);
223
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
224
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
225
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
226
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
227
+ return v1;
228
+ } finally {
229
+ wasm.__wbindgen_add_to_stack_pointer(16);
230
+ }
231
+ }
232
+ /**
233
+ * @returns {number}
234
+ */
235
+ occurrence() {
236
+ const ret = wasm.programattachedrender_occurrence(this.__wbg_ptr);
237
+ return ret >>> 0;
238
+ }
239
+ /**
240
+ * @returns {number}
241
+ */
242
+ outputOpacity() {
243
+ const ret = wasm.programattachedrender_outputOpacity(this.__wbg_ptr);
244
+ return ret;
245
+ }
246
+ /**
247
+ * @returns {Uint8Array}
248
+ */
249
+ outputRgb() {
250
+ try {
251
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
252
+ wasm.programattachedrender_outputRgb(retptr, this.__wbg_ptr);
253
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
254
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
255
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
256
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
257
+ return v1;
258
+ } finally {
259
+ wasm.__wbindgen_add_to_stack_pointer(16);
260
+ }
261
+ }
262
+ /**
263
+ * @returns {number}
264
+ */
265
+ outputSlot() {
266
+ const ret = wasm.programattachedrender_outputSlot(this.__wbg_ptr);
267
+ return ret >>> 0;
268
+ }
269
+ /**
270
+ * @returns {string}
271
+ */
272
+ physicalIdentity() {
273
+ let deferred1_0;
274
+ let deferred1_1;
275
+ try {
276
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
277
+ wasm.programattachedrender_physicalIdentity(retptr, this.__wbg_ptr);
278
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
279
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
280
+ deferred1_0 = r0;
281
+ deferred1_1 = r1;
282
+ return getStringFromWasm0(r0, r1);
283
+ } finally {
284
+ wasm.__wbindgen_add_to_stack_pointer(16);
285
+ wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
286
+ }
287
+ }
288
+ /**
289
+ * @returns {number}
290
+ */
291
+ presentationRoot() {
292
+ const ret = wasm.programattachedrender_presentationRoot(this.__wbg_ptr);
293
+ return ret >>> 0;
294
+ }
295
+ /**
296
+ * @returns {bigint}
297
+ */
298
+ revision() {
299
+ const ret = wasm.programattachedrender_revision(this.__wbg_ptr);
300
+ return BigInt.asUintN(64, ret);
301
+ }
302
+ /**
303
+ * @returns {number}
304
+ */
305
+ sinkOutput() {
306
+ const ret = wasm.programattachedrender_sinkOutput(this.__wbg_ptr);
307
+ return ret >>> 0;
308
+ }
309
+ /**
310
+ * @returns {bigint}
311
+ */
312
+ sinkSequence() {
313
+ const ret = wasm.programattachedrender_sinkSequence(this.__wbg_ptr);
314
+ return BigInt.asUintN(64, ret);
315
+ }
316
+ /**
317
+ * @returns {Uint8Array | undefined}
318
+ */
319
+ terminalCompositeRgb() {
320
+ try {
321
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
322
+ wasm.programattachedrender_terminalCompositeRgb(retptr, this.__wbg_ptr);
323
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
324
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
325
+ let v1;
326
+ if (r0 !== 0) {
327
+ v1 = getArrayU8FromWasm0(r0, r1).slice();
328
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
329
+ }
330
+ return v1;
331
+ } finally {
332
+ wasm.__wbindgen_add_to_stack_pointer(16);
333
+ }
334
+ }
335
+ }
336
+ if (Symbol.dispose) ProgramAttachedRender.prototype[Symbol.dispose] = ProgramAttachedRender.prototype.free;
337
+
338
+ export class ProgramAttachedSnapshot {
339
+ static __wrap(ptr) {
340
+ const obj = Object.create(ProgramAttachedSnapshot.prototype);
341
+ obj.__wbg_ptr = ptr;
342
+ ProgramAttachedSnapshotFinalization.register(obj, obj.__wbg_ptr, obj);
343
+ return obj;
344
+ }
10
345
  __destroy_into_raw() {
11
346
  const ptr = this.__wbg_ptr;
12
347
  this.__wbg_ptr = 0;
13
- LabColorsFinalization.unregister(this);
348
+ ProgramAttachedSnapshotFinalization.unregister(this);
14
349
  return ptr;
15
350
  }
16
351
  free() {
17
352
  const ptr = this.__destroy_into_raw();
18
- wasm.__wbg_labcolors_free(ptr, 0);
353
+ wasm.__wbg_programattachedsnapshot_free(ptr, 0);
19
354
  }
20
355
  /**
21
- * Exact stable-Glow runtime recheck. Returns whether the point screen
22
- * layer is a byte-for-byte no-op for every alpha under encoded sRGB8.
23
- * `adaptTheme` uses this cheap core-owned predicate to detect the only
24
- * stable determinate/indeterminate class transition without running CAM16
25
- * or re-solving on every animated-background frame.
26
- * @param {string} tint_hex
27
- * @param {string} bg_hex
28
356
  * @returns {boolean}
29
357
  */
30
- isStableGlowPointNoop(tint_hex, bg_hex) {
358
+ hasRender() {
359
+ const ret = wasm.programattachedsnapshot_hasRender(this.__wbg_ptr);
360
+ return ret !== 0;
361
+ }
362
+ /**
363
+ * @returns {number}
364
+ */
365
+ outputCount() {
366
+ const ret = wasm.programattachedsnapshot_outputCount(this.__wbg_ptr);
367
+ return ret >>> 0;
368
+ }
369
+ /**
370
+ * @param {number} index
371
+ * @returns {number}
372
+ */
373
+ outputOpacity(index) {
31
374
  try {
32
375
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
33
- const ptr0 = passStringToWasm0(tint_hex, wasm.__wbindgen_export, wasm.__wbindgen_export2);
34
- const len0 = WASM_VECTOR_LEN;
35
- const ptr1 = passStringToWasm0(bg_hex, wasm.__wbindgen_export, wasm.__wbindgen_export2);
36
- const len1 = WASM_VECTOR_LEN;
37
- wasm.labcolors_isStableGlowPointNoop(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
376
+ wasm.programattachedsnapshot_outputOpacity(retptr, this.__wbg_ptr, addHeapObject(index));
377
+ var r0 = getDataViewMemory0().getFloat64(retptr + 8 * 0, true);
378
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
379
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
380
+ if (r3) {
381
+ throw takeObject(r2);
382
+ }
383
+ return r0;
384
+ } finally {
385
+ wasm.__wbindgen_add_to_stack_pointer(16);
386
+ }
387
+ }
388
+ /**
389
+ * @param {number} index
390
+ * @returns {Uint8Array}
391
+ */
392
+ outputRgb(index) {
393
+ try {
394
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
395
+ wasm.programattachedsnapshot_outputRgb(retptr, this.__wbg_ptr, addHeapObject(index));
396
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
397
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
398
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
399
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
400
+ if (r3) {
401
+ throw takeObject(r2);
402
+ }
403
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
404
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
405
+ return v1;
406
+ } finally {
407
+ wasm.__wbindgen_add_to_stack_pointer(16);
408
+ }
409
+ }
410
+ /**
411
+ * @param {number} index
412
+ * @returns {number}
413
+ */
414
+ outputSlot(index) {
415
+ try {
416
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
417
+ wasm.programattachedsnapshot_outputSlot(retptr, this.__wbg_ptr, addHeapObject(index));
38
418
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
39
419
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
40
420
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
41
421
  if (r2) {
42
422
  throw takeObject(r1);
43
423
  }
44
- return r0 !== 0;
424
+ return r0 >>> 0;
45
425
  } finally {
46
426
  wasm.__wbindgen_add_to_stack_pointer(16);
47
427
  }
48
428
  }
49
429
  /**
50
- * Загрузить конфиг дизайн-системы (JSON по типу `ThemeConfig` из `.d.ts`).
51
- *
52
- * Полный preflight движка: невалидный конфиг отклоняется структурной
53
- * ошибкой `invalid_config: …` и НЕ меняет состояние. После успешной
54
- * загрузки `resolveTheme` эмитит роли конфига (включая полупрозрачные
55
- * роли лестницы — эмиссия `oklch(L% C H / α)`). Возвращает отпечаток
56
- * конфига — 16 hex-символов;
57
- * разные конфиги дают разные отпечатки (и разные кэш-пространства).
58
- * @param {string} json
430
+ * @returns {ProgramAttachedRender | undefined}
431
+ */
432
+ render() {
433
+ const ret = wasm.programattachedsnapshot_render(this.__wbg_ptr);
434
+ return ret === 0 ? undefined : ProgramAttachedRender.__wrap(ret);
435
+ }
436
+ /**
59
437
  * @returns {string}
60
438
  */
61
- loadConfig(json) {
62
- let deferred3_0;
63
- let deferred3_1;
439
+ get state() {
440
+ let deferred1_0;
441
+ let deferred1_1;
64
442
  try {
65
443
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
66
- const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
444
+ wasm.programattachedsnapshot_state(retptr, this.__wbg_ptr);
445
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
446
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
447
+ deferred1_0 = r0;
448
+ deferred1_1 = r1;
449
+ return getStringFromWasm0(r0, r1);
450
+ } finally {
451
+ wasm.__wbindgen_add_to_stack_pointer(16);
452
+ wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
453
+ }
454
+ }
455
+ }
456
+ if (Symbol.dispose) ProgramAttachedSnapshot.prototype[Symbol.dispose] = ProgramAttachedSnapshot.prototype.free;
457
+
458
+ export class ProgramAttachment {
459
+ static __wrap(ptr) {
460
+ const obj = Object.create(ProgramAttachment.prototype);
461
+ obj.__wbg_ptr = ptr;
462
+ ProgramAttachmentFinalization.register(obj, obj.__wbg_ptr, obj);
463
+ return obj;
464
+ }
465
+ __destroy_into_raw() {
466
+ const ptr = this.__wbg_ptr;
467
+ this.__wbg_ptr = 0;
468
+ ProgramAttachmentFinalization.unregister(this);
469
+ return ptr;
470
+ }
471
+ free() {
472
+ const ptr = this.__destroy_into_raw();
473
+ wasm.__wbg_programattachment_free(ptr, 0);
474
+ }
475
+ /**
476
+ * Потребляет attachment только после подтверждения внешнего revoke caller-ом.
477
+ * @param {boolean} confirmed
478
+ */
479
+ dispose(confirmed) {
480
+ try {
481
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
482
+ wasm.programattachment_dispose(retptr, this.__wbg_ptr, addHeapObject(confirmed));
483
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
484
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
485
+ if (r1) {
486
+ throw takeObject(r0);
487
+ }
488
+ } finally {
489
+ wasm.__wbindgen_add_to_stack_pointer(16);
490
+ }
491
+ }
492
+ /**
493
+ * Допускает authority только из текущего committed head attachment.
494
+ * @returns {AttachedMaterializationAuthority}
495
+ */
496
+ materializationAuthority() {
497
+ try {
498
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
499
+ wasm.programattachment_materializationAuthority(retptr, this.__wbg_ptr);
500
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
501
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
502
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
503
+ if (r2) {
504
+ throw takeObject(r1);
505
+ }
506
+ return AttachedMaterializationAuthority.__wrap(r0);
507
+ } finally {
508
+ wasm.__wbindgen_add_to_stack_pointer(16);
509
+ }
510
+ }
511
+ /**
512
+ * Проверяет переданные caller-ом revision, identity и epoch против current head.
513
+ * @param {bigint} revision
514
+ * @param {Uint8Array} content_identity
515
+ * @param {bigint} binding_epoch
516
+ * @returns {AttachedMaterializationAuthority}
517
+ */
518
+ materializationAuthorityFor(revision, content_identity, binding_epoch) {
519
+ try {
520
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
521
+ const ptr0 = passArray8ToWasm0(content_identity, wasm.__wbindgen_export2);
67
522
  const len0 = WASM_VECTOR_LEN;
68
- wasm.labcolors_loadConfig(retptr, this.__wbg_ptr, ptr0, len0);
523
+ wasm.programattachment_materializationAuthorityFor(retptr, this.__wbg_ptr, addHeapObject(revision), ptr0, len0, addHeapObject(binding_epoch));
69
524
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
70
525
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
71
526
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
72
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
73
- var ptr2 = r0;
74
- var len2 = r1;
75
- if (r3) {
76
- ptr2 = 0; len2 = 0;
77
- throw takeObject(r2);
527
+ if (r2) {
528
+ throw takeObject(r1);
78
529
  }
79
- deferred3_0 = ptr2;
80
- deferred3_1 = len2;
81
- return getStringFromWasm0(ptr2, len2);
530
+ return AttachedMaterializationAuthority.__wrap(r0);
82
531
  } finally {
83
532
  wasm.__wbindgen_add_to_stack_pointer(16);
84
- wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
85
533
  }
86
534
  }
87
535
  /**
88
- * Return the frozen legacy `muddiness` coordinate for an sRGB hex colour.
89
- *
90
- * This is an experimental compatibility proxy: it reproduces the historic
91
- * numeric API, but is not an observer-validated human clean/dirty verdict
92
- * or a production decision. The legacy identifier is retained only for
93
- * compatibility.
94
- * @param {string} hex
95
- * @returns {number}
536
+ * Атомарно применяет observed revision через host sink.
537
+ * @param {bigint} revision
538
+ * @param {Uint32Array} scenario_ids
539
+ * @param {Uint8Array} surfaces
540
+ * @param {number} surface_count
541
+ * @returns {ProgramAttachedSnapshot}
96
542
  */
97
- muddiness(hex) {
543
+ updateObserved(revision, scenario_ids, surfaces, surface_count) {
98
544
  try {
99
545
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
100
- const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_export, wasm.__wbindgen_export2);
546
+ const ptr0 = passArray32ToWasm0(scenario_ids, wasm.__wbindgen_export2);
101
547
  const len0 = WASM_VECTOR_LEN;
102
- wasm.labcolors_muddiness(retptr, this.__wbg_ptr, ptr0, len0);
103
- var r0 = getDataViewMemory0().getFloat64(retptr + 8 * 0, true);
548
+ const ptr1 = passArray8ToWasm0(surfaces, wasm.__wbindgen_export2);
549
+ const len1 = WASM_VECTOR_LEN;
550
+ wasm.programattachment_updateObserved(retptr, this.__wbg_ptr, addHeapObject(revision), ptr0, len0, ptr1, len1, addHeapObject(surface_count));
551
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
552
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
104
553
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
105
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
106
- if (r3) {
107
- throw takeObject(r2);
554
+ if (r2) {
555
+ throw takeObject(r1);
108
556
  }
109
- return r0;
557
+ return ProgramAttachedSnapshot.__wrap(r0);
110
558
  } finally {
111
559
  wasm.__wbindgen_add_to_stack_pointer(16);
112
560
  }
113
561
  }
114
562
  /**
115
- * Create an engine with no design system loaded.
116
- *
117
- * The engine is agnostic (ADR-0001): it carries no built-in role table, so
118
- * [`resolveTheme`](LabColors::resolve_theme) rejects with `config_required`
119
- * until [`loadConfig`](LabColors::load_config) supplies a design system.
120
- */
121
- constructor() {
122
- const ret = wasm.labcolors_new();
123
- this.__wbg_ptr = ret;
124
- LabColorsFinalization.register(this, this.__wbg_ptr, this);
125
- return this;
126
- }
127
- /**
128
- * Recheck the contrasts `fgHexes` achieve against `bgHex` under `theme` —
129
- * the cheap per-frame primitive a reactive runtime uses to decide whether
130
- * already-resolved colours still pass against a changed background (re-solve
131
- * only when they stably do not). No full solve: one perceptual-model forward
132
- * for the background plus one per foreground.
133
- *
134
- * Returns a `Float64Array` of `[lc, wcagRatio]` pairs, interleaved and in the
135
- * order of `fgHexes`: index `2*i` is foreground `i`'s signed `Lc`, `2*i+1`
136
- * its WCAG ratio. Rejects (structured `{code, message}`) on an invalid hex or
137
- * an unknown theme.
138
- * @param {string} bg_hex
139
- * @param {string[]} fg_hexes
140
- * @param {string} theme
141
- * @returns {Float64Array}
142
- */
143
- recheckContrast(bg_hex, fg_hexes, theme) {
563
+ * Атомарно отзывает owned sink для недоступной revision.
564
+ * @param {bigint} revision
565
+ * @param {number} reason_id
566
+ * @returns {ProgramAttachedSnapshot}
567
+ */
568
+ updateUnknown(revision, reason_id) {
569
+ try {
570
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
571
+ wasm.programattachment_updateUnknown(retptr, this.__wbg_ptr, addHeapObject(revision), addHeapObject(reason_id));
572
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
573
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
574
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
575
+ if (r2) {
576
+ throw takeObject(r1);
577
+ }
578
+ return ProgramAttachedSnapshot.__wrap(r0);
579
+ } finally {
580
+ wasm.__wbindgen_add_to_stack_pointer(16);
581
+ }
582
+ }
583
+ }
584
+ if (Symbol.dispose) ProgramAttachment.prototype[Symbol.dispose] = ProgramAttachment.prototype.free;
585
+
586
+ /**
587
+ * Публичный runtime одного скомпилированного Program.
588
+ */
589
+ export class ProgramRuntime {
590
+ static __wrap(ptr) {
591
+ const obj = Object.create(ProgramRuntime.prototype);
592
+ obj.__wbg_ptr = ptr;
593
+ ProgramRuntimeFinalization.register(obj, obj.__wbg_ptr, obj);
594
+ return obj;
595
+ }
596
+ __destroy_into_raw() {
597
+ const ptr = this.__wbg_ptr;
598
+ this.__wbg_ptr = 0;
599
+ ProgramRuntimeFinalization.unregister(this);
600
+ return ptr;
601
+ }
602
+ free() {
603
+ const ptr = this.__destroy_into_raw();
604
+ wasm.__wbg_programruntime_free(ptr, 0);
605
+ }
606
+ /**
607
+ * Атомарный observed update. `surfaces` — row-major
608
+ * `scenario_ids.len() × surface_count × 3` bytes.
609
+ * @param {bigint} revision
610
+ * @param {Uint32Array} scenario_ids
611
+ * @param {Uint8Array} surfaces
612
+ * @param {number} surface_count
613
+ * @returns {ProgramSnapshot}
614
+ */
615
+ updateObserved(revision, scenario_ids, surfaces, surface_count) {
144
616
  try {
145
617
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
146
- const ptr0 = passStringToWasm0(bg_hex, wasm.__wbindgen_export, wasm.__wbindgen_export2);
618
+ const ptr0 = passArray32ToWasm0(scenario_ids, wasm.__wbindgen_export2);
147
619
  const len0 = WASM_VECTOR_LEN;
148
- const ptr1 = passArrayJsValueToWasm0(fg_hexes, wasm.__wbindgen_export);
620
+ const ptr1 = passArray8ToWasm0(surfaces, wasm.__wbindgen_export2);
149
621
  const len1 = WASM_VECTOR_LEN;
150
- const ptr2 = passStringToWasm0(theme, wasm.__wbindgen_export, wasm.__wbindgen_export2);
151
- const len2 = WASM_VECTOR_LEN;
152
- wasm.labcolors_recheckContrast(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
622
+ wasm.programruntime_updateObserved(retptr, this.__wbg_ptr, addHeapObject(revision), ptr0, len0, ptr1, len1, addHeapObject(surface_count));
623
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
624
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
625
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
626
+ if (r2) {
627
+ throw takeObject(r1);
628
+ }
629
+ return ProgramSnapshot.__wrap(r0);
630
+ } finally {
631
+ wasm.__wbindgen_add_to_stack_pointer(16);
632
+ }
633
+ }
634
+ /**
635
+ * @param {bigint} revision
636
+ * @param {number} reason_id
637
+ * @returns {ProgramSnapshot}
638
+ */
639
+ updateUnknown(revision, reason_id) {
640
+ try {
641
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
642
+ wasm.programruntime_updateUnknown(retptr, this.__wbg_ptr, addHeapObject(revision), addHeapObject(reason_id));
153
643
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
154
644
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
155
645
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
646
+ if (r2) {
647
+ throw takeObject(r1);
648
+ }
649
+ return ProgramSnapshot.__wrap(r0);
650
+ } finally {
651
+ wasm.__wbindgen_add_to_stack_pointer(16);
652
+ }
653
+ }
654
+ }
655
+ if (Symbol.dispose) ProgramRuntime.prototype[Symbol.dispose] = ProgramRuntime.prototype.free;
656
+
657
+ /**
658
+ * Owned snapshot одного Program update.
659
+ */
660
+ export class ProgramSnapshot {
661
+ static __wrap(ptr) {
662
+ const obj = Object.create(ProgramSnapshot.prototype);
663
+ obj.__wbg_ptr = ptr;
664
+ ProgramSnapshotFinalization.register(obj, obj.__wbg_ptr, obj);
665
+ return obj;
666
+ }
667
+ __destroy_into_raw() {
668
+ const ptr = this.__wbg_ptr;
669
+ this.__wbg_ptr = 0;
670
+ ProgramSnapshotFinalization.unregister(this);
671
+ return ptr;
672
+ }
673
+ free() {
674
+ const ptr = this.__destroy_into_raw();
675
+ wasm.__wbg_programsnapshot_free(ptr, 0);
676
+ }
677
+ /**
678
+ * @returns {number}
679
+ */
680
+ outputCount() {
681
+ const ret = wasm.programsnapshot_outputCount(this.__wbg_ptr);
682
+ return ret >>> 0;
683
+ }
684
+ /**
685
+ * @param {number} index
686
+ * @returns {number}
687
+ */
688
+ outputOpacity(index) {
689
+ try {
690
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
691
+ wasm.programsnapshot_outputOpacity(retptr, this.__wbg_ptr, addHeapObject(index));
692
+ var r0 = getDataViewMemory0().getFloat64(retptr + 8 * 0, true);
693
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
156
694
  var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
157
695
  if (r3) {
158
696
  throw takeObject(r2);
159
697
  }
160
- var v4 = getArrayF64FromWasm0(r0, r1).slice();
161
- wasm.__wbindgen_export4(r0, r1 * 8, 8);
162
- return v4;
698
+ return r0;
163
699
  } finally {
164
700
  wasm.__wbindgen_add_to_stack_pointer(16);
165
701
  }
166
702
  }
167
703
  /**
168
- * Recheck one foreground set against MANY background samples in a single
169
- * call. The reactive controller's worst-case loop rechecks the same
170
- * foregrounds against every sample of a varying backdrop (gradient / image /
171
- * bg-blur / glass); the dominant per-foreground CAM16 forward is background-
172
- * independent, so this shares it across all samples instead of recomputing it
173
- * per `recheckContrast` call — a measured ~2.6x on the multi-sample recheck.
174
- *
175
- * Returns a flat, background-major `Float64Array`: sample `s`, foreground `i`
176
- * is at `(s * fgHexes.length + i) * 2` (`lc`) and `+1` (`wcagRatio`). The
177
- * values are byte-identical to calling `recheckContrast(bgHexes[s], fgHexes,
178
- * theme)` for each `s`.
179
- * @param {string[]} bg_hexes
180
- * @param {string[]} fg_hexes
181
- * @param {string} theme
182
- * @returns {Float64Array}
183
- */
184
- recheckContrastMulti(bg_hexes, fg_hexes, theme) {
704
+ * @param {number} index
705
+ * @returns {Uint8Array}
706
+ */
707
+ outputRgb(index) {
185
708
  try {
186
709
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
187
- const ptr0 = passArrayJsValueToWasm0(bg_hexes, wasm.__wbindgen_export);
188
- const len0 = WASM_VECTOR_LEN;
189
- const ptr1 = passArrayJsValueToWasm0(fg_hexes, wasm.__wbindgen_export);
190
- const len1 = WASM_VECTOR_LEN;
191
- const ptr2 = passStringToWasm0(theme, wasm.__wbindgen_export, wasm.__wbindgen_export2);
192
- const len2 = WASM_VECTOR_LEN;
193
- wasm.labcolors_recheckContrastMulti(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
710
+ wasm.programsnapshot_outputRgb(retptr, this.__wbg_ptr, addHeapObject(index));
194
711
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
195
712
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
196
713
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -198,70 +715,292 @@ export class LabColors {
198
715
  if (r3) {
199
716
  throw takeObject(r2);
200
717
  }
201
- var v4 = getArrayF64FromWasm0(r0, r1).slice();
202
- wasm.__wbindgen_export4(r0, r1 * 8, 8);
203
- return v4;
718
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
719
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
720
+ return v1;
204
721
  } finally {
205
722
  wasm.__wbindgen_add_to_stack_pointer(16);
206
723
  }
207
724
  }
208
725
  /**
209
- * Resolve every role for `bgHex` under `theme` (`"light" | "dark" |
210
- * "light-ic" | "dark-ic"`).
211
- *
212
- * Returns a `ResolvedTheme` object. Per-role unreachability is part of a
213
- * successful result (each role carries its own `kind`); only whole-call
214
- * failures reject (no config loaded yet as `config_required`, invalid hex,
215
- * unknown theme, a core invariant failure, and the by-construction-
216
- * unreachable oklch serialisation failure as `internal_error`) — as a
217
- * structured `"<code>: <message>"` error, never an unwound panic.
218
- * @param {string} bg_hex
219
- * @param {string} theme
220
- * @returns {ResolvedTheme}
726
+ * @param {number} index
727
+ * @returns {number}
221
728
  */
222
- resolveTheme(bg_hex, theme) {
729
+ outputSlot(index) {
223
730
  try {
224
731
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
225
- const ptr0 = passStringToWasm0(bg_hex, wasm.__wbindgen_export, wasm.__wbindgen_export2);
226
- const len0 = WASM_VECTOR_LEN;
227
- const ptr1 = passStringToWasm0(theme, wasm.__wbindgen_export, wasm.__wbindgen_export2);
228
- const len1 = WASM_VECTOR_LEN;
229
- wasm.labcolors_resolveTheme(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
732
+ wasm.programsnapshot_outputSlot(retptr, this.__wbg_ptr, addHeapObject(index));
230
733
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
231
734
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
232
735
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
233
736
  if (r2) {
234
737
  throw takeObject(r1);
235
738
  }
236
- return takeObject(r0);
739
+ return r0 >>> 0;
740
+ } finally {
741
+ wasm.__wbindgen_add_to_stack_pointer(16);
742
+ }
743
+ }
744
+ /**
745
+ * Stable lifecycle key: waiting|ready|stale|failed.
746
+ * @returns {string}
747
+ */
748
+ get state() {
749
+ let deferred1_0;
750
+ let deferred1_1;
751
+ try {
752
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
753
+ wasm.programsnapshot_state(retptr, this.__wbg_ptr);
754
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
755
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
756
+ deferred1_0 = r0;
757
+ deferred1_1 = r1;
758
+ return getStringFromWasm0(r0, r1);
237
759
  } finally {
238
760
  wasm.__wbindgen_add_to_stack_pointer(16);
761
+ wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
762
+ }
763
+ }
764
+ }
765
+ if (Symbol.dispose) ProgramSnapshot.prototype[Symbol.dispose] = ProgramSnapshot.prototype.free;
766
+
767
+ /**
768
+ * Создаёт один публичный attachment и передаёт все внешние эффекты в `host`.
769
+ * @param {Uint8Array} bytes
770
+ * @param {number} stream_id
771
+ * @param {number} output_slot
772
+ * @param {number} sink_output
773
+ * @param {number} presentation_root
774
+ * @param {number} occurrence
775
+ * @param {Function} host
776
+ * @returns {ProgramAttachment}
777
+ */
778
+ export function attachProgramWire(bytes, stream_id, output_slot, sink_output, presentation_root, occurrence, host) {
779
+ try {
780
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
781
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export2);
782
+ const len0 = WASM_VECTOR_LEN;
783
+ wasm.attachProgramWire(retptr, ptr0, len0, addHeapObject(stream_id), addHeapObject(output_slot), addHeapObject(sink_output), addHeapObject(presentation_root), addHeapObject(occurrence), addBorrowedObject(host));
784
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
785
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
786
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
787
+ if (r2) {
788
+ throw takeObject(r1);
789
+ }
790
+ return ProgramAttachment.__wrap(r0);
791
+ } finally {
792
+ wasm.__wbindgen_add_to_stack_pointer(16);
793
+ heap[stack_pointer++] = undefined;
794
+ }
795
+ }
796
+
797
+ /**
798
+ * Компилирует canonical Program wire bytes и создаёт одну runtime Session.
799
+ * @param {Uint8Array} bytes
800
+ * @param {number} stream_id
801
+ * @returns {ProgramRuntime}
802
+ */
803
+ export function compileProgramWire(bytes, stream_id) {
804
+ try {
805
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
806
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export2);
807
+ const len0 = WASM_VECTOR_LEN;
808
+ wasm.compileProgramWire(retptr, ptr0, len0, addHeapObject(stream_id));
809
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
810
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
811
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
812
+ if (r2) {
813
+ throw takeObject(r1);
239
814
  }
815
+ return ProgramRuntime.__wrap(r0);
816
+ } finally {
817
+ wasm.__wbindgen_add_to_stack_pointer(16);
818
+ }
819
+ }
820
+
821
+ /**
822
+ * Decodes untrusted certificate bytes into immutable metadata for inspection
823
+ * only. The opaque body, producer capability, and admission state stay in
824
+ * Core and are not projected to JavaScript.
825
+ * @param {Uint8Array} bytes
826
+ * @returns {any}
827
+ */
828
+ export function decodeCertificateEnvelope(bytes) {
829
+ try {
830
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
831
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export2);
832
+ const len0 = WASM_VECTOR_LEN;
833
+ wasm.decodeCertificateEnvelope(retptr, ptr0, len0);
834
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
835
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
836
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
837
+ if (r2) {
838
+ throw takeObject(r1);
839
+ }
840
+ return takeObject(r0);
841
+ } finally {
842
+ wasm.__wbindgen_add_to_stack_pointer(16);
843
+ }
844
+ }
845
+
846
+ /**
847
+ * Точная оценка WCAG 2.2 одной финальной пары sRGB8.
848
+ * @param {string} foreground_hex
849
+ * @param {string} background_hex
850
+ * @param {string} criterion
851
+ * @returns {Wcag22AssessmentV1}
852
+ */
853
+ export function evaluateWcag22(foreground_hex, background_hex, criterion) {
854
+ try {
855
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
856
+ const ptr0 = passStringToWasm0(foreground_hex, wasm.__wbindgen_export2, wasm.__wbindgen_export4);
857
+ const len0 = WASM_VECTOR_LEN;
858
+ const ptr1 = passStringToWasm0(background_hex, wasm.__wbindgen_export2, wasm.__wbindgen_export4);
859
+ const len1 = WASM_VECTOR_LEN;
860
+ const ptr2 = passStringToWasm0(criterion, wasm.__wbindgen_export2, wasm.__wbindgen_export4);
861
+ const len2 = WASM_VECTOR_LEN;
862
+ wasm.evaluateWcag22(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
863
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
864
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
865
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
866
+ if (r2) {
867
+ throw takeObject(r1);
868
+ }
869
+ return takeObject(r0);
870
+ } finally {
871
+ wasm.__wbindgen_add_to_stack_pointer(16);
872
+ }
873
+ }
874
+
875
+ /**
876
+ * Выдаёт собственную копию байтов сертификата встроенного дескриптора исходников Core.
877
+ * Идентичность и маркер создаёт Core; capability и состояние приёма остаются внутри.
878
+ * @returns {Uint8Array}
879
+ */
880
+ export function issueSourceCertificateEnvelope() {
881
+ try {
882
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
883
+ wasm.issueSourceCertificateEnvelope(retptr);
884
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
885
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
886
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
887
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
888
+ if (r3) {
889
+ throw takeObject(r2);
890
+ }
891
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
892
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
893
+ return v1;
894
+ } finally {
895
+ wasm.__wbindgen_add_to_stack_pointer(16);
896
+ }
897
+ }
898
+
899
+ /**
900
+ * Единственный публичный манифест численных возможностей.
901
+ * @returns {NumericalCapabilityManifestV2}
902
+ */
903
+ export function numericalCapabilityManifest() {
904
+ try {
905
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
906
+ wasm.numericalCapabilityManifest(retptr);
907
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
908
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
909
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
910
+ if (r2) {
911
+ throw takeObject(r1);
912
+ }
913
+ return takeObject(r0);
914
+ } finally {
915
+ wasm.__wbindgen_add_to_stack_pointer(16);
240
916
  }
241
917
  }
242
- if (Symbol.dispose) LabColors.prototype[Symbol.dispose] = LabColors.prototype.free;
243
918
  function __wbg_get_imports() {
244
919
  const import0 = {
245
920
  __proto__: null,
246
- __wbg_Error_92b29b0548f8b746: function(arg0, arg1) {
247
- const ret = Error(getStringFromWasm0(arg0, arg1));
248
- return addHeapObject(ret);
921
+ __wbg___wbindgen_bigint_get_as_i64_d968e41184ae354f: function(arg0, arg1) {
922
+ const v = getObject(arg1);
923
+ const ret = typeof(v) === 'bigint' ? v : undefined;
924
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
925
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
926
+ },
927
+ __wbg___wbindgen_boolean_get_fa956cfa2d1bd751: function(arg0) {
928
+ const v = getObject(arg0);
929
+ const ret = typeof(v) === 'boolean' ? v : undefined;
930
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
249
931
  },
250
- __wbg___wbindgen_string_get_b0ca35b86a603356: function(arg0, arg1) {
932
+ __wbg___wbindgen_jsval_eq_e659fcf7b0e32763: function(arg0, arg1) {
933
+ const ret = getObject(arg0) === getObject(arg1);
934
+ return ret;
935
+ },
936
+ __wbg___wbindgen_number_get_394265ed1e1b84ee: function(arg0, arg1) {
251
937
  const obj = getObject(arg1);
252
- const ret = typeof(obj) === 'string' ? obj : undefined;
253
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
254
- var len1 = WASM_VECTOR_LEN;
255
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
256
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
938
+ const ret = typeof(obj) === 'number' ? obj : undefined;
939
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
940
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
257
941
  },
258
942
  __wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
259
943
  throw new Error(getStringFromWasm0(arg0, arg1));
260
944
  },
945
+ __wbg_bindingFailure_4877cb613e60386d: function(arg0, arg1, arg2) {
946
+ const ret = bindingFailure(arg0 >>> 0, getStringFromWasm0(arg1, arg2));
947
+ return addHeapObject(ret);
948
+ },
949
+ __wbg_call_a6e5c5dce5018821: function() { return handleError(function (arg0, arg1, arg2) {
950
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
951
+ return addHeapObject(ret);
952
+ }, arguments); },
953
+ __wbg_certificateError_2ec426aadd4e43a9: function(arg0, arg1, arg2, arg3) {
954
+ const ret = certificateError(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
955
+ return addHeapObject(ret);
956
+ },
957
+ __wbg_certificateProjection_ebb48b40efb00a94: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, arg20, arg21) {
958
+ const ret = certificateProjection(arg0, getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4), arg5, getStringFromWasm0(arg6, arg7), getStringFromWasm0(arg8, arg9), getArrayU8FromWasm0(arg10, arg11), getStringFromWasm0(arg12, arg13), getStringFromWasm0(arg14, arg15), arg16, arg17 >>> 0, getArrayU8FromWasm0(arg18, arg19), getArrayU8FromWasm0(arg20, arg21));
959
+ return addHeapObject(ret);
960
+ },
961
+ __wbg_new_da52cf8fe3429cb2: function() {
962
+ const ret = new Object();
963
+ return addHeapObject(ret);
964
+ },
965
+ __wbg_new_from_slice_77cdfb7977362f3c: function(arg0, arg1) {
966
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
967
+ return addHeapObject(ret);
968
+ },
261
969
  __wbg_parse_1c0d8a8656d7e016: function() { return handleError(function (arg0, arg1) {
262
970
  const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
263
971
  return addHeapObject(ret);
264
972
  }, arguments); },
973
+ __wbg_programError_5f6bdc898b9887ae: function(arg0, arg1, arg2, arg3, arg4, arg5) {
974
+ const ret = programError(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5));
975
+ return addHeapObject(ret);
976
+ },
977
+ __wbg_programFailure_39b68ebdcc015c84: function(arg0, arg1, arg2) {
978
+ const ret = programFailure(arg0 >>> 0, getStringFromWasm0(arg1, arg2));
979
+ return addHeapObject(ret);
980
+ },
981
+ __wbg_set_8535240470bf2500: function() { return handleError(function (arg0, arg1, arg2) {
982
+ const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
983
+ return ret;
984
+ }, arguments); },
985
+ __wbindgen_cast_0000000000000001: function(arg0) {
986
+ // Cast intrinsic for `F64 -> Externref`.
987
+ const ret = arg0;
988
+ return addHeapObject(ret);
989
+ },
990
+ __wbindgen_cast_0000000000000002: function(arg0, arg1) {
991
+ // Cast intrinsic for `Ref(String) -> Externref`.
992
+ const ret = getStringFromWasm0(arg0, arg1);
993
+ return addHeapObject(ret);
994
+ },
995
+ __wbindgen_cast_0000000000000003: function(arg0) {
996
+ // Cast intrinsic for `U64 -> Externref`.
997
+ const ret = BigInt.asUintN(64, arg0);
998
+ return addHeapObject(ret);
999
+ },
1000
+ __wbindgen_object_clone_ref: function(arg0) {
1001
+ const ret = getObject(arg0);
1002
+ return addHeapObject(ret);
1003
+ },
265
1004
  __wbindgen_object_drop_ref: function(arg0) {
266
1005
  takeObject(arg0);
267
1006
  },
@@ -272,9 +1011,24 @@ function __wbg_get_imports() {
272
1011
  };
273
1012
  }
274
1013
 
275
- const LabColorsFinalization = (typeof FinalizationRegistry === 'undefined')
1014
+ const AttachedMaterializationAuthorityFinalization = (typeof FinalizationRegistry === 'undefined')
1015
+ ? { register: () => {}, unregister: () => {} }
1016
+ : new FinalizationRegistry(ptr => wasm.__wbg_attachedmaterializationauthority_free(ptr, 1));
1017
+ const ProgramAttachedRenderFinalization = (typeof FinalizationRegistry === 'undefined')
1018
+ ? { register: () => {}, unregister: () => {} }
1019
+ : new FinalizationRegistry(ptr => wasm.__wbg_programattachedrender_free(ptr, 1));
1020
+ const ProgramAttachedSnapshotFinalization = (typeof FinalizationRegistry === 'undefined')
1021
+ ? { register: () => {}, unregister: () => {} }
1022
+ : new FinalizationRegistry(ptr => wasm.__wbg_programattachedsnapshot_free(ptr, 1));
1023
+ const ProgramAttachmentFinalization = (typeof FinalizationRegistry === 'undefined')
1024
+ ? { register: () => {}, unregister: () => {} }
1025
+ : new FinalizationRegistry(ptr => wasm.__wbg_programattachment_free(ptr, 1));
1026
+ const ProgramRuntimeFinalization = (typeof FinalizationRegistry === 'undefined')
276
1027
  ? { register: () => {}, unregister: () => {} }
277
- : new FinalizationRegistry(ptr => wasm.__wbg_labcolors_free(ptr, 1));
1028
+ : new FinalizationRegistry(ptr => wasm.__wbg_programruntime_free(ptr, 1));
1029
+ const ProgramSnapshotFinalization = (typeof FinalizationRegistry === 'undefined')
1030
+ ? { register: () => {}, unregister: () => {} }
1031
+ : new FinalizationRegistry(ptr => wasm.__wbg_programsnapshot_free(ptr, 1));
278
1032
 
279
1033
  function addHeapObject(obj) {
280
1034
  if (heap_next === heap.length) heap.push(heap.length + 1);
@@ -285,15 +1039,21 @@ function addHeapObject(obj) {
285
1039
  return idx;
286
1040
  }
287
1041
 
1042
+ function addBorrowedObject(obj) {
1043
+ if (stack_pointer == 1) throw new Error('out of js stack');
1044
+ heap[--stack_pointer] = obj;
1045
+ return stack_pointer;
1046
+ }
1047
+
288
1048
  function dropObject(idx) {
289
1049
  if (idx < 1028) return;
290
1050
  heap[idx] = heap_next;
291
1051
  heap_next = idx;
292
1052
  }
293
1053
 
294
- function getArrayF64FromWasm0(ptr, len) {
1054
+ function getArrayU8FromWasm0(ptr, len) {
295
1055
  ptr = ptr >>> 0;
296
- return getFloat64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
1056
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
297
1057
  }
298
1058
 
299
1059
  let cachedDataViewMemory0 = null;
@@ -304,18 +1064,18 @@ function getDataViewMemory0() {
304
1064
  return cachedDataViewMemory0;
305
1065
  }
306
1066
 
307
- let cachedFloat64ArrayMemory0 = null;
308
- function getFloat64ArrayMemory0() {
309
- if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
310
- cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
311
- }
312
- return cachedFloat64ArrayMemory0;
313
- }
314
-
315
1067
  function getStringFromWasm0(ptr, len) {
316
1068
  return decodeText(ptr >>> 0, len);
317
1069
  }
318
1070
 
1071
+ let cachedUint32ArrayMemory0 = null;
1072
+ function getUint32ArrayMemory0() {
1073
+ if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
1074
+ cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
1075
+ }
1076
+ return cachedUint32ArrayMemory0;
1077
+ }
1078
+
319
1079
  let cachedUint8ArrayMemory0 = null;
320
1080
  function getUint8ArrayMemory0() {
321
1081
  if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
@@ -330,7 +1090,7 @@ function handleError(f, args) {
330
1090
  try {
331
1091
  return f.apply(this, args);
332
1092
  } catch (e) {
333
- wasm.__wbindgen_export3(addHeapObject(e));
1093
+ wasm.__wbindgen_export(addHeapObject(e));
334
1094
  }
335
1095
  }
336
1096
 
@@ -343,13 +1103,17 @@ function isLikeNone(x) {
343
1103
  return x === undefined || x === null;
344
1104
  }
345
1105
 
346
- function passArrayJsValueToWasm0(array, malloc) {
347
- const ptr = malloc(array.length * 4, 4) >>> 0;
348
- const mem = getDataViewMemory0();
349
- for (let i = 0; i < array.length; i++) {
350
- mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
351
- }
352
- WASM_VECTOR_LEN = array.length;
1106
+ function passArray32ToWasm0(arg, malloc) {
1107
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
1108
+ getUint32ArrayMemory0().set(arg, ptr / 4);
1109
+ WASM_VECTOR_LEN = arg.length;
1110
+ return ptr;
1111
+ }
1112
+
1113
+ function passArray8ToWasm0(arg, malloc) {
1114
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
1115
+ getUint8ArrayMemory0().set(arg, ptr / 1);
1116
+ WASM_VECTOR_LEN = arg.length;
353
1117
  return ptr;
354
1118
  }
355
1119
 
@@ -390,6 +1154,8 @@ function passStringToWasm0(arg, malloc, realloc) {
390
1154
  return ptr;
391
1155
  }
392
1156
 
1157
+ let stack_pointer = 1024;
1158
+
393
1159
  function takeObject(idx) {
394
1160
  const ret = getObject(idx);
395
1161
  dropObject(idx);
@@ -431,7 +1197,7 @@ function __wbg_finalize_init(instance, module) {
431
1197
  wasm = instance.exports;
432
1198
  wasmModule = module;
433
1199
  cachedDataViewMemory0 = null;
434
- cachedFloat64ArrayMemory0 = null;
1200
+ cachedUint32ArrayMemory0 = null;
435
1201
  cachedUint8ArrayMemory0 = null;
436
1202
  return wasm;
437
1203
  }