@thibezer/ui-components-kit 2.28.1 → 2.28.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 +12 -0
- package/dist/camadas.cjs +43 -43
- package/dist/camadas.js +788 -802
- package/dist/canvas.cjs +38 -38
- package/dist/canvas.js +1045 -1022
- package/dist/components/ui-camadas/camadas-metricas.d.ts +2 -3
- package/dist/components/ui-canvas-cad/cad-hud-coordenadas.d.ts +12 -0
- package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +6 -1
- package/dist/custom-elements.json +26706 -26600
- package/dist/feature_caixa-BLVtatpp.cjs +1 -0
- package/dist/feature_caixa-CHAdzESq.js +806 -0
- package/dist/{feature_desenho-BH-E1Q9Q.cjs → feature_desenho-DRHnu8u8.cjs} +1 -1
- package/dist/{feature_desenho-CC8Mp5Gp.js → feature_desenho-edf-dHuf.js} +2 -2
- package/dist/feature_metricas-CKQGG2nz.cjs +1 -0
- package/dist/feature_metricas-DGfd21VR.js +130 -0
- package/dist/geometria-px-DEAIxMG5.js +512 -0
- package/dist/geometria-px-DJcNHXbE.cjs +1 -0
- package/dist/gerencigeo-canvas/dms.d.ts +7 -0
- package/dist/gerencigeo-canvas/feature_algoritmos.d.ts +1 -4
- package/dist/gerencigeo-canvas/utils.d.ts +1 -3
- package/dist/mapa.cjs +1 -1
- package/dist/mapa.js +1 -1
- package/dist/motor.cjs +1 -1
- package/dist/motor.js +113 -111
- package/dist/prancha-nucleo.cjs +3 -3
- package/dist/prancha-nucleo.js +283 -282
- package/dist/prancha.cjs +1 -1
- package/dist/prancha.js +3 -3
- package/dist/utils-B2HuBLwz.js +108 -0
- package/dist/utils-DpPysTeU.cjs +1 -0
- package/package.json +1 -1
- package/dist/feature_caixa-4M4MkFH7.cjs +0 -1
- package/dist/feature_caixa-BVc5LenS.js +0 -824
- package/dist/geometria-px-Cyi_oPD6.cjs +0 -1
- package/dist/geometria-px-DHMPUsxC.js +0 -639
- package/dist/utils-ClVgqVyJ.cjs +0 -1
- package/dist/utils-DrHoxxmf.js +0 -83
package/dist/prancha-nucleo.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
var lo = Object.defineProperty;
|
|
2
2
|
var fo = (t, a, n) => a in t ? lo(t, a, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[a] = n;
|
|
3
3
|
var P = (t, a, n) => fo(t, typeof a != "symbol" ? a + "" : a, n);
|
|
4
|
-
import { a as At,
|
|
5
|
-
import { b as Io, a as $o,
|
|
6
|
-
import { E as
|
|
7
|
-
import {
|
|
8
|
-
|
|
4
|
+
import { a as At, m as Wa, B as ho, w as mo, x as zn, u as po, H as go, d as z, q as Za, I as yo, D as pa, n as bo, f as Mo, P as xo, Q as vo, c as Ao, p as Po } from "./geometria-px-DEAIxMG5.js";
|
|
5
|
+
import { b as Io, a as $o, S as So, H as Eo, G as jo, p as Lo, T as zo, F as oa, q as lt, A as No, n as za, o as Co, C as To, B as qo, t as Do, r as Nn, f as Pt, d as Oo, x as wo, j as ko, i as Ro } from "./feature_caixa-CHAdzESq.js";
|
|
6
|
+
import { E as $s } from "./feature_caixa-CHAdzESq.js";
|
|
7
|
+
import { l as Cn } from "./feature_metricas-DGfd21VR.js";
|
|
8
|
+
import { e as Na } from "./cores-utils-DMyqWvZh.js";
|
|
9
|
+
function Ot(t) {
|
|
9
10
|
const a = t.length;
|
|
10
11
|
if (a < 3) return 0;
|
|
11
12
|
let n = 0;
|
|
@@ -18,7 +19,7 @@ function Dt(t) {
|
|
|
18
19
|
function Fo(t) {
|
|
19
20
|
const [a, ...n] = t;
|
|
20
21
|
if (!a) return 0;
|
|
21
|
-
const o = Math.abs(
|
|
22
|
+
const o = Math.abs(Ot(a)) - n.reduce((e, r) => e + Math.abs(Ot(r)), 0);
|
|
22
23
|
return Number.isFinite(o) ? Math.max(0, o) : 0;
|
|
23
24
|
}
|
|
24
25
|
function _o(t, a = !1) {
|
|
@@ -58,14 +59,14 @@ const A = Object.freeze({
|
|
|
58
59
|
function Tn(t) {
|
|
59
60
|
return typeof t == "string" && Object.prototype.hasOwnProperty.call(Ca, t);
|
|
60
61
|
}
|
|
61
|
-
function
|
|
62
|
+
function Wr(t, a) {
|
|
62
63
|
return !Number.isFinite(t) || !Tn(a) ? NaN : t * Ca[a];
|
|
63
64
|
}
|
|
64
|
-
function
|
|
65
|
+
function Zr(t, a) {
|
|
65
66
|
return !Number.isFinite(t) || !Tn(a) ? NaN : t / Ca[a];
|
|
66
67
|
}
|
|
67
68
|
const qn = 1e-12, pt = (t) => typeof t == "number" && Number.isFinite(t), nt = Object.freeze({ a: 1, b: 0, c: 0, d: 1, e: 0, f: 0 });
|
|
68
|
-
function
|
|
69
|
+
function Jr(t, a, n, o, e, r) {
|
|
69
70
|
return { a: t, b: a, c: n, d: o, e, f: r };
|
|
70
71
|
}
|
|
71
72
|
function wt(t) {
|
|
@@ -76,8 +77,8 @@ function wt(t) {
|
|
|
76
77
|
function It(t) {
|
|
77
78
|
return wt(t) ? { a: t.a, b: t.b, c: t.c, d: t.d, e: t.e, f: t.f } : nt;
|
|
78
79
|
}
|
|
79
|
-
const Jt = (t) => t.a * t.d - t.b * t.c, Xo = (t) => !(Math.abs(Jt(t)) > qn),
|
|
80
|
-
function
|
|
80
|
+
const Jt = (t) => t.a * t.d - t.b * t.c, Xo = (t) => !(Math.abs(Jt(t)) > qn), Qr = (t, a = 0) => Math.abs(t.a - 1) <= a && Math.abs(t.b) <= a && Math.abs(t.c) <= a && Math.abs(t.d - 1) <= a && Math.abs(t.e) <= a && Math.abs(t.f) <= a;
|
|
81
|
+
function Kr(t, a, n = 1e-9) {
|
|
81
82
|
return Math.abs(t.a - a.a) <= n && Math.abs(t.b - a.b) <= n && Math.abs(t.c - a.c) <= n && Math.abs(t.d - a.d) <= n && Math.abs(t.e - a.e) <= n && Math.abs(t.f - a.f) <= n;
|
|
82
83
|
}
|
|
83
84
|
function ft(t, a) {
|
|
@@ -112,10 +113,10 @@ function dt(t) {
|
|
|
112
113
|
function I(t, a) {
|
|
113
114
|
return [t.a * a[0] + t.c * a[1] + t.e, t.b * a[0] + t.d * a[1] + t.f];
|
|
114
115
|
}
|
|
115
|
-
function
|
|
116
|
+
function ti(t, a) {
|
|
116
117
|
return [t.a * a[0] + t.c * a[1], t.b * a[0] + t.d * a[1]];
|
|
117
118
|
}
|
|
118
|
-
function
|
|
119
|
+
function ai(t, a) {
|
|
119
120
|
return a.map((n) => I(t, n));
|
|
120
121
|
}
|
|
121
122
|
const j = (t, a) => ({ a: 1, b: 0, c: 0, d: 1, e: t, f: a });
|
|
@@ -123,7 +124,7 @@ function qa(t, a) {
|
|
|
123
124
|
return a ? Ta(j(-a[0], -a[1]), t, j(a[0], a[1])) : t;
|
|
124
125
|
}
|
|
125
126
|
const Qt = (t, a = t, n) => qa({ a: t, b: 0, c: 0, d: a, e: 0, f: 0 }, n);
|
|
126
|
-
function
|
|
127
|
+
function Dn(t, a) {
|
|
127
128
|
const n = Math.cos(t), o = Math.sin(t);
|
|
128
129
|
return qa({ a: n, b: o, c: -o, d: n, e: 0, f: 0 }, a);
|
|
129
130
|
}
|
|
@@ -131,26 +132,26 @@ const Ja = (t, a = 0, n) => qa({ a: 1, b: a, c: t, d: 1, e: 0, f: 0 }, n);
|
|
|
131
132
|
function Bo(t, a) {
|
|
132
133
|
return Qt(t === "horizontal" ? -1 : 1, t === "vertical" ? -1 : 1, a);
|
|
133
134
|
}
|
|
134
|
-
function
|
|
135
|
+
function ni(t) {
|
|
135
136
|
const a = It(t), n = Math.hypot(a.a, a.b);
|
|
136
137
|
if (n === 0)
|
|
137
138
|
return { translacaoX: a.e, translacaoY: a.f, rotacao: 0, escalaX: 0, escalaY: Math.hypot(a.c, a.d), cisalhamento: 0 };
|
|
138
139
|
const o = Math.atan2(a.b, a.a), e = Jt(a) / n, r = Math.cos(o), i = Math.sin(o), s = e === 0 ? 0 : (a.c * r + a.d * i) / e;
|
|
139
140
|
return { translacaoX: a.e, translacaoY: a.f, rotacao: o, escalaX: n, escalaY: e, cisalhamento: s };
|
|
140
141
|
}
|
|
141
|
-
function
|
|
142
|
+
function oi(t) {
|
|
142
143
|
const a = Math.cos(t.rotacao), n = Math.sin(t.rotacao), o = a * t.escalaX, e = n * t.escalaX, r = (a * t.cisalhamento - n) * t.escalaY, i = (n * t.cisalhamento + a) * t.escalaY;
|
|
143
144
|
return It({ a: o, b: e, c: r, d: i, e: t.translacaoX, f: t.translacaoY });
|
|
144
145
|
}
|
|
145
146
|
const bt = 0.5522847498307936, Uo = 0.8, Ho = 1.2, Vo = 0.55, S = (t) => typeof t == "number" && Number.isFinite(t), Yo = "sans-serif", Wo = /^[\p{L}\p{N}\s,'"_-]{1,120}$/u;
|
|
146
|
-
function
|
|
147
|
+
function On(t) {
|
|
147
148
|
return typeof t == "string" && Wo.test(t.trim()) ? t.trim() : Yo;
|
|
148
149
|
}
|
|
149
150
|
let Vt = null, ga = 0;
|
|
150
|
-
function
|
|
151
|
+
function ei(t) {
|
|
151
152
|
Vt = typeof t == "function" ? t : null, ga++;
|
|
152
153
|
}
|
|
153
|
-
const
|
|
154
|
+
const ri = () => Vt !== null;
|
|
154
155
|
function Zo(t, a, n) {
|
|
155
156
|
const o = Math.max([...t].length, 1) * n * Vo;
|
|
156
157
|
if (!Vt) return o;
|
|
@@ -259,7 +260,7 @@ function re(t, a, n) {
|
|
|
259
260
|
function ie(t) {
|
|
260
261
|
if (!(S(t.tamanho) && t.tamanho > 0)) return null;
|
|
261
262
|
const a = String(t.texto ?? "").split(`
|
|
262
|
-
`), n =
|
|
263
|
+
`), n = On(t.fonte), o = S(t.largura) && t.largura > 0 ? t.largura : a.reduce((i, s) => Math.max(i, Zo(s, n, t.tamanho)), 0), e = a.length * t.tamanho * Ho;
|
|
263
264
|
return { x: t.alinhamento === "centro" ? -o / 2 : t.alinhamento === "direita" ? -o : 0, y: -t.tamanho * Uo, largura: o, altura: e };
|
|
264
265
|
}
|
|
265
266
|
function Ft(t) {
|
|
@@ -311,7 +312,7 @@ function ta(t) {
|
|
|
311
312
|
}
|
|
312
313
|
return ia.gravar(t, a), a;
|
|
313
314
|
}
|
|
314
|
-
function
|
|
315
|
+
function O(t) {
|
|
315
316
|
if (!t || typeof t != "object") return null;
|
|
316
317
|
if (ea.tem(t)) return ea.obter(t);
|
|
317
318
|
let a = null;
|
|
@@ -323,29 +324,29 @@ function D(t) {
|
|
|
323
324
|
}
|
|
324
325
|
return ea.gravar(t, a), a;
|
|
325
326
|
}
|
|
326
|
-
const
|
|
327
|
-
function
|
|
327
|
+
const Da = ([[t, a], [n, o]]) => [t, a, n, o].every(S) ? { x: t, y: a, largura: n - t, altura: o - a } : null;
|
|
328
|
+
function Oa(t) {
|
|
328
329
|
const a = t == null ? void 0 : t.geometria;
|
|
329
330
|
if (!a || typeof a != "object") return null;
|
|
330
331
|
if (sa.tem(a)) return sa.obter(a);
|
|
331
|
-
const n = ta(a), o = n ?
|
|
332
|
+
const n = ta(a), o = n ? Da(Cn(n, A)) : null;
|
|
332
333
|
return sa.gravar(a, o), o;
|
|
333
334
|
}
|
|
334
335
|
function ce(t) {
|
|
335
|
-
const a =
|
|
336
|
+
const a = Oa(t);
|
|
336
337
|
if (!a) return null;
|
|
337
338
|
const n = L(t), o = [[a.x, a.y], [a.x + a.largura, a.y], [a.x + a.largura, a.y + a.altura], [a.x, a.y + a.altura]].map((c) => I(n, c));
|
|
338
339
|
let e = 1 / 0, r = 1 / 0, i = -1 / 0, s = -1 / 0;
|
|
339
340
|
for (const [c, u] of o)
|
|
340
341
|
c < e && (e = c), c > i && (i = c), u < r && (r = u), u > s && (s = u);
|
|
341
|
-
return
|
|
342
|
+
return Da([[e, r], [i, s]]);
|
|
342
343
|
}
|
|
343
344
|
function St(t) {
|
|
344
345
|
if (ra.tem(t)) return ra.obter(t);
|
|
345
|
-
const a =
|
|
346
|
+
const a = O(t), n = a ? Da(Cn(a, A)) : null;
|
|
346
347
|
return t && typeof t == "object" && ra.gravar(t, n), n;
|
|
347
348
|
}
|
|
348
|
-
const
|
|
349
|
+
const ii = (t) => !!t && t.tipo === "Polygon", qt = "#000000", wa = 0.25, ue = 4, Ka = 25.4 / 96, T = (t) => typeof t == "number" && Number.isFinite(t), Mt = (t, a) => T(t) ? Math.min(1, Math.max(0, t)) : a;
|
|
349
350
|
function le(t, a, n = 1, o = "butt") {
|
|
350
351
|
const e = T(a) && a > 0 ? a / Ka : 1;
|
|
351
352
|
return So(ho(t, e, n, o)).map((r) => Math.round(r * Ka * 1e4) / 1e4);
|
|
@@ -374,13 +375,13 @@ function ka(t) {
|
|
|
374
375
|
dx: n(a[0]),
|
|
375
376
|
dy: n(a[1]),
|
|
376
377
|
desfoque: T(t.desfoque) && t.desfoque >= 0 ? Math.min(100, t.desfoque) : ca.desfoque,
|
|
377
|
-
cor:
|
|
378
|
+
cor: z(t.cor, qt),
|
|
378
379
|
opacidade: Mt(t.opacidade, ca.opacidade)
|
|
379
380
|
};
|
|
380
381
|
return o.opacidade > 0 ? o : null;
|
|
381
382
|
}
|
|
382
383
|
function fe(t) {
|
|
383
|
-
return t.filter((a) => a && T(a.posicao)).map((a) => ({ posicao: Math.min(1, Math.max(0, a.posicao)), cor:
|
|
384
|
+
return t.filter((a) => a && T(a.posicao)).map((a) => ({ posicao: Math.min(1, Math.max(0, a.posicao)), cor: z(a.cor, qt), opacidade: Mt(a.opacidade, 1) })).sort((a, n) => a.posicao - n.posicao);
|
|
384
385
|
}
|
|
385
386
|
function de(t, a) {
|
|
386
387
|
if (!t || !Array.isArray(t.paradas)) return;
|
|
@@ -389,7 +390,7 @@ function de(t, a) {
|
|
|
389
390
|
const o = n.reduce((r, i) => Math.abs(i.posicao - 0.5) < Math.abs(r.posicao - 0.5) ? i : r, n[0]);
|
|
390
391
|
return {
|
|
391
392
|
def: t.tipo === "radial" ? { ...t, paradas: n } : { tipo: "linear", de: t.de, ate: t.ate, paradas: n },
|
|
392
|
-
corDegradacao: a ?
|
|
393
|
+
corDegradacao: a ? z(a, o.cor) : o.cor,
|
|
393
394
|
opacidadeDegradacao: o.opacidade ?? 1
|
|
394
395
|
};
|
|
395
396
|
}
|
|
@@ -412,7 +413,7 @@ function ba(t) {
|
|
|
412
413
|
if (g > 0) {
|
|
413
414
|
const y = mo(m.terminacao) ?? "butt", p = zn(m.tipoLinha);
|
|
414
415
|
e = {
|
|
415
|
-
cor:
|
|
416
|
+
cor: z(m.cor, qt),
|
|
416
417
|
largura: g,
|
|
417
418
|
opacidade: Mt(m.opacidade, 1),
|
|
418
419
|
tracejado: p && p !== "continua" ? le(p, g, go(m.escalaTipoLinha), y) : [],
|
|
@@ -430,7 +431,7 @@ function ba(t) {
|
|
|
430
431
|
if (!g || y) {
|
|
431
432
|
const p = t.geometria.tipo === "caminho" && ((h = t.geometria.geometria) == null ? void 0 : h.tipo) === "Polygon" && t.geometria.geometria.aneis.length > 1;
|
|
432
433
|
i = {
|
|
433
|
-
cor:
|
|
434
|
+
cor: z(s.cor, (y == null ? void 0 : y.corDegradacao) ?? qt),
|
|
434
435
|
opacidade: Mt(s.opacidade, 1),
|
|
435
436
|
regra: s.regra ?? (p ? "evenodd" : "nonzero")
|
|
436
437
|
}, y && (i.gradiente = y);
|
|
@@ -441,7 +442,7 @@ function ba(t) {
|
|
|
441
442
|
u && o && !n && (c = {
|
|
442
443
|
angulo: (T(u.angulo) ? u.angulo : 45) * Math.PI / 180 + he(t),
|
|
443
444
|
espacamento: T(u.espacamento) && u.espacamento > 0 ? Math.max(0.1, u.espacamento) : 2,
|
|
444
|
-
cor:
|
|
445
|
+
cor: z(u.cor, (e == null ? void 0 : e.cor) ?? qt),
|
|
445
446
|
largura: T(u.espessura) && u.espessura > 0 ? u.espessura : 0.18,
|
|
446
447
|
opacidade: Mt(u.opacidade, 1),
|
|
447
448
|
cruzada: u.cruzada === !0
|
|
@@ -466,7 +467,7 @@ function me(t, a) {
|
|
|
466
467
|
const r = parseInt(e.slice(0, 2), 16), i = parseInt(e.slice(2, 4), 16), s = parseInt(e.slice(4, 6), 16), c = e.length === 8 ? parseInt(e.slice(6, 8), 16) / 255 : 1;
|
|
467
468
|
return `rgba(${r},${i},${s},${Math.round(c * n * 1e3) / 1e3})`;
|
|
468
469
|
}
|
|
469
|
-
const C = (t) => typeof t == "number" && Number.isFinite(t),
|
|
470
|
+
const C = (t) => typeof t == "number" && Number.isFinite(t), D = (t) => C(t) && t > 0, U = (t) => Array.isArray(t) && t.length >= 2 && C(t[0]) && C(t[1]), K = (t) => [t[0], t[1]], pe = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]), ge = ["triangulo", "triangulo-aberto", "aberta", "circulo", "quadrado", "losango", "barra"], an = 360, ye = 1e5, xt = (t) => C(t) ? Math.min(1, Math.max(0, t)) : void 0, nn = (t, a, n) => C(t) ? Math.min(n, Math.max(a, Math.round(t))) : null;
|
|
470
471
|
function ua(t, a) {
|
|
471
472
|
if (!Array.isArray(t) || t.length === 0) return null;
|
|
472
473
|
const n = [];
|
|
@@ -499,12 +500,12 @@ function Me(t) {
|
|
|
499
500
|
const a = t;
|
|
500
501
|
switch (a.tipo) {
|
|
501
502
|
case "retangulo": {
|
|
502
|
-
if (!
|
|
503
|
+
if (!D(a.largura) || !D(a.altura)) return null;
|
|
503
504
|
const n = Array.isArray(a.raios) && a.raios.length === 4 ? a.raios.map((o) => C(o) && o > 0 ? o : 0) : void 0;
|
|
504
505
|
return n && n.some((o) => o > 0) ? { tipo: "retangulo", largura: a.largura, altura: a.altura, raios: n } : { tipo: "retangulo", largura: a.largura, altura: a.altura };
|
|
505
506
|
}
|
|
506
507
|
case "elipse": {
|
|
507
|
-
if (!
|
|
508
|
+
if (!D(a.rx) || !D(a.ry)) return null;
|
|
508
509
|
const n = a.arco;
|
|
509
510
|
if (n && typeof n == "object") {
|
|
510
511
|
if (!C(n.inicio) || !C(n.fim) || n.inicio === n.fim) return null;
|
|
@@ -515,11 +516,11 @@ function Me(t) {
|
|
|
515
516
|
}
|
|
516
517
|
case "poligono-regular": {
|
|
517
518
|
const n = nn(a.lados, 3, an);
|
|
518
|
-
return
|
|
519
|
+
return D(a.raio) && n !== null ? { tipo: "poligono-regular", raio: a.raio, lados: n } : null;
|
|
519
520
|
}
|
|
520
521
|
case "estrela": {
|
|
521
522
|
const n = nn(a.pontas, 3, an);
|
|
522
|
-
return !
|
|
523
|
+
return !D(a.raioExterno) || !D(a.raioInterno) || n === null ? null : { tipo: "estrela", raioExterno: a.raioExterno, raioInterno: Math.min(a.raioInterno, a.raioExterno), pontas: n };
|
|
523
524
|
}
|
|
524
525
|
case "linha":
|
|
525
526
|
return U(a.de) && U(a.ate) ? { tipo: "linha", de: K(a.de), ate: K(a.ate) } : null;
|
|
@@ -528,9 +529,9 @@ function Me(t) {
|
|
|
528
529
|
return n ? { tipo: "caminho", geometria: n } : null;
|
|
529
530
|
}
|
|
530
531
|
case "texto": {
|
|
531
|
-
if (!
|
|
532
|
+
if (!D(a.tamanho)) return null;
|
|
532
533
|
const o = { tipo: "texto", texto: typeof a.texto == "string" ? a.texto : a.texto === void 0 || a.texto === null ? "" : String(a.texto), tamanho: a.tamanho };
|
|
533
|
-
return typeof a.fonte == "string" && a.fonte.trim() && (o.fonte = a.fonte),
|
|
534
|
+
return typeof a.fonte == "string" && a.fonte.trim() && (o.fonte = a.fonte), D(a.largura) && (o.largura = a.largura), (a.alinhamento === "centro" || a.alinhamento === "direita" || a.alinhamento === "esquerda") && (o.alinhamento = a.alinhamento), o;
|
|
534
535
|
}
|
|
535
536
|
default:
|
|
536
537
|
return null;
|
|
@@ -540,15 +541,15 @@ function on(t) {
|
|
|
540
541
|
if (!t || typeof t != "object") return;
|
|
541
542
|
const a = t;
|
|
542
543
|
if (ge.includes(a.estilo))
|
|
543
|
-
return
|
|
544
|
+
return D(a.escala) ? { estilo: a.estilo, escala: Math.min(a.escala, 100) } : { estilo: a.estilo };
|
|
544
545
|
}
|
|
545
|
-
const
|
|
546
|
+
const Dt = (t) => typeof t == "string" && t.trim() && t.length <= 64 ? t.trim() : void 0, xe = 64;
|
|
546
547
|
function ve(t) {
|
|
547
548
|
if (!Array.isArray(t)) return null;
|
|
548
549
|
const a = [];
|
|
549
550
|
for (const n of t.slice(0, xe)) {
|
|
550
551
|
if (!n || typeof n != "object") continue;
|
|
551
|
-
const o = n, e =
|
|
552
|
+
const o = n, e = Dt(o.cor);
|
|
552
553
|
if (!e || !C(o.posicao)) continue;
|
|
553
554
|
const r = { posicao: Math.min(1, Math.max(0, o.posicao)), cor: e }, i = xt(o.opacidade);
|
|
554
555
|
i !== void 0 && (r.opacidade = i), a.push(r);
|
|
@@ -560,7 +561,7 @@ function Ae(t) {
|
|
|
560
561
|
const a = t, n = ve(a.paradas);
|
|
561
562
|
if (n) {
|
|
562
563
|
if (a.tipo === "linear" && U(a.de) && U(a.ate)) return { tipo: "linear", de: K(a.de), ate: K(a.ate), paradas: n };
|
|
563
|
-
if (a.tipo === "radial" && U(a.centro) &&
|
|
564
|
+
if (a.tipo === "radial" && U(a.centro) && D(a.raio)) {
|
|
564
565
|
const o = { tipo: "radial", centro: K(a.centro), raio: Math.min(a.raio, 100), paradas: n };
|
|
565
566
|
return U(a.foco) && (o.foco = K(a.foco)), o;
|
|
566
567
|
}
|
|
@@ -571,8 +572,8 @@ function Pe(t) {
|
|
|
571
572
|
const a = t;
|
|
572
573
|
return Ht({
|
|
573
574
|
angulo: C(a.angulo) ? a.angulo : void 0,
|
|
574
|
-
espacamento:
|
|
575
|
-
cor:
|
|
575
|
+
espacamento: D(a.espacamento) ? Math.max(0.1, Math.min(a.espacamento, 1e3)) : void 0,
|
|
576
|
+
cor: Dt(a.cor),
|
|
576
577
|
espessura: C(a.espessura) && a.espessura >= 0 ? Math.min(a.espessura, 100) : void 0,
|
|
577
578
|
opacidade: xt(a.opacidade),
|
|
578
579
|
cruzada: a.cruzada === !0 ? !0 : void 0
|
|
@@ -588,11 +589,11 @@ function Ie(t) {
|
|
|
588
589
|
if (a.traco === null) n.traco = null;
|
|
589
590
|
else if (a.traco && typeof a.traco == "object") {
|
|
590
591
|
const e = a.traco, r = Ht({
|
|
591
|
-
cor:
|
|
592
|
+
cor: Dt(e.cor),
|
|
592
593
|
espessura: C(e.espessura) && e.espessura >= 0 ? Math.min(e.espessura, 1e3) : void 0,
|
|
593
594
|
opacidade: xt(e.opacidade),
|
|
594
595
|
tipoLinha: zn(e.tipoLinha),
|
|
595
|
-
escalaTipoLinha:
|
|
596
|
+
escalaTipoLinha: D(e.escalaTipoLinha) ? e.escalaTipoLinha : void 0,
|
|
596
597
|
terminacao: e.terminacao === "arredondada" || e.terminacao === "reta" || e.terminacao === "quadrada" ? e.terminacao : void 0,
|
|
597
598
|
juncao: e.juncao === "arredondada" || e.juncao === "chanfrada" || e.juncao === "angular" ? e.juncao : void 0,
|
|
598
599
|
limitePonta: C(e.limitePonta) && e.limitePonta >= 1 ? Math.min(e.limitePonta, 100) : void 0,
|
|
@@ -605,7 +606,7 @@ function Ie(t) {
|
|
|
605
606
|
if (a.preenchimento === null) n.preenchimento = null;
|
|
606
607
|
else if (a.preenchimento && typeof a.preenchimento == "object") {
|
|
607
608
|
const e = a.preenchimento, r = Ht({
|
|
608
|
-
cor:
|
|
609
|
+
cor: Dt(e.cor),
|
|
609
610
|
opacidade: xt(e.opacidade),
|
|
610
611
|
regra: e.regra === "evenodd" || e.regra === "nonzero" ? e.regra : void 0,
|
|
611
612
|
gradiente: Ae(e.gradiente)
|
|
@@ -624,7 +625,7 @@ function Ie(t) {
|
|
|
624
625
|
n.sombra = Ht({
|
|
625
626
|
deslocamento: U(e.deslocamento) ? [Math.max(-1e3, Math.min(1e3, e.deslocamento[0])), Math.max(-1e3, Math.min(1e3, e.deslocamento[1]))] : void 0,
|
|
626
627
|
desfoque: C(e.desfoque) && e.desfoque >= 0 ? Math.min(e.desfoque, 100) : void 0,
|
|
627
|
-
cor:
|
|
628
|
+
cor: Dt(e.cor),
|
|
628
629
|
opacidade: xt(e.opacidade)
|
|
629
630
|
});
|
|
630
631
|
}
|
|
@@ -653,7 +654,7 @@ function Se(t) {
|
|
|
653
654
|
const a = Rn(t);
|
|
654
655
|
return typeof a == "string" ? null : a;
|
|
655
656
|
}
|
|
656
|
-
function
|
|
657
|
+
function si(t) {
|
|
657
658
|
const a = { elementos: [], recusados: [] };
|
|
658
659
|
if (!Array.isArray(t)) return a;
|
|
659
660
|
const n = /* @__PURE__ */ new Set();
|
|
@@ -681,7 +682,7 @@ function Ra(t) {
|
|
|
681
682
|
const a = t.largura < 0 ? t.x + t.largura : t.x, n = t.altura < 0 ? t.y + t.altura : t.y;
|
|
682
683
|
return { x: a, y: n, largura: Math.abs(t.largura), altura: Math.abs(t.altura) };
|
|
683
684
|
}
|
|
684
|
-
const
|
|
685
|
+
const ci = (t, a) => ({
|
|
685
686
|
x: Math.min(t[0], a[0]),
|
|
686
687
|
y: Math.min(t[1], a[1]),
|
|
687
688
|
largura: Math.abs(a[0] - t[0]),
|
|
@@ -699,10 +700,10 @@ function en(t, a) {
|
|
|
699
700
|
const [o, e] = Fn(n);
|
|
700
701
|
return ht(t, { geometria: { tipo: "elipse", rx: n.largura / 2, ry: n.altura / 2 }, transformacao: j(o, e) });
|
|
701
702
|
}
|
|
702
|
-
function
|
|
703
|
+
function ui(t, a, n, o = 6) {
|
|
703
704
|
return !E(a == null ? void 0 : a[0]) || !E(a == null ? void 0 : a[1]) || !E(n) || n <= 0 || !E(o) || o < 3 ? null : ht(t, { geometria: { tipo: "poligono-regular", raio: n, lados: Math.min(360, Math.round(o)) }, transformacao: j(a[0], a[1]) });
|
|
704
705
|
}
|
|
705
|
-
function
|
|
706
|
+
function li(t, a, n, o, e = 5) {
|
|
706
707
|
return !E(a == null ? void 0 : a[0]) || !E(a == null ? void 0 : a[1]) || !E(n) || !E(o) || n <= 0 || o <= 0 || !E(e) || e < 3 ? null : ht(t, {
|
|
707
708
|
geometria: { tipo: "estrela", raioExterno: n, raioInterno: Math.min(o, n), pontas: Math.min(360, Math.round(e)) },
|
|
708
709
|
transformacao: j(a[0], a[1])
|
|
@@ -716,15 +717,15 @@ function Lt(t, a, n) {
|
|
|
716
717
|
transformacao: j(o, e)
|
|
717
718
|
});
|
|
718
719
|
}
|
|
719
|
-
function
|
|
720
|
+
function fi(t, a) {
|
|
720
721
|
return !a || a.tipo !== "LineString" && a.tipo !== "Polygon" ? null : ht(t, { geometria: { tipo: "caminho", geometria: a } });
|
|
721
722
|
}
|
|
722
|
-
function
|
|
723
|
+
function di(t, a, n, o) {
|
|
723
724
|
return !E(a == null ? void 0 : a[0]) || !E(a == null ? void 0 : a[1]) || !E(o) || o <= 0 ? null : ht(t, { geometria: { tipo: "texto", texto: typeof n == "string" ? n : String(n ?? ""), tamanho: o }, transformacao: j(a[0], a[1]) });
|
|
724
725
|
}
|
|
725
|
-
const Ee = ["no", "n", "ne", "e", "se", "s", "so", "o"], la = 1e-4,
|
|
726
|
+
const Ee = ["no", "n", "ne", "e", "se", "s", "so", "o"], la = 1e-4, N = (t) => typeof t == "number" && Number.isFinite(t);
|
|
726
727
|
function Fa(t) {
|
|
727
|
-
const a =
|
|
728
|
+
const a = Oa(t);
|
|
728
729
|
return a ? { quadro: L(t), min: [a.x, a.y], max: [a.x + a.largura, a.y + a.altura] } : null;
|
|
729
730
|
}
|
|
730
731
|
function je(t) {
|
|
@@ -760,12 +761,12 @@ function F(t, a) {
|
|
|
760
761
|
}
|
|
761
762
|
}
|
|
762
763
|
const Ma = { no: "se", n: "s", ne: "so", e: "o", se: "no", s: "n", so: "ne", o: "e" };
|
|
763
|
-
function
|
|
764
|
+
function hi(t, a = 6) {
|
|
764
765
|
const n = (f) => I(t.quadro, f), o = Object.fromEntries(Ee.map((f) => [f, n(F(t, f))])), e = n(F(t, "centro")), r = o.n;
|
|
765
766
|
let i = r[0] - e[0], s = r[1] - e[1];
|
|
766
767
|
const c = Math.hypot(i, s);
|
|
767
768
|
c > 1e-9 ? (i /= c, s /= c) : (i = 0, s = -1);
|
|
768
|
-
const u =
|
|
769
|
+
const u = N(a) ? a : 6;
|
|
769
770
|
return { cantos: [o.no, o.ne, o.se, o.so], alcas: o, centro: e, rotacao: [r[0] + i * u, r[1] + s * u] };
|
|
770
771
|
}
|
|
771
772
|
function xa(t, a) {
|
|
@@ -773,8 +774,8 @@ function xa(t, a) {
|
|
|
773
774
|
return n ? Ta(n, a, t.quadro) : null;
|
|
774
775
|
}
|
|
775
776
|
const rn = (t) => Math.abs(t) < la ? t < 0 ? -la : la : t;
|
|
776
|
-
function
|
|
777
|
-
if (!t || !Ma[a] || !
|
|
777
|
+
function mi(t, a, n, o = {}) {
|
|
778
|
+
if (!t || !Ma[a] || !N(n == null ? void 0 : n[0]) || !N(n == null ? void 0 : n[1])) return null;
|
|
778
779
|
const e = dt(t.quadro);
|
|
779
780
|
if (!e) return null;
|
|
780
781
|
const r = I(e, n), i = F(t, a), s = F(t, o.doCentro ? "centro" : Ma[a]), c = a !== "n" && a !== "s", u = a !== "e" && a !== "o", f = i[0] - s[0], d = i[1] - s[1];
|
|
@@ -783,17 +784,17 @@ function hi(t, a, n, o = {}) {
|
|
|
783
784
|
const m = u ? c && Math.abs(l) >= Math.abs(h) ? l : h : l;
|
|
784
785
|
l = m, h = m;
|
|
785
786
|
}
|
|
786
|
-
return !
|
|
787
|
+
return !N(l) || !N(h) ? null : xa(t, Qt(rn(l), rn(h), s));
|
|
787
788
|
}
|
|
788
|
-
function
|
|
789
|
-
if (![t == null ? void 0 : t[0], t == null ? void 0 : t[1], a == null ? void 0 : a[0], a == null ? void 0 : a[1], n == null ? void 0 : n[0], n == null ? void 0 : n[1]].every(
|
|
789
|
+
function pi(t, a, n, o) {
|
|
790
|
+
if (![t == null ? void 0 : t[0], t == null ? void 0 : t[1], a == null ? void 0 : a[0], a == null ? void 0 : a[1], n == null ? void 0 : n[0], n == null ? void 0 : n[1]].every(N)) return { matriz: nt, angulo: 0 };
|
|
790
791
|
const r = a[0] - t[0], i = a[1] - t[1], s = n[0] - t[0], c = n[1] - t[1];
|
|
791
792
|
if (Math.hypot(r, i) < 1e-9 || Math.hypot(s, c) < 1e-9) return { matriz: nt, angulo: 0 };
|
|
792
793
|
let u = Math.atan2(r * c - i * s, r * s + i * c);
|
|
793
|
-
return
|
|
794
|
+
return N(o) && o > 0 && (u = Math.round(u / o) * o), { matriz: Dn(u, t), angulo: u };
|
|
794
795
|
}
|
|
795
|
-
function
|
|
796
|
-
if (!t || !["n", "s", "e", "o"].includes(a) || !
|
|
796
|
+
function gi(t, a, n) {
|
|
797
|
+
if (!t || !["n", "s", "e", "o"].includes(a) || !N(n == null ? void 0 : n[0]) || !N(n == null ? void 0 : n[1])) return null;
|
|
797
798
|
const o = dt(t.quadro);
|
|
798
799
|
if (!o) return null;
|
|
799
800
|
const e = I(o, n), r = F(t, a), i = F(t, Ma[a]);
|
|
@@ -806,28 +807,28 @@ function pi(t, a, n) {
|
|
|
806
807
|
}
|
|
807
808
|
function at(t, a) {
|
|
808
809
|
const n = L(t), o = ft(a, n);
|
|
809
|
-
return [o.a, o.b, o.c, o.d, o.e, o.f].every(
|
|
810
|
+
return [o.a, o.b, o.c, o.d, o.e, o.f].every(N) ? { ...t, transformacao: o } : t;
|
|
810
811
|
}
|
|
811
|
-
const
|
|
812
|
+
const yi = (t, a, n) => N(a) && N(n) ? at(t, j(a, n)) : t;
|
|
812
813
|
function _a(t) {
|
|
813
814
|
const a = je(t);
|
|
814
815
|
return a ? I(a.quadro, F(a, "centro")) : null;
|
|
815
816
|
}
|
|
816
|
-
function
|
|
817
|
-
if (t.pivo &&
|
|
817
|
+
function bi(t) {
|
|
818
|
+
if (t.pivo && N(t.pivo[0]) && N(t.pivo[1])) return I(L(t), t.pivo);
|
|
818
819
|
const a = Fa(t);
|
|
819
820
|
return a ? I(a.quadro, F(a, "centro")) : null;
|
|
820
821
|
}
|
|
821
822
|
function _n(t, a) {
|
|
822
823
|
return t.map((n) => n.bloqueado ? n : at(n, a));
|
|
823
824
|
}
|
|
824
|
-
function
|
|
825
|
+
function Mi(t, a, n) {
|
|
825
826
|
const o = n ?? _a(t);
|
|
826
827
|
return o ? _n(t, Bo(a, o)) : [...t];
|
|
827
828
|
}
|
|
828
|
-
function
|
|
829
|
+
function xi(t, a, n) {
|
|
829
830
|
const o = n ?? _a(t);
|
|
830
|
-
return o &&
|
|
831
|
+
return o && N(a) ? _n(t, Dn(a, o)) : [...t];
|
|
831
832
|
}
|
|
832
833
|
const Gn = (t) => typeof t == "number" && Number.isFinite(t);
|
|
833
834
|
function Et(t) {
|
|
@@ -856,7 +857,7 @@ function Et(t) {
|
|
|
856
857
|
}
|
|
857
858
|
};
|
|
858
859
|
}
|
|
859
|
-
function
|
|
860
|
+
function vi(t) {
|
|
860
861
|
if (!Array.isArray(t)) return [];
|
|
861
862
|
const a = /* @__PURE__ */ new Set(), n = [];
|
|
862
863
|
for (const o of t) {
|
|
@@ -869,12 +870,12 @@ function xi(t) {
|
|
|
869
870
|
}
|
|
870
871
|
return n;
|
|
871
872
|
}
|
|
872
|
-
const
|
|
873
|
+
const Ai = wa, V = (t) => typeof t == "number" && Number.isFinite(t);
|
|
873
874
|
function Le(t) {
|
|
874
875
|
const a = rt(t).preenchimento;
|
|
875
876
|
return !!a && (a.opacidade > 0 || !!a.gradiente);
|
|
876
877
|
}
|
|
877
|
-
function
|
|
878
|
+
function ze(t) {
|
|
878
879
|
const a = rt(t).traco;
|
|
879
880
|
return a ? a.largura / 2 : 0;
|
|
880
881
|
}
|
|
@@ -882,7 +883,7 @@ function _t(t, a) {
|
|
|
882
883
|
const n = a && !Array.isArray(a) && typeof a.indice == "function" ? a : Et(a);
|
|
883
884
|
return t.map((o, e) => ({ el: o, c: o ? n.indice(o) : 0, chave: V(o == null ? void 0 : o.ordem) ? o.ordem : e, i: e })).sort((o, e) => o.c - e.c || o.chave - e.chave || o.i - e.i).map((o) => o.el);
|
|
884
885
|
}
|
|
885
|
-
function
|
|
886
|
+
function Ne(t, a) {
|
|
886
887
|
let n = 1 / 0;
|
|
887
888
|
const o = a.tipo === "Polygon" ? a.aneis.map((e) => ({ pts: e, fechado: !0 })) : (a.partes && a.partes.length > 1 ? a.partes : [a.coordenadas]).map((e) => ({ pts: e, fechado: !1 }));
|
|
888
889
|
for (const { pts: e, fechado: r } of o) {
|
|
@@ -895,12 +896,12 @@ function ze(t, a) {
|
|
|
895
896
|
}
|
|
896
897
|
const Ga = (t, a, n) => !!t && !t.mascara && n.visivel(t) && (a || !n.travado(t));
|
|
897
898
|
function Ce(t, a, n = 1) {
|
|
898
|
-
const o = St(t), e =
|
|
899
|
+
const o = St(t), e = O(t);
|
|
899
900
|
if (!o || !e) return null;
|
|
900
|
-
const r = (V(n) && n >= 0 ? n : 1) +
|
|
901
|
+
const r = (V(n) && n >= 0 ? n : 1) + ze(t);
|
|
901
902
|
if (a[0] < o.x - r || a[0] > o.x + o.largura + r || a[1] < o.y - r || a[1] > o.y + o.altura + r) return null;
|
|
902
903
|
if (e.tipo === "Polygon" && (Le(t) || t.geometria.tipo === "texto") && Lo(a, e.aneis)) return 0;
|
|
903
|
-
const s =
|
|
904
|
+
const s = Ne(a, e);
|
|
904
905
|
return s <= r ? s : null;
|
|
905
906
|
}
|
|
906
907
|
function Te(t, a, n = {}) {
|
|
@@ -914,18 +915,18 @@ function Te(t, a, n = {}) {
|
|
|
914
915
|
}
|
|
915
916
|
return r;
|
|
916
917
|
}
|
|
917
|
-
function
|
|
918
|
+
function Pi(t, a, n = {}) {
|
|
918
919
|
var o;
|
|
919
920
|
return ((o = Te(t, a, n)[0]) == null ? void 0 : o.elemento) ?? null;
|
|
920
921
|
}
|
|
921
922
|
function Xa(t) {
|
|
922
|
-
const a =
|
|
923
|
+
const a = O(t);
|
|
923
924
|
if (!a) return null;
|
|
924
925
|
const n = { id: t.id, camadaId: t.camadaId ?? "", geometria: a, propriedades: {} };
|
|
925
926
|
return t.oculto && (n.oculta = !0), t.bloqueado && (n.bloqueada = !0), n;
|
|
926
927
|
}
|
|
927
928
|
const qe = (t) => ({ x: t[0], y: t[1] });
|
|
928
|
-
function
|
|
929
|
+
function Ii(t, a, n, o = {}) {
|
|
929
930
|
if (!t || ![t.x, t.y, t.largura, t.altura].every(V)) return [];
|
|
930
931
|
const e = {
|
|
931
932
|
x1: Math.min(t.x, t.x + t.largura),
|
|
@@ -939,7 +940,7 @@ function Pi(t, a, n, o = {}) {
|
|
|
939
940
|
return !!c && Eo(c, e, qe, n, A);
|
|
940
941
|
});
|
|
941
942
|
}
|
|
942
|
-
function
|
|
943
|
+
function $i(t, a, n = {}) {
|
|
943
944
|
if (!Array.isArray(t) || t.length < 3) return [];
|
|
944
945
|
const o = n.incluirBloqueados === !0, e = Et(n.camadas), r = t.filter((i) => V(i == null ? void 0 : i[0]) && V(i == null ? void 0 : i[1])).map((i) => [i[0], i[1]]);
|
|
945
946
|
return a.filter((i) => {
|
|
@@ -954,7 +955,7 @@ function sn(t) {
|
|
|
954
955
|
const n = a.x + a.largura, o = a.y + a.altura;
|
|
955
956
|
return { id: t.id, camadaId: t.camadaId ?? "", geometria: { tipo: "Polygon", aneis: [[[a.x, a.y], [n, a.y], [n, o], [a.x, o]]] }, propriedades: {} };
|
|
956
957
|
}
|
|
957
|
-
class
|
|
958
|
+
class Si {
|
|
958
959
|
constructor() {
|
|
959
960
|
P(this, "indice", new yo(A));
|
|
960
961
|
P(this, "elementos", /* @__PURE__ */ new Map());
|
|
@@ -1018,10 +1019,10 @@ class $i {
|
|
|
1018
1019
|
return this.consultarCaixa({ x: a[0], y: a[1], largura: 0, altura: 0 }, V(n) && n > 0 ? n : 0);
|
|
1019
1020
|
}
|
|
1020
1021
|
}
|
|
1021
|
-
const
|
|
1022
|
-
function
|
|
1022
|
+
const De = ["vertice", "canto", "centro", "meio", "guia", "aresta", "grade"], W = (t) => typeof t == "number" && Number.isFinite(t);
|
|
1023
|
+
function Ei(t, a, n, o = {}, e = []) {
|
|
1023
1024
|
if (!W(t == null ? void 0 : t[0]) || !W(t == null ? void 0 : t[1]) || !W(n) || n <= 0) return null;
|
|
1024
|
-
const r = W(o.toleranciaPx) && o.toleranciaPx >= 0 ? o.toleranciaPx :
|
|
1025
|
+
const r = W(o.toleranciaPx) && o.toleranciaPx >= 0 ? o.toleranciaPx : zo, i = new Set(e), s = n, c = (p) => ({ x: p[0] * s, y: p[1] * s }), u = { x: t[0] * s, y: t[1] * s }, f = (p) => Math.hypot(p[0] * s - u.x, p[1] * s - u.y), d = a.filter((p) => p && !p.oculto && !i.has(p.id)), l = [];
|
|
1025
1026
|
for (const p of d) {
|
|
1026
1027
|
const M = Xa(p);
|
|
1027
1028
|
M && l.push({ ...M, bloqueada: !1 });
|
|
@@ -1057,17 +1058,17 @@ function Si(t, a, n, o = {}, e = []) {
|
|
|
1057
1058
|
const p = y.origem && W(y.origem[0]) && W(y.origem[1]) ? y.origem : [0, 0], M = y.espacamento, b = [p[0] + Math.round((t[0] - p[0]) / M) * M, p[1] + Math.round((t[1] - p[1]) / M) * M];
|
|
1058
1059
|
m({ tipo: "grade", coordenada: b, distanciaPx: f(b) });
|
|
1059
1060
|
}
|
|
1060
|
-
for (const p of
|
|
1061
|
+
for (const p of De) {
|
|
1061
1062
|
const M = h.get(p);
|
|
1062
1063
|
if (M) return M;
|
|
1063
1064
|
}
|
|
1064
1065
|
return null;
|
|
1065
1066
|
}
|
|
1066
|
-
const Yt = (t) => typeof t == "number" && Number.isFinite(t),
|
|
1067
|
+
const Yt = (t) => typeof t == "number" && Number.isFinite(t), Oe = (t) => Array.isArray(t) && Yt(t[0]) && Yt(t[1]);
|
|
1067
1068
|
function it(t) {
|
|
1068
1069
|
return !t || t.bloqueado || !t.geometria || t.geometria.tipo === "texto" ? null : Ft(t.geometria);
|
|
1069
1070
|
}
|
|
1070
|
-
function
|
|
1071
|
+
function ji(t) {
|
|
1071
1072
|
if (!(t != null && t.geometria) || t.geometria.tipo === "texto") return null;
|
|
1072
1073
|
if (t.geometria.tipo === "caminho") return t;
|
|
1073
1074
|
const a = Ft(t.geometria);
|
|
@@ -1075,21 +1076,21 @@ function Ei(t) {
|
|
|
1075
1076
|
}
|
|
1076
1077
|
const jt = (t, a) => ({ ...t, geometria: { tipo: "caminho", geometria: a } });
|
|
1077
1078
|
function Ba(t, a) {
|
|
1078
|
-
if (!
|
|
1079
|
+
if (!Oe(a)) return null;
|
|
1079
1080
|
const n = dt(L(t));
|
|
1080
1081
|
return n ? I(n, a) : null;
|
|
1081
1082
|
}
|
|
1082
|
-
function
|
|
1083
|
+
function Li(t) {
|
|
1083
1084
|
const a = it(t);
|
|
1084
1085
|
if (!a) return [];
|
|
1085
1086
|
const n = L(t);
|
|
1086
1087
|
return lt(a, A).map((o) => I(n, o));
|
|
1087
1088
|
}
|
|
1088
|
-
function
|
|
1089
|
+
function zi(t) {
|
|
1089
1090
|
const a = it(t);
|
|
1090
1091
|
if (!a) return [];
|
|
1091
1092
|
const n = L(t);
|
|
1092
|
-
return (
|
|
1093
|
+
return (za(a) ?? []).map((o) => ({
|
|
1093
1094
|
...o.entrada ? { entrada: I(n, o.entrada) } : {},
|
|
1094
1095
|
...o.saida ? { saida: I(n, o.saida) } : {}
|
|
1095
1096
|
}));
|
|
@@ -1098,9 +1099,9 @@ function Ni(t, a, n) {
|
|
|
1098
1099
|
const o = it(t), e = o ? Ba(t, n) : null;
|
|
1099
1100
|
if (!o || !e) return null;
|
|
1100
1101
|
const r = lt(o, A).slice();
|
|
1101
|
-
return !Number.isInteger(a) || a < 0 || a >= r.length ? null : (r[a] = e, jt(t,
|
|
1102
|
+
return !Number.isInteger(a) || a < 0 || a >= r.length ? null : (r[a] = e, jt(t, Nn(o, r, A)));
|
|
1102
1103
|
}
|
|
1103
|
-
function
|
|
1104
|
+
function Ci(t, a, n, o) {
|
|
1104
1105
|
const e = it(t), r = L(t), i = dt(r);
|
|
1105
1106
|
if (!e || !i || !Yt(n) || !Yt(o)) return null;
|
|
1106
1107
|
const s = lt(e, A).slice(), c = a.filter((u) => Number.isInteger(u) && u >= 0 && u < s.length);
|
|
@@ -1109,21 +1110,21 @@ function zi(t, a, n, o) {
|
|
|
1109
1110
|
const f = I(r, s[u]);
|
|
1110
1111
|
s[u] = I(i, [f[0] + n, f[1] + o]);
|
|
1111
1112
|
}
|
|
1112
|
-
return jt(t,
|
|
1113
|
+
return jt(t, Nn(e, s, A));
|
|
1113
1114
|
}
|
|
1114
|
-
function
|
|
1115
|
+
function Ti(t, a, n) {
|
|
1115
1116
|
const o = it(t), e = o ? Ba(t, n) : null;
|
|
1116
1117
|
if (!o || !e) return null;
|
|
1117
1118
|
const r = lt(o, A).length;
|
|
1118
|
-
return !Number.isInteger(a) || a < 0 || a >= r || o.tipo === "LineString" && a >= r - 1 ? null : jt(t,
|
|
1119
|
+
return !Number.isInteger(a) || a < 0 || a >= r || o.tipo === "LineString" && a >= r - 1 ? null : jt(t, No(o, a, e));
|
|
1119
1120
|
}
|
|
1120
|
-
function
|
|
1121
|
+
function qi(t, a) {
|
|
1121
1122
|
const n = it(t);
|
|
1122
1123
|
if (!n || !Number.isInteger(a) || lt(n, A).length <= To(n)) return null;
|
|
1123
1124
|
const o = qo(n, a);
|
|
1124
1125
|
return o ? jt(t, o) : null;
|
|
1125
1126
|
}
|
|
1126
|
-
function
|
|
1127
|
+
function Di(t, a) {
|
|
1127
1128
|
const n = it(t), o = n ? lt(n, A).length : 0;
|
|
1128
1129
|
if (!n || !Number.isInteger(a) || a < 0 || a >= o) return null;
|
|
1129
1130
|
const e = Co(n, a);
|
|
@@ -1131,7 +1132,7 @@ function qi(t, a) {
|
|
|
1131
1132
|
}
|
|
1132
1133
|
function Oi(t, a, n, o, e = !0) {
|
|
1133
1134
|
const r = it(t), i = r ? Ba(t, o) : null, s = r ? lt(r, A).length : 0;
|
|
1134
|
-
return !r || !i || n !== "entrada" && n !== "saida" || !Number.isInteger(a) || a < 0 || a >= s ? null : jt(t,
|
|
1135
|
+
return !r || !i || n !== "entrada" && n !== "saida" || !Number.isInteger(a) || a < 0 || a >= s ? null : jt(t, Do(r, a, n, i, e));
|
|
1135
1136
|
}
|
|
1136
1137
|
const we = [
|
|
1137
1138
|
"retangulo",
|
|
@@ -1181,21 +1182,21 @@ const Re = Object.freeze({
|
|
|
1181
1182
|
"linha-diagonal": "linhas",
|
|
1182
1183
|
seta: "setas",
|
|
1183
1184
|
"seta-dupla": "setas"
|
|
1184
|
-
},
|
|
1185
|
+
}, wi = Object.freeze(
|
|
1185
1186
|
["retangulo", "moldura-dupla", "retangulo-arredondado", "elipse", "circulo", "triangulo", "losango", "linha-horizontal", "linha-vertical", "linha-diagonal", "seta", "seta-dupla"].map((t) => Object.freeze({ valor: t, rotulo: Re[t], grupo: Fe[t], usaQuadro: t === "retangulo" || t === "moldura-dupla" }))
|
|
1186
|
-
), Gt = (t) => typeof t == "number" && Number.isFinite(t),
|
|
1187
|
+
), Gt = (t) => typeof t == "number" && Number.isFinite(t), Nt = (t, a) => Gt(t) && t > 0 ? t : a, cn = (t) => Gt(t) ? Math.min(1, Math.max(0, t)) : void 0;
|
|
1187
1188
|
function q(t, a, n = {}) {
|
|
1188
1189
|
const o = cn(t.opacidadeTraco), e = cn(t.opacidadePreenchimento);
|
|
1189
1190
|
return { traco: t.semTraco === !0 ? null : {
|
|
1190
1191
|
cor: t.corTraco ?? "#000000",
|
|
1191
|
-
espessura:
|
|
1192
|
+
espessura: Nt(t.espessura, 0.35),
|
|
1192
1193
|
tipoLinha: Ua[t.estiloTraco ?? "continuo"] ?? "continua",
|
|
1193
1194
|
...o !== void 0 ? { opacidade: o } : {},
|
|
1194
1195
|
...a && (t.alinhamentoTraco === "dentro" || t.alinhamentoTraco === "fora") ? { alinhamento: t.alinhamentoTraco } : {},
|
|
1195
1196
|
...n
|
|
1196
1197
|
}, preenchimento: a && t.corPreenchimento ? { cor: t.corPreenchimento, ...e !== void 0 ? { opacidade: e } : {} } : null };
|
|
1197
1198
|
}
|
|
1198
|
-
function
|
|
1199
|
+
function zt(t, a, n) {
|
|
1199
1200
|
const o = Gt(n) && n > 0 ? n : 0, e = Math.hypot(a[0] - t[0], a[1] - t[1]);
|
|
1200
1201
|
if (o === 0 || !(e > 2 * o)) return [t, a];
|
|
1201
1202
|
const r = (a[0] - t[0]) / e, i = (a[1] - t[1]) / e;
|
|
@@ -1210,7 +1211,7 @@ function un(t, a, n, o, e) {
|
|
|
1210
1211
|
};
|
|
1211
1212
|
return e && (s.camadaId = e), s;
|
|
1212
1213
|
}
|
|
1213
|
-
function
|
|
1214
|
+
function ki(t, a, n = {}) {
|
|
1214
1215
|
const o = Ra(a);
|
|
1215
1216
|
if (!o || !ke(t)) return [];
|
|
1216
1217
|
const e = typeof n.id == "string" && n.id ? n.id : "predefinicao", r = { id: e, camadaId: n.camadaId }, i = o.largura, s = o.altura, c = (d) => d ? [d] : [], u = n.ponta ?? { estilo: "triangulo" }, f = i > 0 && s > 0;
|
|
@@ -1218,13 +1219,13 @@ function wi(t, a, n = {}) {
|
|
|
1218
1219
|
case "retangulo":
|
|
1219
1220
|
return f ? c(Bt({ ...r, aparencia: q(n, !0) }, o)) : [];
|
|
1220
1221
|
case "retangulo-arredondado":
|
|
1221
|
-
return f ? c(Bt({ ...r, aparencia: q(n, !0) }, o,
|
|
1222
|
+
return f ? c(Bt({ ...r, aparencia: q(n, !0) }, o, Nt(n.raio, Math.min(i, s) * 0.1))) : [];
|
|
1222
1223
|
case "moldura-dupla": {
|
|
1223
1224
|
if (!f) return [];
|
|
1224
|
-
const d =
|
|
1225
|
+
const d = Nt(n.espacamento, 1.5);
|
|
1225
1226
|
if (2 * d >= Math.min(i, s)) return [];
|
|
1226
1227
|
const l = `${e}-grupo`, h = n.preenchimentoNa === "externa", m = Bt({ ...r, grupoId: l, aparencia: q(n, h) }, o), g = Bt(
|
|
1227
|
-
{ id: `${e}-2`, camadaId: n.camadaId, grupoId: l, aparencia: q({ ...n, espessura:
|
|
1228
|
+
{ id: `${e}-2`, camadaId: n.camadaId, grupoId: l, aparencia: q({ ...n, espessura: Nt(n.espessuraInterna, Nt(n.espessura, 0.35) * 2) }, !h) },
|
|
1228
1229
|
{ x: o.x + d, y: o.y + d, largura: i - 2 * d, altura: s - 2 * d }
|
|
1229
1230
|
);
|
|
1230
1231
|
return m && g ? [m, g] : [];
|
|
@@ -1241,28 +1242,28 @@ function wi(t, a, n = {}) {
|
|
|
1241
1242
|
case "losango":
|
|
1242
1243
|
return f ? [un(e, o, [[0, -s / 2], [i / 2, 0], [0, s / 2], [-i / 2, 0]], q(n, !0), n.camadaId)] : [];
|
|
1243
1244
|
case "linha-horizontal": {
|
|
1244
|
-
const [d, l] =
|
|
1245
|
+
const [d, l] = zt([o.x, o.y + s / 2], [o.x + i, o.y + s / 2], n.recuo);
|
|
1245
1246
|
return i > 0 ? c(Lt({ ...r, aparencia: q(n, !1) }, d, l)) : [];
|
|
1246
1247
|
}
|
|
1247
1248
|
case "linha-vertical": {
|
|
1248
|
-
const [d, l] =
|
|
1249
|
+
const [d, l] = zt([o.x + i / 2, o.y], [o.x + i / 2, o.y + s], n.recuo);
|
|
1249
1250
|
return s > 0 ? c(Lt({ ...r, aparencia: q(n, !1) }, d, l)) : [];
|
|
1250
1251
|
}
|
|
1251
1252
|
case "linha-diagonal": {
|
|
1252
|
-
const [d, l] =
|
|
1253
|
+
const [d, l] = zt([o.x, o.y], [o.x + i, o.y + s], n.recuo);
|
|
1253
1254
|
return f ? c(Lt({ ...r, aparencia: q(n, !1) }, d, l)) : [];
|
|
1254
1255
|
}
|
|
1255
1256
|
case "seta": {
|
|
1256
|
-
const [d, l] =
|
|
1257
|
+
const [d, l] = zt([o.x, o.y + s / 2], [o.x + i, o.y + s / 2], n.recuo);
|
|
1257
1258
|
return i > 0 ? c(Lt({ ...r, aparencia: q(n, !1, { pontaFim: u }) }, d, l)) : [];
|
|
1258
1259
|
}
|
|
1259
1260
|
case "seta-dupla": {
|
|
1260
|
-
const [d, l] =
|
|
1261
|
+
const [d, l] = zt([o.x, o.y + s / 2], [o.x + i, o.y + s / 2], n.recuo);
|
|
1261
1262
|
return i > 0 ? c(Lt({ ...r, aparencia: q(n, !1, { pontaInicio: u, pontaFim: u }) }, d, l)) : [];
|
|
1262
1263
|
}
|
|
1263
1264
|
}
|
|
1264
1265
|
}
|
|
1265
|
-
const
|
|
1266
|
+
const Ri = ["A0", "A1", "A2", "A3", "A4"], _e = Object.freeze({
|
|
1266
1267
|
A0: [841, 1189],
|
|
1267
1268
|
A1: [594, 841],
|
|
1268
1269
|
A2: [420, 594],
|
|
@@ -1278,7 +1279,7 @@ function Xe(t, a, n) {
|
|
|
1278
1279
|
const o = t - n.esquerda - n.direita, e = a - n.superior - n.inferior;
|
|
1279
1280
|
return o > 0 && e > 0 ? { x: n.esquerda, y: n.superior, largura: o, altura: e } : null;
|
|
1280
1281
|
}
|
|
1281
|
-
function
|
|
1282
|
+
function Fi(t, a = "retrato", n = {}) {
|
|
1282
1283
|
const o = _e[t];
|
|
1283
1284
|
if (!o) return null;
|
|
1284
1285
|
const [e, r] = a === "paisagem" ? [o[1], o[0]] : o, i = { ...Ge(t) };
|
|
@@ -1378,7 +1379,7 @@ function Ye(t, a, n) {
|
|
|
1378
1379
|
t[o] = { ...r, p: [i[0] + (s[0] - i[0]) * u, i[1] + (s[1] - i[1]) * u] };
|
|
1379
1380
|
}
|
|
1380
1381
|
function We(t) {
|
|
1381
|
-
const a =
|
|
1382
|
+
const a = Oa(t);
|
|
1382
1383
|
if (!a || !(a.largura > 0) || !(a.altura > 0)) return null;
|
|
1383
1384
|
const n = Ta(Qt(a.largura, a.altura), j(a.x, a.y), L(t));
|
|
1384
1385
|
return Xo(n) ? null : n;
|
|
@@ -1386,7 +1387,7 @@ function We(t) {
|
|
|
1386
1387
|
function Ze(t) {
|
|
1387
1388
|
var s;
|
|
1388
1389
|
if (!t || typeof t != "object" || t.oculto) return null;
|
|
1389
|
-
const a =
|
|
1390
|
+
const a = O(t);
|
|
1390
1391
|
if (!a) return null;
|
|
1391
1392
|
const n = rt(t), o = { id: String(t.id), opacidade: n.opacidade, preenchimento: null, hachura: null, traco: null, pontas: [], texto: null }, e = t.geometria.tipo === "texto" ? t.geometria : null;
|
|
1392
1393
|
if (e)
|
|
@@ -1394,7 +1395,7 @@ function Ze(t) {
|
|
|
1394
1395
|
linhas: String(e.texto ?? "").split(`
|
|
1395
1396
|
`),
|
|
1396
1397
|
tamanho: e.tamanho,
|
|
1397
|
-
fonte:
|
|
1398
|
+
fonte: On(e.fonte),
|
|
1398
1399
|
alinhamento: e.alinhamento === "centro" ? "center" : e.alinhamento === "direita" ? "right" : "left",
|
|
1399
1400
|
cor: n.preenchimento.cor,
|
|
1400
1401
|
opacidade: n.preenchimento.opacidade,
|
|
@@ -1482,7 +1483,7 @@ function Vn(t, a) {
|
|
|
1482
1483
|
let c = s;
|
|
1483
1484
|
const u = o.opacidade(i);
|
|
1484
1485
|
u < 1 && (c = { ...c, opacidade: c.opacidade * u });
|
|
1485
|
-
const f = i.recorteId ? e.get(i.recorteId) : void 0, d = f && f.mascara ?
|
|
1486
|
+
const f = i.recorteId ? e.get(i.recorteId) : void 0, d = f && f.mascara ? O(f) : null;
|
|
1486
1487
|
d && d.tipo === "Polygon" && (c = { ...c, recorte: { caminho: Bn(d), regra: d.aneis.length > 1 ? "evenodd" : "nonzero" } }), r.push(c);
|
|
1487
1488
|
}
|
|
1488
1489
|
return r;
|
|
@@ -1581,7 +1582,7 @@ function tr(t, a = {}) {
|
|
|
1581
1582
|
return !(r.x0 <= r.x1 && r.y0 <= r.y1) || ![r.x0, r.y0, r.x1, r.y1].every(va) ? null : { x: r.x0, y: r.y0, largura: r.x1 - r.x0, altura: r.y1 - r.y0 };
|
|
1582
1583
|
}
|
|
1583
1584
|
const $t = (t) => typeof t == "number" && Number.isFinite(t), Wt = (t) => !!t && [t.x, t.y, t.largura, t.altura].every($t) && t.largura > 0 && t.altura > 0;
|
|
1584
|
-
function
|
|
1585
|
+
function _i(t, a, n, o = {}) {
|
|
1585
1586
|
const e = Array.isArray(t) ? t.filter((h) => h && typeof h == "object") : [];
|
|
1586
1587
|
if (!Wt(a) || !Wt(n)) return [...e];
|
|
1587
1588
|
let r = n.largura / a.largura, i = n.altura / a.altura, s = n.x, c = n.y;
|
|
@@ -1603,13 +1604,13 @@ function Fi(t, a, n, o = {}) {
|
|
|
1603
1604
|
return at(h, f);
|
|
1604
1605
|
});
|
|
1605
1606
|
}
|
|
1606
|
-
function
|
|
1607
|
+
function Gi(t, a = {}) {
|
|
1607
1608
|
const n = Array.isArray(t) ? t.filter((f) => f && typeof f == "object") : [], o = $t(a.minimo) && a.minimo > 0 ? a.minimo : 0, e = tr(n);
|
|
1608
1609
|
if (!e) return { elementos: [...n], caixa: { x: 0, y: 0, largura: o, altura: o } };
|
|
1609
1610
|
const r = Math.max(e.largura, o), i = Math.max(e.altura, o), s = (r - e.largura) / 2 - e.x, c = (i - e.altura) / 2 - e.y, u = j(s, c);
|
|
1610
1611
|
return { elementos: n.map((f) => at(f, u)), caixa: { x: 0, y: 0, largura: r, altura: i } };
|
|
1611
1612
|
}
|
|
1612
|
-
function
|
|
1613
|
+
function Xi(t, a, n) {
|
|
1613
1614
|
return !Wt(a) || !Wt(n) || !$t(t == null ? void 0 : t[0]) || !$t(t == null ? void 0 : t[1]) ? null : I({ a: n.largura / a.largura, b: 0, c: 0, d: n.altura / a.altura, e: n.x - a.x * n.largura / a.largura, f: n.y - a.y * n.altura / a.altura }, t);
|
|
1614
1615
|
}
|
|
1615
1616
|
const ar = Object.freeze(
|
|
@@ -1629,7 +1630,7 @@ function nr(t) {
|
|
|
1629
1630
|
}
|
|
1630
1631
|
return null;
|
|
1631
1632
|
}
|
|
1632
|
-
function
|
|
1633
|
+
function Bi(t, a, n = {}) {
|
|
1633
1634
|
const o = Array.isArray(t) ? t.filter((l) => l && typeof l == "object") : [];
|
|
1634
1635
|
if (!a || typeof a != "object") return [...o];
|
|
1635
1636
|
const e = Wn(a.espessura) && a.espessura > 0 ? a.espessura : null, r = n.espessura === "proporcional" && e !== null ? nr(o) : null, i = r !== null && r > 0 && e !== null ? e / r : null, s = a.estiloTraco && Xn.includes(a.estiloTraco) ? a.estiloTraco : null, c = mn(a.opacidadeTraco), u = mn(a.opacidadePreenchimento), f = !!(a.corTraco || e !== null || s || c !== null), d = !!(a.corPreenchimento || u !== null);
|
|
@@ -1659,7 +1660,7 @@ function Xi(t, a, n = {}) {
|
|
|
1659
1660
|
});
|
|
1660
1661
|
}
|
|
1661
1662
|
const pn = (t, a) => Math.abs(t - a) < 1e-6;
|
|
1662
|
-
function
|
|
1663
|
+
function Ui(t) {
|
|
1663
1664
|
var c, u;
|
|
1664
1665
|
const a = (Array.isArray(t) ? t : []).filter((f) => f && typeof f == "object" && !f.mascara);
|
|
1665
1666
|
let n = null, o = 0, e = 0, r = null, i = 0, s = 0;
|
|
@@ -1688,7 +1689,7 @@ const gn = ["save", "restore", "beginPath", "moveTo", "lineTo", "bezierCurveTo",
|
|
|
1688
1689
|
function Jn(t) {
|
|
1689
1690
|
return !t || typeof t != "object" && typeof t != "function" ? "nenhuma" : vt(t, "setTransform") ? "absoluta" : vt(t, "transform") ? "relativa" : "nenhuma";
|
|
1690
1691
|
}
|
|
1691
|
-
function
|
|
1692
|
+
function Hi(t) {
|
|
1692
1693
|
const a = !!t && (typeof t == "object" || typeof t == "function"), n = Jn(t), o = [], e = [], r = (i) => {
|
|
1693
1694
|
try {
|
|
1694
1695
|
return t[i] !== void 0;
|
|
@@ -1738,7 +1739,7 @@ function bn(t) {
|
|
|
1738
1739
|
}
|
|
1739
1740
|
}
|
|
1740
1741
|
}
|
|
1741
|
-
function
|
|
1742
|
+
function Vi() {
|
|
1742
1743
|
Aa = !1;
|
|
1743
1744
|
}
|
|
1744
1745
|
const Pa = 24, er = 256, Zt = (t) => typeof t == "number" && Number.isFinite(t);
|
|
@@ -1892,7 +1893,7 @@ function hr(t, a, n = {}) {
|
|
|
1892
1893
|
const u = r === "relativa" ? or(t) : t, f = n.matriz ? It(n.matriz) : nt, d = n.fundo;
|
|
1893
1894
|
if (d && [d.largura, d.altura].every((l) => Number.isFinite(l) && l > 0))
|
|
1894
1895
|
try {
|
|
1895
|
-
u.save(), tt(u, f), u.globalAlpha = 1, u.fillStyle =
|
|
1896
|
+
u.save(), tt(u, f), u.globalAlpha = 1, u.fillStyle = z(d.cor, "#ffffff"), u.fillRect(0, 0, d.largura, d.altura), u.restore();
|
|
1896
1897
|
} catch (l) {
|
|
1897
1898
|
vn(o, l instanceof Error ? l.message : String(l));
|
|
1898
1899
|
try {
|
|
@@ -1912,7 +1913,7 @@ function hr(t, a, n = {}) {
|
|
|
1912
1913
|
}
|
|
1913
1914
|
return o.falhas > 0 && bn(`${o.falhas} falha(s) ao pintar; primeira: ${o.primeiraFalha}`), o;
|
|
1914
1915
|
}
|
|
1915
|
-
function
|
|
1916
|
+
function Yi(t, a, n = {}) {
|
|
1916
1917
|
return hr(t, dr(a, { camadas: n.camadas }), n);
|
|
1917
1918
|
}
|
|
1918
1919
|
const ha = (t) => typeof t == "number" && Number.isFinite(t);
|
|
@@ -1923,7 +1924,7 @@ function mr(t) {
|
|
|
1923
1924
|
return Object.is(o, -0) || o === 0 ? "0" : String(o);
|
|
1924
1925
|
};
|
|
1925
1926
|
}
|
|
1926
|
-
const R = (t) =>
|
|
1927
|
+
const R = (t) => Na(t);
|
|
1927
1928
|
function Q(t, a) {
|
|
1928
1929
|
let n = "";
|
|
1929
1930
|
for (const o of t)
|
|
@@ -1932,8 +1933,8 @@ function Q(t, a) {
|
|
|
1932
1933
|
}
|
|
1933
1934
|
const Kn = (t, a) => `matrix(${[t.a, t.b, t.c, t.d, t.e, t.f].map(a).join(" ")})`, B = (t, a, n) => a < 1 ? ` ${t}="${n(Math.max(0, a))}"` : "";
|
|
1934
1935
|
function to(t, a, n, o) {
|
|
1935
|
-
const e = t.alinhamento === "center" ? "middle" : t.alinhamento === "right" ? "end" : "start", r = t.linhas.map((i, s) => `<tspan x="0" y="${o(s * t.tamanho * t.entrelinha)}">${
|
|
1936
|
-
return `<text transform="${Kn(t.matriz, o)}" font-size="${o(t.tamanho)}" font-family="${R(t.fonte)}" text-anchor="${e}" fill="${R(
|
|
1936
|
+
const e = t.alinhamento === "center" ? "middle" : t.alinhamento === "right" ? "end" : "start", r = t.linhas.map((i, s) => `<tspan x="0" y="${o(s * t.tamanho * t.entrelinha)}">${Na(i)}</tspan>`).join("");
|
|
1937
|
+
return `<text transform="${Kn(t.matriz, o)}" font-size="${o(t.tamanho)}" font-family="${R(t.fonte)}" text-anchor="${e}" fill="${R(z(a, "#000000"))}" xml:space="preserve"${B("fill-opacity", n, o)}>${r}</text>`;
|
|
1937
1938
|
}
|
|
1938
1939
|
function pr(t) {
|
|
1939
1940
|
let a = 1 / 0, n = 1 / 0, o = -1 / 0, e = -1 / 0;
|
|
@@ -1946,7 +1947,7 @@ function pr(t) {
|
|
|
1946
1947
|
return Number.isFinite(a) ? [a, n, o, e] : null;
|
|
1947
1948
|
}
|
|
1948
1949
|
function gr(t, a, n, o) {
|
|
1949
|
-
const e = R(
|
|
1950
|
+
const e = R(z(t.cor, "#000000")), r = t.partes.filter((c) => w(c.caminho)).map((c) => c.modo === "encher" ? `<path d="${Q(c.caminho, a)}" fill="${e}" fill-rule="${c.regra}" stroke="none"/>` : `<path d="${Q(c.caminho, a)}" fill="none" stroke="${e}" stroke-width="${a(c.largura)}" stroke-linecap="${c.terminacao}" stroke-linejoin="${c.juncao}"${c.tracejado.length > 0 ? ` stroke-dasharray="${c.tracejado.map(a).join(" ")}"` : ""}/>`);
|
|
1950
1951
|
if (t.texto && r.push(to(t.texto, t.cor, 1, a)), r.length === 0) return "";
|
|
1951
1952
|
let i = "";
|
|
1952
1953
|
const s = pr(t.partes.map((c) => c.caminho));
|
|
@@ -1961,9 +1962,9 @@ function yr(t, a, n, o) {
|
|
|
1961
1962
|
t.sombra && e.push(gr(t.sombra, a, n, o));
|
|
1962
1963
|
const r = t.preenchimento;
|
|
1963
1964
|
if (r && w(r.caminho)) {
|
|
1964
|
-
let d = R(
|
|
1965
|
+
let d = R(z(r.cor, "#000000"));
|
|
1965
1966
|
if (r.gradiente) {
|
|
1966
|
-
const l = `pr-g${o.n++}`, h = r.gradiente.def, m = h.paradas.map((y) => `<stop offset="${a(y.posicao)}" stop-color="${R(
|
|
1967
|
+
const l = `pr-g${o.n++}`, h = r.gradiente.def, m = h.paradas.map((y) => `<stop offset="${a(y.posicao)}" stop-color="${R(z(y.cor, "#000000"))}"${B("stop-opacity", y.opacidade ?? 1, a)}/>`).join(""), g = `id="${l}" gradientUnits="userSpaceOnUse" gradientTransform="${Kn(r.gradiente.quadro, a)}"`;
|
|
1967
1968
|
n.push(h.tipo === "linear" ? `<linearGradient ${g} x1="${a(h.de[0])}" y1="${a(h.de[1])}" x2="${a(h.ate[0])}" y2="${a(h.ate[1])}">${m}</linearGradient>` : `<radialGradient ${g} cx="${a(h.centro[0])}" cy="${a(h.centro[1])}" r="${a(h.raio)}" fx="${a((h.foco ?? h.centro)[0])}" fy="${a((h.foco ?? h.centro)[1])}">${m}</radialGradient>`), d = `url(#${l})`;
|
|
1968
1969
|
}
|
|
1969
1970
|
e.push(`<path d="${Q(r.caminho, a)}" fill="${d}" fill-rule="${r.regra}" stroke="none"${B("fill-opacity", r.opacidade, a)}/>`);
|
|
@@ -1973,16 +1974,16 @@ function yr(t, a, n, o) {
|
|
|
1973
1974
|
const d = `pr-c${o.n++}`;
|
|
1974
1975
|
n.push(`<clipPath id="${d}"><path d="${Q(i.recorte, a)}" clip-rule="${i.regra}"/></clipPath>`);
|
|
1975
1976
|
const l = i.linhas.map(([h, m]) => `M${a(h[0])} ${a(h[1])}L${a(m[0])} ${a(m[1])}`).join("");
|
|
1976
|
-
e.push(`<path d="${l}" clip-path="url(#${d})" fill="none" stroke="${R(
|
|
1977
|
+
e.push(`<path d="${l}" clip-path="url(#${d})" fill="none" stroke="${R(z(i.cor, "#000000"))}" stroke-width="${a(i.largura)}" stroke-linecap="butt"${B("stroke-opacity", i.opacidade, a)}/>`);
|
|
1977
1978
|
}
|
|
1978
1979
|
const s = t.traco;
|
|
1979
1980
|
if (s && w(s.caminho)) {
|
|
1980
1981
|
const d = s.tracejado.length > 0 ? ` stroke-dasharray="${s.tracejado.map(a).join(" ")}"` : "";
|
|
1981
|
-
e.push(`<path d="${Q(s.caminho, a)}" fill="none" stroke="${R(
|
|
1982
|
+
e.push(`<path d="${Q(s.caminho, a)}" fill="none" stroke="${R(z(s.cor, "#000000"))}" stroke-width="${a(s.largura)}" stroke-linecap="${s.terminacao}" stroke-linejoin="${s.juncao}" stroke-miterlimit="${a(s.limitePonta)}"${d}${B("stroke-opacity", s.opacidade, a)}/>`);
|
|
1982
1983
|
}
|
|
1983
1984
|
for (const d of t.pontas) {
|
|
1984
1985
|
if (!w(d.caminho)) continue;
|
|
1985
|
-
const l = R(
|
|
1986
|
+
const l = R(z(d.cor, "#000000"));
|
|
1986
1987
|
e.push(d.preenchida ? `<path d="${Q(d.caminho, a)}" fill="${l}" stroke="none"${B("fill-opacity", d.opacidade, a)}/>` : `<path d="${Q(d.caminho, a)}" fill="none" stroke="${l}" stroke-width="${a(d.largura)}" stroke-linejoin="miter"${B("stroke-opacity", d.opacidade, a)}/>`);
|
|
1987
1988
|
}
|
|
1988
1989
|
const c = t.texto;
|
|
@@ -1995,14 +1996,14 @@ function yr(t, a, n, o) {
|
|
|
1995
1996
|
const f = t.mesclagem && /^[a-z-]+$/.test(t.mesclagem) ? ` style="mix-blend-mode:${t.mesclagem}"` : "";
|
|
1996
1997
|
return `<g data-id="${R(t.id)}"${B("opacity", t.opacidade, a)}${u}${f}>${e.join("")}</g>`;
|
|
1997
1998
|
}
|
|
1998
|
-
function
|
|
1999
|
+
function Wi(t, a) {
|
|
1999
2000
|
const n = ha(a == null ? void 0 : a.casas) ? Math.min(8, Math.max(0, Math.round(a.casas))) : 4, o = mr(n), e = ha(a == null ? void 0 : a.largura) && a.largura > 0 ? a.largura : 1, r = ha(a == null ? void 0 : a.altura) && a.altura > 0 ? a.altura : 1, i = [], s = { n: 0 }, c = [];
|
|
2000
2001
|
for (const l of Vn(t, a == null ? void 0 : a.camadas))
|
|
2001
2002
|
try {
|
|
2002
2003
|
c.push(yr(l, o, i, s));
|
|
2003
2004
|
} catch {
|
|
2004
2005
|
}
|
|
2005
|
-
const u = a != null && a.titulo ? `<title>${
|
|
2006
|
+
const u = a != null && a.titulo ? `<title>${Na(a.titulo)}</title>` : "", f = a != null && a.fundo ? `<rect x="0" y="0" width="${o(e)}" height="${o(r)}" fill="${R(z(a.fundo, "#ffffff"))}"/>` : "", d = i.length > 0 ? `<defs>${i.join("")}</defs>` : "";
|
|
2006
2007
|
return `<svg xmlns="http://www.w3.org/2000/svg" width="${o(e)}mm" height="${o(r)}mm" viewBox="0 0 ${o(e)} ${o(r)}">${u}${d}${f}${c.join("")}</svg>`;
|
|
2007
2008
|
}
|
|
2008
2009
|
const Tt = (t) => typeof t == "number" && Number.isFinite(t), An = (t) => !!t && Tt(t.x) && Tt(t.y) && Tt(t.largura) && Tt(t.altura) && t.largura >= 0 && t.altura >= 0, Pn = (t) => [t.x, t.x + t.largura / 2, t.x + t.largura], In = (t) => [t.y, t.y + t.altura / 2, t.y + t.altura];
|
|
@@ -2020,7 +2021,7 @@ function Sn(t, a, n, o) {
|
|
|
2020
2021
|
const [e, r, i, s] = t === "vertical" ? [n.y, n.y + n.altura, o.y, o.y + o.altura] : [n.x, n.x + n.largura, o.x, o.x + o.largura], c = { orientacao: t, posicao: a, de: Math.min(e, i), ate: Math.max(r, s) };
|
|
2021
2022
|
return r < i ? c.distancia = i - r : s < e && (c.distancia = e - s), c;
|
|
2022
2023
|
}
|
|
2023
|
-
function
|
|
2024
|
+
function Zi(t, a, n) {
|
|
2024
2025
|
const o = { correcao: [0, 0], linhas: [] };
|
|
2025
2026
|
if (!An(t) || !Tt(n) || n < 0 || !Array.isArray(a)) return o;
|
|
2026
2027
|
const e = a.filter(An), r = $n(Pn(t), e, Pn, n), i = $n(In(t), e, In, n), s = (r == null ? void 0 : r.delta) ?? 0, c = (i == null ? void 0 : i.delta) ?? 0, u = { ...t, x: t.x + s, y: t.y + c }, f = [];
|
|
@@ -2047,7 +2048,7 @@ function br(t) {
|
|
|
2047
2048
|
function no(t) {
|
|
2048
2049
|
return aa(t) ? wn(t.geometria.largura, t.geometria.altura, t.geometria.raios) : null;
|
|
2049
2050
|
}
|
|
2050
|
-
function
|
|
2051
|
+
function Ji(t, a) {
|
|
2051
2052
|
if (!aa(t) || t.bloqueado) return null;
|
|
2052
2053
|
const n = no(t), o = t.geometria, e = ot(a) && a > 0 ? Math.min(a / br(t), Math.min(o.largura, o.altura) / 2) : 0, r = L(t);
|
|
2053
2054
|
return [0, 1, 2, 3].map((i) => {
|
|
@@ -2055,7 +2056,7 @@ function Zi(t, a) {
|
|
|
2055
2056
|
return I(r, [s[0] + c[0] * u, s[1] + c[1] * u]);
|
|
2056
2057
|
});
|
|
2057
2058
|
}
|
|
2058
|
-
function
|
|
2059
|
+
function Qi(t, a, n) {
|
|
2059
2060
|
if (!aa(t) || !Number.isInteger(a) || a < 0 || a > 3 || !ot(n == null ? void 0 : n[0]) || !ot(n == null ? void 0 : n[1])) return null;
|
|
2060
2061
|
const o = dt(L(t));
|
|
2061
2062
|
if (!o) return null;
|
|
@@ -2067,7 +2068,7 @@ function En(t, a, n) {
|
|
|
2067
2068
|
const o = t.geometria, e = Math.min(Math.max(0, n), Math.min(o.largura, o.altura) / 2), r = no(t), i = a === null ? [e, e, e, e] : r.map((c, u) => u === a ? e : c), s = i.some((c) => c > 0) ? { tipo: "retangulo", largura: o.largura, altura: o.altura, raios: i } : { tipo: "retangulo", largura: o.largura, altura: o.altura };
|
|
2068
2069
|
return { ...t, geometria: s };
|
|
2069
2070
|
}
|
|
2070
|
-
function
|
|
2071
|
+
function Ki(t, a) {
|
|
2071
2072
|
if (typeof a == "number") return En(t, null, a);
|
|
2072
2073
|
if (!Array.isArray(a) || a.length !== 4 || !a.every(ot)) return null;
|
|
2073
2074
|
let n = t;
|
|
@@ -2075,7 +2076,7 @@ function Qi(t, a) {
|
|
|
2075
2076
|
return n;
|
|
2076
2077
|
}
|
|
2077
2078
|
const Rt = (t) => typeof t == "number" && Number.isFinite(t);
|
|
2078
|
-
function
|
|
2079
|
+
function ts(t, a) {
|
|
2079
2080
|
const n = new Set(a), o = new Set(t.filter((e) => n.has(e.id) && e.grupoId).map((e) => e.grupoId));
|
|
2080
2081
|
return t.filter((e) => n.has(e.id) || e.grupoId !== void 0 && o.has(e.grupoId)).map((e) => e.id);
|
|
2081
2082
|
}
|
|
@@ -2084,7 +2085,7 @@ const oo = (t) => {
|
|
|
2084
2085
|
const { ordem: a, ...n } = t;
|
|
2085
2086
|
return n;
|
|
2086
2087
|
};
|
|
2087
|
-
function
|
|
2088
|
+
function as(t, a, n, o) {
|
|
2088
2089
|
const e = new Set(a), r = Et(o), i = _t(t, r).map(oo);
|
|
2089
2090
|
if (n === "frente" || n === "tras") {
|
|
2090
2091
|
const c = /* @__PURE__ */ new Map();
|
|
@@ -2122,7 +2123,7 @@ function ts(t, a, n, o) {
|
|
|
2122
2123
|
}
|
|
2123
2124
|
return s;
|
|
2124
2125
|
}
|
|
2125
|
-
function
|
|
2126
|
+
function ns(t, a, n, o) {
|
|
2126
2127
|
const e = new Set(a);
|
|
2127
2128
|
if (e.size < 2 || typeof n != "string" || !n) return [...t];
|
|
2128
2129
|
const r = _t(t, o).map(oo), i = r.filter((u) => e.has(u.id)).map((u) => ({ ...u, grupoId: n })), s = r.map((u) => e.has(u.id)).lastIndexOf(!0), c = [];
|
|
@@ -2130,7 +2131,7 @@ function as(t, a, n, o) {
|
|
|
2130
2131
|
e.has(u.id) || c.push(u), f === s && c.push(...i);
|
|
2131
2132
|
}), c;
|
|
2132
2133
|
}
|
|
2133
|
-
function
|
|
2134
|
+
function os(t, a) {
|
|
2134
2135
|
const n = new Set(a), o = new Set(t.filter((e) => n.has(e.id) && e.grupoId).map((e) => e.grupoId));
|
|
2135
2136
|
return t.map((e) => {
|
|
2136
2137
|
if (!e.grupoId || !o.has(e.grupoId)) return e;
|
|
@@ -2157,7 +2158,7 @@ function ro(t) {
|
|
|
2157
2158
|
return n;
|
|
2158
2159
|
}
|
|
2159
2160
|
const Sa = (t, a, n) => a === 0 && n === 0 ? [] : t.membros.filter((o) => !o.bloqueado).map((o) => at(o, j(a, n)));
|
|
2160
|
-
function
|
|
2161
|
+
function es(t, a, n = { tipo: "selecao" }) {
|
|
2161
2162
|
let o = ro(t), e = null;
|
|
2162
2163
|
if ((n == null ? void 0 : n.tipo) === "caixa") {
|
|
2163
2164
|
const i = n.caixa;
|
|
@@ -2200,7 +2201,7 @@ function os(t, a, n = { tipo: "selecao" }) {
|
|
|
2200
2201
|
}
|
|
2201
2202
|
return r;
|
|
2202
2203
|
}
|
|
2203
|
-
function
|
|
2204
|
+
function rs(t, a, n = "espacos", o) {
|
|
2204
2205
|
const e = a === "horizontal", r = ro(t), i = Rt(o) && n === "espacos";
|
|
2205
2206
|
if (r.length < (i ? 2 : 3)) return [];
|
|
2206
2207
|
const s = (g) => e ? g.x : g.y, c = (g) => e ? g.largura : g.altura;
|
|
@@ -2221,7 +2222,7 @@ function es(t, a, n = "espacos", o) {
|
|
|
2221
2222
|
}
|
|
2222
2223
|
return d;
|
|
2223
2224
|
}
|
|
2224
|
-
function
|
|
2225
|
+
function is(t, a, n = [0, 0]) {
|
|
2225
2226
|
var s;
|
|
2226
2227
|
const o = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map();
|
|
2227
2228
|
for (const c of t) o.set(c.id, a(((s = c.geometria) == null ? void 0 : s.tipo) ?? "elemento"));
|
|
@@ -2231,7 +2232,7 @@ function rs(t, a, n = [0, 0]) {
|
|
|
2231
2232
|
return u.id = o.get(c.id), c.grupoId && (e.has(c.grupoId) || e.set(c.grupoId, a("grupo")), u.grupoId = e.get(c.grupoId)), c.recorteId && (o.has(c.recorteId) ? u.recorteId = o.get(c.recorteId) : delete u.recorteId), delete u.ordem, r === 0 && i === 0 ? u : at(u, j(r, i));
|
|
2232
2233
|
});
|
|
2233
2234
|
}
|
|
2234
|
-
function
|
|
2235
|
+
function ss(t, a) {
|
|
2235
2236
|
return t.map((n) => {
|
|
2236
2237
|
if (!a) {
|
|
2237
2238
|
const { aparencia: o, ...e } = n;
|
|
@@ -2245,8 +2246,8 @@ function et(t, a, n = t.id) {
|
|
|
2245
2246
|
const { transformacao: o, pivo: e, ...r } = t;
|
|
2246
2247
|
return { ...r, id: n, geometria: { tipo: "caminho", geometria: a } };
|
|
2247
2248
|
}
|
|
2248
|
-
function
|
|
2249
|
-
const n = t.map((e) => ({ e, c:
|
|
2249
|
+
function cs(t, a = 0.01) {
|
|
2250
|
+
const n = t.map((e) => ({ e, c: O(e) })).filter((e) => e.c && e.e.geometria.tipo !== "texto");
|
|
2250
2251
|
if (n.length < 2) return { motivo: "selecao-insuficiente" };
|
|
2251
2252
|
const o = ut(a) && a >= 0 ? a : 0.01;
|
|
2252
2253
|
if (n.every((e) => e.c.tipo === "LineString")) {
|
|
@@ -2262,34 +2263,34 @@ function ss(t, a = 0.01) {
|
|
|
2262
2263
|
}
|
|
2263
2264
|
return { motivo: "tipos-incompativeis" };
|
|
2264
2265
|
}
|
|
2265
|
-
function
|
|
2266
|
-
const o =
|
|
2266
|
+
function us(t, a, n) {
|
|
2267
|
+
const o = O(t), e = O(a);
|
|
2267
2268
|
if (!o || !e) return { motivo: "degenerado" };
|
|
2268
2269
|
if (o.tipo !== "Polygon" || t.geometria.tipo === "texto") return { motivo: "sem-forma-fechada" };
|
|
2269
2270
|
if (e.tipo !== "LineString") return { motivo: "tipos-incompativeis" };
|
|
2270
|
-
const r =
|
|
2271
|
+
const r = Oo(o.aneis[0], e.coordenadas, A);
|
|
2271
2272
|
return r ? { ok: r.map((i) => et(t, { tipo: "Polygon", aneis: [i] }, n("caminho"))) } : { motivo: "sem-intersecao" };
|
|
2272
2273
|
}
|
|
2273
|
-
function
|
|
2274
|
+
function ls(t, a, n) {
|
|
2274
2275
|
var r;
|
|
2275
|
-
const o =
|
|
2276
|
+
const o = O(t);
|
|
2276
2277
|
if (!o || t.geometria.tipo === "texto") return { motivo: ((r = t.geometria) == null ? void 0 : r.tipo) === "texto" ? "texto" : "degenerado" };
|
|
2277
2278
|
if (!ut(a) || a === 0) return { motivo: "degenerado" };
|
|
2278
2279
|
const e = Pt(o.tipo === "Polygon" ? { tipo: "Polygon", aneis: [o.aneis[0]] } : { tipo: "LineString", coordenadas: o.coordenadas }, a, A);
|
|
2279
2280
|
return e ? { ok: et(t, { tipo: "Polygon", aneis: [e] }, n) } : { motivo: "degenerado" };
|
|
2280
2281
|
}
|
|
2281
|
-
function
|
|
2282
|
+
function fs(t, a) {
|
|
2282
2283
|
var r;
|
|
2283
|
-
const n =
|
|
2284
|
+
const n = O(t);
|
|
2284
2285
|
if (!n || t.geometria.tipo === "texto") return { motivo: ((r = t.geometria) == null ? void 0 : r.tipo) === "texto" ? "texto" : "degenerado" };
|
|
2285
2286
|
const o = ut(a) && a > 0 ? a : 0.1;
|
|
2286
2287
|
if (n.tipo === "Polygon") return { ok: et(t, { tipo: "Polygon", aneis: n.aneis.map((i) => xo(i, o, 1)) }) };
|
|
2287
2288
|
const e = (n.partes && n.partes.length > 1 ? n.partes : [n.coordenadas]).map((i) => vo(i, o, 1));
|
|
2288
2289
|
return { ok: et(t, e.length > 1 ? { tipo: "LineString", coordenadas: e[0], partes: e } : { tipo: "LineString", coordenadas: e[0] }) };
|
|
2289
2290
|
}
|
|
2290
|
-
function
|
|
2291
|
+
function ds(t) {
|
|
2291
2292
|
var i;
|
|
2292
|
-
const a =
|
|
2293
|
+
const a = O(t), n = rt(t).traco;
|
|
2293
2294
|
if (!a || t.geometria.tipo === "texto") return { motivo: ((i = t.geometria) == null ? void 0 : i.tipo) === "texto" ? "texto" : "degenerado" };
|
|
2294
2295
|
if (!n) return { motivo: "degenerado" };
|
|
2295
2296
|
const o = n.largura / 2;
|
|
@@ -2305,18 +2306,18 @@ function fs(t) {
|
|
|
2305
2306
|
const r = et(t, e);
|
|
2306
2307
|
return r.aparencia = { ...t.aparencia ?? {}, traco: null, preenchimento: { cor: n.cor, opacidade: n.opacidade, regra: "evenodd" }, hachura: null }, { ok: r };
|
|
2307
2308
|
}
|
|
2308
|
-
function
|
|
2309
|
+
function hs(t, a, n, o) {
|
|
2309
2310
|
const e = new Set(a), r = _t(t.filter((s) => e.has(s.id)), o);
|
|
2310
2311
|
if (r.length < 2) return { motivo: "selecao-insuficiente" };
|
|
2311
2312
|
const i = [...r].reverse().find((s) => {
|
|
2312
2313
|
var c;
|
|
2313
|
-
return s.geometria.tipo !== "texto" && ((c =
|
|
2314
|
+
return s.geometria.tipo !== "texto" && ((c = O(s)) == null ? void 0 : c.tipo) === "Polygon";
|
|
2314
2315
|
});
|
|
2315
2316
|
return i ? {
|
|
2316
2317
|
ok: t.map((s) => s.id === i.id ? { ...s, mascara: !0, grupoId: n } : e.has(s.id) ? { ...s, recorteId: i.id, grupoId: n } : s)
|
|
2317
2318
|
} : { motivo: "sem-forma-fechada" };
|
|
2318
2319
|
}
|
|
2319
|
-
function
|
|
2320
|
+
function ms(t, a) {
|
|
2320
2321
|
const n = new Set(a), o = new Set(t.filter((r) => n.has(r.id) && r.grupoId).map((r) => r.grupoId)), e = new Set(t.filter((r) => r.mascara && (n.has(r.id) || r.grupoId && o.has(r.grupoId))).map((r) => r.id));
|
|
2321
2322
|
return e.size === 0 ? [...t] : t.map((r) => {
|
|
2322
2323
|
if (e.has(r.id)) {
|
|
@@ -2330,8 +2331,8 @@ function hs(t, a) {
|
|
|
2330
2331
|
return r;
|
|
2331
2332
|
});
|
|
2332
2333
|
}
|
|
2333
|
-
function
|
|
2334
|
-
const o = t != null && t.geometria && t.geometria.tipo !== "texto" ? Ft(t.geometria) : null, e = o ?
|
|
2334
|
+
function ps(t, a, n) {
|
|
2335
|
+
const o = t != null && t.geometria && t.geometria.tipo !== "texto" ? Ft(t.geometria) : null, e = o ? za(o) : null;
|
|
2335
2336
|
if (!e || !ut(a == null ? void 0 : a[0]) || !ut(a == null ? void 0 : a[1])) return null;
|
|
2336
2337
|
const r = L(t);
|
|
2337
2338
|
let i = null;
|
|
@@ -2340,8 +2341,8 @@ function ms(t, a, n) {
|
|
|
2340
2341
|
f <= n && (!i || f < i.d) && (i = { i: c, d: f });
|
|
2341
2342
|
}), i ? i.i : null;
|
|
2342
2343
|
}
|
|
2343
|
-
function
|
|
2344
|
-
const o = t != null && t.geometria && t.geometria.tipo !== "texto" ? Ft(t.geometria) : null, e = o ?
|
|
2344
|
+
function gs(t, a, n) {
|
|
2345
|
+
const o = t != null && t.geometria && t.geometria.tipo !== "texto" ? Ft(t.geometria) : null, e = o ? za(o) : null;
|
|
2345
2346
|
if (!o || !e || !ut(a == null ? void 0 : a[0]) || !ut(a == null ? void 0 : a[1])) return null;
|
|
2346
2347
|
const r = L(t);
|
|
2347
2348
|
let i = null;
|
|
@@ -2500,7 +2501,7 @@ function jn(t, a, n) {
|
|
|
2500
2501
|
}
|
|
2501
2502
|
return t === "uniao" ? !1 : t === "intersecao" ? n.length > 0 && o === n.length : t === "subtracao" ? e : (o & 1) === 1;
|
|
2502
2503
|
}
|
|
2503
|
-
function
|
|
2504
|
+
function ys(t, a, n) {
|
|
2504
2505
|
let o = !1;
|
|
2505
2506
|
for (let e = 0, r = n.length - 1; e < n.length; r = e++) {
|
|
2506
2507
|
const [i, s] = n[e], [c, u] = n[r];
|
|
@@ -2545,13 +2546,13 @@ function Lr(t) {
|
|
|
2545
2546
|
s.push(d.b.p);
|
|
2546
2547
|
const l = (a.get(d.b.id) ?? []).filter((h) => !n[h]);
|
|
2547
2548
|
if (l.length === 0) break;
|
|
2548
|
-
c = l.length === 1 ? l[0] :
|
|
2549
|
+
c = l.length === 1 ? l[0] : zr(d, l, t);
|
|
2549
2550
|
}
|
|
2550
2551
|
u && s.length >= 3 ? o.push(s) : e++;
|
|
2551
2552
|
}
|
|
2552
2553
|
return { aneis: o, descartadas: e };
|
|
2553
2554
|
}
|
|
2554
|
-
function
|
|
2555
|
+
function zr(t, a, n) {
|
|
2555
2556
|
const o = t.b.p[0] - t.a.p[0], e = t.b.p[1] - t.a.p[1];
|
|
2556
2557
|
let r = a[0], i = -1 / 0;
|
|
2557
2558
|
for (const s of a) {
|
|
@@ -2560,12 +2561,12 @@ function Nr(t, a, n) {
|
|
|
2560
2561
|
}
|
|
2561
2562
|
return r;
|
|
2562
2563
|
}
|
|
2563
|
-
function
|
|
2564
|
+
function Nr(t, a, n) {
|
|
2564
2565
|
const o = [], e = [];
|
|
2565
2566
|
for (const i of t) {
|
|
2566
2567
|
const s = jr(i);
|
|
2567
2568
|
if (s.length < 3) continue;
|
|
2568
|
-
const c =
|
|
2569
|
+
const c = Ot(s);
|
|
2569
2570
|
Math.abs(c) <= a || (c > 0 ? o.push({ anel: s, area: c, poligono: { exterior: s, furos: [] } }) : e.push({ anel: s, area: -c }));
|
|
2570
2571
|
}
|
|
2571
2572
|
o.sort((i, s) => i.area - s.area);
|
|
@@ -2635,25 +2636,25 @@ function qr(t, a, n = {}) {
|
|
|
2635
2636
|
m.bordas = _.length;
|
|
2636
2637
|
const { aneis: mt, descartadas: na } = Lr(_);
|
|
2637
2638
|
m.aneis = mt.length;
|
|
2638
|
-
const { poligonos: so, descartados: co } =
|
|
2639
|
-
return m.descartados = na + co, { poligonos: so.map(
|
|
2639
|
+
const { poligonos: so, descartados: co } = Nr(mt, f * f, x);
|
|
2640
|
+
return m.descartados = na + co, { poligonos: so.map(Dr), estatisticas: m };
|
|
2640
2641
|
}
|
|
2641
|
-
const
|
|
2642
|
+
const Dr = (t) => ({
|
|
2642
2643
|
exterior: t.exterior.map(([a, n]) => [a, n]),
|
|
2643
2644
|
furos: t.furos.map((a) => a.map(([n, o]) => [n, o]))
|
|
2644
2645
|
});
|
|
2645
|
-
function
|
|
2646
|
+
function bs(t) {
|
|
2646
2647
|
let a = 0;
|
|
2647
2648
|
for (const n of t ?? []) {
|
|
2648
|
-
a += Math.abs(
|
|
2649
|
-
for (const o of n.furos) a -= Math.abs(
|
|
2649
|
+
a += Math.abs(Ot(n.exterior));
|
|
2650
|
+
for (const o of n.furos) a -= Math.abs(Ot(o));
|
|
2650
2651
|
}
|
|
2651
2652
|
return a;
|
|
2652
2653
|
}
|
|
2653
|
-
function
|
|
2654
|
+
function Or(t) {
|
|
2654
2655
|
var e, r, i;
|
|
2655
2656
|
if (!t || typeof t != "object" || t.mascara || ((e = t.geometria) == null ? void 0 : e.tipo) === "texto" || ((r = t.geometria) == null ? void 0 : r.tipo) === "linha") return null;
|
|
2656
|
-
const a =
|
|
2657
|
+
const a = O(t);
|
|
2657
2658
|
if (!a) return null;
|
|
2658
2659
|
if (a.tipo === "Polygon") {
|
|
2659
2660
|
const s = a.curva && a.aneis.length === 1 ? [At(a.curva, !0)] : a.aneis, c = ((i = rt(t).preenchimento) == null ? void 0 : i.regra) ?? (s.length > 1 ? "evenodd" : "nonzero");
|
|
@@ -2662,8 +2663,8 @@ function Dr(t) {
|
|
|
2662
2663
|
const o = (a.partes && a.partes.length > 1 ? a.partes : [a.curva ? At(a.curva, !1) : a.coordenadas]).filter((s) => s.length >= 3);
|
|
2663
2664
|
return o.length > 0 ? { aneis: o, regra: "nonzero" } : null;
|
|
2664
2665
|
}
|
|
2665
|
-
function
|
|
2666
|
-
const n = (Array.isArray(t) ? t : []).map((c) => ({ e: c, r:
|
|
2666
|
+
function Ms(t, a) {
|
|
2667
|
+
const n = (Array.isArray(t) ? t : []).map((c) => ({ e: c, r: Or(c) })).filter((c) => c.r !== null);
|
|
2667
2668
|
if (n.length < 2) return { motivo: "selecao-insuficiente" };
|
|
2668
2669
|
const o = a === "subtracao" ? n[0].e : n[n.length - 1].e, { poligonos: e } = qr(n.map((c) => c.r), a);
|
|
2669
2670
|
if (e.length === 0) return { motivo: a === "intersecao" ? "sem-intersecao" : "resultado-vazio" };
|
|
@@ -2713,7 +2714,7 @@ function Fr(t) {
|
|
|
2713
2714
|
const a = t.transformacao;
|
|
2714
2715
|
return a && La(a.a) && La(a.b) ? X(Math.atan2(a.b, a.a) * 180 / Math.PI) : 0;
|
|
2715
2716
|
}
|
|
2716
|
-
function
|
|
2717
|
+
function xs(t, a) {
|
|
2717
2718
|
var n, o, e, r, i, s, c, u, f, d, l, h, m, g, y;
|
|
2718
2719
|
if (!(!t || typeof t != "object" || !t.geometria))
|
|
2719
2720
|
try {
|
|
@@ -2811,7 +2812,7 @@ const _r = (t) => {
|
|
|
2811
2812
|
function J(t) {
|
|
2812
2813
|
return t && typeof t == "object" ? { ...t } : {};
|
|
2813
2814
|
}
|
|
2814
|
-
function
|
|
2815
|
+
function vs(t, a, n) {
|
|
2815
2816
|
if (!t || typeof t != "object" || !kr(a) || Rr(a)) return null;
|
|
2816
2817
|
const o = { ...t.aparencia ?? {} }, e = { ...t }, [r, i] = a.split("."), s = _r(n), c = Xr(n), u = Gr(n), f = s === null ? null : Math.min(1, Math.max(0, s / 100));
|
|
2817
2818
|
if (r === "elemento")
|
|
@@ -2890,7 +2891,7 @@ function xs(t, a, n) {
|
|
|
2890
2891
|
return r !== "elemento" && (e.aparencia = o), Se(e) ?? null;
|
|
2891
2892
|
}
|
|
2892
2893
|
const ma = (t) => typeof t == "number" && Number.isFinite(t);
|
|
2893
|
-
class
|
|
2894
|
+
class As {
|
|
2894
2895
|
constructor(a = {}) {
|
|
2895
2896
|
P(this, "desfazeres", []);
|
|
2896
2897
|
P(this, "refazeres", []);
|
|
@@ -2948,21 +2949,21 @@ export {
|
|
|
2948
2949
|
_e as DIMENSOES_FOLHA,
|
|
2949
2950
|
qn as EPSILON_DETERMINANTE,
|
|
2950
2951
|
la as ESCALA_MINIMA,
|
|
2951
|
-
|
|
2952
|
+
$s as ESPACO_GEOGRAFICO,
|
|
2952
2953
|
A as ESPACO_PLANO,
|
|
2953
|
-
|
|
2954
|
+
Ai as ESPESSURA_PADRAO_MM,
|
|
2954
2955
|
wa as ESPESSURA_TRACO_PADRAO_MM,
|
|
2955
2956
|
Xn as ESTILOS_TRACO,
|
|
2956
2957
|
ar as ESTILO_DO_TIPO_LINHA,
|
|
2957
2958
|
er as FAIXAS_MAXIMO,
|
|
2958
2959
|
Pa as FAIXAS_PADRAO,
|
|
2959
2960
|
Yo as FONTE_PADRAO,
|
|
2960
|
-
|
|
2961
|
-
|
|
2961
|
+
Ri as FORMATOS_ABNT,
|
|
2962
|
+
As as Historico,
|
|
2962
2963
|
nt as IDENTIDADE,
|
|
2963
2964
|
wr as IDS_PROPRIEDADES_PRANCHA,
|
|
2964
|
-
|
|
2965
|
-
|
|
2965
|
+
wi as ITENS_PREDEFINICOES,
|
|
2966
|
+
Si as IndicePrancha,
|
|
2966
2967
|
bt as KAPPA,
|
|
2967
2968
|
ue as LIMITE_PONTA_PADRAO,
|
|
2968
2969
|
fn as MAX_LINHAS_HACHURA,
|
|
@@ -2972,34 +2973,34 @@ export {
|
|
|
2972
2973
|
kn as MODOS_MESCLAGEM,
|
|
2973
2974
|
Cr as OPERACOES_BOOLEANAS,
|
|
2974
2975
|
we as PREDEFINICOES,
|
|
2975
|
-
|
|
2976
|
+
De as PRIORIDADE_SNAP_PRANCHA,
|
|
2976
2977
|
Re as ROTULOS_PREDEFINICOES,
|
|
2977
2978
|
ca as SOMBRA_PADRAO,
|
|
2978
2979
|
Ua as TIPO_LINHA_DO_ESTILO,
|
|
2979
2980
|
or as adaptarContextoRelativo,
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2981
|
+
Ti as adicionarAncora,
|
|
2982
|
+
ns as agrupar,
|
|
2983
|
+
Bi as ajustarAparenciaEmLote,
|
|
2984
|
+
_i as ajustarElementosACaixa,
|
|
2985
|
+
zi as alcasDoElemento,
|
|
2986
|
+
es as alinhar,
|
|
2986
2987
|
Rn as analisarElemento,
|
|
2987
|
-
|
|
2988
|
-
|
|
2988
|
+
ps as ancoraMaisProxima,
|
|
2989
|
+
Li as ancorasDoElemento,
|
|
2989
2990
|
rt as aparenciaDe,
|
|
2990
2991
|
I as aplicar,
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2992
|
+
ss as aplicarAparencia,
|
|
2993
|
+
Ms as aplicarPathfinder,
|
|
2994
|
+
ai as aplicarTodos,
|
|
2995
|
+
ti as aplicarVetor,
|
|
2996
|
+
Ot as areaComSinal,
|
|
2997
|
+
bs as areaDosPoligonos,
|
|
2997
2998
|
bn as avisarUmaVez,
|
|
2998
|
-
|
|
2999
|
+
Ei as buscarSnapPrancha,
|
|
2999
3000
|
je as caixaDaSelecao,
|
|
3000
|
-
|
|
3001
|
+
ci as caixaDeCantos,
|
|
3001
3002
|
Xe as caixaDoQuadro,
|
|
3002
|
-
|
|
3003
|
+
Fi as caixaDoQuadroAbnt,
|
|
3003
3004
|
ie as caixaDoTexto,
|
|
3004
3005
|
Ra as caixaNormalizada,
|
|
3005
3006
|
Fa as caixaOrientada,
|
|
@@ -3008,138 +3009,138 @@ export {
|
|
|
3008
3009
|
Q as caminhoParaSvg,
|
|
3009
3010
|
_a as centroDaSelecao,
|
|
3010
3011
|
Ja as cisalhamento,
|
|
3011
|
-
|
|
3012
|
+
vs as comPropriedade,
|
|
3012
3013
|
En as comRaioDeCanto,
|
|
3013
3014
|
et as comoCaminhoNaFolha,
|
|
3014
3015
|
Ta as compor,
|
|
3015
3016
|
Be as comprimentoDaPonta,
|
|
3016
|
-
|
|
3017
|
+
ds as contornoDoTraco,
|
|
3017
3018
|
oe as contornoElipse,
|
|
3018
3019
|
re as contornoEstrela,
|
|
3019
3020
|
Ft as contornoLocal,
|
|
3020
3021
|
ta as contornoLocalEmCache,
|
|
3021
|
-
|
|
3022
|
+
O as contornoNaFolha,
|
|
3022
3023
|
ee as contornoPoligonoRegular,
|
|
3023
3024
|
Qo as contornoRetangulo,
|
|
3024
|
-
|
|
3025
|
-
|
|
3025
|
+
Di as converterAncora,
|
|
3026
|
+
ji as converterEmCaminho,
|
|
3026
3027
|
me as corComOpacidade,
|
|
3027
3028
|
rr as corNaPosicao,
|
|
3028
|
-
|
|
3029
|
+
fi as criarCaminho,
|
|
3029
3030
|
en as criarElipse,
|
|
3030
|
-
|
|
3031
|
+
li as criarEstrela,
|
|
3031
3032
|
Lt as criarLinha,
|
|
3032
|
-
|
|
3033
|
-
|
|
3033
|
+
hs as criarMascara,
|
|
3034
|
+
ui as criarPoligonoRegular,
|
|
3034
3035
|
Bt as criarRetangulo,
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3036
|
+
di as criarTexto,
|
|
3037
|
+
Zr as deMm,
|
|
3038
|
+
ni as decompor,
|
|
3039
|
+
ei as definirMedidorTexto,
|
|
3040
|
+
Ki as definirRaiosDoRetangulo,
|
|
3041
|
+
os as desagrupar,
|
|
3042
|
+
Yi as desenharElementos,
|
|
3042
3043
|
hr as desenharPlano,
|
|
3043
|
-
|
|
3044
|
+
ls as deslocarCaminho,
|
|
3044
3045
|
Jt as determinante,
|
|
3045
|
-
|
|
3046
|
+
Hi as diagnosticarContexto,
|
|
3046
3047
|
He as direcaoNaPonta,
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3048
|
+
rs as distribuir,
|
|
3049
|
+
us as dividirComLinha,
|
|
3050
|
+
is as duplicarElementos,
|
|
3051
|
+
ii as ehFechado,
|
|
3052
|
+
Qr as ehIdentidade,
|
|
3052
3053
|
wt as ehMatrizFinita,
|
|
3053
3054
|
ke as ehPredefinicao,
|
|
3054
3055
|
Rr as ehPropriedadeDeGeometria,
|
|
3055
3056
|
kr as ehPropriedadePrancha,
|
|
3056
3057
|
Xo as ehSingular,
|
|
3057
3058
|
Tn as ehUnidadePrancha,
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3059
|
+
Pi as elementoNoTopo,
|
|
3060
|
+
Ii as elementosNaCaixa,
|
|
3061
|
+
$i as elementosNoLaco,
|
|
3061
3062
|
Te as elementosNoPonto,
|
|
3062
3063
|
qa as emTornoDe,
|
|
3063
3064
|
ce as envelopeNaFolha,
|
|
3064
3065
|
tr as envelopeVisual,
|
|
3065
3066
|
Qt as escala,
|
|
3066
3067
|
Bo as espelhamento,
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3068
|
+
Mi as espelharElementos,
|
|
3069
|
+
qi as excluirAncora,
|
|
3070
|
+
ts as expandirGrupos,
|
|
3071
|
+
Wi as exportarSvg,
|
|
3071
3072
|
ir as faixasDoGradienteLinear,
|
|
3072
3073
|
Xa as feicaoDoElemento,
|
|
3073
|
-
|
|
3074
|
+
On as fonteSegura,
|
|
3074
3075
|
Ue as geometriaDaPonta,
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3076
|
+
ki as gerarPredefinicao,
|
|
3077
|
+
xi as girarElementos,
|
|
3078
|
+
Zi as guiasInteligentes,
|
|
3079
|
+
Kr as iguais,
|
|
3079
3080
|
dt as inverter,
|
|
3080
|
-
|
|
3081
|
-
|
|
3081
|
+
ms as liberarMascara,
|
|
3082
|
+
Oa as limitesLocais,
|
|
3082
3083
|
St as limitesNaFolha,
|
|
3083
3084
|
dn as linhasDeHachura,
|
|
3084
3085
|
Et as mapaDeCamadas,
|
|
3085
|
-
|
|
3086
|
-
|
|
3086
|
+
Xi as mapearPontoNaCaixa,
|
|
3087
|
+
Ji as marcasDosCantos,
|
|
3087
3088
|
Ge as margensAbnt,
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3089
|
+
Jr as matriz,
|
|
3090
|
+
gi as matrizDeCisalhamentoPorAlca,
|
|
3091
|
+
mi as matrizDeEscalaPorAlca,
|
|
3091
3092
|
L as matrizDoElemento,
|
|
3092
|
-
|
|
3093
|
+
ze as meiaEspessura,
|
|
3093
3094
|
Jn as modoDeTransformacao,
|
|
3094
3095
|
Oi as moverAlcaDaAncora,
|
|
3095
3096
|
Ni as moverAncora,
|
|
3096
|
-
|
|
3097
|
-
|
|
3097
|
+
Ci as moverAncoras,
|
|
3098
|
+
yi as moverElemento,
|
|
3098
3099
|
ft as multiplicar,
|
|
3099
3100
|
Ie as normalizarAparencia,
|
|
3100
|
-
|
|
3101
|
+
vi as normalizarCamadas,
|
|
3101
3102
|
Se as normalizarElemento,
|
|
3102
|
-
|
|
3103
|
+
si as normalizarElementos,
|
|
3103
3104
|
Me as normalizarGeometriaElemento,
|
|
3104
3105
|
Ae as normalizarGradiente,
|
|
3105
3106
|
Pe as normalizarHachura,
|
|
3106
|
-
|
|
3107
|
+
Gi as normalizarParaOrigem,
|
|
3107
3108
|
qr as operacaoBooleana,
|
|
3108
3109
|
_t as ordenarPorEmpilhamento,
|
|
3109
3110
|
le as padraoTipoLinhaMm,
|
|
3110
|
-
|
|
3111
|
-
|
|
3111
|
+
Wr as paraMm,
|
|
3112
|
+
bi as pivoNaFolha,
|
|
3112
3113
|
dr as planejar,
|
|
3113
3114
|
Ze as planejarElemento,
|
|
3114
3115
|
Vn as planejarElementos,
|
|
3115
3116
|
Hn as planoDe,
|
|
3116
|
-
|
|
3117
|
+
ys as pontoNoAnel,
|
|
3117
3118
|
F as posicaoLocalDaAlca,
|
|
3118
|
-
|
|
3119
|
-
|
|
3119
|
+
hi as posicoesDasAlcas,
|
|
3120
|
+
Qi as profundidadeNoCanto,
|
|
3120
3121
|
wn as raiosCabiveis,
|
|
3121
3122
|
no as raiosEfetivos,
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3123
|
+
oi as recompor,
|
|
3124
|
+
Vi as redefinirAvisoContexto,
|
|
3125
|
+
Or as regiaoDoElemento,
|
|
3126
|
+
as as reordenar,
|
|
3126
3127
|
ba as resolverAparencia,
|
|
3127
3128
|
ka as resolverSombra,
|
|
3128
|
-
|
|
3129
|
-
|
|
3129
|
+
Ui as resumirAparencia,
|
|
3130
|
+
Dn as rotacao,
|
|
3130
3131
|
Fr as rotacaoEmGraus,
|
|
3131
|
-
|
|
3132
|
+
pi as rotacaoPorArrasto,
|
|
3132
3133
|
It as saneada,
|
|
3133
|
-
|
|
3134
|
-
|
|
3134
|
+
fs as simplificarCaminho,
|
|
3135
|
+
ri as temMedidorTexto,
|
|
3135
3136
|
Le as temPreenchimento,
|
|
3136
3137
|
Ce as testarElemento,
|
|
3137
3138
|
se as transformarContorno,
|
|
3138
3139
|
at as transformarElemento,
|
|
3139
3140
|
_n as transformarElementos,
|
|
3140
3141
|
j as translacao,
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3142
|
+
gs as trechoMaisProximo,
|
|
3143
|
+
cs as unirCaminhos,
|
|
3144
|
+
xs as valorDaPropriedade,
|
|
3144
3145
|
ne as varreduraDoArco
|
|
3145
3146
|
};
|