@carandesign/drawui 0.1.2 → 0.2.2
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/CHANGELOG.md +6 -0
- package/README.md +1 -0
- package/dist/components/button/DrawuiButton.types.d.ts +2 -1
- package/dist/components/card/DrawuiCard.types.d.ts +2 -1
- package/dist/components/collapse/DrawuiCollapse.types.d.ts +2 -1
- package/dist/components/divider/DrawuiDivider.types.d.ts +2 -1
- package/dist/components/iconButton/DrawuiIconButton.types.d.ts +2 -1
- package/dist/components/input/DrawuiInput.types.d.ts +2 -1
- package/dist/drawui.cjs.js +11 -11
- package/dist/drawui.es.js +1021 -983
- package/dist/theme/types.d.ts +1 -0
- package/package.json +5 -2
package/dist/drawui.es.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import st, { createContext as nt, useContext as rt, useRef as
|
|
2
|
-
var ce = { exports: {} },
|
|
1
|
+
import st, { createContext as nt, useContext as rt, useRef as O, useState as Y, useEffect as R } from "react";
|
|
2
|
+
var ce = { exports: {} }, Z = {};
|
|
3
3
|
var je;
|
|
4
4
|
function ot() {
|
|
5
|
-
if (je) return
|
|
5
|
+
if (je) return Z;
|
|
6
6
|
je = 1;
|
|
7
7
|
var o = /* @__PURE__ */ Symbol.for("react.transitional.element"), e = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
8
|
-
function
|
|
8
|
+
function s(t, n, r) {
|
|
9
9
|
var i = null;
|
|
10
|
-
if (r !== void 0 && (i = "" + r),
|
|
10
|
+
if (r !== void 0 && (i = "" + r), n.key !== void 0 && (i = "" + n.key), "key" in n) {
|
|
11
11
|
r = {};
|
|
12
|
-
for (var a in
|
|
13
|
-
a !== "key" && (r[a] =
|
|
14
|
-
} else r =
|
|
15
|
-
return
|
|
12
|
+
for (var a in n)
|
|
13
|
+
a !== "key" && (r[a] = n[a]);
|
|
14
|
+
} else r = n;
|
|
15
|
+
return n = r.ref, {
|
|
16
16
|
$$typeof: o,
|
|
17
|
-
type:
|
|
17
|
+
type: t,
|
|
18
18
|
key: i,
|
|
19
|
-
ref:
|
|
19
|
+
ref: n !== void 0 ? n : null,
|
|
20
20
|
props: r
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
return
|
|
23
|
+
return Z.Fragment = e, Z.jsx = s, Z.jsxs = s, Z;
|
|
24
24
|
}
|
|
25
|
-
var
|
|
25
|
+
var X = {};
|
|
26
26
|
var $e;
|
|
27
27
|
function at() {
|
|
28
28
|
return $e || ($e = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
@@ -51,19 +51,19 @@ function at() {
|
|
|
51
51
|
), p.$$typeof) {
|
|
52
52
|
case m:
|
|
53
53
|
return "Portal";
|
|
54
|
-
case G:
|
|
55
|
-
return p.displayName || "Context";
|
|
56
54
|
case z:
|
|
55
|
+
return p.displayName || "Context";
|
|
56
|
+
case C:
|
|
57
57
|
return (p._context.displayName || "Context") + ".Consumer";
|
|
58
|
-
case
|
|
59
|
-
var
|
|
60
|
-
return p = p.displayName, p || (p =
|
|
58
|
+
case N:
|
|
59
|
+
var w = p.render;
|
|
60
|
+
return p = p.displayName, p || (p = w.displayName || w.name || "", p = p !== "" ? "ForwardRef(" + p + ")" : "ForwardRef"), p;
|
|
61
61
|
case se:
|
|
62
|
-
return
|
|
63
|
-
case
|
|
64
|
-
|
|
62
|
+
return w = p.displayName || null, w !== null ? w : o(p.type) || "Memo";
|
|
63
|
+
case D:
|
|
64
|
+
w = p._payload, p = p._init;
|
|
65
65
|
try {
|
|
66
|
-
return o(p(
|
|
66
|
+
return o(p(w));
|
|
67
67
|
} catch {
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -72,35 +72,35 @@ function at() {
|
|
|
72
72
|
function e(p) {
|
|
73
73
|
return "" + p;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function s(p) {
|
|
76
76
|
try {
|
|
77
77
|
e(p);
|
|
78
|
-
var
|
|
78
|
+
var w = !1;
|
|
79
79
|
} catch {
|
|
80
|
-
|
|
80
|
+
w = !0;
|
|
81
81
|
}
|
|
82
|
-
if (
|
|
83
|
-
|
|
84
|
-
var _ =
|
|
82
|
+
if (w) {
|
|
83
|
+
w = console;
|
|
84
|
+
var _ = w.error, P = typeof Symbol == "function" && Symbol.toStringTag && p[Symbol.toStringTag] || p.constructor.name || "Object";
|
|
85
85
|
return _.call(
|
|
86
|
-
|
|
86
|
+
w,
|
|
87
87
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
88
88
|
P
|
|
89
89
|
), e(p);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function t(p) {
|
|
93
93
|
if (p === b) return "<>";
|
|
94
|
-
if (typeof p == "object" && p !== null && p.$$typeof ===
|
|
94
|
+
if (typeof p == "object" && p !== null && p.$$typeof === D)
|
|
95
95
|
return "<...>";
|
|
96
96
|
try {
|
|
97
|
-
var
|
|
98
|
-
return
|
|
97
|
+
var w = o(p);
|
|
98
|
+
return w ? "<" + w + ">" : "<...>";
|
|
99
99
|
} catch {
|
|
100
100
|
return "<...>";
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function n() {
|
|
104
104
|
var p = x.A;
|
|
105
105
|
return p === null ? null : p.getOwner();
|
|
106
106
|
}
|
|
@@ -109,16 +109,16 @@ function at() {
|
|
|
109
109
|
}
|
|
110
110
|
function i(p) {
|
|
111
111
|
if (S.call(p, "key")) {
|
|
112
|
-
var
|
|
113
|
-
if (
|
|
112
|
+
var w = Object.getOwnPropertyDescriptor(p, "key").get;
|
|
113
|
+
if (w && w.isReactWarning) return !1;
|
|
114
114
|
}
|
|
115
115
|
return p.key !== void 0;
|
|
116
116
|
}
|
|
117
|
-
function a(p,
|
|
117
|
+
function a(p, w) {
|
|
118
118
|
function _() {
|
|
119
|
-
|
|
119
|
+
I || (I = !0, console.error(
|
|
120
120
|
"%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://react.dev/link/special-props)",
|
|
121
|
-
|
|
121
|
+
w
|
|
122
122
|
));
|
|
123
123
|
}
|
|
124
124
|
_.isReactWarning = !0, Object.defineProperty(p, "key", {
|
|
@@ -126,23 +126,23 @@ function at() {
|
|
|
126
126
|
configurable: !0
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function c() {
|
|
130
130
|
var p = o(this.type);
|
|
131
|
-
return
|
|
131
|
+
return q[p] || (q[p] = !0, console.error(
|
|
132
132
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
133
133
|
)), p = this.props.ref, p !== void 0 ? p : null;
|
|
134
134
|
}
|
|
135
|
-
function u(p,
|
|
135
|
+
function u(p, w, _, P, ie, Me) {
|
|
136
136
|
var T = _.ref;
|
|
137
137
|
return p = {
|
|
138
138
|
$$typeof: g,
|
|
139
139
|
type: p,
|
|
140
|
-
key:
|
|
140
|
+
key: w,
|
|
141
141
|
props: _,
|
|
142
142
|
_owner: P
|
|
143
143
|
}, (T !== void 0 ? T : null) !== null ? Object.defineProperty(p, "ref", {
|
|
144
144
|
enumerable: !1,
|
|
145
|
-
get:
|
|
145
|
+
get: c
|
|
146
146
|
}) : Object.defineProperty(p, "ref", { enumerable: !1, value: null }), p._store = {}, Object.defineProperty(p._store, "validated", {
|
|
147
147
|
configurable: !1,
|
|
148
148
|
enumerable: !1,
|
|
@@ -162,14 +162,14 @@ function at() {
|
|
|
162
162
|
configurable: !1,
|
|
163
163
|
enumerable: !1,
|
|
164
164
|
writable: !0,
|
|
165
|
-
value:
|
|
165
|
+
value: Me
|
|
166
166
|
}), Object.freeze && (Object.freeze(p.props), Object.freeze(p)), p;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
var T =
|
|
168
|
+
function l(p, w, _, P, ie, Me) {
|
|
169
|
+
var T = w.children;
|
|
170
170
|
if (T !== void 0)
|
|
171
171
|
if (P)
|
|
172
|
-
if (
|
|
172
|
+
if ($(T)) {
|
|
173
173
|
for (P = 0; P < T.length; P++)
|
|
174
174
|
h(T[P]);
|
|
175
175
|
Object.freeze && Object.freeze(T);
|
|
@@ -178,12 +178,12 @@ function at() {
|
|
|
178
178
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
179
179
|
);
|
|
180
180
|
else h(T);
|
|
181
|
-
if (S.call(
|
|
181
|
+
if (S.call(w, "key")) {
|
|
182
182
|
T = o(p);
|
|
183
|
-
var
|
|
183
|
+
var G = Object.keys(w).filter(function(tt) {
|
|
184
184
|
return tt !== "key";
|
|
185
185
|
});
|
|
186
|
-
P = 0 <
|
|
186
|
+
P = 0 < G.length ? "{key: someKey, " + G.join(": ..., ") + ": ...}" : "{key: someKey}", B[T + P] || (G = 0 < G.length ? "{" + G.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
187
187
|
`A props object containing a "key" prop is being spread into JSX:
|
|
188
188
|
let props = %s;
|
|
189
189
|
<%s {...props} />
|
|
@@ -192,15 +192,15 @@ React keys must be passed directly to JSX without using spread:
|
|
|
192
192
|
<%s key={someKey} {...props} />`,
|
|
193
193
|
P,
|
|
194
194
|
T,
|
|
195
|
-
|
|
195
|
+
G,
|
|
196
196
|
T
|
|
197
|
-
),
|
|
197
|
+
), B[T + P] = !0);
|
|
198
198
|
}
|
|
199
|
-
if (T = null, _ !== void 0 && (
|
|
199
|
+
if (T = null, _ !== void 0 && (s(_), T = "" + _), i(w) && (s(w.key), T = "" + w.key), "key" in w) {
|
|
200
200
|
_ = {};
|
|
201
|
-
for (var ye in
|
|
202
|
-
ye !== "key" && (_[ye] =
|
|
203
|
-
} else _ =
|
|
201
|
+
for (var ye in w)
|
|
202
|
+
ye !== "key" && (_[ye] = w[ye]);
|
|
203
|
+
} else _ = w;
|
|
204
204
|
return T && a(
|
|
205
205
|
_,
|
|
206
206
|
typeof p == "function" ? p.displayName || p.name || "Unknown" : p
|
|
@@ -208,18 +208,18 @@ React keys must be passed directly to JSX without using spread:
|
|
|
208
208
|
p,
|
|
209
209
|
T,
|
|
210
210
|
_,
|
|
211
|
-
|
|
211
|
+
n(),
|
|
212
212
|
ie,
|
|
213
|
-
|
|
213
|
+
Me
|
|
214
214
|
);
|
|
215
215
|
}
|
|
216
216
|
function h(p) {
|
|
217
|
-
f(p) ? p._store && (p._store.validated = 1) : typeof p == "object" && p !== null && p.$$typeof ===
|
|
217
|
+
f(p) ? p._store && (p._store.validated = 1) : typeof p == "object" && p !== null && p.$$typeof === D && (p._payload.status === "fulfilled" ? f(p._payload.value) && p._payload.value._store && (p._payload.value._store.validated = 1) : p._store && (p._store.validated = 1));
|
|
218
218
|
}
|
|
219
219
|
function f(p) {
|
|
220
220
|
return typeof p == "object" && p !== null && p.$$typeof === g;
|
|
221
221
|
}
|
|
222
|
-
var d = st, g = /* @__PURE__ */ Symbol.for("react.transitional.element"), m = /* @__PURE__ */ Symbol.for("react.portal"), b = /* @__PURE__ */ Symbol.for("react.fragment"), v = /* @__PURE__ */ Symbol.for("react.strict_mode"), y = /* @__PURE__ */ Symbol.for("react.profiler"),
|
|
222
|
+
var d = st, g = /* @__PURE__ */ Symbol.for("react.transitional.element"), m = /* @__PURE__ */ Symbol.for("react.portal"), b = /* @__PURE__ */ Symbol.for("react.fragment"), v = /* @__PURE__ */ Symbol.for("react.strict_mode"), y = /* @__PURE__ */ Symbol.for("react.profiler"), C = /* @__PURE__ */ Symbol.for("react.consumer"), z = /* @__PURE__ */ Symbol.for("react.context"), N = /* @__PURE__ */ Symbol.for("react.forward_ref"), ee = /* @__PURE__ */ Symbol.for("react.suspense"), te = /* @__PURE__ */ Symbol.for("react.suspense_list"), se = /* @__PURE__ */ Symbol.for("react.memo"), D = /* @__PURE__ */ Symbol.for("react.lazy"), ne = /* @__PURE__ */ Symbol.for("react.activity"), re = /* @__PURE__ */ Symbol.for("react.client.reference"), x = d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, S = Object.prototype.hasOwnProperty, $ = Array.isArray, W = console.createTask ? console.createTask : function() {
|
|
223
223
|
return null;
|
|
224
224
|
};
|
|
225
225
|
d = {
|
|
@@ -227,79 +227,79 @@ React keys must be passed directly to JSX without using spread:
|
|
|
227
227
|
return p();
|
|
228
228
|
}
|
|
229
229
|
};
|
|
230
|
-
var
|
|
230
|
+
var I, q = {}, oe = d.react_stack_bottom_frame.bind(
|
|
231
231
|
d,
|
|
232
232
|
r
|
|
233
|
-
)(), ae =
|
|
234
|
-
|
|
233
|
+
)(), ae = W(t(r)), B = {};
|
|
234
|
+
X.Fragment = b, X.jsx = function(p, w, _) {
|
|
235
235
|
var P = 1e4 > x.recentlyCreatedOwnerStacks++;
|
|
236
|
-
return
|
|
236
|
+
return l(
|
|
237
237
|
p,
|
|
238
|
-
|
|
238
|
+
w,
|
|
239
239
|
_,
|
|
240
240
|
!1,
|
|
241
241
|
P ? Error("react-stack-top-frame") : oe,
|
|
242
|
-
P ?
|
|
242
|
+
P ? W(t(p)) : ae
|
|
243
243
|
);
|
|
244
|
-
},
|
|
244
|
+
}, X.jsxs = function(p, w, _) {
|
|
245
245
|
var P = 1e4 > x.recentlyCreatedOwnerStacks++;
|
|
246
|
-
return
|
|
246
|
+
return l(
|
|
247
247
|
p,
|
|
248
|
-
|
|
248
|
+
w,
|
|
249
249
|
_,
|
|
250
250
|
!0,
|
|
251
251
|
P ? Error("react-stack-top-frame") : oe,
|
|
252
|
-
P ?
|
|
252
|
+
P ? W(t(p)) : ae
|
|
253
253
|
);
|
|
254
254
|
};
|
|
255
|
-
})()),
|
|
255
|
+
})()), X;
|
|
256
256
|
}
|
|
257
|
-
var
|
|
257
|
+
var ze;
|
|
258
258
|
function it() {
|
|
259
|
-
return
|
|
259
|
+
return ze || (ze = 1, process.env.NODE_ENV === "production" ? ce.exports = ot() : ce.exports = at()), ce.exports;
|
|
260
260
|
}
|
|
261
|
-
var
|
|
262
|
-
function Te(o, e,
|
|
261
|
+
var M = it();
|
|
262
|
+
function Te(o, e, s) {
|
|
263
263
|
if (o && o.length) {
|
|
264
|
-
const [
|
|
265
|
-
for (const
|
|
266
|
-
const [u,
|
|
267
|
-
|
|
264
|
+
const [t, n] = e, r = Math.PI / 180 * s, i = Math.cos(r), a = Math.sin(r);
|
|
265
|
+
for (const c of o) {
|
|
266
|
+
const [u, l] = c;
|
|
267
|
+
c[0] = (u - t) * i - (l - n) * a + t, c[1] = (u - t) * a + (l - n) * i + n;
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
|
-
function ct(o, e,
|
|
272
|
-
const
|
|
273
|
-
o.forEach((
|
|
271
|
+
function ct(o, e, s) {
|
|
272
|
+
const t = [];
|
|
273
|
+
o.forEach((n) => t.push(...n)), Te(t, e, s);
|
|
274
274
|
}
|
|
275
275
|
function lt(o, e) {
|
|
276
276
|
return o[0] === e[0] && o[1] === e[1];
|
|
277
277
|
}
|
|
278
|
-
function ut(o, e,
|
|
279
|
-
const
|
|
280
|
-
if (
|
|
278
|
+
function ut(o, e, s, t = 1) {
|
|
279
|
+
const n = s, r = Math.max(e, 0.1), i = o[0] && o[0][0] && typeof o[0][0] == "number" ? [o] : o, a = [0, 0];
|
|
280
|
+
if (n)
|
|
281
281
|
for (const u of i)
|
|
282
|
-
Te(u, a,
|
|
283
|
-
const
|
|
284
|
-
if (
|
|
282
|
+
Te(u, a, n);
|
|
283
|
+
const c = ht(i, r, t);
|
|
284
|
+
if (n) {
|
|
285
285
|
for (const u of i)
|
|
286
|
-
Te(u, a, -
|
|
287
|
-
ct(
|
|
286
|
+
Te(u, a, -n);
|
|
287
|
+
ct(c, a, -n);
|
|
288
288
|
}
|
|
289
|
-
return
|
|
289
|
+
return c;
|
|
290
290
|
}
|
|
291
|
-
function ht(o, e,
|
|
292
|
-
const
|
|
291
|
+
function ht(o, e, s) {
|
|
292
|
+
const t = [];
|
|
293
293
|
for (const u of o) {
|
|
294
|
-
const
|
|
295
|
-
lt(
|
|
294
|
+
const l = [...u];
|
|
295
|
+
lt(l[0], l[l.length - 1]) || l.push([l[0][0], l[0][1]]), l.length > 2 && t.push(l);
|
|
296
296
|
}
|
|
297
|
-
const
|
|
297
|
+
const n = [];
|
|
298
298
|
e = Math.max(e, 0.1);
|
|
299
299
|
const r = [];
|
|
300
|
-
for (const u of
|
|
301
|
-
for (let
|
|
302
|
-
const h = u[
|
|
300
|
+
for (const u of t)
|
|
301
|
+
for (let l = 0; l < u.length - 1; l++) {
|
|
302
|
+
const h = u[l], f = u[l + 1];
|
|
303
303
|
if (h[1] !== f[1]) {
|
|
304
304
|
const d = Math.min(h[1], f[1]);
|
|
305
305
|
r.push({
|
|
@@ -310,9 +310,9 @@ function ht(o, e, n) {
|
|
|
310
310
|
});
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
|
-
if (r.sort((u,
|
|
314
|
-
return
|
|
315
|
-
let i = [], a = r[0].ymin,
|
|
313
|
+
if (r.sort((u, l) => u.ymin < l.ymin ? -1 : u.ymin > l.ymin ? 1 : u.x < l.x ? -1 : u.x > l.x ? 1 : u.ymax === l.ymax ? 0 : (u.ymax - l.ymax) / Math.abs(u.ymax - l.ymax)), !r.length)
|
|
314
|
+
return n;
|
|
315
|
+
let i = [], a = r[0].ymin, c = 0;
|
|
316
316
|
for (; i.length || r.length; ) {
|
|
317
317
|
if (r.length) {
|
|
318
318
|
let u = -1;
|
|
@@ -322,119 +322,119 @@ function ht(o, e, n) {
|
|
|
322
322
|
i.push({ s: a, edge: h });
|
|
323
323
|
});
|
|
324
324
|
}
|
|
325
|
-
if (i = i.filter((u) => !(u.edge.ymax <= a)), i.sort((u,
|
|
325
|
+
if (i = i.filter((u) => !(u.edge.ymax <= a)), i.sort((u, l) => u.edge.x === l.edge.x ? 0 : (u.edge.x - l.edge.x) / Math.abs(u.edge.x - l.edge.x)), (s !== 1 || c % e === 0) && i.length > 1)
|
|
326
326
|
for (let u = 0; u < i.length; u = u + 2) {
|
|
327
|
-
const
|
|
328
|
-
if (
|
|
327
|
+
const l = u + 1;
|
|
328
|
+
if (l >= i.length)
|
|
329
329
|
break;
|
|
330
|
-
const h = i[u].edge, f = i[
|
|
331
|
-
|
|
330
|
+
const h = i[u].edge, f = i[l].edge;
|
|
331
|
+
n.push([
|
|
332
332
|
[Math.round(h.x), a],
|
|
333
333
|
[Math.round(f.x), a]
|
|
334
334
|
]);
|
|
335
335
|
}
|
|
336
|
-
a +=
|
|
337
|
-
u.edge.x = u.edge.x +
|
|
338
|
-
}),
|
|
336
|
+
a += s, i.forEach((u) => {
|
|
337
|
+
u.edge.x = u.edge.x + s * u.edge.islope;
|
|
338
|
+
}), c++;
|
|
339
339
|
}
|
|
340
|
-
return
|
|
340
|
+
return n;
|
|
341
341
|
}
|
|
342
|
-
function
|
|
343
|
-
var
|
|
344
|
-
const
|
|
345
|
-
let
|
|
346
|
-
|
|
342
|
+
function J(o, e) {
|
|
343
|
+
var s;
|
|
344
|
+
const t = e.hachureAngle + 90;
|
|
345
|
+
let n = e.hachureGap;
|
|
346
|
+
n < 0 && (n = e.strokeWidth * 4), n = Math.round(Math.max(n, 0.1));
|
|
347
347
|
let r = 1;
|
|
348
|
-
return e.roughness >= 1 && (((
|
|
348
|
+
return e.roughness >= 1 && (((s = e.randomizer) === null || s === void 0 ? void 0 : s.next()) || Math.random()) > 0.7 && (r = n), ut(o, n, t, r || 1);
|
|
349
349
|
}
|
|
350
350
|
class Le {
|
|
351
351
|
constructor(e) {
|
|
352
352
|
this.helper = e;
|
|
353
353
|
}
|
|
354
|
-
fillPolygons(e,
|
|
355
|
-
return this._fillPolygons(e,
|
|
354
|
+
fillPolygons(e, s) {
|
|
355
|
+
return this._fillPolygons(e, s);
|
|
356
356
|
}
|
|
357
|
-
_fillPolygons(e,
|
|
358
|
-
const
|
|
359
|
-
return { type: "fillSketch", ops: this.renderLines(
|
|
357
|
+
_fillPolygons(e, s) {
|
|
358
|
+
const t = J(e, s);
|
|
359
|
+
return { type: "fillSketch", ops: this.renderLines(t, s) };
|
|
360
360
|
}
|
|
361
|
-
renderLines(e,
|
|
362
|
-
const
|
|
363
|
-
for (const
|
|
364
|
-
|
|
365
|
-
return
|
|
361
|
+
renderLines(e, s) {
|
|
362
|
+
const t = [];
|
|
363
|
+
for (const n of e)
|
|
364
|
+
t.push(...this.helper.doubleLineOps(n[0][0], n[0][1], n[1][0], n[1][1], s));
|
|
365
|
+
return t;
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
|
-
function
|
|
369
|
-
const e = o[0],
|
|
370
|
-
return Math.sqrt(Math.pow(e[0] -
|
|
368
|
+
function we(o) {
|
|
369
|
+
const e = o[0], s = o[1];
|
|
370
|
+
return Math.sqrt(Math.pow(e[0] - s[0], 2) + Math.pow(e[1] - s[1], 2));
|
|
371
371
|
}
|
|
372
372
|
class ft extends Le {
|
|
373
|
-
fillPolygons(e,
|
|
374
|
-
let
|
|
375
|
-
|
|
376
|
-
const
|
|
373
|
+
fillPolygons(e, s) {
|
|
374
|
+
let t = s.hachureGap;
|
|
375
|
+
t < 0 && (t = s.strokeWidth * 4), t = Math.max(t, 0.1);
|
|
376
|
+
const n = Object.assign({}, s, { hachureGap: t }), r = J(e, n), i = Math.PI / 180 * s.hachureAngle, a = [], c = t * 0.5 * Math.cos(i), u = t * 0.5 * Math.sin(i);
|
|
377
377
|
for (const [h, f] of r)
|
|
378
|
-
|
|
379
|
-
[h[0] -
|
|
378
|
+
we([h, f]) && a.push([
|
|
379
|
+
[h[0] - c, h[1] + u],
|
|
380
380
|
[...f]
|
|
381
381
|
], [
|
|
382
|
-
[h[0] +
|
|
382
|
+
[h[0] + c, h[1] - u],
|
|
383
383
|
[...f]
|
|
384
384
|
]);
|
|
385
|
-
return { type: "fillSketch", ops: this.renderLines(a,
|
|
385
|
+
return { type: "fillSketch", ops: this.renderLines(a, s) };
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
388
|
class dt extends Le {
|
|
389
|
-
fillPolygons(e,
|
|
390
|
-
const
|
|
391
|
-
return
|
|
389
|
+
fillPolygons(e, s) {
|
|
390
|
+
const t = this._fillPolygons(e, s), n = Object.assign({}, s, { hachureAngle: s.hachureAngle + 90 }), r = this._fillPolygons(e, n);
|
|
391
|
+
return t.ops = t.ops.concat(r.ops), t;
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
394
|
class pt {
|
|
395
395
|
constructor(e) {
|
|
396
396
|
this.helper = e;
|
|
397
397
|
}
|
|
398
|
-
fillPolygons(e,
|
|
399
|
-
|
|
400
|
-
const
|
|
401
|
-
return this.dotsOnLines(
|
|
402
|
-
}
|
|
403
|
-
dotsOnLines(e,
|
|
404
|
-
const
|
|
405
|
-
let
|
|
406
|
-
|
|
407
|
-
let r =
|
|
408
|
-
r < 0 && (r =
|
|
409
|
-
const i =
|
|
398
|
+
fillPolygons(e, s) {
|
|
399
|
+
s = Object.assign({}, s, { hachureAngle: 0 });
|
|
400
|
+
const t = J(e, s);
|
|
401
|
+
return this.dotsOnLines(t, s);
|
|
402
|
+
}
|
|
403
|
+
dotsOnLines(e, s) {
|
|
404
|
+
const t = [];
|
|
405
|
+
let n = s.hachureGap;
|
|
406
|
+
n < 0 && (n = s.strokeWidth * 4), n = Math.max(n, 0.1);
|
|
407
|
+
let r = s.fillWeight;
|
|
408
|
+
r < 0 && (r = s.strokeWidth / 2);
|
|
409
|
+
const i = n / 4;
|
|
410
410
|
for (const a of e) {
|
|
411
|
-
const
|
|
412
|
-
for (let g = 0; g <
|
|
413
|
-
const m = d + h + g *
|
|
414
|
-
|
|
411
|
+
const c = we(a), u = c / n, l = Math.ceil(u) - 1, h = c - l * n, f = (a[0][0] + a[1][0]) / 2 - n / 4, d = Math.min(a[0][1], a[1][1]);
|
|
412
|
+
for (let g = 0; g < l; g++) {
|
|
413
|
+
const m = d + h + g * n, b = f - i + Math.random() * 2 * i, v = m - i + Math.random() * 2 * i, y = this.helper.ellipse(b, v, r, r, s);
|
|
414
|
+
t.push(...y.ops);
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
return { type: "fillSketch", ops:
|
|
417
|
+
return { type: "fillSketch", ops: t };
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
420
|
class gt {
|
|
421
421
|
constructor(e) {
|
|
422
422
|
this.helper = e;
|
|
423
423
|
}
|
|
424
|
-
fillPolygons(e,
|
|
425
|
-
const
|
|
426
|
-
return { type: "fillSketch", ops: this.dashedLine(
|
|
424
|
+
fillPolygons(e, s) {
|
|
425
|
+
const t = J(e, s);
|
|
426
|
+
return { type: "fillSketch", ops: this.dashedLine(t, s) };
|
|
427
427
|
}
|
|
428
|
-
dashedLine(e,
|
|
429
|
-
const
|
|
428
|
+
dashedLine(e, s) {
|
|
429
|
+
const t = s.dashOffset < 0 ? s.hachureGap < 0 ? s.strokeWidth * 4 : s.hachureGap : s.dashOffset, n = s.dashGap < 0 ? s.hachureGap < 0 ? s.strokeWidth * 4 : s.hachureGap : s.dashGap, r = [];
|
|
430
430
|
return e.forEach((i) => {
|
|
431
|
-
const a =
|
|
432
|
-
let
|
|
433
|
-
|
|
434
|
-
const f = Math.atan((h[1] -
|
|
435
|
-
for (let d = 0; d <
|
|
436
|
-
const g = d * (
|
|
437
|
-
r.push(...this.helper.doubleLineOps(b[0], b[1], v[0], v[1],
|
|
431
|
+
const a = we(i), c = Math.floor(a / (t + n)), u = (a + n - c * (t + n)) / 2;
|
|
432
|
+
let l = i[0], h = i[1];
|
|
433
|
+
l[0] > h[0] && (l = i[1], h = i[0]);
|
|
434
|
+
const f = Math.atan((h[1] - l[1]) / (h[0] - l[0]));
|
|
435
|
+
for (let d = 0; d < c; d++) {
|
|
436
|
+
const g = d * (t + n), m = g + t, b = [l[0] + g * Math.cos(f) + u * Math.cos(f), l[1] + g * Math.sin(f) + u * Math.sin(f)], v = [l[0] + m * Math.cos(f) + u * Math.cos(f), l[1] + m * Math.sin(f) + u * Math.sin(f)];
|
|
437
|
+
r.push(...this.helper.doubleLineOps(b[0], b[1], v[0], v[1], s));
|
|
438
438
|
}
|
|
439
439
|
}), r;
|
|
440
440
|
}
|
|
@@ -443,51 +443,51 @@ class mt {
|
|
|
443
443
|
constructor(e) {
|
|
444
444
|
this.helper = e;
|
|
445
445
|
}
|
|
446
|
-
fillPolygons(e,
|
|
447
|
-
const
|
|
448
|
-
|
|
449
|
-
const r =
|
|
450
|
-
return { type: "fillSketch", ops: this.zigzagLines(r,
|
|
446
|
+
fillPolygons(e, s) {
|
|
447
|
+
const t = s.hachureGap < 0 ? s.strokeWidth * 4 : s.hachureGap, n = s.zigzagOffset < 0 ? t : s.zigzagOffset;
|
|
448
|
+
s = Object.assign({}, s, { hachureGap: t + n });
|
|
449
|
+
const r = J(e, s);
|
|
450
|
+
return { type: "fillSketch", ops: this.zigzagLines(r, n, s) };
|
|
451
451
|
}
|
|
452
|
-
zigzagLines(e,
|
|
453
|
-
const
|
|
452
|
+
zigzagLines(e, s, t) {
|
|
453
|
+
const n = [];
|
|
454
454
|
return e.forEach((r) => {
|
|
455
|
-
const i =
|
|
456
|
-
let
|
|
457
|
-
|
|
458
|
-
const
|
|
455
|
+
const i = we(r), a = Math.round(i / (2 * s));
|
|
456
|
+
let c = r[0], u = r[1];
|
|
457
|
+
c[0] > u[0] && (c = r[1], u = r[0]);
|
|
458
|
+
const l = Math.atan((u[1] - c[1]) / (u[0] - c[0]));
|
|
459
459
|
for (let h = 0; h < a; h++) {
|
|
460
|
-
const f = h * 2 *
|
|
461
|
-
|
|
460
|
+
const f = h * 2 * s, d = (h + 1) * 2 * s, g = Math.sqrt(2 * Math.pow(s, 2)), m = [c[0] + f * Math.cos(l), c[1] + f * Math.sin(l)], b = [c[0] + d * Math.cos(l), c[1] + d * Math.sin(l)], v = [m[0] + g * Math.cos(l + Math.PI / 4), m[1] + g * Math.sin(l + Math.PI / 4)];
|
|
461
|
+
n.push(...this.helper.doubleLineOps(m[0], m[1], v[0], v[1], t), ...this.helper.doubleLineOps(v[0], v[1], b[0], b[1], t));
|
|
462
462
|
}
|
|
463
|
-
}),
|
|
463
|
+
}), n;
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
|
-
const
|
|
466
|
+
const E = {};
|
|
467
467
|
function kt(o, e) {
|
|
468
|
-
let
|
|
469
|
-
if (!
|
|
470
|
-
switch (
|
|
468
|
+
let s = o.fillStyle || "hachure";
|
|
469
|
+
if (!E[s])
|
|
470
|
+
switch (s) {
|
|
471
471
|
case "zigzag":
|
|
472
|
-
|
|
472
|
+
E[s] || (E[s] = new ft(e));
|
|
473
473
|
break;
|
|
474
474
|
case "cross-hatch":
|
|
475
|
-
|
|
475
|
+
E[s] || (E[s] = new dt(e));
|
|
476
476
|
break;
|
|
477
477
|
case "dots":
|
|
478
|
-
|
|
478
|
+
E[s] || (E[s] = new pt(e));
|
|
479
479
|
break;
|
|
480
480
|
case "dashed":
|
|
481
|
-
|
|
481
|
+
E[s] || (E[s] = new gt(e));
|
|
482
482
|
break;
|
|
483
483
|
case "zigzag-line":
|
|
484
|
-
|
|
484
|
+
E[s] || (E[s] = new mt(e));
|
|
485
485
|
break;
|
|
486
486
|
default:
|
|
487
|
-
|
|
487
|
+
s = "hachure", E[s] || (E[s] = new Le(e));
|
|
488
488
|
break;
|
|
489
489
|
}
|
|
490
|
-
return
|
|
490
|
+
return E[s];
|
|
491
491
|
}
|
|
492
492
|
function bt() {
|
|
493
493
|
return Math.floor(Math.random() * 2 ** 31);
|
|
@@ -500,14 +500,14 @@ class vt {
|
|
|
500
500
|
return this.seed ? (2 ** 31 - 1 & (this.seed = Math.imul(48271, this.seed))) / 2 ** 31 : Math.random();
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
|
-
const
|
|
504
|
-
function
|
|
503
|
+
const wt = 0, xe = 1, Be = 2, le = { A: 7, a: 7, C: 6, c: 6, H: 1, h: 1, L: 2, l: 2, M: 2, m: 2, Q: 4, q: 4, S: 4, s: 4, T: 2, t: 2, V: 1, v: 1, Z: 0, z: 0 };
|
|
504
|
+
function Mt(o) {
|
|
505
505
|
const e = new Array();
|
|
506
506
|
for (; o !== ""; )
|
|
507
507
|
if (o.match(/^([ \t\r\n,]+)/))
|
|
508
508
|
o = o.substr(RegExp.$1.length);
|
|
509
509
|
else if (o.match(/^([aAcChHlLmMqQsStTvVzZ])/))
|
|
510
|
-
e[e.length] = { type:
|
|
510
|
+
e[e.length] = { type: wt, text: RegExp.$1 }, o = o.substr(RegExp.$1.length);
|
|
511
511
|
else if (o.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))
|
|
512
512
|
e[e.length] = { type: xe, text: `${parseFloat(RegExp.$1)}` }, o = o.substr(RegExp.$1.length);
|
|
513
513
|
else
|
|
@@ -518,73 +518,73 @@ function _e(o, e) {
|
|
|
518
518
|
return o.type === e;
|
|
519
519
|
}
|
|
520
520
|
function Ae(o) {
|
|
521
|
-
const e = [],
|
|
522
|
-
let
|
|
521
|
+
const e = [], s = Mt(o);
|
|
522
|
+
let t = "BOD", n = 0, r = s[n];
|
|
523
523
|
for (; !_e(r, Be); ) {
|
|
524
524
|
let i = 0;
|
|
525
525
|
const a = [];
|
|
526
|
-
if (
|
|
526
|
+
if (t === "BOD")
|
|
527
527
|
if (r.text === "M" || r.text === "m")
|
|
528
|
-
|
|
528
|
+
n++, i = le[r.text], t = r.text;
|
|
529
529
|
else
|
|
530
530
|
return Ae("M0,0" + o);
|
|
531
|
-
else _e(r, xe) ? i = le[
|
|
532
|
-
if (
|
|
533
|
-
for (let
|
|
534
|
-
const u =
|
|
531
|
+
else _e(r, xe) ? i = le[t] : (n++, i = le[r.text], t = r.text);
|
|
532
|
+
if (n + i < s.length) {
|
|
533
|
+
for (let c = n; c < n + i; c++) {
|
|
534
|
+
const u = s[c];
|
|
535
535
|
if (_e(u, xe))
|
|
536
536
|
a[a.length] = +u.text;
|
|
537
537
|
else
|
|
538
|
-
throw new Error("Param not a number: " +
|
|
538
|
+
throw new Error("Param not a number: " + t + "," + u.text);
|
|
539
539
|
}
|
|
540
|
-
if (typeof le[
|
|
541
|
-
const
|
|
542
|
-
e.push(
|
|
540
|
+
if (typeof le[t] == "number") {
|
|
541
|
+
const c = { key: t, data: a };
|
|
542
|
+
e.push(c), n += i, r = s[n], t === "M" && (t = "L"), t === "m" && (t = "l");
|
|
543
543
|
} else
|
|
544
|
-
throw new Error("Bad segment: " +
|
|
544
|
+
throw new Error("Bad segment: " + t);
|
|
545
545
|
} else
|
|
546
546
|
throw new Error("Path data ended short");
|
|
547
547
|
}
|
|
548
548
|
return e;
|
|
549
549
|
}
|
|
550
550
|
function Ze(o) {
|
|
551
|
-
let e = 0,
|
|
551
|
+
let e = 0, s = 0, t = 0, n = 0;
|
|
552
552
|
const r = [];
|
|
553
553
|
for (const { key: i, data: a } of o)
|
|
554
554
|
switch (i) {
|
|
555
555
|
case "M":
|
|
556
|
-
r.push({ key: "M", data: [...a] }), [e,
|
|
556
|
+
r.push({ key: "M", data: [...a] }), [e, s] = a, [t, n] = a;
|
|
557
557
|
break;
|
|
558
558
|
case "m":
|
|
559
|
-
e += a[0],
|
|
559
|
+
e += a[0], s += a[1], r.push({ key: "M", data: [e, s] }), t = e, n = s;
|
|
560
560
|
break;
|
|
561
561
|
case "L":
|
|
562
|
-
r.push({ key: "L", data: [...a] }), [e,
|
|
562
|
+
r.push({ key: "L", data: [...a] }), [e, s] = a;
|
|
563
563
|
break;
|
|
564
564
|
case "l":
|
|
565
|
-
e += a[0],
|
|
565
|
+
e += a[0], s += a[1], r.push({ key: "L", data: [e, s] });
|
|
566
566
|
break;
|
|
567
567
|
case "C":
|
|
568
|
-
r.push({ key: "C", data: [...a] }), e = a[4],
|
|
568
|
+
r.push({ key: "C", data: [...a] }), e = a[4], s = a[5];
|
|
569
569
|
break;
|
|
570
570
|
case "c": {
|
|
571
|
-
const
|
|
572
|
-
r.push({ key: "C", data:
|
|
571
|
+
const c = a.map((u, l) => l % 2 ? u + s : u + e);
|
|
572
|
+
r.push({ key: "C", data: c }), e = c[4], s = c[5];
|
|
573
573
|
break;
|
|
574
574
|
}
|
|
575
575
|
case "Q":
|
|
576
|
-
r.push({ key: "Q", data: [...a] }), e = a[2],
|
|
576
|
+
r.push({ key: "Q", data: [...a] }), e = a[2], s = a[3];
|
|
577
577
|
break;
|
|
578
578
|
case "q": {
|
|
579
|
-
const
|
|
580
|
-
r.push({ key: "Q", data:
|
|
579
|
+
const c = a.map((u, l) => l % 2 ? u + s : u + e);
|
|
580
|
+
r.push({ key: "Q", data: c }), e = c[2], s = c[3];
|
|
581
581
|
break;
|
|
582
582
|
}
|
|
583
583
|
case "A":
|
|
584
|
-
r.push({ key: "A", data: [...a] }), e = a[5],
|
|
584
|
+
r.push({ key: "A", data: [...a] }), e = a[5], s = a[6];
|
|
585
585
|
break;
|
|
586
586
|
case "a":
|
|
587
|
-
e += a[5],
|
|
587
|
+
e += a[5], s += a[6], r.push({ key: "A", data: [a[0], a[1], a[2], a[3], a[4], e, s] });
|
|
588
588
|
break;
|
|
589
589
|
case "H":
|
|
590
590
|
r.push({ key: "H", data: [...a] }), e = a[0];
|
|
@@ -593,120 +593,120 @@ function Ze(o) {
|
|
|
593
593
|
e += a[0], r.push({ key: "H", data: [e] });
|
|
594
594
|
break;
|
|
595
595
|
case "V":
|
|
596
|
-
r.push({ key: "V", data: [...a] }),
|
|
596
|
+
r.push({ key: "V", data: [...a] }), s = a[0];
|
|
597
597
|
break;
|
|
598
598
|
case "v":
|
|
599
|
-
|
|
599
|
+
s += a[0], r.push({ key: "V", data: [s] });
|
|
600
600
|
break;
|
|
601
601
|
case "S":
|
|
602
|
-
r.push({ key: "S", data: [...a] }), e = a[2],
|
|
602
|
+
r.push({ key: "S", data: [...a] }), e = a[2], s = a[3];
|
|
603
603
|
break;
|
|
604
604
|
case "s": {
|
|
605
|
-
const
|
|
606
|
-
r.push({ key: "S", data:
|
|
605
|
+
const c = a.map((u, l) => l % 2 ? u + s : u + e);
|
|
606
|
+
r.push({ key: "S", data: c }), e = c[2], s = c[3];
|
|
607
607
|
break;
|
|
608
608
|
}
|
|
609
609
|
case "T":
|
|
610
|
-
r.push({ key: "T", data: [...a] }), e = a[0],
|
|
610
|
+
r.push({ key: "T", data: [...a] }), e = a[0], s = a[1];
|
|
611
611
|
break;
|
|
612
612
|
case "t":
|
|
613
|
-
e += a[0],
|
|
613
|
+
e += a[0], s += a[1], r.push({ key: "T", data: [e, s] });
|
|
614
614
|
break;
|
|
615
615
|
case "Z":
|
|
616
616
|
case "z":
|
|
617
|
-
r.push({ key: "Z", data: [] }), e =
|
|
617
|
+
r.push({ key: "Z", data: [] }), e = t, s = n;
|
|
618
618
|
break;
|
|
619
619
|
}
|
|
620
620
|
return r;
|
|
621
621
|
}
|
|
622
622
|
function Xe(o) {
|
|
623
623
|
const e = [];
|
|
624
|
-
let
|
|
625
|
-
for (const { key: u, data:
|
|
624
|
+
let s = "", t = 0, n = 0, r = 0, i = 0, a = 0, c = 0;
|
|
625
|
+
for (const { key: u, data: l } of o) {
|
|
626
626
|
switch (u) {
|
|
627
627
|
case "M":
|
|
628
|
-
e.push({ key: "M", data: [...
|
|
628
|
+
e.push({ key: "M", data: [...l] }), [t, n] = l, [r, i] = l;
|
|
629
629
|
break;
|
|
630
630
|
case "C":
|
|
631
|
-
e.push({ key: "C", data: [...
|
|
631
|
+
e.push({ key: "C", data: [...l] }), t = l[4], n = l[5], a = l[2], c = l[3];
|
|
632
632
|
break;
|
|
633
633
|
case "L":
|
|
634
|
-
e.push({ key: "L", data: [...
|
|
634
|
+
e.push({ key: "L", data: [...l] }), [t, n] = l;
|
|
635
635
|
break;
|
|
636
636
|
case "H":
|
|
637
|
-
|
|
637
|
+
t = l[0], e.push({ key: "L", data: [t, n] });
|
|
638
638
|
break;
|
|
639
639
|
case "V":
|
|
640
|
-
|
|
640
|
+
n = l[0], e.push({ key: "L", data: [t, n] });
|
|
641
641
|
break;
|
|
642
642
|
case "S": {
|
|
643
643
|
let h = 0, f = 0;
|
|
644
|
-
|
|
644
|
+
s === "C" || s === "S" ? (h = t + (t - a), f = n + (n - c)) : (h = t, f = n), e.push({ key: "C", data: [h, f, ...l] }), a = l[0], c = l[1], t = l[2], n = l[3];
|
|
645
645
|
break;
|
|
646
646
|
}
|
|
647
647
|
case "T": {
|
|
648
|
-
const [h, f] =
|
|
648
|
+
const [h, f] = l;
|
|
649
649
|
let d = 0, g = 0;
|
|
650
|
-
|
|
651
|
-
const m =
|
|
652
|
-
e.push({ key: "C", data: [m, b, v, y, h, f] }), a = d,
|
|
650
|
+
s === "Q" || s === "T" ? (d = t + (t - a), g = n + (n - c)) : (d = t, g = n);
|
|
651
|
+
const m = t + 2 * (d - t) / 3, b = n + 2 * (g - n) / 3, v = h + 2 * (d - h) / 3, y = f + 2 * (g - f) / 3;
|
|
652
|
+
e.push({ key: "C", data: [m, b, v, y, h, f] }), a = d, c = g, t = h, n = f;
|
|
653
653
|
break;
|
|
654
654
|
}
|
|
655
655
|
case "Q": {
|
|
656
|
-
const [h, f, d, g] =
|
|
657
|
-
e.push({ key: "C", data: [m, b, v, y, d, g] }), a = h,
|
|
656
|
+
const [h, f, d, g] = l, m = t + 2 * (h - t) / 3, b = n + 2 * (f - n) / 3, v = d + 2 * (h - d) / 3, y = g + 2 * (f - g) / 3;
|
|
657
|
+
e.push({ key: "C", data: [m, b, v, y, d, g] }), a = h, c = f, t = d, n = g;
|
|
658
658
|
break;
|
|
659
659
|
}
|
|
660
660
|
case "A": {
|
|
661
|
-
const h = Math.abs(
|
|
662
|
-
h === 0 || f === 0 ? (e.push({ key: "C", data: [
|
|
663
|
-
e.push({ key: "C", data:
|
|
664
|
-
}),
|
|
661
|
+
const h = Math.abs(l[0]), f = Math.abs(l[1]), d = l[2], g = l[3], m = l[4], b = l[5], v = l[6];
|
|
662
|
+
h === 0 || f === 0 ? (e.push({ key: "C", data: [t, n, b, v, b, v] }), t = b, n = v) : (t !== b || n !== v) && (Ue(t, n, b, v, h, f, d, g, m).forEach(function(C) {
|
|
663
|
+
e.push({ key: "C", data: C });
|
|
664
|
+
}), t = b, n = v);
|
|
665
665
|
break;
|
|
666
666
|
}
|
|
667
667
|
case "Z":
|
|
668
|
-
e.push({ key: "Z", data: [] }),
|
|
668
|
+
e.push({ key: "Z", data: [] }), t = r, n = i;
|
|
669
669
|
break;
|
|
670
670
|
}
|
|
671
|
-
|
|
671
|
+
s = u;
|
|
672
672
|
}
|
|
673
673
|
return e;
|
|
674
674
|
}
|
|
675
675
|
function yt(o) {
|
|
676
676
|
return Math.PI * o / 180;
|
|
677
677
|
}
|
|
678
|
-
function
|
|
679
|
-
const
|
|
680
|
-
return [
|
|
678
|
+
function U(o, e, s) {
|
|
679
|
+
const t = o * Math.cos(s) - e * Math.sin(s), n = o * Math.sin(s) + e * Math.cos(s);
|
|
680
|
+
return [t, n];
|
|
681
681
|
}
|
|
682
|
-
function Ue(o, e,
|
|
683
|
-
const
|
|
682
|
+
function Ue(o, e, s, t, n, r, i, a, c, u) {
|
|
683
|
+
const l = yt(i);
|
|
684
684
|
let h = [], f = 0, d = 0, g = 0, m = 0;
|
|
685
685
|
if (u)
|
|
686
686
|
[f, d, g, m] = u;
|
|
687
687
|
else {
|
|
688
|
-
[o, e] =
|
|
689
|
-
const x = (o -
|
|
690
|
-
let
|
|
691
|
-
|
|
692
|
-
const
|
|
693
|
-
g =
|
|
688
|
+
[o, e] = U(o, e, -l), [s, t] = U(s, t, -l);
|
|
689
|
+
const x = (o - s) / 2, S = (e - t) / 2;
|
|
690
|
+
let $ = x * x / (n * n) + S * S / (r * r);
|
|
691
|
+
$ > 1 && ($ = Math.sqrt($), n = $ * n, r = $ * r);
|
|
692
|
+
const W = a === c ? -1 : 1, I = n * n, q = r * r, oe = I * q - I * S * S - q * x * x, ae = I * S * S + q * x * x, B = W * Math.sqrt(Math.abs(oe / ae));
|
|
693
|
+
g = B * n * S / r + (o + s) / 2, m = B * -r * x / n + (e + t) / 2, f = Math.asin(parseFloat(((e - m) / r).toFixed(9))), d = Math.asin(parseFloat(((t - m) / r).toFixed(9))), o < g && (f = Math.PI - f), s < g && (d = Math.PI - d), f < 0 && (f = Math.PI * 2 + f), d < 0 && (d = Math.PI * 2 + d), c && f > d && (f = f - Math.PI * 2), !c && d > f && (d = d - Math.PI * 2);
|
|
694
694
|
}
|
|
695
695
|
let b = d - f;
|
|
696
696
|
if (Math.abs(b) > Math.PI * 120 / 180) {
|
|
697
|
-
const x = d, S =
|
|
698
|
-
|
|
697
|
+
const x = d, S = s, $ = t;
|
|
698
|
+
c && d > f ? d = f + Math.PI * 120 / 180 * 1 : d = f + Math.PI * 120 / 180 * -1, s = g + n * Math.cos(d), t = m + r * Math.sin(d), h = Ue(s, t, S, $, n, r, i, 0, c, [d, x, g, m]);
|
|
699
699
|
}
|
|
700
700
|
b = d - f;
|
|
701
|
-
const v = Math.cos(f), y = Math.sin(f),
|
|
702
|
-
if (
|
|
703
|
-
return [
|
|
701
|
+
const v = Math.cos(f), y = Math.sin(f), C = Math.cos(d), z = Math.sin(d), N = Math.tan(b / 4), ee = 4 / 3 * n * N, te = 4 / 3 * r * N, se = [o, e], D = [o + ee * y, e - te * v], ne = [s + ee * z, t - te * C], re = [s, t];
|
|
702
|
+
if (D[0] = 2 * se[0] - D[0], D[1] = 2 * se[1] - D[1], u)
|
|
703
|
+
return [D, ne, re].concat(h);
|
|
704
704
|
{
|
|
705
|
-
h = [
|
|
705
|
+
h = [D, ne, re].concat(h);
|
|
706
706
|
const x = [];
|
|
707
707
|
for (let S = 0; S < h.length; S += 3) {
|
|
708
|
-
const
|
|
709
|
-
x.push([
|
|
708
|
+
const $ = U(h[S][0], h[S][1], l), W = U(h[S + 1][0], h[S + 1][1], l), I = U(h[S + 2][0], h[S + 2][1], l);
|
|
709
|
+
x.push([$[0], $[1], W[0], W[1], I[0], I[1]]);
|
|
710
710
|
}
|
|
711
711
|
return x;
|
|
712
712
|
}
|
|
@@ -717,146 +717,146 @@ const _t = {
|
|
|
717
717
|
ellipse: Tt,
|
|
718
718
|
doubleLineOps: Rt
|
|
719
719
|
};
|
|
720
|
-
function Qe(o, e,
|
|
721
|
-
return { type: "path", ops:
|
|
722
|
-
}
|
|
723
|
-
function de(o, e,
|
|
724
|
-
const
|
|
725
|
-
if (
|
|
726
|
-
const
|
|
727
|
-
for (let r = 0; r <
|
|
728
|
-
|
|
729
|
-
return e &&
|
|
730
|
-
} else if (
|
|
731
|
-
return Qe(o[0][0], o[0][1], o[1][0], o[1][1],
|
|
720
|
+
function Qe(o, e, s, t, n) {
|
|
721
|
+
return { type: "path", ops: H(o, e, s, t, n) };
|
|
722
|
+
}
|
|
723
|
+
function de(o, e, s) {
|
|
724
|
+
const t = (o || []).length;
|
|
725
|
+
if (t > 2) {
|
|
726
|
+
const n = [];
|
|
727
|
+
for (let r = 0; r < t - 1; r++)
|
|
728
|
+
n.push(...H(o[r][0], o[r][1], o[r + 1][0], o[r + 1][1], s));
|
|
729
|
+
return e && n.push(...H(o[t - 1][0], o[t - 1][1], o[0][0], o[0][1], s)), { type: "path", ops: n };
|
|
730
|
+
} else if (t === 2)
|
|
731
|
+
return Qe(o[0][0], o[0][1], o[1][0], o[1][1], s);
|
|
732
732
|
return { type: "path", ops: [] };
|
|
733
733
|
}
|
|
734
734
|
function St(o, e) {
|
|
735
735
|
return de(o, !0, e);
|
|
736
736
|
}
|
|
737
|
-
function Pt(o, e,
|
|
737
|
+
function Pt(o, e, s, t, n) {
|
|
738
738
|
const r = [
|
|
739
739
|
[o, e],
|
|
740
|
-
[o +
|
|
741
|
-
[o +
|
|
742
|
-
[o, e +
|
|
740
|
+
[o + s, e],
|
|
741
|
+
[o + s, e + t],
|
|
742
|
+
[o, e + t]
|
|
743
743
|
];
|
|
744
|
-
return St(r,
|
|
744
|
+
return St(r, n);
|
|
745
745
|
}
|
|
746
|
-
function
|
|
746
|
+
function De(o, e) {
|
|
747
747
|
if (o.length) {
|
|
748
|
-
const
|
|
749
|
-
for (let i = 1; i <
|
|
750
|
-
const a =
|
|
748
|
+
const t = typeof o[0][0] == "number" ? [o] : o, n = ue(t[0], 1 * (1 + e.roughness * 0.2), e), r = e.disableMultiStroke ? [] : ue(t[0], 1.5 * (1 + e.roughness * 0.22), We(e));
|
|
749
|
+
for (let i = 1; i < t.length; i++) {
|
|
750
|
+
const a = t[i];
|
|
751
751
|
if (a.length) {
|
|
752
|
-
const
|
|
753
|
-
for (const
|
|
754
|
-
|
|
755
|
-
for (const
|
|
756
|
-
|
|
752
|
+
const c = ue(a, 1 * (1 + e.roughness * 0.2), e), u = e.disableMultiStroke ? [] : ue(a, 1.5 * (1 + e.roughness * 0.22), We(e));
|
|
753
|
+
for (const l of c)
|
|
754
|
+
l.op !== "move" && n.push(l);
|
|
755
|
+
for (const l of u)
|
|
756
|
+
l.op !== "move" && r.push(l);
|
|
757
757
|
}
|
|
758
758
|
}
|
|
759
|
-
return { type: "path", ops:
|
|
759
|
+
return { type: "path", ops: n.concat(r) };
|
|
760
760
|
}
|
|
761
761
|
return { type: "path", ops: [] };
|
|
762
762
|
}
|
|
763
|
-
function Tt(o, e,
|
|
764
|
-
const r = Je(
|
|
765
|
-
return Oe(o, e,
|
|
763
|
+
function Tt(o, e, s, t, n) {
|
|
764
|
+
const r = Je(s, t, n);
|
|
765
|
+
return Oe(o, e, n, r).opset;
|
|
766
766
|
}
|
|
767
|
-
function Je(o, e,
|
|
768
|
-
const
|
|
767
|
+
function Je(o, e, s) {
|
|
768
|
+
const t = Math.sqrt(Math.PI * 2 * Math.sqrt((Math.pow(o / 2, 2) + Math.pow(e / 2, 2)) / 2)), n = Math.ceil(Math.max(s.curveStepCount, s.curveStepCount / Math.sqrt(200) * t)), r = Math.PI * 2 / n;
|
|
769
769
|
let i = Math.abs(o / 2), a = Math.abs(e / 2);
|
|
770
|
-
const
|
|
771
|
-
return i += k(i *
|
|
770
|
+
const c = 1 - s.curveFitting;
|
|
771
|
+
return i += k(i * c, s), a += k(a * c, s), { increment: r, rx: i, ry: a };
|
|
772
772
|
}
|
|
773
|
-
function Oe(o, e,
|
|
774
|
-
const [
|
|
775
|
-
let i = ke(
|
|
776
|
-
if (!
|
|
777
|
-
const [a] =
|
|
778
|
-
i = i.concat(
|
|
773
|
+
function Oe(o, e, s, t) {
|
|
774
|
+
const [n, r] = He(t.increment, o, e, t.rx, t.ry, 1, t.increment * me(0.1, me(0.4, 1, s), s), s);
|
|
775
|
+
let i = ke(n, null, s);
|
|
776
|
+
if (!s.disableMultiStroke && s.roughness !== 0) {
|
|
777
|
+
const [a] = He(t.increment, o, e, t.rx, t.ry, 1.5, 0, s), c = ke(a, null, s);
|
|
778
|
+
i = i.concat(c);
|
|
779
779
|
}
|
|
780
780
|
return {
|
|
781
781
|
estimatedPoints: r,
|
|
782
782
|
opset: { type: "path", ops: i }
|
|
783
783
|
};
|
|
784
784
|
}
|
|
785
|
-
function Ie(o, e,
|
|
786
|
-
const u = o,
|
|
787
|
-
let h = Math.abs(
|
|
788
|
-
h += k(h * 0.01,
|
|
789
|
-
let d =
|
|
785
|
+
function Ie(o, e, s, t, n, r, i, a, c) {
|
|
786
|
+
const u = o, l = e;
|
|
787
|
+
let h = Math.abs(s / 2), f = Math.abs(t / 2);
|
|
788
|
+
h += k(h * 0.01, c), f += k(f * 0.01, c);
|
|
789
|
+
let d = n, g = r;
|
|
790
790
|
for (; d < 0; )
|
|
791
791
|
d += Math.PI * 2, g += Math.PI * 2;
|
|
792
792
|
g - d > Math.PI * 2 && (d = 0, g = Math.PI * 2);
|
|
793
|
-
const m = Math.PI * 2 /
|
|
794
|
-
if (!
|
|
795
|
-
const y =
|
|
793
|
+
const m = Math.PI * 2 / c.curveStepCount, b = Math.min(m / 2, (g - d) / 2), v = Fe(b, u, l, h, f, d, g, 1, c);
|
|
794
|
+
if (!c.disableMultiStroke) {
|
|
795
|
+
const y = Fe(b, u, l, h, f, d, g, 1.5, c);
|
|
796
796
|
v.push(...y);
|
|
797
797
|
}
|
|
798
|
-
return i && (a ? v.push(...
|
|
798
|
+
return i && (a ? v.push(...H(u, l, u + h * Math.cos(d), l + f * Math.sin(d), c), ...H(u, l, u + h * Math.cos(g), l + f * Math.sin(g), c)) : v.push({ op: "lineTo", data: [u, l] }, { op: "lineTo", data: [u + h * Math.cos(d), l + f * Math.sin(d)] })), { type: "path", ops: v };
|
|
799
799
|
}
|
|
800
800
|
function Ne(o, e) {
|
|
801
|
-
const
|
|
802
|
-
let
|
|
803
|
-
for (const { key: i, data: a } of
|
|
801
|
+
const s = Xe(Ze(Ae(o))), t = [];
|
|
802
|
+
let n = [0, 0], r = [0, 0];
|
|
803
|
+
for (const { key: i, data: a } of s)
|
|
804
804
|
switch (i) {
|
|
805
805
|
case "M": {
|
|
806
|
-
r = [a[0], a[1]],
|
|
806
|
+
r = [a[0], a[1]], n = [a[0], a[1]];
|
|
807
807
|
break;
|
|
808
808
|
}
|
|
809
809
|
case "L":
|
|
810
|
-
|
|
810
|
+
t.push(...H(r[0], r[1], a[0], a[1], e)), r = [a[0], a[1]];
|
|
811
811
|
break;
|
|
812
812
|
case "C": {
|
|
813
|
-
const [
|
|
814
|
-
|
|
813
|
+
const [c, u, l, h, f, d] = a;
|
|
814
|
+
t.push(...Ct(c, u, l, h, f, d, r, e)), r = [f, d];
|
|
815
815
|
break;
|
|
816
816
|
}
|
|
817
817
|
case "Z":
|
|
818
|
-
|
|
818
|
+
t.push(...H(r[0], r[1], n[0], n[1], e)), r = [n[0], n[1]];
|
|
819
819
|
break;
|
|
820
820
|
}
|
|
821
|
-
return { type: "path", ops:
|
|
821
|
+
return { type: "path", ops: t };
|
|
822
822
|
}
|
|
823
823
|
function Se(o, e) {
|
|
824
|
-
const
|
|
825
|
-
for (const
|
|
826
|
-
if (
|
|
827
|
-
const
|
|
824
|
+
const s = [];
|
|
825
|
+
for (const t of o)
|
|
826
|
+
if (t.length) {
|
|
827
|
+
const n = e.maxRandomnessOffset || 0, r = t.length;
|
|
828
828
|
if (r > 2) {
|
|
829
|
-
|
|
829
|
+
s.push({ op: "move", data: [t[0][0] + k(n, e), t[0][1] + k(n, e)] });
|
|
830
830
|
for (let i = 1; i < r; i++)
|
|
831
|
-
|
|
831
|
+
s.push({ op: "lineTo", data: [t[i][0] + k(n, e), t[i][1] + k(n, e)] });
|
|
832
832
|
}
|
|
833
833
|
}
|
|
834
|
-
return { type: "fillPath", ops:
|
|
834
|
+
return { type: "fillPath", ops: s };
|
|
835
835
|
}
|
|
836
|
-
function
|
|
836
|
+
function V(o, e) {
|
|
837
837
|
return kt(e, _t).fillPolygons(o, e);
|
|
838
838
|
}
|
|
839
|
-
function xt(o, e,
|
|
840
|
-
const a = o,
|
|
841
|
-
let u = Math.abs(
|
|
842
|
-
u += k(u * 0.01, i),
|
|
843
|
-
let h =
|
|
839
|
+
function xt(o, e, s, t, n, r, i) {
|
|
840
|
+
const a = o, c = e;
|
|
841
|
+
let u = Math.abs(s / 2), l = Math.abs(t / 2);
|
|
842
|
+
u += k(u * 0.01, i), l += k(l * 0.01, i);
|
|
843
|
+
let h = n, f = r;
|
|
844
844
|
for (; h < 0; )
|
|
845
845
|
h += Math.PI * 2, f += Math.PI * 2;
|
|
846
846
|
f - h > Math.PI * 2 && (h = 0, f = Math.PI * 2);
|
|
847
847
|
const d = (f - h) / i.curveStepCount, g = [];
|
|
848
848
|
for (let m = h; m <= f; m = m + d)
|
|
849
|
-
g.push([a + u * Math.cos(m),
|
|
850
|
-
return g.push([a + u * Math.cos(f),
|
|
849
|
+
g.push([a + u * Math.cos(m), c + l * Math.sin(m)]);
|
|
850
|
+
return g.push([a + u * Math.cos(f), c + l * Math.sin(f)]), g.push([a, c]), V([g], i);
|
|
851
851
|
}
|
|
852
852
|
function Ot(o, e) {
|
|
853
853
|
return k(o, e);
|
|
854
854
|
}
|
|
855
|
-
function Et(o, e,
|
|
856
|
-
return me(o, e,
|
|
855
|
+
function Et(o, e, s) {
|
|
856
|
+
return me(o, e, s);
|
|
857
857
|
}
|
|
858
|
-
function Rt(o, e,
|
|
859
|
-
return
|
|
858
|
+
function Rt(o, e, s, t, n) {
|
|
859
|
+
return H(o, e, s, t, n, !0);
|
|
860
860
|
}
|
|
861
861
|
function We(o) {
|
|
862
862
|
const e = Object.assign({}, o);
|
|
@@ -865,29 +865,29 @@ function We(o) {
|
|
|
865
865
|
function Ke(o) {
|
|
866
866
|
return o.randomizer || (o.randomizer = new vt(o.seed || 0)), o.randomizer.next();
|
|
867
867
|
}
|
|
868
|
-
function me(o, e,
|
|
869
|
-
return
|
|
868
|
+
function me(o, e, s, t = 1) {
|
|
869
|
+
return s.roughness * t * (Ke(s) * (e - o) + o);
|
|
870
870
|
}
|
|
871
|
-
function k(o, e,
|
|
872
|
-
return me(-o, o, e,
|
|
871
|
+
function k(o, e, s = 1) {
|
|
872
|
+
return me(-o, o, e, s);
|
|
873
873
|
}
|
|
874
|
-
function
|
|
875
|
-
const i = r ?
|
|
874
|
+
function H(o, e, s, t, n, r = !1) {
|
|
875
|
+
const i = r ? n.disableMultiStrokeFill : n.disableMultiStroke, a = Ee(o, e, s, t, n, !0, !1);
|
|
876
876
|
if (i)
|
|
877
877
|
return a;
|
|
878
|
-
const
|
|
879
|
-
return a.concat(
|
|
878
|
+
const c = Ee(o, e, s, t, n, !0, !0);
|
|
879
|
+
return a.concat(c);
|
|
880
880
|
}
|
|
881
|
-
function Ee(o, e,
|
|
882
|
-
const a = Math.pow(o -
|
|
881
|
+
function Ee(o, e, s, t, n, r, i) {
|
|
882
|
+
const a = Math.pow(o - s, 2) + Math.pow(e - t, 2), c = Math.sqrt(a);
|
|
883
883
|
let u = 1;
|
|
884
|
-
|
|
885
|
-
let
|
|
886
|
-
|
|
887
|
-
const h =
|
|
888
|
-
let d =
|
|
889
|
-
d = k(d,
|
|
890
|
-
const m = [], b = () => k(h,
|
|
884
|
+
c < 200 ? u = 1 : c > 500 ? u = 0.4 : u = -16668e-7 * c + 1.233334;
|
|
885
|
+
let l = n.maxRandomnessOffset || 0;
|
|
886
|
+
l * l * 100 > a && (l = c / 10);
|
|
887
|
+
const h = l / 2, f = 0.2 + Ke(n) * 0.2;
|
|
888
|
+
let d = n.bowing * n.maxRandomnessOffset * (t - e) / 200, g = n.bowing * n.maxRandomnessOffset * (o - s) / 200;
|
|
889
|
+
d = k(d, n, u), g = k(g, n, u);
|
|
890
|
+
const m = [], b = () => k(h, n, u), v = () => k(l, n, u), y = n.preserveVertices;
|
|
891
891
|
return i ? m.push({
|
|
892
892
|
op: "move",
|
|
893
893
|
data: [
|
|
@@ -897,62 +897,62 @@ function Ee(o, e, n, s, t, r, i) {
|
|
|
897
897
|
}) : m.push({
|
|
898
898
|
op: "move",
|
|
899
899
|
data: [
|
|
900
|
-
o + (y ? 0 : k(
|
|
901
|
-
e + (y ? 0 : k(
|
|
900
|
+
o + (y ? 0 : k(l, n, u)),
|
|
901
|
+
e + (y ? 0 : k(l, n, u))
|
|
902
902
|
]
|
|
903
903
|
}), i ? m.push({
|
|
904
904
|
op: "bcurveTo",
|
|
905
905
|
data: [
|
|
906
|
-
d + o + (
|
|
907
|
-
g + e + (
|
|
908
|
-
d + o + 2 * (
|
|
909
|
-
g + e + 2 * (
|
|
910
|
-
|
|
911
|
-
|
|
906
|
+
d + o + (s - o) * f + b(),
|
|
907
|
+
g + e + (t - e) * f + b(),
|
|
908
|
+
d + o + 2 * (s - o) * f + b(),
|
|
909
|
+
g + e + 2 * (t - e) * f + b(),
|
|
910
|
+
s + (y ? 0 : b()),
|
|
911
|
+
t + (y ? 0 : b())
|
|
912
912
|
]
|
|
913
913
|
}) : m.push({
|
|
914
914
|
op: "bcurveTo",
|
|
915
915
|
data: [
|
|
916
|
-
d + o + (
|
|
917
|
-
g + e + (
|
|
918
|
-
d + o + 2 * (
|
|
919
|
-
g + e + 2 * (
|
|
920
|
-
|
|
921
|
-
|
|
916
|
+
d + o + (s - o) * f + v(),
|
|
917
|
+
g + e + (t - e) * f + v(),
|
|
918
|
+
d + o + 2 * (s - o) * f + v(),
|
|
919
|
+
g + e + 2 * (t - e) * f + v(),
|
|
920
|
+
s + (y ? 0 : v()),
|
|
921
|
+
t + (y ? 0 : v())
|
|
922
922
|
]
|
|
923
923
|
}), m;
|
|
924
924
|
}
|
|
925
|
-
function ue(o, e,
|
|
925
|
+
function ue(o, e, s) {
|
|
926
926
|
if (!o.length)
|
|
927
927
|
return [];
|
|
928
|
-
const
|
|
929
|
-
|
|
930
|
-
o[0][0] + k(e,
|
|
931
|
-
o[0][1] + k(e,
|
|
932
|
-
]),
|
|
933
|
-
o[0][0] + k(e,
|
|
934
|
-
o[0][1] + k(e,
|
|
928
|
+
const t = [];
|
|
929
|
+
t.push([
|
|
930
|
+
o[0][0] + k(e, s),
|
|
931
|
+
o[0][1] + k(e, s)
|
|
932
|
+
]), t.push([
|
|
933
|
+
o[0][0] + k(e, s),
|
|
934
|
+
o[0][1] + k(e, s)
|
|
935
935
|
]);
|
|
936
|
-
for (let
|
|
937
|
-
|
|
938
|
-
o[
|
|
939
|
-
o[
|
|
940
|
-
]),
|
|
941
|
-
o[
|
|
942
|
-
o[
|
|
936
|
+
for (let n = 1; n < o.length; n++)
|
|
937
|
+
t.push([
|
|
938
|
+
o[n][0] + k(e, s),
|
|
939
|
+
o[n][1] + k(e, s)
|
|
940
|
+
]), n === o.length - 1 && t.push([
|
|
941
|
+
o[n][0] + k(e, s),
|
|
942
|
+
o[n][1] + k(e, s)
|
|
943
943
|
]);
|
|
944
|
-
return ke(
|
|
945
|
-
}
|
|
946
|
-
function ke(o, e,
|
|
947
|
-
const
|
|
948
|
-
if (
|
|
949
|
-
const r = [], i = 1 -
|
|
950
|
-
|
|
951
|
-
for (let a = 1; a + 2 <
|
|
952
|
-
const
|
|
953
|
-
r[0] = [
|
|
944
|
+
return ke(t, null, s);
|
|
945
|
+
}
|
|
946
|
+
function ke(o, e, s) {
|
|
947
|
+
const t = o.length, n = [];
|
|
948
|
+
if (t > 3) {
|
|
949
|
+
const r = [], i = 1 - s.curveTightness;
|
|
950
|
+
n.push({ op: "move", data: [o[1][0], o[1][1]] });
|
|
951
|
+
for (let a = 1; a + 2 < t; a++) {
|
|
952
|
+
const c = o[a];
|
|
953
|
+
r[0] = [c[0], c[1]], r[1] = [c[0] + (i * o[a + 1][0] - i * o[a - 1][0]) / 6, c[1] + (i * o[a + 1][1] - i * o[a - 1][1]) / 6], r[2] = [o[a + 1][0] + (i * o[a][0] - i * o[a + 2][0]) / 6, o[a + 1][1] + (i * o[a][1] - i * o[a + 2][1]) / 6], r[3] = [o[a + 1][0], o[a + 1][1]], n.push({ op: "bcurveTo", data: [r[1][0], r[1][1], r[2][0], r[2][1], r[3][0], r[3][1]] });
|
|
954
954
|
}
|
|
955
|
-
} else
|
|
955
|
+
} else t === 3 ? (n.push({ op: "move", data: [o[1][0], o[1][1]] }), n.push({
|
|
956
956
|
op: "bcurveTo",
|
|
957
957
|
data: [
|
|
958
958
|
o[1][0],
|
|
@@ -962,117 +962,117 @@ function ke(o, e, n) {
|
|
|
962
962
|
o[2][0],
|
|
963
963
|
o[2][1]
|
|
964
964
|
]
|
|
965
|
-
})) :
|
|
966
|
-
return
|
|
967
|
-
}
|
|
968
|
-
function
|
|
969
|
-
const
|
|
970
|
-
if (
|
|
971
|
-
o = o / 4,
|
|
972
|
-
e +
|
|
973
|
-
|
|
965
|
+
})) : t === 2 && n.push(...Ee(o[0][0], o[0][1], o[1][0], o[1][1], s, !0, !0));
|
|
966
|
+
return n;
|
|
967
|
+
}
|
|
968
|
+
function He(o, e, s, t, n, r, i, a) {
|
|
969
|
+
const c = a.roughness === 0, u = [], l = [];
|
|
970
|
+
if (c) {
|
|
971
|
+
o = o / 4, l.push([
|
|
972
|
+
e + t * Math.cos(-o),
|
|
973
|
+
s + n * Math.sin(-o)
|
|
974
974
|
]);
|
|
975
975
|
for (let h = 0; h <= Math.PI * 2; h = h + o) {
|
|
976
976
|
const f = [
|
|
977
|
-
e +
|
|
978
|
-
|
|
977
|
+
e + t * Math.cos(h),
|
|
978
|
+
s + n * Math.sin(h)
|
|
979
979
|
];
|
|
980
|
-
u.push(f),
|
|
980
|
+
u.push(f), l.push(f);
|
|
981
981
|
}
|
|
982
|
-
|
|
983
|
-
e +
|
|
984
|
-
|
|
985
|
-
]),
|
|
986
|
-
e +
|
|
987
|
-
|
|
982
|
+
l.push([
|
|
983
|
+
e + t * Math.cos(0),
|
|
984
|
+
s + n * Math.sin(0)
|
|
985
|
+
]), l.push([
|
|
986
|
+
e + t * Math.cos(o),
|
|
987
|
+
s + n * Math.sin(o)
|
|
988
988
|
]);
|
|
989
989
|
} else {
|
|
990
990
|
const h = k(0.5, a) - Math.PI / 2;
|
|
991
|
-
|
|
992
|
-
k(r, a) + e + 0.9 *
|
|
993
|
-
k(r, a) +
|
|
991
|
+
l.push([
|
|
992
|
+
k(r, a) + e + 0.9 * t * Math.cos(h - o),
|
|
993
|
+
k(r, a) + s + 0.9 * n * Math.sin(h - o)
|
|
994
994
|
]);
|
|
995
995
|
const f = Math.PI * 2 + h - 0.01;
|
|
996
996
|
for (let d = h; d < f; d = d + o) {
|
|
997
997
|
const g = [
|
|
998
|
-
k(r, a) + e +
|
|
999
|
-
k(r, a) +
|
|
998
|
+
k(r, a) + e + t * Math.cos(d),
|
|
999
|
+
k(r, a) + s + n * Math.sin(d)
|
|
1000
1000
|
];
|
|
1001
|
-
u.push(g),
|
|
1001
|
+
u.push(g), l.push(g);
|
|
1002
1002
|
}
|
|
1003
|
-
|
|
1004
|
-
k(r, a) + e +
|
|
1005
|
-
k(r, a) +
|
|
1006
|
-
]),
|
|
1007
|
-
k(r, a) + e + 0.98 *
|
|
1008
|
-
k(r, a) +
|
|
1009
|
-
]),
|
|
1010
|
-
k(r, a) + e + 0.9 *
|
|
1011
|
-
k(r, a) +
|
|
1003
|
+
l.push([
|
|
1004
|
+
k(r, a) + e + t * Math.cos(h + Math.PI * 2 + i * 0.5),
|
|
1005
|
+
k(r, a) + s + n * Math.sin(h + Math.PI * 2 + i * 0.5)
|
|
1006
|
+
]), l.push([
|
|
1007
|
+
k(r, a) + e + 0.98 * t * Math.cos(h + i),
|
|
1008
|
+
k(r, a) + s + 0.98 * n * Math.sin(h + i)
|
|
1009
|
+
]), l.push([
|
|
1010
|
+
k(r, a) + e + 0.9 * t * Math.cos(h + i * 0.5),
|
|
1011
|
+
k(r, a) + s + 0.9 * n * Math.sin(h + i * 0.5)
|
|
1012
1012
|
]);
|
|
1013
1013
|
}
|
|
1014
|
-
return [
|
|
1014
|
+
return [l, u];
|
|
1015
1015
|
}
|
|
1016
|
-
function
|
|
1017
|
-
const u = r + k(0.1,
|
|
1018
|
-
|
|
1019
|
-
k(a,
|
|
1020
|
-
k(a,
|
|
1016
|
+
function Fe(o, e, s, t, n, r, i, a, c) {
|
|
1017
|
+
const u = r + k(0.1, c), l = [];
|
|
1018
|
+
l.push([
|
|
1019
|
+
k(a, c) + e + 0.9 * t * Math.cos(u - o),
|
|
1020
|
+
k(a, c) + s + 0.9 * n * Math.sin(u - o)
|
|
1021
1021
|
]);
|
|
1022
1022
|
for (let h = u; h <= i; h = h + o)
|
|
1023
|
-
|
|
1024
|
-
k(a,
|
|
1025
|
-
k(a,
|
|
1023
|
+
l.push([
|
|
1024
|
+
k(a, c) + e + t * Math.cos(h),
|
|
1025
|
+
k(a, c) + s + n * Math.sin(h)
|
|
1026
1026
|
]);
|
|
1027
|
-
return
|
|
1028
|
-
e +
|
|
1029
|
-
|
|
1030
|
-
]),
|
|
1031
|
-
e +
|
|
1032
|
-
|
|
1033
|
-
]), ke(
|
|
1034
|
-
}
|
|
1035
|
-
function Ct(o, e,
|
|
1036
|
-
const
|
|
1037
|
-
let
|
|
1027
|
+
return l.push([
|
|
1028
|
+
e + t * Math.cos(i),
|
|
1029
|
+
s + n * Math.sin(i)
|
|
1030
|
+
]), l.push([
|
|
1031
|
+
e + t * Math.cos(i),
|
|
1032
|
+
s + n * Math.sin(i)
|
|
1033
|
+
]), ke(l, null, c);
|
|
1034
|
+
}
|
|
1035
|
+
function Ct(o, e, s, t, n, r, i, a) {
|
|
1036
|
+
const c = [], u = [a.maxRandomnessOffset || 1, (a.maxRandomnessOffset || 1) + 0.3];
|
|
1037
|
+
let l = [0, 0];
|
|
1038
1038
|
const h = a.disableMultiStroke ? 1 : 2, f = a.preserveVertices;
|
|
1039
1039
|
for (let d = 0; d < h; d++)
|
|
1040
|
-
d === 0 ?
|
|
1040
|
+
d === 0 ? c.push({ op: "move", data: [i[0], i[1]] }) : c.push({ op: "move", data: [i[0] + (f ? 0 : k(u[0], a)), i[1] + (f ? 0 : k(u[0], a))] }), l = f ? [n, r] : [n + k(u[d], a), r + k(u[d], a)], c.push({
|
|
1041
1041
|
op: "bcurveTo",
|
|
1042
1042
|
data: [
|
|
1043
1043
|
o + k(u[d], a),
|
|
1044
1044
|
e + k(u[d], a),
|
|
1045
|
-
n + k(u[d], a),
|
|
1046
1045
|
s + k(u[d], a),
|
|
1047
|
-
|
|
1048
|
-
|
|
1046
|
+
t + k(u[d], a),
|
|
1047
|
+
l[0],
|
|
1048
|
+
l[1]
|
|
1049
1049
|
]
|
|
1050
1050
|
});
|
|
1051
|
-
return
|
|
1051
|
+
return c;
|
|
1052
1052
|
}
|
|
1053
|
-
function
|
|
1053
|
+
function Q(o) {
|
|
1054
1054
|
return [...o];
|
|
1055
1055
|
}
|
|
1056
1056
|
function qe(o, e = 0) {
|
|
1057
|
-
const
|
|
1058
|
-
if (
|
|
1057
|
+
const s = o.length;
|
|
1058
|
+
if (s < 3)
|
|
1059
1059
|
throw new Error("A curve must have at least three points.");
|
|
1060
|
-
const
|
|
1061
|
-
if (
|
|
1062
|
-
|
|
1060
|
+
const t = [];
|
|
1061
|
+
if (s === 3)
|
|
1062
|
+
t.push(Q(o[0]), Q(o[1]), Q(o[2]), Q(o[2]));
|
|
1063
1063
|
else {
|
|
1064
|
-
const
|
|
1065
|
-
|
|
1064
|
+
const n = [];
|
|
1065
|
+
n.push(o[0], o[0]);
|
|
1066
1066
|
for (let a = 1; a < o.length; a++)
|
|
1067
|
-
|
|
1067
|
+
n.push(o[a]), a === o.length - 1 && n.push(o[a]);
|
|
1068
1068
|
const r = [], i = 1 - e;
|
|
1069
|
-
|
|
1070
|
-
for (let a = 1; a + 2 <
|
|
1071
|
-
const
|
|
1072
|
-
r[0] = [
|
|
1069
|
+
t.push(Q(n[0]));
|
|
1070
|
+
for (let a = 1; a + 2 < n.length; a++) {
|
|
1071
|
+
const c = n[a];
|
|
1072
|
+
r[0] = [c[0], c[1]], r[1] = [c[0] + (i * n[a + 1][0] - i * n[a - 1][0]) / 6, c[1] + (i * n[a + 1][1] - i * n[a - 1][1]) / 6], r[2] = [n[a + 1][0] + (i * n[a][0] - i * n[a + 2][0]) / 6, n[a + 1][1] + (i * n[a][1] - i * n[a + 2][1]) / 6], r[3] = [n[a + 1][0], n[a + 1][1]], t.push(r[1], r[2], r[3]);
|
|
1073
1073
|
}
|
|
1074
1074
|
}
|
|
1075
|
-
return
|
|
1075
|
+
return t;
|
|
1076
1076
|
}
|
|
1077
1077
|
function Lt(o, e) {
|
|
1078
1078
|
return Math.sqrt(pe(o, e));
|
|
@@ -1080,98 +1080,98 @@ function Lt(o, e) {
|
|
|
1080
1080
|
function pe(o, e) {
|
|
1081
1081
|
return Math.pow(o[0] - e[0], 2) + Math.pow(o[1] - e[1], 2);
|
|
1082
1082
|
}
|
|
1083
|
-
function At(o, e,
|
|
1084
|
-
const
|
|
1085
|
-
if (
|
|
1083
|
+
function At(o, e, s) {
|
|
1084
|
+
const t = pe(e, s);
|
|
1085
|
+
if (t === 0)
|
|
1086
1086
|
return pe(o, e);
|
|
1087
|
-
let
|
|
1088
|
-
return
|
|
1087
|
+
let n = ((o[0] - e[0]) * (s[0] - e[0]) + (o[1] - e[1]) * (s[1] - e[1])) / t;
|
|
1088
|
+
return n = Math.max(0, Math.min(1, n)), pe(o, F(e, s, n));
|
|
1089
1089
|
}
|
|
1090
|
-
function
|
|
1090
|
+
function F(o, e, s) {
|
|
1091
1091
|
return [
|
|
1092
|
-
o[0] + (e[0] - o[0]) *
|
|
1093
|
-
o[1] + (e[1] - o[1]) *
|
|
1092
|
+
o[0] + (e[0] - o[0]) * s,
|
|
1093
|
+
o[1] + (e[1] - o[1]) * s
|
|
1094
1094
|
];
|
|
1095
1095
|
}
|
|
1096
1096
|
function jt(o, e) {
|
|
1097
|
-
const
|
|
1098
|
-
let i = 3 *
|
|
1097
|
+
const s = o[e + 0], t = o[e + 1], n = o[e + 2], r = o[e + 3];
|
|
1098
|
+
let i = 3 * t[0] - 2 * s[0] - r[0];
|
|
1099
1099
|
i *= i;
|
|
1100
|
-
let a = 3 *
|
|
1100
|
+
let a = 3 * t[1] - 2 * s[1] - r[1];
|
|
1101
1101
|
a *= a;
|
|
1102
|
-
let
|
|
1103
|
-
|
|
1104
|
-
let u = 3 *
|
|
1105
|
-
return u *= u, i <
|
|
1106
|
-
}
|
|
1107
|
-
function Re(o, e,
|
|
1108
|
-
const
|
|
1109
|
-
if (jt(o, e) <
|
|
1102
|
+
let c = 3 * n[0] - 2 * r[0] - s[0];
|
|
1103
|
+
c *= c;
|
|
1104
|
+
let u = 3 * n[1] - 2 * r[1] - s[1];
|
|
1105
|
+
return u *= u, i < c && (i = c), a < u && (a = u), i + a;
|
|
1106
|
+
}
|
|
1107
|
+
function Re(o, e, s, t) {
|
|
1108
|
+
const n = t || [];
|
|
1109
|
+
if (jt(o, e) < s) {
|
|
1110
1110
|
const r = o[e + 0];
|
|
1111
|
-
|
|
1111
|
+
n.length ? Lt(n[n.length - 1], r) > 1 && n.push(r) : n.push(r), n.push(o[e + 3]);
|
|
1112
1112
|
} else {
|
|
1113
|
-
const i = o[e + 0], a = o[e + 1],
|
|
1114
|
-
Re([i,
|
|
1113
|
+
const i = o[e + 0], a = o[e + 1], c = o[e + 2], u = o[e + 3], l = F(i, a, 0.5), h = F(a, c, 0.5), f = F(c, u, 0.5), d = F(l, h, 0.5), g = F(h, f, 0.5), m = F(d, g, 0.5);
|
|
1114
|
+
Re([i, l, d, m], 0, s, n), Re([m, g, f, u], 0, s, n);
|
|
1115
1115
|
}
|
|
1116
|
-
return
|
|
1116
|
+
return n;
|
|
1117
1117
|
}
|
|
1118
1118
|
function $t(o, e) {
|
|
1119
1119
|
return be(o, 0, o.length, e);
|
|
1120
1120
|
}
|
|
1121
|
-
function be(o, e,
|
|
1122
|
-
const r =
|
|
1123
|
-
let
|
|
1124
|
-
for (let
|
|
1125
|
-
const h = At(o[
|
|
1126
|
-
h >
|
|
1121
|
+
function be(o, e, s, t, n) {
|
|
1122
|
+
const r = n || [], i = o[e], a = o[s - 1];
|
|
1123
|
+
let c = 0, u = 1;
|
|
1124
|
+
for (let l = e + 1; l < s - 1; ++l) {
|
|
1125
|
+
const h = At(o[l], i, a);
|
|
1126
|
+
h > c && (c = h, u = l);
|
|
1127
1127
|
}
|
|
1128
|
-
return Math.sqrt(
|
|
1128
|
+
return Math.sqrt(c) > t ? (be(o, e, u + 1, t, r), be(o, u, s, t, r)) : (r.length || r.push(i), r.push(a)), r;
|
|
1129
1129
|
}
|
|
1130
|
-
function Ce(o, e = 0.15,
|
|
1131
|
-
const
|
|
1132
|
-
for (let r = 0; r <
|
|
1130
|
+
function Ce(o, e = 0.15, s) {
|
|
1131
|
+
const t = [], n = (o.length - 1) / 3;
|
|
1132
|
+
for (let r = 0; r < n; r++) {
|
|
1133
1133
|
const i = r * 3;
|
|
1134
|
-
Re(o, i, e,
|
|
1134
|
+
Re(o, i, e, t);
|
|
1135
1135
|
}
|
|
1136
|
-
return
|
|
1136
|
+
return s && s > 0 ? be(t, 0, t.length, s) : t;
|
|
1137
1137
|
}
|
|
1138
|
-
function
|
|
1139
|
-
const
|
|
1140
|
-
let i = [], a = [0, 0],
|
|
1138
|
+
function zt(o, e, s) {
|
|
1139
|
+
const t = Ae(o), n = Xe(Ze(t)), r = [];
|
|
1140
|
+
let i = [], a = [0, 0], c = [];
|
|
1141
1141
|
const u = () => {
|
|
1142
|
-
|
|
1143
|
-
},
|
|
1142
|
+
c.length >= 4 && i.push(...Ce(c, e)), c = [];
|
|
1143
|
+
}, l = () => {
|
|
1144
1144
|
u(), i.length && (r.push(i), i = []);
|
|
1145
1145
|
};
|
|
1146
|
-
for (const { key: f, data: d } of
|
|
1146
|
+
for (const { key: f, data: d } of n)
|
|
1147
1147
|
switch (f) {
|
|
1148
1148
|
case "M":
|
|
1149
|
-
|
|
1149
|
+
l(), a = [d[0], d[1]], i.push(a);
|
|
1150
1150
|
break;
|
|
1151
1151
|
case "L":
|
|
1152
1152
|
u(), i.push([d[0], d[1]]);
|
|
1153
1153
|
break;
|
|
1154
1154
|
case "C":
|
|
1155
|
-
if (!
|
|
1155
|
+
if (!c.length) {
|
|
1156
1156
|
const g = i.length ? i[i.length - 1] : a;
|
|
1157
|
-
|
|
1157
|
+
c.push([g[0], g[1]]);
|
|
1158
1158
|
}
|
|
1159
|
-
|
|
1159
|
+
c.push([d[0], d[1]]), c.push([d[2], d[3]]), c.push([d[4], d[5]]);
|
|
1160
1160
|
break;
|
|
1161
1161
|
case "Z":
|
|
1162
1162
|
u(), i.push([a[0], a[1]]);
|
|
1163
1163
|
break;
|
|
1164
1164
|
}
|
|
1165
|
-
if (
|
|
1165
|
+
if (l(), !s)
|
|
1166
1166
|
return r;
|
|
1167
1167
|
const h = [];
|
|
1168
1168
|
for (const f of r) {
|
|
1169
|
-
const d = $t(f,
|
|
1169
|
+
const d = $t(f, s);
|
|
1170
1170
|
d.length && h.push(d);
|
|
1171
1171
|
}
|
|
1172
1172
|
return h;
|
|
1173
1173
|
}
|
|
1174
|
-
const
|
|
1174
|
+
const L = "none";
|
|
1175
1175
|
class ve {
|
|
1176
1176
|
constructor(e) {
|
|
1177
1177
|
this.defaultOptions = {
|
|
@@ -1203,57 +1203,57 @@ class ve {
|
|
|
1203
1203
|
_o(e) {
|
|
1204
1204
|
return e ? Object.assign({}, this.defaultOptions, e) : this.defaultOptions;
|
|
1205
1205
|
}
|
|
1206
|
-
_d(e,
|
|
1207
|
-
return { shape: e, sets:
|
|
1206
|
+
_d(e, s, t) {
|
|
1207
|
+
return { shape: e, sets: s || [], options: t || this.defaultOptions };
|
|
1208
1208
|
}
|
|
1209
|
-
line(e,
|
|
1209
|
+
line(e, s, t, n, r) {
|
|
1210
1210
|
const i = this._o(r);
|
|
1211
|
-
return this._d("line", [Qe(e,
|
|
1211
|
+
return this._d("line", [Qe(e, s, t, n, i)], i);
|
|
1212
1212
|
}
|
|
1213
|
-
rectangle(e,
|
|
1214
|
-
const i = this._o(r), a = [],
|
|
1213
|
+
rectangle(e, s, t, n, r) {
|
|
1214
|
+
const i = this._o(r), a = [], c = Pt(e, s, t, n, i);
|
|
1215
1215
|
if (i.fill) {
|
|
1216
|
-
const u = [[e,
|
|
1217
|
-
i.fillStyle === "solid" ? a.push(Se([u], i)) : a.push(
|
|
1216
|
+
const u = [[e, s], [e + t, s], [e + t, s + n], [e, s + n]];
|
|
1217
|
+
i.fillStyle === "solid" ? a.push(Se([u], i)) : a.push(V([u], i));
|
|
1218
1218
|
}
|
|
1219
|
-
return i.stroke !==
|
|
1219
|
+
return i.stroke !== L && a.push(c), this._d("rectangle", a, i);
|
|
1220
1220
|
}
|
|
1221
|
-
ellipse(e,
|
|
1222
|
-
const i = this._o(r), a = [],
|
|
1221
|
+
ellipse(e, s, t, n, r) {
|
|
1222
|
+
const i = this._o(r), a = [], c = Je(t, n, i), u = Oe(e, s, i, c);
|
|
1223
1223
|
if (i.fill)
|
|
1224
1224
|
if (i.fillStyle === "solid") {
|
|
1225
|
-
const
|
|
1226
|
-
|
|
1225
|
+
const l = Oe(e, s, i, c).opset;
|
|
1226
|
+
l.type = "fillPath", a.push(l);
|
|
1227
1227
|
} else
|
|
1228
|
-
a.push(
|
|
1229
|
-
return i.stroke !==
|
|
1228
|
+
a.push(V([u.estimatedPoints], i));
|
|
1229
|
+
return i.stroke !== L && a.push(u.opset), this._d("ellipse", a, i);
|
|
1230
1230
|
}
|
|
1231
|
-
circle(e,
|
|
1232
|
-
const r = this.ellipse(e,
|
|
1231
|
+
circle(e, s, t, n) {
|
|
1232
|
+
const r = this.ellipse(e, s, t, t, n);
|
|
1233
1233
|
return r.shape = "circle", r;
|
|
1234
1234
|
}
|
|
1235
|
-
linearPath(e,
|
|
1236
|
-
const
|
|
1237
|
-
return this._d("linearPath", [de(e, !1,
|
|
1235
|
+
linearPath(e, s) {
|
|
1236
|
+
const t = this._o(s);
|
|
1237
|
+
return this._d("linearPath", [de(e, !1, t)], t);
|
|
1238
1238
|
}
|
|
1239
|
-
arc(e,
|
|
1240
|
-
const u = this._o(
|
|
1239
|
+
arc(e, s, t, n, r, i, a = !1, c) {
|
|
1240
|
+
const u = this._o(c), l = [], h = Ie(e, s, t, n, r, i, a, !0, u);
|
|
1241
1241
|
if (a && u.fill)
|
|
1242
1242
|
if (u.fillStyle === "solid") {
|
|
1243
1243
|
const f = Object.assign({}, u);
|
|
1244
1244
|
f.disableMultiStroke = !0;
|
|
1245
|
-
const d = Ie(e,
|
|
1246
|
-
d.type = "fillPath",
|
|
1245
|
+
const d = Ie(e, s, t, n, r, i, !0, !1, f);
|
|
1246
|
+
d.type = "fillPath", l.push(d);
|
|
1247
1247
|
} else
|
|
1248
|
-
|
|
1249
|
-
return u.stroke !==
|
|
1250
|
-
}
|
|
1251
|
-
curve(e,
|
|
1252
|
-
const
|
|
1253
|
-
if (
|
|
1254
|
-
if (
|
|
1255
|
-
const i =
|
|
1256
|
-
|
|
1248
|
+
l.push(xt(e, s, t, n, r, i, u));
|
|
1249
|
+
return u.stroke !== L && l.push(h), this._d("arc", l, u);
|
|
1250
|
+
}
|
|
1251
|
+
curve(e, s) {
|
|
1252
|
+
const t = this._o(s), n = [], r = De(e, t);
|
|
1253
|
+
if (t.fill && t.fill !== L)
|
|
1254
|
+
if (t.fillStyle === "solid") {
|
|
1255
|
+
const i = De(e, Object.assign(Object.assign({}, t), { disableMultiStroke: !0, roughness: t.roughness ? t.roughness + t.fillShapeRoughnessGain : 0 }));
|
|
1256
|
+
n.push({
|
|
1257
1257
|
type: "fillPath",
|
|
1258
1258
|
ops: this._mergedShape(i.ops)
|
|
1259
1259
|
});
|
|
@@ -1261,134 +1261,134 @@ class ve {
|
|
|
1261
1261
|
const i = [], a = e;
|
|
1262
1262
|
if (a.length) {
|
|
1263
1263
|
const u = typeof a[0][0] == "number" ? [a] : a;
|
|
1264
|
-
for (const
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
]), 10, (1 +
|
|
1264
|
+
for (const l of u)
|
|
1265
|
+
l.length < 3 ? i.push(...l) : l.length === 3 ? i.push(...Ce(qe([
|
|
1266
|
+
l[0],
|
|
1267
|
+
l[0],
|
|
1268
|
+
l[1],
|
|
1269
|
+
l[2]
|
|
1270
|
+
]), 10, (1 + t.roughness) / 2)) : i.push(...Ce(qe(l), 10, (1 + t.roughness) / 2));
|
|
1271
1271
|
}
|
|
1272
|
-
i.length &&
|
|
1272
|
+
i.length && n.push(V([i], t));
|
|
1273
1273
|
}
|
|
1274
|
-
return
|
|
1274
|
+
return t.stroke !== L && n.push(r), this._d("curve", n, t);
|
|
1275
1275
|
}
|
|
1276
|
-
polygon(e,
|
|
1277
|
-
const
|
|
1278
|
-
return
|
|
1276
|
+
polygon(e, s) {
|
|
1277
|
+
const t = this._o(s), n = [], r = de(e, !0, t);
|
|
1278
|
+
return t.fill && (t.fillStyle === "solid" ? n.push(Se([e], t)) : n.push(V([e], t))), t.stroke !== L && n.push(r), this._d("polygon", n, t);
|
|
1279
1279
|
}
|
|
1280
|
-
path(e,
|
|
1281
|
-
const
|
|
1280
|
+
path(e, s) {
|
|
1281
|
+
const t = this._o(s), n = [];
|
|
1282
1282
|
if (!e)
|
|
1283
|
-
return this._d("path",
|
|
1283
|
+
return this._d("path", n, t);
|
|
1284
1284
|
e = (e || "").replace(/\n/g, " ").replace(/(-\s)/g, "-").replace("/(ss)/g", " ");
|
|
1285
|
-
const r =
|
|
1285
|
+
const r = t.fill && t.fill !== "transparent" && t.fill !== L, i = t.stroke !== L, a = !!(t.simplification && t.simplification < 1), c = a ? 4 - 4 * (t.simplification || 1) : (1 + t.roughness) / 2, u = zt(e, 1, c), l = Ne(e, t);
|
|
1286
1286
|
if (r)
|
|
1287
|
-
if (
|
|
1287
|
+
if (t.fillStyle === "solid")
|
|
1288
1288
|
if (u.length === 1) {
|
|
1289
|
-
const h = Ne(e, Object.assign(Object.assign({},
|
|
1290
|
-
|
|
1289
|
+
const h = Ne(e, Object.assign(Object.assign({}, t), { disableMultiStroke: !0, roughness: t.roughness ? t.roughness + t.fillShapeRoughnessGain : 0 }));
|
|
1290
|
+
n.push({
|
|
1291
1291
|
type: "fillPath",
|
|
1292
1292
|
ops: this._mergedShape(h.ops)
|
|
1293
1293
|
});
|
|
1294
1294
|
} else
|
|
1295
|
-
|
|
1295
|
+
n.push(Se(u, t));
|
|
1296
1296
|
else
|
|
1297
|
-
|
|
1297
|
+
n.push(V(u, t));
|
|
1298
1298
|
return i && (a ? u.forEach((h) => {
|
|
1299
|
-
|
|
1300
|
-
}) :
|
|
1301
|
-
}
|
|
1302
|
-
opsToPath(e,
|
|
1303
|
-
let
|
|
1304
|
-
for (const
|
|
1305
|
-
const r = typeof
|
|
1306
|
-
switch (
|
|
1299
|
+
n.push(de(h, !1, t));
|
|
1300
|
+
}) : n.push(l)), this._d("path", n, t);
|
|
1301
|
+
}
|
|
1302
|
+
opsToPath(e, s) {
|
|
1303
|
+
let t = "";
|
|
1304
|
+
for (const n of e.ops) {
|
|
1305
|
+
const r = typeof s == "number" && s >= 0 ? n.data.map((i) => +i.toFixed(s)) : n.data;
|
|
1306
|
+
switch (n.op) {
|
|
1307
1307
|
case "move":
|
|
1308
|
-
|
|
1308
|
+
t += `M${r[0]} ${r[1]} `;
|
|
1309
1309
|
break;
|
|
1310
1310
|
case "bcurveTo":
|
|
1311
|
-
|
|
1311
|
+
t += `C${r[0]} ${r[1]}, ${r[2]} ${r[3]}, ${r[4]} ${r[5]} `;
|
|
1312
1312
|
break;
|
|
1313
1313
|
case "lineTo":
|
|
1314
|
-
|
|
1314
|
+
t += `L${r[0]} ${r[1]} `;
|
|
1315
1315
|
break;
|
|
1316
1316
|
}
|
|
1317
1317
|
}
|
|
1318
|
-
return
|
|
1318
|
+
return t.trim();
|
|
1319
1319
|
}
|
|
1320
1320
|
toPaths(e) {
|
|
1321
|
-
const
|
|
1322
|
-
for (const r of
|
|
1321
|
+
const s = e.sets || [], t = e.options || this.defaultOptions, n = [];
|
|
1322
|
+
for (const r of s) {
|
|
1323
1323
|
let i = null;
|
|
1324
1324
|
switch (r.type) {
|
|
1325
1325
|
case "path":
|
|
1326
1326
|
i = {
|
|
1327
1327
|
d: this.opsToPath(r),
|
|
1328
|
-
stroke:
|
|
1329
|
-
strokeWidth:
|
|
1330
|
-
fill:
|
|
1328
|
+
stroke: t.stroke,
|
|
1329
|
+
strokeWidth: t.strokeWidth,
|
|
1330
|
+
fill: L
|
|
1331
1331
|
};
|
|
1332
1332
|
break;
|
|
1333
1333
|
case "fillPath":
|
|
1334
1334
|
i = {
|
|
1335
1335
|
d: this.opsToPath(r),
|
|
1336
|
-
stroke:
|
|
1336
|
+
stroke: L,
|
|
1337
1337
|
strokeWidth: 0,
|
|
1338
|
-
fill:
|
|
1338
|
+
fill: t.fill || L
|
|
1339
1339
|
};
|
|
1340
1340
|
break;
|
|
1341
1341
|
case "fillSketch":
|
|
1342
|
-
i = this.fillSketch(r,
|
|
1342
|
+
i = this.fillSketch(r, t);
|
|
1343
1343
|
break;
|
|
1344
1344
|
}
|
|
1345
|
-
i &&
|
|
1345
|
+
i && n.push(i);
|
|
1346
1346
|
}
|
|
1347
|
-
return
|
|
1347
|
+
return n;
|
|
1348
1348
|
}
|
|
1349
|
-
fillSketch(e,
|
|
1350
|
-
let
|
|
1351
|
-
return
|
|
1349
|
+
fillSketch(e, s) {
|
|
1350
|
+
let t = s.fillWeight;
|
|
1351
|
+
return t < 0 && (t = s.strokeWidth / 2), {
|
|
1352
1352
|
d: this.opsToPath(e),
|
|
1353
|
-
stroke:
|
|
1354
|
-
strokeWidth:
|
|
1355
|
-
fill:
|
|
1353
|
+
stroke: s.fill || L,
|
|
1354
|
+
strokeWidth: t,
|
|
1355
|
+
fill: L
|
|
1356
1356
|
};
|
|
1357
1357
|
}
|
|
1358
1358
|
_mergedShape(e) {
|
|
1359
|
-
return e.filter((
|
|
1359
|
+
return e.filter((s, t) => t === 0 ? !0 : s.op !== "move");
|
|
1360
1360
|
}
|
|
1361
1361
|
}
|
|
1362
|
-
class
|
|
1363
|
-
constructor(e,
|
|
1364
|
-
this.canvas = e, this.ctx = this.canvas.getContext("2d"), this.gen = new ve(
|
|
1362
|
+
class Dt {
|
|
1363
|
+
constructor(e, s) {
|
|
1364
|
+
this.canvas = e, this.ctx = this.canvas.getContext("2d"), this.gen = new ve(s);
|
|
1365
1365
|
}
|
|
1366
1366
|
draw(e) {
|
|
1367
|
-
const
|
|
1368
|
-
for (const i of
|
|
1367
|
+
const s = e.sets || [], t = e.options || this.getDefaultOptions(), n = this.ctx, r = e.options.fixedDecimalPlaceDigits;
|
|
1368
|
+
for (const i of s)
|
|
1369
1369
|
switch (i.type) {
|
|
1370
1370
|
case "path":
|
|
1371
|
-
|
|
1371
|
+
n.save(), n.strokeStyle = t.stroke === "none" ? "transparent" : t.stroke, n.lineWidth = t.strokeWidth, t.strokeLineDash && n.setLineDash(t.strokeLineDash), t.strokeLineDashOffset && (n.lineDashOffset = t.strokeLineDashOffset), this._drawToContext(n, i, r), n.restore();
|
|
1372
1372
|
break;
|
|
1373
1373
|
case "fillPath": {
|
|
1374
|
-
|
|
1374
|
+
n.save(), n.fillStyle = t.fill || "";
|
|
1375
1375
|
const a = e.shape === "curve" || e.shape === "polygon" || e.shape === "path" ? "evenodd" : "nonzero";
|
|
1376
|
-
this._drawToContext(
|
|
1376
|
+
this._drawToContext(n, i, r, a), n.restore();
|
|
1377
1377
|
break;
|
|
1378
1378
|
}
|
|
1379
1379
|
case "fillSketch":
|
|
1380
|
-
this.fillSketch(
|
|
1380
|
+
this.fillSketch(n, i, t);
|
|
1381
1381
|
break;
|
|
1382
1382
|
}
|
|
1383
1383
|
}
|
|
1384
|
-
fillSketch(e,
|
|
1385
|
-
let
|
|
1386
|
-
|
|
1384
|
+
fillSketch(e, s, t) {
|
|
1385
|
+
let n = t.fillWeight;
|
|
1386
|
+
n < 0 && (n = t.strokeWidth / 2), e.save(), t.fillLineDash && e.setLineDash(t.fillLineDash), t.fillLineDashOffset && (e.lineDashOffset = t.fillLineDashOffset), e.strokeStyle = t.fill || "", e.lineWidth = n, this._drawToContext(e, s, t.fixedDecimalPlaceDigits), e.restore();
|
|
1387
1387
|
}
|
|
1388
|
-
_drawToContext(e,
|
|
1388
|
+
_drawToContext(e, s, t, n = "nonzero") {
|
|
1389
1389
|
e.beginPath();
|
|
1390
|
-
for (const r of
|
|
1391
|
-
const i = typeof
|
|
1390
|
+
for (const r of s.ops) {
|
|
1391
|
+
const i = typeof t == "number" && t >= 0 ? r.data.map((a) => +a.toFixed(t)) : r.data;
|
|
1392
1392
|
switch (r.op) {
|
|
1393
1393
|
case "move":
|
|
1394
1394
|
e.moveTo(i[0], i[1]);
|
|
@@ -1401,7 +1401,7 @@ class zt {
|
|
|
1401
1401
|
break;
|
|
1402
1402
|
}
|
|
1403
1403
|
}
|
|
1404
|
-
|
|
1404
|
+
s.type === "fillPath" ? e.fill(n) : e.stroke();
|
|
1405
1405
|
}
|
|
1406
1406
|
get generator() {
|
|
1407
1407
|
return this.gen;
|
|
@@ -1409,75 +1409,75 @@ class zt {
|
|
|
1409
1409
|
getDefaultOptions() {
|
|
1410
1410
|
return this.gen.defaultOptions;
|
|
1411
1411
|
}
|
|
1412
|
-
line(e,
|
|
1413
|
-
const i = this.gen.line(e,
|
|
1412
|
+
line(e, s, t, n, r) {
|
|
1413
|
+
const i = this.gen.line(e, s, t, n, r);
|
|
1414
1414
|
return this.draw(i), i;
|
|
1415
1415
|
}
|
|
1416
|
-
rectangle(e,
|
|
1417
|
-
const i = this.gen.rectangle(e,
|
|
1416
|
+
rectangle(e, s, t, n, r) {
|
|
1417
|
+
const i = this.gen.rectangle(e, s, t, n, r);
|
|
1418
1418
|
return this.draw(i), i;
|
|
1419
1419
|
}
|
|
1420
|
-
ellipse(e,
|
|
1421
|
-
const i = this.gen.ellipse(e,
|
|
1420
|
+
ellipse(e, s, t, n, r) {
|
|
1421
|
+
const i = this.gen.ellipse(e, s, t, n, r);
|
|
1422
1422
|
return this.draw(i), i;
|
|
1423
1423
|
}
|
|
1424
|
-
circle(e,
|
|
1425
|
-
const r = this.gen.circle(e,
|
|
1424
|
+
circle(e, s, t, n) {
|
|
1425
|
+
const r = this.gen.circle(e, s, t, n);
|
|
1426
1426
|
return this.draw(r), r;
|
|
1427
1427
|
}
|
|
1428
|
-
linearPath(e,
|
|
1429
|
-
const
|
|
1430
|
-
return this.draw(
|
|
1428
|
+
linearPath(e, s) {
|
|
1429
|
+
const t = this.gen.linearPath(e, s);
|
|
1430
|
+
return this.draw(t), t;
|
|
1431
1431
|
}
|
|
1432
|
-
polygon(e,
|
|
1433
|
-
const
|
|
1434
|
-
return this.draw(
|
|
1432
|
+
polygon(e, s) {
|
|
1433
|
+
const t = this.gen.polygon(e, s);
|
|
1434
|
+
return this.draw(t), t;
|
|
1435
1435
|
}
|
|
1436
|
-
arc(e,
|
|
1437
|
-
const u = this.gen.arc(e,
|
|
1436
|
+
arc(e, s, t, n, r, i, a = !1, c) {
|
|
1437
|
+
const u = this.gen.arc(e, s, t, n, r, i, a, c);
|
|
1438
1438
|
return this.draw(u), u;
|
|
1439
1439
|
}
|
|
1440
|
-
curve(e,
|
|
1441
|
-
const
|
|
1442
|
-
return this.draw(
|
|
1440
|
+
curve(e, s) {
|
|
1441
|
+
const t = this.gen.curve(e, s);
|
|
1442
|
+
return this.draw(t), t;
|
|
1443
1443
|
}
|
|
1444
|
-
path(e,
|
|
1445
|
-
const
|
|
1446
|
-
return this.draw(
|
|
1444
|
+
path(e, s) {
|
|
1445
|
+
const t = this.gen.path(e, s);
|
|
1446
|
+
return this.draw(t), t;
|
|
1447
1447
|
}
|
|
1448
1448
|
}
|
|
1449
1449
|
const he = "http://www.w3.org/2000/svg";
|
|
1450
1450
|
class It {
|
|
1451
|
-
constructor(e,
|
|
1452
|
-
this.svg = e, this.gen = new ve(
|
|
1451
|
+
constructor(e, s) {
|
|
1452
|
+
this.svg = e, this.gen = new ve(s);
|
|
1453
1453
|
}
|
|
1454
1454
|
draw(e) {
|
|
1455
|
-
const
|
|
1456
|
-
for (const a of
|
|
1457
|
-
let
|
|
1455
|
+
const s = e.sets || [], t = e.options || this.getDefaultOptions(), n = this.svg.ownerDocument || window.document, r = n.createElementNS(he, "g"), i = e.options.fixedDecimalPlaceDigits;
|
|
1456
|
+
for (const a of s) {
|
|
1457
|
+
let c = null;
|
|
1458
1458
|
switch (a.type) {
|
|
1459
1459
|
case "path": {
|
|
1460
|
-
|
|
1460
|
+
c = n.createElementNS(he, "path"), c.setAttribute("d", this.opsToPath(a, i)), c.setAttribute("stroke", t.stroke), c.setAttribute("stroke-width", t.strokeWidth + ""), c.setAttribute("fill", "none"), t.strokeLineDash && c.setAttribute("stroke-dasharray", t.strokeLineDash.join(" ").trim()), t.strokeLineDashOffset && c.setAttribute("stroke-dashoffset", `${t.strokeLineDashOffset}`);
|
|
1461
1461
|
break;
|
|
1462
1462
|
}
|
|
1463
1463
|
case "fillPath": {
|
|
1464
|
-
|
|
1464
|
+
c = n.createElementNS(he, "path"), c.setAttribute("d", this.opsToPath(a, i)), c.setAttribute("stroke", "none"), c.setAttribute("stroke-width", "0"), c.setAttribute("fill", t.fill || ""), (e.shape === "curve" || e.shape === "polygon") && c.setAttribute("fill-rule", "evenodd");
|
|
1465
1465
|
break;
|
|
1466
1466
|
}
|
|
1467
1467
|
case "fillSketch": {
|
|
1468
|
-
|
|
1468
|
+
c = this.fillSketch(n, a, t);
|
|
1469
1469
|
break;
|
|
1470
1470
|
}
|
|
1471
1471
|
}
|
|
1472
|
-
|
|
1472
|
+
c && r.appendChild(c);
|
|
1473
1473
|
}
|
|
1474
1474
|
return r;
|
|
1475
1475
|
}
|
|
1476
|
-
fillSketch(e,
|
|
1477
|
-
let
|
|
1478
|
-
|
|
1476
|
+
fillSketch(e, s, t) {
|
|
1477
|
+
let n = t.fillWeight;
|
|
1478
|
+
n < 0 && (n = t.strokeWidth / 2);
|
|
1479
1479
|
const r = e.createElementNS(he, "path");
|
|
1480
|
-
return r.setAttribute("d", this.opsToPath(
|
|
1480
|
+
return r.setAttribute("d", this.opsToPath(s, t.fixedDecimalPlaceDigits)), r.setAttribute("stroke", t.fill || ""), r.setAttribute("stroke-width", n + ""), r.setAttribute("fill", "none"), t.fillLineDash && r.setAttribute("stroke-dasharray", t.fillLineDash.join(" ").trim()), t.fillLineDashOffset && r.setAttribute("stroke-dashoffset", `${t.fillLineDashOffset}`), r;
|
|
1481
1481
|
}
|
|
1482
1482
|
get generator() {
|
|
1483
1483
|
return this.gen;
|
|
@@ -1485,49 +1485,49 @@ class It {
|
|
|
1485
1485
|
getDefaultOptions() {
|
|
1486
1486
|
return this.gen.defaultOptions;
|
|
1487
1487
|
}
|
|
1488
|
-
opsToPath(e,
|
|
1489
|
-
return this.gen.opsToPath(e,
|
|
1488
|
+
opsToPath(e, s) {
|
|
1489
|
+
return this.gen.opsToPath(e, s);
|
|
1490
1490
|
}
|
|
1491
|
-
line(e,
|
|
1492
|
-
const i = this.gen.line(e,
|
|
1491
|
+
line(e, s, t, n, r) {
|
|
1492
|
+
const i = this.gen.line(e, s, t, n, r);
|
|
1493
1493
|
return this.draw(i);
|
|
1494
1494
|
}
|
|
1495
|
-
rectangle(e,
|
|
1496
|
-
const i = this.gen.rectangle(e,
|
|
1495
|
+
rectangle(e, s, t, n, r) {
|
|
1496
|
+
const i = this.gen.rectangle(e, s, t, n, r);
|
|
1497
1497
|
return this.draw(i);
|
|
1498
1498
|
}
|
|
1499
|
-
ellipse(e,
|
|
1500
|
-
const i = this.gen.ellipse(e,
|
|
1499
|
+
ellipse(e, s, t, n, r) {
|
|
1500
|
+
const i = this.gen.ellipse(e, s, t, n, r);
|
|
1501
1501
|
return this.draw(i);
|
|
1502
1502
|
}
|
|
1503
|
-
circle(e,
|
|
1504
|
-
const r = this.gen.circle(e,
|
|
1503
|
+
circle(e, s, t, n) {
|
|
1504
|
+
const r = this.gen.circle(e, s, t, n);
|
|
1505
1505
|
return this.draw(r);
|
|
1506
1506
|
}
|
|
1507
|
-
linearPath(e,
|
|
1508
|
-
const
|
|
1509
|
-
return this.draw(
|
|
1507
|
+
linearPath(e, s) {
|
|
1508
|
+
const t = this.gen.linearPath(e, s);
|
|
1509
|
+
return this.draw(t);
|
|
1510
1510
|
}
|
|
1511
|
-
polygon(e,
|
|
1512
|
-
const
|
|
1513
|
-
return this.draw(
|
|
1511
|
+
polygon(e, s) {
|
|
1512
|
+
const t = this.gen.polygon(e, s);
|
|
1513
|
+
return this.draw(t);
|
|
1514
1514
|
}
|
|
1515
|
-
arc(e,
|
|
1516
|
-
const u = this.gen.arc(e,
|
|
1515
|
+
arc(e, s, t, n, r, i, a = !1, c) {
|
|
1516
|
+
const u = this.gen.arc(e, s, t, n, r, i, a, c);
|
|
1517
1517
|
return this.draw(u);
|
|
1518
1518
|
}
|
|
1519
|
-
curve(e,
|
|
1520
|
-
const
|
|
1521
|
-
return this.draw(
|
|
1519
|
+
curve(e, s) {
|
|
1520
|
+
const t = this.gen.curve(e, s);
|
|
1521
|
+
return this.draw(t);
|
|
1522
1522
|
}
|
|
1523
|
-
path(e,
|
|
1524
|
-
const
|
|
1525
|
-
return this.draw(
|
|
1523
|
+
path(e, s) {
|
|
1524
|
+
const t = this.gen.path(e, s);
|
|
1525
|
+
return this.draw(t);
|
|
1526
1526
|
}
|
|
1527
1527
|
}
|
|
1528
|
-
const
|
|
1528
|
+
const A = {
|
|
1529
1529
|
canvas(o, e) {
|
|
1530
|
-
return new
|
|
1530
|
+
return new Dt(o, e);
|
|
1531
1531
|
},
|
|
1532
1532
|
svg(o, e) {
|
|
1533
1533
|
return new It(o, e);
|
|
@@ -1538,15 +1538,15 @@ const L = {
|
|
|
1538
1538
|
newSeed() {
|
|
1539
1539
|
return ve.newSeed();
|
|
1540
1540
|
}
|
|
1541
|
-
},
|
|
1542
|
-
H${o +
|
|
1543
|
-
A${
|
|
1544
|
-
V${e +
|
|
1545
|
-
A${
|
|
1546
|
-
H${o +
|
|
1547
|
-
A${
|
|
1548
|
-
V${e +
|
|
1549
|
-
A${
|
|
1541
|
+
}, K = (o, e, s, t, n) => `M${o + n},${e}
|
|
1542
|
+
H${o + s - n}
|
|
1543
|
+
A${n},${n} 0 0 1 ${o + s},${e + n}
|
|
1544
|
+
V${e + t - n}
|
|
1545
|
+
A${n},${n} 0 0 1 ${o + s - n},${e + t}
|
|
1546
|
+
H${o + n}
|
|
1547
|
+
A${n},${n} 0 0 1 ${o},${e + t - n}
|
|
1548
|
+
V${e + n}
|
|
1549
|
+
A${n},${n} 0 0 1 ${o + n},${e}
|
|
1550
1550
|
Z`, Nt = {
|
|
1551
1551
|
"drawui-button": "_drawui-button_1nx7z_1"
|
|
1552
1552
|
}, ge = {
|
|
@@ -1565,7 +1565,7 @@ const L = {
|
|
|
1565
1565
|
}
|
|
1566
1566
|
},
|
|
1567
1567
|
roughness: {
|
|
1568
|
-
roughness:
|
|
1568
|
+
roughness: 3,
|
|
1569
1569
|
bowing: 2
|
|
1570
1570
|
},
|
|
1571
1571
|
fill: {
|
|
@@ -1623,7 +1623,7 @@ const L = {
|
|
|
1623
1623
|
}
|
|
1624
1624
|
}
|
|
1625
1625
|
}, et = nt(ge), Gt = ({ theme: o, children: e }) => {
|
|
1626
|
-
const
|
|
1626
|
+
const s = {
|
|
1627
1627
|
...ge,
|
|
1628
1628
|
...o,
|
|
1629
1629
|
stroke: {
|
|
@@ -1635,65 +1635,67 @@ const L = {
|
|
|
1635
1635
|
...o?.radius
|
|
1636
1636
|
}
|
|
1637
1637
|
};
|
|
1638
|
-
return /* @__PURE__ */
|
|
1639
|
-
},
|
|
1638
|
+
return /* @__PURE__ */ M.jsx(et.Provider, { value: s, children: e });
|
|
1639
|
+
}, j = () => rt(et), Vt = ({
|
|
1640
1640
|
strokeWeight: o = "medium",
|
|
1641
1641
|
radius: e = "md",
|
|
1642
|
-
size:
|
|
1643
|
-
backgroundColor:
|
|
1644
|
-
children:
|
|
1645
|
-
|
|
1642
|
+
size: s = "sm",
|
|
1643
|
+
backgroundColor: t,
|
|
1644
|
+
children: n,
|
|
1645
|
+
fillStyle: r,
|
|
1646
|
+
...i
|
|
1646
1647
|
}) => {
|
|
1647
|
-
const
|
|
1648
|
-
return
|
|
1649
|
-
if (!
|
|
1650
|
-
const
|
|
1651
|
-
|
|
1652
|
-
const
|
|
1653
|
-
|
|
1648
|
+
const a = j(), c = O(null), [u, l] = Y(!1), h = a.buttonSize[s].width, f = a.buttonSize[s].height, d = a.buttonSize[s].fontSize;
|
|
1649
|
+
return R(() => {
|
|
1650
|
+
if (!c.current) return;
|
|
1651
|
+
const g = A.svg(c.current);
|
|
1652
|
+
c.current.innerHTML = "";
|
|
1653
|
+
const m = a.stroke[o], b = g.path(
|
|
1654
|
+
K(0, 0, h, f, a.radius[e]),
|
|
1654
1655
|
{
|
|
1655
|
-
stroke:
|
|
1656
|
-
strokeWidth:
|
|
1657
|
-
fill:
|
|
1658
|
-
|
|
1659
|
-
|
|
1656
|
+
stroke: m.color,
|
|
1657
|
+
strokeWidth: m.width,
|
|
1658
|
+
fill: t ?? a.fill.background,
|
|
1659
|
+
fillStyle: r,
|
|
1660
|
+
roughness: u ? a.roughness.roughness + 1 : a.roughness.roughness,
|
|
1661
|
+
bowing: a.roughness.bowing
|
|
1660
1662
|
}
|
|
1661
1663
|
);
|
|
1662
|
-
|
|
1663
|
-
}, [
|
|
1664
|
+
c.current.appendChild(b);
|
|
1665
|
+
}, [u, o, e, a]), /* @__PURE__ */ M.jsxs(
|
|
1664
1666
|
"button",
|
|
1665
1667
|
{
|
|
1666
|
-
...
|
|
1667
|
-
onMouseEnter: () =>
|
|
1668
|
-
onMouseLeave: () =>
|
|
1669
|
-
className: `${Nt["drawui-button"]} ${
|
|
1668
|
+
...i,
|
|
1669
|
+
onMouseEnter: () => l(!0),
|
|
1670
|
+
onMouseLeave: () => l(!1),
|
|
1671
|
+
className: `${Nt["drawui-button"]} ${i.className ?? ""}`,
|
|
1670
1672
|
style: {
|
|
1671
1673
|
position: "relative",
|
|
1672
|
-
width:
|
|
1673
|
-
height:
|
|
1674
|
+
width: h,
|
|
1675
|
+
height: f,
|
|
1674
1676
|
border: "none",
|
|
1675
1677
|
background: "transparent",
|
|
1676
1678
|
cursor: "pointer"
|
|
1677
1679
|
},
|
|
1678
1680
|
children: [
|
|
1679
|
-
/* @__PURE__ */
|
|
1681
|
+
/* @__PURE__ */ M.jsx(
|
|
1680
1682
|
"svg",
|
|
1681
1683
|
{
|
|
1682
|
-
ref:
|
|
1683
|
-
width:
|
|
1684
|
-
height:
|
|
1684
|
+
ref: c,
|
|
1685
|
+
width: h,
|
|
1686
|
+
height: f,
|
|
1685
1687
|
style: { position: "absolute", inset: 0 }
|
|
1686
1688
|
}
|
|
1687
1689
|
),
|
|
1688
|
-
/* @__PURE__ */
|
|
1690
|
+
/* @__PURE__ */ M.jsx(
|
|
1689
1691
|
"span",
|
|
1690
1692
|
{
|
|
1691
1693
|
style: {
|
|
1692
1694
|
position: "relative",
|
|
1693
|
-
fontSize:
|
|
1695
|
+
fontSize: d,
|
|
1694
1696
|
pointerEvents: "none"
|
|
1695
1697
|
},
|
|
1696
|
-
children:
|
|
1698
|
+
children: n
|
|
1697
1699
|
}
|
|
1698
1700
|
)
|
|
1699
1701
|
]
|
|
@@ -1704,49 +1706,51 @@ const L = {
|
|
|
1704
1706
|
"drawui-card-header": "_drawui-card-header_vhoat_7",
|
|
1705
1707
|
"drawui-card-body": "_drawui-card-body_vhoat_12",
|
|
1706
1708
|
"drawui-card-footer": "_drawui-card-footer_vhoat_17"
|
|
1707
|
-
}, Wt = "_vertical_1tdom_6",
|
|
1709
|
+
}, Wt = "_vertical_1tdom_6", Ht = "_horizontal_1tdom_11", Pe = {
|
|
1708
1710
|
"drawui-divider": "_drawui-divider_1tdom_1",
|
|
1709
1711
|
vertical: Wt,
|
|
1710
|
-
horizontal:
|
|
1712
|
+
horizontal: Ht
|
|
1711
1713
|
}, Ge = ({
|
|
1712
1714
|
strokeWeight: o = "medium",
|
|
1713
1715
|
width: e = "100%",
|
|
1714
|
-
vertical:
|
|
1715
|
-
className:
|
|
1716
|
+
vertical: s = !1,
|
|
1717
|
+
className: t,
|
|
1718
|
+
fillStyle: n
|
|
1716
1719
|
}) => {
|
|
1717
|
-
const
|
|
1718
|
-
return
|
|
1719
|
-
if (!
|
|
1720
|
-
|
|
1721
|
-
const
|
|
1722
|
-
if (
|
|
1723
|
-
const
|
|
1724
|
-
stroke:
|
|
1725
|
-
strokeWidth:
|
|
1726
|
-
roughness:
|
|
1727
|
-
bowing:
|
|
1720
|
+
const r = j(), i = O(null);
|
|
1721
|
+
return R(() => {
|
|
1722
|
+
if (!i.current) return;
|
|
1723
|
+
i.current.innerHTML = "";
|
|
1724
|
+
const a = A.svg(i.current), c = r.stroke[o];
|
|
1725
|
+
if (s) {
|
|
1726
|
+
const u = typeof e == "number" ? e : 100, l = a.line(0, 0, 0, u, {
|
|
1727
|
+
stroke: c.color,
|
|
1728
|
+
strokeWidth: c.width,
|
|
1729
|
+
roughness: r.roughness.roughness,
|
|
1730
|
+
bowing: r.roughness.bowing
|
|
1728
1731
|
});
|
|
1729
|
-
|
|
1732
|
+
i.current.appendChild(l);
|
|
1730
1733
|
} else {
|
|
1731
|
-
const
|
|
1732
|
-
stroke:
|
|
1733
|
-
strokeWidth:
|
|
1734
|
-
roughness:
|
|
1735
|
-
bowing:
|
|
1734
|
+
const u = typeof e == "number" ? e : 300, l = a.line(0, 0, u, 0, {
|
|
1735
|
+
stroke: c.color,
|
|
1736
|
+
strokeWidth: c.width,
|
|
1737
|
+
roughness: r.roughness.roughness,
|
|
1738
|
+
bowing: r.roughness.bowing,
|
|
1739
|
+
fillStyle: n
|
|
1736
1740
|
});
|
|
1737
|
-
|
|
1741
|
+
i.current.appendChild(l);
|
|
1738
1742
|
}
|
|
1739
|
-
}, [
|
|
1743
|
+
}, [r, o, e, s]), /* @__PURE__ */ M.jsx(
|
|
1740
1744
|
"div",
|
|
1741
1745
|
{
|
|
1742
|
-
className: `${Pe["drawui-divider"]} ${
|
|
1743
|
-
style: { width:
|
|
1744
|
-
children: /* @__PURE__ */
|
|
1746
|
+
className: `${Pe["drawui-divider"]} ${s ? Pe.vertical : Pe.horizontal} ${t ?? ""}`,
|
|
1747
|
+
style: { width: s ? void 0 : e },
|
|
1748
|
+
children: /* @__PURE__ */ M.jsx(
|
|
1745
1749
|
"svg",
|
|
1746
1750
|
{
|
|
1747
|
-
ref:
|
|
1748
|
-
width:
|
|
1749
|
-
height:
|
|
1751
|
+
ref: i,
|
|
1752
|
+
width: s ? 2 : e,
|
|
1753
|
+
height: s ? e : 2,
|
|
1750
1754
|
style: { display: "block" }
|
|
1751
1755
|
}
|
|
1752
1756
|
)
|
|
@@ -1755,58 +1759,86 @@ const L = {
|
|
|
1755
1759
|
}, Yt = ({
|
|
1756
1760
|
strokeWeight: o = "medium",
|
|
1757
1761
|
radius: e = "md",
|
|
1758
|
-
width:
|
|
1759
|
-
height:
|
|
1760
|
-
|
|
1762
|
+
width: s = 300,
|
|
1763
|
+
height: t,
|
|
1764
|
+
//optional, card adjust height itself by content
|
|
1765
|
+
backgroundColor: n,
|
|
1761
1766
|
header: r,
|
|
1762
1767
|
footer: i,
|
|
1763
|
-
|
|
1764
|
-
|
|
1768
|
+
fillStyle: a,
|
|
1769
|
+
children: c,
|
|
1770
|
+
...u
|
|
1765
1771
|
}) => {
|
|
1766
|
-
const
|
|
1767
|
-
|
|
1768
|
-
if (!
|
|
1769
|
-
const
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1772
|
+
const l = j(), h = O(null), f = O(null), [d, g] = Y(!1), [m, b] = Y(t ?? 200);
|
|
1773
|
+
R(() => {
|
|
1774
|
+
if (!f.current || t) return;
|
|
1775
|
+
const y = () => {
|
|
1776
|
+
if (f.current) {
|
|
1777
|
+
const z = f.current.scrollHeight;
|
|
1778
|
+
b(z);
|
|
1779
|
+
}
|
|
1780
|
+
};
|
|
1781
|
+
y();
|
|
1782
|
+
const C = new ResizeObserver(y);
|
|
1783
|
+
return C.observe(f.current), () => C.disconnect();
|
|
1784
|
+
}, [c, r, i, t]), R(() => {
|
|
1785
|
+
if (!h.current) return;
|
|
1786
|
+
const y = A.svg(h.current);
|
|
1787
|
+
h.current.innerHTML = "";
|
|
1788
|
+
const C = l.stroke[o], z = t ?? m, N = y.path(
|
|
1789
|
+
K(0, 0, s, z, l.radius[e]),
|
|
1773
1790
|
{
|
|
1774
|
-
stroke:
|
|
1775
|
-
strokeWidth:
|
|
1776
|
-
fill:
|
|
1777
|
-
roughness:
|
|
1778
|
-
bowing:
|
|
1791
|
+
stroke: C.color,
|
|
1792
|
+
strokeWidth: C.width,
|
|
1793
|
+
fill: n ?? l.fill.background,
|
|
1794
|
+
roughness: d ? l.roughness.roughness + 1 : l.roughness.roughness,
|
|
1795
|
+
bowing: l.roughness.bowing,
|
|
1796
|
+
fillStyle: a
|
|
1779
1797
|
}
|
|
1780
1798
|
);
|
|
1781
|
-
|
|
1782
|
-
}, [
|
|
1799
|
+
h.current.appendChild(N);
|
|
1800
|
+
}, [
|
|
1801
|
+
o,
|
|
1802
|
+
e,
|
|
1803
|
+
s,
|
|
1804
|
+
m,
|
|
1805
|
+
t,
|
|
1806
|
+
n,
|
|
1807
|
+
l,
|
|
1808
|
+
d,
|
|
1809
|
+
a
|
|
1810
|
+
]);
|
|
1811
|
+
const v = t ?? m;
|
|
1812
|
+
return /* @__PURE__ */ M.jsxs(
|
|
1783
1813
|
"div",
|
|
1784
1814
|
{
|
|
1785
|
-
...
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1815
|
+
...u,
|
|
1816
|
+
ref: f,
|
|
1817
|
+
className: `${fe["drawui-card"]} ${u.className ?? ""}`,
|
|
1818
|
+
onMouseEnter: () => g(!0),
|
|
1819
|
+
onMouseLeave: () => g(!1),
|
|
1789
1820
|
style: {
|
|
1790
1821
|
position: "relative",
|
|
1791
|
-
width:
|
|
1792
|
-
|
|
1822
|
+
width: s,
|
|
1823
|
+
minHeight: t || "auto",
|
|
1824
|
+
height: t || "auto",
|
|
1793
1825
|
cursor: "default",
|
|
1794
1826
|
display: "flex",
|
|
1795
1827
|
flexDirection: "column",
|
|
1796
1828
|
overflow: "hidden"
|
|
1797
1829
|
},
|
|
1798
1830
|
children: [
|
|
1799
|
-
/* @__PURE__ */
|
|
1831
|
+
/* @__PURE__ */ M.jsx(
|
|
1800
1832
|
"svg",
|
|
1801
1833
|
{
|
|
1802
|
-
ref:
|
|
1803
|
-
width:
|
|
1804
|
-
height:
|
|
1834
|
+
ref: h,
|
|
1835
|
+
width: s,
|
|
1836
|
+
height: v,
|
|
1805
1837
|
style: { position: "absolute", inset: 0, pointerEvents: "none" }
|
|
1806
1838
|
}
|
|
1807
1839
|
),
|
|
1808
|
-
r && /* @__PURE__ */
|
|
1809
|
-
/* @__PURE__ */
|
|
1840
|
+
r && /* @__PURE__ */ M.jsxs(M.Fragment, { children: [
|
|
1841
|
+
/* @__PURE__ */ M.jsx(
|
|
1810
1842
|
"div",
|
|
1811
1843
|
{
|
|
1812
1844
|
className: fe["drawui-card-header"],
|
|
@@ -1814,19 +1846,19 @@ const L = {
|
|
|
1814
1846
|
children: r
|
|
1815
1847
|
}
|
|
1816
1848
|
),
|
|
1817
|
-
/* @__PURE__ */
|
|
1849
|
+
/* @__PURE__ */ M.jsx(Ge, { width: s, strokeWeight: "thick" })
|
|
1818
1850
|
] }),
|
|
1819
|
-
/* @__PURE__ */
|
|
1851
|
+
/* @__PURE__ */ M.jsx(
|
|
1820
1852
|
"div",
|
|
1821
1853
|
{
|
|
1822
1854
|
className: fe["drawui-card-body"],
|
|
1823
1855
|
style: { position: "relative", zIndex: 1, flex: 1 },
|
|
1824
|
-
children:
|
|
1856
|
+
children: c
|
|
1825
1857
|
}
|
|
1826
1858
|
),
|
|
1827
|
-
i && /* @__PURE__ */
|
|
1828
|
-
/* @__PURE__ */
|
|
1829
|
-
/* @__PURE__ */
|
|
1859
|
+
i && /* @__PURE__ */ M.jsxs(M.Fragment, { children: [
|
|
1860
|
+
/* @__PURE__ */ M.jsx(Ge, { width: s, strokeWeight: "thick" }),
|
|
1861
|
+
/* @__PURE__ */ M.jsx(
|
|
1830
1862
|
"div",
|
|
1831
1863
|
{
|
|
1832
1864
|
className: fe["drawui-card-footer"],
|
|
@@ -1844,77 +1876,81 @@ const L = {
|
|
|
1844
1876
|
}, Bt = ({
|
|
1845
1877
|
header: o,
|
|
1846
1878
|
children: e,
|
|
1847
|
-
strokeWeight:
|
|
1848
|
-
radius:
|
|
1849
|
-
width:
|
|
1850
|
-
|
|
1879
|
+
strokeWeight: s = "medium",
|
|
1880
|
+
radius: t = "md",
|
|
1881
|
+
width: n = 300,
|
|
1882
|
+
fillStyle: r,
|
|
1883
|
+
className: i
|
|
1851
1884
|
}) => {
|
|
1852
|
-
const
|
|
1853
|
-
return
|
|
1854
|
-
if (!
|
|
1855
|
-
const
|
|
1856
|
-
|
|
1857
|
-
const
|
|
1858
|
-
|
|
1885
|
+
const a = j(), c = O(null);
|
|
1886
|
+
return R(() => {
|
|
1887
|
+
if (!c.current) return;
|
|
1888
|
+
const u = A.svg(c.current);
|
|
1889
|
+
c.current.innerHTML = "";
|
|
1890
|
+
const l = a.stroke[s], h = u.path(
|
|
1891
|
+
K(0, 0, n, 40, a.radius[t]),
|
|
1859
1892
|
{
|
|
1860
|
-
stroke:
|
|
1861
|
-
strokeWidth:
|
|
1893
|
+
stroke: l.color,
|
|
1894
|
+
strokeWidth: l.width,
|
|
1862
1895
|
fill: "transparent",
|
|
1863
|
-
roughness:
|
|
1864
|
-
bowing:
|
|
1896
|
+
roughness: a.roughness.roughness,
|
|
1897
|
+
bowing: a.roughness.bowing,
|
|
1898
|
+
fillStyle: r
|
|
1865
1899
|
}
|
|
1866
1900
|
);
|
|
1867
|
-
|
|
1868
|
-
}, [
|
|
1869
|
-
/* @__PURE__ */
|
|
1870
|
-
/* @__PURE__ */
|
|
1901
|
+
c.current.appendChild(h);
|
|
1902
|
+
}, [a, s, t, n]), /* @__PURE__ */ M.jsx("div", { className: `${Ve["drawui-collapse"]} ${i ?? ""}`, style: { width: n }, children: /* @__PURE__ */ M.jsxs("details", { children: [
|
|
1903
|
+
/* @__PURE__ */ M.jsxs("summary", { style: { position: "relative" }, children: [
|
|
1904
|
+
/* @__PURE__ */ M.jsx(
|
|
1871
1905
|
"svg",
|
|
1872
1906
|
{
|
|
1873
|
-
ref:
|
|
1874
|
-
width:
|
|
1907
|
+
ref: c,
|
|
1908
|
+
width: n,
|
|
1875
1909
|
height: 40,
|
|
1876
1910
|
style: { position: "absolute", inset: 0, pointerEvents: "none" }
|
|
1877
1911
|
}
|
|
1878
1912
|
),
|
|
1879
|
-
/* @__PURE__ */
|
|
1913
|
+
/* @__PURE__ */ M.jsx("span", { style: { position: "relative", zIndex: 1 }, children: o })
|
|
1880
1914
|
] }),
|
|
1881
|
-
/* @__PURE__ */
|
|
1915
|
+
/* @__PURE__ */ M.jsx("div", { className: Ve["drawui-collapse-content"], children: e })
|
|
1882
1916
|
] }) });
|
|
1883
|
-
},
|
|
1917
|
+
}, Ft = {}, Zt = ({
|
|
1884
1918
|
strokeWeight: o = "medium",
|
|
1885
1919
|
radius: e = "md",
|
|
1886
|
-
size:
|
|
1887
|
-
icon:
|
|
1888
|
-
|
|
1889
|
-
|
|
1920
|
+
size: s = "sm",
|
|
1921
|
+
icon: t,
|
|
1922
|
+
fillStyle: n,
|
|
1923
|
+
backgroundColor: r,
|
|
1924
|
+
...i
|
|
1890
1925
|
}) => {
|
|
1891
|
-
const
|
|
1892
|
-
return
|
|
1893
|
-
if (!
|
|
1894
|
-
const
|
|
1895
|
-
|
|
1896
|
-
const
|
|
1897
|
-
|
|
1926
|
+
const a = j(), c = O(null), [u, l] = Y(!1), h = a.buttonSize[s].height;
|
|
1927
|
+
return R(() => {
|
|
1928
|
+
if (!c.current) return;
|
|
1929
|
+
const f = A.svg(c.current);
|
|
1930
|
+
c.current.innerHTML = "";
|
|
1931
|
+
const d = a.stroke[o], g = f.path(
|
|
1932
|
+
K(0, 0, h, h, a.radius[e]),
|
|
1898
1933
|
{
|
|
1899
|
-
stroke:
|
|
1900
|
-
strokeWidth:
|
|
1901
|
-
fill:
|
|
1902
|
-
roughness:
|
|
1903
|
-
bowing:
|
|
1934
|
+
stroke: d.color,
|
|
1935
|
+
strokeWidth: d.width,
|
|
1936
|
+
fill: r ?? a.fill.background,
|
|
1937
|
+
roughness: u ? a.roughness.roughness + 1 : a.roughness.roughness,
|
|
1938
|
+
bowing: a.roughness.bowing,
|
|
1939
|
+
fillStyle: n
|
|
1904
1940
|
}
|
|
1905
1941
|
);
|
|
1906
|
-
|
|
1907
|
-
}, [
|
|
1942
|
+
c.current.appendChild(g);
|
|
1943
|
+
}, [u, o, e, a, h, r]), /* @__PURE__ */ M.jsxs(
|
|
1908
1944
|
"button",
|
|
1909
1945
|
{
|
|
1910
|
-
...
|
|
1911
|
-
onMouseEnter: () =>
|
|
1912
|
-
onMouseLeave: () =>
|
|
1913
|
-
className: `${
|
|
1946
|
+
...i,
|
|
1947
|
+
onMouseEnter: () => l(!0),
|
|
1948
|
+
onMouseLeave: () => l(!1),
|
|
1949
|
+
className: `${Ft["drawui-button"]} ${i.className ?? ""}`,
|
|
1914
1950
|
style: {
|
|
1915
1951
|
position: "relative",
|
|
1916
|
-
width:
|
|
1917
|
-
height:
|
|
1952
|
+
width: h,
|
|
1953
|
+
height: h,
|
|
1918
1954
|
// height and width are equal
|
|
1919
1955
|
border: "none",
|
|
1920
1956
|
background: "transparent",
|
|
@@ -1925,12 +1961,12 @@ const L = {
|
|
|
1925
1961
|
padding: 0
|
|
1926
1962
|
},
|
|
1927
1963
|
children: [
|
|
1928
|
-
/* @__PURE__ */
|
|
1964
|
+
/* @__PURE__ */ M.jsx(
|
|
1929
1965
|
"svg",
|
|
1930
1966
|
{
|
|
1931
|
-
ref:
|
|
1932
|
-
width:
|
|
1933
|
-
height:
|
|
1967
|
+
ref: c,
|
|
1968
|
+
width: h,
|
|
1969
|
+
height: h,
|
|
1934
1970
|
style: {
|
|
1935
1971
|
position: "absolute",
|
|
1936
1972
|
inset: 0,
|
|
@@ -1938,7 +1974,7 @@ const L = {
|
|
|
1938
1974
|
}
|
|
1939
1975
|
}
|
|
1940
1976
|
),
|
|
1941
|
-
/* @__PURE__ */
|
|
1977
|
+
/* @__PURE__ */ M.jsx(
|
|
1942
1978
|
"span",
|
|
1943
1979
|
{
|
|
1944
1980
|
style: {
|
|
@@ -1948,7 +1984,7 @@ const L = {
|
|
|
1948
1984
|
alignItems: "center",
|
|
1949
1985
|
justifyContent: "center"
|
|
1950
1986
|
},
|
|
1951
|
-
children:
|
|
1987
|
+
children: t
|
|
1952
1988
|
}
|
|
1953
1989
|
)
|
|
1954
1990
|
]
|
|
@@ -1960,62 +1996,64 @@ const L = {
|
|
|
1960
1996
|
}, Xt = ({
|
|
1961
1997
|
strokeWeight: o = "medium",
|
|
1962
1998
|
backgroundColor: e,
|
|
1963
|
-
radius:
|
|
1964
|
-
inputSize:
|
|
1965
|
-
className:
|
|
1966
|
-
|
|
1967
|
-
|
|
1999
|
+
radius: s = "md",
|
|
2000
|
+
inputSize: t = "md",
|
|
2001
|
+
className: n,
|
|
2002
|
+
fillStyle: r,
|
|
2003
|
+
style: i,
|
|
2004
|
+
...a
|
|
1968
2005
|
}) => {
|
|
1969
|
-
const
|
|
1970
|
-
return
|
|
1971
|
-
if (!
|
|
1972
|
-
const
|
|
1973
|
-
|
|
1974
|
-
const z =
|
|
1975
|
-
|
|
2006
|
+
const c = j(), u = O(null), l = O(null), [h, f] = Y(!1), [d, g] = Y(!1), m = c.inputSize[t].height, b = c.inputSize[t].fontSize, v = c.inputSize[t].paddingX;
|
|
2007
|
+
return R(() => {
|
|
2008
|
+
if (!u.current || !l.current) return;
|
|
2009
|
+
const y = l.current.offsetWidth, C = A.svg(u.current);
|
|
2010
|
+
u.current.innerHTML = "";
|
|
2011
|
+
const z = c.stroke[o], N = C.path(
|
|
2012
|
+
K(0, 0, y, m, c.radius[s]),
|
|
1976
2013
|
{
|
|
1977
2014
|
stroke: z.color,
|
|
1978
2015
|
strokeWidth: z.width,
|
|
1979
|
-
fill: e ??
|
|
1980
|
-
roughness:
|
|
1981
|
-
bowing:
|
|
2016
|
+
fill: e ?? c.fill.background,
|
|
2017
|
+
roughness: h ? c.roughness.roughness + 1 : c.roughness.roughness,
|
|
2018
|
+
bowing: c.roughness.bowing,
|
|
2019
|
+
fillStyle: r
|
|
1982
2020
|
}
|
|
1983
2021
|
);
|
|
1984
|
-
|
|
1985
|
-
}, [
|
|
2022
|
+
u.current.appendChild(N);
|
|
2023
|
+
}, [h, d, o, s, t, c, e]), /* @__PURE__ */ M.jsxs(
|
|
1986
2024
|
"div",
|
|
1987
2025
|
{
|
|
1988
|
-
ref:
|
|
1989
|
-
className: `${Ye["drawui-input"]} ${
|
|
1990
|
-
style: { height:
|
|
1991
|
-
onMouseEnter: () =>
|
|
1992
|
-
onMouseLeave: () =>
|
|
2026
|
+
ref: l,
|
|
2027
|
+
className: `${Ye["drawui-input"]} ${n ?? ""}`,
|
|
2028
|
+
style: { height: m, ...i },
|
|
2029
|
+
onMouseEnter: () => g(!0),
|
|
2030
|
+
onMouseLeave: () => g(!1),
|
|
1993
2031
|
children: [
|
|
1994
|
-
/* @__PURE__ */
|
|
2032
|
+
/* @__PURE__ */ M.jsx(
|
|
1995
2033
|
"svg",
|
|
1996
2034
|
{
|
|
1997
|
-
ref:
|
|
2035
|
+
ref: u,
|
|
1998
2036
|
width: "100%",
|
|
1999
|
-
height:
|
|
2037
|
+
height: m,
|
|
2000
2038
|
style: { position: "absolute", inset: 0 }
|
|
2001
2039
|
}
|
|
2002
2040
|
),
|
|
2003
|
-
/* @__PURE__ */
|
|
2041
|
+
/* @__PURE__ */ M.jsx(
|
|
2004
2042
|
"input",
|
|
2005
2043
|
{
|
|
2006
|
-
...
|
|
2044
|
+
...a,
|
|
2007
2045
|
className: Ye["drawui-input-field"],
|
|
2008
2046
|
style: {
|
|
2009
|
-
height:
|
|
2010
|
-
fontSize:
|
|
2011
|
-
paddingLeft:
|
|
2012
|
-
paddingRight:
|
|
2047
|
+
height: m,
|
|
2048
|
+
fontSize: b,
|
|
2049
|
+
paddingLeft: v,
|
|
2050
|
+
paddingRight: v
|
|
2013
2051
|
},
|
|
2014
|
-
onFocus: (
|
|
2015
|
-
|
|
2052
|
+
onFocus: (y) => {
|
|
2053
|
+
f(!0), a.onFocus?.(y);
|
|
2016
2054
|
},
|
|
2017
|
-
onBlur: (
|
|
2018
|
-
|
|
2055
|
+
onBlur: (y) => {
|
|
2056
|
+
f(!1), a.onBlur?.(y);
|
|
2019
2057
|
}
|
|
2020
2058
|
}
|
|
2021
2059
|
)
|
|
@@ -2025,203 +2063,203 @@ const L = {
|
|
|
2025
2063
|
}, Ut = ({
|
|
2026
2064
|
size: o = 24,
|
|
2027
2065
|
strokeWeight: e = "medium",
|
|
2028
|
-
color:
|
|
2029
|
-
className:
|
|
2066
|
+
color: s,
|
|
2067
|
+
className: t
|
|
2030
2068
|
}) => {
|
|
2031
|
-
const
|
|
2032
|
-
return
|
|
2069
|
+
const n = j(), r = O(null);
|
|
2070
|
+
return R(() => {
|
|
2033
2071
|
if (!r.current) return;
|
|
2034
|
-
const i =
|
|
2072
|
+
const i = A.svg(r.current);
|
|
2035
2073
|
r.current.innerHTML = "";
|
|
2036
|
-
const a =
|
|
2074
|
+
const a = n.stroke[e], c = s ?? a.color, u = i.path(
|
|
2037
2075
|
"M6 18 H18 L16 12 A6 6 0 0 0 8 12 Z",
|
|
2038
2076
|
{
|
|
2039
|
-
stroke:
|
|
2077
|
+
stroke: c,
|
|
2040
2078
|
strokeWidth: a.width,
|
|
2041
|
-
roughness:
|
|
2042
|
-
bowing:
|
|
2079
|
+
roughness: n.roughness.roughness,
|
|
2080
|
+
bowing: n.roughness.bowing,
|
|
2043
2081
|
fill: "transparent"
|
|
2044
2082
|
}
|
|
2045
2083
|
);
|
|
2046
2084
|
r.current.appendChild(u);
|
|
2047
|
-
const
|
|
2048
|
-
stroke:
|
|
2085
|
+
const l = i.circle(12, 18, 2, {
|
|
2086
|
+
stroke: c,
|
|
2049
2087
|
strokeWidth: a.width,
|
|
2050
|
-
roughness:
|
|
2051
|
-
bowing:
|
|
2088
|
+
roughness: n.roughness.roughness,
|
|
2089
|
+
bowing: n.roughness.bowing,
|
|
2052
2090
|
fill: "transparent"
|
|
2053
2091
|
});
|
|
2054
|
-
r.current.appendChild(
|
|
2055
|
-
}, [
|
|
2092
|
+
r.current.appendChild(l);
|
|
2093
|
+
}, [n, e, s]), /* @__PURE__ */ M.jsx("svg", { ref: r, width: o, height: o, viewBox: "0 0 24 24", className: t });
|
|
2056
2094
|
}, Qt = ({
|
|
2057
2095
|
size: o = 24,
|
|
2058
2096
|
strokeWeight: e = "medium",
|
|
2059
|
-
color:
|
|
2060
|
-
className:
|
|
2097
|
+
color: s,
|
|
2098
|
+
className: t
|
|
2061
2099
|
}) => {
|
|
2062
|
-
const
|
|
2063
|
-
return
|
|
2100
|
+
const n = j(), r = O(null);
|
|
2101
|
+
return R(() => {
|
|
2064
2102
|
if (!r.current) return;
|
|
2065
|
-
const i =
|
|
2103
|
+
const i = A.svg(r.current);
|
|
2066
2104
|
r.current.innerHTML = "";
|
|
2067
|
-
const a =
|
|
2105
|
+
const a = n.stroke[e], c = s ?? a.color, u = i.path(
|
|
2068
2106
|
"M2 12 L12 2 L22 12 V22 H2 Z",
|
|
2069
2107
|
{
|
|
2070
|
-
stroke:
|
|
2108
|
+
stroke: c,
|
|
2071
2109
|
strokeWidth: a.width,
|
|
2072
|
-
roughness:
|
|
2073
|
-
bowing:
|
|
2110
|
+
roughness: n.roughness.roughness,
|
|
2111
|
+
bowing: n.roughness.bowing,
|
|
2074
2112
|
fill: "transparent"
|
|
2075
2113
|
}
|
|
2076
2114
|
);
|
|
2077
2115
|
r.current.appendChild(u);
|
|
2078
|
-
}, [
|
|
2116
|
+
}, [n, e, s]), /* @__PURE__ */ M.jsx(
|
|
2079
2117
|
"svg",
|
|
2080
2118
|
{
|
|
2081
2119
|
ref: r,
|
|
2082
2120
|
width: o,
|
|
2083
2121
|
height: o,
|
|
2084
2122
|
viewBox: "0 0 24 24",
|
|
2085
|
-
className:
|
|
2123
|
+
className: t
|
|
2086
2124
|
}
|
|
2087
2125
|
);
|
|
2088
2126
|
}, Jt = ({
|
|
2089
2127
|
size: o = 24,
|
|
2090
2128
|
strokeWeight: e = "medium",
|
|
2091
|
-
color:
|
|
2092
|
-
className:
|
|
2129
|
+
color: s,
|
|
2130
|
+
className: t
|
|
2093
2131
|
}) => {
|
|
2094
|
-
const
|
|
2095
|
-
return
|
|
2132
|
+
const n = j(), r = O(null);
|
|
2133
|
+
return R(() => {
|
|
2096
2134
|
if (!r.current) return;
|
|
2097
|
-
const i =
|
|
2135
|
+
const i = A.svg(r.current);
|
|
2098
2136
|
r.current.innerHTML = "";
|
|
2099
|
-
const a =
|
|
2100
|
-
stroke:
|
|
2137
|
+
const a = n.stroke[e], c = s ?? a.color, u = i.line(4, 12, 20, 12, {
|
|
2138
|
+
stroke: c,
|
|
2101
2139
|
strokeWidth: a.width,
|
|
2102
|
-
roughness:
|
|
2103
|
-
bowing:
|
|
2140
|
+
roughness: n.roughness.roughness,
|
|
2141
|
+
bowing: n.roughness.bowing
|
|
2104
2142
|
});
|
|
2105
2143
|
r.current.appendChild(u);
|
|
2106
|
-
}, [
|
|
2144
|
+
}, [n, e, s]), /* @__PURE__ */ M.jsx("svg", { ref: r, width: o, height: o, viewBox: "0 0 24 24", className: t });
|
|
2107
2145
|
}, Kt = ({
|
|
2108
2146
|
size: o = 24,
|
|
2109
2147
|
strokeWeight: e = "medium",
|
|
2110
|
-
color:
|
|
2111
|
-
className:
|
|
2148
|
+
color: s,
|
|
2149
|
+
className: t
|
|
2112
2150
|
}) => {
|
|
2113
|
-
const
|
|
2114
|
-
return
|
|
2151
|
+
const n = j(), r = O(null);
|
|
2152
|
+
return R(() => {
|
|
2115
2153
|
if (!r.current) return;
|
|
2116
|
-
const i =
|
|
2154
|
+
const i = A.svg(r.current);
|
|
2117
2155
|
r.current.innerHTML = "";
|
|
2118
|
-
const a =
|
|
2119
|
-
stroke:
|
|
2156
|
+
const a = n.stroke[e], c = s ?? a.color, u = i.line(12, 4, 12, 20, {
|
|
2157
|
+
stroke: c,
|
|
2120
2158
|
strokeWidth: a.width,
|
|
2121
|
-
roughness:
|
|
2122
|
-
bowing:
|
|
2123
|
-
}),
|
|
2124
|
-
stroke:
|
|
2159
|
+
roughness: n.roughness.roughness,
|
|
2160
|
+
bowing: n.roughness.bowing
|
|
2161
|
+
}), l = i.line(4, 12, 20, 12, {
|
|
2162
|
+
stroke: c,
|
|
2125
2163
|
strokeWidth: a.width,
|
|
2126
|
-
roughness:
|
|
2127
|
-
bowing:
|
|
2164
|
+
roughness: n.roughness.roughness,
|
|
2165
|
+
bowing: n.roughness.bowing
|
|
2128
2166
|
});
|
|
2129
|
-
r.current.appendChild(u), r.current.appendChild(
|
|
2130
|
-
}, [
|
|
2167
|
+
r.current.appendChild(u), r.current.appendChild(l);
|
|
2168
|
+
}, [n, e, s]), /* @__PURE__ */ M.jsx("svg", { ref: r, width: o, height: o, viewBox: "0 0 24 24", className: t });
|
|
2131
2169
|
}, es = ({
|
|
2132
2170
|
size: o = 24,
|
|
2133
2171
|
strokeWeight: e = "medium",
|
|
2134
|
-
color:
|
|
2135
|
-
className:
|
|
2172
|
+
color: s,
|
|
2173
|
+
className: t
|
|
2136
2174
|
}) => {
|
|
2137
|
-
const
|
|
2138
|
-
return
|
|
2175
|
+
const n = j(), r = O(null);
|
|
2176
|
+
return R(() => {
|
|
2139
2177
|
if (!r.current) return;
|
|
2140
|
-
const i =
|
|
2178
|
+
const i = A.svg(r.current);
|
|
2141
2179
|
r.current.innerHTML = "";
|
|
2142
|
-
const a =
|
|
2143
|
-
stroke:
|
|
2180
|
+
const a = n.stroke[e], c = s ?? a.color, u = i.circle(10, 10, 14, {
|
|
2181
|
+
stroke: c,
|
|
2144
2182
|
strokeWidth: a.width,
|
|
2145
|
-
roughness:
|
|
2146
|
-
bowing:
|
|
2183
|
+
roughness: n.roughness.roughness,
|
|
2184
|
+
bowing: n.roughness.bowing,
|
|
2147
2185
|
fill: "transparent"
|
|
2148
|
-
}),
|
|
2149
|
-
stroke:
|
|
2186
|
+
}), l = i.line(16, 16, 22, 22, {
|
|
2187
|
+
stroke: c,
|
|
2150
2188
|
strokeWidth: a.width,
|
|
2151
|
-
roughness:
|
|
2152
|
-
bowing:
|
|
2189
|
+
roughness: n.roughness.roughness,
|
|
2190
|
+
bowing: n.roughness.bowing
|
|
2153
2191
|
});
|
|
2154
|
-
r.current.appendChild(u), r.current.appendChild(
|
|
2155
|
-
}, [
|
|
2192
|
+
r.current.appendChild(u), r.current.appendChild(l);
|
|
2193
|
+
}, [n, e, s]), /* @__PURE__ */ M.jsx(
|
|
2156
2194
|
"svg",
|
|
2157
2195
|
{
|
|
2158
2196
|
ref: r,
|
|
2159
2197
|
width: o,
|
|
2160
2198
|
height: o,
|
|
2161
2199
|
viewBox: "0 0 24 24",
|
|
2162
|
-
className:
|
|
2200
|
+
className: t
|
|
2163
2201
|
}
|
|
2164
2202
|
);
|
|
2165
2203
|
}, ts = ({
|
|
2166
2204
|
size: o = 24,
|
|
2167
2205
|
strokeWeight: e = "medium",
|
|
2168
|
-
color:
|
|
2169
|
-
className:
|
|
2206
|
+
color: s,
|
|
2207
|
+
className: t
|
|
2170
2208
|
}) => {
|
|
2171
|
-
const
|
|
2172
|
-
return
|
|
2209
|
+
const n = j(), r = O(null);
|
|
2210
|
+
return R(() => {
|
|
2173
2211
|
if (!r.current) return;
|
|
2174
|
-
const i =
|
|
2212
|
+
const i = A.svg(r.current);
|
|
2175
2213
|
r.current.innerHTML = "";
|
|
2176
|
-
const a =
|
|
2177
|
-
stroke:
|
|
2214
|
+
const a = n.stroke[e], c = s ?? a.color, u = i.circle(12, 12, 14, {
|
|
2215
|
+
stroke: c,
|
|
2178
2216
|
strokeWidth: a.width,
|
|
2179
|
-
roughness:
|
|
2180
|
-
bowing:
|
|
2217
|
+
roughness: n.roughness.roughness,
|
|
2218
|
+
bowing: n.roughness.bowing,
|
|
2181
2219
|
fill: "transparent"
|
|
2182
2220
|
});
|
|
2183
2221
|
r.current.appendChild(u);
|
|
2184
|
-
for (let
|
|
2185
|
-
const h =
|
|
2186
|
-
stroke:
|
|
2222
|
+
for (let l = 0; l < 8; l++) {
|
|
2223
|
+
const h = l * Math.PI * 2 / 8, f = 12 + 7 * Math.cos(h), d = 12 + 7 * Math.sin(h), g = 12 + 10 * Math.cos(h), m = 12 + 10 * Math.sin(h), b = i.line(f, d, g, m, {
|
|
2224
|
+
stroke: c,
|
|
2187
2225
|
strokeWidth: a.width,
|
|
2188
|
-
roughness:
|
|
2189
|
-
bowing:
|
|
2226
|
+
roughness: n.roughness.roughness,
|
|
2227
|
+
bowing: n.roughness.bowing
|
|
2190
2228
|
});
|
|
2191
2229
|
r.current.appendChild(b);
|
|
2192
2230
|
}
|
|
2193
|
-
}, [
|
|
2231
|
+
}, [n, e, s]), /* @__PURE__ */ M.jsx("svg", { ref: r, width: o, height: o, viewBox: "0 0 24 24", className: t });
|
|
2194
2232
|
}, ss = ({
|
|
2195
2233
|
size: o = 24,
|
|
2196
2234
|
strokeWeight: e = "medium",
|
|
2197
|
-
color:
|
|
2198
|
-
className:
|
|
2235
|
+
color: s,
|
|
2236
|
+
className: t
|
|
2199
2237
|
}) => {
|
|
2200
|
-
const
|
|
2201
|
-
return
|
|
2238
|
+
const n = j(), r = O(null);
|
|
2239
|
+
return R(() => {
|
|
2202
2240
|
if (!r.current) return;
|
|
2203
|
-
const i =
|
|
2241
|
+
const i = A.svg(r.current);
|
|
2204
2242
|
r.current.innerHTML = "";
|
|
2205
|
-
const a =
|
|
2206
|
-
stroke:
|
|
2243
|
+
const a = n.stroke[e], c = s ?? a.color, u = i.circle(12, 8, 6, {
|
|
2244
|
+
stroke: c,
|
|
2207
2245
|
strokeWidth: a.width,
|
|
2208
|
-
roughness:
|
|
2209
|
-
bowing:
|
|
2246
|
+
roughness: n.roughness.roughness,
|
|
2247
|
+
bowing: n.roughness.bowing,
|
|
2210
2248
|
fill: "transparent"
|
|
2211
2249
|
});
|
|
2212
2250
|
r.current.appendChild(u);
|
|
2213
|
-
const
|
|
2251
|
+
const l = i.path(
|
|
2214
2252
|
"M4 20 Q12 16 20 20",
|
|
2215
2253
|
{
|
|
2216
|
-
stroke:
|
|
2254
|
+
stroke: c,
|
|
2217
2255
|
strokeWidth: a.width,
|
|
2218
|
-
roughness:
|
|
2219
|
-
bowing:
|
|
2256
|
+
roughness: n.roughness.roughness,
|
|
2257
|
+
bowing: n.roughness.bowing,
|
|
2220
2258
|
fill: "transparent"
|
|
2221
2259
|
}
|
|
2222
2260
|
);
|
|
2223
|
-
r.current.appendChild(
|
|
2224
|
-
}, [
|
|
2261
|
+
r.current.appendChild(l);
|
|
2262
|
+
}, [n, e, s]), /* @__PURE__ */ M.jsx("svg", { ref: r, width: o, height: o, viewBox: "0 0 24 24", className: t });
|
|
2225
2263
|
};
|
|
2226
2264
|
export {
|
|
2227
2265
|
Vt as DrawuiButton,
|
|
@@ -2238,5 +2276,5 @@ export {
|
|
|
2238
2276
|
es as IconSearch,
|
|
2239
2277
|
ts as IconSettings,
|
|
2240
2278
|
ss as IconUser,
|
|
2241
|
-
|
|
2279
|
+
j as useDrawuiTheme
|
|
2242
2280
|
};
|