@thibezer/ui-components-kit 2.11.0 → 2.12.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 (100) hide show
  1. package/CHANGELOG.md +557 -486
  2. package/README.md +1 -1
  3. package/dist/alvo-digitavel-CzCvNVQ3.js +23 -0
  4. package/dist/alvo-digitavel-DbH0hYFf.cjs +1 -0
  5. package/dist/camadas.cjs +111 -106
  6. package/dist/camadas.js +1061 -895
  7. package/dist/canvas.cjs +27 -27
  8. package/dist/canvas.js +801 -819
  9. package/dist/components/ui-camadas/camadas-arvore-renderer.d.ts +3 -0
  10. package/dist/components/ui-camadas/camadas-colecao.d.ts +1 -1
  11. package/dist/components/ui-camadas/camadas-drop-ops.d.ts +3 -0
  12. package/dist/components/ui-camadas/camadas-eventos-camadas.d.ts +2 -0
  13. package/dist/components/ui-camadas/camadas-hierarquia.d.ts +12 -2
  14. package/dist/components/ui-camadas/camadas-host.d.ts +6 -0
  15. package/dist/components/ui-camadas/camadas-metricas.d.ts +2 -1
  16. package/dist/components/ui-camadas/camadas-selecao.d.ts +2 -2
  17. package/dist/components/ui-camadas/tipos.d.ts +1 -0
  18. package/dist/components/ui-camadas/ui-camadas.d.ts +3 -0
  19. package/dist/components/ui-cores/cores-utils.d.ts +1 -1
  20. package/dist/components/ui-cores/tipos.d.ts +2 -2
  21. package/dist/components/ui-cores/ui-controle-cores.d.ts +1 -1
  22. package/dist/components/ui-cores/ui-seletor-cor.d.ts +8 -4
  23. package/dist/components/ui-tabela-propriedades/editores-basicos.d.ts +4 -1
  24. package/dist/components/ui-tabela-propriedades/propriedades-dom-utils.d.ts +2 -0
  25. package/dist/components/ui-tabela-propriedades/propriedades-gerenciador-valores.d.ts +3 -0
  26. package/dist/components/ui-tabela-propriedades/propriedades-painel-controles.d.ts +1 -0
  27. package/dist/components/ui-tabela-propriedades/tipos.d.ts +14 -0
  28. package/dist/components/ui-tabela-propriedades/ui-tabela-propriedades.d.ts +20 -0
  29. package/dist/cores.cjs +1 -1
  30. package/dist/cores.js +2 -2
  31. package/dist/custom-elements.json +24710 -21951
  32. package/dist/data.cjs +1 -1
  33. package/dist/data.js +79 -72
  34. package/dist/form-validacao-BIOXxt-1.js +140 -0
  35. package/dist/form-validacao-ytRYSF3E.cjs +1 -0
  36. package/dist/index.cjs +1 -1
  37. package/dist/index.d.ts +3 -3
  38. package/dist/index.js +163 -156
  39. package/dist/register.cjs +1 -1
  40. package/dist/register.js +3 -3
  41. package/dist/svg-seguro-BsbNQqpd.js +50 -0
  42. package/dist/svg-seguro-C76iLlAZ.cjs +1 -0
  43. package/dist/tabela.cjs +1 -1
  44. package/dist/tabela.js +71 -64
  45. package/dist/tipos-elementos.d.ts +111 -6
  46. package/dist/tipos-react.d.ts +4 -0
  47. package/dist/tipos-vue.d.ts +100 -6
  48. package/dist/ui-badge-BxT-sDmV.cjs +28 -0
  49. package/dist/ui-badge-C0eKBI8E.js +183 -0
  50. package/dist/ui-botao-BOOnP8ds.cjs +12 -0
  51. package/dist/ui-botao-DfqSivHl.js +165 -0
  52. package/dist/ui-botao-OGJV6Vfk.js +165 -0
  53. package/dist/ui-botao-psS1juof.cjs +12 -0
  54. package/dist/ui-campo-texto-Cnn2UAkS.cjs +16 -0
  55. package/dist/ui-campo-texto-Uu2dJE_0.js +379 -0
  56. package/dist/ui-card-B86lJXTP.cjs +20 -0
  57. package/dist/ui-card-C_o5_0cB.js +111 -0
  58. package/dist/{ui-controle-cores-DMtTUtLk.js → ui-controle-cores-B4R6ct4I.js} +9 -10
  59. package/dist/ui-controle-cores-BS0WYPdi.js +572 -0
  60. package/dist/{ui-controle-cores-CohlwXJK.cjs → ui-controle-cores-C8um-If9.cjs} +2 -2
  61. package/dist/ui-controle-cores-CHMKGemo.cjs +141 -0
  62. package/dist/ui-controle-cores-Dog7ERYv.js +697 -0
  63. package/dist/ui-controle-cores-Er6ZcQ7U.cjs +111 -0
  64. package/dist/ui-modal-CvGFGh1h.cjs +18 -0
  65. package/dist/ui-modal-DBOtSTbR.js +238 -0
  66. package/dist/ui-paleta-ferramentas-CEZYcN4J.js +624 -0
  67. package/dist/ui-paleta-ferramentas-CU4icLl0.js +1171 -0
  68. package/dist/ui-paleta-ferramentas-Ccmo-rB5.cjs +21 -0
  69. package/dist/ui-paleta-ferramentas-DLwZHIDv.cjs +21 -0
  70. package/dist/ui-paleta-ferramentas-DNN5i6nL.js +860 -0
  71. package/dist/ui-paleta-ferramentas-Dbj1kBS9.cjs +18 -0
  72. package/dist/ui-paleta-ferramentas-DbwdWVtT.js +1173 -0
  73. package/dist/ui-paleta-ferramentas-bvqxj1Yd.cjs +21 -0
  74. package/dist/ui-segmented-D6b6zxVs.cjs +19 -0
  75. package/dist/ui-segmented-DyF5YLsV.js +418 -0
  76. package/dist/ui-segmented-rn9RxRGM.cjs +19 -0
  77. package/dist/ui-segmented-wUraId2e.js +412 -0
  78. package/dist/ui-seletor-cor-C4U2eqxY.cjs +82 -0
  79. package/dist/ui-seletor-cor-D2_C6Aor.js +391 -0
  80. package/dist/ui-skeleton-DI4_9WOX.js +428 -0
  81. package/dist/ui-skeleton-SPYqku8P.cjs +52 -0
  82. package/dist/ui-skeleton-W9uwIceA.js +585 -0
  83. package/dist/ui-skeleton-elhKIh2B.cjs +33 -0
  84. package/dist/ui-switch-BcOqOkiV.js +856 -0
  85. package/dist/ui-switch-D7iPKDj-.cjs +53 -0
  86. package/dist/ui-tabela-propriedades-BBr5sqki.cjs +145 -0
  87. package/dist/ui-tabela-propriedades-BecPqC-e.cjs +141 -0
  88. package/dist/ui-tabela-propriedades-BokvDD3b.js +2648 -0
  89. package/dist/ui-tabela-propriedades-Boy7I5yW.js +2412 -0
  90. package/dist/ui-tabela-propriedades-C-PeuW1i.cjs +141 -0
  91. package/dist/ui-tabela-propriedades-CyPyKXtB.js +3013 -0
  92. package/dist/ui-tabela-propriedades-Df9ajC6M.js +2648 -0
  93. package/dist/ui-tabela-propriedades-DqvPilK_.cjs +142 -0
  94. package/dist/ui-toast-Bp_NlM5G.js +156 -0
  95. package/dist/ui-toast-DGTZKne5.cjs +20 -0
  96. package/dist/zero-js-triggers-C_KrvFOQ.js +244 -0
  97. package/dist/zero-js-triggers-C_gtaojZ.cjs +1 -0
  98. package/package.json +187 -186
  99. package/dist/ui-seletor-cor-D9iI7yew.js +0 -413
  100. package/dist/ui-seletor-cor-Ft06TEUH.cjs +0 -110
