@scratch/scratch-vm 11.1.0 → 11.2.0-cla.1

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.
@@ -1,3 +1,44 @@
1
+ /*!
2
+ * decimal.js v10.5.0
3
+ * An arbitrary-precision Decimal type for JavaScript.
4
+ * https://github.com/MikeMcl/decimal.js
5
+ * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
6
+ * MIT Licence
7
+ */
8
+
9
+ /*!
10
+ * Copyright (c) 2015-2020, Salesforce.com, Inc.
11
+ * All rights reserved.
12
+ *
13
+ * Redistribution and use in source and binary forms, with or without
14
+ * modification, are permitted provided that the following conditions are met:
15
+ *
16
+ * 1. Redistributions of source code must retain the above copyright notice,
17
+ * this list of conditions and the following disclaimer.
18
+ *
19
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
20
+ * this list of conditions and the following disclaimer in the documentation
21
+ * and/or other materials provided with the distribution.
22
+ *
23
+ * 3. Neither the name of Salesforce.com nor the names of its contributors may
24
+ * be used to endorse or promote products derived from this software without
25
+ * specific prior written permission.
26
+ *
27
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
31
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37
+ * POSSIBILITY OF SUCH DAMAGE.
38
+ */
39
+
40
+ /*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
41
+
1
42
  /*! @source http://purl.eligrey.com/github/canvas-toBlob.js/blob/master/canvas-toBlob.js */
2
43
 
3
44
  /*! exports provided: Adler32 */
@@ -62,6 +103,8 @@
62
103
 
63
104
  /*! no static exports found */
64
105
 
106
+ /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
107
+
65
108
  /*!******************!*\
66
109
  !*** ./index.js ***!
67
110
  \******************/
@@ -202,4 +245,298 @@
202
245
  !*** ./src/squeak/byte-take-iterator.js ***!
203
246
  \******************************************/
204
247
 
