UNPKG

@ionic/core

Version:
4 lines • 773 B
/*! * (C) Ionic http://ionicframework.com - MIT License */ import{b as t,w as o,q as e}from"./p-Co7eql8D.js";const n=(e,n,s,r=[])=>{let i,a=t(e,n);const c=n.filter((t=>!r.includes(t))),u=new Set,l=(t,o)=>{null===o?u.delete(t):u.add(t)},b=()=>{void 0===i&&0!==c.length&&void 0!==o&&"MutationObserver"in o&&((()=>{const t={};for(const o of c){const n=e.getAttribute(o),s=u.has(o);l(o,n),null===n&&!s||n===a[o]||(t[o]=n)}Object.keys(t).length>0&&(a={...a,...t},s())})(),i=new MutationObserver((t=>{const o={};for(const n of t){const t=n.attributeName,s=e.getAttribute(t);l(t,s),o[t]=s}a={...a,...o},s()})),i.observe(e,{attributeFilter:c}))};return b(),{get attributes(){return a},init:b,destroy:()=>{i?.disconnect(),i=void 0}}},s=(t,o,s=[])=>n(t,e,o,s);export{n as a,s as c}