@pixerate/editor 0.259.0 → 0.260.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 (74) hide show
  1. package/dist/agent/index.cjs +2 -2
  2. package/dist/agent/index.js +1 -1
  3. package/dist/animation-editor/index.cjs +61 -59
  4. package/dist/animation-editor/index.js +5 -3
  5. package/dist/brushes/index.cjs +52 -52
  6. package/dist/brushes/index.js +6 -6
  7. package/dist/{brushstrokeRender-JI4W6F2G.js → brushstrokeRender-25Q5BEY6.js} +17 -7
  8. package/dist/{brushstrokeRender-MQ6PSDM5.cjs → brushstrokeRender-N6UPZSQS.cjs} +31 -21
  9. package/dist/canvas/brushTypes.d.cts +5 -0
  10. package/dist/canvas/brushTypes.d.ts +5 -0
  11. package/dist/canvas/drawController.d.cts +15 -1
  12. package/dist/canvas/drawController.d.ts +15 -1
  13. package/dist/canvas/index.cjs +136 -102
  14. package/dist/canvas/index.js +35 -1
  15. package/dist/{chunk-3PPJRMIG.js → chunk-3O47TPGX.js} +197 -18
  16. package/dist/{chunk-5Q5MLXAD.cjs → chunk-3TQW5MPW.cjs} +23 -23
  17. package/dist/{chunk-JBBJE76O.cjs → chunk-3ZRNK3RO.cjs} +1138 -85
  18. package/dist/{chunk-YSGW7VV4.cjs → chunk-43NT242D.cjs} +1401 -228
  19. package/dist/{chunk-SMTUQWGY.js → chunk-5IW65VQ6.js} +1 -1
  20. package/dist/{chunk-YQ4PQTBB.js → chunk-6NZL24W4.js} +9 -1
  21. package/dist/{chunk-O3ZVZSNJ.cjs → chunk-7AUQ2UJ3.cjs} +137 -129
  22. package/dist/{chunk-4M4E3N6X.js → chunk-CQVTGBQI.js} +1 -1
  23. package/dist/{chunk-SSFMWJDK.js → chunk-D4TE5JNW.js} +1192 -19
  24. package/dist/{chunk-AORZ5M5C.js → chunk-EHALWBBD.js} +1 -1
  25. package/dist/{chunk-6WCQ35GI.cjs → chunk-NHA26O5X.cjs} +2 -2
  26. package/dist/{chunk-DPYAO5U6.cjs → chunk-PVJMTLPJ.cjs} +197 -18
  27. package/dist/{chunk-MQGQTKVW.cjs → chunk-PYTJBVW5.cjs} +29 -29
  28. package/dist/{chunk-IXQZHCOF.js → chunk-QAR2N7HZ.js} +1 -1
  29. package/dist/{chunk-5P4JEOIV.js → chunk-TMDDMJCR.js} +2 -2
  30. package/dist/{chunk-RSIKDWOP.cjs → chunk-TZOX7KWV.cjs} +15 -15
  31. package/dist/{chunk-IPUTIUGQ.cjs → chunk-UVZ7RQOE.cjs} +1 -1
  32. package/dist/{chunk-A7GJ6BXI.js → chunk-WJ4WQJCC.js} +1062 -9
  33. package/dist/{chunk-ICTPLVSR.js → chunk-X2EXYY4J.js} +1 -1
  34. package/dist/{chunk-WQCNC4DK.js → chunk-XC6DPRYI.js} +695 -4
  35. package/dist/{chunk-KBYB7OWB.cjs → chunk-YHDHFJUC.cjs} +776 -85
  36. package/dist/{chunk-P3PZ63M3.cjs → chunk-YLUIFXSL.cjs} +35 -35
  37. package/dist/commands/index.cjs +2 -2
  38. package/dist/commands/index.js +1 -1
  39. package/dist/image-editor/index.cjs +1385 -2484
  40. package/dist/image-editor/index.js +139 -1238
  41. package/dist/image-editor/selection-worker.cjs +3 -4
  42. package/dist/image-editor/selection-worker.js +1 -2
  43. package/dist/paint/index.cjs +3 -5
  44. package/dist/paint/index.js +40 -42
  45. package/dist/paint-editor/contract.d.cts +29 -0
  46. package/dist/paint-editor/contract.d.ts +29 -0
  47. package/dist/paint-editor/dab-stroke.d.cts +5 -0
  48. package/dist/paint-editor/dab-stroke.d.ts +5 -0
  49. package/dist/paint-editor/index.cjs +402 -258
  50. package/dist/paint-editor/index.d.cts +1 -0
  51. package/dist/paint-editor/index.d.ts +1 -0
  52. package/dist/paint-editor/index.js +197 -53
  53. package/dist/paint-editor/stamp-tip.d.cts +17 -0
  54. package/dist/paint-editor/stamp-tip.d.ts +17 -0
  55. package/dist/paint-editor/ui.d.cts +21 -1
  56. package/dist/paint-editor/ui.d.ts +21 -1
  57. package/dist/raster/index.cjs +2 -4
  58. package/dist/raster/index.js +6 -8
  59. package/dist/vector/brushstroke.d.cts +6 -0
  60. package/dist/vector/brushstroke.d.ts +6 -0
  61. package/dist/vector/controller.d.cts +11 -2
  62. package/dist/vector/controller.d.ts +11 -2
  63. package/dist/vector/index.cjs +990 -973
  64. package/dist/vector/index.js +28 -11
  65. package/package.json +1 -1
  66. package/skills/pixerate-brushes/SKILL.md +1 -1
  67. package/skills/pixerate-canvas/SKILL.md +3 -1
  68. package/skills/pixerate-vector/SKILL.md +2 -2
  69. package/dist/chunk-2VJAVXLI.js +0 -192
  70. package/dist/chunk-62Z5WLRA.js +0 -700
  71. package/dist/chunk-BOHDJJ2O.cjs +0 -192
  72. package/dist/chunk-NKGB64CW.cjs +0 -700
  73. package/dist/chunk-SS53NNZO.cjs +0 -1066
  74. package/dist/chunk-ZNA3IQZF.js +0 -1066
@@ -11,7 +11,7 @@ var _chunkRVGP2XLFcjs = require('../chunk-RVGP2XLF.cjs');
11
11
 
12
12
 
13
13
 
14
- var _chunkMQGQTKVWcjs = require('../chunk-MQGQTKVW.cjs');
14
+ var _chunkPYTJBVW5cjs = require('../chunk-PYTJBVW5.cjs');
15
15
 
16
16
 
17
17
 
@@ -26,12 +26,10 @@ var _chunkCBVNCWJMcjs = require('../chunk-CBVNCWJM.cjs');
26
26
 
27
27
 
28
28
 
29
- var _chunkYSGW7VV4cjs = require('../chunk-YSGW7VV4.cjs');
30
- require('../chunk-SS53NNZO.cjs');
31
29
 
30
+ var _chunk43NT242Dcjs = require('../chunk-43NT242D.cjs');
31
+ require('../chunk-3ZRNK3RO.cjs');
32
32
 
33
- var _chunkLRTR4ASZcjs = require('../chunk-LRTR4ASZ.cjs');
34
- require('../chunk-A2IS7EHE.cjs');
35
33
 
36
34
 
37
35
 
@@ -47,7 +45,8 @@ require('../chunk-A2IS7EHE.cjs');
47
45
 
48
46
 
49
47
 
50
- var _chunkDPYAO5U6cjs = require('../chunk-DPYAO5U6.cjs');
48
+
49
+ var _chunkPVJMTLPJcjs = require('../chunk-PVJMTLPJ.cjs');
51
50
  require('../chunk-QT26RHKK.cjs');
52
51
  require('../chunk-K6PXS6DO.cjs');
53
52
 
@@ -74,7 +73,8 @@ require('../chunk-K6PXS6DO.cjs');
74
73
 
75
74
 
76
75
 
77
- var _chunkKBYB7OWBcjs = require('../chunk-KBYB7OWB.cjs');
76
+ var _chunkYHDHFJUCcjs = require('../chunk-YHDHFJUC.cjs');
77
+ require('../chunk-BB6TR422.cjs');
78
78
  require('../chunk-BROJYMWU.cjs');
79
79
 
80
80
 
@@ -85,7 +85,7 @@ var _chunkJLWLX52Lcjs = require('../chunk-JLWLX52L.cjs');
85
85
 
86
86
 
87
87
  var _chunkK7ENM55Pcjs = require('../chunk-K7ENM55P.cjs');
88
- require('../chunk-O3ZVZSNJ.cjs');
88
+ require('../chunk-7AUQ2UJ3.cjs');
89
89
 
90
90
 
91
91
 
@@ -140,7 +140,7 @@ require('../chunk-O3ZVZSNJ.cjs');
140
140
 
141
141
 
142
142
 
143
- var _chunkRSIKDWOPcjs = require('../chunk-RSIKDWOP.cjs');
143
+ var _chunkTZOX7KWVcjs = require('../chunk-TZOX7KWV.cjs');
144
144
 
145
145
 
146
146
 
@@ -154,6 +154,10 @@ require('../chunk-GF2RBSDM.cjs');
154
154
  require('../chunk-NM3G4VQT.cjs');
155
155
 
156
156
 
157
+ var _chunkLRTR4ASZcjs = require('../chunk-LRTR4ASZ.cjs');
158
+ require('../chunk-A2IS7EHE.cjs');
159
+
160
+
157
161
  var _chunkU67EN7GGcjs = require('../chunk-U67EN7GG.cjs');
158
162
 
159
163
 
@@ -270,6 +274,7 @@ require('../chunk-UWEQ55MY.cjs');
270
274
 
271
275
 
272
276
 
277
+
273
278
  var _chunkSJ2CPTQCcjs = require('../chunk-SJ2CPTQC.cjs');
274
279
  require('../chunk-2BSBFBOA.cjs');
275
280
  require('../chunk-4ZC5QJE2.cjs');
@@ -653,6 +658,18 @@ function brushStickerRefs(brush) {
653
658
  const refs = brush.engine === "sticker" ? [...brush.sticker.stamps] : brush.engine === "particle" ? [...brush.particle.dotTextures] : brush.engine === "dab" && brush.stamp ? [brush.stamp] : [];
654
659
  return [...new Set(refs.filter((r) => r.includes(":") && !r.startsWith("editor:")))];
655
660
  }
661
+ function sprayDroplets(d, spray, seed) {
662
+ const count = 1 + Math.round(spray.density * 31);
663
+ const key = d.index * 131 + Math.round(d.travel * 8);
664
+ const out = [];
665
+ for (let i = 0; i < count; i++) {
666
+ const n = key * 64 + i;
667
+ const a = _chunk3K6HWEXZcjs.rand01.call(void 0, seed, n, 61) * Math.PI * 2;
668
+ const rr = Math.sqrt(_chunk3K6HWEXZcjs.rand01.call(void 0, seed, n, 67)) * d.radius;
669
+ out.push({ ...d, x: d.x + Math.cos(a) * rr, y: d.y + Math.sin(a) * rr, radius: Math.max(0.5, d.radius * spray.size * (0.6 + 0.8 * _chunk3K6HWEXZcjs.rand01.call(void 0, seed, n, 71))), roundness: 1, angle: _chunk3K6HWEXZcjs.rand01.call(void 0, seed, n, 73) * Math.PI * 2 });
670
+ }
671
+ return out;
672
+ }
656
673
 
657
674
  // src/paint-editor/engine.ts
658
675
  function penOrientation(p) {
@@ -921,14 +938,7 @@ var DryStroke = (_class3 = class {
921
938
  this.mark(d, d, rects);
922
939
  continue;
923
940
  }
924
- const count = 1 + Math.round(spray.density * 31);
925
- const key = d.index * 131 + Math.round(d.travel * 8);
926
- for (let i = 0; i < count; i++) {
927
- const a = _chunk3K6HWEXZcjs.rand01.call(void 0, seed, key * 64 + i, 61) * Math.PI * 2;
928
- const rr = Math.sqrt(_chunk3K6HWEXZcjs.rand01.call(void 0, seed, key * 64 + i, 67)) * d.radius;
929
- const drop = { ...d, x: d.x + Math.cos(a) * rr, y: d.y + Math.sin(a) * rr, radius: Math.max(0.5, d.radius * spray.size * (0.6 + 0.8 * _chunk3K6HWEXZcjs.rand01.call(void 0, seed, key * 64 + i, 71))), roundness: 1, angle: _chunk3K6HWEXZcjs.rand01.call(void 0, seed, key * 64 + i, 73) * Math.PI * 2 };
930
- this.mark(drop, d, rects);
931
- }
941
+ for (const drop of sprayDroplets(d, spray, seed)) this.mark(drop, d, rects);
932
942
  }
933
943
  return rects;
934
944
  }
