@thibezer/ui-components-kit 2.24.1 → 2.24.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/CHANGELOG.md +61 -1
  2. package/dist/botao.cjs +12 -1
  3. package/dist/botao.js +162 -3
  4. package/dist/camadas.cjs +311 -1
  5. package/dist/camadas.js +3244 -148
  6. package/dist/campo-texto.cjs +16 -1
  7. package/dist/campo-texto.js +308 -7
  8. package/dist/canvas.cjs +22 -22
  9. package/dist/canvas.js +230 -233
  10. package/dist/card.cjs +20 -1
  11. package/dist/card.js +145 -2
  12. package/dist/components/ui-canvas-prancha/index.d.ts +1 -1
  13. package/dist/components/ui-canvas-prancha/prancha-teclado.d.ts +18 -0
  14. package/dist/components/ui-canvas-prancha/ui-canvas-prancha-base.d.ts +4 -0
  15. package/dist/components/ui-editor-prancha/editor-modos.d.ts +10 -0
  16. package/dist/components/ui-editor-prancha/editor-tipos.d.ts +4 -0
  17. package/dist/components/ui-editor-prancha/index.d.ts +1 -0
  18. package/dist/components/ui-editor-prancha/ui-editor-prancha.d.ts +39 -6
  19. package/dist/core.cjs +1 -1
  20. package/dist/core.js +44 -55
  21. package/dist/{cores-utils-BrdynxRd.js → cores-utils-DMyqWvZh.js} +2 -2
  22. package/dist/cores.cjs +32 -1
  23. package/dist/cores.js +300 -13
  24. package/dist/custom-elements.json +1712 -1205
  25. package/dist/data.cjs +28 -1
  26. package/dist/data.js +286 -99
  27. package/dist/{feature_caixa-2Sxv3tGa.js → feature_caixa-BVc5LenS.js} +42 -42
  28. package/dist/{feature_desenho-BVHivWIB.js → feature_desenho-CC8Mp5Gp.js} +2 -2
  29. package/dist/feedback.cjs +52 -1
  30. package/dist/feedback.js +655 -25
  31. package/dist/forms.cjs +66 -1
  32. package/dist/forms.js +1216 -39
  33. package/dist/{geometria-px-DUs5FgLE.js → geometria-px-DHMPUsxC.js} +47 -47
  34. package/dist/index.cjs +67 -1
  35. package/dist/index.js +1476 -274
  36. package/dist/kit-base-CGqj9aiD.cjs +2 -0
  37. package/dist/kit-base-_THn4w3u.js +1079 -0
  38. package/dist/mapa.cjs +5 -5
  39. package/dist/mapa.js +16 -17
  40. package/dist/modal.cjs +18 -1
  41. package/dist/modal.js +235 -29
  42. package/dist/motor.js +49 -49
  43. package/dist/prancha-nucleo.cjs +3 -1
  44. package/dist/prancha-nucleo.js +3120 -277
  45. package/dist/prancha.cjs +38 -1
  46. package/dist/prancha.js +3233 -228
  47. package/dist/register.cjs +1 -1
  48. package/dist/register.js +3 -20
  49. package/dist/seletor-mapa-base.cjs +13 -13
  50. package/dist/seletor-mapa-base.js +3 -5
  51. package/dist/tabela.cjs +142 -1
  52. package/dist/tabela.js +3773 -92
  53. package/dist/tipos-elementos.d.ts +5 -1
  54. package/dist/tipos-vue.d.ts +4 -1
  55. package/dist/tools.cjs +16 -1
  56. package/dist/tools.js +1564 -26
  57. package/dist/ui-seletor-cor-BGw8SBPm.cjs +83 -0
  58. package/dist/{ui-seletor-cor-Cd8jkzXG.js → ui-seletor-cor-B_twSm-V.js} +8 -9
  59. package/dist/utils-ClVgqVyJ.cjs +1 -0
  60. package/dist/utils-DrHoxxmf.js +83 -0
  61. package/package.json +43 -2
  62. package/dist/acessibilidade-CSzX-DkG.cjs +0 -1
  63. package/dist/acessibilidade-CUlSXc2X.js +0 -38
  64. package/dist/altura-controle-ukMRPckR.cjs +0 -1
  65. package/dist/altura-controle-vxQiXG4q.js +0 -62
  66. package/dist/alvo-digitavel-CzCvNVQ3.js +0 -23
  67. package/dist/alvo-digitavel-DbH0hYFf.cjs +0 -1
  68. package/dist/degrade-CIxvOTUv.cjs +0 -1
  69. package/dist/degrade-gDa5sW__.js +0 -119
  70. package/dist/feature_caixa-CnYPKVFS.cjs +0 -1
  71. package/dist/feature_caixa-DCs9ZeSk.js +0 -1038
  72. package/dist/feature_historico-BAIYk1Me.cjs +0 -3
  73. package/dist/feature_historico-C4h9y5fu.js +0 -3039
  74. package/dist/form-atalhos-7JTYvumA.cjs +0 -1
  75. package/dist/form-atalhos-DDTlpgaB.js +0 -203
  76. package/dist/form-erros-CwPz7Jr4.cjs +0 -1
  77. package/dist/form-erros-DT5HklfD.js +0 -184
  78. package/dist/form-submissao-C-SPRKgT.js +0 -61
  79. package/dist/form-submissao-DxKO5MHI.cjs +0 -1
  80. package/dist/form-validacao-BlQFxUVj.js +0 -104
  81. package/dist/form-validacao-DIeyQVH5.cjs +0 -1
  82. package/dist/geometria-px-DKrWq_XY.js +0 -639
  83. package/dist/leaflet-CEPcxGWV.cjs +0 -1
  84. package/dist/leaflet-DOq10gfg.js +0 -84
  85. package/dist/leaflet-loader-94z5VsdY.cjs +0 -2
  86. package/dist/leaflet-loader-Cjcdgj5R.js +0 -21
  87. package/dist/listener-bag-D5omxZ9h.cjs +0 -1
  88. package/dist/listener-bag-DQgv7OON.js +0 -34
  89. package/dist/motor-By2te6PZ.js +0 -1400
  90. package/dist/motor-CkMxd378.cjs +0 -1
  91. package/dist/opcoes-CupvWVIm.js +0 -24
  92. package/dist/opcoes-vdAUY5OI.cjs +0 -1
  93. package/dist/parts-CaoQiCfI.js +0 -7
  94. package/dist/parts-vQa2873h.cjs +0 -1
  95. package/dist/prancha-paleta-BZ-9QDgh.js +0 -5276
  96. package/dist/prancha-paleta-Bb24vP71.cjs +0 -17
  97. package/dist/ssr-safe-5cWfJP-s.js +0 -10
  98. package/dist/ssr-safe-CiHD1adl.cjs +0 -1
  99. package/dist/svg-seguro-ChVJ2L2z.js +0 -74
  100. package/dist/svg-seguro-J2RM1Ssf.cjs +0 -1
  101. package/dist/ui-badge-DE58YSBY.cjs +0 -28
  102. package/dist/ui-badge-KgmI3jOD.js +0 -201
  103. package/dist/ui-botao-Dz8YvmiA.cjs +0 -12
  104. package/dist/ui-botao-zLkcMMyP.js +0 -168
  105. package/dist/ui-bus-CUd99VJi.js +0 -177
  106. package/dist/ui-bus-XqBLlTYQ.cjs +0 -1
  107. package/dist/ui-camadas-DoHPnbQm.js +0 -3133
  108. package/dist/ui-camadas-Vx7wYD4D.cjs +0 -311
  109. package/dist/ui-campo-texto-Dliyt9qr.cjs +0 -16
  110. package/dist/ui-campo-texto-btevggO3.js +0 -379
  111. package/dist/ui-card-7IEYbCN0.js +0 -150
  112. package/dist/ui-card-Bx8EyzYY.cjs +0 -20
  113. package/dist/ui-card-C-EJoKnm.js +0 -150
  114. package/dist/ui-card-DFnRp9bl.js +0 -146
  115. package/dist/ui-card-DrWVJQKw.cjs +0 -20
  116. package/dist/ui-card-DsIjHMmG.cjs +0 -20
  117. package/dist/ui-controle-cores-B1w_Yl69.cjs +0 -32
  118. package/dist/ui-controle-cores-BRjMvmMn.js +0 -291
  119. package/dist/ui-controle-cores-BcH9k2Fa.js +0 -292
  120. package/dist/ui-controle-cores-CvSTP6gJ.cjs +0 -32
  121. package/dist/ui-editor-prancha-CIngI6yI.js +0 -2886
  122. package/dist/ui-editor-prancha-DorSe6sC.cjs +0 -31
  123. package/dist/ui-linha-2kY7TNUJ.cjs +0 -38
  124. package/dist/ui-linha-B4mBRm1x.cjs +0 -61
  125. package/dist/ui-linha-DTEIIww4.js +0 -1167
  126. package/dist/ui-linha-KFF86FW5.js +0 -752
  127. package/dist/ui-modal-BrXzVZ65.js +0 -216
  128. package/dist/ui-modal-lARKzEVZ.cjs +0 -18
  129. package/dist/ui-paleta-ferramentas-Bu6JaT0s.js +0 -1245
  130. package/dist/ui-paleta-ferramentas-D3Jhwt26.cjs +0 -21
  131. package/dist/ui-paleta-ferramentas-DebHYiwd.js +0 -1615
  132. package/dist/ui-paleta-ferramentas-Dgejtluh.js +0 -1423
  133. package/dist/ui-paleta-ferramentas-hzyo8wBt.cjs +0 -22
  134. package/dist/ui-paleta-ferramentas-jWuICjW8.cjs +0 -22
  135. package/dist/ui-seletor-cor-0RLjcME6.cjs +0 -83
  136. package/dist/ui-seletor-cor-CMuuW-Ym.cjs +0 -83
  137. package/dist/ui-seletor-cor-DFIQ1sin.js +0 -405
  138. package/dist/ui-skeleton-BLEV6h3k.js +0 -653
  139. package/dist/ui-skeleton-B_XTaGrX.cjs +0 -52
  140. package/dist/ui-switch-BXIDwC-Y.cjs +0 -66
  141. package/dist/ui-switch-Ctxk-jKS.js +0 -1212
  142. package/dist/ui-tabela-CXxqbwXv.cjs +0 -7
  143. package/dist/ui-tabela-Cd0vOwnT.js +0 -1459
  144. package/dist/ui-tabela-propriedades-C5cIF5ES.js +0 -3779
  145. package/dist/ui-tabela-propriedades-CJyo568n.js +0 -3517
  146. package/dist/ui-tabela-propriedades-D96Djx-q.cjs +0 -136
  147. package/dist/ui-tabela-propriedades-Wa34hfIr.cjs +0 -142
  148. package/dist/ui-tabela-propriedades-ahQhQauu.js +0 -2329
  149. package/dist/ui-tabela-propriedades-w9JWhjHy.cjs +0 -142
  150. package/dist/zero-js-triggers-CJT988bR.js +0 -83
  151. package/dist/zero-js-triggers-CgM9IIQB.cjs +0 -1
