/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */
import{w as o}from"./p-COLHV2ym.js";import{r}from"./p-BiTKUjko.js";import{j as t}from"./p-C8IsBmNU.js";const i=(t,i,e)=>{let n,s;if(void 0!==o&&"MutationObserver"in o){const o=Array.isArray(i)?i:[i];n=new MutationObserver((t=>{for(const i of t)for(const t of i.addedNodes)if(t.nodeType===Node.ELEMENT_NODE&&o.includes(t.slot))return e(),void r((()=>c(t)))})),n.observe(t,{childList:!0,subtree:!0})}const c=o=>{var r;s&&(s.disconnect(),s=void 0),s=new MutationObserver((o=>{e();for(const r of o)for(const o of r.removedNodes)o.nodeType===Node.ELEMENT_NODE&&o.slot===i&&d()})),s.observe(null!==(r=o.parentElement)&&void 0!==r?r:o,{subtree:!0,childList:!0})},d=()=>{s&&(s.disconnect(),s=void 0)};return{destroy:()=>{n&&(n.disconnect(),n=void 0),d()}}},e=(o,r,i)=>{const e=null==o?0:o.toString().length,s=n(e,r);if(void 0===i)return s;try{return i(e,r)}catch(o){return t("[ion-input] - Exception in provided `counterFormatter`:",o),s}},n=(o,r)=>`${o} / ${r}`;export{i as c,e as g}