@@ -1019,6 +1029,7 @@ var PaintDabStroke = (_class4 = class {
1019
1029
  constructor(brush, options) {;_class4.prototype.__init18.call(this);_class4.prototype.__init19.call(this);_class4.prototype.__init20.call(this);_class4.prototype.__init21.call(this);_class4.prototype.__init22.call(this);_class4.prototype.__init23.call(this);_class4.prototype.__init24.call(this);_class4.prototype.__init25.call(this);_class4.prototype.__init26.call(this);_class4.prototype.__init27.call(this);
1020
1030
  this.brush = brush;
1021
1031
  this.options = options;
1032
+ this.stamp = brush.engine === "dab" && brush.stamp ? stampSampler(brush.stamp, options.stampArt) : null;
1022
1033
  this.smoother = new PenSmoother(brush.tip.smoothing, brush.pressureSmoothing);
1023
1034
  this.copies = _optionalChain([options, 'access', _8 => _8.copies, 'optionalAccess', _9 => _9.length]) ? options.copies : [IDENTITY_COPY];
1024
1035
  const exchanging = brush.engine === "mixer" || brush.engine === "dab";
@@ -1062,6 +1073,8 @@ var PaintDabStroke = (_class4 = class {
1062
1073
  __init25() {this.paint = [0, 0, 0]}
1063
1074
  __init26() {this.lastRaw = null}
1064
1075
  __init27() {this.lastFed = null}
1076
+ /** The stamp tip's shape (dab brushes), or `null` for the round computed tip. */
1077
+
1065
1078
  /** What copy 0's brush carries after the dabs so far (mixer and wet-capable dab brushes). */
1066
1079
  get load() {
1067
1080
  return _nullishCoalesce(_optionalChain([this, 'access', _12 => _12.states, 'access', _13 => _13[0], 'access', _14 => _14.exchange, 'optionalAccess', _15 => _15.load]), () => ( null));
@@ -1094,8 +1107,9 @@ var PaintDabStroke = (_class4 = class {
1094
1107
  return rects;
1095
1108
  }
1096
1109
  paintDabs(copy, dabs, rects) {
1097
- for (const d of dabs) {
1098
- const rect = _chunkFQPUF2W2cjs.dabRect.call(void 0, d, this.brush.tip.hardness);
1110
+ const spray = this.brush.engine === "dab" ? this.brush.spray : null;
1111
+ for (const d of spray ? dabs.flatMap((dab) => sprayDroplets(dab, spray, (_nullishCoalesce(this.options.seed, () => ( 0))) + copy * 7919)) : dabs) {
1112
+ const rect = this.stamp ? stampDabRect(d) : _chunkFQPUF2W2cjs.dabRect.call(void 0, d, this.brush.tip.hardness);
1099
1113
  if (rect.width <= 0 || rect.height <= 0) continue;
1100
1114
  this.dab(copy, d, rect);
1101
1115
  rects.push(rect);
@@ -1111,7 +1125,8 @@ var PaintDabStroke = (_class4 = class {
1111
1125
  }
1112
1126
  const tip = this.tip.subarray(0, n);
1113
1127
  tip.fill(0);
1114
- _chunkFQPUF2W2cjs.rasterizeDab.call(void 0, { ...d, alpha: 1 }, this.brush.tip.hardness, rect, tip);
1128
+ if (this.stamp) rasterizeStampDab({ ...d, alpha: 1 }, this.stamp, d.index, rect, tip);
1129
+ else _chunkFQPUF2W2cjs.rasterizeDab.call(void 0, { ...d, alpha: 1 }, this.brush.tip.hardness, rect, tip);
1115
1130
  if (!(this.depth > 0 && this.options.grain)) return { tip, cov: tip };
1116
1131
  const cov = this.cov.subarray(0, n);
1117
1132
  const grain = this.options.grain;
@@ -1306,10 +1321,10 @@ function lightTile(color, height, heightAround, material, light) {
1306
1321
  const nh = Math.max(0, nx * hx + ny * hy + nz * hz);
1307
1322
  const spec = Math.max(0, Math.pow(nh, shininess) - Math.pow(hz, shininess)) * (0.25 + 0.75 * gloss) * light.relief;
1308
1323
  for (let c = 0; c < 3; c++) {
1309
- const a = _chunkKBYB7OWBcjs.SRGB_TO_LINEAR[color[i + c]];
1324
+ const a = _chunkYHDHFJUCcjs.SRGB_TO_LINEAR[color[i + c]];
1310
1325
  const tint = metal * a + (1 - metal);
1311
1326
  const v = a * shade * (1 - 0.35 * metal) + spec * tint * (1 + metal);
1312
- out[i + c] = _chunkKBYB7OWBcjs.linearToSrgb8.call(void 0, v);
1327
+ out[i + c] = _chunkYHDHFJUCcjs.linearToSrgb8.call(void 0, v);
1313
1328
  }
1314
1329
  }
1315
1330
  }
@@ -1714,7 +1729,7 @@ function shadowToLight(shadow) {
1714
1729
  return new (0, _chunk474IQG74cjs.TiledSurface)(1, tiles, 0);
1715
1730
  }
1716
1731
  function lightTwinBrush(brush) {
1717
- return _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0,
1732
+ return _chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0,
1718
1733
  {
1719
1734
  tip: { ...brush.tip, blend: "normal", pressureOpacity: brush.tip.pressureOpacity || brush.light.pressure },
1720
1735
  behavior: { ...brush.behavior, mixing: "rgb" },
@@ -2946,7 +2961,7 @@ var PaintStrokeSession = (_class12 = class _PaintStrokeSession {
2946
2961
  } else if (init.thick) {
2947
2962
  const rgb = (c) => [c[0] / 255, c[1] / 255, c[2] / 255];
2948
2963
  this.thickDriver = new ThickStrokeDriver({ brush, target: this.tileTarget(), channels: init.thick.channels, color: rgb(init.color), load: init.mixerLoad, seed: init.seed, copies: this.copies, paint: _nullishCoalesce(init.paint, () => ( null)), effect });
2949
- } else if (brush.engine === "mixer" || brush.engine === "blender" || brush.engine === "smudge" || _chunkRSIKDWOPcjs.usesPaintExchange.call(void 0, brush, Boolean(init.paint))) {
2964
+ } else if (brush.engine === "mixer" || brush.engine === "blender" || brush.engine === "smudge" || _chunkTZOX7KWVcjs.usesPaintExchange.call(void 0, brush, Boolean(init.paint))) {
2950
2965
  const rgb = (c) => [c[0] / 255, c[1] / 255, c[2] / 255];
2951
2966
  this.wet = new PaintDabStroke(brush, {
2952
2967
  target: this.tileTarget(),
@@ -2958,7 +2973,8 @@ var PaintStrokeSession = (_class12 = class _PaintStrokeSession {
2958
2973
  seed: init.seed,
2959
2974
  copies: this.copies,
2960
2975
  paint: _nullishCoalesce(init.paint, () => ( null)),
2961
- effect
2976
+ effect,
2977
+ stampArt: init.stampArt
2962
2978
  });
2963
2979
  } else {
2964
2980
  const opts = { grain: init.grain, paperDepth: init.paperDepth, seed: init.seed, copies: this.copies, paint: _nullishCoalesce(init.paint, () => ( null)), effect, stampArt: init.stampArt };
@@ -3185,7 +3201,7 @@ function brushLoadForStroke(brush, current, color) {
3185
3201
  if (brush.engine === "mixer") return mixerLoadForStroke(brush, current, color);
3186
3202
  if (brush.engine === "impasto") return { reservoir: [color[0], color[1], color[2]], amount: 1, pickup: brush.behavior.dirty ? current.pickup : null };
3187
3203
  if (brush.engine === "wet") return brush.wet.tool === "paint" ? { reservoir: [color[0], color[1], color[2]], amount: 1, pickup: brush.behavior.dirty ? current.pickup : null } : _chunkFQPUF2W2cjs.EMPTY_MIXER_LOAD;
3188
- if (_chunkRSIKDWOPcjs.usesPaintExchange.call(void 0, brush)) return { reservoir: [color[0], color[1], color[2]], amount: 1, pickup: brush.behavior.dirty ? current.pickup : null };
3204
+ if (_chunkTZOX7KWVcjs.usesPaintExchange.call(void 0, brush)) return { reservoir: [color[0], color[1], color[2]], amount: 1, pickup: brush.behavior.dirty ? current.pickup : null };
3189
3205
  return _chunkFQPUF2W2cjs.EMPTY_MIXER_LOAD;
3190
3206
  }
3191
3207
 
@@ -3447,15 +3463,15 @@ function readLoad(raw) {
3447
3463
  function readStrokeBrush(raw) {
3448
3464
  if (raw && typeof raw === "object" && "kind" in raw && !("engine" in raw)) {
3449
3465
  try {
3450
- return _chunkRSIKDWOPcjs.resolveBrush.call(void 0, _chunkRSIKDWOPcjs.normalizeBrushSpec.call(void 0, raw));
3466
+ return _chunkTZOX7KWVcjs.resolveBrush.call(void 0, _chunkTZOX7KWVcjs.normalizeBrushSpec.call(void 0, raw));
3451
3467
  } catch (e5) {
3452
3468
  }
3453
3469
  }
3454
- return _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, _nullishCoalesce(raw, () => ( {})));
3470
+ return _chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0, _nullishCoalesce(raw, () => ( {})));
3455
3471
  }
3456
3472
  function strokeToJSON(stroke) {
3457
3473
  const { brush, ...rest } = stroke;
3458
- return { ...JSON.parse(JSON.stringify(rest)), brush: _chunkRSIKDWOPcjs.migrateBrushV1.call(void 0, brush) };
3474
+ return { ...JSON.parse(JSON.stringify(rest)), brush: _chunkTZOX7KWVcjs.migrateBrushV1.call(void 0, brush) };
3459
3475
  }
3460
3476
  function normalizeBrushStroke(raw) {
3461
3477
  if (!raw || typeof raw !== "object") return null;
@@ -3525,7 +3541,7 @@ function varyStroke(stroke, m, v) {
3525
3541
  if (ps !== 1) q.pressure = Math.min(1, Math.max(0, (_nullishCoalesce(p.pressure, () => ( 1))) * ps));
3526
3542
  return q;
3527
3543
  });
3528
- const brush = s !== 1 ? _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, { ...stroke.brush, tip: { ...stroke.brush.tip, size: stroke.brush.tip.size * s } }) : stroke.brush;
3544
+ const brush = s !== 1 ? _chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0, { ...stroke.brush, tip: { ...stroke.brush.tip, size: stroke.brush.tip.size * s } }) : stroke.brush;
3529
3545
  const out = { ...stroke, brush, points };
3530
3546
  if (_optionalChain([stroke, 'access', _112 => _112.paint, 'optionalAccess', _113 => _113.type]) === "gradient" && s !== 1) out.paint = _chunkFQPUF2W2cjs.scalePaintGradient.call(void 0, stroke.paint, s);
3531
3547
  if (_optionalChain([stroke, 'access', _114 => _114.paint, 'optionalAccess', _115 => _115.type]) === "effect" && stroke.paint.map && s !== 1) out.paint = { ...stroke.paint, map: { ...stroke.paint.map, length: Math.min(4096, Math.max(16, Math.round(stroke.paint.map.length * s))) } };
@@ -3599,7 +3615,7 @@ var PROFILE = {
3599
3615
  }
3600
3616
  };
3601
3617
  function createPaintCompositor() {
3602
- return new (0, _chunkDPYAO5U6cjs.RasterCompositor)(PROFILE);
3618
+ return new (0, _chunkPVJMTLPJcjs.RasterCompositor)(PROFILE);
3603
3619
  }
3604
3620
  function downsampleRgba(data, width, height, tw, th) {
3605
3621
  tw = Math.max(1, Math.round(tw));
@@ -3675,11 +3691,11 @@ function header(state, options) {
3675
3691
  return out;
3676
3692
  }
3677
3693
  function serializePaintDocument(state, options = {}) {
3678
- const { layers, assets } = _chunkYSGW7VV4cjs.serializeLayers.call(void 0, state.layers);
3694
+ const { layers, assets } = _chunk43NT242Dcjs.serializeLayers.call(void 0, state.layers);
3679
3695
  return { ...header(state, options), layers, assets };
3680
3696
  }
3681
3697
  async function serializePaintDocumentExternal(state, store, options = {}) {
3682
- const { layers, assets } = await _chunkYSGW7VV4cjs.serializeLayersExternal.call(void 0, state.layers, store);
3698
+ const { layers, assets } = await _chunk43NT242Dcjs.serializeLayersExternal.call(void 0, state.layers, store);
3683
3699
  return { ...header(state, options), layers, assets };
3684
3700
  }
3685
3701
  function paintLayersOnly(layers, problems) {
@@ -3716,9 +3732,9 @@ function deserializePaintDocument(raw) {
3716
3732
  const canvas = normalizeCanvas({ width: r.width, height: r.height, dpi: _nullishCoalesce(r.dpi, () => ( void 0)) });
3717
3733
  const paper = normalizePaper(_nullishCoalesce(r.paper, () => ( {})));
3718
3734
  const assets = r.assets && typeof r.assets === "object" ? r.assets : {};
3719
- const layers = paintLayersOnly(_chunkYSGW7VV4cjs.deserializeLayers.call(void 0, r.layers, { assets, problems }), problems);
3735
+ const layers = paintLayersOnly(_chunk43NT242Dcjs.deserializeLayers.call(void 0, r.layers, { assets, problems }), problems);
3720
3736
  const wanted = typeof r.activeLayerId === "string" ? r.activeLayerId : null;
3721
- const activeLayerId = wanted && _chunkDPYAO5U6cjs.findLayer.call(void 0, layers, wanted) ? wanted : _nullishCoalesce(_optionalChain([_chunkDPYAO5U6cjs.flattenLayers.call(void 0, layers), 'access', _129 => _129.filter, 'call', _130 => _130((l) => l.type === "pixel"), 'access', _131 => _131.pop, 'call', _132 => _132(), 'optionalAccess', _133 => _133.id]), () => ( null));
3737
+ const activeLayerId = wanted && _chunkPVJMTLPJcjs.findLayer.call(void 0, layers, wanted) ? wanted : _nullishCoalesce(_optionalChain([_chunkPVJMTLPJcjs.flattenLayers.call(void 0, layers), 'access', _129 => _129.filter, 'call', _130 => _130((l) => l.type === "pixel"), 'access', _131 => _131.pop, 'call', _132 => _132(), 'optionalAccess', _133 => _133.id]), () => ( null));
3722
3738
  const wetEvents = Array.isArray(r.wetEvents) ? r.wetEvents.filter((e) => e && typeof e === "object" && Number.isInteger(e.clock) && typeof e.kind === "string") : [];
3723
3739
  const state = { canvas, paper, layers, activeLayerId, strokes: readStrokes(r.strokes, problems) };
3724
3740
  if (wetEvents.length) state.wetEvents = wetEvents;
@@ -3732,7 +3748,7 @@ async function deserializePaintDocumentAsync(raw, store) {
3732
3748
  if (!raw || typeof raw !== "object") throw new Error("Not a paint document: expected a JSON object.");
3733
3749
  const r = raw;
3734
3750
  const problems = [];
3735
- const assets = await _chunkYSGW7VV4cjs.resolveExternalAssets.call(void 0, _nullishCoalesce(r.assets, () => ( {})), store, problems);
3751
+ const assets = await _chunk43NT242Dcjs.resolveExternalAssets.call(void 0, _nullishCoalesce(r.assets, () => ( {})), store, problems);
3736
3752
  const loaded = deserializePaintDocument({ ...r, assets });
3737
3753
  return { ...loaded, problems: [...problems, ...loaded.problems] };
3738
3754
  }
@@ -3809,7 +3825,7 @@ function viewPenToDocument(view, p) {
3809
3825
 
3810
3826
  // src/paint-editor/input.ts
3811
3827
  function samplePressure(e) {
3812
- return _chunkKBYB7OWBcjs.pointerPressure.call(void 0, e);
3828
+ return _chunkYHDHFJUCcjs.pointerPressure.call(void 0, e);
3813
3829
  }
3814
3830
  function pointerToPenPoint(e, x, y, view) {
3815
3831
  const p = { x, y, pressure: samplePressure(e) };
@@ -3879,7 +3895,7 @@ function downloadBytes(bytes, fileName, mimeType) {
3879
3895
 
3880
3896
  // src/paint-editor/wet.ts
3881
3897
  var STROKE_WATER = 0.9;
3882
- var STROKE_MASS = _chunkKBYB7OWBcjs.PIGMENT_UNIT * 2.5;
3898
+ var STROKE_MASS = _chunkYHDHFJUCcjs.PIGMENT_UNIT * 2.5;
3883
3899
  var STROKE_LIGHT = 1.5;
3884
3900
  var COVERAGE_STEPS = 4096;
3885
3901
  function union2(a, b) {
@@ -3909,7 +3925,7 @@ var WetStrokeDriver = (_class13 = class {
3909
3925
  const spacing = Math.max(0.02, brush.tip.spacing);
3910
3926
  const perDab = Math.min(1, spacing * 1.2);
3911
3927
  const thin = wet.thinner;
3912
- this.medium = new (0, _chunkKBYB7OWBcjs.WetMedium)(init.world, init.laneId, {
3928
+ this.medium = new (0, _chunkYHDHFJUCcjs.WetMedium)(init.world, init.laneId, {
3913
3929
  water: STROKE_WATER * Math.min(1, wet.water * (1 + thin)) * perDab,
3914
3930
  mass: STROKE_MASS * wet.pigment * (1 - 0.6 * thin) * perDab,
3915
3931
  body: wet.body * (1 - thin),
@@ -4115,7 +4131,7 @@ var PaintWetLayers = (_class14 = class {
4115
4131
 
4116
4132
 
4117
4133
  __init88() {this.world = null}
4118
- __init89() {this.tilt = { ..._chunkKBYB7OWBcjs.FLAT }}
4134
+ __init89() {this.tilt = { ..._chunkYHDHFJUCcjs.FLAT }}
4119
4135
  __init90() {this.settings = /* @__PURE__ */ new Map()}
4120
4136
  __init91() {this.paused = false}
4121
4137
  /** Wet strokes dry as soon as they end (one undo step with the stroke). */
@@ -4139,8 +4155,8 @@ var PaintWetLayers = (_class14 = class {
4139
4155
  /** Starts the GPU engine for the world (once; it may turn out unavailable). */
4140
4156
  startGpu() {
4141
4157
  if (this.gpuMode === "off" || this.gpu || this.gpuStarting || this.gpuSupport) return;
4142
- const provider = this.options.gpuProvider === void 0 ? _chunkKBYB7OWBcjs.findWebGpu.call(void 0, ) : this.options.gpuProvider;
4143
- this.gpuStarting = _chunkKBYB7OWBcjs.createWetGpuEngine.call(void 0, provider).then(({ engine, support }) => {
4158
+ const provider = this.options.gpuProvider === void 0 ? _chunkYHDHFJUCcjs.findWebGpu.call(void 0, ) : this.options.gpuProvider;
4159
+ this.gpuStarting = _chunkYHDHFJUCcjs.createWetGpuEngine.call(void 0, provider).then(({ engine, support }) => {
4144
4160
  this.gpuSupport = support;
4145
4161
  if (!engine) return;
4146
4162
  if (this.gpuMode === "off" || !this.world) {
@@ -4199,7 +4215,7 @@ var PaintWetLayers = (_class14 = class {
4199
4215
  return this.world;
4200
4216
  }
4201
4217
  makeWorld(width, height, paper) {
4202
- const world = new (0, _chunkKBYB7OWBcjs.WetWorld)(width, height, wetPaperInput(paper), { kernel: this.options.kernel, threads: this.options.threads });
4218
+ const world = new (0, _chunkYHDHFJUCcjs.WetWorld)(width, height, wetPaperInput(paper), { kernel: this.options.kernel, threads: this.options.threads });
4203
4219
  world.setTilt(this.tilt);
4204
4220
  world.gpuMinTiles = this.gpuMinTiles;
4205
4221
  if (this.gpu) world.attachGpu(this.gpu);
@@ -4211,7 +4227,7 @@ var PaintWetLayers = (_class14 = class {
4211
4227
  * sides: the shift has to be whole wet tiles (256 px), and no wet stroke may be live.
4212
4228
  */
4213
4229
  canExtend(left, top) {
4214
- return left % _chunkKBYB7OWBcjs.WET_TILE === 0 && top % _chunkKBYB7OWBcjs.WET_TILE === 0 && !this.driver;
4230
+ return left % _chunkYHDHFJUCcjs.WET_TILE === 0 && top % _chunkYHDHFJUCcjs.WET_TILE === 0 && !this.driver;
4215
4231
  }
4216
4232
  /**
4217
4233
  * Keeps the wet paint while the canvas grows to `width`×`height` by `left` / `top` on those
@@ -4229,12 +4245,12 @@ var PaintWetLayers = (_class14 = class {
4229
4245
  this.lastTick = null;
4230
4246
  this.stepsOwed = 0;
4231
4247
  if (!old || !snap) return;
4232
- const moved = _chunkKBYB7OWBcjs.moveWetSnapshot.call(void 0, snap, old, { width, height }, left, top, (l) => {
4248
+ const moved = _chunkYHDHFJUCcjs.moveWetSnapshot.call(void 0, snap, old, { width, height }, left, top, (l) => {
4233
4249
  const flow = _optionalChain([this, 'access', _157 => _157.settings, 'access', _158 => _158.get, 'call', _159 => _159(l.id), 'optionalAccess', _160 => _160.flow]);
4234
4250
  return {
4235
4251
  base: _chunk474IQG74cjs.translateSurface.call(void 0, l.base, left, top),
4236
4252
  ...l.light ? { light: _chunk474IQG74cjs.translateSurface.call(void 0, l.light, left, top) } : {},
4237
- flow: l.flow && flow && flow.kind !== "none" ? _chunkKBYB7OWBcjs.flowField.call(void 0, flow, width, height) : l.flow
4253
+ flow: l.flow && flow && flow.kind !== "none" ? _chunkYHDHFJUCcjs.flowField.call(void 0, flow, width, height) : l.flow
4238
4254
  };
4239
4255
  });
4240
4256
  this.world = this.makeWorld(width, height, paper);
@@ -4262,7 +4278,7 @@ var PaintWetLayers = (_class14 = class {
4262
4278
  settingsOf(layerId, medium = "watercolor") {
4263
4279
  let s = this.settings.get(layerId);
4264
4280
  if (!s) {
4265
- s = { params: _chunkKBYB7OWBcjs.normalizeWetParams.call(void 0, WET_MEDIUM_PARAMS[medium], _chunkKBYB7OWBcjs.DEFAULT_WET_PARAMS), flow: { ..._chunkKBYB7OWBcjs.DEFAULT_FLOW } };
4281
+ s = { params: _chunkYHDHFJUCcjs.normalizeWetParams.call(void 0, WET_MEDIUM_PARAMS[medium], _chunkYHDHFJUCcjs.DEFAULT_WET_PARAMS), flow: { ..._chunkYHDHFJUCcjs.DEFAULT_FLOW } };
4266
4282
  this.settings.set(layerId, s);
4267
4283
  }
4268
4284
  return s;
@@ -4275,27 +4291,27 @@ var PaintWetLayers = (_class14 = class {
4275
4291
  const s = this.settingsOf(layerId, medium);
4276
4292
  w.ensureLane(layerId, { params: s.params, base, light: this.host.layerLight(layerId) });
4277
4293
  const { width, height } = this.host.canvas();
4278
- if (s.flow.kind !== "none") w.setFlow(layerId, _chunkKBYB7OWBcjs.flowField.call(void 0, s.flow, width, height), s.flow.strength);
4294
+ if (s.flow.kind !== "none") w.setFlow(layerId, _chunkYHDHFJUCcjs.flowField.call(void 0, s.flow, width, height), s.flow.strength);
4279
4295
  }
4280
4296
  return w;
4281
4297
  }
4282
4298
  setParams(layerId, update) {
4283
4299
  const s = this.settingsOf(layerId);
4284
- s.params = _chunkKBYB7OWBcjs.normalizeWetParams.call(void 0, update, s.params);
4300
+ s.params = _chunkYHDHFJUCcjs.normalizeWetParams.call(void 0, update, s.params);
4285
4301
  if (_optionalChain([this, 'access', _166 => _166.world, 'optionalAccess', _167 => _167.hasLane, 'call', _168 => _168(layerId)])) this.world.setParams(layerId, s.params);
4286
4302
  return { ...s.params };
4287
4303
  }
4288
4304
  setFlow(layerId, update) {
4289
4305
  const s = this.settingsOf(layerId);
4290
- s.flow = _chunkKBYB7OWBcjs.normalizeFlow.call(void 0, update, s.flow);
4306
+ s.flow = _chunkYHDHFJUCcjs.normalizeFlow.call(void 0, update, s.flow);
4291
4307
  if (_optionalChain([this, 'access', _169 => _169.world, 'optionalAccess', _170 => _170.hasLane, 'call', _171 => _171(layerId)])) {
4292
4308
  const { width, height } = this.host.canvas();
4293
- this.world.setFlow(layerId, _chunkKBYB7OWBcjs.flowField.call(void 0, s.flow, width, height), s.flow.strength);
4309
+ this.world.setFlow(layerId, _chunkYHDHFJUCcjs.flowField.call(void 0, s.flow, width, height), s.flow.strength);
4294
4310
  }
4295
4311
  return { ...s.flow };
4296
4312
  }
4297
4313
  setTilt(update) {
4298
- this.tilt = _chunkKBYB7OWBcjs.normalizeTilt.call(void 0, update, this.tilt);
4314
+ this.tilt = _chunkYHDHFJUCcjs.normalizeTilt.call(void 0, update, this.tilt);
4299
4315
  _optionalChain([this, 'access', _172 => _172.world, 'optionalAccess', _173 => _173.setTilt, 'call', _174 => _174(this.tilt)]);
4300
4316
  return { ...this.tilt };
4301
4317
  }
@@ -4564,7 +4580,7 @@ var PaintWetLayers = (_class14 = class {
4564
4580
  }, _class14);
4565
4581
  function wetPigmentOf(hex2, body) {
4566
4582
  const [r, g, b] = hexToRgb8(hex2);
4567
- return Array.from(_chunkKBYB7OWBcjs.pigmentOf.call(void 0, [r / 255, g / 255, b / 255], body));
4583
+ return Array.from(_chunkYHDHFJUCcjs.pigmentOf.call(void 0, [r / 255, g / 255, b / 255], body));
4568
4584
  }
4569
4585
 
4570
4586
  // src/paint-editor/thumbnails.ts
@@ -4572,7 +4588,7 @@ var thumbWorld = null;
4572
4588
  function paintWetTestStroke(brush, paper, color, width, height) {
4573
4589
  if (!thumbWorld || thumbWorld.width !== width || thumbWorld.height !== height) {
4574
4590
  _optionalChain([thumbWorld, 'optionalAccess', _208 => _208.destroy, 'call', _209 => _209()]);
4575
- thumbWorld = new (0, _chunkKBYB7OWBcjs.WetWorld)(width, height, wetPaperInput(paper), { kernel: "typescript", threads: 0 });
4591
+ thumbWorld = new (0, _chunkYHDHFJUCcjs.WetWorld)(width, height, wetPaperInput(paper), { kernel: "typescript", threads: 0 });
4576
4592
  } else thumbWorld.setPaper(wetPaperInput(paper));
4577
4593
  const w = thumbWorld;
4578
4594
  if (w.hasLane("thumb")) w.removeLane("thumb");
@@ -4580,8 +4596,8 @@ function paintWetTestStroke(brush, paper, color, width, height) {
4580
4596
  const [r, g, b] = hexToRgb8(color);
4581
4597
  if (brush.wet.tool !== "paint" && brush.wet.tool !== "water") {
4582
4598
  const half = Math.ceil(height / 2);
4583
- w.paint("thumb", { x: 0, y: 0, width, height: half }, null, 0.4, Array.from(_chunkKBYB7OWBcjs.pigmentOf.call(void 0, [r / 255, g / 255, b / 255], 0), (v) => v * 0.05));
4584
- w.paint("thumb", { x: 0, y: half, width, height: height - half }, null, 0.4, Array.from(_chunkKBYB7OWBcjs.pigmentOf.call(void 0, [232 / 255, 196 / 255, 64 / 255], 0), (v) => v * 0.05));
4599
+ w.paint("thumb", { x: 0, y: 0, width, height: half }, null, 0.4, Array.from(_chunkYHDHFJUCcjs.pigmentOf.call(void 0, [r / 255, g / 255, b / 255], 0), (v) => v * 0.05));
4600
+ w.paint("thumb", { x: 0, y: half, width, height: height - half }, null, 0.4, Array.from(_chunkYHDHFJUCcjs.pigmentOf.call(void 0, [232 / 255, 196 / 255, 64 / 255], 0), (v) => v * 0.05));
4585
4601
  }
4586
4602
  const driver = new WetStrokeDriver({
4587
4603
  world: w,
@@ -4656,7 +4672,7 @@ function renderBrushThumbnail(brush, options) {
4656
4672
  const width = Math.max(16, Math.min(512, Math.round(_nullishCoalesce(options.width, () => ( 160)))));
4657
4673
  const height = Math.max(16, Math.min(512, Math.round(_nullishCoalesce(options.height, () => ( 48)))));
4658
4674
  const maxSize = height * 0.42;
4659
- const b = brush.tip.size > maxSize ? _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, { tip: { ...brush.tip, size: maxSize } }, brush) : brush;
4675
+ const b = brush.tip.size > maxSize ? _chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0, { tip: { ...brush.tip, size: maxSize } }, brush) : brush;
4660
4676
  const rgba = [...hexToRgb8(options.color), 255];
4661
4677
  let surface = _chunk474IQG74cjs.emptySurface.call(void 0, 4);
4662
4678
  if (b.engine === "eraser") {
@@ -4939,7 +4955,7 @@ var DEFAULT_SWATCHES = [
4939
4955
  // src/paint-editor/mixing-pad.ts
4940
4956
  var MIXING_PAD_WIDTH = 360;
4941
4957
  var MIXING_PAD_HEIGHT = 220;
4942
- var PAD_PAINT = _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, {
4958
+ var PAD_PAINT = _chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0, {
4943
4959
  id: "pad-paint",
4944
4960
  name: "Pad paint",
4945
4961
  category: "mixer",
@@ -4947,7 +4963,7 @@ var PAD_PAINT = _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, {
4947
4963
  tip: { size: 28, hardness: 0.75, spacing: 0.1, opacity: 1, flow: 0.7, pressureSize: false, pressureOpacity: false },
4948
4964
  mixer: { wet: 0.45, load: 1, mix: 0.4, loadEachStroke: true, cleanEachStroke: true, mixing: "pigment" }
4949
4965
  });
4950
- var PAD_KNIFE = _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, {
4966
+ var PAD_KNIFE = _chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0, {
4951
4967
  id: "pad-knife",
4952
4968
  name: "Palette knife",
4953
4969
  category: "smudge",
@@ -4957,7 +4973,7 @@ var PAD_KNIFE = _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, {
4957
4973
  // A knife drags streaks of paint and folds them into each other, mixing them as pigment.
4958
4974
  smudge: { strength: 0.6, length: 0.8, mixing: "pigment" }
4959
4975
  });
4960
- var PAD_BLOB = _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, {
4976
+ var PAD_BLOB = _chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0, {
4961
4977
  id: "pad-blob",
4962
4978
  name: "Pad blob",
4963
4979
  category: "custom",
@@ -4979,7 +4995,7 @@ var MixingPad = (_class16 = class {constructor() { _class16.prototype.__init106.
4979
4995
  }
4980
4996
  }
4981
4997
  let brush = options.tool === "knife" ? PAD_KNIFE : PAD_PAINT;
4982
- if (options.size !== void 0) brush = _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, { tip: { ...brush.tip, size: options.size } }, brush);
4998
+ if (options.size !== void 0) brush = _chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0, { tip: { ...brush.tip, size: options.size } }, brush);
4983
4999
  return this.run(brush, points, options.color);
4984
5000
  }
4985
5001
  /** Paints `points` with `brush` in `color` on the pad. */
@@ -5078,10 +5094,10 @@ var MixingPad = (_class16 = class {constructor() { _class16.prototype.__init106.
5078
5094
  const off = used.length === 1 ? 0 : 0.45 * R;
5079
5095
  const x = Math.min(cx + R - r, Math.max(cx - R + r, cx + Math.cos(a) * off));
5080
5096
  const y = Math.min(cy + R - r, Math.max(cy - R + r, cy + Math.sin(a) * off));
5081
- const blob = _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, { tip: { ...PAD_BLOB.tip, size: Math.max(2, 2 * r) } }, PAD_BLOB);
5097
+ const blob = _chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0, { tip: { ...PAD_BLOB.tip, size: Math.max(2, 2 * r) } }, PAD_BLOB);
5082
5098
  this.run(blob, [{ x, y }], p.color.toLowerCase());
5083
5099
  });
5084
- const knife = _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, { tip: { ...PAD_KNIFE.tip, size: Math.max(12, R * 0.5) } }, PAD_KNIFE);
5100
+ const knife = _chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0, { tip: { ...PAD_KNIFE.tip, size: Math.max(12, R * 0.5) } }, PAD_KNIFE);
5085
5101
  for (let k = 0; k < passes; k++) {
5086
5102
  const stir = [];
5087
5103
  const turns = 1.6;
@@ -5096,7 +5112,7 @@ var MixingPad = (_class16 = class {constructor() { _class16.prototype.__init106.
5096
5112
  paints2.map((p) => hexToRgb8(p.color).map((v) => v / 255)),
5097
5113
  paints2.map((p) => p.parts)
5098
5114
  );
5099
- const core = _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, { tip: { ...PAD_BLOB.tip, size: R * 1.1, hardness: 0.55 } }, PAD_BLOB);
5115
+ const core = _chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0, { tip: { ...PAD_BLOB.tip, size: R * 1.1, hardness: 0.55 } }, PAD_BLOB);
5100
5116
  const hex2 = "#" + mixed.map((v) => Math.round(v * 255).toString(16).padStart(2, "0")).join("");
5101
5117
  this.run(core, [{ x: cx, y: cy }], hex2);
5102
5118
  return { color: this.pick(cx, cy, 2), bounds };
@@ -5136,21 +5152,21 @@ var MixingPad = (_class16 = class {constructor() { _class16.prototype.__init106.
5136
5152
  var copyJSON = (v) => JSON.parse(JSON.stringify(v));
5137
5153
  var isObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
5138
5154
  function libraryBrush(spec, builtin, resolved) {
5139
- const brush = resolved ? _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, resolved, resolved) : _chunkRSIKDWOPcjs.resolveBrush.call(void 0, spec);
5155
+ const brush = resolved ? _chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0, resolved, resolved) : _chunkTZOX7KWVcjs.resolveBrush.call(void 0, spec);
5140
5156
  if (builtin) brush.builtin = true;
5141
5157
  else delete brush.builtin;
5142
5158
  return { spec, brush, builtin };
5143
5159
  }
5144
5160
  var builtins = null;
5145
5161
  function builtinLibraryBrushes() {
5146
- return builtins ??= _chunkRSIKDWOPcjs.BRUSH_PRESETS.map((spec) => {
5147
- const resolved = _chunkRSIKDWOPcjs.BUILTIN_BRUSHES.find((b) => b.id === spec.id);
5162
+ return builtins ??= _chunkTZOX7KWVcjs.BRUSH_PRESETS.map((spec) => {
5163
+ const resolved = _chunkTZOX7KWVcjs.BUILTIN_BRUSHES.find((b) => b.id === spec.id);
5148
5164
  return libraryBrush(spec, true, resolved);
5149
5165
  });
5150
5166
  }
5151
5167
  function seededStorage(brushes) {
5152
5168
  if (!brushes.length) return void 0;
5153
- let stored = JSON.stringify({ format: "pixerate-brushes", version: 1, brushes: brushes.map(_chunkRSIKDWOPcjs.brushToJSON) });
5169
+ let stored = JSON.stringify({ format: "pixerate-brushes", version: 1, brushes: brushes.map(_chunkTZOX7KWVcjs.brushToJSON) });
5154
5170
  return {
5155
5171
  get: async () => stored,
5156
5172
  set: async (_key, value) => {
@@ -5163,7 +5179,7 @@ var paints = (b) => {
5163
5179
  return JSON.stringify(rest);
5164
5180
  };
5165
5181
  function brushSpecOf(next, from) {
5166
- const plain = _chunkRSIKDWOPcjs.migrateBrushV1.call(void 0, next);
5182
+ const plain = _chunkTZOX7KWVcjs.migrateBrushV1.call(void 0, next);
5167
5183
  const out = copyJSON(plain);
5168
5184
  if (from.description) out.description = from.description;
5169
5185
  if (_optionalChain([from, 'access', _213 => _213.tags, 'optionalAccess', _214 => _214.length])) out.tags = [...from.tags];
@@ -5183,8 +5199,8 @@ function brushSpecOf(next, from) {
5183
5199
  out.motion = { ..._nullishCoalesce(out.motion, () => ( {})), ...from.motion.live !== void 0 ? { live: from.motion.live } : {}, ...from.motion.fps !== void 0 ? { fps: from.motion.fps } : {} };
5184
5200
  }
5185
5201
  try {
5186
- const hinted = _chunkRSIKDWOPcjs.normalizeBrushSpec.call(void 0, out, []);
5187
- if (paints(_chunkRSIKDWOPcjs.resolveBrush.call(void 0, hinted)) === paints(_chunkRSIKDWOPcjs.resolveBrush.call(void 0, plain))) return hinted;
5202
+ const hinted = _chunkTZOX7KWVcjs.normalizeBrushSpec.call(void 0, out, []);
5203
+ if (paints(_chunkTZOX7KWVcjs.resolveBrush.call(void 0, hinted)) === paints(_chunkTZOX7KWVcjs.resolveBrush.call(void 0, plain))) return hinted;
5188
5204
  } catch (e7) {
5189
5205
  }
5190
5206
  return plain;
@@ -5463,7 +5479,7 @@ function replayItems(doc) {
5463
5479
  }
5464
5480
  function emptiedLayers(layers) {
5465
5481
  let out = [...layers];
5466
- for (const l of _chunkDPYAO5U6cjs.flattenLayers.call(void 0, layers)) if (l.type === "pixel") out = _chunkDPYAO5U6cjs.mapLayer.call(void 0, out, l.id, () => ({ ...l, surface: _chunk474IQG74cjs.emptySurface.call(void 0, 4), offset: { x: 0, y: 0 } }));
5482
+ for (const l of _chunkPVJMTLPJcjs.flattenLayers.call(void 0, layers)) if (l.type === "pixel") out = _chunkPVJMTLPJcjs.mapLayer.call(void 0, out, l.id, () => ({ ...l, surface: _chunk474IQG74cjs.emptySurface.call(void 0, 4), offset: { x: 0, y: 0 } }));
5467
5483
  return out;
5468
5484
  }
5469
5485
  async function replayPainting(source, target, options = {}) {
@@ -5777,7 +5793,7 @@ function effectGuard(fn) {
5777
5793
  try {
5778
5794
  return fn();
5779
5795
  } catch (e) {
5780
- if (e instanceof _chunkDPYAO5U6cjs.LayerEffectError) throw new PaintEditorError(e.message);
5796
+ if (e instanceof _chunkPVJMTLPJcjs.LayerEffectError) throw new PaintEditorError(e.message);
5781
5797
  throw e;
5782
5798
  }
5783
5799
  }
@@ -5791,7 +5807,7 @@ async function libraryCall(call) {
5791
5807
  try {
5792
5808
  return await call();
5793
5809
  } catch (e) {
5794
- throw e instanceof _chunkRSIKDWOPcjs.BrushLibraryError ? new PaintEditorError(e.message) : e;
5810
+ throw e instanceof _chunkTZOX7KWVcjs.BrushLibraryError ? new PaintEditorError(e.message) : e;
5795
5811
  }
5796
5812
  }
5797
5813
  var HEX3 = /^#[0-9a-f]{6}$/i;
@@ -5921,15 +5937,15 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
5921
5937
  this.rasterizeSticker = _nullishCoalesce(options.rasterizeSticker, () => ( defaultStickerRasterizer));
5922
5938
  if (options.stickers) this.stickers.set(options.stickers);
5923
5939
  this.doc = createPaintDocument({ width: options.width, height: options.height, dpi: options.dpi, paper: this.resolvePaper(options.paper) });
5924
- const seed = (_nullishCoalesce(options.brushes, () => ( []))).map((b) => _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, { ...b, builtin: false }));
5925
- this.brushLibrary = _nullishCoalesce(options.brushLibrary, () => ( _chunkRSIKDWOPcjs.createBrushLibrary.call(void 0, { storage: seededStorage(seed) })));
5926
- this.brushEntries = [...builtinLibraryBrushes(), ...seed.map((b) => libraryBrush(_chunkRSIKDWOPcjs.migrateBrushV1.call(void 0, b), false, b))];
5927
- const wanted = _nullishCoalesce(options.brushId, () => ( _chunkRSIKDWOPcjs.DEFAULT_BRUSH_ID));
5928
- const start = _nullishCoalesce(this.findEntry(wanted), () => ( this.findEntry(_chunkRSIKDWOPcjs.DEFAULT_BRUSH_ID)));
5929
- this.brush = _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, start.brush);
5940
+ const seed = (_nullishCoalesce(options.brushes, () => ( []))).map((b) => _chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0, { ...b, builtin: false }));
5941
+ this.brushLibrary = _nullishCoalesce(options.brushLibrary, () => ( _chunkTZOX7KWVcjs.createBrushLibrary.call(void 0, { storage: seededStorage(seed) })));
5942
+ this.brushEntries = [...builtinLibraryBrushes(), ...seed.map((b) => libraryBrush(_chunkTZOX7KWVcjs.migrateBrushV1.call(void 0, b), false, b))];
5943
+ const wanted = _nullishCoalesce(options.brushId, () => ( _chunkTZOX7KWVcjs.DEFAULT_BRUSH_ID));
5944
+ const start = _nullishCoalesce(this.findEntry(wanted), () => ( this.findEntry(_chunkTZOX7KWVcjs.DEFAULT_BRUSH_ID)));
5945
+ this.brush = _chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0, start.brush);
5930
5946
  this.brushSpec = copyJSON(start.spec);
5931
5947
  this.unsubscribeLibrary = this.brushLibrary.subscribe(() => void this.refreshBrushes().catch(() => void 0));
5932
- if (options.brushLibrary && seed.length) void this.brushLibrary.importFile(seed.map(_chunkRSIKDWOPcjs.brushToJSON)).catch(() => void 0);
5948
+ if (options.brushLibrary && seed.length) void this.brushLibrary.importFile(seed.map(_chunkTZOX7KWVcjs.brushToJSON)).catch(() => void 0);
5933
5949
  void this.refreshBrushes().catch(() => void 0);
5934
5950
  this.pendingBrushId = start.brush.id === wanted ? null : wanted;
5935
5951
  this.color = options.color ? parseColor(options.color) : "#1f2937";
@@ -5943,19 +5959,19 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
5943
5959
  canvas: () => this.doc.canvas,
5944
5960
  paper: () => this.doc.paper,
5945
5961
  layerSurface: (id) => {
5946
- const l = _optionalChain([_chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, id), 'optionalAccess', _262 => _262.layer]);
5962
+ const l = _optionalChain([_chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, id), 'optionalAccess', _262 => _262.layer]);
5947
5963
  return isPixelLayer(l) ? l.surface : null;
5948
5964
  },
5949
5965
  updateSurfaces: (surfaces, rects) => {
5950
5966
  let layers = this.doc.layers;
5951
- for (const [id, surface] of surfaces) if (_chunkDPYAO5U6cjs.findLayer.call(void 0, layers, id)) layers = _chunkDPYAO5U6cjs.mapLayer.call(void 0, layers, id, (l) => ({ ...l, surface }));
5967
+ for (const [id, surface] of surfaces) if (_chunkPVJMTLPJcjs.findLayer.call(void 0, layers, id)) layers = _chunkPVJMTLPJcjs.mapLayer.call(void 0, layers, id, (l) => ({ ...l, surface }));
5952
5968
  this.doc = { ...this.doc, layers };
5953
5969
  this.emit(rects.length ? rects : "all");
5954
5970
  },
5955
5971
  layerLight: (id) => _nullishCoalesce(_optionalChain([this, 'access', _263 => _263.doc, 'access', _264 => _264.light, 'optionalAccess', _265 => _265[id]]), () => ( null)),
5956
5972
  updateLights: (lights) => {
5957
5973
  let light = this.doc.light;
5958
- for (const [id, surface] of lights) if (_chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, id)) light = withLayerLight(light, id, surface);
5974
+ for (const [id, surface] of lights) if (_chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, id)) light = withLayerLight(light, id, surface);
5959
5975
  this.doc = { ...this.doc, ...light ? { light } : {} };
5960
5976
  },
5961
5977
  changed: () => {
@@ -6087,7 +6103,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
6087
6103
  if (placement.bottom) this.moveLayer(layer.id, 0, null);
6088
6104
  fn(layer.id);
6089
6105
  if (this.wetOp || this.pendingWetEvents.length) throw new PaintEditorError("Wet paint can't be previewed; suggest it with a dry brush.");
6090
- const found = _optionalChain([_chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, layer.id), 'optionalAccess', _269 => _269.layer]);
6106
+ const found = _optionalChain([_chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, layer.id), 'optionalAccess', _269 => _269.layer]);
6091
6107
  const surface = found && isPixelLayer(found) ? found.surface : null;
6092
6108
  const bounds = surface ? _chunk474IQG74cjs.contentBounds.call(void 0, surface) : null;
6093
6109
  const box = bounds ? clipToCanvas(bounds, this.doc.canvas) : null;
@@ -6415,8 +6431,8 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
6415
6431
  }
6416
6432
  let next = { ...shiftDocument(this.withWetEvents(this.doc), left, top), canvas: { ...was, width, height } };
6417
6433
  for (const id of keptWet) {
6418
- const l = _optionalChain([_chunkDPYAO5U6cjs.findLayer.call(void 0, next.layers, id), 'optionalAccess', _281 => _281.layer]);
6419
- if (isPixelLayer(l)) next = { ...next, layers: _chunkDPYAO5U6cjs.mapLayer.call(void 0, next.layers, id, () => ({ ...l, surface: _chunk474IQG74cjs.translateSurface.call(void 0, l.surface, l.offset.x, l.offset.y), offset: { x: 0, y: 0 } })) };
6434
+ const l = _optionalChain([_chunkPVJMTLPJcjs.findLayer.call(void 0, next.layers, id), 'optionalAccess', _281 => _281.layer]);
6435
+ if (isPixelLayer(l)) next = { ...next, layers: _chunkPVJMTLPJcjs.mapLayer.call(void 0, next.layers, id, () => ({ ...l, surface: _chunk474IQG74cjs.translateSurface.call(void 0, l.surface, l.offset.x, l.offset.y), offset: { x: 0, y: 0 } })) };
6420
6436
  }
6421
6437
  if (this.wet.world) {
6422
6438
  if (keptWet.length) this.wet.extend(width, height, left, top, next.paper);
@@ -6459,7 +6475,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
6459
6475
  }
6460
6476
  // --- Layers --------------------------------------------------------------------
6461
6477
  getLayer(id) {
6462
- return _optionalChain([_chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, id), 'optionalAccess', _282 => _282.layer]);
6478
+ return _optionalChain([_chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, id), 'optionalAccess', _282 => _282.layer]);
6463
6479
  }
6464
6480
  /** The active pixel layer (or `undefined`). */
6465
6481
  getActiveLayer() {
@@ -6478,12 +6494,12 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
6478
6494
  walk(this.doc.layers, null, 0);
6479
6495
  return out;
6480
6496
  }
6481
- describeLayer(l, parentId = _nullishCoalesce(_optionalChain([_chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, l.id), 'optionalAccess', _283 => _283.parent, 'optionalAccess', _284 => _284.id]), () => ( null)), depth = _nullishCoalesce(_optionalChain([_chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, l.id), 'optionalAccess', _285 => _285.path, 'access', _286 => _286.length]), () => ( 0))) {
6497
+ describeLayer(l, parentId = _nullishCoalesce(_optionalChain([_chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, l.id), 'optionalAccess', _283 => _283.parent, 'optionalAccess', _284 => _284.id]), () => ( null)), depth = _nullishCoalesce(_optionalChain([_chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, l.id), 'optionalAccess', _285 => _285.path, 'access', _286 => _286.length]), () => ( 0))) {
6482
6498
  let bounds = null;
6483
6499
  if (l.type === "pixel") {
6484
6500
  const b = _chunk474IQG74cjs.contentBounds.call(void 0, l.surface);
6485
6501
  bounds = b ? { ...b, x: b.x + l.offset.x, y: b.y + l.offset.y } : null;
6486
- } else for (const c of _chunkDPYAO5U6cjs.flattenLayers.call(void 0, l.children)) if (c.type === "pixel") bounds = unionRect(bounds, this.describeLayer(c, l.id, depth + 1).bounds);
6502
+ } else for (const c of _chunkPVJMTLPJcjs.flattenLayers.call(void 0, l.children)) if (c.type === "pixel") bounds = unionRect(bounds, this.describeLayer(c, l.id, depth + 1).bounds);
6487
6503
  return {
6488
6504
  id: l.id,
6489
6505
  name: l.name,
@@ -6512,7 +6528,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
6512
6528
  if (!id) throw new PaintEditorError(`There is no active layer to ${what}; add one with add_layer.`);
6513
6529
  const l = this.requireLayer(id);
6514
6530
  if (!isPixelLayer(l)) throw new PaintEditorError(`Layer "${l.name}" is a group; ${what} a pixel layer inside it.`);
6515
- if (_chunkDPYAO5U6cjs.isLayerLocked.call(void 0, l, "pixels")) throw new PaintEditorError(`Layer "${l.name}" has its pixels locked; unlock it (update_layer locks) before you ${what} it.`);
6531
+ if (_chunkPVJMTLPJcjs.isLayerLocked.call(void 0, l, "pixels")) throw new PaintEditorError(`Layer "${l.name}" has its pixels locked; unlock it (update_layer locks) before you ${what} it.`);
6516
6532
  if (!l.visible) throw new PaintEditorError(`Layer "${l.name}" is hidden; show it (update_layer visible true) before you ${what} it.`);
6517
6533
  return l;
6518
6534
  }
@@ -6526,7 +6542,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
6526
6542
  /** Adds a layer above the active one: `pixel` (default), `group`, or `strokes`, a live stroke layer whose strokes stay editable. */
6527
6543
  addLayer(options = {}) {
6528
6544
  this.requireIdle("adding a layer");
6529
- const count = _chunkDPYAO5U6cjs.flattenLayers.call(void 0, this.doc.layers).length;
6545
+ const count = _chunkPVJMTLPJcjs.flattenLayers.call(void 0, this.doc.layers).length;
6530
6546
  const type = _nullishCoalesce(options.type, () => ( "pixel"));
6531
6547
  const name = _optionalChain([options, 'access', _293 => _293.name, 'optionalAccess', _294 => _294.trim, 'call', _295 => _295()]) || (type === "group" ? `Group ${count + 1}` : type === "strokes" ? `Strokes ${count + 1}` : `Layer ${count + 1}`);
6532
6548
  const layer = type === "group" ? { type: "group", id: newPaintLayerId(), name, visible: true, opacity: 1, blend: "pass-through", children: [] } : createPaintLayer(name);
@@ -6538,12 +6554,12 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
6538
6554
  if (g.type !== "group") throw new PaintEditorError(`Layer "${g.name}" is not a group; pass a group id as parentId.`);
6539
6555
  parentId = g.id;
6540
6556
  } else if (above) {
6541
- const loc = _chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, above);
6557
+ const loc = _chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, above);
6542
6558
  if (!loc) throw new PaintEditorError(`Unknown layer "${above}". Call list_layers for the ids.`);
6543
6559
  parentId = _nullishCoalesce(_optionalChain([loc, 'access', _296 => _296.parent, 'optionalAccess', _297 => _297.id]), () => ( null));
6544
6560
  index = loc.index + 1;
6545
6561
  }
6546
- const layers = _chunkDPYAO5U6cjs.insertLayer.call(void 0, this.doc.layers, layer, parentId, index);
6562
+ const layers = _chunkPVJMTLPJcjs.insertLayer.call(void 0, this.doc.layers, layer, parentId, index);
6547
6563
  const live = type === "strokes" ? { liveStrokes: { ..._nullishCoalesce(this.doc.liveStrokes, () => ( {})), [layer.id]: [] } } : {};
6548
6564
  this.commit(type === "group" ? "Add group" : type === "strokes" ? "Add stroke layer" : "Add layer", { ...this.doc, layers, activeLayerId: layer.id, ...live });
6549
6565
  return this.describeLayer(layer);
@@ -6551,7 +6567,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
6551
6567
  updateLayer(id, update) {
6552
6568
  this.requireIdle("changing a layer");
6553
6569
  const l = this.requireLayer(id);
6554
- if (_chunkDPYAO5U6cjs.isLayerLocked.call(void 0, l, "all") && Object.keys(update).some((k) => k !== "locks")) throw new PaintEditorError(`Layer "${l.name}" is fully locked; unlock it first (locks {all: false}).`);
6570
+ if (_chunkPVJMTLPJcjs.isLayerLocked.call(void 0, l, "all") && Object.keys(update).some((k) => k !== "locks")) throw new PaintEditorError(`Layer "${l.name}" is fully locked; unlock it first (locks {all: false}).`);
6555
6571
  if (update.opacity !== void 0 && !(update.opacity >= 0 && update.opacity <= 1)) throw new PaintEditorError(`opacity ${update.opacity} is out of range; use 0..1.`);
6556
6572
  if (update.blend !== void 0 && !_chunk2VX55NFMcjs.isBlendMode.call(void 0, update.blend) && !(l.type === "group" && update.blend === "pass-through")) {
6557
6573
  throw new PaintEditorError(`Unknown blend mode "${update.blend}". Call get_canvas_info for the blend modes.`);
@@ -6567,7 +6583,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
6567
6583
  const locks = { ..._nullishCoalesce(l.locks, () => ( {})), ...update.locks };
6568
6584
  next.locks = Object.values(locks).some(Boolean) ? locks : void 0;
6569
6585
  }
6570
- this.commit("Layer properties", { ...this.doc, layers: _chunkDPYAO5U6cjs.mapLayer.call(void 0, this.doc.layers, id, () => next) });
6586
+ this.commit("Layer properties", { ...this.doc, layers: _chunkPVJMTLPJcjs.mapLayer.call(void 0, this.doc.layers, id, () => next) });
6571
6587
  return this.describeLayer(next);
6572
6588
  }
6573
6589
  // --- Layer effects (layer styles) ---------------------------------------------
@@ -6582,17 +6598,17 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
6582
6598
  * layer's pixels when it is composited, so it follows later painting. One undo step.
6583
6599
  */
6584
6600
  addLayerEffect(id, kind, settings = {}, index) {
6585
- if (!_chunkDPYAO5U6cjs.isLayerEffectKind.call(void 0, kind)) throw new PaintEditorError(`Unknown effect kind "${String(kind)}". Kinds: ${_chunkDPYAO5U6cjs.LAYER_EFFECT_KINDS.join(", ")}.`);
6601
+ if (!_chunkPVJMTLPJcjs.isLayerEffectKind.call(void 0, kind)) throw new PaintEditorError(`Unknown effect kind "${String(kind)}". Kinds: ${_chunkPVJMTLPJcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
6586
6602
  const current = _nullishCoalesce(this.effectsLayer(id, "add effects").effects, () => ( { enabled: true, items: [] }));
6587
6603
  const ids = new Set(current.items.map((e) => e.id));
6588
- let effectId = _chunkDPYAO5U6cjs.newEffectId.call(void 0, );
6589
- while (ids.has(effectId)) effectId = _chunkDPYAO5U6cjs.newEffectId.call(void 0, );
6604
+ let effectId = _chunkPVJMTLPJcjs.newEffectId.call(void 0, );
6605
+ while (ids.has(effectId)) effectId = _chunkPVJMTLPJcjs.newEffectId.call(void 0, );
6590
6606
  const { id: _id, kind: _kind, ...rest } = settings;
6591
- const effect = effectGuard(() => _chunkDPYAO5U6cjs.mergeLayerEffect.call(void 0, _chunkDPYAO5U6cjs.defaultLayerEffect.call(void 0, kind, effectId), rest));
6607
+ const effect = effectGuard(() => _chunkPVJMTLPJcjs.mergeLayerEffect.call(void 0, _chunkPVJMTLPJcjs.defaultLayerEffect.call(void 0, kind, effectId), rest));
6592
6608
  const items = [...current.items];
6593
6609
  const at = index === void 0 ? items.length : Math.max(0, Math.min(items.length, Math.floor(index)));
6594
6610
  items.splice(at, 0, effect);
6595
- this.writeLayerEffects(id, { ...current, items }, `Add ${_chunkDPYAO5U6cjs.layerEffectLabel.call(void 0, kind)}`, true);
6611
+ this.writeLayerEffects(id, { ...current, items }, `Add ${_chunkPVJMTLPJcjs.layerEffectLabel.call(void 0, kind)}`, true);
6596
6612
  return { effect, effects: this.getLayerEffects(id) };
6597
6613
  }
6598
6614
  /**
@@ -6604,15 +6620,15 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
6604
6620
  const current = this.effectsLayer(id, "change its effects").effects;
6605
6621
  const i = this.requireEffect(id, effectId);
6606
6622
  const items = [...current.items];
6607
- items[i] = effectGuard(() => _chunkDPYAO5U6cjs.mergeLayerEffect.call(void 0, items[i], changes));
6608
- this.writeLayerEffects(id, { ...current, items }, `Change ${_chunkDPYAO5U6cjs.layerEffectLabel.call(void 0, items[i].kind)}`, commitToHistory);
6623
+ items[i] = effectGuard(() => _chunkPVJMTLPJcjs.mergeLayerEffect.call(void 0, items[i], changes));
6624
+ this.writeLayerEffects(id, { ...current, items }, `Change ${_chunkPVJMTLPJcjs.layerEffectLabel.call(void 0, items[i].kind)}`, commitToHistory);
6609
6625
  return this.getLayerEffects(id);
6610
6626
  }
6611
6627
  /** Removes one effect (one undo step). Returns the layer's remaining effects. */
6612
6628
  removeLayerEffect(id, effectId) {
6613
6629
  const current = this.effectsLayer(id, "change its effects").effects;
6614
6630
  const i = this.requireEffect(id, effectId);
6615
- this.writeLayerEffects(id, { ...current, items: current.items.filter((e) => e.id !== effectId) }, `Remove ${_chunkDPYAO5U6cjs.layerEffectLabel.call(void 0, current.items[i].kind)}`, true);
6631
+ this.writeLayerEffects(id, { ...current, items: current.items.filter((e) => e.id !== effectId) }, `Remove ${_chunkPVJMTLPJcjs.layerEffectLabel.call(void 0, current.items[i].kind)}`, true);
6616
6632
  return this.getLayerEffects(id);
6617
6633
  }
6618
6634
  /** Turns all of a layer's effects on or off and, when given, sets Scale Effects (0.01..10). One undo step. */
@@ -6630,7 +6646,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
6630
6646
  /** Replaces a layer's effects, validated (`null` removes them). One undo step. Returns the effects. */
6631
6647
  setLayerEffects(id, effects, commitToHistory = true) {
6632
6648
  this.effectsLayer(id, "change its effects");
6633
- if (effects) effectGuard(() => _chunkDPYAO5U6cjs.validateLayerEffects.call(void 0, effects));
6649
+ if (effects) effectGuard(() => _chunkPVJMTLPJcjs.validateLayerEffects.call(void 0, effects));
6634
6650
  this.writeLayerEffects(id, effects, "Layer effects", commitToHistory);
6635
6651
  return this.getLayerEffects(id);
6636
6652
  }
@@ -6641,7 +6657,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
6641
6657
  effectsLayer(id, action) {
6642
6658
  this.requireIdle("changing layer effects");
6643
6659
  const l = this.requireLayer(id);
6644
- if (_chunkDPYAO5U6cjs.isLayerLocked.call(void 0, l, "all")) throw new PaintEditorError(`Layer "${l.name}" is fully locked, so it can't ${action}; unlock it first (locks {all: false}).`);
6660
+ if (_chunkPVJMTLPJcjs.isLayerLocked.call(void 0, l, "all")) throw new PaintEditorError(`Layer "${l.name}" is fully locked, so it can't ${action}; unlock it first (locks {all: false}).`);
6645
6661
  return l;
6646
6662
  }
6647
6663
  requireEffect(id, effectId) {
@@ -6656,30 +6672,30 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
6656
6672
  const next = { ...this.requireLayer(id) };
6657
6673
  if (effects && (effects.items.length || effects.psd || effects.scale !== void 0 || !effects.enabled)) next.effects = effects;
6658
6674
  else delete next.effects;
6659
- this.commitOrAmend(label, { ...this.doc, layers: _chunkDPYAO5U6cjs.mapLayer.call(void 0, this.doc.layers, id, () => next) }, commitToHistory);
6675
+ this.commitOrAmend(label, { ...this.doc, layers: _chunkPVJMTLPJcjs.mapLayer.call(void 0, this.doc.layers, id, () => next) }, commitToHistory);
6660
6676
  }
6661
6677
  removeLayer(id) {
6662
6678
  this.requireIdle("removing a layer");
6663
6679
  const l = this.requireLayer(id);
6664
- if (_chunkDPYAO5U6cjs.isLayerLocked.call(void 0, l, "all")) throw new PaintEditorError(`Layer "${l.name}" is fully locked; unlock it before removing it.`);
6665
- const wetIds = this.wet.wetLayerIds().filter((x) => x === id || l.type === "group" && _chunkDPYAO5U6cjs.findLayer.call(void 0, l.children, x));
6680
+ if (_chunkPVJMTLPJcjs.isLayerLocked.call(void 0, l, "all")) throw new PaintEditorError(`Layer "${l.name}" is fully locked; unlock it before removing it.`);
6681
+ const wetIds = this.wet.wetLayerIds().filter((x) => x === id || l.type === "group" && _chunkPVJMTLPJcjs.findLayer.call(void 0, l.children, x));
6666
6682
  if (wetIds.length) {
6667
6683
  this.beginWetOp();
6668
6684
  for (const x of wetIds) this.wet.world.removeLane(x);
6669
6685
  }
6670
- const layers = _chunkDPYAO5U6cjs.mapLayer.call(void 0, this.doc.layers, id, () => null);
6686
+ const layers = _chunkPVJMTLPJcjs.mapLayer.call(void 0, this.doc.layers, id, () => null);
6671
6687
  let active = this.doc.activeLayerId;
6672
- if (active && !_chunkDPYAO5U6cjs.findLayer.call(void 0, layers, active)) active = _nullishCoalesce(_optionalChain([_chunkDPYAO5U6cjs.flattenLayers.call(void 0, layers), 'access', _300 => _300.filter, 'call', _301 => _301((x) => x.type === "pixel"), 'access', _302 => _302.pop, 'call', _303 => _303(), 'optionalAccess', _304 => _304.id]), () => ( null));
6673
- this.commit("Remove layer", { ...this.doc, layers, activeLayerId: active, ...this.thickWithout(_chunkDPYAO5U6cjs.flattenLayers.call(void 0, [l]).map((x) => x.id)), ...this.stickersWithout(_chunkDPYAO5U6cjs.flattenLayers.call(void 0, [l]).map((x) => x.id)), ...this.liveStrokesWithout(_chunkDPYAO5U6cjs.flattenLayers.call(void 0, [l]).map((x) => x.id)), ...this.lightWithout(_chunkDPYAO5U6cjs.flattenLayers.call(void 0, [l]).map((x) => x.id)) });
6688
+ if (active && !_chunkPVJMTLPJcjs.findLayer.call(void 0, layers, active)) active = _nullishCoalesce(_optionalChain([_chunkPVJMTLPJcjs.flattenLayers.call(void 0, layers), 'access', _300 => _300.filter, 'call', _301 => _301((x) => x.type === "pixel"), 'access', _302 => _302.pop, 'call', _303 => _303(), 'optionalAccess', _304 => _304.id]), () => ( null));
6689
+ this.commit("Remove layer", { ...this.doc, layers, activeLayerId: active, ...this.thickWithout(_chunkPVJMTLPJcjs.flattenLayers.call(void 0, [l]).map((x) => x.id)), ...this.stickersWithout(_chunkPVJMTLPJcjs.flattenLayers.call(void 0, [l]).map((x) => x.id)), ...this.liveStrokesWithout(_chunkPVJMTLPJcjs.flattenLayers.call(void 0, [l]).map((x) => x.id)), ...this.lightWithout(_chunkPVJMTLPJcjs.flattenLayers.call(void 0, [l]).map((x) => x.id)) });
6674
6690
  return { removed: id, activeLayerId: active };
6675
6691
  }
6676
6692
  duplicateLayer(id) {
6677
6693
  this.requireIdle("duplicating a layer");
6678
- if (_chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, id)) {
6694
+ if (_chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, id)) {
6679
6695
  const inside = (l) => l.type === "group" ? l.children.flatMap(inside) : [l.id];
6680
- this.dryLayersFirst(inside(_chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, id).layer));
6696
+ this.dryLayersFirst(inside(_chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, id).layer));
6681
6697
  }
6682
- const loc = _chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, id);
6698
+ const loc = _chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, id);
6683
6699
  if (!loc) throw new PaintEditorError(`Unknown layer "${id}". Call list_layers for the ids.`);
6684
6700
  const thick = { ..._nullishCoalesce(this.doc.thick, () => ( {})) };
6685
6701
  const stickers = { ..._nullishCoalesce(this.doc.stickers, () => ( {})) };
@@ -6695,43 +6711,43 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
6695
6711
  return l.type === "group" ? { ...l, id: id2, children: l.children.map(copy) } : { ...l, id: id2 };
6696
6712
  };
6697
6713
  const dup = { ...copy(loc.layer), name: `${loc.layer.name} copy` };
6698
- const layers = _chunkDPYAO5U6cjs.insertLayer.call(void 0, this.doc.layers, dup, _nullishCoalesce(_optionalChain([loc, 'access', _305 => _305.parent, 'optionalAccess', _306 => _306.id]), () => ( null)), loc.index + 1);
6714
+ const layers = _chunkPVJMTLPJcjs.insertLayer.call(void 0, this.doc.layers, dup, _nullishCoalesce(_optionalChain([loc, 'access', _305 => _305.parent, 'optionalAccess', _306 => _306.id]), () => ( null)), loc.index + 1);
6699
6715
  this.commit("Duplicate layer", this.withWetEvents({ ...this.doc, layers, activeLayerId: dup.id, ...this.doc.thick ? { thick } : {}, ...this.doc.stickers ? { stickers } : {}, ...this.doc.liveStrokes ? { liveStrokes } : {}, ...this.doc.light ? { light } : {} }));
6700
6716
  return this.describeLayer(dup);
6701
6717
  }
6702
6718
  /** Moves a layer to `index` (0 = bottom) within `parentId` (default its own parent; `null` = top level). */
6703
6719
  moveLayer(id, index, parentId) {
6704
6720
  this.requireIdle("moving a layer");
6705
- const loc = _chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, id);
6721
+ const loc = _chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, id);
6706
6722
  if (!loc) throw new PaintEditorError(`Unknown layer "${id}". Call list_layers for the ids.`);
6707
6723
  const target = parentId === void 0 ? _nullishCoalesce(_optionalChain([loc, 'access', _307 => _307.parent, 'optionalAccess', _308 => _308.id]), () => ( null)) : parentId;
6708
6724
  if (target) {
6709
6725
  const g = this.requireLayer(target);
6710
6726
  if (g.type !== "group") throw new PaintEditorError(`Layer "${g.name}" is not a group; pass a group id as parentId.`);
6711
- if (target === id || loc.layer.type === "group" && _chunkDPYAO5U6cjs.findLayer.call(void 0, loc.layer.children, target)) throw new PaintEditorError("A group cannot move into itself.");
6727
+ if (target === id || loc.layer.type === "group" && _chunkPVJMTLPJcjs.findLayer.call(void 0, loc.layer.children, target)) throw new PaintEditorError("A group cannot move into itself.");
6712
6728
  }
6713
- const without = _chunkDPYAO5U6cjs.mapLayer.call(void 0, this.doc.layers, id, () => null);
6714
- const siblings = target ? _chunkDPYAO5U6cjs.findLayer.call(void 0, without, target).layer.children : without;
6729
+ const without = _chunkPVJMTLPJcjs.mapLayer.call(void 0, this.doc.layers, id, () => null);
6730
+ const siblings = target ? _chunkPVJMTLPJcjs.findLayer.call(void 0, without, target).layer.children : without;
6715
6731
  if (!Number.isInteger(index) || index < 0 || index > siblings.length) throw new PaintEditorError(`index ${index} is out of range; use 0..${siblings.length} (0 is the bottom).`);
6716
- const layers = _chunkDPYAO5U6cjs.insertLayer.call(void 0, without, loc.layer, target, index);
6732
+ const layers = _chunkPVJMTLPJcjs.insertLayer.call(void 0, without, loc.layer, target, index);
6717
6733
  this.commit("Move layer", { ...this.doc, layers });
6718
6734
  return this.describeLayer(loc.layer);
6719
6735
  }
6720
6736
  /** Merges a pixel layer into the pixel layer below it (keeping the lower one's settings). */
6721
6737
  mergeDown(id) {
6722
6738
  this.requireIdle("merging");
6723
- const pre = _chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, id);
6739
+ const pre = _chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, id);
6724
6740
  if (pre) {
6725
6741
  const sib = pre.parent ? pre.parent.children : this.doc.layers;
6726
6742
  this.dryLayersFirst([id, _optionalChain([sib, 'access', _309 => _309[pre.index - 1], 'optionalAccess', _310 => _310.id])].filter((x) => Boolean(x)));
6727
6743
  }
6728
- const loc = _chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, id);
6744
+ const loc = _chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, id);
6729
6745
  if (!loc) throw new PaintEditorError(`Unknown layer "${id}". Call list_layers for the ids.`);
6730
6746
  const siblings = loc.parent ? loc.parent.children : this.doc.layers;
6731
6747
  const below = siblings[loc.index - 1];
6732
6748
  const upper = loc.layer;
6733
6749
  if (!isPixelLayer(upper) || !isPixelLayer(below)) throw new PaintEditorError("Merge down needs a pixel layer directly above another pixel layer in the same group.");
6734
- if (_chunkDPYAO5U6cjs.isLayerLocked.call(void 0, below, "pixels")) throw new PaintEditorError(`Layer "${below.name}" has its pixels locked; unlock it to merge into it.`);
6750
+ if (_chunkPVJMTLPJcjs.isLayerLocked.call(void 0, below, "pixels")) throw new PaintEditorError(`Layer "${below.name}" has its pixels locked; unlock it to merge into it.`);
6735
6751
  const rect = unionRect(this.describeLayer(below).bounds, this.describeLayer(upper).bounds);
6736
6752
  let surface = _chunk474IQG74cjs.emptySurface.call(void 0, 4);
6737
6753
  if (rect) {
@@ -6741,7 +6757,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
6741
6757
  surface = _chunk474IQG74cjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data: px }, 4, rect.x, rect.y);
6742
6758
  }
6743
6759
  const merged = { ...below, surface, offset: { x: 0, y: 0 } };
6744
- const layers = _chunkDPYAO5U6cjs.mapLayer.call(void 0, _chunkDPYAO5U6cjs.mapLayer.call(void 0, this.doc.layers, upper.id, () => null), below.id, () => merged);
6760
+ const layers = _chunkPVJMTLPJcjs.mapLayer.call(void 0, _chunkPVJMTLPJcjs.mapLayer.call(void 0, this.doc.layers, upper.id, () => null), below.id, () => merged);
6745
6761
  const toDoc = (t, l) => t ? _chunk474IQG74cjs.translateSurface.call(void 0, t, l.offset.x, l.offset.y) : void 0;
6746
6762
  const mergedLight = _optionalChain([this, 'access', _311 => _311.doc, 'access', _312 => _312.light, 'optionalAccess', _313 => _313[upper.id]]) || _optionalChain([this, 'access', _314 => _314.doc, 'access', _315 => _315.light, 'optionalAccess', _316 => _316[below.id]]) ? mergeLight(toDoc(_optionalChain([this, 'access', _317 => _317.doc, 'access', _318 => _318.light, 'optionalAccess', _319 => _319[below.id]]), below), upper.visible ? toDoc(_optionalChain([this, 'access', _320 => _320.doc, 'access', _321 => _321.light, 'optionalAccess', _322 => _322[upper.id]]), upper) : void 0, _chunk474IQG74cjs.translateSurface.call(void 0, upper.surface, upper.offset.x, upper.offset.y)) : void 0;
6747
6763
  const lightAfter = _nullishCoalesce(this.lightWithout([upper.id, below.id]).light, () => ( (this.doc.light ? { ...this.doc.light } : void 0)));
@@ -6758,7 +6774,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
6758
6774
  this.wet.world.removeLane(l.id);
6759
6775
  }
6760
6776
  const bounds = this.describeLayer(l).bounds;
6761
- this.commit("Clear layer", this.withPaintEvent({ ...this.doc, layers: _chunkDPYAO5U6cjs.mapLayer.call(void 0, this.doc.layers, l.id, () => ({ ...l, surface: _chunk474IQG74cjs.emptySurface.call(void 0, 4) })), ...this.thickWithout([l.id]), ...this.stickersWithout([l.id]), ..._optionalChain([this, 'access', _323 => _323.doc, 'access', _324 => _324.liveStrokes, 'optionalAccess', _325 => _325[l.id]]) ? { liveStrokes: { ...this.doc.liveStrokes, [l.id]: [] } } : {}, ...this.lightWithout([l.id]) }, { kind: "clear", layerId: l.id }));
6777
+ this.commit("Clear layer", this.withPaintEvent({ ...this.doc, layers: _chunkPVJMTLPJcjs.mapLayer.call(void 0, this.doc.layers, l.id, () => ({ ...l, surface: _chunk474IQG74cjs.emptySurface.call(void 0, 4) })), ...this.thickWithout([l.id]), ...this.stickersWithout([l.id]), ..._optionalChain([this, 'access', _323 => _323.doc, 'access', _324 => _324.liveStrokes, 'optionalAccess', _325 => _325[l.id]]) ? { liveStrokes: { ...this.doc.liveStrokes, [l.id]: [] } } : {}, ...this.lightWithout([l.id]) }, { kind: "clear", layerId: l.id }));
6762
6778
  return { layerId: l.id, bounds };
6763
6779
  }
6764
6780
  /**
@@ -6797,14 +6813,14 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
6797
6813
  background: rgbaOf(this.doc.paper.color),
6798
6814
  opacity,
6799
6815
  blend,
6800
- lockTransparency: _chunkDPYAO5U6cjs.isLayerLocked.call(void 0, l, "transparency"),
6816
+ lockTransparency: _chunkPVJMTLPJcjs.isLayerLocked.call(void 0, l, "transparency"),
6801
6817
  selection: null,
6802
6818
  offset: l.offset
6803
6819
  };
6804
6820
  const surface = this.applyCoverage(l, coverage, rect, apply);
6805
6821
  const lit = _optionalChain([this, 'access', _333 => _333.doc, 'access', _334 => _334.light, 'optionalAccess', _335 => _335[l.id]]);
6806
6822
  const light = lit ? withLayerLight(this.doc.light, l.id, scaleLight(lit, 1 - opacity)) : void 0;
6807
- this.commit("Fill layer", this.withPaintEvent(this.withWetEvents({ ...this.doc, layers: _chunkDPYAO5U6cjs.mapLayer.call(void 0, this.doc.layers, l.id, () => ({ ...l, surface })), ...light ? { light } : {} }), { kind: "fill", layerId: l.id, data: { color, opacity, grain: grainAmount, pressure, blend } }));
6823
+ this.commit("Fill layer", this.withPaintEvent(this.withWetEvents({ ...this.doc, layers: _chunkPVJMTLPJcjs.mapLayer.call(void 0, this.doc.layers, l.id, () => ({ ...l, surface })), ...light ? { light } : {} }), { kind: "fill", layerId: l.id, data: { color, opacity, grain: grainAmount, pressure, blend } }));
6808
6824
  return { layerId: l.id, bounds: rect };
6809
6825
  }
6810
6826
  applyCoverage(l, coverage, rect, apply) {
@@ -6845,7 +6861,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
6845
6861
  }
6846
6862
  /** The effect a layer is drawn from, or `undefined` for other layers. */
6847
6863
  getEffectLayer(layerId) {
6848
- return _chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, layerId) ? _optionalChain([this, 'access', _340 => _340.doc, 'access', _341 => _341.effectLayers, 'optionalAccess', _342 => _342[layerId]]) : void 0;
6864
+ return _chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, layerId) ? _optionalChain([this, 'access', _340 => _340.doc, 'access', _341 => _341.effectLayers, 'optionalAccess', _342 => _342[layerId]]) : void 0;
6849
6865
  }
6850
6866
  /** The effect paper (without its pixels), or `null`. */
6851
6867
  getPaperEffect() {
@@ -6974,10 +6990,10 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
6974
6990
  const pixels = await this.renderEffectCanvas(d, values, options.time);
6975
6991
  this.requireIdle("adding a layer");
6976
6992
  const above = _nullishCoalesce(options.aboveId, () => ( this.doc.activeLayerId));
6977
- const loc = above ? _chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, above) : null;
6993
+ const loc = above ? _chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, above) : null;
6978
6994
  if (options.aboveId !== void 0 && !loc) throw new PaintEditorError(`Layer "${options.aboveId}" was removed while the effect rendered.`);
6979
6995
  const layer = { ...createPaintLayer(_optionalChain([options, 'access', _352 => _352.name, 'optionalAccess', _353 => _353.trim, 'call', _354 => _354()]) || d.name), surface: _chunk474IQG74cjs.surfaceFromPixels.call(void 0, pixels, 4), opacity: _nullishCoalesce(options.opacity, () => ( 1)), blend: _nullishCoalesce(options.blend, () => ( "normal")) };
6980
- const layers = _chunkDPYAO5U6cjs.insertLayer.call(void 0, this.doc.layers, layer, _nullishCoalesce(_optionalChain([loc, 'optionalAccess', _355 => _355.parent, 'optionalAccess', _356 => _356.id]), () => ( null)), loc ? loc.index + 1 : void 0);
6996
+ const layers = _chunkPVJMTLPJcjs.insertLayer.call(void 0, this.doc.layers, layer, _nullishCoalesce(_optionalChain([loc, 'optionalAccess', _355 => _355.parent, 'optionalAccess', _356 => _356.id]), () => ( null)), loc ? loc.index + 1 : void 0);
6981
6997
  const source = this.sourceOf(d, values, options.time);
6982
6998
  this.commit("Add effect layer", { ...this.doc, layers, activeLayerId: layer.id, effectLayers: { ..._nullishCoalesce(this.doc.effectLayers, () => ( {})), [layer.id]: source } });
6983
6999
  return { layer: this.describeLayer(layer), source };
@@ -7001,7 +7017,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
7001
7017
  this.requireIdle("changing an effect layer");
7002
7018
  if (!isPixelLayer(now)) throw new PaintEditorError(`Layer "${l.name}" was removed while the effect rendered.`);
7003
7019
  const source = this.sourceOf(d, values, time);
7004
- this.commitOrAmend("Effect layer", { ...this.doc, layers: _chunkDPYAO5U6cjs.mapLayer.call(void 0, this.doc.layers, l.id, () => ({ ...now, surface: _chunk474IQG74cjs.surfaceFromPixels.call(void 0, pixels, 4), offset: { x: 0, y: 0 } })), effectLayers: { ..._nullishCoalesce(this.doc.effectLayers, () => ( {})), [l.id]: source } }, commitToHistory);
7020
+ this.commitOrAmend("Effect layer", { ...this.doc, layers: _chunkPVJMTLPJcjs.mapLayer.call(void 0, this.doc.layers, l.id, () => ({ ...now, surface: _chunk474IQG74cjs.surfaceFromPixels.call(void 0, pixels, 4), offset: { x: 0, y: 0 } })), effectLayers: { ..._nullishCoalesce(this.doc.effectLayers, () => ( {})), [l.id]: source } }, commitToHistory);
7005
7021
  return source;
7006
7022
  }
7007
7023
  /** Turns an effect layer into a plain pixel layer, keeping its pixels (one undo step). */
@@ -7029,9 +7045,9 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
7029
7045
  const rect = this.canvasRectOf(now);
7030
7046
  const before = _chunk474IQG74cjs.readRegion.call(void 0, now.surface, rect);
7031
7047
  let after = overPixels(before, pixels.data, _nullishCoalesce(options.opacity, () => ( 1)));
7032
- if (options.lockTransparency || _chunkDPYAO5U6cjs.isLayerLocked.call(void 0, now, "transparency")) after = mixPixels(before, after, 1);
7048
+ if (options.lockTransparency || _chunkPVJMTLPJcjs.isLayerLocked.call(void 0, now, "transparency")) after = mixPixels(before, after, 1);
7033
7049
  const surface = _chunk474IQG74cjs.writeRegion.call(void 0, now.surface, rect, after);
7034
- this.commit("Effect fill", { ...this.doc, layers: _chunkDPYAO5U6cjs.mapLayer.call(void 0, this.doc.layers, now.id, () => ({ ...now, surface })) });
7050
+ this.commit("Effect fill", { ...this.doc, layers: _chunkPVJMTLPJcjs.mapLayer.call(void 0, this.doc.layers, now.id, () => ({ ...now, surface })) });
7035
7051
  return { layerId: now.id, source: this.sourceOf(d, values, options.time) };
7036
7052
  }
7037
7053
  // --- Effect paint ----------------------------------------------------------------
@@ -7159,7 +7175,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
7159
7175
  * its pixels are not rendered.
7160
7176
  */
7161
7177
  strokeEffect(init, brush) {
7162
- if (!_chunkRSIKDWOPcjs.brushTakesPaint.call(void 0, brush)) return null;
7178
+ if (!_chunkTZOX7KWVcjs.brushTakesPaint.call(void 0, brush)) return null;
7163
7179
  let source = null;
7164
7180
  if (init.paint !== void 0) {
7165
7181
  if (!isPaintEffectPaint(init.paint)) return null;
@@ -7208,7 +7224,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
7208
7224
  const out = await this.effectsRenderer.render(this.effects.require(), d.id, { width: rect.width, height: rect.height }, { time: _nullishCoalesce(options.time, () => ( 0)), values, inputs });
7209
7225
  const now = this.sameLayerAfterRender(l);
7210
7226
  const surface = _chunk474IQG74cjs.writeRegion.call(void 0, now.surface, rect, mixPixels(before, out.data, amount));
7211
- this.commit("Light effect", { ...this.doc, layers: _chunkDPYAO5U6cjs.mapLayer.call(void 0, this.doc.layers, now.id, () => ({ ...now, surface })) });
7227
+ this.commit("Light effect", { ...this.doc, layers: _chunkPVJMTLPJcjs.mapLayer.call(void 0, this.doc.layers, now.id, () => ({ ...now, surface })) });
7212
7228
  return { layerId: now.id, source: this.sourceOf(d, values, options.time), amount };
7213
7229
  }
7214
7230
  // --- Brushes -------------------------------------------------------------------
@@ -7220,7 +7236,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
7220
7236
  }
7221
7237
  requireEntry(id) {
7222
7238
  const e = this.findEntry(id);
7223
- if (!e) throw new PaintEditorError(`Unknown brush "${id}". ${_chunkRSIKDWOPcjs.closest.call(void 0, id, this.brushEntries.map((x) => x.brush.id))}Call list_brush_presets for the ids.`);
7239
+ if (!e) throw new PaintEditorError(`Unknown brush "${id}". ${_chunkTZOX7KWVcjs.closest.call(void 0, id, this.brushEntries.map((x) => x.brush.id))}Call list_brush_presets for the ids.`);
7224
7240
  return e;
7225
7241
  }
7226
7242
  requireBrush(id) {
@@ -7246,7 +7262,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
7246
7262
  /** A library brush by id, as the engine paints it (`undefined` when unknown). */
7247
7263
  getBrush(id) {
7248
7264
  const b = this.findBrush(id);
7249
- return b ? _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, b, b) : void 0;
7265
+ return b ? _chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0, b, b) : void 0;
7250
7266
  }
7251
7267
  /** A library brush by id as stored (its facets), or without an id the active brush as edited. */
7252
7268
  getBrushSpec(id) {
@@ -7264,7 +7280,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
7264
7280
  const baseSpec = entry ? entry.spec : this.brushSpec;
7265
7281
  if (changes.paint !== void 0 && changes.paint !== null) this.readStrokePaint(changes.paint);
7266
7282
  const unchanged = !Object.keys(changes).length;
7267
- const next = _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, { ...changes, id: base.id }, base);
7283
+ const next = _chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0, { ...changes, id: base.id }, base);
7268
7284
  if (entry) this.takeBrushColour(entry.spec);
7269
7285
  this.useBrush(next, unchanged ? baseSpec : brushSpecOf(next, baseSpec), unchanged && base.builtin === true);
7270
7286
  return this.brush;
@@ -7283,7 +7299,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
7283
7299
  for (const k of unset) delete base[k];
7284
7300
  const spec = this.readBrushPatch(base, patch, problems);
7285
7301
  if (entry || _optionalChain([patch, 'access', _373 => _373.colour, 'optionalAccess', _374 => _374.default]) !== void 0) this.takeBrushColour(spec);
7286
- this.useBrush(unchanged && entry ? entry.brush : _chunkRSIKDWOPcjs.resolveBrush.call(void 0, spec), spec, unchanged && _optionalChain([entry, 'optionalAccess', _375 => _375.builtin]) === true);
7302
+ this.useBrush(unchanged && entry ? entry.brush : _chunkTZOX7KWVcjs.resolveBrush.call(void 0, spec), spec, unchanged && _optionalChain([entry, 'optionalAccess', _375 => _375.builtin]) === true);
7287
7303
  return { brush: this.brush, spec: copyJSON(this.brushSpec), problems };
7288
7304
  }
7289
7305
  /**
@@ -7297,11 +7313,11 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
7297
7313
  if (paint && typeof paint === "object" && "type" in paint && paint.type === "gradient") this.readStrokePaint(paint);
7298
7314
  let next;
7299
7315
  try {
7300
- next = _chunkRSIKDWOPcjs.normalizeBrushSpec.call(void 0, { ...spec, id: this.brush.id }, problems);
7316
+ next = _chunkTZOX7KWVcjs.normalizeBrushSpec.call(void 0, { ...spec, id: this.brush.id }, problems);
7301
7317
  } catch (e) {
7302
7318
  throw new PaintEditorError(e.message);
7303
7319
  }
7304
- this.useBrush(_chunkRSIKDWOPcjs.resolveBrush.call(void 0, next), next, false);
7320
+ this.useBrush(_chunkTZOX7KWVcjs.resolveBrush.call(void 0, next), next, false);
7305
7321
  return { brush: this.brush, spec: copyJSON(this.brushSpec), problems };
7306
7322
  }
7307
7323
  /**
@@ -7310,22 +7326,22 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
7310
7326
  */
7311
7327
  brushChanges(patch, from) {
7312
7328
  const entry = typeof from === "string" ? this.requireEntry(from) : null;
7313
- const base = entry ? entry.brush : typeof from === "object" ? _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, from, from) : this.brush;
7314
- const spec = entry ? entry.spec : typeof from === "object" ? _chunkRSIKDWOPcjs.migrateBrushV1.call(void 0, base) : this.brushSpec;
7315
- return engineChanges(base, _chunkRSIKDWOPcjs.resolveBrush.call(void 0, this.readBrushPatch(spec, patch, [])));
7329
+ const base = entry ? entry.brush : typeof from === "object" ? _chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0, from, from) : this.brush;
7330
+ const spec = entry ? entry.spec : typeof from === "object" ? _chunkTZOX7KWVcjs.migrateBrushV1.call(void 0, base) : this.brushSpec;
7331
+ return engineChanges(base, _chunkTZOX7KWVcjs.resolveBrush.call(void 0, this.readBrushPatch(spec, patch, [])));
7316
7332
  }
7317
7333
  readBrushPatch(base, patch, problems) {
7318
7334
  const { id: _id, name, ...rest } = patch;
7319
7335
  const paint = _optionalChain([rest, 'access', _378 => _378.colour, 'optionalAccess', _379 => _379.default]);
7320
7336
  if (paint && typeof paint === "object" && "type" in paint && paint.type === "gradient") this.readStrokePaint(paint);
7321
7337
  try {
7322
- return _chunkRSIKDWOPcjs.normalizeBrushSpec.call(void 0, _chunkMQGQTKVWcjs.mergeBrushPatch.call(void 0, base, { ...rest, ...name !== void 0 ? { name } : {} }), problems);
7338
+ return _chunkTZOX7KWVcjs.normalizeBrushSpec.call(void 0, _chunkPYTJBVW5cjs.mergeBrushPatch.call(void 0, base, { ...rest, ...name !== void 0 ? { name } : {} }), problems);
7323
7339
  } catch (e) {
7324
7340
  throw new PaintEditorError(e.message);
7325
7341
  }
7326
7342
  }
7327
7343
  useBrush(next, spec, builtin) {
7328
- next = _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, next, next);
7344
+ next = _chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0, next, next);
7329
7345
  if (builtin) next.builtin = true;
7330
7346
  else delete next.builtin;
7331
7347
  this.brush = next;
@@ -7341,9 +7357,9 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
7341
7357
  * saved brush.
7342
7358
  */
7343
7359
  async saveBrush(options) {
7344
- if (!_chunkRSIKDWOPcjs.BRUSH_ID.test(options.id)) throw new PaintEditorError(`Brush id "${options.id}" is invalid; use lowercase letters, digits and dashes (e.g. "my-pencil").`);
7360
+ if (!_chunkTZOX7KWVcjs.BRUSH_ID.test(options.id)) throw new PaintEditorError(`Brush id "${options.id}" is invalid; use lowercase letters, digits and dashes (e.g. "my-pencil").`);
7345
7361
  if (this.brushLibrary.isBuiltin(options.id)) throw new PaintEditorError(`"${options.id}" is a built-in brush; save under another id.`);
7346
- const spec = options.brush ? brushSpecOf(_chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, options.brush, this.brush), this.brushSpec) : this.brushSpec;
7362
+ const spec = options.brush ? brushSpecOf(_chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0, options.brush, this.brush), this.brushSpec) : this.brushSpec;
7347
7363
  const { brush } = await libraryCall(() => this.brushLibrary.save({ ...spec, id: options.id, name: _nullishCoalesce(options.name, () => ( spec.name)) }, { overwrite: true }));
7348
7364
  await this.refreshBrushes();
7349
7365
  return this.requireBrush(brush.id);
@@ -7356,7 +7372,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
7356
7372
  }
7357
7373
  /** The user's saved brushes, as the engine paints them. */
7358
7374
  getUserBrushes() {
7359
- return this.brushEntries.filter((e) => !e.builtin).map((e) => _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, e.brush, e.brush));
7375
+ return this.brushEntries.filter((e) => !e.builtin).map((e) => _chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0, e.brush, e.brush));
7360
7376
  }
