const t=t=>{try{if(t instanceof class{constructor(t){this.value=t}})return t.value;if(!e()||"string"!=typeof t||""===t)return t;const s=document.createDocumentFragment(),r=document.createElement("div");s.appendChild(r),r.innerHTML=t,c.forEach((t=>{const e=s.querySelectorAll(t);for(let t=e.length-1;t>=0;t--){const c=e[t];c.parentNode?c.parentNode.removeChild(c):s.removeChild(c);const r=o(c);for(let t=0;t<r.length;t++)n(r[t])}}));const i=o(s);for(let t=0;t<i.length;t++)n(i[t]);const l=document.createElement("div");l.appendChild(s);const u=l.querySelector("div");return null!==u?u.innerHTML:l.innerHTML}catch(t){return console.error(t),""}},n=t=>{if(t.nodeType&&1!==t.nodeType)return;for(let n=t.attributes.length-1;n>=0;n--){const o=t.attributes.item(n),e=o.name;if(!s.includes(e.toLowerCase())){t.removeAttribute(e);continue}const c=o.value;null!=c&&c.toLowerCase().includes("javascript:")&&t.removeAttribute(e)}const e=o(t);for(let t=0;t<e.length;t++)n(e[t])},o=t=>null!=t.children?t.children:t.childNodes,e=()=>{const t=window,n=t&&t.Ionic&&t.Ionic.config;return!n||(n.get?n.get("sanitizerEnabled",!0):!0===n.sanitizerEnabled||void 0===n.sanitizerEnabled)},s=["class","id","href","src","name","slot"],c=["script","style","iframe","meta","link","object","embed"];export{t as s}