@thibezer/ui-components-kit 2.6.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/README.md +2 -2
  3. package/dist/acessibilidade-CSzX-DkG.cjs +1 -0
  4. package/dist/acessibilidade-CUlSXc2X.js +38 -0
  5. package/dist/camadas.cjs +94 -94
  6. package/dist/camadas.js +1218 -1124
  7. package/dist/campo-texto.cjs +1 -1
  8. package/dist/campo-texto.js +1 -1
  9. package/dist/canvas.cjs +66 -65
  10. package/dist/canvas.js +3769 -3389
  11. package/dist/card.cjs +1 -1
  12. package/dist/card.js +1 -1
  13. package/dist/components/ui-alerta/ui-toast.d.ts +4 -15
  14. package/dist/components/ui-avatar/ui-avatar.d.ts +11 -0
  15. package/dist/components/ui-badge/ui-badge.d.ts +2 -0
  16. package/dist/components/ui-barra-ferramentas/paleta-atalhos.d.ts +16 -0
  17. package/dist/components/ui-barra-ferramentas/paleta-pressao-longa.d.ts +24 -0
  18. package/dist/components/ui-barra-ferramentas/ribbon-render.d.ts +14 -0
  19. package/dist/components/ui-barra-ferramentas/ribbon-teclado.d.ts +17 -0
  20. package/dist/components/ui-barra-ferramentas/ui-paleta-ferramentas.d.ts +1 -7
  21. package/dist/components/ui-barra-ferramentas/ui-ribbon.d.ts +0 -1
  22. package/dist/components/ui-camadas/camadas-arraste-controles.d.ts +2 -0
  23. package/dist/components/ui-camadas/camadas-arvore-renderer.d.ts +4 -11
  24. package/dist/components/ui-camadas/camadas-colecao.d.ts +27 -0
  25. package/dist/components/ui-camadas/camadas-drag-drop.d.ts +13 -1
  26. package/dist/components/ui-camadas/camadas-drop-ops.d.ts +31 -0
  27. package/dist/components/ui-camadas/camadas-hierarquia.d.ts +10 -0
  28. package/dist/components/ui-camadas/camadas-lembranca.d.ts +34 -0
  29. package/dist/components/ui-camadas/camadas-render.d.ts +14 -0
  30. package/dist/components/ui-camadas/camadas-renomear.d.ts +12 -0
  31. package/dist/components/ui-camadas/camadas-selecao-api.d.ts +17 -0
  32. package/dist/components/ui-camadas/camadas-thumb.d.ts +1 -0
  33. package/dist/components/ui-camadas/ui-camadas.d.ts +3 -5
  34. package/dist/components/ui-canvas-cad/cad-acessibilidade.d.ts +15 -0
  35. package/dist/components/ui-canvas-cad/cad-atributos-sync.d.ts +2 -1
  36. package/dist/components/ui-canvas-cad/cad-broadcast.d.ts +1 -1
  37. package/dist/components/ui-canvas-cad/cad-evento-coordenadas.d.ts +22 -0
  38. package/dist/components/ui-canvas-cad/cad-eventos-canvas.d.ts +3 -8
  39. package/dist/components/ui-canvas-cad/cad-feicoes-camera.d.ts +26 -0
  40. package/dist/components/ui-canvas-cad/cad-feicoes-consulta.d.ts +21 -0
  41. package/dist/components/ui-canvas-cad/cad-feicoes-dados.d.ts +39 -0
  42. package/dist/components/ui-canvas-cad/cad-feicoes-desenho.d.ts +68 -0
  43. package/dist/components/ui-canvas-cad/cad-feicoes-edicao.d.ts +37 -0
  44. package/dist/components/ui-canvas-cad/cad-feicoes-operacoes.d.ts +48 -0
  45. package/dist/components/ui-canvas-cad/cad-feicoes-ponteiro.d.ts +24 -0
  46. package/dist/components/ui-canvas-cad/cad-feicoes-selecao-regiao.d.ts +22 -0
  47. package/dist/components/ui-canvas-cad/cad-feicoes-tipos.d.ts +53 -0
  48. package/dist/components/ui-canvas-cad/cad-feicoes-versoes.d.ts +33 -0
  49. package/dist/components/ui-canvas-cad/cad-feicoes.d.ts +26 -106
  50. package/dist/components/ui-canvas-cad/cad-inicializador.d.ts +3 -1
  51. package/dist/components/ui-canvas-cad/cad-leaflet-adaptador.d.ts +5 -0
  52. package/dist/components/ui-canvas-cad/cad-selecao-pontos.d.ts +5 -0
  53. package/dist/components/ui-canvas-cad/tipos.d.ts +37 -0
  54. package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +4 -1
  55. package/dist/components/ui-checkbox/ui-checkbox.d.ts +4 -1
  56. package/dist/components/ui-cores/tipos.d.ts +2 -0
  57. package/dist/components/ui-cores/ui-controle-cores.d.ts +8 -3
  58. package/dist/components/ui-cores/ui-seletor-cor.d.ts +3 -1
  59. package/dist/components/ui-mapa/mapa-atributos.d.ts +14 -0
  60. package/dist/components/ui-mapa/mapa-basemaps.d.ts +7 -0
  61. package/dist/components/ui-mapa/mapa-icones.d.ts +4 -0
  62. package/dist/components/ui-mapa/mapa-leaflet.d.ts +5 -0
  63. package/dist/components/ui-mapa/mapa-vinculo-pai.d.ts +22 -0
  64. package/dist/components/ui-mapa/tipos.d.ts +13 -0
  65. package/dist/components/ui-mapa/ui-mapa-linha.d.ts +12 -5
  66. package/dist/components/ui-mapa/ui-mapa-marcador.d.ts +15 -6
  67. package/dist/components/ui-mapa/ui-mapa.d.ts +14 -1
  68. package/dist/components/ui-modal/modal-acessibilidade.d.ts +5 -5
  69. package/dist/components/ui-modal/modal-foco.d.ts +28 -0
  70. package/dist/components/ui-modal/ui-modal.d.ts +1 -11
  71. package/dist/components/ui-radio/radio-grupo-registry.d.ts +10 -0
  72. package/dist/components/ui-radio/ui-radio.d.ts +9 -2
  73. package/dist/components/ui-skeleton/ui-skeleton.d.ts +9 -0
  74. package/dist/components/ui-switch/ui-switch.d.ts +3 -1
  75. package/dist/components/ui-tabela/tabela-estados.d.ts +16 -0
  76. package/dist/components/ui-tabela/tabela-rolagem.d.ts +44 -0
  77. package/dist/components/ui-tabela/tabela-teclado.d.ts +16 -0
  78. package/dist/components/ui-tabela/ui-tabela.d.ts +1 -19
  79. package/dist/components/ui-tooltip/tooltip-popover.d.ts +7 -0
  80. package/dist/components/ui-tooltip/tooltip-posicionamento.d.ts +29 -0
  81. package/dist/components/ui-tooltip/ui-tooltip.d.ts +24 -1
  82. package/dist/core/opcoes.d.ts +9 -0
  83. package/dist/core/rotulo-controle.d.ts +13 -0
  84. package/dist/core/tipos-toast.d.ts +16 -0
  85. package/dist/core/ui-bus.d.ts +9 -1
  86. package/dist/core.cjs +1 -1
  87. package/dist/core.js +12 -11
  88. package/dist/cores.cjs +1 -1
  89. package/dist/cores.js +1 -1
  90. package/dist/custom-elements.json +19799 -14940
  91. package/dist/data.cjs +1 -1
  92. package/dist/data.js +2 -2
  93. package/dist/feedback.cjs +1 -1
  94. package/dist/feedback.js +21 -21
  95. package/dist/form-validacao-BlQFxUVj.js +104 -0
  96. package/dist/form-validacao-DIeyQVH5.cjs +1 -0
  97. package/dist/forms.cjs +1 -1
  98. package/dist/forms.js +2 -2
  99. package/dist/index.cjs +1 -1
  100. package/dist/index.js +46 -46
  101. package/dist/mapa.cjs +11 -16
  102. package/dist/mapa.js +242 -170
  103. package/dist/modal.cjs +1 -1
  104. package/dist/modal.js +1 -1
  105. package/dist/opcoes-CJYLi6kd.js +12 -0
  106. package/dist/opcoes-CkyDxBuQ.cjs +1 -0
  107. package/dist/register.cjs +1 -1
  108. package/dist/register.js +13 -14
  109. package/dist/tabela.cjs +1 -1
  110. package/dist/tabela.js +1 -1
  111. package/dist/tipos-elementos.d.ts +9 -3
  112. package/dist/tipos-vue.d.ts +9 -3
  113. package/dist/tools.cjs +1 -1
  114. package/dist/tools.js +1 -1
  115. package/dist/ui-badge-ChiiiO1r.js +197 -0
  116. package/dist/ui-badge-DUCxyAG6.cjs +28 -0
  117. package/dist/{zero-js-triggers-C_KrvFOQ.js → ui-bus-CUd99VJi.js} +36 -103
  118. package/dist/ui-bus-XqBLlTYQ.cjs +1 -0
  119. package/dist/ui-campo-texto-CHTfMO-H.cjs +16 -0
  120. package/dist/ui-campo-texto-gum_jDdI.js +380 -0
  121. package/dist/ui-card-BNYCQ7g-.js +119 -0
  122. package/dist/ui-card-BrjBL-yo.cjs +20 -0
  123. package/dist/ui-controle-cores-DgEza3wF.js +612 -0
  124. package/dist/ui-controle-cores-uY__TgwW.cjs +117 -0
  125. package/dist/ui-modal-BkYvNP0G.js +214 -0
  126. package/dist/ui-modal-CUNbpbZ1.cjs +18 -0
  127. package/dist/ui-paleta-ferramentas-Ksh6gMW3.js +890 -0
  128. package/dist/ui-paleta-ferramentas-bDLPbiGA.cjs +21 -0
  129. package/dist/ui-segmented-BOaGRQw4.cjs +19 -0
  130. package/dist/ui-segmented-kbO1BLVs.js +439 -0
  131. package/dist/ui-skeleton-B2Rgrv8o.js +648 -0
  132. package/dist/ui-skeleton-BilwGdOm.js +634 -0
  133. package/dist/ui-skeleton-DiOxTBZK.cjs +52 -0
  134. package/dist/ui-skeleton-SPYqku8P.cjs +52 -0
  135. package/dist/ui-skeleton-W9uwIceA.js +585 -0
  136. package/dist/ui-skeleton-gZrJipCC.cjs +52 -0
  137. package/dist/ui-switch-BX6U5Ykm.cjs +53 -0
  138. package/dist/ui-switch-DO5jR0hy.js +915 -0
  139. package/dist/ui-tabela-propriedades-D9Echt2X.js +2667 -0
  140. package/dist/ui-tabela-propriedades-DzZlyNZ_.cjs +141 -0
  141. package/dist/zero-js-triggers-CJT988bR.js +83 -0
  142. package/dist/zero-js-triggers-CgM9IIQB.cjs +1 -0
  143. package/package.json +10 -3
  144. package/dist/ui-botao-OGJV6Vfk.js +0 -165
  145. package/dist/ui-botao-psS1juof.cjs +0 -12
  146. package/dist/ui-paleta-ferramentas-CEZYcN4J.js +0 -624
  147. package/dist/ui-paleta-ferramentas-Dbj1kBS9.cjs +0 -18
  148. package/dist/ui-skeleton-DI4_9WOX.js +0 -428
  149. package/dist/ui-skeleton-elhKIh2B.cjs +0 -33
  150. package/dist/ui-tabela-propriedades-BBr5sqki.cjs +0 -145
  151. package/dist/ui-tabela-propriedades-Boy7I5yW.js +0 -2412
  152. package/dist/ui-toast-Bp_NlM5G.js +0 -156
  153. package/dist/ui-toast-DGTZKne5.cjs +0 -20
  154. package/dist/zero-js-triggers-C_gtaojZ.cjs +0 -1