7361
7377
  /** A brush library file (version 2) of the given brushes (default: the user's brushes). */
7362
7378
  exportBrushes(ids) {
@@ -7462,7 +7478,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
7462
7478
  * brush's gradient, else the editor's gradient paint. Erasers, blenders and smudges take none.
7463
7479
  */
7464
7480
  strokeGradient(init, brush, color) {
7465
- if (!_chunkRSIKDWOPcjs.brushTakesPaint.call(void 0, brush)) return null;
7481
+ if (!_chunkTZOX7KWVcjs.brushTakesPaint.call(void 0, brush)) return null;
7466
7482
  let g = null;
7467
7483
  if (init.paint !== void 0) {
7468
7484
  if (isPaintEffectPaint(init.paint)) return null;
@@ -7539,7 +7555,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
7539
7555
  // --- Strokes -------------------------------------------------------------------
7540
7556
  strokeBrush(init) {
7541
7557
  let brush = init.brushId !== void 0 ? this.requireBrush(init.brushId) : this.brush;
7542
- if (init.brush) brush = _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, { ...init.brush, id: brush.id }, brush);
7558
+ if (init.brush) brush = _chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0, { ...init.brush, id: brush.id }, brush);
7543
7559
  return brush;
7544
7560
  }
7545
7561
  /**
@@ -7563,16 +7579,16 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
7563
7579
  let layer = (() => {
7564
7580
  const id = _nullishCoalesce(init.layerId, () => ( doc.activeLayerId));
7565
7581
  if (!id) throw new PaintEditorError("There is no active layer to paint on; add one with add_layer.");
7566
- const loc = _chunkDPYAO5U6cjs.findLayer.call(void 0, doc.layers, id);
7582
+ const loc = _chunkPVJMTLPJcjs.findLayer.call(void 0, doc.layers, id);
7567
7583
  if (!loc) throw new PaintEditorError(`Unknown layer "${id}". Call list_layers for the ids.`);
7568
7584
  const l = loc.layer;
7569
7585
  if (!isPixelLayer(l)) throw new PaintEditorError(`Layer "${l.name}" is a group; paint on a pixel layer inside it.`);
7570
- if (_chunkDPYAO5U6cjs.isLayerLocked.call(void 0, l, "pixels")) throw new PaintEditorError(`Layer "${l.name}" has its pixels locked; unlock it (update_layer locks) to paint on it.`);
7586
+ if (_chunkPVJMTLPJcjs.isLayerLocked.call(void 0, l, "pixels")) throw new PaintEditorError(`Layer "${l.name}" has its pixels locked; unlock it (update_layer locks) to paint on it.`);
7571
7587
  if (!l.visible) throw new PaintEditorError(`Layer "${l.name}" is hidden; show it (update_layer visible true) to paint on it.`);
7572
7588
  return l;
7573
7589
  })();
7574
7590
  const brush = this.strokeBrush(init);
7575
- if (this.previewing && _chunkRSIKDWOPcjs.isWetBrush.call(void 0, brush)) throw new PaintEditorError(`Wet paint can't be previewed; the ${brush.name} brush paints wet media. Suggest it with a dry brush.`);
7591
+ if (this.previewing && _chunkTZOX7KWVcjs.isWetBrush.call(void 0, brush)) throw new PaintEditorError(`Wet paint can't be previewed; the ${brush.name} brush paints wet media. Suggest it with a dry brush.`);
7576
7592
  const effect = this.strokeEffect(init, brush);
7577
7593
  if (brush.light.amount > 0) {
7578
7594
  if (brush.engine === "sticker") throw new PaintEditorError(`The ${brush.name} brush sprays stickers, which don't take light yet; paint light with a dab or particle light brush (glow-gel, neon-marker; list_brush_presets lists them), or set light.amount to 0 (set_brush).`);
@@ -7595,16 +7611,16 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
7595
7611
  throw new PaintEditorError(`Layer "${layer.name}" is a sticker layer (its pixels are drawn from its stickers); paint on another layer (add_layer).`);
7596
7612
  }
7597
7613
  let wet;
7598
- if (_chunkRSIKDWOPcjs.isWetBrush.call(void 0, brush)) {
7614
+ if (_chunkTZOX7KWVcjs.isWetBrush.call(void 0, brush)) {
7599
7615
  this.requireWetIdle("painting");
7600
7616
  if (layer.offset.x || layer.offset.y) {
7601
7617
  const moved = { ...layer, surface: _chunk474IQG74cjs.translateSurface.call(void 0, layer.surface, layer.offset.x, layer.offset.y), offset: { x: 0, y: 0 } };
7602
- this.doc = { ...this.doc, layers: _chunkDPYAO5U6cjs.mapLayer.call(void 0, this.doc.layers, layer.id, () => moved) };
7603
- if (doc !== this.doc) doc = { ...doc, layers: _chunkDPYAO5U6cjs.mapLayer.call(void 0, doc.layers, layer.id, () => moved) };
7618
+ this.doc = { ...this.doc, layers: _chunkPVJMTLPJcjs.mapLayer.call(void 0, this.doc.layers, layer.id, () => moved) };
7619
+ if (doc !== this.doc) doc = { ...doc, layers: _chunkPVJMTLPJcjs.mapLayer.call(void 0, doc.layers, layer.id, () => moved) };
7604
7620
  layer = moved;
7605
7621
  }
7606
- if (!this.wet.wetLayerIds().includes(layer.id) && this.wet.wetLayerIds().length >= _chunkKBYB7OWBcjs.MAX_WET_LANES) {
7607
- throw new PaintEditorError(`At most ${_chunkKBYB7OWBcjs.MAX_WET_LANES} layers can hold wet paint at once; dry one first (dry_paint).`);
7622
+ if (!this.wet.wetLayerIds().includes(layer.id) && this.wet.wetLayerIds().length >= _chunkYHDHFJUCcjs.MAX_WET_LANES) {
7623
+ throw new PaintEditorError(`At most ${_chunkYHDHFJUCcjs.MAX_WET_LANES} layers can hold wet paint at once; dry one first (dry_paint).`);
7608
7624
  }
7609
7625
  this.beginWetOp();
7610
7626
  const world = this.wet.ensureLane(layer.id, brush.wet.medium);
@@ -7634,7 +7650,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
7634
7650
  wet = { driver, surface: () => world.display(id).surface };
7635
7651
  } else if (this.wet.wetLayerIds().includes(layer.id)) {
7636
7652
  this.dryLayersFirst([layer.id]);
7637
- const dried = _chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, layer.id).layer;
7653
+ const dried = _chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, layer.id).layer;
7638
7654
  layer = dried;
7639
7655
  }
7640
7656
  let color = init.color === void 0 ? _nullishCoalesce(this.ownColour(init.brushId), () => ( this.color)) : parseColor(init.color);
@@ -7657,7 +7673,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
7657
7673
  layerId: layer.id,
7658
7674
  surface: layer.surface,
7659
7675
  offset: layer.offset,
7660
- lockTransparency: _chunkDPYAO5U6cjs.isLayerLocked.call(void 0, layer, "transparency"),
7676
+ lockTransparency: _chunkPVJMTLPJcjs.isLayerLocked.call(void 0, layer, "transparency"),
7661
7677
  brush,
7662
7678
  color: rgba,
7663
7679
  background: rgbaOf(doc.paper.color),
@@ -7689,7 +7705,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
7689
7705
  const stroke = {
7690
7706
  id: `s${this.strokeCounter++}`,
7691
7707
  layerId: session.layerId,
7692
- brush: _chunkRSIKDWOPcjs.brushToJSON.call(void 0, init.brush),
7708
+ brush: _chunkTZOX7KWVcjs.brushToJSON.call(void 0, init.brush),
7693
7709
  color: init.colorHex,
7694
7710
  points: session.points.map((p) => ({ ...p })),
7695
7711
  seed: init.seed
@@ -7762,7 +7778,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
7762
7778
  const stickers = sprayed ? { ..._nullishCoalesce(this.doc.stickers, () => ( {})), [l.id]: [..._nullishCoalesce(_optionalChain([this, 'access', _414 => _414.doc, 'access', _415 => _415.stickers, 'optionalAccess', _416 => _416[l.id]]), () => ( [])), ...sprayed] } : this.doc.stickers;
7763
7779
  const wetLight = wetStroke && _optionalChain([this, 'access', _417 => _417.wet, 'access', _418 => _418.world, 'optionalAccess', _419 => _419.hasLane, 'call', _420 => _420(l.id)]) ? this.wet.world.lightDisplay(l.id) : null;
7764
7780
  const light = withLayerLight(this.doc.light, l.id, _nullishCoalesce(s.lightChannel(), () => ( wetLight)));
7765
- this.commit(`${brush.name} stroke`, this.withWetEvents(withLiveStroke({ ...this.doc, layers: _chunkDPYAO5U6cjs.mapLayer.call(void 0, this.doc.layers, l.id, () => ({ ...l, surface })), strokes: [...this.doc.strokes, stroke], ...thick ? { thick } : {}, ...stickers ? { stickers } : {}, ...light ? { light } : {} }, stroke)), wetStroke ? before : this.doc);
7781
+ this.commit(`${brush.name} stroke`, this.withWetEvents(withLiveStroke({ ...this.doc, layers: _chunkPVJMTLPJcjs.mapLayer.call(void 0, this.doc.layers, l.id, () => ({ ...l, surface })), strokes: [...this.doc.strokes, stroke], ...thick ? { thick } : {}, ...stickers ? { stickers } : {}, ...light ? { light } : {} }, stroke)), wetStroke ? before : this.doc);
7766
7782
  this.notifySample("end", s, [], stroke.id);
7767
7783
  }
7768
7784
  };
@@ -7793,14 +7809,14 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
7793
7809
  const stroke = this.record(s);
7794
7810
  s.result.strokeId = stroke.id;
7795
7811
  this.paintedBounds.set(stroke, _nullishCoalesce(_optionalChain([s, 'access', _421 => _421.result, 'optionalAccess', _422 => _422.bounds]), () => ( null)));
7796
- const l = _chunkDPYAO5U6cjs.findLayer.call(void 0, out.layers, s.layerId).layer;
7812
+ const l = _chunkPVJMTLPJcjs.findLayer.call(void 0, out.layers, s.layerId).layer;
7797
7813
  const offset = s.init.wet ? { x: 0, y: 0 } : l.offset;
7798
7814
  const ch = s.thickChannels();
7799
7815
  const sprayed = s.stickers();
7800
7816
  const lit = _nullishCoalesce(s.lightChannel(), () => ( (s.init.wet && _optionalChain([this, 'access', _423 => _423.wet, 'access', _424 => _424.world, 'optionalAccess', _425 => _425.hasLane, 'call', _426 => _426(l.id)]) ? this.wet.world.lightDisplay(l.id) : null)));
7801
7817
  out = withLiveStroke({
7802
7818
  ...out,
7803
- layers: _chunkDPYAO5U6cjs.mapLayer.call(void 0, out.layers, l.id, () => ({ ...l, surface, offset })),
7819
+ layers: _chunkPVJMTLPJcjs.mapLayer.call(void 0, out.layers, l.id, () => ({ ...l, surface, offset })),
7804
7820
  strokes: [...out.strokes, stroke],
7805
7821
  ...ch ? { thick: { ..._nullishCoalesce(out.thick, () => ( {})), [l.id]: ch } } : {},
7806
7822
  ...sprayed ? { stickers: { ..._nullishCoalesce(out.stickers, () => ( {})), [l.id]: [..._nullishCoalesce(_optionalChain([out, 'access', _427 => _427.stickers, 'optionalAccess', _428 => _428[l.id]]), () => ( [])), ...sprayed] } } : {},
@@ -7816,8 +7832,8 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
7816
7832
  if (this.wet.instantDry && result.strokeId) {
7817
7833
  this.wet.dry(session.layerId);
7818
7834
  this.logWet({ kind: "dry", layerId: session.layerId, at: out.strokes.length });
7819
- const dried = _chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, session.layerId).layer.surface;
7820
- out = { ...out, layers: _chunkDPYAO5U6cjs.mapLayer.call(void 0, out.layers, session.layerId, (l) => ({ ...l, surface: dried })) };
7835
+ const dried = _chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, session.layerId).layer.surface;
7836
+ out = { ...out, layers: _chunkPVJMTLPJcjs.mapLayer.call(void 0, out.layers, session.layerId, (l) => ({ ...l, surface: dried })) };
7821
7837
  }
7822
7838
  result.wet = this.wet.isWet(session.layerId);
7823
7839
  }
@@ -7899,10 +7915,10 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
7899
7915
  let brush = v.brush;
7900
7916
  if (options.brushId !== void 0) {
7901
7917
  const b = this.requireBrush(options.brushId);
7902
- brush = _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, { tip: { ...b.tip, size: b.tip.size * (v.brush.tip.size / s.brush.tip.size) } }, b);
7918
+ brush = _chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0, { tip: { ...b.tip, size: b.tip.size * (v.brush.tip.size / s.brush.tip.size) } }, b);
7903
7919
  }
7904
7920
  const layerId = _nullishCoalesce(options.layerId, () => ( s.layerId));
7905
- if (!_chunkDPYAO5U6cjs.findLayer.call(void 0, doc.layers, layerId)) throw new PaintEditorError(`Stroke "${s.id}" was painted on layer "${layerId}", which no longer exists; pass layerId to replay it elsewhere.`);
7921
+ if (!_chunkPVJMTLPJcjs.findLayer.call(void 0, doc.layers, layerId)) throw new PaintEditorError(`Stroke "${s.id}" was painted on layer "${layerId}", which no longer exists; pass layerId to replay it elsewhere.`);
7906
7922
  let load = s.load;
7907
7923
  if (load && options.color !== void 0 && load.reservoir) {
7908
7924
  const [r, g, b] = hexToRgb8(options.color);
@@ -8095,7 +8111,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
8095
8111
  wetState() {
8096
8112
  const st = this.getState().wet;
8097
8113
  const backend = this.wet.backend();
8098
- return { ...st, layers: this.wet.wetLayerIds().map((id) => this.wet.info(id)), backend, message: _nullishCoalesce(_optionalChain([backend, 'optionalAccess', _439 => _439.message]), () => ( _chunkKBYB7OWBcjs.wetSupport.call(void 0, ).message)), engine: this.wet.engineInfo() };
8114
+ return { ...st, layers: this.wet.wetLayerIds().map((id) => this.wet.info(id)), backend, message: _nullishCoalesce(_optionalChain([backend, 'optionalAccess', _439 => _439.message]), () => ( _chunkYHDHFJUCcjs.wetSupport.call(void 0, ).message)), engine: this.wet.engineInfo() };
8099
8115
  }
8100
8116
  /**
8101
8117
  * Engine B, the WebGPU accelerator for large wet areas: whether it may run, its state (`off`,
@@ -8164,11 +8180,11 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
8164
8180
  wetPaper(options = {}) {
8165
8181
  this.requireIdle("wetting the paper");
8166
8182
  const l = this.wetLayer(options.layerId, "wet the paper of");
8167
- if (_chunkDPYAO5U6cjs.isLayerLocked.call(void 0, l, "pixels")) throw new PaintEditorError(`Layer "${l.name}" has its pixels locked; unlock it first.`);
8183
+ if (_chunkPVJMTLPJcjs.isLayerLocked.call(void 0, l, "pixels")) throw new PaintEditorError(`Layer "${l.name}" has its pixels locked; unlock it first.`);
8168
8184
  const amount = _nullishCoalesce(options.amount, () => ( 1));
8169
8185
  if (!(amount > 0 && amount <= 1)) throw new PaintEditorError(`amount ${amount} is out of range; use above 0 up to 1.`);
8170
8186
  const rect = _nullishCoalesce(this.checkRect(options.rect), () => ( { x: 0, y: 0, width: this.doc.canvas.width, height: this.doc.canvas.height }));
8171
- if (!this.wet.wetLayerIds().includes(l.id) && this.wet.wetLayerIds().length >= _chunkKBYB7OWBcjs.MAX_WET_LANES) throw new PaintEditorError(`At most ${_chunkKBYB7OWBcjs.MAX_WET_LANES} layers can hold wet paint at once; dry one first (dry_paint).`);
8187
+ if (!this.wet.wetLayerIds().includes(l.id) && this.wet.wetLayerIds().length >= _chunkYHDHFJUCcjs.MAX_WET_LANES) throw new PaintEditorError(`At most ${_chunkYHDHFJUCcjs.MAX_WET_LANES} layers can hold wet paint at once; dry one first (dry_paint).`);
8172
8188
  const before = this.doc;
8173
8189
  this.beginWetOp();
8174
8190
  const world = this.wet.ensureLane(l.id);
@@ -8246,11 +8262,11 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
8246
8262
  /** The layers with the live stroke's surface in place. */
8247
8263
  currentLayers() {
8248
8264
  const override = this.frameOverride;
8249
- if (override) return Array.from(override).reduce((ls, [id, surface]) => _chunkDPYAO5U6cjs.mapLayer.call(void 0, ls, id, (l) => ({ ...l, surface })), this.doc.layers);
8265
+ if (override) return Array.from(override).reduce((ls, [id, surface]) => _chunkPVJMTLPJcjs.mapLayer.call(void 0, ls, id, (l) => ({ ...l, surface })), this.doc.layers);
8250
8266
  const live = this.live;
8251
8267
  if (!live) return this.animatedView();
8252
8268
  if (_optionalChain([this, 'access', _443 => _443.liveLayers, 'optionalAccess', _444 => _444.key]) === live.surface) return this.liveLayers.layers;
8253
- const layers = _chunkDPYAO5U6cjs.mapLayer.call(void 0, this.doc.layers, live.layerId, (l) => ({ ...l, surface: live.surface }));
8269
+ const layers = _chunkPVJMTLPJcjs.mapLayer.call(void 0, this.doc.layers, live.layerId, (l) => ({ ...l, surface: live.surface }));
8254
8270
  this.liveLayers = { key: live.surface, layers };
8255
8271
  return layers;
8256
8272
  }
@@ -8287,7 +8303,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
8287
8303
  let out = layers;
8288
8304
  for (const id of ids) {
8289
8305
  const baked = this.wet.bakedSurface(id);
8290
- if (baked && _chunkDPYAO5U6cjs.findLayer.call(void 0, out, id)) out = _chunkDPYAO5U6cjs.mapLayer.call(void 0, out, id, (l) => ({ ...l, surface: baked }));
8306
+ if (baked && _chunkPVJMTLPJcjs.findLayer.call(void 0, out, id)) out = _chunkPVJMTLPJcjs.mapLayer.call(void 0, out, id, (l) => ({ ...l, surface: baked }));
8291
8307
  }
8292
8308
  return out;
8293
8309
  }
