image-beautifier 1.0.2 → 1.0.4
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.
- package/README.md +14 -0
- package/lib/image-beautifier.es.js +1271 -1079
- package/lib/style.css +1 -1
- package/package.json +8 -2
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
import { ColorPicker as
|
|
6
|
-
import { observer as
|
|
7
|
-
import { Camera as
|
|
8
|
-
import { TinyColor as
|
|
9
|
-
import { clsx as
|
|
10
|
-
import { twMerge as
|
|
11
|
-
import { makeAutoObservable as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
1
|
+
var hr = Object.defineProperty;
|
|
2
|
+
var pr = (i, t, n) => t in i ? hr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[t] = n;
|
|
3
|
+
var R = (i, t, n) => pr(i, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import kt, { useState as O, useMemo as le, useEffect as N, Children as ot, cloneElement as st, useRef as ne } from "react";
|
|
5
|
+
import { ColorPicker as ur, Button as k, Dropdown as At, Popover as xe, Divider as mr, InputNumber as nt, Tooltip as L, Modal as gr, Switch as at, Input as xr, Radio as P, Segmented as lt, ConfigProvider as Nt, Popconfirm as br, Drawer as wr, Slider as pe, Upload as yr, message as vr, theme as ct } from "antd";
|
|
6
|
+
import { observer as B } from "mobx-react-lite";
|
|
7
|
+
import { Camera as jr, Check as Mr, Square as Cr, Circle as kr, Slash as Ar, MoveDownLeft as Nr, Pencil as Tr, Smile as Sr, Undo as Rr, Redo as Dr, ChevronRight as Hr, ChevronDown as zr, ChevronUp as _r, RotateCcw as Er, ZoomIn as Or, ZoomOut as Br, Hand as Yr, Crop as Ir, FlipHorizontal2 as Pr, FlipVertical2 as Wr, Sunset as Zr, Box as Fr, LayoutGrid as Gr, ImagePlus as Lr, Type as Ur, CodeXml as Vr, ClipboardPaste as Jr, ImagePlay as qr, Maximize as Xr, ListCollapse as Qr, ArrowUpRight as $r, ArrowDownRight as Kr, ImageDown as ei, Copy as ti, Settings2 as ri, ChevronLeft as ii, Pipette as oi, Trash2 as si, Sun as ni, Moon as ai, icons as dt } from "lucide-react";
|
|
8
|
+
import { TinyColor as li } from "@ctrl/tinycolor";
|
|
9
|
+
import { clsx as ci } from "clsx";
|
|
10
|
+
import { twMerge as di } from "tailwind-merge";
|
|
11
|
+
import { makeAutoObservable as Tt, toJS as St, runInAction as fi, action as hi } from "mobx";
|
|
12
|
+
import { maxBy as pi } from "lodash";
|
|
13
|
+
import ui from "@emoji-mart/data";
|
|
14
|
+
import mi from "@emoji-mart/react";
|
|
15
|
+
import { Frame as gi, Rect as ae, Box as ft, Ellipse as ht, Line as pt, Text as xi, Cursor as bi, App as wi, ZoomEvent as yi, ResizeEvent as vi, PointerEvent as ji, DragEvent as De } from "leafer-ui";
|
|
16
|
+
import { addListener as Mi, removeListener as Ci } from "resize-detector";
|
|
17
|
+
import { Arrow as ki } from "@leafer-in/arrow";
|
|
18
|
+
import { ScrollBar as Ai } from "@leafer-in/scroll";
|
|
19
|
+
import { tinykeys as Rt } from "tinykeys";
|
|
19
20
|
import "@leafer-in/editor";
|
|
20
21
|
import "@leafer-in/view";
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
import { StyleProvider as Ni } from "@ant-design/cssinjs";
|
|
23
|
+
import Ti from "react-cropper";
|
|
24
|
+
var ue = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
25
|
+
function Si(i) {
|
|
26
|
+
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
|
|
25
27
|
}
|
|
26
|
-
var
|
|
28
|
+
var ze = { exports: {} }, ie = {};
|
|
27
29
|
/**
|
|
28
30
|
* @license React
|
|
29
31
|
* react-jsx-runtime.production.min.js
|
|
@@ -33,21 +35,21 @@ var He = { exports: {} }, oe = {};
|
|
|
33
35
|
* This source code is licensed under the MIT license found in the
|
|
34
36
|
* LICENSE file in the root directory of this source tree.
|
|
35
37
|
*/
|
|
36
|
-
var
|
|
37
|
-
function
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
-
var
|
|
41
|
-
function
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
for (
|
|
45
|
-
if (f && f.defaultProps) for (
|
|
46
|
-
return { $$typeof: t, type: f, key:
|
|
38
|
+
var ut;
|
|
39
|
+
function Ri() {
|
|
40
|
+
if (ut) return ie;
|
|
41
|
+
ut = 1;
|
|
42
|
+
var i = kt, t = Symbol.for("react.element"), n = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, a = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
43
|
+
function h(f, d, p) {
|
|
44
|
+
var m, b = {}, C = null, A = null;
|
|
45
|
+
p !== void 0 && (C = "" + p), d.key !== void 0 && (C = "" + d.key), d.ref !== void 0 && (A = d.ref);
|
|
46
|
+
for (m in d) s.call(d, m) && !l.hasOwnProperty(m) && (b[m] = d[m]);
|
|
47
|
+
if (f && f.defaultProps) for (m in d = f.defaultProps, d) b[m] === void 0 && (b[m] = d[m]);
|
|
48
|
+
return { $$typeof: t, type: f, key: C, ref: A, props: b, _owner: a.current };
|
|
47
49
|
}
|
|
48
|
-
return
|
|
50
|
+
return ie.Fragment = n, ie.jsx = h, ie.jsxs = h, ie;
|
|
49
51
|
}
|
|
50
|
-
var
|
|
52
|
+
var oe = {};
|
|
51
53
|
/**
|
|
52
54
|
* @license React
|
|
53
55
|
* react-jsx-runtime.development.js
|
|
@@ -57,61 +59,61 @@ var re = {};
|
|
|
57
59
|
* This source code is licensed under the MIT license found in the
|
|
58
60
|
* LICENSE file in the root directory of this source tree.
|
|
59
61
|
*/
|
|
60
|
-
var
|
|
61
|
-
function
|
|
62
|
-
return
|
|
63
|
-
var
|
|
64
|
-
function
|
|
65
|
-
if (
|
|
62
|
+
var mt;
|
|
63
|
+
function Di() {
|
|
64
|
+
return mt || (mt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
65
|
+
var i = kt, t = Symbol.for("react.element"), n = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), h = Symbol.for("react.provider"), f = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), A = Symbol.for("react.offscreen"), x = Symbol.iterator, w = "@@iterator";
|
|
66
|
+
function S(r) {
|
|
67
|
+
if (r === null || typeof r != "object")
|
|
66
68
|
return null;
|
|
67
|
-
var c = x &&
|
|
69
|
+
var c = x && r[x] || r[w];
|
|
68
70
|
return typeof c == "function" ? c : null;
|
|
69
71
|
}
|
|
70
|
-
var _ =
|
|
71
|
-
function E(
|
|
72
|
+
var _ = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
73
|
+
function E(r) {
|
|
72
74
|
{
|
|
73
|
-
for (var c = arguments.length,
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
for (var c = arguments.length, u = new Array(c > 1 ? c - 1 : 0), g = 1; g < c; g++)
|
|
76
|
+
u[g - 1] = arguments[g];
|
|
77
|
+
ye("error", r, u);
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
|
-
function
|
|
80
|
+
function ye(r, c, u) {
|
|
79
81
|
{
|
|
80
|
-
var
|
|
81
|
-
j !== "" && (c += "%s",
|
|
82
|
-
var
|
|
83
|
-
return String(
|
|
82
|
+
var g = _.ReactDebugCurrentFrame, j = g.getStackAddendum();
|
|
83
|
+
j !== "" && (c += "%s", u = u.concat([j]));
|
|
84
|
+
var T = u.map(function(v) {
|
|
85
|
+
return String(v);
|
|
84
86
|
});
|
|
85
|
-
|
|
87
|
+
T.unshift("Warning: " + c), Function.prototype.apply.call(console[r], console, T);
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
|
-
var
|
|
90
|
+
var ve = !1, $ = !1, D = !1, F = !1, U = !1, K;
|
|
89
91
|
K = Symbol.for("react.module.reference");
|
|
90
|
-
function
|
|
91
|
-
return !!(typeof
|
|
92
|
+
function Bt(r) {
|
|
93
|
+
return !!(typeof r == "string" || typeof r == "function" || r === s || r === l || U || r === a || r === p || r === m || F || r === A || ve || $ || D || typeof r == "object" && r !== null && (r.$$typeof === C || r.$$typeof === b || r.$$typeof === h || r.$$typeof === f || r.$$typeof === d || // This needs to include all possible module reference object
|
|
92
94
|
// types supported by any Flight configuration anywhere since
|
|
93
95
|
// we don't know which Flight build this will end up being used
|
|
94
96
|
// with.
|
|
95
|
-
|
|
97
|
+
r.$$typeof === K || r.getModuleId !== void 0));
|
|
96
98
|
}
|
|
97
|
-
function
|
|
98
|
-
var
|
|
99
|
-
if (
|
|
100
|
-
return
|
|
99
|
+
function Yt(r, c, u) {
|
|
100
|
+
var g = r.displayName;
|
|
101
|
+
if (g)
|
|
102
|
+
return g;
|
|
101
103
|
var j = c.displayName || c.name || "";
|
|
102
|
-
return j !== "" ?
|
|
104
|
+
return j !== "" ? u + "(" + j + ")" : u;
|
|
103
105
|
}
|
|
104
|
-
function
|
|
105
|
-
return
|
|
106
|
+
function Ee(r) {
|
|
107
|
+
return r.displayName || "Context";
|
|
106
108
|
}
|
|
107
|
-
function
|
|
108
|
-
if (
|
|
109
|
+
function G(r) {
|
|
110
|
+
if (r == null)
|
|
109
111
|
return null;
|
|
110
|
-
if (typeof
|
|
111
|
-
return
|
|
112
|
-
if (typeof
|
|
113
|
-
return
|
|
114
|
-
switch (
|
|
112
|
+
if (typeof r.tag == "number" && E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
|
|
113
|
+
return r.displayName || r.name || null;
|
|
114
|
+
if (typeof r == "string")
|
|
115
|
+
return r;
|
|
116
|
+
switch (r) {
|
|
115
117
|
case s:
|
|
116
118
|
return "Fragment";
|
|
117
119
|
case n:
|
|
@@ -120,28 +122,28 @@ function Mo() {
|
|
|
120
122
|
return "Profiler";
|
|
121
123
|
case a:
|
|
122
124
|
return "StrictMode";
|
|
123
|
-
case
|
|
125
|
+
case p:
|
|
124
126
|
return "Suspense";
|
|
125
|
-
case
|
|
127
|
+
case m:
|
|
126
128
|
return "SuspenseList";
|
|
127
129
|
}
|
|
128
|
-
if (typeof
|
|
129
|
-
switch (
|
|
130
|
+
if (typeof r == "object")
|
|
131
|
+
switch (r.$$typeof) {
|
|
130
132
|
case f:
|
|
131
|
-
var c =
|
|
132
|
-
return
|
|
133
|
+
var c = r;
|
|
134
|
+
return Ee(c) + ".Consumer";
|
|
135
|
+
case h:
|
|
136
|
+
var u = r;
|
|
137
|
+
return Ee(u._context) + ".Provider";
|
|
133
138
|
case d:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
return
|
|
138
|
-
case
|
|
139
|
-
var
|
|
140
|
-
return m !== null ? m : Z(i.type) || "Memo";
|
|
141
|
-
case S: {
|
|
142
|
-
var j = i, C = j._payload, w = j._init;
|
|
139
|
+
return Yt(r, r.render, "ForwardRef");
|
|
140
|
+
case b:
|
|
141
|
+
var g = r.displayName || null;
|
|
142
|
+
return g !== null ? g : G(r.type) || "Memo";
|
|
143
|
+
case C: {
|
|
144
|
+
var j = r, T = j._payload, v = j._init;
|
|
143
145
|
try {
|
|
144
|
-
return
|
|
146
|
+
return G(v(T));
|
|
145
147
|
} catch {
|
|
146
148
|
return null;
|
|
147
149
|
}
|
|
@@ -149,570 +151,572 @@ function Mo() {
|
|
|
149
151
|
}
|
|
150
152
|
return null;
|
|
151
153
|
}
|
|
152
|
-
var V = Object.assign, ee = 0,
|
|
153
|
-
function
|
|
154
|
+
var V = Object.assign, ee = 0, Oe, Be, Ye, Ie, Pe, We, Ze;
|
|
155
|
+
function Fe() {
|
|
154
156
|
}
|
|
155
|
-
|
|
156
|
-
function
|
|
157
|
+
Fe.__reactDisabledLog = !0;
|
|
158
|
+
function It() {
|
|
157
159
|
{
|
|
158
160
|
if (ee === 0) {
|
|
159
|
-
|
|
160
|
-
var
|
|
161
|
+
Oe = console.log, Be = console.info, Ye = console.warn, Ie = console.error, Pe = console.group, We = console.groupCollapsed, Ze = console.groupEnd;
|
|
162
|
+
var r = {
|
|
161
163
|
configurable: !0,
|
|
162
164
|
enumerable: !0,
|
|
163
|
-
value:
|
|
165
|
+
value: Fe,
|
|
164
166
|
writable: !0
|
|
165
167
|
};
|
|
166
168
|
Object.defineProperties(console, {
|
|
167
|
-
info:
|
|
168
|
-
log:
|
|
169
|
-
warn:
|
|
170
|
-
error:
|
|
171
|
-
group:
|
|
172
|
-
groupCollapsed:
|
|
173
|
-
groupEnd:
|
|
169
|
+
info: r,
|
|
170
|
+
log: r,
|
|
171
|
+
warn: r,
|
|
172
|
+
error: r,
|
|
173
|
+
group: r,
|
|
174
|
+
groupCollapsed: r,
|
|
175
|
+
groupEnd: r
|
|
174
176
|
});
|
|
175
177
|
}
|
|
176
178
|
ee++;
|
|
177
179
|
}
|
|
178
180
|
}
|
|
179
|
-
function
|
|
181
|
+
function Pt() {
|
|
180
182
|
{
|
|
181
183
|
if (ee--, ee === 0) {
|
|
182
|
-
var
|
|
184
|
+
var r = {
|
|
183
185
|
configurable: !0,
|
|
184
186
|
enumerable: !0,
|
|
185
187
|
writable: !0
|
|
186
188
|
};
|
|
187
189
|
Object.defineProperties(console, {
|
|
188
|
-
log: V({},
|
|
189
|
-
value: Ee
|
|
190
|
-
}),
|
|
191
|
-
info: V({}, i, {
|
|
190
|
+
log: V({}, r, {
|
|
192
191
|
value: Oe
|
|
193
192
|
}),
|
|
194
|
-
|
|
195
|
-
value:
|
|
193
|
+
info: V({}, r, {
|
|
194
|
+
value: Be
|
|
196
195
|
}),
|
|
197
|
-
|
|
196
|
+
warn: V({}, r, {
|
|
198
197
|
value: Ye
|
|
199
198
|
}),
|
|
200
|
-
|
|
199
|
+
error: V({}, r, {
|
|
201
200
|
value: Ie
|
|
202
201
|
}),
|
|
203
|
-
|
|
204
|
-
value: Be
|
|
205
|
-
}),
|
|
206
|
-
groupEnd: V({}, i, {
|
|
202
|
+
group: V({}, r, {
|
|
207
203
|
value: Pe
|
|
204
|
+
}),
|
|
205
|
+
groupCollapsed: V({}, r, {
|
|
206
|
+
value: We
|
|
207
|
+
}),
|
|
208
|
+
groupEnd: V({}, r, {
|
|
209
|
+
value: Ze
|
|
208
210
|
})
|
|
209
211
|
});
|
|
210
212
|
}
|
|
211
213
|
ee < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
212
214
|
}
|
|
213
215
|
}
|
|
214
|
-
var
|
|
215
|
-
function
|
|
216
|
+
var je = _.ReactCurrentDispatcher, Me;
|
|
217
|
+
function ce(r, c, u) {
|
|
216
218
|
{
|
|
217
|
-
if (
|
|
219
|
+
if (Me === void 0)
|
|
218
220
|
try {
|
|
219
221
|
throw Error();
|
|
220
222
|
} catch (j) {
|
|
221
|
-
var
|
|
222
|
-
|
|
223
|
+
var g = j.stack.trim().match(/\n( *(at )?)/);
|
|
224
|
+
Me = g && g[1] || "";
|
|
223
225
|
}
|
|
224
226
|
return `
|
|
225
|
-
` +
|
|
227
|
+
` + Me + r;
|
|
226
228
|
}
|
|
227
229
|
}
|
|
228
|
-
var
|
|
230
|
+
var Ce = !1, de;
|
|
229
231
|
{
|
|
230
|
-
var
|
|
231
|
-
|
|
232
|
+
var Wt = typeof WeakMap == "function" ? WeakMap : Map;
|
|
233
|
+
de = new Wt();
|
|
232
234
|
}
|
|
233
|
-
function
|
|
234
|
-
if (!
|
|
235
|
+
function Ge(r, c) {
|
|
236
|
+
if (!r || Ce)
|
|
235
237
|
return "";
|
|
236
238
|
{
|
|
237
|
-
var
|
|
238
|
-
if (
|
|
239
|
-
return
|
|
239
|
+
var u = de.get(r);
|
|
240
|
+
if (u !== void 0)
|
|
241
|
+
return u;
|
|
240
242
|
}
|
|
241
|
-
var
|
|
242
|
-
|
|
243
|
+
var g;
|
|
244
|
+
Ce = !0;
|
|
243
245
|
var j = Error.prepareStackTrace;
|
|
244
246
|
Error.prepareStackTrace = void 0;
|
|
245
|
-
var
|
|
246
|
-
|
|
247
|
+
var T;
|
|
248
|
+
T = je.current, je.current = null, It();
|
|
247
249
|
try {
|
|
248
250
|
if (c) {
|
|
249
|
-
var
|
|
251
|
+
var v = function() {
|
|
250
252
|
throw Error();
|
|
251
253
|
};
|
|
252
|
-
if (Object.defineProperty(
|
|
254
|
+
if (Object.defineProperty(v.prototype, "props", {
|
|
253
255
|
set: function() {
|
|
254
256
|
throw Error();
|
|
255
257
|
}
|
|
256
258
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
257
259
|
try {
|
|
258
|
-
Reflect.construct(
|
|
259
|
-
} catch (
|
|
260
|
-
|
|
260
|
+
Reflect.construct(v, []);
|
|
261
|
+
} catch (I) {
|
|
262
|
+
g = I;
|
|
261
263
|
}
|
|
262
|
-
Reflect.construct(
|
|
264
|
+
Reflect.construct(r, [], v);
|
|
263
265
|
} else {
|
|
264
266
|
try {
|
|
265
|
-
|
|
266
|
-
} catch (
|
|
267
|
-
|
|
267
|
+
v.call();
|
|
268
|
+
} catch (I) {
|
|
269
|
+
g = I;
|
|
268
270
|
}
|
|
269
|
-
|
|
271
|
+
r.call(v.prototype);
|
|
270
272
|
}
|
|
271
273
|
} else {
|
|
272
274
|
try {
|
|
273
275
|
throw Error();
|
|
274
|
-
} catch (
|
|
275
|
-
|
|
276
|
+
} catch (I) {
|
|
277
|
+
g = I;
|
|
276
278
|
}
|
|
277
|
-
|
|
279
|
+
r();
|
|
278
280
|
}
|
|
279
|
-
} catch (
|
|
280
|
-
if (
|
|
281
|
-
for (var
|
|
282
|
-
`),
|
|
283
|
-
`),
|
|
281
|
+
} catch (I) {
|
|
282
|
+
if (I && g && typeof I.stack == "string") {
|
|
283
|
+
for (var y = I.stack.split(`
|
|
284
|
+
`), Y = g.stack.split(`
|
|
285
|
+
`), H = y.length - 1, z = Y.length - 1; H >= 1 && z >= 0 && y[H] !== Y[z]; )
|
|
284
286
|
z--;
|
|
285
|
-
for (;
|
|
286
|
-
if (
|
|
287
|
-
if (
|
|
287
|
+
for (; H >= 1 && z >= 0; H--, z--)
|
|
288
|
+
if (y[H] !== Y[z]) {
|
|
289
|
+
if (H !== 1 || z !== 1)
|
|
288
290
|
do
|
|
289
|
-
if (
|
|
290
|
-
var
|
|
291
|
-
` +
|
|
292
|
-
return
|
|
291
|
+
if (H--, z--, z < 0 || y[H] !== Y[z]) {
|
|
292
|
+
var W = `
|
|
293
|
+
` + y[H].replace(" at new ", " at ");
|
|
294
|
+
return r.displayName && W.includes("<anonymous>") && (W = W.replace("<anonymous>", r.displayName)), typeof r == "function" && de.set(r, W), W;
|
|
293
295
|
}
|
|
294
|
-
while (
|
|
296
|
+
while (H >= 1 && z >= 0);
|
|
295
297
|
break;
|
|
296
298
|
}
|
|
297
299
|
}
|
|
298
300
|
} finally {
|
|
299
|
-
|
|
301
|
+
Ce = !1, je.current = T, Pt(), Error.prepareStackTrace = j;
|
|
300
302
|
}
|
|
301
|
-
var X =
|
|
302
|
-
return typeof
|
|
303
|
+
var X = r ? r.displayName || r.name : "", J = X ? ce(X) : "";
|
|
304
|
+
return typeof r == "function" && de.set(r, J), J;
|
|
303
305
|
}
|
|
304
|
-
function
|
|
305
|
-
return
|
|
306
|
+
function Zt(r, c, u) {
|
|
307
|
+
return Ge(r, !1);
|
|
306
308
|
}
|
|
307
|
-
function
|
|
308
|
-
var c =
|
|
309
|
+
function Ft(r) {
|
|
310
|
+
var c = r.prototype;
|
|
309
311
|
return !!(c && c.isReactComponent);
|
|
310
312
|
}
|
|
311
|
-
function
|
|
312
|
-
if (
|
|
313
|
+
function fe(r, c, u) {
|
|
314
|
+
if (r == null)
|
|
313
315
|
return "";
|
|
314
|
-
if (typeof
|
|
315
|
-
return
|
|
316
|
-
if (typeof
|
|
317
|
-
return
|
|
318
|
-
switch (
|
|
319
|
-
case
|
|
320
|
-
return
|
|
321
|
-
case
|
|
322
|
-
return
|
|
316
|
+
if (typeof r == "function")
|
|
317
|
+
return Ge(r, Ft(r));
|
|
318
|
+
if (typeof r == "string")
|
|
319
|
+
return ce(r);
|
|
320
|
+
switch (r) {
|
|
321
|
+
case p:
|
|
322
|
+
return ce("Suspense");
|
|
323
|
+
case m:
|
|
324
|
+
return ce("SuspenseList");
|
|
323
325
|
}
|
|
324
|
-
if (typeof
|
|
325
|
-
switch (
|
|
326
|
-
case
|
|
327
|
-
return
|
|
328
|
-
case
|
|
329
|
-
return
|
|
330
|
-
case
|
|
331
|
-
var
|
|
326
|
+
if (typeof r == "object")
|
|
327
|
+
switch (r.$$typeof) {
|
|
328
|
+
case d:
|
|
329
|
+
return Zt(r.render);
|
|
330
|
+
case b:
|
|
331
|
+
return fe(r.type, c, u);
|
|
332
|
+
case C: {
|
|
333
|
+
var g = r, j = g._payload, T = g._init;
|
|
332
334
|
try {
|
|
333
|
-
return
|
|
335
|
+
return fe(T(j), c, u);
|
|
334
336
|
} catch {
|
|
335
337
|
}
|
|
336
338
|
}
|
|
337
339
|
}
|
|
338
340
|
return "";
|
|
339
341
|
}
|
|
340
|
-
var te = Object.prototype.hasOwnProperty,
|
|
341
|
-
function
|
|
342
|
-
if (
|
|
343
|
-
var c =
|
|
344
|
-
|
|
342
|
+
var te = Object.prototype.hasOwnProperty, Le = {}, Ue = _.ReactDebugCurrentFrame;
|
|
343
|
+
function he(r) {
|
|
344
|
+
if (r) {
|
|
345
|
+
var c = r._owner, u = fe(r.type, r._source, c ? c.type : null);
|
|
346
|
+
Ue.setExtraStackFrame(u);
|
|
345
347
|
} else
|
|
346
|
-
|
|
348
|
+
Ue.setExtraStackFrame(null);
|
|
347
349
|
}
|
|
348
|
-
function
|
|
350
|
+
function Gt(r, c, u, g, j) {
|
|
349
351
|
{
|
|
350
|
-
var
|
|
351
|
-
for (var
|
|
352
|
-
if (
|
|
353
|
-
var
|
|
352
|
+
var T = Function.call.bind(te);
|
|
353
|
+
for (var v in r)
|
|
354
|
+
if (T(r, v)) {
|
|
355
|
+
var y = void 0;
|
|
354
356
|
try {
|
|
355
|
-
if (typeof
|
|
356
|
-
var
|
|
357
|
-
throw
|
|
357
|
+
if (typeof r[v] != "function") {
|
|
358
|
+
var Y = Error((g || "React class") + ": " + u + " type `" + v + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[v] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
359
|
+
throw Y.name = "Invariant Violation", Y;
|
|
358
360
|
}
|
|
359
|
-
|
|
360
|
-
} catch (
|
|
361
|
-
|
|
361
|
+
y = r[v](c, v, g, u, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
362
|
+
} catch (H) {
|
|
363
|
+
y = H;
|
|
362
364
|
}
|
|
363
|
-
|
|
365
|
+
y && !(y instanceof Error) && (he(j), E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", g || "React class", u, v, typeof y), he(null)), y instanceof Error && !(y.message in Le) && (Le[y.message] = !0, he(j), E("Failed %s type: %s", u, y.message), he(null));
|
|
364
366
|
}
|
|
365
367
|
}
|
|
366
368
|
}
|
|
367
|
-
var
|
|
368
|
-
function
|
|
369
|
-
return
|
|
369
|
+
var Lt = Array.isArray;
|
|
370
|
+
function ke(r) {
|
|
371
|
+
return Lt(r);
|
|
370
372
|
}
|
|
371
|
-
function
|
|
373
|
+
function Ut(r) {
|
|
372
374
|
{
|
|
373
|
-
var c = typeof Symbol == "function" && Symbol.toStringTag,
|
|
374
|
-
return
|
|
375
|
+
var c = typeof Symbol == "function" && Symbol.toStringTag, u = c && r[Symbol.toStringTag] || r.constructor.name || "Object";
|
|
376
|
+
return u;
|
|
375
377
|
}
|
|
376
378
|
}
|
|
377
|
-
function
|
|
379
|
+
function Vt(r) {
|
|
378
380
|
try {
|
|
379
|
-
return
|
|
381
|
+
return Ve(r), !1;
|
|
380
382
|
} catch {
|
|
381
383
|
return !0;
|
|
382
384
|
}
|
|
383
385
|
}
|
|
384
|
-
function
|
|
385
|
-
return "" +
|
|
386
|
+
function Ve(r) {
|
|
387
|
+
return "" + r;
|
|
386
388
|
}
|
|
387
|
-
function
|
|
388
|
-
if (
|
|
389
|
-
return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
|
389
|
+
function Je(r) {
|
|
390
|
+
if (Vt(r))
|
|
391
|
+
return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ut(r)), Ve(r);
|
|
390
392
|
}
|
|
391
|
-
var
|
|
393
|
+
var re = _.ReactCurrentOwner, Jt = {
|
|
392
394
|
key: !0,
|
|
393
395
|
ref: !0,
|
|
394
396
|
__self: !0,
|
|
395
397
|
__source: !0
|
|
396
|
-
},
|
|
397
|
-
|
|
398
|
-
function
|
|
399
|
-
if (te.call(
|
|
400
|
-
var c = Object.getOwnPropertyDescriptor(
|
|
398
|
+
}, qe, Xe, Ae;
|
|
399
|
+
Ae = {};
|
|
400
|
+
function qt(r) {
|
|
401
|
+
if (te.call(r, "ref")) {
|
|
402
|
+
var c = Object.getOwnPropertyDescriptor(r, "ref").get;
|
|
401
403
|
if (c && c.isReactWarning)
|
|
402
404
|
return !1;
|
|
403
405
|
}
|
|
404
|
-
return
|
|
406
|
+
return r.ref !== void 0;
|
|
405
407
|
}
|
|
406
|
-
function
|
|
407
|
-
if (te.call(
|
|
408
|
-
var c = Object.getOwnPropertyDescriptor(
|
|
408
|
+
function Xt(r) {
|
|
409
|
+
if (te.call(r, "key")) {
|
|
410
|
+
var c = Object.getOwnPropertyDescriptor(r, "key").get;
|
|
409
411
|
if (c && c.isReactWarning)
|
|
410
412
|
return !1;
|
|
411
413
|
}
|
|
412
|
-
return
|
|
414
|
+
return r.key !== void 0;
|
|
413
415
|
}
|
|
414
|
-
function
|
|
415
|
-
if (typeof
|
|
416
|
-
var
|
|
417
|
-
|
|
416
|
+
function Qt(r, c) {
|
|
417
|
+
if (typeof r.ref == "string" && re.current && c && re.current.stateNode !== c) {
|
|
418
|
+
var u = G(re.current.type);
|
|
419
|
+
Ae[u] || (E('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', G(re.current.type), r.ref), Ae[u] = !0);
|
|
418
420
|
}
|
|
419
421
|
}
|
|
420
|
-
function
|
|
422
|
+
function $t(r, c) {
|
|
421
423
|
{
|
|
422
|
-
var
|
|
423
|
-
|
|
424
|
+
var u = function() {
|
|
425
|
+
qe || (qe = !0, E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", c));
|
|
424
426
|
};
|
|
425
|
-
|
|
426
|
-
get:
|
|
427
|
+
u.isReactWarning = !0, Object.defineProperty(r, "key", {
|
|
428
|
+
get: u,
|
|
427
429
|
configurable: !0
|
|
428
430
|
});
|
|
429
431
|
}
|
|
430
432
|
}
|
|
431
|
-
function
|
|
433
|
+
function Kt(r, c) {
|
|
432
434
|
{
|
|
433
|
-
var
|
|
434
|
-
|
|
435
|
+
var u = function() {
|
|
436
|
+
Xe || (Xe = !0, E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", c));
|
|
435
437
|
};
|
|
436
|
-
|
|
437
|
-
get:
|
|
438
|
+
u.isReactWarning = !0, Object.defineProperty(r, "ref", {
|
|
439
|
+
get: u,
|
|
438
440
|
configurable: !0
|
|
439
441
|
});
|
|
440
442
|
}
|
|
441
443
|
}
|
|
442
|
-
var
|
|
443
|
-
var
|
|
444
|
+
var er = function(r, c, u, g, j, T, v) {
|
|
445
|
+
var y = {
|
|
444
446
|
// This tag allows us to uniquely identify this as a React Element
|
|
445
447
|
$$typeof: t,
|
|
446
448
|
// Built-in properties that belong on the element
|
|
447
|
-
type:
|
|
449
|
+
type: r,
|
|
448
450
|
key: c,
|
|
449
|
-
ref:
|
|
450
|
-
props:
|
|
451
|
+
ref: u,
|
|
452
|
+
props: v,
|
|
451
453
|
// Record the component responsible for creating this element.
|
|
452
|
-
_owner:
|
|
454
|
+
_owner: T
|
|
453
455
|
};
|
|
454
|
-
return
|
|
456
|
+
return y._store = {}, Object.defineProperty(y._store, "validated", {
|
|
455
457
|
configurable: !1,
|
|
456
458
|
enumerable: !1,
|
|
457
459
|
writable: !0,
|
|
458
460
|
value: !1
|
|
459
|
-
}), Object.defineProperty(
|
|
461
|
+
}), Object.defineProperty(y, "_self", {
|
|
460
462
|
configurable: !1,
|
|
461
463
|
enumerable: !1,
|
|
462
464
|
writable: !1,
|
|
463
|
-
value:
|
|
464
|
-
}), Object.defineProperty(
|
|
465
|
+
value: g
|
|
466
|
+
}), Object.defineProperty(y, "_source", {
|
|
465
467
|
configurable: !1,
|
|
466
468
|
enumerable: !1,
|
|
467
469
|
writable: !1,
|
|
468
470
|
value: j
|
|
469
|
-
}), Object.freeze && (Object.freeze(
|
|
471
|
+
}), Object.freeze && (Object.freeze(y.props), Object.freeze(y)), y;
|
|
470
472
|
};
|
|
471
|
-
function
|
|
473
|
+
function tr(r, c, u, g, j) {
|
|
472
474
|
{
|
|
473
|
-
var
|
|
474
|
-
|
|
475
|
-
for (
|
|
476
|
-
te.call(c,
|
|
477
|
-
if (
|
|
478
|
-
var
|
|
479
|
-
for (
|
|
480
|
-
|
|
475
|
+
var T, v = {}, y = null, Y = null;
|
|
476
|
+
u !== void 0 && (Je(u), y = "" + u), Xt(c) && (Je(c.key), y = "" + c.key), qt(c) && (Y = c.ref, Qt(c, j));
|
|
477
|
+
for (T in c)
|
|
478
|
+
te.call(c, T) && !Jt.hasOwnProperty(T) && (v[T] = c[T]);
|
|
479
|
+
if (r && r.defaultProps) {
|
|
480
|
+
var H = r.defaultProps;
|
|
481
|
+
for (T in H)
|
|
482
|
+
v[T] === void 0 && (v[T] = H[T]);
|
|
481
483
|
}
|
|
482
|
-
if (
|
|
483
|
-
var z = typeof
|
|
484
|
-
|
|
484
|
+
if (y || Y) {
|
|
485
|
+
var z = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
|
|
486
|
+
y && $t(v, z), Y && Kt(v, z);
|
|
485
487
|
}
|
|
486
|
-
return
|
|
488
|
+
return er(r, y, Y, j, g, re.current, v);
|
|
487
489
|
}
|
|
488
490
|
}
|
|
489
|
-
var
|
|
490
|
-
function q(
|
|
491
|
-
if (
|
|
492
|
-
var c =
|
|
493
|
-
|
|
491
|
+
var Ne = _.ReactCurrentOwner, Qe = _.ReactDebugCurrentFrame;
|
|
492
|
+
function q(r) {
|
|
493
|
+
if (r) {
|
|
494
|
+
var c = r._owner, u = fe(r.type, r._source, c ? c.type : null);
|
|
495
|
+
Qe.setExtraStackFrame(u);
|
|
494
496
|
} else
|
|
495
|
-
|
|
497
|
+
Qe.setExtraStackFrame(null);
|
|
496
498
|
}
|
|
497
499
|
var Te;
|
|
498
500
|
Te = !1;
|
|
499
|
-
function
|
|
500
|
-
return typeof
|
|
501
|
+
function Se(r) {
|
|
502
|
+
return typeof r == "object" && r !== null && r.$$typeof === t;
|
|
501
503
|
}
|
|
502
|
-
function
|
|
504
|
+
function $e() {
|
|
503
505
|
{
|
|
504
|
-
if (
|
|
505
|
-
var
|
|
506
|
-
if (
|
|
506
|
+
if (Ne.current) {
|
|
507
|
+
var r = G(Ne.current.type);
|
|
508
|
+
if (r)
|
|
507
509
|
return `
|
|
508
510
|
|
|
509
|
-
Check the render method of \`` +
|
|
511
|
+
Check the render method of \`` + r + "`.";
|
|
510
512
|
}
|
|
511
513
|
return "";
|
|
512
514
|
}
|
|
513
515
|
}
|
|
514
|
-
function
|
|
516
|
+
function rr(r) {
|
|
515
517
|
return "";
|
|
516
518
|
}
|
|
517
|
-
var
|
|
518
|
-
function
|
|
519
|
+
var Ke = {};
|
|
520
|
+
function ir(r) {
|
|
519
521
|
{
|
|
520
|
-
var c =
|
|
522
|
+
var c = $e();
|
|
521
523
|
if (!c) {
|
|
522
|
-
var
|
|
523
|
-
|
|
524
|
+
var u = typeof r == "string" ? r : r.displayName || r.name;
|
|
525
|
+
u && (c = `
|
|
524
526
|
|
|
525
|
-
Check the top-level render call using <` +
|
|
527
|
+
Check the top-level render call using <` + u + ">.");
|
|
526
528
|
}
|
|
527
529
|
return c;
|
|
528
530
|
}
|
|
529
531
|
}
|
|
530
|
-
function
|
|
532
|
+
function et(r, c) {
|
|
531
533
|
{
|
|
532
|
-
if (!
|
|
534
|
+
if (!r._store || r._store.validated || r.key != null)
|
|
533
535
|
return;
|
|
534
|
-
|
|
535
|
-
var
|
|
536
|
-
if (
|
|
536
|
+
r._store.validated = !0;
|
|
537
|
+
var u = ir(c);
|
|
538
|
+
if (Ke[u])
|
|
537
539
|
return;
|
|
538
|
-
|
|
539
|
-
var
|
|
540
|
-
|
|
540
|
+
Ke[u] = !0;
|
|
541
|
+
var g = "";
|
|
542
|
+
r && r._owner && r._owner !== Ne.current && (g = " It was passed a child from " + G(r._owner.type) + "."), q(r), E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', u, g), q(null);
|
|
541
543
|
}
|
|
542
544
|
}
|
|
543
|
-
function
|
|
545
|
+
function tt(r, c) {
|
|
544
546
|
{
|
|
545
|
-
if (typeof
|
|
547
|
+
if (typeof r != "object")
|
|
546
548
|
return;
|
|
547
|
-
if (
|
|
548
|
-
for (var
|
|
549
|
-
var
|
|
550
|
-
|
|
549
|
+
if (ke(r))
|
|
550
|
+
for (var u = 0; u < r.length; u++) {
|
|
551
|
+
var g = r[u];
|
|
552
|
+
Se(g) && et(g, c);
|
|
551
553
|
}
|
|
552
|
-
else if (
|
|
553
|
-
|
|
554
|
-
else if (
|
|
555
|
-
var j =
|
|
556
|
-
if (typeof j == "function" && j !==
|
|
557
|
-
for (var
|
|
558
|
-
|
|
554
|
+
else if (Se(r))
|
|
555
|
+
r._store && (r._store.validated = !0);
|
|
556
|
+
else if (r) {
|
|
557
|
+
var j = S(r);
|
|
558
|
+
if (typeof j == "function" && j !== r.entries)
|
|
559
|
+
for (var T = j.call(r), v; !(v = T.next()).done; )
|
|
560
|
+
Se(v.value) && et(v.value, c);
|
|
559
561
|
}
|
|
560
562
|
}
|
|
561
563
|
}
|
|
562
|
-
function
|
|
564
|
+
function or(r) {
|
|
563
565
|
{
|
|
564
|
-
var c =
|
|
566
|
+
var c = r.type;
|
|
565
567
|
if (c == null || typeof c == "string")
|
|
566
568
|
return;
|
|
567
|
-
var
|
|
569
|
+
var u;
|
|
568
570
|
if (typeof c == "function")
|
|
569
|
-
|
|
570
|
-
else if (typeof c == "object" && (c.$$typeof ===
|
|
571
|
+
u = c.propTypes;
|
|
572
|
+
else if (typeof c == "object" && (c.$$typeof === d || // Note: Memo only checks outer props here.
|
|
571
573
|
// Inner props are checked in the reconciler.
|
|
572
|
-
c.$$typeof ===
|
|
573
|
-
|
|
574
|
+
c.$$typeof === b))
|
|
575
|
+
u = c.propTypes;
|
|
574
576
|
else
|
|
575
577
|
return;
|
|
576
|
-
if (
|
|
577
|
-
var
|
|
578
|
-
|
|
578
|
+
if (u) {
|
|
579
|
+
var g = G(c);
|
|
580
|
+
Gt(u, r.props, "prop", g, r);
|
|
579
581
|
} else if (c.PropTypes !== void 0 && !Te) {
|
|
580
582
|
Te = !0;
|
|
581
|
-
var j =
|
|
583
|
+
var j = G(c);
|
|
582
584
|
E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", j || "Unknown");
|
|
583
585
|
}
|
|
584
586
|
typeof c.getDefaultProps == "function" && !c.getDefaultProps.isReactClassApproved && E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
585
587
|
}
|
|
586
588
|
}
|
|
587
|
-
function
|
|
589
|
+
function sr(r) {
|
|
588
590
|
{
|
|
589
|
-
for (var c = Object.keys(
|
|
590
|
-
var
|
|
591
|
-
if (
|
|
592
|
-
q(
|
|
591
|
+
for (var c = Object.keys(r.props), u = 0; u < c.length; u++) {
|
|
592
|
+
var g = c[u];
|
|
593
|
+
if (g !== "children" && g !== "key") {
|
|
594
|
+
q(r), E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", g), q(null);
|
|
593
595
|
break;
|
|
594
596
|
}
|
|
595
597
|
}
|
|
596
|
-
|
|
598
|
+
r.ref !== null && (q(r), E("Invalid attribute `ref` supplied to `React.Fragment`."), q(null));
|
|
597
599
|
}
|
|
598
600
|
}
|
|
599
|
-
var
|
|
600
|
-
function
|
|
601
|
+
var rt = {};
|
|
602
|
+
function it(r, c, u, g, j, T) {
|
|
601
603
|
{
|
|
602
|
-
var
|
|
603
|
-
if (!
|
|
604
|
-
var
|
|
605
|
-
(
|
|
606
|
-
var
|
|
607
|
-
|
|
608
|
-
var
|
|
609
|
-
|
|
604
|
+
var v = Bt(r);
|
|
605
|
+
if (!v) {
|
|
606
|
+
var y = "";
|
|
607
|
+
(r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (y += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
608
|
+
var Y = rr();
|
|
609
|
+
Y ? y += Y : y += $e();
|
|
610
|
+
var H;
|
|
611
|
+
r === null ? H = "null" : ke(r) ? H = "array" : r !== void 0 && r.$$typeof === t ? (H = "<" + (G(r.type) || "Unknown") + " />", y = " Did you accidentally export a JSX literal instead of a component?") : H = typeof r, E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", H, y);
|
|
610
612
|
}
|
|
611
|
-
var z =
|
|
613
|
+
var z = tr(r, c, u, j, T);
|
|
612
614
|
if (z == null)
|
|
613
615
|
return z;
|
|
614
|
-
if (
|
|
615
|
-
var
|
|
616
|
-
if (
|
|
617
|
-
if (
|
|
618
|
-
if (
|
|
619
|
-
for (var X = 0; X <
|
|
620
|
-
|
|
621
|
-
Object.freeze && Object.freeze(
|
|
616
|
+
if (v) {
|
|
617
|
+
var W = c.children;
|
|
618
|
+
if (W !== void 0)
|
|
619
|
+
if (g)
|
|
620
|
+
if (ke(W)) {
|
|
621
|
+
for (var X = 0; X < W.length; X++)
|
|
622
|
+
tt(W[X], r);
|
|
623
|
+
Object.freeze && Object.freeze(W);
|
|
622
624
|
} else
|
|
623
625
|
E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
624
626
|
else
|
|
625
|
-
|
|
627
|
+
tt(W, r);
|
|
626
628
|
}
|
|
627
629
|
if (te.call(c, "key")) {
|
|
628
|
-
var J =
|
|
629
|
-
return
|
|
630
|
-
}),
|
|
631
|
-
if (!
|
|
632
|
-
var
|
|
630
|
+
var J = G(r), I = Object.keys(c).filter(function(fr) {
|
|
631
|
+
return fr !== "key";
|
|
632
|
+
}), Re = I.length > 0 ? "{key: someKey, " + I.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
633
|
+
if (!rt[J + Re]) {
|
|
634
|
+
var dr = I.length > 0 ? "{" + I.join(": ..., ") + ": ...}" : "{}";
|
|
633
635
|
E(`A props object containing a "key" prop is being spread into JSX:
|
|
634
636
|
let props = %s;
|
|
635
637
|
<%s {...props} />
|
|
636
638
|
React keys must be passed directly to JSX without using spread:
|
|
637
639
|
let props = %s;
|
|
638
|
-
<%s key={someKey} {...props} />`,
|
|
640
|
+
<%s key={someKey} {...props} />`, Re, J, dr, J), rt[J + Re] = !0;
|
|
639
641
|
}
|
|
640
642
|
}
|
|
641
|
-
return
|
|
643
|
+
return r === s ? sr(z) : or(z), z;
|
|
642
644
|
}
|
|
643
645
|
}
|
|
644
|
-
function
|
|
645
|
-
return
|
|
646
|
+
function nr(r, c, u) {
|
|
647
|
+
return it(r, c, u, !0);
|
|
646
648
|
}
|
|
647
|
-
function
|
|
648
|
-
return
|
|
649
|
+
function ar(r, c, u) {
|
|
650
|
+
return it(r, c, u, !1);
|
|
649
651
|
}
|
|
650
|
-
var
|
|
651
|
-
|
|
652
|
-
}()),
|
|
652
|
+
var lr = ar, cr = nr;
|
|
653
|
+
oe.Fragment = s, oe.jsx = lr, oe.jsxs = cr;
|
|
654
|
+
}()), oe;
|
|
653
655
|
}
|
|
654
|
-
process.env.NODE_ENV === "production" ?
|
|
655
|
-
var e =
|
|
656
|
-
const
|
|
657
|
-
Camera:
|
|
658
|
-
Check:
|
|
659
|
-
Square:
|
|
660
|
-
Circle:
|
|
661
|
-
Slash:
|
|
662
|
-
MoveDownLeft:
|
|
663
|
-
Pencil:
|
|
664
|
-
Smile:
|
|
665
|
-
Undo:
|
|
666
|
-
Redo:
|
|
667
|
-
ChevronRight:
|
|
668
|
-
ChevronDown:
|
|
669
|
-
ChevronUp:
|
|
670
|
-
RotateCcw:
|
|
671
|
-
ZoomIn:
|
|
672
|
-
ZoomOut:
|
|
673
|
-
Hand:
|
|
674
|
-
Crop:
|
|
675
|
-
FlipHorizontal2:
|
|
676
|
-
FlipVertical2:
|
|
677
|
-
Sunset:
|
|
678
|
-
Box:
|
|
679
|
-
LayoutGrid:
|
|
680
|
-
ImagePlus:
|
|
681
|
-
Type:
|
|
682
|
-
CodeXml:
|
|
683
|
-
ClipboardPaste:
|
|
684
|
-
ImagePlay:
|
|
685
|
-
Maximize:
|
|
686
|
-
ListCollapse:
|
|
687
|
-
ArrowUpRight:
|
|
688
|
-
ArrowDownRight:
|
|
689
|
-
ImageDown:
|
|
690
|
-
Copy:
|
|
691
|
-
Settings2:
|
|
692
|
-
ChevronLeft:
|
|
693
|
-
Pipette:
|
|
694
|
-
Trash2:
|
|
695
|
-
|
|
656
|
+
process.env.NODE_ENV === "production" ? ze.exports = Ri() : ze.exports = Di();
|
|
657
|
+
var e = ze.exports;
|
|
658
|
+
const M = {
|
|
659
|
+
Camera: jr,
|
|
660
|
+
Check: Mr,
|
|
661
|
+
Square: Cr,
|
|
662
|
+
Circle: kr,
|
|
663
|
+
Slash: Ar,
|
|
664
|
+
MoveDownLeft: Nr,
|
|
665
|
+
Pencil: Tr,
|
|
666
|
+
Smile: Sr,
|
|
667
|
+
Undo: Rr,
|
|
668
|
+
Redo: Dr,
|
|
669
|
+
ChevronRight: Hr,
|
|
670
|
+
ChevronDown: zr,
|
|
671
|
+
ChevronUp: _r,
|
|
672
|
+
RotateCcw: Er,
|
|
673
|
+
ZoomIn: Or,
|
|
674
|
+
ZoomOut: Br,
|
|
675
|
+
Hand: Yr,
|
|
676
|
+
Crop: Ir,
|
|
677
|
+
FlipHorizontal2: Pr,
|
|
678
|
+
FlipVertical2: Wr,
|
|
679
|
+
Sunset: Zr,
|
|
680
|
+
Box: Fr,
|
|
681
|
+
LayoutGrid: Gr,
|
|
682
|
+
ImagePlus: Lr,
|
|
683
|
+
Type: Ur,
|
|
684
|
+
CodeXml: Vr,
|
|
685
|
+
ClipboardPaste: Jr,
|
|
686
|
+
ImagePlay: qr,
|
|
687
|
+
Maximize: Xr,
|
|
688
|
+
ListCollapse: Qr,
|
|
689
|
+
ArrowUpRight: $r,
|
|
690
|
+
ArrowDownRight: Kr,
|
|
691
|
+
ImageDown: ei,
|
|
692
|
+
Copy: ti,
|
|
693
|
+
Settings2: ri,
|
|
694
|
+
ChevronLeft: ii,
|
|
695
|
+
Pipette: oi,
|
|
696
|
+
Trash2: si,
|
|
697
|
+
Sun: ni,
|
|
698
|
+
Moon: ai
|
|
699
|
+
}, be = (i) => {
|
|
696
700
|
const t = () => {
|
|
697
701
|
if (!window.EyeDropper) return;
|
|
698
702
|
new EyeDropper().open().then((s) => {
|
|
699
703
|
const a = s.sRGBHex;
|
|
700
|
-
|
|
704
|
+
i != null && i.onChange && i.onChange(new li(a));
|
|
701
705
|
}).catch((s) => {
|
|
702
706
|
console.log(s);
|
|
703
707
|
});
|
|
704
708
|
};
|
|
705
709
|
return /* @__PURE__ */ e.jsx(
|
|
706
|
-
|
|
710
|
+
ur,
|
|
707
711
|
{
|
|
708
|
-
...
|
|
712
|
+
...i,
|
|
709
713
|
panelRender: (n) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
710
|
-
window.EyeDropper && /* @__PURE__ */ e.jsx("div", { className: "mb-1", children: /* @__PURE__ */ e.jsx(
|
|
714
|
+
window.EyeDropper && /* @__PURE__ */ e.jsx("div", { className: "mb-1", children: /* @__PURE__ */ e.jsx(k, { type: "text", shape: "circle", size: "small", icon: /* @__PURE__ */ e.jsx(M.Pipette, { size: 16 }), onClick: t }) }),
|
|
711
715
|
n
|
|
712
716
|
] })
|
|
713
717
|
}
|
|
714
718
|
);
|
|
715
|
-
},
|
|
719
|
+
}, Hi = [
|
|
716
720
|
{
|
|
717
721
|
label: /* @__PURE__ */ e.jsx("div", { className: "w-4 h-3 mt-1.5 items-center cursor-pointer", children: /* @__PURE__ */ e.jsx("i", { className: "block w-full origin-center rounded-lg bg-slate-600 -rotate-45 h-[1px]" }) }),
|
|
718
722
|
key: 1
|
|
@@ -733,18 +737,18 @@ const A = {
|
|
|
733
737
|
label: /* @__PURE__ */ e.jsx("div", { className: "w-4 h-3 mt-1.5 items-center cursor-pointer", children: /* @__PURE__ */ e.jsx("i", { className: "block w-full origin-center rounded-lg bg-slate-600 -rotate-45 h-[8px]" }) }),
|
|
734
738
|
key: 8
|
|
735
739
|
}
|
|
736
|
-
],
|
|
740
|
+
], zi = ({ defaultValue: i, onChange: t }) => {
|
|
737
741
|
const n = ({ key: s }) => {
|
|
738
742
|
t(s);
|
|
739
743
|
};
|
|
740
744
|
return /* @__PURE__ */ e.jsx(
|
|
741
|
-
|
|
745
|
+
At,
|
|
742
746
|
{
|
|
743
|
-
menu: { items:
|
|
747
|
+
menu: { items: Hi, onClick: n, selectedKeys: [i] },
|
|
744
748
|
trigger: ["click"],
|
|
745
749
|
placement: "bottom",
|
|
746
750
|
children: /* @__PURE__ */ e.jsx(
|
|
747
|
-
|
|
751
|
+
k,
|
|
748
752
|
{
|
|
749
753
|
type: "text",
|
|
750
754
|
shape: "circle",
|
|
@@ -754,7 +758,7 @@ const A = {
|
|
|
754
758
|
{
|
|
755
759
|
className: "block w-full origin-center rounded-lg bg-slate-600 -rotate-45",
|
|
756
760
|
style: {
|
|
757
|
-
height:
|
|
761
|
+
height: i + "px"
|
|
758
762
|
}
|
|
759
763
|
}
|
|
760
764
|
) })
|
|
@@ -763,37 +767,37 @@ const A = {
|
|
|
763
767
|
}
|
|
764
768
|
);
|
|
765
769
|
};
|
|
766
|
-
let
|
|
770
|
+
let _i = (i, t = 21) => (n = t) => {
|
|
767
771
|
let s = "", a = n;
|
|
768
772
|
for (; a--; )
|
|
769
|
-
s +=
|
|
773
|
+
s += i[Math.random() * i.length | 0];
|
|
770
774
|
return s;
|
|
771
775
|
};
|
|
772
|
-
const
|
|
773
|
-
const
|
|
774
|
-
return /Mac|iPod|iPhone|iPad/.test(
|
|
775
|
-
},
|
|
776
|
+
const Ei = () => {
|
|
777
|
+
const i = typeof navigator == "object" ? navigator.platform : "";
|
|
778
|
+
return /Mac|iPod|iPhone|iPad/.test(i);
|
|
779
|
+
}, gt = Ei() ? "⌘" : "Ctrl", Dt = [
|
|
776
780
|
"image/jpeg",
|
|
777
781
|
"image/png",
|
|
778
782
|
"image/bmp",
|
|
779
783
|
"image/gif",
|
|
780
784
|
"image/webp"
|
|
781
785
|
];
|
|
782
|
-
function
|
|
783
|
-
return
|
|
786
|
+
function Z(...i) {
|
|
787
|
+
return di(ci(i));
|
|
784
788
|
}
|
|
785
|
-
const
|
|
789
|
+
const ge = _i(
|
|
786
790
|
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
|
787
791
|
7
|
|
788
|
-
),
|
|
792
|
+
), Oi = (i, t) => {
|
|
789
793
|
let n = document.createElement("a");
|
|
790
|
-
n.href =
|
|
791
|
-
},
|
|
792
|
-
let a =
|
|
793
|
-
return a > n && (l *= n / a, a = n), l > s && (a *= s / l, l = s), { width: a, height: l };
|
|
794
|
-
},
|
|
794
|
+
n.href = i, n.download = t, n.style = "position: absolute; z-index: -111; visibility: none;", document.body.appendChild(n), n.click(), document.body.removeChild(n), n = null;
|
|
795
|
+
}, Bi = (i, t, n = 950, s = 450) => {
|
|
796
|
+
let a = i, l = t;
|
|
797
|
+
return a > n && (l *= n / a, a = n), l > s && (a *= s / l, l = s), { width: Math.round(a), height: Math.round(l) };
|
|
798
|
+
}, Yi = (i) => {
|
|
795
799
|
const t = new Image();
|
|
796
|
-
return
|
|
800
|
+
return i.startsWith("data") || (t.crossOrigin = "Anonymous"), new Promise(function(n, s) {
|
|
797
801
|
t.onload = function() {
|
|
798
802
|
n(t);
|
|
799
803
|
};
|
|
@@ -802,71 +806,85 @@ const he = To(
|
|
|
802
806
|
new Error("An error occurred attempting to load image")
|
|
803
807
|
);
|
|
804
808
|
};
|
|
805
|
-
t.onerror = a, t.onabort = a, t.src =
|
|
809
|
+
t.onerror = a, t.onabort = a, t.src = i;
|
|
806
810
|
});
|
|
807
|
-
},
|
|
811
|
+
}, we = (i, t, n = 0.15) => {
|
|
812
|
+
const s = Math.min(i, t);
|
|
813
|
+
return Math.round(s * n);
|
|
814
|
+
}, Ii = (i, t, n) => i === "top-left" ? {
|
|
808
815
|
x: 0,
|
|
809
816
|
y: 0
|
|
810
|
-
} :
|
|
817
|
+
} : i === "top" ? {
|
|
811
818
|
x: t / 2,
|
|
812
819
|
y: 0
|
|
813
|
-
} :
|
|
820
|
+
} : i === "top-right" ? {
|
|
814
821
|
x: t,
|
|
815
822
|
y: 0
|
|
816
|
-
} :
|
|
823
|
+
} : i === "left" ? {
|
|
817
824
|
x: 0,
|
|
818
825
|
y: n / 2
|
|
819
|
-
} :
|
|
826
|
+
} : i === "right" ? {
|
|
820
827
|
x: t,
|
|
821
828
|
y: n / 2
|
|
822
|
-
} :
|
|
829
|
+
} : i === "bottom-left" ? {
|
|
823
830
|
x: 0,
|
|
824
831
|
y: n
|
|
825
|
-
} :
|
|
832
|
+
} : i === "bottom" ? {
|
|
826
833
|
x: t / 2,
|
|
827
834
|
y: n
|
|
828
|
-
} :
|
|
835
|
+
} : i === "bottom-right" ? {
|
|
829
836
|
x: t,
|
|
830
837
|
y: n
|
|
831
|
-
} : { x: t / 2, y: n / 2 },
|
|
832
|
-
const s = n * (Math.PI / 180), a = Math.abs(
|
|
838
|
+
} : { x: t / 2, y: n / 2 }, Pi = (i, t, n) => {
|
|
839
|
+
const s = n * (Math.PI / 180), a = Math.abs(i * Math.cos(s)) + Math.abs(t * Math.sin(s)), l = Math.abs(i * Math.sin(s)) + Math.abs(t * Math.cos(s));
|
|
833
840
|
return {
|
|
834
841
|
width: Math.round(a),
|
|
835
842
|
height: Math.round(l)
|
|
836
843
|
};
|
|
837
|
-
},
|
|
844
|
+
}, _e = (i) => "data:image/svg+xml," + encodeURIComponent(i).replace(/'/g, "%27").replace(/"/g, "%22"), Wi = ({ text: i, color: t, angleDegrees: n }) => {
|
|
838
845
|
const s = document.createElement("div");
|
|
839
846
|
s.style = `text-align:center;white-space:nowrap;line-height:100px;transform: rotate(${n}deg);position: absolute;top:0;left:0;opacity: 0;`;
|
|
840
847
|
const a = document.createElement("span");
|
|
841
|
-
a.style.color = t, a.style.fontSize = "36px", a.innerText =
|
|
842
|
-
const { width: l, height:
|
|
848
|
+
a.style.color = t, a.style.fontSize = "36px", a.innerText = i, s.append(a), document.body.append(s);
|
|
849
|
+
const { width: l, height: h } = s.getBoundingClientRect();
|
|
843
850
|
document.body.removeChild(s);
|
|
844
|
-
const f =
|
|
851
|
+
const f = Pi(l, h, n), d = `
|
|
845
852
|
<div xmlns="http://www.w3.org/1999/xhtml" style="text-align:center;white-space:nowrap;line-height:${f.height}px;transform:rotate(${n}deg);">
|
|
846
|
-
<span style="color:${t};font-size:36px;">${
|
|
853
|
+
<span style="color:${t};font-size:36px;">${i}</span>
|
|
847
854
|
</div>
|
|
848
|
-
`,
|
|
855
|
+
`, p = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${f.width} ${f.height}" width="${f.width}" height="${f.height}">
|
|
856
|
+
<foreignObject width="100%" height="100%">
|
|
857
|
+
${d}
|
|
858
|
+
</foreignObject>
|
|
859
|
+
</svg>`;
|
|
860
|
+
return _e(p);
|
|
861
|
+
}, Zi = (i) => {
|
|
862
|
+
const t = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32">
|
|
849
863
|
<foreignObject width="100%" height="100%">
|
|
850
|
-
|
|
864
|
+
<div xmlns="http://www.w3.org/1999/xhtml" style="text-align:center;white-space:nowrap;line-height:32px;">
|
|
865
|
+
<span style="color:#ffffff;font-size:18px;">${i}</span>
|
|
866
|
+
</div>
|
|
851
867
|
</foreignObject>
|
|
852
|
-
</svg
|
|
853
|
-
return (
|
|
868
|
+
</svg>`;
|
|
869
|
+
return _e(t);
|
|
854
870
|
};
|
|
855
|
-
let
|
|
871
|
+
let xt, Fi = class {
|
|
856
872
|
constructor() {
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
873
|
+
R(this, "img", {});
|
|
874
|
+
R(this, "invalid", !1);
|
|
875
|
+
R(this, "app", null);
|
|
876
|
+
R(this, "scale", 100);
|
|
877
|
+
R(this, "useTool", null);
|
|
878
|
+
R(this, "annotateColor", "#ff0000");
|
|
879
|
+
R(this, "strokeWidth", 4);
|
|
880
|
+
R(this, "shapes", /* @__PURE__ */ new Map());
|
|
881
|
+
R(this, "message", null);
|
|
882
|
+
R(this, "theme", "light");
|
|
883
|
+
R(this, "clearFun", null);
|
|
884
|
+
Tt(this);
|
|
867
885
|
}
|
|
868
886
|
get shapesList() {
|
|
869
|
-
return Array.from(
|
|
887
|
+
return Array.from(St(this.shapes).values());
|
|
870
888
|
}
|
|
871
889
|
get cursor() {
|
|
872
890
|
return this.useTool === "Pencil" ? "pencil" : this.useTool ? "crosshair" : "auto";
|
|
@@ -876,8 +894,20 @@ let pt, Eo = class {
|
|
|
876
894
|
const t = !!((n = this.app) != null && n.tree);
|
|
877
895
|
return t || (this.message.info("Please add a image"), this.setInvalid()), t;
|
|
878
896
|
}
|
|
897
|
+
get nextStep() {
|
|
898
|
+
const t = this.shapesList.filter((s) => s.type === "Step"), n = pi(t, (s) => Number(s.text));
|
|
899
|
+
return n != null && n.text ? Number(n.text) + 1 : 1;
|
|
900
|
+
}
|
|
901
|
+
get isDark() {
|
|
902
|
+
return this.theme === "dark";
|
|
903
|
+
}
|
|
904
|
+
setTheme(t) {
|
|
905
|
+
t !== this.theme && fi(() => {
|
|
906
|
+
t ? this.theme = t : this.theme = this.isDark ? "light" : "dark";
|
|
907
|
+
});
|
|
908
|
+
}
|
|
879
909
|
setInvalid() {
|
|
880
|
-
clearTimeout(
|
|
910
|
+
clearTimeout(xt), this.invalid = !0, xt = setTimeout(hi(() => {
|
|
881
911
|
this.invalid = !1;
|
|
882
912
|
}), 200);
|
|
883
913
|
}
|
|
@@ -914,15 +944,18 @@ let pt, Eo = class {
|
|
|
914
944
|
setStrokeWidth(t) {
|
|
915
945
|
this.strokeWidth = t;
|
|
916
946
|
}
|
|
947
|
+
setClearFun(t) {
|
|
948
|
+
this.clearFun = t;
|
|
949
|
+
}
|
|
917
950
|
clearImg() {
|
|
918
951
|
this.img = {};
|
|
919
952
|
}
|
|
920
953
|
destroy() {
|
|
921
954
|
var t;
|
|
922
|
-
(t = this.app) == null || t.destroy(), this.app = null;
|
|
955
|
+
(t = this.app) == null || t.destroy(!0), this.app = null, this.shapes.clear(), this.setUseTool(null);
|
|
923
956
|
}
|
|
924
957
|
};
|
|
925
|
-
const
|
|
958
|
+
const Gi = new Fi(), Q = {
|
|
926
959
|
default_1: {
|
|
927
960
|
class: "bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500",
|
|
928
961
|
fill: {
|
|
@@ -1309,25 +1342,25 @@ const Oo = new Eo(), Q = {
|
|
|
1309
1342
|
}
|
|
1310
1343
|
}
|
|
1311
1344
|
};
|
|
1312
|
-
class
|
|
1345
|
+
class Li {
|
|
1313
1346
|
constructor() {
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1347
|
+
R(this, "scale", 1);
|
|
1348
|
+
R(this, "scaleX", !1);
|
|
1349
|
+
R(this, "scaleY", !1);
|
|
1350
|
+
R(this, "padding", 0);
|
|
1351
|
+
R(this, "paddingBg", "rgba(255,255,255, 100)");
|
|
1352
|
+
R(this, "round", 10);
|
|
1353
|
+
R(this, "shadow", 3);
|
|
1354
|
+
R(this, "frame", "none");
|
|
1355
|
+
R(this, "background", "default_1");
|
|
1356
|
+
R(this, "align", "center");
|
|
1357
|
+
R(this, "waterImg", null);
|
|
1358
|
+
R(this, "waterIndex", 1);
|
|
1359
|
+
R(this, "size", {
|
|
1327
1360
|
type: "auto",
|
|
1328
1361
|
title: "Auto"
|
|
1329
1362
|
});
|
|
1330
|
-
|
|
1363
|
+
R(this, "frameConf", {
|
|
1331
1364
|
width: 800,
|
|
1332
1365
|
height: 600,
|
|
1333
1366
|
background: {
|
|
@@ -1337,10 +1370,10 @@ class _o {
|
|
|
1337
1370
|
stops: ["#6366f1", "#a855f7", "#ec4899"]
|
|
1338
1371
|
}
|
|
1339
1372
|
});
|
|
1340
|
-
|
|
1373
|
+
Tt(this);
|
|
1341
1374
|
}
|
|
1342
1375
|
get waterSvg() {
|
|
1343
|
-
return
|
|
1376
|
+
return St(this.waterImg);
|
|
1344
1377
|
}
|
|
1345
1378
|
setScale(t) {
|
|
1346
1379
|
this.scale = t;
|
|
@@ -1357,6 +1390,9 @@ class _o {
|
|
|
1357
1390
|
setShadow(t) {
|
|
1358
1391
|
this.shadow = t;
|
|
1359
1392
|
}
|
|
1393
|
+
setFrame(t) {
|
|
1394
|
+
this.frame = t;
|
|
1395
|
+
}
|
|
1360
1396
|
setFrameSize(t, n) {
|
|
1361
1397
|
!t || !n || (this.frameConf.width = t, this.frameConf.height = n);
|
|
1362
1398
|
}
|
|
@@ -1379,37 +1415,37 @@ class _o {
|
|
|
1379
1415
|
this.waterIndex = t;
|
|
1380
1416
|
}
|
|
1381
1417
|
}
|
|
1382
|
-
const
|
|
1383
|
-
editor:
|
|
1384
|
-
option:
|
|
1385
|
-
},
|
|
1386
|
-
const [
|
|
1387
|
-
|
|
1388
|
-
},
|
|
1389
|
-
|
|
1390
|
-
},
|
|
1391
|
-
t(
|
|
1418
|
+
const Ui = new Li(), o = {
|
|
1419
|
+
editor: Gi,
|
|
1420
|
+
option: Ui
|
|
1421
|
+
}, Vi = ({ disabled: i = !1, toSelect: t, locale: n = "en", theme: s = "auto" }) => {
|
|
1422
|
+
const [a, l] = O(!1), h = () => {
|
|
1423
|
+
l(!1);
|
|
1424
|
+
}, f = (p) => {
|
|
1425
|
+
l(p);
|
|
1426
|
+
}, d = (p) => {
|
|
1427
|
+
t(p.native), h();
|
|
1392
1428
|
};
|
|
1393
1429
|
return /* @__PURE__ */ e.jsx(
|
|
1394
|
-
|
|
1430
|
+
xe,
|
|
1395
1431
|
{
|
|
1396
|
-
content: /* @__PURE__ */ e.jsx(
|
|
1432
|
+
content: /* @__PURE__ */ e.jsx(mi, { data: ui, locale: n, onEmojiSelect: d, previewPosition: "none", theme: s }),
|
|
1397
1433
|
title: "",
|
|
1398
1434
|
trigger: "click",
|
|
1399
|
-
open:
|
|
1400
|
-
onOpenChange:
|
|
1435
|
+
open: a,
|
|
1436
|
+
onOpenChange: f,
|
|
1401
1437
|
children: /* @__PURE__ */ e.jsx(
|
|
1402
|
-
|
|
1438
|
+
k,
|
|
1403
1439
|
{
|
|
1404
1440
|
type: "text",
|
|
1405
1441
|
shape: "circle",
|
|
1406
|
-
disabled:
|
|
1407
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
1442
|
+
disabled: i,
|
|
1443
|
+
icon: /* @__PURE__ */ e.jsx(M.Smile, { size: 16 })
|
|
1408
1444
|
}
|
|
1409
1445
|
)
|
|
1410
1446
|
}
|
|
1411
1447
|
);
|
|
1412
|
-
},
|
|
1448
|
+
}, Ji = () => /* @__PURE__ */ e.jsx("h1", { children: /* @__PURE__ */ e.jsxs("a", { href: "https://shoteasy.fun", target: "_blank", "aria-label": "ShotEasy", className: "flex gap-1 text-gray-700 dark:text-gray-300 items-center text-xs font-semibold", children: [
|
|
1413
1449
|
/* @__PURE__ */ e.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 510 510", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1414
1450
|
/* @__PURE__ */ e.jsxs("g", { filter: "url(#filter0_i_40_60)", children: [
|
|
1415
1451
|
/* @__PURE__ */ e.jsx("path", { d: "M60.1774 83.172C64.1232 61.4358 84.9426 47.0139 106.679 50.9598L271.777 80.9308C293.513 84.8767 307.935 105.696 303.989 127.432L247.462 438.817C243.516 460.553 222.696 474.975 200.96 471.029L35.8623 441.058C14.1261 437.112 -0.295702 416.293 3.65017 394.557L60.1774 83.172Z", fill: "#812BED" }),
|
|
@@ -1429,59 +1465,64 @@ const Yo = new _o(), r = {
|
|
|
1429
1465
|
] }) })
|
|
1430
1466
|
] }),
|
|
1431
1467
|
/* @__PURE__ */ e.jsx("span", { children: "ShotEasy" })
|
|
1432
|
-
] }) }),
|
|
1433
|
-
|
|
1434
|
-
/* @__PURE__ */ e.jsx("a", { href: "https://
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1468
|
+
] }) }), qi = ({ children: i }) => /* @__PURE__ */ e.jsxs("div", { className: "flex-1 flex justify-end items-end gap-2 dark:text-gray-300", children: [
|
|
1469
|
+
i,
|
|
1470
|
+
/* @__PURE__ */ e.jsx("a", { href: "https://github.com/CH563/image-beautifier", target: "_blank", "aria-label": "GitHub", className: "block rounded-full p-2 hover:bg-slate-100 dark:hover:bg-slate-700", children: /* @__PURE__ */ e.jsx("svg", { viewBox: "64 64 896 896", focusable: "false", "data-icon": "github", width: "16", height: "16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx("path", { d: "M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9a127.5 127.5 0 0138.1 91v112.5c.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z" }) }) }),
|
|
1471
|
+
/* @__PURE__ */ e.jsx("a", { href: "https://twitter.com/LiWen563", target: "_blank", "aria-label": "twitter:@LiWen563", className: "block rounded-full p-2 dark:hover:bg-slate-700", children: /* @__PURE__ */ e.jsx("svg", { fill: "currentColor", viewBox: "0 0 24 24", width: "16", height: "16", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx("g", { children: /* @__PURE__ */ e.jsx("path", { d: "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" }) }) }) })
|
|
1472
|
+
] }), Xi = ["Square", "SquareFill", "Circle", "Slash", "MoveDownLeft", "Pencil", "Step", "Smile"], Qi = B(({ headLeft: i, headRight: t }) => {
|
|
1473
|
+
const [n, s] = O(!1), a = (d) => {
|
|
1474
|
+
if (!o.editor.isEditing) return;
|
|
1475
|
+
const { useTool: p } = o.editor;
|
|
1476
|
+
o.editor.setUseTool(p === d ? null : d), s(!1);
|
|
1477
|
+
}, l = (d) => {
|
|
1478
|
+
if (!o.editor.isEditing) return;
|
|
1479
|
+
const p = o.option.frameConf.width / 2 - 24, m = o.option.frameConf.height / 2 - 24;
|
|
1480
|
+
o.editor.setUseTool(null), s(!1), o.editor.addShape({
|
|
1481
|
+
id: ge(),
|
|
1445
1482
|
type: "emoji",
|
|
1446
|
-
text:
|
|
1447
|
-
zIndex:
|
|
1448
|
-
x:
|
|
1449
|
-
y:
|
|
1483
|
+
text: d,
|
|
1484
|
+
zIndex: o.editor.shapes.size + 1,
|
|
1485
|
+
x: p,
|
|
1486
|
+
y: m,
|
|
1450
1487
|
editable: !0
|
|
1451
1488
|
});
|
|
1452
|
-
},
|
|
1453
|
-
if (!
|
|
1454
|
-
const
|
|
1455
|
-
|
|
1489
|
+
}, h = () => {
|
|
1490
|
+
if (!o.editor.isEditing) return;
|
|
1491
|
+
const d = !n;
|
|
1492
|
+
o.editor.setUseTool(null), s(d), o.editor.app.config.move.drag = d;
|
|
1493
|
+
}, f = () => {
|
|
1494
|
+
o.editor.setTheme(), localStorage.setItem("SHOTEASY_BEAUTIFIER_THEME", o.editor.theme);
|
|
1456
1495
|
};
|
|
1457
|
-
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center shrink-0 gap-3 bg-white py-2 px-5 border-b border-b-gray-50 shadow-sm relative z-[11] select-none", children: [
|
|
1458
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex-1", children: /* @__PURE__ */ e.jsx(
|
|
1459
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex gap-1 justify-center items-center", children:
|
|
1460
|
-
if (
|
|
1461
|
-
let
|
|
1462
|
-
if (
|
|
1463
|
-
const
|
|
1464
|
-
|
|
1465
|
-
} else
|
|
1466
|
-
|
|
1467
|
-
|
|
1496
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center shrink-0 gap-3 bg-white dark:bg-black py-2 px-5 border-b border-b-gray-50 dark:border-b-gray-700 shadow-sm relative z-[11] select-none", children: [
|
|
1497
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex-1", children: i || /* @__PURE__ */ e.jsx(Ji, {}) }),
|
|
1498
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex gap-1 justify-center items-center", children: Xi.map((d) => {
|
|
1499
|
+
if (d === "Smile") return /* @__PURE__ */ e.jsx(Vi, { disabled: !1, theme: o.editor.isDark ? "dark" : "light", toSelect: l }, d);
|
|
1500
|
+
let p;
|
|
1501
|
+
if (d.includes("Fill")) {
|
|
1502
|
+
const m = d.replace("Fill", ""), b = dt[m];
|
|
1503
|
+
p = /* @__PURE__ */ e.jsx(b, { size: 16, fill: "currentColor" });
|
|
1504
|
+
} else if (d === "Step")
|
|
1505
|
+
p = /* @__PURE__ */ e.jsx("div", { className: "border text-xs border-black dark:border-white w-4 h-4 rounded-full text-center leading-4", children: o.editor.nextStep }, d);
|
|
1506
|
+
else {
|
|
1507
|
+
const m = dt[d];
|
|
1508
|
+
p = /* @__PURE__ */ e.jsx(m, { name: d, size: 16 });
|
|
1468
1509
|
}
|
|
1469
1510
|
return /* @__PURE__ */ e.jsx(
|
|
1470
|
-
|
|
1511
|
+
k,
|
|
1471
1512
|
{
|
|
1472
1513
|
type: "text",
|
|
1473
1514
|
shape: "circle",
|
|
1474
|
-
icon:
|
|
1475
|
-
className:
|
|
1476
|
-
onClick: () =>
|
|
1515
|
+
icon: p,
|
|
1516
|
+
className: o.editor.useTool === d && "text-[#1a79ff] [&_.border]:border-[#1a79ff] bg-sky-100/50 hover:bg-sky-100 hover:text-[#1a79ff] [&_.border]:hover:text-[#1a79ff]",
|
|
1517
|
+
onClick: () => a(d)
|
|
1477
1518
|
},
|
|
1478
|
-
|
|
1519
|
+
d
|
|
1479
1520
|
);
|
|
1480
1521
|
}) }),
|
|
1481
|
-
/* @__PURE__ */ e.jsx(
|
|
1522
|
+
/* @__PURE__ */ e.jsx(mr, { type: "vertical" }),
|
|
1482
1523
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 justify-center items-center", children: [
|
|
1483
1524
|
/* @__PURE__ */ e.jsx(
|
|
1484
|
-
|
|
1525
|
+
be,
|
|
1485
1526
|
{
|
|
1486
1527
|
size: "small",
|
|
1487
1528
|
presets: [
|
|
@@ -1500,141 +1541,149 @@ const Yo = new _o(), r = {
|
|
|
1500
1541
|
]
|
|
1501
1542
|
}
|
|
1502
1543
|
],
|
|
1503
|
-
value:
|
|
1504
|
-
onChange: (
|
|
1544
|
+
value: o.editor.annotateColor,
|
|
1545
|
+
onChange: (d) => o.editor.setAnnotateColor(d.toHexString())
|
|
1505
1546
|
}
|
|
1506
1547
|
),
|
|
1507
|
-
/* @__PURE__ */ e.jsx(
|
|
1548
|
+
/* @__PURE__ */ e.jsx(zi, { defaultValue: o.editor.strokeWidth, onChange: (d) => o.editor.setStrokeWidth(d) }),
|
|
1508
1549
|
/* @__PURE__ */ e.jsx(
|
|
1509
|
-
|
|
1550
|
+
k,
|
|
1510
1551
|
{
|
|
1511
1552
|
type: "text",
|
|
1512
1553
|
shape: "circle",
|
|
1513
|
-
className:
|
|
1514
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
1515
|
-
onClick:
|
|
1554
|
+
className: n && "text-[#1677ff] bg-sky-100/50 hover:bg-sky-100 hover:text-[#1677ff]",
|
|
1555
|
+
icon: /* @__PURE__ */ e.jsx(M.Hand, { size: 16 }),
|
|
1556
|
+
onClick: h
|
|
1516
1557
|
}
|
|
1517
1558
|
)
|
|
1518
1559
|
] }),
|
|
1519
|
-
/* @__PURE__ */ e.jsx(
|
|
1560
|
+
t || /* @__PURE__ */ e.jsx(qi, { children: /* @__PURE__ */ e.jsx(
|
|
1561
|
+
k,
|
|
1562
|
+
{
|
|
1563
|
+
type: "text",
|
|
1564
|
+
shape: "circle",
|
|
1565
|
+
icon: o.editor.isDark ? /* @__PURE__ */ e.jsx(M.Sun, { size: 16 }) : /* @__PURE__ */ e.jsx(M.Moon, { size: 16 }),
|
|
1566
|
+
onClick: f
|
|
1567
|
+
}
|
|
1568
|
+
) })
|
|
1520
1569
|
] });
|
|
1521
1570
|
});
|
|
1522
|
-
function
|
|
1523
|
-
var t = typeof
|
|
1524
|
-
return
|
|
1571
|
+
function $i(i) {
|
|
1572
|
+
var t = typeof i;
|
|
1573
|
+
return i != null && (t == "object" || t == "function");
|
|
1525
1574
|
}
|
|
1526
|
-
var
|
|
1527
|
-
return
|
|
1528
|
-
},
|
|
1529
|
-
function
|
|
1530
|
-
for (var t =
|
|
1575
|
+
var Ht = $i, Ki = typeof ue == "object" && ue && ue.Object === Object && ue, eo = Ki, to = eo, ro = typeof self == "object" && self && self.Object === Object && self, io = to || ro || Function("return this")(), zt = io, oo = zt, so = function() {
|
|
1576
|
+
return oo.Date.now();
|
|
1577
|
+
}, no = so, ao = /\s/;
|
|
1578
|
+
function lo(i) {
|
|
1579
|
+
for (var t = i.length; t-- && ao.test(i.charAt(t)); )
|
|
1531
1580
|
;
|
|
1532
1581
|
return t;
|
|
1533
1582
|
}
|
|
1534
|
-
var
|
|
1535
|
-
function
|
|
1536
|
-
return
|
|
1583
|
+
var co = lo, fo = co, ho = /^\s+/;
|
|
1584
|
+
function po(i) {
|
|
1585
|
+
return i && i.slice(0, fo(i) + 1).replace(ho, "");
|
|
1537
1586
|
}
|
|
1538
|
-
var
|
|
1539
|
-
function
|
|
1540
|
-
var t =
|
|
1587
|
+
var uo = po, mo = zt, go = mo.Symbol, _t = go, bt = _t, Et = Object.prototype, xo = Et.hasOwnProperty, bo = Et.toString, se = bt ? bt.toStringTag : void 0;
|
|
1588
|
+
function wo(i) {
|
|
1589
|
+
var t = xo.call(i, se), n = i[se];
|
|
1541
1590
|
try {
|
|
1542
|
-
|
|
1591
|
+
i[se] = void 0;
|
|
1543
1592
|
var s = !0;
|
|
1544
1593
|
} catch {
|
|
1545
1594
|
}
|
|
1546
|
-
var a =
|
|
1547
|
-
return s && (t ?
|
|
1595
|
+
var a = bo.call(i);
|
|
1596
|
+
return s && (t ? i[se] = n : delete i[se]), a;
|
|
1548
1597
|
}
|
|
1549
|
-
var
|
|
1550
|
-
function
|
|
1551
|
-
return
|
|
1598
|
+
var yo = wo, vo = Object.prototype, jo = vo.toString;
|
|
1599
|
+
function Mo(i) {
|
|
1600
|
+
return jo.call(i);
|
|
1552
1601
|
}
|
|
1553
|
-
var
|
|
1554
|
-
function
|
|
1555
|
-
return
|
|
1602
|
+
var Co = Mo, wt = _t, ko = yo, Ao = Co, No = "[object Null]", To = "[object Undefined]", yt = wt ? wt.toStringTag : void 0;
|
|
1603
|
+
function So(i) {
|
|
1604
|
+
return i == null ? i === void 0 ? To : No : yt && yt in Object(i) ? ko(i) : Ao(i);
|
|
1556
1605
|
}
|
|
1557
|
-
var
|
|
1558
|
-
function
|
|
1559
|
-
return
|
|
1606
|
+
var Ro = So;
|
|
1607
|
+
function Do(i) {
|
|
1608
|
+
return i != null && typeof i == "object";
|
|
1560
1609
|
}
|
|
1561
|
-
var
|
|
1562
|
-
function
|
|
1563
|
-
return typeof
|
|
1610
|
+
var Ho = Do, zo = Ro, _o = Ho, Eo = "[object Symbol]";
|
|
1611
|
+
function Oo(i) {
|
|
1612
|
+
return typeof i == "symbol" || _o(i) && zo(i) == Eo;
|
|
1564
1613
|
}
|
|
1565
|
-
var
|
|
1566
|
-
function
|
|
1567
|
-
if (typeof
|
|
1568
|
-
return
|
|
1569
|
-
if (
|
|
1570
|
-
return
|
|
1571
|
-
if (
|
|
1572
|
-
var t = typeof
|
|
1573
|
-
|
|
1614
|
+
var Bo = Oo, Yo = uo, vt = Ht, Io = Bo, jt = NaN, Po = /^[-+]0x[0-9a-f]+$/i, Wo = /^0b[01]+$/i, Zo = /^0o[0-7]+$/i, Fo = parseInt;
|
|
1615
|
+
function Go(i) {
|
|
1616
|
+
if (typeof i == "number")
|
|
1617
|
+
return i;
|
|
1618
|
+
if (Io(i))
|
|
1619
|
+
return jt;
|
|
1620
|
+
if (vt(i)) {
|
|
1621
|
+
var t = typeof i.valueOf == "function" ? i.valueOf() : i;
|
|
1622
|
+
i = vt(t) ? t + "" : t;
|
|
1574
1623
|
}
|
|
1575
|
-
if (typeof
|
|
1576
|
-
return
|
|
1577
|
-
|
|
1578
|
-
var n =
|
|
1579
|
-
return n ||
|
|
1624
|
+
if (typeof i != "string")
|
|
1625
|
+
return i === 0 ? i : +i;
|
|
1626
|
+
i = Yo(i);
|
|
1627
|
+
var n = Wo.test(i);
|
|
1628
|
+
return n || Zo.test(i) ? Fo(i.slice(2), n ? 2 : 8) : Po.test(i) ? jt : +i;
|
|
1580
1629
|
}
|
|
1581
|
-
var
|
|
1582
|
-
function
|
|
1583
|
-
var s, a, l,
|
|
1584
|
-
if (typeof
|
|
1585
|
-
throw new TypeError(
|
|
1586
|
-
t =
|
|
1587
|
-
function
|
|
1588
|
-
var
|
|
1589
|
-
return s = a = void 0,
|
|
1630
|
+
var Lo = Go, Uo = Ht, He = no, Mt = Lo, Vo = "Expected a function", Jo = Math.max, qo = Math.min;
|
|
1631
|
+
function Xo(i, t, n) {
|
|
1632
|
+
var s, a, l, h, f, d, p = 0, m = !1, b = !1, C = !0;
|
|
1633
|
+
if (typeof i != "function")
|
|
1634
|
+
throw new TypeError(Vo);
|
|
1635
|
+
t = Mt(t) || 0, Uo(n) && (m = !!n.leading, b = "maxWait" in n, l = b ? Jo(Mt(n.maxWait) || 0, t) : l, C = "trailing" in n ? !!n.trailing : C);
|
|
1636
|
+
function A(D) {
|
|
1637
|
+
var F = s, U = a;
|
|
1638
|
+
return s = a = void 0, p = D, h = i.apply(U, F), h;
|
|
1590
1639
|
}
|
|
1591
|
-
function x(
|
|
1592
|
-
return
|
|
1640
|
+
function x(D) {
|
|
1641
|
+
return p = D, f = setTimeout(_, t), m ? A(D) : h;
|
|
1593
1642
|
}
|
|
1594
|
-
function
|
|
1595
|
-
var
|
|
1596
|
-
return
|
|
1643
|
+
function w(D) {
|
|
1644
|
+
var F = D - d, U = D - p, K = t - F;
|
|
1645
|
+
return b ? qo(K, l - U) : K;
|
|
1597
1646
|
}
|
|
1598
|
-
function
|
|
1599
|
-
var
|
|
1600
|
-
return
|
|
1647
|
+
function S(D) {
|
|
1648
|
+
var F = D - d, U = D - p;
|
|
1649
|
+
return d === void 0 || F >= t || F < 0 || b && U >= l;
|
|
1601
1650
|
}
|
|
1602
1651
|
function _() {
|
|
1603
|
-
var
|
|
1604
|
-
if (
|
|
1605
|
-
return E(
|
|
1606
|
-
f = setTimeout(_,
|
|
1652
|
+
var D = He();
|
|
1653
|
+
if (S(D))
|
|
1654
|
+
return E(D);
|
|
1655
|
+
f = setTimeout(_, w(D));
|
|
1607
1656
|
}
|
|
1608
|
-
function E(
|
|
1609
|
-
return f = void 0,
|
|
1657
|
+
function E(D) {
|
|
1658
|
+
return f = void 0, C && s ? A(D) : (s = a = void 0, h);
|
|
1610
1659
|
}
|
|
1611
|
-
function
|
|
1612
|
-
f !== void 0 && clearTimeout(f),
|
|
1660
|
+
function ye() {
|
|
1661
|
+
f !== void 0 && clearTimeout(f), p = 0, s = d = a = f = void 0;
|
|
1613
1662
|
}
|
|
1614
|
-
function
|
|
1615
|
-
return f === void 0 ?
|
|
1663
|
+
function ve() {
|
|
1664
|
+
return f === void 0 ? h : E(He());
|
|
1616
1665
|
}
|
|
1617
1666
|
function $() {
|
|
1618
|
-
var
|
|
1619
|
-
if (s = arguments, a = this,
|
|
1667
|
+
var D = He(), F = S(D);
|
|
1668
|
+
if (s = arguments, a = this, d = D, F) {
|
|
1620
1669
|
if (f === void 0)
|
|
1621
|
-
return x(
|
|
1622
|
-
if (
|
|
1623
|
-
return clearTimeout(f), f = setTimeout(_, t),
|
|
1670
|
+
return x(d);
|
|
1671
|
+
if (b)
|
|
1672
|
+
return clearTimeout(f), f = setTimeout(_, t), A(d);
|
|
1624
1673
|
}
|
|
1625
|
-
return f === void 0 && (f = setTimeout(_, t)),
|
|
1674
|
+
return f === void 0 && (f = setTimeout(_, t)), h;
|
|
1626
1675
|
}
|
|
1627
|
-
return $.cancel =
|
|
1676
|
+
return $.cancel = ye, $.flush = ve, $;
|
|
1628
1677
|
}
|
|
1629
|
-
var
|
|
1630
|
-
const
|
|
1631
|
-
(s) =>
|
|
1632
|
-
)) :
|
|
1633
|
-
(s) =>
|
|
1634
|
-
),
|
|
1635
|
-
const
|
|
1636
|
-
const f = new
|
|
1637
|
-
width:
|
|
1678
|
+
var Qo = Xo;
|
|
1679
|
+
const $o = /* @__PURE__ */ Si(Qo), Ko = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFHGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDUgNzkuMTYzNDk5LCAyMDE4LzA4LzEzLTE2OjQwOjIyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOSAoV2luZG93cykiIHhtcDpDcmVhdGVEYXRlPSIyMDI0LTA0LTE1VDEyOjUwOjI3KzA4OjAwIiB4bXA6TW9kaWZ5RGF0ZT0iMjAyNC0wNC0xNVQxMjo1MzowOSswODowMCIgeG1wOk1ldGFkYXRhRGF0ZT0iMjAyNC0wNC0xNVQxMjo1MzowOSswODowMCIgZGM6Zm9ybWF0PSJpbWFnZS9wbmciIHBob3Rvc2hvcDpDb2xvck1vZGU9IjMiIHBob3Rvc2hvcDpJQ0NQcm9maWxlPSJzUkdCIElFQzYxOTY2LTIuMSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxNTY3NDQxZC1lYmQxLWIwNGUtOWUwOS0yMWQ1Mjk3NzAxNzMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MTU2NzQ0MWQtZWJkMS1iMDRlLTllMDktMjFkNTI5NzcwMTczIiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6MTU2NzQ0MWQtZWJkMS1iMDRlLTllMDktMjFkNTI5NzcwMTczIj4gPHhtcE1NOkhpc3Rvcnk+IDxyZGY6U2VxPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0iY3JlYXRlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDoxNTY3NDQxZC1lYmQxLWIwNGUtOWUwOS0yMWQ1Mjk3NzAxNzMiIHN0RXZ0OndoZW49IjIwMjQtMDQtMTVUMTI6NTA6MjcrMDg6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE5IChXaW5kb3dzKSIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7YEaJEAAAFqUlEQVRoge2Z709TVxjHT2kpFMpCLdSWdiWYFVK0IAV0yBqNYQ2CI062ie4PcJq9QZAfmRq0UwQmIRjjFBeXOJfAYHEYZ81ixQUmJhbkBb9aSotcpHDbYltbU0t69+LqXQPa9Nyit0v6zXlx2p7v8zyfe0977jmlYRgG/s+KorqAUBUBoFoRAKoVAaBaEQCqFQGgWhEAqsUIfqjZbG5parI7HLV1dRKJZPUAt9uNoqhucvKfgQGTyYRaLAtmMwBAIpGkpqbKsrJy5PLU1NS4uLg1Kx8AgAWtcy0tdADoANTX1vp8Pv+PrFZrT3f3gf37JRs24GPe2AQ83tcHDvx6/brFYgk+b2BBABytqsLr+PbwYY/Hg7/pdDp/6+r6rLQ0hsEIUPqKVlpc/HtPj9frDR0AYgpFRb36wtBoNBqNBgAYGhpSNTTcvn17eXmZGCaRSKRS6YdisSAlZR2HgyCI0WhEEGTk8WOHw4GPUavVmnv3KioqVKdPC4XC9zSF6mpq8OtXVVmJYVhXZ+dHaWnERWUxmV+Vl/9y7dro6OjS0tLy8jJhdLlc8/Pz9/v6TjY05GRn+9+Kop07dTpdKHeADMA3Bw+ebWzkJibiLxk02u6Skr6+PqfTGTiCz+czm82qU6dEKSkEw+asrIeDg+8VQMDjxcfG4v342NiWpqYXL15AZR0YGMiTy/0ZDAYDZOWvRAaAaHExMa3nzpFLPDo6qigsJEJ9vmePy+UiEYc8ADcx8ceLF0mkJDQ9Pb01Px+PxqTTz7e3kwhCHqCstPTp06cGg2HqtfR6/bNnz6DSa7VakUCAB9wklZpMJsj6YQBqqqv9AVLWr5dt3JiZkUE0aXr67pKSmZkZqArOnjlDxGxpboasHwbgu/r6YBapjsuXoSqw2Wxb8vJwr3zzZgRBoOwQD3OFCkVSUlJCQsIHb1duXt6OHTugFiIOh1N55Ai+Mk7p9dPT01B2iJVYqVT+pdHMPnlCrMT+wjCMwWBIMzNFIhFUBQCAjwsKxGLxzMyMy+XS6XQKhQLCDHW/3pGcTmfFvn34LDp86BCUNyz2A2w2WyaT4X2DXg/lDQsAAACfz8c7iygKZQwXgOTkZBaLBQBAFxehjOECwGazmUwmAOD58+dQxnABWFxcdLvdAIB1XC6UMVwAUBT1er0AAF5yMpQxLABevnw5OTGB95PeHQCGYT9duVJYUHD50iVsTf9ZW1hY0Ny9i/ezs7PhzMEvGWNjY2KhkA4Aj8vVarVQy01g/XHjBvEo1dPdDeWFuANxLFYihwMAsFqt59vb8SkbuhwOx4ULF/C+QCBIz8iA80Ph/vD6aIjFZN5Rq6G8b9PZxkb/PYbD4YCywwGYTCZZZiaeLE8un52dhbKv1uPhYWJDw2axujo7YSNAP8y1t7VFR0XhKUt27VpaWoKNQMhsNn+ybRtx+b/cu9ftdsMGgQaw2+3KoiIia7FSqdfrYYNgGIYgyJ6ysv/2dzzePY2GRBwyj9PDQ0NpYjGRe2t+/t/370NF6O/v35Kb63+60dbauuK8NUiR3A/c7O0V8fn+p7Ynjh+fn5/3P5BbLa/Xq9PpGk6cEItEhJdJpx8/doxcGRhpAAzDBh88WHFOmC2T1dfW3lGrjUaj1Wr1eDw+n8/tdttsNsPU1M3e3qrKSuIrizeRQNDS3BwYO7BoWAhr6uTExNHq6j9v3fJ/k8FgbJLJ+AKBSChMSEhAUdRms80hyMjIyAq7QqFoUKm2b99OugAAQt5S2u32n69e9f8xCaZlSCTfq1SwBxBv1Nrsiefm5q50dHxRXr4+KSlw6bk5OadOnhwfH1+TvFiIU2iFXC6X0Wh8ODioffTIYrFYLBar1RodHR0fH89ms3Pk8k+VyvT0dD6fv/pQg7TWEoAShcV+IBRFAKhWBIBqRQCoVgSAakUAqFYEgGr9C1O6hDD/uqSdAAAAAElFTkSuQmCC", es = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAPqSURBVFiFxdZ/TFVlGMDx7/seLnjFewE3B1xwM62tlGJYSCIBBbv2g8JMakaptZpzi2T2Y/lPqzblnzYG/cVG2tJ+mavl1qZm05rSykEO0QDBgIvA5e4yvRe4F7ic0x90b5d7D4JwWM9f55w9z57P+7xn7zmkHRj4Ie3AQBH/U8SgUrPCohx/97z3aFqiqQ20YdCGhSpvTSqqB5ThSx3t7oOl9zsXAyAAPrkwUptqlRV6CT6fv6dye1HqePL63d6G+sNGAySAzapc023u9/dWbtuY7u5sMo00Hfs09a0L+YsC0ITm0W1elmdz97RKACVppVCWrzmRfnAgx3iApnl1m3ddkcFn5nvtAAlonDISMbU6ZAjg8/t7K5/bOK05QGx6VvDSUMTUBFTVG2q+bVNo7NMSLSnht4YhpgAxije08u6rUc1zcvN446kMMm0mwxESoKWt1bX3hUeT9Vaek5vHiVPn2FOYwqGyJErXmSMRJ1dW9WcvCPDB1szBMVvOTmlO0CITHil4DCmnXFLA+8WWSESipoqf5juJ0IpHztd9Zc4q2yGXWKchfjl7BlVV/yvQR8x7O5TwmwlHU/PSh3e1T7o6tmqBMQHQ1+vgRq+DzU8+gxACACGgYE0cQ6MqV52BYPkSoMxa/PZZz88f35gXAGCip7ElEtHSfIn+oWHsdjv/GhBA3l0LR0QBQogNL3dOujqeDSIuN/6G954yCteuMBShCwD97bjS2o5n9RYKVscZhpgRANHbEXBfp2vZQ7hi0g1D3BYQQoRtx7ijEUd6KU5frCGIWQEwfTsmPf1iou8yDlsJzhHIj0BsWhXHX4MBem5OzgkxJ0DkJCYG20XA/TfdywtxjsrpCAGxMYLT7WPh5TMioo7e28VIQ/3RZdnlO6Q5QRtt/p7BuhK+a+jkozNe1LDjq9Md0CtPQOPkkeoj68MfijsBBCM+b/d2X+PXX6i+W0KaE7DkV/BEeQVbMq1cdweovzjKeCDqVKdeOX5us7iWhWSzeKfm93kDAOJzX3vJ13Tsc9XvEQBKYhrxD76I+b7HMaWui8r/TPn21yLREfylu4mqFYv9tY3zBughgqEkphFrewDFmoqIXcqXhSl/lMS7NkSU96GOZ8z5JdQLvcMKQPN7Cbg6GO/9kzp7RtfzKYHokYAFIX0LAoD+tyMYh19/tWvX3ZZVMxYLEb9gwEyIWZtPhWYIIBJx6JXy7jk0B0Hbgl5CvXhvZ4W9aq38BkicPVt8aDgAQKvam43k9CyIfkwy445OwrmG2F9zEVUrBvpmbK5qT4t91UOLMoFgaFV7kpCmN0GUAMmAE8SPmESt2Fc9BPAP1KEkwmzcLhwAAAAASUVORK5CYII=", ts = (i, t) => t instanceof Array ? t.map((n) => ot.toArray(n).map(
|
|
1680
|
+
(s) => st(s, { ...i })
|
|
1681
|
+
)) : ot.toArray(t).map(
|
|
1682
|
+
(s) => st(s, { ...i })
|
|
1683
|
+
), rs = ({ width: i, height: t, background: n, parent: s, children: a, cursor: l }) => {
|
|
1684
|
+
const h = le(() => {
|
|
1685
|
+
const f = new gi({
|
|
1686
|
+
width: i,
|
|
1638
1687
|
height: t,
|
|
1639
1688
|
overflow: "hide",
|
|
1640
1689
|
fill: n,
|
|
@@ -1642,147 +1691,215 @@ const Zr = /* @__PURE__ */ vo(Wr), Gr = "data:image/png;base64,iVBORw0KGgoAAAANS
|
|
|
1642
1691
|
});
|
|
1643
1692
|
return f.name = "frame", f;
|
|
1644
1693
|
}, []);
|
|
1645
|
-
return
|
|
1646
|
-
|
|
1647
|
-
}, [
|
|
1648
|
-
|
|
1649
|
-
}, [l]),
|
|
1650
|
-
|
|
1651
|
-
}), [s]), /* @__PURE__ */ e.jsx(e.Fragment, { children:
|
|
1652
|
-
},
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1694
|
+
return N(() => {
|
|
1695
|
+
h.width = i, h.height = t, h.fill = n;
|
|
1696
|
+
}, [i, t, n]), N(() => {
|
|
1697
|
+
h.cursor = l || "auto";
|
|
1698
|
+
}, [l]), N(() => (s.add(h), () => {
|
|
1699
|
+
h.remove();
|
|
1700
|
+
}), [s]), /* @__PURE__ */ e.jsx(e.Fragment, { children: ts({ parent: h }, a) });
|
|
1701
|
+
}, is = `
|
|
1702
|
+
<svg width="43" height="32" viewBox="0 0 52 38" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 24.75C9.17564 24.75 11.75 22.1756 11.75 19C11.75 15.8244 9.17564 13.25 6 13.25C2.82436 13.25 0.25 15.8244 0.25 19C0.25 22.1756 2.82436 24.75 6 24.75Z" fill="#FF5F57" stroke="black" stroke-opacity="0.2" stroke-width="0.5"></path><path d="M26 24.75C29.1756 24.75 31.75 22.1756 31.75 19C31.75 15.8244 29.1756 13.25 26 13.25C22.8244 13.25 20.25 15.8244 20.25 19C20.25 22.1756 22.8244 24.75 26 24.75Z" fill="#FEBC2E" stroke="black" stroke-opacity="0.2" stroke-width="0.5"></path><path d="M46 24.75C49.1756 24.75 51.75 22.1756 51.75 19C51.75 15.8244 49.1756 13.25 46 13.25C42.8244 13.25 40.25 15.8244 40.25 19C40.25 22.1756 42.8244 24.75 46 24.75Z" fill="#28C840" stroke="black" stroke-opacity="0.2" stroke-width="0.5"></path></svg>
|
|
1703
|
+
`, os = _e(is), ss = B(({ parent: i }) => {
|
|
1704
|
+
const t = ne(null), [n, s, a] = le(() => {
|
|
1705
|
+
const l = new ae({
|
|
1706
|
+
origin: "center",
|
|
1707
|
+
fill: {
|
|
1708
|
+
type: "image",
|
|
1709
|
+
url: o.editor.img.src
|
|
1710
|
+
}
|
|
1711
|
+
}), h = new ft({
|
|
1712
|
+
overflow: "hide",
|
|
1713
|
+
children: [l]
|
|
1714
|
+
}), f = new ft({
|
|
1658
1715
|
overflow: "hide",
|
|
1716
|
+
strokeAlign: "outside",
|
|
1659
1717
|
scale: 1,
|
|
1660
|
-
|
|
1718
|
+
fill: "#ffffff00",
|
|
1719
|
+
children: [h]
|
|
1661
1720
|
});
|
|
1662
|
-
return [
|
|
1663
|
-
}, [
|
|
1664
|
-
return
|
|
1665
|
-
|
|
1666
|
-
}, [
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1721
|
+
return [l, h, f];
|
|
1722
|
+
}, [i]);
|
|
1723
|
+
return N(() => {
|
|
1724
|
+
o.option.padding === 0 ? s.fill = "#ffffff00" : s.fill = o.option.paddingBg;
|
|
1725
|
+
}, [o.option.paddingBg, o.option.padding]), N(() => {
|
|
1726
|
+
const { round: l } = o.option;
|
|
1727
|
+
a.cornerRadius = l, t.current ? (t.current.cornerRadius = [l, l, 0, 0], s.cornerRadius = [0, 0, l, l], n.cornerRadius = [0, 0, l, l]) : (s.cornerRadius = l, n.cornerRadius = l);
|
|
1728
|
+
}, [o.option.round]), N(() => {
|
|
1729
|
+
const { shadow: l } = o.option;
|
|
1730
|
+
l === 0 ? a.shadow = null : a.shadow = {
|
|
1731
|
+
x: l * 4,
|
|
1732
|
+
y: l * 4,
|
|
1733
|
+
blur: l * 3,
|
|
1674
1734
|
color: "#00000045",
|
|
1675
1735
|
box: !0
|
|
1676
1736
|
};
|
|
1677
|
-
}, [
|
|
1678
|
-
|
|
1679
|
-
}, [
|
|
1680
|
-
|
|
1681
|
-
}, [
|
|
1682
|
-
|
|
1683
|
-
}, [
|
|
1684
|
-
|
|
1685
|
-
}, [
|
|
1686
|
-
const
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1737
|
+
}, [o.option.shadow]), N(() => {
|
|
1738
|
+
a.scale = o.option.scale;
|
|
1739
|
+
}, [o.option.scale]), N(() => {
|
|
1740
|
+
n.url = o.editor.img.src;
|
|
1741
|
+
}, [o.editor.img.src]), N(() => {
|
|
1742
|
+
n.scaleX = o.option.scaleX ? -1 : 1;
|
|
1743
|
+
}, [o.option.scaleX]), N(() => {
|
|
1744
|
+
n.scaleY = o.option.scaleY ? -1 : 1;
|
|
1745
|
+
}, [o.option.scaleY]), N(() => {
|
|
1746
|
+
const { align: l, round: h, frame: f, frameConf: d } = o.option, p = we(d.width, d.height), { width: m, height: b } = Bi(o.editor.img.width, o.editor.img.height, d.width - p, d.height - p);
|
|
1747
|
+
let C = b;
|
|
1748
|
+
switch (f) {
|
|
1749
|
+
case "light":
|
|
1750
|
+
a.strokeWidth = 8, a.stroke = "#ffffff80";
|
|
1751
|
+
break;
|
|
1752
|
+
case "dark":
|
|
1753
|
+
a.strokeWidth = 8, a.stroke = "#00000050";
|
|
1754
|
+
break;
|
|
1755
|
+
case "macosBarLight":
|
|
1756
|
+
case "macosBarDark":
|
|
1757
|
+
C += 32, t.current = new ae({
|
|
1758
|
+
x: 0,
|
|
1759
|
+
y: 0,
|
|
1760
|
+
height: 32,
|
|
1761
|
+
width: m,
|
|
1762
|
+
cornerRadius: [h, h, 0, 0],
|
|
1763
|
+
draggable: !0,
|
|
1764
|
+
fill: [
|
|
1765
|
+
{ type: "solid", color: f.includes("Dark") ? "#3a3a3b" : "#ffffff" },
|
|
1766
|
+
{ type: "image", url: os, format: "svg", mode: "clip", offset: { x: 10, y: 0 } }
|
|
1767
|
+
]
|
|
1768
|
+
}), a.addAfter(t.current, s), s.cornerRadius = [0, 0, h, h], n.cornerRadius = [0, 0, h, h];
|
|
1769
|
+
break;
|
|
1770
|
+
default:
|
|
1771
|
+
a.strokeWidth = null, a.stroke = null;
|
|
1772
|
+
}
|
|
1773
|
+
const { x: A, y: x } = Ii(l, d.width - m, d.height - C);
|
|
1774
|
+
a.width = m, a.height = C, a.origin = l, a.x = A, a.y = x, s.width = m, s.height = b, s.x = 0, s.y = C - b;
|
|
1775
|
+
const w = m - o.option.padding, S = Math.round(w * b / m);
|
|
1776
|
+
return n.width = w + 2, n.height = S + 2, n.x = o.option.padding / 2 - 1, n.y = (b - S) / 2 - 1, () => {
|
|
1777
|
+
var _;
|
|
1778
|
+
a.strokeWidth = null, a.stroke = null, (_ = t.current) == null || _.remove(), t.current = null, s.cornerRadius = o.option.round, n.cornerRadius = o.option.round;
|
|
1779
|
+
};
|
|
1780
|
+
}, [o.option.frameConf.width, o.option.frameConf.height, o.option.padding, o.option.align, o.option.frame]), N(() => (i.add(a), () => {
|
|
1781
|
+
a.remove();
|
|
1782
|
+
}), [i]), null;
|
|
1783
|
+
}), ns = B(({ parent: i }) => {
|
|
1784
|
+
const t = le(() => new ae({
|
|
1695
1785
|
x: 0,
|
|
1696
1786
|
y: 0
|
|
1697
|
-
}), [
|
|
1698
|
-
return
|
|
1699
|
-
t.width =
|
|
1700
|
-
}, [
|
|
1701
|
-
t.zIndex =
|
|
1702
|
-
}, [
|
|
1787
|
+
}), [i]);
|
|
1788
|
+
return N(() => {
|
|
1789
|
+
t.width = o.option.frameConf.width, t.height = o.option.frameConf.height;
|
|
1790
|
+
}, [o.option.frameConf.width, o.option.frameConf.height]), N(() => {
|
|
1791
|
+
t.zIndex = o.option.waterIndex;
|
|
1792
|
+
}, [o.option.waterIndex]), N(() => {
|
|
1703
1793
|
t.fill = {
|
|
1704
1794
|
type: "image",
|
|
1705
|
-
url:
|
|
1795
|
+
url: o.option.waterSvg,
|
|
1706
1796
|
mode: "repeat",
|
|
1707
1797
|
format: "svg",
|
|
1708
|
-
size: Math.round(
|
|
1798
|
+
size: Math.round(o.option.frameConf.width / 6)
|
|
1709
1799
|
};
|
|
1710
|
-
}, [
|
|
1800
|
+
}, [o.option.waterSvg, o.option.frameConf.width]), N(() => (i.add(t), () => {
|
|
1711
1801
|
t.remove();
|
|
1712
1802
|
}), []), null;
|
|
1713
|
-
}),
|
|
1714
|
-
const
|
|
1715
|
-
const x = { id: n, x: l, y:
|
|
1716
|
-
return t === "SquareFill" ? new
|
|
1803
|
+
}), as = ({ parent: i, type: t, id: n, width: s, height: a, x: l, y: h, fill: f, strokeWidth: d, zIndex: p, points: m, editable: b, text: C }) => {
|
|
1804
|
+
const A = le(() => {
|
|
1805
|
+
const x = { id: n, x: l, y: h, zIndex: p };
|
|
1806
|
+
return t === "SquareFill" ? new ae({
|
|
1717
1807
|
cornerRadius: 8,
|
|
1718
1808
|
width: s,
|
|
1719
1809
|
height: a,
|
|
1720
1810
|
fill: f,
|
|
1721
1811
|
...x
|
|
1722
|
-
}) : t === "Circle" ? new
|
|
1812
|
+
}) : t === "Circle" ? new ht({
|
|
1723
1813
|
stroke: f,
|
|
1724
|
-
strokeWidth:
|
|
1814
|
+
strokeWidth: d,
|
|
1725
1815
|
width: s,
|
|
1726
1816
|
height: a,
|
|
1727
1817
|
...x
|
|
1728
|
-
}) : t === "Slash" ? new
|
|
1818
|
+
}) : t === "Slash" ? new pt({
|
|
1729
1819
|
id: n,
|
|
1730
|
-
points:
|
|
1731
|
-
zIndex:
|
|
1820
|
+
points: m,
|
|
1821
|
+
zIndex: p,
|
|
1732
1822
|
stroke: f,
|
|
1733
|
-
strokeWidth:
|
|
1734
|
-
}) : t === "MoveDownLeft" ? new
|
|
1823
|
+
strokeWidth: d
|
|
1824
|
+
}) : t === "MoveDownLeft" ? new ki({
|
|
1735
1825
|
id: n,
|
|
1736
|
-
points:
|
|
1737
|
-
zIndex:
|
|
1826
|
+
points: m,
|
|
1827
|
+
zIndex: p,
|
|
1738
1828
|
strokeCap: "round",
|
|
1739
1829
|
strokeJoin: "round",
|
|
1740
1830
|
stroke: f,
|
|
1741
|
-
strokeWidth:
|
|
1742
|
-
}) : t === "Pencil" ? new
|
|
1831
|
+
strokeWidth: d
|
|
1832
|
+
}) : t === "Pencil" ? new pt({
|
|
1743
1833
|
id: n,
|
|
1744
|
-
points:
|
|
1745
|
-
zIndex:
|
|
1834
|
+
points: m,
|
|
1835
|
+
zIndex: p,
|
|
1746
1836
|
curve: !0,
|
|
1747
1837
|
stroke: f,
|
|
1748
|
-
strokeWidth:
|
|
1749
|
-
}) : t === "
|
|
1838
|
+
strokeWidth: d
|
|
1839
|
+
}) : t === "Step" ? new ht({
|
|
1840
|
+
...x,
|
|
1841
|
+
width: 32,
|
|
1842
|
+
height: 32,
|
|
1843
|
+
stroke: "#ffffff90",
|
|
1844
|
+
strokeWidth: 2,
|
|
1845
|
+
strokeAlign: "outside",
|
|
1846
|
+
lockRatio: !0,
|
|
1847
|
+
shadow: {
|
|
1848
|
+
x: 1,
|
|
1849
|
+
y: 1,
|
|
1850
|
+
blur: 2,
|
|
1851
|
+
color: "#00000045",
|
|
1852
|
+
box: !0
|
|
1853
|
+
},
|
|
1854
|
+
fill: [
|
|
1855
|
+
{
|
|
1856
|
+
type: "solid",
|
|
1857
|
+
color: f
|
|
1858
|
+
},
|
|
1859
|
+
{
|
|
1860
|
+
type: "image",
|
|
1861
|
+
url: Zi(C),
|
|
1862
|
+
format: "svg",
|
|
1863
|
+
align: "center"
|
|
1864
|
+
}
|
|
1865
|
+
]
|
|
1866
|
+
}) : t === "emoji" ? new xi({
|
|
1750
1867
|
id: n,
|
|
1751
|
-
zIndex:
|
|
1752
|
-
text:
|
|
1868
|
+
zIndex: p,
|
|
1869
|
+
text: C,
|
|
1753
1870
|
resizeFontSize: !0,
|
|
1754
1871
|
fontSize: 48
|
|
1755
|
-
}) : new
|
|
1872
|
+
}) : new ae({
|
|
1756
1873
|
cornerRadius: 8,
|
|
1757
1874
|
stroke: f,
|
|
1758
|
-
strokeWidth:
|
|
1875
|
+
strokeWidth: d,
|
|
1759
1876
|
width: s,
|
|
1760
1877
|
height: a,
|
|
1761
1878
|
...x
|
|
1762
1879
|
});
|
|
1763
|
-
}, [
|
|
1764
|
-
return
|
|
1765
|
-
["Slash", "MoveDownLeft", "Pencil"].includes(t) ?
|
|
1766
|
-
}, [l,
|
|
1767
|
-
|
|
1768
|
-
}, [
|
|
1769
|
-
|
|
1770
|
-
}), [
|
|
1771
|
-
},
|
|
1772
|
-
const
|
|
1880
|
+
}, [i]);
|
|
1881
|
+
return N(() => {
|
|
1882
|
+
["Slash", "MoveDownLeft", "Pencil"].includes(t) ? A.points = m : t === "Step" || (A.x = l, A.y = h, A.width = s, A.height = a);
|
|
1883
|
+
}, [l, h, s, a]), N(() => {
|
|
1884
|
+
A.editable = !!b;
|
|
1885
|
+
}, [b]), N(() => (i.add(A), () => {
|
|
1886
|
+
A.remove();
|
|
1887
|
+
}), [i]), null;
|
|
1888
|
+
}, ls = B(() => (N(() => {
|
|
1889
|
+
const i = (s) => {
|
|
1773
1890
|
var l;
|
|
1774
|
-
const { list: a } = (l =
|
|
1891
|
+
const { list: a } = (l = o.editor.app) == null ? void 0 : l.editor;
|
|
1775
1892
|
if (a != null && a.length) {
|
|
1776
|
-
for (let
|
|
1777
|
-
|
|
1778
|
-
|
|
1893
|
+
for (let h of a)
|
|
1894
|
+
h.remove(), o.editor.removeShape(h);
|
|
1895
|
+
o.editor.app.editor.cancel();
|
|
1779
1896
|
}
|
|
1780
1897
|
}, t = (s) => {
|
|
1781
1898
|
var a, l;
|
|
1782
|
-
s === "fit" ? (a =
|
|
1783
|
-
}, n =
|
|
1784
|
-
Backspace:
|
|
1785
|
-
Delete:
|
|
1899
|
+
s === "fit" ? (a = o.editor.app) == null || a.tree.zoom(s, 100) : (l = o.editor.app) == null || l.tree.zoom(s), o.editor.setScale(o.editor.app.tree.scale);
|
|
1900
|
+
}, n = Rt(window, {
|
|
1901
|
+
Backspace: i,
|
|
1902
|
+
Delete: i,
|
|
1786
1903
|
"$mod+Minus": (s) => {
|
|
1787
1904
|
s.preventDefault(), t("out");
|
|
1788
1905
|
},
|
|
@@ -1797,12 +1914,12 @@ const Zr = /* @__PURE__ */ vo(Wr), Gr = "data:image/png;base64,iVBORw0KGgoAAAANS
|
|
|
1797
1914
|
n();
|
|
1798
1915
|
};
|
|
1799
1916
|
}, [window]), null));
|
|
1800
|
-
|
|
1801
|
-
const
|
|
1917
|
+
bi.set("pencil", { url: es });
|
|
1918
|
+
const cs = B(({ target: i }) => {
|
|
1802
1919
|
var t, n;
|
|
1803
|
-
return
|
|
1804
|
-
const s = new
|
|
1805
|
-
view:
|
|
1920
|
+
return N(() => {
|
|
1921
|
+
const s = new wi({
|
|
1922
|
+
view: i,
|
|
1806
1923
|
editor: {
|
|
1807
1924
|
lockRatio: "corner",
|
|
1808
1925
|
stroke: "#3f99f7",
|
|
@@ -1814,7 +1931,7 @@ const Qr = Y(({ target: o }) => {
|
|
|
1814
1931
|
height: 20,
|
|
1815
1932
|
fill: {
|
|
1816
1933
|
type: "image",
|
|
1817
|
-
url:
|
|
1934
|
+
url: Ko
|
|
1818
1935
|
}
|
|
1819
1936
|
}
|
|
1820
1937
|
},
|
|
@@ -1826,65 +1943,75 @@ const Qr = Y(({ target: o }) => {
|
|
|
1826
1943
|
usePartRender: !0
|
|
1827
1944
|
}
|
|
1828
1945
|
});
|
|
1829
|
-
new
|
|
1830
|
-
|
|
1831
|
-
}), s.tree.on(
|
|
1832
|
-
|
|
1946
|
+
new Ai(s), o.editor.setApp(s), s.tree.on(yi.ZOOM, () => {
|
|
1947
|
+
o.editor.setScale(s.tree.scale);
|
|
1948
|
+
}), s.tree.on(vi.RESIZE, () => {
|
|
1949
|
+
o.editor.setScale(s.tree.scale);
|
|
1833
1950
|
});
|
|
1834
1951
|
let a = null;
|
|
1835
|
-
|
|
1836
|
-
if (!
|
|
1837
|
-
const { target:
|
|
1838
|
-
if (
|
|
1839
|
-
a =
|
|
1840
|
-
const
|
|
1952
|
+
const l = (f) => {
|
|
1953
|
+
if (!o.editor.useTool) return;
|
|
1954
|
+
const { target: d } = f;
|
|
1955
|
+
if (o.editor.getShape(d.id)) return;
|
|
1956
|
+
a = ge();
|
|
1957
|
+
const m = f.getPageBounds ? f.getPageBounds() : f.getPage(), b = o.editor.useTool;
|
|
1958
|
+
return {
|
|
1841
1959
|
id: a,
|
|
1842
|
-
type:
|
|
1843
|
-
fill:
|
|
1844
|
-
strokeWidth:
|
|
1845
|
-
zIndex:
|
|
1846
|
-
...
|
|
1960
|
+
type: b,
|
|
1961
|
+
fill: o.editor.annotateColor,
|
|
1962
|
+
strokeWidth: o.editor.strokeWidth,
|
|
1963
|
+
zIndex: o.editor.shapes.size + 1,
|
|
1964
|
+
...m
|
|
1847
1965
|
};
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
if (
|
|
1851
|
-
const
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1966
|
+
};
|
|
1967
|
+
s.tree.on(ji.DOWN, (f) => {
|
|
1968
|
+
if (o.editor.useTool !== "Step") return;
|
|
1969
|
+
const p = l(f);
|
|
1970
|
+
p && (p.text = o.editor.nextStep, p.editable = !0, o.editor.addShape(p), a = null, o.editor.setUseTool(null));
|
|
1971
|
+
}), s.tree.on(De.START, (f) => {
|
|
1972
|
+
const d = o.editor.useTool;
|
|
1973
|
+
if (d === "Step") return;
|
|
1974
|
+
const p = l(f);
|
|
1975
|
+
p && (["Slash", "MoveDownLeft", "Pencil"].includes(d) && (p.points = [p.x, p.y]), o.editor.addShape(p));
|
|
1976
|
+
}), s.tree.on(De.DRAG, (f) => {
|
|
1977
|
+
if (!o.editor.useTool || !a) return;
|
|
1978
|
+
const d = o.editor.getShape(a);
|
|
1979
|
+
if (!d) return;
|
|
1980
|
+
const p = f.getPageBounds(), m = Object.assign({}, d, p), { points: b, type: C } = m;
|
|
1981
|
+
if (b && b.length) {
|
|
1982
|
+
const { x: A, y: x } = f.getInnerTotal(), w = A > 0 ? p.x + A : p.x, S = x > 0 ? p.y + x : p.y;
|
|
1983
|
+
C === "Pencil" ? m.points = [...b, w, S] : m.points = [b[0], b[1], w, S];
|
|
1857
1984
|
}
|
|
1858
|
-
|
|
1859
|
-
}), s.tree.on(
|
|
1860
|
-
if (!
|
|
1861
|
-
const
|
|
1862
|
-
|
|
1985
|
+
o.editor.addShape(m);
|
|
1986
|
+
}), s.tree.on(De.END, () => {
|
|
1987
|
+
if (!o.editor.useTool || !a) return;
|
|
1988
|
+
const f = o.editor.getShape(a);
|
|
1989
|
+
f && ((f.width === 0 || f.height === 0) && !["Slash", "MoveDownLeft", "Pencil"].includes(f.type) ? o.editor.removeShape(f) : o.editor.addShape(Object.assign({}, f, { editable: !0 }))), a = null, o.editor.useTool !== "Pencil" && o.editor.setUseTool(null);
|
|
1863
1990
|
});
|
|
1864
|
-
const
|
|
1865
|
-
const { width:
|
|
1866
|
-
s.tree.zoom("fit", 100),
|
|
1991
|
+
const h = $o(() => {
|
|
1992
|
+
const { width: f, height: d } = i.getBoundingClientRect();
|
|
1993
|
+
s.tree.zoom("fit", 100), o.option.frameConf.width < f && o.option.frameConf.height < d && s.tree.zoom(1);
|
|
1867
1994
|
}, 10);
|
|
1868
|
-
return
|
|
1869
|
-
|
|
1995
|
+
return Mi(i, h), () => {
|
|
1996
|
+
Ci(i, h), o.editor.destroy();
|
|
1870
1997
|
};
|
|
1871
|
-
}, [
|
|
1998
|
+
}, [i]), N(() => {
|
|
1872
1999
|
const s = setTimeout(() => {
|
|
1873
|
-
const { width: a, height: l } =
|
|
1874
|
-
|
|
2000
|
+
const { width: a, height: l } = i.getBoundingClientRect();
|
|
2001
|
+
o.editor.app.tree.zoom("fit", 100), o.option.frameConf.width < a && o.option.frameConf.height < l && o.editor.app.tree.zoom(1), o.editor.setScale(o.editor.app.tree.scale);
|
|
1875
2002
|
}, 20);
|
|
1876
2003
|
return () => {
|
|
1877
2004
|
clearTimeout(s);
|
|
1878
2005
|
};
|
|
1879
|
-
}, [
|
|
1880
|
-
/* @__PURE__ */ e.jsxs(
|
|
1881
|
-
|
|
1882
|
-
((n =
|
|
1883
|
-
|
|
2006
|
+
}, [o.option.frameConf.width, o.option.frameConf.height]), (t = o.editor.app) != null && t.tree ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2007
|
+
/* @__PURE__ */ e.jsxs(rs, { parent: o.editor.app.tree, cursor: o.editor.cursor, ...o.option.frameConf, children: [
|
|
2008
|
+
o.editor.shapesList.map((s) => /* @__PURE__ */ e.jsx(as, { ...s }, s.id)),
|
|
2009
|
+
((n = o.editor.img) == null ? void 0 : n.src) && /* @__PURE__ */ e.jsx(ss, {}),
|
|
2010
|
+
o.option.waterImg && /* @__PURE__ */ e.jsx(ns, {})
|
|
1884
2011
|
] }),
|
|
1885
|
-
/* @__PURE__ */ e.jsx(
|
|
2012
|
+
/* @__PURE__ */ e.jsx(ls, {})
|
|
1886
2013
|
] }) : null;
|
|
1887
|
-
}),
|
|
2014
|
+
}), ds = [
|
|
1888
2015
|
{
|
|
1889
2016
|
key: 0.5,
|
|
1890
2017
|
label: "50%"
|
|
@@ -1901,33 +2028,33 @@ const Qr = Y(({ target: o }) => {
|
|
|
1901
2028
|
key: 2,
|
|
1902
2029
|
label: "200%"
|
|
1903
2030
|
}
|
|
1904
|
-
],
|
|
1905
|
-
const
|
|
2031
|
+
], fs = B(() => {
|
|
2032
|
+
const i = (n) => {
|
|
1906
2033
|
var s;
|
|
1907
|
-
(s =
|
|
2034
|
+
(s = o.editor.app) == null || s.tree.zoom(n), o.editor.setScale(o.editor.app.tree.scale);
|
|
1908
2035
|
}, t = (n) => {
|
|
1909
2036
|
var a, l;
|
|
1910
2037
|
const s = Number(n.key);
|
|
1911
|
-
s === 4 ? (a =
|
|
2038
|
+
s === 4 ? (a = o.editor.app) == null || a.tree.zoom("fit", 100) : (l = o.editor.app) == null || l.tree.zoom(s), o.editor.setScale(o.editor.app.tree.scale);
|
|
1912
2039
|
};
|
|
1913
2040
|
return /* @__PURE__ */ e.jsxs("div", { className: "absolute z-10 bottom-4 gap-2 right-4 flex items-center ", children: [
|
|
1914
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex bg-white overflow-hidden rounded-full shadow-md", children: [
|
|
1915
|
-
/* @__PURE__ */ e.jsx(
|
|
1916
|
-
/* @__PURE__ */ e.jsx(
|
|
1917
|
-
|
|
2041
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex bg-white dark:bg-black overflow-hidden rounded-full shadow-md", children: [
|
|
2042
|
+
/* @__PURE__ */ e.jsx(k, { type: "text", icon: /* @__PURE__ */ e.jsx(M.ZoomIn, { size: 16 }), onClick: () => i("in") }),
|
|
2043
|
+
/* @__PURE__ */ e.jsx(At, { menu: { items: ds, onClick: t }, placement: "top", children: /* @__PURE__ */ e.jsxs(k, { type: "text", children: [
|
|
2044
|
+
o.editor.scale,
|
|
1918
2045
|
"%"
|
|
1919
2046
|
] }) }),
|
|
1920
|
-
/* @__PURE__ */ e.jsx(
|
|
2047
|
+
/* @__PURE__ */ e.jsx(k, { type: "text", icon: /* @__PURE__ */ e.jsx(M.ZoomOut, { size: 16 }), onClick: () => i("out") })
|
|
1921
2048
|
] }),
|
|
1922
|
-
/* @__PURE__ */ e.jsx("div", { className: "rounded-full bg-white shadow-md overflow-hidden", children: /* @__PURE__ */ e.jsx(
|
|
2049
|
+
/* @__PURE__ */ e.jsx("div", { className: "rounded-full bg-white dark:bg-black shadow-md overflow-hidden", children: /* @__PURE__ */ e.jsx(k, { type: "text", icon: /* @__PURE__ */ e.jsx(M.Maximize, { size: 16 }), onClick: () => t({ key: 4 }) }) })
|
|
1923
2050
|
] });
|
|
1924
|
-
}),
|
|
1925
|
-
const [
|
|
2051
|
+
}), hs = B(() => {
|
|
2052
|
+
const [i, t] = O(null);
|
|
1926
2053
|
return /* @__PURE__ */ e.jsxs("div", { className: "md:w-0 md:flex-1 overflow-hidden select-none relative", children: [
|
|
1927
|
-
/* @__PURE__ */ e.jsx("div", { className: "w-full h-full relative z-0", ref: (n) => t(n), children:
|
|
1928
|
-
/* @__PURE__ */ e.jsx(
|
|
2054
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full h-full relative z-0", ref: (n) => t(n), children: i && /* @__PURE__ */ e.jsx(cs, { target: i }) }),
|
|
2055
|
+
/* @__PURE__ */ e.jsx(fs, {})
|
|
1929
2056
|
] });
|
|
1930
|
-
}),
|
|
2057
|
+
}), ps = [
|
|
1931
2058
|
{
|
|
1932
2059
|
key: "default",
|
|
1933
2060
|
title: "Default",
|
|
@@ -2089,32 +2216,32 @@ const Qr = Y(({ target: o }) => {
|
|
|
2089
2216
|
}
|
|
2090
2217
|
]
|
|
2091
2218
|
}
|
|
2092
|
-
],
|
|
2093
|
-
const [a, l] = O(""), [
|
|
2219
|
+
], us = ({ frameWidth: i, frameHeight: t, type: n, onSet: s }) => {
|
|
2220
|
+
const [a, l] = O(""), [h, f] = O(""), d = () => {
|
|
2094
2221
|
s({ type: "auto", title: "Auto" });
|
|
2095
|
-
},
|
|
2096
|
-
s({ type: "custom", title: "Custom", width: a, height:
|
|
2222
|
+
}, p = () => {
|
|
2223
|
+
s({ type: "custom", title: "Custom", width: a, height: h });
|
|
2097
2224
|
};
|
|
2098
|
-
return
|
|
2099
|
-
n === "custom" ? (l(
|
|
2225
|
+
return N(() => {
|
|
2226
|
+
n === "custom" ? (l(i), f(t)) : (l(""), f(""));
|
|
2100
2227
|
}, [n]), /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center py-2 font-normal", children: [
|
|
2101
2228
|
/* @__PURE__ */ e.jsx(
|
|
2102
|
-
|
|
2229
|
+
nt,
|
|
2103
2230
|
{
|
|
2104
2231
|
min: 1,
|
|
2105
2232
|
value: a,
|
|
2106
2233
|
onChange: l,
|
|
2107
|
-
placeholder:
|
|
2234
|
+
placeholder: i,
|
|
2108
2235
|
prefix: /* @__PURE__ */ e.jsx("span", { className: "opacity-60 mx-1", children: "W" }),
|
|
2109
2236
|
className: "flex-1"
|
|
2110
2237
|
}
|
|
2111
2238
|
),
|
|
2112
2239
|
/* @__PURE__ */ e.jsx("span", { className: "text-xs opacity-50", children: "x" }),
|
|
2113
2240
|
/* @__PURE__ */ e.jsx(
|
|
2114
|
-
|
|
2241
|
+
nt,
|
|
2115
2242
|
{
|
|
2116
2243
|
min: 1,
|
|
2117
|
-
value:
|
|
2244
|
+
value: h,
|
|
2118
2245
|
onChange: f,
|
|
2119
2246
|
placeholder: t,
|
|
2120
2247
|
prefix: /* @__PURE__ */ e.jsx("span", { className: "opacity-60 mx-1", children: "H" }),
|
|
@@ -2122,135 +2249,135 @@ const Qr = Y(({ target: o }) => {
|
|
|
2122
2249
|
}
|
|
2123
2250
|
),
|
|
2124
2251
|
/* @__PURE__ */ e.jsx(
|
|
2125
|
-
|
|
2252
|
+
k,
|
|
2126
2253
|
{
|
|
2127
2254
|
type: "primary",
|
|
2128
2255
|
shape: "circle",
|
|
2129
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2130
|
-
disabled: !a || !
|
|
2131
|
-
onClick:
|
|
2256
|
+
icon: /* @__PURE__ */ e.jsx(M.Check, { size: 18 }),
|
|
2257
|
+
disabled: !a || !h,
|
|
2258
|
+
onClick: p
|
|
2132
2259
|
}
|
|
2133
2260
|
),
|
|
2134
|
-
/* @__PURE__ */ e.jsx(
|
|
2135
|
-
|
|
2261
|
+
/* @__PURE__ */ e.jsx(L, { title: "Auto size", children: /* @__PURE__ */ e.jsx(
|
|
2262
|
+
k,
|
|
2136
2263
|
{
|
|
2137
2264
|
type: "primary",
|
|
2138
2265
|
shape: "circle",
|
|
2139
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2266
|
+
icon: /* @__PURE__ */ e.jsx(M.Maximize, { size: 18 }),
|
|
2140
2267
|
disabled: n === "auto",
|
|
2141
|
-
onClick:
|
|
2268
|
+
onClick: d
|
|
2142
2269
|
}
|
|
2143
2270
|
) })
|
|
2144
2271
|
] });
|
|
2145
|
-
},
|
|
2146
|
-
var
|
|
2147
|
-
const
|
|
2272
|
+
}, ms = B(() => {
|
|
2273
|
+
var A;
|
|
2274
|
+
const i = ne(null), [t, n] = O(!1), [s, a] = O(500), l = () => {
|
|
2148
2275
|
n(!1);
|
|
2149
|
-
},
|
|
2150
|
-
if (n(x), x &&
|
|
2151
|
-
const { height:
|
|
2276
|
+
}, h = (x) => {
|
|
2277
|
+
if (n(x), x && i.current) {
|
|
2278
|
+
const { height: w, y: S } = i.current.getBoundingClientRect(), _ = document.body.clientHeight - w - S - 80;
|
|
2152
2279
|
a(_);
|
|
2153
2280
|
}
|
|
2154
|
-
}, f = (x,
|
|
2155
|
-
if (l(), x.type === "auto" &&
|
|
2156
|
-
const
|
|
2157
|
-
|
|
2281
|
+
}, f = (x, w) => !(x !== o.option.size.type || w.height !== o.option.frameConf.height || w.width !== o.option.frameConf.width), d = (x) => {
|
|
2282
|
+
if (l(), x.type === "auto" && o.editor.img.width) {
|
|
2283
|
+
const w = we(o.editor.img.width, o.editor.img.height);
|
|
2284
|
+
o.option.setSize({ ...x, width: o.editor.img.width + w, height: o.editor.img.height + w });
|
|
2158
2285
|
return;
|
|
2159
2286
|
}
|
|
2160
|
-
|
|
2161
|
-
},
|
|
2162
|
-
l(),
|
|
2287
|
+
o.option.setSize(x);
|
|
2288
|
+
}, p = (x, w, S) => {
|
|
2289
|
+
l(), o.option.setSize({
|
|
2163
2290
|
type: x,
|
|
2164
|
-
title: `${
|
|
2165
|
-
width:
|
|
2166
|
-
height:
|
|
2291
|
+
title: `${w}${S.title ? ` ${S.title} ` : " "}${S.w} : ${S.h}`,
|
|
2292
|
+
width: S.width,
|
|
2293
|
+
height: S.height
|
|
2167
2294
|
});
|
|
2168
|
-
},
|
|
2295
|
+
}, m = ((A = o.editor.img) == null ? void 0 : A.src) || o.option.size.type !== "auto", b = /* @__PURE__ */ e.jsx(us, { type: o.option.size.type, frameWidth: o.option.frameConf.width, frameHeight: o.option.frameConf.height, onSet: d }), C = /* @__PURE__ */ e.jsx("div", { className: "border-t border-gray-200 dark:border-gray-800 py-2 divide-y dark:divide-gray-700", "data-mode": o.editor.isDark ? "dark" : "light", children: ps.map((x) => /* @__PURE__ */ e.jsxs("div", { children: [
|
|
2169
2296
|
x.key !== "default" && /* @__PURE__ */ e.jsx("div", { className: "font-semibold pt-2", children: x.title }),
|
|
2170
|
-
/* @__PURE__ */ e.jsx("section", { className: "flex flex-wrap items-end pb-2", children: x.lists.map((
|
|
2171
|
-
|
|
2297
|
+
/* @__PURE__ */ e.jsx("section", { className: "flex flex-wrap items-end pb-2", children: x.lists.map((w, S) => /* @__PURE__ */ e.jsxs(
|
|
2298
|
+
k,
|
|
2172
2299
|
{
|
|
2173
2300
|
type: "text",
|
|
2174
2301
|
className: "flex-[33%] p-3 h-auto flex-col gap-0 disabled:bg-blue-500/5 disabled:border-blue-500 disabled:cursor-default disabled:text-black",
|
|
2175
|
-
disabled: f(x.key,
|
|
2176
|
-
onClick: () =>
|
|
2302
|
+
disabled: f(x.key, w),
|
|
2303
|
+
onClick: () => p(x.key, x.title, w),
|
|
2177
2304
|
children: [
|
|
2178
2305
|
/* @__PURE__ */ e.jsx("div", { className: "py-2 px-3 w-full", children: /* @__PURE__ */ e.jsx(
|
|
2179
2306
|
"div",
|
|
2180
2307
|
{
|
|
2181
|
-
className: "border border-black/50 bg-black/10 w-full flex items-center justify-center rounded-md opacity-75",
|
|
2182
|
-
style: { aspectRatio:
|
|
2308
|
+
className: "border border-black/50 bg-black/10 dark:bg-white/20 dark:border-white/40 w-full flex items-center justify-center rounded-md opacity-75",
|
|
2309
|
+
style: { aspectRatio: w.w / w.h },
|
|
2183
2310
|
children: /* @__PURE__ */ e.jsxs("span", { children: [
|
|
2184
|
-
|
|
2311
|
+
w.w,
|
|
2185
2312
|
" : ",
|
|
2186
|
-
|
|
2313
|
+
w.h
|
|
2187
2314
|
] })
|
|
2188
2315
|
}
|
|
2189
2316
|
) }),
|
|
2190
|
-
|
|
2317
|
+
w.title && /* @__PURE__ */ e.jsx("div", { className: "text-xs", children: w.title }),
|
|
2191
2318
|
/* @__PURE__ */ e.jsxs("div", { className: "text-xs overflow-hidden text-gray-500", children: [
|
|
2192
|
-
|
|
2319
|
+
w.width,
|
|
2193
2320
|
" x ",
|
|
2194
|
-
|
|
2321
|
+
w.height
|
|
2195
2322
|
] })
|
|
2196
2323
|
]
|
|
2197
2324
|
},
|
|
2198
|
-
|
|
2325
|
+
S
|
|
2199
2326
|
)) })
|
|
2200
2327
|
] }, x.key)) });
|
|
2201
2328
|
return /* @__PURE__ */ e.jsx(
|
|
2202
|
-
|
|
2329
|
+
xe,
|
|
2203
2330
|
{
|
|
2204
|
-
content:
|
|
2205
|
-
title:
|
|
2331
|
+
content: C,
|
|
2332
|
+
title: b,
|
|
2206
2333
|
trigger: "click",
|
|
2207
2334
|
arrow: !1,
|
|
2208
2335
|
placement: "bottomRight",
|
|
2209
2336
|
open: t,
|
|
2210
|
-
overlayClassName: "[&_.ant-popover-inner]:h-full [&_.ant-popover-inner]:overflow-x-hidden [&_.ant-popover-inner]:overflow-y-auto [&_.ant-popover-content]:h-full",
|
|
2337
|
+
overlayClassName: Z("shoteasy-components [&_.ant-popover-inner]:h-full [&_.ant-popover-inner]:overflow-x-hidden [&_.ant-popover-inner]:overflow-y-auto [&_.ant-popover-content]:h-full", o.editor.isDark && "dark-mode"),
|
|
2211
2338
|
overlayStyle: {
|
|
2212
2339
|
width: "400px",
|
|
2213
2340
|
height: `${s}px`
|
|
2214
2341
|
},
|
|
2215
|
-
onOpenChange:
|
|
2216
|
-
children: /* @__PURE__ */ e.jsxs("div", { className:
|
|
2342
|
+
onOpenChange: h,
|
|
2343
|
+
children: /* @__PURE__ */ e.jsxs("div", { className: Z("px-3 py-1.5 border shrink-0 border-gray-200 dark:border-gray-700 gap-3 shadow-sm overflow-hidden max-h-12 rounded-md hover:border-blue-500 [&_svg]:hover:text-blue-500 cursor-pointer flex items-center", t && "shadow-md"), ref: i, children: [
|
|
2217
2344
|
/* @__PURE__ */ e.jsx(
|
|
2218
2345
|
"div",
|
|
2219
2346
|
{
|
|
2220
|
-
className: "border border-black/50 bg-black/10 w-4 rounded-sm",
|
|
2221
|
-
style: { aspectRatio:
|
|
2347
|
+
className: "border border-black/50 bg-black/10 dark:bg-white/20 dark:border-white/40 w-4 rounded-sm",
|
|
2348
|
+
style: { aspectRatio: o.option.frameConf.width / o.option.frameConf.height }
|
|
2222
2349
|
}
|
|
2223
2350
|
),
|
|
2224
2351
|
/* @__PURE__ */ e.jsxs("div", { className: "text-xs", children: [
|
|
2225
|
-
/* @__PURE__ */ e.jsx("div", { className: "font-semibold leading-3 mb-0.5", children:
|
|
2226
|
-
|
|
2227
|
-
|
|
2352
|
+
/* @__PURE__ */ e.jsx("div", { className: "font-semibold leading-3 mb-0.5", children: o.option.size.title }),
|
|
2353
|
+
m ? /* @__PURE__ */ e.jsxs("div", { className: "text-gray-500 leading-3", children: [
|
|
2354
|
+
o.option.frameConf.width,
|
|
2228
2355
|
" x ",
|
|
2229
|
-
|
|
2356
|
+
o.option.frameConf.height,
|
|
2230
2357
|
" px"
|
|
2231
2358
|
] }) : /* @__PURE__ */ e.jsx("div", { className: "text-gray-500 leading-3", children: "Adaptive screenshot size" })
|
|
2232
2359
|
] }),
|
|
2233
2360
|
/* @__PURE__ */ e.jsx("div", { className: "flex-1" }),
|
|
2234
|
-
t ? /* @__PURE__ */ e.jsx(
|
|
2361
|
+
t ? /* @__PURE__ */ e.jsx(M.ChevronUp, { size: 16 }) : /* @__PURE__ */ e.jsx(M.ChevronDown, { size: 16 })
|
|
2235
2362
|
] })
|
|
2236
2363
|
}
|
|
2237
2364
|
);
|
|
2238
|
-
}),
|
|
2239
|
-
const
|
|
2365
|
+
}), gs = B(() => {
|
|
2366
|
+
const i = ne(null), [t, n] = O(!1), s = () => {
|
|
2240
2367
|
n(!0);
|
|
2241
2368
|
}, a = () => {
|
|
2242
|
-
var
|
|
2243
|
-
if (typeof ((
|
|
2244
|
-
const
|
|
2245
|
-
if (
|
|
2246
|
-
const { width:
|
|
2247
|
-
if (
|
|
2248
|
-
src:
|
|
2249
|
-
width:
|
|
2250
|
-
height:
|
|
2251
|
-
})),
|
|
2252
|
-
const
|
|
2253
|
-
|
|
2369
|
+
var h, f;
|
|
2370
|
+
if (typeof ((h = i.current) == null ? void 0 : h.cropper) < "u") {
|
|
2371
|
+
const d = (f = i.current) == null ? void 0 : f.cropper.getCroppedCanvas();
|
|
2372
|
+
if (d) {
|
|
2373
|
+
const { width: p, height: m } = d, b = d.toDataURL();
|
|
2374
|
+
if (o.editor.setImg(Object.assign({}, o.editor.img, {
|
|
2375
|
+
src: b,
|
|
2376
|
+
width: p,
|
|
2377
|
+
height: m
|
|
2378
|
+
})), o.option.size.type === "auto") {
|
|
2379
|
+
const C = we(p, m);
|
|
2380
|
+
o.option.setFrameSize(p + C, m + C);
|
|
2254
2381
|
}
|
|
2255
2382
|
}
|
|
2256
2383
|
}
|
|
@@ -2259,17 +2386,17 @@ const Qr = Y(({ target: o }) => {
|
|
|
2259
2386
|
n(!1);
|
|
2260
2387
|
};
|
|
2261
2388
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2262
|
-
/* @__PURE__ */ e.jsx(
|
|
2263
|
-
|
|
2389
|
+
/* @__PURE__ */ e.jsx(L, { title: "Crop Image", children: /* @__PURE__ */ e.jsx(
|
|
2390
|
+
k,
|
|
2264
2391
|
{
|
|
2265
2392
|
type: "text",
|
|
2266
2393
|
shape: "circle",
|
|
2267
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2394
|
+
icon: /* @__PURE__ */ e.jsx(M.Crop, { size: 18 }),
|
|
2268
2395
|
onClick: s
|
|
2269
2396
|
}
|
|
2270
2397
|
) }),
|
|
2271
2398
|
/* @__PURE__ */ e.jsx(
|
|
2272
|
-
|
|
2399
|
+
gr,
|
|
2273
2400
|
{
|
|
2274
2401
|
title: "Cropper",
|
|
2275
2402
|
open: t,
|
|
@@ -2277,13 +2404,13 @@ const Qr = Y(({ target: o }) => {
|
|
|
2277
2404
|
onCancel: l,
|
|
2278
2405
|
destroyOnClose: !0,
|
|
2279
2406
|
children: /* @__PURE__ */ e.jsx(
|
|
2280
|
-
|
|
2407
|
+
Ti,
|
|
2281
2408
|
{
|
|
2282
|
-
ref:
|
|
2409
|
+
ref: i,
|
|
2283
2410
|
style: { height: 400, width: "100%" },
|
|
2284
2411
|
zoomTo: 0.5,
|
|
2285
|
-
initialAspectRatio:
|
|
2286
|
-
src:
|
|
2412
|
+
initialAspectRatio: o.editor.img.width / o.editor.img.height,
|
|
2413
|
+
src: o.editor.img.src,
|
|
2287
2414
|
dragMode: "move",
|
|
2288
2415
|
viewMode: 1,
|
|
2289
2416
|
minCropBoxHeight: 10,
|
|
@@ -2298,82 +2425,83 @@ const Qr = Y(({ target: o }) => {
|
|
|
2298
2425
|
}
|
|
2299
2426
|
)
|
|
2300
2427
|
] });
|
|
2301
|
-
}),
|
|
2302
|
-
const [
|
|
2428
|
+
}), xs = ["top-left", "top", "top-right", "left", "center", "right", "bottom-left", "bottom", "bottom-right"], bs = B(() => {
|
|
2429
|
+
const [i, t] = O(!1), n = (l) => {
|
|
2303
2430
|
t(l);
|
|
2304
2431
|
}, s = (l) => {
|
|
2305
|
-
|
|
2306
|
-
}, a = /* @__PURE__ */ e.jsx("div", { className:
|
|
2432
|
+
o.option.setAlign(l);
|
|
2433
|
+
}, a = /* @__PURE__ */ e.jsx("div", { className: Z("flex flex-wrap w-24 position-block", o.option.align), children: xs.map((l) => /* @__PURE__ */ e.jsx("div", { className: "w-8 h-8 border border-[var(--c-br)] rounded-sm hover:bg-[var(--c-wb)] cursor-pointer", onClick: () => s(l) }, l)) });
|
|
2307
2434
|
return /* @__PURE__ */ e.jsx(
|
|
2308
|
-
|
|
2435
|
+
xe,
|
|
2309
2436
|
{
|
|
2310
2437
|
content: a,
|
|
2311
2438
|
trigger: "click",
|
|
2312
2439
|
arrow: !1,
|
|
2313
2440
|
placement: "bottomRight",
|
|
2314
|
-
|
|
2441
|
+
overlayClassName: Z("shoteasy-components", o.editor.isDark && "dark-mode"),
|
|
2442
|
+
open: i,
|
|
2315
2443
|
onOpenChange: n,
|
|
2316
2444
|
children: /* @__PURE__ */ e.jsx(
|
|
2317
|
-
|
|
2445
|
+
k,
|
|
2318
2446
|
{
|
|
2319
2447
|
type: "text",
|
|
2320
2448
|
shape: "circle",
|
|
2321
|
-
className:
|
|
2322
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2449
|
+
className: Z(i && "shadow-md"),
|
|
2450
|
+
icon: /* @__PURE__ */ e.jsx(M.LayoutGrid, { size: 18 })
|
|
2323
2451
|
}
|
|
2324
2452
|
)
|
|
2325
2453
|
}
|
|
2326
2454
|
);
|
|
2327
|
-
}),
|
|
2328
|
-
const [
|
|
2329
|
-
l(typeof
|
|
2455
|
+
}), ws = B(() => {
|
|
2456
|
+
const [i, t] = O(!1), [n, s] = O("ShotEasy"), [a, l] = O("#00000030"), [h, f] = O(45), d = (p) => {
|
|
2457
|
+
l(typeof p == "string" ? p : p.toRgbString());
|
|
2330
2458
|
};
|
|
2331
|
-
return
|
|
2332
|
-
if (
|
|
2333
|
-
const
|
|
2459
|
+
return N(() => {
|
|
2460
|
+
if (i && n.trim()) {
|
|
2461
|
+
const p = Wi({
|
|
2334
2462
|
text: n,
|
|
2335
2463
|
color: a,
|
|
2336
|
-
angleDegrees:
|
|
2464
|
+
angleDegrees: h
|
|
2337
2465
|
});
|
|
2338
|
-
|
|
2466
|
+
o.option.setWaterImg(p);
|
|
2339
2467
|
} else
|
|
2340
|
-
|
|
2341
|
-
}, [
|
|
2468
|
+
o.option.setWaterImg(null);
|
|
2469
|
+
}, [i, n, a, h]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2342
2470
|
/* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold [&_label]:text-sm flex gap-4 items-center justify-between", children: [
|
|
2343
2471
|
/* @__PURE__ */ e.jsx("label", { children: "Watermark" }),
|
|
2344
|
-
/* @__PURE__ */ e.jsx(
|
|
2472
|
+
/* @__PURE__ */ e.jsx(at, { defaultChecked: i, onChange: t, size: "small", className: "bg-slate-200" })
|
|
2345
2473
|
] }),
|
|
2346
|
-
|
|
2347
|
-
/* @__PURE__ */ e.jsx(
|
|
2474
|
+
i && /* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold [&_label]:text-xs grid gap-3 pl-2 pt-2", children: [
|
|
2475
|
+
/* @__PURE__ */ e.jsx(xr, { defaultValue: n, placeholder: "Watermark content", onChange: (p) => s(p.target.value) }),
|
|
2348
2476
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
2349
2477
|
/* @__PURE__ */ e.jsx("label", { children: "Color" }),
|
|
2350
|
-
/* @__PURE__ */ e.jsx(
|
|
2478
|
+
/* @__PURE__ */ e.jsx(be, { value: a, onChange: d, size: "small" })
|
|
2351
2479
|
] }),
|
|
2352
2480
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
2353
2481
|
/* @__PURE__ */ e.jsx("label", { children: "Direction" }),
|
|
2354
|
-
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs(
|
|
2355
|
-
/* @__PURE__ */ e.jsx(
|
|
2356
|
-
/* @__PURE__ */ e.jsx(
|
|
2482
|
+
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs(P.Group, { defaultValue: h, onChange: (p) => f(p.target.value), size: "small", children: [
|
|
2483
|
+
/* @__PURE__ */ e.jsx(P.Button, { value: -45, children: /* @__PURE__ */ e.jsx(M.ArrowUpRight, { size: 16, className: "mt-[3px]" }) }),
|
|
2484
|
+
/* @__PURE__ */ e.jsx(P.Button, { value: 45, children: /* @__PURE__ */ e.jsx(M.ArrowDownRight, { size: 16, className: "mt-[3px]" }) })
|
|
2357
2485
|
] }) })
|
|
2358
2486
|
] }),
|
|
2359
2487
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
2360
2488
|
/* @__PURE__ */ e.jsx("label", { children: "Only Background" }),
|
|
2361
|
-
/* @__PURE__ */ e.jsx(
|
|
2489
|
+
/* @__PURE__ */ e.jsx(at, { size: "small", onChange: (p) => o.option.setWaterIndex(p ? -1 : 1), className: "bg-slate-200" })
|
|
2362
2490
|
] })
|
|
2363
2491
|
] })
|
|
2364
2492
|
] });
|
|
2365
2493
|
});
|
|
2366
|
-
function
|
|
2367
|
-
const s =
|
|
2368
|
-
|
|
2369
|
-
s.current =
|
|
2370
|
-
}, [...n]),
|
|
2371
|
-
const l =
|
|
2372
|
-
"$mod+KeyS": (
|
|
2373
|
-
|
|
2494
|
+
function ys(i, t, n) {
|
|
2495
|
+
const s = ne(i), a = ne(t);
|
|
2496
|
+
N(() => {
|
|
2497
|
+
s.current = i, a.current = t;
|
|
2498
|
+
}, [...n]), N(() => {
|
|
2499
|
+
const l = Rt(window, {
|
|
2500
|
+
"$mod+KeyS": (h) => {
|
|
2501
|
+
h.preventDefault(), s.current && s.current();
|
|
2374
2502
|
},
|
|
2375
|
-
"$mod+KeyC": (
|
|
2376
|
-
|
|
2503
|
+
"$mod+KeyC": (h) => {
|
|
2504
|
+
h.preventDefault(), a && a.current();
|
|
2377
2505
|
}
|
|
2378
2506
|
});
|
|
2379
2507
|
return () => {
|
|
@@ -2381,68 +2509,68 @@ function ls(o, t, n) {
|
|
|
2381
2509
|
};
|
|
2382
2510
|
}, [window]);
|
|
2383
2511
|
}
|
|
2384
|
-
const
|
|
2385
|
-
var
|
|
2386
|
-
const [
|
|
2512
|
+
const vs = B(() => {
|
|
2513
|
+
var A;
|
|
2514
|
+
const [i, t] = O(!1), [n, s] = O(!1), [a, l] = O("png"), [h, f] = O(1), d = (x) => {
|
|
2387
2515
|
s(x);
|
|
2388
|
-
},
|
|
2389
|
-
if (!
|
|
2516
|
+
}, p = async () => {
|
|
2517
|
+
if (!o.editor.isEditing || i) return;
|
|
2390
2518
|
const x = {
|
|
2391
|
-
pixelRatio:
|
|
2519
|
+
pixelRatio: h
|
|
2392
2520
|
};
|
|
2393
2521
|
["jpg", "webp"].includes(a) && (x.quality = 0.9, x.fill = "#ffffff");
|
|
2394
|
-
const
|
|
2395
|
-
t(!0),
|
|
2396
|
-
key:
|
|
2522
|
+
const w = ge();
|
|
2523
|
+
t(!0), o.editor.message.open({
|
|
2524
|
+
key: w,
|
|
2397
2525
|
type: "loading",
|
|
2398
2526
|
content: "Downloading..."
|
|
2399
|
-
}), await
|
|
2527
|
+
}), await o.editor.app.tree.export(a, x).then((S) => {
|
|
2400
2528
|
let _ = "ShotEasy";
|
|
2401
|
-
|
|
2402
|
-
key:
|
|
2529
|
+
h > 1 && (_ += `@${h}`), Oi(S.data, `${_}.${a}`), o.editor.message.open({
|
|
2530
|
+
key: w,
|
|
2403
2531
|
type: "success",
|
|
2404
2532
|
content: "Download Success!"
|
|
2405
2533
|
});
|
|
2406
2534
|
}).catch(() => {
|
|
2407
|
-
|
|
2408
|
-
key:
|
|
2535
|
+
o.editor.message.open({
|
|
2536
|
+
key: w,
|
|
2409
2537
|
type: "error",
|
|
2410
2538
|
content: "Download failed!"
|
|
2411
2539
|
});
|
|
2412
2540
|
}), t(!1);
|
|
2413
|
-
},
|
|
2414
|
-
if (!
|
|
2415
|
-
const x =
|
|
2416
|
-
t(!0),
|
|
2541
|
+
}, m = async () => {
|
|
2542
|
+
if (!o.editor.isEditing || i) return;
|
|
2543
|
+
const x = ge();
|
|
2544
|
+
t(!0), o.editor.message.open({
|
|
2417
2545
|
key: x,
|
|
2418
2546
|
type: "loading",
|
|
2419
2547
|
content: "Copying..."
|
|
2420
|
-
}), await
|
|
2421
|
-
const { data:
|
|
2548
|
+
}), await o.editor.app.tree.export("png", { blob: !0, pixelRatio: h }).then(async (w) => {
|
|
2549
|
+
const { data: S } = w;
|
|
2422
2550
|
await navigator.clipboard.write([
|
|
2423
2551
|
new ClipboardItem({
|
|
2424
|
-
[
|
|
2552
|
+
[S.type]: S
|
|
2425
2553
|
})
|
|
2426
|
-
]),
|
|
2554
|
+
]), o.editor.message.open({
|
|
2427
2555
|
key: x,
|
|
2428
2556
|
type: "success",
|
|
2429
2557
|
content: "Copy Success!"
|
|
2430
2558
|
});
|
|
2431
2559
|
}).catch(() => {
|
|
2432
|
-
|
|
2560
|
+
o.editor.message.open({
|
|
2433
2561
|
key: x,
|
|
2434
2562
|
type: "error",
|
|
2435
2563
|
content: "Copy failed!"
|
|
2436
2564
|
});
|
|
2437
2565
|
}), t(!1);
|
|
2438
|
-
},
|
|
2439
|
-
|
|
2566
|
+
}, b = () => {
|
|
2567
|
+
o.editor.destroy(), o.editor.clearImg(), o.editor.clearFun && o.editor.clearFun();
|
|
2440
2568
|
};
|
|
2441
|
-
|
|
2442
|
-
const
|
|
2569
|
+
ys(() => p(), () => m(), [p, m]);
|
|
2570
|
+
const C = /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "p-2 [&_.ant-segmented]:w-full [&_.ant-segmented-item]:w-[33%]", children: [
|
|
2443
2571
|
/* @__PURE__ */ e.jsx("div", { className: "text-xs text-gray-400 mb-2", children: "Format" }),
|
|
2444
2572
|
/* @__PURE__ */ e.jsx(
|
|
2445
|
-
|
|
2573
|
+
lt,
|
|
2446
2574
|
{
|
|
2447
2575
|
options: ["png", "jpg", "webp"],
|
|
2448
2576
|
size: "middle",
|
|
@@ -2451,72 +2579,72 @@ const cs = Y(() => {
|
|
|
2451
2579
|
),
|
|
2452
2580
|
/* @__PURE__ */ e.jsx("div", { className: "text-xs text-gray-400 mt-2 mb-2", children: "Pixel Ratio" }),
|
|
2453
2581
|
/* @__PURE__ */ e.jsx(
|
|
2454
|
-
|
|
2582
|
+
lt,
|
|
2455
2583
|
{
|
|
2456
2584
|
options: [{ value: 1, icon: "1x" }, { value: 2, icon: "2x" }, { value: 3, icon: "3x" }],
|
|
2457
2585
|
size: "middle",
|
|
2458
2586
|
onChange: f
|
|
2459
2587
|
}
|
|
2460
2588
|
),
|
|
2461
|
-
|
|
2589
|
+
o.option.frameConf.width && /* @__PURE__ */ e.jsxs("div", { className: "text-xs p-3 mt-4 flex justify-between bg-black/5 rounded-md", children: [
|
|
2462
2590
|
/* @__PURE__ */ e.jsx("span", { className: "text-gray-400", children: "Download Size" }),
|
|
2463
2591
|
/* @__PURE__ */ e.jsxs("span", { className: "text-gray-700", children: [
|
|
2464
|
-
|
|
2592
|
+
o.option.frameConf.width * h,
|
|
2465
2593
|
" x ",
|
|
2466
|
-
|
|
2594
|
+
o.option.frameConf.height * h
|
|
2467
2595
|
] })
|
|
2468
2596
|
] })
|
|
2469
2597
|
] }) });
|
|
2470
2598
|
return /* @__PURE__ */ e.jsxs("div", { className: "shrink-0 py-4 px-6 flex gap-2 justify-center items-center", children: [
|
|
2471
2599
|
/* @__PURE__ */ e.jsx(
|
|
2472
|
-
|
|
2600
|
+
Nt,
|
|
2473
2601
|
{
|
|
2474
2602
|
theme: {
|
|
2475
2603
|
components: {
|
|
2476
2604
|
Button: {
|
|
2477
|
-
colorPrimary: "#000",
|
|
2605
|
+
colorPrimary: o.editor.isDark ? "#2b4acb" : "#000",
|
|
2478
2606
|
algorithm: !0
|
|
2479
2607
|
// 启用算法
|
|
2480
2608
|
}
|
|
2481
2609
|
}
|
|
2482
2610
|
},
|
|
2483
2611
|
children: /* @__PURE__ */ e.jsxs("div", { className: "ant-space-compact flex flex-1", children: [
|
|
2484
|
-
/* @__PURE__ */ e.jsx(
|
|
2612
|
+
/* @__PURE__ */ e.jsx(L, { placement: "top", title: /* @__PURE__ */ e.jsxs("span", { children: [
|
|
2485
2613
|
"Download ",
|
|
2486
|
-
|
|
2614
|
+
gt,
|
|
2487
2615
|
" + S"
|
|
2488
2616
|
] }), children: /* @__PURE__ */ e.jsx(
|
|
2489
|
-
|
|
2617
|
+
k,
|
|
2490
2618
|
{
|
|
2491
2619
|
type: "primary",
|
|
2492
2620
|
size: "large",
|
|
2493
|
-
loading:
|
|
2494
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2621
|
+
loading: i,
|
|
2622
|
+
icon: /* @__PURE__ */ e.jsx(M.ImageDown, { size: 18 }),
|
|
2495
2623
|
className: "rounded-se-none flex-1 rounded-ee-none me-[-1px] hover:z-[1] border-r-white/30",
|
|
2496
|
-
onClick:
|
|
2624
|
+
onClick: p,
|
|
2497
2625
|
children: /* @__PURE__ */ e.jsxs("div", { className: "leading-4 px-2", children: [
|
|
2498
2626
|
/* @__PURE__ */ e.jsx("div", { className: "text-sm leading-4 font-semibold", children: "Download" }),
|
|
2499
2627
|
/* @__PURE__ */ e.jsxs("div", { className: "text-xs", children: [
|
|
2500
|
-
|
|
2628
|
+
h,
|
|
2501
2629
|
"x as ",
|
|
2502
2630
|
a.toLocaleUpperCase()
|
|
2503
2631
|
] })
|
|
2504
2632
|
] })
|
|
2505
2633
|
}
|
|
2506
2634
|
) }),
|
|
2507
|
-
/* @__PURE__ */ e.jsx(
|
|
2635
|
+
/* @__PURE__ */ e.jsx(L, { placement: "top", title: /* @__PURE__ */ e.jsxs("span", { children: [
|
|
2508
2636
|
"Copy ",
|
|
2509
|
-
|
|
2637
|
+
gt,
|
|
2510
2638
|
" + C"
|
|
2511
2639
|
] }), children: /* @__PURE__ */ e.jsx(
|
|
2512
|
-
|
|
2640
|
+
k,
|
|
2513
2641
|
{
|
|
2514
2642
|
type: "primary",
|
|
2515
2643
|
size: "large",
|
|
2516
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2517
|
-
loading:
|
|
2644
|
+
icon: /* @__PURE__ */ e.jsx(M.Copy, { size: 18 }),
|
|
2645
|
+
loading: i,
|
|
2518
2646
|
className: "rounded-ss-none rounded-es-none border-l-white/30",
|
|
2519
|
-
onClick:
|
|
2647
|
+
onClick: m
|
|
2520
2648
|
}
|
|
2521
2649
|
) })
|
|
2522
2650
|
] })
|
|
@@ -2524,9 +2652,9 @@ const cs = Y(() => {
|
|
|
2524
2652
|
),
|
|
2525
2653
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
2526
2654
|
/* @__PURE__ */ e.jsx(
|
|
2527
|
-
|
|
2655
|
+
xe,
|
|
2528
2656
|
{
|
|
2529
|
-
content:
|
|
2657
|
+
content: C,
|
|
2530
2658
|
trigger: "click",
|
|
2531
2659
|
arrow: !1,
|
|
2532
2660
|
placement: "topRight",
|
|
@@ -2534,197 +2662,250 @@ const cs = Y(() => {
|
|
|
2534
2662
|
overlayStyle: {
|
|
2535
2663
|
width: "320px"
|
|
2536
2664
|
},
|
|
2537
|
-
onOpenChange:
|
|
2538
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2665
|
+
onOpenChange: d,
|
|
2666
|
+
children: /* @__PURE__ */ e.jsx(k, { size: "large", icon: /* @__PURE__ */ e.jsx(M.Settings2, { size: 18 }) })
|
|
2539
2667
|
}
|
|
2540
2668
|
),
|
|
2541
|
-
((
|
|
2542
|
-
|
|
2669
|
+
((A = o.editor.img) == null ? void 0 : A.src) && /* @__PURE__ */ e.jsx(
|
|
2670
|
+
br,
|
|
2543
2671
|
{
|
|
2544
2672
|
title: "Delete the screenshot",
|
|
2545
2673
|
description: "Are you sure to delete this screenshot?",
|
|
2546
|
-
|
|
2674
|
+
placement: "topRight",
|
|
2675
|
+
onConfirm: b,
|
|
2547
2676
|
okText: "Yes",
|
|
2548
2677
|
cancelText: "No",
|
|
2549
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2678
|
+
children: /* @__PURE__ */ e.jsx(k, { size: "large", icon: /* @__PURE__ */ e.jsx(M.Trash2, { size: 18 }) })
|
|
2550
2679
|
}
|
|
2551
2680
|
)
|
|
2552
2681
|
] })
|
|
2553
2682
|
] });
|
|
2554
|
-
}),
|
|
2683
|
+
}), js = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='22'%20height='22'%3e%3cpath%20d='M311.296%20428.544V40.96C186.368%2094.208%2087.552%20195.072%2036.864%20321.024l274.432%20274.432V428.544z'%20fill='%2337C15C'%3e%3c/path%3e%3cpath%20d='M428.544%20311.296l274.432-274.432C642.048%2012.288%20577.536%200%20512%200%20440.832%200%20372.736%2014.848%20311.296%2040.96v387.584l117.248-117.248z'%20fill='%23A9E247'%3e%3c/path%3e%3cpath%20d='M983.04%20311.296h-387.584l117.248%20117.248%20274.432%20274.432c24.576-60.416%2036.864-125.44%2036.864-190.976%200-71.168-14.848-139.264-40.96-200.704z'%20fill='%23FF7D12'%3e%3c/path%3e%3cpath%20d='M712.704%20595.456V983.04c124.928-53.248%20223.744-154.112%20274.432-280.064l-274.432-274.432v166.912z'%20fill='%23F93B21'%3e%3c/path%3e%3cpath%20d='M595.456%20712.704l-274.432%20274.432c60.928%2024.576%20125.44%2036.864%20190.976%2036.864%2071.168%200%20139.264-14.848%20200.704-40.96v-387.584l-117.248%20117.248z'%20fill='%23846FEF'%3e%3c/path%3e%3cpath%20d='M428.544%20712.704H40.96c53.248%20124.928%20154.112%20223.744%20280.064%20274.432l274.432-274.432H428.544z'%20fill='%231E95FF'%3e%3c/path%3e%3cpath%20d='M311.296%20595.456L36.864%20321.024C12.288%20381.952%200%20446.464%200%20512c0%2071.168%2014.848%20139.264%2040.96%20200.704h387.584l-117.248-117.248z'%20fill='%2314EFEF'%3e%3c/path%3e%3cpath%20d='M595.456%20311.296H983.04c-53.248-124.928-154.112-223.744-280.064-274.432L428.544%20311.296h166.912z'%20fill='%23FFC931'%3e%3c/path%3e%3c/svg%3e", Ct = ["cosmic", "desktop"], me = ({ type: i, options: t, onChange: n, value: s }) => {
|
|
2555
2684
|
let a = [];
|
|
2556
2685
|
if (t && t.length)
|
|
2557
2686
|
a = t;
|
|
2558
2687
|
else {
|
|
2559
2688
|
const l = [];
|
|
2560
|
-
Object.keys(Q).map((
|
|
2561
|
-
|
|
2562
|
-
key:
|
|
2563
|
-
value: Q[
|
|
2689
|
+
Object.keys(Q).map((h) => {
|
|
2690
|
+
h.includes(i) && l.push({
|
|
2691
|
+
key: h,
|
|
2692
|
+
value: Q[h]
|
|
2564
2693
|
});
|
|
2565
2694
|
}), a = l;
|
|
2566
2695
|
}
|
|
2567
2696
|
return /* @__PURE__ */ e.jsx(
|
|
2568
|
-
|
|
2697
|
+
P.Group,
|
|
2569
2698
|
{
|
|
2570
2699
|
onChange: (l) => n(l.target.value),
|
|
2571
2700
|
value: s,
|
|
2572
|
-
rootClassName:
|
|
2701
|
+
rootClassName: Z(
|
|
2573
2702
|
"grid [&_span]:ps-0",
|
|
2574
|
-
|
|
2703
|
+
Ct.includes(i) ? "grid-cols-5 gap-y-1.5" : "grid-cols-7 gap-y-3"
|
|
2575
2704
|
),
|
|
2576
|
-
children: a.map((l,
|
|
2577
|
-
|
|
2705
|
+
children: a.map((l, h) => /* @__PURE__ */ e.jsx(
|
|
2706
|
+
P,
|
|
2578
2707
|
{
|
|
2579
2708
|
className: "[&_.ant-radio]:hidden [&_span]:p-0 mr-0",
|
|
2580
2709
|
value: l.key,
|
|
2581
|
-
children:
|
|
2710
|
+
children: Ct.includes(i) ? /* @__PURE__ */ e.jsx("div", { className: Z("w-12 h-8 rounded-md overflow-hidden"), children: /* @__PURE__ */ e.jsx("img", { src: `${l.value.class}&w=48`, className: "w-full h-full object-cover object-center" }) }) : /* @__PURE__ */ e.jsx("div", { className: Z("w-8 h-8 rounded-full overflow-hidden", l.value.class) })
|
|
2582
2711
|
},
|
|
2583
|
-
|
|
2712
|
+
h
|
|
2584
2713
|
))
|
|
2585
2714
|
}
|
|
2586
2715
|
);
|
|
2587
|
-
},
|
|
2716
|
+
}, Ms = B(({ showMore: i, onChange: t }) => {
|
|
2588
2717
|
const n = () => {
|
|
2589
2718
|
t(!1);
|
|
2590
2719
|
}, s = (l) => {
|
|
2591
|
-
const
|
|
2592
|
-
|
|
2720
|
+
const h = l.toHexString();
|
|
2721
|
+
o.option.frameConf.background = {
|
|
2593
2722
|
type: "solid",
|
|
2594
|
-
color:
|
|
2723
|
+
color: h
|
|
2595
2724
|
};
|
|
2596
2725
|
}, a = (l) => {
|
|
2597
|
-
|
|
2726
|
+
o.option.setBackground(l);
|
|
2598
2727
|
};
|
|
2599
2728
|
return /* @__PURE__ */ e.jsx(
|
|
2600
|
-
|
|
2729
|
+
wr,
|
|
2601
2730
|
{
|
|
2602
2731
|
title: "",
|
|
2603
2732
|
placement: "right",
|
|
2604
2733
|
closable: !1,
|
|
2605
2734
|
mask: !1,
|
|
2606
2735
|
onClose: n,
|
|
2607
|
-
open:
|
|
2736
|
+
open: i,
|
|
2608
2737
|
getContainer: !1,
|
|
2609
2738
|
width: "100%",
|
|
2610
2739
|
className: "[&_.ant-drawer-body]:p-0",
|
|
2611
2740
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2 h-full overflow-hidden", children: [
|
|
2612
2741
|
/* @__PURE__ */ e.jsx("div", { className: "shrink-0 pt-4 px-4", children: /* @__PURE__ */ e.jsx(
|
|
2613
|
-
|
|
2742
|
+
k,
|
|
2614
2743
|
{
|
|
2615
2744
|
type: "text",
|
|
2616
2745
|
size: "small",
|
|
2617
2746
|
className: "text-xs flex items-center opacity-80 m-0",
|
|
2618
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2747
|
+
icon: /* @__PURE__ */ e.jsx(M.ChevronRight, { size: 16 }),
|
|
2748
|
+
iconPosition: "end",
|
|
2619
2749
|
onClick: () => t(!1),
|
|
2620
2750
|
children: "Back"
|
|
2621
2751
|
}
|
|
2622
2752
|
) }),
|
|
2623
2753
|
/* @__PURE__ */ e.jsxs("div", { className: "h-0 flex-1 overflow-y-auto px-4 py-2", children: [
|
|
2624
2754
|
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-bold py-2", children: "Custom" }),
|
|
2625
|
-
/* @__PURE__ */ e.jsx("div", { className: "py-1", children: /* @__PURE__ */ e.jsx(
|
|
2755
|
+
/* @__PURE__ */ e.jsx("div", { className: "py-1", children: /* @__PURE__ */ e.jsx(be, { onChange: s, children: /* @__PURE__ */ e.jsx(k, { type: "default", size: "small", shape: "circle", icon: /* @__PURE__ */ e.jsx("img", { src: js, width: 18 }) }) }) }),
|
|
2626
2756
|
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-bold py-2", children: "Solid Colors" }),
|
|
2627
|
-
/* @__PURE__ */ e.jsx(
|
|
2757
|
+
/* @__PURE__ */ e.jsx(me, { type: "solid", onChange: a, value: o.option.background }),
|
|
2628
2758
|
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-bold py-2", children: "Gradients" }),
|
|
2629
|
-
/* @__PURE__ */ e.jsx(
|
|
2759
|
+
/* @__PURE__ */ e.jsx(me, { type: "gradient", onChange: a, value: o.option.background }),
|
|
2630
2760
|
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-bold py-2", children: "Cosmic Gradients" }),
|
|
2631
|
-
/* @__PURE__ */ e.jsx(
|
|
2761
|
+
/* @__PURE__ */ e.jsx(me, { type: "cosmic", onChange: a, value: o.option.background }),
|
|
2632
2762
|
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-bold py-2", children: "Desktop" }),
|
|
2633
|
-
/* @__PURE__ */ e.jsx(
|
|
2763
|
+
/* @__PURE__ */ e.jsx(me, { type: "desktop", onChange: a, value: o.option.background })
|
|
2634
2764
|
] })
|
|
2635
2765
|
] })
|
|
2636
2766
|
}
|
|
2637
2767
|
);
|
|
2638
|
-
}),
|
|
2639
|
-
const [
|
|
2768
|
+
}), Cs = B(() => {
|
|
2769
|
+
const [i, t] = O(!1), n = (s) => {
|
|
2770
|
+
o.option.setFrame(s.target.value);
|
|
2771
|
+
};
|
|
2772
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold [&_label]:text-sm", children: [
|
|
2773
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
2774
|
+
/* @__PURE__ */ e.jsx("label", { children: "Frame" }),
|
|
2775
|
+
/* @__PURE__ */ e.jsxs(
|
|
2776
|
+
k,
|
|
2777
|
+
{
|
|
2778
|
+
type: "text",
|
|
2779
|
+
size: "small",
|
|
2780
|
+
className: "text-xs flex items-center opacity-80 m-0",
|
|
2781
|
+
disabled: !0,
|
|
2782
|
+
onClick: () => t(!0),
|
|
2783
|
+
children: [
|
|
2784
|
+
"More ",
|
|
2785
|
+
/* @__PURE__ */ e.jsx(M.ChevronRight, { size: 16 })
|
|
2786
|
+
]
|
|
2787
|
+
}
|
|
2788
|
+
)
|
|
2789
|
+
] }),
|
|
2790
|
+
/* @__PURE__ */ e.jsx("div", { className: "py-3 [&_.ant-radio-wrapper_span]:p-0 [&_.ant-radio-wrapper_span]:px-1", children: /* @__PURE__ */ e.jsxs(
|
|
2791
|
+
P.Group,
|
|
2792
|
+
{
|
|
2793
|
+
rootClassName: "grid grid-cols-5",
|
|
2794
|
+
onChange: n,
|
|
2795
|
+
value: o.option.frame,
|
|
2796
|
+
children: [
|
|
2797
|
+
/* @__PURE__ */ e.jsx(P, { className: "[&_.ant-radio]:hidden [&_span]:mr-0 [&_span]:block [&_span]:w-full", value: "none", children: /* @__PURE__ */ e.jsx("div", { className: "bg-gray-300/30 rounded-md h-8 overflow-hidden", children: /* @__PURE__ */ e.jsx("div", { className: "bg-slate-300/40 h-7 w-[85%] rounded-md shadow-md -mt-1 -ml-1" }) }) }),
|
|
2798
|
+
/* @__PURE__ */ e.jsx(P, { className: "[&_.ant-radio]:hidden [&_span]:mr-0 [&_span]:block [&_span]:w-full", value: "light", children: /* @__PURE__ */ e.jsx("div", { className: "bg-gray-300/30 rounded-md h-8 overflow-hidden", children: /* @__PURE__ */ e.jsx("div", { className: "bg-slate-300/40 border-2 border-white/80 h-7 w-[85%] rounded-md shadow-md -mt-1 -ml-1" }) }) }),
|
|
2799
|
+
/* @__PURE__ */ e.jsx(P, { className: "[&_.ant-radio]:hidden [&_span]:mr-0 [&_span]:block [&_span]:w-full", value: "dark", children: /* @__PURE__ */ e.jsx("div", { className: "bg-gray-300/30 rounded-md h-8 overflow-hidden", children: /* @__PURE__ */ e.jsx("div", { className: "bg-slate-300/40 border-2 border-black/40 h-7 w-[85%] rounded-md shadow-md -mt-1 -ml-1" }) }) }),
|
|
2800
|
+
/* @__PURE__ */ e.jsx(P, { className: "[&_.ant-radio]:hidden [&_span]:mr-0 [&_span]:block [&_span]:w-full", value: "macosBarLight", children: /* @__PURE__ */ e.jsx("div", { className: "bg-gray-300/30 rounded-md h-8 overflow-hidden", children: /* @__PURE__ */ e.jsx("div", { className: "bg-slate-300/40 h-7 w-[85%] rounded-sm shadow-md mt-2 ml-3 overflow-hidden", children: /* @__PURE__ */ e.jsx(
|
|
2801
|
+
"div",
|
|
2802
|
+
{
|
|
2803
|
+
className: "h-1.5 bg-white/90 px-0.5 flex items-center gap-[1px] before:block before:rounded-full before:w-0.5 before:h-0.5 before:bg-red-500 after:w-0.5 after:h-0.5 after:bg-green-500",
|
|
2804
|
+
children: /* @__PURE__ */ e.jsx("i", { className: "block w-0.5 h-0.5 bg-yellow-500" })
|
|
2805
|
+
}
|
|
2806
|
+
) }) }) }),
|
|
2807
|
+
/* @__PURE__ */ e.jsx(P, { className: "[&_.ant-radio]:hidden [&_span]:mr-0 [&_span]:block [&_span]:w-full", value: "macosBarDark", children: /* @__PURE__ */ e.jsx("div", { className: "bg-gray-300/30 rounded-md h-8 overflow-hidden", children: /* @__PURE__ */ e.jsx("div", { className: "bg-slate-300/40 h-7 w-[85%] rounded-sm shadow-md mt-2 ml-3 overflow-hidden", children: /* @__PURE__ */ e.jsx(
|
|
2808
|
+
"div",
|
|
2809
|
+
{
|
|
2810
|
+
className: "h-1.5 bg-black/90 px-0.5 flex items-center gap-[1px] before:block before:rounded-full before:w-0.5 before:h-0.5 before:bg-red-500 after:w-0.5 after:h-0.5 after:bg-green-500",
|
|
2811
|
+
children: /* @__PURE__ */ e.jsx("i", { className: "block w-0.5 h-0.5 bg-yellow-500" })
|
|
2812
|
+
}
|
|
2813
|
+
) }) }) })
|
|
2814
|
+
]
|
|
2815
|
+
}
|
|
2816
|
+
) })
|
|
2817
|
+
] });
|
|
2818
|
+
}), ks = B(() => {
|
|
2819
|
+
const [i, t] = O(!1), n = (s) => {
|
|
2640
2820
|
const a = s.target.value;
|
|
2641
|
-
|
|
2821
|
+
o.option.setBackground(a);
|
|
2642
2822
|
};
|
|
2643
|
-
return /* @__PURE__ */ e.jsxs("div", { className: "bg-white flex flex-col md:w-[340px] border-l border-l-gray-50 shadow-lg relative z-10 select-none", children: [
|
|
2823
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "bg-white dark:bg-black flex flex-col md:w-[340px] border-l border-l-gray-50 dark:border-l-gray-700 dark:text-gray-400 shadow-lg relative z-10 select-none", children: [
|
|
2644
2824
|
/* @__PURE__ */ e.jsxs("div", { className: "flex-1 flex-col gap-2 p-4 overflow-y-auto overflow-x-hidden", children: [
|
|
2645
|
-
/* @__PURE__ */ e.jsx(
|
|
2825
|
+
/* @__PURE__ */ e.jsx(ms, {}),
|
|
2646
2826
|
/* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold pt-2 [&_label]:text-sm", children: [
|
|
2647
2827
|
/* @__PURE__ */ e.jsx("label", { children: "Quick" }),
|
|
2648
2828
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-4 items-center py-2", children: [
|
|
2649
|
-
/* @__PURE__ */ e.jsx(
|
|
2829
|
+
/* @__PURE__ */ e.jsx(gs, {}),
|
|
2650
2830
|
/* @__PURE__ */ e.jsx(
|
|
2651
|
-
|
|
2831
|
+
k,
|
|
2652
2832
|
{
|
|
2653
2833
|
type: "text",
|
|
2654
2834
|
shape: "circle",
|
|
2655
|
-
onClick: () =>
|
|
2656
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2835
|
+
onClick: () => o.option.toggleFlip("x"),
|
|
2836
|
+
icon: /* @__PURE__ */ e.jsx(M.FlipHorizontal2, { size: 18 })
|
|
2657
2837
|
}
|
|
2658
2838
|
),
|
|
2659
2839
|
/* @__PURE__ */ e.jsx(
|
|
2660
|
-
|
|
2840
|
+
k,
|
|
2661
2841
|
{
|
|
2662
2842
|
type: "text",
|
|
2663
2843
|
shape: "circle",
|
|
2664
|
-
onClick: () =>
|
|
2665
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2844
|
+
onClick: () => o.option.toggleFlip("y"),
|
|
2845
|
+
icon: /* @__PURE__ */ e.jsx(M.FlipVertical2, { size: 18 })
|
|
2666
2846
|
}
|
|
2667
2847
|
),
|
|
2668
|
-
/* @__PURE__ */ e.jsx(
|
|
2848
|
+
/* @__PURE__ */ e.jsx(bs, {})
|
|
2669
2849
|
] })
|
|
2670
2850
|
] }),
|
|
2671
2851
|
/* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold [&_label]:text-sm", children: [
|
|
2672
2852
|
/* @__PURE__ */ e.jsx("label", { children: "Scale" }),
|
|
2673
2853
|
/* @__PURE__ */ e.jsx(
|
|
2674
|
-
|
|
2854
|
+
pe,
|
|
2675
2855
|
{
|
|
2676
2856
|
min: 0.1,
|
|
2677
2857
|
max: 2,
|
|
2678
2858
|
step: 0.1,
|
|
2679
|
-
onChange: (s) =>
|
|
2680
|
-
value: typeof
|
|
2859
|
+
onChange: (s) => o.option.setScale(s),
|
|
2860
|
+
value: typeof o.option.scale == "number" ? o.option.scale : 1
|
|
2681
2861
|
}
|
|
2682
2862
|
)
|
|
2683
2863
|
] }),
|
|
2684
2864
|
/* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold [&_label]:text-sm", children: [
|
|
2685
2865
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between", children: [
|
|
2686
2866
|
/* @__PURE__ */ e.jsx("label", { children: "Padding" }),
|
|
2687
|
-
/* @__PURE__ */ e.jsx(
|
|
2867
|
+
/* @__PURE__ */ e.jsx(be, { value: o.option.paddingBg, onChange: (s) => o.option.setPaddingBg(s.toRgbString()), size: "small" })
|
|
2688
2868
|
] }),
|
|
2689
2869
|
/* @__PURE__ */ e.jsx(
|
|
2690
|
-
|
|
2870
|
+
pe,
|
|
2691
2871
|
{
|
|
2692
2872
|
min: 0,
|
|
2693
2873
|
max: 60,
|
|
2694
|
-
onChange: (s) =>
|
|
2695
|
-
value: typeof
|
|
2874
|
+
onChange: (s) => o.option.setPadding(s),
|
|
2875
|
+
value: typeof o.option.padding == "number" ? o.option.padding : 0
|
|
2696
2876
|
}
|
|
2697
2877
|
)
|
|
2698
2878
|
] }),
|
|
2699
2879
|
/* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold [&_label]:text-sm", children: [
|
|
2700
2880
|
/* @__PURE__ */ e.jsx("label", { children: "Rounded" }),
|
|
2701
2881
|
/* @__PURE__ */ e.jsx(
|
|
2702
|
-
|
|
2882
|
+
pe,
|
|
2703
2883
|
{
|
|
2704
2884
|
min: 0,
|
|
2705
2885
|
max: 20,
|
|
2706
|
-
onChange: (s) =>
|
|
2707
|
-
value: typeof
|
|
2886
|
+
onChange: (s) => o.option.setRound(s),
|
|
2887
|
+
value: typeof o.option.round == "number" ? o.option.round : 0
|
|
2708
2888
|
}
|
|
2709
2889
|
)
|
|
2710
2890
|
] }),
|
|
2711
2891
|
/* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold [&_label]:text-sm", children: [
|
|
2712
2892
|
/* @__PURE__ */ e.jsx("label", { children: "Shadow" }),
|
|
2713
2893
|
/* @__PURE__ */ e.jsx(
|
|
2714
|
-
|
|
2894
|
+
pe,
|
|
2715
2895
|
{
|
|
2716
2896
|
min: 0,
|
|
2717
2897
|
max: 6,
|
|
2718
|
-
onChange: (s) =>
|
|
2719
|
-
value: typeof
|
|
2898
|
+
onChange: (s) => o.option.setShadow(s),
|
|
2899
|
+
value: typeof o.option.shadow == "number" ? o.option.shadow : 0
|
|
2720
2900
|
}
|
|
2721
2901
|
)
|
|
2722
2902
|
] }),
|
|
2903
|
+
/* @__PURE__ */ e.jsx(Cs, {}),
|
|
2723
2904
|
/* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold [&_label]:text-sm", children: [
|
|
2724
2905
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
2725
2906
|
/* @__PURE__ */ e.jsx("label", { children: "Background" }),
|
|
2726
2907
|
/* @__PURE__ */ e.jsxs(
|
|
2727
|
-
|
|
2908
|
+
k,
|
|
2728
2909
|
{
|
|
2729
2910
|
type: "text",
|
|
2730
2911
|
size: "small",
|
|
@@ -2732,90 +2913,90 @@ const cs = Y(() => {
|
|
|
2732
2913
|
onClick: () => t(!0),
|
|
2733
2914
|
children: [
|
|
2734
2915
|
"More ",
|
|
2735
|
-
/* @__PURE__ */ e.jsx(
|
|
2916
|
+
/* @__PURE__ */ e.jsx(M.ChevronRight, { size: 16 })
|
|
2736
2917
|
]
|
|
2737
2918
|
}
|
|
2738
2919
|
)
|
|
2739
2920
|
] }),
|
|
2740
2921
|
/* @__PURE__ */ e.jsx("div", { className: "py-3", children: /* @__PURE__ */ e.jsxs(
|
|
2741
|
-
|
|
2922
|
+
P.Group,
|
|
2742
2923
|
{
|
|
2743
2924
|
onChange: n,
|
|
2744
|
-
value:
|
|
2925
|
+
value: o.option.background,
|
|
2745
2926
|
rootClassName: "grid grid-cols-7 [&_span]:ps-0",
|
|
2746
2927
|
children: [
|
|
2747
|
-
/* @__PURE__ */ e.jsx(
|
|
2928
|
+
/* @__PURE__ */ e.jsx(P, { className: "[&_.ant-radio]:hidden [&_span]:p-0 mr-0", value: "default_1", children: /* @__PURE__ */ e.jsx("div", { className: Z("w-8 h-8 rounded-full", Q.default_1.class) }) }),
|
|
2748
2929
|
Object.keys(Q).map((s) => {
|
|
2749
|
-
if (s.includes("default") && s !== "default_1") return /* @__PURE__ */ e.jsx(
|
|
2930
|
+
if (s.includes("default") && s !== "default_1") return /* @__PURE__ */ e.jsx(P, { className: "[&_.ant-radio]:hidden [&_span]:p-0 mr-0", value: s, children: /* @__PURE__ */ e.jsx("div", { className: Z("w-8 h-8 rounded-full", Q[s].class) }) }, s);
|
|
2750
2931
|
})
|
|
2751
2932
|
]
|
|
2752
2933
|
}
|
|
2753
2934
|
) })
|
|
2754
2935
|
] }),
|
|
2755
|
-
/* @__PURE__ */ e.jsx(
|
|
2936
|
+
/* @__PURE__ */ e.jsx(ws, {})
|
|
2756
2937
|
] }),
|
|
2757
|
-
/* @__PURE__ */ e.jsx(
|
|
2758
|
-
/* @__PURE__ */ e.jsx(
|
|
2938
|
+
/* @__PURE__ */ e.jsx(vs, {}),
|
|
2939
|
+
/* @__PURE__ */ e.jsx(Ms, { showMore: i, onChange: t })
|
|
2759
2940
|
] });
|
|
2760
|
-
}),
|
|
2761
|
-
|
|
2941
|
+
}), As = (i, t = []) => {
|
|
2942
|
+
N(() => {
|
|
2762
2943
|
const n = async (s) => {
|
|
2763
2944
|
const a = s.clipboardData;
|
|
2764
2945
|
if (!a || !a.items) return;
|
|
2765
2946
|
const l = Array.from(a.items).filter(
|
|
2766
|
-
(f) =>
|
|
2947
|
+
(f) => Dt.includes(f.type)
|
|
2767
2948
|
);
|
|
2768
2949
|
if (!l.length) return;
|
|
2769
|
-
const
|
|
2770
|
-
|
|
2950
|
+
const h = l[0].getAsFile();
|
|
2951
|
+
i && i(h);
|
|
2771
2952
|
};
|
|
2772
2953
|
return document.addEventListener("paste", n, !1), () => {
|
|
2773
2954
|
document.removeEventListener("paste", n);
|
|
2774
2955
|
};
|
|
2775
2956
|
}, [...t]);
|
|
2776
|
-
},
|
|
2957
|
+
}, Ot = (i) => async (n, s = "blob") => {
|
|
2958
|
+
const a = window.URL || window.webkitURL || window, l = s === "blob" ? a.createObjectURL(n) : n, h = await Yi(l), f = Math.round(h.width), d = Math.round(h.height);
|
|
2959
|
+
if (i.editor.setImg({
|
|
2960
|
+
src: l,
|
|
2961
|
+
width: f,
|
|
2962
|
+
height: d,
|
|
2963
|
+
type: s === "blob" ? n.type : "image/png",
|
|
2964
|
+
name: s === "blob" ? n.name : "ShotEasy.png"
|
|
2965
|
+
}), i.option.size.type === "auto") {
|
|
2966
|
+
const p = we(f, d);
|
|
2967
|
+
i.option.setFrameSize(f + p, d + p);
|
|
2968
|
+
}
|
|
2969
|
+
}, Ns = async () => {
|
|
2777
2970
|
try {
|
|
2778
|
-
const
|
|
2779
|
-
t.srcObject =
|
|
2971
|
+
const i = await navigator.mediaDevices.getDisplayMedia(), t = document.createElement("video");
|
|
2972
|
+
t.srcObject = i, t.play(), await new Promise((l) => t.onplaying = l);
|
|
2780
2973
|
const n = document.createElement("canvas");
|
|
2781
2974
|
n.width = t.videoWidth, n.height = t.videoHeight, n.getContext("2d").drawImage(t, 0, 0);
|
|
2782
2975
|
const a = n.toDataURL("image/png");
|
|
2783
2976
|
return t.srcObject.getTracks().forEach((l) => l.stop()), a;
|
|
2784
|
-
} catch (
|
|
2785
|
-
console.log("Error capturing screen:",
|
|
2977
|
+
} catch (i) {
|
|
2978
|
+
console.log("Error capturing screen:", i);
|
|
2786
2979
|
}
|
|
2787
|
-
}, { Dragger:
|
|
2788
|
-
const o = async (a,
|
|
2789
|
-
const
|
|
2790
|
-
|
|
2791
|
-
src: f,
|
|
2792
|
-
width: h,
|
|
2793
|
-
height: g,
|
|
2794
|
-
type: l === "blob" ? a.type : "image/png",
|
|
2795
|
-
name: l === "blob" ? a.name : "ShotEasy.png"
|
|
2796
|
-
}), r.option.size.type === "auto") {
|
|
2797
|
-
const y = Math.round(h * 0.2);
|
|
2798
|
-
r.option.setFrameSize(h + y, g + y);
|
|
2799
|
-
}
|
|
2800
|
-
}, t = async (a) => (await o(a), Promise.reject()), n = async () => {
|
|
2801
|
-
const a = await hs();
|
|
2802
|
-
a && o(a, "dataURL");
|
|
2980
|
+
}, { Dragger: Ts } = yr, Ss = B(() => {
|
|
2981
|
+
const i = Ot(o), t = async (a) => (await i(a), Promise.reject()), n = async () => {
|
|
2982
|
+
const a = await Ns();
|
|
2983
|
+
a && i(a, "dataURL");
|
|
2803
2984
|
}, s = () => {
|
|
2804
|
-
|
|
2985
|
+
o.editor.message.info("Developing, Coming soon!");
|
|
2805
2986
|
};
|
|
2806
|
-
return
|
|
2807
|
-
|
|
2808
|
-
}), /* @__PURE__ */ e.jsx("div", { className: "md:w-0 md:flex-1 flex flex-col justify-center items-center overflow-hidden select-none relative", children: /* @__PURE__ */ e.jsxs("div", { className:
|
|
2987
|
+
return As((a) => {
|
|
2988
|
+
i(a);
|
|
2989
|
+
}), /* @__PURE__ */ e.jsx("div", { className: "md:w-0 md:flex-1 flex flex-col justify-center items-center overflow-hidden select-none relative", children: /* @__PURE__ */ e.jsxs("div", { className: Z("max-w-[600px]", o.editor.invalid && "invalid"), children: [
|
|
2809
2990
|
/* @__PURE__ */ e.jsx(
|
|
2810
|
-
|
|
2991
|
+
Ts,
|
|
2811
2992
|
{
|
|
2812
|
-
accept:
|
|
2993
|
+
accept: Dt.join(","),
|
|
2813
2994
|
name: "file",
|
|
2814
2995
|
showUploadList: !1,
|
|
2815
2996
|
beforeUpload: t,
|
|
2816
|
-
rootClassName: "p-4 rounded-md bg-white block shadow-sm",
|
|
2997
|
+
rootClassName: "p-4 rounded-md bg-white dark:bg-black dark:text-gray-400 block shadow-sm",
|
|
2817
2998
|
children: /* @__PURE__ */ e.jsxs("div", { className: "text-center p-10", children: [
|
|
2818
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-2xl my-2 opacity-60", children: /* @__PURE__ */ e.jsx(
|
|
2999
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-2xl my-2 opacity-60", children: /* @__PURE__ */ e.jsx(M.ImagePlus, { className: "mx-auto", size: 36 }) }),
|
|
2819
3000
|
/* @__PURE__ */ e.jsxs("p", { className: "text-sm px-4", children: [
|
|
2820
3001
|
"Click or Drag image to this area",
|
|
2821
3002
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
@@ -2824,29 +3005,40 @@ const cs = Y(() => {
|
|
|
2824
3005
|
] })
|
|
2825
3006
|
}
|
|
2826
3007
|
),
|
|
2827
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between mt-
|
|
2828
|
-
/* @__PURE__ */ e.jsx(
|
|
2829
|
-
/* @__PURE__ */ e.jsx(
|
|
2830
|
-
/* @__PURE__ */ e.jsx(
|
|
2831
|
-
/* @__PURE__ */ e.jsx(
|
|
3008
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between mt-2 py-4 px-6 rounded-md bg-white dark:bg-black shadow-sm", children: [
|
|
3009
|
+
/* @__PURE__ */ e.jsx(L, { placement: "top", arrow: !1, title: "Take a screenshot of desktop windows", children: /* @__PURE__ */ e.jsx(k, { shape: "round", type: "default", size: "large", icon: /* @__PURE__ */ e.jsx(M.Camera, { size: 20 }), onClick: n }) }),
|
|
3010
|
+
/* @__PURE__ */ e.jsx(L, { placement: "top", arrow: !1, title: "Beautify text", children: /* @__PURE__ */ e.jsx(k, { shape: "round", type: "default", size: "large", icon: /* @__PURE__ */ e.jsx(M.Type, { size: 20 }), onClick: s }) }),
|
|
3011
|
+
/* @__PURE__ */ e.jsx(L, { placement: "top", arrow: !1, title: "Beautify Code", children: /* @__PURE__ */ e.jsx(k, { shape: "round", type: "default", size: "large", icon: /* @__PURE__ */ e.jsx(M.CodeXml, { size: 20, onClick: s }) }) }),
|
|
3012
|
+
/* @__PURE__ */ e.jsx(L, { placement: "top", arrow: !1, title: "Create gif animate", children: /* @__PURE__ */ e.jsx(k, { shape: "round", type: "default", size: "large", icon: /* @__PURE__ */ e.jsx(M.ImagePlay, { size: 20, onClick: s }) }) })
|
|
2832
3013
|
] })
|
|
2833
3014
|
] }) });
|
|
2834
|
-
}),
|
|
2835
|
-
var
|
|
2836
|
-
const o = (
|
|
2837
|
-
return
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
3015
|
+
}), $s = B(({ defaultImg: i, headLeft: t, headRight: n, isDark: s, boxClassName: a = "", onClear: l }) => {
|
|
3016
|
+
var m;
|
|
3017
|
+
const h = Ot(o), f = (m = o.editor.img) != null && m.src ? /* @__PURE__ */ e.jsx(hs, {}) : /* @__PURE__ */ e.jsx(Ss, {}), [d, p] = vr.useMessage();
|
|
3018
|
+
return o.editor.setMessage(d), o.editor.setClearFun(l), le(() => {
|
|
3019
|
+
const b = s || localStorage.getItem("SHOTEASY_BEAUTIFIER_THEME") === "dark" ? "dark" : "light";
|
|
3020
|
+
o.editor.setTheme(b);
|
|
3021
|
+
}, [s]), N(() => {
|
|
3022
|
+
i && h(i, "dataURL");
|
|
3023
|
+
}, [i]), /* @__PURE__ */ e.jsx(Ni, { children: /* @__PURE__ */ e.jsxs(
|
|
3024
|
+
Nt,
|
|
3025
|
+
{
|
|
3026
|
+
theme: {
|
|
3027
|
+
algorithm: o.editor.isDark ? ct.darkAlgorithm : ct.defaultAlgorithm
|
|
3028
|
+
},
|
|
3029
|
+
children: [
|
|
3030
|
+
p,
|
|
3031
|
+
/* @__PURE__ */ e.jsxs("div", { id: "shoteasy-container", className: Z("polka flex flex-col overflow-hidden antialiased w-full h-[100vh] dark:bg-black", a), "data-mode": o.editor.isDark ? "dark" : "light", children: [
|
|
3032
|
+
/* @__PURE__ */ e.jsx(Qi, { headLeft: t, headRight: n }),
|
|
3033
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col flex-1 h-0 md:flex-row md:items-stretch", children: [
|
|
3034
|
+
f,
|
|
3035
|
+
/* @__PURE__ */ e.jsx(ks, {})
|
|
3036
|
+
] })
|
|
3037
|
+
] })
|
|
3038
|
+
]
|
|
3039
|
+
}
|
|
3040
|
+
) });
|
|
2849
3041
|
});
|
|
2850
3042
|
export {
|
|
2851
|
-
|
|
3043
|
+
$s as ImageBeautifier
|
|
2852
3044
|
};
|