@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.
- package/CHANGELOG.md +42 -0
- package/README.md +1 -1
- package/dist/botao.cjs +1 -1
- package/dist/botao.js +1 -1
- package/dist/camadas.cjs +50 -50
- package/dist/camadas.js +381 -373
- package/dist/campo-texto.cjs +1 -1
- package/dist/campo-texto.js +1 -1
- package/dist/canvas.cjs +24 -24
- package/dist/canvas.js +757 -751
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/components/ui-avatar/ui-avatar.d.ts +7 -0
- package/dist/components/ui-barra-ferramentas/ui-paleta-ferramentas.d.ts +2 -0
- package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +7 -0
- package/dist/components/ui-mapa/ui-mapa.d.ts +1 -0
- package/dist/components/ui-seletor-mapa-base/ui-seletor-mapa-base.d.ts +6 -0
- package/dist/components/ui-skeleton/ui-skeleton.d.ts +9 -0
- package/dist/components/ui-stat/ui-stat.d.ts +12 -0
- package/dist/components/ui-tabela-propriedades/propriedades-dom-utils.d.ts +2 -1
- package/dist/components/ui-tabela-propriedades/propriedades-persistencia.d.ts +63 -0
- package/dist/components/ui-tabela-propriedades/propriedades-render-arvore.d.ts +1 -0
- package/dist/components/ui-tabela-propriedades/tipos.d.ts +16 -0
- package/dist/components/ui-tabela-propriedades/ui-tabela-propriedades.d.ts +40 -1
- package/dist/core/degrade.d.ts +34 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +33 -24
- package/dist/cores.cjs +1 -1
- package/dist/cores.js +1 -1
- package/dist/custom-elements.json +20565 -19020
- package/dist/data.cjs +1 -1
- package/dist/data.js +89 -79
- package/dist/degrade-CIxvOTUv.cjs +1 -0
- package/dist/degrade-gDa5sW__.js +119 -0
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.js +2 -2
- package/dist/forms.cjs +1 -1
- package/dist/forms.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +215 -196
- package/dist/mapa.cjs +1 -1
- package/dist/mapa.js +1 -1
- package/dist/modal.cjs +1 -1
- package/dist/modal.js +1 -1
- package/dist/register.cjs +1 -1
- package/dist/register.js +11 -11
- package/dist/seletor-mapa-base.cjs +10 -10
- package/dist/seletor-mapa-base.js +34 -28
- package/dist/tabela.cjs +1 -1
- package/dist/tabela.js +83 -73
- package/dist/tipos-elementos.d.ts +33 -3
- package/dist/tipos-vue.d.ts +30 -3
- package/dist/tools.cjs +1 -1
- package/dist/tools.js +1 -1
- package/dist/ui-badge-1UU8vT-b.js +198 -0
- package/dist/ui-badge-CKKKPdt8.cjs +28 -0
- package/dist/ui-badge-DE58YSBY.cjs +28 -0
- package/dist/ui-badge-KgmI3jOD.js +201 -0
- package/dist/ui-botao-Dz8YvmiA.cjs +12 -0
- package/dist/ui-botao-bU_bf6SU.js +166 -0
- package/dist/ui-botao-xTbH5mpH.cjs +12 -0
- package/dist/ui-botao-zLkcMMyP.js +168 -0
- package/dist/ui-campo-texto-DVU_sWV1.cjs +16 -0
- package/dist/ui-campo-texto-Dliyt9qr.cjs +16 -0
- package/dist/ui-campo-texto-W5M0gNE4.js +377 -0
- package/dist/ui-campo-texto-btevggO3.js +379 -0
- package/dist/ui-card-BYyYxxY1.cjs +20 -0
- package/dist/ui-card-CojoGXaT.js +144 -0
- package/dist/ui-card-DFnRp9bl.js +146 -0
- package/dist/ui-card-DrWVJQKw.cjs +20 -0
- package/dist/ui-controle-cores-Bq_XUrIQ.cjs +32 -0
- package/dist/ui-controle-cores-BtA6yzu3.js +291 -0
- package/dist/ui-kit.css +1 -1
- package/dist/ui-linha-2kY7TNUJ.cjs +38 -0
- package/dist/ui-linha-DAz6DBcl.cjs +38 -0
- package/dist/ui-linha-DkxwMhD-.js +749 -0
- package/dist/ui-linha-KFF86FW5.js +752 -0
- package/dist/ui-modal-4nU-tXjO.cjs +18 -0
- package/dist/ui-modal-BrXzVZ65.js +216 -0
- package/dist/ui-modal-BwB9fksp.js +214 -0
- package/dist/ui-modal-lARKzEVZ.cjs +18 -0
- package/dist/ui-paleta-ferramentas-Bu6JaT0s.js +1245 -0
- package/dist/ui-paleta-ferramentas-D3Jhwt26.cjs +21 -0
- package/dist/ui-skeleton-BLEV6h3k.js +653 -0
- package/dist/ui-skeleton-B_XTaGrX.cjs +52 -0
- package/dist/ui-skeleton-DEHwpDqa.js +648 -0
- package/dist/ui-skeleton-sIphhOSx.cjs +52 -0
- package/dist/ui-switch-BXIDwC-Y.cjs +66 -0
- package/dist/ui-switch-Ctxk-jKS.js +1212 -0
- package/dist/ui-switch-DAIgOhqr.cjs +66 -0
- package/dist/ui-switch-_F8yubdX.js +1203 -0
- package/dist/ui-tabela-propriedades-2bq2nX-b.js +3202 -0
- package/dist/ui-tabela-propriedades-CJyo568n.js +3517 -0
- package/dist/ui-tabela-propriedades-CnfW9DZG.cjs +142 -0
- package/dist/ui-tabela-propriedades-Wa34hfIr.cjs +142 -0
- package/package.json +187 -187
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";var Nt=Object.defineProperty;var Tt=(r,t,e)=>t in r?Nt(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var v=(r,t,e)=>Tt(r,typeof t!="symbol"?t+"":t,e);const W=require("./listener-bag-D5omxZ9h.cjs"),R=require("./parts-vQa2873h.cjs"),P=require("./ssr-safe-CiHD1adl.cjs"),O=require("./degrade-CIxvOTUv.cjs"),Dt=require("./svg-seguro-J2RM1Ssf.cjs");class Ce{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,c;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(((c=(u=this.ctx).getFetcher)==null?void 0:c.call(u))??((b,E)=>fetch(b,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)||[],g=Array.isArray(m)?m:[];return i()?(a="render",this.ctx.onDadosRecebidos(g),o(),this.ctx.onCarregandoAlterado(!1),this.emitir("ui-fetch-sucesso",{url:t,total:g.length,dados:g}),!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 Rt=["id","_id","codigo","key"];function It(r,t){return r!=null&&(r===t||String(r)===String(t))}function oe(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 ke(r,t,e="id",i=!1){if(!r||r.length===0)return-1;if(typeof t=="function")return r.findIndex(t);if(i)return oe(t,r.length);const o=[e,...Rt.filter(a=>a!==e)];for(const a of o){const n=r.findIndex(s=>!!s&&typeof s=="object"&&It(s[a],t));if(n!==-1)return n}return oe(t,r.length)}class Se{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=ke(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 ze(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 Ot=new Intl.Collator("pt-BR",{numeric:!0,sensitivity:"base"});function xe(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 Bt(r,t,e){if(e==="data"||!e&&(r instanceof Date||t instanceof Date)){const i=xe(r),o=xe(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 Ot.compare(String(r),String(t))}function Le(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,c=l==null;return u||c?u===c?0:u?1:-1:i!=null&&i.comparador?i.comparador(s,l,a,n)*o:s===l?0:Bt(s,l,i==null?void 0:i.tipo)*o})}function j(r){return r.normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase()}class Me{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=ze(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]:Le(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(j(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 j(s).includes(e)})}temFiltro(){return this.ultimoFiltro!==""}filtrar(t){this.ultimoFiltro=j((t||"").trim()),this.aplicarOrdenacao()}}const Pt=':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 le(r){return r==null||r===""?"":typeof r=="number"?`${r}px`:r}function de(r){return r==="centro"||r==="center"?"ui-tabela--alinhar-centro":r==="direita"||r==="right"?"ui-tabela--alinhar-direita":"ui-tabela--alinhar-esquerda"}function ce(r){return r==="centro"||r==="center"?"center":r==="direita"||r==="right"?"right":"left"}function ae(r){return r==="compacta"?30:r==="relaxada"?56:42}function Ne(r,t,e,i){r.innerHTML=`<style>${Pt}</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"),c=document.createElement("thead"),p=document.createElement("tbody");l.appendChild(u),l.appendChild(c),l.appendChild(p);const d=document.createElement("div");d.className="ui-tabela__erro",d.setAttribute("part","erro"),d.setAttribute("role","alert"),d.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 g=document.createElement("button");g.type="button",g.className="ui-tabela__erro-acao",g.setAttribute("part","erro-acao"),g.textContent="Tentar novamente",d.appendChild(h),d.appendChild(g);const b=document.createElement("div");b.className="ui-tabela__sr",b.setAttribute("role","status"),b.setAttribute("aria-live","polite"),o.appendChild(d),o.appendChild(l),o.appendChild(a),o.appendChild(b);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:c,tbodyElement:p,colgroupElement:u,emptyElement:a,loadingElement:E,erroElement:d,anuncioElement:b}}function Te(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 c=document.createElement("th"),p=r.getAlignmentClass(s.alinhamento);if(c.className=p,c.setAttribute("part","celula-cabecalho"),c.scope="col",c.setAttribute("data-coluna",s.id),c.style.textAlign=r.getTextAlign(s.alinhamento),s.largura!==void 0&&(c.style.width=r.formatWidth(s.largura)),s.larguraMinima!==void 0&&(c.style.minWidth=r.formatWidth(s.larguraMinima)),s.larguraMaxima!==void 0){const _=r.formatWidth(s.larguraMaxima);c.style.maxWidth=_,c.style.overflow="hidden",c.style.textOverflow="ellipsis",c.style.whiteSpace="nowrap"}s.tooltip&&(c.title=s.tooltip);const d=!!s.ordenavel&&r.colunaOrdenada===s.id&&r.direcaoOrdenacao!=="original",h=d&&r.direcaoOrdenacao==="desc";if(s.ordenavel){c.classList.add("ui-tabela__th--ordenavel");const _=()=>r.onHeaderClick(s);r.headerListeners.add(c,"click",_),c.setAttribute("aria-sort",d?h?"descending":"ascending":"none")}const f=_=>r.onHeaderContextMenu(_,s,l,c);r.headerListeners.add(c,"contextmenu",f);const m=document.createElement("div");m.className="ui-tabela__header-content";const g=document.createElement("span");if(g.className="ui-tabela__header-text",g.textContent=s.rotulo,m.appendChild(g),s.ordenavel){const _=document.createElement("span");_.className="ui-tabela__sort-icon";const x=d?h?"ui-tabela__sort-arrow--desc":"ui-tabela__sort-arrow--asc":"ui-tabela__sort-arrow--inativo";_.setAttribute("aria-hidden","true"),_.innerHTML=`<svg class="ui-tabela__sort-arrow ${x}" 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(_)}if(s.ordenavel){const _=document.createElement("button");_.type="button",_.className="ui-tabela__ordenar",_.setAttribute("part","ordenar"),_.appendChild(m),c.appendChild(_)}else c.appendChild(m);const b=document.createElement("div");b.className="ui-tabela__resizer",b.setAttribute("part","redimensionador"),b.title="Arrastar para redimensionar largura (duplo-clique para auto-ajuste)",b.tabIndex=0,b.setAttribute("role","separator"),b.setAttribute("aria-orientation","vertical"),b.setAttribute("aria-label",`Redimensionar coluna ${s.rotulo}`);const E=_=>r.onInitColumnResize(_,s,l,c,b);r.headerListeners.add(b,"mousedown",E);const y=_=>{const x=_;x.pointerType==="mouse"||!x.pointerType||r.onInitColumnResize(x,s,l,c,b)};r.headerListeners.add(b,"pointerdown",y);const w=_=>{var A,z;const x=_,C=x.shiftKey?50:10;if(x.key==="ArrowRight")x.preventDefault(),(A=r.onResizeTeclado)==null||A.call(r,C,s,l,c,u);else if(x.key==="ArrowLeft")x.preventDefault(),(z=r.onResizeTeclado)==null||z.call(r,-C,s,l,c,u);else if(x.key==="Enter"||x.key==="F2"){x.preventDefault();const S=c.getBoundingClientRect();r.onHeaderContextMenu(new MouseEvent("contextmenu",{clientX:S.left,clientY:S.bottom}),s,l,c)}};r.headerListeners.add(b,"keydown",w);const L=_=>{_.stopPropagation(),r.onColumnAutoFit(s,c,u)};r.headerListeners.add(b,"dblclick",L),r.headerListeners.add(b,"click",_=>_.stopPropagation()),c.appendChild(b),o.appendChild(c)}),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 Y=new WeakMap,ue=new WeakMap;function X(r){return r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement}function De(r){return r instanceof HTMLInputElement&&(r.type==="checkbox"||r.type==="radio")?r.checked:r.value}function Ft(r){r.querySelectorAll("input, textarea, select").forEach(t=>{X(t)&&ue.set(t,De(t))})}function Vt(r){try{const t=r;return{inicio:t.selectionStart??null,fim:t.selectionEnd??null}}catch{return{inicio:null,fim:null}}}function qt(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}=Vt(e),s=X(e)?ue.get(e):void 0,l=X(e)?De(e):void 0,u=s!==void 0&&l!==s;return{digitado:u?l:void 0,valorInicial:u?s:void 0,item:Y.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 Ht(r,t){const e=Array.from(r.querySelectorAll("tr[data-index]"));if(t.item){const i=e.find(o=>Y.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 $t(r,t){if(!t)return;const e=Ht(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&&X(o)&&ue.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 jt=["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(", "),Re=new WeakMap;function Ut(r,t){for(const e of r.composedPath()){if(e===t)return!1;if(e instanceof Element&&e.matches(jt))return!0}return!1}function K(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 Wt(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),Ft(o),o}function Ie(r,t,e,i){const o=document.createElement("tr");Y.set(o,t),Re.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=>{Ut(n,o)||r.onLinhaClique(t,e)}),r.colunas.forEach(n=>{o.appendChild(Wt(r,n,t,e))}),o}function Xt(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 Kt(r,t,e,i,o){return e>=i&&e<o&&Y.get(t)===r.dadosExibicao[e]&&Re.get(t)===r.colunas}function Gt(r,t,e,i,o,a,n){const s=r.dadosExibicao.length,l=r.colunas.length||1,u=new Map;let c=null,p=null;for(const m of Array.from(t.children)){const g=m.getAttribute("data-espacador");if(g==="topo"){c=m;continue}if(g==="base"){p=m;continue}const b=Number(m.getAttribute("data-index"));m.hasAttribute("data-index")&&!u.has(b)&&Kt(r,m,b,e,i)?u.set(b,m):m.remove()}const d=a&&e>0?e*o:0;d>0?c?(c.style.height=`${d}px`,c.firstElementChild.colSpan=l):(c=K("topo",d,l),t.insertBefore(c,t.firstChild)):c&&(c.remove(),c=null);let h=c?c.nextSibling:t.firstChild;for(let m=e;m<i;m++){const g=r.dadosExibicao[m],b=u.get(m);b?(Xt(r,b,g,m,n),b===h?h=b.nextSibling:t.insertBefore(b,h)):t.insertBefore(Ie(r,g,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(K("base",f,l)):p&&p.remove()}function Yt(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(K("topo",e*o,l));for(let c=e;c<i;c++)u.appendChild(Ie(r,r.dadosExibicao[c],c,n));a&&i<s&&u.appendChild(K("base",(s-i)*o,l)),t.appendChild(u)}function Oe(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,c=qt(n),p=r.indiceAtivo??null,d=p!==null&&p>=o&&p<a?p:o;if(r.modo==="rolagem"?Gt(r,n,o,a,e,i,d):Yt(r,n,o,a,e,i,d),u!==null){const h=n.querySelector(`tr[data-index="${u}"]`);h&&s.activeElement!==h&&h.focus({preventScroll:!0})}else c&&!(l&&l.isConnected)&&$t(n,c)}function _e(r){if(r===void 0)return null;const t=typeof r=="number"?r:parseInt(r,10);return isNaN(t)?null:t}function Q(r,t){const e=_e(r.larguraMinima);let i=Math.max(e??60,t);const o=_e(r.larguraMaxima);return o!==null&&(i=Math.min(o,i)),i}function Be(r,t,e,i){const o=Q(r,t.offsetWidth+i);return r.largura=`${o}px`,t.style.width=`${o}px`,e&&(e.style.width=`${o}px`),`${o}px`}function Pe(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 c=t.pageX,p=o.offsetWidth,d=n==null?void 0:n.children[i],h=t.type==="pointerdown",f=h?t.pointerId:null,m=h?"pointermove":"mousemove",g=h?"pointerup":"mouseup";let b=!1;const E=L=>{const _=L;if(f!==null&&_.pointerId!==f)return;b=!0;const x=Q(e,p+(_.pageX-c));e.largura=`${x}px`,o.style.width=`${x}px`,d&&(d.style.width=`${x}px`)},y=()=>{w(),b?l(String(e.largura)):u==null||u()},w=()=>{a.classList.remove("ui-tabela__resizer--ativo"),window.removeEventListener(m,E),window.removeEventListener(g,y),h&&window.removeEventListener("pointercancel",y)};return window.addEventListener(m,E),window.addEventListener(g,y),h&&window.addEventListener("pointercancel",y),w}const H=20;let Qt=0;function Fe(r){var z;const{evento:t,coluna:e,colIndex:i,thElement:o,colgroupElement:a,shadow:n,onResizeEnd:s}=r,l=`ui-tabela-dlg-${++Qt}`,u=document.createElement("dialog");u.className="ui-tabela__prompt-dialog",u.setAttribute("part","dialogo"),u.setAttribute("aria-labelledby",`${l}-titulo`);const c=document.createElement("label");c.className="ui-tabela__prompt-title",c.id=`${l}-titulo`,c.htmlFor=`${l}-campo`,c.textContent=`Largura de "${e.rotulo}" (px; vazio = automática)`;const p=document.createElement("input");p.id=`${l}-campo`,p.type="number",p.min=String(H),p.step="1",p.setAttribute("inputmode","numeric"),p.placeholder="auto";const d=e.largura?parseInt(String(e.largura),10):NaN;p.value=Number.isFinite(d)?String(d):"";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 g=document.createElement("button");g.type="button",g.textContent="Cancelar",f.appendChild(g),f.appendChild(m),u.appendChild(c),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 b=u.getBoundingClientRect(),E=b.width||240,y=b.height||140,w=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=`${w}px`,u.style.top=`${L}px`;let _=!1;const x=()=>{var S;_||(_=!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()},A=()=>{const S=e.largura,ve=p.value.trim();if(ve==="")e.largura=void 0,o.style.width="",a!=null&&a.children[i]&&(a.children[i].style.width="");else{const re=Number(ve);if(!Number.isFinite(re)||re<H){C(`Informe um valor de pelo menos ${H} px, ou deixe vazio para automática.`);return}const ie=Math.round(Q({...e,larguraMinima:e.larguraMinima??H},re));e.largura=`${ie}px`,o.style.width=`${ie}px`,a!=null&&a.children[i]&&(a.children[i].style.width=`${ie}px`)}x(),e.largura!==S&&s(e.largura?String(e.largura):"auto")};m.addEventListener("click",S=>{S.stopPropagation(),A()}),g.addEventListener("click",S=>{S.stopPropagation(),x()}),u.addEventListener("close",x),p.addEventListener("input",()=>{h.textContent="",p.removeAttribute("aria-invalid"),p.removeAttribute("aria-describedby")}),p.addEventListener("keydown",S=>{S.key==="Enter"?(S.preventDefault(),A()):S.key==="Escape"&&(S.preventDefault(),x())}),p.focus(),(z=p.select)==null||z.call(p)}function Ve(r,t,e,i,o,a){return Pe({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 qe(r,t,e,i,o){r.preventDefault(),r.stopPropagation(),Fe({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 He(r,t,e,i,o){const a=Be(t,e,i,r);o.host.dispatchEvent(new CustomEvent("ui-column-resize",{detail:{idColuna:t.id,largura:a},bubbles:!0,composed:!0}))}function $e(r){Te({theadElement:r.theadElement,colgroupElement:r.colgroupElement,colunas:r.colunas,colunaOrdenada:r.dadosController.getColunaOrdenada(),direcaoOrdenacao:r.dadosController.getDirecaoOrdenacao(),headerListeners:r.headerListeners,formatWidth:le,getAlignmentClass:de,getTextAlign:ce,onHeaderClick:t=>r.onHeaderClick(t),onHeaderContextMenu:(t,e,i,o)=>{qe(t,e,i,o,{host:r.host,colgroupElement:r.colgroupElement,shadow:r.shadow,onSetIsResizing:r.onSetIsResizing})},onInitColumnResize:(t,e,i,o,a)=>{const n=Ve(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)=>{He(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 je(r){Oe({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:le,getAlignmentClass:de,getTextAlign:ce})}function Ue(r,t){let e=!1;const i=()=>{e||(window.requestAnimationFrame(()=>{try{t()}finally{e=!1}}),e=!0)};return r.addEventListener("scroll",i),i}function We(r,t,e,i){return Ne(r,t,e,i)}function pe(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 Xe(r,t,e){if(pe(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 Jt(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 Zt="Não foi possível carregar os dados.",er="Nenhum resultado para o filtro";function tr(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||Zt),a&&(a.textContent=t.erro||"");const n=r.querySelector(".ui-tabela__erro-acao");n&&(n.style.display=i?"":"none"),r.style.display="flex"}function rr(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 ir({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 or=800;function Ee(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 ye(r,t,e){e==="smooth"&&typeof r.scrollTo=="function"?r.scrollTo({top:t,behavior:"smooth"}):r.scrollTop=t}class ar{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=Ee(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 d=a();if(!d)return;const h=Ee(i,d,this.alturaCabecalho());h&&ye(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;ye(i,Math.max(0,t*this.p.alturaLinha()),"smooth");let l=!0;const u=()=>{l&&(this.cancelar(),this.p.renderizarCorpo(),a()?n("smooth"):s())},c=window.setTimeout(u,or);return i.addEventListener("scrollend",u,{once:!0}),this.cancelarCorrecao=()=>{l=!1,window.clearTimeout(c),i.removeEventListener("scrollend",u),this.cancelarCorrecao=null},!0}cancelar(){var t;(t=this.cancelarCorrecao)==null||t.call(this)}}class Ke extends P.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 W.ListenerBag);v(this,"_corpoListeners",new W.ListenerBag);v(this,"_indiceAtivo",null);v(this,"_alturaLinhaMedida",null);v(this,"rolagem",new ar({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 Me);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=Jt(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 Ce({host:this,onCarregandoAlterado:e=>{this.carregando=e},onDadosRecebidos:e=>{this.dados=e},getOpcoes:()=>this._fetchOpcoes,getFetcher:()=>this._fetcher}),this.selecaoController=new Se({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",...O.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(O.ehAtributoDegrade(e)){O.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(),Xe(e,o,this.obterContextoAtributos()),this.sincronizarAria()}sincronizarAria(){this._tableElement&&(ir({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(){tr(this._erroElement,this._erro,this.getAttribute("texto-erro"),!!this._src)}anunciarResultado(){rr(this._anuncioElement,this.dadosController.getDadosExibicao().length,this.dadosController.temFiltro(),this._textoSemResultados())}_textoSemResultados(){return this.getAttribute("texto-sem-resultados")||er}syncAttributes(){pe(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??ae(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-ae(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=We(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()})}O.aplicarDegradeNoElemento(this,this._containerElement),this.renderHeader(),this.renderBody(),this._virtualizar&&this._containerElement&&!this._scrollHandler&&(this._scrollHandler=Ue(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(){$e(this.obterContextoRenderizador())}renderBody(e="completo"){je(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})}}P.definirCustomElement("ui-tabela",Ke);const T=Math.PI/180,we=64;function D(r){return Math.abs(r)<1e-12?0:Number(r.toPrecision(15))}const nr={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=>D(r/T),rad:r=>D(r*T),sin:r=>D(Math.sin(r*T)),cos:r=>D(Math.cos(r*T)),tan:r=>D(Math.tan(r*T)),asin:r=>D(Math.asin(r)/T),acos:r=>D(Math.acos(r)/T),atan:r=>D(Math.atan(r)/T)},sr={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?D(Math.atan2(r[0],r[1])/T):NaN,mod:r=>r.length===2&&r[1]!==0?r[0]%r[1]:NaN};function Ge(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>we)throw new Error("Profundidade máxima excedida");try{s();let d=u();for(s();e<t.length;){const h=a();if(h==="+"||h==="-"){n(),s();const f=u(),m=o;s(),m?d=h==="+"?d+d*f:d-d*f:d=h==="+"?d+f:d-f,o=!1}else break}return d}finally{i--}}function u(){s();let d=c(),h=o;for(s();e<t.length;){const f=a();if(f==="*"||f==="/"||f==="x"||f==="X"){n(),s();const m=c();if(h=!1,f==="/"&&m===0)throw new Error("Divisão por zero");d=f==="/"?d/m:d*m,s()}else break}return o=h,d}function c(){if(++i>we)throw new Error("Profundidade máxima excedida");try{s();const d=a();if(d==="+"||d==="-"){n();const m=c();return d==="-"?-m:m}let h=p();const f=o;if(s(),a()==="^"){n();const m=c();h=Math.pow(h,m),o=!1}else if(t.slice(e,e+2)==="**"){e+=2;const m=c();h=Math.pow(h,m),o=!1}else o=f;return h}finally{i--}}function p(){s(),o=!1;const d=a();if(d==="+"||d==="-"){n();const g=p();return d==="-"?-g:g}if(d==="("){n();const g=l();if(s(),n()!==")")throw new Error("Parêntese sem fechamento");return s(),a()==="%"?(n(),o=!0,g/100):(o=!1,g)}const h=t.slice(e).match(/^([a-zA-Z_]\w*)\s*\(/);if(h){const g=h[1].toLowerCase(),b=nr[g],E=sr[g];if(!b&&!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 w=E?E(y):y.length===1&&b?b(y[0]):NaN;if(isNaN(w))throw new Error("Resultado inválido de função");return s(),a()==="%"?(n(),o=!0,w/100):(o=!1,w)}const f=t.slice(e).match(/^(pi|π|e)\b/i);if(f){e+=f[0].length;let b=f[1].toLowerCase()==="e"?Math.E:Math.PI;return s(),a()==="%"&&(n(),o=!0,b=b/100),b}const m=t.slice(e).match(/^(?:[0-9]+(?:\.[0-9]+)?|\.[0-9]+|,[0-9]+)(?:[eE][+-]?[0-9]+)?/);if(m){e+=m[0].length;let g=parseFloat(m[0].replace(",","."));return s(),a()==="%"&&(n(),o=!0,g=g/100),g}throw new Error("Caractere inválido: "+d)}try{const d=l();return s(),e<t.length?null:typeof d=="number"&&isFinite(d)?d:null}catch{return null}}const he='.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 fe(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 Ye=new WeakMap;function M(r,t){Ye.set(r,t)}function ne(r,t,e){var a,n;const i=fe(r,t),o=(a=i==null?void 0:i.querySelector(".ui-prop__col-valor"))==null?void 0:a.firstElementChild;o&&((n=Ye.get(o))==null||n(e))}function F(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 V(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 Qe(r,t){const e=Array.from(r.querySelectorAll(he)),i=e.indexOf(t);if(i!==-1&&i+1<e.length){const o=e[i+1];o.focus(),o instanceof HTMLInputElement&&o.select()}}function Je(r,t){const e=Array.from(r.querySelectorAll(he)),i=e.indexOf(t);if(i>0){const o=e[i-1];o.focus(),o instanceof HTMLInputElement&&o.select()}}function Ze(r){const t=r.querySelector(he);t&&(t.focus(),t instanceof HTMLInputElement&&t.select())}function me(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 et(r,t){t.forEach(e=>{!e||typeof e!="object"||(e.aberto=!0,"aberta"in e&&(e.aberta=!0))}),r.querySelectorAll(".ui-prop__categoria").forEach(e=>me(e,!0))}function tt(r,t){t.forEach(e=>{!e||typeof e!="object"||(e.aberto=!1,"aberta"in e&&(e.aberta=!1))}),r.querySelectorAll(".ui-prop__categoria").forEach(e=>me(e,!1))}function rt(r,t,e,i){const o=e.find(a=>a&&String(a.id)===String(i));if(o){const a=Array.from(r.querySelectorAll("[data-cat-id]")).find(l=>l.getAttribute("data-cat-id")===String(i)),s=!(a?a.classList.contains("ui-prop__categoria--aberta"):o.aberto!==void 0?o.aberto!==!1:o.aberta!==!1);o.aberto=s,"aberta"in o&&(o.aberta=s),a&&me(a,s),t.dispatchEvent(new CustomEvent("ui-categoria-toggle",{bubbles:!0,composed:!0,detail:{id:i,aberto:s}}))}}const J=Symbol.for("ui-tabela-propriedades:misto"),Z="Varia";function k(r){return r===J}function N(r){var e;let t;try{t=(e=r.obterTextoMisto)==null?void 0:e.call(r)}catch{}return typeof t=="string"&&t.trim()?t:Z}function B(r,t){return r==null&&t==null?!0:Object.is(r,t)}function G(r){return r.misto?J:r.valor}function it(r){if(!Array.isArray(r)||r.length===0)return;const t=r[0];for(let e=1;e<r.length;e++)if(!B(t,r[e]))return J;return t}function lr(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]=it(t.map(a=>o in a?a[o]:void 0))}),i}function q(r){if(typeof r.casasDecimais=="number"&&r.casasDecimais>=0)return r.casasDecimais;if(typeof r.precisao=="number"&&r.precisao>=0)return r.precisao}function ot(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 ee(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 U(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=Ge(e);if(o===null||!Number.isFinite(o))return null;const a=q(t),n=ee(o,t);return Number(a!==void 0?n.toFixed(a):n.toPrecision(15))}function at(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 nt(r,t,e){const i=document.createElement("span"),o=e?q(e):void 0,a=n=>{if(k(n)){i.className="ui-prop__valor-readonly ui-prop__editor--misto",i.textContent=t?N({obterTextoMisto:t}):Z;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),M(i,a),i}function st(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 c=k(u),p=!c&&!!u;o.classList.toggle("ui-prop__editor--misto",c),a.classList.toggle("ui-prop__checkbox-custom--marcado",p),a.classList.toggle("ui-prop__checkbox-custom--misto",c),a.textContent=c?"–":p?"✓":"",n.textContent=c?N(i):p?"Sim":"Não",o.setAttribute("aria-checked",c?"mixed":String(p))};s(e),M(o,s),o.appendChild(a),o.appendChild(n);const l=()=>{const u=i.obterValorAtual(t.id),c=k(u)?!0:!u;i.registrarAlteracao(r,t.id,c),s(c)};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 lt(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)?V(o,N(i)):F(o,n)};return a(e),M(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 dt(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 ct(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=q(t),n=d=>{if(d==null||d===""||k(d))return"";const h=Number(d);return isNaN(h)?String(d):a!==void 0?h.toFixed(a):String(h)},s=d=>{o.value=n(d),at(o,t,k(d),N(i))};s(e),M(o,s);let l=null;const u=()=>{o.classList.remove("ui-prop__editor-input--calculando"),o.title="",l&&(l.hidden=!0)},c=d=>{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=d,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 d=o.value.trim(),f=!/^[+-]?[0-9]*[.,]?[0-9]*$/.test(d)&&(d.startsWith("=")||/[\+\-\*\/\^\%\(\);]|^[a-zA-Z_π]/.test(d));if(o.classList.toggle("ui-prop__editor-input--calculando",f),f){const m=U(d,t),g=m!==null?`= ${n(m)}`:"= ?";o.title=m!==null?g:"",c(g)}else u()});const p=()=>{u();const d=o.value.trim(),h=i.obterValorAtual(t.id);if(d===n(h))return;if(d===""){if(k(h))return;i.registrarAlteracao(r,t.id,null);return}const f=U(d,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",d=>{if(d.key==="Enter")p(),d.shiftKey&&i.focarEditorAnterior?i.focarEditorAnterior(o):i.focarProximoEditor(o);else if(d.key==="Escape")d.preventDefault(),d.stopPropagation(),u(),s(i.obterValorAtual(t.id)),o.blur();else if(d.key==="ArrowUp"||d.key==="ArrowDown"){d.preventDefault(),u();const h=U(o.value,t),f=i.obterValorAtual(t.id);if(h===null&&k(f))return;const m=h??(Number(f)||0);let g=ot(t,a);d.shiftKey?g*=10:d.altKey&&a===void 0&&(g*=.1);let b=d.key==="ArrowUp"?m+g:m-g;b=ee(b,t),a!==void 0?b=Number(b.toFixed(a)):b=Math.round(b*1e4)/1e4,i.registrarAlteracao(r,t.id,b),s(b)}}),o}function ut(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),at(o,t,l,N(i))};a(e),M(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 pt=(r,t)=>r.toLowerCase()===String(t??"").toLowerCase();function be(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 ht(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 d=String(p||"").toLowerCase();d.includes("center")||d.includes("eixo")||d.includes("dashdot")||d.includes("traço-ponto")?n.setAttribute("stroke-dasharray","8,3,2,3"):d.includes("dash")||d.includes("tracej")||d.includes("hidden")?n.setAttribute("stroke-dasharray","6,3"):d.includes("dot")||d.includes("ponto")||d.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"}];be(l,u);const c=p=>{const d=k(p);if(o.classList.toggle("ui-prop__editor--misto",d),d){s(""),V(l,N(i));return}s(p),F(l,p,pt)};return c(e),M(o,c),l.addEventListener("change",()=>{const p=u.find(d=>d&&String(d.id)===l.value);i.registrarAlteracao(r,t.id,p?p.id:l.value),c(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 ft(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 d=parseFloat(String(p).replace(/[^0-9.]/g,""));return isNaN(d)||d<=0?1.5:Math.min(8,Math.max(1,d*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"}];be(l,u);const c=p=>{const d=k(p);o.classList.toggle("ui-prop__editor--misto",d),n.setAttribute("stroke-width",String(s(d?"":p))),d?V(l,N(i)):F(l,p,pt)};return c(e),M(o,c),l.addEventListener("change",()=>{const p=u.find(d=>d&&String(d.id)===l.value);i.registrarAlteracao(r,t.id,p?p.id:l.value),c(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 ge=[{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"}],mt=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i;function se(r){const t=String(r??"").trim().toLowerCase(),e=ge.find(i=>String(i.indice)===t||i.nome.toLowerCase()===t);return e?e.nome.toLowerCase():t}function dr(r){const t=se(r),e=ge.find(i=>i.nome.toLowerCase()===t);return e?e.hex:mt.test(t)?t:"#ffffff"}function bt(r){return r.length===4?"#"+r.slice(1).split("").map(t=>t+t).join(""):r}function gt(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)),be(n,[{id:"ByLayer",rotulo:"ByLayer"},{id:"ByBlock",rotulo:"ByBlock"},...ge.map(c=>({id:c.nome,rotulo:`${c.nome} (${c.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=c=>{const p=k(c);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",V(n,N(i));return}const d=dr(c);a.style.backgroundColor=d,l.value=bt(d),F(n,c,(h,f)=>se(h)===se(f),h=>h==null||h===""?"—":String(h))};return u(e),M(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",c=>{c.key==="Enter"&&(c.shiftKey&&i.focarEditorAnterior?i.focarEditorAnterior(n):i.focarProximoEditor(n))}),o.appendChild(a),o.appendChild(n),o.appendChild(l),o}function vt(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 c=k(u);if(o.classList.toggle("ui-prop__editor--misto",c),a.classList.toggle("ui-prop__cor-amostra--misto",c),c){const d=N(i);a.style.backgroundColor="",n.textContent=d,s.value="#ffffff",o.setAttribute("aria-label",`${t.rotulo??t.id}: ${d}`);return}const p=typeof u=="string"&&mt.test(u)?bt(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),M(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 xt(r,t,e,i){let o;return t.somenteLeitura||t.tipo==="readonly"?o=nt(e,i.obterTextoMisto,t):t.tipo==="booleano"?o=st(r,t,e,i):t.tipo==="linha"||t.tipo==="linetype"?o=ht(r,t,e,i):t.tipo==="espessura"||t.tipo==="lineweight"?o=ft(r,t,e,i):t.tipo==="cor-cad"?o=gt(r,t,e,i):t.tipo==="selecao"?o=lt(r,t,e,i):t.tipo==="cor"?o=vt(r,t,e,i):t.tipo==="acao"?o=dt(r,t,i):t.tipo==="numero"?o=ct(r,t,e,i):o=ut(r,t,e,i),o.setAttribute("part","editor"),t.dica&&o.setAttribute("aria-description",t.dica),o}function _t(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?Dt.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 c=document.createElement("select");c.className="ui-prop__tipo-select",c.setAttribute("aria-label","Selecionar tipo de família"),t.forEach(d=>{const h=document.createElement("option");h.value=String(d.id),h.textContent=`${d.rotulo??d.id}${d.subtipo?` : ${d.subtipo}`:""}`,String(d.id)===String(e.id)&&(h.selected=!0),c.appendChild(h)}),c.addEventListener("change",()=>{r.onSelecionarTipo(c.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(c),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 c=document.createElement("option");c.value=String(u.id),c.textContent=String(u.rotulo??u.id),String(u.id)===String(e.id)&&(c.selected=!0),o.appendChild(c)}),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 Et(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 d=l.width;if(d<=0)return;const h=p.clientX-l.left;let b=Math.max(80,Math.min(d-130,h))/d*100;b=Math.max(20,Math.min(65,b)),e(b)},c=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",c),r.splitterElement.removeEventListener("pointercancel",c),i(t)}};r.splitterElement.addEventListener("pointermove",u),r.splitterElement.addEventListener("pointerup",c),r.splitterElement.addEventListener("pointercancel",c)};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 c=e(u);i(c)}})}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 ur(){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 yt(r){const{listaContainer:t,categorias:e,termoBusca:i,onToggleCategoria:o,linhaCtx:a}=r;t.innerHTML="";const n=(Array.isArray(e)?e:[]).filter(c=>!!(c&&typeof c=="object"));if(n.length===0){const c=document.createElement("div");c.className="ui-prop__vazio",c.setAttribute("part","vazio"),c.textContent="Nenhuma propriedade disponível.",t.appendChild(c);return}const s=document.createDocumentFragment(),l=(i||"").trim().toLowerCase();let u=0;if(n.forEach(c=>{const p=String(c.titulo??c.id??"").toLowerCase(),d=!!l&&p.includes(l),h=(Array.isArray(c.propriedades)?c.propriedades:[]).filter(x=>{if(!x||typeof x!="object"||x.id===void 0||x.id===null)return!1;if(!l||d)return!0;const C=String(x.rotulo??"").toLowerCase(),A=String(x.id).toLowerCase(),z=String(a.valoresAtuais[x.id]??"").toLowerCase();return C.includes(l)||A.includes(l)||z.includes(l)});if(l&&h.length===0)return;u+=h.length;const f=c.aberto!==void 0?c.aberto!==!1:c.aberta!==!1,m=!!l||f,g=document.createElement("div");g.className=`ui-prop__categoria ${m?"ui-prop__categoria--aberta":""}`,g.setAttribute("data-cat-id",String(c.id)),g.setAttribute("part","categoria"),R.alternarPart(g,"categoria-aberta",m);const b=document.createElement("div");b.className="ui-prop__categoria-header",b.setAttribute("part","categoria-cabecalho"),b.setAttribute("role","button"),b.tabIndex=0,b.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 w=document.createElement("span");w.textContent=String(c.titulo??c.id),E.appendChild(y),E.appendChild(w);const L=document.createElement("span");L.className="ui-prop__categoria-contador",L.textContent=String(h.length),b.appendChild(E),b.appendChild(L),b.addEventListener("click",()=>o(String(c.id))),b.addEventListener("keydown",x=>{if(x.key==="Enter"||x.key===" ")x.preventDefault(),o(String(c.id));else if(x.key==="ArrowRight")g.classList.contains("ui-prop__categoria--aberta")||(x.preventDefault(),o(String(c.id)));else if(x.key==="ArrowLeft")g.classList.contains("ui-prop__categoria--aberta")&&(x.preventDefault(),o(String(c.id)));else if(x.key==="ArrowDown"||x.key==="ArrowUp"){const C=Array.from(t.querySelectorAll(".ui-prop__categoria-header")),A=C.indexOf(b);if(A!==-1){const z=x.key==="ArrowDown"?A+1:A-1;z>=0&&z<C.length&&(x.preventDefault(),C[z].focus())}}else if(x.key==="Home"){const C=t.querySelector(".ui-prop__categoria-header");C&&(x.preventDefault(),C.focus())}else if(x.key==="End"){const C=t.querySelectorAll(".ui-prop__categoria-header");C.length>0&&(x.preventDefault(),C[C.length-1].focus())}});const _=document.createElement("div");_.className="ui-prop__categoria-conteudo",_.setAttribute("part","categoria-conteudo"),h.forEach(x=>{const C=wt(String(c.id),x,a);_.appendChild(C)}),g.appendChild(b),g.appendChild(_),s.appendChild(g)}),l&&u===0){const c=document.createElement("div");c.className="ui-prop__vazio",c.setAttribute("part","vazio"),c.textContent=`Nenhuma propriedade encontrada para "${i}".`,t.appendChild(c);return}t.appendChild(s)}function wt(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]:G(t),a=t.id in e.valoresOriginais?e.valoresOriginais[t.id]:G(t),n=!B(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 c=document.createElement("span");if(c.textContent=u,l.appendChild(c),!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",g=>{g.stopPropagation(),f(String(t.id))}),m.addEventListener("dblclick",g=>g.stopPropagation()),l.appendChild(m)}t.tipo==="numero"&&!t.somenteLeitura&&pr(l,r,t,e);const d=document.createElement("div");d.className="ui-prop__col-valor",d.setAttribute("part","valor");const h=xt(r,t,o,e.editorCtx);if(d.appendChild(h),t.unidade){const f=document.createElement("span");f.className="ui-prop__unidade-sufixo",f.setAttribute("part","unidade"),f.textContent=t.unidade,d.appendChild(f)}return i.appendChild(l),i.appendChild(d),i}function pr(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 c=i.editorCtx.obterValorAtual(e.id);s=typeof c=="number"?c:parseFloat(String(c||0))||0,l=!1;try{r.setPointerCapture(u.pointerId)}catch{}r.classList.add("ui-prop__col-rotulo--arrastando");const p=m=>{const g=m.clientX-n;if(Math.abs(g)>2&&(l=!0),l){let b=1;m.shiftKey?b=.1:(m.ctrlKey||m.metaKey)&&(b=10);const E=q(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 w=s+g*y*b;w=ee(w,e),E!==void 0?w=Number(w.toFixed(E)):w=Math.round(w*100)/100,i.editorCtx.registrarAlteracao(t,e.id,w),i.onAtualizarCampoVisual(e.id,w)}},d=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",d),r.removeEventListener("pointercancel",d)};r.addEventListener("pointermove",p),r.addEventListener("pointerup",d),r.addEventListener("pointercancel",d)})}const Ae=300,hr=480,$=new WeakMap;function At(r){var i,o,a;const t=r.hasAttribute("flutuante"),e=r.style;if(t){const n=$.get(r)??{acoplado:{width:"",height:""}};n.flutuante={left:e.left,top:e.top,width:e.width,height:e.height},$.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=$.get(r))==null?void 0:i.flutuante};if($.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)-Ae-30);e.left=`${s}px`,e.top="70px",e.width=`${Ae}px`,e.height=`${hr}px`}}return!t}function Ct(r,t,e){const i=t.getElementById("header");if(i){let a=null,n=0,s=0,l=0,u=0;const c=d=>{if(a===null)return;const h=d.clientX-n,f=d.clientY-s;let m=l+h,g=u+f;const b=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(b,m)),g=Math.max(0,Math.min(E,g)),r.style.left=`${m}px`,r.style.top=`${g}px`,r.style.right="auto",r.style.bottom="auto"},p=d=>{if(a!==null){try{i.releasePointerCapture(d.pointerId)}catch{}i.removeEventListener("pointermove",c),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",d=>{if(!r.hasAttribute("flutuante")||d.target.closest("button, input, select, a")||d.button!==0)return;d.preventDefault(),a=d.pointerId,n=d.clientX,s=d.clientY;const f=r.getBoundingClientRect();l=f.left,u=f.top,r.classList.add("arrastando");try{i.setPointerCapture(d.pointerId)}catch{}i.addEventListener("pointermove",c),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 c=d=>{if(a===null)return;const h=Math.max(200,n+(d.clientX-l)),f=Math.max(180,s+(d.clientY-u));r.style.width=`${h}px`,r.style.height=`${f}px`},p=d=>{if(a!==null){try{o.releasePointerCapture(d.pointerId)}catch{}o.removeEventListener("pointermove",c),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",d=>{if(!r.hasAttribute("flutuante")||d.button!==0)return;d.preventDefault(),d.stopPropagation(),a=d.pointerId,l=d.clientX,u=d.clientY;const h=r.getBoundingClientRect();n=h.width,s=h.height;try{o.setPointerCapture(d.pointerId)}catch{}o.addEventListener("pointermove",c),o.addEventListener("pointerup",p),o.addEventListener("pointercancel",p)})}}function kt(r){return r==="compacta"?"ultracompacta":r==="ultracompacta"?"padrao":"compacta"}class St{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=G(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!B(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];B(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];B(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=fe(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 zt(r){const{shadow:t,listeners:e,host:i,onToggleExpandirTodas:o,onFiltrar:a,onAplicar:n,onDesfazer:s,onAlternarDensidade:l,onAlternarFlutuante:u,onAlternarColapsoHorizontal:c,onFocarPrimeiroEditor:p}=r,d=t.getElementById("btn-flutuante");d&&u&&e.add(d,"click",u);const h=t.getElementById("btn-colapsar-horizontal");h&&c&&e.add(h,"click",c);const f=t.getElementById("faixa-estreita");f&&c&&e.add(f,"click",c);const m=t.getElementById("btn-expandir-faixa");m&&c&&e.add(m,"click",A=>{A.stopPropagation(),c()});const g=t.getElementById("btn-densidade");g&&l&&e.add(g,"click",l);const b=t.getElementById("btn-expandir-tudo");b&&e.add(b,"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"),w=t.getElementById("btn-limpar-filtro"),L=()=>{w&&y&&(w.style.display=y.value?"inline-flex":"none")};y&&(e.add(y,"input",()=>{L();const A=(y.value||"").trim().toLowerCase();a(A)}),e.add(y,"keydown",A=>{A.key==="Escape"?y.value?(A.preventDefault(),A.stopPropagation(),y.value="",L(),a("")):y.blur():(A.key==="Enter"||A.key==="ArrowDown")&&p&&(A.preventDefault(),p())})),w&&y&&e.add(w,"click",()=>{y.value="",L(),a(""),y.focus()});const _=t.getElementById("btn-aplicar");_&&e.add(_,"click",n);const x=t.getElementById("btn-desfazer");x&&e.add(x,"click",s);const C=t.getElementById("link-ajuda");C&&e.add(C,"click",A=>{A.preventDefault(),i.dispatchEvent(new CustomEvent("ui-ajuda",{bubbles:!0,composed:!0}))}),e.add(t,"keydown",A=>{const z=A;(z.ctrlKey||z.metaKey)&&z.key==="Enter"&&i.getAttribute("modo-aplicar")==="manual"&&(z.preventDefault(),n())})}function I(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 c=r.getElementById("footer");c&&(c.style.display=t.getAttribute("modo-aplicar")==="manual"?"flex":"none")}class te extends P.SafeHTMLElement{constructor(){super();v(this,"shadow");v(this,"listeners",new W.ListenerBag);v(this,"splitterListeners",new W.ListenerBag);v(this,"controladorSplitter");v(this,"gerenciadorValores");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=ur(),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 St({hostElement:this,getCategorias:()=>this._categorias,onAtualizarBotoesFooter:e=>{this.btnAplicarElement.disabled=!e,this.btnDesfazerElement.disabled=!e},onAtualizarCampoVisual:(e,i)=>ne(this.shadow,e,i),onRenderCategorias:()=>this.renderCategorias(),isModoManual:()=>this.getAttribute("modo-aplicar")==="manual"}),this.controladorSplitter=Et({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",...O.ATRIBUTOS_DEGRADE]}get larguraRotuloPorcentagem(){return this._larguraRotuloPorcentagem}connectedCallback(){this.listeners.cleanup(),zt({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:()=>Ze(this.shadow)}),Ct(this,this.shadow,this.listeners),this.controladorSplitter.init(),O.aplicarDegradeNoElemento(this,this.shadow.getElementById("container")),this.syncState()}disconnectedCallback(){this.listeners.cleanup(),this.splitterListeners.cleanup()}attributeChangedCallback(e,i,o){if(i!==o){if(O.ehAtributoDegrade(e)){O.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(I(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||I(this.shadow,this);return;default:I(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 categorias(){return this._categorias}set categorias(e){this._categorias=Array.isArray(e)?e:[],this.gerenciadorValores.inicializarCategorias(this._categorias),this.renderCategorias()}get textoMisto(){const e=this.getAttribute("texto-misto");return e&&e.trim()?e:Z}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(){et(this.shadow,this._categorias)}colapsarTudo(){tt(this.shadow,this._categorias)}toggleCategoria(e){rt(this.shadow,this,this._categorias,e)}get densidade(){return this.getAttribute("densidade")||"padrao"}set densidade(e){!e||e==="padrao"?this.removeAttribute("densidade"):this.setAttribute("densidade",e)}alternarDensidade(){const e=kt(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}})),I(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=At(this);return I(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 I(this.shadow,this),this.dispatchEvent(new CustomEvent("ui-colapso-horizontal",{bubbles:!0,composed:!0,detail:{colapsado:i}})),i}syncState(){I(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.aberto!==void 0?i.aberto===!1:i.aberta===!1)?this.expandirTudo():this.colapsarTudo()}renderSeletorTipos(){_t({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&&yt({listaContainer:e,categorias:this._categorias,termoBusca:this._termoBusca,onToggleCategoria:i=>this.toggleCategoria(i),linhaCtx:{valoresAtuais:this.gerenciadorValores.getValores(),valoresOriginais:this.gerenciadorValores.getValoresOriginais(),onAtualizarCampoVisual:(i,o)=>ne(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=>Qe(this.shadow,i),focarEditorAnterior:i=>Je(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}}))}}}})}}class Lt extends te{}class Mt extends te{}P.definirCustomElement("ui-tabela-propriedades",te);P.definirCustomElement("ui-painel-propriedades",Lt);P.definirCustomElement("ui-propriedades",Mt);exports.GerenciadorValoresPropriedades=St;exports.TEXTO_MISTO_PADRAO=Z;exports.TabelaOrquestradorDados=Me;exports.TabelaRemotaController=Ce;exports.TabelaSelecaoController=Se;exports.UIPainelPropriedades=Lt;exports.UIPropriedades=Mt;exports.UITabela=Ke;exports.UITabelaPropriedades=te;exports.VALOR_MISTO=J;exports.abrirPopoverRedimensionamento=qe;exports.alternarCategoria=rt;exports.alternarDirecaoOrdenacao=ze;exports.alternarPosicionamentoFlutuante=At;exports.aplicarLimitesNumericos=ee;exports.aplicarOrdenacaoTabela=Le;exports.atualizarCampoVisual=ne;exports.avaliarExpressaoMatematica=Ge;exports.buscarLinhaPropriedade=fe;exports.colapsarTodasCategorias=tt;exports.combinarValores=lr;exports.conectarArrastoFlutuante=Ct;exports.conectarPainelControles=zt;exports.criarControladorSplitter=Et;exports.criarEditorAcao=dt;exports.criarEditorBooleano=st;exports.criarEditorCorCad=gt;exports.criarEditorCorSwatch=vt;exports.criarEditorLinetype=ht;exports.criarEditorLineweight=ft;exports.criarEditorNumero=ct;exports.criarEditorReadonly=nt;exports.criarEditorSelecao=lt;exports.criarEditorTexto=ut;exports.criarEditorValor=xt;exports.criarLinhaPropriedade=wt;exports.executarOrquestracaoCorpo=je;exports.executarOrquestracaoHeader=$e;exports.executarRedimensionamentoColuna=Ve;exports.executarRedimensionamentoTeclado=He;exports.exibirPromptPopoverRedimensionamento=Fe;exports.expandirTodasCategorias=et;exports.focarEditorAnterior=Je;exports.focarPrimeiroEditor=Ze;exports.focarProximoEditor=Qe;exports.formatWidth=le;exports.getAlignmentClass=de;exports.getRowHeight=ae;exports.getTextAlign=ce;exports.inicializarScrollVirtualizacao=Ue;exports.iniciarRedimensionamentoColuna=Pe;exports.interpretarEntradaNumerica=U;exports.interpretarIndice=oe;exports.isValorMisto=k;exports.limitarLarguraColuna=Q;exports.localizarIndiceItem=ke;exports.marcarSelectMisto=V;exports.montarEstruturaDOM=Ne;exports.normalizarTexto=j;exports.obterCasasDecimais=q;exports.obterPassoNumerico=ot;exports.orquestrarEstruturaInicial=We;exports.proximaDensidade=kt;exports.redimensionarColunaPorDelta=Be;exports.registrarAtualizadorEditor=M;exports.renderizarCategoriasETree=yt;exports.renderizarCorpoTabela=Oe;exports.renderizarHeaderTabela=Te;exports.renderizarSeletorTipos=_t;exports.sincronizarAtributosTabela=pe;exports.sincronizarPainelControles=I;exports.sincronizarSelect=F;exports.textoMistoDe=N;exports.tratarMudancaAtributoTabela=Xe;exports.valorComum=it;exports.valorInicialDaPropriedade=G;exports.valoresIguais=B;
|