@@ -8300,12 +8316,12 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
8300
8316
  const ids = /* @__PURE__ */ new Set([...Object.keys(_nullishCoalesce(thick, () => ( {}))), ...live ? [live.layerId] : []]);
8301
8317
  for (const id of ids) {
8302
8318
  const ch = _optionalChain([live, 'optionalAccess', _447 => _447.layerId]) === id ? live.channels : _optionalChain([thick, 'optionalAccess', _448 => _448[id]]);
8303
- const l = ch && _optionalChain([_chunkDPYAO5U6cjs.findLayer.call(void 0, out, id), 'optionalAccess', _449 => _449.layer]);
8319
+ const l = ch && _optionalChain([_chunkPVJMTLPJcjs.findLayer.call(void 0, out, id), 'optionalAccess', _449 => _449.layer]);
8304
8320
  if (!ch || !isPixelLayer(l)) continue;
8305
8321
  let cache = this.litCaches.get(id);
8306
8322
  if (!cache) this.litCaches.set(id, cache = new LitCache());
8307
8323
  const lit = cache.lit(l.surface, ch, this.lighting);
8308
- if (lit !== l.surface) out = _chunkDPYAO5U6cjs.mapLayer.call(void 0, out, id, () => ({ ...l, surface: lit }));
8324
+ if (lit !== l.surface) out = _chunkPVJMTLPJcjs.mapLayer.call(void 0, out, id, () => ({ ...l, surface: lit }));
8309
8325
  }
