@beeintel/batch-image 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +7 -3
  2. package/dist/chunks/{AdjustToolPanel-B6dtlFlj.js → AdjustToolPanel-DCNhkuE4.js} +21 -20
  3. package/dist/chunks/BackgroundToolPanel-D3TILm-m.js +43 -0
  4. package/dist/chunks/{BatchMaterials-DDoJTaS5.js → BatchMaterials-BPJeE3y9.js} +1 -1
  5. package/dist/chunks/BatchModeChoices-BuP83uOq.js +118 -0
  6. package/dist/chunks/{BatchOutputColorPicker-D7WIDS4_.js → BatchOutputColorPicker-CZoQzBII.js} +2 -2
  7. package/dist/chunks/BatchReferenceFields-B7SL__lu.js +308 -0
  8. package/dist/chunks/BeautifyToolPanel-DsTOjndh.js +220 -0
  9. package/dist/chunks/{BrandMarkToolPanel-vKobk_R3.js → BrandMarkToolPanel-Cob9bPYT.js} +319 -333
  10. package/dist/chunks/{ContentTrimControl-BKCJEst5.js → ContentTrimControl-CKNfHz_u.js} +2 -2
  11. package/dist/chunks/{CropToolPanel-C_sW5tWL.js → CropToolPanel-6MiynTP2.js} +60 -56
  12. package/dist/chunks/CutoutToolPanel-V-AUrbwz.js +78 -0
  13. package/dist/chunks/DisclosureToolPanel-DvouSIbA.js +72 -0
  14. package/dist/chunks/ExpandToolPanel-C98UZmBx.js +69 -0
  15. package/dist/chunks/{ImageEffectsToolPanel-CsDIBpT6.js → ImageEffectsToolPanel-hA0TlEix.js} +63 -52
  16. package/dist/chunks/{IpAuditToolPanel-CduDfFh-.js → IpAuditToolPanel-BCQ8Kewh.js} +15 -13
  17. package/dist/chunks/{ListingToolPanel-8pJ2_zvI.js → ListingToolPanel-DH-xpvLp.js} +170 -184
  18. package/dist/chunks/{MaterialSelectionPlate-CW7HaS6v.js → MaterialSelectionPlate-CQBIf6ZJ.js} +4 -4
  19. package/dist/chunks/MetadataToolPanel-z4RK3JCb.js +116 -0
  20. package/dist/chunks/{OrientToolPanel-C1AzQchm.js → OrientToolPanel-BwtT0xKI.js} +3 -3
  21. package/dist/chunks/PluginActionFooter.vue_vue_type_script_setup_true_lang-DIRuJ1De.js +122 -0
  22. package/dist/chunks/ResizeToolPanel-BVeZbKJl.js +1171 -0
  23. package/dist/chunks/RetouchToolPanel-CqSzWVOK.js +358 -0
  24. package/dist/chunks/ShadowToolPanel-BgsCgLay.js +258 -0
  25. package/dist/chunks/SvgExportToolPanel-CdCXYYHF.js +208 -0
  26. package/dist/chunks/TranslationToolPanel-D4ETI6sf.js +102 -0
  27. package/dist/chunks/{UpscaleToolPanel-BRIgpszs.js → UpscaleToolPanel-D_hmQLEi.js} +44 -39
  28. package/dist/chunks/arrow-up-C1vBvuff.js +18 -0
  29. package/dist/chunks/{entry-CboOSe2r.js → entry-DVV89YMR.js} +7614 -7498
  30. package/dist/chunks/{loader-circle-CylCgDqP.js → loader-circle-GPucRX_4.js} +1 -1
  31. package/dist/chunks/{motionFeatures-D67ghPG1.js → motionFeatures-_pQ-ZW4p.js} +1 -1
  32. package/dist/chunks/{search-BwsDnulU.js → search-CUAg5uDr.js} +1 -1
  33. package/dist/config.d.ts +6 -0
  34. package/dist/index.d.ts +1 -0
  35. package/dist/index.js +6 -5
  36. package/dist/node/cli.mjs +0 -0
  37. package/dist/resources.json +104 -94
  38. package/dist/slots.d.ts +2 -0
  39. package/dist/style.css +1 -1
  40. package/dist/tool-links.d.ts +10 -0
  41. package/dist/types/batch/public/config.d.ts +6 -0
  42. package/package.json +9 -8
  43. package/dist/chunks/BackgroundToolPanel-C3Rr9d4S.js +0 -41
  44. package/dist/chunks/BatchModeChoices-DeBARgvY.js +0 -111
  45. package/dist/chunks/BatchReferenceFields-Cr5WgFRJ.js +0 -316
  46. package/dist/chunks/BeautifyToolPanel-DDZXDQKM.js +0 -215
  47. package/dist/chunks/CutoutToolPanel-B7ObmiWd.js +0 -73
  48. package/dist/chunks/DisclosureToolPanel-F3ccFJIF.js +0 -76
  49. package/dist/chunks/ExpandToolPanel-BKjj5UJA.js +0 -67
  50. package/dist/chunks/MetadataToolPanel-C8XJOamN.js +0 -104
  51. package/dist/chunks/PluginActionFooter.vue_vue_type_script_setup_true_lang-BGe419qz.js +0 -102
  52. package/dist/chunks/ResizeToolPanel-DWikcj2G.js +0 -1178
  53. package/dist/chunks/RetouchToolPanel-B4eQKk2W.js +0 -350
  54. package/dist/chunks/ShadowToolPanel-Bbj76hQd.js +0 -254
  55. package/dist/chunks/SvgExportToolPanel-BRxpzd7q.js +0 -219
  56. package/dist/chunks/TranslationToolPanel-Bxv8U2WY.js +0 -125
