import"./DsnmJJEf.js";import{p as _,e as h,f as d,g as n,a as u,b as k,k as b,t as v,r as B,c as C,az as W}from"./Dyk1ealw.js";import{i as j}from"./cYAxD0tk.js";import{e as V,k as $,l as A,i as N,s as T}from"./CDBVw774.js";import{s as x,c as z}from"./BGzpdNMV.js";import{p as E}from"./CwjTv5pv.js";const G=new Set(["path","circle","rect","line","polyline","polygon"]),L=new Set(["d","cx","cy","r","x","y","x1","y1","x2","y2","rx","ry","width","height","points","stroke-width","stroke-linecap","stroke-linejoin"]);function q(t){if(!t)return null;if(typeof t=="string"){const r=t.trim();if(!r)return null;const s=I(r);return s?{type:"class",className:s}:null}if(t.type==="class"){const r=t.class.trim();return r?{type:"class",className:r}:null}if(t.type==="svg"){const r=O(t.elements??t.children??(t.path?[{tag:"path",attrs:{d:t.path}}]:[]));return r.length===0?null:{type:"svg",viewBox:M(t.viewBox)?t.viewBox.trim():"0 0 24 24",elements:r}}return null}function I(t){return t.startsWith("class:")?t.slice(6).trim():t.includes(" ")?t:t.startsWith("fa:")?l(t.slice(3)):t.startsWith("fa-solid:")?l(t.slice(9),"solid"):t.startsWith("fa-regular:")?l(t.slice(11),"regular"):t.startsWith("fa-brands:")?l(t.slice(10),"brands"):l(t)}function l(t,r="solid"){const s=t.replace(/^fa-/,"");return`${r.startsWith("fa-")?r:`fa-${r}`} fa-${s}`}function M(t){return typeof t=="string"&&t.length<=64&&/^[0-9.+\-\s]+$/.test(t.trim())}function O(t){return t.slice(0,24).flatMap(r=>{const s=String(r?.tag??"").toLowerCase();if(!G.has(s))return[];const e={},c=r.attrs??r.attributes??{};for(const[m,f]of Object.entries(c)){const o=m.toLowerCase();!L.has(o)||!F(o,f)||(e[o]=String(f))}return Object.keys(e).length>0?[{tag:s,attrs:e}]:[]})}function F(t,r){const s=String(r);return s.length>512?!1:t==="d"?/^[MmZzLlHhVvCcSsQqTtAa0-9.,+\-\s]+$/.test(s):t==="points"?/^[0-9.,+\-\s]+$/.test(s):t==="stroke-linecap"||t==="stroke-linejoin"?/^(butt|round|square|miter|bevel|arcs)$/.test(s):/^[0-9.+\-\s]+$/.test(s)}var H=C('<i aria-hidden="true"></i>'),Q=W('<svg aria-hidden="true" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></svg>');function X(t,r){_(r,!0);let s=E(r,"class",3,"me-1.5 text-sm");const e=b(()=>q(r.icon));var c=h(),m=d(c);{var f=a=>{var i=H();v(()=>x(i,1,`${n(e).className??""} ${s()??""}`)),u(a,i)},o=a=>{var i=Q();V(i,21,()=>n(e).elements,N,(y,p)=>{var g=h(),w=d(g);$(w,()=>n(p).tag,!0,(S,R)=>{A(S,()=>({...n(p).attrs}))}),u(y,g)}),B(i),v(()=>{x(i,0,z(s())),T(i,"viewBox",n(e).viewBox)}),u(a,i)};j(m,a=>{n(e)?.type==="class"?a(f):n(e)?.type==="svg"&&a(o,1)})}u(t,c),k()}export{X as E};
