@pixerate/editor 0.215.0 → 0.217.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.
@@ -1070,6 +1070,105 @@ function startMarchingAnts(tick, stepMs = MARCHING_ANTS_STEP_MS) {
1070
1070
  return () => clearInterval(id);
1071
1071
  }
1072
1072
 
1073
+ // src/image-editor/selection/diff.ts
1074
+ function compareSelectionMasks(a, b, width, height, options = {}) {
1075
+ const minArea = Math.max(1, _nullishCoalesce(options.minArea, () => ( 4)));
1076
+ const maxRegions = Math.max(1, _nullishCoalesce(options.maxRegions, () => ( 10)));
1077
+ const n = width * height;
1078
+ const ad = _optionalChain([a, 'optionalAccess', _2 => _2.data]);
1079
+ const bd = _optionalChain([b, 'optionalAccess', _3 => _3.data]);
1080
+ const added = new Uint8Array(n);
1081
+ const removed = new Uint8Array(n);
1082
+ let areaA = 0;
1083
+ let areaB = 0;
1084
+ let inter = 0;
1085
+ let change = 0;
1086
+ let addedArea = 0;
1087
+ let removedArea = 0;
1088
+ for (let i = 0; i < n; i++) {
1089
+ const va = ad ? ad[i] : 0;
1090
+ const vb = bd ? bd[i] : 0;
1091
+ if (va !== vb) change += Math.abs(vb - va);
1092
+ const ia = va >= 128;
1093
+ const ib = vb >= 128;
1094
+ if (ia) areaA++;
1095
+ if (ib) areaB++;
1096
+ if (ia && ib) inter++;
1097
+ else if (ib) {
1098
+ added[i] = 255;
1099
+ addedArea++;
1100
+ } else if (ia) {
1101
+ removed[i] = 255;
1102
+ removedArea++;
1103
+ }
1104
+ }
1105
+ const union = areaA + areaB - inter;
1106
+ const addedMask = _chunkSS53NNZOcjs.createSelectionMask.call(void 0, width, height, added);
1107
+ const removedMask = _chunkSS53NNZOcjs.createSelectionMask.call(void 0, width, height, removed);
1108
+ return {
1109
+ a: { area: areaA, bounds: _nullishCoalesce(_optionalChain([a, 'optionalAccess', _4 => _4.bounds]), () => ( null)) },
1110
+ b: { area: areaB, bounds: _nullishCoalesce(_optionalChain([b, 'optionalAccess', _5 => _5.bounds]), () => ( null)) },
1111
+ added: { area: addedArea, ...pieces(added, width, height, addedMask.bounds, minArea, maxRegions) },
1112
+ removed: { area: removedArea, ...pieces(removed, width, height, removedMask.bounds, minArea, maxRegions) },
1113
+ iou: union ? Math.round(inter / union * 1e4) / 1e4 : 1,
1114
+ coverageChange: Math.round(change / 255),
1115
+ identical: change === 0,
1116
+ addedMask,
1117
+ removedMask
1118
+ };
1119
+ }
1120
+ function pieces(bits, W, H, bounds, minArea, maxRegions) {
1121
+ if (!bounds) return { count: 0, regions: [] };
1122
+ const { x: x0, y: y0, width: w, height: h } = bounds;
1123
+ const seen = new Uint8Array(w * h);
1124
+ const stack = new Int32Array(w * h);
1125
+ const found = [];
1126
+ for (let start = 0; start < w * h; start++) {
1127
+ if (seen[start] || !bits[(y0 + Math.floor(start / w)) * W + x0 + start % w]) continue;
1128
+ let area = 0;
1129
+ let bx0 = w;
1130
+ let by0 = h;
1131
+ let bx1 = -1;
1132
+ let by1 = -1;
1133
+ let top = 0;
1134
+ stack[top++] = start;
1135
+ seen[start] = 1;
1136
+ while (top) {
1137
+ const k = stack[--top];
1138
+ const i = k % w;
1139
+ const j = (k - i) / w;
1140
+ area++;
1141
+ if (i < bx0) bx0 = i;
1142
+ if (i > bx1) bx1 = i;
1143
+ if (j < by0) by0 = j;
1144
+ if (j > by1) by1 = j;
1145
+ for (let dy = -1; dy <= 1; dy++) {
1146
+ for (let dx = -1; dx <= 1; dx++) {
1147
+ const ni = i + dx;
1148
+ const nj = j + dy;
1149
+ if (ni < 0 || nj < 0 || ni >= w || nj >= h) continue;
1150
+ const nk = nj * w + ni;
1151
+ if (seen[nk] || !bits[(y0 + nj) * W + x0 + ni]) continue;
1152
+ seen[nk] = 1;
1153
+ stack[top++] = nk;
1154
+ }
1155
+ }
1156
+ }
1157
+ if (area >= minArea) found.push({ area, bounds: { x: x0 + bx0, y: y0 + by0, width: bx1 - bx0 + 1, height: by1 - by0 + 1 } });
1158
+ }
1159
+ found.sort((p, q) => q.area - p.area);
1160
+ return { count: found.length, regions: found.slice(0, maxRegions) };
1161
+ }
1162
+ function selectionDiffPixels(added, removed) {
1163
+ const n = added.width * added.height;
1164
+ const out = new Uint8ClampedArray(n * 4);
1165
+ for (let i = 0; i < n; i++) {
1166
+ if (added.data[i]) out.set([34, 197, 94, 140], i * 4);
1167
+ else if (removed.data[i]) out.set([239, 68, 68, 140], i * 4);
1168
+ }
1169
+ return out;
1170
+ }
1171
+
1073
1172
  // src/image-editor/layers/render.ts
1074
1173
  function isQuarterTurn(rotate) {
1075
1174
  return _chunkS55JFWDAcjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
@@ -1132,7 +1231,7 @@ function needsLegacyBase(input) {
1132
1231
  if (!_chunkS55JFWDAcjs.isLegacyShape.call(void 0, stack)) return false;
1133
1232
  const bg = stack.layers[0];
1134
1233
  if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) return true;
1135
- if (_optionalChain([bg, 'access', _2 => _2.mask, 'optionalAccess', _3 => _3.source, 'optionalAccess', _4 => _4.enabled]) && bg.mask.source.maskSource) return true;
1234
+ if (_optionalChain([bg, 'access', _6 => _6.mask, 'optionalAccess', _7 => _7.source, 'optionalAccess', _8 => _8.enabled]) && bg.mask.source.maskSource) return true;
1136
1235
  if (stack.outputOpacity < 1) return true;
1137
1236
  const blur = _chunkS55JFWDAcjs.blurFilter.call(void 0, bg);
1138
1237
  if (blur && blur.enabled && blur.radius > 0) {
@@ -1301,7 +1400,7 @@ function drawOverlayHandles(ctx, points, u = 1) {
1301
1400
  ctx.strokeRect(h.x - size / 2, h.y - size / 2, size, size);
1302
1401
  }
1303
1402
  }
1304
- var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__init2.call(this);_class2.prototype.__init3.call(this);_class2.prototype.__init4.call(this);_class2.prototype.__init5.call(this);_class2.prototype.__init6.call(this);_class2.prototype.__init7.call(this);_class2.prototype.__init8.call(this);_class2.prototype.__init9.call(this);_class2.prototype.__init10.call(this);_class2.prototype.__init11.call(this);_class2.prototype.__init12.call(this);_class2.prototype.__init13.call(this);_class2.prototype.__init14.call(this);_class2.prototype.__init15.call(this);_class2.prototype.__init16.call(this);_class2.prototype.__init17.call(this);_class2.prototype.__init18.call(this);_class2.prototype.__init19.call(this);_class2.prototype.__init20.call(this);_class2.prototype.__init21.call(this);_class2.prototype.__init22.call(this);_class2.prototype.__init23.call(this);_class2.prototype.__init24.call(this);_class2.prototype.__init25.call(this);_class2.prototype.__init26.call(this); }
1403
+ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__init2.call(this);_class2.prototype.__init3.call(this);_class2.prototype.__init4.call(this);_class2.prototype.__init5.call(this);_class2.prototype.__init6.call(this);_class2.prototype.__init7.call(this);_class2.prototype.__init8.call(this);_class2.prototype.__init9.call(this);_class2.prototype.__init10.call(this);_class2.prototype.__init11.call(this);_class2.prototype.__init12.call(this);_class2.prototype.__init13.call(this);_class2.prototype.__init14.call(this);_class2.prototype.__init15.call(this);_class2.prototype.__init16.call(this);_class2.prototype.__init17.call(this);_class2.prototype.__init18.call(this);_class2.prototype.__init19.call(this);_class2.prototype.__init20.call(this);_class2.prototype.__init21.call(this);_class2.prototype.__init22.call(this);_class2.prototype.__init23.call(this);_class2.prototype.__init24.call(this);_class2.prototype.__init25.call(this);_class2.prototype.__init26.call(this);_class2.prototype.__init27.call(this); }
1305
1404
  __init2() {this.imageCache = globalImageCache}
1306
1405
  __init3() {this.cachedBaseCanvas = null}
1307
1406
  __init4() {this.cachedBaseKey = ""}
@@ -1413,7 +1512,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1413
1512
  `${projection.angle},${transform.flipH},${transform.flipV}`,
1414
1513
  `${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunkS55JFWDAcjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
1415
1514
  _chunkS55JFWDAcjs.adjustmentLayersKey.call(void 0, adjustments.layers),
1416
- `${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}`,
1515
+ `${depthMask.enabled},${depthMask.maskSource},${_optionalChain([depthMask, 'access', _9 => _9.depthRange, 'optionalAccess', _10 => _10[0]])}-${_optionalChain([depthMask, 'access', _11 => _11.depthRange, 'optionalAccess', _12 => _12[1]])},${depthMask.softness},${depthMask.invert},${depthMask.mode}`,
1417
1516
  `d${this.displayKey}`
1418
1517
  ].join("|");
1419
1518
  let baseCanvas = this.cachedBaseCanvas;
@@ -1421,12 +1520,12 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1421
1520
  let histogram = null;
1422
1521
  baseCanvas = await this.renderBaseImage(img, naturalWidth, naturalHeight, region, transform, state, (pixels) => {
1423
1522
  histogram = computeHistogram(pixels);
1424
- _optionalChain([this, 'access', _9 => _9.display, 'optionalCall', _10 => _10(pixels.data)]);
1523
+ _optionalChain([this, 'access', _13 => _13.display, 'optionalCall', _14 => _14(pixels.data)]);
1425
1524
  });
1426
1525
  this.cachedBaseCanvas = baseCanvas;
1427
1526
  this.cachedBaseKey = baseKey;
1428
1527
  this.previewHistogram = histogram;
1429
- _optionalChain([this, 'access', _11 => _11.onPreviewHistogram, 'optionalCall', _12 => _12(histogram)]);
1528
+ _optionalChain([this, 'access', _15 => _15.onPreviewHistogram, 'optionalCall', _16 => _16(histogram)]);
1430
1529
  }
1431
1530
  const drawW = rotated.width * projection.scale;
1432
1531
  const drawH = rotated.height * projection.scale;
@@ -1441,7 +1540,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1441
1540
  const drawW = rotated.width * projection.scale;
1442
1541
  const drawH = rotated.height * projection.scale;
1443
1542
  ctx.drawImage(base.canvas, projection.originX - drawW / 2, projection.originY - drawH / 2, drawW, drawH);
1444
- this.publishHistogram(_nullishCoalesce(_nullishCoalesce(base.histogram, () => ( _optionalChain([comp, 'optionalAccess', _13 => _13.histogram, 'call', _14 => _14()]))), () => ( null)));
1543
+ this.publishHistogram(_nullishCoalesce(_nullishCoalesce(base.histogram, () => ( _optionalChain([comp, 'optionalAccess', _17 => _17.histogram, 'call', _18 => _18()]))), () => ( null)));
1445
1544
  }
1446
1545
  }
1447
1546
  if (overlay.length > 0 || options.draftAnnotation) {
@@ -1499,8 +1598,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1499
1598
  }
1500
1599
  const { width: iw, height: ih } = state.imageDimensions;
1501
1600
  const shownSel = state.selectionPreview !== void 0 ? state.selectionPreview : state.selection;
1502
- const quickMaskSel = display === "quickMask" && state.quickMaskEditing && !_optionalChain([shownSel, 'optionalAccess', _15 => _15.bounds]) ? this.emptyMask(Math.round(iw), Math.round(ih)) : null;
1503
- if (_optionalChain([shownSel, 'optionalAccess', _16 => _16.bounds]) && display !== "none" || quickMaskSel || _optionalChain([options, 'access', _17 => _17.draftSelectionPath, 'optionalAccess', _18 => _18.length])) {
1601
+ const quickMaskSel = display === "quickMask" && state.quickMaskEditing && !_optionalChain([shownSel, 'optionalAccess', _19 => _19.bounds]) ? this.emptyMask(Math.round(iw), Math.round(ih)) : null;
1602
+ if (_optionalChain([shownSel, 'optionalAccess', _20 => _20.bounds]) && display !== "none" || quickMaskSel || _optionalChain([options, 'access', _21 => _21.draftSelectionPath, 'optionalAccess', _22 => _22.length])) {
1504
1603
  ctx.save();
1505
1604
  try {
1506
1605
  _chunkS55JFWDAcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
@@ -1508,13 +1607,26 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1508
1607
  ctx.rect(region.x, region.y, region.width, region.height);
1509
1608
  ctx.clip();
1510
1609
  if (quickMaskSel) this.drawQuickMask(ctx, quickMaskSel);
1511
- else if (_optionalChain([shownSel, 'optionalAccess', _19 => _19.bounds]) && display === "quickMask") this.drawQuickMask(ctx, shownSel);
1512
- else if (_optionalChain([shownSel, 'optionalAccess', _20 => _20.bounds]) && display === "ants") this.drawAnts(ctx, shownSel, projection.scale / u, _nullishCoalesce(options.antsOffset, () => ( 0)));
1513
- if (_optionalChain([options, 'access', _21 => _21.draftSelectionPath, 'optionalAccess', _22 => _22.length])) this.drawDraftPath(ctx, options.draftSelectionPath, projection.scale / u);
1610
+ else if (_optionalChain([shownSel, 'optionalAccess', _23 => _23.bounds]) && display === "quickMask") this.drawQuickMask(ctx, shownSel);
1611
+ else if (_optionalChain([shownSel, 'optionalAccess', _24 => _24.bounds]) && display === "ants") this.drawAnts(ctx, shownSel, projection.scale / u, _nullishCoalesce(options.antsOffset, () => ( 0)));
1612
+ if (_optionalChain([options, 'access', _25 => _25.draftSelectionPath, 'optionalAccess', _26 => _26.length])) this.drawDraftPath(ctx, options.draftSelectionPath, projection.scale / u);
1514
1613
  } catch (e7) {
1515
1614
  }
1516
1615
  ctx.restore();
1517
1616
  }
1617
+ const diff = state.selectionDiff;
1618
+ if (diff && diff.selection === (_nullishCoalesce(state.selection, () => ( null)))) {
1619
+ ctx.save();
1620
+ try {
1621
+ _chunkS55JFWDAcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1622
+ ctx.beginPath();
1623
+ ctx.rect(region.x, region.y, region.width, region.height);
1624
+ ctx.clip();
1625
+ this.drawSelectionDiff(ctx, diff);
1626
+ } catch (e8) {
1627
+ }
1628
+ ctx.restore();
1629
+ }
1518
1630
  if (options.brushCursor) {
1519
1631
  const b = options.brushCursor;
1520
1632
  ctx.save();
@@ -1529,7 +1641,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1529
1641
  ctx.lineWidth = px2;
1530
1642
  ctx.strokeStyle = "#ffffff";
1531
1643
  ctx.stroke();
1532
- } catch (e8) {
1644
+ } catch (e9) {
1533
1645
  }
1534
1646
  ctx.restore();
1535
1647
  }
@@ -1550,7 +1662,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1550
1662
  ctx.lineWidth = u;
1551
1663
  ctx.strokeStyle = "#ffffff";
1552
1664
  ctx.stroke();
1553
- } catch (e9) {
1665
+ } catch (e10) {
1554
1666
  }
1555
1667
  ctx.restore();
1556
1668
  }
@@ -1589,7 +1701,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1589
1701
  ctx.strokeStyle = "#111827";
1590
1702
  ctx.stroke();
1591
1703
  }
1592
- } catch (e10) {
1704
+ } catch (e11) {
1593
1705
  }
1594
1706
  ctx.restore();
1595
1707
  }
@@ -1628,7 +1740,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1628
1740
  ctx.lineWidth = 1.5 * u;
1629
1741
  ctx.strokeStyle = "#ffffff";
1630
1742
  ctx.stroke();
1631
- drawOverlayHandles(ctx, [...t.handles, ..._nullishCoalesce(_optionalChain([t, 'access', _23 => _23.warp, 'optionalAccess', _24 => _24.anchors]), () => ( []))].map(scr), u);
1743
+ drawOverlayHandles(ctx, [...t.handles, ..._nullishCoalesce(_optionalChain([t, 'access', _27 => _27.warp, 'optionalAccess', _28 => _28.anchors]), () => ( []))].map(scr), u);
1632
1744
  if (rotate) {
1633
1745
  ctx.beginPath();
1634
1746
  ctx.arc(rotate.x, rotate.y, 5 * u, 0, Math.PI * 2);
@@ -1638,7 +1750,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1638
1750
  ctx.strokeStyle = OVERLAY_HANDLE_EDGE;
1639
1751
  ctx.stroke();
1640
1752
  }
1641
- for (const h of (_nullishCoalesce(_optionalChain([t, 'access', _25 => _25.warp, 'optionalAccess', _26 => _26.handles]), () => ( []))).map((w) => scr(w.point))) {
1753
+ for (const h of (_nullishCoalesce(_optionalChain([t, 'access', _29 => _29.warp, 'optionalAccess', _30 => _30.handles]), () => ( []))).map((w) => scr(w.point))) {
1642
1754
  ctx.beginPath();
1643
1755
  ctx.arc(h.x, h.y, 3.5 * u, 0, Math.PI * 2);
1644
1756
  ctx.fillStyle = "#ffffff";
@@ -1655,7 +1767,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1655
1767
  ctx.lineWidth = 1.5 * u;
1656
1768
  ctx.strokeStyle = OVERLAY_HANDLE_EDGE;
1657
1769
  ctx.stroke();
1658
- } catch (e11) {
1770
+ } catch (e12) {
1659
1771
  }
1660
1772
  ctx.restore();
1661
1773
  }
@@ -1712,7 +1824,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1712
1824
  ctx.setLineDash([4 * u, 3 * u]);
1713
1825
  ctx.strokeRect(Math.min(a.x, b.x), Math.min(a.y, b.y), Math.abs(b.x - a.x), Math.abs(b.y - a.y));
1714
1826
  }
1715
- } catch (e12) {
1827
+ } catch (e13) {
1716
1828
  }
1717
1829
  ctx.restore();
1718
1830
  }
@@ -1780,10 +1892,10 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1780
1892
  _chunkS55JFWDAcjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
1781
1893
  }
1782
1894
  }
1783
- } catch (e13) {
1895
+ } catch (e14) {
1784
1896
  }
1785
1897
  }
1786
- _optionalChain([onPixels, 'optionalCall', _27 => _27(imageData)]);
1898
+ _optionalChain([onPixels, 'optionalCall', _31 => _31(imageData)]);
1787
1899
  baseCtx.putImageData(imageData, 0, 0);
1788
1900
  }
1789
1901
  return baseCanvas;
@@ -1792,7 +1904,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1792
1904
  /** Which base path renders `state` (see `needsLegacyBase`). */
1793
1905
  chooseRoute(state, region, naturalWidth, naturalHeight) {
1794
1906
  let route;
1795
- if (!_optionalChain([state, 'access', _28 => _28.layers, 'optionalAccess', _29 => _29.length])) route = "legacy";
1907
+ if (!_optionalChain([state, 'access', _32 => _32.layers, 'optionalAccess', _33 => _33.length])) route = "legacy";
1796
1908
  else if (this.baseRoute === "layers") route = "layers";
1797
1909
  else {
1798
1910
  const stack = { layers: state.layers, outputOpacity: _nullishCoalesce(state.outputOpacity, () => ( 1)), legacyOutputBlur: state.legacyOutputBlur };
@@ -1802,7 +1914,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1802
1914
  region,
1803
1915
  canvas: { width: naturalWidth, height: naturalHeight },
1804
1916
  transform: state.transform,
1805
- sourceOpaque: _nullishCoalesce(_optionalChain([this, 'access', _30 => _30.layerSources, 'optionalAccess', _31 => _31.sourceIsOpaque, 'call', _32 => _32()]), () => ( true))
1917
+ sourceOpaque: _nullishCoalesce(_optionalChain([this, 'access', _34 => _34.layerSources, 'optionalAccess', _35 => _35.sourceIsOpaque, 'call', _36 => _36()]), () => ( true))
1806
1918
  }) ? "legacy" : "layers";
1807
1919
  }
1808
1920
  this.lastBaseRoute = route;
@@ -1820,36 +1932,36 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1820
1932
  return _nullishCoalesce(this.depthMaps.get(`${source.maskSource}|${width}x${height}`), () => ( null));
1821
1933
  },
1822
1934
  rasterizeAnnotation: (annotation, rect2) => this.rasterizeAnnotation(annotation, rect2),
1823
- version: `${_nullishCoalesce(_optionalChain([host, 'optionalAccess', _33 => _33.version, 'call', _34 => _34()]), () => ( ""))}:${this.assetVersion}`,
1824
- globalLight: _optionalChain([host, 'optionalAccess', _35 => _35.globalLight, 'optionalCall', _36 => _36()]),
1825
- pattern: _optionalChain([host, 'optionalAccess', _37 => _37.pattern]) ? (id) => host.pattern(id) : void 0
1935
+ version: `${_nullishCoalesce(_optionalChain([host, 'optionalAccess', _37 => _37.version, 'call', _38 => _38()]), () => ( ""))}:${this.assetVersion}`,
1936
+ globalLight: _optionalChain([host, 'optionalAccess', _39 => _39.globalLight, 'optionalCall', _40 => _40()]),
1937
+ pattern: _optionalChain([host, 'optionalAccess', _41 => _41.pattern]) ? (id) => host.pattern(id) : void 0
1826
1938
  };
1827
1939
  }
1828
1940
  /** Loads what the compositor reads synchronously: depth maps (at canvas size) and annotation images. */
1829
1941
  /** Loads depth maps and annotation images the compositor reads synchronously. */
1830
1942
  async prepareLayerAssets(layers, width, height) {
1831
1943
  for (const l of _chunkB46UQUDCcjs.flattenLayers.call(void 0, layers)) {
1832
- const source = _optionalChain([l, 'access', _38 => _38.mask, 'optionalAccess', _39 => _39.source]);
1833
- if (_optionalChain([source, 'optionalAccess', _40 => _40.enabled]) && source.maskSource) {
1944
+ const source = _optionalChain([l, 'access', _42 => _42.mask, 'optionalAccess', _43 => _43.source]);
1945
+ if (_optionalChain([source, 'optionalAccess', _44 => _44.enabled]) && source.maskSource) {
1834
1946
  const key2 = `${source.maskSource}|${width}x${height}`;
1835
1947
  if (this.depthMaps.has(key2)) continue;
1836
1948
  try {
1837
1949
  const maskImg = await this.imageCache.get(source.maskSource);
1838
1950
  const canvas = this.createCanvas(width, height);
1839
1951
  const mctx = canvas.getContext("2d");
1840
- const data = mctx ? (mctx.drawImage(maskImg, 0, 0, width, height), _optionalChain([mctx, 'access', _41 => _41.getImageData, 'optionalCall', _42 => _42(0, 0, width, height)])) : null;
1952
+ const data = mctx ? (mctx.drawImage(maskImg, 0, 0, width, height), _optionalChain([mctx, 'access', _45 => _45.getImageData, 'optionalCall', _46 => _46(0, 0, width, height)])) : null;
1841
1953
  if (data) {
1842
1954
  this.depthMaps.set(key2, { width, height, data: data.data });
1843
1955
  this.assetVersion++;
1844
1956
  }
1845
- } catch (e14) {
1957
+ } catch (e15) {
1846
1958
  }
1847
1959
  }
1848
1960
  if (l.type === "annotation" && l.annotation.type === "image" && !this.imageCache.peek(l.annotation.src)) {
1849
1961
  try {
1850
1962
  await this.imageCache.get(l.annotation.src);
1851
1963
  this.assetVersion++;
1852
- } catch (e15) {
1964
+ } catch (e16) {
1853
1965
  }
1854
1966
  }
1855
1967
  }
@@ -1877,7 +1989,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1877
1989
  this.drawAnnotationShape(ctx, annotation, img);
1878
1990
  ctx.setTransform(1, 0, 0, 1, 0, 0);
1879
1991
  return new Uint8ClampedArray(ctx.getImageData(0, 0, rect2.width, rect2.height).data);
1880
- } catch (e16) {
1992
+ } catch (e17) {
1881
1993
  return null;
1882
1994
  }
1883
1995
  }
@@ -1891,7 +2003,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1891
2003
  if (x1 <= x0 || y1 <= y0) return;
1892
2004
  const img = ctx.createImageData(_chunk474IQG74cjs.TILE, _chunk474IQG74cjs.TILE);
1893
2005
  img.data.set(data);
1894
- _optionalChain([this, 'access', _43 => _43.display, 'optionalCall', _44 => _44(img.data)]);
2006
+ _optionalChain([this, 'access', _47 => _47.display, 'optionalCall', _48 => _48(img.data)]);
1895
2007
  ctx.putImageData(img, ox, oy, x0, y0, x1 - x0, y1 - y0);
1896
2008
  }
1897
2009
  /**
@@ -1958,7 +2070,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1958
2070
  const opacity = _nullishCoalesce(state.outputOpacity, () => ( 1));
1959
2071
  const blur = _nullishCoalesce(state.legacyOutputBlur, () => ( 0));
1960
2072
  if (!(opacity < 1) && !(blur > 0)) return null;
1961
- const data = _optionalChain([ctx, 'access', _45 => _45.getImageData, 'optionalCall', _46 => _46(0, 0, w, h)]);
2073
+ const data = _optionalChain([ctx, 'access', _49 => _49.getImageData, 'optionalCall', _50 => _50(0, 0, w, h)]);
1962
2074
  if (!data) return null;
1963
2075
  applyOutputStage(data, opacity, blur);
1964
2076
  ctx.putImageData(data, 0, 0);
@@ -1967,11 +2079,12 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1967
2079
  publishHistogram(histogram) {
1968
2080
  if (histogram === this.previewHistogram) return;
1969
2081
  this.previewHistogram = histogram;
1970
- _optionalChain([this, 'access', _47 => _47.onPreviewHistogram, 'optionalCall', _48 => _48(histogram)]);
2082
+ _optionalChain([this, 'access', _51 => _51.onPreviewHistogram, 'optionalCall', _52 => _52(histogram)]);
1971
2083
  }
1972
2084
  __init21() {this.quickMaskCache = /* @__PURE__ */ new WeakMap()}
1973
- __init22() {this.outlineCache = /* @__PURE__ */ new WeakMap()}
1974
- __init23() {this.emptyMaskCache = null}
2085
+ __init22() {this.diffCache = /* @__PURE__ */ new WeakMap()}
2086
+ __init23() {this.outlineCache = /* @__PURE__ */ new WeakMap()}
2087
+ __init24() {this.emptyMaskCache = null}
1975
2088
  /** An empty selection of the image's size (Quick Mask mode with nothing selected). */
1976
2089
  emptyMask(width, height) {
1977
2090
  const m = this.emptyMaskCache;
@@ -1979,15 +2092,15 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1979
2092
  this.emptyMaskCache = _chunkSS53NNZOcjs.createSelectionMask.call(void 0, Math.max(1, width), Math.max(1, height));
1980
2093
  return this.emptyMaskCache;
1981
2094
  }
1982
- __init24() {this.overlayCache = /* @__PURE__ */ new WeakMap()}
1983
- __init25() {this.maskViewCache = /* @__PURE__ */ new WeakMap()}
1984
- __init26() {this.grayCache = /* @__PURE__ */ new WeakMap()}
2095
+ __init25() {this.overlayCache = /* @__PURE__ */ new WeakMap()}
2096
+ __init26() {this.maskViewCache = /* @__PURE__ */ new WeakMap()}
2097
+ __init27() {this.grayCache = /* @__PURE__ */ new WeakMap()}
1985
2098
  /** A layer's mask as canvas-sized coverage for its mask view, kept while the mask is unchanged. */
1986
2099
  maskViewSelection(layer, width, height) {
1987
2100
  if (!layer.mask || layer.mask.source || width < 1 || height < 1) return null;
1988
2101
  const key2 = `${width}x${height}:${layer.type === "pixel" ? `${layer.offset.x},${layer.offset.y}` : ""}`;
1989
2102
  const cached = this.maskViewCache.get(layer.mask.surface);
1990
- if (_optionalChain([cached, 'optionalAccess', _49 => _49.key]) === key2) return cached.mask;
2103
+ if (_optionalChain([cached, 'optionalAccess', _53 => _53.key]) === key2) return cached.mask;
1991
2104
  const mask = _chunkS55JFWDAcjs.layerMaskSelection.call(void 0, layer, width, height);
1992
2105
  if (mask) this.maskViewCache.set(layer.mask.surface, { key: key2, mask });
1993
2106
  return mask;
@@ -2008,7 +2121,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2008
2121
  }
2009
2122
  /** A channel's tint (colour, opacity, masked or selected area), drawn in natural image space. */
2010
2123
  drawMaskOverlay(ctx, mask, style) {
2011
- const key2 = `${_optionalChain([style, 'access', _50 => _50.color, 'optionalAccess', _51 => _51.join, 'call', _52 => _52(",")])}|${style.opacity}|${style.indicates}`;
2124
+ const key2 = `${_optionalChain([style, 'access', _54 => _54.color, 'optionalAccess', _55 => _55.join, 'call', _56 => _56(",")])}|${style.opacity}|${style.indicates}`;
2012
2125
  let cached = this.overlayCache.get(mask);
2013
2126
  if (!cached || cached.key !== key2) {
2014
2127
  const canvas = this.createCanvas(mask.width, mask.height);
@@ -2023,6 +2136,19 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2023
2136
  ctx.drawImage(cached.canvas, 0, 0, mask.width, mask.height);
2024
2137
  }
2025
2138
  /** Rubylith over the unselected area, drawn in natural image space. */
2139
+ drawSelectionDiff(ctx, diff) {
2140
+ let canvas = this.diffCache.get(diff);
2141
+ if (!canvas) {
2142
+ canvas = this.createCanvas(diff.added.width, diff.added.height);
2143
+ const mctx = canvas.getContext("2d");
2144
+ if (!mctx || typeof mctx.createImageData !== "function") return;
2145
+ const img = mctx.createImageData(diff.added.width, diff.added.height);
2146
+ img.data.set(selectionDiffPixels(diff.added, diff.removed));
2147
+ mctx.putImageData(img, 0, 0);
2148
+ this.diffCache.set(diff, canvas);
2149
+ }
2150
+ ctx.drawImage(canvas, 0, 0, diff.added.width, diff.added.height);
2151
+ }
2026
2152
  drawQuickMask(ctx, selection) {
2027
2153
  let canvas = this.quickMaskCache.get(selection);
2028
2154
  if (!canvas) {
@@ -2131,7 +2257,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2131
2257
  _chunkOLNIPTB3cjs.blendImageData.call(void 0, backdrop, source, _chunkOLNIPTB3cjs.normalizeBlendMode.call(void 0, ann.blend));
2132
2258
  lctx.setTransform(1, 0, 0, 1, 0, 0);
2133
2259
  lctx.putImageData(backdrop, 0, 0);
2134
- } catch (e17) {
2260
+ } catch (e18) {
2135
2261
  return false;
2136
2262
  }
2137
2263
  ctx.save();
@@ -2147,7 +2273,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2147
2273
  if (ann.type === "image") {
2148
2274
  try {
2149
2275
  img = await this.imageCache.get(ann.src);
2150
- } catch (e18) {
2276
+ } catch (e19) {
2151
2277
  }
2152
2278
  }
2153
2279
  this.drawAnnotationShape(ctx, ann, img);
@@ -2426,8 +2552,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2426
2552
  if (!ctx) return maskCanvas;
2427
2553
  ctx.fillStyle = MASK_BLACK;
2428
2554
  ctx.fillRect(0, 0, naturalWidth, naturalHeight);
2429
- const useCrop = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _53 => _53.useCrop]), () => ( true));
2430
- const useAnnotations = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _54 => _54.useAnnotations]), () => ( true));
2555
+ const useCrop = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _57 => _57.useCrop]), () => ( true));
2556
+ const useAnnotations = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _58 => _58.useAnnotations]), () => ( true));
2431
2557
  if (useCrop && state.crop) {
2432
2558
  ctx.fillStyle = MASK_WHITE;
2433
2559
  ctx.fillRect(state.crop.x, state.crop.y, state.crop.width, state.crop.height);
@@ -2437,8 +2563,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2437
2563
  this.drawAnnotationMask(ctx, ann);
2438
2564
  }
2439
2565
  }
2440
- const imageData = _optionalChain([ctx, 'access', _55 => _55.getImageData, 'optionalCall', _56 => _56(0, 0, naturalWidth, naturalHeight)]);
2441
- const selection = (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _57 => _57.useSelection]), () => ( true))) && _optionalChain([state, 'access', _58 => _58.selection, 'optionalAccess', _59 => _59.bounds]) && state.selection.width === naturalWidth && state.selection.height === naturalHeight ? state.selection : null;
2566
+ const imageData = _optionalChain([ctx, 'access', _59 => _59.getImageData, 'optionalCall', _60 => _60(0, 0, naturalWidth, naturalHeight)]);
2567
+ const selection = (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _61 => _61.useSelection]), () => ( true))) && _optionalChain([state, 'access', _62 => _62.selection, 'optionalAccess', _63 => _63.bounds]) && state.selection.width === naturalWidth && state.selection.height === naturalHeight ? state.selection : null;
2442
2568
  if (imageData) {
2443
2569
  const d = imageData.data;
2444
2570
  for (let i = 0; i < d.length; i += 4) {
@@ -2524,16 +2650,16 @@ function getBaseProjection(region, transform, baseW, baseH) {
2524
2650
  };
2525
2651
  }
2526
2652
  var CompositeCanvas = (_class3 = class {
2527
- constructor(canvas, rect2) {;_class3.prototype.__init27.call(this);_class3.prototype.__init28.call(this);_class3.prototype.__init29.call(this);
2653
+ constructor(canvas, rect2) {;_class3.prototype.__init28.call(this);_class3.prototype.__init29.call(this);_class3.prototype.__init30.call(this);
2528
2654
  this.canvas = canvas;
2529
2655
  this.rect = rect2;
2530
2656
  this.region = rect2;
2531
2657
  }
2532
2658
 
2533
2659
 
2534
- __init27() {this.tiles = /* @__PURE__ */ new Map()}
2535
- __init28() {this.histograms = /* @__PURE__ */ new Map()}
2536
- __init29() {this.version = 0}
2660
+ __init28() {this.tiles = /* @__PURE__ */ new Map()}
2661
+ __init29() {this.histograms = /* @__PURE__ */ new Map()}
2662
+ __init30() {this.version = 0}
2537
2663
 
2538
2664
  /** Histogram of the composite over the region (per-tile parts are cached). */
2539
2665
  histogram() {
@@ -2609,27 +2735,7 @@ function inspectMaskEdge(mask, image, options = {}) {
2609
2735
  if (img[i + 3] < 128) return null;
2610
2736
  return [img[i], img[i + 1], img[i + 2]];
2611
2737
  };
2612
- const premul = (x, y, c) => {
2613
- const ix = Math.min(image.width - 1, Math.max(0, x - image.x));
2614
- const iy = Math.min(image.height - 1, Math.max(0, y - image.y));
2615
- const i = (iy * image.width + ix) * 4;
2616
- return img[i + c] * img[i + 3] / 255;
2617
- };
2618
- const gradCache = /* @__PURE__ */ new Map();
2619
- const gradient = (x, y) => {
2620
- const k = y * W + x;
2621
- const hit = gradCache.get(k);
2622
- if (hit !== void 0) return hit;
2623
- let best = 0;
2624
- for (let c = 0; c < 3; c++) {
2625
- const p = (dx, dy) => premul(x + dx, y + dy, c);
2626
- const gx = p(1, -1) + 2 * p(1, 0) + p(1, 1) - p(-1, -1) - 2 * p(-1, 0) - p(-1, 1);
2627
- const gy = p(-1, 1) + 2 * p(0, 1) + p(1, 1) - p(-1, -1) - 2 * p(0, -1) - p(1, -1);
2628
- best = Math.max(best, Math.hypot(gx, gy) / 1020);
2629
- }
2630
- gradCache.set(k, best);
2631
- return best;
2632
- };
2738
+ const gradient = createGradientSampler(image, W);
2633
2739
  const B = Math.min(256, Math.max(24, Math.round(Math.max(W, H) / 12)));
2634
2740
  const BW = Math.ceil(W / B);
2635
2741
  const blocks = /* @__PURE__ */ new Map();
@@ -2806,6 +2912,30 @@ function inspectMaskEdge(mask, image, options = {}) {
2806
2912
  issues
2807
2913
  };
2808
2914
  }
2915
+ function createGradientSampler(image, W) {
2916
+ const img = image.data;
2917
+ const premul = (x, y, c) => {
2918
+ const ix = Math.min(image.width - 1, Math.max(0, x - image.x));
2919
+ const iy = Math.min(image.height - 1, Math.max(0, y - image.y));
2920
+ const i = (iy * image.width + ix) * 4;
2921
+ return img[i + c] * img[i + 3] / 255;
2922
+ };
2923
+ const cache = /* @__PURE__ */ new Map();
2924
+ return (x, y) => {
2925
+ const k = y * W + x;
2926
+ const hit = cache.get(k);
2927
+ if (hit !== void 0) return hit;
2928
+ let best = 0;
2929
+ for (let c = 0; c < 3; c++) {
2930
+ const p = (dx, dy) => premul(x + dx, y + dy, c);
2931
+ const gx = p(1, -1) + 2 * p(1, 0) + p(1, 1) - p(-1, -1) - 2 * p(-1, 0) - p(-1, 1);
2932
+ const gy = p(-1, 1) + 2 * p(0, 1) + p(1, 1) - p(-1, -1) - 2 * p(0, -1) - p(1, -1);
2933
+ best = Math.max(best, Math.hypot(gx, gy) / 1020);
2934
+ }
2935
+ cache.set(k, best);
2936
+ return best;
2937
+ };
2938
+ }
2809
2939
  function traceLoops(a, W, H, rx0, ry0, rx1, ry1) {
2810
2940
  const w = rx1 - rx0;
2811
2941
  const h = ry1 - ry0;
@@ -2983,10 +3113,139 @@ function regions(a, W, H, b, minArea) {
2983
3113
  const kept = list.filter((r) => r.area >= minArea).sort((p, q) => q.area - p.area);
2984
3114
  return { count: kept.length, totalArea: kept.reduce((s, r) => s + r.area, 0), largest: kept.slice(0, 10).map((r) => ({ area: r.area, bounds: box(r) })) };
2985
3115
  };
2986
- const pieces = found.filter((r) => r.fg).sort((p, q) => q.area - p.area);
3116
+ const pieces2 = found.filter((r) => r.fg).sort((p, q) => q.area - p.area);
2987
3117
  return {
2988
3118
  holes: summarize(found.filter((r) => !r.fg && !r.outer)),
2989
- islands: summarize(pieces.slice(1))
3119
+ islands: summarize(pieces2.slice(1))
3120
+ };
3121
+ }
3122
+
3123
+ // src/image-editor/selection/uncertainty.ts
3124
+ var BACKED = 0.2;
3125
+ function selectionUncertainty(mask, image, options = {}) {
3126
+ const W = mask.width;
3127
+ const H = mask.height;
3128
+ const empty = () => ({ unknown: _chunkSS53NNZOcjs.createSelectionMask.call(void 0, W, H), regions: [], count: 0, confidence: 1 });
3129
+ const b = mask.bounds;
3130
+ if (!b) return empty();
3131
+ const band = Math.max(1, Math.round(_nullishCoalesce(options.band, () => ( Math.max(2, Math.min(W, H) / 200)))));
3132
+ const minArea = Math.max(1, _nullishCoalesce(options.minArea, () => ( 16)));
3133
+ const maxRegions = Math.max(1, _nullishCoalesce(options.maxRegions, () => ( 20)));
3134
+ const a = mask.data;
3135
+ const gradient = createGradientSampler(image, W);
3136
+ const x0 = Math.max(0, b.x - band - 1);
3137
+ const y0 = Math.max(0, b.y - band - 1);
3138
+ const x1 = Math.min(W, b.x + b.width + band + 1);
3139
+ const y1 = Math.min(H, b.y + b.height + band + 1);
3140
+ const w = x1 - x0;
3141
+ const h = y1 - y0;
3142
+ const evidence = new Float32Array(w * h).fill(NaN);
3143
+ const seeds = new Uint8Array(w * h);
3144
+ let sum = 0;
3145
+ let n = 0;
3146
+ const on = (x, y) => a[y * W + x] >= 128;
3147
+ for (let y = y0; y < y1; y++) {
3148
+ for (let x = x0; x < x1; x++) {
3149
+ const v = on(x, y);
3150
+ const differs = (nx, ny) => nx >= 0 && ny >= 0 && nx < W && ny < H && on(nx, ny) !== v;
3151
+ if (!(differs(x - 1, y) || differs(x + 1, y) || differs(x, y - 1) || differs(x, y + 1))) continue;
3152
+ let g = 0;
3153
+ for (let dy = -2; dy <= 2; dy++) {
3154
+ for (let dx = -2; dx <= 2; dx++) {
3155
+ const nx = x + dx;
3156
+ const ny = y + dy;
3157
+ if (nx >= 0 && ny >= 0 && nx < W && ny < H) g = Math.max(g, gradient(nx, ny));
3158
+ }
3159
+ }
3160
+ const e = Math.min(1, g / BACKED);
3161
+ const k = (y - y0) * w + (x - x0);
3162
+ evidence[k] = e;
3163
+ sum += e;
3164
+ n++;
3165
+ if (e < 0.5) seeds[k] = 1;
3166
+ }
3167
+ }
3168
+ if (!n) return empty();
3169
+ const rows = new Uint8Array(w * h);
3170
+ for (let y = 0; y < h; y++) {
3171
+ let last = -Infinity;
3172
+ for (let x = 0; x < w; x++) {
3173
+ if (seeds[y * w + x]) last = x;
3174
+ if (x - last <= band) rows[y * w + x] = 1;
3175
+ }
3176
+ last = Infinity;
3177
+ for (let x = w - 1; x >= 0; x--) {
3178
+ if (seeds[y * w + x]) last = x;
3179
+ if (last - x <= band) rows[y * w + x] = 1;
3180
+ }
3181
+ }
3182
+ const grown = new Uint8Array(w * h);
3183
+ for (let x = 0; x < w; x++) {
3184
+ let last = -Infinity;
3185
+ for (let y = 0; y < h; y++) {
3186
+ if (rows[y * w + x]) last = y;
3187
+ if (y - last <= band) grown[y * w + x] = 1;
3188
+ }
3189
+ last = Infinity;
3190
+ for (let y = h - 1; y >= 0; y--) {
3191
+ if (rows[y * w + x]) last = y;
3192
+ if (last - y <= band) grown[y * w + x] = 1;
3193
+ }
3194
+ }
3195
+ const label = new Int32Array(w * h);
3196
+ const stack = new Int32Array(w * h);
3197
+ const found = [];
3198
+ for (let start = 0; start < w * h; start++) {
3199
+ if (!grown[start] || label[start]) continue;
3200
+ const r = { area: 0, e: 0, en: 0, bx0: w, by0: h, bx1: -1, by1: -1 };
3201
+ const id = found.length + 1;
3202
+ let top = 0;
3203
+ stack[top++] = start;
3204
+ label[start] = id;
3205
+ while (top) {
3206
+ const k = stack[--top];
3207
+ const i = k % w;
3208
+ const j = (k - i) / w;
3209
+ r.area++;
3210
+ if (!Number.isNaN(evidence[k])) {
3211
+ r.e += evidence[k];
3212
+ r.en++;
3213
+ }
3214
+ if (i < r.bx0) r.bx0 = i;
3215
+ if (i > r.bx1) r.bx1 = i;
3216
+ if (j < r.by0) r.by0 = j;
3217
+ if (j > r.by1) r.by1 = j;
3218
+ for (let dy = -1; dy <= 1; dy++) {
3219
+ for (let dx = -1; dx <= 1; dx++) {
3220
+ const ni = i + dx;
3221
+ const nj = j + dy;
3222
+ if (ni < 0 || nj < 0 || ni >= w || nj >= h) continue;
3223
+ const nk = nj * w + ni;
3224
+ if (!grown[nk] || label[nk]) continue;
3225
+ label[nk] = id;
3226
+ stack[top++] = nk;
3227
+ }
3228
+ }
3229
+ }
3230
+ found.push(r);
3231
+ }
3232
+ const unknownData = new Uint8Array(W * H);
3233
+ for (let y = 0; y < h; y++) {
3234
+ for (let x = 0; x < w; x++) {
3235
+ const id = label[y * w + x];
3236
+ if (id && found[id - 1].area >= minArea) unknownData[(y + y0) * W + x + x0] = 255;
3237
+ }
3238
+ }
3239
+ const kept = found.filter((r) => r.area >= minArea).map((r) => ({
3240
+ bounds: { x: x0 + r.bx0, y: y0 + r.by0, width: r.bx1 - r.bx0 + 1, height: r.by1 - r.by0 + 1 },
3241
+ area: r.area,
3242
+ confidence: Math.round((r.en ? r.e / r.en : 0) * 1e3) / 1e3
3243
+ })).sort((p, q) => p.confidence - q.confidence || q.area - p.area);
3244
+ return {
3245
+ unknown: _chunkSS53NNZOcjs.createSelectionMask.call(void 0, W, H, unknownData),
3246
+ regions: kept.slice(0, maxRegions),
3247
+ count: kept.length,
3248
+ confidence: Math.round(sum / n * 1e3) / 1e3
2990
3249
  };
2991
3250
  }
2992
3251
 
@@ -3061,8 +3320,8 @@ var EdgeMap = (_class4 = class {
3061
3320
 
3062
3321
 
3063
3322
 
3064
- __init30() {this.blocks = /* @__PURE__ */ new Map()}
3065
- constructor(pixels, options = {}) {;_class4.prototype.__init30.call(this);
3323
+ __init31() {this.blocks = /* @__PURE__ */ new Map()}
3324
+ constructor(pixels, options = {}) {;_class4.prototype.__init31.call(this);
3066
3325
  const { width, height, data } = pixels;
3067
3326
  if (!(width >= 1 && height >= 1) || data.length < width * height * 4) throw new Error("Invalid pixel buffer for edge detection.");
3068
3327
  this.width = width;
@@ -3179,10 +3438,10 @@ function snapToEdge(map, point, width = 10) {
3179
3438
  }
3180
3439
  return best > 0 ? { x: bx + 0.5, y: by + 0.5 } : point;
3181
3440
  }
3182
- var Heap = (_class5 = class {constructor() { _class5.prototype.__init31.call(this);_class5.prototype.__init32.call(this);_class5.prototype.__init33.call(this); }
3183
- __init31() {this.ids = new Int32Array(256)}
3184
- __init32() {this.keys = new Float64Array(256)}
3185
- __init33() {this.size = 0}
3441
+ var Heap = (_class5 = class {constructor() { _class5.prototype.__init32.call(this);_class5.prototype.__init33.call(this);_class5.prototype.__init34.call(this); }
3442
+ __init32() {this.ids = new Int32Array(256)}
3443
+ __init33() {this.keys = new Float64Array(256)}
3444
+ __init34() {this.size = 0}
3186
3445
  push(id, key2) {
3187
3446
  if (this.size === this.ids.length) {
3188
3447
  const ids = new Int32Array(this.size * 2);
@@ -3389,15 +3648,15 @@ function readPaths(stored, problems = []) {
3389
3648
  let work = false;
3390
3649
  for (const [i, raw] of stored.entries()) {
3391
3650
  const r = raw;
3392
- const name = typeof _optionalChain([r, 'optionalAccess', _60 => _60.name]) === "string" && r.name.trim() ? r.name.trim() : `Path ${i + 1}`;
3651
+ const name = typeof _optionalChain([r, 'optionalAccess', _64 => _64.name]) === "string" && r.name.trim() ? r.name.trim() : `Path ${i + 1}`;
3393
3652
  try {
3394
- const components = _chunkS55JFWDAcjs.readShapeComponents.call(void 0, _optionalChain([r, 'optionalAccess', _61 => _61.components]));
3395
- let id = typeof _optionalChain([r, 'optionalAccess', _62 => _62.id]) === "string" && r.id ? r.id : newPathId();
3653
+ const components = _chunkS55JFWDAcjs.readShapeComponents.call(void 0, _optionalChain([r, 'optionalAccess', _65 => _65.components]));
3654
+ let id = typeof _optionalChain([r, 'optionalAccess', _66 => _66.id]) === "string" && r.id ? r.id : newPathId();
3396
3655
  if (ids.has(id)) id = newPathId();
3397
3656
  ids.add(id);
3398
3657
  const path = { id, name, components };
3399
- if (_optionalChain([r, 'optionalAccess', _63 => _63.fillRule]) === "evenodd") path.fillRule = "evenodd";
3400
- if (_optionalChain([r, 'optionalAccess', _64 => _64.work]) === true && !work) {
3658
+ if (_optionalChain([r, 'optionalAccess', _67 => _67.fillRule]) === "evenodd") path.fillRule = "evenodd";
3659
+ if (_optionalChain([r, 'optionalAccess', _68 => _68.work]) === true && !work) {
3401
3660
  path.work = true;
3402
3661
  work = true;
3403
3662
  }
@@ -3468,15 +3727,15 @@ function liveShapeForDrag(o, a, b, mods = {}) {
3468
3727
  return null;
3469
3728
  }
3470
3729
  var ShapeDrawGesture = (_class6 = class {
3471
- constructor(controller, options) {;_class6.prototype.__init34.call(this);_class6.prototype.__init35.call(this);_class6.prototype.__init36.call(this);
3730
+ constructor(controller, options) {;_class6.prototype.__init35.call(this);_class6.prototype.__init36.call(this);_class6.prototype.__init37.call(this);
3472
3731
  this.controller = controller;
3473
3732
  this.options = options;
3474
3733
  }
3475
3734
 
3476
3735
 
3477
- __init34() {this.start = null}
3478
- __init35() {this.layerId = null}
3479
- __init36() {this.error = null}
3736
+ __init35() {this.start = null}
3737
+ __init36() {this.layerId = null}
3738
+ __init37() {this.error = null}
3480
3739
  get active() {
3481
3740
  return this.start !== null;
3482
3741
  }
@@ -3521,11 +3780,11 @@ function applyShapeOptions(controller, layerId, change) {
3521
3780
  const style = {};
3522
3781
  if ("fill" in change) style.fill = _nullishCoalesce(change.fill, () => ( null));
3523
3782
  if ("stroke" in change || "strokeWidth" in change) {
3524
- const color = "stroke" in change ? change.stroke : _optionalChain([info, 'access', _65 => _65.stroke, 'optionalAccess', _66 => _66.paint, 'access', _67 => _67.type]) === "color" ? info.stroke.paint.color : null;
3525
- style.stroke = color ? { width: _nullishCoalesce(_nullishCoalesce(change.strokeWidth, () => ( _optionalChain([info, 'access', _68 => _68.stroke, 'optionalAccess', _69 => _69.width]))), () => ( 2)), paint: color } : null;
3783
+ const color = "stroke" in change ? change.stroke : _optionalChain([info, 'access', _69 => _69.stroke, 'optionalAccess', _70 => _70.paint, 'access', _71 => _71.type]) === "color" ? info.stroke.paint.color : null;
3784
+ style.stroke = color ? { width: _nullishCoalesce(_nullishCoalesce(change.strokeWidth, () => ( _optionalChain([info, 'access', _72 => _72.stroke, 'optionalAccess', _73 => _73.width]))), () => ( 2)), paint: color } : null;
3526
3785
  }
3527
3786
  if (Object.keys(style).length) controller.setShapeStyle(layerId, style);
3528
- const live = _optionalChain([info, 'access', _70 => _70.components, 'access', _71 => _71[0], 'optionalAccess', _72 => _72.live]);
3787
+ const live = _optionalChain([info, 'access', _74 => _74.components, 'access', _75 => _75[0], 'optionalAccess', _76 => _76.live]);
3529
3788
  if (!live) return;
3530
3789
  const shape = {};
3531
3790
  if (live.kind === "rect" && change.radius !== void 0) shape.radius = change.radius;
@@ -3537,7 +3796,7 @@ function applyShapeOptions(controller, layerId, change) {
3537
3796
  if (Object.keys(shape).length) controller.setShapeComponent(layerId, 0, { shape });
3538
3797
  }
3539
3798
  var TextEditSession = (_class7 = class {
3540
- constructor(controller, layerId, index) {;_class7.prototype.__init37.call(this);_class7.prototype.__init38.call(this);_class7.prototype.__init39.call(this);
3799
+ constructor(controller, layerId, index) {;_class7.prototype.__init38.call(this);_class7.prototype.__init39.call(this);_class7.prototype.__init40.call(this);
3541
3800
  this.controller = controller;
3542
3801
  this.layerId = layerId;
3543
3802
  const n = this.text.length;
@@ -3547,11 +3806,11 @@ var TextEditSession = (_class7 = class {
3547
3806
 
3548
3807
 
3549
3808
 
3550
- __init37() {this.changed = false}
3551
- __init38() {this.listeners = /* @__PURE__ */ new Set()}
3552
- __init39() {this.error = null}
3809
+ __init38() {this.changed = false}
3810
+ __init39() {this.listeners = /* @__PURE__ */ new Set()}
3811
+ __init40() {this.error = null}
3553
3812
  get layer() {
3554
- const l = _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, this.controller.getLayers(), this.layerId), 'optionalAccess', _73 => _73.layer]);
3813
+ const l = _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, this.controller.getLayers(), this.layerId), 'optionalAccess', _77 => _77.layer]);
3555
3814
  if (!l || l.type !== "type") throw new Error("The type layer being edited is gone.");
3556
3815
  return l;
3557
3816
  }
@@ -3566,7 +3825,7 @@ var TextEditSession = (_class7 = class {
3566
3825
  }
3567
3826
  /** Whether the layer still exists (it can be deleted or undone away while editing). */
3568
3827
  get alive() {
3569
- return _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, this.controller.getLayers(), this.layerId), 'optionalAccess', _74 => _74.layer, 'access', _75 => _75.type]) === "type";
3828
+ return _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, this.controller.getLayers(), this.layerId), 'optionalAccess', _78 => _78.layer, 'access', _79 => _79.type]) === "type";
3570
3829
  }
3571
3830
  subscribe(fn) {
3572
3831
  this.listeners.add(fn);
@@ -3752,14 +4011,14 @@ var TextEditSession = (_class7 = class {
3752
4011
  if (!this.text.trim().length) {
3753
4012
  try {
3754
4013
  this.controller.removeLayer(this.layerId);
3755
- } catch (e19) {
4014
+ } catch (e20) {
3756
4015
  }
3757
4016
  return false;
3758
4017
  }
3759
4018
  if (this.layer.name === "Text" && this.changed) {
3760
4019
  try {
3761
4020
  this.controller.setLayerProperties(this.layerId, { name: _chunkS55JFWDAcjs.typeLayerName.call(void 0, this.text) }, false);
3762
- } catch (e20) {
4021
+ } catch (e21) {
3763
4022
  }
3764
4023
  }
3765
4024
  return true;
@@ -3798,15 +4057,15 @@ function invert(m) {
3798
4057
  return [d / det, -b / det, -c / det, a / det, (c * f - d * e) / det, (b * e - a * f) / det];
3799
4058
  }
3800
4059
  var TypeToolGesture = (_class8 = class {
3801
- constructor(controller, options) {;_class8.prototype.__init40.call(this);_class8.prototype.__init41.call(this);_class8.prototype.__init42.call(this);
4060
+ constructor(controller, options) {;_class8.prototype.__init41.call(this);_class8.prototype.__init42.call(this);_class8.prototype.__init43.call(this);
3802
4061
  this.controller = controller;
3803
4062
  this.options = options;
3804
4063
  }
3805
4064
 
3806
4065
 
3807
- __init40() {this.session = null}
3808
- __init41() {this.dragStart = null}
3809
- __init42() {this.error = null}
4066
+ __init41() {this.session = null}
4067
+ __init42() {this.dragStart = null}
4068
+ __init43() {this.error = null}
3810
4069
  down(p, mods = {}) {
3811
4070
  this.error = null;
3812
4071
  const hit = typeLayerAt(this.controller, p);
@@ -3854,7 +4113,7 @@ var TypeToolGesture = (_class8 = class {
3854
4113
  finish() {
3855
4114
  const s = this.session;
3856
4115
  this.session = null;
3857
- _optionalChain([s, 'optionalAccess', _76 => _76.close, 'call', _77 => _77()]);
4116
+ _optionalChain([s, 'optionalAccess', _80 => _80.close, 'call', _81 => _81()]);
3858
4117
  }
3859
4118
  }, _class8);
3860
4119
 
@@ -4206,7 +4465,7 @@ function segmentToSelection(width, height, result) {
4206
4465
  const sized = raw.width === width && raw.height === height ? raw : _chunkSS53NNZOcjs.resizeSelection.call(void 0, raw, width, height);
4207
4466
  out = _chunkSS53NNZOcjs.combineSelections.call(void 0, out, sized, "add");
4208
4467
  }
4209
- return _optionalChain([out, 'optionalAccess', _78 => _78.bounds]) ? out : null;
4468
+ return _optionalChain([out, 'optionalAccess', _82 => _82.bounds]) ? out : null;
4210
4469
  }
4211
4470
  function segmentsToSelection(width, height, results) {
4212
4471
  let out = null;
@@ -4255,7 +4514,7 @@ function deserializeChannels(value, size, problems = []) {
4255
4514
  visible: v.visible === true
4256
4515
  });
4257
4516
  } catch (err) {
4258
- problems.push(`Alpha channel "${String(_nullishCoalesce(_optionalChain([v, 'optionalAccess', _79 => _79.name]), () => ( "?")))}" could not be read: ${err instanceof Error ? err.message : String(err)}.`);
4517
+ problems.push(`Alpha channel "${String(_nullishCoalesce(_optionalChain([v, 'optionalAccess', _83 => _83.name]), () => ( "?")))}" could not be read: ${err instanceof Error ? err.message : String(err)}.`);
4259
4518
  }
4260
4519
  }
4261
4520
  return out;
@@ -4293,16 +4552,16 @@ function checkEffectTime(time) {
4293
4552
  return time;
4294
4553
  }
4295
4554
  function checkEffectAnimation(animate) {
4296
- const duration = _optionalChain([animate, 'optionalAccess', _80 => _80.duration]);
4555
+ const duration = _optionalChain([animate, 'optionalAccess', _84 => _84.duration]);
4297
4556
  if (!(typeof duration === "number" && Number.isFinite(duration) && duration > 0 && duration <= _chunkS55JFWDAcjs.MAX_EFFECT_ANIMATION_MS)) {
4298
4557
  throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`animate.duration must be more than 0 and at most ${_chunkS55JFWDAcjs.MAX_EFFECT_ANIMATION_MS} ms.`);
4299
4558
  }
4300
4559
  return { duration: Math.round(duration) };
4301
4560
  }
4302
4561
  function effectLayerTiming(g, d) {
4303
- if (!_optionalChain([d, 'optionalAccess', _81 => _81.duration])) return null;
4562
+ if (!_optionalChain([d, 'optionalAccess', _85 => _85.duration])) return null;
4304
4563
  const time = _nullishCoalesce(g.time, () => ( 0));
4305
- return { mode: g.animate ? "animate" : "still", time, range: Math.max(d.duration, time), duration: _nullishCoalesce(_optionalChain([g, 'access', _82 => _82.animate, 'optionalAccess', _83 => _83.duration]), () => ( d.duration)), loops: d.loop };
4564
+ return { mode: g.animate ? "animate" : "still", time, range: Math.max(d.duration, time), duration: _nullishCoalesce(_optionalChain([g, 'access', _86 => _86.animate, 'optionalAccess', _87 => _87.duration]), () => ( d.duration)), loops: d.loop };
4306
4565
  }
4307
4566
 
4308
4567
  // src/image-editor/effects.ts
@@ -4349,16 +4608,16 @@ function effectPixelsToSurface(p, depth) {
4349
4608
  }
4350
4609
  var ImageEffectsEngine = (_class9 = class {
4351
4610
 
4352
- __init43() {this.cache = /* @__PURE__ */ new Map()}
4353
- __init44() {this.pending = /* @__PURE__ */ new Map()}
4354
- __init45() {this.failures = /* @__PURE__ */ new Map()}
4611
+ __init44() {this.cache = /* @__PURE__ */ new Map()}
4612
+ __init45() {this.pending = /* @__PURE__ */ new Map()}
4613
+ __init46() {this.failures = /* @__PURE__ */ new Map()}
4355
4614
 
4356
- __init46() {this.descriptions = /* @__PURE__ */ new Map()}
4357
- __init47() {this.listeners = /* @__PURE__ */ new Set()}
4615
+ __init47() {this.descriptions = /* @__PURE__ */ new Map()}
4616
+ __init48() {this.listeners = /* @__PURE__ */ new Set()}
4358
4617
 
4359
- __init48() {this.generation = 0}
4618
+ __init49() {this.generation = 0}
4360
4619
 
4361
- constructor(options = {}) {;_class9.prototype.__init43.call(this);_class9.prototype.__init44.call(this);_class9.prototype.__init45.call(this);_class9.prototype.__init46.call(this);_class9.prototype.__init47.call(this);_class9.prototype.__init48.call(this);
4620
+ constructor(options = {}) {;_class9.prototype.__init44.call(this);_class9.prototype.__init45.call(this);_class9.prototype.__init46.call(this);_class9.prototype.__init47.call(this);_class9.prototype.__init48.call(this);_class9.prototype.__init49.call(this);
4362
4621
  this.slot = _nullishCoalesce(options.slot, () => ( new (0, _chunkA3A5TI6Rcjs.EffectsSlot)()));
4363
4622
  this.maxEntries = _nullishCoalesce(options.maxEntries, () => ( 24));
4364
4623
  this.pool = new (0, _chunkPY4GWSE2cjs.EffectRendererPool)({ maxRenderers: options.maxRenderers });
@@ -4550,19 +4809,19 @@ function liftMask(mask, sel, o) {
4550
4809
  return { lifted: _chunk474IQG74cjs.surfaceFromPixels.call(void 0, { width: area.width, height: area.height, data: lifted }, 4, area.x, area.y), rest: _chunk474IQG74cjs.writeRegion.call(void 0, mask, area, rest) };
4551
4810
  }
4552
4811
  var FreeTransformSession = (_class10 = class {
4553
- constructor(host, init = {}) {;_class10.prototype.__init49.call(this);_class10.prototype.__init50.call(this);_class10.prototype.__init51.call(this);_class10.prototype.__init52.call(this);_class10.prototype.__init53.call(this);_class10.prototype.__init54.call(this);_class10.prototype.__init55.call(this);_class10.prototype.__init56.call(this);_class10.prototype.__init57.call(this);_class10.prototype.__init58.call(this);_class10.prototype.__init59.call(this);
4812
+ constructor(host, init = {}) {;_class10.prototype.__init50.call(this);_class10.prototype.__init51.call(this);_class10.prototype.__init52.call(this);_class10.prototype.__init53.call(this);_class10.prototype.__init54.call(this);_class10.prototype.__init55.call(this);_class10.prototype.__init56.call(this);_class10.prototype.__init57.call(this);_class10.prototype.__init58.call(this);_class10.prototype.__init59.call(this);_class10.prototype.__init60.call(this);
4554
4813
  this.host = host;
4555
4814
  if (init.interpolation !== void 0 && !_chunkB46UQUDCcjs.isInterpolation.call(void 0, init.interpolation)) fail(`Unknown interpolation "${String(init.interpolation)}"; use nearest, bilinear or bicubic.`);
4556
4815
  this.interp = _nullishCoalesce(init.interpolation, () => ( "bicubic"));
4557
4816
  const sel = host.selection();
4558
- const selected = Boolean(_optionalChain([sel, 'optionalAccess', _84 => _84.bounds]));
4817
+ const selected = Boolean(_optionalChain([sel, 'optionalAccess', _88 => _88.bounds]));
4559
4818
  let content = _nullishCoalesce(init.content, () => ( "auto"));
4560
4819
  if (!["auto", "layer", "selection", "selection-copy", "selection-outline"].includes(content)) {
4561
4820
  fail(`Unknown content "${String(content)}"; use auto, layer, selection, selection-copy or selection-outline.`);
4562
4821
  }
4563
4822
  const targetId = _nullishCoalesce(init.layerId, () => ( host.activeLayerId()));
4564
- const target = targetId && content !== "selection-outline" ? _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, host.layers(), targetId), 'optionalAccess', _85 => _85.layer]) : void 0;
4565
- const smartTarget = (_optionalChain([target, 'optionalAccess', _86 => _86.type]) === "smart" || _optionalChain([target, 'optionalAccess', _87 => _87.type]) === "shape" || _optionalChain([target, 'optionalAccess', _88 => _88.type]) === "type") && (_nullishCoalesce(init.channel, () => ( (target.id === host.activeLayerId() ? host.activeTarget() : "pixels")))) !== "mask";
4823
+ const target = targetId && content !== "selection-outline" ? _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, host.layers(), targetId), 'optionalAccess', _89 => _89.layer]) : void 0;
4824
+ const smartTarget = (_optionalChain([target, 'optionalAccess', _90 => _90.type]) === "smart" || _optionalChain([target, 'optionalAccess', _91 => _91.type]) === "shape" || _optionalChain([target, 'optionalAccess', _92 => _92.type]) === "type") && (_nullishCoalesce(init.channel, () => ( (target.id === host.activeLayerId() ? host.activeTarget() : "pixels")))) !== "mask";
4566
4825
  if (content === "auto") content = selected && !smartTarget ? "selection" : "layer";
4567
4826
  this.content = content;
4568
4827
  if (content !== "layer" && !selected) fail(`Nothing is selected; ${content} needs a selection. Select first, or use content layer.`);
@@ -4586,9 +4845,9 @@ var FreeTransformSession = (_class10 = class {
4586
4845
  const mask = layer.mask && !layer.mask.source ? layer.mask : void 0;
4587
4846
  const channel = _nullishCoalesce(init.channel, () => ( (layer.id === host.activeLayerId() ? host.activeTarget() : "pixels")));
4588
4847
  if (channel !== "pixels" && channel !== "mask") fail(`Unknown channel "${String(channel)}"; use pixels or mask.`);
4589
- const linked = _optionalChain([mask, 'optionalAccess', _89 => _89.linked]) !== false;
4848
+ const linked = _optionalChain([mask, 'optionalAccess', _93 => _93.linked]) !== false;
4590
4849
  const maskAlone = channel === "mask" && (!linked || layer.type !== "pixel");
4591
- if (channel === "mask" && !mask) fail(_optionalChain([layer, 'access', _90 => _90.mask, 'optionalAccess', _91 => _91.source]) ? `Layer "${layer.name || id}" has a depth mask, which is generated, not transformed.` : `Layer "${layer.name || id}" has no mask to transform; add one with add_layer_mask, or transform its pixels.`);
4850
+ if (channel === "mask" && !mask) fail(_optionalChain([layer, 'access', _94 => _94.mask, 'optionalAccess', _95 => _95.source]) ? `Layer "${layer.name || id}" has a depth mask, which is generated, not transformed.` : `Layer "${layer.name || id}" has no mask to transform; add one with add_layer_mask, or transform its pixels.`);
4592
4851
  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.`);
4593
4852
  if (!layer.visible && content !== "selection-copy") fail(`Layer "${layer.name || id}" is hidden; show it before you transform it.`);
4594
4853
  if (content !== "selection-copy") {
@@ -4691,7 +4950,7 @@ var FreeTransformSession = (_class10 = class {
4691
4950
  };
4692
4951
  this.copyId = copy.id;
4693
4952
  const loc = _chunkB46UQUDCcjs.findLayer.call(void 0, layers, layer.id);
4694
- this.startLayers = _chunkB46UQUDCcjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _92 => _92.parent, 'optionalAccess', _93 => _93.id]), () => ( null)), loc.index + 1);
4953
+ this.startLayers = _chunkB46UQUDCcjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _96 => _96.parent, 'optionalAccess', _97 => _97.id]), () => ( null)), loc.index + 1);
4695
4954
  this.parts.push({ what: "pixels", offset: o, moving: lifted, base: null, reduced: /* @__PURE__ */ new Map() });
4696
4955
  moves.push("pixels");
4697
4956
  }
@@ -4717,7 +4976,7 @@ var FreeTransformSession = (_class10 = class {
4717
4976
  /** The layer being transformed (`null` for `selection-outline`). */
4718
4977
 
4719
4978
  /** The new layer of a `selection-copy`. */
4720
- __init49() {this.copyId = null}
4979
+ __init50() {this.copyId = null}
4721
4980
  /** The frame (document pixels). */
4722
4981
 
4723
4982
  /** What moves. */
@@ -4729,27 +4988,27 @@ var FreeTransformSession = (_class10 = class {
4729
4988
  */
4730
4989
 
4731
4990
  /** True when the layer is a smart object (the transform sets its placement). */
4732
- __init50() {this.smartObject = false}
4991
+ __init51() {this.smartObject = false}
4733
4992
  /** True when the layer is a shape layer (the transform maps its paths and renders them again). */
4734
- __init51() {this.shapeLayer = false}
4735
- __init52() {this.shape = null}
4993
+ __init52() {this.shapeLayer = false}
4994
+ __init53() {this.shape = null}
4736
4995
  /** True when the layer is a type layer (the transform sets its text matrix; affine only). */
4737
- __init53() {this.typeLayer = false}
4738
- __init54() {this.typeTarget = null}
4996
+ __init54() {this.typeLayer = false}
4997
+ __init55() {this.typeTarget = null}
4739
4998
 
4740
- __init55() {this.smart = null}
4741
- __init56() {this.smartReduced = /* @__PURE__ */ new Map()}
4999
+ __init56() {this.smart = null}
5000
+ __init57() {this.smartReduced = /* @__PURE__ */ new Map()}
4742
5001
 
4743
- __init57() {this.smartMasksMoved = false}
5002
+ __init58() {this.smartMasksMoved = false}
4744
5003
 
4745
- __init58() {this.parts = []}
5004
+ __init59() {this.parts = []}
4746
5005
 
4747
5006
 
4748
5007
 
4749
5008
 
4750
5009
  /** The stack this session last showed: anything else means the document changed under it. */
4751
5010
 
4752
- __init59() {this.closed = false}
5011
+ __init60() {this.closed = false}
4753
5012
  /** The current geometry. */
4754
5013
  get geometry() {
4755
5014
  return this.geometryValue;
@@ -4800,7 +5059,7 @@ var FreeTransformSession = (_class10 = class {
4800
5059
  moveVectorMask(layers) {
4801
5060
  const g = this.geometryValue;
4802
5061
  if (!this.layerId || this.copyId || !this.moves.includes("pixels") || _chunkS55JFWDAcjs.isIdentityTransform.call(void 0, g)) return layers;
4803
- const vm = _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, layers, this.layerId), 'optionalAccess', _94 => _94.layer, 'access', _95 => _95.vectorMask]);
5062
+ const vm = _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, layers, this.layerId), 'optionalAccess', _98 => _98.layer, 'access', _99 => _99.vectorMask]);
4804
5063
  if (!vm || vm.linked === false) return layers;
4805
5064
  const warp = _chunkS55JFWDAcjs.hasWarp.call(void 0, g);
4806
5065
  const f = warp ? _chunkS55JFWDAcjs.transformMap.call(void 0, g) : null;
@@ -4971,11 +5230,11 @@ var FreeTransformSession = (_class10 = class {
4971
5230
  result(changed, layers, selection) {
4972
5231
  let bounds = null;
4973
5232
  const id = _nullishCoalesce(this.copyId, () => ( this.layerId));
4974
- const layer = id ? _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, layers, id), 'optionalAccess', _96 => _96.layer]) : void 0;
4975
- if (this.moves.includes("pixels") && _optionalChain([layer, 'optionalAccess', _97 => _97.type]) === "pixel") bounds = toDoc(_chunk474IQG74cjs.contentBounds.call(void 0, this.host.pixelsOf(layer)), layer.offset);
4976
- else if (this.moves.includes("pixels") && (_optionalChain([layer, 'optionalAccess', _98 => _98.type]) === "smart" || _optionalChain([layer, 'optionalAccess', _99 => _99.type]) === "shape" || _optionalChain([layer, 'optionalAccess', _100 => _100.type]) === "type")) bounds = _chunk474IQG74cjs.contentBounds.call(void 0, layer.surface);
4977
- else if (this.moves.includes("mask") && _optionalChain([layer, 'optionalAccess', _101 => _101.mask])) bounds = toDoc(_chunk474IQG74cjs.contentBounds.call(void 0, layer.mask.surface), layer.type === "pixel" ? layer.offset : { x: 0, y: 0 });
4978
- else if (this.moves.includes("selection")) bounds = _optionalChain([selection, 'optionalAccess', _102 => _102.bounds]) ? { ...selection.bounds } : null;
5233
+ const layer = id ? _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, layers, id), 'optionalAccess', _100 => _100.layer]) : void 0;
5234
+ if (this.moves.includes("pixels") && _optionalChain([layer, 'optionalAccess', _101 => _101.type]) === "pixel") bounds = toDoc(_chunk474IQG74cjs.contentBounds.call(void 0, this.host.pixelsOf(layer)), layer.offset);
5235
+ else if (this.moves.includes("pixels") && (_optionalChain([layer, 'optionalAccess', _102 => _102.type]) === "smart" || _optionalChain([layer, 'optionalAccess', _103 => _103.type]) === "shape" || _optionalChain([layer, 'optionalAccess', _104 => _104.type]) === "type")) bounds = _chunk474IQG74cjs.contentBounds.call(void 0, layer.surface);
5236
+ else if (this.moves.includes("mask") && _optionalChain([layer, 'optionalAccess', _105 => _105.mask])) bounds = toDoc(_chunk474IQG74cjs.contentBounds.call(void 0, layer.mask.surface), layer.type === "pixel" ? layer.offset : { x: 0, y: 0 });
5237
+ else if (this.moves.includes("selection")) bounds = _optionalChain([selection, 'optionalAccess', _106 => _106.bounds]) ? { ...selection.bounds } : null;
4979
5238
  return {
4980
5239
  layerId: _nullishCoalesce(this.copyId, () => ( this.layerId)),
4981
5240
  content: this.content,
@@ -5004,7 +5263,7 @@ function deserializeColorMode(raw, problems) {
5004
5263
  }
5005
5264
  function effectiveProof(proof, mode) {
5006
5265
  if (proof) return proof;
5007
- if (_optionalChain([mode, 'optionalAccess', _103 => _103.mode]) === "cmyk") return { ...DEFAULT_PROOF, profile: mode.profile, intent: mode.intent };
5266
+ if (_optionalChain([mode, 'optionalAccess', _107 => _107.mode]) === "cmyk") return { ...DEFAULT_PROOF, profile: mode.profile, intent: mode.intent };
5008
5267
  return null;
5009
5268
  }
5010
5269
  function colorModePlanes(doc, mode) {
@@ -5059,7 +5318,7 @@ function resolveProfile(doc) {
5059
5318
  return p;
5060
5319
  }
5061
5320
  function profileBytes(doc) {
5062
- if (_optionalChain([doc, 'optionalAccess', _104 => _104.icc])) return doc.icc;
5321
+ if (_optionalChain([doc, 'optionalAccess', _108 => _108.icc])) return doc.icc;
5063
5322
  const p = resolveProfile(doc);
5064
5323
  return _nullishCoalesce(p.bytes, () => ( _chunkBROJYMWUcjs.encodeProfile.call(void 0, p)));
5065
5324
  }
@@ -5076,7 +5335,7 @@ function isSrgb(doc) {
5076
5335
  if (!doc || doc.builtin === "srgb") return true;
5077
5336
  try {
5078
5337
  return _chunkBROJYMWUcjs.sameColors.call(void 0, resolveProfile(doc), _chunkBROJYMWUcjs.srgbProfile.call(void 0, ), _chunkBROJYMWUcjs.builtinProfile.call(void 0, "lab-d50"));
5079
- } catch (e21) {
5338
+ } catch (e22) {
5080
5339
  return false;
5081
5340
  }
5082
5341
  }
@@ -5221,7 +5480,7 @@ function paintCoverageInto(base, coverage, apply, rects, depth = null) {
5221
5480
  else tiles.delete(key2);
5222
5481
  continue;
5223
5482
  }
5224
- const src = _nullishCoalesce(_optionalChain([base, 'access', _105 => _105.tiles, 'access', _106 => _106.get, 'call', _107 => _107(key2), 'optionalAccess', _108 => _108.data]), () => ( defaultTile(base)));
5483
+ const src = _nullishCoalesce(_optionalChain([base, 'access', _109 => _109.tiles, 'access', _110 => _110.get, 'call', _111 => _111(key2), 'optionalAccess', _112 => _112.data]), () => ( defaultTile(base)));
5225
5484
  const data = _chunkPQ3H2AANcjs.applyStrokeToTile.call(void 0, coverage, src, base.channels, t.tx, t.ty, apply);
5226
5485
  const tile = _chunk474IQG74cjs.finishTile.call(void 0, data, base.channels, base.defaultValue);
5227
5486
  if (tile) tiles.set(key2, tile);
@@ -5236,7 +5495,7 @@ function defaultTile(s) {
5236
5495
  return d;
5237
5496
  }
5238
5497
  var PaintStrokeSession = (_class11 = class {
5239
- constructor(controller, target, stroke, apply, depth = null) {;_class11.prototype.__init60.call(this);_class11.prototype.__init61.call(this);_class11.prototype.__init62.call(this);_class11.prototype.__init63.call(this);_class11.prototype.__init64.call(this);_class11.prototype.__init65.call(this);_class11.prototype.__init66.call(this);_class11.prototype.__init67.call(this);_class11.prototype.__init68.call(this);_class11.prototype.__init69.call(this);_class11.prototype.__init70.call(this);
5498
+ constructor(controller, target, stroke, apply, depth = null) {;_class11.prototype.__init61.call(this);_class11.prototype.__init62.call(this);_class11.prototype.__init63.call(this);_class11.prototype.__init64.call(this);_class11.prototype.__init65.call(this);_class11.prototype.__init66.call(this);_class11.prototype.__init67.call(this);_class11.prototype.__init68.call(this);_class11.prototype.__init69.call(this);_class11.prototype.__init70.call(this);_class11.prototype.__init71.call(this);
5240
5499
  this.controller = controller;
5241
5500
  this.target = target;
5242
5501
  this.apply = apply;
@@ -5273,28 +5532,28 @@ var PaintStrokeSession = (_class11 = class {
5273
5532
 
5274
5533
 
5275
5534
 
5276
- __init60() {this.touched = /* @__PURE__ */ new Set()}
5535
+ __init61() {this.touched = /* @__PURE__ */ new Set()}
5277
5536
 
5278
5537
 
5279
- __init61() {this.mixerInit = null}
5280
- __init62() {this.retouch = null}
5538
+ __init62() {this.mixerInit = null}
5539
+ __init63() {this.retouch = null}
5281
5540
  /** Writes a mask's RGBA view back (sequential retouching on a mask). */
5282
- __init63() {this.flushView = null}
5283
- __init64() {this.started = false}
5541
+ __init64() {this.flushView = null}
5542
+ __init65() {this.started = false}
5284
5543
  /** Mixer tiles written since the last update: they get new tile objects so the compositor sees them change. */
5285
- __init65() {this.fresh = /* @__PURE__ */ new Set()}
5286
- __init66() {this.last = null}
5287
- __init67() {this.closed = false}
5544
+ __init66() {this.fresh = /* @__PURE__ */ new Set()}
5545
+ __init67() {this.last = null}
5546
+ __init68() {this.closed = false}
5288
5547
  /** Brush and eraser strokes on a 16- or 32-bit document: the deep samples of each touched tile. */
5289
5548
 
5290
- __init68() {this.liveDeep = /* @__PURE__ */ new Map()}
5549
+ __init69() {this.liveDeep = /* @__PURE__ */ new Map()}
5291
5550
  /**
5292
5551
  * Mixer Brush, Smudge and Sponge on a 16- or 32-bit layer: they read and write float working
5293
5552
  * tiles on the 8-bit 0..255 sRGB-encoded scale, which keep the fractions bytes would round away.
5294
5553
  */
5295
5554
 
5296
- __init69() {this.work = /* @__PURE__ */ new Map()}
5297
- __init70() {this.workRead = /* @__PURE__ */ new Map()}
5555
+ __init70() {this.work = /* @__PURE__ */ new Map()}
5556
+ __init71() {this.workRead = /* @__PURE__ */ new Map()}
5298
5557
  /** The pre-stroke tile as a float working tile (cached; `null`: transparent). */
5299
5558
  readWork(key2) {
5300
5559
  if (!this.workRead.has(key2)) this.workRead.set(key2, workTileOf(this.base.tiles.get(key2)));
@@ -5334,7 +5593,7 @@ var PaintStrokeSession = (_class11 = class {
5334
5593
  writeTile: (tx, ty) => {
5335
5594
  const key2 = _chunk474IQG74cjs.tileKey.call(void 0, tx, ty);
5336
5595
  if (!this.touched.has(key2)) {
5337
- this.work.set(key2, _nullishCoalesce(_optionalChain([read, 'call', _109 => _109(key2), 'optionalAccess', _110 => _110.slice, 'call', _111 => _111()]), () => ( new Float32Array(_chunk474IQG74cjs.TILE * _chunk474IQG74cjs.TILE * 4))));
5596
+ this.work.set(key2, _nullishCoalesce(_optionalChain([read, 'call', _113 => _113(key2), 'optionalAccess', _114 => _114.slice, 'call', _115 => _115()]), () => ( new Float32Array(_chunk474IQG74cjs.TILE * _chunk474IQG74cjs.TILE * 4))));
5338
5597
  this.touched.add(key2);
5339
5598
  }
5340
5599
  this.fresh.add(key2);
@@ -5346,11 +5605,11 @@ var PaintStrokeSession = (_class11 = class {
5346
5605
  offset: a.offset,
5347
5606
  lockTransparency: a.lockTransparency,
5348
5607
  selection: a.selection,
5349
- readTile: (tx, ty) => _nullishCoalesce(_optionalChain([this, 'access', _112 => _112.live, 'access', _113 => _113.get, 'call', _114 => _114(_chunk474IQG74cjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _115 => _115.data]), () => ( (this.base.defaultValue ? defaultTile(this.base) : null))),
5608
+ readTile: (tx, ty) => _nullishCoalesce(_optionalChain([this, 'access', _116 => _116.live, 'access', _117 => _117.get, 'call', _118 => _118(_chunk474IQG74cjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _119 => _119.data]), () => ( (this.base.defaultValue ? defaultTile(this.base) : null))),
5350
5609
  writeTile: (tx, ty) => {
5351
5610
  const key2 = _chunk474IQG74cjs.tileKey.call(void 0, tx, ty);
5352
5611
  if (!this.touched.has(key2)) {
5353
- const src = _nullishCoalesce(_optionalChain([this, 'access', _116 => _116.base, 'access', _117 => _117.tiles, 'access', _118 => _118.get, 'call', _119 => _119(key2), 'optionalAccess', _120 => _120.data]), () => ( defaultTile(this.base)));
5612
+ const src = _nullishCoalesce(_optionalChain([this, 'access', _120 => _120.base, 'access', _121 => _121.tiles, 'access', _122 => _122.get, 'call', _123 => _123(key2), 'optionalAccess', _124 => _124.data]), () => ( defaultTile(this.base)));
5354
5613
  this.live.set(key2, { data: new Uint8ClampedArray(src), uniform: null });
5355
5614
  this.touched.add(key2);
5356
5615
  }
@@ -5367,11 +5626,11 @@ var PaintStrokeSession = (_class11 = class {
5367
5626
  if (this.closed || !points.length) return;
5368
5627
  if (!this.started) {
5369
5628
  this.started = true;
5370
- if (_optionalChain([this, 'access', _121 => _121.retouch, 'optionalAccess', _122 => _122.kind]) === "coverage") this.retouch.start(points[0]);
5629
+ if (_optionalChain([this, 'access', _125 => _125.retouch, 'optionalAccess', _126 => _126.kind]) === "coverage") this.retouch.start(points[0]);
5371
5630
  }
5372
5631
  this.last = points[points.length - 1];
5373
5632
  const rects = this.mixer ? this.mixer.push(points) : this.stroke.push(points);
5374
- _optionalChain([this, 'access', _123 => _123.flushView, 'optionalCall', _124 => _124()]);
5633
+ _optionalChain([this, 'access', _127 => _127.flushView, 'optionalCall', _128 => _128()]);
5375
5634
  this.update(rects);
5376
5635
  }
5377
5636
  update(rects) {
@@ -5401,7 +5660,7 @@ var PaintStrokeSession = (_class11 = class {
5401
5660
  for (const [key2, { tx, ty, r }] of regions2) {
5402
5661
  if (this.deep) {
5403
5662
  const rt = this.retouch;
5404
- const paint = _optionalChain([rt, 'optionalAccess', _125 => _125.kind]) === "coverage" ? rt.paint() : null;
5663
+ const paint = _optionalChain([rt, 'optionalAccess', _129 => _129.kind]) === "coverage" ? rt.paint() : null;
5405
5664
  if (paint && paint.kind !== "tone") {
5406
5665
  const prevWork = this.touched.has(key2) ? this.work.get(key2) : void 0;
5407
5666
  this.touched.add(key2);
@@ -5412,13 +5671,13 @@ var PaintStrokeSession = (_class11 = class {
5412
5671
  const prev2 = this.touched.has(key2) ? this.liveDeep.get(key2) : void 0;
5413
5672
  this.touched.add(key2);
5414
5673
  const opts = prev2 ? { into: prev2, region: r, channels: ch } : { channels: ch };
5415
- const d = _optionalChain([rt, 'optionalAccess', _126 => _126.kind]) === "coverage" && _optionalChain([paint, 'optionalAccess', _127 => _127.kind]) === "tone" ? _chunkYF3YZZ6Gcjs.applyToneToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, paint.tone, rt.apply, opts) : _chunkPQ3H2AANcjs.applyStrokeToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, this.apply, opts);
5674
+ const d = _optionalChain([rt, 'optionalAccess', _130 => _130.kind]) === "coverage" && _optionalChain([paint, 'optionalAccess', _131 => _131.kind]) === "tone" ? _chunkYF3YZZ6Gcjs.applyToneToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, paint.tone, rt.apply, opts) : _chunkPQ3H2AANcjs.applyStrokeToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, this.apply, opts);
5416
5675
  this.liveDeep.set(key2, d);
5417
5676
  this.live.set(key2, { data: _chunkOLNIPTB3cjs.proxyOf.call(void 0, d, ch), uniform: null, deep: d });
5418
5677
  continue;
5419
5678
  }
5420
- const src = _nullishCoalesce(_optionalChain([this, 'access', _128 => _128.base, 'access', _129 => _129.tiles, 'access', _130 => _130.get, 'call', _131 => _131(key2), 'optionalAccess', _132 => _132.data]), () => ( defaultTile(this.base)));
5421
- const prev = this.touched.has(key2) ? _optionalChain([this, 'access', _133 => _133.live, 'access', _134 => _134.get, 'call', _135 => _135(key2), 'optionalAccess', _136 => _136.data]) : void 0;
5679
+ const src = _nullishCoalesce(_optionalChain([this, 'access', _132 => _132.base, 'access', _133 => _133.tiles, 'access', _134 => _134.get, 'call', _135 => _135(key2), 'optionalAccess', _136 => _136.data]), () => ( defaultTile(this.base)));
5680
+ const prev = this.touched.has(key2) ? _optionalChain([this, 'access', _137 => _137.live, 'access', _138 => _138.get, 'call', _139 => _139(key2), 'optionalAccess', _140 => _140.data]) : void 0;
5422
5681
  this.touched.add(key2);
5423
5682
  const data = this.compositeTile(src, tx, ty, prev ? { into: prev, region: r } : {});
5424
5683
  this.live.set(key2, { data, uniform: null });
@@ -5430,12 +5689,12 @@ var PaintStrokeSession = (_class11 = class {
5430
5689
  if (this.closed) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("This stroke has already ended.");
5431
5690
  const last = _nullishCoalesce(this.last, () => ( void 0));
5432
5691
  const rects = this.mixer ? this.mixer.finish(last) : this.stroke.finish(last);
5433
- _optionalChain([this, 'access', _137 => _137.flushView, 'optionalCall', _138 => _138()]);
5692
+ _optionalChain([this, 'access', _141 => _141.flushView, 'optionalCall', _142 => _142()]);
5434
5693
  this.update(rects);
5435
5694
  this.closed = true;
5436
5695
  const ch = this.base.channels;
5437
5696
  const r = this.retouch;
5438
- if (_optionalChain([r, 'optionalAccess', _139 => _139.kind]) === "coverage" && r.finalPaint) {
5697
+ if (_optionalChain([r, 'optionalAccess', _143 => _143.kind]) === "coverage" && r.finalPaint) {
5439
5698
  const final = r.finalPaint(this.stroke.coverage);
5440
5699
  if (final) {
5441
5700
  for (const key2 of this.touched) {
@@ -5444,7 +5703,7 @@ var PaintStrokeSession = (_class11 = class {
5444
5703
  this.retouchDeepTile(key2, tx, ty, final, {});
5445
5704
  continue;
5446
5705
  }
5447
- const src = _nullishCoalesce(_optionalChain([this, 'access', _140 => _140.base, 'access', _141 => _141.tiles, 'access', _142 => _142.get, 'call', _143 => _143(key2), 'optionalAccess', _144 => _144.data]), () => ( defaultTile(this.base)));
5706
+ const src = _nullishCoalesce(_optionalChain([this, 'access', _144 => _144.base, 'access', _145 => _145.tiles, 'access', _146 => _146.get, 'call', _147 => _147(key2), 'optionalAccess', _148 => _148.data]), () => ( defaultTile(this.base)));
5448
5707
  this.live.set(key2, { data: this.compositeTile(src, tx, ty, {}, final), uniform: null });
5449
5708
  }
5450
5709
  }
@@ -5466,7 +5725,7 @@ var PaintStrokeSession = (_class11 = class {
5466
5725
  const b = this.mixer ? this.mixer.bounds : this.stroke.coverage.bounds;
5467
5726
  const result = { layerId: this.target.id, channel: this.target.channel, bounds: changed ? b : null, dabs: (_nullishCoalesce(this.mixer, () => ( this.stroke))).dabCount };
5468
5727
  if (mixerLoad) result.mixerLoad = mixerLoad;
5469
- if (_optionalChain([r, 'optionalAccess', _145 => _145.result])) Object.assign(result, r.result());
5728
+ if (_optionalChain([r, 'optionalAccess', _149 => _149.result])) Object.assign(result, r.result());
5470
5729
  return result;
5471
5730
  }
5472
5731
  /** Abandons the stroke and restores the layer. */
@@ -5592,14 +5851,14 @@ function migrateSerializedImageEditorState(data) {
5592
5851
  const legacy = data;
5593
5852
  const adjustments = normalizeStoredAdjustments(legacy.adjustments);
5594
5853
  return {
5595
- version: _optionalChain([adjustments, 'access', _146 => _146.layers, 'optionalAccess', _147 => _147.length]) ? 2 : 1,
5854
+ version: _optionalChain([adjustments, 'access', _150 => _150.layers, 'optionalAccess', _151 => _151.length]) ? 2 : 1,
5596
5855
  crop: legacy.crop ? { ...legacy.crop } : null,
5597
5856
  transform: { ...DEFAULT_TRANSFORM, ...legacy.transform },
5598
5857
  adjustments: serializeAdjustments(adjustments),
5599
5858
  depthMask: {
5600
5859
  ...DEFAULT_DEPTH_MASK,
5601
5860
  ...legacy.depthMask,
5602
- depthRange: [..._nullishCoalesce(_optionalChain([legacy, 'access', _148 => _148.depthMask, 'optionalAccess', _149 => _149.depthRange]), () => ( DEFAULT_DEPTH_MASK.depthRange))]
5861
+ depthRange: [..._nullishCoalesce(_optionalChain([legacy, 'access', _152 => _152.depthMask, 'optionalAccess', _153 => _153.depthRange]), () => ( DEFAULT_DEPTH_MASK.depthRange))]
5603
5862
  },
5604
5863
  annotations: JSON.parse(JSON.stringify(_nullishCoalesce(legacy.annotations, () => ( [])))),
5605
5864
  ...legacy.selection ? { selection: { ...legacy.selection } } : {}
@@ -5631,35 +5890,35 @@ var DEVELOP_KEYS = ["brightness", "contrast", "saturation", "exposure", "tempera
5631
5890
  var ImageEditorController = (_class12 = class {
5632
5891
 
5633
5892
 
5634
- __init71() {this.imageElement = null}
5635
- __init72() {this.listeners = /* @__PURE__ */ new Set()}
5636
- __init73() {this.histogramListeners = /* @__PURE__ */ new Set()}
5893
+ __init72() {this.imageElement = null}
5894
+ __init73() {this.listeners = /* @__PURE__ */ new Set()}
5895
+ __init74() {this.histogramListeners = /* @__PURE__ */ new Set()}
5637
5896
 
5638
5897
  // History stacks
5639
- __init74() {this.undoStack = []}
5640
- __init75() {this.redoStack = []}
5898
+ __init75() {this.undoStack = []}
5899
+ __init76() {this.redoStack = []}
5641
5900
 
5642
5901
 
5643
- __init76() {this.isApplyingHistory = false}
5902
+ __init77() {this.isApplyingHistory = false}
5644
5903
 
5645
5904
  /** Pixels the selection tools sample (host-provided or read back from the source). */
5646
- __init77() {this.samplePixels = null}
5647
- __init78() {this.samplePixelsOverride = false}
5905
+ __init78() {this.samplePixels = null}
5906
+ __init79() {this.samplePixelsOverride = false}
5648
5907
  /** Decoded source pixels (the Background's surface), by the buffer or element they came from. */
5649
- __init79() {this.sourceSurfaces = /* @__PURE__ */ new WeakMap()}
5650
- __init80() {this.viewKey = []}
5908
+ __init80() {this.sourceSurfaces = /* @__PURE__ */ new WeakMap()}
5909
+ __init81() {this.viewKey = []}
5651
5910
  /** For `compositePixels` and mask evaluation (the renderer keeps its own for the viewport). */
5652
- __init81() {this.compositor = new (0, _chunkS55JFWDAcjs.LayerCompositor)()}
5911
+ __init82() {this.compositor = new (0, _chunkS55JFWDAcjs.LayerCompositor)()}
5653
5912
  /** The segmentation provider behind `selectSubject` (see `setSegmentationProvider`). */
5654
- __init82() {this.segmentation = null}
5655
- __init83() {this.selectionWorker = null}
5656
- __init84() {this.documentOpener = null}
5913
+ __init83() {this.segmentation = null}
5914
+ __init84() {this.selectionWorker = null}
5915
+ __init85() {this.documentOpener = null}
5657
5916
  /** The effects provider slot (see `setEffectsProvider`). */
5658
- __init85() {this.effects = new (0, _chunkA3A5TI6Rcjs.EffectsSlot)()}
5917
+ __init86() {this.effects = new (0, _chunkA3A5TI6Rcjs.EffectsSlot)()}
5659
5918
  /** Renders provider effects: effect smart filter results and effect layers. */
5660
- __init86() {this.effectsEngine = new ImageEffectsEngine({ slot: this.effects })}
5661
- __init87() {this.effectRefresh = "none"}
5662
- constructor(options = {}) {;_class12.prototype.__init71.call(this);_class12.prototype.__init72.call(this);_class12.prototype.__init73.call(this);_class12.prototype.__init74.call(this);_class12.prototype.__init75.call(this);_class12.prototype.__init76.call(this);_class12.prototype.__init77.call(this);_class12.prototype.__init78.call(this);_class12.prototype.__init79.call(this);_class12.prototype.__init80.call(this);_class12.prototype.__init81.call(this);_class12.prototype.__init82.call(this);_class12.prototype.__init83.call(this);_class12.prototype.__init84.call(this);_class12.prototype.__init85.call(this);_class12.prototype.__init86.call(this);_class12.prototype.__init87.call(this);_class12.prototype.__init88.call(this);_class12.prototype.__init89.call(this);_class12.prototype.__init90.call(this);_class12.prototype.__init91.call(this);_class12.prototype.__init92.call(this);_class12.prototype.__init93.call(this);_class12.prototype.__init94.call(this);_class12.prototype.__init95.call(this);_class12.prototype.__init96.call(this);_class12.prototype.__init97.call(this);_class12.prototype.__init98.call(this);_class12.prototype.__init99.call(this);_class12.prototype.__init100.call(this);_class12.prototype.__init101.call(this);_class12.prototype.__init102.call(this);_class12.prototype.__init103.call(this);
5919
+ __init87() {this.effectsEngine = new ImageEffectsEngine({ slot: this.effects })}
5920
+ __init88() {this.effectRefresh = "none"}
5921
+ constructor(options = {}) {;_class12.prototype.__init72.call(this);_class12.prototype.__init73.call(this);_class12.prototype.__init74.call(this);_class12.prototype.__init75.call(this);_class12.prototype.__init76.call(this);_class12.prototype.__init77.call(this);_class12.prototype.__init78.call(this);_class12.prototype.__init79.call(this);_class12.prototype.__init80.call(this);_class12.prototype.__init81.call(this);_class12.prototype.__init82.call(this);_class12.prototype.__init83.call(this);_class12.prototype.__init84.call(this);_class12.prototype.__init85.call(this);_class12.prototype.__init86.call(this);_class12.prototype.__init87.call(this);_class12.prototype.__init88.call(this);_class12.prototype.__init89.call(this);_class12.prototype.__init90.call(this);_class12.prototype.__init91.call(this);_class12.prototype.__init92.call(this);_class12.prototype.__init93.call(this);_class12.prototype.__init94.call(this);_class12.prototype.__init95.call(this);_class12.prototype.__init96.call(this);_class12.prototype.__init97.call(this);_class12.prototype.__init98.call(this);_class12.prototype.__init99.call(this);_class12.prototype.__init100.call(this);_class12.prototype.__init101.call(this);_class12.prototype.__init102.call(this);_class12.prototype.__init103.call(this);_class12.prototype.__init104.call(this);
5663
5922
  this.effects.subscribe(() => this.queueEffectRefresh("all"));
5664
5923
  this.effectsEngine.subscribe(() => this.queueEffectRefresh("incomplete"));
5665
5924
  if (options.effects) this.effects.set(options.effects);
@@ -5679,7 +5938,7 @@ var ImageEditorController = (_class12 = class {
5679
5938
  sourceIsOpaque: () => this.sourceIsOpaque(),
5680
5939
  version: () => `${this.sourceVersion()}:${this.patternsVersion()}`,
5681
5940
  globalLight: () => this.state.globalLight,
5682
- pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _150 => _150.state, 'access', _151 => _151.patterns, 'optionalAccess', _152 => _152.find, 'call', _153 => _153((p) => p.id === id)]), () => ( null))
5941
+ pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _154 => _154.state, 'access', _155 => _155.patterns, 'optionalAccess', _156 => _156.find, 'call', _157 => _157((p) => p.id === id)]), () => ( null))
5683
5942
  };
5684
5943
  this.state = {
5685
5944
  sourceUrl: typeof options.image === "string" ? options.image : null,
@@ -5712,13 +5971,13 @@ var ImageEditorController = (_class12 = class {
5712
5971
  };
5713
5972
  }
5714
5973
  this.applyStored(_nullishCoalesce(options.initialState, () => ( {})));
5715
- if (_optionalChain([options, 'access', _154 => _154.initialState, 'optionalAccess', _155 => _155.selection])) {
5974
+ if (_optionalChain([options, 'access', _158 => _158.initialState, 'optionalAccess', _159 => _159.selection])) {
5716
5975
  try {
5717
5976
  this.state.selection = normalizeSelection(_chunkSS53NNZOcjs.deserializeSelection.call(void 0, options.initialState.selection));
5718
- } catch (e22) {
5977
+ } catch (e23) {
5719
5978
  }
5720
5979
  }
5721
- if (_optionalChain([options, 'access', _156 => _156.initialState, 'optionalAccess', _157 => _157.channels])) {
5980
+ if (_optionalChain([options, 'access', _160 => _160.initialState, 'optionalAccess', _161 => _161.channels])) {
5722
5981
  const channels = deserializeChannels(options.initialState.channels, this.naturalSize, this.lastLoadProblems);
5723
5982
  if (channels.length) this.state.channels = channels;
5724
5983
  }
@@ -5761,7 +6020,7 @@ var ImageEditorController = (_class12 = class {
5761
6020
  height: img.naturalHeight || img.height || 600
5762
6021
  }
5763
6022
  };
5764
- } catch (e23) {
6023
+ } catch (e24) {
5765
6024
  return { sourceUrl: src, element: null, dimensions: { ...this.state.imageDimensions } };
5766
6025
  }
5767
6026
  }
@@ -5794,7 +6053,7 @@ var ImageEditorController = (_class12 = class {
5794
6053
  * Where layer pixels changed since the last viewport render, when only strokes changed them
5795
6054
  * (the renderer then recomposites just those rectangles); `'all'` after any other change.
5796
6055
  */
5797
- __init88() {this.pendingDirty = "all"}
6056
+ __init89() {this.pendingDirty = "all"}
5798
6057
  notify(strokeRects) {
5799
6058
  if (strokeRects) this.docRevision++;
5800
6059
  if (strokeRects && this.pendingDirty !== "all") this.pendingDirty.push(...strokeRects);
@@ -5802,7 +6061,7 @@ var ImageEditorController = (_class12 = class {
5802
6061
  this.syncViews();
5803
6062
  this.syncDisplay();
5804
6063
  const currentState = { ...this.state };
5805
- _optionalChain([this, 'access', _158 => _158.onStateChange, 'optionalCall', _159 => _159(currentState)]);
6064
+ _optionalChain([this, 'access', _162 => _162.onStateChange, 'optionalCall', _163 => _163(currentState)]);
5806
6065
  this.listeners.forEach((l) => l(currentState));
5807
6066
  if (this.effects.provider) this.queueEffectRefresh("incomplete");
5808
6067
  }
@@ -5831,11 +6090,11 @@ var ImageEditorController = (_class12 = class {
5831
6090
  if (l.type === "group") {
5832
6091
  const children = walk(l.children);
5833
6092
  if (children !== l.children) next2 = { ...l, children };
5834
- } else if (l.type === "smart" && _optionalChain([l, 'access', _160 => _160.smartFilters, 'optionalAccess', _161 => _161.filters, 'access', _162 => _162.some, 'call', _163 => _163((f) => f.kind === "effect")]) && (all || _chunkS55JFWDAcjs.isSmartSurfaceIncomplete.call(void 0, l.surface))) {
6093
+ } else if (l.type === "smart" && _optionalChain([l, 'access', _164 => _164.smartFilters, 'optionalAccess', _165 => _165.filters, 'access', _166 => _166.some, 'call', _167 => _167((f) => f.kind === "effect")]) && (all || _chunkS55JFWDAcjs.isSmartSurfaceIncomplete.call(void 0, l.surface))) {
5835
6094
  try {
5836
6095
  const r = _chunkS55JFWDAcjs.rerender.call(void 0, l, canvas);
5837
6096
  if (all || !_chunkS55JFWDAcjs.isSmartSurfaceIncomplete.call(void 0, r.surface)) next2 = r;
5838
- } catch (e24) {
6097
+ } catch (e25) {
5839
6098
  }
5840
6099
  }
5841
6100
  if (next2 !== l) {
@@ -5860,7 +6119,7 @@ var ImageEditorController = (_class12 = class {
5860
6119
  * A worker that is cancelled or fails is replaced by a fresh one on the next job.
5861
6120
  */
5862
6121
  setSelectionWorker(factory) {
5863
- _optionalChain([this, 'access', _164 => _164.selectionWorker, 'optionalAccess', _165 => _165.terminate, 'call', _166 => _166()]);
6122
+ _optionalChain([this, 'access', _168 => _168.selectionWorker, 'optionalAccess', _169 => _169.terminate, 'call', _170 => _170()]);
5864
6123
  this.selectionWorker = factory ? new (0, _chunkUC3PWFM3cjs.SelectionWorkerClient)(factory) : null;
5865
6124
  }
5866
6125
  /** Sets (or with `null` removes) how new documents are opened (see `DocumentOpener`). Not an edit. */
@@ -5886,7 +6145,7 @@ var ImageEditorController = (_class12 = class {
5886
6145
  const layer = _chunkS55JFWDAcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5887
6146
  if (layer.type !== "pixel") throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`A new document needs a pixel layer; "${id}" is a ${layer.type} layer.`);
5888
6147
  const sel = _nullishCoalesce(options.selection, () => ( this.state.selection));
5889
- if (!_optionalChain([sel, 'optionalAccess', _167 => _167.bounds])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Nothing is selected; select what goes in the new document first.");
6148
+ if (!_optionalChain([sel, 'optionalAccess', _171 => _171.bounds])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Nothing is selected; select what goes in the new document first.");
5890
6149
  const { width, height } = this.naturalSize;
5891
6150
  const surface = this.surfaceOf(layer);
5892
6151
  let copy;
@@ -5937,10 +6196,10 @@ var ImageEditorController = (_class12 = class {
5937
6196
  * `onProgress` hears its stages. The document is not changed.
5938
6197
  */
5939
6198
  async runSelectionJob(job, pixels, options = {}) {
5940
- _optionalChain([options, 'access', _168 => _168.signal, 'optionalAccess', _169 => _169.throwIfAborted, 'call', _170 => _170()]);
6199
+ _optionalChain([options, 'access', _172 => _172.signal, 'optionalAccess', _173 => _173.throwIfAborted, 'call', _174 => _174()]);
5941
6200
  if (this.selectionWorker) return this.selectionWorker.run(job, pixels, options);
5942
6201
  const result = _chunkUC3PWFM3cjs.runSelectionJob.call(void 0, job, pixels, options.onProgress);
5943
- _optionalChain([options, 'access', _171 => _171.signal, 'optionalAccess', _172 => _172.throwIfAborted, 'call', _173 => _173()]);
6202
+ _optionalChain([options, 'access', _175 => _175.signal, 'optionalAccess', _176 => _176.throwIfAborted, 'call', _177 => _177()]);
5944
6203
  return result;
5945
6204
  }
5946
6205
  /** Registers (or with `null` removes) the segmentation provider. Not an edit: no undo step. */
@@ -6015,8 +6274,8 @@ var ImageEditorController = (_class12 = class {
6015
6274
  */
6016
6275
  async updateEffectFilter(layerId, filterId, changes, commitToHistory = true) {
6017
6276
  const layer = _chunkS55JFWDAcjs.requireSmartObject.call(void 0, this.state.layers, layerId);
6018
- const was = _optionalChain([layer, 'access', _174 => _174.smartFilters, 'optionalAccess', _175 => _175.filters, 'access', _176 => _176.find, 'call', _177 => _177((f) => f.id === filterId)]);
6019
- if (!was || was.kind !== "effect") throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`Smart object "${layer.name || layerId}" has no effect filter "${filterId}"; its filters are ${(_nullishCoalesce(_optionalChain([layer, 'access', _178 => _178.smartFilters, 'optionalAccess', _179 => _179.filters]), () => ( []))).map((f) => `${f.id} (${f.kind === "effect" ? _nullishCoalesce(f.name, () => ( f.effect)) : f.kind})`).join(", ") || "none"}.`);
6277
+ const was = _optionalChain([layer, 'access', _178 => _178.smartFilters, 'optionalAccess', _179 => _179.filters, 'access', _180 => _180.find, 'call', _181 => _181((f) => f.id === filterId)]);
6278
+ if (!was || was.kind !== "effect") throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`Smart object "${layer.name || layerId}" has no effect filter "${filterId}"; its filters are ${(_nullishCoalesce(_optionalChain([layer, 'access', _182 => _182.smartFilters, 'optionalAccess', _183 => _183.filters]), () => ( []))).map((f) => `${f.id} (${f.kind === "effect" ? _nullishCoalesce(f.name, () => ( f.effect)) : f.kind})`).join(", ") || "none"}.`);
6020
6279
  const update = {};
6021
6280
  if (changes.values) {
6022
6281
  const d = await this.describeEffect(was.effect);
@@ -6058,7 +6317,7 @@ var ImageEditorController = (_class12 = class {
6058
6317
  const layer = {
6059
6318
  type: "pixel",
6060
6319
  id,
6061
- name: _optionalChain([options, 'access', _180 => _180.name, 'optionalAccess', _181 => _181.trim, 'call', _182 => _182()]) || d.name,
6320
+ name: _optionalChain([options, 'access', _184 => _184.name, 'optionalAccess', _185 => _185.trim, 'call', _186 => _186()]) || d.name,
6062
6321
  visible: true,
6063
6322
  opacity: _nullishCoalesce(options.opacity, () => ( 1)),
6064
6323
  blend: _nullishCoalesce(blend, () => ( "normal")),
@@ -6083,7 +6342,7 @@ var ImageEditorController = (_class12 = class {
6083
6342
  */
6084
6343
  async updateEffectLayer(layerId, changes, commitToHistory = true) {
6085
6344
  const found = _chunkB46UQUDCcjs.findLayer.call(void 0, this.state.layers, layerId);
6086
- const layer = _optionalChain([found, 'optionalAccess', _183 => _183.layer]);
6345
+ const layer = _optionalChain([found, 'optionalAccess', _187 => _187.layer]);
6087
6346
  if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`"${layerId}" is not an effect layer; add one with add_effect_layer.`);
6088
6347
  _chunkS55JFWDAcjs.requireUnlocked.call(void 0, layer, "pixels", "draw its effect again");
6089
6348
  const g = layer.generator;
@@ -6112,7 +6371,7 @@ var ImageEditorController = (_class12 = class {
6112
6371
  * and how long it runs, the longest of theirs (ms). Null when none animates.
6113
6372
  */
6114
6373
  getAnimation() {
6115
- const layers = _chunkB46UQUDCcjs.flattenLayers.call(void 0, this.state.layers).filter((l) => l.type === "pixel" && l.visible && !!_optionalChain([l, 'access', _184 => _184.generator, 'optionalAccess', _185 => _185.animate]));
6374
+ const layers = _chunkB46UQUDCcjs.flattenLayers.call(void 0, this.state.layers).filter((l) => l.type === "pixel" && l.visible && !!_optionalChain([l, 'access', _188 => _188.generator, 'optionalAccess', _189 => _189.animate]));
6116
6375
  if (!layers.length) return null;
6117
6376
  return { duration: Math.max(...layers.map((l) => l.generator.animate.duration)), layerIds: layers.map((l) => l.id) };
6118
6377
  }
@@ -6129,7 +6388,7 @@ var ImageEditorController = (_class12 = class {
6129
6388
  const { width, height } = this.naturalSize;
6130
6389
  const surfaces = /* @__PURE__ */ new Map();
6131
6390
  for (const l of _chunkB46UQUDCcjs.flattenLayers.call(void 0, this.state.layers)) {
6132
- if (l.type !== "pixel" || !l.visible || !_optionalChain([l, 'access', _186 => _186.generator, 'optionalAccess', _187 => _187.animate])) continue;
6391
+ if (l.type !== "pixel" || !l.visible || !_optionalChain([l, 'access', _190 => _190.generator, 'optionalAccess', _191 => _191.animate])) continue;
6133
6392
  const g = l.generator;
6134
6393
  const pixels = await this.effectsEngine.renderLayer(g.effect, g.values, { width, height, depth: this.bitDepth, time: (_nullishCoalesce(g.time, () => ( 0))) + time });
6135
6394
  surfaces.set(l.id, effectPixelsToSurface(pixels, this.bitDepth));
@@ -6149,7 +6408,7 @@ var ImageEditorController = (_class12 = class {
6149
6408
  })
6150
6409
  );
6151
6410
  }
6152
- __init89() {this.displayFor = null}
6411
+ __init90() {this.displayFor = null}
6153
6412
  /** Keeps the renderer's display transform in step with the document profile, mode and Proof Setup. */
6154
6413
  syncDisplay() {
6155
6414
  const s = this.state;
@@ -6158,7 +6417,7 @@ var ImageEditorController = (_class12 = class {
6158
6417
  this.displayFor = [s.colorProfile, s.proofSetup, s.colorMode];
6159
6418
  try {
6160
6419
  this.renderer.setDisplayTransform(displayTransform(s.colorProfile, effectiveProof(s.proofSetup, s.colorMode)));
6161
- } catch (e25) {
6420
+ } catch (e26) {
6162
6421
  this.renderer.setDisplayTransform(null);
6163
6422
  }
6164
6423
  }
@@ -6190,8 +6449,8 @@ var ImageEditorController = (_class12 = class {
6190
6449
  transform: { ...s.transform },
6191
6450
  outputOpacity: s.outputOpacity,
6192
6451
  selection: _nullishCoalesce(s.selection, () => ( null)),
6193
- ..._optionalChain([s, 'access', _188 => _188.channels, 'optionalAccess', _189 => _189.length]) ? { channels: s.channels } : {},
6194
- ..._optionalChain([s, 'access', _190 => _190.paths, 'optionalAccess', _191 => _191.length]) ? { paths: s.paths } : {},
6452
+ ..._optionalChain([s, 'access', _192 => _192.channels, 'optionalAccess', _193 => _193.length]) ? { channels: s.channels } : {},
6453
+ ..._optionalChain([s, 'access', _194 => _194.paths, 'optionalAccess', _195 => _195.length]) ? { paths: s.paths } : {},
6195
6454
  source: {
6196
6455
  sourceUrl: s.sourceUrl,
6197
6456
  element: this.imageElement,
@@ -6227,11 +6486,11 @@ var ImageEditorController = (_class12 = class {
6227
6486
  if (entry.colorMode) s.colorMode = entry.colorMode;
6228
6487
  else delete s.colorMode;
6229
6488
  s.selection = entry.selection;
6230
- if (_optionalChain([entry, 'access', _192 => _192.channels, 'optionalAccess', _193 => _193.length])) s.channels = entry.channels;
6489
+ if (_optionalChain([entry, 'access', _196 => _196.channels, 'optionalAccess', _197 => _197.length])) s.channels = entry.channels;
6231
6490
  else delete s.channels;
6232
- if (_optionalChain([entry, 'access', _194 => _194.paths, 'optionalAccess', _195 => _195.length])) s.paths = entry.paths;
6491
+ if (_optionalChain([entry, 'access', _198 => _198.paths, 'optionalAccess', _199 => _199.length])) s.paths = entry.paths;
6233
6492
  else delete s.paths;
6234
- if (s.activePathId && !_optionalChain([s, 'access', _196 => _196.paths, 'optionalAccess', _197 => _197.some, 'call', _198 => _198((p) => p.id === s.activePathId)])) s.activePathId = null;
6493
+ if (s.activePathId && !_optionalChain([s, 'access', _200 => _200.paths, 'optionalAccess', _201 => _201.some, 'call', _202 => _202((p) => p.id === s.activePathId)])) s.activePathId = null;
6235
6494
  if (this.imageElement !== entry.source.element && !this.samplePixelsOverride) this.samplePixels = null;
6236
6495
  this.imageElement = entry.source.element;
6237
6496
  s.sourceUrl = entry.source.sourceUrl;
@@ -6242,7 +6501,7 @@ var ImageEditorController = (_class12 = class {
6242
6501
  }
6243
6502
  }
6244
6503
  /** Set while `asOneStep` runs: the step is already recorded, so nested commands add none. */
6245
- __init90() {this.historyGrouped = false}
6504
+ __init91() {this.historyGrouped = false}
6246
6505
  /**
6247
6506
  * Runs `fn` as one undo step: history is recorded once, before it, and the commands it calls
6248
6507
  * record none. If `fn` throws, the step is dropped and the state goes back to before it, so a
@@ -6305,7 +6564,7 @@ var ImageEditorController = (_class12 = class {
6305
6564
  get canUndo() {
6306
6565
  return this.undoStack.length > 0;
6307
6566
  }
6308
- __init91() {this.docRevision = 0}
6567
+ __init92() {this.docRevision = 0}
6309
6568
  /**
6310
6569
  * Bumped on every change to the document (an undoable edit, a stroke, undo, redo), not on view
6311
6570
  * or tool changes, nor on `loadImage` (the source image is the host's, not part of the document). `createImageEditorDocument` uses it to tell document changes apart.
@@ -6437,7 +6696,7 @@ var ImageEditorController = (_class12 = class {
6437
6696
  return this.state.layers;
6438
6697
  }
6439
6698
  getLayer(id) {
6440
- return _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, this.state.layers, id), 'optionalAccess', _199 => _199.layer]);
6699
+ return _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, this.state.layers, id), 'optionalAccess', _203 => _203.layer]);
6441
6700
  }
6442
6701
  /** The active layer, or `undefined`. */
6443
6702
  getActiveLayer() {
@@ -6450,7 +6709,7 @@ var ImageEditorController = (_class12 = class {
6450
6709
  setActiveLayer(id, target = "pixels") {
6451
6710
  if (id !== null && !this.getLayer(id)) return false;
6452
6711
  const layer = id ? this.getLayer(id) : void 0;
6453
- const t = target === "mask" && _optionalChain([layer, 'optionalAccess', _200 => _200.mask]) ? "mask" : target === "filter-mask" && _optionalChain([layer, 'optionalAccess', _201 => _201.type]) === "smart" && _optionalChain([layer, 'access', _202 => _202.smartFilters, 'optionalAccess', _203 => _203.mask]) ? "filter-mask" : "pixels";
6712
+ const t = target === "mask" && _optionalChain([layer, 'optionalAccess', _204 => _204.mask]) ? "mask" : target === "filter-mask" && _optionalChain([layer, 'optionalAccess', _205 => _205.type]) === "smart" && _optionalChain([layer, 'access', _206 => _206.smartFilters, 'optionalAccess', _207 => _207.mask]) ? "filter-mask" : "pixels";
6454
6713
  if (this.state.activeLayerId === id && this.state.activeTarget === t) return true;
6455
6714
  this.state.activeLayerId = id;
6456
6715
  this.state.activeTarget = t;
@@ -6469,7 +6728,7 @@ var ImageEditorController = (_class12 = class {
6469
6728
  if (!b) return null;
6470
6729
  return { x: b.x + layer.offset.x, y: b.y + layer.offset.y, width: b.width, height: b.height, data: _chunk474IQG74cjs.readRegion.call(void 0, surface, b) };
6471
6730
  }
6472
- __init92() {this.boundsCache = /* @__PURE__ */ new WeakMap()}
6731
+ __init93() {this.boundsCache = /* @__PURE__ */ new WeakMap()}
6473
6732
  /**
6474
6733
  * Document bounds of a layer's non-transparent pixels (pixel layers; the Background's source
6475
6734
  * included), or `null` for an empty or non-pixel layer.
@@ -6612,11 +6871,11 @@ var ImageEditorController = (_class12 = class {
6612
6871
  surfaceOf: (l) => this.surfaceOf(l),
6613
6872
  version: `${this.sourceVersion()}:${this.patternsVersion()}`,
6614
6873
  globalLight: this.state.globalLight,
6615
- pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _204 => _204.state, 'access', _205 => _205.patterns, 'optionalAccess', _206 => _206.find, 'call', _207 => _207((p) => p.id === id)]), () => ( null))
6874
+ pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _208 => _208.state, 'access', _209 => _209.patterns, 'optionalAccess', _210 => _210.find, 'call', _211 => _211((p) => p.id === id)]), () => ( null))
6616
6875
  };
6617
6876
  }
6618
- __init93() {this.sourceIds = /* @__PURE__ */ new WeakMap()}
6619
- __init94() {this.nextSourceId = 1}
6877
+ __init94() {this.sourceIds = /* @__PURE__ */ new WeakMap()}
6878
+ __init95() {this.nextSourceId = 1}
6620
6879
  /** Changes whenever the Background's source pixels can have changed. */
6621
6880
  sourceVersion() {
6622
6881
  const key2 = this.samplePixelsOverride ? this.samplePixels : _nullishCoalesce(this.imageElement, () => ( this.samplePixels));
@@ -6665,7 +6924,7 @@ var ImageEditorController = (_class12 = class {
6665
6924
  }
6666
6925
  return fits ? fromPixels(px2) : null;
6667
6926
  }
6668
- __init95() {this.opaqueCache = /* @__PURE__ */ new WeakMap()}
6927
+ __init96() {this.opaqueCache = /* @__PURE__ */ new WeakMap()}
6669
6928
  /** Whether every source pixel is opaque (some legacy renders depend on it). */
6670
6929
  sourceIsOpaque() {
6671
6930
  const s = this.sourceSurface();
@@ -6689,9 +6948,9 @@ var ImageEditorController = (_class12 = class {
6689
6948
  if (!ctx || typeof ctx.getImageData !== "function") return null;
6690
6949
  ctx.drawImage(el, 0, 0, width, height);
6691
6950
  const data = ctx.getImageData(0, 0, width, height);
6692
- if (!_optionalChain([data, 'optionalAccess', _208 => _208.data]) || data.data.length < width * height * 4) return null;
6951
+ if (!_optionalChain([data, 'optionalAccess', _212 => _212.data]) || data.data.length < width * height * 4) return null;
6693
6952
  return { width, height, data: data.data };
6694
- } catch (e26) {
6953
+ } catch (e27) {
6695
6954
  return null;
6696
6955
  }
6697
6956
  }
@@ -6702,7 +6961,7 @@ var ImageEditorController = (_class12 = class {
6702
6961
  const prev = this.state.layers;
6703
6962
  const depth = this.bitDepth;
6704
6963
  this.state.layers = next;
6705
- _optionalChain([extra, 'optionalCall', _209 => _209()]);
6964
+ _optionalChain([extra, 'optionalCall', _213 => _213()]);
6706
6965
  if (depth !== 8 && this.bitDepth === depth) this.state.layers = keepDeepLayers(prev, this.state.layers);
6707
6966
  if (this.state.activeLayerId && !_chunkB46UQUDCcjs.findLayer.call(void 0, this.state.layers, this.state.activeLayerId)) {
6708
6967
  this.state.activeLayerId = _chunkS55JFWDAcjs.activeLayerAfterRemoval.call(void 0, prev, this.state.layers, this.state.activeLayerId);
@@ -6740,7 +6999,7 @@ var ImageEditorController = (_class12 = class {
6740
6999
  const layer = {
6741
7000
  type: "pixel",
6742
7001
  id: init.id && !ids.has(init.id) ? init.id : _chunkS55JFWDAcjs.newLayerId.call(void 0, ),
6743
- name: _optionalChain([init, 'access', _210 => _210.name, 'optionalAccess', _211 => _211.trim, 'call', _212 => _212()]) || this.nextLayerName(),
7002
+ name: _optionalChain([init, 'access', _214 => _214.name, 'optionalAccess', _215 => _215.trim, 'call', _216 => _216()]) || this.nextLayerName(),
6744
7003
  visible: _nullishCoalesce(init.visible, () => ( true)),
6745
7004
  opacity: _nullishCoalesce(init.opacity, () => ( 1)),
6746
7005
  blend: _nullishCoalesce(blend, () => ( "normal")),
@@ -6767,12 +7026,12 @@ var ImageEditorController = (_class12 = class {
6767
7026
  async decodeImage(image) {
6768
7027
  const trimmed = image.trim();
6769
7028
  let png = null;
6770
- if (/^data:image\/png/i.test(trimmed)) png = _nullishCoalesce(_optionalChain([_chunkOLNIPTB3cjs.parseDataUrl.call(void 0, trimmed), 'optionalAccess', _213 => _213.bytes]), () => ( null));
7029
+ if (/^data:image\/png/i.test(trimmed)) png = _nullishCoalesce(_optionalChain([_chunkOLNIPTB3cjs.parseDataUrl.call(void 0, trimmed), 'optionalAccess', _217 => _217.bytes]), () => ( null));
6771
7030
  else if (/^[A-Za-z0-9+/=\s]+$/.test(trimmed) && trimmed.length > 16) {
6772
7031
  try {
6773
7032
  const bytes = _chunkOLNIPTB3cjs.base64ToBytes.call(void 0, trimmed);
6774
7033
  if (_chunkOLNIPTB3cjs.isPng.call(void 0, bytes)) png = bytes;
6775
- } catch (e27) {
7034
+ } catch (e28) {
6776
7035
  png = null;
6777
7036
  }
6778
7037
  }
@@ -6780,14 +7039,14 @@ var ImageEditorController = (_class12 = class {
6780
7039
  try {
6781
7040
  const d = _chunkOLNIPTB3cjs.decodePng.call(void 0, png);
6782
7041
  return { width: d.width, height: d.height, data: d.data };
6783
- } catch (e28) {
7042
+ } catch (e29) {
6784
7043
  }
6785
7044
  }
6786
7045
  const src = png ? `data:image/png;base64,${_chunkOLNIPTB3cjs.bytesToBase64.call(void 0, png)}` : trimmed;
6787
7046
  let img;
6788
7047
  try {
6789
7048
  img = await this.renderer.imageCache.get(src);
6790
- } catch (e29) {
7049
+ } catch (e30) {
6791
7050
  throw new (0, _chunkS55JFWDAcjs.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.");
6792
7051
  }
6793
7052
  const w = img.naturalWidth || img.width;
@@ -6816,7 +7075,7 @@ var ImageEditorController = (_class12 = class {
6816
7075
  removeLayer(id) {
6817
7076
  const next = _chunkS55JFWDAcjs.removeLayer.call(void 0, this.state.layers, id);
6818
7077
  this.commitLayers(next, () => {
6819
- if (this.state.selectedAnnotationId && !_chunkB46UQUDCcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkS55JFWDAcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _214 => _214.id]) === this.state.selectedAnnotationId)) {
7078
+ if (this.state.selectedAnnotationId && !_chunkB46UQUDCcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkS55JFWDAcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _218 => _218.id]) === this.state.selectedAnnotationId)) {
6820
7079
  this.state.selectedAnnotationId = null;
6821
7080
  }
6822
7081
  });
@@ -6825,9 +7084,9 @@ var ImageEditorController = (_class12 = class {
6825
7084
  moveLayer(id, placement) {
6826
7085
  const next = _chunkS55JFWDAcjs.moveLayer.call(void 0, this.state.layers, id, placement);
6827
7086
  const loc = _chunkB46UQUDCcjs.findLayer.call(void 0, next, id);
6828
- if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _215 => _215.parent, 'optionalAccess', _216 => _216.id]), () => ( null)), index: loc.index };
7087
+ if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _219 => _219.parent, 'optionalAccess', _220 => _220.id]), () => ( null)), index: loc.index };
6829
7088
  this.commitLayers(next);
6830
- return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _217 => _217.parent, 'optionalAccess', _218 => _218.id]), () => ( null)), index: loc.index };
7089
+ return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _221 => _221.parent, 'optionalAccess', _222 => _222.id]), () => ( null)), index: loc.index };
6831
7090
  }
6832
7091
  /** A layer's edge colour as percentages (see `setEdgeColor`). */
6833
7092
  getEdgeColor(id) {
@@ -6923,7 +7182,7 @@ var ImageEditorController = (_class12 = class {
6923
7182
  const group = {
6924
7183
  type: "group",
6925
7184
  id: _chunkS55JFWDAcjs.newLayerId.call(void 0, "group"),
6926
- name: _optionalChain([init, 'access', _219 => _219.name, 'optionalAccess', _220 => _220.trim, 'call', _221 => _221()]) || "Group",
7185
+ name: _optionalChain([init, 'access', _223 => _223.name, 'optionalAccess', _224 => _224.trim, 'call', _225 => _225()]) || "Group",
6927
7186
  visible: true,
6928
7187
  opacity: 1,
6929
7188
  blend,
@@ -7016,7 +7275,7 @@ var ImageEditorController = (_class12 = class {
7016
7275
  sel = this.layerTransparency(id);
7017
7276
  } else {
7018
7277
  const current = this.state.selection;
7019
- if (!_optionalChain([current, 'optionalAccess', _222 => _222.bounds])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all / transparency.");
7278
+ if (!_optionalChain([current, 'optionalAccess', _226 => _226.bounds])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all / transparency.");
7020
7279
  sel = from === "hide-selection" ? _chunkSS53NNZOcjs.invertSelection.call(void 0, current) : current;
7021
7280
  }
7022
7281
  mask = this.maskFromSelection(sel, props);
@@ -7047,7 +7306,7 @@ var ImageEditorController = (_class12 = class {
7047
7306
  const layer = _chunkS55JFWDAcjs.requireLayer.call(void 0, this.state.layers, id).layer;
7048
7307
  const name = layer.name || id;
7049
7308
  if (layer.type === "shape") throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`Layer "${name}" is a shape layer, whose path already is its vector mask; change it with set_shape_component, or rasterize the layer first.`);
7050
- if (_optionalChain([layer, 'access', _223 => _223.mask, 'optionalAccess', _224 => _224.source])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`Layer "${name}" has a depth mask, which cannot be combined with a vector mask; remove the depth mask first.`);
7309
+ if (_optionalChain([layer, 'access', _227 => _227.mask, 'optionalAccess', _228 => _228.source])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`Layer "${name}" has a depth mask, which cannot be combined with a vector mask; remove the depth mask first.`);
7051
7310
  return layer;
7052
7311
  }
7053
7312
  requireVectorMask(id) {
@@ -7057,10 +7316,10 @@ var ImageEditorController = (_class12 = class {
7057
7316
  }
7058
7317
  /** Components from a path spec: `components`, or one `shape` / `subpaths`. */
7059
7318
  vectorMaskComponents(path) {
7060
- if (_optionalChain([path, 'access', _225 => _225.components, 'optionalAccess', _226 => _226.length]) && (path.shape !== void 0 || path.subpaths !== void 0)) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
7319
+ if (_optionalChain([path, 'access', _229 => _229.components, 'optionalAccess', _230 => _230.length]) && (path.shape !== void 0 || path.subpaths !== void 0)) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
7061
7320
  if (path.fillRule !== void 0 && path.fillRule !== "nonzero" && path.fillRule !== "evenodd") throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
7062
- const specs = _optionalChain([path, 'access', _227 => _227.components, 'optionalAccess', _228 => _228.length]) ? path.components : [path];
7063
- return specs.map((c, i) => this.componentFrom(c, _optionalChain([path, 'access', _229 => _229.components, 'optionalAccess', _230 => _230.length]) ? `components[${i}].` : ""));
7321
+ const specs = _optionalChain([path, 'access', _231 => _231.components, 'optionalAccess', _232 => _232.length]) ? path.components : [path];
7322
+ return specs.map((c, i) => this.componentFrom(c, _optionalChain([path, 'access', _233 => _233.components, 'optionalAccess', _234 => _234.length]) ? `components[${i}].` : ""));
7064
7323
  }
7065
7324
  /**
7066
7325
  * Layer › Vector Mask: `reveal-all` (an empty path showing everything), `hide-all` (an empty path
@@ -7077,7 +7336,7 @@ var ImageEditorController = (_class12 = class {
7077
7336
  vm = { components: this.vectorMaskComponents(path) };
7078
7337
  if (path.fillRule === "evenodd") vm.fillRule = "evenodd";
7079
7338
  } else if (from === "reveal-all" || from === "hide-all") {
7080
- if (_optionalChain([path, 'access', _231 => _231.components, 'optionalAccess', _232 => _232.length]) || path.shape !== void 0 || path.subpaths !== void 0) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`A ${from} vector mask starts empty; use from path to give a path.`);
7339
+ if (_optionalChain([path, 'access', _235 => _235.components, 'optionalAccess', _236 => _236.length]) || path.shape !== void 0 || path.subpaths !== void 0) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`A ${from} vector mask starts empty; use from path to give a path.`);
7081
7340
  vm = { components: [], ...from === "reveal-all" ? { inverted: true } : {} };
7082
7341
  } else {
7083
7342
  throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`Unknown vector mask source "${String(from)}". Use reveal-all, hide-all, path or selection.`);
@@ -7088,7 +7347,7 @@ var ImageEditorController = (_class12 = class {
7088
7347
  /** The selection's outline as subpaths; throws when nothing is selected or nothing is left to trace. */
7089
7348
  traceSelection(options) {
7090
7349
  const sel = this.state.selection;
7091
- if (!_optionalChain([sel, 'optionalAccess', _233 => _233.bounds])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Nothing is selected; select first, then make a path from the selection.");
7350
+ if (!_optionalChain([sel, 'optionalAccess', _237 => _237.bounds])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Nothing is selected; select first, then make a path from the selection.");
7092
7351
  if (options.tolerance !== void 0 && !(options.tolerance >= 0.1 && options.tolerance <= 10)) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("tolerance must be from 0.1 to 10 px.");
7093
7352
  const subpaths = selectionToSubpaths(sel, options);
7094
7353
  if (!subpaths.length) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("The selection is too small or too faint to trace (below minArea, or under half selected); lower minArea or threshold.");
@@ -7128,7 +7387,7 @@ var ImageEditorController = (_class12 = class {
7128
7387
  return _nullishCoalesce(this.state.paths, () => ( []));
7129
7388
  }
7130
7389
  getPath(id) {
7131
- return _nullishCoalesce(_optionalChain([this, 'access', _234 => _234.state, 'access', _235 => _235.paths, 'optionalAccess', _236 => _236.find, 'call', _237 => _237((p) => p.id === id)]), () => ( null));
7390
+ return _nullishCoalesce(_optionalChain([this, 'access', _238 => _238.state, 'access', _239 => _239.paths, 'optionalAccess', _240 => _240.find, 'call', _241 => _241((p) => p.id === id)]), () => ( null));
7132
7391
  }
7133
7392
  requirePath(id) {
7134
7393
  const path = this.getPath(id);
@@ -7161,14 +7420,14 @@ var ImageEditorController = (_class12 = class {
7161
7420
  const subpaths = this.traceSelection(options);
7162
7421
  const paths = this.getPaths();
7163
7422
  const old = paths.find((p) => p.work);
7164
- const work = { id: _nullishCoalesce(_optionalChain([old, 'optionalAccess', _238 => _238.id]), () => ( newPathId())), name: WORK_PATH_NAME, components: [{ op: "combine", subpaths }], fillRule: "evenodd", work: true };
7423
+ const work = { id: _nullishCoalesce(_optionalChain([old, 'optionalAccess', _242 => _242.id]), () => ( newPathId())), name: WORK_PATH_NAME, components: [{ op: "combine", subpaths }], fillRule: "evenodd", work: true };
7165
7424
  this.commitPaths(old ? paths.map((p) => p === old ? work : p) : [...paths, work], work.id);
7166
7425
  return work;
7167
7426
  }
7168
7427
  /** A new saved path from geometry (`shape`, `subpaths` or `components`). One undo step. */
7169
7428
  addPath(input) {
7170
7429
  const paths = this.getPaths();
7171
- const path = { id: newPathId(), name: _optionalChain([input, 'access', _239 => _239.name, 'optionalAccess', _240 => _240.trim, 'call', _241 => _241()]) || `Path ${paths.filter((p) => !p.work).length + 1}`, components: this.vectorMaskComponents(input) };
7430
+ const path = { id: newPathId(), name: _optionalChain([input, 'access', _243 => _243.name, 'optionalAccess', _244 => _244.trim, 'call', _245 => _245()]) || `Path ${paths.filter((p) => !p.work).length + 1}`, components: this.vectorMaskComponents(input) };
7172
7431
  if (input.fillRule === "evenodd") path.fillRule = "evenodd";
7173
7432
  this.commitPaths([...paths.filter((p) => !p.work), path, ...paths.filter((p) => p.work)], path.id);
7174
7433
  return path;
@@ -7232,7 +7491,7 @@ var ImageEditorController = (_class12 = class {
7232
7491
  const paths = this.getPaths();
7233
7492
  const old = paths.find((p) => p.work);
7234
7493
  const work = {
7235
- id: _nullishCoalesce(_optionalChain([old, 'optionalAccess', _242 => _242.id]), () => ( newPathId())),
7494
+ id: _nullishCoalesce(_optionalChain([old, 'optionalAccess', _246 => _246.id]), () => ( newPathId())),
7236
7495
  name: WORK_PATH_NAME,
7237
7496
  components: components.map((c, i) => this.componentFrom({ op: c.op, subpaths: c.subpaths }, `components[${i}].`)),
7238
7497
  work: true
@@ -7253,7 +7512,7 @@ var ImageEditorController = (_class12 = class {
7253
7512
  /** Duplicates a path as a saved path. One undo step. */
7254
7513
  duplicatePath(id, name) {
7255
7514
  const old = this.requirePath(id);
7256
- const copy = { ...old, id: newPathId(), name: _optionalChain([name, 'optionalAccess', _243 => _243.trim, 'call', _244 => _244()]) || `${old.name} copy`, components: JSON.parse(JSON.stringify(old.components)) };
7515
+ const copy = { ...old, id: newPathId(), name: _optionalChain([name, 'optionalAccess', _247 => _247.trim, 'call', _248 => _248()]) || `${old.name} copy`, components: JSON.parse(JSON.stringify(old.components)) };
7257
7516
  delete copy.work;
7258
7517
  const paths = this.getPaths();
7259
7518
  this.commitPaths([...paths.filter((p) => !p.work), copy, ...paths.filter((p) => p.work)], copy.id);
@@ -7459,7 +7718,7 @@ var ImageEditorController = (_class12 = class {
7459
7718
  const layer = loc.layer;
7460
7719
  if (layer.type !== "pixel") throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
7461
7720
  const sel = this.state.selection;
7462
- if (!_optionalChain([sel, 'optionalAccess', _245 => _245.bounds])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
7721
+ if (!_optionalChain([sel, 'optionalAccess', _249 => _249.bounds])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
7463
7722
  if (options.cut) _chunkS55JFWDAcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
7464
7723
  const surface = this.surfaceOf(layer);
7465
7724
  const sb = sel.bounds;
@@ -7477,14 +7736,14 @@ var ImageEditorController = (_class12 = class {
7477
7736
  const copy = {
7478
7737
  type: "pixel",
7479
7738
  id: _chunkS55JFWDAcjs.newLayerId.call(void 0, ),
7480
- name: _optionalChain([options, 'access', _246 => _246.name, 'optionalAccess', _247 => _247.trim, 'call', _248 => _248()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
7739
+ name: _optionalChain([options, 'access', _250 => _250.name, 'optionalAccess', _251 => _251.trim, 'call', _252 => _252()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
7481
7740
  visible: true,
7482
7741
  opacity: 1,
7483
7742
  blend: "normal",
7484
7743
  surface: _chunk474IQG74cjs.surfaceFromPixels.call(void 0, { width: src.width, height: src.height, data: px2 }, 4, src.x, src.y),
7485
7744
  offset: { ...layer.offset }
7486
7745
  };
7487
- let next = _chunkB46UQUDCcjs.insertLayer.call(void 0, this.state.layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _249 => _249.parent, 'optionalAccess', _250 => _250.id]), () => ( null)), loc.index + 1);
7746
+ let next = _chunkB46UQUDCcjs.insertLayer.call(void 0, this.state.layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _253 => _253.parent, 'optionalAccess', _254 => _254.id]), () => ( null)), loc.index + 1);
7488
7747
  if (kept) {
7489
7748
  const cutLayer = { ...layer, surface: _chunk474IQG74cjs.writeRegion.call(void 0, surface, src, kept) };
7490
7749
  delete cutLayer.source;
@@ -7497,7 +7756,7 @@ var ImageEditorController = (_class12 = class {
7497
7756
  return copy.id;
7498
7757
  }
7499
7758
  // --- Free Transform ---
7500
- __init96() {this.openTransform = null}
7759
+ __init97() {this.openTransform = null}
7501
7760
  /** The Free Transform in progress (see `beginFreeTransform`), or `null`. */
7502
7761
  getFreeTransform() {
7503
7762
  if (this.openTransform && !this.openTransform.isOpen) this.openTransform = null;
@@ -7508,7 +7767,7 @@ var ImageEditorController = (_class12 = class {
7508
7767
  layers: () => this.state.layers,
7509
7768
  activeLayerId: () => this.state.activeLayerId,
7510
7769
  activeTarget: () => this.state.activeTarget,
7511
- selection: () => _optionalChain([this, 'access', _251 => _251.state, 'access', _252 => _252.selection, 'optionalAccess', _253 => _253.bounds]) ? this.state.selection : null,
7770
+ selection: () => _optionalChain([this, 'access', _255 => _255.state, 'access', _256 => _256.selection, 'optionalAccess', _257 => _257.bounds]) ? this.state.selection : null,
7512
7771
  canvas: () => this.naturalSize,
7513
7772
  pixelsOf: (layer) => this.surfaceOf(layer),
7514
7773
  shapeEnv: () => this.shapeEnv(),
@@ -7656,7 +7915,7 @@ var ImageEditorController = (_class12 = class {
7656
7915
  * anything else nests as a layer document. Returns the smart object's id.
7657
7916
  */
7658
7917
  convertToSmartObject(ids, options = {}) {
7659
- const list = _optionalChain([ids, 'optionalAccess', _254 => _254.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
7918
+ const list = _optionalChain([ids, 'optionalAccess', _258 => _258.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
7660
7919
  if (!list.length) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
7661
7920
  const res = _chunkS55JFWDAcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
7662
7921
  this.commitLayers(res.layers, () => {
@@ -7689,8 +7948,8 @@ var ImageEditorController = (_class12 = class {
7689
7948
  width: c.width,
7690
7949
  height: c.height,
7691
7950
  decoded: _chunkS55JFWDAcjs.isContentsDecoded.call(void 0, c),
7692
- fileType: _nullishCoalesce(_optionalChain([c, 'access', _255 => _255.file, 'optionalAccess', _256 => _256.type]), () => ( null)),
7693
- linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _257 => _257.linked, 'optionalAccess', _258 => _258.path]), () => ( null)),
7951
+ fileType: _nullishCoalesce(_optionalChain([c, 'access', _259 => _259.file, 'optionalAccess', _260 => _260.type]), () => ( null)),
7952
+ linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _261 => _261.linked, 'optionalAccess', _262 => _262.path]), () => ( null)),
7694
7953
  instances: _chunkS55JFWDAcjs.instancesOf.call(void 0, this.state.layers, c.id),
7695
7954
  layerCount: c.document ? _chunkB46UQUDCcjs.flattenLayers.call(void 0, c.document.layers).length : 0
7696
7955
  },
@@ -7707,9 +7966,9 @@ var ImageEditorController = (_class12 = class {
7707
7966
  bounds: _chunkS55JFWDAcjs.transformedBox.call(void 0, g)
7708
7967
  },
7709
7968
  smartFilters: {
7710
- enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _259 => _259.enabled]), () => ( true)),
7711
- filters: (_nullishCoalesce(_optionalChain([stack, 'optionalAccess', _260 => _260.filters]), () => ( []))).map((f) => f.kind === "psd" ? { id: f.id, kind: "psd", name: f.name, enabled: f.enabled, blend: f.blend, opacity: f.opacity } : { ...f }),
7712
- mask: _optionalChain([stack, 'optionalAccess', _261 => _261.mask]) ? { enabled: stack.mask.enabled !== false, linked: stack.mask.linked !== false, density: _nullishCoalesce(stack.mask.density, () => ( 1)), feather: _nullishCoalesce(stack.mask.feather, () => ( 0)), bounds: _chunk474IQG74cjs.contentBounds.call(void 0, stack.mask.surface), defaultValue: stack.mask.defaultValue } : null
7969
+ enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _263 => _263.enabled]), () => ( true)),
7970
+ filters: (_nullishCoalesce(_optionalChain([stack, 'optionalAccess', _264 => _264.filters]), () => ( []))).map((f) => f.kind === "psd" ? { id: f.id, kind: "psd", name: f.name, enabled: f.enabled, blend: f.blend, opacity: f.opacity } : { ...f }),
7971
+ mask: _optionalChain([stack, 'optionalAccess', _265 => _265.mask]) ? { enabled: stack.mask.enabled !== false, linked: stack.mask.linked !== false, density: _nullishCoalesce(stack.mask.density, () => ( 1)), feather: _nullishCoalesce(stack.mask.feather, () => ( 0)), bounds: _chunk474IQG74cjs.contentBounds.call(void 0, stack.mask.surface), defaultValue: stack.mask.defaultValue } : null
7713
7972
  },
7714
7973
  bounds: this.getLayerBounds(id)
7715
7974
  };
@@ -7848,7 +8107,7 @@ var ImageEditorController = (_class12 = class {
7848
8107
  * it in the same undo step (Photoshop limits a filter to the selection). Returns whether it did.
7849
8108
  */
7850
8109
  maskFiltersWithSelection(id, useSelection) {
7851
- if (!useSelection || !_optionalChain([this, 'access', _262 => _262.state, 'access', _263 => _263.selection, 'optionalAccess', _264 => _264.bounds])) return false;
8110
+ if (!useSelection || !_optionalChain([this, 'access', _266 => _266.state, 'access', _267 => _267.selection, 'optionalAccess', _268 => _268.bounds])) return false;
7852
8111
  this.setSmartFilterMask(id, "selection", {}, false);
7853
8112
  return true;
7854
8113
  }
@@ -7862,19 +8121,19 @@ var ImageEditorController = (_class12 = class {
7862
8121
  removeSmartFilter(id, filterId) {
7863
8122
  const res = _chunkS55JFWDAcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
7864
8123
  this.commitLayers(res.layers);
7865
- return _nullishCoalesce(_optionalChain([res, 'access', _265 => _265.layer, 'access', _266 => _266.smartFilters, 'optionalAccess', _267 => _267.filters]), () => ( []));
8124
+ return _nullishCoalesce(_optionalChain([res, 'access', _269 => _269.layer, 'access', _270 => _270.smartFilters, 'optionalAccess', _271 => _271.filters]), () => ( []));
7866
8125
  }
7867
8126
  /** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
7868
8127
  moveSmartFilter(id, filterId, index) {
7869
8128
  const res = _chunkS55JFWDAcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
7870
8129
  this.commitLayers(res.layers);
7871
- return _nullishCoalesce(_optionalChain([res, 'access', _268 => _268.layer, 'access', _269 => _269.smartFilters, 'optionalAccess', _270 => _270.filters]), () => ( []));
8130
+ return _nullishCoalesce(_optionalChain([res, 'access', _272 => _272.layer, 'access', _273 => _273.smartFilters, 'optionalAccess', _274 => _274.filters]), () => ( []));
7872
8131
  }
7873
8132
  /** Turns a smart object's whole filter stack on or off (one undo step). */
7874
8133
  setSmartFiltersEnabled(id, enabled) {
7875
8134
  const res = _chunkS55JFWDAcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
7876
8135
  this.commitLayers(res.layers);
7877
- return _nullishCoalesce(_optionalChain([res, 'access', _271 => _271.layer, 'access', _272 => _272.smartFilters, 'optionalAccess', _273 => _273.enabled]), () => ( true));
8136
+ return _nullishCoalesce(_optionalChain([res, 'access', _275 => _275.layer, 'access', _276 => _276.smartFilters, 'optionalAccess', _277 => _277.enabled]), () => ( true));
7878
8137
  }
7879
8138
  /**
7880
8139
  * Sets the smart filter mask (one undo step): `reveal-all`, `hide-all`, `selection` (the
@@ -7886,11 +8145,11 @@ var ImageEditorController = (_class12 = class {
7886
8145
  let mask;
7887
8146
  if (from === "none") mask = null;
7888
8147
  else if (from === "keep") {
7889
- if (!_optionalChain([layer, 'access', _274 => _274.smartFilters, 'optionalAccess', _275 => _275.mask])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
8148
+ if (!_optionalChain([layer, 'access', _278 => _278.smartFilters, 'optionalAccess', _279 => _279.mask])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
7890
8149
  mask = withMaskProps(layer.smartFilters.mask, props);
7891
8150
  } else if (from === "selection") {
7892
8151
  const sel = this.state.selection;
7893
- if (!_optionalChain([sel, 'optionalAccess', _276 => _276.bounds])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
8152
+ if (!_optionalChain([sel, 'optionalAccess', _280 => _280.bounds])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
7894
8153
  mask = this.maskFromSelection(sel, props);
7895
8154
  } else {
7896
8155
  const v = from === "reveal-all" ? 255 : 0;
@@ -7902,7 +8161,7 @@ var ImageEditorController = (_class12 = class {
7902
8161
  if (mask && from !== "keep") this.state.activeTarget = "filter-mask";
7903
8162
  else if (!mask && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
7904
8163
  }, commitToHistory);
7905
- return _nullishCoalesce(_optionalChain([res, 'access', _277 => _277.layer, 'access', _278 => _278.smartFilters, 'optionalAccess', _279 => _279.mask]), () => ( null));
8164
+ return _nullishCoalesce(_optionalChain([res, 'access', _281 => _281.layer, 'access', _282 => _282.smartFilters, 'optionalAccess', _283 => _283.mask]), () => ( null));
7906
8165
  }
7907
8166
  /**
7908
8167
  * Decodes smart object contents that came as files the synchronous decoders cannot read (a JPEG
@@ -7927,7 +8186,7 @@ var ImageEditorController = (_class12 = class {
7927
8186
  };
7928
8187
  this.state.layers = swap(this.state.layers);
7929
8188
  for (const e of [...this.undoStack, ...this.redoStack]) e.layers = swap(e.layers);
7930
- } catch (e30) {
8189
+ } catch (e31) {
7931
8190
  left.push(cid);
7932
8191
  }
7933
8192
  }
@@ -7935,7 +8194,7 @@ var ImageEditorController = (_class12 = class {
7935
8194
  return left;
7936
8195
  }
7937
8196
  // --- Smart object contents (Edit Contents) ---
7938
- __init97() {this.contentsStack = []}
8197
+ __init98() {this.contentsStack = []}
7939
8198
  /** The smart objects whose contents are open (outermost first); empty when the document itself is shown. */
7940
8199
  getEditingContents() {
7941
8200
  return this.contentsStack.map((e) => ({ layerId: e.layerId, name: e.name }));
@@ -7950,7 +8209,7 @@ var ImageEditorController = (_class12 = class {
7950
8209
  if (this.getFreeTransform()) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
7951
8210
  const layer = _chunkS55JFWDAcjs.requireSmartObject.call(void 0, this.state.layers, id);
7952
8211
  const c = layer.contents;
7953
- if (!_chunkS55JFWDAcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _280 => _280.file, 'optionalAccess', _281 => _281.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
8212
+ if (!_chunkS55JFWDAcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _284 => _284.file, 'optionalAccess', _285 => _285.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
7954
8213
  const saved = {
7955
8214
  state: { ...this.state },
7956
8215
  undo: this.undoStack,
@@ -7981,9 +8240,9 @@ var ImageEditorController = (_class12 = class {
7981
8240
  editingContents: this.getEditingContents()
7982
8241
  };
7983
8242
  delete this.state.legacyOutputBlur;
7984
- if (_optionalChain([c, 'access', _282 => _282.document, 'optionalAccess', _283 => _283.globalLight])) this.state.globalLight = c.document.globalLight;
8243
+ if (_optionalChain([c, 'access', _286 => _286.document, 'optionalAccess', _287 => _287.globalLight])) this.state.globalLight = c.document.globalLight;
7985
8244
  else delete this.state.globalLight;
7986
- if (_optionalChain([c, 'access', _284 => _284.document, 'optionalAccess', _285 => _285.patterns, 'optionalAccess', _286 => _286.length])) this.state.patterns = c.document.patterns;
8245
+ if (_optionalChain([c, 'access', _288 => _288.document, 'optionalAccess', _289 => _289.patterns, 'optionalAccess', _290 => _290.length])) this.state.patterns = c.document.patterns;
7987
8246
  else delete this.state.patterns;
7988
8247
  this.imageElement = null;
7989
8248
  this.samplePixels = null;
@@ -8003,23 +8262,23 @@ var ImageEditorController = (_class12 = class {
8003
8262
  closeSmartObjectContents(save = true) {
8004
8263
  const top = this.contentsStack.pop();
8005
8264
  if (!top) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
8006
- if (_optionalChain([this, 'access', _287 => _287.openTransform, 'optionalAccess', _288 => _288.isOpen])) this.openTransform.cancel();
8265
+ if (_optionalChain([this, 'access', _291 => _291.openTransform, 'optionalAccess', _292 => _292.isOpen])) this.openTransform.cancel();
8007
8266
  this.openTransform = null;
8008
8267
  const edited = this.state;
8009
8268
  const changed = save && this.undoStack.length > 0;
8010
8269
  let next = null;
8011
8270
  if (changed) {
8012
- const layer = _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, top.saved.state.layers, top.layerId), 'optionalAccess', _289 => _289.layer]);
8013
- const old = _optionalChain([layer, 'optionalAccess', _290 => _290.contents]);
8271
+ const layer = _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, top.saved.state.layers, top.layerId), 'optionalAccess', _293 => _293.layer]);
8272
+ const old = _optionalChain([layer, 'optionalAccess', _294 => _294.contents]);
8014
8273
  const { width, height } = edited.imageDimensions;
8015
8274
  const only = edited.layers.length === 1 ? edited.layers[0] : null;
8016
- const plain3 = _optionalChain([only, 'optionalAccess', _291 => _291.type]) === "pixel" && only.visible && only.opacity === 1 && only.blend === "normal" && !only.mask && !only.effects && !_optionalChain([only, 'access', _292 => _292.filters, 'optionalAccess', _293 => _293.length]) && !only.clipped && (_nullishCoalesce(only.fillOpacity, () => ( 1))) === 1 && only.source !== "document";
8017
- if (_optionalChain([old, 'optionalAccess', _294 => _294.kind]) === "raster" && plain3) {
8275
+ const plain3 = _optionalChain([only, 'optionalAccess', _295 => _295.type]) === "pixel" && only.visible && only.opacity === 1 && only.blend === "normal" && !only.mask && !only.effects && !_optionalChain([only, 'access', _296 => _296.filters, 'optionalAccess', _297 => _297.length]) && !only.clipped && (_nullishCoalesce(only.fillOpacity, () => ( 1))) === 1 && only.source !== "document";
8276
+ if (_optionalChain([old, 'optionalAccess', _298 => _298.kind]) === "raster" && plain3) {
8018
8277
  const px2 = _chunk474IQG74cjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
8019
8278
  next = _chunkS55JFWDAcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
8020
8279
  } else {
8021
8280
  const doc = { layers: edited.layers, globalLight: edited.globalLight, patterns: edited.patterns };
8022
- next = _chunkS55JFWDAcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _295 => _295.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _296 => _296.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
8281
+ next = _chunkS55JFWDAcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _299 => _299.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _300 => _300.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
8023
8282
  }
8024
8283
  }
8025
8284
  const saved = top.saved;
@@ -8044,7 +8303,7 @@ var ImageEditorController = (_class12 = class {
8044
8303
  }
8045
8304
  /** The document's own layers (not the contents open for editing). */
8046
8305
  rootLayers() {
8047
- return _nullishCoalesce(_optionalChain([this, 'access', _297 => _297.contentsStack, 'access', _298 => _298[0], 'optionalAccess', _299 => _299.saved, 'access', _300 => _300.state, 'access', _301 => _301.layers]), () => ( this.state.layers));
8306
+ return _nullishCoalesce(_optionalChain([this, 'access', _301 => _301.contentsStack, 'access', _302 => _302[0], 'optionalAccess', _303 => _303.saved, 'access', _304 => _304.state, 'access', _305 => _305.layers]), () => ( this.state.layers));
8048
8307
  }
8049
8308
  /** Drops every open contents edit (loading another document). */
8050
8309
  abandonContents() {
@@ -8084,7 +8343,7 @@ var ImageEditorController = (_class12 = class {
8084
8343
  this.commitLayers(_chunkS55JFWDAcjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
8085
8344
  return this.getLayerEffects(id);
8086
8345
  }
8087
- __init98() {this.patternIds = /* @__PURE__ */ new WeakMap()}
8346
+ __init99() {this.patternIds = /* @__PURE__ */ new WeakMap()}
8088
8347
  /** Changes whenever the document's pattern list is replaced (the compositor then drops its caches). */
8089
8348
  patternsVersion() {
8090
8349
  const list = this.state.patterns;
@@ -8246,7 +8505,7 @@ var ImageEditorController = (_class12 = class {
8246
8505
  });
8247
8506
  return bg.id;
8248
8507
  }
8249
- __init99() {this.thumbCache = /* @__PURE__ */ new WeakMap()}
8508
+ __init100() {this.thumbCache = /* @__PURE__ */ new WeakMap()}
8250
8509
  /**
8251
8510
  * A small RGBA preview of a pixel layer over the canvas (or of its mask with `mask: true`),
8252
8511
  * longest side `maxSide` px, point-sampled; `null` for layers without pixels.
@@ -8265,7 +8524,7 @@ var ImageEditorController = (_class12 = class {
8265
8524
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
8266
8525
  const key2 = `${tw}x${th}:${ox},${oy}`;
8267
8526
  let byKey = this.thumbCache.get(surface);
8268
- const hit = _optionalChain([byKey, 'optionalAccess', _302 => _302.get, 'call', _303 => _303(key2)]);
8527
+ const hit = _optionalChain([byKey, 'optionalAccess', _306 => _306.get, 'call', _307 => _307(key2)]);
8269
8528
  if (hit) return hit;
8270
8529
  const out = new Uint8ClampedArray(tw * th * 4);
8271
8530
  for (let y = 0; y < th; y++) {
@@ -8406,7 +8665,7 @@ var ImageEditorController = (_class12 = class {
8406
8665
  if (layer.mask.source) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`Layer "${name}" has a depth mask, which is generated, not painted.`);
8407
8666
  _chunkS55JFWDAcjs.requireUnlocked.call(void 0, layer, "all", action);
8408
8667
  } else if (ch === "filter-mask") {
8409
- if (layer.type !== "smart" || !_optionalChain([layer, 'access', _304 => _304.smartFilters, 'optionalAccess', _305 => _305.mask])) {
8668
+ if (layer.type !== "smart" || !_optionalChain([layer, 'access', _308 => _308.smartFilters, 'optionalAccess', _309 => _309.mask])) {
8410
8669
  throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`Layer "${name}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`, `Layer "${name}" has no smart filter mask to ${action}.`);
8411
8670
  }
8412
8671
  if (!_chunkS55JFWDAcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`The contents of "${name}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`, `The smart object "${name}" is still loading; try again in a moment.`);
@@ -8421,7 +8680,7 @@ var ImageEditorController = (_class12 = class {
8421
8680
  if (!layer.visible) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`Layer "${name}" is hidden; show it before you ${action}.`);
8422
8681
  const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
8423
8682
  const surface = ch === "mask" ? layer.mask.surface : ch === "filter-mask" ? layer.smartFilters.mask.surface : this.surfaceOf(layer);
8424
- const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _306 => _306.locks, 'optionalAccess', _307 => _307.transparency]));
8683
+ const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _310 => _310.locks, 'optionalAccess', _311 => _311.transparency]));
8425
8684
  return { id, layer, channel: ch, offset, surface, lockTransparency };
8426
8685
  }
8427
8686
  /** The layer with its pixels (or mask) replaced by `surface`. */
@@ -8465,13 +8724,13 @@ var ImageEditorController = (_class12 = class {
8465
8724
  blend: target.channel !== "pixels" ? "normal" : brush.blend,
8466
8725
  lockTransparency: target.lockTransparency,
8467
8726
  // In Quick Mask mode the selection is what is painted, so it does not limit the stroke.
8468
- selection: target.channel !== "quick-mask" && _optionalChain([this, 'access', _308 => _308.state, 'access', _309 => _309.selection, 'optionalAccess', _310 => _310.bounds]) ? this.state.selection : null,
8727
+ selection: target.channel !== "quick-mask" && _optionalChain([this, 'access', _312 => _312.state, 'access', _313 => _313.selection, 'optionalAccess', _314 => _314.bounds]) ? this.state.selection : null,
8469
8728
  offset: target.offset
8470
8729
  };
8471
8730
  const depth = target.channel !== "filter-mask" && target.channel !== "quick-mask" && this.bitDepth !== 8 ? this.bitDepth : null;
8472
8731
  if (tool === "mixer") return new PaintStrokeSession(this, target, this.mixerStroke(init, brush), apply, depth);
8473
8732
  if (isRetouchTool(tool)) return new PaintStrokeSession(this, target, this.retouchStroke(tool, init, brush, target, apply), apply, depth);
8474
- const gradient = tool === "brush" && _optionalChain([strokePaint, 'optionalAccess', _311 => _311.type]) === "gradient" ? _chunkPQ3H2AANcjs.resolvePaintGradient.call(void 0, strokePaint, { paint: toHex(color), secondary: toHex(background) }) : null;
8733
+ const gradient = tool === "brush" && _optionalChain([strokePaint, 'optionalAccess', _315 => _315.type]) === "gradient" ? _chunkPQ3H2AANcjs.resolvePaintGradient.call(void 0, strokePaint, { paint: toHex(color), secondary: toHex(background) }) : null;
8475
8734
  return new PaintStrokeSession(this, target, new (0, _chunkPQ3H2AANcjs.StrokeCoverage)(brush, gradient, _nullishCoalesce(init.seed, () => ( 0))), apply, depth);
8476
8735
  }
8477
8736
  /** A retouching stroke's start: its settings, what it samples and how it composites. */
@@ -8518,9 +8777,9 @@ var ImageEditorController = (_class12 = class {
8518
8777
  const steps = settings.historySteps;
8519
8778
  const entry = steps > 0 ? _nullishCoalesce(this.undoStack[this.undoStack.length - steps], () => ( this.undoStack[0])) : this.undoStack[0];
8520
8779
  if (!entry) throw new (0, _chunkS55JFWDAcjs.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.");
8521
- const then = _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, entry.layers, target.id), 'optionalAccess', _312 => _312.layer]);
8780
+ const then = _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, entry.layers, target.id), 'optionalAccess', _316 => _316.layer]);
8522
8781
  if (!then) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`Layer "${target.id}" did not exist ${steps > 0 ? `${steps} steps back` : "in the oldest state"}; choose fewer history steps (historySteps).`);
8523
- const surface = target.channel === "mask" ? _optionalChain([then, 'access', _313 => _313.mask, 'optionalAccess', _314 => _314.surface]) : then.type === "pixel" ? then.surface : void 0;
8782
+ const surface = target.channel === "mask" ? _optionalChain([then, 'access', _317 => _317.mask, 'optionalAccess', _318 => _318.surface]) : then.type === "pixel" ? then.surface : void 0;
8524
8783
  if (!surface) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`Layer "${target.id}" had no ${target.channel === "mask" ? "mask" : "pixels"} in that state.`);
8525
8784
  const offset2 = then.type === "pixel" ? then.offset : { x: 0, y: 0 };
8526
8785
  const depth = !mask && this.bitDepth !== 8 ? this.bitDepth : null;
@@ -8594,7 +8853,7 @@ var ImageEditorController = (_class12 = class {
8594
8853
  }
8595
8854
  /** A pixel source over a surface (layer pixels or a mask) in layer space at `offset`. */
8596
8855
  surfaceSource(surface, offset) {
8597
- return new (0, _chunkYF3YZZ6Gcjs.TilePixelSource)((tx, ty) => _nullishCoalesce(_optionalChain([surface, 'access', _315 => _315.tiles, 'access', _316 => _316.get, 'call', _317 => _317(_chunk474IQG74cjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _318 => _318.data]), () => ( (surface.defaultValue ? defaultTile(surface) : null))), surface.channels, offset);
8856
+ return new (0, _chunkYF3YZZ6Gcjs.TilePixelSource)((tx, ty) => _nullishCoalesce(_optionalChain([surface, 'access', _319 => _319.tiles, 'access', _320 => _320.get, 'call', _321 => _321(_chunk474IQG74cjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _322 => _322.data]), () => ( (surface.defaultValue ? defaultTile(surface) : null))), surface.channels, offset);
8598
8857
  }
8599
8858
  /** A pixel source over the composite of the current layers (through `throughId` and below, or all of them), as it is now. */
8600
8859
  compositeSource(throughId, depth = null) {
@@ -8670,7 +8929,7 @@ var ImageEditorController = (_class12 = class {
8670
8929
  paintStroke(init) {
8671
8930
  if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("points must hold at least one { x, y } point.");
8672
8931
  for (const p of init.points) {
8673
- if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _319 => _319.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _320 => _320.y]))) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
8932
+ if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _323 => _323.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _324 => _324.y]))) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
8674
8933
  }
8675
8934
  const session = this.beginStroke(init);
8676
8935
  session.push(init.points);
@@ -8699,7 +8958,7 @@ var ImageEditorController = (_class12 = class {
8699
8958
  */
8700
8959
  strokeSelection(options) {
8701
8960
  const sel = this.state.selection;
8702
- if (!_optionalChain([sel, 'optionalAccess', _321 => _321.bounds])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Nothing is selected; select first, then stroke the selection.");
8961
+ if (!_optionalChain([sel, 'optionalAccess', _325 => _325.bounds])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Nothing is selected; select first, then stroke the selection.");
8703
8962
  const width = options.width;
8704
8963
  if (!(width > 0 && width <= 250)) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("width must be greater than 0 and at most 250 px.");
8705
8964
  const location = _nullishCoalesce(options.location, () => ( "outside"));
@@ -8716,7 +8975,7 @@ var ImageEditorController = (_class12 = class {
8716
8975
  */
8717
8976
  cropToSelection() {
8718
8977
  const sel = this.state.selection;
8719
- if (!_optionalChain([sel, 'optionalAccess', _322 => _322.bounds])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Nothing is selected; select the area to keep, then crop to it.");
8978
+ if (!_optionalChain([sel, 'optionalAccess', _326 => _326.bounds])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Nothing is selected; select the area to keep, then crop to it.");
8720
8979
  const crop = { ...sel.bounds };
8721
8980
  this.setCrop(crop);
8722
8981
  return crop;
@@ -8767,7 +9026,7 @@ var ImageEditorController = (_class12 = class {
8767
9026
  */
8768
9027
  prepareContentAwareFill(options = {}) {
8769
9028
  const sel = this.state.selection;
8770
- if (!_optionalChain([sel, 'optionalAccess', _323 => _323.bounds])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Nothing is selected; select what to remove, then fill it.");
9029
+ if (!_optionalChain([sel, 'optionalAccess', _327 => _327.bounds])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Nothing is selected; select what to remove, then fill it.");
8771
9030
  if (this.bitDepth !== 8) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Content-Aware Fill works on 8-bit documents for now; set_bit_depth 8 first, or use spot_heal.");
8772
9031
  const output = _nullishCoalesce(options.output, () => ( "current"));
8773
9032
  if (output !== "current" && output !== "new-layer" && output !== "duplicate-layer") {
@@ -8778,12 +9037,12 @@ var ImageEditorController = (_class12 = class {
8778
9037
  const b = sel.bounds;
8779
9038
  let area = _nullishCoalesce(options.samplingArea, () => ( null));
8780
9039
  if (!area && options.samplingChannelId) area = this.requireChannel(options.samplingChannelId).mask;
8781
- if (!area && _optionalChain([options, 'access', _324 => _324.sampleRects, 'optionalAccess', _325 => _325.length])) {
9040
+ if (!area && _optionalChain([options, 'access', _328 => _328.sampleRects, 'optionalAccess', _329 => _329.length])) {
8782
9041
  for (const r of options.sampleRects) area = _chunkSS53NNZOcjs.combineSelections.call(void 0, area, _chunkUC3PWFM3cjs.rectSelection.call(void 0, width, height, r, { antiAlias: false }), "add");
8783
9042
  }
8784
9043
  if (area && !area.bounds) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("The sampling area is empty; paint or give an area to sample from.");
8785
9044
  let win;
8786
- if (_optionalChain([area, 'optionalAccess', _326 => _326.bounds])) {
9045
+ if (_optionalChain([area, 'optionalAccess', _330 => _330.bounds])) {
8787
9046
  const a = area.bounds;
8788
9047
  const x0 = Math.max(0, Math.min(b.x - 8, a.x));
8789
9048
  const y0 = Math.max(0, Math.min(b.y - 8, a.y));
@@ -8808,7 +9067,7 @@ var ImageEditorController = (_class12 = class {
8808
9067
  }
8809
9068
  }
8810
9069
  let exclude = null;
8811
- if (area || _optionalChain([options, 'access', _327 => _327.excludeRects, 'optionalAccess', _328 => _328.length])) {
9070
+ if (area || _optionalChain([options, 'access', _331 => _331.excludeRects, 'optionalAccess', _332 => _332.length])) {
8812
9071
  exclude = new Uint8Array(n);
8813
9072
  if (area) {
8814
9073
  const ad = area.data;
@@ -8860,7 +9119,7 @@ var ImageEditorController = (_class12 = class {
8860
9119
  return { layerId: target.id, bounds: { ...b }, output };
8861
9120
  }
8862
9121
  /** The pixel clipboard (Copy / Cut), or null. */
8863
- __init100() {this.clipboard = null}
9122
+ __init101() {this.clipboard = null}
8864
9123
  /** What Copy or Cut last put on the editor's clipboard, or null. */
8865
9124
  getClipboard() {
8866
9125
  return this.clipboard;
@@ -8879,8 +9138,8 @@ var ImageEditorController = (_class12 = class {
8879
9138
  */
8880
9139
  copyPixels(options = {}) {
8881
9140
  const { width, height } = this.naturalSize;
8882
- const sel = _optionalChain([this, 'access', _329 => _329.state, 'access', _330 => _330.selection, 'optionalAccess', _331 => _331.bounds]) ? this.state.selection : null;
8883
- const rect2 = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _332 => _332.bounds]), () => ( { x: 0, y: 0, width, height }));
9141
+ const sel = _optionalChain([this, 'access', _333 => _333.state, 'access', _334 => _334.selection, 'optionalAccess', _335 => _335.bounds]) ? this.state.selection : null;
9142
+ const rect2 = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _336 => _336.bounds]), () => ( { x: 0, y: 0, width, height }));
8884
9143
  let data;
8885
9144
  if (options.merged) {
8886
9145
  data = new Uint8ClampedArray(this.compositePixels(rect2).data);
@@ -8920,7 +9179,7 @@ var ImageEditorController = (_class12 = class {
8920
9179
  pastePixels(mode = "new-layer", image = this.clipboard) {
8921
9180
  if (!image) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("The clipboard is empty; copy_pixels first.");
8922
9181
  if (!PASTE_MODES.includes(mode)) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`Unknown paste mode "${String(mode)}"; use ${PASTE_MODES.join(", ")}.`);
8923
- const sel = _optionalChain([this, 'access', _333 => _333.state, 'access', _334 => _334.selection, 'optionalAccess', _335 => _335.bounds]) ? this.state.selection : null;
9182
+ const sel = _optionalChain([this, 'access', _337 => _337.state, 'access', _338 => _338.selection, 'optionalAccess', _339 => _339.bounds]) ? this.state.selection : null;
8924
9183
  if ((mode === "into" || mode === "outside") && !sel) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`Paste ${mode === "into" ? "Into" : "Outside"} needs a selection; select where it goes first.`);
8925
9184
  const { width, height } = this.naturalSize;
8926
9185
  let x;
@@ -8929,7 +9188,7 @@ var ImageEditorController = (_class12 = class {
8929
9188
  x = image.x;
8930
9189
  y = image.y;
8931
9190
  } else {
8932
- const frame = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _336 => _336.bounds]), () => ( { x: 0, y: 0, width, height }));
9191
+ const frame = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _340 => _340.bounds]), () => ( { x: 0, y: 0, width, height }));
8933
9192
  x = Math.round(frame.x + (frame.width - image.width) / 2);
8934
9193
  y = Math.round(frame.y + (frame.height - image.height) / 2);
8935
9194
  }
@@ -8946,8 +9205,8 @@ var ImageEditorController = (_class12 = class {
8946
9205
  if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("opacity must be from 0 to 1.");
8947
9206
  const blend = _nullishCoalesce(_chunkS55JFWDAcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
8948
9207
  const quickMask = target.channel === "quick-mask";
8949
- const sel = _nullishCoalesce(coverageMask, () => ( (!quickMask && options.useSelection !== false && _optionalChain([this, 'access', _337 => _337.state, 'access', _338 => _338.selection, 'optionalAccess', _339 => _339.bounds]) ? this.state.selection : null)));
8950
- const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _340 => _340.bounds]), () => ( { x: 0, y: 0, width, height }));
9208
+ const sel = _nullishCoalesce(coverageMask, () => ( (!quickMask && options.useSelection !== false && _optionalChain([this, 'access', _341 => _341.state, 'access', _342 => _342.selection, 'optionalAccess', _343 => _343.bounds]) ? this.state.selection : null)));
9209
+ const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _344 => _344.bounds]), () => ( { x: 0, y: 0, width, height }));
8951
9210
  const coverage = new (0, _chunkPQ3H2AANcjs.CoverageMap)();
8952
9211
  const ones = new Float32Array(region.width * region.height);
8953
9212
  if (sel) {
@@ -9072,7 +9331,7 @@ var ImageEditorController = (_class12 = class {
9072
9331
  placeLayer(layers, node, where) {
9073
9332
  if (where.aboveId) {
9074
9333
  const loc = _chunkB46UQUDCcjs.findLayer.call(void 0, layers, where.aboveId);
9075
- if (loc) return _chunkB46UQUDCcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _341 => _341.parent, 'optionalAccess', _342 => _342.id]), () => ( null)), loc.index + 1);
9334
+ if (loc) return _chunkB46UQUDCcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _345 => _345.parent, 'optionalAccess', _346 => _346.id]), () => ( null)), loc.index + 1);
9076
9335
  }
9077
9336
  if (where.parentId) {
9078
9337
  const loc = _chunkB46UQUDCcjs.findLayer.call(void 0, layers, where.parentId);
@@ -9083,11 +9342,11 @@ var ImageEditorController = (_class12 = class {
9083
9342
  const at = Math.max(0, Math.min(nodes.length, Math.round(where.adjustmentIndex)));
9084
9343
  if (at < nodes.length) {
9085
9344
  const loc = _chunkB46UQUDCcjs.findLayer.call(void 0, layers, nodes[at].id);
9086
- return _chunkB46UQUDCcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _343 => _343.parent, 'optionalAccess', _344 => _344.id]), () => ( null)), loc.index);
9345
+ return _chunkB46UQUDCcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _347 => _347.parent, 'optionalAccess', _348 => _348.id]), () => ( null)), loc.index);
9087
9346
  }
9088
9347
  if (nodes.length) {
9089
9348
  const loc = _chunkB46UQUDCcjs.findLayer.call(void 0, layers, nodes[nodes.length - 1].id);
9090
- return _chunkB46UQUDCcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _345 => _345.parent, 'optionalAccess', _346 => _346.id]), () => ( null)), loc.index + 1);
9349
+ return _chunkB46UQUDCcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _349 => _349.parent, 'optionalAccess', _350 => _350.id]), () => ( null)), loc.index + 1);
9091
9350
  }
9092
9351
  }
9093
9352
  return _chunkB46UQUDCcjs.insertLayer.call(void 0, layers, node, null, this.defaultInsertIndex(layers));
@@ -9126,7 +9385,7 @@ var ImageEditorController = (_class12 = class {
9126
9385
  enabled: spec.enabled,
9127
9386
  opacity: spec.opacity,
9128
9387
  blend: spec.blend,
9129
- mask: _nullishCoalesce(spec.mask, () => ( (spec.useSelection && _optionalChain([this, 'access', _347 => _347.state, 'access', _348 => _348.selection, 'optionalAccess', _349 => _349.bounds]) ? _chunkS55JFWDAcjs.layerMaskFromSelection.call(void 0, this.state.selection) : void 0)))
9388
+ mask: _nullishCoalesce(spec.mask, () => ( (spec.useSelection && _optionalChain([this, 'access', _351 => _351.state, 'access', _352 => _352.selection, 'optionalAccess', _353 => _353.bounds]) ? _chunkS55JFWDAcjs.layerMaskFromSelection.call(void 0, this.state.selection) : void 0)))
9130
9389
  });
9131
9390
  while (ids.has(layer.id)) layer.id = _chunkS55JFWDAcjs.newLayerId.call(void 0, "adj");
9132
9391
  const { width, height } = this.naturalSize;
@@ -9203,7 +9462,7 @@ var ImageEditorController = (_class12 = class {
9203
9462
  const anchor = nodes[to];
9204
9463
  const without = _chunkB46UQUDCcjs.mapLayer.call(void 0, layers, id, () => null);
9205
9464
  const loc = _chunkB46UQUDCcjs.findLayer.call(void 0, without, anchor.id);
9206
- return _chunkB46UQUDCcjs.insertLayer.call(void 0, without, node, _nullishCoalesce(_optionalChain([loc, 'access', _350 => _350.parent, 'optionalAccess', _351 => _351.id]), () => ( null)), to > from ? loc.index + 1 : loc.index);
9465
+ return _chunkB46UQUDCcjs.insertLayer.call(void 0, without, node, _nullishCoalesce(_optionalChain([loc, 'access', _354 => _354.parent, 'optionalAccess', _355 => _355.id]), () => ( null)), to > from ? loc.index + 1 : loc.index);
9207
9466
  }
9208
9467
  /** Moves a layer to `toIndex` among the adjustment layers (0 = bottom) as one undo step. Returns false if nothing moved. */
9209
9468
  moveAdjustmentLayer(id, toIndex) {
@@ -9244,7 +9503,7 @@ var ImageEditorController = (_class12 = class {
9244
9503
  return _nullishCoalesce(this.state.selection, () => ( null));
9245
9504
  }
9246
9505
  get hasSelection() {
9247
- return Boolean(_optionalChain([this, 'access', _352 => _352.state, 'access', _353 => _353.selection, 'optionalAccess', _354 => _354.bounds]));
9506
+ return Boolean(_optionalChain([this, 'access', _356 => _356.state, 'access', _357 => _357.selection, 'optionalAccess', _358 => _358.bounds]));
9248
9507
  }
9249
9508
  /** Returns the current canvas (composition) dimensions. */
9250
9509
  getCanvasSize() {
@@ -9336,7 +9595,7 @@ var ImageEditorController = (_class12 = class {
9336
9595
  const prev = normalizeSelection(_nullishCoalesce(this.state.selection, () => ( null)));
9337
9596
  if (prev === next || prev && next && sameSelection(prev, next)) return false;
9338
9597
  this.recordHistory();
9339
- if (!next && _optionalChain([prev, 'optionalAccess', _355 => _355.bounds])) this.lastSelection = prev;
9598
+ if (!next && _optionalChain([prev, 'optionalAccess', _359 => _359.bounds])) this.lastSelection = prev;
9340
9599
  this.state.selection = next;
9341
9600
  this.notify();
9342
9601
  return true;
@@ -9362,7 +9621,7 @@ var ImageEditorController = (_class12 = class {
9362
9621
  return this.setSelection(null);
9363
9622
  }
9364
9623
  /** The selection a Deselect cleared, for `reselect` (not saved, not part of history). */
9365
- __init101() {this.lastSelection = null}
9624
+ __init102() {this.lastSelection = null}
9366
9625
  /** Whether `reselect` has a selection to bring back. */
9367
9626
  canReselect() {
9368
9627
  const { width, height } = this.naturalSize;
@@ -9390,14 +9649,14 @@ var ImageEditorController = (_class12 = class {
9390
9649
  /** Select › Grow: adds connected pixels within `tolerance` of a selected colour (one undo step). */
9391
9650
  async growSelection(options = {}) {
9392
9651
  const sel = this.state.selection;
9393
- if (!_optionalChain([sel, 'optionalAccess', _356 => _356.bounds])) return false;
9652
+ if (!_optionalChain([sel, 'optionalAccess', _360 => _360.bounds])) return false;
9394
9653
  const pixels = await this.requirePixels(options);
9395
9654
  return this.setSelection(growSelection(pixels, sel, options));
9396
9655
  }
9397
9656
  /** Select › Similar: adds every pixel within `tolerance` of a selected colour (one undo step). */
9398
9657
  async selectSimilar(options = {}) {
9399
9658
  const sel = this.state.selection;
9400
- if (!_optionalChain([sel, 'optionalAccess', _357 => _357.bounds])) return false;
9659
+ if (!_optionalChain([sel, 'optionalAccess', _361 => _361.bounds])) return false;
9401
9660
  const pixels = await this.requirePixels(options);
9402
9661
  return this.setSelection(selectSimilar(pixels, sel, options));
9403
9662
  }
@@ -9489,7 +9748,7 @@ var ImageEditorController = (_class12 = class {
9489
9748
  size: options.size,
9490
9749
  grow: m === "add",
9491
9750
  enhanceEdge: options.enhanceEdge,
9492
- selection: m === "add" && _optionalChain([sel, 'optionalAccess', _358 => _358.bounds]) ? _chunkUC3PWFM3cjs.serializeMask.call(void 0, sel) : null
9751
+ selection: m === "add" && _optionalChain([sel, 'optionalAccess', _362 => _362.bounds]) ? _chunkUC3PWFM3cjs.serializeMask.call(void 0, sel) : null
9493
9752
  };
9494
9753
  const { mask } = await this.runSelectionJob(job, pixels, {
9495
9754
  signal: options.signal,
@@ -9509,7 +9768,7 @@ var ImageEditorController = (_class12 = class {
9509
9768
  const { width, height } = this.naturalSize;
9510
9769
  const image = await this.toDataURL({ format: "image/png" });
9511
9770
  const results = await provider.segment({ ...request, image, width, height });
9512
- _optionalChain([request, 'access', _359 => _359.signal, 'optionalAccess', _360 => _360.throwIfAborted, 'call', _361 => _361()]);
9771
+ _optionalChain([request, 'access', _363 => _363.signal, 'optionalAccess', _364 => _364.throwIfAborted, 'call', _365 => _365()]);
9513
9772
  const decoded = [];
9514
9773
  for (const r of _nullishCoalesce(results, () => ( []))) decoded.push({ ...r, mask: r.mask !== void 0 ? await this.decodeMaskImage(r.mask) : void 0 });
9515
9774
  return decoded;
@@ -9526,7 +9785,7 @@ var ImageEditorController = (_class12 = class {
9526
9785
  let union = null;
9527
9786
  for (const r of decoded) {
9528
9787
  const one = segmentsToSelection(width, height, [r]);
9529
- if (!_optionalChain([one, 'optionalAccess', _362 => _362.bounds])) continue;
9788
+ if (!_optionalChain([one, 'optionalAccess', _366 => _366.bounds])) continue;
9530
9789
  if ("rect" in target) {
9531
9790
  const r0 = target.rect;
9532
9791
  const grow = 0.1 * Math.max(r0.width, r0.height);
@@ -9594,7 +9853,7 @@ var ImageEditorController = (_class12 = class {
9594
9853
  if (this.segmentation && options.useModel !== false) {
9595
9854
  const { width, height } = this.naturalSize;
9596
9855
  const sky = segmentsToSelection(width, height, await this.modelSegments({ target: "the sky", signal: options.signal }));
9597
- if (!_optionalChain([sky, 'optionalAccess', _363 => _363.bounds])) return { selection: _nullishCoalesce(this.state.selection, () => ( null)), method: "model", note: "The segmentation model found no sky." };
9856
+ if (!_optionalChain([sky, 'optionalAccess', _367 => _367.bounds])) return { selection: _nullishCoalesce(this.state.selection, () => ( null)), method: "model", note: "The segmentation model found no sky." };
9598
9857
  this.setSelection(sky, _nullishCoalesce(options.mode, () => ( "replace")));
9599
9858
  return { selection: _nullishCoalesce(this.state.selection, () => ( null)), method: "model" };
9600
9859
  }
@@ -9625,13 +9884,13 @@ var ImageEditorController = (_class12 = class {
9625
9884
  try {
9626
9885
  const canvas = await this.renderSource();
9627
9886
  const ctx = canvas.getContext("2d");
9628
- const data2 = _optionalChain([ctx, 'optionalAccess', _364 => _364.getImageData, 'optionalCall', _365 => _365(0, 0, width, height)]);
9887
+ const data2 = _optionalChain([ctx, 'optionalAccess', _368 => _368.getImageData, 'optionalCall', _369 => _369(0, 0, width, height)]);
9629
9888
  if (data2 && data2.data && data2.data.length >= width * height * 4) {
9630
9889
  base = { width, height, data: data2.data };
9631
9890
  this.samplePixels = base;
9632
9891
  this.samplePixelsOverride = false;
9633
9892
  }
9634
- } catch (e31) {
9893
+ } catch (e32) {
9635
9894
  base = null;
9636
9895
  }
9637
9896
  }
@@ -9700,7 +9959,7 @@ var ImageEditorController = (_class12 = class {
9700
9959
  /** Select › Modify: grow, shrink, feather, border or smooth by `radius` pixels (one undo step). */
9701
9960
  modifySelection(op, radius) {
9702
9961
  const sel = this.state.selection;
9703
- if (!_optionalChain([sel, 'optionalAccess', _366 => _366.bounds])) return false;
9962
+ if (!_optionalChain([sel, 'optionalAccess', _370 => _370.bounds])) return false;
9704
9963
  return this.setSelection(_chunkSS53NNZOcjs.modifySelection.call(void 0, sel, op, radius));
9705
9964
  }
9706
9965
  /**
@@ -9709,7 +9968,7 @@ var ImageEditorController = (_class12 = class {
9709
9968
  */
9710
9969
  async refineSelection(params, options = {}) {
9711
9970
  const sel = this.state.selection;
9712
- if (!_optionalChain([sel, 'optionalAccess', _367 => _367.bounds])) return false;
9971
+ if (!_optionalChain([sel, 'optionalAccess', _371 => _371.bounds])) return false;
9713
9972
  const pixels = (_nullishCoalesce(params.radius, () => ( 0))) > 0 ? await this.requirePixels(options) : null;
9714
9973
  return this.setSelection(_chunkSS53NNZOcjs.refineSelection.call(void 0, pixels, sel, params));
9715
9974
  }
@@ -9730,8 +9989,9 @@ var ImageEditorController = (_class12 = class {
9730
9989
  */
9731
9990
  async refineSelectionTo(params, output = "selection", options = {}) {
9732
9991
  const edits = _nullishCoalesce(options.edits, () => ( []));
9992
+ const regions2 = this.checkRegions(options.regions);
9733
9993
  const refineMode = _nullishCoalesce(options.refineMode, () => ( "color"));
9734
- if (!_optionalChain([this, 'access', _368 => _368.state, 'access', _369 => _369.selection, 'optionalAccess', _370 => _370.bounds]) && !edits.length) throw new Error("Nothing is selected; select first, or pass edits that paint a selection.");
9994
+ if (!_optionalChain([this, 'access', _372 => _372.state, 'access', _373 => _373.selection, 'optionalAccess', _374 => _374.bounds]) && !edits.length) throw new Error("Nothing is selected; select first, or pass edits that paint a selection.");
9735
9995
  if (refineMode === "object" && !this.segmentation) {
9736
9996
  throw new Error("Object aware refinement needs a segmentation model (setSegmentationProvider); use refineMode color.");
9737
9997
  }
@@ -9754,17 +10014,24 @@ var ImageEditorController = (_class12 = class {
9754
10014
  const { width, height } = this.naturalSize;
9755
10015
  const edited = _chunkUC3PWFM3cjs.applyRefineEdits.call(void 0, pixels, _nullishCoalesce(this.state.selection, () => ( null)), edits, width, height);
9756
10016
  let sel = edited.selection;
9757
- if (!_optionalChain([sel, 'optionalAccess', _371 => _371.bounds])) throw new Error("The edits leave nothing selected; paint with mode add first.");
10017
+ if (!_optionalChain([sel, 'optionalAccess', _375 => _375.bounds])) throw new Error("The edits leave nothing selected; paint with mode add first.");
9758
10018
  if (refineMode === "object") {
9759
10019
  const b = sel.bounds;
9760
10020
  const found = await this.modelObject({ rect: b }, options.signal);
9761
10021
  if (!found) throw new Error("The segmentation model found no object in the selection; use refineMode color.");
9762
10022
  const near = _chunkSS53NNZOcjs.modifySelection.call(void 0, sel, "expand", Math.max(4, _nullishCoalesce(params.radius, () => ( 8))));
9763
10023
  const clipped = _chunkSS53NNZOcjs.combineSelections.call(void 0, found, near, "intersect");
9764
- if (!_optionalChain([clipped, 'optionalAccess', _372 => _372.bounds])) throw new Error("The segmentation model found no object in the selection; use refineMode color.");
10024
+ if (!_optionalChain([clipped, 'optionalAccess', _376 => _376.bounds])) throw new Error("The segmentation model found no object in the selection; use refineMode color.");
9765
10025
  sel = clipped;
9766
10026
  }
9767
- const refined = _chunkSS53NNZOcjs.refineSelection.call(void 0, pixels, sel, params, edited.refineBrush);
10027
+ let refined = _chunkSS53NNZOcjs.refineSelection.call(void 0, pixels, sel, params, edited.refineBrush);
10028
+ if (regions2) {
10029
+ const data = Uint8Array.from(sel.data);
10030
+ for (const r of regions2) {
10031
+ for (let y = r.y; y < r.y + r.height; y++) data.set(refined.data.subarray(y * width + r.x, y * width + r.x + r.width), y * width + r.x);
10032
+ }
10033
+ refined = _chunkSS53NNZOcjs.createSelectionMask.call(void 0, width, height, data);
10034
+ }
9768
10035
  if (!refined.bounds) throw new Error("Refining left nothing selected; use a smaller shiftEdge or contrast.");
9769
10036
  if (toDocument) {
9770
10037
  const document2 = this.documentFromSelection({ layerId, withMask: output === "new-document-with-mask", selection: refined, decontaminate: amount * 100, radius: params.radius });
@@ -9856,7 +10123,7 @@ var ImageEditorController = (_class12 = class {
9856
10123
  let mask;
9857
10124
  if (source === "selection") {
9858
10125
  const sel = this.state.selection;
9859
- if (!_optionalChain([sel, 'optionalAccess', _373 => _373.bounds])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Nothing is selected; select first, or export a channel or a layer mask.");
10126
+ if (!_optionalChain([sel, 'optionalAccess', _377 => _377.bounds])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Nothing is selected; select first, or export a channel or a layer mask.");
9860
10127
  mask = sel;
9861
10128
  } else if ("channelId" in source) {
9862
10129
  mask = this.requireChannel(source.channelId).mask;
@@ -9880,7 +10147,7 @@ var ImageEditorController = (_class12 = class {
9880
10147
  const canvas = this.renderer.createCanvas(w, h);
9881
10148
  const ctx = canvas.getContext("2d");
9882
10149
  if (ctx) ctx.drawImage(img, 0, 0, w, h);
9883
- const data = _optionalChain([ctx, 'optionalAccess', _374 => _374.getImageData, 'optionalCall', _375 => _375(0, 0, w, h)]);
10150
+ const data = _optionalChain([ctx, 'optionalAccess', _378 => _378.getImageData, 'optionalCall', _379 => _379(0, 0, w, h)]);
9884
10151
  if (!data) throw new Error("The mask image pixels are not available (no canvas access); pass pixels.");
9885
10152
  return { width: w, height: h, data: data.data };
9886
10153
  }
@@ -9896,7 +10163,7 @@ var ImageEditorController = (_class12 = class {
9896
10163
  const provider = this.segmentation;
9897
10164
  if (!provider) {
9898
10165
  const pixels = await this.requirePixels({});
9899
- _optionalChain([options, 'access', _376 => _376.signal, 'optionalAccess', _377 => _377.throwIfAborted, 'call', _378 => _378()]);
10166
+ _optionalChain([options, 'access', _380 => _380.signal, 'optionalAccess', _381 => _381.throwIfAborted, 'call', _382 => _382()]);
9900
10167
  const { mask: selection, reason } = await this.runSelectionJob({ op: "subject", enhanceEdge: options.enhanceEdge }, pixels, options);
9901
10168
  if (selection.bounds) this.shapeCommand(selection, options);
9902
10169
  const unused = target.trim() ? ` "${target.trim()}" was not used to choose it.` : "";
@@ -9912,17 +10179,17 @@ var ImageEditorController = (_class12 = class {
9912
10179
  const decoded = await this.modelSegments({ target: description, maxSegments: options.maxSegments, signal: options.signal });
9913
10180
  const segments = decoded.map((r) => {
9914
10181
  const one = segmentsToSelection(width, height, [r]);
9915
- return { label: r.label || description, bounds: _nullishCoalesce(_optionalChain([one, 'optionalAccess', _379 => _379.bounds]), () => ( null)), ...r.score !== void 0 ? { score: r.score } : {} };
10182
+ return { label: r.label || description, bounds: _nullishCoalesce(_optionalChain([one, 'optionalAccess', _383 => _383.bounds]), () => ( null)), ...r.score !== void 0 ? { score: r.score } : {} };
9916
10183
  });
9917
10184
  const mask = segmentsToSelection(width, height, decoded);
9918
10185
  if (mask && options.beforeApply) {
9919
10186
  const outlines = decoded.flatMap((r, i) => {
9920
10187
  const rings = segmentationOutlines(r);
9921
- const b = _optionalChain([segments, 'access', _380 => _380[i], 'optionalAccess', _381 => _381.bounds]);
10188
+ const b = _optionalChain([segments, 'access', _384 => _384[i], 'optionalAccess', _385 => _385.bounds]);
9922
10189
  return rings.length ? rings : b ? [[{ x: b.x, y: b.y }, { x: b.x + b.width, y: b.y }, { x: b.x + b.width, y: b.y + b.height }, { x: b.x, y: b.y + b.height }]] : [];
9923
10190
  });
9924
10191
  await options.beforeApply(outlines);
9925
- _optionalChain([options, 'access', _382 => _382.signal, 'optionalAccess', _383 => _383.throwIfAborted, 'call', _384 => _384()]);
10192
+ _optionalChain([options, 'access', _386 => _386.signal, 'optionalAccess', _387 => _387.throwIfAborted, 'call', _388 => _388()]);
9926
10193
  }
9927
10194
  if (mask) this.shapeCommand(mask, options);
9928
10195
  return { segments: segments.filter((s) => s.bounds), method: "model" };
@@ -9955,7 +10222,7 @@ var ImageEditorController = (_class12 = class {
9955
10222
  const view = this.state.maskView;
9956
10223
  if (!view) return null;
9957
10224
  const layer = this.getLayer(view.layerId);
9958
- return _optionalChain([layer, 'optionalAccess', _385 => _385.mask]) && !layer.mask.source ? view : null;
10225
+ return _optionalChain([layer, 'optionalAccess', _389 => _389.mask]) && !layer.mask.source ? view : null;
9959
10226
  }
9960
10227
  /**
9961
10228
  * Shows a layer's mask on the canvas: `gray` alone in grey (Alt-click the mask thumbnail),
@@ -9978,7 +10245,7 @@ var ImageEditorController = (_class12 = class {
9978
10245
  if (!layer.mask) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to show; add one with add_layer_mask.`);
9979
10246
  if (layer.mask.source) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is computed, not painted, so it has no mask view.`);
9980
10247
  const cur = this.state.maskView;
9981
- if (_optionalChain([cur, 'optionalAccess', _386 => _386.layerId]) !== id || cur.mode !== mode) {
10248
+ if (_optionalChain([cur, 'optionalAccess', _390 => _390.layerId]) !== id || cur.mode !== mode) {
9982
10249
  this.state.maskView = { layerId: id, mode };
9983
10250
  this.notify();
9984
10251
  }
@@ -9990,7 +10257,7 @@ var ImageEditorController = (_class12 = class {
9990
10257
  return _nullishCoalesce(this.state.channels, () => ( []));
9991
10258
  }
9992
10259
  getChannel(id) {
9993
- return _nullishCoalesce(_optionalChain([this, 'access', _387 => _387.state, 'access', _388 => _388.channels, 'optionalAccess', _389 => _389.find, 'call', _390 => _390((c) => c.id === id)]), () => ( null));
10260
+ return _nullishCoalesce(_optionalChain([this, 'access', _391 => _391.state, 'access', _392 => _392.channels, 'optionalAccess', _393 => _393.find, 'call', _394 => _394((c) => c.id === id)]), () => ( null));
9994
10261
  }
9995
10262
  requireChannel(id) {
9996
10263
  const channel = this.getChannel(id);
@@ -10019,14 +10286,14 @@ var ImageEditorController = (_class12 = class {
10019
10286
  */
10020
10287
  saveSelection(options = {}) {
10021
10288
  const sel = this.state.selection;
10022
- if (!_optionalChain([sel, 'optionalAccess', _391 => _391.bounds])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Nothing is selected; select first, then save the selection to a channel.");
10289
+ if (!_optionalChain([sel, 'optionalAccess', _395 => _395.bounds])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Nothing is selected; select first, then save the selection to a channel.");
10023
10290
  const { width, height } = this.naturalSize;
10024
10291
  const sized = sel.width === width && sel.height === height ? sel : _chunkSS53NNZOcjs.resizeSelection.call(void 0, sel, width, height);
10025
10292
  const channels = [...this.getChannels()];
10026
10293
  if (options.channelId !== void 0) {
10027
10294
  const existing = this.requireChannel(options.channelId);
10028
10295
  const mask = _nullishCoalesce(_chunkSS53NNZOcjs.combineSelections.call(void 0, existing.mask.bounds ? existing.mask : null, sized, _nullishCoalesce(options.mode, () => ( "replace"))), () => ( _chunkSS53NNZOcjs.createSelectionMask.call(void 0, width, height)));
10029
- const next = { ...existing, mask, ..._optionalChain([options, 'access', _392 => _392.name, 'optionalAccess', _393 => _393.trim, 'call', _394 => _394()]) ? { name: options.name.trim() } : {} };
10296
+ const next = { ...existing, mask, ..._optionalChain([options, 'access', _396 => _396.name, 'optionalAccess', _397 => _397.trim, 'call', _398 => _398()]) ? { name: options.name.trim() } : {} };
10030
10297
  this.setChannels(channels.map((c) => c.id === existing.id ? next : c));
10031
10298
  return next;
10032
10299
  }
@@ -10037,7 +10304,7 @@ var ImageEditorController = (_class12 = class {
10037
10304
  const channels = this.getChannels();
10038
10305
  const channel = {
10039
10306
  id: this.newChannelId(),
10040
- name: _optionalChain([name, 'optionalAccess', _395 => _395.trim, 'call', _396 => _396()]) || `Alpha ${channels.length + 1}`,
10307
+ name: _optionalChain([name, 'optionalAccess', _399 => _399.trim, 'call', _400 => _400()]) || `Alpha ${channels.length + 1}`,
10041
10308
  mask,
10042
10309
  color: DEFAULT_CHANNEL_COLOR,
10043
10310
  opacity: 0.5,
@@ -10082,7 +10349,7 @@ var ImageEditorController = (_class12 = class {
10082
10349
  /** Duplicates an alpha channel just after it (one undo step). Returns the copy. */
10083
10350
  duplicateChannel(id, name) {
10084
10351
  const channel = this.requireChannel(id);
10085
- const copy = { ...channel, id: this.newChannelId(), name: _optionalChain([name, 'optionalAccess', _397 => _397.trim, 'call', _398 => _398()]) || `${channel.name} copy` };
10352
+ const copy = { ...channel, id: this.newChannelId(), name: _optionalChain([name, 'optionalAccess', _401 => _401.trim, 'call', _402 => _402()]) || `${channel.name} copy` };
10086
10353
  const channels = [...this.getChannels()];
10087
10354
  channels.splice(channels.findIndex((c) => c.id === id) + 1, 0, copy);
10088
10355
  this.setChannels(channels);
@@ -10113,7 +10380,7 @@ var ImageEditorController = (_class12 = class {
10113
10380
  quickMaskSurface() {
10114
10381
  const { width, height } = this.naturalSize;
10115
10382
  const sel = this.state.selection;
10116
- if (!_optionalChain([sel, 'optionalAccess', _399 => _399.bounds])) return _chunk474IQG74cjs.emptySurface.call(void 0, 1, 0);
10383
+ if (!_optionalChain([sel, 'optionalAccess', _403 => _403.bounds])) return _chunk474IQG74cjs.emptySurface.call(void 0, 1, 0);
10117
10384
  return (sel.width === width && sel.height === height ? sel : _chunkSS53NNZOcjs.resizeSelection.call(void 0, sel, width, height)).surface;
10118
10385
  }
10119
10386
  /** The selection a painted Quick Mask surface stands for (it shares the surface's tiles). */
@@ -10134,7 +10401,7 @@ var ImageEditorController = (_class12 = class {
10134
10401
  */
10135
10402
  applySelectionAsLayerMask(layerId, props = {}) {
10136
10403
  const sel = this.state.selection;
10137
- if (!_optionalChain([sel, 'optionalAccess', _400 => _400.bounds]) || !this.getAdjustmentLayer(layerId)) return false;
10404
+ if (!_optionalChain([sel, 'optionalAccess', _404 => _404.bounds]) || !this.getAdjustmentLayer(layerId)) return false;
10138
10405
  return this.setLayerMask(layerId, this.maskFromSelection(sel, props));
10139
10406
  }
10140
10407
  setLayerMask(layerId, mask, commitToHistory = true) {
@@ -10183,7 +10450,7 @@ var ImageEditorController = (_class12 = class {
10183
10450
  let layer;
10184
10451
  if (target === "selection") {
10185
10452
  mask = this.getSelection();
10186
- if (!_optionalChain([mask, 'optionalAccess', _401 => _401.bounds])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Nothing is selected: make a selection first, or inspect a layer-mask or vector-mask with layerId.");
10453
+ if (!_optionalChain([mask, 'optionalAccess', _405 => _405.bounds])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Nothing is selected: make a selection first, or inspect a layer-mask or vector-mask with layerId.");
10187
10454
  } else if (target === "layer-mask" || target === "vector-mask") {
10188
10455
  if (!options.layerId) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`A ${target} needs layerId (see list_layers).`);
10189
10456
  layer = this.getLayer(options.layerId);
@@ -10204,15 +10471,105 @@ var ImageEditorController = (_class12 = class {
10204
10471
  const x = Math.max(0, b.x - 8);
10205
10472
  const y = Math.max(0, b.y - 8);
10206
10473
  const region = { x, y, width: Math.min(width, b.x + b.width + 8) - x, height: Math.min(height, b.y + b.height + 8) - y };
10207
- const own = _optionalChain([layer, 'optionalAccess', _402 => _402.type]) === "pixel" ? this.getLayerPixels(layer.id) : null;
10474
+ const own = _optionalChain([layer, 'optionalAccess', _406 => _406.type]) === "pixel" ? this.getLayerPixels(layer.id) : null;
10208
10475
  const image = _nullishCoalesce(own, () => ( { ...this.compositePixels(region), x: region.x, y: region.y }));
10209
10476
  const report = inspectMaskEdge(mask, image, options);
10210
10477
  return { target, ...layer ? { layerId: layer.id } : {}, ...report };
10211
10478
  }
10479
+ /** Whole-pixel rectangles inside the canvas, or a useful error; undefined stays undefined. */
10480
+ checkRegions(regions2) {
10481
+ if (regions2 === void 0) return void 0;
10482
+ const { width, height } = this.naturalSize;
10483
+ if (!Array.isArray(regions2) || !regions2.length) throw new Error("regions must be a non-empty list of { x, y, width, height } (e.g. the uncertainRegions bounds); leave it out to refine everywhere.");
10484
+ return regions2.map((r, i) => {
10485
+ const x = Math.max(0, Math.floor(_optionalChain([r, 'optionalAccess', _407 => _407.x])));
10486
+ const y = Math.max(0, Math.floor(_optionalChain([r, 'optionalAccess', _408 => _408.y])));
10487
+ const x1 = Math.min(width, Math.ceil(_optionalChain([r, 'optionalAccess', _409 => _409.x]) + _optionalChain([r, 'optionalAccess', _410 => _410.width])));
10488
+ const y1 = Math.min(height, Math.ceil(_optionalChain([r, 'optionalAccess', _411 => _411.y]) + _optionalChain([r, 'optionalAccess', _412 => _412.height])));
10489
+ if (![x, y, x1, y1].every(Number.isFinite) || x1 <= x || y1 <= y) throw new Error(`regions[${i}] must overlap the image (0..${width} \xD7 0..${height}), got ${JSON.stringify(r)}.`);
10490
+ return { x, y, width: x1 - x, height: y1 - y };
10491
+ });
10492
+ }
10493
+ /**
10494
+ * Where the selection is unsure of itself: the stretches of its edge with no image edge under
10495
+ * them, widened into a band (a trimap's unknown), as a mask and regions with bounds and
10496
+ * confidence, least confident first. Measured against the composite. Read-only; an empty
10497
+ * selection has none.
10498
+ */
10499
+ selectionUncertainty(options = {}) {
10500
+ const { width, height } = this.naturalSize;
10501
+ const sel = this.getSelection();
10502
+ if (!_optionalChain([sel, 'optionalAccess', _413 => _413.bounds])) return selectionUncertainty(_chunkSS53NNZOcjs.createSelectionMask.call(void 0, width, height), { x: 0, y: 0, width: 0, height: 0, data: new Uint8ClampedArray(0) }, options);
10503
+ const b = sel.bounds;
10504
+ const m = Math.max(8, Math.ceil(_nullishCoalesce(options.band, () => ( Math.max(2, Math.min(width, height) / 200)))) + 4);
10505
+ const x = Math.max(0, b.x - m);
10506
+ const y = Math.max(0, b.y - m);
10507
+ const region = { x, y, width: Math.min(width, b.x + b.width + m) - x, height: Math.min(height, b.y + b.height + m) - y };
10508
+ return selectionUncertainty(sel, { ...this.compositePixels(region), x, y }, options);
10509
+ }
10510
+ /**
10511
+ * A selection to compare (`compareSelections`): the current one, the one `steps` undo steps
10512
+ * ago, a saved channel, or a layer's painted or vector mask. `null` is nothing selected.
10513
+ */
10514
+ selectionFrom(source) {
10515
+ const { width, height } = this.naturalSize;
10516
+ switch (_optionalChain([source, 'optionalAccess', _414 => _414.kind])) {
10517
+ case "selection":
10518
+ return this.getSelection();
10519
+ case "history": {
10520
+ const steps = _nullishCoalesce(source.steps, () => ( 1));
10521
+ const depth = this.undoStack.length;
10522
+ if (!Number.isInteger(steps) || steps < 1) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`steps must be a whole number of undo steps back, at least 1; got ${String(source.steps)}.`);
10523
+ if (steps > depth) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`There ${depth === 1 ? "is 1 undo step" : `are ${depth} undo steps`}; steps must be 1..${depth || 1}${depth ? "" : " once something has been done"}.`);
10524
+ return _nullishCoalesce(this.undoStack[depth - steps].selection, () => ( null));
10525
+ }
10526
+ case "channel":
10527
+ return this.requireChannel(source.channelId).mask;
10528
+ case "layer-mask": {
10529
+ const layer = this.getLayer(source.layerId);
10530
+ if (!layer) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`There is no layer "${source.layerId}" (see list_layers).`);
10531
+ const mask = this.layerMaskCoverage(layer.id);
10532
+ if (!mask) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`Layer "${layer.name || layer.id}" has no painted mask; add one with add_layer_mask, or compare its vector-mask.`);
10533
+ return mask;
10534
+ }
10535
+ case "vector-mask": {
10536
+ const layer = this.getLayer(source.layerId);
10537
+ if (!layer) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`There is no layer "${source.layerId}" (see list_layers).`);
10538
+ const { vm } = this.requireVectorMask(layer.id);
10539
+ const mask = pathToSelection(vm.components, width, height, { fillRule: vm.fillRule });
10540
+ return vm.inverted ? _chunkSS53NNZOcjs.invertSelection.call(void 0, mask) : mask;
10541
+ }
10542
+ default:
10543
+ throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`Unknown selection source ${JSON.stringify(source)}. Use selection, history, channel, layer-mask or vector-mask.`);
10544
+ }
10545
+ }
10546
+ /**
10547
+ * What changed from selection `a` (default: before the last undo step) to `b` (default: the
10548
+ * current selection): added and removed area with their largest pieces, IoU and the coverage
10549
+ * change. With `show` (default true) the canvas tints added area green and removed red until the
10550
+ * selection next changes (view state, no undo step). Read-only otherwise.
10551
+ */
10552
+ compareSelections(a = { kind: "history", steps: 1 }, b = { kind: "selection" }, options = {}) {
10553
+ const { width, height } = this.naturalSize;
10554
+ const ma = this.selectionFrom(a);
10555
+ const mb = this.selectionFrom(b);
10556
+ const { addedMask, removedMask, ...diff } = compareSelectionMasks(ma, mb, width, height, options);
10557
+ if (options.show !== false) {
10558
+ this.state.selectionDiff = diff.identical ? null : { added: addedMask, removed: removedMask, selection: _nullishCoalesce(this.state.selection, () => ( null)) };
10559
+ this.notify();
10560
+ }
10561
+ return diff;
10562
+ }
10563
+ /** Hides the `compareSelections` overlay. */
10564
+ clearSelectionDiff() {
10565
+ if (!this.state.selectionDiff) return;
10566
+ this.state.selectionDiff = null;
10567
+ this.notify();
10568
+ }
10212
10569
  /** A layer's painted mask over the canvas as a selection mask; null without one (or for a depth mask). */
10213
10570
  layerMaskCoverage(layerId) {
10214
10571
  const layer = this.getLayer(layerId);
10215
- if (!_optionalChain([layer, 'optionalAccess', _403 => _403.mask]) || layer.mask.source) return null;
10572
+ if (!_optionalChain([layer, 'optionalAccess', _415 => _415.mask]) || layer.mask.source) return null;
10216
10573
  const { width, height } = this.naturalSize;
10217
10574
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
10218
10575
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
@@ -10247,7 +10604,7 @@ var ImageEditorController = (_class12 = class {
10247
10604
  this.state.layers = _chunkB46UQUDCcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
10248
10605
  const next = { ...l };
10249
10606
  if (_chunkS55JFWDAcjs.isDefaultDepthMask.call(void 0, merged)) {
10250
- if (_optionalChain([next, 'access', _404 => _404.mask, 'optionalAccess', _405 => _405.source])) delete next.mask;
10607
+ if (_optionalChain([next, 'access', _416 => _416.mask, 'optionalAccess', _417 => _417.source])) delete next.mask;
10251
10608
  } else next.mask = _chunkS55JFWDAcjs.depthRasterMask.call(void 0, merged);
10252
10609
  return next;
10253
10610
  });
@@ -10257,7 +10614,7 @@ var ImageEditorController = (_class12 = class {
10257
10614
  resetDepthMask() {
10258
10615
  this.recordHistory();
10259
10616
  const target = this.developLayer();
10260
- if (_optionalChain([target, 'optionalAccess', _406 => _406.mask, 'optionalAccess', _407 => _407.source])) {
10617
+ if (_optionalChain([target, 'optionalAccess', _418 => _418.mask, 'optionalAccess', _419 => _419.source])) {
10261
10618
  this.state.layers = _chunkB46UQUDCcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
10262
10619
  const next = { ...l };
10263
10620
  delete next.mask;
@@ -10269,7 +10626,7 @@ var ImageEditorController = (_class12 = class {
10269
10626
  // --- Annotations & Layers ---
10270
10627
  /** The layer showing annotation `id`: an annotation layer, or a shape layer migrated from it. */
10271
10628
  annotationLayer(id) {
10272
- return _chunkB46UQUDCcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkS55JFWDAcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _408 => _408.id]) === id);
10629
+ return _chunkB46UQUDCcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkS55JFWDAcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _420 => _420.id]) === id);
10273
10630
  }
10274
10631
  /** What migrating an annotation needs: the canvas size, patterns and the text shaper. */
10275
10632
  annotationEnv() {
@@ -10287,7 +10644,7 @@ var ImageEditorController = (_class12 = class {
10287
10644
  const fullAnnotation = { ...annotation, id };
10288
10645
  const layer = _chunkS55JFWDAcjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
10289
10646
  const loc = placement.aboveId ? _chunkB46UQUDCcjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
10290
- this.state.layers = loc ? _chunkB46UQUDCcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _409 => _409.parent, 'optionalAccess', _410 => _410.id]), () => ( null)), loc.index + 1) : _chunkB46UQUDCcjs.insertLayer.call(void 0, this.state.layers, layer, null);
10647
+ this.state.layers = loc ? _chunkB46UQUDCcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _421 => _421.parent, 'optionalAccess', _422 => _422.id]), () => ( null)), loc.index + 1) : _chunkB46UQUDCcjs.insertLayer.call(void 0, this.state.layers, layer, null);
10291
10648
  this.state.selectedAnnotationId = id;
10292
10649
  this.notify();
10293
10650
  return id;
@@ -10367,7 +10724,7 @@ var ImageEditorController = (_class12 = class {
10367
10724
  this.notify();
10368
10725
  }
10369
10726
  // --- Rendering & Export ---
10370
- __init102() {this.blankSource = null}
10727
+ __init103() {this.blankSource = null}
10371
10728
  /**
10372
10729
  * What the renderer draws from: the source image, or, for a document without one (an opened
10373
10730
  * PSD, a v3 document loaded on its own), a transparent canvas of the document size, since every
@@ -10410,11 +10767,11 @@ var ImageEditorController = (_class12 = class {
10410
10767
  await this.renderer.renderToCanvas(targetCanvas, source, this.state, {
10411
10768
  ...options,
10412
10769
  // The clone source follows the brush cursor (both editors pass it).
10413
- cloneSourceMarker: _optionalChain([options, 'optionalAccess', _411 => _411.cloneSourceMarker]) !== void 0 ? options.cloneSourceMarker : _optionalChain([options, 'optionalAccess', _412 => _412.brushCursor]) ? this.cloneSourceMarker(options.brushCursor) : null,
10770
+ cloneSourceMarker: _optionalChain([options, 'optionalAccess', _423 => _423.cloneSourceMarker]) !== void 0 ? options.cloneSourceMarker : _optionalChain([options, 'optionalAccess', _424 => _424.brushCursor]) ? this.cloneSourceMarker(options.brushCursor) : null,
10414
10771
  dirty: dirty === "all" ? void 0 : dirty,
10415
10772
  checkpointLayerId: this.state.activeLayerId
10416
10773
  });
10417
- } catch (e32) {
10774
+ } catch (e33) {
10418
10775
  }
10419
10776
  }
10420
10777
  async renderExport(options) {
@@ -10423,7 +10780,7 @@ var ImageEditorController = (_class12 = class {
10423
10780
  return this.renderer.createCanvas(1, 1);
10424
10781
  }
10425
10782
  this.syncViews();
10426
- if (_optionalChain([options, 'optionalAccess', _413 => _413.layerIds])) {
10783
+ if (_optionalChain([options, 'optionalAccess', _425 => _425.layerIds])) {
10427
10784
  const keep = new Set(options.layerIds);
10428
10785
  const layers = _chunkB46UQUDCcjs.flattenLayers.call(void 0, this.state.layers).filter((l) => keep.has(l.id));
10429
10786
  return this.renderer.renderExport(source, { ...this.state, layers }, options);
@@ -10469,7 +10826,7 @@ var ImageEditorController = (_class12 = class {
10469
10826
  try {
10470
10827
  if (mime === "image/png") return _chunkBROJYMWUcjs.writePngIcc.call(void 0, bytes, icc, this.getColorProfile().name);
10471
10828
  if (mime === "image/jpeg") return _chunkBROJYMWUcjs.writeJpegIcc.call(void 0, bytes, icc);
10472
- } catch (e33) {
10829
+ } catch (e34) {
10473
10830
  }
10474
10831
  return bytes;
10475
10832
  }
@@ -10577,7 +10934,7 @@ var ImageEditorController = (_class12 = class {
10577
10934
  let px2 = await this.decodeImage(newDataUrl);
10578
10935
  if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
10579
10936
  const data = new Uint8ClampedArray(px2.data);
10580
- const sel = _optionalChain([this, 'access', _414 => _414.state, 'access', _415 => _415.selection, 'optionalAccess', _416 => _416.bounds]) ? this.state.selection : null;
10937
+ const sel = _optionalChain([this, 'access', _426 => _426.state, 'access', _427 => _427.selection, 'optionalAccess', _428 => _428.bounds]) ? this.state.selection : null;
10581
10938
  if (sel) for (let p = 0, i = 3; p < width * height; p++, i += 4) data[i] = Math.round(data[i] * sel.data[p] / 255);
10582
10939
  return this.addPixelLayer({ name: "Inpaint", pixels: { width, height, data } });
10583
10940
  }
@@ -10624,7 +10981,7 @@ var ImageEditorController = (_class12 = class {
10624
10981
  }
10625
10982
  /** Font families the shaper offers (generic families at least). */
10626
10983
  listFonts() {
10627
- return _nullishCoalesce(_optionalChain([this, 'access', _417 => _417.getTextShaper, 'call', _418 => _418(), 'optionalAccess', _419 => _419.families, 'optionalCall', _420 => _420()]), () => ( ["sans-serif", "serif", "monospace"]));
10984
+ return _nullishCoalesce(_optionalChain([this, 'access', _429 => _429.getTextShaper, 'call', _430 => _430(), 'optionalAccess', _431 => _431.families, 'optionalCall', _432 => _432()]), () => ( ["sans-serif", "serif", "monospace"]));
10628
10985
  }
10629
10986
  typeInfo(id) {
10630
10987
  const layer = _chunkS55JFWDAcjs.requireTypeLayer.call(void 0, this.state.layers, id);
@@ -10698,8 +11055,8 @@ var ImageEditorController = (_class12 = class {
10698
11055
  const layer = this.layoutTypeLayer({ ...init, text, orientation: vertical ? "vertical" : "horizontal" });
10699
11056
  const { width, height } = this.naturalSize;
10700
11057
  const b = _chunk474IQG74cjs.contentBounds.call(void 0, layer.surface);
10701
- const x0 = Math.max(0, _nullishCoalesce(_optionalChain([b, 'optionalAccess', _421 => _421.x]), () => ( 0)));
10702
- const y0 = Math.max(0, _nullishCoalesce(_optionalChain([b, 'optionalAccess', _422 => _422.y]), () => ( 0)));
11058
+ const x0 = Math.max(0, _nullishCoalesce(_optionalChain([b, 'optionalAccess', _433 => _433.x]), () => ( 0)));
11059
+ const y0 = Math.max(0, _nullishCoalesce(_optionalChain([b, 'optionalAccess', _434 => _434.y]), () => ( 0)));
10703
11060
  const x1 = Math.min(width, b ? b.x + b.width : 0);
10704
11061
  const y1 = Math.min(height, b ? b.y + b.height : 0);
10705
11062
  let mask;
@@ -10876,7 +11233,7 @@ var ImageEditorController = (_class12 = class {
10876
11233
  if (colors.size > 1) warnings.push("The text had several colours; the shape takes the first one.");
10877
11234
  const missing = _chunkQAUIZPYIcjs.layoutText.call(void 0, layer, shaper).missingFonts;
10878
11235
  if (missing.length) warnings.push(`Missing fonts were drawn with a fallback: ${missing.join(", ")}.`);
10879
- const first = _nullishCoalesce(_optionalChain([layer, 'access', _423 => _423.runs, 'access', _424 => _424.find, 'call', _425 => _425((r) => r.length > 0), 'optionalAccess', _426 => _426.style]), () => ( _chunkQAUIZPYIcjs.DEFAULT_TEXT_STYLE));
11236
+ const first = _nullishCoalesce(_optionalChain([layer, 'access', _435 => _435.runs, 'access', _436 => _436.find, 'call', _437 => _437((r) => r.length > 0), 'optionalAccess', _438 => _438.style]), () => ( _chunkQAUIZPYIcjs.DEFAULT_TEXT_STYLE));
10880
11237
  const fill = first.opacity !== void 0 && first.opacity !== 1 ? { type: "color", color: first.color, opacity: first.opacity } : { type: "color", color: first.color };
10881
11238
  const shape = _chunkS55JFWDAcjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
10882
11239
  const keep = { visible: layer.visible, opacity: layer.opacity, blend: layer.blend };
@@ -10909,7 +11266,7 @@ var ImageEditorController = (_class12 = class {
10909
11266
  // --- Shape layers ---
10910
11267
  /** What shape rendering needs: the canvas size and the document's patterns. */
10911
11268
  shapeEnv() {
10912
- return { ...this.naturalSize, pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _427 => _427.state, 'access', _428 => _428.patterns, 'optionalAccess', _429 => _429.find, 'call', _430 => _430((p) => p.id === id)]), () => ( null)) };
11269
+ return { ...this.naturalSize, pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _439 => _439.state, 'access', _440 => _440.patterns, 'optionalAccess', _441 => _441.find, 'call', _442 => _442((p) => p.id === id)]), () => ( null)) };
10913
11270
  }
10914
11271
  /** One component from tool or UI input (validated). */
10915
11272
  componentFrom(spec, path) {
@@ -10952,9 +11309,9 @@ var ImageEditorController = (_class12 = class {
10952
11309
  * open path) and stroked with `stroke`. Goes above the active layer unless placed. Returns its id.
10953
11310
  */
10954
11311
  addShapeLayer(init) {
10955
- const specs = _optionalChain([init, 'access', _431 => _431.components, 'optionalAccess', _432 => _432.length]) ? init.components : [init];
10956
- if (_optionalChain([init, 'access', _433 => _433.components, 'optionalAccess', _434 => _434.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
10957
- const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _435 => _435.components, 'optionalAccess', _436 => _436.length]) ? `components[${i}].` : ""));
11312
+ const specs = _optionalChain([init, 'access', _443 => _443.components, 'optionalAccess', _444 => _444.length]) ? init.components : [init];
11313
+ if (_optionalChain([init, 'access', _445 => _445.components, 'optionalAccess', _446 => _446.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
11314
+ const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _447 => _447.components, 'optionalAccess', _448 => _448.length]) ? `components[${i}].` : ""));
10958
11315
  const stroke = init.stroke ? _chunkS55JFWDAcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
10959
11316
  const openOnly = components.every((c) => !c.live && c.subpaths.every((sp) => !sp.closed));
10960
11317
  const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkS55JFWDAcjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkS55JFWDAcjs.normalizeShapePaint.call(void 0, init.fill, "fill");
@@ -11065,7 +11422,7 @@ var ImageEditorController = (_class12 = class {
11065
11422
  if (layer.locks) next.locks = layer.locks;
11066
11423
  if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
11067
11424
  } else if (layer.type === "pixel") {
11068
- if (!_optionalChain([layer, 'access', _437 => _437.filters, 'optionalAccess', _438 => _438.length])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
11425
+ if (!_optionalChain([layer, 'access', _449 => _449.filters, 'optionalAccess', _450 => _450.length])) throw new (0, _chunkS55JFWDAcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
11069
11426
  _chunkS55JFWDAcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
11070
11427
  const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
11071
11428
  const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
@@ -11084,7 +11441,7 @@ var ImageEditorController = (_class12 = class {
11084
11441
  return this.rasterizeSmartObject(id);
11085
11442
  } else if (layer.type === "shape" || layer.type === "type") {
11086
11443
  next = layer.type === "shape" ? _chunkS55JFWDAcjs.shapeAsPixelLayer.call(void 0, layer) : _chunkS55JFWDAcjs.typeAsPixelLayer.call(void 0, layer);
11087
- if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _439 => _439.annotation, 'optionalAccess', _440 => _440.id])) this.state.selectedAnnotationId = null;
11444
+ if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _451 => _451.annotation, 'optionalAccess', _452 => _452.id])) this.state.selectedAnnotationId = null;
11088
11445
  } else {
11089
11446
  throw new (0, _chunkS55JFWDAcjs.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.`);
11090
11447
  }
@@ -11098,8 +11455,8 @@ var ImageEditorController = (_class12 = class {
11098
11455
  const doc = this.state.colorProfile;
11099
11456
  const p = resolveProfile(doc);
11100
11457
  const m = this.state.colorMode;
11101
- const out = { name: _nullishCoalesce(_optionalChain([doc, 'optionalAccess', _441 => _441.name]), () => ( p.description)), builtin: doc ? _nullishCoalesce(doc.builtin, () => ( null)) : "srgb", colorSpace: p.colorSpace, srgb: isSrgb(doc), mode: _nullishCoalesce(_optionalChain([m, 'optionalAccess', _442 => _442.mode]), () => ( "rgb")) };
11102
- if (_optionalChain([m, 'optionalAccess', _443 => _443.mode]) === "cmyk") out.cmykProfile = { name: m.profile.name, builtin: _nullishCoalesce(m.profile.builtin, () => ( null)), intent: m.intent };
11458
+ const out = { name: _nullishCoalesce(_optionalChain([doc, 'optionalAccess', _453 => _453.name]), () => ( p.description)), builtin: doc ? _nullishCoalesce(doc.builtin, () => ( null)) : "srgb", colorSpace: p.colorSpace, srgb: isSrgb(doc), mode: _nullishCoalesce(_optionalChain([m, 'optionalAccess', _454 => _454.mode]), () => ( "rgb")) };
11459
+ if (_optionalChain([m, 'optionalAccess', _455 => _455.mode]) === "cmyk") out.cmykProfile = { name: m.profile.name, builtin: _nullishCoalesce(m.profile.builtin, () => ( null)), intent: m.intent };
11103
11460
  return out;
11104
11461
  }
11105
11462
  /**
@@ -11189,7 +11546,7 @@ var ImageEditorController = (_class12 = class {
11189
11546
  const textEnv = this.textEnv();
11190
11547
  const walk = (layers) => layers.map((l) => {
11191
11548
  let next2 = l;
11192
- if (_optionalChain([l, 'access', _444 => _444.effects, 'optionalAccess', _445 => _445.items, 'access', _446 => _446.length])) next2 = { ...next2, effects: convertColorFields(l.effects, hex) };
11549
+ if (_optionalChain([l, 'access', _456 => _456.effects, 'optionalAccess', _457 => _457.items, 'access', _458 => _458.length])) next2 = { ...next2, effects: convertColorFields(l.effects, hex) };
11193
11550
  if (l.type === "group") {
11194
11551
  if (next2 !== l) converted.push(l.id);
11195
11552
  return { ...next2, children: walk(l.children) };
@@ -11203,7 +11560,7 @@ var ImageEditorController = (_class12 = class {
11203
11560
  const recoloured = { ...next2, runs: convertColorFields(l.runs, hex) };
11204
11561
  try {
11205
11562
  next2 = _chunkS55JFWDAcjs.rerenderText.call(void 0, recoloured, textEnv);
11206
- } catch (e34) {
11563
+ } catch (e35) {
11207
11564
  next2 = { ...recoloured, surface: convertSurfaceColors(l.surface, t) };
11208
11565
  }
11209
11566
  } else if (l.type === "annotation") next2 = { ...next2, annotation: convertColorFields(l.annotation, hex) };
@@ -11377,8 +11734,8 @@ var ImageEditorController = (_class12 = class {
11377
11734
  else delete s.bitDepth;
11378
11735
  delete s.colorProfile;
11379
11736
  delete s.colorMode;
11380
- if (_optionalChain([result, 'access', _447 => _447.sourceMode, 'optionalAccess', _448 => _448.mode]) === "cmyk") s.colorMode = { mode: "cmyk", profile: result.sourceMode.profile, intent: "relative" };
11381
- else if (_optionalChain([result, 'access', _449 => _449.sourceMode, 'optionalAccess', _450 => _450.mode]) === "lab") s.colorMode = { mode: "lab" };
11737
+ if (_optionalChain([result, 'access', _459 => _459.sourceMode, 'optionalAccess', _460 => _460.mode]) === "cmyk") s.colorMode = { mode: "cmyk", profile: result.sourceMode.profile, intent: "relative" };
11738
+ else if (_optionalChain([result, 'access', _461 => _461.sourceMode, 'optionalAccess', _462 => _462.mode]) === "lab") s.colorMode = { mode: "lab" };
11382
11739
  else if (result.iccProfile) {
11383
11740
  try {
11384
11741
  const doc = documentProfile(result.iccProfile);
@@ -11442,7 +11799,7 @@ var ImageEditorController = (_class12 = class {
11442
11799
  const compositor = new (0, _chunkS55JFWDAcjs.LayerCompositor)();
11443
11800
  const bakeMask = (layer) => {
11444
11801
  const mask = layer.mask;
11445
- if (!_optionalChain([mask, 'optionalAccess', _451 => _451.source])) return mask;
11802
+ if (!_optionalChain([mask, 'optionalAccess', _463 => _463.source])) return mask;
11446
11803
  add2("Parametric (depth) masks were baked into pixel masks", layer.name);
11447
11804
  const plain3 = { ...layer, mask: { ...mask, density: 1, feather: 0, enabled: true } };
11448
11805
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
@@ -11458,10 +11815,10 @@ var ImageEditorController = (_class12 = class {
11458
11815
  return baked;
11459
11816
  };
11460
11817
  const prepare = async (layer) => {
11461
- if (_optionalChain([layer, 'access', _452 => _452.edge, 'optionalAccess', _453 => _453.ambient])) add2("The live edge cast (set_edge_ambient) has no PSD equivalent and was left out", layer.name);
11818
+ if (_optionalChain([layer, 'access', _464 => _464.edge, 'optionalAccess', _465 => _465.ambient])) add2("The live edge cast (set_edge_ambient) has no PSD equivalent and was left out", layer.name);
11462
11819
  const p = await prepareLayer(layer);
11463
- if (_optionalChain([p, 'optionalAccess', _454 => _454.edge])) delete p.edge;
11464
- if (_optionalChain([p, 'optionalAccess', _455 => _455.blend]) === "pigment") add2("The Pigment blend mode has no PSD equivalent and was written as Normal", layer.name);
11820
+ if (_optionalChain([p, 'optionalAccess', _466 => _466.edge])) delete p.edge;
11821
+ if (_optionalChain([p, 'optionalAccess', _467 => _467.blend]) === "pigment") add2("The Pigment blend mode has no PSD equivalent and was written as Normal", layer.name);
11465
11822
  return p;
11466
11823
  };
11467
11824
  const prepareLayer = async (layer) => {
@@ -11504,7 +11861,7 @@ var ImageEditorController = (_class12 = class {
11504
11861
  return out2;
11505
11862
  }
11506
11863
  if (layer.type === "shape" || layer.type === "type") {
11507
- if (layer.type === "type" && _optionalChain([layer, 'access', _456 => _456.missingFonts, 'optionalAccess', _457 => _457.length])) add2(`Type layers drawn with a fallback for missing fonts (${layer.missingFonts.join(", ")}) keep the font names, so Photoshop may draw them differently`, layer.name);
11864
+ if (layer.type === "type" && _optionalChain([layer, 'access', _468 => _468.missingFonts, 'optionalAccess', _469 => _469.length])) add2(`Type layers drawn with a fallback for missing fonts (${layer.missingFonts.join(", ")}) keep the font names, so Photoshop may draw them differently`, layer.name);
11508
11865
  const out2 = { ...layer };
11509
11866
  const mask2 = bakeMask(layer);
11510
11867
  if (mask2) out2.mask = mask2;
@@ -11523,7 +11880,7 @@ var ImageEditorController = (_class12 = class {
11523
11880
  out.surface = this.surfaceOf(layer);
11524
11881
  delete out.source;
11525
11882
  }
11526
- const active = _nullishCoalesce(_optionalChain([layer, 'access', _458 => _458.filters, 'optionalAccess', _459 => _459.filter, 'call', _460 => _460(_chunkS55JFWDAcjs.isActiveFilter)]), () => ( []));
11883
+ const active = _nullishCoalesce(_optionalChain([layer, 'access', _470 => _470.filters, 'optionalAccess', _471 => _471.filter, 'call', _472 => _472(_chunkS55JFWDAcjs.isActiveFilter)]), () => ( []));
11527
11884
  if (active.length) {
11528
11885
  add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
11529
11886
  const content = { ...out, visible: true, opacity: 1, blend: "normal" };
@@ -11534,7 +11891,7 @@ var ImageEditorController = (_class12 = class {
11534
11891
  const data = compositor.composite([content], canvas, sources);
11535
11892
  out = { ...out, surface: _chunk474IQG74cjs.surfaceFromPixels.call(void 0, { width, height, data }, 4, -layer.offset.x, -layer.offset.y) };
11536
11893
  }
11537
- if (_optionalChain([layer, 'access', _461 => _461.filters, 'optionalAccess', _462 => _462.some, 'call', _463 => _463((f) => !f.enabled)])) add2("Disabled layer filters were left out", layer.name);
11894
+ if (_optionalChain([layer, 'access', _473 => _473.filters, 'optionalAccess', _474 => _474.some, 'call', _475 => _475((f) => !f.enabled)])) add2("Disabled layer filters were left out", layer.name);
11538
11895
  delete out.filters;
11539
11896
  const unmixMask = _chunkS55JFWDAcjs.hasEdgeUnmix.call(void 0, layer.edge) ? _chunkS55JFWDAcjs.effectiveLayerMask.call(void 0, layer, width, height) : void 0;
11540
11897
  if (unmixMask && !unmixMask.source && unmixMask.enabled !== false) {
@@ -11606,7 +11963,7 @@ var ImageEditorController = (_class12 = class {
11606
11963
  );
11607
11964
  }
11608
11965
  layers = resizeLegacyMasks(layers, prev, next.dimensions);
11609
- const env = { ...next.dimensions, pattern: (pid) => _nullishCoalesce(_optionalChain([this, 'access', _464 => _464.state, 'access', _465 => _465.patterns, 'optionalAccess', _466 => _466.find, 'call', _467 => _467((p) => p.id === pid)]), () => ( null)) };
11966
+ const env = { ...next.dimensions, pattern: (pid) => _nullishCoalesce(_optionalChain([this, 'access', _476 => _476.state, 'access', _477 => _477.patterns, 'optionalAccess', _478 => _478.find, 'call', _479 => _479((p) => p.id === pid)]), () => ( null)) };
11610
11967
  for (const l of _chunkB46UQUDCcjs.flattenLayers.call(void 0, layers)) {
11611
11968
  if (l.type === "annotation") {
11612
11969
  layers = _chunkB46UQUDCcjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, annotation: scaleAnnotation(l.annotation, sx, sy) }));
@@ -11615,7 +11972,7 @@ var ImageEditorController = (_class12 = class {
11615
11972
  const scaled = a ? scaleAnnotation(a, sx, sy) : null;
11616
11973
  const fromAnnotation = scaled ? _chunkS55JFWDAcjs.shapeFromAnnotation.call(void 0, scaled) : null;
11617
11974
  const m = [sx, 0, 0, sy, 0, 0];
11618
- const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _468 => _468.components]), () => ( _chunkS55JFWDAcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
11975
+ const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _480 => _480.components]), () => ( _chunkS55JFWDAcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
11619
11976
  const moved = { ...l, components, ...fromAnnotation ? { fill: fromAnnotation.fill, stroke: fromAnnotation.stroke } : {} };
11620
11977
  if (scaled && fromAnnotation) moved.annotation = scaled;
11621
11978
  else delete moved.annotation;
@@ -11633,7 +11990,7 @@ var ImageEditorController = (_class12 = class {
11633
11990
  this.notify();
11634
11991
  }
11635
11992
  toJSON(options) {
11636
- const root = _optionalChain([this, 'access', _469 => _469.contentsStack, 'access', _470 => _470[0], 'optionalAccess', _471 => _471.saved]);
11993
+ const root = _optionalChain([this, 'access', _481 => _481.contentsStack, 'access', _482 => _482[0], 'optionalAccess', _483 => _483.saved]);
11637
11994
  const current = this.state;
11638
11995
  const element = this.imageElement;
11639
11996
  if (root) {
@@ -11644,9 +12001,9 @@ var ImageEditorController = (_class12 = class {
11644
12001
  let out;
11645
12002
  try {
11646
12003
  out = this.serializeState();
11647
- if (_optionalChain([this, 'access', _472 => _472.state, 'access', _473 => _473.selection, 'optionalAccess', _474 => _474.bounds])) out.selection = _chunkSS53NNZOcjs.serializeSelection.call(void 0, this.state.selection);
11648
- if (_optionalChain([this, 'access', _475 => _475.state, 'access', _476 => _476.channels, 'optionalAccess', _477 => _477.length])) out.channels = serializeChannels(this.state.channels);
11649
- if (_optionalChain([this, 'access', _478 => _478.state, 'access', _479 => _479.paths, 'optionalAccess', _480 => _480.length])) out.paths = serializePaths(this.state.paths);
12004
+ if (_optionalChain([this, 'access', _484 => _484.state, 'access', _485 => _485.selection, 'optionalAccess', _486 => _486.bounds])) out.selection = _chunkSS53NNZOcjs.serializeSelection.call(void 0, this.state.selection);
12005
+ if (_optionalChain([this, 'access', _487 => _487.state, 'access', _488 => _488.channels, 'optionalAccess', _489 => _489.length])) out.channels = serializeChannels(this.state.channels);
12006
+ if (_optionalChain([this, 'access', _490 => _490.state, 'access', _491 => _491.paths, 'optionalAccess', _492 => _492.length])) out.paths = serializePaths(this.state.paths);
11650
12007
  } finally {
11651
12008
  if (root) {
11652
12009
  this.state = current;
@@ -11681,7 +12038,7 @@ var ImageEditorController = (_class12 = class {
11681
12038
  if (data.selection) {
11682
12039
  try {
11683
12040
  selection = normalizeSelection(_chunkSS53NNZOcjs.deserializeSelection.call(void 0, data.selection));
11684
- } catch (e35) {
12041
+ } catch (e36) {
11685
12042
  selection = null;
11686
12043
  }
11687
12044
  }
@@ -11699,7 +12056,7 @@ var ImageEditorController = (_class12 = class {
11699
12056
  this.notify();
11700
12057
  }
11701
12058
  /** Problems found by the last `loadJSON` / `initialState` of a v3 document (unreadable layers or assets). */
11702
- __init103() {this.lastLoadProblems = []}
12059
+ __init104() {this.lastLoadProblems = []}
11703
12060
  applyStored(raw) {
11704
12061
  const s = this.state;
11705
12062
  const data = migrateSerializedImageEditorState(raw);
@@ -11764,10 +12121,10 @@ var ImageEditorController = (_class12 = class {
11764
12121
  serializeState() {
11765
12122
  const { width, height } = this.naturalSize;
11766
12123
  const view = _chunkS55JFWDAcjs.legacyView.call(void 0, this.stack(), width, height, null);
11767
- if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _481 => _481.state, 'access', _482 => _482.patterns, 'optionalAccess', _483 => _483.length]) && this.bitDepth === 8 && !this.state.colorProfile && !this.state.colorMode) {
12124
+ if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _493 => _493.state, 'access', _494 => _494.patterns, 'optionalAccess', _495 => _495.length]) && this.bitDepth === 8 && !this.state.colorProfile && !this.state.colorMode) {
11768
12125
  return {
11769
12126
  // States without adjustment layers keep schema 1, so they round-trip unchanged.
11770
- version: _optionalChain([view, 'access', _484 => _484.adjustments, 'access', _485 => _485.layers, 'optionalAccess', _486 => _486.length]) ? 2 : 1,
12127
+ version: _optionalChain([view, 'access', _496 => _496.adjustments, 'access', _497 => _497.layers, 'optionalAccess', _498 => _498.length]) ? 2 : 1,
11771
12128
  crop: this.state.crop ? { ...this.state.crop } : null,
11772
12129
  transform: { ...this.state.transform },
11773
12130
  adjustments: serializeAdjustments(view.adjustments),
@@ -11792,7 +12149,7 @@ var ImageEditorController = (_class12 = class {
11792
12149
  };
11793
12150
  if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
11794
12151
  if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
11795
- if (_optionalChain([this, 'access', _487 => _487.state, 'access', _488 => _488.patterns, 'optionalAccess', _489 => _489.length])) out.patterns = _chunkS55JFWDAcjs.serializePatterns.call(void 0, this.state.patterns);
12152
+ if (_optionalChain([this, 'access', _499 => _499.state, 'access', _500 => _500.patterns, 'optionalAccess', _501 => _501.length])) out.patterns = _chunkS55JFWDAcjs.serializePatterns.call(void 0, this.state.patterns);
11796
12153
  if (smartContents) out.smartContents = smartContents;
11797
12154
  if (this.state.bitDepth === 16 || this.state.bitDepth === 32) out.bitDepth = this.state.bitDepth;
11798
12155
  if (this.state.colorProfile) out.colorProfile = serializeColorProfile(this.state.colorProfile);
@@ -11802,7 +12159,7 @@ var ImageEditorController = (_class12 = class {
11802
12159
  }, _class12);
11803
12160
  function serializeAdjustments(adjustments) {
11804
12161
  const out = { ...adjustments };
11805
- if (_optionalChain([out, 'access', _490 => _490.layers, 'optionalAccess', _491 => _491.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
12162
+ if (_optionalChain([out, 'access', _502 => _502.layers, 'optionalAccess', _503 => _503.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
11806
12163
  else delete out.layers;
11807
12164
  if (_chunkS55JFWDAcjs.normalizeProcessVersion.call(void 0, out.process) === _chunkS55JFWDAcjs.LEGACY_PROCESS_VERSION) {
11808
12165
  delete out.process;
@@ -11838,11 +12195,11 @@ function withDevelop(layer, partial) {
11838
12195
  return { ...layer, filters };
11839
12196
  }
11840
12197
  function withBlur(layer, radius) {
11841
- const existing = _optionalChain([layer, 'access', _492 => _492.filters, 'optionalAccess', _493 => _493.find, 'call', _494 => _494((f) => f.kind === "blur")]);
12198
+ const existing = _optionalChain([layer, 'access', _504 => _504.filters, 'optionalAccess', _505 => _505.find, 'call', _506 => _506((f) => f.kind === "blur")]);
11842
12199
  const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
11843
12200
  if (radius > 0) {
11844
12201
  filters.push({
11845
- id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _495 => _495.id]), () => ( (layer.source === "document" ? _chunkS55JFWDAcjs.BLUR_FILTER_ID : _chunkS55JFWDAcjs.newLayerId.call(void 0, "flt")))),
12202
+ id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _507 => _507.id]), () => ( (layer.source === "document" ? _chunkS55JFWDAcjs.BLUR_FILTER_ID : _chunkS55JFWDAcjs.newLayerId.call(void 0, "flt")))),
11846
12203
  kind: "blur",
11847
12204
  enabled: true,
11848
12205
  radius
@@ -11938,7 +12295,7 @@ function collectStateTiles(layers, into) {
11938
12295
  if (l.type === "shape" || l.type === "type") _chunk474IQG74cjs.collectTiles.call(void 0, l.surface, into);
11939
12296
  if (l.type === "smart") {
11940
12297
  _chunk474IQG74cjs.collectTiles.call(void 0, l.surface, into);
11941
- if (_optionalChain([l, 'access', _496 => _496.smartFilters, 'optionalAccess', _497 => _497.mask])) _chunk474IQG74cjs.collectTiles.call(void 0, l.smartFilters.mask.surface, into);
12298
+ if (_optionalChain([l, 'access', _508 => _508.smartFilters, 'optionalAccess', _509 => _509.mask])) _chunk474IQG74cjs.collectTiles.call(void 0, l.smartFilters.mask.surface, into);
11942
12299
  if (l.contents.raster) _chunk474IQG74cjs.collectTiles.call(void 0, l.contents.raster, into);
11943
12300
  if (l.contents.document) collectStateTiles(l.contents.document.layers, into);
11944
12301
  }
@@ -11970,7 +12327,7 @@ function pixelsOnly(layers) {
11970
12327
  for (const l of layers) {
11971
12328
  if (l.type === "adjustment") continue;
11972
12329
  if (l.type === "group") out.push({ ...l, children: pixelsOnly(l.children) });
11973
- else if (l.type === "pixel" && _optionalChain([l, 'access', _498 => _498.filters, 'optionalAccess', _499 => _499.length])) {
12330
+ else if (l.type === "pixel" && _optionalChain([l, 'access', _510 => _510.filters, 'optionalAccess', _511 => _511.length])) {
11974
12331
  const p = { ...l };
11975
12332
  delete p.filters;
11976
12333
  out.push(p);
@@ -12036,7 +12393,7 @@ function toHex(c) {
12036
12393
  return "#" + [c[0], c[1], c[2]].map((v) => Math.round(v).toString(16).padStart(2, "0")).join("");
12037
12394
  }
12038
12395
  function normalizeSelection(mask) {
12039
- return _optionalChain([mask, 'optionalAccess', _500 => _500.bounds]) ? mask : null;
12396
+ return _optionalChain([mask, 'optionalAccess', _512 => _512.bounds]) ? mask : null;
12040
12397
  }
12041
12398
  function sameSelection(a, b) {
12042
12399
  if (a.width !== b.width || a.height !== b.height) return false;
@@ -12190,7 +12547,7 @@ function loadImageEditorDocument(input) {
12190
12547
  if (typeof input === "string") {
12191
12548
  try {
12192
12549
  parsed = JSON.parse(input);
12193
- } catch (e36) {
12550
+ } catch (e37) {
12194
12551
  parsed = input;
12195
12552
  }
12196
12553
  }
@@ -12246,7 +12603,7 @@ function loadImageEditorDocument(input) {
12246
12603
  }
12247
12604
  const state = { version: 1, ...result.value };
12248
12605
  if (isV2) {
12249
- if (_optionalChain([state, 'access', _501 => _501.adjustments, 'access', _502 => _502.layers, 'optionalAccess', _503 => _503.length])) state.version = 2;
12606
+ if (_optionalChain([state, 'access', _513 => _513.adjustments, 'access', _514 => _514.layers, 'optionalAccess', _515 => _515.length])) state.version = 2;
12250
12607
  result.report.version = 2;
12251
12608
  }
12252
12609
  if (state.selection === void 0) delete state.selection;
@@ -12454,7 +12811,7 @@ function findAdjustmentControl(id) {
12454
12811
  }
12455
12812
  function findLayerControl(kind, id) {
12456
12813
  if (id === "opacity") return ADJUSTMENT_LAYER_OPACITY_CONTROL;
12457
- return _optionalChain([ADJUSTMENT_LAYER_CONTROLS, 'access', _504 => _504[kind], 'optionalAccess', _505 => _505.find, 'call', _506 => _506((c) => c.id === id)]);
12814
+ return _optionalChain([ADJUSTMENT_LAYER_CONTROLS, 'access', _516 => _516[kind], 'optionalAccess', _517 => _517.find, 'call', _518 => _518((c) => c.id === id)]);
12458
12815
  }
12459
12816
  function clampControlValue(spec, v) {
12460
12817
  if (typeof v !== "number" || !Number.isFinite(v)) return spec.default;
@@ -12921,13 +13278,17 @@ function rectOf(args) {
12921
13278
  if (rect2.width <= 0 || rect2.height <= 0) throw new Error("width and height must be greater than 0.");
12922
13279
  return rect2;
12923
13280
  }
13281
+ function uncertainty(controller) {
13282
+ const u = controller.selectionUncertainty();
13283
+ return { uncertainRegions: u.regions, uncertainCount: u.count, edgeConfidence: u.confidence };
13284
+ }
12924
13285
  function summary(controller) {
12925
13286
  const sel = controller.getSelection();
12926
13287
  const { width, height } = controller.getState().imageDimensions;
12927
13288
  const area = _chunkSS53NNZOcjs.selectionArea.call(void 0, sel);
12928
13289
  return {
12929
13290
  empty: !sel,
12930
- bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _507 => _507.bounds]), () => ( null)),
13291
+ bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _519 => _519.bounds]), () => ( null)),
12931
13292
  /** Σ coverage in pixels. */
12932
13293
  area: Math.round(area),
12933
13294
  percent: Math.round(area / Math.max(1, width * height) * 1e4) / 100,
@@ -12970,6 +13331,65 @@ function createImageSelectionTools(controller) {
12970
13331
  return controller.inspectMaskEdge(t, { layerId, minArea });
12971
13332
  }
12972
13333
  };
13334
+ const sourceSchema = (which, dflt) => ({
13335
+ type: "object",
13336
+ properties: {
13337
+ source: { type: "string", enum: ["selection", "history", "channel", "layer-mask", "vector-mask"], description: "selection: the current one; history: as it was steps undo steps ago; channel: a saved selection (channelId, see list_channels); layer-mask / vector-mask: a layer's mask (layerId)." },
13338
+ steps: { type: "integer", minimum: 1, description: "history only: how many undo steps back (default 1, before the last edit)." },
13339
+ channelId: { type: "string", description: "channel only: the channel id from list_channels." },
13340
+ layerId: { type: "string", description: "layer-mask and vector-mask only: the layer id from list_layers." }
13341
+ },
13342
+ required: ["source"],
13343
+ additionalProperties: false,
13344
+ description: `${which} (default ${dflt}).`
13345
+ });
13346
+ const toSource = (v, fallback) => {
13347
+ if (v === void 0) return fallback;
13348
+ const o = v;
13349
+ const extra = (keys) => {
13350
+ const bad = Object.keys(o).filter((k) => k !== "source" && !keys.includes(k));
13351
+ if (bad.length) throw new Error(`${bad.join(", ")} ${bad.length === 1 ? "does" : "do"} not apply to source ${o.source}.`);
13352
+ };
13353
+ switch (o.source) {
13354
+ case "selection":
13355
+ extra([]);
13356
+ return { kind: "selection" };
13357
+ case "history":
13358
+ extra(["steps"]);
13359
+ return { kind: "history", steps: _nullishCoalesce(o.steps, () => ( 1)) };
13360
+ case "channel":
13361
+ extra(["channelId"]);
13362
+ if (!o.channelId) throw new Error("source channel needs channelId (see list_channels).");
13363
+ return { kind: "channel", channelId: o.channelId };
13364
+ case "layer-mask":
13365
+ case "vector-mask":
13366
+ extra(["layerId"]);
13367
+ if (!o.layerId) throw new Error(`source ${o.source} needs layerId (see list_layers).`);
13368
+ return { kind: o.source, layerId: o.layerId };
13369
+ default:
13370
+ throw new Error(`Unknown source "${String(o.source)}". Use selection, history, channel, layer-mask or vector-mask.`);
13371
+ }
13372
+ };
13373
+ const compareTool = {
13374
+ name: "compare_selections",
13375
+ title: "Compare two selections",
13376
+ description: "Shows what changed between two selections, to check that a modify, refine or select step did what you meant. a (default: the selection before the last undo step) and b (default: the current selection) can each be the current selection, a history step, a saved channel or a layer's mask. Returns a and b (area, bounds), added and removed (area in pixels, count and the 10 largest pieces with bounds, ready for capture_view), iou 0-1, coverageChange (pixels of coverage changed, counting edges that only softened) and identical. With show (default true) the canvas tints added area green and removed red until the selection next changes (view only, no undo step).",
13377
+ inputSchema: {
13378
+ type: "object",
13379
+ properties: {
13380
+ a: sourceSchema("The selection before", "history, 1 step back"),
13381
+ b: sourceSchema("The selection after", "the current selection"),
13382
+ minArea: { type: "number", minimum: 1, maximum: 1e6, description: "Pieces smaller than this many pixels are counted but not listed (default 4)." },
13383
+ show: { type: "boolean", description: "Tint the change on the canvas (default true)." }
13384
+ },
13385
+ additionalProperties: false
13386
+ },
13387
+ annotations: { title: "Compare two selections", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
13388
+ handler: ({ a, b, minArea, show }) => controller.compareSelections(toSource(a, { kind: "history", steps: 1 }), toSource(b, { kind: "selection" }), {
13389
+ ...minArea !== void 0 ? { minArea } : {},
13390
+ show: show !== false
13391
+ })
13392
+ };
12973
13393
  const selectRegion = {
12974
13394
  name: "select_region",
12975
13395
  title: "Select a region",
@@ -13023,7 +13443,7 @@ function createImageSelectionTools(controller) {
13023
13443
  break;
13024
13444
  }
13025
13445
  case "polygon": {
13026
- const list = Array.isArray(points) ? points.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _508 => _508.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _509 => _509.y]), NaN) })) : [];
13446
+ const list = Array.isArray(points) ? points.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _520 => _520.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _521 => _521.y]), NaN) })) : [];
13027
13447
  if (list.length < 3 || !list.every((p) => Number.isFinite(p.x) && Number.isFinite(p.y))) {
13028
13448
  throw new Error("polygon needs points: at least 3 { x, y } vertices.");
13029
13449
  }
@@ -13145,13 +13565,20 @@ function createImageSelectionTools(controller) {
13145
13565
  additionalProperties: false
13146
13566
  }
13147
13567
  },
13148
- refineMode: { type: "string", enum: ["color", "object"], description: "color (default): refine from the image colours; object: from a host segmentation model's outline of the object (needs a model)." }
13568
+ refineMode: { type: "string", enum: ["color", "object"], description: "color (default): refine from the image colours; object: from a host segmentation model's outline of the object (needs a model)." },
13569
+ regions: {
13570
+ type: "array",
13571
+ minItems: 1,
13572
+ maxItems: 50,
13573
+ items: rectSchemaStrict,
13574
+ description: "Refine only inside these rectangles (natural image pixels), e.g. the uncertainRegions bounds a smart selection returned; the rest of the selection stays as it is. Default: everywhere."
13575
+ }
13149
13576
  },
13150
13577
  additionalProperties: false
13151
13578
  },
13152
13579
  annotations: writeAnnotations("Refine the selection edge"),
13153
13580
  handler: async (params) => {
13154
- const edits = Array.isArray(params.edits) ? params.edits.map((e) => e.kind === "object" ? { ...e } : { ...e, points: (_nullishCoalesce(e.points, () => ( []))).map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _510 => _510.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _511 => _511.y]), NaN) })) }) : [];
13581
+ const edits = Array.isArray(params.edits) ? params.edits.map((e) => e.kind === "object" ? { ...e } : { ...e, points: (_nullishCoalesce(e.points, () => ( []))).map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _522 => _522.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _523 => _523.y]), NaN) })) }) : [];
13155
13582
  for (const e of edits) {
13156
13583
  if (e.kind === "object") {
13157
13584
  if (!e.rect === !e.point) throw new Error("An object edit takes rect (a box around the object) or point (on it).");
@@ -13176,7 +13603,8 @@ function createImageSelectionTools(controller) {
13176
13603
  layerId: typeof params.layerId === "string" ? params.layerId : void 0,
13177
13604
  decontaminate: num2(params.decontaminate, 0),
13178
13605
  edits,
13179
- refineMode: params.refineMode === "object" ? "object" : "color"
13606
+ refineMode: params.refineMode === "object" ? "object" : "color",
13607
+ ...params.regions !== void 0 ? { regions: params.regions } : {}
13180
13608
  }
13181
13609
  );
13182
13610
  return { ...summary(controller), ...result };
@@ -13315,7 +13743,7 @@ function createImageSelectionTools(controller) {
13315
13743
  },
13316
13744
  annotations: writeAnnotations("Select a polygon (lasso)", true),
13317
13745
  handler: async (args) => {
13318
- const list = Array.isArray(args.points) ? args.points.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _512 => _512.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _513 => _513.y]), NaN) })) : [];
13746
+ const list = Array.isArray(args.points) ? args.points.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _524 => _524.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _525 => _525.y]), NaN) })) : [];
13319
13747
  if (list.length < 3 || !list.every((p) => Number.isFinite(p.x) && Number.isFinite(p.y))) {
13320
13748
  throw new Error("points needs at least 3 { x, y } vertices in natural image pixels.");
13321
13749
  }
@@ -13332,7 +13760,7 @@ function createImageSelectionTools(controller) {
13332
13760
  const quickSelectTool = {
13333
13761
  name: "quick_select",
13334
13762
  title: "Quick Selection",
13335
- description: "Quick Selection: paints brush strokes (paths in natural image pixels) that each grow into the region they are painted on, out to its edges (a graph cut on colour and edges), combined with the selection by mode. With replace (default) the first stroke replaces the selection and later ones add, as the brush does; use mode subtract to take an area back out. Best for a subject or area that differs from its surroundings: paint inside it, away from the edge, then check with get_selection and capture_view and add or subtract strokes where it leaked or fell short. All strokes are one undoable step. Returns the selection.",
13763
+ description: "Quick Selection: paints brush strokes (paths in natural image pixels) that each grow into the region they are painted on, out to its edges (a graph cut on colour and edges), combined with the selection by mode. With replace (default) the first stroke replaces the selection and later ones add, as the brush does; use mode subtract to take an area back out. Best for a subject or area that differs from its surroundings: paint inside it, away from the edge, then check with get_selection and capture_view and add or subtract strokes where it leaked or fell short. All strokes are one undoable step. Returns the selection. Also returns uncertainRegions (bounds, area, confidence 0-1; up to 20, least confident first), uncertainCount and edgeConfidence: where the edge has no image edge under it. Look at those with capture_view and fix only them (refine_selection with regions).",
13336
13764
  inputSchema: {
13337
13765
  type: "object",
13338
13766
  properties: {
@@ -13352,7 +13780,7 @@ function createImageSelectionTools(controller) {
13352
13780
  },
13353
13781
  annotations: writeAnnotations("Quick Selection"),
13354
13782
  handler: async (args, context) => {
13355
- const strokes = Array.isArray(args.strokes) ? args.strokes.map((s) => Array.isArray(s) ? s.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _514 => _514.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _515 => _515.y]), NaN) })) : []) : [];
13783
+ const strokes = Array.isArray(args.strokes) ? args.strokes.map((s) => Array.isArray(s) ? s.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _526 => _526.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _527 => _527.y]), NaN) })) : []) : [];
13356
13784
  if (!strokes.length || strokes.some((s) => !s.length || !s.every((p) => Number.isFinite(p.x) && Number.isFinite(p.y)))) {
13357
13785
  throw new Error("strokes needs at least one stroke of { x, y } points in natural image pixels.");
13358
13786
  }
@@ -13361,15 +13789,15 @@ function createImageSelectionTools(controller) {
13361
13789
  mode: _chunkSS53NNZOcjs.parseSelectionMode.call(void 0, args.mode),
13362
13790
  sampleAllLayers: args.sampleAllLayers,
13363
13791
  enhanceEdge: args.enhanceEdge,
13364
- signal: _optionalChain([context, 'optionalAccess', _516 => _516.signal])
13792
+ signal: _optionalChain([context, 'optionalAccess', _528 => _528.signal])
13365
13793
  });
13366
- return summary(controller);
13794
+ return { ...summary(controller), ...uncertainty(controller) };
13367
13795
  }
13368
13796
  };
13369
13797
  const selectObjectTool = {
13370
13798
  name: "select_object",
13371
13799
  title: "Object Selection",
13372
- description: 'Object Selection: selects the object inside rect (a box drawn loosely around it, natural image pixels; what lies outside the box is treated as background) or the object under point. With a host segmentation model it asks the model (falling back if nothing it returns fits); otherwise it finds the object from the colours of object and background and the edges between them (GrabCut). Combined with the selection by mode. A box is more reliable than a point: make it a little larger than the object on every side. Check with get_selection and capture_view, then fix with quick_select strokes or select_object with mode add / subtract. One undoable step. Returns the selection and method ("model" or "grabcut").',
13800
+ description: 'Object Selection: selects the object inside rect (a box drawn loosely around it, natural image pixels; what lies outside the box is treated as background) or the object under point. With a host segmentation model it asks the model (falling back if nothing it returns fits); otherwise it finds the object from the colours of object and background and the edges between them (GrabCut). Combined with the selection by mode. A box is more reliable than a point: make it a little larger than the object on every side. Check with get_selection and capture_view, then fix with quick_select strokes or select_object with mode add / subtract. One undoable step. Returns the selection and method ("model" or "grabcut"). Also returns uncertainRegions (bounds, area, confidence 0-1; up to 20, least confident first), uncertainCount and edgeConfidence: where the edge has no image edge under it. Look at those with capture_view and fix only them (refine_selection with regions).',
13373
13801
  inputSchema: {
13374
13802
  type: "object",
13375
13803
  properties: {
@@ -13399,10 +13827,10 @@ function createImageSelectionTools(controller) {
13399
13827
  sampleAllLayers: args.sampleAllLayers,
13400
13828
  enhanceEdge: args.enhanceEdge,
13401
13829
  useModel: args.useModel,
13402
- signal: _optionalChain([context, 'optionalAccess', _517 => _517.signal])
13830
+ signal: _optionalChain([context, 'optionalAccess', _529 => _529.signal])
13403
13831
  };
13404
13832
  const { method } = rect2 ? await controller.selectObject({ rect: { x: num2(rect2.x, NaN), y: num2(rect2.y, NaN), width: num2(rect2.width, NaN), height: num2(rect2.height, NaN) } }, options) : await controller.selectObject({ point: { x: num2(point.x, NaN), y: num2(point.y, NaN) } }, options);
13405
- return { ...summary(controller), method };
13833
+ return { ...summary(controller), method, ...uncertainty(controller) };
13406
13834
  }
13407
13835
  };
13408
13836
  const selectFocusAreaTool = {
@@ -13428,7 +13856,7 @@ function createImageSelectionTools(controller) {
13428
13856
  softness: args.softness === void 0 ? void 0 : num2(args.softness, 4),
13429
13857
  mode: _chunkSS53NNZOcjs.parseSelectionMode.call(void 0, args.mode),
13430
13858
  sampleAllLayers: args.sampleAllLayers,
13431
- signal: _optionalChain([context, 'optionalAccess', _518 => _518.signal])
13859
+ signal: _optionalChain([context, 'optionalAccess', _530 => _530.signal])
13432
13860
  });
13433
13861
  return { ...summary(controller), noiseLevel };
13434
13862
  }
@@ -13436,7 +13864,7 @@ function createImageSelectionTools(controller) {
13436
13864
  const selectSkyTool = {
13437
13865
  name: "select_sky",
13438
13866
  title: "Select the sky",
13439
- description: 'Select \u203A Sky: selects the sky, combined with the selection by mode. With a host segmentation model it asks the model; otherwise it finds it classically (blue, or bright and grey when overcast, smooth, reaching down from the top of the image, including patches seen through branches or gaps) with the edge fitted to the skyline. Use it to replace or recolour a sky or to adjust the land without it (invert_selection). Raise threshold to take in haze or a sunset glow, lower it if bright buildings come in. One undoable step. Returns the selection, method ("model" or "classical"; threshold and softness apply to classical), and a note when no sky was found (the selection is then unchanged).',
13867
+ description: 'Select \u203A Sky: selects the sky, combined with the selection by mode. With a host segmentation model it asks the model; otherwise it finds it classically (blue, or bright and grey when overcast, smooth, reaching down from the top of the image, including patches seen through branches or gaps) with the edge fitted to the skyline. Use it to replace or recolour a sky or to adjust the land without it (invert_selection). Raise threshold to take in haze or a sunset glow, lower it if bright buildings come in. One undoable step. Returns the selection, method ("model" or "classical"; threshold and softness apply to classical), and a note when no sky was found (the selection is then unchanged). Also returns uncertainRegions (bounds, area, confidence 0-1; up to 20, least confident first), uncertainCount and edgeConfidence: where the edge has no image edge under it. Look at those with capture_view and fix only them (refine_selection with regions).',
13440
13868
  inputSchema: {
13441
13869
  type: "object",
13442
13870
  properties: {
@@ -13456,9 +13884,9 @@ function createImageSelectionTools(controller) {
13456
13884
  mode: _chunkSS53NNZOcjs.parseSelectionMode.call(void 0, args.mode),
13457
13885
  sampleAllLayers: args.sampleAllLayers,
13458
13886
  useModel: args.useModel,
13459
- signal: _optionalChain([context, 'optionalAccess', _519 => _519.signal])
13887
+ signal: _optionalChain([context, 'optionalAccess', _531 => _531.signal])
13460
13888
  });
13461
- return { ...summary(controller), method, ...note ? { note } : {} };
13889
+ return { ...summary(controller), method, ...note ? { note } : {}, ...uncertainty(controller) };
13462
13890
  }
13463
13891
  };
13464
13892
  const magicWandTool = {
@@ -13554,7 +13982,7 @@ function createImageSelectionTools(controller) {
13554
13982
  await controller.selectColorRangePreset(args.preset, { ...common, falloff: num2(args.fuzziness, 20) });
13555
13983
  } else {
13556
13984
  const samples = args.samples.map((s, i) => {
13557
- if (typeof _optionalChain([s, 'optionalAccess', _520 => _520.color]) !== "string" || !/^#?[0-9a-f]{6}$/i.test(s.color.trim())) throw new Error(`samples[${i}].color must be #rrggbb.`);
13985
+ if (typeof _optionalChain([s, 'optionalAccess', _532 => _532.color]) !== "string" || !/^#?[0-9a-f]{6}$/i.test(s.color.trim())) throw new Error(`samples[${i}].color must be #rrggbb.`);
13558
13986
  const at = typeof s.x === "number" && typeof s.y === "number" ? { x: s.x, y: s.y } : void 0;
13559
13987
  return at ? { color: s.color, at } : { color: s.color };
13560
13988
  });
@@ -13796,7 +14224,7 @@ function createImageSelectionTools(controller) {
13796
14224
  annotations: writeAnnotations("Content-Aware Fill"),
13797
14225
  handler: async (args, context) => {
13798
14226
  if (!controller.getSelection()) throw new Error("Nothing is selected; select what to remove first.");
13799
- const rects = (v) => Array.isArray(v) ? v.map((r) => ({ x: num2(_optionalChain([r, 'optionalAccess', _521 => _521.x]), NaN), y: num2(_optionalChain([r, 'optionalAccess', _522 => _522.y]), NaN), width: num2(_optionalChain([r, 'optionalAccess', _523 => _523.width]), NaN), height: num2(_optionalChain([r, 'optionalAccess', _524 => _524.height]), NaN) })) : void 0;
14227
+ const rects = (v) => Array.isArray(v) ? v.map((r) => ({ x: num2(_optionalChain([r, 'optionalAccess', _533 => _533.x]), NaN), y: num2(_optionalChain([r, 'optionalAccess', _534 => _534.y]), NaN), width: num2(_optionalChain([r, 'optionalAccess', _535 => _535.width]), NaN), height: num2(_optionalChain([r, 'optionalAccess', _536 => _536.height]), NaN) })) : void 0;
13800
14228
  return controller.contentAwareFillAsync({
13801
14229
  output: args.output,
13802
14230
  sampleRadius: args.sampleRadius,
@@ -13805,7 +14233,7 @@ function createImageSelectionTools(controller) {
13805
14233
  sampleRects: rects(args.sampleRects),
13806
14234
  excludeRects: rects(args.excludeRects),
13807
14235
  samplingChannelId: typeof args.samplingChannelId === "string" ? args.samplingChannelId : void 0,
13808
- signal: _optionalChain([context, 'optionalAccess', _525 => _525.signal])
14236
+ signal: _optionalChain([context, 'optionalAccess', _537 => _537.signal])
13809
14237
  });
13810
14238
  }
13811
14239
  };
@@ -14016,6 +14444,7 @@ function createImageSelectionTools(controller) {
14016
14444
  return [
14017
14445
  getSelection,
14018
14446
  inspectEdge,
14447
+ compareTool,
14019
14448
  selectAll,
14020
14449
  deselect,
14021
14450
  invert2,
@@ -14063,7 +14492,7 @@ function createImageSubjectSelectionTool(controller) {
14063
14492
  return {
14064
14493
  name: "select_subject",
14065
14494
  title: "Select a subject",
14066
- description: 'Select \u203A Subject: selects the main subject of the flattened image, combined with the selection by mode. With a segmentation model set by the host, target (a description such as "the dog" or "the house") chooses which objects; describe one object precisely to get only that one. Without a model, the subject that stands out most from the background is found classically (superpixel saliency and GrabCut): target cannot choose it, and method "saliency" and a note say so. Then check it with capture_view and fix it with quick_select or select_object. One undoable step. Returns the selection, the objects found (label, bounds), method ("model" or "saliency") and any note; none found leaves the selection unchanged.',
14495
+ description: 'Select \u203A Subject: selects the main subject of the flattened image, combined with the selection by mode. With a segmentation model set by the host, target (a description such as "the dog" or "the house") chooses which objects; describe one object precisely to get only that one. Without a model, the subject that stands out most from the background is found classically (superpixel saliency and GrabCut): target cannot choose it, and method "saliency" and a note say so. Then check it with capture_view and fix it with quick_select or select_object. One undoable step. Returns the selection, the objects found (label, bounds), method ("model" or "saliency") and any note; none found leaves the selection unchanged. Also returns uncertainRegions (bounds, area, confidence 0-1; up to 20, least confident first), uncertainCount and edgeConfidence: where the edge has no image edge under it. Look at those with capture_view and fix only them (refine_selection with regions).',
14067
14496
  inputSchema: {
14068
14497
  type: "object",
14069
14498
  properties: {
@@ -14084,17 +14513,17 @@ function createImageSubjectSelectionTool(controller) {
14084
14513
  handler: async ({ target, maxSegments, mode, feather, enhanceEdge }, context) => {
14085
14514
  if (target !== void 0 && typeof target !== "string") throw new Error("target must be a description in words.");
14086
14515
  if (controller.segmentationProvider && !String(_nullishCoalesce(target, () => ( ""))).trim()) throw new Error("target must describe what to select (a model is set, and it selects by description).");
14087
- const perform = _optionalChain([context, 'optionalAccess', _526 => _526.perform]);
14516
+ const perform = _optionalChain([context, 'optionalAccess', _538 => _538.perform]);
14088
14517
  const { segments, method, note } = await controller.selectSubject(String(_nullishCoalesce(target, () => ( ""))), {
14089
14518
  mode: _chunkSS53NNZOcjs.parseSelectionMode.call(void 0, mode),
14090
14519
  feather: num2(feather, 0),
14091
14520
  maxSegments: typeof maxSegments === "number" ? Math.max(1, Math.round(maxSegments)) : void 0,
14092
14521
  enhanceEdge: enhanceEdge === true,
14093
- signal: _optionalChain([context, 'optionalAccess', _527 => _527.signal]),
14522
+ signal: _optionalChain([context, 'optionalAccess', _539 => _539.signal]),
14094
14523
  // Under playback the cursor traces what the model found, as a lasso, before it is selected.
14095
14524
  beforeApply: perform ? (outlines) => perform(planOutlineTrace(outlines)) : void 0
14096
14525
  });
14097
- return { ...summary(controller), found: segments, method, ...note ? { note } : {} };
14526
+ return { ...summary(controller), found: segments, method, ...note ? { note } : {}, ...uncertainty(controller) };
14098
14527
  }
14099
14528
  };
14100
14529
  }
@@ -14168,7 +14597,7 @@ async function renderImageRegion(controller, request) {
14168
14597
  const maskView = maskViewCanvas(controller, document);
14169
14598
  if (maskView) context.drawImage(maskView, rect2.x, rect2.y, rect2.width, rect2.height, 0, 0, out.width, out.height);
14170
14599
  const selection = state.selection;
14171
- if (_optionalChain([selection, 'optionalAccess', _528 => _528.bounds]) && selection.width === state.imageDimensions.width && selection.height === state.imageDimensions.height) {
14600
+ if (_optionalChain([selection, 'optionalAccess', _540 => _540.bounds]) && selection.width === state.imageDimensions.width && selection.height === state.imageDimensions.height) {
14172
14601
  const shade = selectionShade(selection, document);
14173
14602
  if (shade) context.drawImage(shade, rect2.x, rect2.y, rect2.width, rect2.height, 0, 0, out.width, out.height);
14174
14603
  }
@@ -14193,7 +14622,7 @@ function createImageCaptureSurface(controller) {
14193
14622
  return {
14194
14623
  units: "image pixels",
14195
14624
  content: whole,
14196
- selection: () => ({ rect: _nullishCoalesce(_optionalChain([controller, 'access', _529 => _529.getState, 'call', _530 => _530(), 'access', _531 => _531.selection, 'optionalAccess', _532 => _532.bounds]), () => ( null)) }),
14625
+ selection: () => ({ rect: _nullishCoalesce(_optionalChain([controller, 'access', _541 => _541.getState, 'call', _542 => _542(), 'access', _543 => _543.selection, 'optionalAccess', _544 => _544.bounds]), () => ( null)) }),
14197
14626
  overlays: "a shade over unselected pixels, the crop box outline and a layer mask view (set_mask_view)",
14198
14627
  maxScale: 8,
14199
14628
  render: (request) => renderImageRegion(controller, request)
@@ -14527,7 +14956,7 @@ function describeLayer(layer, activeId, boundsOf) {
14527
14956
  out.bounds = boundsOf(layer);
14528
14957
  out.fillOpacity = round3(_nullishCoalesce(layer.fillOpacity, () => ( 1)));
14529
14958
  out.shape = {
14530
- components: layer.components.map((c) => ({ op: c.op, kind: _nullishCoalesce(_optionalChain([c, 'access', _533 => _533.live, 'optionalAccess', _534 => _534.kind]), () => ( "path")) })),
14959
+ components: layer.components.map((c) => ({ op: c.op, kind: _nullishCoalesce(_optionalChain([c, 'access', _545 => _545.live, 'optionalAccess', _546 => _546.kind]), () => ( "path")) })),
14531
14960
  fill: layer.fill ? layer.fill.type : null,
14532
14961
  stroke: layer.stroke ? { width: layer.stroke.width, paint: layer.stroke.paint.type } : null
14533
14962
  };
@@ -14550,8 +14979,8 @@ function describeLayer(layer, activeId, boundsOf) {
14550
14979
  out.bounds = boundsOf(layer);
14551
14980
  out.fillOpacity = round3(_nullishCoalesce(layer.fillOpacity, () => ( 1)));
14552
14981
  out.contents = { id: layer.contents.id, name: layer.contents.name, kind: layer.contents.kind, width: layer.contents.width, height: layer.contents.height };
14553
- out.smartFilters = (_nullishCoalesce(_optionalChain([layer, 'access', _535 => _535.smartFilters, 'optionalAccess', _536 => _536.filters]), () => ( []))).map((f) => ({ id: f.id, kind: f.kind, enabled: f.enabled }));
14554
- out.filterMask = maskSummary(_optionalChain([layer, 'access', _537 => _537.smartFilters, 'optionalAccess', _538 => _538.mask]));
14982
+ out.smartFilters = (_nullishCoalesce(_optionalChain([layer, 'access', _547 => _547.smartFilters, 'optionalAccess', _548 => _548.filters]), () => ( []))).map((f) => ({ id: f.id, kind: f.kind, enabled: f.enabled }));
14983
+ out.filterMask = maskSummary(_optionalChain([layer, 'access', _549 => _549.smartFilters, 'optionalAccess', _550 => _550.mask]));
14555
14984
  break;
14556
14985
  }
14557
14986
  return out;
@@ -14579,7 +15008,7 @@ function createImageLayerTools(controller) {
14579
15008
  if (!loc) return null;
14580
15009
  return {
14581
15010
  ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)),
14582
- parentId: _nullishCoalesce(_optionalChain([loc, 'access', _539 => _539.parent, 'optionalAccess', _540 => _540.id]), () => ( null)),
15011
+ parentId: _nullishCoalesce(_optionalChain([loc, 'access', _551 => _551.parent, 'optionalAccess', _552 => _552.id]), () => ( null)),
14583
15012
  index: loc.index
14584
15013
  };
14585
15014
  };
@@ -14902,7 +15331,7 @@ function createImageLayerTools(controller) {
14902
15331
  if (view !== "gray" && view !== "overlay" && view !== "off") throw new Error(`Unknown view "${String(view)}". Use gray, overlay or off.`);
14903
15332
  const id = view === "off" || layerId === void 0 ? void 0 : exists(layerId);
14904
15333
  const shown = controller.setMaskView(view, id);
14905
- return { view: _nullishCoalesce(_optionalChain([shown, 'optionalAccess', _541 => _541.mode]), () => ( "off")), layerId: _nullishCoalesce(_optionalChain([shown, 'optionalAccess', _542 => _542.layerId]), () => ( null)) };
15334
+ return { view: _nullishCoalesce(_optionalChain([shown, 'optionalAccess', _553 => _553.mode]), () => ( "off")), layerId: _nullishCoalesce(_optionalChain([shown, 'optionalAccess', _554 => _554.layerId]), () => ( null)) };
14906
15335
  }
14907
15336
  };
14908
15337
  const AMOUNT = (what) => ({ type: "number", minimum: 0, maximum: 100, description: `${what}, in percent 0-100; 0 turns it off.` });
@@ -15443,29 +15872,29 @@ function snapTo45(from, point) {
15443
15872
  return { x: from.x + Math.cos(a) * len, y: from.y + Math.sin(a) * len };
15444
15873
  }
15445
15874
  var SelectionGesture = (_class13 = class {
15446
- constructor(controller, getOptions) {;_class13.prototype.__init104.call(this);_class13.prototype.__init105.call(this);_class13.prototype.__init106.call(this);_class13.prototype.__init107.call(this);_class13.prototype.__init108.call(this);_class13.prototype.__init109.call(this);_class13.prototype.__init110.call(this);_class13.prototype.__init111.call(this);_class13.prototype.__init112.call(this);_class13.prototype.__init113.call(this);_class13.prototype.__init114.call(this);_class13.prototype.__init115.call(this);_class13.prototype.__init116.call(this);
15875
+ constructor(controller, getOptions) {;_class13.prototype.__init105.call(this);_class13.prototype.__init106.call(this);_class13.prototype.__init107.call(this);_class13.prototype.__init108.call(this);_class13.prototype.__init109.call(this);_class13.prototype.__init110.call(this);_class13.prototype.__init111.call(this);_class13.prototype.__init112.call(this);_class13.prototype.__init113.call(this);_class13.prototype.__init114.call(this);_class13.prototype.__init115.call(this);_class13.prototype.__init116.call(this);_class13.prototype.__init117.call(this);
15447
15876
  this.controller = controller;
15448
15877
  this.getOptions = getOptions;
15449
15878
  }
15450
15879
 
15451
15880
 
15452
- __init104() {this.start = null}
15453
- __init105() {this.points = []}
15454
- __init106() {this.current = null}
15455
- __init107() {this.modifiers = {}}
15881
+ __init105() {this.start = null}
15882
+ __init106() {this.points = []}
15883
+ __init107() {this.current = null}
15884
+ __init108() {this.modifiers = {}}
15456
15885
  /** Polygonal lasso corners while one is being drawn. */
15457
- __init108() {this.polygon = null}
15458
- __init109() {this.pressedAt = null}
15459
- __init110() {this.freehand = false}
15460
- __init111() {this.magnetic = null}
15886
+ __init109() {this.polygon = null}
15887
+ __init110() {this.pressedAt = null}
15888
+ __init111() {this.freehand = false}
15889
+ __init112() {this.magnetic = null}
15461
15890
  /** A click this close to the first corner (natural pixels) closes a polygonal lasso. */
15462
- __init112() {this.closeRadius = 8}
15891
+ __init113() {this.closeRadius = 8}
15463
15892
  /** The last error (e.g. pixels unavailable for the wand), for the UI to show. */
15464
- __init113() {this.error = null}
15465
- __init114() {this.pending = Promise.resolve()}
15893
+ __init114() {this.error = null}
15894
+ __init115() {this.pending = Promise.resolve()}
15466
15895
  /** Quick Selection while dragging: the selection before the stroke, how the stroke combines, the pixels. */
15467
- __init115() {this.quick = null}
15468
- __init116() {this.livePreviews = Promise.resolve()}
15896
+ __init116() {this.quick = null}
15897
+ __init117() {this.livePreviews = Promise.resolve()}
15469
15898
  get active() {
15470
15899
  return this.start !== null || this.polygon !== null || this.magnetic !== null;
15471
15900
  }
@@ -15501,12 +15930,12 @@ var SelectionGesture = (_class13 = class {
15501
15930
  size: _nullishCoalesce(options.quickSize, () => ( 30)),
15502
15931
  grow: q.mode === "add",
15503
15932
  enhanceEdge: _nullishCoalesce(options.quickEnhance, () => ( false)),
15504
- selection: q.mode === "add" && _optionalChain([q, 'access', _543 => _543.base, 'optionalAccess', _544 => _544.bounds]) ? _chunkUC3PWFM3cjs.serializeMask.call(void 0, q.base) : null
15933
+ selection: q.mode === "add" && _optionalChain([q, 'access', _555 => _555.base, 'optionalAccess', _556 => _556.bounds]) ? _chunkUC3PWFM3cjs.serializeMask.call(void 0, q.base) : null
15505
15934
  },
15506
15935
  pixels
15507
15936
  );
15508
15937
  if (this.quick === q) this.controller.setSelectionPreview(_chunkSS53NNZOcjs.combineSelections.call(void 0, q.base, mask, q.mode));
15509
- } catch (e37) {
15938
+ } catch (e38) {
15510
15939
  break;
15511
15940
  }
15512
15941
  } while (q.dirty && this.quick === q);
@@ -15712,7 +16141,7 @@ var SelectionGesture = (_class13 = class {
15712
16141
  this.start = null;
15713
16142
  this.current = null;
15714
16143
  this.points = [];
15715
- const strokeMode = _nullishCoalesce(_optionalChain([this, 'access', _545 => _545.quick, 'optionalAccess', _546 => _546.mode]), () => ( (mode === "replace" && this.controller.getSelection() ? "add" : mode)));
16144
+ const strokeMode = _nullishCoalesce(_optionalChain([this, 'access', _557 => _557.quick, 'optionalAccess', _558 => _558.mode]), () => ( (mode === "replace" && this.controller.getSelection() ? "add" : mode)));
15716
16145
  this.quick = null;
15717
16146
  this.pending = this.controller.quickSelect([stroke], {
15718
16147
  size: _nullishCoalesce(options.quickSize, () => ( 30)),
@@ -15873,7 +16302,7 @@ function handleSelectionShortcut(controller, e, onError) {
15873
16302
  try {
15874
16303
  fn();
15875
16304
  } catch (err) {
15876
- _optionalChain([onError, 'optionalCall', _547 => _547(err instanceof Error ? err.message : String(err))]);
16305
+ _optionalChain([onError, 'optionalCall', _559 => _559(err instanceof Error ? err.message : String(err))]);
15877
16306
  }
15878
16307
  return true;
15879
16308
  };
@@ -15888,9 +16317,9 @@ function handleMaskViewKey(controller, e) {
15888
16317
  if (e.ctrlKey || e.metaKey || e.altKey || e.key !== "\\") return false;
15889
16318
  const id = controller.getState().activeLayerId;
15890
16319
  const layer = id ? controller.getLayer(id) : null;
15891
- if (!_optionalChain([layer, 'optionalAccess', _548 => _548.mask]) || layer.mask.source) return false;
16320
+ if (!_optionalChain([layer, 'optionalAccess', _560 => _560.mask]) || layer.mask.source) return false;
15892
16321
  const view = controller.getMaskView();
15893
- controller.setMaskView(_optionalChain([view, 'optionalAccess', _549 => _549.layerId]) === layer.id && view.mode === "overlay" ? "off" : "overlay", layer.id);
16322
+ controller.setMaskView(_optionalChain([view, 'optionalAccess', _561 => _561.layerId]) === layer.id && view.mode === "overlay" ? "off" : "overlay", layer.id);
15894
16323
  return true;
15895
16324
  }
15896
16325
  function handleQuickMaskKey(controller, e) {
@@ -16085,14 +16514,14 @@ function handlePaintShortcut(controller, e) {
16085
16514
  return false;
16086
16515
  }
16087
16516
  var PaintGesture = (_class14 = class {
16088
- constructor(controller) {;_class14.prototype.__init117.call(this);_class14.prototype.__init118.call(this);_class14.prototype.__init119.call(this);
16517
+ constructor(controller) {;_class14.prototype.__init118.call(this);_class14.prototype.__init119.call(this);_class14.prototype.__init120.call(this);
16089
16518
  this.controller = controller;
16090
16519
  }
16091
16520
 
16092
- __init117() {this.stroke = null}
16093
- __init118() {this.move = null}
16521
+ __init118() {this.stroke = null}
16522
+ __init119() {this.move = null}
16094
16523
  /** The last refusal (e.g. "layer is locked"), for the editor to show. */
16095
- __init119() {this.error = null}
16524
+ __init120() {this.error = null}
16096
16525
  get active() {
16097
16526
  return Boolean(this.stroke || this.move);
16098
16527
  }
@@ -16104,7 +16533,7 @@ var PaintGesture = (_class14 = class {
16104
16533
  const layer = this.controller.getActiveLayer();
16105
16534
  if (!layer) throw new Error("Select a layer to move in the Layers panel.");
16106
16535
  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.`);
16107
- if (_optionalChain([layer, 'access', _550 => _550.locks, 'optionalAccess', _551 => _551.all]) || _optionalChain([layer, 'access', _552 => _552.locks, 'optionalAccess', _553 => _553.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
16536
+ if (_optionalChain([layer, 'access', _562 => _562.locks, 'optionalAccess', _563 => _563.all]) || _optionalChain([layer, 'access', _564 => _564.locks, 'optionalAccess', _565 => _565.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
16108
16537
  const origin = layer.type === "pixel" ? { ...layer.offset } : layer.type === "smart" ? { ...layer.placement.corners[0] } : (() => {
16109
16538
  const b = _chunkS55JFWDAcjs.shapeGeometryBounds.call(void 0, layer);
16110
16539
  return b ? { x: b.x, y: b.y } : { x: 0, y: 0 };
@@ -16161,7 +16590,7 @@ var PaintGesture = (_class14 = class {
16161
16590
  this.move = null;
16162
16591
  }
16163
16592
  cancel() {
16164
- _optionalChain([this, 'access', _554 => _554.stroke, 'optionalAccess', _555 => _555.cancel, 'call', _556 => _556()]);
16593
+ _optionalChain([this, 'access', _566 => _566.stroke, 'optionalAccess', _567 => _567.cancel, 'call', _568 => _568()]);
16165
16594
  this.stroke = null;
16166
16595
  this.move = null;
16167
16596
  }
@@ -16396,7 +16825,7 @@ function profileArg(v) {
16396
16825
  if (s.startsWith("icc:")) {
16397
16826
  try {
16398
16827
  return _chunkOLNIPTB3cjs.base64ToBytes.call(void 0, s.slice(4));
16399
- } catch (e38) {
16828
+ } catch (e39) {
16400
16829
  throw new (0, _chunkS55JFWDAcjs.LayerOperationError)("The icc: value is not valid base64.");
16401
16830
  }
16402
16831
  }
@@ -17242,7 +17671,7 @@ function createImageSmartObjectTools(controller) {
17242
17671
  const layerSummary = (id) => {
17243
17672
  const s = controller.getState();
17244
17673
  const loc = _chunkB46UQUDCcjs.findLayer.call(void 0, s.layers, id);
17245
- return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _557 => _557.parent, 'optionalAccess', _558 => _558.id]), () => ( null)), index: loc.index } : null;
17674
+ return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _569 => _569.parent, 'optionalAccess', _570 => _570.id]), () => ( null)), index: loc.index } : null;
17246
17675
  };
17247
17676
  const getSmart = {
17248
17677
  name: "get_smart_object",
@@ -17799,7 +18228,7 @@ function createImageShapeTools(controller) {
17799
18228
  const layerSummary = (id) => {
17800
18229
  const s = controller.getState();
17801
18230
  const loc = _chunkB46UQUDCcjs.findLayer.call(void 0, s.layers, id);
17802
- return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _559 => _559.parent, 'optionalAccess', _560 => _560.id]), () => ( null)), index: loc.index } : null;
18231
+ return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _571 => _571.parent, 'optionalAccess', _572 => _572.id]), () => ( null)), index: loc.index } : null;
17803
18232
  };
17804
18233
  const get = {
17805
18234
  name: "get_shape_layer",
@@ -18030,7 +18459,7 @@ function createImageShapeTools(controller) {
18030
18459
  const mode = args.mode;
18031
18460
  controller.pathToSelection(_nullishCoalesce(fromPathId(args), () => ( pathSpec(args))), { feather: args.feather, antiAlias: args.antiAlias, mode });
18032
18461
  const sel = controller.getSelection();
18033
- return { empty: !sel, bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _561 => _561.bounds]), () => ( null)), area: Math.round(sel ? _chunkSS53NNZOcjs.selectionArea.call(void 0, sel) : 0) };
18462
+ return { empty: !sel, bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _573 => _573.bounds]), () => ( null)), area: Math.round(sel ? _chunkSS53NNZOcjs.selectionArea.call(void 0, sel) : 0) };
18034
18463
  }
18035
18464
  };
18036
18465
  const getVectorMask = {
@@ -18062,7 +18491,7 @@ function createImageShapeTools(controller) {
18062
18491
  handler: (args) => {
18063
18492
  const id = layerArg(args.layerId);
18064
18493
  const spec = _nullishCoalesce(fromPathId(args), () => ( pathSpec(args)));
18065
- const hasPath = _optionalChain([spec, 'access', _562 => _562.components, 'optionalAccess', _563 => _563.length]) || spec.shape !== void 0 || spec.subpaths !== void 0;
18494
+ const hasPath = _optionalChain([spec, 'access', _574 => _574.components, 'optionalAccess', _575 => _575.length]) || spec.shape !== void 0 || spec.subpaths !== void 0;
18066
18495
  const from = _nullishCoalesce(args.from, () => ( (hasPath ? "path" : "reveal-all")));
18067
18496
  if (from !== "selection" && TRACE_KEYS.some((k) => args[k] !== void 0)) throw new Error("tolerance, cornerRoundness and minArea apply only to from selection.");
18068
18497
  controller.addVectorMask(id, from, spec, traceOptions(args));
@@ -18170,7 +18599,7 @@ function createImageShapeTools(controller) {
18170
18599
  annotations: { title: "Add a document path", ...WRITE8 },
18171
18600
  handler: (args) => {
18172
18601
  const spec = pathSpec(args);
18173
- if (!_optionalChain([spec, 'access', _564 => _564.components, 'optionalAccess', _565 => _565.length]) && spec.shape === void 0 && spec.subpaths === void 0) throw new Error("Give the path as shape, subpaths or components.");
18602
+ if (!_optionalChain([spec, 'access', _576 => _576.components, 'optionalAccess', _577 => _577.length]) && spec.shape === void 0 && spec.subpaths === void 0) throw new Error("Give the path as shape, subpaths or components.");
18174
18603
  return { path: pathSummary(controller.addPath({ ...spec, name: args.name }).id) };
18175
18604
  }
18176
18605
  };
@@ -18314,7 +18743,7 @@ function createImageTypeTools(controller) {
18314
18743
  const layerSummary = (id) => {
18315
18744
  const s = controller.getState();
18316
18745
  const loc = _chunkB46UQUDCcjs.findLayer.call(void 0, s.layers, id);
18317
- return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _566 => _566.parent, 'optionalAccess', _567 => _567.id]), () => ( null)), index: loc.index } : null;
18746
+ return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _578 => _578.parent, 'optionalAccess', _579 => _579.id]), () => ( null)), index: loc.index } : null;
18318
18747
  };
18319
18748
  const range = (args) => ({ start: args.start, end: args.end });
18320
18749
  const listFonts = {
@@ -18323,7 +18752,7 @@ function createImageTypeTools(controller) {
18323
18752
  description: "Returns the font families type layers can use here (generic families such as sans-serif always work). Changes nothing.",
18324
18753
  inputSchema: { type: "object", properties: {}, additionalProperties: false },
18325
18754
  annotations: { title: "List fonts", ...READ11 },
18326
- handler: () => ({ families: controller.listFonts(), shaper: _nullishCoalesce(_optionalChain([controller, 'access', _568 => _568.getTextShaper, 'call', _569 => _569(), 'optionalAccess', _570 => _570.id]), () => ( null)) })
18755
+ handler: () => ({ families: controller.listFonts(), shaper: _nullishCoalesce(_optionalChain([controller, 'access', _580 => _580.getTextShaper, 'call', _581 => _581(), 'optionalAccess', _582 => _582.id]), () => ( null)) })
18327
18756
  };
18328
18757
  const get = {
18329
18758
  name: "get_text_layer",
@@ -18479,7 +18908,7 @@ function createImageTypeTools(controller) {
18479
18908
  const init = pick2(args, ["text", "x", "y", "orientation", "box", "style", "paragraph", "rotation", "mode", "feather", "antiAlias"]);
18480
18909
  controller.selectTextShape(init);
18481
18910
  const sel = controller.getSelection();
18482
- return { empty: !sel, bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _571 => _571.bounds]), () => ( null)), area: Math.round(sel ? _chunkSS53NNZOcjs.selectionArea.call(void 0, sel) : 0) };
18911
+ return { empty: !sel, bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _583 => _583.bounds]), () => ( null)), area: Math.round(sel ? _chunkSS53NNZOcjs.selectionArea.call(void 0, sel) : 0) };
18483
18912
  }
18484
18913
  };
18485
18914
  return [listFonts, get, add2, setText, setStyle, setParagraph, setFrame, setOrientation, toShape, typeMask];
@@ -18658,7 +19087,7 @@ function createImageEditorToolProvider(controller, options = {}) {
18658
19087
  for (const ref of [aboveId, parentId]) {
18659
19088
  if (ref !== void 0 && !controller.getLayer(ref)) throw new Error(`Unknown layer "${ref}". Call list_layers for ids.`);
18660
19089
  }
18661
- if (parentId !== void 0 && _optionalChain([controller, 'access', _572 => _572.getLayer, 'call', _573 => _573(parentId), 'optionalAccess', _574 => _574.type]) !== "group") throw new Error(`Layer "${parentId}" is not a group.`);
19090
+ if (parentId !== void 0 && _optionalChain([controller, 'access', _584 => _584.getLayer, 'call', _585 => _585(parentId), 'optionalAccess', _586 => _586.type]) !== "group") throw new Error(`Layer "${parentId}" is not a group.`);
18662
19091
  const id = controller.addAdjustmentLayer({ kind, params, opacity, blend, name, aboveId, parentId, useSelection: useSelection !== false });
18663
19092
  const layer = controller.getAdjustmentLayer(id);
18664
19093
  return { layer: JSON.parse(JSON.stringify(layer)), index: controller.getAdjustmentLayers().findIndex((l) => l.id === id), masked: Boolean(layer.mask) };
@@ -18895,35 +19324,35 @@ function scaleParams(p, s) {
18895
19324
  return { ...p, radius: p.radius * s, feather: p.feather * s };
18896
19325
  }
18897
19326
  var SelectAndMaskSession = (_class15 = class {
18898
- constructor(controller) {;_class15.prototype.__init120.call(this);_class15.prototype.__init121.call(this);_class15.prototype.__init122.call(this);_class15.prototype.__init123.call(this);_class15.prototype.__init124.call(this);_class15.prototype.__init125.call(this);_class15.prototype.__init126.call(this);_class15.prototype.__init127.call(this);_class15.prototype.__init128.call(this);_class15.prototype.__init129.call(this);_class15.prototype.__init130.call(this);_class15.prototype.__init131.call(this);_class15.prototype.__init132.call(this);_class15.prototype.__init133.call(this);_class15.prototype.__init134.call(this);
19327
+ constructor(controller) {;_class15.prototype.__init121.call(this);_class15.prototype.__init122.call(this);_class15.prototype.__init123.call(this);_class15.prototype.__init124.call(this);_class15.prototype.__init125.call(this);_class15.prototype.__init126.call(this);_class15.prototype.__init127.call(this);_class15.prototype.__init128.call(this);_class15.prototype.__init129.call(this);_class15.prototype.__init130.call(this);_class15.prototype.__init131.call(this);_class15.prototype.__init132.call(this);_class15.prototype.__init133.call(this);_class15.prototype.__init134.call(this);_class15.prototype.__init135.call(this);
18899
19328
  this.controller = controller;
18900
19329
  this.base = controller.getSelection();
18901
19330
  this.settingsValue = remembered ? { ...remembered, params: { ...remembered.params }, showOriginal: false } : { ...DEFAULT_SELECT_AND_MASK_SETTINGS, params: { ...DEFAULT_SELECT_AND_MASK_SETTINGS.params } };
18902
19331
  }
18903
19332
 
18904
19333
 
18905
- __init120() {this.editsList = []}
19334
+ __init121() {this.editsList = []}
18906
19335
  /** The edit being painted, shown in the preview but not yet in `edits`. */
18907
- __init121() {this.live = null}
18908
- __init122() {this.dragStart = null}
18909
- __init123() {this.pixels = null}
18910
- __init124() {this.previewPixels = null}
19336
+ __init122() {this.live = null}
19337
+ __init123() {this.dragStart = null}
19338
+ __init124() {this.pixels = null}
19339
+ __init125() {this.previewPixels = null}
18911
19340
  /** The layers below the active one, composited (On Layers shows them where nothing is selected). */
18912
- __init125() {this.below = null}
18913
- __init126() {this.belowPreview = null}
19341
+ __init126() {this.below = null}
19342
+ __init127() {this.belowPreview = null}
18914
19343
 
18915
- __init127() {this.previewMask = null}
18916
- __init128() {this.baseMask = null}
18917
- __init129() {this.listeners = /* @__PURE__ */ new Set()}
19344
+ __init128() {this.previewMask = null}
19345
+ __init129() {this.baseMask = null}
19346
+ __init130() {this.listeners = /* @__PURE__ */ new Set()}
18918
19347
  /** Why the preview could not be made (no pixels), for the UI. */
18919
- __init130() {this.error = null}
19348
+ __init131() {this.error = null}
18920
19349
  /** A note for the UI, such as object aware refinement applying only on OK. */
18921
- __init131() {this.note = null}
19350
+ __init132() {this.note = null}
18922
19351
  /** Bumped each time the preview changes, so a UI can redraw. */
18923
- __init132() {this.revision = 0}
19352
+ __init133() {this.revision = 0}
18924
19353
  /** True while the worker computes a preview. */
18925
- __init133() {this.computing = false}
18926
- __init134() {this.dirty = false}
19354
+ __init134() {this.computing = false}
19355
+ __init135() {this.dirty = false}
18927
19356
  get settings() {
18928
19357
  return this.settingsValue;
18929
19358
  }
@@ -18956,7 +19385,7 @@ var SelectAndMaskSession = (_class15 = class {
18956
19385
  if (!ids.length) return null;
18957
19386
  try {
18958
19387
  return this.controller.compositePixels(void 0, { layerIds: ids });
18959
- } catch (e39) {
19388
+ } catch (e40) {
18960
19389
  return null;
18961
19390
  }
18962
19391
  }
@@ -18993,7 +19422,7 @@ var SelectAndMaskSession = (_class15 = class {
18993
19422
  const h = Math.max(1, Math.round(px2.height * s));
18994
19423
  this.previewPixels = scalePixels(px2, w, h);
18995
19424
  this.belowPreview = this.below ? scalePixels(this.below, w, h) : null;
18996
- this.baseMask = _optionalChain([this, 'access', _575 => _575.base, 'optionalAccess', _576 => _576.bounds]) ? s === 1 ? this.base : _chunkSS53NNZOcjs.resizeSelection.call(void 0, this.base, w, h) : null;
19425
+ this.baseMask = _optionalChain([this, 'access', _587 => _587.base, 'optionalAccess', _588 => _588.bounds]) ? s === 1 ? this.base : _chunkSS53NNZOcjs.resizeSelection.call(void 0, this.base, w, h) : null;
18997
19426
  }
18998
19427
  /**
18999
19428
  * Recomputes the preview mask from the base selection, the strokes and the settings: at once on
@@ -19011,7 +19440,7 @@ var SelectAndMaskSession = (_class15 = class {
19011
19440
  const edits = [...this.editsList, ...this.live ? [this.live] : []].map((e) => scaleEdit(e, scale));
19012
19441
  try {
19013
19442
  const { selection, refineBrush } = _chunkUC3PWFM3cjs.applyRefineEdits.call(void 0, px2, this.baseMask, edits, px2.width, px2.height);
19014
- this.previewMask = _optionalChain([selection, 'optionalAccess', _577 => _577.bounds]) ? _chunkSS53NNZOcjs.refineSelection.call(void 0, px2, selection, scaleParams(this.settingsValue.params, scale), refineBrush) : null;
19443
+ this.previewMask = _optionalChain([selection, 'optionalAccess', _589 => _589.bounds]) ? _chunkSS53NNZOcjs.refineSelection.call(void 0, px2, selection, scaleParams(this.settingsValue.params, scale), refineBrush) : null;
19015
19444
  this.error = null;
19016
19445
  } catch (err) {
19017
19446
  this.previewMask = null;
@@ -19117,7 +19546,7 @@ var SelectAndMaskSession = (_class15 = class {
19117
19546
  break;
19118
19547
  }
19119
19548
  case "on-layers": {
19120
- const under = _optionalChain([this, 'access', _578 => _578.belowPreview, 'optionalAccess', _579 => _579.data]);
19549
+ const under = _optionalChain([this, 'access', _590 => _590.belowPreview, 'optionalAccess', _591 => _591.data]);
19121
19550
  let ur = checker;
19122
19551
  let ug = checker;
19123
19552
  let ub = checker;
@@ -19413,7 +19842,7 @@ function maskThumbnailClick(controller, layer, e) {
19413
19842
  } else if (e.altKey && !layer.mask.source) {
19414
19843
  const mode = e.shiftKey ? "overlay" : "gray";
19415
19844
  const view = controller.getMaskView();
19416
- controller.setMaskView(_optionalChain([view, 'optionalAccess', _580 => _580.layerId]) === layer.id && view.mode === mode ? "off" : mode, layer.id);
19845
+ controller.setMaskView(_optionalChain([view, 'optionalAccess', _592 => _592.layerId]) === layer.id && view.mode === mode ? "off" : mode, layer.id);
19417
19846
  } else if (e.shiftKey) {
19418
19847
  controller.setLayerMaskProps(layer.id, { enabled: layer.mask.enabled === false });
19419
19848
  } else {
@@ -19477,7 +19906,7 @@ function layerHasThumbnail(layer) {
19477
19906
  return layer.type === "pixel" || layer.type === "shape" || layer.type === "type";
19478
19907
  }
19479
19908
  function layerWarning(layer) {
19480
- if (layer.type === "type" && _optionalChain([layer, 'access', _581 => _581.missingFonts, 'optionalAccess', _582 => _582.length])) {
19909
+ if (layer.type === "type" && _optionalChain([layer, 'access', _593 => _593.missingFonts, 'optionalAccess', _594 => _594.length])) {
19481
19910
  return `Missing ${layer.missingFonts.length === 1 ? "font" : "fonts"}: ${layer.missingFonts.join(", ")}. ${layer.rendering === "stored" ? "Showing the saved pixels until the text is edited." : "Drawn with a fallback font."}`;
19482
19911
  }
19483
19912
  return null;
@@ -19500,16 +19929,16 @@ function layerMenu(controller) {
19500
19929
  const siblings = loc ? loc.parent ? loc.parent.children : s.layers : [];
19501
19930
  const below = loc ? siblings[loc.index - 1] : void 0;
19502
19931
  const hasSel = controller.hasSelection;
19503
- const isPixel = _optionalChain([active, 'optionalAccess', _583 => _583.type]) === "pixel";
19504
- const hasOwnPixels = _optionalChain([active, 'optionalAccess', _584 => _584.type]) === "pixel" || _optionalChain([active, 'optionalAccess', _585 => _585.type]) === "shape" || _optionalChain([active, 'optionalAccess', _586 => _586.type]) === "type" || _optionalChain([active, 'optionalAccess', _587 => _587.type]) === "smart";
19932
+ const isPixel = _optionalChain([active, 'optionalAccess', _595 => _595.type]) === "pixel";
19933
+ const hasOwnPixels = _optionalChain([active, 'optionalAccess', _596 => _596.type]) === "pixel" || _optionalChain([active, 'optionalAccess', _597 => _597.type]) === "shape" || _optionalChain([active, 'optionalAccess', _598 => _598.type]) === "type" || _optionalChain([active, 'optionalAccess', _599 => _599.type]) === "smart";
19505
19934
  return [
19506
19935
  { action: "new-layer", label: "New Layer", enabled: true },
19507
19936
  { action: "new-group", label: "New Group", enabled: true },
19508
19937
  { action: "duplicate", label: "Duplicate Layer", enabled: Boolean(active) },
19509
19938
  { action: "delete", label: "Delete Layer", enabled: Boolean(active) },
19510
19939
  { action: "group-selected", label: "Group Layer", enabled: Boolean(active) },
19511
- { action: "ungroup", label: "Ungroup", enabled: _optionalChain([active, 'optionalAccess', _588 => _588.type]) === "group" },
19512
- { action: "merge-down", label: "Merge Down", enabled: Boolean(_optionalChain([active, 'optionalAccess', _589 => _589.visible]) && _optionalChain([below, 'optionalAccess', _590 => _590.type]) === "pixel") },
19940
+ { action: "ungroup", label: "Ungroup", enabled: _optionalChain([active, 'optionalAccess', _600 => _600.type]) === "group" },
19941
+ { action: "merge-down", label: "Merge Down", enabled: Boolean(_optionalChain([active, 'optionalAccess', _601 => _601.visible]) && _optionalChain([below, 'optionalAccess', _602 => _602.type]) === "pixel") },
19513
19942
  { action: "merge-visible", label: "Merge Visible", enabled: s.layers.some((l) => l.visible) },
19514
19943
  { action: "flatten", label: "Flatten Image", enabled: s.layers.length > 0 },
19515
19944
  { action: "via-copy", label: "Layer via Copy", enabled: isPixel && hasSel },
@@ -19519,27 +19948,27 @@ function layerMenu(controller) {
19519
19948
  { action: "add-mask-hide-selection", label: "Add Mask Hiding Selection", enabled: Boolean(active) && hasSel },
19520
19949
  { action: "add-mask-transparency", label: "Add Mask from Transparency", enabled: hasOwnPixels },
19521
19950
  { action: "select-transparency", label: "Select Layer Pixels", enabled: hasOwnPixels },
19522
- { action: "apply-mask", label: "Apply Layer Mask", enabled: isPixel && Boolean(_optionalChain([active, 'optionalAccess', _591 => _591.mask])) },
19523
- { action: "delete-mask", label: "Delete Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _592 => _592.mask])) },
19524
- { action: "toggle-mask", label: _optionalChain([active, 'optionalAccess', _593 => _593.mask, 'optionalAccess', _594 => _594.enabled]) === false ? "Enable Layer Mask" : "Disable Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _595 => _595.mask])) },
19525
- { action: "toggle-mask-link", label: _optionalChain([active, 'optionalAccess', _596 => _596.mask, 'optionalAccess', _597 => _597.linked]) === false ? "Link Layer Mask" : "Unlink Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _598 => _598.mask]) && !active.mask.source) },
19526
- { action: "add-vector-mask", label: "Add Vector Mask (Reveal All)", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _599 => _599.mask, 'optionalAccess', _600 => _600.source])) },
19527
- { action: "add-vector-mask-hide", label: "Add Vector Mask (Hide All)", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _601 => _601.mask, 'optionalAccess', _602 => _602.source])) },
19528
- { action: "add-vector-mask-selection", label: "Add Vector Mask from Selection", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _603 => _603.mask, 'optionalAccess', _604 => _604.source])) && hasSel },
19529
- { action: "delete-vector-mask", label: "Delete Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _605 => _605.vectorMask])) },
19530
- { action: "toggle-vector-mask", label: _optionalChain([active, 'optionalAccess', _606 => _606.vectorMask, 'optionalAccess', _607 => _607.enabled]) === false ? "Enable Vector Mask" : "Disable Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _608 => _608.vectorMask])) },
19531
- { action: "rasterize-vector-mask", label: "Rasterize Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _609 => _609.vectorMask])) },
19532
- { action: "rasterize", label: "Rasterize Layer", enabled: _optionalChain([active, 'optionalAccess', _610 => _610.type]) === "annotation" || _optionalChain([active, 'optionalAccess', _611 => _611.type]) === "smart" || _optionalChain([active, 'optionalAccess', _612 => _612.type]) === "shape" || _optionalChain([active, 'optionalAccess', _613 => _613.type]) === "type" || isPixel && Boolean(_optionalChain([active, 'optionalAccess', _614 => _614.type]) === "pixel" && _optionalChain([active, 'access', _615 => _615.filters, 'optionalAccess', _616 => _616.length])) },
19951
+ { action: "apply-mask", label: "Apply Layer Mask", enabled: isPixel && Boolean(_optionalChain([active, 'optionalAccess', _603 => _603.mask])) },
19952
+ { action: "delete-mask", label: "Delete Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _604 => _604.mask])) },
19953
+ { action: "toggle-mask", label: _optionalChain([active, 'optionalAccess', _605 => _605.mask, 'optionalAccess', _606 => _606.enabled]) === false ? "Enable Layer Mask" : "Disable Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _607 => _607.mask])) },
19954
+ { action: "toggle-mask-link", label: _optionalChain([active, 'optionalAccess', _608 => _608.mask, 'optionalAccess', _609 => _609.linked]) === false ? "Link Layer Mask" : "Unlink Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _610 => _610.mask]) && !active.mask.source) },
19955
+ { action: "add-vector-mask", label: "Add Vector Mask (Reveal All)", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _611 => _611.mask, 'optionalAccess', _612 => _612.source])) },
19956
+ { action: "add-vector-mask-hide", label: "Add Vector Mask (Hide All)", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _613 => _613.mask, 'optionalAccess', _614 => _614.source])) },
19957
+ { action: "add-vector-mask-selection", label: "Add Vector Mask from Selection", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _615 => _615.mask, 'optionalAccess', _616 => _616.source])) && hasSel },
19958
+ { action: "delete-vector-mask", label: "Delete Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _617 => _617.vectorMask])) },
19959
+ { action: "toggle-vector-mask", label: _optionalChain([active, 'optionalAccess', _618 => _618.vectorMask, 'optionalAccess', _619 => _619.enabled]) === false ? "Enable Vector Mask" : "Disable Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _620 => _620.vectorMask])) },
19960
+ { action: "rasterize-vector-mask", label: "Rasterize Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _621 => _621.vectorMask])) },
19961
+ { action: "rasterize", label: "Rasterize Layer", enabled: _optionalChain([active, 'optionalAccess', _622 => _622.type]) === "annotation" || _optionalChain([active, 'optionalAccess', _623 => _623.type]) === "smart" || _optionalChain([active, 'optionalAccess', _624 => _624.type]) === "shape" || _optionalChain([active, 'optionalAccess', _625 => _625.type]) === "type" || isPixel && Boolean(_optionalChain([active, 'optionalAccess', _626 => _626.type]) === "pixel" && _optionalChain([active, 'access', _627 => _627.filters, 'optionalAccess', _628 => _628.length])) },
19533
19962
  { action: "convert-smart", label: "Convert to Smart Object", enabled: Boolean(active && active.type !== "annotation") },
19534
- { action: "edit-contents", label: "Edit Contents", enabled: _optionalChain([active, 'optionalAccess', _617 => _617.type]) === "smart" },
19535
- { action: "smart-via-copy", label: "New Smart Object via Copy", enabled: _optionalChain([active, 'optionalAccess', _618 => _618.type]) === "smart" },
19536
- { action: "add-filter-mask", label: "Add Smart Filter Mask", enabled: _optionalChain([active, 'optionalAccess', _619 => _619.type]) === "smart" && !_optionalChain([active, 'access', _620 => _620.smartFilters, 'optionalAccess', _621 => _621.mask]) },
19537
- { action: "toggle-clip", label: _optionalChain([active, 'optionalAccess', _622 => _622.clipped]) ? "Release Clipping Mask" : "Create Clipping Mask", enabled: Boolean(loc && loc.index > 0) }
19963
+ { action: "edit-contents", label: "Edit Contents", enabled: _optionalChain([active, 'optionalAccess', _629 => _629.type]) === "smart" },
19964
+ { action: "smart-via-copy", label: "New Smart Object via Copy", enabled: _optionalChain([active, 'optionalAccess', _630 => _630.type]) === "smart" },
19965
+ { action: "add-filter-mask", label: "Add Smart Filter Mask", enabled: _optionalChain([active, 'optionalAccess', _631 => _631.type]) === "smart" && !_optionalChain([active, 'access', _632 => _632.smartFilters, 'optionalAccess', _633 => _633.mask]) },
19966
+ { action: "toggle-clip", label: _optionalChain([active, 'optionalAccess', _634 => _634.clipped]) ? "Release Clipping Mask" : "Create Clipping Mask", enabled: Boolean(loc && loc.index > 0) }
19538
19967
  ];
19539
19968
  }
19540
19969
  async function runLayerMenuAction(controller, action) {
19541
19970
  const active = controller.getActiveLayer();
19542
- const id = _optionalChain([active, 'optionalAccess', _623 => _623.id]);
19971
+ const id = _optionalChain([active, 'optionalAccess', _635 => _635.id]);
19543
19972
  try {
19544
19973
  switch (action) {
19545
19974
  case "new-layer":
@@ -19595,10 +20024,10 @@ async function runLayerMenuAction(controller, action) {
19595
20024
  if (id) controller.removeLayerMask(id);
19596
20025
  break;
19597
20026
  case "toggle-mask":
19598
- if (id && _optionalChain([active, 'optionalAccess', _624 => _624.mask])) controller.setLayerMaskProps(id, { enabled: active.mask.enabled === false });
20027
+ if (id && _optionalChain([active, 'optionalAccess', _636 => _636.mask])) controller.setLayerMaskProps(id, { enabled: active.mask.enabled === false });
19599
20028
  break;
19600
20029
  case "toggle-mask-link":
19601
- if (id && _optionalChain([active, 'optionalAccess', _625 => _625.mask])) controller.setLayerMaskProps(id, { linked: active.mask.linked === false });
20030
+ if (id && _optionalChain([active, 'optionalAccess', _637 => _637.mask])) controller.setLayerMaskProps(id, { linked: active.mask.linked === false });
19602
20031
  break;
19603
20032
  case "add-vector-mask":
19604
20033
  case "add-vector-mask-hide":
@@ -19611,7 +20040,7 @@ async function runLayerMenuAction(controller, action) {
19611
20040
  if (id) controller.removeVectorMask(id);
19612
20041
  break;
19613
20042
  case "toggle-vector-mask":
19614
- if (id && _optionalChain([active, 'optionalAccess', _626 => _626.vectorMask])) controller.setVectorMaskProps(id, { enabled: active.vectorMask.enabled === false });
20043
+ if (id && _optionalChain([active, 'optionalAccess', _638 => _638.vectorMask])) controller.setVectorMaskProps(id, { enabled: active.vectorMask.enabled === false });
19615
20044
  break;
19616
20045
  case "rasterize-vector-mask":
19617
20046
  if (id) controller.rasterizeVectorMask(id);
@@ -19632,7 +20061,7 @@ async function runLayerMenuAction(controller, action) {
19632
20061
  if (id) controller.setSmartFilterMask(id, "reveal-all");
19633
20062
  break;
19634
20063
  case "toggle-clip":
19635
- if (id) controller.setLayerProperties(id, { clipped: !_optionalChain([active, 'optionalAccess', _627 => _627.clipped]) });
20064
+ if (id) controller.setLayerProperties(id, { clipped: !_optionalChain([active, 'optionalAccess', _639 => _639.clipped]) });
19636
20065
  break;
19637
20066
  }
19638
20067
  return null;
@@ -19642,7 +20071,7 @@ async function runLayerMenuAction(controller, action) {
19642
20071
  }
19643
20072
  function smartFilterRows(layer) {
19644
20073
  if (layer.type !== "smart") return [];
19645
- const list = _nullishCoalesce(_optionalChain([layer, 'access', _628 => _628.smartFilters, 'optionalAccess', _629 => _629.filters]), () => ( []));
20074
+ const list = _nullishCoalesce(_optionalChain([layer, 'access', _640 => _640.smartFilters, 'optionalAccess', _641 => _641.filters]), () => ( []));
19646
20075
  const rows = list.map((f, index) => ({
19647
20076
  filter: f,
19648
20077
  index,
@@ -19668,8 +20097,8 @@ function extractNormalizedLayerItems(controller, fallbackImageUrl = "") {
19668
20097
  };
19669
20098
  collectSerialized(_nullishCoalesce(serialized.layers, () => ( [])));
19670
20099
  const sLayerMap = new Map(allSerializedLayers.map((sl) => [sl.id, sl]));
19671
- const imgW = _optionalChain([state, 'access', _630 => _630.imageDimensions, 'optionalAccess', _631 => _631.width]) || 1;
19672
- const imgH = _optionalChain([state, 'access', _632 => _632.imageDimensions, 'optionalAccess', _633 => _633.height]) || 1;
20100
+ const imgW = _optionalChain([state, 'access', _642 => _642.imageDimensions, 'optionalAccess', _643 => _643.width]) || 1;
20101
+ const imgH = _optionalChain([state, 'access', _644 => _644.imageDimensions, 'optionalAccess', _645 => _645.height]) || 1;
19673
20102
  return ctrlLayers.map((l) => {
19674
20103
  const bounds = controller.getLayerBounds(l.id) || {
19675
20104
  x: 0,
@@ -19678,8 +20107,8 @@ function extractNormalizedLayerItems(controller, fallbackImageUrl = "") {
19678
20107
  height: imgH
19679
20108
  };
19680
20109
  const sLayer = sLayerMap.get(l.id);
19681
- const assetKey = _optionalChain([sLayer, 'optionalAccess', _634 => _634.asset]);
19682
- const layerDataUrl = assetKey && assets[assetKey] || assets[l.id] || (_optionalChain([sLayer, 'optionalAccess', _635 => _635.source]) === "document" ? fallbackImageUrl : "");
20110
+ const assetKey = _optionalChain([sLayer, 'optionalAccess', _646 => _646.asset]);
20111
+ const layerDataUrl = assetKey && assets[assetKey] || assets[l.id] || (_optionalChain([sLayer, 'optionalAccess', _647 => _647.source]) === "document" ? fallbackImageUrl : "");
19683
20112
  return {
19684
20113
  id: l.id,
19685
20114
  name: l.name || "Untitled Layer",
@@ -19733,9 +20162,9 @@ async function addLayerOfKind(controller, id, init) {
19733
20162
  const cx = Math.round(canvas.width / 2);
19734
20163
  const cy = Math.round(canvas.height / 2);
19735
20164
  return controller.addTextLayer({
19736
- text: _optionalChain([init, 'optionalAccess', _636 => _636.text]) || "New Text",
19737
- x: typeof _optionalChain([init, 'optionalAccess', _637 => _637.x]) === "number" ? init.x : cx - 100,
19738
- y: typeof _optionalChain([init, 'optionalAccess', _638 => _638.y]) === "number" ? init.y : cy,
20165
+ text: _optionalChain([init, 'optionalAccess', _648 => _648.text]) || "New Text",
20166
+ x: typeof _optionalChain([init, 'optionalAccess', _649 => _649.x]) === "number" ? init.x : cx - 100,
20167
+ y: typeof _optionalChain([init, 'optionalAccess', _650 => _650.y]) === "number" ? init.y : cy,
19739
20168
  ...init
19740
20169
  });
19741
20170
  }
@@ -19748,10 +20177,10 @@ async function addLayerOfKind(controller, id, init) {
19748
20177
  return controller.addShapeLayer({
19749
20178
  shape: {
19750
20179
  kind: "rect",
19751
- x: typeof _optionalChain([init, 'optionalAccess', _639 => _639.x]) === "number" ? init.x : cx - Math.round(w / 2),
19752
- y: typeof _optionalChain([init, 'optionalAccess', _640 => _640.y]) === "number" ? init.y : cy - Math.round(h / 2),
19753
- width: typeof _optionalChain([init, 'optionalAccess', _641 => _641.width]) === "number" ? init.width : w,
19754
- height: typeof _optionalChain([init, 'optionalAccess', _642 => _642.height]) === "number" ? init.height : h
20180
+ x: typeof _optionalChain([init, 'optionalAccess', _651 => _651.x]) === "number" ? init.x : cx - Math.round(w / 2),
20181
+ y: typeof _optionalChain([init, 'optionalAccess', _652 => _652.y]) === "number" ? init.y : cy - Math.round(h / 2),
20182
+ width: typeof _optionalChain([init, 'optionalAccess', _653 => _653.width]) === "number" ? init.width : w,
20183
+ height: typeof _optionalChain([init, 'optionalAccess', _654 => _654.height]) === "number" ? init.height : h
19755
20184
  },
19756
20185
  name: "Rectangle",
19757
20186
  ...init
@@ -19766,10 +20195,10 @@ async function addLayerOfKind(controller, id, init) {
19766
20195
  return controller.addShapeLayer({
19767
20196
  shape: {
19768
20197
  kind: "ellipse",
19769
- x: typeof _optionalChain([init, 'optionalAccess', _643 => _643.x]) === "number" ? init.x : cx - Math.round(w / 2),
19770
- y: typeof _optionalChain([init, 'optionalAccess', _644 => _644.y]) === "number" ? init.y : cy - Math.round(h / 2),
19771
- width: typeof _optionalChain([init, 'optionalAccess', _645 => _645.width]) === "number" ? init.width : w,
19772
- height: typeof _optionalChain([init, 'optionalAccess', _646 => _646.height]) === "number" ? init.height : h
20198
+ x: typeof _optionalChain([init, 'optionalAccess', _655 => _655.x]) === "number" ? init.x : cx - Math.round(w / 2),
20199
+ y: typeof _optionalChain([init, 'optionalAccess', _656 => _656.y]) === "number" ? init.y : cy - Math.round(h / 2),
20200
+ width: typeof _optionalChain([init, 'optionalAccess', _657 => _657.width]) === "number" ? init.width : w,
20201
+ height: typeof _optionalChain([init, 'optionalAccess', _658 => _658.height]) === "number" ? init.height : h
19773
20202
  },
19774
20203
  name: "Ellipse",
19775
20204
  ...init
@@ -19830,18 +20259,18 @@ function layerEffectsPanel(layer) {
19830
20259
  if (!layer) return { ...empty, available: false, reason: "Select a layer to add a layer style." };
19831
20260
  if (layer.type === "adjustment") return { ...empty, available: false, reason: "Adjustment layers cannot have a layer style." };
19832
20261
  const fx = layer.effects;
19833
- const readOnly = Boolean(_optionalChain([layer, 'access', _647 => _647.locks, 'optionalAccess', _648 => _648.all]));
20262
+ const readOnly = Boolean(_optionalChain([layer, 'access', _659 => _659.locks, 'optionalAccess', _660 => _660.all]));
19834
20263
  return {
19835
20264
  available: true,
19836
20265
  readOnly,
19837
20266
  reason: readOnly ? "The layer is locked; unlock it to change its layer style." : void 0,
19838
- enabled: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _649 => _649.enabled]), () => ( true)),
19839
- scale: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _650 => _650.scale]), () => ( 1)),
19840
- rows: (_nullishCoalesce(_optionalChain([fx, 'optionalAccess', _651 => _651.items]), () => ( []))).map((e) => ({ id: e.id, kind: e.kind, label: _chunkB46UQUDCcjs.layerEffectLabel.call(void 0, e.kind), enabled: e.enabled }))
20267
+ enabled: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _661 => _661.enabled]), () => ( true)),
20268
+ scale: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _662 => _662.scale]), () => ( 1)),
20269
+ rows: (_nullishCoalesce(_optionalChain([fx, 'optionalAccess', _663 => _663.items]), () => ( []))).map((e) => ({ id: e.id, kind: e.kind, label: _chunkB46UQUDCcjs.layerEffectLabel.call(void 0, e.kind), enabled: e.enabled }))
19841
20270
  };
19842
20271
  }
19843
20272
  function layerEffectsBadge(layer) {
19844
- if (!_optionalChain([layer, 'access', _652 => _652.effects, 'optionalAccess', _653 => _653.items, 'access', _654 => _654.length])) return null;
20273
+ if (!_optionalChain([layer, 'access', _664 => _664.effects, 'optionalAccess', _665 => _665.items, 'access', _666 => _666.length])) return null;
19845
20274
  return _chunkB46UQUDCcjs.hasActiveEffects.call(void 0, layer.effects) ? "on" : "off";
19846
20275
  }
19847
20276
  var LAYER_EFFECT_MENU = _chunkB46UQUDCcjs.LAYER_EFFECT_KINDS.map((kind) => ({ kind, label: _chunkB46UQUDCcjs.layerEffectLabel.call(void 0, kind) }));
@@ -19886,8 +20315,8 @@ function fillControls(f, allowPattern, patterns) {
19886
20315
  }
19887
20316
  function gradientControls(prefix, g) {
19888
20317
  return [
19889
- { key: `${prefix}.stops.0.color`, label: "Start colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _655 => _655.stops, 'access', _656 => _656[0], 'optionalAccess', _657 => _657.color]), () => ( "#000000")) },
19890
- { key: `${prefix}.stops.last.color`, label: "End colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _658 => _658.stops, 'access', _659 => _659[g.stops.length - 1], 'optionalAccess', _660 => _660.color]), () => ( "#ffffff")) },
20318
+ { key: `${prefix}.stops.0.color`, label: "Start colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _667 => _667.stops, 'access', _668 => _668[0], 'optionalAccess', _669 => _669.color]), () => ( "#000000")) },
20319
+ { key: `${prefix}.stops.last.color`, label: "End colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _670 => _670.stops, 'access', _671 => _671[g.stops.length - 1], 'optionalAccess', _672 => _672.color]), () => ( "#ffffff")) },
19891
20320
  { key: `${prefix}.style`, label: "Style", type: "select", value: g.style, options: opt(["linear", "Linear"], ["radial", "Radial"], ["angle", "Angle"], ["reflected", "Reflected"], ["diamond", "Diamond"]) },
19892
20321
  { key: `${prefix}.angle`, label: "Angle", type: "range", min: -180, max: 180, step: 1, value: g.angle, unit: "\xB0" },
19893
20322
  { key: `${prefix}.scale`, label: "Scale", type: "range", min: 0.1, max: 1.5, step: 0.01, value: g.scale, percent: true, unit: "%" },
@@ -19979,19 +20408,19 @@ function layerEffectControls(e, patterns = []) {
19979
20408
  }
19980
20409
  function fillOfType(current, type, patterns) {
19981
20410
  if (type === "gradient") return { type: "gradient", gradient: _chunkB46UQUDCcjs.defaultEffectGradient.call(void 0, ) };
19982
- if (type === "pattern") return { type: "pattern", patternId: _nullishCoalesce(_optionalChain([patterns, 'access', _661 => _661[0], 'optionalAccess', _662 => _662.id]), () => ( "checker")), scale: 1 };
20411
+ if (type === "pattern") return { type: "pattern", patternId: _nullishCoalesce(_optionalChain([patterns, 'access', _673 => _673[0], 'optionalAccess', _674 => _674.id]), () => ( "checker")), scale: 1 };
19983
20412
  return { type: "color", color: current.type === "color" ? current.color : "#000000" };
19984
20413
  }
19985
20414
  function effectControlChange(effect, key2, value, patterns = []) {
19986
20415
  const [top, ...rest] = key2.split(".");
19987
20416
  if (top === "fill" && rest[0] === "type") return { fill: fillOfType(effect.fill, String(value), patterns) };
19988
20417
  if (top === "patternId" && !rest.length) {
19989
- const name = _optionalChain([patternOptions, 'call', _663 => _663(patterns), 'access', _664 => _664.find, 'call', _665 => _665((o) => o.value === value), 'optionalAccess', _666 => _666.label]);
20418
+ const name = _optionalChain([patternOptions, 'call', _675 => _675(patterns), 'access', _676 => _676.find, 'call', _677 => _677((o) => o.value === value), 'optionalAccess', _678 => _678.label]);
19990
20419
  return name ? { patternId: value, name } : { patternId: value };
19991
20420
  }
19992
20421
  if (!rest.length) return { [top]: value };
19993
20422
  if (top === "fill" && rest[0] === "patternId") {
19994
- const name = _optionalChain([patternOptions, 'call', _667 => _667(patterns), 'access', _668 => _668.find, 'call', _669 => _669((o) => o.value === value), 'optionalAccess', _670 => _670.label]);
20423
+ const name = _optionalChain([patternOptions, 'call', _679 => _679(patterns), 'access', _680 => _680.find, 'call', _681 => _681((o) => o.value === value), 'optionalAccess', _682 => _682.label]);
19995
20424
  return { fill: { ...effect.fill, patternId: value, ...name ? { name } : {} } };
19996
20425
  }
19997
20426
  return { [top]: setPath(getPath(effect, top), rest, value) };
@@ -20018,7 +20447,7 @@ function colorPanelView(controller) {
20018
20447
  profileName: profile.name,
20019
20448
  workingSpace: profile.builtin,
20020
20449
  mode: profile.mode,
20021
- cmykProfileName: _nullishCoalesce(_optionalChain([profile, 'access', _671 => _671.cmykProfile, 'optionalAccess', _672 => _672.name]), () => ( null)),
20450
+ cmykProfileName: _nullishCoalesce(_optionalChain([profile, 'access', _683 => _683.cmykProfile, 'optionalAccess', _684 => _684.name]), () => ( null)),
20022
20451
  proof: proof ? { id: _nullishCoalesce(proof.profile.builtin, () => ( null)), name: proof.profile.name, intent: proof.intent, simulatePaper: proof.simulatePaper, gamutWarning: proof.gamutWarning, bpc: proof.bpc } : null
20023
20452
  };
20024
20453
  }
@@ -20201,32 +20630,32 @@ function boxFrameHit(overlay, p, tolerance, band) {
20201
20630
  return null;
20202
20631
  }
20203
20632
  var FreeTransformTool = (_class16 = class {
20204
- constructor(controller, options = {}) {;_class16.prototype.__init135.call(this);_class16.prototype.__init136.call(this);_class16.prototype.__init137.call(this);_class16.prototype.__init138.call(this);_class16.prototype.__init139.call(this);_class16.prototype.__init140.call(this);_class16.prototype.__init141.call(this);_class16.prototype.__init142.call(this);_class16.prototype.__init143.call(this);_class16.prototype.__init144.call(this);_class16.prototype.__init145.call(this);_class16.prototype.__init146.call(this);_class16.prototype.__init147.call(this);_class16.prototype.__init148.call(this);
20633
+ constructor(controller, options = {}) {;_class16.prototype.__init136.call(this);_class16.prototype.__init137.call(this);_class16.prototype.__init138.call(this);_class16.prototype.__init139.call(this);_class16.prototype.__init140.call(this);_class16.prototype.__init141.call(this);_class16.prototype.__init142.call(this);_class16.prototype.__init143.call(this);_class16.prototype.__init144.call(this);_class16.prototype.__init145.call(this);_class16.prototype.__init146.call(this);_class16.prototype.__init147.call(this);_class16.prototype.__init148.call(this);_class16.prototype.__init149.call(this);
20205
20634
  this.controller = controller;
20206
20635
  this.options = options;
20207
20636
  }
20208
20637
 
20209
20638
 
20210
- __init135() {this.sessionRef = null}
20211
- __init136() {this.modeValue = "scale"}
20639
+ __init136() {this.sessionRef = null}
20640
+ __init137() {this.modeValue = "scale"}
20212
20641
  /** The reference point in the untransformed frame's space (follows the transform). */
20213
- __init137() {this.refBox = { x: 0, y: 0 }}
20214
- __init138() {this.corners = null}
20215
- __init139() {this.drag = null}
20642
+ __init138() {this.refBox = { x: 0, y: 0 }}
20643
+ __init139() {this.corners = null}
20644
+ __init140() {this.drag = null}
20216
20645
  /** The warp mesh in the frame's own space (null: no warp). */
20217
- __init140() {this.mesh = null}
20218
- __init141() {this.warpSettings = { style: "custom", bend: 50, horizontal: 0, vertical: 0, orientation: "horizontal", columns: 1, rows: 1 }}
20219
- __init142() {this.pending = false}
20220
- __init143() {this.viewScale = 1}
20646
+ __init141() {this.mesh = null}
20647
+ __init142() {this.warpSettings = { style: "custom", bend: 50, horizontal: 0, vertical: 0, orientation: "horizontal", columns: 1, rows: 1 }}
20648
+ __init143() {this.pending = false}
20649
+ __init144() {this.viewScale = 1}
20221
20650
 
20222
20651
  /** Values typed into the options bar since the last drag (V skew is not recovered from the shape). */
20223
- __init144() {this.typed = {}}
20652
+ __init145() {this.typed = {}}
20224
20653
  /** Width and height scale together when typed (the chain icon). */
20225
- __init145() {this.proportional = true}
20226
- __init146() {this.error = null}
20227
- __init147() {this.lastResult = null}
20654
+ __init146() {this.proportional = true}
20655
+ __init147() {this.error = null}
20656
+ __init148() {this.lastResult = null}
20228
20657
  get active() {
20229
- return Boolean(_optionalChain([this, 'access', _673 => _673.sessionRef, 'optionalAccess', _674 => _674.isOpen]));
20658
+ return Boolean(_optionalChain([this, 'access', _685 => _685.sessionRef, 'optionalAccess', _686 => _686.isOpen]));
20230
20659
  }
20231
20660
  get session() {
20232
20661
  return this.active ? this.sessionRef : null;
@@ -20235,7 +20664,7 @@ var FreeTransformTool = (_class16 = class {
20235
20664
  return this.modeValue;
20236
20665
  }
20237
20666
  get interpolation() {
20238
- return _nullishCoalesce(_optionalChain([this, 'access', _675 => _675.sessionRef, 'optionalAccess', _676 => _676.interpolation]), () => ( "bicubic"));
20667
+ return _nullishCoalesce(_optionalChain([this, 'access', _687 => _687.sessionRef, 'optionalAccess', _688 => _688.interpolation]), () => ( "bicubic"));
20239
20668
  }
20240
20669
  /** Whether the open transform has changed anything yet (a commit would add an undo step). */
20241
20670
  get modified() {
@@ -20245,7 +20674,7 @@ var FreeTransformTool = (_class16 = class {
20245
20674
  const start = s.startGeometry.corners;
20246
20675
  return this.corners.some((p, i) => p.x !== start[i].x || p.y !== start[i].y);
20247
20676
  }
20248
- __init148() {this.listeners = /* @__PURE__ */ new Set()}
20677
+ __init149() {this.listeners = /* @__PURE__ */ new Set()}
20249
20678
  /** Calls `listener` whenever the overlay, readout, mode or error changes. Returns the unsubscribe. */
20250
20679
  subscribe(listener) {
20251
20680
  this.listeners.add(listener);
@@ -20254,7 +20683,7 @@ var FreeTransformTool = (_class16 = class {
20254
20683
  };
20255
20684
  }
20256
20685
  changed() {
20257
- _optionalChain([this, 'access', _677 => _677.options, 'access', _678 => _678.onChange, 'optionalCall', _679 => _679()]);
20686
+ _optionalChain([this, 'access', _689 => _689.options, 'access', _690 => _690.onChange, 'optionalCall', _691 => _691()]);
20258
20687
  for (const l of this.listeners) l();
20259
20688
  }
20260
20689
  /** Opens a Free Transform (default: the selected pixels of the active layer, or the whole layer). Returns an error message or `null`. */
@@ -20647,7 +21076,7 @@ var FreeTransformTool = (_class16 = class {
20647
21076
  }
20648
21077
  /** Abandons the transform and restores everything. */
20649
21078
  cancel() {
20650
- _optionalChain([this, 'access', _680 => _680.sessionRef, 'optionalAccess', _681 => _681.cancel, 'call', _682 => _682()]);
21079
+ _optionalChain([this, 'access', _692 => _692.sessionRef, 'optionalAccess', _693 => _693.cancel, 'call', _694 => _694()]);
20651
21080
  this.sessionRef = null;
20652
21081
  this.corners = null;
20653
21082
  this.mesh = null;
@@ -20703,7 +21132,7 @@ function imageLayerAppliedEffects(layer) {
20703
21132
  const ref = (r) => ({ effect: r.effect, ...r.name ? { name: r.name } : {}, ...r.provider ? { provider: r.provider } : {} });
20704
21133
  if (layer.type === "pixel" && layer.generator) out.push({ id: "generator", ...ref(layer.generator), role: "effect layer", enabled: true, values: layer.generator.values, ...layer.generator.time ? { time: layer.generator.time } : {}, ...layer.generator.animate ? { animate: layer.generator.animate } : {} });
20705
21134
  if (layer.type === "smart")
20706
- (_nullishCoalesce(_optionalChain([layer, 'access', _683 => _683.smartFilters, 'optionalAccess', _684 => _684.filters]), () => ( []))).forEach((f, index) => {
21135
+ (_nullishCoalesce(_optionalChain([layer, 'access', _695 => _695.smartFilters, 'optionalAccess', _696 => _696.filters]), () => ( []))).forEach((f, index) => {
20707
21136
  if (f.kind === "effect") out.push({ id: f.id, ...ref(f), role: "smart filter", enabled: f.enabled && layer.smartFilters.enabled, opacity: f.opacity, blend: f.blend, values: f.values, index });
20708
21137
  });
20709
21138
  return out;
@@ -20860,7 +21289,7 @@ var OTHER_TOOL_LABELS = {
20860
21289
  watermark: "Watermark"
20861
21290
  };
20862
21291
  function imageToolLabel(tool) {
20863
- return _nullishCoalesce(_nullishCoalesce(_optionalChain([PAINT_TOOLS, 'access', _685 => _685.find, 'call', _686 => _686((t) => t.id === tool), 'optionalAccess', _687 => _687.label]), () => ( OTHER_TOOL_LABELS[tool])), () => ( tool));
21292
+ return _nullishCoalesce(_nullishCoalesce(_optionalChain([PAINT_TOOLS, 'access', _697 => _697.find, 'call', _698 => _698((t) => t.id === tool), 'optionalAccess', _699 => _699.label]), () => ( OTHER_TOOL_LABELS[tool])), () => ( tool));
20864
21293
  }
20865
21294
  var IMAGE_TOOL_SHORTCUTS = {
20866
21295
  ...Object.fromEntries(PAINT_TOOLS.filter((t) => t.shortcut).map((t) => [t.id, t.shortcut])),
@@ -20944,19 +21373,19 @@ var pt = (p) => ({ x: p.x, y: p.y });
20944
21373
  var cloneComponents = (cs) => cs.map((c) => ({ op: c.op, subpaths: c.subpaths.map((sp) => ({ anchors: sp.anchors.map(_chunkQAUIZPYIcjs.cloneAnchor), closed: sp.closed })), ...c.live ? { live: c.live } : {} }));
20945
21374
  var sameTarget = (a, b) => !!a && !!b && a.kind === b.kind && (a.kind === "path" ? a.id === b.id : a.layerId === b.layerId);
20946
21375
  var PathEditGesture = (_class17 = class {
20947
- constructor(controller) {;_class17.prototype.__init149.call(this);_class17.prototype.__init150.call(this);_class17.prototype.__init151.call(this);_class17.prototype.__init152.call(this);_class17.prototype.__init153.call(this);_class17.prototype.__init154.call(this);_class17.prototype.__init155.call(this);
21376
+ constructor(controller) {;_class17.prototype.__init150.call(this);_class17.prototype.__init151.call(this);_class17.prototype.__init152.call(this);_class17.prototype.__init153.call(this);_class17.prototype.__init154.call(this);_class17.prototype.__init155.call(this);_class17.prototype.__init156.call(this);
20948
21377
  this.controller = controller;
20949
21378
  }
20950
21379
 
20951
21380
  /** Selected anchors, as `component:subpath:anchor` keys. */
20952
- __init149() {this.selected = /* @__PURE__ */ new Set()}
20953
- __init150() {this.target = null}
20954
- __init151() {this.drag = null}
21381
+ __init150() {this.selected = /* @__PURE__ */ new Set()}
21382
+ __init151() {this.target = null}
21383
+ __init152() {this.drag = null}
20955
21384
  /** The Pen's open subpath being drawn. */
20956
- __init152() {this.drawing = null}
20957
- __init153() {this.pointer = null}
20958
- __init154() {this.scale = 1}
20959
- __init155() {this.error = null}
21385
+ __init153() {this.drawing = null}
21386
+ __init154() {this.pointer = null}
21387
+ __init155() {this.scale = 1}
21388
+ __init156() {this.error = null}
20960
21389
  /** Screen pixels per document pixel (the viewport projection's scale). */
20961
21390
  setView(scale) {
20962
21391
  if (scale > 0 && Number.isFinite(scale)) this.scale = scale;
@@ -20987,15 +21416,15 @@ var PathEditGesture = (_class17 = class {
20987
21416
  let cs;
20988
21417
  try {
20989
21418
  cs = this.controller.getPathEditComponents(target);
20990
- } catch (e40) {
21419
+ } catch (e41) {
20991
21420
  return null;
20992
21421
  }
20993
21422
  for (const k of [...this.selected]) {
20994
21423
  const r = parseKey(k);
20995
- if (!_optionalChain([cs, 'access', _688 => _688[r.component], 'optionalAccess', _689 => _689.subpaths, 'access', _690 => _690[r.subpath], 'optionalAccess', _691 => _691.anchors, 'access', _692 => _692[r.anchor]])) this.selected.delete(k);
21424
+ if (!_optionalChain([cs, 'access', _700 => _700[r.component], 'optionalAccess', _701 => _701.subpaths, 'access', _702 => _702[r.subpath], 'optionalAccess', _703 => _703.anchors, 'access', _704 => _704[r.anchor]])) this.selected.delete(k);
20996
21425
  }
20997
21426
  const d = this.drawing;
20998
- if (d && (!_optionalChain([cs, 'access', _693 => _693[d.component], 'optionalAccess', _694 => _694.subpaths, 'access', _695 => _695[d.subpath]]) || cs[d.component].subpaths[d.subpath].closed)) this.drawing = null;
21427
+ if (d && (!_optionalChain([cs, 'access', _705 => _705[d.component], 'optionalAccess', _706 => _706.subpaths, 'access', _707 => _707[d.subpath]]) || cs[d.component].subpaths[d.subpath].closed)) this.drawing = null;
20999
21428
  return cs;
21000
21429
  }
21001
21430
  anchorAt(cs, p) {
@@ -21330,11 +21759,11 @@ var PathEditGesture = (_class17 = class {
21330
21759
  let preview = null;
21331
21760
  const d = this.drawing;
21332
21761
  if (tool === "path-pen" && d && this.pointer && !this.drag) {
21333
- const sp = _optionalChain([cs, 'access', _696 => _696[d.component], 'optionalAccess', _697 => _697.subpaths, 'access', _698 => _698[d.subpath]]);
21334
- const last = _optionalChain([sp, 'optionalAccess', _699 => _699.anchors, 'access', _700 => _700[sp.anchors.length - 1]]);
21762
+ const sp = _optionalChain([cs, 'access', _708 => _708[d.component], 'optionalAccess', _709 => _709.subpaths, 'access', _710 => _710[d.subpath]]);
21763
+ const last = _optionalChain([sp, 'optionalAccess', _711 => _711.anchors, 'access', _712 => _712[sp.anchors.length - 1]]);
21335
21764
  if (last) preview = last.out ? [pt(last), pt(last.out), this.pointer, this.pointer] : [pt(last), this.pointer];
21336
21765
  }
21337
- const marquee = _optionalChain([this, 'access', _701 => _701.drag, 'optionalAccess', _702 => _702.kind]) === "marquee" ? rect(this.drag.start, this.drag.end) : null;
21766
+ const marquee = _optionalChain([this, 'access', _713 => _713.drag, 'optionalAccess', _714 => _714.kind]) === "marquee" ? rect(this.drag.start, this.drag.end) : null;
21338
21767
  return { curves, anchors, handles, marquee, preview };
21339
21768
  }
21340
21769
  }, _class17);
@@ -21369,26 +21798,26 @@ var DEFAULT_CONTENT_AWARE_FILL_SETTINGS = {
21369
21798
  livePreview: true
21370
21799
  };
21371
21800
  var ContentAwareFillSession = (_class18 = class _ContentAwareFillSession {
21372
- constructor(controller) {;_class18.prototype.__init156.call(this);_class18.prototype.__init157.call(this);_class18.prototype.__init158.call(this);_class18.prototype.__init159.call(this);_class18.prototype.__init160.call(this);_class18.prototype.__init161.call(this);_class18.prototype.__init162.call(this);_class18.prototype.__init163.call(this);_class18.prototype.__init164.call(this);_class18.prototype.__init165.call(this);_class18.prototype.__init166.call(this);_class18.prototype.__init167.call(this);_class18.prototype.__init168.call(this);_class18.prototype.__init169.call(this);_class18.prototype.__init170.call(this);
21801
+ constructor(controller) {;_class18.prototype.__init157.call(this);_class18.prototype.__init158.call(this);_class18.prototype.__init159.call(this);_class18.prototype.__init160.call(this);_class18.prototype.__init161.call(this);_class18.prototype.__init162.call(this);_class18.prototype.__init163.call(this);_class18.prototype.__init164.call(this);_class18.prototype.__init165.call(this);_class18.prototype.__init166.call(this);_class18.prototype.__init167.call(this);_class18.prototype.__init168.call(this);_class18.prototype.__init169.call(this);_class18.prototype.__init170.call(this);_class18.prototype.__init171.call(this);
21373
21802
  this.controller = controller;
21374
21803
  }
21375
21804
 
21376
- __init156() {this.settingsValue = { ...DEFAULT_CONTENT_AWARE_FILL_SETTINGS }}
21377
- __init157() {this.plan = null}
21805
+ __init157() {this.settingsValue = { ...DEFAULT_CONTENT_AWARE_FILL_SETTINGS }}
21806
+ __init158() {this.plan = null}
21378
21807
  /** The source view's window (document pixels): the selection with room around it to sample. */
21379
- __init158() {this.win = null}
21380
- __init159() {this.before = null}
21381
- __init160() {this.hole = null}
21808
+ __init159() {this.win = null}
21809
+ __init160() {this.before = null}
21810
+ __init161() {this.hole = null}
21382
21811
  /** 1 where the fill may copy from, per window pixel. */
21383
- __init161() {this.area = null}
21384
- __init162() {this.after = null}
21385
- __init163() {this.lastPoint = null}
21386
- __init164() {this.listeners = /* @__PURE__ */ new Set()}
21387
- __init165() {this.dirty = false}
21812
+ __init162() {this.area = null}
21813
+ __init163() {this.after = null}
21814
+ __init164() {this.lastPoint = null}
21815
+ __init165() {this.listeners = /* @__PURE__ */ new Set()}
21816
+ __init166() {this.dirty = false}
21388
21817
  /** Why the workspace can't fill (nothing selected, not a pixel layer), for the UI. */
21389
- __init166() {this.error = null}
21390
- __init167() {this.computing = false}
21391
- __init168() {this.revision = 0}
21818
+ __init167() {this.error = null}
21819
+ __init168() {this.computing = false}
21820
+ __init169() {this.revision = 0}
21392
21821
  get settings() {
21393
21822
  return this.settingsValue;
21394
21823
  }
@@ -21407,7 +21836,7 @@ var ContentAwareFillSession = (_class18 = class _ContentAwareFillSession {
21407
21836
  /** Images up to this many pixels show (and can be sampled) whole in the workspace. */
21408
21837
  static __initStatic() {this.WHOLE_IMAGE_PIXELS = 4e6}
21409
21838
  /** Room around the selection the window holds, in px each way. */
21410
- __init169() {this.margin = 0}
21839
+ __init170() {this.margin = 0}
21411
21840
  /**
21412
21841
  * Reads the layer and makes the first preview. The window is the whole image up to
21413
21842
  * {@link WHOLE_IMAGE_PIXELS}; on a larger one it holds the selection and room around it (twice
@@ -21416,8 +21845,8 @@ var ContentAwareFillSession = (_class18 = class _ContentAwareFillSession {
21416
21845
  async open() {
21417
21846
  try {
21418
21847
  const { width, height } = this.controller.getState().imageDimensions;
21419
- const b = _optionalChain([this, 'access', _703 => _703.controller, 'access', _704 => _704.getSelection, 'call', _705 => _705(), 'optionalAccess', _706 => _706.bounds]);
21420
- this.margin = width * height <= _ContentAwareFillSession.WHOLE_IMAGE_PIXELS ? Math.max(width, height) : Math.max(256, 2 * Math.max(_nullishCoalesce(_optionalChain([b, 'optionalAccess', _707 => _707.width]), () => ( 0)), _nullishCoalesce(_optionalChain([b, 'optionalAccess', _708 => _708.height]), () => ( 0))));
21848
+ const b = _optionalChain([this, 'access', _715 => _715.controller, 'access', _716 => _716.getSelection, 'call', _717 => _717(), 'optionalAccess', _718 => _718.bounds]);
21849
+ this.margin = width * height <= _ContentAwareFillSession.WHOLE_IMAGE_PIXELS ? Math.max(width, height) : Math.max(256, 2 * Math.max(_nullishCoalesce(_optionalChain([b, 'optionalAccess', _719 => _719.width]), () => ( 0)), _nullishCoalesce(_optionalChain([b, 'optionalAccess', _720 => _720.height]), () => ( 0))));
21421
21850
  this.plan = this.controller.prepareContentAwareFill({ sampleRadius: this.margin });
21422
21851
  } catch (err) {
21423
21852
  this.error = err instanceof Error ? err.message : String(err);
@@ -21549,7 +21978,7 @@ var ContentAwareFillSession = (_class18 = class _ContentAwareFillSession {
21549
21978
  this.emit();
21550
21979
  return true;
21551
21980
  }
21552
- __init170() {this.strokeAdds = true}
21981
+ __init171() {this.strokeAdds = true}
21553
21982
  move(point) {
21554
21983
  if (!this.lastPoint) return;
21555
21984
  this.paint(this.lastPoint, point, this.strokeAdds);
@@ -21575,7 +22004,7 @@ var ContentAwareFillSession = (_class18 = class _ContentAwareFillSession {
21575
22004
  this.dirty = false;
21576
22005
  try {
21577
22006
  const area = this.samplingMask();
21578
- if (!_optionalChain([area, 'optionalAccess', _709 => _709.bounds])) throw new Error("The sampling area is empty; paint where the fill may copy from.");
22007
+ if (!_optionalChain([area, 'optionalAccess', _721 => _721.bounds])) throw new Error("The sampling area is empty; paint where the fill may copy from.");
21579
22008
  const { plan, after } = await this.controller.previewContentAwareFill({ layerId: this.plan.layerId, samplingArea: area, seed: this.settingsValue.seed });
21580
22009
  const win = this.win;
21581
22010
  const out = Uint8ClampedArray.from(this.before);
@@ -21654,7 +22083,7 @@ var ContentAwareFillSession = (_class18 = class _ContentAwareFillSession {
21654
22083
  /** OK: fills with this sampling area, seed and output as one undo step. */
21655
22084
  async commit(options = {}) {
21656
22085
  const area = this.samplingMask();
21657
- if (!this.plan || !_optionalChain([area, 'optionalAccess', _710 => _710.bounds])) throw new Error(_nullishCoalesce(this.error, () => ( "The sampling area is empty; paint where the fill may copy from.")));
22086
+ if (!this.plan || !_optionalChain([area, 'optionalAccess', _722 => _722.bounds])) throw new Error(_nullishCoalesce(this.error, () => ( "The sampling area is empty; paint where the fill may copy from.")));
21658
22087
  return this.controller.contentAwareFillAsync({ layerId: this.plan.layerId, samplingArea: area, seed: this.settingsValue.seed, output: this.settingsValue.output, signal: options.signal });
21659
22088
  }
21660
22089
  }, _class18.__initStatic(), _class18);
@@ -22768,4 +23197,8 @@ var ContentAwareFillSession = (_class18 = class _ContentAwareFillSession {
22768
23197
 
22769
23198
 
22770
23199
 
22771
- exports.ADJUSTMENT_KEYS = _chunkS55JFWDAcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkS55JFWDAcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkS55JFWDAcjs.ADJUSTMENT_LUT_SIZE; exports.ANCHOR_FRACTION = _chunkS55JFWDAcjs.ANCHOR_FRACTION; exports.AS_SHOT_KELVIN = _chunkS55JFWDAcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkS55JFWDAcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkS55JFWDAcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkOLNIPTB3cjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkOLNIPTB3cjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkS55JFWDAcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkKWNMBMKGcjs.BODY_SCATTER; exports.BRUSHSTROKE_MAX_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MAX_SCALE; exports.BRUSHSTROKE_MIN_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MIN_SCALE; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkBROJYMWUcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunkPQ3H2AANcjs.BrushstrokeCache; exports.CANVAS_SIZE_PRESETS = CANVAS_SIZE_PRESETS; exports.CLONE_TRANSFORM_CONTROLS = CLONE_TRANSFORM_CONTROLS; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.COLOR_RANGE_PRESETS = COLOR_RANGE_PRESETS; exports.COLOR_RANGE_PRESET_LABELS = COLOR_RANGE_PRESET_LABELS; exports.CONTENT_AWARE_FILL_SAMPLING = CONTENT_AWARE_FILL_SAMPLING; exports.CONTENT_AWARE_FILL_TOOLS = CONTENT_AWARE_FILL_TOOLS; exports.ColorGmm = _chunkUC3PWFM3cjs.ColorGmm; exports.ContentAwareFillSession = ContentAwareFillSession; exports.CoverageMap = _chunkPQ3H2AANcjs.CoverageMap; exports.D50 = _chunkS55JFWDAcjs.D50; exports.D65 = _chunkS55JFWDAcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkQAUIZPYIcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkPQ3H2AANcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkPQ3H2AANcjs.DEFAULT_BRUSH; exports.DEFAULT_CANVAS_VIEWPORT = DEFAULT_CANVAS_VIEWPORT; exports.DEFAULT_CHANNEL_COLOR = DEFAULT_CHANNEL_COLOR; exports.DEFAULT_CONTENT_AWARE_FILL_SETTINGS = DEFAULT_CONTENT_AWARE_FILL_SETTINGS; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkKWNMBMKGcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkB46UQUDCcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkS55JFWDAcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkPQ3H2AANcjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunkPQ3H2AANcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkPQ3H2AANcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = _chunkSS53NNZOcjs.DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunkYF3YZZ6Gcjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SELECT_AND_MASK_SETTINGS = DEFAULT_SELECT_AND_MASK_SETTINGS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkPQ3H2AANcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkQAUIZPYIcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkKWNMBMKGcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkKWNMBMKGcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkS55JFWDAcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkK6PXS6DOcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkKWNMBMKGcjs.DRY_EPS; exports.DabWalker = _chunkPQ3H2AANcjs.DabWalker; exports.EDGE_COLOR_RADIUS = _chunkS55JFWDAcjs.EDGE_COLOR_RADIUS; exports.EFFECT_LAYER_USES = EFFECT_LAYER_USES; exports.EMPTY_DISTANCE = _chunkSS53NNZOcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkPQ3H2AANcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkKWNMBMKGcjs.EX; exports.EY = _chunkKWNMBMKGcjs.EY; exports.EdgeMap = EdgeMap; exports.FLAG_ALIVE = _chunkKWNMBMKGcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkKWNMBMKGcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkKWNMBMKGcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkKWNMBMKGcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkKWNMBMKGcjs.FLAG_TOP; exports.FLAG_WET = _chunkKWNMBMKGcjs.FLAG_WET; exports.FLAT = _chunkKWNMBMKGcjs.FLAT; exports.FREE_INTERVAL = _chunkKWNMBMKGcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkS55JFWDAcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GAMMA = _chunkUC3PWFM3cjs.GAMMA; exports.GRAIN_PATTERNS = _chunkPQ3H2AANcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkPQ3H2AANcjs.GRAIN_TILE; exports.GUIDED_FILTER_EPS = _chunkSS53NNZOcjs.GUIDED_FILTER_EPS; exports.GridGraph = _chunkUC3PWFM3cjs.GridGraph; exports.HIDE = _chunkKWNMBMKGcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkS55JFWDAcjs.HUE_RANGE_LABELS; exports.HUE_RANGE_PRESETS = HUE_RANGE_PRESETS; exports.IDENTITY_CLONE_TRANSFORM = _chunkYF3YZZ6Gcjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunkS55JFWDAcjs.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.IMAGE_PLAYBACK_KIND = IMAGE_PLAYBACK_KIND; exports.IMAGE_TOOL_GROUPS = IMAGE_TOOL_GROUPS; exports.IMAGE_TOOL_SHORTCUTS = IMAGE_TOOL_SHORTCUTS; exports.INTENTS = _chunkBROJYMWUcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkB46UQUDCcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkS55JFWDAcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkS55JFWDAcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkB46UQUDCcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkS55JFWDAcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkS55JFWDAcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkS55JFWDAcjs.LUMA_709; exports.LayerCompositor = _chunkS55JFWDAcjs.LayerCompositor; exports.LayerEffectError = _chunkB46UQUDCcjs.LayerEffectError; exports.LayerOperationError = _chunkS55JFWDAcjs.LayerOperationError; exports.MARCHING_ANTS_STEP_MS = MARCHING_ANTS_STEP_MS; exports.MASK_EDGE_THRESHOLDS = MASK_EDGE_THRESHOLDS; exports.MASK_FILE_ACCEPT = MASK_FILE_ACCEPT; exports.MAX_BATCH = _chunkKWNMBMKGcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkPQ3H2AANcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_BACKING_SIDE = MAX_CANVAS_BACKING_SIDE; exports.MAX_EFFECT_ANIMATION_MS = _chunkS55JFWDAcjs.MAX_EFFECT_ANIMATION_MS; exports.MAX_EFFECT_REACH = _chunkB46UQUDCcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkS55JFWDAcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkKWNMBMKGcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkB46UQUDCcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkKWNMBMKGcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkKWNMBMKGcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkS55JFWDAcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkS55JFWDAcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkPQ3H2AANcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkPQ3H2AANcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkPQ3H2AANcjs.MIXING_MODELS; exports.MixerStroke = _chunkPQ3H2AANcjs.MixerStroke; exports.OPP = _chunkKWNMBMKGcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkOLNIPTB3cjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunkPQ3H2AANcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkPQ3H2AANcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkPQ3H2AANcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkKWNMBMKGcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkS55JFWDAcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkKWNMBMKGcjs.PARAM; exports.PARAM_FLOATS = _chunkKWNMBMKGcjs.PARAM_FLOATS; exports.PASTE_MODES = PASTE_MODES; exports.PATH_EDIT_TOOLS = PATH_EDIT_TOOLS; exports.PATTERN_BLOCK_KEYS = _chunkS55JFWDAcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkOLNIPTB3cjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkKWNMBMKGcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkOLNIPTB3cjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkOLNIPTB3cjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkKWNMBMKGcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkOLNIPTB3cjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkKWNMBMKGcjs.PLANE; exports.PLANE_BYTES = _chunkKWNMBMKGcjs.PLANE_BYTES; exports.PREVIEW_SIZE = PREVIEW_SIZE; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkS55JFWDAcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkKWNMBMKGcjs.P_D0; exports.P_EDGE = _chunkKWNMBMKGcjs.P_EDGE; exports.P_FX = _chunkKWNMBMKGcjs.P_FX; exports.P_FY = _chunkKWNMBMKGcjs.P_FY; exports.P_H = _chunkKWNMBMKGcjs.P_H; exports.P_P0 = _chunkKWNMBMKGcjs.P_P0; exports.P_RHO = _chunkKWNMBMKGcjs.P_RHO; exports.P_SW = _chunkKWNMBMKGcjs.P_SW; exports.P_UX = _chunkKWNMBMKGcjs.P_UX; exports.P_UY = _chunkKWNMBMKGcjs.P_UY; exports.PaintExchange = _chunkPQ3H2AANcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkPQ3H2AANcjs.PaintGradientSampler; exports.PaintSourceError = _chunkPQ3H2AANcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = _chunkPQ3H2AANcjs.PaperGrain; exports.PathEditGesture = PathEditGesture; exports.PatternPlacement = _chunkB46UQUDCcjs.PatternPlacement; exports.PatternTile = _chunkB46UQUDCcjs.PatternTile; exports.PsdError = _chunkS55JFWDAcjs.PsdError; exports.QUICK_MASK_TARGET = QUICK_MASK_TARGET; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.REFINE_EDIT_KINDS = _chunkUC3PWFM3cjs.REFINE_EDIT_KINDS; exports.REFINE_OUTPUTS = REFINE_OUTPUTS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunkYF3YZZ6Gcjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunkYF3YZZ6Gcjs.RegionPixelSource; exports.RetouchDabStroke = _chunkYF3YZZ6Gcjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkSS53NNZOcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkSS53NNZOcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SELECT_AND_MASK_TOOLS = SELECT_AND_MASK_TOOLS; exports.SELECT_AND_MASK_VIEWS = SELECT_AND_MASK_VIEWS; exports.SET_PLANES = _chunkKWNMBMKGcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkOLNIPTB3cjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkS55JFWDAcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkS55JFWDAcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkKWNMBMKGcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkKWNMBMKGcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkKWNMBMKGcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkS55JFWDAcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunkYF3YZZ6Gcjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkKWNMBMKGcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkKWNMBMKGcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkS55JFWDAcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectAndMaskSession = SelectAndMaskSession; exports.SelectionGesture = SelectionGesture; exports.SelectionWorkerClient = _chunkUC3PWFM3cjs.SelectionWorkerClient; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkPQ3H2AANcjs.SmudgeTip; exports.StrokeCoverage = _chunkPQ3H2AANcjs.StrokeCoverage; exports.SurfaceDraft = _chunk474IQG74cjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkS55JFWDAcjs.TEXT_ALIGNS; exports.TEXT_ORIENTATIONS = _chunkS55JFWDAcjs.TEXT_ORIENTATIONS; exports.TEXT_RENDER_MARGIN = _chunkS55JFWDAcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkS55JFWDAcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunk474IQG74cjs.TILE; exports.TILE_SHIFT = _chunk474IQG74cjs.TILE_SHIFT; exports.TINT_SCALE = _chunkS55JFWDAcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunkPQ3H2AANcjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkS55JFWDAcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunkYF3YZZ6Gcjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkS55JFWDAcjs.TRANSFORM_ANCHORS; exports.TRANSFORM_ROTATE_HANDLE_OFFSET = TRANSFORM_ROTATE_HANDLE_OFFSET; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkPQ3H2AANcjs.TileMedium; exports.TilePixelSource = _chunkYF3YZZ6Gcjs.TilePixelSource; exports.TileableNoise = _chunkPQ3H2AANcjs.TileableNoise; exports.TiledSurface = _chunk474IQG74cjs.TiledSurface; exports.TransformTooLargeError = _chunkB46UQUDCcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunkYF3YZZ6Gcjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.UNITS = _chunkUC3PWFM3cjs.UNITS; exports.U_MAX = _chunkKWNMBMKGcjs.U_MAX; exports.VIBRANCE_GREY = _chunkS55JFWDAcjs.VIBRANCE_GREY; exports.W9 = _chunkKWNMBMKGcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkQAUIZPYIcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkQAUIZPYIcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkKWNMBMKGcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkKWNMBMKGcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkKWNMBMKGcjs.WET_TILE; exports.WGSL_HALO = _chunkKWNMBMKGcjs.WGSL_HALO; exports.WGSL_SHADE = _chunkKWNMBMKGcjs.WGSL_SHADE; exports.WGSL_STEP = _chunkKWNMBMKGcjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WORK_PATH_NAME = WORK_PATH_NAME; exports.WORK_SIZE = _chunkUC3PWFM3cjs.WORK_SIZE; exports.WetGpuEngine = _chunkKWNMBMKGcjs.WetGpuEngine; exports.WetMedium = _chunkKWNMBMKGcjs.WetMedium; exports.WetWorkerPool = _chunkKWNMBMKGcjs.WetWorkerPool; exports.WetWorld = _chunkKWNMBMKGcjs.WetWorld; exports.WetWorldError = _chunkKWNMBMKGcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkS55JFWDAcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkXFM3OCHUcjs.ZlibError; exports.activeAdjustmentLayers = _chunkS55JFWDAcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkS55JFWDAcjs.activeEffectSmartFilters; exports.activeLayerAfterRemoval = _chunkS55JFWDAcjs.activeLayerAfterRemoval; exports.activeSmartFilters = _chunkS55JFWDAcjs.activeSmartFilters; exports.addLayerEffect = _chunkS55JFWDAcjs.addLayerEffect; exports.addLayerFilter = _chunkS55JFWDAcjs.addLayerFilter; exports.addLayerOfKind = addLayerOfKind; exports.addPaintGradientStop = _chunkPQ3H2AANcjs.addPaintGradientStop; exports.addSmartFilter = _chunkS55JFWDAcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkS55JFWDAcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkS55JFWDAcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkS55JFWDAcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkS55JFWDAcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunkXFM3OCHUcjs.adler32; exports.agentDragDraft = agentDragDraft; exports.anchorPoint = _chunkS55JFWDAcjs.anchorPoint; exports.annotationBlend = _chunkS55JFWDAcjs.annotationBlend; exports.annotationLayerFor = _chunkS55JFWDAcjs.annotationLayerFor; exports.annotationLayerName = _chunkS55JFWDAcjs.annotationLayerName; exports.annotationOfLayer = _chunkS55JFWDAcjs.annotationOfLayer; exports.annotationOfShape = _chunkS55JFWDAcjs.annotationOfShape; exports.annotationOfType = _chunkS55JFWDAcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkS55JFWDAcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkS55JFWDAcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkS55JFWDAcjs.applyAdjustments; exports.applyBoxBlur = _chunkS55JFWDAcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkS55JFWDAcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkS55JFWDAcjs.applyDepthMask; exports.applyEdgeUnmix = _chunkS55JFWDAcjs.applyEdgeUnmix; exports.applyHomography = _chunkQT26RHKKcjs.applyHomography; exports.applyImageProjectionToContext = _chunkS55JFWDAcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkS55JFWDAcjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkS55JFWDAcjs.applyLegacyFloat; exports.applyMatrix3 = _chunkS55JFWDAcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkS55JFWDAcjs.applyParams; exports.applyProcess2Adjustments = _chunkS55JFWDAcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkS55JFWDAcjs.applyProcess2Float; exports.applyRefineEdits = _chunkUC3PWFM3cjs.applyRefineEdits; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunkYF3YZZ6Gcjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkS55JFWDAcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkPQ3H2AANcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkPQ3H2AANcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunkYF3YZZ6Gcjs.applyToneToDeepTile; exports.backgroundLayer = _chunkS55JFWDAcjs.backgroundLayer; exports.base64ToBytes = _chunkOLNIPTB3cjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunkMQDIP4CFcjs.bestOffset; exports.blackWhiteGray = _chunkS55JFWDAcjs.blackWhiteGray; exports.blendChannel = _chunkOLNIPTB3cjs.blendChannel; exports.blendImageData = _chunkOLNIPTB3cjs.blendImageData; exports.blendLum = _chunkOLNIPTB3cjs.blendLum; exports.blendPixel = _chunkOLNIPTB3cjs.blendPixel; exports.blendRadius = _chunkPQ3H2AANcjs.blendRadius; exports.blendRgb = _chunkOLNIPTB3cjs.blendRgb; exports.blendTile = _chunkB46UQUDCcjs.blendTile; exports.blenderDab = _chunkPQ3H2AANcjs.blenderDab; exports.blurFilter = _chunkS55JFWDAcjs.blurFilter; exports.borderCoverage = _chunkSS53NNZOcjs.borderCoverage; exports.boxBlur = _chunkUC3PWFM3cjs.boxBlur; exports.boxBlurPixels = _chunkYF3YZZ6Gcjs.boxBlurPixels; exports.boxFrameHit = boxFrameHit; exports.boxFrameOverlay = boxFrameOverlay; exports.boxMean = _chunkSS53NNZOcjs.boxMean; exports.boxPointOf = _chunkS55JFWDAcjs.boxPointOf; exports.boxQuad = _chunkQT26RHKKcjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkS55JFWDAcjs.bradfordAdaptation; exports.brushStrokeMask = _chunkUC3PWFM3cjs.brushStrokeMask; exports.brushstrokeDataUrl = _chunkPQ3H2AANcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkPQ3H2AANcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkPQ3H2AANcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkYQGCPL5Xcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkPQ3H2AANcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkPQ3H2AANcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkS55JFWDAcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkS55JFWDAcjs.buildToneLut; exports.builtinPattern = _chunkB46UQUDCcjs.builtinPattern; exports.builtinPatternIds = _chunkB46UQUDCcjs.builtinPatternIds; exports.bytesToBase64 = _chunkOLNIPTB3cjs.bytesToBase64; exports.calculateCropDrag = _chunkS55JFWDAcjs.calculateCropDrag; exports.canShareMemory = _chunkKWNMBMKGcjs.canShareMemory; exports.canvasCompositeOperation = _chunkOLNIPTB3cjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkS55JFWDAcjs.canvasToImagePoint; exports.caretAt = _chunkQAUIZPYIcjs.caretAt; exports.changedTiles = _chunkB46UQUDCcjs.changedTiles; exports.channelThumbnail = channelThumbnail; exports.checkEffectAnimation = checkEffectAnimation; exports.checkEffectTime = checkEffectTime; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkS55JFWDAcjs.clampCropToImage; exports.cleanMixer = _chunkPQ3H2AANcjs.cleanMixer; exports.cloneSamplePoint = _chunkYF3YZZ6Gcjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunk474IQG74cjs.collectTiles; exports.colorBalanceChannel = _chunkS55JFWDAcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.colorRangePreset = colorRangePreset; exports.combineSelections = _chunkSS53NNZOcjs.combineSelections; exports.compileAdjustmentLayer = _chunkS55JFWDAcjs.compileAdjustmentLayer; exports.componentPath = _chunkS55JFWDAcjs.componentPath; exports.componentsCoverage = _chunkS55JFWDAcjs.componentsCoverage; exports.compositeDeep = _chunkS55JFWDAcjs.compositeDeep; exports.compositeSurfaceOver = _chunkB46UQUDCcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkSS53NNZOcjs.computeSelectionBounds; exports.contentAwareFill = _chunkMQDIP4CFcjs.contentAwareFill; exports.contentBounds = _chunk474IQG74cjs.contentBounds; exports.contentsBox = _chunkS55JFWDAcjs.contentsBox; exports.contentsSurface = _chunkS55JFWDAcjs.contentsSurface; exports.contractCoverage = _chunkSS53NNZOcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkOLNIPTB3cjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkS55JFWDAcjs.convertToSmartObject; exports.copySmartObject = _chunkS55JFWDAcjs.copySmartObject; exports.cornersFromMatrix = _chunkS55JFWDAcjs.cornersFromMatrix; exports.coverageTileCoord = _chunkPQ3H2AANcjs.coverageTileCoord; exports.coverageToByte = _chunkSS53NNZOcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkS55JFWDAcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkPQ3H2AANcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkQAUIZPYIcjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; exports.createImageEditorDocument = createImageEditorDocument; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageEffectsToolProvider = createImageEffectsToolProvider; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePlaybackLocator = createImagePlaybackLocator; exports.createImagePsdTools = createImagePsdTools; exports.createImageRetouchTools = createImageRetouchTools; exports.createImageSegmentationToolProvider = createImageSegmentationToolProvider; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageSubjectSelectionTool = createImageSubjectSelectionTool; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkQAUIZPYIcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkQAUIZPYIcjs.createOutlineTextShaper; exports.createPigment = _chunkOLNIPTB3cjs.createPigment; exports.createPigmentTools = _chunkKWNMBMKGcjs.createPigmentTools; exports.createSelectionMask = _chunkSS53NNZOcjs.createSelectionMask; exports.createShapeLayer = _chunkS55JFWDAcjs.createShapeLayer; exports.createTypeLayer = _chunkS55JFWDAcjs.createTypeLayer; exports.createWetGpuEngine = _chunkKWNMBMKGcjs.createWetGpuEngine; exports.cssFont = _chunkQAUIZPYIcjs.cssFont; exports.cssFontFamily = _chunkQAUIZPYIcjs.cssFontFamily; exports.curveLut = _chunkB46UQUDCcjs.curveLut; exports.curveLutFromLevels = _chunkS55JFWDAcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkPQ3H2AANcjs.dabCoverage; exports.dabRect = _chunkPQ3H2AANcjs.dabRect; exports.decodeDeepSurface = _chunkS55JFWDAcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkS55JFWDAcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkS55JFWDAcjs.decodeLayerMask; exports.decodeMergedImage = _chunkS55JFWDAcjs.decodeMergedImage; exports.decodePlanes = _chunkS55JFWDAcjs.decodePlanes; exports.decodePng = _chunkOLNIPTB3cjs.decodePng; exports.decodePngDataUrl = _chunkS55JFWDAcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkSS53NNZOcjs.decodeSelectionRle; exports.decontaminateColors = _chunkSS53NNZOcjs.decontaminateColors; exports.deepBytes = _chunkOLNIPTB3cjs.deepBytes; exports.deepTile = _chunkOLNIPTB3cjs.deepTile; exports.defaultActiveLayerId = _chunkS55JFWDAcjs.defaultActiveLayerId; exports.defaultAdjustmentParams = _chunkS55JFWDAcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkB46UQUDCcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkB46UQUDCcjs.defaultLayerEffect; exports.defaultShapeName = _chunkS55JFWDAcjs.defaultShapeName; exports.deflate = _chunkXFM3OCHUcjs.deflate; exports.deflateRaw = _chunkXFM3OCHUcjs.deflateRaw; exports.depthMaskAlpha = _chunkS55JFWDAcjs.depthMaskAlpha; exports.depthOf = _chunkOLNIPTB3cjs.depthOf; exports.depthRasterMask = _chunkS55JFWDAcjs.depthRasterMask; exports.describeChannel = describeChannel; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkS55JFWDAcjs.describeTransform; exports.deserializeChannels = deserializeChannels; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkS55JFWDAcjs.deserializeEffects; exports.deserializeLayer = _chunkS55JFWDAcjs.deserializeLayer; exports.deserializeLayers = _chunkS55JFWDAcjs.deserializeLayers; exports.deserializeMask = _chunkUC3PWFM3cjs.deserializeMask; exports.deserializePatterns = _chunkS55JFWDAcjs.deserializePatterns; exports.deserializeSelection = _chunkSS53NNZOcjs.deserializeSelection; exports.despillEdge = _chunkS55JFWDAcjs.despillEdge; exports.developFilter = _chunkS55JFWDAcjs.developFilter; exports.developFromAdjustments = _chunkS55JFWDAcjs.developFromAdjustments; exports.developTarget = _chunkS55JFWDAcjs.developTarget; exports.dexp = _chunkKWNMBMKGcjs.dexp; exports.dilateMask = _chunkMQDIP4CFcjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkSS53NNZOcjs.distanceTransform; exports.dlog = _chunkKWNMBMKGcjs.dlog; exports.documentContents = _chunkS55JFWDAcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunkYF3YZZ6Gcjs.dodgeBurn; exports.dodgeBurnCurve = _chunkYF3YZZ6Gcjs.dodgeBurnCurve; exports.downloadMaskImage = downloadMaskImage; exports.downloadPsd = downloadPsd; exports.dpow = _chunkKWNMBMKGcjs.dpow; exports.dragWarpMeshPoint = _chunkQAUIZPYIcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkKWNMBMKGcjs.dsincos; exports.duplicateLayer = _chunkS55JFWDAcjs.duplicateLayer; exports.edgeBits = _chunkKWNMBMKGcjs.edgeBits; exports.edgeWidth = _chunkSS53NNZOcjs.edgeWidth; exports.effectColorHex = _chunkB46UQUDCcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectLayerTiming = effectLayerTiming; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkB46UQUDCcjs.effectReach; exports.effectiveLayerMask = _chunkS55JFWDAcjs.effectiveLayerMask; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkB46UQUDCcjs.effectsFingerprint; exports.effectsMargin = _chunkB46UQUDCcjs.effectsMargin; exports.effectsScale = _chunkB46UQUDCcjs.effectsScale; exports.ellipsePoints = _chunkUC3PWFM3cjs.ellipsePoints; exports.ellipseSelection = _chunkUC3PWFM3cjs.ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunk474IQG74cjs.emptySurface; exports.encodeDeepSurface = _chunkS55JFWDAcjs.encodeDeepSurface; exports.encodePng = _chunkOLNIPTB3cjs.encodePng; exports.encodeRle = _chunkS55JFWDAcjs.encodeRle; exports.encodeSelectionRle = _chunkSS53NNZOcjs.encodeSelectionRle; exports.encodeSurface = _chunkS55JFWDAcjs.encodeSurface; exports.evalWarpMesh = _chunkQAUIZPYIcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkS55JFWDAcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkPQ3H2AANcjs.exchangeRates; exports.expNeg = _chunkKWNMBMKGcjs.expNeg; exports.expandCoverage = _chunkSS53NNZOcjs.expandCoverage; exports.exportPsd = _chunkS55JFWDAcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkSS53NNZOcjs.featherCoverage; exports.fillRect = _chunk474IQG74cjs.fillRect; exports.filmPixel = _chunkKWNMBMKGcjs.filmPixel; exports.filmReflectance = _chunkKWNMBMKGcjs.filmReflectance; exports.filterMaskCoverage = _chunkS55JFWDAcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkB46UQUDCcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findSky = _chunkUC3PWFM3cjs.findSky; exports.findSubject = _chunkUC3PWFM3cjs.findSubject; exports.findWebGpu = _chunkKWNMBMKGcjs.findWebGpu; exports.finishTile = _chunk474IQG74cjs.finishTile; exports.fitParagraphRuns = _chunkQAUIZPYIcjs.fitParagraphRuns; exports.fitRuns = _chunkQAUIZPYIcjs.fitRuns; exports.flattenLayers = _chunkB46UQUDCcjs.flattenLayers; exports.flattenPath = _chunkS55JFWDAcjs.flattenPath; exports.flipCorners = _chunkS55JFWDAcjs.flipCorners; exports.flowField = _chunkKWNMBMKGcjs.flowField; exports.focusArea = _chunkUC3PWFM3cjs.focusArea; exports.followLayerMove = _chunkS55JFWDAcjs.followLayerMove; exports.fontOf = _chunkQAUIZPYIcjs.fontOf; exports.forgetSelectAndMaskSettings = forgetSelectAndMaskSettings; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkSS53NNZOcjs.fullSelection; exports.gaussianBlur = _chunkK6PXS6DOcjs.gaussianBlur; exports.geometryHomography = _chunkS55JFWDAcjs.geometryHomography; exports.getAnnotationBounds = _chunkS55JFWDAcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkS55JFWDAcjs.getCropCursor; exports.getRotatedSize = _chunkS55JFWDAcjs.getRotatedSize; exports.getViewportMetrics = _chunkS55JFWDAcjs.getViewportMetrics; exports.getViewportProjection = _chunkS55JFWDAcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.grabCutLabels = _chunkUC3PWFM3cjs.grabCutLabels; exports.gradientDabColor = _chunkPQ3H2AANcjs.gradientDabColor; exports.grainCatch = _chunkPQ3H2AANcjs.grainCatch; exports.grainHeights = _chunkPQ3H2AANcjs.grainHeights; exports.greyMorphology = _chunkSS53NNZOcjs.greyMorphology; exports.groupLayers = _chunkS55JFWDAcjs.groupLayers; exports.growSelection = growSelection; exports.guidePlanes = _chunkSS53NNZOcjs.guidePlanes; exports.guidedFilterColor = _chunkSS53NNZOcjs.guidedFilterColor; exports.handleMaskViewKey = handleMaskViewKey; exports.handlePaintShortcut = handlePaintShortcut; exports.handleQuickMaskKey = handleQuickMaskKey; exports.handleSelectionShortcut = handleSelectionShortcut; exports.hasActiveEffects = _chunkB46UQUDCcjs.hasActiveEffects; exports.hasEdgeUnmix = _chunkS55JFWDAcjs.hasEdgeUnmix; exports.hasLayersBelow = hasLayersBelow; exports.hasResampledLegacyMask = _chunkS55JFWDAcjs.hasResampledLegacyMask; exports.hasSoftBand = _chunkS55JFWDAcjs.hasSoftBand; exports.hasSurface = _chunkS55JFWDAcjs.hasSurface; exports.hasWarp = _chunkS55JFWDAcjs.hasWarp; exports.hash2 = _chunkPQ3H2AANcjs.hash2; exports.hashMaskContent = _chunkSS53NNZOcjs.hashMaskContent; exports.hashNoise = _chunkB46UQUDCcjs.hashNoise; exports.healPixels = _chunkYF3YZZ6Gcjs.healPixels; exports.hexToPaintRgb = _chunkPQ3H2AANcjs.hexToPaintRgb; exports.hexToRgb = _chunkS55JFWDAcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkS55JFWDAcjs.hitTestAnnotation; exports.hitTestCrop = _chunkS55JFWDAcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkQT26RHKKcjs.homographyFromAffine; exports.homographyFromPoints = _chunkQT26RHKKcjs.homographyFromPoints; exports.hslToRgb = _chunkS55JFWDAcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkS55JFWDAcjs.hueRangeTables; exports.hueRangeWeight = _chunkS55JFWDAcjs.hueRangeWeight; exports.hueSaturation = _chunkS55JFWDAcjs.hueSaturation; exports.identityCurve = _chunkS55JFWDAcjs.identityCurve; exports.identityLevels = _chunkS55JFWDAcjs.identityLevels; exports.identityTransform = _chunkS55JFWDAcjs.identityTransform; exports.identityWarpMesh = _chunkQAUIZPYIcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imagePanelTool = imagePanelTool; exports.imagePlaybackPanel = imagePlaybackPanel; exports.imageToCanvasPoint = _chunkS55JFWDAcjs.imageToCanvasPoint; exports.imageToolCanvasMode = imageToolCanvasMode; exports.imageToolForShortcut = imageToolForShortcut; exports.imageToolGroup = imageToolGroup; exports.imageToolLabel = imageToolLabel; exports.imageToolPanel = imageToolPanel; exports.importPsd = _chunkS55JFWDAcjs.importPsd; exports.inflate = _chunkXFM3OCHUcjs.inflate; exports.inflateRaw = _chunkXFM3OCHUcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkB46UQUDCcjs.insertLayer; exports.inspectMaskEdge = inspectMaskEdge; exports.instancesOf = _chunkS55JFWDAcjs.instancesOf; exports.invertHomography = _chunkQT26RHKKcjs.invertHomography; exports.invertMatrix3 = _chunkS55JFWDAcjs.invertMatrix3; exports.invertSelection = _chunkSS53NNZOcjs.invertSelection; exports.isActiveFilter = _chunkS55JFWDAcjs.isActiveFilter; exports.isActiveVectorMask = _chunkS55JFWDAcjs.isActiveVectorMask; exports.isAdjustmentKind = _chunkS55JFWDAcjs.isAdjustmentKind; exports.isBitDepth = _chunkOLNIPTB3cjs.isBitDepth; exports.isBlendMode = _chunkOLNIPTB3cjs.isBlendMode; exports.isBrushstrokeBrush = _chunkPQ3H2AANcjs.isBrushstrokeBrush; exports.isColorRangePreset = isColorRangePreset; exports.isContentsDecoded = _chunkS55JFWDAcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkS55JFWDAcjs.isDefaultDepthMask; exports.isGradientPaint = _chunkPQ3H2AANcjs.isGradientPaint; exports.isIdentityCloneTransform = _chunkYF3YZZ6Gcjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunkS55JFWDAcjs.isIdentityTransform; exports.isInterpolation = _chunkB46UQUDCcjs.isInterpolation; exports.isLayerEffectKind = _chunkB46UQUDCcjs.isLayerEffectKind; exports.isLayerLocked = _chunkB46UQUDCcjs.isLayerLocked; exports.isLegacyShape = _chunkS55JFWDAcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPaintableLayer = _chunkS55JFWDAcjs.isPaintableLayer; exports.isPainterlyBlendMode = _chunkOLNIPTB3cjs.isPainterlyBlendMode; exports.isPathEditTool = isPathEditTool; exports.isPng = _chunkOLNIPTB3cjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkS55JFWDAcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkS55JFWDAcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkSS53NNZOcjs.isSelectionEmpty; exports.isSelectionMode = _chunkSS53NNZOcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkOLNIPTB3cjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkS55JFWDAcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkS55JFWDAcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkS55JFWDAcjs.isTransformAnchor; exports.isValidWarp = _chunkS55JFWDAcjs.isValidWarp; exports.keepDeepSamples = _chunkOLNIPTB3cjs.keepDeepSamples; exports.keepMainPieces = _chunkUC3PWFM3cjs.keepMainPieces; exports.kelvinToTemperature = _chunkS55JFWDAcjs.kelvinToTemperature; exports.keysWeight = _chunkB46UQUDCcjs.keysWeight; exports.latticeViscosity = _chunkKWNMBMKGcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkB46UQUDCcjs.layerEffectFields; exports.layerEffectLabel = _chunkB46UQUDCcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkS55JFWDAcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkS55JFWDAcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkS55JFWDAcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkS55JFWDAcjs.layerMaskKey; exports.layerMaskSelection = _chunkS55JFWDAcjs.layerMaskSelection; exports.layerMenu = layerMenu; exports.layerName = _chunkS55JFWDAcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerPanels = layerPanels; exports.layerThumbnailClick = layerThumbnailClick; exports.layerTree = _chunkS55JFWDAcjs.layerTree; exports.layerTypeLabel = _chunkS55JFWDAcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkS55JFWDAcjs.layersFromLegacy; exports.layoutText = _chunkQAUIZPYIcjs.layoutText; exports.legacyAdjustmentLayer = _chunkS55JFWDAcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkS55JFWDAcjs.legacyMaskOf; exports.legacyView = _chunkS55JFWDAcjs.legacyView; exports.lerpPigment = _chunkOLNIPTB3cjs.lerpPigment; exports.lerpPigmentInto = _chunkOLNIPTB3cjs.lerpPigmentInto; exports.levelsValue = _chunkS55JFWDAcjs.levelsValue; exports.linearSrgbToXy = _chunkS55JFWDAcjs.linearSrgbToXy; exports.linearToSrgb = _chunkS55JFWDAcjs.linearToSrgb; exports.linearToSrgb8 = _chunkKWNMBMKGcjs.linearToSrgb8; exports.liveComponent = _chunkS55JFWDAcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkS55JFWDAcjs.liveShapeSubpaths; exports.liveWire = liveWire; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkPQ3H2AANcjs.loadMixer; exports.loadOpenTypeFont = _chunkLCCMOWR7cjs.loadOpenTypeFont; exports.loadWetKernel = _chunkKWNMBMKGcjs.loadWetKernel; exports.luma = _chunkYF3YZZ6Gcjs.luma; exports.magicWand = magicWand; exports.magneticAnchorSpacing = magneticAnchorSpacing; exports.mapCropHandle = _chunkS55JFWDAcjs.mapCropHandle; exports.mapLayer = _chunkB46UQUDCcjs.mapLayer; exports.mapSubpaths = _chunkS55JFWDAcjs.mapSubpaths; exports.maskBounds = _chunkMQDIP4CFcjs.maskBounds; exports.maskCoverageOverCanvas = _chunkS55JFWDAcjs.maskCoverageOverCanvas; exports.maskFileName = maskFileName; exports.maskNameFromFile = maskNameFromFile; exports.maskSummary = maskSummary; exports.maskThumbnailClick = maskThumbnailClick; exports.matrixFromCorners = _chunkS55JFWDAcjs.matrixFromCorners; exports.matrixFromParams = _chunkS55JFWDAcjs.matrixFromParams; exports.measureCanvasViewport = measureCanvasViewport; exports.membraneFill = _chunkMQDIP4CFcjs.membraneFill; exports.mergeLayerEffect = _chunkB46UQUDCcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkS55JFWDAcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunkPQ3H2AANcjs.mix32; exports.mixPigment8 = _chunkOLNIPTB3cjs.mixPigment8; exports.mixPigmentRgb = _chunkOLNIPTB3cjs.mixPigmentRgb; exports.mixPigments = _chunkOLNIPTB3cjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkPQ3H2AANcjs.mixerRates; exports.modifySelection = _chunkSS53NNZOcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkS55JFWDAcjs.moveLayer; exports.moveSmartFilter = _chunkS55JFWDAcjs.moveSmartFilter; exports.mulMatrix3 = _chunkS55JFWDAcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkS55JFWDAcjs.neutralHueRange; exports.newContentsId = _chunkS55JFWDAcjs.newContentsId; exports.newEffectId = _chunkB46UQUDCcjs.newEffectId; exports.newLayerId = _chunkS55JFWDAcjs.newLayerId; exports.newLayerOptions = newLayerOptions; exports.newPathId = newPathId; exports.normalizeAdjustmentLayer = _chunkS55JFWDAcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkS55JFWDAcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkS55JFWDAcjs.normalizeAngle; exports.normalizeBlendMode = _chunkOLNIPTB3cjs.normalizeBlendMode; exports.normalizeBlender = _chunkPQ3H2AANcjs.normalizeBlender; exports.normalizeBrush = _chunkPQ3H2AANcjs.normalizeBrush; exports.normalizeFilter = _chunkS55JFWDAcjs.normalizeFilter; exports.normalizeFlow = _chunkKWNMBMKGcjs.normalizeFlow; exports.normalizeHexColor = _chunkPQ3H2AANcjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkB46UQUDCcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkS55JFWDAcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkS55JFWDAcjs.normalizeLiveShape; exports.normalizeMixer = _chunkPQ3H2AANcjs.normalizeMixer; exports.normalizePlacement = _chunkS55JFWDAcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkS55JFWDAcjs.normalizeProcessVersion; exports.normalizeRect = _chunkUC3PWFM3cjs.normalizeRect; exports.normalizeRefineEdgeParams = _chunkSS53NNZOcjs.normalizeRefineEdgeParams; exports.normalizeRetouch = _chunkYF3YZZ6Gcjs.normalizeRetouch; exports.normalizeShapePaint = _chunkS55JFWDAcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkS55JFWDAcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkS55JFWDAcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkPQ3H2AANcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkS55JFWDAcjs.normalizeSubpaths; exports.normalizeText = _chunkS55JFWDAcjs.normalizeText; exports.normalizeTilt = _chunkKWNMBMKGcjs.normalizeTilt; exports.normalizeWetParams = _chunkKWNMBMKGcjs.normalizeWetParams; exports.offsetLayer = _chunkS55JFWDAcjs.offsetLayer; exports.offsetShape = _chunkS55JFWDAcjs.offsetShape; exports.offsetSmartObject = _chunkS55JFWDAcjs.offsetSmartObject; exports.offsetVectorMask = _chunkS55JFWDAcjs.offsetVectorMask; exports.openMaskFile = openMaskFile; exports.openPsdFile = openPsdFile; exports.otsuThreshold = _chunkUC3PWFM3cjs.otsuThreshold; exports.packRgba = _chunk474IQG74cjs.packRgba; exports.packWetParams = _chunkKWNMBMKGcjs.packWetParams; exports.paintGradientMappingFor = _chunkPQ3H2AANcjs.paintGradientMappingFor; exports.paintPathStroke = _chunkPQ3H2AANcjs.paintPathStroke; exports.paintSourceColor = _chunkPQ3H2AANcjs.paintSourceColor; exports.paintSourceCss = _chunkPQ3H2AANcjs.paintSourceCss; exports.paragraphRanges = _chunkQAUIZPYIcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkS55JFWDAcjs.parseAdjustmentBlock; exports.parseBlend = _chunkS55JFWDAcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkA2IS7EHEcjs.parseCssColor; exports.parseDataUrl = _chunkOLNIPTB3cjs.parseDataUrl; exports.parseEffectColor = _chunkB46UQUDCcjs.parseEffectColor; exports.parseLfx2 = _chunkS55JFWDAcjs.parseLfx2; exports.parseLrfx = _chunkS55JFWDAcjs.parseLrfx; exports.parseOpenTypeFont = _chunkLCCMOWR7cjs.parseOpenTypeFont; exports.parsePaintSource = _chunkPQ3H2AANcjs.parsePaintSource; exports.parsePatternBlock = _chunkS55JFWDAcjs.parsePatternBlock; exports.parseSelectionMode = _chunkSS53NNZOcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkS55JFWDAcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkS55JFWDAcjs.patchParagraphStyle; exports.patchTextStyle = _chunkS55JFWDAcjs.patchTextStyle; exports.pathAnchorCount = pathAnchorCount; exports.pathBounds = pathBounds; exports.pathStrokeCoverage = _chunkPQ3H2AANcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkPQ3H2AANcjs.pathStrokeDabs; exports.pathSvgData = pathSvgData; exports.pathToSelection = pathToSelection; exports.perDabStrength = _chunkYF3YZZ6Gcjs.perDabStrength; exports.photoFilterMatrix = _chunkS55JFWDAcjs.photoFilterMatrix; exports.pigment8 = _chunkOLNIPTB3cjs.pigment8; exports.pigmentColor = _chunkKWNMBMKGcjs.pigmentColor; exports.pigmentOf = _chunkKWNMBMKGcjs.pigmentOf; exports.pixelLayerBounds = _chunkS55JFWDAcjs.pixelLayerBounds; exports.pixelLayers = _chunkS55JFWDAcjs.pixelLayers; exports.pixelPigment = _chunkKWNMBMKGcjs.pixelPigment; exports.placeContents = _chunkS55JFWDAcjs.placeContents; exports.placeLayer = _chunkS55JFWDAcjs.placeLayer; exports.placementAt = _chunkS55JFWDAcjs.placementAt; exports.placementBounds = _chunkS55JFWDAcjs.placementBounds; exports.placementGeometry = _chunkS55JFWDAcjs.placementGeometry; exports.planImageToolPlayback = planImageToolPlayback; exports.planOutlineTrace = planOutlineTrace; exports.pngDataUrl = _chunkOLNIPTB3cjs.pngDataUrl; exports.pointerPressure = _chunkKWNMBMKGcjs.pointerPressure; exports.pointerStrokeSample = _chunkKWNMBMKGcjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkKWNMBMKGcjs.pointerStrokeSamples; exports.polygonCoverage = _chunkUC3PWFM3cjs.polygonCoverage; exports.polygonCoverageBox = _chunkUC3PWFM3cjs.polygonCoverageBox; exports.polygonSelection = _chunkUC3PWFM3cjs.polygonSelection; exports.posterizeValue = _chunkS55JFWDAcjs.posterizeValue; exports.presetWarp = _chunkS55JFWDAcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkS55JFWDAcjs.projectImagePoint; exports.projectImageRect = _chunkS55JFWDAcjs.projectImageRect; exports.projectMaskCoverage = _chunkS55JFWDAcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkOLNIPTB3cjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkS55JFWDAcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkS55JFWDAcjs.psdToLayers; exports.pullWarpMesh = _chunkQAUIZPYIcjs.pullWarpMesh; exports.put255 = _chunkPQ3H2AANcjs.put255; exports.quadFrameOverlay = quadFrameOverlay; exports.quickMaskPixels = quickMaskPixels; exports.quickSelectStroke = _chunkUC3PWFM3cjs.quickSelectStroke; exports.rand01 = _chunkPQ3H2AANcjs.rand01; exports.randSigned = _chunkPQ3H2AANcjs.randSigned; exports.rangeLightness = _chunkS55JFWDAcjs.rangeLightness; exports.rasterContents = _chunkS55JFWDAcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkS55JFWDAcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkS55JFWDAcjs.rasterizeCoverage; exports.rasterizeDab = _chunkPQ3H2AANcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkS55JFWDAcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkOLNIPTB3cjs.readDeepRegion; exports.readEdgeColor = _chunkS55JFWDAcjs.readEdgeColor; exports.readPaintSource = _chunkPQ3H2AANcjs.readPaintSource; exports.readPaths = readPaths; exports.readPixel = _chunk474IQG74cjs.readPixel; exports.readPsd = _chunkS55JFWDAcjs.readPsd; exports.readRegion = _chunk474IQG74cjs.readRegion; exports.readShapeComponents = _chunkS55JFWDAcjs.readShapeComponents; exports.readSourceRegion = _chunkYF3YZZ6Gcjs.readSourceRegion; exports.rectSelection = _chunkUC3PWFM3cjs.rectSelection; exports.rectToQuad = _chunkQT26RHKKcjs.rectToQuad; exports.reduceSurface = _chunkB46UQUDCcjs.reduceSurface; exports.referencePoint = _chunkS55JFWDAcjs.referencePoint; exports.refineCoverage = _chunkSS53NNZOcjs.refineCoverage; exports.refineEdgeHalo = _chunkSS53NNZOcjs.refineEdgeHalo; exports.refineSelection = _chunkSS53NNZOcjs.refineSelection; exports.reflectanceToRgb = _chunkOLNIPTB3cjs.reflectanceToRgb; exports.removeAlpha = _chunkS55JFWDAcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkS55JFWDAcjs.removeLayer; exports.removeLayerEffect = _chunkS55JFWDAcjs.removeLayerEffect; exports.removeLayerFilter = _chunkS55JFWDAcjs.removeLayerFilter; exports.removePaintGradientStop = _chunkPQ3H2AANcjs.removePaintGradientStop; exports.removeSmartFilter = _chunkS55JFWDAcjs.removeSmartFilter; exports.renderBrushstroke = _chunkPQ3H2AANcjs.renderBrushstroke; exports.renderLayerEffects = _chunkB46UQUDCcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkS55JFWDAcjs.renderShape; exports.renderShapeRect = _chunkS55JFWDAcjs.renderShapeRect; exports.renderSmartObject = _chunkS55JFWDAcjs.renderSmartObject; exports.renderText = _chunkS55JFWDAcjs.renderText; exports.replaceContents = _chunkS55JFWDAcjs.replaceContents; exports.replaceTextRange = _chunkS55JFWDAcjs.replaceTextRange; exports.requireLayer = _chunkS55JFWDAcjs.requireLayer; exports.requireOperation = _chunkS55JFWDAcjs.requireOperation; exports.requireShapeLayer = _chunkS55JFWDAcjs.requireShapeLayer; exports.requireSmartObject = _chunkS55JFWDAcjs.requireSmartObject; exports.requireTypeLayer = _chunkS55JFWDAcjs.requireTypeLayer; exports.requireUnlocked = _chunkS55JFWDAcjs.requireUnlocked; exports.rerender = _chunkS55JFWDAcjs.rerender; exports.rerenderShape = _chunkS55JFWDAcjs.rerenderShape; exports.rerenderText = _chunkS55JFWDAcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkSS53NNZOcjs.resizeSelection; exports.resizeWarpMesh = _chunkQAUIZPYIcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkS55JFWDAcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunkPQ3H2AANcjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.resolveVectorMasks = _chunkS55JFWDAcjs.resolveVectorMasks; exports.restyleRange = _chunkQAUIZPYIcjs.restyleRange; exports.retouchFilter = _chunkYF3YZZ6Gcjs.retouchFilter; exports.reversePaintGradient = _chunkPQ3H2AANcjs.reversePaintGradient; exports.rgbToGray = _chunkS55JFWDAcjs.rgbToGray; exports.rgbToHsl = _chunkS55JFWDAcjs.rgbToHsl; exports.rgbToReflectance = _chunkOLNIPTB3cjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunkYF3YZZ6Gcjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkS55JFWDAcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkS55JFWDAcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.runSelectionJob = _chunkUC3PWFM3cjs.runSelectionJob; exports.sameCanvasViewport = sameCanvasViewport; exports.sampleLut = _chunkS55JFWDAcjs.sampleLut; exports.sampleToneLut = _chunkS55JFWDAcjs.sampleToneLut; exports.saturationOf = _chunkYF3YZZ6Gcjs.saturationOf; exports.scaleLayerEffect = _chunkB46UQUDCcjs.scaleLayerEffect; exports.scalePaintGradient = _chunkPQ3H2AANcjs.scalePaintGradient; exports.seamlessClone = _chunkMQDIP4CFcjs.seamlessClone; exports.seedFromString = _chunkPQ3H2AANcjs.seedFromString; exports.segmentToSelection = segmentToSelection; exports.segmentationOutlines = segmentationOutlines; exports.segmentsToSelection = segmentsToSelection; exports.selectObjectIn = _chunkUC3PWFM3cjs.selectObjectIn; exports.selectSimilar = selectSimilar; exports.selectionArea = _chunkSS53NNZOcjs.selectionArea; exports.selectionFromCoverage = _chunkSS53NNZOcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkSS53NNZOcjs.selectionFromPixels; exports.selectionFromRegion = _chunkSS53NNZOcjs.selectionFromRegion; exports.selectionFromTiles = _chunkSS53NNZOcjs.selectionFromTiles; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionRing = selectionRing; exports.selectionToCoverage = _chunkSS53NNZOcjs.selectionToCoverage; exports.selectionToPixels = _chunkSS53NNZOcjs.selectionToPixels; exports.selectionToSubpaths = selectionToSubpaths; exports.selectionValueAt = _chunkSS53NNZOcjs.selectionValueAt; exports.serializeChannels = serializeChannels; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkS55JFWDAcjs.serializeContents; exports.serializeEffects = _chunkS55JFWDAcjs.serializeEffects; exports.serializeLayer = _chunkS55JFWDAcjs.serializeLayer; exports.serializeLayers = _chunkS55JFWDAcjs.serializeLayers; exports.serializeLayersExternal = _chunkS55JFWDAcjs.serializeLayersExternal; exports.serializeMask = _chunkUC3PWFM3cjs.serializeMask; exports.serializePaths = serializePaths; exports.serializePatterns = _chunkS55JFWDAcjs.serializePatterns; exports.serializeSelection = _chunkSS53NNZOcjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkS55JFWDAcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkS55JFWDAcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkS55JFWDAcjs.setLayerMask; exports.setLayerProperties = _chunkS55JFWDAcjs.setLayerProperties; exports.setLum = _chunkOLNIPTB3cjs.setLum; exports.setPigmentColor = _chunkOLNIPTB3cjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkS55JFWDAcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkS55JFWDAcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkS55JFWDAcjs.setSmartPlacement; exports.shadeTile = _chunkKWNMBMKGcjs.shadeTile; exports.shapeAsPixelLayer = _chunkS55JFWDAcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkS55JFWDAcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkS55JFWDAcjs.shapeGeometryBounds; exports.shapeLayers = _chunkS55JFWDAcjs.shapeLayers; exports.shapeOutline = _chunkS55JFWDAcjs.shapeOutline; exports.shapeRenderClip = _chunkS55JFWDAcjs.shapeRenderClip; exports.shiftCoverage = _chunkSS53NNZOcjs.shiftCoverage; exports.simplifyPixelPath = simplifyPixelPath; exports.skinToneRange = skinToneRange; exports.slicSuperpixels = _chunkUC3PWFM3cjs.slicSuperpixels; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkS55JFWDAcjs.smartObjectLayers; exports.smoothCoverage = _chunkSS53NNZOcjs.smoothCoverage; exports.smoothPoints = _chunkPQ3H2AANcjs.smoothPoints; exports.smoothnessWeights = _chunkUC3PWFM3cjs.smoothnessWeights; exports.smudgeEffect = _chunkYF3YZZ6Gcjs.smudgeEffect; exports.snapPolygonToEdges = snapPolygonToEdges; exports.snapTo45 = snapTo45; exports.snapToEdge = snapToEdge; exports.softMaskToSelection = _chunkUC3PWFM3cjs.softMaskToSelection; exports.solidPaint = _chunkPQ3H2AANcjs.solidPaint; exports.solidSurface = _chunk474IQG74cjs.solidSurface; exports.solveMembrane = _chunkMQDIP4CFcjs.solveMembrane; exports.spliceRuns = _chunkQAUIZPYIcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunkYF3YZZ6Gcjs.sponge; exports.spongeEffect = _chunkYF3YZZ6Gcjs.spongeEffect; exports.spotHealPixels = _chunkYF3YZZ6Gcjs.spotHealPixels; exports.spotHealWindow = _chunkYF3YZZ6Gcjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkKWNMBMKGcjs.srgbByteToLinear; exports.srgbDecode = _chunkOLNIPTB3cjs.srgbDecode; exports.srgbEncode = _chunkOLNIPTB3cjs.srgbEncode; exports.srgbToLinear = _chunkS55JFWDAcjs.srgbToLinear; exports.standardBlendMode = _chunkOLNIPTB3cjs.standardBlendMode; exports.startMarchingAnts = startMarchingAnts; exports.startSelectionWorker = _chunkUC3PWFM3cjs.startSelectionWorker; exports.stepSlotTs = _chunkKWNMBMKGcjs.stepSlotTs; exports.strokeGrainCatch = _chunkPQ3H2AANcjs.strokeGrainCatch; exports.styleAt = _chunkQAUIZPYIcjs.styleAt; exports.subpathsToSvgPath = subpathsToSvgPath; exports.sumHistograms = sumHistograms; exports.superpixelSaliency = _chunkUC3PWFM3cjs.superpixelSaliency; exports.surfaceBytes = _chunk474IQG74cjs.surfaceBytes; exports.surfaceDepth = _chunkOLNIPTB3cjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkOLNIPTB3cjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunk474IQG74cjs.surfaceFromPixels; exports.surfacesEqual = _chunk474IQG74cjs.surfacesEqual; exports.tempTintToXy = _chunkS55JFWDAcjs.tempTintToXy; exports.temperatureToKelvin = _chunkS55JFWDAcjs.temperatureToKelvin; exports.textIndexAt = _chunkQAUIZPYIcjs.textIndexAt; exports.textMatrix = _chunkS55JFWDAcjs.textMatrix; exports.textOrientation = _chunkS55JFWDAcjs.textOrientation; exports.textOutlines = _chunkS55JFWDAcjs.textOutlines; exports.textRange = _chunkS55JFWDAcjs.textRange; exports.tileCoord = _chunk474IQG74cjs.tileCoord; exports.tileKey = _chunk474IQG74cjs.tileKey; exports.tileRect = _chunk474IQG74cjs.tileRect; exports.tileSamples = _chunkOLNIPTB3cjs.tileSamples; exports.tileSamples16 = _chunkOLNIPTB3cjs.tileSamples16; exports.tileSamples32 = _chunkOLNIPTB3cjs.tileSamples32; exports.tilesInRect = _chunk474IQG74cjs.tilesInRect; exports.tipFalloff = _chunkPQ3H2AANcjs.tipFalloff; exports.tipReach = _chunkPQ3H2AANcjs.tipReach; exports.tipShape = _chunkPQ3H2AANcjs.tipShape; exports.to16From32 = _chunkOLNIPTB3cjs.to16From32; exports.to16From8 = _chunkOLNIPTB3cjs.to16From8; exports.to32From16 = _chunkOLNIPTB3cjs.to32From16; exports.to32From8 = _chunkOLNIPTB3cjs.to32From8; exports.to8From16 = _chunkOLNIPTB3cjs.to8From16; exports.to8From32 = _chunkOLNIPTB3cjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkS55JFWDAcjs.toTextSpace; exports.toneCurve = _chunkS55JFWDAcjs.toneCurve; exports.toneLuts = _chunkS55JFWDAcjs.toneLuts; exports.toneOf = _chunkYF3YZZ6Gcjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkS55JFWDAcjs.transformHomography; exports.transformMap = _chunkS55JFWDAcjs.transformMap; exports.transformShapeComponents = _chunkS55JFWDAcjs.transformShapeComponents; exports.transformSurface = _chunkB46UQUDCcjs.transformSurface; exports.transformTypeLayer = _chunkS55JFWDAcjs.transformTypeLayer; exports.transformVectorMask = _chunkS55JFWDAcjs.transformVectorMask; exports.transformedBounds = _chunkB46UQUDCcjs.transformedBounds; exports.transformedBox = _chunkS55JFWDAcjs.transformedBox; exports.transformedPoint = _chunkS55JFWDAcjs.transformedPoint; exports.translateLayer = _chunkS55JFWDAcjs.translateLayer; exports.translateSurface = _chunk474IQG74cjs.translateSurface; exports.typeAsPixelLayer = _chunkS55JFWDAcjs.typeAsPixelLayer; exports.typeFrame = _chunkS55JFWDAcjs.typeFrame; exports.typeFromAnnotation = _chunkS55JFWDAcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkS55JFWDAcjs.typeLayerName; exports.ungroupLayer = _chunkS55JFWDAcjs.ungroupLayer; exports.uniformTile = _chunk474IQG74cjs.uniformTile; exports.unionRect = _chunkS55JFWDAcjs.unionRect; exports.unprojectCanvasPoint = _chunkS55JFWDAcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkS55JFWDAcjs.updateLayerEffect; exports.updateLayerFilter = _chunkS55JFWDAcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkS55JFWDAcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunkPQ3H2AANcjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkS55JFWDAcjs.updateShapeLayer; exports.updateSmartFilter = _chunkS55JFWDAcjs.updateSmartFilter; exports.updateTypeLayer = _chunkS55JFWDAcjs.updateTypeLayer; exports.upscaleRegion = _chunkUC3PWFM3cjs.upscaleRegion; exports.userErrorMessage = _chunkS55JFWDAcjs.userErrorMessage; exports.uvToXy = _chunkS55JFWDAcjs.uvToXy; exports.validateEffectGradient = _chunkB46UQUDCcjs.validateEffectGradient; exports.validateLayerEffect = _chunkB46UQUDCcjs.validateLayerEffect; exports.validateLayerEffects = _chunkB46UQUDCcjs.validateLayerEffects; exports.vectorMaskBounds = _chunkS55JFWDAcjs.vectorMaskBounds; exports.vectorMaskCoverage = _chunkS55JFWDAcjs.vectorMaskCoverage; exports.vectorMaskThumbnail = _chunkS55JFWDAcjs.vectorMaskThumbnail; exports.vectorMaskThumbnailClick = vectorMaskThumbnailClick; exports.versionedDescriptorBytes = _chunkS55JFWDAcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkS55JFWDAcjs.vibranceLinear; exports.vibrancePixel = _chunkS55JFWDAcjs.vibrancePixel; exports.walkDabs = _chunkPQ3H2AANcjs.walkDabs; exports.warpMeshEditPoints = _chunkQAUIZPYIcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkQAUIZPYIcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkQAUIZPYIcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkQAUIZPYIcjs.warpPresetMesh; exports.warpSurface = _chunkB46UQUDCcjs.warpSurface; exports.watchCanvasViewport = watchCanvasViewport; exports.wbMatrix = _chunkS55JFWDAcjs.wbMatrix; exports.wetGpuSupport = _chunkKWNMBMKGcjs.wetGpuSupport; exports.wetSimdSupported = _chunkKWNMBMKGcjs.wetSimdSupported; exports.wetSupport = _chunkKWNMBMKGcjs.wetSupport; exports.whiteBalanceFromSample = _chunkS55JFWDAcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkS55JFWDAcjs.whiteBalanceMatrix; exports.withBackgroundOpacity = withBackgroundOpacity; exports.withFilterMaskSurface = _chunkS55JFWDAcjs.withFilterMaskSurface; exports.withImagePlayback = withImagePlayback; exports.withNewIds = _chunkS55JFWDAcjs.withNewIds; exports.workImage = _chunkUC3PWFM3cjs.workImage; exports.workLuma = _chunkUC3PWFM3cjs.workLuma; exports.workPlanes = _chunkUC3PWFM3cjs.workPlanes; exports.writeAdjustmentBlock = _chunkS55JFWDAcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkOLNIPTB3cjs.writeDeepRegion; exports.writeLfx2 = _chunkS55JFWDAcjs.writeLfx2; exports.writePatternBlock = _chunkS55JFWDAcjs.writePatternBlock; exports.writePsd = _chunkS55JFWDAcjs.writePsd; exports.writeRegion = _chunk474IQG74cjs.writeRegion; exports.xyToTempTint = _chunkS55JFWDAcjs.xyToTempTint; exports.xyToUv = _chunkS55JFWDAcjs.xyToUv;
23200
+
23201
+
23202
+
23203
+
23204
+ exports.ADJUSTMENT_KEYS = _chunkS55JFWDAcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkS55JFWDAcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkS55JFWDAcjs.ADJUSTMENT_LUT_SIZE; exports.ANCHOR_FRACTION = _chunkS55JFWDAcjs.ANCHOR_FRACTION; exports.AS_SHOT_KELVIN = _chunkS55JFWDAcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkS55JFWDAcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkS55JFWDAcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkOLNIPTB3cjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkOLNIPTB3cjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkS55JFWDAcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkKWNMBMKGcjs.BODY_SCATTER; exports.BRUSHSTROKE_MAX_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MAX_SCALE; exports.BRUSHSTROKE_MIN_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MIN_SCALE; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkBROJYMWUcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunkPQ3H2AANcjs.BrushstrokeCache; exports.CANVAS_SIZE_PRESETS = CANVAS_SIZE_PRESETS; exports.CLONE_TRANSFORM_CONTROLS = CLONE_TRANSFORM_CONTROLS; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.COLOR_RANGE_PRESETS = COLOR_RANGE_PRESETS; exports.COLOR_RANGE_PRESET_LABELS = COLOR_RANGE_PRESET_LABELS; exports.CONTENT_AWARE_FILL_SAMPLING = CONTENT_AWARE_FILL_SAMPLING; exports.CONTENT_AWARE_FILL_TOOLS = CONTENT_AWARE_FILL_TOOLS; exports.ColorGmm = _chunkUC3PWFM3cjs.ColorGmm; exports.ContentAwareFillSession = ContentAwareFillSession; exports.CoverageMap = _chunkPQ3H2AANcjs.CoverageMap; exports.D50 = _chunkS55JFWDAcjs.D50; exports.D65 = _chunkS55JFWDAcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkQAUIZPYIcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkPQ3H2AANcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkPQ3H2AANcjs.DEFAULT_BRUSH; exports.DEFAULT_CANVAS_VIEWPORT = DEFAULT_CANVAS_VIEWPORT; exports.DEFAULT_CHANNEL_COLOR = DEFAULT_CHANNEL_COLOR; exports.DEFAULT_CONTENT_AWARE_FILL_SETTINGS = DEFAULT_CONTENT_AWARE_FILL_SETTINGS; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkKWNMBMKGcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkB46UQUDCcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkS55JFWDAcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkPQ3H2AANcjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunkPQ3H2AANcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkPQ3H2AANcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = _chunkSS53NNZOcjs.DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunkYF3YZZ6Gcjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SELECT_AND_MASK_SETTINGS = DEFAULT_SELECT_AND_MASK_SETTINGS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkPQ3H2AANcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkQAUIZPYIcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkKWNMBMKGcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkKWNMBMKGcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkS55JFWDAcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkK6PXS6DOcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkKWNMBMKGcjs.DRY_EPS; exports.DabWalker = _chunkPQ3H2AANcjs.DabWalker; exports.EDGE_COLOR_RADIUS = _chunkS55JFWDAcjs.EDGE_COLOR_RADIUS; exports.EFFECT_LAYER_USES = EFFECT_LAYER_USES; exports.EMPTY_DISTANCE = _chunkSS53NNZOcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkPQ3H2AANcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkKWNMBMKGcjs.EX; exports.EY = _chunkKWNMBMKGcjs.EY; exports.EdgeMap = EdgeMap; exports.FLAG_ALIVE = _chunkKWNMBMKGcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkKWNMBMKGcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkKWNMBMKGcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkKWNMBMKGcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkKWNMBMKGcjs.FLAG_TOP; exports.FLAG_WET = _chunkKWNMBMKGcjs.FLAG_WET; exports.FLAT = _chunkKWNMBMKGcjs.FLAT; exports.FREE_INTERVAL = _chunkKWNMBMKGcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkS55JFWDAcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GAMMA = _chunkUC3PWFM3cjs.GAMMA; exports.GRAIN_PATTERNS = _chunkPQ3H2AANcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkPQ3H2AANcjs.GRAIN_TILE; exports.GUIDED_FILTER_EPS = _chunkSS53NNZOcjs.GUIDED_FILTER_EPS; exports.GridGraph = _chunkUC3PWFM3cjs.GridGraph; exports.HIDE = _chunkKWNMBMKGcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkS55JFWDAcjs.HUE_RANGE_LABELS; exports.HUE_RANGE_PRESETS = HUE_RANGE_PRESETS; exports.IDENTITY_CLONE_TRANSFORM = _chunkYF3YZZ6Gcjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunkS55JFWDAcjs.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.IMAGE_PLAYBACK_KIND = IMAGE_PLAYBACK_KIND; exports.IMAGE_TOOL_GROUPS = IMAGE_TOOL_GROUPS; exports.IMAGE_TOOL_SHORTCUTS = IMAGE_TOOL_SHORTCUTS; exports.INTENTS = _chunkBROJYMWUcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkB46UQUDCcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkS55JFWDAcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkS55JFWDAcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkB46UQUDCcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkS55JFWDAcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkS55JFWDAcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkS55JFWDAcjs.LUMA_709; exports.LayerCompositor = _chunkS55JFWDAcjs.LayerCompositor; exports.LayerEffectError = _chunkB46UQUDCcjs.LayerEffectError; exports.LayerOperationError = _chunkS55JFWDAcjs.LayerOperationError; exports.MARCHING_ANTS_STEP_MS = MARCHING_ANTS_STEP_MS; exports.MASK_EDGE_THRESHOLDS = MASK_EDGE_THRESHOLDS; exports.MASK_FILE_ACCEPT = MASK_FILE_ACCEPT; exports.MAX_BATCH = _chunkKWNMBMKGcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkPQ3H2AANcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_BACKING_SIDE = MAX_CANVAS_BACKING_SIDE; exports.MAX_EFFECT_ANIMATION_MS = _chunkS55JFWDAcjs.MAX_EFFECT_ANIMATION_MS; exports.MAX_EFFECT_REACH = _chunkB46UQUDCcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkS55JFWDAcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkKWNMBMKGcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkB46UQUDCcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkKWNMBMKGcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkKWNMBMKGcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkS55JFWDAcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkS55JFWDAcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkPQ3H2AANcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkPQ3H2AANcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkPQ3H2AANcjs.MIXING_MODELS; exports.MixerStroke = _chunkPQ3H2AANcjs.MixerStroke; exports.OPP = _chunkKWNMBMKGcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkOLNIPTB3cjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunkPQ3H2AANcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkPQ3H2AANcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkPQ3H2AANcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkKWNMBMKGcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkS55JFWDAcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkKWNMBMKGcjs.PARAM; exports.PARAM_FLOATS = _chunkKWNMBMKGcjs.PARAM_FLOATS; exports.PASTE_MODES = PASTE_MODES; exports.PATH_EDIT_TOOLS = PATH_EDIT_TOOLS; exports.PATTERN_BLOCK_KEYS = _chunkS55JFWDAcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkOLNIPTB3cjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkKWNMBMKGcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkOLNIPTB3cjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkOLNIPTB3cjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkKWNMBMKGcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkOLNIPTB3cjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkKWNMBMKGcjs.PLANE; exports.PLANE_BYTES = _chunkKWNMBMKGcjs.PLANE_BYTES; exports.PREVIEW_SIZE = PREVIEW_SIZE; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkS55JFWDAcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkKWNMBMKGcjs.P_D0; exports.P_EDGE = _chunkKWNMBMKGcjs.P_EDGE; exports.P_FX = _chunkKWNMBMKGcjs.P_FX; exports.P_FY = _chunkKWNMBMKGcjs.P_FY; exports.P_H = _chunkKWNMBMKGcjs.P_H; exports.P_P0 = _chunkKWNMBMKGcjs.P_P0; exports.P_RHO = _chunkKWNMBMKGcjs.P_RHO; exports.P_SW = _chunkKWNMBMKGcjs.P_SW; exports.P_UX = _chunkKWNMBMKGcjs.P_UX; exports.P_UY = _chunkKWNMBMKGcjs.P_UY; exports.PaintExchange = _chunkPQ3H2AANcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkPQ3H2AANcjs.PaintGradientSampler; exports.PaintSourceError = _chunkPQ3H2AANcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = _chunkPQ3H2AANcjs.PaperGrain; exports.PathEditGesture = PathEditGesture; exports.PatternPlacement = _chunkB46UQUDCcjs.PatternPlacement; exports.PatternTile = _chunkB46UQUDCcjs.PatternTile; exports.PsdError = _chunkS55JFWDAcjs.PsdError; exports.QUICK_MASK_TARGET = QUICK_MASK_TARGET; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.REFINE_EDIT_KINDS = _chunkUC3PWFM3cjs.REFINE_EDIT_KINDS; exports.REFINE_OUTPUTS = REFINE_OUTPUTS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunkYF3YZZ6Gcjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunkYF3YZZ6Gcjs.RegionPixelSource; exports.RetouchDabStroke = _chunkYF3YZZ6Gcjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkSS53NNZOcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkSS53NNZOcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SELECT_AND_MASK_TOOLS = SELECT_AND_MASK_TOOLS; exports.SELECT_AND_MASK_VIEWS = SELECT_AND_MASK_VIEWS; exports.SET_PLANES = _chunkKWNMBMKGcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkOLNIPTB3cjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkS55JFWDAcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkS55JFWDAcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkKWNMBMKGcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkKWNMBMKGcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkKWNMBMKGcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkS55JFWDAcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunkYF3YZZ6Gcjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkKWNMBMKGcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkKWNMBMKGcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkS55JFWDAcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectAndMaskSession = SelectAndMaskSession; exports.SelectionGesture = SelectionGesture; exports.SelectionWorkerClient = _chunkUC3PWFM3cjs.SelectionWorkerClient; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkPQ3H2AANcjs.SmudgeTip; exports.StrokeCoverage = _chunkPQ3H2AANcjs.StrokeCoverage; exports.SurfaceDraft = _chunk474IQG74cjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkS55JFWDAcjs.TEXT_ALIGNS; exports.TEXT_ORIENTATIONS = _chunkS55JFWDAcjs.TEXT_ORIENTATIONS; exports.TEXT_RENDER_MARGIN = _chunkS55JFWDAcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkS55JFWDAcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunk474IQG74cjs.TILE; exports.TILE_SHIFT = _chunk474IQG74cjs.TILE_SHIFT; exports.TINT_SCALE = _chunkS55JFWDAcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunkPQ3H2AANcjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkS55JFWDAcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunkYF3YZZ6Gcjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkS55JFWDAcjs.TRANSFORM_ANCHORS; exports.TRANSFORM_ROTATE_HANDLE_OFFSET = TRANSFORM_ROTATE_HANDLE_OFFSET; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkPQ3H2AANcjs.TileMedium; exports.TilePixelSource = _chunkYF3YZZ6Gcjs.TilePixelSource; exports.TileableNoise = _chunkPQ3H2AANcjs.TileableNoise; exports.TiledSurface = _chunk474IQG74cjs.TiledSurface; exports.TransformTooLargeError = _chunkB46UQUDCcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunkYF3YZZ6Gcjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.UNITS = _chunkUC3PWFM3cjs.UNITS; exports.U_MAX = _chunkKWNMBMKGcjs.U_MAX; exports.VIBRANCE_GREY = _chunkS55JFWDAcjs.VIBRANCE_GREY; exports.W9 = _chunkKWNMBMKGcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkQAUIZPYIcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkQAUIZPYIcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkKWNMBMKGcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkKWNMBMKGcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkKWNMBMKGcjs.WET_TILE; exports.WGSL_HALO = _chunkKWNMBMKGcjs.WGSL_HALO; exports.WGSL_SHADE = _chunkKWNMBMKGcjs.WGSL_SHADE; exports.WGSL_STEP = _chunkKWNMBMKGcjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WORK_PATH_NAME = WORK_PATH_NAME; exports.WORK_SIZE = _chunkUC3PWFM3cjs.WORK_SIZE; exports.WetGpuEngine = _chunkKWNMBMKGcjs.WetGpuEngine; exports.WetMedium = _chunkKWNMBMKGcjs.WetMedium; exports.WetWorkerPool = _chunkKWNMBMKGcjs.WetWorkerPool; exports.WetWorld = _chunkKWNMBMKGcjs.WetWorld; exports.WetWorldError = _chunkKWNMBMKGcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkS55JFWDAcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkXFM3OCHUcjs.ZlibError; exports.activeAdjustmentLayers = _chunkS55JFWDAcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkS55JFWDAcjs.activeEffectSmartFilters; exports.activeLayerAfterRemoval = _chunkS55JFWDAcjs.activeLayerAfterRemoval; exports.activeSmartFilters = _chunkS55JFWDAcjs.activeSmartFilters; exports.addLayerEffect = _chunkS55JFWDAcjs.addLayerEffect; exports.addLayerFilter = _chunkS55JFWDAcjs.addLayerFilter; exports.addLayerOfKind = addLayerOfKind; exports.addPaintGradientStop = _chunkPQ3H2AANcjs.addPaintGradientStop; exports.addSmartFilter = _chunkS55JFWDAcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkS55JFWDAcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkS55JFWDAcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkS55JFWDAcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkS55JFWDAcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunkXFM3OCHUcjs.adler32; exports.agentDragDraft = agentDragDraft; exports.anchorPoint = _chunkS55JFWDAcjs.anchorPoint; exports.annotationBlend = _chunkS55JFWDAcjs.annotationBlend; exports.annotationLayerFor = _chunkS55JFWDAcjs.annotationLayerFor; exports.annotationLayerName = _chunkS55JFWDAcjs.annotationLayerName; exports.annotationOfLayer = _chunkS55JFWDAcjs.annotationOfLayer; exports.annotationOfShape = _chunkS55JFWDAcjs.annotationOfShape; exports.annotationOfType = _chunkS55JFWDAcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkS55JFWDAcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkS55JFWDAcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkS55JFWDAcjs.applyAdjustments; exports.applyBoxBlur = _chunkS55JFWDAcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkS55JFWDAcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkS55JFWDAcjs.applyDepthMask; exports.applyEdgeUnmix = _chunkS55JFWDAcjs.applyEdgeUnmix; exports.applyHomography = _chunkQT26RHKKcjs.applyHomography; exports.applyImageProjectionToContext = _chunkS55JFWDAcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkS55JFWDAcjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkS55JFWDAcjs.applyLegacyFloat; exports.applyMatrix3 = _chunkS55JFWDAcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkS55JFWDAcjs.applyParams; exports.applyProcess2Adjustments = _chunkS55JFWDAcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkS55JFWDAcjs.applyProcess2Float; exports.applyRefineEdits = _chunkUC3PWFM3cjs.applyRefineEdits; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunkYF3YZZ6Gcjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkS55JFWDAcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkPQ3H2AANcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkPQ3H2AANcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunkYF3YZZ6Gcjs.applyToneToDeepTile; exports.backgroundLayer = _chunkS55JFWDAcjs.backgroundLayer; exports.base64ToBytes = _chunkOLNIPTB3cjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunkMQDIP4CFcjs.bestOffset; exports.blackWhiteGray = _chunkS55JFWDAcjs.blackWhiteGray; exports.blendChannel = _chunkOLNIPTB3cjs.blendChannel; exports.blendImageData = _chunkOLNIPTB3cjs.blendImageData; exports.blendLum = _chunkOLNIPTB3cjs.blendLum; exports.blendPixel = _chunkOLNIPTB3cjs.blendPixel; exports.blendRadius = _chunkPQ3H2AANcjs.blendRadius; exports.blendRgb = _chunkOLNIPTB3cjs.blendRgb; exports.blendTile = _chunkB46UQUDCcjs.blendTile; exports.blenderDab = _chunkPQ3H2AANcjs.blenderDab; exports.blurFilter = _chunkS55JFWDAcjs.blurFilter; exports.borderCoverage = _chunkSS53NNZOcjs.borderCoverage; exports.boxBlur = _chunkUC3PWFM3cjs.boxBlur; exports.boxBlurPixels = _chunkYF3YZZ6Gcjs.boxBlurPixels; exports.boxFrameHit = boxFrameHit; exports.boxFrameOverlay = boxFrameOverlay; exports.boxMean = _chunkSS53NNZOcjs.boxMean; exports.boxPointOf = _chunkS55JFWDAcjs.boxPointOf; exports.boxQuad = _chunkQT26RHKKcjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkS55JFWDAcjs.bradfordAdaptation; exports.brushStrokeMask = _chunkUC3PWFM3cjs.brushStrokeMask; exports.brushstrokeDataUrl = _chunkPQ3H2AANcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkPQ3H2AANcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkPQ3H2AANcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkYQGCPL5Xcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkPQ3H2AANcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkPQ3H2AANcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkS55JFWDAcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkS55JFWDAcjs.buildToneLut; exports.builtinPattern = _chunkB46UQUDCcjs.builtinPattern; exports.builtinPatternIds = _chunkB46UQUDCcjs.builtinPatternIds; exports.bytesToBase64 = _chunkOLNIPTB3cjs.bytesToBase64; exports.calculateCropDrag = _chunkS55JFWDAcjs.calculateCropDrag; exports.canShareMemory = _chunkKWNMBMKGcjs.canShareMemory; exports.canvasCompositeOperation = _chunkOLNIPTB3cjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkS55JFWDAcjs.canvasToImagePoint; exports.caretAt = _chunkQAUIZPYIcjs.caretAt; exports.changedTiles = _chunkB46UQUDCcjs.changedTiles; exports.channelThumbnail = channelThumbnail; exports.checkEffectAnimation = checkEffectAnimation; exports.checkEffectTime = checkEffectTime; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkS55JFWDAcjs.clampCropToImage; exports.cleanMixer = _chunkPQ3H2AANcjs.cleanMixer; exports.cloneSamplePoint = _chunkYF3YZZ6Gcjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunk474IQG74cjs.collectTiles; exports.colorBalanceChannel = _chunkS55JFWDAcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.colorRangePreset = colorRangePreset; exports.combineSelections = _chunkSS53NNZOcjs.combineSelections; exports.compareSelectionMasks = compareSelectionMasks; exports.compileAdjustmentLayer = _chunkS55JFWDAcjs.compileAdjustmentLayer; exports.componentPath = _chunkS55JFWDAcjs.componentPath; exports.componentsCoverage = _chunkS55JFWDAcjs.componentsCoverage; exports.compositeDeep = _chunkS55JFWDAcjs.compositeDeep; exports.compositeSurfaceOver = _chunkB46UQUDCcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkSS53NNZOcjs.computeSelectionBounds; exports.contentAwareFill = _chunkMQDIP4CFcjs.contentAwareFill; exports.contentBounds = _chunk474IQG74cjs.contentBounds; exports.contentsBox = _chunkS55JFWDAcjs.contentsBox; exports.contentsSurface = _chunkS55JFWDAcjs.contentsSurface; exports.contractCoverage = _chunkSS53NNZOcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkOLNIPTB3cjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkS55JFWDAcjs.convertToSmartObject; exports.copySmartObject = _chunkS55JFWDAcjs.copySmartObject; exports.cornersFromMatrix = _chunkS55JFWDAcjs.cornersFromMatrix; exports.coverageTileCoord = _chunkPQ3H2AANcjs.coverageTileCoord; exports.coverageToByte = _chunkSS53NNZOcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkS55JFWDAcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkPQ3H2AANcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkQAUIZPYIcjs.createCanvasTextShaper; exports.createGradientSampler = createGradientSampler; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; exports.createImageEditorDocument = createImageEditorDocument; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageEffectsToolProvider = createImageEffectsToolProvider; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePlaybackLocator = createImagePlaybackLocator; exports.createImagePsdTools = createImagePsdTools; exports.createImageRetouchTools = createImageRetouchTools; exports.createImageSegmentationToolProvider = createImageSegmentationToolProvider; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageSubjectSelectionTool = createImageSubjectSelectionTool; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkQAUIZPYIcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkQAUIZPYIcjs.createOutlineTextShaper; exports.createPigment = _chunkOLNIPTB3cjs.createPigment; exports.createPigmentTools = _chunkKWNMBMKGcjs.createPigmentTools; exports.createSelectionMask = _chunkSS53NNZOcjs.createSelectionMask; exports.createShapeLayer = _chunkS55JFWDAcjs.createShapeLayer; exports.createTypeLayer = _chunkS55JFWDAcjs.createTypeLayer; exports.createWetGpuEngine = _chunkKWNMBMKGcjs.createWetGpuEngine; exports.cssFont = _chunkQAUIZPYIcjs.cssFont; exports.cssFontFamily = _chunkQAUIZPYIcjs.cssFontFamily; exports.curveLut = _chunkB46UQUDCcjs.curveLut; exports.curveLutFromLevels = _chunkS55JFWDAcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkPQ3H2AANcjs.dabCoverage; exports.dabRect = _chunkPQ3H2AANcjs.dabRect; exports.decodeDeepSurface = _chunkS55JFWDAcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkS55JFWDAcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkS55JFWDAcjs.decodeLayerMask; exports.decodeMergedImage = _chunkS55JFWDAcjs.decodeMergedImage; exports.decodePlanes = _chunkS55JFWDAcjs.decodePlanes; exports.decodePng = _chunkOLNIPTB3cjs.decodePng; exports.decodePngDataUrl = _chunkS55JFWDAcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkSS53NNZOcjs.decodeSelectionRle; exports.decontaminateColors = _chunkSS53NNZOcjs.decontaminateColors; exports.deepBytes = _chunkOLNIPTB3cjs.deepBytes; exports.deepTile = _chunkOLNIPTB3cjs.deepTile; exports.defaultActiveLayerId = _chunkS55JFWDAcjs.defaultActiveLayerId; exports.defaultAdjustmentParams = _chunkS55JFWDAcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkB46UQUDCcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkB46UQUDCcjs.defaultLayerEffect; exports.defaultShapeName = _chunkS55JFWDAcjs.defaultShapeName; exports.deflate = _chunkXFM3OCHUcjs.deflate; exports.deflateRaw = _chunkXFM3OCHUcjs.deflateRaw; exports.depthMaskAlpha = _chunkS55JFWDAcjs.depthMaskAlpha; exports.depthOf = _chunkOLNIPTB3cjs.depthOf; exports.depthRasterMask = _chunkS55JFWDAcjs.depthRasterMask; exports.describeChannel = describeChannel; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkS55JFWDAcjs.describeTransform; exports.deserializeChannels = deserializeChannels; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkS55JFWDAcjs.deserializeEffects; exports.deserializeLayer = _chunkS55JFWDAcjs.deserializeLayer; exports.deserializeLayers = _chunkS55JFWDAcjs.deserializeLayers; exports.deserializeMask = _chunkUC3PWFM3cjs.deserializeMask; exports.deserializePatterns = _chunkS55JFWDAcjs.deserializePatterns; exports.deserializeSelection = _chunkSS53NNZOcjs.deserializeSelection; exports.despillEdge = _chunkS55JFWDAcjs.despillEdge; exports.developFilter = _chunkS55JFWDAcjs.developFilter; exports.developFromAdjustments = _chunkS55JFWDAcjs.developFromAdjustments; exports.developTarget = _chunkS55JFWDAcjs.developTarget; exports.dexp = _chunkKWNMBMKGcjs.dexp; exports.dilateMask = _chunkMQDIP4CFcjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkSS53NNZOcjs.distanceTransform; exports.dlog = _chunkKWNMBMKGcjs.dlog; exports.documentContents = _chunkS55JFWDAcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunkYF3YZZ6Gcjs.dodgeBurn; exports.dodgeBurnCurve = _chunkYF3YZZ6Gcjs.dodgeBurnCurve; exports.downloadMaskImage = downloadMaskImage; exports.downloadPsd = downloadPsd; exports.dpow = _chunkKWNMBMKGcjs.dpow; exports.dragWarpMeshPoint = _chunkQAUIZPYIcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkKWNMBMKGcjs.dsincos; exports.duplicateLayer = _chunkS55JFWDAcjs.duplicateLayer; exports.edgeBits = _chunkKWNMBMKGcjs.edgeBits; exports.edgeWidth = _chunkSS53NNZOcjs.edgeWidth; exports.effectColorHex = _chunkB46UQUDCcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectLayerTiming = effectLayerTiming; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkB46UQUDCcjs.effectReach; exports.effectiveLayerMask = _chunkS55JFWDAcjs.effectiveLayerMask; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkB46UQUDCcjs.effectsFingerprint; exports.effectsMargin = _chunkB46UQUDCcjs.effectsMargin; exports.effectsScale = _chunkB46UQUDCcjs.effectsScale; exports.ellipsePoints = _chunkUC3PWFM3cjs.ellipsePoints; exports.ellipseSelection = _chunkUC3PWFM3cjs.ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunk474IQG74cjs.emptySurface; exports.encodeDeepSurface = _chunkS55JFWDAcjs.encodeDeepSurface; exports.encodePng = _chunkOLNIPTB3cjs.encodePng; exports.encodeRle = _chunkS55JFWDAcjs.encodeRle; exports.encodeSelectionRle = _chunkSS53NNZOcjs.encodeSelectionRle; exports.encodeSurface = _chunkS55JFWDAcjs.encodeSurface; exports.evalWarpMesh = _chunkQAUIZPYIcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkS55JFWDAcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkPQ3H2AANcjs.exchangeRates; exports.expNeg = _chunkKWNMBMKGcjs.expNeg; exports.expandCoverage = _chunkSS53NNZOcjs.expandCoverage; exports.exportPsd = _chunkS55JFWDAcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkSS53NNZOcjs.featherCoverage; exports.fillRect = _chunk474IQG74cjs.fillRect; exports.filmPixel = _chunkKWNMBMKGcjs.filmPixel; exports.filmReflectance = _chunkKWNMBMKGcjs.filmReflectance; exports.filterMaskCoverage = _chunkS55JFWDAcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkB46UQUDCcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findSky = _chunkUC3PWFM3cjs.findSky; exports.findSubject = _chunkUC3PWFM3cjs.findSubject; exports.findWebGpu = _chunkKWNMBMKGcjs.findWebGpu; exports.finishTile = _chunk474IQG74cjs.finishTile; exports.fitParagraphRuns = _chunkQAUIZPYIcjs.fitParagraphRuns; exports.fitRuns = _chunkQAUIZPYIcjs.fitRuns; exports.flattenLayers = _chunkB46UQUDCcjs.flattenLayers; exports.flattenPath = _chunkS55JFWDAcjs.flattenPath; exports.flipCorners = _chunkS55JFWDAcjs.flipCorners; exports.flowField = _chunkKWNMBMKGcjs.flowField; exports.focusArea = _chunkUC3PWFM3cjs.focusArea; exports.followLayerMove = _chunkS55JFWDAcjs.followLayerMove; exports.fontOf = _chunkQAUIZPYIcjs.fontOf; exports.forgetSelectAndMaskSettings = forgetSelectAndMaskSettings; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkSS53NNZOcjs.fullSelection; exports.gaussianBlur = _chunkK6PXS6DOcjs.gaussianBlur; exports.geometryHomography = _chunkS55JFWDAcjs.geometryHomography; exports.getAnnotationBounds = _chunkS55JFWDAcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkS55JFWDAcjs.getCropCursor; exports.getRotatedSize = _chunkS55JFWDAcjs.getRotatedSize; exports.getViewportMetrics = _chunkS55JFWDAcjs.getViewportMetrics; exports.getViewportProjection = _chunkS55JFWDAcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.grabCutLabels = _chunkUC3PWFM3cjs.grabCutLabels; exports.gradientDabColor = _chunkPQ3H2AANcjs.gradientDabColor; exports.grainCatch = _chunkPQ3H2AANcjs.grainCatch; exports.grainHeights = _chunkPQ3H2AANcjs.grainHeights; exports.greyMorphology = _chunkSS53NNZOcjs.greyMorphology; exports.groupLayers = _chunkS55JFWDAcjs.groupLayers; exports.growSelection = growSelection; exports.guidePlanes = _chunkSS53NNZOcjs.guidePlanes; exports.guidedFilterColor = _chunkSS53NNZOcjs.guidedFilterColor; exports.handleMaskViewKey = handleMaskViewKey; exports.handlePaintShortcut = handlePaintShortcut; exports.handleQuickMaskKey = handleQuickMaskKey; exports.handleSelectionShortcut = handleSelectionShortcut; exports.hasActiveEffects = _chunkB46UQUDCcjs.hasActiveEffects; exports.hasEdgeUnmix = _chunkS55JFWDAcjs.hasEdgeUnmix; exports.hasLayersBelow = hasLayersBelow; exports.hasResampledLegacyMask = _chunkS55JFWDAcjs.hasResampledLegacyMask; exports.hasSoftBand = _chunkS55JFWDAcjs.hasSoftBand; exports.hasSurface = _chunkS55JFWDAcjs.hasSurface; exports.hasWarp = _chunkS55JFWDAcjs.hasWarp; exports.hash2 = _chunkPQ3H2AANcjs.hash2; exports.hashMaskContent = _chunkSS53NNZOcjs.hashMaskContent; exports.hashNoise = _chunkB46UQUDCcjs.hashNoise; exports.healPixels = _chunkYF3YZZ6Gcjs.healPixels; exports.hexToPaintRgb = _chunkPQ3H2AANcjs.hexToPaintRgb; exports.hexToRgb = _chunkS55JFWDAcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkS55JFWDAcjs.hitTestAnnotation; exports.hitTestCrop = _chunkS55JFWDAcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkQT26RHKKcjs.homographyFromAffine; exports.homographyFromPoints = _chunkQT26RHKKcjs.homographyFromPoints; exports.hslToRgb = _chunkS55JFWDAcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkS55JFWDAcjs.hueRangeTables; exports.hueRangeWeight = _chunkS55JFWDAcjs.hueRangeWeight; exports.hueSaturation = _chunkS55JFWDAcjs.hueSaturation; exports.identityCurve = _chunkS55JFWDAcjs.identityCurve; exports.identityLevels = _chunkS55JFWDAcjs.identityLevels; exports.identityTransform = _chunkS55JFWDAcjs.identityTransform; exports.identityWarpMesh = _chunkQAUIZPYIcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imagePanelTool = imagePanelTool; exports.imagePlaybackPanel = imagePlaybackPanel; exports.imageToCanvasPoint = _chunkS55JFWDAcjs.imageToCanvasPoint; exports.imageToolCanvasMode = imageToolCanvasMode; exports.imageToolForShortcut = imageToolForShortcut; exports.imageToolGroup = imageToolGroup; exports.imageToolLabel = imageToolLabel; exports.imageToolPanel = imageToolPanel; exports.importPsd = _chunkS55JFWDAcjs.importPsd; exports.inflate = _chunkXFM3OCHUcjs.inflate; exports.inflateRaw = _chunkXFM3OCHUcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkB46UQUDCcjs.insertLayer; exports.inspectMaskEdge = inspectMaskEdge; exports.instancesOf = _chunkS55JFWDAcjs.instancesOf; exports.invertHomography = _chunkQT26RHKKcjs.invertHomography; exports.invertMatrix3 = _chunkS55JFWDAcjs.invertMatrix3; exports.invertSelection = _chunkSS53NNZOcjs.invertSelection; exports.isActiveFilter = _chunkS55JFWDAcjs.isActiveFilter; exports.isActiveVectorMask = _chunkS55JFWDAcjs.isActiveVectorMask; exports.isAdjustmentKind = _chunkS55JFWDAcjs.isAdjustmentKind; exports.isBitDepth = _chunkOLNIPTB3cjs.isBitDepth; exports.isBlendMode = _chunkOLNIPTB3cjs.isBlendMode; exports.isBrushstrokeBrush = _chunkPQ3H2AANcjs.isBrushstrokeBrush; exports.isColorRangePreset = isColorRangePreset; exports.isContentsDecoded = _chunkS55JFWDAcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkS55JFWDAcjs.isDefaultDepthMask; exports.isGradientPaint = _chunkPQ3H2AANcjs.isGradientPaint; exports.isIdentityCloneTransform = _chunkYF3YZZ6Gcjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunkS55JFWDAcjs.isIdentityTransform; exports.isInterpolation = _chunkB46UQUDCcjs.isInterpolation; exports.isLayerEffectKind = _chunkB46UQUDCcjs.isLayerEffectKind; exports.isLayerLocked = _chunkB46UQUDCcjs.isLayerLocked; exports.isLegacyShape = _chunkS55JFWDAcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPaintableLayer = _chunkS55JFWDAcjs.isPaintableLayer; exports.isPainterlyBlendMode = _chunkOLNIPTB3cjs.isPainterlyBlendMode; exports.isPathEditTool = isPathEditTool; exports.isPng = _chunkOLNIPTB3cjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkS55JFWDAcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkS55JFWDAcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkSS53NNZOcjs.isSelectionEmpty; exports.isSelectionMode = _chunkSS53NNZOcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkOLNIPTB3cjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkS55JFWDAcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkS55JFWDAcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkS55JFWDAcjs.isTransformAnchor; exports.isValidWarp = _chunkS55JFWDAcjs.isValidWarp; exports.keepDeepSamples = _chunkOLNIPTB3cjs.keepDeepSamples; exports.keepMainPieces = _chunkUC3PWFM3cjs.keepMainPieces; exports.kelvinToTemperature = _chunkS55JFWDAcjs.kelvinToTemperature; exports.keysWeight = _chunkB46UQUDCcjs.keysWeight; exports.latticeViscosity = _chunkKWNMBMKGcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkB46UQUDCcjs.layerEffectFields; exports.layerEffectLabel = _chunkB46UQUDCcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkS55JFWDAcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkS55JFWDAcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkS55JFWDAcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkS55JFWDAcjs.layerMaskKey; exports.layerMaskSelection = _chunkS55JFWDAcjs.layerMaskSelection; exports.layerMenu = layerMenu; exports.layerName = _chunkS55JFWDAcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerPanels = layerPanels; exports.layerThumbnailClick = layerThumbnailClick; exports.layerTree = _chunkS55JFWDAcjs.layerTree; exports.layerTypeLabel = _chunkS55JFWDAcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkS55JFWDAcjs.layersFromLegacy; exports.layoutText = _chunkQAUIZPYIcjs.layoutText; exports.legacyAdjustmentLayer = _chunkS55JFWDAcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkS55JFWDAcjs.legacyMaskOf; exports.legacyView = _chunkS55JFWDAcjs.legacyView; exports.lerpPigment = _chunkOLNIPTB3cjs.lerpPigment; exports.lerpPigmentInto = _chunkOLNIPTB3cjs.lerpPigmentInto; exports.levelsValue = _chunkS55JFWDAcjs.levelsValue; exports.linearSrgbToXy = _chunkS55JFWDAcjs.linearSrgbToXy; exports.linearToSrgb = _chunkS55JFWDAcjs.linearToSrgb; exports.linearToSrgb8 = _chunkKWNMBMKGcjs.linearToSrgb8; exports.liveComponent = _chunkS55JFWDAcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkS55JFWDAcjs.liveShapeSubpaths; exports.liveWire = liveWire; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkPQ3H2AANcjs.loadMixer; exports.loadOpenTypeFont = _chunkLCCMOWR7cjs.loadOpenTypeFont; exports.loadWetKernel = _chunkKWNMBMKGcjs.loadWetKernel; exports.luma = _chunkYF3YZZ6Gcjs.luma; exports.magicWand = magicWand; exports.magneticAnchorSpacing = magneticAnchorSpacing; exports.mapCropHandle = _chunkS55JFWDAcjs.mapCropHandle; exports.mapLayer = _chunkB46UQUDCcjs.mapLayer; exports.mapSubpaths = _chunkS55JFWDAcjs.mapSubpaths; exports.maskBounds = _chunkMQDIP4CFcjs.maskBounds; exports.maskCoverageOverCanvas = _chunkS55JFWDAcjs.maskCoverageOverCanvas; exports.maskFileName = maskFileName; exports.maskNameFromFile = maskNameFromFile; exports.maskSummary = maskSummary; exports.maskThumbnailClick = maskThumbnailClick; exports.matrixFromCorners = _chunkS55JFWDAcjs.matrixFromCorners; exports.matrixFromParams = _chunkS55JFWDAcjs.matrixFromParams; exports.measureCanvasViewport = measureCanvasViewport; exports.membraneFill = _chunkMQDIP4CFcjs.membraneFill; exports.mergeLayerEffect = _chunkB46UQUDCcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkS55JFWDAcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunkPQ3H2AANcjs.mix32; exports.mixPigment8 = _chunkOLNIPTB3cjs.mixPigment8; exports.mixPigmentRgb = _chunkOLNIPTB3cjs.mixPigmentRgb; exports.mixPigments = _chunkOLNIPTB3cjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkPQ3H2AANcjs.mixerRates; exports.modifySelection = _chunkSS53NNZOcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkS55JFWDAcjs.moveLayer; exports.moveSmartFilter = _chunkS55JFWDAcjs.moveSmartFilter; exports.mulMatrix3 = _chunkS55JFWDAcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkS55JFWDAcjs.neutralHueRange; exports.newContentsId = _chunkS55JFWDAcjs.newContentsId; exports.newEffectId = _chunkB46UQUDCcjs.newEffectId; exports.newLayerId = _chunkS55JFWDAcjs.newLayerId; exports.newLayerOptions = newLayerOptions; exports.newPathId = newPathId; exports.normalizeAdjustmentLayer = _chunkS55JFWDAcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkS55JFWDAcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkS55JFWDAcjs.normalizeAngle; exports.normalizeBlendMode = _chunkOLNIPTB3cjs.normalizeBlendMode; exports.normalizeBlender = _chunkPQ3H2AANcjs.normalizeBlender; exports.normalizeBrush = _chunkPQ3H2AANcjs.normalizeBrush; exports.normalizeFilter = _chunkS55JFWDAcjs.normalizeFilter; exports.normalizeFlow = _chunkKWNMBMKGcjs.normalizeFlow; exports.normalizeHexColor = _chunkPQ3H2AANcjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkB46UQUDCcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkS55JFWDAcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkS55JFWDAcjs.normalizeLiveShape; exports.normalizeMixer = _chunkPQ3H2AANcjs.normalizeMixer; exports.normalizePlacement = _chunkS55JFWDAcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkS55JFWDAcjs.normalizeProcessVersion; exports.normalizeRect = _chunkUC3PWFM3cjs.normalizeRect; exports.normalizeRefineEdgeParams = _chunkSS53NNZOcjs.normalizeRefineEdgeParams; exports.normalizeRetouch = _chunkYF3YZZ6Gcjs.normalizeRetouch; exports.normalizeShapePaint = _chunkS55JFWDAcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkS55JFWDAcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkS55JFWDAcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkPQ3H2AANcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkS55JFWDAcjs.normalizeSubpaths; exports.normalizeText = _chunkS55JFWDAcjs.normalizeText; exports.normalizeTilt = _chunkKWNMBMKGcjs.normalizeTilt; exports.normalizeWetParams = _chunkKWNMBMKGcjs.normalizeWetParams; exports.offsetLayer = _chunkS55JFWDAcjs.offsetLayer; exports.offsetShape = _chunkS55JFWDAcjs.offsetShape; exports.offsetSmartObject = _chunkS55JFWDAcjs.offsetSmartObject; exports.offsetVectorMask = _chunkS55JFWDAcjs.offsetVectorMask; exports.openMaskFile = openMaskFile; exports.openPsdFile = openPsdFile; exports.otsuThreshold = _chunkUC3PWFM3cjs.otsuThreshold; exports.packRgba = _chunk474IQG74cjs.packRgba; exports.packWetParams = _chunkKWNMBMKGcjs.packWetParams; exports.paintGradientMappingFor = _chunkPQ3H2AANcjs.paintGradientMappingFor; exports.paintPathStroke = _chunkPQ3H2AANcjs.paintPathStroke; exports.paintSourceColor = _chunkPQ3H2AANcjs.paintSourceColor; exports.paintSourceCss = _chunkPQ3H2AANcjs.paintSourceCss; exports.paragraphRanges = _chunkQAUIZPYIcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkS55JFWDAcjs.parseAdjustmentBlock; exports.parseBlend = _chunkS55JFWDAcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkA2IS7EHEcjs.parseCssColor; exports.parseDataUrl = _chunkOLNIPTB3cjs.parseDataUrl; exports.parseEffectColor = _chunkB46UQUDCcjs.parseEffectColor; exports.parseLfx2 = _chunkS55JFWDAcjs.parseLfx2; exports.parseLrfx = _chunkS55JFWDAcjs.parseLrfx; exports.parseOpenTypeFont = _chunkLCCMOWR7cjs.parseOpenTypeFont; exports.parsePaintSource = _chunkPQ3H2AANcjs.parsePaintSource; exports.parsePatternBlock = _chunkS55JFWDAcjs.parsePatternBlock; exports.parseSelectionMode = _chunkSS53NNZOcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkS55JFWDAcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkS55JFWDAcjs.patchParagraphStyle; exports.patchTextStyle = _chunkS55JFWDAcjs.patchTextStyle; exports.pathAnchorCount = pathAnchorCount; exports.pathBounds = pathBounds; exports.pathStrokeCoverage = _chunkPQ3H2AANcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkPQ3H2AANcjs.pathStrokeDabs; exports.pathSvgData = pathSvgData; exports.pathToSelection = pathToSelection; exports.perDabStrength = _chunkYF3YZZ6Gcjs.perDabStrength; exports.photoFilterMatrix = _chunkS55JFWDAcjs.photoFilterMatrix; exports.pigment8 = _chunkOLNIPTB3cjs.pigment8; exports.pigmentColor = _chunkKWNMBMKGcjs.pigmentColor; exports.pigmentOf = _chunkKWNMBMKGcjs.pigmentOf; exports.pixelLayerBounds = _chunkS55JFWDAcjs.pixelLayerBounds; exports.pixelLayers = _chunkS55JFWDAcjs.pixelLayers; exports.pixelPigment = _chunkKWNMBMKGcjs.pixelPigment; exports.placeContents = _chunkS55JFWDAcjs.placeContents; exports.placeLayer = _chunkS55JFWDAcjs.placeLayer; exports.placementAt = _chunkS55JFWDAcjs.placementAt; exports.placementBounds = _chunkS55JFWDAcjs.placementBounds; exports.placementGeometry = _chunkS55JFWDAcjs.placementGeometry; exports.planImageToolPlayback = planImageToolPlayback; exports.planOutlineTrace = planOutlineTrace; exports.pngDataUrl = _chunkOLNIPTB3cjs.pngDataUrl; exports.pointerPressure = _chunkKWNMBMKGcjs.pointerPressure; exports.pointerStrokeSample = _chunkKWNMBMKGcjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkKWNMBMKGcjs.pointerStrokeSamples; exports.polygonCoverage = _chunkUC3PWFM3cjs.polygonCoverage; exports.polygonCoverageBox = _chunkUC3PWFM3cjs.polygonCoverageBox; exports.polygonSelection = _chunkUC3PWFM3cjs.polygonSelection; exports.posterizeValue = _chunkS55JFWDAcjs.posterizeValue; exports.presetWarp = _chunkS55JFWDAcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkS55JFWDAcjs.projectImagePoint; exports.projectImageRect = _chunkS55JFWDAcjs.projectImageRect; exports.projectMaskCoverage = _chunkS55JFWDAcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkOLNIPTB3cjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkS55JFWDAcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkS55JFWDAcjs.psdToLayers; exports.pullWarpMesh = _chunkQAUIZPYIcjs.pullWarpMesh; exports.put255 = _chunkPQ3H2AANcjs.put255; exports.quadFrameOverlay = quadFrameOverlay; exports.quickMaskPixels = quickMaskPixels; exports.quickSelectStroke = _chunkUC3PWFM3cjs.quickSelectStroke; exports.rand01 = _chunkPQ3H2AANcjs.rand01; exports.randSigned = _chunkPQ3H2AANcjs.randSigned; exports.rangeLightness = _chunkS55JFWDAcjs.rangeLightness; exports.rasterContents = _chunkS55JFWDAcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkS55JFWDAcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkS55JFWDAcjs.rasterizeCoverage; exports.rasterizeDab = _chunkPQ3H2AANcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkS55JFWDAcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkOLNIPTB3cjs.readDeepRegion; exports.readEdgeColor = _chunkS55JFWDAcjs.readEdgeColor; exports.readPaintSource = _chunkPQ3H2AANcjs.readPaintSource; exports.readPaths = readPaths; exports.readPixel = _chunk474IQG74cjs.readPixel; exports.readPsd = _chunkS55JFWDAcjs.readPsd; exports.readRegion = _chunk474IQG74cjs.readRegion; exports.readShapeComponents = _chunkS55JFWDAcjs.readShapeComponents; exports.readSourceRegion = _chunkYF3YZZ6Gcjs.readSourceRegion; exports.rectSelection = _chunkUC3PWFM3cjs.rectSelection; exports.rectToQuad = _chunkQT26RHKKcjs.rectToQuad; exports.reduceSurface = _chunkB46UQUDCcjs.reduceSurface; exports.referencePoint = _chunkS55JFWDAcjs.referencePoint; exports.refineCoverage = _chunkSS53NNZOcjs.refineCoverage; exports.refineEdgeHalo = _chunkSS53NNZOcjs.refineEdgeHalo; exports.refineSelection = _chunkSS53NNZOcjs.refineSelection; exports.reflectanceToRgb = _chunkOLNIPTB3cjs.reflectanceToRgb; exports.removeAlpha = _chunkS55JFWDAcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkS55JFWDAcjs.removeLayer; exports.removeLayerEffect = _chunkS55JFWDAcjs.removeLayerEffect; exports.removeLayerFilter = _chunkS55JFWDAcjs.removeLayerFilter; exports.removePaintGradientStop = _chunkPQ3H2AANcjs.removePaintGradientStop; exports.removeSmartFilter = _chunkS55JFWDAcjs.removeSmartFilter; exports.renderBrushstroke = _chunkPQ3H2AANcjs.renderBrushstroke; exports.renderLayerEffects = _chunkB46UQUDCcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkS55JFWDAcjs.renderShape; exports.renderShapeRect = _chunkS55JFWDAcjs.renderShapeRect; exports.renderSmartObject = _chunkS55JFWDAcjs.renderSmartObject; exports.renderText = _chunkS55JFWDAcjs.renderText; exports.replaceContents = _chunkS55JFWDAcjs.replaceContents; exports.replaceTextRange = _chunkS55JFWDAcjs.replaceTextRange; exports.requireLayer = _chunkS55JFWDAcjs.requireLayer; exports.requireOperation = _chunkS55JFWDAcjs.requireOperation; exports.requireShapeLayer = _chunkS55JFWDAcjs.requireShapeLayer; exports.requireSmartObject = _chunkS55JFWDAcjs.requireSmartObject; exports.requireTypeLayer = _chunkS55JFWDAcjs.requireTypeLayer; exports.requireUnlocked = _chunkS55JFWDAcjs.requireUnlocked; exports.rerender = _chunkS55JFWDAcjs.rerender; exports.rerenderShape = _chunkS55JFWDAcjs.rerenderShape; exports.rerenderText = _chunkS55JFWDAcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkSS53NNZOcjs.resizeSelection; exports.resizeWarpMesh = _chunkQAUIZPYIcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkS55JFWDAcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunkPQ3H2AANcjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.resolveVectorMasks = _chunkS55JFWDAcjs.resolveVectorMasks; exports.restyleRange = _chunkQAUIZPYIcjs.restyleRange; exports.retouchFilter = _chunkYF3YZZ6Gcjs.retouchFilter; exports.reversePaintGradient = _chunkPQ3H2AANcjs.reversePaintGradient; exports.rgbToGray = _chunkS55JFWDAcjs.rgbToGray; exports.rgbToHsl = _chunkS55JFWDAcjs.rgbToHsl; exports.rgbToReflectance = _chunkOLNIPTB3cjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunkYF3YZZ6Gcjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkS55JFWDAcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkS55JFWDAcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.runSelectionJob = _chunkUC3PWFM3cjs.runSelectionJob; exports.sameCanvasViewport = sameCanvasViewport; exports.sampleLut = _chunkS55JFWDAcjs.sampleLut; exports.sampleToneLut = _chunkS55JFWDAcjs.sampleToneLut; exports.saturationOf = _chunkYF3YZZ6Gcjs.saturationOf; exports.scaleLayerEffect = _chunkB46UQUDCcjs.scaleLayerEffect; exports.scalePaintGradient = _chunkPQ3H2AANcjs.scalePaintGradient; exports.seamlessClone = _chunkMQDIP4CFcjs.seamlessClone; exports.seedFromString = _chunkPQ3H2AANcjs.seedFromString; exports.segmentToSelection = segmentToSelection; exports.segmentationOutlines = segmentationOutlines; exports.segmentsToSelection = segmentsToSelection; exports.selectObjectIn = _chunkUC3PWFM3cjs.selectObjectIn; exports.selectSimilar = selectSimilar; exports.selectionArea = _chunkSS53NNZOcjs.selectionArea; exports.selectionDiffPixels = selectionDiffPixels; exports.selectionFromCoverage = _chunkSS53NNZOcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkSS53NNZOcjs.selectionFromPixels; exports.selectionFromRegion = _chunkSS53NNZOcjs.selectionFromRegion; exports.selectionFromTiles = _chunkSS53NNZOcjs.selectionFromTiles; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionRing = selectionRing; exports.selectionToCoverage = _chunkSS53NNZOcjs.selectionToCoverage; exports.selectionToPixels = _chunkSS53NNZOcjs.selectionToPixels; exports.selectionToSubpaths = selectionToSubpaths; exports.selectionUncertainty = selectionUncertainty; exports.selectionValueAt = _chunkSS53NNZOcjs.selectionValueAt; exports.serializeChannels = serializeChannels; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkS55JFWDAcjs.serializeContents; exports.serializeEffects = _chunkS55JFWDAcjs.serializeEffects; exports.serializeLayer = _chunkS55JFWDAcjs.serializeLayer; exports.serializeLayers = _chunkS55JFWDAcjs.serializeLayers; exports.serializeLayersExternal = _chunkS55JFWDAcjs.serializeLayersExternal; exports.serializeMask = _chunkUC3PWFM3cjs.serializeMask; exports.serializePaths = serializePaths; exports.serializePatterns = _chunkS55JFWDAcjs.serializePatterns; exports.serializeSelection = _chunkSS53NNZOcjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkS55JFWDAcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkS55JFWDAcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkS55JFWDAcjs.setLayerMask; exports.setLayerProperties = _chunkS55JFWDAcjs.setLayerProperties; exports.setLum = _chunkOLNIPTB3cjs.setLum; exports.setPigmentColor = _chunkOLNIPTB3cjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkS55JFWDAcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkS55JFWDAcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkS55JFWDAcjs.setSmartPlacement; exports.shadeTile = _chunkKWNMBMKGcjs.shadeTile; exports.shapeAsPixelLayer = _chunkS55JFWDAcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkS55JFWDAcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkS55JFWDAcjs.shapeGeometryBounds; exports.shapeLayers = _chunkS55JFWDAcjs.shapeLayers; exports.shapeOutline = _chunkS55JFWDAcjs.shapeOutline; exports.shapeRenderClip = _chunkS55JFWDAcjs.shapeRenderClip; exports.shiftCoverage = _chunkSS53NNZOcjs.shiftCoverage; exports.simplifyPixelPath = simplifyPixelPath; exports.skinToneRange = skinToneRange; exports.slicSuperpixels = _chunkUC3PWFM3cjs.slicSuperpixels; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkS55JFWDAcjs.smartObjectLayers; exports.smoothCoverage = _chunkSS53NNZOcjs.smoothCoverage; exports.smoothPoints = _chunkPQ3H2AANcjs.smoothPoints; exports.smoothnessWeights = _chunkUC3PWFM3cjs.smoothnessWeights; exports.smudgeEffect = _chunkYF3YZZ6Gcjs.smudgeEffect; exports.snapPolygonToEdges = snapPolygonToEdges; exports.snapTo45 = snapTo45; exports.snapToEdge = snapToEdge; exports.softMaskToSelection = _chunkUC3PWFM3cjs.softMaskToSelection; exports.solidPaint = _chunkPQ3H2AANcjs.solidPaint; exports.solidSurface = _chunk474IQG74cjs.solidSurface; exports.solveMembrane = _chunkMQDIP4CFcjs.solveMembrane; exports.spliceRuns = _chunkQAUIZPYIcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunkYF3YZZ6Gcjs.sponge; exports.spongeEffect = _chunkYF3YZZ6Gcjs.spongeEffect; exports.spotHealPixels = _chunkYF3YZZ6Gcjs.spotHealPixels; exports.spotHealWindow = _chunkYF3YZZ6Gcjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkKWNMBMKGcjs.srgbByteToLinear; exports.srgbDecode = _chunkOLNIPTB3cjs.srgbDecode; exports.srgbEncode = _chunkOLNIPTB3cjs.srgbEncode; exports.srgbToLinear = _chunkS55JFWDAcjs.srgbToLinear; exports.standardBlendMode = _chunkOLNIPTB3cjs.standardBlendMode; exports.startMarchingAnts = startMarchingAnts; exports.startSelectionWorker = _chunkUC3PWFM3cjs.startSelectionWorker; exports.stepSlotTs = _chunkKWNMBMKGcjs.stepSlotTs; exports.strokeGrainCatch = _chunkPQ3H2AANcjs.strokeGrainCatch; exports.styleAt = _chunkQAUIZPYIcjs.styleAt; exports.subpathsToSvgPath = subpathsToSvgPath; exports.sumHistograms = sumHistograms; exports.superpixelSaliency = _chunkUC3PWFM3cjs.superpixelSaliency; exports.surfaceBytes = _chunk474IQG74cjs.surfaceBytes; exports.surfaceDepth = _chunkOLNIPTB3cjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkOLNIPTB3cjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunk474IQG74cjs.surfaceFromPixels; exports.surfacesEqual = _chunk474IQG74cjs.surfacesEqual; exports.tempTintToXy = _chunkS55JFWDAcjs.tempTintToXy; exports.temperatureToKelvin = _chunkS55JFWDAcjs.temperatureToKelvin; exports.textIndexAt = _chunkQAUIZPYIcjs.textIndexAt; exports.textMatrix = _chunkS55JFWDAcjs.textMatrix; exports.textOrientation = _chunkS55JFWDAcjs.textOrientation; exports.textOutlines = _chunkS55JFWDAcjs.textOutlines; exports.textRange = _chunkS55JFWDAcjs.textRange; exports.tileCoord = _chunk474IQG74cjs.tileCoord; exports.tileKey = _chunk474IQG74cjs.tileKey; exports.tileRect = _chunk474IQG74cjs.tileRect; exports.tileSamples = _chunkOLNIPTB3cjs.tileSamples; exports.tileSamples16 = _chunkOLNIPTB3cjs.tileSamples16; exports.tileSamples32 = _chunkOLNIPTB3cjs.tileSamples32; exports.tilesInRect = _chunk474IQG74cjs.tilesInRect; exports.tipFalloff = _chunkPQ3H2AANcjs.tipFalloff; exports.tipReach = _chunkPQ3H2AANcjs.tipReach; exports.tipShape = _chunkPQ3H2AANcjs.tipShape; exports.to16From32 = _chunkOLNIPTB3cjs.to16From32; exports.to16From8 = _chunkOLNIPTB3cjs.to16From8; exports.to32From16 = _chunkOLNIPTB3cjs.to32From16; exports.to32From8 = _chunkOLNIPTB3cjs.to32From8; exports.to8From16 = _chunkOLNIPTB3cjs.to8From16; exports.to8From32 = _chunkOLNIPTB3cjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkS55JFWDAcjs.toTextSpace; exports.toneCurve = _chunkS55JFWDAcjs.toneCurve; exports.toneLuts = _chunkS55JFWDAcjs.toneLuts; exports.toneOf = _chunkYF3YZZ6Gcjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkS55JFWDAcjs.transformHomography; exports.transformMap = _chunkS55JFWDAcjs.transformMap; exports.transformShapeComponents = _chunkS55JFWDAcjs.transformShapeComponents; exports.transformSurface = _chunkB46UQUDCcjs.transformSurface; exports.transformTypeLayer = _chunkS55JFWDAcjs.transformTypeLayer; exports.transformVectorMask = _chunkS55JFWDAcjs.transformVectorMask; exports.transformedBounds = _chunkB46UQUDCcjs.transformedBounds; exports.transformedBox = _chunkS55JFWDAcjs.transformedBox; exports.transformedPoint = _chunkS55JFWDAcjs.transformedPoint; exports.translateLayer = _chunkS55JFWDAcjs.translateLayer; exports.translateSurface = _chunk474IQG74cjs.translateSurface; exports.typeAsPixelLayer = _chunkS55JFWDAcjs.typeAsPixelLayer; exports.typeFrame = _chunkS55JFWDAcjs.typeFrame; exports.typeFromAnnotation = _chunkS55JFWDAcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkS55JFWDAcjs.typeLayerName; exports.ungroupLayer = _chunkS55JFWDAcjs.ungroupLayer; exports.uniformTile = _chunk474IQG74cjs.uniformTile; exports.unionRect = _chunkS55JFWDAcjs.unionRect; exports.unprojectCanvasPoint = _chunkS55JFWDAcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkS55JFWDAcjs.updateLayerEffect; exports.updateLayerFilter = _chunkS55JFWDAcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkS55JFWDAcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunkPQ3H2AANcjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkS55JFWDAcjs.updateShapeLayer; exports.updateSmartFilter = _chunkS55JFWDAcjs.updateSmartFilter; exports.updateTypeLayer = _chunkS55JFWDAcjs.updateTypeLayer; exports.upscaleRegion = _chunkUC3PWFM3cjs.upscaleRegion; exports.userErrorMessage = _chunkS55JFWDAcjs.userErrorMessage; exports.uvToXy = _chunkS55JFWDAcjs.uvToXy; exports.validateEffectGradient = _chunkB46UQUDCcjs.validateEffectGradient; exports.validateLayerEffect = _chunkB46UQUDCcjs.validateLayerEffect; exports.validateLayerEffects = _chunkB46UQUDCcjs.validateLayerEffects; exports.vectorMaskBounds = _chunkS55JFWDAcjs.vectorMaskBounds; exports.vectorMaskCoverage = _chunkS55JFWDAcjs.vectorMaskCoverage; exports.vectorMaskThumbnail = _chunkS55JFWDAcjs.vectorMaskThumbnail; exports.vectorMaskThumbnailClick = vectorMaskThumbnailClick; exports.versionedDescriptorBytes = _chunkS55JFWDAcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkS55JFWDAcjs.vibranceLinear; exports.vibrancePixel = _chunkS55JFWDAcjs.vibrancePixel; exports.walkDabs = _chunkPQ3H2AANcjs.walkDabs; exports.warpMeshEditPoints = _chunkQAUIZPYIcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkQAUIZPYIcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkQAUIZPYIcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkQAUIZPYIcjs.warpPresetMesh; exports.warpSurface = _chunkB46UQUDCcjs.warpSurface; exports.watchCanvasViewport = watchCanvasViewport; exports.wbMatrix = _chunkS55JFWDAcjs.wbMatrix; exports.wetGpuSupport = _chunkKWNMBMKGcjs.wetGpuSupport; exports.wetSimdSupported = _chunkKWNMBMKGcjs.wetSimdSupported; exports.wetSupport = _chunkKWNMBMKGcjs.wetSupport; exports.whiteBalanceFromSample = _chunkS55JFWDAcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkS55JFWDAcjs.whiteBalanceMatrix; exports.withBackgroundOpacity = withBackgroundOpacity; exports.withFilterMaskSurface = _chunkS55JFWDAcjs.withFilterMaskSurface; exports.withImagePlayback = withImagePlayback; exports.withNewIds = _chunkS55JFWDAcjs.withNewIds; exports.workImage = _chunkUC3PWFM3cjs.workImage; exports.workLuma = _chunkUC3PWFM3cjs.workLuma; exports.workPlanes = _chunkUC3PWFM3cjs.workPlanes; exports.writeAdjustmentBlock = _chunkS55JFWDAcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkOLNIPTB3cjs.writeDeepRegion; exports.writeLfx2 = _chunkS55JFWDAcjs.writeLfx2; exports.writePatternBlock = _chunkS55JFWDAcjs.writePatternBlock; exports.writePsd = _chunkS55JFWDAcjs.writePsd; exports.writeRegion = _chunk474IQG74cjs.writeRegion; exports.xyToTempTint = _chunkS55JFWDAcjs.xyToTempTint; exports.xyToUv = _chunkS55JFWDAcjs.xyToUv;