@@ -0,0 +1,856 @@
1
+ var _ = Object.defineProperty;
2
+ var k = (n, i, t) => i in n ? _(n, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[i] = t;
3
+ var a = (n, i, t) => k(n, typeof i != "symbol" ? i + "" : i, t);
4
+ import { L as d } from "./listener-bag-DQgv7OON.js";
5
+ import { a as y } from "./parts-CaoQiCfI.js";
6
+ import { d as h } from "./ssr-safe-5cWfJP-s.js";
7
+ import { F as u, r as w } from "./ui-campo-texto-Uu2dJE_0.js";
8
+ import { g as m, o as p, c as f } from "./form-validacao-BIOXxt-1.js";
9
+ class A {
10
+ constructor(i, t, e) {
11
+ a(this, "scrollHandler");
12
+ a(this, "resizeHandler");
13
+ a(this, "posicionar", () => {
14
+ if (this.isMobileOrBottomSheet()) {
15
+ this.content.style.top = "", this.content.style.left = "", this.content.style.minWidth = "";
16
+ return;
17
+ }
18
+ const i = this.button.getBoundingClientRect();
19
+ this.content.style.top = `${Math.round(i.bottom + 2)}px`, this.content.style.left = `${Math.round(i.left)}px`, this.content.style.minWidth = `${Math.round(Math.max(i.width, 120))}px`, this.ajustarAoViewport(i);
20
+ });
21
+ this.host = i, this.button = t, this.content = e;
22
+ }
23
+ isMobileOrBottomSheet() {
24
+ return typeof window > "u" ? !1 : window.innerWidth <= 640 || this.host.hasAttribute("bottom-sheet") || this.host.hasAttribute("modo-mobile");
25
+ }
26
+ /** Com a lista já visível (medida real): abre para cima se faltar espaço embaixo e não deixa sair pela lateral. */
27
+ ajustarAoViewport(i) {
28
+ const t = this.content.offsetHeight, e = this.content.offsetWidth;
29
+ if (t <= 0 || typeof window > "u") return;
30
+ const s = 8;
31
+ i.bottom + 2 + t > window.innerHeight - s && i.top - 2 - t >= s && (this.content.style.top = `${Math.round(i.top - 2 - t)}px`), i.left + e > window.innerWidth - s && (this.content.style.left = `${Math.max(s, Math.round(window.innerWidth - s - e))}px`);
32
+ }
33
+ ativarAcompanhamento(i) {
34
+ if (this.scrollHandler = i, this.resizeHandler = this.posicionar, window.addEventListener("scroll", this.scrollHandler, { capture: !0, passive: !0 }), window.addEventListener("resize", this.resizeHandler, { passive: !0 }), typeof this.content.showPopover == "function")
35
+ try {
36
+ this.content.showPopover();
37
+ } catch {
38
+ }
39
+ this.posicionar();
40
+ }
41
+ desativarAcompanhamento() {
42
+ if (this.scrollHandler && (window.removeEventListener("scroll", this.scrollHandler, { capture: !0 }), this.scrollHandler = void 0), this.resizeHandler && (window.removeEventListener("resize", this.resizeHandler), this.resizeHandler = void 0), typeof this.content.hidePopover == "function")
43
+ try {
44
+ this.content.hidePopover();
45
+ } catch {
46
+ }
47
+ }
48
+ }
49
+ class E {
50
+ constructor(i) {
51
+ a(this, "focusedIndex", -1);
52
+ this.listElement = i;
53
+ }
54
+ focarPrimeiroItem() {
55
+ const i = Array.from(this.listElement.querySelectorAll(".ui-lista-flutuante__item"));
56
+ if (i.length > 0) {
57
+ const t = i.findIndex((e) => e.classList.contains("ui-lista-flutuante__item--selecionado"));
58
+ this.focusedIndex = Math.max(0, t), i[this.focusedIndex].focus();
59
+ }
60
+ }
61
+ resetarFoco() {
62
+ this.focusedIndex = -1;
63
+ }
64
+ moverFoco(i) {
65
+ const t = Array.from(this.listElement.querySelectorAll(".ui-lista-flutuante__item"));
66
+ t.length !== 0 && (this.focusedIndex += i, this.focusedIndex < 0 && (this.focusedIndex = t.length - 1), this.focusedIndex >= t.length && (this.focusedIndex = 0), t[this.focusedIndex].focus());
67
+ }
68
+ tratarKeydownLista(i, t, e, s, r) {
69
+ if (i.key === "ArrowDown")
70
+ i.preventDefault(), this.moverFoco(1);
71
+ else if (i.key === "ArrowUp")
72
+ i.preventDefault(), this.moverFoco(-1);
73
+ else if (i.key === "Home" || i.key === "End") {
74
+ i.preventDefault();
75
+ const o = i.key === "End";
76
+ this.focusedIndex = o ? -1 : 0, o ? this.moverFoco(-1) : this.moverFoco(0);
77
+ } else i.key === "Tab" ? s() : i.key === "Enter" || i.key === " " ? (i.preventDefault(), this.focusedIndex >= 0 && this.focusedIndex < t.length && e(t[this.focusedIndex])) : i.key === "Escape" && (i.preventDefault(), s(), r.focus());
78
+ }
79
+ }
80
+ const S = ':host{display:inline-block;position:relative;width:100%;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}:host([inline]){width:auto}.ui-lista-flutuante__container{display:flex;flex-direction:column;width:100%;position:relative}.ui-lista-flutuante__label{font-family:var(--ui-fonte-base, "Inter", sans-serif);font-size:var(--ui-tamanho-corpo-sm, 13px);font-weight:var(--ui-peso-medio, 500);color:var(--ui-cor-texto, #e1e1e6);margin-bottom:4px;-webkit-user-select:none;user-select:none;flex-shrink:0}.ui-lista-flutuante__asterisco{color:var(--ui-cor-texto-erro, #ff5555);margin-left:2px}.ui-lista-flutuante__gatilho{display:flex;align-items:center;justify-content:space-between;gap:6px;width:100%;height:var(--ui-campo-altura, 100%);min-height:var(--ui-campo-altura, var(--ui-altura-minima, 15px));padding:0 8px;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);color:var(--ui-cor-texto, #e1e1e6);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 6px);font-family:var(--ui-fonte-base, "Inter", sans-serif);font-size:clamp(11px,.85rem,13px);line-height:1;cursor:pointer;box-sizing:border-box;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:border-color .15s ease,background-color .15s ease}.ui-lista-flutuante__gatilho:hover:not(:disabled){border-color:var(--ui-cor-primaria, #00E08A)}.ui-lista-flutuante__gatilho:disabled{opacity:.5;cursor:not-allowed}.ui-lista-flutuante__texto{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;text-align:left}.ui-lista-flutuante__seta{font-size:10px;line-height:1;display:inline-flex;align-items:center;justify-content:center;transition:transform .2s ease;color:var(--ui-cor-texto-secundario, #888899);flex-shrink:0;shape-rendering:geometricPrecision}:host([aberta]) .ui-lista-flutuante__seta{transform:rotate(180deg)}.ui-lista-flutuante__backdrop{display:none;position:fixed;top:0;left:0;width:100vw;height:100vh;background:transparent;-webkit-backdrop-filter:none;backdrop-filter:none;z-index:calc(var(--ui-z-popover, 1050) - 1)}:host([aberta]) .ui-lista-flutuante__backdrop{display:block}:host(:not([aberta])) .ui-lista-flutuante__conteudo{display:none!important}:host([aberta]) .ui-lista-flutuante__conteudo{display:block}.ui-lista-flutuante__conteudo{position:fixed;margin:0;padding:4px;list-style:none;background-color:var(--ui-cor-fundo-menu, #18181c);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .14));border-radius:var(--ui-raio-borda, 6px);box-shadow:var(--ui-sombra-lg, 0 8px 28px rgba(0, 0, 0, .55));max-height:220px;overflow-y:auto;z-index:var(--ui-z-popover, 1050);box-sizing:border-box;inset:auto}.ui-lista-flutuante__sheet-header{display:none;width:100%;margin-bottom:8px}.ui-lista-flutuante__handle{width:36px;height:4px;border-radius:2px;background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 25%,transparent);margin:2px auto 8px}.ui-lista-flutuante__sheet-title-bar{display:flex;align-items:center;justify-content:space-between;width:100%;padding:4px 6px 8px;border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));margin-bottom:6px}.ui-lista-flutuante__sheet-titulo{font-size:13px;font-weight:600;color:var(--ui-cor-primaria, #00E08A);letter-spacing:.3px;text-transform:uppercase}.ui-lista-flutuante__sheet-close{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);font-size:14px;cursor:pointer;padding:4px 8px;border-radius:var(--ui-raio-sm, 4px);display:flex;align-items:center;justify-content:center;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:color .15s,background-color .15s}.ui-lista-flutuante__sheet-close:hover{color:#fff;background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent)}.ui-lista-flutuante__item{padding:6px 10px;font-family:var(--ui-fonte-base, "Inter", sans-serif);font-size:12px;line-height:1.2;color:var(--ui-cor-texto, #e1e1e6);border-radius:var(--ui-raio-sm, 4px);cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:8px;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:background-color .12s ease,color .12s ease;-webkit-user-select:none;user-select:none}.ui-lista-flutuante__item:hover{background-color:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.ui-lista-flutuante__item--selecionado{background-color:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 15%,transparent);color:var(--ui-cor-primaria, #00E08A);font-weight:600}.ui-lista-flutuante__item--selecionado:after{content:"✓";font-size:11px;color:var(--ui-cor-primaria, #00E08A)}@media (max-width: 640px){.ui-lista-flutuante__gatilho{min-height:max(var(--ui-campo-altura, 38px),38px);font-size:15px}:host([aberta]) .ui-lista-flutuante__backdrop{background-color:#00000059;-webkit-backdrop-filter:none;backdrop-filter:none}.ui-lista-flutuante__conteudo{position:fixed!important;bottom:0!important;top:auto!important;left:0!important;width:100vw!important;max-width:100vw!important;min-width:100vw!important;max-height:70vh!important;max-height:70dvh!important;border-radius:var(--ui-raio-xl, 16px) var(--ui-raio-xl, 16px) 0 0!important;border-bottom:none!important;padding:10px 16px calc(24px + env(safe-area-inset-bottom,0px)) 16px!important;box-shadow:0 -8px 32px #000000b3!important;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;animation:ui-bottom-sheet-slide .22s cubic-bezier(.4,0,.2,1)}.ui-lista-flutuante__sheet-header{display:flex!important;flex-direction:column!important}.ui-lista-flutuante__sheet-close{min-width:44px;min-height:44px;font-size:18px}.ui-lista-flutuante__item{padding:12px 14px!important;font-size:15px!important;margin-bottom:3px}}:host([bottom-sheet][aberta]) .ui-lista-flutuante__backdrop,:host([modo-mobile][aberta]) .ui-lista-flutuante__backdrop{background-color:#00000059;-webkit-backdrop-filter:none;backdrop-filter:none}:host([bottom-sheet]) .ui-lista-flutuante__conteudo,:host([modo-mobile]) .ui-lista-flutuante__conteudo{position:fixed!important;bottom:0!important;top:auto!important;left:0!important;width:100vw!important;max-width:100vw!important;min-width:100vw!important;max-height:70vh!important;max-height:70dvh!important;border-radius:var(--ui-raio-xl, 16px) var(--ui-raio-xl, 16px) 0 0!important;border-bottom:none!important;padding:10px 16px calc(24px + env(safe-area-inset-bottom,0px)) 16px!important;box-shadow:0 -8px 32px #000000b3!important;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;animation:ui-bottom-sheet-slide .22s cubic-bezier(.4,0,.2,1)}:host([bottom-sheet]) .ui-lista-flutuante__sheet-header,:host([modo-mobile]) .ui-lista-flutuante__sheet-header{display:flex!important;flex-direction:column!important}:host([bottom-sheet]) .ui-lista-flutuante__sheet-close,:host([modo-mobile]) .ui-lista-flutuante__sheet-close{min-width:44px;min-height:44px;font-size:18px}:host([bottom-sheet]) .ui-lista-flutuante__item,:host([modo-mobile]) .ui-lista-flutuante__item{padding:12px 14px!important;font-size:15px!important;margin-bottom:3px}@keyframes ui-bottom-sheet-slide{0%{transform:translateY(100%)}to{transform:translateY(0)}}', L = [
81
+ "aberta",
82
+ "texto-padrao",
83
+ "value",
84
+ "disabled",
85
+ "bottom-sheet",
86
+ "modo-mobile",
87
+ "label",
88
+ "rotulo",
89
+ "placeholder",
90
+ "tamanho",
91
+ "size",
92
+ "altura",
93
+ "height",
94
+ "densidade",
95
+ "name",
96
+ "obrigatorio",
97
+ "required",
98
+ "mensagem-validacao",
99
+ "aria-label"
100
+ ];
101
+ function C() {
102
+ return `
103
+ <style>${S}</style>
104
+ <div class="ui-lista-flutuante__container">
105
+ <label class="ui-lista-flutuante__label" part="rotulo" style="display: none;"></label>
106
+ <div class="ui-lista-flutuante__backdrop"></div>
107
+ <button class="ui-lista-flutuante__gatilho" part="campo" aria-haspopup="listbox" aria-expanded="false" type="button">
108
+ <span class="ui-lista-flutuante__texto" part="valor"></span>
109
+ <span class="ui-lista-flutuante__seta" part="seta">▼</span>
110
+ </button>
111
+ <div class="ui-lista-flutuante__conteudo" part="lista" role="listbox" popover="manual">
112
+ <div class="ui-lista-flutuante__sheet-header">
113
+ <div class="ui-lista-flutuante__handle"></div>
114
+ <div class="ui-lista-flutuante__sheet-title-bar">
115
+ <span class="ui-lista-flutuante__sheet-titulo">Selecione uma opção</span>
116
+ <button class="ui-lista-flutuante__sheet-close" type="button" aria-label="Fechar">✕</button>
117
+ </div>
118
+ </div>
119
+ <ul class="ui-lista-flutuante__lista" style="margin: 0; padding: 0; list-style: none;"></ul>
120
+ </div>
121
+ </div>
122
+ `;
123
+ }
124
+ function b(n, i, t) {
125
+ n.innerHTML = "", i.forEach((e) => {
126
+ const s = document.createElement("li"), r = String(e.id) === String(t);
127
+ s.className = `ui-lista-flutuante__item ${r ? "ui-lista-flutuante__item--selecionado" : ""}`, s.setAttribute("data-id", e.id), s.textContent = e.label, s.role = "option", s.tabIndex = -1, s.setAttribute("part", r ? "opcao opcao-selecionada" : "opcao"), r && s.setAttribute("aria-selected", "true"), n.appendChild(s);
128
+ });
129
+ }
130
+ function z(n, i) {
131
+ n.querySelectorAll(".ui-lista-flutuante__item").forEach((e) => {
132
+ const s = e.getAttribute("data-id");
133
+ y(e, "opcao-selecionada", s === String(i)), s === String(i) ? (e.classList.add("ui-lista-flutuante__item--selecionado"), e.setAttribute("aria-selected", "true")) : (e.classList.remove("ui-lista-flutuante__item--selecionado"), e.removeAttribute("aria-selected"));
134
+ });
135
+ }
136
+ class g extends u {
137
+ constructor() {
138
+ super();
139
+ a(this, "labelElement");
140
+ a(this, "button");
141
+ a(this, "content");
142
+ a(this, "listElement");
143
+ a(this, "textoElement");
144
+ a(this, "backdropElement");
145
+ a(this, "sheetTituloElement");
146
+ a(this, "sheetCloseButton");
147
+ a(this, "idsAcessibilidade");
148
+ a(this, "listeners", new d());
149
+ a(this, "_itens", []);
150
+ a(this, "_value", "");
151
+ a(this, "_defaultValue", "");
152
+ a(this, "_defaultCapturado", !1);
153
+ a(this, "observer");
154
+ a(this, "posicionamento");
155
+ a(this, "teclado");
156
+ a(this, "toggleLista", (t) => {
157
+ t.stopPropagation(), !this.disabled && (this.hasAttribute("aberta") ? this.fechar() : this.abrir());
158
+ });
159
+ a(this, "handleKeyDown", (t) => {
160
+ if (!this.disabled) {
161
+ if (t.key === "Escape" && this.hasAttribute("aberta")) {
162
+ t.preventDefault(), this.fechar();
163
+ return;
164
+ }
165
+ (t.key === "Enter" || t.key === " " || t.key === "ArrowDown" || t.key === "ArrowUp") && (t.preventDefault(), this.hasAttribute("aberta") ? this.teclado.focarPrimeiroItem() : this.abrir());
166
+ }
167
+ });
168
+ a(this, "handleListKeyDown", (t) => {
169
+ this.hasAttribute("aberta") && this.teclado.tratarKeydownLista(
170
+ t,
171
+ this._itens,
172
+ (e) => this.selecionarItem(e),
173
+ this.fechar,
174
+ this.button
175
+ );
176
+ });
177
+ a(this, "fechar", () => {
178
+ this.hasAttribute("aberta") && (this.removeAttribute("aberta"), this.posicionamento.desativarAcompanhamento(), this.teclado.resetarFoco());
179
+ });
180
+ a(this, "handleClickFora", (t) => {
181
+ if (!this.hasAttribute("aberta")) return;
182
+ const e = t.composedPath();
183
+ !e.includes(this) && !e.includes(this.content) && this.fechar();
184
+ });
185
+ /** Clicar no rótulo foca o controle (comportamento do <select> nativo), sem abrir a lista. */
186
+ a(this, "focarGatilho", () => {
187
+ this.disabled || this.button.focus();
188
+ });
189
+ a(this, "handleHostClick", (t) => {
190
+ f(this, t) && this.focarGatilho();
191
+ });
192
+ a(this, "handleListClick", (t) => {
193
+ var o;
194
+ t.stopPropagation();
195
+ const e = (o = t.target) == null ? void 0 : o.closest("li[data-id]");
196
+ if (!e) return;
197
+ const s = e.getAttribute("data-id"), r = this._itens.find((l) => String(l.id) === String(s));
198
+ r && this.selecionarItem(r);
199
+ });
200
+ const t = this.attachShadow({ mode: "open" });
201
+ t.innerHTML = C(), this.labelElement = t.querySelector(".ui-lista-flutuante__label"), this.button = t.querySelector(".ui-lista-flutuante__gatilho"), this.content = t.querySelector(".ui-lista-flutuante__conteudo"), this.listElement = t.querySelector(".ui-lista-flutuante__lista"), this.textoElement = t.querySelector(".ui-lista-flutuante__texto"), this.backdropElement = t.querySelector(".ui-lista-flutuante__backdrop"), this.sheetTituloElement = t.querySelector(".ui-lista-flutuante__sheet-titulo"), this.sheetCloseButton = t.querySelector(".ui-lista-flutuante__sheet-close");
202
+ const e = m("ui-select");
203
+ this.idsAcessibilidade = {
204
+ label: `${e}-label`,
205
+ gatilho: `${e}-gatilho`,
206
+ texto: `${e}-texto`,
207
+ lista: `${e}-lista`
208
+ }, this.labelElement.id = this.idsAcessibilidade.label, this.button.id = this.idsAcessibilidade.gatilho, this.textoElement.id = this.idsAcessibilidade.texto, this.content.id = this.idsAcessibilidade.lista, this.button.setAttribute("aria-controls", this.idsAcessibilidade.lista), this.posicionamento = new A(this, this.button, this.content), this.teclado = new E(this.listElement);
209
+ }
210
+ static get observedAttributes() {
211
+ return L;
212
+ }
213
+ connectedCallback() {
214
+ this.listeners.cleanup(), this.listeners.add(this.button, "click", this.toggleLista), this.listeners.add(this.button, "keydown", this.handleKeyDown), this.listeners.add(this.content, "keydown", this.handleListKeyDown), this.listeners.add(this.backdropElement, "click", this.fechar), this.listeners.add(this.listElement, "click", this.handleListClick), this.listeners.add(this.sheetCloseButton, "click", (t) => {
215
+ t.stopPropagation(), this.fechar();
216
+ }), this.listeners.add(document, "click", this.handleClickFora), this.listeners.add(this.labelElement, "click", this.focarGatilho), this.listeners.add(this, "click", this.handleHostClick), this._defaultCapturado || (this._defaultValue = this.getAttribute("value") || "", this._defaultCapturado = !0), this.carregarItensFilhos(), this.syncState(), this.observer = new MutationObserver(() => this.carregarItensFilhos()), this.observer.observe(this, { childList: !0, subtree: !0 });
217
+ }
218
+ carregarItensFilhos() {
219
+ const t = Array.from(this.querySelectorAll('option, ui-opcao, [role="option"], [data-opcao], [data-value]:not(input):not(select)'));
220
+ t.length > 0 && (this._itens = t.map((e, s) => {
221
+ var o;
222
+ const r = e.getAttribute("value") || e.getAttribute("data-value") || String(s + 1);
223
+ return {
224
+ id: r,
225
+ label: ((o = e.textContent) == null ? void 0 : o.trim()) || r || `Opção ${s + 1}`
226
+ };
227
+ }), b(this.listElement, this._itens, this._value), this.syncLabel());
228
+ }
229
+ disconnectedCallback() {
230
+ this.listeners.cleanup(), this.observer && this.observer.disconnect(), this.fechar();
231
+ }
232
+ attributeChangedCallback(t, e, s) {
233
+ t === "aberta" && this.button.setAttribute("aria-expanded", String(s !== null)), (t === "texto-padrao" || t === "placeholder" || t === "label" || t === "rotulo" || t === "aria-label") && this.syncLabel(), t === "value" && s !== this._value && (this.value = s || ""), t === "disabled" && (this.button.disabled = this.disabled), (t === "altura" || t === "height") && (s ? this.style.setProperty("--ui-campo-altura", isNaN(Number(s)) ? s : `${s}px`) : this.style.removeProperty("--ui-campo-altura"));
234
+ }
235
+ get value() {
236
+ return this._value;
237
+ }
238
+ set value(t) {
239
+ this._value = t, this.setAttribute("value", t), this.internals.setFormValue(t), this.syncLabel(), z(this.listElement, this._value), this.atualizarValidade();
240
+ }
241
+ get label() {
242
+ return this.getAttribute("label") || this.getAttribute("rotulo") || "";
243
+ }
244
+ set label(t) {
245
+ t ? this.setAttribute("label", t) : (this.removeAttribute("label"), this.removeAttribute("rotulo")), this.syncLabel();
246
+ }
247
+ get disabled() {
248
+ return this.hasAttribute("disabled") || this._formDisabled;
249
+ }
250
+ set disabled(t) {
251
+ t ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"), this.button.disabled = this.disabled;
252
+ }
253
+ get name() {
254
+ return this.getAttribute("name") || "";
255
+ }
256
+ set name(t) {
257
+ this.setAttribute("name", t);
258
+ }
259
+ get type() {
260
+ return "select-one";
261
+ }
262
+ atualizarValidade() {
263
+ if (!this.internals || typeof this.internals.setValidity != "function") return;
264
+ if (this.disabled) {
265
+ this.internals.setValidity({});
266
+ return;
267
+ }
268
+ if (this._customErrorMessage) {
269
+ this.internals.setValidity({ customError: !0 }, this._customErrorMessage, this.button);
270
+ return;
271
+ }
272
+ if ((this.hasAttribute("obrigatorio") || this.hasAttribute("required")) && (!this._value || this._value.trim() === "")) {
273
+ const e = this.getAttribute("mensagem-validacao") || "Selecione um item da lista.";
274
+ this.internals.setValidity({ valueMissing: !0 }, e, this.button);
275
+ return;
276
+ }
277
+ this.internals.setValidity({});
278
+ }
279
+ // === Ciclo de Vida Form-Associated Custom Elements (W3C FACE) ===
280
+ formDisabledCallback(t) {
281
+ this._formDisabled = t, this.button.disabled = this.disabled, this.disabled && this.fechar();
282
+ }
283
+ formResetCallback() {
284
+ this.value = this._defaultValue;
285
+ }
286
+ formStateRestoreCallback(t, e) {
287
+ typeof t == "string" && (this.value = t);
288
+ }
289
+ get itens() {
290
+ return this._itens;
291
+ }
292
+ set itens(t) {
293
+ this._itens = t || [], b(this.listElement, this._itens, this._value), this.syncLabel();
294
+ }
295
+ abrir() {
296
+ this.disabled || this.hasAttribute("aberta") || (this.setAttribute("aberta", ""), this.posicionamento.posicionar(), this.posicionamento.ativarAcompanhamento(this.fechar));
297
+ }
298
+ syncLabel() {
299
+ const t = this.getAttribute("label") || this.getAttribute("rotulo");
300
+ if (t)
301
+ w(this.labelElement, t, this.required, "ui-lista-flutuante__asterisco"), this.labelElement.style.display = "block", this.sheetTituloElement.textContent = t, this.button.setAttribute("aria-labelledby", `${this.idsAcessibilidade.label} ${this.idsAcessibilidade.texto}`), this.content.setAttribute("aria-labelledby", this.idsAcessibilidade.label), this.button.removeAttribute("aria-label"), this.content.removeAttribute("aria-label");
302
+ else {
303
+ this.labelElement.style.display = "none", this.sincronizarRotuloExterno();
304
+ const s = this.getAttribute("texto-padrao") || this.getAttribute("placeholder") || "Opções";
305
+ this.sheetTituloElement.textContent = s;
306
+ }
307
+ const e = this._itens.find((s) => String(s.id) === String(this._value));
308
+ if (e)
309
+ this.textoElement.textContent = e.label;
310
+ else {
311
+ const s = this.getAttribute("texto-padrao") || this.getAttribute("placeholder") || "Opções";
312
+ this.textoElement.textContent = s;
313
+ }
314
+ }
315
+ /** Sem o atributo `label`, usa o rótulo de fora do Shadow DOM (aria-label, <label for>, <label> envolvente). */
316
+ sincronizarRotuloExterno() {
317
+ this.button.removeAttribute("aria-labelledby"), this.content.removeAttribute("aria-labelledby");
318
+ const t = p(this, this.internals);
319
+ t ? (this.button.setAttribute("aria-labelledby", `${this.idsAcessibilidade.gatilho} ${this.idsAcessibilidade.texto}`), this.button.setAttribute("aria-label", t), this.content.setAttribute("aria-label", t)) : (this.button.removeAttribute("aria-label"), this.content.removeAttribute("aria-label"));
320
+ }
321
+ syncState() {
322
+ const t = this.getAttribute("altura") || this.getAttribute("height");
323
+ t && this.style.setProperty("--ui-campo-altura", isNaN(Number(t)) ? t : `${t}px`), this.hasAttribute("value") && (this._value = this.getAttribute("value") || "", this.internals.setFormValue(this._value)), this.syncLabel(), this.atualizarValidade();
324
+ }
325
+ selecionarItem(t) {
326
+ var r;
327
+ const e = (r = this.shadowRoot) == null ? void 0 : r.activeElement, s = !!e && this.content.contains(e);
328
+ this.value = t.id, this.fechar(), s && this.button.focus(), this.dispatchEvent(
329
+ new CustomEvent("ui-selecionar", {
330
+ detail: t,
331
+ bubbles: !0,
332
+ composed: !0
333
+ })
334
+ ), this.dispatchEvent(
335
+ new Event("input", {
336
+ bubbles: !0,
337
+ composed: !0
338
+ })
339
+ ), this.dispatchEvent(
340
+ new Event("change", {
341
+ bubbles: !0,
342
+ composed: !0
343
+ })
344
+ );
345
+ }
346
+ }
347
+ class I extends g {
348
+ }
349
+ h("ui-lista-flutuante", g);
350
+ h("ui-select", I);
351
+ const q = ':host{display:inline-flex;align-items:center;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif);vertical-align:middle}.ui-checkbox{display:inline-flex;align-items:center;gap:8px;cursor:pointer;-webkit-user-select:none;user-select:none;line-height:1;outline:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent}.ui-checkbox--disabled{opacity:.5;cursor:not-allowed!important;pointer-events:none}.ui-checkbox__box{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;min-width:16px;min-height:16px;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));border-radius:var(--ui-raio-sm, 4px);box-sizing:border-box;transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease;flex-shrink:0}.ui-checkbox:focus-visible .ui-checkbox__box,.ui-checkbox--foco .ui-checkbox__box{border-color:var(--ui-cor-primaria, #00E08A);box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 25%,transparent)}.ui-checkbox--checked .ui-checkbox__box,.ui-checkbox--indeterminate .ui-checkbox__box{background-color:var(--ui-cor-primaria, #00E08A);border-color:var(--ui-cor-primaria, #00E08A);color:var(--ui-cor-texto-sobre-primaria, #000000)}.ui-checkbox__mark{width:12px;height:12px;display:flex;align-items:center;justify-content:center;transition:transform .15s cubic-bezier(.4,0,.2,1),opacity .15s ease;transform:scale(0);opacity:0}.ui-checkbox--checked .ui-checkbox__mark,.ui-checkbox--indeterminate .ui-checkbox__mark{transform:scale(1);opacity:1}.ui-checkbox__mark svg{width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;shape-rendering:geometricPrecision}.ui-checkbox__label{display:inline-flex;align-items:center;font-size:clamp(11px,.85rem,14px);color:var(--ui-cor-texto, #e1e1e6);line-height:1}.ui-checkbox--label-esquerda{flex-direction:row-reverse}@media (max-width: 640px){.ui-checkbox{min-height:40px;padding:4px 0}.ui-checkbox__box{width:20px;height:20px;min-width:20px;min-height:20px}.ui-checkbox__mark{width:14px;height:14px}.ui-checkbox__label{font-size:14px}}';
352
+ class V extends u {
353
+ constructor() {
354
+ super();
355
+ a(this, "containerElement");
356
+ a(this, "markElement");
357
+ a(this, "labelElement");
358
+ a(this, "listeners", new d());
359
+ a(this, "_defaultChecked", !1);
360
+ a(this, "_defaultIndeterminate", !1);
361
+ a(this, "handleClick", (t) => {
362
+ t.preventDefault(), this.alternar();
363
+ });
364
+ a(this, "handleKeyDown", (t) => {
365
+ (t.key === " " || t.key === "Enter") && (t.preventDefault(), this.alternar());
366
+ });
367
+ a(this, "handleFocus", () => {
368
+ this.containerElement.classList.add("ui-checkbox--foco");
369
+ });
370
+ a(this, "handleBlur", () => {
371
+ this.containerElement.classList.remove("ui-checkbox--foco");
372
+ });
373
+ const t = this.attachShadow({ mode: "open" });
374
+ t.innerHTML = `
375
+ <style>${q}</style>
376
+ <div class="ui-checkbox" part="base" tabindex="0" role="checkbox" aria-checked="false">
377
+ <span class="ui-checkbox__box" part="controle">
378
+ <span class="ui-checkbox__mark" part="indicador"></span>
379
+ </span>
380
+ <span class="ui-checkbox__label" part="rotulo" style="display: none;"></span>
381
+ </div>
382
+ `, this.containerElement = t.querySelector(".ui-checkbox"), this.markElement = t.querySelector(".ui-checkbox__mark"), this.labelElement = t.querySelector(".ui-checkbox__label");
383
+ }
384
+ static get observedAttributes() {
385
+ return [
386
+ "marcado",
387
+ "checked",
388
+ "indeterminado",
389
+ "indeterminate",
390
+ "disabled",
391
+ "value",
392
+ "label",
393
+ "posicao-label",
394
+ "name",
395
+ "obrigatorio",
396
+ "required",
397
+ "mensagem-validacao"
398
+ ];
399
+ }
400
+ connectedCallback() {
401
+ this.listeners.cleanup(), this.listeners.add(this.containerElement, "click", this.handleClick), this.listeners.add(this.containerElement, "keydown", this.handleKeyDown), this.listeners.add(this.containerElement, "focus", this.handleFocus), this.listeners.add(this.containerElement, "blur", this.handleBlur), this._defaultChecked = this.hasAttribute("marcado") || this.hasAttribute("checked"), this._defaultIndeterminate = this.hasAttribute("indeterminado") || this.hasAttribute("indeterminate"), this.syncState();
402
+ }
403
+ disconnectedCallback() {
404
+ this.listeners.cleanup();
405
+ }
406
+ attributeChangedCallback(t, e, s) {
407
+ this.syncState();
408
+ }
409
+ get marcado() {
410
+ return this.hasAttribute("marcado") || this.hasAttribute("checked");
411
+ }
412
+ set marcado(t) {
413
+ t ? this.setAttribute("marcado", "") : (this.removeAttribute("marcado"), this.removeAttribute("checked")), this.syncState();
414
+ }
415
+ get checked() {
416
+ return this.marcado;
417
+ }
418
+ set checked(t) {
419
+ this.marcado = t;
420
+ }
421
+ get value() {
422
+ return this.getAttribute("value") || "on";
423
+ }
424
+ set value(t) {
425
+ this.setAttribute("value", t), this.syncState();
426
+ }
427
+ get name() {
428
+ return this.getAttribute("name") || "";
429
+ }
430
+ set name(t) {
431
+ this.setAttribute("name", t), this.syncState();
432
+ }
433
+ get indeterminado() {
434
+ return this.hasAttribute("indeterminado") || this.hasAttribute("indeterminate");
435
+ }
436
+ set indeterminado(t) {
437
+ t ? this.setAttribute("indeterminado", "") : (this.removeAttribute("indeterminado"), this.removeAttribute("indeterminate")), this.syncState();
438
+ }
439
+ get disabled() {
440
+ return this.hasAttribute("disabled") || this._formDisabled;
441
+ }
442
+ set disabled(t) {
443
+ t ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"), this.syncState();
444
+ }
445
+ get type() {
446
+ return "checkbox";
447
+ }
448
+ atualizarValidade() {
449
+ if (!this.internals || typeof this.internals.setValidity != "function") return;
450
+ if (this.disabled) {
451
+ this.internals.setValidity({});
452
+ return;
453
+ }
454
+ if (this._customErrorMessage) {
455
+ this.internals.setValidity({ customError: !0 }, this._customErrorMessage, this.containerElement);
456
+ return;
457
+ }
458
+ if ((this.hasAttribute("obrigatorio") || this.hasAttribute("required")) && !this.marcado) {
459
+ const e = this.getAttribute("mensagem-validacao") || "Marque esta caixa para continuar.";
460
+ this.internals.setValidity({ valueMissing: !0 }, e, this.containerElement);
461
+ return;
462
+ }
463
+ this.internals.setValidity({});
464
+ }
465
+ alternar() {
466
+ this.disabled || (this.indeterminado ? (this.indeterminado = !1, this.marcado = !0) : this.marcado = !this.marcado, this.dispatchEvent(
467
+ new CustomEvent("ui-change", {
468
+ detail: {
469
+ marcado: this.marcado,
470
+ indeterminado: this.indeterminado,
471
+ value: this.getAttribute("value") || ""
472
+ },
473
+ bubbles: !0,
474
+ composed: !0
475
+ })
476
+ ), this.dispatchEvent(
477
+ new Event("change", {
478
+ bubbles: !0,
479
+ composed: !0
480
+ })
481
+ ));
482
+ }
483
+ syncState() {
484
+ const t = this.marcado, e = this.indeterminado, s = this.disabled, r = this.getAttribute("label"), o = this.getAttribute("posicao-label") || "direita";
485
+ this.containerElement.setAttribute(
486
+ "aria-checked",
487
+ e ? "mixed" : String(t)
488
+ ), s ? (this.containerElement.classList.add("ui-checkbox--disabled"), this.containerElement.setAttribute("tabindex", "-1"), this.containerElement.setAttribute("aria-disabled", "true")) : (this.containerElement.classList.remove("ui-checkbox--disabled"), this.containerElement.setAttribute("tabindex", "0"), this.containerElement.removeAttribute("aria-disabled")), t ? this.containerElement.classList.add("ui-checkbox--checked") : this.containerElement.classList.remove("ui-checkbox--checked"), e ? this.containerElement.classList.add("ui-checkbox--indeterminate") : this.containerElement.classList.remove("ui-checkbox--indeterminate"), o === "esquerda" ? this.containerElement.classList.add("ui-checkbox--label-esquerda") : this.containerElement.classList.remove("ui-checkbox--label-esquerda"), e ? this.markElement.innerHTML = `
489
+ <svg viewBox="0 0 24 24">
490
+ <line x1="5" y1="12" x2="19" y2="12"></line>
491
+ </svg>
492
+ ` : t ? this.markElement.innerHTML = `
493
+ <svg viewBox="0 0 24 24">
494
+ <polyline points="20 6 9 17 4 12"></polyline>
495
+ </svg>
496
+ ` : this.markElement.innerHTML = "", r ? (this.labelElement.textContent = r, this.labelElement.style.display = "inline") : this.labelElement.style.display = "none", t ? this.internals.setFormValue(this.getAttribute("value") || "on") : this.internals.setFormValue(null), this.atualizarValidade();
497
+ }
498
+ // === Ciclo de Vida Form-Associated Custom Elements (W3C FACE) ===
499
+ formResetCallback() {
500
+ this.marcado = this._defaultChecked, this.indeterminado = this._defaultIndeterminate, this.syncState();
501
+ }
502
+ formStateRestoreCallback(t, e) {
503
+ typeof t == "string" ? this.marcado = t === (this.getAttribute("value") || "on") : typeof t == "boolean" && (this.marcado = t), this.syncState();
504
+ }
505
+ }
506
+ h("ui-checkbox", V);
507
+ const D = ':host{display:inline-flex;align-items:center;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif);vertical-align:middle}.ui-radio{display:inline-flex;align-items:center;gap:8px;cursor:pointer;-webkit-user-select:none;user-select:none;line-height:1;outline:none}.ui-radio--disabled{opacity:.5;cursor:not-allowed!important;pointer-events:none}.ui-radio__circle{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;min-width:16px;min-height:16px;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));border-radius:50%;box-sizing:border-box;transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease;flex-shrink:0}.ui-radio:focus-visible .ui-radio__circle,.ui-radio--foco .ui-radio__circle{border-color:var(--ui-cor-primaria, #00E08A);box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 25%,transparent)}.ui-radio--checked .ui-radio__circle{border-color:var(--ui-cor-primaria, #00E08A)}.ui-radio__dot{width:8px;height:8px;border-radius:50%;background-color:var(--ui-cor-primaria, #00E08A);transition:transform .15s cubic-bezier(.4,0,.2,1),opacity .15s ease;transform:scale(0);opacity:0}.ui-radio--checked .ui-radio__dot{transform:scale(1);opacity:1}.ui-radio__label{display:inline-flex;align-items:center;font-size:clamp(11px,.85rem,14px);color:var(--ui-cor-texto, #e1e1e6);line-height:1}.ui-radio--label-esquerda{flex-direction:row-reverse}';
508
+ class c {
509
+ static getScopeNode(i) {
510
+ return i.closest("form") || i.getRootNode() || document;
511
+ }
512
+ static registrar(i) {
513
+ const t = i.name;
514
+ if (t) {
515
+ const e = this.getScopeNode(i);
516
+ this.registry.has(e) || this.registry.set(e, /* @__PURE__ */ new Map());
517
+ const s = this.registry.get(e);
518
+ s.has(t) || s.set(t, /* @__PURE__ */ new Set()), s.get(t).add(i);
519
+ }
520
+ }
521
+ static desregistrar(i) {
522
+ const t = i.name;
523
+ if (t) {
524
+ const e = this.getScopeNode(i), s = this.registry.get(e);
525
+ if (s && s.has(t)) {
526
+ const r = s.get(t);
527
+ r.delete(i), r.size === 0 && s.delete(t), s.size === 0 && this.registry.delete(e);
528
+ }
529
+ }
530
+ }
531
+ static obterRadiosDoGrupo(i) {
532
+ const t = i.name;
533
+ if (!t) return [];
534
+ const e = this.getScopeNode(i), s = this.registry.get(e);
535
+ return !s || !s.has(t) ? [] : Array.from(s.get(t));
536
+ }
537
+ static desmarcarOutros(i) {
538
+ this.obterRadiosDoGrupo(i).forEach((e) => {
539
+ e !== i && (e.removeAttribute("marcado"), e.removeAttribute("checked"), e.syncState());
540
+ });
541
+ }
542
+ static tratarNavegacaoTeclado(i, t) {
543
+ if (["ArrowDown", "ArrowRight", "ArrowUp", "ArrowLeft"].includes(i.key)) {
544
+ i.preventDefault();
545
+ const s = this.obterRadiosDoGrupo(t).filter((l) => !l.disabled);
546
+ if (s.length <= 1) return;
547
+ const r = s.indexOf(t);
548
+ let o = r;
549
+ if (i.key === "ArrowDown" || i.key === "ArrowRight" ? o = (r + 1) % s.length : (i.key === "ArrowUp" || i.key === "ArrowLeft") && (o = (r - 1 + s.length) % s.length), o !== r && o >= 0 && o < s.length) {
550
+ const l = s[o];
551
+ l.selecionar(), l.focus();
552
+ }
553
+ }
554
+ }
555
+ }
556
+ a(c, "registry", /* @__PURE__ */ new WeakMap());
557
+ class M extends u {
558
+ constructor() {
559
+ super();
560
+ a(this, "containerElement");
561
+ a(this, "labelElement");
562
+ a(this, "_defaultChecked", !1);
563
+ a(this, "handleClick", (t) => {
564
+ t.preventDefault(), this.selecionar(), this.containerElement.focus();
565
+ });
566
+ a(this, "handleKeyDown", (t) => {
567
+ t.key === " " || t.key === "Enter" ? (t.preventDefault(), this.selecionar()) : c.tratarNavegacaoTeclado(t, this);
568
+ });
569
+ a(this, "handleFocus", () => {
570
+ this.containerElement.classList.add("ui-radio--foco");
571
+ });
572
+ a(this, "handleBlur", () => {
573
+ this.containerElement.classList.remove("ui-radio--foco");
574
+ });
575
+ const t = this.attachShadow({ mode: "open" });
576
+ t.innerHTML = `
577
+ <style>${D}</style>
578
+ <div class="ui-radio" part="base" tabindex="0" role="radio" aria-checked="false">
579
+ <span class="ui-radio__circle" part="controle">
580
+ <span class="ui-radio__dot" part="indicador"></span>
581
+ </span>
582
+ <span class="ui-radio__label" part="rotulo" style="display: none;"></span>
583
+ </div>
584
+ `, this.containerElement = t.querySelector(".ui-radio"), this.labelElement = t.querySelector(".ui-radio__label");
585
+ }
586
+ static get observedAttributes() {
587
+ return [
588
+ "marcado",
589
+ "checked",
590
+ "name",
591
+ "nome",
592
+ "disabled",
593
+ "value",
594
+ "label",
595
+ "posicao-label",
596
+ "obrigatorio",
597
+ "required",
598
+ "mensagem-validacao"
599
+ ];
600
+ }
601
+ connectedCallback() {
602
+ this.containerElement.addEventListener("click", this.handleClick), this.containerElement.addEventListener("keydown", this.handleKeyDown), this.containerElement.addEventListener("focus", this.handleFocus), this.containerElement.addEventListener("blur", this.handleBlur), this._defaultChecked = this.hasAttribute("marcado") || this.hasAttribute("checked"), c.registrar(this), this.syncState();
603
+ }
604
+ disconnectedCallback() {
605
+ this.containerElement.removeEventListener("click", this.handleClick), this.containerElement.removeEventListener("keydown", this.handleKeyDown), this.containerElement.removeEventListener("focus", this.handleFocus), this.containerElement.removeEventListener("blur", this.handleBlur), c.desregistrar(this);
606
+ }
607
+ attributeChangedCallback(t, e, s) {
608
+ this.syncState();
609
+ }
610
+ get marcado() {
611
+ return this.hasAttribute("marcado") || this.hasAttribute("checked");
612
+ }
613
+ set marcado(t) {
614
+ t ? this.setAttribute("marcado", "") : (this.removeAttribute("marcado"), this.removeAttribute("checked"));
615
+ }
616
+ get name() {
617
+ return this.getAttribute("name") || this.getAttribute("nome") || "";
618
+ }
619
+ set name(t) {
620
+ c.desregistrar(this), this.setAttribute("name", t), c.registrar(this), this.syncState();
621
+ }
622
+ get disabled() {
623
+ return this.hasAttribute("disabled") || this._formDisabled;
624
+ }
625
+ set disabled(t) {
626
+ t ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"), this.syncState();
627
+ }
628
+ get type() {
629
+ return "radio";
630
+ }
631
+ atualizarValidade() {
632
+ if (!this.internals || typeof this.internals.setValidity != "function") return;
633
+ if (this.disabled) {
634
+ this.internals.setValidity({});
635
+ return;
636
+ }
637
+ if (this._customErrorMessage) {
638
+ this.internals.setValidity({ customError: !0 }, this._customErrorMessage, this.containerElement);
639
+ return;
640
+ }
641
+ const t = c.obterRadiosDoGrupo(this);
642
+ if ((this.required || t.length > 0 && t.some((s) => s.required)) && !(this.marcado || t.length > 0 && t.some((r) => r.marcado))) {
643
+ const r = this.getAttribute("mensagem-validacao") || "Selecione uma opção.";
644
+ this.internals.setValidity({ valueMissing: !0 }, r, this.containerElement);
645
+ return;
646
+ }
647
+ this.internals.setValidity({});
648
+ }
649
+ focus(t) {
650
+ this.containerElement.focus(t);
651
+ }
652
+ selecionar() {
653
+ this.disabled || this.marcado || (c.desmarcarOutros(this), this.marcado = !0, this.dispatchEvent(
654
+ new CustomEvent("ui-change", {
655
+ detail: {
656
+ marcado: !0,
657
+ name: this.name,
658
+ value: this.getAttribute("value") || ""
659
+ },
660
+ bubbles: !0,
661
+ composed: !0
662
+ })
663
+ ), this.dispatchEvent(
664
+ new Event("change", {
665
+ bubbles: !0,
666
+ composed: !0
667
+ })
668
+ ), c.obterRadiosDoGrupo(this).forEach((t) => t.atualizarValidade()));
669
+ }
670
+ syncState() {
671
+ const t = this.marcado, e = this.disabled, s = this.getAttribute("label"), r = this.getAttribute("posicao-label") || "direita";
672
+ if (this.containerElement.setAttribute("aria-checked", String(t)), e)
673
+ this.containerElement.classList.add("ui-radio--disabled"), this.containerElement.setAttribute("tabindex", "-1"), this.containerElement.setAttribute("aria-disabled", "true");
674
+ else {
675
+ this.containerElement.classList.remove("ui-radio--disabled"), this.containerElement.removeAttribute("aria-disabled");
676
+ const o = c.obterRadiosDoGrupo(this);
677
+ o.length > 0 ? o.some((v) => v.marcado) ? this.containerElement.setAttribute("tabindex", t ? "0" : "-1") : this.containerElement.setAttribute("tabindex", o[0] === this ? "0" : "-1") : this.containerElement.setAttribute("tabindex", "0");
678
+ }
679
+ t ? this.containerElement.classList.add("ui-radio--checked") : this.containerElement.classList.remove("ui-radio--checked"), r === "esquerda" ? this.containerElement.classList.add("ui-radio--label-esquerda") : this.containerElement.classList.remove("ui-radio--label-esquerda"), s ? (this.labelElement.textContent = s, this.labelElement.style.display = "inline") : this.labelElement.style.display = "none", t ? this.internals.setFormValue(this.getAttribute("value") || "on") : this.internals.setFormValue(null), this.atualizarValidade();
680
+ }
681
+ // === Ciclo de Vida Form-Associated Custom Elements (W3C FACE) ===
682
+ formResetCallback() {
683
+ this.marcado = this._defaultChecked, this._defaultChecked ? this.internals.setFormValue(this.getAttribute("value") || "on") : this.internals.setFormValue(null), this.atualizarValidade();
684
+ }
685
+ formStateRestoreCallback(t, e) {
686
+ typeof t == "string" ? this.marcado = t === (this.getAttribute("value") || "on") : typeof t == "boolean" && (this.marcado = t), this.syncState();
687
+ }
688
+ }
689
+ h("ui-radio", M);
690
+ const R = ':host{display:inline-flex;align-items:center;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif);vertical-align:middle}.ui-switch{display:inline-flex;align-items:center;gap:8px;cursor:pointer;-webkit-user-select:none;user-select:none;line-height:1;outline:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent}.ui-switch--disabled{opacity:.5;cursor:not-allowed!important;pointer-events:none}.ui-switch__track{display:inline-flex;align-items:center;position:relative;width:36px;height:20px;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .16));border-radius:var(--ui-raio-pill, 999px);box-sizing:border-box;padding:1px;transition:background-color .2s ease,border-color .2s ease,box-shadow .2s ease;flex-shrink:0}.ui-switch:focus-visible .ui-switch__track,.ui-switch--foco .ui-switch__track{border-color:var(--ui-cor-primaria, #00E08A);box-shadow:0 0 0 2px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 25%,transparent)}.ui-switch--checked .ui-switch__track{background-color:var(--ui-cor-primaria, #00E08A);border-color:var(--ui-cor-primaria, #00E08A)}.ui-switch__thumb{display:block;width:16px;height:16px;background-color:#fff;border-radius:50%;box-shadow:var(--ui-sombra-sm, 0 1px 3px rgba(0, 0, 0, .3));transition:transform .2s cubic-bezier(.4,0,.2,1),background-color .2s ease;transform:translate(0)}.ui-switch--checked .ui-switch__thumb{transform:translate(16px);background-color:var(--ui-cor-texto-sobre-primaria, #000000)}.ui-switch--sm .ui-switch__track{width:28px;height:16px;padding:1px}.ui-switch--sm .ui-switch__thumb{width:12px;height:12px}.ui-switch--sm.ui-switch--checked .ui-switch__thumb{transform:translate(12px)}.ui-switch--lg .ui-switch__track{width:44px;height:24px;padding:1px}.ui-switch--lg .ui-switch__thumb{width:20px;height:20px}.ui-switch--lg.ui-switch--checked .ui-switch__thumb{transform:translate(20px)}.ui-switch__label{display:inline-flex;align-items:center;font-size:clamp(11px,.85rem,14px);color:var(--ui-cor-texto, #e1e1e6);line-height:1}.ui-switch--label-esquerda{flex-direction:row-reverse}@media (max-width: 640px){.ui-switch{min-height:40px;padding:4px 0}.ui-switch__label{font-size:14px}}';
691
+ class x extends u {
692
+ constructor() {
693
+ super();
694
+ a(this, "containerElement");
695
+ a(this, "labelElement");
696
+ a(this, "labelId");
697
+ a(this, "listeners", new d());
698
+ a(this, "_defaultChecked", !1);
699
+ a(this, "handleClick", (t) => {
700
+ t.preventDefault(), this.alternar();
701
+ });
702
+ a(this, "handleHostClick", (t) => {
703
+ f(this, t) && (this.alternar(), this.containerElement.focus());
704
+ });
705
+ a(this, "handleKeyDown", (t) => {
706
+ (t.key === " " || t.key === "Enter") && (t.preventDefault(), this.alternar());
707
+ });
708
+ a(this, "handleFocus", () => {
709
+ this.containerElement.classList.add("ui-switch--foco");
710
+ });
711
+ a(this, "handleBlur", () => {
712
+ this.containerElement.classList.remove("ui-switch--foco");
713
+ });
714
+ const t = this.attachShadow({ mode: "open" });
715
+ t.innerHTML = `
716
+ <style>${R}</style>
717
+ <div class="ui-switch" part="base" tabindex="0" role="switch" aria-checked="false">
718
+ <span class="ui-switch__track" part="controle">
719
+ <span class="ui-switch__thumb" part="indicador"></span>
720
+ </span>
721
+ <span class="ui-switch__label" part="rotulo" style="display: none;"></span>
722
+ </div>
723
+ `, this.containerElement = t.querySelector(".ui-switch"), this.labelElement = t.querySelector(".ui-switch__label"), this.labelId = m("ui-switch-label"), this.labelElement.id = this.labelId;
724
+ }
725
+ static get observedAttributes() {
726
+ return [
727
+ "ativo",
728
+ "ligado",
729
+ "checked",
730
+ "disabled",
731
+ "tamanho",
732
+ "size",
733
+ "label",
734
+ "posicao-label",
735
+ "value",
736
+ "name",
737
+ "obrigatorio",
738
+ "required",
739
+ "mensagem-validacao",
740
+ "aria-label"
741
+ ];
742
+ }
743
+ connectedCallback() {
744
+ this.listeners.cleanup(), this.listeners.add(this.containerElement, "click", this.handleClick), this.listeners.add(this.containerElement, "keydown", this.handleKeyDown), this.listeners.add(this.containerElement, "focus", this.handleFocus), this.listeners.add(this.containerElement, "blur", this.handleBlur), this.listeners.add(this, "click", this.handleHostClick), this._defaultChecked = this.hasAttribute("ativo") || this.hasAttribute("ligado") || this.hasAttribute("checked"), this.syncState();
745
+ }
746
+ disconnectedCallback() {
747
+ this.listeners.cleanup();
748
+ }
749
+ attributeChangedCallback(t, e, s) {
750
+ this.syncState();
751
+ }
752
+ get ativo() {
753
+ return this.hasAttribute("ativo") || this.hasAttribute("ligado") || this.hasAttribute("checked");
754
+ }
755
+ set ativo(t) {
756
+ t ? this.setAttribute("ativo", "") : (this.removeAttribute("ativo"), this.removeAttribute("ligado"), this.removeAttribute("checked")), this.syncState();
757
+ }
758
+ get checked() {
759
+ return this.ativo;
760
+ }
761
+ set checked(t) {
762
+ this.ativo = t;
763
+ }
764
+ get value() {
765
+ return this.getAttribute("value") || "on";
766
+ }
767
+ set value(t) {
768
+ this.setAttribute("value", t), this.syncState();
769
+ }
770
+ get name() {
771
+ return this.getAttribute("name") || "";
772
+ }
773
+ set name(t) {
774
+ this.setAttribute("name", t), this.syncState();
775
+ }
776
+ get disabled() {
777
+ return this.hasAttribute("disabled") || this._formDisabled;
778
+ }
779
+ set disabled(t) {
780
+ t ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"), this.syncState();
781
+ }
782
+ get type() {
783
+ return "checkbox";
784
+ }
785
+ atualizarValidade() {
786
+ if (!this.internals || typeof this.internals.setValidity != "function") return;
787
+ if (this.disabled) {
788
+ this.internals.setValidity({});
789
+ return;
790
+ }
791
+ if (this._customErrorMessage) {
792
+ this.internals.setValidity({ customError: !0 }, this._customErrorMessage, this.containerElement);
793
+ return;
794
+ }
795
+ if ((this.hasAttribute("obrigatorio") || this.hasAttribute("required")) && !this.ativo) {
796
+ const e = this.getAttribute("mensagem-validacao") || "Ative este interruptor para continuar.";
797
+ this.internals.setValidity({ valueMissing: !0 }, e, this.containerElement);
798
+ return;
799
+ }
800
+ this.internals.setValidity({});
801
+ }
802
+ alternar() {
803
+ this.disabled || (this.ativo = !this.ativo, this.dispatchEvent(
804
+ new CustomEvent("ui-change", {
805
+ detail: {
806
+ ativo: this.ativo,
807
+ value: this.getAttribute("value") || ""
808
+ },
809
+ bubbles: !0,
810
+ composed: !0
811
+ })
812
+ ), this.dispatchEvent(
813
+ new Event("change", {
814
+ bubbles: !0,
815
+ composed: !0
816
+ })
817
+ ));
818
+ }
819
+ syncState() {
820
+ const t = this.ativo, e = this.disabled, s = this.getAttribute("tamanho") || this.getAttribute("size") || "md", r = this.getAttribute("label"), o = this.getAttribute("posicao-label") || "direita";
821
+ if (this.containerElement.setAttribute("aria-checked", String(t)), e ? (this.containerElement.classList.add("ui-switch--disabled"), this.containerElement.setAttribute("tabindex", "-1"), this.containerElement.setAttribute("aria-disabled", "true")) : (this.containerElement.classList.remove("ui-switch--disabled"), this.containerElement.setAttribute("tabindex", "0"), this.containerElement.removeAttribute("aria-disabled")), t ? this.containerElement.classList.add("ui-switch--checked") : this.containerElement.classList.remove("ui-switch--checked"), this.containerElement.classList.remove("ui-switch--sm", "ui-switch--md", "ui-switch--lg"), ["sm", "md", "lg"].includes(s) ? this.containerElement.classList.add(`ui-switch--${s}`) : this.containerElement.classList.add("ui-switch--md"), o === "esquerda" ? this.containerElement.classList.add("ui-switch--label-esquerda") : this.containerElement.classList.remove("ui-switch--label-esquerda"), r)
822
+ this.labelElement.textContent = r, this.labelElement.style.display = "inline", this.containerElement.setAttribute("aria-labelledby", this.labelId), this.containerElement.removeAttribute("aria-label");
823
+ else {
824
+ this.labelElement.style.display = "none", this.containerElement.removeAttribute("aria-labelledby");
825
+ const l = p(this, this.internals);
826
+ l ? this.containerElement.setAttribute("aria-label", l) : this.containerElement.removeAttribute("aria-label");
827
+ }
828
+ t ? this.internals.setFormValue(this.getAttribute("value") || "on") : this.internals.setFormValue(null), this.atualizarValidade();
829
+ }
830
+ // === Ciclo de Vida Form-Associated Custom Elements (W3C FACE) ===
831
+ formResetCallback() {
832
+ this.ativo = this._defaultChecked, this.syncState();
833
+ }
834
+ formStateRestoreCallback(t, e) {
835
+ typeof t == "string" ? this.ativo = t === (this.getAttribute("value") || "on") : typeof t == "boolean" && (this.ativo = t), this.syncState();
836
+ }
837
+ }
838
+ class F extends x {
839
+ }
840
+ h("ui-switch", x);
841
+ h("ui-toggle", F);
842
+ export {
843
+ L as A,
844
+ A as L,
845
+ c as R,
846
+ V as U,
847
+ E as a,
848
+ g as b,
849
+ M as c,
850
+ I as d,
851
+ x as e,
852
+ F as f,
853
+ z as g,
854
+ C as h,
855
+ b as r
856
+ };