@@ -0,0 +1,2667 @@
1
+ var he = Object.defineProperty;
2
+ var me = (r, t, e) => t in r ? he(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var b = (r, t, e) => me(r, typeof t != "symbol" ? t + "" : t, e);
4
+ import { L as I } from "./listener-bag-DQgv7OON.js";
5
+ import { a as be } from "./parts-CaoQiCfI.js";
6
+ import { d as ie, S as oe } from "./ssr-safe-5cWfJP-s.js";
7
+ import { h as fe } from "./svg-seguro-BsbNQqpd.js";
8
+ class ge {
9
+ constructor(t) {
10
+ b(this, "autoFetchController", null);
11
+ b(this, "emVoo", null);
12
+ this.ctx = t;
13
+ }
14
+ /**
15
+ * Busca os dados. Resolve `true` em sucesso e `false` em falha, cancelamento ou requisição
16
+ * substituída (nunca rejeita; o motivo da falha vai no evento `ui-fetch-erro`).
17
+ * Uma chamada com a mesma URL de uma requisição em andamento reaproveita essa requisição.
18
+ */
19
+ carregar(t) {
20
+ if (!t) return Promise.resolve(!1);
21
+ if (this.emVoo && this.emVoo.url === t && this.autoFetchController) return this.emVoo.promessa;
22
+ this.cancelarEmVoo();
23
+ const e = new AbortController();
24
+ this.autoFetchController = e;
25
+ const i = this.executar(t, e);
26
+ return this.emVoo = { url: t, promessa: i }, i;
27
+ }
28
+ emitir(t, e) {
29
+ this.ctx.host.dispatchEvent(new CustomEvent(t, { bubbles: !0, composed: !0, detail: e }));
30
+ }
31
+ erro(t, e, i, o) {
32
+ const a = e instanceof Error ? e.message : String(e);
33
+ console.error("[ui-tabela] Erro ao carregar dados remotos:", e);
34
+ const n = { url: t, erro: a, origem: i };
35
+ o !== void 0 && (n.status = o), this.emitir("ui-fetch-erro", n);
36
+ }
37
+ async executar(t, e) {
38
+ var s, d, c, l;
39
+ const i = () => this.autoFetchController === e, o = () => {
40
+ this.autoFetchController === e && (this.autoFetchController = null, this.emVoo = null);
41
+ };
42
+ this.ctx.onCarregandoAlterado(!0), this.emitir("ui-fetch-start", { url: t });
43
+ let a = "rede", n;
44
+ try {
45
+ const u = { ...((d = (s = this.ctx).getOpcoes) == null ? void 0 : d.call(s)) ?? {}, signal: e.signal }, h = await (((l = (c = this.ctx).getFetcher) == null ? void 0 : l.call(c)) ?? ((g, _) => fetch(g, _)))(t, u);
46
+ if (!h.ok)
47
+ throw a = "http", n = h.status, new Error(`HTTP ${h.status}: ${h.statusText}`);
48
+ a = "json";
49
+ const m = await h.json(), x = Array.isArray(m) ? m : (m == null ? void 0 : m.dados) || (m == null ? void 0 : m.items) || (m == null ? void 0 : m.data) || (m == null ? void 0 : m.rows) || [], f = Array.isArray(x) ? x : [];
50
+ return i() ? (a = "render", this.ctx.onDadosRecebidos(f), o(), this.ctx.onCarregandoAlterado(!1), this.emitir("ui-fetch-sucesso", { url: t, total: f.length, dados: f }), !0) : !1;
51
+ } catch (u) {
52
+ return (u == null ? void 0 : u.name) === "AbortError" ? (i() && (o(), this.ctx.onCarregandoAlterado(!1)), this.emitir("ui-fetch-cancelado", { url: t }), !1) : (i() && (o(), this.ctx.onCarregandoAlterado(!1), this.erro(t, u, a, n)), !1);
53
+ }
54
+ }
55
+ /** Cancela a requisição em andamento (se houver) e libera o indicador de carregamento. */
56
+ abortar() {
57
+ this.autoFetchController && (this.cancelarEmVoo(), this.ctx.onCarregandoAlterado(!1));
58
+ }
59
+ cancelarEmVoo() {
60
+ if (this.autoFetchController) {
61
+ const t = this.autoFetchController;
62
+ this.autoFetchController = null, this.emVoo = null, t.abort();
63
+ }
64
+ }
65
+ }
66
+ const xe = ["id", "_id", "codigo", "key"];
67
+ function ve(r, t) {
68
+ return r != null && (r === t || String(r) === String(t));
69
+ }
70
+ function Y(r, t) {
71
+ let e = -1;
72
+ return typeof r == "number" && Number.isInteger(r) ? e = r : typeof r == "string" && /^\d+$/.test(r.trim()) && (e = parseInt(r.trim(), 10)), e >= 0 && e < t ? e : -1;
73
+ }
74
+ function _e(r, t, e = "id", i = !1) {
75
+ if (!r || r.length === 0) return -1;
76
+ if (typeof t == "function")
77
+ return r.findIndex(t);
78
+ if (i) return Y(t, r.length);
79
+ const o = [e, ...xe.filter((a) => a !== e)];
80
+ for (const a of o) {
81
+ const n = r.findIndex((s) => !!s && typeof s == "object" && ve(s[a], t));
82
+ if (n !== -1) return n;
83
+ }
84
+ return Y(t, r.length);
85
+ }
86
+ class Ee {
87
+ constructor(t) {
88
+ b(this, "itemSelecionado", null);
89
+ b(this, "indiceSelecionado", null);
90
+ this.ctx = t;
91
+ }
92
+ /** Mesmo objeto ou mesmo valor na chave configurada. */
93
+ indiceDoItem(t, e) {
94
+ const i = this.ctx.getChaveId(), o = t.indexOf(e);
95
+ return o >= 0 ? o : e[i] == null ? -1 : t.findIndex((a) => (a == null ? void 0 : a[i]) != null && String(a[i]) === String(e[i]));
96
+ }
97
+ getItemSelecionado() {
98
+ return this.itemSelecionado;
99
+ }
100
+ setItemSelecionado(t) {
101
+ this.itemSelecionado = t;
102
+ const e = t ? this.indiceDoItem(this.ctx.getDadosExibicao(), t) : -1;
103
+ this.indiceSelecionado = e >= 0 ? e : null, this.atualizarLinhasSelecionadas();
104
+ }
105
+ getIndiceSelecionado() {
106
+ return this.indiceSelecionado;
107
+ }
108
+ setIndiceSelecionado(t) {
109
+ const e = this.ctx.getDadosExibicao(), i = t !== null && t >= 0 && t < e.length;
110
+ this.indiceSelecionado = i ? t : null, this.itemSelecionado = i ? e[t] : null, this.atualizarLinhasSelecionadas();
111
+ }
112
+ /**
113
+ * Reaplica a seleção após ordenar, filtrar ou trocar os dados.
114
+ * - Item ainda exibido: atualiza o índice (e a referência, se veio um objeto novo com a mesma chave).
115
+ * - Item só escondido pelo filtro: mantém a seleção (sem índice) para reaparecer ao limpar o filtro.
116
+ * - Item removido dos dados: limpa a seleção e emite `ui-selecao-removida`.
117
+ */
118
+ reconciliar() {
119
+ const t = this.itemSelecionado;
120
+ if (!t) {
121
+ this.indiceSelecionado = null;
122
+ return;
123
+ }
124
+ const e = this.ctx.getDadosExibicao(), i = this.indiceDoItem(e, t);
125
+ if (i >= 0) {
126
+ this.indiceSelecionado = i, this.substituirReferencia(t, e[i]);
127
+ return;
128
+ }
129
+ this.indiceSelecionado = null;
130
+ const o = this.ctx.getDadosOriginais(), a = this.indiceDoItem(o, t);
131
+ if (a >= 0) {
132
+ this.substituirReferencia(t, o[a]);
133
+ return;
134
+ }
135
+ this.itemSelecionado = null, this.ctx.host.dispatchEvent(
136
+ new CustomEvent("ui-selecao-removida", { bubbles: !0, composed: !0, detail: { item: t } })
137
+ );
138
+ }
139
+ /** Mesmo registro com outro objeto (dados recarregados): atualiza a referência e avisa. */
140
+ substituirReferencia(t, e) {
141
+ this.itemSelecionado = e, t !== e && this.ctx.host.dispatchEvent(
142
+ new CustomEvent("ui-selecao-atualizada", { bubbles: !0, composed: !0, detail: { item: e, anterior: t } })
143
+ );
144
+ }
145
+ limparSelecao() {
146
+ this.itemSelecionado = null, this.indiceSelecionado = null, this.atualizarLinhasSelecionadas();
147
+ }
148
+ isItemSelecionado(t, e) {
149
+ if (this.itemSelecionado) {
150
+ if (this.itemSelecionado === t) return !0;
151
+ const i = this.ctx.getChaveId();
152
+ if (t[i] != null && this.itemSelecionado[i] != null)
153
+ return String(t[i]) === String(this.itemSelecionado[i]);
154
+ if (t.id != null && this.itemSelecionado.id != null)
155
+ return String(t.id) === String(this.itemSelecionado.id);
156
+ }
157
+ return this.indiceSelecionado !== null && this.indiceSelecionado === e;
158
+ }
159
+ atualizarLinhasSelecionadas() {
160
+ const t = this.ctx.getTbody();
161
+ if (!t) return;
162
+ const e = this.ctx.getDadosExibicao();
163
+ t.querySelectorAll("tr:not(.ui-tabela__virtual-spacer)").forEach((o) => {
164
+ const a = o.getAttribute("data-index"), n = a !== null ? parseInt(a, 10) : -1, s = n >= 0 ? e[n] : null, d = s ? this.isItemSelecionado(s, n) : !1;
165
+ o.classList.toggle("ui-tabela__tr--selecionada", d), be(o, "linha-selecionada", d), d ? (o.setAttribute("data-selecionada", "true"), o.setAttribute("aria-current", "true"), o.setAttribute("aria-selected", "true")) : (o.removeAttribute("data-selecionada"), o.removeAttribute("aria-current"), o.setAttribute("aria-selected", "false"));
166
+ });
167
+ }
168
+ rolarPara(t, e) {
169
+ const i = this.ctx.getDadosExibicao(), o = _e(i, t, this.ctx.getChaveId(), (e == null ? void 0 : e.porIndice) === !0);
170
+ if (o === -1)
171
+ return !1;
172
+ if (e != null && e.selecionar) {
173
+ const a = i[o];
174
+ this.itemSelecionado = a, this.indiceSelecionado = o, this.atualizarLinhasSelecionadas(), this.ctx.onLinhaAtiva(o), this.ctx.host.dispatchEvent(
175
+ new CustomEvent("ui-linha-selecionada", {
176
+ bubbles: !0,
177
+ composed: !0,
178
+ detail: { item: a, indice: o }
179
+ })
180
+ );
181
+ }
182
+ return this.ctx.onRolarParaIndice(o, (e == null ? void 0 : e.comportamento) || "smooth");
183
+ }
184
+ }
185
+ function ye(r, t, e) {
186
+ return r !== e ? {
187
+ idColuna: e,
188
+ direcao: "asc"
189
+ } : t === "asc" ? {
190
+ idColuna: e,
191
+ direcao: "desc"
192
+ } : t === "desc" ? {
193
+ idColuna: null,
194
+ direcao: "original"
195
+ } : {
196
+ idColuna: e,
197
+ direcao: "asc"
198
+ };
199
+ }
200
+ const we = new Intl.Collator("pt-BR", { numeric: !0, sensitivity: "base" });
201
+ function G(r) {
202
+ if (r instanceof Date) return r.getTime();
203
+ if (typeof r == "number") return r;
204
+ const t = String(r).trim(), e = /^(\d{1,2})\/(\d{1,2})\/(\d{4})(?:[ T](\d{1,2}):(\d{2}))?$/.exec(t);
205
+ return e ? new Date(+e[3], +e[2] - 1, +e[1], +(e[4] ?? 0), +(e[5] ?? 0)).getTime() : Date.parse(t);
206
+ }
207
+ function Ce(r, t, e) {
208
+ if (e === "data" || !e && (r instanceof Date || t instanceof Date)) {
209
+ const i = G(r), o = G(t);
210
+ if (!Number.isNaN(i) && !Number.isNaN(o)) return i - o;
211
+ } else if (e === "numero" || !e && typeof r == "number" && typeof t == "number") {
212
+ const i = Number(r), o = Number(t);
213
+ if (!Number.isNaN(i) && !Number.isNaN(o)) return i - o;
214
+ } else if (e === "booleano" || !e && typeof r == "boolean" && typeof t == "boolean")
215
+ return +!!r - +!!t;
216
+ return we.compare(String(r), String(t));
217
+ }
218
+ function Ae(r, t, e, i) {
219
+ if (!t || e === "original")
220
+ return [...r];
221
+ const o = e === "desc" ? -1 : 1;
222
+ return [...r].sort((a, n) => {
223
+ const s = a[t], d = n[t], c = s == null, l = d == null;
224
+ return c || l ? c === l ? 0 : c ? 1 : -1 : i != null && i.comparador ? i.comparador(s, d, a, n) * o : s === d ? 0 : Ce(s, d, i == null ? void 0 : i.tipo) * o;
225
+ });
226
+ }
227
+ function V(r) {
228
+ return r.normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase();
229
+ }
230
+ class ke {
231
+ constructor() {
232
+ b(this, "dadosOriginais", []);
233
+ b(this, "dadosExibicao", []);
234
+ b(this, "colunaOrdenada", null);
235
+ b(this, "direcaoOrdenacao", "original");
236
+ b(this, "ultimoFiltro", "");
237
+ /** Colunas declaradas: o filtro olha só elas (vazio = todos os campos do registro). */
238
+ b(this, "colunasFiltro", []);
239
+ b(this, "colunas", []);
240
+ /** Ordenação feita pelo servidor: a tabela guarda coluna/direção (indicador) mas não reordena os dados. */
241
+ b(this, "ordenacaoRemota", !1);
242
+ }
243
+ setColunas(t) {
244
+ this.colunas = t, this.colunaOrdenada && this.aplicarOrdenacao();
245
+ }
246
+ setOrdenacaoRemota(t) {
247
+ this.ordenacaoRemota !== t && (this.ordenacaoRemota = t, this.aplicarOrdenacao());
248
+ }
249
+ /** Restaura coluna/direção (ex.: `ui-sort` cancelado) e recalcula. */
250
+ restaurarOrdenacao(t, e) {
251
+ this.colunaOrdenada = t, this.direcaoOrdenacao = e, this.aplicarOrdenacao();
252
+ }
253
+ setColunasFiltro(t) {
254
+ this.colunasFiltro = t, this.ultimoFiltro && this.aplicarOrdenacao();
255
+ }
256
+ getDadosOriginais() {
257
+ return this.dadosOriginais;
258
+ }
259
+ setDadosOriginais(t) {
260
+ this.dadosOriginais = Array.isArray(t) ? t.filter((e) => e != null) : [], this.aplicarOrdenacao();
261
+ }
262
+ getDadosExibicao() {
263
+ return this.dadosExibicao;
264
+ }
265
+ getColunaOrdenada() {
266
+ return this.colunaOrdenada;
267
+ }
268
+ setColunaOrdenada(t) {
269
+ this.colunaOrdenada = t, t ? this.direcaoOrdenacao === "original" && (this.direcaoOrdenacao = "asc") : this.direcaoOrdenacao = "original", this.aplicarOrdenacao();
270
+ }
271
+ getDirecaoOrdenacao() {
272
+ return this.direcaoOrdenacao;
273
+ }
274
+ setDirecaoOrdenacao(t) {
275
+ this.direcaoOrdenacao = t || "original", this.direcaoOrdenacao === "original" && (this.colunaOrdenada = null), this.aplicarOrdenacao();
276
+ }
277
+ alternarOrdenacaoColuna(t) {
278
+ if (!t.ordenavel) return null;
279
+ const e = ye(this.colunaOrdenada, this.direcaoOrdenacao, t.id);
280
+ return this.colunaOrdenada = e.idColuna, this.direcaoOrdenacao = e.direcao, this.aplicarOrdenacao(), e;
281
+ }
282
+ /** Recalcula a lista exibida: filtro vigente e, sobre o resultado, a ordenação da coluna (valem juntos). */
283
+ aplicarOrdenacao() {
284
+ const t = this.ultimoFiltro, e = t ? this.dadosOriginais.filter((o) => this.casaFiltro(o, t)) : this.dadosOriginais, i = this.colunaOrdenada ? this.colunas.find((o) => o.id === this.colunaOrdenada) : null;
285
+ this.dadosExibicao = this.ordenacaoRemota ? [...e] : Ae(e, this.colunaOrdenada, this.direcaoOrdenacao, i);
286
+ }
287
+ casaFiltro(t, e) {
288
+ return (this.colunasFiltro.length > 0 ? this.colunasFiltro : Object.keys(t)).some((o) => {
289
+ const a = t[o], n = this.colunas.find((d) => d.id === o);
290
+ if (n != null && n.textoFiltro)
291
+ try {
292
+ if (V(String(n.textoFiltro(a, t) ?? "")).includes(e)) return !0;
293
+ } catch {
294
+ }
295
+ if (a == null || typeof a == "object" && !(a instanceof Date)) return !1;
296
+ const s = a instanceof Date ? `${a.toISOString()} ${a.toLocaleDateString("pt-BR")}` : String(a);
297
+ return V(s).includes(e);
298
+ });
299
+ }
300
+ /** Há um filtro de texto aplicado (o vazio vira "sem resultados"). */
301
+ temFiltro() {
302
+ return this.ultimoFiltro !== "";
303
+ }
304
+ filtrar(t) {
305
+ this.ultimoFiltro = V((t || "").trim()), this.aplicarOrdenacao();
306
+ }
307
+ }
308
+ const ze = ':host{display:block;width:100%;box-sizing:border-box;font-family:inherit;color:var(--ui-cor-texto, #e1e1e6);position:relative}.ui-tabela-container{width:100%;max-width:100%;max-height:var(--ui-tabela-max-height, 500px);overflow-x:auto;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 6px);background-color:var(--ui-cor-superficie, #141417);box-sizing:border-box;position:relative}.ui-tabela{width:100%;border-collapse:separate;border-spacing:0;text-align:left;font-size:14px;font-family:var(--ui-fonte-base, inherit);font-variant-numeric:tabular-nums}.ui-tabela thead{background-color:var(--ui-cor-fundo-elevado, #1a1a1e)}.ui-tabela th{position:sticky;top:0;z-index:10;padding:10px 16px;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);color:var(--ui-cor-texto-secundario, #9696a6);font-size:13px;font-weight:600;letter-spacing:.02em;border-bottom:2px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));white-space:nowrap;-webkit-user-select:none;user-select:none;box-sizing:border-box}.ui-tabela th[aria-sort=ascending],.ui-tabela th[aria-sort=descending]{color:var(--ui-cor-texto, #e1e1e6)}.ui-tabela__resizer{position:absolute;top:0;right:0;width:8px;height:100%;cursor:col-resize;-webkit-user-select:none;user-select:none;touch-action:none;z-index:20;background:linear-gradient(var(--ui-cor-borda, rgba(255, 255, 255, .12)),var(--ui-cor-borda, rgba(255, 255, 255, .12))) center / 1px 60% no-repeat;transition:background-color .15s ease}.ui-tabela__resizer:hover,.ui-tabela__resizer:focus-visible,.ui-tabela__resizer--ativo{background:var(--ui-cor-primaria, #00E08A);outline:none}:host([densidade="compacta"]) th,:host([densidade="compacta"]) td,:host([density="compact"]) th,:host([density="compact"]) td{padding:4px 8px}:host([densidade="normal"]) th,:host([densidade="normal"]) td,:host([density="normal"]) th,:host([density="normal"]) td{padding:10px 16px}:host([densidade="relaxada"]) th,:host([densidade="relaxada"]) td,:host([density="relaxed"]) th,:host([density="relaxed"]) td{padding:16px 20px}:host([altura-linha]) td,:host([row-height]) td{height:var(--ui-tabela-altura-linha);box-sizing:border-box;padding-top:0;padding-bottom:0;overflow:hidden;white-space:nowrap}.ui-tabela__header-content{display:inline-flex;align-items:center;vertical-align:middle;width:100%;box-sizing:border-box}.ui-tabela__header-text{margin-right:var(--ui-tabela-th-gap, 6px);display:inline-block;min-width:0;overflow:hidden;text-overflow:ellipsis}.ui-tabela__sort-icon{width:var(--ui-tabela-th-icone, 16px);min-width:var(--ui-tabela-th-icone, 16px);flex:none;display:inline-flex;justify-content:center;align-items:center}.ui-tabela th.ui-tabela__th--ordenavel{cursor:pointer}@media (hover: hover){.ui-tabela th.ui-tabela__th--ordenavel:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,var(--ui-cor-fundo-elevado, #1a1a1e));color:var(--ui-cor-texto, #e1e1e6)}}.ui-tabela__ordenar{all:unset;display:flex;width:100%;box-sizing:border-box;cursor:pointer;font:inherit;color:inherit;text-align:inherit}.ui-tabela__ordenar:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:2px;border-radius:var(--ui-raio-sm, 4px)}.ui-tabela tbody tr:focus{outline:none}.ui-tabela tbody tr:focus-visible{outline:2px solid var(--ui-tabela-cor-foco, var(--ui-cor-texto, #e1e1e6));outline-offset:-2px;background-color:var(--ui-tabela-hover, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 8%, transparent))}.ui-tabela__sort-arrow{display:inline-block;width:14px;height:14px;vertical-align:middle;shape-rendering:geometricPrecision;fill:var(--ui-cor-primaria, #00E08A)}.ui-tabela__sort-arrow path{transition:opacity .15s ease;opacity:.35}.ui-tabela__sort-arrow--asc .seta-cima,.ui-tabela__sort-arrow--desc .seta-baixo{opacity:1}.ui-tabela__sort-arrow--inativo{fill:var(--ui-cor-texto-secundario, #9696a6)}.ui-tabela__sort-arrow--inativo path{opacity:.6}.ui-tabela td{padding:10px 16px;border-bottom:1px solid color-mix(in srgb,var(--ui-cor-borda, rgba(255, 255, 255, .12)) 60%,transparent);white-space:nowrap;vertical-align:middle;color:var(--ui-cor-texto, #e1e1e6);box-sizing:border-box}.ui-tabela__cell-content{display:inline-flex;align-items:center;vertical-align:middle}.ui-tabela__cell-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.ui-tabela--alinhar-esquerda{text-align:left}.ui-tabela--alinhar-esquerda .ui-tabela__header-content,.ui-tabela--alinhar-esquerda .ui-tabela__cell-content{justify-content:flex-start}.ui-tabela--alinhar-centro{text-align:center}.ui-tabela--alinhar-centro .ui-tabela__header-content,.ui-tabela--alinhar-centro .ui-tabela__cell-content{justify-content:center}.ui-tabela--alinhar-direita{text-align:right}.ui-tabela--alinhar-direita .ui-tabela__header-content,.ui-tabela--alinhar-direita .ui-tabela__cell-content{justify-content:flex-end}.ui-tabela tbody tr[data-index]{cursor:pointer}.ui-tabela tbody tr.ui-tabela__tr--par{background-color:var(--ui-tabela-zebra, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 4%, transparent))}@media (hover: hover){.ui-tabela tbody tr[data-index]:hover{background-color:var(--ui-tabela-hover, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 8%, transparent))}}.ui-tabela tbody tr[data-index]:active{background-color:var(--ui-tabela-hover, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 12%, transparent))}:host(:not([selecionar-texto])) .ui-tabela tbody td{-webkit-user-select:none;user-select:none}.ui-tabela tbody tr.ui-tabela__tr--selecionada,.ui-tabela tbody tr[data-selecionada=true]{background-color:var(--ui-tabela-selecionada, var(--ui-cor-linha-selecionada, color-mix(in srgb, var(--ui-cor-primaria, #00E08A) 14%, transparent)))}.ui-tabela tbody tr.ui-tabela__tr--selecionada td:first-child,.ui-tabela tbody tr[data-selecionada=true] td:first-child{box-shadow:inset 3px 0 0 var(--ui-cor-primaria, #00E08A)}@media (hover: hover){.ui-tabela tbody tr.ui-tabela__tr--selecionada:hover,.ui-tabela tbody tr[data-selecionada=true]:hover{background-color:var(--ui-tabela-selecionada-hover, var(--ui-cor-linha-selecionada-hover, color-mix(in srgb, var(--ui-cor-primaria, #00E08A) 22%, transparent)))}}.ui-tabela__virtual-spacer td{padding:0!important;border:none!important;height:inherit;background:transparent!important}.ui-tabela__empty{padding:40px 24px;text-align:center;color:var(--ui-cor-texto-secundario, #9696a6);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;box-sizing:border-box}.ui-tabela__empty-icon{width:32px;height:32px;opacity:.5;fill:currentColor}.ui-tabela__empty-text{font-size:14px;font-weight:500;color:var(--ui-cor-texto-secundario, #9696a6)}.ui-tabela__erro{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:12px;padding:10px 14px;border:1px solid var(--ui-cor-texto-erro, #ff5555);border-left-width:4px;border-radius:var(--ui-raio-borda, 6px);background:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 10%,transparent);color:var(--ui-cor-texto, #e1e1e6);font-size:14px;box-sizing:border-box}.ui-tabela__erro-texto{flex:1 1 200px;min-width:0}.ui-tabela__erro-detalhe{display:block;margin-top:2px;font-size:12px;color:var(--ui-cor-texto-secundario, #9696a6);overflow-wrap:anywhere}.ui-tabela__erro-acao,.ui-tabela__prompt-actions button{background:var(--ui-cor-botao-secundario-fundo, rgba(255, 255, 255, .12));color:var(--ui-cor-texto, #e1e1e6);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));padding:6px 12px;border-radius:var(--ui-raio-sm, 4px);font:inherit;cursor:pointer}.ui-tabela__erro-acao:hover,.ui-tabela__prompt-actions button:hover{background:var(--ui-cor-botao-secundario-hover, rgba(255, 255, 255, .2))}.ui-tabela__erro-acao:focus-visible,.ui-tabela__prompt-actions button:focus-visible,.ui-tabela__prompt-dialog input:focus-visible{outline:2px solid var(--ui-cor-primaria, #00E08A);outline-offset:2px}.ui-tabela__sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.ui-tabela__loading{position:absolute;top:0;left:0;right:0;bottom:0;background-color:color-mix(in srgb,var(--ui-cor-superficie, #141417) 72%,transparent);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;z-index:50;color:var(--ui-cor-texto, #e1e1e6);font-size:14px}.ui-tabela__spinner{width:32px;height:32px;border:3px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 15%,transparent);border-top-color:var(--ui-cor-primaria, #00E08A);border-radius:50%;animation:ui-tabela-spin .8s linear infinite}@keyframes ui-tabela-spin{to{transform:rotate(360deg)}}.ui-tabela__prompt-dialog{margin:0;max-width:calc(100vw - 16px);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .2));border-radius:var(--ui-raio-borda, 6px);background-color:var(--ui-cor-fundo-elevado, #1a1a1e);color:var(--ui-cor-texto, #e1e1e6);padding:12px;box-shadow:var(--ui-sombra-lg, 0 8px 32px rgba(0, 0, 0, .8));font-family:inherit;font-size:14px}.ui-tabela__prompt-dialog::backdrop{background:#0000004d}.ui-tabela__prompt-title{display:block;margin-bottom:8px;font-weight:500}.ui-tabela__prompt-dialog input{width:100%;padding:6px 8px;border-radius:var(--ui-raio-sm, 4px);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .2));background:var(--ui-cor-superficie, #141417);color:var(--ui-cor-texto, #e1e1e6);margin-bottom:8px;box-sizing:border-box;font:inherit}.ui-tabela__prompt-dialog input[aria-invalid=true]{border-color:var(--ui-cor-texto-erro, #ff5555)}.ui-tabela__prompt-erro{min-height:1.2em;margin-bottom:8px;font-size:12px;color:var(--ui-cor-texto-erro, #ff5555)}.ui-tabela__prompt-actions{display:flex;justify-content:flex-end;gap:8px}.ui-tabela__prompt-actions button:last-child{background:var(--ui-cor-primaria, #00E08A);border-color:transparent;color:var(--ui-cor-texto-sobre-primaria, #000000);font-weight:600}.ui-tabela__prompt-actions button:last-child:hover{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 85%,var(--ui-cor-texto, #e1e1e6))}@media (pointer: coarse){.ui-tabela__resizer{width:16px}:host(:not([altura-linha]):not([row-height])) .ui-tabela tbody tr[data-index]{height:44px}}@media (max-width: 640px){.ui-tabela th{padding:8px 10px;font-size:12px}.ui-tabela td{padding:8px 10px;font-size:13px}}@media (prefers-reduced-motion: reduce){.ui-tabela__resizer,.ui-tabela__sort-arrow path{transition:none}.ui-tabela__spinner{animation-duration:2.4s}}';
309
+ function ae(r) {
310
+ return r == null || r === "" ? "" : typeof r == "number" ? `${r}px` : r;
311
+ }
312
+ function ne(r) {
313
+ return r === "centro" || r === "center" ? "ui-tabela--alinhar-centro" : r === "direita" || r === "right" ? "ui-tabela--alinhar-direita" : "ui-tabela--alinhar-esquerda";
314
+ }
315
+ function se(r) {
316
+ return r === "centro" || r === "center" ? "center" : r === "direita" || r === "right" ? "right" : "left";
317
+ }
318
+ function K(r) {
319
+ return r === "compacta" ? 30 : r === "relaxada" ? 56 : 42;
320
+ }
321
+ function Se(r, t, e, i) {
322
+ r.innerHTML = `<style>${ze}</style>`;
323
+ const o = document.createElement("div");
324
+ o.className = "ui-tabela-container", o.setAttribute("part", "base"), e && (o.style.maxHeight = e);
325
+ const a = document.createElement("div");
326
+ a.className = "ui-tabela__empty", a.setAttribute("part", "vazio"), a.style.display = "none", a.setAttribute("role", "status");
327
+ const n = document.createElement("div");
328
+ n.innerHTML = `
329
+ <svg class="ui-tabela__empty-icon" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
330
+ <path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 10h2v7H7zm4-3h2v10h-2zm4 6h2v4h-2z"/>
331
+ </svg>`;
332
+ const s = document.createElement("span");
333
+ s.className = "ui-tabela__empty-text", s.textContent = t, a.appendChild(n), a.appendChild(s);
334
+ const d = document.createElement("table");
335
+ d.className = "ui-tabela", d.setAttribute("part", "tabela"), d.setAttribute("role", "grid");
336
+ const c = document.createElement("colgroup"), l = document.createElement("thead"), u = document.createElement("tbody");
337
+ d.appendChild(c), d.appendChild(l), d.appendChild(u);
338
+ const p = document.createElement("div");
339
+ p.className = "ui-tabela__erro", p.setAttribute("part", "erro"), p.setAttribute("role", "alert"), p.style.display = "none";
340
+ const h = document.createElement("div");
341
+ h.className = "ui-tabela__erro-texto";
342
+ const m = document.createElement("span");
343
+ m.className = "ui-tabela__erro-mensagem";
344
+ const x = document.createElement("span");
345
+ x.className = "ui-tabela__erro-detalhe", h.appendChild(m), h.appendChild(x);
346
+ const f = document.createElement("button");
347
+ f.type = "button", f.className = "ui-tabela__erro-acao", f.setAttribute("part", "erro-acao"), f.textContent = "Tentar novamente", p.appendChild(h), p.appendChild(f);
348
+ const g = document.createElement("div");
349
+ g.className = "ui-tabela__sr", g.setAttribute("role", "status"), g.setAttribute("aria-live", "polite"), o.appendChild(p), o.appendChild(d), o.appendChild(a), o.appendChild(g);
350
+ const _ = document.createElement("div");
351
+ return _.className = "ui-tabela__loading", _.setAttribute("part", "carregando"), _.setAttribute("role", "status"), _.setAttribute("aria-live", "polite"), _.style.display = i ? "flex" : "none", _.innerHTML = `
352
+ <div class="ui-tabela__spinner" aria-hidden="true"></div>
353
+ <span class="ui-tabela__loading-texto">Carregando dados...</span>
354
+ `, o.appendChild(_), r.appendChild(o), {
355
+ containerElement: o,
356
+ tableElement: d,
357
+ theadElement: l,
358
+ tbodyElement: u,
359
+ colgroupElement: c,
360
+ emptyElement: a,
361
+ loadingElement: _,
362
+ erroElement: p,
363
+ anuncioElement: g
364
+ };
365
+ }
366
+ function Le(r) {
367
+ var a, n;
368
+ if (!r.theadElement || !r.colgroupElement) return;
369
+ r.headerListeners.cleanup();
370
+ const e = r.theadElement.getRootNode().activeElement, i = e && r.theadElement.contains(e) ? ((a = e.closest("th")) == null ? void 0 : a.getAttribute("data-coluna")) ?? null : null;
371
+ r.theadElement.innerHTML = "", r.colgroupElement.innerHTML = "";
372
+ const o = document.createElement("tr");
373
+ if (o.setAttribute("aria-rowindex", "1"), r.colunas.forEach((s, d) => {
374
+ const c = document.createElement("col");
375
+ s.largura !== void 0 && (c.style.width = r.formatWidth(s.largura)), r.colgroupElement.appendChild(c);
376
+ const l = document.createElement("th"), u = r.getAlignmentClass(s.alinhamento);
377
+ if (l.className = u, l.setAttribute("part", "celula-cabecalho"), l.scope = "col", l.setAttribute("data-coluna", s.id), l.style.textAlign = r.getTextAlign(s.alinhamento), s.largura !== void 0 && (l.style.width = r.formatWidth(s.largura)), s.larguraMinima !== void 0 && (l.style.minWidth = r.formatWidth(s.larguraMinima)), s.larguraMaxima !== void 0) {
378
+ const v = r.formatWidth(s.larguraMaxima);
379
+ l.style.maxWidth = v, l.style.overflow = "hidden", l.style.textOverflow = "ellipsis", l.style.whiteSpace = "nowrap";
380
+ }
381
+ s.tooltip && (l.title = s.tooltip);
382
+ const p = !!s.ordenavel && r.colunaOrdenada === s.id && r.direcaoOrdenacao !== "original", h = p && r.direcaoOrdenacao === "desc";
383
+ if (s.ordenavel) {
384
+ l.classList.add("ui-tabela__th--ordenavel");
385
+ const v = () => r.onHeaderClick(s);
386
+ r.headerListeners.add(l, "click", v), l.setAttribute("aria-sort", p ? h ? "descending" : "ascending" : "none");
387
+ }
388
+ const m = (v) => r.onHeaderContextMenu(v, s, d, l);
389
+ r.headerListeners.add(l, "contextmenu", m);
390
+ const x = document.createElement("div");
391
+ x.className = "ui-tabela__header-content";
392
+ const f = document.createElement("span");
393
+ if (f.className = "ui-tabela__header-text", f.textContent = s.rotulo, x.appendChild(f), s.ordenavel) {
394
+ const v = document.createElement("span");
395
+ v.className = "ui-tabela__sort-icon";
396
+ const E = p ? h ? "ui-tabela__sort-arrow--desc" : "ui-tabela__sort-arrow--asc" : "ui-tabela__sort-arrow--inativo";
397
+ v.setAttribute("aria-hidden", "true"), v.innerHTML = `<svg class="ui-tabela__sort-arrow ${E}" viewBox="0 0 24 24" focusable="false"><path class="seta-cima" d="M7 11l5-5 5 5H7z"/><path class="seta-baixo" d="M7 13l5 5 5-5H7z"/></svg>`, x.appendChild(v);
398
+ }
399
+ if (s.ordenavel) {
400
+ const v = document.createElement("button");
401
+ v.type = "button", v.className = "ui-tabela__ordenar", v.setAttribute("part", "ordenar"), v.appendChild(x), l.appendChild(v);
402
+ } else
403
+ l.appendChild(x);
404
+ const g = document.createElement("div");
405
+ g.className = "ui-tabela__resizer", g.setAttribute("part", "redimensionador"), g.title = "Arrastar para redimensionar largura (duplo-clique para auto-ajuste)", g.tabIndex = 0, g.setAttribute("role", "separator"), g.setAttribute("aria-orientation", "vertical"), g.setAttribute("aria-label", `Redimensionar coluna ${s.rotulo}`);
406
+ const _ = (v) => r.onInitColumnResize(v, s, d, l, g);
407
+ r.headerListeners.add(g, "mousedown", _);
408
+ const y = (v) => {
409
+ const E = v;
410
+ E.pointerType === "mouse" || !E.pointerType || r.onInitColumnResize(E, s, d, l, g);
411
+ };
412
+ r.headerListeners.add(g, "pointerdown", y);
413
+ const A = (v) => {
414
+ var N, T;
415
+ const E = v, D = E.shiftKey ? 50 : 10;
416
+ if (E.key === "ArrowRight")
417
+ E.preventDefault(), (N = r.onResizeTeclado) == null || N.call(r, D, s, d, l, c);
418
+ else if (E.key === "ArrowLeft")
419
+ E.preventDefault(), (T = r.onResizeTeclado) == null || T.call(r, -D, s, d, l, c);
420
+ else if (E.key === "Enter" || E.key === "F2") {
421
+ E.preventDefault();
422
+ const C = l.getBoundingClientRect();
423
+ r.onHeaderContextMenu(new MouseEvent("contextmenu", { clientX: C.left, clientY: C.bottom }), s, d, l);
424
+ }
425
+ };
426
+ r.headerListeners.add(g, "keydown", A);
427
+ const w = (v) => {
428
+ v.stopPropagation(), r.onColumnAutoFit(s, l, c);
429
+ };
430
+ r.headerListeners.add(g, "dblclick", w), r.headerListeners.add(g, "click", (v) => v.stopPropagation()), l.appendChild(g), o.appendChild(l);
431
+ }), r.theadElement.appendChild(o), i !== null) {
432
+ const s = Array.from(o.children).find((d) => d.getAttribute("data-coluna") === i);
433
+ (n = s == null ? void 0 : s.querySelector(".ui-tabela__ordenar")) == null || n.focus();
434
+ }
435
+ }
436
+ const Me = 'button, input, select, textarea, a, summary, [role="button"], [data-prevent-select]';
437
+ function Ne(r, t) {
438
+ for (const e of r.composedPath()) {
439
+ if (e === t) return !1;
440
+ if (e instanceof Element && e.matches(Me)) return !0;
441
+ }
442
+ return !1;
443
+ }
444
+ function Te(r) {
445
+ if (!r.tbodyElement || !r.tableElement || !r.emptyElement || !r.containerElement) return;
446
+ if (r.tableElement.setAttribute("aria-colcount", String(r.colunas.length)), !r.dadosExibicao || r.dadosExibicao.length === 0) {
447
+ r.tbodyElement.innerHTML = "", r.tableElement.setAttribute("aria-rowcount", "1"), r.tableElement.style.display = r.colunas.length > 0 ? "table" : "none", r.emptyElement.style.display = "flex";
448
+ const p = r.emptyElement.querySelector(".ui-tabela__empty-text"), h = r.filtroAtivo ? r.textoSemResultados : r.textoVazio;
449
+ p && h !== void 0 && (p.textContent = h);
450
+ return;
451
+ }
452
+ r.emptyElement.style.display = "none", r.tableElement.style.display = "table", r.tableElement.setAttribute("aria-rowcount", String(r.dadosExibicao.length + 1));
453
+ const t = r.dadosExibicao.length, e = r.rowHeight, i = r.virtualizar && t > 30;
454
+ let o = 0, a = t;
455
+ if (i) {
456
+ const p = r.containerElement.scrollTop, h = r.containerElement.clientHeight || 400, m = 5;
457
+ o = Math.max(0, Math.floor(p / e) - m), a = Math.min(t, Math.ceil((p + h) / e) + m);
458
+ }
459
+ const s = r.tbodyElement.getRootNode().activeElement, d = s && s.parentElement === r.tbodyElement ? s.getAttribute("data-index") : null, c = r.indiceAtivo ?? null, l = c !== null && c >= o && c < a ? c : o;
460
+ r.tbodyElement.innerHTML = "";
461
+ const u = document.createDocumentFragment();
462
+ if (i && o > 0) {
463
+ const p = document.createElement("tr");
464
+ p.className = "ui-tabela__virtual-spacer", p.setAttribute("aria-hidden", "true"), p.style.height = `${o * e}px`;
465
+ const h = document.createElement("td");
466
+ h.colSpan = r.colunas.length || 1, p.appendChild(h), u.appendChild(p);
467
+ }
468
+ for (let p = o; p < a; p++) {
469
+ const h = r.dadosExibicao[p], m = document.createElement("tr");
470
+ m.setAttribute("data-index", String(p)), m.setAttribute("part", "linha"), m.setAttribute("aria-rowindex", String(p + 2)), m.setAttribute("aria-selected", "false"), m.tabIndex = p === l ? 0 : -1, p % 2 === 1 && m.classList.add("ui-tabela__tr--par");
471
+ const x = r.chaveId;
472
+ h[x] !== void 0 ? m.setAttribute("data-id", String(h[x])) : h.id !== void 0 ? m.setAttribute("data-id", String(h.id)) : h._id !== void 0 && m.setAttribute("data-id", String(h._id)), r.isItemSelecionado(h, p) && (m.classList.add("ui-tabela__tr--selecionada"), m.setAttribute("part", "linha linha-selecionada"), m.setAttribute("aria-current", "true"), m.setAttribute("aria-selected", "true"), m.setAttribute("data-selecionada", "true")), m.addEventListener("click", (f) => {
473
+ Ne(f, m) || r.onLinhaClique(h, p);
474
+ }), r.colunas.forEach((f) => {
475
+ const g = document.createElement("td"), _ = r.getAlignmentClass(f.alinhamento);
476
+ if (g.className = _, g.setAttribute("part", "celula"), g.style.textAlign = r.getTextAlign(f.alinhamento), f.larguraMaxima !== void 0) {
477
+ const w = r.formatWidth(f.larguraMaxima);
478
+ g.style.maxWidth = w, g.style.overflow = "hidden", g.style.textOverflow = "ellipsis", g.style.whiteSpace = "nowrap";
479
+ }
480
+ const y = document.createElement("div");
481
+ y.className = "ui-tabela__cell-content", f.larguraMaxima !== void 0 && y.classList.add("ui-tabela__cell-truncate");
482
+ const A = h[f.id];
483
+ if (typeof f.render == "function")
484
+ try {
485
+ const w = f.render(A, h, p);
486
+ w instanceof Node ? y.appendChild(w) : y.textContent = String(w ?? "");
487
+ } catch (w) {
488
+ console.error(`[ui-tabela] Erro no render da coluna "${f.id}" (linha ${p}):`, w), y.textContent = "";
489
+ }
490
+ else if (A instanceof Node)
491
+ y.appendChild(A);
492
+ else {
493
+ const w = A != null ? String(A) : "";
494
+ y.textContent = w, f.larguraMaxima !== void 0 && !f.tooltip && (g.title = w);
495
+ }
496
+ g.appendChild(y), m.appendChild(g);
497
+ }), u.appendChild(m);
498
+ }
499
+ if (i && a < t) {
500
+ const p = document.createElement("tr");
501
+ p.className = "ui-tabela__virtual-spacer", p.setAttribute("aria-hidden", "true"), p.style.height = `${(t - a) * e}px`;
502
+ const h = document.createElement("td");
503
+ h.colSpan = r.colunas.length || 1, p.appendChild(h), u.appendChild(p);
504
+ }
505
+ if (r.tbodyElement.appendChild(u), d !== null) {
506
+ const p = r.tbodyElement.querySelector(`tr[data-index="${d}"]`);
507
+ p == null || p.focus({ preventScroll: !0 });
508
+ }
509
+ }
510
+ function Q(r) {
511
+ if (r === void 0) return null;
512
+ const t = typeof r == "number" ? r : parseInt(r, 10);
513
+ return isNaN(t) ? null : t;
514
+ }
515
+ function $(r, t) {
516
+ const e = Q(r.larguraMinima);
517
+ let i = Math.max(e ?? 60, t);
518
+ const o = Q(r.larguraMaxima);
519
+ return o !== null && (i = Math.min(o, i)), i;
520
+ }
521
+ function De(r, t, e, i) {
522
+ const o = $(r, t.offsetWidth + i);
523
+ return r.largura = `${o}px`, t.style.width = `${o}px`, e && (e.style.width = `${o}px`), `${o}px`;
524
+ }
525
+ function Re(r) {
526
+ const {
527
+ evento: t,
528
+ coluna: e,
529
+ colIndex: i,
530
+ thElement: o,
531
+ resizer: a,
532
+ colgroupElement: n,
533
+ onResizeStart: s,
534
+ onResizeEnd: d,
535
+ onResizeCancel: c
536
+ } = r;
537
+ t.stopPropagation(), t.preventDefault(), s(), a.classList.add("ui-tabela__resizer--ativo");
538
+ const l = t.pageX, u = o.offsetWidth, p = n == null ? void 0 : n.children[i], h = t.type === "pointerdown", m = h ? t.pointerId : null, x = h ? "pointermove" : "mousemove", f = h ? "pointerup" : "mouseup";
539
+ let g = !1;
540
+ const _ = (w) => {
541
+ const v = w;
542
+ if (m !== null && v.pointerId !== m) return;
543
+ g = !0;
544
+ const E = $(e, u + (v.pageX - l));
545
+ e.largura = `${E}px`, o.style.width = `${E}px`, p && (p.style.width = `${E}px`);
546
+ }, y = () => {
547
+ A(), g ? d(String(e.largura)) : c == null || c();
548
+ }, A = () => {
549
+ a.classList.remove("ui-tabela__resizer--ativo"), window.removeEventListener(x, _), window.removeEventListener(f, y), h && window.removeEventListener("pointercancel", y);
550
+ };
551
+ return window.addEventListener(x, _), window.addEventListener(f, y), h && window.addEventListener("pointercancel", y), A;
552
+ }
553
+ const R = 20;
554
+ let Be = 0;
555
+ function Oe(r) {
556
+ var T;
557
+ const {
558
+ evento: t,
559
+ coluna: e,
560
+ colIndex: i,
561
+ thElement: o,
562
+ colgroupElement: a,
563
+ shadow: n,
564
+ onResizeEnd: s
565
+ } = r, d = `ui-tabela-dlg-${++Be}`, c = document.createElement("dialog");
566
+ c.className = "ui-tabela__prompt-dialog", c.setAttribute("part", "dialogo"), c.setAttribute("aria-labelledby", `${d}-titulo`);
567
+ const l = document.createElement("label");
568
+ l.className = "ui-tabela__prompt-title", l.id = `${d}-titulo`, l.htmlFor = `${d}-campo`, l.textContent = `Largura de "${e.rotulo}" (px; vazio = automática)`;
569
+ const u = document.createElement("input");
570
+ u.id = `${d}-campo`, u.type = "number", u.min = String(R), u.step = "1", u.setAttribute("inputmode", "numeric"), u.placeholder = "auto";
571
+ const p = e.largura ? parseInt(String(e.largura), 10) : NaN;
572
+ u.value = Number.isFinite(p) ? String(p) : "";
573
+ const h = document.createElement("div");
574
+ h.className = "ui-tabela__prompt-erro", h.id = `${d}-erro`, h.setAttribute("role", "alert");
575
+ const m = document.createElement("div");
576
+ m.className = "ui-tabela__prompt-actions";
577
+ const x = document.createElement("button");
578
+ x.type = "button", x.textContent = "Aplicar";
579
+ const f = document.createElement("button");
580
+ f.type = "button", f.textContent = "Cancelar", m.appendChild(f), m.appendChild(x), c.appendChild(l), c.appendChild(u), c.appendChild(h), c.appendChild(m), n.appendChild(c), typeof c.showModal == "function" ? c.showModal() : c.setAttribute("open", ""), c.style.position = "fixed";
581
+ const g = c.getBoundingClientRect(), _ = g.width || 240, y = g.height || 140, A = Math.max(8, Math.min(t.clientX || 0, window.innerWidth - _ - 8)), w = Math.max(8, Math.min(t.clientY || 0, window.innerHeight - y - 8));
582
+ c.style.left = `${A}px`, c.style.top = `${w}px`;
583
+ let v = !1;
584
+ const E = () => {
585
+ var C;
586
+ v || (v = !0, c.open && typeof c.close == "function" && c.close(), c.remove(), (C = o.querySelector(".ui-tabela__ordenar, .ui-tabela__resizer")) == null || C.focus());
587
+ }, D = (C) => {
588
+ h.textContent = C, u.setAttribute("aria-invalid", "true"), u.setAttribute("aria-describedby", h.id), u.focus();
589
+ }, N = () => {
590
+ const C = e.largura, X = u.value.trim();
591
+ if (X === "")
592
+ e.largura = void 0, o.style.width = "", a != null && a.children[i] && (a.children[i].style.width = "");
593
+ else {
594
+ const F = Number(X);
595
+ if (!Number.isFinite(F) || F < R) {
596
+ D(`Informe um valor de pelo menos ${R} px, ou deixe vazio para automática.`);
597
+ return;
598
+ }
599
+ const H = Math.round($({ ...e, larguraMinima: e.larguraMinima ?? R }, F));
600
+ e.largura = `${H}px`, o.style.width = `${H}px`, a != null && a.children[i] && (a.children[i].style.width = `${H}px`);
601
+ }
602
+ E(), e.largura !== C && s(e.largura ? String(e.largura) : "auto");
603
+ };
604
+ x.addEventListener("click", (C) => {
605
+ C.stopPropagation(), N();
606
+ }), f.addEventListener("click", (C) => {
607
+ C.stopPropagation(), E();
608
+ }), c.addEventListener("close", E), u.addEventListener("input", () => {
609
+ h.textContent = "", u.removeAttribute("aria-invalid"), u.removeAttribute("aria-describedby");
610
+ }), u.addEventListener("keydown", (C) => {
611
+ C.key === "Enter" ? (C.preventDefault(), N()) : C.key === "Escape" && (C.preventDefault(), E());
612
+ }), u.focus(), (T = u.select) == null || T.call(u);
613
+ }
614
+ function Ie(r, t, e, i, o, a) {
615
+ return Re({
616
+ evento: r,
617
+ coluna: t,
618
+ colIndex: e,
619
+ thElement: i,
620
+ resizer: o,
621
+ colgroupElement: a.colgroupElement,
622
+ onResizeStart: () => a.onSetIsResizing(!0),
623
+ onResizeCancel: () => {
624
+ setTimeout(() => a.onSetIsResizing(!1), 50);
625
+ },
626
+ onResizeEnd: (n) => {
627
+ setTimeout(() => a.onSetIsResizing(!1), 50), a.host.dispatchEvent(
628
+ new CustomEvent("ui-column-resize", {
629
+ detail: { idColuna: t.id, largura: n },
630
+ bubbles: !0,
631
+ composed: !0
632
+ })
633
+ );
634
+ }
635
+ });
636
+ }
637
+ function Pe(r, t, e, i, o) {
638
+ r.preventDefault(), r.stopPropagation(), Oe({
639
+ evento: r,
640
+ coluna: t,
641
+ colIndex: e,
642
+ thElement: i,
643
+ colgroupElement: o.colgroupElement,
644
+ shadow: o.shadow,
645
+ onResizeEnd: (a) => {
646
+ o.host.dispatchEvent(
647
+ new CustomEvent("ui-column-resize", {
648
+ detail: { idColuna: t.id, largura: a },
649
+ bubbles: !0,
650
+ composed: !0
651
+ })
652
+ );
653
+ }
654
+ });
655
+ }
656
+ function Fe(r, t, e, i, o) {
657
+ const a = De(t, e, i, r);
658
+ o.host.dispatchEvent(
659
+ new CustomEvent("ui-column-resize", {
660
+ detail: { idColuna: t.id, largura: a },
661
+ bubbles: !0,
662
+ composed: !0
663
+ })
664
+ );
665
+ }
666
+ function He(r) {
667
+ Le({
668
+ theadElement: r.theadElement,
669
+ colgroupElement: r.colgroupElement,
670
+ colunas: r.colunas,
671
+ colunaOrdenada: r.dadosController.getColunaOrdenada(),
672
+ direcaoOrdenacao: r.dadosController.getDirecaoOrdenacao(),
673
+ headerListeners: r.headerListeners,
674
+ formatWidth: ae,
675
+ getAlignmentClass: ne,
676
+ getTextAlign: se,
677
+ onHeaderClick: (t) => r.onHeaderClick(t),
678
+ onHeaderContextMenu: (t, e, i, o) => {
679
+ Pe(t, e, i, o, {
680
+ host: r.host,
681
+ colgroupElement: r.colgroupElement,
682
+ shadow: r.shadow,
683
+ onSetIsResizing: r.onSetIsResizing
684
+ });
685
+ },
686
+ onInitColumnResize: (t, e, i, o, a) => {
687
+ const n = Ie(t, e, i, o, a, {
688
+ host: r.host,
689
+ colgroupElement: r.colgroupElement,
690
+ shadow: r.shadow,
691
+ onSetIsResizing: r.onSetIsResizing
692
+ });
693
+ r.onActiveResizeCleanup(n);
694
+ },
695
+ onResizeTeclado: (t, e, i, o, a) => {
696
+ Fe(t, e, o, a, {
697
+ host: r.host,
698
+ colgroupElement: r.colgroupElement,
699
+ shadow: r.shadow,
700
+ onSetIsResizing: r.onSetIsResizing
701
+ });
702
+ },
703
+ onColumnAutoFit: (t, e, i) => {
704
+ t.largura = void 0, e.style.width = "", i.style.width = "", r.host.dispatchEvent(
705
+ new CustomEvent("ui-column-resize", {
706
+ bubbles: !0,
707
+ composed: !0,
708
+ detail: { idColuna: t.id, largura: "auto" }
709
+ })
710
+ );
711
+ }
712
+ });
713
+ }
714
+ function Ve(r) {
715
+ Te({
716
+ tbodyElement: r.tbodyElement,
717
+ tableElement: r.tableElement,
718
+ emptyElement: r.emptyElement,
719
+ containerElement: r.containerElement,
720
+ dadosExibicao: r.dadosController.getDadosExibicao(),
721
+ colunas: r.colunas,
722
+ chaveId: r.chaveId,
723
+ virtualizar: r.virtualizar,
724
+ rowHeight: r.rowHeight,
725
+ indiceAtivo: r.indiceAtivo,
726
+ filtroAtivo: r.dadosController.temFiltro(),
727
+ textoVazio: r.textoVazio,
728
+ textoSemResultados: r.textoSemResultados,
729
+ isItemSelecionado: (t, e) => r.selecaoController.isItemSelecionado(t, e),
730
+ onLinhaClique: (t, e) => {
731
+ r.selecaoController.setItemSelecionado(t), r.host.dispatchEvent(
732
+ new CustomEvent("ui-linha-clique", {
733
+ bubbles: !0,
734
+ composed: !0,
735
+ detail: { item: t, indice: e }
736
+ })
737
+ );
738
+ },
739
+ formatWidth: ae,
740
+ getAlignmentClass: ne,
741
+ getTextAlign: se
742
+ });
743
+ }
744
+ function qe(r, t) {
745
+ let e = !1;
746
+ const i = () => {
747
+ e || (window.requestAnimationFrame(() => {
748
+ try {
749
+ t();
750
+ } finally {
751
+ e = !1;
752
+ }
753
+ }), e = !0);
754
+ };
755
+ return r.addEventListener("scroll", i), i;
756
+ }
757
+ function $e(r, t, e, i) {
758
+ return Se(r, t, e, i);
759
+ }
760
+ function le(r) {
761
+ const t = r.host.getAttribute("texto-vazio") || r.host.getAttribute("empty-text");
762
+ t && r.onTextoVazioAlterado(t);
763
+ const e = r.host.getAttribute("virtualizar") || r.host.getAttribute("virtualize");
764
+ e !== null && r.onVirtualizarAlterado(e !== "false"), r.onSrcLido(r.host.getAttribute("src"));
765
+ const i = r.host.hasAttribute("carregando") || r.host.hasAttribute("loading");
766
+ r.onCarregandoAlterado(i), r.loadingElement && (r.loadingElement.style.display = i ? "flex" : "none");
767
+ }
768
+ function je(r, t, e) {
769
+ if (le(e), r === "src") {
770
+ t && e.host.isConnected && e.onCarregarSrc(t);
771
+ return;
772
+ }
773
+ if (r === "max-height" && e.containerElement) {
774
+ e.containerElement.style.maxHeight = t || "";
775
+ return;
776
+ }
777
+ if ((r === "texto-vazio" || r === "empty-text") && e.emptyElement) {
778
+ const i = e.emptyElement.querySelector(".ui-tabela__empty-text");
779
+ i && t && (i.textContent = t), e.onRenderBody();
780
+ return;
781
+ }
782
+ if (r === "carregando" || r === "loading") {
783
+ e.loadingElement && (e.loadingElement.style.display = t !== null ? "flex" : "none");
784
+ return;
785
+ }
786
+ if (r === "densidade" || r === "density") {
787
+ e.onRenderBody();
788
+ return;
789
+ }
790
+ e.onRenderTotal();
791
+ }
792
+ function Ue(r, t, e, i) {
793
+ if (r === "Enter" || r === " ") return { tipo: "ativar" };
794
+ if (!Number.isInteger(t) || !Number.isInteger(e) || e < 0) return null;
795
+ const o = Math.max(1, Math.floor(Number.isFinite(i) ? i : 1)), a = (n) => Math.min(e, Math.max(0, n));
796
+ switch (r) {
797
+ case "ArrowDown":
798
+ return { tipo: "mover", indice: a(t + 1) };
799
+ case "ArrowUp":
800
+ return { tipo: "mover", indice: a(t - 1) };
801
+ case "Home":
802
+ return { tipo: "mover", indice: 0 };
803
+ case "End":
804
+ return { tipo: "mover", indice: e };
805
+ case "PageDown":
806
+ return { tipo: "mover", indice: a(t + o) };
807
+ case "PageUp":
808
+ return { tipo: "mover", indice: a(t - o) };
809
+ default:
810
+ return null;
811
+ }
812
+ }
813
+ const We = "Não foi possível carregar os dados.", Xe = "Nenhum resultado para o filtro";
814
+ function Ye(r, t, e, i) {
815
+ if (!r) return;
816
+ if (!t) {
817
+ r.style.display = "none";
818
+ return;
819
+ }
820
+ const o = r.querySelector(".ui-tabela__erro-mensagem"), a = r.querySelector(".ui-tabela__erro-detalhe");
821
+ o && (o.textContent = e || We), a && (a.textContent = t.erro || "");
822
+ const n = r.querySelector(".ui-tabela__erro-acao");
823
+ n && (n.style.display = i ? "" : "none"), r.style.display = "flex";
824
+ }
825
+ function Ge(r, t, e, i) {
826
+ r && (r.textContent = e ? t === 0 ? i : `${t} ${t === 1 ? "registro encontrado" : "registros encontrados"}` : "");
827
+ }
828
+ function Ke({ tabela: r, container: t }, e, i) {
829
+ r && (e ? r.setAttribute("aria-label", e) : r.removeAttribute("aria-label"), r.setAttribute("aria-busy", String(i)), t && (e ? (t.setAttribute("role", "region"), t.setAttribute("aria-label", e)) : (t.removeAttribute("role"), t.removeAttribute("aria-label"))));
830
+ }
831
+ const Qe = 800;
832
+ function Z(r, t, e) {
833
+ const i = r.getBoundingClientRect(), o = t.getBoundingClientRect(), a = i.top + r.clientTop + e, n = i.top + r.clientTop + r.clientHeight;
834
+ return o.top < a ? o.top - a : o.bottom > n ? Math.min(o.bottom - n, o.top - a) : 0;
835
+ }
836
+ function J(r, t, e) {
837
+ e === "smooth" && typeof r.scrollTo == "function" ? r.scrollTo({ top: t, behavior: "smooth" }) : r.scrollTop = t;
838
+ }
839
+ class Ze {
840
+ constructor(t) {
841
+ b(this, "cancelarCorrecao", null);
842
+ this.p = t;
843
+ }
844
+ alturaCabecalho() {
845
+ var t;
846
+ return ((t = this.p.cabecalho()) == null ? void 0 : t.offsetHeight) ?? 0;
847
+ }
848
+ /** Linhas inteiras que cabem na área visível (mínimo 1). */
849
+ linhasPorPagina() {
850
+ var e;
851
+ const t = (((e = this.p.container()) == null ? void 0 : e.clientHeight) ?? 0) - this.alturaCabecalho();
852
+ return Math.max(1, Math.floor(t / this.p.alturaLinha()));
853
+ }
854
+ /** Foca a linha, renderizando a janela virtual se necessário, e a mantém visível abaixo do cabeçalho fixo. */
855
+ focar(t) {
856
+ const e = this.p.container(), i = this.p.tbody();
857
+ if (!e || !i) return;
858
+ this.p.aoLinhaAtiva(t);
859
+ const o = `tr[data-index="${t}"]`;
860
+ let a = i.querySelector(o);
861
+ if (a || (e.scrollTop = Math.max(0, t * this.p.alturaLinha() - e.clientHeight / 2), this.p.renderizarCorpo(), a = i.querySelector(o)), !a) return;
862
+ a.focus({ preventScroll: !0 });
863
+ const n = Z(e, a, this.alturaCabecalho());
864
+ n && (e.scrollTop += n);
865
+ }
866
+ /**
867
+ * Posiciona a linha exibida `indice` na área visível.
868
+ * Fora da janela virtual, rola até a posição estimada, renderiza a janela e corrige pela posição
869
+ * real da linha. No modo suave a correção ocorre ao fim da animação (`scrollend`, com timeout de
870
+ * segurança para navegadores sem o evento ou quando não há rolagem a fazer).
871
+ */
872
+ posicionar(t, e) {
873
+ const i = this.p.container(), o = this.p.tbody();
874
+ if (!i || !o) return !1;
875
+ this.cancelar();
876
+ const a = () => o.querySelector(`tr[data-index="${t}"]`), n = (u) => {
877
+ const p = a();
878
+ if (!p) return;
879
+ const h = Z(i, p, this.alturaCabecalho());
880
+ h && J(i, i.scrollTop + h, u);
881
+ };
882
+ if (a())
883
+ return n(e), !0;
884
+ const s = () => {
885
+ i.scrollTop = Math.max(0, t * this.p.alturaLinha()), this.p.renderizarCorpo(), n("auto"), this.p.renderizarCorpo();
886
+ };
887
+ if (e === "auto")
888
+ return s(), !0;
889
+ J(i, Math.max(0, t * this.p.alturaLinha()), "smooth");
890
+ let d = !0;
891
+ const c = () => {
892
+ d && (this.cancelar(), this.p.renderizarCorpo(), a() ? n("smooth") : s());
893
+ }, l = window.setTimeout(c, Qe);
894
+ return i.addEventListener("scrollend", c, { once: !0 }), this.cancelarCorrecao = () => {
895
+ d = !1, window.clearTimeout(l), i.removeEventListener("scrollend", c), this.cancelarCorrecao = null;
896
+ }, !0;
897
+ }
898
+ /** Cancela a correção pendente de uma rolagem suave (nova rolagem, desconexão). */
899
+ cancelar() {
900
+ var t;
901
+ (t = this.cancelarCorrecao) == null || t.call(this);
902
+ }
903
+ }
904
+ class Je extends oe {
905
+ constructor() {
906
+ super();
907
+ b(this, "shadow");
908
+ b(this, "_colunas", []);
909
+ b(this, "_textoVazio", "Nenhum registro encontrado");
910
+ b(this, "_virtualizar", !0);
911
+ b(this, "_isResizing", !1);
912
+ b(this, "_carregando", !1);
913
+ b(this, "_src", null);
914
+ b(this, "_fetchOpcoes", null);
915
+ b(this, "_fetcher", null);
916
+ b(this, "_containerElement", null);
917
+ b(this, "_tableElement", null);
918
+ b(this, "_theadElement", null);
919
+ b(this, "_tbodyElement", null);
920
+ b(this, "_colgroupElement", null);
921
+ b(this, "_emptyElement", null);
922
+ b(this, "_loadingElement", null);
923
+ b(this, "_erroElement", null);
924
+ b(this, "_anuncioElement", null);
925
+ /** Último erro de carregamento remoto (null = sem erro). */
926
+ b(this, "_erro", null);
927
+ b(this, "_scrollHandler", null);
928
+ b(this, "_activeResizeCleanup", null);
929
+ b(this, "_headerListeners", new I());
930
+ b(this, "_corpoListeners", new I());
931
+ /** Linha com o foco móvel (navegação por teclado); null = primeira linha visível. */
932
+ b(this, "_indiceAtivo", null);
933
+ /** Altura real das linhas medida no DOM; null = usa a estimativa da densidade. */
934
+ b(this, "_alturaLinhaMedida", null);
935
+ b(this, "rolagem", new Ze({
936
+ container: () => this._containerElement,
937
+ tbody: () => this._tbodyElement,
938
+ cabecalho: () => this._theadElement,
939
+ alturaLinha: () => this.getRowHeight(),
940
+ renderizarCorpo: () => this.renderBody(),
941
+ aoLinhaAtiva: (e) => {
942
+ this._indiceAtivo = e;
943
+ }
944
+ }));
945
+ b(this, "remotaController");
946
+ b(this, "selecaoController");
947
+ b(this, "dadosController", new ke());
948
+ /** Mantém um único tabindex=0 (foco móvel): Tab entra na tabela pela última linha ativa. */
949
+ b(this, "handleFocoLinha", (e) => {
950
+ const i = e.target;
951
+ i.parentElement !== this._tbodyElement || !i.hasAttribute("data-index") || this.definirLinhaAtiva(Number(i.getAttribute("data-index")));
952
+ });
953
+ /**
954
+ * Teclado nas linhas: setas, Home/End e PageUp/PageDown movem o foco;
955
+ * Enter/Espaço selecionam a linha (mesmo caminho do clique, emite `ui-linha-clique`).
956
+ */
957
+ b(this, "handleTecladoCorpo", (e) => {
958
+ const i = e.target;
959
+ if (i.parentElement !== this._tbodyElement || !i.hasAttribute("data-index")) return;
960
+ const o = this.dadosController.getDadosExibicao().length - 1, a = Ue(e.key, Number(i.getAttribute("data-index")), o, this.rolagem.linhasPorPagina());
961
+ a && (e.preventDefault(), a.tipo === "ativar" ? i.click() : this.rolagem.focar(a.indice));
962
+ });
963
+ this.shadow = this.attachShadow({ mode: "open" }), this.remotaController = new ge({
964
+ host: this,
965
+ onCarregandoAlterado: (e) => {
966
+ this.carregando = e;
967
+ },
968
+ onDadosRecebidos: (e) => {
969
+ this.dados = e;
970
+ },
971
+ getOpcoes: () => this._fetchOpcoes,
972
+ getFetcher: () => this._fetcher
973
+ }), this.selecaoController = new Ee({
974
+ host: this,
975
+ getTbody: () => this._tbodyElement,
976
+ getDadosExibicao: () => this.dadosController.getDadosExibicao(),
977
+ getDadosOriginais: () => this.dadosController.getDadosOriginais(),
978
+ getChaveId: () => this.chaveId,
979
+ onRolarParaIndice: (e, i) => this.rolagem.posicionar(e, i),
980
+ onLinhaAtiva: (e) => this.definirLinhaAtiva(e)
981
+ }), this.addEventListener("ui-fetch-erro", (e) => this.mostrarErro(e.detail)), this.addEventListener("ui-fetch-start", () => this.mostrarErro(null)), this.addEventListener("ui-fetch-sucesso", () => this.mostrarErro(null));
982
+ }
983
+ static get observedAttributes() {
984
+ return ["texto-vazio", "empty-text", "max-height", "densidade", "density", "altura-linha", "row-height", "virtualizar", "virtualize", "src", "carregando", "loading", "chave-id", "id-key", "aria-label", "ordenacao-remota", "texto-erro", "texto-sem-resultados", "texto-carregando"];
985
+ }
986
+ connectedCallback() {
987
+ this.syncAttributes(), this.alturaLinha && this.style.setProperty("--ui-tabela-altura-linha", `${this.alturaLinha}px`), !this.hasAttribute("densidade") && !this.hasAttribute("density") && this.setAttribute("densidade", "normal"), this.renderTotal(), this._src && this.remotaController.carregar(this._src);
988
+ }
989
+ disconnectedCallback() {
990
+ this.cleanupEventListeners();
991
+ }
992
+ attributeChangedCallback(e, i, o) {
993
+ e === "ordenacao-remota" && (this.dadosController.setOrdenacaoRemota(o !== null), this.atualizarContextoSelecao()), (e === "densidade" || e === "density" || e === "altura-linha" || e === "row-height") && (this._alturaLinhaMedida = null), (e === "altura-linha" || e === "row-height") && this.aplicarAlturaLinha(), (e === "chave-id" || e === "id-key") && this.atualizarContextoSelecao(), je(e, o, this.obterContextoAtributos()), this.sincronizarAria();
994
+ }
995
+ /** Nome acessível vem do host (`aria-label`); `aria-busy` acompanha o carregamento remoto. */
996
+ sincronizarAria() {
997
+ this._tableElement && (Ke({ tabela: this._tableElement, container: this._containerElement }, this.getAttribute("aria-label"), this._carregando), this.atualizarTextosEstado());
998
+ }
999
+ /** Textos de estado configuráveis por atributo (carregando, sem resultados, erro). */
1000
+ atualizarTextosEstado() {
1001
+ var i;
1002
+ const e = (i = this._loadingElement) == null ? void 0 : i.querySelector(".ui-tabela__loading-texto");
1003
+ e && (e.textContent = this.getAttribute("texto-carregando") || "Carregando dados..."), this.renderizarErro();
1004
+ }
1005
+ /** Mostra (ou oculta, com null) o aviso de erro de carregamento com a ação "Tentar novamente". */
1006
+ mostrarErro(e) {
1007
+ this._erro = e, this.renderizarErro();
1008
+ }
1009
+ renderizarErro() {
1010
+ Ye(this._erroElement, this._erro, this.getAttribute("texto-erro"), !!this._src);
1011
+ }
1012
+ /** Anuncia ao leitor de tela o resultado do filtro (a região é limpa sem filtro ativo). */
1013
+ anunciarResultado() {
1014
+ Ge(
1015
+ this._anuncioElement,
1016
+ this.dadosController.getDadosExibicao().length,
1017
+ this.dadosController.temFiltro(),
1018
+ this._textoSemResultados()
1019
+ );
1020
+ }
1021
+ _textoSemResultados() {
1022
+ return this.getAttribute("texto-sem-resultados") || Xe;
1023
+ }
1024
+ syncAttributes() {
1025
+ le(this.obterContextoAtributos());
1026
+ }
1027
+ obterContextoAtributos() {
1028
+ return {
1029
+ host: this,
1030
+ containerElement: this._containerElement,
1031
+ emptyElement: this._emptyElement,
1032
+ loadingElement: this._loadingElement,
1033
+ onTextoVazioAlterado: (e) => {
1034
+ this._textoVazio = e;
1035
+ },
1036
+ onVirtualizarAlterado: (e) => {
1037
+ this._virtualizar = e;
1038
+ },
1039
+ onSrcLido: (e) => {
1040
+ this._src = e;
1041
+ },
1042
+ onCarregarSrc: (e) => {
1043
+ this.remotaController.carregar(e);
1044
+ },
1045
+ onCarregandoAlterado: (e) => {
1046
+ this._carregando = e;
1047
+ },
1048
+ onRenderBody: () => this.renderBody(),
1049
+ onRenderTotal: () => this.renderTotal()
1050
+ };
1051
+ }
1052
+ get src() {
1053
+ return this._src;
1054
+ }
1055
+ set src(e) {
1056
+ this._src = e, e ? this.setAttribute("src", e) : this.removeAttribute("src");
1057
+ }
1058
+ get carregando() {
1059
+ return this._carregando;
1060
+ }
1061
+ set carregando(e) {
1062
+ this._carregando = !!e, this._carregando ? this.setAttribute("carregando", "") : (this.removeAttribute("carregando"), this.removeAttribute("loading")), this._loadingElement && (this._loadingElement.style.display = this._carregando ? "flex" : "none"), this.sincronizarAria();
1063
+ }
1064
+ /** Opções do `fetch` do modo remoto (headers, credentials, method, body...); o `signal` é da tabela. */
1065
+ get fetchOpcoes() {
1066
+ return this._fetchOpcoes;
1067
+ }
1068
+ set fetchOpcoes(e) {
1069
+ this._fetchOpcoes = e ?? null;
1070
+ }
1071
+ /** Função de busca alternativa ao `fetch` (autenticação, renovação de token, mocks). */
1072
+ get fetcher() {
1073
+ return this._fetcher;
1074
+ }
1075
+ set fetcher(e) {
1076
+ this._fetcher = typeof e == "function" ? e : null;
1077
+ }
1078
+ /** Ordenação feita pelo servidor: o clique no cabeçalho atualiza o indicador e emite `ui-sort`, mas não reordena. */
1079
+ get ordenacaoRemota() {
1080
+ return this.hasAttribute("ordenacao-remota");
1081
+ }
1082
+ set ordenacaoRemota(e) {
1083
+ this.toggleAttribute("ordenacao-remota", !!e);
1084
+ }
1085
+ /** Busca a URL (guardada como `src`, para `recarregar()`). Resolve `true` em sucesso; falhas vão em `ui-fetch-erro`. */
1086
+ async carregarDoEndpoint(e) {
1087
+ return e && e !== this._src && (this.src = e), this.remotaController.carregar(e || this._src || "");
1088
+ }
1089
+ async recarregar() {
1090
+ return this._src ? this.remotaController.carregar(this._src) : (this.dadosController.aplicarOrdenacao(), this.atualizarContextoSelecao(), this.renderBody(), !0);
1091
+ }
1092
+ filtrar(e) {
1093
+ this.dadosController.filtrar(e), this.atualizarContextoSelecao(), this.renderBody();
1094
+ }
1095
+ cleanupEventListeners() {
1096
+ this._containerElement && this._scrollHandler && (this._containerElement.removeEventListener("scroll", this._scrollHandler), this._scrollHandler = null), this._activeResizeCleanup && (this._activeResizeCleanup(), this._activeResizeCleanup = null, this._isResizing = !1), this.rolagem.cancelar(), this.remotaController.abortar(), this._headerListeners.cleanup(), this._corpoListeners.cleanup();
1097
+ }
1098
+ get colunas() {
1099
+ return this._colunas;
1100
+ }
1101
+ set colunas(e) {
1102
+ this._colunas = Array.isArray(e) ? e.filter((i) => i != null).map((i) => ({ ...i })) : [], this.dadosController.setColunas(this._colunas), this.dadosController.setColunasFiltro(this._colunas.map((i) => i.id)), this._alturaLinhaMedida = null, this.renderTotal();
1103
+ }
1104
+ get dados() {
1105
+ return this.dadosController.getDadosOriginais();
1106
+ }
1107
+ set dados(e) {
1108
+ this.dadosController.setDadosOriginais(e), this.atualizarContextoSelecao(), this.renderBody();
1109
+ }
1110
+ get itens() {
1111
+ return this.dados;
1112
+ }
1113
+ set itens(e) {
1114
+ this.dados = e;
1115
+ }
1116
+ get chaveId() {
1117
+ return this.getAttribute("chave-id") || this.getAttribute("id-key") || "id";
1118
+ }
1119
+ set chaveId(e) {
1120
+ e ? this.setAttribute("chave-id", e) : (this.removeAttribute("chave-id"), this.removeAttribute("id-key")), this.atualizarContextoSelecao();
1121
+ }
1122
+ get itemSelecionado() {
1123
+ return this.selecaoController.getItemSelecionado();
1124
+ }
1125
+ set itemSelecionado(e) {
1126
+ this.selecaoController.setItemSelecionado(e);
1127
+ }
1128
+ get indiceSelecionado() {
1129
+ return this.selecaoController.getIndiceSelecionado();
1130
+ }
1131
+ set indiceSelecionado(e) {
1132
+ this.selecaoController.setIndiceSelecionado(e);
1133
+ }
1134
+ limparSelecao() {
1135
+ this.selecaoController.limparSelecao();
1136
+ }
1137
+ get densidade() {
1138
+ const e = this.getAttribute("densidade") || this.getAttribute("density");
1139
+ return e === "compacta" || e === "compact" ? "compacta" : e === "relaxada" || e === "relaxed" ? "relaxada" : "normal";
1140
+ }
1141
+ set densidade(e) {
1142
+ e ? this.setAttribute("densidade", e) : (this.removeAttribute("densidade"), this.removeAttribute("density")), this.renderBody();
1143
+ }
1144
+ get virtualizar() {
1145
+ return this._virtualizar;
1146
+ }
1147
+ set virtualizar(e) {
1148
+ this._virtualizar = !!e, e ? this.setAttribute("virtualizar", "true") : this.removeAttribute("virtualizar"), this.renderTotal();
1149
+ }
1150
+ get colunaOrdenada() {
1151
+ return this.dadosController.getColunaOrdenada();
1152
+ }
1153
+ set colunaOrdenada(e) {
1154
+ this.dadosController.setColunaOrdenada(e), this.atualizarContextoSelecao(), this.renderHeader(), this.renderBody();
1155
+ }
1156
+ get direcaoOrdenacao() {
1157
+ return this.dadosController.getDirecaoOrdenacao();
1158
+ }
1159
+ set direcaoOrdenacao(e) {
1160
+ this.dadosController.setDirecaoOrdenacao(e), this.atualizarContextoSelecao(), this.renderHeader(), this.renderBody();
1161
+ }
1162
+ get textoVazio() {
1163
+ return this._textoVazio;
1164
+ }
1165
+ set textoVazio(e) {
1166
+ this._textoVazio = e || "Nenhum registro encontrado", this.renderTotal();
1167
+ }
1168
+ handleHeaderClick(e) {
1169
+ if (!e.ordenavel || this._isResizing) return;
1170
+ const i = this.dadosController.getColunaOrdenada(), o = this.dadosController.getDirecaoOrdenacao(), a = this.dadosController.alternarOrdenacaoColuna(e);
1171
+ if (!a) return;
1172
+ this.atualizarContextoSelecao(), this.renderHeader(), this.renderBody();
1173
+ const n = new CustomEvent("ui-sort", { detail: a, bubbles: !0, composed: !0, cancelable: !0 });
1174
+ this.dispatchEvent(n), n.defaultPrevented && (this.dadosController.restaurarOrdenacao(i, o), this.atualizarContextoSelecao(), this.renderHeader(), this.renderBody());
1175
+ }
1176
+ /** Altura fixa das linhas em px (`altura-linha`), sobrepõe a densidade; null = vale a densidade. */
1177
+ get alturaLinha() {
1178
+ const e = this.getAttribute("altura-linha") ?? this.getAttribute("row-height"), i = e === null ? NaN : parseFloat(e);
1179
+ return Number.isFinite(i) && i > 0 ? i : null;
1180
+ }
1181
+ set alturaLinha(e) {
1182
+ e && e > 0 ? this.setAttribute("altura-linha", String(e)) : (this.removeAttribute("altura-linha"), this.removeAttribute("row-height"));
1183
+ }
1184
+ /** Publica a altura fixa como variável CSS (usada pelo estilo `:host([altura-linha])`). */
1185
+ aplicarAlturaLinha() {
1186
+ const e = this.alturaLinha;
1187
+ e ? this.style.setProperty("--ui-tabela-altura-linha", `${e}px`) : this.style.removeProperty("--ui-tabela-altura-linha"), this.renderBody();
1188
+ }
1189
+ /** Altura usada na virtualização: a fixa (`altura-linha`), a medida no DOM ou a estimativa da densidade. */
1190
+ getRowHeight() {
1191
+ return this.alturaLinha ?? this._alturaLinhaMedida ?? K(this.densidade);
1192
+ }
1193
+ /**
1194
+ * Mede a altura real das linhas uma vez por configuração (densidade/colunas): padding, fonte e
1195
+ * renderizadores customizados mudam a altura, e a estimativa fixa desalinharia a janela virtual.
1196
+ * Não remede a cada rolagem para os espaçadores não "pularem" com linhas de alturas diferentes.
1197
+ */
1198
+ medirAlturaLinha() {
1199
+ if (this._alturaLinhaMedida !== null || !this._tbodyElement) return;
1200
+ const e = this._tbodyElement.querySelectorAll("tr[data-index]");
1201
+ if (e.length === 0) return;
1202
+ let i = 0;
1203
+ e.forEach((a) => {
1204
+ i += a.getBoundingClientRect().height;
1205
+ });
1206
+ const o = i / e.length;
1207
+ o <= 0 || (this._alturaLinhaMedida = o, Math.abs(o - K(this.densidade)) > 0.5 && this.renderBody());
1208
+ }
1209
+ /** Ordenar, filtrar, trocar os dados ou a chave mantém a linha selecionada (se ainda existir). */
1210
+ atualizarContextoSelecao() {
1211
+ this.selecaoController.reconciliar(), this._indiceAtivo = this.selecaoController.getIndiceSelecionado();
1212
+ }
1213
+ renderTotal() {
1214
+ var e;
1215
+ if (this.shadow) {
1216
+ if (this._containerElement) {
1217
+ if (this._containerElement.style.maxHeight = this.getAttribute("max-height") || "", this._emptyElement) {
1218
+ const i = this._emptyElement.querySelector(".ui-tabela__empty-text");
1219
+ i && (i.textContent = this._textoVazio);
1220
+ }
1221
+ } else {
1222
+ this.cleanupEventListeners();
1223
+ const i = $e(this.shadow, this._textoVazio, this.getAttribute("max-height"), this._carregando);
1224
+ this._containerElement = i.containerElement, this._tableElement = i.tableElement, this._colgroupElement = i.colgroupElement, this._theadElement = i.theadElement, this._tbodyElement = i.tbodyElement, this._emptyElement = i.emptyElement, this._loadingElement = i.loadingElement, this._erroElement = i.erroElement, this._anuncioElement = i.anuncioElement, (e = i.erroElement.querySelector(".ui-tabela__erro-acao")) == null || e.addEventListener("click", () => {
1225
+ this.recarregar();
1226
+ });
1227
+ }
1228
+ this.renderHeader(), this.renderBody(), this._virtualizar && this._containerElement && !this._scrollHandler && (this._scrollHandler = qe(this._containerElement, () => this.renderBody())), this._tbodyElement && this._corpoListeners.size === 0 && (this._corpoListeners.add(this._tbodyElement, "keydown", this.handleTecladoCorpo), this._corpoListeners.add(this._tbodyElement, "focusin", this.handleFocoLinha)), this.sincronizarAria();
1229
+ }
1230
+ }
1231
+ definirLinhaAtiva(e) {
1232
+ this._indiceAtivo = e;
1233
+ const i = this._tbodyElement, o = i == null ? void 0 : i.querySelector(`tr[data-index="${e}"]`);
1234
+ !i || !o || (i.querySelectorAll('tr[tabindex="0"]').forEach((a) => {
1235
+ a !== o && (a.tabIndex = -1);
1236
+ }), o.tabIndex = 0);
1237
+ }
1238
+ obterContextoRenderizador() {
1239
+ return {
1240
+ host: this,
1241
+ shadow: this.shadow,
1242
+ theadElement: this._theadElement,
1243
+ colgroupElement: this._colgroupElement,
1244
+ tbodyElement: this._tbodyElement,
1245
+ tableElement: this._tableElement,
1246
+ emptyElement: this._emptyElement,
1247
+ containerElement: this._containerElement,
1248
+ colunas: this._colunas,
1249
+ dadosController: this.dadosController,
1250
+ selecaoController: this.selecaoController,
1251
+ chaveId: this.chaveId,
1252
+ virtualizar: this._virtualizar,
1253
+ rowHeight: this.getRowHeight(),
1254
+ indiceAtivo: this._indiceAtivo,
1255
+ textoVazio: this._textoVazio,
1256
+ textoSemResultados: this._textoSemResultados(),
1257
+ headerListeners: this._headerListeners,
1258
+ onSetIsResizing: (e) => {
1259
+ this._isResizing = e;
1260
+ },
1261
+ onActiveResizeCleanup: (e) => {
1262
+ this._activeResizeCleanup = e;
1263
+ },
1264
+ onHeaderClick: (e) => this.handleHeaderClick(e)
1265
+ };
1266
+ }
1267
+ renderHeader() {
1268
+ He(this.obterContextoRenderizador());
1269
+ }
1270
+ renderBody() {
1271
+ Ve(this.obterContextoRenderizador()), this.anunciarResultado(), this.medirAlturaLinha();
1272
+ }
1273
+ /**
1274
+ * Rola até um item e opcionalmente o seleciona. Aceita ID (pela `chave-id`, depois `id`, `_id`,
1275
+ * `codigo`, `key`), predicado ou índice. Um número é procurado primeiro como ID; use
1276
+ * `{ porIndice: true }` ou `rolarParaIndice()` para tratá-lo só como índice da linha exibida.
1277
+ */
1278
+ rolarPara(e, i) {
1279
+ return this.selecaoController.rolarPara(e, i);
1280
+ }
1281
+ /** Rola até a linha exibida de índice `indice` (posição após ordenação/filtro, base 0). */
1282
+ rolarParaIndice(e, i) {
1283
+ return this.selecaoController.rolarPara(e, { ...i, porIndice: !0 });
1284
+ }
1285
+ }
1286
+ ie("ui-tabela", Je);
1287
+ const S = Math.PI / 180;
1288
+ function L(r) {
1289
+ return Math.abs(r) < 1e-12 ? 0 : Number(r.toPrecision(15));
1290
+ }
1291
+ const et = {
1292
+ sqrt: Math.sqrt,
1293
+ abs: Math.abs,
1294
+ round: Math.round,
1295
+ floor: Math.floor,
1296
+ ceil: Math.ceil,
1297
+ sin: (r) => L(Math.sin(r * S)),
1298
+ cos: (r) => L(Math.cos(r * S)),
1299
+ tan: (r) => L(Math.tan(r * S)),
1300
+ asin: (r) => L(Math.asin(r) / S),
1301
+ acos: (r) => L(Math.acos(r) / S),
1302
+ atan: (r) => L(Math.atan(r) / S)
1303
+ };
1304
+ function ee(r) {
1305
+ if (!r || typeof r != "string") return null;
1306
+ let t = r.trim();
1307
+ if (!t) return null;
1308
+ t = t.replace(/(\d),(\d)/g, "$1.$2").replace(/,/g, "."), t = t.replace(/\bpi\b/gi, String(Math.PI)), t = t.replace(/\be\b/gi, String(Math.E));
1309
+ let e = 0;
1310
+ function i() {
1311
+ return t[e] || "";
1312
+ }
1313
+ function o() {
1314
+ return t[e++] || "";
1315
+ }
1316
+ function a() {
1317
+ for (; e < t.length && /\s/.test(t[e]); )
1318
+ e++;
1319
+ }
1320
+ function n() {
1321
+ a();
1322
+ let l = s();
1323
+ for (a(); e < t.length; ) {
1324
+ const u = i();
1325
+ if (u === "+" || u === "-") {
1326
+ o(), a();
1327
+ const p = e, h = s();
1328
+ a(), t.slice(p, e).includes("%") ? l = u === "+" ? l + l * h : l - l * h : l = u === "+" ? l + h : l - h;
1329
+ } else
1330
+ break;
1331
+ }
1332
+ return l;
1333
+ }
1334
+ function s() {
1335
+ a();
1336
+ let l = d();
1337
+ for (a(); e < t.length; ) {
1338
+ const u = i();
1339
+ if (u === "*" || u === "/" || u === "x" || u === "X") {
1340
+ o(), a();
1341
+ const p = d();
1342
+ if (u === "/" && p === 0)
1343
+ throw new Error("Divisão por zero");
1344
+ l = u === "/" ? l / p : l * p, a();
1345
+ } else
1346
+ break;
1347
+ }
1348
+ return l;
1349
+ }
1350
+ function d() {
1351
+ a();
1352
+ const l = i();
1353
+ if (l === "+" || l === "-") {
1354
+ o();
1355
+ const p = d();
1356
+ return l === "-" ? -p : p;
1357
+ }
1358
+ let u = c();
1359
+ if (a(), i() === "^") {
1360
+ o();
1361
+ const p = d();
1362
+ u = Math.pow(u, p);
1363
+ } else if (t.slice(e, e + 2) === "**") {
1364
+ e += 2;
1365
+ const p = d();
1366
+ u = Math.pow(u, p);
1367
+ }
1368
+ return u;
1369
+ }
1370
+ function c() {
1371
+ a();
1372
+ const l = i();
1373
+ if (l === "+" || l === "-") {
1374
+ o();
1375
+ const h = c();
1376
+ return l === "-" ? -h : h;
1377
+ }
1378
+ if (l === "(") {
1379
+ o();
1380
+ const h = n();
1381
+ if (a(), o() !== ")") throw new Error("Parêntese sem fechamento");
1382
+ return a(), i() === "%" ? (o(), h / 100) : h;
1383
+ }
1384
+ const u = t.slice(e).match(/^([a-zA-Z_]\w*)\s*\(/);
1385
+ if (u) {
1386
+ const h = et[u[1].toLowerCase()];
1387
+ if (!h) throw new Error("Função desconhecida: " + u[1]);
1388
+ e += u[0].length;
1389
+ const m = n();
1390
+ if (a(), o() !== ")") throw new Error("Parêntese sem fechamento");
1391
+ const x = h(m);
1392
+ return a(), i() === "%" ? (o(), x / 100) : x;
1393
+ }
1394
+ const p = t.slice(e).match(/^([0-9]+(?:\.[0-9]+)?|\.[0-9]+)/);
1395
+ if (p) {
1396
+ e += p[0].length;
1397
+ let h = parseFloat(p[0]);
1398
+ return a(), i() === "%" && (o(), h = h / 100), h;
1399
+ }
1400
+ throw new Error("Caractere inválido: " + l);
1401
+ }
1402
+ try {
1403
+ const l = n();
1404
+ return a(), e < t.length ? null : isFinite(l) ? l : null;
1405
+ } catch {
1406
+ return null;
1407
+ }
1408
+ }
1409
+ const tt = '.ui-prop__linha input:not([disabled]):not([type="color"]):not(.ui-prop__cor-picker-oculto), .ui-prop__linha select:not([disabled]), .ui-prop__linha .ui-prop__btn-acao-inline:not([disabled]), .ui-prop__linha .ui-prop__editor-booleano, .ui-prop__linha .ui-prop__editor-cor-container';
1410
+ function de(r, t) {
1411
+ if (!r) return null;
1412
+ const e = String(t);
1413
+ return Array.from(r.querySelectorAll("[data-prop-id]")).find((i) => i.getAttribute("data-prop-id") === e) ?? null;
1414
+ }
1415
+ const ce = /* @__PURE__ */ new WeakMap();
1416
+ function k(r, t) {
1417
+ ce.set(r, t);
1418
+ }
1419
+ function te(r, t, e) {
1420
+ var a, n;
1421
+ const i = de(r, t), o = (a = i == null ? void 0 : i.querySelector(".ui-prop__col-valor")) == null ? void 0 : a.firstElementChild;
1422
+ o && ((n = ce.get(o)) == null || n(e));
1423
+ }
1424
+ function z(r, t, e = (o, a) => o === String(a), i = (o) => o == null || o === "" ? "—" : String(o)) {
1425
+ var n;
1426
+ (n = r.querySelector("option[data-externa]")) == null || n.remove();
1427
+ const o = Array.from(r.options).find((s) => !s.hasAttribute("data-acao") && e(s.value, t));
1428
+ if (o) {
1429
+ o.selected = !0;
1430
+ return;
1431
+ }
1432
+ const a = document.createElement("option");
1433
+ a.value = t == null ? "" : String(t), a.textContent = i(t), a.setAttribute("data-externa", ""), a.hidden = !0, r.insertBefore(a, r.firstChild), a.selected = !0;
1434
+ }
1435
+ function rt(r, t) {
1436
+ const e = Array.from(r.querySelectorAll(tt)), i = e.indexOf(t);
1437
+ if (i !== -1 && i + 1 < e.length) {
1438
+ const o = e[i + 1];
1439
+ o.focus(), o instanceof HTMLInputElement && o.select();
1440
+ }
1441
+ }
1442
+ function j(r, t) {
1443
+ var e;
1444
+ r.classList.toggle("ui-prop__categoria--aberta", t), (e = r.querySelector(".ui-prop__categoria-header")) == null || e.setAttribute("aria-expanded", String(t));
1445
+ }
1446
+ function it(r, t) {
1447
+ t.forEach((e) => e.aberto = !0), r.querySelectorAll(".ui-prop__categoria").forEach((e) => j(e, !0));
1448
+ }
1449
+ function ot(r, t) {
1450
+ t.forEach((e) => e.aberto = !1), r.querySelectorAll(".ui-prop__categoria").forEach((e) => j(e, !1));
1451
+ }
1452
+ function at(r, t, e, i) {
1453
+ const o = e.find((a) => a.id === i);
1454
+ if (o) {
1455
+ o.aberto = o.aberto === !1;
1456
+ const a = Array.from(r.querySelectorAll("[data-cat-id]")).find((n) => n.getAttribute("data-cat-id") === i);
1457
+ a && j(a, !!o.aberto), t.dispatchEvent(
1458
+ new CustomEvent("ui-categoria-toggle", {
1459
+ bubbles: !0,
1460
+ composed: !0,
1461
+ detail: { id: i, aberto: o.aberto }
1462
+ })
1463
+ );
1464
+ }
1465
+ }
1466
+ function nt(r) {
1467
+ const t = document.createElement("span"), e = (i) => {
1468
+ const o = typeof i == "number" || typeof i == "string" && /^-?\d+(\.\d+)?$/.test(i.trim());
1469
+ t.className = `ui-prop__valor-readonly ${o ? "ui-prop__valor-readonly--numero" : ""}`.trim(), t.textContent = i != null ? String(i) : "—";
1470
+ };
1471
+ return e(r), k(t, e), t;
1472
+ }
1473
+ function st(r, t, e, i) {
1474
+ const o = document.createElement("label");
1475
+ o.className = "ui-prop__editor-booleano", o.setAttribute("role", "checkbox"), o.tabIndex = 0, o.setAttribute("aria-label", t.rotulo);
1476
+ const a = document.createElement("div");
1477
+ a.className = "ui-prop__checkbox-custom";
1478
+ const n = document.createElement("span");
1479
+ n.className = "ui-prop__booleano-rotulo";
1480
+ const s = (c) => {
1481
+ const l = !!c;
1482
+ a.classList.toggle("ui-prop__checkbox-custom--marcado", l), a.textContent = l ? "✓" : "", n.textContent = l ? "Sim" : "Não", o.setAttribute("aria-checked", String(l));
1483
+ };
1484
+ s(e), k(o, s), o.appendChild(a), o.appendChild(n);
1485
+ const d = () => {
1486
+ const c = !i.obterValorAtual(t.id);
1487
+ i.registrarAlteracao(r, t.id, c), s(c);
1488
+ };
1489
+ return o.addEventListener("click", (c) => {
1490
+ c.preventDefault(), d();
1491
+ }), o.addEventListener("keydown", (c) => {
1492
+ c.key === " " ? (c.preventDefault(), d()) : c.key === "Enter" && (c.preventDefault(), i.focarProximoEditor(o));
1493
+ }), o;
1494
+ }
1495
+ function lt(r, t, e, i) {
1496
+ const o = document.createElement("select");
1497
+ return o.className = "ui-prop__editor-select", o.setAttribute("aria-label", t.rotulo), (t.opcoes || []).forEach((a) => {
1498
+ const n = document.createElement("option");
1499
+ n.value = String(a.id), n.textContent = a.rotulo, o.appendChild(n);
1500
+ }), z(o, e), k(o, (a) => z(o, a)), o.addEventListener("change", () => {
1501
+ const a = (t.opcoes || []).find((n) => String(n.id) === o.value);
1502
+ i.registrarAlteracao(r, t.id, a ? a.id : o.value), z(o, i.obterValorAtual(t.id));
1503
+ }), o.addEventListener("keydown", (a) => {
1504
+ a.key === "Enter" && i.focarProximoEditor(o);
1505
+ }), o;
1506
+ }
1507
+ function dt(r, t, e) {
1508
+ const i = document.createElement("button");
1509
+ return i.type = "button", i.className = "ui-prop__btn-acao-inline", i.textContent = t.rotuloAcao || "Editar...", i.addEventListener("click", () => {
1510
+ typeof t.onClickAcao == "function" && t.onClickAcao(t), e.despacharEventoAcao(t, r);
1511
+ }), i;
1512
+ }
1513
+ function ct(r, t, e, i) {
1514
+ const o = document.createElement("input");
1515
+ o.type = "text", o.inputMode = "decimal", o.autocomplete = "off", o.spellcheck = !1, o.className = "ui-prop__editor-input ui-prop__editor-input--numero", o.setAttribute("aria-label", t.rotulo), t.placeholder && (o.placeholder = t.placeholder);
1516
+ const a = (s) => {
1517
+ if (s == null || s === "") return "";
1518
+ const d = Number(s);
1519
+ return isNaN(d) ? String(s) : t.casasDecimais !== void 0 ? d.toFixed(t.casasDecimais) : String(d);
1520
+ };
1521
+ o.value = a(e), k(o, (s) => {
1522
+ o.value = a(s);
1523
+ }), o.addEventListener("focus", () => {
1524
+ o.select();
1525
+ }), o.addEventListener("input", () => {
1526
+ const s = o.value, d = /[\+\-\*\/\^\%\(\)]/.test(s) && !/^[+-]?[0-9]*\.?[0-9]*$/.test(s.trim());
1527
+ o.classList.toggle("ui-prop__editor-input--calculando", d);
1528
+ });
1529
+ const n = () => {
1530
+ o.classList.remove("ui-prop__editor-input--calculando");
1531
+ const s = o.value.trim();
1532
+ if (s === "") {
1533
+ i.registrarAlteracao(r, t.id, null);
1534
+ return;
1535
+ }
1536
+ const d = ee(s);
1537
+ if (d !== null && !isNaN(d)) {
1538
+ let c = d;
1539
+ t.casasDecimais !== void 0 && (c = Number(d.toFixed(t.casasDecimais))), o.value = a(c), i.registrarAlteracao(r, t.id, c);
1540
+ } else
1541
+ o.value = a(i.obterValorAtual(t.id));
1542
+ };
1543
+ return o.addEventListener("change", n), o.addEventListener("blur", n), o.addEventListener("keydown", (s) => {
1544
+ if (s.key === "Enter")
1545
+ n(), i.focarProximoEditor(o);
1546
+ else if (s.key === "Escape")
1547
+ o.classList.remove("ui-prop__editor-input--calculando"), o.value = a(i.obterValorAtual(t.id)), o.blur();
1548
+ else if (s.key === "ArrowUp" || s.key === "ArrowDown") {
1549
+ s.preventDefault();
1550
+ const c = ee(o.value) ?? (Number(i.obterValorAtual(t.id)) || 0);
1551
+ let l = t.casasDecimais !== void 0 ? Math.pow(10, -t.casasDecimais) : 1;
1552
+ s.shiftKey ? l *= 10 : s.altKey && t.casasDecimais === void 0 && (l *= 0.1);
1553
+ let u = s.key === "ArrowUp" ? c + l : c - l;
1554
+ t.casasDecimais !== void 0 ? u = Number(u.toFixed(t.casasDecimais)) : u = Math.round(u * 100) / 100, o.value = a(u), i.registrarAlteracao(r, t.id, u);
1555
+ }
1556
+ }), o;
1557
+ }
1558
+ function ut(r, t, e, i) {
1559
+ const o = document.createElement("input");
1560
+ o.type = "text", o.className = "ui-prop__editor-input", o.setAttribute("aria-label", t.rotulo), t.placeholder && (o.placeholder = t.placeholder), o.value = e != null ? String(e) : "", k(o, (n) => {
1561
+ o.value = n != null ? String(n) : "";
1562
+ }), o.addEventListener("focus", () => {
1563
+ o.select();
1564
+ });
1565
+ const a = () => {
1566
+ i.registrarAlteracao(r, t.id, o.value);
1567
+ };
1568
+ return o.addEventListener("change", a), o.addEventListener("keydown", (n) => {
1569
+ n.key === "Enter" ? (a(), i.focarProximoEditor(o)) : n.key === "Escape" && (o.value = String(i.obterValorAtual(t.id) ?? ""), o.blur());
1570
+ }), o;
1571
+ }
1572
+ const P = (r, t) => r.toLowerCase() === String(t ?? "").toLowerCase();
1573
+ function U(r, t) {
1574
+ t.forEach((e) => {
1575
+ const i = document.createElement("option");
1576
+ i.value = String(e.id), i.textContent = e.rotulo, r.appendChild(i);
1577
+ });
1578
+ }
1579
+ function pt(r, t, e, i) {
1580
+ const o = document.createElement("div");
1581
+ o.className = "ui-prop__editor-linha-container";
1582
+ const a = document.createElementNS("http://www.w3.org/2000/svg", "svg");
1583
+ a.setAttribute("class", "ui-prop__linha-amostra-svg"), a.setAttribute("viewBox", "0 0 44 12");
1584
+ const n = document.createElementNS("http://www.w3.org/2000/svg", "line");
1585
+ n.setAttribute("x1", "0"), n.setAttribute("y1", "6"), n.setAttribute("x2", "44"), n.setAttribute("y2", "6");
1586
+ const s = (l) => {
1587
+ const u = String(l || "").toLowerCase();
1588
+ u.includes("center") || u.includes("eixo") || u.includes("dashdot") || u.includes("traço-ponto") ? n.setAttribute("stroke-dasharray", "8,3,2,3") : u.includes("dash") || u.includes("tracej") || u.includes("hidden") ? n.setAttribute("stroke-dasharray", "6,3") : u.includes("dot") || u.includes("ponto") || u.includes("pontilh") ? n.setAttribute("stroke-dasharray", "2,3") : n.setAttribute("stroke-dasharray", "none");
1589
+ };
1590
+ a.appendChild(n);
1591
+ const d = document.createElement("select");
1592
+ d.className = "ui-prop__linha-select", d.setAttribute("aria-label", t.rotulo), U(d, t.opcoes && t.opcoes.length > 0 ? t.opcoes : [
1593
+ { id: "ByLayer", rotulo: "ByLayer" },
1594
+ { id: "ByBlock", rotulo: "ByBlock" },
1595
+ { id: "Continuous", rotulo: "Continuous" },
1596
+ { id: "Dashed", rotulo: "Dashed" },
1597
+ { id: "Hidden", rotulo: "Hidden" },
1598
+ { id: "Center", rotulo: "Center" },
1599
+ { id: "Dotted", rotulo: "Dotted" }
1600
+ ]);
1601
+ const c = (l) => {
1602
+ s(l), z(d, l, P);
1603
+ };
1604
+ return c(e), k(o, c), d.addEventListener("change", () => {
1605
+ s(d.value), i.registrarAlteracao(r, t.id, d.value), z(d, d.value, P);
1606
+ }), d.addEventListener("keydown", (l) => {
1607
+ l.key === "Enter" && i.focarProximoEditor(d);
1608
+ }), o.appendChild(a), o.appendChild(d), o;
1609
+ }
1610
+ function ht(r, t, e, i) {
1611
+ const o = document.createElement("div");
1612
+ o.className = "ui-prop__editor-espessura-container";
1613
+ const a = document.createElementNS("http://www.w3.org/2000/svg", "svg");
1614
+ a.setAttribute("class", "ui-prop__espessura-amostra-svg"), a.setAttribute("viewBox", "0 0 38 12");
1615
+ const n = document.createElementNS("http://www.w3.org/2000/svg", "line");
1616
+ n.setAttribute("x1", "0"), n.setAttribute("y1", "6"), n.setAttribute("x2", "38"), n.setAttribute("y2", "6");
1617
+ const s = (l) => {
1618
+ const u = parseFloat(String(l).replace(/[^0-9.]/g, ""));
1619
+ return isNaN(u) || u <= 0 ? 1.5 : Math.min(8, Math.max(1, u * 8));
1620
+ };
1621
+ a.appendChild(n);
1622
+ const d = document.createElement("select");
1623
+ d.className = "ui-prop__espessura-select", d.setAttribute("aria-label", t.rotulo), U(d, t.opcoes && t.opcoes.length > 0 ? t.opcoes : [
1624
+ { id: "ByLayer", rotulo: "ByLayer" },
1625
+ { id: "ByBlock", rotulo: "ByBlock" },
1626
+ { id: "0.00 mm", rotulo: "0.00 mm" },
1627
+ { id: "0.05 mm", rotulo: "0.05 mm" },
1628
+ { id: "0.09 mm", rotulo: "0.09 mm" },
1629
+ { id: "0.13 mm", rotulo: "0.13 mm" },
1630
+ { id: "0.15 mm", rotulo: "0.15 mm" },
1631
+ { id: "0.18 mm", rotulo: "0.18 mm" },
1632
+ { id: "0.20 mm", rotulo: "0.20 mm" },
1633
+ { id: "0.25 mm", rotulo: "0.25 mm" },
1634
+ { id: "0.30 mm", rotulo: "0.30 mm" },
1635
+ { id: "0.35 mm", rotulo: "0.35 mm" },
1636
+ { id: "0.40 mm", rotulo: "0.40 mm" },
1637
+ { id: "0.50 mm", rotulo: "0.50 mm" },
1638
+ { id: "0.60 mm", rotulo: "0.60 mm" },
1639
+ { id: "0.70 mm", rotulo: "0.70 mm" },
1640
+ { id: "1.00 mm", rotulo: "1.00 mm" },
1641
+ { id: "1.40 mm", rotulo: "1.40 mm" },
1642
+ { id: "2.00 mm", rotulo: "2.00 mm" }
1643
+ ]);
1644
+ const c = (l) => {
1645
+ n.setAttribute("stroke-width", String(s(l))), z(d, l, P);
1646
+ };
1647
+ return c(e), k(o, c), d.addEventListener("change", () => {
1648
+ n.setAttribute("stroke-width", String(s(d.value))), i.registrarAlteracao(r, t.id, d.value), z(d, d.value, P);
1649
+ }), d.addEventListener("keydown", (l) => {
1650
+ l.key === "Enter" && i.focarProximoEditor(d);
1651
+ }), o.appendChild(a), o.appendChild(d), o;
1652
+ }
1653
+ const W = [
1654
+ { nome: "Red", indice: 1, hex: "#ff0000" },
1655
+ { nome: "Yellow", indice: 2, hex: "#ffff00" },
1656
+ { nome: "Green", indice: 3, hex: "#00ff00" },
1657
+ { nome: "Cyan", indice: 4, hex: "#00ffff" },
1658
+ { nome: "Blue", indice: 5, hex: "#0000ff" },
1659
+ { nome: "Magenta", indice: 6, hex: "#ff00ff" },
1660
+ { nome: "White", indice: 7, hex: "#ffffff" }
1661
+ ], ue = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
1662
+ function q(r) {
1663
+ const t = String(r ?? "").trim().toLowerCase(), e = W.find((i) => String(i.indice) === t || i.nome.toLowerCase() === t);
1664
+ return e ? e.nome.toLowerCase() : t;
1665
+ }
1666
+ function mt(r) {
1667
+ const t = q(r), e = W.find((i) => i.nome.toLowerCase() === t);
1668
+ return e ? e.hex : ue.test(t) ? t : "#ffffff";
1669
+ }
1670
+ function pe(r) {
1671
+ return r.length === 4 ? "#" + r.slice(1).split("").map((t) => t + t).join("") : r;
1672
+ }
1673
+ function bt(r, t, e, i) {
1674
+ const o = document.createElement("div");
1675
+ o.className = "ui-prop__editor-cor-cad-container";
1676
+ const a = document.createElement("div");
1677
+ a.className = "ui-prop__cor-amostra";
1678
+ const n = document.createElement("select");
1679
+ n.className = "ui-prop__cor-cad-select", n.setAttribute("aria-label", t.rotulo), U(n, [
1680
+ { id: "ByLayer", rotulo: "ByLayer" },
1681
+ { id: "ByBlock", rotulo: "ByBlock" },
1682
+ ...W.map((l) => ({ id: l.nome, rotulo: `${l.nome} (${l.indice})` }))
1683
+ ]);
1684
+ const s = document.createElement("option");
1685
+ s.value = "__escolher", s.textContent = "Selecionar cor...", s.setAttribute("data-acao", ""), n.appendChild(s);
1686
+ const d = document.createElement("input");
1687
+ d.type = "color", d.className = "ui-prop__cor-picker-oculto", d.tabIndex = -1;
1688
+ const c = (l) => {
1689
+ const u = mt(l);
1690
+ a.style.backgroundColor = u, d.value = pe(u), z(
1691
+ n,
1692
+ l,
1693
+ (p, h) => q(p) === q(h),
1694
+ (p) => p == null || p === "" ? "—" : String(p)
1695
+ );
1696
+ };
1697
+ return c(e), k(o, c), d.addEventListener("input", () => {
1698
+ a.style.backgroundColor = d.value;
1699
+ }), d.addEventListener("change", () => {
1700
+ i.registrarAlteracao(r, t.id, d.value), c(i.obterValorAtual(t.id));
1701
+ }), n.addEventListener("change", () => {
1702
+ if (n.value === "__escolher") {
1703
+ c(i.obterValorAtual(t.id)), d.click();
1704
+ return;
1705
+ }
1706
+ i.registrarAlteracao(r, t.id, n.value), c(i.obterValorAtual(t.id));
1707
+ }), n.addEventListener("keydown", (l) => {
1708
+ l.key === "Enter" && i.focarProximoEditor(n);
1709
+ }), o.appendChild(a), o.appendChild(n), o.appendChild(d), o;
1710
+ }
1711
+ function ft(r, t, e, i) {
1712
+ const o = document.createElement("div");
1713
+ o.className = "ui-prop__editor-cor-container", o.setAttribute("role", "button"), o.tabIndex = 0;
1714
+ const a = document.createElement("div");
1715
+ a.className = "ui-prop__cor-amostra";
1716
+ const n = document.createElement("span");
1717
+ n.className = "ui-prop__cor-texto";
1718
+ const s = document.createElement("input");
1719
+ s.type = "color", s.className = "ui-prop__cor-picker-oculto", s.tabIndex = -1;
1720
+ const d = (c) => {
1721
+ const l = typeof c == "string" && ue.test(c) ? pe(c) : null;
1722
+ a.style.backgroundColor = c || "#ffffff", n.textContent = t.textoAmostra || String(c || "ByLayer"), s.value = l ?? "#ffffff", o.setAttribute("aria-label", `${t.rotulo}: ${c || "ByLayer"}`);
1723
+ };
1724
+ return d(e), k(o, d), s.addEventListener("input", () => {
1725
+ a.style.backgroundColor = s.value, n.textContent = t.textoAmostra || s.value;
1726
+ }), s.addEventListener("change", () => {
1727
+ i.registrarAlteracao(r, t.id, s.value), d(i.obterValorAtual(t.id));
1728
+ }), o.addEventListener("click", (c) => {
1729
+ c.target !== s && s.click();
1730
+ }), o.addEventListener("keydown", (c) => {
1731
+ (c.key === " " || c.key === "Enter") && (c.preventDefault(), s.click());
1732
+ }), o.appendChild(a), o.appendChild(n), o.appendChild(s), o;
1733
+ }
1734
+ function gt(r, t, e, i) {
1735
+ return t.somenteLeitura || t.tipo === "readonly" ? nt(e) : t.tipo === "booleano" ? st(r, t, e, i) : t.tipo === "linha" || t.tipo === "linetype" ? pt(r, t, e, i) : t.tipo === "espessura" || t.tipo === "lineweight" ? ht(r, t, e, i) : t.tipo === "cor-cad" ? bt(r, t, e, i) : t.tipo === "selecao" ? lt(r, t, e, i) : t.tipo === "cor" ? ft(r, t, e, i) : t.tipo === "acao" ? dt(r, t, i) : t.tipo === "numero" ? ct(r, t, e, i) : ut(r, t, e, i);
1736
+ }
1737
+ function xt(r) {
1738
+ if (!r.tipoContainerElement) return;
1739
+ if (!r.tipos || r.tipos.length === 0) {
1740
+ r.tipoContainerElement.style.display = "none";
1741
+ return;
1742
+ }
1743
+ r.tipoContainerElement.style.display = "flex", r.tipoContainerElement.innerHTML = "";
1744
+ const t = r.tipos.find((e) => String(e.id) === String(r.tipoSelecionadoId)) || r.tipos[0];
1745
+ if (r.estiloVisual === "revit") {
1746
+ const e = document.createElement("div");
1747
+ e.className = "ui-prop__tipo-revit-card";
1748
+ const i = document.createElement("div");
1749
+ i.className = "ui-prop__tipo-miniatura";
1750
+ const o = t.iconeSvg ? fe(t.iconeSvg) : null;
1751
+ o ? i.appendChild(o) : i.innerHTML = `
1752
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
1753
+ <rect x="3" y="3" width="18" height="18" rx="2"></rect>
1754
+ <path d="M3 9h18M9 21V9"></path>
1755
+ </svg>
1756
+ `;
1757
+ const a = document.createElement("div");
1758
+ a.className = "ui-prop__tipo-info";
1759
+ const n = document.createElement("div");
1760
+ n.className = "ui-prop__tipo-nome", n.textContent = t.rotulo;
1761
+ const s = document.createElement("div");
1762
+ s.className = "ui-prop__tipo-subtexto", s.textContent = t.subtipo || "Tipo de Família", a.appendChild(n), a.appendChild(s), e.appendChild(i), e.appendChild(a);
1763
+ const d = document.createElement("div");
1764
+ d.className = "ui-prop__tipo-revit-subbarra";
1765
+ const c = document.createElement("select");
1766
+ c.className = "ui-prop__tipo-select", r.tipos.forEach((u) => {
1767
+ const p = document.createElement("option");
1768
+ p.value = u.id, p.textContent = `${u.rotulo}${u.subtipo ? ` : ${u.subtipo}` : ""}`, String(u.id) === String(r.tipoSelecionadoId) && (p.selected = !0), c.appendChild(p);
1769
+ }), c.addEventListener("change", () => {
1770
+ r.onSelecionarTipo(c.value);
1771
+ });
1772
+ const l = document.createElement("button");
1773
+ l.type = "button", l.className = "ui-prop__btn-editar-tipo", l.innerHTML = `
1774
+ <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="margin-right: 4px; vertical-align: -1px;">
1775
+ <rect x="3" y="3" width="12" height="12" rx="1"></rect>
1776
+ <rect x="9" y="9" width="12" height="12" rx="1"></rect>
1777
+ </svg>
1778
+ <span>Editar tipo</span>
1779
+ `, l.addEventListener("click", () => {
1780
+ r.onEditarTipo(t);
1781
+ }), d.appendChild(c), d.appendChild(l), r.tipoContainerElement.appendChild(e), r.tipoContainerElement.appendChild(d);
1782
+ } else {
1783
+ const e = document.createElement("div");
1784
+ e.className = "ui-prop__tipo-autocad-bar";
1785
+ const i = document.createElement("select");
1786
+ i.className = "ui-prop__tipo-select", r.tipos.forEach((d) => {
1787
+ const c = document.createElement("option");
1788
+ c.value = d.id, c.textContent = d.rotulo, String(d.id) === String(r.tipoSelecionadoId) && (c.selected = !0), i.appendChild(c);
1789
+ }), i.addEventListener("change", () => {
1790
+ r.onSelecionarTipo(i.value);
1791
+ });
1792
+ const o = document.createElement("div");
1793
+ o.className = "ui-prop__tipo-autocad-acoes";
1794
+ const a = document.createElement("button");
1795
+ a.type = "button", a.className = "ui-prop__btn-autocad", a.title = "Seleção rápida", a.setAttribute("aria-label", "Seleção rápida"), a.innerHTML = `
1796
+ <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
1797
+ <polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon>
1798
+ </svg>
1799
+ `, a.addEventListener("click", () => {
1800
+ r.onQuickSelect(t);
1801
+ });
1802
+ const n = document.createElement("button");
1803
+ n.type = "button", n.className = "ui-prop__btn-autocad", n.title = "Selecionar objetos", n.setAttribute("aria-label", "Selecionar objetos"), n.innerHTML = `
1804
+ <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
1805
+ <circle cx="12" cy="12" r="7"></circle>
1806
+ <line x1="12" y1="2" x2="12" y2="7"></line>
1807
+ <line x1="12" y1="17" x2="12" y2="22"></line>
1808
+ <line x1="2" y1="12" x2="7" y2="12"></line>
1809
+ <line x1="17" y1="12" x2="22" y2="12"></line>
1810
+ <line x1="12" y1="9" x2="12" y2="15" stroke-width="2.5"></line>
1811
+ <line x1="9" y1="12" x2="15" y2="12" stroke-width="2.5"></line>
1812
+ </svg>
1813
+ `, n.addEventListener("click", () => {
1814
+ r.onSelectObjects(t);
1815
+ });
1816
+ const s = document.createElement("button");
1817
+ s.type = "button", s.className = "ui-prop__btn-autocad", s.title = "Calculadora rápida", s.setAttribute("aria-label", "Calculadora rápida"), s.innerHTML = `
1818
+ <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
1819
+ <rect x="4" y="2" width="16" height="20" rx="2"></rect>
1820
+ <line x1="8" y1="6" x2="16" y2="6"></line>
1821
+ <circle cx="8" cy="11" r="1" fill="currentColor"></circle>
1822
+ <circle cx="12" cy="11" r="1" fill="currentColor"></circle>
1823
+ <circle cx="16" cy="11" r="1" fill="currentColor"></circle>
1824
+ <circle cx="8" cy="15" r="1" fill="currentColor"></circle>
1825
+ <circle cx="12" cy="15" r="1" fill="currentColor"></circle>
1826
+ <circle cx="16" cy="15" r="1" fill="currentColor"></circle>
1827
+ </svg>
1828
+ `, s.addEventListener("click", () => {
1829
+ r.onCalculadora(t);
1830
+ }), o.appendChild(a), o.appendChild(n), o.appendChild(s), e.appendChild(i), e.appendChild(o), r.tipoContainerElement.appendChild(e);
1831
+ }
1832
+ }
1833
+ function vt(r) {
1834
+ let t = 45;
1835
+ function e(o) {
1836
+ const a = Math.max(20, Math.min(65, o));
1837
+ return t = a, r.hostElement.style.setProperty("--ui-prop-rotulo-largura", `${a}%`), r.splitterElement && (r.splitterElement.style.left = `calc(${a}% - 4px)`), a;
1838
+ }
1839
+ function i() {
1840
+ if (!r.splitterElement || !r.corpoElement) return;
1841
+ r.splitterListeners.cleanup();
1842
+ let o = !1;
1843
+ const a = (n) => {
1844
+ if (n.button !== 0) return;
1845
+ n.preventDefault(), n.stopPropagation(), o = !0, r.splitterElement.classList.add("ui-prop__splitter--ativo");
1846
+ try {
1847
+ r.splitterElement.setPointerCapture(n.pointerId);
1848
+ } catch {
1849
+ }
1850
+ const s = r.corpoElement.getBoundingClientRect(), d = (l) => {
1851
+ if (!o) return;
1852
+ const u = s.width;
1853
+ if (u <= 0) return;
1854
+ const p = l.clientX - s.left;
1855
+ let f = Math.max(80, Math.min(u - 130, p)) / u * 100;
1856
+ f = Math.max(20, Math.min(65, f)), e(f);
1857
+ }, c = (l) => {
1858
+ if (o) {
1859
+ o = !1, r.splitterElement.classList.remove("ui-prop__splitter--ativo");
1860
+ try {
1861
+ r.splitterElement.hasPointerCapture(l.pointerId) && r.splitterElement.releasePointerCapture(l.pointerId);
1862
+ } catch {
1863
+ }
1864
+ r.splitterElement.removeEventListener("pointermove", d), r.splitterElement.removeEventListener("pointerup", c), r.splitterElement.removeEventListener("pointercancel", c), r.onLarguraAlterada(t), r.hostElement.dispatchEvent(
1865
+ new CustomEvent("ui-splitter-resize", {
1866
+ bubbles: !0,
1867
+ composed: !0,
1868
+ detail: { larguraPorcentagem: t }
1869
+ })
1870
+ );
1871
+ }
1872
+ };
1873
+ r.splitterElement.addEventListener("pointermove", d), r.splitterElement.addEventListener("pointerup", c), r.splitterElement.addEventListener("pointercancel", c);
1874
+ };
1875
+ r.splitterListeners.add(r.splitterElement, "pointerdown", a), r.splitterListeners.add(r.splitterElement, "dblclick", () => {
1876
+ e(45), r.onLarguraAlterada(45), r.hostElement.dispatchEvent(
1877
+ new CustomEvent("ui-splitter-resize", {
1878
+ bubbles: !0,
1879
+ composed: !0,
1880
+ detail: { larguraPorcentagem: 45 }
1881
+ })
1882
+ );
1883
+ });
1884
+ }
1885
+ return {
1886
+ init: i,
1887
+ definirLarguraRotulo: e
1888
+ };
1889
+ }
1890
+ const _t = `:host{display:flex;flex-direction:column;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif);font-size:var(--ui-tamanho-corpo-sm, 12px);color:var(--ui-cor-texto, #e1e1e6);background-color:var(--ui-cor-superficie, #141417);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 4px);overflow:hidden;width:100%;max-width:100%;height:100%;min-height:200px;-webkit-user-select:none;user-select:none;--ui-prop-altura-linha: 22px;--ui-prop-rotulo-largura: 45%}:host([densidade="compacta"]){--ui-prop-altura-linha: 19px;font-size:10.5px}:host([densidade="ultracompacta"]){--ui-prop-altura-linha: 17px;font-size:10px}:host([densidade="relaxada"]){--ui-prop-altura-linha: 28px;font-size:12px}:host([colapsado]){width:32px!important;min-width:32px!important;max-width:32px!important;height:100%!important;cursor:pointer;transition:width .2s cubic-bezier(.4,0,.2,1)}:host([colapsado]) .ui-prop__header,:host([colapsado]) .ui-prop__tipo-seletor-container,:host([colapsado]) .ui-prop__filtro-container,:host([colapsado]) .ui-prop__corpo-wrapper,:host([colapsado]) .ui-prop__footer,:host([colapsado]) .ui-prop__resizer-canto{display:none!important}:host([colapsado]) .ui-prop__faixa-estreita{display:flex!important;flex-direction:column;align-items:center;width:100%;height:100%;padding:8px 0;gap:10px;box-sizing:border-box;background-color:var(--ui-cor-fundo-elevado, #18181d);-webkit-user-select:none;user-select:none;cursor:pointer}.ui-prop__faixa-estreita{display:none}.ui-prop__faixa-icone{display:flex;align-items:center;justify-content:center;color:var(--ui-cor-destaque, #00E08A);flex-shrink:0}.ui-prop__faixa-btn-expandir{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 5%,transparent);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:3px;color:var(--ui-cor-texto, #e1e1e6);cursor:pointer;padding:0;transition:all .15s ease;flex-shrink:0}.ui-prop__faixa-btn-expandir:hover{background-color:var(--ui-cor-destaque, #00E08A);color:#000;border-color:var(--ui-cor-destaque, #00E08A)}.ui-prop__faixa-texto{writing-mode:vertical-rl;text-orientation:mixed;transform:rotate(180deg);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:2px;color:var(--ui-cor-texto-secundario, #888899);margin-top:8px;flex:1;pointer-events:none}:host([colapsado]):hover .ui-prop__faixa-texto{color:var(--ui-cor-texto, #ffffff)}:host([flutuante]){position:fixed!important;z-index:var(--ui-z-docked-bar, 600)!important;box-shadow:var(--ui-sombra-lg, 0 16px 48px rgba(0, 0, 0, .75)),0 0 0 1px color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 14%,transparent),0 6px 14px #00000080!important;border-radius:6px!important;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);resize:both;overflow:hidden;max-width:95vw;max-height:95vh;min-width:220px;min-height:200px}:host([flutuante]) .ui-prop__header{cursor:grab;-webkit-user-select:none;user-select:none}:host([flutuante].arrastando) .ui-prop__header{cursor:grabbing!important}.ui-prop__resizer-canto{display:none}:host([flutuante]) .ui-prop__resizer-canto{display:block;position:absolute;bottom:0;right:0;width:14px;height:14px;cursor:nwse-resize;z-index:50;background:linear-gradient(135deg,transparent 50%,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent) 50%,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent) 65%,transparent 65%,transparent 80%,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent) 80%);pointer-events:auto}.ui-prop__btn-icone--ativo{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 18%,transparent)!important;color:var(--ui-cor-destaque, #00E08A)!important}.ui-prop__container{display:flex;flex-direction:column;width:100%;height:100%;min-height:0;flex:1;overflow:hidden;box-sizing:border-box}.ui-prop__header{display:flex;align-items:center;justify-content:space-between;height:22px;min-height:22px;padding:0 8px;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));flex-shrink:0;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__header{height:20px;min-height:20px;padding:0 6px}:host([densidade="ultracompacta"]) .ui-prop__header{height:18px;min-height:18px;padding:0 5px}.ui-prop__header-titulo{display:flex;align-items:center;gap:5px;font-size:10.5px;font-weight:600;color:var(--ui-cor-texto, #ffffff);text-transform:uppercase;letter-spacing:.4px}:host([densidade="compacta"]) .ui-prop__header-titulo{font-size:10px;gap:4px}:host([densidade="ultracompacta"]) .ui-prop__header-titulo{font-size:9.5px;gap:3px}.ui-prop__header-icone{display:flex;align-items:center;color:var(--ui-cor-destaque, #00E08A)}.ui-prop__header-icone svg{width:12px;height:12px}:host([densidade="ultracompacta"]) .ui-prop__header-icone svg{width:10px;height:10px}.ui-prop__header-acoes{display:flex;align-items:center;gap:2px}.ui-prop__btn-icone{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;background:transparent;border:none;border-radius:2px;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer;transition:all .15s ease;padding:0}.ui-prop__btn-icone:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08));color:var(--ui-cor-texto, #ffffff)}:host([densidade="compacta"]) .ui-prop__btn-icone{width:17px;height:17px}:host([densidade="ultracompacta"]) .ui-prop__btn-icone{width:16px;height:16px}.ui-prop__tipo-seletor-container{padding:3px 6px;background-color:var(--ui-cor-superficie, #141417);border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));display:flex;flex-direction:column;gap:3px;flex-shrink:0;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__tipo-seletor-container{padding:2px 5px;gap:2px}:host([densidade="ultracompacta"]) .ui-prop__tipo-seletor-container{padding:1px 4px;gap:1px}.ui-prop__tipo-revit-card{display:flex;align-items:center;gap:10px;background-color:var(--ui-cor-fundo-card, #18181c);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-sm, 4px);padding:6px 8px;cursor:pointer;transition:border-color .15s ease}.ui-prop__tipo-revit-card:hover{border-color:var(--ui-cor-destaque, #00E08A)}.ui-prop__tipo-miniatura{width:32px;height:32px;border-radius:3px;background-color:var(--ui-cor-fundo-elevado, #24242a);display:flex;align-items:center;justify-content:center;color:var(--ui-cor-destaque, #00E08A);flex-shrink:0}.ui-prop__tipo-info{display:flex;flex-direction:column;flex:1;min-width:0}.ui-prop__tipo-nome{font-weight:600;font-size:12px;color:var(--ui-cor-texto, #ffffff);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ui-prop__tipo-subtexto{font-size:11px;color:var(--ui-cor-texto-secundario, #888899);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ui-prop__tipo-revit-subbarra{display:flex;align-items:center;gap:6px}.ui-prop__tipo-select{flex:1;min-width:0;width:0;height:20px;background-color:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:2px;padding:0 16px 0 2px;font-size:10.5px;font-weight:500;cursor:pointer;outline:none;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 4px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;box-sizing:border-box;transition:background-color .15s ease,color .15s ease}.ui-prop__tipo-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 5%,transparent);color:#fff}.ui-prop__tipo-select:focus{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 8%,transparent);color:var(--ui-cor-destaque, #00E08A)}:host([densidade="compacta"]) .ui-prop__tipo-select{height:18px;font-size:10px;padding:0 14px 0 2px}:host([densidade="ultracompacta"]) .ui-prop__tipo-select{height:16px;font-size:9.5px;padding:0 12px 0 2px}.ui-prop__btn-editar-tipo{height:20px;padding:0 6px;background-color:transparent;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:2px;color:var(--ui-cor-texto, #ffffff);font-size:10.5px;font-weight:500;cursor:pointer;white-space:nowrap;transition:all .15s ease}:host([densidade="compacta"]) .ui-prop__btn-editar-tipo{height:18px;font-size:10px}:host([densidade="ultracompacta"]) .ui-prop__btn-editar-tipo{height:16px;font-size:9.5px}.ui-prop__btn-editar-tipo:hover{background-color:var(--ui-cor-botao-secundario-hover, #2a2a34);border-color:var(--ui-cor-destaque, #00E08A)}.ui-prop__tipo-autocad-bar{display:flex;align-items:center;gap:2px;width:100%;min-width:0;box-sizing:border-box;background:transparent}.ui-prop__tipo-autocad-acoes{display:flex;align-items:center;gap:1px;flex-shrink:0;border-left:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));padding-left:3px;margin-left:1px}.ui-prop__btn-autocad{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;background:transparent;border:none;border-radius:2px;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer;padding:0;transition:all .15s ease}:host([densidade="compacta"]) .ui-prop__btn-autocad{width:18px;height:18px}:host([densidade="ultracompacta"]) .ui-prop__btn-autocad{width:16px;height:16px}.ui-prop__btn-autocad:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .1));color:var(--ui-cor-destaque, #00E08A)}.ui-prop__btn-autocad:active{transform:scale(.92);background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 15%,transparent)}.ui-prop__filtro-container{display:flex;align-items:center;padding:4px 8px;background-color:var(--ui-cor-fundo, #0b0b0d);border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));gap:6px;flex-shrink:0}.ui-prop__filtro-icone{color:var(--ui-cor-texto-secundario, #888899);flex-shrink:0}.ui-prop__filtro-input{flex:1;background:transparent;border:none;outline:none;font-size:11px;color:var(--ui-cor-texto, #e1e1e6);padding:3px 0}.ui-prop__filtro-input::placeholder{color:var(--ui-cor-texto-secundario, #666677)}.ui-prop__corpo-wrapper{position:relative;flex:1;min-height:0;width:100%;overflow:hidden;display:flex;flex-direction:column}.ui-prop__corpo{flex:1;min-height:0;width:100%;overflow-y:auto;overflow-x:hidden;background-color:var(--ui-cor-superficie, #141417);position:relative;scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 18%,transparent) var(--ui-cor-fundo, #0b0b0d)}.ui-prop__corpo::-webkit-scrollbar{width:8px}.ui-prop__corpo::-webkit-scrollbar-track{background:var(--ui-cor-fundo, #0b0b0d)}.ui-prop__corpo::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 18%,transparent);border-radius:var(--ui-raio-sm, 4px)}.ui-prop__corpo::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 30%,transparent)}.ui-prop__categoria{border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .1))}.ui-prop__categoria-header{position:relative;z-index:25;display:flex;align-items:center;justify-content:space-between;height:21px;padding:0 6px;background-color:var(--ui-cor-fundo-elevado, #18181d);cursor:pointer;-webkit-user-select:none;user-select:none;font-weight:600;font-size:10.5px;color:var(--ui-cor-texto, #ffffff);border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .05));transition:background-color .15s ease;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__categoria-header{height:19px;font-size:10px;padding:0 5px}:host([densidade="ultracompacta"]) .ui-prop__categoria-header{height:17px;font-size:9.5px;padding:0 4px}.ui-prop__categoria-header:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .06))}.ui-prop__categoria-titulo-bloco{display:flex;align-items:center;gap:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-prop__categoria-seta{display:inline-flex;align-items:center;justify-content:center;font-size:9px;width:12px;height:12px;color:var(--ui-cor-texto-secundario, #888899);transition:transform .15s ease}.ui-prop__categoria--aberta .ui-prop__categoria-seta{transform:rotate(90deg)}.ui-prop__categoria-contador{font-size:10px;font-weight:400;color:var(--ui-cor-texto-secundario, #888899)}.ui-prop__categoria-conteudo{display:none}.ui-prop__categoria--aberta .ui-prop__categoria-conteudo{display:block}.ui-prop__linha{display:flex;align-items:stretch;min-height:var(--ui-prop-altura-linha, 24px);border-bottom:1px dotted var(--ui-cor-borda, rgba(255, 255, 255, .08));box-sizing:border-box;position:relative;z-index:1;transition:background-color .1s ease}.ui-prop__linha:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .04))}.ui-prop__linha:focus-within{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 8%,transparent)}.ui-prop__linha:focus-within .ui-prop__col-rotulo{color:var(--ui-cor-texto, #ffffff);font-weight:500}.ui-prop__linha--modificada{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 5%,transparent)}.ui-prop__col-rotulo{width:var(--ui-prop-rotulo-largura, 45%);padding:1px 4px 1px 8px;display:flex;align-items:center;color:var(--ui-cor-texto-secundario, #9999aa);border-right:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10.5px;position:relative;flex-shrink:0;box-sizing:border-box}:host([densidade="compacta"]) .ui-prop__col-rotulo{padding:0 4px 0 6px;font-size:10px}:host([densidade="ultracompacta"]) .ui-prop__col-rotulo{padding:0 3px 0 5px;font-size:9.5px}.ui-prop__col-rotulo span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-prop__col-rotulo--scrub{cursor:ew-resize;-webkit-user-select:none;user-select:none;transition:color .15s ease,background-color .15s ease}.ui-prop__col-rotulo--scrub:hover{color:var(--ui-cor-destaque, #00E08A);background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 5%,transparent)}.ui-prop__col-rotulo--arrastando{color:#000!important;background-color:var(--ui-cor-destaque, #00E08A)!important;font-weight:600;cursor:ew-resize!important}.ui-prop__col-rotulo--arrastando span{color:#000!important}.ui-prop__splitter{position:absolute;top:0;bottom:0;min-height:100%;left:calc(var(--ui-prop-rotulo-largura, 45%) - 4px);width:8px;cursor:col-resize;z-index:30;touch-action:none;-webkit-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center}.ui-prop__splitter:after{content:"";position:absolute;top:0;bottom:0;left:3px;width:2px;background-color:transparent;pointer-events:none;transition:background-color .15s ease,box-shadow .15s ease}.ui-prop__splitter:hover:after,.ui-prop__splitter--ativo:after{background-color:var(--ui-cor-destaque, #00E08A);box-shadow:0 0 6px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 50%,transparent)}.ui-prop__splitter--ativo{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 8%,transparent)}.ui-prop__col-valor{width:calc(100% - var(--ui-prop-rotulo-largura, 45%));flex:1 1 0px;min-width:0!important;display:flex;align-items:stretch;padding:0;overflow:hidden;box-sizing:border-box;position:relative;transition:background-color .1s ease,box-shadow .1s ease}.ui-prop__col-valor:focus-within{background-color:var(--ui-cor-fundo, #0b0b0d);box-shadow:inset 0 0 0 1px var(--ui-cor-destaque, #00E08A)}.ui-prop__editor-input{width:100%;min-width:0;height:100%;min-height:var(--ui-prop-altura-linha, 24px);background:transparent;border:none;border-radius:0;color:var(--ui-cor-texto, #ffffff);font-family:inherit;font-size:11px;padding:0 8px;outline:none;box-sizing:border-box;transition:background-color .1s ease}.ui-prop__editor-input:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__editor-input--numero{text-align:right;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums}.ui-prop__editor-input--calculando{color:var(--ui-cor-destaque, #00E08A)!important;font-weight:500}.ui-prop__col-valor:has(.ui-prop__editor-input--calculando){background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 8%,transparent)!important;box-shadow:inset 0 0 0 1.5px var(--ui-cor-destaque, #00E08A)!important}.ui-prop__editor-select{flex:1 1 0px;min-width:0!important;width:0!important;max-width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);background-color:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:0;font-size:11px;padding:0 20px 0 8px;outline:none;cursor:pointer;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;transition:background-color .1s ease}.ui-prop__editor-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__editor-select option{background-color:var(--ui-cor-fundo-elevado, #18181c);color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor-cor-container{display:flex;align-items:center;gap:6px;width:100%;max-width:100%;min-width:0!important;height:100%;min-height:var(--ui-prop-altura-linha, 24px);cursor:pointer;padding:0 20px 0 8px;box-sizing:border-box;position:relative;border:none;border-radius:0;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;transition:background-color .1s ease}.ui-prop__editor-cor-container:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 4%,transparent)}.ui-prop__cor-amostra{width:13px;height:13px;border-radius:2px;border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 30%,transparent);flex-shrink:0;box-sizing:border-box}.ui-prop__cor-texto{flex:1 1 0px;min-width:0!important;width:0!important;font-size:11px;color:var(--ui-cor-texto, #ffffff);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-prop__cor-picker-oculto{position:absolute;opacity:0;pointer-events:none;width:0;height:0}.ui-prop__editor-linha-container{display:flex;align-items:center;gap:6px;width:100%;max-width:100%;min-width:0!important;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 0 0 8px;box-sizing:border-box;overflow:hidden;border:none;border-radius:0}.ui-prop__linha-amostra-svg{width:24px;height:10px;flex-shrink:0}.ui-prop__linha-amostra-svg line{stroke:var(--ui-cor-texto, #e1e1e6);stroke-width:1.5}.ui-prop__linha-select{flex:1 1 0px;min-width:0!important;width:0!important;max-width:100%;height:100%;background:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:0;font-size:11px;padding:0 20px 0 4px;outline:none;cursor:pointer;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-prop__linha-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__linha-select option{background-color:var(--ui-cor-fundo-elevado, #18181c);color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor-espessura-container{display:flex;align-items:center;gap:6px;width:100%;max-width:100%;min-width:0!important;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 0 0 8px;box-sizing:border-box;overflow:hidden;border:none;border-radius:0}.ui-prop__espessura-amostra-svg{width:20px;height:10px;flex-shrink:0}.ui-prop__espessura-amostra-svg line{stroke:var(--ui-cor-texto, #e1e1e6)}.ui-prop__espessura-select{flex:1 1 0px;min-width:0!important;width:0!important;max-width:100%;height:100%;background:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:0;font-size:11px;padding:0 20px 0 4px;outline:none;cursor:pointer;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-prop__espessura-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__espessura-select option{background-color:var(--ui-cor-fundo-elevado, #18181c);color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor-cor-cad-container{display:flex;align-items:center;gap:6px;width:100%;max-width:100%;min-width:0!important;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 0 0 8px;box-sizing:border-box;overflow:hidden;border:none;border-radius:0}.ui-prop__cor-cad-select{flex:1 1 0px;min-width:0!important;width:0!important;max-width:100%;height:100%;background:transparent;color:var(--ui-cor-texto, #ffffff);border:none;border-radius:0;font-size:11px;padding:0 20px 0 4px;outline:none;cursor:pointer;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23888899' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:8px 5px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-prop__cor-cad-select:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__cor-cad-select option{background-color:var(--ui-cor-fundo-elevado, #18181c);color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor-booleano{display:flex;align-items:center;gap:6px;width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);cursor:pointer;padding:0 8px;box-sizing:border-box;-webkit-user-select:none;user-select:none}.ui-prop__editor-booleano:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__checkbox-custom{width:13px;height:13px;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .25));border-radius:2px;background-color:var(--ui-cor-fundo, #0b0b0d);display:flex;align-items:center;justify-content:center;transition:all .15s ease}.ui-prop__checkbox-custom--marcado{background-color:var(--ui-cor-destaque, #00E08A);border-color:var(--ui-cor-destaque, #00E08A);color:#000}.ui-prop__booleano-rotulo{font-size:11px;color:var(--ui-cor-texto, #ffffff)}.ui-prop__btn-acao-inline{width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);padding:0 8px;background-color:transparent;border:none;border-radius:0;color:var(--ui-cor-texto, #ffffff);font-size:11px;font-weight:500;cursor:pointer;white-space:nowrap;text-align:left;transition:all .15s ease;box-sizing:border-box}.ui-prop__btn-acao-inline:hover{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 4%,transparent);color:var(--ui-cor-destaque, #00E08A)}.ui-prop__valor-readonly{display:flex;align-items:center;width:100%;height:100%;min-height:var(--ui-prop-altura-linha, 24px);font-size:11px;color:var(--ui-cor-texto-secundario, #777788);padding:0 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;box-sizing:border-box;-webkit-user-select:text;user-select:text}.ui-prop__valor-readonly--numero{justify-content:flex-end;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums}.ui-prop__unidade-sufixo{display:flex;align-items:center;font-size:10px;color:var(--ui-cor-texto-secundario, #777788);padding-right:8px;flex-shrink:0;-webkit-user-select:none;user-select:none}.ui-prop__vazio{padding:24px 16px;text-align:center;color:var(--ui-cor-texto-secundario, #888899);font-size:12px}.ui-prop__footer{display:flex;align-items:center;justify-content:space-between;padding:6px 10px;background-color:var(--ui-cor-fundo-elevado, #18181c);border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .1));flex-shrink:0}.ui-prop__link-ajuda{font-size:11px;color:var(--ui-cor-destaque, #00E08A);text-decoration:none;cursor:pointer}.ui-prop__link-ajuda:hover{text-decoration:underline}.ui-prop__footer-botoes{display:flex;gap:6px}.ui-prop__btn-aplicar{height:24px;padding:0 12px;background-color:var(--ui-cor-destaque, #00E08A);color:#000;border:none;border-radius:3px;font-size:11px;font-weight:600;cursor:pointer;transition:all .15s ease}.ui-prop__btn-aplicar:disabled{background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 10%,transparent);color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 30%,transparent);cursor:not-allowed}.ui-prop__btn-desfazer{height:24px;padding:0 8px;background:transparent;color:var(--ui-cor-texto-secundario, #888899);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:3px;font-size:11px;cursor:pointer;transition:all .15s ease}.ui-prop__btn-desfazer:hover:not(:disabled){background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08));color:var(--ui-cor-texto, #ffffff)}.ui-prop__btn-desfazer:disabled{opacity:.4;cursor:not-allowed}@media (max-width: 640px){:host{--ui-prop-altura-linha: 28px;font-size:13px}.ui-prop__btn-icone{min-width:28px;min-height:28px}.ui-prop__footer-botoes{gap:8px}.ui-prop__btn-aplicar,.ui-prop__btn-desfazer{height:30px;font-size:12px;padding:0 12px;touch-action:manipulation;-webkit-tap-highlight-color:transparent}.ui-prop__editor-input,.ui-prop__editor-select{touch-action:manipulation;font-size:14px}}`;
1891
+ function Et() {
1892
+ return `
1893
+ <style>${_t}</style>
1894
+ <div class="ui-prop__container" id="container">
1895
+ <!-- 0. Faixa Vertical da Coluna Estreita (visível quando colapsado) -->
1896
+ <div class="ui-prop__faixa-estreita" id="faixa-estreita" title="Clique para expandir painel">
1897
+ <span class="ui-prop__faixa-icone">
1898
+ <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
1899
+ <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
1900
+ <line x1="3" y1="9" x2="21" y2="9"></line>
1901
+ <line x1="9" y1="21" x2="9" y2="9"></line>
1902
+ </svg>
1903
+ </span>
1904
+ <button type="button" class="ui-prop__faixa-btn-expandir" id="btn-expandir-faixa" title="Expandir painel de propriedades">
1905
+ <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2">
1906
+ <polyline points="9 18 15 12 9 6"></polyline>
1907
+ <line x1="5" y1="5" x2="5" y2="19"></line>
1908
+ </svg>
1909
+ </button>
1910
+ <span class="ui-prop__faixa-texto">PROPRIEDADES</span>
1911
+ </div>
1912
+
1913
+ <!-- 1. Header Superior -->
1914
+ <header class="ui-prop__header" id="header">
1915
+ <div class="ui-prop__header-titulo">
1916
+ <span class="ui-prop__header-icone">
1917
+ <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
1918
+ <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
1919
+ <line x1="3" y1="9" x2="21" y2="9"></line>
1920
+ <line x1="9" y1="21" x2="9" y2="9"></line>
1921
+ </svg>
1922
+ </span>
1923
+ <span id="header-titulo-texto">Propriedades</span>
1924
+ </div>
1925
+ <div class="ui-prop__header-acoes">
1926
+ <button type="button" class="ui-prop__btn-icone" id="btn-flutuante" title="Desacoplar / Modo flutuante (CAD)" aria-label="Modo flutuante">
1927
+ <svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
1928
+ <rect x="3" y="3" width="14" height="14" rx="2"></rect>
1929
+ <polyline points="15 3 21 3 21 9"></polyline>
1930
+ <line x1="10" y1="14" x2="21" y2="3"></line>
1931
+ </svg>
1932
+ </button>
1933
+ <button type="button" class="ui-prop__btn-icone" id="btn-colapsar-horizontal" title="Recolher para coluna estreita" aria-label="Recolher para coluna estreita">
1934
+ <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
1935
+ <polyline points="11 17 6 12 11 7"></polyline>
1936
+ <line x1="18" y1="5" x2="18" y2="19"></line>
1937
+ </svg>
1938
+ </button>
1939
+ <button type="button" class="ui-prop__btn-icone" id="btn-densidade" title="Alternar compressão vertical" aria-label="Alternar densidade vertical">
1940
+ <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
1941
+ <polyline points="4 7 12 11 20 7"></polyline>
1942
+ <polyline points="4 17 12 13 20 17"></polyline>
1943
+ <line x1="4" y1="12" x2="20" y2="12"></line>
1944
+ </svg>
1945
+ </button>
1946
+ <button type="button" class="ui-prop__btn-icone" id="btn-expandir-tudo" title="Expandir/Recolher Tudo" aria-label="Expandir ou recolher tudo">
1947
+ <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
1948
+ <polyline points="7 13 12 18 17 13"></polyline>
1949
+ <polyline points="7 6 12 11 17 6"></polyline>
1950
+ </svg>
1951
+ </button>
1952
+ <button type="button" class="ui-prop__btn-icone" id="btn-fechar" title="Fechar" aria-label="Fechar" style="display: none;">
1953
+ ✕
1954
+ </button>
1955
+ </div>
1956
+ </header>
1957
+
1958
+ <!-- 2. Seletor de Tipo (AutoCAD / Revit) -->
1959
+ <div class="ui-prop__tipo-seletor-container" id="tipo-container" style="display: none;"></div>
1960
+
1961
+ <!-- 3. Busca Rápida de Propriedades -->
1962
+ <div class="ui-prop__filtro-container" id="filtro-container" style="display: none;">
1963
+ <svg class="ui-prop__filtro-icone" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
1964
+ <circle cx="11" cy="11" r="8"></circle>
1965
+ <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
1966
+ </svg>
1967
+ <input type="text" class="ui-prop__filtro-input" id="filtro-input" placeholder="Filtrar propriedades..." />
1968
+ </div>
1969
+
1970
+ <!-- 4. Corpo Rolável com Grade de Categorias -->
1971
+ <div class="ui-prop__corpo-wrapper" id="corpo-wrapper">
1972
+ <div class="ui-prop__splitter" id="splitter"></div>
1973
+ <div class="ui-prop__corpo" id="corpo">
1974
+ <div class="ui-prop__lista-categorias" id="lista-categorias"></div>
1975
+ </div>
1976
+ </div>
1977
+
1978
+ <!-- 5. Rodapé com Ações (Aplicar / Desfazer) -->
1979
+ <footer class="ui-prop__footer" id="footer" style="display: none;">
1980
+ <a class="ui-prop__link-ajuda" id="link-ajuda" href="#" role="button">Ajuda de propriedades</a>
1981
+ <div class="ui-prop__footer-botoes">
1982
+ <button type="button" class="ui-prop__btn-desfazer" id="btn-desfazer" disabled>Desfazer</button>
1983
+ <button type="button" class="ui-prop__btn-aplicar" id="btn-aplicar" disabled>Aplicar</button>
1984
+ </div>
1985
+ </footer>
1986
+
1987
+ <!-- 6. Grip para redimensionar no modo flutuante -->
1988
+ <div class="ui-prop__resizer-canto" id="resizer-canto" title="Redimensionar"></div>
1989
+ </div>
1990
+ `;
1991
+ }
1992
+ function O(r, t) {
1993
+ return r == null && t == null ? !0 : Object.is(r, t);
1994
+ }
1995
+ class yt {
1996
+ constructor(t) {
1997
+ b(this, "valoresOriginais", {});
1998
+ b(this, "valoresAtuais", {});
1999
+ this.ctx = t;
2000
+ }
2001
+ inicializarCategorias(t) {
2002
+ this.valoresOriginais = {}, this.valoresAtuais = {};
2003
+ const e = /* @__PURE__ */ new Set();
2004
+ t.forEach((i) => {
2005
+ (i.propriedades || []).forEach((o) => {
2006
+ e.has(o.id) && typeof console < "u" && console.warn(`[ui-tabela-propriedades] id de propriedade repetido: "${o.id}". Os valores são indexados por id e serão compartilhados.`), e.add(o.id), this.valoresOriginais[o.id] = o.valor, this.valoresAtuais[o.id] = o.valor;
2007
+ });
2008
+ }), this.ctx.onAtualizarBotoesFooter(!1);
2009
+ }
2010
+ /** Há alguma propriedade com valor diferente do original (último aplicar/carregar)? */
2011
+ get isDirty() {
2012
+ return Object.keys(this.valoresAtuais).some((t) => this.isModificada(t));
2013
+ }
2014
+ isModificada(t) {
2015
+ return !O(this.valoresAtuais[t], this.valoresOriginais[t]);
2016
+ }
2017
+ getValores() {
2018
+ return { ...this.valoresAtuais };
2019
+ }
2020
+ getValoresOriginais() {
2021
+ return { ...this.valoresOriginais };
2022
+ }
2023
+ setValores(t) {
2024
+ !t || typeof t != "object" || (Object.keys(t).forEach((e) => {
2025
+ this.valoresAtuais[e] = t[e], this.valoresOriginais[e] = t[e];
2026
+ }), this.ctx.onAtualizarBotoesFooter(this.isDirty));
2027
+ }
2028
+ obterValor(t) {
2029
+ return this.valoresAtuais[t];
2030
+ }
2031
+ /** Alteração programática: atualiza o editor na tela; não emite se o valor não mudou. */
2032
+ definirValor(t, e, i = !0) {
2033
+ const o = this.valoresAtuais[t];
2034
+ O(o, e) || (this.valoresAtuais[t] = e, this.aposAlterar(t), this.ctx.onAtualizarCampoVisual(t, e), i && this.emitirAlteracao(t, e, o, this.categoriaDe(t)));
2035
+ }
2036
+ /** Alteração feita pelo usuário num editor. Em modo manual só emite no Aplicar. */
2037
+ registrarAlteracao(t, e, i) {
2038
+ const o = this.valoresAtuais[e];
2039
+ O(o, i) || (this.valoresAtuais[e] = i, this.aposAlterar(e), this.ctx.isModoManual() || this.emitirAlteracao(e, i, o, t));
2040
+ }
2041
+ aplicar() {
2042
+ var e;
2043
+ if (!this.isDirty) return;
2044
+ this.valoresOriginais = { ...this.valoresAtuais }, this.ctx.onAtualizarBotoesFooter(!1);
2045
+ const t = (e = this.ctx.hostElement.shadowRoot) == null ? void 0 : e.querySelectorAll(".ui-prop__linha--modificada");
2046
+ t == null || t.forEach((i) => i.classList.remove("ui-prop__linha--modificada")), this.ctx.hostElement.dispatchEvent(
2047
+ new CustomEvent("ui-aplicar", {
2048
+ bubbles: !0,
2049
+ composed: !0,
2050
+ detail: { valores: { ...this.valoresAtuais } }
2051
+ })
2052
+ );
2053
+ }
2054
+ desfazer() {
2055
+ this.isDirty && (this.valoresAtuais = { ...this.valoresOriginais }, this.ctx.onAtualizarBotoesFooter(!1), this.ctx.onRenderCategorias(), this.ctx.hostElement.dispatchEvent(
2056
+ new CustomEvent("ui-desfazer", {
2057
+ bubbles: !0,
2058
+ composed: !0,
2059
+ detail: { valores: { ...this.valoresAtuais } }
2060
+ })
2061
+ ));
2062
+ }
2063
+ /** Marca/desmarca a linha e recalcula os botões do rodapé (voltar ao original limpa o estado). */
2064
+ aposAlterar(t) {
2065
+ const e = de(this.ctx.hostElement.shadowRoot, t);
2066
+ e == null || e.classList.toggle("ui-prop__linha--modificada", this.isModificada(t)), this.ctx.onAtualizarBotoesFooter(this.isDirty);
2067
+ }
2068
+ categoriaDe(t) {
2069
+ var e;
2070
+ for (const i of this.ctx.getCategorias())
2071
+ if ((e = i.propriedades) != null && e.some((o) => o.id === t)) return i.id;
2072
+ return "";
2073
+ }
2074
+ emitirAlteracao(t, e, i, o = "") {
2075
+ this.ctx.hostElement.dispatchEvent(
2076
+ new CustomEvent("ui-propriedade-alterada", {
2077
+ bubbles: !0,
2078
+ composed: !0,
2079
+ detail: {
2080
+ id: t,
2081
+ categoriaId: o,
2082
+ valor: e,
2083
+ valorAnterior: i,
2084
+ todosValores: { ...this.valoresAtuais }
2085
+ }
2086
+ })
2087
+ );
2088
+ }
2089
+ }
2090
+ function wt(r) {
2091
+ const { listaContainer: t, categorias: e, termoBusca: i, onToggleCategoria: o, linhaCtx: a } = r;
2092
+ if (t.innerHTML = "", !e || e.length === 0) {
2093
+ const s = document.createElement("div");
2094
+ s.className = "ui-prop__vazio", s.textContent = "Nenhuma propriedade disponível.", t.appendChild(s);
2095
+ return;
2096
+ }
2097
+ const n = document.createDocumentFragment();
2098
+ e.forEach((s) => {
2099
+ const d = (s.propriedades || []).filter((g) => i ? g.rotulo.toLowerCase().includes(i) || String(g.id).toLowerCase().includes(i) : !0);
2100
+ if (i && d.length === 0)
2101
+ return;
2102
+ const c = !!i || s.aberto !== !1, l = document.createElement("div");
2103
+ l.className = `ui-prop__categoria ${c ? "ui-prop__categoria--aberta" : ""}`, l.setAttribute("data-cat-id", s.id);
2104
+ const u = document.createElement("div");
2105
+ u.className = "ui-prop__categoria-header", u.setAttribute("role", "button"), u.tabIndex = 0, u.setAttribute("aria-expanded", String(c));
2106
+ const p = document.createElement("div");
2107
+ p.className = "ui-prop__categoria-titulo-bloco";
2108
+ const h = document.createElement("span");
2109
+ h.className = "ui-prop__categoria-seta", h.textContent = "▶";
2110
+ const m = document.createElement("span");
2111
+ m.textContent = s.titulo, p.appendChild(h), p.appendChild(m);
2112
+ const x = document.createElement("span");
2113
+ x.className = "ui-prop__categoria-contador", x.textContent = String(d.length), u.appendChild(p), u.appendChild(x), u.addEventListener("click", () => o(s.id)), u.addEventListener("keydown", (g) => {
2114
+ (g.key === "Enter" || g.key === " ") && (g.preventDefault(), o(s.id));
2115
+ });
2116
+ const f = document.createElement("div");
2117
+ f.className = "ui-prop__categoria-conteudo", d.forEach((g) => {
2118
+ const _ = Ct(s.id, g, a);
2119
+ f.appendChild(_);
2120
+ }), l.appendChild(u), l.appendChild(f), n.appendChild(l);
2121
+ }), t.appendChild(n);
2122
+ }
2123
+ function Ct(r, t, e) {
2124
+ const i = document.createElement("div");
2125
+ i.className = "ui-prop__linha", i.setAttribute("data-prop-id", t.id);
2126
+ const o = e.valoresAtuais[t.id] !== void 0 ? e.valoresAtuais[t.id] : t.valor, a = t.id in e.valoresOriginais ? e.valoresOriginais[t.id] : t.valor;
2127
+ O(o, a) || i.classList.add("ui-prop__linha--modificada"), i.addEventListener("dblclick", () => {
2128
+ const l = i.querySelector(
2129
+ 'input:not([type="color"]):not(.ui-prop__cor-picker-oculto), select, .ui-prop__btn-acao-inline'
2130
+ );
2131
+ l && (l.focus(), l instanceof HTMLInputElement && l.select());
2132
+ });
2133
+ const n = document.createElement("div");
2134
+ n.className = "ui-prop__col-rotulo", n.title = t.rotulo;
2135
+ const s = document.createElement("span");
2136
+ s.textContent = t.rotulo, n.appendChild(s), t.tipo === "numero" && !t.somenteLeitura && At(n, r, t, e);
2137
+ const d = document.createElement("div");
2138
+ d.className = "ui-prop__col-valor";
2139
+ const c = gt(r, t, o, e.editorCtx);
2140
+ if (d.appendChild(c), t.unidade) {
2141
+ const l = document.createElement("span");
2142
+ l.className = "ui-prop__unidade-sufixo", l.textContent = t.unidade, d.appendChild(l);
2143
+ }
2144
+ return i.appendChild(n), i.appendChild(d), i;
2145
+ }
2146
+ function At(r, t, e, i) {
2147
+ r.classList.add("ui-prop__col-rotulo--scrub"), r.title = `${e.rotulo} (Arraste para ajustar, duplo-clique para editar)`;
2148
+ let o = 0, a = 0, n = !1;
2149
+ r.addEventListener("pointerdown", (s) => {
2150
+ if (s.button !== 0) return;
2151
+ o = s.clientX;
2152
+ const d = i.editorCtx.obterValorAtual(e.id);
2153
+ a = typeof d == "number" ? d : parseFloat(String(d || 0)) || 0, n = !1;
2154
+ try {
2155
+ r.setPointerCapture(s.pointerId);
2156
+ } catch {
2157
+ }
2158
+ r.classList.add("ui-prop__col-rotulo--arrastando");
2159
+ const c = (u) => {
2160
+ const p = u.clientX - o;
2161
+ if (Math.abs(p) > 2 && (n = !0), n) {
2162
+ let h = 1;
2163
+ u.shiftKey ? h = 0.1 : (u.ctrlKey || u.metaKey) && (h = 10);
2164
+ const m = e.casasDecimais !== void 0 ? e.casasDecimais : 2, x = Math.pow(10, -Math.min(m, 2));
2165
+ let f = a + p * x * h;
2166
+ e.casasDecimais !== void 0 ? f = Number(f.toFixed(e.casasDecimais)) : f = Math.round(f * 100) / 100, i.editorCtx.registrarAlteracao(t, e.id, f), i.onAtualizarCampoVisual(e.id, f);
2167
+ }
2168
+ }, l = (u) => {
2169
+ r.classList.remove("ui-prop__col-rotulo--arrastando");
2170
+ try {
2171
+ r.hasPointerCapture(u.pointerId) && r.releasePointerCapture(u.pointerId);
2172
+ } catch {
2173
+ }
2174
+ r.removeEventListener("pointermove", c), r.removeEventListener("pointerup", l), r.removeEventListener("pointercancel", l);
2175
+ };
2176
+ r.addEventListener("pointermove", c), r.addEventListener("pointerup", l), r.addEventListener("pointercancel", l);
2177
+ });
2178
+ }
2179
+ const re = 300, kt = 480, B = /* @__PURE__ */ new WeakMap();
2180
+ function zt(r) {
2181
+ var i, o, a;
2182
+ const t = r.hasAttribute("flutuante"), e = r.style;
2183
+ if (t) {
2184
+ const n = B.get(r) ?? { acoplado: { width: "", height: "" } };
2185
+ n.flutuante = { left: e.left, top: e.top, width: e.width, height: e.height }, B.set(r, n), r.removeAttribute("flutuante"), e.left = "", e.top = "", e.right = "", e.bottom = "", e.position = "", e.zIndex = "", e.width = n.acoplado.width, e.height = n.acoplado.height;
2186
+ } else {
2187
+ const n = {
2188
+ acoplado: { width: e.width, height: e.height },
2189
+ flutuante: (i = B.get(r)) == null ? void 0 : i.flutuante
2190
+ };
2191
+ if (B.set(r, n), r.setAttribute("flutuante", ""), e.position = "fixed", (o = n.flutuante) != null && o.left || (a = n.flutuante) != null && a.top)
2192
+ e.left = n.flutuante.left, e.top = n.flutuante.top, e.width = n.flutuante.width, e.height = n.flutuante.height;
2193
+ else if (!e.left && !e.top) {
2194
+ const s = Math.max(
2195
+ 20,
2196
+ (typeof window < "u" ? window.innerWidth : 1024) - re - 30
2197
+ );
2198
+ e.left = `${s}px`, e.top = "70px", e.width = `${re}px`, e.height = `${kt}px`;
2199
+ }
2200
+ }
2201
+ return !t;
2202
+ }
2203
+ function St(r, t, e) {
2204
+ const i = t.getElementById("header");
2205
+ if (i) {
2206
+ let a = null, n = 0, s = 0, d = 0, c = 0;
2207
+ const l = (p) => {
2208
+ if (a === null) return;
2209
+ const h = p.clientX - n, m = p.clientY - s;
2210
+ let x = d + h, f = c + m;
2211
+ const g = Math.max(0, (typeof window < "u" ? window.innerWidth : 1024) - r.offsetWidth), _ = Math.max(0, (typeof window < "u" ? window.innerHeight : 768) - 30);
2212
+ x = Math.max(0, Math.min(g, x)), f = Math.max(0, Math.min(_, f)), r.style.left = `${x}px`, r.style.top = `${f}px`, r.style.right = "auto", r.style.bottom = "auto";
2213
+ }, u = (p) => {
2214
+ if (a !== null) {
2215
+ try {
2216
+ i.releasePointerCapture(p.pointerId);
2217
+ } catch {
2218
+ }
2219
+ i.removeEventListener("pointermove", l), i.removeEventListener("pointerup", u), i.removeEventListener("pointercancel", u), a = null, r.classList.remove("arrastando"), r.dispatchEvent(new CustomEvent("ui-mover", {
2220
+ bubbles: !0,
2221
+ composed: !0,
2222
+ detail: { left: r.style.left, top: r.style.top }
2223
+ }));
2224
+ }
2225
+ };
2226
+ e.add(i, "pointerdown", (p) => {
2227
+ if (!r.hasAttribute("flutuante") || p.target.closest("button, input, select, a") || p.button !== 0) return;
2228
+ p.preventDefault(), a = p.pointerId, n = p.clientX, s = p.clientY;
2229
+ const m = r.getBoundingClientRect();
2230
+ d = m.left, c = m.top, r.classList.add("arrastando");
2231
+ try {
2232
+ i.setPointerCapture(p.pointerId);
2233
+ } catch {
2234
+ }
2235
+ i.addEventListener("pointermove", l), i.addEventListener("pointerup", u), i.addEventListener("pointercancel", u);
2236
+ });
2237
+ }
2238
+ const o = t.getElementById("resizer-canto");
2239
+ if (o) {
2240
+ let a = null, n = 0, s = 0, d = 0, c = 0;
2241
+ const l = (p) => {
2242
+ if (a === null) return;
2243
+ const h = Math.max(200, n + (p.clientX - d)), m = Math.max(180, s + (p.clientY - c));
2244
+ r.style.width = `${h}px`, r.style.height = `${m}px`;
2245
+ }, u = (p) => {
2246
+ if (a !== null) {
2247
+ try {
2248
+ o.releasePointerCapture(p.pointerId);
2249
+ } catch {
2250
+ }
2251
+ o.removeEventListener("pointermove", l), o.removeEventListener("pointerup", u), o.removeEventListener("pointercancel", u), a = null, r.dispatchEvent(new CustomEvent("ui-redimensionar", {
2252
+ bubbles: !0,
2253
+ composed: !0,
2254
+ detail: { width: r.style.width, height: r.style.height }
2255
+ }));
2256
+ }
2257
+ };
2258
+ e.add(o, "pointerdown", (p) => {
2259
+ if (!r.hasAttribute("flutuante") || p.button !== 0) return;
2260
+ p.preventDefault(), p.stopPropagation(), a = p.pointerId, d = p.clientX, c = p.clientY;
2261
+ const h = r.getBoundingClientRect();
2262
+ n = h.width, s = h.height;
2263
+ try {
2264
+ o.setPointerCapture(p.pointerId);
2265
+ } catch {
2266
+ }
2267
+ o.addEventListener("pointermove", l), o.addEventListener("pointerup", u), o.addEventListener("pointercancel", u);
2268
+ });
2269
+ }
2270
+ }
2271
+ function Lt(r) {
2272
+ return r === "compacta" ? "ultracompacta" : r === "ultracompacta" ? "padrao" : "compacta";
2273
+ }
2274
+ function Mt(r) {
2275
+ const {
2276
+ shadow: t,
2277
+ listeners: e,
2278
+ host: i,
2279
+ onToggleExpandirTodas: o,
2280
+ onFiltrar: a,
2281
+ onAplicar: n,
2282
+ onDesfazer: s,
2283
+ onAlternarDensidade: d,
2284
+ onAlternarFlutuante: c,
2285
+ onAlternarColapsoHorizontal: l
2286
+ } = r, u = t.getElementById("btn-flutuante");
2287
+ u && c && e.add(u, "click", c);
2288
+ const p = t.getElementById("btn-colapsar-horizontal");
2289
+ p && l && e.add(p, "click", l);
2290
+ const h = t.getElementById("faixa-estreita");
2291
+ h && l && e.add(h, "click", l);
2292
+ const m = t.getElementById("btn-expandir-faixa");
2293
+ m && l && e.add(m, "click", (v) => {
2294
+ v.stopPropagation(), l();
2295
+ });
2296
+ const x = t.getElementById("btn-densidade");
2297
+ x && d && e.add(x, "click", d);
2298
+ const f = t.getElementById("btn-expandir-tudo");
2299
+ f && e.add(f, "click", o);
2300
+ const g = t.getElementById("btn-fechar");
2301
+ g && e.add(g, "click", () => {
2302
+ i.dispatchEvent(new CustomEvent("ui-fechar", { bubbles: !0, composed: !0 }));
2303
+ });
2304
+ const _ = t.getElementById("filtro-input");
2305
+ _ && e.add(_, "input", () => {
2306
+ const v = (_.value || "").trim().toLowerCase();
2307
+ a(v);
2308
+ });
2309
+ const y = t.getElementById("btn-aplicar");
2310
+ y && e.add(y, "click", n);
2311
+ const A = t.getElementById("btn-desfazer");
2312
+ A && e.add(A, "click", s);
2313
+ const w = t.getElementById("link-ajuda");
2314
+ w && e.add(w, "click", (v) => {
2315
+ v.preventDefault(), i.dispatchEvent(new CustomEvent("ui-ajuda", { bubbles: !0, composed: !0 }));
2316
+ });
2317
+ }
2318
+ function M(r, t) {
2319
+ const e = r.getElementById("header-titulo-texto");
2320
+ e && (e.textContent = t.getAttribute("titulo") || "Propriedades");
2321
+ const i = r.getElementById("btn-fechar");
2322
+ i && (i.style.display = t.hasAttribute("fechavel") ? "inline-flex" : "none");
2323
+ const o = r.getElementById("btn-flutuante");
2324
+ if (o) {
2325
+ const c = t.hasAttribute("flutuante");
2326
+ o.title = c ? "Acoplar painel (Dock)" : "Desacoplar / Modo flutuante (CAD)", o.classList.toggle("ui-prop__btn-icone--ativo", c);
2327
+ }
2328
+ const a = r.getElementById("btn-colapsar-horizontal");
2329
+ if (a) {
2330
+ const c = t.hasAttribute("colapsado");
2331
+ a.title = c ? "Expandir painel" : "Recolher para coluna estreita", a.classList.toggle("ui-prop__btn-icone--ativo", c);
2332
+ }
2333
+ const n = r.getElementById("btn-densidade");
2334
+ if (n) {
2335
+ const c = t.getAttribute("densidade") || "padrão";
2336
+ n.title = `Compressão vertical: ${c} (clique para alternar)`;
2337
+ }
2338
+ const s = r.getElementById("filtro-container");
2339
+ s && (s.style.display = t.hasAttribute("filtro") ? "flex" : "none");
2340
+ const d = r.getElementById("footer");
2341
+ d && (d.style.display = t.getAttribute("modo-aplicar") === "manual" ? "flex" : "none");
2342
+ }
2343
+ class Nt extends oe {
2344
+ constructor() {
2345
+ super();
2346
+ b(this, "shadow");
2347
+ b(this, "listeners", new I());
2348
+ b(this, "splitterListeners", new I());
2349
+ b(this, "controladorSplitter");
2350
+ b(this, "gerenciadorValores");
2351
+ b(this, "_categorias", []);
2352
+ b(this, "_tipos", []);
2353
+ b(this, "_tipoSelecionadoId", "");
2354
+ b(this, "_termoBusca", "");
2355
+ b(this, "_larguraRotuloPorcentagem", 45);
2356
+ b(this, "tipoContainerElement");
2357
+ b(this, "corpoElement");
2358
+ b(this, "btnAplicarElement");
2359
+ b(this, "btnDesfazerElement");
2360
+ b(this, "splitterElement");
2361
+ this.shadow = this.attachShadow({ mode: "open" }), this.shadow.innerHTML = Et(), this.tipoContainerElement = this.shadow.getElementById("tipo-container"), this.corpoElement = this.shadow.getElementById("corpo"), this.btnAplicarElement = this.shadow.getElementById("btn-aplicar"), this.btnDesfazerElement = this.shadow.getElementById("btn-desfazer"), this.splitterElement = this.shadow.getElementById("splitter"), this.gerenciadorValores = new yt({
2362
+ hostElement: this,
2363
+ getCategorias: () => this._categorias,
2364
+ onAtualizarBotoesFooter: (e) => {
2365
+ this.btnAplicarElement.disabled = !e, this.btnDesfazerElement.disabled = !e;
2366
+ },
2367
+ onAtualizarCampoVisual: (e, i) => te(this.shadow, e, i),
2368
+ onRenderCategorias: () => this.renderCategorias(),
2369
+ isModoManual: () => this.getAttribute("modo-aplicar") === "manual"
2370
+ }), this.controladorSplitter = vt({
2371
+ hostElement: this,
2372
+ corpoElement: this.corpoElement,
2373
+ splitterElement: this.splitterElement,
2374
+ splitterListeners: this.splitterListeners,
2375
+ onLarguraAlterada: (e) => {
2376
+ this._larguraRotuloPorcentagem = e;
2377
+ }
2378
+ });
2379
+ }
2380
+ static get observedAttributes() {
2381
+ return [
2382
+ "titulo",
2383
+ "estilo-visual",
2384
+ "modo-aplicar",
2385
+ "filtro",
2386
+ "densidade",
2387
+ "largura-rotulo",
2388
+ "fechavel",
2389
+ "colapsado",
2390
+ "flutuante"
2391
+ ];
2392
+ }
2393
+ get larguraRotuloPorcentagem() {
2394
+ return this._larguraRotuloPorcentagem;
2395
+ }
2396
+ connectedCallback() {
2397
+ this.listeners.cleanup(), Mt({
2398
+ shadow: this.shadow,
2399
+ listeners: this.listeners,
2400
+ host: this,
2401
+ onToggleExpandirTodas: () => this.toggleExpandirTodas(),
2402
+ onFiltrar: (e) => {
2403
+ this._termoBusca = e, this.renderCategorias();
2404
+ },
2405
+ onAplicar: () => this.aplicar(),
2406
+ onDesfazer: () => this.desfazer(),
2407
+ onAlternarDensidade: () => this.alternarDensidade(),
2408
+ onAlternarFlutuante: () => this.alternarFlutuante(),
2409
+ onAlternarColapsoHorizontal: () => this.alternarColapsoHorizontal()
2410
+ }), St(this, this.shadow, this.listeners), this.controladorSplitter.init(), this.syncState();
2411
+ }
2412
+ disconnectedCallback() {
2413
+ this.listeners.cleanup(), this.splitterListeners.cleanup();
2414
+ }
2415
+ /**
2416
+ * Cada atributo atualiza só o que depende dele: redesenhar todas as linhas (ex.: ao trocar o
2417
+ * `titulo`) tiraria o foco de um campo em edição.
2418
+ */
2419
+ attributeChangedCallback(e, i, o) {
2420
+ if (i !== o)
2421
+ switch (e) {
2422
+ case "largura-rotulo": {
2423
+ const a = parseFloat(o ?? "");
2424
+ isNaN(a) || (this._larguraRotuloPorcentagem = this.controladorSplitter.definirLarguraRotulo(a));
2425
+ return;
2426
+ }
2427
+ case "estilo-visual":
2428
+ this.renderSeletorTipos();
2429
+ return;
2430
+ case "filtro":
2431
+ if (M(this.shadow, this), o === null && this._termoBusca) {
2432
+ this._termoBusca = "";
2433
+ const a = this.shadow.getElementById("filtro-input");
2434
+ a && (a.value = ""), this.renderCategorias();
2435
+ }
2436
+ return;
2437
+ default:
2438
+ M(this.shadow, this);
2439
+ }
2440
+ }
2441
+ get categorias() {
2442
+ return this._categorias;
2443
+ }
2444
+ set categorias(e) {
2445
+ this._categorias = Array.isArray(e) ? e : [], this.gerenciadorValores.inicializarCategorias(this._categorias), this.renderCategorias();
2446
+ }
2447
+ get tipos() {
2448
+ return this._tipos;
2449
+ }
2450
+ set tipos(e) {
2451
+ this._tipos = Array.isArray(e) ? e : [], this.renderSeletorTipos();
2452
+ }
2453
+ get tipoSelecionado() {
2454
+ return this._tipoSelecionadoId;
2455
+ }
2456
+ set tipoSelecionado(e) {
2457
+ this._tipoSelecionadoId = e, this.renderSeletorTipos();
2458
+ }
2459
+ get valores() {
2460
+ return this.gerenciadorValores.getValores();
2461
+ }
2462
+ set valores(e) {
2463
+ this.gerenciadorValores.setValores(e), this.renderCategorias();
2464
+ }
2465
+ get isDirty() {
2466
+ return this.gerenciadorValores.isDirty;
2467
+ }
2468
+ get dirty() {
2469
+ return this.gerenciadorValores.isDirty;
2470
+ }
2471
+ obterValor(e) {
2472
+ return this.gerenciadorValores.obterValor(e);
2473
+ }
2474
+ definirValor(e, i, o = !0) {
2475
+ this.gerenciadorValores.definirValor(e, i, o);
2476
+ }
2477
+ aplicar() {
2478
+ this.gerenciadorValores.aplicar();
2479
+ }
2480
+ desfazer() {
2481
+ this.gerenciadorValores.desfazer();
2482
+ }
2483
+ expandirTudo() {
2484
+ it(this.shadow, this._categorias);
2485
+ }
2486
+ colapsarTudo() {
2487
+ ot(this.shadow, this._categorias);
2488
+ }
2489
+ toggleCategoria(e) {
2490
+ at(this.shadow, this, this._categorias, e);
2491
+ }
2492
+ get densidade() {
2493
+ return this.getAttribute("densidade") || "padrao";
2494
+ }
2495
+ set densidade(e) {
2496
+ !e || e === "padrao" ? this.removeAttribute("densidade") : this.setAttribute("densidade", e);
2497
+ }
2498
+ alternarDensidade() {
2499
+ const e = Lt(this.getAttribute("densidade") || "padrao");
2500
+ return e === "padrao" ? this.removeAttribute("densidade") : this.setAttribute("densidade", e), this.dispatchEvent(
2501
+ new CustomEvent("ui-densidade-alterada", {
2502
+ bubbles: !0,
2503
+ composed: !0,
2504
+ detail: { densidade: e }
2505
+ })
2506
+ ), M(this.shadow, this), e;
2507
+ }
2508
+ get flutuante() {
2509
+ return this.hasAttribute("flutuante");
2510
+ }
2511
+ set flutuante(e) {
2512
+ !!e !== this.hasAttribute("flutuante") && this.alternarFlutuante();
2513
+ }
2514
+ get colapsado() {
2515
+ return this.hasAttribute("colapsado");
2516
+ }
2517
+ set colapsado(e) {
2518
+ !!e !== this.hasAttribute("colapsado") && this.alternarColapsoHorizontal();
2519
+ }
2520
+ alternarFlutuante() {
2521
+ const e = zt(this);
2522
+ return M(this.shadow, this), this.dispatchEvent(new CustomEvent("ui-flutuante-alterado", {
2523
+ bubbles: !0,
2524
+ composed: !0,
2525
+ detail: {
2526
+ flutuante: e,
2527
+ left: this.style.left,
2528
+ top: this.style.top,
2529
+ width: this.style.width,
2530
+ height: this.style.height
2531
+ }
2532
+ })), e;
2533
+ }
2534
+ alternarColapsoHorizontal() {
2535
+ const e = this.hasAttribute("colapsado");
2536
+ e ? this.removeAttribute("colapsado") : this.setAttribute("colapsado", "");
2537
+ const i = !e;
2538
+ return M(this.shadow, this), this.dispatchEvent(new CustomEvent("ui-colapso-horizontal", {
2539
+ bubbles: !0,
2540
+ composed: !0,
2541
+ detail: { colapsado: i }
2542
+ })), i;
2543
+ }
2544
+ syncState() {
2545
+ M(this.shadow, this);
2546
+ const e = this.getAttribute("largura-rotulo");
2547
+ if (e) {
2548
+ const i = parseFloat(e);
2549
+ isNaN(i) || (this._larguraRotuloPorcentagem = this.controladorSplitter.definirLarguraRotulo(i));
2550
+ }
2551
+ this.renderSeletorTipos(), this.renderCategorias();
2552
+ }
2553
+ toggleExpandirTodas() {
2554
+ this._categorias.some((i) => i.aberto === !1) ? this.expandirTudo() : this.colapsarTudo();
2555
+ }
2556
+ renderSeletorTipos() {
2557
+ xt({
2558
+ tipoContainerElement: this.tipoContainerElement,
2559
+ tipos: this._tipos,
2560
+ tipoSelecionadoId: this._tipoSelecionadoId,
2561
+ estiloVisual: this.getAttribute("estilo-visual") || "autocad",
2562
+ onSelecionarTipo: (e) => {
2563
+ this._tipoSelecionadoId = e, this.renderSeletorTipos();
2564
+ const i = this._tipos.find((o) => String(o.id) === String(e));
2565
+ this.dispatchEvent(new CustomEvent("ui-tipo-alterado", { bubbles: !0, composed: !0, detail: { id: e, tipo: i } }));
2566
+ },
2567
+ onEditarTipo: (e) => this.dispatchEvent(new CustomEvent("ui-editar-tipo-clique", { bubbles: !0, composed: !0, detail: { tipo: e } })),
2568
+ onQuickSelect: (e) => this.dispatchEvent(new CustomEvent("ui-quick-select", { bubbles: !0, composed: !0, detail: { tipo: e } })),
2569
+ onSelectObjects: (e) => this.dispatchEvent(new CustomEvent("ui-selecionar-objetos", { bubbles: !0, composed: !0, detail: { tipo: e } })),
2570
+ onCalculadora: (e) => this.dispatchEvent(new CustomEvent("ui-calculadora", { bubbles: !0, composed: !0, detail: { tipo: e } }))
2571
+ });
2572
+ }
2573
+ renderCategorias() {
2574
+ const e = this.shadow.getElementById("lista-categorias");
2575
+ e && wt({
2576
+ listaContainer: e,
2577
+ categorias: this._categorias,
2578
+ termoBusca: this._termoBusca,
2579
+ onToggleCategoria: (i) => this.toggleCategoria(i),
2580
+ linhaCtx: {
2581
+ valoresAtuais: this.gerenciadorValores.getValores(),
2582
+ valoresOriginais: this.gerenciadorValores.getValoresOriginais(),
2583
+ onAtualizarCampoVisual: (i, o) => te(this.shadow, i, o),
2584
+ editorCtx: {
2585
+ obterValorAtual: (i) => this.gerenciadorValores.obterValor(i),
2586
+ registrarAlteracao: (i, o, a) => {
2587
+ this.gerenciadorValores.registrarAlteracao(i, o, a);
2588
+ },
2589
+ focarProximoEditor: (i) => rt(this.shadow, i),
2590
+ despacharEventoAcao: (i, o) => {
2591
+ this.dispatchEvent(
2592
+ new CustomEvent("ui-acao-clique", {
2593
+ bubbles: !0,
2594
+ composed: !0,
2595
+ detail: { id: i.id, categoriaId: o, propriedade: i }
2596
+ })
2597
+ );
2598
+ }
2599
+ }
2600
+ }
2601
+ });
2602
+ }
2603
+ }
2604
+ ie("ui-tabela-propriedades", Nt);
2605
+ export {
2606
+ Te as $,
2607
+ Ct as A,
2608
+ Ve as B,
2609
+ He as C,
2610
+ Ie as D,
2611
+ Fe as E,
2612
+ Oe as F,
2613
+ yt as G,
2614
+ it as H,
2615
+ rt as I,
2616
+ ae as J,
2617
+ ne as K,
2618
+ K as L,
2619
+ se as M,
2620
+ qe as N,
2621
+ Re as O,
2622
+ Y as P,
2623
+ $ as Q,
2624
+ _e as R,
2625
+ Se as S,
2626
+ ke as T,
2627
+ Je as U,
2628
+ V,
2629
+ $e as W,
2630
+ Lt as X,
2631
+ De as Y,
2632
+ k as Z,
2633
+ wt as _,
2634
+ ge as a,
2635
+ Le as a0,
2636
+ xt as a1,
2637
+ le as a2,
2638
+ M as a3,
2639
+ z as a4,
2640
+ je as a5,
2641
+ O as a6,
2642
+ Ee as b,
2643
+ Nt as c,
2644
+ Pe as d,
2645
+ at as e,
2646
+ ye as f,
2647
+ zt as g,
2648
+ Ae as h,
2649
+ te as i,
2650
+ ee as j,
2651
+ de as k,
2652
+ ot as l,
2653
+ St as m,
2654
+ Mt as n,
2655
+ vt as o,
2656
+ dt as p,
2657
+ st as q,
2658
+ bt as r,
2659
+ ft as s,
2660
+ pt as t,
2661
+ ht as u,
2662
+ ct as v,
2663
+ nt as w,
2664
+ lt as x,
2665
+ ut as y,
2666
+ gt as z
2667
+ };