@pixerate/editor-react 0.114.2 → 0.114.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/animation-editor/index.cjs +342 -215
  2. package/dist/animation-editor/index.js +2 -2
  3. package/dist/canvas/index.cjs +520 -393
  4. package/dist/canvas/index.js +2 -2
  5. package/dist/{chunk-5LFQ2UQZ.js → chunk-354TA5QV.js} +221 -101
  6. package/dist/{chunk-2INOKIJN.js → chunk-SH63DFOO.js} +345 -297
  7. package/dist/{chunk-BWEARAWR.js → chunk-TOGMXZM4.js} +40 -18
  8. package/dist/effects/EffectParameters.d.cts +4 -1
  9. package/dist/effects/EffectParameters.d.ts +4 -1
  10. package/dist/effects/index.cjs +348 -221
  11. package/dist/effects/index.js +2 -2
  12. package/dist/image-editor/ImageEffectControls.d.cts +4 -1
  13. package/dist/image-editor/ImageEffectControls.d.ts +4 -1
  14. package/dist/image-editor/ImageProviderEffectsPanel.d.cts +4 -1
  15. package/dist/image-editor/ImageProviderEffectsPanel.d.ts +4 -1
  16. package/dist/image-editor/controls/parameterControls.d.cts +4 -0
  17. package/dist/image-editor/controls/parameterControls.d.ts +4 -0
  18. package/dist/image-editor/index.cjs +868 -697
  19. package/dist/image-editor/index.js +3 -3
  20. package/dist/index.cjs +1388 -1217
  21. package/dist/index.js +3 -3
  22. package/dist/paint-editor/index.cjs +335 -208
  23. package/dist/paint-editor/index.js +2 -2
  24. package/dist/parameters/ParametersPanel.d.cts +4 -1
  25. package/dist/parameters/ParametersPanel.d.ts +4 -1
  26. package/dist/parameters/controls.d.cts +72 -0
  27. package/dist/parameters/controls.d.ts +72 -0
  28. package/dist/parameters/fields.d.cts +19 -6
  29. package/dist/parameters/fields.d.ts +19 -6
  30. package/dist/parameters/index.cjs +350 -183
  31. package/dist/parameters/index.d.cts +1 -0
  32. package/dist/parameters/index.d.ts +1 -0
  33. package/dist/parameters/index.js +70 -14
  34. package/dist/vector/index.cjs +321 -194
  35. package/dist/vector/index.js +2 -2
  36. package/dist/video-editor/index.cjs +418 -291
  37. package/dist/video-editor/index.js +2 -2
  38. package/package.json +3 -3
