@thibezer/ui-components-kit 2.15.0 → 2.17.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 (98) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +1 -1
  3. package/dist/botao.cjs +1 -1
  4. package/dist/botao.js +1 -1
  5. package/dist/camadas.cjs +50 -50
  6. package/dist/camadas.js +381 -373
  7. package/dist/campo-texto.cjs +1 -1
  8. package/dist/campo-texto.js +1 -1
  9. package/dist/canvas.cjs +24 -24
  10. package/dist/canvas.js +757 -751
  11. package/dist/card.cjs +1 -1
  12. package/dist/card.js +1 -1
  13. package/dist/components/ui-avatar/ui-avatar.d.ts +7 -0
  14. package/dist/components/ui-barra-ferramentas/ui-paleta-ferramentas.d.ts +2 -0
  15. package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +7 -0
  16. package/dist/components/ui-mapa/ui-mapa.d.ts +1 -0
  17. package/dist/components/ui-seletor-mapa-base/ui-seletor-mapa-base.d.ts +6 -0
  18. package/dist/components/ui-skeleton/ui-skeleton.d.ts +9 -0
  19. package/dist/components/ui-stat/ui-stat.d.ts +12 -0
  20. package/dist/components/ui-tabela-propriedades/propriedades-dom-utils.d.ts +2 -1
  21. package/dist/components/ui-tabela-propriedades/propriedades-persistencia.d.ts +63 -0
  22. package/dist/components/ui-tabela-propriedades/propriedades-render-arvore.d.ts +1 -0
  23. package/dist/components/ui-tabela-propriedades/tipos.d.ts +16 -0
  24. package/dist/components/ui-tabela-propriedades/ui-tabela-propriedades.d.ts +40 -1
  25. package/dist/core/degrade.d.ts +34 -0
  26. package/dist/core/index.d.ts +1 -0
  27. package/dist/core.cjs +1 -1
  28. package/dist/core.js +33 -24
  29. package/dist/cores.cjs +1 -1
  30. package/dist/cores.js +1 -1
  31. package/dist/custom-elements.json +20565 -19020
  32. package/dist/data.cjs +1 -1
  33. package/dist/data.js +89 -79
  34. package/dist/degrade-CIxvOTUv.cjs +1 -0
  35. package/dist/degrade-gDa5sW__.js +119 -0
  36. package/dist/feedback.cjs +1 -1
  37. package/dist/feedback.js +2 -2
  38. package/dist/forms.cjs +1 -1
  39. package/dist/forms.js +2 -2
  40. package/dist/index.cjs +1 -1
  41. package/dist/index.d.ts +1 -0
  42. package/dist/index.js +215 -196
  43. package/dist/mapa.cjs +1 -1
  44. package/dist/mapa.js +1 -1
  45. package/dist/modal.cjs +1 -1
  46. package/dist/modal.js +1 -1
  47. package/dist/register.cjs +1 -1
  48. package/dist/register.js +11 -11
  49. package/dist/seletor-mapa-base.cjs +10 -10
  50. package/dist/seletor-mapa-base.js +34 -28
  51. package/dist/tabela.cjs +1 -1
  52. package/dist/tabela.js +83 -73
  53. package/dist/tipos-elementos.d.ts +33 -3
  54. package/dist/tipos-vue.d.ts +30 -3
  55. package/dist/tools.cjs +1 -1
  56. package/dist/tools.js +1 -1
  57. package/dist/ui-badge-1UU8vT-b.js +198 -0
  58. package/dist/ui-badge-CKKKPdt8.cjs +28 -0
  59. package/dist/ui-badge-DE58YSBY.cjs +28 -0
  60. package/dist/ui-badge-KgmI3jOD.js +201 -0
  61. package/dist/ui-botao-Dz8YvmiA.cjs +12 -0
  62. package/dist/ui-botao-bU_bf6SU.js +166 -0
  63. package/dist/ui-botao-xTbH5mpH.cjs +12 -0
  64. package/dist/ui-botao-zLkcMMyP.js +168 -0
  65. package/dist/ui-campo-texto-DVU_sWV1.cjs +16 -0
  66. package/dist/ui-campo-texto-Dliyt9qr.cjs +16 -0
  67. package/dist/ui-campo-texto-W5M0gNE4.js +377 -0
  68. package/dist/ui-campo-texto-btevggO3.js +379 -0
  69. package/dist/ui-card-BYyYxxY1.cjs +20 -0
  70. package/dist/ui-card-CojoGXaT.js +144 -0
  71. package/dist/ui-card-DFnRp9bl.js +146 -0
  72. package/dist/ui-card-DrWVJQKw.cjs +20 -0
  73. package/dist/ui-controle-cores-Bq_XUrIQ.cjs +32 -0
  74. package/dist/ui-controle-cores-BtA6yzu3.js +291 -0
  75. package/dist/ui-kit.css +1 -1
  76. package/dist/ui-linha-2kY7TNUJ.cjs +38 -0
  77. package/dist/ui-linha-DAz6DBcl.cjs +38 -0
  78. package/dist/ui-linha-DkxwMhD-.js +749 -0
  79. package/dist/ui-linha-KFF86FW5.js +752 -0
  80. package/dist/ui-modal-4nU-tXjO.cjs +18 -0
  81. package/dist/ui-modal-BrXzVZ65.js +216 -0
  82. package/dist/ui-modal-BwB9fksp.js +214 -0
  83. package/dist/ui-modal-lARKzEVZ.cjs +18 -0
  84. package/dist/ui-paleta-ferramentas-Bu6JaT0s.js +1245 -0
  85. package/dist/ui-paleta-ferramentas-D3Jhwt26.cjs +21 -0
  86. package/dist/ui-skeleton-BLEV6h3k.js +653 -0
  87. package/dist/ui-skeleton-B_XTaGrX.cjs +52 -0
  88. package/dist/ui-skeleton-DEHwpDqa.js +648 -0
  89. package/dist/ui-skeleton-sIphhOSx.cjs +52 -0
  90. package/dist/ui-switch-BXIDwC-Y.cjs +66 -0
  91. package/dist/ui-switch-Ctxk-jKS.js +1212 -0
  92. package/dist/ui-switch-DAIgOhqr.cjs +66 -0
  93. package/dist/ui-switch-_F8yubdX.js +1203 -0
  94. package/dist/ui-tabela-propriedades-2bq2nX-b.js +3202 -0
  95. package/dist/ui-tabela-propriedades-CJyo568n.js +3517 -0
  96. package/dist/ui-tabela-propriedades-CnfW9DZG.cjs +142 -0
  97. package/dist/ui-tabela-propriedades-Wa34hfIr.cjs +142 -0
  98. package/package.json +187 -187
