@pixerate/editor 0.134.0 → 0.136.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 (113) hide show
  1. package/dist/animation-editor/index.cjs +58 -55
  2. package/dist/animation-editor/index.cjs.map +1 -1
  3. package/dist/animation-editor/index.d.cts +8 -5
  4. package/dist/animation-editor/index.d.ts +8 -5
  5. package/dist/animation-editor/index.js +5 -2
  6. package/dist/animation-editor/index.js.map +1 -1
  7. package/dist/{bezier-J8i4uqSH.d.cts → bezier-CdccFsF8.d.cts} +1 -1
  8. package/dist/{bezier-lNEOp0Jx.d.ts → bezier-DG9qNZQV.d.ts} +1 -1
  9. package/dist/canvas/index.d.cts +10 -7
  10. package/dist/canvas/index.d.ts +10 -7
  11. package/dist/{chunk-Z2H7KECK.cjs → chunk-2R3UW57U.cjs} +13 -2
  12. package/dist/chunk-2R3UW57U.cjs.map +1 -0
  13. package/dist/{chunk-ESIWZMMK.js → chunk-6QQR4LKE.js} +2 -2
  14. package/dist/chunk-A3BVTI3G.js +150 -0
  15. package/dist/chunk-A3BVTI3G.js.map +1 -0
  16. package/dist/{chunk-T6TV6HY6.cjs → chunk-B2CUCM7Y.cjs} +36 -36
  17. package/dist/{chunk-T6TV6HY6.cjs.map → chunk-B2CUCM7Y.cjs.map} +1 -1
  18. package/dist/chunk-ECCXGELC.cjs +727 -0
  19. package/dist/chunk-ECCXGELC.cjs.map +1 -0
  20. package/dist/{chunk-OXSV64JX.js → chunk-G6IKY6PL.js} +4 -4
  21. package/dist/chunk-I52DRGGJ.js +727 -0
  22. package/dist/chunk-I52DRGGJ.js.map +1 -0
  23. package/dist/{chunk-6CTZAGZ2.js → chunk-ILYFOJUN.js} +56 -1
  24. package/dist/chunk-ILYFOJUN.js.map +1 -0
  25. package/dist/{chunk-YAFS2QFZ.cjs → chunk-JLGNZMUV.cjs} +82 -82
  26. package/dist/{chunk-YAFS2QFZ.cjs.map → chunk-JLGNZMUV.cjs.map} +1 -1
  27. package/dist/{chunk-7RJ6P7MI.js → chunk-KZXLZCQ7.js} +2 -2
  28. package/dist/{chunk-HHTCDFZC.js → chunk-MAHQC3SK.js} +13 -2
  29. package/dist/chunk-MAHQC3SK.js.map +1 -0
  30. package/dist/{chunk-FWEO3HSL.js → chunk-PQQF5KOW.js} +8 -8
  31. package/dist/chunk-Q6OUXEK3.cjs +150 -0
  32. package/dist/chunk-Q6OUXEK3.cjs.map +1 -0
  33. package/dist/{chunk-P3RQ5UJE.cjs → chunk-UTQKC66X.cjs} +4 -4
  34. package/dist/{chunk-P3RQ5UJE.cjs.map → chunk-UTQKC66X.cjs.map} +1 -1
  35. package/dist/{chunk-J3B45HTA.cjs → chunk-XB25WOC2.cjs} +6 -6
  36. package/dist/{chunk-J3B45HTA.cjs.map → chunk-XB25WOC2.cjs.map} +1 -1
  37. package/dist/{chunk-NVTHUPJ6.cjs → chunk-YT3JL7YM.cjs} +71 -16
  38. package/dist/chunk-YT3JL7YM.cjs.map +1 -0
  39. package/dist/effects/index.d.cts +7 -4
  40. package/dist/effects/index.d.ts +7 -4
  41. package/dist/{export-BGdT02aL.d.cts → export-BOheWw2R.d.cts} +13 -5
  42. package/dist/{export-Dng22YB8.d.ts → export-ByKKIA2S.d.ts} +13 -5
  43. package/dist/{export-KzubBKo7.d.cts → export-CEYeRQXH.d.cts} +1 -1
  44. package/dist/{export-DMeG6E06.d.ts → export-Ds7zgGD8.d.ts} +1 -1
  45. package/dist/extensions/index.cjs +3 -3
  46. package/dist/extensions/index.cjs.map +1 -1
  47. package/dist/extensions/index.js +2 -2
  48. package/dist/generation/index.cjs +150 -945
  49. package/dist/generation/index.cjs.map +1 -1
  50. package/dist/generation/index.d.cts +3 -423
  51. package/dist/generation/index.d.ts +3 -423
  52. package/dist/generation/index.js +59 -854
  53. package/dist/generation/index.js.map +1 -1
  54. package/dist/grammar/index.cjs +3 -3
  55. package/dist/grammar/index.cjs.map +1 -1
  56. package/dist/grammar/index.js +2 -2
  57. package/dist/{helpers-Coa4e2j_.d.ts → helpers--ns3W2D7.d.ts} +7 -1
  58. package/dist/{helpers-DHl28yLO.d.cts → helpers-BVkU4oUi.d.cts} +7 -1
  59. package/dist/image-editor/index.cjs +742 -647
  60. package/dist/image-editor/index.cjs.map +1 -1
  61. package/dist/image-editor/index.d.cts +29 -11
  62. package/dist/image-editor/index.d.ts +29 -11
  63. package/dist/image-editor/index.js +107 -12
  64. package/dist/image-editor/index.js.map +1 -1
  65. package/dist/index.cjs +28 -28
  66. package/dist/index.cjs.map +1 -1
  67. package/dist/index.js +36 -36
  68. package/dist/{opentype-Dfcx6wFx.d.ts → opentype-DfoVYgmG.d.ts} +1 -1
  69. package/dist/{opentype-BWR7Qv8W.d.cts → opentype-yi-Kz4ND.d.cts} +1 -1
  70. package/dist/paint/index.cjs +10 -2
  71. package/dist/paint/index.cjs.map +1 -1
  72. package/dist/paint/index.d.cts +2 -2
  73. package/dist/paint/index.d.ts +2 -2
  74. package/dist/paint/index.js +9 -1
  75. package/dist/paint-editor/index.cjs +10 -7
  76. package/dist/paint-editor/index.cjs.map +1 -1
  77. package/dist/paint-editor/index.d.cts +10 -7
  78. package/dist/paint-editor/index.d.ts +10 -7
  79. package/dist/paint-editor/index.js +5 -2
  80. package/dist/paint-editor/index.js.map +1 -1
  81. package/dist/{pathfinder-D8KQ6blQ.d.cts → pathfinder-7JkMwYvC.d.cts} +1 -1
  82. package/dist/{pathfinder-Celbi3e6.d.ts → pathfinder-GM3UWdBZ.d.ts} +1 -1
  83. package/dist/{pool-BfuxBKTd.d.cts → pool-04qp8iW4.d.cts} +1 -1
  84. package/dist/{pool-8JZGWHvR.d.ts → pool-CkTxlLMC.d.ts} +1 -1
  85. package/dist/provenance-DmlcgdzT.d.cts +426 -0
  86. package/dist/provenance-uh5r2TQ8.d.ts +426 -0
  87. package/dist/{rand-BaqEOs1Y.d.ts → rand-BszBST4s.d.ts} +31 -1
  88. package/dist/{rand-DdpFzCo6.d.cts → rand-DOH_aMvm.d.cts} +31 -1
  89. package/dist/{svg-pwXWq6s2.d.cts → svg-BDDKvWWY.d.cts} +2 -2
  90. package/dist/{svg-CxxqG3_W.d.ts → svg-rV6_HPmn.d.ts} +2 -2
  91. package/dist/{tools-3EBjR91b.d.cts → tools-BAjSbTdY.d.cts} +1 -1
  92. package/dist/{tools-y1M6O3UT.d.ts → tools-DPYerqeR.d.ts} +1 -1
  93. package/dist/vector/index.cjs +2684 -1860
  94. package/dist/vector/index.cjs.map +1 -1
  95. package/dist/vector/index.d.cts +313 -71
  96. package/dist/vector/index.d.ts +313 -71
  97. package/dist/vector/index.js +4700 -3876
  98. package/dist/vector/index.js.map +1 -1
  99. package/dist/video-editor/index.d.cts +7 -4
  100. package/dist/video-editor/index.d.ts +7 -4
  101. package/dist/{warp-Ceqdz7kj.d.cts → warp-DQh9R7Ie.d.cts} +1 -1
  102. package/dist/{warp-C1gwu2G_.d.ts → warp-XVL6SpSh.d.ts} +1 -1
  103. package/package.json +1 -1
  104. package/skills/pixerate-image-editor/SKILL.md +4 -4
  105. package/skills/pixerate-vector/SKILL.md +20 -1
  106. package/dist/chunk-6CTZAGZ2.js.map +0 -1
  107. package/dist/chunk-HHTCDFZC.js.map +0 -1
  108. package/dist/chunk-NVTHUPJ6.cjs.map +0 -1
  109. package/dist/chunk-Z2H7KECK.cjs.map +0 -1
  110. /package/dist/{chunk-ESIWZMMK.js.map → chunk-6QQR4LKE.js.map} +0 -0
  111. /package/dist/{chunk-OXSV64JX.js.map → chunk-G6IKY6PL.js.map} +0 -0
  112. /package/dist/{chunk-7RJ6P7MI.js.map → chunk-KZXLZCQ7.js.map} +0 -0
  113. /package/dist/{chunk-FWEO3HSL.js.map → chunk-PQQF5KOW.js.map} +0 -0
@@ -363,7 +363,7 @@ var _chunk2OJACTPRcjs = require('../chunk-2OJACTPR.cjs');
363
363
 
364
364
 
365
365
 
366
- var _chunkYAFS2QFZcjs = require('../chunk-YAFS2QFZ.cjs');
366
+ var _chunkJLGNZMUVcjs = require('../chunk-JLGNZMUV.cjs');
367
367
 
368
368
 
369
369
  var _chunk2YQONY6Gcjs = require('../chunk-2YQONY6G.cjs');
@@ -471,7 +471,11 @@ var _chunkMUUXNRU4cjs = require('../chunk-MUUXNRU4.cjs');
471
471
 
472
472
 
473
473
 
474
- var _chunkNVTHUPJ6cjs = require('../chunk-NVTHUPJ6.cjs');
474
+
475
+
476
+
477
+
478
+ var _chunkYT3JL7YMcjs = require('../chunk-YT3JL7YM.cjs');
475
479
 
476
480
 
477
481
 
@@ -806,7 +810,8 @@ var _chunk643B2HKCcjs = require('../chunk-643B2HKC.cjs');
806
810
 
807
811
 
808
812
 
809
- var _chunkZ2H7KECKcjs = require('../chunk-Z2H7KECK.cjs');
813
+ var _chunk2R3UW57Ucjs = require('../chunk-2R3UW57U.cjs');
814
+ require('../chunk-Q6OUXEK3.cjs');
810
815
  require('../chunk-BJTCSLF6.cjs');
811
816
  require('../chunk-IZ4WRXZA.cjs');
812
817
 
@@ -818,6 +823,8 @@ require('../chunk-IZ4WRXZA.cjs');
818
823
 
819
824
  var _chunkJODTP4DPcjs = require('../chunk-JODTP4DP.cjs');
820
825
  require('../chunk-RIWPYSKU.cjs');
826
+ require('../chunk-FD4LPFAE.cjs');
827
+ require('../chunk-MKA3AHLV.cjs');
821
828
  require('../chunk-MR3Z4OQI.cjs');
822
829
  require('../chunk-A6PHCAGX.cjs');
823
830
 
@@ -924,7 +931,7 @@ function quickMaskPixels(mask, style = {}) {
924
931
 
925
932
  // src/image-editor/layers/render.ts
926
933
  function isQuarterTurn(rotate) {
927
- return _chunkYAFS2QFZcjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
934
+ return _chunkJLGNZMUVcjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
928
935
  }
929
936
  function isIntegerRect(r) {
930
937
  return Number.isInteger(r.x) && Number.isInteger(r.y) && Number.isInteger(r.width) && Number.isInteger(r.height);
@@ -932,7 +939,7 @@ function isIntegerRect(r) {
932
939
  function baseProjection(region, transform, baseW, baseH) {
933
940
  return {
934
941
  region,
935
- angle: _chunkYAFS2QFZcjs.normalizeAngle.call(void 0, transform.rotate),
942
+ angle: _chunkJLGNZMUVcjs.normalizeAngle.call(void 0, transform.rotate),
936
943
  flipH: transform.flipH,
937
944
  flipV: transform.flipV,
938
945
  scale: 1,
@@ -941,14 +948,14 @@ function baseProjection(region, transform, baseW, baseH) {
941
948
  };
942
949
  }
943
950
  function projectQuarterTurn(src, srcRect, region, transform) {
944
- const rotated = _chunkYAFS2QFZcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
951
+ const rotated = _chunkJLGNZMUVcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
945
952
  const w = Math.max(1, Math.round(rotated.width));
946
953
  const h = Math.max(1, Math.round(rotated.height));
947
954
  const out = new Uint8ClampedArray(w * h * 4);
948
955
  const p = baseProjection(region, transform, w, h);
949
- const o = _chunkYAFS2QFZcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
950
- const ox = _chunkYAFS2QFZcjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
951
- const oy = _chunkYAFS2QFZcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
956
+ const o = _chunkJLGNZMUVcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
957
+ const ox = _chunkJLGNZMUVcjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
958
+ const oy = _chunkJLGNZMUVcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
952
959
  const ux = Math.round(ox.x - o.x);
953
960
  const vx = Math.round(ox.y - o.y);
954
961
  const uy = Math.round(oy.x - o.x);
@@ -977,23 +984,23 @@ function applyOutputStage(img, opacity, legacyOutputBlur) {
977
984
  const d = img.data;
978
985
  for (let i = 3; i < d.length; i += 4) d[i] = d[i] * opacity;
979
986
  }
980
- if (legacyOutputBlur && legacyOutputBlur > 0) _chunkYAFS2QFZcjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
987
+ if (legacyOutputBlur && legacyOutputBlur > 0) _chunkJLGNZMUVcjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
981
988
  }
982
989
  function needsLegacyBase(input) {
983
990
  const { stack, region, canvas, transform } = input;
984
- if (!_chunkYAFS2QFZcjs.isLegacyShape.call(void 0, stack)) return false;
991
+ if (!_chunkJLGNZMUVcjs.isLegacyShape.call(void 0, stack)) return false;
985
992
  const bg = stack.layers[0];
986
993
  if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) return true;
987
994
  if (_optionalChain([bg, 'access', _2 => _2.mask, 'optionalAccess', _3 => _3.source, 'optionalAccess', _4 => _4.enabled]) && bg.mask.source.maskSource) return true;
988
995
  if (stack.outputOpacity < 1) return true;
989
- const blur = _chunkYAFS2QFZcjs.blurFilter.call(void 0, bg);
996
+ const blur = _chunkJLGNZMUVcjs.blurFilter.call(void 0, bg);
990
997
  if (blur && blur.enabled && blur.radius > 0) {
991
998
  const full = region.x === 0 && region.y === 0 && region.width === canvas.width && region.height === canvas.height;
992
- const angle = _chunkYAFS2QFZcjs.normalizeAngle.call(void 0, transform.rotate);
999
+ const angle = _chunkJLGNZMUVcjs.normalizeAngle.call(void 0, transform.rotate);
993
1000
  if (!full || angle === 90 || angle === 270) return true;
994
1001
  }
995
1002
  if ((_nullishCoalesce(stack.legacyOutputBlur, () => ( 0))) > 0 && !input.sourceOpaque) return true;
996
- if (_chunkYAFS2QFZcjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
1003
+ if (_chunkJLGNZMUVcjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
997
1004
  return false;
998
1005
  }
999
1006
  var isPlainAnnotation = (l) => l.type === "annotation" ? l.opacity === 1 && l.blend === "normal" && !l.clipped && !l.mask : (l.type === "shape" || l.type === "type") && Boolean(l.annotation) && l.opacity === 1 && l.blend === (_nullishCoalesce(l.annotation.blend, () => ( "normal"))) && !l.clipped && !l.mask && !l.effects && (_nullishCoalesce(l.fillOpacity, () => ( 1))) === 1;
@@ -1025,7 +1032,7 @@ function coveringRect(region) {
1025
1032
  const y = Math.floor(region.y);
1026
1033
  return { x, y, width: Math.ceil(region.x + region.width) - x, height: Math.ceil(region.y + region.height) - y };
1027
1034
  }
1028
- function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunkYAFS2QFZcjs.LayerCompositor)()) {
1035
+ function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunkJLGNZMUVcjs.LayerCompositor)()) {
1029
1036
  if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) {
1030
1037
  throw new Error("renderLayeredBase needs an integer region and a quarter-turn rotation.");
1031
1038
  }
@@ -1159,8 +1166,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1159
1166
  * The viewport's compositor. It only ever composites the viewport's stack, so its tile cache can
1160
1167
  * trust dirty rectangles; exports use `exportCompositor`.
1161
1168
  */
1162
- __init8() {this.compositor = new (0, _chunkYAFS2QFZcjs.LayerCompositor)()}
1163
- __init9() {this.exportCompositor = new (0, _chunkYAFS2QFZcjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
1169
+ __init8() {this.compositor = new (0, _chunkJLGNZMUVcjs.LayerCompositor)()}
1170
+ __init9() {this.exportCompositor = new (0, _chunkJLGNZMUVcjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
1164
1171
  /** How the host resolves layer pixels (set by the controller). */
1165
1172
 
1166
1173
  /**
@@ -1237,9 +1244,9 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1237
1244
  return;
1238
1245
  }
1239
1246
  const isActivelyCropping = Boolean(options.showCropOverlay || state.activeTool === "crop");
1240
- const projection = _chunkYAFS2QFZcjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
1247
+ const projection = _chunkJLGNZMUVcjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
1241
1248
  const { region } = projection;
1242
- const rotated = _chunkYAFS2QFZcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1249
+ const rotated = _chunkJLGNZMUVcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1243
1250
  const route = this.chooseRoute(state, region, naturalWidth, naturalHeight);
1244
1251
  let overlay = annotations;
1245
1252
  if (route === "legacy") {
@@ -1249,8 +1256,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1249
1256
  `${naturalWidth}x${naturalHeight}`,
1250
1257
  `${region.x},${region.y},${region.width},${region.height}`,
1251
1258
  `${projection.angle},${transform.flipH},${transform.flipV}`,
1252
- `${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunkYAFS2QFZcjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
1253
- _chunkYAFS2QFZcjs.adjustmentLayersKey.call(void 0, adjustments.layers),
1259
+ `${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunkJLGNZMUVcjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
1260
+ _chunkJLGNZMUVcjs.adjustmentLayersKey.call(void 0, adjustments.layers),
1254
1261
  `${depthMask.enabled},${depthMask.maskSource},${_optionalChain([depthMask, 'access', _5 => _5.depthRange, 'optionalAccess', _6 => _6[0]])}-${_optionalChain([depthMask, 'access', _7 => _7.depthRange, 'optionalAccess', _8 => _8[1]])},${depthMask.softness},${depthMask.invert},${depthMask.mode}`,
1255
1262
  `d${this.displayKey}`
1256
1263
  ].join("|");
@@ -1284,7 +1291,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1284
1291
  }
1285
1292
  if (overlay.length > 0 || options.draftAnnotation) {
1286
1293
  ctx.save();
1287
- _chunkYAFS2QFZcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1294
+ _chunkJLGNZMUVcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1288
1295
  ctx.beginPath();
1289
1296
  ctx.rect(region.x, region.y, region.width, region.height);
1290
1297
  ctx.clip();
@@ -1307,7 +1314,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1307
1314
  if (_optionalChain([state, 'access', _15 => _15.selection, 'optionalAccess', _16 => _16.bounds]) && display !== "none" || _optionalChain([options, 'access', _17 => _17.draftSelectionPath, 'optionalAccess', _18 => _18.length])) {
1308
1315
  ctx.save();
1309
1316
  try {
1310
- _chunkYAFS2QFZcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1317
+ _chunkJLGNZMUVcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1311
1318
  ctx.beginPath();
1312
1319
  ctx.rect(region.x, region.y, region.width, region.height);
1313
1320
  ctx.clip();
@@ -1322,7 +1329,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1322
1329
  const b = options.brushCursor;
1323
1330
  ctx.save();
1324
1331
  try {
1325
- _chunkYAFS2QFZcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1332
+ _chunkJLGNZMUVcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1326
1333
  const px2 = 1 / (projection.scale || 1);
1327
1334
  ctx.beginPath();
1328
1335
  ctx.arc(b.x, b.y, Math.max(px2, b.diameter / 2), 0, Math.PI * 2);
@@ -1337,7 +1344,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1337
1344
  ctx.restore();
1338
1345
  }
1339
1346
  if (options.cloneSourceMarker) {
1340
- const m = _chunkYAFS2QFZcjs.projectImagePoint.call(void 0, options.cloneSourceMarker, projection);
1347
+ const m = _chunkJLGNZMUVcjs.projectImagePoint.call(void 0, options.cloneSourceMarker, projection);
1341
1348
  ctx.save();
1342
1349
  try {
1343
1350
  const r = 7;
@@ -1361,7 +1368,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1361
1368
  const t = options.textEdit;
1362
1369
  ctx.save();
1363
1370
  try {
1364
- const scr = (p) => _chunkYAFS2QFZcjs.projectImagePoint.call(void 0, p, projection);
1371
+ const scr = (p) => _chunkJLGNZMUVcjs.projectImagePoint.call(void 0, p, projection);
1365
1372
  const poly = (pts) => {
1366
1373
  ctx.beginPath();
1367
1374
  pts.map(scr).forEach((p, i) => i ? ctx.lineTo(p.x, p.y) : ctx.moveTo(p.x, p.y));
@@ -1400,7 +1407,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1400
1407
  const t = options.freeTransform;
1401
1408
  ctx.save();
1402
1409
  try {
1403
- const scr = (p) => _chunkYAFS2QFZcjs.projectImagePoint.call(void 0, p, projection);
1410
+ const scr = (p) => _chunkJLGNZMUVcjs.projectImagePoint.call(void 0, p, projection);
1404
1411
  ctx.beginPath();
1405
1412
  if (t.warp) {
1406
1413
  for (const c of t.warp.curves) {
@@ -1458,7 +1465,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1458
1465
  }
1459
1466
  if (isActivelyCropping) {
1460
1467
  const activeCrop = options.draftCrop !== void 0 && options.draftCrop !== null ? options.draftCrop : _nullishCoalesce(crop, () => ( { x: 0, y: 0, width: naturalWidth, height: naturalHeight }));
1461
- this.drawCropOverlay(ctx, _chunkYAFS2QFZcjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
1468
+ this.drawCropOverlay(ctx, _chunkJLGNZMUVcjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
1462
1469
  }
1463
1470
  }
1464
1471
  /**
@@ -1467,7 +1474,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1467
1474
  */
1468
1475
  async renderBaseImage(img, naturalWidth, naturalHeight, region, transform, state, onPixels) {
1469
1476
  const { adjustments, depthMask } = state;
1470
- const rotated = _chunkYAFS2QFZcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1477
+ const rotated = _chunkJLGNZMUVcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1471
1478
  const baseW = Math.max(1, Math.round(rotated.width));
1472
1479
  const baseH = Math.max(1, Math.round(rotated.height));
1473
1480
  const baseCanvas = this.createCanvas(baseW, baseH);
@@ -1475,7 +1482,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1475
1482
  if (!baseCtx) return baseCanvas;
1476
1483
  const projection = getBaseProjection(region, transform, baseW, baseH);
1477
1484
  baseCtx.save();
1478
- _chunkYAFS2QFZcjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
1485
+ _chunkJLGNZMUVcjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
1479
1486
  baseCtx.drawImage(
1480
1487
  img,
1481
1488
  region.x,
@@ -1490,8 +1497,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1490
1497
  baseCtx.restore();
1491
1498
  const imageData = baseCtx.getImageData(0, 0, baseW, baseH);
1492
1499
  if (imageData) {
1493
- const layerMasks = _chunkYAFS2QFZcjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
1494
- _chunkYAFS2QFZcjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
1500
+ const layerMasks = _chunkJLGNZMUVcjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
1501
+ _chunkJLGNZMUVcjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
1495
1502
  if (depthMask.enabled && depthMask.maskSource) {
1496
1503
  try {
1497
1504
  const maskImg = await this.imageCache.get(depthMask.maskSource);
@@ -1502,7 +1509,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1502
1509
  const maskCtx = maskCanvas.getContext("2d");
1503
1510
  if (maskCtx) {
1504
1511
  maskCtx.save();
1505
- _chunkYAFS2QFZcjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
1512
+ _chunkJLGNZMUVcjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
1506
1513
  maskCtx.drawImage(
1507
1514
  maskImg,
1508
1515
  region.x * sx,
@@ -1517,7 +1524,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1517
1524
  maskCtx.restore();
1518
1525
  const maskData = maskCtx.getImageData(0, 0, baseW, baseH);
1519
1526
  if (maskData) {
1520
- _chunkYAFS2QFZcjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
1527
+ _chunkJLGNZMUVcjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
1521
1528
  }
1522
1529
  }
1523
1530
  } catch (e8) {
@@ -1536,7 +1543,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1536
1543
  else if (this.baseRoute === "layers") route = "layers";
1537
1544
  else {
1538
1545
  const stack = { layers: state.layers, outputOpacity: _nullishCoalesce(state.outputOpacity, () => ( 1)), legacyOutputBlur: state.legacyOutputBlur };
1539
- const shaped = this.baseRoute === "legacy" && _chunkYAFS2QFZcjs.isLegacyShape.call(void 0, stack);
1546
+ const shaped = this.baseRoute === "legacy" && _chunkJLGNZMUVcjs.isLegacyShape.call(void 0, stack);
1540
1547
  route = shaped || needsLegacyBase({
1541
1548
  stack,
1542
1549
  region,
@@ -1671,17 +1678,17 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1671
1678
  if (!comp) return null;
1672
1679
  const opacity = _nullishCoalesce(state.outputOpacity, () => ( 1));
1673
1680
  const blur = _nullishCoalesce(state.legacyOutputBlur, () => ( 0));
1674
- const rotated = _chunkYAFS2QFZcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1681
+ const rotated = _chunkJLGNZMUVcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1675
1682
  const baseW = Math.max(1, Math.round(rotated.width));
1676
1683
  const baseH = Math.max(1, Math.round(rotated.height));
1677
- const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkYAFS2QFZcjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
1684
+ const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkJLGNZMUVcjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
1678
1685
  if (this.cachedPostCanvas && this.cachedPostKey === key) return { canvas: this.cachedPostCanvas, histogram: this.cachedPostHistogram };
1679
1686
  const canvas = this.cachedPostCanvas && this.cachedPostCanvas.width === baseW && this.cachedPostCanvas.height === baseH ? this.cachedPostCanvas : this.createCanvas(baseW, baseH);
1680
1687
  const ctx = canvas.getContext("2d");
1681
1688
  if (!ctx) return null;
1682
1689
  ctx.clearRect(0, 0, baseW, baseH);
1683
1690
  ctx.save();
1684
- _chunkYAFS2QFZcjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
1691
+ _chunkJLGNZMUVcjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
1685
1692
  ctx.beginPath();
1686
1693
  ctx.rect(region.x, region.y, region.width, region.height);
1687
1694
  ctx.clip();
@@ -1953,7 +1960,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1953
1960
  ctx.strokeStyle = "#3b82f6";
1954
1961
  ctx.lineWidth = 1.5;
1955
1962
  ctx.setLineDash([4, 4]);
1956
- const bounds = _chunkYAFS2QFZcjs.getAnnotationBounds.call(void 0, ann);
1963
+ const bounds = _chunkJLGNZMUVcjs.getAnnotationBounds.call(void 0, ann);
1957
1964
  const pad = 4;
1958
1965
  ctx.strokeRect(bounds.x - pad, bounds.y - pad, bounds.width + pad * 2, bounds.height + pad * 2);
1959
1966
  ctx.fillStyle = "#ffffff";
@@ -1974,7 +1981,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1974
1981
  }
1975
1982
  /** @deprecated Use the standalone `getAnnotationBounds` from the geometry module. */
1976
1983
  getAnnotationBounds(ann) {
1977
- return _chunkYAFS2QFZcjs.getAnnotationBounds.call(void 0, ann);
1984
+ return _chunkJLGNZMUVcjs.getAnnotationBounds.call(void 0, ann);
1978
1985
  }
1979
1986
  /**
1980
1987
  * Draws a rule-of-thirds crop grid overlay. All rectangles come from
@@ -2056,8 +2063,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2056
2063
  }
2057
2064
  const { width: naturalWidth, height: naturalHeight } = getSourceSize(img);
2058
2065
  const { crop, transform, annotations } = state;
2059
- const region = crop ? _chunkYAFS2QFZcjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
2060
- const rotated = _chunkYAFS2QFZcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
2066
+ const region = crop ? _chunkJLGNZMUVcjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
2067
+ const rotated = _chunkJLGNZMUVcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
2061
2068
  const baseW = Math.max(1, Math.round(rotated.width));
2062
2069
  const baseH = Math.max(1, Math.round(rotated.height));
2063
2070
  const exportW = options.width || baseW;
@@ -2086,7 +2093,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2086
2093
  const bctx = baseCanvas.getContext("2d");
2087
2094
  if (bctx) {
2088
2095
  bctx.save();
2089
- _chunkYAFS2QFZcjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
2096
+ _chunkJLGNZMUVcjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
2090
2097
  bctx.beginPath();
2091
2098
  bctx.rect(region.x, region.y, region.width, region.height);
2092
2099
  bctx.clip();
@@ -2099,7 +2106,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2099
2106
  if (options.includeAnnotations !== false && overlay.length > 0) {
2100
2107
  ctx.save();
2101
2108
  ctx.scale(exportW / baseW, exportH / baseH);
2102
- _chunkYAFS2QFZcjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
2109
+ _chunkJLGNZMUVcjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
2103
2110
  for (const ann of overlay) {
2104
2111
  await this.drawAnnotation(ctx, ann);
2105
2112
  }
@@ -2189,7 +2196,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2189
2196
  case "rect":
2190
2197
  case "image":
2191
2198
  case "text": {
2192
- const b = _chunkYAFS2QFZcjs.getAnnotationBounds.call(void 0, ann);
2199
+ const b = _chunkJLGNZMUVcjs.getAnnotationBounds.call(void 0, ann);
2193
2200
  ctx.fillRect(b.x, b.y, b.width, b.height);
2194
2201
  break;
2195
2202
  }
@@ -2209,7 +2216,7 @@ function getSourceSize(img, fallbackW = 800, fallbackH = 600) {
2209
2216
  function getBaseProjection(region, transform, baseW, baseH) {
2210
2217
  return {
2211
2218
  region,
2212
- angle: _chunkYAFS2QFZcjs.normalizeAngle.call(void 0, transform.rotate),
2219
+ angle: _chunkJLGNZMUVcjs.normalizeAngle.call(void 0, transform.rotate),
2213
2220
  flipH: transform.flipH,
2214
2221
  flipV: transform.flipV,
2215
2222
  scale: 1,
@@ -2313,8 +2320,8 @@ function polygonCoverage(points, width, height, antiAlias = true) {
2313
2320
  }
2314
2321
  function toMask(width, height, coverage) {
2315
2322
  const out = new Uint8Array(coverage.length);
2316
- for (let i = 0; i < out.length; i++) out[i] = _chunkYAFS2QFZcjs.coverageToByte.call(void 0, coverage[i]);
2317
- return _chunkYAFS2QFZcjs.createSelectionMask.call(void 0, width, height, out);
2323
+ for (let i = 0; i < out.length; i++) out[i] = _chunkJLGNZMUVcjs.coverageToByte.call(void 0, coverage[i]);
2324
+ return _chunkJLGNZMUVcjs.createSelectionMask.call(void 0, width, height, out);
2318
2325
  }
2319
2326
  function polygonSelection(width, height, points, options = {}) {
2320
2327
  return toMask(width, height, polygonCoverage(points, width, height, _nullishCoalesce(options.antiAlias, () => ( true))));
@@ -2441,7 +2448,7 @@ function magicWand(pixels, seed, options = {}) {
2441
2448
  const { width: w, height: h } = pixels;
2442
2449
  const sx = Math.floor(seed.x);
2443
2450
  const sy = Math.floor(seed.y);
2444
- if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunkYAFS2QFZcjs.createSelectionMask.call(void 0, w, h);
2451
+ if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunkJLGNZMUVcjs.createSelectionMask.call(void 0, w, h);
2445
2452
  const similar = similarity(pixels, sy * w + sx, _nullishCoalesce(options.tolerance, () => ( 32)), _nullishCoalesce(options.distance, () => ( "rgb")));
2446
2453
  const marks = new Uint8Array(n);
2447
2454
  let bx0 = w;
@@ -2489,9 +2496,9 @@ function magicWand(pixels, seed, options = {}) {
2489
2496
  }
2490
2497
  }
2491
2498
  }
2492
- if (bx1 < 0) return _chunkYAFS2QFZcjs.createSelectionMask.call(void 0, w, h);
2493
- if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunkYAFS2QFZcjs.createSelectionMask.call(void 0, w, h, marks);
2494
- return _chunkYAFS2QFZcjs.createSelectionMask.call(void 0,
2499
+ if (bx1 < 0) return _chunkJLGNZMUVcjs.createSelectionMask.call(void 0, w, h);
2500
+ if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunkJLGNZMUVcjs.createSelectionMask.call(void 0, w, h, marks);
2501
+ return _chunkJLGNZMUVcjs.createSelectionMask.call(void 0,
2495
2502
  w,
2496
2503
  h,
2497
2504
  antialiasMarks(marks, w, h, Math.max(0, bx0 - 1), Math.max(0, by0 - 1), Math.min(w, bx1 + 2), Math.min(h, by1 + 2))
@@ -2513,7 +2520,7 @@ function colorRange(pixels, samples, options = {}) {
2513
2520
  const parsed = samples.map((s) => ({ c: sampleColor(s.color), at: s.at }));
2514
2521
  const radius = options.localized !== void 0 ? Math.max(1, options.localized) : void 0;
2515
2522
  const out = new Uint8Array(n);
2516
- if (!parsed.length) return _chunkYAFS2QFZcjs.createSelectionMask.call(void 0, w, h, out);
2523
+ if (!parsed.length) return _chunkJLGNZMUVcjs.createSelectionMask.call(void 0, w, h, out);
2517
2524
  for (let i = 0; i < n; i++) {
2518
2525
  const p = i * 4;
2519
2526
  if (data[p + 3] <= 0) continue;
@@ -2529,9 +2536,9 @@ function colorRange(pixels, samples, options = {}) {
2529
2536
  }
2530
2537
  if (k > best) best = k;
2531
2538
  }
2532
- out[i] = _chunkYAFS2QFZcjs.coverageToByte.call(void 0, best);
2539
+ out[i] = _chunkJLGNZMUVcjs.coverageToByte.call(void 0, best);
2533
2540
  }
2534
- return _chunkYAFS2QFZcjs.createSelectionMask.call(void 0, w, h, out);
2541
+ return _chunkJLGNZMUVcjs.createSelectionMask.call(void 0, w, h, out);
2535
2542
  }
2536
2543
  var TONE_RANGE_PRESETS = {
2537
2544
  shadows: [0, 65],
@@ -2549,9 +2556,9 @@ function toneRange(pixels, range, falloff = 20) {
2549
2556
  if (d[p + 3] <= 0) continue;
2550
2557
  const l = Math.min(255, Math.max(0, 0.299 * d[p] + 0.587 * d[p + 1] + 0.114 * d[p + 2]));
2551
2558
  const outside = l < lo ? lo - l : l > hi ? l - hi : 0;
2552
- out[i] = _chunkYAFS2QFZcjs.coverageToByte.call(void 0, 1 - outside / ramp);
2559
+ out[i] = _chunkJLGNZMUVcjs.coverageToByte.call(void 0, 1 - outside / ramp);
2553
2560
  }
2554
- return _chunkYAFS2QFZcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2561
+ return _chunkJLGNZMUVcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2555
2562
  }
2556
2563
  function hueRange(pixels, center) {
2557
2564
  const n = checkPixels(pixels);
@@ -2574,9 +2581,9 @@ function hueRange(pixels, center) {
2574
2581
  hue *= 60;
2575
2582
  let dh = ((hue - center) % 360 + 360) % 360;
2576
2583
  dh = Math.min(dh, 360 - dh);
2577
- out[i] = _chunkYAFS2QFZcjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
2584
+ out[i] = _chunkJLGNZMUVcjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
2578
2585
  }
2579
- return _chunkYAFS2QFZcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2586
+ return _chunkJLGNZMUVcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2580
2587
  }
2581
2588
 
2582
2589
  // src/image-editor/selection/refine.ts
@@ -2710,9 +2717,9 @@ function edgeWidth(guide, w, h, r) {
2710
2717
  g[yy * w + xx] = Math.sqrt(gx * gx + gy * gy);
2711
2718
  }
2712
2719
  }
2713
- const gm = _chunkYAFS2QFZcjs.greyMorphology.call(void 0, g, w, h, r, true);
2714
- const hi = _chunkYAFS2QFZcjs.greyMorphology.call(void 0, y, w, h, r, true);
2715
- const lo = _chunkYAFS2QFZcjs.greyMorphology.call(void 0, y, w, h, r, false);
2720
+ const gm = _chunkJLGNZMUVcjs.greyMorphology.call(void 0, g, w, h, r, true);
2721
+ const hi = _chunkJLGNZMUVcjs.greyMorphology.call(void 0, y, w, h, r, true);
2722
+ const lo = _chunkJLGNZMUVcjs.greyMorphology.call(void 0, y, w, h, r, false);
2716
2723
  const out = new Float32Array(n);
2717
2724
  for (let i = 0; i < n; i++) out[i] = (hi[i] - lo[i]) / Math.max(gm[i], 1e-4);
2718
2725
  return out;
@@ -2736,7 +2743,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
2736
2743
  }
2737
2744
  }
2738
2745
  if (any) {
2739
- const dist = _chunkYAFS2QFZcjs.distanceTransform.call(void 0, boundary, w, h);
2746
+ const dist = _chunkJLGNZMUVcjs.distanceTransform.call(void 0, boundary, w, h);
2740
2747
  const r = gfRadius(p);
2741
2748
  const q = guidedFilterColor(guide, m, w, h, r);
2742
2749
  const widths = p.smartRadius ? edgeWidth(guide, w, h, r) : null;
@@ -2762,7 +2769,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
2762
2769
  for (let i = 0; i < a.length; i++) a[i] = Math.min(1, Math.max(0, (a[i] - 0.5) * gain + 0.5));
2763
2770
  }
2764
2771
  const amount = shiftAmount(p);
2765
- if (Math.abs(amount) >= 1e-4) a = _chunkYAFS2QFZcjs.shiftCoverage.call(void 0, a, w, h, amount);
2772
+ if (Math.abs(amount) >= 1e-4) a = _chunkJLGNZMUVcjs.shiftCoverage.call(void 0, a, w, h, amount);
2766
2773
  return a;
2767
2774
  }
2768
2775
  function guidePlanes(pixels, win) {
@@ -2806,9 +2813,9 @@ function refineSelection(pixels, mask, params = {}) {
2806
2813
  const out = new Uint8Array(mask.width * mask.height);
2807
2814
  for (let y = 0; y < wh; y++) {
2808
2815
  const dst = (y0 + y) * mask.width + x0;
2809
- for (let x = 0; x < ww; x++) out[dst + x] = _chunkYAFS2QFZcjs.coverageToByte.call(void 0, refined[y * ww + x]);
2816
+ for (let x = 0; x < ww; x++) out[dst + x] = _chunkJLGNZMUVcjs.coverageToByte.call(void 0, refined[y * ww + x]);
2810
2817
  }
2811
- return _chunkYAFS2QFZcjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
2818
+ return _chunkJLGNZMUVcjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
2812
2819
  }
2813
2820
 
2814
2821
  // src/image-editor/effects.ts
@@ -2978,7 +2985,7 @@ var ImageEffectsEngine = (_class4 = class {
2978
2985
  // src/image-editor/free-transform.ts
2979
2986
  var FREE_TRANSFORM_CONTENTS = ["auto", "layer", "selection", "selection-copy", "selection-outline"];
2980
2987
  var fail = (message) => {
2981
- throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(message);
2988
+ throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(message);
2982
2989
  };
2983
2990
  var T = (x, y) => [1, 0, x, 0, 1, y, 0, 0, 1];
2984
2991
  function previewStep(scale) {
@@ -3087,7 +3094,7 @@ var FreeTransformSession = (_class5 = class {
3087
3094
  } else {
3088
3095
  const id = _nullishCoalesce(init.layerId, () => ( host.activeLayerId()));
3089
3096
  if (!id) fail("No layer given and none is active; pass layerId (see list_layers).");
3090
- const layer = _chunkYAFS2QFZcjs.requireLayer.call(void 0, layers, id).layer;
3097
+ const layer = _chunkJLGNZMUVcjs.requireLayer.call(void 0, layers, id).layer;
3091
3098
  this.layerId = layer.id;
3092
3099
  const mask = layer.mask && !layer.mask.source ? layer.mask : void 0;
3093
3100
  const channel = _nullishCoalesce(init.channel, () => ( (layer.id === host.activeLayerId() ? host.activeTarget() : "pixels")));
@@ -3098,20 +3105,20 @@ var FreeTransformSession = (_class5 = class {
3098
3105
  if (!maskAlone && layer.type !== "pixel" && layer.type !== "smart" && layer.type !== "shape" && layer.type !== "type") fail(`Layer "${layer.name || id}" is a ${layer.type} layer; Free Transform works on pixel, shape, type and smart object layers, layer masks (channel mask) and selections.`);
3099
3106
  if (!layer.visible && content !== "selection-copy") fail(`Layer "${layer.name || id}" is hidden; show it before you transform it.`);
3100
3107
  if (content !== "selection-copy") {
3101
- _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "position", "transform it");
3102
- if (!maskAlone) _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
3108
+ _chunkJLGNZMUVcjs.requireUnlocked.call(void 0, layer, "position", "transform it");
3109
+ if (!maskAlone) _chunkJLGNZMUVcjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
3103
3110
  }
3104
3111
  const o = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
3105
3112
  const pixels = layer.type === "pixel" ? host.pixelsOf(layer) : null;
3106
3113
  if (layer.type === "smart" && !maskAlone) {
3107
3114
  if (content !== "layer") fail(`Layer "${layer.name || id}" is a smart object, which transforms as a whole; use content layer (or rasterize it to transform part of it).`);
3108
- if (!_chunkYAFS2QFZcjs.isContentsDecoded.call(void 0, layer.contents)) fail(`The contents of "${layer.name || id}" are not decoded here, so it cannot be transformed; run prepareSmartObjects() first.`);
3115
+ if (!_chunkJLGNZMUVcjs.isContentsDecoded.call(void 0, layer.contents)) fail(`The contents of "${layer.name || id}" are not decoded here, so it cannot be transformed; run prepareSmartObjects() first.`);
3109
3116
  this.smart = layer;
3110
3117
  this.smartObject = true;
3111
- this.startGeometry = _chunkYAFS2QFZcjs.placementGeometry.call(void 0, layer);
3118
+ this.startGeometry = _chunkJLGNZMUVcjs.placementGeometry.call(void 0, layer);
3112
3119
  if (init.interpolation === void 0 && layer.placement.interpolation) this.interp = layer.placement.interpolation;
3113
3120
  this.startInterp = this.interp;
3114
- this.box = _chunkYAFS2QFZcjs.contentsBox.call(void 0, layer.contents);
3121
+ this.box = _chunkJLGNZMUVcjs.contentsBox.call(void 0, layer.contents);
3115
3122
  this.moves = mask && linked ? ["pixels", "mask"] : ["pixels"];
3116
3123
  this.geometryValue = this.startGeometry;
3117
3124
  this.shown = this.startLayers;
@@ -3119,8 +3126,8 @@ var FreeTransformSession = (_class5 = class {
3119
3126
  }
3120
3127
  if (layer.type === "type" && !maskAlone) {
3121
3128
  if (content !== "layer") fail(`Layer "${layer.name || id}" is a type layer, which transforms as a whole; use content layer (or rasterize it to transform part of it).`);
3122
- const frame = _chunkYAFS2QFZcjs.typeFrame.call(void 0, layer, host.textEnv().shaper);
3123
- const m = _chunkYAFS2QFZcjs.textMatrix.call(void 0, layer);
3129
+ const frame = _chunkJLGNZMUVcjs.typeFrame.call(void 0, layer, host.textEnv().shaper);
3130
+ const m = _chunkJLGNZMUVcjs.textMatrix.call(void 0, layer);
3124
3131
  const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
3125
3132
  this.typeTarget = layer;
3126
3133
  this.typeLayer = true;
@@ -3139,7 +3146,7 @@ var FreeTransformSession = (_class5 = class {
3139
3146
  }
3140
3147
  if (layer.type === "shape" && !maskAlone) {
3141
3148
  if (content !== "layer") fail(`Layer "${layer.name || id}" is a shape layer, which transforms as a whole; use content layer (or rasterize it to transform part of it).`);
3142
- const g = _chunkYAFS2QFZcjs.shapeGeometryBounds.call(void 0, layer);
3149
+ const g = _chunkJLGNZMUVcjs.shapeGeometryBounds.call(void 0, layer);
3143
3150
  if (!g) fail(`Shape layer "${layer.name || id}" has no path to transform.`);
3144
3151
  const w = Math.max(g.width, 1);
3145
3152
  const h = Math.max(g.height, 1);
@@ -3187,7 +3194,7 @@ var FreeTransformSession = (_class5 = class {
3187
3194
  if (box) {
3188
3195
  const copy = {
3189
3196
  type: "pixel",
3190
- id: _chunkYAFS2QFZcjs.newLayerId.call(void 0, ),
3197
+ id: _chunkJLGNZMUVcjs.newLayerId.call(void 0, ),
3191
3198
  name: `${layer.name || "Layer"} copy`,
3192
3199
  visible: true,
3193
3200
  opacity: 1,
@@ -3211,7 +3218,7 @@ var FreeTransformSession = (_class5 = class {
3211
3218
  if (!box) fail(content === "layer" ? "The layer has no pixels to transform." : "The selection holds no pixels of this layer; select some, or transform the outline (content selection-outline).");
3212
3219
  this.box = box;
3213
3220
  this.moves = moves;
3214
- this.startGeometry = _chunkYAFS2QFZcjs.identityTransform.call(void 0, box);
3221
+ this.startGeometry = _chunkJLGNZMUVcjs.identityTransform.call(void 0, box);
3215
3222
  this.startInterp = this.interp;
3216
3223
  this.geometryValue = this.startGeometry;
3217
3224
  this.shown = this.startLayers;
@@ -3289,8 +3296,8 @@ var FreeTransformSession = (_class5 = class {
3289
3296
  warp: changes.warp === void 0 ? _nullishCoalesce(this.geometryValue.warp, () => ( null)) : changes.warp
3290
3297
  };
3291
3298
  if (next.corners.length !== 4 || !next.corners.every((p) => Number.isFinite(p.x) && Number.isFinite(p.y))) fail("corners must be four finite points: top-left, top-right, bottom-right, bottom-left.");
3292
- if (!_chunkYAFS2QFZcjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
3293
- if (this.typeTarget && (_chunkYAFS2QFZcjs.hasWarp.call(void 0, next) || !_chunkYAFS2QFZcjs.matrixFromCorners.call(void 0, next.box, next.corners))) {
3299
+ if (!_chunkJLGNZMUVcjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
3300
+ if (this.typeTarget && (_chunkJLGNZMUVcjs.hasWarp.call(void 0, next) || !_chunkJLGNZMUVcjs.matrixFromCorners.call(void 0, next.box, next.corners))) {
3294
3301
  fail("Type layers take scale, rotate, skew and flips only (the corners must stay a parallelogram, no warp); rasterize the layer (rasterize_layer) for distort, perspective or warp.");
3295
3302
  }
3296
3303
  this.geometryValue = next;
@@ -3302,10 +3309,10 @@ var FreeTransformSession = (_class5 = class {
3302
3309
  if (this.smart) return { layers: this.resampleSmart(final, preview), selection: this.startSelection };
3303
3310
  if (this.typeTarget) return { layers: this.resampleType(), selection: this.startSelection };
3304
3311
  const g = this.geometryValue;
3305
- const identity = _chunkYAFS2QFZcjs.isIdentityTransform.call(void 0, g);
3306
- const warp = _chunkYAFS2QFZcjs.hasWarp.call(void 0, g);
3307
- const h = warp ? null : _chunkYAFS2QFZcjs.geometryHomography.call(void 0, g);
3308
- const f = warp ? _chunkYAFS2QFZcjs.transformMap.call(void 0, g) : null;
3312
+ const identity = _chunkJLGNZMUVcjs.isIdentityTransform.call(void 0, g);
3313
+ const warp = _chunkJLGNZMUVcjs.hasWarp.call(void 0, g);
3314
+ const h = warp ? null : _chunkJLGNZMUVcjs.geometryHomography.call(void 0, g);
3315
+ const f = warp ? _chunkJLGNZMUVcjs.transformMap.call(void 0, g) : null;
3309
3316
  const step = final ? 1 : previewStep(preview.scale);
3310
3317
  const interpolation = final ? this.interp : this.interp === "nearest" ? "nearest" : "bilinear";
3311
3318
  let layers = this.startLayers;
@@ -3349,7 +3356,7 @@ var FreeTransformSession = (_class5 = class {
3349
3356
  if (part.what === "selection") {
3350
3357
  const { width, height } = this.host.canvas();
3351
3358
  const data = new Uint8Array(_chunkJ5BA3BQ6cjs.readRegion.call(void 0, result, { x: 0, y: 0, width, height }).buffer);
3352
- const next = _chunkYAFS2QFZcjs.createSelectionMask.call(void 0, width, height, data);
3359
+ const next = _chunkJLGNZMUVcjs.createSelectionMask.call(void 0, width, height, data);
3353
3360
  selection = next.bounds ? next : null;
3354
3361
  } else if (part.what === "pixels") {
3355
3362
  layers = _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, targetId, (l) => {
@@ -3371,14 +3378,14 @@ var FreeTransformSession = (_class5 = class {
3371
3378
  resampleShape(final, preview, warpMap, h) {
3372
3379
  const layer = this.shape;
3373
3380
  let components = layer.components;
3374
- if (!_chunkYAFS2QFZcjs.isIdentityTransform.call(void 0, this.geometryValue)) {
3381
+ if (!_chunkJLGNZMUVcjs.isIdentityTransform.call(void 0, this.geometryValue)) {
3375
3382
  const affine = !warpMap && h && Math.abs(h[6]) < 1e-12 && Math.abs(h[7]) < 1e-12 && Math.abs(h[8] - 1) < 1e-12 ? [h[0], h[3], h[1], h[4], h[2], h[5]] : void 0;
3376
3383
  const map = _nullishCoalesce(warpMap, () => ( ((p) => h ? _chunkMUUXNRU4cjs.applyHomography.call(void 0, h, p) : p)));
3377
- components = _chunkYAFS2QFZcjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
3384
+ components = _chunkJLGNZMUVcjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
3378
3385
  }
3379
3386
  const moved = { ...layer, components };
3380
3387
  delete moved.annotation;
3381
- const surface = _chunkYAFS2QFZcjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
3388
+ const surface = _chunkJLGNZMUVcjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
3382
3389
  return _chunk24ATT2PEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => ({ ...moved, surface }));
3383
3390
  }
3384
3391
  /**
@@ -3388,13 +3395,13 @@ var FreeTransformSession = (_class5 = class {
3388
3395
  resampleType() {
3389
3396
  const layer = this.typeTarget;
3390
3397
  const g = this.geometryValue;
3391
- if (_chunkYAFS2QFZcjs.hasWarp.call(void 0, g)) fail("Type layers cannot be warped here; rasterize the layer first (rasterize_layer), or transform it with scale, rotate and skew.");
3392
- const m = _chunkYAFS2QFZcjs.matrixFromCorners.call(void 0, g.box, g.corners);
3398
+ if (_chunkJLGNZMUVcjs.hasWarp.call(void 0, g)) fail("Type layers cannot be warped here; rasterize the layer first (rasterize_layer), or transform it with scale, rotate and skew.");
3399
+ const m = _chunkJLGNZMUVcjs.matrixFromCorners.call(void 0, g.box, g.corners);
3393
3400
  if (!m) fail("Type layers take scale, rotate, skew and flips only (the corners must stay a parallelogram); rasterize the layer for distort or perspective.");
3394
3401
  const next = { ...layer, transform: m };
3395
3402
  delete next.annotation;
3396
- let layers = _chunk24ATT2PEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => _chunkYAFS2QFZcjs.rerenderText.call(void 0, next, this.host.textEnv()));
3397
- const change = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, _chunkZ2H7KECKcjs.invertMatrix.call(void 0, _chunkYAFS2QFZcjs.textMatrix.call(void 0, layer))), _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, m));
3403
+ let layers = _chunk24ATT2PEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => _chunkJLGNZMUVcjs.rerenderText.call(void 0, next, this.host.textEnv()));
3404
+ const change = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, _chunk2R3UW57Ucjs.invertMatrix.call(void 0, _chunkJLGNZMUVcjs.textMatrix.call(void 0, layer))), _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, m));
3398
3405
  for (const part of this.parts) {
3399
3406
  if (part.what !== "mask") continue;
3400
3407
  const surface = _chunk24ATT2PEcjs.transformSurface.call(void 0, part.moving, change, { interpolation: this.interp === "nearest" ? "nearest" : "bilinear" });
@@ -3410,12 +3417,12 @@ var FreeTransformSession = (_class5 = class {
3410
3417
  const canvas = this.host.canvas();
3411
3418
  try {
3412
3419
  if (final) {
3413
- const res = _chunkYAFS2QFZcjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
3420
+ const res = _chunkJLGNZMUVcjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
3414
3421
  this.smartMasksMoved = res.masksMoved;
3415
3422
  return res.layers;
3416
3423
  }
3417
3424
  const step = previewStep(preview.scale);
3418
- const surface = _chunkYAFS2QFZcjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
3425
+ const surface = _chunkJLGNZMUVcjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
3419
3426
  return _chunk24ATT2PEcjs.mapLayer.call(void 0, this.startLayers, layer.id, (l) => ({ ...l, placement, surface }));
3420
3427
  } catch (e) {
3421
3428
  if (e instanceof _chunk24ATT2PEcjs.TransformTooLargeError) fail(e.message);
@@ -3425,10 +3432,10 @@ var FreeTransformSession = (_class5 = class {
3425
3432
  /** Whether the geometry (or the interpolation of a smart object) differs from where it started. */
3426
3433
  isChanged() {
3427
3434
  const g = this.geometryValue;
3428
- if (!this.smart && !this.typeTarget) return !_chunkYAFS2QFZcjs.isIdentityTransform.call(void 0, g);
3435
+ if (!this.smart && !this.typeTarget) return !_chunkJLGNZMUVcjs.isIdentityTransform.call(void 0, g);
3429
3436
  const a = this.startGeometry;
3430
3437
  const same = g.corners.every((c, i) => Math.abs(c.x - a.corners[i].x) < 1e-9 && Math.abs(c.y - a.corners[i].y) < 1e-9);
3431
- const warp = (w, box) => w && _chunkYAFS2QFZcjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
3438
+ const warp = (w, box) => w && _chunkJLGNZMUVcjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
3432
3439
  return !same || warp(g.warp, g.box) !== warp(a.warp, a.box) || this.interp !== this.startInterp;
3433
3440
  }
3434
3441
  render(preview) {
@@ -3688,7 +3695,7 @@ function convertSurfaceColors(surface, t) {
3688
3695
  }
3689
3696
 
3690
3697
  // src/image-editor/controller.ts
3691
- var IMAGE_EDITOR_SCHEMA_VERSION = _chunkYAFS2QFZcjs.LAYERED_SCHEMA_VERSION;
3698
+ var IMAGE_EDITOR_SCHEMA_VERSION = _chunkJLGNZMUVcjs.LAYERED_SCHEMA_VERSION;
3692
3699
  var RETOUCH_TOOLS = ["clone", "heal", "spot-heal", "smudge", "dodge", "burn", "sponge", "blur", "sharpen", "history"];
3693
3700
  var isRetouchTool = (tool) => RETOUCH_TOOLS.includes(tool);
3694
3701
  var STROKE_TOOLS = ["brush", "eraser", "mixer", ...RETOUCH_TOOLS];
@@ -3744,7 +3751,7 @@ var PaintStrokeSession = (_class6 = class {
3744
3751
  this.stroke = null;
3745
3752
  this.retouch = stroke;
3746
3753
  if (this.base.channels === 1) {
3747
- const view = _chunkNVTHUPJ6cjs.rgbaViewOfGrey.call(void 0, this.mixerPixels());
3754
+ const view = _chunkYT3JL7YMcjs.rgbaViewOfGrey.call(void 0, this.mixerPixels());
3748
3755
  this.mixer = stroke.create(view.target);
3749
3756
  this.flushView = view.flush;
3750
3757
  } else this.mixer = stroke.create(this.mixerPixels());
@@ -3791,7 +3798,7 @@ var PaintStrokeSession = (_class6 = class {
3791
3798
  retouchDeepTile(key, tx, ty, paint, options) {
3792
3799
  const r = this.retouch;
3793
3800
  const read = this.readWork(key);
3794
- const out = _chunkNVTHUPJ6cjs.applyRetouchToTile.call(void 0, this.stroke.coverage, _nullishCoalesce(read, () => ( new Float32Array(_chunkJ5BA3BQ6cjs.TILE * _chunkJ5BA3BQ6cjs.TILE * 4))), 4, tx, ty, paint, r.apply, options);
3801
+ const out = _chunkYT3JL7YMcjs.applyRetouchToTile.call(void 0, this.stroke.coverage, _nullishCoalesce(read, () => ( new Float32Array(_chunkJ5BA3BQ6cjs.TILE * _chunkJ5BA3BQ6cjs.TILE * 4))), 4, tx, ty, paint, r.apply, options);
3795
3802
  this.work.set(key, out);
3796
3803
  const d = deepOfWorkTile(out, this.deep, read, this.base.tiles.get(key));
3797
3804
  this.liveDeep.set(key, d);
@@ -3801,7 +3808,7 @@ var PaintStrokeSession = (_class6 = class {
3801
3808
  /** The new tile of a coverage stroke over the pre-stroke tile `src`. */
3802
3809
  compositeTile(src, tx, ty, options = {}, paint) {
3803
3810
  const r = this.retouch;
3804
- if (r && r.kind === "coverage") return _chunkNVTHUPJ6cjs.applyRetouchToTile.call(void 0, this.stroke.coverage, src, this.base.channels, tx, ty, _nullishCoalesce(paint, () => ( r.paint())), r.apply, options);
3811
+ if (r && r.kind === "coverage") return _chunkYT3JL7YMcjs.applyRetouchToTile.call(void 0, this.stroke.coverage, src, this.base.channels, tx, ty, _nullishCoalesce(paint, () => ( r.paint())), r.apply, options);
3805
3812
  return _chunk6GFRKLLScjs.applyStrokeToTile.call(void 0, this.stroke.coverage, src, this.base.channels, tx, ty, this.apply, options);
3806
3813
  }
3807
3814
  /** The live pixels a mixer stroke reads and writes; base tiles are copied on first write. */
@@ -3882,7 +3889,7 @@ var PaintStrokeSession = (_class6 = class {
3882
3889
  for (const t of _chunkJ5BA3BQ6cjs.tilesInRect.call(void 0, { x: r.x - this.apply.offset.x, y: r.y - this.apply.offset.y, width: r.width, height: r.height })) {
3883
3890
  const key = _chunkJ5BA3BQ6cjs.tileKey.call(void 0, t.tx, t.ty);
3884
3891
  const cur = regions.get(key);
3885
- regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunkYAFS2QFZcjs.unionRect.call(void 0, cur.r, r) : r });
3892
+ regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunkJLGNZMUVcjs.unionRect.call(void 0, cur.r, r) : r });
3886
3893
  }
3887
3894
  }
3888
3895
  for (const [key, { tx, ty, r }] of regions) {
@@ -3899,7 +3906,7 @@ var PaintStrokeSession = (_class6 = class {
3899
3906
  const prev2 = this.touched.has(key) ? this.liveDeep.get(key) : void 0;
3900
3907
  this.touched.add(key);
3901
3908
  const opts = prev2 ? { into: prev2, region: r, channels: ch } : { channels: ch };
3902
- const d = _optionalChain([rt, 'optionalAccess', _98 => _98.kind]) === "coverage" && _optionalChain([paint, 'optionalAccess', _99 => _99.kind]) === "tone" ? _chunkNVTHUPJ6cjs.applyToneToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, paint.tone, rt.apply, opts) : _chunk6GFRKLLScjs.applyStrokeToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, this.apply, opts);
3909
+ const d = _optionalChain([rt, 'optionalAccess', _98 => _98.kind]) === "coverage" && _optionalChain([paint, 'optionalAccess', _99 => _99.kind]) === "tone" ? _chunkYT3JL7YMcjs.applyToneToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, paint.tone, rt.apply, opts) : _chunk6GFRKLLScjs.applyStrokeToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, this.apply, opts);
3903
3910
  this.liveDeep.set(key, d);
3904
3911
  this.live.set(key, { data: _chunkJ5BA3BQ6cjs.proxyOf.call(void 0, d, ch), uniform: null, deep: d });
3905
3912
  continue;
@@ -3914,7 +3921,7 @@ var PaintStrokeSession = (_class6 = class {
3914
3921
  }
3915
3922
  /** Finishes the stroke (one undo step) and returns what changed. */
3916
3923
  end() {
3917
- if (this.closed) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("This stroke has already ended.");
3924
+ if (this.closed) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("This stroke has already ended.");
3918
3925
  const last = _nullishCoalesce(this.last, () => ( void 0));
3919
3926
  const rects = this.mixer ? this.mixer.finish(last) : this.stroke.finish(last);
3920
3927
  _optionalChain([this, 'access', _109 => _109.flushView, 'optionalCall', _110 => _110()]);
@@ -4050,20 +4057,20 @@ function sameTile(a, b) {
4050
4057
  for (let i = 0; i < a.data.length; i++) if (a.data[i] !== b.data[i]) return false;
4051
4058
  return true;
4052
4059
  }
4053
- var DEFAULT_ADJUSTMENTS = _chunkYAFS2QFZcjs.DEFAULT_ADJUSTMENTS_VALUES;
4060
+ var DEFAULT_ADJUSTMENTS = _chunkJLGNZMUVcjs.DEFAULT_ADJUSTMENTS_VALUES;
4054
4061
  function normalizeStoredAdjustments(stored) {
4055
4062
  if (!stored) return { ...DEFAULT_ADJUSTMENTS };
4056
4063
  const out = {
4057
4064
  ...DEFAULT_ADJUSTMENTS,
4058
4065
  ...stored,
4059
- process: _chunkYAFS2QFZcjs.normalizeProcessVersion.call(void 0, stored.process)
4066
+ process: _chunkJLGNZMUVcjs.normalizeProcessVersion.call(void 0, stored.process)
4060
4067
  };
4061
- const layers = _chunkYAFS2QFZcjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
4068
+ const layers = _chunkJLGNZMUVcjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
4062
4069
  if (layers.length) out.layers = layers;
4063
4070
  else delete out.layers;
4064
4071
  return out;
4065
4072
  }
4066
- var isLayered = (data) => Boolean(data && data.version === _chunkYAFS2QFZcjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
4073
+ var isLayered = (data) => Boolean(data && data.version === _chunkJLGNZMUVcjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
4067
4074
  function migrateSerializedImageEditorState(data) {
4068
4075
  if (isLayered(data)) {
4069
4076
  const out = {
@@ -4095,10 +4102,10 @@ function migrateSerializedImageEditorState(data) {
4095
4102
  function migrateToLayeredState(data, size) {
4096
4103
  const clean = migrateSerializedImageEditorState(data);
4097
4104
  if (isLayered(clean)) return clean;
4098
- const stack = _chunkYAFS2QFZcjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
4099
- const { layers, assets } = _chunkYAFS2QFZcjs.serializeLayers.call(void 0, stack.layers);
4105
+ const stack = _chunkJLGNZMUVcjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
4106
+ const { layers, assets } = _chunkJLGNZMUVcjs.serializeLayers.call(void 0, stack.layers);
4100
4107
  const out = {
4101
- version: _chunkYAFS2QFZcjs.LAYERED_SCHEMA_VERSION,
4108
+ version: _chunkJLGNZMUVcjs.LAYERED_SCHEMA_VERSION,
4102
4109
  width: Math.round(size.width),
4103
4110
  height: Math.round(size.height),
4104
4111
  layers,
@@ -4112,8 +4119,8 @@ function migrateToLayeredState(data, size) {
4112
4119
  if (clean.selection) out.selection = clean.selection;
4113
4120
  return out;
4114
4121
  }
4115
- var DEFAULT_TRANSFORM = _chunkYAFS2QFZcjs.DEFAULT_TRANSFORM_VALUES;
4116
- var DEFAULT_DEPTH_MASK = _chunkYAFS2QFZcjs.DEFAULT_DEPTH_MASK_VALUES;
4122
+ var DEFAULT_TRANSFORM = _chunkJLGNZMUVcjs.DEFAULT_TRANSFORM_VALUES;
4123
+ var DEFAULT_DEPTH_MASK = _chunkJLGNZMUVcjs.DEFAULT_DEPTH_MASK_VALUES;
4117
4124
  var DEVELOP_KEYS = ["brightness", "contrast", "saturation", "exposure", "temperature", "tint"];
4118
4125
  var ImageEditorController = (_class7 = class {
4119
4126
 
@@ -4136,7 +4143,7 @@ var ImageEditorController = (_class7 = class {
4136
4143
  __init62() {this.sourceSurfaces = /* @__PURE__ */ new WeakMap()}
4137
4144
  __init63() {this.viewKey = []}
4138
4145
  /** For `compositePixels` and mask evaluation (the renderer keeps its own for the viewport). */
4139
- __init64() {this.compositor = new (0, _chunkYAFS2QFZcjs.LayerCompositor)()}
4146
+ __init64() {this.compositor = new (0, _chunkJLGNZMUVcjs.LayerCompositor)()}
4140
4147
  /** The effects provider slot (see `setEffectsProvider`). */
4141
4148
  __init65() {this.effects = new (0, _chunkJODTP4DPcjs.EffectsSlot)()}
4142
4149
  /** Renders provider effects: effect smart filter results and effect layers. */
@@ -4180,7 +4187,7 @@ var ImageEditorController = (_class7 = class {
4180
4187
  activeLayerId: null,
4181
4188
  activeTarget: "pixels",
4182
4189
  outputOpacity: 1,
4183
- paint: { brush: { ..._chunk6GFRKLLScjs.DEFAULT_BRUSH }, foreground: "#000000", background: "#ffffff", paint: { type: "color", color: "#000000" }, mixer: { ..._chunk6GFRKLLScjs.DEFAULT_MIXER }, mixerLoad: _chunk6GFRKLLScjs.EMPTY_MIXER_LOAD, retouch: { ..._chunkNVTHUPJ6cjs.DEFAULT_RETOUCH }, cloneSource: null },
4190
+ paint: { brush: { ..._chunk6GFRKLLScjs.DEFAULT_BRUSH }, foreground: "#000000", background: "#ffffff", paint: { type: "color", color: "#000000" }, mixer: { ..._chunk6GFRKLLScjs.DEFAULT_MIXER }, mixerLoad: _chunk6GFRKLLScjs.EMPTY_MIXER_LOAD, retouch: { ..._chunkYT3JL7YMcjs.DEFAULT_RETOUCH }, cloneSource: null, cloneTransform: { ..._chunkYT3JL7YMcjs.IDENTITY_CLONE_TRANSFORM } },
4184
4191
  fit: _nullishCoalesce(options.fit, () => ( "margin"))
4185
4192
  };
4186
4193
  if (options.image instanceof Object && "width" in options.image) {
@@ -4194,7 +4201,7 @@ var ImageEditorController = (_class7 = class {
4194
4201
  this.applyStored(_nullishCoalesce(options.initialState, () => ( {})));
4195
4202
  if (_optionalChain([options, 'access', _126 => _126.initialState, 'optionalAccess', _127 => _127.selection])) {
4196
4203
  try {
4197
- this.state.selection = normalizeSelection(_chunkYAFS2QFZcjs.deserializeSelection.call(void 0, options.initialState.selection));
4204
+ this.state.selection = normalizeSelection(_chunkJLGNZMUVcjs.deserializeSelection.call(void 0, options.initialState.selection));
4198
4205
  } catch (e15) {
4199
4206
  }
4200
4207
  }
@@ -4306,10 +4313,10 @@ var ImageEditorController = (_class7 = class {
4306
4313
  if (l.type === "group") {
4307
4314
  const children = walk(l.children);
4308
4315
  if (children !== l.children) next2 = { ...l, children };
4309
- } else if (l.type === "smart" && _optionalChain([l, 'access', _130 => _130.smartFilters, 'optionalAccess', _131 => _131.filters, 'access', _132 => _132.some, 'call', _133 => _133((f) => f.kind === "effect")]) && (all || _chunkYAFS2QFZcjs.isSmartSurfaceIncomplete.call(void 0, l.surface))) {
4316
+ } else if (l.type === "smart" && _optionalChain([l, 'access', _130 => _130.smartFilters, 'optionalAccess', _131 => _131.filters, 'access', _132 => _132.some, 'call', _133 => _133((f) => f.kind === "effect")]) && (all || _chunkJLGNZMUVcjs.isSmartSurfaceIncomplete.call(void 0, l.surface))) {
4310
4317
  try {
4311
- const r = _chunkYAFS2QFZcjs.rerender.call(void 0, l, canvas);
4312
- if (all || !_chunkYAFS2QFZcjs.isSmartSurfaceIncomplete.call(void 0, r.surface)) next2 = r;
4318
+ const r = _chunkJLGNZMUVcjs.rerender.call(void 0, l, canvas);
4319
+ if (all || !_chunkJLGNZMUVcjs.isSmartSurfaceIncomplete.call(void 0, r.surface)) next2 = r;
4313
4320
  } catch (e17) {
4314
4321
  }
4315
4322
  }
@@ -4365,19 +4372,19 @@ var ImageEditorController = (_class7 = class {
4365
4372
  const d = await this.describeEffect(effect, "filter");
4366
4373
  const values = _chunkJODTP4DPcjs.resolveEffectValues.call(void 0, d, options.values);
4367
4374
  const found = _chunk24ATT2PEcjs.findLayer.call(void 0, this.state.layers, layerId);
4368
- if (!found) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`There is no layer "${layerId}"; call list_layers for the layer ids.`);
4375
+ if (!found) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`There is no layer "${layerId}"; call list_layers for the layer ids.`);
4369
4376
  let layers = this.state.layers;
4370
4377
  let id = layerId;
4371
4378
  let converted = false;
4372
4379
  if (found.layer.type !== "smart") {
4373
- if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${found.layer.name || layerId}" is ${found.layer.type === "adjustment" ? "an adjustment layer" : "an annotation"}, which has no pixels to filter; apply the effect to a pixel layer or smart object.`);
4374
- const res2 = _chunkYAFS2QFZcjs.convertToSmartObject.call(void 0, layers, [layerId], this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l) });
4380
+ if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Layer "${found.layer.name || layerId}" is ${found.layer.type === "adjustment" ? "an adjustment layer" : "an annotation"}, which has no pixels to filter; apply the effect to a pixel layer or smart object.`);
4381
+ const res2 = _chunkJLGNZMUVcjs.convertToSmartObject.call(void 0, layers, [layerId], this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l) });
4375
4382
  layers = res2.layers;
4376
4383
  id = res2.layer.id;
4377
4384
  converted = true;
4378
4385
  }
4379
- const filter = _chunkYAFS2QFZcjs.normalizeSmartFilter.call(void 0, { kind: "effect", effect: d.id, provider: this.effects.require().id, name: d.name, values, enabled: options.enabled !== false, blend: options.blend, opacity: options.opacity });
4380
- const res = _chunkYAFS2QFZcjs.addSmartFilter.call(void 0, layers, id, filter, this.canvasSize, options.index);
4386
+ const filter = _chunkJLGNZMUVcjs.normalizeSmartFilter.call(void 0, { kind: "effect", effect: d.id, provider: this.effects.require().id, name: d.name, values, enabled: options.enabled !== false, blend: options.blend, opacity: options.opacity });
4387
+ const res = _chunkJLGNZMUVcjs.addSmartFilter.call(void 0, layers, id, filter, this.canvasSize, options.index);
4381
4388
  this.commitLayers(res.layers);
4382
4389
  return { layerId: id, filter: res.filter, converted };
4383
4390
  }
@@ -4388,9 +4395,9 @@ var ImageEditorController = (_class7 = class {
4388
4395
  * false, during a drag).
4389
4396
  */
4390
4397
  async updateEffectFilter(layerId, filterId, changes, commitToHistory = true) {
4391
- const layer = _chunkYAFS2QFZcjs.requireSmartObject.call(void 0, this.state.layers, layerId);
4398
+ const layer = _chunkJLGNZMUVcjs.requireSmartObject.call(void 0, this.state.layers, layerId);
4392
4399
  const was = _optionalChain([layer, 'access', _134 => _134.smartFilters, 'optionalAccess', _135 => _135.filters, 'access', _136 => _136.find, 'call', _137 => _137((f) => f.id === filterId)]);
4393
- if (!was || was.kind !== "effect") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Smart object "${layer.name || layerId}" has no effect filter "${filterId}"; its filters are ${(_nullishCoalesce(_optionalChain([layer, 'access', _138 => _138.smartFilters, 'optionalAccess', _139 => _139.filters]), () => ( []))).map((f) => `${f.id} (${f.kind === "effect" ? _nullishCoalesce(f.name, () => ( f.effect)) : f.kind})`).join(", ") || "none"}.`);
4400
+ if (!was || was.kind !== "effect") throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Smart object "${layer.name || layerId}" has no effect filter "${filterId}"; its filters are ${(_nullishCoalesce(_optionalChain([layer, 'access', _138 => _138.smartFilters, 'optionalAccess', _139 => _139.filters]), () => ( []))).map((f) => `${f.id} (${f.kind === "effect" ? _nullishCoalesce(f.name, () => ( f.effect)) : f.kind})`).join(", ") || "none"}.`);
4394
4401
  const update = {};
4395
4402
  if (changes.values) {
4396
4403
  const d = await this.describeEffect(was.effect);
@@ -4399,15 +4406,15 @@ var ImageEditorController = (_class7 = class {
4399
4406
  for (const [k, v] of Object.entries(changes.values)) {
4400
4407
  if (v !== null) given[k] = v;
4401
4408
  else if (k in d.controls.properties) base[k] = d.defaults[k];
4402
- else throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
4409
+ else throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
4403
4410
  }
4404
4411
  update.values = { ...base, ..._chunkJODTP4DPcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
4405
4412
  }
4406
4413
  for (const k of ["enabled", "blend", "opacity"]) if (changes[k] !== void 0) update[k] = changes[k];
4407
- let res = _chunkYAFS2QFZcjs.updateSmartFilter.call(void 0, this.state.layers, layerId, filterId, update, this.canvasSize);
4408
- if (changes.index !== void 0) res = { ...res, layers: _chunkYAFS2QFZcjs.moveSmartFilter.call(void 0, res.layers, layerId, filterId, changes.index, this.canvasSize).layers };
4414
+ let res = _chunkJLGNZMUVcjs.updateSmartFilter.call(void 0, this.state.layers, layerId, filterId, update, this.canvasSize);
4415
+ if (changes.index !== void 0) res = { ...res, layers: _chunkJLGNZMUVcjs.moveSmartFilter.call(void 0, res.layers, layerId, filterId, changes.index, this.canvasSize).layers };
4409
4416
  this.commitLayers(res.layers, void 0, commitToHistory);
4410
- return _chunkYAFS2QFZcjs.requireSmartObject.call(void 0, this.state.layers, layerId).smartFilters.filters.find((f) => f.id === filterId);
4417
+ return _chunkJLGNZMUVcjs.requireSmartObject.call(void 0, this.state.layers, layerId).smartFilters.filters.find((f) => f.id === filterId);
4411
4418
  }
4412
4419
  /**
4413
4420
  * Adds an effect layer: a pixel layer drawn by a provider generator, overlay or title effect at
@@ -4419,12 +4426,12 @@ var ImageEditorController = (_class7 = class {
4419
4426
  const values = _chunkJODTP4DPcjs.resolveEffectValues.call(void 0, d, options.values);
4420
4427
  const { width, height } = this.naturalSize;
4421
4428
  const pixels = await this.effectsEngine.renderLayer(d.id, values, { width, height, depth: this.bitDepth, time: options.time });
4422
- const blend = _chunkYAFS2QFZcjs.parseBlend.call(void 0, options.blend);
4423
- if (options.opacity !== void 0 && !(options.opacity >= 0 && options.opacity <= 1)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("opacity must be from 0 to 1.");
4429
+ const blend = _chunkJLGNZMUVcjs.parseBlend.call(void 0, options.blend);
4430
+ if (options.opacity !== void 0 && !(options.opacity >= 0 && options.opacity <= 1)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("opacity must be from 0 to 1.");
4424
4431
  const ids = new Set(_chunk24ATT2PEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
4425
4432
  const layer = {
4426
4433
  type: "pixel",
4427
- id: options.id && !ids.has(options.id) ? options.id : _chunkYAFS2QFZcjs.newLayerId.call(void 0, ),
4434
+ id: options.id && !ids.has(options.id) ? options.id : _chunkJLGNZMUVcjs.newLayerId.call(void 0, ),
4428
4435
  name: _optionalChain([options, 'access', _140 => _140.name, 'optionalAccess', _141 => _141.trim, 'call', _142 => _142()]) || d.name,
4429
4436
  visible: true,
4430
4437
  opacity: _nullishCoalesce(options.opacity, () => ( 1)),
@@ -4433,7 +4440,7 @@ var ImageEditorController = (_class7 = class {
4433
4440
  offset: { x: 0, y: 0 },
4434
4441
  generator: { effect: d.id, provider: this.effects.require().id, name: d.name, values, ...options.time ? { time: options.time } : {} }
4435
4442
  };
4436
- const next = _chunkYAFS2QFZcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(options));
4443
+ const next = _chunkJLGNZMUVcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(options));
4437
4444
  this.commitLayers(next, () => {
4438
4445
  this.state.activeLayerId = layer.id;
4439
4446
  this.state.activeTarget = "pixels";
@@ -4448,8 +4455,8 @@ var ImageEditorController = (_class7 = class {
4448
4455
  async updateEffectLayer(layerId, changes, commitToHistory = true) {
4449
4456
  const found = _chunk24ATT2PEcjs.findLayer.call(void 0, this.state.layers, layerId);
4450
4457
  const layer = _optionalChain([found, 'optionalAccess', _143 => _143.layer]);
4451
- if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`"${layerId}" is not an effect layer; add one with add_effect_layer.`);
4452
- _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "pixels", "draw its effect again");
4458
+ if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`"${layerId}" is not an effect layer; add one with add_effect_layer.`);
4459
+ _chunkJLGNZMUVcjs.requireUnlocked.call(void 0, layer, "pixels", "draw its effect again");
4453
4460
  const g = layer.generator;
4454
4461
  const d = await this.describeEffect(g.effect);
4455
4462
  const base = { ...g.values };
@@ -4457,7 +4464,7 @@ var ImageEditorController = (_class7 = class {
4457
4464
  for (const [k, v] of Object.entries(_nullishCoalesce(changes.values, () => ( {})))) {
4458
4465
  if (v !== null) given[k] = v;
4459
4466
  else if (k in d.controls.properties) base[k] = d.defaults[k];
4460
- else throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
4467
+ else throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
4461
4468
  }
4462
4469
  const values = { ...base, ..._chunkJODTP4DPcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
4463
4470
  const time = _nullishCoalesce(_nullishCoalesce(changes.time, () => ( g.time)), () => ( 0));
@@ -4472,7 +4479,7 @@ var ImageEditorController = (_class7 = class {
4472
4479
  /** Turns an effect layer into a plain pixel layer keeping its pixels (one undo step). */
4473
4480
  rasterizeEffectLayer(layerId) {
4474
4481
  const found = _chunk24ATT2PEcjs.findLayer.call(void 0, this.state.layers, layerId);
4475
- if (!found || found.layer.type !== "pixel" || !found.layer.generator) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`"${layerId}" is not an effect layer.`);
4482
+ if (!found || found.layer.type !== "pixel" || !found.layer.generator) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`"${layerId}" is not an effect layer.`);
4476
4483
  this.commitLayers(
4477
4484
  _chunk24ATT2PEcjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => {
4478
4485
  const { generator: _g, ...rest } = l;
@@ -4500,7 +4507,7 @@ var ImageEditorController = (_class7 = class {
4500
4507
  if (key.length === this.viewKey.length && key.every((v, i) => v === this.viewKey[i])) return;
4501
4508
  this.viewKey = key;
4502
4509
  const { width, height } = this.naturalSize;
4503
- const view = _chunkYAFS2QFZcjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
4510
+ const view = _chunkJLGNZMUVcjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
4504
4511
  s.adjustments = view.adjustments;
4505
4512
  s.depthMask = view.depthMask;
4506
4513
  s.annotations = view.annotations;
@@ -4654,7 +4661,7 @@ var ImageEditorController = (_class7 = class {
4654
4661
  applyCropPreset(ratio) {
4655
4662
  this.recordHistory();
4656
4663
  const { width, height } = this.state.imageDimensions;
4657
- if (ratio && _chunkYAFS2QFZcjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
4664
+ if (ratio && _chunkJLGNZMUVcjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
4658
4665
  ratio = 1 / ratio;
4659
4666
  }
4660
4667
  if (!ratio) {
@@ -4736,7 +4743,7 @@ var ImageEditorController = (_class7 = class {
4736
4743
  */
4737
4744
  getLayerPixels(id) {
4738
4745
  const layer = this.getLayer(id);
4739
- if (!layer || !_chunkYAFS2QFZcjs.hasSurface.call(void 0, layer)) return null;
4746
+ if (!layer || !_chunkJLGNZMUVcjs.hasSurface.call(void 0, layer)) return null;
4740
4747
  const surface = this.surfaceOf(layer);
4741
4748
  const b = _chunkJ5BA3BQ6cjs.contentBounds.call(void 0, surface);
4742
4749
  if (!b) return null;
@@ -4749,7 +4756,7 @@ var ImageEditorController = (_class7 = class {
4749
4756
  */
4750
4757
  getLayerBounds(id) {
4751
4758
  const layer = this.getLayer(id);
4752
- if (!layer || !_chunkYAFS2QFZcjs.hasSurface.call(void 0, layer)) return null;
4759
+ if (!layer || !_chunkJLGNZMUVcjs.hasSurface.call(void 0, layer)) return null;
4753
4760
  const surface = this.surfaceOf(layer);
4754
4761
  let b = this.boundsCache.get(surface);
4755
4762
  if (b === void 0) {
@@ -4764,9 +4771,9 @@ var ImageEditorController = (_class7 = class {
4764
4771
  */
4765
4772
  getLayerDataURL(id) {
4766
4773
  const layer = this.getLayer(id);
4767
- if (!layer || !_chunkYAFS2QFZcjs.hasSurface.call(void 0, layer)) return null;
4774
+ if (!layer || !_chunkJLGNZMUVcjs.hasSurface.call(void 0, layer)) return null;
4768
4775
  const surface = this.surfaceOf(layer);
4769
- const enc = _chunkYAFS2QFZcjs.encodeSurface.call(void 0, surface);
4776
+ const enc = _chunkJLGNZMUVcjs.encodeSurface.call(void 0, surface);
4770
4777
  return enc ? enc.url : null;
4771
4778
  }
4772
4779
  /**
@@ -4908,19 +4915,19 @@ var ImageEditorController = (_class7 = class {
4908
4915
  if (init.pixels) {
4909
4916
  const px2 = init.pixels;
4910
4917
  if (!(px2.width > 0 && px2.height > 0) || px2.data.length < px2.width * px2.height * 4) {
4911
- throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
4918
+ throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
4912
4919
  }
4913
4920
  surface = _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, px2, 4);
4914
4921
  } else if (init.color !== void 0) {
4915
4922
  const c = parseColor(init.color);
4916
4923
  surface = _chunkJ5BA3BQ6cjs.solidSurface.call(void 0, 4, { x: 0, y: 0, width, height }, _chunkJ5BA3BQ6cjs.packRgba.call(void 0, c[0], c[1], c[2], c[3]));
4917
4924
  }
4918
- const blend = _chunkYAFS2QFZcjs.parseBlend.call(void 0, init.blend);
4919
- if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("opacity must be from 0 to 1.");
4925
+ const blend = _chunkJLGNZMUVcjs.parseBlend.call(void 0, init.blend);
4926
+ if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("opacity must be from 0 to 1.");
4920
4927
  const ids = new Set(_chunk24ATT2PEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
4921
4928
  const layer = {
4922
4929
  type: "pixel",
4923
- id: init.id && !ids.has(init.id) ? init.id : _chunkYAFS2QFZcjs.newLayerId.call(void 0, ),
4930
+ id: init.id && !ids.has(init.id) ? init.id : _chunkJLGNZMUVcjs.newLayerId.call(void 0, ),
4924
4931
  name: _optionalChain([init, 'access', _155 => _155.name, 'optionalAccess', _156 => _156.trim, 'call', _157 => _157()]) || this.nextLayerName(),
4925
4932
  visible: _nullishCoalesce(init.visible, () => ( true)),
4926
4933
  opacity: _nullishCoalesce(init.opacity, () => ( 1)),
@@ -4929,7 +4936,7 @@ var ImageEditorController = (_class7 = class {
4929
4936
  offset: { x: Math.round(_nullishCoalesce(init.x, () => ( 0))), y: Math.round(_nullishCoalesce(init.y, () => ( 0))) }
4930
4937
  };
4931
4938
  if (init.fillOpacity !== void 0 && init.fillOpacity !== 1) layer.fillOpacity = init.fillOpacity;
4932
- const next = _chunkYAFS2QFZcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
4939
+ const next = _chunkJLGNZMUVcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
4933
4940
  this.commitLayers(next, () => {
4934
4941
  this.state.activeLayerId = layer.id;
4935
4942
  this.state.activeTarget = "pixels";
@@ -4969,12 +4976,12 @@ var ImageEditorController = (_class7 = class {
4969
4976
  try {
4970
4977
  img = await this.renderer.imageCache.get(src);
4971
4978
  } catch (e22) {
4972
- throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("The image could not be decoded here. Pass a PNG (data URL or base64), or run in a browser for other formats and URLs.");
4979
+ throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("The image could not be decoded here. Pass a PNG (data URL or base64), or run in a browser for other formats and URLs.");
4973
4980
  }
4974
4981
  const w = img.naturalWidth || img.width;
4975
4982
  const h = img.naturalHeight || img.height;
4976
4983
  const ctx = this.renderer.createCanvas(w, h).getContext("2d");
4977
- if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
4984
+ if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
4978
4985
  ctx.drawImage(img, 0, 0, w, h);
4979
4986
  const data = ctx.getImageData(0, 0, w, h);
4980
4987
  return { width: w, height: h, data: data.data };
@@ -4987,7 +4994,7 @@ var ImageEditorController = (_class7 = class {
4987
4994
  }
4988
4995
  /** Duplicates a layer (with its children) directly above it, as one undo step. Returns the copy's id. */
4989
4996
  duplicateLayer(id, name) {
4990
- const res = _chunkYAFS2QFZcjs.duplicateLayer.call(void 0, this.state.layers, id, name);
4997
+ const res = _chunkJLGNZMUVcjs.duplicateLayer.call(void 0, this.state.layers, id, name);
4991
4998
  this.commitLayers(res.layers, () => {
4992
4999
  this.state.activeLayerId = res.id;
4993
5000
  });
@@ -4995,16 +5002,16 @@ var ImageEditorController = (_class7 = class {
4995
5002
  }
4996
5003
  /** Deletes a layer (refused when locked), as one undo step. */
4997
5004
  removeLayer(id) {
4998
- const next = _chunkYAFS2QFZcjs.removeLayer.call(void 0, this.state.layers, id);
5005
+ const next = _chunkJLGNZMUVcjs.removeLayer.call(void 0, this.state.layers, id);
4999
5006
  this.commitLayers(next, () => {
5000
- if (this.state.selectedAnnotationId && !_chunk24ATT2PEcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkYAFS2QFZcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _159 => _159.id]) === this.state.selectedAnnotationId)) {
5007
+ if (this.state.selectedAnnotationId && !_chunk24ATT2PEcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkJLGNZMUVcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _159 => _159.id]) === this.state.selectedAnnotationId)) {
5001
5008
  this.state.selectedAnnotationId = null;
5002
5009
  }
5003
5010
  });
5004
5011
  }
5005
5012
  /** Moves a layer above / below another, or into a group, as one undo step. Returns its new parent and index. */
5006
5013
  moveLayer(id, placement) {
5007
- const next = _chunkYAFS2QFZcjs.moveLayer.call(void 0, this.state.layers, id, placement);
5014
+ const next = _chunkJLGNZMUVcjs.moveLayer.call(void 0, this.state.layers, id, placement);
5008
5015
  const loc = _chunk24ATT2PEcjs.findLayer.call(void 0, next, id);
5009
5016
  if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _160 => _160.parent, 'optionalAccess', _161 => _161.id]), () => ( null)), index: loc.index };
5010
5017
  this.commitLayers(next);
@@ -5015,23 +5022,23 @@ var ImageEditorController = (_class7 = class {
5015
5022
  * one undo step (`commitToHistory = false` for the moves of a slider drag). Returns the layer.
5016
5023
  */
5017
5024
  setLayerProperties(id, props, commitToHistory = true) {
5018
- const next = _chunkYAFS2QFZcjs.setLayerProperties.call(void 0, this.state.layers, id, props);
5025
+ const next = _chunkJLGNZMUVcjs.setLayerProperties.call(void 0, this.state.layers, id, props);
5019
5026
  this.commitLayers(next, void 0, commitToHistory);
5020
5027
  return _chunk24ATT2PEcjs.findLayer.call(void 0, next, id).layer;
5021
5028
  }
5022
5029
  /** Adds an empty pass-through group above the active layer (or at `placement`) and makes it active. Returns its id. */
5023
5030
  addGroup(init = {}) {
5024
- const blend = init.blend === void 0 ? "pass-through" : _chunkYAFS2QFZcjs.parseBlend.call(void 0, init.blend, true);
5031
+ const blend = init.blend === void 0 ? "pass-through" : _chunkJLGNZMUVcjs.parseBlend.call(void 0, init.blend, true);
5025
5032
  const group = {
5026
5033
  type: "group",
5027
- id: _chunkYAFS2QFZcjs.newLayerId.call(void 0, "group"),
5034
+ id: _chunkJLGNZMUVcjs.newLayerId.call(void 0, "group"),
5028
5035
  name: _optionalChain([init, 'access', _164 => _164.name, 'optionalAccess', _165 => _165.trim, 'call', _166 => _166()]) || "Group",
5029
5036
  visible: true,
5030
5037
  opacity: 1,
5031
5038
  blend,
5032
5039
  children: []
5033
5040
  };
5034
- const next = _chunkYAFS2QFZcjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
5041
+ const next = _chunkJLGNZMUVcjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
5035
5042
  this.commitLayers(next, () => {
5036
5043
  this.state.activeLayerId = group.id;
5037
5044
  this.state.activeTarget = "pixels";
@@ -5040,7 +5047,7 @@ var ImageEditorController = (_class7 = class {
5040
5047
  }
5041
5048
  /** Puts sibling layers into a new group (one undo step). Returns the group id. */
5042
5049
  groupLayers(ids, name) {
5043
- const res = _chunkYAFS2QFZcjs.groupLayers.call(void 0, this.state.layers, ids, name);
5050
+ const res = _chunkJLGNZMUVcjs.groupLayers.call(void 0, this.state.layers, ids, name);
5044
5051
  this.commitLayers(res.layers, () => {
5045
5052
  this.state.activeLayerId = res.id;
5046
5053
  });
@@ -5048,7 +5055,7 @@ var ImageEditorController = (_class7 = class {
5048
5055
  }
5049
5056
  /** Replaces a group by its children (one undo step). Returns the child ids, bottom to top. */
5050
5057
  ungroupLayer(id) {
5051
- const res = _chunkYAFS2QFZcjs.ungroupLayer.call(void 0, this.state.layers, id);
5058
+ const res = _chunkJLGNZMUVcjs.ungroupLayer.call(void 0, this.state.layers, id);
5052
5059
  this.commitLayers(res.layers);
5053
5060
  return res.ids;
5054
5061
  }
@@ -5057,38 +5064,38 @@ var ImageEditorController = (_class7 = class {
5057
5064
  * (`commitToHistory = false` for the moves of a drag). Returns the offset and document bounds.
5058
5065
  */
5059
5066
  offsetLayer(id, move, commitToHistory = true) {
5060
- const layer = _chunkYAFS2QFZcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5067
+ const layer = _chunkJLGNZMUVcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5061
5068
  if (layer.type === "smart") {
5062
5069
  const tl = layer.placement.corners[0];
5063
5070
  const dx = move.x !== void 0 ? move.x - tl.x : _nullishCoalesce(move.dx, () => ( 0));
5064
5071
  const dy = move.y !== void 0 ? move.y - tl.y : _nullishCoalesce(move.dy, () => ( 0));
5065
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("x and y must be numbers.");
5066
- this.commitLayers(_chunkYAFS2QFZcjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
5072
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("x and y must be numbers.");
5073
+ this.commitLayers(_chunkJLGNZMUVcjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
5067
5074
  const moved = _chunk24ATT2PEcjs.findLayer.call(void 0, this.state.layers, id).layer;
5068
5075
  return { offset: { x: Math.round(moved.placement.corners[0].x), y: Math.round(moved.placement.corners[0].y) }, bounds: this.getLayerBounds(id) };
5069
5076
  }
5070
5077
  if (layer.type === "shape") {
5071
- const g = _nullishCoalesce(_chunkYAFS2QFZcjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
5078
+ const g = _nullishCoalesce(_chunkJLGNZMUVcjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
5072
5079
  const dx = move.x !== void 0 ? move.x - g.x : _nullishCoalesce(move.dx, () => ( 0));
5073
5080
  const dy = move.y !== void 0 ? move.y - g.y : _nullishCoalesce(move.dy, () => ( 0));
5074
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("x and y must be numbers.");
5075
- _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "position", "move it");
5076
- let moved = _chunkYAFS2QFZcjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
5081
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("x and y must be numbers.");
5082
+ _chunkJLGNZMUVcjs.requireUnlocked.call(void 0, layer, "position", "move it");
5083
+ let moved = _chunkJLGNZMUVcjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
5077
5084
  const mask = layer.mask;
5078
5085
  if (mask && mask.linked !== false && !mask.source && (Math.round(dx) || Math.round(dy))) moved = { ...moved, mask: { ...mask, surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, mask.surface, Math.round(dx), Math.round(dy)) } };
5079
5086
  this.commitLayers(_chunk24ATT2PEcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
5080
- const b = _nullishCoalesce(_chunkYAFS2QFZcjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
5087
+ const b = _nullishCoalesce(_chunkJLGNZMUVcjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
5081
5088
  return { offset: { x: Math.round(b.x), y: Math.round(b.y) }, bounds: this.getLayerBounds(id) };
5082
5089
  }
5083
5090
  if (layer.type === "type") {
5084
5091
  const m = _nullishCoalesce(layer.transform, () => ( [1, 0, 0, 1, 0, 0]));
5085
5092
  const dx = move.x !== void 0 ? move.x - m[4] : _nullishCoalesce(move.dx, () => ( 0));
5086
5093
  const dy = move.y !== void 0 ? move.y - m[5] : _nullishCoalesce(move.dy, () => ( 0));
5087
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("x and y must be numbers.");
5088
- _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "position", "move it");
5094
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("x and y must be numbers.");
5095
+ _chunkJLGNZMUVcjs.requireUnlocked.call(void 0, layer, "position", "move it");
5089
5096
  const mx = Math.round(dx);
5090
5097
  const my = Math.round(dy);
5091
- let moved = { ..._chunkYAFS2QFZcjs.transformTypeLayer.call(void 0, layer, [1, 0, 0, 1, mx, my]), surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, layer.surface, mx, my) };
5098
+ let moved = { ..._chunkJLGNZMUVcjs.transformTypeLayer.call(void 0, layer, [1, 0, 0, 1, mx, my]), surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, layer.surface, mx, my) };
5092
5099
  const mask = layer.mask;
5093
5100
  if (mask && mask.linked !== false && !mask.source && (mx || my)) moved = { ...moved, mask: { ...mask, surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, mask.surface, mx, my) } };
5094
5101
  this.commitLayers(_chunk24ATT2PEcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
@@ -5098,7 +5105,7 @@ var ImageEditorController = (_class7 = class {
5098
5105
  const current = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
5099
5106
  const x = _nullishCoalesce(move.x, () => ( current.x + (_nullishCoalesce(move.dx, () => ( 0)))));
5100
5107
  const y = _nullishCoalesce(move.y, () => ( current.y + (_nullishCoalesce(move.dy, () => ( 0)))));
5101
- const next = _chunkYAFS2QFZcjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
5108
+ const next = _chunkJLGNZMUVcjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
5102
5109
  this.commitLayers(next, void 0, commitToHistory);
5103
5110
  return { offset: { x: Math.round(x), y: Math.round(y) }, bounds: this.getLayerBounds(id) };
5104
5111
  }
@@ -5108,11 +5115,11 @@ var ImageEditorController = (_class7 = class {
5108
5115
  * target when the layer is active.
5109
5116
  */
5110
5117
  addLayerMask(id, from = "reveal-all", props = {}) {
5111
- const layer = _chunkYAFS2QFZcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5118
+ const layer = _chunkJLGNZMUVcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5112
5119
  let mask;
5113
5120
  if (from === "selection") {
5114
5121
  const sel = this.state.selection;
5115
- if (!_optionalChain([sel, 'optionalAccess', _167 => _167.bounds])) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
5122
+ if (!_optionalChain([sel, 'optionalAccess', _167 => _167.bounds])) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
5116
5123
  mask = this.maskFromSelection(sel, props);
5117
5124
  if (layer.type === "pixel" && (layer.offset.x || layer.offset.y)) {
5118
5125
  mask = { ...mask, surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, mask.surface, -layer.offset.x, -layer.offset.y) };
@@ -5121,7 +5128,7 @@ var ImageEditorController = (_class7 = class {
5121
5128
  const v = from === "reveal-all" ? 255 : 0;
5122
5129
  mask = withMaskProps({ surface: _chunkJ5BA3BQ6cjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
5123
5130
  }
5124
- const next = _chunkYAFS2QFZcjs.setLayerMask.call(void 0, this.state.layers, id, mask);
5131
+ const next = _chunkJLGNZMUVcjs.setLayerMask.call(void 0, this.state.layers, id, mask);
5125
5132
  this.commitLayers(next, () => {
5126
5133
  if (this.state.activeLayerId === id) this.state.activeTarget = "mask";
5127
5134
  });
@@ -5129,18 +5136,18 @@ var ImageEditorController = (_class7 = class {
5129
5136
  }
5130
5137
  /** Removes a layer's mask (one undo step). */
5131
5138
  removeLayerMask(id) {
5132
- const layer = _chunkYAFS2QFZcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5133
- if (!layer.mask) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
5134
- this.commitLayers(_chunkYAFS2QFZcjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
5139
+ const layer = _chunkJLGNZMUVcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5140
+ if (!layer.mask) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
5141
+ this.commitLayers(_chunkJLGNZMUVcjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
5135
5142
  if (this.state.activeLayerId === id) this.state.activeTarget = "pixels";
5136
5143
  });
5137
5144
  }
5138
5145
  /** Changes any layer mask's density, feather, enabled or linked flag (pixels kept). Returns the mask. */
5139
5146
  setLayerMaskProps(id, props, commitToHistory = true) {
5140
- const layer = _chunkYAFS2QFZcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5141
- if (!layer.mask) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
5147
+ const layer = _chunkJLGNZMUVcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5148
+ if (!layer.mask) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
5142
5149
  const mask = withMaskProps(layer.mask, props);
5143
- this.commitLayers(_chunkYAFS2QFZcjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
5150
+ this.commitLayers(_chunkJLGNZMUVcjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
5144
5151
  return mask;
5145
5152
  }
5146
5153
  /**
@@ -5148,11 +5155,11 @@ var ImageEditorController = (_class7 = class {
5148
5155
  * the depth map) and removes the mask, as one undo step.
5149
5156
  */
5150
5157
  async applyLayerMask(id) {
5151
- const loc = _chunkYAFS2QFZcjs.requireLayer.call(void 0, this.state.layers, id);
5158
+ const loc = _chunkJLGNZMUVcjs.requireLayer.call(void 0, this.state.layers, id);
5152
5159
  const layer = loc.layer;
5153
- if (layer.type !== "pixel") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Only a pixel layer's mask can be applied to its pixels; "${id}" is a ${layer.type} layer. Remove the mask or keep it.`);
5154
- if (!layer.mask) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
5155
- _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
5160
+ if (layer.type !== "pixel") throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Only a pixel layer's mask can be applied to its pixels; "${id}" is a ${layer.type} layer. Remove the mask or keep it.`);
5161
+ if (!layer.mask) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
5162
+ _chunkJLGNZMUVcjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
5156
5163
  const { width, height } = this.naturalSize;
5157
5164
  await this.renderer.prepareLayerAssets([layer], width, height);
5158
5165
  const sources = this.renderer.compositorSources(width, height);
@@ -5185,13 +5192,13 @@ var ImageEditorController = (_class7 = class {
5185
5192
  */
5186
5193
  layerViaCopy(options = {}) {
5187
5194
  const id = _nullishCoalesce(options.layerId, () => ( this.state.activeLayerId));
5188
- if (!id) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
5189
- const loc = _chunkYAFS2QFZcjs.requireLayer.call(void 0, this.state.layers, id);
5195
+ if (!id) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
5196
+ const loc = _chunkJLGNZMUVcjs.requireLayer.call(void 0, this.state.layers, id);
5190
5197
  const layer = loc.layer;
5191
- if (layer.type !== "pixel") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
5198
+ if (layer.type !== "pixel") throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
5192
5199
  const sel = this.state.selection;
5193
- if (!_optionalChain([sel, 'optionalAccess', _168 => _168.bounds])) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
5194
- if (options.cut) _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
5200
+ if (!_optionalChain([sel, 'optionalAccess', _168 => _168.bounds])) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
5201
+ if (options.cut) _chunkJLGNZMUVcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
5195
5202
  const surface = this.surfaceOf(layer);
5196
5203
  const sb = sel.bounds;
5197
5204
  const src = { x: sb.x - layer.offset.x, y: sb.y - layer.offset.y, width: sb.width, height: sb.height };
@@ -5207,7 +5214,7 @@ var ImageEditorController = (_class7 = class {
5207
5214
  }
5208
5215
  const copy = {
5209
5216
  type: "pixel",
5210
- id: _chunkYAFS2QFZcjs.newLayerId.call(void 0, ),
5217
+ id: _chunkJLGNZMUVcjs.newLayerId.call(void 0, ),
5211
5218
  name: _optionalChain([options, 'access', _169 => _169.name, 'optionalAccess', _170 => _170.trim, 'call', _171 => _171()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
5212
5219
  visible: true,
5213
5220
  opacity: 1,
@@ -5280,7 +5287,7 @@ var ImageEditorController = (_class7 = class {
5280
5287
  * Refused while another transform is open.
5281
5288
  */
5282
5289
  beginFreeTransform(init = {}) {
5283
- if (this.getFreeTransform()) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
5290
+ if (this.getFreeTransform()) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
5284
5291
  const session = new FreeTransformSession(this.transformHost(), init);
5285
5292
  this.openTransform = session;
5286
5293
  this.notify();
@@ -5294,26 +5301,26 @@ var ImageEditorController = (_class7 = class {
5294
5301
  */
5295
5302
  transformLayer(spec) {
5296
5303
  const given = [spec.matrix, spec.corners, spec.params].filter((v) => v !== void 0).length;
5297
- if (given > 1) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give only one of matrix, corners and params.");
5298
- if (!given && spec.warp === void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
5304
+ if (given > 1) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give only one of matrix, corners and params.");
5305
+ if (!given && spec.warp === void 0) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
5299
5306
  if (spec.matrix && !(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) {
5300
- throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("matrix must be six finite numbers [a, b, c, d, e, f] (x' = a\xB7x + c\xB7y + e, y' = b\xB7x + d\xB7y + f).");
5307
+ throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("matrix must be six finite numbers [a, b, c, d, e, f] (x' = a\xB7x + c\xB7y + e, y' = b\xB7x + d\xB7y + f).");
5301
5308
  }
5302
5309
  if (spec.matrix) {
5303
5310
  const [a, b, c, d] = spec.matrix;
5304
- if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
5311
+ if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
5305
5312
  }
5306
5313
  const session = this.beginFreeTransform(spec);
5307
5314
  try {
5308
5315
  const g = session.startGeometry;
5309
- const corners = spec.matrix ? g.corners.map((p) => _chunkZ2H7KECKcjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunkYAFS2QFZcjs.applyParams.call(void 0, g, spec.params) : g.corners;
5316
+ const corners = spec.matrix ? g.corners.map((p) => _chunk2R3UW57Ucjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunkJLGNZMUVcjs.applyParams.call(void 0, g, spec.params) : g.corners;
5310
5317
  let warp = spec.warp === void 0 ? _nullishCoalesce(g.warp, () => ( null)) : null;
5311
5318
  if (spec.warp) {
5312
5319
  if ("style" in spec.warp) {
5313
- if (!_chunkZ2H7KECKcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkZ2H7KECKcjs.WARP_STYLES.join(", ")}.`);
5314
- warp = _chunkYAFS2QFZcjs.presetWarp.call(void 0, session.box, spec.warp);
5320
+ if (!_chunk2R3UW57Ucjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunk2R3UW57Ucjs.WARP_STYLES.join(", ")}.`);
5321
+ warp = _chunkJLGNZMUVcjs.presetWarp.call(void 0, session.box, spec.warp);
5315
5322
  } else {
5316
- if (!_chunkYAFS2QFZcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("mesh must have us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points, row by row.");
5323
+ if (!_chunkJLGNZMUVcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("mesh must have us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points, row by row.");
5317
5324
  warp = spec.warp;
5318
5325
  }
5319
5326
  }
@@ -5326,10 +5333,10 @@ var ImageEditorController = (_class7 = class {
5326
5333
  }
5327
5334
  /** Flips the layer (or its selected pixels, or the outline) about the frame's centre, exactly (one undo step). */
5328
5335
  flipLayer(axis, init = {}) {
5329
- if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
5336
+ if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
5330
5337
  const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
5331
5338
  try {
5332
- session.update({ corners: _chunkYAFS2QFZcjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
5339
+ session.update({ corners: _chunkJLGNZMUVcjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
5333
5340
  return session.commit();
5334
5341
  } catch (e) {
5335
5342
  session.cancel();
@@ -5341,16 +5348,16 @@ var ImageEditorController = (_class7 = class {
5341
5348
  * centre, snapped so pixels land on whole pixels: exact, no resampling (one undo step).
5342
5349
  */
5343
5350
  rotateLayer90(turn, init = {}) {
5344
- if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
5351
+ if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
5345
5352
  const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
5346
5353
  try {
5347
- const b = session.smartObject || session.typeLayer ? _nullishCoalesce(_chunkYAFS2QFZcjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
5354
+ const b = session.smartObject || session.typeLayer ? _nullishCoalesce(_chunkJLGNZMUVcjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
5348
5355
  const cx = b.x + b.width / 2;
5349
5356
  const cy = b.y + b.height / 2;
5350
5357
  const ox = turn === 180 ? 0 : Math.round(cx - b.height / 2) - (cx - b.height / 2);
5351
5358
  const oy = turn === 180 ? 0 : Math.round(cy - b.width / 2) - (cy - b.width / 2);
5352
5359
  const m = turn === 90 ? [0, 1, -1, 0, cx + cy + ox, cy - cx + oy] : turn === -90 ? [0, -1, 1, 0, cx - cy + ox, cy + cx + oy] : [-1, 0, 0, -1, 2 * cx, 2 * cy];
5353
- session.update({ corners: session.startGeometry.corners.map((p) => _chunkZ2H7KECKcjs.applyMatrix.call(void 0, m, p)) }, false);
5360
+ session.update({ corners: session.startGeometry.corners.map((p) => _chunk2R3UW57Ucjs.applyMatrix.call(void 0, m, p)) }, false);
5354
5361
  return session.commit();
5355
5362
  } catch (e) {
5356
5363
  session.cancel();
@@ -5359,20 +5366,20 @@ var ImageEditorController = (_class7 = class {
5359
5366
  }
5360
5367
  /** Adds a `develop` or `blur` filter to a pixel layer (one undo step). Returns the layer's filters. */
5361
5368
  addLayerFilter(id, filter) {
5362
- const f = _chunkYAFS2QFZcjs.normalizeFilter.call(void 0, filter);
5363
- const next = _chunkYAFS2QFZcjs.addLayerFilter.call(void 0, this.state.layers, id, f);
5369
+ const f = _chunkJLGNZMUVcjs.normalizeFilter.call(void 0, filter);
5370
+ const next = _chunkJLGNZMUVcjs.addLayerFilter.call(void 0, this.state.layers, id, f);
5364
5371
  this.commitLayers(next);
5365
5372
  return _nullishCoalesce(_chunk24ATT2PEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
5366
5373
  }
5367
5374
  /** Changes one filter (one undo step, or none with `commitToHistory = false` during a drag). Returns the filters. */
5368
5375
  updateLayerFilter(id, filterId, changes, commitToHistory = true) {
5369
- const next = _chunkYAFS2QFZcjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
5376
+ const next = _chunkJLGNZMUVcjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
5370
5377
  this.commitLayers(next, void 0, commitToHistory);
5371
5378
  return _nullishCoalesce(_chunk24ATT2PEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
5372
5379
  }
5373
5380
  /** Removes one filter (one undo step). Returns the remaining filters. */
5374
5381
  removeLayerFilter(id, filterId) {
5375
- const next = _chunkYAFS2QFZcjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
5382
+ const next = _chunkJLGNZMUVcjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
5376
5383
  this.commitLayers(next);
5377
5384
  return _nullishCoalesce(_chunk24ATT2PEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
5378
5385
  }
@@ -5388,8 +5395,8 @@ var ImageEditorController = (_class7 = class {
5388
5395
  */
5389
5396
  convertToSmartObject(ids, options = {}) {
5390
5397
  const list = _optionalChain([ids, 'optionalAccess', _177 => _177.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
5391
- if (!list.length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
5392
- const res = _chunkYAFS2QFZcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
5398
+ if (!list.length) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
5399
+ const res = _chunkJLGNZMUVcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
5393
5400
  this.commitLayers(res.layers, () => {
5394
5401
  this.state.activeLayerId = res.layer.id;
5395
5402
  this.state.activeTarget = "pixels";
@@ -5398,7 +5405,7 @@ var ImageEditorController = (_class7 = class {
5398
5405
  }
5399
5406
  /** Layer › Smart Objects › Rasterize (one undo step): the smart object becomes a pixel layer holding what it renders. */
5400
5407
  rasterizeSmartObject(id) {
5401
- const res = _chunkYAFS2QFZcjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
5408
+ const res = _chunkJLGNZMUVcjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
5402
5409
  this.commitLayers(res.layers, () => {
5403
5410
  if (this.state.activeLayerId === id && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
5404
5411
  });
@@ -5406,10 +5413,10 @@ var ImageEditorController = (_class7 = class {
5406
5413
  }
5407
5414
  /** A smart object's contents, placement and smart filters as plain data (see `SmartObjectInfo`). */
5408
5415
  getSmartObject(id) {
5409
- const layer = _chunkYAFS2QFZcjs.requireSmartObject.call(void 0, this.state.layers, id);
5416
+ const layer = _chunkJLGNZMUVcjs.requireSmartObject.call(void 0, this.state.layers, id);
5410
5417
  const c = layer.contents;
5411
- const g = _chunkYAFS2QFZcjs.placementGeometry.call(void 0, layer);
5412
- const readout = _chunkYAFS2QFZcjs.describeTransform.call(void 0, g);
5418
+ const g = _chunkJLGNZMUVcjs.placementGeometry.call(void 0, layer);
5419
+ const readout = _chunkJLGNZMUVcjs.describeTransform.call(void 0, g);
5413
5420
  const stack = layer.smartFilters;
5414
5421
  return {
5415
5422
  layerId: layer.id,
@@ -5419,10 +5426,10 @@ var ImageEditorController = (_class7 = class {
5419
5426
  kind: c.kind,
5420
5427
  width: c.width,
5421
5428
  height: c.height,
5422
- decoded: _chunkYAFS2QFZcjs.isContentsDecoded.call(void 0, c),
5429
+ decoded: _chunkJLGNZMUVcjs.isContentsDecoded.call(void 0, c),
5423
5430
  fileType: _nullishCoalesce(_optionalChain([c, 'access', _178 => _178.file, 'optionalAccess', _179 => _179.type]), () => ( null)),
5424
5431
  linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _180 => _180.linked, 'optionalAccess', _181 => _181.path]), () => ( null)),
5425
- instances: _chunkYAFS2QFZcjs.instancesOf.call(void 0, this.state.layers, c.id),
5432
+ instances: _chunkJLGNZMUVcjs.instancesOf.call(void 0, this.state.layers, c.id),
5426
5433
  layerCount: c.document ? _chunk24ATT2PEcjs.flattenLayers.call(void 0, c.document.layers).length : 0
5427
5434
  },
5428
5435
  placement: {
@@ -5434,8 +5441,8 @@ var ImageEditorController = (_class7 = class {
5434
5441
  scaleY: readout.scaleY,
5435
5442
  rotate: readout.rotate,
5436
5443
  skewX: readout.skewX,
5437
- center: _chunkYAFS2QFZcjs.anchorPoint.call(void 0, g, "center"),
5438
- bounds: _chunkYAFS2QFZcjs.transformedBox.call(void 0, g)
5444
+ center: _chunkJLGNZMUVcjs.anchorPoint.call(void 0, g, "center"),
5445
+ bounds: _chunkJLGNZMUVcjs.transformedBox.call(void 0, g)
5439
5446
  },
5440
5447
  smartFilters: {
5441
5448
  enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _182 => _182.enabled]), () => ( true)),
@@ -5452,7 +5459,7 @@ var ImageEditorController = (_class7 = class {
5452
5459
  * change. Returns the new placement summary.
5453
5460
  */
5454
5461
  setSmartObjectPlacement(id, placement, commitToHistory = true) {
5455
- const res = _chunkYAFS2QFZcjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
5462
+ const res = _chunkJLGNZMUVcjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
5456
5463
  this.commitLayers(res.layers, void 0, commitToHistory);
5457
5464
  return { ...this.getSmartObject(id).placement, masksMoved: res.masksMoved };
5458
5465
  }
@@ -5465,23 +5472,23 @@ var ImageEditorController = (_class7 = class {
5465
5472
  * nothing is relative to the current transform.
5466
5473
  */
5467
5474
  setSmartObjectTransform(id, spec) {
5468
- const layer = _chunkYAFS2QFZcjs.requireSmartObject.call(void 0, this.state.layers, id);
5469
- const g = _chunkYAFS2QFZcjs.placementGeometry.call(void 0, layer);
5475
+ const layer = _chunkJLGNZMUVcjs.requireSmartObject.call(void 0, this.state.layers, id);
5476
+ const g = _chunkJLGNZMUVcjs.placementGeometry.call(void 0, layer);
5470
5477
  const numeric = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y"].filter((k) => spec[k] !== void 0);
5471
5478
  const ways = [spec.corners !== void 0, spec.matrix !== void 0, numeric.length > 0].filter(Boolean).length;
5472
- if (ways > 1) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
5479
+ if (ways > 1) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
5473
5480
  let corners = g.corners;
5474
5481
  if (spec.corners) corners = spec.corners;
5475
5482
  else if (spec.matrix) {
5476
- if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("matrix must be six finite numbers [a, b, c, d, e, f] (x' = a\xB7x + c\xB7y + e, y' = b\xB7x + d\xB7y + f).");
5483
+ if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("matrix must be six finite numbers [a, b, c, d, e, f] (x' = a\xB7x + c\xB7y + e, y' = b\xB7x + d\xB7y + f).");
5477
5484
  const [a, b, c, d] = spec.matrix;
5478
- if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
5479
- corners = _chunkYAFS2QFZcjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
5485
+ if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
5486
+ corners = _chunkJLGNZMUVcjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
5480
5487
  } else if (numeric.length) {
5481
- if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
5482
- for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`${k} must be a finite number.`);
5483
- const now = _chunkYAFS2QFZcjs.describeTransform.call(void 0, g);
5484
- const centre = _chunkYAFS2QFZcjs.anchorPoint.call(void 0, g, "center");
5488
+ if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
5489
+ for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`${k} must be a finite number.`);
5490
+ const now = _chunkJLGNZMUVcjs.describeTransform.call(void 0, g);
5491
+ const centre = _chunkJLGNZMUVcjs.anchorPoint.call(void 0, g, "center");
5485
5492
  const params = {
5486
5493
  scaleX: _nullishCoalesce(spec.scaleX, () => ( (now.affine ? now.scaleX : 100))),
5487
5494
  scaleY: _nullishCoalesce(spec.scaleY, () => ( (now.affine ? now.scaleY : 100))),
@@ -5489,20 +5496,20 @@ var ImageEditorController = (_class7 = class {
5489
5496
  skewX: _nullishCoalesce(spec.skewX, () => ( (now.affine ? now.skewX : 0))),
5490
5497
  skewY: _nullishCoalesce(spec.skewY, () => ( 0))
5491
5498
  };
5492
- const m = _chunkYAFS2QFZcjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
5499
+ const m = _chunkJLGNZMUVcjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
5493
5500
  const cx = g.box.width / 2;
5494
5501
  const cy = g.box.height / 2;
5495
5502
  const to = { x: _nullishCoalesce(spec.x, () => ( centre.x)), y: _nullishCoalesce(spec.y, () => ( centre.y)) };
5496
- corners = _chunkYAFS2QFZcjs.cornersFromMatrix.call(void 0, g.box, _chunkZ2H7KECKcjs.multiplyMatrices.call(void 0, m, _chunkZ2H7KECKcjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
5503
+ corners = _chunkJLGNZMUVcjs.cornersFromMatrix.call(void 0, g.box, _chunk2R3UW57Ucjs.multiplyMatrices.call(void 0, m, _chunk2R3UW57Ucjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
5497
5504
  }
5498
5505
  let warp = _nullishCoalesce(layer.placement.warp, () => ( null));
5499
5506
  if (spec.warp === null) warp = null;
5500
5507
  else if (spec.warp) {
5501
5508
  if ("style" in spec.warp) {
5502
- if (!_chunkZ2H7KECKcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkZ2H7KECKcjs.WARP_STYLES.join(", ")}.`);
5503
- warp = _chunkYAFS2QFZcjs.presetWarp.call(void 0, g.box, spec.warp);
5509
+ if (!_chunk2R3UW57Ucjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunk2R3UW57Ucjs.WARP_STYLES.join(", ")}.`);
5510
+ warp = _chunkJLGNZMUVcjs.presetWarp.call(void 0, g.box, spec.warp);
5504
5511
  } else {
5505
- if (!_chunkYAFS2QFZcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("mesh must have us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points in contents pixels, row by row.");
5512
+ if (!_chunkJLGNZMUVcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("mesh must have us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points in contents pixels, row by row.");
5506
5513
  warp = spec.warp;
5507
5514
  }
5508
5515
  }
@@ -5516,16 +5523,16 @@ var ImageEditorController = (_class7 = class {
5516
5523
  * the layers that changed.
5517
5524
  */
5518
5525
  replaceSmartObjectContents(id, source) {
5519
- const layer = _chunkYAFS2QFZcjs.requireSmartObject.call(void 0, this.state.layers, id);
5526
+ const layer = _chunkJLGNZMUVcjs.requireSmartObject.call(void 0, this.state.layers, id);
5520
5527
  let contents;
5521
5528
  if ("contents" in source) contents = source.contents;
5522
- else if ("pixels" in source) contents = _chunkYAFS2QFZcjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
5529
+ else if ("pixels" in source) contents = _chunkJLGNZMUVcjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
5523
5530
  else {
5524
- const psd = _chunkYAFS2QFZcjs.importPsd.call(void 0, source.psd, { newId: () => _chunkYAFS2QFZcjs.newLayerId.call(void 0, ) });
5525
- contents = _chunkYAFS2QFZcjs.documentContents.call(void 0, { layers: psd.layers, globalLight: psd.globalLight, patterns: psd.patterns.length ? psd.patterns : void 0 }, psd.width, psd.height, _nullishCoalesce(source.name, () => ( `${layer.name || "Contents"}.psb`)));
5531
+ const psd = _chunkJLGNZMUVcjs.importPsd.call(void 0, source.psd, { newId: () => _chunkJLGNZMUVcjs.newLayerId.call(void 0, ) });
5532
+ contents = _chunkJLGNZMUVcjs.documentContents.call(void 0, { layers: psd.layers, globalLight: psd.globalLight, patterns: psd.patterns.length ? psd.patterns : void 0 }, psd.width, psd.height, _nullishCoalesce(source.name, () => ( `${layer.name || "Contents"}.psb`)));
5526
5533
  contents.file = { bytes: source.psd.slice(), type: psd.info.psb ? "psb" : "psd" };
5527
5534
  }
5528
- const res = _chunkYAFS2QFZcjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
5535
+ const res = _chunkJLGNZMUVcjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
5529
5536
  this.commitLayers(res.layers);
5530
5537
  return { contentsId: layer.contents.id, width: contents.width, height: contents.height, layerIds: res.ids };
5531
5538
  }
@@ -5540,16 +5547,16 @@ var ImageEditorController = (_class7 = class {
5540
5547
  * and bytes.
5541
5548
  */
5542
5549
  exportSmartObjectContents(id) {
5543
- const layer = _chunkYAFS2QFZcjs.requireSmartObject.call(void 0, this.state.layers, id);
5550
+ const layer = _chunkJLGNZMUVcjs.requireSmartObject.call(void 0, this.state.layers, id);
5544
5551
  const c = layer.contents;
5545
5552
  const base = c.name.replace(/\.\w+$/, "") || "Contents";
5546
5553
  if (c.file) {
5547
- const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunkYAFS2QFZcjs.BROWSER_IMAGE_TYPES };
5554
+ const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunkJLGNZMUVcjs.BROWSER_IMAGE_TYPES };
5548
5555
  const ext = c.file.type.toLowerCase();
5549
5556
  return { name: /\.\w+$/.test(c.name) ? c.name : `${base}.${ext}`, mimeType: _nullishCoalesce(mime[ext], () => ( "application/octet-stream")), bytes: c.file.bytes };
5550
5557
  }
5551
- if (!_chunkYAFS2QFZcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
5552
- const f = _chunkYAFS2QFZcjs.smartContentsFile.call(void 0, c);
5558
+ if (!_chunkJLGNZMUVcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
5559
+ const f = _chunkJLGNZMUVcjs.smartContentsFile.call(void 0, c);
5553
5560
  return { name: f.name, mimeType: f.name.endsWith(".png") ? "image/png" : "image/vnd.adobe.photoshop", bytes: f.bytes };
5554
5561
  }
5555
5562
  /**
@@ -5558,7 +5565,7 @@ var ImageEditorController = (_class7 = class {
5558
5565
  * undo step. Returns the copy's id.
5559
5566
  */
5560
5567
  copySmartObject(id, linked = false, name) {
5561
- const res = _chunkYAFS2QFZcjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
5568
+ const res = _chunkJLGNZMUVcjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
5562
5569
  this.commitLayers(res.layers, () => {
5563
5570
  this.state.activeLayerId = res.layer.id;
5564
5571
  this.state.activeTarget = "pixels";
@@ -5567,31 +5574,31 @@ var ImageEditorController = (_class7 = class {
5567
5574
  }
5568
5575
  /** Adds a smart filter (`develop` or `blur`, with `blend` and `opacity`) at `index` (default the top), as one undo step. */
5569
5576
  addSmartFilter(id, filter, index) {
5570
- const res = _chunkYAFS2QFZcjs.addSmartFilter.call(void 0, this.state.layers, id, _chunkYAFS2QFZcjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
5577
+ const res = _chunkJLGNZMUVcjs.addSmartFilter.call(void 0, this.state.layers, id, _chunkJLGNZMUVcjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
5571
5578
  this.commitLayers(res.layers);
5572
5579
  return res.filter;
5573
5580
  }
5574
5581
  /** Changes one smart filter (one undo step, or none with `commitToHistory = false` during a drag). */
5575
5582
  updateSmartFilter(id, filterId, changes, commitToHistory = true) {
5576
- const res = _chunkYAFS2QFZcjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
5583
+ const res = _chunkJLGNZMUVcjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
5577
5584
  this.commitLayers(res.layers, void 0, commitToHistory);
5578
5585
  return res.filter;
5579
5586
  }
5580
5587
  /** Removes one smart filter (one undo step). Returns the remaining filters. */
5581
5588
  removeSmartFilter(id, filterId) {
5582
- const res = _chunkYAFS2QFZcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
5589
+ const res = _chunkJLGNZMUVcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
5583
5590
  this.commitLayers(res.layers);
5584
5591
  return _nullishCoalesce(_optionalChain([res, 'access', _185 => _185.layer, 'access', _186 => _186.smartFilters, 'optionalAccess', _187 => _187.filters]), () => ( []));
5585
5592
  }
5586
5593
  /** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
5587
5594
  moveSmartFilter(id, filterId, index) {
5588
- const res = _chunkYAFS2QFZcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
5595
+ const res = _chunkJLGNZMUVcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
5589
5596
  this.commitLayers(res.layers);
5590
5597
  return _nullishCoalesce(_optionalChain([res, 'access', _188 => _188.layer, 'access', _189 => _189.smartFilters, 'optionalAccess', _190 => _190.filters]), () => ( []));
5591
5598
  }
5592
5599
  /** Turns a smart object's whole filter stack on or off (one undo step). */
5593
5600
  setSmartFiltersEnabled(id, enabled) {
5594
- const res = _chunkYAFS2QFZcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
5601
+ const res = _chunkJLGNZMUVcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
5595
5602
  this.commitLayers(res.layers);
5596
5603
  return _nullishCoalesce(_optionalChain([res, 'access', _191 => _191.layer, 'access', _192 => _192.smartFilters, 'optionalAccess', _193 => _193.enabled]), () => ( true));
5597
5604
  }
@@ -5601,21 +5608,21 @@ var ImageEditorController = (_class7 = class {
5601
5608
  * Painting it targets channel `filter-mask`. Returns the mask, or `null` when removed.
5602
5609
  */
5603
5610
  setSmartFilterMask(id, from, props = {}, commitToHistory = true) {
5604
- const layer = _chunkYAFS2QFZcjs.requireSmartObject.call(void 0, this.state.layers, id);
5611
+ const layer = _chunkJLGNZMUVcjs.requireSmartObject.call(void 0, this.state.layers, id);
5605
5612
  let mask;
5606
5613
  if (from === "none") mask = null;
5607
5614
  else if (from === "keep") {
5608
- if (!_optionalChain([layer, 'access', _194 => _194.smartFilters, 'optionalAccess', _195 => _195.mask])) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
5615
+ if (!_optionalChain([layer, 'access', _194 => _194.smartFilters, 'optionalAccess', _195 => _195.mask])) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
5609
5616
  mask = withMaskProps(layer.smartFilters.mask, props);
5610
5617
  } else if (from === "selection") {
5611
5618
  const sel = this.state.selection;
5612
- if (!_optionalChain([sel, 'optionalAccess', _196 => _196.bounds])) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
5619
+ if (!_optionalChain([sel, 'optionalAccess', _196 => _196.bounds])) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
5613
5620
  mask = this.maskFromSelection(sel, props);
5614
5621
  } else {
5615
5622
  const v = from === "reveal-all" ? 255 : 0;
5616
5623
  mask = withMaskProps({ surface: _chunkJ5BA3BQ6cjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
5617
5624
  }
5618
- const res = _chunkYAFS2QFZcjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
5625
+ const res = _chunkJLGNZMUVcjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
5619
5626
  this.commitLayers(res.layers, () => {
5620
5627
  if (this.state.activeLayerId !== id) return;
5621
5628
  if (mask && from !== "keep") this.state.activeTarget = "filter-mask";
@@ -5631,14 +5638,14 @@ var ImageEditorController = (_class7 = class {
5631
5638
  async prepareSmartObjects() {
5632
5639
  const pending = /* @__PURE__ */ new Map();
5633
5640
  for (const l of _chunk24ATT2PEcjs.flattenLayers.call(void 0, this.state.layers)) {
5634
- if (l.type === "smart" && !_chunkYAFS2QFZcjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunkYAFS2QFZcjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
5641
+ if (l.type === "smart" && !_chunkJLGNZMUVcjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunkJLGNZMUVcjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
5635
5642
  }
5636
5643
  const left = [];
5637
5644
  for (const [cid, c] of pending) {
5638
5645
  try {
5639
- const url = `data:${_chunkYAFS2QFZcjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkDCLJNVZScjs.bytesToBase64.call(void 0, c.file.bytes)}`;
5646
+ const url = `data:${_chunkJLGNZMUVcjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkDCLJNVZScjs.bytesToBase64.call(void 0, c.file.bytes)}`;
5640
5647
  const px2 = await this.decodeImage(url);
5641
- const decoded = { ...c, kind: "raster", raster: _chunkYAFS2QFZcjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
5648
+ const decoded = { ...c, kind: "raster", raster: _chunkJLGNZMUVcjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
5642
5649
  const swap = (layers) => {
5643
5650
  let out = layers;
5644
5651
  for (const l of _chunk24ATT2PEcjs.flattenLayers.call(void 0, layers)) if (l.type === "smart" && l.contents.id === cid) out = _chunk24ATT2PEcjs.mapLayer.call(void 0, out, l.id, (x) => ({ ...x, contents: decoded }));
@@ -5666,10 +5673,10 @@ var ImageEditorController = (_class7 = class {
5666
5673
  * Contents can nest. Returns the contents' size and layer ids.
5667
5674
  */
5668
5675
  editSmartObjectContents(id) {
5669
- if (this.getFreeTransform()) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
5670
- const layer = _chunkYAFS2QFZcjs.requireSmartObject.call(void 0, this.state.layers, id);
5676
+ if (this.getFreeTransform()) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
5677
+ const layer = _chunkJLGNZMUVcjs.requireSmartObject.call(void 0, this.state.layers, id);
5671
5678
  const c = layer.contents;
5672
- if (!_chunkYAFS2QFZcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _200 => _200.file, 'optionalAccess', _201 => _201.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
5679
+ if (!_chunkJLGNZMUVcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _200 => _200.file, 'optionalAccess', _201 => _201.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
5673
5680
  const saved = {
5674
5681
  state: { ...this.state },
5675
5682
  undo: this.undoStack,
@@ -5680,7 +5687,7 @@ var ImageEditorController = (_class7 = class {
5680
5687
  samplePixelsOverride: this.samplePixelsOverride,
5681
5688
  psdResolution: this.psdResolution
5682
5689
  };
5683
- const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunkYAFS2QFZcjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
5690
+ const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunkJLGNZMUVcjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
5684
5691
  this.contentsStack.push({ layerId: layer.id, contentsId: c.id, name: layer.name || c.name, saved });
5685
5692
  const s = this.state;
5686
5693
  this.state = {
@@ -5688,7 +5695,7 @@ var ImageEditorController = (_class7 = class {
5688
5695
  sourceUrl: null,
5689
5696
  imageDimensions: { width: c.width, height: c.height },
5690
5697
  crop: null,
5691
- transform: { ..._chunkYAFS2QFZcjs.DEFAULT_TRANSFORM_VALUES },
5698
+ transform: { ..._chunkJLGNZMUVcjs.DEFAULT_TRANSFORM_VALUES },
5692
5699
  layers,
5693
5700
  activeLayerId: layers.length ? layers[layers.length - 1].id : null,
5694
5701
  activeTarget: "pixels",
@@ -5721,7 +5728,7 @@ var ImageEditorController = (_class7 = class {
5721
5728
  */
5722
5729
  closeSmartObjectContents(save = true) {
5723
5730
  const top = this.contentsStack.pop();
5724
- if (!top) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
5731
+ if (!top) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
5725
5732
  if (_optionalChain([this, 'access', _207 => _207.openTransform, 'optionalAccess', _208 => _208.isOpen])) this.openTransform.cancel();
5726
5733
  this.openTransform = null;
5727
5734
  const edited = this.state;
@@ -5735,10 +5742,10 @@ var ImageEditorController = (_class7 = class {
5735
5742
  const plain3 = _optionalChain([only, 'optionalAccess', _211 => _211.type]) === "pixel" && only.visible && only.opacity === 1 && only.blend === "normal" && !only.mask && !only.effects && !_optionalChain([only, 'access', _212 => _212.filters, 'optionalAccess', _213 => _213.length]) && !only.clipped && (_nullishCoalesce(only.fillOpacity, () => ( 1))) === 1 && only.source !== "document";
5736
5743
  if (_optionalChain([old, 'optionalAccess', _214 => _214.kind]) === "raster" && plain3) {
5737
5744
  const px2 = _chunkJ5BA3BQ6cjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
5738
- next = _chunkYAFS2QFZcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
5745
+ next = _chunkJLGNZMUVcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
5739
5746
  } else {
5740
5747
  const doc = { layers: edited.layers, globalLight: edited.globalLight, patterns: edited.patterns };
5741
- next = _chunkYAFS2QFZcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _215 => _215.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _216 => _216.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
5748
+ next = _chunkJLGNZMUVcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _215 => _215.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _216 => _216.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
5742
5749
  }
5743
5750
  }
5744
5751
  const saved = top.saved;
@@ -5757,7 +5764,7 @@ var ImageEditorController = (_class7 = class {
5757
5764
  this.notify();
5758
5765
  return { layerId: top.layerId, changed: false, layerIds: [] };
5759
5766
  }
5760
- const res = _chunkYAFS2QFZcjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
5767
+ const res = _chunkJLGNZMUVcjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
5761
5768
  this.commitLayers(res.layers);
5762
5769
  return { layerId: top.layerId, changed: true, layerIds: res.ids };
5763
5770
  }
@@ -5772,35 +5779,35 @@ var ImageEditorController = (_class7 = class {
5772
5779
  // --- Layer effects ---
5773
5780
  /** A layer's effects (an empty, enabled list when it has none). */
5774
5781
  getLayerEffects(id) {
5775
- return _chunkYAFS2QFZcjs.layerEffectsOf.call(void 0, _chunkYAFS2QFZcjs.requireLayer.call(void 0, this.state.layers, id).layer);
5782
+ return _chunkJLGNZMUVcjs.layerEffectsOf.call(void 0, _chunkJLGNZMUVcjs.requireLayer.call(void 0, this.state.layers, id).layer);
5776
5783
  }
5777
5784
  /**
5778
5785
  * Adds an effect of `kind` with Photoshop's defaults and `params` applied (one undo step), at
5779
5786
  * `index` in the layer's effect list (default the end). Returns the new effect and the effects.
5780
5787
  */
5781
5788
  addLayerEffect(id, kind, params = {}, index) {
5782
- const res = _chunkYAFS2QFZcjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
5789
+ const res = _chunkJLGNZMUVcjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
5783
5790
  this.commitLayers(res.layers);
5784
5791
  return { effect: res.effect, effects: this.getLayerEffects(id) };
5785
5792
  }
5786
5793
  /** Changes one effect (one undo step, or none with `commitToHistory = false` during a drag). Returns the effects. */
5787
5794
  updateLayerEffect(id, effectId, changes, commitToHistory = true) {
5788
- this.commitLayers(_chunkYAFS2QFZcjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
5795
+ this.commitLayers(_chunkJLGNZMUVcjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
5789
5796
  return this.getLayerEffects(id);
5790
5797
  }
5791
5798
  /** Removes one effect (one undo step). Returns the remaining effects. */
5792
5799
  removeLayerEffect(id, effectId) {
5793
- this.commitLayers(_chunkYAFS2QFZcjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
5800
+ this.commitLayers(_chunkJLGNZMUVcjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
5794
5801
  return this.getLayerEffects(id);
5795
5802
  }
5796
5803
  /** Turns a layer's effects on or off as a whole and, when given, sets Scale Effects (one undo step). */
5797
5804
  setLayerEffectsEnabled(id, enabled, scale, commitToHistory = true) {
5798
- this.commitLayers(_chunkYAFS2QFZcjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
5805
+ this.commitLayers(_chunkJLGNZMUVcjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
5799
5806
  return this.getLayerEffects(id);
5800
5807
  }
5801
5808
  /** Replaces a layer's effects (one undo step; `null` removes them). Returns the effects. */
5802
5809
  setLayerEffects(id, effects, commitToHistory = true) {
5803
- this.commitLayers(_chunkYAFS2QFZcjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
5810
+ this.commitLayers(_chunkJLGNZMUVcjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
5804
5811
  return this.getLayerEffects(id);
5805
5812
  }
5806
5813
  __init76() {this.patternIds = /* @__PURE__ */ new WeakMap()}
@@ -5826,8 +5833,8 @@ var ImageEditorController = (_class7 = class {
5826
5833
  /** Sets the global light (one undo step). `angle` -360..360°, `altitude` 0..90°. Returns it. */
5827
5834
  setGlobalLight(light, commitToHistory = true) {
5828
5835
  const next = { ...this.getGlobalLight(), ...light };
5829
- if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
5830
- if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
5836
+ if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
5837
+ if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
5831
5838
  if (commitToHistory) this.recordHistory();
5832
5839
  if (next.angle === _chunk24ATT2PEcjs.DEFAULT_GLOBAL_LIGHT.angle && next.altitude === _chunk24ATT2PEcjs.DEFAULT_GLOBAL_LIGHT.altitude) delete this.state.globalLight;
5833
5840
  else this.state.globalLight = next;
@@ -5838,16 +5845,16 @@ var ImageEditorController = (_class7 = class {
5838
5845
  async compositeToSurface(layers, rect) {
5839
5846
  const { width, height } = this.naturalSize;
5840
5847
  if (_chunk24ATT2PEcjs.flattenLayers.call(void 0, layers).some((l) => l.type === "annotation" && l.visible) && !this.renderer.canRasterize()) {
5841
- throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
5848
+ throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
5842
5849
  }
5843
5850
  await this.renderer.prepareLayerAssets(layers, width, height);
5844
5851
  const sources = this.renderer.compositorSources(width, height);
5845
5852
  const depth = this.bitDepth;
5846
5853
  if (depth !== 8) {
5847
- const samples = _chunk24ATT2PEcjs.workingToSamples.call(void 0, _chunkYAFS2QFZcjs.compositeDeep.call(void 0, layers, rect, sources, depth), depth);
5854
+ const samples = _chunk24ATT2PEcjs.workingToSamples.call(void 0, _chunkJLGNZMUVcjs.compositeDeep.call(void 0, layers, rect, sources, depth), depth);
5848
5855
  return _chunkJ5BA3BQ6cjs.surfaceFromDeepPixels.call(void 0, { width: rect.width, height: rect.height, data: samples }, 4, rect.x, rect.y);
5849
5856
  }
5850
- const data = new (0, _chunkYAFS2QFZcjs.LayerCompositor)().composite(layers, rect, sources);
5857
+ const data = new (0, _chunkJLGNZMUVcjs.LayerCompositor)().composite(layers, rect, sources);
5851
5858
  return _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data }, 4, rect.x, rect.y);
5852
5859
  }
5853
5860
  /**
@@ -5860,22 +5867,22 @@ var ImageEditorController = (_class7 = class {
5860
5867
  const r = _nullishCoalesce(rect, () => ( { x: 0, y: 0, width, height }));
5861
5868
  const depth = this.bitDepth;
5862
5869
  if (depth === 8) return { width: r.width, height: r.height, depth: 16, data: _chunkJ5BA3BQ6cjs.to16From8.call(void 0, this.compositePixels(r).data) };
5863
- const data = _chunk24ATT2PEcjs.workingToSamples.call(void 0, _chunkYAFS2QFZcjs.compositeDeep.call(void 0, this.state.layers, r, this.compositorSources(), depth), depth);
5870
+ const data = _chunk24ATT2PEcjs.workingToSamples.call(void 0, _chunkJLGNZMUVcjs.compositeDeep.call(void 0, this.state.layers, r, this.compositorSources(), depth), depth);
5864
5871
  return { width: r.width, height: r.height, depth, data };
5865
5872
  }
5866
5873
  /** Document bounds a layer can paint into (pixel content, annotations, or the canvas for the rest). */
5867
5874
  paintBounds(layer) {
5868
5875
  const { width, height } = this.naturalSize;
5869
5876
  const canvas = { x: 0, y: 0, width, height };
5870
- if (_chunkYAFS2QFZcjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
5877
+ if (_chunkJLGNZMUVcjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
5871
5878
  if (layer.type === "annotation") {
5872
- const b = _chunkYAFS2QFZcjs.getAnnotationBounds.call(void 0, layer.annotation);
5879
+ const b = _chunkJLGNZMUVcjs.getAnnotationBounds.call(void 0, layer.annotation);
5873
5880
  const pad = 4 + ("strokeWidth" in layer.annotation ? layer.annotation.strokeWidth : 0);
5874
5881
  return coveringRect({ x: b.x - pad, y: b.y - pad, width: b.width + 2 * pad, height: b.height + 2 * pad });
5875
5882
  }
5876
5883
  if (layer.type === "group") {
5877
5884
  let r = null;
5878
- for (const c of layer.children) r = _chunkYAFS2QFZcjs.unionRect.call(void 0, r, this.paintBounds(c));
5885
+ for (const c of layer.children) r = _chunkJLGNZMUVcjs.unionRect.call(void 0, r, this.paintBounds(c));
5879
5886
  return _nullishCoalesce(r, () => ( canvas));
5880
5887
  }
5881
5888
  return canvas;
@@ -5886,16 +5893,16 @@ var ImageEditorController = (_class7 = class {
5886
5893
  * Returns the merged id.
5887
5894
  */
5888
5895
  async mergeDown(id) {
5889
- const loc = _chunkYAFS2QFZcjs.requireLayer.call(void 0, this.state.layers, id);
5896
+ const loc = _chunkJLGNZMUVcjs.requireLayer.call(void 0, this.state.layers, id);
5890
5897
  const upper = loc.layer;
5891
5898
  const siblings = loc.parent ? loc.parent.children : this.state.layers;
5892
5899
  const lower = siblings[loc.index - 1];
5893
- if (!lower) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
5894
- if (lower.type !== "pixel") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Merge Down needs a pixel layer below; "${lower.name || lower.id}" is a ${lower.type} layer. Move the layer or merge into another one.`);
5895
- if (!upper.visible) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
5896
- _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, upper, "all", "merge it");
5897
- _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
5898
- let rect = _nullishCoalesce(_chunkYAFS2QFZcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
5900
+ if (!lower) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
5901
+ if (lower.type !== "pixel") throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Merge Down needs a pixel layer below; "${lower.name || lower.id}" is a ${lower.type} layer. Move the layer or merge into another one.`);
5902
+ if (!upper.visible) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
5903
+ _chunkJLGNZMUVcjs.requireUnlocked.call(void 0, upper, "all", "merge it");
5904
+ _chunkJLGNZMUVcjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
5905
+ let rect = _nullishCoalesce(_chunkJLGNZMUVcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
5899
5906
  const reach = Math.max(_chunk24ATT2PEcjs.effectsMargin.call(void 0, lower.effects), upper.type === "adjustment" ? 0 : _chunk24ATT2PEcjs.effectsMargin.call(void 0, upper.effects));
5900
5907
  if (reach) rect = { x: rect.x - reach, y: rect.y - reach, width: rect.width + 2 * reach, height: rect.height + 2 * reach };
5901
5908
  const base = { ...lower, blend: "normal", opacity: 1 };
@@ -5921,12 +5928,12 @@ var ImageEditorController = (_class7 = class {
5921
5928
  */
5922
5929
  async mergeVisible() {
5923
5930
  const visible = this.state.layers.filter((l) => l.visible);
5924
- if (!visible.length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("No layer is visible.");
5931
+ if (!visible.length) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("No layer is visible.");
5925
5932
  const { width, height } = this.naturalSize;
5926
5933
  const surface = await this.compositeToSurface(visible, { x: 0, y: 0, width, height });
5927
5934
  const merged = {
5928
5935
  type: "pixel",
5929
- id: _chunkYAFS2QFZcjs.newLayerId.call(void 0, ),
5936
+ id: _chunkJLGNZMUVcjs.newLayerId.call(void 0, ),
5930
5937
  name: "Merged",
5931
5938
  visible: true,
5932
5939
  opacity: 1,
@@ -5950,8 +5957,8 @@ var ImageEditorController = (_class7 = class {
5950
5957
  const surface = await this.compositeToSurface(this.state.layers, { x: 0, y: 0, width, height });
5951
5958
  const bg = {
5952
5959
  type: "pixel",
5953
- id: _chunkYAFS2QFZcjs.BACKGROUND_LAYER_ID,
5954
- name: _chunkYAFS2QFZcjs.BACKGROUND_LAYER_NAME,
5960
+ id: _chunkJLGNZMUVcjs.BACKGROUND_LAYER_ID,
5961
+ name: _chunkJLGNZMUVcjs.BACKGROUND_LAYER_NAME,
5955
5962
  visible: true,
5956
5963
  opacity: 1,
5957
5964
  blend: "normal",
@@ -5978,7 +5985,7 @@ var ImageEditorController = (_class7 = class {
5978
5985
  const k = Math.min(1, side / Math.max(width, height));
5979
5986
  const tw = Math.max(1, Math.round(width * k));
5980
5987
  const th = Math.max(1, Math.round(height * k));
5981
- const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunkYAFS2QFZcjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
5988
+ const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunkJLGNZMUVcjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
5982
5989
  if (!surface) return null;
5983
5990
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
5984
5991
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
@@ -6020,7 +6027,7 @@ var ImageEditorController = (_class7 = class {
6020
6027
  /** Brush settings, colours and tool options of the paint tools (view state, no undo). */
6021
6028
  setPaintOptions(options) {
6022
6029
  const cur = this.state.paint;
6023
- const retouch = options.retouch ? _chunkNVTHUPJ6cjs.normalizeRetouch.call(void 0, options.retouch, cur.retouch) : cur.retouch;
6030
+ const retouch = options.retouch ? _chunkYT3JL7YMcjs.normalizeRetouch.call(void 0, options.retouch, cur.retouch) : cur.retouch;
6024
6031
  const cloneSource = cur.cloneSource && retouch.aligned !== cur.retouch.aligned ? { ...cur.cloneSource, offset: null } : cur.cloneSource;
6025
6032
  let source = cur.paint;
6026
6033
  let foreground = options.foreground !== void 0 ? toHex(parseColor(options.foreground)) : cur.foreground;
@@ -6038,7 +6045,8 @@ var ImageEditorController = (_class7 = class {
6038
6045
  mixer: options.mixer ? _chunk6GFRKLLScjs.normalizeMixer.call(void 0, { ...cur.mixer, ...options.mixer }) : cur.mixer,
6039
6046
  mixerLoad: cur.mixerLoad,
6040
6047
  retouch,
6041
- cloneSource
6048
+ cloneSource,
6049
+ cloneTransform: cur.cloneTransform
6042
6050
  };
6043
6051
  this.state.paint = next;
6044
6052
  this.notify();
@@ -6073,12 +6081,30 @@ var ImageEditorController = (_class7 = class {
6073
6081
  * pixels. The next stroke fixes the offset from its first point. View state, no undo.
6074
6082
  */
6075
6083
  setCloneSource(point) {
6076
- if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("The clone source needs finite x and y (document pixels).");
6084
+ if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("The clone source needs finite x and y (document pixels).");
6077
6085
  const source = point ? { x: Math.round(point.x), y: Math.round(point.y), offset: null } : null;
6078
6086
  this.state.paint = { ...this.state.paint, cloneSource: source };
6079
6087
  this.notify();
6080
6088
  return source;
6081
6089
  }
6090
+ /**
6091
+ * The Clone Source panel's transform for the Clone Stamp and Healing Brush: `scaleX` / `scaleY`
6092
+ * (factors, 0.01..10 in size; negative flips) and `rotate` (degrees, clockwise), merged into the
6093
+ * current one; `null` resets it. View state, no undo. Returns the transform.
6094
+ */
6095
+ setCloneTransform(t) {
6096
+ const cur = this.state.paint.cloneTransform;
6097
+ const next = t ? { ...cur, ...t } : { ..._chunkYT3JL7YMcjs.IDENTITY_CLONE_TRANSFORM };
6098
+ for (const k of ["scaleX", "scaleY"]) {
6099
+ const v = next[k];
6100
+ if (!Number.isFinite(v) || Math.abs(v) < 0.01 || Math.abs(v) > 10) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`${k} must be a scale factor between 0.01 and 10 in size (negative flips), not ${String(v)}.`);
6101
+ }
6102
+ if (!Number.isFinite(next.rotate)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("rotate must be a number of degrees.");
6103
+ next.rotate = ((next.rotate + 180) % 360 + 360) % 360 - 180;
6104
+ this.state.paint = { ...this.state.paint, cloneTransform: next };
6105
+ this.notify();
6106
+ return next;
6107
+ }
6082
6108
  /** D: black foreground, white background. */
6083
6109
  resetPaintColors() {
6084
6110
  this.setPaintOptions({ foreground: "#000000", background: "#ffffff" });
@@ -6091,27 +6117,27 @@ var ImageEditorController = (_class7 = class {
6091
6117
  /** Resolves and validates what a stroke, fill or clear paints into. */
6092
6118
  paintTarget(layerId, channel, action) {
6093
6119
  const id = _nullishCoalesce(layerId, () => ( this.state.activeLayerId));
6094
- if (!id) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`);
6095
- const layer = _chunkYAFS2QFZcjs.requireLayer.call(void 0, this.state.layers, id).layer;
6120
+ if (!id) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`);
6121
+ const layer = _chunkJLGNZMUVcjs.requireLayer.call(void 0, this.state.layers, id).layer;
6096
6122
  const ch = _nullishCoalesce(channel, () => ( (id === this.state.activeLayerId ? this.state.activeTarget : "pixels")));
6097
6123
  if (ch === "mask") {
6098
- if (!layer.mask) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`);
6099
- if (layer.mask.source) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is generated, not painted.`);
6100
- _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "all", action);
6124
+ if (!layer.mask) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`);
6125
+ if (layer.mask.source) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is generated, not painted.`);
6126
+ _chunkJLGNZMUVcjs.requireUnlocked.call(void 0, layer, "all", action);
6101
6127
  } else if (ch === "filter-mask") {
6102
6128
  if (layer.type !== "smart" || !_optionalChain([layer, 'access', _224 => _224.smartFilters, 'optionalAccess', _225 => _225.mask])) {
6103
- throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`);
6129
+ throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Layer "${layer.name || id}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`);
6104
6130
  }
6105
- if (!_chunkYAFS2QFZcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`);
6106
- _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "all", action);
6131
+ if (!_chunkJLGNZMUVcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`);
6132
+ _chunkJLGNZMUVcjs.requireUnlocked.call(void 0, layer, "all", action);
6107
6133
  } else {
6108
- if (layer.type === "smart") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" is a smart object; its pixels come from its contents. Rasterize it (rasterize_smart_object), edit its contents (edit_smart_object_contents), or ${action} on its mask or filter mask.`);
6109
- if (layer.type === "shape") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" is a shape layer; its pixels are drawn from its paths. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`);
6110
- if (layer.type === "type") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" is a type layer; its pixels are drawn from its text. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`);
6111
- if (layer.type !== "pixel") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`);
6112
- _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "pixels", action);
6134
+ if (layer.type === "smart") throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Layer "${layer.name || id}" is a smart object; its pixels come from its contents. Rasterize it (rasterize_smart_object), edit its contents (edit_smart_object_contents), or ${action} on its mask or filter mask.`);
6135
+ if (layer.type === "shape") throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Layer "${layer.name || id}" is a shape layer; its pixels are drawn from its paths. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`);
6136
+ if (layer.type === "type") throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Layer "${layer.name || id}" is a type layer; its pixels are drawn from its text. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`);
6137
+ if (layer.type !== "pixel") throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Layer "${layer.name || id}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`);
6138
+ _chunkJLGNZMUVcjs.requireUnlocked.call(void 0, layer, "pixels", action);
6113
6139
  }
6114
- if (!layer.visible) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" is hidden; show it before you ${action}.`);
6140
+ if (!layer.visible) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Layer "${layer.name || id}" is hidden; show it before you ${action}.`);
6115
6141
  const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
6116
6142
  const surface = ch === "mask" ? layer.mask.surface : ch === "filter-mask" ? layer.smartFilters.mask.surface : this.surfaceOf(layer);
6117
6143
  const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _226 => _226.locks, 'optionalAccess', _227 => _227.transparency]));
@@ -6120,7 +6146,7 @@ var ImageEditorController = (_class7 = class {
6120
6146
  /** The layer with its pixels (or mask) replaced by `surface`. */
6121
6147
  withSurface(layer, channel, surface) {
6122
6148
  if (channel === "mask") return { ...layer, mask: { ...layer.mask, surface } };
6123
- if (channel === "filter-mask") return _chunkYAFS2QFZcjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
6149
+ if (channel === "filter-mask") return _chunkJLGNZMUVcjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
6124
6150
  const next = { ...layer, surface };
6125
6151
  delete next.source;
6126
6152
  return next;
@@ -6133,10 +6159,10 @@ var ImageEditorController = (_class7 = class {
6133
6159
  */
6134
6160
  beginStroke(init = {}) {
6135
6161
  const tool = _nullishCoalesce(init.tool, () => ( "brush"));
6136
- if (!STROKE_TOOLS.includes(tool)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use one of ${STROKE_TOOLS.join(", ")}.`);
6162
+ if (!STROKE_TOOLS.includes(tool)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use one of ${STROKE_TOOLS.join(", ")}.`);
6137
6163
  const target = this.paintTarget(init.layerId, init.channel, tool === "eraser" ? "erase" : isRetouchTool(tool) ? "retouch" : "paint");
6138
6164
  if (tool === "mixer" && target.channel !== "pixels") {
6139
- throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.");
6165
+ throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.");
6140
6166
  }
6141
6167
  const brush = _chunk6GFRKLLScjs.normalizeBrush.call(void 0, { ...this.state.paint.brush, ..._nullishCoalesce(init.brush, () => ( {})) });
6142
6168
  let strokePaint = null;
@@ -6168,11 +6194,11 @@ var ImageEditorController = (_class7 = class {
6168
6194
  }
6169
6195
  /** A retouching stroke's start: its settings, what it samples and how it composites. */
6170
6196
  retouchStroke(tool, init, brush, target, apply) {
6171
- const settings = _chunkNVTHUPJ6cjs.normalizeRetouch.call(void 0, _nullishCoalesce(init.retouch, () => ( {})), this.state.paint.retouch);
6197
+ const settings = _chunkYT3JL7YMcjs.normalizeRetouch.call(void 0, _nullishCoalesce(init.retouch, () => ( {})), this.state.paint.retouch);
6172
6198
  const mask = target.channel !== "pixels";
6173
- if (tool === "sponge" && mask) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("The Sponge changes saturation, and a mask has none; target pixels (channel pixels), or use dodge or burn on the mask.");
6174
- if (tool === "smudge") return { kind: "dabs", create: (pixels) => new (0, _chunkNVTHUPJ6cjs.RetouchDabStroke)(brush, pixels, _chunkNVTHUPJ6cjs.smudgeEffect.call(void 0, brush, settings.strength)) };
6175
- if (tool === "sponge") return { kind: "dabs", create: (pixels) => new (0, _chunkNVTHUPJ6cjs.RetouchDabStroke)(brush, pixels, _chunkNVTHUPJ6cjs.spongeEffect.call(void 0, brush, settings.spongeMode === "saturate", settings.vibrance)) };
6199
+ if (tool === "sponge" && mask) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("The Sponge changes saturation, and a mask has none; target pixels (channel pixels), or use dodge or burn on the mask.");
6200
+ if (tool === "smudge") return { kind: "dabs", create: (pixels) => new (0, _chunkYT3JL7YMcjs.RetouchDabStroke)(brush, pixels, _chunkYT3JL7YMcjs.smudgeEffect.call(void 0, brush, settings.strength)) };
6201
+ if (tool === "sponge") return { kind: "dabs", create: (pixels) => new (0, _chunkYT3JL7YMcjs.RetouchDabStroke)(brush, pixels, _chunkYT3JL7YMcjs.spongeEffect.call(void 0, brush, settings.spongeMode === "saturate", settings.vibrance)) };
6176
6202
  const retouchApply = {
6177
6203
  opacity: tool === "clone" || tool === "heal" || tool === "history" ? brush.opacity : tool === "blur" || tool === "sharpen" ? brush.opacity * settings.strength : 1,
6178
6204
  blend: tool === "clone" && !mask ? brush.blend : "normal",
@@ -6182,7 +6208,7 @@ var ImageEditorController = (_class7 = class {
6182
6208
  };
6183
6209
  const coverage = new (0, _chunk6GFRKLLScjs.StrokeCoverage)(brush);
6184
6210
  if (tool === "dodge" || tool === "burn") {
6185
- const paint2 = { kind: "tone", tone: _chunkNVTHUPJ6cjs.toneOf.call(void 0, tool, settings) };
6211
+ const paint2 = { kind: "tone", tone: _chunkYT3JL7YMcjs.toneOf.call(void 0, tool, settings) };
6186
6212
  return { kind: "coverage", coverage, apply: retouchApply, start: () => {
6187
6213
  }, paint: () => paint2 };
6188
6214
  }
@@ -6190,11 +6216,11 @@ var ImageEditorController = (_class7 = class {
6190
6216
  const n = target.surface.channels;
6191
6217
  const depth = !mask && this.bitDepth !== 8 ? this.bitDepth : null;
6192
6218
  const m = 6;
6193
- const filtered = new (0, _chunkNVTHUPJ6cjs.TilePixelSource)(
6219
+ const filtered = new (0, _chunkYT3JL7YMcjs.TilePixelSource)(
6194
6220
  (tx, ty) => {
6195
6221
  const r = { x: tx * _chunkJ5BA3BQ6cjs.TILE - m, y: ty * _chunkJ5BA3BQ6cjs.TILE - m, width: _chunkJ5BA3BQ6cjs.TILE + 2 * m, height: _chunkJ5BA3BQ6cjs.TILE + 2 * m };
6196
6222
  const d = workRegionOf(target.surface, r, depth);
6197
- _chunkNVTHUPJ6cjs.retouchFilter.call(void 0, d, r.width, r.height, n, tool, 2, 1.2);
6223
+ _chunkYT3JL7YMcjs.retouchFilter.call(void 0, d, r.width, r.height, n, tool, 2, 1.2);
6198
6224
  const out = new Float32Array(_chunkJ5BA3BQ6cjs.TILE * _chunkJ5BA3BQ6cjs.TILE * n);
6199
6225
  for (let y = 0; y < _chunkJ5BA3BQ6cjs.TILE; y++) out.set(d.subarray(((y + m) * r.width + m) * n, ((y + m) * r.width + m + _chunkJ5BA3BQ6cjs.TILE) * n), y * _chunkJ5BA3BQ6cjs.TILE * n);
6200
6226
  return out;
@@ -6209,21 +6235,21 @@ var ImageEditorController = (_class7 = class {
6209
6235
  if (tool === "history") {
6210
6236
  const steps = settings.historySteps;
6211
6237
  const entry = steps > 0 ? _nullishCoalesce(this.undoStack[this.undoStack.length - steps], () => ( this.undoStack[0])) : this.undoStack[0];
6212
- if (!entry) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("There is no earlier state to paint from yet: the History Brush paints a layer as it was some undo steps back. Make a change first.");
6238
+ if (!entry) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("There is no earlier state to paint from yet: the History Brush paints a layer as it was some undo steps back. Make a change first.");
6213
6239
  const then = _optionalChain([_chunk24ATT2PEcjs.findLayer.call(void 0, entry.layers, target.id), 'optionalAccess', _232 => _232.layer]);
6214
- if (!then) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${target.id}" did not exist ${steps > 0 ? `${steps} steps back` : "in the oldest state"}; choose fewer history steps (historySteps).`);
6240
+ if (!then) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Layer "${target.id}" did not exist ${steps > 0 ? `${steps} steps back` : "in the oldest state"}; choose fewer history steps (historySteps).`);
6215
6241
  const surface = target.channel === "mask" ? _optionalChain([then, 'access', _233 => _233.mask, 'optionalAccess', _234 => _234.surface]) : then.type === "pixel" ? then.surface : void 0;
6216
- if (!surface) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${target.id}" had no ${target.channel === "mask" ? "mask" : "pixels"} in that state.`);
6242
+ if (!surface) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Layer "${target.id}" had no ${target.channel === "mask" ? "mask" : "pixels"} in that state.`);
6217
6243
  const offset2 = then.type === "pixel" ? then.offset : { x: 0, y: 0 };
6218
6244
  const depth = !mask && this.bitDepth !== 8 ? this.bitDepth : null;
6219
- const source2 = depth ? new (0, _chunkNVTHUPJ6cjs.TilePixelSource)((tx, ty) => workTileOf(surface.tiles.get(_chunkJ5BA3BQ6cjs.tileKey.call(void 0, tx, ty))), 4, offset2) : this.surfaceSource(surface, offset2);
6245
+ const source2 = depth ? new (0, _chunkYT3JL7YMcjs.TilePixelSource)((tx, ty) => workTileOf(surface.tiles.get(_chunkJ5BA3BQ6cjs.tileKey.call(void 0, tx, ty))), 4, offset2) : this.surfaceSource(surface, offset2);
6220
6246
  const paint2 = { kind: "source", source: source2, dx: 0, dy: 0 };
6221
6247
  return { kind: "coverage", coverage, apply: retouchApply, start: () => {
6222
6248
  }, paint: () => paint2 };
6223
6249
  }
6224
6250
  const sample = mask ? "current" : settings.sample;
6225
6251
  const deep = !mask && this.bitDepth !== 8 ? this.bitDepth : null;
6226
- const own = deep ? new (0, _chunkNVTHUPJ6cjs.TilePixelSource)((tx, ty) => workTileOf(target.surface.tiles.get(_chunkJ5BA3BQ6cjs.tileKey.call(void 0, tx, ty))), 4, target.offset) : this.surfaceSource(target.surface, target.offset);
6252
+ const own = deep ? new (0, _chunkYT3JL7YMcjs.TilePixelSource)((tx, ty) => workTileOf(target.surface.tiles.get(_chunkJ5BA3BQ6cjs.tileKey.call(void 0, tx, ty))), 4, target.offset) : this.surfaceSource(target.surface, target.offset);
6227
6253
  const source = sample === "current" ? own : this.compositeSource(sample === "all" ? null : target.id, deep);
6228
6254
  const pad = (r, m) => ({ x: r.x - m, y: r.y - m, width: r.width + 2 * m, height: r.height + 2 * m });
6229
6255
  const covered = (cov, r) => {
@@ -6244,24 +6270,26 @@ var ImageEditorController = (_class7 = class {
6244
6270
  paint: () => trail,
6245
6271
  finalPaint: (cov) => {
6246
6272
  if (!cov.bounds) return null;
6247
- const win = _chunkNVTHUPJ6cjs.spotHealWindow.call(void 0, cov.bounds, { width, height });
6273
+ const win = _chunkYT3JL7YMcjs.spotHealWindow.call(void 0, cov.bounds, { width, height });
6248
6274
  if (win.width <= 0 || win.height <= 0) return null;
6249
- const img = _chunkNVTHUPJ6cjs.readSourceRegion.call(void 0, source, win);
6275
+ const img = _chunkYT3JL7YMcjs.readSourceRegion.call(void 0, source, win);
6250
6276
  const hole = covered(cov, win);
6251
- const healed = _chunkNVTHUPJ6cjs.spotHealPixels.call(void 0, win.width, win.height, img, hole, brush.size, settings.spotType, (off) => {
6277
+ const healed = _chunkYT3JL7YMcjs.spotHealPixels.call(void 0, win.width, win.height, img, hole, brush.size, settings.spotType, (off) => {
6252
6278
  patch = off ? { x: off[0], y: off[1] } : null;
6253
6279
  });
6254
- return { kind: "source", source: new (0, _chunkNVTHUPJ6cjs.RegionPixelSource)(win, healed), dx: 0, dy: 0 };
6280
+ return { kind: "source", source: new (0, _chunkYT3JL7YMcjs.RegionPixelSource)(win, healed), dx: 0, dy: 0 };
6255
6281
  },
6256
6282
  result: () => ({ spotHeal: { offset: patch } })
6257
6283
  };
6258
6284
  }
6259
6285
  if (init.source) this.setCloneSource(init.source);
6260
6286
  const cs = this.state.paint.cloneSource;
6261
- if (!cs) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`The ${tool === "clone" ? "Clone Stamp" : "Healing Brush"} needs a source point; Alt-click the canvas, call set_clone_source, or pass source { x, y }.`);
6287
+ if (!cs) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`The ${tool === "clone" ? "Clone Stamp" : "Healing Brush"} needs a source point; Alt-click the canvas, call set_clone_source, or pass source { x, y }.`);
6262
6288
  let offset = { x: 0, y: 0 };
6263
6289
  let first = { x: 0, y: 0 };
6264
- const paint = () => ({ kind: "source", source, dx: offset.x, dy: offset.y });
6290
+ const xf = this.state.paint.cloneTransform;
6291
+ const transformed = _chunkYT3JL7YMcjs.isIdentityCloneTransform.call(void 0, xf) ? null : new (0, _chunkYT3JL7YMcjs.TransformedPixelSource)(source, (x, y) => _chunkYT3JL7YMcjs.cloneSamplePoint.call(void 0, xf, cs, { x: cs.x - offset.x, y: cs.y - offset.y }, x, y));
6292
+ const paint = () => transformed ? { kind: "source", source: transformed, dx: 0, dy: 0 } : { kind: "source", source, dx: offset.x, dy: offset.y };
6265
6293
  return {
6266
6294
  kind: "coverage",
6267
6295
  coverage,
@@ -6275,16 +6303,16 @@ var ImageEditorController = (_class7 = class {
6275
6303
  finalPaint: tool === "heal" ? (cov) => {
6276
6304
  if (!cov.bounds) return null;
6277
6305
  const g = pad(cov.bounds, 2);
6278
- const src = _chunkNVTHUPJ6cjs.readSourceRegion.call(void 0, source, g, offset.x, offset.y);
6279
- const dst = _chunkNVTHUPJ6cjs.readSourceRegion.call(void 0, source, g);
6280
- return { kind: "source", source: new (0, _chunkNVTHUPJ6cjs.RegionPixelSource)(g, _chunkNVTHUPJ6cjs.healPixels.call(void 0, g.width, g.height, src, dst, covered(cov, g))), dx: 0, dy: 0 };
6306
+ const src = transformed ? _chunkYT3JL7YMcjs.readSourceRegion.call(void 0, transformed, g) : _chunkYT3JL7YMcjs.readSourceRegion.call(void 0, source, g, offset.x, offset.y);
6307
+ const dst = _chunkYT3JL7YMcjs.readSourceRegion.call(void 0, source, g);
6308
+ return { kind: "source", source: new (0, _chunkYT3JL7YMcjs.RegionPixelSource)(g, _chunkYT3JL7YMcjs.healPixels.call(void 0, g.width, g.height, src, dst, covered(cov, g))), dx: 0, dy: 0 };
6281
6309
  } : void 0,
6282
6310
  result: () => ({ clone: { offset: { ...offset }, source: { x: first.x + offset.x, y: first.y + offset.y }, aligned: settings.aligned } })
6283
6311
  };
6284
6312
  }
6285
6313
  /** A pixel source over a surface (layer pixels or a mask) in layer space at `offset`. */
6286
6314
  surfaceSource(surface, offset) {
6287
- return new (0, _chunkNVTHUPJ6cjs.TilePixelSource)((tx, ty) => _nullishCoalesce(_optionalChain([surface, 'access', _235 => _235.tiles, 'access', _236 => _236.get, 'call', _237 => _237(_chunkJ5BA3BQ6cjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _238 => _238.data]), () => ( (surface.defaultValue ? defaultTile(surface) : null))), surface.channels, offset);
6315
+ return new (0, _chunkYT3JL7YMcjs.TilePixelSource)((tx, ty) => _nullishCoalesce(_optionalChain([surface, 'access', _235 => _235.tiles, 'access', _236 => _236.get, 'call', _237 => _237(_chunkJ5BA3BQ6cjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _238 => _238.data]), () => ( (surface.defaultValue ? defaultTile(surface) : null))), surface.channels, offset);
6288
6316
  }
6289
6317
  /** A pixel source over the composite of the current layers (through `throughId` and below, or all of them), as it is now. */
6290
6318
  compositeSource(throughId, depth = null) {
@@ -6292,8 +6320,8 @@ var ImageEditorController = (_class7 = class {
6292
6320
  const layers = throughId ? layersThrough(stack, throughId) : stack;
6293
6321
  const sources = this.compositorSources();
6294
6322
  if (depth) {
6295
- return new (0, _chunkNVTHUPJ6cjs.TilePixelSource)((tx, ty) => {
6296
- const w = _chunkYAFS2QFZcjs.compositeDeep.call(void 0, layers, { x: tx * _chunkJ5BA3BQ6cjs.TILE, y: ty * _chunkJ5BA3BQ6cjs.TILE, width: _chunkJ5BA3BQ6cjs.TILE, height: _chunkJ5BA3BQ6cjs.TILE }, sources, depth);
6323
+ return new (0, _chunkYT3JL7YMcjs.TilePixelSource)((tx, ty) => {
6324
+ const w = _chunkJLGNZMUVcjs.compositeDeep.call(void 0, layers, { x: tx * _chunkJ5BA3BQ6cjs.TILE, y: ty * _chunkJ5BA3BQ6cjs.TILE, width: _chunkJ5BA3BQ6cjs.TILE, height: _chunkJ5BA3BQ6cjs.TILE }, sources, depth);
6297
6325
  for (let i = 0; i < w.length; i += 4) {
6298
6326
  if (depth === 32) for (let c = 0; c < 3; c++) w[i + c] = _chunkJ5BA3BQ6cjs.srgbEncode.call(void 0, w[i + c]);
6299
6327
  for (let c = 0; c < 4; c++) w[i + c] *= 255;
@@ -6301,8 +6329,8 @@ var ImageEditorController = (_class7 = class {
6301
6329
  return w;
6302
6330
  }, 4);
6303
6331
  }
6304
- const compositor = new (0, _chunkYAFS2QFZcjs.LayerCompositor)();
6305
- return new (0, _chunkNVTHUPJ6cjs.TilePixelSource)((tx, ty) => compositor.tile(layers, tx, ty, sources), 4);
6332
+ const compositor = new (0, _chunkJLGNZMUVcjs.LayerCompositor)();
6333
+ return new (0, _chunkYT3JL7YMcjs.TilePixelSource)((tx, ty) => compositor.tile(layers, tx, ty, sources), 4);
6306
6334
  }
6307
6335
  /** A Mixer Brush stroke's start: the settings, and the load (refilled when asked or set to). */
6308
6336
  mixerStroke(init, brush) {
@@ -6351,9 +6379,9 @@ var ImageEditorController = (_class7 = class {
6351
6379
  * document bounds and the number of dabs.
6352
6380
  */
6353
6381
  paintStroke(init) {
6354
- if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("points must hold at least one { x, y } point.");
6382
+ if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("points must hold at least one { x, y } point.");
6355
6383
  for (const p of init.points) {
6356
- if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _239 => _239.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _240 => _240.y]))) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
6384
+ if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _239 => _239.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _240 => _240.y]))) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
6357
6385
  }
6358
6386
  const session = this.beginStroke(init);
6359
6387
  session.push(init.points);
@@ -6379,8 +6407,8 @@ var ImageEditorController = (_class7 = class {
6379
6407
  const target = this.paintTarget(options.layerId, options.channel, mode === "paint" ? "fill" : "clear");
6380
6408
  const { width, height } = this.naturalSize;
6381
6409
  const opacity = _nullishCoalesce(options.opacity, () => ( 1));
6382
- if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("opacity must be from 0 to 1.");
6383
- const blend = _nullishCoalesce(_chunkYAFS2QFZcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
6410
+ if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("opacity must be from 0 to 1.");
6411
+ const blend = _nullishCoalesce(_chunkJLGNZMUVcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
6384
6412
  const sel = options.useSelection !== false && _optionalChain([this, 'access', _241 => _241.state, 'access', _242 => _242.selection, 'optionalAccess', _243 => _243.bounds]) ? this.state.selection : null;
6385
6413
  const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _244 => _244.bounds]), () => ( { x: 0, y: 0, width, height }));
6386
6414
  const coverage = new (0, _chunk6GFRKLLScjs.CoverageMap)();
@@ -6416,7 +6444,7 @@ var ImageEditorController = (_class7 = class {
6416
6444
  // --- Adjustments ---
6417
6445
  /** The pixel layer the base sliders edit: the active pixel layer, else the Background. */
6418
6446
  developLayer() {
6419
- return _chunkYAFS2QFZcjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
6447
+ return _chunkJLGNZMUVcjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
6420
6448
  }
6421
6449
  /**
6422
6450
  * Sets base adjustment values as one undo step (unless `commitToHistory` is false). The base
@@ -6442,7 +6470,7 @@ var ImageEditorController = (_class7 = class {
6442
6470
  this.state.outputOpacity = Math.min(1, Math.max(0, partial.opacity));
6443
6471
  }
6444
6472
  if ("layers" in partial) {
6445
- layers = this.replaceAdjustmentNodes(layers, _chunkYAFS2QFZcjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
6473
+ layers = this.replaceAdjustmentNodes(layers, _chunkJLGNZMUVcjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
6446
6474
  }
6447
6475
  this.state.layers = layers;
6448
6476
  this.notify();
@@ -6450,7 +6478,7 @@ var ImageEditorController = (_class7 = class {
6450
6478
  /** True when the adjustments use an older rendering process than {@link LATEST_PROCESS_VERSION}. */
6451
6479
  get isProcessOutdated() {
6452
6480
  this.syncViews();
6453
- return _chunkYAFS2QFZcjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunkYAFS2QFZcjs.LATEST_PROCESS_VERSION;
6481
+ return _chunkJLGNZMUVcjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunkJLGNZMUVcjs.LATEST_PROCESS_VERSION;
6454
6482
  }
6455
6483
  /**
6456
6484
  * Update to Current Process: re-interprets the current adjustment values with the latest
@@ -6458,7 +6486,7 @@ var ImageEditorController = (_class7 = class {
6458
6486
  */
6459
6487
  upgradeProcess() {
6460
6488
  if (!this.isProcessOutdated) return false;
6461
- this.setAdjustments({ process: _chunkYAFS2QFZcjs.LATEST_PROCESS_VERSION });
6489
+ this.setAdjustments({ process: _chunkJLGNZMUVcjs.LATEST_PROCESS_VERSION });
6462
6490
  return true;
6463
6491
  }
6464
6492
  /** Resets the base sliders (latest process). Adjustment layers are kept; see `clearAdjustmentLayers`. */
@@ -6469,7 +6497,7 @@ var ImageEditorController = (_class7 = class {
6469
6497
  this.state.layers = _chunk24ATT2PEcjs.mapLayer.call(void 0,
6470
6498
  this.state.layers,
6471
6499
  target.id,
6472
- (l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunkYAFS2QFZcjs.LATEST_PROCESS_VERSION }), 0)
6500
+ (l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunkJLGNZMUVcjs.LATEST_PROCESS_VERSION }), 0)
6473
6501
  );
6474
6502
  }
6475
6503
  delete this.state.legacyOutputBlur;
@@ -6533,7 +6561,7 @@ var ImageEditorController = (_class7 = class {
6533
6561
  const existing = new Set(this.adjustmentNodes(out).map((n) => n.id));
6534
6562
  for (const l of next) {
6535
6563
  if (existing.has(l.id)) continue;
6536
- out = this.placeLayer(out, _chunkYAFS2QFZcjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
6564
+ out = this.placeLayer(out, _chunkJLGNZMUVcjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
6537
6565
  }
6538
6566
  const order = next.map((l) => l.id);
6539
6567
  for (let to = 0; to < order.length; to++) out = this.moveAdjustmentNode(out, order[to], to);
@@ -6548,7 +6576,7 @@ var ImageEditorController = (_class7 = class {
6548
6576
  addAdjustmentLayer(init, index) {
6549
6577
  const spec = typeof init === "string" ? { kind: init } : init;
6550
6578
  const ids = new Set(_chunk24ATT2PEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
6551
- const layer = _chunkYAFS2QFZcjs.createAdjustmentLayer.call(void 0, spec.kind, {
6579
+ const layer = _chunkJLGNZMUVcjs.createAdjustmentLayer.call(void 0, spec.kind, {
6552
6580
  id: spec.id && !ids.has(spec.id) ? spec.id : void 0,
6553
6581
  name: spec.name,
6554
6582
  params: spec.params,
@@ -6557,10 +6585,10 @@ var ImageEditorController = (_class7 = class {
6557
6585
  blend: spec.blend,
6558
6586
  mask: _nullishCoalesce(spec.mask, () => ( void 0))
6559
6587
  });
6560
- while (ids.has(layer.id)) layer.id = _chunkYAFS2QFZcjs.newLayerId.call(void 0, "adj");
6588
+ while (ids.has(layer.id)) layer.id = _chunkJLGNZMUVcjs.newLayerId.call(void 0, "adj");
6561
6589
  const { width, height } = this.naturalSize;
6562
6590
  this.recordHistory();
6563
- const node = _chunkYAFS2QFZcjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
6591
+ const node = _chunkJLGNZMUVcjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
6564
6592
  const positioned = Boolean(spec.aboveId || spec.parentId);
6565
6593
  this.state.layers = this.placeLayer(this.state.layers, node, {
6566
6594
  aboveId: spec.aboveId,
@@ -6580,7 +6608,7 @@ var ImageEditorController = (_class7 = class {
6580
6608
  if (!loc || loc.layer.type !== "adjustment") return false;
6581
6609
  const { width, height } = this.naturalSize;
6582
6610
  const node = loc.layer;
6583
- const merged = _chunkYAFS2QFZcjs.normalizeAdjustmentLayer.call(void 0, {
6611
+ const merged = _chunkJLGNZMUVcjs.normalizeAdjustmentLayer.call(void 0, {
6584
6612
  id: node.id,
6585
6613
  kind: node.kind,
6586
6614
  enabled: _nullishCoalesce(update.enabled, () => ( node.visible)),
@@ -6600,7 +6628,7 @@ var ImageEditorController = (_class7 = class {
6600
6628
  params: merged.params
6601
6629
  };
6602
6630
  if (update.mask !== void 0) {
6603
- const mask = update.mask ? _chunkYAFS2QFZcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
6631
+ const mask = update.mask ? _chunkJLGNZMUVcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
6604
6632
  if (mask) next.mask = mask;
6605
6633
  else delete next.mask;
6606
6634
  }
@@ -6687,8 +6715,8 @@ var ImageEditorController = (_class7 = class {
6687
6715
  const { width, height } = this.naturalSize;
6688
6716
  let next = null;
6689
6717
  if (mask) {
6690
- const sized = mask.width === width && mask.height === height ? mask : _chunkYAFS2QFZcjs.resizeSelection.call(void 0, mask, width, height);
6691
- next = _chunkYAFS2QFZcjs.combineSelections.call(void 0, this.state.selection, sized, mode);
6718
+ const sized = mask.width === width && mask.height === height ? mask : _chunkJLGNZMUVcjs.resizeSelection.call(void 0, mask, width, height);
6719
+ next = _chunkJLGNZMUVcjs.combineSelections.call(void 0, this.state.selection, sized, mode);
6692
6720
  } else if (mode !== "replace") {
6693
6721
  return false;
6694
6722
  }
@@ -6702,7 +6730,7 @@ var ImageEditorController = (_class7 = class {
6702
6730
  /** Select › All. */
6703
6731
  selectAll() {
6704
6732
  const { width, height } = this.naturalSize;
6705
- return this.setSelection(_chunkYAFS2QFZcjs.fullSelection.call(void 0, width, height));
6733
+ return this.setSelection(_chunkJLGNZMUVcjs.fullSelection.call(void 0, width, height));
6706
6734
  }
6707
6735
  /** Select › Deselect. */
6708
6736
  deselect() {
@@ -6711,11 +6739,11 @@ var ImageEditorController = (_class7 = class {
6711
6739
  /** Select › Inverse (with nothing selected, selects everything). */
6712
6740
  invertSelection() {
6713
6741
  const { width, height } = this.naturalSize;
6714
- const current = _nullishCoalesce(this.state.selection, () => ( _chunkYAFS2QFZcjs.createSelectionMask.call(void 0, width, height)));
6715
- return this.setSelection(_chunkYAFS2QFZcjs.invertSelection.call(void 0, current));
6742
+ const current = _nullishCoalesce(this.state.selection, () => ( _chunkJLGNZMUVcjs.createSelectionMask.call(void 0, width, height)));
6743
+ return this.setSelection(_chunkJLGNZMUVcjs.invertSelection.call(void 0, current));
6716
6744
  }
6717
6745
  shapeCommand(mask, options) {
6718
- const shaped = options.feather && options.feather > 0 ? _chunkYAFS2QFZcjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
6746
+ const shaped = options.feather && options.feather > 0 ? _chunkJLGNZMUVcjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
6719
6747
  return this.setSelection(shaped, _nullishCoalesce(options.mode, () => ( "replace")));
6720
6748
  }
6721
6749
  /** Rectangular marquee in natural image pixels. */
@@ -6769,11 +6797,11 @@ var ImageEditorController = (_class7 = class {
6769
6797
  if (!this.samplePixelsOverride && !options.pixels) this.samplePixels = null;
6770
6798
  return null;
6771
6799
  }
6772
- const legacy = _chunkYAFS2QFZcjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
6800
+ const legacy = _chunkJLGNZMUVcjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
6773
6801
  if (options.sample === "active-layer") {
6774
6802
  const layer = this.getActiveLayer();
6775
6803
  if (!layer || layer.type !== "pixel") {
6776
- throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
6804
+ throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
6777
6805
  }
6778
6806
  const surface = layer.source === "document" && options.pixels ? _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, options.pixels, 4) : this.surfaceOf(layer);
6779
6807
  return { width, height, data: _chunkJ5BA3BQ6cjs.readRegion.call(void 0, surface, { x: -layer.offset.x, y: -layer.offset.y, width, height }) };
@@ -6782,7 +6810,7 @@ var ImageEditorController = (_class7 = class {
6782
6810
  this.syncViews();
6783
6811
  if (legacy && !options.pixels) {
6784
6812
  const copy = { width: base.width, height: base.height, data: new Uint8ClampedArray(base.data) };
6785
- _chunkYAFS2QFZcjs.applyAdjustments.call(void 0, copy, _chunkYAFS2QFZcjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
6813
+ _chunkJLGNZMUVcjs.applyAdjustments.call(void 0, copy, _chunkJLGNZMUVcjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
6786
6814
  return copy;
6787
6815
  }
6788
6816
  const pixels = options.pixels;
@@ -6794,7 +6822,7 @@ var ImageEditorController = (_class7 = class {
6794
6822
  };
6795
6823
  const stack = withoutAnnotations(this.state.layers);
6796
6824
  const layers = options.sampleMerged ? stack : pixelsOnly(stack);
6797
- const data = new (0, _chunkYAFS2QFZcjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
6825
+ const data = new (0, _chunkJLGNZMUVcjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
6798
6826
  return { width, height, data };
6799
6827
  }
6800
6828
  async requirePixels(options) {
@@ -6821,7 +6849,7 @@ var ImageEditorController = (_class7 = class {
6821
6849
  modifySelection(op, radius) {
6822
6850
  const sel = this.state.selection;
6823
6851
  if (!_optionalChain([sel, 'optionalAccess', _258 => _258.bounds])) return false;
6824
- return this.setSelection(_chunkYAFS2QFZcjs.modifySelection.call(void 0, sel, op, radius));
6852
+ return this.setSelection(_chunkJLGNZMUVcjs.modifySelection.call(void 0, sel, op, radius));
6825
6853
  }
6826
6854
  /**
6827
6855
  * Refine Edge: snaps the selection (e.g. a coarse AI mask loaded with `loadSelectionFromImage`)
@@ -6852,7 +6880,7 @@ var ImageEditorController = (_class7 = class {
6852
6880
  } else {
6853
6881
  pixels = source;
6854
6882
  }
6855
- this.setSelection(_chunkYAFS2QFZcjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
6883
+ this.setSelection(_chunkJLGNZMUVcjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
6856
6884
  return this.getSelection();
6857
6885
  }
6858
6886
  /** Quick Mask view (tints the unselected area). View state: no undo step. */
@@ -6864,7 +6892,7 @@ var ImageEditorController = (_class7 = class {
6864
6892
  // --- Layer masks ---
6865
6893
  maskFromSelection(sel, props = {}) {
6866
6894
  const { width, height } = this.naturalSize;
6867
- const sized = sel.width === width && sel.height === height ? sel : _chunkYAFS2QFZcjs.resizeSelection.call(void 0, sel, width, height);
6895
+ const sized = sel.width === width && sel.height === height ? sel : _chunkJLGNZMUVcjs.resizeSelection.call(void 0, sel, width, height);
6868
6896
  const mask = { surface: _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, { width, height, data: sized.data }, 1, 0, 0, 0), defaultValue: 0 };
6869
6897
  return withMaskProps(mask, props);
6870
6898
  }
@@ -6910,7 +6938,7 @@ var ImageEditorController = (_class7 = class {
6910
6938
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
6911
6939
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
6912
6940
  const data = _chunkJ5BA3BQ6cjs.readRegion.call(void 0, layer.mask.surface, { x: -ox, y: -oy, width, height });
6913
- const sel = _chunkYAFS2QFZcjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
6941
+ const sel = _chunkJLGNZMUVcjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
6914
6942
  return this.setSelection(sel, mode);
6915
6943
  }
6916
6944
  // --- Histogram ---
@@ -6940,9 +6968,9 @@ var ImageEditorController = (_class7 = class {
6940
6968
  merged.depthRange = [...merged.depthRange];
6941
6969
  this.state.layers = _chunk24ATT2PEcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
6942
6970
  const next = { ...l };
6943
- if (_chunkYAFS2QFZcjs.isDefaultDepthMask.call(void 0, merged)) {
6971
+ if (_chunkJLGNZMUVcjs.isDefaultDepthMask.call(void 0, merged)) {
6944
6972
  if (_optionalChain([next, 'access', _264 => _264.mask, 'optionalAccess', _265 => _265.source])) delete next.mask;
6945
- } else next.mask = _chunkYAFS2QFZcjs.depthRasterMask.call(void 0, merged);
6973
+ } else next.mask = _chunkJLGNZMUVcjs.depthRasterMask.call(void 0, merged);
6946
6974
  return next;
6947
6975
  });
6948
6976
  }
@@ -6963,7 +6991,7 @@ var ImageEditorController = (_class7 = class {
6963
6991
  // --- Annotations & Layers ---
6964
6992
  /** The layer showing annotation `id`: an annotation layer, or a shape layer migrated from it. */
6965
6993
  annotationLayer(id) {
6966
- return _chunk24ATT2PEcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkYAFS2QFZcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _268 => _268.id]) === id);
6994
+ return _chunk24ATT2PEcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkJLGNZMUVcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _268 => _268.id]) === id);
6967
6995
  }
6968
6996
  /** What migrating an annotation needs: the canvas size, patterns and the text shaper. */
6969
6997
  annotationEnv() {
@@ -6979,7 +7007,7 @@ var ImageEditorController = (_class7 = class {
6979
7007
  this.recordHistory();
6980
7008
  const id = `ann_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`;
6981
7009
  const fullAnnotation = { ...annotation, id };
6982
- const layer = _chunkYAFS2QFZcjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
7010
+ const layer = _chunkJLGNZMUVcjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
6983
7011
  const loc = placement.aboveId ? _chunk24ATT2PEcjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
6984
7012
  this.state.layers = loc ? _chunk24ATT2PEcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _269 => _269.parent, 'optionalAccess', _270 => _270.id]), () => ( null)), loc.index + 1) : _chunk24ATT2PEcjs.insertLayer.call(void 0, this.state.layers, layer, null);
6985
7013
  this.state.selectedAnnotationId = id;
@@ -6991,17 +7019,17 @@ var ImageEditorController = (_class7 = class {
6991
7019
  this.recordHistory();
6992
7020
  }
6993
7021
  const layer = this.annotationLayer(id);
6994
- const current = layer ? _chunkYAFS2QFZcjs.annotationOfLayer.call(void 0, layer) : null;
7022
+ const current = layer ? _chunkJLGNZMUVcjs.annotationOfLayer.call(void 0, layer) : null;
6995
7023
  if (layer && current) {
6996
7024
  const annotation = { ...current, ...partial, id };
6997
- const name = layer.name === _chunkYAFS2QFZcjs.annotationLayerName.call(void 0, current) ? _chunkYAFS2QFZcjs.annotationLayerName.call(void 0, annotation) : layer.name;
7025
+ const name = layer.name === _chunkJLGNZMUVcjs.annotationLayerName.call(void 0, current) ? _chunkJLGNZMUVcjs.annotationLayerName.call(void 0, annotation) : layer.name;
6998
7026
  this.state.layers = _chunk24ATT2PEcjs.mapLayer.call(void 0, this.state.layers, layer.id, () => this.layerForAnnotation(layer, annotation, name));
6999
7027
  }
7000
7028
  this.notify();
7001
7029
  }
7002
7030
  /** `layer` (an annotation, or a shape or type layer migrated from one) showing `annotation` instead, keeping its other properties. */
7003
7031
  layerForAnnotation(layer, annotation, name) {
7004
- const fresh = _chunkYAFS2QFZcjs.annotationLayerFor.call(void 0, annotation, this.annotationEnv());
7032
+ const fresh = _chunkJLGNZMUVcjs.annotationLayerFor.call(void 0, annotation, this.annotationEnv());
7005
7033
  const keep = { id: layer.id, visible: layer.visible, opacity: layer.opacity };
7006
7034
  for (const k of ["clipped", "mask", "locks", "effects"]) if (layer[k] !== void 0) keep[k] = layer[k];
7007
7035
  if (fresh.type !== "annotation" && layer.type !== "annotation" && layer.fillOpacity !== void 0) keep.fillOpacity = layer.fillOpacity;
@@ -7088,7 +7116,10 @@ var ImageEditorController = (_class7 = class {
7088
7116
  if (s.activeTool !== "clone" && s.activeTool !== "heal") return null;
7089
7117
  const cs = s.paint.cloneSource;
7090
7118
  if (!cs) return null;
7091
- if (cursor && cs.offset && s.paint.retouch.aligned) return { x: cursor.x + cs.offset.x, y: cursor.y + cs.offset.y };
7119
+ if (cursor && cs.offset && s.paint.retouch.aligned) {
7120
+ const [x, y] = _chunkYT3JL7YMcjs.cloneSamplePoint.call(void 0, s.paint.cloneTransform, cs, { x: cs.x - cs.offset.x, y: cs.y - cs.offset.y }, cursor.x, cursor.y);
7121
+ return { x, y };
7122
+ }
7092
7123
  return { x: cs.x, y: cs.y };
7093
7124
  }
7094
7125
  async render(targetCanvas, options) {
@@ -7285,8 +7316,8 @@ var ImageEditorController = (_class7 = class {
7285
7316
  return;
7286
7317
  }
7287
7318
  const target = this.developLayer();
7288
- if (!target) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("There is no pixel layer to mask.");
7289
- _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, target, "all", "mask it");
7319
+ if (!target) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("There is no pixel layer to mask.");
7320
+ _chunkJLGNZMUVcjs.requireUnlocked.call(void 0, target, "all", "mask it");
7290
7321
  const { width, height } = this.naturalSize;
7291
7322
  let px2 = await this.decodeImage(newDataUrl);
7292
7323
  if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
@@ -7294,14 +7325,14 @@ var ImageEditorController = (_class7 = class {
7294
7325
  for (let p = 0; p < alpha.length; p++) alpha[p] = px2.data[p * 4 + 3];
7295
7326
  let surface = _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, { width, height, data: alpha }, 1, 0, 0, 0);
7296
7327
  if (target.offset.x || target.offset.y) surface = _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, surface, -target.offset.x, -target.offset.y);
7297
- this.commitLayers(_chunkYAFS2QFZcjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
7328
+ this.commitLayers(_chunkJLGNZMUVcjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
7298
7329
  return target.id;
7299
7330
  }
7300
7331
  // --- Type layers ---
7301
7332
 
7302
7333
  /** The shaper that lays out and draws type layers (`null` when there is none here). */
7303
7334
  getTextShaper() {
7304
- if (this.textShaperValue === void 0) this.textShaperValue = _chunkZ2H7KECKcjs.createCanvasTextShaper.call(void 0, { createCanvas: (w, h) => this.renderer.createCanvas(w, h) });
7335
+ if (this.textShaperValue === void 0) this.textShaperValue = _chunk2R3UW57Ucjs.createCanvasTextShaper.call(void 0, { createCanvas: (w, h) => this.renderer.createCanvas(w, h) });
7305
7336
  return this.textShaperValue;
7306
7337
  }
7307
7338
  /** Sets the text shaper (fonts) type layers lay out and draw with; existing layers redraw on their next edit. */
@@ -7318,7 +7349,7 @@ var ImageEditorController = (_class7 = class {
7318
7349
  return _nullishCoalesce(_optionalChain([this, 'access', _277 => _277.getTextShaper, 'call', _278 => _278(), 'optionalAccess', _279 => _279.families, 'optionalCall', _280 => _280()]), () => ( ["sans-serif", "serif", "monospace"]));
7319
7350
  }
7320
7351
  typeInfo(id) {
7321
- const layer = _chunkYAFS2QFZcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7352
+ const layer = _chunkJLGNZMUVcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7322
7353
  const ranges = (runs) => {
7323
7354
  let at = 0;
7324
7355
  return runs.map((r) => {
@@ -7331,7 +7362,7 @@ var ImageEditorController = (_class7 = class {
7331
7362
  let lines = [];
7332
7363
  let missing = _nullishCoalesce(layer.missingFonts, () => ( []));
7333
7364
  if (shaper) {
7334
- const layout = _chunkZ2H7KECKcjs.layoutText.call(void 0, layer, shaper);
7365
+ const layout = _chunk2R3UW57Ucjs.layoutText.call(void 0, layer, shaper);
7335
7366
  const r = (n) => Math.round(n * 1e3) / 1e3;
7336
7367
  lines = layout.lines.map((l) => ({ start: l.start, end: l.end, baseline: r(l.baseline), width: r(l.width) }));
7337
7368
  if (layer.rendering === "stored") missing = layout.missingFonts;
@@ -7361,25 +7392,25 @@ var ImageEditorController = (_class7 = class {
7361
7392
  * text wrapped in `box`. Refused without a text shaper. Returns its id.
7362
7393
  */
7363
7394
  addTextLayer(init) {
7364
- const text = _chunkYAFS2QFZcjs.normalizeText.call(void 0, init.text);
7365
- if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("x and y must be numbers (document pixels).");
7366
- const style = _chunkYAFS2QFZcjs.patchTextStyle.call(void 0, { ..._chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE, color: this.state.paint.foreground }, _nullishCoalesce(init.style, () => ( {})));
7367
- const paragraph = _chunkYAFS2QFZcjs.patchParagraphStyle.call(void 0, {}, _nullishCoalesce(init.paragraph, () => ( {})));
7395
+ const text = _chunkJLGNZMUVcjs.normalizeText.call(void 0, init.text);
7396
+ if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("x and y must be numbers (document pixels).");
7397
+ const style = _chunkJLGNZMUVcjs.patchTextStyle.call(void 0, { ..._chunk2R3UW57Ucjs.DEFAULT_TEXT_STYLE, color: this.state.paint.foreground }, _nullishCoalesce(init.style, () => ( {})));
7398
+ const paragraph = _chunkJLGNZMUVcjs.patchParagraphStyle.call(void 0, {}, _nullishCoalesce(init.paragraph, () => ( {})));
7368
7399
  let frame = { kind: "point" };
7369
7400
  if (init.box) {
7370
7401
  const { width, height } = init.box;
7371
- if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("box.width and box.height must be at least 1 pixel.");
7402
+ if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("box.width and box.height must be at least 1 pixel.");
7372
7403
  frame = { kind: "box", width, height };
7373
7404
  }
7374
- if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("rotation must be a number of degrees.");
7375
- if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("opacity must be between 0 and 1.");
7376
- if (init.blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
7405
+ if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("rotation must be a number of degrees.");
7406
+ if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("opacity must be between 0 and 1.");
7407
+ if (init.blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
7377
7408
  const t = [1, 0, 0, 1, init.x, init.y];
7378
- const transform = init.rotation ? _chunkZ2H7KECKcjs.multiplyMatrices.call(void 0, t, _chunkZ2H7KECKcjs.rotateMatrix.call(void 0, init.rotation, { x: init.x, y: init.y })) : t;
7379
- const layer = _chunkYAFS2QFZcjs.createTypeLayer.call(void 0, { text, runs: [{ length: text.length, style }], paragraphs: [{ length: text.length, style: paragraph }], frame, transform, name: _nullishCoalesce(init.name, () => ( _chunkYAFS2QFZcjs.typeLayerName.call(void 0, text))) }, this.textEnv());
7409
+ const transform = init.rotation ? _chunk2R3UW57Ucjs.multiplyMatrices.call(void 0, t, _chunk2R3UW57Ucjs.rotateMatrix.call(void 0, init.rotation, { x: init.x, y: init.y })) : t;
7410
+ const layer = _chunkJLGNZMUVcjs.createTypeLayer.call(void 0, { text, runs: [{ length: text.length, style }], paragraphs: [{ length: text.length, style: paragraph }], frame, transform, name: _nullishCoalesce(init.name, () => ( _chunkJLGNZMUVcjs.typeLayerName.call(void 0, text))) }, this.textEnv());
7380
7411
  if (init.opacity !== void 0) layer.opacity = init.opacity;
7381
7412
  if (init.blend !== void 0) layer.blend = init.blend;
7382
- const next = _chunkYAFS2QFZcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
7413
+ const next = _chunkJLGNZMUVcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
7383
7414
  this.commitLayers(next, () => {
7384
7415
  this.state.activeLayerId = layer.id;
7385
7416
  this.state.activeTarget = "pixels";
@@ -7391,28 +7422,28 @@ var ImageEditorController = (_class7 = class {
7391
7422
  * `start`. One undo step unless `commitToHistory` is false (typing). Returns the layer.
7392
7423
  */
7393
7424
  setText(id, text, range = {}, commitToHistory = true) {
7394
- const layer = _chunkYAFS2QFZcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7395
- const insert = _chunkYAFS2QFZcjs.normalizeText.call(void 0, text);
7396
- const [start, end] = _chunkYAFS2QFZcjs.textRange.call(void 0, layer.text, range.start, range.end);
7397
- const { layers } = _chunkYAFS2QFZcjs.updateTypeLayer.call(void 0, this.state.layers, id, (l) => _chunkYAFS2QFZcjs.replaceTextRange.call(void 0, l, start, end, insert), this.textEnv(), "edit its text");
7425
+ const layer = _chunkJLGNZMUVcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7426
+ const insert = _chunkJLGNZMUVcjs.normalizeText.call(void 0, text);
7427
+ const [start, end] = _chunkJLGNZMUVcjs.textRange.call(void 0, layer.text, range.start, range.end);
7428
+ const { layers } = _chunkJLGNZMUVcjs.updateTypeLayer.call(void 0, this.state.layers, id, (l) => _chunkJLGNZMUVcjs.replaceTextRange.call(void 0, l, start, end, insert), this.textEnv(), "edit its text");
7398
7429
  this.commitLayers(layers, void 0, commitToHistory);
7399
7430
  return this.typeInfo(id);
7400
7431
  }
7401
7432
  /** Sets character style fields over [start, end) (default all), one undo step. Returns the layer. */
7402
7433
  setTextStyle(id, style, range = {}, commitToHistory = true) {
7403
- const layer = _chunkYAFS2QFZcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7404
- const [start, end] = _chunkYAFS2QFZcjs.textRange.call(void 0, layer.text, range.start, range.end);
7405
- if (!Object.keys(style).length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give at least one style field to set.");
7406
- _chunkYAFS2QFZcjs.patchTextStyle.call(void 0, _chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE, style);
7407
- const { layers } = _chunkYAFS2QFZcjs.updateTypeLayer.call(void 0,
7434
+ const layer = _chunkJLGNZMUVcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7435
+ const [start, end] = _chunkJLGNZMUVcjs.textRange.call(void 0, layer.text, range.start, range.end);
7436
+ if (!Object.keys(style).length) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give at least one style field to set.");
7437
+ _chunkJLGNZMUVcjs.patchTextStyle.call(void 0, _chunk2R3UW57Ucjs.DEFAULT_TEXT_STYLE, style);
7438
+ const { layers } = _chunkJLGNZMUVcjs.updateTypeLayer.call(void 0,
7408
7439
  this.state.layers,
7409
7440
  id,
7410
7441
  (l) => {
7411
7442
  if (start === end) {
7412
- if (l.text.length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("The range is empty; give start < end (or leave both out for the whole text).");
7413
- return { runs: [{ length: 0, style: _chunkYAFS2QFZcjs.patchTextStyle.call(void 0, _chunkZ2H7KECKcjs.styleAt.call(void 0, l.runs, 0, _chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE), style) }] };
7443
+ if (l.text.length) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("The range is empty; give start < end (or leave both out for the whole text).");
7444
+ return { runs: [{ length: 0, style: _chunkJLGNZMUVcjs.patchTextStyle.call(void 0, _chunk2R3UW57Ucjs.styleAt.call(void 0, l.runs, 0, _chunk2R3UW57Ucjs.DEFAULT_TEXT_STYLE), style) }] };
7414
7445
  }
7415
- return { runs: _chunkZ2H7KECKcjs.restyleRange.call(void 0, l.runs, start, end, (s) => _chunkYAFS2QFZcjs.patchTextStyle.call(void 0, s, style)) };
7446
+ return { runs: _chunk2R3UW57Ucjs.restyleRange.call(void 0, l.runs, start, end, (s) => _chunkJLGNZMUVcjs.patchTextStyle.call(void 0, s, style)) };
7416
7447
  },
7417
7448
  this.textEnv(),
7418
7449
  "restyle its text"
@@ -7422,11 +7453,11 @@ var ImageEditorController = (_class7 = class {
7422
7453
  }
7423
7454
  /** Sets paragraph style fields on every paragraph that [start, end) touches (default all), one undo step. */
7424
7455
  setParagraphStyle(id, style, range = {}, commitToHistory = true) {
7425
- const layer = _chunkYAFS2QFZcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7426
- const [start, end] = _chunkYAFS2QFZcjs.textRange.call(void 0, layer.text, range.start, range.end);
7427
- if (!Object.keys(style).length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give at least one paragraph field to set.");
7428
- _chunkYAFS2QFZcjs.patchParagraphStyle.call(void 0, {}, style);
7429
- const { layers } = _chunkYAFS2QFZcjs.updateTypeLayer.call(void 0,
7456
+ const layer = _chunkJLGNZMUVcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7457
+ const [start, end] = _chunkJLGNZMUVcjs.textRange.call(void 0, layer.text, range.start, range.end);
7458
+ if (!Object.keys(style).length) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give at least one paragraph field to set.");
7459
+ _chunkJLGNZMUVcjs.patchParagraphStyle.call(void 0, {}, style);
7460
+ const { layers } = _chunkJLGNZMUVcjs.updateTypeLayer.call(void 0,
7430
7461
  this.state.layers,
7431
7462
  id,
7432
7463
  (l) => {
@@ -7435,7 +7466,7 @@ var ImageEditorController = (_class7 = class {
7435
7466
  const a = at;
7436
7467
  at += p.length;
7437
7468
  const touches = a < end && at > start || start === end && start >= a && (start < at || at === l.text.length);
7438
- return touches || !l.text.length ? { length: p.length, style: _chunkYAFS2QFZcjs.patchParagraphStyle.call(void 0, p.style, style) } : p;
7469
+ return touches || !l.text.length ? { length: p.length, style: _chunkJLGNZMUVcjs.patchParagraphStyle.call(void 0, p.style, style) } : p;
7439
7470
  });
7440
7471
  return { paragraphs };
7441
7472
  },
@@ -7451,21 +7482,21 @@ var ImageEditorController = (_class7 = class {
7451
7482
  * paragraph. Also resizes a box. One undo step.
7452
7483
  */
7453
7484
  setTextFrame(id, frame, commitToHistory = true) {
7454
- const layer = _chunkYAFS2QFZcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7455
- if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("width and height must be at least 1 pixel.");
7456
- if (frame.kind !== "box" && frame.kind !== "point") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("kind must be point or box.");
7485
+ const layer = _chunkJLGNZMUVcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7486
+ if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("width and height must be at least 1 pixel.");
7487
+ if (frame.kind !== "box" && frame.kind !== "point") throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("kind must be point or box.");
7457
7488
  const shaper = this.getTextShaper();
7458
- const { layers } = _chunkYAFS2QFZcjs.updateTypeLayer.call(void 0,
7489
+ const { layers } = _chunkJLGNZMUVcjs.updateTypeLayer.call(void 0,
7459
7490
  this.state.layers,
7460
7491
  id,
7461
7492
  (l) => {
7462
7493
  if (frame.kind === "box" && l.frame.kind === "box") return { frame: { kind: "box", width: frame.width, height: frame.height } };
7463
- if (!shaper) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Changing between point and paragraph text needs a text shaper to measure the text.");
7464
- const lines = _chunkZ2H7KECKcjs.layoutText.call(void 0, l, shaper).lines;
7494
+ if (!shaper) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Changing between point and paragraph text needs a text shaper to measure the text.");
7495
+ const lines = _chunk2R3UW57Ucjs.layoutText.call(void 0, l, shaper).lines;
7465
7496
  const first = lines[0];
7466
7497
  const dx = frame.kind === "box" ? first ? first.x : 0 : 0;
7467
7498
  const dy = frame.kind === "box" ? first ? first.baseline - first.ascent : 0 : first ? first.baseline : 0;
7468
- const m = _chunkYAFS2QFZcjs.textMatrix.call(void 0, l);
7499
+ const m = _chunkJLGNZMUVcjs.textMatrix.call(void 0, l);
7469
7500
  const shifted = [m[0], m[1], m[2], m[3], m[0] * dx + m[2] * dy + m[4], m[1] * dx + m[3] * dy + m[5]];
7470
7501
  const nextFrame = frame.kind === "box" ? { kind: "box", width: frame.width, height: frame.height } : { kind: "point" };
7471
7502
  return { frame: nextFrame, transform: shifted };
@@ -7482,21 +7513,21 @@ var ImageEditorController = (_class7 = class {
7482
7513
  * `warnings` says when other colours were dropped. One undo step.
7483
7514
  */
7484
7515
  convertTextToShape(id) {
7485
- const layer = _chunkYAFS2QFZcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7486
- _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "all", "convert it");
7516
+ const layer = _chunkJLGNZMUVcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7517
+ _chunkJLGNZMUVcjs.requireUnlocked.call(void 0, layer, "all", "convert it");
7487
7518
  const shaper = this.getTextShaper();
7488
- if (!shaper) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Convert to Shape needs a text shaper that gives glyph outlines; none is set here.");
7489
- const parts = _chunkYAFS2QFZcjs.textOutlines.call(void 0, layer, shaper);
7490
- const subpaths = parts.flatMap((p) => _chunkZ2H7KECKcjs.bezierToSubpaths.call(void 0, p.path));
7491
- if (!subpaths.length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("The text draws nothing (it is empty or only spaces), so there is no shape to make.");
7519
+ if (!shaper) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Convert to Shape needs a text shaper that gives glyph outlines; none is set here.");
7520
+ const parts = _chunkJLGNZMUVcjs.textOutlines.call(void 0, layer, shaper);
7521
+ const subpaths = parts.flatMap((p) => _chunk2R3UW57Ucjs.bezierToSubpaths.call(void 0, p.path));
7522
+ if (!subpaths.length) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("The text draws nothing (it is empty or only spaces), so there is no shape to make.");
7492
7523
  const warnings = [];
7493
7524
  const colors = new Set(layer.runs.filter((r) => r.length > 0).map((r) => `${r.style.color}/${_nullishCoalesce(r.style.opacity, () => ( 1))}`));
7494
7525
  if (colors.size > 1) warnings.push("The text had several colours; the shape takes the first one.");
7495
- const missing = _chunkZ2H7KECKcjs.layoutText.call(void 0, layer, shaper).missingFonts;
7526
+ const missing = _chunk2R3UW57Ucjs.layoutText.call(void 0, layer, shaper).missingFonts;
7496
7527
  if (missing.length) warnings.push(`Missing fonts were drawn with a fallback: ${missing.join(", ")}.`);
7497
- const first = _nullishCoalesce(_optionalChain([layer, 'access', _281 => _281.runs, 'access', _282 => _282.find, 'call', _283 => _283((r) => r.length > 0), 'optionalAccess', _284 => _284.style]), () => ( _chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE));
7528
+ const first = _nullishCoalesce(_optionalChain([layer, 'access', _281 => _281.runs, 'access', _282 => _282.find, 'call', _283 => _283((r) => r.length > 0), 'optionalAccess', _284 => _284.style]), () => ( _chunk2R3UW57Ucjs.DEFAULT_TEXT_STYLE));
7498
7529
  const fill = first.opacity !== void 0 && first.opacity !== 1 ? { type: "color", color: first.color, opacity: first.opacity } : { type: "color", color: first.color };
7499
- const shape = _chunkYAFS2QFZcjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
7530
+ const shape = _chunkJLGNZMUVcjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
7500
7531
  const keep = { visible: layer.visible, opacity: layer.opacity, blend: layer.blend };
7501
7532
  for (const k of ["clipped", "mask", "locks", "effects", "fillOpacity"]) if (layer[k] !== void 0) keep[k] = layer[k];
7502
7533
  this.commitLayers(_chunk24ATT2PEcjs.mapLayer.call(void 0, this.state.layers, id, () => ({ ...shape, ...keep })));
@@ -7504,23 +7535,23 @@ var ImageEditorController = (_class7 = class {
7504
7535
  }
7505
7536
  /** The layout of a type layer (lines, characters, bounds in text space), or `null` without a shaper. */
7506
7537
  getTextLayout(id) {
7507
- const layer = _chunkYAFS2QFZcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7538
+ const layer = _chunkJLGNZMUVcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7508
7539
  const shaper = this.getTextShaper();
7509
- return shaper ? _chunkZ2H7KECKcjs.layoutText.call(void 0, layer, shaper) : null;
7540
+ return shaper ? _chunk2R3UW57Ucjs.layoutText.call(void 0, layer, shaper) : null;
7510
7541
  }
7511
7542
  /** The text index nearest a document point (for clicks on a type layer). */
7512
7543
  textIndexAt(id, point) {
7513
- const layer = _chunkYAFS2QFZcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7544
+ const layer = _chunkJLGNZMUVcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7514
7545
  const layout = this.getTextLayout(id);
7515
- return layout ? _chunkZ2H7KECKcjs.textIndexAt.call(void 0, layout, _chunkYAFS2QFZcjs.toTextSpace.call(void 0, layer, point)) : layer.text.length;
7546
+ return layout ? _chunk2R3UW57Ucjs.textIndexAt.call(void 0, layout, _chunkJLGNZMUVcjs.toTextSpace.call(void 0, layer, point)) : layer.text.length;
7516
7547
  }
7517
7548
  /** The caret at text index `index` as a document-space segment (top to bottom), for drawing it. */
7518
7549
  textCaret(id, index) {
7519
- const layer = _chunkYAFS2QFZcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7550
+ const layer = _chunkJLGNZMUVcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7520
7551
  const layout = this.getTextLayout(id);
7521
7552
  if (!layout) return null;
7522
- const c = _chunkZ2H7KECKcjs.caretAt.call(void 0, layout, Math.max(0, Math.min(layer.text.length, index)));
7523
- const m = _chunkYAFS2QFZcjs.textMatrix.call(void 0, layer);
7553
+ const c = _chunk2R3UW57Ucjs.caretAt.call(void 0, layout, Math.max(0, Math.min(layer.text.length, index)));
7554
+ const m = _chunkJLGNZMUVcjs.textMatrix.call(void 0, layer);
7524
7555
  const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
7525
7556
  return { top: at(c.x, c.top), bottom: at(c.x, c.bottom), line: c.line };
7526
7557
  }
@@ -7531,14 +7562,14 @@ var ImageEditorController = (_class7 = class {
7531
7562
  }
7532
7563
  /** One component from tool or UI input (validated). */
7533
7564
  componentFrom(spec, path) {
7534
- const op = _chunkYAFS2QFZcjs.requireOperation.call(void 0, spec.op, `${path}op`);
7535
- if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
7536
- if (spec.shape !== void 0) return _chunkYAFS2QFZcjs.liveComponent.call(void 0, _chunkYAFS2QFZcjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
7537
- if (spec.subpaths !== void 0) return { op, subpaths: _chunkYAFS2QFZcjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
7538
- throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
7565
+ const op = _chunkJLGNZMUVcjs.requireOperation.call(void 0, spec.op, `${path}op`);
7566
+ if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
7567
+ if (spec.shape !== void 0) return _chunkJLGNZMUVcjs.liveComponent.call(void 0, _chunkJLGNZMUVcjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
7568
+ if (spec.subpaths !== void 0) return { op, subpaths: _chunkJLGNZMUVcjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
7569
+ throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
7539
7570
  }
7540
7571
  shapeInfo(id) {
7541
- const layer = _chunkYAFS2QFZcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7572
+ const layer = _chunkJLGNZMUVcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7542
7573
  const r = (n) => Math.round(n * 1e3) / 1e3;
7543
7574
  const box = (b) => b ? { x: r(b.x), y: r(b.y), width: r(b.width), height: r(b.height) } : null;
7544
7575
  const info = {
@@ -7548,13 +7579,13 @@ var ImageEditorController = (_class7 = class {
7548
7579
  index,
7549
7580
  op: c.op,
7550
7581
  live: c.live ? JSON.parse(JSON.stringify(c.live)) : null,
7551
- subpaths: _chunkZ2H7KECKcjs.roundSubpaths.call(void 0, c.subpaths),
7552
- bounds: box(_chunkYAFS2QFZcjs.shapeGeometryBounds.call(void 0, { components: [c] }))
7582
+ subpaths: _chunk2R3UW57Ucjs.roundSubpaths.call(void 0, c.subpaths),
7583
+ bounds: box(_chunkJLGNZMUVcjs.shapeGeometryBounds.call(void 0, { components: [c] }))
7553
7584
  })),
7554
7585
  fillRule: _nullishCoalesce(layer.fillRule, () => ( "nonzero")),
7555
7586
  fill: layer.fill ? JSON.parse(JSON.stringify(layer.fill)) : null,
7556
7587
  stroke: layer.stroke ? JSON.parse(JSON.stringify(layer.stroke)) : null,
7557
- geometryBounds: box(_chunkYAFS2QFZcjs.shapeGeometryBounds.call(void 0, layer)),
7588
+ geometryBounds: box(_chunkJLGNZMUVcjs.shapeGeometryBounds.call(void 0, layer)),
7558
7589
  bounds: this.getLayerBounds(id)
7559
7590
  };
7560
7591
  if (layer.annotation) info.annotationId = layer.annotation.id;
@@ -7571,17 +7602,17 @@ var ImageEditorController = (_class7 = class {
7571
7602
  */
7572
7603
  addShapeLayer(init) {
7573
7604
  const specs = _optionalChain([init, 'access', _289 => _289.components, 'optionalAccess', _290 => _290.length]) ? init.components : [init];
7574
- if (_optionalChain([init, 'access', _291 => _291.components, 'optionalAccess', _292 => _292.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
7605
+ if (_optionalChain([init, 'access', _291 => _291.components, 'optionalAccess', _292 => _292.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
7575
7606
  const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _293 => _293.components, 'optionalAccess', _294 => _294.length]) ? `components[${i}].` : ""));
7576
- const stroke = init.stroke ? _chunkYAFS2QFZcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
7607
+ const stroke = init.stroke ? _chunkJLGNZMUVcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
7577
7608
  const openOnly = components.every((c) => !c.live && c.subpaths.every((sp) => !sp.closed));
7578
- const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkYAFS2QFZcjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkYAFS2QFZcjs.normalizeShapePaint.call(void 0, init.fill, "fill");
7579
- if (!fill && !stroke) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
7580
- if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
7581
- if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("opacity must be between 0 and 1.");
7582
- if (init.blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
7583
- const layer = _chunkYAFS2QFZcjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
7584
- const next = _chunkYAFS2QFZcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
7609
+ const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkJLGNZMUVcjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkJLGNZMUVcjs.normalizeShapePaint.call(void 0, init.fill, "fill");
7610
+ if (!fill && !stroke) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
7611
+ if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
7612
+ if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("opacity must be between 0 and 1.");
7613
+ if (init.blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
7614
+ const layer = _chunkJLGNZMUVcjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
7615
+ const next = _chunkJLGNZMUVcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
7585
7616
  this.commitLayers(next, () => {
7586
7617
  this.state.activeLayerId = layer.id;
7587
7618
  this.state.activeTarget = "pixels";
@@ -7594,18 +7625,18 @@ var ImageEditorController = (_class7 = class {
7594
7625
  * only those settings of the current stroke. Returns the shape.
7595
7626
  */
7596
7627
  setShapeStyle(id, changes, commitToHistory = true) {
7597
- const layer = _chunkYAFS2QFZcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7598
- const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunkYAFS2QFZcjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
7599
- const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunkYAFS2QFZcjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
7600
- if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
7628
+ const layer = _chunkJLGNZMUVcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7629
+ const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunkJLGNZMUVcjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
7630
+ const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunkJLGNZMUVcjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
7631
+ if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
7601
7632
  const fillRule = _nullishCoalesce(_nullishCoalesce(changes.fillRule, () => ( layer.fillRule)), () => ( "nonzero"));
7602
- const { layers } = _chunkYAFS2QFZcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
7633
+ const { layers } = _chunkJLGNZMUVcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
7603
7634
  this.commitLayers(layers, void 0, commitToHistory);
7604
7635
  return this.shapeInfo(id);
7605
7636
  }
7606
7637
  componentIndex(layer, index) {
7607
7638
  if (!Number.isInteger(index) || index < 0 || index >= layer.components.length) {
7608
- throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
7639
+ throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
7609
7640
  }
7610
7641
  return index;
7611
7642
  }
@@ -7615,36 +7646,36 @@ var ImageEditorController = (_class7 = class {
7615
7646
  * the live shape) or its operation. Returns the shape.
7616
7647
  */
7617
7648
  setShapeComponent(id, index, change, commitToHistory = true) {
7618
- const layer = _chunkYAFS2QFZcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7649
+ const layer = _chunkJLGNZMUVcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7619
7650
  const i = this.componentIndex(layer, index);
7620
7651
  const current = layer.components[i];
7621
7652
  let shape = change.shape;
7622
7653
  if (shape && current.live && shape.kind === void 0) shape = { ...current.live, ...shape };
7623
7654
  else if (shape && current.live && shape.kind === current.live.kind) shape = { ...current.live, ...shape };
7624
- const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunkYAFS2QFZcjs.requireOperation.call(void 0, change.op) };
7655
+ const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunkJLGNZMUVcjs.requireOperation.call(void 0, change.op) };
7625
7656
  const components = layer.components.map((c, k) => k === i ? next : c);
7626
- const { layers } = _chunkYAFS2QFZcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7657
+ const { layers } = _chunkJLGNZMUVcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7627
7658
  this.commitLayers(layers, void 0, commitToHistory);
7628
7659
  return this.shapeInfo(id);
7629
7660
  }
7630
7661
  /** Adds a component to a shape (path operations), on top unless `index` is given (one undo step). Returns the shape. */
7631
7662
  addShapeComponent(id, spec, index) {
7632
- const layer = _chunkYAFS2QFZcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7663
+ const layer = _chunkJLGNZMUVcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7633
7664
  const c = this.componentFrom(spec, "");
7634
7665
  const at = index === void 0 ? layer.components.length : index;
7635
- if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
7666
+ if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
7636
7667
  const components = [...layer.components.slice(0, at), c, ...layer.components.slice(at)];
7637
- const { layers } = _chunkYAFS2QFZcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7668
+ const { layers } = _chunkJLGNZMUVcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7638
7669
  this.commitLayers(layers);
7639
7670
  return this.shapeInfo(id);
7640
7671
  }
7641
7672
  /** Removes one component of a shape (one undo step); the last one cannot go (delete the layer instead). Returns the shape. */
7642
7673
  removeShapeComponent(id, index) {
7643
- const layer = _chunkYAFS2QFZcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7674
+ const layer = _chunkJLGNZMUVcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7644
7675
  const i = this.componentIndex(layer, index);
7645
- if (layer.components.length === 1) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
7676
+ if (layer.components.length === 1) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
7646
7677
  const components = layer.components.filter((_, k) => k !== i);
7647
- const { layers } = _chunkYAFS2QFZcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7678
+ const { layers } = _chunkJLGNZMUVcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7648
7679
  this.commitLayers(layers);
7649
7680
  return this.shapeInfo(id);
7650
7681
  }
@@ -7653,10 +7684,10 @@ var ImageEditorController = (_class7 = class {
7653
7684
  * shapes become paths), as one undo step. Returns the shape.
7654
7685
  */
7655
7686
  mergeShapeComponents(id) {
7656
- const layer = _chunkYAFS2QFZcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7657
- if (layer.components.length < 2) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
7658
- const components = _chunkYAFS2QFZcjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
7659
- const { layers } = _chunkYAFS2QFZcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
7687
+ const layer = _chunkJLGNZMUVcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7688
+ if (layer.components.length < 2) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
7689
+ const components = _chunkJLGNZMUVcjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
7690
+ const { layers } = _chunkJLGNZMUVcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
7660
7691
  this.commitLayers(layers);
7661
7692
  return this.shapeInfo(id);
7662
7693
  }
@@ -7666,8 +7697,8 @@ var ImageEditorController = (_class7 = class {
7666
7697
  * step. Returns the layer id.
7667
7698
  */
7668
7699
  async rasterizeLayer(id) {
7669
- const layer = _chunkYAFS2QFZcjs.requireLayer.call(void 0, this.state.layers, id).layer;
7670
- _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
7700
+ const layer = _chunkJLGNZMUVcjs.requireLayer.call(void 0, this.state.layers, id).layer;
7701
+ _chunkJLGNZMUVcjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
7671
7702
  const { width, height } = this.naturalSize;
7672
7703
  const canvas = { x: 0, y: 0, width, height };
7673
7704
  let next;
@@ -7683,8 +7714,8 @@ var ImageEditorController = (_class7 = class {
7683
7714
  if (layer.locks) next.locks = layer.locks;
7684
7715
  if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
7685
7716
  } else if (layer.type === "pixel") {
7686
- if (!_optionalChain([layer, 'access', _295 => _295.filters, 'optionalAccess', _296 => _296.length])) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
7687
- _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
7717
+ if (!_optionalChain([layer, 'access', _295 => _295.filters, 'optionalAccess', _296 => _296.length])) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
7718
+ _chunkJLGNZMUVcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
7688
7719
  const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
7689
7720
  const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
7690
7721
  delete content.mask;
@@ -7701,10 +7732,10 @@ var ImageEditorController = (_class7 = class {
7701
7732
  } else if (layer.type === "smart") {
7702
7733
  return this.rasterizeSmartObject(id);
7703
7734
  } else if (layer.type === "shape" || layer.type === "type") {
7704
- next = layer.type === "shape" ? _chunkYAFS2QFZcjs.shapeAsPixelLayer.call(void 0, layer) : _chunkYAFS2QFZcjs.typeAsPixelLayer.call(void 0, layer);
7735
+ next = layer.type === "shape" ? _chunkJLGNZMUVcjs.shapeAsPixelLayer.call(void 0, layer) : _chunkJLGNZMUVcjs.typeAsPixelLayer.call(void 0, layer);
7705
7736
  if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _297 => _297.annotation, 'optionalAccess', _298 => _298.id])) this.state.selectedAnnotationId = null;
7706
7737
  } else {
7707
- throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Only shape, type and annotation layers, smart objects and pixel layers with filters rasterize; "${layer.name || id}" is a ${layer.type} layer. Merge it down or flatten instead.`);
7738
+ throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Only shape, type and annotation layers, smart objects and pixel layers with filters rasterize; "${layer.name || id}" is a ${layer.type} layer. Merge it down or flatten instead.`);
7708
7739
  }
7709
7740
  this.commitLayers(_chunk24ATT2PEcjs.mapLayer.call(void 0, this.state.layers, id, () => next));
7710
7741
  return id;
@@ -7729,7 +7760,7 @@ var ImageEditorController = (_class7 = class {
7729
7760
  setColorMode(mode, options = {}) {
7730
7761
  let next;
7731
7762
  if (mode === "rgb") {
7732
- if (options.profile !== void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("An RGB document takes no CMYK profile; use assign_profile for its working space.");
7763
+ if (options.profile !== void 0) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("An RGB document takes no CMYK profile; use assign_profile for its working space.");
7733
7764
  next = null;
7734
7765
  } else if (mode === "lab") next = { mode: "lab" };
7735
7766
  else if (mode === "cmyk") {
@@ -7737,14 +7768,14 @@ var ImageEditorController = (_class7 = class {
7737
7768
  try {
7738
7769
  doc = documentProfile(_nullishCoalesce(options.profile, () => ( "coated-cmyk")));
7739
7770
  } catch (e) {
7740
- throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7771
+ throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7741
7772
  }
7742
7773
  const cs = resolveProfile(doc).colorSpace;
7743
- if (cs !== "cmyk") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`CMYK mode needs a CMYK profile; "${doc.name}" is ${cs.toUpperCase()}.`);
7774
+ if (cs !== "cmyk") throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`CMYK mode needs a CMYK profile; "${doc.name}" is ${cs.toUpperCase()}.`);
7744
7775
  const intent = _nullishCoalesce(options.intent, () => ( "relative"));
7745
- if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7776
+ if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7746
7777
  next = { mode: "cmyk", profile: doc, intent };
7747
- } else throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Unknown colour mode "${String(mode)}"; use rgb, cmyk or lab.`);
7778
+ } else throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Unknown colour mode "${String(mode)}"; use rgb, cmyk or lab.`);
7748
7779
  this.recordHistory();
7749
7780
  if (next) this.state.colorMode = next;
7750
7781
  else delete this.state.colorMode;
@@ -7757,10 +7788,10 @@ var ImageEditorController = (_class7 = class {
7757
7788
  try {
7758
7789
  doc = documentProfile(profile);
7759
7790
  } catch (e) {
7760
- throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7791
+ throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7761
7792
  }
7762
7793
  const cs = resolveProfile(doc).colorSpace;
7763
- if (cs !== "rgb") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`${action} needs an RGB profile; "${doc.name}" is ${cs.toUpperCase()}. The document is RGB: soft-proof CMYK with set_proof_setup, or export to it.`);
7794
+ if (cs !== "rgb") throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`${action} needs an RGB profile; "${doc.name}" is ${cs.toUpperCase()}. The document is RGB: soft-proof CMYK with set_proof_setup, or export to it.`);
7764
7795
  return doc;
7765
7796
  }
7766
7797
  /**
@@ -7786,7 +7817,7 @@ var ImageEditorController = (_class7 = class {
7786
7817
  convertToProfile(profile, options = {}) {
7787
7818
  const doc = this.rgbProfileArg(profile, "Convert to Profile");
7788
7819
  const intent = _nullishCoalesce(options.intent, () => ( "relative"));
7789
- if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7820
+ if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7790
7821
  const t = _chunkG5NMLUVFcjs.Transform.create(resolveProfile(this.state.colorProfile), resolveProfile(doc), { intent, bpc: _nullishCoalesce(options.bpc, () => ( true)) });
7791
7822
  const converted = [];
7792
7823
  const unconverted = [];
@@ -7816,11 +7847,11 @@ var ImageEditorController = (_class7 = class {
7816
7847
  else if (l.type === "pixel") next2 = { ...next2, surface: convertSurfaceColors(this.surfaceOf(l), t), source: void 0 };
7817
7848
  else if (l.type === "shape") {
7818
7849
  const s = next2;
7819
- next2 = _chunkYAFS2QFZcjs.rerenderShape.call(void 0, { ...s, fill: convertColorFields(s.fill, hex), stroke: convertColorFields(s.stroke, hex), ...s.annotation ? { annotation: convertColorFields(s.annotation, hex) } : {} }, shapeEnv);
7850
+ next2 = _chunkJLGNZMUVcjs.rerenderShape.call(void 0, { ...s, fill: convertColorFields(s.fill, hex), stroke: convertColorFields(s.stroke, hex), ...s.annotation ? { annotation: convertColorFields(s.annotation, hex) } : {} }, shapeEnv);
7820
7851
  } else if (l.type === "type") {
7821
7852
  const recoloured = { ...next2, runs: convertColorFields(l.runs, hex) };
7822
7853
  try {
7823
- next2 = _chunkYAFS2QFZcjs.rerenderText.call(void 0, recoloured, textEnv);
7854
+ next2 = _chunkJLGNZMUVcjs.rerenderText.call(void 0, recoloured, textEnv);
7824
7855
  } catch (e27) {
7825
7856
  next2 = { ...recoloured, surface: convertSurfaceColors(l.surface, t) };
7826
7857
  }
@@ -7850,12 +7881,12 @@ var ImageEditorController = (_class7 = class {
7850
7881
  try {
7851
7882
  doc = documentProfile(setup.profile);
7852
7883
  } catch (e) {
7853
- throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7884
+ throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7854
7885
  }
7855
7886
  const intent = _nullishCoalesce(setup.intent, () => ( DEFAULT_PROOF.intent));
7856
- if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7887
+ if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7857
7888
  const next = { ...DEFAULT_PROOF, ...setup, intent, profile: doc };
7858
- if (!_chunkG5NMLUVFcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`"${doc.name}" describes a source only, so colours cannot be proofed through it.`);
7889
+ if (!_chunkG5NMLUVFcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`"${doc.name}" describes a source only, so colours cannot be proofed through it.`);
7859
7890
  this.state.proofSetup = next;
7860
7891
  this.notify();
7861
7892
  return next;
@@ -7872,14 +7903,14 @@ var ImageEditorController = (_class7 = class {
7872
7903
  src = options.from !== void 0 ? resolveProfile(documentProfile(options.from)) : resolveProfile(this.state.colorProfile);
7873
7904
  dst = resolveProfile(documentProfile(to));
7874
7905
  } catch (e) {
7875
- throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7906
+ throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7876
7907
  }
7877
- if (src.colorSpace !== "rgb") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Colours are given as #rrggbb, so the source profile must be RGB.");
7908
+ if (src.colorSpace !== "rgb") throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Colours are given as #rrggbb, so the source profile must be RGB.");
7878
7909
  const t = _chunkG5NMLUVFcjs.Transform.create(src, dst, { intent: _nullishCoalesce(options.intent, () => ( "relative")), bpc: _nullishCoalesce(options.bpc, () => ( true)) });
7879
7910
  const toLab = _chunkG5NMLUVFcjs.Transform.create(src, _chunkG5NMLUVFcjs.builtinProfile.call(void 0, "lab-d50"), { intent: "relative", bpc: false });
7880
7911
  return colors.map((input) => {
7881
7912
  const m = /^#?([0-9a-f]{6})$/i.exec(input.trim());
7882
- if (!m) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Invalid colour "${input}"; use #rrggbb.`);
7913
+ if (!m) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Invalid colour "${input}"; use #rrggbb.`);
7883
7914
  const n = parseInt(m[1], 16);
7884
7915
  const rgb = [(n >> 16 & 255) / 255, (n >> 8 & 255) / 255, (n & 255) / 255];
7885
7916
  const out = new Float32Array(16);
@@ -7905,7 +7936,7 @@ var ImageEditorController = (_class7 = class {
7905
7936
  * the ids of the layers whose pixels changed.
7906
7937
  */
7907
7938
  setBitDepth(depth) {
7908
- if (!_chunkJ5BA3BQ6cjs.isBitDepth.call(void 0, depth)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Bit depth must be 8, 16 or 32, not ${String(depth)}.`);
7939
+ if (!_chunkJ5BA3BQ6cjs.isBitDepth.call(void 0, depth)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Bit depth must be 8, 16 or 32, not ${String(depth)}.`);
7909
7940
  const changed = [];
7910
7941
  const withMask = (l) => {
7911
7942
  const m = l.mask;
@@ -7954,7 +7985,7 @@ var ImageEditorController = (_class7 = class {
7954
7985
  * Throws `PsdError` for files that cannot be read at all.
7955
7986
  */
7956
7987
  loadPsd(bytes) {
7957
- const result = _chunkYAFS2QFZcjs.importPsd.call(void 0, bytes, { newId: () => _chunkYAFS2QFZcjs.newLayerId.call(void 0, ) });
7988
+ const result = _chunkJLGNZMUVcjs.importPsd.call(void 0, bytes, { newId: () => _chunkJLGNZMUVcjs.newLayerId.call(void 0, ) });
7958
7989
  this.abandonContents();
7959
7990
  this.recordHistory();
7960
7991
  const s = this.state;
@@ -7964,7 +7995,7 @@ var ImageEditorController = (_class7 = class {
7964
7995
  if (!this.samplePixelsOverride) this.samplePixels = null;
7965
7996
  s.layers = this.checkPsdFonts(result);
7966
7997
  s.crop = null;
7967
- s.transform = { ..._chunkYAFS2QFZcjs.DEFAULT_TRANSFORM_VALUES };
7998
+ s.transform = { ..._chunkJLGNZMUVcjs.DEFAULT_TRANSFORM_VALUES };
7968
7999
  s.outputOpacity = 1;
7969
8000
  delete s.legacyOutputBlur;
7970
8001
  s.selection = null;
@@ -8015,7 +8046,7 @@ var ImageEditorController = (_class7 = class {
8015
8046
  let layers = result.layers;
8016
8047
  const missing = /* @__PURE__ */ new Map();
8017
8048
  for (const l of types) {
8018
- const fonts = shaper ? _chunkZ2H7KECKcjs.layoutText.call(void 0, l, shaper).missingFonts : [...new Set(l.runs.map((r) => r.style.fontFamily))];
8049
+ const fonts = shaper ? _chunk2R3UW57Ucjs.layoutText.call(void 0, l, shaper).missingFonts : [...new Set(l.runs.map((r) => r.style.fontFamily))];
8019
8050
  if (!fonts.length) continue;
8020
8051
  layers = _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, missingFonts: fonts }));
8021
8052
  for (const f of fonts) missing.set(f, [..._nullishCoalesce(missing.get(f), () => ( [])), l.name]);
@@ -8043,7 +8074,7 @@ var ImageEditorController = (_class7 = class {
8043
8074
  const canRasterize = this.renderer.canRasterize();
8044
8075
  await this.renderer.prepareLayerAssets(this.state.layers, width, height);
8045
8076
  const sources = this.renderer.compositorSources(width, height);
8046
- const compositor = new (0, _chunkYAFS2QFZcjs.LayerCompositor)();
8077
+ const compositor = new (0, _chunkJLGNZMUVcjs.LayerCompositor)();
8047
8078
  const bakeMask = (layer) => {
8048
8079
  const mask = layer.mask;
8049
8080
  if (!_optionalChain([mask, 'optionalAccess', _309 => _309.source])) return mask;
@@ -8125,7 +8156,7 @@ var ImageEditorController = (_class7 = class {
8125
8156
  out.surface = this.surfaceOf(layer);
8126
8157
  delete out.source;
8127
8158
  }
8128
- const active = _nullishCoalesce(_optionalChain([layer, 'access', _313 => _313.filters, 'optionalAccess', _314 => _314.filter, 'call', _315 => _315(_chunkYAFS2QFZcjs.isActiveFilter)]), () => ( []));
8159
+ const active = _nullishCoalesce(_optionalChain([layer, 'access', _313 => _313.filters, 'optionalAccess', _314 => _314.filter, 'call', _315 => _315(_chunkJLGNZMUVcjs.isActiveFilter)]), () => ( []));
8129
8160
  if (active.length) {
8130
8161
  add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
8131
8162
  const content = { ...out, visible: true, opacity: 1, blend: "normal" };
@@ -8158,8 +8189,8 @@ var ImageEditorController = (_class7 = class {
8158
8189
  const color = this.psdColorOptions(warnings);
8159
8190
  if (color.colorMode && this.bitDepth === 32) warnings.push(`${color.colorMode.toUpperCase()} files are written at 16 bits per channel at most; the 32-bit samples were converted (colour above 1 clipped).`);
8160
8191
  const depth = color.colorMode && this.bitDepth === 32 ? 16 : this.bitDepth;
8161
- const mergedDeep = depth === 8 ? void 0 : _chunk24ATT2PEcjs.workingToSamples.call(void 0, _chunkYAFS2QFZcjs.compositeDeep.call(void 0, prepared, canvas, sources, depth), depth);
8162
- const result = _chunkYAFS2QFZcjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, mergedDeep, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight, depth, ...color });
8192
+ const mergedDeep = depth === 8 ? void 0 : _chunk24ATT2PEcjs.workingToSamples.call(void 0, _chunkJLGNZMUVcjs.compositeDeep.call(void 0, prepared, canvas, sources, depth), depth);
8193
+ const result = _chunkJLGNZMUVcjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, mergedDeep, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight, depth, ...color });
8163
8194
  warnings.push(...result.warnings);
8164
8195
  return { bytes: result.bytes, warnings, psb: result.psb, width, height };
8165
8196
  }
@@ -8175,13 +8206,13 @@ var ImageEditorController = (_class7 = class {
8175
8206
  if (!this.samplePixelsOverride) this.samplePixels = null;
8176
8207
  if (this.state.selection && (sx !== 1 || sy !== 1)) {
8177
8208
  this.state.selection = normalizeSelection(
8178
- _chunkYAFS2QFZcjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
8209
+ _chunkJLGNZMUVcjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
8179
8210
  );
8180
8211
  }
8181
8212
  let layers = this.state.layers;
8182
8213
  if (sx !== 1 || sy !== 1) {
8183
8214
  if (this.state.crop) {
8184
- this.state.crop = _chunkYAFS2QFZcjs.clampCropToImage.call(void 0,
8215
+ this.state.crop = _chunkJLGNZMUVcjs.clampCropToImage.call(void 0,
8185
8216
  {
8186
8217
  x: Math.round(this.state.crop.x * sx),
8187
8218
  y: Math.round(this.state.crop.y * sy),
@@ -8200,17 +8231,17 @@ var ImageEditorController = (_class7 = class {
8200
8231
  } else if (l.type === "shape") {
8201
8232
  const a = l.annotation;
8202
8233
  const scaled = a ? scaleAnnotation(a, sx, sy) : null;
8203
- const fromAnnotation = scaled ? _chunkYAFS2QFZcjs.shapeFromAnnotation.call(void 0, scaled) : null;
8234
+ const fromAnnotation = scaled ? _chunkJLGNZMUVcjs.shapeFromAnnotation.call(void 0, scaled) : null;
8204
8235
  const m = [sx, 0, 0, sy, 0, 0];
8205
- const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _323 => _323.components]), () => ( _chunkYAFS2QFZcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
8236
+ const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _323 => _323.components]), () => ( _chunkJLGNZMUVcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
8206
8237
  const moved = { ...l, components, ...fromAnnotation ? { fill: fromAnnotation.fill, stroke: fromAnnotation.stroke } : {} };
8207
8238
  if (scaled && fromAnnotation) moved.annotation = scaled;
8208
8239
  else delete moved.annotation;
8209
- layers = _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, l.id, () => _chunkYAFS2QFZcjs.rerenderShape.call(void 0, moved, env));
8240
+ layers = _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, l.id, () => _chunkJLGNZMUVcjs.rerenderShape.call(void 0, moved, env));
8210
8241
  }
8211
8242
  }
8212
8243
  }
8213
- const bg = _chunkYAFS2QFZcjs.developTarget.call(void 0, layers, null);
8244
+ const bg = _chunkJLGNZMUVcjs.developTarget.call(void 0, layers, null);
8214
8245
  if (bg && bg.source !== "document") layers = _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, bg.id, () => ({ ...bg, source: "document" }));
8215
8246
  if (clearAnnotations) {
8216
8247
  for (const l of _chunk24ATT2PEcjs.flattenLayers.call(void 0, layers)) if (l.type === "annotation" || (l.type === "shape" || l.type === "type") && l.annotation) layers = _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, l.id, () => null);
@@ -8231,7 +8262,7 @@ var ImageEditorController = (_class7 = class {
8231
8262
  let out;
8232
8263
  try {
8233
8264
  out = this.serializeState();
8234
- if (_optionalChain([this, 'access', _327 => _327.state, 'access', _328 => _328.selection, 'optionalAccess', _329 => _329.bounds])) out.selection = _chunkYAFS2QFZcjs.serializeSelection.call(void 0, this.state.selection);
8265
+ if (_optionalChain([this, 'access', _327 => _327.state, 'access', _328 => _328.selection, 'optionalAccess', _329 => _329.bounds])) out.selection = _chunkJLGNZMUVcjs.serializeSelection.call(void 0, this.state.selection);
8235
8266
  } finally {
8236
8267
  if (root) {
8237
8268
  this.state = current;
@@ -8239,8 +8270,8 @@ var ImageEditorController = (_class7 = class {
8239
8270
  this.viewKey = [];
8240
8271
  }
8241
8272
  }
8242
- if (!options || out.version !== _chunkYAFS2QFZcjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
8243
- return _chunkYAFS2QFZcjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
8273
+ if (!options || out.version !== _chunkJLGNZMUVcjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
8274
+ return _chunkJLGNZMUVcjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
8244
8275
  }
8245
8276
  /**
8246
8277
  * Loads a stored state whose v3 assets may live in an asset store (references other than data
@@ -8248,12 +8279,12 @@ var ImageEditorController = (_class7 = class {
8248
8279
  * out and listed in `lastLoadProblems`.
8249
8280
  */
8250
8281
  async loadJSONAsync(data, options = {}) {
8251
- if (data.version !== _chunkYAFS2QFZcjs.LAYERED_SCHEMA_VERSION || !data.assets) {
8282
+ if (data.version !== _chunkJLGNZMUVcjs.LAYERED_SCHEMA_VERSION || !data.assets) {
8252
8283
  this.loadJSON(data);
8253
8284
  return;
8254
8285
  }
8255
8286
  const problems = [];
8256
- const assets = await _chunkYAFS2QFZcjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
8287
+ const assets = await _chunkJLGNZMUVcjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
8257
8288
  this.loadJSON({ ...data, assets });
8258
8289
  this.lastLoadProblems = [...problems, ...this.lastLoadProblems];
8259
8290
  }
@@ -8265,7 +8296,7 @@ var ImageEditorController = (_class7 = class {
8265
8296
  let selection = null;
8266
8297
  if (data.selection) {
8267
8298
  try {
8268
- selection = normalizeSelection(_chunkYAFS2QFZcjs.deserializeSelection.call(void 0, data.selection));
8299
+ selection = normalizeSelection(_chunkJLGNZMUVcjs.deserializeSelection.call(void 0, data.selection));
8269
8300
  } catch (e28) {
8270
8301
  selection = null;
8271
8302
  }
@@ -8283,8 +8314,8 @@ var ImageEditorController = (_class7 = class {
8283
8314
  if (isLayered(data)) {
8284
8315
  const problems = [];
8285
8316
  const canvas = typeof data.width === "number" && data.width > 0 && typeof data.height === "number" && data.height > 0 ? { width: data.width, height: data.height } : this.naturalSize;
8286
- const storedPatterns = _chunkYAFS2QFZcjs.deserializePatterns.call(void 0, data.patterns, []);
8287
- s.layers = _chunkYAFS2QFZcjs.deserializeLayers.call(void 0, data.layers, {
8317
+ const storedPatterns = _chunkJLGNZMUVcjs.deserializePatterns.call(void 0, data.patterns, []);
8318
+ s.layers = _chunkJLGNZMUVcjs.deserializeLayers.call(void 0, data.layers, {
8288
8319
  assets: _nullishCoalesce(data.assets, () => ( {})),
8289
8320
  problems,
8290
8321
  smartContents: Array.isArray(data.smartContents) ? data.smartContents : [],
@@ -8302,7 +8333,7 @@ var ImageEditorController = (_class7 = class {
8302
8333
  const light = data.globalLight;
8303
8334
  if (light && Number.isFinite(light.angle) && Number.isFinite(light.altitude)) s.globalLight = { angle: light.angle, altitude: Math.min(90, Math.max(0, light.altitude)) };
8304
8335
  else delete s.globalLight;
8305
- const patterns = _chunkYAFS2QFZcjs.deserializePatterns.call(void 0, data.patterns, problems);
8336
+ const patterns = _chunkJLGNZMUVcjs.deserializePatterns.call(void 0, data.patterns, problems);
8306
8337
  if (patterns.length) s.patterns = patterns;
8307
8338
  else delete s.patterns;
8308
8339
  if (data.bitDepth === 16 || data.bitDepth === 32) s.bitDepth = data.bitDepth;
@@ -8318,7 +8349,7 @@ var ImageEditorController = (_class7 = class {
8318
8349
  }
8319
8350
  } else {
8320
8351
  const { width, height } = this.naturalSize;
8321
- const stack = _chunkYAFS2QFZcjs.layersFromLegacy.call(void 0, data, width, height);
8352
+ const stack = _chunkJLGNZMUVcjs.layersFromLegacy.call(void 0, data, width, height);
8322
8353
  s.layers = stack.layers;
8323
8354
  s.outputOpacity = stack.outputOpacity;
8324
8355
  if (stack.legacyOutputBlur !== void 0) s.legacyOutputBlur = stack.legacyOutputBlur;
@@ -8339,7 +8370,7 @@ var ImageEditorController = (_class7 = class {
8339
8370
  }
8340
8371
  serializeState() {
8341
8372
  const { width, height } = this.naturalSize;
8342
- const view = _chunkYAFS2QFZcjs.legacyView.call(void 0, this.stack(), width, height, null);
8373
+ const view = _chunkJLGNZMUVcjs.legacyView.call(void 0, this.stack(), width, height, null);
8343
8374
  if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _330 => _330.state, 'access', _331 => _331.patterns, 'optionalAccess', _332 => _332.length]) && this.bitDepth === 8 && !this.state.colorProfile && !this.state.colorMode) {
8344
8375
  return {
8345
8376
  // States without adjustment layers keep schema 1, so they round-trip unchanged.
@@ -8354,9 +8385,9 @@ var ImageEditorController = (_class7 = class {
8354
8385
  annotations: JSON.parse(JSON.stringify(view.annotations))
8355
8386
  };
8356
8387
  }
8357
- const { layers, assets, smartContents } = _chunkYAFS2QFZcjs.serializeLayers.call(void 0, this.state.layers);
8388
+ const { layers, assets, smartContents } = _chunkJLGNZMUVcjs.serializeLayers.call(void 0, this.state.layers);
8358
8389
  const out = {
8359
- version: _chunkYAFS2QFZcjs.LAYERED_SCHEMA_VERSION,
8390
+ version: _chunkJLGNZMUVcjs.LAYERED_SCHEMA_VERSION,
8360
8391
  width,
8361
8392
  height,
8362
8393
  layers,
@@ -8368,7 +8399,7 @@ var ImageEditorController = (_class7 = class {
8368
8399
  };
8369
8400
  if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
8370
8401
  if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
8371
- if (_optionalChain([this, 'access', _336 => _336.state, 'access', _337 => _337.patterns, 'optionalAccess', _338 => _338.length])) out.patterns = _chunkYAFS2QFZcjs.serializePatterns.call(void 0, this.state.patterns);
8402
+ if (_optionalChain([this, 'access', _336 => _336.state, 'access', _337 => _337.patterns, 'optionalAccess', _338 => _338.length])) out.patterns = _chunkJLGNZMUVcjs.serializePatterns.call(void 0, this.state.patterns);
8372
8403
  if (smartContents) out.smartContents = smartContents;
8373
8404
  if (this.state.bitDepth === 16 || this.state.bitDepth === 32) out.bitDepth = this.state.bitDepth;
8374
8405
  if (this.state.colorProfile) out.colorProfile = serializeColorProfile(this.state.colorProfile);
@@ -8380,7 +8411,7 @@ function serializeAdjustments(adjustments) {
8380
8411
  const out = { ...adjustments };
8381
8412
  if (_optionalChain([out, 'access', _339 => _339.layers, 'optionalAccess', _340 => _340.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
8382
8413
  else delete out.layers;
8383
- if (_chunkYAFS2QFZcjs.normalizeProcessVersion.call(void 0, out.process) === _chunkYAFS2QFZcjs.LEGACY_PROCESS_VERSION) {
8414
+ if (_chunkJLGNZMUVcjs.normalizeProcessVersion.call(void 0, out.process) === _chunkJLGNZMUVcjs.LEGACY_PROCESS_VERSION) {
8384
8415
  delete out.process;
8385
8416
  if (!out.tint) delete out.tint;
8386
8417
  }
@@ -8391,7 +8422,7 @@ function withDevelop(layer, partial) {
8391
8422
  let i = filters.findIndex((f) => f.kind === "develop");
8392
8423
  if (i === -1) {
8393
8424
  filters.unshift({
8394
- id: layer.source === "document" ? _chunkYAFS2QFZcjs.DEVELOP_FILTER_ID : _chunkYAFS2QFZcjs.newLayerId.call(void 0, "flt"),
8425
+ id: layer.source === "document" ? _chunkJLGNZMUVcjs.DEVELOP_FILTER_ID : _chunkJLGNZMUVcjs.newLayerId.call(void 0, "flt"),
8395
8426
  kind: "develop",
8396
8427
  enabled: true,
8397
8428
  brightness: 0,
@@ -8400,7 +8431,7 @@ function withDevelop(layer, partial) {
8400
8431
  exposure: 0,
8401
8432
  temperature: 0,
8402
8433
  tint: 0,
8403
- process: _chunkYAFS2QFZcjs.LATEST_PROCESS_VERSION
8434
+ process: _chunkJLGNZMUVcjs.LATEST_PROCESS_VERSION
8404
8435
  });
8405
8436
  i = 0;
8406
8437
  }
@@ -8409,7 +8440,7 @@ function withDevelop(layer, partial) {
8409
8440
  const v = partial[k];
8410
8441
  if (typeof v === "number" && Number.isFinite(v)) next[k] = v;
8411
8442
  }
8412
- if ("process" in partial) next.process = _chunkYAFS2QFZcjs.normalizeProcessVersion.call(void 0, partial.process);
8443
+ if ("process" in partial) next.process = _chunkJLGNZMUVcjs.normalizeProcessVersion.call(void 0, partial.process);
8413
8444
  filters[i] = next;
8414
8445
  return { ...layer, filters };
8415
8446
  }
@@ -8418,7 +8449,7 @@ function withBlur(layer, radius) {
8418
8449
  const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
8419
8450
  if (radius > 0) {
8420
8451
  filters.push({
8421
- id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _344 => _344.id]), () => ( (layer.source === "document" ? _chunkYAFS2QFZcjs.BLUR_FILTER_ID : _chunkYAFS2QFZcjs.newLayerId.call(void 0, "flt")))),
8452
+ id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _344 => _344.id]), () => ( (layer.source === "document" ? _chunkJLGNZMUVcjs.BLUR_FILTER_ID : _chunkJLGNZMUVcjs.newLayerId.call(void 0, "flt")))),
8422
8453
  kind: "blur",
8423
8454
  enabled: true,
8424
8455
  radius
@@ -8442,7 +8473,7 @@ function mergeAdjustmentNode(node, update, width, height) {
8442
8473
  if (!update.mask) delete next.mask;
8443
8474
  else {
8444
8475
  const current = node.mask && !node.mask.source ? node.mask : null;
8445
- const memo = current ? _chunkYAFS2QFZcjs.legacyMaskOf.call(void 0, current, width, height) : null;
8476
+ const memo = current ? _chunkJLGNZMUVcjs.legacyMaskOf.call(void 0, current, width, height) : null;
8446
8477
  if (current && memo && memo.width === update.mask.width && memo.height === update.mask.height && memo.rle === update.mask.rle) {
8447
8478
  next.mask = withMaskProps(current, {
8448
8479
  density: _nullishCoalesce(update.mask.density, () => ( 1)),
@@ -8450,7 +8481,7 @@ function mergeAdjustmentNode(node, update, width, height) {
8450
8481
  enabled: update.mask.enabled !== false
8451
8482
  });
8452
8483
  } else {
8453
- const m = _chunkYAFS2QFZcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
8484
+ const m = _chunkJLGNZMUVcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
8454
8485
  if (m) next.mask = m;
8455
8486
  else delete next.mask;
8456
8487
  }
@@ -8489,7 +8520,7 @@ function resizeLegacyMasks(layers, from, to) {
8489
8520
  for (const l of _chunk24ATT2PEcjs.flattenLayers.call(void 0, layers)) {
8490
8521
  if (l.type !== "adjustment" || !l.mask || l.mask.source) continue;
8491
8522
  const old = l.mask;
8492
- const mask = _chunkYAFS2QFZcjs.rasterMaskFromLegacy.call(void 0, _chunkYAFS2QFZcjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
8523
+ const mask = _chunkJLGNZMUVcjs.rasterMaskFromLegacy.call(void 0, _chunkJLGNZMUVcjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
8493
8524
  if (!mask) continue;
8494
8525
  out = _chunk24ATT2PEcjs.mapLayer.call(void 0, out, l.id, (n) => ({ ...n, mask: { ...mask, density: old.density, feather: old.feather, enabled: old.enabled } }));
8495
8526
  }
@@ -8585,12 +8616,12 @@ function withoutAnnotations(layers) {
8585
8616
  function parseColor(value) {
8586
8617
  if (Array.isArray(value)) {
8587
8618
  if (value.length < 3 || value.length > 4 || !value.every((v) => typeof v === "number" && v >= 0 && v <= 255)) {
8588
- throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
8619
+ throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
8589
8620
  }
8590
8621
  return [Math.round(value[0]), Math.round(value[1]), Math.round(value[2]), Math.round(_nullishCoalesce(value[3], () => ( 255)))];
8591
8622
  }
8592
8623
  const m = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(String(value).trim());
8593
- if (!m) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
8624
+ if (!m) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
8594
8625
  let hex = m[1];
8595
8626
  if (hex.length === 3) hex = hex.split("").map((c) => c + c).join("");
8596
8627
  const n = (i) => parseInt(hex.slice(i, i + 2), 16);
@@ -8600,7 +8631,7 @@ function readImagePaint(raw) {
8600
8631
  try {
8601
8632
  return _chunk6GFRKLLScjs.parsePaintSource.call(void 0, raw);
8602
8633
  } catch (e) {
8603
- if (e instanceof _chunk6GFRKLLScjs.PaintSourceError) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(e.message);
8634
+ if (e instanceof _chunk6GFRKLLScjs.PaintSourceError) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(e.message);
8604
8635
  throw e;
8605
8636
  }
8606
8637
  }
@@ -8748,7 +8779,7 @@ function loadImageEditorDocument(input) {
8748
8779
  // Optional: only present when something was selected when saving.
8749
8780
  selection: {
8750
8781
  parse: (value) => {
8751
- const mask = _chunkYAFS2QFZcjs.deserializeSelection.call(void 0, value);
8782
+ const mask = _chunkJLGNZMUVcjs.deserializeSelection.call(void 0, value);
8752
8783
  const v = value;
8753
8784
  return { width: mask.width, height: mask.height, rle: v.rle };
8754
8785
  },
@@ -8836,7 +8867,7 @@ function loadLayeredDocument(doc) {
8836
8867
  },
8837
8868
  selection: {
8838
8869
  parse: (value) => {
8839
- const mask = _chunkYAFS2QFZcjs.deserializeSelection.call(void 0, value);
8870
+ const mask = _chunkJLGNZMUVcjs.deserializeSelection.call(void 0, value);
8840
8871
  const v = value;
8841
8872
  return { width: mask.width, height: mask.height, rle: v.rle };
8842
8873
  },
@@ -9230,14 +9261,14 @@ function describeSelection(mask) {
9230
9261
  // src/image-editor/selection-tools.ts
9231
9262
  var modeSchema = {
9232
9263
  type: "string",
9233
- enum: [..._chunkYAFS2QFZcjs.SELECTION_MODES],
9264
+ enum: [..._chunkJLGNZMUVcjs.SELECTION_MODES],
9234
9265
  description: "How the result combines with the current selection (default replace)."
9235
9266
  };
9236
9267
  var num = (v, d) => typeof v === "number" && Number.isFinite(v) ? v : d;
9237
9268
  function summary(controller) {
9238
9269
  const sel = controller.getSelection();
9239
9270
  const { width, height } = controller.getState().imageDimensions;
9240
- const area = _chunkYAFS2QFZcjs.selectionArea.call(void 0, sel);
9271
+ const area = _chunkJLGNZMUVcjs.selectionArea.call(void 0, sel);
9241
9272
  return {
9242
9273
  empty: !sel,
9243
9274
  bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _356 => _356.bounds]), () => ( null)),
@@ -9283,7 +9314,7 @@ function createImageSelectionTools(controller) {
9283
9314
  },
9284
9315
  annotations: writeAnnotations("Select a region", true),
9285
9316
  handler: ({ shape, x, y, width, height, mode, feather }) => {
9286
- const opts = { mode: _chunkYAFS2QFZcjs.parseSelectionMode.call(void 0, mode), feather: num(feather, 0) };
9317
+ const opts = { mode: _chunkJLGNZMUVcjs.parseSelectionMode.call(void 0, mode), feather: num(feather, 0) };
9287
9318
  switch (shape) {
9288
9319
  case "all":
9289
9320
  controller.selectAll();
@@ -9336,7 +9367,7 @@ function createImageSelectionTools(controller) {
9336
9367
  annotations: writeAnnotations("Select by colour", true),
9337
9368
  handler: async ({ x, y, color, tolerance, contiguous, fuzziness, sampleMerged, sample, mode }) => {
9338
9369
  const common = {
9339
- mode: _chunkYAFS2QFZcjs.parseSelectionMode.call(void 0, mode),
9370
+ mode: _chunkJLGNZMUVcjs.parseSelectionMode.call(void 0, mode),
9340
9371
  sampleMerged: sampleMerged === true,
9341
9372
  sample: _nullishCoalesce(sample, () => ( "composite"))
9342
9373
  };
@@ -9357,7 +9388,7 @@ function createImageSelectionTools(controller) {
9357
9388
  inputSchema: {
9358
9389
  type: "object",
9359
9390
  properties: {
9360
- op: { type: "string", enum: [..._chunkYAFS2QFZcjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
9391
+ op: { type: "string", enum: [..._chunkJLGNZMUVcjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
9361
9392
  radius: { type: "number", minimum: 0, maximum: 500, description: "Radius in pixels." }
9362
9393
  },
9363
9394
  required: ["op", "radius"],
@@ -9365,7 +9396,7 @@ function createImageSelectionTools(controller) {
9365
9396
  },
9366
9397
  annotations: writeAnnotations("Modify the selection"),
9367
9398
  handler: ({ op, radius }) => {
9368
- if (!_chunkYAFS2QFZcjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
9399
+ if (!_chunkJLGNZMUVcjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
9369
9400
  if (!controller.getSelection()) throw new Error("Nothing is selected.");
9370
9401
  controller.modifySelection(op, Math.min(500, Math.max(0, num(radius, 0))));
9371
9402
  return summary(controller);
@@ -9409,7 +9440,7 @@ function createImageSelectionTools(controller) {
9409
9440
  type: "object",
9410
9441
  properties: {
9411
9442
  layerId: { type: "string", description: "Existing adjustment layer to mask." },
9412
- kind: { type: "string", enum: _chunkYAFS2QFZcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
9443
+ kind: { type: "string", enum: _chunkJLGNZMUVcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
9413
9444
  params: { type: "object", description: "Parameters for the new layer (see list_controls)." },
9414
9445
  density: { type: "number", minimum: 0, maximum: 1, description: "Mask density 0-1." },
9415
9446
  feather: { type: "number", minimum: 0, maximum: 1e3, description: "Mask feather in pixels." }
@@ -9429,11 +9460,11 @@ function createImageSelectionTools(controller) {
9429
9460
  if (!controller.getAdjustmentLayer(layerId)) throw new Error(`No adjustment layer "${layerId}".`);
9430
9461
  controller.applySelectionAsLayerMask(layerId, props);
9431
9462
  id = layerId;
9432
- } else if (_chunkYAFS2QFZcjs.isAdjustmentKind.call(void 0, kind)) {
9463
+ } else if (_chunkJLGNZMUVcjs.isAdjustmentKind.call(void 0, kind)) {
9433
9464
  id = controller.addAdjustmentLayer({
9434
9465
  kind,
9435
9466
  params,
9436
- mask: _chunkYAFS2QFZcjs.layerMaskFromSelection.call(void 0, sel, props)
9467
+ mask: _chunkJLGNZMUVcjs.layerMaskFromSelection.call(void 0, sel, props)
9437
9468
  });
9438
9469
  } else {
9439
9470
  throw new Error("Pass layerId (an existing layer) or kind (a new adjustment layer).");
@@ -9570,11 +9601,11 @@ function createImageEditTools(controller) {
9570
9601
  const geometry2 = () => {
9571
9602
  const s = controller.getState();
9572
9603
  const region = _nullishCoalesce(s.crop, () => ( { x: 0, y: 0, ...s.imageDimensions }));
9573
- const out = _chunkYAFS2QFZcjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
9604
+ const out = _chunkJLGNZMUVcjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
9574
9605
  return {
9575
9606
  image: { ...s.imageDimensions },
9576
9607
  crop: s.crop ? { ...s.crop } : null,
9577
- rotation: _chunkYAFS2QFZcjs.normalizeAngle.call(void 0, s.transform.rotate),
9608
+ rotation: _chunkJLGNZMUVcjs.normalizeAngle.call(void 0, s.transform.rotate),
9578
9609
  flipH: s.transform.flipH,
9579
9610
  flipV: s.transform.flipV,
9580
9611
  output: { width: Math.round(out.width), height: Math.round(out.height) }
@@ -9809,7 +9840,7 @@ function describeLayer(layer, activeId, boundsOf) {
9809
9840
  const out = {
9810
9841
  id: layer.id,
9811
9842
  type: layer.type,
9812
- name: layer.name || (layer.type === "adjustment" ? _chunkYAFS2QFZcjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
9843
+ name: layer.name || (layer.type === "adjustment" ? _chunkJLGNZMUVcjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
9813
9844
  visible: layer.visible,
9814
9845
  opacity: round3(layer.opacity),
9815
9846
  blend: layer.blend,
@@ -9898,8 +9929,8 @@ function createImageLayerTools(controller) {
9898
9929
  };
9899
9930
  };
9900
9931
  const exists = (id, what = "layerId") => {
9901
- if (typeof id !== "string" || !id) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
9902
- _chunkYAFS2QFZcjs.requireLayer.call(void 0, controller.getLayers(), id);
9932
+ if (typeof id !== "string" || !id) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
9933
+ _chunkJLGNZMUVcjs.requireLayer.call(void 0, controller.getLayers(), id);
9903
9934
  return id;
9904
9935
  };
9905
9936
  const listLayers = {
@@ -9935,7 +9966,7 @@ function createImageLayerTools(controller) {
9935
9966
  handler: ({ layerId, target }) => {
9936
9967
  const id = exists(layerId);
9937
9968
  const layer = controller.getLayer(id);
9938
- if (target === "mask" && !layer.mask) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
9969
+ if (target === "mask" && !layer.mask) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
9939
9970
  controller.setActiveLayer(id, _nullishCoalesce(target, () => ( "pixels")));
9940
9971
  return { layer: describe(id), activeTarget: controller.getState().activeTarget };
9941
9972
  }
@@ -9960,7 +9991,7 @@ function createImageLayerTools(controller) {
9960
9991
  },
9961
9992
  annotations: { title: "Add a pixel layer", ...WRITE2 },
9962
9993
  handler: async (args) => {
9963
- if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give color or image, not both.");
9994
+ if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give color or image, not both.");
9964
9995
  for (const k of ["aboveId", "belowId", "parentId"]) if (args[k] !== void 0) exists(args[k], k);
9965
9996
  const init = {
9966
9997
  name: args.name,
@@ -10050,7 +10081,7 @@ function createImageLayerTools(controller) {
10050
10081
  const id = exists(args.layerId);
10051
10082
  const props = {};
10052
10083
  for (const k of ["name", "visible", "opacity", "fillOpacity", "blend", "clipped", "locks", "collapsed"]) if (args[k] !== void 0) props[k] = args[k];
10053
- if (!Object.keys(props).length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give at least one property to change.");
10084
+ if (!Object.keys(props).length) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give at least one property to change.");
10054
10085
  controller.setLayerProperties(id, props);
10055
10086
  return { layer: describe(id) };
10056
10087
  }
@@ -10144,8 +10175,8 @@ function createImageLayerTools(controller) {
10144
10175
  annotations: { title: "Move a layer's pixels", ...WRITE2 },
10145
10176
  handler: ({ layerId, x, y, dx, dy }) => {
10146
10177
  const id = exists(layerId);
10147
- if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give x and y, or dx and dy.");
10148
- if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give x / y or dx / dy, not both.");
10178
+ if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give x and y, or dx and dy.");
10179
+ if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give x / y or dx / dy, not both.");
10149
10180
  return { layerId: id, ...controller.offsetLayer(id, { x, y, dx, dy }) };
10150
10181
  }
10151
10182
  };
@@ -10217,7 +10248,7 @@ function createImageLayerTools(controller) {
10217
10248
  annotations: { title: "Set layer mask properties", ...WRITE_IDEMPOTENT2 },
10218
10249
  handler: ({ layerId, density, feather, enabled, linked }) => {
10219
10250
  const id = exists(layerId);
10220
- if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give density, feather, enabled or linked.");
10251
+ if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give density, feather, enabled or linked.");
10221
10252
  const mask = controller.setLayerMaskProps(id, {
10222
10253
  density,
10223
10254
  feather,
@@ -10300,7 +10331,7 @@ function createImageLayerTools(controller) {
10300
10331
  handler: (args) => {
10301
10332
  const id = exists(args.layerId);
10302
10333
  const changes = filterValues(args);
10303
- if (!Object.keys(changes).length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give at least one value to change.");
10334
+ if (!Object.keys(changes).length) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give at least one value to change.");
10304
10335
  return { layerId: id, filters: controller.updateLayerFilter(id, args.filterId, changes) };
10305
10336
  }
10306
10337
  };
@@ -10564,8 +10595,8 @@ function describeLayerEffects(effects) {
10564
10595
  }
10565
10596
  function createImageEffectTools(controller) {
10566
10597
  const layerArg = (id) => {
10567
- if (typeof id !== "string" || !id) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
10568
- _chunkYAFS2QFZcjs.requireLayer.call(void 0, controller.getLayers(), id);
10598
+ if (typeof id !== "string" || !id) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
10599
+ _chunkJLGNZMUVcjs.requireLayer.call(void 0, controller.getLayers(), id);
10569
10600
  return id;
10570
10601
  };
10571
10602
  const result = (layerId, extra = {}) => ({ layerId, ...extra, ...describeLayerEffects(controller.getLayerEffects(layerId)) });
@@ -10596,7 +10627,7 @@ function createImageEffectTools(controller) {
10596
10627
  annotations: { title: "Add a layer effect", ...WRITE3 },
10597
10628
  handler: ({ layerId, kind, settings, index }) => {
10598
10629
  const id = layerArg(layerId);
10599
- if (!_chunk24ATT2PEcjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`kind must be one of ${_chunk24ATT2PEcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
10630
+ if (!_chunk24ATT2PEcjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`kind must be one of ${_chunk24ATT2PEcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
10600
10631
  const { effect } = controller.addLayerEffect(id, kind, _nullishCoalesce(settings, () => ( {})), index);
10601
10632
  return result(id, { effectId: effect.id });
10602
10633
  }
@@ -10616,7 +10647,7 @@ function createImageEffectTools(controller) {
10616
10647
  handler: ({ layerId, effectId, settings }) => {
10617
10648
  const id = layerArg(layerId);
10618
10649
  const changes = _nullishCoalesce(settings, () => ( {}));
10619
- if (!Object.keys(changes).length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give at least one setting to change.");
10650
+ if (!Object.keys(changes).length) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give at least one setting to change.");
10620
10651
  controller.updateLayerEffect(id, effectId, changes);
10621
10652
  return result(id);
10622
10653
  }
@@ -10668,7 +10699,7 @@ function createImageEffectTools(controller) {
10668
10699
  },
10669
10700
  annotations: { title: "Set the global light", ...WRITE_IDEMPOTENT3 },
10670
10701
  handler: ({ angle, altitude }) => {
10671
- if (angle === void 0 && altitude === void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give angle, altitude or both.");
10702
+ if (angle === void 0 && altitude === void 0) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give angle, altitude or both.");
10672
10703
  const next = {};
10673
10704
  if (angle !== void 0) next.angle = angle;
10674
10705
  if (altitude !== void 0) next.altitude = altitude;
@@ -10719,6 +10750,30 @@ var RETOUCH_OPTION_CONTROLS = [
10719
10750
  { id: "strength", label: "Strength", section: "layer", min: 0, max: 1, step: 0.01, default: 0.5, decimals: 0, track: plain2, displayScale: 100, unit: "%", tools: ["smudge", "blur", "sharpen"] },
10720
10751
  { id: "historySteps", label: "Steps back", section: "layer", min: 0, max: 50, step: 1, default: 0, decimals: 0, track: plain2, unit: "", tools: ["history"] }
10721
10752
  ];
10753
+ var CLONE_TRANSFORM_CONTROLS = [
10754
+ { id: "width", label: "Source W", section: "layer", min: 1, max: 400, step: 1, default: 100, decimals: 0, track: plain2, unit: "%" },
10755
+ { id: "height", label: "Source H", section: "layer", min: 1, max: 400, step: 1, default: 100, decimals: 0, track: plain2, unit: "%" },
10756
+ { id: "angle", label: "Source angle", section: "layer", min: -180, max: 180, step: 1, default: 0, decimals: 0, track: plain2, unit: "\xB0" }
10757
+ ];
10758
+ function cloneTransformView(controller) {
10759
+ const t = controller.getState().paint.cloneTransform;
10760
+ return {
10761
+ width: Math.round(Math.abs(t.scaleX) * 100),
10762
+ height: Math.round(Math.abs(t.scaleY) * 100),
10763
+ angle: t.rotate,
10764
+ flipH: t.scaleX < 0,
10765
+ flipV: t.scaleY < 0,
10766
+ identity: t.scaleX === 1 && t.scaleY === 1 && t.rotate === 0
10767
+ };
10768
+ }
10769
+ function setCloneTransformValue(controller, id, value) {
10770
+ const t = controller.getState().paint.cloneTransform;
10771
+ if (id === "width") controller.setCloneTransform({ scaleX: Math.sign(t.scaleX) * (_nullishCoalesce(value, () => ( 100))) / 100 });
10772
+ else if (id === "height") controller.setCloneTransform({ scaleY: Math.sign(t.scaleY) * (_nullishCoalesce(value, () => ( 100))) / 100 });
10773
+ else if (id === "angle") controller.setCloneTransform({ rotate: _nullishCoalesce(value, () => ( 0)) });
10774
+ else if (id === "flipH") controller.setCloneTransform({ scaleX: -t.scaleX });
10775
+ else controller.setCloneTransform({ scaleY: -t.scaleY });
10776
+ }
10722
10777
  var RETOUCH_CHOICES = [
10723
10778
  {
10724
10779
  id: "sample",
@@ -10857,7 +10912,7 @@ var PaintGesture = (_class8 = class {
10857
10912
  if (layer.type !== "pixel" && layer.type !== "shape" && layer.type !== "smart") throw new Error(`Only pixel, shape and smart object layers move; "${layer.name}" is a ${layer.type} layer.`);
10858
10913
  if (_optionalChain([layer, 'access', _370 => _370.locks, 'optionalAccess', _371 => _371.all]) || _optionalChain([layer, 'access', _372 => _372.locks, 'optionalAccess', _373 => _373.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
10859
10914
  const origin = layer.type === "pixel" ? { ...layer.offset } : layer.type === "smart" ? { ...layer.placement.corners[0] } : (() => {
10860
- const b = _chunkYAFS2QFZcjs.shapeGeometryBounds.call(void 0, layer);
10915
+ const b = _chunkJLGNZMUVcjs.shapeGeometryBounds.call(void 0, layer);
10861
10916
  return b ? { x: b.x, y: b.y } : { x: 0, y: 0 };
10862
10917
  })();
10863
10918
  this.move = { id: layer.id, start: { x: sample.x, y: sample.y }, origin, moved: false };
@@ -11015,9 +11070,9 @@ function createImagePaintTools(controller) {
11015
11070
  annotations: { title: "Paint a brush stroke", ...WRITE4 },
11016
11071
  handler: (args) => {
11017
11072
  const tool = args.tool;
11018
- if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
11019
- if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)('paint applies to the brush only (the eraser removes paint; the Mixer Brush loads color); drop paint or use tool "brush".');
11020
- if (args.paint !== void 0 && args.color !== void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give color or paint, not both.");
11073
+ if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
11074
+ if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)('paint applies to the brush only (the eraser removes paint; the Mixer Brush loads color); drop paint or use tool "brush".');
11075
+ if (args.paint !== void 0 && args.color !== void 0) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give color or paint, not both.");
11021
11076
  const result = controller.paintStroke({
11022
11077
  tool,
11023
11078
  points: args.points,
@@ -11148,7 +11203,7 @@ function profileArg(v) {
11148
11203
  try {
11149
11204
  return _chunkDCLJNVZScjs.base64ToBytes.call(void 0, s.slice(4));
11150
11205
  } catch (e30) {
11151
- throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("The icc: value is not valid base64.");
11206
+ throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("The icc: value is not valid base64.");
11152
11207
  }
11153
11208
  }
11154
11209
  return s;
@@ -11213,10 +11268,10 @@ function createImageColorTools(controller) {
11213
11268
  annotations: { title: "Set up soft proofing", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
11214
11269
  handler: (args) => {
11215
11270
  if (args.off === true) {
11216
- if (args.profile !== void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give either off true or a profile, not both.");
11271
+ if (args.profile !== void 0) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give either off true or a profile, not both.");
11217
11272
  return controller.setProofSetup(null);
11218
11273
  }
11219
- if (args.profile === void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Pass the profile to proof with (e.g. coated-cmyk), or off true.");
11274
+ if (args.profile === void 0) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Pass the profile to proof with (e.g. coated-cmyk), or off true.");
11220
11275
  const s = controller.setProofSetup({
11221
11276
  profile: profileArg(args.profile),
11222
11277
  ...args.intent !== void 0 ? { intent: args.intent } : {},
@@ -11268,7 +11323,7 @@ function createImageColorTools(controller) {
11268
11323
  },
11269
11324
  annotations: { title: "Set the colour mode", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
11270
11325
  handler: (args) => {
11271
- if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("profile and intent apply to CMYK mode only.");
11326
+ if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("profile and intent apply to CMYK mode only.");
11272
11327
  return controller.setColorMode(args.mode, {
11273
11328
  ...args.profile !== void 0 ? { profile: profileArg(args.profile) } : {},
11274
11329
  ...args.intent !== void 0 ? { intent: args.intent } : {}
@@ -11322,7 +11377,7 @@ var TARGET2 = {
11322
11377
  };
11323
11378
  var SAMPLE = {
11324
11379
  type: "string",
11325
- enum: [..._chunkNVTHUPJ6cjs.RETOUCH_SAMPLES],
11380
+ enum: [..._chunkYT3JL7YMcjs.RETOUCH_SAMPLES],
11326
11381
  description: "What is sampled: current (default: the target layer), current-below (the composite of this layer and everything under it), or all (the composite of every layer). Sample current-below or all to retouch onto an empty layer above the image."
11327
11382
  };
11328
11383
  function readTarget2(args) {
@@ -11333,7 +11388,7 @@ function checkSource(controller, source) {
11333
11388
  const p = source;
11334
11389
  const { width, height } = controller.getState().imageDimensions;
11335
11390
  if (!(p.x >= 0 && p.y >= 0 && p.x < width && p.y < height)) {
11336
- throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`source (${p.x}, ${p.y}) is outside the ${width} \xD7 ${height} canvas; pick a point on the image to sample.`);
11391
+ throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`source (${p.x}, ${p.y}) is outside the ${width} \xD7 ${height} canvas; pick a point on the image to sample.`);
11337
11392
  }
11338
11393
  return p;
11339
11394
  }
@@ -11401,7 +11456,7 @@ function createImageRetouchTools(controller) {
11401
11456
  type: "object",
11402
11457
  properties: {
11403
11458
  points: POINTS,
11404
- type: { type: "string", enum: [..._chunkNVTHUPJ6cjs.SPOT_HEAL_TYPES], description: "proximity-match (default the current option), content-aware or smooth." },
11459
+ type: { type: "string", enum: [..._chunkYT3JL7YMcjs.SPOT_HEAL_TYPES], description: "proximity-match (default the current option), content-aware or smooth." },
11405
11460
  sample: SAMPLE,
11406
11461
  brush: BRUSH2,
11407
11462
  ...TARGET2
@@ -11434,7 +11489,7 @@ function createImageRetouchTools(controller) {
11434
11489
  type: "object",
11435
11490
  properties: {
11436
11491
  points: POINTS,
11437
- range: { type: "string", enum: [..._chunkNVTHUPJ6cjs.TONE_RANGES], description: `Which tones to ${verb} most: shadows, midtones (default the current option, midtones) or highlights.` },
11492
+ range: { type: "string", enum: [..._chunkYT3JL7YMcjs.TONE_RANGES], description: `Which tones to ${verb} most: shadows, midtones (default the current option, midtones) or highlights.` },
11438
11493
  exposure: { type: "number", minimum: 0, maximum: 1, description: "Strength 0..1 (default the current option, 0.5). Overlapping dabs in one stroke never go past it; another stroke builds on it." },
11439
11494
  protectTones: { type: "boolean", description: "Change luma only, keeping hue and saturation (default true)." },
11440
11495
  brush: BRUSH2,
@@ -11526,12 +11581,12 @@ function createImageRetouchTools(controller) {
11526
11581
  const getOptions = {
11527
11582
  name: "get_retouch_options",
11528
11583
  title: "Get retouch options",
11529
- description: "Reads the retouching tools' options (aligned, sample, spotType, range, exposure, protectTones, spongeMode, vibrance, strength, historySteps) and the clone source ({x, y, offset} or null; offset is the aligned offset the last clone or heal stroke fixed: an aligned stroke samples at the brush plus offset, which the editors show as a crosshair). Call it before clone_stamp or heal_brush without a source to see where they will sample.",
11584
+ description: "Reads the retouching tools' options (aligned, sample, spotType, range, exposure, protectTones, spongeMode, vibrance, strength, historySteps), the Clone Source transform ({scaleX, scaleY, rotate}) and the clone source ({x, y, offset} or null; offset is the aligned offset the last clone or heal stroke fixed: an aligned stroke samples at the brush plus offset, which the editors show as a crosshair). Call it before clone_stamp or heal_brush without a source to see where they will sample.",
11530
11585
  inputSchema: { type: "object", properties: {}, additionalProperties: false },
11531
11586
  annotations: { title: "Get retouch options", ...READ6 },
11532
11587
  handler: () => {
11533
- const { retouch, cloneSource } = controller.getState().paint;
11534
- return { options: { ...retouch }, cloneSource: cloneSource ? { ...cloneSource } : null };
11588
+ const { retouch, cloneSource, cloneTransform } = controller.getState().paint;
11589
+ return { options: { ...retouch }, cloneSource: cloneSource ? { ...cloneSource } : null, cloneTransform: { ...cloneTransform } };
11535
11590
  }
11536
11591
  };
11537
11592
  const setOptions = {
@@ -11543,8 +11598,8 @@ function createImageRetouchTools(controller) {
11543
11598
  properties: {
11544
11599
  aligned: { type: "boolean", description: "Clone / heal: keep the offset from stroke to stroke (default true)." },
11545
11600
  sample: SAMPLE,
11546
- spotType: { type: "string", enum: [..._chunkNVTHUPJ6cjs.SPOT_HEAL_TYPES], description: "Spot heal: proximity-match (default), content-aware or smooth." },
11547
- range: { type: "string", enum: [..._chunkNVTHUPJ6cjs.TONE_RANGES], description: "Dodge / burn: shadows, midtones (default) or highlights." },
11601
+ spotType: { type: "string", enum: [..._chunkYT3JL7YMcjs.SPOT_HEAL_TYPES], description: "Spot heal: proximity-match (default), content-aware or smooth." },
11602
+ range: { type: "string", enum: [..._chunkYT3JL7YMcjs.TONE_RANGES], description: "Dodge / burn: shadows, midtones (default) or highlights." },
11548
11603
  exposure: { type: "number", minimum: 0, maximum: 1, description: "Dodge / burn strength 0..1 (default 0.5)." },
11549
11604
  protectTones: { type: "boolean", description: "Dodge / burn: keep hue and saturation (default true)." },
11550
11605
  spongeMode: { type: "string", enum: ["desaturate", "saturate"], description: "Sponge: desaturate (default) or saturate." },
@@ -11573,14 +11628,47 @@ function createImageRetouchTools(controller) {
11573
11628
  annotations: { title: "Set the clone source", ...WRITE5, idempotentHint: true },
11574
11629
  handler: (args) => {
11575
11630
  if (args.clear === true) {
11576
- if (args.x !== void 0 || args.y !== void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give either clear true or x and y, not both.");
11631
+ if (args.x !== void 0 || args.y !== void 0) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give either clear true or x and y, not both.");
11577
11632
  return controller.setCloneSource(null);
11578
11633
  }
11579
- if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Pass x and y (document pixels) for the source point, or clear true to remove it.");
11634
+ if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Pass x and y (document pixels) for the source point, or clear true to remove it.");
11580
11635
  return controller.setCloneSource(checkSource(controller, { x: args.x, y: args.y }));
11581
11636
  }
11582
11637
  };
11583
- return [cloneStamp, healBrush, spotHeal, smudge, dodge, burn, spongeTool, blurTool, sharpenTool, historyBrush, getOptions, setOptions, setSource];
11638
+ const setTransform = {
11639
+ name: "set_clone_transform",
11640
+ title: "Transform the clone source",
11641
+ description: "Photoshop's Clone Source panel: the Clone Stamp and Healing Brush lay the source scaled by `scaleX` / `scaleY` (percent, default 100; negative or the flip flags mirror it) and rotated by `rotate` degrees clockwise about the stroke's start. Merged into the current transform; reset true goes back to 100 %, 0\xB0. Use it to clone a reflection, a smaller copy or a tilted patch. View state, not an undo step. Returns the transform ({scaleX, scaleY, rotate} as factors and degrees).",
11642
+ inputSchema: {
11643
+ type: "object",
11644
+ properties: {
11645
+ scaleX: { type: "number", description: "Width in percent of the source (1..1000; negative flips horizontally)." },
11646
+ scaleY: { type: "number", description: "Height in percent of the source (1..1000; negative flips vertically)." },
11647
+ rotate: { type: "number", description: "Rotation in degrees, clockwise (-180..180)." },
11648
+ flipHorizontal: { type: "boolean", description: "Mirror the source left to right (negates the width scale; default false)." },
11649
+ flipVertical: { type: "boolean", description: "Mirror the source top to bottom (negates the height scale; default false)." },
11650
+ reset: { type: "boolean", description: "Back to 100 %, no flip, 0\xB0 (default false); other arguments are not allowed with it." }
11651
+ },
11652
+ additionalProperties: false
11653
+ },
11654
+ annotations: { title: "Transform the clone source", ...WRITE5, idempotentHint: false },
11655
+ handler: (args) => {
11656
+ if (args.reset === true) {
11657
+ if (Object.keys(args).some((k) => k !== "reset")) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give either reset true or transform values, not both.");
11658
+ return controller.setCloneTransform(null);
11659
+ }
11660
+ const cur = controller.getState().paint.cloneTransform;
11661
+ const next = {};
11662
+ if (args.scaleX !== void 0) next.scaleX = args.scaleX / 100;
11663
+ if (args.scaleY !== void 0) next.scaleY = args.scaleY / 100;
11664
+ if (args.rotate !== void 0) next.rotate = args.rotate;
11665
+ if (args.flipHorizontal === true) next.scaleX = -(_nullishCoalesce(next.scaleX, () => ( cur.scaleX)));
11666
+ if (args.flipVertical === true) next.scaleY = -(_nullishCoalesce(next.scaleY, () => ( cur.scaleY)));
11667
+ if (!Object.keys(next).length) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Pass scaleX, scaleY, rotate, flipHorizontal or flipVertical, or reset true.");
11668
+ return controller.setCloneTransform(next);
11669
+ }
11670
+ };
11671
+ return [cloneStamp, healBrush, spotHeal, smudge, dodge, burn, spongeTool, blurTool, sharpenTool, historyBrush, getOptions, setOptions, setSource, setTransform];
11584
11672
  }
11585
11673
  function pick(args, keys) {
11586
11674
  const out = {};
@@ -11597,11 +11685,11 @@ var DATA = {
11597
11685
  description: "The PSD or PSB file as base64 (a `data:` URL prefix is accepted)."
11598
11686
  };
11599
11687
  function psdBytesFromBase64(data) {
11600
- if (typeof data !== "string" || !data.trim()) throw new (0, _chunkYAFS2QFZcjs.PsdError)("data is required: the PSD file as base64.");
11688
+ if (typeof data !== "string" || !data.trim()) throw new (0, _chunkJLGNZMUVcjs.PsdError)("data is required: the PSD file as base64.");
11601
11689
  const body = data.trim().replace(/^data:[^,]*;base64,/i, "");
11602
- if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunkYAFS2QFZcjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
11690
+ if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunkJLGNZMUVcjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
11603
11691
  const bytes = _chunkDCLJNVZScjs.base64ToBytes.call(void 0, body);
11604
- if (bytes.length < 26) throw new (0, _chunkYAFS2QFZcjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
11692
+ if (bytes.length < 26) throw new (0, _chunkJLGNZMUVcjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
11605
11693
  return bytes;
11606
11694
  }
11607
11695
  function createImagePsdTools(controller) {
@@ -11612,7 +11700,7 @@ function createImagePsdTools(controller) {
11612
11700
  inputSchema: { type: "object", properties: { data: DATA }, required: ["data"], additionalProperties: false },
11613
11701
  annotations: { title: "Inspect a PSD", ...READ7 },
11614
11702
  handler: ({ data }) => {
11615
- const res = _chunkYAFS2QFZcjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
11703
+ const res = _chunkJLGNZMUVcjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
11616
11704
  return {
11617
11705
  width: res.width,
11618
11706
  height: res.height,
@@ -11699,7 +11787,7 @@ var GEOMETRY = {
11699
11787
  dy: { type: "number", description: "Move down after scaling and rotating, in document pixels (default 0)." },
11700
11788
  reference: {
11701
11789
  description: "Fixed point of scale, skew and rotate: an anchor of the frame (top-left, top, top-right, left, center, right, bottom-left, bottom, bottom-right; default center) or a document point {x, y}.",
11702
- anyOf: [{ type: "string", enum: _chunkYAFS2QFZcjs.TRANSFORM_ANCHORS }, POINT]
11790
+ anyOf: [{ type: "string", enum: _chunkJLGNZMUVcjs.TRANSFORM_ANCHORS }, POINT]
11703
11791
  },
11704
11792
  matrix: {
11705
11793
  type: "array",
@@ -11720,14 +11808,14 @@ var NUMERIC = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "dx", "dy", "refe
11720
11808
  function geometryFrom(args) {
11721
11809
  const numeric = NUMERIC.filter((k) => args[k] !== void 0);
11722
11810
  const ways = [numeric.length > 0, args.matrix !== void 0, args.corners !== void 0].filter(Boolean).length;
11723
- if (ways === 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
11724
- if (ways > 1) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
11811
+ if (ways === 0) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
11812
+ if (ways > 1) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
11725
11813
  if (args.matrix !== void 0) return { matrix: args.matrix };
11726
11814
  if (args.corners !== void 0) return { corners: args.corners };
11727
11815
  const params = {};
11728
11816
  for (const k of NUMERIC) if (args[k] !== void 0) params[k] = args[k];
11729
- if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
11730
- if (typeof params.reference === "string" && !_chunkYAFS2QFZcjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunkYAFS2QFZcjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
11817
+ if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
11818
+ if (typeof params.reference === "string" && !_chunkJLGNZMUVcjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunkJLGNZMUVcjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
11731
11819
  return { params };
11732
11820
  }
11733
11821
  function targetFrom(args) {
@@ -11776,15 +11864,15 @@ function createImageTransformTools(controller) {
11776
11864
  moved: [...s.moves],
11777
11865
  frame: { ...s.box },
11778
11866
  corners: s.startGeometry.corners.map(roundPoint),
11779
- center: roundPoint(_chunkYAFS2QFZcjs.anchorPoint.call(void 0, s.startGeometry, "center"))
11867
+ center: roundPoint(_chunkJLGNZMUVcjs.anchorPoint.call(void 0, s.startGeometry, "center"))
11780
11868
  };
11781
11869
  if (s.smartObject) out.smartObject = true;
11782
11870
  s.cancel();
11783
11871
  if (args.meshColumns !== void 0) {
11784
11872
  const cols = args.meshColumns;
11785
11873
  const rows = _nullishCoalesce(args.meshRows, () => ( cols));
11786
- const mesh = _chunkZ2H7KECKcjs.identityWarpMesh.call(void 0, s.box, cols, rows);
11787
- out.mesh = { columns: cols, rows, pointsPerRow: _chunkZ2H7KECKcjs.warpMeshColumns.call(void 0, mesh), pointRows: _chunkZ2H7KECKcjs.warpMeshRows.call(void 0, mesh), points: mesh.points.map(roundPoint) };
11874
+ const mesh = _chunk2R3UW57Ucjs.identityWarpMesh.call(void 0, s.box, cols, rows);
11875
+ out.mesh = { columns: cols, rows, pointsPerRow: _chunk2R3UW57Ucjs.warpMeshColumns.call(void 0, mesh), pointRows: _chunk2R3UW57Ucjs.warpMeshRows.call(void 0, mesh), points: mesh.points.map(roundPoint) };
11788
11876
  }
11789
11877
  return out;
11790
11878
  }
@@ -11809,7 +11897,7 @@ function createImageTransformTools(controller) {
11809
11897
  type: "object",
11810
11898
  properties: {
11811
11899
  ...TARGET3,
11812
- style: { type: "string", enum: _chunkZ2H7KECKcjs.WARP_STYLES, description: "Preset warp (Photoshop\u2019s menu): arc, arcLower, arcUpper, arch, bulge, shellLower, shellUpper, flag, wave, fish, rise, fisheye, inflate, squeeze, twist." },
11900
+ style: { type: "string", enum: _chunk2R3UW57Ucjs.WARP_STYLES, description: "Preset warp (Photoshop\u2019s menu): arc, arcLower, arcUpper, arch, bulge, shellLower, shellUpper, flag, wave, fish, rise, fisheye, inflate, squeeze, twist." },
11813
11901
  bend: { type: "number", minimum: -100, maximum: 100, description: "Preset bend in percent, \u2212100..100 (default 50)." },
11814
11902
  horizontal: { type: "number", minimum: -100, maximum: 100, description: "Preset horizontal distortion in percent, \u2212100..100 (default 0)." },
11815
11903
  vertical: { type: "number", minimum: -100, maximum: 100, description: "Preset vertical distortion in percent, \u2212100..100 (default 0)." },
@@ -11831,11 +11919,11 @@ function createImageTransformTools(controller) {
11831
11919
  annotations: { title: "Warp a layer", ...WRITE6 },
11832
11920
  handler: (args) => {
11833
11921
  const hasPreset = ["style", "bend", "horizontal", "vertical", "orientation"].some((k) => args[k] !== void 0);
11834
- if (hasPreset && args.mesh !== void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
11835
- if (!hasPreset && args.mesh === void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give a preset style or a mesh.");
11922
+ if (hasPreset && args.mesh !== void 0) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
11923
+ if (!hasPreset && args.mesh === void 0) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give a preset style or a mesh.");
11836
11924
  let warp;
11837
11925
  if (hasPreset) {
11838
- if (args.style === void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunkZ2H7KECKcjs.WARP_STYLES.join(", ")}.`);
11926
+ if (args.style === void 0) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunk2R3UW57Ucjs.WARP_STYLES.join(", ")}.`);
11839
11927
  warp = {
11840
11928
  style: args.style,
11841
11929
  bend: _nullishCoalesce(args.bend, () => ( 50)),
@@ -11846,7 +11934,7 @@ function createImageTransformTools(controller) {
11846
11934
  } else {
11847
11935
  const m = args.mesh;
11848
11936
  const want = (3 * m.columns + 1) * (3 * m.rows + 1);
11849
- if (m.points.length !== want) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`A ${m.columns} \xD7 ${m.rows} mesh needs (3\xB7${m.columns} + 1) \xD7 (3\xB7${m.rows} + 1) = ${want} points, got ${m.points.length}.`);
11937
+ if (m.points.length !== want) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`A ${m.columns} \xD7 ${m.rows} mesh needs (3\xB7${m.columns} + 1) \xD7 (3\xB7${m.rows} + 1) = ${want} points, got ${m.points.length}.`);
11850
11938
  const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
11851
11939
  warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
11852
11940
  }
@@ -11941,13 +12029,13 @@ function settingsFrom(args) {
11941
12029
  return out;
11942
12030
  }
11943
12031
  function imageArg(image) {
11944
- if (typeof image !== "string" || !image.trim()) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
12032
+ if (typeof image !== "string" || !image.trim()) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
11945
12033
  return image.trim();
11946
12034
  }
11947
12035
  function createImageSmartObjectTools(controller) {
11948
12036
  const smartId = (id) => {
11949
- if (typeof id !== "string" || !id) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
11950
- _chunkYAFS2QFZcjs.requireSmartObject.call(void 0, controller.getLayers(), id);
12037
+ if (typeof id !== "string" || !id) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
12038
+ _chunkJLGNZMUVcjs.requireSmartObject.call(void 0, controller.getLayers(), id);
11951
12039
  return id;
11952
12040
  };
11953
12041
  const info = (id) => {
@@ -11984,7 +12072,7 @@ function createImageSmartObjectTools(controller) {
11984
12072
  },
11985
12073
  annotations: { title: "Convert to Smart Object", ...WRITE7 },
11986
12074
  handler: ({ layerIds, name }) => {
11987
- for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunkYAFS2QFZcjs.requireLayer.call(void 0, controller.getLayers(), id2);
12075
+ for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunkJLGNZMUVcjs.requireLayer.call(void 0, controller.getLayers(), id2);
11988
12076
  const id = controller.convertToSmartObject(layerIds, { name });
11989
12077
  return { layer: layerSummary(id), smartObject: info(id) };
11990
12078
  }
@@ -12021,7 +12109,7 @@ function createImageSmartObjectTools(controller) {
12021
12109
  {
12022
12110
  type: "object",
12023
12111
  properties: {
12024
- style: { type: "string", enum: _chunkZ2H7KECKcjs.WARP_STYLES, description: "Preset (Photoshop\u2019s menu)." },
12112
+ style: { type: "string", enum: _chunk2R3UW57Ucjs.WARP_STYLES, description: "Preset (Photoshop\u2019s menu)." },
12025
12113
  bend: { type: "number", minimum: -100, maximum: 100, description: "Bend in percent (default 50)." },
12026
12114
  horizontal: { type: "number", minimum: -100, maximum: 100, description: "Horizontal distortion in percent (default 0)." },
12027
12115
  vertical: { type: "number", minimum: -100, maximum: 100, description: "Vertical distortion in percent (default 0)." },
@@ -12057,12 +12145,12 @@ function createImageSmartObjectTools(controller) {
12057
12145
  else if (w) {
12058
12146
  const m = w;
12059
12147
  const want = (3 * m.columns + 1) * (3 * m.rows + 1);
12060
- if (m.points.length !== want) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`A ${m.columns} \xD7 ${m.rows} mesh needs (3\xB7${m.columns} + 1) \xD7 (3\xB7${m.rows} + 1) = ${want} points, got ${m.points.length}.`);
12148
+ if (m.points.length !== want) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`A ${m.columns} \xD7 ${m.rows} mesh needs (3\xB7${m.columns} + 1) \xD7 (3\xB7${m.rows} + 1) = ${want} points, got ${m.points.length}.`);
12061
12149
  const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
12062
12150
  warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
12063
12151
  }
12064
12152
  const keys = ["corners", "matrix", "scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y", "warp", "interpolation"];
12065
- if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
12153
+ if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
12066
12154
  const res = controller.setSmartObjectTransform(id, {
12067
12155
  corners: args.corners,
12068
12156
  matrix: args.matrix,
@@ -12187,7 +12275,7 @@ function createImageSmartObjectTools(controller) {
12187
12275
  handler: (args) => {
12188
12276
  const id = smartId(args.layerId);
12189
12277
  const changes = settingsFrom(args);
12190
- if (!Object.keys(changes).length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give at least one value to change.");
12278
+ if (!Object.keys(changes).length) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give at least one value to change.");
12191
12279
  const filter = controller.updateSmartFilter(id, args.filterId, changes);
12192
12280
  return { layerId: id, filter, smartFilters: info(id).smartFilters };
12193
12281
  }
@@ -12508,8 +12596,8 @@ function geometry(args) {
12508
12596
  }
12509
12597
  function createImageShapeTools(controller) {
12510
12598
  const shapeId = (id) => {
12511
- if (typeof id !== "string" || !id) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
12512
- _chunkYAFS2QFZcjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
12599
+ if (typeof id !== "string" || !id) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
12600
+ _chunkJLGNZMUVcjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
12513
12601
  return id;
12514
12602
  };
12515
12603
  const layerSummary = (id) => {
@@ -12584,7 +12672,7 @@ function createImageShapeTools(controller) {
12584
12672
  annotations: { title: "Restyle a shape", ...WRITE_IDEMPOTENT5 },
12585
12673
  handler: ({ layerId, fill, stroke, fillRule }) => {
12586
12674
  const id = shapeId(layerId);
12587
- if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
12675
+ if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
12588
12676
  return controller.setShapeStyle(id, { fill, stroke, fillRule });
12589
12677
  }
12590
12678
  };
@@ -12633,7 +12721,7 @@ function createImageShapeTools(controller) {
12633
12721
  handler: ({ layerId, componentIndex, ...rest }) => {
12634
12722
  const id = shapeId(layerId);
12635
12723
  const change = geometry(rest);
12636
- if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give shape, subpaths or op to change.");
12724
+ if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("Give shape, subpaths or op to change.");
12637
12725
  return controller.setShapeComponent(id, componentIndex, change);
12638
12726
  }
12639
12727
  };
@@ -12707,8 +12795,8 @@ function pick2(args, keys) {
12707
12795
  }
12708
12796
  function createImageTypeTools(controller) {
12709
12797
  const typeId = (id) => {
12710
- if (typeof id !== "string" || !id) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("layerId is required (a type layer id from list_layers).");
12711
- _chunkYAFS2QFZcjs.requireTypeLayer.call(void 0, controller.getLayers(), id);
12798
+ if (typeof id !== "string" || !id) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("layerId is required (a type layer id from list_layers).");
12799
+ _chunkJLGNZMUVcjs.requireTypeLayer.call(void 0, controller.getLayers(), id);
12712
12800
  return id;
12713
12801
  };
12714
12802
  const layerSummary = (id) => {
@@ -12788,7 +12876,7 @@ function createImageTypeTools(controller) {
12788
12876
  annotations: { title: "Style a range of text", ...WRITE_IDEMPOTENT6 },
12789
12877
  handler: (args) => {
12790
12878
  const style = pick2(args, Object.keys(STYLE));
12791
- if (!Object.keys(style).length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Give at least one style field: ${Object.keys(STYLE).join(", ")}.`);
12879
+ if (!Object.keys(style).length) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Give at least one style field: ${Object.keys(STYLE).join(", ")}.`);
12792
12880
  return controller.setTextStyle(typeId(args.layerId), style, range(args));
12793
12881
  }
12794
12882
  };
@@ -12800,7 +12888,7 @@ function createImageTypeTools(controller) {
12800
12888
  annotations: { title: "Style paragraphs", ...WRITE_IDEMPOTENT6 },
12801
12889
  handler: (args) => {
12802
12890
  const style = pick2(args, Object.keys(PARAGRAPH));
12803
- if (!Object.keys(style).length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Give at least one paragraph field: ${Object.keys(PARAGRAPH).join(", ")}.`);
12891
+ if (!Object.keys(style).length) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)(`Give at least one paragraph field: ${Object.keys(PARAGRAPH).join(", ")}.`);
12804
12892
  return controller.setParagraphStyle(typeId(args.layerId), style, range(args));
12805
12893
  }
12806
12894
  };
@@ -12822,7 +12910,7 @@ function createImageTypeTools(controller) {
12822
12910
  annotations: { title: "Point or paragraph text", ...WRITE_IDEMPOTENT6 },
12823
12911
  handler: ({ layerId, kind, width, height }) => {
12824
12912
  const id = typeId(layerId);
12825
- if (kind === "box" && (width === void 0 || height === void 0)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("kind box needs width and height in pixels.");
12913
+ if (kind === "box" && (width === void 0 || height === void 0)) throw new (0, _chunkJLGNZMUVcjs.LayerOperationError)("kind box needs width and height in pixels.");
12826
12914
  return controller.setTextFrame(id, kind === "box" ? { kind: "box", width, height } : { kind: "point" });
12827
12915
  }
12828
12916
  };
@@ -12844,7 +12932,7 @@ function createImageTypeTools(controller) {
12844
12932
  var LAYER_PATH = /^layers\.([^.]+)\.(.+)$/;
12845
12933
  function adjustmentsSummary(adjustments) {
12846
12934
  return {
12847
- process: _chunkYAFS2QFZcjs.normalizeProcessVersion.call(void 0, adjustments.process),
12935
+ process: _chunkJLGNZMUVcjs.normalizeProcessVersion.call(void 0, adjustments.process),
12848
12936
  values: readAdjustmentControls(adjustments),
12849
12937
  layers: (_nullishCoalesce(adjustments.layers, () => ( []))).map((l) => JSON.parse(JSON.stringify(l)))
12850
12938
  };
@@ -12887,7 +12975,7 @@ function createImageEditorToolProvider(controller, options = {}) {
12887
12975
  default: def,
12888
12976
  ...requiresProcess ? { requiresProcess } : {}
12889
12977
  })),
12890
- layerKinds: _chunkYAFS2QFZcjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
12978
+ layerKinds: _chunkJLGNZMUVcjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
12891
12979
  kind,
12892
12980
  label,
12893
12981
  controls: [...ADJUSTMENT_LAYER_CONTROLS[kind], ADJUSTMENT_LAYER_OPACITY_CONTROL].map(({ id, label: l, min, max, step, default: def }) => ({
@@ -12973,7 +13061,7 @@ function createImageEditorToolProvider(controller, options = {}) {
12973
13061
  const result = { applied, clamped };
12974
13062
  if (typeof label === "string" && label) result.label = label;
12975
13063
  const notes = [];
12976
- if ("tint" in applied && _chunkYAFS2QFZcjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
13064
+ if ("tint" in applied && _chunkJLGNZMUVcjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
12977
13065
  notes.push("Tint has no effect on process 1 edits.");
12978
13066
  }
12979
13067
  if (notes.length) result.notes = notes;
@@ -12983,11 +13071,11 @@ function createImageEditorToolProvider(controller, options = {}) {
12983
13071
  const addLayer = {
12984
13072
  name: "add_adjustment_layer",
12985
13073
  title: "Add an adjustment layer",
12986
- description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunkYAFS2QFZcjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
13074
+ description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunkJLGNZMUVcjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
12987
13075
  inputSchema: {
12988
13076
  type: "object",
12989
13077
  properties: {
12990
- kind: { type: "string", enum: _chunkYAFS2QFZcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
13078
+ kind: { type: "string", enum: _chunkJLGNZMUVcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
12991
13079
  params: { type: "object", description: "Initial parameters (see list_controls); merged with neutral defaults." },
12992
13080
  opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0-1 (default 1)." },
12993
13081
  blend: { type: "string", enum: _chunkJ5BA3BQ6cjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." },
@@ -13006,7 +13094,7 @@ function createImageEditorToolProvider(controller, options = {}) {
13006
13094
  openWorldHint: false
13007
13095
  },
13008
13096
  handler: ({ kind, params, opacity, blend, name, aboveId, parentId }) => {
13009
- if (!_chunkYAFS2QFZcjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
13097
+ if (!_chunkJLGNZMUVcjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
13010
13098
  if (blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, blend)) throw new Error(`Unknown blend mode "${blend}".`);
13011
13099
  if (aboveId !== void 0 && parentId !== void 0) throw new Error("Give aboveId or parentId, not both.");
13012
13100
  for (const ref of [aboveId, parentId]) {
@@ -13100,7 +13188,7 @@ function boxToCurvePoint(x, y, width, height) {
13100
13188
  return { input: clampLevel(x / (width || 1) * 255), output: clampLevel((height - y) / (height || 1) * 255) };
13101
13189
  }
13102
13190
  function curveSvgPath(points, width, height, samples = 64) {
13103
- const lut = _chunkYAFS2QFZcjs.curveLutFromLevels.call(void 0, points);
13191
+ const lut = _chunkJLGNZMUVcjs.curveLutFromLevels.call(void 0, points);
13104
13192
  const n = lut.length - 1;
13105
13193
  let d = "";
13106
13194
  for (let i = 0; i <= samples; i++) {
@@ -13610,7 +13698,7 @@ var TextEditSession = (_class11 = class {
13610
13698
  else {
13611
13699
  const layout = this.layout();
13612
13700
  if (layout && layout.lines.length) {
13613
- const c = _chunkZ2H7KECKcjs.caretAt.call(void 0, layout, f);
13701
+ const c = _chunk2R3UW57Ucjs.caretAt.call(void 0, layout, f);
13614
13702
  const line = layout.lines[c.line];
13615
13703
  if (to === "home") f = line.start;
13616
13704
  else if (to === "end") {
@@ -13705,7 +13793,7 @@ var TextEditSession = (_class11 = class {
13705
13793
  styleHere() {
13706
13794
  const layer = this.layer;
13707
13795
  const at = this.start > 0 && this.start === this.end ? this.start - 1 : this.start;
13708
- return _chunkZ2H7KECKcjs.styleAt.call(void 0, layer.runs, at, _chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE);
13796
+ return _chunk2R3UW57Ucjs.styleAt.call(void 0, layer.runs, at, _chunk2R3UW57Ucjs.DEFAULT_TEXT_STYLE);
13709
13797
  }
13710
13798
  info() {
13711
13799
  return this.controller.getTextLayer(this.layerId);
@@ -13714,8 +13802,8 @@ var TextEditSession = (_class11 = class {
13714
13802
  overlay() {
13715
13803
  const layer = this.layer;
13716
13804
  const layout = this.layout();
13717
- const m = _chunkYAFS2QFZcjs.textMatrix.call(void 0, layer);
13718
- const at = (x, y) => _chunkZ2H7KECKcjs.applyMatrix.call(void 0, m, { x, y });
13805
+ const m = _chunkJLGNZMUVcjs.textMatrix.call(void 0, layer);
13806
+ const at = (x, y) => _chunk2R3UW57Ucjs.applyMatrix.call(void 0, m, { x, y });
13719
13807
  let frame = null;
13720
13808
  if (layer.frame.kind === "box") frame = [at(0, 0), at(layer.frame.width, 0), at(layer.frame.width, layer.frame.height), at(0, layer.frame.height)];
13721
13809
  else if (layout) {
@@ -13735,7 +13823,7 @@ var TextEditSession = (_class11 = class {
13735
13823
  selection.push([at(x0, top), at(x1, top), at(x1, bottom), at(x0, bottom)]);
13736
13824
  }
13737
13825
  }
13738
- const c = _chunkZ2H7KECKcjs.caretAt.call(void 0, layout, this.focus);
13826
+ const c = _chunk2R3UW57Ucjs.caretAt.call(void 0, layout, this.focus);
13739
13827
  return { caret: [at(c.x, c.top), at(c.x, c.bottom)], selection, frame };
13740
13828
  }
13741
13829
  /** Ends editing: an empty layer made for this session is deleted (as Photoshop does). Returns whether the layer remains. */
@@ -13750,7 +13838,7 @@ var TextEditSession = (_class11 = class {
13750
13838
  }
13751
13839
  if (this.layer.name === "Text" && this.changed) {
13752
13840
  try {
13753
- this.controller.setLayerProperties(this.layerId, { name: _chunkYAFS2QFZcjs.typeLayerName.call(void 0, this.text) }, false);
13841
+ this.controller.setLayerProperties(this.layerId, { name: _chunkJLGNZMUVcjs.typeLayerName.call(void 0, this.text) }, false);
13754
13842
  } catch (e32) {
13755
13843
  }
13756
13844
  }
@@ -13761,8 +13849,8 @@ function typeLayerAt(controller, p, slop = 4) {
13761
13849
  const layers = [...flattenTypeLayers(controller.getLayers())].reverse();
13762
13850
  for (const l of layers) {
13763
13851
  if (!l.visible) continue;
13764
- const inv = invert(_chunkYAFS2QFZcjs.textMatrix.call(void 0, l));
13765
- const q = _chunkZ2H7KECKcjs.applyMatrix.call(void 0, inv, p);
13852
+ const inv = invert(_chunkJLGNZMUVcjs.textMatrix.call(void 0, l));
13853
+ const q = _chunk2R3UW57Ucjs.applyMatrix.call(void 0, inv, p);
13766
13854
  let b = null;
13767
13855
  if (l.frame.kind === "box") b = { x: 0, y: 0, width: l.frame.width, height: l.frame.height };
13768
13856
  else {
@@ -13872,7 +13960,7 @@ function layerPanelRows(layers, activeId) {
13872
13960
  }
13873
13961
  function layerLabel(layer) {
13874
13962
  if (layer.name) return layer.name;
13875
- if (layer.type === "adjustment") return _chunkYAFS2QFZcjs.adjustmentKindLabel.call(void 0, layer.kind);
13963
+ if (layer.type === "adjustment") return _chunkJLGNZMUVcjs.adjustmentKindLabel.call(void 0, layer.kind);
13876
13964
  return layer.type === "group" ? "Group" : "Layer";
13877
13965
  }
13878
13966
  function layerBadge(layer) {
@@ -14344,7 +14432,7 @@ var FREE_TRANSFORM_MODE_OPTIONS = [
14344
14432
  ];
14345
14433
  var WARP_STYLE_OPTIONS = [
14346
14434
  { id: "custom", label: "Custom" },
14347
- ..._chunkZ2H7KECKcjs.WARP_STYLES.map((id) => ({ id, label: _chunkZ2H7KECKcjs.WARP_STYLE_LABELS[id] }))
14435
+ ..._chunk2R3UW57Ucjs.WARP_STYLES.map((id) => ({ id, label: _chunk2R3UW57Ucjs.WARP_STYLE_LABELS[id] }))
14348
14436
  ];
14349
14437
  var WARP_GRID_OPTIONS = [
14350
14438
  { id: "1x1", label: "Default", columns: 1, rows: 1 },
@@ -14480,7 +14568,7 @@ var FreeTransformTool = (_class13 = class {
14480
14568
  setMode(mode) {
14481
14569
  this.modeValue = mode;
14482
14570
  const s = this.session;
14483
- if (mode === "warp" && s && !this.mesh) this.mesh = _chunkZ2H7KECKcjs.identityWarpMesh.call(void 0, s.box, this.warpSettings.columns, this.warpSettings.rows);
14571
+ if (mode === "warp" && s && !this.mesh) this.mesh = _chunk2R3UW57Ucjs.identityWarpMesh.call(void 0, s.box, this.warpSettings.columns, this.warpSettings.rows);
14484
14572
  this.changed();
14485
14573
  }
14486
14574
  /** The Warp options bar's settings. */
@@ -14502,13 +14590,13 @@ var FreeTransformTool = (_class13 = class {
14502
14590
  this.modeValue = "warp";
14503
14591
  const next = { ...this.warpSettings, ...changes };
14504
14592
  this.warpSettings = next;
14505
- let mesh = _nullishCoalesce(this.mesh, () => ( _chunkZ2H7KECKcjs.identityWarpMesh.call(void 0, s.box, next.columns, next.rows)));
14593
+ let mesh = _nullishCoalesce(this.mesh, () => ( _chunk2R3UW57Ucjs.identityWarpMesh.call(void 0, s.box, next.columns, next.rows)));
14506
14594
  if (next.style !== "custom" && ("style" in changes || "bend" in changes || "horizontal" in changes || "vertical" in changes || "orientation" in changes)) {
14507
14595
  const preset = { style: next.style, bend: next.bend, horizontal: next.horizontal, vertical: next.vertical, orientation: next.orientation };
14508
- mesh = _nullishCoalesce(_chunkZ2H7KECKcjs.warpPresetMesh.call(void 0, preset, s.box), () => ( _chunkZ2H7KECKcjs.identityWarpMesh.call(void 0, s.box)));
14509
- mesh = _chunkZ2H7KECKcjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
14596
+ mesh = _nullishCoalesce(_chunk2R3UW57Ucjs.warpPresetMesh.call(void 0, preset, s.box), () => ( _chunk2R3UW57Ucjs.identityWarpMesh.call(void 0, s.box)));
14597
+ mesh = _chunk2R3UW57Ucjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
14510
14598
  }
14511
- if ("columns" in changes || "rows" in changes) mesh = _chunkZ2H7KECKcjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
14599
+ if ("columns" in changes || "rows" in changes) mesh = _chunk2R3UW57Ucjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
14512
14600
  this.mesh = mesh;
14513
14601
  this.changed();
14514
14602
  this.preview();
@@ -14555,11 +14643,11 @@ var FreeTransformTool = (_class13 = class {
14555
14643
  const m = this.mesh;
14556
14644
  const at = (p) => _nullishCoalesce(_chunkMUUXNRU4cjs.applyHomography.call(void 0, h, p), () => ( p));
14557
14645
  const pts = m.points.map(at);
14558
- const edit = _chunkZ2H7KECKcjs.warpMeshEditPoints.call(void 0, m);
14646
+ const edit = _chunk2R3UW57Ucjs.warpMeshEditPoints.call(void 0, m);
14559
14647
  out.handles = [];
14560
- out.outline = _chunkZ2H7KECKcjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }).length ? this.meshOutline(pts, m) : out.outline;
14648
+ out.outline = _chunk2R3UW57Ucjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }).length ? this.meshOutline(pts, m) : out.outline;
14561
14649
  out.warp = {
14562
- curves: _chunkZ2H7KECKcjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }),
14650
+ curves: _chunk2R3UW57Ucjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }),
14563
14651
  anchors: edit.anchors.map((i) => pts[i]),
14564
14652
  handles: edit.handles.map((e) => ({ point: pts[e.index], anchor: pts[e.anchor] }))
14565
14653
  };
@@ -14583,7 +14671,7 @@ var FreeTransformTool = (_class13 = class {
14583
14671
  if (!o) return null;
14584
14672
  if (this.modeValue === "warp" && this.mesh) {
14585
14673
  const h = this.homography();
14586
- const edit = _chunkZ2H7KECKcjs.warpMeshEditPoints.call(void 0, this.mesh);
14674
+ const edit = _chunk2R3UW57Ucjs.warpMeshEditPoints.call(void 0, this.mesh);
14587
14675
  let best2 = -1;
14588
14676
  let bestD2 = tolerance;
14589
14677
  for (const i of [...edit.anchors, ...edit.handles.map((e) => e.index)]) {
@@ -14628,7 +14716,7 @@ var FreeTransformTool = (_class13 = class {
14628
14716
  if (this.modeValue === "warp" && this.mesh && handle === "inside") {
14629
14717
  const q = this.toFrame(p, this.corners);
14630
14718
  if (q) {
14631
- const r = _chunkZ2H7KECKcjs.warpMeshParamAt.call(void 0, this.mesh, q);
14719
+ const r = _chunk2R3UW57Ucjs.warpMeshParamAt.call(void 0, this.mesh, q);
14632
14720
  st = { s: r.s, t: r.t };
14633
14721
  }
14634
14722
  }
@@ -14661,8 +14749,8 @@ var FreeTransformTool = (_class13 = class {
14661
14749
  if (!a || !b) return;
14662
14750
  const delta = { x: b.x - a.x, y: b.y - a.y };
14663
14751
  const i = meshIndex(d.handle);
14664
- if (i >= 0) this.mesh = _chunkZ2H7KECKcjs.dragWarpMeshPoint.call(void 0, d.mesh, i, delta);
14665
- else if (d.handle === "inside" && d.st) this.mesh = _chunkZ2H7KECKcjs.pullWarpMesh.call(void 0, d.mesh, d.st.s, d.st.t, delta);
14752
+ if (i >= 0) this.mesh = _chunk2R3UW57Ucjs.dragWarpMeshPoint.call(void 0, d.mesh, i, delta);
14753
+ else if (d.handle === "inside" && d.st) this.mesh = _chunk2R3UW57Ucjs.pullWarpMesh.call(void 0, d.mesh, d.st.s, d.st.t, delta);
14666
14754
  else return;
14667
14755
  this.warpSettings = { ...this.warpSettings, style: "custom" };
14668
14756
  this.changed();
@@ -14786,7 +14874,7 @@ var FreeTransformTool = (_class13 = class {
14786
14874
  bar() {
14787
14875
  const s = this.session;
14788
14876
  if (!s || !this.corners) return null;
14789
- const read = _chunkYAFS2QFZcjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
14877
+ const read = _chunkJLGNZMUVcjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
14790
14878
  return {
14791
14879
  affine: read.affine,
14792
14880
  x: _nullishCoalesce(this.typed.x, () => ( read.x)),
@@ -14811,7 +14899,7 @@ var FreeTransformTool = (_class13 = class {
14811
14899
  this.changed();
14812
14900
  return;
14813
14901
  }
14814
- const m = _chunkYAFS2QFZcjs.matrixFromParams.call(void 0, s.box, {
14902
+ const m = _chunkJLGNZMUVcjs.matrixFromParams.call(void 0, s.box, {
14815
14903
  scaleX: next.scaleX,
14816
14904
  scaleY: next.scaleY,
14817
14905
  rotate: next.rotate,
@@ -14821,7 +14909,7 @@ var FreeTransformTool = (_class13 = class {
14821
14909
  dx: next.x - this.refBox.x,
14822
14910
  dy: next.y - this.refBox.y
14823
14911
  });
14824
- this.setCorners(_chunkYAFS2QFZcjs.cornersFromMatrix.call(void 0, s.box, m));
14912
+ this.setCorners(_chunkJLGNZMUVcjs.cornersFromMatrix.call(void 0, s.box, m));
14825
14913
  this.typed = { scaleX: next.scaleX, scaleY: next.scaleY, rotate: next.rotate, skewX: next.skewX, skewY: next.skewY, x: next.x, y: next.y };
14826
14914
  this.changed();
14827
14915
  }
@@ -15914,5 +16002,12 @@ function createImageEffectsToolProvider(controller, options = {}) {
15914
16002
 
15915
16003
 
15916
16004
 
15917
- exports.ADJUSTMENT_KEYS = _chunkYAFS2QFZcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkYAFS2QFZcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkYAFS2QFZcjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkYAFS2QFZcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkYAFS2QFZcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkYAFS2QFZcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkJ5BA3BQ6cjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkJ5BA3BQ6cjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkYAFS2QFZcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkFHPVDTI2cjs.BODY_SCATTER; exports.BRUSHSTROKE_MAX_SCALE = _chunkSYPFUL5Bcjs.BRUSHSTROKE_MAX_SCALE; exports.BRUSHSTROKE_MIN_SCALE = _chunkSYPFUL5Bcjs.BRUSHSTROKE_MIN_SCALE; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkG5NMLUVFcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunkZ6OUCS2Kcjs.BrushstrokeCache; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.CoverageMap = _chunk6GFRKLLScjs.CoverageMap; exports.D50 = _chunkYAFS2QFZcjs.D50; exports.D65 = _chunkYAFS2QFZcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkZ2H7KECKcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunk6GFRKLLScjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunk6GFRKLLScjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkFHPVDTI2cjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunk24ATT2PEcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkYAFS2QFZcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunk6GFRKLLScjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunk6GFRKLLScjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunk6GFRKLLScjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunkNVTHUPJ6cjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunk6GFRKLLScjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkFHPVDTI2cjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkFHPVDTI2cjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkYAFS2QFZcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunk24ATT2PEcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkFHPVDTI2cjs.DRY_EPS; exports.DabWalker = _chunk6GFRKLLScjs.DabWalker; exports.EMPTY_DISTANCE = _chunkYAFS2QFZcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunk6GFRKLLScjs.EMPTY_MIXER_LOAD; exports.EX = _chunkFHPVDTI2cjs.EX; exports.EY = _chunkFHPVDTI2cjs.EY; exports.FLAG_ALIVE = _chunkFHPVDTI2cjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkFHPVDTI2cjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkFHPVDTI2cjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkFHPVDTI2cjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkFHPVDTI2cjs.FLAG_TOP; exports.FLAG_WET = _chunkFHPVDTI2cjs.FLAG_WET; exports.FLAT = _chunkFHPVDTI2cjs.FLAT; exports.FREE_INTERVAL = _chunkFHPVDTI2cjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkYAFS2QFZcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HIDE = _chunkFHPVDTI2cjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkYAFS2QFZcjs.HUE_RANGE_LABELS; exports.IDENTITY_MATRIX3 = _chunkYAFS2QFZcjs.IDENTITY_MATRIX3; exports.IMAGE_ADJUSTMENT_CONTROLS = IMAGE_ADJUSTMENT_CONTROLS; exports.IMAGE_CROP_PRESETS = IMAGE_CROP_PRESETS; exports.IMAGE_EDITOR_SCHEMA_VERSION = IMAGE_EDITOR_SCHEMA_VERSION; exports.IMAGE_EDITOR_STATE_VERSION = IMAGE_EDITOR_STATE_VERSION; exports.IMAGE_EFFECT_PLACES = IMAGE_EFFECT_PLACES; exports.IMAGE_FILTER_PRESETS = IMAGE_FILTER_PRESETS; exports.INTENTS = _chunkG5NMLUVFcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunk24ATT2PEcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkYAFS2QFZcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkYAFS2QFZcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunk24ATT2PEcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkYAFS2QFZcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkYAFS2QFZcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkYAFS2QFZcjs.LUMA_709; exports.LayerCompositor = _chunkYAFS2QFZcjs.LayerCompositor; exports.LayerEffectError = _chunk24ATT2PEcjs.LayerEffectError; exports.LayerOperationError = _chunkYAFS2QFZcjs.LayerOperationError; exports.MAX_BATCH = _chunkFHPVDTI2cjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunk6GFRKLLScjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunk24ATT2PEcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkYAFS2QFZcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkFHPVDTI2cjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunk24ATT2PEcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkFHPVDTI2cjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkFHPVDTI2cjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkYAFS2QFZcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkYAFS2QFZcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunk6GFRKLLScjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunk6GFRKLLScjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunk6GFRKLLScjs.MIXING_MODELS; exports.MixerStroke = _chunk6GFRKLLScjs.MixerStroke; exports.OPP = _chunkFHPVDTI2cjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkJ5BA3BQ6cjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunk6GFRKLLScjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunk6GFRKLLScjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunk6GFRKLLScjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunk6GFRKLLScjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunk6GFRKLLScjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunk6GFRKLLScjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunk6GFRKLLScjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunk6GFRKLLScjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunk6GFRKLLScjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunk6GFRKLLScjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunk6GFRKLLScjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunk6GFRKLLScjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkFHPVDTI2cjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkYAFS2QFZcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkFHPVDTI2cjs.PARAM; exports.PARAM_FLOATS = _chunkFHPVDTI2cjs.PARAM_FLOATS; exports.PATTERN_BLOCK_KEYS = _chunkYAFS2QFZcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkJ5BA3BQ6cjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkFHPVDTI2cjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkJ5BA3BQ6cjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkJ5BA3BQ6cjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkFHPVDTI2cjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkJ5BA3BQ6cjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkFHPVDTI2cjs.PLANE; exports.PLANE_BYTES = _chunkFHPVDTI2cjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkYAFS2QFZcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkFHPVDTI2cjs.P_D0; exports.P_EDGE = _chunkFHPVDTI2cjs.P_EDGE; exports.P_FX = _chunkFHPVDTI2cjs.P_FX; exports.P_FY = _chunkFHPVDTI2cjs.P_FY; exports.P_H = _chunkFHPVDTI2cjs.P_H; exports.P_P0 = _chunkFHPVDTI2cjs.P_P0; exports.P_RHO = _chunkFHPVDTI2cjs.P_RHO; exports.P_SW = _chunkFHPVDTI2cjs.P_SW; exports.P_UX = _chunkFHPVDTI2cjs.P_UX; exports.P_UY = _chunkFHPVDTI2cjs.P_UY; exports.PaintExchange = _chunk6GFRKLLScjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunk6GFRKLLScjs.PaintGradientSampler; exports.PaintSourceError = _chunk6GFRKLLScjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PatternPlacement = _chunk24ATT2PEcjs.PatternPlacement; exports.PatternTile = _chunk24ATT2PEcjs.PatternTile; exports.PsdError = _chunkYAFS2QFZcjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunkNVTHUPJ6cjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunkNVTHUPJ6cjs.RegionPixelSource; exports.RetouchDabStroke = _chunkNVTHUPJ6cjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkYAFS2QFZcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkYAFS2QFZcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkFHPVDTI2cjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkJ5BA3BQ6cjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkYAFS2QFZcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkYAFS2QFZcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkFHPVDTI2cjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkFHPVDTI2cjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkFHPVDTI2cjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkYAFS2QFZcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunkNVTHUPJ6cjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkFHPVDTI2cjs.SRGB_TO_LINEAR; exports.STRIP = _chunkFHPVDTI2cjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkYAFS2QFZcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunk6GFRKLLScjs.SmudgeTip; exports.StrokeCoverage = _chunk6GFRKLLScjs.StrokeCoverage; exports.SurfaceDraft = _chunkJ5BA3BQ6cjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkYAFS2QFZcjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunkYAFS2QFZcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkYAFS2QFZcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkJ5BA3BQ6cjs.TILE; exports.TILE_SHIFT = _chunkJ5BA3BQ6cjs.TILE_SHIFT; exports.TINT_SCALE = _chunkYAFS2QFZcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunk6GFRKLLScjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkYAFS2QFZcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunkNVTHUPJ6cjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkYAFS2QFZcjs.TRANSFORM_ANCHORS; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunk6GFRKLLScjs.TileMedium; exports.TilePixelSource = _chunkNVTHUPJ6cjs.TilePixelSource; exports.TiledSurface = _chunkJ5BA3BQ6cjs.TiledSurface; exports.TransformTooLargeError = _chunk24ATT2PEcjs.TransformTooLargeError; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkFHPVDTI2cjs.U_MAX; exports.VIBRANCE_GREY = _chunkYAFS2QFZcjs.VIBRANCE_GREY; exports.W9 = _chunkFHPVDTI2cjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkZ2H7KECKcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkZ2H7KECKcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkFHPVDTI2cjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkFHPVDTI2cjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkFHPVDTI2cjs.WET_TILE; exports.WGSL_HALO = _chunkFHPVDTI2cjs.WGSL_HALO; exports.WGSL_SHADE = _chunkFHPVDTI2cjs.WGSL_SHADE; exports.WGSL_STEP = _chunkFHPVDTI2cjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WetGpuEngine = _chunkFHPVDTI2cjs.WetGpuEngine; exports.WetMedium = _chunkFHPVDTI2cjs.WetMedium; exports.WetWorkerPool = _chunkFHPVDTI2cjs.WetWorkerPool; exports.WetWorld = _chunkFHPVDTI2cjs.WetWorld; exports.WetWorldError = _chunkFHPVDTI2cjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkYAFS2QFZcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunk643B2HKCcjs.ZlibError; exports.activeAdjustmentLayers = _chunkYAFS2QFZcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkYAFS2QFZcjs.activeEffectSmartFilters; exports.activeSmartFilters = _chunkYAFS2QFZcjs.activeSmartFilters; exports.addLayerEffect = _chunkYAFS2QFZcjs.addLayerEffect; exports.addLayerFilter = _chunkYAFS2QFZcjs.addLayerFilter; exports.addPaintGradientStop = _chunk6GFRKLLScjs.addPaintGradientStop; exports.addSmartFilter = _chunkYAFS2QFZcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkYAFS2QFZcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkYAFS2QFZcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkYAFS2QFZcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkYAFS2QFZcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunk643B2HKCcjs.adler32; exports.anchorPoint = _chunkYAFS2QFZcjs.anchorPoint; exports.annotationBlend = _chunkYAFS2QFZcjs.annotationBlend; exports.annotationLayerFor = _chunkYAFS2QFZcjs.annotationLayerFor; exports.annotationLayerName = _chunkYAFS2QFZcjs.annotationLayerName; exports.annotationOfLayer = _chunkYAFS2QFZcjs.annotationOfLayer; exports.annotationOfShape = _chunkYAFS2QFZcjs.annotationOfShape; exports.annotationOfType = _chunkYAFS2QFZcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkYAFS2QFZcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkYAFS2QFZcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkYAFS2QFZcjs.applyAdjustments; exports.applyBoxBlur = _chunkYAFS2QFZcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkYAFS2QFZcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkYAFS2QFZcjs.applyDepthMask; exports.applyHomography = _chunkMUUXNRU4cjs.applyHomography; exports.applyImageProjectionToContext = _chunkYAFS2QFZcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkYAFS2QFZcjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkYAFS2QFZcjs.applyLegacyFloat; exports.applyMatrix3 = _chunkYAFS2QFZcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkYAFS2QFZcjs.applyParams; exports.applyProcess2Adjustments = _chunkYAFS2QFZcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkYAFS2QFZcjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunkNVTHUPJ6cjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkYAFS2QFZcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunk6GFRKLLScjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunk6GFRKLLScjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunkNVTHUPJ6cjs.applyToneToDeepTile; exports.backgroundLayer = _chunkYAFS2QFZcjs.backgroundLayer; exports.base64ToBytes = _chunkDCLJNVZScjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunkNVTHUPJ6cjs.bestOffset; exports.blackWhiteGray = _chunkYAFS2QFZcjs.blackWhiteGray; exports.blendChannel = _chunkJ5BA3BQ6cjs.blendChannel; exports.blendImageData = _chunkJ5BA3BQ6cjs.blendImageData; exports.blendLum = _chunkJ5BA3BQ6cjs.blendLum; exports.blendPixel = _chunkJ5BA3BQ6cjs.blendPixel; exports.blendRadius = _chunk6GFRKLLScjs.blendRadius; exports.blendRgb = _chunkJ5BA3BQ6cjs.blendRgb; exports.blendTile = _chunk24ATT2PEcjs.blendTile; exports.blenderDab = _chunk6GFRKLLScjs.blenderDab; exports.blurFilter = _chunkYAFS2QFZcjs.blurFilter; exports.borderCoverage = _chunkYAFS2QFZcjs.borderCoverage; exports.boxBlurPixels = _chunkNVTHUPJ6cjs.boxBlurPixels; exports.boxMean = boxMean; exports.boxPointOf = _chunkYAFS2QFZcjs.boxPointOf; exports.boxQuad = _chunkMUUXNRU4cjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkYAFS2QFZcjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunkZ6OUCS2Kcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkZ6OUCS2Kcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkZ6OUCS2Kcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkSYPFUL5Bcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkZ6OUCS2Kcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkZ6OUCS2Kcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkYAFS2QFZcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkYAFS2QFZcjs.buildToneLut; exports.builtinPattern = _chunk24ATT2PEcjs.builtinPattern; exports.builtinPatternIds = _chunk24ATT2PEcjs.builtinPatternIds; exports.bytesToBase64 = _chunkDCLJNVZScjs.bytesToBase64; exports.calculateCropDrag = _chunkYAFS2QFZcjs.calculateCropDrag; exports.canShareMemory = _chunkFHPVDTI2cjs.canShareMemory; exports.canvasCompositeOperation = _chunkJ5BA3BQ6cjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkYAFS2QFZcjs.canvasToImagePoint; exports.caretAt = _chunkZ2H7KECKcjs.caretAt; exports.changedTiles = _chunk24ATT2PEcjs.changedTiles; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkYAFS2QFZcjs.clampCropToImage; exports.cleanMixer = _chunk6GFRKLLScjs.cleanMixer; exports.cloneSourceLabel = cloneSourceLabel; exports.collectTiles = _chunkJ5BA3BQ6cjs.collectTiles; exports.colorBalanceChannel = _chunkYAFS2QFZcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.combineSelections = _chunkYAFS2QFZcjs.combineSelections; exports.compileAdjustmentLayer = _chunkYAFS2QFZcjs.compileAdjustmentLayer; exports.componentPath = _chunkYAFS2QFZcjs.componentPath; exports.compositeDeep = _chunkYAFS2QFZcjs.compositeDeep; exports.compositeSurfaceOver = _chunk24ATT2PEcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkYAFS2QFZcjs.computeSelectionBounds; exports.contentAwareFill = _chunkNVTHUPJ6cjs.contentAwareFill; exports.contentBounds = _chunkJ5BA3BQ6cjs.contentBounds; exports.contentsBox = _chunkYAFS2QFZcjs.contentsBox; exports.contentsSurface = _chunkYAFS2QFZcjs.contentsSurface; exports.contractCoverage = _chunkYAFS2QFZcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkJ5BA3BQ6cjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkYAFS2QFZcjs.convertToSmartObject; exports.copySmartObject = _chunkYAFS2QFZcjs.copySmartObject; exports.cornersFromMatrix = _chunkYAFS2QFZcjs.cornersFromMatrix; exports.coverageTileCoord = _chunk6GFRKLLScjs.coverageTileCoord; exports.coverageToByte = _chunkYAFS2QFZcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkYAFS2QFZcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunk6GFRKLLScjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkZ2H7KECKcjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageEffectsToolProvider = createImageEffectsToolProvider; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePsdTools = createImagePsdTools; exports.createImageRetouchTools = createImageRetouchTools; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkZ2H7KECKcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkZ2H7KECKcjs.createOutlineTextShaper; exports.createPigment = _chunkJ5BA3BQ6cjs.createPigment; exports.createPigmentTools = _chunkFHPVDTI2cjs.createPigmentTools; exports.createSelectionMask = _chunkYAFS2QFZcjs.createSelectionMask; exports.createShapeLayer = _chunkYAFS2QFZcjs.createShapeLayer; exports.createTypeLayer = _chunkYAFS2QFZcjs.createTypeLayer; exports.createWetGpuEngine = _chunkFHPVDTI2cjs.createWetGpuEngine; exports.cssFont = _chunkZ2H7KECKcjs.cssFont; exports.cssFontFamily = _chunkZ2H7KECKcjs.cssFontFamily; exports.curveLut = _chunk24ATT2PEcjs.curveLut; exports.curveLutFromLevels = _chunkYAFS2QFZcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunk6GFRKLLScjs.dabCoverage; exports.dabRect = _chunk6GFRKLLScjs.dabRect; exports.decodeDeepSurface = _chunkYAFS2QFZcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkYAFS2QFZcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkYAFS2QFZcjs.decodeLayerMask; exports.decodeMergedImage = _chunkYAFS2QFZcjs.decodeMergedImage; exports.decodePlanes = _chunkYAFS2QFZcjs.decodePlanes; exports.decodePng = _chunkDCLJNVZScjs.decodePng; exports.decodePngDataUrl = _chunkYAFS2QFZcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkYAFS2QFZcjs.decodeSelectionRle; exports.deepBytes = _chunkJ5BA3BQ6cjs.deepBytes; exports.deepTile = _chunkJ5BA3BQ6cjs.deepTile; exports.defaultAdjustmentParams = _chunkYAFS2QFZcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunk24ATT2PEcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunk24ATT2PEcjs.defaultLayerEffect; exports.defaultShapeName = _chunkYAFS2QFZcjs.defaultShapeName; exports.deflate = _chunk643B2HKCcjs.deflate; exports.deflateRaw = _chunk643B2HKCcjs.deflateRaw; exports.depthMaskAlpha = _chunkYAFS2QFZcjs.depthMaskAlpha; exports.depthOf = _chunkJ5BA3BQ6cjs.depthOf; exports.depthRasterMask = _chunkYAFS2QFZcjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkYAFS2QFZcjs.describeTransform; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkYAFS2QFZcjs.deserializeEffects; exports.deserializeLayer = _chunkYAFS2QFZcjs.deserializeLayer; exports.deserializeLayers = _chunkYAFS2QFZcjs.deserializeLayers; exports.deserializePatterns = _chunkYAFS2QFZcjs.deserializePatterns; exports.deserializeSelection = _chunkYAFS2QFZcjs.deserializeSelection; exports.developFilter = _chunkYAFS2QFZcjs.developFilter; exports.developFromAdjustments = _chunkYAFS2QFZcjs.developFromAdjustments; exports.developTarget = _chunkYAFS2QFZcjs.developTarget; exports.dexp = _chunkFHPVDTI2cjs.dexp; exports.dilateMask = _chunkNVTHUPJ6cjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkYAFS2QFZcjs.distanceTransform; exports.dlog = _chunkFHPVDTI2cjs.dlog; exports.documentContents = _chunkYAFS2QFZcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunkNVTHUPJ6cjs.dodgeBurn; exports.dodgeBurnCurve = _chunkNVTHUPJ6cjs.dodgeBurnCurve; exports.downloadPsd = downloadPsd; exports.dpow = _chunkFHPVDTI2cjs.dpow; exports.dragWarpMeshPoint = _chunkZ2H7KECKcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkFHPVDTI2cjs.dsincos; exports.duplicateLayer = _chunkYAFS2QFZcjs.duplicateLayer; exports.edgeBits = _chunkFHPVDTI2cjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunk24ATT2PEcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunk24ATT2PEcjs.effectReach; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunk24ATT2PEcjs.effectsFingerprint; exports.effectsMargin = _chunk24ATT2PEcjs.effectsMargin; exports.effectsScale = _chunk24ATT2PEcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkJ5BA3BQ6cjs.emptySurface; exports.encodeDeepSurface = _chunkYAFS2QFZcjs.encodeDeepSurface; exports.encodePng = _chunkDCLJNVZScjs.encodePng; exports.encodeRle = _chunkYAFS2QFZcjs.encodeRle; exports.encodeSelectionRle = _chunkYAFS2QFZcjs.encodeSelectionRle; exports.encodeSurface = _chunkYAFS2QFZcjs.encodeSurface; exports.evalWarpMesh = _chunkZ2H7KECKcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkYAFS2QFZcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunk6GFRKLLScjs.exchangeRates; exports.expNeg = _chunkFHPVDTI2cjs.expNeg; exports.expandCoverage = _chunkYAFS2QFZcjs.expandCoverage; exports.exportPsd = _chunkYAFS2QFZcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkYAFS2QFZcjs.featherCoverage; exports.fillRect = _chunkJ5BA3BQ6cjs.fillRect; exports.filmPixel = _chunkFHPVDTI2cjs.filmPixel; exports.filmReflectance = _chunkFHPVDTI2cjs.filmReflectance; exports.filterMaskCoverage = _chunkYAFS2QFZcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunk24ATT2PEcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findWebGpu = _chunkFHPVDTI2cjs.findWebGpu; exports.finishTile = _chunkJ5BA3BQ6cjs.finishTile; exports.fitParagraphRuns = _chunkZ2H7KECKcjs.fitParagraphRuns; exports.fitRuns = _chunkZ2H7KECKcjs.fitRuns; exports.flattenLayers = _chunk24ATT2PEcjs.flattenLayers; exports.flattenPath = _chunkYAFS2QFZcjs.flattenPath; exports.flipCorners = _chunkYAFS2QFZcjs.flipCorners; exports.flowField = _chunkFHPVDTI2cjs.flowField; exports.fontOf = _chunkZ2H7KECKcjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkYAFS2QFZcjs.fullSelection; exports.gaussianBlur = _chunk24ATT2PEcjs.gaussianBlur; exports.geometryHomography = _chunkYAFS2QFZcjs.geometryHomography; exports.getAnnotationBounds = _chunkYAFS2QFZcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkYAFS2QFZcjs.getCropCursor; exports.getRotatedSize = _chunkYAFS2QFZcjs.getRotatedSize; exports.getViewportMetrics = _chunkYAFS2QFZcjs.getViewportMetrics; exports.getViewportProjection = _chunkYAFS2QFZcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.gradientDabColor = _chunk6GFRKLLScjs.gradientDabColor; exports.greyMorphology = _chunkYAFS2QFZcjs.greyMorphology; exports.groupLayers = _chunkYAFS2QFZcjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunk24ATT2PEcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunkYAFS2QFZcjs.hasResampledLegacyMask; exports.hasSurface = _chunkYAFS2QFZcjs.hasSurface; exports.hasWarp = _chunkYAFS2QFZcjs.hasWarp; exports.hash2 = _chunk6GFRKLLScjs.hash2; exports.hashMaskContent = _chunkYAFS2QFZcjs.hashMaskContent; exports.hashNoise = _chunk24ATT2PEcjs.hashNoise; exports.healPixels = _chunkNVTHUPJ6cjs.healPixels; exports.hexToPaintRgb = _chunk6GFRKLLScjs.hexToPaintRgb; exports.hexToRgb = _chunkYAFS2QFZcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkYAFS2QFZcjs.hitTestAnnotation; exports.hitTestCrop = _chunkYAFS2QFZcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkMUUXNRU4cjs.homographyFromAffine; exports.homographyFromPoints = _chunkMUUXNRU4cjs.homographyFromPoints; exports.hslToRgb = _chunkYAFS2QFZcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkYAFS2QFZcjs.hueRangeTables; exports.hueRangeWeight = _chunkYAFS2QFZcjs.hueRangeWeight; exports.hueSaturation = _chunkYAFS2QFZcjs.hueSaturation; exports.identityCurve = _chunkYAFS2QFZcjs.identityCurve; exports.identityLevels = _chunkYAFS2QFZcjs.identityLevels; exports.identityTransform = _chunkYAFS2QFZcjs.identityTransform; exports.identityWarpMesh = _chunkZ2H7KECKcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imageToCanvasPoint = _chunkYAFS2QFZcjs.imageToCanvasPoint; exports.importPsd = _chunkYAFS2QFZcjs.importPsd; exports.inflate = _chunk643B2HKCcjs.inflate; exports.inflateRaw = _chunk643B2HKCcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunk24ATT2PEcjs.insertLayer; exports.instancesOf = _chunkYAFS2QFZcjs.instancesOf; exports.invertHomography = _chunkMUUXNRU4cjs.invertHomography; exports.invertMatrix3 = _chunkYAFS2QFZcjs.invertMatrix3; exports.invertSelection = _chunkYAFS2QFZcjs.invertSelection; exports.isActiveFilter = _chunkYAFS2QFZcjs.isActiveFilter; exports.isAdjustmentKind = _chunkYAFS2QFZcjs.isAdjustmentKind; exports.isBitDepth = _chunkJ5BA3BQ6cjs.isBitDepth; exports.isBlendMode = _chunkJ5BA3BQ6cjs.isBlendMode; exports.isBrushstrokeBrush = _chunkZ6OUCS2Kcjs.isBrushstrokeBrush; exports.isContentsDecoded = _chunkYAFS2QFZcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkYAFS2QFZcjs.isDefaultDepthMask; exports.isGradientPaint = _chunk6GFRKLLScjs.isGradientPaint; exports.isIdentityTransform = _chunkYAFS2QFZcjs.isIdentityTransform; exports.isInterpolation = _chunk24ATT2PEcjs.isInterpolation; exports.isLayerEffectKind = _chunk24ATT2PEcjs.isLayerEffectKind; exports.isLayerLocked = _chunk24ATT2PEcjs.isLayerLocked; exports.isLegacyShape = _chunkYAFS2QFZcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPainterlyBlendMode = _chunkJ5BA3BQ6cjs.isPainterlyBlendMode; exports.isPng = _chunkDCLJNVZScjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkYAFS2QFZcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkYAFS2QFZcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkYAFS2QFZcjs.isSelectionEmpty; exports.isSelectionMode = _chunkYAFS2QFZcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkJ5BA3BQ6cjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkYAFS2QFZcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkYAFS2QFZcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkYAFS2QFZcjs.isTransformAnchor; exports.isValidWarp = _chunkYAFS2QFZcjs.isValidWarp; exports.keepDeepSamples = _chunkJ5BA3BQ6cjs.keepDeepSamples; exports.kelvinToTemperature = _chunkYAFS2QFZcjs.kelvinToTemperature; exports.keysWeight = _chunk24ATT2PEcjs.keysWeight; exports.latticeViscosity = _chunkFHPVDTI2cjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunk24ATT2PEcjs.layerEffectFields; exports.layerEffectLabel = _chunk24ATT2PEcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkYAFS2QFZcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkYAFS2QFZcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkYAFS2QFZcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkYAFS2QFZcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkYAFS2QFZcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkYAFS2QFZcjs.layerTree; exports.layerTypeLabel = _chunkYAFS2QFZcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkYAFS2QFZcjs.layersFromLegacy; exports.layoutText = _chunkZ2H7KECKcjs.layoutText; exports.legacyAdjustmentLayer = _chunkYAFS2QFZcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkYAFS2QFZcjs.legacyMaskOf; exports.legacyView = _chunkYAFS2QFZcjs.legacyView; exports.lerpPigment = _chunkJ5BA3BQ6cjs.lerpPigment; exports.lerpPigmentInto = _chunkJ5BA3BQ6cjs.lerpPigmentInto; exports.levelsValue = _chunkYAFS2QFZcjs.levelsValue; exports.linearSrgbToXy = _chunkYAFS2QFZcjs.linearSrgbToXy; exports.linearToSrgb = _chunkYAFS2QFZcjs.linearToSrgb; exports.linearToSrgb8 = _chunkFHPVDTI2cjs.linearToSrgb8; exports.liveComponent = _chunkYAFS2QFZcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkYAFS2QFZcjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunk6GFRKLLScjs.loadMixer; exports.loadOpenTypeFont = _chunk2OJACTPRcjs.loadOpenTypeFont; exports.loadWetKernel = _chunkFHPVDTI2cjs.loadWetKernel; exports.luma = _chunkNVTHUPJ6cjs.luma; exports.magicWand = magicWand; exports.mapCropHandle = _chunkYAFS2QFZcjs.mapCropHandle; exports.mapLayer = _chunk24ATT2PEcjs.mapLayer; exports.mapSubpaths = _chunkYAFS2QFZcjs.mapSubpaths; exports.maskBounds = _chunkNVTHUPJ6cjs.maskBounds; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkYAFS2QFZcjs.matrixFromCorners; exports.matrixFromParams = _chunkYAFS2QFZcjs.matrixFromParams; exports.membraneFill = _chunkNVTHUPJ6cjs.membraneFill; exports.mergeLayerEffect = _chunk24ATT2PEcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkYAFS2QFZcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunk6GFRKLLScjs.mix32; exports.mixPigment8 = _chunkJ5BA3BQ6cjs.mixPigment8; exports.mixPigmentRgb = _chunkJ5BA3BQ6cjs.mixPigmentRgb; exports.mixPigments = _chunkJ5BA3BQ6cjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunk6GFRKLLScjs.mixerRates; exports.modifySelection = _chunkYAFS2QFZcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkYAFS2QFZcjs.moveLayer; exports.moveSmartFilter = _chunkYAFS2QFZcjs.moveSmartFilter; exports.mulMatrix3 = _chunkYAFS2QFZcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkYAFS2QFZcjs.neutralHueRange; exports.newContentsId = _chunkYAFS2QFZcjs.newContentsId; exports.newEffectId = _chunk24ATT2PEcjs.newEffectId; exports.newLayerId = _chunkYAFS2QFZcjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkYAFS2QFZcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkYAFS2QFZcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkYAFS2QFZcjs.normalizeAngle; exports.normalizeBlendMode = _chunkJ5BA3BQ6cjs.normalizeBlendMode; exports.normalizeBlender = _chunk6GFRKLLScjs.normalizeBlender; exports.normalizeBrush = _chunk6GFRKLLScjs.normalizeBrush; exports.normalizeFilter = _chunkYAFS2QFZcjs.normalizeFilter; exports.normalizeFlow = _chunkFHPVDTI2cjs.normalizeFlow; exports.normalizeHexColor = _chunk6GFRKLLScjs.normalizeHexColor; exports.normalizeLayerEffects = _chunk24ATT2PEcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkYAFS2QFZcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkYAFS2QFZcjs.normalizeLiveShape; exports.normalizeMixer = _chunk6GFRKLLScjs.normalizeMixer; exports.normalizePlacement = _chunkYAFS2QFZcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkYAFS2QFZcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunkNVTHUPJ6cjs.normalizeRetouch; exports.normalizeShapePaint = _chunkYAFS2QFZcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkYAFS2QFZcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkYAFS2QFZcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunk6GFRKLLScjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkYAFS2QFZcjs.normalizeSubpaths; exports.normalizeText = _chunkYAFS2QFZcjs.normalizeText; exports.normalizeTilt = _chunkFHPVDTI2cjs.normalizeTilt; exports.normalizeWetParams = _chunkFHPVDTI2cjs.normalizeWetParams; exports.offsetLayer = _chunkYAFS2QFZcjs.offsetLayer; exports.offsetShape = _chunkYAFS2QFZcjs.offsetShape; exports.offsetSmartObject = _chunkYAFS2QFZcjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkJ5BA3BQ6cjs.packRgba; exports.packWetParams = _chunkFHPVDTI2cjs.packWetParams; exports.paintGradientMappingFor = _chunk6GFRKLLScjs.paintGradientMappingFor; exports.paintPathStroke = _chunkZ6OUCS2Kcjs.paintPathStroke; exports.paintSourceColor = _chunk6GFRKLLScjs.paintSourceColor; exports.paintSourceCss = _chunk6GFRKLLScjs.paintSourceCss; exports.paragraphRanges = _chunkZ2H7KECKcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkYAFS2QFZcjs.parseAdjustmentBlock; exports.parseBlend = _chunkYAFS2QFZcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunk2YQONY6Gcjs.parseCssColor; exports.parseDataUrl = _chunkDCLJNVZScjs.parseDataUrl; exports.parseEffectColor = _chunk24ATT2PEcjs.parseEffectColor; exports.parseLfx2 = _chunkYAFS2QFZcjs.parseLfx2; exports.parseLrfx = _chunkYAFS2QFZcjs.parseLrfx; exports.parseOpenTypeFont = _chunk2OJACTPRcjs.parseOpenTypeFont; exports.parsePaintSource = _chunk6GFRKLLScjs.parsePaintSource; exports.parsePatternBlock = _chunkYAFS2QFZcjs.parsePatternBlock; exports.parseSelectionMode = _chunkYAFS2QFZcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkYAFS2QFZcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkYAFS2QFZcjs.patchParagraphStyle; exports.patchTextStyle = _chunkYAFS2QFZcjs.patchTextStyle; exports.pathStrokeCoverage = _chunkZ6OUCS2Kcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkZ6OUCS2Kcjs.pathStrokeDabs; exports.perDabStrength = _chunkNVTHUPJ6cjs.perDabStrength; exports.photoFilterMatrix = _chunkYAFS2QFZcjs.photoFilterMatrix; exports.pigment8 = _chunkJ5BA3BQ6cjs.pigment8; exports.pigmentColor = _chunkFHPVDTI2cjs.pigmentColor; exports.pigmentOf = _chunkFHPVDTI2cjs.pigmentOf; exports.pixelLayerBounds = _chunkYAFS2QFZcjs.pixelLayerBounds; exports.pixelLayers = _chunkYAFS2QFZcjs.pixelLayers; exports.pixelPigment = _chunkFHPVDTI2cjs.pixelPigment; exports.placeContents = _chunkYAFS2QFZcjs.placeContents; exports.placeLayer = _chunkYAFS2QFZcjs.placeLayer; exports.placementAt = _chunkYAFS2QFZcjs.placementAt; exports.placementBounds = _chunkYAFS2QFZcjs.placementBounds; exports.placementGeometry = _chunkYAFS2QFZcjs.placementGeometry; exports.pngDataUrl = _chunkDCLJNVZScjs.pngDataUrl; exports.pointerPressure = _chunkFHPVDTI2cjs.pointerPressure; exports.pointerStrokeSample = _chunkFHPVDTI2cjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkFHPVDTI2cjs.pointerStrokeSamples; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkYAFS2QFZcjs.posterizeValue; exports.presetWarp = _chunkYAFS2QFZcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkYAFS2QFZcjs.projectImagePoint; exports.projectImageRect = _chunkYAFS2QFZcjs.projectImageRect; exports.projectMaskCoverage = _chunkYAFS2QFZcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkJ5BA3BQ6cjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkYAFS2QFZcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkYAFS2QFZcjs.psdToLayers; exports.pullWarpMesh = _chunkZ2H7KECKcjs.pullWarpMesh; exports.put255 = _chunk6GFRKLLScjs.put255; exports.quickMaskPixels = quickMaskPixels; exports.rand01 = _chunk6GFRKLLScjs.rand01; exports.rangeLightness = _chunkYAFS2QFZcjs.rangeLightness; exports.rasterContents = _chunkYAFS2QFZcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkYAFS2QFZcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkYAFS2QFZcjs.rasterizeCoverage; exports.rasterizeDab = _chunk6GFRKLLScjs.rasterizeDab; exports.rasterizeSmartObject = _chunkYAFS2QFZcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkJ5BA3BQ6cjs.readDeepRegion; exports.readPaintSource = _chunk6GFRKLLScjs.readPaintSource; exports.readPixel = _chunkJ5BA3BQ6cjs.readPixel; exports.readPsd = _chunkYAFS2QFZcjs.readPsd; exports.readRegion = _chunkJ5BA3BQ6cjs.readRegion; exports.readSourceRegion = _chunkNVTHUPJ6cjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkMUUXNRU4cjs.rectToQuad; exports.reduceSurface = _chunk24ATT2PEcjs.reduceSurface; exports.referencePoint = _chunkYAFS2QFZcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkJ5BA3BQ6cjs.reflectanceToRgb; exports.removeAlpha = _chunkYAFS2QFZcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkYAFS2QFZcjs.removeLayer; exports.removeLayerEffect = _chunkYAFS2QFZcjs.removeLayerEffect; exports.removeLayerFilter = _chunkYAFS2QFZcjs.removeLayerFilter; exports.removePaintGradientStop = _chunk6GFRKLLScjs.removePaintGradientStop; exports.removeSmartFilter = _chunkYAFS2QFZcjs.removeSmartFilter; exports.renderBrushstroke = _chunkZ6OUCS2Kcjs.renderBrushstroke; exports.renderLayerEffects = _chunk24ATT2PEcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkYAFS2QFZcjs.renderShape; exports.renderShapeRect = _chunkYAFS2QFZcjs.renderShapeRect; exports.renderSmartObject = _chunkYAFS2QFZcjs.renderSmartObject; exports.renderText = _chunkYAFS2QFZcjs.renderText; exports.replaceContents = _chunkYAFS2QFZcjs.replaceContents; exports.replaceTextRange = _chunkYAFS2QFZcjs.replaceTextRange; exports.requireLayer = _chunkYAFS2QFZcjs.requireLayer; exports.requireOperation = _chunkYAFS2QFZcjs.requireOperation; exports.requireShapeLayer = _chunkYAFS2QFZcjs.requireShapeLayer; exports.requireSmartObject = _chunkYAFS2QFZcjs.requireSmartObject; exports.requireTypeLayer = _chunkYAFS2QFZcjs.requireTypeLayer; exports.requireUnlocked = _chunkYAFS2QFZcjs.requireUnlocked; exports.rerender = _chunkYAFS2QFZcjs.rerender; exports.rerenderShape = _chunkYAFS2QFZcjs.rerenderShape; exports.rerenderText = _chunkYAFS2QFZcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkYAFS2QFZcjs.resizeSelection; exports.resizeWarpMesh = _chunkZ2H7KECKcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkYAFS2QFZcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunk6GFRKLLScjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunkZ2H7KECKcjs.restyleRange; exports.retouchFilter = _chunkNVTHUPJ6cjs.retouchFilter; exports.reversePaintGradient = _chunk6GFRKLLScjs.reversePaintGradient; exports.rgbToGray = _chunkYAFS2QFZcjs.rgbToGray; exports.rgbToHsl = _chunkYAFS2QFZcjs.rgbToHsl; exports.rgbToReflectance = _chunkJ5BA3BQ6cjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunkNVTHUPJ6cjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkYAFS2QFZcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkYAFS2QFZcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunkYAFS2QFZcjs.sampleLut; exports.sampleToneLut = _chunkYAFS2QFZcjs.sampleToneLut; exports.saturationOf = _chunkNVTHUPJ6cjs.saturationOf; exports.scaleLayerEffect = _chunk24ATT2PEcjs.scaleLayerEffect; exports.scalePaintGradient = _chunk6GFRKLLScjs.scalePaintGradient; exports.seamlessClone = _chunkNVTHUPJ6cjs.seamlessClone; exports.selectionArea = _chunkYAFS2QFZcjs.selectionArea; exports.selectionFromCoverage = _chunkYAFS2QFZcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkYAFS2QFZcjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkYAFS2QFZcjs.selectionToCoverage; exports.selectionToPixels = _chunkYAFS2QFZcjs.selectionToPixels; exports.selectionValueAt = _chunkYAFS2QFZcjs.selectionValueAt; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkYAFS2QFZcjs.serializeContents; exports.serializeEffects = _chunkYAFS2QFZcjs.serializeEffects; exports.serializeLayer = _chunkYAFS2QFZcjs.serializeLayer; exports.serializeLayers = _chunkYAFS2QFZcjs.serializeLayers; exports.serializeLayersExternal = _chunkYAFS2QFZcjs.serializeLayersExternal; exports.serializePatterns = _chunkYAFS2QFZcjs.serializePatterns; exports.serializeSelection = _chunkYAFS2QFZcjs.serializeSelection; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkYAFS2QFZcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkYAFS2QFZcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkYAFS2QFZcjs.setLayerMask; exports.setLayerProperties = _chunkYAFS2QFZcjs.setLayerProperties; exports.setLum = _chunkJ5BA3BQ6cjs.setLum; exports.setPigmentColor = _chunkJ5BA3BQ6cjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkYAFS2QFZcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkYAFS2QFZcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkYAFS2QFZcjs.setSmartPlacement; exports.shadeTile = _chunkFHPVDTI2cjs.shadeTile; exports.shapeAsPixelLayer = _chunkYAFS2QFZcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkYAFS2QFZcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkYAFS2QFZcjs.shapeGeometryBounds; exports.shapeLayers = _chunkYAFS2QFZcjs.shapeLayers; exports.shapeOutline = _chunkYAFS2QFZcjs.shapeOutline; exports.shapeRenderClip = _chunkYAFS2QFZcjs.shapeRenderClip; exports.shiftCoverage = _chunkYAFS2QFZcjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkYAFS2QFZcjs.smartObjectLayers; exports.smoothCoverage = _chunkYAFS2QFZcjs.smoothCoverage; exports.smoothPoints = _chunk6GFRKLLScjs.smoothPoints; exports.smudgeEffect = _chunkNVTHUPJ6cjs.smudgeEffect; exports.solidPaint = _chunk6GFRKLLScjs.solidPaint; exports.solidSurface = _chunkJ5BA3BQ6cjs.solidSurface; exports.solveMembrane = _chunkNVTHUPJ6cjs.solveMembrane; exports.spliceRuns = _chunkZ2H7KECKcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunkNVTHUPJ6cjs.sponge; exports.spongeEffect = _chunkNVTHUPJ6cjs.spongeEffect; exports.spotHealPixels = _chunkNVTHUPJ6cjs.spotHealPixels; exports.spotHealWindow = _chunkNVTHUPJ6cjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkFHPVDTI2cjs.srgbByteToLinear; exports.srgbDecode = _chunkJ5BA3BQ6cjs.srgbDecode; exports.srgbEncode = _chunkJ5BA3BQ6cjs.srgbEncode; exports.srgbToLinear = _chunkYAFS2QFZcjs.srgbToLinear; exports.standardBlendMode = _chunkJ5BA3BQ6cjs.standardBlendMode; exports.stepSlotTs = _chunkFHPVDTI2cjs.stepSlotTs; exports.styleAt = _chunkZ2H7KECKcjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkJ5BA3BQ6cjs.surfaceBytes; exports.surfaceDepth = _chunkJ5BA3BQ6cjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkJ5BA3BQ6cjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunkJ5BA3BQ6cjs.surfaceFromPixels; exports.surfacesEqual = _chunkJ5BA3BQ6cjs.surfacesEqual; exports.tempTintToXy = _chunkYAFS2QFZcjs.tempTintToXy; exports.temperatureToKelvin = _chunkYAFS2QFZcjs.temperatureToKelvin; exports.textIndexAt = _chunkZ2H7KECKcjs.textIndexAt; exports.textMatrix = _chunkYAFS2QFZcjs.textMatrix; exports.textOutlines = _chunkYAFS2QFZcjs.textOutlines; exports.textRange = _chunkYAFS2QFZcjs.textRange; exports.tileCoord = _chunkJ5BA3BQ6cjs.tileCoord; exports.tileKey = _chunkJ5BA3BQ6cjs.tileKey; exports.tileRect = _chunkJ5BA3BQ6cjs.tileRect; exports.tileSamples = _chunkJ5BA3BQ6cjs.tileSamples; exports.tileSamples16 = _chunkJ5BA3BQ6cjs.tileSamples16; exports.tileSamples32 = _chunkJ5BA3BQ6cjs.tileSamples32; exports.tilesInRect = _chunkJ5BA3BQ6cjs.tilesInRect; exports.tipFalloff = _chunk6GFRKLLScjs.tipFalloff; exports.tipReach = _chunk6GFRKLLScjs.tipReach; exports.tipShape = _chunk6GFRKLLScjs.tipShape; exports.to16From32 = _chunkJ5BA3BQ6cjs.to16From32; exports.to16From8 = _chunkJ5BA3BQ6cjs.to16From8; exports.to32From16 = _chunkJ5BA3BQ6cjs.to32From16; exports.to32From8 = _chunkJ5BA3BQ6cjs.to32From8; exports.to8From16 = _chunkJ5BA3BQ6cjs.to8From16; exports.to8From32 = _chunkJ5BA3BQ6cjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkYAFS2QFZcjs.toTextSpace; exports.toneCurve = _chunkYAFS2QFZcjs.toneCurve; exports.toneLuts = _chunkYAFS2QFZcjs.toneLuts; exports.toneOf = _chunkNVTHUPJ6cjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkYAFS2QFZcjs.transformHomography; exports.transformMap = _chunkYAFS2QFZcjs.transformMap; exports.transformShapeComponents = _chunkYAFS2QFZcjs.transformShapeComponents; exports.transformSurface = _chunk24ATT2PEcjs.transformSurface; exports.transformTypeLayer = _chunkYAFS2QFZcjs.transformTypeLayer; exports.transformedBounds = _chunk24ATT2PEcjs.transformedBounds; exports.transformedBox = _chunkYAFS2QFZcjs.transformedBox; exports.transformedPoint = _chunkYAFS2QFZcjs.transformedPoint; exports.translateSurface = _chunkJ5BA3BQ6cjs.translateSurface; exports.typeAsPixelLayer = _chunkYAFS2QFZcjs.typeAsPixelLayer; exports.typeFrame = _chunkYAFS2QFZcjs.typeFrame; exports.typeFromAnnotation = _chunkYAFS2QFZcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkYAFS2QFZcjs.typeLayerName; exports.ungroupLayer = _chunkYAFS2QFZcjs.ungroupLayer; exports.uniformTile = _chunkJ5BA3BQ6cjs.uniformTile; exports.unionRect = _chunkYAFS2QFZcjs.unionRect; exports.unprojectCanvasPoint = _chunkYAFS2QFZcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkYAFS2QFZcjs.updateLayerEffect; exports.updateLayerFilter = _chunkYAFS2QFZcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkYAFS2QFZcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunk6GFRKLLScjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkYAFS2QFZcjs.updateShapeLayer; exports.updateSmartFilter = _chunkYAFS2QFZcjs.updateSmartFilter; exports.updateTypeLayer = _chunkYAFS2QFZcjs.updateTypeLayer; exports.uvToXy = _chunkYAFS2QFZcjs.uvToXy; exports.validateEffectGradient = _chunk24ATT2PEcjs.validateEffectGradient; exports.validateLayerEffect = _chunk24ATT2PEcjs.validateLayerEffect; exports.validateLayerEffects = _chunk24ATT2PEcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkYAFS2QFZcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkYAFS2QFZcjs.vibranceLinear; exports.vibrancePixel = _chunkYAFS2QFZcjs.vibrancePixel; exports.walkDabs = _chunk6GFRKLLScjs.walkDabs; exports.warpMeshEditPoints = _chunkZ2H7KECKcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkZ2H7KECKcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkZ2H7KECKcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkZ2H7KECKcjs.warpPresetMesh; exports.warpSurface = _chunk24ATT2PEcjs.warpSurface; exports.wbMatrix = _chunkYAFS2QFZcjs.wbMatrix; exports.wetGpuSupport = _chunkFHPVDTI2cjs.wetGpuSupport; exports.wetSimdSupported = _chunkFHPVDTI2cjs.wetSimdSupported; exports.wetSupport = _chunkFHPVDTI2cjs.wetSupport; exports.whiteBalanceFromSample = _chunkYAFS2QFZcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkYAFS2QFZcjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkYAFS2QFZcjs.withFilterMaskSurface; exports.withNewIds = _chunkYAFS2QFZcjs.withNewIds; exports.writeAdjustmentBlock = _chunkYAFS2QFZcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkJ5BA3BQ6cjs.writeDeepRegion; exports.writeLfx2 = _chunkYAFS2QFZcjs.writeLfx2; exports.writePatternBlock = _chunkYAFS2QFZcjs.writePatternBlock; exports.writePsd = _chunkYAFS2QFZcjs.writePsd; exports.writeRegion = _chunkJ5BA3BQ6cjs.writeRegion; exports.xyToTempTint = _chunkYAFS2QFZcjs.xyToTempTint; exports.xyToUv = _chunkYAFS2QFZcjs.xyToUv;
16005
+
16006
+
16007
+
16008
+
16009
+
16010
+
16011
+
16012
+ exports.ADJUSTMENT_KEYS = _chunkJLGNZMUVcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkJLGNZMUVcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkJLGNZMUVcjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkJLGNZMUVcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkJLGNZMUVcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkJLGNZMUVcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkJ5BA3BQ6cjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkJ5BA3BQ6cjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkJLGNZMUVcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkFHPVDTI2cjs.BODY_SCATTER; exports.BRUSHSTROKE_MAX_SCALE = _chunkSYPFUL5Bcjs.BRUSHSTROKE_MAX_SCALE; exports.BRUSHSTROKE_MIN_SCALE = _chunkSYPFUL5Bcjs.BRUSHSTROKE_MIN_SCALE; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkG5NMLUVFcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunkZ6OUCS2Kcjs.BrushstrokeCache; exports.CLONE_TRANSFORM_CONTROLS = CLONE_TRANSFORM_CONTROLS; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.CoverageMap = _chunk6GFRKLLScjs.CoverageMap; exports.D50 = _chunkJLGNZMUVcjs.D50; exports.D65 = _chunkJLGNZMUVcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunk2R3UW57Ucjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunk6GFRKLLScjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunk6GFRKLLScjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkFHPVDTI2cjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunk24ATT2PEcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkJLGNZMUVcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunk6GFRKLLScjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunk6GFRKLLScjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunk6GFRKLLScjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunkYT3JL7YMcjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunk6GFRKLLScjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunk2R3UW57Ucjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkFHPVDTI2cjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkFHPVDTI2cjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkJLGNZMUVcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunk24ATT2PEcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkFHPVDTI2cjs.DRY_EPS; exports.DabWalker = _chunk6GFRKLLScjs.DabWalker; exports.EMPTY_DISTANCE = _chunkJLGNZMUVcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunk6GFRKLLScjs.EMPTY_MIXER_LOAD; exports.EX = _chunkFHPVDTI2cjs.EX; exports.EY = _chunkFHPVDTI2cjs.EY; exports.FLAG_ALIVE = _chunkFHPVDTI2cjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkFHPVDTI2cjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkFHPVDTI2cjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkFHPVDTI2cjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkFHPVDTI2cjs.FLAG_TOP; exports.FLAG_WET = _chunkFHPVDTI2cjs.FLAG_WET; exports.FLAT = _chunkFHPVDTI2cjs.FLAT; exports.FREE_INTERVAL = _chunkFHPVDTI2cjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkJLGNZMUVcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HIDE = _chunkFHPVDTI2cjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkJLGNZMUVcjs.HUE_RANGE_LABELS; exports.IDENTITY_CLONE_TRANSFORM = _chunkYT3JL7YMcjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunkJLGNZMUVcjs.IDENTITY_MATRIX3; exports.IMAGE_ADJUSTMENT_CONTROLS = IMAGE_ADJUSTMENT_CONTROLS; exports.IMAGE_CROP_PRESETS = IMAGE_CROP_PRESETS; exports.IMAGE_EDITOR_SCHEMA_VERSION = IMAGE_EDITOR_SCHEMA_VERSION; exports.IMAGE_EDITOR_STATE_VERSION = IMAGE_EDITOR_STATE_VERSION; exports.IMAGE_EFFECT_PLACES = IMAGE_EFFECT_PLACES; exports.IMAGE_FILTER_PRESETS = IMAGE_FILTER_PRESETS; exports.INTENTS = _chunkG5NMLUVFcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunk24ATT2PEcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkJLGNZMUVcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkJLGNZMUVcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunk24ATT2PEcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkJLGNZMUVcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkJLGNZMUVcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkJLGNZMUVcjs.LUMA_709; exports.LayerCompositor = _chunkJLGNZMUVcjs.LayerCompositor; exports.LayerEffectError = _chunk24ATT2PEcjs.LayerEffectError; exports.LayerOperationError = _chunkJLGNZMUVcjs.LayerOperationError; exports.MAX_BATCH = _chunkFHPVDTI2cjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunk6GFRKLLScjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunk24ATT2PEcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkJLGNZMUVcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkFHPVDTI2cjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunk24ATT2PEcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkFHPVDTI2cjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkFHPVDTI2cjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkJLGNZMUVcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkJLGNZMUVcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunk6GFRKLLScjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunk6GFRKLLScjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunk6GFRKLLScjs.MIXING_MODELS; exports.MixerStroke = _chunk6GFRKLLScjs.MixerStroke; exports.OPP = _chunkFHPVDTI2cjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkJ5BA3BQ6cjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunk6GFRKLLScjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunk6GFRKLLScjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunk6GFRKLLScjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunk6GFRKLLScjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunk6GFRKLLScjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunk6GFRKLLScjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunk6GFRKLLScjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunk6GFRKLLScjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunk6GFRKLLScjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunk6GFRKLLScjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunk6GFRKLLScjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunk6GFRKLLScjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkFHPVDTI2cjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkJLGNZMUVcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkFHPVDTI2cjs.PARAM; exports.PARAM_FLOATS = _chunkFHPVDTI2cjs.PARAM_FLOATS; exports.PATTERN_BLOCK_KEYS = _chunkJLGNZMUVcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkJ5BA3BQ6cjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkFHPVDTI2cjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkJ5BA3BQ6cjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkJ5BA3BQ6cjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkFHPVDTI2cjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkJ5BA3BQ6cjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkFHPVDTI2cjs.PLANE; exports.PLANE_BYTES = _chunkFHPVDTI2cjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkJLGNZMUVcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkFHPVDTI2cjs.P_D0; exports.P_EDGE = _chunkFHPVDTI2cjs.P_EDGE; exports.P_FX = _chunkFHPVDTI2cjs.P_FX; exports.P_FY = _chunkFHPVDTI2cjs.P_FY; exports.P_H = _chunkFHPVDTI2cjs.P_H; exports.P_P0 = _chunkFHPVDTI2cjs.P_P0; exports.P_RHO = _chunkFHPVDTI2cjs.P_RHO; exports.P_SW = _chunkFHPVDTI2cjs.P_SW; exports.P_UX = _chunkFHPVDTI2cjs.P_UX; exports.P_UY = _chunkFHPVDTI2cjs.P_UY; exports.PaintExchange = _chunk6GFRKLLScjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunk6GFRKLLScjs.PaintGradientSampler; exports.PaintSourceError = _chunk6GFRKLLScjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PatternPlacement = _chunk24ATT2PEcjs.PatternPlacement; exports.PatternTile = _chunk24ATT2PEcjs.PatternTile; exports.PsdError = _chunkJLGNZMUVcjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunkYT3JL7YMcjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunkYT3JL7YMcjs.RegionPixelSource; exports.RetouchDabStroke = _chunkYT3JL7YMcjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkJLGNZMUVcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkJLGNZMUVcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkFHPVDTI2cjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkJ5BA3BQ6cjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkJLGNZMUVcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkJLGNZMUVcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkFHPVDTI2cjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkFHPVDTI2cjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkFHPVDTI2cjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkJLGNZMUVcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunkYT3JL7YMcjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkFHPVDTI2cjs.SRGB_TO_LINEAR; exports.STRIP = _chunkFHPVDTI2cjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkJLGNZMUVcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunk6GFRKLLScjs.SmudgeTip; exports.StrokeCoverage = _chunk6GFRKLLScjs.StrokeCoverage; exports.SurfaceDraft = _chunkJ5BA3BQ6cjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkJLGNZMUVcjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunkJLGNZMUVcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkJLGNZMUVcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkJ5BA3BQ6cjs.TILE; exports.TILE_SHIFT = _chunkJ5BA3BQ6cjs.TILE_SHIFT; exports.TINT_SCALE = _chunkJLGNZMUVcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunk6GFRKLLScjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkJLGNZMUVcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunkYT3JL7YMcjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkJLGNZMUVcjs.TRANSFORM_ANCHORS; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunk6GFRKLLScjs.TileMedium; exports.TilePixelSource = _chunkYT3JL7YMcjs.TilePixelSource; exports.TiledSurface = _chunkJ5BA3BQ6cjs.TiledSurface; exports.TransformTooLargeError = _chunk24ATT2PEcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunkYT3JL7YMcjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkFHPVDTI2cjs.U_MAX; exports.VIBRANCE_GREY = _chunkJLGNZMUVcjs.VIBRANCE_GREY; exports.W9 = _chunkFHPVDTI2cjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunk2R3UW57Ucjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunk2R3UW57Ucjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkFHPVDTI2cjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkFHPVDTI2cjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkFHPVDTI2cjs.WET_TILE; exports.WGSL_HALO = _chunkFHPVDTI2cjs.WGSL_HALO; exports.WGSL_SHADE = _chunkFHPVDTI2cjs.WGSL_SHADE; exports.WGSL_STEP = _chunkFHPVDTI2cjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WetGpuEngine = _chunkFHPVDTI2cjs.WetGpuEngine; exports.WetMedium = _chunkFHPVDTI2cjs.WetMedium; exports.WetWorkerPool = _chunkFHPVDTI2cjs.WetWorkerPool; exports.WetWorld = _chunkFHPVDTI2cjs.WetWorld; exports.WetWorldError = _chunkFHPVDTI2cjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkJLGNZMUVcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunk643B2HKCcjs.ZlibError; exports.activeAdjustmentLayers = _chunkJLGNZMUVcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkJLGNZMUVcjs.activeEffectSmartFilters; exports.activeSmartFilters = _chunkJLGNZMUVcjs.activeSmartFilters; exports.addLayerEffect = _chunkJLGNZMUVcjs.addLayerEffect; exports.addLayerFilter = _chunkJLGNZMUVcjs.addLayerFilter; exports.addPaintGradientStop = _chunk6GFRKLLScjs.addPaintGradientStop; exports.addSmartFilter = _chunkJLGNZMUVcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkJLGNZMUVcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkJLGNZMUVcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkJLGNZMUVcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkJLGNZMUVcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunk643B2HKCcjs.adler32; exports.anchorPoint = _chunkJLGNZMUVcjs.anchorPoint; exports.annotationBlend = _chunkJLGNZMUVcjs.annotationBlend; exports.annotationLayerFor = _chunkJLGNZMUVcjs.annotationLayerFor; exports.annotationLayerName = _chunkJLGNZMUVcjs.annotationLayerName; exports.annotationOfLayer = _chunkJLGNZMUVcjs.annotationOfLayer; exports.annotationOfShape = _chunkJLGNZMUVcjs.annotationOfShape; exports.annotationOfType = _chunkJLGNZMUVcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkJLGNZMUVcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkJLGNZMUVcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkJLGNZMUVcjs.applyAdjustments; exports.applyBoxBlur = _chunkJLGNZMUVcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkJLGNZMUVcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkJLGNZMUVcjs.applyDepthMask; exports.applyHomography = _chunkMUUXNRU4cjs.applyHomography; exports.applyImageProjectionToContext = _chunkJLGNZMUVcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkJLGNZMUVcjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkJLGNZMUVcjs.applyLegacyFloat; exports.applyMatrix3 = _chunkJLGNZMUVcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkJLGNZMUVcjs.applyParams; exports.applyProcess2Adjustments = _chunkJLGNZMUVcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkJLGNZMUVcjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunkYT3JL7YMcjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkJLGNZMUVcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunk6GFRKLLScjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunk6GFRKLLScjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunkYT3JL7YMcjs.applyToneToDeepTile; exports.backgroundLayer = _chunkJLGNZMUVcjs.backgroundLayer; exports.base64ToBytes = _chunkDCLJNVZScjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunkYT3JL7YMcjs.bestOffset; exports.blackWhiteGray = _chunkJLGNZMUVcjs.blackWhiteGray; exports.blendChannel = _chunkJ5BA3BQ6cjs.blendChannel; exports.blendImageData = _chunkJ5BA3BQ6cjs.blendImageData; exports.blendLum = _chunkJ5BA3BQ6cjs.blendLum; exports.blendPixel = _chunkJ5BA3BQ6cjs.blendPixel; exports.blendRadius = _chunk6GFRKLLScjs.blendRadius; exports.blendRgb = _chunkJ5BA3BQ6cjs.blendRgb; exports.blendTile = _chunk24ATT2PEcjs.blendTile; exports.blenderDab = _chunk6GFRKLLScjs.blenderDab; exports.blurFilter = _chunkJLGNZMUVcjs.blurFilter; exports.borderCoverage = _chunkJLGNZMUVcjs.borderCoverage; exports.boxBlurPixels = _chunkYT3JL7YMcjs.boxBlurPixels; exports.boxMean = boxMean; exports.boxPointOf = _chunkJLGNZMUVcjs.boxPointOf; exports.boxQuad = _chunkMUUXNRU4cjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkJLGNZMUVcjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunkZ6OUCS2Kcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkZ6OUCS2Kcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkZ6OUCS2Kcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkSYPFUL5Bcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkZ6OUCS2Kcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkZ6OUCS2Kcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkJLGNZMUVcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkJLGNZMUVcjs.buildToneLut; exports.builtinPattern = _chunk24ATT2PEcjs.builtinPattern; exports.builtinPatternIds = _chunk24ATT2PEcjs.builtinPatternIds; exports.bytesToBase64 = _chunkDCLJNVZScjs.bytesToBase64; exports.calculateCropDrag = _chunkJLGNZMUVcjs.calculateCropDrag; exports.canShareMemory = _chunkFHPVDTI2cjs.canShareMemory; exports.canvasCompositeOperation = _chunkJ5BA3BQ6cjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkJLGNZMUVcjs.canvasToImagePoint; exports.caretAt = _chunk2R3UW57Ucjs.caretAt; exports.changedTiles = _chunk24ATT2PEcjs.changedTiles; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkJLGNZMUVcjs.clampCropToImage; exports.cleanMixer = _chunk6GFRKLLScjs.cleanMixer; exports.cloneSamplePoint = _chunkYT3JL7YMcjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunkJ5BA3BQ6cjs.collectTiles; exports.colorBalanceChannel = _chunkJLGNZMUVcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.combineSelections = _chunkJLGNZMUVcjs.combineSelections; exports.compileAdjustmentLayer = _chunkJLGNZMUVcjs.compileAdjustmentLayer; exports.componentPath = _chunkJLGNZMUVcjs.componentPath; exports.compositeDeep = _chunkJLGNZMUVcjs.compositeDeep; exports.compositeSurfaceOver = _chunk24ATT2PEcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkJLGNZMUVcjs.computeSelectionBounds; exports.contentAwareFill = _chunkYT3JL7YMcjs.contentAwareFill; exports.contentBounds = _chunkJ5BA3BQ6cjs.contentBounds; exports.contentsBox = _chunkJLGNZMUVcjs.contentsBox; exports.contentsSurface = _chunkJLGNZMUVcjs.contentsSurface; exports.contractCoverage = _chunkJLGNZMUVcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkJ5BA3BQ6cjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkJLGNZMUVcjs.convertToSmartObject; exports.copySmartObject = _chunkJLGNZMUVcjs.copySmartObject; exports.cornersFromMatrix = _chunkJLGNZMUVcjs.cornersFromMatrix; exports.coverageTileCoord = _chunk6GFRKLLScjs.coverageTileCoord; exports.coverageToByte = _chunkJLGNZMUVcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkJLGNZMUVcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunk6GFRKLLScjs.createBlenderScratch; exports.createCanvasTextShaper = _chunk2R3UW57Ucjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageEffectsToolProvider = createImageEffectsToolProvider; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePsdTools = createImagePsdTools; exports.createImageRetouchTools = createImageRetouchTools; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunk2R3UW57Ucjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunk2R3UW57Ucjs.createOutlineTextShaper; exports.createPigment = _chunkJ5BA3BQ6cjs.createPigment; exports.createPigmentTools = _chunkFHPVDTI2cjs.createPigmentTools; exports.createSelectionMask = _chunkJLGNZMUVcjs.createSelectionMask; exports.createShapeLayer = _chunkJLGNZMUVcjs.createShapeLayer; exports.createTypeLayer = _chunkJLGNZMUVcjs.createTypeLayer; exports.createWetGpuEngine = _chunkFHPVDTI2cjs.createWetGpuEngine; exports.cssFont = _chunk2R3UW57Ucjs.cssFont; exports.cssFontFamily = _chunk2R3UW57Ucjs.cssFontFamily; exports.curveLut = _chunk24ATT2PEcjs.curveLut; exports.curveLutFromLevels = _chunkJLGNZMUVcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunk6GFRKLLScjs.dabCoverage; exports.dabRect = _chunk6GFRKLLScjs.dabRect; exports.decodeDeepSurface = _chunkJLGNZMUVcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkJLGNZMUVcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkJLGNZMUVcjs.decodeLayerMask; exports.decodeMergedImage = _chunkJLGNZMUVcjs.decodeMergedImage; exports.decodePlanes = _chunkJLGNZMUVcjs.decodePlanes; exports.decodePng = _chunkDCLJNVZScjs.decodePng; exports.decodePngDataUrl = _chunkJLGNZMUVcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkJLGNZMUVcjs.decodeSelectionRle; exports.deepBytes = _chunkJ5BA3BQ6cjs.deepBytes; exports.deepTile = _chunkJ5BA3BQ6cjs.deepTile; exports.defaultAdjustmentParams = _chunkJLGNZMUVcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunk24ATT2PEcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunk24ATT2PEcjs.defaultLayerEffect; exports.defaultShapeName = _chunkJLGNZMUVcjs.defaultShapeName; exports.deflate = _chunk643B2HKCcjs.deflate; exports.deflateRaw = _chunk643B2HKCcjs.deflateRaw; exports.depthMaskAlpha = _chunkJLGNZMUVcjs.depthMaskAlpha; exports.depthOf = _chunkJ5BA3BQ6cjs.depthOf; exports.depthRasterMask = _chunkJLGNZMUVcjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkJLGNZMUVcjs.describeTransform; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkJLGNZMUVcjs.deserializeEffects; exports.deserializeLayer = _chunkJLGNZMUVcjs.deserializeLayer; exports.deserializeLayers = _chunkJLGNZMUVcjs.deserializeLayers; exports.deserializePatterns = _chunkJLGNZMUVcjs.deserializePatterns; exports.deserializeSelection = _chunkJLGNZMUVcjs.deserializeSelection; exports.developFilter = _chunkJLGNZMUVcjs.developFilter; exports.developFromAdjustments = _chunkJLGNZMUVcjs.developFromAdjustments; exports.developTarget = _chunkJLGNZMUVcjs.developTarget; exports.dexp = _chunkFHPVDTI2cjs.dexp; exports.dilateMask = _chunkYT3JL7YMcjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkJLGNZMUVcjs.distanceTransform; exports.dlog = _chunkFHPVDTI2cjs.dlog; exports.documentContents = _chunkJLGNZMUVcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunkYT3JL7YMcjs.dodgeBurn; exports.dodgeBurnCurve = _chunkYT3JL7YMcjs.dodgeBurnCurve; exports.downloadPsd = downloadPsd; exports.dpow = _chunkFHPVDTI2cjs.dpow; exports.dragWarpMeshPoint = _chunk2R3UW57Ucjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkFHPVDTI2cjs.dsincos; exports.duplicateLayer = _chunkJLGNZMUVcjs.duplicateLayer; exports.edgeBits = _chunkFHPVDTI2cjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunk24ATT2PEcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunk24ATT2PEcjs.effectReach; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunk24ATT2PEcjs.effectsFingerprint; exports.effectsMargin = _chunk24ATT2PEcjs.effectsMargin; exports.effectsScale = _chunk24ATT2PEcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkJ5BA3BQ6cjs.emptySurface; exports.encodeDeepSurface = _chunkJLGNZMUVcjs.encodeDeepSurface; exports.encodePng = _chunkDCLJNVZScjs.encodePng; exports.encodeRle = _chunkJLGNZMUVcjs.encodeRle; exports.encodeSelectionRle = _chunkJLGNZMUVcjs.encodeSelectionRle; exports.encodeSurface = _chunkJLGNZMUVcjs.encodeSurface; exports.evalWarpMesh = _chunk2R3UW57Ucjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkJLGNZMUVcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunk6GFRKLLScjs.exchangeRates; exports.expNeg = _chunkFHPVDTI2cjs.expNeg; exports.expandCoverage = _chunkJLGNZMUVcjs.expandCoverage; exports.exportPsd = _chunkJLGNZMUVcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkJLGNZMUVcjs.featherCoverage; exports.fillRect = _chunkJ5BA3BQ6cjs.fillRect; exports.filmPixel = _chunkFHPVDTI2cjs.filmPixel; exports.filmReflectance = _chunkFHPVDTI2cjs.filmReflectance; exports.filterMaskCoverage = _chunkJLGNZMUVcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunk24ATT2PEcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findWebGpu = _chunkFHPVDTI2cjs.findWebGpu; exports.finishTile = _chunkJ5BA3BQ6cjs.finishTile; exports.fitParagraphRuns = _chunk2R3UW57Ucjs.fitParagraphRuns; exports.fitRuns = _chunk2R3UW57Ucjs.fitRuns; exports.flattenLayers = _chunk24ATT2PEcjs.flattenLayers; exports.flattenPath = _chunkJLGNZMUVcjs.flattenPath; exports.flipCorners = _chunkJLGNZMUVcjs.flipCorners; exports.flowField = _chunkFHPVDTI2cjs.flowField; exports.fontOf = _chunk2R3UW57Ucjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkJLGNZMUVcjs.fullSelection; exports.gaussianBlur = _chunk24ATT2PEcjs.gaussianBlur; exports.geometryHomography = _chunkJLGNZMUVcjs.geometryHomography; exports.getAnnotationBounds = _chunkJLGNZMUVcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkJLGNZMUVcjs.getCropCursor; exports.getRotatedSize = _chunkJLGNZMUVcjs.getRotatedSize; exports.getViewportMetrics = _chunkJLGNZMUVcjs.getViewportMetrics; exports.getViewportProjection = _chunkJLGNZMUVcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.gradientDabColor = _chunk6GFRKLLScjs.gradientDabColor; exports.greyMorphology = _chunkJLGNZMUVcjs.greyMorphology; exports.groupLayers = _chunkJLGNZMUVcjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunk24ATT2PEcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunkJLGNZMUVcjs.hasResampledLegacyMask; exports.hasSurface = _chunkJLGNZMUVcjs.hasSurface; exports.hasWarp = _chunkJLGNZMUVcjs.hasWarp; exports.hash2 = _chunk6GFRKLLScjs.hash2; exports.hashMaskContent = _chunkJLGNZMUVcjs.hashMaskContent; exports.hashNoise = _chunk24ATT2PEcjs.hashNoise; exports.healPixels = _chunkYT3JL7YMcjs.healPixels; exports.hexToPaintRgb = _chunk6GFRKLLScjs.hexToPaintRgb; exports.hexToRgb = _chunkJLGNZMUVcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkJLGNZMUVcjs.hitTestAnnotation; exports.hitTestCrop = _chunkJLGNZMUVcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkMUUXNRU4cjs.homographyFromAffine; exports.homographyFromPoints = _chunkMUUXNRU4cjs.homographyFromPoints; exports.hslToRgb = _chunkJLGNZMUVcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkJLGNZMUVcjs.hueRangeTables; exports.hueRangeWeight = _chunkJLGNZMUVcjs.hueRangeWeight; exports.hueSaturation = _chunkJLGNZMUVcjs.hueSaturation; exports.identityCurve = _chunkJLGNZMUVcjs.identityCurve; exports.identityLevels = _chunkJLGNZMUVcjs.identityLevels; exports.identityTransform = _chunkJLGNZMUVcjs.identityTransform; exports.identityWarpMesh = _chunk2R3UW57Ucjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imageToCanvasPoint = _chunkJLGNZMUVcjs.imageToCanvasPoint; exports.importPsd = _chunkJLGNZMUVcjs.importPsd; exports.inflate = _chunk643B2HKCcjs.inflate; exports.inflateRaw = _chunk643B2HKCcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunk24ATT2PEcjs.insertLayer; exports.instancesOf = _chunkJLGNZMUVcjs.instancesOf; exports.invertHomography = _chunkMUUXNRU4cjs.invertHomography; exports.invertMatrix3 = _chunkJLGNZMUVcjs.invertMatrix3; exports.invertSelection = _chunkJLGNZMUVcjs.invertSelection; exports.isActiveFilter = _chunkJLGNZMUVcjs.isActiveFilter; exports.isAdjustmentKind = _chunkJLGNZMUVcjs.isAdjustmentKind; exports.isBitDepth = _chunkJ5BA3BQ6cjs.isBitDepth; exports.isBlendMode = _chunkJ5BA3BQ6cjs.isBlendMode; exports.isBrushstrokeBrush = _chunkZ6OUCS2Kcjs.isBrushstrokeBrush; exports.isContentsDecoded = _chunkJLGNZMUVcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkJLGNZMUVcjs.isDefaultDepthMask; exports.isGradientPaint = _chunk6GFRKLLScjs.isGradientPaint; exports.isIdentityCloneTransform = _chunkYT3JL7YMcjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunkJLGNZMUVcjs.isIdentityTransform; exports.isInterpolation = _chunk24ATT2PEcjs.isInterpolation; exports.isLayerEffectKind = _chunk24ATT2PEcjs.isLayerEffectKind; exports.isLayerLocked = _chunk24ATT2PEcjs.isLayerLocked; exports.isLegacyShape = _chunkJLGNZMUVcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPainterlyBlendMode = _chunkJ5BA3BQ6cjs.isPainterlyBlendMode; exports.isPng = _chunkDCLJNVZScjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkJLGNZMUVcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkJLGNZMUVcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkJLGNZMUVcjs.isSelectionEmpty; exports.isSelectionMode = _chunkJLGNZMUVcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkJ5BA3BQ6cjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkJLGNZMUVcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkJLGNZMUVcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkJLGNZMUVcjs.isTransformAnchor; exports.isValidWarp = _chunkJLGNZMUVcjs.isValidWarp; exports.keepDeepSamples = _chunkJ5BA3BQ6cjs.keepDeepSamples; exports.kelvinToTemperature = _chunkJLGNZMUVcjs.kelvinToTemperature; exports.keysWeight = _chunk24ATT2PEcjs.keysWeight; exports.latticeViscosity = _chunkFHPVDTI2cjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunk24ATT2PEcjs.layerEffectFields; exports.layerEffectLabel = _chunk24ATT2PEcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkJLGNZMUVcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkJLGNZMUVcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkJLGNZMUVcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkJLGNZMUVcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkJLGNZMUVcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkJLGNZMUVcjs.layerTree; exports.layerTypeLabel = _chunkJLGNZMUVcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkJLGNZMUVcjs.layersFromLegacy; exports.layoutText = _chunk2R3UW57Ucjs.layoutText; exports.legacyAdjustmentLayer = _chunkJLGNZMUVcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkJLGNZMUVcjs.legacyMaskOf; exports.legacyView = _chunkJLGNZMUVcjs.legacyView; exports.lerpPigment = _chunkJ5BA3BQ6cjs.lerpPigment; exports.lerpPigmentInto = _chunkJ5BA3BQ6cjs.lerpPigmentInto; exports.levelsValue = _chunkJLGNZMUVcjs.levelsValue; exports.linearSrgbToXy = _chunkJLGNZMUVcjs.linearSrgbToXy; exports.linearToSrgb = _chunkJLGNZMUVcjs.linearToSrgb; exports.linearToSrgb8 = _chunkFHPVDTI2cjs.linearToSrgb8; exports.liveComponent = _chunkJLGNZMUVcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkJLGNZMUVcjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunk6GFRKLLScjs.loadMixer; exports.loadOpenTypeFont = _chunk2OJACTPRcjs.loadOpenTypeFont; exports.loadWetKernel = _chunkFHPVDTI2cjs.loadWetKernel; exports.luma = _chunkYT3JL7YMcjs.luma; exports.magicWand = magicWand; exports.mapCropHandle = _chunkJLGNZMUVcjs.mapCropHandle; exports.mapLayer = _chunk24ATT2PEcjs.mapLayer; exports.mapSubpaths = _chunkJLGNZMUVcjs.mapSubpaths; exports.maskBounds = _chunkYT3JL7YMcjs.maskBounds; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkJLGNZMUVcjs.matrixFromCorners; exports.matrixFromParams = _chunkJLGNZMUVcjs.matrixFromParams; exports.membraneFill = _chunkYT3JL7YMcjs.membraneFill; exports.mergeLayerEffect = _chunk24ATT2PEcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkJLGNZMUVcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunk6GFRKLLScjs.mix32; exports.mixPigment8 = _chunkJ5BA3BQ6cjs.mixPigment8; exports.mixPigmentRgb = _chunkJ5BA3BQ6cjs.mixPigmentRgb; exports.mixPigments = _chunkJ5BA3BQ6cjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunk6GFRKLLScjs.mixerRates; exports.modifySelection = _chunkJLGNZMUVcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkJLGNZMUVcjs.moveLayer; exports.moveSmartFilter = _chunkJLGNZMUVcjs.moveSmartFilter; exports.mulMatrix3 = _chunkJLGNZMUVcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkJLGNZMUVcjs.neutralHueRange; exports.newContentsId = _chunkJLGNZMUVcjs.newContentsId; exports.newEffectId = _chunk24ATT2PEcjs.newEffectId; exports.newLayerId = _chunkJLGNZMUVcjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkJLGNZMUVcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkJLGNZMUVcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkJLGNZMUVcjs.normalizeAngle; exports.normalizeBlendMode = _chunkJ5BA3BQ6cjs.normalizeBlendMode; exports.normalizeBlender = _chunk6GFRKLLScjs.normalizeBlender; exports.normalizeBrush = _chunk6GFRKLLScjs.normalizeBrush; exports.normalizeFilter = _chunkJLGNZMUVcjs.normalizeFilter; exports.normalizeFlow = _chunkFHPVDTI2cjs.normalizeFlow; exports.normalizeHexColor = _chunk6GFRKLLScjs.normalizeHexColor; exports.normalizeLayerEffects = _chunk24ATT2PEcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkJLGNZMUVcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkJLGNZMUVcjs.normalizeLiveShape; exports.normalizeMixer = _chunk6GFRKLLScjs.normalizeMixer; exports.normalizePlacement = _chunkJLGNZMUVcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkJLGNZMUVcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunkYT3JL7YMcjs.normalizeRetouch; exports.normalizeShapePaint = _chunkJLGNZMUVcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkJLGNZMUVcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkJLGNZMUVcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunk6GFRKLLScjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkJLGNZMUVcjs.normalizeSubpaths; exports.normalizeText = _chunkJLGNZMUVcjs.normalizeText; exports.normalizeTilt = _chunkFHPVDTI2cjs.normalizeTilt; exports.normalizeWetParams = _chunkFHPVDTI2cjs.normalizeWetParams; exports.offsetLayer = _chunkJLGNZMUVcjs.offsetLayer; exports.offsetShape = _chunkJLGNZMUVcjs.offsetShape; exports.offsetSmartObject = _chunkJLGNZMUVcjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkJ5BA3BQ6cjs.packRgba; exports.packWetParams = _chunkFHPVDTI2cjs.packWetParams; exports.paintGradientMappingFor = _chunk6GFRKLLScjs.paintGradientMappingFor; exports.paintPathStroke = _chunkZ6OUCS2Kcjs.paintPathStroke; exports.paintSourceColor = _chunk6GFRKLLScjs.paintSourceColor; exports.paintSourceCss = _chunk6GFRKLLScjs.paintSourceCss; exports.paragraphRanges = _chunk2R3UW57Ucjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkJLGNZMUVcjs.parseAdjustmentBlock; exports.parseBlend = _chunkJLGNZMUVcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunk2YQONY6Gcjs.parseCssColor; exports.parseDataUrl = _chunkDCLJNVZScjs.parseDataUrl; exports.parseEffectColor = _chunk24ATT2PEcjs.parseEffectColor; exports.parseLfx2 = _chunkJLGNZMUVcjs.parseLfx2; exports.parseLrfx = _chunkJLGNZMUVcjs.parseLrfx; exports.parseOpenTypeFont = _chunk2OJACTPRcjs.parseOpenTypeFont; exports.parsePaintSource = _chunk6GFRKLLScjs.parsePaintSource; exports.parsePatternBlock = _chunkJLGNZMUVcjs.parsePatternBlock; exports.parseSelectionMode = _chunkJLGNZMUVcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkJLGNZMUVcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkJLGNZMUVcjs.patchParagraphStyle; exports.patchTextStyle = _chunkJLGNZMUVcjs.patchTextStyle; exports.pathStrokeCoverage = _chunkZ6OUCS2Kcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkZ6OUCS2Kcjs.pathStrokeDabs; exports.perDabStrength = _chunkYT3JL7YMcjs.perDabStrength; exports.photoFilterMatrix = _chunkJLGNZMUVcjs.photoFilterMatrix; exports.pigment8 = _chunkJ5BA3BQ6cjs.pigment8; exports.pigmentColor = _chunkFHPVDTI2cjs.pigmentColor; exports.pigmentOf = _chunkFHPVDTI2cjs.pigmentOf; exports.pixelLayerBounds = _chunkJLGNZMUVcjs.pixelLayerBounds; exports.pixelLayers = _chunkJLGNZMUVcjs.pixelLayers; exports.pixelPigment = _chunkFHPVDTI2cjs.pixelPigment; exports.placeContents = _chunkJLGNZMUVcjs.placeContents; exports.placeLayer = _chunkJLGNZMUVcjs.placeLayer; exports.placementAt = _chunkJLGNZMUVcjs.placementAt; exports.placementBounds = _chunkJLGNZMUVcjs.placementBounds; exports.placementGeometry = _chunkJLGNZMUVcjs.placementGeometry; exports.pngDataUrl = _chunkDCLJNVZScjs.pngDataUrl; exports.pointerPressure = _chunkFHPVDTI2cjs.pointerPressure; exports.pointerStrokeSample = _chunkFHPVDTI2cjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkFHPVDTI2cjs.pointerStrokeSamples; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkJLGNZMUVcjs.posterizeValue; exports.presetWarp = _chunkJLGNZMUVcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkJLGNZMUVcjs.projectImagePoint; exports.projectImageRect = _chunkJLGNZMUVcjs.projectImageRect; exports.projectMaskCoverage = _chunkJLGNZMUVcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkJ5BA3BQ6cjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkJLGNZMUVcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkJLGNZMUVcjs.psdToLayers; exports.pullWarpMesh = _chunk2R3UW57Ucjs.pullWarpMesh; exports.put255 = _chunk6GFRKLLScjs.put255; exports.quickMaskPixels = quickMaskPixels; exports.rand01 = _chunk6GFRKLLScjs.rand01; exports.rangeLightness = _chunkJLGNZMUVcjs.rangeLightness; exports.rasterContents = _chunkJLGNZMUVcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkJLGNZMUVcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkJLGNZMUVcjs.rasterizeCoverage; exports.rasterizeDab = _chunk6GFRKLLScjs.rasterizeDab; exports.rasterizeSmartObject = _chunkJLGNZMUVcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkJ5BA3BQ6cjs.readDeepRegion; exports.readPaintSource = _chunk6GFRKLLScjs.readPaintSource; exports.readPixel = _chunkJ5BA3BQ6cjs.readPixel; exports.readPsd = _chunkJLGNZMUVcjs.readPsd; exports.readRegion = _chunkJ5BA3BQ6cjs.readRegion; exports.readSourceRegion = _chunkYT3JL7YMcjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkMUUXNRU4cjs.rectToQuad; exports.reduceSurface = _chunk24ATT2PEcjs.reduceSurface; exports.referencePoint = _chunkJLGNZMUVcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkJ5BA3BQ6cjs.reflectanceToRgb; exports.removeAlpha = _chunkJLGNZMUVcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkJLGNZMUVcjs.removeLayer; exports.removeLayerEffect = _chunkJLGNZMUVcjs.removeLayerEffect; exports.removeLayerFilter = _chunkJLGNZMUVcjs.removeLayerFilter; exports.removePaintGradientStop = _chunk6GFRKLLScjs.removePaintGradientStop; exports.removeSmartFilter = _chunkJLGNZMUVcjs.removeSmartFilter; exports.renderBrushstroke = _chunkZ6OUCS2Kcjs.renderBrushstroke; exports.renderLayerEffects = _chunk24ATT2PEcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkJLGNZMUVcjs.renderShape; exports.renderShapeRect = _chunkJLGNZMUVcjs.renderShapeRect; exports.renderSmartObject = _chunkJLGNZMUVcjs.renderSmartObject; exports.renderText = _chunkJLGNZMUVcjs.renderText; exports.replaceContents = _chunkJLGNZMUVcjs.replaceContents; exports.replaceTextRange = _chunkJLGNZMUVcjs.replaceTextRange; exports.requireLayer = _chunkJLGNZMUVcjs.requireLayer; exports.requireOperation = _chunkJLGNZMUVcjs.requireOperation; exports.requireShapeLayer = _chunkJLGNZMUVcjs.requireShapeLayer; exports.requireSmartObject = _chunkJLGNZMUVcjs.requireSmartObject; exports.requireTypeLayer = _chunkJLGNZMUVcjs.requireTypeLayer; exports.requireUnlocked = _chunkJLGNZMUVcjs.requireUnlocked; exports.rerender = _chunkJLGNZMUVcjs.rerender; exports.rerenderShape = _chunkJLGNZMUVcjs.rerenderShape; exports.rerenderText = _chunkJLGNZMUVcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkJLGNZMUVcjs.resizeSelection; exports.resizeWarpMesh = _chunk2R3UW57Ucjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkJLGNZMUVcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunk6GFRKLLScjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunk2R3UW57Ucjs.restyleRange; exports.retouchFilter = _chunkYT3JL7YMcjs.retouchFilter; exports.reversePaintGradient = _chunk6GFRKLLScjs.reversePaintGradient; exports.rgbToGray = _chunkJLGNZMUVcjs.rgbToGray; exports.rgbToHsl = _chunkJLGNZMUVcjs.rgbToHsl; exports.rgbToReflectance = _chunkJ5BA3BQ6cjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunkYT3JL7YMcjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkJLGNZMUVcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkJLGNZMUVcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunkJLGNZMUVcjs.sampleLut; exports.sampleToneLut = _chunkJLGNZMUVcjs.sampleToneLut; exports.saturationOf = _chunkYT3JL7YMcjs.saturationOf; exports.scaleLayerEffect = _chunk24ATT2PEcjs.scaleLayerEffect; exports.scalePaintGradient = _chunk6GFRKLLScjs.scalePaintGradient; exports.seamlessClone = _chunkYT3JL7YMcjs.seamlessClone; exports.selectionArea = _chunkJLGNZMUVcjs.selectionArea; exports.selectionFromCoverage = _chunkJLGNZMUVcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkJLGNZMUVcjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkJLGNZMUVcjs.selectionToCoverage; exports.selectionToPixels = _chunkJLGNZMUVcjs.selectionToPixels; exports.selectionValueAt = _chunkJLGNZMUVcjs.selectionValueAt; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkJLGNZMUVcjs.serializeContents; exports.serializeEffects = _chunkJLGNZMUVcjs.serializeEffects; exports.serializeLayer = _chunkJLGNZMUVcjs.serializeLayer; exports.serializeLayers = _chunkJLGNZMUVcjs.serializeLayers; exports.serializeLayersExternal = _chunkJLGNZMUVcjs.serializeLayersExternal; exports.serializePatterns = _chunkJLGNZMUVcjs.serializePatterns; exports.serializeSelection = _chunkJLGNZMUVcjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkJLGNZMUVcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkJLGNZMUVcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkJLGNZMUVcjs.setLayerMask; exports.setLayerProperties = _chunkJLGNZMUVcjs.setLayerProperties; exports.setLum = _chunkJ5BA3BQ6cjs.setLum; exports.setPigmentColor = _chunkJ5BA3BQ6cjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkJLGNZMUVcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkJLGNZMUVcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkJLGNZMUVcjs.setSmartPlacement; exports.shadeTile = _chunkFHPVDTI2cjs.shadeTile; exports.shapeAsPixelLayer = _chunkJLGNZMUVcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkJLGNZMUVcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkJLGNZMUVcjs.shapeGeometryBounds; exports.shapeLayers = _chunkJLGNZMUVcjs.shapeLayers; exports.shapeOutline = _chunkJLGNZMUVcjs.shapeOutline; exports.shapeRenderClip = _chunkJLGNZMUVcjs.shapeRenderClip; exports.shiftCoverage = _chunkJLGNZMUVcjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkJLGNZMUVcjs.smartObjectLayers; exports.smoothCoverage = _chunkJLGNZMUVcjs.smoothCoverage; exports.smoothPoints = _chunk6GFRKLLScjs.smoothPoints; exports.smudgeEffect = _chunkYT3JL7YMcjs.smudgeEffect; exports.solidPaint = _chunk6GFRKLLScjs.solidPaint; exports.solidSurface = _chunkJ5BA3BQ6cjs.solidSurface; exports.solveMembrane = _chunkYT3JL7YMcjs.solveMembrane; exports.spliceRuns = _chunk2R3UW57Ucjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunkYT3JL7YMcjs.sponge; exports.spongeEffect = _chunkYT3JL7YMcjs.spongeEffect; exports.spotHealPixels = _chunkYT3JL7YMcjs.spotHealPixels; exports.spotHealWindow = _chunkYT3JL7YMcjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkFHPVDTI2cjs.srgbByteToLinear; exports.srgbDecode = _chunkJ5BA3BQ6cjs.srgbDecode; exports.srgbEncode = _chunkJ5BA3BQ6cjs.srgbEncode; exports.srgbToLinear = _chunkJLGNZMUVcjs.srgbToLinear; exports.standardBlendMode = _chunkJ5BA3BQ6cjs.standardBlendMode; exports.stepSlotTs = _chunkFHPVDTI2cjs.stepSlotTs; exports.styleAt = _chunk2R3UW57Ucjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkJ5BA3BQ6cjs.surfaceBytes; exports.surfaceDepth = _chunkJ5BA3BQ6cjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkJ5BA3BQ6cjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunkJ5BA3BQ6cjs.surfaceFromPixels; exports.surfacesEqual = _chunkJ5BA3BQ6cjs.surfacesEqual; exports.tempTintToXy = _chunkJLGNZMUVcjs.tempTintToXy; exports.temperatureToKelvin = _chunkJLGNZMUVcjs.temperatureToKelvin; exports.textIndexAt = _chunk2R3UW57Ucjs.textIndexAt; exports.textMatrix = _chunkJLGNZMUVcjs.textMatrix; exports.textOutlines = _chunkJLGNZMUVcjs.textOutlines; exports.textRange = _chunkJLGNZMUVcjs.textRange; exports.tileCoord = _chunkJ5BA3BQ6cjs.tileCoord; exports.tileKey = _chunkJ5BA3BQ6cjs.tileKey; exports.tileRect = _chunkJ5BA3BQ6cjs.tileRect; exports.tileSamples = _chunkJ5BA3BQ6cjs.tileSamples; exports.tileSamples16 = _chunkJ5BA3BQ6cjs.tileSamples16; exports.tileSamples32 = _chunkJ5BA3BQ6cjs.tileSamples32; exports.tilesInRect = _chunkJ5BA3BQ6cjs.tilesInRect; exports.tipFalloff = _chunk6GFRKLLScjs.tipFalloff; exports.tipReach = _chunk6GFRKLLScjs.tipReach; exports.tipShape = _chunk6GFRKLLScjs.tipShape; exports.to16From32 = _chunkJ5BA3BQ6cjs.to16From32; exports.to16From8 = _chunkJ5BA3BQ6cjs.to16From8; exports.to32From16 = _chunkJ5BA3BQ6cjs.to32From16; exports.to32From8 = _chunkJ5BA3BQ6cjs.to32From8; exports.to8From16 = _chunkJ5BA3BQ6cjs.to8From16; exports.to8From32 = _chunkJ5BA3BQ6cjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkJLGNZMUVcjs.toTextSpace; exports.toneCurve = _chunkJLGNZMUVcjs.toneCurve; exports.toneLuts = _chunkJLGNZMUVcjs.toneLuts; exports.toneOf = _chunkYT3JL7YMcjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkJLGNZMUVcjs.transformHomography; exports.transformMap = _chunkJLGNZMUVcjs.transformMap; exports.transformShapeComponents = _chunkJLGNZMUVcjs.transformShapeComponents; exports.transformSurface = _chunk24ATT2PEcjs.transformSurface; exports.transformTypeLayer = _chunkJLGNZMUVcjs.transformTypeLayer; exports.transformedBounds = _chunk24ATT2PEcjs.transformedBounds; exports.transformedBox = _chunkJLGNZMUVcjs.transformedBox; exports.transformedPoint = _chunkJLGNZMUVcjs.transformedPoint; exports.translateSurface = _chunkJ5BA3BQ6cjs.translateSurface; exports.typeAsPixelLayer = _chunkJLGNZMUVcjs.typeAsPixelLayer; exports.typeFrame = _chunkJLGNZMUVcjs.typeFrame; exports.typeFromAnnotation = _chunkJLGNZMUVcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkJLGNZMUVcjs.typeLayerName; exports.ungroupLayer = _chunkJLGNZMUVcjs.ungroupLayer; exports.uniformTile = _chunkJ5BA3BQ6cjs.uniformTile; exports.unionRect = _chunkJLGNZMUVcjs.unionRect; exports.unprojectCanvasPoint = _chunkJLGNZMUVcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkJLGNZMUVcjs.updateLayerEffect; exports.updateLayerFilter = _chunkJLGNZMUVcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkJLGNZMUVcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunk6GFRKLLScjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkJLGNZMUVcjs.updateShapeLayer; exports.updateSmartFilter = _chunkJLGNZMUVcjs.updateSmartFilter; exports.updateTypeLayer = _chunkJLGNZMUVcjs.updateTypeLayer; exports.uvToXy = _chunkJLGNZMUVcjs.uvToXy; exports.validateEffectGradient = _chunk24ATT2PEcjs.validateEffectGradient; exports.validateLayerEffect = _chunk24ATT2PEcjs.validateLayerEffect; exports.validateLayerEffects = _chunk24ATT2PEcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkJLGNZMUVcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkJLGNZMUVcjs.vibranceLinear; exports.vibrancePixel = _chunkJLGNZMUVcjs.vibrancePixel; exports.walkDabs = _chunk6GFRKLLScjs.walkDabs; exports.warpMeshEditPoints = _chunk2R3UW57Ucjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunk2R3UW57Ucjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunk2R3UW57Ucjs.warpMeshParamAt; exports.warpPresetMesh = _chunk2R3UW57Ucjs.warpPresetMesh; exports.warpSurface = _chunk24ATT2PEcjs.warpSurface; exports.wbMatrix = _chunkJLGNZMUVcjs.wbMatrix; exports.wetGpuSupport = _chunkFHPVDTI2cjs.wetGpuSupport; exports.wetSimdSupported = _chunkFHPVDTI2cjs.wetSimdSupported; exports.wetSupport = _chunkFHPVDTI2cjs.wetSupport; exports.whiteBalanceFromSample = _chunkJLGNZMUVcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkJLGNZMUVcjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkJLGNZMUVcjs.withFilterMaskSurface; exports.withNewIds = _chunkJLGNZMUVcjs.withNewIds; exports.writeAdjustmentBlock = _chunkJLGNZMUVcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkJ5BA3BQ6cjs.writeDeepRegion; exports.writeLfx2 = _chunkJLGNZMUVcjs.writeLfx2; exports.writePatternBlock = _chunkJLGNZMUVcjs.writePatternBlock; exports.writePsd = _chunkJLGNZMUVcjs.writePsd; exports.writeRegion = _chunkJ5BA3BQ6cjs.writeRegion; exports.xyToTempTint = _chunkJLGNZMUVcjs.xyToTempTint; exports.xyToUv = _chunkJLGNZMUVcjs.xyToUv;
15918
16013
  //# sourceMappingURL=index.cjs.map