var n;const i="scIconLibraries",o="surecart:icon-library-registered",t="undefined"!=typeof window?window:void 0,r=new Set;function e(){return t&&Array.isArray(t[i])?t[i]:[]}function u(n){t&&(t[i]=n)}function d(n){r.forEach((t=>{t.library===n&&t.redraw()}))}function c(n){r.add(n)}function f(n){r.delete(n)}function a(n){try{return e().find((t=>(null==t?void 0:t.name)===n))}catch{return}}function s(n,r){const i=e().filter((t=>(null==t?void 0:t.name)!==n));i.push({name:n,...r}),u(i);try{null==t||t.dispatchEvent(new CustomEvent(o,{detail:{name:n}}))}catch{}}null===(n=null==t?void 0:t.addEventListener)||void 0===n||n.call(t,o,(n=>{var t;const e=null===(t=n.detail)||void 0===t?void 0:t.name;e&&d(e)})),t&&(t.ceRegisterIconLibrary=s);export{a as g,s as r,f as u,c as w};