@@ -0,0 +1,142 @@
1
+ "use strict";var Ut=Object.defineProperty;var Wt=(r,t,e)=>t in r?Ut(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var v=(r,t,e)=>Wt(r,typeof t!="symbol"?t+"":t,e);const J=require("./listener-bag-D5omxZ9h.cjs"),R=require("./parts-vQa2873h.cjs"),H=require("./ssr-safe-CiHD1adl.cjs"),I=require("./degrade-CIxvOTUv.cjs"),Xt=require("./svg-seguro-J2RM1Ssf.cjs");class Te{constructor(t){v(this,"autoFetchController",null);v(this,"emVoo",null);this.ctx=t}carregar(t){if(!t)return Promise.resolve(!1);if(this.emVoo&&this.emVoo.url===t&&this.autoFetchController)return this.emVoo.promessa;this.cancelarEmVoo();const e=new AbortController;this.autoFetchController=e;const i=this.executar(t,e);return this.emVoo={url:t,promessa:i},i}emitir(t,e){this.ctx.host.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}erro(t,e,i,o){const a=e instanceof Error?e.message:String(e);console.error("[ui-tabela] Erro ao carregar dados remotos:",e);const n={url:t,erro:a,origem:i};o!==void 0&&(n.status=o),this.emitir("ui-fetch-erro",n)}async executar(t,e){var s,l,u,d;const i=()=>this.autoFetchController===e,o=()=>{this.autoFetchController===e&&(this.autoFetchController=null,this.emVoo=null)};this.ctx.onCarregandoAlterado(!0),this.emitir("ui-fetch-start",{url:t});let a="rede",n;try{const p={...((l=(s=this.ctx).getOpcoes)==null?void 0:l.call(s))??{},signal:e.signal},h=await(((d=(u=this.ctx).getFetcher)==null?void 0:d.call(u))??((g,E)=>fetch(g,E)))(t,p);if(!h.ok)throw a="http",n=h.status,new Error(`HTTP ${h.status}: ${h.statusText}`);a="json";const f=await h.json(),m=Array.isArray(f)?f:(f==null?void 0:f.dados)||(f==null?void 0:f.items)||(f==null?void 0:f.data)||(f==null?void 0:f.rows)||[],b=Array.isArray(m)?m:[];return i()?(a="render",this.ctx.onDadosRecebidos(b),o(),this.ctx.onCarregandoAlterado(!1),this.emitir("ui-fetch-sucesso",{url:t,total:b.length,dados:b}),!0):!1}catch(p){return(p==null?void 0:p.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,p,a,n)),!1)}}abortar(){this.autoFetchController&&(this.cancelarEmVoo(),this.ctx.onCarregandoAlterado(!1))}cancelarEmVoo(){if(this.autoFetchController){const t=this.autoFetchController;this.autoFetchController=null,this.emVoo=null,t.abort()}}}const Kt=["id","_id","codigo","key"];function Gt(r,t){return r!=null&&(r===t||String(r)===String(t))}function ue(r,t){let e=-1;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}function Pe(r,t,e="id",i=!1){if(!r||r.length===0)return-1;if(typeof t=="function")return r.findIndex(t);if(i)return ue(t,r.length);const o=[e,...Kt.filter(a=>a!==e)];for(const a of o){const n=r.findIndex(s=>!!s&&typeof s=="object"&&Gt(s[a],t));if(n!==-1)return n}return ue(t,r.length)}class Re{constructor(t){v(this,"itemSelecionado",null);v(this,"indiceSelecionado",null);this.ctx=t}indiceDoItem(t,e){const i=this.ctx.getChaveId(),o=t.indexOf(e);return o>=0?o:e[i]==null?-1:t.findIndex(a=>(a==null?void 0:a[i])!=null&&String(a[i])===String(e[i]))}getItemSelecionado(){return this.itemSelecionado}setItemSelecionado(t){this.itemSelecionado=t;const e=t?this.indiceDoItem(this.ctx.getDadosExibicao(),t):-1;this.indiceSelecionado=e>=0?e:null,this.atualizarLinhasSelecionadas()}getIndiceSelecionado(){return this.indiceSelecionado}setIndiceSelecionado(t){const e=this.ctx.getDadosExibicao(),i=t!==null&&t>=0&&t<e.length;this.indiceSelecionado=i?t:null,this.itemSelecionado=i?e[t]:null,this.atualizarLinhasSelecionadas()}reconciliar(){const t=this.itemSelecionado;if(!t){this.indiceSelecionado=null;return}const e=this.ctx.getDadosExibicao(),i=this.indiceDoItem(e,t);if(i>=0){this.indiceSelecionado=i,this.substituirReferencia(t,e[i]);return}this.indiceSelecionado=null;const o=this.ctx.getDadosOriginais(),a=this.indiceDoItem(o,t);if(a>=0){this.substituirReferencia(t,o[a]);return}this.itemSelecionado=null,this.ctx.host.dispatchEvent(new CustomEvent("ui-selecao-removida",{bubbles:!0,composed:!0,detail:{item:t}}))}substituirReferencia(t,e){this.itemSelecionado=e,t!==e&&this.ctx.host.dispatchEvent(new CustomEvent("ui-selecao-atualizada",{bubbles:!0,composed:!0,detail:{item:e,anterior:t}}))}limparSelecao(){this.itemSelecionado=null,this.indiceSelecionado=null,this.atualizarLinhasSelecionadas()}isItemSelecionado(t,e){if(this.itemSelecionado){if(this.itemSelecionado===t)return!0;const i=this.ctx.getChaveId();if(t[i]!=null&&this.itemSelecionado[i]!=null)return String(t[i])===String(this.itemSelecionado[i]);if(t.id!=null&&this.itemSelecionado.id!=null)return String(t.id)===String(this.itemSelecionado.id)}return this.indiceSelecionado!==null&&this.indiceSelecionado===e}atualizarLinhasSelecionadas(){const t=this.ctx.getTbody();if(!t)return;const e=this.ctx.getDadosExibicao();t.querySelectorAll("tr:not(.ui-tabela__virtual-spacer)").forEach(o=>{const a=o.getAttribute("data-index"),n=a!==null?parseInt(a,10):-1,s=n>=0?e[n]:null,l=s?this.isItemSelecionado(s,n):!1;o.classList.toggle("ui-tabela__tr--selecionada",l),R.alternarPart(o,"linha-selecionada",l),l?(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"))})}rolarPara(t,e){const i=this.ctx.getDadosExibicao(),o=Pe(i,t,this.ctx.getChaveId(),(e==null?void 0:e.porIndice)===!0);if(o===-1)return!1;if(e!=null&&e.selecionar){const a=i[o];this.itemSelecionado=a,this.indiceSelecionado=o,this.atualizarLinhasSelecionadas(),this.ctx.onLinhaAtiva(o),this.ctx.host.dispatchEvent(new CustomEvent("ui-linha-selecionada",{bubbles:!0,composed:!0,detail:{item:a,indice:o}}))}return this.ctx.onRolarParaIndice(o,(e==null?void 0:e.comportamento)||"smooth")}}function Oe(r,t,e){return r!==e?{idColuna:e,direcao:"asc"}:t==="asc"?{idColuna:e,direcao:"desc"}:t==="desc"?{idColuna:null,direcao:"original"}:{idColuna:e,direcao:"asc"}}const Yt=new Intl.Collator("pt-BR",{numeric:!0,sensitivity:"base"});function ke(r){if(r instanceof Date)return r.getTime();if(typeof r=="number")return r;const t=String(r).trim(),e=/^(\d{1,2})\/(\d{1,2})\/(\d{4})(?:[ T](\d{1,2}):(\d{2}))?$/.exec(t);return e?new Date(+e[3],+e[2]-1,+e[1],+(e[4]??0),+(e[5]??0)).getTime():Date.parse(t)}function Jt(r,t,e){if(e==="data"||!e&&(r instanceof Date||t instanceof Date)){const i=ke(r),o=ke(t);if(!Number.isNaN(i)&&!Number.isNaN(o))return i-o}else if(e==="numero"||!e&&typeof r=="number"&&typeof t=="number"){const i=Number(r),o=Number(t);if(!Number.isNaN(i)&&!Number.isNaN(o))return i-o}else if(e==="booleano"||!e&&typeof r=="boolean"&&typeof t=="boolean")return+!!r-+!!t;return Yt.compare(String(r),String(t))}function Ie(r,t,e,i){if(!t||e==="original")return[...r];const o=e==="desc"?-1:1;return[...r].sort((a,n)=>{const s=a[t],l=n[t],u=s==null,d=l==null;return u||d?u===d?0:u?1:-1:i!=null&&i.comparador?i.comparador(s,l,a,n)*o:s===l?0:Jt(s,l,i==null?void 0:i.tipo)*o})}function G(r){return r.normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase()}class Be{constructor(){v(this,"dadosOriginais",[]);v(this,"dadosExibicao",[]);v(this,"indicePorItem",null);v(this,"colunaOrdenada",null);v(this,"direcaoOrdenacao","original");v(this,"ultimoFiltro","");v(this,"colunasFiltro",[]);v(this,"colunas",[]);v(this,"ordenacaoRemota",!1)}setColunas(t){this.colunas=t,this.colunaOrdenada&&this.aplicarOrdenacao()}setOrdenacaoRemota(t){this.ordenacaoRemota!==t&&(this.ordenacaoRemota=t,this.aplicarOrdenacao())}restaurarOrdenacao(t,e){this.colunaOrdenada=t,this.direcaoOrdenacao=e,this.aplicarOrdenacao()}setColunasFiltro(t){this.colunasFiltro=t,this.ultimoFiltro&&this.aplicarOrdenacao()}getDadosOriginais(){return this.dadosOriginais}setDadosOriginais(t){this.dadosOriginais=Array.isArray(t)?t.filter(e=>e!=null):[],this.indicePorItem=null,this.aplicarOrdenacao()}indiceOriginal(t){this.indicePorItem||(this.indicePorItem=new Map,this.dadosOriginais.forEach((i,o)=>{this.indicePorItem.has(i)||this.indicePorItem.set(i,o)}));const e=this.indicePorItem.get(t);return e!==void 0&&this.dadosOriginais[e]===t?e:this.dadosOriginais.indexOf(t)}getDadosExibicao(){return this.dadosExibicao}getColunaOrdenada(){return this.colunaOrdenada}setColunaOrdenada(t){this.colunaOrdenada=t,t?this.direcaoOrdenacao==="original"&&(this.direcaoOrdenacao="asc"):this.direcaoOrdenacao="original",this.aplicarOrdenacao()}getDirecaoOrdenacao(){return this.direcaoOrdenacao}setDirecaoOrdenacao(t){this.direcaoOrdenacao=t||"original",this.direcaoOrdenacao==="original"&&(this.colunaOrdenada=null),this.aplicarOrdenacao()}alternarOrdenacaoColuna(t){if(!t.ordenavel)return null;const e=Oe(this.colunaOrdenada,this.direcaoOrdenacao,t.id);return this.colunaOrdenada=e.idColuna,this.direcaoOrdenacao=e.direcao,this.aplicarOrdenacao(),e}aplicarOrdenacao(){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;this.dadosExibicao=this.ordenacaoRemota?[...e]:Ie(e,this.colunaOrdenada,this.direcaoOrdenacao,i)}casaFiltro(t,e){return(this.colunasFiltro.length>0?this.colunasFiltro:Object.keys(t)).some(o=>{const a=t[o],n=this.colunas.find(l=>l.id===o);if(n!=null&&n.textoFiltro)try{if(G(String(n.textoFiltro(a,t)??"")).includes(e))return!0}catch{}if(a==null||typeof a=="object"&&!(a instanceof Date))return!1;const s=a instanceof Date?`${a.toISOString()} ${a.toLocaleDateString("pt-BR")}`:String(a);return G(s).includes(e)})}temFiltro(){return this.ultimoFiltro!==""}filtrar(t){this.ultimoFiltro=G((t||"").trim()),this.aplicarOrdenacao()}}const Qt=':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:var(--ui-degrade-interno, var(--ui-tabela-fundo, var(--ui-fundo-superficie, 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:var(--ui-tabela-cabecalho-fundo, var(--ui-fundo-elevado, var(--ui-cor-fundo-elevado, #1a1a1e)))}.ui-tabela th{position:sticky;top:0;z-index:10;padding:10px 16px;background:var(--ui-tabela-cabecalho-fundo, var(--ui-fundo-elevado, 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-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: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: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:var(--ui-tabela-hover, color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 8%, transparent))}}.ui-tabela tbody tr[data-index]:active{background: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: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: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-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:var(--ui-tabela-dialogo-fundo, var(--ui-fundo-elevado, 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}}:host(.degrade),:host(.gradiente),:host([data-degrade]:not([data-degrade="false"])),.ui-tabela-container[data-degrade]:not([data-degrade=false]){--ui-tabela-fundo: var(--ui-gradiente-superficie);--ui-tabela-cabecalho-fundo: var(--ui-gradiente-elevado);--ui-tabela-dialogo-fundo: var(--ui-gradiente-elevado)}';function me(r){return r==null||r===""?"":typeof r=="number"?`${r}px`:r}function ge(r){return r==="centro"||r==="center"?"ui-tabela--alinhar-centro":r==="direita"||r==="right"?"ui-tabela--alinhar-direita":"ui-tabela--alinhar-esquerda"}function be(r){return r==="centro"||r==="center"?"center":r==="direita"||r==="right"?"right":"left"}function pe(r){return r==="compacta"?30:r==="relaxada"?56:42}function Fe(r,t,e,i){r.innerHTML=`<style>${Qt}</style>`;const o=document.createElement("div");o.className="ui-tabela-container",o.setAttribute("part","base"),e&&(o.style.maxHeight=e);const a=document.createElement("div");a.className="ui-tabela__empty",a.setAttribute("part","vazio"),a.style.display="none",a.setAttribute("role","status");const n=document.createElement("div");n.innerHTML=`
2
+ <svg class="ui-tabela__empty-icon" aria-hidden="true" focusable="false" viewBox="0 0 24 24">
3
+ <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"/>
4
+ </svg>`;const s=document.createElement("span");s.className="ui-tabela__empty-text",s.textContent=t,a.appendChild(n),a.appendChild(s);const l=document.createElement("table");l.className="ui-tabela",l.setAttribute("part","tabela"),l.setAttribute("role","grid");const u=document.createElement("colgroup"),d=document.createElement("thead"),p=document.createElement("tbody");l.appendChild(u),l.appendChild(d),l.appendChild(p);const c=document.createElement("div");c.className="ui-tabela__erro",c.setAttribute("part","erro"),c.setAttribute("role","alert"),c.style.display="none";const h=document.createElement("div");h.className="ui-tabela__erro-texto";const f=document.createElement("span");f.className="ui-tabela__erro-mensagem";const m=document.createElement("span");m.className="ui-tabela__erro-detalhe",h.appendChild(f),h.appendChild(m);const b=document.createElement("button");b.type="button",b.className="ui-tabela__erro-acao",b.setAttribute("part","erro-acao"),b.textContent="Tentar novamente",c.appendChild(h),c.appendChild(b);const g=document.createElement("div");g.className="ui-tabela__sr",g.setAttribute("role","status"),g.setAttribute("aria-live","polite"),o.appendChild(c),o.appendChild(l),o.appendChild(a),o.appendChild(g);const E=document.createElement("div");return E.className="ui-tabela__loading",E.setAttribute("part","carregando"),E.setAttribute("role","status"),E.setAttribute("aria-live","polite"),E.style.display=i?"flex":"none",E.innerHTML=`
5
+ <div class="ui-tabela__spinner" aria-hidden="true"></div>
6
+ <span class="ui-tabela__loading-texto">Carregando dados...</span>
7
+ `,o.appendChild(E),r.appendChild(o),{containerElement:o,tableElement:l,theadElement:d,tbodyElement:p,colgroupElement:u,emptyElement:a,loadingElement:E,erroElement:c,anuncioElement:g}}function Ve(r){var a,n;if(!r.theadElement||!r.colgroupElement)return;r.headerListeners.cleanup();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;r.theadElement.innerHTML="",r.colgroupElement.innerHTML="";const o=document.createElement("tr");if(o.setAttribute("aria-rowindex","1"),r.colunas.forEach((s,l)=>{const u=document.createElement("col");s.largura!==void 0&&(u.style.width=r.formatWidth(s.largura)),r.colgroupElement.appendChild(u);const d=document.createElement("th"),p=r.getAlignmentClass(s.alinhamento);if(d.className=p,d.setAttribute("part","celula-cabecalho"),d.scope="col",d.setAttribute("data-coluna",s.id),d.style.textAlign=r.getTextAlign(s.alinhamento),s.largura!==void 0&&(d.style.width=r.formatWidth(s.largura)),s.larguraMinima!==void 0&&(d.style.minWidth=r.formatWidth(s.larguraMinima)),s.larguraMaxima!==void 0){const x=r.formatWidth(s.larguraMaxima);d.style.maxWidth=x,d.style.overflow="hidden",d.style.textOverflow="ellipsis",d.style.whiteSpace="nowrap"}s.tooltip&&(d.title=s.tooltip);const c=!!s.ordenavel&&r.colunaOrdenada===s.id&&r.direcaoOrdenacao!=="original",h=c&&r.direcaoOrdenacao==="desc";if(s.ordenavel){d.classList.add("ui-tabela__th--ordenavel");const x=()=>r.onHeaderClick(s);r.headerListeners.add(d,"click",x),d.setAttribute("aria-sort",c?h?"descending":"ascending":"none")}const f=x=>r.onHeaderContextMenu(x,s,l,d);r.headerListeners.add(d,"contextmenu",f);const m=document.createElement("div");m.className="ui-tabela__header-content";const b=document.createElement("span");if(b.className="ui-tabela__header-text",b.textContent=s.rotulo,m.appendChild(b),s.ordenavel){const x=document.createElement("span");x.className="ui-tabela__sort-icon";const _=c?h?"ui-tabela__sort-arrow--desc":"ui-tabela__sort-arrow--asc":"ui-tabela__sort-arrow--inativo";x.setAttribute("aria-hidden","true"),x.innerHTML=`<svg class="ui-tabela__sort-arrow ${_}" 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>`,m.appendChild(x)}if(s.ordenavel){const x=document.createElement("button");x.type="button",x.className="ui-tabela__ordenar",x.setAttribute("part","ordenar"),x.appendChild(m),d.appendChild(x)}else d.appendChild(m);const g=document.createElement("div");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}`);const E=x=>r.onInitColumnResize(x,s,l,d,g);r.headerListeners.add(g,"mousedown",E);const y=x=>{const _=x;_.pointerType==="mouse"||!_.pointerType||r.onInitColumnResize(_,s,l,d,g)};r.headerListeners.add(g,"pointerdown",y);const A=x=>{var w,z;const _=x,C=_.shiftKey?50:10;if(_.key==="ArrowRight")_.preventDefault(),(w=r.onResizeTeclado)==null||w.call(r,C,s,l,d,u);else if(_.key==="ArrowLeft")_.preventDefault(),(z=r.onResizeTeclado)==null||z.call(r,-C,s,l,d,u);else if(_.key==="Enter"||_.key==="F2"){_.preventDefault();const S=d.getBoundingClientRect();r.onHeaderContextMenu(new MouseEvent("contextmenu",{clientX:S.left,clientY:S.bottom}),s,l,d)}};r.headerListeners.add(g,"keydown",A);const L=x=>{x.stopPropagation(),r.onColumnAutoFit(s,d,u)};r.headerListeners.add(g,"dblclick",L),r.headerListeners.add(g,"click",x=>x.stopPropagation()),d.appendChild(g),o.appendChild(d)}),r.theadElement.appendChild(o),i!==null){const s=Array.from(o.children).find(l=>l.getAttribute("data-coluna")===i);(n=s==null?void 0:s.querySelector(".ui-tabela__ordenar"))==null||n.focus()}}const ie=new WeakMap,ve=new WeakMap;function Q(r){return r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement}function qe(r){return r instanceof HTMLInputElement&&(r.type==="checkbox"||r.type==="radio")?r.checked:r.value}function Zt(r){r.querySelectorAll("input, textarea, select").forEach(t=>{Q(t)&&ve.set(t,qe(t))})}function er(r){try{const t=r;return{inicio:t.selectionStart??null,fim:t.selectionEnd??null}}catch{return{inicio:null,fim:null}}}function tr(r){const e=r.getRootNode().activeElement;if(!e||e===r||!r.contains(e))return null;const i=e.closest("td"),o=i==null?void 0:i.closest("tr");if(!i||!o||o.parentElement!==r||!o.hasAttribute("data-index"))return null;const{inicio:a,fim:n}=er(e),s=Q(e)?ve.get(e):void 0,l=Q(e)?qe(e):void 0,u=s!==void 0&&l!==s;return{digitado:u?l:void 0,valorInicial:u?s:void 0,item:ie.get(o),dataId:o.getAttribute("data-id"),indiceLinha:Number(o.getAttribute("data-index")),indiceColuna:Array.from(o.children).indexOf(i),ordinal:Array.from(i.querySelectorAll("*")).indexOf(e),selecaoInicio:a,selecaoFim:n}}function rr(r,t){const e=Array.from(r.querySelectorAll("tr[data-index]"));if(t.item){const i=e.find(o=>ie.get(o)===t.item);if(i)return i}if(t.dataId!==null){const i=e.find(o=>o.getAttribute("data-id")===t.dataId);if(i)return i}return e.find(i=>Number(i.getAttribute("data-index"))===t.indiceLinha)??null}function ir(r,t){if(!t)return;const e=rr(r,t),i=e==null?void 0:e.children[t.indiceColuna],o=i==null?void 0:i.querySelectorAll("*")[t.ordinal];if(!(!o||typeof o.focus!="function")&&(o.focus({preventScroll:!0}),t.digitado!==void 0&&Q(o)&&ve.get(o)===t.valorInicial&&(typeof t.digitado=="boolean"?o.checked=t.digitado:o.value=t.digitado),t.selecaoInicio!==null&&t.selecaoFim!==null))try{o.setSelectionRange(t.selecaoInicio,t.selecaoFim)}catch{}}const or=["button","input","select","textarea","a","summary","label",'[role="button"]','[role="checkbox"]','[role="switch"]','[role="radio"]','[role="textbox"]','[role="combobox"]','[role="slider"]','[role="spinbutton"]','[role="menuitem"]','[role="tab"]','[role="link"]','[contenteditable]:not([contenteditable="false"])',"[data-prevent-select]"].join(", "),He=new WeakMap;function ar(r,t){for(const e of r.composedPath()){if(e===t)return!1;if(e instanceof Element&&e.matches(or))return!0}return!1}function Z(r,t,e){const i=document.createElement("tr");i.className="ui-tabela__virtual-spacer",i.setAttribute("data-espacador",r),i.setAttribute("aria-hidden","true"),i.style.height=`${t}px`;const o=document.createElement("td");return o.colSpan=e,i.appendChild(o),i}function nr(r,t,e,i){const o=document.createElement("td"),a=r.getAlignmentClass(t.alinhamento);if(o.className=a,o.setAttribute("part","celula"),o.style.textAlign=r.getTextAlign(t.alinhamento),t.larguraMaxima!==void 0){const l=r.formatWidth(t.larguraMaxima);o.style.maxWidth=l,o.style.overflow="hidden",o.style.textOverflow="ellipsis",o.style.whiteSpace="nowrap"}const n=document.createElement("div");n.className="ui-tabela__cell-content",t.larguraMaxima!==void 0&&n.classList.add("ui-tabela__cell-truncate");const s=e[t.id];if(typeof t.render=="function")try{const l=r.indiceOriginal?r.indiceOriginal(e):i,u=t.render(s,e,i,l);u instanceof Node?n.appendChild(u):n.textContent=String(u??"")}catch(l){console.error(`[ui-tabela] Erro no render da coluna "${t.id}" (linha ${i}):`,l),n.textContent=""}else if(s instanceof Node)n.appendChild(s);else{const l=s!=null?String(s):"";n.textContent=l,t.larguraMaxima!==void 0&&!t.tooltip&&(o.title=l)}return o.appendChild(n),Zt(o),o}function $e(r,t,e,i){const o=document.createElement("tr");ie.set(o,t),He.set(o,r.colunas),o.setAttribute("data-index",String(e)),o.setAttribute("part","linha"),o.setAttribute("aria-rowindex",String(e+2)),o.setAttribute("aria-selected","false"),o.tabIndex=e===i?0:-1,e%2===1&&o.classList.add("ui-tabela__tr--par");const a=r.chaveId;return t[a]!==void 0?o.setAttribute("data-id",String(t[a])):t.id!==void 0?o.setAttribute("data-id",String(t.id)):t._id!==void 0&&o.setAttribute("data-id",String(t._id)),r.isItemSelecionado(t,e)&&(o.classList.add("ui-tabela__tr--selecionada"),o.setAttribute("part","linha linha-selecionada"),o.setAttribute("aria-current","true"),o.setAttribute("aria-selected","true"),o.setAttribute("data-selecionada","true")),o.addEventListener("click",n=>{ar(n,o)||r.onLinhaClique(t,e)}),r.colunas.forEach(n=>{o.appendChild(nr(r,n,t,e))}),o}function sr(r,t,e,i,o){t.tabIndex=i===o?0:-1;const a=r.isItemSelecionado(e,i);a!==t.classList.contains("ui-tabela__tr--selecionada")&&(t.classList.toggle("ui-tabela__tr--selecionada",a),R.alternarPart(t,"linha-selecionada",a),t.setAttribute("aria-selected",String(a)),a?(t.setAttribute("aria-current","true"),t.setAttribute("data-selecionada","true")):(t.removeAttribute("aria-current"),t.removeAttribute("data-selecionada")))}function lr(r,t,e,i,o){return e>=i&&e<o&&ie.get(t)===r.dadosExibicao[e]&&He.get(t)===r.colunas}function dr(r,t,e,i,o,a,n){const s=r.dadosExibicao.length,l=r.colunas.length||1,u=new Map;let d=null,p=null;for(const m of Array.from(t.children)){const b=m.getAttribute("data-espacador");if(b==="topo"){d=m;continue}if(b==="base"){p=m;continue}const g=Number(m.getAttribute("data-index"));m.hasAttribute("data-index")&&!u.has(g)&&lr(r,m,g,e,i)?u.set(g,m):m.remove()}const c=a&&e>0?e*o:0;c>0?d?(d.style.height=`${c}px`,d.firstElementChild.colSpan=l):(d=Z("topo",c,l),t.insertBefore(d,t.firstChild)):d&&(d.remove(),d=null);let h=d?d.nextSibling:t.firstChild;for(let m=e;m<i;m++){const b=r.dadosExibicao[m],g=u.get(m);g?(sr(r,g,b,m,n),g===h?h=g.nextSibling:t.insertBefore(g,h)):t.insertBefore($e(r,b,m,n),h)}const f=a&&i<s?(s-i)*o:0;f>0?p?(p.style.height=`${f}px`,p.firstElementChild.colSpan=l,p.nextSibling&&t.appendChild(p)):t.appendChild(Z("base",f,l)):p&&p.remove()}function cr(r,t,e,i,o,a,n){const s=r.dadosExibicao.length,l=r.colunas.length||1;t.innerHTML="";const u=document.createDocumentFragment();a&&e>0&&u.appendChild(Z("topo",e*o,l));for(let d=e;d<i;d++)u.appendChild($e(r,r.dadosExibicao[d],d,n));a&&i<s&&u.appendChild(Z("base",(s-i)*o,l)),t.appendChild(u)}function je(r){if(!r.tbodyElement||!r.tableElement||!r.emptyElement||!r.containerElement)return;if(r.tableElement.setAttribute("aria-colcount",String(r.colunas.length)),!r.dadosExibicao||r.dadosExibicao.length===0){r.tbodyElement.innerHTML="",r.tableElement.setAttribute("aria-rowcount","1"),r.tableElement.style.display=r.colunas.length>0?"table":"none",r.emptyElement.style.display="flex";const h=r.emptyElement.querySelector(".ui-tabela__empty-text"),f=r.filtroAtivo?r.textoSemResultados:r.textoVazio;h&&f!==void 0&&(h.textContent=f);return}r.emptyElement.style.display="none",r.tableElement.style.display="table",r.tableElement.setAttribute("aria-rowcount",String(r.dadosExibicao.length+1));const t=r.dadosExibicao.length,e=r.rowHeight,i=r.virtualizar&&t>30;let o=0,a=t;if(i){const h=r.containerElement.scrollTop,f=r.containerElement.clientHeight||400,m=5;o=Math.max(0,Math.floor(h/e)-m),a=Math.min(t,Math.ceil((h+f)/e)+m)}const n=r.tbodyElement,s=n.getRootNode(),l=s.activeElement,u=l&&l.parentElement===n?l.getAttribute("data-index"):null,d=tr(n),p=r.indiceAtivo??null,c=p!==null&&p>=o&&p<a?p:o;if(r.modo==="rolagem"?dr(r,n,o,a,e,i,c):cr(r,n,o,a,e,i,c),u!==null){const h=n.querySelector(`tr[data-index="${u}"]`);h&&s.activeElement!==h&&h.focus({preventScroll:!0})}else d&&!(l&&l.isConnected)&&ir(n,d)}function Se(r){if(r===void 0)return null;const t=typeof r=="number"?r:parseInt(r,10);return isNaN(t)?null:t}function oe(r,t){const e=Se(r.larguraMinima);let i=Math.max(e??60,t);const o=Se(r.larguraMaxima);return o!==null&&(i=Math.min(o,i)),i}function Ue(r,t,e,i){const o=oe(r,t.offsetWidth+i);return r.largura=`${o}px`,t.style.width=`${o}px`,e&&(e.style.width=`${o}px`),`${o}px`}function We(r){const{evento:t,coluna:e,colIndex:i,thElement:o,resizer:a,colgroupElement:n,onResizeStart:s,onResizeEnd:l,onResizeCancel:u}=r;t.stopPropagation(),t.preventDefault(),s(),a.classList.add("ui-tabela__resizer--ativo");const d=t.pageX,p=o.offsetWidth,c=n==null?void 0:n.children[i],h=t.type==="pointerdown",f=h?t.pointerId:null,m=h?"pointermove":"mousemove",b=h?"pointerup":"mouseup";let g=!1;const E=L=>{const x=L;if(f!==null&&x.pointerId!==f)return;g=!0;const _=oe(e,p+(x.pageX-d));e.largura=`${_}px`,o.style.width=`${_}px`,c&&(c.style.width=`${_}px`)},y=()=>{A(),g?l(String(e.largura)):u==null||u()},A=()=>{a.classList.remove("ui-tabela__resizer--ativo"),window.removeEventListener(m,E),window.removeEventListener(b,y),h&&window.removeEventListener("pointercancel",y)};return window.addEventListener(m,E),window.addEventListener(b,y),h&&window.addEventListener("pointercancel",y),A}const X=20;let ur=0;function Xe(r){var z;const{evento:t,coluna:e,colIndex:i,thElement:o,colgroupElement:a,shadow:n,onResizeEnd:s}=r,l=`ui-tabela-dlg-${++ur}`,u=document.createElement("dialog");u.className="ui-tabela__prompt-dialog",u.setAttribute("part","dialogo"),u.setAttribute("aria-labelledby",`${l}-titulo`);const d=document.createElement("label");d.className="ui-tabela__prompt-title",d.id=`${l}-titulo`,d.htmlFor=`${l}-campo`,d.textContent=`Largura de "${e.rotulo}" (px; vazio = automática)`;const p=document.createElement("input");p.id=`${l}-campo`,p.type="number",p.min=String(X),p.step="1",p.setAttribute("inputmode","numeric"),p.placeholder="auto";const c=e.largura?parseInt(String(e.largura),10):NaN;p.value=Number.isFinite(c)?String(c):"";const h=document.createElement("div");h.className="ui-tabela__prompt-erro",h.id=`${l}-erro`,h.setAttribute("role","alert");const f=document.createElement("div");f.className="ui-tabela__prompt-actions";const m=document.createElement("button");m.type="button",m.textContent="Aplicar";const b=document.createElement("button");b.type="button",b.textContent="Cancelar",f.appendChild(b),f.appendChild(m),u.appendChild(d),u.appendChild(p),u.appendChild(h),u.appendChild(f),n.appendChild(u),typeof u.showModal=="function"?u.showModal():u.setAttribute("open",""),u.style.position="fixed";const g=u.getBoundingClientRect(),E=g.width||240,y=g.height||140,A=Math.max(8,Math.min(t.clientX||0,window.innerWidth-E-8)),L=Math.max(8,Math.min(t.clientY||0,window.innerHeight-y-8));u.style.left=`${A}px`,u.style.top=`${L}px`;let x=!1;const _=()=>{var S;x||(x=!0,u.open&&typeof u.close=="function"&&u.close(),u.remove(),(S=o.querySelector(".ui-tabela__ordenar, .ui-tabela__resizer"))==null||S.focus())},C=S=>{h.textContent=S,p.setAttribute("aria-invalid","true"),p.setAttribute("aria-describedby",h.id),p.focus()},w=()=>{const S=e.largura,Ce=p.value.trim();if(Ce==="")e.largura=void 0,o.style.width="",a!=null&&a.children[i]&&(a.children[i].style.width="");else{const de=Number(Ce);if(!Number.isFinite(de)||de<X){C(`Informe um valor de pelo menos ${X} px, ou deixe vazio para automática.`);return}const ce=Math.round(oe({...e,larguraMinima:e.larguraMinima??X},de));e.largura=`${ce}px`,o.style.width=`${ce}px`,a!=null&&a.children[i]&&(a.children[i].style.width=`${ce}px`)}_(),e.largura!==S&&s(e.largura?String(e.largura):"auto")};m.addEventListener("click",S=>{S.stopPropagation(),w()}),b.addEventListener("click",S=>{S.stopPropagation(),_()}),u.addEventListener("close",_),p.addEventListener("input",()=>{h.textContent="",p.removeAttribute("aria-invalid"),p.removeAttribute("aria-describedby")}),p.addEventListener("keydown",S=>{S.key==="Enter"?(S.preventDefault(),w()):S.key==="Escape"&&(S.preventDefault(),_())}),p.focus(),(z=p.select)==null||z.call(p)}function Ke(r,t,e,i,o,a){return We({evento:r,coluna:t,colIndex:e,thElement:i,resizer:o,colgroupElement:a.colgroupElement,onResizeStart:()=>a.onSetIsResizing(!0),onResizeCancel:()=>{setTimeout(()=>a.onSetIsResizing(!1),50)},onResizeEnd:n=>{setTimeout(()=>a.onSetIsResizing(!1),50),a.host.dispatchEvent(new CustomEvent("ui-column-resize",{detail:{idColuna:t.id,largura:n},bubbles:!0,composed:!0}))}})}function Ge(r,t,e,i,o){r.preventDefault(),r.stopPropagation(),Xe({evento:r,coluna:t,colIndex:e,thElement:i,colgroupElement:o.colgroupElement,shadow:o.shadow,onResizeEnd:a=>{o.host.dispatchEvent(new CustomEvent("ui-column-resize",{detail:{idColuna:t.id,largura:a},bubbles:!0,composed:!0}))}})}function Ye(r,t,e,i,o){const a=Ue(t,e,i,r);o.host.dispatchEvent(new CustomEvent("ui-column-resize",{detail:{idColuna:t.id,largura:a},bubbles:!0,composed:!0}))}function Je(r){Ve({theadElement:r.theadElement,colgroupElement:r.colgroupElement,colunas:r.colunas,colunaOrdenada:r.dadosController.getColunaOrdenada(),direcaoOrdenacao:r.dadosController.getDirecaoOrdenacao(),headerListeners:r.headerListeners,formatWidth:me,getAlignmentClass:ge,getTextAlign:be,onHeaderClick:t=>r.onHeaderClick(t),onHeaderContextMenu:(t,e,i,o)=>{Ge(t,e,i,o,{host:r.host,colgroupElement:r.colgroupElement,shadow:r.shadow,onSetIsResizing:r.onSetIsResizing})},onInitColumnResize:(t,e,i,o,a)=>{const n=Ke(t,e,i,o,a,{host:r.host,colgroupElement:r.colgroupElement,shadow:r.shadow,onSetIsResizing:r.onSetIsResizing});r.onActiveResizeCleanup(n)},onResizeTeclado:(t,e,i,o,a)=>{Ye(t,e,o,a,{host:r.host,colgroupElement:r.colgroupElement,shadow:r.shadow,onSetIsResizing:r.onSetIsResizing})},onColumnAutoFit:(t,e,i)=>{t.largura=void 0,e.style.width="",i.style.width="",r.host.dispatchEvent(new CustomEvent("ui-column-resize",{bubbles:!0,composed:!0,detail:{idColuna:t.id,largura:"auto"}}))}})}function Qe(r){je({tbodyElement:r.tbodyElement,tableElement:r.tableElement,emptyElement:r.emptyElement,containerElement:r.containerElement,dadosExibicao:r.dadosController.getDadosExibicao(),colunas:r.colunas,chaveId:r.chaveId,virtualizar:r.virtualizar,rowHeight:r.rowHeight,indiceAtivo:r.indiceAtivo,filtroAtivo:r.dadosController.temFiltro(),modo:r.modoCorpo,indiceOriginal:t=>r.dadosController.indiceOriginal(t),textoVazio:r.textoVazio,textoSemResultados:r.textoSemResultados,isItemSelecionado:(t,e)=>r.selecaoController.isItemSelecionado(t,e),onLinhaClique:(t,e)=>{r.selecaoController.setItemSelecionado(t),r.host.dispatchEvent(new CustomEvent("ui-linha-clique",{bubbles:!0,composed:!0,detail:{item:t,indice:e}}))},formatWidth:me,getAlignmentClass:ge,getTextAlign:be})}function Ze(r,t){let e=!1;const i=()=>{e||(window.requestAnimationFrame(()=>{try{t()}finally{e=!1}}),e=!0)};return r.addEventListener("scroll",i),i}function et(r,t,e,i){return Fe(r,t,e,i)}function _e(r){const t=r.host.getAttribute("texto-vazio")||r.host.getAttribute("empty-text");t&&r.onTextoVazioAlterado(t);const e=r.host.getAttribute("virtualizar")||r.host.getAttribute("virtualize");e!==null&&r.onVirtualizarAlterado(e!=="false"),r.onSrcLido(r.host.getAttribute("src"));const i=r.host.hasAttribute("carregando")||r.host.hasAttribute("loading");r.onCarregandoAlterado(i),r.loadingElement&&(r.loadingElement.style.display=i?"flex":"none")}function tt(r,t,e){if(_e(e),r==="src"){t&&e.host.isConnected&&e.onCarregarSrc(t);return}if(r==="max-height"&&e.containerElement){e.containerElement.style.maxHeight=t||"";return}if((r==="texto-vazio"||r==="empty-text")&&e.emptyElement){const i=e.emptyElement.querySelector(".ui-tabela__empty-text");i&&t&&(i.textContent=t),e.onRenderBody();return}if(r==="carregando"||r==="loading"){e.loadingElement&&(e.loadingElement.style.display=t!==null?"flex":"none");return}if(!(r==="aria-label"||r==="texto-erro"||r==="texto-carregando")){if(r==="texto-sem-resultados"||r==="densidade"||r==="density"){e.onRenderBody();return}e.onRenderTotal()}}function pr(r,t,e,i){if(r==="Enter"||r===" ")return{tipo:"ativar"};if(!Number.isInteger(t)||!Number.isInteger(e)||e<0)return null;const o=Math.max(1,Math.floor(Number.isFinite(i)?i:1)),a=n=>Math.min(e,Math.max(0,n));switch(r){case"ArrowDown":return{tipo:"mover",indice:a(t+1)};case"ArrowUp":return{tipo:"mover",indice:a(t-1)};case"Home":return{tipo:"mover",indice:0};case"End":return{tipo:"mover",indice:e};case"PageDown":return{tipo:"mover",indice:a(t+o)};case"PageUp":return{tipo:"mover",indice:a(t-o)};default:return null}}const hr="Não foi possível carregar os dados.",fr="Nenhum resultado para o filtro";function mr(r,t,e,i){if(!r)return;if(!t){r.style.display="none";return}const o=r.querySelector(".ui-tabela__erro-mensagem"),a=r.querySelector(".ui-tabela__erro-detalhe");o&&(o.textContent=e||hr),a&&(a.textContent=t.erro||"");const n=r.querySelector(".ui-tabela__erro-acao");n&&(n.style.display=i?"":"none"),r.style.display="flex"}function gr(r,t,e,i){if(!r)return;const o=e?t===0?i:`${t} ${t===1?"registro encontrado":"registros encontrados"}`:"";r.textContent!==o&&(r.textContent=o)}function br({tabela:r,container:t},e,i){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"))))}const vr=800;function ze(r,t,e){const i=r.getBoundingClientRect(),o=t.getBoundingClientRect(),a=i.top+r.clientTop+e,n=i.top+r.clientTop+r.clientHeight;return o.top<a?o.top-a:o.bottom>n?Math.min(o.bottom-n,o.top-a):0}function Le(r,t,e){e==="smooth"&&typeof r.scrollTo=="function"?r.scrollTo({top:t,behavior:"smooth"}):r.scrollTop=t}class _r{constructor(t){v(this,"cancelarCorrecao",null);this.p=t}alturaCabecalho(){var t;return((t=this.p.cabecalho())==null?void 0:t.offsetHeight)??0}linhasPorPagina(){var e;const t=(((e=this.p.container())==null?void 0:e.clientHeight)??0)-this.alturaCabecalho();return Math.max(1,Math.floor(t/this.p.alturaLinha()))}focar(t){const e=this.p.container(),i=this.p.tbody();if(!e||!i)return;this.p.aoLinhaAtiva(t);const o=`tr[data-index="${t}"]`;let a=i.querySelector(o);if(a||(e.scrollTop=Math.max(0,t*this.p.alturaLinha()-e.clientHeight/2),this.p.renderizarCorpo(),a=i.querySelector(o)),!a)return;a.focus({preventScroll:!0});const n=ze(e,a,this.alturaCabecalho());n&&(e.scrollTop+=n)}posicionar(t,e){const i=this.p.container(),o=this.p.tbody();if(!i||!o)return!1;this.cancelar();const a=()=>o.querySelector(`tr[data-index="${t}"]`),n=p=>{const c=a();if(!c)return;const h=ze(i,c,this.alturaCabecalho());h&&Le(i,i.scrollTop+h,p)};if(a())return n(e),!0;const s=()=>{i.scrollTop=Math.max(0,t*this.p.alturaLinha()),this.p.renderizarCorpo(),n("auto"),this.p.renderizarCorpo()};if(e==="auto")return s(),!0;Le(i,Math.max(0,t*this.p.alturaLinha()),"smooth");let l=!0;const u=()=>{l&&(this.cancelar(),this.p.renderizarCorpo(),a()?n("smooth"):s())},d=window.setTimeout(u,vr);return i.addEventListener("scrollend",u,{once:!0}),this.cancelarCorrecao=()=>{l=!1,window.clearTimeout(d),i.removeEventListener("scrollend",u),this.cancelarCorrecao=null},!0}cancelar(){var t;(t=this.cancelarCorrecao)==null||t.call(this)}}class rt extends H.SafeHTMLElement{constructor(){super();v(this,"shadow");v(this,"_colunas",[]);v(this,"_textoVazio","Nenhum registro encontrado");v(this,"_virtualizar",!0);v(this,"_isResizing",!1);v(this,"_carregando",!1);v(this,"_src",null);v(this,"_fetchOpcoes",null);v(this,"_fetcher",null);v(this,"_containerElement",null);v(this,"_tableElement",null);v(this,"_theadElement",null);v(this,"_tbodyElement",null);v(this,"_colgroupElement",null);v(this,"_emptyElement",null);v(this,"_loadingElement",null);v(this,"_erroElement",null);v(this,"_anuncioElement",null);v(this,"_erro",null);v(this,"_scrollHandler",null);v(this,"_activeResizeCleanup",null);v(this,"_headerListeners",new J.ListenerBag);v(this,"_corpoListeners",new J.ListenerBag);v(this,"_indiceAtivo",null);v(this,"_alturaLinhaMedida",null);v(this,"rolagem",new _r({container:()=>this._containerElement,tbody:()=>this._tbodyElement,cabecalho:()=>this._theadElement,alturaLinha:()=>this.getRowHeight(),renderizarCorpo:()=>this.renderBody("rolagem"),aoLinhaAtiva:e=>{this._indiceAtivo=e}}));v(this,"remotaController");v(this,"selecaoController");v(this,"dadosController",new Be);v(this,"handleFocoLinha",e=>{const i=e.target;i.parentElement!==this._tbodyElement||!i.hasAttribute("data-index")||this.definirLinhaAtiva(Number(i.getAttribute("data-index")))});v(this,"handleTecladoCorpo",e=>{const i=e.target;if(i.parentElement!==this._tbodyElement||!i.hasAttribute("data-index"))return;const o=this.dadosController.getDadosExibicao().length-1,a=pr(e.key,Number(i.getAttribute("data-index")),o,this.rolagem.linhasPorPagina());a&&(e.preventDefault(),a.tipo==="ativar"?i.click():this.rolagem.focar(a.indice))});this.shadow=this.attachShadow({mode:"open"}),this.remotaController=new Te({host:this,onCarregandoAlterado:e=>{this.carregando=e},onDadosRecebidos:e=>{this.dados=e},getOpcoes:()=>this._fetchOpcoes,getFetcher:()=>this._fetcher}),this.selecaoController=new Re({host:this,getTbody:()=>this._tbodyElement,getDadosExibicao:()=>this.dadosController.getDadosExibicao(),getDadosOriginais:()=>this.dadosController.getDadosOriginais(),getChaveId:()=>this.chaveId,onRolarParaIndice:(e,i)=>this.rolagem.posicionar(e,i),onLinhaAtiva:e=>this.definirLinhaAtiva(e)}),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))}static get observedAttributes(){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",...I.ATRIBUTOS_DEGRADE]}connectedCallback(){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)}disconnectedCallback(){this.cleanupEventListeners()}attributeChangedCallback(e,i,o){if(I.ehAtributoDegrade(e)){I.aplicarDegradeNoElemento(this,this._containerElement);return}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(),tt(e,o,this.obterContextoAtributos()),this.sincronizarAria()}sincronizarAria(){this._tableElement&&(br({tabela:this._tableElement,container:this._containerElement},this.getAttribute("aria-label"),this._carregando),this.atualizarTextosEstado())}atualizarTextosEstado(){var i;const e=(i=this._loadingElement)==null?void 0:i.querySelector(".ui-tabela__loading-texto");e&&(e.textContent=this.getAttribute("texto-carregando")||"Carregando dados..."),this.renderizarErro()}mostrarErro(e){this._erro=e,this.renderizarErro()}renderizarErro(){mr(this._erroElement,this._erro,this.getAttribute("texto-erro"),!!this._src)}anunciarResultado(){gr(this._anuncioElement,this.dadosController.getDadosExibicao().length,this.dadosController.temFiltro(),this._textoSemResultados())}_textoSemResultados(){return this.getAttribute("texto-sem-resultados")||fr}syncAttributes(){_e(this.obterContextoAtributos())}obterContextoAtributos(){return{host:this,containerElement:this._containerElement,emptyElement:this._emptyElement,loadingElement:this._loadingElement,onTextoVazioAlterado:e=>{this._textoVazio=e},onVirtualizarAlterado:e=>{this._virtualizar=e},onSrcLido:e=>{this._src=e},onCarregarSrc:e=>{this.remotaController.carregar(e)},onCarregandoAlterado:e=>{this._carregando=e},onRenderBody:()=>this.renderBody(),onRenderTotal:()=>this.renderTotal()}}get src(){return this._src}set src(e){this._src=e,e?this.setAttribute("src",e):this.removeAttribute("src")}get carregando(){return this._carregando}set carregando(e){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()}get fetchOpcoes(){return this._fetchOpcoes}set fetchOpcoes(e){this._fetchOpcoes=e??null}get fetcher(){return this._fetcher}set fetcher(e){this._fetcher=typeof e=="function"?e:null}get ordenacaoRemota(){return this.hasAttribute("ordenacao-remota")}set ordenacaoRemota(e){this.toggleAttribute("ordenacao-remota",!!e)}async carregarDoEndpoint(e){return e&&e!==this._src&&(this.src=e),this.remotaController.carregar(e||this._src||"")}async recarregar(){return this._src?this.remotaController.carregar(this._src):(this.dadosController.aplicarOrdenacao(),this.atualizarContextoSelecao(),this.renderBody(),!0)}filtrar(e){this.dadosController.filtrar(e),this.atualizarContextoSelecao(),this.renderBody()}cleanupEventListeners(){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()}get colunas(){return this._colunas}set colunas(e){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()}get dados(){return this.dadosController.getDadosOriginais()}set dados(e){this.dadosController.setDadosOriginais(e),this.atualizarContextoSelecao(),this.renderBody()}get itens(){return this.dados}set itens(e){this.dados=e}get chaveId(){return this.getAttribute("chave-id")||this.getAttribute("id-key")||"id"}set chaveId(e){e?this.setAttribute("chave-id",e):(this.removeAttribute("chave-id"),this.removeAttribute("id-key")),this.atualizarContextoSelecao()}get itemSelecionado(){return this.selecaoController.getItemSelecionado()}set itemSelecionado(e){this.selecaoController.setItemSelecionado(e)}get indiceSelecionado(){return this.selecaoController.getIndiceSelecionado()}set indiceSelecionado(e){this.selecaoController.setIndiceSelecionado(e)}limparSelecao(){this.selecaoController.limparSelecao()}get densidade(){const e=this.getAttribute("densidade")||this.getAttribute("density");return e==="compacta"||e==="compact"?"compacta":e==="relaxada"||e==="relaxed"?"relaxada":"normal"}set densidade(e){e?this.setAttribute("densidade",e):(this.removeAttribute("densidade"),this.removeAttribute("density")),this.renderBody()}get virtualizar(){return this._virtualizar}set virtualizar(e){this._virtualizar=!!e,e?this.setAttribute("virtualizar","true"):this.removeAttribute("virtualizar"),this.renderTotal()}get colunaOrdenada(){return this.dadosController.getColunaOrdenada()}set colunaOrdenada(e){this.dadosController.setColunaOrdenada(e),this.atualizarContextoSelecao(),this.renderHeader(),this.renderBody()}get direcaoOrdenacao(){return this.dadosController.getDirecaoOrdenacao()}set direcaoOrdenacao(e){this.dadosController.setDirecaoOrdenacao(e),this.atualizarContextoSelecao(),this.renderHeader(),this.renderBody()}get textoVazio(){return this._textoVazio}set textoVazio(e){this._textoVazio=e||"Nenhum registro encontrado",this.renderTotal()}handleHeaderClick(e){if(!e.ordenavel||this._isResizing)return;const i=this.dadosController.getColunaOrdenada(),o=this.dadosController.getDirecaoOrdenacao(),a=this.dadosController.alternarOrdenacaoColuna(e);if(!a)return;this.atualizarContextoSelecao(),this.renderHeader(),this.renderBody();const n=new CustomEvent("ui-sort",{detail:a,bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(n),n.defaultPrevented&&(this.dadosController.restaurarOrdenacao(i,o),this.atualizarContextoSelecao(),this.renderHeader(),this.renderBody())}get alturaLinha(){const e=this.getAttribute("altura-linha")??this.getAttribute("row-height"),i=e===null?NaN:parseFloat(e);return Number.isFinite(i)&&i>0?i:null}set alturaLinha(e){e&&e>0?this.setAttribute("altura-linha",String(e)):(this.removeAttribute("altura-linha"),this.removeAttribute("row-height"))}aplicarAlturaLinha(){const e=this.alturaLinha;e?this.style.setProperty("--ui-tabela-altura-linha",`${e}px`):this.style.removeProperty("--ui-tabela-altura-linha"),this.renderBody()}getRowHeight(){return this.alturaLinha??this._alturaLinhaMedida??pe(this.densidade)}medirAlturaLinha(){if(this._alturaLinhaMedida!==null||!this._tbodyElement)return;const e=this._tbodyElement.querySelectorAll("tr[data-index]");if(e.length===0)return;let i=0;e.forEach(a=>{i+=a.getBoundingClientRect().height});const o=i/e.length;o<=0||(this._alturaLinhaMedida=o,Math.abs(o-pe(this.densidade))>.5&&this.renderBody())}atualizarContextoSelecao(){this.selecaoController.reconciliar(),this._indiceAtivo=this.selecaoController.getIndiceSelecionado()}renderTotal(){var e;if(this.shadow){if(this._containerElement){if(this._containerElement.style.maxHeight=this.getAttribute("max-height")||"",this._emptyElement){const i=this._emptyElement.querySelector(".ui-tabela__empty-text");i&&(i.textContent=this._textoVazio)}}else{this.cleanupEventListeners();const i=et(this.shadow,this._textoVazio,this.getAttribute("max-height"),this._carregando);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",()=>{this.recarregar()})}I.aplicarDegradeNoElemento(this,this._containerElement),this.renderHeader(),this.renderBody(),this._virtualizar&&this._containerElement&&!this._scrollHandler&&(this._scrollHandler=Ze(this._containerElement,()=>this.renderBody("rolagem"))),this._tbodyElement&&this._corpoListeners.size===0&&(this._corpoListeners.add(this._tbodyElement,"keydown",this.handleTecladoCorpo),this._corpoListeners.add(this._tbodyElement,"focusin",this.handleFocoLinha)),this.sincronizarAria()}}definirLinhaAtiva(e){this._indiceAtivo=e;const i=this._tbodyElement,o=i==null?void 0:i.querySelector(`tr[data-index="${e}"]`);!i||!o||(i.querySelectorAll('tr[tabindex="0"]').forEach(a=>{a!==o&&(a.tabIndex=-1)}),o.tabIndex=0)}obterContextoRenderizador(e="completo"){return{modoCorpo:e,host:this,shadow:this.shadow,theadElement:this._theadElement,colgroupElement:this._colgroupElement,tbodyElement:this._tbodyElement,tableElement:this._tableElement,emptyElement:this._emptyElement,containerElement:this._containerElement,colunas:this._colunas,dadosController:this.dadosController,selecaoController:this.selecaoController,chaveId:this.chaveId,virtualizar:this._virtualizar,rowHeight:this.getRowHeight(),indiceAtivo:this._indiceAtivo,textoVazio:this._textoVazio,textoSemResultados:this._textoSemResultados(),headerListeners:this._headerListeners,onSetIsResizing:i=>{this._isResizing=i},onActiveResizeCleanup:i=>{this._activeResizeCleanup=i},onHeaderClick:i=>this.handleHeaderClick(i)}}renderHeader(){Je(this.obterContextoRenderizador())}renderBody(e="completo"){Qe(this.obterContextoRenderizador(e)),this.anunciarResultado(),this.medirAlturaLinha()}rolarPara(e,i){return this.selecaoController.rolarPara(e,i)}rolarParaIndice(e,i){return this.selecaoController.rolarPara(e,{...i,porIndice:!0})}}H.definirCustomElement("ui-tabela",rt);const T=Math.PI/180,Me=64;function P(r){return Math.abs(r)<1e-12?0:Number(r.toPrecision(15))}const xr={sqrt:Math.sqrt,abs:Math.abs,round:Math.round,floor:Math.floor,ceil:Math.ceil,trunc:Math.trunc,sign:Math.sign,log:Math.log10,ln:Math.log,deg:r=>P(r/T),rad:r=>P(r*T),sin:r=>P(Math.sin(r*T)),cos:r=>P(Math.cos(r*T)),tan:r=>P(Math.tan(r*T)),asin:r=>P(Math.asin(r)/T),acos:r=>P(Math.acos(r)/T),atan:r=>P(Math.atan(r)/T)},Er={min:r=>r.length>0?Math.min(...r):NaN,max:r=>r.length>0?Math.max(...r):NaN,pow:r=>r.length===2?Math.pow(r[0],r[1]):NaN,hypot:r=>r.length>=2?Math.hypot(...r):NaN,atan2:r=>r.length===2?P(Math.atan2(r[0],r[1])/T):NaN,mod:r=>r.length===2&&r[1]!==0?r[0]%r[1]:NaN};function it(r){if(!r||typeof r!="string")return null;let t=r.trim();if(t.startsWith("=")&&(t=t.slice(1).trim()),!t)return null;t=t.replace(/(\d),(\d)/g,"$1.$2");let e=0,i=0,o=!1;function a(){return t[e]||""}function n(){return t[e++]||""}function s(){for(;e<t.length&&/\s/.test(t[e]);)e++}function l(){if(++i>Me)throw new Error("Profundidade máxima excedida");try{s();let c=u();for(s();e<t.length;){const h=a();if(h==="+"||h==="-"){n(),s();const f=u(),m=o;s(),m?c=h==="+"?c+c*f:c-c*f:c=h==="+"?c+f:c-f,o=!1}else break}return c}finally{i--}}function u(){s();let c=d(),h=o;for(s();e<t.length;){const f=a();if(f==="*"||f==="/"||f==="x"||f==="X"){n(),s();const m=d();if(h=!1,f==="/"&&m===0)throw new Error("Divisão por zero");c=f==="/"?c/m:c*m,s()}else break}return o=h,c}function d(){if(++i>Me)throw new Error("Profundidade máxima excedida");try{s();const c=a();if(c==="+"||c==="-"){n();const m=d();return c==="-"?-m:m}let h=p();const f=o;if(s(),a()==="^"){n();const m=d();h=Math.pow(h,m),o=!1}else if(t.slice(e,e+2)==="**"){e+=2;const m=d();h=Math.pow(h,m),o=!1}else o=f;return h}finally{i--}}function p(){s(),o=!1;const c=a();if(c==="+"||c==="-"){n();const b=p();return c==="-"?-b:b}if(c==="("){n();const b=l();if(s(),n()!==")")throw new Error("Parêntese sem fechamento");return s(),a()==="%"?(n(),o=!0,b/100):(o=!1,b)}const h=t.slice(e).match(/^([a-zA-Z_]\w*)\s*\(/);if(h){const b=h[1].toLowerCase(),g=xr[b],E=Er[b];if(!g&&!E)throw new Error("Função desconhecida: "+h[1]);e+=h[0].length;const y=[l()];for(s();a()===";"||a()===",";)n(),s(),y.push(l()),s();if(n()!==")")throw new Error("Parêntese sem fechamento");const A=E?E(y):y.length===1&&g?g(y[0]):NaN;if(isNaN(A))throw new Error("Resultado inválido de função");return s(),a()==="%"?(n(),o=!0,A/100):(o=!1,A)}const f=t.slice(e).match(/^(pi|π|e)\b/i);if(f){e+=f[0].length;let g=f[1].toLowerCase()==="e"?Math.E:Math.PI;return s(),a()==="%"&&(n(),o=!0,g=g/100),g}const m=t.slice(e).match(/^(?:[0-9]+(?:\.[0-9]+)?|\.[0-9]+|,[0-9]+)(?:[eE][+-]?[0-9]+)?/);if(m){e+=m[0].length;let b=parseFloat(m[0].replace(",","."));return s(),a()==="%"&&(n(),o=!0,b=b/100),b}throw new Error("Caractere inválido: "+c)}try{const c=l();return s(),e<t.length?null:typeof c=="number"&&isFinite(c)?c:null}catch{return null}}const yr="ui_tabela_propriedades_estado_",ee=new Set(["__proto__","constructor","prototype"]);function Ne(r){return!!r&&typeof r=="object"&&!Array.isArray(r)}function xe(){if(typeof window>"u")return null;try{return typeof localStorage<"u"?localStorage:null}catch{return null}}function $(r,t){const e=typeof r=="string"?r.trim():"",i=typeof t=="string"?t.trim():"";return`${yr}${e||i||"default"}`}function ot(r){if(!Ne(r))return null;const t={};if(Ne(r.categorias))for(const[o,a]of Object.entries(r.categorias))!o||ee.has(o)||typeof a=="boolean"&&(t[o]=a);const e=typeof r.versao=="number"&&Number.isFinite(r.versao)?r.versao:1,i=typeof r.ultimaAtualizacao=="number"&&Number.isFinite(r.ultimaAtualizacao)?r.ultimaAtualizacao:void 0;return i!==void 0?{versao:e,categorias:t,ultimaAtualizacao:i}:{versao:e,categorias:t}}function at(r){const t=xe();if(!t)return null;try{const e=t.getItem(r);return e?ot(JSON.parse(e)):null}catch(e){return console.warn(`[ui-tabela-propriedades] Não foi possível carregar o estado persistido (${r}):`,e),null}}function nt(r,t){const e=xe();if(e)try{e.setItem(r,JSON.stringify(t))}catch(i){console.warn(`[ui-tabela-propriedades] Não foi possível salvar o estado persistido (${r}):`,i)}}function st(r){const t=xe();if(t)try{t.removeItem(r)}catch{}}function M(r){if(!r||typeof r!="object")return null;const t=r.id;if(t==null)return null;const e=String(t);return!e||ee.has(e)?null:e}function te(r){return r.aberto!==void 0?r.aberto!==!1:r.aberta!==!1}function V(r,t){if(!(!r||typeof r!="object"||Object.isFrozen(r)))try{r.aberto=t,"aberta"in r&&(r.aberta=t)}catch{}}class lt{constructor(t){v(this,"preferencias",new Map);v(this,"origensAberto",new Map);v(this,"ultimaChaveCarregada",null);this.getContexto=t}chaveAtual(){const t=this.getContexto();return $(t.storageKey,t.id)}carregarDoStorage(t=!1){const e=this.getContexto(),i=$(e.storageKey,e.id);if(t&&this.preferencias.clear(),this.ultimaChaveCarregada=i,!e.persistir)return!1;const o=at(i);if(!o)return!1;for(const[a,n]of Object.entries(o.categorias))(t||!this.preferencias.has(a))&&this.preferencias.set(a,n);return!0}sincronizarSeChaveMudou(){const t=this.getContexto();if(!t.conectado||!t.persistir)return!1;const e=$(t.storageKey,t.id);return this.ultimaChaveCarregada===null?this.carregarDoStorage(!1):e!==this.ultimaChaveCarregada?this.carregarDoStorage(!0):!1}registrarOrigens(t){if(this.origensAberto.clear(),!!Array.isArray(t))for(const e of t){const i=M(e);i!==null&&this.origensAberto.set(i,te(e))}}aplicarEmCategorias(t){if(Array.isArray(t))for(const e of t){const i=M(e);i!==null&&this.preferencias.has(i)&&V(e,this.preferencias.get(i))}}restaurarOrigensEmCategorias(t){if(Array.isArray(t))for(const e of t){const i=M(e);i!==null&&this.origensAberto.has(i)&&V(e,this.origensAberto.get(i))}}estaAberta(t){if(!t||typeof t!="object")return!0;const e=M(t);return e!==null&&this.preferencias.has(e)?this.preferencias.get(e):te(t)}registrar(t,e,i=!0){!t||ee.has(t)||(this.preferencias.set(t,!!e),i&&this.salvar())}registrarVarias(t,e=!0){let i=!1;for(const[o,a]of t)!o||ee.has(o)||(this.preferencias.set(o,!!a),i=!0);i&&e&&this.salvar()}salvar(){const t=this.getContexto();if(!t.persistir||!t.conectado)return;const e=$(t.storageKey,t.id);if(this.ultimaChaveCarregada=e,this.preferencias.size===0)return;const i={};for(const[o,a]of this.preferencias.entries())i[o]=a;nt(e,{versao:1,categorias:i,ultimaAtualizacao:Date.now()})}limpar(t){this.preferencias.clear(),t&&this.restaurarOrigensEmCategorias(t),st(this.chaveAtual())}obterEstado(t){const e={};for(const[i,o]of this.preferencias.entries())e[i]=o;if(Array.isArray(t))for(const i of t){const o=M(i);o!==null&&!(o in e)&&(e[o]=this.estaAberta(i))}return e}montarDetalheEvento(t){const e=this.obterEstado(t),i=[],o=[];for(const[a,n]of Object.entries(e))n?i.push(a):o.push(a);return{estado:e,abertas:i,fechadas:o}}}const Ee='.ui-prop__categoria--aberta .ui-prop__linha input:not([disabled]):not([type="color"]):not(.ui-prop__cor-picker-oculto), .ui-prop__categoria--aberta .ui-prop__linha select:not([disabled]), .ui-prop__categoria--aberta .ui-prop__linha .ui-prop__btn-acao-inline:not([disabled]), .ui-prop__categoria--aberta .ui-prop__linha .ui-prop__editor-booleano, .ui-prop__categoria--aberta .ui-prop__linha .ui-prop__editor-cor-container';function ye(r,t){if(!r)return null;const e=String(t);return Array.from(r.querySelectorAll("[data-prop-id]")).find(i=>i.getAttribute("data-prop-id")===e)??null}const dt=new WeakMap;function N(r,t){dt.set(r,t)}function he(r,t,e){var a,n;const i=ye(r,t),o=(a=i==null?void 0:i.querySelector(".ui-prop__col-valor"))==null?void 0:a.firstElementChild;o&&((n=dt.get(o))==null||n(e))}function j(r,t,e=(o,a)=>o===String(a),i=o=>o==null||o===""?"—":String(o)){var n;(n=r.querySelector("option[data-externa]"))==null||n.remove();const o=Array.from(r.options).find(s=>!s.hasAttribute("data-acao")&&e(s.value,t));if(o){o.selected=!0;return}const a=document.createElement("option");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}function U(r,t){var i;(i=r.querySelector("option[data-externa]"))==null||i.remove();const e=document.createElement("option");e.value="",e.textContent=t,e.setAttribute("data-externa",""),e.setAttribute("data-misto",""),e.hidden=!0,e.disabled=!0,r.insertBefore(e,r.firstChild),e.selected=!0}function ct(r,t){const e=Array.from(r.querySelectorAll(Ee)),i=e.indexOf(t);if(i!==-1&&i+1<e.length){const o=e[i+1];o.focus(),o instanceof HTMLInputElement&&o.select()}}function ut(r,t){const e=Array.from(r.querySelectorAll(Ee)),i=e.indexOf(t);if(i>0){const o=e[i-1];o.focus(),o instanceof HTMLInputElement&&o.select()}}function pt(r){const t=r.querySelector(Ee);t&&(t.focus(),t instanceof HTMLInputElement&&t.select())}function ae(r,t){var e;r.classList.toggle("ui-prop__categoria--aberta",t),R.alternarPart(r,"categoria-aberta",t),(e=r.querySelector(".ui-prop__categoria-header"))==null||e.setAttribute("aria-expanded",String(t))}function ht(r,t,e){const i=new Map;r.querySelectorAll(".ui-prop__categoria[data-cat-id]").forEach(o=>{const a=o.getAttribute("data-cat-id");a!==null&&i.set(a,o)}),(Array.isArray(t)?t:[]).forEach(o=>{const a=M(o);if(a===null)return;const n=e(o),s=i.get(a);s&&ae(s,n)})}function ft(r,t){(Array.isArray(t)?t:[]).forEach(e=>{V(e,!0)}),r.querySelectorAll(".ui-prop__categoria").forEach(e=>ae(e,!0))}function mt(r,t){(Array.isArray(t)?t:[]).forEach(e=>{V(e,!1)}),r.querySelectorAll(".ui-prop__categoria").forEach(e=>ae(e,!1))}function gt(r,t,e,i,o){const a=(Array.isArray(e)?e:[]).find(u=>u&&typeof u=="object"&&String(u.id)===String(i));if(!a)return;const n=Array.from(r.querySelectorAll("[data-cat-id]")).find(u=>u.getAttribute("data-cat-id")===String(i)),l=!(o!==void 0?o:n?n.classList.contains("ui-prop__categoria--aberta"):te(a));return V(a,l),n&&ae(n,l),t.dispatchEvent(new CustomEvent("ui-categoria-toggle",{bubbles:!0,composed:!0,detail:{id:i,aberto:l}})),l}const ne=Symbol.for("ui-tabela-propriedades:misto"),se="Varia";function k(r){return r===ne}function D(r){var e;let t;try{t=(e=r.obterTextoMisto)==null?void 0:e.call(r)}catch{}return typeof t=="string"&&t.trim()?t:se}function F(r,t){return r==null&&t==null?!0:Object.is(r,t)}function re(r){return r.misto?ne:r.valor}function bt(r){if(!Array.isArray(r)||r.length===0)return;const t=r[0];for(let e=1;e<r.length;e++)if(!F(t,r[e]))return ne;return t}function Ar(r){if(!Array.isArray(r))return{};const t=r.filter(o=>o!==null&&typeof o=="object"&&!Array.isArray(o)),e=new Set;t.forEach(o=>Object.keys(o).forEach(a=>e.add(a)));const i={};return e.forEach(o=>{i[o]=bt(t.map(a=>o in a?a[o]:void 0))}),i}function W(r){if(typeof r.casasDecimais=="number"&&r.casasDecimais>=0)return r.casasDecimais;if(typeof r.precisao=="number"&&r.precisao>=0)return r.precisao}function vt(r,t){return typeof r.passo=="number"&&r.passo>0?r.passo:typeof r.step=="number"&&r.step>0?r.step:t!==void 0?Math.pow(10,-t):1}function le(r,t){let e=r;return typeof t.min=="number"&&Number.isFinite(t.min)&&(e=Math.max(t.min,e)),typeof t.max=="number"&&Number.isFinite(t.max)&&(e=Math.min(t.max,e)),e}function Y(r,t){if(typeof r!="string")return null;let e=r.trim();const i=typeof t.unidade=="string"?t.unidade.trim():"";if(i&&e.length>i.length&&e.toLowerCase().endsWith(i.toLowerCase())&&(e=e.slice(0,e.length-i.length).trim()),!e)return null;const o=it(e);if(o===null||!Number.isFinite(o))return null;const a=W(t),n=le(o,t);return Number(a!==void 0?n.toFixed(a):n.toPrecision(15))}function _t(r,t,e,i){r.classList.toggle("ui-prop__editor--misto",e),e?r.placeholder=i:t.placeholder?r.placeholder=t.placeholder:r.removeAttribute("placeholder")}function xt(r,t,e){const i=document.createElement("span"),o=e?W(e):void 0,a=n=>{if(k(n)){i.className="ui-prop__valor-readonly ui-prop__editor--misto",i.textContent=t?D({obterTextoMisto:t}):se;return}if(n==null){i.className="ui-prop__valor-readonly",i.textContent="—";return}if((e==null?void 0:e.tipo)==="booleano"&&typeof n=="boolean"){i.className="ui-prop__valor-readonly",i.textContent=n?"Sim":"Não";return}if(e!=null&&e.opcoes&&e.opcoes.length>0){const l=e.opcoes.find(u=>u&&String(u.id)===String(n));if(l){i.className="ui-prop__valor-readonly",i.textContent=l.rotulo;return}}const s=typeof n=="number"||typeof n=="string"&&/^-?\d+(\.\d+)?$/.test(n.trim());if(i.className=`ui-prop__valor-readonly ${s?"ui-prop__valor-readonly--numero":""}`.trim(),s&&o!==void 0){const l=Number(n);i.textContent=Number.isFinite(l)?l.toFixed(o):String(n)}else i.textContent=String(n)};return a(r),N(i,a),i}function Et(r,t,e,i){const o=document.createElement("label");o.className="ui-prop__editor-booleano",o.setAttribute("role","checkbox"),o.tabIndex=0,o.setAttribute("aria-label",String(t.rotulo??t.id));const a=document.createElement("div");a.className="ui-prop__checkbox-custom";const n=document.createElement("span");n.className="ui-prop__booleano-rotulo";const s=u=>{const d=k(u),p=!d&&!!u;o.classList.toggle("ui-prop__editor--misto",d),a.classList.toggle("ui-prop__checkbox-custom--marcado",p),a.classList.toggle("ui-prop__checkbox-custom--misto",d),a.textContent=d?"–":p?"✓":"",n.textContent=d?D(i):p?"Sim":"Não",o.setAttribute("aria-checked",d?"mixed":String(p))};s(e),N(o,s),o.appendChild(a),o.appendChild(n);const l=()=>{const u=i.obterValorAtual(t.id),d=k(u)?!0:!u;i.registrarAlteracao(r,t.id,d),s(d)};return o.addEventListener("click",u=>{u.preventDefault(),l()}),o.addEventListener("keydown",u=>{u.key===" "?(u.preventDefault(),l()):u.key==="Enter"&&(u.preventDefault(),u.shiftKey&&i.focarEditorAnterior?i.focarEditorAnterior(o):i.focarProximoEditor(o))}),o}function yt(r,t,e,i){const o=document.createElement("select");o.className="ui-prop__editor-select",o.setAttribute("aria-label",String(t.rotulo??t.id)),(Array.isArray(t.opcoes)?t.opcoes:[]).forEach(n=>{if(!n||typeof n!="object")return;const s=document.createElement("option");s.value=String(n.id),s.textContent=String(n.rotulo??n.id),o.appendChild(s)});const a=n=>{o.classList.toggle("ui-prop__editor--misto",k(n)),k(n)?U(o,D(i)):j(o,n)};return a(e),N(o,a),o.addEventListener("change",()=>{const n=(t.opcoes||[]).find(s=>s&&String(s.id)===o.value);i.registrarAlteracao(r,t.id,n?n.id:o.value),a(i.obterValorAtual(t.id))}),o.addEventListener("keydown",n=>{n.key==="Enter"&&(n.shiftKey&&i.focarEditorAnterior?i.focarEditorAnterior(o):i.focarProximoEditor(o))}),o}function At(r,t,e){const i=document.createElement("button");return i.type="button",i.className="ui-prop__btn-acao-inline",i.textContent=t.rotuloAcao||"Editar...",i.addEventListener("click",()=>{typeof t.onClickAcao=="function"&&t.onClickAcao(t),e.despacharEventoAcao(t,r)}),i}function wt(r,t,e,i){const o=document.createElement("input");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",String(t.rotulo??t.id)),t.placeholder&&(o.placeholder=t.placeholder);const a=W(t),n=c=>{if(c==null||c===""||k(c))return"";const h=Number(c);return isNaN(h)?String(c):a!==void 0?h.toFixed(a):String(h)},s=c=>{o.value=n(c),_t(o,t,k(c),D(i))};s(e),N(o,s);let l=null;const u=()=>{o.classList.remove("ui-prop__editor-input--calculando"),o.title="",l&&(l.hidden=!0)},d=c=>{if(!l){if(!o.parentElement)return;l=document.createElement("span"),l.className="ui-prop__previa-calculo",l.setAttribute("aria-hidden","true"),o.parentElement.appendChild(l)}l.textContent=c,l.hidden=!1};o.addEventListener("focus",()=>{o.classList.remove("ui-prop__editor-input--invalido"),o.select()}),o.addEventListener("animationend",()=>o.classList.remove("ui-prop__editor-input--invalido")),o.addEventListener("input",()=>{o.classList.remove("ui-prop__editor-input--invalido");const c=o.value.trim(),f=!/^[+-]?[0-9]*[.,]?[0-9]*$/.test(c)&&(c.startsWith("=")||/[\+\-\*\/\^\%\(\);]|^[a-zA-Z_π]/.test(c));if(o.classList.toggle("ui-prop__editor-input--calculando",f),f){const m=Y(c,t),b=m!==null?`= ${n(m)}`:"= ?";o.title=m!==null?b:"",d(b)}else u()});const p=()=>{u();const c=o.value.trim(),h=i.obterValorAtual(t.id);if(c===n(h))return;if(c===""){if(k(h))return;i.registrarAlteracao(r,t.id,null);return}const f=Y(c,t);f!==null?(i.registrarAlteracao(r,t.id,f),s(i.obterValorAtual(t.id))):(s(h),o.classList.add("ui-prop__editor-input--invalido"))};return o.addEventListener("change",p),o.addEventListener("blur",p),o.addEventListener("keydown",c=>{if(c.key==="Enter")p(),c.shiftKey&&i.focarEditorAnterior?i.focarEditorAnterior(o):i.focarProximoEditor(o);else if(c.key==="Escape")c.preventDefault(),c.stopPropagation(),u(),s(i.obterValorAtual(t.id)),o.blur();else if(c.key==="ArrowUp"||c.key==="ArrowDown"){c.preventDefault(),u();const h=Y(o.value,t),f=i.obterValorAtual(t.id);if(h===null&&k(f))return;const m=h??(Number(f)||0);let b=vt(t,a);c.shiftKey?b*=10:c.altKey&&a===void 0&&(b*=.1);let g=c.key==="ArrowUp"?m+b:m-b;g=le(g,t),a!==void 0?g=Number(g.toFixed(a)):g=Math.round(g*1e4)/1e4,i.registrarAlteracao(r,t.id,g),s(g)}}),o}function Ct(r,t,e,i){const o=document.createElement("input");o.type="text",o.className="ui-prop__editor-input",o.setAttribute("aria-label",String(t.rotulo??t.id)),t.placeholder&&(o.placeholder=t.placeholder);const a=s=>{const l=k(s);o.value=l||s==null?"":String(s),_t(o,t,l,D(i))};a(e),N(o,a),o.addEventListener("focus",()=>{o.select()});const n=()=>{o.value===""&&k(i.obterValorAtual(t.id))||(i.registrarAlteracao(r,t.id,o.value),a(i.obterValorAtual(t.id)))};return o.addEventListener("change",n),o.addEventListener("blur",n),o.addEventListener("keydown",s=>{s.key==="Enter"?(n(),s.shiftKey&&i.focarEditorAnterior?i.focarEditorAnterior(o):i.focarProximoEditor(o)):s.key==="Escape"&&(s.preventDefault(),s.stopPropagation(),a(i.obterValorAtual(t.id)),o.blur())}),o}const kt=(r,t)=>r.toLowerCase()===String(t??"").toLowerCase();function Ae(r,t){(Array.isArray(t)?t:[]).forEach(e=>{if(!e||typeof e!="object")return;const i=document.createElement("option");i.value=String(e.id),i.textContent=String(e.rotulo??e.id),r.appendChild(i)})}function St(r,t,e,i){const o=document.createElement("div");o.className="ui-prop__editor-linha-container";const a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("class","ui-prop__linha-amostra-svg"),a.setAttribute("viewBox","0 0 44 12"),a.setAttribute("aria-hidden","true");const n=document.createElementNS("http://www.w3.org/2000/svg","line");n.setAttribute("x1","0"),n.setAttribute("y1","6"),n.setAttribute("x2","44"),n.setAttribute("y2","6");const s=p=>{const c=String(p||"").toLowerCase();c.includes("center")||c.includes("eixo")||c.includes("dashdot")||c.includes("traço-ponto")?n.setAttribute("stroke-dasharray","8,3,2,3"):c.includes("dash")||c.includes("tracej")||c.includes("hidden")?n.setAttribute("stroke-dasharray","6,3"):c.includes("dot")||c.includes("ponto")||c.includes("pontilh")?n.setAttribute("stroke-dasharray","2,3"):n.setAttribute("stroke-dasharray","none")};a.appendChild(n);const l=document.createElement("select");l.className="ui-prop__linha-select",l.setAttribute("aria-label",String(t.rotulo??t.id));const u=t.opcoes&&t.opcoes.length>0?t.opcoes:[{id:"ByLayer",rotulo:"ByLayer"},{id:"ByBlock",rotulo:"ByBlock"},{id:"Continuous",rotulo:"Continuous"},{id:"Dashed",rotulo:"Dashed"},{id:"Hidden",rotulo:"Hidden"},{id:"Center",rotulo:"Center"},{id:"Dotted",rotulo:"Dotted"}];Ae(l,u);const d=p=>{const c=k(p);if(o.classList.toggle("ui-prop__editor--misto",c),c){s(""),U(l,D(i));return}s(p),j(l,p,kt)};return d(e),N(o,d),l.addEventListener("change",()=>{const p=u.find(c=>c&&String(c.id)===l.value);i.registrarAlteracao(r,t.id,p?p.id:l.value),d(i.obterValorAtual(t.id))}),l.addEventListener("keydown",p=>{p.key==="Enter"&&(p.shiftKey&&i.focarEditorAnterior?i.focarEditorAnterior(l):i.focarProximoEditor(l))}),o.appendChild(a),o.appendChild(l),o}function zt(r,t,e,i){const o=document.createElement("div");o.className="ui-prop__editor-espessura-container";const a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("class","ui-prop__espessura-amostra-svg"),a.setAttribute("viewBox","0 0 38 12"),a.setAttribute("aria-hidden","true");const n=document.createElementNS("http://www.w3.org/2000/svg","line");n.setAttribute("x1","0"),n.setAttribute("y1","6"),n.setAttribute("x2","38"),n.setAttribute("y2","6");const s=p=>{const c=parseFloat(String(p).replace(/[^0-9.]/g,""));return isNaN(c)||c<=0?1.5:Math.min(8,Math.max(1,c*8))};a.appendChild(n);const l=document.createElement("select");l.className="ui-prop__espessura-select",l.setAttribute("aria-label",String(t.rotulo??t.id));const u=t.opcoes&&t.opcoes.length>0?t.opcoes:[{id:"ByLayer",rotulo:"ByLayer"},{id:"ByBlock",rotulo:"ByBlock"},{id:"0.00 mm",rotulo:"0.00 mm"},{id:"0.05 mm",rotulo:"0.05 mm"},{id:"0.09 mm",rotulo:"0.09 mm"},{id:"0.13 mm",rotulo:"0.13 mm"},{id:"0.15 mm",rotulo:"0.15 mm"},{id:"0.18 mm",rotulo:"0.18 mm"},{id:"0.20 mm",rotulo:"0.20 mm"},{id:"0.25 mm",rotulo:"0.25 mm"},{id:"0.30 mm",rotulo:"0.30 mm"},{id:"0.35 mm",rotulo:"0.35 mm"},{id:"0.40 mm",rotulo:"0.40 mm"},{id:"0.50 mm",rotulo:"0.50 mm"},{id:"0.60 mm",rotulo:"0.60 mm"},{id:"0.70 mm",rotulo:"0.70 mm"},{id:"1.00 mm",rotulo:"1.00 mm"},{id:"1.40 mm",rotulo:"1.40 mm"},{id:"2.00 mm",rotulo:"2.00 mm"}];Ae(l,u);const d=p=>{const c=k(p);o.classList.toggle("ui-prop__editor--misto",c),n.setAttribute("stroke-width",String(s(c?"":p))),c?U(l,D(i)):j(l,p,kt)};return d(e),N(o,d),l.addEventListener("change",()=>{const p=u.find(c=>c&&String(c.id)===l.value);i.registrarAlteracao(r,t.id,p?p.id:l.value),d(i.obterValorAtual(t.id))}),l.addEventListener("keydown",p=>{p.key==="Enter"&&(p.shiftKey&&i.focarEditorAnterior?i.focarEditorAnterior(l):i.focarProximoEditor(l))}),o.appendChild(a),o.appendChild(l),o}const we=[{nome:"Red",indice:1,hex:"#ff0000"},{nome:"Yellow",indice:2,hex:"#ffff00"},{nome:"Green",indice:3,hex:"#00ff00"},{nome:"Cyan",indice:4,hex:"#00ffff"},{nome:"Blue",indice:5,hex:"#0000ff"},{nome:"Magenta",indice:6,hex:"#ff00ff"},{nome:"White",indice:7,hex:"#ffffff"}],Lt=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i;function fe(r){const t=String(r??"").trim().toLowerCase(),e=we.find(i=>String(i.indice)===t||i.nome.toLowerCase()===t);return e?e.nome.toLowerCase():t}function wr(r){const t=fe(r),e=we.find(i=>i.nome.toLowerCase()===t);return e?e.hex:Lt.test(t)?t:"#ffffff"}function Mt(r){return r.length===4?"#"+r.slice(1).split("").map(t=>t+t).join(""):r}function Nt(r,t,e,i){const o=document.createElement("div");o.className="ui-prop__editor-cor-cad-container";const a=document.createElement("div");a.className="ui-prop__cor-amostra";const n=document.createElement("select");n.className="ui-prop__cor-cad-select",n.setAttribute("aria-label",String(t.rotulo??t.id)),Ae(n,[{id:"ByLayer",rotulo:"ByLayer"},{id:"ByBlock",rotulo:"ByBlock"},...we.map(d=>({id:d.nome,rotulo:`${d.nome} (${d.indice})`}))]);const s=document.createElement("option");s.value="__escolher",s.textContent="Selecionar cor...",s.setAttribute("data-acao",""),n.appendChild(s);const l=document.createElement("input");l.type="color",l.className="ui-prop__cor-picker-oculto",l.tabIndex=-1,l.setAttribute("aria-hidden","true");const u=d=>{const p=k(d);if(o.classList.toggle("ui-prop__editor--misto",p),a.classList.toggle("ui-prop__cor-amostra--misto",p),p){a.style.backgroundColor="",l.value="#ffffff",U(n,D(i));return}const c=wr(d);a.style.backgroundColor=c,l.value=Mt(c),j(n,d,(h,f)=>fe(h)===fe(f),h=>h==null||h===""?"—":String(h))};return u(e),N(o,u),l.addEventListener("input",()=>{a.style.backgroundColor=l.value}),l.addEventListener("change",()=>{i.registrarAlteracao(r,t.id,l.value),u(i.obterValorAtual(t.id))}),n.addEventListener("change",()=>{if(n.value==="__escolher"){u(i.obterValorAtual(t.id)),l.click();return}i.registrarAlteracao(r,t.id,n.value),u(i.obterValorAtual(t.id))}),n.addEventListener("keydown",d=>{d.key==="Enter"&&(d.shiftKey&&i.focarEditorAnterior?i.focarEditorAnterior(n):i.focarProximoEditor(n))}),o.appendChild(a),o.appendChild(n),o.appendChild(l),o}function Dt(r,t,e,i){const o=document.createElement("div");o.className="ui-prop__editor-cor-container",o.setAttribute("role","button"),o.tabIndex=0;const a=document.createElement("div");a.className="ui-prop__cor-amostra";const n=document.createElement("span");n.className="ui-prop__cor-texto";const s=document.createElement("input");s.type="color",s.className="ui-prop__cor-picker-oculto",s.tabIndex=-1,s.setAttribute("aria-hidden","true");const l=u=>{const d=k(u);if(o.classList.toggle("ui-prop__editor--misto",d),a.classList.toggle("ui-prop__cor-amostra--misto",d),d){const c=D(i);a.style.backgroundColor="",n.textContent=c,s.value="#ffffff",o.setAttribute("aria-label",`${t.rotulo??t.id}: ${c}`);return}const p=typeof u=="string"&&Lt.test(u)?Mt(u):null;a.style.backgroundColor=u||"#ffffff",n.textContent=t.textoAmostra||String(u||"ByLayer"),s.value=p??"#ffffff",o.setAttribute("aria-label",`${t.rotulo??t.id}: ${u||"ByLayer"}`)};return l(e),N(o,l),s.addEventListener("input",()=>{a.style.backgroundColor=s.value,n.textContent=t.textoAmostra||s.value}),s.addEventListener("change",()=>{i.registrarAlteracao(r,t.id,s.value),l(i.obterValorAtual(t.id))}),o.addEventListener("click",u=>{u.target!==s&&s.click()}),o.addEventListener("keydown",u=>{(u.key===" "||u.key==="Enter")&&(u.preventDefault(),s.click())}),o.appendChild(a),o.appendChild(n),o.appendChild(s),o}function Tt(r,t,e,i){let o;return t.somenteLeitura||t.tipo==="readonly"?o=xt(e,i.obterTextoMisto,t):t.tipo==="booleano"?o=Et(r,t,e,i):t.tipo==="linha"||t.tipo==="linetype"?o=St(r,t,e,i):t.tipo==="espessura"||t.tipo==="lineweight"?o=zt(r,t,e,i):t.tipo==="cor-cad"?o=Nt(r,t,e,i):t.tipo==="selecao"?o=yt(r,t,e,i):t.tipo==="cor"?o=Dt(r,t,e,i):t.tipo==="acao"?o=At(r,t,i):t.tipo==="numero"?o=wt(r,t,e,i):o=Ct(r,t,e,i),o.setAttribute("part","editor"),t.dica&&o.setAttribute("aria-description",t.dica),o}function Pt(r){if(!r.tipoContainerElement)return;const t=(Array.isArray(r.tipos)?r.tipos:[]).filter(i=>!!(i&&typeof i=="object"&&i.id!==void 0&&i.id!==null));if(t.length===0){r.tipoContainerElement.style.display="none",r.tipoContainerElement.innerHTML="";return}r.tipoContainerElement.style.display="flex",r.tipoContainerElement.innerHTML="";const e=t.find(i=>String(i.id)===String(r.tipoSelecionadoId))||t[0];if(r.estiloVisual==="revit"){const i=document.createElement("div");i.className="ui-prop__tipo-revit-card",i.title="Editar tipo de família",i.addEventListener("click",()=>r.onEditarTipo(e));const o=document.createElement("div");o.className="ui-prop__tipo-miniatura";const a=e.iconeSvg?Xt.higienizarSvg(e.iconeSvg):null;a?o.appendChild(a):o.innerHTML=`
8
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
9
+ <rect x="3" y="3" width="18" height="18" rx="2"></rect>
10
+ <path d="M3 9h18M9 21V9"></path>
11
+ </svg>
12
+ `;const n=document.createElement("div");n.className="ui-prop__tipo-info";const s=document.createElement("div");s.className="ui-prop__tipo-nome",s.textContent=String(e.rotulo??e.id);const l=document.createElement("div");l.className="ui-prop__tipo-subtexto",l.textContent=e.subtipo||"Tipo de Família",n.appendChild(s),n.appendChild(l),i.appendChild(o),i.appendChild(n);const u=document.createElement("div");u.className="ui-prop__tipo-revit-subbarra";const d=document.createElement("select");d.className="ui-prop__tipo-select",d.setAttribute("aria-label","Selecionar tipo de família"),t.forEach(c=>{const h=document.createElement("option");h.value=String(c.id),h.textContent=`${c.rotulo??c.id}${c.subtipo?` : ${c.subtipo}`:""}`,String(c.id)===String(e.id)&&(h.selected=!0),d.appendChild(h)}),d.addEventListener("change",()=>{r.onSelecionarTipo(d.value)});const p=document.createElement("button");p.type="button",p.className="ui-prop__btn-editar-tipo",p.innerHTML=`
13
+ <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="margin-right: 4px; vertical-align: -1px;" aria-hidden="true">
14
+ <rect x="3" y="3" width="12" height="12" rx="1"></rect>
15
+ <rect x="9" y="9" width="12" height="12" rx="1"></rect>
16
+ </svg>
17
+ <span>Editar tipo</span>
18
+ `,p.addEventListener("click",()=>{r.onEditarTipo(e)}),u.appendChild(d),u.appendChild(p),r.tipoContainerElement.appendChild(i),r.tipoContainerElement.appendChild(u)}else{const i=document.createElement("div");i.className="ui-prop__tipo-autocad-bar";const o=document.createElement("select");o.className="ui-prop__tipo-select",o.setAttribute("aria-label","Selecionar tipo de objeto"),t.forEach(u=>{const d=document.createElement("option");d.value=String(u.id),d.textContent=String(u.rotulo??u.id),String(u.id)===String(e.id)&&(d.selected=!0),o.appendChild(d)}),o.addEventListener("change",()=>{r.onSelecionarTipo(o.value)});const a=document.createElement("div");a.className="ui-prop__tipo-autocad-acoes";const n=document.createElement("button");n.type="button",n.className="ui-prop__btn-autocad",n.title="Seleção rápida",n.setAttribute("aria-label","Seleção rápida"),n.innerHTML=`
19
+ <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
20
+ <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>
21
+ </svg>
22
+ `,n.addEventListener("click",()=>{r.onQuickSelect(e)});const s=document.createElement("button");s.type="button",s.className="ui-prop__btn-autocad",s.title="Selecionar objetos",s.setAttribute("aria-label","Selecionar objetos"),s.innerHTML=`
23
+ <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
24
+ <circle cx="12" cy="12" r="7"></circle>
25
+ <line x1="12" y1="2" x2="12" y2="7"></line>
26
+ <line x1="12" y1="17" x2="12" y2="22"></line>
27
+ <line x1="2" y1="12" x2="7" y2="12"></line>
28
+ <line x1="17" y1="12" x2="22" y2="12"></line>
29
+ <line x1="12" y1="9" x2="12" y2="15" stroke-width="2.5"></line>
30
+ <line x1="9" y1="12" x2="15" y2="12" stroke-width="2.5"></line>
31
+ </svg>
32
+ `,s.addEventListener("click",()=>{r.onSelectObjects(e)});const l=document.createElement("button");l.type="button",l.className="ui-prop__btn-autocad",l.title="Calculadora rápida",l.setAttribute("aria-label","Calculadora rápida"),l.innerHTML=`
33
+ <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
34
+ <rect x="4" y="2" width="16" height="20" rx="2"></rect>
35
+ <line x1="8" y1="6" x2="16" y2="6"></line>
36
+ <circle cx="8" cy="11" r="1" fill="currentColor"></circle>
37
+ <circle cx="12" cy="11" r="1" fill="currentColor"></circle>
38
+ <circle cx="16" cy="11" r="1" fill="currentColor"></circle>
39
+ <circle cx="8" cy="15" r="1" fill="currentColor"></circle>
40
+ <circle cx="12" cy="15" r="1" fill="currentColor"></circle>
41
+ <circle cx="16" cy="15" r="1" fill="currentColor"></circle>
42
+ </svg>
43
+ `,l.addEventListener("click",()=>{r.onCalculadora(e)}),a.appendChild(n),a.appendChild(s),a.appendChild(l),i.appendChild(o),i.appendChild(a),r.tipoContainerElement.appendChild(i)}}function Rt(r){let t=45;function e(a){if(!Number.isFinite(a))return t;const n=Math.max(20,Math.min(65,a));return t=n,r.hostElement.style.setProperty("--ui-prop-rotulo-largura",`${n}%`),r.splitterElement&&(r.splitterElement.style.left=`calc(${n}% - 4px)`,r.splitterElement.setAttribute("aria-valuenow",String(Math.round(n)))),n}function i(a){r.onLarguraAlterada(a),r.hostElement.dispatchEvent(new CustomEvent("ui-splitter-resize",{bubbles:!0,composed:!0,detail:{larguraPorcentagem:a}}))}function o(){if(!r.splitterElement||!r.corpoElement)return;r.splitterListeners.cleanup();let a=!1;const n=s=>{if(s.button!==0)return;s.preventDefault(),s.stopPropagation(),a=!0,r.splitterElement.classList.add("ui-prop__splitter--ativo");try{r.splitterElement.setPointerCapture(s.pointerId)}catch{}const l=r.corpoElement.getBoundingClientRect(),u=p=>{if(!a)return;const c=l.width;if(c<=0)return;const h=p.clientX-l.left;let g=Math.max(80,Math.min(c-130,h))/c*100;g=Math.max(20,Math.min(65,g)),e(g)},d=p=>{if(a){a=!1,r.splitterElement.classList.remove("ui-prop__splitter--ativo");try{r.splitterElement.hasPointerCapture(p.pointerId)&&r.splitterElement.releasePointerCapture(p.pointerId)}catch{}r.splitterElement.removeEventListener("pointermove",u),r.splitterElement.removeEventListener("pointerup",d),r.splitterElement.removeEventListener("pointercancel",d),i(t)}};r.splitterElement.addEventListener("pointermove",u),r.splitterElement.addEventListener("pointerup",d),r.splitterElement.addEventListener("pointercancel",d)};r.splitterListeners.add(r.splitterElement,"pointerdown",n),r.splitterListeners.add(r.splitterElement,"dblclick",()=>{const s=e(45);i(s)}),r.splitterListeners.add(r.splitterElement,"keydown",s=>{const l=s.shiftKey?5:2;let u=null;if(s.key==="ArrowLeft"?u=t-l:s.key==="ArrowRight"?u=t+l:s.key==="Home"?u=20:s.key==="End"?u=65:s.key==="Enter"&&(u=45),u!==null){s.preventDefault(),s.stopPropagation();const d=e(u);i(d)}})}return{init:o,definirLarguraRotulo:e}}const Cr=`: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:var(--ui-degrade-interno, var(--ui-prop-fundo, var(--ui-fundo-superficie, var(--ui-cor-superficie, #141417))));border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 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:var(--ui-prop-elevado-fundo, var(--ui-fundo-elevado, 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:var(--ui-cor-destaque, #00E08A);color:var(--ui-cor-texto-sobre-primaria, #000000);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-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;background:var(--ui-degrade-interno, var(--ui-prop-container-fundo, transparent))}.ui-prop__header{display:flex;align-items:center;justify-content:space-between;height:22px;min-height:22px;padding:0 8px;background:var(--ui-prop-elevado-fundo, var(--ui-fundo-elevado, 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: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:var(--ui-prop-secao-fundo, 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:var(--ui-prop-card-fundo, var(--ui-fundo-card, 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: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;--_chevron: 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");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:var(--_chevron) right 4px center / 8px 5px no-repeat,transparent;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:var(--_chevron) right 4px center / 8px 5px no-repeat,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 5%,transparent);color:var(--ui-cor-texto, #ffffff)}.ui-prop__tipo-select:focus{background:var(--_chevron) right 4px center / 8px 5px no-repeat,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: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: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: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-mix(in srgb,var(--ui-cor-primaria, #00E08A) 15%,transparent)}.ui-prop__filtro-container{display:flex;align-items:center;padding:4px 8px;background:var(--ui-prop-filtro-fundo, 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-limpar{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);cursor:pointer;font-size:11px;padding:0 4px;display:inline-flex;align-items:center;justify-content:center;border-radius:2px}.ui-prop__filtro-limpar:hover{color:var(--ui-cor-texto, #ffffff);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .08))}.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:var(--ui-prop-secao-fundo, 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:var(--ui-prop-categoria-fundo, var(--ui-fundo-elevado, 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:focus-visible{outline:1.5px solid var(--ui-cor-destaque, #00E08A);outline-offset:-1.5px}.ui-prop__categoria-header:hover{background: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:var(--ui-cor-hover-menu, rgba(255, 255, 255, .04))}.ui-prop__linha:focus-within{background: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-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-mix(in srgb,var(--ui-cor-primaria, #00E08A) 5%,transparent)}.ui-prop__col-rotulo--arrastando{color:var(--ui-cor-texto-sobre-primaria, #000000)!important;background:var(--ui-cor-destaque, #00E08A)!important;font-weight:600;cursor:ew-resize!important}.ui-prop__col-rotulo--arrastando span{color:var(--ui-cor-texto-sobre-primaria, #000000)!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:transparent;pointer-events:none;transition:background-color .15s ease,box-shadow .15s ease}.ui-prop__splitter:hover:after,.ui-prop__splitter--ativo:after{background:var(--ui-cor-destaque, #00E08A);box-shadow:0 0 6px color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 50%,transparent)}.ui-prop__splitter:focus-visible{outline:none}.ui-prop__splitter:focus-visible:after{background: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-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: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-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-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);--_chevron: 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");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:var(--_chevron) right 6px center / 8px 5px no-repeat,transparent;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;transition:background-color .1s ease}.ui-prop__editor-select:hover{background:var(--_chevron) right 6px center / 8px 5px no-repeat,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__editor-select option{background: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;--_chevron: 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:var(--_chevron) right 6px center / 8px 5px no-repeat,transparent;transition:background-color .1s ease}.ui-prop__editor-cor-container:hover{background:var(--_chevron) right 6px center / 8px 5px no-repeat,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%;--_chevron: 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");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:var(--_chevron) right 6px center / 8px 5px no-repeat,transparent;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-prop__linha-select:hover{background:var(--_chevron) right 6px center / 8px 5px no-repeat,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__linha-select option{background: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%;--_chevron: 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");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:var(--_chevron) right 6px center / 8px 5px no-repeat,transparent;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-prop__espessura-select:hover{background:var(--_chevron) right 6px center / 8px 5px no-repeat,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__espessura-select option{background: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%;--_chevron: 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");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:var(--_chevron) right 6px center / 8px 5px no-repeat,transparent;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-prop__cor-cad-select:hover{background:var(--_chevron) right 6px center / 8px 5px no-repeat,color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 3%,transparent)}.ui-prop__cor-cad-select option{background: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-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:var(--ui-cor-fundo, #0b0b0d);display:flex;align-items:center;justify-content:center;transition:all .15s ease}.ui-prop__checkbox-custom--marcado{background:var(--ui-cor-destaque, #00E08A);border-color:var(--ui-cor-destaque, #00E08A);color:var(--ui-cor-texto-sobre-primaria, #000000)}.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: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-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:var(--ui-prop-elevado-fundo, var(--ui-fundo-elevado, 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:var(--ui-cor-destaque, #00E08A);color:var(--ui-cor-texto-sobre-primaria, #000000);border:none;border-radius:3px;font-size:11px;font-weight:600;cursor:pointer;transition:all .15s ease}.ui-prop__btn-aplicar:disabled{background: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: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}}.ui-prop__editor--misto,.ui-prop__editor--misto .ui-prop__booleano-rotulo,.ui-prop__editor--misto .ui-prop__cor-texto,.ui-prop__editor--misto select,select.ui-prop__editor--misto{font-style:italic;color:var(--ui-prop-misto-cor, var(--ui-cor-texto-secundario, #a0a0ab))}.ui-prop__editor-input.ui-prop__editor--misto::placeholder{font-style:italic;color:var(--ui-prop-misto-cor, var(--ui-cor-texto-secundario, #a0a0ab));opacity:1}.ui-prop__editor--misto option:not([data-misto]),select.ui-prop__editor--misto option:not([data-misto]){font-style:normal;color:var(--ui-cor-texto, #ffffff)}.ui-prop__editor--misto svg{opacity:.35}.ui-prop__checkbox-custom--misto{border-color:var(--ui-prop-misto-cor, var(--ui-cor-texto-secundario, #a0a0ab));color:var(--ui-prop-misto-cor, var(--ui-cor-texto-secundario, #a0a0ab));font-style:normal}.ui-prop__cor-amostra--misto{background:linear-gradient(to top right,transparent calc(50% - 1px),var(--ui-prop-misto-cor, var(--ui-cor-texto-secundario, #a0a0ab)) 50%,transparent calc(50% + 1px))}.ui-prop__linha--modificada .ui-prop__col-rotulo{box-shadow:inset 2px 0 0 var(--ui-cor-destaque, #00E08A)}.ui-prop__btn-reverter{display:none;margin-left:auto;flex-shrink:0;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:none;border-radius:var(--ui-raio-sm, 3px);background:transparent;color:var(--ui-cor-destaque, #00E08A);font-size:11px;line-height:1;cursor:pointer}.ui-prop__linha--modificada .ui-prop__btn-reverter{display:inline-flex}.ui-prop__btn-reverter:hover{background:color-mix(in srgb,var(--ui-cor-primaria, #00E08A) 15%,transparent)}.ui-prop__btn-reverter:focus-visible{outline:1px solid var(--ui-cor-destaque, #00E08A);outline-offset:-1px}.ui-prop__previa-calculo{position:absolute;left:6px;top:50%;transform:translateY(-50%);pointer-events:none;font-size:10px;font-family:var(--ui-fonte-codigo, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-variant-numeric:tabular-nums;color:var(--ui-cor-texto-secundario, #9696a6);white-space:nowrap}.ui-prop__previa-calculo[hidden]{display:none}.ui-prop__editor-input--invalido{animation:ui-prop-invalido .6s ease}.ui-prop__col-valor:has(.ui-prop__editor-input--invalido){box-shadow:inset 0 0 0 1px var(--ui-cor-texto-erro, #ff5555)}@keyframes ui-prop-invalido{0%,60%{color:var(--ui-cor-texto-erro, #ff5555)}to{color:inherit}}@media (prefers-reduced-motion: reduce){.ui-prop__editor-input--invalido{animation-duration:.01ms}}:host(.degrade),:host(.gradiente),:host([data-degrade]:not([data-degrade="false"])),:host([degrade]:not([degrade="false"])),:host([gradiente]:not([gradiente="false"])),:host([gradient]:not([gradient="false"])),.ui-prop__container[data-degrade]:not([data-degrade=false]){--ui-prop-fundo: var(--ui-gradiente-superficie);--ui-prop-container-fundo: var(--ui-gradiente-superficie);--ui-prop-elevado-fundo: var(--ui-gradiente-elevado);--ui-prop-card-fundo: var(--ui-gradiente-card);--ui-prop-secao-fundo: transparent;--ui-prop-filtro-fundo: color-mix(in srgb, var(--ui-cor-fundo, #0b0b0d) 72%, transparent);--ui-prop-categoria-fundo: color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 4%, transparent)}`;function kr(){return`
44
+ <style>${Cr}</style>
45
+ <div class="ui-prop__container" id="container" part="base">
46
+ <!-- 0. Faixa Vertical da Coluna Estreita (visível quando colapsado) -->
47
+ <div class="ui-prop__faixa-estreita" id="faixa-estreita" part="faixa-estreita" title="Clique para expandir painel">
48
+ <span class="ui-prop__faixa-icone" aria-hidden="true">
49
+ <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
50
+ <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
51
+ <line x1="3" y1="9" x2="21" y2="9"></line>
52
+ <line x1="9" y1="21" x2="9" y2="9"></line>
53
+ </svg>
54
+ </span>
55
+ <button type="button" class="ui-prop__faixa-btn-expandir" id="btn-expandir-faixa" title="Expandir painel de propriedades" aria-label="Expandir painel de propriedades">
56
+ <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2">
57
+ <polyline points="9 18 15 12 9 6"></polyline>
58
+ <line x1="5" y1="5" x2="5" y2="19"></line>
59
+ </svg>
60
+ </button>
61
+ <span class="ui-prop__faixa-texto">PROPRIEDADES</span>
62
+ </div>
63
+
64
+ <!-- 1. Header Superior -->
65
+ <header class="ui-prop__header" id="header" part="cabecalho">
66
+ <div class="ui-prop__header-titulo">
67
+ <span class="ui-prop__header-icone" aria-hidden="true">
68
+ <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
69
+ <rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
70
+ <line x1="3" y1="9" x2="21" y2="9"></line>
71
+ <line x1="9" y1="21" x2="9" y2="9"></line>
72
+ </svg>
73
+ </span>
74
+ <span id="header-titulo-texto" part="titulo">Propriedades</span>
75
+ </div>
76
+ <div class="ui-prop__header-acoes" part="acoes-cabecalho">
77
+ <button type="button" class="ui-prop__btn-icone" id="btn-flutuante" title="Desacoplar / Modo flutuante (CAD)" aria-label="Modo flutuante">
78
+ <svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
79
+ <rect x="3" y="3" width="14" height="14" rx="2"></rect>
80
+ <polyline points="15 3 21 3 21 9"></polyline>
81
+ <line x1="10" y1="14" x2="21" y2="3"></line>
82
+ </svg>
83
+ </button>
84
+ <button type="button" class="ui-prop__btn-icone" id="btn-colapsar-horizontal" title="Recolher para coluna estreita" aria-label="Recolher para coluna estreita">
85
+ <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
86
+ <polyline points="11 17 6 12 11 7"></polyline>
87
+ <line x1="18" y1="5" x2="18" y2="19"></line>
88
+ </svg>
89
+ </button>
90
+ <button type="button" class="ui-prop__btn-icone" id="btn-densidade" title="Alternar compressão vertical" aria-label="Alternar densidade vertical">
91
+ <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
92
+ <polyline points="4 7 12 11 20 7"></polyline>
93
+ <polyline points="4 17 12 13 20 17"></polyline>
94
+ <line x1="4" y1="12" x2="20" y2="12"></line>
95
+ </svg>
96
+ </button>
97
+ <button type="button" class="ui-prop__btn-icone" id="btn-expandir-tudo" title="Expandir/Recolher Tudo" aria-label="Expandir ou recolher tudo">
98
+ <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
99
+ <polyline points="7 13 12 18 17 13"></polyline>
100
+ <polyline points="7 6 12 11 17 6"></polyline>
101
+ </svg>
102
+ </button>
103
+ <button type="button" class="ui-prop__btn-icone" id="btn-fechar" title="Fechar" aria-label="Fechar" style="display: none;">
104
+ ✕
105
+ </button>
106
+ </div>
107
+ </header>
108
+
109
+ <!-- 2. Seletor de Tipo (AutoCAD / Revit) -->
110
+ <div class="ui-prop__tipo-seletor-container" id="tipo-container" part="seletor-tipo" style="display: none;"></div>
111
+
112
+ <!-- 3. Busca Rápida de Propriedades -->
113
+ <div class="ui-prop__filtro-container" id="filtro-container" part="filtro" style="display: none;">
114
+ <svg class="ui-prop__filtro-icone" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
115
+ <circle cx="11" cy="11" r="8"></circle>
116
+ <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
117
+ </svg>
118
+ <input type="text" class="ui-prop__filtro-input" id="filtro-input" part="filtro-input" placeholder="Filtrar propriedades..." aria-label="Filtrar propriedades" autocomplete="off" spellcheck="false" />
119
+ <button type="button" class="ui-prop__filtro-limpar" id="btn-limpar-filtro" title="Limpar filtro (Esc)" aria-label="Limpar filtro" style="display: none;">✕</button>
120
+ </div>
121
+
122
+ <!-- 4. Corpo Rolável com Grade de Categorias -->
123
+ <div class="ui-prop__corpo-wrapper" id="corpo-wrapper">
124
+ <div class="ui-prop__splitter" id="splitter" part="splitter" role="separator" tabindex="0" aria-orientation="vertical" aria-valuemin="20" aria-valuemax="65" aria-valuenow="45" aria-label="Redimensionar coluna de rótulos" title="Arraste para redimensionar colunas (duplo-clique reseta para 45%)"></div>
125
+ <div class="ui-prop__corpo" id="corpo" part="corpo">
126
+ <div class="ui-prop__lista-categorias" id="lista-categorias" part="lista-categorias"></div>
127
+ </div>
128
+ </div>
129
+
130
+ <!-- 5. Rodapé com Ações (Aplicar / Desfazer) -->
131
+ <footer class="ui-prop__footer" id="footer" part="rodape" style="display: none;">
132
+ <a class="ui-prop__link-ajuda" id="link-ajuda" part="ajuda" href="#" role="button">Ajuda de propriedades</a>
133
+ <div class="ui-prop__footer-botoes">
134
+ <button type="button" class="ui-prop__btn-desfazer" id="btn-desfazer" part="desfazer" disabled>Desfazer</button>
135
+ <button type="button" class="ui-prop__btn-aplicar" id="btn-aplicar" part="aplicar" disabled>Aplicar</button>
136
+ </div>
137
+ </footer>
138
+
139
+ <!-- 6. Grip para redimensionar no modo flutuante -->
140
+ <div class="ui-prop__resizer-canto" id="resizer-canto" title="Redimensionar"></div>
141
+ </div>
142
+ `}function Ot(r){const{listaContainer:t,categorias:e,termoBusca:i,onToggleCategoria:o,linhaCtx:a}=r;t.innerHTML="";const n=(Array.isArray(e)?e:[]).filter(d=>!!(d&&typeof d=="object"));if(n.length===0){const d=document.createElement("div");d.className="ui-prop__vazio",d.setAttribute("part","vazio"),d.textContent="Nenhuma propriedade disponível.",t.appendChild(d);return}const s=document.createDocumentFragment(),l=(i||"").trim().toLowerCase();let u=0;if(n.forEach(d=>{const p=String(d.titulo??d.id??"").toLowerCase(),c=!!l&&p.includes(l),h=(Array.isArray(d.propriedades)?d.propriedades:[]).filter(_=>{if(!_||typeof _!="object"||_.id===void 0||_.id===null)return!1;if(!l||c)return!0;const C=String(_.rotulo??"").toLowerCase(),w=String(_.id).toLowerCase(),z=String(a.valoresAtuais[_.id]??"").toLowerCase();return C.includes(l)||w.includes(l)||z.includes(l)});if(l&&h.length===0)return;u+=h.length;const f=r.obterCategoriaAberta?r.obterCategoriaAberta(d):d.aberto!==void 0?d.aberto!==!1:d.aberta!==!1,m=!!l||f,b=document.createElement("div");b.className=`ui-prop__categoria ${m?"ui-prop__categoria--aberta":""}`,b.setAttribute("data-cat-id",String(d.id)),b.setAttribute("part","categoria"),R.alternarPart(b,"categoria-aberta",m);const g=document.createElement("div");g.className="ui-prop__categoria-header",g.setAttribute("part","categoria-cabecalho"),g.setAttribute("role","button"),g.tabIndex=0,g.setAttribute("aria-expanded",String(m));const E=document.createElement("div");E.className="ui-prop__categoria-titulo-bloco";const y=document.createElement("span");y.className="ui-prop__categoria-seta",y.setAttribute("aria-hidden","true"),y.textContent="▶";const A=document.createElement("span");A.textContent=String(d.titulo??d.id),E.appendChild(y),E.appendChild(A);const L=document.createElement("span");L.className="ui-prop__categoria-contador",L.textContent=String(h.length),g.appendChild(E),g.appendChild(L),g.addEventListener("click",()=>o(String(d.id))),g.addEventListener("keydown",_=>{if(_.key==="Enter"||_.key===" ")_.preventDefault(),o(String(d.id));else if(_.key==="ArrowRight")b.classList.contains("ui-prop__categoria--aberta")||(_.preventDefault(),o(String(d.id)));else if(_.key==="ArrowLeft")b.classList.contains("ui-prop__categoria--aberta")&&(_.preventDefault(),o(String(d.id)));else if(_.key==="ArrowDown"||_.key==="ArrowUp"){const C=Array.from(t.querySelectorAll(".ui-prop__categoria-header")),w=C.indexOf(g);if(w!==-1){const z=_.key==="ArrowDown"?w+1:w-1;z>=0&&z<C.length&&(_.preventDefault(),C[z].focus())}}else if(_.key==="Home"){const C=t.querySelector(".ui-prop__categoria-header");C&&(_.preventDefault(),C.focus())}else if(_.key==="End"){const C=t.querySelectorAll(".ui-prop__categoria-header");C.length>0&&(_.preventDefault(),C[C.length-1].focus())}});const x=document.createElement("div");x.className="ui-prop__categoria-conteudo",x.setAttribute("part","categoria-conteudo"),h.forEach(_=>{const C=It(String(d.id),_,a);x.appendChild(C)}),b.appendChild(g),b.appendChild(x),s.appendChild(b)}),l&&u===0){const d=document.createElement("div");d.className="ui-prop__vazio",d.setAttribute("part","vazio"),d.textContent=`Nenhuma propriedade encontrada para "${i}".`,t.appendChild(d);return}t.appendChild(s)}function It(r,t,e){const i=document.createElement("div");i.className="ui-prop__linha",i.setAttribute("data-prop-id",String(t.id)),i.setAttribute("part","linha");const o=e.valoresAtuais[t.id]!==void 0?e.valoresAtuais[t.id]:re(t),a=t.id in e.valoresOriginais?e.valoresOriginais[t.id]:re(t),n=!F(o,a),s=k(o);n&&(i.classList.add("ui-prop__linha--modificada"),R.alternarPart(i,"linha-modificada",!0)),s&&(i.classList.add("ui-prop__linha--misto"),R.alternarPart(i,"linha-mista",!0)),i.addEventListener("dblclick",()=>{const f=i.querySelector('input:not([type="color"]):not(.ui-prop__cor-picker-oculto), select, .ui-prop__btn-acao-inline');f&&(f.focus(),f instanceof HTMLInputElement&&f.select())});const l=document.createElement("div");l.className="ui-prop__col-rotulo",l.setAttribute("part","rotulo");const u=String(t.rotulo??t.id);l.title=t.dica?`${u} — ${t.dica}`:u;const d=document.createElement("span");if(d.textContent=u,l.appendChild(d),!t.somenteLeitura&&t.tipo!=="readonly"&&t.tipo!=="acao"&&e.onRedefinir){const f=e.onRedefinir,m=document.createElement("button");m.type="button",m.className="ui-prop__btn-reverter",m.title="Restaurar valor original",m.setAttribute("aria-label",`Restaurar valor original de ${u}`),m.setAttribute("part","restaurar"),m.textContent="↺",m.addEventListener("click",b=>{b.stopPropagation(),f(String(t.id))}),m.addEventListener("dblclick",b=>b.stopPropagation()),l.appendChild(m)}t.tipo==="numero"&&!t.somenteLeitura&&Sr(l,r,t,e);const c=document.createElement("div");c.className="ui-prop__col-valor",c.setAttribute("part","valor");const h=Tt(r,t,o,e.editorCtx);if(c.appendChild(h),t.unidade){const f=document.createElement("span");f.className="ui-prop__unidade-sufixo",f.setAttribute("part","unidade"),f.textContent=t.unidade,c.appendChild(f)}return i.appendChild(l),i.appendChild(c),i}function Sr(r,t,e,i){r.classList.add("ui-prop__col-rotulo--scrub");const o=String(e.rotulo??e.id),a=e.dica?`${o} — ${e.dica}`:o;r.title=`${a} (Arraste para ajustar, duplo-clique para editar)`;let n=0,s=0,l=!1;r.addEventListener("pointerdown",u=>{var h,f;if(u.button!==0||(f=(h=u.target)==null?void 0:h.closest)!=null&&f.call(h,".ui-prop__btn-reverter")||k(i.editorCtx.obterValorAtual(e.id)))return;n=u.clientX;const d=i.editorCtx.obterValorAtual(e.id);s=typeof d=="number"?d:parseFloat(String(d||0))||0,l=!1;try{r.setPointerCapture(u.pointerId)}catch{}r.classList.add("ui-prop__col-rotulo--arrastando");const p=m=>{const b=m.clientX-n;if(Math.abs(b)>2&&(l=!0),l){let g=1;m.shiftKey?g=.1:(m.ctrlKey||m.metaKey)&&(g=10);const E=W(e),y=typeof e.passo=="number"&&e.passo>0?e.passo*.01:typeof e.step=="number"&&e.step>0?e.step*.01:Math.pow(10,-Math.min(E!==void 0?E:2,2));let A=s+b*y*g;A=le(A,e),E!==void 0?A=Number(A.toFixed(E)):A=Math.round(A*100)/100,i.editorCtx.registrarAlteracao(t,e.id,A),i.onAtualizarCampoVisual(e.id,A)}},c=m=>{r.classList.remove("ui-prop__col-rotulo--arrastando");try{r.hasPointerCapture(m.pointerId)&&r.releasePointerCapture(m.pointerId)}catch{}r.removeEventListener("pointermove",p),r.removeEventListener("pointerup",c),r.removeEventListener("pointercancel",c)};r.addEventListener("pointermove",p),r.addEventListener("pointerup",c),r.addEventListener("pointercancel",c)})}const De=300,zr=480,K=new WeakMap;function Bt(r){var i,o,a;const t=r.hasAttribute("flutuante"),e=r.style;if(t){const n=K.get(r)??{acoplado:{width:"",height:""}};n.flutuante={left:e.left,top:e.top,width:e.width,height:e.height},K.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}else{const n={acoplado:{width:e.width,height:e.height},flutuante:(i=K.get(r))==null?void 0:i.flutuante};if(K.set(r,n),r.setAttribute("flutuante",""),e.position="fixed",(o=n.flutuante)!=null&&o.left||(a=n.flutuante)!=null&&a.top)e.left=n.flutuante.left,e.top=n.flutuante.top,e.width=n.flutuante.width,e.height=n.flutuante.height;else if(!e.left&&!e.top){const s=Math.max(20,(typeof window<"u"?window.innerWidth:1024)-De-30);e.left=`${s}px`,e.top="70px",e.width=`${De}px`,e.height=`${zr}px`}}return!t}function Ft(r,t,e){const i=t.getElementById("header");if(i){let a=null,n=0,s=0,l=0,u=0;const d=c=>{if(a===null)return;const h=c.clientX-n,f=c.clientY-s;let m=l+h,b=u+f;const g=Math.max(0,(typeof window<"u"?window.innerWidth:1024)-r.offsetWidth),E=Math.max(0,(typeof window<"u"?window.innerHeight:768)-30);m=Math.max(0,Math.min(g,m)),b=Math.max(0,Math.min(E,b)),r.style.left=`${m}px`,r.style.top=`${b}px`,r.style.right="auto",r.style.bottom="auto"},p=c=>{if(a!==null){try{i.releasePointerCapture(c.pointerId)}catch{}i.removeEventListener("pointermove",d),i.removeEventListener("pointerup",p),i.removeEventListener("pointercancel",p),a=null,r.classList.remove("arrastando"),r.dispatchEvent(new CustomEvent("ui-mover",{bubbles:!0,composed:!0,detail:{left:r.style.left,top:r.style.top}}))}};e.add(i,"pointerdown",c=>{if(!r.hasAttribute("flutuante")||c.target.closest("button, input, select, a")||c.button!==0)return;c.preventDefault(),a=c.pointerId,n=c.clientX,s=c.clientY;const f=r.getBoundingClientRect();l=f.left,u=f.top,r.classList.add("arrastando");try{i.setPointerCapture(c.pointerId)}catch{}i.addEventListener("pointermove",d),i.addEventListener("pointerup",p),i.addEventListener("pointercancel",p)})}const o=t.getElementById("resizer-canto");if(o){let a=null,n=0,s=0,l=0,u=0;const d=c=>{if(a===null)return;const h=Math.max(200,n+(c.clientX-l)),f=Math.max(180,s+(c.clientY-u));r.style.width=`${h}px`,r.style.height=`${f}px`},p=c=>{if(a!==null){try{o.releasePointerCapture(c.pointerId)}catch{}o.removeEventListener("pointermove",d),o.removeEventListener("pointerup",p),o.removeEventListener("pointercancel",p),a=null,r.dispatchEvent(new CustomEvent("ui-redimensionar",{bubbles:!0,composed:!0,detail:{width:r.style.width,height:r.style.height}}))}};e.add(o,"pointerdown",c=>{if(!r.hasAttribute("flutuante")||c.button!==0)return;c.preventDefault(),c.stopPropagation(),a=c.pointerId,l=c.clientX,u=c.clientY;const h=r.getBoundingClientRect();n=h.width,s=h.height;try{o.setPointerCapture(c.pointerId)}catch{}o.addEventListener("pointermove",d),o.addEventListener("pointerup",p),o.addEventListener("pointercancel",p)})}}function Vt(r){return r==="compacta"?"ultracompacta":r==="ultracompacta"?"padrao":"compacta"}class qt{constructor(t){v(this,"valoresOriginais",{});v(this,"valoresAtuais",{});this.ctx=t}inicializarCategorias(t){this.valoresOriginais={},this.valoresAtuais={};const e=new Set;(Array.isArray(t)?t:[]).forEach(i=>{!i||typeof i!="object"||(Array.isArray(i.propriedades)?i.propriedades:[]).forEach(o=>{if(!o||typeof o!="object"||o.id===void 0||o.id===null)return;const a=String(o.id);e.has(a)&&typeof console<"u"&&console.warn(`[ui-tabela-propriedades] id de propriedade repetido: "${a}". Os valores são indexados por id e serão compartilhados.`),e.add(a);const n=re(o);this.valoresOriginais[a]=n,this.valoresAtuais[a]=n})}),this.ctx.onAtualizarBotoesFooter(!1)}get isDirty(){return Object.keys(this.valoresAtuais).some(t=>this.isModificada(t))}isModificada(t){return!F(this.valoresAtuais[t],this.valoresOriginais[t])}getValores(){return{...this.valoresAtuais}}getValoresOriginais(){return{...this.valoresOriginais}}setValores(t){!t||typeof t!="object"||(Object.keys(t).forEach(e=>{this.valoresAtuais[e]=t[e],this.valoresOriginais[e]=t[e]}),this.ctx.onAtualizarBotoesFooter(this.isDirty))}obterValor(t){return this.valoresAtuais[t]}obterValorOriginal(t){return this.valoresOriginais[t]}definirValor(t,e,i=!0){const o=this.valoresAtuais[t];F(o,e)||(this.valoresAtuais[t]=e,this.aposAlterar(t),this.ctx.onAtualizarCampoVisual(t,e),i&&this.emitirAlteracao(t,e,o,this.categoriaDe(t)))}redefinirValor(t,e=!0){if(!(t in this.valoresOriginais)||!this.isModificada(t))return!1;const i=this.valoresOriginais[t];return this.definirValor(t,i,e&&!this.ctx.isModoManual()),!0}registrarAlteracao(t,e,i){const o=this.valoresAtuais[e];F(o,i)||(this.valoresAtuais[e]=i,this.aposAlterar(e),this.ctx.isModoManual()||this.emitirAlteracao(e,i,o,t))}aplicar(){var i;if(!this.isDirty)return;const t={};Object.keys(this.valoresAtuais).forEach(o=>{this.isModificada(o)&&(t[o]=this.valoresAtuais[o])}),this.valoresOriginais={...this.valoresAtuais},this.ctx.onAtualizarBotoesFooter(!1);const e=(i=this.ctx.hostElement.shadowRoot)==null?void 0:i.querySelectorAll(".ui-prop__linha--modificada");e==null||e.forEach(o=>{o.classList.remove("ui-prop__linha--modificada"),R.alternarPart(o,"linha-modificada",!1)}),this.ctx.hostElement.dispatchEvent(new CustomEvent("ui-aplicar",{bubbles:!0,composed:!0,detail:{valores:{...this.valoresAtuais},alterados:t}}))}desfazer(){this.isDirty&&(this.valoresAtuais={...this.valoresOriginais},this.ctx.onAtualizarBotoesFooter(!1),this.ctx.onRenderCategorias(),this.ctx.hostElement.dispatchEvent(new CustomEvent("ui-desfazer",{bubbles:!0,composed:!0,detail:{valores:{...this.valoresAtuais}}})))}aposAlterar(t){const e=ye(this.ctx.hostElement.shadowRoot,t);if(e){const i=this.isModificada(t),o=k(this.valoresAtuais[t]);e.classList.toggle("ui-prop__linha--modificada",i),e.classList.toggle("ui-prop__linha--misto",o),R.alternarPart(e,"linha-modificada",i),R.alternarPart(e,"linha-mista",o)}this.ctx.onAtualizarBotoesFooter(this.isDirty)}categoriaDe(t){for(const e of this.ctx.getCategorias())if(e&&Array.isArray(e.propriedades)&&e.propriedades.some(i=>i&&String(i.id)===String(t)))return e.id;return""}emitirAlteracao(t,e,i,o=""){this.ctx.hostElement.dispatchEvent(new CustomEvent("ui-propriedade-alterada",{bubbles:!0,composed:!0,detail:{id:t,categoriaId:o,valor:e,valorAnterior:i,todosValores:{...this.valoresAtuais}}}))}}function Ht(r){const{shadow:t,listeners:e,host:i,onToggleExpandirTodas:o,onFiltrar:a,onAplicar:n,onDesfazer:s,onAlternarDensidade:l,onAlternarFlutuante:u,onAlternarColapsoHorizontal:d,onFocarPrimeiroEditor:p}=r,c=t.getElementById("btn-flutuante");c&&u&&e.add(c,"click",u);const h=t.getElementById("btn-colapsar-horizontal");h&&d&&e.add(h,"click",d);const f=t.getElementById("faixa-estreita");f&&d&&e.add(f,"click",d);const m=t.getElementById("btn-expandir-faixa");m&&d&&e.add(m,"click",w=>{w.stopPropagation(),d()});const b=t.getElementById("btn-densidade");b&&l&&e.add(b,"click",l);const g=t.getElementById("btn-expandir-tudo");g&&e.add(g,"click",o);const E=t.getElementById("btn-fechar");E&&e.add(E,"click",()=>{i.dispatchEvent(new CustomEvent("ui-fechar",{bubbles:!0,composed:!0}))});const y=t.getElementById("filtro-input"),A=t.getElementById("btn-limpar-filtro"),L=()=>{A&&y&&(A.style.display=y.value?"inline-flex":"none")};y&&(e.add(y,"input",()=>{L();const w=(y.value||"").trim().toLowerCase();a(w)}),e.add(y,"keydown",w=>{w.key==="Escape"?y.value?(w.preventDefault(),w.stopPropagation(),y.value="",L(),a("")):y.blur():(w.key==="Enter"||w.key==="ArrowDown")&&p&&(w.preventDefault(),p())})),A&&y&&e.add(A,"click",()=>{y.value="",L(),a(""),y.focus()});const x=t.getElementById("btn-aplicar");x&&e.add(x,"click",n);const _=t.getElementById("btn-desfazer");_&&e.add(_,"click",s);const C=t.getElementById("link-ajuda");C&&e.add(C,"click",w=>{w.preventDefault(),i.dispatchEvent(new CustomEvent("ui-ajuda",{bubbles:!0,composed:!0}))}),e.add(t,"keydown",w=>{const z=w;(z.ctrlKey||z.metaKey)&&z.key==="Enter"&&i.getAttribute("modo-aplicar")==="manual"&&(z.preventDefault(),n())})}function O(r,t){const e=r.getElementById("header-titulo-texto");e&&(e.textContent=t.getAttribute("titulo")||"Propriedades");const i=r.getElementById("btn-fechar");i&&(i.style.display=t.hasAttribute("fechavel")?"inline-flex":"none");const o=r.getElementById("btn-flutuante");if(o){const p=t.hasAttribute("flutuante");o.title=p?"Acoplar painel (Dock)":"Desacoplar / Modo flutuante (CAD)",o.setAttribute("aria-pressed",String(p)),o.classList.toggle("ui-prop__btn-icone--ativo",p)}const a=r.getElementById("btn-colapsar-horizontal");if(a){const p=t.hasAttribute("colapsado");a.title=p?"Expandir painel":"Recolher para coluna estreita",a.setAttribute("aria-pressed",String(p)),a.classList.toggle("ui-prop__btn-icone--ativo",p)}const n=r.getElementById("btn-densidade");if(n){const p=t.getAttribute("densidade")||"padrão";n.title=`Compressão vertical: ${p} (clique para alternar)`}const s=r.getElementById("filtro-container");s&&(s.style.display=t.hasAttribute("filtro")?"flex":"none");const l=r.getElementById("filtro-input"),u=r.getElementById("btn-limpar-filtro");u&&l&&(u.style.display=l.value?"inline-flex":"none");const d=r.getElementById("footer");d&&(d.style.display=t.getAttribute("modo-aplicar")==="manual"?"flex":"none")}const B=class B extends H.SafeHTMLElement{constructor(){super();v(this,"shadow");v(this,"listeners",new J.ListenerBag);v(this,"splitterListeners",new J.ListenerBag);v(this,"controladorSplitter");v(this,"gerenciadorValores");v(this,"_conectado",!1);v(this,"lembranca",new lt(()=>({persistir:this.persistir,conectado:this._conectado,storageKey:this.storageKey,id:this.id})));v(this,"_categorias",[]);v(this,"_tipos",[]);v(this,"_tipoSelecionadoId","");v(this,"_termoBusca","");v(this,"_larguraRotuloPorcentagem",45);v(this,"_sincronizandoFlutuante",!1);v(this,"tipoContainerElement");v(this,"corpoElement");v(this,"btnAplicarElement");v(this,"btnDesfazerElement");v(this,"splitterElement");this.shadow=this.attachShadow({mode:"open"}),this.shadow.innerHTML=kr(),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 qt({hostElement:this,getCategorias:()=>this._categorias,onAtualizarBotoesFooter:e=>{this.btnAplicarElement.disabled=!e,this.btnDesfazerElement.disabled=!e},onAtualizarCampoVisual:(e,i)=>he(this.shadow,e,i),onRenderCategorias:()=>this.renderCategorias(),isModoManual:()=>this.getAttribute("modo-aplicar")==="manual"}),this.controladorSplitter=Rt({hostElement:this,corpoElement:this.corpoElement,splitterElement:this.splitterElement,splitterListeners:this.splitterListeners,onLarguraAlterada:e=>{this._larguraRotuloPorcentagem=e}})}static get observedAttributes(){return["titulo","estilo-visual","modo-aplicar","filtro","densidade","largura-rotulo","fechavel","colapsado","flutuante","texto-misto","persistir","storage-key",...I.ATRIBUTOS_DEGRADE]}get larguraRotuloPorcentagem(){return this._larguraRotuloPorcentagem}connectedCallback(){this.listeners.cleanup(),this._conectado=!0,this.atualizarRegistroChavePadrao(),this.persistir&&(this.lembranca.sincronizarSeChaveMudou(),this.lembranca.restaurarOrigensEmCategorias(this._categorias),this.lembranca.aplicarEmCategorias(this._categorias)),Ht({shadow:this.shadow,listeners:this.listeners,host:this,onToggleExpandirTodas:()=>this.toggleExpandirTodas(),onFiltrar:e=>{this._termoBusca=e,this.renderCategorias()},onAplicar:()=>this.aplicar(),onDesfazer:()=>this.desfazer(),onAlternarDensidade:()=>this.alternarDensidade(),onAlternarFlutuante:()=>this.alternarFlutuante(),onAlternarColapsoHorizontal:()=>this.alternarColapsoHorizontal(),onFocarPrimeiroEditor:()=>pt(this.shadow)}),Ft(this,this.shadow,this.listeners),this.controladorSplitter.init(),I.aplicarDegradeNoElemento(this,this.shadow.getElementById("container")),this.syncState()}disconnectedCallback(){this._conectado=!1,this.atualizarRegistroChavePadrao(),this.listeners.cleanup(),this.splitterListeners.cleanup()}attributeChangedCallback(e,i,o){if(i!==o){if(I.ehAtributoDegrade(e)){I.aplicarDegradeNoElemento(this,this.shadow.getElementById("container"));return}switch(e){case"largura-rotulo":{const a=parseFloat(o??"");isNaN(a)||(this._larguraRotuloPorcentagem=this.controladorSplitter.definirLarguraRotulo(a));return}case"estilo-visual":this.renderSeletorTipos();return;case"texto-misto":this.renderCategorias();return;case"filtro":if(O(this.shadow,this),o===null&&this._termoBusca){this._termoBusca="";const a=this.shadow.getElementById("filtro-input");a&&(a.value=""),this.renderCategorias()}return;case"flutuante":this._sincronizandoFlutuante||O(this.shadow,this);return;case"persistir":this.atualizarRegistroChavePadrao(),this._conectado&&this.persistir&&(this.lembranca.sincronizarSeChaveMudou(),this.lembranca.restaurarOrigensEmCategorias(this._categorias),this.lembranca.aplicarEmCategorias(this._categorias),this.atualizarVisaoCategorias());return;case"storage-key":this.atualizarRegistroChavePadrao(),this._conectado&&this.persistir&&(this.lembranca.carregarDoStorage(!0),this.lembranca.restaurarOrigensEmCategorias(this._categorias),this.lembranca.aplicarEmCategorias(this._categorias),this.atualizarVisaoCategorias());return;default:O(this.shadow,this)}}}get titulo(){return this.getAttribute("titulo")||"Propriedades"}set titulo(e){e?this.setAttribute("titulo",e):this.removeAttribute("titulo")}get estiloVisual(){return this.getAttribute("estilo-visual")||"autocad"}set estiloVisual(e){e&&e!=="autocad"?this.setAttribute("estilo-visual",e):this.removeAttribute("estilo-visual")}get modoAplicar(){return this.getAttribute("modo-aplicar")||"imediato"}set modoAplicar(e){e==="manual"?this.setAttribute("modo-aplicar","manual"):this.removeAttribute("modo-aplicar")}get filtro(){return this.hasAttribute("filtro")}set filtro(e){e?this.setAttribute("filtro",""):this.removeAttribute("filtro")}get termoBusca(){return this._termoBusca}set termoBusca(e){this._termoBusca=(e||"").trim().toLowerCase();const i=this.shadow.getElementById("filtro-input");i&&(i.value=e||""),this.renderCategorias()}get larguraRotulo(){return this._larguraRotuloPorcentagem}set larguraRotulo(e){const i=typeof e=="number"?e:parseFloat(String(e));isNaN(i)||this.setAttribute("largura-rotulo",String(i))}get fechavel(){return this.hasAttribute("fechavel")}set fechavel(e){e?this.setAttribute("fechavel",""):this.removeAttribute("fechavel")}get persistir(){return this.getAttribute("persistir")!=="false"}set persistir(e){e===!1?this.setAttribute("persistir","false"):this.removeAttribute("persistir")}get storageKey(){return this.getAttribute("storage-key")}set storageKey(e){e&&e.trim()?this.setAttribute("storage-key",e.trim()):this.removeAttribute("storage-key")}get categorias(){return this._categorias}set categorias(e){this._categorias=Array.isArray(e)?e:[],this.gerenciadorValores.inicializarCategorias(this._categorias),this.lembranca.registrarOrigens(this._categorias),this._conectado&&this.persistir&&this.lembranca.sincronizarSeChaveMudou(),this.lembranca.aplicarEmCategorias(this._categorias),this.renderCategorias()}get textoMisto(){const e=this.getAttribute("texto-misto");return e&&e.trim()?e:se}set textoMisto(e){typeof e=="string"&&e.trim()?this.setAttribute("texto-misto",e):this.removeAttribute("texto-misto")}get tipos(){return this._tipos}set tipos(e){this._tipos=Array.isArray(e)?e:[],this.renderSeletorTipos()}get tipoSelecionado(){const e=this._tipos.filter(o=>o&&o.id!==null&&o.id!==void 0);return!e.some(o=>String(o.id)===this._tipoSelecionadoId)&&e.length>0?String(e[0].id):this._tipoSelecionadoId}set tipoSelecionado(e){this._tipoSelecionadoId=String(e??""),this.renderSeletorTipos()}get valores(){return this.gerenciadorValores.getValores()}set valores(e){this.gerenciadorValores.setValores(e),this.renderCategorias()}get isDirty(){return this.gerenciadorValores.isDirty}get dirty(){return this.gerenciadorValores.isDirty}obterValor(e){return this.gerenciadorValores.obterValor(e)}definirValor(e,i,o=!0){this.gerenciadorValores.definirValor(e,i,o)}redefinirValor(e,i=!0){return this.gerenciadorValores.redefinirValor(e,i)}aplicar(){this.gerenciadorValores.aplicar()}desfazer(){this.gerenciadorValores.desfazer()}expandirTudo(){const e=[];for(const i of this._categorias){const o=M(i);o!==null&&e.push([o,!0])}this.lembranca.registrarVarias(e),ft(this.shadow,this._categorias),e.length>0&&this.emitirEstadoCategorias()}colapsarTudo(){const e=[];for(const i of this._categorias){const o=M(i);o!==null&&e.push([o,!1])}this.lembranca.registrarVarias(e),mt(this.shadow,this._categorias),e.length>0&&this.emitirEstadoCategorias()}toggleCategoria(e){const i=this._categorias.find(n=>M(n)===e);if(!i)return;const o=this.lembranca.estaAberta(i),a=gt(this.shadow,this,this._categorias,e,o);typeof a=="boolean"&&(this.lembranca.registrar(e,a),this.emitirEstadoCategorias())}obterChaveStorageAtual(){return this.lembranca.chaveAtual()}obterEstadoCategorias(){return this.lembranca.obterEstado(this._categorias)}definirEstadoCategorias(e,i){if(!e||typeof e!="object")return;const o=[];for(const[a,n]of Object.entries(e))typeof n=="boolean"&&o.push([a,n]);o.length!==0&&(this.lembranca.registrarVarias(o,(i==null?void 0:i.persistir)!==!1),this.lembranca.aplicarEmCategorias(this._categorias),this.atualizarVisaoCategorias(),i!=null&&i.emitirEvento&&this.emitirEstadoCategorias())}limparEstadoCategorias(){this.lembranca.limpar(this._categorias),this.atualizarVisaoCategorias()}limparLembranca(){this.limparEstadoCategorias()}get densidade(){return this.getAttribute("densidade")||"padrao"}set densidade(e){!e||e==="padrao"?this.removeAttribute("densidade"):this.setAttribute("densidade",e)}alternarDensidade(){const e=Vt(this.getAttribute("densidade")||"padrao");return e==="padrao"?this.removeAttribute("densidade"):this.setAttribute("densidade",e),this.dispatchEvent(new CustomEvent("ui-densidade-alterada",{bubbles:!0,composed:!0,detail:{densidade:e}})),O(this.shadow,this),e}get flutuante(){return this.hasAttribute("flutuante")}set flutuante(e){!!e!==this.hasAttribute("flutuante")&&this.alternarFlutuante()}get colapsado(){return this.hasAttribute("colapsado")}set colapsado(e){!!e!==this.hasAttribute("colapsado")&&this.alternarColapsoHorizontal()}alternarFlutuante(){this._sincronizandoFlutuante=!0;try{const e=Bt(this);return O(this.shadow,this),this.dispatchEvent(new CustomEvent("ui-flutuante-alterado",{bubbles:!0,composed:!0,detail:{flutuante:e,left:this.style.left,top:this.style.top,width:this.style.width,height:this.style.height}})),e}finally{this._sincronizandoFlutuante=!1}}alternarColapsoHorizontal(){const e=this.hasAttribute("colapsado");e?this.removeAttribute("colapsado"):this.setAttribute("colapsado","");const i=!e;return O(this.shadow,this),this.dispatchEvent(new CustomEvent("ui-colapso-horizontal",{bubbles:!0,composed:!0,detail:{colapsado:i}})),i}syncState(){O(this.shadow,this);const e=this.getAttribute("largura-rotulo");if(e){const i=parseFloat(e);isNaN(i)||(this._larguraRotuloPorcentagem=this.controladorSplitter.definirLarguraRotulo(i))}this.renderSeletorTipos(),this.renderCategorias()}toggleExpandirTodas(){this._categorias.some(i=>!!(i&&typeof i=="object")&&!this.lembranca.estaAberta(i))?this.expandirTudo():this.colapsarTudo()}atualizarRegistroChavePadrao(){var i,o;if(this._conectado&&this.persistir&&!((i=this.getAttribute("storage-key"))!=null&&i.trim())&&!((o=this.id)!=null&&o.trim())){const a=B.instanciasChavePadrao.has(this);B.instanciasChavePadrao.add(this),!a&&B.instanciasChavePadrao.size>1&&console.warn('[ui-tabela-propriedades] Múltiplos painéis persistentes conectados sem "id" ou "storage-key". Todos compartilharão a mesma chave de armazenamento.')}else B.instanciasChavePadrao.delete(this)}atualizarVisaoCategorias(){const e=this.shadow.querySelectorAll(".ui-prop__categoria").length>0;if(!this._termoBusca&&e){ht(this.shadow,this._categorias,i=>this.lembranca.estaAberta(i));return}this.renderCategorias()}emitirEstadoCategorias(){const e=this.lembranca.montarDetalheEvento(this._categorias);this.dispatchEvent(new CustomEvent("ui-categorias-estado",{bubbles:!0,composed:!0,detail:e}))}renderSeletorTipos(){Pt({tipoContainerElement:this.tipoContainerElement,tipos:this._tipos,tipoSelecionadoId:this._tipoSelecionadoId,estiloVisual:this.getAttribute("estilo-visual")||"autocad",onSelecionarTipo:e=>{this._tipoSelecionadoId=e,this.renderSeletorTipos();const i=this._tipos.find(o=>o&&String(o.id)===String(e));this.dispatchEvent(new CustomEvent("ui-tipo-alterado",{bubbles:!0,composed:!0,detail:{id:e,tipo:i}}))},onEditarTipo:e=>this.dispatchEvent(new CustomEvent("ui-editar-tipo-clique",{bubbles:!0,composed:!0,detail:{tipo:e}})),onQuickSelect:e=>this.dispatchEvent(new CustomEvent("ui-quick-select",{bubbles:!0,composed:!0,detail:{tipo:e}})),onSelectObjects:e=>this.dispatchEvent(new CustomEvent("ui-selecionar-objetos",{bubbles:!0,composed:!0,detail:{tipo:e}})),onCalculadora:e=>this.dispatchEvent(new CustomEvent("ui-calculadora",{bubbles:!0,composed:!0,detail:{tipo:e}}))})}renderCategorias(){const e=this.shadow.getElementById("lista-categorias");e&&Ot({listaContainer:e,categorias:this._categorias,termoBusca:this._termoBusca,onToggleCategoria:i=>this.toggleCategoria(i),obterCategoriaAberta:i=>this.lembranca.estaAberta(i),linhaCtx:{valoresAtuais:this.gerenciadorValores.getValores(),valoresOriginais:this.gerenciadorValores.getValoresOriginais(),onAtualizarCampoVisual:(i,o)=>he(this.shadow,i,o),onRedefinir:i=>this.redefinirValor(i),editorCtx:{obterValorAtual:i=>this.gerenciadorValores.obterValor(i),registrarAlteracao:(i,o,a)=>{this.gerenciadorValores.registrarAlteracao(i,o,a)},focarProximoEditor:i=>ct(this.shadow,i),focarEditorAnterior:i=>ut(this.shadow,i),obterTextoMisto:()=>this.textoMisto,despacharEventoAcao:(i,o)=>{this.dispatchEvent(new CustomEvent("ui-acao-clique",{bubbles:!0,composed:!0,detail:{id:i.id,categoriaId:o,propriedade:i}}))}}}})}};v(B,"instanciasChavePadrao",new Set);let q=B;class $t extends q{}class jt extends q{}H.definirCustomElement("ui-tabela-propriedades",q);H.definirCustomElement("ui-painel-propriedades",$t);H.definirCustomElement("ui-propriedades",jt);exports.GerenciadorValoresPropriedades=qt;exports.LembrancaCategoriasPropriedades=lt;exports.TEXTO_MISTO_PADRAO=se;exports.TabelaOrquestradorDados=Be;exports.TabelaRemotaController=Te;exports.TabelaSelecaoController=Re;exports.UIPainelPropriedades=$t;exports.UIPropriedades=jt;exports.UITabela=rt;exports.UITabelaPropriedades=q;exports.VALOR_MISTO=ne;exports.abertoPadraoDaCategoria=te;exports.abrirPopoverRedimensionamento=Ge;exports.alternarCategoria=gt;exports.alternarDirecaoOrdenacao=Oe;exports.alternarPosicionamentoFlutuante=Bt;exports.aplicarLimitesNumericos=le;exports.aplicarOrdenacaoTabela=Ie;exports.atualizarCampoVisual=he;exports.avaliarExpressaoMatematica=it;exports.buscarLinhaPropriedade=ye;exports.carregarEstadoPropriedades=at;exports.colapsarTodasCategorias=mt;exports.combinarValores=Ar;exports.conectarArrastoFlutuante=Ft;exports.conectarPainelControles=Ht;exports.criarControladorSplitter=Rt;exports.criarEditorAcao=At;exports.criarEditorBooleano=Et;exports.criarEditorCorCad=Nt;exports.criarEditorCorSwatch=Dt;exports.criarEditorLinetype=St;exports.criarEditorLineweight=zt;exports.criarEditorNumero=wt;exports.criarEditorReadonly=xt;exports.criarEditorSelecao=yt;exports.criarEditorTexto=Ct;exports.criarEditorValor=Tt;exports.criarLinhaPropriedade=It;exports.executarOrquestracaoCorpo=Qe;exports.executarOrquestracaoHeader=Je;exports.executarRedimensionamentoColuna=Ke;exports.executarRedimensionamentoTeclado=Ye;exports.exibirPromptPopoverRedimensionamento=Xe;exports.expandirTodasCategorias=ft;exports.focarEditorAnterior=ut;exports.focarPrimeiroEditor=pt;exports.focarProximoEditor=ct;exports.formatWidth=me;exports.gerarChaveStoragePropriedades=$;exports.getAlignmentClass=ge;exports.getRowHeight=pe;exports.getTextAlign=be;exports.idDaCategoria=M;exports.inicializarScrollVirtualizacao=Ze;exports.iniciarRedimensionamentoColuna=We;exports.interpretarEntradaNumerica=Y;exports.interpretarIndice=ue;exports.isValorMisto=k;exports.limitarLarguraColuna=oe;exports.limparEstadoPropriedades=st;exports.localizarIndiceItem=Pe;exports.marcarSelectMisto=U;exports.montarEstruturaDOM=Fe;exports.normalizarEstadoPersistidoPropriedades=ot;exports.normalizarTexto=G;exports.obterCasasDecimais=W;exports.obterPassoNumerico=vt;exports.orquestrarEstruturaInicial=et;exports.proximaDensidade=Vt;exports.redimensionarColunaPorDelta=Ue;exports.registrarAtualizadorEditor=N;exports.renderizarCategoriasETree=Ot;exports.renderizarCorpoTabela=je;exports.renderizarHeaderTabela=Ve;exports.renderizarSeletorTipos=Pt;exports.salvarEstadoPropriedades=nt;exports.sincronizarAtributosTabela=_e;exports.sincronizarCampoAberto=V;exports.sincronizarDomCategorias=ht;exports.sincronizarPainelControles=O;exports.sincronizarSelect=j;exports.textoMistoDe=D;exports.tratarMudancaAtributoTabela=tt;exports.valorComum=bt;exports.valorInicialDaPropriedade=re;exports.valoresIguais=F;