import{t as h}from"./tippy.esm-BMtxumUI.js";document.addEventListener("DOMContentLoaded",async()=>{const n=document.querySelectorAll(".icon-picker"),o=await u();n.forEach(c=>{const t=c.querySelector("input"),e=c.querySelector(".icon-picker-modal"),s=e.querySelector(".icon-list");r(o,t,s);const a=h(t,{content:e,trigger:"click",interactive:!0,placement:"bottom",arrow:!1,maxWidth:"300px",offset:[0,-30],theme:"light",appendTo:()=>document.body,onShow(i){e.style.display="block"},onHide(i){e.style.display="none"}});t.addEventListener("keyup",i=>{const l=i.target.value.toLowerCase(),p=o.filter(d=>d.toLowerCase().includes(l));s.innerHTML="",r(p,t,s),a.setContent(e)})})});function r(n,o,c){c.innerHTML="",n.forEach(t=>{const e=document.createElement("i");e.className=`ph ${t}`,e.style.fontSize="24px",e.style.cursor="pointer",e.style.margin="5px",e.addEventListener("click",()=>{o.value=t,o._tippy.hide()}),c.appendChild(e)})}async function u(){const n=[];try{const c=await(await fetch("https://unpkg.com/@phosphor-icons/web/src/regular/style.css")).text(),t=/\.ph-([a-z0-9-]+):before/g;let e;for(;(e=t.exec(c))!==null;)n.push(`ph ph-${e[1]}`),n.push(`ph-fill ph-${e[1]}`)}catch{}return n}