@@ -1,177 +0,0 @@
1
- var u = Object.defineProperty;
2
- var c = (o, e, t) => e in o ? u(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
- var a = (o, e, t) => c(o, typeof e != "symbol" ? e + "" : e, t);
4
- class f {
5
- constructor() {
6
- a(this, "provedorToast", null);
7
- a(this, "listeners", /* @__PURE__ */ new Map());
8
- a(this, "_observandoSistema", !1);
9
- this.observarTemaDoSistema();
10
- }
11
- on(e, t) {
12
- return this.listeners.has(e) || this.listeners.set(e, /* @__PURE__ */ new Set()), this.listeners.get(e).add(t), () => this.off(e, t);
13
- }
14
- once(e, t) {
15
- const r = (i) => {
16
- this.off(e, r), t(i);
17
- };
18
- this.on(e, r);
19
- }
20
- off(e, t) {
21
- const r = this.listeners.get(e);
22
- r && (r.delete(t), r.size === 0 && this.listeners.delete(e));
23
- }
24
- emit(e, t) {
25
- const r = this.listeners.get(e);
26
- r && r.forEach((i) => {
27
- try {
28
- i(t);
29
- } catch (s) {
30
- console.error(`[UIBus] Erro ao executar ouvinte do evento "${e}":`, s);
31
- }
32
- }), typeof window < "u" && window.dispatchEvent(
33
- new CustomEvent(`uibus:${e}`, {
34
- detail: t,
35
- bubbles: !0,
36
- composed: !0
37
- })
38
- );
39
- }
40
- /* ====================================================
41
- Métodos de Atalho e Ações de Alta Produtividade
42
- ==================================================== */
43
- /**
44
- * Abre um modal pelo seu ID no documento.
45
- */
46
- abrirModal(e) {
47
- if (typeof document > "u") return !1;
48
- const t = document.getElementById(e);
49
- return t && typeof t.abrir == "function" ? (t.abrir(), this.emit("modal:aberto", { id: e }), !0) : t ? (t.setAttribute("aberto", ""), this.emit("modal:aberto", { id: e }), !0) : (console.warn(`[UIBus] Modal com ID "${e}" não encontrado no DOM.`), !1);
50
- }
51
- /**
52
- * Fecha um modal pelo seu ID ou todos os modais abertos se nenhum ID for passado.
53
- * Retorna `false` se o modal não existir ou continuar aberto (`bloquear-fechamento`).
54
- */
55
- fecharModal(e) {
56
- if (typeof document > "u") return !1;
57
- if (e) {
58
- const t = document.getElementById(e);
59
- return t && typeof t.fechar == "function" ? (t.fechar(), t.hasAttribute("aberto") || t.hasAttribute("open") ? !1 : (this.emit("modal:fechado", { id: e }), !0)) : t ? (t.removeAttribute("aberto"), t.removeAttribute("open"), this.emit("modal:fechado", { id: e }), !0) : !1;
60
- } else
61
- return document.querySelectorAll(
62
- "ui-modal[aberto], ui-modal[open], ui-dialog[aberto], ui-dialog[open]"
63
- ).forEach((r) => {
64
- typeof r.fechar == "function" ? r.fechar() : (r.removeAttribute("aberto"), r.removeAttribute("open"));
65
- }), this.emit("modal:fechado-todos"), !0;
66
- }
67
- /**
68
- * Abre um painel lateral (drawer / sheet) pelo seu ID no documento.
69
- */
70
- abrirDrawer(e) {
71
- if (typeof document > "u") return !1;
72
- const t = document.getElementById(e);
73
- return t && typeof t.abrir == "function" ? (t.abrir(), this.emit("drawer:aberto", { id: e }), !0) : t ? (t.setAttribute("aberto", ""), this.emit("drawer:aberto", { id: e }), !0) : (console.warn(`[UIBus] Drawer com ID "${e}" não encontrado no DOM.`), !1);
74
- }
75
- /**
76
- * Fecha um painel lateral (drawer / sheet) pelo seu ID ou todos se nenhum for passado.
77
- */
78
- fecharDrawer(e) {
79
- if (typeof document > "u") return !1;
80
- if (e) {
81
- const t = document.getElementById(e);
82
- return t && typeof t.fechar == "function" ? (t.fechar(), this.emit("drawer:fechado", { id: e }), !0) : t ? (t.removeAttribute("aberto"), t.removeAttribute("open"), this.emit("drawer:fechado", { id: e }), !0) : !1;
83
- } else
84
- return document.querySelectorAll(
85
- "ui-drawer[aberto], ui-drawer[open], ui-sheet[aberto], ui-sheet[open]"
86
- ).forEach((r) => {
87
- typeof r.fechar == "function" ? r.fechar() : (r.removeAttribute("aberto"), r.removeAttribute("open"));
88
- }), this.emit("drawer:fechado-todos"), !0;
89
- }
90
- /**
91
- * Dispara uma notificação toast flutuante inteligente.
92
- */
93
- notificar(e) {
94
- const t = this.provedorToast;
95
- if (t)
96
- try {
97
- t(typeof e == "string" ? { mensagem: e, tipo: "info" } : e);
98
- } catch (r) {
99
- console.error("Erro ao exibir toast:", r);
100
- }
101
- }
102
- /**
103
- * Registra (ou remove, com `null`) o provedor que materializa os toasts.
104
- * O `ui-toast` se registra sozinho ao ser carregado; sem provedor, `notificar` é no-op.
105
- */
106
- registrarProvedorToast(e) {
107
- this.provedorToast = e;
108
- }
109
- /**
110
- * Copia um texto para a área de transferência do usuário e exibe feedback opcional.
111
- */
112
- async copiar(e, t) {
113
- if (typeof navigator > "u" || !navigator.clipboard)
114
- return !1;
115
- try {
116
- return await navigator.clipboard.writeText(e), t !== void 0 && this.notificar({
117
- tipo: "sucesso",
118
- mensagem: t || "Copiado para a área de transferência!"
119
- }), this.emit("clipboard:copiado", { texto: e }), !0;
120
- } catch (r) {
121
- return console.error("[UIBus] Falha ao copiar texto:", r), this.notificar({
122
- tipo: "erro",
123
- mensagem: "Não foi possível copiar o texto."
124
- }), !1;
125
- }
126
- }
127
- /**
128
- * Altera a densidade visual global do kit (compacta, normal ou relaxada).
129
- */
130
- definirDensidade(e) {
131
- let t = 34;
132
- typeof e == "number" ? t = Math.max(15, e) : e === "compacta" ? t = 26 : e === "relaxada" ? t = 42 : t = 34, !(typeof document > "u") && (document.documentElement.style.setProperty("--ui-altura-minima", `${t}px`), document.documentElement.style.setProperty("--ui-campo-altura", `${t}px`), document.documentElement.setAttribute("data-ui-densidade", typeof e == "string" ? e : "custom"), this.emit("densidade:alterada", { densidade: e, alturaPx: t }));
133
- }
134
- /**
135
- * Tema em vigor: o forçado na raiz (`data-tema`, `data-theme`, `.dark`/`.light`)
136
- * ou, sem nenhum, o do sistema operacional (`prefers-color-scheme`).
137
- */
138
- obterTema() {
139
- if (typeof document > "u") return "escuro";
140
- const e = n(document.documentElement);
141
- return e || (m() ? "claro" : "escuro");
142
- }
143
- /**
144
- * Define o tema global. Sem argumento, alterna o tema em vigor;
145
- * `'auto'` remove o tema forçado e volta a seguir o sistema operacional.
146
- */
147
- definirTema(e) {
148
- if (typeof document > "u") return e === "claro" ? "claro" : "escuro";
149
- const t = document.documentElement;
150
- if (e === "auto")
151
- t.removeAttribute("data-tema"), t.removeAttribute("data-theme"), t.classList.remove("dark", "light");
152
- else {
153
- const i = e || (this.obterTema() === "escuro" ? "claro" : "escuro");
154
- t.setAttribute("data-tema", i), t.classList.toggle("dark", i === "escuro"), t.classList.toggle("light", i === "claro");
155
- }
156
- const r = this.obterTema();
157
- return this.emit("tema:alterado", { tema: r }), r;
158
- }
159
- /** Com o tema seguindo o SO, avisa `tema:alterado` quando o usuário troca o tema do sistema. */
160
- observarTemaDoSistema() {
161
- var e, t;
162
- this._observandoSistema || typeof window > "u" || typeof window.matchMedia != "function" || (this._observandoSistema = !0, (t = (e = window.matchMedia("(prefers-color-scheme: light)")).addEventListener) == null || t.call(e, "change", () => {
163
- n(document.documentElement) || this.emit("tema:alterado", { tema: this.obterTema() });
164
- }));
165
- }
166
- }
167
- function n(o) {
168
- const e = o.getAttribute("data-tema") || o.getAttribute("data-theme");
169
- return e === "escuro" || e === "dark" ? "escuro" : e === "claro" || e === "light" ? "claro" : o.classList.contains("dark") ? "escuro" : o.classList.contains("light") ? "claro" : null;
170
- }
171
- function m() {
172
- return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-color-scheme: light)").matches;
173
- }
174
- const l = new f();
175
- export {
176
- l as U
177
- };
@@ -1 +0,0 @@
1
- "use strict";var u=Object.defineProperty;var c=(o,e,t)=>e in o?u(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var a=(o,e,t)=>c(o,typeof e!="symbol"?e+"":e,t);class f{constructor(){a(this,"provedorToast",null);a(this,"listeners",new Map);a(this,"_observandoSistema",!1);this.observarTemaDoSistema()}on(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>this.off(e,t)}once(e,t){const r=i=>{this.off(e,r),t(i)};this.on(e,r)}off(e,t){const r=this.listeners.get(e);r&&(r.delete(t),r.size===0&&this.listeners.delete(e))}emit(e,t){const r=this.listeners.get(e);r&&r.forEach(i=>{try{i(t)}catch(s){console.error(`[UIBus] Erro ao executar ouvinte do evento "${e}":`,s)}}),typeof window<"u"&&window.dispatchEvent(new CustomEvent(`uibus:${e}`,{detail:t,bubbles:!0,composed:!0}))}abrirModal(e){if(typeof document>"u")return!1;const t=document.getElementById(e);return t&&typeof t.abrir=="function"?(t.abrir(),this.emit("modal:aberto",{id:e}),!0):t?(t.setAttribute("aberto",""),this.emit("modal:aberto",{id:e}),!0):(console.warn(`[UIBus] Modal com ID "${e}" não encontrado no DOM.`),!1)}fecharModal(e){if(typeof document>"u")return!1;if(e){const t=document.getElementById(e);return t&&typeof t.fechar=="function"?(t.fechar(),t.hasAttribute("aberto")||t.hasAttribute("open")?!1:(this.emit("modal:fechado",{id:e}),!0)):t?(t.removeAttribute("aberto"),t.removeAttribute("open"),this.emit("modal:fechado",{id:e}),!0):!1}else return document.querySelectorAll("ui-modal[aberto], ui-modal[open], ui-dialog[aberto], ui-dialog[open]").forEach(r=>{typeof r.fechar=="function"?r.fechar():(r.removeAttribute("aberto"),r.removeAttribute("open"))}),this.emit("modal:fechado-todos"),!0}abrirDrawer(e){if(typeof document>"u")return!1;const t=document.getElementById(e);return t&&typeof t.abrir=="function"?(t.abrir(),this.emit("drawer:aberto",{id:e}),!0):t?(t.setAttribute("aberto",""),this.emit("drawer:aberto",{id:e}),!0):(console.warn(`[UIBus] Drawer com ID "${e}" não encontrado no DOM.`),!1)}fecharDrawer(e){if(typeof document>"u")return!1;if(e){const t=document.getElementById(e);return t&&typeof t.fechar=="function"?(t.fechar(),this.emit("drawer:fechado",{id:e}),!0):t?(t.removeAttribute("aberto"),t.removeAttribute("open"),this.emit("drawer:fechado",{id:e}),!0):!1}else return document.querySelectorAll("ui-drawer[aberto], ui-drawer[open], ui-sheet[aberto], ui-sheet[open]").forEach(r=>{typeof r.fechar=="function"?r.fechar():(r.removeAttribute("aberto"),r.removeAttribute("open"))}),this.emit("drawer:fechado-todos"),!0}notificar(e){const t=this.provedorToast;if(t)try{t(typeof e=="string"?{mensagem:e,tipo:"info"}:e)}catch(r){console.error("Erro ao exibir toast:",r)}}registrarProvedorToast(e){this.provedorToast=e}async copiar(e,t){if(typeof navigator>"u"||!navigator.clipboard)return!1;try{return await navigator.clipboard.writeText(e),t!==void 0&&this.notificar({tipo:"sucesso",mensagem:t||"Copiado para a área de transferência!"}),this.emit("clipboard:copiado",{texto:e}),!0}catch(r){return console.error("[UIBus] Falha ao copiar texto:",r),this.notificar({tipo:"erro",mensagem:"Não foi possível copiar o texto."}),!1}}definirDensidade(e){let t=34;typeof e=="number"?t=Math.max(15,e):e==="compacta"?t=26:e==="relaxada"?t=42:t=34,!(typeof document>"u")&&(document.documentElement.style.setProperty("--ui-altura-minima",`${t}px`),document.documentElement.style.setProperty("--ui-campo-altura",`${t}px`),document.documentElement.setAttribute("data-ui-densidade",typeof e=="string"?e:"custom"),this.emit("densidade:alterada",{densidade:e,alturaPx:t}))}obterTema(){if(typeof document>"u")return"escuro";const e=n(document.documentElement);return e||(m()?"claro":"escuro")}definirTema(e){if(typeof document>"u")return e==="claro"?"claro":"escuro";const t=document.documentElement;if(e==="auto")t.removeAttribute("data-tema"),t.removeAttribute("data-theme"),t.classList.remove("dark","light");else{const i=e||(this.obterTema()==="escuro"?"claro":"escuro");t.setAttribute("data-tema",i),t.classList.toggle("dark",i==="escuro"),t.classList.toggle("light",i==="claro")}const r=this.obterTema();return this.emit("tema:alterado",{tema:r}),r}observarTemaDoSistema(){var e,t;this._observandoSistema||typeof window>"u"||typeof window.matchMedia!="function"||(this._observandoSistema=!0,(t=(e=window.matchMedia("(prefers-color-scheme: light)")).addEventListener)==null||t.call(e,"change",()=>{n(document.documentElement)||this.emit("tema:alterado",{tema:this.obterTema()})}))}}function n(o){const e=o.getAttribute("data-tema")||o.getAttribute("data-theme");return e==="escuro"||e==="dark"?"escuro":e==="claro"||e==="light"?"claro":o.classList.contains("dark")?"escuro":o.classList.contains("light")?"claro":null}function m(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: light)").matches}const d=new f;exports.UIBus=d;