8310
8326
  return out;
8311
8327
  }
@@ -8320,13 +8336,13 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
8320
8336
  if (!ids.size) return layers;
8321
8337
  let out = layers;
8322
8338
  for (const id of ids) {
8323
- const l = _optionalChain([_chunkDPYAO5U6cjs.findLayer.call(void 0, out, id), 'optionalAccess', _450 => _450.layer]);
8339
+ const l = _optionalChain([_chunkPVJMTLPJcjs.findLayer.call(void 0, out, id), 'optionalAccess', _450 => _450.layer]);
8324
8340
  if (!isPixelLayer(l)) continue;
8325
8341
  let cache = this.lightCaches.get(id);
8326
8342
  if (!cache) this.lightCaches.set(id, cache = new LightCache());
8327
8343
  const glowed = cache.glow(l.surface, light[id], _optionalChain([this, 'access', _451 => _451.liveThick, 'optionalAccess', _452 => _452.layerId]) === id ? this.liveThick.channels : _optionalChain([this, 'access', _453 => _453.doc, 'access', _454 => _454.thick, 'optionalAccess', _455 => _455[id]]));
8328
- if (glowed !== l.surface) out = _chunkDPYAO5U6cjs.mapLayer.call(void 0, out, id, () => ({ ...l, surface: glowed }));
8329
- const committed = _optionalChain([_chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, id), 'optionalAccess', _456 => _456.layer]);
8344
+ if (glowed !== l.surface) out = _chunkPVJMTLPJcjs.mapLayer.call(void 0, out, id, () => ({ ...l, surface: glowed }));
8345
+ const committed = _optionalChain([_chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, id), 'optionalAccess', _456 => _456.layer]);
8330
8346
  const spill = light[id] && isPixelLayer(committed) ? cache.spill(committed.surface, light[id], this.lightSpillOf(id)) : null;
8331
8347
  if (spill) out = insertAfter(out, id, { type: "pixel", id: `${id}${SPILL_SUFFIX}`, name: `${l.name} light`, visible: l.visible, opacity: l.opacity, blend: "linear-dodge", surface: spill, offset: { ...l.offset } });
8332
8348
  }
@@ -8367,7 +8383,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
8367
8383
  if (backlight) layers = [...layers, backlight];
8368
8384
  if (options.layerIds) {
8369
8385
  const picked = [];
8370
- for (const id of options.layerIds) picked.push(_nullishCoalesce(_optionalChain([_chunkDPYAO5U6cjs.findLayer.call(void 0, layers, id), 'optionalAccess', _462 => _462.layer]), () => ( this.requireLayer(id))));
8386
+ for (const id of options.layerIds) picked.push(_nullishCoalesce(_optionalChain([_chunkPVJMTLPJcjs.findLayer.call(void 0, layers, id), 'optionalAccess', _462 => _462.layer]), () => ( this.requireLayer(id))));
8371
8387
  layers = picked.map((l) => ({ ...l, visible: true }));
8372
8388
  }
8373
8389
  const under = options.paper === false ? [] : [paperNode(this.doc.paper, this.lighting)];
@@ -8411,7 +8427,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
8411
8427
  /** Wet settings saved with the document (`null` when they are all defaults). */
8412
8428
  wetJSON() {
8413
8429
  const layers = {};
8414
- for (const [id, set] of this.wet.settings) if (_chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, id)) layers[id] = { params: { ...set.params }, flow: { ...set.flow } };
8430
+ for (const [id, set] of this.wet.settings) if (_chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, id)) layers[id] = { params: { ...set.params }, flow: { ...set.flow } };
8415
8431
  const flat = this.wet.tilt.angle === 0;
8416
8432
  if (!Object.keys(layers).length && flat) return void 0;
8417
8433
  return { tilt: { ...this.wet.tilt }, layers };
@@ -8420,7 +8436,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
8420
8436
  this.wet.reset();
8421
8437
  if (!raw || typeof raw !== "object") return;
8422
8438
  const r = raw;
8423
- this.wet.setTilt(_chunkKBYB7OWBcjs.normalizeTilt.call(void 0, _nullishCoalesce(r.tilt, () => ( {}))));
8439
+ this.wet.setTilt(_chunkYHDHFJUCcjs.normalizeTilt.call(void 0, _nullishCoalesce(r.tilt, () => ( {}))));
8424
8440
  if (r.layers && typeof r.layers === "object") {
8425
8441
  for (const [id, v] of Object.entries(r.layers)) {
8426
8442
  if (!v || typeof v !== "object") {
@@ -8428,7 +8444,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
8428
8444
  continue;
8429
8445
  }
8430
8446
  const x = v;
8431
- this.wet.settings.set(id, { params: _chunkKBYB7OWBcjs.normalizeWetParams.call(void 0, _nullishCoalesce(x.params, () => ( {}))), flow: _chunkKBYB7OWBcjs.normalizeFlow.call(void 0, _nullishCoalesce(x.flow, () => ( {}))) });
8447
+ this.wet.settings.set(id, { params: _chunkYHDHFJUCcjs.normalizeWetParams.call(void 0, _nullishCoalesce(x.params, () => ( {}))), flow: _chunkYHDHFJUCcjs.normalizeFlow.call(void 0, _nullishCoalesce(x.flow, () => ( {}))) });
8432
8448
  }
8433
8449
  }
8434
8450
  }
@@ -8437,32 +8453,32 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
8437
8453
  const ext = { ...this.extensions };
8438
8454
  const channels = {};
8439
8455
  for (const [id, ch] of Object.entries(_nullishCoalesce(this.doc.thick, () => ( {})))) {
8440
- if (!_chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, id)) continue;
8456
+ if (!_chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, id)) continue;
8441
8457
  const saved = thickToJSON(ch);
8442
8458
  if (saved) channels[id] = saved;
8443
8459
  }
8444
8460
  if (Object.keys(channels).length) ext.layerChannels = channels;
8445
8461
  else delete ext.layerChannels;
8446
8462
  const stickers = {};
8447
- for (const [id, list] of Object.entries(_nullishCoalesce(this.doc.stickers, () => ( {})))) if (list.length && _chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, id)) stickers[id] = list.map((x) => ({ ...x }));
8463
+ for (const [id, list] of Object.entries(_nullishCoalesce(this.doc.stickers, () => ( {})))) if (list.length && _chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, id)) stickers[id] = list.map((x) => ({ ...x }));
8448
8464
  if (Object.keys(stickers).length) ext.stickers = stickers;
8449
8465
  else delete ext.stickers;
8450
8466
  const liveStrokes = {};
8451
- for (const [id, list] of Object.entries(_nullishCoalesce(this.doc.liveStrokes, () => ( {})))) if (_chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, id)) liveStrokes[id] = list.map(strokeToJSON);
8467
+ for (const [id, list] of Object.entries(_nullishCoalesce(this.doc.liveStrokes, () => ( {})))) if (_chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, id)) liveStrokes[id] = list.map(strokeToJSON);
8452
8468
  if (Object.keys(liveStrokes).length) ext.liveStrokes = liveStrokes;
8453
8469
  else delete ext.liveStrokes;
8454
8470
  const light = {};
8455
8471
  for (const [id, t] of Object.entries(_nullishCoalesce(this.doc.light, () => ( {})))) {
8456
- if (!_chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, id)) continue;
8472
+ if (!_chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, id)) continue;
8457
8473
  const saved = lightToJSON(_nullishCoalesce(this.wet.bakedLight(id), () => ( t)));
8458
8474
  if (saved) light[id] = saved;
8459
8475
  }
8460
8476
  if (Object.keys(light).length) ext.light = light;
8461
8477
  else delete ext.light;
8462
- const spills = Object.fromEntries(Object.entries(this.lightSpills).filter(([id]) => _chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, id)));
8478
+ const spills = Object.fromEntries(Object.entries(this.lightSpills).filter(([id]) => _chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, id)));
8463
8479
  if (Object.keys(spills).length) ext.lightSpill = spills;
8464
8480
  else delete ext.lightSpill;
8465
- const effectLayers = effectLayersToJSON(_nullishCoalesce(this.doc.effectLayers, () => ( {})), (id) => isPixelLayer(_optionalChain([_chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, id), 'optionalAccess', _465 => _465.layer])));
8481
+ const effectLayers = effectLayersToJSON(_nullishCoalesce(this.doc.effectLayers, () => ( {})), (id) => isPixelLayer(_optionalChain([_chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, id), 'optionalAccess', _465 => _465.layer])));
8466
8482
  if (effectLayers) ext.effectLayers = effectLayers;
8467
8483
  else delete ext.effectLayers;
8468
8484
  if (this.doc.paperEffect) ext.paperEffect = paperEffectToJSON(this.doc.paperEffect);