@@ -6,7 +6,11 @@ import {
6
6
  EffectsBrowser,
7
7
  useEffectDescription,
8
8
  useEffects
9
- } from "./chunk-BWEARAWR.js";
9
+ } from "./chunk-TOGMXZM4.js";
10
+ import {
11
+ resolveParameterComponents,
12
+ useParameterComponents
13
+ } from "./chunk-354TA5QV.js";
10
14
  import {
11
15
  PresenceLayer,
12
16
  useAgentPlayback,
@@ -2047,25 +2051,67 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
2047
2051
  import React7, { useEffect as useEffect7, useState as useState8 } from "react";
2048
2052
  import { EFFECT_LAYER_USES, findLayer } from "@pixerate/editor/image-editor";
2049
2053
 
2054
+ // src/image-editor/controls/parameterControls.tsx
2055
+ import { matchParameterOptionValue } from "@pixerate/editor/parameters";
2056
+ import { jsx as jsx9 } from "react/jsx-runtime";
2057
+ function ImageParameterSlider({ value, min, max, step, label, disabled, className, onChange, onGestureStart, onGestureEnd }) {
2058
+ return /* @__PURE__ */ jsx9(
2059
+ ImageRange,
2060
+ {
2061
+ value,
2062
+ min,
2063
+ max,
2064
+ step,
2065
+ label,
2066
+ disabled,
2067
+ className,
2068
+ onChange,
2069
+ onStart: onGestureStart,
2070
+ onEnd: onGestureEnd
2071
+ }
2072
+ );
2073
+ }
2074
+ function ImageParameterSelect({ value, options, label, disabled, className, onChange }) {
2075
+ return /* @__PURE__ */ jsx9(
2076
+ ImageSelect,
2077
+ {
2078
+ value: String(value),
2079
+ options: options.map((o) => ({ value: String(o.value), label: o.label })),
2080
+ label,
2081
+ disabled,
2082
+ className,
2083
+ onChange: (v) => onChange(matchParameterOptionValue(options, v))
2084
+ }
2085
+ );
2086
+ }
2087
+ function imageEditorParameterComponents(controls) {
2088
+ return {
2089
+ slider: controls.Range ? ImageParameterSlider : void 0,
2090
+ select: controls.Select ? ImageParameterSelect : void 0
2091
+ };
2092
+ }
2093
+
2050
2094
  // src/image-editor/ImageEffectControls.tsx
2051
- import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
2052
- function ImageEffectControls({ provider, effect, name, values, onChange, onPreset, className }) {
2095
+ import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
2096
+ function ImageEffectControls({ provider, effect, name, values, onChange, onPreset, className, components }) {
2053
2097
  const { description, error } = useEffectDescription(provider, effect);
2098
+ const fallback = resolveParameterComponents(useParameterComponents(), imageEditorParameterComponents(useImageEditorControls()));
2099
+ const effectiveComponents = resolveParameterComponents(components, fallback);
2054
2100
  let body;
2055
2101
  if (!provider) body = /* @__PURE__ */ jsxs9("p", { className: "text-[11px] text-muted-foreground", children: [
2056
2102
  'No effects provider: "',
2057
2103
  name ?? effect,
2058
2104
  '" is kept but not drawn.'
2059
2105
  ] });
2060
- else if (error) body = /* @__PURE__ */ jsx9("p", { className: "text-[11px] text-amber-600", children: error });
2061
- else if (!description) body = /* @__PURE__ */ jsx9("p", { className: "text-[11px] text-muted-foreground", children: "Loading\u2026" });
2062
- else body = /* @__PURE__ */ jsx9(EffectParameters, { description, values, onChange, onReset: (k) => onChange(k, description.defaults[k], null), onPreset });
2063
- return /* @__PURE__ */ jsx9("div", { className, "data-testid": "image-effect-controls", children: body });
2106
+ else if (error) body = /* @__PURE__ */ jsx10("p", { className: "text-[11px] text-amber-600", children: error });
2107
+ else if (!description) body = /* @__PURE__ */ jsx10("p", { className: "text-[11px] text-muted-foreground", children: "Loading\u2026" });
2108
+ else body = /* @__PURE__ */ jsx10(EffectParameters, { description, values, onChange, onReset: (k) => onChange(k, description.defaults[k], null), onPreset, components: effectiveComponents });
2109
+ return /* @__PURE__ */ jsx10("div", { className, "data-testid": "image-effect-controls", children: body });
2064
2110
  }
2065
2111
 
2066
2112
  // src/image-editor/ImageProviderEffectsPanel.tsx
2067
- import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
2068
- function ImageProviderEffectsPanel({ controller, className = "" }) {
2113
+ import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
2114
+ function ImageProviderEffectsPanel({ controller, className = "", components }) {
2069
2115
  const [, setTick] = useState8(0);
2070
2116
  useEffect7(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
2071
2117
  const [browse, setBrowse] = useState8(null);
@@ -2094,73 +2140,75 @@ function ImageProviderEffectsPanel({ controller, className = "" }) {
2094
2140
  const canFilter = !!layer && layer.type !== "adjustment" && layer.type !== "annotation";
2095
2141
  return /* @__PURE__ */ jsxs10("section", { className: `flex flex-col gap-2 text-xs ${className}`, "aria-label": "Provider effects", "data-image-provider-effects": "", children: [
2096
2142
  /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-1", children: [
2097
- /* @__PURE__ */ jsx10("span", { className: "flex-1 font-semibold uppercase tracking-wider text-[11px] text-foreground", children: "Effects" }),
2098
- /* @__PURE__ */ jsx10("button", { type: "button", className: imageOutlineButtonClass, disabled: !provider || !canFilter, "aria-pressed": browse === "filter", onClick: () => setBrowse(browse === "filter" ? null : "filter"), children: "Apply effect\u2026" }),
2099
- /* @__PURE__ */ jsx10("button", { type: "button", className: imageOutlineButtonClass, disabled: !provider, "aria-pressed": browse === "layer", onClick: () => setBrowse(browse === "layer" ? null : "layer"), children: "Effect layer\u2026" })
2143
+ /* @__PURE__ */ jsx11("span", { className: "flex-1 font-semibold uppercase tracking-wider text-[11px] text-foreground", children: "Effects" }),
2144
+ /* @__PURE__ */ jsx11("button", { type: "button", className: imageOutlineButtonClass, disabled: !provider || !canFilter, "aria-pressed": browse === "filter", onClick: () => setBrowse(browse === "filter" ? null : "filter"), children: "Apply effect\u2026" }),
2145
+ /* @__PURE__ */ jsx11("button", { type: "button", className: imageOutlineButtonClass, disabled: !provider, "aria-pressed": browse === "layer", onClick: () => setBrowse(browse === "layer" ? null : "layer"), children: "Effect layer\u2026" })
2100
2146
  ] }),
2101
- !provider && /* @__PURE__ */ jsx10("p", { className: "text-[11px] text-muted-foreground", children: "No effects provider is registered. Effects in the document are kept." }),
2102
- browse === "filter" && layer && /* @__PURE__ */ jsx10(EffectsBrowser, { provider, uses: ["filter"], title: "Filters", onPick: (e) => (setBrowse(null), run(() => controller.applyEffectFilter(layer.id, e.id))) }),
2103
- browse === "layer" && /* @__PURE__ */ jsx10(EffectsBrowser, { provider, uses: EFFECT_LAYER_USES, title: "Generators and overlays", onPick: (e) => (setBrowse(null), run(() => controller.addEffectLayer(e.id))) }),
2147
+ !provider && /* @__PURE__ */ jsx11("p", { className: "text-[11px] text-muted-foreground", children: "No effects provider is registered. Effects in the document are kept." }),
2148
+ browse === "filter" && layer && /* @__PURE__ */ jsx11(EffectsBrowser, { provider, uses: ["filter"], title: "Filters", onPick: (e) => (setBrowse(null), run(() => controller.applyEffectFilter(layer.id, e.id))) }),
2149
+ browse === "layer" && /* @__PURE__ */ jsx11(EffectsBrowser, { provider, uses: EFFECT_LAYER_USES, title: "Generators and overlays", onPick: (e) => (setBrowse(null), run(() => controller.addEffectLayer(e.id))) }),
2104
2150
  generator && layer && /* @__PURE__ */ jsxs10("div", { className: "space-y-1", "data-effect-part": "generator", children: [
2105
2151
  /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-1", children: [
2106
- /* @__PURE__ */ jsx10("span", { className: "flex-1 font-medium text-foreground", children: generator.name ?? generator.effect }),
2107
- /* @__PURE__ */ jsx10("button", { type: "button", className: imageOutlineButtonClass, title: "Keep the pixels as a plain layer", onClick: () => run(() => controller.rasterizeEffectLayer(layer.id)), children: "Rasterize" })
2152
+ /* @__PURE__ */ jsx11("span", { className: "flex-1 font-medium text-foreground", children: generator.name ?? generator.effect }),
2153
+ /* @__PURE__ */ jsx11("button", { type: "button", className: imageOutlineButtonClass, title: "Keep the pixels as a plain layer", onClick: () => run(() => controller.rasterizeEffectLayer(layer.id)), children: "Rasterize" })
2108
2154
  ] }),
2109
- /* @__PURE__ */ jsx10(
2155
+ /* @__PURE__ */ jsx11(
2110
2156
  ImageEffectControls,
2111
2157
  {
2112
2158
  provider,
2113
2159
  effect: generator.effect,
2114
2160
  name: generator.name,
2115
2161
  values: generator.values,
2162
+ components,
2116
2163
  onChange: (k, v, gesture) => run(() => controller.updateEffectLayer(layer.id, { values: { [k]: v } }, commit(gesture))),
2117
2164
  onPreset: (values) => run(() => controller.updateEffectLayer(layer.id, { values }))
2118
2165
  }
2119
2166
  )
2120
2167
  ] }),
2121
- filters.length > 0 && layer && /* @__PURE__ */ jsx10("ol", { className: "space-y-1", "data-effect-part": "filters", children: filters.map((f) => {
2168
+ filters.length > 0 && layer && /* @__PURE__ */ jsx11("ol", { className: "space-y-1", "data-effect-part": "filters", children: filters.map((f) => {
2122
2169
  const label = f.kind === "effect" ? f.name ?? f.effect : f.kind;
2123
2170
  const all = layer.smartFilters.filters;
2124
2171
  const index = all.indexOf(f);
2125
2172
  if (f.kind !== "effect") return null;
2126
2173
  return /* @__PURE__ */ jsxs10("li", { className: "rounded border border-border p-1", "data-smart-effect": f.id, children: [
2127
2174
  /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-1", children: [
2128
- /* @__PURE__ */ jsx10("input", { type: "checkbox", checked: f.enabled, "aria-label": `${label} on`, onChange: (e) => {
2129
- const enabled = e.currentTarget.checked;
2130
- run(() => controller.updateEffectFilter(layer.id, f.id, { enabled }));
2131
- } }),
2132
- /* @__PURE__ */ jsx10("button", { type: "button", className: "min-w-0 flex-1 truncate text-left text-foreground", "aria-expanded": open === f.id, onClick: () => setOpen(open === f.id ? null : f.id), children: label }),
2133
- /* @__PURE__ */ jsx10("button", { type: "button", className: imageOutlineButtonClass, disabled: index === all.length - 1, "aria-label": "Move up", onClick: () => run(() => controller.updateEffectFilter(layer.id, f.id, { index: index + 1 })), children: "\u2191" }),
2134
- /* @__PURE__ */ jsx10("button", { type: "button", className: imageOutlineButtonClass, disabled: index === 0, "aria-label": "Move down", onClick: () => run(() => controller.updateEffectFilter(layer.id, f.id, { index: index - 1 })), children: "\u2193" }),
2135
- /* @__PURE__ */ jsx10("button", { type: "button", className: imageOutlineButtonClass, "aria-label": `Remove ${label}`, onClick: () => run(() => controller.removeSmartFilter(layer.id, f.id)), children: "\u2715" })
2175
+ /* @__PURE__ */ jsx11(
2176
+ ImageCheckbox,
2177
+ {
2178
+ checked: f.enabled,
2179
+ label: `${label} on`,
2180
+ onChange: (enabled) => run(() => controller.updateEffectFilter(layer.id, f.id, { enabled }))
2181
+ }
2182
+ ),
2183
+ /* @__PURE__ */ jsx11("button", { type: "button", className: "min-w-0 flex-1 truncate text-left text-foreground", "aria-expanded": open === f.id, onClick: () => setOpen(open === f.id ? null : f.id), children: label }),
2184
+ /* @__PURE__ */ jsx11("button", { type: "button", className: imageOutlineButtonClass, disabled: index === all.length - 1, "aria-label": "Move up", onClick: () => run(() => controller.updateEffectFilter(layer.id, f.id, { index: index + 1 })), children: "\u2191" }),
2185
+ /* @__PURE__ */ jsx11("button", { type: "button", className: imageOutlineButtonClass, disabled: index === 0, "aria-label": "Move down", onClick: () => run(() => controller.updateEffectFilter(layer.id, f.id, { index: index - 1 })), children: "\u2193" }),
2186
+ /* @__PURE__ */ jsx11("button", { type: "button", className: imageOutlineButtonClass, "aria-label": `Remove ${label}`, onClick: () => run(() => controller.removeSmartFilter(layer.id, f.id)), children: "\u2715" })
2136
2187
  ] }),
2137
2188
  open === f.id && /* @__PURE__ */ jsxs10("div", { className: "mt-1 space-y-2", children: [
2138
2189
  /* @__PURE__ */ jsxs10("label", { className: "flex items-center gap-1", children: [
2139
- /* @__PURE__ */ jsx10("span", { className: "w-14 text-[11px] text-foreground", children: "Opacity" }),
2140
- /* @__PURE__ */ jsx10(
2141
- "input",
2190
+ /* @__PURE__ */ jsx11("span", { className: "w-14 text-[11px] text-foreground", children: "Opacity" }),
2191
+ /* @__PURE__ */ jsx11(
2192
+ ImageRange,
2142
2193
  {
2143
- type: "range",
2144
2194
  min: 0,
2145
2195
  max: 1,
2146
2196
  step: 0.01,
2147
2197
  className: "flex-1",
2148
2198
  value: f.opacity,
2149
- "aria-label": `${label} opacity`,
2150
- onChange: (e) => {
2151
- const opacity = Number(e.currentTarget.value);
2152
- run(() => controller.updateEffectFilter(layer.id, f.id, { opacity }));
2153
- }
2199
+ label: `${label} opacity`,
2200
+ onChange: (opacity) => run(() => controller.updateEffectFilter(layer.id, f.id, { opacity }))
2154
2201
  }
2155
2202
  )
2156
2203
  ] }),
2157
- /* @__PURE__ */ jsx10(
2204
+ /* @__PURE__ */ jsx11(
2158
2205
  ImageEffectControls,
2159
2206
  {
2160
2207
  provider,
2161
2208
  effect: f.effect,
2162
2209
  name: f.name,
2163
2210
  values: f.values,
2211
+ components,
2164
2212
  onChange: (k, v, gesture) => run(() => controller.updateEffectFilter(layer.id, f.id, { values: { [k]: v } }, commit(gesture))),
2165
2213
  onPreset: (values) => run(() => controller.updateEffectFilter(layer.id, f.id, { values }))
2166
2214
  }
@@ -2168,8 +2216,8 @@ function ImageProviderEffectsPanel({ controller, className = "" }) {
2168
2216
  ] })
2169
2217
  ] }, f.id);
2170
2218
  }) }),
2171
- !layer && /* @__PURE__ */ jsx10("p", { className: "text-[11px] text-muted-foreground", children: "Select a layer to apply effects to it." }),
2172
- message && /* @__PURE__ */ jsx10("p", { role: "alert", className: "text-[11px] text-destructive", children: message })
2219
+ !layer && /* @__PURE__ */ jsx11("p", { className: "text-[11px] text-muted-foreground", children: "Select a layer to apply effects to it." }),
2220
+ message && /* @__PURE__ */ jsx11("p", { role: "alert", className: "text-[11px] text-destructive", children: message })
2173
2221
  ] });
2174
2222
  }
2175
2223
 
@@ -2195,11 +2243,11 @@ import { DEFAULT_PAINT_GRADIENT, userErrorMessage } from "@pixerate/editor/image
2195
2243
 
2196
2244
  // src/image-editor/PaintGradientEditor.tsx
2197
2245
  import { PAINT_GRADIENT_KIT } from "@pixerate/editor/image-editor";
2198
- import { jsx as jsx11 } from "react/jsx-runtime";
2199
- var PaintGradientEditor = (props) => /* @__PURE__ */ jsx11(PaintGradientEditorView, { ...props, kit: PAINT_GRADIENT_KIT });
2246
+ import { jsx as jsx12 } from "react/jsx-runtime";
2247
+ var PaintGradientEditor = (props) => /* @__PURE__ */ jsx12(PaintGradientEditorView, { ...props, kit: PAINT_GRADIENT_KIT });
2200
2248
 
2201
2249
  // src/image-editor/BrushOptionsBar.tsx
2202
- import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
2250
+ import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
2203
2251
  var BrushOptionsBar = ({ controller, className }) => {
2204
2252
  const [, setTick] = useState9(0);
2205
2253
  useEffect8(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
@@ -2216,7 +2264,7 @@ var BrushOptionsBar = ({ controller, className }) => {
2216
2264
  }
2217
2265
  };
2218
2266
  return /* @__PURE__ */ jsxs11("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "brush-options", children: [
2219
- /* @__PURE__ */ jsx12("div", { className: "flex flex-wrap gap-1", role: "toolbar", "aria-label": "Paint tools", children: PAINT_TOOLS.map((t) => /* @__PURE__ */ jsx12(
2267
+ /* @__PURE__ */ jsx13("div", { className: "flex flex-wrap gap-1", role: "toolbar", "aria-label": "Paint tools", children: PAINT_TOOLS.map((t) => /* @__PURE__ */ jsx13(
2220
2268
  "button",
2221
2269
  {
2222
2270
  type: "button",
@@ -2230,7 +2278,7 @@ var BrushOptionsBar = ({ controller, className }) => {
2230
2278
  )) }),
2231
2279
  /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", role: "group", "aria-label": "Colours", children: [
2232
2280
  /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1", children: [
2233
- /* @__PURE__ */ jsx12(
2281
+ /* @__PURE__ */ jsx13(
2234
2282
  "input",
2235
2283
  {
2236
2284
  type: "color",
@@ -2240,10 +2288,10 @@ var BrushOptionsBar = ({ controller, className }) => {
2240
2288
  className: imageColorInputClass
2241
2289
  }
2242
2290
  ),
2243
- /* @__PURE__ */ jsx12("span", { className: "text-muted-foreground", children: "FG" })
2291
+ /* @__PURE__ */ jsx13("span", { className: "text-muted-foreground", children: "FG" })
2244
2292
  ] }),
2245
2293
  /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1", children: [
2246
- /* @__PURE__ */ jsx12(
2294
+ /* @__PURE__ */ jsx13(
2247
2295
  "input",
2248
2296
  {
2249
2297
  type: "color",
@@ -2253,11 +2301,11 @@ var BrushOptionsBar = ({ controller, className }) => {
2253
2301
  className: imageColorInputClass
2254
2302
  }
2255
2303
  ),
2256
- /* @__PURE__ */ jsx12("span", { className: "text-muted-foreground", children: "BG" })
2304
+ /* @__PURE__ */ jsx13("span", { className: "text-muted-foreground", children: "BG" })
2257
2305
  ] }),
2258
- /* @__PURE__ */ jsx12("button", { type: "button", title: "Swap colours (X)", className: imageChipClass(false), onClick: () => controller.swapPaintColors(), children: "Swap" }),
2259
- /* @__PURE__ */ jsx12("button", { type: "button", title: "Default colours (D)", className: imageChipClass(false), onClick: () => controller.resetPaintColors(), children: "Default" }),
2260
- state.activeTool === "brush" && /* @__PURE__ */ jsx12(
2306
+ /* @__PURE__ */ jsx13("button", { type: "button", title: "Swap colours (X)", className: imageChipClass(false), onClick: () => controller.swapPaintColors(), children: "Swap" }),
2307
+ /* @__PURE__ */ jsx13("button", { type: "button", title: "Default colours (D)", className: imageChipClass(false), onClick: () => controller.resetPaintColors(), children: "Default" }),
2308
+ state.activeTool === "brush" && /* @__PURE__ */ jsx13(
2261
2309
  "button",
2262
2310
  {
2263
2311
  type: "button",
@@ -2269,8 +2317,8 @@ var BrushOptionsBar = ({ controller, className }) => {
2269
2317
  }
2270
2318
  )
2271
2319
  ] }),
2272
- state.activeTool === "brush" && paint.type === "gradient" && /* @__PURE__ */ jsx12(PaintGradientEditor, { value: paint, colors: { paint: foreground, secondary: background }, onChange: (g) => attempt(() => controller.setPaintOptions({ paint: g })) }),
2273
- BRUSH_OPTION_CONTROLS.map((spec) => /* @__PURE__ */ jsx12(
2320
+ state.activeTool === "brush" && paint.type === "gradient" && /* @__PURE__ */ jsx13(PaintGradientEditor, { value: paint, colors: { paint: foreground, secondary: background }, onChange: (g) => attempt(() => controller.setPaintOptions({ paint: g })) }),
2321
+ BRUSH_OPTION_CONTROLS.map((spec) => /* @__PURE__ */ jsx13(
2274
2322
  ControlSlider,
2275
2323
  {
2276
2324
  spec,
@@ -2281,7 +2329,7 @@ var BrushOptionsBar = ({ controller, className }) => {
2281
2329
  )),
2282
2330
  state.activeTool === "mixer" && /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-2 border-t border-border pt-2", role: "group", "aria-label": "Mixer Brush", "data-testid": "mixer-options", children: [
2283
2331
  /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
2284
- /* @__PURE__ */ jsx12(
2332
+ /* @__PURE__ */ jsx13(
2285
2333
  "span",
2286
2334
  {
2287
2335
  "aria-label": "Brush load",
@@ -2290,10 +2338,10 @@ var BrushOptionsBar = ({ controller, className }) => {
2290
2338
  style: { background: mixerLoad.reservoir ? rgbUnitToHex(mixerLoad.reservoir) : "transparent" }
2291
2339
  }
2292
2340
  ),
2293
- /* @__PURE__ */ jsx12("button", { type: "button", title: "Fill the reservoir with the foreground colour", className: imageChipClass(false), onClick: () => controller.loadMixerBrush(), children: "Load brush" }),
2294
- /* @__PURE__ */ jsx12("button", { type: "button", title: "Empty the picked-up colour", className: imageChipClass(false), onClick: () => controller.cleanMixerBrush(), children: "Clean brush" })
2341
+ /* @__PURE__ */ jsx13("button", { type: "button", title: "Fill the reservoir with the foreground colour", className: imageChipClass(false), onClick: () => controller.loadMixerBrush(), children: "Load brush" }),
2342
+ /* @__PURE__ */ jsx13("button", { type: "button", title: "Empty the picked-up colour", className: imageChipClass(false), onClick: () => controller.cleanMixerBrush(), children: "Clean brush" })
2295
2343
  ] }),
2296
- /* @__PURE__ */ jsx12("div", { className: "flex gap-1", role: "group", "aria-label": "Mixing", children: MIXER_MIXING_OPTIONS.map((m) => /* @__PURE__ */ jsx12(
2344
+ /* @__PURE__ */ jsx13("div", { className: "flex gap-1", role: "group", "aria-label": "Mixing", children: MIXER_MIXING_OPTIONS.map((m) => /* @__PURE__ */ jsx13(
2297
2345
  "button",
2298
2346
  {
2299
2347
  type: "button",
@@ -2305,34 +2353,34 @@ var BrushOptionsBar = ({ controller, className }) => {
2305
2353
  },
2306
2354
  m.id
2307
2355
  )) }),
2308
- MIXER_OPTION_CONTROLS.map((spec) => /* @__PURE__ */ jsx12(ControlSlider, { spec, value: mixer[spec.id], onChange: (v) => controller.setPaintOptions({ mixer: { [spec.id]: v } }) }, spec.id)),
2356
+ MIXER_OPTION_CONTROLS.map((spec) => /* @__PURE__ */ jsx13(ControlSlider, { spec, value: mixer[spec.id], onChange: (v) => controller.setPaintOptions({ mixer: { [spec.id]: v } }) }, spec.id)),
2309
2357
  /* @__PURE__ */ jsxs11("div", { className: "flex flex-wrap gap-3 text-foreground", children: [
2310
2358
  /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1.5", children: [
2311
- /* @__PURE__ */ jsx12(ImageCheckbox, { label: "Load the brush after each stroke", checked: mixer.loadEachStroke, onChange: (on) => controller.setPaintOptions({ mixer: { loadEachStroke: on } }) }),
2359
+ /* @__PURE__ */ jsx13(ImageCheckbox, { label: "Load the brush after each stroke", checked: mixer.loadEachStroke, onChange: (on) => controller.setPaintOptions({ mixer: { loadEachStroke: on } }) }),
2312
2360
  "Load each stroke"
2313
2361
  ] }),
2314
2362
  /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1.5", children: [
2315
- /* @__PURE__ */ jsx12(ImageCheckbox, { label: "Clean the brush after each stroke", checked: mixer.cleanEachStroke, onChange: (on) => controller.setPaintOptions({ mixer: { cleanEachStroke: on } }) }),
2363
+ /* @__PURE__ */ jsx13(ImageCheckbox, { label: "Clean the brush after each stroke", checked: mixer.cleanEachStroke, onChange: (on) => controller.setPaintOptions({ mixer: { cleanEachStroke: on } }) }),
2316
2364
  "Clean each stroke"
2317
2365
  ] })
2318
2366
  ] })
2319
2367
  ] }),
2320
2368
  isRetouchPaintTool(tool) && /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-2 border-t border-border pt-2", role: "group", "aria-label": "Retouch options", "data-testid": "retouch-options", children: [
2321
2369
  (tool === "clone" || tool === "heal") && /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
2322
- /* @__PURE__ */ jsx12("span", { className: "text-muted-foreground", "data-testid": "clone-source", children: cloneSourceLabel(controller) }),
2323
- cloneSource && /* @__PURE__ */ jsx12("button", { type: "button", title: "Forget the source point", className: imageChipClass(false), onClick: () => controller.setCloneSource(null), children: "Clear source" })
2370
+ /* @__PURE__ */ jsx13("span", { className: "text-muted-foreground", "data-testid": "clone-source", children: cloneSourceLabel(controller) }),
2371
+ cloneSource && /* @__PURE__ */ jsx13("button", { type: "button", title: "Forget the source point", className: imageChipClass(false), onClick: () => controller.setCloneSource(null), children: "Clear source" })
2324
2372
  ] }),
2325
2373
  (tool === "clone" || tool === "heal") && /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-1", role: "group", "aria-label": "Clone source transform", "data-testid": "clone-transform", children: [
2326
- CLONE_TRANSFORM_CONTROLS.map((spec) => /* @__PURE__ */ jsx12(ControlSlider, { spec, value: cloneTransformView(controller)[spec.id], onChange: (v) => setCloneTransformValue(controller, spec.id, v) }, spec.id)),
2374
+ CLONE_TRANSFORM_CONTROLS.map((spec) => /* @__PURE__ */ jsx13(ControlSlider, { spec, value: cloneTransformView(controller)[spec.id], onChange: (v) => setCloneTransformValue(controller, spec.id, v) }, spec.id)),
2327
2375
  /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-1", children: [
2328
- /* @__PURE__ */ jsx12("button", { type: "button", "aria-pressed": cloneTransformView(controller).flipH, title: "Mirror the source left to right", className: imageChipClass(cloneTransformView(controller).flipH), onClick: () => setCloneTransformValue(controller, "flipH"), children: "Flip H" }),
2329
- /* @__PURE__ */ jsx12("button", { type: "button", "aria-pressed": cloneTransformView(controller).flipV, title: "Mirror the source top to bottom", className: imageChipClass(cloneTransformView(controller).flipV), onClick: () => setCloneTransformValue(controller, "flipV"), children: "Flip V" }),
2330
- !cloneTransformView(controller).identity && /* @__PURE__ */ jsx12("button", { type: "button", title: "Back to 100 %, no flip, 0\xB0", className: imageChipClass(false), onClick: () => controller.setCloneTransform(null), children: "Reset transform" })
2376
+ /* @__PURE__ */ jsx13("button", { type: "button", "aria-pressed": cloneTransformView(controller).flipH, title: "Mirror the source left to right", className: imageChipClass(cloneTransformView(controller).flipH), onClick: () => setCloneTransformValue(controller, "flipH"), children: "Flip H" }),
2377
+ /* @__PURE__ */ jsx13("button", { type: "button", "aria-pressed": cloneTransformView(controller).flipV, title: "Mirror the source top to bottom", className: imageChipClass(cloneTransformView(controller).flipV), onClick: () => setCloneTransformValue(controller, "flipV"), children: "Flip V" }),
2378
+ !cloneTransformView(controller).identity && /* @__PURE__ */ jsx13("button", { type: "button", title: "Back to 100 %, no flip, 0\xB0", className: imageChipClass(false), onClick: () => controller.setCloneTransform(null), children: "Reset transform" })
2331
2379
  ] })
2332
2380
  ] }),
