@pixerate/editor 0.154.0 → 0.156.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/dist/animation-editor/index.cjs +60 -61
  2. package/dist/animation-editor/index.js +5 -6
  3. package/dist/{brushstrokeRender-YAZVQUXY.cjs → brushstrokeRender-5WANQIG4.cjs} +10 -10
  4. package/dist/{brushstrokeRender-EUDQTDYS.js → brushstrokeRender-Q4LI22QV.js} +3 -3
  5. package/dist/canvas/index.cjs +23 -24
  6. package/dist/canvas/index.js +3 -4
  7. package/dist/chart/index.cjs +2 -3
  8. package/dist/chart/index.js +1 -2
  9. package/dist/{chunk-AGZ47XY2.js → chunk-2N2QPO3H.js} +6 -2
  10. package/dist/{chunk-NMXPOKF3.js → chunk-45XXVHVG.js} +1 -1
  11. package/dist/{chunk-FLOGD3QB.js → chunk-6UPGM3JB.js} +2 -2
  12. package/dist/{chunk-6FUAHCVI.cjs → chunk-7NW46N7I.cjs} +16 -16
  13. package/dist/{chunk-ORDXMBD4.js → chunk-A5UCR2TO.js} +10 -3
  14. package/dist/{chunk-PI45JMP7.cjs → chunk-CD7PLU77.cjs} +81 -81
  15. package/dist/{chunk-LRRCMRSL.cjs → chunk-EBDCRTZI.cjs} +20 -16
  16. package/dist/{chunk-OLCYQLFE.js → chunk-EL5PAHNP.js} +1 -1
  17. package/dist/{chunk-PUC43JPT.cjs → chunk-EYVVIZJ3.cjs} +1 -1
  18. package/dist/{chunk-BXMIBMVG.cjs → chunk-JGKCC5OF.cjs} +65 -58
  19. package/dist/chunk-M4MIZPQI.cjs +393 -0
  20. package/dist/{chunk-LIXLD433.cjs → chunk-MHEXLG3M.cjs} +35 -35
  21. package/dist/chunk-NHLYK3AX.js +393 -0
  22. package/dist/{chunk-RHXW4TA5.cjs → chunk-QMI5HZWA.cjs} +7 -7
  23. package/dist/{chunk-XFDQEAOS.cjs → chunk-RQCMSEM5.cjs} +2 -2
  24. package/dist/{chunk-BCY22GBH.js → chunk-SDHZG5TF.js} +1 -1
  25. package/dist/{chunk-HVX35M2I.cjs → chunk-WI7QJA7A.cjs} +2 -2
  26. package/dist/{chunk-UILRJQFD.js → chunk-WNAAWLZ5.js} +1 -1
  27. package/dist/{chunk-4J4MC3F5.js → chunk-YXOW456B.js} +1 -1
  28. package/dist/{chunk-Y64YPIFT.js → chunk-ZQWLWDZI.js} +1 -1
  29. package/dist/diagram/index.cjs +2 -3
  30. package/dist/diagram/index.js +1 -2
  31. package/dist/image-editor/controller.d.cts +8 -0
  32. package/dist/image-editor/controller.d.ts +8 -0
  33. package/dist/image-editor/editorDocument.d.cts +16 -0
  34. package/dist/image-editor/editorDocument.d.ts +16 -0
  35. package/dist/image-editor/index.cjs +787 -737
  36. package/dist/image-editor/index.d.cts +1 -0
  37. package/dist/image-editor/index.d.ts +1 -0
  38. package/dist/image-editor/index.js +56 -6
  39. package/dist/index.cjs +4 -5
  40. package/dist/index.js +2 -3
  41. package/dist/paint/grain.d.cts +7 -0
  42. package/dist/paint/grain.d.ts +7 -0
  43. package/dist/paint/index.cjs +3 -3
  44. package/dist/paint/index.js +2 -2
  45. package/dist/paint-editor/controller.d.cts +38 -0
  46. package/dist/paint-editor/controller.d.ts +38 -0
  47. package/dist/paint-editor/document.d.cts +8 -0
  48. package/dist/paint-editor/document.d.ts +8 -0
  49. package/dist/paint-editor/editorDocument.d.cts +17 -0
  50. package/dist/paint-editor/editorDocument.d.ts +17 -0
  51. package/dist/paint-editor/index.cjs +476 -273
  52. package/dist/paint-editor/index.d.cts +1 -0
  53. package/dist/paint-editor/index.d.ts +1 -0
  54. package/dist/paint-editor/index.js +216 -13
  55. package/dist/paint-editor/paper.d.cts +8 -0
  56. package/dist/paint-editor/paper.d.ts +8 -0
  57. package/dist/paint-editor/stencils.d.cts +2 -0
  58. package/dist/paint-editor/stencils.d.ts +2 -0
  59. package/dist/paint-editor/wet.d.cts +1 -0
  60. package/dist/paint-editor/wet.d.ts +1 -0
  61. package/dist/parameters/index.cjs +2 -3
  62. package/dist/parameters/index.js +1 -2
  63. package/dist/persistence/assets.d.cts +51 -0
  64. package/dist/persistence/assets.d.ts +51 -0
  65. package/dist/persistence/editorDocument.d.cts +12 -0
  66. package/dist/persistence/editorDocument.d.ts +12 -0
  67. package/dist/persistence/index.cjs +32 -8
  68. package/dist/persistence/index.d.cts +1 -0
  69. package/dist/persistence/index.d.ts +1 -0
  70. package/dist/persistence/index.js +34 -10
  71. package/dist/spreadsheet/index.cjs +3 -4
  72. package/dist/spreadsheet/index.js +2 -3
  73. package/dist/tokens/index.cjs +3 -4
  74. package/dist/tokens/index.js +2 -3
  75. package/dist/vector/index.cjs +952 -953
  76. package/dist/vector/index.js +5 -6
  77. package/dist/video-editor/index.cjs +2 -3
  78. package/dist/video-editor/index.js +1 -2
  79. package/package.json +1 -1
  80. package/skills/pixerate-image-editor/SKILL.md +16 -24
  81. package/skills/pixerate-image-editor/references/smart-objects.md +28 -0
  82. package/skills/pixerate-paint-editor/SKILL.md +26 -6
  83. package/dist/chunk-5H2C3QSF.cjs +0 -134
  84. package/dist/chunk-GNV54DLO.js +0 -134
  85. package/dist/chunk-L5OWG2NA.cjs +0 -135
  86. package/dist/chunk-WHKNYFM2.js +0 -135
