import{a6 as w,e as S,q as k,x as B,l as x,aa as C,af as T,s as I,a as q,I as P}from"./D7LY3N47.js";const E=Object.freeze({left:0,top:0,width:16,height:16}),R=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),N=Object.freeze({...E,...R});Object.freeze({...N,body:"",hidden:!1});function L(e,n){let s=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in n)s+=" "+r+'="'+n[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+s+">"+e+"</svg>"}const M=/(-?[0-9.]*[0-9]+[0-9.]*)/g,V=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function v(e,n,s){if(n===1)return e;if(s=s||100,typeof e=="number")return Math.ceil(e*n*s)/s;if(typeof e!="string")return e;const r=e.split(M);if(r===null||!r.length)return e;const t=[];let o=r.shift(),i=V.test(o);for(;;){if(i){const c=parseFloat(o);isNaN(c)?t.push(o):t.push(Math.ceil(c*n*s)/s)}else t.push(o);if(o=r.shift(),o===void 0)return t.join("");i=!i}}function W(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function _(e){return"data:image/svg+xml,"+W(e)}function D(e){return'url("'+_(e)+'")'}function G(e){const[n,s,r,t]=e;if(r!==t){const o=Math.max(r,t);return[n-(o-r)/2,s-(o-t)/2,o,o]}return e}const H=Object.freeze({width:null,height:null}),U=Object.freeze({...H,...R});function K(e,n="defs"){let s="";const r=e.indexOf("<"+n);for(;r>=0;){const t=e.indexOf(">",r),o=e.indexOf("</"+n);if(t===-1||o===-1)break;const i=e.indexOf(">",o);if(i===-1)break;s+=e.slice(t+1,o).trim(),e=e.slice(0,r).trim()+e.slice(i+1)}return{defs:s,content:e}}function J(e,n){return e?"<defs>"+e+"</defs>"+n:n}function Q(e,n,s){const r=K(e);return J(r.defs,n+r.content+s)}const X=e=>e==="unset"||e==="undefined"||e==="none";function Y(e,n){const s={...N,...e},r={...U,...n},t={left:s.left,top:s.top,width:s.width,height:s.height};let o=s.body;[s,r].forEach(g=>{const f=[],A=g.hFlip,O=g.vFlip;let m=g.rotate;A?O?m+=2:(f.push("translate("+(t.width+t.left).toString()+" "+(0-t.top).toString()+")"),f.push("scale(-1 1)"),t.top=t.left=0):O&&(f.push("translate("+(0-t.left).toString()+" "+(t.height+t.top).toString()+")"),f.push("scale(1 -1)"),t.top=t.left=0);let d;switch(m<0&&(m-=Math.floor(m/4)*4),m=m%4,m){case 1:d=t.height/2+t.top,f.unshift("rotate(90 "+d.toString()+" "+d.toString()+")");break;case 2:f.unshift("rotate(180 "+(t.width/2+t.left).toString()+" "+(t.height/2+t.top).toString()+")");break;case 3:d=t.width/2+t.left,f.unshift("rotate(-90 "+d.toString()+" "+d.toString()+")");break}m%2===1&&(t.left!==t.top&&(d=t.left,t.left=t.top,t.top=d),t.width!==t.height&&(d=t.width,t.width=t.height,t.height=d)),f.length&&(o=Q(o,'<g transform="'+f.join(" ")+'">',"</g>"))});const i=r.width,c=r.height,a=t.width,l=t.height;let u,h;i===null?(h=c===null?"1em":c==="auto"?l:c,u=v(h,a/l)):(u=i==="auto"?a:i,h=c===null?v(u,l/a):c==="auto"?l:c);const y={},z=(g,f)=>{X(f)||(y[g]=f.toString())};z("width",u),z("height",h);const $=[t.left,t.top,a,l];return y.viewBox=$.join(" "),{attributes:y,viewBox:$,body:o}}function Z(e){const n={display:"inline-block",width:"1em",height:"1em"},s=e.varName;switch(e.pseudoSelector&&(n.content="''"),e.mode){case"background":s&&(n["background-image"]="var(--"+s+")"),n["background-repeat"]="no-repeat",n["background-size"]="100% 100%";break;case"mask":n["background-color"]="currentColor",s&&(n["mask-image"]=n["-webkit-mask-image"]="var(--"+s+")"),n["mask-repeat"]=n["-webkit-mask-repeat"]="no-repeat",n["mask-size"]=n["-webkit-mask-size"]="100% 100%";break}return n}function ee(e,n){const s={},r=n.varName,t=Y(e);let o=t.viewBox;o[2]!==o[3]&&(n.forceSquare?o=G(o):s.width=v("1em",o[2]/o[3]));const i=L(t.body.replace(/currentColor/g,n.color||"black"),{viewBox:`${o[0]} ${o[1]} ${o[2]} ${o[3]}`,width:`${o[2]}`,height:`${o[3]}`}),c=D(i);if(r)s["--"+r]=c;else switch(n.mode){case"background":s["background-image"]=c;break;case"mask":s["mask-image"]=s["-webkit-mask-image"]=c;break}return s}const b={selectorStart:{compressed:"{",compact:" {",expanded:" {"},selectorEnd:{compressed:"}",compact:`; }
`,expanded:`;
}
`},rule:{compressed:"{key}:",compact:" {key}: ",expanded:`
  {key}: `}};function te(e,n="expanded"){const s=[];for(let r=0;r<e.length;r++){const{selector:t,rules:o}=e[r];let c=(t instanceof Array?t.join(n==="compressed"?",":", "):t)+b.selectorStart[n],a=!0;for(const l in o)a||(c+=";"),c+=b.rule[n].replace("{key}",l)+o[l],a=!1;c+=b.selectorEnd[n],s.push(c)}return s.join(n==="compressed"?"":`
`)}function ne(e,n={}){const s=n.customise?n.customise(e.body):e.body,r=n.mode||(n.color||!s.includes("currentColor")?"background":"mask");let t=n.varName;t===void 0&&r==="mask"&&(t="svg");const o={...n,mode:r,varName:t};r==="background"&&delete o.varName;const i={...n.rules,...Z(o),...ee({...N,...e,body:s},o)},c=n.iconSelector||".icon";return te([{selector:c,rules:i}],o.format)}async function se(e,n){if(!e)return null;const s=k(e);return s||(await B(e).catch(()=>(console.warn(`[Icon] failed to load icon \`${e}\``),null)),k(e))}function j(e){const n=w().icon,s=(n.collections||[]).sort((r,t)=>t.length-r.length);return S(()=>{const r=e(),t=r.startsWith(n.cssSelectorPrefix)?r.slice(n.cssSelectorPrefix.length):r,o=n.aliases?.[t]||t;if(!o.includes(":")){const i=s.find(c=>o.startsWith(c+"-"));return i?i+":"+o.slice(i.length+1):o}return o})}function F(e,n){if(e!==!1)return e===!0||e===null?n:e}let p;function oe(e){return e.replace(/([^\w-])/g,"\\$1")}function re(){if(p)return p;p=new Set;const e=s=>{if(s=s.replace(/^:where\((.*)\)$/,"$1").trim(),s.startsWith("."))return s},n=s=>{if(s?.length)for(const r of s){r?.cssRules&&n(r.cssRules);const t=r?.selectorText;if(typeof t=="string"){const o=e(t);o&&p.add(o)}}};if(typeof document<"u")for(const s of document.styleSheets)try{const r=s.cssRules||s.rules;n(r)}catch{}return p}const ce=x({name:"NuxtIconCss",props:{name:{type:String,required:!0},customize:{type:[Function,Boolean,null],default:null,required:!1}},setup(e){const n=C(),s=w().icon,r=S(()=>e.name?s.cssSelectorPrefix+e.name:"");function t(c){if(!c)return;const a=k(c);if(a)return a;const l=n.payload?.data?.[c];if(l)return q(c,l),l}const o=S(()=>"."+oe(r.value));function i(c,a=!0){let l=o.value;s.cssWherePseudo&&(l=`:where(${l})`);const u=ne(c,{iconSelector:l,format:"compressed",customise:F(e.customize,s.customize)});return s.cssLayer&&a?`@layer ${s.cssLayer} { ${u} }`:u}{const c=re();async function a(l){if(c.has(o.value)||typeof document>"u")return;const u=document.createElement("style");u.textContent=i(l);const h=document.head.querySelector('style, link[rel="stylesheet"]');h?document.head.insertBefore(u,h):document.head.appendChild(u),c.add(o.value)}T(()=>e.name,()=>{if(c.has(o.value))return;const l=t(e.name);l?a(l):se(e.name).then(u=>{u&&a(u)}).catch(()=>null)},{immediate:!0})}return()=>I("span",{class:["iconify",r.value]})}}),ie=x({name:"NuxtIconSvg",props:{name:{type:String,required:!0},customize:{type:[Function,Boolean,null],default:null,required:!1}},setup(e,{slots:n}){const s=C(),r=w().icon,t=j(()=>e.name),o="i-"+t.value;if(t.value){const i=s.payload.data[o];i&&q(t.value,i)}return()=>I(P,{icon:t.value,ssr:!0,customise:F(e.customize,r.customize)},n)}}),ae=x({name:"NuxtIcon",props:{name:{type:String,required:!0},mode:{type:String,required:!1,default:null},size:{type:[Number,String],required:!1,default:null},customize:{type:[Function,Boolean,null],default:null,required:!1}},setup(e,{slots:n}){const s=C(),r=w().icon,t=j(()=>e.name),o=S(()=>s.vueApp?.component(t.value)||((e.mode||r.mode)==="svg"?ie:ce)),i=S(()=>{const c=e.size||r.size;return c?{fontSize:Number.isNaN(+c)?c:c+"px"}:null});return()=>I(o.value,{...r.attrs,name:t.value,class:r.class,style:i.value,customize:e.customize},n)}});export{ae as default};