2333
2381
  RETOUCH_CHOICES.filter((c) => c.tools.includes(tool)).map((choice) => /* @__PURE__ */ jsxs11("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": choice.label, children: [
2334
- /* @__PURE__ */ jsx12("span", { className: "text-muted-foreground", children: choice.label }),
2335
- choice.options.map((o) => /* @__PURE__ */ jsx12(
2382
+ /* @__PURE__ */ jsx13("span", { className: "text-muted-foreground", children: choice.label }),
2383
+ choice.options.map((o) => /* @__PURE__ */ jsx13(
2336
2384
  "button",
2337
2385
  {
2338
2386
  type: "button",
@@ -2345,34 +2393,34 @@ var BrushOptionsBar = ({ controller, className }) => {
2345
2393
  o.id
2346
2394
  ))
2347
2395
  ] }, choice.id)),
2348
- RETOUCH_OPTION_CONTROLS.filter((c) => c.tools.includes(tool)).map((spec) => /* @__PURE__ */ jsx12(ControlSlider, { spec, value: retouch[spec.id], onChange: (v) => controller.setPaintOptions({ retouch: { [spec.id]: v } }) }, spec.id)),
2349
- /* @__PURE__ */ jsx12("div", { className: "flex flex-wrap gap-3 text-foreground", children: RETOUCH_TOGGLES.filter((t) => t.tools.includes(tool)).map((t) => /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1.5", children: [
2350
- /* @__PURE__ */ jsx12(ImageCheckbox, { label: t.label, checked: retouch[t.id], onChange: (on) => controller.setPaintOptions({ retouch: { [t.id]: on } }) }),
2396
+ RETOUCH_OPTION_CONTROLS.filter((c) => c.tools.includes(tool)).map((spec) => /* @__PURE__ */ jsx13(ControlSlider, { spec, value: retouch[spec.id], onChange: (v) => controller.setPaintOptions({ retouch: { [spec.id]: v } }) }, spec.id)),
2397
+ /* @__PURE__ */ jsx13("div", { className: "flex flex-wrap gap-3 text-foreground", children: RETOUCH_TOGGLES.filter((t) => t.tools.includes(tool)).map((t) => /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1.5", children: [
2398
+ /* @__PURE__ */ jsx13(ImageCheckbox, { label: t.label, checked: retouch[t.id], onChange: (on) => controller.setPaintOptions({ retouch: { [t.id]: on } }) }),
2351
2399
  t.label
2352
2400
  ] }, t.id)) })
2353
2401
  ] }),
2354
2402
  /* @__PURE__ */ jsxs11("div", { className: "flex flex-wrap gap-3 text-foreground", role: "group", "aria-label": "Pressure", children: [
2355
2403
  /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1.5", children: [
2356
- /* @__PURE__ */ jsx12(ImageCheckbox, { label: "Pressure controls size", checked: brush.pressureSize, onChange: (on) => controller.setPaintOptions({ brush: { pressureSize: on } }) }),
2404
+ /* @__PURE__ */ jsx13(ImageCheckbox, { label: "Pressure controls size", checked: brush.pressureSize, onChange: (on) => controller.setPaintOptions({ brush: { pressureSize: on } }) }),
2357
2405
  "Pressure size"
2358
2406
  ] }),
2359
2407
  /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1.5", children: [
2360
- /* @__PURE__ */ jsx12(ImageCheckbox, { label: "Pressure controls opacity", checked: brush.pressureOpacity, onChange: (on) => controller.setPaintOptions({ brush: { pressureOpacity: on } }) }),
2408
+ /* @__PURE__ */ jsx13(ImageCheckbox, { label: "Pressure controls opacity", checked: brush.pressureOpacity, onChange: (on) => controller.setPaintOptions({ brush: { pressureOpacity: on } }) }),
2361
2409
  "Pressure opacity"
2362
2410
  ] })
2363
2411
  ] }),
2364
2412
  /* @__PURE__ */ jsxs11("div", { className: "flex gap-1", children: [
2365
- /* @__PURE__ */ jsx12("button", { type: "button", className: imageChipClass(false), onClick: () => attempt(() => controller.fillPixels()), children: "Fill" }),
2366
- /* @__PURE__ */ jsx12("button", { type: "button", className: imageChipClass(false), onClick: () => attempt(() => controller.clearPixels()), children: "Clear" })
2413
+ /* @__PURE__ */ jsx13("button", { type: "button", className: imageChipClass(false), onClick: () => attempt(() => controller.fillPixels()), children: "Fill" }),
2414
+ /* @__PURE__ */ jsx13("button", { type: "button", className: imageChipClass(false), onClick: () => attempt(() => controller.clearPixels()), children: "Clear" })
2367
2415
  ] }),
2368
- error && /* @__PURE__ */ jsx12("p", { role: "alert", className: "text-destructive", children: error })
2416
+ error && /* @__PURE__ */ jsx13("p", { role: "alert", className: "text-destructive", children: error })
2369
2417
  ] });
2370
2418
  };
2371
2419
 
2372
2420
  // src/image-editor/ColorProfilePanel.tsx
2373
2421
  import { useEffect as useEffect9, useState as useState10 } from "react";
2374
2422
  import { COLOR_MODE_OPTIONS, INTENT_OPTIONS, PROOF_PROFILE_OPTIONS, WORKING_SPACE_OPTIONS, colorPanelView } from "@pixerate/editor/image-editor";
2375
- import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
2423
+ import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
2376
2424
  var chip = imageChipClass(false);
2377
2425
  var select = "rounded bg-muted px-1 py-0.5 text-[11px] text-foreground";
2378
2426
  var ColorProfilePanel = ({ controller, className }) => {
@@ -2405,26 +2453,26 @@ var ColorProfilePanel = ({ controller, className }) => {
2405
2453
  };
2406
2454
  return /* @__PURE__ */ jsxs12("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "color-profile-panel", children: [
2407
2455
  /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2", children: [
2408
- /* @__PURE__ */ jsx13("span", { className: "text-muted-foreground", children: "Profile" }),
2409
- /* @__PURE__ */ jsx13("span", { "data-testid": "color-profile-name", children: view.profileName })
2456
+ /* @__PURE__ */ jsx14("span", { className: "text-muted-foreground", children: "Profile" }),
2457
+ /* @__PURE__ */ jsx14("span", { "data-testid": "color-profile-name", children: view.profileName })
2410
2458
  ] }),
2411
2459
  /* @__PURE__ */ jsxs12("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": "Colour mode", children: [
2412
- /* @__PURE__ */ jsx13("span", { className: "text-muted-foreground", children: "Mode" }),
2413
- /* @__PURE__ */ jsx13("select", { "aria-label": "Colour mode", className: select, value: view.mode, onChange: (e) => attempt(() => controller.setColorMode(e.target.value)), children: COLOR_MODE_OPTIONS.map((o) => /* @__PURE__ */ jsx13("option", { value: o.id, title: o.title, children: o.label }, o.id)) }),
2414
- view.cmykProfileName && /* @__PURE__ */ jsx13("span", { className: "text-muted-foreground", children: view.cmykProfileName })
2460
+ /* @__PURE__ */ jsx14("span", { className: "text-muted-foreground", children: "Mode" }),
2461
+ /* @__PURE__ */ jsx14("select", { "aria-label": "Colour mode", className: select, value: view.mode, onChange: (e) => attempt(() => controller.setColorMode(e.target.value)), children: COLOR_MODE_OPTIONS.map((o) => /* @__PURE__ */ jsx14("option", { value: o.id, title: o.title, children: o.label }, o.id)) }),
2462
+ view.cmykProfileName && /* @__PURE__ */ jsx14("span", { className: "text-muted-foreground", children: view.cmykProfileName })
2415
2463
  ] }),
2416
2464
  /* @__PURE__ */ jsxs12("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": "Assign or convert", children: [
2417
- /* @__PURE__ */ jsx13("select", { "aria-label": "Target profile", className: select, value: target, onChange: (e) => setTarget(e.target.value), children: WORKING_SPACE_OPTIONS.map((o) => /* @__PURE__ */ jsx13("option", { value: o.id, children: o.label }, o.id)) }),
2418
- /* @__PURE__ */ jsx13("select", { "aria-label": "Rendering intent", className: select, value: intent, onChange: (e) => setIntent(e.target.value), children: INTENT_OPTIONS.map((o) => /* @__PURE__ */ jsx13("option", { value: o.id, title: o.title, children: o.label }, o.id)) }),
2465
+ /* @__PURE__ */ jsx14("select", { "aria-label": "Target profile", className: select, value: target, onChange: (e) => setTarget(e.target.value), children: WORKING_SPACE_OPTIONS.map((o) => /* @__PURE__ */ jsx14("option", { value: o.id, children: o.label }, o.id)) }),
2466
+ /* @__PURE__ */ jsx14("select", { "aria-label": "Rendering intent", className: select, value: intent, onChange: (e) => setIntent(e.target.value), children: INTENT_OPTIONS.map((o) => /* @__PURE__ */ jsx14("option", { value: o.id, title: o.title, children: o.label }, o.id)) }),
2419
2467
  /* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1", children: [
2420
- /* @__PURE__ */ jsx13("input", { type: "checkbox", "aria-label": "Black point compensation", checked: bpc, onChange: (e) => setBpc(e.target.checked), className: "accent-primary" }),
2468
+ /* @__PURE__ */ jsx14("input", { type: "checkbox", "aria-label": "Black point compensation", checked: bpc, onChange: (e) => setBpc(e.target.checked), className: "accent-primary" }),
2421
2469
  "BPC"
2422
2470
  ] }),
2423
- /* @__PURE__ */ jsx13("button", { type: "button", className: chip, title: "Edit \u203A Assign Profile: keep the numbers", onClick: () => attempt(() => controller.assignProfile(target)), children: "Assign" }),
2424
- /* @__PURE__ */ jsx13("button", { type: "button", className: chip, title: "Edit \u203A Convert to Profile: keep the look", onClick: () => attempt(() => controller.convertToProfile(target, { intent, bpc })), children: "Convert" })
2471
+ /* @__PURE__ */ jsx14("button", { type: "button", className: chip, title: "Edit \u203A Assign Profile: keep the numbers", onClick: () => attempt(() => controller.assignProfile(target)), children: "Assign" }),
2472
+ /* @__PURE__ */ jsx14("button", { type: "button", className: chip, title: "Edit \u203A Convert to Profile: keep the look", onClick: () => attempt(() => controller.convertToProfile(target, { intent, bpc })), children: "Convert" })
2425
2473
  ] }),
2426
2474
  /* @__PURE__ */ jsxs12("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": "Proof setup", children: [
2427
- /* @__PURE__ */ jsx13("span", { className: "text-muted-foreground", children: "Proof" }),
2475
+ /* @__PURE__ */ jsx14("span", { className: "text-muted-foreground", children: "Proof" }),
2428
2476
  /* @__PURE__ */ jsxs12(
2429
2477
  "select",
2430
2478
  {
@@ -2433,24 +2481,24 @@ var ColorProfilePanel = ({ controller, className }) => {
2433
2481
  value: view.proof?.id ?? "",
2434
2482
  onChange: (e) => e.target.value ? proofWith({ id: e.target.value }) : attempt(() => controller.setProofSetup(null)),
2435
2483
  children: [
2436
- /* @__PURE__ */ jsx13("option", { value: "", children: "Off" }),
2437
- PROOF_PROFILE_OPTIONS.map((o) => /* @__PURE__ */ jsx13("option", { value: o.id, children: o.label }, o.id))
2484
+ /* @__PURE__ */ jsx14("option", { value: "", children: "Off" }),
2485
+ PROOF_PROFILE_OPTIONS.map((o) => /* @__PURE__ */ jsx14("option", { value: o.id, children: o.label }, o.id))
2438
2486
  ]
2439
2487
  }
2440
2488
  ),
2441
2489
  view.proof && /* @__PURE__ */ jsxs12(Fragment2, { children: [
2442
- /* @__PURE__ */ jsx13("select", { "aria-label": "Proof intent", className: select, value: view.proof.intent, onChange: (e) => proofWith({ intent: e.target.value }), children: INTENT_OPTIONS.map((o) => /* @__PURE__ */ jsx13("option", { value: o.id, children: o.label }, o.id)) }),
2490
+ /* @__PURE__ */ jsx14("select", { "aria-label": "Proof intent", className: select, value: view.proof.intent, onChange: (e) => proofWith({ intent: e.target.value }), children: INTENT_OPTIONS.map((o) => /* @__PURE__ */ jsx14("option", { value: o.id, children: o.label }, o.id)) }),
2443
2491
  /* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1", children: [
2444
- /* @__PURE__ */ jsx13("input", { type: "checkbox", "aria-label": "Simulate paper colour", checked: view.proof.simulatePaper, onChange: (e) => proofWith({ simulatePaper: e.target.checked }), className: "accent-primary" }),
2492
+ /* @__PURE__ */ jsx14("input", { type: "checkbox", "aria-label": "Simulate paper colour", checked: view.proof.simulatePaper, onChange: (e) => proofWith({ simulatePaper: e.target.checked }), className: "accent-primary" }),
2445
2493
  "Paper"
2446
2494
  ] }),
2447
2495
  /* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1", children: [
2448
- /* @__PURE__ */ jsx13("input", { type: "checkbox", "aria-label": "Gamut warning", checked: view.proof.gamutWarning, onChange: (e) => proofWith({ gamutWarning: e.target.checked }), className: "accent-primary" }),
2496
+ /* @__PURE__ */ jsx14("input", { type: "checkbox", "aria-label": "Gamut warning", checked: view.proof.gamutWarning, onChange: (e) => proofWith({ gamutWarning: e.target.checked }), className: "accent-primary" }),
2449
2497
  "Gamut warning"
2450
2498
  ] })
2451
2499
  ] })
2452
2500
  ] }),
2453
- error && /* @__PURE__ */ jsx13("p", { role: "alert", className: "text-destructive", children: error })
2501
+ error && /* @__PURE__ */ jsx14("p", { role: "alert", className: "text-destructive", children: error })
2454
2502
  ] });
2455
2503
  };
2456
2504
 
@@ -2462,7 +2510,7 @@ import {
2462
2510
  SELECTION_TOOLS,
2463
2511
  describeSelection
2464
2512
  } from "@pixerate/editor/image-editor";