@@ -0,0 +1,1171 @@
1
+ import { defineComponent as ae, useId as Ue, computed as C, openBlock as d, createElementBlock as u, unref as e, createElementVNode as s, createCommentVNode as b, defineAsyncComponent as Ge, ref as y, watch as F, onActivated as Qe, nextTick as K, createVNode as m, withCtx as q, Fragment as U, renderList as B, toDisplayString as h, normalizeClass as Ye, createBlock as J, createTextVNode as E } from "vue";
2
+ import { J as oe, F as ie, _ as Se, K as fe, L as pe, N as Xe, O as et, Q as Y, S as tt, T as lt, U as we, V as at, W as ze, P as X, R as ot, X as ye, Y as it, Z as st, $ as ke, a0 as nt, a1 as le, a2 as rt, G as dt } from "./entry-DVV89YMR.js";
3
+ import { ar as _e, ao as Ie } from "./hosted-resources-COzZ7nZY.js";
4
+ import { B as Ce } from "./BatchOutputColorPicker-CZoQzBII.js";
5
+ import { C as ut } from "./ContentTrimControl-CKNfHz_u.js";
6
+ import { S as ct } from "./search-CUAg5uDr.js";
7
+ import { u as ht, a as mt, c as bt, _ as vt, n as gt } from "./PluginActionFooter.vue_vue_type_script_setup_true_lang-DIRuJ1De.js";
8
+ /**
9
+ * @license @lucide/vue v1.47.0 - ISC
10
+ *
11
+ * This source code is licensed under the ISC license.
12
+ * See the LICENSE file in the root directory of this source tree.
13
+ */
14
+ const ft = {
15
+ name: "arrow-left-right",
16
+ size: 24,
17
+ node: [
18
+ ["path", { d: "M8 3 4 7l4 4", key: "9rb6wj" }],
19
+ ["path", { d: "M4 7h16", key: "6tx8e3" }],
20
+ ["path", { d: "m16 21 4-4-4-4", key: "siv7j2" }],
21
+ ["path", { d: "M20 17H4", key: "h6l3hr" }]
22
+ ]
23
+ }, Ve = oe(ft);
24
+ /**
25
+ * @license @lucide/vue v1.47.0 - ISC
26
+ *
27
+ * This source code is licensed under the ISC license.
28
+ * See the LICENSE file in the root directory of this source tree.
29
+ */
30
+ const pt = {
31
+ name: "lock-open",
32
+ size: 24,
33
+ node: [
34
+ ["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
35
+ ["path", { d: "M7 11V7a5 5 0 0 1 9.9-1", key: "1mm8w8" }]
36
+ ],
37
+ aliases: ["unlock"]
38
+ }, wt = oe(pt);
39
+ /**
40
+ * @license @lucide/vue v1.47.0 - ISC
41
+ *
42
+ * This source code is licensed under the ISC license.
43
+ * See the LICENSE file in the root directory of this source tree.
44
+ */
45
+ const zt = {
46
+ name: "lock",
47
+ size: 24,
48
+ node: [
49
+ ["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
50
+ ["path", { d: "M7 11V7a5 5 0 0 1 10 0v4", key: "fwvmzm" }]
51
+ ]
52
+ }, yt = oe(zt), kt = ["viewBox", "aria-label"], Ct = ["id", "width", "height"], Vt = ["width", "height"], Pt = ["width", "height"], xt = ["x", "y", "width", "height"], $t = ["id"], Rt = ["width", "height"], Lt = ["width", "height", "fill"], Ut = ["clip-path"], St = ["x", "y", "width", "height", "viewBox"], _t = ["width", "height"], It = ["points"], Mt = ["cx", "cy", "r"], Dt = ["d"], Bt = ["x", "y", "width", "height"], Et = ["width", "height"], At = /* @__PURE__ */ ae({
53
+ __name: "SizeCropIllustration",
54
+ props: {
55
+ label: {},
56
+ width: {},
57
+ height: {},
58
+ method: {},
59
+ anchor: {},
60
+ background: { default: "#ffffff" },
61
+ sourceWidth: { default: 5461 },
62
+ sourceHeight: { default: 4096 },
63
+ allowEnlargement: { type: Boolean, default: !0 }
64
+ },
65
+ setup(t) {
66
+ const { ui: _, uiText: A } = ie(), i = t, c = Ue(), o = C(() => {
67
+ if (i.method === "crop") {
68
+ const z = _e(i.sourceWidth, i.sourceHeight, {
69
+ version: 1,
70
+ ratio: `${i.width}:${i.height}`,
71
+ anchor: i.anchor
72
+ });
73
+ return {
74
+ width: i.sourceWidth,
75
+ height: i.sourceHeight,
76
+ image: { x: 0, y: 0, width: i.sourceWidth, height: i.sourceHeight },
77
+ crop: z,
78
+ mask: `M0 0h${i.sourceWidth}v${i.sourceHeight}h-${i.sourceWidth}Z M${z.x} ${z.y}h${z.width}v${z.height}h-${z.width}Z`
79
+ };
80
+ }
81
+ const p = Ie(i.sourceWidth, i.sourceHeight, {
82
+ width: i.width,
83
+ height: i.height,
84
+ fit: i.method,
85
+ position: i.anchor,
86
+ background: i.background,
87
+ allowEnlargement: i.allowEnlargement
88
+ });
89
+ return {
90
+ width: p.width,
91
+ height: p.height,
92
+ image: p.imageRect,
93
+ crop: void 0,
94
+ mask: void 0
95
+ };
96
+ });
97
+ return (p, z) => (d(), u("svg", {
98
+ viewBox: `0 0 ${o.value.width} ${o.value.height}`,
99
+ role: "img",
100
+ "aria-label": e(A)(t.label),
101
+ preserveAspectRatio: "xMidYMid meet",
102
+ class: "size-illustration"
103
+ }, [
104
+ s("defs", null, [
105
+ s("pattern", {
106
+ id: `${e(c)}-checker`,
107
+ width: o.value.width / 8,
108
+ height: o.value.height / 8,
109
+ patternUnits: "userSpaceOnUse"
110
+ }, [
111
+ s("rect", {
112
+ width: o.value.width / 8,
113
+ height: o.value.height / 8,
114
+ fill: "#ffffff"
115
+ }, null, 8, Vt),
116
+ s("rect", {
117
+ width: o.value.width / 16,
118
+ height: o.value.height / 16,
119
+ fill: "#e4e4e7"
120
+ }, null, 8, Pt),
121
+ s("rect", {
122
+ x: o.value.width / 16,
123
+ y: o.value.height / 16,
124
+ width: o.value.width / 16,
125
+ height: o.value.height / 16,
126
+ fill: "#e4e4e7"
127
+ }, null, 8, xt)
128
+ ], 8, Ct),
129
+ s("clipPath", {
130
+ id: `${e(c)}-clip`
131
+ }, [
132
+ s("rect", {
133
+ x: "0",
134
+ y: "0",
135
+ width: o.value.width,
136
+ height: o.value.height
137
+ }, null, 8, Rt)
138
+ ], 8, $t)
139
+ ]),
140
+ s("rect", {
141
+ x: "0",
142
+ y: "0",
143
+ width: o.value.width,
144
+ height: o.value.height,
145
+ fill: t.background === "transparent" ? `url(#${e(c)}-checker)` : t.background
146
+ }, null, 8, Lt),
147
+ s("g", {
148
+ "clip-path": `url(#${e(c)}-clip)`
149
+ }, [
150
+ (d(), u("svg", {
151
+ x: o.value.image.x,
152
+ y: o.value.image.y,
153
+ width: o.value.image.width,
154
+ height: o.value.image.height,
155
+ viewBox: `0 0 ${t.sourceWidth} ${t.sourceHeight}`,
156
+ preserveAspectRatio: "none",
157
+ class: "size-illustration-photo"
158
+ }, [
159
+ s("rect", {
160
+ x: "0",
161
+ y: "0",
162
+ width: t.sourceWidth,
163
+ height: t.sourceHeight,
164
+ fill: "#eff3e8"
165
+ }, null, 8, _t),
166
+ s("polygon", {
167
+ points: `0,${t.sourceHeight} ${t.sourceWidth * 0.4},${t.sourceHeight * 0.4} ${t.sourceWidth * 0.83},${t.sourceHeight}`,
168
+ fill: "#b7c69f"
169
+ }, null, 8, It),
170
+ s("circle", {
171
+ cx: t.sourceWidth * 0.76,
172
+ cy: t.sourceHeight * 0.24,
173
+ r: Math.min(t.sourceWidth, t.sourceHeight) * 0.075,
174
+ fill: "#91a76d"
175
+ }, null, 8, Mt)
176
+ ], 8, St)),
177
+ o.value.mask ? (d(), u("path", {
178
+ key: 0,
179
+ d: o.value.mask,
180
+ fill: "#24262a",
181
+ "fill-opacity": ".2",
182
+ "fill-rule": "evenodd"
183
+ }, null, 8, Dt)) : b("", !0)
184
+ ], 8, Ut),
185
+ o.value.crop ? (d(), u("rect", {
186
+ key: 0,
187
+ class: "size-illustration-crop",
188
+ x: o.value.crop.x,
189
+ y: o.value.crop.y,
190
+ width: o.value.crop.width,
191
+ height: o.value.crop.height,
192
+ fill: "none",
193
+ stroke: "#84a447",
194
+ "stroke-width": "1.5",
195
+ "vector-effect": "non-scaling-stroke"
196
+ }, null, 8, Bt)) : (d(), u("rect", {
197
+ key: 1,
198
+ x: "0",
199
+ y: "0",
200
+ width: o.value.width,
201
+ height: o.value.height,
202
+ fill: "none",
203
+ stroke: "#a6b690",
204
+ "stroke-width": "1",
205
+ "vector-effect": "non-scaling-stroke"
206
+ }, null, 8, Et))
207
+ ], 8, kt));
208
+ }
209
+ }), ee = /* @__PURE__ */ Se(At, [["__scopeId", "data-v-219fa766"]]), Ht = "" + new URL("../assets/amazon-CjTtpZTq.webp", import.meta.url).href, Tt = "" + new URL("../assets/ebay-CxLfrRAf.webp", import.meta.url).href, Wt = "" + new URL("../assets/etsy-CSvz9GpY.webp", import.meta.url).href, Ot = "" + new URL("../assets/shopify-wVaBafcF.webp", import.meta.url).href, Pe = "" + new URL("../assets/facebook-Ca2nJJiQ.webp", import.meta.url).href, Kt = "" + new URL("../assets/instagram-Bf0IVidT.webp", import.meta.url).href, qt = "" + new URL("../assets/mercado-libre-C8CskEiS.webp", import.meta.url).href, xe = "" + new URL("../assets/whatsapp-CWJxqzR6.webp", import.meta.url).href, $e = "" + new URL("../assets/line-Dr1j___B.webp", import.meta.url).href, Nt = "" + new URL("../assets/poshmark-DnZi2vA1.webp", import.meta.url).href, jt = "" + new URL("../assets/depop-CkVC5Fn1.webp", import.meta.url).href, Ft = "" + new URL("../assets/vinted-1QDsxvC6.webp", import.meta.url).href, Jt = "" + new URL("../assets/shopee-Bxfei6sj.webp", import.meta.url).href, Zt = "" + new URL("../assets/lazada-ConR4e1O.webp", import.meta.url).href, Gt = "" + new URL("../assets/momo-BWXO_8Df.webp", import.meta.url).href, Qt = "" + new URL("../assets/shopline-DMoaJ7Bh.webp", import.meta.url).href, Yt = "" + new URL("../assets/nuvemshop-DPt6rnA-.webp", import.meta.url).href, Re = "" + new URL("../assets/mercari-jp-DHj7nz4O.webp", import.meta.url).href, Xt = "" + new URL("../assets/creema-B1tWyCPx.webp", import.meta.url).href, el = "" + new URL("../assets/rakuten-ulYog1hL.webp", import.meta.url).href, tl = "" + new URL("../assets/qoo10-C1pq81Jx.webp", import.meta.url).href, ll = "" + new URL("../assets/buyma-dAxYNjow.webp", import.meta.url).href, al = "" + new URL("../assets/naver-xQKL8lWg.webp", import.meta.url).href, ol = "" + new URL("../assets/karrot-BXFPhDwt.webp", import.meta.url).href, il = "" + new URL("../assets/g-market-DXuYK_JH.webp", import.meta.url).href, sl = "" + new URL("../assets/ssg-DQoFx5u5.webp", import.meta.url).href, nl = "" + new URL("../assets/idus-7diqRNPs.webp", import.meta.url).href, rl = "" + new URL("../assets/auction-j26eVUQO.webp", import.meta.url).href, dl = "" + new URL("../assets/11st-D7qGO5e4.webp", import.meta.url).href, ul = "" + new URL("../assets/kakao-talk-Df79L_Mv.webp", import.meta.url).href, cl = "" + new URL("../assets/otto-market-DWZyNKJn.webp", import.meta.url).href, hl = "" + new URL("../assets/zalando-CenfWOwz.webp", import.meta.url).href, ml = "" + new URL("../assets/kaufland-BDDy6e0C.webp", import.meta.url).href, bl = "" + new URL("../assets/olx-B87gp-Il.webp", import.meta.url).href, vl = "" + new URL("../assets/douyin-CP_HwBDF.webp", import.meta.url).href, gl = "" + new URL("../assets/youtube-DS12d5mi.webp", import.meta.url).href, fl = "" + new URL("../assets/linkedin-4s_9Wh03.webp", import.meta.url).href, pl = "" + new URL("../assets/pinterest-ByZqih2J.webp", import.meta.url).href, Le = Object.freeze({
210
+ Amazon: Ht,
211
+ eBay: Tt,
212
+ Etsy: Wt,
213
+ Shopify: Ot,
214
+ Facebook: Pe,
215
+ Instagram: Kt,
216
+ "Mercado Libre": qt,
217
+ WhatsApp: xe,
218
+ LINE: $e,
219
+ Poshmark: Nt,
220
+ Depop: jt,
221
+ Vinted: Ft,
222
+ Shopee: Jt,
223
+ Lazada: Zt,
224
+ MOMO: Gt,
225
+ Shopline: Qt,
226
+ Nuvemshop: Yt,
227
+ "Mercari JP": Re,
228
+ Creema: Xt,
229
+ Rakuten: el,
230
+ Qoo10: tl,
231
+ BUYMA: ll,
232
+ Naver: al,
233
+ Karrot: ol,
234
+ "G Market": il,
235
+ SSG: sl,
236
+ Idus: nl,
237
+ Auction: rl,
238
+ "11st": dl,
239
+ "Kakao Talk": ul,
240
+ "Otto Market": cl,
241
+ Zalando: hl,
242
+ Kaufland: ml,
243
+ OLX: bl,
244
+ 抖音: vl,
245
+ YouTube: gl,
246
+ LinkedIn: fl,
247
+ Pinterest: pl,
248
+ "Facebook Marketplace": Pe,
249
+ "WhatsApp Business": xe,
250
+ "LINE Shop": $e,
251
+ Mercari: Re
252
+ });
253
+ function te(t) {
254
+ const _ = Object.prototype.hasOwnProperty.call(Le, t) ? Le[t] : void 0;
255
+ return _ ? { src: _, alt: t } : void 0;
256
+ }
257
+ const wl = ["aria-label"], zl = ["aria-label"], yl = ["id", "aria-controls", "aria-selected", "tabindex", "disabled", "data-size-mode", "onClick", "onKeydown"], kl = {
258
+ key: 0,
259
+ class: "size-search"
260
+ }, Cl = ["disabled", "aria-label", "aria-controls", "aria-expanded", "aria-activedescendant", "value", "placeholder"], Vl = ["disabled", "aria-label", "title"], Pl = {
261
+ key: 1,
262
+ class: "size-snapshot-note"
263
+ }, xl = ["id", "aria-labelledby", "disabled"], $l = { class: "size-catalog-heading" }, Rl = ["aria-label", "title"], Ll = ["id", "aria-label"], Ul = ["aria-label"], Sl = ["id", "aria-selected", "tabindex", "data-option-index", "title", "onClick"], _l = { class: "size-platform-mark" }, Il = ["src", "alt"], Ml = ["title"], Dl = {
264
+ key: 2,
265
+ viewBox: "0 0 24 24",
266
+ "aria-hidden": "true"
267
+ }, Bl = { class: "size-catalog-copy" }, El = { key: 0 }, Al = { key: 1 }, Hl = { key: 2 }, Tl = { class: "size-catalog-icons" }, Wl = {
268
+ viewBox: "0 0 24 24",
269
+ "aria-hidden": "true"
270
+ }, Ol = ["x", "y", "width", "height"], Kl = {
271
+ key: 0,
272
+ class: "size-empty"
273
+ }, ql = ["aria-label", "disabled"], Nl = ["id", "aria-labelledby", "disabled"], jl = {
274
+ key: 1,
275
+ class: "size-background"
276
+ }, Fl = {
277
+ key: 0,
278
+ class: "size-quick-presets"
279
+ }, Jl = ["aria-label", "aria-pressed", "title", "onClick"], Zl = {
280
+ viewBox: "0 0 24 24",
281
+ "aria-hidden": "true"
282
+ }, Gl = ["width", "height"], Ql = {
283
+ key: 0,
284
+ d: "M9 12h6M12 9v6",
285
+ stroke: "currentColor",
286
+ "stroke-width": "1.4"
287
+ }, Yl = {
288
+ key: 1,
289
+ d: "M8 12h8M12 8v8",
290
+ stroke: "currentColor",
291
+ "stroke-width": "1.4"
292
+ }, Xl = {
293
+ key: 2,
294
+ class: "size-template-label"
295
+ }, ea = ["title"], ta = {
296
+ key: 3,
297
+ class: "size-original-note"
298
+ }, la = { class: "size-specification" }, aa = ["title"], oa = {
299
+ key: 0,
300
+ class: "size-preset-actions"
301
+ }, ia = ["aria-label", "title"], sa = ["aria-label"], na = ["data-method", "aria-label", "aria-checked", "tabindex", "title", "onClick", "onKeydown"], ra = {
302
+ key: 0,
303
+ class: "size-current-output",
304
+ role: "status"
305
+ }, da = { class: "size-dimensions" }, ua = ["aria-label", "value", "aria-invalid", "aria-describedby"], ca = { class: "size-dimension-icons" }, ha = ["aria-label", "title", "aria-checked", "disabled"], ma = ["aria-label", "title", "disabled"], ba = ["aria-label", "value", "aria-invalid", "aria-describedby"], va = ["id"], ga = { class: "size-position-controls" }, fa = ["aria-label"], pa = ["aria-label", "title", "aria-pressed", "onClick"], wa = { class: "size-position-examples" }, za = {
306
+ key: 2,
307
+ class: "size-background"
308
+ }, ya = {
309
+ key: 3,
310
+ class: "size-advanced"
311
+ }, ka = ["tabindex", "aria-disabled"], Ca = { class: "size-enlarge-field" }, Va = ["aria-label", "aria-checked"], Pa = ["aria-label", "value"], xa = ["value"], $a = ["aria-label"], Ra = /* @__PURE__ */ ae({
312
+ name: "SizeCropPanel",
313
+ __name: "SizeCropPanel",
314
+ props: {
315
+ modelValue: {},
316
+ disabled: { type: Boolean },
317
+ count: {},
318
+ currentWidth: {},
319
+ currentHeight: {},
320
+ scopeKey: {},
321
+ viewingSnapshot: { type: Boolean },
322
+ hideReset: { type: Boolean },
323
+ trimPreviewSource: {},
324
+ trimEstimateApplied: { type: Boolean }
325
+ },
326
+ emits: ["update:modelValue", "validity"],
327
+ setup(t, { expose: _, emit: A }) {
328
+ const { ui: i, uiText: c } = ie(), o = t, p = A, z = Ge(
329
+ () => import("./MaterialSelectionPlate-CQBIf6ZJ.js")
330
+ ), I = y(!1);
331
+ let M = !1;
332
+ F(
333
+ () => o.modelValue,
334
+ () => {
335
+ I.value = M, M = !1;
336
+ }
337
+ );
338
+ const g = Ue(), f = y(!1), P = y(""), $ = y(0), v = y(-1), x = y(), Q = y(), se = y(), H = y(String(o.modelValue.width)), T = y(String(o.modelValue.height)), w = y(""), ne = y(!0), R = C(() => o.modelValue.method === "trim" ? "trim" : "size"), Me = [
339
+ { value: "size", label: "尺寸 / 比例" },
340
+ { value: "trim", label: "按内容裁边" }
341
+ ], S = [
342
+ { value: "contain", label: "完整保留", help: "等比缩放,可留白" },
343
+ { value: "cover", label: "裁满画布", help: "等比铺满,裁去边缘" },
344
+ { value: "crop", label: "仅裁切", help: "只按比例裁切,不缩放" }
345
+ ], re = [
346
+ { value: "lanczos3", label: "Lanczos3 · 清晰" },
347
+ { value: "mitchell", label: "Mitchell · 平衡" },
348
+ { value: "cubic", label: "Catmull-Rom · 平滑" },
349
+ { value: "linear", label: "Bilinear · 柔和" }
350
+ ], de = [
351
+ { value: "top-left", label: "左上", symbol: "↖" },
352
+ { value: "top", label: "顶部", symbol: "↑" },
353
+ { value: "top-right", label: "右上", symbol: "↗" },
354
+ { value: "left", label: "左侧", symbol: "←" },
355
+ { value: "center", label: "居中", symbol: "·" },
356
+ { value: "right", label: "右侧", symbol: "→" },
357
+ { value: "bottom-left", label: "左下", symbol: "↙" },
358
+ { value: "bottom", label: "底部", symbol: "↓" },
359
+ { value: "bottom-right", label: "右下", symbol: "↘" }
360
+ ], ue = {
361
+ "standard-square": "方图",
362
+ "standard-portrait": "竖图",
363
+ "standard-landscape": "横图",
364
+ custom: "自定义"
365
+ }, De = { original: "保持各图当前尺寸", custom: "自定义尺寸" }, Be = {
366
+ reference: "参考尺寸",
367
+ "official-minimum": "官方最低尺寸",
368
+ "official-recommended": "官方建议尺寸"
369
+ }, W = C(
370
+ () => ["original", "custom"].includes(o.modelValue.presetId) ? void 0 : fe(o.modelValue.presetId)
371
+ ), Ee = C(
372
+ () => o.modelValue.sizeMode === "original" ? i("tools.resize.sizeCropPanel_2dfe85f0") : W.value ? [W.value.platform, c(W.value.label)].filter(Boolean).join(" · ") : i("tools.resize.sizeCropPanel_8a2e2847")
373
+ ), Ae = C(() => pe(o.modelValue)), k = C(() => Xe(P.value)), He = C(() => {
374
+ if (P.value.trim())
375
+ return [
376
+ {
377
+ id: "search",
378
+ label: i("tools.resize.sizeCropPanel_88d72ece"),
379
+ options: k.value.map((n, l) => ({ preset: n, index: l }))
380
+ }
381
+ ];
382
+ const a = [];
383
+ return k.value.forEach((n, l) => {
384
+ let r = a.find((V) => V.id === n.group);
385
+ r || (r = {
386
+ id: n.group,
387
+ label: et.find((V) => V.id === n.group)?.label ?? n.group,
388
+ options: []
389
+ }, a.push(r)), r.options.push({ preset: n, index: l });
390
+ }), a;
391
+ }), Te = C(
392
+ () => v.value >= 0 && k.value[v.value] ? `${g}-option-${k.value[v.value].id}` : void 0
393
+ ), We = C(
394
+ () => i(
395
+ o.modelValue.method === "contain" ? "tools.resize.positionAligned" : "tools.resize.positionKept",
396
+ {
397
+ position: c(
398
+ de.find((a) => a.value === o.modelValue.anchor)?.label || "居中"
399
+ )
400
+ }
401
+ )
402
+ ), ce = C(() => {
403
+ if (o.modelValue.method === "trim") return i("tools.crop.contentTrim.singlePreview");
404
+ if (o.modelValue.sizeMode === "original") return "";
405
+ if (o.modelValue.method !== "crop") {
406
+ if (o.modelValue.allowEnlargement || o.viewingSnapshot || !o.currentWidth || !o.currentHeight)
407
+ return "";
408
+ try {
409
+ const a = Ie(o.currentWidth, o.currentHeight, {
410
+ width: o.modelValue.width,
411
+ height: o.modelValue.height,
412
+ fit: o.modelValue.method,
413
+ background: o.modelValue.background,
414
+ position: o.modelValue.anchor,
415
+ allowEnlargement: !1
416
+ });
417
+ return a.skipped ? i("tools.resize.sizeCropPanel_113e4bd6", { p0: a.width, p1: a.height }) : "";
418
+ } catch {
419
+ return "";
420
+ }
421
+ }
422
+ if (o.viewingSnapshot || !o.currentWidth || !o.currentHeight)
423
+ return i("tools.resize.sizeCropPanel_347ab08e");
424
+ try {
425
+ const a = _e(o.currentWidth, o.currentHeight, {
426
+ version: 1,
427
+ ratio: `${o.modelValue.width}:${o.modelValue.height}`,
428
+ anchor: o.modelValue.anchor
429
+ });
430
+ return i("tools.resize.sizeCropPanel_c87c0205", { p0: a.width, p1: a.height });
431
+ } catch {
432
+ return i("tools.resize.sizeCropPanel_fd9f2cab");
433
+ }
434
+ });
435
+ function N(a) {
436
+ return a ? a.id === "original" ? "保持每张图片当前版本的像素尺寸,无需处理;不是恢复上传原图。" : a.id === "custom" ? "自选模板宽高或裁切比例。" : `${a.platform} · ${c(a.label)} · ${a.width} × ${a.height} · ${ze(a)} · ${c(Be[a.basis])}${a.source ? ` · ${i("common.source")}: ${c(a.source)}` : ""}` : "可自定义宽高与处理方式。";
437
+ }
438
+ function j(a) {
439
+ const n = Number(a);
440
+ return !!a.trim() && Number.isInteger(n) && n >= 1 && n <= 4096;
441
+ }
442
+ function D() {
443
+ o.disabled || p(
444
+ "validity",
445
+ o.modelValue.method === "trim" ? ne.value : !w.value && j(H.value) && j(T.value)
446
+ );
447
+ }
448
+ function O(a = o.modelValue) {
449
+ H.value = String(a.width), T.value = String(a.height), w.value = "", D();
450
+ }
451
+ function L(a, n) {
452
+ o.disabled || (M = !!n?.detail, p("update:modelValue", ye({ ...o.modelValue, ...a })));
453
+ }
454
+ function he(a, n) {
455
+ o.disabled || R.value === a || (M = !!n?.detail, f.value = !1, p("update:modelValue", it(o.modelValue, a)));
456
+ }
457
+ function Oe(a, n) {
458
+ if (o.disabled || a.defaultPrevented) return;
459
+ let l;
460
+ if (["ArrowLeft", "ArrowRight"].includes(a.key)) l = n === "size" ? "trim" : "size";
461
+ else if (a.key === "Home") l = "size";
462
+ else if (a.key === "End") l = "trim";
463
+ else return;
464
+ a.preventDefault(), a.stopPropagation();
465
+ const r = a.currentTarget.closest("[role=tablist]");
466
+ he(l), K(
467
+ () => r?.querySelector(`[data-size-mode="${l}"]`)?.focus()
468
+ );
469
+ }
470
+ function Ke(a) {
471
+ (a === "transparent" || /^#[0-9a-f]{6}$/i.test(a)) && L({ background: a.toLowerCase() });
472
+ }
473
+ function qe(a) {
474
+ const n = a.target.value;
475
+ re.some((l) => l.value === n) && L({ kernel: n });
476
+ }
477
+ function Z(a, n) {
478
+ if (o.disabled) return;
479
+ M = !!n?.detail;
480
+ const l = st(o.modelValue, a);
481
+ O(l), p("update:modelValue", l), G();
482
+ }
483
+ function me(a, n) {
484
+ if (o.disabled) return;
485
+ const l = n.target.value;
486
+ if (a === "width" ? H.value = l : T.value = l, w.value = "", !j(l) || !o.modelValue.lockRatio && (!j(H.value) || !j(T.value))) {
487
+ w.value = "宽高需为 1–4096 的整数。", D();
488
+ return;
489
+ }
490
+ try {
491
+ let r = ke(o.modelValue, a, Number(l));
492
+ if (!o.modelValue.lockRatio) {
493
+ const V = a === "width" ? "height" : "width";
494
+ r = ke(
495
+ r,
496
+ V,
497
+ Number(V === "width" ? H.value : T.value)
498
+ );
499
+ }
500
+ O(r), p("update:modelValue", r);
501
+ } catch {
502
+ w.value = "锁定比例后的宽高需在 1–4096 之间。", D();
503
+ }
504
+ }
505
+ function be() {
506
+ if (o.disabled || w.value) return;
507
+ const a = nt(o.modelValue);
508
+ O(a), p("update:modelValue", a);
509
+ }
510
+ function Ne() {
511
+ if (o.disabled) return;
512
+ const a = ye(le);
513
+ O(a), p("update:modelValue", a);
514
+ }
515
+ function G() {
516
+ const a = f.value;
517
+ x.value && ($.value = x.value.scrollTop), f.value = !1, a && K(() => se.value?.focus());
518
+ }
519
+ function je() {
520
+ return f.value ? (G(), !0) : !1;
521
+ }
522
+ _({ dismissOverlay: je, hasOverlay: () => f.value });
523
+ async function Fe() {
524
+ o.disabled || (f.value = !0, v.value = k.value.findIndex((a) => a.id === o.modelValue.presetId), await K(), x.value && (x.value.scrollTop = $.value), Q.value?.focus());
525
+ }
526
+ function Je(a) {
527
+ o.disabled || (P.value = a.target.value, v.value = -1, $.value = 0, P.value.trim() && (f.value = !0), x.value && (x.value.scrollTop = 0));
528
+ }
529
+ function ve(a) {
530
+ if (o.disabled || a.defaultPrevented) return;
531
+ if (a.key === "Escape") {
532
+ a.preventDefault(), a.stopPropagation(), G();
533
+ return;
534
+ }
535
+ const n = a.target.closest("[data-option-index]");
536
+ if (!(a.target !== Q.value && !n)) {
537
+ if (!f.value && ["ArrowDown", "ArrowUp", "Home", "End", "Enter"].includes(a.key) && (f.value = !0, v.value = -1), a.key === "Enter" && k.value.length) {
538
+ const l = n ? Number(n.dataset.optionIndex) : Math.max(0, v.value);
539
+ a.preventDefault(), a.stopPropagation(), Z(k.value[l].id);
540
+ return;
541
+ }
542
+ ["ArrowDown", "ArrowUp", "Home", "End"].includes(a.key) && (a.preventDefault(), a.stopPropagation(), k.value.length && (n && (v.value = Number(n.dataset.optionIndex)), a.key === "Home" ? v.value = 0 : a.key === "End" ? v.value = k.value.length - 1 : a.key === "ArrowDown" ? v.value = (v.value + 1) % k.value.length : v.value = v.value <= 0 ? k.value.length - 1 : v.value - 1, K(() => {
543
+ const l = x.value?.querySelector(
544
+ `[data-option-index="${v.value}"]`
545
+ );
546
+ l?.scrollIntoView?.({ block: "nearest" }), n && l?.focus();
547
+ })));
548
+ }
549
+ }
550
+ function Ze(a, n) {
551
+ if (o.disabled || a.defaultPrevented) return;
552
+ const l = S.findIndex((ge) => ge.value === n);
553
+ let r;
554
+ if (a.key === "ArrowRight" || a.key === "ArrowDown") r = (l + 1) % S.length;
555
+ else if (a.key === "ArrowLeft" || a.key === "ArrowUp")
556
+ r = (l + S.length - 1) % S.length;
557
+ else if (a.key === "Home") r = 0;
558
+ else if (a.key === "End") r = S.length - 1;
559
+ else return;
560
+ a.preventDefault(), a.stopPropagation(), L({ method: S[r].value });
561
+ const V = a.currentTarget?.parentElement;
562
+ K(
563
+ () => V?.querySelector(`[data-method="${S[r].value}"]`)?.focus()
564
+ );
565
+ }
566
+ return F(
567
+ [
568
+ () => o.modelValue.width,
569
+ () => o.modelValue.height,
570
+ () => o.modelValue.presetId,
571
+ () => o.modelValue.sizeMode
572
+ ],
573
+ () => O(),
574
+ { immediate: !0 }
575
+ ), F(
576
+ () => o.modelValue.method,
577
+ () => D()
578
+ ), F(
579
+ () => o.scopeKey,
580
+ () => {
581
+ P.value = "", $.value = 0, v.value = -1, f.value = !1, O();
582
+ }
583
+ ), F(
584
+ () => o.disabled,
585
+ (a) => {
586
+ a ? f.value = !1 : D();
587
+ }
588
+ ), Qe(() => {
589
+ I.value = !1, D(), f.value && K(() => {
590
+ x.value && (x.value.scrollTop = $.value);
591
+ });
592
+ }), (a, n) => (d(), u("section", {
593
+ class: "size-crop-panel material-selection-controls",
594
+ "aria-label": e(i)("tools.resize.sizeCropPanel_46d77e1e")
595
+ }, [
596
+ m(e(Y), {
597
+ id: `${e(g)}-material-modes`
598
+ }, {
599
+ default: q(() => [
600
+ s("div", {
601
+ class: "size-mode-tabs",
602
+ role: "tablist",
603
+ "aria-label": e(c)("处理目标")
604
+ }, [
605
+ (d(), u(U, null, B(Me, (l) => s("button", {
606
+ id: `${e(g)}-${l.value}-tab`,
607
+ key: l.value,
608
+ type: "button",
609
+ role: "tab",
610
+ "aria-controls": `${e(g)}-mode-page`,
611
+ "aria-selected": R.value === l.value,
612
+ tabindex: R.value === l.value ? 0 : -1,
613
+ disabled: t.disabled,
614
+ "data-size-mode": l.value,
615
+ onClick: (r) => he(l.value, r),
616
+ onKeydown: (r) => Oe(r, l.value)
617
+ }, [
618
+ m(e(z), {
619
+ selected: R.value === l.value,
620
+ animate: I.value
621
+ }, null, 8, ["selected", "animate"]),
622
+ s("span", null, h(e(c)(l.label)), 1)
623
+ ], 40, yl)), 64))
624
+ ], 8, zl)
625
+ ]),
626
+ _: 1
627
+ }, 8, ["id"]),
628
+ R.value === "size" ? (d(), u("div", kl, [
629
+ m(e(ct), { size: 15 }),
630
+ s("input", {
631
+ ref_key: "searchInput",
632
+ ref: Q,
633
+ type: "search",
634
+ disabled: t.disabled,
635
+ "aria-label": e(i)("tools.resize.sizeCropPanel_83918892"),
636
+ role: "combobox",
637
+ "aria-controls": f.value ? `${e(g)}-catalog` : void 0,
638
+ "aria-expanded": f.value,
639
+ "aria-activedescendant": f.value ? Te.value : void 0,
640
+ value: P.value,
641
+ placeholder: e(i)("tools.resize.sizeCropPanel_afce8afc"),
642
+ onInput: Je,
643
+ onKeydown: ve
644
+ }, null, 40, Cl),
645
+ s("button", {
646
+ ref_key: "catalogButton",
647
+ ref: se,
648
+ type: "button",
649
+ class: "size-browse-icon",
650
+ disabled: t.disabled,
651
+ "aria-label": e(i)("tools.resize.sizeCropPanel_81807c31"),
652
+ title: e(i)("tools.resize.sizeCropPanel_4be6e4b2"),
653
+ onClick: Fe
654
+ }, [
655
+ m(e(tt), { size: 15 })
656
+ ], 8, Vl)
657
+ ])) : b("", !0),
658
+ t.viewingSnapshot ? (d(), u("p", Pl, h(e(i)("tools.resize.sizeCropPanel_17f0beee")), 1)) : b("", !0),
659
+ f.value ? (d(), u("fieldset", {
660
+ key: 2,
661
+ id: `${e(g)}-mode-page`,
662
+ role: "tabpanel",
663
+ "aria-labelledby": `${e(g)}-${R.value}-tab`,
664
+ class: "size-catalog",
665
+ disabled: t.disabled,
666
+ onKeydown: ve
667
+ }, [
668
+ s("div", $l, [
669
+ s("button", {
670
+ type: "button",
671
+ "aria-label": e(i)("tools.resize.sizeCropPanel_70d27247"),
672
+ title: e(i)("tools.resize.sizeCropPanel_70d27247"),
673
+ onClick: G
674
+ }, [
675
+ m(e(lt), {
676
+ class: "directional-icon",
677
+ size: 16
678
+ })
679
+ ], 8, Rl),
680
+ s("strong", null, h(e(i)("tools.resize.sizeCropPanel_e2396e63")), 1),
681
+ s("small", null, h(k.value.length), 1)
682
+ ]),
683
+ s("div", {
684
+ ref_key: "catalogScroll",
685
+ ref: x,
686
+ class: "size-catalog-scroll",
687
+ onScroll: n[1] || (n[1] = (l) => $.value = l.target.scrollTop)
688
+ }, [
689
+ s("div", {
690
+ id: `${e(g)}-catalog`,
691
+ role: "listbox",
692
+ "aria-label": e(i)("tools.resize.sizeCropPanel_154d27a1")
693
+ }, [
694
+ (d(!0), u(U, null, B(He.value, (l) => (d(), u("section", {
695
+ key: l.id,
696
+ class: "size-catalog-group",
697
+ role: "group",
698
+ "aria-label": e(c)(l.label)
699
+ }, [
700
+ s("h2", null, h(e(c)(l.label)), 1),
701
+ (d(!0), u(U, null, B(l.options, ({ preset: r, index: V }) => (d(), u("button", {
702
+ id: `${e(g)}-option-${r.id}`,
703
+ key: r.id,
704
+ type: "button",
705
+ role: "option",
706
+ "aria-selected": r.id === t.modelValue.presetId,
707
+ tabindex: v.value === V ? 0 : -1,
708
+ class: Ye({ "catalog-active": v.value === V }),
709
+ "data-option-index": V,
710
+ title: N(r),
711
+ onClick: (ge) => Z(r.id)
712
+ }, [
713
+ s("span", _l, [
714
+ e(te)(r.platform) ? (d(), u("img", {
715
+ key: 0,
716
+ src: e(te)(r.platform)?.src,
717
+ alt: e(te)(r.platform)?.alt,
718
+ loading: "lazy",
719
+ decoding: "async"
720
+ }, null, 8, Il)) : r.platform ? (d(), u("span", {
721
+ key: 1,
722
+ class: "size-logo-pending",
723
+ title: e(i)("tools.resize.sizeCropPanel_3cdfa056")
724
+ }, "…", 8, Ml)) : (d(), u("svg", Dl, [...n[10] || (n[10] = [
725
+ s("rect", {
726
+ x: "4",
727
+ y: "4",
728
+ width: "16",
729
+ height: "16",
730
+ rx: "2",
731
+ fill: "none",
732
+ stroke: "currentColor",
733
+ "stroke-width": "1.5"
734
+ }, null, -1)
735
+ ])]))
736
+ ]),
737
+ s("span", Bl, [
738
+ s("strong", null, h(e(c)([r.platform, e(c)(r.label)].filter(Boolean).join(" · "))), 1),
739
+ r.id === "original" ? (d(), u("small", El, h(e(i)("tools.resize.sizeCropPanel_9634746f")), 1)) : r.id === "custom" ? (d(), u("small", Al, h(e(i)("tools.resize.sizeCropPanel_62883eae")), 1)) : (d(), u("small", Hl, h(r.width) + " × " + h(r.height) + " · " + h(e(pe)(r)), 1))
740
+ ]),
741
+ s("span", Tl, [
742
+ m(e(we), {
743
+ size: 13,
744
+ role: "img",
745
+ "aria-hidden": !1,
746
+ "aria-label": N(r)
747
+ }, null, 8, ["aria-label"]),
748
+ (d(), u("svg", Wl, [
749
+ s("rect", {
750
+ x: 12 - Math.min(18, 18 * r.width / r.height) / 2,
751
+ y: 12 - Math.min(18, 18 * r.height / r.width) / 2,
752
+ width: Math.min(18, 18 * r.width / r.height),
753
+ height: Math.min(18, 18 * r.height / r.width),
754
+ rx: "1",
755
+ fill: "none",
756
+ stroke: "currentColor",
757
+ "stroke-width": "1.5"
758
+ }, null, 8, Ol)
759
+ ]))
760
+ ])
761
+ ], 10, Sl))), 128))
762
+ ], 8, Ul))), 128))
763
+ ], 8, Ll),
764
+ k.value.length ? b("", !0) : (d(), u("div", Kl, [
765
+ s("p", null, h(e(i)("tools.resize.sizeCropPanel_7d65f2c5")), 1),
766
+ s("button", {
767
+ type: "button",
768
+ "aria-label": e(i)("tools.resize.sizeCropPanel_74f73eaa"),
769
+ disabled: t.disabled,
770
+ onClick: n[0] || (n[0] = (l) => Z("custom"))
771
+ }, h(e(i)("tools.resize.sizeCropPanel_74f73eaa")), 9, ql)
772
+ ]))
773
+ ], 544)
774
+ ], 40, xl)) : (d(), u("fieldset", {
775
+ key: 3,
776
+ id: `${e(g)}-mode-page`,
777
+ role: "tabpanel",
778
+ "aria-labelledby": `${e(g)}-${R.value}-tab`,
779
+ class: "size-settings",
780
+ disabled: t.disabled
781
+ }, [
782
+ R.value === "trim" ? (d(), J(ut, {
783
+ key: 0,
784
+ class: "size-trim-option",
785
+ enabled: !0,
786
+ "show-switch": !1,
787
+ help: e(i)("common.audit.trimHelp"),
788
+ padding: t.modelValue.trimPadding ?? 0,
789
+ "padding-color": t.modelValue.trimPaddingColor ?? "transparent",
790
+ disabled: t.disabled,
791
+ source: t.trimPreviewSource,
792
+ "estimate-applied": t.trimEstimateApplied,
793
+ onPadding: n[2] || (n[2] = (l) => L({ trimPadding: l })),
794
+ onValidity: n[3] || (n[3] = (l) => {
795
+ ne.value = l, D();
796
+ })
797
+ }, null, 8, ["help", "padding", "padding-color", "disabled", "source", "estimate-applied"])) : b("", !0),
798
+ R.value === "trim" && (t.modelValue.trimPadding ?? 0) > 0 ? (d(), u("div", jl, [
799
+ s("span", null, h(e(i)("tools.resize.sizeCropPanel_360c6f27")), 1),
800
+ m(Ce, {
801
+ "model-value": t.modelValue.trimPaddingColor ?? "transparent",
802
+ disabled: t.disabled,
803
+ "onUpdate:modelValue": n[4] || (n[4] = (l) => L({ trimPaddingColor: l }))
804
+ }, null, 8, ["model-value", "disabled"])
805
+ ])) : b("", !0),
806
+ m(e(Y), {
807
+ id: `${e(g)}-material-presets`
808
+ }, {
809
+ default: q(() => [
810
+ t.modelValue.method !== "trim" ? (d(), u("div", Fl, [
811
+ (d(!0), u(U, null, B(e(at), (l) => (d(), u("button", {
812
+ key: l,
813
+ type: "button",
814
+ "aria-label": e(c)(De[l] ?? ue[l]),
815
+ "aria-pressed": t.modelValue.presetId === l,
816
+ title: l === "original" ? e(i)("tools.resize.sizeCropPanel_2f1fc2ba") : l === "custom" ? e(i)("tools.resize.sizeCropPanel_48ee658b") : N(e(fe)(l)),
817
+ onClick: (r) => Z(l, r)
818
+ }, [
819
+ m(e(z), {
820
+ selected: t.modelValue.presetId === l,
821
+ animate: I.value
822
+ }, null, 8, ["selected", "animate"]),
823
+ (d(), u("svg", Zl, [
824
+ s("rect", {
825
+ x: "4",
826
+ y: "4",
827
+ width: l === "standard-portrait" ? 12 : 16,
828
+ height: l === "standard-landscape" ? 11 : 16,
829
+ rx: "2",
830
+ fill: "none",
831
+ stroke: "currentColor",
832
+ "stroke-width": "1.4"
833
+ }, null, 8, Gl),
834
+ l === "custom" ? (d(), u("path", Ql)) : b("", !0),
835
+ l === "original" ? (d(), u("path", Yl)) : b("", !0)
836
+ ])),
837
+ s("span", null, h(e(c)(ue[l])), 1)
838
+ ], 8, Jl))), 128))
839
+ ])) : b("", !0)
840
+ ]),
841
+ _: 1
842
+ }, 8, ["id"]),
843
+ t.modelValue.method !== "trim" ? (d(), u("div", Xl, [
844
+ s("strong", {
845
+ title: t.modelValue.sizeMode === "original" ? e(i)("tools.resize.sizeCropPanel_a89cc481") : void 0
846
+ }, h(Ee.value), 9, ea),
847
+ W.value ? (d(), J(e(we), {
848
+ key: 0,
849
+ size: 14,
850
+ "aria-label": N(W.value),
851
+ role: "img",
852
+ "aria-hidden": !1,
853
+ title: N(W.value)
854
+ }, null, 8, ["aria-label", "title"])) : b("", !0)
855
+ ])) : b("", !0),
856
+ t.modelValue.sizeMode === "original" && t.modelValue.method !== "trim" ? (d(), u("p", ta, h(e(i)("tools.resize.sizeCropPanel_88a14bd8")), 1)) : b("", !0),
857
+ t.modelValue.sizeMode !== "original" && t.modelValue.method !== "trim" ? (d(), u(U, { key: 4 }, [
858
+ s("div", la, [
859
+ s("p", {
860
+ class: "size-template-meta",
861
+ title: e(i)("tools.resize.sizeCropPanel_84bfaf1d", { p0: e(ze)(t.modelValue) })
862
+ }, h(t.modelValue.width) + " × " + h(t.modelValue.height) + h(t.modelValue.method === "crop" ? e(i)("tools.resize.sizeCropPanel_6418f8c9") : " px") + " · " + h(Ae.value), 9, aa),
863
+ t.modelValue.presetId !== "custom" ? (d(), u("div", oa, [
864
+ s("button", {
865
+ type: "button",
866
+ "aria-label": e(i)("tools.resize.sizeCropPanel_a33be51c"),
867
+ title: e(i)("tools.resize.sizeCropPanel_222b4e3b"),
868
+ onClick: be
869
+ }, [
870
+ m(e(Ve), { size: 13 })
871
+ ], 8, ia)
872
+ ])) : b("", !0)
873
+ ]),
874
+ m(e(Y), {
875
+ id: `${e(g)}-material-methods`
876
+ }, {
877
+ default: q(() => [
878
+ s("div", {
879
+ class: "size-methods",
880
+ role: "radiogroup",
881
+ "aria-label": e(i)("tools.resize.sizeCropPanel_9e09420b")
882
+ }, [
883
+ (d(), u(U, null, B(S, (l) => s("button", {
884
+ key: l.value,
885
+ type: "button",
886
+ role: "radio",
887
+ "data-method": l.value,
888
+ "aria-label": e(c)(l.label),
889
+ "aria-checked": t.modelValue.method === l.value,
890
+ tabindex: t.modelValue.method === l.value ? 0 : -1,
891
+ title: e(c)(l.help),
892
+ onClick: (r) => L({ method: l.value }, r),
893
+ onKeydown: (r) => Ze(r, l.value)
894
+ }, [
895
+ m(e(z), {
896
+ selected: t.modelValue.method === l.value,
897
+ animate: I.value
898
+ }, null, 8, ["selected", "animate"]),
899
+ m(ee, {
900
+ label: e(i)("tools.resize.sizeCropPanel_5549425d", { p0: e(c)(l.label) }),
901
+ width: t.modelValue.width,
902
+ height: t.modelValue.height,
903
+ method: l.value,
904
+ anchor: t.modelValue.anchor,
905
+ "allow-enlargement": t.modelValue.allowEnlargement,
906
+ background: l.value === "contain" ? t.modelValue.background : "#ffffff"
907
+ }, null, 8, ["label", "width", "height", "method", "anchor", "allow-enlargement", "background"]),
908
+ s("span", null, [
909
+ s("strong", null, h(e(c)(l.label)), 1),
910
+ s("small", null, h(e(c)(l.help)), 1)
911
+ ])
912
+ ], 40, na)), 64))
913
+ ], 8, sa)
914
+ ]),
915
+ _: 1
916
+ }, 8, ["id"]),
917
+ ce.value ? (d(), u("p", ra, h(ce.value), 1)) : b("", !0),
918
+ t.modelValue.presetId === "custom" ? (d(), u(U, { key: 1 }, [
919
+ s("div", da, [
920
+ s("label", null, [
921
+ E(h(t.modelValue.method === "crop" ? e(i)("tools.resize.sizeCropPanel_84da7fd0") : e(i)("tools.resize.sizeCropPanel_b9121834")), 1),
922
+ s("input", {
923
+ type: "number",
924
+ min: "1",
925
+ max: "4096",
926
+ step: "1",
927
+ required: "",
928
+ "aria-label": t.modelValue.method === "crop" ? e(i)("tools.resize.sizeCropPanel_8ff0ab56") : e(i)("tools.resize.sizeCropPanel_b9121834"),
929
+ value: H.value,
930
+ "aria-invalid": !!w.value,
931
+ "aria-describedby": w.value ? `${e(g)}-error` : void 0,
932
+ onInput: n[5] || (n[5] = (l) => me("width", l))
933
+ }, null, 40, ua)
934
+ ]),
935
+ s("div", ca, [
936
+ s("button", {
937
+ type: "button",
938
+ role: "switch",
939
+ "aria-label": e(i)("tools.resize.sizeCropPanel_430adb6e"),
940
+ title: e(i)("tools.resize.sizeCropPanel_430adb6e"),
941
+ "aria-checked": t.modelValue.lockRatio,
942
+ disabled: t.disabled || !!w.value,
943
+ onClick: n[6] || (n[6] = (l) => !w.value && L({ lockRatio: !t.modelValue.lockRatio }))
944
+ }, [
945
+ t.modelValue.lockRatio ? (d(), J(e(yt), {
946
+ key: 0,
947
+ size: 13
948
+ })) : (d(), J(e(wt), {
949
+ key: 1,
950
+ size: 13
951
+ }))
952
+ ], 8, ha),
953
+ s("button", {
954
+ type: "button",
955
+ "aria-label": e(i)("tools.resize.sizeCropPanel_a33be51c"),
956
+ title: e(i)("tools.resize.sizeCropPanel_a33be51c"),
957
+ disabled: t.disabled || !!w.value,
958
+ onClick: be
959
+ }, [
960
+ m(e(Ve), { size: 13 })
961
+ ], 8, ma)
962
+ ]),
963
+ s("label", null, [
964
+ E(h(t.modelValue.method === "crop" ? e(i)("tools.resize.sizeCropPanel_cd1cb056") : e(i)("tools.resize.sizeCropPanel_24b4b2d0")), 1),
965
+ s("input", {
966
+ type: "number",
967
+ min: "1",
968
+ max: "4096",
969
+ step: "1",
970
+ required: "",
971
+ "aria-label": t.modelValue.method === "crop" ? e(i)("tools.resize.sizeCropPanel_3aed521e") : e(i)("tools.resize.sizeCropPanel_24b4b2d0"),
972
+ value: T.value,
973
+ "aria-invalid": !!w.value,
974
+ "aria-describedby": w.value ? `${e(g)}-error` : void 0,
975
+ onInput: n[7] || (n[7] = (l) => me("height", l))
976
+ }, null, 40, ba)
977
+ ])
978
+ ]),
979
+ w.value ? (d(), u("p", {
980
+ key: 0,
981
+ id: `${e(g)}-error`,
982
+ class: "size-input-error",
983
+ role: "alert"
984
+ }, h(e(c)(w.value)), 9, va)) : b("", !0)
985
+ ], 64)) : b("", !0),
986
+ (d(), u("div", {
987
+ key: t.modelValue.method,
988
+ class: "size-position"
989
+ }, [
990
+ s("span", null, [
991
+ E(h(t.modelValue.method === "contain" ? e(i)("tools.resize.sizeCropPanel_85424d66") : e(i)("tools.adjust.basicCropPanel_3968f6fd")), 1),
992
+ m(X, {
993
+ text: We.value + " " + e(i)("tools.resize.sizeCropPanel_86ab646d") + " / " + e(i)("tools.resize.sizeCropPanel_577124ca")
994
+ }, null, 8, ["text"])
995
+ ]),
996
+ s("div", ga, [
997
+ s("div", {
998
+ class: "size-anchors",
999
+ role: "group",
1000
+ "aria-label": e(i)("tools.resize.sizeCropPanel_630f1805")
1001
+ }, [
1002
+ (d(), u(U, null, B(de, (l) => s("button", {
1003
+ key: l.value,
1004
+ type: "button",
1005
+ "aria-label": e(i)("tools.resize.sizeCropPanel_efb8bf18", { p0: e(c)(l.label) }),
1006
+ title: e(c)(l.label),
1007
+ "aria-pressed": t.modelValue.anchor === l.value,
1008
+ onClick: (r) => L({ anchor: l.value })
1009
+ }, h(l.symbol), 9, pa)), 64))
1010
+ ], 8, fa),
1011
+ s("div", wa, [
1012
+ s("figure", null, [
1013
+ m(ee, {
1014
+ label: e(i)("tools.resize.sizeCropPanel_888a36a0"),
1015
+ width: t.modelValue.width,
1016
+ height: t.modelValue.height,
1017
+ method: t.modelValue.method,
1018
+ anchor: t.modelValue.anchor,
1019
+ background: t.modelValue.background
1020
+ }, null, 8, ["label", "width", "height", "method", "anchor", "background"])
1021
+ ]),
1022
+ s("figure", null, [
1023
+ m(ee, {
1024
+ label: e(i)("tools.resize.sizeCropPanel_385e86d0"),
1025
+ width: t.modelValue.width,
1026
+ height: t.modelValue.height,
1027
+ method: t.modelValue.method,
1028
+ anchor: t.modelValue.anchor,
1029
+ background: t.modelValue.background,
1030
+ "source-width": 4096,
1031
+ "source-height": 5461
1032
+ }, null, 8, ["label", "width", "height", "method", "anchor", "background"])
1033
+ ])
1034
+ ])
1035
+ ])
1036
+ ])),
1037
+ t.modelValue.method === "contain" ? (d(), u("div", za, [
1038
+ s("span", null, h(e(i)("tools.resize.sizeCropPanel_360c6f27")), 1),
1039
+ m(Ce, {
1040
+ "model-value": t.modelValue.background,
1041
+ disabled: t.disabled,
1042
+ "onUpdate:modelValue": Ke
1043
+ }, null, 8, ["model-value", "disabled"])
1044
+ ])) : b("", !0),
1045
+ t.modelValue.method !== "crop" ? (d(), u("details", ya, [
1046
+ s("summary", {
1047
+ tabindex: t.disabled ? -1 : 0,
1048
+ "aria-disabled": t.disabled,
1049
+ onClick: n[8] || (n[8] = (l) => t.disabled && l.preventDefault())
1050
+ }, h(e(i)("tools.resize.sizeCropPanel_44455611")), 9, ka),
1051
+ s("div", Ca, [
1052
+ s("span", null, [
1053
+ E(h(e(i)("tools.resize.sizeCropPanel_cf811ee0")), 1),
1054
+ m(X, {
1055
+ text: e(i)("common.audit.enlargeHelp")
1056
+ }, null, 8, ["text"])
1057
+ ]),
1058
+ n[12] || (n[12] = E(" >", -1)),
1059
+ s("button", {
1060
+ type: "button",
1061
+ role: "switch",
1062
+ class: "batch-switch",
1063
+ "aria-label": e(i)("tools.resize.sizeCropPanel_cf811ee0"),
1064
+ "aria-checked": t.modelValue.allowEnlargement,
1065
+ onClick: n[9] || (n[9] = (l) => L({ allowEnlargement: !t.modelValue.allowEnlargement }))
1066
+ }, [...n[11] || (n[11] = [
1067
+ s("span", null, null, -1)
1068
+ ])], 8, Va)
1069
+ ]),
1070
+ s("label", null, [
1071
+ s("span", null, [
1072
+ E(h(e(i)("tools.resize.sizeCropPanel_186f04c4")), 1),
1073
+ m(X, {
1074
+ text: e(i)("tools.resize.sizeCropPanel_2454a5d9")
1075
+ }, null, 8, ["text"])
1076
+ ]),
1077
+ s("select", {
1078
+ "aria-label": e(i)("tools.resize.sizeCropPanel_186f04c4"),
1079
+ value: t.modelValue.kernel,
1080
+ onChange: qe
1081
+ }, [
1082
+ (d(), u(U, null, B(re, (l) => s("option", {
1083
+ key: l.value,
1084
+ value: l.value
1085
+ }, h(e(c)(l.label)), 9, xa)), 64))
1086
+ ], 40, Pa)
1087
+ ])
1088
+ ])) : b("", !0)
1089
+ ], 64)) : b("", !0),
1090
+ t.hideReset ? b("", !0) : (d(), u("button", {
1091
+ key: 5,
1092
+ type: "button",
1093
+ class: "size-reset",
1094
+ "aria-label": e(i)("tools.resize.sizeCropPanel_a02f0a52"),
1095
+ onClick: Ne
1096
+ }, [
1097
+ m(e(ot), { size: 14 }),
1098
+ E(h(e(i)("tools.resize.sizeCropPanel_a02f0a52")), 1)
1099
+ ], 8, $a))
1100
+ ], 8, Nl))
1101
+ ], 8, wl));
1102
+ }
1103
+ }), La = /* @__PURE__ */ Se(Ra, [["__scopeId", "data-v-ceeb2fc2"]]), Ua = {
1104
+ key: 0,
1105
+ class: "hint"
1106
+ }, Aa = /* @__PURE__ */ ae({
1107
+ name: "ResizeToolPanel",
1108
+ __name: "ResizeToolPanel",
1109
+ props: {
1110
+ context: {}
1111
+ },
1112
+ setup(t, { expose: _ }) {
1113
+ const { ui: A } = ie(), i = t, c = ht(() => i.context), o = y(), p = y(!0), z = C(
1114
+ () => c.value.sizeCrop.sizeMode === "original" && c.value.sizeCrop.method !== "trim"
1115
+ ), I = C(() => {
1116
+ try {
1117
+ return rt(c.value.sizeCrop).toolId;
1118
+ } catch {
1119
+ return "resize";
1120
+ }
1121
+ }), M = C(() => z.value ? A("common.toolPanel_12d37070") : void 0);
1122
+ _({
1123
+ hasOverlay: () => !!o.value?.hasOverlay(),
1124
+ dismissOverlay: () => !!o.value?.dismissOverlay()
1125
+ });
1126
+ const g = mt(() => i.context, "sizeCrop");
1127
+ return (f, P) => (d(), J(dt, {
1128
+ context: t.context,
1129
+ layout: "contained",
1130
+ changed: e(bt)(e(c).sizeCrop, e(le)),
1131
+ "body-class": "plugin-size-body",
1132
+ onReset: P[1] || (P[1] = ($) => t.context.resetDraft({ sizeCrop: { ...e(le) } }))
1133
+ }, {
1134
+ actions: q(() => [
1135
+ m(vt, {
1136
+ context: t.context,
1137
+ available: e(gt)(t.context, I.value),
1138
+ ready: p.value && !z.value,
1139
+ label: M.value
1140
+ }, {
1141
+ default: q(() => [
1142
+ e(c).sizeCrop.sizeMode === "fixed" && e(c).sizeCrop.method !== "crop" && e(c).sizeCrop.method !== "trim" && !e(c).sizeCrop.allowEnlargement ? (d(), u("p", Ua, h(e(A)("common.toolPanel_76515609")), 1)) : b("", !0)
1143
+ ]),
1144
+ _: 1
1145
+ }, 8, ["context", "available", "ready", "label"])
1146
+ ]),
1147
+ default: q(() => [
1148
+ m(La, {
1149
+ ref_key: "panel",
1150
+ ref: o,
1151
+ "model-value": e(c).sizeCrop,
1152
+ "hide-reset": !0,
1153
+ disabled: t.context.readonly,
1154
+ count: t.context.view.count,
1155
+ "scope-key": t.context.view.batchId,
1156
+ "current-width": t.context.view.currentWidth,
1157
+ "current-height": t.context.view.currentHeight,
1158
+ "viewing-snapshot": t.context.view.viewingSnapshot,
1159
+ "trim-preview-source": t.context.view.currentImageSource,
1160
+ "trim-estimate-applied": t.context.view.trimEstimateApplied,
1161
+ "onUpdate:modelValue": e(g),
1162
+ onValidity: P[0] || (P[0] = ($) => p.value = $)
1163
+ }, null, 8, ["model-value", "disabled", "count", "scope-key", "current-width", "current-height", "viewing-snapshot", "trim-preview-source", "trim-estimate-applied", "onUpdate:modelValue"])
1164
+ ]),
1165
+ _: 1
1166
+ }, 8, ["context", "changed"]));
1167
+ }
1168
+ });
1169
+ export {
1170
+ Aa as default
1171
+ };