{"version":3,"names":["getIconScale","componentScale","async","componentOnReady","el","isStencilEl","Promise","resolve","requestAnimationFrame"],"sources":["src/utils/component.ts"],"sourcesContent":["import { HTMLStencilElement } from \"@stencil/core/internal\";\nimport { Scale } from \"../components/interfaces\";\n\nexport function getIconScale(componentScale: Scale): Extract {\n return componentScale === \"l\" ? \"m\" : \"s\";\n}\n\n/**\n * This util helps us wait for a component to be ready for both lazy-loading (`dist` output) and non-lazy-loading (`components` output) components.\n *\n * Based on https://github.com/ionic-team/ionic-framework/blob/1a8bd6d/core/src/utils/helpers.ts#L60C1-L79C3\n *\n * @param el - the host element to wait for\n */\nexport async function componentOnReady(el: HTMLElement): Promise {\n await (isStencilEl(el)\n ? el.componentOnReady()\n : new Promise((resolve) => requestAnimationFrame(() => resolve())));\n}\n\nfunction isStencilEl(el: HTMLElement): el is HTMLStencilElement {\n return typeof (el as HTMLStencilElement).componentOnReady === \"function\";\n}\n"],"mappings":";;;;;SAGgBA,EAAaC,GAC3B,OAAOA,IAAmB,IAAM,IAAM,GACxC,CASOC,eAAeC,EAAiBC,SAC9BC,EAAYD,GACfA,EAAGD,mBACH,IAAIG,SAAeC,GAAYC,uBAAsB,IAAMD,QACjE,CAEA,SAASF,EAAYD,GACnB,cAAeA,EAA0BD,mBAAqB,UAChE,Q","ignoreList":[]}