2465
- import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
2513
+ import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
2466
2514
  var MODIFY_OPS = [
2467
2515
  { op: "grow", label: "Grow" },
2468
2516
  { op: "shrink", label: "Shrink" },
@@ -2484,27 +2532,27 @@ var SelectionOptionsBar = ({
2484
2532
  const sel = selection === void 0 ? controller.getSelection() : selection;
2485
2533
  const qm = quickMask ?? Boolean(controller.getState().quickMask);
2486
2534
  return /* @__PURE__ */ jsxs13("div", { "data-testid": "selection-options-bar", className: `flex flex-col gap-3 text-xs ${className}`, children: [
2487
- /* @__PURE__ */ jsx14("div", { role: "group", "aria-label": "Selection tool", className: "flex flex-wrap gap-1", children: SELECTION_TOOLS.map((t) => /* @__PURE__ */ jsx14("button", { type: "button", "aria-pressed": options.tool === t.id, className: btn(options.tool === t.id), onClick: () => set({ tool: t.id }), children: t.label }, t.id)) }),
2488
- /* @__PURE__ */ jsx14("div", { role: "group", "aria-label": "Selection mode", className: "flex flex-wrap gap-1", children: SELECTION_MODES.map((m) => /* @__PURE__ */ jsx14("button", { type: "button", "aria-pressed": options.mode === m, className: btn(options.mode === m), onClick: () => set({ mode: m }), children: SELECTION_MODE_LABELS[m] }, m)) }),
2535
+ /* @__PURE__ */ jsx15("div", { role: "group", "aria-label": "Selection tool", className: "flex flex-wrap gap-1", children: SELECTION_TOOLS.map((t) => /* @__PURE__ */ jsx15("button", { type: "button", "aria-pressed": options.tool === t.id, className: btn(options.tool === t.id), onClick: () => set({ tool: t.id }), children: t.label }, t.id)) }),
2536
+ /* @__PURE__ */ jsx15("div", { role: "group", "aria-label": "Selection mode", className: "flex flex-wrap gap-1", children: SELECTION_MODES.map((m) => /* @__PURE__ */ jsx15("button", { type: "button", "aria-pressed": options.mode === m, className: btn(options.mode === m), onClick: () => set({ mode: m }), children: SELECTION_MODE_LABELS[m] }, m)) }),
2489
2537
  options.tool === "wand" && /* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-2", children: [
2490
2538
  /* @__PURE__ */ jsxs13("label", { className: "flex flex-col gap-1", children: [
2491
2539
  /* @__PURE__ */ jsxs13("span", { className: "flex justify-between text-muted-foreground", children: [
2492
- /* @__PURE__ */ jsx14("span", { children: "Tolerance" }),
2493
- /* @__PURE__ */ jsx14("span", { className: "font-mono", children: options.tolerance })
2540
+ /* @__PURE__ */ jsx15("span", { children: "Tolerance" }),
2541
+ /* @__PURE__ */ jsx15("span", { className: "font-mono", children: options.tolerance })
2494
2542
  ] }),
2495
- /* @__PURE__ */ jsx14(ImageRange, { label: "Tolerance", min: 0, max: 255, step: 1, value: options.tolerance, onChange: (v) => set({ tolerance: v }) })
2543
+ /* @__PURE__ */ jsx15(ImageRange, { label: "Tolerance", min: 0, max: 255, step: 1, value: options.tolerance, onChange: (v) => set({ tolerance: v }) })
2496
2544
  ] }),
2497
2545
  /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-2 text-foreground", children: [
2498
- /* @__PURE__ */ jsx14(ImageCheckbox, { label: "Contiguous", checked: options.contiguous, onChange: (on) => set({ contiguous: on }) }),
2546
+ /* @__PURE__ */ jsx15(ImageCheckbox, { label: "Contiguous", checked: options.contiguous, onChange: (on) => set({ contiguous: on }) }),
2499
2547
  "Contiguous"
2500
2548
  ] }),
2501
2549
  /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-2 text-foreground", children: [
2502
- /* @__PURE__ */ jsx14(ImageCheckbox, { label: "Sample adjusted image", checked: options.sampleMerged, onChange: (on) => set({ sampleMerged: on }) }),
2550
+ /* @__PURE__ */ jsx15(ImageCheckbox, { label: "Sample adjusted image", checked: options.sampleMerged, onChange: (on) => set({ sampleMerged: on }) }),
2503
2551
  "Sample adjusted image"
2504
2552
  ] }),
2505
2553
  /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-2 text-foreground", children: [
2506
2554
  "Sample",
2507
- /* @__PURE__ */ jsx14(
2555
+ /* @__PURE__ */ jsx15(
2508
2556
  ImageSelect,
2509
2557
  {
2510
2558
  label: "Sample from",
@@ -2519,19 +2567,19 @@ var SelectionOptionsBar = ({
2519
2567
  ] })
2520
2568
  ] }),
2521
2569
  /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-2 text-foreground", children: [
2522
- /* @__PURE__ */ jsx14(ImageCheckbox, { label: "Anti-alias", checked: options.antiAlias, onChange: (on) => set({ antiAlias: on }) }),
2570
+ /* @__PURE__ */ jsx15(ImageCheckbox, { label: "Anti-alias", checked: options.antiAlias, onChange: (on) => set({ antiAlias: on }) }),
2523
2571
  "Anti-alias"
2524
2572
  ] }),