@@ -1281,6 +1281,8 @@ var PaperGrain = (_class5 = class {
1281
1281
 
1282
1282
 
1283
1283
 
1284
+
1285
+
1284
1286
  constructor(paper, media = "dry") {;_class5.prototype.__init22.call(this);
1285
1287
  const raw = grainHeights(paper.pattern, paper.seed);
1286
1288
  const t = paper[media];
@@ -1296,6 +1298,8 @@ var PaperGrain = (_class5 = class {
1296
1298
  }
1297
1299
  this.scale = paper.scale;
1298
1300
  this.mirror = paper.tiling === "mirror";
1301
+ this.ox = _nullishCoalesce(_optionalChain([paper, 'access', _5 => _5.offset, 'optionalAccess', _6 => _6.x]), () => ( 0));
1302
+ this.oy = _nullishCoalesce(_optionalChain([paper, 'access', _7 => _7.offset, 'optionalAccess', _8 => _8.y]), () => ( 0));
1299
1303
  }
1300
1304
  /** Tile cell index for a coordinate in grain pixels (mirrored on odd tiles when mirroring). */
1301
1305
  wrap(v) {
@@ -1306,8 +1310,8 @@ var PaperGrain = (_class5 = class {
1306
1310
  }
1307
1311
  /** Height 0..1 at document position (x, y). */
1308
1312
  at(x, y) {
1309
- const u = x / this.scale - 0.5;
1310
- const v = y / this.scale - 0.5;
1313
+ const u = (x - this.ox) / this.scale - 0.5;
1314
+ const v = (y - this.oy) / this.scale - 0.5;
1311
1315
  const x0 = Math.floor(u);
1312
1316
  const y0 = Math.floor(v);
1313
1317
  const fx = u - x0;
@@ -1363,10 +1367,10 @@ function pathStrokeDabs(samples, options) {
1363
1367
  const tilt = _nullishCoalesce(options.tilt, () => ( {}));
1364
1368
  const minSize = Math.min(1, Math.max(0, _nullishCoalesce(options.minSize, () => ( 0))));
1365
1369
  let index = 0;
1366
- const t0 = _nullishCoalesce(_optionalChain([pts, 'access', _5 => _5.find, 'call', _6 => _6((s) => typeof s.t === "number" && Number.isFinite(s.t)), 'optionalAccess', _7 => _7.t]), () => ( null));
1370
+ const t0 = _nullishCoalesce(_optionalChain([pts, 'access', _9 => _9.find, 'call', _10 => _10((s) => typeof s.t === "number" && Number.isFinite(s.t)), 'optionalAccess', _11 => _11.t]), () => ( null));
1367
1371
  const dab = (x, y, p, l, dir, travel = 0, time = null, speed = null) => {
1368
1372
  const pr = Math.min(1, Math.max(0, p));
1369
- const lean0 = _nullishCoalesce(_optionalChain([l, 'optionalAccess', _8 => _8.amount]), () => ( 0));
1373
+ const lean0 = _nullishCoalesce(_optionalChain([l, 'optionalAccess', _12 => _12.amount]), () => ( 0));
1370
1374
  const size = brush.size * (brush.pressureSize ? minSize + (1 - minSize) * pr : 1) * (1 + 1.5 * (_nullishCoalesce(tilt.size, () => ( 0))) * lean0);
1371
1375
  let angle = brush.angle * Math.PI / 180;
1372
1376
  if (options.followPath) angle += dir;
@@ -1433,9 +1437,9 @@ function pathStrokeCoverage(samples, options) {
1433
1437
  const brush = normalizeBrush(options.brush);
1434
1438
  const coverage = new CoverageMap();
1435
1439
  const dabs = pathStrokeDabs(samples, options);
1436
- const g = _optionalChain([options, 'access', _9 => _9.gradient, 'optionalAccess', _10 => _10.paint, 'access', _11 => _11.type]) === "gradient" ? options.gradient : null;
1440
+ const g = _optionalChain([options, 'access', _13 => _13.gradient, 'optionalAccess', _14 => _14.paint, 'access', _15 => _15.type]) === "gradient" ? options.gradient : null;
1437
1441
  const sampler = g ? new PaintGradientSampler(resolvePaintGradient(g.paint, _nullishCoalesce(g.colors, () => ( { paint: "#000000", secondary: "#ffffff" }))), _nullishCoalesce(g.seed, () => ( 0))) : null;
1438
- const tipTable = _optionalChain([sampler, 'optionalAccess', _12 => _12.acrossTip]) ? sampler.tipTable(TIP_GRADIENT_STEPS) : null;
1442
+ const tipTable = _optionalChain([sampler, 'optionalAccess', _16 => _16.acrossTip]) ? sampler.tipTable(TIP_GRADIENT_STEPS) : null;
1439
1443
  const scratch = { field: new Float32Array(0), sample: { rgb: [0, 0, 0], alpha: 1 } };
1440
1444
  let buf = new Float32Array(0);
1441
1445
  let bounds = null;
@@ -1459,7 +1463,7 @@ function pathStrokeCoverage(samples, options) {
1459
1463
  }
1460
1464
  const grain = options.grain;
1461
1465
  if (grain && grain.depth > 0 && dabs.length) {
1462
- const pressure = dabs.reduce((sum, d) => sum + (_nullishCoalesce(_optionalChain([d, 'access', _13 => _13.params, 'optionalAccess', _14 => _14.pressure]), () => ( 1))), 0) / dabs.length;
1466
+ const pressure = dabs.reduce((sum, d) => sum + (_nullishCoalesce(_optionalChain([d, 'access', _17 => _17.params, 'optionalAccess', _18 => _18.pressure]), () => ( 1))), 0) / dabs.length;
1463
1467
  for (const [key, t] of coverage.tiles) {
1464
1468
  const { tx, ty } = _chunkCWM3CUUXcjs.tileCoord.call(void 0, key);
1465
1469
  for (let y = 0, k = 0; y < _chunkCWM3CUUXcjs.TILE; y++) {
@@ -1475,11 +1479,11 @@ function paintPathStroke(surface, samples, options) {
1475
1479
  const brush = normalizeBrush(options.brush);
1476
1480
  const hex = (c) => "#" + [0, 1, 2].map((i) => Math.round(Math.min(255, Math.max(0, c[i]))).toString(16).padStart(2, "0")).join("");
1477
1481
  let color = options.color;
1478
- if (_optionalChain([options, 'access', _15 => _15.paint, 'optionalAccess', _16 => _16.paint, 'access', _17 => _17.type]) === "color") {
1482
+ if (_optionalChain([options, 'access', _19 => _19.paint, 'optionalAccess', _20 => _20.paint, 'access', _21 => _21.type]) === "color") {
1479
1483
  const rgb = hexToPaintRgb(options.paint.paint.color).map((v) => Math.round(v * 255));
1480
1484
  color = [rgb[0], rgb[1], rgb[2], color[3]];
1481
1485
  }
1482
- const gradient = _optionalChain([options, 'access', _18 => _18.paint, 'optionalAccess', _19 => _19.paint, 'access', _20 => _20.type]) === "gradient" ? { ...options.paint, colors: _nullishCoalesce(options.paint.colors, () => ( { paint: hex(color), secondary: "#ffffff" })) } : null;
1486
+ const gradient = _optionalChain([options, 'access', _22 => _22.paint, 'optionalAccess', _23 => _23.paint, 'access', _24 => _24.type]) === "gradient" ? { ...options.paint, colors: _nullishCoalesce(options.paint.colors, () => ( { paint: hex(color), secondary: "#ffffff" })) } : null;
1483
1487
  const { coverage, bounds, dabs } = pathStrokeCoverage(samples, { ...options, gradient });
1484
1488
  if (!bounds) return { surface, bounds: null, dabs };
1485
1489
  const offset = _nullishCoalesce(options.offset, () => ( { x: 0, y: 0 }));
@@ -1496,7 +1500,7 @@ function paintPathStroke(surface, samples, options) {
1496
1500
  const tiles = new Map(surface.tiles);
1497
1501
  for (const { tx, ty } of _chunkCWM3CUUXcjs.tilesInRect.call(void 0, { x: bounds.x - offset.x, y: bounds.y - offset.y, width: bounds.width, height: bounds.height })) {
1498
1502
  const key = _chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty);
1499
- const src = _optionalChain([surface, 'access', _21 => _21.tiles, 'access', _22 => _22.get, 'call', _23 => _23(key), 'optionalAccess', _24 => _24.data]);
1503
+ const src = _optionalChain([surface, 'access', _25 => _25.tiles, 'access', _26 => _26.get, 'call', _27 => _27(key), 'optionalAccess', _28 => _28.data]);
1500
1504
  const base = src && src.length === _chunkCWM3CUUXcjs.TILE * _chunkCWM3CUUXcjs.TILE * 4 ? src : new Uint8ClampedArray(_chunkCWM3CUUXcjs.TILE * _chunkCWM3CUUXcjs.TILE * 4);
1501
1505
  const t = _chunkCWM3CUUXcjs.finishTile.call(void 0, applyStrokeToTile(coverage, base, 4, tx, ty, apply), 4, surface.defaultValue);
1502
1506
  if (t) tiles.set(key, t);
@@ -1592,7 +1596,7 @@ function renderBrushstroke(input, brush, options = {}) {
1592
1596
  let scale = finite2(options.scale) && options.scale > 0 ? Math.min(_chunkYQGCPL5Xcjs.BRUSHSTROKE_MAX_SCALE, Math.max(_chunkYQGCPL5Xcjs.BRUSHSTROKE_MIN_SCALE, options.scale)) : 1;
1593
1597
  if (!samples.length) return { image: { width: 0, height: 0, data: new Uint8ClampedArray(0) }, bounds: null, scale, dabs: 0 };
1594
1598
  const tip = strokeOptions.brush;
1595
- const reach = tip.size * (1 + 1.5 * (_nullishCoalesce(_optionalChain([strokeOptions, 'access', _25 => _25.tilt, 'optionalAccess', _26 => _26.size]), () => ( 0)))) + 4;
1599
+ const reach = tip.size * (1 + 1.5 * (_nullishCoalesce(_optionalChain([strokeOptions, 'access', _29 => _29.tilt, 'optionalAccess', _30 => _30.size]), () => ( 0)))) + 4;
1596
1600
  let x0 = Infinity, y0 = Infinity, x1 = -Infinity, y1 = -Infinity;
1597
1601
  for (const s of samples) {
1598
1602
  x0 = Math.min(x0, s.x);
@@ -1615,8 +1619,8 @@ function renderBrushstroke(input, brush, options = {}) {
1615
1619
  let grain;
1616
1620
  if (paper && depth > 0) {
1617
1621
  const g = paperGrain(paper);
1618
- const ox = _nullishCoalesce(_optionalChain([ch, 'access', _27 => _27.origin, 'optionalAccess', _28 => _28.x]), () => ( 0));
1619
- const oy = _nullishCoalesce(_optionalChain([ch, 'access', _29 => _29.origin, 'optionalAccess', _30 => _30.y]), () => ( 0));
1622
+ const ox = _nullishCoalesce(_optionalChain([ch, 'access', _31 => _31.origin, 'optionalAccess', _32 => _32.x]), () => ( 0));
1623
+ const oy = _nullishCoalesce(_optionalChain([ch, 'access', _33 => _33.origin, 'optionalAccess', _34 => _34.y]), () => ( 0));
1620
1624
  const k = (finite2(ch.unit) && ch.unit > 0 ? ch.unit : 1) / scale;
1621
1625
  grain = { depth, at: (x, y) => g.at(ox + x * k, oy + y * k) };
1622
1626
  }
@@ -1734,7 +1738,7 @@ var PaintExchange = (_class7 = class {
1734
1738
  }
1735
1739
  /** The prepared pigment of the last `paint` colour (pigment mixing only), for `deposit`. */
1736
1740
  get paintPigment() {
1737
- return _nullishCoalesce(_optionalChain([this, 'access', _31 => _31.pig, 'optionalAccess', _32 => _32.paint]), () => ( null));
1741
+ return _nullishCoalesce(_optionalChain([this, 'access', _35 => _35.pig, 'optionalAccess', _36 => _36.paint]), () => ( null));
1738
1742
  }
1739
1743
  /** Recolours the reservoir without refilling it (a multi-coloured brush, per dab). */
1740
1744
  setReservoirColor(r, g, b) {
@@ -1771,7 +1775,7 @@ var PaintExchange = (_class7 = class {
1771
1775
  if (!this.well) this.well = [sample.rgb[0], sample.rgb[1], sample.rgb[2]];
1772
1776
  else {
1773
1777
  if (pig) _chunkCWM3CUUXcjs.setPigmentColor.call(void 0, pig.canvas, sample.rgb[0], sample.rgb[1], sample.rgb[2]);
1774
- const o = this.mix(this.well, _nullishCoalesce(_optionalChain([pig, 'optionalAccess', _33 => _33.well]), () => ( null)), sample.rgb, _nullishCoalesce(_optionalChain([pig, 'optionalAccess', _34 => _34.canvas]), () => ( null)), this.rates.pickup * sample.contact);
1778
+ const o = this.mix(this.well, _nullishCoalesce(_optionalChain([pig, 'optionalAccess', _37 => _37.well]), () => ( null)), sample.rgb, _nullishCoalesce(_optionalChain([pig, 'optionalAccess', _38 => _38.canvas]), () => ( null)), this.rates.pickup * sample.contact);
1775
1779
  this.well = [o[0], o[1], o[2]];
1776
1780
  }
1777
1781
  if (pig) _chunkCWM3CUUXcjs.setPigmentColor.call(void 0, pig.well, this.well[0], this.well[1], this.well[2]);
@@ -1789,7 +1793,7 @@ var PaintExchange = (_class7 = class {
1789
1793
  if (!(total > 1e-6)) return 0;
1790
1794
  const pig = this.pig;
1791
1795
  if (res && this.well) {
1792
- const m = this.mix(res, _nullishCoalesce(_optionalChain([pig, 'optionalAccess', _35 => _35.res]), () => ( null)), this.well, _nullishCoalesce(_optionalChain([pig, 'optionalAccess', _36 => _36.well]), () => ( null)), wp / total);
1796
+ const m = this.mix(res, _nullishCoalesce(_optionalChain([pig, 'optionalAccess', _39 => _39.res]), () => ( null)), this.well, _nullishCoalesce(_optionalChain([pig, 'optionalAccess', _40 => _40.well]), () => ( null)), wp / total);
1793
1797
  out[0] = m[0];
1794
1798
  out[1] = m[1];
1795
1799
  out[2] = m[2];
@@ -5,7 +5,7 @@ import {
5
5
  dabRect,
6
6
  put255,
7
7
  rasterizeDab
8
- } from "./chunk-AGZ47XY2.js";
8
+ } from "./chunk-2N2QPO3H.js";
9
9
  import {
10
10
  TILE,
11
11
  blendPixel,
@@ -74,7 +74,7 @@ function profileAlongPolyline(points, values, count = 32) {
74
74
  var round3 = (v) => Math.round(v * 1e3) / 1e3;
75
75
  var loading = null;
76
76
  function loadCanvasBrushstrokeRenderer() {
77
- loading ??= Promise.resolve().then(() => _interopRequireWildcard(require("./brushstrokeRender-YAZVQUXY.cjs"))).catch((error) => {
77
+ loading ??= Promise.resolve().then(() => _interopRequireWildcard(require("./brushstrokeRender-5WANQIG4.cjs"))).catch((error) => {
78
78
  loading = null;
79
79
  throw error;
80
80
  });
@@ -20,7 +20,7 @@
20
20
 
21
21
 
22
22
 
23
- var _chunkLRRCMRSLcjs = require('./chunk-LRRCMRSL.cjs');
23
+ var _chunkEBDCRTZIcjs = require('./chunk-EBDCRTZI.cjs');
24
24
 
25
25
 
26
26
 
@@ -73,7 +73,13 @@ function paperPreset(id) {
73
73
  return p ? clonePaper(p) : void 0;
74
74
  }
75
75
  function clonePaper(p) {
76
- return { ...p, dry: { ...p.dry }, wet: { ...p.wet } };
76
+ return { ...p, dry: { ...p.dry }, wet: { ...p.wet }, ...p.offset ? { offset: { ...p.offset } } : {} };
77
+ }
78
+ function readOffset(raw, d) {
79
+ const o = raw && typeof raw === "object" ? raw : null;
80
+ const x = o && typeof o.x === "number" && Number.isFinite(o.x) ? Math.round(o.x) : _nullishCoalesce(_optionalChain([d, 'optionalAccess', _3 => _3.x]), () => ( 0));
81
+ const y = o && typeof o.y === "number" && Number.isFinite(o.y) ? Math.round(o.y) : _nullishCoalesce(_optionalChain([d, 'optionalAccess', _4 => _4.y]), () => ( 0));
82
+ return x || y ? { offset: { x, y } } : {};
77
83
  }
78
84
  function readTuning(raw, d) {
79
85
  const r = raw && typeof raw === "object" ? raw : {};
@@ -86,7 +92,7 @@ function normalizePaper(raw = {}, base) {
86
92
  preset: typeof r.preset === "string" && r.preset ? r.preset : b.preset,
87
93
  name: typeof r.name === "string" && r.name.trim() ? r.name.trim() : b.name,
88
94
  family: PAPER_FAMILIES.includes(r.family) ? r.family : b.family,
89
- pattern: _chunkLRRCMRSLcjs.GRAIN_PATTERNS.includes(r.pattern) ? r.pattern : b.pattern,
95
+ pattern: _chunkEBDCRTZIcjs.GRAIN_PATTERNS.includes(r.pattern) ? r.pattern : b.pattern,
90
96
  seed: typeof r.seed === "number" && Number.isFinite(r.seed) ? Math.round(Math.abs(r.seed)) % 2147483647 : b.seed,
91
97
  color: typeof r.color === "string" && HEX.test(r.color) ? r.color.toLowerCase() : b.color,
92
98
  scale: clampNum(r.scale, 0.25, 8, b.scale),
@@ -98,14 +104,15 @@ function normalizePaper(raw = {}, base) {
98
104
  absorption: unit(r.absorption, b.absorption),
99
105
  permeability: unit(r.permeability, b.permeability),
100
106
  roughness: unit(r.roughness, b.roughness),
101
- ...unit(r.metallic, _nullishCoalesce(b.metallic, () => ( 0))) > 0 ? { metallic: unit(r.metallic, _nullishCoalesce(b.metallic, () => ( 0))) } : {}
107
+ ...unit(r.metallic, _nullishCoalesce(b.metallic, () => ( 0))) > 0 ? { metallic: unit(r.metallic, _nullishCoalesce(b.metallic, () => ( 0))) } : {},
108
+ ...readOffset(r.offset, b.offset)
102
109
  };
103
110
  }
104
111
  function hexToRgb8(hex) {
105
112
  const n = parseInt(hex.slice(1, 7), 16);
106
113
  return [n >> 16 & 255, n >> 8 & 255, n & 255];
107
114
  }
108
- function renderPaper(paper, rect, grain = new (0, _chunkLRRCMRSLcjs.PaperGrain)(paper), light) {
115
+ function renderPaper(paper, rect, grain = new (0, _chunkEBDCRTZIcjs.PaperGrain)(paper), light) {
109
116
  const [r, g, b] = hexToRgb8(paper.color);
110
117
  const out = new Uint8ClampedArray(rect.width * rect.height * 4);
111
118
  const shade = grain.flat ? 0 : paper.shading * 0.16;
@@ -267,22 +274,22 @@ var PenDabWalker = (_class2 = class {
267
274
  const i = this.index++;
268
275
  const seed = this.seed;
269
276
  let diameter = this.diameter(s);
270
- if (dyn.sizeJitter) diameter *= Math.max(0.05, 1 + dyn.sizeJitter * _chunkLRRCMRSLcjs.randSigned.call(void 0, seed, i, 1 /* Size */));
277
+ if (dyn.sizeJitter) diameter *= Math.max(0.05, 1 + dyn.sizeJitter * _chunkEBDCRTZIcjs.randSigned.call(void 0, seed, i, 1 /* Size */));
271
278
  const base = tip.angle * Math.PI / 180;
272
279
  let angle;
273
280
  if (rotation === "stroke") angle = this.dir + base;
274
281
  else if (rotation === "barrel" && s.twist !== null) angle = this.mapAngle(base - s.twist * Math.PI / 180);
275
282
  else if (dyn.tiltRoundness > 0 && s.lean > 0.02) angle = this.mapAngle(base - s.azimuth);
276
283
  else angle = this.mapAngle(base);
277
- if (dyn.angleJitter) angle += dyn.angleJitter * Math.PI * _chunkLRRCMRSLcjs.randSigned.call(void 0, seed, i, 2 /* Angle */);
284
+ if (dyn.angleJitter) angle += dyn.angleJitter * Math.PI * _chunkEBDCRTZIcjs.randSigned.call(void 0, seed, i, 2 /* Angle */);
278
285
  let opacity = tip.pressureOpacity ? s.pressure : 1;
279
286
  opacity *= 1 - dyn.tiltOpacity * s.lean * 0.8;
280
287
  if (s.speed !== null && dyn.velocityOpacity) opacity *= Math.max(0, 1 + dyn.velocityOpacity * (Math.min(1, s.speed / FULL_SPEED) - 0.5));
281
- if (dyn.opacityJitter) opacity *= 1 - dyn.opacityJitter * (_chunkLRRCMRSLcjs.randSigned.call(void 0, seed, i, 3 /* Opacity */) * 0.5 + 0.5);
288
+ if (dyn.opacityJitter) opacity *= 1 - dyn.opacityJitter * (_chunkEBDCRTZIcjs.randSigned.call(void 0, seed, i, 3 /* Opacity */) * 0.5 + 0.5);
282
289
  const flow = tip.flow * (1 - dyn.pressureFlow + dyn.pressureFlow * s.pressure);
283
290
  let { x, y } = s;
284
291
  if (dyn.scatter) {
285
- const off = dyn.scatter * diameter * _chunkLRRCMRSLcjs.randSigned.call(void 0, seed, i, 4 /* Scatter */);
292
+ const off = dyn.scatter * diameter * _chunkEBDCRTZIcjs.randSigned.call(void 0, seed, i, 4 /* Scatter */);
286
293
  x += Math.sin(this.dir) * off;
287
294
  y += Math.cos(this.dir) * off;
288
295
  }
@@ -366,13 +373,13 @@ var DryStroke = (_class3 = class {
366
373
  this.brush = brush;
367
374
  this.options = options;
368
375
  this.smoother = new PenSmoother(brush.tip.smoothing, brush.pressureSmoothing);
369
- this.copies = _optionalChain([options, 'access', _3 => _3.copies, 'optionalAccess', _4 => _4.length]) ? options.copies : [IDENTITY_COPY];
376
+ this.copies = _optionalChain([options, 'access', _5 => _5.copies, 'optionalAccess', _6 => _6.length]) ? options.copies : [IDENTITY_COPY];
370
377
  this.walkers = this.copies.map((c, i) => new PenDabWalker(brush, (_nullishCoalesce(options.seed, () => ( 0))) + i * 7919 | 0, c.linear));
371
378
  this.depth = options.grain && !options.grain.flat ? Math.min(1, Math.max(0, options.paperDepth * brush.grain)) : 0;
372
379
  }
373
380
 
374
381
 
375
- __init12() {this.coverage = new (0, _chunkLRRCMRSLcjs.CoverageMap)()}
382
+ __init12() {this.coverage = new (0, _chunkEBDCRTZIcjs.CoverageMap)()}
376
383
  __init13() {this.dabCount = 0}
377
384
 
378
385
 
@@ -406,16 +413,16 @@ var DryStroke = (_class3 = class {
406
413
  const hardness = this.brush.tip.hardness;
407
414
  const grain = this.options.grain;
408
415
  for (const d of dabs) {
409
- const rect = _chunkLRRCMRSLcjs.dabRect.call(void 0, d, hardness);
416
+ const rect = _chunkEBDCRTZIcjs.dabRect.call(void 0, d, hardness);
410
417
  const n = rect.width * rect.height;
411
418
  if (this.buf.length < n) this.buf = new Float32Array(n);
412
419
  const vals = this.buf.subarray(0, n);
413
- _chunkLRRCMRSLcjs.rasterizeDab.call(void 0, d, hardness, rect, vals);
420
+ _chunkEBDCRTZIcjs.rasterizeDab.call(void 0, d, hardness, rect, vals);
414
421
  if (this.depth > 0 && grain) {
415
422
  for (let yy = 0, k = 0; yy < rect.height; yy++) {
416
423
  const y = rect.y + yy + 0.5;
417
424
  for (let xx = 0; xx < rect.width; xx++, k++) {
418
- if (vals[k] > 0) vals[k] *= _chunkLRRCMRSLcjs.grainCatch.call(void 0, grain.at(rect.x + xx + 0.5, y), this.depth, d.pressure);
425
+ if (vals[k] > 0) vals[k] *= _chunkEBDCRTZIcjs.grainCatch.call(void 0, grain.at(rect.x + xx + 0.5, y), this.depth, d.pressure);
419
426
  }
420
427
  }
421
428
  }
@@ -488,14 +495,14 @@ function stampCoverage(kind, u, v, t) {
488
495
  }
489
496
  case "splat": {
490
497
  let rr = 0.55;
491
- for (let k = 1; k <= 3; k++) rr += 0.08 * Math.sin(a * (k + 2) + _chunkLRRCMRSLcjs.hash2.call(void 0, k, 1, t) * 6.28) / k;
498
+ for (let k = 1; k <= 3; k++) rr += 0.08 * Math.sin(a * (k + 2) + _chunkEBDCRTZIcjs.hash2.call(void 0, k, 1, t) * 6.28) / k;
492
499
  let c = edge(rr - r);
493
500
  for (let k = 0; k < 4; k++) {
494
- const ang = _chunkLRRCMRSLcjs.hash2.call(void 0, k, 7, t) * Math.PI * 2;
495
- const dist = 0.72 + 0.2 * _chunkLRRCMRSLcjs.hash2.call(void 0, k, 9, t);
501
+ const ang = _chunkEBDCRTZIcjs.hash2.call(void 0, k, 7, t) * Math.PI * 2;
502
+ const dist = 0.72 + 0.2 * _chunkEBDCRTZIcjs.hash2.call(void 0, k, 9, t);
496
503
  const dx = u - Math.cos(ang) * dist;
497
504
  const dy = v - Math.sin(ang) * dist;
498
- c = Math.max(c, edge(0.08 + 0.06 * _chunkLRRCMRSLcjs.hash2.call(void 0, k, 11, t) - Math.hypot(dx, dy)));
505
+ c = Math.max(c, edge(0.08 + 0.06 * _chunkEBDCRTZIcjs.hash2.call(void 0, k, 11, t) - Math.hypot(dx, dy)));
499
506
  }
500
507
  return c;
501
508
  }
@@ -533,7 +540,7 @@ function drawSticker(medium, s) {
533
540
  c /= 4;
534
541
  if (c <= 0) continue;
535
542
  cov[p] = c;
536
- const shade = 1 + 0.12 * (-(u + v) / 2) + 0.06 * (_chunkLRRCMRSLcjs.hash2.call(void 0, px, rect.y + yy, s.seed) - 0.5);
543
+ const shade = 1 + 0.12 * (-(u + v) / 2) + 0.06 * (_chunkEBDCRTZIcjs.hash2.call(void 0, px, rect.y + yy, s.seed) - 0.5);
537
544
  field[p * 3] = Math.min(1, Math.max(0, r * shade));
538
545
  field[p * 3 + 1] = Math.min(1, Math.max(0, g * shade));
539
546
  field[p * 3 + 2] = Math.min(1, Math.max(0, b * shade));
@@ -544,8 +551,8 @@ function drawSticker(medium, s) {
544
551
  }
545
552
  function jitterColor(hex, amount, seed, i) {
546
553
  const [r, g, b] = hexRgb(hex);
547
- const l = (_chunkLRRCMRSLcjs.rand01.call(void 0, seed, i, 61) - 0.5) * amount * 0.6;
548
- const h = (_chunkLRRCMRSLcjs.rand01.call(void 0, seed, i, 63) - 0.5) * amount;
554
+ const l = (_chunkEBDCRTZIcjs.rand01.call(void 0, seed, i, 61) - 0.5) * amount * 0.6;
555
+ const h = (_chunkEBDCRTZIcjs.rand01.call(void 0, seed, i, 63) - 0.5) * amount;
549
556
  const m = (r + g + b) / 3;
550
557
  const rot = (c0, c1) => c0 + (c1 - c0) * h;
551
558
  const out = [rot(r, g), rot(g, b), rot(b, r)].map((c) => Math.min(1, Math.max(0, c + l + (c - m) * 0)));
@@ -560,7 +567,7 @@ var StickerSpray = (_class4 = class {
560
567
  const spacing = Math.max(0.05, 1 / Math.max(0.05, b.sticker.density * 4));
561
568
  const walk = { ...b, tip: { ...b.tip, spacing }, dynamics: { ...b.dynamics, scatter: 0, sizeJitter: 0, angleJitter: 0 } };
562
569
  this.walkers = this.copies.map((c, i) => new PenDabWalker(walk, init.seed + i * 7919 | 0, c.linear));
563
- this.medium = new (0, _chunkLRRCMRSLcjs.TileMedium)(init.target, {});
570
+ this.medium = new (0, _chunkEBDCRTZIcjs.TileMedium)(init.target, {});
564
571
  this.next = init.nextId;
565
572
  }
566
573
 
@@ -603,21 +610,21 @@ var StickerSpray = (_class4 = class {
603
610
  const st = this.init.brush.sticker;
604
611
  const i = this.next;
605
612
  const seed = this.init.seed;
606
- const size = d.radius * 2 * (1 - st.sizeJitter * 0.7 * _chunkLRRCMRSLcjs.rand01.call(void 0, seed, i, 51));
613
+ const size = d.radius * 2 * (1 - st.sizeJitter * 0.7 * _chunkEBDCRTZIcjs.rand01.call(void 0, seed, i, 51));
607
614
  const off = st.scatter * d.radius * 2;
608
- const a = _chunkLRRCMRSLcjs.rand01.call(void 0, seed, i, 53) * Math.PI * 2;
609
- const dist = _chunkLRRCMRSLcjs.rand01.call(void 0, seed, i, 55) * off;
615
+ const a = _chunkEBDCRTZIcjs.rand01.call(void 0, seed, i, 53) * Math.PI * 2;
616
+ const dist = _chunkEBDCRTZIcjs.rand01.call(void 0, seed, i, 55) * off;
610
617
  const base = this.colorAt(d, Math.cos(a) * dist, Math.sin(a) * dist);
611
618
  const sticker = {
612
619
  id: `st${this.next++}`,
613
- stamp: _nullishCoalesce(st.stamps[Math.floor(_chunkLRRCMRSLcjs.rand01.call(void 0, seed, i, 57) * st.stamps.length)], () => ( "dot")),
620
+ stamp: _nullishCoalesce(st.stamps[Math.floor(_chunkEBDCRTZIcjs.rand01.call(void 0, seed, i, 57) * st.stamps.length)], () => ( "dot")),
614
621
  x: Math.round((d.x + Math.cos(a) * dist) * 100) / 100,
615
622
  y: Math.round((d.y + Math.sin(a) * dist) * 100) / 100,
616
623
  size: Math.max(2, Math.round(size * 10) / 10),
617
- rotation: Math.round((-d.angle * 180 / Math.PI + (_chunkLRRCMRSLcjs.rand01.call(void 0, seed, i, 59) * 2 - 1) * 180 * st.rotationJitter) * 10) / 10,
624
+ rotation: Math.round((-d.angle * 180 / Math.PI + (_chunkEBDCRTZIcjs.rand01.call(void 0, seed, i, 59) * 2 - 1) * 180 * st.rotationJitter) * 10) / 10,
618
625
  color: st.colorJitter > 0 ? jitterColor(base.color, st.colorJitter, seed, i) : base.color,
619
626
  opacity: Math.round(Math.min(1, d.opacity * this.init.brush.tip.opacity * base.alpha) * 1e3) / 1e3,
620
- seed: Math.floor(_chunkLRRCMRSLcjs.rand01.call(void 0, seed, i, 65) * 1e9)
627
+ seed: Math.floor(_chunkEBDCRTZIcjs.rand01.call(void 0, seed, i, 65) * 1e9)
621
628
  };
622
629
  this.stickers.push(sticker);
623
630
  rects.push(drawSticker(this.medium, sticker));
@@ -628,13 +635,13 @@ var StickerSpray = (_class4 = class {
628
635
  colorAt(d, dx, dy) {
629
636
  const g = this.init.paint;
630
637
  if (!g) return { color: this.init.color, alpha: 1 };
631
- this.sampler ??= new (0, _chunkLRRCMRSLcjs.PaintGradientSampler)(g, this.init.seed);
638
+ this.sampler ??= new (0, _chunkEBDCRTZIcjs.PaintGradientSampler)(g, this.init.seed);
632
639
  const s = g.map.by === "across-tip" ? this.sampler.sample(((dx * Math.sin(d.direction) + dy * Math.cos(d.direction)) / Math.max(0.5, d.radius) + 1) / 2) : this.sampler.dab(d);
633
640
  return { color: "#" + s.rgb.map((c) => Math.round(Math.min(1, Math.max(0, c)) * 255).toString(16).padStart(2, "0")).join(""), alpha: s.alpha };
634
641
  }
635
642
  }, _class4);
636
643
  function renderStickers(stickers, target) {
637
- const medium = new (0, _chunkLRRCMRSLcjs.TileMedium)(target, {});
644
+ const medium = new (0, _chunkEBDCRTZIcjs.TileMedium)(target, {});
638
645
  for (const s of stickers) drawSticker(medium, s);
639
646
  }
640
647
  function normalizeStickerUpdate(u) {
@@ -694,10 +701,10 @@ var MarkStroke = (_class5 = class {
694
701
  constructor(brush, options) {;_class5.prototype.__init21.call(this);_class5.prototype.__init22.call(this);_class5.prototype.__init23.call(this);_class5.prototype.__init24.call(this);_class5.prototype.__init25.call(this);_class5.prototype.__init26.call(this);_class5.prototype.__init27.call(this);
695
702
  this.brush = brush;
696
703
  this.options = options;
697
- this.sampler = options.paint ? new (0, _chunkLRRCMRSLcjs.PaintGradientSampler)(options.paint, _nullishCoalesce(options.seed, () => ( 0))) : null;
698
- this.tipTable = _optionalChain([this, 'access', _5 => _5.sampler, 'optionalAccess', _6 => _6.acrossTip]) ? this.sampler.tipTable(_chunkLRRCMRSLcjs.TIP_GRADIENT_STEPS) : null;
704
+ this.sampler = options.paint ? new (0, _chunkEBDCRTZIcjs.PaintGradientSampler)(options.paint, _nullishCoalesce(options.seed, () => ( 0))) : null;
705
+ this.tipTable = _optionalChain([this, 'access', _7 => _7.sampler, 'optionalAccess', _8 => _8.acrossTip]) ? this.sampler.tipTable(_chunkEBDCRTZIcjs.TIP_GRADIENT_STEPS) : null;
699
706
  this.smoother = new PenSmoother(brush.tip.smoothing, brush.pressureSmoothing);
700
- this.copies = _optionalChain([options, 'access', _7 => _7.copies, 'optionalAccess', _8 => _8.length]) ? options.copies : [IDENTITY_COPY];
707
+ this.copies = _optionalChain([options, 'access', _9 => _9.copies, 'optionalAccess', _10 => _10.length]) ? options.copies : [IDENTITY_COPY];
701
708
  this.seed = _nullishCoalesce(options.seed, () => ( 0));
702
709
  const fine = { ...brush, tip: { ...brush.tip, spacing: Math.max(0.01, Math.min(0.25, STEP_PX / Math.max(1, brush.tip.size))) } };
703
710
  this.walkers = this.copies.map((c, i) => new PenDabWalker(fine, (_nullishCoalesce(options.seed, () => ( 0))) + i * 7919 | 0, c.linear));
@@ -705,7 +712,7 @@ var MarkStroke = (_class5 = class {
705
712
  }
706
713
 
707
714
 
708
- __init21() {this.coverage = new (0, _chunkLRRCMRSLcjs.CoverageMap)()}
715
+ __init21() {this.coverage = new (0, _chunkEBDCRTZIcjs.CoverageMap)()}
709
716
  __init22() {this.dabCount = 0}
710
717
 
711
718
 
@@ -767,16 +774,16 @@ var MarkStroke = (_class5 = class {
767
774
  if (!(r > 0.05) || !(alpha > 0)) return;
768
775
  const dab = { x, y, radius: Math.max(0.5, r), alpha: Math.min(1, alpha), opacity: Math.min(1, opacity), angle: 0, roundness: 1 };
769
776
  const hardness = this.brush.tip.hardness;
770
- const rect = _chunkLRRCMRSLcjs.dabRect.call(void 0, dab, hardness);
777
+ const rect = _chunkEBDCRTZIcjs.dabRect.call(void 0, dab, hardness);
771
778
  const n = rect.width * rect.height;
772
779
  if (n <= 0) return;
773
780
  if (this.buf.length < n) this.buf = new Float32Array(n);
774
781
  const vals = this.buf.subarray(0, n);
775
- _chunkLRRCMRSLcjs.rasterizeDab.call(void 0, dab, hardness, rect, vals);
782
+ _chunkEBDCRTZIcjs.rasterizeDab.call(void 0, dab, hardness, rect, vals);
776
783
  const grain = this.options.grain;
777
784
  if (this.depth > 0 && grain) {
778
785
  for (let yy = 0, k = 0; yy < rect.height; yy++)
779
- for (let xx = 0; xx < rect.width; xx++, k++) if (vals[k] > 0) vals[k] *= _chunkLRRCMRSLcjs.grainCatch.call(void 0, grain.at(rect.x + xx + 0.5, rect.y + yy + 0.5), this.depth, pressure);
786
+ for (let xx = 0; xx < rect.width; xx++, k++) if (vals[k] > 0) vals[k] *= _chunkEBDCRTZIcjs.grainCatch.call(void 0, grain.at(rect.x + xx + 0.5, rect.y + yy + 0.5), this.depth, pressure);
780
787
  }
781
788
  const color = this.markColor(x, y);
782
789
  if (color && color.alpha < 1) for (let k = 0; k < n; k++) vals[k] *= color.alpha;
@@ -819,7 +826,7 @@ function curl(x, y, seed) {
819
826
  const fy = v - y0;
820
827
  const sx = fx * fx * (3 - 2 * fx);
821
828
  const sy = fy * fy * (3 - 2 * fy);
822
- const h = (a2, b2) => _chunkLRRCMRSLcjs.rand01.call(void 0, seed, a2 * 73856093 + b2 * 19349663, 41);
829
+ const h = (a2, b2) => _chunkEBDCRTZIcjs.rand01.call(void 0, seed, a2 * 73856093 + b2 * 19349663, 41);
823
830
  const a = h(x0, y0);
824
831
  const b = h(x0 + 1, y0);
825
832
  const c = h(x0, y0 + 1);
@@ -843,11 +850,11 @@ var ParticleStroke = (_class6 = class extends MarkStroke {
843
850
  const list = this.sets[copy];
844
851
  const size = Math.max(1, d.radius * 2);
845
852
  for (let i = 0; i < (s.kind === "flow" ? 0 : s.count); i++) {
846
- const r = _chunkLRRCMRSLcjs.rand01.call(void 0, this.seed, i, 3 + copy) * s.spread * size * 0.5;
847
- const a = _chunkLRRCMRSLcjs.rand01.call(void 0, this.seed, i, 5 + copy) * Math.PI * 2;
853
+ const r = _chunkEBDCRTZIcjs.rand01.call(void 0, this.seed, i, 3 + copy) * s.spread * size * 0.5;
854
+ const a = _chunkEBDCRTZIcjs.rand01.call(void 0, this.seed, i, 5 + copy) * Math.PI * 2;
848
855
  const ox = Math.cos(a) * r;
849
856
  const oy = Math.sin(a) * r;
850
- const p = { x: d.x + ox, y: d.y + oy, vx: 0, vy: 0, ox, oy, k: 0.6 + 0.8 * _chunkLRRCMRSLcjs.rand01.call(void 0, this.seed, i, 7), phase: a, age: 0, run: 0, bead: 0, alive: true };
857
+ const p = { x: d.x + ox, y: d.y + oy, vx: 0, vy: 0, ox, oy, k: 0.6 + 0.8 * _chunkEBDCRTZIcjs.rand01.call(void 0, this.seed, i, 7), phase: a, age: 0, run: 0, bead: 0, alive: true };
851
858
  if (s.kind === "string") p.strand = Array.from({ length: 6 }, () => ({ x: d.x + ox, y: d.y + oy, vx: 0, vy: 0 }));
852
859
  if (s.kind === "orbit") {
853
860
  p.ox = Math.max(1, r + size * 0.15);
@@ -872,8 +879,8 @@ var ParticleStroke = (_class6 = class extends MarkStroke {
872
879
  while (this.spawn >= 1) {
873
880
  this.spawn -= 1;
874
881
  const i = this.dabCount + list.length * 31 + Math.floor(d.index);
875
- const a = _chunkLRRCMRSLcjs.rand01.call(void 0, this.seed, i, 11 + copy) * Math.PI * 2;
876
- const r = _chunkLRRCMRSLcjs.rand01.call(void 0, this.seed, i, 13 + copy) * s.spread * size * 0.5;
882
+ const a = _chunkEBDCRTZIcjs.rand01.call(void 0, this.seed, i, 11 + copy) * Math.PI * 2;
883
+ const r = _chunkEBDCRTZIcjs.rand01.call(void 0, this.seed, i, 13 + copy) * s.spread * size * 0.5;
877
884
  list.push({ x: d.x + Math.cos(a) * r, y: d.y + Math.sin(a) * r, vx: 0, vy: 0, ox: 0, oy: 0, k: 1, phase: a, age: 0, run: 0, bead: 0, alive: true });
878
885
  }
879
886
  }
@@ -908,7 +915,7 @@ var ParticleStroke = (_class6 = class extends MarkStroke {
908
915
  break;
909
916
  }
910
917
  case "orbit": {
911
- p.phase += (0.05 + 0.3 * s.speed) * (i % 2 ? -1 : 1) * (0.7 + 0.6 * _chunkLRRCMRSLcjs.rand01.call(void 0, this.seed, i, 17));
918
+ p.phase += (0.05 + 0.3 * s.speed) * (i % 2 ? -1 : 1) * (0.7 + 0.6 * _chunkEBDCRTZIcjs.rand01.call(void 0, this.seed, i, 17));
912
919
  p.x = d.x + Math.cos(p.phase) * p.ox;
913
920
  p.y = d.y + Math.sin(p.phase) * p.ox + g * p.ox;
914
921
  break;
@@ -967,16 +974,16 @@ var BristleStroke = class extends MarkStroke {
967
974
  const s = this.s;
968
975
  this.tufts = this.copies.map(
969
976
  (_, c) => Array.from({ length: s.count }, (_2, i) => {
970
- const a = _chunkLRRCMRSLcjs.rand01.call(void 0, this.seed, i, 21 + c) * Math.PI * 2;
971
- const r = Math.sqrt(_chunkLRRCMRSLcjs.rand01.call(void 0, this.seed, i, 23 + c));
977
+ const a = _chunkEBDCRTZIcjs.rand01.call(void 0, this.seed, i, 21 + c) * Math.PI * 2;
978
+ const r = Math.sqrt(_chunkEBDCRTZIcjs.rand01.call(void 0, this.seed, i, 23 + c));
972
979
  return {
973
980
  u: Math.cos(a) * r,
974
981
  v: Math.sin(a) * r,
975
982
  x: 0,
976
983
  y: 0,
977
- paint: 1 - s.jitter * 0.4 * _chunkLRRCMRSLcjs.rand01.call(void 0, this.seed, i, 25 + c),
978
- thirst: 1 + s.jitter * (_chunkLRRCMRSLcjs.rand01.call(void 0, this.seed, i, 27 + c) * 2 - 1),
979
- w: 1 + s.jitter * 0.6 * (_chunkLRRCMRSLcjs.rand01.call(void 0, this.seed, i, 29 + c) - 0.5),
984
+ paint: 1 - s.jitter * 0.4 * _chunkEBDCRTZIcjs.rand01.call(void 0, this.seed, i, 25 + c),
985
+ thirst: 1 + s.jitter * (_chunkEBDCRTZIcjs.rand01.call(void 0, this.seed, i, 27 + c) * 2 - 1),
986
+ w: 1 + s.jitter * 0.6 * (_chunkEBDCRTZIcjs.rand01.call(void 0, this.seed, i, 29 + c) - 0.5),
980
987
  started: false
981
988
  };
982
989
  })
@@ -1175,12 +1182,12 @@ function normalizePaintBrush(raw = {}, base) {
1175
1182
  if (rb.dirty !== void 0) mixerIn.cleanEachStroke = !rb.dirty;
1176
1183
  if (rb.mixing !== void 0) mixerIn.mixing = rb.mixing;
1177
1184
  }
1178
- const mixer = _chunkLRRCMRSLcjs.normalizeMixer.call(void 0, mixerIn);
1185
+ const mixer = _chunkEBDCRTZIcjs.normalizeMixer.call(void 0, mixerIn);
1179
1186
  let behavior = normalizeBehavior(rb, b.behavior);
1180
1187
  if (engine === "mixer") behavior = { ...behavior, pickup: mixer.wet, mix: mixer.mix, dirty: !mixer.cleanEachStroke, mixing: mixer.mixing };
1181
1188
  let paint = _nullishCoalesce(b.paint, () => ( null));
1182
1189
  if (raw.paint !== void 0) {
1183
- const p = _chunkLRRCMRSLcjs.readPaintSource.call(void 0, raw.paint);
1190
+ const p = _chunkEBDCRTZIcjs.readPaintSource.call(void 0, raw.paint);
1184
1191
  paint = p && p.type === "gradient" ? p : null;
1185
1192
  } else if (rb.multicolor !== void 0) {
1186
1193
  const mc = normalizeMultiColor(rb.multicolor, _nullishCoalesce(paintToMultiColor(paint), () => ( DEFAULT_MULTI_COLOR)));
@@ -1192,7 +1199,7 @@ function normalizePaintBrush(raw = {}, base) {
1192
1199
  name: typeof raw.name === "string" && raw.name.trim() ? raw.name.trim().slice(0, 80) : b.name,
1193
1200
  category: PAINT_BRUSH_CATEGORIES.includes(raw.category) ? raw.category : b.category,
1194
1201
  engine,
1195
- tip: _chunkLRRCMRSLcjs.normalizeBrush.call(void 0, { ...b.tip, ..._nullishCoalesce(raw.tip, () => ( {})) }),
1202
+ tip: _chunkEBDCRTZIcjs.normalizeBrush.call(void 0, { ...b.tip, ..._nullishCoalesce(raw.tip, () => ( {})) }),
1196
1203
  grain: unit4(raw.grain, b.grain),
1197
1204
  pressureSmoothing: range(raw.pressureSmoothing, 0, 0.95, b.pressureSmoothing),
1198
1205
  rotation: BRUSH_ROTATIONS.includes(raw.rotation) ? raw.rotation : b.rotation,
@@ -1200,8 +1207,8 @@ function normalizePaintBrush(raw = {}, base) {
1200
1207
  mixer,
1201
1208
  loadsColor: typeof raw.loadsColor === "boolean" ? raw.loadsColor : b.loadsColor,
1202
1209
  behavior,
1203
- blender: _chunkLRRCMRSLcjs.normalizeBlender.call(void 0, _nullishCoalesce(raw.blender, () => ( {})), b.blender),
1204
- smudge: _chunkLRRCMRSLcjs.normalizeSmudge.call(void 0, _nullishCoalesce(raw.smudge, () => ( {})), b.smudge),
1210
+ blender: _chunkEBDCRTZIcjs.normalizeBlender.call(void 0, _nullishCoalesce(raw.blender, () => ( {})), b.blender),
1211
+ smudge: _chunkEBDCRTZIcjs.normalizeSmudge.call(void 0, _nullishCoalesce(raw.smudge, () => ( {})), b.smudge),
1205
1212
  wet: normalizeWetBrush(_nullishCoalesce(raw.wet, () => ( {})), _nullishCoalesce(b.wet, () => ( DEFAULT_WET_BRUSH))),
1206
1213
  impasto: normalizeImpasto(_nullishCoalesce(raw.impasto, () => ( {})), _nullishCoalesce(b.impasto, () => ( DEFAULT_IMPASTO))),
1207
1214
  particle: normalizeParticle(_nullishCoalesce(raw.particle, () => ( {})), _nullishCoalesce(b.particle, () => ( DEFAULT_PARTICLE))),
@@ -1216,16 +1223,16 @@ var BASE_BRUSH = {
1216
1223
  name: "Round",
1217
1224
  category: "custom",
1218
1225
  engine: "dab",
1219
- tip: { ..._chunkLRRCMRSLcjs.DEFAULT_BRUSH },
1226
+ tip: { ..._chunkEBDCRTZIcjs.DEFAULT_BRUSH },
1220
1227
  grain: 0,
1221
1228
  pressureSmoothing: 0,
1222
1229
  rotation: "fixed",
1223
1230
  dynamics: { ...DEFAULT_DYNAMICS },
1224
- mixer: { ..._chunkLRRCMRSLcjs.DEFAULT_MIXER },
1231
+ mixer: { ..._chunkEBDCRTZIcjs.DEFAULT_MIXER },
1225
1232
  loadsColor: true,
1226
1233
  behavior: { ...DEFAULT_BEHAVIOR, multicolor: { ...DEFAULT_MULTI_COLOR, colors: [] } },
1227
- blender: { ..._chunkLRRCMRSLcjs.DEFAULT_BLENDER },
1228
- smudge: { ..._chunkLRRCMRSLcjs.DEFAULT_SMUDGE },
1234
+ blender: { ..._chunkEBDCRTZIcjs.DEFAULT_BLENDER },
1235
+ smudge: { ..._chunkEBDCRTZIcjs.DEFAULT_SMUDGE },
1229
1236
  wet: { ...DEFAULT_WET_BRUSH },
1230
1237
  impasto: { ...DEFAULT_IMPASTO },
1231
1238
  particle: { ...DEFAULT_PARTICLE },