@thibezer/ui-components-kit 2.24.0 → 2.24.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 +69 -1
- package/dist/botao.cjs +12 -1
- package/dist/botao.js +162 -3
- package/dist/camadas.cjs +311 -1
- package/dist/camadas.js +3244 -148
- package/dist/campo-texto.cjs +16 -1
- package/dist/campo-texto.js +308 -7
- package/dist/canvas.cjs +22 -22
- package/dist/canvas.js +230 -233
- package/dist/card.cjs +20 -1
- package/dist/card.js +145 -2
- package/dist/components/ui-canvas-prancha/index.d.ts +1 -1
- package/dist/components/ui-canvas-prancha/prancha-teclado.d.ts +18 -0
- package/dist/components/ui-canvas-prancha/ui-canvas-prancha-base.d.ts +4 -0
- package/dist/components/ui-card/ui-card.d.ts +4 -0
- package/dist/components/ui-editor-prancha/editor-modos.d.ts +10 -0
- package/dist/components/ui-editor-prancha/editor-tipos.d.ts +4 -0
- package/dist/components/ui-editor-prancha/index.d.ts +1 -0
- package/dist/components/ui-editor-prancha/ui-editor-prancha.d.ts +39 -6
- package/dist/core.cjs +1 -1
- package/dist/core.js +44 -55
- package/dist/{cores-utils-BrdynxRd.js → cores-utils-DMyqWvZh.js} +2 -2
- package/dist/cores.cjs +32 -1
- package/dist/cores.js +300 -13
- package/dist/custom-elements.json +33962 -33439
- package/dist/data.cjs +28 -1
- package/dist/data.js +286 -99
- package/dist/{feature_caixa-2Sxv3tGa.js → feature_caixa-BVc5LenS.js} +42 -42
- package/dist/{feature_desenho-BVHivWIB.js → feature_desenho-CC8Mp5Gp.js} +2 -2
- package/dist/feedback.cjs +52 -1
- package/dist/feedback.js +655 -25
- package/dist/forms.cjs +66 -1
- package/dist/forms.js +1216 -39
- package/dist/{geometria-px-DUs5FgLE.js → geometria-px-DHMPUsxC.js} +47 -47
- package/dist/index.cjs +67 -1
- package/dist/index.js +1476 -274
- package/dist/kit-base-CGqj9aiD.cjs +2 -0
- package/dist/kit-base-_THn4w3u.js +1079 -0
- package/dist/mapa.cjs +5 -5
- package/dist/mapa.js +16 -17
- package/dist/modal.cjs +18 -1
- package/dist/modal.js +235 -29
- package/dist/motor.js +49 -49
- package/dist/prancha-nucleo.cjs +3 -1
- package/dist/prancha-nucleo.js +3120 -277
- package/dist/prancha.cjs +38 -1
- package/dist/prancha.js +3233 -228
- package/dist/register.cjs +1 -1
- package/dist/register.js +3 -20
- package/dist/seletor-mapa-base.cjs +13 -13
- package/dist/seletor-mapa-base.js +3 -5
- package/dist/tabela.cjs +142 -1
- package/dist/tabela.js +3773 -92
- package/dist/tipos-elementos.d.ts +5 -1
- package/dist/tipos-vue.d.ts +4 -1
- package/dist/tools.cjs +16 -1
- package/dist/tools.js +1564 -26
- package/dist/ui-seletor-cor-BGw8SBPm.cjs +83 -0
- package/dist/{ui-seletor-cor-Cd8jkzXG.js → ui-seletor-cor-B_twSm-V.js} +8 -9
- package/dist/utils-ClVgqVyJ.cjs +1 -0
- package/dist/utils-DrHoxxmf.js +83 -0
- package/package.json +43 -2
- package/dist/acessibilidade-CSzX-DkG.cjs +0 -1
- package/dist/acessibilidade-CUlSXc2X.js +0 -38
- package/dist/altura-controle-ukMRPckR.cjs +0 -1
- package/dist/altura-controle-vxQiXG4q.js +0 -62
- package/dist/alvo-digitavel-CzCvNVQ3.js +0 -23
- package/dist/alvo-digitavel-DbH0hYFf.cjs +0 -1
- package/dist/degrade-CIxvOTUv.cjs +0 -1
- package/dist/degrade-gDa5sW__.js +0 -119
- package/dist/feature_caixa-CnYPKVFS.cjs +0 -1
- package/dist/feature_caixa-DCs9ZeSk.js +0 -1038
- package/dist/feature_historico-BAIYk1Me.cjs +0 -3
- package/dist/feature_historico-C4h9y5fu.js +0 -3039
- package/dist/form-atalhos-7JTYvumA.cjs +0 -1
- package/dist/form-atalhos-DDTlpgaB.js +0 -203
- package/dist/form-erros-CwPz7Jr4.cjs +0 -1
- package/dist/form-erros-DT5HklfD.js +0 -184
- package/dist/form-submissao-C-SPRKgT.js +0 -61
- package/dist/form-submissao-DxKO5MHI.cjs +0 -1
- package/dist/form-validacao-BlQFxUVj.js +0 -104
- package/dist/form-validacao-DIeyQVH5.cjs +0 -1
- package/dist/geometria-px-DKrWq_XY.js +0 -639
- package/dist/leaflet-CEPcxGWV.cjs +0 -1
- package/dist/leaflet-DOq10gfg.js +0 -84
- package/dist/leaflet-loader-94z5VsdY.cjs +0 -2
- package/dist/leaflet-loader-Cjcdgj5R.js +0 -21
- package/dist/listener-bag-D5omxZ9h.cjs +0 -1
- package/dist/listener-bag-DQgv7OON.js +0 -34
- package/dist/motor-By2te6PZ.js +0 -1400
- package/dist/motor-CkMxd378.cjs +0 -1
- package/dist/opcoes-CupvWVIm.js +0 -24
- package/dist/opcoes-vdAUY5OI.cjs +0 -1
- package/dist/parts-CaoQiCfI.js +0 -7
- package/dist/parts-vQa2873h.cjs +0 -1
- package/dist/prancha-paleta-BZ-9QDgh.js +0 -5276
- package/dist/prancha-paleta-Bb24vP71.cjs +0 -17
- package/dist/ssr-safe-5cWfJP-s.js +0 -10
- package/dist/ssr-safe-CiHD1adl.cjs +0 -1
- package/dist/svg-seguro-ChVJ2L2z.js +0 -74
- package/dist/svg-seguro-J2RM1Ssf.cjs +0 -1
- package/dist/ui-badge-DE58YSBY.cjs +0 -28
- package/dist/ui-badge-KgmI3jOD.js +0 -201
- package/dist/ui-botao-Dz8YvmiA.cjs +0 -12
- package/dist/ui-botao-zLkcMMyP.js +0 -168
- package/dist/ui-bus-CUd99VJi.js +0 -177
- package/dist/ui-bus-XqBLlTYQ.cjs +0 -1
- package/dist/ui-camadas-DoHPnbQm.js +0 -3133
- package/dist/ui-camadas-Vx7wYD4D.cjs +0 -311
- package/dist/ui-campo-texto-Dliyt9qr.cjs +0 -16
- package/dist/ui-campo-texto-btevggO3.js +0 -379
- package/dist/ui-card-7IEYbCN0.js +0 -150
- package/dist/ui-card-Bx8EyzYY.cjs +0 -20
- package/dist/ui-card-DFnRp9bl.js +0 -146
- package/dist/ui-card-DrWVJQKw.cjs +0 -20
- package/dist/ui-controle-cores-B1w_Yl69.cjs +0 -32
- package/dist/ui-controle-cores-BRjMvmMn.js +0 -291
- package/dist/ui-controle-cores-BcH9k2Fa.js +0 -292
- package/dist/ui-controle-cores-CvSTP6gJ.cjs +0 -32
- package/dist/ui-editor-prancha-CIngI6yI.js +0 -2886
- package/dist/ui-editor-prancha-DorSe6sC.cjs +0 -31
- package/dist/ui-linha-2kY7TNUJ.cjs +0 -38
- package/dist/ui-linha-B4mBRm1x.cjs +0 -61
- package/dist/ui-linha-DTEIIww4.js +0 -1167
- package/dist/ui-linha-KFF86FW5.js +0 -752
- package/dist/ui-modal-BrXzVZ65.js +0 -216
- package/dist/ui-modal-lARKzEVZ.cjs +0 -18
- package/dist/ui-paleta-ferramentas-Bu6JaT0s.js +0 -1245
- package/dist/ui-paleta-ferramentas-D3Jhwt26.cjs +0 -21
- package/dist/ui-paleta-ferramentas-DebHYiwd.js +0 -1615
- package/dist/ui-paleta-ferramentas-Dgejtluh.js +0 -1423
- package/dist/ui-paleta-ferramentas-hzyo8wBt.cjs +0 -22
- package/dist/ui-paleta-ferramentas-jWuICjW8.cjs +0 -22
- package/dist/ui-seletor-cor-0RLjcME6.cjs +0 -83
- package/dist/ui-seletor-cor-CMuuW-Ym.cjs +0 -83
- package/dist/ui-seletor-cor-DFIQ1sin.js +0 -405
- package/dist/ui-skeleton-BLEV6h3k.js +0 -653
- package/dist/ui-skeleton-B_XTaGrX.cjs +0 -52
- package/dist/ui-switch-BXIDwC-Y.cjs +0 -66
- package/dist/ui-switch-Ctxk-jKS.js +0 -1212
- package/dist/ui-tabela-CXxqbwXv.cjs +0 -7
- package/dist/ui-tabela-Cd0vOwnT.js +0 -1459
- package/dist/ui-tabela-propriedades-C5cIF5ES.js +0 -3779
- package/dist/ui-tabela-propriedades-CJyo568n.js +0 -3517
- package/dist/ui-tabela-propriedades-D96Djx-q.cjs +0 -136
- package/dist/ui-tabela-propriedades-Wa34hfIr.cjs +0 -142
- package/dist/ui-tabela-propriedades-ahQhQauu.js +0 -2329
- package/dist/ui-tabela-propriedades-w9JWhjHy.cjs +0 -142
- package/dist/zero-js-triggers-CJT988bR.js +0 -83
- package/dist/zero-js-triggers-CgM9IIQB.cjs +0 -1
|
@@ -1,3133 +0,0 @@
|
|
|
1
|
-
var za = Object.defineProperty;
|
|
2
|
-
var Ma = (e, t, a) => t in e ? za(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
|
|
3
|
-
var A = (e, t, a) => Ma(e, typeof t != "symbol" ? t + "" : t, a);
|
|
4
|
-
import { d as $e, S as Pa } from "./ssr-safe-5cWfJP-s.js";
|
|
5
|
-
import { A as Ba, a as Oe, e as qa } from "./degrade-gDa5sW__.js";
|
|
6
|
-
import { L as Da } from "./listener-bag-DQgv7OON.js";
|
|
7
|
-
import { a as Ke } from "./parts-CaoQiCfI.js";
|
|
8
|
-
import { a as Ta } from "./ui-seletor-cor-Cd8jkzXG.js";
|
|
9
|
-
import { f as Oa } from "./alvo-digitavel-CzCvNVQ3.js";
|
|
10
|
-
const b = {
|
|
11
|
-
camadas: `<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
12
|
-
<polygon points="12 2 2 7 12 12 22 7 12 2"></polygon>
|
|
13
|
-
<polyline points="2 17 12 22 22 17"></polyline>
|
|
14
|
-
<polyline points="2 12 12 17 22 12"></polyline>
|
|
15
|
-
</svg>`,
|
|
16
|
-
inspecao: `<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
17
|
-
<circle cx="11" cy="11" r="8"></circle>
|
|
18
|
-
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
|
|
19
|
-
</svg>`,
|
|
20
|
-
equipe: `<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
21
|
-
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
|
|
22
|
-
<circle cx="9" cy="7" r="4"></circle>
|
|
23
|
-
<path d="M23 21v-2a4 4 0 0 0-3-3.87"></path>
|
|
24
|
-
<path d="M16 3.13a4 4 0 0 1 0 7.75"></path>
|
|
25
|
-
</svg>`,
|
|
26
|
-
olhoAberto: `<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
27
|
-
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path>
|
|
28
|
-
<circle cx="12" cy="12" r="3"></circle>
|
|
29
|
-
</svg>`,
|
|
30
|
-
olhoFechado: `<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
31
|
-
<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"></path>
|
|
32
|
-
<line x1="1" y1="1" x2="23" y2="23"></line>
|
|
33
|
-
</svg>`,
|
|
34
|
-
cadeadoTrancado: `<svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
|
|
35
|
-
<rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect>
|
|
36
|
-
<path d="M7 11V7a5 5 0 0 1 10 0v4"></path>
|
|
37
|
-
</svg>`,
|
|
38
|
-
cadeadoAberto: `<svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
39
|
-
<rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect>
|
|
40
|
-
<path d="M7 11V7a5 5 0 0 1 9.9-1"></path>
|
|
41
|
-
</svg>`,
|
|
42
|
-
chevronDir: `<svg viewBox="0 0 24 24" width="10" height="10" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
|
43
|
-
<polyline points="9 18 15 12 9 6"></polyline>
|
|
44
|
-
</svg>`,
|
|
45
|
-
dragHandle: `<svg viewBox="5 3 14 18" width="7" height="9" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
|
|
46
|
-
<line x1="8" y1="6" x2="8" y2="6.01"></line>
|
|
47
|
-
<line x1="16" y1="6" x2="16" y2="6.01"></line>
|
|
48
|
-
<line x1="8" y1="12" x2="8" y2="12.01"></line>
|
|
49
|
-
<line x1="16" y1="12" x2="16" y2="12.01"></line>
|
|
50
|
-
<line x1="8" y1="18" x2="8" y2="18.01"></line>
|
|
51
|
-
<line x1="16" y1="18" x2="16" y2="18.01"></line>
|
|
52
|
-
</svg>`,
|
|
53
|
-
alvoEnquadrar: `<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
54
|
-
<circle cx="12" cy="12" r="10"></circle>
|
|
55
|
-
<line x1="12" y1="2" x2="12" y2="6"></line>
|
|
56
|
-
<line x1="12" y1="18" x2="12" y2="22"></line>
|
|
57
|
-
<line x1="2" y1="12" x2="6" y2="12"></line>
|
|
58
|
-
<line x1="18" y1="12" x2="22" y2="12"></line>
|
|
59
|
-
</svg>`,
|
|
60
|
-
engrenagem: `<svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
61
|
-
<circle cx="12" cy="12" r="3"></circle>
|
|
62
|
-
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
|
|
63
|
-
</svg>`,
|
|
64
|
-
mais: `<svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
|
|
65
|
-
<line x1="12" y1="5" x2="12" y2="19"></line>
|
|
66
|
-
<line x1="5" y1="12" x2="19" y2="12"></line>
|
|
67
|
-
</svg>`,
|
|
68
|
-
lixeira: `<svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
69
|
-
<polyline points="3 6 5 6 21 6"></polyline>
|
|
70
|
-
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
|
|
71
|
-
</svg>`,
|
|
72
|
-
fechar: `<svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
|
73
|
-
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
74
|
-
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
75
|
-
</svg>`,
|
|
76
|
-
busca: `<svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
77
|
-
<circle cx="11" cy="11" r="8"></circle>
|
|
78
|
-
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
|
|
79
|
-
</svg>`,
|
|
80
|
-
recolherPainel: `<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
|
|
81
|
-
<polyline points="13 17 18 12 13 7"></polyline>
|
|
82
|
-
<polyline points="6 17 11 12 6 7"></polyline>
|
|
83
|
-
</svg>`,
|
|
84
|
-
expandirPainel: `<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
|
|
85
|
-
<polyline points="11 17 6 12 11 7"></polyline>
|
|
86
|
-
<polyline points="18 17 13 12 18 7"></polyline>
|
|
87
|
-
</svg>`,
|
|
88
|
-
reguaMetrica: `<svg viewBox="0 0 24 24" width="10" height="10" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
89
|
-
<path d="M21.3 15.3l-9.6-9.6a1 1 0 0 0-1.4 0l-7 7a1 1 0 0 0 0 1.4l9.6 9.6a1 1 0 0 0 1.4 0l7-7a1 1 0 0 0 0-1.4z"></path>
|
|
90
|
-
<line x1="14.5" y1="8.5" x2="12" y2="11"></line>
|
|
91
|
-
<line x1="10.5" y1="12.5" x2="8" y2="15"></line>
|
|
92
|
-
</svg>`,
|
|
93
|
-
moverPasta: `<svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
94
|
-
<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path>
|
|
95
|
-
</svg>`,
|
|
96
|
-
mapa: `<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
97
|
-
<polygon points="1 6 1 22 8 18 16 22 23 18 23 2 16 6 8 2 1 6"></polygon>
|
|
98
|
-
<line x1="8" y1="2" x2="8" y2="18"></line>
|
|
99
|
-
<line x1="16" y1="6" x2="16" y2="22"></line>
|
|
100
|
-
</svg>`,
|
|
101
|
-
gradeCad: `<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
102
|
-
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
|
103
|
-
<line x1="3" y1="9" x2="21" y2="9"></line>
|
|
104
|
-
<line x1="3" y1="15" x2="21" y2="15"></line>
|
|
105
|
-
<line x1="9" y1="3" x2="9" y2="21"></line>
|
|
106
|
-
<line x1="15" y1="3" x2="15" y2="21"></line>
|
|
107
|
-
</svg>`
|
|
108
|
-
};
|
|
109
|
-
function M(e) {
|
|
110
|
-
return e == null ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
111
|
-
}
|
|
112
|
-
const Ra = /^(#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})|(?:rgb|hsl)a?\(\s*[\w.%\s,/+-]+\)|[a-z]{3,30})$/i;
|
|
113
|
-
function W(e, t = "#00E08A") {
|
|
114
|
-
if (!e || typeof e != "string") return t;
|
|
115
|
-
const a = e.trim();
|
|
116
|
-
return Ra.test(a) ? a : t;
|
|
117
|
-
}
|
|
118
|
-
function we(e) {
|
|
119
|
-
return Math.max(0, Math.min(255, Math.round(e))).toString(16).padStart(2, "0");
|
|
120
|
-
}
|
|
121
|
-
function ja(e, t, a) {
|
|
122
|
-
const r = t / 100, i = a / 100, o = (c) => (c + e / 30) % 12, n = r * Math.min(i, 1 - i), s = (c) => i - n * Math.max(-1, Math.min(o(c) - 3, Math.min(9 - o(c), 1)));
|
|
123
|
-
return [s(0) * 255, s(8) * 255, s(4) * 255];
|
|
124
|
-
}
|
|
125
|
-
function Na(e, t = "#000000") {
|
|
126
|
-
if (!e || typeof e != "string") return t;
|
|
127
|
-
const a = e.trim().toLowerCase(), r = /^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.exec(a);
|
|
128
|
-
if (r) {
|
|
129
|
-
const o = r[1];
|
|
130
|
-
return o.length <= 4 ? `#${o[0]}${o[0]}${o[1]}${o[1]}${o[2]}${o[2]}` : `#${o.slice(0, 6)}`;
|
|
131
|
-
}
|
|
132
|
-
const i = /^(rgb|hsl)a?\(([^)]+)\)$/.exec(a);
|
|
133
|
-
if (i) {
|
|
134
|
-
const o = i[2].split(/[\s,/]+/).filter(Boolean).map((n) => parseFloat(n));
|
|
135
|
-
if (o.length >= 3 && o.slice(0, 3).every((n) => !isNaN(n))) {
|
|
136
|
-
const [n, s, c] = o, [d, l, p] = i[1] === "rgb" ? [n, s, c] : ja(n, s, c);
|
|
137
|
-
return `#${we(d)}${we(l)}${we(p)}`;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return t;
|
|
141
|
-
}
|
|
142
|
-
function O(e, t, a) {
|
|
143
|
-
const r = e.querySelectorAll(`[${t}]`);
|
|
144
|
-
for (let i = 0; i < r.length; i++)
|
|
145
|
-
if (r[i].getAttribute(t) === a) return r[i];
|
|
146
|
-
return null;
|
|
147
|
-
}
|
|
148
|
-
function Qe(e, t = 80) {
|
|
149
|
-
let a = null;
|
|
150
|
-
return (...r) => {
|
|
151
|
-
a && clearTimeout(a), a = setTimeout(() => {
|
|
152
|
-
e(...r), a = null;
|
|
153
|
-
}, t);
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
function R(e, t) {
|
|
157
|
-
e.setAttribute("title", t), e.setAttribute("aria-label", t);
|
|
158
|
-
}
|
|
159
|
-
const Xe = [
|
|
160
|
-
{
|
|
161
|
-
id: "none",
|
|
162
|
-
nome: "Sem Mapa",
|
|
163
|
-
descricao: "Tela CAD neutra com grade quadriculada"
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
id: "google_satelite_puro",
|
|
167
|
-
nome: "Google Puro",
|
|
168
|
-
descricao: "Satélite limpo sem ruas ou rótulos",
|
|
169
|
-
thumbnailUrl: "https://images.unsplash.com/photo-1524661135-423995f22d0b?w=160&auto=format&fit=crop&q=80"
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
id: "google_satelite",
|
|
173
|
-
nome: "Google Híbrido",
|
|
174
|
-
descricao: "Satélite com nomes de ruas e divisas",
|
|
175
|
-
thumbnailUrl: "https://images.unsplash.com/photo-1524661135-423995f22d0b?w=160&auto=format&fit=crop&q=80"
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
id: "satelite",
|
|
179
|
-
nome: "Esri Satélite",
|
|
180
|
-
descricao: "Imagens orbitais de alta resolução",
|
|
181
|
-
thumbnailUrl: "https://images.unsplash.com/photo-1451187580459-43490279c0fa?w=160&auto=format&fit=crop&q=80"
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
id: "osm",
|
|
185
|
-
nome: "OpenStreetMap",
|
|
186
|
-
descricao: "Mapa viário e urbano colaborativo",
|
|
187
|
-
thumbnailUrl: "https://images.unsplash.com/photo-1569336415962-a4bd9f69cd83?w=160&auto=format&fit=crop&q=80"
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
id: "topografia",
|
|
191
|
-
nome: "Topografia",
|
|
192
|
-
descricao: "Curvas de nível e relevo sombreado",
|
|
193
|
-
thumbnailUrl: "https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?w=160&auto=format&fit=crop&q=80"
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
id: "dark",
|
|
197
|
-
nome: "Dark Canvas",
|
|
198
|
-
descricao: "Mapa escuro de alto contraste para CAD",
|
|
199
|
-
thumbnailUrl: "https://images.unsplash.com/photo-1518709268805-4e9042af9f23?w=160&auto=format&fit=crop&q=80"
|
|
200
|
-
}
|
|
201
|
-
];
|
|
202
|
-
function We(e, t) {
|
|
203
|
-
const a = Array.isArray(e) ? e.find((r) => r.id === t) : void 0;
|
|
204
|
-
return a && typeof a.nome == "string" ? a.nome : "";
|
|
205
|
-
}
|
|
206
|
-
function Ha(e = Xe, t = "satelite", a = !1) {
|
|
207
|
-
if (!e || e.length === 0) return "";
|
|
208
|
-
const r = e.map((i) => {
|
|
209
|
-
const o = t === i.id, n = M(i.id), s = M(i.nome), c = M(i.descricao || i.nome);
|
|
210
|
-
let d = "";
|
|
211
|
-
return i.thumbnailUrl ? d = `<img class="ui-basemap-preview" src="${M(i.thumbnailUrl)}" alt="" loading="lazy" referrerpolicy="no-referrer" data-basemap-thumb />` : d = `<div class="ui-basemap-preview-none">${b.gradeCad}</div>`, `
|
|
212
|
-
<div class="ui-basemap-card ${o ? "active" : ""}" data-basemap-id="${n}" role="button" tabindex="0" aria-pressed="${o}" title="${c}">
|
|
213
|
-
${d}
|
|
214
|
-
<span>${s}</span>
|
|
215
|
-
</div>
|
|
216
|
-
`;
|
|
217
|
-
}).join("");
|
|
218
|
-
return `
|
|
219
|
-
<div class="ui-basemap-section ${a ? "recolhido" : ""}" part="mapas-base">
|
|
220
|
-
<button type="button" class="ui-basemap-toggle" data-basemap-toggle="alternar" aria-expanded="${!a}" aria-controls="ui-basemap-grid" title="${a ? "Mostrar mapas base" : "Recolher mapas base"}">
|
|
221
|
-
<span class="ui-basemap-title">Mapa Base</span>
|
|
222
|
-
<span class="ui-basemap-atual" data-basemap-atual>${M(We(e, t))}</span>
|
|
223
|
-
<span class="ui-chevron-icon ${a ? "" : "open"}">${b.chevronDir}</span>
|
|
224
|
-
</button>
|
|
225
|
-
${a ? "" : `<div class="ui-basemap-grid" id="ui-basemap-grid">
|
|
226
|
-
${r}
|
|
227
|
-
</div>`}
|
|
228
|
-
</div>
|
|
229
|
-
`;
|
|
230
|
-
}
|
|
231
|
-
function me(e) {
|
|
232
|
-
if (!Array.isArray(e) || e.length === 0) return [];
|
|
233
|
-
const t = e.filter((d) => !!(d && typeof d == "object" && d.id)), a = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
234
|
-
t.forEach((d, l) => {
|
|
235
|
-
a.set(d.id, d), r.set(d.id, l);
|
|
236
|
-
});
|
|
237
|
-
const i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
|
|
238
|
-
for (const d of t) {
|
|
239
|
-
if (o.has(d.id)) continue;
|
|
240
|
-
const l = [], p = /* @__PURE__ */ new Map();
|
|
241
|
-
let u = d;
|
|
242
|
-
for (; u && u.parentId && a.has(u.parentId) && u.parentId !== u.id; ) {
|
|
243
|
-
if (p.has(u.id)) {
|
|
244
|
-
const f = p.get(u.id), m = l.slice(f);
|
|
245
|
-
let v = m[0];
|
|
246
|
-
for (const h of m)
|
|
247
|
-
(r.get(h) ?? 1 / 0) < (r.get(v) ?? 1 / 0) && (v = h);
|
|
248
|
-
i.add(v);
|
|
249
|
-
break;
|
|
250
|
-
}
|
|
251
|
-
if (o.has(u.id)) break;
|
|
252
|
-
p.set(u.id, l.length), l.push(u.id), u = a.get(u.parentId);
|
|
253
|
-
}
|
|
254
|
-
for (const f of l) o.add(f);
|
|
255
|
-
}
|
|
256
|
-
const n = /* @__PURE__ */ new Map(), s = [];
|
|
257
|
-
t.forEach((d) => {
|
|
258
|
-
!i.has(d.id) && !!(d.parentId && a.has(d.parentId) && d.parentId !== d.id) && d.parentId ? (n.has(d.parentId) || n.set(d.parentId, []), n.get(d.parentId).push(d)) : s.push(d);
|
|
259
|
-
});
|
|
260
|
-
function c(d, l, p) {
|
|
261
|
-
const u = new Set(p);
|
|
262
|
-
u.add(d.id);
|
|
263
|
-
const m = (n.get(d.id) || (Array.isArray(d.children) ? d.children : [])).filter(
|
|
264
|
-
(v) => !!(v && typeof v == "object" && v.id && !u.has(v.id))
|
|
265
|
-
);
|
|
266
|
-
return {
|
|
267
|
-
camada: d,
|
|
268
|
-
depth: l,
|
|
269
|
-
subcamadas: m.map((v) => c(v, l + 1, u))
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
return s.map((d) => c(d, 0, /* @__PURE__ */ new Set()));
|
|
273
|
-
}
|
|
274
|
-
function Ga(e, t) {
|
|
275
|
-
const a = /* @__PURE__ */ new Set();
|
|
276
|
-
if (!t || !Array.isArray(e)) return a;
|
|
277
|
-
const r = /* @__PURE__ */ new Map();
|
|
278
|
-
for (const o of e)
|
|
279
|
-
!o || typeof o != "object" || !o.id || o.parentId && o.parentId !== o.id && (r.has(o.parentId) || r.set(o.parentId, []), r.get(o.parentId).push(o.id));
|
|
280
|
-
const i = [t];
|
|
281
|
-
for (; i.length > 0; ) {
|
|
282
|
-
const o = i.pop();
|
|
283
|
-
if (a.has(o)) continue;
|
|
284
|
-
a.add(o);
|
|
285
|
-
const n = r.get(o);
|
|
286
|
-
if (n)
|
|
287
|
-
for (const s of n)
|
|
288
|
-
a.has(s) || i.push(s);
|
|
289
|
-
}
|
|
290
|
-
return a;
|
|
291
|
-
}
|
|
292
|
-
function re(e, t, a) {
|
|
293
|
-
if (!a || !Array.isArray(t) || t.length === 0) return [];
|
|
294
|
-
const r = Ga(e, a);
|
|
295
|
-
return t.filter((i) => !!(i && i.layerId && r.has(i.layerId)));
|
|
296
|
-
}
|
|
297
|
-
function ge(e) {
|
|
298
|
-
const t = /* @__PURE__ */ new Map();
|
|
299
|
-
e.forEach((r) => r && r.id && t.set(r.id, r));
|
|
300
|
-
const a = /* @__PURE__ */ new Map();
|
|
301
|
-
for (const r of t.values()) {
|
|
302
|
-
let i = !1, o = !1;
|
|
303
|
-
const n = /* @__PURE__ */ new Set([r.id]);
|
|
304
|
-
let s = r.parentId ? t.get(r.parentId) : void 0;
|
|
305
|
-
for (; s && !n.has(s.id); )
|
|
306
|
-
n.add(s.id), s.visible === !1 && (i = !0), s.locked === !0 && (o = !0), s = s.parentId ? t.get(s.parentId) : void 0;
|
|
307
|
-
a.set(r.id, { ocultaPorAncestral: i, travadaPorAncestral: o });
|
|
308
|
-
}
|
|
309
|
-
return a;
|
|
310
|
-
}
|
|
311
|
-
function ue(e) {
|
|
312
|
-
const t = ge(e);
|
|
313
|
-
return new Set(
|
|
314
|
-
e.filter((a) => {
|
|
315
|
-
var r;
|
|
316
|
-
return a && (a.locked === !0 || ((r = t.get(a.id)) == null ? void 0 : r.travadaPorAncestral) === !0);
|
|
317
|
-
}).map((a) => a.id)
|
|
318
|
-
);
|
|
319
|
-
}
|
|
320
|
-
function Je(e) {
|
|
321
|
-
const t = me(e), a = ue(e), r = (i) => {
|
|
322
|
-
const o = i.camada, n = i.depth, s = i.subcamadas, c = n > 0 ? " ".repeat(n) + "↳ " : s.length > 0 || o.isGroup ? "📁 " : "", d = a.has(o.id), l = `<option value="${M(o.id)}"${d ? " disabled" : ""}>${c}${M(o.name)}${d ? " 🔒" : ""}</option>`, p = s.map((u) => r(u)).join("");
|
|
323
|
-
return l + p;
|
|
324
|
-
};
|
|
325
|
-
return t.map((i) => r(i)).join("");
|
|
326
|
-
}
|
|
327
|
-
function Ze(e, t) {
|
|
328
|
-
return t > 0 ? {
|
|
329
|
-
icone: b.alvoEnquadrar,
|
|
330
|
-
texto: `${t} ${t > 1 ? "selecionados" : "selecionado"}`
|
|
331
|
-
} : {
|
|
332
|
-
icone: b.camadas,
|
|
333
|
-
texto: `${e} ${e > 1 ? "camadas" : "camada"}`
|
|
334
|
-
};
|
|
335
|
-
}
|
|
336
|
-
function Va(e, t, a) {
|
|
337
|
-
const r = t.filter((c) => a.has(c.id)), i = r.length > 0, o = i ? r.length : e.length, n = Ze(e.length, r.length), s = Je(e);
|
|
338
|
-
return `
|
|
339
|
-
<div class="ui-tree-footer ${i ? "tem-selecao" : "sem-selecao"}" part="rodape">
|
|
340
|
-
<div class="ui-footer-left">
|
|
341
|
-
<span class="ui-footer-count" id="footer-count">${o}</span>
|
|
342
|
-
<span class="ui-footer-label" id="footer-label" role="img" title="${n.texto}" aria-label="${n.texto}">${n.icone}</span>
|
|
343
|
-
</div>
|
|
344
|
-
|
|
345
|
-
<!-- Criação de camadas/grupos quando não há nada selecionado -->
|
|
346
|
-
<div class="ui-footer-actions-gerais" style="display: ${i ? "none" : "flex"};">
|
|
347
|
-
<button class="ui-footer-chip-btn" id="btn-footer-new-group" title="Criar Nova Pasta/Grupo de Camadas" aria-label="Criar Grupo de Camadas">
|
|
348
|
-
${b.moverPasta}
|
|
349
|
-
<span>Grupo</span>
|
|
350
|
-
</button>
|
|
351
|
-
<button class="ui-footer-chip-btn primario" id="btn-footer-new-layer" title="Criar Nova Camada Vetorial" aria-label="Criar Nova Camada">
|
|
352
|
-
${b.mais}
|
|
353
|
-
<span>Camada</span>
|
|
354
|
-
</button>
|
|
355
|
-
</div>
|
|
356
|
-
|
|
357
|
-
<!-- Ações em massa ativadas quando há seleção -->
|
|
358
|
-
<div class="ui-footer-right ui-footer-bulk-actions" style="display: ${i ? "flex" : "none"};">
|
|
359
|
-
<div class="ui-footer-move-wrapper ${i ? "" : "disabled"}" title="Mover selecionados para outra camada">
|
|
360
|
-
<select id="select-footer-move" aria-label="Mover selecionados para outra camada" class="ui-footer-select" ${i ? "" : "disabled"}>
|
|
361
|
-
<option value="" disabled selected>Mover para...</option>
|
|
362
|
-
${s}
|
|
363
|
-
</select>
|
|
364
|
-
</div>
|
|
365
|
-
|
|
366
|
-
<button class="ui-footer-btn btn-danger-footer ${i ? "" : "disabled"}" id="btn-footer-del" title="Excluir selecionados" aria-label="Excluir selecionados" ${i ? "" : "disabled"}>
|
|
367
|
-
${b.lixeira}
|
|
368
|
-
</button>
|
|
369
|
-
</div>
|
|
370
|
-
</div>
|
|
371
|
-
`;
|
|
372
|
-
}
|
|
373
|
-
const Ae = 64;
|
|
374
|
-
function Re(e) {
|
|
375
|
-
return Array.isArray(e) && e.length >= 2 && Number.isFinite(e[0]) && Number.isFinite(e[1]);
|
|
376
|
-
}
|
|
377
|
-
function ea(e) {
|
|
378
|
-
return !Array.isArray(e) || e.length === 0 ? [] : Re(e[0]) ? [e.filter(Re)] : e.flatMap(ea);
|
|
379
|
-
}
|
|
380
|
-
function je(e) {
|
|
381
|
-
if (e.length <= Ae) return e;
|
|
382
|
-
const t = e.length / Ae, a = [];
|
|
383
|
-
for (let r = 0; r < Ae; r++) a.push(e[Math.floor(r * t)]);
|
|
384
|
-
return a.push(e[e.length - 1]), a;
|
|
385
|
-
}
|
|
386
|
-
function _a(e, t, a) {
|
|
387
|
-
const r = ea(t).filter((S) => S.length > 0);
|
|
388
|
-
if (r.length === 0) return "";
|
|
389
|
-
let i = 1 / 0, o = -1 / 0, n = 1 / 0, s = -1 / 0;
|
|
390
|
-
for (const S of r)
|
|
391
|
-
for (const [F, q] of S)
|
|
392
|
-
q < i && (i = q), q > o && (o = q), -F < n && (n = -F), -F > s && (s = -F);
|
|
393
|
-
const c = 16, d = 2, l = c - d * 2, p = o - i, u = s - n, f = Math.max(p, u), m = f > 0 ? l / f : 0, v = d + (l - p * m) / 2, h = d + (l - u * m) / 2, g = (S) => Math.round(S * 100) / 100, y = ([S, F]) => `${g(v + (F - i) * m)},${g(h + (-S - n) * m)}`, k = e === "polygon" || e === "multipolygon", L = e === "linestring" || e === "multilinestring", x = (S) => `<svg viewBox="0 0 ${c} ${c}" width="100%" height="100%" aria-hidden="true">${S}</svg>`;
|
|
394
|
-
if (k) {
|
|
395
|
-
const S = r.filter((F) => F.length >= 3).map((F) => `M${je(F).map(y).join("L")}Z`).join("");
|
|
396
|
-
return S ? x(
|
|
397
|
-
`<path d="${S}" fill="${a}" fill-opacity="0.45" fill-rule="evenodd" stroke="${a}" stroke-width="1.2" stroke-linejoin="round"/>`
|
|
398
|
-
) : "";
|
|
399
|
-
}
|
|
400
|
-
if (L) {
|
|
401
|
-
const S = r.filter((F) => F.length >= 2).map((F) => `M${je(F).map(y).join("L")}`).join("");
|
|
402
|
-
return S ? x(
|
|
403
|
-
`<path d="${S}" fill="none" stroke="${a}" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>`
|
|
404
|
-
) : "";
|
|
405
|
-
}
|
|
406
|
-
return "";
|
|
407
|
-
}
|
|
408
|
-
function aa(e, t, a) {
|
|
409
|
-
const r = W(t, "#00E08A"), i = (e || "").toLowerCase(), o = a !== void 0 ? _a(i, a, r) : "";
|
|
410
|
-
return o || (i === "polygon" || i === "multipolygon" ? `<svg viewBox="0 0 16 16" width="11" height="11"><polygon points="2,14 14,14 12,2 4,4" fill="${r}" fill-opacity="0.45" stroke="${r}" stroke-width="1.5"/></svg>` : i === "linestring" || i === "multilinestring" ? `<svg viewBox="0 0 16 16" width="11" height="11"><polyline points="2,13 8,3 14,10" fill="none" stroke="${r}" stroke-width="2"/></svg>` : i === "text" ? `<svg viewBox="0 0 16 16" width="11" height="11"><text x="8" y="12" font-size="12" font-weight="bold" fill="${r}" text-anchor="middle" font-family="sans-serif">T</text></svg>` : `<svg viewBox="0 0 16 16" width="11" height="11"><circle cx="8" cy="8" r="4.2" fill="${r}" stroke="#ffffff" stroke-width="1.2"/></svg>`);
|
|
411
|
-
}
|
|
412
|
-
function Le(e, t, a) {
|
|
413
|
-
return {
|
|
414
|
-
camadaIdSeguro: M(e.id),
|
|
415
|
-
corCamada: W(e.color, "#00E08A"),
|
|
416
|
-
profundidade: t,
|
|
417
|
-
esmaecida: e.visible === !1 || (a == null ? void 0 : a.ocultaPorAncestral) === !0,
|
|
418
|
-
travadaPelaCamada: e.locked === !0 || (a == null ? void 0 : a.travadaPorAncestral) === !0
|
|
419
|
-
};
|
|
420
|
-
}
|
|
421
|
-
const Ee = (e, t, a) => `${e} ${e === 1 ? t : a}`;
|
|
422
|
-
function ta(e, t, a) {
|
|
423
|
-
return a === 0 ? Ee(e, "feição", "feições") : `${Ee(e, "feição", "feições")} no grupo (${t} nesta camada) · ${Ee(a, "subcamada", "subcamadas")}`;
|
|
424
|
-
}
|
|
425
|
-
function ra(e, t, a, r) {
|
|
426
|
-
return e === 0 && r ? "" : `<span class="ui-count-chip" title="${ta(e, t, a)}">${e}</span>`;
|
|
427
|
-
}
|
|
428
|
-
function ia(e, t) {
|
|
429
|
-
const a = t - e;
|
|
430
|
-
return {
|
|
431
|
-
resumo: `Exibindo ${e} de ${t} feições. Use a busca acima para filtrar.`,
|
|
432
|
-
botao: `Mostrar mais (+${Math.min(80, a)})`
|
|
433
|
-
};
|
|
434
|
-
}
|
|
435
|
-
function oa(e, t, a) {
|
|
436
|
-
const r = ia(t, a);
|
|
437
|
-
return `<div class="ui-truncate-notice" role="note">
|
|
438
|
-
<span>${r.resumo}</span>
|
|
439
|
-
<button type="button" class="ui-truncate-more-btn" data-layer-show-more="${e}">${r.botao}</button>
|
|
440
|
-
</div>`;
|
|
441
|
-
}
|
|
442
|
-
function na(e) {
|
|
443
|
-
return `<div class="ui-empty-row"><span>${e ? "Grupo vazio (adicione subcamadas ou feições)" : "Camada vazia"}</span></div>`;
|
|
444
|
-
}
|
|
445
|
-
const Ya = ["name", "color", "visible", "locked", "status", "type", "geometryType", "coordinates", "layerId"];
|
|
446
|
-
function Ua(e, t) {
|
|
447
|
-
return Ya.every((a) => e[a] === t[a]);
|
|
448
|
-
}
|
|
449
|
-
function Ce(e, t, a, r) {
|
|
450
|
-
const { camadaIdSeguro: i, corCamada: o, profundidade: n } = t, s = M(e.id), c = M(e.name || "Feição"), d = W(e.color, o), l = e.visible !== !1, p = t.travadaPelaCamada, u = e.locked === !0 || p, f = p ? "Bloqueada pela camada" : u ? "Desbloquear Feição" : "Bloquear Feição", m = e.status === "previa" ? '<span class="ui-previa-dot" title="Geometria prévia" aria-label="Geometria prévia"></span>' : "";
|
|
451
|
-
return `
|
|
452
|
-
<div class="ui-feat-row ${a ? "selected-row" : ""} ${l ? "" : "hidden-row"} ${t.esmaecida ? "herdado-oculto" : ""}" data-feat-row="${s}" data-feat-select="${s}" data-feat-layer="${i}" role="treeitem" aria-level="${n + 2}" aria-selected="${a}" tabindex="-1" draggable="true" part="${a ? "feicao feicao-selecionada" : "feicao"}" style="--layer-depth: ${n + 1};" title="Clique para selecionar | Arraste para reordenar">
|
|
453
|
-
<div class="ui-col ui-col-eye" data-feat-eye="${s}" role="button" tabindex="0" aria-label="${l ? "Ocultar Feição" : "Exibir Feição"}" title="${l ? "Ocultar Feição" : "Exibir Feição"}">
|
|
454
|
-
${l ? b.olhoAberto : b.olhoFechado}
|
|
455
|
-
</div>
|
|
456
|
-
|
|
457
|
-
<div class="ui-col ui-col-lock ${u ? "" : "ui-lock-open"}" data-feat-lock="${s}" ${p ? 'data-locked-by-layer="true"' : ""} role="button" tabindex="0" aria-label="${f}" title="${f}">
|
|
458
|
-
${u ? b.cadeadoTrancado : b.cadeadoAberto}
|
|
459
|
-
</div>
|
|
460
|
-
|
|
461
|
-
<div class="ui-col ui-col-colorbar" style="background: ${o};"></div>
|
|
462
|
-
<div class="ui-col ui-col-thumb">
|
|
463
|
-
<div class="ui-thumb-box">${aa(e.type || e.geometryType, d, e.coordinates)}</div>
|
|
464
|
-
</div>
|
|
465
|
-
|
|
466
|
-
<div class="ui-col ui-col-name" data-feat-name-trigger="${s}" title="Duplo clique para renomear">
|
|
467
|
-
${r ? `<input type="text" class="ui-inline-rename-input" data-inline-feat-input="${s}" value="${c}" />` : `<span class="ui-name-text">${c}</span>${m}`}
|
|
468
|
-
</div>
|
|
469
|
-
|
|
470
|
-
<div class="ui-col ui-col-actions">
|
|
471
|
-
<button class="ui-micro-btn" data-feat-fit="${s}" title="Enquadrar no mapa" aria-label="Enquadrar feição no mapa">${b.alvoEnquadrar}</button>
|
|
472
|
-
</div>
|
|
473
|
-
|
|
474
|
-
<div class="ui-col ui-col-target" data-feat-target="${s}" role="button" tabindex="0" aria-label="Selecionar feição" title="Selecionar feição">
|
|
475
|
-
<div class="ui-target-circle ${a ? "selected" : ""}"></div>
|
|
476
|
-
</div>
|
|
477
|
-
</div>
|
|
478
|
-
`;
|
|
479
|
-
}
|
|
480
|
-
const ze = 80;
|
|
481
|
-
function Z(e, t) {
|
|
482
|
-
const a = (t || "").trim().toLowerCase();
|
|
483
|
-
return a ? e.filter(
|
|
484
|
-
(r) => (r.name || "").toLowerCase().includes(a) || (r.category || "").toLowerCase().includes(a) || (r.type || "").toLowerCase().includes(a)
|
|
485
|
-
) : e;
|
|
486
|
-
}
|
|
487
|
-
function sa(e, t, a) {
|
|
488
|
-
var u, f;
|
|
489
|
-
const r = (a || "").trim().toLowerCase();
|
|
490
|
-
if (!r) return null;
|
|
491
|
-
const i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
492
|
-
for (const m of e)
|
|
493
|
-
i.set(m.id, m), m.parentId && m.parentId !== m.id && (o.has(m.parentId) || o.set(m.parentId, []), o.get(m.parentId).push(m.id));
|
|
494
|
-
const n = /* @__PURE__ */ new Map();
|
|
495
|
-
for (const m of t) {
|
|
496
|
-
const v = m.layerId || "";
|
|
497
|
-
n.has(v) || n.set(v, []), n.get(v).push(m);
|
|
498
|
-
}
|
|
499
|
-
const s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set();
|
|
500
|
-
for (const m of e)
|
|
501
|
-
(typeof m.name == "string" ? m.name.toLowerCase() : "").includes(r) ? (s.add(m.id), c.add(m.id)) : Z(n.get(m.id) || [], r).length > 0 && c.add(m.id);
|
|
502
|
-
const d = new Set(c);
|
|
503
|
-
for (const m of c) {
|
|
504
|
-
const v = /* @__PURE__ */ new Set([m]);
|
|
505
|
-
let h = (u = i.get(m)) == null ? void 0 : u.parentId;
|
|
506
|
-
for (; h && i.has(h) && !v.has(h); )
|
|
507
|
-
v.add(h), d.add(h), h = (f = i.get(h)) == null ? void 0 : f.parentId;
|
|
508
|
-
}
|
|
509
|
-
const l = [...s];
|
|
510
|
-
for (; l.length > 0; ) {
|
|
511
|
-
const m = l.pop();
|
|
512
|
-
for (const v of o.get(m) || [])
|
|
513
|
-
d.has(v) || (d.add(v), l.push(v));
|
|
514
|
-
}
|
|
515
|
-
const p = /* @__PURE__ */ new Map();
|
|
516
|
-
for (const m of d) {
|
|
517
|
-
const v = n.get(m) || [];
|
|
518
|
-
p.set(m, s.has(m) ? v : Z(v, r));
|
|
519
|
-
}
|
|
520
|
-
return { camadasVisiveis: d, feicoesPorCamada: p };
|
|
521
|
-
}
|
|
522
|
-
function da(e, t, a, r = "", i = ze, o) {
|
|
523
|
-
const n = sa(e, t, r), s = [], c = /* @__PURE__ */ new Map();
|
|
524
|
-
for (let p = 0; p < t.length; p++) {
|
|
525
|
-
const u = t[p];
|
|
526
|
-
if (!u || !u.id) continue;
|
|
527
|
-
const f = u.layerId || "";
|
|
528
|
-
c.has(f) || c.set(f, []), c.get(f).push(u);
|
|
529
|
-
}
|
|
530
|
-
const d = me(e);
|
|
531
|
-
function l(p) {
|
|
532
|
-
const u = p.camada;
|
|
533
|
-
if (n && !n.camadasVisiveis.has(u.id) || !(n ? !0 : a.has(u.id))) return;
|
|
534
|
-
for (const g of p.subcamadas)
|
|
535
|
-
l(g);
|
|
536
|
-
const m = n ? n.feicoesPorCamada.get(u.id) || [] : c.get(u.id) || [], v = (o == null ? void 0 : o.get(u.id)) ?? i, h = m.slice(0, v);
|
|
537
|
-
for (let g = 0; g < h.length; g++)
|
|
538
|
-
s.push(h[g].id);
|
|
539
|
-
}
|
|
540
|
-
for (const p of d)
|
|
541
|
-
l(p);
|
|
542
|
-
return s;
|
|
543
|
-
}
|
|
544
|
-
function Ka(e, t, a, r, i, o) {
|
|
545
|
-
if (!e.includes(r)) return null;
|
|
546
|
-
const n = new Set(t);
|
|
547
|
-
let s = a;
|
|
548
|
-
if (o && a && e.includes(a)) {
|
|
549
|
-
const c = e.indexOf(a), d = e.indexOf(r), l = Math.min(c, d), p = Math.max(c, d);
|
|
550
|
-
i || n.clear();
|
|
551
|
-
for (let u = l; u <= p; u++)
|
|
552
|
-
n.add(e[u]);
|
|
553
|
-
} else i ? (n.has(r) ? n.delete(r) : n.add(r), s = r) : (n.clear(), n.add(r), s = r);
|
|
554
|
-
return { selecionados: n, ultimoClicadoId: s };
|
|
555
|
-
}
|
|
556
|
-
function Me(e, t) {
|
|
557
|
-
if (e.size === 0) return;
|
|
558
|
-
const a = new Set(t.map((r) => r.id));
|
|
559
|
-
for (const r of e)
|
|
560
|
-
a.has(r) || e.delete(r);
|
|
561
|
-
}
|
|
562
|
-
function G(e, t, a) {
|
|
563
|
-
const r = /* @__PURE__ */ new Set();
|
|
564
|
-
let i = e.find((o) => o.id === t);
|
|
565
|
-
for (; i && i.parentId; ) {
|
|
566
|
-
if (r.has(i.id) || (r.add(i.id), i.parentId === a)) return !0;
|
|
567
|
-
i = e.find((o) => o.id === (i == null ? void 0 : i.parentId));
|
|
568
|
-
}
|
|
569
|
-
return !1;
|
|
570
|
-
}
|
|
571
|
-
function Ie(e) {
|
|
572
|
-
return Number.isFinite(e) ? e < 0.25 ? "acima" : e > 0.75 ? "abaixo" : "dentro" : "dentro";
|
|
573
|
-
}
|
|
574
|
-
function Ne(e, t, a, r) {
|
|
575
|
-
if (!t || !a || t === a) return null;
|
|
576
|
-
const i = e.find((d) => d.id === t), o = e.find((d) => d.id === a);
|
|
577
|
-
if (!i || !o) return null;
|
|
578
|
-
const n = i.parentId !== void 0 ? i.parentId : null;
|
|
579
|
-
if (r === "dentro")
|
|
580
|
-
return G(e, o.id, i.id) ? null : (i.parentId = o.id, { tipo: "hierarquia", camada: i, novoParentId: o.id, parentAnteriorId: n });
|
|
581
|
-
if (G(e, o.id, i.id)) return null;
|
|
582
|
-
const s = e.findIndex((d) => d.id === t);
|
|
583
|
-
e.splice(s, 1);
|
|
584
|
-
const c = e.findIndex((d) => d.id === a);
|
|
585
|
-
return c === -1 ? e.push(i) : e.splice(r === "acima" ? c : c + 1, 0, i), i.parentId = o.parentId ?? null, { tipo: "ordem", camada: i, parentAnteriorId: n, novoParentId: i.parentId };
|
|
586
|
-
}
|
|
587
|
-
function Qa(e, t, a, r) {
|
|
588
|
-
const i = e.find((s) => s.id === a), o = t.find((s) => s.id === r);
|
|
589
|
-
if (!i || !o || i.layerId === r) return null;
|
|
590
|
-
const n = i.layerId;
|
|
591
|
-
return i.layerId = r, { feicao: i, camadaOrigemId: n, camadaDestinoId: r, mudouDeCamada: !0 };
|
|
592
|
-
}
|
|
593
|
-
function Xa(e, t, a, r) {
|
|
594
|
-
if (!t || !a || t === a) return null;
|
|
595
|
-
const i = e.findIndex((p) => p.id === t);
|
|
596
|
-
if (i === -1) return null;
|
|
597
|
-
const o = e.find((p) => p.id === a);
|
|
598
|
-
if (!o) return null;
|
|
599
|
-
const [n] = e.splice(i, 1), s = n.layerId, c = o.layerId, d = s !== c;
|
|
600
|
-
d && (n.layerId = c);
|
|
601
|
-
const l = e.findIndex((p) => p.id === a);
|
|
602
|
-
return l === -1 ? e.push(n) : e.splice(r ? l : l + 1, 0, n), { feicao: n, camadaOrigemId: s, camadaDestinoId: c, mudouDeCamada: d };
|
|
603
|
-
}
|
|
604
|
-
function N(e) {
|
|
605
|
-
return `L:${e}`;
|
|
606
|
-
}
|
|
607
|
-
function j(e) {
|
|
608
|
-
return `F:${e}`;
|
|
609
|
-
}
|
|
610
|
-
function Wa(e, t, a) {
|
|
611
|
-
if (!a || a.length === 0)
|
|
612
|
-
return [
|
|
613
|
-
...e.map((s) => ({ tipo: "layer", nodo: s })),
|
|
614
|
-
...t.map((s) => ({ tipo: "feature", feicao: s }))
|
|
615
|
-
];
|
|
616
|
-
const r = new Map(e.map((s) => [s.camada.id, s])), i = new Map(t.map((s) => [s.id, s])), o = /* @__PURE__ */ new Set(), n = [];
|
|
617
|
-
for (const s of a)
|
|
618
|
-
if (!o.has(s)) {
|
|
619
|
-
if (s.startsWith("L:")) {
|
|
620
|
-
const c = s.slice(2), d = r.get(c);
|
|
621
|
-
d && (o.add(s), n.push({ tipo: "layer", nodo: d }));
|
|
622
|
-
} else if (s.startsWith("F:")) {
|
|
623
|
-
const c = s.slice(2), d = i.get(c);
|
|
624
|
-
d && (o.add(s), n.push({ tipo: "feature", feicao: d }));
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
for (const s of e) {
|
|
628
|
-
const c = N(s.camada.id);
|
|
629
|
-
o.has(c) || (o.add(c), n.push({ tipo: "layer", nodo: s }));
|
|
630
|
-
}
|
|
631
|
-
for (const s of t) {
|
|
632
|
-
const c = j(s.id);
|
|
633
|
-
o.has(c) || (o.add(c), n.push({ tipo: "feature", feicao: s }));
|
|
634
|
-
}
|
|
635
|
-
return n;
|
|
636
|
-
}
|
|
637
|
-
function ve(e, t, a, r) {
|
|
638
|
-
const i = a.filter((l) => l.parentId === t).map((l) => l.id), o = r.filter((l) => l.layerId === t).map((l) => l.id), n = /* @__PURE__ */ new Set([
|
|
639
|
-
...i.map(N),
|
|
640
|
-
...o.map(j)
|
|
641
|
-
]), s = e.get(t), c = [], d = /* @__PURE__ */ new Set();
|
|
642
|
-
if (s)
|
|
643
|
-
for (const l of s)
|
|
644
|
-
n.has(l) && !d.has(l) && (d.add(l), c.push(l));
|
|
645
|
-
for (const l of i) {
|
|
646
|
-
const p = N(l);
|
|
647
|
-
d.has(p) || (d.add(p), c.push(p));
|
|
648
|
-
}
|
|
649
|
-
for (const l of o) {
|
|
650
|
-
const p = j(l);
|
|
651
|
-
d.has(p) || (d.add(p), c.push(p));
|
|
652
|
-
}
|
|
653
|
-
return c;
|
|
654
|
-
}
|
|
655
|
-
function he(e, t, a, r) {
|
|
656
|
-
const i = e.filter((n) => n !== t), o = i.indexOf(a);
|
|
657
|
-
o === -1 ? i.push(t) : i.splice(r ? o : o + 1, 0, t), e.length = 0, e.push(...i);
|
|
658
|
-
}
|
|
659
|
-
function U(e, t, a) {
|
|
660
|
-
if (!t) return;
|
|
661
|
-
const r = e.get(t);
|
|
662
|
-
if (!r) return;
|
|
663
|
-
const i = r.filter((o) => o !== a);
|
|
664
|
-
i.length === 0 ? e.delete(t) : e.set(t, i);
|
|
665
|
-
}
|
|
666
|
-
function Ja(e, t) {
|
|
667
|
-
const a = t.filter((n) => n.startsWith("L:")).map((n) => n.slice(2));
|
|
668
|
-
if (a.length < 2) return;
|
|
669
|
-
const r = new Set(a), i = [], o = /* @__PURE__ */ new Map();
|
|
670
|
-
for (let n = 0; n < e.length; n++)
|
|
671
|
-
r.has(e[n].id) && (i.push(n), o.set(e[n].id, e[n]));
|
|
672
|
-
if (i.length === a.length)
|
|
673
|
-
for (let n = 0; n < i.length; n++) {
|
|
674
|
-
const s = o.get(a[n]);
|
|
675
|
-
s && (e[i[n]] = s);
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
function Za(e, t) {
|
|
679
|
-
const a = t.filter((n) => n.startsWith("F:")).map((n) => n.slice(2));
|
|
680
|
-
if (a.length < 2) return;
|
|
681
|
-
const r = new Set(a), i = [], o = /* @__PURE__ */ new Map();
|
|
682
|
-
for (let n = 0; n < e.length; n++)
|
|
683
|
-
r.has(e[n].id) && (i.push(n), o.set(e[n].id, e[n]));
|
|
684
|
-
if (i.length === a.length)
|
|
685
|
-
for (let n = 0; n < i.length; n++) {
|
|
686
|
-
const s = o.get(a[n]);
|
|
687
|
-
s && (e[i[n]] = s);
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
function He(e, t, a, r, i, o) {
|
|
691
|
-
if (!r || !i) return null;
|
|
692
|
-
const n = e.find((p) => p.id === r), s = t.find((p) => p.id === i);
|
|
693
|
-
if (!n || !s || !s.layerId) return null;
|
|
694
|
-
const c = s.layerId;
|
|
695
|
-
if (c === r || G(e, c, r)) return null;
|
|
696
|
-
const d = n.parentId !== void 0 ? n.parentId : null;
|
|
697
|
-
d && d !== c && U(a, d, N(r)), n.parentId = c;
|
|
698
|
-
const l = ve(a, c, e, t);
|
|
699
|
-
return he(l, N(r), j(i), o), a.set(c, l), Ja(e, l), {
|
|
700
|
-
tipo: d !== c ? "hierarquia" : "ordem",
|
|
701
|
-
camada: n,
|
|
702
|
-
parentAnteriorId: d,
|
|
703
|
-
novoParentId: c
|
|
704
|
-
};
|
|
705
|
-
}
|
|
706
|
-
function et(e, t, a, r, i, o) {
|
|
707
|
-
if (!r || !i) return null;
|
|
708
|
-
const n = t.find((u) => u.id === r), s = e.find((u) => u.id === i);
|
|
709
|
-
if (!n || !s || !s.parentId) return null;
|
|
710
|
-
const c = s.parentId, d = n.layerId, l = d !== c;
|
|
711
|
-
l && (U(a, d, j(r)), n.layerId = c);
|
|
712
|
-
const p = ve(a, c, e, t);
|
|
713
|
-
return he(p, j(r), N(i), o), a.set(c, p), Za(t, p), { feicao: n, camadaOrigemId: d, camadaDestinoId: c, mudouDeCamada: l };
|
|
714
|
-
}
|
|
715
|
-
function Ge(e, t, a, r, i, o, n, s) {
|
|
716
|
-
const c = N(r);
|
|
717
|
-
if (n && (n !== s || o === "dentro") && U(a, n, c), o !== "dentro" && s && a.has(s)) {
|
|
718
|
-
const d = ve(a, s, e, t);
|
|
719
|
-
he(d, c, N(i), o === "acima"), a.set(s, d);
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
function at(e, t, a, r, i, o, n, s) {
|
|
723
|
-
const c = j(r);
|
|
724
|
-
if (n && n !== s && U(a, n, c), s && a.has(s)) {
|
|
725
|
-
const d = ve(a, s, e, t);
|
|
726
|
-
he(d, c, j(i), o), a.set(s, d);
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
function tt(e, t, a, r) {
|
|
730
|
-
const i = j(t);
|
|
731
|
-
if (U(e, a, i), r && e.has(r)) {
|
|
732
|
-
const o = e.get(r);
|
|
733
|
-
o.includes(i) || o.push(i);
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
function rt(e) {
|
|
737
|
-
const {
|
|
738
|
-
camadas: t,
|
|
739
|
-
feicoes: a,
|
|
740
|
-
camadaAtivaId: r,
|
|
741
|
-
expandedLayers: i,
|
|
742
|
-
selectedFeatureIds: o,
|
|
743
|
-
activeSettingsLayerId: n,
|
|
744
|
-
editingLayerId: s,
|
|
745
|
-
editingFeatureId: c,
|
|
746
|
-
searchQuery: d,
|
|
747
|
-
titulo: l = "CAMADAS",
|
|
748
|
-
mostrarBusca: p = !0,
|
|
749
|
-
limitesPorCamada: u,
|
|
750
|
-
limiteFeicoesPorCamada: f = ze,
|
|
751
|
-
mostrarBotaoColapsar: m = !1,
|
|
752
|
-
ordemFilhosPorPai: v
|
|
753
|
-
} = e, h = (d || "").trim().toLowerCase(), g = sa(t, a, h), y = /* @__PURE__ */ new Map();
|
|
754
|
-
for (let z = 0; z < a.length; z++) {
|
|
755
|
-
const I = a[z];
|
|
756
|
-
if (!I || !I.id) continue;
|
|
757
|
-
const D = I.layerId || "";
|
|
758
|
-
y.has(D) || y.set(D, []), y.get(D).push(I);
|
|
759
|
-
}
|
|
760
|
-
const k = ge(t), L = t.every((z) => z.visible !== !1), x = t.length > 0 && t.every((z) => i.has(z.id)), S = p ? `
|
|
761
|
-
<div class="ui-tree-search-wrapper" part="busca">
|
|
762
|
-
<span class="ui-tree-search-icon">${b.busca}</span>
|
|
763
|
-
<input type="text" class="ui-tree-search-input" id="input-layer-search" aria-label="Buscar camada ou feição" placeholder="Buscar camada ou feição..." value="${M(
|
|
764
|
-
d
|
|
765
|
-
)}" />
|
|
766
|
-
${d ? `<button class="ui-tree-search-clear" id="btn-clear-layer-search" title="Limpar busca" aria-label="Limpar busca">${b.fechar}</button>` : ""}
|
|
767
|
-
</div>
|
|
768
|
-
` : "", F = `
|
|
769
|
-
<div class="ui-tree-toolbar" part="toolbar">
|
|
770
|
-
<div class="ui-tree-title-group">
|
|
771
|
-
<span class="ui-tree-section-title">${M(l || "CAMADAS")}</span>
|
|
772
|
-
<span class="ui-tree-count-badge">${t.length}</span>
|
|
773
|
-
</div>
|
|
774
|
-
<div class="ui-tree-actions">
|
|
775
|
-
<button id="btn-toggle-all-vis" class="ui-tree-action-btn" title="${L ? "Ocultar Todas as Camadas" : "Exibir Todas as Camadas"}" aria-label="${L ? "Ocultar Todas as Camadas" : "Exibir Todas as Camadas"}">
|
|
776
|
-
${L ? b.olhoAberto : b.olhoFechado}
|
|
777
|
-
</button>
|
|
778
|
-
<button id="btn-toggle-all-expand" class="ui-tree-action-btn" aria-label="${x ? "Recolher Todos os Grupos" : "Expandir Todos os Grupos"}" title="${x ? "Recolher Todos os Grupos" : "Expandir Todos os Grupos"}">
|
|
779
|
-
<span class="ui-chevron-icon ${x ? "open" : ""}">${b.chevronDir}</span>
|
|
780
|
-
</button>
|
|
781
|
-
${m ? `<button id="btn-colapsar" class="ui-camadas-btn-colapsar" title="Recolher painel" aria-label="Recolher painel">${b.recolherPainel}</button>` : ""}
|
|
782
|
-
</div>
|
|
783
|
-
</div>
|
|
784
|
-
${S}
|
|
785
|
-
`, q = (z) => {
|
|
786
|
-
const I = z.camada;
|
|
787
|
-
if (g && !g.camadasVisiveis.has(I.id)) return "";
|
|
788
|
-
const D = z.depth, Q = z.subcamadas, Be = g ? Q.filter(($) => g.camadasVisiveis.has($.camada.id)) : Q, ie = !!(I.isGroup || Q.length > 0), C = M(I.id), oe = M(I.name || (ie ? "Novo Grupo" : "Camada")), V = W(I.color, "#00E08A"), ne = I.visible !== !1, se = I.locked === !0, de = h ? !0 : i.has(I.id), be = n === I.id, ye = r === I.id, _ = k.get(I.id), ya = (_ == null ? void 0 : _.ocultaPorAncestral) === !0, xa = (_ == null ? void 0 : _.travadaPorAncestral) === !0, H = g ? g.feicoesPorCamada.get(I.id) || [] : y.get(I.id) || [], ce = g ? H : re(t, a, I.id), qe = ce.length > 0 && ce.every(($) => o.has($.id)), wa = !qe && ce.some(($) => o.has($.id)), xe = (u == null ? void 0 : u.get(I.id)) ?? f, Aa = H.slice(0, xe), Ea = H.length > xe, Ia = Le(I, D, _), ka = ($) => Ce($, Ia, o.has($.id), c === $.id), La = Ea ? oa(C, xe, H.length) : "", De = Number(I.opacity ?? 1), Te = Number.isFinite(De) ? Math.min(1, Math.max(0, De)) : 1, Ca = Math.round(Te * 100), Sa = t.filter(($) => $.id !== I.id && !G(t, $.id, I.id)).map(
|
|
789
|
-
($) => `<option value="${M($.id)}" ${I.parentId === $.id ? "selected" : ""}>${$.isGroup ? "📁 " : ""}${M($.name)}</option>`
|
|
790
|
-
).join(""), Fa = be ? `
|
|
791
|
-
<div class="ui-layer-settings-drawer" id="settings-drawer-${C}" part="drawer" style="--drawer-cor-camada: ${V};">
|
|
792
|
-
<div class="ui-drawer-header">
|
|
793
|
-
<div class="ui-drawer-header-left">
|
|
794
|
-
<span class="ui-drawer-icon">${b.engrenagem}</span>
|
|
795
|
-
<span class="ui-drawer-title">Configurações da Camada</span>
|
|
796
|
-
<span class="ui-drawer-layer-chip" title="${oe}">${oe}</span>
|
|
797
|
-
</div>
|
|
798
|
-
<button type="button" class="ui-drawer-btn-fechar" data-layer-settings-close="${C}" title="Fechar configurações (Esc)" aria-label="Fechar configurações">
|
|
799
|
-
${b.fechar}
|
|
800
|
-
</button>
|
|
801
|
-
</div>
|
|
802
|
-
|
|
803
|
-
<div class="ui-drawer-body">
|
|
804
|
-
<!-- Cor da Camada -->
|
|
805
|
-
<div class="ui-drawer-row">
|
|
806
|
-
<div class="ui-drawer-row-label">
|
|
807
|
-
<span>Cor do Vetor</span>
|
|
808
|
-
</div>
|
|
809
|
-
<div class="ui-drawer-color-group">
|
|
810
|
-
<label class="ui-drawer-color-pill" title="Clique para alterar a cor da camada">
|
|
811
|
-
<span class="ui-drawer-color-sample" id="sample-color-${C}" style="background-color: ${V};"></span>
|
|
812
|
-
<span class="ui-drawer-color-hex" id="hex-color-${C}">${V.toUpperCase()}</span>
|
|
813
|
-
<input type="color" aria-label="Cor da camada" data-layer-color-picker="${C}" value="${Na(V, "#00e08a")}" class="ui-drawer-color-native" />
|
|
814
|
-
</label>
|
|
815
|
-
</div>
|
|
816
|
-
</div>
|
|
817
|
-
|
|
818
|
-
<!-- Opacidade da Camada -->
|
|
819
|
-
<div class="ui-drawer-row">
|
|
820
|
-
<div class="ui-drawer-row-label">
|
|
821
|
-
<span>Opacidade</span>
|
|
822
|
-
<span class="ui-drawer-badge" id="badge-op-${C}">${Ca}%</span>
|
|
823
|
-
</div>
|
|
824
|
-
<div class="ui-drawer-slider-container">
|
|
825
|
-
<input type="range" aria-label="Opacidade da camada" min="0.05" max="1" step="0.05" value="${Number(Te) || 0}" data-layer-opacity-slider="${C}" class="ui-drawer-slider" />
|
|
826
|
-
</div>
|
|
827
|
-
</div>
|
|
828
|
-
|
|
829
|
-
<!-- Hierarquia / Grupo Pai -->
|
|
830
|
-
<div class="ui-drawer-row">
|
|
831
|
-
<div class="ui-drawer-row-label">
|
|
832
|
-
<span>Pertence ao Grupo</span>
|
|
833
|
-
</div>
|
|
834
|
-
<div class="ui-drawer-select-wrapper">
|
|
835
|
-
<select class="ui-drawer-select" data-layer-parent-select="${C}" aria-label="Grupo pai da camada">
|
|
836
|
-
<option value="" ${I.parentId ? "" : "selected"}>(Nenhum - Nível Principal)</option>
|
|
837
|
-
${Sa}
|
|
838
|
-
</select>
|
|
839
|
-
</div>
|
|
840
|
-
</div>
|
|
841
|
-
</div>
|
|
842
|
-
|
|
843
|
-
<div class="ui-drawer-footer">
|
|
844
|
-
<div class="ui-drawer-meta-info">
|
|
845
|
-
<span>${Q.length > 0 ? `${Q.length} subcamadas · ` : ""}${H.length} ${H.length === 1 ? "feição" : "feições"}</span>
|
|
846
|
-
</div>
|
|
847
|
-
<div class="ui-drawer-actions">
|
|
848
|
-
<button type="button" class="ui-drawer-btn-sublayer" data-add-sublayer="${C}" title="Adicionar nova camada dentro desta">
|
|
849
|
-
${b.mais} Subcamada
|
|
850
|
-
</button>
|
|
851
|
-
<button type="button" class="ui-drawer-btn-danger" data-delete-layer="${C}" title="Excluir esta camada e suas feições">
|
|
852
|
-
${b.lixeira}
|
|
853
|
-
<span class="ui-btn-label">Excluir</span>
|
|
854
|
-
</button>
|
|
855
|
-
</div>
|
|
856
|
-
</div>
|
|
857
|
-
</div>
|
|
858
|
-
` : "", $a = Wa(
|
|
859
|
-
Be,
|
|
860
|
-
Aa,
|
|
861
|
-
v == null ? void 0 : v.get(I.id)
|
|
862
|
-
).map(($) => $.tipo === "layer" ? q($.nodo) : ka($.feicao)).join("");
|
|
863
|
-
return `
|
|
864
|
-
<div class="ui-layer-group ${D > 0 ? "is-sublayer-group" : ""}" data-layer-id="${C}" data-layer-depth="${D}" role="treeitem" aria-level="${D + 1}" aria-expanded="${de}" part="grupo" style="--layer-active-color: ${V};">
|
|
865
|
-
<div class="ui-layer-row ${ne ? "" : "hidden-layer"} ${ye ? "active-drawing-layer" : ""} ${D > 0 ? "is-sublayer" : ""} ${ie ? "is-group-row" : ""} ${ya ? "herdado-oculto" : ""} ${xa ? "herdado-travado" : ""}" data-layer-row="${C}" data-layer-id="${C}" tabindex="-1" draggable="true" part="${ye ? "camada camada-ativa" : "camada"}" ${ye ? 'aria-current="true"' : ""} style="--layer-depth: ${D};">
|
|
866
|
-
<div class="ui-col ui-col-drag" title="Arrastar para reordenar Z-Index">${b.dragHandle}</div>
|
|
867
|
-
|
|
868
|
-
<div class="ui-col ui-col-eye" data-layer-eye="${C}" role="button" tabindex="0" aria-label="${ne ? "Ocultar Camada" : "Exibir Camada"}" title="${ne ? "Ocultar Camada" : "Exibir Camada"}">
|
|
869
|
-
${ne ? b.olhoAberto : b.olhoFechado}
|
|
870
|
-
</div>
|
|
871
|
-
|
|
872
|
-
<div class="ui-col ui-col-lock ${se ? "" : "ui-lock-open"}" data-layer-lock="${C}" role="button" tabindex="0" aria-label="${se ? "Desbloquear Camada" : "Bloquear Camada"}" title="${se ? "Desbloquear Camada" : "Bloquear Camada"}">
|
|
873
|
-
${se ? b.cadeadoTrancado : b.cadeadoAberto}
|
|
874
|
-
</div>
|
|
875
|
-
|
|
876
|
-
<div class="ui-col ui-col-colorbar ui-col-colorbar-editavel" data-layer-color="${C}" role="button" tabindex="0" style="background: ${V};" aria-label="Alterar cor da camada" title="Alterar cor da camada (usada no destaque de seleção)"></div>
|
|
877
|
-
|
|
878
|
-
<div class="ui-col ui-col-chevron" data-layer-expand="${C}" role="button" tabindex="0" aria-label="${de ? "Recolher grupo" : "Expandir grupo"}">
|
|
879
|
-
<span class="ui-chevron-icon ${de ? "open" : ""}">${b.chevronDir}</span>
|
|
880
|
-
</div>
|
|
881
|
-
|
|
882
|
-
<div class="ui-col ui-col-name" data-layer-name-trigger="${C}" title="Clique para ativar camada de desenho | Duplo clique para renomear">
|
|
883
|
-
${s === I.id ? `<input type="text" class="ui-inline-rename-input" data-inline-layer-input="${C}" value="${oe}" />` : `<span class="ui-name-text">${oe}</span>
|
|
884
|
-
${ra(ce.length, H.length, Q.length, ie)}`}
|
|
885
|
-
</div>
|
|
886
|
-
|
|
887
|
-
<div class="ui-col ui-col-actions">
|
|
888
|
-
<button class="ui-micro-btn" data-layer-fit="${C}" title="Enquadrar camada no mapa" aria-label="Enquadrar camada no mapa">${b.alvoEnquadrar}</button>
|
|
889
|
-
<button class="ui-micro-btn ${be ? "active" : ""}" data-layer-settings="${C}" title="Ajustar cor, hierarquia, opacidade e excluir" aria-label="Configurações da camada" aria-expanded="${be}">${b.engrenagem}</button>
|
|
890
|
-
</div>
|
|
891
|
-
|
|
892
|
-
<div class="ui-col ui-col-target" data-layer-target="${C}" role="button" tabindex="0" aria-label="Selecionar todas as feições deste grupo" title="Selecionar todas as feições deste grupo">
|
|
893
|
-
<div class="ui-target-circle ${qe ? "selected" : wa ? "partial" : ""}"></div>
|
|
894
|
-
</div>
|
|
895
|
-
</div>
|
|
896
|
-
|
|
897
|
-
${Fa}
|
|
898
|
-
|
|
899
|
-
<div class="ui-children-container ${D > 0 ? "is-subchildren" : ""}" role="group" style="--parent-depth: ${D}; --parent-layer-color: ${V}; display: ${de ? "block" : "none"};">
|
|
900
|
-
${$a}
|
|
901
|
-
${La}
|
|
902
|
-
${Be.length === 0 && H.length === 0 ? na(ie) : ""}
|
|
903
|
-
</div>
|
|
904
|
-
</div>
|
|
905
|
-
`;
|
|
906
|
-
}, w = me(t), B = t.length === 0 ? (y.get("") ?? []).filter((z) => !h || String(z.name ?? "").toLowerCase().includes(h)) : [], E = Le({ id: "" }, 0, void 0), P = B.slice(0, f).map((z) => Ce(z, E, o.has(z.id), c === z.id)).join(""), K = g && g.camadasVisiveis.size === 0 && !P ? `<div class="ui-search-empty" role="status">Nenhum resultado para “${M((d || "").trim())}”</div>` : P || w.map((z) => q(z)).join("");
|
|
907
|
-
return `
|
|
908
|
-
${F}
|
|
909
|
-
<div class="ui-panel-box">
|
|
910
|
-
<div class="ui-layer-tree" id="ui-layer-tree-mount" role="tree" aria-label="Camadas e feições" aria-multiselectable="true" part="arvore">
|
|
911
|
-
${K}
|
|
912
|
-
</div>
|
|
913
|
-
</div>
|
|
914
|
-
`;
|
|
915
|
-
}
|
|
916
|
-
function it(e) {
|
|
917
|
-
return [
|
|
918
|
-
{
|
|
919
|
-
gatilho: "data-layer-name-trigger",
|
|
920
|
-
input: "data-inline-layer-input",
|
|
921
|
-
linha: "data-layer-row",
|
|
922
|
-
marcarEditando: (t) => {
|
|
923
|
-
e.editingLayerId = t;
|
|
924
|
-
},
|
|
925
|
-
aplicar: (t, a) => {
|
|
926
|
-
const r = e.camadas.find((i) => i.id === t);
|
|
927
|
-
return !a || !r || r.name === a ? null : (r.name = a, { detalhe: { camadaId: t, novoNome: a, camada: r }, salvar: !0 });
|
|
928
|
-
},
|
|
929
|
-
emitir: (t) => e.dispararEvento("ui-camada-renomeada", t)
|
|
930
|
-
},
|
|
931
|
-
{
|
|
932
|
-
gatilho: "data-feat-name-trigger",
|
|
933
|
-
input: "data-inline-feat-input",
|
|
934
|
-
linha: "data-feat-row",
|
|
935
|
-
marcarEditando: (t) => {
|
|
936
|
-
e.editingFeatureId = t;
|
|
937
|
-
},
|
|
938
|
-
aplicar: (t, a) => {
|
|
939
|
-
const r = e.feicoes.find((i) => i.id === t);
|
|
940
|
-
return !a || !r || r.name === a ? null : (r.name = a, { detalhe: { feicaoId: t, novoNome: a, feicao: r }, salvar: !1 });
|
|
941
|
-
},
|
|
942
|
-
emitir: (t) => e.dispararEvento("ui-feicao-renomeada", t)
|
|
943
|
-
}
|
|
944
|
-
];
|
|
945
|
-
}
|
|
946
|
-
function Ve(e, t, a = t) {
|
|
947
|
-
for (const r of it(e))
|
|
948
|
-
a.querySelectorAll(`[${r.gatilho}]`).forEach((i) => {
|
|
949
|
-
i.addEventListener("dblclick", (o) => {
|
|
950
|
-
o.stopPropagation();
|
|
951
|
-
const n = i.getAttribute(r.gatilho);
|
|
952
|
-
if (!n) return;
|
|
953
|
-
r.marcarEditando(n), e.solicitarRenderizacao();
|
|
954
|
-
const s = O(t, r.input, n);
|
|
955
|
-
if (!s) return;
|
|
956
|
-
s.focus(), s.select();
|
|
957
|
-
let c = !1;
|
|
958
|
-
const d = (l, p = !1) => {
|
|
959
|
-
var u, f;
|
|
960
|
-
if (!c) {
|
|
961
|
-
if (c = !0, r.marcarEditando(null), l) {
|
|
962
|
-
const m = r.aplicar(n, s.value.trim());
|
|
963
|
-
m && (m.salvar && ((u = e.salvarLembrancaEstado) == null || u.call(e)), r.emitir(m.detalhe));
|
|
964
|
-
}
|
|
965
|
-
e.solicitarRenderizacao(), p && ((f = O(t, r.linha, n)) == null || f.focus());
|
|
966
|
-
}
|
|
967
|
-
};
|
|
968
|
-
s.addEventListener("keydown", (l) => {
|
|
969
|
-
l.key === "Enter" ? (l.preventDefault(), d(!0, !0)) : l.key === "Escape" && (l.preventDefault(), d(!1, !0));
|
|
970
|
-
}), s.addEventListener("blur", () => d(!0));
|
|
971
|
-
});
|
|
972
|
-
});
|
|
973
|
-
}
|
|
974
|
-
const ot = ["dragging", "drop-above", "drop-below", "drop-into"];
|
|
975
|
-
class nt {
|
|
976
|
-
constructor(t, a) {
|
|
977
|
-
A(this, "host");
|
|
978
|
-
A(this, "shadow");
|
|
979
|
-
/** Cancela um arraste por toque em andamento (remove os ouvintes de `window`). */
|
|
980
|
-
A(this, "cancelarToque", null);
|
|
981
|
-
/**
|
|
982
|
-
* Arraste HTML5 em andamento. Fica no gerenciador (e não numa closure de `bindDragAndDrop`) para que linhas
|
|
983
|
-
* ligadas depois, na atualização incremental, enxerguem o arraste iniciado numa linha mais antiga.
|
|
984
|
-
*/
|
|
985
|
-
A(this, "arraste", {
|
|
986
|
-
tipo: null,
|
|
987
|
-
camadaId: null,
|
|
988
|
-
feicaoId: null
|
|
989
|
-
});
|
|
990
|
-
this.host = t, this.shadow = a;
|
|
991
|
-
}
|
|
992
|
-
bindAll() {
|
|
993
|
-
this.bindInlineRename(), this.bindDragAndDrop(), this.bindTouchDragAndDrop();
|
|
994
|
-
}
|
|
995
|
-
/** Solta o que ficou em `window` (arraste por toque interrompido pela desconexão do componente). */
|
|
996
|
-
destruir() {
|
|
997
|
-
var t;
|
|
998
|
-
(t = this.cancelarToque) == null || t.call(this), this.cancelarToque = null;
|
|
999
|
-
}
|
|
1000
|
-
bindInlineRename() {
|
|
1001
|
-
Ve(this.host, this.shadow);
|
|
1002
|
-
}
|
|
1003
|
-
limparClassesDeArraste() {
|
|
1004
|
-
this.shadow.querySelectorAll(".ui-layer-row, .ui-feat-row, .ui-layer-group").forEach((t) => {
|
|
1005
|
-
t.classList.remove(...ot);
|
|
1006
|
-
});
|
|
1007
|
-
}
|
|
1008
|
-
/** Depois de qualquer mudança na ordem/hierarquia de camadas. */
|
|
1009
|
-
aposReordenarCamadas() {
|
|
1010
|
-
var t, a;
|
|
1011
|
-
(a = (t = this.host).salvarLembrancaEstado) == null || a.call(t), this.host.dispararEvento("ui-camadas-reordenadas", { camadas: [...this.host.camadas] }), this.host.solicitarRenderizacao();
|
|
1012
|
-
}
|
|
1013
|
-
emitirFeicaoMovida(t) {
|
|
1014
|
-
this.host.dispararEvento("ui-feicao-movida", {
|
|
1015
|
-
feicaoId: t.feicao.id,
|
|
1016
|
-
camadaOrigemId: t.camadaOrigemId,
|
|
1017
|
-
camadaDestinoId: t.camadaDestinoId,
|
|
1018
|
-
feicao: t.feicao,
|
|
1019
|
-
feicoes: [...this.host.feicoes]
|
|
1020
|
-
});
|
|
1021
|
-
}
|
|
1022
|
-
/** Camada travada (ou sob grupo travado) ou feição individualmente travada não pode ser movida entre camadas. */
|
|
1023
|
-
trocaEntreCamadasTravada(t, a) {
|
|
1024
|
-
const r = this.host.feicoes.find((n) => n.id === t), i = r == null ? void 0 : r.layerId;
|
|
1025
|
-
if (!a || i === a) return !1;
|
|
1026
|
-
if ((r == null ? void 0 : r.locked) === !0) return !0;
|
|
1027
|
-
const o = ue(this.host.camadas);
|
|
1028
|
-
return o.has(a) || !!i && o.has(i);
|
|
1029
|
-
}
|
|
1030
|
-
arrasteBloqueado(t) {
|
|
1031
|
-
return !!t.closest("input, button, select") || !!this.host.editingLayerId || !!this.host.editingFeatureId;
|
|
1032
|
-
}
|
|
1033
|
-
/** Render completo: zera o arraste e liga camadas e feições do painel todo. */
|
|
1034
|
-
bindDragAndDrop() {
|
|
1035
|
-
this.arraste = { tipo: null, camadaId: null, feicaoId: null }, this.vincularArrasteCamadas(this.shadow), this.vincularArrasteFeicoes(this.shadow);
|
|
1036
|
-
}
|
|
1037
|
-
/** Atualização incremental: liga renomear e arraste só nas linhas de feição novas dentro de `raiz`. */
|
|
1038
|
-
bindLinhasFeicao(t) {
|
|
1039
|
-
Ve(this.host, this.shadow, t), this.vincularArrasteFeicoes(t);
|
|
1040
|
-
}
|
|
1041
|
-
vincularArrasteCamadas(t) {
|
|
1042
|
-
t.querySelectorAll('.ui-layer-row[draggable="true"]').forEach((a) => {
|
|
1043
|
-
const r = a.getAttribute("data-layer-id");
|
|
1044
|
-
r && (a.addEventListener("dragstart", (i) => {
|
|
1045
|
-
const o = i;
|
|
1046
|
-
if (this.arrasteBloqueado(o.target)) {
|
|
1047
|
-
o.preventDefault();
|
|
1048
|
-
return;
|
|
1049
|
-
}
|
|
1050
|
-
this.arraste.tipo = "layer", this.arraste.camadaId = r, o.dataTransfer && (o.dataTransfer.setData("text/plain", JSON.stringify({ type: "layer", id: r })), o.dataTransfer.effectAllowed = "move"), a.classList.add("dragging");
|
|
1051
|
-
}), a.addEventListener("dragover", (i) => {
|
|
1052
|
-
const o = i;
|
|
1053
|
-
if (o.preventDefault(), o.stopPropagation(), o.dataTransfer && (o.dataTransfer.dropEffect = "move"), this.arraste.tipo === "layer") {
|
|
1054
|
-
if (this.arraste.camadaId === r) return;
|
|
1055
|
-
const n = a.getBoundingClientRect(), s = Ie((o.clientY - n.top) / n.height);
|
|
1056
|
-
a.classList.toggle("drop-above", s === "acima"), a.classList.toggle("drop-below", s === "abaixo"), a.classList.toggle("drop-into", s === "dentro");
|
|
1057
|
-
} else if (this.arraste.tipo === "feature") {
|
|
1058
|
-
const n = this.host.camadas.find((s) => s.id === r);
|
|
1059
|
-
if (n != null && n.parentId) {
|
|
1060
|
-
const s = a.getBoundingClientRect(), c = s.height > 0 ? Ie((o.clientY - s.top) / s.height) : "dentro";
|
|
1061
|
-
a.classList.toggle("drop-above", c === "acima"), a.classList.toggle("drop-below", c === "abaixo"), a.classList.toggle("drop-into", c === "dentro");
|
|
1062
|
-
} else
|
|
1063
|
-
a.classList.remove("drop-above", "drop-below"), a.classList.add("drop-into");
|
|
1064
|
-
}
|
|
1065
|
-
}), a.addEventListener("dragleave", (i) => {
|
|
1066
|
-
const o = i.relatedTarget;
|
|
1067
|
-
o && a.contains(o) || a.classList.remove("drop-above", "drop-below", "drop-into");
|
|
1068
|
-
}), a.addEventListener("drop", (i) => {
|
|
1069
|
-
var s, c, d, l, p;
|
|
1070
|
-
const o = i;
|
|
1071
|
-
o.preventDefault(), o.stopPropagation();
|
|
1072
|
-
const n = a.classList.contains("drop-into") ? "dentro" : a.classList.contains("drop-above") ? "acima" : "abaixo";
|
|
1073
|
-
if (this.limparClassesDeArraste(), this.arraste.tipo === "layer") {
|
|
1074
|
-
if (!this.arraste.camadaId || this.arraste.camadaId === r || !this.host.camadas.some((f) => f.id === this.arraste.camadaId) || !this.host.camadas.some((f) => f.id === r)) return;
|
|
1075
|
-
const u = Ne(this.host.camadas, this.arraste.camadaId, r, n);
|
|
1076
|
-
u && this.host.ordemFilhosPorPai && Ge(
|
|
1077
|
-
this.host.camadas,
|
|
1078
|
-
this.host.feicoes,
|
|
1079
|
-
this.host.ordemFilhosPorPai,
|
|
1080
|
-
this.arraste.camadaId,
|
|
1081
|
-
r,
|
|
1082
|
-
n,
|
|
1083
|
-
u.parentAnteriorId,
|
|
1084
|
-
u.novoParentId
|
|
1085
|
-
), (u == null ? void 0 : u.tipo) === "hierarquia" ? ((s = this.host.expandedLayers) == null || s.add(u.novoParentId), this.host.dispararEvento("ui-camada-mover-hierarquia", {
|
|
1086
|
-
camadaId: u.camada.id,
|
|
1087
|
-
novoParentId: u.novoParentId,
|
|
1088
|
-
parentAnteriorId: u.parentAnteriorId,
|
|
1089
|
-
camada: u.camada
|
|
1090
|
-
})) : u && u.parentAnteriorId !== u.novoParentId && this.host.dispararEvento("ui-camada-mover-hierarquia", {
|
|
1091
|
-
camadaId: u.camada.id,
|
|
1092
|
-
novoParentId: u.novoParentId,
|
|
1093
|
-
parentAnteriorId: u.parentAnteriorId,
|
|
1094
|
-
camada: u.camada
|
|
1095
|
-
}), this.aposReordenarCamadas();
|
|
1096
|
-
} else if (this.arraste.tipo === "feature") {
|
|
1097
|
-
if (!this.arraste.feicaoId) return;
|
|
1098
|
-
const u = this.host.camadas.find((f) => f.id === r);
|
|
1099
|
-
if (u != null && u.parentId && (n === "acima" || n === "abaixo")) {
|
|
1100
|
-
if (this.trocaEntreCamadasTravada(this.arraste.feicaoId, u.parentId) || !this.host.ordemFilhosPorPai) return;
|
|
1101
|
-
const f = et(
|
|
1102
|
-
this.host.camadas,
|
|
1103
|
-
this.host.feicoes,
|
|
1104
|
-
this.host.ordemFilhosPorPai,
|
|
1105
|
-
this.arraste.feicaoId,
|
|
1106
|
-
r,
|
|
1107
|
-
n === "acima"
|
|
1108
|
-
);
|
|
1109
|
-
if (!f) return;
|
|
1110
|
-
this.host.dispararEvento("ui-feicoes-reordenadas", { feicoes: [...this.host.feicoes] }), f.mudouDeCamada && this.emitirFeicaoMovida(f), (d = (c = this.host).salvarLembrancaEstado) == null || d.call(c), this.host.solicitarRenderizacao();
|
|
1111
|
-
} else {
|
|
1112
|
-
if (this.trocaEntreCamadasTravada(this.arraste.feicaoId, r)) return;
|
|
1113
|
-
const f = Qa(this.host.feicoes, this.host.camadas, this.arraste.feicaoId, r);
|
|
1114
|
-
f && (this.host.ordemFilhosPorPai && tt(
|
|
1115
|
-
this.host.ordemFilhosPorPai,
|
|
1116
|
-
f.feicao.id,
|
|
1117
|
-
f.camadaOrigemId,
|
|
1118
|
-
f.camadaDestinoId
|
|
1119
|
-
), this.emitirFeicaoMovida(f), (p = (l = this.host).salvarLembrancaEstado) == null || p.call(l), this.host.solicitarRenderizacao());
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
|
-
}), a.addEventListener("dragend", () => {
|
|
1123
|
-
this.arraste.tipo = null, this.arraste.camadaId = null, this.arraste.feicaoId = null, this.limparClassesDeArraste();
|
|
1124
|
-
}));
|
|
1125
|
-
});
|
|
1126
|
-
}
|
|
1127
|
-
vincularArrasteFeicoes(t) {
|
|
1128
|
-
t.querySelectorAll('.ui-feat-row[draggable="true"]').forEach((a) => {
|
|
1129
|
-
const r = a.getAttribute("data-feat-row"), i = a.getAttribute("data-feat-layer");
|
|
1130
|
-
r && (a.addEventListener("dragstart", (o) => {
|
|
1131
|
-
const n = o;
|
|
1132
|
-
if (this.arrasteBloqueado(n.target)) {
|
|
1133
|
-
n.preventDefault();
|
|
1134
|
-
return;
|
|
1135
|
-
}
|
|
1136
|
-
n.stopPropagation(), this.arraste.tipo = "feature", this.arraste.feicaoId = r, this.arraste.camadaId = i, n.dataTransfer && (n.dataTransfer.setData("text/plain", JSON.stringify({ type: "feature", id: r, layerId: i })), n.dataTransfer.effectAllowed = "move"), a.classList.add("dragging");
|
|
1137
|
-
}), a.addEventListener("dragover", (o) => {
|
|
1138
|
-
const n = o, s = this.arraste.tipo === "feature" && this.arraste.feicaoId !== r, c = this.arraste.tipo === "layer" && !!this.arraste.camadaId && !!i && this.arraste.camadaId !== i && !G(this.host.camadas, i, this.arraste.camadaId);
|
|
1139
|
-
if (!s && !c) return;
|
|
1140
|
-
n.preventDefault(), n.stopPropagation(), n.dataTransfer && (n.dataTransfer.dropEffect = "move");
|
|
1141
|
-
const d = a.getBoundingClientRect(), l = n.clientY - d.top < d.height / 2;
|
|
1142
|
-
a.classList.toggle("drop-above", l), a.classList.toggle("drop-below", !l);
|
|
1143
|
-
}), a.addEventListener("dragleave", (o) => {
|
|
1144
|
-
const n = o.relatedTarget;
|
|
1145
|
-
n && a.contains(n) || a.classList.remove("drop-above", "drop-below");
|
|
1146
|
-
}), a.addEventListener("drop", (o) => {
|
|
1147
|
-
var d, l, p;
|
|
1148
|
-
const n = o, s = a.getBoundingClientRect(), c = a.classList.contains("drop-above") ? !0 : a.classList.contains("drop-below") ? !1 : s.height > 0 && n.clientY - s.top < s.height / 2;
|
|
1149
|
-
if (this.arraste.tipo === "feature") {
|
|
1150
|
-
if (!this.arraste.feicaoId || this.arraste.feicaoId === r || (n.preventDefault(), n.stopPropagation(), this.limparClassesDeArraste(), this.trocaEntreCamadasTravada(this.arraste.feicaoId, i))) return;
|
|
1151
|
-
const u = Xa(this.host.feicoes, this.arraste.feicaoId, r, c);
|
|
1152
|
-
if (!u) return;
|
|
1153
|
-
this.host.ordemFilhosPorPai && at(
|
|
1154
|
-
this.host.camadas,
|
|
1155
|
-
this.host.feicoes,
|
|
1156
|
-
this.host.ordemFilhosPorPai,
|
|
1157
|
-
this.arraste.feicaoId,
|
|
1158
|
-
r,
|
|
1159
|
-
c,
|
|
1160
|
-
u.camadaOrigemId,
|
|
1161
|
-
u.camadaDestinoId
|
|
1162
|
-
), this.host.dispararEvento("ui-feicoes-reordenadas", { feicoes: [...this.host.feicoes] }), u.mudouDeCamada && this.emitirFeicaoMovida(u), (l = (d = this.host).salvarLembrancaEstado) == null || l.call(d), this.host.solicitarRenderizacao();
|
|
1163
|
-
} else if (this.arraste.tipo === "layer") {
|
|
1164
|
-
if (!this.arraste.camadaId || !i || !this.host.ordemFilhosPorPai) return;
|
|
1165
|
-
n.preventDefault(), n.stopPropagation(), this.limparClassesDeArraste();
|
|
1166
|
-
const u = He(
|
|
1167
|
-
this.host.camadas,
|
|
1168
|
-
this.host.feicoes,
|
|
1169
|
-
this.host.ordemFilhosPorPai,
|
|
1170
|
-
this.arraste.camadaId,
|
|
1171
|
-
r,
|
|
1172
|
-
c
|
|
1173
|
-
);
|
|
1174
|
-
if (!u) return;
|
|
1175
|
-
u.parentAnteriorId !== u.novoParentId && u.novoParentId && ((p = this.host.expandedLayers) == null || p.add(u.novoParentId), this.host.dispararEvento("ui-camada-mover-hierarquia", {
|
|
1176
|
-
camadaId: u.camada.id,
|
|
1177
|
-
novoParentId: u.novoParentId,
|
|
1178
|
-
parentAnteriorId: u.parentAnteriorId,
|
|
1179
|
-
camada: u.camada
|
|
1180
|
-
})), this.aposReordenarCamadas();
|
|
1181
|
-
}
|
|
1182
|
-
}), a.addEventListener("dragend", (o) => {
|
|
1183
|
-
o.stopPropagation(), this.arraste.tipo = null, this.arraste.feicaoId = null, this.arraste.camadaId = null, this.limparClassesDeArraste();
|
|
1184
|
-
}));
|
|
1185
|
-
});
|
|
1186
|
-
}
|
|
1187
|
-
/**
|
|
1188
|
-
* Suporte a arraste por toque e ponteiro no handle (.ui-col-drag) para tablets e mobile.
|
|
1189
|
-
* Suporta tanto reordenação (acima/abaixo) quanto aninhamento hierárquico (drop-into),
|
|
1190
|
-
* mantendo paridade total com o Drag & Drop HTML5.
|
|
1191
|
-
* Os ouvintes de `window` existem só durante o gesto e são soltos em `destruir()`.
|
|
1192
|
-
*/
|
|
1193
|
-
bindTouchDragAndDrop() {
|
|
1194
|
-
this.shadow.querySelectorAll(".ui-layer-row .ui-col-drag").forEach((t) => {
|
|
1195
|
-
const a = t.closest(".ui-layer-row");
|
|
1196
|
-
if (!a) return;
|
|
1197
|
-
const r = a.getAttribute("data-layer-id");
|
|
1198
|
-
r && t.addEventListener("pointerdown", (i) => {
|
|
1199
|
-
var p;
|
|
1200
|
-
const o = i;
|
|
1201
|
-
if (o.pointerType === "mouse" && o.button !== 0 || this.host.editingLayerId || this.host.editingFeatureId) return;
|
|
1202
|
-
(p = this.cancelarToque) == null || p.call(this);
|
|
1203
|
-
let n = null, s = "abaixo";
|
|
1204
|
-
const c = (u) => {
|
|
1205
|
-
u.preventDefault(), a.classList.add("dragging");
|
|
1206
|
-
const f = this.shadow.elementFromPoint(u.clientX, u.clientY), m = f ? f.closest(".ui-layer-row, .ui-feat-row") : null;
|
|
1207
|
-
if (n && n !== m && n.classList.remove("drop-above", "drop-below", "drop-into"), m && m !== a)
|
|
1208
|
-
if (m.classList.contains("ui-feat-row")) {
|
|
1209
|
-
const h = m.getAttribute("data-feat-layer");
|
|
1210
|
-
if (!h || h === r || G(this.host.camadas, h, r)) {
|
|
1211
|
-
n = null;
|
|
1212
|
-
return;
|
|
1213
|
-
}
|
|
1214
|
-
n = m;
|
|
1215
|
-
const g = m.getBoundingClientRect(), y = g.height > 0 && u.clientY - g.top < g.height / 2;
|
|
1216
|
-
s = y ? "acima" : "abaixo", m.classList.toggle("drop-above", y), m.classList.toggle("drop-below", !y), m.classList.remove("drop-into");
|
|
1217
|
-
} else {
|
|
1218
|
-
n = m;
|
|
1219
|
-
const h = m.getBoundingClientRect();
|
|
1220
|
-
s = h.height > 0 ? Ie((u.clientY - h.top) / h.height) : "abaixo", m.classList.toggle("drop-above", s === "acima"), m.classList.toggle("drop-below", s === "abaixo"), m.classList.toggle("drop-into", s === "dentro");
|
|
1221
|
-
}
|
|
1222
|
-
else
|
|
1223
|
-
n = null;
|
|
1224
|
-
}, d = () => {
|
|
1225
|
-
window.removeEventListener("pointermove", c), window.removeEventListener("pointerup", l), window.removeEventListener("pointercancel", l), this.cancelarToque = null;
|
|
1226
|
-
}, l = () => {
|
|
1227
|
-
var v, h;
|
|
1228
|
-
d();
|
|
1229
|
-
const u = n == null ? void 0 : n.getAttribute("data-layer-id"), f = n == null ? void 0 : n.getAttribute("data-feat-row");
|
|
1230
|
-
if (this.limparClassesDeArraste(), f && this.host.ordemFilhosPorPai) {
|
|
1231
|
-
const g = He(
|
|
1232
|
-
this.host.camadas,
|
|
1233
|
-
this.host.feicoes,
|
|
1234
|
-
this.host.ordemFilhosPorPai,
|
|
1235
|
-
r,
|
|
1236
|
-
f,
|
|
1237
|
-
s === "acima"
|
|
1238
|
-
);
|
|
1239
|
-
if (!g) return;
|
|
1240
|
-
g.parentAnteriorId !== g.novoParentId && g.novoParentId && ((v = this.host.expandedLayers) == null || v.add(g.novoParentId), this.host.dispararEvento("ui-camada-mover-hierarquia", {
|
|
1241
|
-
camadaId: g.camada.id,
|
|
1242
|
-
novoParentId: g.novoParentId,
|
|
1243
|
-
parentAnteriorId: g.parentAnteriorId,
|
|
1244
|
-
camada: g.camada
|
|
1245
|
-
})), this.aposReordenarCamadas();
|
|
1246
|
-
return;
|
|
1247
|
-
}
|
|
1248
|
-
if (!u || u === r) return;
|
|
1249
|
-
const m = Ne(this.host.camadas, r, u, s);
|
|
1250
|
-
m && (this.host.ordemFilhosPorPai && Ge(
|
|
1251
|
-
this.host.camadas,
|
|
1252
|
-
this.host.feicoes,
|
|
1253
|
-
this.host.ordemFilhosPorPai,
|
|
1254
|
-
r,
|
|
1255
|
-
u,
|
|
1256
|
-
s,
|
|
1257
|
-
m.parentAnteriorId,
|
|
1258
|
-
m.novoParentId
|
|
1259
|
-
), m.tipo === "hierarquia" ? ((h = this.host.expandedLayers) == null || h.add(m.novoParentId), this.host.dispararEvento("ui-camada-mover-hierarquia", {
|
|
1260
|
-
camadaId: m.camada.id,
|
|
1261
|
-
novoParentId: m.novoParentId,
|
|
1262
|
-
parentAnteriorId: m.parentAnteriorId,
|
|
1263
|
-
camada: m.camada
|
|
1264
|
-
})) : m.parentAnteriorId !== m.novoParentId && this.host.dispararEvento("ui-camada-mover-hierarquia", {
|
|
1265
|
-
camadaId: m.camada.id,
|
|
1266
|
-
novoParentId: m.novoParentId,
|
|
1267
|
-
parentAnteriorId: m.parentAnteriorId,
|
|
1268
|
-
camada: m.camada
|
|
1269
|
-
}), this.aposReordenarCamadas());
|
|
1270
|
-
};
|
|
1271
|
-
this.cancelarToque = () => {
|
|
1272
|
-
d(), this.limparClassesDeArraste();
|
|
1273
|
-
}, window.addEventListener("pointermove", c, { passive: !1 }), window.addEventListener("pointerup", l), window.addEventListener("pointercancel", l);
|
|
1274
|
-
});
|
|
1275
|
-
});
|
|
1276
|
-
}
|
|
1277
|
-
}
|
|
1278
|
-
const st = "ui_camadas_estado_";
|
|
1279
|
-
function dt(e, t) {
|
|
1280
|
-
const a = (e || t || "default").trim();
|
|
1281
|
-
return `${st}${a}`;
|
|
1282
|
-
}
|
|
1283
|
-
function le(e) {
|
|
1284
|
-
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
1285
|
-
}
|
|
1286
|
-
function J(e) {
|
|
1287
|
-
return Array.isArray(e) ? e.filter((t) => typeof t == "string") : [];
|
|
1288
|
-
}
|
|
1289
|
-
function _e(e) {
|
|
1290
|
-
if (!le(e)) return;
|
|
1291
|
-
const t = {};
|
|
1292
|
-
return typeof e.name == "string" && (t.name = e.name), typeof e.visible == "boolean" && (t.visible = e.visible), typeof e.locked == "boolean" && (t.locked = e.locked), typeof e.opacity == "number" && Number.isFinite(e.opacity) && e.opacity >= 0 && e.opacity <= 1 && (t.opacity = e.opacity), typeof e.color == "string" && (t.color = e.color), (typeof e.parentId == "string" || e.parentId === null) && (t.parentId = e.parentId), t;
|
|
1293
|
-
}
|
|
1294
|
-
function ct(e) {
|
|
1295
|
-
if (!le(e)) return null;
|
|
1296
|
-
const t = {};
|
|
1297
|
-
if (le(e.camadasOverrides))
|
|
1298
|
-
for (const [r, i] of Object.entries(e.camadasOverrides)) {
|
|
1299
|
-
const o = _e(i);
|
|
1300
|
-
if (!o) continue;
|
|
1301
|
-
const n = _e(i.origem);
|
|
1302
|
-
t[r] = n ? { ...o, origem: n } : o;
|
|
1303
|
-
}
|
|
1304
|
-
const a = e.altura;
|
|
1305
|
-
return {
|
|
1306
|
-
versao: typeof e.versao == "number" ? e.versao : 1,
|
|
1307
|
-
expandedLayerIds: J(e.expandedLayerIds),
|
|
1308
|
-
collapsedLayerIds: J(e.collapsedLayerIds),
|
|
1309
|
-
camadaAtivaId: typeof e.camadaAtivaId == "string" ? e.camadaAtivaId : null,
|
|
1310
|
-
painelColapsado: typeof e.painelColapsado == "boolean" ? e.painelColapsado : void 0,
|
|
1311
|
-
ordemCamadasIds: J(e.ordemCamadasIds),
|
|
1312
|
-
ordemOrigemIds: Array.isArray(e.ordemOrigemIds) ? J(e.ordemOrigemIds) : void 0,
|
|
1313
|
-
ordemFilhosPorPai: (() => {
|
|
1314
|
-
if (!le(e.ordemFilhosPorPai)) return;
|
|
1315
|
-
const r = {};
|
|
1316
|
-
for (const [i, o] of Object.entries(e.ordemFilhosPorPai)) {
|
|
1317
|
-
const n = J(o);
|
|
1318
|
-
n.length > 0 && (r[i] = n);
|
|
1319
|
-
}
|
|
1320
|
-
return Object.keys(r).length > 0 ? r : void 0;
|
|
1321
|
-
})(),
|
|
1322
|
-
mapaBaseAtivo: typeof e.mapaBaseAtivo == "string" ? e.mapaBaseAtivo : void 0,
|
|
1323
|
-
densidade: e.densidade === "compacto" || e.densidade === "normal" ? e.densidade : void 0,
|
|
1324
|
-
altura: typeof a == "number" && Number.isFinite(a) && a > 0 ? a : null,
|
|
1325
|
-
camadasOverrides: t,
|
|
1326
|
-
ultimaAtualizacao: typeof e.ultimaAtualizacao == "number" ? e.ultimaAtualizacao : void 0
|
|
1327
|
-
};
|
|
1328
|
-
}
|
|
1329
|
-
function Se(e) {
|
|
1330
|
-
if (typeof window > "u" || typeof localStorage > "u")
|
|
1331
|
-
return null;
|
|
1332
|
-
try {
|
|
1333
|
-
const t = localStorage.getItem(e);
|
|
1334
|
-
return t ? ct(JSON.parse(t)) : null;
|
|
1335
|
-
} catch (t) {
|
|
1336
|
-
console.warn(`[UI-Camadas] Não foi possível carregar o estado persistido (${e}):`, t);
|
|
1337
|
-
}
|
|
1338
|
-
return null;
|
|
1339
|
-
}
|
|
1340
|
-
function lt(e, t) {
|
|
1341
|
-
if (!(typeof window > "u" || typeof localStorage > "u"))
|
|
1342
|
-
try {
|
|
1343
|
-
localStorage.setItem(e, JSON.stringify(t));
|
|
1344
|
-
} catch (a) {
|
|
1345
|
-
console.warn(`[UI-Camadas] Não foi possível salvar o estado persistido (${e}):`, a);
|
|
1346
|
-
}
|
|
1347
|
-
}
|
|
1348
|
-
function ut(e) {
|
|
1349
|
-
if (!(typeof window > "u" || typeof localStorage > "u"))
|
|
1350
|
-
try {
|
|
1351
|
-
localStorage.removeItem(e);
|
|
1352
|
-
} catch {
|
|
1353
|
-
}
|
|
1354
|
-
}
|
|
1355
|
-
function ca(e) {
|
|
1356
|
-
return {
|
|
1357
|
-
name: e.name,
|
|
1358
|
-
visible: e.visible !== !1,
|
|
1359
|
-
locked: !!e.locked,
|
|
1360
|
-
opacity: typeof e.opacity == "number" ? e.opacity : 1,
|
|
1361
|
-
color: e.color || "#00E08A",
|
|
1362
|
-
parentId: e.parentId !== void 0 ? e.parentId : null
|
|
1363
|
-
};
|
|
1364
|
-
}
|
|
1365
|
-
function pt(e, t, a, r) {
|
|
1366
|
-
var p;
|
|
1367
|
-
if (!Array.isArray(e)) return;
|
|
1368
|
-
const i = (t == null ? void 0 : t.camadasOverrides) || {}, o = new Set((t == null ? void 0 : t.expandedLayerIds) || []), n = new Set((t == null ? void 0 : t.collapsedLayerIds) || []), s = o.size > 0 || n.size > 0;
|
|
1369
|
-
for (let u = 0; u < e.length; u++) {
|
|
1370
|
-
const f = e[u], m = i[f.id];
|
|
1371
|
-
if (r == null || r.set(f.id, ca(f)), m) {
|
|
1372
|
-
const v = m.origem, h = (g) => {
|
|
1373
|
-
var k;
|
|
1374
|
-
const y = (k = r == null ? void 0 : r.get(f.id)) == null ? void 0 : k[g];
|
|
1375
|
-
return v !== void 0 && v[g] !== y;
|
|
1376
|
-
};
|
|
1377
|
-
typeof m.name == "string" && m.name.trim() && !h("name") && (f.name = m.name), typeof m.visible == "boolean" && !h("visible") && (f.visible = m.visible), typeof m.locked == "boolean" && !h("locked") && (f.locked = m.locked), typeof m.opacity == "number" && !h("opacity") && (f.opacity = m.opacity), typeof m.color == "string" && !h("color") && (f.color = m.color), m.parentId !== void 0 && !h("parentId") && (f.parentId = m.parentId);
|
|
1378
|
-
}
|
|
1379
|
-
s ? o.has(f.id) ? a.add(f.id) : n.has(f.id) ? a.delete(f.id) : a.add(f.id) : a.add(f.id);
|
|
1380
|
-
}
|
|
1381
|
-
for (let u = 0; u < e.length; u++) {
|
|
1382
|
-
const f = e[u];
|
|
1383
|
-
f.parentId && (f.parentId === f.id || G(e, f.parentId, f.id)) && (f.parentId = ((p = r == null ? void 0 : r.get(f.id)) == null ? void 0 : p.parentId) ?? null);
|
|
1384
|
-
}
|
|
1385
|
-
const c = new Set(e.map((u) => u.id)), d = t == null ? void 0 : t.ordemOrigemIds;
|
|
1386
|
-
if (!(Array.isArray(d) && (() => {
|
|
1387
|
-
const u = new Set(d), f = (m) => m.filter((v) => c.has(v) && u.has(v)).join("|");
|
|
1388
|
-
return f(d) !== f(e.map((m) => m.id));
|
|
1389
|
-
})()) && Array.isArray(t == null ? void 0 : t.ordemCamadasIds) && t.ordemCamadasIds.length > 0) {
|
|
1390
|
-
const u = /* @__PURE__ */ new Map();
|
|
1391
|
-
t.ordemCamadasIds.forEach((f, m) => u.set(f, m)), e.sort((f, m) => {
|
|
1392
|
-
const v = u.has(f.id) ? u.get(f.id) : 9999, h = u.has(m.id) ? u.get(m.id) : 9999;
|
|
1393
|
-
return v - h;
|
|
1394
|
-
});
|
|
1395
|
-
}
|
|
1396
|
-
}
|
|
1397
|
-
function ft(e) {
|
|
1398
|
-
const { estadoAnterior: t, camadas: a, expandedLayers: r } = e;
|
|
1399
|
-
let i = (t == null ? void 0 : t.expandedLayerIds) || [], o = (t == null ? void 0 : t.collapsedLayerIds) || [], n = (t == null ? void 0 : t.ordemCamadasIds) || [], s = t == null ? void 0 : t.ordemOrigemIds;
|
|
1400
|
-
const c = {
|
|
1401
|
-
...(t == null ? void 0 : t.camadasOverrides) || {}
|
|
1402
|
-
};
|
|
1403
|
-
a.length > 0 && (i = [], o = [], n = a.map((l) => l.id), s = e.origensCamadas ? [...e.origensCamadas.keys()] : n, a.forEach((l) => {
|
|
1404
|
-
var p, u;
|
|
1405
|
-
r.has(l.id) ? i.push(l.id) : o.push(l.id), c[l.id] = {
|
|
1406
|
-
name: l.name,
|
|
1407
|
-
visible: l.visible !== !1,
|
|
1408
|
-
locked: !!l.locked,
|
|
1409
|
-
opacity: typeof l.opacity == "number" ? l.opacity : 1,
|
|
1410
|
-
color: l.color || "#00E08A",
|
|
1411
|
-
parentId: l.parentId !== void 0 ? l.parentId : null,
|
|
1412
|
-
origem: ((p = e.origensCamadas) == null ? void 0 : p.get(l.id)) ?? ((u = c[l.id]) == null ? void 0 : u.origem)
|
|
1413
|
-
};
|
|
1414
|
-
}));
|
|
1415
|
-
for (const l of e.camadasRemovidas ?? []) delete c[l];
|
|
1416
|
-
let d;
|
|
1417
|
-
return e.ordemFilhosPorPai && e.ordemFilhosPorPai.size > 0 ? (d = {}, e.ordemFilhosPorPai.forEach((l, p) => {
|
|
1418
|
-
l.length > 0 && (d[p] = [...l]);
|
|
1419
|
-
}), Object.keys(d).length === 0 && (d = void 0)) : !a.length && (t != null && t.ordemFilhosPorPai) && (d = t.ordemFilhosPorPai), {
|
|
1420
|
-
versao: 1,
|
|
1421
|
-
expandedLayerIds: i,
|
|
1422
|
-
collapsedLayerIds: o,
|
|
1423
|
-
camadaAtivaId: e.camadaAtivaId,
|
|
1424
|
-
painelColapsado: e.painelColapsado,
|
|
1425
|
-
ordemCamadasIds: n,
|
|
1426
|
-
ordemOrigemIds: s,
|
|
1427
|
-
ordemFilhosPorPai: d,
|
|
1428
|
-
mapaBaseAtivo: e.mapaBaseAtivo,
|
|
1429
|
-
densidade: e.densidade,
|
|
1430
|
-
altura: e.altura,
|
|
1431
|
-
camadasOverrides: c,
|
|
1432
|
-
ultimaAtualizacao: Date.now()
|
|
1433
|
-
};
|
|
1434
|
-
}
|
|
1435
|
-
const mt = `:host{display:flex;flex-direction:column;box-sizing:border-box;font-family:inherit;font-size:11px;color:var(--ui-cor-texto, #e1e1e6);-webkit-user-select:none;user-select:none;width:100%;height:var(--ui-camadas-altura, 100%);min-height:var(--ui-camadas-min-altura, 140px);position:relative;--camada-respiro: 8px;--camada-barra-altura: 28px;--camada-linha-altura: 25px;--camada-thumb-tamanho: 20px;--camada-indent-nivel: 16px;--camada-transicao: .16s cubic-bezier(.16, 1, .3, 1)}:host([densidade="compacto"]){--camada-linha-altura: 22px;--camada-thumb-tamanho: 17px;font-size:10px}:host([flutuante]){position:absolute;top:10px;right:10px;bottom:46px;z-index:var(--ui-z-workspace-hud, 500);width:auto;height:var(--ui-camadas-altura, auto)}*,*:before,*:after{box-sizing:border-box}:host(:not([flutuante])) .ui-camadas-container{max-width:100%;min-width:0;border:none;box-shadow:none;border-radius:0;background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none}:host(:not([flutuante])) .ui-camadas-container[data-borda-canvas=esquerda]{border-left:2px solid var(--ui-camadas-borda-canvas, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 18%, transparent))}:host(:not([flutuante])) .ui-camadas-container[data-borda-canvas=direita]{border-right:2px solid var(--ui-camadas-borda-canvas, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 18%, transparent))}:host(:not([flutuante])) .ui-camadas-container[data-borda-canvas=ambas]{border-left:2px solid var(--ui-camadas-borda-canvas, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 18%, transparent));border-right:2px solid var(--ui-camadas-borda-canvas, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 18%, transparent))}.ui-camadas-container{display:flex;flex-direction:column;flex:1 1 auto;height:100%;min-height:0;width:100%;max-width:380px;min-width:270px;background:var(--ui-degrade-interno, var(--ui-camadas-fundo, var(--ui-fundo-superficie, var(--ui-cor-superficie, #141417))));border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 8px);box-shadow:var(--ui-sombra-lg, 0 10px 30px -4px rgba(0, 0, 0, .5)),0 0 0 1px color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 5%,transparent);overflow:hidden;position:relative;transition:transform .24s cubic-bezier(.16,1,.3,1),opacity .2s ease;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}:host([colapsado]) .ui-camadas-container{transform:translate(calc(100% + 24px));opacity:0;pointer-events:none}.ui-camadas-toggle-flutuante{display:none;position:absolute;top:10px;right:10px;z-index:calc(var(--ui-z-workspace-hud, 500) - 1);background:var(--ui-camadas-toggle-fundo, var(--ui-fundo-superficie, var(--ui-cor-superficie, #141417)));border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .18));border-radius:var(--ui-raio-borda, 6px);color:var(--ui-cor-texto, #ffffff);width:34px;height:34px;cursor:pointer;align-items:center;justify-content:center;box-shadow:var(--ui-sombra-md, 0 8px 20px rgba(0, 0, 0, .45));transition:all var(--camada-transicao)}:host([colapsado][flutuante]) .ui-camadas-toggle-flutuante{display:flex}.ui-camadas-toggle-flutuante:hover{border-color:var(--ui-cor-primaria, #00E08A);color:var(--ui-cor-primaria, #00E08A);transform:scale(1.08);box-shadow:0 0 14px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 35%,transparent)}.ui-camadas-btn-colapsar{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);width:22px;height:22px;cursor:pointer;border-radius:var(--ui-raio-sm, 4px);display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:all var(--camada-transicao)}.ui-camadas-btn-colapsar:hover{color:var(--ui-cor-texto, #ffffff);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .09))}.ui-camadas-corpo{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;padding:0 var(--camada-respiro) var(--camada-respiro);display:flex;flex-direction:column;gap:6px;scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 16%,transparent) transparent}.ui-camadas-corpo::-webkit-scrollbar{width:4px}.ui-camadas-corpo::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 18%,transparent);border-radius:var(--ui-raio-sm, 4px)}.ui-camadas-corpo::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 32%,transparent)}.ui-tree-toolbar{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;height:var(--camada-barra-altura);min-height:var(--camada-barra-altura);flex-shrink:0;margin:0 calc(-1 * var(--camada-respiro));padding:0 var(--camada-respiro);gap:8px;border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .06))}.ui-tree-title-group{display:flex;align-items:center;gap:5px}.ui-tree-section-title{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.6px;color:var(--ui-cor-texto-secundario, #888899)}.ui-tree-count-badge{font-size:9px;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 7%,transparent);color:var(--ui-cor-texto-secundario, #888899);padding:1px 5px;border-radius:8px;border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 6%,transparent)}.ui-tree-actions{display:flex;align-items:center;gap:3px}.ui-tree-action-btn{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);border-radius:var(--ui-raio-sm, 4px);width:24px;height:24px;padding:0;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all var(--camada-transicao)}.ui-tree-action-btn:hover{color:var(--ui-cor-texto, #ffffff);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .09))}.ui-tree-btn-new{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 14%,transparent);border:none;color:var(--ui-cor-primaria, #00E08A);border-radius:var(--ui-raio-sm, 4px);height:24px;padding:0 8px;font-size:10px;font-weight:600;cursor:pointer;display:flex;align-items:center;gap:4px;transition:all var(--camada-transicao)}.ui-tree-btn-new:hover{background:var(--ui-cor-primaria, #00E08A);color:var(--ui-cor-texto-sobre-primaria, #000000)}.ui-tree-search-wrapper{position:relative;display:flex;align-items:center;margin:1px 0}.ui-tree-search-icon{position:absolute;left:8px;color:var(--ui-cor-texto-secundario, #888899);pointer-events:none;display:flex;align-items:center}.ui-tree-search-input{width:100%;height:25px;background:var(--ui-cor-fundo, #0a0a0c);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .1));border-radius:var(--ui-raio-borda, 5px);padding:0 24px 0 26px;color:var(--ui-cor-texto, #ffffff);font-size:10.5px;outline:none;transition:border-color var(--camada-transicao),box-shadow var(--camada-transicao)}.ui-tree-search-input:focus{border-color:var(--ui-cor-primaria, #00E08A);box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 18%,transparent)}.ui-tree-search-clear{position:absolute;right:5px;background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer;width:18px;height:18px;display:flex;align-items:center;justify-content:center;border-radius:3px;transition:all var(--camada-transicao)}.ui-tree-search-clear:hover{color:var(--ui-cor-texto, #ffffff);background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 10%,transparent)}.ui-panel-box{background:var(--ui-cor-fundo, #0c0c0f);border:none;border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));border-radius:0;margin:0 calc(-1 * var(--camada-respiro)) calc(-1 * var(--camada-respiro));overflow:hidden;display:flex;flex-direction:column;flex:1 1 0%;min-height:140px}.ui-search-empty{padding:14px 10px;text-align:center;font-size:11px;color:var(--ui-cor-texto-secundario, #888899);overflow-wrap:anywhere}.ui-layer-tree{flex:1 1 0%;min-height:40px;overflow-y:auto;overflow-x:hidden}.ui-layer-group{border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .04));transition:background var(--camada-transicao)}.ui-layer-group.drop-into{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 9%,transparent)!important;outline:1.5px dashed var(--ui-cor-primaria, #00E08A);outline-offset:-1.5px}.ui-layer-row,.ui-feat-row{display:flex;align-items:center;height:var(--camada-linha-altura);min-height:var(--camada-linha-altura);max-height:var(--camada-linha-altura);padding:0 4px;-webkit-user-select:none;user-select:none;cursor:default;transition:background .1s ease;position:relative}.ui-layer-row{background:var(--ui-cor-fundo-elevado, #18181d);font-weight:600;cursor:pointer;border-left:3px solid transparent}.ui-layer-row:hover{background:var(--ui-cor-hover-menu, #22222a)}.ui-layer-row.active-drawing-layer{background:color-mix(in srgb,var(--layer-active-color, var(--ui-cor-primaria, #00E08A)) 18%,var(--ui-cor-fundo-elevado, #18181d))!important;border-left:3px solid var(--layer-active-color, var(--ui-cor-primaria, #00E08A))!important;box-shadow:inset 0 0 12px color-mix(in srgb,var(--layer-active-color, var(--ui-cor-primaria, #00E08A)) 10%,transparent)}.ui-layer-row.active-drawing-layer .ui-name-text{color:var(--ui-cor-texto, #e1e1e6);font-weight:700}.ui-feat-row{border-left:3px solid transparent;padding-left:13px;background:var(--ui-cor-fundo, #101014);font-weight:400;cursor:pointer}.ui-feat-row:hover{background:var(--ui-cor-hover-menu, #19191f)}.ui-feat-row.selected-row{background:color-mix(in srgb,var(--layer-active-color, var(--ui-cor-texto-info, #33b5ff)) 20%,var(--ui-cor-fundo, #101014))!important;outline:1px solid color-mix(in srgb,var(--layer-active-color, var(--ui-cor-texto-info, #33b5ff)) 55%,transparent)!important;outline-offset:-1px}.ui-layer-row.hidden-layer,.ui-feat-row.hidden-row{opacity:.52}.ui-layer-row.hidden-layer .ui-col-eye,.ui-feat-row.hidden-row .ui-col-eye{color:var(--ui-cor-texto-alerta, #ffb86c);opacity:.95}.ui-layer-row.dragging,.ui-feat-row.dragging{opacity:.35;background:color-mix(in srgb,var(--ui-cor-texto-info, #33b5ff) 16%,transparent)!important}.ui-layer-row.drop-above:before,.ui-feat-row.drop-above:before{content:"";position:absolute;top:0;left:0;right:0;height:2px;background:var(--ui-cor-texto-info, #33b5ff);box-shadow:0 0 8px color-mix(in srgb,var(--ui-cor-texto-info, #33b5ff) 100%,transparent);z-index:20;pointer-events:none}.ui-layer-row.drop-below:after,.ui-feat-row.drop-below:after{content:"";position:absolute;bottom:0;left:0;right:0;height:2px;background:var(--ui-cor-texto-info, #33b5ff);box-shadow:0 0 8px color-mix(in srgb,var(--ui-cor-texto-info, #33b5ff) 100%,transparent);z-index:20;pointer-events:none}.ui-layer-row.drop-into{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 16%,transparent)!important;outline:1.5px dashed var(--ui-cor-primaria, #00E08A)!important;outline-offset:-2px;border-radius:var(--ui-raio-sm, 4px)}.ui-layer-row.is-sublayer{background:color-mix(in srgb,var(--ui-cor-fundo-elevado, #18181d) 70%,transparent)}.ui-group-folder-icon{display:inline-flex;align-items:center;justify-content:center;color:var(--ui-cor-texto-alerta, #ffb86c);margin-right:4px;flex-shrink:0}.ui-col{display:flex;align-items:center;justify-content:center;flex-shrink:0;height:var(--camada-linha-altura)}.ui-col-drag{width:8px;margin-right:1px;cursor:grab;color:var(--ui-cor-texto-secundario, #888899);opacity:.35;touch-action:none;transition:opacity var(--camada-transicao),color var(--camada-transicao)}.ui-layer-row:hover .ui-col-drag,.ui-feat-row:hover .ui-col-drag{opacity:.9;color:var(--ui-cor-primaria, #00E08A)}.ui-col-drag:active{cursor:grabbing}.ui-col-eye{width:20px;cursor:pointer;color:var(--ui-cor-texto-secundario, #888899);transition:color var(--camada-transicao)}.ui-col-eye:hover{color:var(--ui-cor-primaria, #00E08A)}.ui-col-lock{width:18px;cursor:pointer;color:var(--ui-cor-texto-secundario, #888899);transition:color var(--camada-transicao)}.ui-col-lock:hover{color:var(--ui-cor-texto-alerta, #ffb86c)}.ui-col-colorbar{width:5px;height:16px;margin:0 3px 0 2px;border-radius:1.5px;flex-shrink:0}.ui-col-colorbar-editavel{position:relative;width:5px;height:18px;cursor:pointer}.ui-col-colorbar-editavel:before{content:"";position:absolute;top:-3px;right:-4px;bottom:-3px;left:-4px}.ui-col-colorbar-editavel:hover,.ui-col-colorbar-editavel:focus-visible{filter:brightness(1.3);outline:none}.ui-col-chevron,.ui-feat-row .ui-col-thumb{margin-left:calc(var(--layer-depth, 0) * var(--camada-indent-nivel, 16px))}.ui-col-chevron{width:14px;cursor:pointer;color:var(--ui-cor-texto-secundario, #888899);display:flex;align-items:center;justify-content:center}.ui-chevron-icon{display:inline-flex;align-items:center;justify-content:center;transition:transform var(--camada-transicao)}.ui-chevron-icon.open{transform:rotate(90deg)}.ui-col-thumb{width:calc(var(--camada-thumb-tamanho) + 3px);margin-right:4px;display:flex;align-items:center;justify-content:center}.ui-thumb-box{width:var(--camada-thumb-tamanho);height:var(--camada-thumb-tamanho);border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 15%,transparent);border-radius:3px;background:var(--ui-cor-fundo, #0d0d10);box-sizing:border-box;overflow:hidden;display:flex;align-items:center;justify-content:center}.ui-col-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10.5px;color:var(--ui-cor-texto, #e1e1e6);padding-left:2px;padding-right:4px;cursor:pointer;display:flex;align-items:center;justify-content:flex-start;text-align:left;gap:4px}.ui-name-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-count-chip{font-size:9px;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums;color:var(--ui-cor-texto-secundario, #888899);font-weight:400;padding:0 2px;flex-shrink:0}.ui-col-actions{display:flex;align-items:center;gap:2px;opacity:0;transition:opacity var(--camada-transicao)}.ui-layer-row:hover .ui-col-actions,.ui-feat-row:hover .ui-col-actions,.ui-layer-row:focus-within .ui-col-actions,.ui-feat-row:focus-within .ui-col-actions,.ui-col-actions:has(.ui-micro-btn.active){opacity:1}.ui-micro-btn{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);width:18px;height:18px;padding:0;border-radius:3px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all var(--camada-transicao)}.ui-micro-btn:hover{color:var(--ui-cor-primaria, #00E08A);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .12))}.ui-micro-btn.active{color:var(--ui-cor-primaria, #00E08A);background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 18%,transparent)}.ui-col-target{width:22px;cursor:pointer}.ui-target-circle{width:11px;height:11px;border-radius:50%;border:1.5px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 32%,transparent);background:transparent;transition:all .12s ease}.ui-col-target:hover .ui-target-circle{border-color:var(--ui-cor-texto-info, #33b5ff);transform:scale(1.18)}.ui-target-circle.selected{border:2px solid var(--layer-active-color, var(--ui-cor-texto-info, #33b5ff));background:var(--layer-active-color, var(--ui-cor-texto-info, #33b5ff));box-shadow:inset 0 0 0 2px var(--ui-cor-superficie, #141418)}.ui-target-circle.partial{border:2px solid var(--layer-active-color, var(--ui-cor-texto-info, #33b5ff));background:color-mix(in srgb,var(--layer-active-color, var(--ui-cor-texto-info, #33b5ff)) 40%,transparent)}.ui-inline-rename-input{width:100%;height:20px;background:var(--ui-cor-fundo, #0d0d10);color:var(--ui-cor-texto, #e1e1e6);border:1px solid var(--ui-cor-primaria, #00E08A);border-radius:3px;font-size:10.5px;padding:0 4px;outline:none;box-shadow:0 0 8px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 40%,transparent)}.ui-layer-settings-drawer{background:linear-gradient(180deg,var(--ui-cor-fundo-elevado, #17171e) 0%,var(--ui-cor-superficie, #0f0f13) 100%);padding:10px 14px 12px;border-top:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);border-bottom:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 12%,transparent);border-left:3px solid var(--drawer-cor-camada, var(--ui-cor-primaria, #00E08A));display:flex;flex-direction:column;gap:10px;box-shadow:inset 0 1px color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 6%,transparent),0 6px 16px #00000073;animation:drawerSlideDown .18s cubic-bezier(.16,1,.3,1);position:relative;z-index:10}@keyframes drawerSlideDown{0%{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}.ui-drawer-header{display:flex;align-items:center;justify-content:space-between;padding-bottom:6px;border-bottom:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 7%,transparent)}.ui-drawer-header-left{display:flex;align-items:center;gap:7px;min-width:0}.ui-drawer-icon{color:var(--drawer-cor-camada, var(--ui-cor-primaria, #00E08A));display:flex;align-items:center;flex-shrink:0}.ui-drawer-title{font-size:10.5px;font-weight:700;color:var(--ui-cor-texto, #e1e1e6);text-transform:uppercase;letter-spacing:.6px;white-space:nowrap}.ui-drawer-layer-chip{font-size:9.5px;font-weight:500;color:var(--ui-cor-texto-secundario, #888899);background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 7%,transparent);padding:1px 6px;border-radius:var(--ui-raio-sm, 4px);border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-drawer-btn-fechar{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);width:20px;height:20px;padding:0;border-radius:var(--ui-raio-sm, 4px);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all var(--camada-transicao)}.ui-drawer-btn-fechar:hover{color:var(--ui-cor-texto, #e1e1e6);background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 12%,transparent)}.ui-drawer-body{display:flex;flex-direction:column;gap:10px}.ui-drawer-row{display:flex;flex-direction:column;gap:5px}.ui-drawer-row-label{display:flex;justify-content:space-between;align-items:center;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.4px;color:var(--ui-cor-texto-secundario, #888899)}.ui-drawer-color-group{display:flex;align-items:center;justify-content:space-between;gap:8px}.ui-drawer-color-pill{position:relative;display:inline-flex;align-items:center;gap:6px;padding:3px 8px 3px 5px;background:var(--ui-cor-fundo, #0b0b0d);border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 16%,transparent);border-radius:var(--ui-raio-sm, 4px);cursor:pointer;transition:all var(--camada-transicao);-webkit-user-select:none;user-select:none}.ui-drawer-color-pill:hover{border-color:var(--drawer-cor-camada, var(--ui-cor-primaria, #00E08A));background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);box-shadow:0 0 10px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 25%,transparent)}.ui-drawer-color-sample{width:14px;height:14px;border-radius:3px;border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 35%,transparent);box-shadow:var(--ui-sombra-sm, 0 1px 3px rgba(0, 0, 0, .5));flex-shrink:0;transition:background-color .1s ease}.ui-drawer-color-hex{font-size:10px;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums;font-weight:700;color:var(--ui-cor-texto, #e1e1e6);letter-spacing:.5px}.ui-drawer-color-native{position:absolute;opacity:0;width:0;height:0;pointer-events:none}.ui-drawer-badge{font-size:9.5px;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums;font-weight:700;color:var(--ui-cor-texto, #e1e1e6);background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 10%,transparent);padding:1px 6px;border-radius:var(--ui-raio-sm, 4px);border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 12%,transparent)}.ui-drawer-slider-container{display:flex;flex-direction:column;gap:4px}.ui-drawer-slider{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;height:5px;background:linear-gradient(90deg,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent) 0%,var(--drawer-cor-camada, var(--ui-cor-primaria, #00E08A)) 100%);border-radius:3px;outline:none;margin:3px 0;cursor:pointer;border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 12%,transparent)}.ui-drawer-slider::-webkit-slider-thumb{-webkit-appearance:none;width:14px;height:14px;border-radius:50%;background:#fff;border:3px solid var(--drawer-cor-camada, var(--ui-cor-primaria, #00E08A));box-shadow:0 0 6px #0009,0 0 10px var(--drawer-cor-camada, rgba(0, 224, 138, .6));cursor:pointer;transition:transform .12s ease}.ui-drawer-slider::-webkit-slider-thumb:hover{transform:scale(1.22)}.ui-drawer-slider::-moz-range-thumb{width:14px;height:14px;border-radius:50%;background:#fff;border:3px solid var(--drawer-cor-camada, var(--ui-cor-primaria, #00E08A));box-shadow:0 0 6px #0009,0 0 10px var(--drawer-cor-camada, rgba(0, 224, 138, .6));cursor:pointer}.ui-drawer-footer{display:flex;align-items:center;justify-content:space-between;padding-top:8px;border-top:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 7%,transparent)}.ui-drawer-meta-info{font-size:9.5px;color:var(--ui-cor-texto-secundario, #888899);font-style:italic}.ui-drawer-actions{display:flex;align-items:center;gap:6px}.ui-drawer-btn-danger{background:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 10%,transparent);border:1px solid color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 35%,transparent);color:var(--ui-cor-texto-erro, #ff5555);border-radius:var(--ui-raio-sm, 4px);height:24px;padding:0 10px;font-size:10px;font-weight:600;cursor:pointer;display:inline-flex;align-items:center;gap:5px;transition:all var(--camada-transicao)}.ui-drawer-btn-danger:hover{background:var(--ui-cor-botao-destrutivo-fundo, #d32f2f);color:var(--ui-cor-botao-destrutivo-texto, #ffffff);border-color:var(--ui-cor-botao-destrutivo-fundo, #d32f2f);box-shadow:0 0 10px color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 45%,transparent);transform:translateY(-.5px)}.ui-drawer-btn-danger.confirming{background:var(--ui-cor-botao-destrutivo-hover, #b71c1c);color:var(--ui-cor-botao-destrutivo-texto, #ffffff);border-color:var(--ui-cor-botao-destrutivo-hover, #b71c1c);animation:pulseDanger 1.2s infinite}@keyframes pulseDanger{0%{transform:scale(1)}50%{transform:scale(1.02)}to{transform:scale(1)}}.ui-previa-dot{width:6px;height:6px;margin-left:4px;border-radius:50%;flex-shrink:0;background:var(--ui-cor-texto-alerta, #ffb86c);box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-texto-alerta, #ffb86c) 25%,transparent)}.ui-tree-footer{height:var(--camada-barra-altura);min-height:var(--camada-barra-altura);background:var(--ui-cor-fundo-elevado, #121216);border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));display:flex;align-items:center;justify-content:space-between;padding:0 var(--camada-respiro);gap:6px;box-sizing:border-box;overflow:hidden;position:relative;flex-shrink:0;margin:0 calc(-1 * var(--camada-respiro))}.ui-footer-left{display:flex;align-items:center;gap:5px;white-space:nowrap;min-width:0;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis}.ui-footer-count{font-size:11px;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums;font-weight:700;color:var(--ui-cor-primaria, #00E08A);flex-shrink:0}.ui-footer-label{display:inline-flex;align-items:center;color:var(--ui-cor-texto-secundario, #888899);flex-shrink:0}.ui-footer-actions-gerais{display:flex;align-items:center;gap:4px;flex-shrink:0}.ui-footer-chip-btn{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 6%,transparent);border:none;color:var(--ui-cor-texto-secundario, #a0a0b0);font-size:10px;font-weight:600;height:22px;padding:0 8px;border-radius:var(--ui-raio-sm, 4px);cursor:pointer;display:inline-flex;align-items:center;gap:4px;transition:all var(--camada-transicao)}.ui-footer-chip-btn:hover{background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .12));color:var(--ui-cor-texto, #ffffff)}.ui-footer-chip-btn.primario{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 14%,transparent);color:var(--ui-cor-primaria, #00E08A)}.ui-footer-chip-btn.primario:hover{background:var(--ui-cor-primaria, #00E08A);color:var(--ui-cor-texto-sobre-primaria, #000000)}.ui-footer-right{display:flex;align-items:center;gap:4px;flex:1 1 auto;min-width:0}.ui-footer-btn{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);width:22px;height:22px;padding:0;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:all var(--camada-transicao);flex-shrink:0}.ui-footer-btn:hover:not(.disabled){color:var(--ui-cor-texto, #e1e1e6);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .12))}.ui-footer-btn.disabled{opacity:.25;cursor:not-allowed}.ui-footer-btn.btn-danger-footer:hover:not(.disabled){color:var(--ui-cor-texto-erro, #ff5555);background:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 15%,transparent)}.ui-footer-btn.confirming{background:var(--ui-cor-botao-destrutivo-hover, #b71c1c)!important;color:var(--ui-cor-botao-destrutivo-texto, #ffffff)!important}.ui-footer-move-wrapper{position:relative;display:flex;align-items:center;flex:1 1 auto;min-width:0}.ui-footer-select{-moz-appearance:none;appearance:none;-webkit-appearance:none;--_chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888899' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");background:var(--_chevron) right 6px center / 10px no-repeat,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 6%,transparent);border:none;color:var(--ui-cor-texto, #e1e1e6);border-radius:var(--ui-raio-sm, 4px);font:inherit;font-size:10px;font-weight:500;height:22px;padding:0 22px 0 8px;cursor:pointer;width:100%;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-footer-select:hover:not(:disabled){background:var(--_chevron) right 6px center / 10px no-repeat,var(--ui-cor-hover-menu, rgba(255, 255, 255, .12))}.ui-footer-select:focus-visible{outline:1px solid var(--ui-cor-primaria, #00E08A)}.ui-drawer-btn-sublayer{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 6%,transparent);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));color:var(--ui-cor-texto, #e1e1e6);font-size:10.5px;font-weight:500;padding:4px 8px;border-radius:4px;cursor:pointer;display:inline-flex;align-items:center;gap:4px;transition:all var(--camada-transicao)}.ui-drawer-btn-sublayer:hover{background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .12));color:var(--ui-cor-primaria, #00E08A);border-color:var(--ui-cor-primaria, #00E08A)}.ui-drawer-select-wrapper{display:flex;align-items:center}.ui-drawer-select{background:var(--ui-cor-fundo, #16161c);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .15));color:var(--ui-cor-texto, #e1e1e6);border-radius:4px;font-size:10.5px;height:24px;padding:0 6px;cursor:pointer;max-width:140px}.ui-basemap-section{display:flex;flex-direction:column;gap:4px;flex-shrink:0}.ui-basemap-toggle{display:flex;align-items:center;gap:6px;width:100%;padding:2px;background:transparent;border:0;border-radius:var(--ui-raio-sm, 4px);font:inherit;color:inherit;cursor:pointer;text-align:left}.ui-basemap-toggle:hover .ui-basemap-title{color:var(--ui-cor-texto, #e1e1e6)}.ui-basemap-toggle:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:1px}.ui-basemap-atual{flex:1 1 auto;min-width:0;font-size:10px;color:var(--ui-cor-primaria, #00E08A);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:right}.ui-basemap-title{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.6px;color:var(--ui-cor-texto-secundario, #888899)}.ui-basemap-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:4px}.ui-basemap-section{container-type:inline-size}@container (min-width: 260px){.ui-basemap-grid{grid-template-columns:repeat(3,1fr)}}@container (min-width: 340px){.ui-basemap-grid{grid-template-columns:repeat(4,1fr)}}.ui-basemap-card{display:flex;flex-direction:column;align-items:center;gap:2px;padding:3px;border-radius:var(--ui-raio-borda, 5px);background:var(--ui-cor-fundo, #101014);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));cursor:pointer;transition:all var(--camada-transicao);text-align:center;overflow:hidden}.ui-basemap-card:hover{border-color:var(--ui-cor-primaria, #00E08A);background:var(--ui-cor-fundo-elevado, #17171c)}.ui-basemap-card.active{border-color:var(--ui-cor-primaria, #00E08A);background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 12%,transparent);color:var(--ui-cor-primaria, #00E08A);font-weight:600;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 35%,transparent)}.ui-basemap-preview{width:100%;height:22px;border-radius:3px;object-fit:cover;opacity:.85;transition:opacity var(--camada-transicao)}.ui-basemap-preview-none{width:100%;height:22px;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 4%,transparent);border-radius:3px;color:var(--ui-cor-texto-secundario, #888899)}.ui-basemap-card:hover .ui-basemap-preview,.ui-basemap-card.active .ui-basemap-preview{opacity:1}.ui-basemap-card span{font-size:9.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.ui-layer-row.herdado-oculto,.ui-feat-row.herdado-oculto{opacity:.52}.ui-layer-row.herdado-travado .ui-col-lock.ui-lock-open{color:var(--ui-cor-texto-secundario, #888899);opacity:.7}.ui-search-hidden{display:none!important}.ui-empty-row{height:22px;display:flex;align-items:center;padding-left:36px;font-size:10px;color:var(--ui-cor-texto-secundario, #666677);font-style:italic;background:var(--ui-cor-fundo-recuado, rgba(0, 0, 0, .15))}.ui-camadas-resizer-altura{display:none;flex-shrink:0;width:100%;height:9px;background:var(--ui-cor-superficie, #141417);border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));cursor:ns-resize;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;touch-action:none;transition:background .15s ease,border-color .15s ease;position:relative;z-index:10}:host([redimensionavel]) .ui-camadas-resizer-altura,:host([redimensionavel-altura]) .ui-camadas-resizer-altura{display:flex}.ui-camadas-resizer-altura:hover,.ui-camadas-resizer-altura.ui-camadas-resizer--ativo{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 9%,transparent);border-top-color:var(--ui-cor-primaria, #00E08A)}.ui-camadas-resizer-grip{width:32px;height:3px;border-radius:2px;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 22%,transparent);transition:all .15s ease}.ui-camadas-resizer-altura:hover .ui-camadas-resizer-grip,.ui-camadas-resizer-altura.ui-camadas-resizer--ativo .ui-camadas-resizer-grip{background:var(--ui-cor-primaria, #00E08A);width:46px;box-shadow:0 0 8px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 45%,transparent)}:host(.ui-camadas--redimensionando){-webkit-user-select:none!important;user-select:none!important;cursor:ns-resize!important}:host(.ui-camadas--redimensionando) *{-webkit-user-select:none!important;user-select:none!important}.ui-col-lock.ui-lock-open{opacity:.28}.ui-col-lock.ui-lock-open:hover,.ui-col-lock.ui-lock-open:focus-visible{opacity:.8}.ui-col-lock[data-locked-by-layer]{cursor:not-allowed}.ui-col[role=button]:focus-visible,.ui-basemap-card:focus-visible,.ui-feat-row:focus-visible,.ui-layer-row:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:-2px}.ui-footer-btn.confirming{color:var(--ui-cor-botao-destrutivo-texto, #ffffff);background:var(--ui-cor-botao-destrutivo-hover, #b71c1c);width:auto;padding:0 6px}.ui-truncate-notice{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 12px;margin:4px 8px 6px;background:color-mix(in srgb,var(--ui-cor-fundo-elevado, #1a1a1e) 70%,transparent);border:1px dashed var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 4px);font-size:10px;color:var(--ui-cor-texto-secundario, #9696a6)}.ui-truncate-notice span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-truncate-more-btn{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;background:var(--ui-cor-superficie, #141417);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .18));border-radius:var(--ui-raio-borda, 4px);color:var(--ui-cor-primaria, #00E08A);font-size:10px;font-weight:500;cursor:pointer;white-space:nowrap;transition:all var(--camada-transicao)}.ui-truncate-more-btn:hover{background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08));border-color:var(--ui-cor-primaria, #00E08A)}.ui-truncate-more-btn:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:1px}:host(.degrade),:host(.gradiente),:host([data-degrade]:not([data-degrade="false"])),.ui-camadas-container[data-degrade]:not([data-degrade=false]){--ui-camadas-fundo: var(--ui-gradiente-superficie);--ui-camadas-toggle-fundo: var(--ui-gradiente-superficie)}`;
|
|
1436
|
-
function gt(e, t) {
|
|
1437
|
-
t.querySelectorAll("[data-layer-row]").forEach((r) => {
|
|
1438
|
-
const o = r.getAttribute("data-layer-row") === e.camadaAtivaId;
|
|
1439
|
-
r.classList.toggle("active-drawing-layer", o), Ke(r, "camada-ativa", o), o ? r.setAttribute("aria-current", "true") : r.removeAttribute("aria-current");
|
|
1440
|
-
});
|
|
1441
|
-
}
|
|
1442
|
-
function vt(e, t) {
|
|
1443
|
-
t.querySelectorAll(".ui-feat-row").forEach((a) => {
|
|
1444
|
-
const r = a.getAttribute("data-feat-row"), i = r ? e.selectedFeatureIds.has(r) : !1;
|
|
1445
|
-
a.classList.toggle("selected-row", i), Ke(a, "feicao-selecionada", i), a.setAttribute("aria-selected", String(i));
|
|
1446
|
-
const o = a.querySelector(".ui-target-circle");
|
|
1447
|
-
o && o.classList.toggle("selected", i);
|
|
1448
|
-
}), t.querySelectorAll(".ui-layer-group").forEach((a) => {
|
|
1449
|
-
const r = a.getAttribute("data-layer-id"), i = re(e.camadas, e.feicoes, r ?? ""), o = Z(i, e.searchQuery);
|
|
1450
|
-
la(a.querySelector(".ui-layer-row .ui-target-circle"), o, e.selectedFeatureIds);
|
|
1451
|
-
}), ua(e, t);
|
|
1452
|
-
}
|
|
1453
|
-
function la(e, t, a) {
|
|
1454
|
-
if (!e) return;
|
|
1455
|
-
if (t.length === 0) {
|
|
1456
|
-
e.classList.remove("selected", "partial");
|
|
1457
|
-
return;
|
|
1458
|
-
}
|
|
1459
|
-
const r = t.every((o) => a.has(o.id)), i = !r && t.some((o) => a.has(o.id));
|
|
1460
|
-
e.classList.toggle("selected", r), e.classList.toggle("partial", i);
|
|
1461
|
-
}
|
|
1462
|
-
function ua(e, t) {
|
|
1463
|
-
const a = e.feicoes.filter((p) => e.selectedFeatureIds.has(p.id)), r = a.length > 0, i = t.getElementById("footer-count"), o = t.getElementById("footer-label");
|
|
1464
|
-
if (i && (i.textContent = String(r ? a.length : e.camadas.length)), o) {
|
|
1465
|
-
const p = Ze(e.camadas.length, a.length);
|
|
1466
|
-
o.innerHTML = p.icone, o.title = p.texto, o.setAttribute("aria-label", p.texto);
|
|
1467
|
-
}
|
|
1468
|
-
const n = t.querySelector(".ui-tree-footer");
|
|
1469
|
-
n && (n.classList.toggle("tem-selecao", r), n.classList.toggle("sem-selecao", !r));
|
|
1470
|
-
const s = t.querySelector(".ui-footer-actions-gerais");
|
|
1471
|
-
s && (s.style.display = r ? "none" : "flex");
|
|
1472
|
-
const c = t.querySelector(".ui-footer-bulk-actions");
|
|
1473
|
-
c && (c.style.display = r ? "flex" : "none"), ["btn-footer-del"].forEach((p) => {
|
|
1474
|
-
const u = t.getElementById(p);
|
|
1475
|
-
u && (u.disabled = !r, u.classList.toggle("disabled", !r));
|
|
1476
|
-
});
|
|
1477
|
-
const d = t.querySelector(".ui-footer-move-wrapper");
|
|
1478
|
-
d && d.classList.toggle("disabled", !r);
|
|
1479
|
-
const l = t.getElementById("select-footer-move");
|
|
1480
|
-
l && (l.disabled = !r);
|
|
1481
|
-
}
|
|
1482
|
-
function Ye(e, t) {
|
|
1483
|
-
const a = ge(e.camadas), r = new Map(e.camadas.map((n) => [n.id, n]));
|
|
1484
|
-
t.querySelectorAll(".ui-layer-row").forEach((n) => {
|
|
1485
|
-
const s = a.get(n.getAttribute("data-layer-row") || "");
|
|
1486
|
-
n.classList.toggle("herdado-oculto", (s == null ? void 0 : s.ocultaPorAncestral) === !0), n.classList.toggle("herdado-travado", (s == null ? void 0 : s.travadaPorAncestral) === !0);
|
|
1487
|
-
});
|
|
1488
|
-
const i = new Map(e.feicoes.map((n) => [n.id, n]));
|
|
1489
|
-
t.querySelectorAll(".ui-feat-row").forEach((n) => {
|
|
1490
|
-
const s = n.getAttribute("data-feat-layer") || "", c = r.get(s), d = a.get(s);
|
|
1491
|
-
n.classList.toggle("herdado-oculto", (c == null ? void 0 : c.visible) === !1 || (d == null ? void 0 : d.ocultaPorAncestral) === !0);
|
|
1492
|
-
const l = n.querySelector("[data-feat-lock]"), p = i.get(n.getAttribute("data-feat-row") || "");
|
|
1493
|
-
if (!l || !p) return;
|
|
1494
|
-
const u = (c == null ? void 0 : c.locked) === !0 || (d == null ? void 0 : d.travadaPorAncestral) === !0, f = p.locked === !0 || u;
|
|
1495
|
-
l.innerHTML = f ? b.cadeadoTrancado : b.cadeadoAberto, l.classList.toggle("ui-lock-open", !f), u ? l.setAttribute("data-locked-by-layer", "true") : l.removeAttribute("data-locked-by-layer"), R(
|
|
1496
|
-
l,
|
|
1497
|
-
u ? "Bloqueada pela camada" : f ? "Desbloquear Feição" : "Bloquear Feição"
|
|
1498
|
-
);
|
|
1499
|
-
});
|
|
1500
|
-
const o = t.getElementById("select-footer-move");
|
|
1501
|
-
o && (o.innerHTML = `<option value="" disabled selected>Mover para...</option>${Je(e.camadas)}`);
|
|
1502
|
-
}
|
|
1503
|
-
function ht(e, t) {
|
|
1504
|
-
t.querySelectorAll("[data-layer-row]").forEach((i) => {
|
|
1505
|
-
i.addEventListener("click", (o) => {
|
|
1506
|
-
if (o.target.closest(
|
|
1507
|
-
"[data-layer-eye], [data-layer-lock], [data-layer-expand], [data-layer-target], [data-layer-fit], [data-layer-settings], [data-layer-color], input, button"
|
|
1508
|
-
))
|
|
1509
|
-
return;
|
|
1510
|
-
const s = i.getAttribute("data-layer-row");
|
|
1511
|
-
s && e.definirCamadaAtiva(s, !0);
|
|
1512
|
-
});
|
|
1513
|
-
}), t.querySelectorAll("[data-layer-expand]").forEach((i) => {
|
|
1514
|
-
i.addEventListener("click", (o) => {
|
|
1515
|
-
o.stopPropagation();
|
|
1516
|
-
const n = i.getAttribute("data-layer-expand");
|
|
1517
|
-
if (!n) return;
|
|
1518
|
-
e.expandedLayers.has(n) ? e.expandedLayers.delete(n) : e.expandedLayers.add(n);
|
|
1519
|
-
const s = i.closest(".ui-layer-group"), c = i.querySelector(".ui-chevron-icon"), d = e.expandedLayers.has(n);
|
|
1520
|
-
if (c && c.classList.toggle("open", d), s) {
|
|
1521
|
-
s.setAttribute("aria-expanded", String(d));
|
|
1522
|
-
const l = s.querySelector(".ui-children-container");
|
|
1523
|
-
l && (l.style.display = d ? "block" : "none");
|
|
1524
|
-
}
|
|
1525
|
-
R(i, d ? "Recolher grupo" : "Expandir grupo"), bt(e, t), e.salvarLembrancaEstado();
|
|
1526
|
-
});
|
|
1527
|
-
}), t.querySelectorAll("[data-layer-eye]").forEach((i) => {
|
|
1528
|
-
i.addEventListener("click", (o) => {
|
|
1529
|
-
o.stopPropagation();
|
|
1530
|
-
const n = i.getAttribute("data-layer-eye"), s = e.camadas.find((c) => c.id === n);
|
|
1531
|
-
if (s) {
|
|
1532
|
-
s.visible = s.visible === !1;
|
|
1533
|
-
const c = s.visible !== !1;
|
|
1534
|
-
i.innerHTML = c ? b.olhoAberto : b.olhoFechado, R(i, c ? "Ocultar Camada" : "Exibir Camada");
|
|
1535
|
-
const d = i.closest(".ui-layer-row");
|
|
1536
|
-
d && d.classList.toggle("hidden-layer", !c), yt(e, t), Ye(e, t), e.salvarLembrancaEstado(), e.dispararEvento("ui-camada-visibilidade", {
|
|
1537
|
-
camadaId: s.id,
|
|
1538
|
-
visivel: c
|
|
1539
|
-
});
|
|
1540
|
-
}
|
|
1541
|
-
});
|
|
1542
|
-
}), t.querySelectorAll("[data-layer-lock]").forEach((i) => {
|
|
1543
|
-
i.addEventListener("click", (o) => {
|
|
1544
|
-
o.stopPropagation();
|
|
1545
|
-
const n = i.getAttribute("data-layer-lock"), s = e.camadas.find((c) => c.id === n);
|
|
1546
|
-
s && (s.locked = !s.locked, i.innerHTML = s.locked ? b.cadeadoTrancado : b.cadeadoAberto, i.classList.toggle("ui-lock-open", !s.locked), R(i, s.locked ? "Desbloquear Camada" : "Bloquear Camada"), Ye(e, t), e.salvarLembrancaEstado(), e.dispararEvento("ui-camada-bloqueio", {
|
|
1547
|
-
camadaId: s.id,
|
|
1548
|
-
bloqueado: s.locked
|
|
1549
|
-
}));
|
|
1550
|
-
});
|
|
1551
|
-
}), t.querySelectorAll("[data-layer-fit]").forEach((i) => {
|
|
1552
|
-
i.addEventListener("click", (o) => {
|
|
1553
|
-
o.stopPropagation();
|
|
1554
|
-
const n = i.getAttribute("data-layer-fit");
|
|
1555
|
-
n && e.dispararEvento("ui-camada-enquadrar", { camadaId: n });
|
|
1556
|
-
});
|
|
1557
|
-
}), t.querySelectorAll("[data-layer-settings]").forEach((i) => {
|
|
1558
|
-
i.addEventListener("click", (o) => {
|
|
1559
|
-
o.stopPropagation();
|
|
1560
|
-
const n = i.getAttribute("data-layer-settings");
|
|
1561
|
-
e.activeSettingsLayerId = e.activeSettingsLayerId === n ? null : n, e.solicitarRenderizacao();
|
|
1562
|
-
});
|
|
1563
|
-
}), t.querySelectorAll("[data-layer-settings-close]").forEach((i) => {
|
|
1564
|
-
i.addEventListener("click", (o) => {
|
|
1565
|
-
o.stopPropagation(), e.activeSettingsLayerId = null, e.solicitarRenderizacao();
|
|
1566
|
-
});
|
|
1567
|
-
});
|
|
1568
|
-
const a = (i, o, n) => {
|
|
1569
|
-
const s = e.camadas.find((f) => f.id === i);
|
|
1570
|
-
if (!s) return;
|
|
1571
|
-
const c = W(o, s.color || "#00E08A");
|
|
1572
|
-
s.color = c;
|
|
1573
|
-
const d = t.getElementById(`sample-color-${i}`);
|
|
1574
|
-
d && (d.style.backgroundColor = c);
|
|
1575
|
-
const l = t.getElementById(`hex-color-${i}`);
|
|
1576
|
-
l && (l.textContent = c.toUpperCase());
|
|
1577
|
-
const p = t.getElementById(`settings-drawer-${i}`);
|
|
1578
|
-
p && p.style.setProperty("--drawer-cor-camada", c);
|
|
1579
|
-
const u = O(t, "data-layer-row", i);
|
|
1580
|
-
if (u) {
|
|
1581
|
-
const f = u.closest(".ui-layer-group");
|
|
1582
|
-
f == null || f.style.setProperty("--layer-active-color", c);
|
|
1583
|
-
const m = f == null ? void 0 : f.querySelector(":scope > .ui-children-container");
|
|
1584
|
-
m == null || m.style.setProperty("--parent-layer-color", c);
|
|
1585
|
-
const v = u.querySelector(".ui-col-colorbar");
|
|
1586
|
-
v && (v.style.backgroundColor = c);
|
|
1587
|
-
const h = new Map(e.feicoes.map((g) => [g.id, g]));
|
|
1588
|
-
f == null || f.querySelectorAll(".ui-feat-row").forEach((g) => {
|
|
1589
|
-
if (g.getAttribute("data-feat-layer") !== i) return;
|
|
1590
|
-
const y = g.querySelector(".ui-col-colorbar");
|
|
1591
|
-
y && (y.style.backgroundColor = c);
|
|
1592
|
-
const k = h.get(g.getAttribute("data-feat-row") || "");
|
|
1593
|
-
if (!k || k.color) return;
|
|
1594
|
-
const L = g.querySelector(".ui-thumb-box");
|
|
1595
|
-
L && (L.innerHTML = aa(k.type || k.geometryType, c, k.coordinates));
|
|
1596
|
-
});
|
|
1597
|
-
}
|
|
1598
|
-
n ? e.salvarLembrancaEstado() : e.agendarSalvarLembranca(), e.dispararEvento("ui-camada-cor", { camadaId: s.id, cor: c });
|
|
1599
|
-
};
|
|
1600
|
-
t.querySelectorAll("[data-layer-color-picker]").forEach((i) => {
|
|
1601
|
-
const o = i, n = (s) => (c) => {
|
|
1602
|
-
const d = o.getAttribute("data-layer-color-picker");
|
|
1603
|
-
if (!d) return;
|
|
1604
|
-
const l = c.target.value;
|
|
1605
|
-
a(d, l, s);
|
|
1606
|
-
};
|
|
1607
|
-
o.addEventListener("input", n(!1)), o.addEventListener("change", n(!0));
|
|
1608
|
-
}), t.querySelectorAll("[data-layer-color]").forEach((i) => {
|
|
1609
|
-
const o = (n) => {
|
|
1610
|
-
n.stopPropagation();
|
|
1611
|
-
const s = i.getAttribute("data-layer-color"), c = e.camadas.find((d) => d.id === s);
|
|
1612
|
-
!s || !c || Ta({
|
|
1613
|
-
ancora: i,
|
|
1614
|
-
titulo: `Cor · ${c.name || "Camada"}`,
|
|
1615
|
-
modo: "simples",
|
|
1616
|
-
cor: W(c.color, "#00E08A"),
|
|
1617
|
-
mostrarOpacidade: !1,
|
|
1618
|
-
aoAlterar: (d) => a(s, d.cor, !1),
|
|
1619
|
-
aoConfirmar: (d) => a(s, d.cor, !0),
|
|
1620
|
-
aoCancelar: (d) => a(s, d.cor, !0)
|
|
1621
|
-
});
|
|
1622
|
-
};
|
|
1623
|
-
i.addEventListener("click", o), i.addEventListener("keydown", (n) => {
|
|
1624
|
-
const s = n.key;
|
|
1625
|
-
(s === "Enter" || s === " ") && (n.preventDefault(), o(n));
|
|
1626
|
-
});
|
|
1627
|
-
});
|
|
1628
|
-
const r = (i, o) => {
|
|
1629
|
-
const n = e.camadas.find((d) => d.id === i);
|
|
1630
|
-
if (!n) return;
|
|
1631
|
-
n.opacity = o;
|
|
1632
|
-
const s = t.getElementById(`badge-op-${i}`);
|
|
1633
|
-
s && (s.textContent = `${Math.round(o * 100)}%`);
|
|
1634
|
-
const c = O(t, "data-layer-opacity-slider", i);
|
|
1635
|
-
c && parseFloat(c.value) !== o && (c.value = String(o)), e.agendarSalvarLembranca(), e.dispararEvento("ui-camada-opacidade", { camadaId: n.id, opacidade: o });
|
|
1636
|
-
};
|
|
1637
|
-
t.querySelectorAll("[data-layer-opacity-slider]").forEach((i) => {
|
|
1638
|
-
i.addEventListener("input", (o) => {
|
|
1639
|
-
const n = i.getAttribute("data-layer-opacity-slider");
|
|
1640
|
-
if (!n) return;
|
|
1641
|
-
const s = parseFloat(o.target.value);
|
|
1642
|
-
Number.isFinite(s) && r(n, Math.min(1, Math.max(0, s)));
|
|
1643
|
-
});
|
|
1644
|
-
}), t.querySelectorAll("[data-delete-layer]").forEach((i) => {
|
|
1645
|
-
let o = null;
|
|
1646
|
-
const n = () => {
|
|
1647
|
-
o && (clearTimeout(o), o = null), i.classList.remove("confirming");
|
|
1648
|
-
const s = i.querySelector(".ui-btn-label");
|
|
1649
|
-
s && (s.textContent = "Excluir");
|
|
1650
|
-
};
|
|
1651
|
-
i.addEventListener("ui-cancelar-confirmacao", n), i.addEventListener("click", (s) => {
|
|
1652
|
-
s.stopPropagation();
|
|
1653
|
-
const c = i.getAttribute("data-delete-layer");
|
|
1654
|
-
if (!c) return;
|
|
1655
|
-
if (i.classList.contains("confirming")) {
|
|
1656
|
-
n(), e.dispararEvento("ui-camada-excluida", { camadaId: c });
|
|
1657
|
-
const l = e.selectedFeatureIds.size;
|
|
1658
|
-
e.camadas.forEach((p) => {
|
|
1659
|
-
p.parentId === c && (p.parentId = null);
|
|
1660
|
-
}), e.removerCamada(c), e.selectedFeatureIds.size !== l && e.notificarMudancaSelecao();
|
|
1661
|
-
} else {
|
|
1662
|
-
i.classList.add("confirming");
|
|
1663
|
-
const l = i.querySelector(".ui-btn-label");
|
|
1664
|
-
l && (l.textContent = "Confirmar Exclusão?"), o = setTimeout(n, 3500);
|
|
1665
|
-
}
|
|
1666
|
-
});
|
|
1667
|
-
}), t.querySelectorAll("[data-layer-parent-select]").forEach((i) => {
|
|
1668
|
-
i.addEventListener("change", (o) => {
|
|
1669
|
-
const n = o.target, s = n.getAttribute("data-layer-parent-select"), c = n.value || null, d = e.camadas.find((l) => l.id === s);
|
|
1670
|
-
if (d) {
|
|
1671
|
-
if (c && (c === d.id || G(e.camadas, c, d.id))) {
|
|
1672
|
-
n.value = d.parentId || "";
|
|
1673
|
-
return;
|
|
1674
|
-
}
|
|
1675
|
-
const l = d.parentId ?? null;
|
|
1676
|
-
d.parentId = c, c && e.expandedLayers.add(c), e.salvarLembrancaEstado(), e.dispararEvento("ui-camada-mover-hierarquia", {
|
|
1677
|
-
camadaId: d.id,
|
|
1678
|
-
novoParentId: c,
|
|
1679
|
-
parentAnteriorId: l,
|
|
1680
|
-
camada: d
|
|
1681
|
-
}), e.solicitarRenderizacao();
|
|
1682
|
-
}
|
|
1683
|
-
});
|
|
1684
|
-
}), t.querySelectorAll("[data-add-sublayer]").forEach((i) => {
|
|
1685
|
-
i.addEventListener("click", (o) => {
|
|
1686
|
-
o.stopPropagation();
|
|
1687
|
-
const n = i.getAttribute("data-add-sublayer");
|
|
1688
|
-
e.dispararEvento("ui-camada-adicionar", { parentId: n });
|
|
1689
|
-
});
|
|
1690
|
-
}), pa(e, t), t.querySelectorAll("[data-layer-target]").forEach((i) => {
|
|
1691
|
-
i.addEventListener("click", (o) => {
|
|
1692
|
-
o.stopPropagation();
|
|
1693
|
-
const n = o, s = i.getAttribute("data-layer-target");
|
|
1694
|
-
if (!s) return;
|
|
1695
|
-
const c = re(e.camadas, e.feicoes, s), d = Z(c, e.searchQuery);
|
|
1696
|
-
if (d.length === 0) return;
|
|
1697
|
-
d.every((p) => e.selectedFeatureIds.has(p.id)) ? d.forEach((p) => e.selectedFeatureIds.delete(p.id)) : (!n.ctrlKey && !n.metaKey && e.selectedFeatureIds.clear(), d.forEach((p) => e.selectedFeatureIds.add(p.id))), e.lastClickedFeatureId = d[d.length - 1].id, e.sincronizarSelecaoDOM(), e.notificarMudancaSelecao();
|
|
1698
|
-
});
|
|
1699
|
-
});
|
|
1700
|
-
}
|
|
1701
|
-
function pa(e, t) {
|
|
1702
|
-
t.querySelectorAll("[data-layer-show-more]").forEach((a) => {
|
|
1703
|
-
a.addEventListener("click", (r) => {
|
|
1704
|
-
r.stopPropagation();
|
|
1705
|
-
const i = a.getAttribute("data-layer-show-more");
|
|
1706
|
-
i && e.incrementarLimiteFeicoes(i);
|
|
1707
|
-
});
|
|
1708
|
-
});
|
|
1709
|
-
}
|
|
1710
|
-
function bt(e, t) {
|
|
1711
|
-
const a = t.getElementById("btn-toggle-all-expand");
|
|
1712
|
-
if (!a) return;
|
|
1713
|
-
const r = e.camadas.length > 0 && e.camadas.every((o) => e.expandedLayers.has(o.id)), i = a.querySelector(".ui-chevron-icon");
|
|
1714
|
-
i && i.classList.toggle("open", r), R(
|
|
1715
|
-
a,
|
|
1716
|
-
r ? "Recolher Todos os Grupos" : "Expandir Todos os Grupos"
|
|
1717
|
-
);
|
|
1718
|
-
}
|
|
1719
|
-
function yt(e, t) {
|
|
1720
|
-
const a = t.getElementById("btn-toggle-all-vis");
|
|
1721
|
-
if (!a) return;
|
|
1722
|
-
const r = e.camadas.every((i) => i.visible !== !1);
|
|
1723
|
-
a.innerHTML = r ? b.olhoAberto : b.olhoFechado, R(a, r ? "Ocultar Todas as Camadas" : "Exibir Todas as Camadas");
|
|
1724
|
-
}
|
|
1725
|
-
function xt(e, t) {
|
|
1726
|
-
const a = t.getElementById("select-footer-move");
|
|
1727
|
-
a && a.addEventListener("change", (n) => {
|
|
1728
|
-
const s = n.target.value;
|
|
1729
|
-
if (!s) return;
|
|
1730
|
-
const c = ue(e.camadas);
|
|
1731
|
-
if (c.has(s)) {
|
|
1732
|
-
a.value = "";
|
|
1733
|
-
return;
|
|
1734
|
-
}
|
|
1735
|
-
const d = e.feicoes.filter(
|
|
1736
|
-
(p) => e.selectedFeatureIds.has(p.id) && !c.has(p.layerId) && p.locked !== !0
|
|
1737
|
-
);
|
|
1738
|
-
if (d.length === 0) {
|
|
1739
|
-
a.value = "";
|
|
1740
|
-
return;
|
|
1741
|
-
}
|
|
1742
|
-
const l = new Map(d.map((p) => [p.id, p.layerId]));
|
|
1743
|
-
d.forEach((p) => p.layerId = s), d.forEach((p) => {
|
|
1744
|
-
l.get(p.id) !== s && e.dispararEvento("ui-feicao-movida", {
|
|
1745
|
-
feicaoId: p.id,
|
|
1746
|
-
camadaOrigemId: l.get(p.id),
|
|
1747
|
-
camadaDestinoId: s,
|
|
1748
|
-
feicao: p
|
|
1749
|
-
});
|
|
1750
|
-
}), e.dispararEvento("ui-acao-massa", {
|
|
1751
|
-
acao: "mover",
|
|
1752
|
-
feicoesIds: d.map((p) => p.id),
|
|
1753
|
-
feicoes: d,
|
|
1754
|
-
valor: s
|
|
1755
|
-
}), e.solicitarRenderizacao();
|
|
1756
|
-
});
|
|
1757
|
-
const r = t.getElementById("btn-footer-new-layer");
|
|
1758
|
-
r && r.addEventListener("click", () => {
|
|
1759
|
-
e.dispararEvento("ui-camada-adicionar", {});
|
|
1760
|
-
});
|
|
1761
|
-
const i = t.getElementById("btn-footer-new-group");
|
|
1762
|
-
i && i.addEventListener("click", () => {
|
|
1763
|
-
e.dispararEvento("ui-camada-grupo-adicionar", { isGroup: !0 });
|
|
1764
|
-
});
|
|
1765
|
-
const o = t.getElementById("btn-footer-del");
|
|
1766
|
-
if (o) {
|
|
1767
|
-
let n = null;
|
|
1768
|
-
const s = "Excluir selecionados", c = () => {
|
|
1769
|
-
n && (clearTimeout(n), n = null), o.classList.remove("confirming"), R(o, s);
|
|
1770
|
-
};
|
|
1771
|
-
o.addEventListener("ui-cancelar-confirmacao", c), o.addEventListener("click", () => {
|
|
1772
|
-
const d = ue(e.camadas), l = e.feicoes.filter(
|
|
1773
|
-
(f) => e.selectedFeatureIds.has(f.id) && !d.has(f.layerId) && f.locked !== !0
|
|
1774
|
-
);
|
|
1775
|
-
if (l.length === 0) return;
|
|
1776
|
-
const p = l.map((f) => f.id);
|
|
1777
|
-
if (!o.classList.contains("confirming")) {
|
|
1778
|
-
o.classList.add("confirming"), R(o, `Clique novamente para excluir ${p.length} selecionado(s)`), n = setTimeout(c, 3500);
|
|
1779
|
-
return;
|
|
1780
|
-
}
|
|
1781
|
-
c();
|
|
1782
|
-
const u = new Set(p);
|
|
1783
|
-
e.feicoes = e.feicoes.filter((f) => !u.has(f.id)), p.forEach((f) => e.selectedFeatureIds.delete(f)), e.lastClickedFeatureId && u.has(e.lastClickedFeatureId) && (e.lastClickedFeatureId = null), e.dispararEvento("ui-acao-massa", {
|
|
1784
|
-
acao: "excluir",
|
|
1785
|
-
feicoesIds: p,
|
|
1786
|
-
feicoes: l
|
|
1787
|
-
}), e.notificarMudancaSelecao(), e.solicitarRenderizacao();
|
|
1788
|
-
});
|
|
1789
|
-
}
|
|
1790
|
-
}
|
|
1791
|
-
const wt = [
|
|
1792
|
-
{ tipo: "olho", atributo: "data-layer-eye", entidade: "camada" },
|
|
1793
|
-
{ tipo: "olho", atributo: "data-feat-eye", entidade: "feicao" },
|
|
1794
|
-
{ tipo: "cadeado", atributo: "data-layer-lock", entidade: "camada" },
|
|
1795
|
-
{ tipo: "cadeado", atributo: "data-feat-lock", entidade: "feicao" },
|
|
1796
|
-
{ tipo: "selecao", atributo: "data-layer-target", entidade: "camada" },
|
|
1797
|
-
{ tipo: "selecao", atributo: "data-feat-target", entidade: "feicao" }
|
|
1798
|
-
], Fe = {
|
|
1799
|
-
olho: "[data-layer-eye], [data-feat-eye]",
|
|
1800
|
-
cadeado: "[data-layer-lock], [data-feat-lock]",
|
|
1801
|
-
selecao: "[data-layer-target], [data-feat-target]"
|
|
1802
|
-
}, At = 3;
|
|
1803
|
-
function Et(e) {
|
|
1804
|
-
return wt.find((t) => e.hasAttribute(t.atributo)) ?? null;
|
|
1805
|
-
}
|
|
1806
|
-
function ke(e, t) {
|
|
1807
|
-
const a = Et(t);
|
|
1808
|
-
if (!a) return null;
|
|
1809
|
-
const r = t.getAttribute(a.atributo);
|
|
1810
|
-
if (!r) return null;
|
|
1811
|
-
if (a.tipo === "olho") {
|
|
1812
|
-
const o = a.entidade === "camada" ? e.camadas.find((n) => n.id === r) : e.feicoes.find((n) => n.id === r);
|
|
1813
|
-
return o ? o.visible !== !1 : null;
|
|
1814
|
-
}
|
|
1815
|
-
if (a.tipo === "cadeado") {
|
|
1816
|
-
if (t.hasAttribute("data-locked-by-layer")) return null;
|
|
1817
|
-
const o = a.entidade === "camada" ? e.camadas.find((n) => n.id === r) : e.feicoes.find((n) => n.id === r);
|
|
1818
|
-
return o ? o.locked === !0 : null;
|
|
1819
|
-
}
|
|
1820
|
-
if (a.entidade === "feicao") return e.selectedFeatureIds.has(r);
|
|
1821
|
-
const i = Z(
|
|
1822
|
-
re(e.camadas, e.feicoes, r),
|
|
1823
|
-
e.searchQuery
|
|
1824
|
-
);
|
|
1825
|
-
return i.length === 0 ? null : i.every((o) => e.selectedFeatureIds.has(o.id));
|
|
1826
|
-
}
|
|
1827
|
-
function Ue(e, t, a = !1) {
|
|
1828
|
-
e.dispatchEvent(
|
|
1829
|
-
new MouseEvent("click", {
|
|
1830
|
-
bubbles: !0,
|
|
1831
|
-
cancelable: !0,
|
|
1832
|
-
ctrlKey: t,
|
|
1833
|
-
shiftKey: a
|
|
1834
|
-
})
|
|
1835
|
-
);
|
|
1836
|
-
}
|
|
1837
|
-
let T = null;
|
|
1838
|
-
function It(e) {
|
|
1839
|
-
(T == null ? void 0 : T.host) === e && T.cancelar();
|
|
1840
|
-
}
|
|
1841
|
-
function fa(e, t, a = t) {
|
|
1842
|
-
Object.keys(Fe).forEach((r) => {
|
|
1843
|
-
a.querySelectorAll(Fe[r]).forEach((i) => {
|
|
1844
|
-
i.addEventListener("pointerdown", (o) => kt(e, t, r, i, o));
|
|
1845
|
-
});
|
|
1846
|
-
});
|
|
1847
|
-
}
|
|
1848
|
-
function kt(e, t, a, r, i) {
|
|
1849
|
-
if (i.pointerType === "mouse" && i.button !== 0 || e.editingLayerId || e.editingFeatureId || ke(e, r) === null) return;
|
|
1850
|
-
T == null || T.cancelar();
|
|
1851
|
-
const o = Fe[a], n = i.ctrlKey || i.metaKey, s = i.shiftKey;
|
|
1852
|
-
let c = !1, d = !1, l = i.clientY;
|
|
1853
|
-
const p = /* @__PURE__ */ new Set([r]), u = (x) => {
|
|
1854
|
-
x.preventDefault(), x.stopImmediatePropagation();
|
|
1855
|
-
}, f = (x) => {
|
|
1856
|
-
x.stopPropagation(), x.preventDefault();
|
|
1857
|
-
}, m = (x) => x.preventDefault(), v = (x) => {
|
|
1858
|
-
p.has(x) || (p.add(x), ke(e, x) !== d && Ue(x, a === "selecao"));
|
|
1859
|
-
}, h = () => {
|
|
1860
|
-
c = !0, Ue(r, n, s), d = ke(e, r) === !0, t.addEventListener("selectstart", m), document.body.style.userSelect = "none";
|
|
1861
|
-
}, g = (x) => {
|
|
1862
|
-
var w, B;
|
|
1863
|
-
if (!c) {
|
|
1864
|
-
if (Math.hypot(x.clientX - i.clientX, x.clientY - i.clientY) < At) return;
|
|
1865
|
-
const E = (w = t.elementFromPoint(x.clientX, x.clientY)) == null ? void 0 : w.closest(o);
|
|
1866
|
-
if (!E || E === r) return;
|
|
1867
|
-
h();
|
|
1868
|
-
}
|
|
1869
|
-
x.preventDefault();
|
|
1870
|
-
const S = Math.min(l, x.clientY), F = Math.max(l, x.clientY);
|
|
1871
|
-
t.querySelectorAll(o).forEach((E) => {
|
|
1872
|
-
const P = E.getBoundingClientRect();
|
|
1873
|
-
if (P.height === 0) return;
|
|
1874
|
-
const K = P.top + P.height / 2;
|
|
1875
|
-
K >= S && K <= F && v(E);
|
|
1876
|
-
});
|
|
1877
|
-
const q = (B = t.elementFromPoint(x.clientX, x.clientY)) == null ? void 0 : B.closest(o);
|
|
1878
|
-
q && v(q), l = x.clientY;
|
|
1879
|
-
}, y = (x = !1) => {
|
|
1880
|
-
(T == null ? void 0 : T.cancelar) === L && (T = null), window.removeEventListener("pointermove", g), window.removeEventListener("pointerup", k), window.removeEventListener("pointercancel", k), window.removeEventListener("dragstart", u, !0), t.removeEventListener("selectstart", m), c && (document.body.style.userSelect = "", x || (window.addEventListener("click", f, { capture: !0, once: !0 }), setTimeout(() => window.removeEventListener("click", f, !0), 0)));
|
|
1881
|
-
}, k = () => y(), L = () => y(!0);
|
|
1882
|
-
T = { host: e, cancelar: L }, window.addEventListener("dragstart", u, !0), window.addEventListener("pointermove", g, { passive: !1 }), window.addEventListener("pointerup", k), window.addEventListener("pointercancel", k);
|
|
1883
|
-
}
|
|
1884
|
-
function Lt(e, t) {
|
|
1885
|
-
const a = t.getElementById("btn-toggle-all-vis");
|
|
1886
|
-
a && a.addEventListener("click", () => e.alternarVisibilidadeTodas(!0));
|
|
1887
|
-
const r = t.getElementById("btn-toggle-all-expand");
|
|
1888
|
-
r && r.addEventListener("click", (o) => {
|
|
1889
|
-
o.stopPropagation(), e.camadas.length > 0 && e.camadas.every((s) => e.expandedLayers.has(s.id)) ? e.colapsarTodas() : e.expandirTodas();
|
|
1890
|
-
});
|
|
1891
|
-
const i = t.getElementById("btn-colapsar");
|
|
1892
|
-
i && i.addEventListener("click", () => e.colapsar(!0)), Ct(e, t);
|
|
1893
|
-
}
|
|
1894
|
-
function Ct(e, t) {
|
|
1895
|
-
const a = t.getElementById("input-layer-search"), r = t.getElementById("btn-clear-layer-search"), i = () => {
|
|
1896
|
-
var o;
|
|
1897
|
-
e.searchQuery = "", e.solicitarRenderizacao(), (o = t.getElementById("input-layer-search")) == null || o.focus();
|
|
1898
|
-
};
|
|
1899
|
-
if (a) {
|
|
1900
|
-
const o = Qe(() => e.solicitarRenderizacao(), 75);
|
|
1901
|
-
a.addEventListener("input", (n) => {
|
|
1902
|
-
e.searchQuery = n.target.value, o();
|
|
1903
|
-
}), a.addEventListener("keydown", (n) => {
|
|
1904
|
-
n.key === "Escape" && e.searchQuery && (n.preventDefault(), i());
|
|
1905
|
-
});
|
|
1906
|
-
}
|
|
1907
|
-
r && r.addEventListener("click", i);
|
|
1908
|
-
}
|
|
1909
|
-
function ma(e, t) {
|
|
1910
|
-
t.querySelectorAll("[data-feat-select]").forEach((a) => {
|
|
1911
|
-
a.addEventListener("click", (r) => {
|
|
1912
|
-
if (e.editingFeatureId) return;
|
|
1913
|
-
const i = r;
|
|
1914
|
-
if (i.target.closest(
|
|
1915
|
-
"[data-feat-eye], [data-feat-lock], [data-feat-fit], [data-feat-target], input, button"
|
|
1916
|
-
))
|
|
1917
|
-
return;
|
|
1918
|
-
const n = a.getAttribute("data-feat-select");
|
|
1919
|
-
n && e.selecionarFeicao(n, i.ctrlKey || i.metaKey, i.shiftKey, !0);
|
|
1920
|
-
});
|
|
1921
|
-
}), t.querySelectorAll("[data-feat-target]").forEach((a) => {
|
|
1922
|
-
a.addEventListener("click", (r) => {
|
|
1923
|
-
r.stopPropagation();
|
|
1924
|
-
const i = r, o = a.getAttribute("data-feat-target");
|
|
1925
|
-
o && e.selecionarFeicao(o, i.ctrlKey || i.metaKey, i.shiftKey, !0);
|
|
1926
|
-
});
|
|
1927
|
-
}), t.querySelectorAll("[data-feat-eye]").forEach((a) => {
|
|
1928
|
-
a.addEventListener("click", (r) => {
|
|
1929
|
-
r.stopPropagation();
|
|
1930
|
-
const i = a.getAttribute("data-feat-eye"), o = e.feicoes.find((n) => n.id === i);
|
|
1931
|
-
if (o) {
|
|
1932
|
-
o.visible = o.visible === !1;
|
|
1933
|
-
const n = o.visible !== !1;
|
|
1934
|
-
a.innerHTML = n ? b.olhoAberto : b.olhoFechado, R(a, n ? "Ocultar Feição" : "Exibir Feição");
|
|
1935
|
-
const s = a.closest(".ui-feat-row");
|
|
1936
|
-
s && s.classList.toggle("hidden-row", !n), e.dispararEvento("ui-feicao-visibilidade", {
|
|
1937
|
-
feicaoId: o.id,
|
|
1938
|
-
visivel: n
|
|
1939
|
-
});
|
|
1940
|
-
}
|
|
1941
|
-
});
|
|
1942
|
-
}), t.querySelectorAll("[data-feat-lock]").forEach((a) => {
|
|
1943
|
-
a.addEventListener("click", (r) => {
|
|
1944
|
-
if (r.stopPropagation(), a.hasAttribute("data-locked-by-layer")) return;
|
|
1945
|
-
const i = a.getAttribute("data-feat-lock"), o = e.feicoes.find((n) => n.id === i);
|
|
1946
|
-
o && (o.locked = !o.locked, a.innerHTML = o.locked ? b.cadeadoTrancado : b.cadeadoAberto, a.classList.toggle("ui-lock-open", !o.locked), R(a, o.locked ? "Desbloquear Feição" : "Bloquear Feição"), e.dispararEvento("ui-feicao-bloqueio", {
|
|
1947
|
-
feicaoId: o.id,
|
|
1948
|
-
bloqueado: o.locked
|
|
1949
|
-
}));
|
|
1950
|
-
});
|
|
1951
|
-
}), t.querySelectorAll("[data-feat-fit]").forEach((a) => {
|
|
1952
|
-
a.addEventListener("click", (r) => {
|
|
1953
|
-
r.stopPropagation();
|
|
1954
|
-
const i = a.getAttribute("data-feat-fit");
|
|
1955
|
-
i && e.dispararEvento("ui-feicao-enquadrar", { feicaoId: i });
|
|
1956
|
-
});
|
|
1957
|
-
});
|
|
1958
|
-
}
|
|
1959
|
-
function St(e, t) {
|
|
1960
|
-
var a;
|
|
1961
|
-
(a = t.querySelector("[data-basemap-toggle]")) == null || a.addEventListener("click", () => {
|
|
1962
|
-
e.alternarMapasBaseRecolhido(!0);
|
|
1963
|
-
}), t.querySelectorAll("[data-basemap-id]").forEach((r) => {
|
|
1964
|
-
r.addEventListener("click", () => {
|
|
1965
|
-
const i = r.getAttribute("data-basemap-id");
|
|
1966
|
-
i && e.selecionarMapaBase(i, !0);
|
|
1967
|
-
});
|
|
1968
|
-
});
|
|
1969
|
-
}
|
|
1970
|
-
function Ft(e, t) {
|
|
1971
|
-
Lt(e, t), ht(e, t), ma(e, t), St(e, t), xt(e, t), fa(e, t);
|
|
1972
|
-
}
|
|
1973
|
-
function $t(e) {
|
|
1974
|
-
if (!e.arvoreRenderizada) return { incremental: !1, motivo: "arvore-nao-renderizada" };
|
|
1975
|
-
if (e.buscaAtiva) return { incremental: !1, motivo: "busca-ativa" };
|
|
1976
|
-
if (e.editandoCamada || e.editandoFeicao) return { incremental: !1, motivo: "edicao-inline" };
|
|
1977
|
-
for (const t of e.camadasAfetadas) {
|
|
1978
|
-
if (!t.existeNoModelo) return { incremental: !1, motivo: "camada-orfa" };
|
|
1979
|
-
if (!t.renderizadaNoDom) return { incremental: !1, motivo: "camada-fora-do-dom" };
|
|
1980
|
-
if (t.drawerAberto) return { incremental: !1, motivo: "drawer-aberto" };
|
|
1981
|
-
}
|
|
1982
|
-
return e.idsDuplicados ? { incremental: !1, motivo: "ids-duplicados" } : { incremental: !0 };
|
|
1983
|
-
}
|
|
1984
|
-
function ga(e, t = /* @__PURE__ */ new Map()) {
|
|
1985
|
-
for (const a of e)
|
|
1986
|
-
t.set(a.camada.id, a), ga(a.subcamadas, t);
|
|
1987
|
-
return t;
|
|
1988
|
-
}
|
|
1989
|
-
function zt(e) {
|
|
1990
|
-
const t = /* @__PURE__ */ new Map();
|
|
1991
|
-
for (let a = 0; a < e.length; a++) {
|
|
1992
|
-
const r = e[a];
|
|
1993
|
-
if (!r || !r.id) continue;
|
|
1994
|
-
const i = r.layerId || "", o = t.get(i);
|
|
1995
|
-
o ? o.push(r) : t.set(i, [r]);
|
|
1996
|
-
}
|
|
1997
|
-
return t;
|
|
1998
|
-
}
|
|
1999
|
-
function ee(e, t) {
|
|
2000
|
-
for (let a = e.firstElementChild; a; a = a.nextElementSibling)
|
|
2001
|
-
if (a.classList.contains(t)) return a;
|
|
2002
|
-
return null;
|
|
2003
|
-
}
|
|
2004
|
-
function Mt(e) {
|
|
2005
|
-
const t = /* @__PURE__ */ new Map(), a = (r) => {
|
|
2006
|
-
for (let i = r.firstElementChild; i; i = i.nextElementSibling) {
|
|
2007
|
-
if (!i.classList.contains("ui-layer-group")) continue;
|
|
2008
|
-
const o = i.getAttribute("data-layer-id");
|
|
2009
|
-
o !== null && t.set(o, i);
|
|
2010
|
-
const n = ee(i, "ui-children-container");
|
|
2011
|
-
n && a(n);
|
|
2012
|
-
}
|
|
2013
|
-
};
|
|
2014
|
-
return a(e), t;
|
|
2015
|
-
}
|
|
2016
|
-
function Pt(e) {
|
|
2017
|
-
if (!e || e.length < 2) return !1;
|
|
2018
|
-
const t = /* @__PURE__ */ new Set();
|
|
2019
|
-
for (const a of e) {
|
|
2020
|
-
if (t.has(a.id)) return !0;
|
|
2021
|
-
t.add(a.id);
|
|
2022
|
-
}
|
|
2023
|
-
return !1;
|
|
2024
|
-
}
|
|
2025
|
-
function Bt(e, t) {
|
|
2026
|
-
var i;
|
|
2027
|
-
const a = new Map(t.map((o) => [o.id, o])), r = /* @__PURE__ */ new Set();
|
|
2028
|
-
for (const o of e) {
|
|
2029
|
-
let n = o;
|
|
2030
|
-
for (; n && a.has(n) && !r.has(n); )
|
|
2031
|
-
r.add(n), n = (i = a.get(n)) == null ? void 0 : i.parentId;
|
|
2032
|
-
}
|
|
2033
|
-
return r;
|
|
2034
|
-
}
|
|
2035
|
-
function pe(e) {
|
|
2036
|
-
const t = document.createElement("template");
|
|
2037
|
-
return t.innerHTML = e, { modelo: t, elementos: Array.from(t.content.children) };
|
|
2038
|
-
}
|
|
2039
|
-
function fe(e) {
|
|
2040
|
-
var a;
|
|
2041
|
-
const t = e.nextSibling;
|
|
2042
|
-
t && t.nodeType === 3 && !(t.textContent ?? "").trim() && ((a = t.parentNode) == null || a.removeChild(t)), e.remove();
|
|
2043
|
-
}
|
|
2044
|
-
function qt(e, t) {
|
|
2045
|
-
if (!e || !t.contains(e)) return null;
|
|
2046
|
-
const a = Array.from(e.attributes).find((r) => r.name.startsWith("data-") && r.value !== "");
|
|
2047
|
-
return a ? { nome: a.name, valor: a.value } : null;
|
|
2048
|
-
}
|
|
2049
|
-
function Dt(e, t) {
|
|
2050
|
-
var F, q;
|
|
2051
|
-
const { host: a, shadow: r, mudanca: i } = e;
|
|
2052
|
-
if ((q = (F = a.ordemFilhosPorPai) == null ? void 0 : F.get(t)) != null && q.length) return !1;
|
|
2053
|
-
const o = e.grupos.get(t), n = e.nodos.get(t), s = o ? ee(o, "ui-children-container") : null;
|
|
2054
|
-
if (!o || !n || !s) return !1;
|
|
2055
|
-
const c = n.camada, d = e.porCamada.get(t) ?? [], l = a.expandedFeatureLimits.get(t) ?? ze, p = d.slice(0, l), u = new Set(p.map((w) => w.id)), f = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), v = r.activeElement;
|
|
2056
|
-
let h = null;
|
|
2057
|
-
for (let w = s.firstElementChild, B; w; w = B) {
|
|
2058
|
-
B = w.nextElementSibling;
|
|
2059
|
-
const E = w.getAttribute("data-feat-row");
|
|
2060
|
-
if (E === null) {
|
|
2061
|
-
!h && !w.classList.contains("ui-layer-group") && (h = w);
|
|
2062
|
-
continue;
|
|
2063
|
-
}
|
|
2064
|
-
const P = i.idsAlterados.has(E) && u.has(E) && !f.has(E);
|
|
2065
|
-
!u.has(E) || f.has(E) || P ? (P && m.set(E, { tabindex: w.getAttribute("tabindex"), foco: qt(v, w) }), fe(w)) : (f.set(E, w), h || (h = w));
|
|
2066
|
-
}
|
|
2067
|
-
const g = Le(c, n.depth, e.herdado.get(t)), y = p.filter((w) => !f.has(w.id));
|
|
2068
|
-
let k = [];
|
|
2069
|
-
if (y.length > 0) {
|
|
2070
|
-
const w = y.map(
|
|
2071
|
-
(P) => Ce(P, g, a.selectedFeatureIds.has(P.id), a.editingFeatureId === P.id)
|
|
2072
|
-
).join(""), { modelo: B, elementos: E } = pe(w);
|
|
2073
|
-
if (E.length !== y.length) return !1;
|
|
2074
|
-
e.ligar(B.content), k = E;
|
|
2075
|
-
}
|
|
2076
|
-
let L = h, x = 0;
|
|
2077
|
-
const S = /* @__PURE__ */ new Map();
|
|
2078
|
-
for (const w of p) {
|
|
2079
|
-
const B = f.get(w.id);
|
|
2080
|
-
if (B)
|
|
2081
|
-
B === L ? L = B.nextElementSibling : s.insertBefore(B, L);
|
|
2082
|
-
else {
|
|
2083
|
-
const E = k[x++];
|
|
2084
|
-
s.insertBefore(E, L), S.set(w.id, E);
|
|
2085
|
-
}
|
|
2086
|
-
}
|
|
2087
|
-
return m.forEach((w, B) => {
|
|
2088
|
-
const E = S.get(B);
|
|
2089
|
-
if (!E || (w.tabindex !== null && E.setAttribute("tabindex", w.tabindex), !w.foco)) return;
|
|
2090
|
-
const P = E.getAttribute(w.foco.nome) === w.foco.valor ? E : Array.from(E.querySelectorAll(`[${w.foco.nome}]`)).find(
|
|
2091
|
-
(K) => K.getAttribute(w.foco.nome) === w.foco.valor
|
|
2092
|
-
);
|
|
2093
|
-
P == null || P.focus({ preventScroll: !0 });
|
|
2094
|
-
}), Tt(e, s, n, l, d.length);
|
|
2095
|
-
}
|
|
2096
|
-
function Tt(e, t, a, r, i) {
|
|
2097
|
-
const o = M(a.camada.id), n = !!(a.camada.isGroup || a.subcamadas.length > 0), s = i > r, c = a.subcamadas.length === 0 && i === 0, d = ee(t, "ui-truncate-notice"), l = ee(t, "ui-empty-row");
|
|
2098
|
-
if (l && !c && fe(l), d && !s && fe(d), s)
|
|
2099
|
-
if (d) {
|
|
2100
|
-
const p = ia(r, i), u = d.querySelector("span"), f = d.querySelector(".ui-truncate-more-btn");
|
|
2101
|
-
if (!u || !f) return !1;
|
|
2102
|
-
u.textContent !== p.resumo && (u.textContent = p.resumo), f.textContent !== p.botao && (f.textContent = p.botao);
|
|
2103
|
-
} else {
|
|
2104
|
-
const { modelo: p, elementos: u } = pe(oa(o, r, i));
|
|
2105
|
-
if (u.length !== 1) return !1;
|
|
2106
|
-
e.ligar(p.content), t.appendChild(u[0]);
|
|
2107
|
-
}
|
|
2108
|
-
if (c && !l) {
|
|
2109
|
-
const { elementos: p } = pe(na(n));
|
|
2110
|
-
if (p.length !== 1) return !1;
|
|
2111
|
-
t.appendChild(p[0]);
|
|
2112
|
-
}
|
|
2113
|
-
return !0;
|
|
2114
|
-
}
|
|
2115
|
-
function Ot(e, t) {
|
|
2116
|
-
const a = e.grupos.get(t), r = e.nodos.get(t), i = a ? ee(a, "ui-layer-row") : null, o = i == null ? void 0 : i.querySelector(".ui-col-name");
|
|
2117
|
-
if (!a || !r || !i || !o) return !1;
|
|
2118
|
-
const { host: n } = e, s = re(n.camadas, n.feicoes, t), c = (e.porCamada.get(t) ?? []).length, d = r.subcamadas.length, l = !!(r.camada.isGroup || d > 0), p = o.querySelector(".ui-count-chip");
|
|
2119
|
-
if (p)
|
|
2120
|
-
if (s.length === 0 && l)
|
|
2121
|
-
fe(p);
|
|
2122
|
-
else {
|
|
2123
|
-
const u = String(s.length), f = ta(s.length, c, d);
|
|
2124
|
-
p.textContent !== u && (p.textContent = u), p.getAttribute("title") !== f && p.setAttribute("title", f);
|
|
2125
|
-
}
|
|
2126
|
-
else {
|
|
2127
|
-
const u = ra(s.length, c, d, l);
|
|
2128
|
-
if (u) {
|
|
2129
|
-
const { elementos: f } = pe(u);
|
|
2130
|
-
if (f.length !== 1) return !1;
|
|
2131
|
-
o.appendChild(f[0]);
|
|
2132
|
-
}
|
|
2133
|
-
}
|
|
2134
|
-
return la(i.querySelector(".ui-target-circle"), s, n.selectedFeatureIds), !0;
|
|
2135
|
-
}
|
|
2136
|
-
function Rt(e, t, a, r) {
|
|
2137
|
-
const i = t.getElementById("ui-layer-tree-mount"), o = ga(me(e.camadas)), n = i ? Mt(i) : /* @__PURE__ */ new Map(), s = zt(e.feicoes), c = a.camadas === "todas" ? Array.from(o.keys()) : Array.from(a.camadas), d = c.map((u) => ({
|
|
2138
|
-
existeNoModelo: o.has(u),
|
|
2139
|
-
renderizadaNoDom: n.has(u),
|
|
2140
|
-
drawerAberto: e.activeSettingsLayerId === u
|
|
2141
|
-
}));
|
|
2142
|
-
if (!$t({
|
|
2143
|
-
arvoreRenderizada: i !== null,
|
|
2144
|
-
buscaAtiva: (e.searchQuery || "").trim() !== "",
|
|
2145
|
-
editandoCamada: e.editingLayerId !== null,
|
|
2146
|
-
editandoFeicao: e.editingFeatureId !== null,
|
|
2147
|
-
idsDuplicados: c.some((u) => Pt(s.get(u))),
|
|
2148
|
-
camadasAfetadas: d
|
|
2149
|
-
}).incremental) return !1;
|
|
2150
|
-
const p = {
|
|
2151
|
-
host: e,
|
|
2152
|
-
shadow: t,
|
|
2153
|
-
mudanca: a,
|
|
2154
|
-
porCamada: s,
|
|
2155
|
-
nodos: o,
|
|
2156
|
-
grupos: n,
|
|
2157
|
-
herdado: ge(e.camadas),
|
|
2158
|
-
ligar: r
|
|
2159
|
-
};
|
|
2160
|
-
for (const u of c)
|
|
2161
|
-
if (!Dt(p, u)) return !1;
|
|
2162
|
-
for (const u of Bt(c, e.camadas))
|
|
2163
|
-
if (!Ot(p, u)) return !1;
|
|
2164
|
-
return (a.selecaoAfetada || e.selectedFeatureIds.size > 0) && ua(e, t), !0;
|
|
2165
|
-
}
|
|
2166
|
-
function jt(e) {
|
|
2167
|
-
if (!e.isConnected) return;
|
|
2168
|
-
const t = document.createElement("div");
|
|
2169
|
-
t.className = "ui-basemap-preview-none", t.innerHTML = b.gradeCad, e.replaceWith(t);
|
|
2170
|
-
}
|
|
2171
|
-
function Nt(e, t, a, r) {
|
|
2172
|
-
var v, h;
|
|
2173
|
-
const i = rt({
|
|
2174
|
-
camadas: e.camadas,
|
|
2175
|
-
feicoes: e.feicoes,
|
|
2176
|
-
camadaAtivaId: e.camadaAtivaId,
|
|
2177
|
-
expandedLayers: e.expandedLayers,
|
|
2178
|
-
selectedFeatureIds: e.selectedFeatureIds,
|
|
2179
|
-
activeSettingsLayerId: e.activeSettingsLayerId,
|
|
2180
|
-
editingLayerId: e.editingLayerId,
|
|
2181
|
-
editingFeatureId: e.editingFeatureId,
|
|
2182
|
-
searchQuery: e.searchQuery,
|
|
2183
|
-
titulo: e.titulo,
|
|
2184
|
-
mostrarBusca: e.mostrarBusca,
|
|
2185
|
-
limitesPorCamada: e.expandedFeatureLimits,
|
|
2186
|
-
mostrarBotaoColapsar: e.flutuante && e.getAttribute("colapsavel") !== "false",
|
|
2187
|
-
ordemFilhosPorPai: e.ordemFilhosPorPai
|
|
2188
|
-
}), o = e.mostrarMapasBase ? Ha(e.mapasBase, e.mapaBaseAtivo, e.mapasBaseRecolhido) : "", n = e.mostrarRodape ? Va(e.camadas, e.feicoes, e.selectedFeatureIds) : "", s = t.getElementById("ui-layer-tree-mount"), c = a.scrollTop, d = s ? s.scrollTop : 0, l = t.activeElement, p = l && a.contains(l) ? l.id : "", u = l && !p && a.contains(l) ? Array.from(l.attributes).find((g) => g.name.startsWith("data-") && g.value !== "") : void 0, f = l && "selectionStart" in l ? l.selectionStart : null;
|
|
2189
|
-
a.innerHTML = `
|
|
2190
|
-
${i}
|
|
2191
|
-
${n}
|
|
2192
|
-
${o}
|
|
2193
|
-
`, a.scrollTop = c;
|
|
2194
|
-
const m = t.getElementById("ui-layer-tree-mount");
|
|
2195
|
-
if (m && (m.scrollTop = d), p) {
|
|
2196
|
-
const g = t.getElementById(p);
|
|
2197
|
-
if (g && (g.focus({ preventScroll: !0 }), f !== null && typeof g.setSelectionRange == "function"))
|
|
2198
|
-
try {
|
|
2199
|
-
g.setSelectionRange(f, f);
|
|
2200
|
-
} catch {
|
|
2201
|
-
}
|
|
2202
|
-
}
|
|
2203
|
-
!p && u && ((v = O(a, u.name, u.value)) == null || v.focus({ preventScroll: !0 })), (h = t.querySelector("[data-layer-row], [data-feat-row]")) == null || h.setAttribute("tabindex", "0"), a.querySelectorAll("img[data-basemap-thumb]").forEach((g) => {
|
|
2204
|
-
const y = () => jt(g);
|
|
2205
|
-
g.addEventListener("error", y, { once: !0 }), g.complete && g.naturalWidth === 0 && g.getAttribute("src") && y();
|
|
2206
|
-
}), Ft(e, t), r.bindAll();
|
|
2207
|
-
}
|
|
2208
|
-
function Ht(e, t, a, r) {
|
|
2209
|
-
try {
|
|
2210
|
-
return Rt(e, t, r, (i) => {
|
|
2211
|
-
ma(e, i), pa(e, i), fa(e, t, i), a.bindLinhasFeicao(i);
|
|
2212
|
-
});
|
|
2213
|
-
} catch (i) {
|
|
2214
|
-
return console.warn("[UI-Camadas] atualização incremental falhou; redesenhando o painel.", i), !1;
|
|
2215
|
-
}
|
|
2216
|
-
}
|
|
2217
|
-
const Gt = '[role="button"][tabindex]', ae = "[data-layer-row], [data-feat-row]", Vt = ["color", "range", "checkbox", "radio", "button"];
|
|
2218
|
-
function va(e) {
|
|
2219
|
-
return !e || !(e instanceof Element) || e instanceof HTMLInputElement && Vt.includes(e.type) ? !1 : Oa({ composedPath: () => [e] });
|
|
2220
|
-
}
|
|
2221
|
-
function _t(e) {
|
|
2222
|
-
return Array.from(e.querySelectorAll(ae)).filter((t) => {
|
|
2223
|
-
const a = t.closest(".ui-children-container");
|
|
2224
|
-
return !(a && a.style.display === "none") && !t.classList.contains("ui-search-hidden");
|
|
2225
|
-
});
|
|
2226
|
-
}
|
|
2227
|
-
function Y(e, t) {
|
|
2228
|
-
t && (e.querySelectorAll(ae).forEach((a) => a.setAttribute("tabindex", "-1")), t.setAttribute("tabindex", "0"), t.focus());
|
|
2229
|
-
}
|
|
2230
|
-
function Yt(e, t) {
|
|
2231
|
-
e.dispatchEvent(
|
|
2232
|
-
new MouseEvent("click", {
|
|
2233
|
-
bubbles: !0,
|
|
2234
|
-
ctrlKey: t.ctrlKey || t.metaKey,
|
|
2235
|
-
shiftKey: t.shiftKey
|
|
2236
|
-
})
|
|
2237
|
-
);
|
|
2238
|
-
}
|
|
2239
|
-
function Ut(e, t, a) {
|
|
2240
|
-
var i;
|
|
2241
|
-
if (va(a.composedPath()[0])) return;
|
|
2242
|
-
const r = t.querySelector(".confirming");
|
|
2243
|
-
if (r) {
|
|
2244
|
-
a.preventDefault(), r.dispatchEvent(new Event("ui-cancelar-confirmacao")), r.classList.remove("confirming");
|
|
2245
|
-
return;
|
|
2246
|
-
}
|
|
2247
|
-
if (e.activeSettingsLayerId) {
|
|
2248
|
-
a.preventDefault();
|
|
2249
|
-
const o = e.activeSettingsLayerId;
|
|
2250
|
-
e.activeSettingsLayerId = null, e.solicitarRenderizacao(), (i = O(t, "data-layer-settings", o)) == null || i.focus();
|
|
2251
|
-
return;
|
|
2252
|
-
}
|
|
2253
|
-
e.selectedFeatureIds.size > 0 && (a.preventDefault(), e.limparSelecao(!0));
|
|
2254
|
-
}
|
|
2255
|
-
function Kt(e, t, a, r) {
|
|
2256
|
-
var s, c, d;
|
|
2257
|
-
const i = r.composedPath()[0];
|
|
2258
|
-
if (!(i instanceof HTMLElement) || va(i)) return;
|
|
2259
|
-
if ((r.key === "Enter" || r.key === " ") && i.matches(Gt)) {
|
|
2260
|
-
r.preventDefault(), i.click();
|
|
2261
|
-
return;
|
|
2262
|
-
}
|
|
2263
|
-
if (!i.matches(ae)) return;
|
|
2264
|
-
const o = _t(t), n = o.indexOf(i);
|
|
2265
|
-
if (r.key === "F2") {
|
|
2266
|
-
r.preventDefault();
|
|
2267
|
-
const l = i.getAttribute("data-layer-row"), p = i.getAttribute("data-feat-row"), u = l ? O(i, "data-layer-name-trigger", l) : p ? O(i, "data-feat-name-trigger", p) : null;
|
|
2268
|
-
u && u.dispatchEvent(new MouseEvent("dblclick", { bubbles: !0 }));
|
|
2269
|
-
return;
|
|
2270
|
-
}
|
|
2271
|
-
if ((r.ctrlKey || r.metaKey) && (r.key === "a" || r.key === "A")) {
|
|
2272
|
-
r.preventDefault();
|
|
2273
|
-
const l = da(
|
|
2274
|
-
e.camadas,
|
|
2275
|
-
e.feicoes,
|
|
2276
|
-
e.expandedLayers,
|
|
2277
|
-
e.searchQuery,
|
|
2278
|
-
void 0,
|
|
2279
|
-
e.expandedFeatureLimits
|
|
2280
|
-
);
|
|
2281
|
-
l.length > 0 && e.selecionarFeicoes(l, !0);
|
|
2282
|
-
return;
|
|
2283
|
-
}
|
|
2284
|
-
if (r.key === "Delete") {
|
|
2285
|
-
const l = a.getElementById("btn-footer-del");
|
|
2286
|
-
if (l && !l.hasAttribute("disabled") && e.selectedFeatureIds.size > 0) {
|
|
2287
|
-
r.preventDefault(), l.click();
|
|
2288
|
-
return;
|
|
2289
|
-
}
|
|
2290
|
-
}
|
|
2291
|
-
switch (r.key) {
|
|
2292
|
-
case "ArrowDown":
|
|
2293
|
-
r.preventDefault(), Y(t, o[Math.min(o.length - 1, n + 1)]);
|
|
2294
|
-
break;
|
|
2295
|
-
case "ArrowUp":
|
|
2296
|
-
r.preventDefault(), Y(t, o[Math.max(0, n - 1)]);
|
|
2297
|
-
break;
|
|
2298
|
-
case "Home":
|
|
2299
|
-
r.preventDefault(), Y(t, o[0]);
|
|
2300
|
-
break;
|
|
2301
|
-
case "End":
|
|
2302
|
-
r.preventDefault(), Y(t, o[o.length - 1]);
|
|
2303
|
-
break;
|
|
2304
|
-
case "ArrowRight": {
|
|
2305
|
-
const l = i.getAttribute("data-layer-row");
|
|
2306
|
-
if (!l) return;
|
|
2307
|
-
const p = i.closest(".ui-layer-group");
|
|
2308
|
-
(p == null ? void 0 : p.getAttribute("aria-expanded")) === "true" ? n + 1 < o.length && (p != null && p.contains(o[n + 1])) && (r.preventDefault(), Y(t, o[n + 1])) : (r.preventDefault(), (s = O(a, "data-layer-expand", l)) == null || s.click());
|
|
2309
|
-
break;
|
|
2310
|
-
}
|
|
2311
|
-
case "ArrowLeft": {
|
|
2312
|
-
const l = i.getAttribute("data-layer-row");
|
|
2313
|
-
if (l) {
|
|
2314
|
-
const f = i.closest(".ui-layer-group");
|
|
2315
|
-
if ((f == null ? void 0 : f.getAttribute("aria-expanded")) === "true")
|
|
2316
|
-
r.preventDefault(), (c = O(a, "data-layer-expand", l)) == null || c.click();
|
|
2317
|
-
else {
|
|
2318
|
-
const v = (d = f == null ? void 0 : f.parentElement) == null ? void 0 : d.closest(".ui-layer-group"), h = v == null ? void 0 : v.getAttribute("data-layer-id"), g = h ? O(t, "data-layer-row", h) : null;
|
|
2319
|
-
g && (r.preventDefault(), Y(t, g));
|
|
2320
|
-
}
|
|
2321
|
-
return;
|
|
2322
|
-
}
|
|
2323
|
-
const p = i.getAttribute("data-feat-layer"), u = p ? O(t, "data-layer-row", p) : null;
|
|
2324
|
-
u && (r.preventDefault(), Y(t, u));
|
|
2325
|
-
break;
|
|
2326
|
-
}
|
|
2327
|
-
case "Enter":
|
|
2328
|
-
case " ":
|
|
2329
|
-
r.preventDefault(), Yt(i, r);
|
|
2330
|
-
break;
|
|
2331
|
-
}
|
|
2332
|
-
}
|
|
2333
|
-
function Qt(e, t, a, r, i) {
|
|
2334
|
-
i.add(t, "keydown", (o) => {
|
|
2335
|
-
o.key === "Escape" && Ut(e, a, o);
|
|
2336
|
-
}), i.add(r, "keydown", (o) => Kt(e, r, a, o)), i.add(r, "focusin", (o) => {
|
|
2337
|
-
const n = o.composedPath()[0];
|
|
2338
|
-
n instanceof HTMLElement && n.matches(ae) && (r.querySelectorAll(ae).forEach((s) => s.setAttribute("tabindex", "-1")), n.setAttribute("tabindex", "0"));
|
|
2339
|
-
});
|
|
2340
|
-
}
|
|
2341
|
-
function Xt(e, t, a, r, i) {
|
|
2342
|
-
const o = da(
|
|
2343
|
-
e.camadas,
|
|
2344
|
-
e.feicoes,
|
|
2345
|
-
e.expandedLayers,
|
|
2346
|
-
e.searchQuery,
|
|
2347
|
-
void 0,
|
|
2348
|
-
e.expandedFeatureLimits
|
|
2349
|
-
), n = !r && !o.includes(t) && e.feicoes.some((c) => c.id === t), s = Ka(
|
|
2350
|
-
n ? [...o, t] : o,
|
|
2351
|
-
e.selectedFeatureIds,
|
|
2352
|
-
e.lastClickedFeatureId,
|
|
2353
|
-
t,
|
|
2354
|
-
a,
|
|
2355
|
-
r
|
|
2356
|
-
);
|
|
2357
|
-
s && (e.selectedFeatureIds = s.selecionados, e.lastClickedFeatureId = s.ultimoClicadoId, e.sincronizarSelecaoDOM(), i && e.notificarMudancaSelecao());
|
|
2358
|
-
}
|
|
2359
|
-
function Wt(e, t, a) {
|
|
2360
|
-
const r = t || [];
|
|
2361
|
-
r.length === e.selectedFeatureIds.size && r.every((n) => e.selectedFeatureIds.has(n)) || (e.selectedFeatureIds.clear(), r.forEach((n) => e.selectedFeatureIds.add(n)), e.lastClickedFeatureId = r.length > 0 ? r[r.length - 1] : null, e.sincronizarSelecaoDOM(), a && e.notificarMudancaSelecao());
|
|
2362
|
-
}
|
|
2363
|
-
function Jt(e, t) {
|
|
2364
|
-
e.selectedFeatureIds.size !== 0 && (e.selectedFeatureIds.clear(), e.lastClickedFeatureId = null, e.sincronizarSelecaoDOM(), t && e.notificarMudancaSelecao());
|
|
2365
|
-
}
|
|
2366
|
-
function Zt(e) {
|
|
2367
|
-
const t = e.feicoes.filter((a) => e.selectedFeatureIds.has(a.id));
|
|
2368
|
-
e.dispararEvento("ui-feicoes-selecionadas", {
|
|
2369
|
-
feicoesIds: Array.from(e.selectedFeatureIds),
|
|
2370
|
-
feicoes: t
|
|
2371
|
-
}), t.length === 1 ? e.dispararEvento("ui-feicao-selecionada", { feicaoId: t[0].id, feicao: t[0] }) : t.length === 0 && e.dispararEvento("ui-feicao-selecionada", { feicaoId: null, feicao: null });
|
|
2372
|
-
}
|
|
2373
|
-
class er {
|
|
2374
|
-
constructor(t) {
|
|
2375
|
-
A(this, "origens", /* @__PURE__ */ new Map());
|
|
2376
|
-
A(this, "removidas", /* @__PURE__ */ new Set());
|
|
2377
|
-
A(this, "salvarComDebounce", Qe(() => this.salvar(), 200));
|
|
2378
|
-
this.instantaneo = t;
|
|
2379
|
-
}
|
|
2380
|
-
chaveAtual() {
|
|
2381
|
-
const t = this.instantaneo();
|
|
2382
|
-
return dt(t.storageKey, t.id);
|
|
2383
|
-
}
|
|
2384
|
-
carregar() {
|
|
2385
|
-
return Se(this.chaveAtual());
|
|
2386
|
-
}
|
|
2387
|
-
/** Versão com debounce, para interações contínuas (seletor de cor, slider de opacidade). */
|
|
2388
|
-
agendar() {
|
|
2389
|
-
this.salvarComDebounce();
|
|
2390
|
-
}
|
|
2391
|
-
salvar() {
|
|
2392
|
-
const t = this.instantaneo();
|
|
2393
|
-
if (!t.persistir || !t.conectado) return;
|
|
2394
|
-
const a = this.chaveAtual(), r = ft({
|
|
2395
|
-
estadoAnterior: Se(a),
|
|
2396
|
-
origensCamadas: this.origens,
|
|
2397
|
-
camadas: t.camadas,
|
|
2398
|
-
expandedLayers: t.expandedLayers,
|
|
2399
|
-
camadaAtivaId: t.camadaAtivaId,
|
|
2400
|
-
painelColapsado: t.painelColapsado,
|
|
2401
|
-
mapaBaseAtivo: t.mapaBaseAtivo,
|
|
2402
|
-
densidade: t.densidade,
|
|
2403
|
-
altura: t.altura,
|
|
2404
|
-
camadasRemovidas: this.removidas,
|
|
2405
|
-
ordemFilhosPorPai: t.ordemFilhosPorPai
|
|
2406
|
-
});
|
|
2407
|
-
this.removidas.clear(), lt(a, r);
|
|
2408
|
-
}
|
|
2409
|
-
limpar() {
|
|
2410
|
-
ut(this.chaveAtual());
|
|
2411
|
-
}
|
|
2412
|
-
// --- Origens (como a camada chegou do consumidor) e remoções ---
|
|
2413
|
-
limparOrigens() {
|
|
2414
|
-
this.origens.clear();
|
|
2415
|
-
}
|
|
2416
|
-
registrarOrigem(t) {
|
|
2417
|
-
this.origens.set(t.id, ca(t));
|
|
2418
|
-
}
|
|
2419
|
-
esquecerCamada(t) {
|
|
2420
|
-
this.origens.delete(t), this.removidas.add(t);
|
|
2421
|
-
}
|
|
2422
|
-
/** Aplica por cima de `camadas` o que foi lembrado (expansão, visibilidade, travas, opacidade, cor, ordem). */
|
|
2423
|
-
reidratar(t, a, r, i) {
|
|
2424
|
-
if (pt(t, a, r, this.origens), i && (i.clear(), a != null && a.ordemFilhosPorPai))
|
|
2425
|
-
for (const [o, n] of Object.entries(a.ordemFilhosPorPai))
|
|
2426
|
-
Array.isArray(n) && n.length > 0 && i.set(o, [...n]);
|
|
2427
|
-
}
|
|
2428
|
-
}
|
|
2429
|
-
function Pe(e, t = null, a = /* @__PURE__ */ new Set()) {
|
|
2430
|
-
const r = [];
|
|
2431
|
-
if (!Array.isArray(e)) return r;
|
|
2432
|
-
for (const i of e) {
|
|
2433
|
-
if (!i || typeof i != "object" || !i.id) continue;
|
|
2434
|
-
const o = String(i.id);
|
|
2435
|
-
if (a.has(o)) continue;
|
|
2436
|
-
a.add(o);
|
|
2437
|
-
const n = { ...i, id: o };
|
|
2438
|
-
delete n.children, t && n.parentId === void 0 && (n.parentId = t), r.push(n), Array.isArray(i.children) && i.children.length > 0 && r.push(...Pe(i.children, o, a));
|
|
2439
|
-
}
|
|
2440
|
-
return r;
|
|
2441
|
-
}
|
|
2442
|
-
function ha(e) {
|
|
2443
|
-
const t = e.lastClickedFeatureId;
|
|
2444
|
-
t && !e.feicoes.some((a) => a.id === t) && (e.lastClickedFeatureId = null);
|
|
2445
|
-
}
|
|
2446
|
-
function ba(e) {
|
|
2447
|
-
if (!Array.isArray(e)) return [];
|
|
2448
|
-
const t = /* @__PURE__ */ new Set(), a = [];
|
|
2449
|
-
for (const r of e) {
|
|
2450
|
-
if (!r || typeof r != "object" || !r.id) continue;
|
|
2451
|
-
const i = String(r.id);
|
|
2452
|
-
t.has(i) || (t.add(i), a.push({ ...r, id: i }));
|
|
2453
|
-
}
|
|
2454
|
-
return a;
|
|
2455
|
-
}
|
|
2456
|
-
function ar(e, t, a) {
|
|
2457
|
-
if (e.camadas = Array.isArray(t) ? Pe(t) : [], e.lembranca.limparOrigens(), e.persistir) {
|
|
2458
|
-
const o = e.lembranca.carregar();
|
|
2459
|
-
e.lembranca.reidratar(e.camadas, o, e.expandedLayers, e.ordemFilhosPorPai), o != null && o.camadaAtivaId && e.camadas.some((n) => n.id === o.camadaAtivaId) && (e.camadaAtivaId = o.camadaAtivaId);
|
|
2460
|
-
} else
|
|
2461
|
-
e.camadas.forEach((o) => {
|
|
2462
|
-
e.lembranca.registrarOrigem(o), e.expandedLayers.has(o.id) || e.expandedLayers.add(o.id);
|
|
2463
|
-
});
|
|
2464
|
-
if (Array.isArray(a)) {
|
|
2465
|
-
e.feicoes = ba(a);
|
|
2466
|
-
const o = new Set(e.camadas.map((s) => s.id)), n = e.feicoes.filter((s) => s.layerId && !o.has(s.layerId));
|
|
2467
|
-
n.length > 0 && console.warn(
|
|
2468
|
-
`[UI-Camadas] ${n.length} feição(ões) possuem 'layerId' não cadastrado nas camadas:`,
|
|
2469
|
-
n.map((s) => ({ id: s.id, nome: s.name, layerId: s.layerId }))
|
|
2470
|
-
), Me(e.selectedFeatureIds, e.feicoes), ha(e);
|
|
2471
|
-
}
|
|
2472
|
-
const r = new Set(e.camadas.map((o) => o.id));
|
|
2473
|
-
if (e.activeSettingsLayerId && !r.has(e.activeSettingsLayerId) && (e.activeSettingsLayerId = null), e.editingLayerId && !r.has(e.editingLayerId) && (e.editingLayerId = null), e.expandedFeatureLimits)
|
|
2474
|
-
for (const o of e.expandedFeatureLimits.keys())
|
|
2475
|
-
r.has(o) || e.expandedFeatureLimits.delete(o);
|
|
2476
|
-
const i = e.getAttribute("camada-ativa");
|
|
2477
|
-
e.camadas.length > 0 && (!i || !r.has(i)) && (e.camadaAtivaId = e.camadas[0].id), e.salvarLembrancaEstado(), e.solicitarRenderizacao();
|
|
2478
|
-
}
|
|
2479
|
-
function tr(e, t) {
|
|
2480
|
-
const a = new Map(e.map((i) => [i.id, i])), r = /* @__PURE__ */ new Set();
|
|
2481
|
-
for (const i of t) {
|
|
2482
|
-
const o = a.get(i.id);
|
|
2483
|
-
(!o || !Ua(o, i)) && r.add(i.id);
|
|
2484
|
-
}
|
|
2485
|
-
return r;
|
|
2486
|
-
}
|
|
2487
|
-
function rr(e, t) {
|
|
2488
|
-
const a = e.feicoes;
|
|
2489
|
-
e.feicoes = ba(t);
|
|
2490
|
-
const r = e.selectedFeatureIds.size;
|
|
2491
|
-
Me(e.selectedFeatureIds, e.feicoes), ha(e), e.editingFeatureId && !e.feicoes.some((i) => i.id === e.editingFeatureId) && (e.editingFeatureId = null), e.solicitarAtualizacaoFeicoes({
|
|
2492
|
-
camadas: "todas",
|
|
2493
|
-
idsAlterados: tr(a, e.feicoes),
|
|
2494
|
-
selecaoAfetada: e.selectedFeatureIds.size !== r
|
|
2495
|
-
});
|
|
2496
|
-
}
|
|
2497
|
-
function ir(e, t) {
|
|
2498
|
-
if (!t || !t.id) return;
|
|
2499
|
-
if (e.camadas.some((r) => r.id === t.id)) {
|
|
2500
|
-
console.warn(`[UI-Camadas] adicionarCamada ignorado: já existe uma camada com id '${t.id}'.`);
|
|
2501
|
-
return;
|
|
2502
|
-
}
|
|
2503
|
-
const a = new Set(e.camadas.map((r) => r.id));
|
|
2504
|
-
for (const r of Pe([t])) {
|
|
2505
|
-
if (a.has(r.id)) {
|
|
2506
|
-
console.warn(`[UI-Camadas] adicionarCamada: subcamada '${r.id}' ignorada, o id já existe.`);
|
|
2507
|
-
continue;
|
|
2508
|
-
}
|
|
2509
|
-
a.add(r.id), e.camadas.push(r), e.lembranca.registrarOrigem(r), e.expandedLayers.add(r.id), r.parentId && e.expandedLayers.add(r.parentId);
|
|
2510
|
-
}
|
|
2511
|
-
e.salvarLembrancaEstado(), e.solicitarRenderizacao();
|
|
2512
|
-
}
|
|
2513
|
-
function or(e, t) {
|
|
2514
|
-
var r, i;
|
|
2515
|
-
const a = e.camadas.find((o) => o.id === t);
|
|
2516
|
-
e.camadas.forEach((o) => {
|
|
2517
|
-
o.parentId === t && (o.parentId = null);
|
|
2518
|
-
}), e.camadas = e.camadas.filter((o) => o.id !== t), e.feicoes = e.feicoes.filter((o) => o.layerId !== t), e.ordemFilhosPorPai && (e.ordemFilhosPorPai.delete(t), a != null && a.parentId && U(e.ordemFilhosPorPai, a.parentId, N(t))), e.lembranca.esquecerCamada(t), e.expandedLayers.delete(t), (r = e.expandedFeatureLimits) == null || r.delete(t), e.activeSettingsLayerId === t && (e.activeSettingsLayerId = null), e.editingLayerId === t && (e.editingLayerId = null), e.editingFeatureId && !e.feicoes.some((o) => o.id === e.editingFeatureId) && (e.editingFeatureId = null), Me(e.selectedFeatureIds, e.feicoes), e.selectedFeatureIds.size === 0 && (e.lastClickedFeatureId = null), e.camadaAtivaId === t && (e.camadaAtivaId = ((i = e.camadas[0]) == null ? void 0 : i.id) ?? null), e.salvarLembrancaEstado(), e.solicitarRenderizacao();
|
|
2519
|
-
}
|
|
2520
|
-
function nr(e, t) {
|
|
2521
|
-
if (!(!t || !t.id)) {
|
|
2522
|
-
if (e.feicoes.some((a) => a.id === t.id)) {
|
|
2523
|
-
console.warn(`[UI-Camadas] adicionarFeicao ignorado: já existe uma feição com id '${t.id}'.`);
|
|
2524
|
-
return;
|
|
2525
|
-
}
|
|
2526
|
-
e.feicoes.push({ ...t }), e.solicitarAtualizacaoFeicoes({
|
|
2527
|
-
camadas: /* @__PURE__ */ new Set([t.layerId || ""]),
|
|
2528
|
-
idsAlterados: /* @__PURE__ */ new Set(),
|
|
2529
|
-
selecaoAfetada: e.selectedFeatureIds.has(t.id)
|
|
2530
|
-
});
|
|
2531
|
-
}
|
|
2532
|
-
}
|
|
2533
|
-
function sr(e, t) {
|
|
2534
|
-
if (!t || typeof t != "object" || !t.id) return;
|
|
2535
|
-
const a = e.feicoes.findIndex((r) => r.id === t.id);
|
|
2536
|
-
if (a !== -1) {
|
|
2537
|
-
const r = e.feicoes[a].layerId || "";
|
|
2538
|
-
e.feicoes[a] = { ...e.feicoes[a], ...t }, e.solicitarAtualizacaoFeicoes({
|
|
2539
|
-
camadas: /* @__PURE__ */ new Set([r, e.feicoes[a].layerId || ""]),
|
|
2540
|
-
idsAlterados: /* @__PURE__ */ new Set([t.id]),
|
|
2541
|
-
selecaoAfetada: !1
|
|
2542
|
-
});
|
|
2543
|
-
}
|
|
2544
|
-
}
|
|
2545
|
-
function dr(e, t) {
|
|
2546
|
-
const a = e.feicoes.find((i) => i.id === t);
|
|
2547
|
-
e.feicoes = e.feicoes.filter((i) => i.id !== t), a != null && a.layerId && e.ordemFilhosPorPai && U(e.ordemFilhosPorPai, a.layerId, j(t));
|
|
2548
|
-
const r = e.selectedFeatureIds.delete(t);
|
|
2549
|
-
e.lastClickedFeatureId === t && (e.lastClickedFeatureId = null), e.editingFeatureId === t && (e.editingFeatureId = null), e.solicitarAtualizacaoFeicoes({
|
|
2550
|
-
camadas: new Set(a ? [a.layerId || ""] : []),
|
|
2551
|
-
idsAlterados: /* @__PURE__ */ new Set(),
|
|
2552
|
-
selecaoAfetada: r
|
|
2553
|
-
});
|
|
2554
|
-
}
|
|
2555
|
-
function cr(e) {
|
|
2556
|
-
function r() {
|
|
2557
|
-
return e.getMinAltura ? e.getMinAltura() : 140;
|
|
2558
|
-
}
|
|
2559
|
-
function i() {
|
|
2560
|
-
return e.getMaxAltura ? e.getMaxAltura() : 1600;
|
|
2561
|
-
}
|
|
2562
|
-
function o(d, l = !1) {
|
|
2563
|
-
if (d == null || d === "") {
|
|
2564
|
-
e.hostElement.style.removeProperty("height"), e.hostElement.style.removeProperty("--ui-camadas-altura"), l && e.hostElement.dispatchEvent(
|
|
2565
|
-
new CustomEvent("ui-redimensionar-altura", {
|
|
2566
|
-
bubbles: !0,
|
|
2567
|
-
composed: !0,
|
|
2568
|
-
detail: { altura: null }
|
|
2569
|
-
})
|
|
2570
|
-
);
|
|
2571
|
-
return;
|
|
2572
|
-
}
|
|
2573
|
-
const p = typeof d == "number" ? d : parseFloat(String(d));
|
|
2574
|
-
if (isNaN(p)) return;
|
|
2575
|
-
const u = Math.max(r(), Math.min(i(), Math.round(p)));
|
|
2576
|
-
e.hostElement.style.height = `${u}px`, e.hostElement.style.setProperty("--ui-camadas-altura", `${u}px`), l && e.hostElement.dispatchEvent(
|
|
2577
|
-
new CustomEvent("ui-redimensionar-altura", {
|
|
2578
|
-
bubbles: !0,
|
|
2579
|
-
composed: !0,
|
|
2580
|
-
detail: { altura: u }
|
|
2581
|
-
})
|
|
2582
|
-
);
|
|
2583
|
-
}
|
|
2584
|
-
let n = null;
|
|
2585
|
-
function s() {
|
|
2586
|
-
if (!e.resizerElement) return;
|
|
2587
|
-
let d = !1, l = 0, p = 0;
|
|
2588
|
-
const u = (m) => {
|
|
2589
|
-
if (m.button !== 0) return;
|
|
2590
|
-
m.preventDefault(), m.stopPropagation(), d = !0, l = m.clientY, p = e.hostElement.getBoundingClientRect().height, e.resizerElement.classList.add("ui-camadas-resizer--ativo"), e.hostElement.classList.add("ui-camadas--redimensionando");
|
|
2591
|
-
try {
|
|
2592
|
-
e.resizerElement.setPointerCapture(m.pointerId);
|
|
2593
|
-
} catch {
|
|
2594
|
-
}
|
|
2595
|
-
const v = (y) => {
|
|
2596
|
-
if (!d) return;
|
|
2597
|
-
y.preventDefault();
|
|
2598
|
-
const k = y.clientY - l, L = Math.max(r(), Math.min(i(), Math.round(p + k)));
|
|
2599
|
-
e.hostElement.style.height = `${L}px`, e.hostElement.style.setProperty("--ui-camadas-altura", `${L}px`), e.onRedimensionando && e.onRedimensionando(L), e.hostElement.dispatchEvent(
|
|
2600
|
-
new CustomEvent("ui-redimensionando-altura", {
|
|
2601
|
-
bubbles: !0,
|
|
2602
|
-
composed: !0,
|
|
2603
|
-
detail: { altura: L }
|
|
2604
|
-
})
|
|
2605
|
-
);
|
|
2606
|
-
}, h = () => {
|
|
2607
|
-
var y;
|
|
2608
|
-
d = !1, n = null, window.removeEventListener("pointermove", v), window.removeEventListener("pointerup", g), window.removeEventListener("pointercancel", g), (y = e.resizerElement) == null || y.classList.remove("ui-camadas-resizer--ativo"), e.hostElement.classList.remove("ui-camadas--redimensionando");
|
|
2609
|
-
}, g = (y) => {
|
|
2610
|
-
if (!d) return;
|
|
2611
|
-
d = !1, e.resizerElement.classList.remove("ui-camadas-resizer--ativo"), e.hostElement.classList.remove("ui-camadas--redimensionando");
|
|
2612
|
-
try {
|
|
2613
|
-
e.resizerElement.hasPointerCapture(y.pointerId) && e.resizerElement.releasePointerCapture(y.pointerId);
|
|
2614
|
-
} catch {
|
|
2615
|
-
}
|
|
2616
|
-
window.removeEventListener("pointermove", v), window.removeEventListener("pointerup", g), window.removeEventListener("pointercancel", g);
|
|
2617
|
-
const k = e.hostElement.getBoundingClientRect().height, L = Math.round(k);
|
|
2618
|
-
e.onAlturaAlterada && e.onAlturaAlterada(L), e.hostElement.dispatchEvent(
|
|
2619
|
-
new CustomEvent("ui-redimensionar-altura", {
|
|
2620
|
-
bubbles: !0,
|
|
2621
|
-
composed: !0,
|
|
2622
|
-
detail: { altura: L }
|
|
2623
|
-
})
|
|
2624
|
-
);
|
|
2625
|
-
};
|
|
2626
|
-
n = h, window.addEventListener("pointermove", v), window.addEventListener("pointerup", g), window.addEventListener("pointercancel", g);
|
|
2627
|
-
}, f = (m) => {
|
|
2628
|
-
m.preventDefault(), m.stopPropagation(), o(null, !0), e.onAlturaAlterada && e.onAlturaAlterada(null);
|
|
2629
|
-
};
|
|
2630
|
-
e.listeners.add(e.resizerElement, "pointerdown", u), e.listeners.add(e.resizerElement, "dblclick", f);
|
|
2631
|
-
}
|
|
2632
|
-
function c() {
|
|
2633
|
-
n == null || n(), e.listeners.cleanup();
|
|
2634
|
-
}
|
|
2635
|
-
return {
|
|
2636
|
-
init: s,
|
|
2637
|
-
definirAltura: o,
|
|
2638
|
-
destruir: c
|
|
2639
|
-
};
|
|
2640
|
-
}
|
|
2641
|
-
const X = class X extends Pa {
|
|
2642
|
-
constructor() {
|
|
2643
|
-
super();
|
|
2644
|
-
A(this, "shadow");
|
|
2645
|
-
A(this, "listeners", new Da());
|
|
2646
|
-
A(this, "dragDropManager");
|
|
2647
|
-
A(this, "resizerController");
|
|
2648
|
-
A(this, "bordaResizeObserver", null);
|
|
2649
|
-
A(this, "alturaCustomizada", null);
|
|
2650
|
-
A(this, "conectado", !1);
|
|
2651
|
-
A(this, "profundidadeLote", 0);
|
|
2652
|
-
A(this, "renderPendente", !1);
|
|
2653
|
-
/** Mudança de feições à espera do `render()` (consumida nele): permite atualizar só as linhas afetadas. */
|
|
2654
|
-
A(this, "mudancaFeicoes", null);
|
|
2655
|
-
/** @internal */
|
|
2656
|
-
A(this, "lembranca", new er(() => ({
|
|
2657
|
-
persistir: this.persistir,
|
|
2658
|
-
conectado: this.conectado,
|
|
2659
|
-
storageKey: this.storageKey,
|
|
2660
|
-
id: this.id,
|
|
2661
|
-
camadas: this.camadas,
|
|
2662
|
-
expandedLayers: this.expandedLayers,
|
|
2663
|
-
camadaAtivaId: this.camadaAtivaId,
|
|
2664
|
-
painelColapsado: this.colapsado,
|
|
2665
|
-
mapaBaseAtivo: this.mapaBaseAtivo,
|
|
2666
|
-
densidade: this.densidade,
|
|
2667
|
-
altura: this.alturaCustomizada,
|
|
2668
|
-
ordemFilhosPorPai: this.ordemFilhosPorPai
|
|
2669
|
-
})));
|
|
2670
|
-
// Estado interno
|
|
2671
|
-
A(this, "camadas", []);
|
|
2672
|
-
A(this, "feicoes", []);
|
|
2673
|
-
A(this, "mapasBase", [...Xe]);
|
|
2674
|
-
A(this, "expandedLayers", /* @__PURE__ */ new Set());
|
|
2675
|
-
A(this, "expandedFeatureLimits", /* @__PURE__ */ new Map());
|
|
2676
|
-
A(this, "ordemFilhosPorPai", /* @__PURE__ */ new Map());
|
|
2677
|
-
A(this, "selectedFeatureIds", /* @__PURE__ */ new Set());
|
|
2678
|
-
A(this, "lastClickedFeatureId", null);
|
|
2679
|
-
A(this, "activeSettingsLayerId", null);
|
|
2680
|
-
A(this, "editingLayerId", null);
|
|
2681
|
-
A(this, "editingFeatureId", null);
|
|
2682
|
-
A(this, "searchQuery", "");
|
|
2683
|
-
A(this, "corpoElement");
|
|
2684
|
-
A(this, "btnExpandirFlutuante");
|
|
2685
|
-
this.shadow = this.attachShadow({ mode: "open" }), this.shadow.innerHTML = `
|
|
2686
|
-
<style>${mt}</style>
|
|
2687
|
-
<div class="ui-camadas-container" id="panel-container" part="base" role="region" aria-label="Painel de Camadas">
|
|
2688
|
-
<div class="ui-camadas-corpo" id="painel-corpo" part="corpo"></div>
|
|
2689
|
-
<div class="ui-camadas-resizer-altura" id="resizer-altura" part="resizer" title="Arraste para redimensionar a altura (duplo-clique para resetar)" aria-label="Redimensionar altura">
|
|
2690
|
-
<span class="ui-camadas-resizer-grip"></span>
|
|
2691
|
-
</div>
|
|
2692
|
-
</div>
|
|
2693
|
-
<button class="ui-camadas-toggle-flutuante" id="btn-expandir-flutuante" part="botao-expandir" title="Expandir Painel de Camadas" aria-label="Expandir Painel de Camadas">
|
|
2694
|
-
${b.camadas}
|
|
2695
|
-
</button>
|
|
2696
|
-
`, this.corpoElement = this.shadow.getElementById("painel-corpo"), this.btnExpandirFlutuante = this.shadow.getElementById("btn-expandir-flutuante"), this.dragDropManager = new nt(this, this.shadow);
|
|
2697
|
-
const a = this.shadow.getElementById("resizer-altura");
|
|
2698
|
-
this.resizerController = cr({
|
|
2699
|
-
hostElement: this,
|
|
2700
|
-
resizerElement: a,
|
|
2701
|
-
listeners: this.listeners,
|
|
2702
|
-
getMinAltura: () => {
|
|
2703
|
-
const r = this.getAttribute("min-altura");
|
|
2704
|
-
return r && parseFloat(r) || 140;
|
|
2705
|
-
},
|
|
2706
|
-
getMaxAltura: () => {
|
|
2707
|
-
const r = this.getAttribute("max-altura");
|
|
2708
|
-
return r && parseFloat(r) || 1600;
|
|
2709
|
-
},
|
|
2710
|
-
onAlturaAlterada: (r) => {
|
|
2711
|
-
this.alturaCustomizada = r, this.salvarLembrancaEstado();
|
|
2712
|
-
}
|
|
2713
|
-
});
|
|
2714
|
-
}
|
|
2715
|
-
static get observedAttributes() {
|
|
2716
|
-
return [
|
|
2717
|
-
"titulo",
|
|
2718
|
-
"mapa-base-ativo",
|
|
2719
|
-
"camada-ativa",
|
|
2720
|
-
"aba-ativa",
|
|
2721
|
-
"colapsavel",
|
|
2722
|
-
"colapsado",
|
|
2723
|
-
"flutuante",
|
|
2724
|
-
"mostrar-mapas-base",
|
|
2725
|
-
"mapas-base-recolhido",
|
|
2726
|
-
"mostrar-rodape",
|
|
2727
|
-
"mostrar-busca",
|
|
2728
|
-
"densidade",
|
|
2729
|
-
"persistir",
|
|
2730
|
-
"storage-key",
|
|
2731
|
-
"redimensionavel",
|
|
2732
|
-
"redimensionavel-altura",
|
|
2733
|
-
"altura",
|
|
2734
|
-
"min-altura",
|
|
2735
|
-
"max-altura",
|
|
2736
|
-
"borda-canvas",
|
|
2737
|
-
...Ba
|
|
2738
|
-
];
|
|
2739
|
-
}
|
|
2740
|
-
connectedCallback() {
|
|
2741
|
-
var a;
|
|
2742
|
-
if (this.persistir) {
|
|
2743
|
-
const r = Se(this.obterChaveStorageAtual());
|
|
2744
|
-
r && (r.painelColapsado === !0 && !this.hasAttribute("colapsado") && (this.colapsado = !0), r.camadaAtivaId && !this.getAttribute("camada-ativa") && (this.camadaAtivaId = r.camadaAtivaId), r.mapaBaseAtivo && !this.getAttribute("mapa-base-ativo") && (this.mapaBaseAtivo = r.mapaBaseAtivo), r.densidade && !this.getAttribute("densidade") && (this.densidade = r.densidade), typeof r.altura == "number" && !this.getAttribute("altura") && !this.style.height && (this.resizerController.definirAltura(r.altura, !1), this.alturaCustomizada = r.altura));
|
|
2745
|
-
}
|
|
2746
|
-
this.hasAttribute("altura") && this.resizerController.definirAltura(this.getAttribute("altura"), !1), this.persistir && !this.storageKey && !this.id && (X.instanciasChavePadrao.size > 0 && console.warn(
|
|
2747
|
-
"[UI-Camadas] Mais de um painel sem 'id' nem 'storage-key' divide a mesma chave de persistência e um sobrescreve o estado do outro. Defina 'storage-key' (ou 'id') em cada um."
|
|
2748
|
-
), X.instanciasChavePadrao.add(this)), this.resizerController.init(), Oe(this, this.shadow.getElementById("panel-container")), this.atualizarBordaCanvas(), typeof window < "u" && this.listeners.add(window, "resize", () => this.atualizarBordaCanvas()), typeof ResizeObserver < "u" && ((a = this.bordaResizeObserver) == null || a.disconnect(), this.bordaResizeObserver = new ResizeObserver(() => this.atualizarBordaCanvas()), this.bordaResizeObserver.observe(this)), this.render(), this.conectarEventosGerais(), Qt(this, this, this.shadow, this.corpoElement, this.listeners), this.conectado = !0, this.camadas.length > 0 && this.salvarLembrancaEstado();
|
|
2749
|
-
}
|
|
2750
|
-
disconnectedCallback() {
|
|
2751
|
-
var a, r, i;
|
|
2752
|
-
this.conectado = !1, X.instanciasChavePadrao.delete(this), (a = this.bordaResizeObserver) == null || a.disconnect(), this.bordaResizeObserver = null, (r = this.resizerController) == null || r.destruir(), (i = this.dragDropManager) == null || i.destruir(), It(this), this.listeners.cleanup();
|
|
2753
|
-
}
|
|
2754
|
-
attributeChangedCallback(a, r, i) {
|
|
2755
|
-
var o, n;
|
|
2756
|
-
if (r !== i) {
|
|
2757
|
-
if (qa(a)) {
|
|
2758
|
-
Oe(this, this.shadow.getElementById("panel-container"));
|
|
2759
|
-
return;
|
|
2760
|
-
}
|
|
2761
|
-
a === "colapsado" ? this.salvarLembrancaEstado() : a === "camada-ativa" ? (this.sincronizarCamadaAtivaDOM(), this.salvarLembrancaEstado()) : a === "densidade" ? this.salvarLembrancaEstado() : a === "mapa-base-ativo" ? i && this.marcarMapaBaseAtivoNoDOM(i) : a === "titulo" || a === "mostrar-mapas-base" || a === "mapas-base-recolhido" || a === "mostrar-rodape" || a === "mostrar-busca" || a === "colapsavel" || a === "flutuante" ? this.solicitarRenderizacao() : a === "altura" ? (o = this.resizerController) == null || o.definirAltura(i, !1) : a === "min-altura" || a === "max-altura" ? this.alturaCustomizada !== null && ((n = this.resizerController) == null || n.definirAltura(this.alturaCustomizada, !1)) : a === "borda-canvas" && this.atualizarBordaCanvas();
|
|
2762
|
-
}
|
|
2763
|
-
}
|
|
2764
|
-
/**
|
|
2765
|
-
* Define em qual lado do painel aparece a faixinha fina de separação com o canvas:
|
|
2766
|
-
* nunca na borda encostada na tela, sempre no lado voltado ao canvas (ou ambos se solto).
|
|
2767
|
-
*/
|
|
2768
|
-
atualizarBordaCanvas() {
|
|
2769
|
-
const a = this.shadow.getElementById("panel-container");
|
|
2770
|
-
if (!a) return;
|
|
2771
|
-
const r = this.getAttribute("borda-canvas");
|
|
2772
|
-
if (r === "esquerda" || r === "direita" || r === "ambas" || r === "nenhuma") {
|
|
2773
|
-
a.setAttribute("data-borda-canvas", r);
|
|
2774
|
-
return;
|
|
2775
|
-
}
|
|
2776
|
-
let i = "esquerda";
|
|
2777
|
-
if (typeof window < "u" && typeof this.getBoundingClientRect == "function") {
|
|
2778
|
-
const o = this.getBoundingClientRect(), n = window.innerWidth || 0;
|
|
2779
|
-
if (o.width > 0 && n > 0) {
|
|
2780
|
-
const s = o.left <= 2, c = n - o.right <= 2;
|
|
2781
|
-
c && !s ? i = "esquerda" : s && !c ? i = "direita" : s && c ? i = "nenhuma" : i = "ambas";
|
|
2782
|
-
}
|
|
2783
|
-
}
|
|
2784
|
-
a.setAttribute("data-borda-canvas", i);
|
|
2785
|
-
}
|
|
2786
|
-
// --- Getters e Setters de Propriedades Reativas ---
|
|
2787
|
-
get titulo() {
|
|
2788
|
-
return this.getAttribute("titulo") || "Camadas";
|
|
2789
|
-
}
|
|
2790
|
-
set titulo(a) {
|
|
2791
|
-
this.setAttribute("titulo", a);
|
|
2792
|
-
}
|
|
2793
|
-
get camadaAtivaId() {
|
|
2794
|
-
var a;
|
|
2795
|
-
return this.getAttribute("camada-ativa") || (((a = this.camadas[0]) == null ? void 0 : a.id) ?? null);
|
|
2796
|
-
}
|
|
2797
|
-
set camadaAtivaId(a) {
|
|
2798
|
-
a ? this.setAttribute("camada-ativa", a) : this.removeAttribute("camada-ativa");
|
|
2799
|
-
}
|
|
2800
|
-
get mapaBaseAtivo() {
|
|
2801
|
-
return this.getAttribute("mapa-base-ativo") || "satelite";
|
|
2802
|
-
}
|
|
2803
|
-
set mapaBaseAtivo(a) {
|
|
2804
|
-
this.setAttribute("mapa-base-ativo", a);
|
|
2805
|
-
}
|
|
2806
|
-
selecionarMapaBase(a, r = !1) {
|
|
2807
|
-
!a || this.mapaBaseAtivo === a || (this.mapaBaseAtivo = a, this.marcarMapaBaseAtivoNoDOM(a), this.salvarLembrancaEstado(), r && this.dispararEvento("ui-mapa-base-alterado", { mapaBaseId: a }));
|
|
2808
|
-
}
|
|
2809
|
-
marcarMapaBaseAtivoNoDOM(a) {
|
|
2810
|
-
this.shadow.querySelectorAll("[data-basemap-id]").forEach((i) => {
|
|
2811
|
-
const o = i.getAttribute("data-basemap-id") === a;
|
|
2812
|
-
i.classList.toggle("active", o), i.setAttribute("aria-pressed", String(o));
|
|
2813
|
-
});
|
|
2814
|
-
const r = this.shadow.querySelector("[data-basemap-atual]");
|
|
2815
|
-
r && (r.textContent = We(this.mapasBase, a));
|
|
2816
|
-
}
|
|
2817
|
-
/** Seção "Mapa Base" recolhida (só o cabeçalho com o mapa ativo). Atributo `mapas-base-recolhido`. */
|
|
2818
|
-
get mapasBaseRecolhido() {
|
|
2819
|
-
return this.hasAttribute("mapas-base-recolhido");
|
|
2820
|
-
}
|
|
2821
|
-
set mapasBaseRecolhido(a) {
|
|
2822
|
-
a ? this.setAttribute("mapas-base-recolhido", "") : this.removeAttribute("mapas-base-recolhido");
|
|
2823
|
-
}
|
|
2824
|
-
/** Alterna a seção de mapas base; com `emitirEvento`, dispara `ui-mapas-base-recolhimento`. */
|
|
2825
|
-
alternarMapasBaseRecolhido(a = !1) {
|
|
2826
|
-
this.mapasBaseRecolhido = !this.mapasBaseRecolhido, a && this.dispararEvento("ui-mapas-base-recolhimento", { recolhido: this.mapasBaseRecolhido });
|
|
2827
|
-
}
|
|
2828
|
-
get abaAtiva() {
|
|
2829
|
-
return this.getAttribute("aba-ativa") || "camadas";
|
|
2830
|
-
}
|
|
2831
|
-
set abaAtiva(a) {
|
|
2832
|
-
this.setAttribute("aba-ativa", a);
|
|
2833
|
-
}
|
|
2834
|
-
get colapsado() {
|
|
2835
|
-
return this.hasAttribute("colapsado");
|
|
2836
|
-
}
|
|
2837
|
-
set colapsado(a) {
|
|
2838
|
-
a ? this.setAttribute("colapsado", "") : this.removeAttribute("colapsado");
|
|
2839
|
-
}
|
|
2840
|
-
get colapsavel() {
|
|
2841
|
-
return this.getAttribute("colapsavel") !== "false";
|
|
2842
|
-
}
|
|
2843
|
-
set colapsavel(a) {
|
|
2844
|
-
this.setAttribute("colapsavel", String(a));
|
|
2845
|
-
}
|
|
2846
|
-
get flutuante() {
|
|
2847
|
-
return this.hasAttribute("flutuante");
|
|
2848
|
-
}
|
|
2849
|
-
set flutuante(a) {
|
|
2850
|
-
a ? this.setAttribute("flutuante", "") : this.removeAttribute("flutuante");
|
|
2851
|
-
}
|
|
2852
|
-
get densidade() {
|
|
2853
|
-
return this.getAttribute("densidade") || "normal";
|
|
2854
|
-
}
|
|
2855
|
-
set densidade(a) {
|
|
2856
|
-
this.setAttribute("densidade", a);
|
|
2857
|
-
}
|
|
2858
|
-
get mostrarMapasBase() {
|
|
2859
|
-
return this.getAttribute("mostrar-mapas-base") !== "false";
|
|
2860
|
-
}
|
|
2861
|
-
set mostrarMapasBase(a) {
|
|
2862
|
-
this.setAttribute("mostrar-mapas-base", String(a));
|
|
2863
|
-
}
|
|
2864
|
-
get mostrarRodape() {
|
|
2865
|
-
return this.getAttribute("mostrar-rodape") !== "false";
|
|
2866
|
-
}
|
|
2867
|
-
set mostrarRodape(a) {
|
|
2868
|
-
this.setAttribute("mostrar-rodape", String(a));
|
|
2869
|
-
}
|
|
2870
|
-
get mostrarBusca() {
|
|
2871
|
-
return this.getAttribute("mostrar-busca") !== "false";
|
|
2872
|
-
}
|
|
2873
|
-
set mostrarBusca(a) {
|
|
2874
|
-
this.setAttribute("mostrar-busca", String(a));
|
|
2875
|
-
}
|
|
2876
|
-
get persistir() {
|
|
2877
|
-
return this.getAttribute("persistir") !== "false";
|
|
2878
|
-
}
|
|
2879
|
-
set persistir(a) {
|
|
2880
|
-
this.setAttribute("persistir", String(a));
|
|
2881
|
-
}
|
|
2882
|
-
get storageKey() {
|
|
2883
|
-
return this.getAttribute("storage-key");
|
|
2884
|
-
}
|
|
2885
|
-
set storageKey(a) {
|
|
2886
|
-
a ? this.setAttribute("storage-key", a) : this.removeAttribute("storage-key");
|
|
2887
|
-
}
|
|
2888
|
-
get redimensionavel() {
|
|
2889
|
-
return this.hasAttribute("redimensionavel") || this.hasAttribute("redimensionavel-altura");
|
|
2890
|
-
}
|
|
2891
|
-
set redimensionavel(a) {
|
|
2892
|
-
a ? this.setAttribute("redimensionavel", "") : (this.removeAttribute("redimensionavel"), this.removeAttribute("redimensionavel-altura"));
|
|
2893
|
-
}
|
|
2894
|
-
get altura() {
|
|
2895
|
-
return this.getAttribute("altura") || this.style.height || null;
|
|
2896
|
-
}
|
|
2897
|
-
set altura(a) {
|
|
2898
|
-
a != null ? (this.setAttribute("altura", String(a)), this.definirAltura(a)) : (this.removeAttribute("altura"), this.definirAltura(null));
|
|
2899
|
-
}
|
|
2900
|
-
definirAltura(a, r = !0) {
|
|
2901
|
-
var o;
|
|
2902
|
-
(o = this.resizerController) == null || o.definirAltura(a, !1);
|
|
2903
|
-
const i = a !== null ? parseFloat(String(a)) : null;
|
|
2904
|
-
this.alturaCustomizada = isNaN(i) ? null : i, r && this.salvarLembrancaEstado();
|
|
2905
|
-
}
|
|
2906
|
-
// --- Gerenciamento de Persistência / Lembrança ---
|
|
2907
|
-
obterChaveStorageAtual() {
|
|
2908
|
-
return this.lembranca.chaveAtual();
|
|
2909
|
-
}
|
|
2910
|
-
/** Versão com debounce, para interações contínuas (seletor de cor, slider de opacidade). */
|
|
2911
|
-
agendarSalvarLembranca() {
|
|
2912
|
-
this.lembranca.agendar();
|
|
2913
|
-
}
|
|
2914
|
-
salvarLembrancaEstado() {
|
|
2915
|
-
this.lembranca.salvar();
|
|
2916
|
-
}
|
|
2917
|
-
limparLembranca() {
|
|
2918
|
-
this.expandedFeatureLimits.clear(), this.ordemFilhosPorPai.clear(), this.lembranca.limpar();
|
|
2919
|
-
}
|
|
2920
|
-
// --- API Pública de Alta Ergonomia ---
|
|
2921
|
-
//
|
|
2922
|
-
// Contrato de eventos: toda mutação feita pelo aplicativo consumidor (propriedades,
|
|
2923
|
-
// atributos e métodos públicos) atualiza apenas o DOM interno, sem disparar eventos.
|
|
2924
|
-
// Eventos saem do componente somente em resposta a uma interação física do usuário
|
|
2925
|
-
// (clique, drag-and-drop, teclado). Métodos que aceitam `emitirEvento` permitem
|
|
2926
|
-
// optar explicitamente pela emissão quando necessário.
|
|
2927
|
-
/** Atalho reativo para `definirCamadas()` — não dispara eventos. */
|
|
2928
|
-
get layers() {
|
|
2929
|
-
return this.camadas;
|
|
2930
|
-
}
|
|
2931
|
-
set layers(a) {
|
|
2932
|
-
this.definirCamadas(a);
|
|
2933
|
-
}
|
|
2934
|
-
/** Atalho reativo para `definirFeicoes()` — não dispara eventos. */
|
|
2935
|
-
get features() {
|
|
2936
|
-
return this.feicoes;
|
|
2937
|
-
}
|
|
2938
|
-
set features(a) {
|
|
2939
|
-
this.definirFeicoes(a);
|
|
2940
|
-
}
|
|
2941
|
-
/** Atalho reativo para `definirMapasBase()` — não dispara eventos. */
|
|
2942
|
-
get basemaps() {
|
|
2943
|
-
return this.mapasBase;
|
|
2944
|
-
}
|
|
2945
|
-
set basemaps(a) {
|
|
2946
|
-
this.definirMapasBase(a);
|
|
2947
|
-
}
|
|
2948
|
-
definirCamadas(a, r) {
|
|
2949
|
-
ar(this, a, r);
|
|
2950
|
-
}
|
|
2951
|
-
definirFeicoes(a) {
|
|
2952
|
-
rr(this, a);
|
|
2953
|
-
}
|
|
2954
|
-
definirMapasBase(a) {
|
|
2955
|
-
this.mapasBase = Array.isArray(a) ? [...a] : [], this.solicitarRenderizacao();
|
|
2956
|
-
}
|
|
2957
|
-
definirCamadaAtiva(a, r = !1) {
|
|
2958
|
-
!a || this.camadaAtivaId === a || (this.camadaAtivaId = a, this.sincronizarCamadaAtivaDOM(), this.salvarLembrancaEstado(), r && this.dispararEvento("ui-camada-selecionada", {
|
|
2959
|
-
camadaId: a,
|
|
2960
|
-
camada: this.camadas.find((i) => i.id === a)
|
|
2961
|
-
}));
|
|
2962
|
-
}
|
|
2963
|
-
obterCamada(a) {
|
|
2964
|
-
return this.camadas.find((r) => r.id === a);
|
|
2965
|
-
}
|
|
2966
|
-
obterCamadaAtiva() {
|
|
2967
|
-
return this.camadas.find((a) => a.id === this.camadaAtivaId);
|
|
2968
|
-
}
|
|
2969
|
-
obterFeicao(a) {
|
|
2970
|
-
return this.feicoes.find((r) => r.id === a);
|
|
2971
|
-
}
|
|
2972
|
-
obterFeicoesSelecionadas() {
|
|
2973
|
-
return this.feicoes.filter((a) => this.selectedFeatureIds.has(a.id));
|
|
2974
|
-
}
|
|
2975
|
-
adicionarCamada(a) {
|
|
2976
|
-
ir(this, a);
|
|
2977
|
-
}
|
|
2978
|
-
removerCamada(a) {
|
|
2979
|
-
or(this, a);
|
|
2980
|
-
}
|
|
2981
|
-
adicionarFeicao(a) {
|
|
2982
|
-
nr(this, a);
|
|
2983
|
-
}
|
|
2984
|
-
atualizarFeicao(a) {
|
|
2985
|
-
sr(this, a);
|
|
2986
|
-
}
|
|
2987
|
-
removerFeicao(a) {
|
|
2988
|
-
dr(this, a);
|
|
2989
|
-
}
|
|
2990
|
-
selecionarFeicao(a, r = !1, i = !1, o = !1) {
|
|
2991
|
-
Xt(this, a, r, i, o);
|
|
2992
|
-
}
|
|
2993
|
-
selecionarFeicoes(a, r = !1) {
|
|
2994
|
-
Wt(this, a, r);
|
|
2995
|
-
}
|
|
2996
|
-
limparSelecao(a = !1) {
|
|
2997
|
-
Jt(this, a);
|
|
2998
|
-
}
|
|
2999
|
-
expandirTodas() {
|
|
3000
|
-
this.expandedLayers = new Set(this.camadas.map((a) => a.id)), this.salvarLembrancaEstado(), this.solicitarRenderizacao();
|
|
3001
|
-
}
|
|
3002
|
-
colapsarTodas() {
|
|
3003
|
-
this.expandedLayers.clear(), this.salvarLembrancaEstado(), this.solicitarRenderizacao();
|
|
3004
|
-
}
|
|
3005
|
-
alternarExpansao(a) {
|
|
3006
|
-
a && (this.expandedLayers.has(a) ? this.expandedLayers.delete(a) : this.expandedLayers.add(a), this.salvarLembrancaEstado(), this.solicitarRenderizacao());
|
|
3007
|
-
}
|
|
3008
|
-
incrementarLimiteFeicoes(a) {
|
|
3009
|
-
if (!a) return;
|
|
3010
|
-
const r = this.expandedFeatureLimits.get(a) ?? 80;
|
|
3011
|
-
this.expandedFeatureLimits.set(a, r + 80), this.solicitarRenderizacao();
|
|
3012
|
-
}
|
|
3013
|
-
alternarVisibilidadeTodas(a = !1) {
|
|
3014
|
-
const i = !this.camadas.some((o) => o.visible !== !1);
|
|
3015
|
-
this.camadas.forEach((o) => {
|
|
3016
|
-
o.visible = i, a && this.dispararEvento("ui-camada-visibilidade", { camadaId: o.id, visivel: i });
|
|
3017
|
-
}), this.salvarLembrancaEstado(), this.solicitarRenderizacao();
|
|
3018
|
-
}
|
|
3019
|
-
colapsar(a = !1) {
|
|
3020
|
-
this.definirColapso(!0, a);
|
|
3021
|
-
}
|
|
3022
|
-
expandir(a = !1) {
|
|
3023
|
-
this.definirColapso(!1, a);
|
|
3024
|
-
}
|
|
3025
|
-
alternarColapso(a = !1) {
|
|
3026
|
-
this.definirColapso(!this.colapsado, a);
|
|
3027
|
-
}
|
|
3028
|
-
definirColapso(a, r) {
|
|
3029
|
-
this.colapsado !== a && (this.colapsado = a, r && this.dispararEvento("ui-colapso-alterado", { colapsado: a }));
|
|
3030
|
-
}
|
|
3031
|
-
// --- Renderização e Ciclo de Vida ---
|
|
3032
|
-
solicitarRenderizacao() {
|
|
3033
|
-
if (this.profundidadeLote > 0) {
|
|
3034
|
-
this.renderPendente = !0;
|
|
3035
|
-
return;
|
|
3036
|
-
}
|
|
3037
|
-
this.render();
|
|
3038
|
-
}
|
|
3039
|
-
/**
|
|
3040
|
-
* Caminho das mutações de feição: o DOM fica atualizado na volta da chamada, mas só as linhas afetadas são
|
|
3041
|
-
* refeitas quando possível. Em `emLote` vale o adiamento de sempre (uma renderização completa no fim).
|
|
3042
|
-
* Qualquer caso que o caminho incremental não garanta (busca, edição inline, drawer, camada fora da árvore…)
|
|
3043
|
-
* cai no render completo.
|
|
3044
|
-
*/
|
|
3045
|
-
solicitarAtualizacaoFeicoes(a) {
|
|
3046
|
-
if (this.profundidadeLote > 0) {
|
|
3047
|
-
this.renderPendente = !0;
|
|
3048
|
-
return;
|
|
3049
|
-
}
|
|
3050
|
-
this.mudancaFeicoes = a, this.render();
|
|
3051
|
-
}
|
|
3052
|
-
/**
|
|
3053
|
-
* Agrupa várias mutações (`adicionarFeicao` em laço, por exemplo) em uma só renderização, ao fim de `fn`.
|
|
3054
|
-
* Mesmo com a atualização incremental, é a forma ideal para cargas grandes: o DOM é refeito uma só vez.
|
|
3055
|
-
*/
|
|
3056
|
-
emLote(a) {
|
|
3057
|
-
this.profundidadeLote++;
|
|
3058
|
-
try {
|
|
3059
|
-
a();
|
|
3060
|
-
} finally {
|
|
3061
|
-
this.profundidadeLote--, this.profundidadeLote === 0 && this.renderPendente && (this.renderPendente = !1, this.render());
|
|
3062
|
-
}
|
|
3063
|
-
}
|
|
3064
|
-
dispararEvento(a, r) {
|
|
3065
|
-
this.dispatchEvent(
|
|
3066
|
-
new CustomEvent(a, {
|
|
3067
|
-
detail: r,
|
|
3068
|
-
bubbles: !0,
|
|
3069
|
-
composed: !0
|
|
3070
|
-
})
|
|
3071
|
-
);
|
|
3072
|
-
}
|
|
3073
|
-
render() {
|
|
3074
|
-
const a = this.mudancaFeicoes;
|
|
3075
|
-
this.mudancaFeicoes = null, this.corpoElement && (a && Ht(this, this.shadow, this.dragDropManager, a) || Nt(this, this.shadow, this.corpoElement, this.dragDropManager));
|
|
3076
|
-
}
|
|
3077
|
-
// --- Conexão de Eventos ---
|
|
3078
|
-
conectarEventosGerais() {
|
|
3079
|
-
this.listeners.add(this.btnExpandirFlutuante, "click", () => this.expandir(!0));
|
|
3080
|
-
}
|
|
3081
|
-
// --- Sincronização de DOM (delegada) ---
|
|
3082
|
-
sincronizarCamadaAtivaDOM() {
|
|
3083
|
-
gt(this, this.shadow);
|
|
3084
|
-
}
|
|
3085
|
-
sincronizarSelecaoDOM() {
|
|
3086
|
-
vt(this, this.shadow);
|
|
3087
|
-
}
|
|
3088
|
-
// --- Auxiliares Internos ---
|
|
3089
|
-
notificarMudancaSelecao() {
|
|
3090
|
-
Zt(this);
|
|
3091
|
-
}
|
|
3092
|
-
};
|
|
3093
|
-
/** Painéis conectados sem `id` nem `storage-key`: dividem a mesma chave de persistência. */
|
|
3094
|
-
A(X, "instanciasChavePadrao", /* @__PURE__ */ new Set());
|
|
3095
|
-
let te = X;
|
|
3096
|
-
class lr extends te {
|
|
3097
|
-
}
|
|
3098
|
-
class ur extends te {
|
|
3099
|
-
}
|
|
3100
|
-
$e("ui-camadas", te);
|
|
3101
|
-
$e("ui-painel-camadas", lr);
|
|
3102
|
-
$e("ui-layer-panel", ur);
|
|
3103
|
-
export {
|
|
3104
|
-
nt as C,
|
|
3105
|
-
b as I,
|
|
3106
|
-
ze as L,
|
|
3107
|
-
Xe as M,
|
|
3108
|
-
te as U,
|
|
3109
|
-
ur as a,
|
|
3110
|
-
lr as b,
|
|
3111
|
-
Ka as c,
|
|
3112
|
-
Se as d,
|
|
3113
|
-
me as e,
|
|
3114
|
-
M as f,
|
|
3115
|
-
sa as g,
|
|
3116
|
-
Z as h,
|
|
3117
|
-
Je as i,
|
|
3118
|
-
dt as j,
|
|
3119
|
-
ct as k,
|
|
3120
|
-
ut as l,
|
|
3121
|
-
ft as m,
|
|
3122
|
-
We as n,
|
|
3123
|
-
da as o,
|
|
3124
|
-
Me as p,
|
|
3125
|
-
rt as q,
|
|
3126
|
-
pt as r,
|
|
3127
|
-
Ha as s,
|
|
3128
|
-
Va as t,
|
|
3129
|
-
aa as u,
|
|
3130
|
-
Ze as v,
|
|
3131
|
-
lt as w,
|
|
3132
|
-
ca as x
|
|
3133
|
-
};
|