@@ -8478,7 +8494,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
8478
8494
  if (ext.stickers && typeof ext.stickers === "object") {
8479
8495
  const stickers = {};
8480
8496
  for (const [id, list] of Object.entries(ext.stickers)) {
8481
- if (!_chunkDPYAO5U6cjs.findLayer.call(void 0, state.layers, id) || !Array.isArray(list)) continue;
8497
+ if (!_chunkPVJMTLPJcjs.findLayer.call(void 0, state.layers, id) || !Array.isArray(list)) continue;
8482
8498
  const ok = list.flatMap((x) => {
8483
8499
  if (!x || typeof x.id !== "string" || !Number.isFinite(x.x) || !Number.isFinite(x.y) || !(x.size > 0)) return [];
8484
8500
  try {
@@ -8498,7 +8514,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
8498
8514
  if (ext.liveStrokes && typeof ext.liveStrokes === "object") {
8499
8515
  const liveStrokes = {};
8500
8516
  for (const [id, list] of Object.entries(ext.liveStrokes)) {
8501
- if (!isPixelLayer(_optionalChain([_chunkDPYAO5U6cjs.findLayer.call(void 0, state.layers, id), 'optionalAccess', _466 => _466.layer])) || !Array.isArray(list)) continue;
8517
+ if (!isPixelLayer(_optionalChain([_chunkPVJMTLPJcjs.findLayer.call(void 0, state.layers, id), 'optionalAccess', _466 => _466.layer])) || !Array.isArray(list)) continue;
8502
8518
  const ok = list.map(normalizeBrushStroke).filter((x) => x !== null).map((x) => ({ ...x, layerId: id }));
8503
8519
  if (ok.length !== list.length) problems.push(`Some strokes of stroke layer "${id}" could not be read; they were dropped (the layer's pixels are kept until a stroke is edited).`);
8504
8520
  liveStrokes[id] = ok;
@@ -8508,7 +8524,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
8508
8524
  if (ext.effectLayers && typeof ext.effectLayers === "object") {
8509
8525
  const effectLayers = {};
8510
8526
  for (const [id, v] of Object.entries(ext.effectLayers)) {
8511
- if (!isPixelLayer(_optionalChain([_chunkDPYAO5U6cjs.findLayer.call(void 0, state.layers, id), 'optionalAccess', _467 => _467.layer]))) continue;
8527
+ if (!isPixelLayer(_optionalChain([_chunkPVJMTLPJcjs.findLayer.call(void 0, state.layers, id), 'optionalAccess', _467 => _467.layer]))) continue;
8512
8528
  const source = readPaintEffectSource(v);
8513
8529
  if (source) effectLayers[id] = source;
8514
8530
  else problems.push(`The effect of layer "${id}" could not be read; it loads as a plain layer.`);
@@ -8527,7 +8543,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
8527
8543
  if (ext.lightSpill && typeof ext.lightSpill === "object") {
8528
8544
  for (const [id, v] of Object.entries(ext.lightSpill)) {
8529
8545
  try {
8530
- if (_chunkDPYAO5U6cjs.findLayer.call(void 0, state.layers, id)) this.lightSpills[id] = normalizeLightSpill(_nullishCoalesce(v, () => ( {})));
8546
+ if (_chunkPVJMTLPJcjs.findLayer.call(void 0, state.layers, id)) this.lightSpills[id] = normalizeLightSpill(_nullishCoalesce(v, () => ( {})));
8531
8547
  } catch (e10) {
8532
8548
  problems.push(`The light spill of layer "${id}" could not be read; it takes the defaults.`);
8533
8549
  }
@@ -8536,7 +8552,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
8536
8552
  if (ext.light && typeof ext.light === "object") {
8537
8553
  const light = {};
8538
8554
  for (const [id, v] of Object.entries(ext.light)) {
8539
- if (!isPixelLayer(_optionalChain([_chunkDPYAO5U6cjs.findLayer.call(void 0, state.layers, id), 'optionalAccess', _468 => _468.layer]))) continue;
8555
+ if (!isPixelLayer(_optionalChain([_chunkPVJMTLPJcjs.findLayer.call(void 0, state.layers, id), 'optionalAccess', _468 => _468.layer]))) continue;
8540
8556
  try {
8541
8557
  light[id] = lightFromJSON(v);
8542
8558
  } catch (e) {
@@ -8549,7 +8565,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
8549
8565
  if (!raw || typeof raw !== "object") return state;
8550
8566
  const thick = {};
8551
8567
  for (const [id, v] of Object.entries(raw)) {
8552
- if (!_chunkDPYAO5U6cjs.findLayer.call(void 0, state.layers, id)) continue;
8568
+ if (!_chunkPVJMTLPJcjs.findLayer.call(void 0, state.layers, id)) continue;
8553
8569
  try {
8554
8570
  thick[id] = thickFromJSON(v);
8555
8571
  } catch (e) {
@@ -8677,7 +8693,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
8677
8693
  return next.type === "group" ? { ...next, children: toStandard(next.children) } : next;
8678
8694
  });
8679
8695
  const layers = toStandard(dried);
8680
- const result = _chunkYSGW7VV4cjs.exportPsd.call(void 0, { width, height, layers: [paperLayer, ...layers], merged, resolution: dpi });
8696
+ const result = _chunk43NT242Dcjs.exportPsd.call(void 0, { width, height, layers: [paperLayer, ...layers], merged, resolution: dpi });
8681
8697
  for (const [mode, names] of changed) {
8682
8698
  const label = _nullishCoalesce(_optionalChain([_chunk2VX55NFMcjs.BLEND_MODES, 'access', _475 => _475.find, 'call', _476 => _476((m) => m.id === mode), 'optionalAccess', _477 => _477.label]), () => ( mode));
8683
8699
  const std = _nullishCoalesce(_optionalChain([_chunk2VX55NFMcjs.BLEND_MODES, 'access', _478 => _478.find, 'call', _479 => _479((m) => m.id === _chunk2VX55NFMcjs.standardBlendMode.call(void 0, mode)), 'optionalAccess', _480 => _480.label]), () => ( _chunk2VX55NFMcjs.standardBlendMode.call(void 0, mode)));
@@ -8986,12 +9002,12 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
8986
9002
  * only the tiles under those rects are redrawn.
8987
9003
  */
8988
9004
  commitStickers(label, layer, stickers, dirty) {
8989
- if (_chunkDPYAO5U6cjs.isLayerLocked.call(void 0, layer, "pixels")) throw new PaintEditorError(`Layer "${layer.name}" has its pixels locked; unlock it first.`);
9005
+ if (_chunkPVJMTLPJcjs.isLayerLocked.call(void 0, layer, "pixels")) throw new PaintEditorError(`Layer "${layer.name}" has its pixels locked; unlock it first.`);
8990
9006
  this.requireStickerArt(stickers);
8991
9007
  const before = _nullishCoalesce(this.previewBase(), () => ( this.doc));
8992
9008
  this.stickerPreview = null;
8993
9009
  const surface = this.redrawStickers(layer, stickers, dirty);
8994
- const doc = { ...this.doc, layers: _chunkDPYAO5U6cjs.mapLayer.call(void 0, this.doc.layers, layer.id, () => ({ ...layer, surface, offset: { x: 0, y: 0 } })), stickers: { ..._nullishCoalesce(this.doc.stickers, () => ( {})), [layer.id]: stickers } };
9010
+ const doc = { ...this.doc, layers: _chunkPVJMTLPJcjs.mapLayer.call(void 0, this.doc.layers, layer.id, () => ({ ...layer, surface, offset: { x: 0, y: 0 } })), stickers: { ..._nullishCoalesce(this.doc.stickers, () => ( {})), [layer.id]: stickers } };
8995
9011
  this.commit(label, this.withPaintEvent(doc, { kind: "stickers", layerId: layer.id, data: { stickers: stickers.map((s) => ({ ...s })) } }), before);
8996
9012
  }
8997
9013
  redrawStickers(layer, stickers, dirty) {
@@ -9031,7 +9047,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
9031
9047
  */
9032
9048
  previewSticker(layerId, id, update) {
9033
9049
  const { layer, stickers } = this.stickerLayer(layerId);
9034
- if (_chunkDPYAO5U6cjs.isLayerLocked.call(void 0, layer, "pixels")) throw new PaintEditorError(`Layer "${layer.name}" has its pixels locked; unlock it first.`);
9050
+ if (_chunkPVJMTLPJcjs.isLayerLocked.call(void 0, layer, "pixels")) throw new PaintEditorError(`Layer "${layer.name}" has its pixels locked; unlock it first.`);
9035
9051
  const i = stickers.findIndex((s) => s.id === id);
9036
9052
  if (i < 0) throw new PaintEditorError(`Layer "${layer.name}" has no sticker "${id}". Call list_stickers for the ids.`);
9037
9053
  const next = { ...stickers[i], ...this.readStickerUpdate(update) };
@@ -9039,7 +9055,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
9039
9055
  const dirty = [stickerRect(stickers[i]), stickerRect(next)];
9040
9056
  const base = _nullishCoalesce(this.previewBase(), () => ( this.doc));
9041
9057
  const surface = this.redrawStickers(layer, list, dirty);
9042
- this.doc = { ...this.doc, layers: _chunkDPYAO5U6cjs.mapLayer.call(void 0, this.doc.layers, layer.id, () => ({ ...layer, surface, offset: { x: 0, y: 0 } })), stickers: { ..._nullishCoalesce(this.doc.stickers, () => ( {})), [layer.id]: list } };
9058
+ this.doc = { ...this.doc, layers: _chunkPVJMTLPJcjs.mapLayer.call(void 0, this.doc.layers, layer.id, () => ({ ...layer, surface, offset: { x: 0, y: 0 } })), stickers: { ..._nullishCoalesce(this.doc.stickers, () => ( {})), [layer.id]: list } };
9043
9059
  this.stickerPreview = { base, shown: this.doc };
9044
9060
  this.emit(dirty);
9045
9061
  return { ...next };
@@ -9154,7 +9170,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
9154
9170
  findLiveStroke(id) {
9155
9171
  for (const [layerId, strokes] of Object.entries(_nullishCoalesce(this.doc.liveStrokes, () => ( {})))) {
9156
9172
  const index = strokes.findIndex((x) => x.id === id);
9157
- const layer = _optionalChain([_chunkDPYAO5U6cjs.findLayer.call(void 0, this.doc.layers, layerId), 'optionalAccess', _520 => _520.layer]);
9173
+ const layer = _optionalChain([_chunkPVJMTLPJcjs.findLayer.call(void 0, this.doc.layers, layerId), 'optionalAccess', _520 => _520.layer]);
9158
9174
  if (index >= 0 && isPixelLayer(layer)) return { layer, strokes, index };
9159
9175
  }
9160
9176
  const baked = this.doc.strokes.some((x) => x.id === id);
@@ -9174,15 +9190,15 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
9174
9190
  let brush = was.brush;
9175
9191
  if (update.brushId !== void 0) {
9176
9192
  const b = this.requireBrush(update.brushId);
9177
- brush = _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, { tip: { ...b.tip, size: was.brush.tip.size } }, b);
9193
+ brush = _chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0, { tip: { ...b.tip, size: was.brush.tip.size } }, b);
9178
9194
  }
9179
9195
  if (update.brush !== void 0) {
9180
9196
  if (!update.brush || typeof update.brush !== "object") throw new PaintEditorError("brush must be an object of brush settings (as set_brush takes).");
9181
- brush = _chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, { ...update.brush, id: brush.id }, brush);
9197
+ brush = _chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0, { ...update.brush, id: brush.id }, brush);
9182
9198
  }
9183
9199
  const why = liveStrokeRefusal(brush);
9184
9200
  if (why) throw new PaintEditorError(why);
9185
- const next = { ...was, brush: _chunkRSIKDWOPcjs.brushToJSON.call(void 0, brush) };
9201
+ const next = { ...was, brush: _chunkTZOX7KWVcjs.brushToJSON.call(void 0, brush) };
9186
9202
  if (update.seed !== void 0) {
9187
9203
  if (!Number.isInteger(update.seed) || update.seed < 0) throw new PaintEditorError(`seed ${update.seed} must be a whole number of 0 or more.`);
9188
9204
  next.seed = update.seed;
@@ -9318,10 +9334,10 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
9318
9334
  this.commit(label, this.withLiveStrokes(this.doc, layer, list, dirty));
9319
9335
  }
9320
9336
  withLiveStrokes(doc, layer, list, dirty) {
9321
- if (_chunkDPYAO5U6cjs.isLayerLocked.call(void 0, layer, "pixels")) throw new PaintEditorError(`Layer "${layer.name}" has its pixels locked; unlock it (update_layer locks) first.`);
9322
- const current = _optionalChain([_chunkDPYAO5U6cjs.findLayer.call(void 0, doc.layers, layer.id), 'optionalAccess', _525 => _525.layer]);
9337
+ if (_chunkPVJMTLPJcjs.isLayerLocked.call(void 0, layer, "pixels")) throw new PaintEditorError(`Layer "${layer.name}" has its pixels locked; unlock it (update_layer locks) first.`);
9338
+ const current = _optionalChain([_chunkPVJMTLPJcjs.findLayer.call(void 0, doc.layers, layer.id), 'optionalAccess', _525 => _525.layer]);
9323
9339
  const surface = this.drawLiveStrokes(_nullishCoalesce(current, () => ( layer)), list, dirty);
9324
- const next = { ...doc, layers: _chunkDPYAO5U6cjs.mapLayer.call(void 0, doc.layers, layer.id, (l) => ({ ...l, surface, offset: { x: 0, y: 0 } })), liveStrokes: { ..._nullishCoalesce(doc.liveStrokes, () => ( {})), [layer.id]: [...list] } };
9340
+ const next = { ...doc, layers: _chunkPVJMTLPJcjs.mapLayer.call(void 0, doc.layers, layer.id, (l) => ({ ...l, surface, offset: { x: 0, y: 0 } })), liveStrokes: { ..._nullishCoalesce(doc.liveStrokes, () => ( {})), [layer.id]: [...list] } };
9325
9341
  return this.withPaintEvent(next, { kind: "live-strokes", layerId: layer.id, data: { strokes: list.map((x) => JSON.parse(JSON.stringify(x))) } });
9326
9342
  }
9327
9343
  /** Where a stroke painted (document pixels): as learnt when it was painted or drawn, else an estimate from its points and brush. */
@@ -9350,7 +9366,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
9350
9366
  };
9351
9367
  const paint = st.paint && this.liveEffectAt !== null && isLiveEffect(st) ? framePaint(st.paint, this.liveEffectAt) : st.paint;
9352
9368
  const init = { layerId: plain.id, color: st.color, brush: st.brush, seed: st.seed, copies: _nullishCoalesce(st.copies, () => ( [])), ...st.load ? { load: st.load } : {}, ...paint ? { paint } : {}, snapToPerspective: false, stencils: false, maskStencils: _nullishCoalesce(st.stencils, () => ( [])) };
9353
- const session = this.sessionFor({ ...doc, layers: _chunkDPYAO5U6cjs.mapLayer.call(void 0, doc.layers, plain.id, () => ({ ...plain, surface })) }, init, host);
9369
+ const session = this.sessionFor({ ...doc, layers: _chunkPVJMTLPJcjs.mapLayer.call(void 0, doc.layers, plain.id, () => ({ ...plain, surface })) }, init, host);
9354
9370
  session.push(st.points);
9355
9371
  const result = session.end();
9356
9372
  const had = this.paintedBounds.get(st);
@@ -9397,8 +9413,8 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
9397
9413
  if (!this.animatedLayers.size) return this.doc.layers;
9398
9414
  let layers = this.doc.layers;
9399
9415
  for (const [id, a] of this.animatedLayers) {
9400
- const l = _optionalChain([_chunkDPYAO5U6cjs.findLayer.call(void 0, layers, id), 'optionalAccess', _526 => _526.layer]);
9401
- if (isPixelLayer(l) && l.surface === a.base) layers = _chunkDPYAO5U6cjs.mapLayer.call(void 0, layers, id, () => ({ ...l, surface: a.surface }));
9416
+ const l = _optionalChain([_chunkPVJMTLPJcjs.findLayer.call(void 0, layers, id), 'optionalAccess', _526 => _526.layer]);
9417
+ if (isPixelLayer(l) && l.surface === a.base) layers = _chunkPVJMTLPJcjs.mapLayer.call(void 0, layers, id, () => ({ ...l, surface: a.surface }));
9402
9418
  }
9403
9419
  return layers;
9404
9420
  }
@@ -9407,7 +9423,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
9407
9423
  const layers = [];
9408
9424
  const sources = /* @__PURE__ */ new Map();
9409
9425
  for (const [id, strokes] of Object.entries(_nullishCoalesce(doc.liveStrokes, () => ( {})))) {
9410
- const layer = _optionalChain([_chunkDPYAO5U6cjs.findLayer.call(void 0, doc.layers, id), 'optionalAccess', _527 => _527.layer]);
9426
+ const layer = _optionalChain([_chunkPVJMTLPJcjs.findLayer.call(void 0, doc.layers, id), 'optionalAccess', _527 => _527.layer]);
9411
9427
  const live = strokes.filter(isLiveEffect);
9412
9428
  if (!isPixelLayer(layer) || !live.length) continue;
9413
9429
  layers.push({ layer, strokes });
@@ -9741,7 +9757,7 @@ var PaintEditorController = (_class19 = class _PaintEditorController {
9741
9757
  }
9742
9758
  /** A layer's tile surface (live while stroking), for thumbnails. */
9743
9759
  layerSurface(id) {
9744
- const l = _optionalChain([_chunkDPYAO5U6cjs.findLayer.call(void 0, this.currentLayers(), id), 'optionalAccess', _534 => _534.layer]);
9760
+ const l = _optionalChain([_chunkPVJMTLPJcjs.findLayer.call(void 0, this.currentLayers(), id), 'optionalAccess', _534 => _534.layer]);
9745
9761
  return isPixelLayer(l) ? l.surface : null;
9746
9762
  }
9747
9763
  }, _class19.__initStatic(), _class19);
@@ -9794,7 +9810,7 @@ function withLiveStroke(doc, stroke) {
9794
9810
  function shiftDocument(doc, dx, dy) {
9795
9811
  if (!dx && !dy) return doc;
9796
9812
  let layers = doc.layers;
9797
- for (const l of _chunkDPYAO5U6cjs.flattenLayers.call(void 0, doc.layers)) if (l.type === "pixel") layers = _chunkDPYAO5U6cjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, offset: movePoint(l.offset, dx, dy) }));
9813
+ for (const l of _chunkPVJMTLPJcjs.flattenLayers.call(void 0, doc.layers)) if (l.type === "pixel") layers = _chunkPVJMTLPJcjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, offset: movePoint(l.offset, dx, dy) }));
9798
9814
  const m = [1, 0, 0, 1, dx, dy];
9799
9815
  const moveStickers = (list) => list.map((s) => ({ ...s, x: Math.round((s.x + dx) * 100) / 100, y: Math.round((s.y + dy) * 100) / 100 }));
9800
9816
  const out = {
@@ -10839,7 +10855,7 @@ function createPaintWetTools(c) {
10839
10855
  type: "object",
10840
10856
  properties: {
10841
10857
  layerId: LAYER_ID2,
10842
- kind: { type: "string", enum: [..._chunkKBYB7OWBcjs.WET_FLOW_KINDS], description: "none, linear, swirl, radial or turbulent." },
10858
+ kind: { type: "string", enum: [..._chunkYHDHFJUCcjs.WET_FLOW_KINDS], description: "none, linear, swirl, radial or turbulent." },
10843
10859
  strength: UNIT("How hard it pushes, 0..1 (1 is about a 25\xB0 tilt; default 0.5)."),
10844
10860
  angle: { type: "number", minimum: -360, maximum: 360, description: "linear: direction in degrees clockwise from canvas down (default 0)." },
10845
10861
  center: {
@@ -11443,7 +11459,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
11443
11459
  name: "set_brush",
11444
11460
  title: "Set the brush",
11445
11461
  description: "Chooses the active brush (id, from list_brush_presets) and / or changes it with facets laid over it (objects merge, lists and values replace, marks of another kind replace the marks; the brush library's create_brush fields); unset removes whole facets first (unset colour drops a brush's own gradient). Strokes without a brush use it. Editor state, not an undo step: the changes stay on the active brush until the library's create_brush or update_brush stores a brush. Returns the active brush as facets, the engine it paints with, and problems (values clamped or dropped).",
11446
- inputSchema: { type: "object", properties: { id: { type: "string", description: "Brush id from list_brush_presets to start from (default the active brush)." }, name: { type: "string", minLength: 1, maxLength: 80, description: "Display name." }, ..._chunkMQGQTKVWcjs.BRUSH_PATCH_PROPERTIES, unset: _chunkMQGQTKVWcjs.BRUSH_UNSET_PROPERTY }, additionalProperties: false },
11462
+ inputSchema: { type: "object", properties: { id: { type: "string", description: "Brush id from list_brush_presets to start from (default the active brush)." }, name: { type: "string", minLength: 1, maxLength: 80, description: "Display name." }, ..._chunkPYTJBVW5cjs.BRUSH_PATCH_PROPERTIES, unset: _chunkPYTJBVW5cjs.BRUSH_UNSET_PROPERTY }, additionalProperties: false },
11447
11463
  annotations: { title: "Set the brush", ...SET4 },
11448
11464
  handler: async ({ id, unset, ...patch }) => {
11449
11465
  const stamps = _optionalChain([patch, 'access', _556 => _556.tip, 'optionalAccess', _557 => _557.stamps]);
@@ -11539,7 +11555,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
11539
11555
  points: POINTS,
11540
11556
  layerId: LAYER_ID4,
11541
11557
  brushId: { type: "string", description: "Brush id from list_brush_presets (default the active brush)." },
11542
- brush: { type: "object", description: "Facets to change for this stroke only, laid over brushId or the active brush (as set_brush takes them).", properties: _chunkMQGQTKVWcjs.BRUSH_PATCH_PROPERTIES, additionalProperties: false },
11558
+ brush: { type: "object", description: "Facets to change for this stroke only, laid over brushId or the active brush (as set_brush takes them).", properties: _chunkPYTJBVW5cjs.BRUSH_PATCH_PROPERTIES, additionalProperties: false },
11543
11559
  color: { ...COLOR3, description: "Paint colour #rrggbb (default the paint colour)." },
11544
11560
  paint: { ..._chunkFQPUF2W2cjs.PAINT_SOURCE_JSON_SCHEMA, description: "What this stroke paints with instead of the editor's paint: a colour, or gradient paint that changes colour as the stroke goes (by distance, pressure, tilt, speed, direction, time, across the tip or at random). Wins over the brush's own gradient." },
11545
11561
  seed: { type: "integer", minimum: 0, description: "Jitter seed (default a new one); the same seed and points give the same marks." },
@@ -11555,7 +11571,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
11555
11571
  const base = a.brushId ? c.getBrush(a.brushId) : c.getState().brush;
11556
11572
  const brush = a.brush ? c.brushChanges(a.brush, a.brushId) : void 0;
11557
11573
  if (base) {
11558
- const refs = brushStickerRefs(_chunkRSIKDWOPcjs.normalizePaintBrush.call(void 0, { ..._nullishCoalesce(brush, () => ( {})), id: base.id }, base));
11574
+ const refs = brushStickerRefs(_chunkTZOX7KWVcjs.normalizePaintBrush.call(void 0, { ..._nullishCoalesce(brush, () => ( {})), id: base.id }, base));
11559
11575
  if (refs.length) await c.prepareStickers(refs);
11560
11576
  }
11561
11577
  const stroke = { points: a.points, layerId: a.layerId, brushId: a.brushId, brush, color: a.color, paint: a.paint, seed: a.seed, snapToPerspective: a.snapToPerspective };
@@ -11639,7 +11655,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
11639
11655
  properties: {
11640
11656
  id: { type: "string", description: "Stroke id from list_strokes {live: true}." },
11641
11657
  brushId: { type: "string", description: "Brush id from list_brush_presets; the stroke keeps its size." },
11642
- brush: { type: "object", properties: _chunkMQGQTKVWcjs.BRUSH_PATCH_PROPERTIES, additionalProperties: false, description: "Facets to change on top of brushId or the stroke\u2019s brush (as set_brush takes them); missing fields keep their values." },
11658
+ brush: { type: "object", properties: _chunkPYTJBVW5cjs.BRUSH_PATCH_PROPERTIES, additionalProperties: false, description: "Facets to change on top of brushId or the stroke\u2019s brush (as set_brush takes them); missing fields keep their values." },
11643
11659
  color: { type: "string", pattern: "^#[0-9a-fA-F]{6}$", description: "New colour #rrggbb (replaces gradient paint)." },
11644
11660
  paint: { anyOf: [_chunkFQPUF2W2cjs.PAINT_SOURCE_JSON_SCHEMA, { type: "null", description: "Back to the stroke\u2019s plain colour." }], description: "A colour or gradient paint for the stroke; null drops its gradient." },
11645
11661
  seed: { type: "integer", minimum: 0, description: "Another jitter seed: particles, scatter and texture fall differently." }
@@ -11887,10 +11903,10 @@ function createPaintEditorToolProvider(controller, options = {}) {
11887
11903
  tools.push(...createPaintThickTools(c));
11888
11904
  tools.push(...createPaintReplayTools(c));
11889
11905
  tools.push(...createPaintStickerTools(c));
11890
- tools.push(..._chunkKBYB7OWBcjs.createPigmentTools.call(void 0, ));
11906
+ tools.push(..._chunkYHDHFJUCcjs.createPigmentTools.call(void 0, ));
11891
11907
  tools.push(..._chunkAVTPZO4Zcjs.createStickerTools.call(void 0, { provider: () => c.stickersProvider }));
11892
11908
  tools.push(
11893
- ..._chunkYSGW7VV4cjs.createLayerEffectTools.call(void 0,
11909
+ ..._chunk43NT242Dcjs.createLayerEffectTools.call(void 0,
11894
11910
  {
11895
11911
  requireLayer: (id) => void c.getLayerEffects(id),
11896
11912
  getLayerEffects: (id) => c.getLayerEffects(id),
@@ -11949,12 +11965,12 @@ function strokeSummary(s, withPoints, live) {
11949
11965
 
11950
11966
  // src/paint-editor/brush-library-tools.ts
11951
11967
  function createPaintBrushLibraryToolProvider(controller, options = {}) {
11952
- return _chunkMQGQTKVWcjs.createBrushLibraryToolProvider.call(void 0, controller.brushLibrary, {
11953
- profile: _chunkRSIKDWOPcjs.PAINT_PROFILE,
11968
+ return _chunkPYTJBVW5cjs.createBrushLibraryToolProvider.call(void 0, controller.brushLibrary, {
11969
+ profile: _chunkTZOX7KWVcjs.PAINT_PROFILE,
11954
11970
  stickers: () => controller.stickers.provider,
11955
11971
  ...options,
11956
11972
  renderPreview: (brush, { width, height, color }) => {
11957
- const t = renderBrushThumbnail(_chunkRSIKDWOPcjs.resolveBrush.call(void 0, brush), { paper: controller.getState().document.paper, width, height, color: color.toLowerCase() });
11973
+ const t = renderBrushThumbnail(_chunkTZOX7KWVcjs.resolveBrush.call(void 0, brush), { paper: controller.getState().document.paper, width, height, color: color.toLowerCase() });
11958
11974
  return { data: _chunkW5M3J7PVcjs.bytesToBase64.call(void 0, _chunkW5M3J7PVcjs.encodePng.call(void 0, t.width, t.height, t.data)), mimeType: "image/png" };
11959
11975
  }
11960
11976
  });
@@ -12178,44 +12194,47 @@ var PaintGesture = (_class20 = class {
12178
12194
  }
12179
12195
  }, _class20);
12180
12196
  var round2 = (v) => Math.round(v * 100) / 100;
12197
+ var PAINT_SHORTCUTS = [
12198
+ { id: "undo", label: "Undo", group: "edit", keys: ["Mod+Z"], tool: "undo_paint" },
12199
+ { id: "redo", label: "Redo", group: "edit", keys: ["Mod+Shift+Z", "Mod+Y"], tool: "redo_paint" },
12200
+ ...PAINT_TOOLS.map((t) => ({ id: `tool.${t.id}`, label: t.label, group: "tools", keys: [t.key.toUpperCase()] })),
12201
+ { id: "brush.smaller", label: "Smaller brush", group: "brush", keys: ["["], tool: "set_brush" },
12202
+ { id: "brush.larger", label: "Larger brush", group: "brush", keys: ["]"], tool: "set_brush" },
12203
+ { id: "colour.swap", label: "Swap colours", group: "colour", keys: ["X"] },
12204
+ { id: "view.mirror", label: "Mirror the view", group: "view", keys: ["M"], tool: "set_view" },
12205
+ { id: "view.reset", label: "Reset the view", group: "view", keys: ["Escape"], tool: "set_view" }
12206
+ ];
12207
+ function paintShortcutFor(e) {
12208
+ if (!e.key) return null;
12209
+ const parts = [...e.ctrlKey || e.metaKey ? ["Mod"] : [], ...e.shiftKey && (e.ctrlKey || e.metaKey) ? ["Shift"] : []];
12210
+ const key = e.key.length === 1 ? e.key.toUpperCase() : e.key[0].toUpperCase() + e.key.slice(1).toLowerCase();
12211
+ const combo = [...parts, key].join("+");
12212
+ return _nullishCoalesce(PAINT_SHORTCUTS.find((s) => s.keys.includes(combo)), () => ( null));
12213
+ }
12181
12214
  function handlePaintShortcut(controller, gesture, e) {
12182
- const mod = e.ctrlKey || e.metaKey;
12183
- const key = e.key.toLowerCase();
12184
- if (mod && key === "z") {
12185
- if (controller.getState().stroking) return true;
12186
- if (e.shiftKey) controller.redo();
12187
- else controller.undo();
12188
- return true;
12189
- }
12190
- if (mod && key === "y") {
12191
- controller.redo();
12215
+ const shortcut = paintShortcutFor(e);
12216
+ if (!shortcut) return false;
12217
+ const id = shortcut.id;
12218
+ if (id === "undo" || id === "redo") {
12219
+ if (controller.getState().stroking && !(id === "redo" && e.key.toLowerCase() === "y")) return true;
12220
+ if (id === "undo") controller.undo();
12221
+ else controller.redo();
12192
12222
  return true;
12193
12223
  }
12194
- if (mod) return false;
12195
- const tool = PAINT_TOOLS.find((t) => t.key === key);
12196
- if (tool) {
12197
- gesture.tool = tool.id;
12224
+ if (id.startsWith("tool.")) {
12225
+ gesture.tool = id.slice(5);
12198
12226
  return true;
12199
12227
  }
12200
- const brush = controller.getState().brush;
12201
- if (key === "[" || key === "]") {
12228
+ if (id === "brush.smaller" || id === "brush.larger") {
12229
+ const brush = controller.getState().brush;
12202
12230
  const step = Math.max(1, Math.round(brush.tip.size * 0.15));
12203
- controller.setBrush({ tip: { size: Math.max(1, brush.tip.size + (key === "]" ? step : -step)) } });
12204
- return true;
12205
- }
12206
- if (key === "x") {
12207
- controller.swapColors();
12208
- return true;
12209
- }
12210
- if (key === "m") {
12211
- controller.setView({ mirror: !controller.getState().view.mirror });
12231
+ controller.setBrush({ tip: { size: Math.max(1, brush.tip.size + (id === "brush.larger" ? step : -step)) } });
12212
12232
  return true;
12213
12233
  }
12214
- if (key === "escape") {
12215
- controller.resetView();
12216
- return true;
12217
- }
12218
- return false;
12234
+ if (id === "colour.swap") controller.swapColors();
12235
+ else if (id === "view.mirror") controller.setView({ mirror: !controller.getState().view.mirror });
12236
+ else if (id === "view.reset") controller.resetView();
12237
+ return true;
12219
12238
  }
12220
12239
  var PaintCanvasPresenter = (_class21 = class {
12221
12240
  constructor(controller) {;_class21.prototype.__init189.call(this);_class21.prototype.__init190.call(this);_class21.prototype.__init191.call(this);
@@ -12446,7 +12465,7 @@ var DOT_ROTATION_LABELS = { follow: "Follow motion", random: "Random", fixed: "T
12446
12465
  var STAMP_LABELS = { dot: "Dot", star: "Star", heart: "Heart", leaf: "Leaf", flower: "Flower", confetti: "Confetti", splat: "Splat", sparkle: "Sparkle", ring: "Ring" };
12447
12466
  function toggleStickerRef(refs, ref2) {
12448
12467
  if (refs.includes(ref2)) return refs.length > 1 ? refs.filter((r) => r !== ref2) : [...refs];
12449
- return refs.length < _chunkRSIKDWOPcjs.MAX_STICKER_STAMPS ? [...refs, ref2] : [...refs];
12468
+ return refs.length < _chunkTZOX7KWVcjs.MAX_STICKER_STAMPS ? [...refs, ref2] : [...refs];
12450
12469
  }
12451
12470
  function stickerRefLabel(ref2) {
12452
12471
  const stamp = ref2.startsWith("editor:") ? ref2.slice(7) : null;
@@ -12459,7 +12478,7 @@ function toggleStamp(stamps, stamp) {
12459
12478
  }
12460
12479
  function toggleDotTexture(textures, stamp) {
12461
12480
  if (textures.includes(stamp)) return textures.filter((s) => s !== stamp);
12462
- return textures.length < _chunkRSIKDWOPcjs.MAX_DOT_TEXTURES ? [...textures, stamp] : [...textures];
12481
+ return textures.length < _chunkTZOX7KWVcjs.MAX_DOT_TEXTURES ? [...textures, stamp] : [...textures];
12463
12482
  }
12464
12483
  var STROKE_SLIDERS = [
12465
12484
  { path: "tip.size", label: "Size", min: 1, max: 400, step: 1 },
@@ -13172,6 +13191,131 @@ function createPaintProposalToolProvider(proposals, options = {}) {
13172
13191
  };
13173
13192
  }
13174
13193
 
13194
+ // src/paint-editor/contract.ts
13195
+ var PAINT_CONTRACT_FORMAT_VERSION = 1;
13196
+ var POINT2 = { type: "object", properties: { x: { type: "number", description: "Document x in pixels." }, y: { type: "number", description: "Document y in pixels." } }, required: ["x", "y"] };
13197
+ var PAINT_DOCUMENT_JSON_SCHEMA = {
13198
+ type: "object",
13199
+ description: "A saved painting, as the paint editor's save tools and autosave write it.",
13200
+ properties: {
13201
+ format: { type: "string", const: _chunkSJ2CPTQCcjs.EDITOR_DOCUMENT_FORMAT, description: `Always "${_chunkSJ2CPTQCcjs.EDITOR_DOCUMENT_FORMAT}".` },
13202
+ kind: { type: "string", const: "paint", description: 'Always "paint".' },
13203
+ formatVersion: { type: "integer", minimum: 1, description: "Version of the envelope for this kind; readers migrate older ones." },
13204
+ name: { type: "string", description: "Display name, when it has one." },
13205
+ document: {
13206
+ type: "object",
13207
+ description: "The painting (`SerializedPaintDocument`).",
13208
+ properties: {
13209
+ format: { type: "string", const: PAINT_FORMAT, description: `Always "${PAINT_FORMAT}".` },
13210
+ version: { type: "integer", minimum: 1, maximum: PAINT_SCHEMA_VERSION, description: `Painting version (${PAINT_SCHEMA_VERSION}; version 1 strokes hold flat engine brushes and are migrated).` },
13211
+ width: { type: "integer", minimum: 1, description: "Canvas width in pixels." },
13212
+ height: { type: "integer", minimum: 1, description: "Canvas height in pixels." },
13213
+ dpi: { type: "number", exclusiveMinimum: 0, description: "Pixels per inch." },
13214
+ paper: {
13215
+ type: "object",
13216
+ description: "The paper settings; the paper is regenerated from them, never stored as pixels.",
13217
+ properties: {
13218
+ preset: { type: "string", description: "The paper preset it started from (custom when none)." },
13219
+ name: { type: "string", description: "Display name." },
13220
+ pattern: { type: "string", description: "Grain pattern id." },
13221
+ seed: { type: "number", description: "Grain seed." },
13222
+ color: { type: "string", description: "Paper colour #rrggbb." },
13223
+ scale: { type: "number", description: "Grain scale (0.25 to 8)." },
13224
+ depth: { type: "number", minimum: 0, maximum: 1, description: "Grain depth for dry media." }
13225
+ },
13226
+ required: ["preset", "pattern", "seed", "color"]
13227
+ },
13228
+ layers: {
13229
+ type: "array",
13230
+ description: "Bottom to top: the image editor's serialized layers (pixel layers keep their pixels in `assets`).",
13231
+ items: { type: "object", properties: { id: { type: "string", description: "Layer id." }, name: { type: "string", description: "Layer name." }, type: { type: "string", description: "pixel, group, \u2026" } }, required: ["id", "type"] }
13232
+ },
13233
+ assets: { type: "object", additionalProperties: { type: "string" }, description: "Asset id \u2192 PNG data URL or an external reference." },
13234
+ activeLayerId: { type: ["string", "null"], description: "The active layer." },
13235
+ strokes: {
13236
+ type: "array",
13237
+ description: "Recorded strokes, oldest first (missing when saved without them).",
13238
+ items: {
13239
+ type: "object",
13240
+ properties: {
13241
+ id: { type: "string", description: "Stroke id." },
13242
+ layerId: { type: "string", description: "The layer it painted on." },
13243
+ color: { type: "string", description: "The paint colour as recorded at stroke start." },
13244
+ seed: { type: "number", description: "Seed of its jitter and grain, so a replay is exact." },
13245
+ points: { type: "array", items: POINT2, description: "The samples, with pressure, tilt and time when recorded." },
13246
+ brush: { $ref: "../brushes/brush.schema.json", description: "The facet brush it painted with." }
13247
+ },
13248
+ required: ["id", "layerId", "points", "brush"]
13249
+ }
13250
+ }
13251
+ },
13252
+ required: ["format", "version", "width", "height", "dpi", "paper", "layers", "assets", "activeLayerId"]
13253
+ }
13254
+ },
13255
+ required: ["format", "kind", "formatVersion", "document"]
13256
+ };
13257
+ function toolList(provider) {
13258
+ const tools = typeof provider.tools === "function" ? provider.tools() : provider.tools;
13259
+ return {
13260
+ id: provider.id,
13261
+ title: provider.title,
13262
+ ...provider.skill ? { skill: provider.skill } : {},
13263
+ tools: tools.map((t) => ({ name: t.name, title: t.title, description: t.description, inputSchema: t.inputSchema, annotations: t.annotations }))
13264
+ };
13265
+ }
13266
+ function uiTables() {
13267
+ return {
13268
+ tools: PAINT_TOOLS,
13269
+ brushOptions: _chunk43NT242Dcjs.BRUSH_OPTION_CONTROLS,
13270
+ blendMenu: BLEND_MENU_GROUPS,
13271
+ layerEffects: _chunkPVJMTLPJcjs.LAYER_EFFECT_MENU.map(({ kind, label }) => ({ kind, label, controls: _chunkPVJMTLPJcjs.layerEffectControls.call(void 0, _chunkPVJMTLPJcjs.defaultLayerEffect.call(void 0, kind, kind)) })),
13272
+ sliders: { paper: PAPER_SLIDERS, wet: WET_PARAM_SLIDERS, wetTilt: WET_TILT_SLIDERS, wetSpeed: WET_SPEED_SLIDER, light: LIGHT_SLIDERS, stroke: STROKE_SLIDERS, sticker: STICKER_SLIDERS },
13273
+ padSampleSizes: PAD_SAMPLE_SIZES,
13274
+ wetGpu: WET_GPU_OPTIONS,
13275
+ labels: {
13276
+ wetTools: WET_TOOL_LABELS,
13277
+ wetMedia: WET_MEDIUM_LABELS,
13278
+ impastoTools: IMPASTO_TOOL_LABELS,
13279
+ particleKinds: PARTICLE_KIND_LABELS,
13280
+ particleRenders: PARTICLE_RENDER_LABELS,
13281
+ ribbonPairs: RIBBON_PAIR_LABELS,
13282
+ dotTextureOrders: DOT_TEXTURE_ORDER_LABELS,
13283
+ dotRotations: DOT_ROTATION_LABELS,
13284
+ stamps: STAMP_LABELS
13285
+ }
13286
+ };
13287
+ }
13288
+ function paintContracts(options) {
13289
+ const controller = new PaintEditorController({ width: 64, height: 64 });
13290
+ controller.setEffectsProvider(options.effects);
13291
+ const providers = [
13292
+ createPaintEditorToolProvider(controller),
13293
+ createPaintEffectsToolProvider(controller),
13294
+ createPaintBrushLibraryToolProvider(controller),
13295
+ createPaintProposalToolProvider(createPaintProposals({ controller }))
13296
+ ].map(toolList);
13297
+ const document = createPaintEditorDocument(controller);
13298
+ const files = {
13299
+ "document.schema.json": { $schema: "https://json-schema.org/draft/2020-12/schema", $id: "document.schema.json", ...PAINT_DOCUMENT_JSON_SCHEMA },
13300
+ "tools.json": { providers },
13301
+ "commands.json": PAINT_SHORTCUTS.map((s) => ({ ...s, params: { type: "object", properties: {}, additionalProperties: false } })),
13302
+ "ui.json": uiTables()
13303
+ };
13304
+ files["manifest.json"] = {
13305
+ domain: "paint",
13306
+ formatVersion: PAINT_CONTRACT_FORMAT_VERSION,
13307
+ document: { kind: document.kind, formatVersion: document.formatVersion, format: PAINT_FORMAT, version: PAINT_SCHEMA_VERSION },
13308
+ counts: { providers: providers.length, tools: providers.reduce((n, p) => n + p.tools.length, 0), commands: PAINT_SHORTCUTS.length, layerEffects: _chunkPVJMTLPJcjs.LAYER_EFFECT_KINDS.length },
13309
+ files: Object.keys(files).sort()
13310
+ };
13311
+ return files;
13312
+ }
13313
+
13314
+
13315
+
13316
+
13317
+
13318
+
13175
13319
 
13176
13320
 
13177
13321
 
@@ -13526,4 +13670,4 @@ function createPaintProposalToolProvider(proposals, options = {}) {
13526
13670
 
13527
13671
 
13528
13672
 
13529
- exports.BACKLIGHT_SPILL = BACKLIGHT_SPILL; exports.BLEND_MENU_GROUPS = BLEND_MENU_GROUPS; exports.BLEND_MODES = _chunk2VX55NFMcjs.BLEND_MODES; exports.BRUSH_ID = _chunkRSIKDWOPcjs.BRUSH_ID; exports.BRUSH_ROTATIONS = _chunkRSIKDWOPcjs.BRUSH_ROTATIONS; exports.BRUSH_SLIDERS = _chunkMQGQTKVWcjs.BRUSH_SLIDERS; exports.BUILTIN_BRUSHES = _chunkRSIKDWOPcjs.BUILTIN_BRUSHES; exports.BristleStroke = BristleStroke; exports.DEFAULT_BACKLIGHT_COLOR = DEFAULT_BACKLIGHT_COLOR; exports.DEFAULT_BEHAVIOR = _chunkRSIKDWOPcjs.DEFAULT_BEHAVIOR; exports.DEFAULT_BRISTLE = _chunkRSIKDWOPcjs.DEFAULT_BRISTLE; exports.DEFAULT_BRUSH_ID = _chunkRSIKDWOPcjs.DEFAULT_BRUSH_ID; exports.DEFAULT_DPI = DEFAULT_DPI; exports.DEFAULT_DYNAMICS = _chunkRSIKDWOPcjs.DEFAULT_DYNAMICS; exports.DEFAULT_FLOW = _chunkKBYB7OWBcjs.DEFAULT_FLOW; exports.DEFAULT_IMPASTO = _chunkRSIKDWOPcjs.DEFAULT_IMPASTO; exports.DEFAULT_LIGHT = _chunkRSIKDWOPcjs.DEFAULT_LIGHT; exports.DEFAULT_LIGHTING = DEFAULT_LIGHTING; exports.DEFAULT_MULTI_COLOR = _chunkRSIKDWOPcjs.DEFAULT_MULTI_COLOR; exports.DEFAULT_PAINT_GRADIENT = _chunkFQPUF2W2cjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkFQPUF2W2cjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PAPER = DEFAULT_PAPER; exports.DEFAULT_PARTICLE = _chunkRSIKDWOPcjs.DEFAULT_PARTICLE; exports.DEFAULT_SPRAY = _chunkRSIKDWOPcjs.DEFAULT_SPRAY; exports.DEFAULT_STICKER = _chunkRSIKDWOPcjs.DEFAULT_STICKER; exports.DEFAULT_SWATCHES = DEFAULT_SWATCHES; exports.DEFAULT_VIEW = DEFAULT_VIEW; exports.DEFAULT_WET_BRUSH = _chunkRSIKDWOPcjs.DEFAULT_WET_BRUSH; exports.DEFAULT_WET_PARAMS = _chunkKBYB7OWBcjs.DEFAULT_WET_PARAMS; exports.DOT_ROTATIONS = _chunkRSIKDWOPcjs.DOT_ROTATIONS; exports.DOT_ROTATION_LABELS = DOT_ROTATION_LABELS; exports.DOT_TEXTURE_ORDERS = _chunkRSIKDWOPcjs.DOT_TEXTURE_ORDERS; exports.DOT_TEXTURE_ORDER_LABELS = DOT_TEXTURE_ORDER_LABELS; exports.DryStroke = DryStroke; exports.EFFECT_MAP_REPEATS = EFFECT_MAP_REPEATS; exports.EFFECT_STRIP_HEIGHT = EFFECT_STRIP_HEIGHT; exports.GPU_LEAD = GPU_LEAD; exports.GRAIN_PATTERNS = _chunkPXDIAYB6cjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkPXDIAYB6cjs.GRAIN_TILE; exports.HARMONY_KINDS = _chunkI3Y2Q3PMcjs.HARMONY_KINDS; exports.IDENTITY_AFFINE = IDENTITY_AFFINE; exports.IDENTITY_COPY = IDENTITY_COPY; exports.IMPASTO_TOOLS = _chunkRSIKDWOPcjs.IMPASTO_TOOLS; exports.IMPASTO_TOOL_LABELS = IMPASTO_TOOL_LABELS; exports.LIGHT_SLIDERS = LIGHT_SLIDERS; exports.LIVE_STROKE_ENGINES = LIVE_STROKE_ENGINES; exports.LitCache = LitCache; exports.MAX_BRUSH_SIZE = _chunkFQPUF2W2cjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_SIDE = MAX_CANVAS_SIDE; exports.MAX_COORDINATE = MAX_COORDINATE; exports.MAX_DOT_TEXTURES = _chunkRSIKDWOPcjs.MAX_DOT_TEXTURES; exports.MAX_IMAGE_SIDE = MAX_IMAGE_SIDE; exports.MAX_LIVE_EFFECT_SOURCES = MAX_LIVE_EFFECT_SOURCES; exports.MAX_STICKER_STAMPS = _chunkRSIKDWOPcjs.MAX_STICKER_STAMPS; exports.MAX_ZOOM = MAX_ZOOM; exports.MIN_CANVAS_SIDE = MIN_CANVAS_SIDE; exports.MIN_ZOOM = MIN_ZOOM; exports.MIXING_PAD_HEIGHT = MIXING_PAD_HEIGHT; exports.MIXING_PAD_WIDTH = MIXING_PAD_WIDTH; exports.MULTI_COLOR_MODES = _chunkRSIKDWOPcjs.MULTI_COLOR_MODES; exports.MixingPad = MixingPad; exports.PAD_SAMPLE_SIZES = PAD_SAMPLE_SIZES; exports.PAINTERLY_BLEND_MODES = _chunk2VX55NFMcjs.PAINTERLY_BLEND_MODES; exports.PAINT_BRUSH_CATEGORIES = _chunkRSIKDWOPcjs.PAINT_BRUSH_CATEGORIES; exports.PAINT_BRUSH_ENGINES = _chunkRSIKDWOPcjs.PAINT_BRUSH_ENGINES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkFQPUF2W2cjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_EFFECT_PLACES = PAINT_EFFECT_PLACES; exports.PAINT_FORMAT = PAINT_FORMAT; exports.PAINT_GRADIENT_FULL_SPEED = _chunkFQPUF2W2cjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkFQPUF2W2cjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkFQPUF2W2cjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkFQPUF2W2cjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkFQPUF2W2cjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkFQPUF2W2cjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkFQPUF2W2cjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkFQPUF2W2cjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkFQPUF2W2cjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkFQPUF2W2cjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SCHEMA_VERSION = PAINT_SCHEMA_VERSION; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkFQPUF2W2cjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TARGET = PAINT_TARGET; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_EFFECT_BLENDS = PAPER_EFFECT_BLENDS; exports.PAPER_EFFECT_NODE_ID = PAPER_EFFECT_NODE_ID; exports.PAPER_FAMILIES = PAPER_FAMILIES; exports.PAPER_LIBRARY = PAPER_LIBRARY; exports.PAPER_NODE_ID = PAPER_NODE_ID; exports.PAPER_SLIDERS = PAPER_SLIDERS; exports.PAPER_TARGET = PAPER_TARGET; exports.PARTICLE_KINDS = _chunkRSIKDWOPcjs.PARTICLE_KINDS; exports.PARTICLE_KIND_LABELS = PARTICLE_KIND_LABELS; exports.PARTICLE_RENDERS = _chunkRSIKDWOPcjs.PARTICLE_RENDERS; exports.PARTICLE_RENDER_LABELS = PARTICLE_RENDER_LABELS; exports.PaintCanvasPresenter = PaintCanvasPresenter; exports.PaintDabStroke = PaintDabStroke; exports.PaintDirector = PaintDirector; exports.PaintDocumentError = PaintDocumentError; exports.PaintEditorController = PaintEditorController; exports.PaintEditorError = PaintEditorError; exports.PaintEffectsRenderer = PaintEffectsRenderer; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkFQPUF2W2cjs.PaintGradientSampler; exports.PaintPresence = PaintPresence; exports.PaintSourceError = _chunkFQPUF2W2cjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaintWetLayers = PaintWetLayers; exports.PaperGrain = _chunkPXDIAYB6cjs.PaperGrain; exports.ParticleStroke = ParticleStroke; exports.PenDabWalker = PenDabWalker; exports.PenSmoother = PenSmoother; exports.PerspectiveSnapper = PerspectiveSnapper; exports.RIBBON_PAIRS = _chunkRSIKDWOPcjs.RIBBON_PAIRS; exports.RIBBON_PAIR_LABELS = RIBBON_PAIR_LABELS; exports.SNAP_DECIDE_DISTANCE = SNAP_DECIDE_DISTANCE; exports.STAMP_KINDS = _chunkJSDND7DFcjs.STAMP_KINDS; exports.STAMP_LABELS = STAMP_LABELS; exports.STENCIL_KINDS = STENCIL_KINDS; exports.STENCIL_SHAPES = STENCIL_SHAPES; exports.STICKER_ART_SIZE = STICKER_ART_SIZE; exports.STICKER_SLIDERS = STICKER_SLIDERS; exports.STROKE_SLIDERS = STROKE_SLIDERS; exports.SYMMETRY_MODES = SYMMETRY_MODES; exports.StencilSnapper = StencilSnapper; exports.StickerArtCache = StickerArtCache; exports.StickerBrowser = _chunkRVGP2XLFcjs.StickerBrowser; exports.StickerSpray = StickerSpray; exports.TRACING_NODE_ID = TRACING_NODE_ID; exports.ThickStrokeDriver = ThickStrokeDriver; exports.TileableNoise = _chunk3K6HWEXZcjs.TileableNoise; exports.WET_FLOW_KINDS = _chunkKBYB7OWBcjs.WET_FLOW_KINDS; exports.WET_GPU_MODES = WET_GPU_MODES; exports.WET_GPU_OPTIONS = WET_GPU_OPTIONS; exports.WET_MEDIA = _chunkRSIKDWOPcjs.WET_MEDIA; exports.WET_MEDIUM_LABELS = WET_MEDIUM_LABELS; exports.WET_MEDIUM_PARAMS = WET_MEDIUM_PARAMS; exports.WET_PARAM_KEYS = _chunkKBYB7OWBcjs.WET_PARAM_KEYS; exports.WET_PARAM_SCHEMA = WET_PARAM_SCHEMA; exports.WET_PARAM_SLIDERS = WET_PARAM_SLIDERS; exports.WET_SPEED_SLIDER = WET_SPEED_SLIDER; exports.WET_TILT_SLIDERS = WET_TILT_SLIDERS; exports.WET_TOOLS = _chunkRSIKDWOPcjs.WET_TOOLS; exports.WET_TOOL_LABELS = WET_TOOL_LABELS; exports.WetStrokeDriver = WetStrokeDriver; exports.addPaintGradientStop = _chunkFQPUF2W2cjs.addPaintGradientStop; exports.addPolygonArea = addPolygonArea; exports.affineCopy = affineCopy; exports.applyAffine = applyAffine; exports.backlightOf = backlightOf; exports.brushEngineControls = _chunkMQGQTKVWcjs.brushEngineControls; exports.brushLoadColor = brushLoadColor; exports.brushLoadForStroke = brushLoadForStroke; exports.brushTakesPaint = _chunkRSIKDWOPcjs.brushTakesPaint; exports.brushToJSON = _chunkRSIKDWOPcjs.brushToJSON; exports.buildTimeLapse = buildTimeLapse; exports.checkPaintEffectPlace = checkPaintEffectPlace; exports.clonePaper = clonePaper; exports.colorHarmony = colorHarmony2; exports.composeAffine = composeAffine; exports.contactSheet = contactSheet; exports.createPaintAgentStrokes = createPaintAgentStrokes; exports.createPaintBrushLibraryToolProvider = createPaintBrushLibraryToolProvider; exports.createPaintChangeFeed = createPaintChangeFeed; exports.createPaintCompositor = createPaintCompositor; exports.createPaintDocument = createPaintDocument; exports.createPaintEditorDocument = createPaintEditorDocument; exports.createPaintEditorToolProvider = createPaintEditorToolProvider; exports.createPaintEffectsToolProvider = createPaintEffectsToolProvider; exports.createPaintLayer = createPaintLayer; exports.createPaintProposalToolProvider = createPaintProposalToolProvider; exports.createPaintProposals = createPaintProposals; exports.createPaintReplayTools = createPaintReplayTools; exports.createPaintStickerTools = createPaintStickerTools; exports.createPaintThickTools = createPaintThickTools; exports.createPaintWetTools = createPaintWetTools; exports.decodeImageBlob = decodeImageBlob; exports.defaultGuides = defaultGuides; exports.defaultImageEncoder = defaultImageEncoder; exports.defaultStickerRasterizer = defaultStickerRasterizer; exports.deserializePaintDocument = deserializePaintDocument; exports.deserializePaintDocumentAsync = deserializePaintDocumentAsync; exports.documentExtensions = documentExtensions; exports.documentToScreen = documentToScreen; exports.downloadBytes = downloadBytes; exports.downsampleRgba = downsampleRgba; exports.drawSticker = drawSticker; exports.drawWaterOverlay = drawWaterOverlay; exports.effectDabField = effectDabField; exports.effectLayersToJSON = effectLayersToJSON; exports.effectPaintKey = effectPaintKey; exports.effectPaintSize = effectPaintSize; exports.emptiedLayers = emptiedLayers; exports.emptyThickChannels = emptyThickChannels; exports.fitZoom = fitZoom; exports.grainCatch = _chunkPXDIAYB6cjs.grainCatch; exports.grainHeights = _chunkPXDIAYB6cjs.grainHeights; exports.guideOverlay = guideOverlay; exports.handlePaintShortcut = handlePaintShortcut; exports.hash2 = _chunk3K6HWEXZcjs.hash2; exports.hexToPaintRgb = _chunkFQPUF2W2cjs.hexToPaintRgb; exports.hexToRgb8 = hexToRgb8; exports.hslToRgb = hslToRgb; exports.hsvToRgb = hsvToRgb; exports.hueToWheel = _chunkI3Y2Q3PMcjs.hueToWheel; exports.invertAffine = invertAffine; exports.isBlendMode = _chunk2VX55NFMcjs.isBlendMode; exports.isGradientPaint = _chunkFQPUF2W2cjs.isGradientPaint; exports.isPaintEffectPaint = isPaintEffectPaint; exports.isPainterlyBlendMode = _chunk2VX55NFMcjs.isPainterlyBlendMode; exports.isPalmTouch = isPalmTouch; exports.isWetBrush = _chunkRSIKDWOPcjs.isWetBrush; exports.isWetCapable = _chunkRSIKDWOPcjs.isWetCapable; exports.lightTile = lightTile; exports.lightingKey = lightingKey; exports.liveStrokeBounds = liveStrokeBounds; exports.liveStrokeRefusal = liveStrokeRefusal; exports.mapPenPoint = mapPenPoint; exports.mix32 = _chunk3K6HWEXZcjs.mix32; exports.mixPixels = mixPixels; exports.mixerLoadForStroke = mixerLoadForStroke; exports.mixerTip = mixerTip; exports.multiColorForDab = multiColorForDab; exports.multiColorGradient = multiColorGradient; exports.multiColorPalette = multiColorPalette; exports.multiColorSliders = _chunkMQGQTKVWcjs.multiColorSliders; exports.multiColorToPaint = _chunkRSIKDWOPcjs.multiColorToPaint; exports.newPaintLayerId = newPaintLayerId; exports.nextPaperEffectVersion = nextPaperEffectVersion; exports.normalizeBehavior = _chunkRSIKDWOPcjs.normalizeBehavior; exports.normalizeBristle = _chunkRSIKDWOPcjs.normalizeBristle; exports.normalizeBrushStroke = normalizeBrushStroke; exports.normalizeCanvas = normalizeCanvas; exports.normalizeDynamics = _chunkRSIKDWOPcjs.normalizeDynamics; exports.normalizeFlow = _chunkKBYB7OWBcjs.normalizeFlow; exports.normalizeHexColor = _chunkFQPUF2W2cjs.normalizeHexColor; exports.normalizeImpasto = _chunkRSIKDWOPcjs.normalizeImpasto; exports.normalizeLight = _chunkRSIKDWOPcjs.normalizeLight; exports.normalizeLighting = normalizeLighting; exports.normalizeMultiColor = _chunkRSIKDWOPcjs.normalizeMultiColor; exports.normalizePaintBrush = _chunkRSIKDWOPcjs.normalizePaintBrush; exports.normalizePaper = normalizePaper; exports.normalizeParticle = _chunkRSIKDWOPcjs.normalizeParticle; exports.normalizePerspective = normalizePerspective; exports.normalizeRotation = normalizeRotation; exports.normalizeStencil = normalizeStencil; exports.normalizeStickerSettings = _chunkRSIKDWOPcjs.normalizeStickerSettings; exports.normalizeStickerUpdate = normalizeStickerUpdate; exports.normalizeSymmetry = normalizeSymmetry; exports.normalizeView = normalizeView; exports.normalizeWetBrush = _chunkRSIKDWOPcjs.normalizeWetBrush; exports.normalizeWetParams = _chunkKBYB7OWBcjs.normalizeWetParams; exports.overPixels = overPixels; exports.padSampleRadius = padSampleRadius; exports.paintAgentStrokePoints = paintAgentStrokePoints; exports.paintGradientMappingFor = _chunkFQPUF2W2cjs.paintGradientMappingFor; exports.paintPlaybackPanel = paintPlaybackPanel; exports.paintProposalGhost = paintProposalGhost; exports.paintSourceColor = _chunkFQPUF2W2cjs.paintSourceColor; exports.paintSourceCss = _chunkFQPUF2W2cjs.paintSourceCss; exports.paintToMultiColor = _chunkRSIKDWOPcjs.paintToMultiColor; exports.paperEffectFromJSON = paperEffectFromJSON; exports.paperEffectToJSON = paperEffectToJSON; exports.paperGrain = paperGrain; exports.paperKey = paperKey; exports.paperNode = paperNode; exports.paperPreset = paperPreset; exports.parseBrushLibrary = _chunkRSIKDWOPcjs.parseBrushLibrary; exports.parseHexColor = parseHexColor; exports.parsePaintSource = _chunkFQPUF2W2cjs.parsePaintSource; exports.patchBrushValue = _chunkMQGQTKVWcjs.patchBrushValue; exports.patchPath = patchPath; exports.penOrientation = penOrientation; exports.perspectiveDirections = perspectiveDirections; exports.perspectiveGuideLines = perspectiveGuideLines; exports.planPaintToolPlayback = planPaintToolPlayback; exports.pointerToPenPoint = pointerToPenPoint; exports.quickStencil = quickStencil; exports.rand01 = _chunk3K6HWEXZcjs.rand01; exports.randSigned = _chunk3K6HWEXZcjs.randSigned; exports.readEffectStrokeMap = readEffectStrokeMap; exports.readPaintEffectPaint = readPaintEffectPaint; exports.readPaintEffectSource = readPaintEffectSource; exports.readPaintSource = _chunkFQPUF2W2cjs.readPaintSource; exports.readPath = readPath; exports.readSwatch = readSwatch; exports.reliefInfo = reliefInfo; exports.removePaintGradientStop = _chunkFQPUF2W2cjs.removePaintGradientStop; exports.renderBrushThumbnail = renderBrushThumbnail; exports.renderColorWheel = renderColorWheel; exports.renderPaper = renderPaper; exports.renderStickers = renderStickers; exports.replayFrame = replayFrame; exports.replayItems = replayItems; exports.replayPainting = replayPainting; exports.resolvePaintGradient = _chunkFQPUF2W2cjs.resolvePaintGradient; exports.reversePaintGradient = _chunkFQPUF2W2cjs.reversePaintGradient; exports.rgbToHexColor = rgbToHexColor; exports.rgbToHsl = rgbToHsl; exports.rgbToHsv = rgbToHsv; exports.sampleArt = sampleArt; exports.sampleEffectAt = sampleEffectAt; exports.sampleEffectField = sampleEffectField; exports.samplePressure = samplePressure; exports.scalePaintGradient = _chunkFQPUF2W2cjs.scalePaintGradient; exports.scaleStencil = scaleStencil; exports.screenToDocument = screenToDocument; exports.seedFromString = _chunk3K6HWEXZcjs.seedFromString; exports.serializePaintDocument = serializePaintDocument; exports.serializePaintDocumentExternal = serializePaintDocumentExternal; exports.solidPaint = _chunkFQPUF2W2cjs.solidPaint; exports.stampCoverage = _chunkJSDND7DFcjs.stampCoverage; exports.standardBlendMode = _chunk2VX55NFMcjs.standardBlendMode; exports.startWetClock = startWetClock; exports.stencilMask = stencilMask; exports.stencilOutline = stencilOutline; exports.stickerAt = stickerAt; exports.stickerRect = stickerRect; exports.stickerRefLabel = stickerRefLabel; exports.stickerStamp = stickerStamp; exports.stickerSurface = stickerSurface; exports.strokeBounds = strokeBounds; exports.strokeDuration = strokeDuration; exports.strokeSchedule = strokeSchedule; exports.strokeToJSON = strokeToJSON; exports.sweepPath = sweepPath; exports.symmetryAxisAngles = symmetryAxisAngles; exports.symmetryAxisSegments = symmetryAxisSegments; exports.symmetryCopies = symmetryCopies; exports.thickFromJSON = thickFromJSON; exports.thickToJSON = thickToJSON; exports.thumbnailStroke = thumbnailStroke; exports.tiltToOrientation = tiltToOrientation; exports.timeLapseVideo = timeLapseVideo; exports.timeLapseZip = timeLapseZip; exports.toStrokePoint = toStrokePoint; exports.toggleDotTexture = toggleDotTexture; exports.toggleStamp = toggleStamp; exports.toggleStickerRef = toggleStickerRef; exports.translateStencil = translateStencil; exports.updatePaintGradientStop = _chunkFQPUF2W2cjs.updatePaintGradientStop; exports.usesPaintExchange = _chunkRSIKDWOPcjs.usesPaintExchange; exports.variationAffine = variationAffine; exports.varyStroke = varyStroke; exports.viewCssTransform = viewCssTransform; exports.viewMatrix = viewMatrix; exports.viewPenToDocument = viewPenToDocument; exports.wetEngineSummary = wetEngineSummary; exports.wetPaperInput = wetPaperInput; exports.wetPigmentOf = wetPigmentOf; exports.wetSupport = _chunkKBYB7OWBcjs.wetSupport; exports.wheelAngle = wheelAngle; exports.wheelPick = wheelPick; exports.wheelPoint = wheelPoint; exports.wheelToHue = _chunkI3Y2Q3PMcjs.wheelToHue; exports.withPaintPlayback = withPaintPlayback;
13673
+ exports.BACKLIGHT_SPILL = BACKLIGHT_SPILL; exports.BLEND_MENU_GROUPS = BLEND_MENU_GROUPS; exports.BLEND_MODES = _chunk2VX55NFMcjs.BLEND_MODES; exports.BRUSH_ID = _chunkTZOX7KWVcjs.BRUSH_ID; exports.BRUSH_ROTATIONS = _chunkTZOX7KWVcjs.BRUSH_ROTATIONS; exports.BRUSH_SLIDERS = _chunkPYTJBVW5cjs.BRUSH_SLIDERS; exports.BUILTIN_BRUSHES = _chunkTZOX7KWVcjs.BUILTIN_BRUSHES; exports.BristleStroke = BristleStroke; exports.DEFAULT_BACKLIGHT_COLOR = DEFAULT_BACKLIGHT_COLOR; exports.DEFAULT_BEHAVIOR = _chunkTZOX7KWVcjs.DEFAULT_BEHAVIOR; exports.DEFAULT_BRISTLE = _chunkTZOX7KWVcjs.DEFAULT_BRISTLE; exports.DEFAULT_BRUSH_ID = _chunkTZOX7KWVcjs.DEFAULT_BRUSH_ID; exports.DEFAULT_DPI = DEFAULT_DPI; exports.DEFAULT_DYNAMICS = _chunkTZOX7KWVcjs.DEFAULT_DYNAMICS; exports.DEFAULT_FLOW = _chunkYHDHFJUCcjs.DEFAULT_FLOW; exports.DEFAULT_IMPASTO = _chunkTZOX7KWVcjs.DEFAULT_IMPASTO; exports.DEFAULT_LIGHT = _chunkTZOX7KWVcjs.DEFAULT_LIGHT; exports.DEFAULT_LIGHTING = DEFAULT_LIGHTING; exports.DEFAULT_MULTI_COLOR = _chunkTZOX7KWVcjs.DEFAULT_MULTI_COLOR; exports.DEFAULT_PAINT_GRADIENT = _chunkFQPUF2W2cjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkFQPUF2W2cjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PAPER = DEFAULT_PAPER; exports.DEFAULT_PARTICLE = _chunkTZOX7KWVcjs.DEFAULT_PARTICLE; exports.DEFAULT_SPRAY = _chunkTZOX7KWVcjs.DEFAULT_SPRAY; exports.DEFAULT_STICKER = _chunkTZOX7KWVcjs.DEFAULT_STICKER; exports.DEFAULT_SWATCHES = DEFAULT_SWATCHES; exports.DEFAULT_VIEW = DEFAULT_VIEW; exports.DEFAULT_WET_BRUSH = _chunkTZOX7KWVcjs.DEFAULT_WET_BRUSH; exports.DEFAULT_WET_PARAMS = _chunkYHDHFJUCcjs.DEFAULT_WET_PARAMS; exports.DOT_ROTATIONS = _chunkTZOX7KWVcjs.DOT_ROTATIONS; exports.DOT_ROTATION_LABELS = DOT_ROTATION_LABELS; exports.DOT_TEXTURE_ORDERS = _chunkTZOX7KWVcjs.DOT_TEXTURE_ORDERS; exports.DOT_TEXTURE_ORDER_LABELS = DOT_TEXTURE_ORDER_LABELS; exports.DryStroke = DryStroke; exports.EFFECT_MAP_REPEATS = EFFECT_MAP_REPEATS; exports.EFFECT_STRIP_HEIGHT = EFFECT_STRIP_HEIGHT; exports.GPU_LEAD = GPU_LEAD; exports.GRAIN_PATTERNS = _chunkPXDIAYB6cjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkPXDIAYB6cjs.GRAIN_TILE; exports.HARMONY_KINDS = _chunkI3Y2Q3PMcjs.HARMONY_KINDS; exports.IDENTITY_AFFINE = IDENTITY_AFFINE; exports.IDENTITY_COPY = IDENTITY_COPY; exports.IMPASTO_TOOLS = _chunkTZOX7KWVcjs.IMPASTO_TOOLS; exports.IMPASTO_TOOL_LABELS = IMPASTO_TOOL_LABELS; exports.LIGHT_SLIDERS = LIGHT_SLIDERS; exports.LIVE_STROKE_ENGINES = LIVE_STROKE_ENGINES; exports.LitCache = LitCache; exports.MAX_BRUSH_SIZE = _chunkFQPUF2W2cjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_SIDE = MAX_CANVAS_SIDE; exports.MAX_COORDINATE = MAX_COORDINATE; exports.MAX_DOT_TEXTURES = _chunkTZOX7KWVcjs.MAX_DOT_TEXTURES; exports.MAX_IMAGE_SIDE = MAX_IMAGE_SIDE; exports.MAX_LIVE_EFFECT_SOURCES = MAX_LIVE_EFFECT_SOURCES; exports.MAX_STICKER_STAMPS = _chunkTZOX7KWVcjs.MAX_STICKER_STAMPS; exports.MAX_ZOOM = MAX_ZOOM; exports.MIN_CANVAS_SIDE = MIN_CANVAS_SIDE; exports.MIN_ZOOM = MIN_ZOOM; exports.MIXING_PAD_HEIGHT = MIXING_PAD_HEIGHT; exports.MIXING_PAD_WIDTH = MIXING_PAD_WIDTH; exports.MULTI_COLOR_MODES = _chunkTZOX7KWVcjs.MULTI_COLOR_MODES; exports.MixingPad = MixingPad; exports.PAD_SAMPLE_SIZES = PAD_SAMPLE_SIZES; exports.PAINTERLY_BLEND_MODES = _chunk2VX55NFMcjs.PAINTERLY_BLEND_MODES; exports.PAINT_BRUSH_CATEGORIES = _chunkTZOX7KWVcjs.PAINT_BRUSH_CATEGORIES; exports.PAINT_BRUSH_ENGINES = _chunkTZOX7KWVcjs.PAINT_BRUSH_ENGINES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkFQPUF2W2cjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_CONTRACT_FORMAT_VERSION = PAINT_CONTRACT_FORMAT_VERSION; exports.PAINT_DOCUMENT_JSON_SCHEMA = PAINT_DOCUMENT_JSON_SCHEMA; exports.PAINT_EFFECT_PLACES = PAINT_EFFECT_PLACES; exports.PAINT_FORMAT = PAINT_FORMAT; exports.PAINT_GRADIENT_FULL_SPEED = _chunkFQPUF2W2cjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkFQPUF2W2cjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkFQPUF2W2cjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkFQPUF2W2cjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkFQPUF2W2cjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkFQPUF2W2cjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkFQPUF2W2cjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkFQPUF2W2cjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkFQPUF2W2cjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkFQPUF2W2cjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SCHEMA_VERSION = PAINT_SCHEMA_VERSION; exports.PAINT_SHORTCUTS = PAINT_SHORTCUTS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkFQPUF2W2cjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TARGET = PAINT_TARGET; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_EFFECT_BLENDS = PAPER_EFFECT_BLENDS; exports.PAPER_EFFECT_NODE_ID = PAPER_EFFECT_NODE_ID; exports.PAPER_FAMILIES = PAPER_FAMILIES; exports.PAPER_LIBRARY = PAPER_LIBRARY; exports.PAPER_NODE_ID = PAPER_NODE_ID; exports.PAPER_SLIDERS = PAPER_SLIDERS; exports.PAPER_TARGET = PAPER_TARGET; exports.PARTICLE_KINDS = _chunkTZOX7KWVcjs.PARTICLE_KINDS; exports.PARTICLE_KIND_LABELS = PARTICLE_KIND_LABELS; exports.PARTICLE_RENDERS = _chunkTZOX7KWVcjs.PARTICLE_RENDERS; exports.PARTICLE_RENDER_LABELS = PARTICLE_RENDER_LABELS; exports.PaintCanvasPresenter = PaintCanvasPresenter; exports.PaintDabStroke = PaintDabStroke; exports.PaintDirector = PaintDirector; exports.PaintDocumentError = PaintDocumentError; exports.PaintEditorController = PaintEditorController; exports.PaintEditorError = PaintEditorError; exports.PaintEffectsRenderer = PaintEffectsRenderer; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkFQPUF2W2cjs.PaintGradientSampler; exports.PaintPresence = PaintPresence; exports.PaintSourceError = _chunkFQPUF2W2cjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaintWetLayers = PaintWetLayers; exports.PaperGrain = _chunkPXDIAYB6cjs.PaperGrain; exports.ParticleStroke = ParticleStroke; exports.PenDabWalker = PenDabWalker; exports.PenSmoother = PenSmoother; exports.PerspectiveSnapper = PerspectiveSnapper; exports.RIBBON_PAIRS = _chunkTZOX7KWVcjs.RIBBON_PAIRS; exports.RIBBON_PAIR_LABELS = RIBBON_PAIR_LABELS; exports.SNAP_DECIDE_DISTANCE = SNAP_DECIDE_DISTANCE; exports.STAMP_KINDS = _chunkJSDND7DFcjs.STAMP_KINDS; exports.STAMP_LABELS = STAMP_LABELS; exports.STENCIL_KINDS = STENCIL_KINDS; exports.STENCIL_SHAPES = STENCIL_SHAPES; exports.STICKER_ART_SIZE = STICKER_ART_SIZE; exports.STICKER_SLIDERS = STICKER_SLIDERS; exports.STROKE_SLIDERS = STROKE_SLIDERS; exports.SYMMETRY_MODES = SYMMETRY_MODES; exports.StencilSnapper = StencilSnapper; exports.StickerArtCache = StickerArtCache; exports.StickerBrowser = _chunkRVGP2XLFcjs.StickerBrowser; exports.StickerSpray = StickerSpray; exports.TRACING_NODE_ID = TRACING_NODE_ID; exports.ThickStrokeDriver = ThickStrokeDriver; exports.TileableNoise = _chunk3K6HWEXZcjs.TileableNoise; exports.WET_FLOW_KINDS = _chunkYHDHFJUCcjs.WET_FLOW_KINDS; exports.WET_GPU_MODES = WET_GPU_MODES; exports.WET_GPU_OPTIONS = WET_GPU_OPTIONS; exports.WET_MEDIA = _chunkTZOX7KWVcjs.WET_MEDIA; exports.WET_MEDIUM_LABELS = WET_MEDIUM_LABELS; exports.WET_MEDIUM_PARAMS = WET_MEDIUM_PARAMS; exports.WET_PARAM_KEYS = _chunkYHDHFJUCcjs.WET_PARAM_KEYS; exports.WET_PARAM_SCHEMA = WET_PARAM_SCHEMA; exports.WET_PARAM_SLIDERS = WET_PARAM_SLIDERS; exports.WET_SPEED_SLIDER = WET_SPEED_SLIDER; exports.WET_TILT_SLIDERS = WET_TILT_SLIDERS; exports.WET_TOOLS = _chunkTZOX7KWVcjs.WET_TOOLS; exports.WET_TOOL_LABELS = WET_TOOL_LABELS; exports.WetStrokeDriver = WetStrokeDriver; exports.addPaintGradientStop = _chunkFQPUF2W2cjs.addPaintGradientStop; exports.addPolygonArea = addPolygonArea; exports.affineCopy = affineCopy; exports.applyAffine = applyAffine; exports.backlightOf = backlightOf; exports.brushEngineControls = _chunkPYTJBVW5cjs.brushEngineControls; exports.brushLoadColor = brushLoadColor; exports.brushLoadForStroke = brushLoadForStroke; exports.brushTakesPaint = _chunkTZOX7KWVcjs.brushTakesPaint; exports.brushToJSON = _chunkTZOX7KWVcjs.brushToJSON; exports.buildTimeLapse = buildTimeLapse; exports.checkPaintEffectPlace = checkPaintEffectPlace; exports.clonePaper = clonePaper; exports.colorHarmony = colorHarmony2; exports.composeAffine = composeAffine; exports.contactSheet = contactSheet; exports.createPaintAgentStrokes = createPaintAgentStrokes; exports.createPaintBrushLibraryToolProvider = createPaintBrushLibraryToolProvider; exports.createPaintChangeFeed = createPaintChangeFeed; exports.createPaintCompositor = createPaintCompositor; exports.createPaintDocument = createPaintDocument; exports.createPaintEditorDocument = createPaintEditorDocument; exports.createPaintEditorToolProvider = createPaintEditorToolProvider; exports.createPaintEffectsToolProvider = createPaintEffectsToolProvider; exports.createPaintLayer = createPaintLayer; exports.createPaintProposalToolProvider = createPaintProposalToolProvider; exports.createPaintProposals = createPaintProposals; exports.createPaintReplayTools = createPaintReplayTools; exports.createPaintStickerTools = createPaintStickerTools; exports.createPaintThickTools = createPaintThickTools; exports.createPaintWetTools = createPaintWetTools; exports.decodeImageBlob = decodeImageBlob; exports.defaultGuides = defaultGuides; exports.defaultImageEncoder = defaultImageEncoder; exports.defaultStickerRasterizer = defaultStickerRasterizer; exports.deserializePaintDocument = deserializePaintDocument; exports.deserializePaintDocumentAsync = deserializePaintDocumentAsync; exports.documentExtensions = documentExtensions; exports.documentToScreen = documentToScreen; exports.downloadBytes = downloadBytes; exports.downsampleRgba = downsampleRgba; exports.drawSticker = drawSticker; exports.drawWaterOverlay = drawWaterOverlay; exports.effectDabField = effectDabField; exports.effectLayersToJSON = effectLayersToJSON; exports.effectPaintKey = effectPaintKey; exports.effectPaintSize = effectPaintSize; exports.emptiedLayers = emptiedLayers; exports.emptyThickChannels = emptyThickChannels; exports.fitZoom = fitZoom; exports.grainCatch = _chunkPXDIAYB6cjs.grainCatch; exports.grainHeights = _chunkPXDIAYB6cjs.grainHeights; exports.guideOverlay = guideOverlay; exports.handlePaintShortcut = handlePaintShortcut; exports.hash2 = _chunk3K6HWEXZcjs.hash2; exports.hexToPaintRgb = _chunkFQPUF2W2cjs.hexToPaintRgb; exports.hexToRgb8 = hexToRgb8; exports.hslToRgb = hslToRgb; exports.hsvToRgb = hsvToRgb; exports.hueToWheel = _chunkI3Y2Q3PMcjs.hueToWheel; exports.invertAffine = invertAffine; exports.isBlendMode = _chunk2VX55NFMcjs.isBlendMode; exports.isGradientPaint = _chunkFQPUF2W2cjs.isGradientPaint; exports.isPaintEffectPaint = isPaintEffectPaint; exports.isPainterlyBlendMode = _chunk2VX55NFMcjs.isPainterlyBlendMode; exports.isPalmTouch = isPalmTouch; exports.isWetBrush = _chunkTZOX7KWVcjs.isWetBrush; exports.isWetCapable = _chunkTZOX7KWVcjs.isWetCapable; exports.lightTile = lightTile; exports.lightingKey = lightingKey; exports.liveStrokeBounds = liveStrokeBounds; exports.liveStrokeRefusal = liveStrokeRefusal; exports.mapPenPoint = mapPenPoint; exports.mix32 = _chunk3K6HWEXZcjs.mix32; exports.mixPixels = mixPixels; exports.mixerLoadForStroke = mixerLoadForStroke; exports.mixerTip = mixerTip; exports.multiColorForDab = multiColorForDab; exports.multiColorGradient = multiColorGradient; exports.multiColorPalette = multiColorPalette; exports.multiColorSliders = _chunkPYTJBVW5cjs.multiColorSliders; exports.multiColorToPaint = _chunkTZOX7KWVcjs.multiColorToPaint; exports.newPaintLayerId = newPaintLayerId; exports.nextPaperEffectVersion = nextPaperEffectVersion; exports.normalizeBehavior = _chunkTZOX7KWVcjs.normalizeBehavior; exports.normalizeBristle = _chunkTZOX7KWVcjs.normalizeBristle; exports.normalizeBrushStroke = normalizeBrushStroke; exports.normalizeCanvas = normalizeCanvas; exports.normalizeDynamics = _chunkTZOX7KWVcjs.normalizeDynamics; exports.normalizeFlow = _chunkYHDHFJUCcjs.normalizeFlow; exports.normalizeHexColor = _chunkFQPUF2W2cjs.normalizeHexColor; exports.normalizeImpasto = _chunkTZOX7KWVcjs.normalizeImpasto; exports.normalizeLight = _chunkTZOX7KWVcjs.normalizeLight; exports.normalizeLighting = normalizeLighting; exports.normalizeMultiColor = _chunkTZOX7KWVcjs.normalizeMultiColor; exports.normalizePaintBrush = _chunkTZOX7KWVcjs.normalizePaintBrush; exports.normalizePaper = normalizePaper; exports.normalizeParticle = _chunkTZOX7KWVcjs.normalizeParticle; exports.normalizePerspective = normalizePerspective; exports.normalizeRotation = normalizeRotation; exports.normalizeStencil = normalizeStencil; exports.normalizeStickerSettings = _chunkTZOX7KWVcjs.normalizeStickerSettings; exports.normalizeStickerUpdate = normalizeStickerUpdate; exports.normalizeSymmetry = normalizeSymmetry; exports.normalizeView = normalizeView; exports.normalizeWetBrush = _chunkTZOX7KWVcjs.normalizeWetBrush; exports.normalizeWetParams = _chunkYHDHFJUCcjs.normalizeWetParams; exports.overPixels = overPixels; exports.padSampleRadius = padSampleRadius; exports.paintAgentStrokePoints = paintAgentStrokePoints; exports.paintContracts = paintContracts; exports.paintGradientMappingFor = _chunkFQPUF2W2cjs.paintGradientMappingFor; exports.paintPlaybackPanel = paintPlaybackPanel; exports.paintProposalGhost = paintProposalGhost; exports.paintShortcutFor = paintShortcutFor; exports.paintSourceColor = _chunkFQPUF2W2cjs.paintSourceColor; exports.paintSourceCss = _chunkFQPUF2W2cjs.paintSourceCss; exports.paintToMultiColor = _chunkTZOX7KWVcjs.paintToMultiColor; exports.paperEffectFromJSON = paperEffectFromJSON; exports.paperEffectToJSON = paperEffectToJSON; exports.paperGrain = paperGrain; exports.paperKey = paperKey; exports.paperNode = paperNode; exports.paperPreset = paperPreset; exports.parseBrushLibrary = _chunkTZOX7KWVcjs.parseBrushLibrary; exports.parseHexColor = parseHexColor; exports.parsePaintSource = _chunkFQPUF2W2cjs.parsePaintSource; exports.patchBrushValue = _chunkPYTJBVW5cjs.patchBrushValue; exports.patchPath = patchPath; exports.penOrientation = penOrientation; exports.perspectiveDirections = perspectiveDirections; exports.perspectiveGuideLines = perspectiveGuideLines; exports.planPaintToolPlayback = planPaintToolPlayback; exports.pointerToPenPoint = pointerToPenPoint; exports.quickStencil = quickStencil; exports.rand01 = _chunk3K6HWEXZcjs.rand01; exports.randSigned = _chunk3K6HWEXZcjs.randSigned; exports.readEffectStrokeMap = readEffectStrokeMap; exports.readPaintEffectPaint = readPaintEffectPaint; exports.readPaintEffectSource = readPaintEffectSource; exports.readPaintSource = _chunkFQPUF2W2cjs.readPaintSource; exports.readPath = readPath; exports.readSwatch = readSwatch; exports.reliefInfo = reliefInfo; exports.removePaintGradientStop = _chunkFQPUF2W2cjs.removePaintGradientStop; exports.renderBrushThumbnail = renderBrushThumbnail; exports.renderColorWheel = renderColorWheel; exports.renderPaper = renderPaper; exports.renderStickers = renderStickers; exports.replayFrame = replayFrame; exports.replayItems = replayItems; exports.replayPainting = replayPainting; exports.resolvePaintGradient = _chunkFQPUF2W2cjs.resolvePaintGradient; exports.reversePaintGradient = _chunkFQPUF2W2cjs.reversePaintGradient; exports.rgbToHexColor = rgbToHexColor; exports.rgbToHsl = rgbToHsl; exports.rgbToHsv = rgbToHsv; exports.sampleArt = sampleArt; exports.sampleEffectAt = sampleEffectAt; exports.sampleEffectField = sampleEffectField; exports.samplePressure = samplePressure; exports.scalePaintGradient = _chunkFQPUF2W2cjs.scalePaintGradient; exports.scaleStencil = scaleStencil; exports.screenToDocument = screenToDocument; exports.seedFromString = _chunk3K6HWEXZcjs.seedFromString; exports.serializePaintDocument = serializePaintDocument; exports.serializePaintDocumentExternal = serializePaintDocumentExternal; exports.solidPaint = _chunkFQPUF2W2cjs.solidPaint; exports.stampCoverage = _chunkJSDND7DFcjs.stampCoverage; exports.standardBlendMode = _chunk2VX55NFMcjs.standardBlendMode; exports.startWetClock = startWetClock; exports.stencilMask = stencilMask; exports.stencilOutline = stencilOutline; exports.stickerAt = stickerAt; exports.stickerRect = stickerRect; exports.stickerRefLabel = stickerRefLabel; exports.stickerStamp = stickerStamp; exports.stickerSurface = stickerSurface; exports.strokeBounds = strokeBounds; exports.strokeDuration = strokeDuration; exports.strokeSchedule = strokeSchedule; exports.strokeToJSON = strokeToJSON; exports.sweepPath = sweepPath; exports.symmetryAxisAngles = symmetryAxisAngles; exports.symmetryAxisSegments = symmetryAxisSegments; exports.symmetryCopies = symmetryCopies; exports.thickFromJSON = thickFromJSON; exports.thickToJSON = thickToJSON; exports.thumbnailStroke = thumbnailStroke; exports.tiltToOrientation = tiltToOrientation; exports.timeLapseVideo = timeLapseVideo; exports.timeLapseZip = timeLapseZip; exports.toStrokePoint = toStrokePoint; exports.toggleDotTexture = toggleDotTexture; exports.toggleStamp = toggleStamp; exports.toggleStickerRef = toggleStickerRef; exports.translateStencil = translateStencil; exports.updatePaintGradientStop = _chunkFQPUF2W2cjs.updatePaintGradientStop; exports.usesPaintExchange = _chunkTZOX7KWVcjs.usesPaintExchange; exports.variationAffine = variationAffine; exports.varyStroke = varyStroke; exports.viewCssTransform = viewCssTransform; exports.viewMatrix = viewMatrix; exports.viewPenToDocument = viewPenToDocument; exports.wetEngineSummary = wetEngineSummary; exports.wetPaperInput = wetPaperInput; exports.wetPigmentOf = wetPigmentOf; exports.wetSupport = _chunkYHDHFJUCcjs.wetSupport; exports.wheelAngle = wheelAngle; exports.wheelPick = wheelPick; exports.wheelPoint = wheelPoint; exports.wheelToHue = _chunkI3Y2Q3PMcjs.wheelToHue; exports.withPaintPlayback = withPaintPlayback;