2525
2573
  /* @__PURE__ */ jsxs13("div", { className: "flex flex-wrap gap-1", children: [
2526
- /* @__PURE__ */ jsx14("button", { type: "button", className: btn(false), onClick: () => controller.selectAll(), children: "Select All" }),
2527
- /* @__PURE__ */ jsx14("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => controller.deselect(), children: "Deselect" }),
2528
- /* @__PURE__ */ jsx14("button", { type: "button", className: btn(false), onClick: () => controller.invertSelection(), children: "Inverse" }),
2529
- /* @__PURE__ */ jsx14("button", { type: "button", "aria-pressed": qm, className: btn(qm), onClick: () => controller.setQuickMask(!qm), children: "Quick Mask" })
2574
+ /* @__PURE__ */ jsx15("button", { type: "button", className: btn(false), onClick: () => controller.selectAll(), children: "Select All" }),
2575
+ /* @__PURE__ */ jsx15("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => controller.deselect(), children: "Deselect" }),
2576
+ /* @__PURE__ */ jsx15("button", { type: "button", className: btn(false), onClick: () => controller.invertSelection(), children: "Inverse" }),
2577
+ /* @__PURE__ */ jsx15("button", { type: "button", "aria-pressed": qm, className: btn(qm), onClick: () => controller.setQuickMask(!qm), children: "Quick Mask" })
2530
2578
  ] }),
2531
2579
  /* @__PURE__ */ jsxs13("div", { className: "flex flex-wrap items-center gap-1", children: [
2532
2580
  /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
2533
2581
  "Radius",
2534
- /* @__PURE__ */ jsx14(
2582
+ /* @__PURE__ */ jsx15(
2535
2583
  "input",
2536
2584
  {
2537
2585
  type: "number",
@@ -2545,9 +2593,9 @@ var SelectionOptionsBar = ({
2545
2593
  }
2546
2594
  )
2547
2595
  ] }),
2548
- MODIFY_OPS.map(({ op, label }) => /* @__PURE__ */ jsx14("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => controller.modifySelection(op, radius), children: label }, op))
2596
+ MODIFY_OPS.map(({ op, label }) => /* @__PURE__ */ jsx15("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => controller.modifySelection(op, radius), children: label }, op))
2549
2597
  ] }),
2550
- /* @__PURE__ */ jsx14("p", { "data-testid": "selection-status", className: "text-muted-foreground", children: describeSelection(sel) })
2598
+ /* @__PURE__ */ jsx15("p", { "data-testid": "selection-status", className: "text-muted-foreground", children: describeSelection(sel) })
2551
2599
  ] });
2552
2600
  };
2553
2601
 
@@ -2559,7 +2607,7 @@ import {
2559
2607
  adjustmentKindLabel as adjustmentKindLabel2,
2560
2608
  layerMaskFromSelection
2561
2609
  } from "@pixerate/editor/image-editor";
2562
- import { Fragment as Fragment3, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
2610
+ import { Fragment as Fragment3, jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
2563
2611
  var DEFAULT_PARAMS = { radius: 8, smartRadius: false, smooth: 0, feather: 0, contrast: 0, shiftEdge: 0 };
2564
2612
  var button = "px-2 py-1 rounded-md border border-border bg-background text-[11px] text-foreground hover:bg-accent hover:text-accent-foreground disabled:opacity-40";
2565
2613
  var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
@@ -2583,16 +2631,16 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
2583
2631
  }
2584
2632
  };
2585
2633
  return /* @__PURE__ */ jsxs14("div", { "data-testid": "refine-edge-panel", className: `flex flex-col gap-3 text-xs ${className}`, children: [
2586
- /* @__PURE__ */ jsx15("span", { className: imageSectionTitleClass, children: "Refine Edge" }),
2634
+ /* @__PURE__ */ jsx16("span", { className: imageSectionTitleClass, children: "Refine Edge" }),
2587
2635
  REFINE_EDGE_CONTROLS.map((c) => /* @__PURE__ */ jsxs14("label", { className: "flex flex-col gap-1", children: [
2588
2636
  /* @__PURE__ */ jsxs14("span", { className: "flex justify-between text-muted-foreground", children: [
2589
- /* @__PURE__ */ jsx15("span", { children: c.label }),
2637
+ /* @__PURE__ */ jsx16("span", { children: c.label }),
2590
2638
  /* @__PURE__ */ jsxs14("span", { className: "font-mono", children: [
2591
2639
  params[c.id],
2592
2640
  c.unit
2593
2641
  ] })
2594
2642
  ] }),
2595
- /* @__PURE__ */ jsx15(
2643
+ /* @__PURE__ */ jsx16(
2596
2644
  "input",
2597
2645
  {
2598
2646
  type: "range",
@@ -2607,27 +2655,27 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
2607
2655
  )
2608
2656
  ] }, c.id)),
2609
2657
  /* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2 text-foreground", children: [
2610
- /* @__PURE__ */ jsx15("input", { type: "checkbox", checked: params.smartRadius, onChange: (e) => setParams({ ...params, smartRadius: e.target.checked }) }),
2658
+ /* @__PURE__ */ jsx16("input", { type: "checkbox", checked: params.smartRadius, onChange: (e) => setParams({ ...params, smartRadius: e.target.checked }) }),
2611
2659
  "Smart Radius"
2612
2660
  ] }),
2613
2661
  /* @__PURE__ */ jsxs14("div", { className: "flex gap-1", children: [
2614
- /* @__PURE__ */ jsx15("button", { type: "button", className: button, disabled: !sel || busy, onClick: refine, children: "Refine Edge" }),
2615
- /* @__PURE__ */ jsx15("button", { type: "button", className: button, onClick: () => setParams(DEFAULT_PARAMS), children: "Reset" })
2662
+ /* @__PURE__ */ jsx16("button", { type: "button", className: button, disabled: !sel || busy, onClick: refine, children: "Refine Edge" }),
2663
+ /* @__PURE__ */ jsx16("button", { type: "button", className: button, onClick: () => setParams(DEFAULT_PARAMS), children: "Reset" })
2616
2664
  ] }),
2617
- error && /* @__PURE__ */ jsx15("p", { role: "alert", className: "text-destructive", children: error }),
2618
- /* @__PURE__ */ jsx15("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] mt-2", children: "Layer Mask" }),
2665
+ error && /* @__PURE__ */ jsx16("p", { role: "alert", className: "text-destructive", children: error }),
2666
+ /* @__PURE__ */ jsx16("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] mt-2", children: "Layer Mask" }),
2619
2667
  /* @__PURE__ */ jsxs14("div", { className: "flex gap-1 items-center", children: [
2620
- /* @__PURE__ */ jsx15(
2668
+ /* @__PURE__ */ jsx16(
2621
2669
  "select",
2622
2670
  {
2623
2671
  "aria-label": "New masked layer kind",
2624
2672
  value: newKind,
2625
2673
  onChange: (e) => setNewKind(e.target.value),
2626
2674
  className: "flex-1 bg-background border border-border rounded px-1 py-1 text-foreground",
2627
- children: ADJUSTMENT_KINDS2.map((k) => /* @__PURE__ */ jsx15("option", { value: k.kind, children: k.label }, k.kind))
2675
+ children: ADJUSTMENT_KINDS2.map((k) => /* @__PURE__ */ jsx16("option", { value: k.kind, children: k.label }, k.kind))
2628
2676
  }
2629
2677
  ),
2630
- /* @__PURE__ */ jsx15(
2678
+ /* @__PURE__ */ jsx16(
2631
2679
  "button",
2632
2680
  {
2633
2681
  type: "button",
@@ -2639,7 +2687,7 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
2639
2687
  )
2640
2688
  ] }),
2641
2689
  list.length > 0 && target && /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-2", children: [
2642
- /* @__PURE__ */ jsx15(
2690
+ /* @__PURE__ */ jsx16(
2643
2691
  "select",
2644
2692
  {
2645
2693
  "aria-label": "Mask layer",
@@ -2653,20 +2701,20 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
2653
2701
  }
2654
2702
  ),
2655
2703
  /* @__PURE__ */ jsxs14("div", { className: "flex flex-wrap gap-1", children: [
2656
- /* @__PURE__ */ jsx15("button", { type: "button", className: button, disabled: !sel, onClick: () => controller.applySelectionAsLayerMask(target.id), children: "Mask with Selection" }),
2657
- /* @__PURE__ */ jsx15("button", { type: "button", className: button, disabled: !target.mask, onClick: () => controller.selectionFromLayerMask(target.id), children: "Load as Selection" }),
2658
- /* @__PURE__ */ jsx15("button", { type: "button", className: button, disabled: !target.mask, onClick: () => controller.setAdjustmentLayerMask(target.id, null), children: "Remove Mask" })
2704
+ /* @__PURE__ */ jsx16("button", { type: "button", className: button, disabled: !sel, onClick: () => controller.applySelectionAsLayerMask(target.id), children: "Mask with Selection" }),
2705
+ /* @__PURE__ */ jsx16("button", { type: "button", className: button, disabled: !target.mask, onClick: () => controller.selectionFromLayerMask(target.id), children: "Load as Selection" }),
2706
+ /* @__PURE__ */ jsx16("button", { type: "button", className: button, disabled: !target.mask, onClick: () => controller.setAdjustmentLayerMask(target.id, null), children: "Remove Mask" })
2659
2707
  ] }),
2660
2708
  target.mask && /* @__PURE__ */ jsxs14(Fragment3, { children: [
2661
2709
  /* @__PURE__ */ jsxs14("label", { className: "flex flex-col gap-1", children: [
2662
2710
  /* @__PURE__ */ jsxs14("span", { className: "flex justify-between text-muted-foreground", children: [
2663
- /* @__PURE__ */ jsx15("span", { children: "Density" }),
2711
+ /* @__PURE__ */ jsx16("span", { children: "Density" }),
2664
2712
  /* @__PURE__ */ jsxs14("span", { className: "font-mono", children: [
2665
2713
  Math.round((target.mask.density ?? 1) * 100),
2666
2714
  "%"
2667
2715
  ] })
2668
2716
  ] }),
2669
- /* @__PURE__ */ jsx15(
2717
+ /* @__PURE__ */ jsx16(
2670
2718
  "input",
2671
2719
  {
2672
2720
  type: "range",
@@ -2682,13 +2730,13 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
2682
2730
  ] }),
2683
2731
  /* @__PURE__ */ jsxs14("label", { className: "flex flex-col gap-1", children: [
2684
2732
  /* @__PURE__ */ jsxs14("span", { className: "flex justify-between text-muted-foreground", children: [
2685
- /* @__PURE__ */ jsx15("span", { children: "Mask Feather" }),
2733
+ /* @__PURE__ */ jsx16("span", { children: "Mask Feather" }),
2686
2734
  /* @__PURE__ */ jsxs14("span", { className: "font-mono", children: [
2687
2735
  target.mask.feather ?? 0,
2688
2736
  "px"
2689
2737
  ] })
2690
2738
  ] }),
2691
- /* @__PURE__ */ jsx15(
2739
+ /* @__PURE__ */ jsx16(
2692
2740
  "input",
2693
2741
  {
2694
2742
  type: "range",
@@ -2710,7 +2758,7 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
2710
2758
  // src/image-editor/FreeTransformOptionsBar.tsx
2711
2759
  import { useEffect as useEffect10, useState as useState13 } from "react";
2712
2760
  import { FREE_TRANSFORM_FIELDS, FREE_TRANSFORM_MODE_OPTIONS, INTERPOLATIONS, TRANSFORM_ANCHORS, WARP_GRID_OPTIONS, WARP_STYLE_OPTIONS } from "@pixerate/editor/image-editor";
2713
- import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
2761
+ import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
2714
2762
  var round = (v, unit) => unit === "px" ? Math.round(v * 10) / 10 : Math.round(v * 100) / 100;
2715
2763
  var FreeTransformOptionsBar = ({ tool, className }) => {
2716
2764
  const [, setTick] = useState13(0);
@@ -2727,16 +2775,16 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
2727
2775
  if (raw.trim() !== "" && Number.isFinite(v) && Math.abs(v - bar[field]) > 1e-9) tool.setField(field, v);
2728
2776
  };
2729
2777
  return /* @__PURE__ */ jsxs15("div", { className: `flex flex-wrap items-center gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "free-transform-options", role: "toolbar", "aria-label": "Free Transform options", children: [
2730
- /* @__PURE__ */ jsx16("div", { className: "flex gap-1", role: "group", "aria-label": "Transform mode", children: FREE_TRANSFORM_MODE_OPTIONS.map((m) => /* @__PURE__ */ jsx16("button", { type: "button", title: m.title, "aria-pressed": tool.mode === m.id, className: imageChipClass(tool.mode === m.id), onClick: () => tool.setMode(m.id), children: m.label }, m.id)) }),
2731
- /* @__PURE__ */ jsx16("div", { className: "grid grid-cols-3 gap-px", role: "group", "aria-label": "Reference point", children: TRANSFORM_ANCHORS.map((a) => /* @__PURE__ */ jsx16("button", { type: "button", "aria-label": `Reference point ${a}`, title: `Reference point: ${a}`, className: "h-2.5 w-2.5 rounded-sm bg-accent hover:bg-primary/90", onClick: () => tool.setReference(a) }, a)) }),
2778
+ /* @__PURE__ */ jsx17("div", { className: "flex gap-1", role: "group", "aria-label": "Transform mode", children: FREE_TRANSFORM_MODE_OPTIONS.map((m) => /* @__PURE__ */ jsx17("button", { type: "button", title: m.title, "aria-pressed": tool.mode === m.id, className: imageChipClass(tool.mode === m.id), onClick: () => tool.setMode(m.id), children: m.label }, m.id)) }),
2779
+ /* @__PURE__ */ jsx17("div", { className: "grid grid-cols-3 gap-px", role: "group", "aria-label": "Reference point", children: TRANSFORM_ANCHORS.map((a) => /* @__PURE__ */ jsx17("button", { type: "button", "aria-label": `Reference point ${a}`, title: `Reference point: ${a}`, className: "h-2.5 w-2.5 rounded-sm bg-accent hover:bg-primary/90", onClick: () => tool.setReference(a) }, a)) }),
2732
2780
  tool.mode === "warp" && /* @__PURE__ */ jsxs15("div", { className: "flex flex-wrap items-center gap-2", role: "group", "aria-label": "Warp options", children: [
2733
2781
  /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-1", children: [
2734
- /* @__PURE__ */ jsx16("span", { className: "text-muted-foreground", children: "Warp" }),
2735
- /* @__PURE__ */ jsx16("select", { "aria-label": "Warp style", value: warp.style, onChange: (e) => tool.setWarp({ style: e.target.value }), className: imageFieldClass, children: WARP_STYLE_OPTIONS.map((o) => /* @__PURE__ */ jsx16("option", { value: o.id, children: o.label }, o.id)) })
2782
+ /* @__PURE__ */ jsx17("span", { className: "text-muted-foreground", children: "Warp" }),
2783
+ /* @__PURE__ */ jsx17("select", { "aria-label": "Warp style", value: warp.style, onChange: (e) => tool.setWarp({ style: e.target.value }), className: imageFieldClass, children: WARP_STYLE_OPTIONS.map((o) => /* @__PURE__ */ jsx17("option", { value: o.id, children: o.label }, o.id)) })
2736
2784
  ] }),
2737
2785
  ["bend", "horizontal", "vertical"].map((k) => /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-1", children: [
2738
- /* @__PURE__ */ jsx16("span", { className: "text-muted-foreground", children: k === "bend" ? "Bend" : k === "horizontal" ? "H" : "V" }),
2739
- /* @__PURE__ */ jsx16(
2786
+ /* @__PURE__ */ jsx17("span", { className: "text-muted-foreground", children: k === "bend" ? "Bend" : k === "horizontal" ? "H" : "V" }),
2787
+ /* @__PURE__ */ jsx17(
2740
2788
  "input",
2741
2789
  {
2742
2790
  type: "number",
@@ -2757,9 +2805,9 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
2757
2805
  },
2758
2806
  `${k}:${warp[k]}`
2759
2807
  ),
2760
- /* @__PURE__ */ jsx16("span", { className: "text-muted-foreground", children: "%" })
2808
+ /* @__PURE__ */ jsx17("span", { className: "text-muted-foreground", children: "%" })
2761
2809
  ] }, k)),
2762
- /* @__PURE__ */ jsx16(
2810
+ /* @__PURE__ */ jsx17(
2763
2811
  "button",
2764
2812
  {
2765
2813
  type: "button",
@@ -2772,8 +2820,8 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
2772
2820
  }
2773
2821
  ),
2774
2822
  /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-1", children: [
2775
- /* @__PURE__ */ jsx16("span", { className: "text-muted-foreground", children: "Grid" }),
2776
- /* @__PURE__ */ jsx16(
2823
+ /* @__PURE__ */ jsx17("span", { className: "text-muted-foreground", children: "Grid" }),
2824
+ /* @__PURE__ */ jsx17(
2777
2825
  "select",
2778
2826
  {
2779
2827
  "aria-label": "Warp grid",
@@ -2783,14 +2831,14 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
2783
2831
  tool.setWarp({ columns: g.columns, rows: g.rows });
2784
2832
  },
2785
2833
  className: imageFieldClass,
2786
- children: WARP_GRID_OPTIONS.map((g) => /* @__PURE__ */ jsx16("option", { value: g.id, children: g.label }, g.id))
2834
+ children: WARP_GRID_OPTIONS.map((g) => /* @__PURE__ */ jsx17("option", { value: g.id, children: g.label }, g.id))
2787
2835
  }
2788
2836
  )
2789
2837
  ] })
2790
2838
  ] }),
2791
2839
  tool.mode !== "warp" && FREE_TRANSFORM_FIELDS.map((f) => /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-1", title: f.title, children: [
2792
- /* @__PURE__ */ jsx16("span", { className: "text-muted-foreground", children: f.label }),
2793
- /* @__PURE__ */ jsx16(
2840
+ /* @__PURE__ */ jsx17("span", { className: "text-muted-foreground", children: f.label }),
2841
+ /* @__PURE__ */ jsx17(
2794
2842
  "input",
2795
2843
  {
2796
2844
  type: "number",
@@ -2810,8 +2858,8 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
2810
2858
  },
2811
2859
  `${f.id}:${round(bar[f.id], f.unit)}`
2812
2860
  ),
2813
- /* @__PURE__ */ jsx16("span", { className: "text-muted-foreground", children: f.unit }),
2814
- f.id === "scaleX" && /* @__PURE__ */ jsx16(
2861
+ /* @__PURE__ */ jsx17("span", { className: "text-muted-foreground", children: f.unit }),
2862
+ f.id === "scaleX" && /* @__PURE__ */ jsx17(
2815
2863
  "button",
2816
2864
  {
2817
2865
  type: "button",
@@ -2827,28 +2875,28 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
2827
2875
  )
2828
2876
  ] }, f.id)),
2829
2877
  /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-1", children: [
2830
- /* @__PURE__ */ jsx16("span", { className: "text-muted-foreground", children: "Interpolation" }),
2831
- /* @__PURE__ */ jsx16(
2878
+ /* @__PURE__ */ jsx17("span", { className: "text-muted-foreground", children: "Interpolation" }),
2879
+ /* @__PURE__ */ jsx17(
2832
2880
  "select",
2833
2881
  {
2834
2882
  "aria-label": "Interpolation",
2835
2883
  value: tool.interpolation,
2836
2884
  onChange: (e) => tool.setInterpolation(e.target.value),
2837
2885
  className: imageFieldClass,
2838
- children: INTERPOLATIONS.map((i) => /* @__PURE__ */ jsx16("option", { value: i, children: i[0].toUpperCase() + i.slice(1) }, i))
2886
+ children: INTERPOLATIONS.map((i) => /* @__PURE__ */ jsx17("option", { value: i, children: i[0].toUpperCase() + i.slice(1) }, i))
2839
2887
  }
2840
2888
  )
2841
2889
  ] }),
2842
- /* @__PURE__ */ jsx16("button", { type: "button", title: "Commit (Enter)", className: "px-2 py-1 rounded bg-primary text-primary-foreground hover:bg-primary/90", onClick: () => tool.commit(), children: "Commit" }),
2843
- /* @__PURE__ */ jsx16("button", { type: "button", title: "Cancel (Esc)", className: imageChipClass(false), onClick: () => tool.cancel(), children: "Cancel" }),
2844
- tool.error && /* @__PURE__ */ jsx16("span", { role: "alert", className: "text-destructive", children: tool.error })
2890
+ /* @__PURE__ */ jsx17("button", { type: "button", title: "Commit (Enter)", className: "px-2 py-1 rounded bg-primary text-primary-foreground hover:bg-primary/90", onClick: () => tool.commit(), children: "Commit" }),
2891
+ /* @__PURE__ */ jsx17("button", { type: "button", title: "Cancel (Esc)", className: imageChipClass(false), onClick: () => tool.cancel(), children: "Cancel" }),
2892
+ tool.error && /* @__PURE__ */ jsx17("span", { role: "alert", className: "text-destructive", children: tool.error })
2845
2893
  ] });
2846
2894
  };
2847
2895
 
2848
2896
  // src/image-editor/ShapeOptionsBar.tsx
2849
2897
  import { useEffect as useEffect11, useState as useState14 } from "react";
2850
2898
  import { LIVE_SHAPE_KINDS, SHAPE_KIND_LABELS, applyShapeOptions } from "@pixerate/editor/image-editor";
2851
- import { Fragment as Fragment4, jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
2899
+ import { Fragment as Fragment4, jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
2852
2900
  var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
2853
2901
  const [, setTick] = useState14(0);
2854
2902
  useEffect11(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
@@ -2867,12 +2915,12 @@ var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
2867
2915
  };
2868
2916
  const num = (v, min, max) => Math.max(min, Math.min(max, Number(v) || min));
2869
2917
  return /* @__PURE__ */ jsxs16("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "shape-options", children: [
2870
- /* @__PURE__ */ jsx17("div", { className: "flex flex-wrap gap-1", role: "toolbar", "aria-label": "Shape kind", children: LIVE_SHAPE_KINDS.map((k) => /* @__PURE__ */ jsx17("button", { type: "button", "aria-pressed": options.kind === k, className: imageChipClass(options.kind === k), onClick: () => onChange({ ...options, kind: k }), children: SHAPE_KIND_LABELS[k] }, k)) }),
2918
+ /* @__PURE__ */ jsx18("div", { className: "flex flex-wrap gap-1", role: "toolbar", "aria-label": "Shape kind", children: LIVE_SHAPE_KINDS.map((k) => /* @__PURE__ */ jsx18("button", { type: "button", "aria-pressed": options.kind === k, className: imageChipClass(options.kind === k), onClick: () => onChange({ ...options, kind: k }), children: SHAPE_KIND_LABELS[k] }, k)) }),
2871
2919
  /* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap items-center gap-3", children: [
2872
2920
  /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
2873
- /* @__PURE__ */ jsx17(ImageCheckbox, { label: "Fill", checked: options.fill !== null, onChange: (on) => set({ fill: on ? "#4f46e5" : null }) }),
2921
+ /* @__PURE__ */ jsx18(ImageCheckbox, { label: "Fill", checked: options.fill !== null, onChange: (on) => set({ fill: on ? "#4f46e5" : null }) }),
2874
2922
  "Fill",
2875
- /* @__PURE__ */ jsx17(
2923
+ /* @__PURE__ */ jsx18(
2876
2924
  "input",
2877
2925
  {
2878
2926
  type: "color",
@@ -2885,9 +2933,9 @@ var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
2885
2933
  )
2886
2934
  ] }),
2887
2935
  /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
2888
- /* @__PURE__ */ jsx17(ImageCheckbox, { label: "Stroke", checked: options.stroke !== null, onChange: (on) => set({ stroke: on ? "#000000" : null }) }),
2936
+ /* @__PURE__ */ jsx18(ImageCheckbox, { label: "Stroke", checked: options.stroke !== null, onChange: (on) => set({ stroke: on ? "#000000" : null }) }),
2889
2937
  "Stroke",
2890
- /* @__PURE__ */ jsx17(
2938
+ /* @__PURE__ */ jsx18(
2891
2939
  "input",
2892
2940
  {
2893
2941
  type: "color",
@@ -2901,7 +2949,7 @@ var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
2901
2949
  ] }),
2902
2950
  /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
2903
2951
  "Width",
2904
- /* @__PURE__ */ jsx17(
2952
+ /* @__PURE__ */ jsx18(
2905
2953
  "input",
2906
2954
  {
2907
2955
  type: "number",
@@ -2918,42 +2966,42 @@ var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
2918
2966
  /* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap items-center gap-3", children: [
2919
2967
  options.kind === "rect" && /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
2920
2968
  "Radius",
2921
- /* @__PURE__ */ jsx17("input", { type: "number", "aria-label": "Corner radius", min: 0, max: 1e3, value: options.radius, onChange: (e) => set({ radius: num(e.target.value, 0, 1e3) }), className: `w-14 ${imageFieldClass}` })
2969
+ /* @__PURE__ */ jsx18("input", { type: "number", "aria-label": "Corner radius", min: 0, max: 1e3, value: options.radius, onChange: (e) => set({ radius: num(e.target.value, 0, 1e3) }), className: `w-14 ${imageFieldClass}` })
2922
2970
  ] }),
2923
2971
  options.kind === "polygon" && /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
2924
2972
  "Sides",
2925
- /* @__PURE__ */ jsx17("input", { type: "number", "aria-label": "Sides", min: 3, max: 100, value: options.sides, onChange: (e) => set({ sides: num(e.target.value, 3, 100) }), className: `w-14 ${imageFieldClass}` })
2973
+ /* @__PURE__ */ jsx18("input", { type: "number", "aria-label": "Sides", min: 3, max: 100, value: options.sides, onChange: (e) => set({ sides: num(e.target.value, 3, 100) }), className: `w-14 ${imageFieldClass}` })
2926
2974
  ] }),
2927
2975
  options.kind === "star" && /* @__PURE__ */ jsxs16(Fragment4, { children: [
2928
2976
  /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
2929
2977
  "Points",
2930
- /* @__PURE__ */ jsx17("input", { type: "number", "aria-label": "Points", min: 3, max: 100, value: options.points, onChange: (e) => set({ points: num(e.target.value, 3, 100) }), className: `w-14 ${imageFieldClass}` })
2978
+ /* @__PURE__ */ jsx18("input", { type: "number", "aria-label": "Points", min: 3, max: 100, value: options.points, onChange: (e) => set({ points: num(e.target.value, 3, 100) }), className: `w-14 ${imageFieldClass}` })
2931
2979
  ] }),
2932
2980
  /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
2933
2981
  "Inner",
2934
- /* @__PURE__ */ jsx17(ImageRange, { label: "Inner radius", min: 0.05, max: 1, step: 0.05, value: options.innerRatio, onChange: (v) => set({ innerRatio: v }) })
2982
+ /* @__PURE__ */ jsx18(ImageRange, { label: "Inner radius", min: 0.05, max: 1, step: 0.05, value: options.innerRatio, onChange: (v) => set({ innerRatio: v }) })
2935
2983
  ] })
2936
2984
  ] }),
2937
2985
  options.kind === "line" && /* @__PURE__ */ jsxs16(Fragment4, { children: [
2938
2986
  /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
2939
2987
  "Weight",
2940
- /* @__PURE__ */ jsx17("input", { type: "number", "aria-label": "Line weight", min: 1, max: 200, value: options.weight, onChange: (e) => set({ weight: num(e.target.value, 1, 200) }), className: `w-14 ${imageFieldClass}` })
2988
+ /* @__PURE__ */ jsx18("input", { type: "number", "aria-label": "Line weight", min: 1, max: 200, value: options.weight, onChange: (e) => set({ weight: num(e.target.value, 1, 200) }), className: `w-14 ${imageFieldClass}` })
2941
2989
  ] }),
2942
2990
  /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
2943
- /* @__PURE__ */ jsx17(ImageCheckbox, { label: "Arrowhead", checked: options.arrow, onChange: (on) => set({ arrow: on }) }),
2991
+ /* @__PURE__ */ jsx18(ImageCheckbox, { label: "Arrowhead", checked: options.arrow, onChange: (on) => set({ arrow: on }) }),
2944
2992
  "Arrowhead"
2945
2993
  ] })
2946
2994
  ] })
2947
2995
  ] }),
2948
- /* @__PURE__ */ jsx17("p", { className: "text-[10px] text-muted-foreground", children: "Drag on the image to draw. Shift: square, circle or 45\xB0 line. Alt: from the centre." }),
2949
- error && /* @__PURE__ */ jsx17("p", { role: "alert", className: "text-destructive", children: error })
2996
+ /* @__PURE__ */ jsx18("p", { className: "text-[10px] text-muted-foreground", children: "Drag on the image to draw. Shift: square, circle or 45\xB0 line. Alt: from the centre." }),
2997
+ error && /* @__PURE__ */ jsx18("p", { role: "alert", className: "text-destructive", children: error })
2950
2998
  ] });
2951
2999
  };
2952
3000
 
2953
3001
  // src/image-editor/TypeOptionsBar.tsx
2954
3002
  import { useEffect as useEffect12, useState as useState15 } from "react";
2955
3003
  import { TEXT_ALIGNS } from "@pixerate/editor/image-editor";
2956
- import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
3004
+ import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
2957
3005
  var ALIGN_LABELS = { left: "Left", center: "Centre", right: "Right", justify: "Justify" };
2958
3006
  var TypeOptionsBar = ({ controller, options, onChange, session, className }) => {
2959
3007
  const [, setTick] = useState15(0);
@@ -2995,7 +3043,7 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
2995
3043
  /* @__PURE__ */ jsxs17("div", { className: "flex flex-wrap items-center gap-2", children: [
2996
3044
  /* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
2997
3045
  "Font",
2998
- /* @__PURE__ */ jsx18(
3046
+ /* @__PURE__ */ jsx19(
2999
3047
  "input",
3000
3048
  {
3001
3049
  list: "pixerate-type-fonts",
@@ -3005,11 +3053,11 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
3005
3053
  className: "w-32 rounded border border-border bg-background px-1 py-0.5"
3006
3054
  }
3007
3055
  ),
3008
- /* @__PURE__ */ jsx18("datalist", { id: "pixerate-type-fonts", children: fonts.map((f) => /* @__PURE__ */ jsx18("option", { value: f }, f)) })
3056
+ /* @__PURE__ */ jsx19("datalist", { id: "pixerate-type-fonts", children: fonts.map((f) => /* @__PURE__ */ jsx19("option", { value: f }, f)) })
3009
3057
  ] }),
3010
3058
  /* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
3011
3059
  "Size",
3012
- /* @__PURE__ */ jsx18(
3060
+ /* @__PURE__ */ jsx19(
3013
3061
  "input",
3014
3062
  {
3015
3063
  type: "number",
@@ -3022,24 +3070,24 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
3022
3070
  }
3023
3071
  )
3024
3072
  ] }),
3025
- /* @__PURE__ */ jsx18("button", { type: "button", "aria-pressed": shown.fontWeight >= 600, className: `${imageChipClass(shown.fontWeight >= 600)} font-bold`, onClick: () => style({ fontWeight: shown.fontWeight >= 600 ? 400 : 700 }), children: "B" }),
3026
- /* @__PURE__ */ jsx18("button", { type: "button", "aria-pressed": shown.italic, className: `${imageChipClass(shown.italic)} italic`, onClick: () => style({ italic: !shown.italic }), children: "I" }),
3027
- /* @__PURE__ */ jsx18("input", { type: "color", "aria-label": "Text colour", value: shown.color, onChange: (e) => style({ color: e.target.value }), className: imageColorInputClass })
3073
+ /* @__PURE__ */ jsx19("button", { type: "button", "aria-pressed": shown.fontWeight >= 600, className: `${imageChipClass(shown.fontWeight >= 600)} font-bold`, onClick: () => style({ fontWeight: shown.fontWeight >= 600 ? 400 : 700 }), children: "B" }),
3074
+ /* @__PURE__ */ jsx19("button", { type: "button", "aria-pressed": shown.italic, className: `${imageChipClass(shown.italic)} italic`, onClick: () => style({ italic: !shown.italic }), children: "I" }),
3075
+ /* @__PURE__ */ jsx19("input", { type: "color", "aria-label": "Text colour", value: shown.color, onChange: (e) => style({ color: e.target.value }), className: imageColorInputClass })
3028
3076
  ] }),
3029
- /* @__PURE__ */ jsx18("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Alignment", children: TEXT_ALIGNS.map((a) => /* @__PURE__ */ jsx18("button", { type: "button", "aria-pressed": options.align === a, className: imageChipClass(options.align === a), onClick: () => style({ align: a }), children: ALIGN_LABELS[a] }, a)) }),
3030
- /* @__PURE__ */ jsx18("p", { className: "text-[10px] text-muted-foreground", children: "Click to type point text, drag for a paragraph box, click text to edit it. Esc finishes." }),
3077
+ /* @__PURE__ */ jsx19("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Alignment", children: TEXT_ALIGNS.map((a) => /* @__PURE__ */ jsx19("button", { type: "button", "aria-pressed": options.align === a, className: imageChipClass(options.align === a), onClick: () => style({ align: a }), children: ALIGN_LABELS[a] }, a)) }),
3078
+ /* @__PURE__ */ jsx19("p", { className: "text-[10px] text-muted-foreground", children: "Click to type point text, drag for a paragraph box, click text to edit it. Esc finishes." }),
3031
3079
  missing.length > 0 && /* @__PURE__ */ jsxs17("p", { role: "status", className: "text-amber-600", "data-testid": "type-missing-fonts", children: [
3032
3080
  "Missing ",
3033
3081
  missing.length === 1 ? "font" : "fonts",
3034
3082
  ": ",
3035
3083
  missing.join(", ")
3036
3084
  ] }),
3037
- error && /* @__PURE__ */ jsx18("p", { role: "alert", className: "text-destructive", children: error })
3085
+ error && /* @__PURE__ */ jsx19("p", { role: "alert", className: "text-destructive", children: error })
3038
3086
  ] });
3039
3087
  };
3040
3088
 
3041
3089
  // src/image-editor/ImageEditor.tsx
3042
- import { Fragment as Fragment5, jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
3090
+ import { Fragment as Fragment5, jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
3043
3091
  var ImageEditor = ({
3044
3092
  editor: externalEditor,
3045
3093
  src,
@@ -3211,7 +3259,7 @@ var ImageEditor = ({
3211
3259
  children: [
3212
3260
  /* @__PURE__ */ jsxs18("div", { className: imageEditorHeaderClass, children: [
3213
3261
  /* @__PURE__ */ jsxs18("div", { role: "tablist", className: imageTabListClass, children: [
3214
- /* @__PURE__ */ jsx19(
3262
+ /* @__PURE__ */ jsx20(
3215
3263
  "button",
3216
3264
  {
3217
3265
  type: "button",
@@ -3226,7 +3274,7 @@ var ImageEditor = ({
3226
3274
  children: "Transform & Crop"
3227
3275
  }
3228
3276
  ),
3229
- /* @__PURE__ */ jsx19(
3277
+ /* @__PURE__ */ jsx20(
3230
3278
  "button",
3231
3279
  {
3232
3280
  type: "button",
@@ -3241,7 +3289,7 @@ var ImageEditor = ({
3241
3289
  children: "Adjustments"
3242
3290
  }
3243
3291
  ),
3244
- /* @__PURE__ */ jsx19(
3292
+ /* @__PURE__ */ jsx20(
3245
3293
  "button",
3246
3294
  {
3247
3295
  type: "button",
@@ -3256,7 +3304,7 @@ var ImageEditor = ({
3256
3304
  children: "Layers"
3257
3305
  }
3258
3306
  ),
3259
- /* @__PURE__ */ jsx19(
3307
+ /* @__PURE__ */ jsx20(
3260
3308
  "button",
3261
3309
  {
3262
3310
  type: "button",
@@ -3271,7 +3319,7 @@ var ImageEditor = ({
3271
3319
  children: "Paint"
3272
3320
  }
3273
3321
  ),
3274
- /* @__PURE__ */ jsx19(
3322
+ /* @__PURE__ */ jsx20(
3275
3323
  "button",
3276
3324
  {
3277
3325
  type: "button",
@@ -3286,7 +3334,7 @@ var ImageEditor = ({
3286
3334
  children: "Select & Mask"
3287
3335
  }
3288
3336
  ),
3289
- /* @__PURE__ */ jsx19(
3337
+ /* @__PURE__ */ jsx20(
3290
3338
  "button",
3291
3339
  {
3292
3340
  type: "button",
@@ -3301,7 +3349,7 @@ var ImageEditor = ({
3301
3349
  children: "Annotations"
3302
3350
  }
3303
3351
  ),
3304
- /* @__PURE__ */ jsx19(
3352
+ /* @__PURE__ */ jsx20(
3305
3353
  "button",
3306
3354
  {
3307
3355
  type: "button",
@@ -3329,14 +3377,14 @@ var ImageEditor = ({
3329
3377
  "aria-selected": activeTab === "ai",
3330
3378
  className: `${imageTabClass(activeTab === "ai")} flex items-center gap-1.5`,
3331
3379
  children: [
3332
- /* @__PURE__ */ jsx19("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx19("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }),
3380
+ /* @__PURE__ */ jsx20("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx20("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }),
3333
3381
  "AI Tools"
3334
3382
  ]
3335
3383
  }
3336
3384
  )
3337
3385
  ] }),
3338
3386
  /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2 text-xs", children: [
3339
- /* @__PURE__ */ jsx19(
3387
+ /* @__PURE__ */ jsx20(
3340
3388
  "button",
3341
3389
  {
3342
3390
  type: "button",
@@ -3347,7 +3395,7 @@ var ImageEditor = ({
3347
3395
  children: "\u21A9"
3348
3396
  }
3349
3397
  ),
3350
- /* @__PURE__ */ jsx19(
3398
+ /* @__PURE__ */ jsx20(
3351
3399
  "button",
3352
3400
  {
3353
3401
  type: "button",
@@ -3358,7 +3406,7 @@ var ImageEditor = ({
3358
3406
  children: "\u21AA"
3359
3407
  }
3360
3408
  ),
3361
- /* @__PURE__ */ jsx19(
3409
+ /* @__PURE__ */ jsx20(
3362
3410
  "button",
3363
3411
  {
3364
3412
  type: "button",
@@ -3367,8 +3415,8 @@ var ImageEditor = ({
3367
3415
  children: "Reset"
3368
3416
  }
3369
3417
  ),
3370
- /* @__PURE__ */ jsx19("div", { className: "h-4 w-px bg-muted mx-1" }),
3371
- /* @__PURE__ */ jsx19(
3418
+ /* @__PURE__ */ jsx20("div", { className: "h-4 w-px bg-muted mx-1" }),
3419
+ /* @__PURE__ */ jsx20(
3372
3420
  "button",
3373
3421
  {
3374
3422
  type: "button",
@@ -3382,7 +3430,7 @@ var ImageEditor = ({
3382
3430
  Math.round(state.zoom * 100),
3383
3431
  "%"
3384
3432
  ] }),
3385
- /* @__PURE__ */ jsx19(
3433
+ /* @__PURE__ */ jsx20(
3386
3434
  "button",
3387
3435
  {
3388
3436
  type: "button",
@@ -3392,8 +3440,8 @@ var ImageEditor = ({
3392
3440
  children: "+"
3393
3441
  }
3394
3442
  ),
3395
- /* @__PURE__ */ jsx19("div", { className: "h-4 w-px bg-muted mx-1" }),
3396
- /* @__PURE__ */ jsx19(
3443
+ /* @__PURE__ */ jsx20("div", { className: "h-4 w-px bg-muted mx-1" }),
3444
+ /* @__PURE__ */ jsx20(
3397
3445
  "button",
3398
3446
  {
3399
3447
  type: "button",
@@ -3404,7 +3452,7 @@ var ImageEditor = ({
3404
3452
  children: "Hold Compare"
3405
3453
  }
3406
3454
  ),
3407
- /* @__PURE__ */ jsx19(
3455
+ /* @__PURE__ */ jsx20(
3408
3456
  "button",
3409
3457
  {
3410
3458
  type: "button",
@@ -3415,10 +3463,10 @@ var ImageEditor = ({
3415
3463
  )
3416
3464
  ] })
3417
3465
  ] }),
3418
- transformTool.active && /* @__PURE__ */ jsx19(FreeTransformOptionsBar, { tool: transformTool, className: "border-b border-border bg-background/95 px-4 py-2" }),
3419
- !transformTool.active && transformTool.error && /* @__PURE__ */ jsx19("div", { role: "alert", className: imageErrorBannerClass, children: transformTool.error }),
3466
+ transformTool.active && /* @__PURE__ */ jsx20(FreeTransformOptionsBar, { tool: transformTool, className: "border-b border-border bg-background/95 px-4 py-2" }),
3467
+ !transformTool.active && transformTool.error && /* @__PURE__ */ jsx20("div", { role: "alert", className: imageErrorBannerClass, children: transformTool.error }),
3420
3468
  /* @__PURE__ */ jsxs18("div", { className: "flex flex-col md:flex-row flex-1 min-h-[520px] md:h-[560px]", children: [
3421
- /* @__PURE__ */ jsx19(
3469
+ /* @__PURE__ */ jsx20(
3422
3470
  ImageEditorCanvas,
3423
3471
  {
3424
3472
  editor,
@@ -3444,9 +3492,9 @@ var ImageEditor = ({
3444
3492
  ),
3445
3493
  /* @__PURE__ */ jsxs18("div", { className: imageSidebarClass, children: [
3446
3494
  activeTab === "crop" && /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-4 text-xs", children: [
3447
- /* @__PURE__ */ jsx19("span", { className: imageSectionTitleClass, children: "Aspect Ratio Presets" }),
3495
+ /* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Aspect Ratio Presets" }),
3448
3496
  /* @__PURE__ */ jsxs18("div", { className: "grid grid-cols-3 gap-2", children: [
3449
- /* @__PURE__ */ jsx19(
3497
+ /* @__PURE__ */ jsx20(
3450
3498
  "button",
3451
3499
  {
3452
3500
  type: "button",
@@ -3458,7 +3506,7 @@ var ImageEditor = ({
3458
3506
  children: "Freeform"
3459
3507
  }
3460
3508
  ),
3461
- /* @__PURE__ */ jsx19(
3509
+ /* @__PURE__ */ jsx20(
3462
3510
  "button",
3463
3511
  {
3464
3512
  type: "button",
@@ -3470,7 +3518,7 @@ var ImageEditor = ({
3470
3518
  children: "1:1 Square"
3471
3519
  }
3472
3520
  ),
3473
- /* @__PURE__ */ jsx19(
3521
+ /* @__PURE__ */ jsx20(
3474
3522
  "button",
3475
3523
  {
3476
3524
  type: "button",
@@ -3482,7 +3530,7 @@ var ImageEditor = ({
3482
3530
  children: "4:3 Standard"
3483
3531
  }
3484
3532
  ),
3485
- /* @__PURE__ */ jsx19(
3533
+ /* @__PURE__ */ jsx20(
3486
3534
  "button",
3487
3535
  {
3488
3536
  type: "button",
@@ -3494,7 +3542,7 @@ var ImageEditor = ({
3494
3542
  children: "16:9 Wide"
3495
3543
  }
3496
3544
  ),
3497
- /* @__PURE__ */ jsx19(
3545
+ /* @__PURE__ */ jsx20(
3498
3546
  "button",
3499
3547
  {
3500
3548
  type: "button",
@@ -3506,7 +3554,7 @@ var ImageEditor = ({
3506
3554
  children: "3:2 Photo"
3507
3555
  }
3508
3556
  ),
3509
- /* @__PURE__ */ jsx19(
3557
+ /* @__PURE__ */ jsx20(
3510
3558
  "button",
3511
3559
  {
3512
3560
  type: "button",
@@ -3519,10 +3567,10 @@ var ImageEditor = ({
3519
3567
  }
3520
3568
  )
3521
3569
  ] }),
3522
- /* @__PURE__ */ jsx19("div", { className: imageDividerClass }),
3523
- /* @__PURE__ */ jsx19("span", { className: imageSectionTitleClass, children: "Orientation & Flips" }),
3570
+ /* @__PURE__ */ jsx20("div", { className: imageDividerClass }),
3571
+ /* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Orientation & Flips" }),
3524
3572
  /* @__PURE__ */ jsxs18("div", { className: "grid grid-cols-2 gap-2", children: [
3525
- /* @__PURE__ */ jsx19(
3573
+ /* @__PURE__ */ jsx20(
3526
3574
  "button",
3527
3575
  {
3528
3576
  type: "button",
@@ -3531,7 +3579,7 @@ var ImageEditor = ({
3531
3579
  children: "Rotate -90\xB0"
3532
3580
  }
3533
3581
  ),
3534
- /* @__PURE__ */ jsx19(
3582
+ /* @__PURE__ */ jsx20(
3535
3583
  "button",
3536
3584
  {
3537
3585
  type: "button",
@@ -3540,7 +3588,7 @@ var ImageEditor = ({
3540
3588
  children: "Rotate +90\xB0"
3541
3589
  }
3542
3590
  ),
3543
- /* @__PURE__ */ jsx19(
3591
+ /* @__PURE__ */ jsx20(
3544
3592
  "button",
3545
3593
  {
3546
3594
  type: "button",
@@ -3549,7 +3597,7 @@ var ImageEditor = ({
3549
3597
  children: "Flip Horizontal"
3550
3598
  }
3551
3599
  ),
3552
- /* @__PURE__ */ jsx19(
3600
+ /* @__PURE__ */ jsx20(
3553
3601
  "button",
3554
3602
  {
3555
3603
  type: "button",
@@ -3562,8 +3610,8 @@ var ImageEditor = ({
3562
3610
  ] }),
3563
3611
  activeTab === "adjust" && /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-3 text-xs", children: [
3564
3612
  /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
3565
- /* @__PURE__ */ jsx19("span", { className: imageSectionTitleClass, children: "Color Adjustments" }),
3566
- /* @__PURE__ */ jsx19(
3613
+ /* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Color Adjustments" }),
3614
+ /* @__PURE__ */ jsx20(
3567
3615
  "button",
3568
3616
  {
3569
3617
  type: "button",
@@ -3573,9 +3621,9 @@ var ImageEditor = ({
3573
3621
  }
3574
3622
  )
3575
3623
  ] }),
3576
- /* @__PURE__ */ jsx19(Histogram, { histogram: editor.histogram }),
3624
+ /* @__PURE__ */ jsx20(Histogram, { histogram: editor.histogram }),
3577
3625
  IMAGE_ADJUSTMENT_CONTROLS.map((spec) => /* @__PURE__ */ jsxs18(React15.Fragment, { children: [
3578
- /* @__PURE__ */ jsx19(
3626
+ /* @__PURE__ */ jsx20(
3579
3627
  ControlSlider,
3580
3628
  {
3581
3629
  spec,
@@ -3590,8 +3638,8 @@ var ImageEditor = ({
3590
3638
  className: "flex items-center justify-between gap-2 rounded border border-amber-500/30 bg-amber-500/10 px-2 py-1.5 text-[10px] text-amber-600",
3591
3639
  "data-testid": "image-editor-process-notice",
3592
3640
  children: [
3593
- /* @__PURE__ */ jsx19("span", { children: "Legacy rendering (process 1). Tint needs the current process." }),
3594
- /* @__PURE__ */ jsx19(
3641
+ /* @__PURE__ */ jsx20("span", { children: "Legacy rendering (process 1). Tint needs the current process." }),
3642
+ /* @__PURE__ */ jsx20(
3595
3643
  "button",
3596
3644
  {
3597
3645
  type: "button",
@@ -3604,7 +3652,7 @@ var ImageEditor = ({
3604
3652
  }
3605
3653
  )
3606
3654
  ] }, spec.id)),
3607
- /* @__PURE__ */ jsx19("div", { className: imageSectionClass, children: /* @__PURE__ */ jsx19(
3655
+ /* @__PURE__ */ jsx20("div", { className: imageSectionClass, children: /* @__PURE__ */ jsx20(
3608
3656
  AdjustmentLayersPanel,
3609
3657
  {
3610
3658
  controller,
@@ -3614,8 +3662,8 @@ var ImageEditor = ({
3614
3662
  ) })
3615
3663
  ] }),
3616
3664
  activeTab === "layers" && /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-3 text-xs", children: [
3617
- /* @__PURE__ */ jsx19("span", { className: imageSectionTitleClass, children: "Layers" }),
3618
- /* @__PURE__ */ jsx19(
3665
+ /* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Layers" }),
3666
+ /* @__PURE__ */ jsx20(
3619
3667
  "button",
3620
3668
  {
3621
3669
  type: "button",
@@ -3626,15 +3674,15 @@ var ImageEditor = ({
3626
3674
  children: "Free Transform"
3627
3675
  }
3628
3676
  ),
3629
- /* @__PURE__ */ jsx19(LayersPanel, { controller }),
3630
- effectsShown && /* @__PURE__ */ jsx19(ImageProviderEffectsPanel, { controller, className: imageSectionClass }),
3631
- /* @__PURE__ */ jsx19("span", { className: imageSectionTitleClass, children: "Colour" }),
3632
- /* @__PURE__ */ jsx19(ColorProfilePanel, { controller })
3677
+ /* @__PURE__ */ jsx20(LayersPanel, { controller }),
3678
+ effectsShown && /* @__PURE__ */ jsx20(ImageProviderEffectsPanel, { controller, className: imageSectionClass }),
3679
+ /* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Colour" }),
3680
+ /* @__PURE__ */ jsx20(ColorProfilePanel, { controller })
3633
3681
  ] }),
3634
3682
  activeTab === "paint" && /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-3 text-xs", children: [
3635
- /* @__PURE__ */ jsx19("span", { className: imageSectionTitleClass, children: "Paint" }),
3636
- /* @__PURE__ */ jsx19(BrushOptionsBar, { controller }),
3637
- /* @__PURE__ */ jsx19(
3683
+ /* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Paint" }),
3684
+ /* @__PURE__ */ jsx20(BrushOptionsBar, { controller }),
3685
+ /* @__PURE__ */ jsx20(
3638
3686
  "button",
3639
3687
  {
3640
3688
  type: "button",
@@ -3645,12 +3693,12 @@ var ImageEditor = ({
3645
3693
  children: "Free Transform"
3646
3694
  }
3647
3695
  ),
3648
- paintError && /* @__PURE__ */ jsx19("p", { role: "alert", className: "text-destructive", "data-testid": "paint-error", children: paintError }),
3649
- /* @__PURE__ */ jsx19("div", { className: imageSectionClass, children: /* @__PURE__ */ jsx19(LayersPanel, { controller }) })
3696
+ paintError && /* @__PURE__ */ jsx20("p", { role: "alert", className: "text-destructive", "data-testid": "paint-error", children: paintError }),
3697
+ /* @__PURE__ */ jsx20("div", { className: imageSectionClass, children: /* @__PURE__ */ jsx20(LayersPanel, { controller }) })
3650
3698
  ] }),
3651
3699
  activeTab === "annotate" && /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-3 text-xs", children: [
3652
- /* @__PURE__ */ jsx19("span", { className: imageSectionTitleClass, children: "Shape & Type Layers" }),
3653
- /* @__PURE__ */ jsx19("div", { className: "grid grid-cols-2 gap-1.5", children: ["shape", "type"].map((t) => /* @__PURE__ */ jsx19(
3700
+ /* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Shape & Type Layers" }),
3701
+ /* @__PURE__ */ jsx20("div", { className: "grid grid-cols-2 gap-1.5", children: ["shape", "type"].map((t) => /* @__PURE__ */ jsx20(
3654
3702
  "button",
3655
3703
  {
3656
3704
  type: "button",
@@ -3661,13 +3709,13 @@ var ImageEditor = ({
3661
3709
  },
3662
3710
  t
3663
3711
  )) }),
3664
- state.activeTool === "shape" && /* @__PURE__ */ jsx19(ShapeOptionsBar, { controller, options: shapeOptions, onChange: setShapeOptions }),
3665
- state.activeTool === "type" && /* @__PURE__ */ jsx19(TypeOptionsBar, { controller, options: typeOptions, onChange: setTypeOptions, session: typeSession }),
3666
- state.activeTool === "type" && typeSession && /* @__PURE__ */ jsx19("button", { type: "button", onClick: finishTyping, className: "self-start rounded bg-muted px-2 py-1 text-[11px] text-foreground hover:bg-accent", children: "Done editing text" }),
3667
- shapeTypeError && /* @__PURE__ */ jsx19("p", { role: "alert", className: "text-destructive", "data-testid": "shape-type-error", children: shapeTypeError }),
3668
- /* @__PURE__ */ jsx19("div", { className: imageDividerClass }),
3669
- /* @__PURE__ */ jsx19("span", { className: imageSectionTitleClass, children: "Draw & Annotate" }),
3670
- /* @__PURE__ */ jsx19("div", { className: "grid grid-cols-3 gap-1.5", children: ["pen", "rect", "circle", "arrow", "line"].map((t) => /* @__PURE__ */ jsx19(
3712
+ state.activeTool === "shape" && /* @__PURE__ */ jsx20(ShapeOptionsBar, { controller, options: shapeOptions, onChange: setShapeOptions }),
3713
+ state.activeTool === "type" && /* @__PURE__ */ jsx20(TypeOptionsBar, { controller, options: typeOptions, onChange: setTypeOptions, session: typeSession }),
3714
+ state.activeTool === "type" && typeSession && /* @__PURE__ */ jsx20("button", { type: "button", onClick: finishTyping, className: "self-start rounded bg-muted px-2 py-1 text-[11px] text-foreground hover:bg-accent", children: "Done editing text" }),
3715
+ shapeTypeError && /* @__PURE__ */ jsx20("p", { role: "alert", className: "text-destructive", "data-testid": "shape-type-error", children: shapeTypeError }),
3716
+ /* @__PURE__ */ jsx20("div", { className: imageDividerClass }),
3717
+ /* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Draw & Annotate" }),
3718
+ /* @__PURE__ */ jsx20("div", { className: "grid grid-cols-3 gap-1.5", children: ["pen", "rect", "circle", "arrow", "line"].map((t) => /* @__PURE__ */ jsx20(
3671
3719
  "button",
3672
3720
  {
3673
3721
  type: "button",
@@ -3678,8 +3726,8 @@ var ImageEditor = ({
3678
3726
  t
3679
3727
  )) }),
3680
3728
  /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2 mt-2", children: [
3681
- /* @__PURE__ */ jsx19("label", { className: "text-muted-foreground", children: "Color:" }),
3682
- /* @__PURE__ */ jsx19(
3729
+ /* @__PURE__ */ jsx20("label", { className: "text-muted-foreground", children: "Color:" }),
3730
+ /* @__PURE__ */ jsx20(
3683
3731
  "input",
3684
3732
  {
3685
3733
  type: "color",
@@ -3690,13 +3738,13 @@ var ImageEditor = ({
3690
3738
  ),
3691
3739
  /* @__PURE__ */ jsxs18("div", { className: "flex-1 ml-2", children: [
3692
3740
  /* @__PURE__ */ jsxs18("div", { className: "flex justify-between text-muted-foreground mb-0.5", children: [
3693
- /* @__PURE__ */ jsx19("span", { children: "Width:" }),
3741
+ /* @__PURE__ */ jsx20("span", { children: "Width:" }),
3694
3742
  /* @__PURE__ */ jsxs18("span", { className: "font-mono", children: [
3695
3743
  strokeWidth,
3696
3744
  "px"
3697
3745
  ] })
3698
3746
  ] }),
3699
- /* @__PURE__ */ jsx19(
3747
+ /* @__PURE__ */ jsx20(
3700
3748
  "input",
3701
3749
  {
3702
3750
  type: "range",
@@ -3709,10 +3757,10 @@ var ImageEditor = ({
3709
3757
  )
3710
3758
  ] })
3711
3759
  ] }),
3712
- /* @__PURE__ */ jsx19("div", { className: imageDividerClass }),
3713
- /* @__PURE__ */ jsx19("span", { className: imageSectionTitleClass, children: "Add Text" }),
3760
+ /* @__PURE__ */ jsx20("div", { className: imageDividerClass }),
3761
+ /* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Add Text" }),
3714
3762
  /* @__PURE__ */ jsxs18("div", { className: "flex gap-2", children: [
3715
- /* @__PURE__ */ jsx19(
3763
+ /* @__PURE__ */ jsx20(
3716
3764
  "input",
3717
3765
  {
3718
3766
  type: "text",
@@ -3723,7 +3771,7 @@ var ImageEditor = ({
3723
3771
  className: "flex-1 bg-background border border-border rounded-lg px-2.5 py-1.5 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:border-primary"
3724
3772
  }
3725
3773
  ),
3726
- /* @__PURE__ */ jsx19(
3774
+ /* @__PURE__ */ jsx20(
3727
3775
  "button",
3728
3776
  {
3729
3777
  type: "button",
@@ -3734,13 +3782,13 @@ var ImageEditor = ({
3734
3782
  )
3735
3783
  ] }),
3736
3784
  /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between text-muted-foreground", children: [
3737
- /* @__PURE__ */ jsx19("span", { children: "Font Size:" }),
3785
+ /* @__PURE__ */ jsx20("span", { children: "Font Size:" }),
3738
3786
  /* @__PURE__ */ jsxs18("span", { className: "font-mono", children: [
3739
3787
  fontSize,
3740
3788
  "px"
3741
3789
  ] })
3742
3790
  ] }),
3743
- /* @__PURE__ */ jsx19(
3791
+ /* @__PURE__ */ jsx20(
3744
3792
  "input",
3745
3793
  {
3746
3794
  type: "range",
@@ -3751,14 +3799,14 @@ var ImageEditor = ({
3751
3799
  className: imageRangeClass
3752
3800
  }
3753
3801
  ),
3754
- /* @__PURE__ */ jsx19("div", { className: imageDividerClass }),
3802
+ /* @__PURE__ */ jsx20("div", { className: imageDividerClass }),
3755
3803
  /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
3756
3804
  /* @__PURE__ */ jsxs18("span", { className: "text-muted-foreground", children: [
3757
3805
  "Layers (",
3758
3806
  state.annotations.length,
3759
3807
  ")"
3760
3808
  ] }),
3761
- state.selectedAnnotationId && /* @__PURE__ */ jsx19(
3809
+ state.selectedAnnotationId && /* @__PURE__ */ jsx20(
3762
3810
  "button",
3763
3811
  {
3764
3812
  type: "button",
@@ -3767,7 +3815,7 @@ var ImageEditor = ({
3767
3815
  children: "Delete Selected"
3768
3816
  }
3769
3817
  ),
3770
- state.annotations.length > 0 && /* @__PURE__ */ jsx19(
3818
+ state.annotations.length > 0 && /* @__PURE__ */ jsx20(
3771
3819
  "button",
3772
3820
  {
3773
3821
  type: "button",
@@ -3780,8 +3828,8 @@ var ImageEditor = ({
3780
3828
  ] }),
3781
3829
  activeTab === "depth" && /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-3 text-xs", children: [
3782
3830
  /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
3783
- /* @__PURE__ */ jsx19("span", { className: imageSectionTitleClass, children: "Depth Masking" }),
3784
- /* @__PURE__ */ jsx19(
3831
+ /* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Depth Masking" }),
3832
+ /* @__PURE__ */ jsx20(
3785
3833
  "button",
3786
3834
  {
3787
3835
  type: "button",
@@ -3792,7 +3840,7 @@ var ImageEditor = ({
3792
3840
  )
3793
3841
  ] }),
3794
3842
  /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-2 cursor-pointer text-foreground", children: [
3795
- /* @__PURE__ */ jsx19(
3843
+ /* @__PURE__ */ jsx20(
3796
3844
  "input",
3797
3845
  {
3798
3846
  type: "checkbox",
@@ -3801,12 +3849,12 @@ var ImageEditor = ({
3801
3849
  className: "rounded accent-primary"
3802
3850
  }
3803
3851
  ),
3804
- /* @__PURE__ */ jsx19("span", { children: "Enable Depth / Alpha Mask" })
3852
+ /* @__PURE__ */ jsx20("span", { children: "Enable Depth / Alpha Mask" })
3805
3853
  ] }),
3806
3854
  state.depthMask.enabled && /* @__PURE__ */ jsxs18(Fragment5, { children: [
3807
3855
  /* @__PURE__ */ jsxs18("div", { children: [
3808
- /* @__PURE__ */ jsx19("label", { className: "text-muted-foreground block mb-1", children: "Mask Image URL:" }),
3809
- /* @__PURE__ */ jsx19(
3856
+ /* @__PURE__ */ jsx20("label", { className: "text-muted-foreground block mb-1", children: "Mask Image URL:" }),
3857
+ /* @__PURE__ */ jsx20(
3810
3858
  "input",
3811
3859
  {
3812
3860
  type: "text",
@@ -3818,7 +3866,7 @@ var ImageEditor = ({
3818
3866
  )
3819
3867
  ] }),
3820
3868
  /* @__PURE__ */ jsxs18("div", { className: "flex gap-2", children: [
3821
- /* @__PURE__ */ jsx19(
3869
+ /* @__PURE__ */ jsx20(
3822
3870
  "button",
3823
3871
  {
3824
3872
  type: "button",
@@ -3827,7 +3875,7 @@ var ImageEditor = ({
3827
3875
  children: "Threshold Mode"
3828
3876
  }
3829
3877
  ),
3830
- /* @__PURE__ */ jsx19(
3878
+ /* @__PURE__ */ jsx20(
3831
3879
  "button",
3832
3880
  {
3833
3881
  type: "button",
@@ -3839,10 +3887,10 @@ var ImageEditor = ({
3839
3887
  ] }),
3840
3888
  /* @__PURE__ */ jsxs18("div", { children: [
3841
3889
  /* @__PURE__ */ jsxs18("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
3842
- /* @__PURE__ */ jsx19("span", { children: "Depth Start (Lower):" }),
3843
- /* @__PURE__ */ jsx19("span", { className: "font-mono", children: state.depthMask.depthRange[0] })
3890
+ /* @__PURE__ */ jsx20("span", { children: "Depth Start (Lower):" }),
3891
+ /* @__PURE__ */ jsx20("span", { className: "font-mono", children: state.depthMask.depthRange[0] })
3844
3892
  ] }),
3845
- /* @__PURE__ */ jsx19(
3893
+ /* @__PURE__ */ jsx20(
3846
3894
  "input",
3847
3895
  {
3848
3896
  type: "range",
@@ -3858,10 +3906,10 @@ var ImageEditor = ({
3858
3906
  ] }),
3859
3907
  /* @__PURE__ */ jsxs18("div", { children: [
3860
3908
  /* @__PURE__ */ jsxs18("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
3861
- /* @__PURE__ */ jsx19("span", { children: "Depth Stop (Upper):" }),
3862
- /* @__PURE__ */ jsx19("span", { className: "font-mono", children: state.depthMask.depthRange[1] })
3909
+ /* @__PURE__ */ jsx20("span", { children: "Depth Stop (Upper):" }),
3910
+ /* @__PURE__ */ jsx20("span", { className: "font-mono", children: state.depthMask.depthRange[1] })
3863
3911
  ] }),
3864
- /* @__PURE__ */ jsx19(
3912
+ /* @__PURE__ */ jsx20(
3865
3913
  "input",
3866
3914
  {
3867
3915
  type: "range",
@@ -3877,10 +3925,10 @@ var ImageEditor = ({
3877
3925
  ] }),
3878
3926
  /* @__PURE__ */ jsxs18("div", { children: [
3879
3927
  /* @__PURE__ */ jsxs18("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
3880
- /* @__PURE__ */ jsx19("span", { children: "Softness:" }),
3881
- /* @__PURE__ */ jsx19("span", { className: "font-mono", children: state.depthMask.softness })
3928
+ /* @__PURE__ */ jsx20("span", { children: "Softness:" }),
3929
+ /* @__PURE__ */ jsx20("span", { className: "font-mono", children: state.depthMask.softness })
3882
3930
  ] }),
3883
- /* @__PURE__ */ jsx19(
3931
+ /* @__PURE__ */ jsx20(
3884
3932
  "input",
3885
3933
  {
3886
3934
  type: "range",
@@ -3893,7 +3941,7 @@ var ImageEditor = ({
3893
3941
  )
3894
3942
  ] }),
3895
3943
  /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-2 cursor-pointer text-foreground mt-1", children: [
3896
- /* @__PURE__ */ jsx19(
3944
+ /* @__PURE__ */ jsx20(
3897
3945
  "input",
3898
3946
  {
3899
3947
  type: "checkbox",
@@ -3902,12 +3950,12 @@ var ImageEditor = ({
3902
3950
  className: "rounded accent-primary"
3903
3951
  }
3904
3952
  ),
3905
- /* @__PURE__ */ jsx19("span", { children: "Invert Mask" })
3953
+ /* @__PURE__ */ jsx20("span", { children: "Invert Mask" })
3906
3954
  ] })
3907
3955
  ] })
3908
3956
  ] }),
3909
3957
  activeTab === "select" && /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-4 text-xs", children: [
3910
- /* @__PURE__ */ jsx19(
3958
+ /* @__PURE__ */ jsx20(
3911
3959
  SelectionOptionsBar,
3912
3960
  {
3913
3961
  controller,
@@ -3917,9 +3965,9 @@ var ImageEditor = ({
3917
3965
  quickMask: Boolean(state.quickMask)
3918
3966
  }
3919
3967
  ),
3920
- selectionError && /* @__PURE__ */ jsx19("p", { role: "alert", className: "text-destructive", children: selectionError }),
3968
+ selectionError && /* @__PURE__ */ jsx20("p", { role: "alert", className: "text-destructive", children: selectionError }),
3921
3969
  /* @__PURE__ */ jsxs18("div", { className: "flex gap-1", children: [
3922
- /* @__PURE__ */ jsx19(
3970
+ /* @__PURE__ */ jsx20(
3923
3971
  "button",
3924
3972
  {
3925
3973
  type: "button",
@@ -3930,7 +3978,7 @@ var ImageEditor = ({
3930
3978
  children: "Transform Selection"
3931
3979
  }
3932
3980
  ),
3933
- /* @__PURE__ */ jsx19(
3981
+ /* @__PURE__ */ jsx20(
3934
3982
  "button",
3935
3983
  {
3936
3984
  type: "button",
@@ -3942,11 +3990,11 @@ var ImageEditor = ({
3942
3990
  }
3943
3991
  )
3944
3992
  ] }),
3945
- /* @__PURE__ */ jsx19(RefineEdgePanel, { controller, selection: state.selection ?? null, layers: state.adjustments.layers })
3993
+ /* @__PURE__ */ jsx20(RefineEdgePanel, { controller, selection: state.selection ?? null, layers: state.adjustments.layers })
3946
3994
  ] }),
3947
3995
  activeTab === "ai" && /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-4 text-xs", children: [
3948
3996
  /* @__PURE__ */ jsxs18("label", { className: "flex items-center justify-between gap-2 text-foreground", children: [
3949
- /* @__PURE__ */ jsx19("span", { children: "Results go to" }),
3997
+ /* @__PURE__ */ jsx20("span", { children: "Results go to" }),
3950
3998
  /* @__PURE__ */ jsxs18(
3951
3999
  "select",
3952
4000
  {
@@ -3955,9 +4003,9 @@ var ImageEditor = ({
3955
4003
  onChange: (e) => setAiTarget(e.target.value),
3956
4004
  className: imageSelectClass,
3957
4005
  children: [
3958
- /* @__PURE__ */ jsx19("option", { value: "auto", children: controller.isMultiLayer ? "Auto (new layer)" : "Auto (replace image)" }),
3959
- /* @__PURE__ */ jsx19("option", { value: "new-layer", children: "New layer / mask" }),
3960
- /* @__PURE__ */ jsx19("option", { value: "replace", children: "Replace image" })
4006
+ /* @__PURE__ */ jsx20("option", { value: "auto", children: controller.isMultiLayer ? "Auto (new layer)" : "Auto (replace image)" }),
4007
+ /* @__PURE__ */ jsx20("option", { value: "new-layer", children: "New layer / mask" }),
4008
+ /* @__PURE__ */ jsx20("option", { value: "replace", children: "Replace image" })
3961
4009
  ]
3962
4010
  }
3963
4011
  )
@@ -3965,13 +4013,13 @@ var ImageEditor = ({
3965
4013
  /* @__PURE__ */ jsxs18("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
3966
4014
  /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
3967
4015
  /* @__PURE__ */ jsxs18("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
3968
- /* @__PURE__ */ jsx19("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx19("path", { d: "M6 3v12M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" }) }),
4016
+ /* @__PURE__ */ jsx20("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx20("path", { d: "M6 3v12M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" }) }),
3969
4017
  "Background Removal"
3970
4018
  ] }),
3971
- isRemovingBg && /* @__PURE__ */ jsx19("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-primary/15 text-primary animate-pulse", children: "Removing..." })
4019
+ isRemovingBg && /* @__PURE__ */ jsx20("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-primary/15 text-primary animate-pulse", children: "Removing..." })
3972
4020
  ] }),
3973
- /* @__PURE__ */ jsx19("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Isolate foreground subject with AI alpha transparency segmentation." }),
3974
- /* @__PURE__ */ jsx19(
4021
+ /* @__PURE__ */ jsx20("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Isolate foreground subject with AI alpha transparency segmentation." }),
4022
+ /* @__PURE__ */ jsx20(
3975
4023
  "button",
3976
4024
  {
3977
4025
  type: "button",
@@ -3979,10 +4027,10 @@ var ImageEditor = ({
3979
4027
  disabled: isRemovingBg || isInpainting,
3980
4028
  className: "mt-1 px-3 py-2 rounded-lg bg-primary hover:bg-primary/90 disabled:opacity-50 text-primary-foreground font-medium shadow transition-colors flex items-center justify-center gap-2",
3981
4029
  children: isRemovingBg ? /* @__PURE__ */ jsxs18(Fragment5, { children: [
3982
- /* @__PURE__ */ jsx19("div", { className: imageSpinnerClass }),
4030
+ /* @__PURE__ */ jsx20("div", { className: imageSpinnerClass }),
3983
4031
  "Removing Background..."
3984
4032
  ] }) : /* @__PURE__ */ jsxs18(Fragment5, { children: [
3985
- /* @__PURE__ */ jsx19("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx19("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }),
4033
+ /* @__PURE__ */ jsx20("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx20("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }),
3986
4034
  "Remove Background"
3987
4035
  ] })
3988
4036
  }
@@ -3992,17 +4040,17 @@ var ImageEditor = ({
3992
4040
  /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
3993
4041
  /* @__PURE__ */ jsxs18("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
3994
4042
  /* @__PURE__ */ jsxs18("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
3995
- /* @__PURE__ */ jsx19("path", { d: "m21.64 3.64-1.28-1.28a1.2 1.2 0 0 0-1.7 0l-9.72 9.72-1.94 4.86 4.86-1.94 9.72-9.72a1.2 1.2 0 0 0 .06-1.64z" }),
3996
- /* @__PURE__ */ jsx19("path", { d: "m14 7 3 3" })
4043
+ /* @__PURE__ */ jsx20("path", { d: "m21.64 3.64-1.28-1.28a1.2 1.2 0 0 0-1.7 0l-9.72 9.72-1.94 4.86 4.86-1.94 9.72-9.72a1.2 1.2 0 0 0 .06-1.64z" }),
4044
+ /* @__PURE__ */ jsx20("path", { d: "m14 7 3 3" })
3997
4045
  ] }),
3998
4046
  "Generative Inpainting"
3999
4047
  ] }),
4000
- isInpainting && /* @__PURE__ */ jsx19("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-primary/15 text-primary animate-pulse", children: "Inpainting..." })
4048
+ isInpainting && /* @__PURE__ */ jsx20("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-primary/15 text-primary animate-pulse", children: "Inpainting..." })
4001
4049
  ] }),
4002
- /* @__PURE__ */ jsx19("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Replace, modify, or fill selected regions using prompt-guided generative inpainting." }),
4050
+ /* @__PURE__ */ jsx20("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Replace, modify, or fill selected regions using prompt-guided generative inpainting." }),
4003
4051
  /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-1", children: [
4004
- /* @__PURE__ */ jsx19("label", { htmlFor: "ai-inpaint-prompt-react", className: "text-foreground text-[11px] font-medium", children: "Prompt" }),
4005
- /* @__PURE__ */ jsx19(
4052
+ /* @__PURE__ */ jsx20("label", { htmlFor: "ai-inpaint-prompt-react", className: "text-foreground text-[11px] font-medium", children: "Prompt" }),
4053
+ /* @__PURE__ */ jsx20(
4006
4054
  "textarea",
4007
4055
  {
4008
4056
  id: "ai-inpaint-prompt-react",
@@ -4015,7 +4063,7 @@ var ImageEditor = ({
4015
4063
  )
4016
4064
  ] }),
4017
4065
  /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-1", children: [
4018
- /* @__PURE__ */ jsx19("span", { className: "text-foreground text-[11px] font-medium", children: "Target Mask Region" }),
4066
+ /* @__PURE__ */ jsx20("span", { className: "text-foreground text-[11px] font-medium", children: "Target Mask Region" }),
4019
4067
  /* @__PURE__ */ jsxs18("div", { className: "grid grid-cols-2 gap-1.5", children: [
4020
4068
  /* @__PURE__ */ jsxs18(
4021
4069
  "button",
@@ -4045,7 +4093,7 @@ var ImageEditor = ({
4045
4093
  )
4046
4094
  ] })
4047
4095
  ] }),
4048
- /* @__PURE__ */ jsx19(
4096
+ /* @__PURE__ */ jsx20(
4049
4097
  "button",
4050
4098
  {
4051
4099
  type: "button",
@@ -4053,17 +4101,17 @@ var ImageEditor = ({
4053
4101
  disabled: isInpainting || isRemovingBg || !inpaintPrompt.trim(),
4054
4102
  className: "mt-1 px-3 py-2 rounded-lg bg-primary hover:bg-primary/90 disabled:opacity-50 text-primary-foreground font-medium shadow transition-colors flex items-center justify-center gap-2",
4055
4103
  children: isInpainting ? /* @__PURE__ */ jsxs18(Fragment5, { children: [
4056
- /* @__PURE__ */ jsx19("div", { className: imageSpinnerClass }),
4104
+ /* @__PURE__ */ jsx20("div", { className: imageSpinnerClass }),
4057
4105
  "Generating Inpaint..."
4058
4106
  ] }) : /* @__PURE__ */ jsxs18(Fragment5, { children: [
4059
- /* @__PURE__ */ jsx19("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx19("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }),
4107
+ /* @__PURE__ */ jsx20("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx20("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }),
4060
4108
  "Apply Inpainting"
4061
4109
  ] })
4062
4110
  }
4063
4111
  )
4064
4112
  ] }),
4065
- aiError && /* @__PURE__ */ jsx19("div", { className: "p-2.5 rounded-lg bg-destructive/10 border border-destructive/40 text-destructive text-[11px]", children: aiError }),
4066
- aiSuccess && /* @__PURE__ */ jsx19("div", { className: "p-2.5 rounded-lg bg-emerald-500/10 border border-emerald-500/30 text-emerald-600 text-[11px]", children: aiSuccess })
4113
+ aiError && /* @__PURE__ */ jsx20("div", { className: "p-2.5 rounded-lg bg-destructive/10 border border-destructive/40 text-destructive text-[11px]", children: aiError }),
4114
+ aiSuccess && /* @__PURE__ */ jsx20("div", { className: "p-2.5 rounded-lg bg-emerald-500/10 border border-emerald-500/30 text-emerald-600 text-[11px]", children: aiSuccess })
4067
4115
  ] })
4068
4116
  ] })
4069
4117
  ] })