248
+ /**
249
+ * @description Calculate deltaE OK which is the simple root sum of squares
250
+ * @param {number[]} reference - Array of OKLab values: L as 0..1, a and b as -1..1
251
+ * @param {number[]} sample - Array of OKLab values: L as 0..1, a and b as -1..1
252
+ * @return {number} How different a color sample is from reference
253
+ *
254
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
255
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/deltaEOK.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
256
+ * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/deltaEOK.js
257
+ */
258
+
259
+ /**
260
+ * @license MIT https://github.com/facelessuser/coloraide/blob/main/LICENSE.md
261
+ */
262
+
263
+ /**
264
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
265
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
266
+ *
267
+ * XYZ <-> LMS matrices recalculated for consistent reference white
268
+ * @see https://github.com/w3c/csswg-drafts/issues/6642#issuecomment-943521484
269
+ */
270
+
271
+ /**
272
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
273
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
274
+ * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js
275
+ */
276
+
277
+ /**
278
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
279
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
280
+ */
281
+
282
+ /**
283
+ * @param {number} hue - Hue as degrees 0..360
284
+ * @param {number} white - Whiteness as percentage 0..100
285
+ * @param {number} black - Blackness as percentage 0..100
286
+ * @return {number[]} Array of RGB components 0..1
287
+ *
288
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
289
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hwbToRgb.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
290
+ * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hwbToRgb.js
291
+ */
292
+
293
+ /**
294
+ * @param {number} hue - Hue as degrees 0..360
295
+ * @param {number} sat - Saturation as percentage 0..100
296
+ * @param {number} light - Lightness as percentage 0..100
297
+ * @return {number[]} Array of sRGB components; in-gamut colors in range [0..1]
298
+ *
299
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
300
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hslToRgb.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
301
+ * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hslToRgb.js
302
+ */
303
+
304
+ /**
305
+ * Assuming XYZ is relative to D50, convert to CIE Lab
306
+ * from CIE standard, which now defines these as a rational fraction
307
+ *
308
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
309
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
310
+ */
311
+
312
+ /**
313
+ * Bradford chromatic adaptation from D50 to D65
314
+ *
315
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
316
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
317
+ */
318
+
319
+ /**
320
+ * Bradford chromatic adaptation from D65 to D50
321
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
322
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
323
+ * @see http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html
324
+ */
325
+
326
+ /**
327
+ * Character class utilities for XML NS 1.0 edition 3.
328
+ *
329
+ * @author Louis-Dominique Dubeau
330
+ * @license MIT
331
+ * @copyright Louis-Dominique Dubeau
332
+ */
333
+
334
+ /**
335
+ * Character classes and associated utilities for the 2nd edition of XML 1.1.
336
+ *
337
+ * @author Louis-Dominique Dubeau
338
+ * @license MIT
339
+ * @copyright Louis-Dominique Dubeau
340
+ */
341
+
342
+ /**
343
+ * Character classes and associated utilities for the 5th edition of XML 1.0.
344
+ *
345
+ * @author Louis-Dominique Dubeau
346
+ * @license MIT
347
+ * @copyright Louis-Dominique Dubeau
348
+ */
349
+
350
+ /**
351
+ * Convert D50 XYZ to linear-light prophoto-rgb
352
+ *
353
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
354
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
355
+ * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
356
+ */
357
+
358
+ /**
359
+ * Convert Lab to D50-adapted XYZ
360
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
361
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
362
+ * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
363
+ */
364
+
365
+ /**
366
+ * Convert XYZ to linear-light P3
367
+ *
368
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
369
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
370
+ */
371
+
372
+ /**
373
+ * Convert XYZ to linear-light rec2020
374
+ *
375
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
376
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
377
+ */
378
+
379
+ /**
380
+ * Convert an array of a98-rgb values in the range 0.0 - 1.0
381
+ * to linear light (un-companded) form. Negative values are also now accepted
382
+ *
383
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
384
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
385
+ */
386
+
387
+ /**
388
+ * Convert an array of display-p3 RGB values in the range 0.0 - 1.0
389
+ * to linear light (un-companded) form.
390
+ *
391
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
392
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
393
+ */
394
+
395
+ /**
396
+ * Convert an array of gamma-corrected sRGB values in the 0.0 to 1.0 range to HSL.
397
+ *
398
+ * @param {Color} RGB [r, g, b]
399
+ * - Red component 0..1
400
+ * - Green component 0..1
401
+ * - Blue component 0..1
402
+ * @return {number[]} Array of HSL values: Hue as degrees 0..360, Saturation and Lightness as percentages 0..100
403
+ *
404
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
405
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
406
+ *
407
+ * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/better-rgbToHsl.js
408
+ */
409
+
410
+ /**
411
+ * Convert an array of linear-light a98-rgb in the range 0.0-1.0
412
+ * to gamma corrected form. Negative values are also now accepted
413
+ *
414
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
415
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
416
+ */
417
+
418
+ /**
419
+ * Convert an array of linear-light a98-rgb values to CIE XYZ
420
+ * http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
421
+ * has greater numerical precision than section 4.3.5.3 of
422
+ * https://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf
423
+ * but the values below were calculated from first principles
424
+ * from the chromaticity coordinates of R G B W
425
+ *
426
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
427
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
428
+ * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
429
+ * @see https://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf
430
+ * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/matrixmaker.html
431
+ */
432
+
433
+ /**
434
+ * Convert an array of linear-light display-p3 RGB in the range 0.0-1.0
435
+ * to gamma corrected form
436
+ *
437
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
438
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
439
+ */
440
+
441
+ /**
442
+ * Convert an array of linear-light display-p3 values to CIE XYZ
443
+ * using D65 (no chromatic adaptation)
444
+ *
445
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
446
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
447
+ * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
448
+ */
449
+
450
+ /**
451
+ * Convert an array of linear-light prophoto-rgb in the range 0.0-1.0
452
+ * to gamma corrected form.
453
+ * Transfer curve is gamma 1.8 with a small linear portion.
454
+ *
455
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
456
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
457
+ */
458
+
459
+ /**
460
+ * Convert an array of linear-light prophoto-rgb values to CIE D50 XYZ.
461
+ * Matrix cannot be expressed in rational form, but is calculated to 64 bit accuracy.
462
+ *
463
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
464
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
465
+ * @see see https://github.com/w3c/csswg-drafts/issues/7675
466
+ */
467
+
468
+ /**
469
+ * Convert an array of linear-light rec2020 RGB in the range 0.0-1.0
470
+ * to gamma corrected form ITU-R BT.2020-2 p.4
471
+ *
472
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
473
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
474
+ */
475
+
476
+ /**
477
+ * Convert an array of linear-light rec2020 values to CIE XYZ
478
+ * using D65 (no chromatic adaptation)
479
+ *
480
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
481
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
482
+ * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
483
+ */
484
+
485
+ /**
486
+ * Convert an array of linear-light sRGB values in the range 0.0-1.0 to gamma corrected form
487
+ * Extended transfer function:
488
+ * For negative values, linear portion extends on reflection
489
+ * of axis, then uses reflected pow below that
490
+ *
491
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
492
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
493
+ * @see https://en.wikipedia.org/wiki/SRGB
494
+ */
495
+
496
+ /**
497
+ * Convert an array of linear-light sRGB values to CIE XYZ
498
+ * using sRGB's own white, D65 (no chromatic adaptation)
499
+ *
500
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
501
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
502
+ */
503
+
504
+ /**
505
+ * Convert an array of of sRGB values where in-gamut values are in the range
506
+ * [0 - 1] to linear light (un-companded) form.
507
+ * Extended transfer function:
508
+ * For negative values, linear portion is extended on reflection of axis,
509
+ * then reflected power function is used.
510
+ *
511
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
512
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
513
+ * @see https://en.wikipedia.org/wiki/SRGB
514
+ */
515
+
516
+ /**
517
+ * Convert an array of prophoto-rgb values where in-gamut Colors are in the
518
+ * range [0.0 - 1.0] to linear light (un-companded) form. Transfer curve is
519
+ * gamma 1.8 with a small linear portion. Extended transfer function
520
+ *
521
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
522
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
523
+ */
524
+
525
+ /**
526
+ * Convert an array of rec2020 RGB values in the range 0.0 - 1.0
527
+ * to linear light (un-companded) form.
528
+ * ITU-R BT.2020-2 p.4
529
+ *
530
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
531
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
532
+ */
533
+
534
+ /**
535
+ * Given OKLab, convert to XYZ relative to D65
536
+ *
537
+ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
538
+ * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).
539
+ * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js
540
+ */
541
+
205
542
  /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */