@pixerate/editor 0.237.0 → 0.239.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 (94) hide show
  1. package/dist/agent/index.cjs +40 -39
  2. package/dist/agent/index.js +9 -8
  3. package/dist/animation/index.cjs +7 -6
  4. package/dist/animation/index.js +6 -5
  5. package/dist/animation-editor/index.cjs +66 -65
  6. package/dist/animation-editor/index.js +9 -8
  7. package/dist/{brushstrokeRender-WDTKD54B.cjs → brushstrokeRender-MPOM7BFW.cjs} +7 -5
  8. package/dist/{brushstrokeRender-MAHOXL7K.js → brushstrokeRender-WB67GMUP.js} +4 -2
  9. package/dist/canvas/index.cjs +55 -54
  10. package/dist/canvas/index.js +10 -9
  11. package/dist/chart/index.cjs +159 -158
  12. package/dist/chart/index.js +9 -8
  13. package/dist/{chunk-L6Y7TSQ4.js → chunk-36ZTV7WO.js} +1 -1
  14. package/dist/{chunk-JVNGCS26.js → chunk-3E36VDMJ.js} +1 -1
  15. package/dist/{chunk-WRZ6C4TU.cjs → chunk-3R5P3DVY.cjs} +6 -6
  16. package/dist/{chunk-RUONPPMC.cjs → chunk-44BMJJVA.cjs} +8 -8
  17. package/dist/{chunk-YBAPT7NL.js → chunk-6ADHGQ73.js} +4 -2
  18. package/dist/chunk-7AHBW2CQ.cjs +200 -0
  19. package/dist/{chunk-EUIDTZNQ.cjs → chunk-7PT4RJL5.cjs} +113 -111
  20. package/dist/{chunk-CU6ANS5L.js → chunk-7YGBSFC6.js} +2 -2
  21. package/dist/{chunk-ATKKG76G.cjs → chunk-AD7GA3TL.cjs} +23 -23
  22. package/dist/{chunk-FSLKBQU7.js → chunk-AIS56JOO.js} +3 -3
  23. package/dist/{chunk-5VQXSS2S.cjs → chunk-BBUE3UJL.cjs} +86 -86
  24. package/dist/{chunk-7272D3K2.js → chunk-BP6KSGVD.js} +6 -4
  25. package/dist/{chunk-F6R67I3A.js → chunk-CXXXAZ7H.js} +1 -1
  26. package/dist/{chunk-5DQPDXOM.cjs → chunk-D2SGV525.cjs} +76 -76
  27. package/dist/chunk-F67XMVDI.js +200 -0
  28. package/dist/{chunk-JVSX5QTS.js → chunk-FQVVO5YA.js} +3 -3
  29. package/dist/{chunk-UXETV2NC.cjs → chunk-GA4EU4P3.cjs} +4 -4
  30. package/dist/{chunk-UFEDHACQ.js → chunk-GXAK6Q5J.js} +2 -2
  31. package/dist/{chunk-MHLU6GRJ.js → chunk-JEGJP4OW.js} +7 -196
  32. package/dist/chunk-KMPM5JM5.js +936 -0
  33. package/dist/{chunk-GOBOCZZI.js → chunk-LEQKZGQI.js} +1 -1
  34. package/dist/{chunk-M5GLQQWG.cjs → chunk-LJZRHVZV.cjs} +2 -2
  35. package/dist/{chunk-N76AMOKE.cjs → chunk-MOW3JMNG.cjs} +42 -42
  36. package/dist/{chunk-WKMUBATU.js → chunk-N4DFDI73.js} +1 -1
  37. package/dist/{chunk-GNZI3KYK.cjs → chunk-NKTNLJUJ.cjs} +49 -9
  38. package/dist/{chunk-TQOL6CF7.js → chunk-PJYG6FCF.js} +49 -9
  39. package/dist/{chunk-V3L7U63N.cjs → chunk-PP6BXVRL.cjs} +1 -1
  40. package/dist/{chunk-TFF2GTGN.cjs → chunk-PPFJHTW5.cjs} +24 -22
  41. package/dist/{chunk-6ZZKRH7R.js → chunk-QARCM66V.js} +3 -3
  42. package/dist/{chunk-5UEFBM2M.cjs → chunk-RD7RX52G.cjs} +18 -207
  43. package/dist/{chunk-CDP2AKMA.js → chunk-RV5DKZHU.js} +1 -1
  44. package/dist/chunk-S6OT6CTS.cjs +936 -0
  45. package/dist/{chunk-HUAISCUX.cjs → chunk-T7KQEMAE.cjs} +18 -18
  46. package/dist/{chunk-BQE3Y6ZO.cjs → chunk-THXFU3JB.cjs} +5 -5
  47. package/dist/{chunk-4ZC5QJE2.cjs → chunk-UTI5IITZ.cjs} +3 -3
  48. package/dist/{chunk-XSVUNSDJ.js → chunk-UUBO6RB5.js} +1 -1
  49. package/dist/{chunk-CZWUDFR3.cjs → chunk-UZU6DIZA.cjs} +52 -52
  50. package/dist/{chunk-M2TPMYJE.js → chunk-V6DT2CDH.js} +1 -1
  51. package/dist/{chunk-WV5WTOC6.cjs → chunk-W7GRGGBH.cjs} +16 -16
  52. package/dist/{chunk-23E5GI2U.js → chunk-WGN7AUKB.js} +2 -2
  53. package/dist/{chunk-YMREOA67.js → chunk-XK4SST43.js} +2 -2
  54. package/dist/{chunk-SOSBOS5T.cjs → chunk-XWOLPNBW.cjs} +22 -22
  55. package/dist/{chunk-ILP77UD6.js → chunk-YGQVCQTG.js} +1 -1
  56. package/dist/{chunk-GXLZZVR5.cjs → chunk-ZXNO3ZOX.cjs} +37 -37
  57. package/dist/color/index.cjs +6 -4
  58. package/dist/color/index.js +9 -7
  59. package/dist/export/index.cjs +8 -7
  60. package/dist/export/index.js +7 -6
  61. package/dist/extensions/index.cjs +11 -10
  62. package/dist/extensions/index.js +10 -9
  63. package/dist/gradient/index.cjs +104 -813
  64. package/dist/gradient/index.d.cts +1 -0
  65. package/dist/gradient/index.d.ts +1 -0
  66. package/dist/gradient/index.js +87 -796
  67. package/dist/gradient/sample.d.cts +69 -0
  68. package/dist/gradient/sample.d.ts +69 -0
  69. package/dist/image-editor/index.cjs +826 -778
  70. package/dist/image-editor/index.js +57 -9
  71. package/dist/index.cjs +17 -16
  72. package/dist/index.js +11 -10
  73. package/dist/paint-editor/controller.d.cts +31 -1
  74. package/dist/paint-editor/controller.d.ts +31 -1
  75. package/dist/paint-editor/index.cjs +403 -195
  76. package/dist/paint-editor/index.js +231 -23
  77. package/dist/paint-editor/sticker-tools.d.cts +1 -1
  78. package/dist/paint-editor/sticker-tools.d.ts +1 -1
  79. package/dist/paint-editor/stickers.d.cts +10 -3
  80. package/dist/paint-editor/stickers.d.ts +10 -3
  81. package/dist/paint-editor/ui.d.cts +10 -3
  82. package/dist/paint-editor/ui.d.ts +10 -3
  83. package/dist/tokens/index.cjs +4 -3
  84. package/dist/tokens/index.js +3 -2
  85. package/dist/typography/index.cjs +8 -7
  86. package/dist/typography/index.js +3 -2
  87. package/dist/vector/index.cjs +967 -966
  88. package/dist/vector/index.js +9 -8
  89. package/dist/video-editor/index.cjs +7 -6
  90. package/dist/video-editor/index.js +6 -5
  91. package/package.json +1 -1
  92. package/skills/pixerate-color/SKILL.md +3 -0
  93. package/skills/pixerate-image-editor/SKILL.md +1 -0
  94. package/skills/pixerate-paint-editor/SKILL.md +6 -2
@@ -7,7 +7,7 @@ var _chunkZQIWBJGHcjs = require('../chunk-ZQIWBJGH.cjs');
7
7
 
8
8
 
9
9
 
10
- var _chunk5VQXSS2Scjs = require('../chunk-5VQXSS2S.cjs');
10
+ var _chunkBBUE3UJLcjs = require('../chunk-BBUE3UJL.cjs');
11
11
  require('../chunk-A2IS7EHE.cjs');
12
12
  require('../chunk-SS53NNZO.cjs');
13
13
 
@@ -55,7 +55,7 @@ var _chunkJLWLX52Lcjs = require('../chunk-JLWLX52L.cjs');
55
55
 
56
56
 
57
57
  var _chunkK7ENM55Pcjs = require('../chunk-K7ENM55P.cjs');
58
- require('../chunk-BQE3Y6ZO.cjs');
58
+ require('../chunk-THXFU3JB.cjs');
59
59
 
60
60
 
61
61
 
@@ -125,7 +125,8 @@ require('../chunk-BQE3Y6ZO.cjs');
125
125
 
126
126
 
127
127
 
128
- var _chunkGNZI3KYKcjs = require('../chunk-GNZI3KYK.cjs');
128
+
129
+ var _chunkNKTNLJUJcjs = require('../chunk-NKTNLJUJ.cjs');
129
130
  require('../chunk-CVFAAZXE.cjs');
130
131
  require('../chunk-GF2RBSDM.cjs');
131
132
  require('../chunk-NM3G4VQT.cjs');
@@ -240,16 +241,17 @@ require('../chunk-UWEQ55MY.cjs');
240
241
 
241
242
  var _chunkSJ2CPTQCcjs = require('../chunk-SJ2CPTQC.cjs');
242
243
  require('../chunk-2BSBFBOA.cjs');
243
- require('../chunk-4ZC5QJE2.cjs');
244
+ require('../chunk-UTI5IITZ.cjs');
244
245
  require('../chunk-A6QWKBJP.cjs');
245
246
 
246
247
 
247
248
 
248
249
 
249
250
 
250
- var _chunkEUIDTZNQcjs = require('../chunk-EUIDTZNQ.cjs');
251
- require('../chunk-TFF2GTGN.cjs');
252
- require('../chunk-5UEFBM2M.cjs');
251
+ var _chunk7PT4RJL5cjs = require('../chunk-7PT4RJL5.cjs');
252
+ require('../chunk-PPFJHTW5.cjs');
253
+ require('../chunk-RD7RX52G.cjs');
254
+ require('../chunk-7AHBW2CQ.cjs');
253
255
  require('../chunk-IPJ3TEYR.cjs');
254
256
 
255
257
  // src/paint-editor/document.ts
@@ -283,7 +285,7 @@ function normalizeCanvas(raw) {
283
285
  function createPaintDocument(options = {}) {
284
286
  const canvas = normalizeCanvas({ width: _nullishCoalesce(options.width, () => ( 2048)), height: _nullishCoalesce(options.height, () => ( 1536)), dpi: options.dpi });
285
287
  const layer = createPaintLayer("Layer 1");
286
- return { canvas, paper: _chunkGNZI3KYKcjs.normalizePaper.call(void 0, _nullishCoalesce(options.paper, () => ( {}))), layers: [layer], activeLayerId: layer.id, strokes: [] };
288
+ return { canvas, paper: _chunkNKTNLJUJcjs.normalizePaper.call(void 0, _nullishCoalesce(options.paper, () => ( {}))), layers: [layer], activeLayerId: layer.id, strokes: [] };
287
289
  }
288
290
 
289
291
  // src/paint-editor/dab-stroke.ts
@@ -337,13 +339,13 @@ var PaintDabStroke = (_class = class {
337
339
  constructor(brush, options) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);_class.prototype.__init8.call(this);_class.prototype.__init9.call(this);_class.prototype.__init10.call(this);
338
340
  this.brush = brush;
339
341
  this.options = options;
340
- this.smoother = new (0, _chunkGNZI3KYKcjs.PenSmoother)(brush.tip.smoothing, brush.pressureSmoothing);
341
- this.copies = _optionalChain([options, 'access', _2 => _2.copies, 'optionalAccess', _3 => _3.length]) ? options.copies : [_chunkGNZI3KYKcjs.IDENTITY_COPY];
342
+ this.smoother = new (0, _chunkNKTNLJUJcjs.PenSmoother)(brush.tip.smoothing, brush.pressureSmoothing);
343
+ this.copies = _optionalChain([options, 'access', _2 => _2.copies, 'optionalAccess', _3 => _3.length]) ? options.copies : [_chunkNKTNLJUJcjs.IDENTITY_COPY];
342
344
  const exchanging = brush.engine === "mixer" || brush.engine === "dab";
343
345
  const rates = brush.engine === "mixer" ? _chunkPQ3H2AANcjs.mixerRates.call(void 0, brush.mixer) : _chunkPQ3H2AANcjs.exchangeRates.call(void 0, brush.behavior.pickup, brush.behavior.mix, 1, brush.behavior.mixing);
344
346
  this.mixing = brush.engine === "mixer" ? brush.mixer.mixing : brush.behavior.mixing;
345
347
  this.states = this.copies.map((c, i) => ({
346
- walker: new (0, _chunkGNZI3KYKcjs.PenDabWalker)(brush, (_nullishCoalesce(options.seed, () => ( 0))) + i * 7919 | 0, c.linear),
348
+ walker: new (0, _chunkNKTNLJUJcjs.PenDabWalker)(brush, (_nullishCoalesce(options.seed, () => ( 0))) + i * 7919 | 0, c.linear),
347
349
  exchange: exchanging ? new (0, _chunkPQ3H2AANcjs.PaintExchange)(rates, options.load) : null,
348
350
  smudge: brush.engine === "smudge" ? new (0, _chunkPQ3H2AANcjs.SmudgeTip)(brush.smudge, brush.tip.size * (1 + brush.dynamics.tiltSize * 1.5)) : null
349
351
  }));
@@ -456,7 +458,7 @@ var PaintDabStroke = (_class = class {
456
458
  let flow = 1;
457
459
  if (this.options.effect) {
458
460
  const rgb = [0, 0, 0];
459
- flow = _chunkGNZI3KYKcjs.sampleEffectAt.call(void 0, this.options.effect, d.x, d.y, rgb);
461
+ flow = _chunkNKTNLJUJcjs.sampleEffectAt.call(void 0, this.options.effect, d.x, d.y, rgb);
460
462
  ex.setReservoirColor(rgb[0], rgb[1], rgb[2]);
461
463
  } else if (this.sampler && !this.gradient) {
462
464
  const g = this.sampler.dab(d, this.sample);
@@ -687,12 +689,12 @@ var ThickStrokeDriver = (_class3 = class {
687
689
  constructor(init) {;_class3.prototype.__init12.call(this);_class3.prototype.__init13.call(this);_class3.prototype.__init14.call(this);_class3.prototype.__init15.call(this);_class3.prototype.__init16.call(this);_class3.prototype.__init17.call(this);_class3.prototype.__init18.call(this);_class3.prototype.__init19.call(this);_class3.prototype.__init20.call(this);
688
690
  this.init = init;
689
691
  const b = init.brush;
690
- this.smoother = new (0, _chunkGNZI3KYKcjs.PenSmoother)(b.tip.smoothing, b.pressureSmoothing);
691
- const copies = init.copies.length ? init.copies : [_chunkGNZI3KYKcjs.IDENTITY_COPY];
692
+ this.smoother = new (0, _chunkNKTNLJUJcjs.PenSmoother)(b.tip.smoothing, b.pressureSmoothing);
693
+ const copies = init.copies.length ? init.copies : [_chunkNKTNLJUJcjs.IDENTITY_COPY];
692
694
  this.copies = copies;
693
695
  const rates = _chunkPQ3H2AANcjs.exchangeRates.call(void 0, b.behavior.pickup, b.behavior.mix, 1, b.behavior.mixing);
694
696
  this.states = copies.map((c, i) => ({
695
- walker: new (0, _chunkGNZI3KYKcjs.PenDabWalker)(b, init.seed + i * 7919 | 0, c.linear),
697
+ walker: new (0, _chunkNKTNLJUJcjs.PenDabWalker)(b, init.seed + i * 7919 | 0, c.linear),
696
698
  exchange: new (0, _chunkPQ3H2AANcjs.PaintExchange)(rates, init.load),
697
699
  smudge: b.impasto.tool === "knife" ? new (0, _chunkPQ3H2AANcjs.SmudgeTip)({ strength: 0.85, length: 0.6 + 0.38 * b.impasto.drag, mixing: b.behavior.mixing }, b.tip.size * 1.2) : null,
698
700
  carried: null,
@@ -990,7 +992,7 @@ var PaintStrokeSession = (_class4 = class {
990
992
  this.layerId = init.layerId;
991
993
  this.base = init.surface;
992
994
  this.live = new Map(this.base.tiles);
993
- this.copies = init.copies.length ? init.copies : [_chunkGNZI3KYKcjs.IDENTITY_COPY];
995
+ this.copies = init.copies.length ? init.copies : [_chunkNKTNLJUJcjs.IDENTITY_COPY];
994
996
  const brush = init.brush;
995
997
  if (init.wet) this.wetDriver = init.wet.driver;
996
998
  const effect = _nullishCoalesce(_optionalChain([init, 'access', _15 => _15.effect, 'optionalAccess', _16 => _16.pixels]), () => ( null));
@@ -1007,11 +1009,11 @@ var PaintStrokeSession = (_class4 = class {
1007
1009
  };
1008
1010
  if (this.wetDriver) {
1009
1011
  } else if (init.sticker) {
1010
- this.stickerSpray = new (0, _chunkGNZI3KYKcjs.StickerSpray)({ brush, target: this.tileTarget(), color: init.colorHex, seed: init.seed, copies: this.copies, nextId: init.sticker.nextId, paint: _nullishCoalesce(init.paint, () => ( null)) });
1012
+ this.stickerSpray = new (0, _chunkNKTNLJUJcjs.StickerSpray)({ brush, target: this.tileTarget(), color: init.colorHex, seed: init.seed, copies: this.copies, nextId: init.sticker.nextId, paint: _nullishCoalesce(init.paint, () => ( null)) });
1011
1013
  } else if (init.thick) {
1012
1014
  const rgb = (c) => [c[0] / 255, c[1] / 255, c[2] / 255];
1013
1015
  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)) });
1014
- } else if (brush.engine === "mixer" || brush.engine === "blender" || brush.engine === "smudge" || _chunkGNZI3KYKcjs.usesPaintExchange.call(void 0, brush, Boolean(init.paint))) {
1016
+ } else if (brush.engine === "mixer" || brush.engine === "blender" || brush.engine === "smudge" || _chunkNKTNLJUJcjs.usesPaintExchange.call(void 0, brush, Boolean(init.paint))) {
1015
1017
  const rgb = (c) => [c[0] / 255, c[1] / 255, c[2] / 255];
1016
1018
  this.wet = new PaintDabStroke(brush, {
1017
1019
  target: this.tileTarget(),
@@ -1027,7 +1029,7 @@ var PaintStrokeSession = (_class4 = class {
1027
1029
  });
1028
1030
  } else {
1029
1031
  const opts = { grain: init.grain, paperDepth: init.paperDepth, seed: init.seed, copies: this.copies, paint: _nullishCoalesce(init.paint, () => ( null)), effect };
1030
- this.dry = brush.engine === "particle" ? new (0, _chunkGNZI3KYKcjs.ParticleStroke)(brush, opts) : brush.engine === "bristle" ? new (0, _chunkGNZI3KYKcjs.BristleStroke)(brush, opts) : new (0, _chunkGNZI3KYKcjs.DryStroke)(brush, opts);
1032
+ this.dry = brush.engine === "particle" ? new (0, _chunkNKTNLJUJcjs.ParticleStroke)(brush, opts) : brush.engine === "bristle" ? new (0, _chunkNKTNLJUJcjs.BristleStroke)(brush, opts) : new (0, _chunkNKTNLJUJcjs.DryStroke)(brush, opts);
1031
1033
  }
1032
1034
  }
1033
1035
 
@@ -1198,7 +1200,7 @@ function brushLoadForStroke(brush, current, color) {
1198
1200
  if (brush.engine === "mixer") return mixerLoadForStroke(brush, current, color);
1199
1201
  if (brush.engine === "impasto") return { reservoir: [color[0], color[1], color[2]], amount: 1, pickup: brush.behavior.dirty ? current.pickup : null };
1200
1202
  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 } : _chunkPQ3H2AANcjs.EMPTY_MIXER_LOAD;
1201
- if (_chunkGNZI3KYKcjs.usesPaintExchange.call(void 0, brush)) return { reservoir: [color[0], color[1], color[2]], amount: 1, pickup: brush.behavior.dirty ? current.pickup : null };
1203
+ if (_chunkNKTNLJUJcjs.usesPaintExchange.call(void 0, brush)) return { reservoir: [color[0], color[1], color[2]], amount: 1, pickup: brush.behavior.dirty ? current.pickup : null };
1202
1204
  return _chunkPQ3H2AANcjs.EMPTY_MIXER_LOAD;
1203
1205
  }
1204
1206
 
@@ -1466,7 +1468,7 @@ function normalizeBrushStroke(raw) {
1466
1468
  const out = {
1467
1469
  id: r.id,
1468
1470
  layerId: r.layerId,
1469
- brush: _chunkGNZI3KYKcjs.normalizePaintBrush.call(void 0, _nullishCoalesce(r.brush, () => ( {}))),
1471
+ brush: _chunkNKTNLJUJcjs.normalizePaintBrush.call(void 0, _nullishCoalesce(r.brush, () => ( {}))),
1470
1472
  color: typeof r.color === "string" && /^#[0-9a-f]{6}$/i.test(r.color) ? r.color.toLowerCase() : "#000000",
1471
1473
  points,
1472
1474
  seed: finite2(r.seed) ? r.seed | 0 : 0
@@ -1485,7 +1487,7 @@ function normalizeBrushStroke(raw) {
1485
1487
  }
1486
1488
  if (st.length) out.stencils = st;
1487
1489
  }
1488
- const effect = _chunkGNZI3KYKcjs.readPaintEffectPaint.call(void 0, r.paint);
1490
+ const effect = _chunkNKTNLJUJcjs.readPaintEffectPaint.call(void 0, r.paint);
1489
1491
  const paint = effect ? null : _chunkPQ3H2AANcjs.readPaintSource.call(void 0, r.paint);
1490
1492
  if (effect) out.paint = effect;
1491
1493
  else if (paint && paint.type === "gradient") out.paint = paint;
@@ -1524,7 +1526,7 @@ function varyStroke(stroke, m, v) {
1524
1526
  if (ps !== 1) q.pressure = Math.min(1, Math.max(0, (_nullishCoalesce(p.pressure, () => ( 1))) * ps));
1525
1527
  return q;
1526
1528
  });
1527
- const brush = s !== 1 ? _chunkGNZI3KYKcjs.normalizePaintBrush.call(void 0, { ...stroke.brush, tip: { ...stroke.brush.tip, size: stroke.brush.tip.size * s } }) : stroke.brush;
1529
+ const brush = s !== 1 ? _chunkNKTNLJUJcjs.normalizePaintBrush.call(void 0, { ...stroke.brush, tip: { ...stroke.brush.tip, size: stroke.brush.tip.size * s } }) : stroke.brush;
1528
1530
  const out = { ...stroke, brush, points };
1529
1531
  if (_optionalChain([stroke, 'access', _59 => _59.paint, 'optionalAccess', _60 => _60.type]) === "gradient" && s !== 1) out.paint = _chunkPQ3H2AANcjs.scalePaintGradient.call(void 0, stroke.paint, s);
1530
1532
  if (_optionalChain([stroke, 'access', _61 => _61.copies, 'optionalAccess', _62 => _62.length])) {
@@ -1568,7 +1570,7 @@ function paperTile(paper, r, light) {
1568
1570
  const key = `${paperKey(paper, light)}|${r.x},${r.y},${r.width},${r.height}`;
1569
1571
  let t = tileCache.get(key);
1570
1572
  if (!t) {
1571
- t = _chunkGNZI3KYKcjs.renderPaper.call(void 0, paper, r, paperGrain(paper), light);
1573
+ t = _chunkNKTNLJUJcjs.renderPaper.call(void 0, paper, r, paperGrain(paper), light);
1572
1574
  if (tileCache.size > 512) tileCache.delete(tileCache.keys().next().value);
1573
1575
  tileCache.set(key, t);
1574
1576
  }
@@ -1673,11 +1675,11 @@ function header(state, options) {
1673
1675
  return out;
1674
1676
  }
1675
1677
  function serializePaintDocument(state, options = {}) {
1676
- const { layers, assets } = _chunk5VQXSS2Scjs.serializeLayers.call(void 0, state.layers);
1678
+ const { layers, assets } = _chunkBBUE3UJLcjs.serializeLayers.call(void 0, state.layers);
1677
1679
  return { ...header(state, options), layers, assets };
1678
1680
  }
1679
1681
  async function serializePaintDocumentExternal(state, store, options = {}) {
1680
- const { layers, assets } = await _chunk5VQXSS2Scjs.serializeLayersExternal.call(void 0, state.layers, store);
1682
+ const { layers, assets } = await _chunkBBUE3UJLcjs.serializeLayersExternal.call(void 0, state.layers, store);
1681
1683
  return { ...header(state, options), layers, assets };
1682
1684
  }
1683
1685
  function paintLayersOnly(layers, problems) {
@@ -1712,9 +1714,9 @@ function deserializePaintDocument(raw) {
1712
1714
  }
1713
1715
  const problems = [];
1714
1716
  const canvas = normalizeCanvas({ width: r.width, height: r.height, dpi: _nullishCoalesce(r.dpi, () => ( void 0)) });
1715
- const paper = _chunkGNZI3KYKcjs.normalizePaper.call(void 0, _nullishCoalesce(r.paper, () => ( {})));
1717
+ const paper = _chunkNKTNLJUJcjs.normalizePaper.call(void 0, _nullishCoalesce(r.paper, () => ( {})));
1716
1718
  const assets = r.assets && typeof r.assets === "object" ? r.assets : {};
1717
- const layers = paintLayersOnly(_chunk5VQXSS2Scjs.deserializeLayers.call(void 0, r.layers, { assets, problems }), problems);
1719
+ const layers = paintLayersOnly(_chunkBBUE3UJLcjs.deserializeLayers.call(void 0, r.layers, { assets, problems }), problems);
1718
1720
  const wanted = typeof r.activeLayerId === "string" ? r.activeLayerId : null;
1719
1721
  const activeLayerId = wanted && _chunkHB4ICNNAcjs.findLayer.call(void 0, layers, wanted) ? wanted : _nullishCoalesce(_optionalChain([_chunkHB4ICNNAcjs.flattenLayers.call(void 0, layers), 'access', _74 => _74.filter, 'call', _75 => _75((l) => l.type === "pixel"), 'access', _76 => _76.pop, 'call', _77 => _77(), 'optionalAccess', _78 => _78.id]), () => ( null));
1720
1722
  const wetEvents = Array.isArray(r.wetEvents) ? r.wetEvents.filter((e) => e && typeof e === "object" && Number.isInteger(e.clock) && typeof e.kind === "string") : [];
@@ -1730,7 +1732,7 @@ async function deserializePaintDocumentAsync(raw, store) {
1730
1732
  if (!raw || typeof raw !== "object") throw new Error("Not a paint document: expected a JSON object.");
1731
1733
  const r = raw;
1732
1734
  const problems = [];
1733
- const assets = await _chunk5VQXSS2Scjs.resolveExternalAssets.call(void 0, _nullishCoalesce(r.assets, () => ( {})), store, problems);
1735
+ const assets = await _chunkBBUE3UJLcjs.resolveExternalAssets.call(void 0, _nullishCoalesce(r.assets, () => ( {})), store, problems);
1734
1736
  const loaded = deserializePaintDocument({ ...r, assets });
1735
1737
  return { ...loaded, problems: [...problems, ...loaded.problems] };
1736
1738
  }
@@ -1813,7 +1815,7 @@ function pointerToPenPoint(e, x, y, view) {
1813
1815
  const p = { x, y, pressure: samplePressure(e) };
1814
1816
  if (typeof e.timeStamp === "number" && Number.isFinite(e.timeStamp)) p.t = e.timeStamp;
1815
1817
  if (e.pointerType !== "pen") return p;
1816
- const o = _chunkGNZI3KYKcjs.penOrientation.call(void 0, {
1818
+ const o = _chunkNKTNLJUJcjs.penOrientation.call(void 0, {
1817
1819
  x,
1818
1820
  y,
1819
1821
  altitude: typeof e.altitudeAngle === "number" ? e.altitudeAngle : void 0,
@@ -1892,7 +1894,7 @@ function wetPaperInput(paper) {
1892
1894
  absorption: paper.absorption,
1893
1895
  permeability: paper.permeability,
1894
1896
  roughness: flat ? 0 : paper.roughness,
1895
- color: _chunkGNZI3KYKcjs.hexToRgb8.call(void 0, paper.color),
1897
+ color: _chunkNKTNLJUJcjs.hexToRgb8.call(void 0, paper.color),
1896
1898
  heightAt: flat ? () => 0.5 : (x, y) => grain.at(x, y)
1897
1899
  };
1898
1900
  }
@@ -1900,8 +1902,8 @@ var WetStrokeDriver = (_class5 = class {
1900
1902
  constructor(init) {;_class5.prototype.__init35.call(this);_class5.prototype.__init36.call(this);_class5.prototype.__init37.call(this);_class5.prototype.__init38.call(this);_class5.prototype.__init39.call(this);_class5.prototype.__init40.call(this);_class5.prototype.__init41.call(this);_class5.prototype.__init42.call(this);_class5.prototype.__init43.call(this);_class5.prototype.__init44.call(this);_class5.prototype.__init45.call(this);_class5.prototype.__init46.call(this);
1901
1903
  this.init = init;
1902
1904
  const brush = init.brush;
1903
- this.smoother = new (0, _chunkGNZI3KYKcjs.PenSmoother)(brush.tip.smoothing, brush.pressureSmoothing);
1904
- const copies = init.copies.length ? init.copies : [_chunkGNZI3KYKcjs.IDENTITY_COPY];
1905
+ this.smoother = new (0, _chunkNKTNLJUJcjs.PenSmoother)(brush.tip.smoothing, brush.pressureSmoothing);
1906
+ const copies = init.copies.length ? init.copies : [_chunkNKTNLJUJcjs.IDENTITY_COPY];
1905
1907
  const wet = brush.wet;
1906
1908
  const spacing = Math.max(0.02, brush.tip.spacing);
1907
1909
  const perDab = Math.min(1, spacing * 1.2);
@@ -1913,7 +1915,7 @@ var WetStrokeDriver = (_class5 = class {
1913
1915
  });
1914
1916
  const rates = _chunkPQ3H2AANcjs.exchangeRates.call(void 0, brush.behavior.pickup, brush.behavior.mix, wet.load, brush.behavior.mixing);
1915
1917
  this.states = copies.map((c, i) => ({
1916
- walker: new (0, _chunkGNZI3KYKcjs.PenDabWalker)(brush, init.seed + i * 7919 | 0, c.linear),
1918
+ walker: new (0, _chunkNKTNLJUJcjs.PenDabWalker)(brush, init.seed + i * 7919 | 0, c.linear),
1917
1919
  exchange: wet.tool === "paint" ? new (0, _chunkPQ3H2AANcjs.PaintExchange)(rates, init.load) : null,
1918
1920
  last: null
1919
1921
  }));
@@ -2524,7 +2526,7 @@ var PaintWetLayers = (_class6 = class {
2524
2526
  }
2525
2527
  }, _class6);
2526
2528
  function wetPigmentOf(hex, body) {
2527
- const [r, g, b] = _chunkGNZI3KYKcjs.hexToRgb8.call(void 0, hex);
2529
+ const [r, g, b] = _chunkNKTNLJUJcjs.hexToRgb8.call(void 0, hex);
2528
2530
  return Array.from(_chunkXFYLA3ZOcjs.pigmentOf.call(void 0, [r / 255, g / 255, b / 255], body));
2529
2531
  }
2530
2532
 
@@ -2538,7 +2540,7 @@ function paintWetTestStroke(brush, paper, color, width, height) {
2538
2540
  const w = thumbWorld;
2539
2541
  if (w.hasLane("thumb")) w.removeLane("thumb");
2540
2542
  w.ensureLane("thumb");
2541
- const [r, g, b] = _chunkGNZI3KYKcjs.hexToRgb8.call(void 0, color);
2543
+ const [r, g, b] = _chunkNKTNLJUJcjs.hexToRgb8.call(void 0, color);
2542
2544
  if (brush.wet.tool !== "paint" && brush.wet.tool !== "water") {
2543
2545
  const half = Math.ceil(height / 2);
2544
2546
  w.paint("thumb", { x: 0, y: 0, width, height: half }, null, 0.4, Array.from(_chunkXFYLA3ZOcjs.pigmentOf.call(void 0, [r / 255, g / 255, b / 255], 0), (v) => v * 0.05));
@@ -2552,9 +2554,9 @@ function paintWetTestStroke(brush, paper, color, width, height) {
2552
2554
  load: brushLoadForStroke(brush, _chunkPQ3H2AANcjs.EMPTY_MIXER_LOAD, [r / 255, g / 255, b / 255]),
2553
2555
  grain: paperGrain(paper),
2554
2556
  paperDepth: paper.depth,
2555
- paperColor: _chunkGNZI3KYKcjs.hexToRgb8.call(void 0, paper.color),
2557
+ paperColor: _chunkNKTNLJUJcjs.hexToRgb8.call(void 0, paper.color),
2556
2558
  seed: 7,
2557
- copies: [_chunkGNZI3KYKcjs.IDENTITY_COPY]
2559
+ copies: [_chunkNKTNLJUJcjs.IDENTITY_COPY]
2558
2560
  });
2559
2561
  driver.push(thumbnailStroke(width, height));
2560
2562
  driver.finish();
@@ -2574,7 +2576,7 @@ function thumbnailStroke(width, height) {
2574
2576
  return pts;
2575
2577
  }
2576
2578
  function paintTestStroke(surface, brush, paper, color, width, height) {
2577
- const [r, g, b] = _chunkGNZI3KYKcjs.hexToRgb8.call(void 0, color);
2579
+ const [r, g, b] = _chunkNKTNLJUJcjs.hexToRgb8.call(void 0, color);
2578
2580
  let result = surface;
2579
2581
  let thick = null;
2580
2582
  const session = new PaintStrokeSession(
@@ -2593,13 +2595,13 @@ function paintTestStroke(surface, brush, paper, color, width, height) {
2593
2595
  lockTransparency: false,
2594
2596
  brush,
2595
2597
  color: [r, g, b, 255],
2596
- background: [..._chunkGNZI3KYKcjs.hexToRgb8.call(void 0, paper.color), 255],
2598
+ background: [..._chunkNKTNLJUJcjs.hexToRgb8.call(void 0, paper.color), 255],
2597
2599
  grain: paperGrain(paper),
2598
2600
  paperDepth: paper.depth,
2599
2601
  seed: 7,
2600
2602
  colorHex: color,
2601
2603
  affineCopies: [],
2602
- copies: [_chunkGNZI3KYKcjs.IDENTITY_COPY],
2604
+ copies: [_chunkNKTNLJUJcjs.IDENTITY_COPY],
2603
2605
  mixerLoad: brushLoadForStroke(brush, _chunkPQ3H2AANcjs.EMPTY_MIXER_LOAD, [r / 255, g / 255, b / 255]),
2604
2606
  thick: brush.engine === "impasto" ? { channels: emptyThickChannels() } : void 0,
2605
2607
  sticker: brush.engine === "sticker" ? { nextId: 1 } : void 0
@@ -2613,8 +2615,8 @@ function renderBrushThumbnail(brush, options) {
2613
2615
  const width = Math.max(16, Math.min(512, Math.round(_nullishCoalesce(options.width, () => ( 160)))));
2614
2616
  const height = Math.max(16, Math.min(512, Math.round(_nullishCoalesce(options.height, () => ( 48)))));
2615
2617
  const maxSize = height * 0.42;
2616
- const b = brush.tip.size > maxSize ? _chunkGNZI3KYKcjs.normalizePaintBrush.call(void 0, { tip: { ...brush.tip, size: maxSize } }, brush) : brush;
2617
- const rgba = [..._chunkGNZI3KYKcjs.hexToRgb8.call(void 0, options.color), 255];
2618
+ const b = brush.tip.size > maxSize ? _chunkNKTNLJUJcjs.normalizePaintBrush.call(void 0, { tip: { ...brush.tip, size: maxSize } }, brush) : brush;
2619
+ const rgba = [..._chunkNKTNLJUJcjs.hexToRgb8.call(void 0, options.color), 255];
2618
2620
  let surface = _chunk474IQG74cjs.emptySurface.call(void 0, 4);
2619
2621
  if (b.engine === "eraser") {
2620
2622
  surface = _chunk474IQG74cjs.fillRect.call(void 0, surface, { x: 0, y: 0, width, height }, rgba);
@@ -2861,7 +2863,7 @@ function hslToRgb(h, s, l) {
2861
2863
  return hsvToRgb(h, v === 0 ? 0 : c / v, v);
2862
2864
  }
2863
2865
  function colorHarmony2(base, kind, options = {}) {
2864
- return _chunkEUIDTZNQcjs.colorHarmony.call(void 0, base, kind, options);
2866
+ return _chunk7PT4RJL5cjs.colorHarmony.call(void 0, base, kind, options);
2865
2867
  }
2866
2868
  function readSwatch(raw) {
2867
2869
  if (!raw || typeof raw !== "object") return null;
@@ -2890,7 +2892,7 @@ var DEFAULT_SWATCHES = [
2890
2892
  // src/paint-editor/mixing-pad.ts
2891
2893
  var MIXING_PAD_WIDTH = 360;
2892
2894
  var MIXING_PAD_HEIGHT = 220;
2893
- var PAD_PAINT = _chunkGNZI3KYKcjs.normalizePaintBrush.call(void 0, {
2895
+ var PAD_PAINT = _chunkNKTNLJUJcjs.normalizePaintBrush.call(void 0, {
2894
2896
  id: "pad-paint",
2895
2897
  name: "Pad paint",
2896
2898
  category: "mixer",
@@ -2898,7 +2900,7 @@ var PAD_PAINT = _chunkGNZI3KYKcjs.normalizePaintBrush.call(void 0, {
2898
2900
  tip: { size: 28, hardness: 0.75, spacing: 0.1, opacity: 1, flow: 0.7, pressureSize: false, pressureOpacity: false },
2899
2901
  mixer: { wet: 0.45, load: 1, mix: 0.4, loadEachStroke: true, cleanEachStroke: true, mixing: "pigment" }
2900
2902
  });
2901
- var PAD_KNIFE = _chunkGNZI3KYKcjs.normalizePaintBrush.call(void 0, {
2903
+ var PAD_KNIFE = _chunkNKTNLJUJcjs.normalizePaintBrush.call(void 0, {
2902
2904
  id: "pad-knife",
2903
2905
  name: "Palette knife",
2904
2906
  category: "smudge",
@@ -2908,7 +2910,7 @@ var PAD_KNIFE = _chunkGNZI3KYKcjs.normalizePaintBrush.call(void 0, {
2908
2910
  // A knife drags streaks of paint and folds them into each other, mixing them as pigment.
2909
2911
  smudge: { strength: 0.6, length: 0.8, mixing: "pigment" }
2910
2912
  });
2911
- var PAD_BLOB = _chunkGNZI3KYKcjs.normalizePaintBrush.call(void 0, {
2913
+ var PAD_BLOB = _chunkNKTNLJUJcjs.normalizePaintBrush.call(void 0, {
2912
2914
  id: "pad-blob",
2913
2915
  name: "Pad blob",
2914
2916
  category: "custom",
@@ -2930,12 +2932,12 @@ var MixingPad = (_class8 = class {constructor() { _class8.prototype.__init65.cal
2930
2932
  }
2931
2933
  }
2932
2934
  let brush = options.tool === "knife" ? PAD_KNIFE : PAD_PAINT;
2933
- if (options.size !== void 0) brush = _chunkGNZI3KYKcjs.normalizePaintBrush.call(void 0, { tip: { ...brush.tip, size: options.size } }, brush);
2935
+ if (options.size !== void 0) brush = _chunkNKTNLJUJcjs.normalizePaintBrush.call(void 0, { tip: { ...brush.tip, size: options.size } }, brush);
2934
2936
  return this.run(brush, points, options.color);
2935
2937
  }
2936
2938
  /** Paints `points` with `brush` in `color` on the pad. */
2937
2939
  run(brush, points, color) {
2938
- const [r, g, b] = _chunkGNZI3KYKcjs.hexToRgb8.call(void 0, color);
2940
+ const [r, g, b] = _chunkNKTNLJUJcjs.hexToRgb8.call(void 0, color);
2939
2941
  let result = null;
2940
2942
  const session = new PaintStrokeSession(
2941
2943
  { update: () => {
@@ -2953,7 +2955,7 @@ var MixingPad = (_class8 = class {constructor() { _class8.prototype.__init65.cal
2953
2955
  seed: 1,
2954
2956
  colorHex: color,
2955
2957
  affineCopies: [],
2956
- copies: [_chunkGNZI3KYKcjs.IDENTITY_COPY],
2958
+ copies: [_chunkNKTNLJUJcjs.IDENTITY_COPY],
2957
2959
  mixerLoad: brushLoadForStroke(brush, _chunkPQ3H2AANcjs.EMPTY_MIXER_LOAD, [r / 255, g / 255, b / 255])
2958
2960
  }
2959
2961
  );
@@ -3029,10 +3031,10 @@ var MixingPad = (_class8 = class {constructor() { _class8.prototype.__init65.cal
3029
3031
  const off = used.length === 1 ? 0 : 0.45 * R;
3030
3032
  const x = Math.min(cx + R - r, Math.max(cx - R + r, cx + Math.cos(a) * off));
3031
3033
  const y = Math.min(cy + R - r, Math.max(cy - R + r, cy + Math.sin(a) * off));
3032
- const blob = _chunkGNZI3KYKcjs.normalizePaintBrush.call(void 0, { tip: { ...PAD_BLOB.tip, size: Math.max(2, 2 * r) } }, PAD_BLOB);
3034
+ const blob = _chunkNKTNLJUJcjs.normalizePaintBrush.call(void 0, { tip: { ...PAD_BLOB.tip, size: Math.max(2, 2 * r) } }, PAD_BLOB);
3033
3035
  this.run(blob, [{ x, y }], p.color.toLowerCase());
3034
3036
  });
3035
- const knife = _chunkGNZI3KYKcjs.normalizePaintBrush.call(void 0, { tip: { ...PAD_KNIFE.tip, size: Math.max(12, R * 0.5) } }, PAD_KNIFE);
3037
+ const knife = _chunkNKTNLJUJcjs.normalizePaintBrush.call(void 0, { tip: { ...PAD_KNIFE.tip, size: Math.max(12, R * 0.5) } }, PAD_KNIFE);
3036
3038
  for (let k = 0; k < passes; k++) {
3037
3039
  const stir = [];
3038
3040
  const turns = 1.6;
@@ -3044,10 +3046,10 @@ var MixingPad = (_class8 = class {constructor() { _class8.prototype.__init65.cal
3044
3046
  this.run(knife, stir, "#000000");
3045
3047
  }
3046
3048
  const mixed = _chunkOLNIPTB3cjs.mixPigments.call(void 0,
3047
- paints.map((p) => _chunkGNZI3KYKcjs.hexToRgb8.call(void 0, p.color).map((v) => v / 255)),
3049
+ paints.map((p) => _chunkNKTNLJUJcjs.hexToRgb8.call(void 0, p.color).map((v) => v / 255)),
3048
3050
  paints.map((p) => p.parts)
3049
3051
  );
3050
- const core = _chunkGNZI3KYKcjs.normalizePaintBrush.call(void 0, { tip: { ...PAD_BLOB.tip, size: R * 1.1, hardness: 0.55 } }, PAD_BLOB);
3052
+ const core = _chunkNKTNLJUJcjs.normalizePaintBrush.call(void 0, { tip: { ...PAD_BLOB.tip, size: R * 1.1, hardness: 0.55 } }, PAD_BLOB);
3051
3053
  const hex = "#" + mixed.map((v) => Math.round(v * 255).toString(16).padStart(2, "0")).join("");
3052
3054
  this.run(core, [{ x: cx, y: cy }], hex);
3053
3055
  return { color: this.pick(cx, cy, 2), bounds };
@@ -3404,12 +3406,13 @@ var PaintEditorError = class extends Error {
3404
3406
  }
3405
3407
  };
3406
3408
  var HEX2 = /^#[0-9a-f]{6}$/i;
3409
+ var MAX_ADD_STICKERS = 500;
3407
3410
  function parseColor(value, what = "color") {
3408
3411
  if (typeof value !== "string" || !HEX2.test(value.trim())) throw new PaintEditorError(`${what} is ${JSON.stringify(value)}; use #rrggbb, e.g. "#2a4b8d".`);
3409
3412
  return value.trim().toLowerCase();
3410
3413
  }
3411
3414
  function rgbaOf(hex) {
3412
- const [r, g, b] = _chunkGNZI3KYKcjs.hexToRgb8.call(void 0, hex);
3415
+ const [r, g, b] = _chunkNKTNLJUJcjs.hexToRgb8.call(void 0, hex);
3413
3416
  return [r, g, b, 255];
3414
3417
  }
3415
3418
  function rgbToHex(r, g, b) {
@@ -3447,47 +3450,50 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
3447
3450
  __init82() {this.mixerLoad = _chunkPQ3H2AANcjs.EMPTY_MIXER_LOAD}
3448
3451
  __init83() {this.view = { ...DEFAULT_VIEW, pan: { ...DEFAULT_VIEW.pan } }}
3449
3452
 
3453
+ __init84() {this.selectedSticker = null}
3454
+ /** A sticker drag in progress (`previewSticker`): the document before it, so the drop undoes in one step, and the one it showed last. */
3455
+ __init85() {this.stickerPreview = null}
3450
3456
 
3451
- __init84() {this.listeners = /* @__PURE__ */ new Set()}
3452
- __init85() {this.version = 0}
3453
- __init86() {this.cached = null}
3454
- __init87() {this.session = null}
3455
- __init88() {this.live = null}
3456
- __init89() {this.liveLayers = null}
3457
- __init90() {this.dirty = "all"}
3458
- __init91() {this.seedCounter = 1}
3459
- __init92() {this.strokeCounter = 1}
3457
+ __init86() {this.listeners = /* @__PURE__ */ new Set()}
3458
+ __init87() {this.version = 0}
3459
+ __init88() {this.cached = null}
3460
+ __init89() {this.session = null}
3461
+ __init90() {this.live = null}
3462
+ __init91() {this.liveLayers = null}
3463
+ __init92() {this.dirty = "all"}
3464
+ __init93() {this.seedCounter = 1}
3465
+ __init94() {this.strokeCounter = 1}
3460
3466
 
3461
- __init93() {this.swatches = DEFAULT_SWATCHES.map((s) => ({ ...s }))}
3462
- __init94() {this.pad = new MixingPad()}
3463
- __init95() {this.savedPads = []}
3464
- __init96() {this.nextPadId = 1}
3465
- __init97() {this.tracingVersion = 1}
3466
- __init98() {this.tracingCache = null}
3467
- __init99() {this.imagePixels = /* @__PURE__ */ new Map()}
3468
- __init100() {this.nextReferenceId = 1}
3469
- __init101() {this.viewCompositor = createPaintCompositor()}
3470
- __init102() {this.exportCompositor = createPaintCompositor()}
3467
+ __init95() {this.swatches = DEFAULT_SWATCHES.map((s) => ({ ...s }))}
3468
+ __init96() {this.pad = new MixingPad()}
3469
+ __init97() {this.savedPads = []}
3470
+ __init98() {this.nextPadId = 1}
3471
+ __init99() {this.tracingVersion = 1}
3472
+ __init100() {this.tracingCache = null}
3473
+ __init101() {this.imagePixels = /* @__PURE__ */ new Map()}
3474
+ __init102() {this.nextReferenceId = 1}
3475
+ __init103() {this.viewCompositor = createPaintCompositor()}
3476
+ __init104() {this.exportCompositor = createPaintCompositor()}
3471
3477
  /** Wet media: the simulation, its settings and time. */
3472
3478
 
3473
3479
 
3474
3480
  /** Where the light comes from for thick paint (saved with the document, not undo steps). */
3475
- __init103() {this.lighting = { ...DEFAULT_LIGHTING }}
3476
- __init104() {this.litCaches = /* @__PURE__ */ new Map()}
3481
+ __init105() {this.lighting = { ...DEFAULT_LIGHTING }}
3482
+ __init106() {this.litCaches = /* @__PURE__ */ new Map()}
3477
3483
  /** The live impasto stroke's channels. */
3478
- __init105() {this.liveThick = null}
3484
+ __init107() {this.liveThick = null}
3479
3485
  /** Set while an operation that changes wet paint runs: the simulation before it (for undo). */
3480
- __init106() {this.wetOp = null}
3486
+ __init108() {this.wetOp = null}
3481
3487
  /** The effects provider slot (see `setEffectsProvider`). */
3482
- __init107() {this.effects = new (0, _chunkJAOSL334cjs.EffectsSlot)()}
3483
- __init108() {this.effectsRenderer = new PaintEffectsRenderer()}
3484
- __init109() {this.paperEffectNodeCache = null}
3485
- constructor(options = {}) {;_class10.prototype.__init72.call(this);_class10.prototype.__init73.call(this);_class10.prototype.__init74.call(this);_class10.prototype.__init75.call(this);_class10.prototype.__init76.call(this);_class10.prototype.__init77.call(this);_class10.prototype.__init78.call(this);_class10.prototype.__init79.call(this);_class10.prototype.__init80.call(this);_class10.prototype.__init81.call(this);_class10.prototype.__init82.call(this);_class10.prototype.__init83.call(this);_class10.prototype.__init84.call(this);_class10.prototype.__init85.call(this);_class10.prototype.__init86.call(this);_class10.prototype.__init87.call(this);_class10.prototype.__init88.call(this);_class10.prototype.__init89.call(this);_class10.prototype.__init90.call(this);_class10.prototype.__init91.call(this);_class10.prototype.__init92.call(this);_class10.prototype.__init93.call(this);_class10.prototype.__init94.call(this);_class10.prototype.__init95.call(this);_class10.prototype.__init96.call(this);_class10.prototype.__init97.call(this);_class10.prototype.__init98.call(this);_class10.prototype.__init99.call(this);_class10.prototype.__init100.call(this);_class10.prototype.__init101.call(this);_class10.prototype.__init102.call(this);_class10.prototype.__init103.call(this);_class10.prototype.__init104.call(this);_class10.prototype.__init105.call(this);_class10.prototype.__init106.call(this);_class10.prototype.__init107.call(this);_class10.prototype.__init108.call(this);_class10.prototype.__init109.call(this);_class10.prototype.__init110.call(this);_class10.prototype.__init111.call(this);_class10.prototype.__init112.call(this);_class10.prototype.__init113.call(this);
3488
+ __init109() {this.effects = new (0, _chunkJAOSL334cjs.EffectsSlot)()}
3489
+ __init110() {this.effectsRenderer = new PaintEffectsRenderer()}
3490
+ __init111() {this.paperEffectNodeCache = null}
3491
+ constructor(options = {}) {;_class10.prototype.__init72.call(this);_class10.prototype.__init73.call(this);_class10.prototype.__init74.call(this);_class10.prototype.__init75.call(this);_class10.prototype.__init76.call(this);_class10.prototype.__init77.call(this);_class10.prototype.__init78.call(this);_class10.prototype.__init79.call(this);_class10.prototype.__init80.call(this);_class10.prototype.__init81.call(this);_class10.prototype.__init82.call(this);_class10.prototype.__init83.call(this);_class10.prototype.__init84.call(this);_class10.prototype.__init85.call(this);_class10.prototype.__init86.call(this);_class10.prototype.__init87.call(this);_class10.prototype.__init88.call(this);_class10.prototype.__init89.call(this);_class10.prototype.__init90.call(this);_class10.prototype.__init91.call(this);_class10.prototype.__init92.call(this);_class10.prototype.__init93.call(this);_class10.prototype.__init94.call(this);_class10.prototype.__init95.call(this);_class10.prototype.__init96.call(this);_class10.prototype.__init97.call(this);_class10.prototype.__init98.call(this);_class10.prototype.__init99.call(this);_class10.prototype.__init100.call(this);_class10.prototype.__init101.call(this);_class10.prototype.__init102.call(this);_class10.prototype.__init103.call(this);_class10.prototype.__init104.call(this);_class10.prototype.__init105.call(this);_class10.prototype.__init106.call(this);_class10.prototype.__init107.call(this);_class10.prototype.__init108.call(this);_class10.prototype.__init109.call(this);_class10.prototype.__init110.call(this);_class10.prototype.__init111.call(this);_class10.prototype.__init112.call(this);_class10.prototype.__init113.call(this);_class10.prototype.__init114.call(this);_class10.prototype.__init115.call(this);
3486
3492
  this.historyLimit = Math.max(1, _nullishCoalesce(options.historyLimit, () => ( 200)));
3487
3493
  this.doc = createPaintDocument({ width: options.width, height: options.height, dpi: options.dpi, paper: this.resolvePaper(options.paper) });
3488
- this.userBrushes = (_nullishCoalesce(options.brushes, () => ( []))).map((b) => _chunkGNZI3KYKcjs.normalizePaintBrush.call(void 0, { ...b, builtin: false }));
3489
- const start = _nullishCoalesce(this.findBrush(_nullishCoalesce(options.brushId, () => ( _chunkGNZI3KYKcjs.DEFAULT_BRUSH_ID))), () => ( this.findBrush(_chunkGNZI3KYKcjs.DEFAULT_BRUSH_ID)));
3490
- this.brush = _chunkGNZI3KYKcjs.normalizePaintBrush.call(void 0, start);
3494
+ this.userBrushes = (_nullishCoalesce(options.brushes, () => ( []))).map((b) => _chunkNKTNLJUJcjs.normalizePaintBrush.call(void 0, { ...b, builtin: false }));
3495
+ const start = _nullishCoalesce(this.findBrush(_nullishCoalesce(options.brushId, () => ( _chunkNKTNLJUJcjs.DEFAULT_BRUSH_ID))), () => ( this.findBrush(_chunkNKTNLJUJcjs.DEFAULT_BRUSH_ID)));
3496
+ this.brush = _chunkNKTNLJUJcjs.normalizePaintBrush.call(void 0, start);
3491
3497
  this.color = options.color ? parseColor(options.color) : "#1f2937";
3492
3498
  this.hand = options.hand === "left" ? "left" : "right";
3493
3499
  this.encodeImage = options.encodeImage;
@@ -3534,7 +3540,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
3534
3540
  this.cached = {
3535
3541
  document: this.doc,
3536
3542
  brush: this.brush,
3537
- brushes: this.library ??= [..._chunkGNZI3KYKcjs.BUILTIN_BRUSHES, ...this.userBrushes],
3543
+ brushes: this.library ??= [..._chunkNKTNLJUJcjs.BUILTIN_BRUSHES, ...this.userBrushes],
3538
3544
  color: this.color,
3539
3545
  secondaryColor: this.secondaryColor,
3540
3546
  paint: _nullishCoalesce(this.gradient, () => ( { type: "color", color: this.color })),
@@ -3543,6 +3549,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
3543
3549
  mixerLoad: this.mixerLoad,
3544
3550
  view: this.view,
3545
3551
  hand: this.hand,
3552
+ selectedSticker: this.selectedSticker,
3546
3553
  canUndo: this.undoStack.length > 0 && !this.session,
3547
3554
  canRedo: this.redoStack.length > 0 && !this.session,
3548
3555
  undoLabel: _nullishCoalesce(_optionalChain([last, 'optionalAccess', _179 => _179.label]), () => ( null)),
@@ -3581,7 +3588,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
3581
3588
  return d;
3582
3589
  }
3583
3590
  // --- History -------------------------------------------------------------------
3584
- __init110() {this.docRevision = 0}
3591
+ __init112() {this.docRevision = 0}
3585
3592
  /**
3586
3593
  * Bumped on every change to the painting (a committed or amended step, undo, redo, opening a
3587
3594
  * document), not on wet-paint frames or view changes. `createPaintEditorDocument` uses it.
@@ -3664,7 +3671,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
3664
3671
  return wetIds;
3665
3672
  }
3666
3673
  /** Records a wet event (for replays) in the document being built. */
3667
- __init111() {this.pendingWetEvents = []}
3674
+ __init113() {this.pendingWetEvents = []}
3668
3675
  logWet(e) {
3669
3676
  this.pendingWetEvents.push({ clock: _nullishCoalesce(_optionalChain([this, 'access', _187 => _187.wet, 'access', _188 => _188.world, 'optionalAccess', _189 => _189.clock]), () => ( 0)), at: this.doc.strokes.length, ...e });
3670
3677
  }
@@ -3727,7 +3734,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
3727
3734
  // --- Canvas and paper ----------------------------------------------------------
3728
3735
  resolvePaper(paper) {
3729
3736
  if (typeof paper === "string") {
3730
- const p = _chunkGNZI3KYKcjs.paperPreset.call(void 0, paper);
3737
+ const p = _chunkNKTNLJUJcjs.paperPreset.call(void 0, paper);
3731
3738
  if (!p) throw new PaintEditorError(`Unknown paper "${paper}". Call list_papers for the ids.`);
3732
3739
  return p;
3733
3740
  }
@@ -3838,19 +3845,19 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
3838
3845
  this.requireIdle("changing the paper");
3839
3846
  let base = this.doc.paper;
3840
3847
  if (update.preset !== void 0 && update.preset !== this.doc.paper.preset) {
3841
- const p = _chunkGNZI3KYKcjs.paperPreset.call(void 0, update.preset);
3848
+ const p = _chunkNKTNLJUJcjs.paperPreset.call(void 0, update.preset);
3842
3849
  if (!p) throw new PaintEditorError(`Unknown paper "${update.preset}". Call list_papers for the ids.`);
3843
3850
  base = p;
3844
3851
  }
3845
3852
  const { preset: _p, ...rest } = update;
3846
3853
  if (rest.color !== void 0) parseColor(rest.color, "paper color");
3847
- const paper = _chunkGNZI3KYKcjs.normalizePaper.call(void 0, { ...rest, preset: base.preset, offset: _nullishCoalesce(rest.offset, () => ( this.doc.paper.offset)) }, base);
3854
+ const paper = _chunkNKTNLJUJcjs.normalizePaper.call(void 0, { ...rest, preset: base.preset, offset: _nullishCoalesce(rest.offset, () => ( this.doc.paper.offset)) }, base);
3848
3855
  const changedKeys = Object.keys(rest).filter((k) => k !== "name");
3849
3856
  if (changedKeys.length && update.preset === void 0) paper.preset = base.preset;
3850
3857
  if (this.wet.world) this.beginWetOp();
3851
3858
  this.commit("Paper", { ...this.doc, paper });
3852
3859
  this.wet.paperChanged();
3853
- return _chunkGNZI3KYKcjs.clonePaper.call(void 0, paper);
3860
+ return _chunkNKTNLJUJcjs.clonePaper.call(void 0, paper);
3854
3861
  }
3855
3862
  // --- Layers --------------------------------------------------------------------
3856
3863
  getLayer(id) {
@@ -4367,7 +4374,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4367
4374
  }
4368
4375
  /** The rendered pixels of an effect paint at the current canvas size, or `null` when it has not been rendered. */
4369
4376
  effectPaintImage(p) {
4370
- const key = _chunkGNZI3KYKcjs.effectPaintKey.call(void 0, p);
4377
+ const key = _chunkNKTNLJUJcjs.effectPaintKey.call(void 0, p);
4371
4378
  const img = this.effectPaintPixels.get(key);
4372
4379
  if (!img || img.width !== this.doc.canvas.width || img.height !== this.doc.canvas.height) return null;
4373
4380
  this.effectPaintPixels.delete(key);
@@ -4390,7 +4397,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4390
4397
  throw new PaintEditorError(`Effect paint could not render ${what}: ${e instanceof Error ? e.message : String(e)}`);
4391
4398
  }
4392
4399
  const img = { width, height, data: new Uint8ClampedArray(pixels.data) };
4393
- this.effectPaintPixels.set(_chunkGNZI3KYKcjs.effectPaintKey.call(void 0, p), img);
4400
+ this.effectPaintPixels.set(_chunkNKTNLJUJcjs.effectPaintKey.call(void 0, p), img);
4394
4401
  while (this.effectPaintPixels.size > _PaintEditorController.EFFECT_PAINT_CACHE) this.effectPaintPixels.delete(this.effectPaintPixels.keys().next().value);
4395
4402
  return img;
4396
4403
  }
@@ -4401,7 +4408,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4401
4408
  async prepareEffectPaints(paints) {
4402
4409
  const seen = /* @__PURE__ */ new Set();
4403
4410
  for (const p of paints) {
4404
- const key = _chunkGNZI3KYKcjs.effectPaintKey.call(void 0, p);
4411
+ const key = _chunkNKTNLJUJcjs.effectPaintKey.call(void 0, p);
4405
4412
  if (seen.has(key)) continue;
4406
4413
  seen.add(key);
4407
4414
  await this.renderEffectPaint(p);
@@ -4439,11 +4446,11 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4439
4446
  * its pixels are not rendered.
4440
4447
  */
4441
4448
  strokeEffect(init, brush) {
4442
- if (!_chunkGNZI3KYKcjs.brushTakesPaint.call(void 0, brush)) return null;
4449
+ if (!_chunkNKTNLJUJcjs.brushTakesPaint.call(void 0, brush)) return null;
4443
4450
  let source = null;
4444
4451
  if (init.paint !== void 0) {
4445
- if (!_chunkGNZI3KYKcjs.isPaintEffectPaint.call(void 0, init.paint)) return null;
4446
- source = _chunkGNZI3KYKcjs.readPaintEffectPaint.call(void 0, init.paint);
4452
+ if (!_chunkNKTNLJUJcjs.isPaintEffectPaint.call(void 0, init.paint)) return null;
4453
+ source = _chunkNKTNLJUJcjs.readPaintEffectPaint.call(void 0, init.paint);
4447
4454
  if (!source) throw new PaintEditorError("The stroke's effect paint needs an effect id and values (getEffectPaint returns one).");
4448
4455
  } else if (init.color === void 0 && !brush.paint) {
4449
4456
  if (this.effectPaintPending) throw new PaintEditorError(`The effect paint "${this.effectPaintPending.effect}" is still rendering; wait for set_effect_paint to finish, then paint.`);
@@ -4498,12 +4505,12 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4498
4505
  }
4499
4506
  // --- Brushes -------------------------------------------------------------------
4500
4507
  findBrush(id) {
4501
- return _nullishCoalesce(_chunkGNZI3KYKcjs.BUILTIN_BRUSHES.find((b) => b.id === id), () => ( this.userBrushes.find((b) => b.id === id)));
4508
+ return _nullishCoalesce(_chunkNKTNLJUJcjs.BUILTIN_BRUSHES.find((b) => b.id === id), () => ( this.userBrushes.find((b) => b.id === id)));
4502
4509
  }
4503
4510
  /** A library brush by id (`undefined` when unknown). */
4504
4511
  getBrush(id) {
4505
4512
  const b = this.findBrush(id);
4506
- return b ? _chunkGNZI3KYKcjs.normalizePaintBrush.call(void 0, b, b) : void 0;
4513
+ return b ? _chunkNKTNLJUJcjs.normalizePaintBrush.call(void 0, b, b) : void 0;
4507
4514
  }
4508
4515
  requireBrush(id) {
4509
4516
  const b = this.findBrush(id);
@@ -4518,7 +4525,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4518
4525
  const { id, ...changes } = update;
4519
4526
  const base = id !== void 0 ? this.requireBrush(id) : this.brush;
4520
4527
  if (changes.paint !== void 0 && changes.paint !== null) this.readStrokePaint(changes.paint);
4521
- const next = _chunkGNZI3KYKcjs.normalizePaintBrush.call(void 0, { ...changes, id: base.id }, base);
4528
+ const next = _chunkNKTNLJUJcjs.normalizePaintBrush.call(void 0, { ...changes, id: base.id }, base);
4522
4529
  if (base.builtin && !Object.keys(changes).length) next.builtin = true;
4523
4530
  else delete next.builtin;
4524
4531
  this.brush = next;
@@ -4527,10 +4534,10 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4527
4534
  }
4528
4535
  /** Saves the active brush (or `brush`) into the user library under `id` / `name`. */
4529
4536
  saveBrush(options) {
4530
- if (!_chunkGNZI3KYKcjs.BRUSH_ID.test(options.id)) throw new PaintEditorError(`Brush id "${options.id}" is invalid; use lowercase letters, digits and dashes (e.g. "my-pencil").`);
4531
- if (_chunkGNZI3KYKcjs.BUILTIN_BRUSHES.some((b) => b.id === options.id)) throw new PaintEditorError(`"${options.id}" is a built-in brush; save under another id.`);
4532
- const source = options.brush ? _chunkGNZI3KYKcjs.normalizePaintBrush.call(void 0, options.brush, this.brush) : this.brush;
4533
- const saved = _chunkGNZI3KYKcjs.normalizePaintBrush.call(void 0, { ...source, id: options.id, name: _nullishCoalesce(options.name, () => ( source.name)) });
4537
+ if (!_chunkNKTNLJUJcjs.BRUSH_ID.test(options.id)) throw new PaintEditorError(`Brush id "${options.id}" is invalid; use lowercase letters, digits and dashes (e.g. "my-pencil").`);
4538
+ if (_chunkNKTNLJUJcjs.BUILTIN_BRUSHES.some((b) => b.id === options.id)) throw new PaintEditorError(`"${options.id}" is a built-in brush; save under another id.`);
4539
+ const source = options.brush ? _chunkNKTNLJUJcjs.normalizePaintBrush.call(void 0, options.brush, this.brush) : this.brush;
4540
+ const saved = _chunkNKTNLJUJcjs.normalizePaintBrush.call(void 0, { ...source, id: options.id, name: _nullishCoalesce(options.name, () => ( source.name)) });
4534
4541
  delete saved.builtin;
4535
4542
  const i = this.userBrushes.findIndex((b) => b.id === options.id);
4536
4543
  if (i >= 0) this.userBrushes[i] = saved;
@@ -4540,7 +4547,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4540
4547
  return saved;
4541
4548
  }
4542
4549
  removeBrush(id) {
4543
- if (_chunkGNZI3KYKcjs.BUILTIN_BRUSHES.some((b) => b.id === id)) throw new PaintEditorError(`"${id}" is a built-in brush and cannot be removed.`);
4550
+ if (_chunkNKTNLJUJcjs.BUILTIN_BRUSHES.some((b) => b.id === id)) throw new PaintEditorError(`"${id}" is a built-in brush and cannot be removed.`);
4544
4551
  const i = this.userBrushes.findIndex((b) => b.id === id);
4545
4552
  if (i < 0) throw new PaintEditorError(`Unknown brush "${id}". Call list_brushes for the ids.`);
4546
4553
  this.userBrushes.splice(i, 1);
@@ -4549,12 +4556,12 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4549
4556
  }
4550
4557
  /** The user's saved brushes. */
4551
4558
  getUserBrushes() {
4552
- return this.userBrushes.map((b) => _chunkGNZI3KYKcjs.normalizePaintBrush.call(void 0, b, b));
4559
+ return this.userBrushes.map((b) => _chunkNKTNLJUJcjs.normalizePaintBrush.call(void 0, b, b));
4553
4560
  }
4554
4561
  /** A brush library file of the given brushes (default: the user's brushes). */
4555
4562
  exportBrushes(ids) {
4556
4563
  const list = ids ? ids.map((id) => this.requireBrush(id)) : this.userBrushes;
4557
- return { format: "pixerate-brushes", version: 1, brushes: list.map(_chunkGNZI3KYKcjs.brushToJSON) };
4564
+ return { format: "pixerate-brushes", version: 1, brushes: list.map(_chunkNKTNLJUJcjs.brushToJSON) };
4558
4565
  }
4559
4566
  /**
4560
4567
  * Adds the brushes of a library file to the user library. A brush whose id is taken is skipped
@@ -4564,14 +4571,14 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4564
4571
  const problems = [];
4565
4572
  let list;
4566
4573
  try {
4567
- list = _chunkGNZI3KYKcjs.parseBrushLibrary.call(void 0, file, problems);
4574
+ list = _chunkNKTNLJUJcjs.parseBrushLibrary.call(void 0, file, problems);
4568
4575
  } catch (e) {
4569
4576
  throw new PaintEditorError(e.message);
4570
4577
  }
4571
4578
  const added = [];
4572
4579
  const skipped = [];
4573
4580
  for (const b of list) {
4574
- if (_chunkGNZI3KYKcjs.BUILTIN_BRUSHES.some((x) => x.id === b.id)) {
4581
+ if (_chunkNKTNLJUJcjs.BUILTIN_BRUSHES.some((x) => x.id === b.id)) {
4575
4582
  skipped.push(b.id);
4576
4583
  problems.push(`"${b.id}" is a built-in brush id; rename it to import it.`);
4577
4584
  continue;
@@ -4636,10 +4643,10 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4636
4643
  * brush's gradient, else the editor's gradient paint. Erasers, blenders and smudges take none.
4637
4644
  */
4638
4645
  strokeGradient(init, brush, color) {
4639
- if (!_chunkGNZI3KYKcjs.brushTakesPaint.call(void 0, brush)) return null;
4646
+ if (!_chunkNKTNLJUJcjs.brushTakesPaint.call(void 0, brush)) return null;
4640
4647
  let g = null;
4641
4648
  if (init.paint !== void 0) {
4642
- if (_chunkGNZI3KYKcjs.isPaintEffectPaint.call(void 0, init.paint)) return null;
4649
+ if (_chunkNKTNLJUJcjs.isPaintEffectPaint.call(void 0, init.paint)) return null;
4643
4650
  const p = this.readStrokePaint(init.paint);
4644
4651
  g = p.type === "gradient" ? p : null;
4645
4652
  } else g = _nullishCoalesce(brush.paint, () => ( (init.color === void 0 ? this.gradient : null)));
@@ -4683,7 +4690,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4683
4690
  // --- Mixer Brush ---------------------------------------------------------------
4684
4691
  /** Fills the Mixer Brush reservoir with a colour (default the editor colour). */
4685
4692
  loadMixerBrush(color) {
4686
- const [r, g, b] = _chunkGNZI3KYKcjs.hexToRgb8.call(void 0, color === void 0 ? this.color : parseColor(color));
4693
+ const [r, g, b] = _chunkNKTNLJUJcjs.hexToRgb8.call(void 0, color === void 0 ? this.color : parseColor(color));
4687
4694
  this.mixerLoad = _chunkPQ3H2AANcjs.loadMixer.call(void 0, this.mixerLoad, [r / 255, g / 255, b / 255]);
4688
4695
  this.emit([]);
4689
4696
  return this.mixerLoad;
@@ -4713,7 +4720,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4713
4720
  // --- Strokes -------------------------------------------------------------------
4714
4721
  strokeBrush(init) {
4715
4722
  let brush = init.brushId !== void 0 ? this.requireBrush(init.brushId) : this.brush;
4716
- if (init.brush) brush = _chunkGNZI3KYKcjs.normalizePaintBrush.call(void 0, { ...init.brush, id: brush.id }, brush);
4723
+ if (init.brush) brush = _chunkNKTNLJUJcjs.normalizePaintBrush.call(void 0, { ...init.brush, id: brush.id }, brush);
4717
4724
  return brush;
4718
4725
  }
4719
4726
  /**
@@ -4729,7 +4736,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4729
4736
  return symmetryCopies(this.guides.symmetry);
4730
4737
  }
4731
4738
  sessionFor(doc, init, host) {
4732
- if (init.paint !== void 0 && !_chunkGNZI3KYKcjs.isPaintEffectPaint.call(void 0, init.paint)) {
4739
+ if (init.paint !== void 0 && !_chunkNKTNLJUJcjs.isPaintEffectPaint.call(void 0, init.paint)) {
4733
4740
  const p = this.readStrokePaint(init.paint);
4734
4741
  if (p.type === "color") init = { ...init, color: p.color, paint: void 0 };
4735
4742
  else init = { ...init, paint: p };
@@ -4754,7 +4761,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4754
4761
  throw new PaintEditorError(`Layer "${layer.name}" is a sticker layer (its pixels are drawn from its stickers); paint on another layer (add_layer).`);
4755
4762
  }
4756
4763
  let wet;
4757
- if (_chunkGNZI3KYKcjs.isWetBrush.call(void 0, brush)) {
4764
+ if (_chunkNKTNLJUJcjs.isWetBrush.call(void 0, brush)) {
4758
4765
  this.requireWetIdle("painting");
4759
4766
  if (layer.offset.x || layer.offset.y) {
4760
4767
  const moved = { ...layer, surface: _chunk474IQG74cjs.translateSurface.call(void 0, layer.surface, layer.offset.x, layer.offset.y), offset: { x: 0, y: 0 } };
@@ -4769,7 +4776,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4769
4776
  const world = this.wet.ensureLane(layer.id, brush.wet.medium);
4770
4777
  const id = layer.id;
4771
4778
  const wetColor = init.color === void 0 ? this.color : parseColor(init.color);
4772
- const [r, g, b] = _chunkGNZI3KYKcjs.hexToRgb8.call(void 0, wetColor);
4779
+ const [r, g, b] = _chunkNKTNLJUJcjs.hexToRgb8.call(void 0, wetColor);
4773
4780
  const wetGradient = this.strokeGradient(init, brush, wetColor);
4774
4781
  const load = _nullishCoalesce(init.load, () => ( brushLoadForStroke(brush, this.mixerLoad, [r / 255, g / 255, b / 255])));
4775
4782
  const seedW = _nullishCoalesce(init.seed, () => ( _chunkPQ3H2AANcjs.mix32.call(void 0, this.seedCounter * 2654435761 >>> 0) & 2147483647));
@@ -4782,7 +4789,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4782
4789
  load,
4783
4790
  grain: paperGrain(doc.paper),
4784
4791
  paperDepth: doc.paper.depth,
4785
- paperColor: _chunkGNZI3KYKcjs.hexToRgb8.call(void 0, doc.paper.color),
4792
+ paperColor: _chunkNKTNLJUJcjs.hexToRgb8.call(void 0, doc.paper.color),
4786
4793
  seed: seedW,
4787
4794
  copies: [IDENTITY_AFFINE, ...copiesW].map(affineCopy),
4788
4795
  mask: init.maskStencils ? this.stencilSelection(init.maskStencils) : init.stencils !== false ? this.stencilSelection() : null,
@@ -4802,7 +4809,11 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4802
4809
  const snapper = init.snapToPerspective && perspective.enabled && perspective.snap ? new PerspectiveSnapper(perspective) : null;
4803
4810
  const useStencils = init.stencils !== false;
4804
4811
  const stencilSnapper = useStencils && this.guides.stencils.some((x) => x.enabled && x.mode === "guide") ? new StencilSnapper(this.guides.stencils) : null;
4805
- const selection = init.maskStencils ? this.stencilSelection(init.maskStencils) : useStencils ? this.stencilSelection() : null;
4812
+ if (brush.engine === "sticker" && !init.maskStencils && useStencils && this.stencilSelection()) {
4813
+ const masks = this.guides.stencils.filter((x) => x.enabled && x.mode === "mask").map((x) => x.id);
4814
+ throw new PaintEditorError(`Stickers can't be clipped by mask stencils (${masks.join(", ")}): they are objects drawn whole. Hide them (update_stencil enabled false) to spray stickers, or erase stickers you don't want (remove_stickers).`);
4815
+ }
4816
+ const selection = brush.engine === "sticker" ? null : init.maskStencils ? this.stencilSelection(init.maskStencils) : useStencils ? this.stencilSelection() : null;
4806
4817
  const inputFilter = snapper || stencilSnapper ? (p) => stencilSnapper ? stencilSnapper.snap(snapper ? snapper.snap(p) : p) : snapper.snap(p) : void 0;
4807
4818
  const rgba = rgbaOf(color);
4808
4819
  const seed = _nullishCoalesce(init.seed, () => ( _chunkPQ3H2AANcjs.mix32.call(void 0, this.seedCounter++ * 2654435761 >>> 0) & 2147483647));
@@ -4840,7 +4851,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4840
4851
  const stroke = {
4841
4852
  id: `s${this.strokeCounter++}`,
4842
4853
  layerId: session.layerId,
4843
- brush: _chunkGNZI3KYKcjs.brushToJSON.call(void 0, init.brush),
4854
+ brush: _chunkNKTNLJUJcjs.brushToJSON.call(void 0, init.brush),
4844
4855
  color: init.colorHex,
4845
4856
  points: session.points.map((p) => ({ ...p })),
4846
4857
  seed: init.seed
@@ -5040,13 +5051,13 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5040
5051
  let brush = v.brush;
5041
5052
  if (options.brushId !== void 0) {
5042
5053
  const b = this.requireBrush(options.brushId);
5043
- brush = _chunkGNZI3KYKcjs.normalizePaintBrush.call(void 0, { tip: { ...b.tip, size: b.tip.size * (v.brush.tip.size / s.brush.tip.size) } }, b);
5054
+ brush = _chunkNKTNLJUJcjs.normalizePaintBrush.call(void 0, { tip: { ...b.tip, size: b.tip.size * (v.brush.tip.size / s.brush.tip.size) } }, b);
5044
5055
  }
5045
5056
  const layerId = _nullishCoalesce(options.layerId, () => ( s.layerId));
5046
5057
  if (!_chunkHB4ICNNAcjs.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.`);
5047
5058
  let load = s.load;
5048
5059
  if (load && options.color !== void 0 && load.reservoir) {
5049
- const [r, g, b] = _chunkGNZI3KYKcjs.hexToRgb8.call(void 0, options.color);
5060
+ const [r, g, b] = _chunkNKTNLJUJcjs.hexToRgb8.call(void 0, options.color);
5050
5061
  load = { ...load, reservoir: [r / 255, g / 255, b / 255] };
5051
5062
  }
5052
5063
  const paint = v.paint && options.color === void 0 ? { paint: v.paint } : {};
@@ -5507,7 +5518,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5507
5518
  const stickers = {};
5508
5519
  for (const [id, list] of Object.entries(ext.stickers)) {
5509
5520
  if (!_chunkHB4ICNNAcjs.findLayer.call(void 0, state.layers, id) || !Array.isArray(list)) continue;
5510
- const ok = list.filter((x) => x && typeof x.id === "string" && _chunkGNZI3KYKcjs.STAMP_KINDS.includes(x.stamp) && Number.isFinite(x.x) && Number.isFinite(x.y) && x.size > 0);
5521
+ const ok = list.filter((x) => x && typeof x.id === "string" && _chunkNKTNLJUJcjs.STAMP_KINDS.includes(x.stamp) && Number.isFinite(x.x) && Number.isFinite(x.y) && x.size > 0);
5511
5522
  if (ok.length !== list.length) problems.push(`Some stickers of layer "${id}" could not be read; they were dropped.`);
5512
5523
  stickers[id] = ok.map((x) => ({ ...x }));
5513
5524
  }
@@ -5649,7 +5660,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5649
5660
  return next.type === "group" ? { ...next, children: toStandard(next.children) } : next;
5650
5661
  });
5651
5662
  const layers = toStandard(dried);
5652
- const result = _chunk5VQXSS2Scjs.exportPsd.call(void 0, { width, height, layers: [paperLayer, ...layers], merged, resolution: dpi });
5663
+ const result = _chunkBBUE3UJLcjs.exportPsd.call(void 0, { width, height, layers: [paperLayer, ...layers], merged, resolution: dpi });
5653
5664
  for (const [mode, names] of changed) {
5654
5665
  const label = _nullishCoalesce(_optionalChain([_chunkOLNIPTB3cjs.BLEND_MODES, 'access', _289 => _289.find, 'call', _290 => _290((m) => m.id === mode), 'optionalAccess', _291 => _291.label]), () => ( mode));
5655
5666
  const std = _nullishCoalesce(_optionalChain([_chunkOLNIPTB3cjs.BLEND_MODES, 'access', _292 => _292.find, 'call', _293 => _293((m) => m.id === _chunkOLNIPTB3cjs.standardBlendMode.call(void 0, mode)), 'optionalAccess', _294 => _294.label]), () => ( _chunkOLNIPTB3cjs.standardBlendMode.call(void 0, mode)));
@@ -5897,28 +5908,115 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5897
5908
  this.requireLayer(id);
5898
5909
  return (_nullishCoalesce(_optionalChain([this, 'access', _308 => _308.doc, 'access', _309 => _309.stickers, 'optionalAccess', _310 => _310[id]]), () => ( []))).map((s) => ({ ...s }));
5899
5910
  }
5900
- /** Replaces a layer's stickers and redraws its pixels from them (one undo step). */
5901
- commitStickers(label, layer, stickers) {
5911
+ /**
5912
+ * Replaces a layer's stickers and redraws its pixels from them (one undo step). With `dirty`,
5913
+ * only the tiles under those rects are redrawn.
5914
+ */
5915
+ commitStickers(label, layer, stickers, dirty) {
5902
5916
  if (_chunkHB4ICNNAcjs.isLayerLocked.call(void 0, layer, "pixels")) throw new PaintEditorError(`Layer "${layer.name}" has its pixels locked; unlock it first.`);
5903
- const surface = _chunkGNZI3KYKcjs.stickerSurface.call(void 0, stickers);
5917
+ const before = _nullishCoalesce(this.previewBase(), () => ( this.doc));
5918
+ this.stickerPreview = null;
5919
+ const surface = this.redrawStickers(layer, stickers, dirty);
5904
5920
  const doc = { ...this.doc, layers: _chunkHB4ICNNAcjs.mapLayer.call(void 0, this.doc.layers, layer.id, () => ({ ...layer, surface, offset: { x: 0, y: 0 } })), stickers: { ..._nullishCoalesce(this.doc.stickers, () => ( {})), [layer.id]: stickers } };
5905
- this.commit(label, this.withPaintEvent(doc, { kind: "stickers", layerId: layer.id, data: { stickers: stickers.map((s) => ({ ...s })) } }));
5921
+ this.commit(label, this.withPaintEvent(doc, { kind: "stickers", layerId: layer.id, data: { stickers: stickers.map((s) => ({ ...s })) } }), before);
5922
+ }
5923
+ redrawStickers(layer, stickers, dirty) {
5924
+ const partial = dirty && !layer.offset.x && !layer.offset.y;
5925
+ return partial ? _chunkNKTNLJUJcjs.stickerSurface.call(void 0, stickers, layer.surface, dirty) : _chunkNKTNLJUJcjs.stickerSurface.call(void 0, stickers);
5926
+ }
5927
+ /** The document from before the sticker preview on screen, or `null` when none is (anything else changed the document since). */
5928
+ previewBase() {
5929
+ return _optionalChain([this, 'access', _311 => _311.stickerPreview, 'optionalAccess', _312 => _312.shown]) === this.doc ? this.stickerPreview.base : null;
5930
+ }
5931
+ readStickerUpdate(update) {
5932
+ try {
5933
+ return _chunkNKTNLJUJcjs.normalizeStickerUpdate.call(void 0, update);
5934
+ } catch (e) {
5935
+ throw new PaintEditorError(e.message);
5936
+ }
5937
+ }
5938
+ /** The top-most sticker under a point (document pixels) on a layer (default the active one), or `null`. */
5939
+ stickerAt(layerId, x, y) {
5940
+ if (!Number.isFinite(x) || !Number.isFinite(y)) throw new PaintEditorError("x and y must be numbers of document pixels.");
5941
+ const id = _nullishCoalesce(layerId, () => ( this.doc.activeLayerId));
5942
+ if (!id) return null;
5943
+ this.requireLayer(id);
5944
+ const hit = _chunkNKTNLJUJcjs.stickerAt.call(void 0, _nullishCoalesce(_optionalChain([this, 'access', _313 => _313.doc, 'access', _314 => _314.stickers, 'optionalAccess', _315 => _315[id]]), () => ( [])), x, y);
5945
+ return hit ? { ...hit } : null;
5946
+ }
5947
+ /** Picks a sticker for the panel and canvas (`null` for none). Editor state, not an undo step. */
5948
+ selectSticker(id) {
5949
+ if (id === this.selectedSticker) return;
5950
+ this.selectedSticker = id;
5951
+ this.emit([]);
5952
+ }
5953
+ /**
5954
+ * Shows a sticker change without committing it (a drag in progress): only the tiles under its
5955
+ * old and new place are redrawn. `updateSticker` then commits it as one undo step from before
5956
+ * the first preview; `cancelStickerPreview` puts it back.
5957
+ */
5958
+ previewSticker(layerId, id, update) {
5959
+ const { layer, stickers } = this.stickerLayer(layerId);
5960
+ if (_chunkHB4ICNNAcjs.isLayerLocked.call(void 0, layer, "pixels")) throw new PaintEditorError(`Layer "${layer.name}" has its pixels locked; unlock it first.`);
5961
+ const i = stickers.findIndex((s) => s.id === id);
5962
+ if (i < 0) throw new PaintEditorError(`Layer "${layer.name}" has no sticker "${id}". Call list_stickers for the ids.`);
5963
+ const next = { ...stickers[i], ...this.readStickerUpdate(update) };
5964
+ const list = stickers.map((s, j) => j === i ? next : s);
5965
+ const dirty = [_chunkNKTNLJUJcjs.stickerRect.call(void 0, stickers[i]), _chunkNKTNLJUJcjs.stickerRect.call(void 0, next)];
5966
+ const base = _nullishCoalesce(this.previewBase(), () => ( this.doc));
5967
+ const surface = this.redrawStickers(layer, list, dirty);
5968
+ this.doc = { ...this.doc, layers: _chunkHB4ICNNAcjs.mapLayer.call(void 0, this.doc.layers, layer.id, () => ({ ...layer, surface, offset: { x: 0, y: 0 } })), stickers: { ..._nullishCoalesce(this.doc.stickers, () => ( {})), [layer.id]: list } };
5969
+ this.stickerPreview = { base, shown: this.doc };
5970
+ this.emit(dirty);
5971
+ return { ...next };
5972
+ }
5973
+ /** Drops a sticker preview, restoring the document from before it. */
5974
+ cancelStickerPreview() {
5975
+ const base = this.previewBase();
5976
+ this.stickerPreview = null;
5977
+ if (!base) return;
5978
+ this.doc = base;
5979
+ this.emit();
5906
5980
  }
5907
5981
  /** Moves, turns, resizes, recolours or restamps one sticker (one undo step). Returns it. */
5908
5982
  updateSticker(layerId, id, update) {
5909
5983
  const { layer, stickers } = this.stickerLayer(layerId);
5910
5984
  const i = stickers.findIndex((s) => s.id === id);
5911
5985
  if (i < 0) throw new PaintEditorError(`Layer "${layer.name}" has no sticker "${id}". Call list_stickers for the ids.`);
5912
- let u;
5913
- try {
5914
- u = _chunkGNZI3KYKcjs.normalizeStickerUpdate.call(void 0, update);
5915
- } catch (e) {
5916
- throw new PaintEditorError(e.message);
5917
- }
5986
+ const u = this.readStickerUpdate(update);
5918
5987
  const next = { ...stickers[i], ...u };
5919
- this.commitStickers("Edit sticker", layer, stickers.map((s, j) => j === i ? next : s));
5988
+ this.commitStickers("Edit sticker", layer, stickers.map((s, j) => j === i ? next : s), [_chunkNKTNLJUJcjs.stickerRect.call(void 0, stickers[i]), _chunkNKTNLJUJcjs.stickerRect.call(void 0, next)]);
5920
5989
  return { ...next };
5921
5990
  }
5991
+ /**
5992
+ * Places stickers exactly (one undo step), on top of a sticker layer or onto an empty layer,
5993
+ * which becomes one. Missing fields: size 48 px, rotation 0, the paint colour, opacity 1, a seed
5994
+ * from the new id. Returns the new stickers with their ids.
5995
+ */
5996
+ addStickers(layerId, input) {
5997
+ const layer = this.wetLayer(layerId, "add stickers to");
5998
+ if (!input.length) throw new PaintEditorError("Pass at least one sticker (stamp, x, y).");
5999
+ if (input.length > MAX_ADD_STICKERS) throw new PaintEditorError(`At most ${MAX_ADD_STICKERS} stickers per call; split them over several calls.`);
6000
+ const existing = _optionalChain([this, 'access', _316 => _316.doc, 'access', _317 => _317.stickers, 'optionalAccess', _318 => _318[layer.id]]);
6001
+ if (!_optionalChain([existing, 'optionalAccess', _319 => _319.length])) {
6002
+ if (this.wet.wetLayerIds().includes(layer.id) || _chunk474IQG74cjs.contentBounds.call(void 0, layer.surface)) throw new PaintEditorError(`Layer "${layer.name}" already has paint; add stickers to an empty layer (add_layer) or a sticker layer so they stay editable.`);
6003
+ }
6004
+ let n = this.nextStickerNumber();
6005
+ const added = input.map((raw, i) => {
6006
+ for (const k of ["stamp", "x", "y"]) if (raw[k] === void 0) throw new PaintEditorError(`Sticker ${i} needs ${k}.`);
6007
+ let u;
6008
+ try {
6009
+ u = this.readStickerUpdate(raw);
6010
+ } catch (e) {
6011
+ throw new PaintEditorError(`Sticker ${i}: ${e.message}`);
6012
+ }
6013
+ if (raw.seed !== void 0 && !Number.isInteger(raw.seed)) throw new PaintEditorError(`Sticker ${i}: seed must be a whole number.`);
6014
+ const id = n++;
6015
+ return { id: `st${id}`, size: 48, rotation: 0, color: this.color, opacity: 1, seed: _nullishCoalesce(raw.seed, () => ( _chunkPQ3H2AANcjs.mix32.call(void 0, id * 2654435761 >>> 0) & 2147483647)), ...u };
6016
+ });
6017
+ this.commitStickers("Add stickers", layer, [..._nullishCoalesce(existing, () => ( [])), ...added], _optionalChain([existing, 'optionalAccess', _320 => _320.length]) ? added.map(_chunkNKTNLJUJcjs.stickerRect) : void 0);
6018
+ return added.map((s) => ({ ...s }));
6019
+ }
5922
6020
  /** Brings stickers to the top (`front`) or bottom of their layer (one undo step). */
5923
6021
  arrangeStickers(layerId, ids, to) {
5924
6022
  const { layer, stickers } = this.stickerLayer(layerId);
@@ -5926,7 +6024,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5926
6024
  const picked = stickers.filter((s) => ids.includes(s.id));
5927
6025
  const rest = stickers.filter((s) => !ids.includes(s.id));
5928
6026
  const next = to === "front" ? [...rest, ...picked] : [...picked, ...rest];
5929
- this.commitStickers("Arrange stickers", layer, next);
6027
+ this.commitStickers("Arrange stickers", layer, next, picked.map(_chunkNKTNLJUJcjs.stickerRect));
5930
6028
  return next.map((s) => s.id);
5931
6029
  }
5932
6030
  /** Deletes stickers (`ids`, or all of them on the layer) (one undo step). Returns the ids removed. */
@@ -5936,7 +6034,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5936
6034
  for (const id of ids) if (!stickers.some((s) => s.id === id)) throw new PaintEditorError(`Layer "${layer.name}" has no sticker "${id}". Call list_stickers for the ids.`);
5937
6035
  }
5938
6036
  const removed = ids ? [...ids] : stickers.map((s) => s.id);
5939
- this.commitStickers("Remove stickers", layer, stickers.filter((s) => !removed.includes(s.id)));
6037
+ this.commitStickers("Remove stickers", layer, stickers.filter((s) => !removed.includes(s.id)), ids ? stickers.filter((s) => removed.includes(s.id)).map(_chunkNKTNLJUJcjs.stickerRect) : void 0);
5940
6038
  return removed;
5941
6039
  }
5942
6040
  /** Sets a layer's stickers (replays). */
@@ -5945,13 +6043,13 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5945
6043
  this.commitStickers("Stickers", l, stickers.map((s) => ({ ...s })));
5946
6044
  }
5947
6045
  // --- Stencils --------------------------------------------------------------------
5948
- __init112() {this.stencilCache = null}
5949
- __init113() {this.nextStencilId = 1}
6046
+ __init114() {this.stencilCache = null}
6047
+ __init115() {this.nextStencilId = 1}
5950
6048
  /** The mask stencils' coverage over the canvas (cached), or `null` when none masks. */
5951
6049
  stencilSelection(stencils = this.guides.stencils) {
5952
6050
  const { width, height } = this.doc.canvas;
5953
6051
  const size = `${width}x${height}`;
5954
- if (_optionalChain([this, 'access', _311 => _311.stencilCache, 'optionalAccess', _312 => _312.key]) === stencils && this.stencilCache.size === size) return this.stencilCache.mask;
6052
+ if (_optionalChain([this, 'access', _321 => _321.stencilCache, 'optionalAccess', _322 => _322.key]) === stencils && this.stencilCache.size === size) return this.stencilCache.mask;
5955
6053
  const mask = stencilMask(stencils, width, height);
5956
6054
  this.stencilCache = { key: stencils, size, mask };
5957
6055
  return mask;
@@ -6013,7 +6111,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
6013
6111
  makeSwatch(color, name) {
6014
6112
  const p = typeof color === "string" ? { type: "color", color: parseColor(color) } : this.readStrokePaint(color);
6015
6113
  const out = { color: _chunkPQ3H2AANcjs.paintSourceColor.call(void 0, p, { paint: this.color, secondary: this.secondaryColor }) };
6016
- if (_optionalChain([name, 'optionalAccess', _313 => _313.trim, 'call', _314 => _314()])) out.name = name.trim();
6114
+ if (_optionalChain([name, 'optionalAccess', _323 => _323.trim, 'call', _324 => _324()])) out.name = name.trim();
6017
6115
  if (p.type === "gradient") out.paint = p;
6018
6116
  return out;
6019
6117
  }
@@ -6065,7 +6163,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
6065
6163
  * mix becomes the paint colour. Returns the mixed colour and the pile's bounds.
6066
6164
  */
6067
6165
  mixOnPad(paints, options = {}) {
6068
- const parsed = (_nullishCoalesce(paints, () => ( []))).map((p, i) => ({ color: parseColor(_optionalChain([p, 'optionalAccess', _315 => _315.color]), `paints[${i}].color`), parts: _optionalChain([p, 'optionalAccess', _316 => _316.parts]) }));
6166
+ const parsed = (_nullishCoalesce(paints, () => ( []))).map((p, i) => ({ color: parseColor(_optionalChain([p, 'optionalAccess', _325 => _325.color]), `paints[${i}].color`), parts: _optionalChain([p, 'optionalAccess', _326 => _326.parts]) }));
6069
6167
  let r;
6070
6168
  try {
6071
6169
  r = this.pad.mix(parsed, options);
@@ -6154,7 +6252,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
6154
6252
  }
6155
6253
  /** A layer's tile surface (live while stroking), for thumbnails. */
6156
6254
  layerSurface(id) {
6157
- const l = _optionalChain([_chunkHB4ICNNAcjs.findLayer.call(void 0, this.currentLayers(), id), 'optionalAccess', _317 => _317.layer]);
6255
+ const l = _optionalChain([_chunkHB4ICNNAcjs.findLayer.call(void 0, this.currentLayers(), id), 'optionalAccess', _327 => _327.layer]);
6158
6256
  return isPixelLayer(l) ? l.surface : null;
6159
6257
  }
6160
6258
  }, _class10.__initStatic(), _class10);
@@ -6180,7 +6278,7 @@ function shiftDocument(doc, dx, dy) {
6180
6278
  if (doc.stickers) out.stickers = Object.fromEntries(Object.entries(doc.stickers).map(([id, list]) => [id, moveStickers(list)]));
6181
6279
  if (doc.paintEvents) {
6182
6280
  out.paintEvents = doc.paintEvents.map((e) => {
6183
- const list = e.kind === "stickers" ? _optionalChain([e, 'access', _318 => _318.data, 'optionalAccess', _319 => _319.stickers]) : void 0;
6281
+ const list = e.kind === "stickers" ? _optionalChain([e, 'access', _328 => _328.data, 'optionalAccess', _329 => _329.stickers]) : void 0;
6184
6282
  return list ? { ...e, data: { ...e.data, stickers: moveStickers(list) } } : e;
6185
6283
  });
6186
6284
  }
@@ -6262,8 +6360,8 @@ function strokeSchedule(points) {
6262
6360
  return total > 0 ? acc.map((d) => d / total) : points.map(() => 1);
6263
6361
  }
6264
6362
  function strokeDuration(points, max = 1800) {
6265
- const t0 = _optionalChain([points, 'access', _320 => _320[0], 'optionalAccess', _321 => _321.t]);
6266
- const t1 = _optionalChain([points, 'access', _322 => _322[points.length - 1], 'optionalAccess', _323 => _323.t]);
6363
+ const t0 = _optionalChain([points, 'access', _330 => _330[0], 'optionalAccess', _331 => _331.t]);
6364
+ const t1 = _optionalChain([points, 'access', _332 => _332[points.length - 1], 'optionalAccess', _333 => _333.t]);
6267
6365
  let ms;
6268
6366
  if (points.every((p) => Number.isFinite(p.t)) && t1 > t0) ms = t1 - t0;
6269
6367
  else {
@@ -6317,7 +6415,7 @@ var PaintDirector = class {
6317
6415
  }
6318
6416
  where(id) {
6319
6417
  const a = this.presence.get(id);
6320
- return { x: _nullishCoalesce(_optionalChain([a, 'optionalAccess', _324 => _324.x]), () => ( 0)), y: _nullishCoalesce(_optionalChain([a, 'optionalAccess', _325 => _325.y]), () => ( 0)) };
6418
+ return { x: _nullishCoalesce(_optionalChain([a, 'optionalAccess', _334 => _334.x]), () => ( 0)), y: _nullishCoalesce(_optionalChain([a, 'optionalAccess', _335 => _335.y]), () => ( 0)) };
6321
6419
  }
6322
6420
  /** Glides to `to`; an actor that just appeared starts there instead of the corner. */
6323
6421
  async glide(id, to, ms = 380) {
@@ -6364,8 +6462,8 @@ var PaintDirector = class {
6364
6462
  }
6365
6463
  case "replay": {
6366
6464
  await this.say(id, command.note, 500);
6367
- const source = c.getStrokes().filter((s) => _optionalChain([command, 'access', _326 => _326.replay, 'access', _327 => _327.strokeIds, 'optionalAccess', _328 => _328.includes, 'call', _329 => _329(s.id)]));
6368
- const first = _optionalChain([source, 'access', _330 => _330[0], 'optionalAccess', _331 => _331.points, 'access', _332 => _332[0]]);
6465
+ const source = c.getStrokes().filter((s) => _optionalChain([command, 'access', _336 => _336.replay, 'access', _337 => _337.strokeIds, 'optionalAccess', _338 => _338.includes, 'call', _339 => _339(s.id)]));
6466
+ const first = _optionalChain([source, 'access', _340 => _340[0], 'optionalAccess', _341 => _341.points, 'access', _342 => _342[0]]);
6369
6467
  if (first) await this.glide(id, first);
6370
6468
  const result = c.replayStrokes(command.replay);
6371
6469
  if (result.bounds) await this.glide(id, centre(result.bounds), 520);
@@ -6512,6 +6610,61 @@ function createPaintStickerTools(c) {
6512
6610
  coordinates: { out: ["stickers[]"] },
6513
6611
  handler: ({ layerId }) => ({ layerId: _nullishCoalesce(layerId, () => ( c.document.activeLayerId)), stickers: c.listStickers(layerId) })
6514
6612
  },
6613
+ {
6614
+ name: "sticker_at",
6615
+ title: "Find the sticker at a point",
6616
+ description: "Returns the top-most sticker under a point (document pixels) by its stamp\u2019s shape, or sticker null when none is there, so you can pick one sticker among many similar ones before update_sticker, arrange_stickers or remove_stickers. Changes nothing.",
6617
+ inputSchema: {
6618
+ type: "object",
6619
+ properties: {
6620
+ layerId: LAYER_ID,
6621
+ x: { type: "number", description: "Point x in document pixels." },
6622
+ y: { type: "number", description: "Point y in document pixels." }
6623
+ },
6624
+ required: ["x", "y"],
6625
+ additionalProperties: false
6626
+ },
6627
+ annotations: { title: "Find the sticker at a point", ...READ },
6628
+ coordinates: { in: [""], out: ["sticker"] },
6629
+ handler: ({ layerId, x, y }) => ({ layerId: _nullishCoalesce(layerId, () => ( c.document.activeLayerId)), sticker: c.stickerAt(layerId, x, y) })
6630
+ },
6631
+ {
6632
+ name: "add_stickers",
6633
+ title: "Place stickers",
6634
+ description: "Places stickers exactly where you say, on top of a sticker layer or onto an empty layer (which becomes a sticker layer). Use it for deliberate placement; spray with paint_stroke and a sticker brush for a random scatter. One undo step. Returns the new stickers with their ids, for update_sticker, arrange_stickers and remove_stickers.",
6635
+ inputSchema: {
6636
+ type: "object",
6637
+ properties: {
6638
+ layerId: LAYER_ID,
6639
+ stickers: {
6640
+ type: "array",
6641
+ minItems: 1,
6642
+ maxItems: 500,
6643
+ description: "The stickers to place, drawn in this order (later ones on top).",
6644
+ items: {
6645
+ type: "object",
6646
+ properties: {
6647
+ stamp: { type: "string", enum: [..._chunkNKTNLJUJcjs.STAMP_KINDS], description: "The stamp." },
6648
+ x: { type: "number", description: "Centre x in document pixels." },
6649
+ y: { type: "number", description: "Centre y in document pixels." },
6650
+ size: { type: "number", minimum: 2, maximum: 2048, description: "Diameter in pixels (default 48)." },
6651
+ rotation: { type: "number", minimum: -3600, maximum: 3600, description: "Degrees clockwise (default 0)." },
6652
+ color: { type: "string", pattern: "^#[0-9a-fA-F]{6}$", description: "Colour #rrggbb (default the paint colour)." },
6653
+ opacity: { type: "number", minimum: 0, maximum: 1, description: "Opacity 0..1 (default 1)." },
6654
+ seed: { type: "integer", minimum: 0, description: "Texture seed (default from the new id); splat and confetti shapes vary with it." }
6655
+ },
6656
+ required: ["stamp", "x", "y"],
6657
+ additionalProperties: false
6658
+ }
6659
+ }
6660
+ },
6661
+ required: ["stickers"],
6662
+ additionalProperties: false
6663
+ },
6664
+ annotations: { title: "Place stickers", ...WRITE },
6665
+ coordinates: { in: ["stickers[]"], out: ["stickers[]"] },
6666
+ handler: ({ layerId, stickers }) => ({ layerId: _nullishCoalesce(layerId, () => ( c.document.activeLayerId)), stickers: c.addStickers(layerId, stickers) })
6667
+ },
6515
6668
  {
6516
6669
  name: "update_sticker",
6517
6670
  title: "Change a sticker",
@@ -6521,7 +6674,7 @@ function createPaintStickerTools(c) {
6521
6674
  properties: {
6522
6675
  layerId: LAYER_ID,
6523
6676
  id: { type: "string", description: "Sticker id from list_stickers." },
6524
- stamp: { type: "string", enum: [..._chunkGNZI3KYKcjs.STAMP_KINDS], description: "Another stamp." },
6677
+ stamp: { type: "string", enum: [..._chunkNKTNLJUJcjs.STAMP_KINDS], description: "Another stamp." },
6525
6678
  x: { type: "number", description: "Centre x in document pixels." },
6526
6679
  y: { type: "number", description: "Centre y in document pixels." },
6527
6680
  size: { type: "number", minimum: 2, maximum: 2048, description: "Diameter in pixels." },
@@ -6798,7 +6951,7 @@ function createPaintGuideTools(c) {
6798
6951
  inputSchema: {
6799
6952
  type: "object",
6800
6953
  properties: {
6801
- kind: { type: "string", enum: [..._chunkEUIDTZNQcjs.HARMONY_KINDS], description: "The harmony." },
6954
+ kind: { type: "string", enum: [..._chunk7PT4RJL5cjs.HARMONY_KINDS], description: "The harmony." },
6802
6955
  color: { ...COLOR2, description: "Base colour #rrggbb (default the paint colour)." },
6803
6956
  wheel: { type: "string", enum: ["ryb", "rgb"], description: "ryb (painter\u2019s wheel, default) or rgb." },
6804
6957
  spread: { type: "number", minimum: 5, maximum: 90, description: "Analogous and split-complementary spread in degrees (default 30)." }
@@ -7399,7 +7552,7 @@ var BEHAVIOR = {
7399
7552
  type: "object",
7400
7553
  description: "Multi-coloured brush (the older form of paint, the brush's own gradient: tip is across-tip, dab is distance in dabs or random). Read back from paint when it has a multi-colour equivalent. Missing fields keep their current values.",
7401
7554
  properties: {
7402
- mode: { type: "string", enum: [..._chunkGNZI3KYKcjs.MULTI_COLOR_MODES], description: "off; tip: the colours lie side by side across the tip (stripes along the stroke, like a brush loaded with several paints); dab: the colour changes along the stroke." },
7555
+ mode: { type: "string", enum: [..._chunkNKTNLJUJcjs.MULTI_COLOR_MODES], description: "off; tip: the colours lie side by side across the tip (stripes along the stroke, like a brush loaded with several paints); dab: the colour changes along the stroke." },
7403
7556
  colors: { type: "array", maxItems: 8, items: { ...COLOR3 }, description: "2..8 colours #rrggbb; fewer than 2 uses the paint colour and the secondary colour." },
7404
7557
  order: { type: "string", enum: ["sequence", "random"], description: "dab mode: sequence runs through the colours in order, blending between them; random picks one per run of dabs (seeded)." },
7405
7558
  length: { type: "integer", minimum: 1, maximum: 500, description: "dab mode: dabs per colour (default 12)." },
@@ -7440,10 +7593,10 @@ var WET_BRUSH = {
7440
7593
  properties: {
7441
7594
  tool: {
7442
7595
  type: "string",
7443
- enum: [..._chunkGNZI3KYKcjs.WET_TOOLS],
7596
+ enum: [..._chunkNKTNLJUJcjs.WET_TOOLS],
7444
7597
  description: "paint: water and pigment (picks up and mixes wet paint by behavior.pickup / mix); water: clear water (with rewet it lifts dried paint); dry: a hair dryer, takes water; blow: pushes the water along the stroke; blend: evens out wet pigment; smudge: drags wet paint; blot: a tissue, takes wet paint up (erase wet)."
7445
7598
  },
7446
- medium: { type: "string", enum: [..._chunkGNZI3KYKcjs.WET_MEDIA], description: "The medium: watercolor, gouache or oil. A layer takes the medium's wet settings the first time it holds wet paint (oil: thick, barely flows, stays wet long and blends into the wet paint it meets)." },
7599
+ medium: { type: "string", enum: [..._chunkNKTNLJUJcjs.WET_MEDIA], description: "The medium: watercolor, gouache or oil. A layer takes the medium's wet settings the first time it holds wet paint (oil: thick, barely flows, stays wet long and blends into the wet paint it meets)." },
7447
7600
  load: { type: "number", minimum: 0, maximum: 1, description: "Paint loading: 1 never runs out; lower, the brush runs dry along a long stroke (each stroke reloads)." },
7448
7601
  thinner: { type: "number", minimum: 0, maximum: 1, description: "Thinner (water or solvent): more transparent, runnier paint." },
7449
7602
  water: { type: "number", minimum: 0, maximum: 1, description: "Wetness: water laid per stroke, 0.2 a damp brush .. 1 a dripping one." },
@@ -7460,7 +7613,7 @@ var IMPASTO_BRUSH = {
7460
7613
  properties: {
7461
7614
  tool: {
7462
7615
  type: "string",
7463
- enum: [..._chunkGNZI3KYKcjs.IMPASTO_TOOLS],
7616
+ enum: [..._chunkNKTNLJUJcjs.IMPASTO_TOOLS],
7464
7617
  description: "brush: thick paint with bristle ridges along the stroke; tube: blobs squeezed from the tube; knife: a palette knife that scrapes the relief flat and smears the paint; roller: a flat stippled band; gloop: a thick, glossy, rounded bead."
7465
7618
  },
7466
7619
  thickness: { type: "number", minimum: 0, maximum: 1, description: "How far the paint stands up." },
@@ -7476,8 +7629,8 @@ var PARTICLE_BRUSH = {
7476
7629
  type: "object",
7477
7630
  description: "Particle engine settings (procedural brushes). Missing fields keep their current values.",
7478
7631
  properties: {
7479
- kind: { type: "string", enum: [..._chunkGNZI3KYKcjs.PARTICLE_KINDS], description: "string: strands of masses on springs dragged behind the pen (hair, fur, wet string); spring: particles on springs to the pen, overshooting and wobbling; orbit: particles circling the pen (curls); flow: particles thrown off the pen into a swirling flow until they fade." },
7480
- render: { type: "string", enum: [..._chunkGNZI3KYKcjs.PARTICLE_RENDERS], description: "dot: a mark at each step; line: each particle draws a continuous line; sequence: beads spaced along each path." },
7632
+ kind: { type: "string", enum: [..._chunkNKTNLJUJcjs.PARTICLE_KINDS], description: "string: strands of masses on springs dragged behind the pen (hair, fur, wet string); spring: particles on springs to the pen, overshooting and wobbling; orbit: particles circling the pen (curls); flow: particles thrown off the pen into a swirling flow until they fade." },
7633
+ render: { type: "string", enum: [..._chunkNKTNLJUJcjs.PARTICLE_RENDERS], description: "dot: a mark at each step; line: each particle draws a continuous line; sequence: beads spaced along each path." },
7481
7634
  count: { type: "integer", minimum: 1, maximum: 64, description: "Particles (flow: how many are thrown per tip of travel)." },
7482
7635
  size: { type: "number", minimum: 0, maximum: 1, description: "Mark size as a fraction of the tip size." },
7483
7636
  spread: { type: "number", minimum: 0, maximum: 1, description: "How far apart the particles start, as a fraction of the tip size." },
@@ -7507,27 +7660,27 @@ var STICKER_BRUSH = {
7507
7660
  type: "object",
7508
7661
  description: "Sticker engine settings: stamps sprayed along the stroke as editable stickers. Missing fields keep their current values.",
7509
7662
  properties: {
7510
- stamps: { type: "array", minItems: 1, maxItems: 9, items: { type: "string", enum: [..._chunkGNZI3KYKcjs.STAMP_KINDS], description: "A stamp." }, description: "The stamps to spray (one picked at random per sticker)." },
7511
- density: { type: "number", minimum: 0, maximum: 1, description: "Stickers per distance travelled." },
7663
+ stamps: { type: "array", minItems: 1, maxItems: 9, items: { type: "string", enum: [..._chunkNKTNLJUJcjs.STAMP_KINDS], description: "A stamp." }, description: "The stamps to spray (one picked at random per sticker)." },
7664
+ density: { type: "number", minimum: 0, maximum: 1, description: "How closely stickers follow each other: about density \xD7 4 stickers per tip diameter of travel (0.25 \u2248 one per diameter, 1 \u2248 four). Default 0.4." },
7512
7665
  sizeJitter: { type: "number", minimum: 0, maximum: 1, description: "Random size change." },
7513
7666
  rotationJitter: { type: "number", minimum: 0, maximum: 1, description: "Random turn as a fraction of \xB1180\xB0." },
7514
7667
  scatter: { type: "number", minimum: 0, maximum: 2, description: "How far from the path stickers land, in tip diameters." },
7515
- colorJitter: { type: "number", minimum: 0, maximum: 1, description: "Random colour change around the paint colour." }
7668
+ colorJitter: { type: "number", minimum: 0, maximum: 1, description: "Random colour change around the paint colour: at 1, up to \xB140\xB0 of hue and \xB10.15 OKLab lightness, kept in gamut. Default 0.2." }
7516
7669
  },
7517
7670
  additionalProperties: false
7518
7671
  };
7519
7672
  var BRUSH_FIELDS = {
7520
7673
  name: { type: "string", minLength: 1, maxLength: 80, description: "Display name." },
7521
- category: { type: "string", enum: [..._chunkGNZI3KYKcjs.PAINT_BRUSH_CATEGORIES], description: "Library category." },
7674
+ category: { type: "string", enum: [..._chunkNKTNLJUJcjs.PAINT_BRUSH_CATEGORIES], description: "Library category." },
7522
7675
  engine: {
7523
7676
  type: "string",
7524
- enum: [..._chunkGNZI3KYKcjs.PAINT_BRUSH_ENGINES],
7677
+ enum: [..._chunkNKTNLJUJcjs.PAINT_BRUSH_ENGINES],
7525
7678
  description: "dab: paints dabs (with behavior.pickup or gradient paint it paints dab by dab, lifting and mixing paint); eraser: removes paint; mixer: the Mixer Brush (a reservoir plus picked-up paint); blender: mixes the colours under and near the tip; smudge: drags paint along the stroke; wet: watercolour, gouache, oil and the wet tools on a simulated wet layer (see wet); impasto: thick paint with relief (see impasto); particle: procedural particle brushes (see particle); bristle: a tuft of bristles that bend and splay (see bristle); sticker: sprays editable sticker stamps (see sticker)."
7526
7679
  },
7527
7680
  tip: TIP,
7528
7681
  grain: { type: "number", minimum: 0, maximum: 1, description: "Paper grain response: 0 ignores the grain, 1 catches only its peaks at light pressure (pencil, pastel, charcoal). Multiplied by the paper depth." },
7529
7682
  pressureSmoothing: { type: "number", minimum: 0, maximum: 0.95, description: "Pressure smoothing, separate from the tip position smoothing." },
7530
- rotation: { type: "string", enum: [..._chunkGNZI3KYKcjs.BRUSH_ROTATIONS], description: "What turns the tip: fixed (tip.angle), stroke (follows the direction of travel) or barrel (the pen barrel rotation, twist)." },
7683
+ rotation: { type: "string", enum: [..._chunkNKTNLJUJcjs.BRUSH_ROTATIONS], description: "What turns the tip: fixed (tip.angle), stroke (follows the direction of travel) or barrel (the pen barrel rotation, twist)." },
7531
7684
  dynamics: DYNAMICS,
7532
7685
  mixer: MIXER,
7533
7686
  loadsColor: { type: "boolean", description: "Mixer engine: load the colour each stroke (false for a mixer that only moves paint)." },
@@ -7577,7 +7730,7 @@ function brushSummary(b) {
7577
7730
  size: b.tip.size,
7578
7731
  grain: b.grain,
7579
7732
  rotation: b.rotation,
7580
- wetCapable: _chunkGNZI3KYKcjs.isWetCapable.call(void 0, b),
7733
+ wetCapable: _chunkNKTNLJUJcjs.isWetCapable.call(void 0, b),
7581
7734
  pickup: b.behavior.pickup,
7582
7735
  dirty: b.behavior.dirty,
7583
7736
  multicolor: b.behavior.multicolor.mode,
@@ -7685,8 +7838,8 @@ function createPaintEditorToolProvider(controller, options = {}) {
7685
7838
  inputSchema: EMPTY3,
7686
7839
  annotations: { title: "List papers", ...READ6 },
7687
7840
  handler: () => ({
7688
- papers: _chunkGNZI3KYKcjs.PAPER_LIBRARY.map((p) => ({ id: p.preset, name: p.name, family: p.family, pattern: p.pattern, color: p.color, depth: p.depth, absorption: p.absorption, permeability: p.permeability, roughness: p.roughness })),
7689
- families: [..._chunkGNZI3KYKcjs.PAPER_FAMILIES],
7841
+ papers: _chunkNKTNLJUJcjs.PAPER_LIBRARY.map((p) => ({ id: p.preset, name: p.name, family: p.family, pattern: p.pattern, color: p.color, depth: p.depth, absorption: p.absorption, permeability: p.permeability, roughness: p.roughness })),
7842
+ families: [..._chunkNKTNLJUJcjs.PAPER_FAMILIES],
7690
7843
  patterns: [..._chunkPQ3H2AANcjs.GRAIN_PATTERNS]
7691
7844
  })
7692
7845
  });
@@ -7906,7 +8059,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
7906
8059
  annotations: { title: "List brushes", ...READ6 },
7907
8060
  handler: () => {
7908
8061
  const s = c.getState();
7909
- return { activeBrushId: s.brush.id, activeEdited: !s.brush.builtin && Boolean(_optionalChain([c, 'access', _333 => _333.getBrush, 'call', _334 => _334(s.brush.id), 'optionalAccess', _335 => _335.builtin])), brushes: s.brushes.map(brushSummary) };
8062
+ return { activeBrushId: s.brush.id, activeEdited: !s.brush.builtin && Boolean(_optionalChain([c, 'access', _343 => _343.getBrush, 'call', _344 => _344(s.brush.id), 'optionalAccess', _345 => _345.builtin])), brushes: s.brushes.map(brushSummary) };
7910
8063
  }
7911
8064
  });
7912
8065
  add({
@@ -7917,10 +8070,10 @@ function createPaintEditorToolProvider(controller, options = {}) {
7917
8070
  annotations: { title: "Get a brush", ...READ6 },
7918
8071
  handler: ({ id }) => {
7919
8072
  const st = c.getState();
7920
- if (id === void 0) return { ..._chunkGNZI3KYKcjs.brushToJSON.call(void 0, st.brush), strokePaint: _nullishCoalesce(st.brush.paint, () => ( st.paint)) };
8073
+ if (id === void 0) return { ..._chunkNKTNLJUJcjs.brushToJSON.call(void 0, st.brush), strokePaint: _nullishCoalesce(st.brush.paint, () => ( st.paint)) };
7921
8074
  const b = c.getBrush(id);
7922
8075
  if (!b) throw new Error(`Unknown brush "${id}". Call list_brushes for the ids.`);
7923
- return { ..._chunkGNZI3KYKcjs.brushToJSON.call(void 0, b), builtin: Boolean(b.builtin), strokePaint: _nullishCoalesce(b.paint, () => ( st.paint)) };
8076
+ return { ..._chunkNKTNLJUJcjs.brushToJSON.call(void 0, b), builtin: Boolean(b.builtin), strokePaint: _nullishCoalesce(b.paint, () => ( st.paint)) };
7924
8077
  }
7925
8078
  });
7926
8079
  add({
@@ -7929,7 +8082,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
7929
8082
  description: "Chooses the active brush (id) and / or changes its settings; strokes without a brush use it. Editor state, not an undo step. Changes stay on the active brush until save_brush stores them. Returns the active brush.",
7930
8083
  inputSchema: { type: "object", properties: { id: { type: "string", description: "Brush id from list_brushes to start from." }, ...BRUSH_FIELDS }, additionalProperties: false },
7931
8084
  annotations: { title: "Set the brush", ...SET4 },
7932
- handler: (a) => _chunkGNZI3KYKcjs.brushToJSON.call(void 0, c.setBrush(a))
8085
+ handler: (a) => _chunkNKTNLJUJcjs.brushToJSON.call(void 0, c.setBrush(a))
7933
8086
  });
7934
8087
  add({
7935
8088
  name: "save_brush",
@@ -7945,7 +8098,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
7945
8098
  additionalProperties: false
7946
8099
  },
7947
8100
  annotations: { title: "Save a brush", ...SET4 },
7948
- handler: ({ id, name }) => _chunkGNZI3KYKcjs.brushToJSON.call(void 0, c.saveBrush({ id, name }))
8101
+ handler: ({ id, name }) => _chunkNKTNLJUJcjs.brushToJSON.call(void 0, c.saveBrush({ id, name }))
7949
8102
  });
7950
8103
  add({
7951
8104
  name: "remove_brush",
@@ -8144,7 +8297,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
8144
8297
  color: s.color,
8145
8298
  points: ids ? s.points : s.points.length,
8146
8299
  seed: s.seed,
8147
- copies: _nullishCoalesce(_optionalChain([s, 'access', _336 => _336.copies, 'optionalAccess', _337 => _337.length]), () => ( 0)),
8300
+ copies: _nullishCoalesce(_optionalChain([s, 'access', _346 => _346.copies, 'optionalAccess', _347 => _347.length]), () => ( 0)),
8148
8301
  bounds: { x: Math.floor(Math.min(...xs) - pad), y: Math.floor(Math.min(...ys) - pad), width: Math.ceil(Math.max(...xs) - Math.min(...xs) + 2 * pad), height: Math.ceil(Math.max(...ys) - Math.min(...ys) + 2 * pad) }
8149
8302
  };
8150
8303
  })
@@ -8312,16 +8465,16 @@ function createPaintEditorToolProvider(controller, options = {}) {
8312
8465
  }
8313
8466
  function hostTool({ coordinates, ...tool }, { origin, onChange }) {
8314
8467
  if (!origin && !onChange) return tool;
8315
- const write = !_optionalChain([tool, 'access', _338 => _338.annotations, 'optionalAccess', _339 => _339.readOnlyHint]);
8468
+ const write = !_optionalChain([tool, 'access', _348 => _348.annotations, 'optionalAccess', _349 => _349.readOnlyHint]);
8316
8469
  const done = (result) => {
8317
- if (write) _optionalChain([onChange, 'optionalCall', _340 => _340({ tool: tool.name })]);
8318
- return origin && _optionalChain([coordinates, 'optionalAccess', _341 => _341.out]) ? fromDocument(result, coordinates.out, origin) : result;
8470
+ if (write) _optionalChain([onChange, 'optionalCall', _350 => _350({ tool: tool.name })]);
8471
+ return origin && _optionalChain([coordinates, 'optionalAccess', _351 => _351.out]) ? fromDocument(result, coordinates.out, origin) : result;
8319
8472
  };
8320
8473
  return {
8321
8474
  ...tool,
8322
8475
  ...origin ? { description: hostedText(_nullishCoalesce(tool.description, () => ( ""))), inputSchema: hostedSchema(tool.inputSchema) } : {},
8323
8476
  handler: (args, context) => {
8324
- const r = tool.handler(origin && _optionalChain([coordinates, 'optionalAccess', _342 => _342.in]) ? toDocument(args, coordinates.in, origin) : args, context);
8477
+ const r = tool.handler(origin && _optionalChain([coordinates, 'optionalAccess', _352 => _352.in]) ? toDocument(args, coordinates.in, origin) : args, context);
8325
8478
  return r instanceof Promise ? r.then(done) : done(r);
8326
8479
  }
8327
8480
  };
@@ -8331,24 +8484,25 @@ function hostTool({ coordinates, ...tool }, { origin, onChange }) {
8331
8484
  var PAINT_TOOLS = [
8332
8485
  { id: "brush", label: "Brush", key: "b" },
8333
8486
  { id: "eyedropper", label: "Eyedropper", key: "i" },
8487
+ { id: "sticker", label: "Stickers", key: "s" },
8334
8488
  { id: "pan", label: "Pan", key: "h" },
8335
8489
  { id: "rotate", label: "Rotate view", key: "r" }
8336
8490
  ];
8337
8491
  var PaintGesture = (_class11 = class {
8338
- constructor(controller, box) {;_class11.prototype.__init114.call(this);_class11.prototype.__init115.call(this);_class11.prototype.__init116.call(this);_class11.prototype.__init117.call(this);_class11.prototype.__init118.call(this);_class11.prototype.__init119.call(this);
8492
+ constructor(controller, box) {;_class11.prototype.__init116.call(this);_class11.prototype.__init117.call(this);_class11.prototype.__init118.call(this);_class11.prototype.__init119.call(this);_class11.prototype.__init120.call(this);_class11.prototype.__init121.call(this);
8339
8493
  this.controller = controller;
8340
8494
  this.box = box;
8341
8495
  }
8342
8496
 
8343
8497
 
8344
- __init114() {this.tool = "brush"}
8498
+ __init116() {this.tool = "brush"}
8345
8499
  /** The last refusal (a hidden or locked layer), for the editor to show. */
8346
- __init115() {this.error = null}
8500
+ __init117() {this.error = null}
8347
8501
  /** The predicted tail of the current stroke in document pixels (draw it as a thin preview). */
8348
- __init116() {this.predicted = []}
8349
- __init117() {this.mode = null}
8350
- __init118() {this.penAt = null}
8351
- __init119() {this.penDown = false}
8502
+ __init118() {this.predicted = []}
8503
+ __init119() {this.mode = null}
8504
+ __init120() {this.penAt = null}
8505
+ __init121() {this.penDown = false}
8352
8506
  doc(e) {
8353
8507
  const b = this.box();
8354
8508
  const s = this.controller.getState();
@@ -8383,6 +8537,7 @@ var PaintGesture = (_class11 = class {
8383
8537
  this.pick(e);
8384
8538
  return false;
8385
8539
  }
8540
+ if (tool === "sticker") return this.stickerDown(e);
8386
8541
  try {
8387
8542
  const p = this.pen(e);
8388
8543
  const session = this.controller.beginStroke({ start: p });
@@ -8394,6 +8549,29 @@ var PaintGesture = (_class11 = class {
8394
8549
  return false;
8395
8550
  }
8396
8551
  }
8552
+ /**
8553
+ * The Stickers tool: pressing a sticker picks it and dragging moves it (one undo step at the
8554
+ * drop); pressing anywhere else places the active brush's first stamp there, at its tip size and
8555
+ * the paint colour, and picks it.
8556
+ */
8557
+ stickerDown(e) {
8558
+ const p = this.doc(e);
8559
+ try {
8560
+ const hit = this.controller.stickerAt(void 0, p.x, p.y);
8561
+ if (hit) {
8562
+ this.controller.selectSticker(hit.id);
8563
+ this.mode = { kind: "sticker", pointerId: e.pointerId, id: hit.id, dx: hit.x - p.x, dy: hit.y - p.y, at: null };
8564
+ return true;
8565
+ }
8566
+ const brush = this.controller.getState().brush;
8567
+ const size = Math.min(2048, Math.max(2, Math.round(brush.tip.size)));
8568
+ const [added] = this.controller.addStickers(void 0, [{ stamp: _nullishCoalesce(brush.sticker.stamps[0], () => ( "star")), x: round2(p.x), y: round2(p.y), size }]);
8569
+ this.controller.selectSticker(added.id);
8570
+ } catch (err) {
8571
+ this.error = err instanceof Error ? err.message : String(err);
8572
+ }
8573
+ return false;
8574
+ }
8397
8575
  pick(e) {
8398
8576
  const p = this.doc(e);
8399
8577
  const { width, height } = this.controller.document.canvas;
@@ -8416,6 +8594,16 @@ var PaintGesture = (_class11 = class {
8416
8594
  this.controller.setView({ rotation: r });
8417
8595
  return;
8418
8596
  }
8597
+ if (m.kind === "sticker") {
8598
+ const p = this.doc(e);
8599
+ m.at = { x: round2(p.x + m.dx), y: round2(p.y + m.dy) };
8600
+ try {
8601
+ this.controller.previewSticker(void 0, m.id, m.at);
8602
+ } catch (err) {
8603
+ this.error = err instanceof Error ? err.message : String(err);
8604
+ }
8605
+ return;
8606
+ }
8419
8607
  const session = this.controller.activeStroke;
8420
8608
  if (!session) return;
8421
8609
  const events = typeof e.getCoalescedEvents === "function" ? e.getCoalescedEvents() : [];
@@ -8429,12 +8617,21 @@ var PaintGesture = (_class11 = class {
8429
8617
  if (!m || m.pointerId !== e.pointerId) return;
8430
8618
  this.mode = null;
8431
8619
  this.predicted = [];
8432
- if (m.kind === "stroke") _optionalChain([this, 'access', _343 => _343.controller, 'access', _344 => _344.activeStroke, 'optionalAccess', _345 => _345.end, 'call', _346 => _346()]);
8620
+ if (m.kind === "stroke") _optionalChain([this, 'access', _353 => _353.controller, 'access', _354 => _354.activeStroke, 'optionalAccess', _355 => _355.end, 'call', _356 => _356()]);
8621
+ if (m.kind === "sticker" && m.at) {
8622
+ try {
8623
+ this.controller.updateSticker(void 0, m.id, m.at);
8624
+ } catch (err) {
8625
+ this.controller.cancelStickerPreview();
8626
+ this.error = err instanceof Error ? err.message : String(err);
8627
+ }
8628
+ }
8433
8629
  }
8434
8630
  cancel() {
8435
8631
  this.penDown = false;
8436
8632
  this.predicted = [];
8437
- if (_optionalChain([this, 'access', _347 => _347.mode, 'optionalAccess', _348 => _348.kind]) === "stroke") _optionalChain([this, 'access', _349 => _349.controller, 'access', _350 => _350.activeStroke, 'optionalAccess', _351 => _351.cancel, 'call', _352 => _352()]);
8633
+ if (_optionalChain([this, 'access', _357 => _357.mode, 'optionalAccess', _358 => _358.kind]) === "stroke") _optionalChain([this, 'access', _359 => _359.controller, 'access', _360 => _360.activeStroke, 'optionalAccess', _361 => _361.cancel, 'call', _362 => _362()]);
8634
+ if (_optionalChain([this, 'access', _363 => _363.mode, 'optionalAccess', _364 => _364.kind]) === "sticker") this.controller.cancelStickerPreview();
8438
8635
  this.mode = null;
8439
8636
  }
8440
8637
  get active() {
@@ -8455,6 +8652,7 @@ var PaintGesture = (_class11 = class {
8455
8652
  this.controller.setView({ zoom, pan: { x: px - (px - s.view.pan.x) * k, y: py - (py - s.view.pan.y) * k } });
8456
8653
  }
8457
8654
  }, _class11);
8655
+ var round2 = (v) => Math.round(v * 100) / 100;
8458
8656
  function handlePaintShortcut(controller, gesture, e) {
8459
8657
  const mod = e.ctrlKey || e.metaKey;
8460
8658
  const key = e.key.toLowerCase();
@@ -8495,13 +8693,13 @@ function handlePaintShortcut(controller, gesture, e) {
8495
8693
  return false;
8496
8694
  }
8497
8695
  var PaintCanvasPresenter = (_class12 = class {
8498
- constructor(controller) {;_class12.prototype.__init120.call(this);_class12.prototype.__init121.call(this);_class12.prototype.__init122.call(this);
8696
+ constructor(controller) {;_class12.prototype.__init122.call(this);_class12.prototype.__init123.call(this);_class12.prototype.__init124.call(this);
8499
8697
  this.controller = controller;
8500
8698
  }
8501
8699
 
8502
- __init120() {this.uploaded = /* @__PURE__ */ new Map()}
8503
- __init121() {this.scratch = null}
8504
- __init122() {this.size = ""}
8700
+ __init122() {this.uploaded = /* @__PURE__ */ new Map()}
8701
+ __init123() {this.scratch = null}
8702
+ __init124() {this.size = ""}
8505
8703
  /** Draws what changed into `ctx` (a canvas the size of the document); returns the tiles drawn. */
8506
8704
  render(ctx) {
8507
8705
  const { width, height } = this.controller.document.canvas;
@@ -8532,6 +8730,15 @@ function guideOverlay(controller) {
8532
8730
  const s = controller.getState();
8533
8731
  const size = s.document.canvas;
8534
8732
  const out = [];
8733
+ const layerId = s.document.activeLayerId;
8734
+ const picked = layerId && s.selectedSticker ? _optionalChain([s, 'access', _365 => _365.document, 'access', _366 => _366.stickers, 'optionalAccess', _367 => _367[layerId], 'optionalAccess', _368 => _368.find, 'call', _369 => _369((x) => x.id === s.selectedSticker)]) : void 0;
8735
+ if (picked) {
8736
+ const r = picked.size / 2 + 2;
8737
+ const a = picked.rotation * Math.PI / 180;
8738
+ const corner = (u, v) => ({ x: picked.x + (u * Math.cos(a) - v * Math.sin(a)) * r, y: picked.y + (u * Math.sin(a) + v * Math.cos(a)) * r });
8739
+ const box = [corner(-1, -1), corner(1, -1), corner(1, 1), corner(-1, 1)];
8740
+ for (let i = 0; i < 4; i++) out.push({ from: box[i], to: box[(i + 1) % 4], kind: "sticker" });
8741
+ }
8535
8742
  for (const st of s.guides.stencils) {
8536
8743
  if (!st.enabled) continue;
8537
8744
  const line = stencilOutline(st);
@@ -8568,7 +8775,7 @@ var PAPER_SLIDERS = [
8568
8775
  ];
8569
8776
  function readPath(obj, path) {
8570
8777
  let v = obj;
8571
- for (const k of path.split(".")) v = _optionalChain([v, 'optionalAccess', _353 => _353[k]]);
8778
+ for (const k of path.split(".")) v = _optionalChain([v, 'optionalAccess', _370 => _370[k]]);
8572
8779
  return typeof v === "number" ? v : 0;
8573
8780
  }
8574
8781
  function patchPath(obj, path, value) {
@@ -8592,7 +8799,7 @@ function renderColorWheel(size, wheel, inner = 0.64) {
8592
8799
  const dy = y + 0.5 - r;
8593
8800
  const d = Math.hypot(dx, dy) / r;
8594
8801
  if (d > 1 || d < inner) continue;
8595
- const [cr, cg, cb] = hsvToRgb(_chunkEUIDTZNQcjs.wheelToHue.call(void 0, wheelAngle(dx, dy), wheel), 1, 1);
8802
+ const [cr, cg, cb] = hsvToRgb(_chunk7PT4RJL5cjs.wheelToHue.call(void 0, wheelAngle(dx, dy), wheel), 1, 1);
8596
8803
  const i = (y * size + x) * 4;
8597
8804
  const edge = Math.min(1, (1 - d) * r, (d - inner) * r);
8598
8805
  data[i] = cr;
@@ -8606,7 +8813,7 @@ function renderColorWheel(size, wheel, inner = 0.64) {
8606
8813
  function wheelPick(dx, dy, wheel, color) {
8607
8814
  const [r, g, b] = parseHexColor(color);
8608
8815
  const { s, v } = rgbToHsv(r, g, b);
8609
- const [nr, ng, nb] = hsvToRgb(_chunkEUIDTZNQcjs.wheelToHue.call(void 0, wheelAngle(dx, dy), wheel), s || 1, v || 1);
8816
+ const [nr, ng, nb] = hsvToRgb(_chunk7PT4RJL5cjs.wheelToHue.call(void 0, wheelAngle(dx, dy), wheel), s || 1, v || 1);
8610
8817
  return rgbToHexColor(nr, ng, nb);
8611
8818
  }
8612
8819
  var BLEND_MENU_GROUPS = [
@@ -8690,7 +8897,7 @@ function brushEngineControls(brush) {
8690
8897
  impastoTool: true
8691
8898
  };
8692
8899
  case "wet": {
8693
- const tool = _nullishCoalesce(_optionalChain([brush, 'access', _354 => _354.wet, 'optionalAccess', _355 => _355.tool]), () => ( "paint"));
8900
+ const tool = _nullishCoalesce(_optionalChain([brush, 'access', _371 => _371.wet, 'optionalAccess', _372 => _372.tool]), () => ( "paint"));
8694
8901
  const sliders = tool === "paint" ? [
8695
8902
  { path: "wet.water", label: "Water", min: 0, max: 1, step: 0.01 },
8696
8903
  { path: "wet.pigment", label: "Pigment", min: 0, max: 1, step: 0.01 },
@@ -8823,7 +9030,7 @@ function startWetClock(controller, frame, cancel) {
8823
9030
  id = raf(loop);
8824
9031
  return () => {
8825
9032
  stopped = true;
8826
- _optionalChain([caf, 'optionalCall', _356 => _356(id)]);
9033
+ _optionalChain([caf, 'optionalCall', _373 => _373(id)]);
8827
9034
  };
8828
9035
  }
8829
9036
  function drawWaterOverlay(controller, ctx) {
@@ -9426,4 +9633,5 @@ function createPaintEditorDocument(controller, options = {}) {
9426
9633
 
9427
9634
 
9428
9635
 
9429
- exports.BLEND_MENU_GROUPS = BLEND_MENU_GROUPS; exports.BLEND_MODES = _chunkOLNIPTB3cjs.BLEND_MODES; exports.BRUSH_ID = _chunkGNZI3KYKcjs.BRUSH_ID; exports.BRUSH_ROTATIONS = _chunkGNZI3KYKcjs.BRUSH_ROTATIONS; exports.BRUSH_SLIDERS = BRUSH_SLIDERS; exports.BUILTIN_BRUSHES = _chunkGNZI3KYKcjs.BUILTIN_BRUSHES; exports.BristleStroke = _chunkGNZI3KYKcjs.BristleStroke; exports.DEFAULT_BEHAVIOR = _chunkGNZI3KYKcjs.DEFAULT_BEHAVIOR; exports.DEFAULT_BRISTLE = _chunkGNZI3KYKcjs.DEFAULT_BRISTLE; exports.DEFAULT_BRUSH_ID = _chunkGNZI3KYKcjs.DEFAULT_BRUSH_ID; exports.DEFAULT_DPI = DEFAULT_DPI; exports.DEFAULT_DYNAMICS = _chunkGNZI3KYKcjs.DEFAULT_DYNAMICS; exports.DEFAULT_FLOW = _chunkXFYLA3ZOcjs.DEFAULT_FLOW; exports.DEFAULT_IMPASTO = _chunkGNZI3KYKcjs.DEFAULT_IMPASTO; exports.DEFAULT_LIGHTING = DEFAULT_LIGHTING; exports.DEFAULT_MULTI_COLOR = _chunkGNZI3KYKcjs.DEFAULT_MULTI_COLOR; exports.DEFAULT_PAINT_GRADIENT = _chunkPQ3H2AANcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkPQ3H2AANcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PAPER = _chunkGNZI3KYKcjs.DEFAULT_PAPER; exports.DEFAULT_PARTICLE = _chunkGNZI3KYKcjs.DEFAULT_PARTICLE; exports.DEFAULT_STICKER = _chunkGNZI3KYKcjs.DEFAULT_STICKER; exports.DEFAULT_SWATCHES = DEFAULT_SWATCHES; exports.DEFAULT_VIEW = DEFAULT_VIEW; exports.DEFAULT_WET_BRUSH = _chunkGNZI3KYKcjs.DEFAULT_WET_BRUSH; exports.DEFAULT_WET_PARAMS = _chunkXFYLA3ZOcjs.DEFAULT_WET_PARAMS; exports.DryStroke = _chunkGNZI3KYKcjs.DryStroke; exports.GPU_LEAD = GPU_LEAD; exports.GRAIN_PATTERNS = _chunkPQ3H2AANcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkPQ3H2AANcjs.GRAIN_TILE; exports.HARMONY_KINDS = _chunkEUIDTZNQcjs.HARMONY_KINDS; exports.IDENTITY_AFFINE = IDENTITY_AFFINE; exports.IDENTITY_COPY = _chunkGNZI3KYKcjs.IDENTITY_COPY; exports.IMPASTO_TOOLS = _chunkGNZI3KYKcjs.IMPASTO_TOOLS; exports.IMPASTO_TOOL_LABELS = IMPASTO_TOOL_LABELS; exports.LIGHT_SLIDERS = LIGHT_SLIDERS; exports.LitCache = LitCache; exports.MAX_BRUSH_SIZE = _chunkPQ3H2AANcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_SIDE = MAX_CANVAS_SIDE; exports.MAX_COORDINATE = MAX_COORDINATE; exports.MAX_IMAGE_SIDE = MAX_IMAGE_SIDE; 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 = _chunkGNZI3KYKcjs.MULTI_COLOR_MODES; exports.MixingPad = MixingPad; exports.PAD_SAMPLE_SIZES = PAD_SAMPLE_SIZES; exports.PAINTERLY_BLEND_MODES = _chunkOLNIPTB3cjs.PAINTERLY_BLEND_MODES; exports.PAINT_BRUSH_CATEGORIES = _chunkGNZI3KYKcjs.PAINT_BRUSH_CATEGORIES; exports.PAINT_BRUSH_ENGINES = _chunkGNZI3KYKcjs.PAINT_BRUSH_ENGINES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_EFFECT_PLACES = PAINT_EFFECT_PLACES; exports.PAINT_FORMAT = PAINT_FORMAT; exports.PAINT_GRADIENT_FULL_SPEED = _chunkPQ3H2AANcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkPQ3H2AANcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkPQ3H2AANcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SCHEMA_VERSION = PAINT_SCHEMA_VERSION; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkPQ3H2AANcjs.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 = _chunkGNZI3KYKcjs.PAPER_FAMILIES; exports.PAPER_LIBRARY = _chunkGNZI3KYKcjs.PAPER_LIBRARY; exports.PAPER_NODE_ID = PAPER_NODE_ID; exports.PAPER_SLIDERS = PAPER_SLIDERS; exports.PAPER_TARGET = PAPER_TARGET; exports.PARTICLE_KINDS = _chunkGNZI3KYKcjs.PARTICLE_KINDS; exports.PARTICLE_KIND_LABELS = PARTICLE_KIND_LABELS; exports.PARTICLE_RENDERS = _chunkGNZI3KYKcjs.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 = _chunkPQ3H2AANcjs.PaintGradientSampler; exports.PaintPresence = PaintPresence; exports.PaintSourceError = _chunkPQ3H2AANcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaintWetLayers = PaintWetLayers; exports.PaperGrain = _chunkPQ3H2AANcjs.PaperGrain; exports.ParticleStroke = _chunkGNZI3KYKcjs.ParticleStroke; exports.PenDabWalker = _chunkGNZI3KYKcjs.PenDabWalker; exports.PenSmoother = _chunkGNZI3KYKcjs.PenSmoother; exports.PerspectiveSnapper = PerspectiveSnapper; exports.SNAP_DECIDE_DISTANCE = SNAP_DECIDE_DISTANCE; exports.STAMP_KINDS = _chunkGNZI3KYKcjs.STAMP_KINDS; exports.STAMP_LABELS = STAMP_LABELS; exports.STENCIL_KINDS = STENCIL_KINDS; exports.STENCIL_SHAPES = STENCIL_SHAPES; exports.STICKER_SLIDERS = STICKER_SLIDERS; exports.SYMMETRY_MODES = SYMMETRY_MODES; exports.StencilSnapper = StencilSnapper; exports.StickerSpray = _chunkGNZI3KYKcjs.StickerSpray; exports.TRACING_NODE_ID = TRACING_NODE_ID; exports.ThickStrokeDriver = ThickStrokeDriver; exports.TileableNoise = _chunkPQ3H2AANcjs.TileableNoise; exports.WET_FLOW_KINDS = _chunkXFYLA3ZOcjs.WET_FLOW_KINDS; exports.WET_GPU_MODES = WET_GPU_MODES; exports.WET_GPU_OPTIONS = WET_GPU_OPTIONS; exports.WET_MEDIA = _chunkGNZI3KYKcjs.WET_MEDIA; exports.WET_MEDIUM_LABELS = WET_MEDIUM_LABELS; exports.WET_MEDIUM_PARAMS = WET_MEDIUM_PARAMS; exports.WET_PARAM_KEYS = _chunkXFYLA3ZOcjs.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 = _chunkGNZI3KYKcjs.WET_TOOLS; exports.WET_TOOL_LABELS = WET_TOOL_LABELS; exports.WetStrokeDriver = WetStrokeDriver; exports.addPaintGradientStop = _chunkPQ3H2AANcjs.addPaintGradientStop; exports.affineCopy = affineCopy; exports.applyAffine = applyAffine; exports.brushEngineControls = brushEngineControls; exports.brushLoadColor = brushLoadColor; exports.brushLoadForStroke = brushLoadForStroke; exports.brushTakesPaint = _chunkGNZI3KYKcjs.brushTakesPaint; exports.brushToJSON = _chunkGNZI3KYKcjs.brushToJSON; exports.buildTimeLapse = buildTimeLapse; exports.checkPaintEffectPlace = checkPaintEffectPlace; exports.clonePaper = _chunkGNZI3KYKcjs.clonePaper; exports.colorHarmony = colorHarmony2; exports.composeAffine = composeAffine; exports.contactSheet = contactSheet; exports.createPaintCompositor = createPaintCompositor; exports.createPaintDocument = createPaintDocument; exports.createPaintEditorDocument = createPaintEditorDocument; exports.createPaintEditorToolProvider = createPaintEditorToolProvider; exports.createPaintEffectsToolProvider = createPaintEffectsToolProvider; exports.createPaintLayer = createPaintLayer; exports.createPaintReplayTools = createPaintReplayTools; exports.createPaintStickerTools = createPaintStickerTools; exports.createPaintThickTools = createPaintThickTools; exports.createPaintWetTools = createPaintWetTools; exports.decodeImageBlob = decodeImageBlob; exports.defaultGuides = defaultGuides; exports.defaultImageEncoder = defaultImageEncoder; exports.deserializePaintDocument = deserializePaintDocument; exports.deserializePaintDocumentAsync = deserializePaintDocumentAsync; exports.documentExtensions = documentExtensions; exports.documentToScreen = documentToScreen; exports.downloadBytes = downloadBytes; exports.downsampleRgba = downsampleRgba; exports.drawSticker = _chunkGNZI3KYKcjs.drawSticker; exports.drawWaterOverlay = drawWaterOverlay; exports.effectLayersToJSON = effectLayersToJSON; exports.effectPaintKey = _chunkGNZI3KYKcjs.effectPaintKey; exports.emptiedLayers = emptiedLayers; exports.emptyThickChannels = emptyThickChannels; exports.fitZoom = fitZoom; exports.grainCatch = _chunkPQ3H2AANcjs.grainCatch; exports.grainHeights = _chunkPQ3H2AANcjs.grainHeights; exports.guideOverlay = guideOverlay; exports.handlePaintShortcut = handlePaintShortcut; exports.hash2 = _chunkPQ3H2AANcjs.hash2; exports.hexToPaintRgb = _chunkPQ3H2AANcjs.hexToPaintRgb; exports.hexToRgb8 = _chunkGNZI3KYKcjs.hexToRgb8; exports.hslToRgb = hslToRgb; exports.hsvToRgb = hsvToRgb; exports.hueToWheel = _chunkEUIDTZNQcjs.hueToWheel; exports.invertAffine = invertAffine; exports.isBlendMode = _chunkOLNIPTB3cjs.isBlendMode; exports.isGradientPaint = _chunkPQ3H2AANcjs.isGradientPaint; exports.isPaintEffectPaint = _chunkGNZI3KYKcjs.isPaintEffectPaint; exports.isPainterlyBlendMode = _chunkOLNIPTB3cjs.isPainterlyBlendMode; exports.isPalmTouch = isPalmTouch; exports.isWetBrush = _chunkGNZI3KYKcjs.isWetBrush; exports.isWetCapable = _chunkGNZI3KYKcjs.isWetCapable; exports.lightTile = lightTile; exports.lightingKey = lightingKey; exports.mapPenPoint = mapPenPoint; exports.mix32 = _chunkPQ3H2AANcjs.mix32; exports.mixPixels = mixPixels; exports.mixerLoadForStroke = mixerLoadForStroke; exports.mixerTip = _chunkGNZI3KYKcjs.mixerTip; exports.multiColorForDab = multiColorForDab; exports.multiColorGradient = multiColorGradient; exports.multiColorPalette = multiColorPalette; exports.multiColorSliders = multiColorSliders; exports.multiColorToPaint = _chunkGNZI3KYKcjs.multiColorToPaint; exports.newPaintLayerId = newPaintLayerId; exports.nextPaperEffectVersion = nextPaperEffectVersion; exports.normalizeBehavior = _chunkGNZI3KYKcjs.normalizeBehavior; exports.normalizeBristle = _chunkGNZI3KYKcjs.normalizeBristle; exports.normalizeBrushStroke = normalizeBrushStroke; exports.normalizeCanvas = normalizeCanvas; exports.normalizeDynamics = _chunkGNZI3KYKcjs.normalizeDynamics; exports.normalizeFlow = _chunkXFYLA3ZOcjs.normalizeFlow; exports.normalizeHexColor = _chunkPQ3H2AANcjs.normalizeHexColor; exports.normalizeImpasto = _chunkGNZI3KYKcjs.normalizeImpasto; exports.normalizeLighting = normalizeLighting; exports.normalizeMultiColor = _chunkGNZI3KYKcjs.normalizeMultiColor; exports.normalizePaintBrush = _chunkGNZI3KYKcjs.normalizePaintBrush; exports.normalizePaper = _chunkGNZI3KYKcjs.normalizePaper; exports.normalizeParticle = _chunkGNZI3KYKcjs.normalizeParticle; exports.normalizePerspective = normalizePerspective; exports.normalizeRotation = normalizeRotation; exports.normalizeStencil = normalizeStencil; exports.normalizeStickerSettings = _chunkGNZI3KYKcjs.normalizeStickerSettings; exports.normalizeStickerUpdate = _chunkGNZI3KYKcjs.normalizeStickerUpdate; exports.normalizeSymmetry = normalizeSymmetry; exports.normalizeView = normalizeView; exports.normalizeWetBrush = _chunkGNZI3KYKcjs.normalizeWetBrush; exports.normalizeWetParams = _chunkXFYLA3ZOcjs.normalizeWetParams; exports.overPixels = overPixels; exports.padSampleRadius = padSampleRadius; exports.paintGradientMappingFor = _chunkPQ3H2AANcjs.paintGradientMappingFor; exports.paintPlaybackPanel = paintPlaybackPanel; exports.paintSourceColor = _chunkPQ3H2AANcjs.paintSourceColor; exports.paintSourceCss = _chunkPQ3H2AANcjs.paintSourceCss; exports.paintToMultiColor = _chunkGNZI3KYKcjs.paintToMultiColor; exports.paperEffectFromJSON = paperEffectFromJSON; exports.paperEffectToJSON = paperEffectToJSON; exports.paperGrain = paperGrain; exports.paperKey = paperKey; exports.paperNode = paperNode; exports.paperPreset = _chunkGNZI3KYKcjs.paperPreset; exports.parseBrushLibrary = _chunkGNZI3KYKcjs.parseBrushLibrary; exports.parseHexColor = parseHexColor; exports.parsePaintSource = _chunkPQ3H2AANcjs.parsePaintSource; exports.patchBrushValue = patchBrushValue; exports.patchPath = patchPath; exports.penOrientation = _chunkGNZI3KYKcjs.penOrientation; exports.perspectiveDirections = perspectiveDirections; exports.perspectiveGuideLines = perspectiveGuideLines; exports.planPaintToolPlayback = planPaintToolPlayback; exports.pointerToPenPoint = pointerToPenPoint; exports.quickStencil = quickStencil; exports.rand01 = _chunkPQ3H2AANcjs.rand01; exports.randSigned = _chunkPQ3H2AANcjs.randSigned; exports.readPaintEffectPaint = _chunkGNZI3KYKcjs.readPaintEffectPaint; exports.readPaintEffectSource = readPaintEffectSource; exports.readPaintSource = _chunkPQ3H2AANcjs.readPaintSource; exports.readPath = readPath; exports.readSwatch = readSwatch; exports.reliefInfo = reliefInfo; exports.removePaintGradientStop = _chunkPQ3H2AANcjs.removePaintGradientStop; exports.renderBrushThumbnail = renderBrushThumbnail; exports.renderColorWheel = renderColorWheel; exports.renderPaper = _chunkGNZI3KYKcjs.renderPaper; exports.renderStickers = _chunkGNZI3KYKcjs.renderStickers; exports.replayFrame = replayFrame; exports.replayItems = replayItems; exports.replayPainting = replayPainting; exports.resolvePaintGradient = _chunkPQ3H2AANcjs.resolvePaintGradient; exports.reversePaintGradient = _chunkPQ3H2AANcjs.reversePaintGradient; exports.rgbToHexColor = rgbToHexColor; exports.rgbToHsl = rgbToHsl; exports.rgbToHsv = rgbToHsv; exports.sampleEffectAt = _chunkGNZI3KYKcjs.sampleEffectAt; exports.sampleEffectField = _chunkGNZI3KYKcjs.sampleEffectField; exports.samplePressure = samplePressure; exports.scalePaintGradient = _chunkPQ3H2AANcjs.scalePaintGradient; exports.scaleStencil = scaleStencil; exports.screenToDocument = screenToDocument; exports.seedFromString = _chunkPQ3H2AANcjs.seedFromString; exports.serializePaintDocument = serializePaintDocument; exports.serializePaintDocumentExternal = serializePaintDocumentExternal; exports.solidPaint = _chunkPQ3H2AANcjs.solidPaint; exports.stampCoverage = _chunkGNZI3KYKcjs.stampCoverage; exports.standardBlendMode = _chunkOLNIPTB3cjs.standardBlendMode; exports.startWetClock = startWetClock; exports.stencilMask = stencilMask; exports.stencilOutline = stencilOutline; exports.stickerRect = _chunkGNZI3KYKcjs.stickerRect; exports.stickerSurface = _chunkGNZI3KYKcjs.stickerSurface; exports.strokeBounds = strokeBounds; exports.strokeDuration = strokeDuration; exports.strokeSchedule = strokeSchedule; exports.sweepPath = sweepPath; exports.symmetryAxisAngles = symmetryAxisAngles; exports.symmetryAxisSegments = symmetryAxisSegments; exports.symmetryCopies = symmetryCopies; exports.thickFromJSON = thickFromJSON; exports.thickToJSON = thickToJSON; exports.thumbnailStroke = thumbnailStroke; exports.tiltToOrientation = _chunkGNZI3KYKcjs.tiltToOrientation; exports.timeLapseVideo = timeLapseVideo; exports.timeLapseZip = timeLapseZip; exports.toStrokePoint = _chunkGNZI3KYKcjs.toStrokePoint; exports.toggleStamp = toggleStamp; exports.translateStencil = translateStencil; exports.updatePaintGradientStop = _chunkPQ3H2AANcjs.updatePaintGradientStop; exports.usesPaintExchange = _chunkGNZI3KYKcjs.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 = _chunkXFYLA3ZOcjs.wetSupport; exports.wheelAngle = wheelAngle; exports.wheelPick = wheelPick; exports.wheelPoint = wheelPoint; exports.wheelToHue = _chunkEUIDTZNQcjs.wheelToHue; exports.withPaintPlayback = withPaintPlayback;
9636
+
9637
+ exports.BLEND_MENU_GROUPS = BLEND_MENU_GROUPS; exports.BLEND_MODES = _chunkOLNIPTB3cjs.BLEND_MODES; exports.BRUSH_ID = _chunkNKTNLJUJcjs.BRUSH_ID; exports.BRUSH_ROTATIONS = _chunkNKTNLJUJcjs.BRUSH_ROTATIONS; exports.BRUSH_SLIDERS = BRUSH_SLIDERS; exports.BUILTIN_BRUSHES = _chunkNKTNLJUJcjs.BUILTIN_BRUSHES; exports.BristleStroke = _chunkNKTNLJUJcjs.BristleStroke; exports.DEFAULT_BEHAVIOR = _chunkNKTNLJUJcjs.DEFAULT_BEHAVIOR; exports.DEFAULT_BRISTLE = _chunkNKTNLJUJcjs.DEFAULT_BRISTLE; exports.DEFAULT_BRUSH_ID = _chunkNKTNLJUJcjs.DEFAULT_BRUSH_ID; exports.DEFAULT_DPI = DEFAULT_DPI; exports.DEFAULT_DYNAMICS = _chunkNKTNLJUJcjs.DEFAULT_DYNAMICS; exports.DEFAULT_FLOW = _chunkXFYLA3ZOcjs.DEFAULT_FLOW; exports.DEFAULT_IMPASTO = _chunkNKTNLJUJcjs.DEFAULT_IMPASTO; exports.DEFAULT_LIGHTING = DEFAULT_LIGHTING; exports.DEFAULT_MULTI_COLOR = _chunkNKTNLJUJcjs.DEFAULT_MULTI_COLOR; exports.DEFAULT_PAINT_GRADIENT = _chunkPQ3H2AANcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkPQ3H2AANcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PAPER = _chunkNKTNLJUJcjs.DEFAULT_PAPER; exports.DEFAULT_PARTICLE = _chunkNKTNLJUJcjs.DEFAULT_PARTICLE; exports.DEFAULT_STICKER = _chunkNKTNLJUJcjs.DEFAULT_STICKER; exports.DEFAULT_SWATCHES = DEFAULT_SWATCHES; exports.DEFAULT_VIEW = DEFAULT_VIEW; exports.DEFAULT_WET_BRUSH = _chunkNKTNLJUJcjs.DEFAULT_WET_BRUSH; exports.DEFAULT_WET_PARAMS = _chunkXFYLA3ZOcjs.DEFAULT_WET_PARAMS; exports.DryStroke = _chunkNKTNLJUJcjs.DryStroke; exports.GPU_LEAD = GPU_LEAD; exports.GRAIN_PATTERNS = _chunkPQ3H2AANcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkPQ3H2AANcjs.GRAIN_TILE; exports.HARMONY_KINDS = _chunk7PT4RJL5cjs.HARMONY_KINDS; exports.IDENTITY_AFFINE = IDENTITY_AFFINE; exports.IDENTITY_COPY = _chunkNKTNLJUJcjs.IDENTITY_COPY; exports.IMPASTO_TOOLS = _chunkNKTNLJUJcjs.IMPASTO_TOOLS; exports.IMPASTO_TOOL_LABELS = IMPASTO_TOOL_LABELS; exports.LIGHT_SLIDERS = LIGHT_SLIDERS; exports.LitCache = LitCache; exports.MAX_BRUSH_SIZE = _chunkPQ3H2AANcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_SIDE = MAX_CANVAS_SIDE; exports.MAX_COORDINATE = MAX_COORDINATE; exports.MAX_IMAGE_SIDE = MAX_IMAGE_SIDE; 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 = _chunkNKTNLJUJcjs.MULTI_COLOR_MODES; exports.MixingPad = MixingPad; exports.PAD_SAMPLE_SIZES = PAD_SAMPLE_SIZES; exports.PAINTERLY_BLEND_MODES = _chunkOLNIPTB3cjs.PAINTERLY_BLEND_MODES; exports.PAINT_BRUSH_CATEGORIES = _chunkNKTNLJUJcjs.PAINT_BRUSH_CATEGORIES; exports.PAINT_BRUSH_ENGINES = _chunkNKTNLJUJcjs.PAINT_BRUSH_ENGINES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_EFFECT_PLACES = PAINT_EFFECT_PLACES; exports.PAINT_FORMAT = PAINT_FORMAT; exports.PAINT_GRADIENT_FULL_SPEED = _chunkPQ3H2AANcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkPQ3H2AANcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkPQ3H2AANcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SCHEMA_VERSION = PAINT_SCHEMA_VERSION; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkPQ3H2AANcjs.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 = _chunkNKTNLJUJcjs.PAPER_FAMILIES; exports.PAPER_LIBRARY = _chunkNKTNLJUJcjs.PAPER_LIBRARY; exports.PAPER_NODE_ID = PAPER_NODE_ID; exports.PAPER_SLIDERS = PAPER_SLIDERS; exports.PAPER_TARGET = PAPER_TARGET; exports.PARTICLE_KINDS = _chunkNKTNLJUJcjs.PARTICLE_KINDS; exports.PARTICLE_KIND_LABELS = PARTICLE_KIND_LABELS; exports.PARTICLE_RENDERS = _chunkNKTNLJUJcjs.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 = _chunkPQ3H2AANcjs.PaintGradientSampler; exports.PaintPresence = PaintPresence; exports.PaintSourceError = _chunkPQ3H2AANcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaintWetLayers = PaintWetLayers; exports.PaperGrain = _chunkPQ3H2AANcjs.PaperGrain; exports.ParticleStroke = _chunkNKTNLJUJcjs.ParticleStroke; exports.PenDabWalker = _chunkNKTNLJUJcjs.PenDabWalker; exports.PenSmoother = _chunkNKTNLJUJcjs.PenSmoother; exports.PerspectiveSnapper = PerspectiveSnapper; exports.SNAP_DECIDE_DISTANCE = SNAP_DECIDE_DISTANCE; exports.STAMP_KINDS = _chunkNKTNLJUJcjs.STAMP_KINDS; exports.STAMP_LABELS = STAMP_LABELS; exports.STENCIL_KINDS = STENCIL_KINDS; exports.STENCIL_SHAPES = STENCIL_SHAPES; exports.STICKER_SLIDERS = STICKER_SLIDERS; exports.SYMMETRY_MODES = SYMMETRY_MODES; exports.StencilSnapper = StencilSnapper; exports.StickerSpray = _chunkNKTNLJUJcjs.StickerSpray; exports.TRACING_NODE_ID = TRACING_NODE_ID; exports.ThickStrokeDriver = ThickStrokeDriver; exports.TileableNoise = _chunkPQ3H2AANcjs.TileableNoise; exports.WET_FLOW_KINDS = _chunkXFYLA3ZOcjs.WET_FLOW_KINDS; exports.WET_GPU_MODES = WET_GPU_MODES; exports.WET_GPU_OPTIONS = WET_GPU_OPTIONS; exports.WET_MEDIA = _chunkNKTNLJUJcjs.WET_MEDIA; exports.WET_MEDIUM_LABELS = WET_MEDIUM_LABELS; exports.WET_MEDIUM_PARAMS = WET_MEDIUM_PARAMS; exports.WET_PARAM_KEYS = _chunkXFYLA3ZOcjs.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 = _chunkNKTNLJUJcjs.WET_TOOLS; exports.WET_TOOL_LABELS = WET_TOOL_LABELS; exports.WetStrokeDriver = WetStrokeDriver; exports.addPaintGradientStop = _chunkPQ3H2AANcjs.addPaintGradientStop; exports.affineCopy = affineCopy; exports.applyAffine = applyAffine; exports.brushEngineControls = brushEngineControls; exports.brushLoadColor = brushLoadColor; exports.brushLoadForStroke = brushLoadForStroke; exports.brushTakesPaint = _chunkNKTNLJUJcjs.brushTakesPaint; exports.brushToJSON = _chunkNKTNLJUJcjs.brushToJSON; exports.buildTimeLapse = buildTimeLapse; exports.checkPaintEffectPlace = checkPaintEffectPlace; exports.clonePaper = _chunkNKTNLJUJcjs.clonePaper; exports.colorHarmony = colorHarmony2; exports.composeAffine = composeAffine; exports.contactSheet = contactSheet; exports.createPaintCompositor = createPaintCompositor; exports.createPaintDocument = createPaintDocument; exports.createPaintEditorDocument = createPaintEditorDocument; exports.createPaintEditorToolProvider = createPaintEditorToolProvider; exports.createPaintEffectsToolProvider = createPaintEffectsToolProvider; exports.createPaintLayer = createPaintLayer; exports.createPaintReplayTools = createPaintReplayTools; exports.createPaintStickerTools = createPaintStickerTools; exports.createPaintThickTools = createPaintThickTools; exports.createPaintWetTools = createPaintWetTools; exports.decodeImageBlob = decodeImageBlob; exports.defaultGuides = defaultGuides; exports.defaultImageEncoder = defaultImageEncoder; exports.deserializePaintDocument = deserializePaintDocument; exports.deserializePaintDocumentAsync = deserializePaintDocumentAsync; exports.documentExtensions = documentExtensions; exports.documentToScreen = documentToScreen; exports.downloadBytes = downloadBytes; exports.downsampleRgba = downsampleRgba; exports.drawSticker = _chunkNKTNLJUJcjs.drawSticker; exports.drawWaterOverlay = drawWaterOverlay; exports.effectLayersToJSON = effectLayersToJSON; exports.effectPaintKey = _chunkNKTNLJUJcjs.effectPaintKey; exports.emptiedLayers = emptiedLayers; exports.emptyThickChannels = emptyThickChannels; exports.fitZoom = fitZoom; exports.grainCatch = _chunkPQ3H2AANcjs.grainCatch; exports.grainHeights = _chunkPQ3H2AANcjs.grainHeights; exports.guideOverlay = guideOverlay; exports.handlePaintShortcut = handlePaintShortcut; exports.hash2 = _chunkPQ3H2AANcjs.hash2; exports.hexToPaintRgb = _chunkPQ3H2AANcjs.hexToPaintRgb; exports.hexToRgb8 = _chunkNKTNLJUJcjs.hexToRgb8; exports.hslToRgb = hslToRgb; exports.hsvToRgb = hsvToRgb; exports.hueToWheel = _chunk7PT4RJL5cjs.hueToWheel; exports.invertAffine = invertAffine; exports.isBlendMode = _chunkOLNIPTB3cjs.isBlendMode; exports.isGradientPaint = _chunkPQ3H2AANcjs.isGradientPaint; exports.isPaintEffectPaint = _chunkNKTNLJUJcjs.isPaintEffectPaint; exports.isPainterlyBlendMode = _chunkOLNIPTB3cjs.isPainterlyBlendMode; exports.isPalmTouch = isPalmTouch; exports.isWetBrush = _chunkNKTNLJUJcjs.isWetBrush; exports.isWetCapable = _chunkNKTNLJUJcjs.isWetCapable; exports.lightTile = lightTile; exports.lightingKey = lightingKey; exports.mapPenPoint = mapPenPoint; exports.mix32 = _chunkPQ3H2AANcjs.mix32; exports.mixPixels = mixPixels; exports.mixerLoadForStroke = mixerLoadForStroke; exports.mixerTip = _chunkNKTNLJUJcjs.mixerTip; exports.multiColorForDab = multiColorForDab; exports.multiColorGradient = multiColorGradient; exports.multiColorPalette = multiColorPalette; exports.multiColorSliders = multiColorSliders; exports.multiColorToPaint = _chunkNKTNLJUJcjs.multiColorToPaint; exports.newPaintLayerId = newPaintLayerId; exports.nextPaperEffectVersion = nextPaperEffectVersion; exports.normalizeBehavior = _chunkNKTNLJUJcjs.normalizeBehavior; exports.normalizeBristle = _chunkNKTNLJUJcjs.normalizeBristle; exports.normalizeBrushStroke = normalizeBrushStroke; exports.normalizeCanvas = normalizeCanvas; exports.normalizeDynamics = _chunkNKTNLJUJcjs.normalizeDynamics; exports.normalizeFlow = _chunkXFYLA3ZOcjs.normalizeFlow; exports.normalizeHexColor = _chunkPQ3H2AANcjs.normalizeHexColor; exports.normalizeImpasto = _chunkNKTNLJUJcjs.normalizeImpasto; exports.normalizeLighting = normalizeLighting; exports.normalizeMultiColor = _chunkNKTNLJUJcjs.normalizeMultiColor; exports.normalizePaintBrush = _chunkNKTNLJUJcjs.normalizePaintBrush; exports.normalizePaper = _chunkNKTNLJUJcjs.normalizePaper; exports.normalizeParticle = _chunkNKTNLJUJcjs.normalizeParticle; exports.normalizePerspective = normalizePerspective; exports.normalizeRotation = normalizeRotation; exports.normalizeStencil = normalizeStencil; exports.normalizeStickerSettings = _chunkNKTNLJUJcjs.normalizeStickerSettings; exports.normalizeStickerUpdate = _chunkNKTNLJUJcjs.normalizeStickerUpdate; exports.normalizeSymmetry = normalizeSymmetry; exports.normalizeView = normalizeView; exports.normalizeWetBrush = _chunkNKTNLJUJcjs.normalizeWetBrush; exports.normalizeWetParams = _chunkXFYLA3ZOcjs.normalizeWetParams; exports.overPixels = overPixels; exports.padSampleRadius = padSampleRadius; exports.paintGradientMappingFor = _chunkPQ3H2AANcjs.paintGradientMappingFor; exports.paintPlaybackPanel = paintPlaybackPanel; exports.paintSourceColor = _chunkPQ3H2AANcjs.paintSourceColor; exports.paintSourceCss = _chunkPQ3H2AANcjs.paintSourceCss; exports.paintToMultiColor = _chunkNKTNLJUJcjs.paintToMultiColor; exports.paperEffectFromJSON = paperEffectFromJSON; exports.paperEffectToJSON = paperEffectToJSON; exports.paperGrain = paperGrain; exports.paperKey = paperKey; exports.paperNode = paperNode; exports.paperPreset = _chunkNKTNLJUJcjs.paperPreset; exports.parseBrushLibrary = _chunkNKTNLJUJcjs.parseBrushLibrary; exports.parseHexColor = parseHexColor; exports.parsePaintSource = _chunkPQ3H2AANcjs.parsePaintSource; exports.patchBrushValue = patchBrushValue; exports.patchPath = patchPath; exports.penOrientation = _chunkNKTNLJUJcjs.penOrientation; exports.perspectiveDirections = perspectiveDirections; exports.perspectiveGuideLines = perspectiveGuideLines; exports.planPaintToolPlayback = planPaintToolPlayback; exports.pointerToPenPoint = pointerToPenPoint; exports.quickStencil = quickStencil; exports.rand01 = _chunkPQ3H2AANcjs.rand01; exports.randSigned = _chunkPQ3H2AANcjs.randSigned; exports.readPaintEffectPaint = _chunkNKTNLJUJcjs.readPaintEffectPaint; exports.readPaintEffectSource = readPaintEffectSource; exports.readPaintSource = _chunkPQ3H2AANcjs.readPaintSource; exports.readPath = readPath; exports.readSwatch = readSwatch; exports.reliefInfo = reliefInfo; exports.removePaintGradientStop = _chunkPQ3H2AANcjs.removePaintGradientStop; exports.renderBrushThumbnail = renderBrushThumbnail; exports.renderColorWheel = renderColorWheel; exports.renderPaper = _chunkNKTNLJUJcjs.renderPaper; exports.renderStickers = _chunkNKTNLJUJcjs.renderStickers; exports.replayFrame = replayFrame; exports.replayItems = replayItems; exports.replayPainting = replayPainting; exports.resolvePaintGradient = _chunkPQ3H2AANcjs.resolvePaintGradient; exports.reversePaintGradient = _chunkPQ3H2AANcjs.reversePaintGradient; exports.rgbToHexColor = rgbToHexColor; exports.rgbToHsl = rgbToHsl; exports.rgbToHsv = rgbToHsv; exports.sampleEffectAt = _chunkNKTNLJUJcjs.sampleEffectAt; exports.sampleEffectField = _chunkNKTNLJUJcjs.sampleEffectField; exports.samplePressure = samplePressure; exports.scalePaintGradient = _chunkPQ3H2AANcjs.scalePaintGradient; exports.scaleStencil = scaleStencil; exports.screenToDocument = screenToDocument; exports.seedFromString = _chunkPQ3H2AANcjs.seedFromString; exports.serializePaintDocument = serializePaintDocument; exports.serializePaintDocumentExternal = serializePaintDocumentExternal; exports.solidPaint = _chunkPQ3H2AANcjs.solidPaint; exports.stampCoverage = _chunkNKTNLJUJcjs.stampCoverage; exports.standardBlendMode = _chunkOLNIPTB3cjs.standardBlendMode; exports.startWetClock = startWetClock; exports.stencilMask = stencilMask; exports.stencilOutline = stencilOutline; exports.stickerAt = _chunkNKTNLJUJcjs.stickerAt; exports.stickerRect = _chunkNKTNLJUJcjs.stickerRect; exports.stickerSurface = _chunkNKTNLJUJcjs.stickerSurface; exports.strokeBounds = strokeBounds; exports.strokeDuration = strokeDuration; exports.strokeSchedule = strokeSchedule; exports.sweepPath = sweepPath; exports.symmetryAxisAngles = symmetryAxisAngles; exports.symmetryAxisSegments = symmetryAxisSegments; exports.symmetryCopies = symmetryCopies; exports.thickFromJSON = thickFromJSON; exports.thickToJSON = thickToJSON; exports.thumbnailStroke = thumbnailStroke; exports.tiltToOrientation = _chunkNKTNLJUJcjs.tiltToOrientation; exports.timeLapseVideo = timeLapseVideo; exports.timeLapseZip = timeLapseZip; exports.toStrokePoint = _chunkNKTNLJUJcjs.toStrokePoint; exports.toggleStamp = toggleStamp; exports.translateStencil = translateStencil; exports.updatePaintGradientStop = _chunkPQ3H2AANcjs.updatePaintGradientStop; exports.usesPaintExchange = _chunkNKTNLJUJcjs.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 = _chunkXFYLA3ZOcjs.wetSupport; exports.wheelAngle = wheelAngle; exports.wheelPick = wheelPick; exports.wheelPoint = wheelPoint; exports.wheelToHue = _chunk7PT4RJL5cjs.wheelToHue; exports.withPaintPlayback = withPaintPlayback;