"use strict";const a={},d={},I="/",p=":";export const MERCURY_ALIAS="mer",registerAssets=(e,t,r)=>{a[e]||d[t]||(a[e]=r,d[t]=e)},getAsset=(e,t)=>{const r=d[e]??e,n=a[r];if(!n)return;const o=n.icons[t.category];if(!o)return;const c=o[t.name];if(c)return t.colorType?c[t.colorType]:c},getIconPath=(e,t="mer")=>{const r=e.colorType?`/${e.colorType}`:"";return`${t}/${e.category}/${e.name}${r}`},getIconPathExpanded=(e,t,r="mer")=>`${getIconPath(e,r)}:${getIconPath(t,r)}`;const g=(e,t,r)=>{const n=t==="mer"?"":`-${t}`;return r?`var(--icon${n}__${e}--${r})`:`var(--icon${n}__${e})`},m=e=>{const t=e.split("/"),r=t[0],n=d[r]??r;if(!a[n]){const A=t[0],l=t[1],u=t[2];return{vendor:"mer",category:A,name:l,colorType:u}}const c=t[1],s=t[2],S=t[3];return{vendor:r,category:c,name:s,colorType:S}};export const getImagePathCallback=e=>{const{vendor:t,category:r,name:n,colorType:o}=m(e),c=getAsset(t,o?{category:r,name:n,colorType:o}:{category:r,name:n});if(!c)return{base:e};const s={base:g(c.enabled.name,t)};return c.hover&&(s.hover=g(c.hover.name,t)),c.active&&(s.active=g(c.active.name,t)),c.disabled&&(s.disabled=g(c.disabled.name,t)),s},getActionMenuImagePathCallback=(e,t)=>{if(!e.startImgSrc&&t==="start"||!e.endImgSrc&&t==="end")return;const r=t==="start"?e.startImgSrc:e.endImgSrc;return getImagePathCallback(r)},getActionListImagePathCallback=e=>e.imgSrc?getImagePathCallback(e.imgSrc):void 0,getNavigationListImagePathCallback=e=>e.startImgSrc?getImagePathCallback(e.startImgSrc):void 0,getTreeViewImagePathCallback=(e,t)=>{if(!e.startImgSrc&&t==="start"||!e.endImgSrc&&t==="end")return;const n=(t==="start"?e.startImgSrc:e.endImgSrc).split(":"),o=getImagePathCallback(n[0]);if(o)return n[1]?{default:o,expanded:getImagePathCallback(n[1])}:{default:o}},getComboBoxImagePathCallback=(e,t)=>{if(!e.startImgSrc&&t==="start"||!e.endImgSrc&&t==="end")return;const r=t==="start"?e.startImgSrc:e.endImgSrc;return getImagePathCallback(r)},getImagePathCallbackDefinitions={"ch-accordion-render":getImagePathCallback,"ch-action-menu-render":getActionMenuImagePathCallback,"ch-action-list-render":getActionListImagePathCallback,"ch-combo-box-render":getComboBoxImagePathCallback,"ch-checkbox":getImagePathCallback,"ch-edit":getImagePathCallback,"ch-image":getImagePathCallback,"ch-navigation-list-render":getNavigationListImagePathCallback,"ch-tab-render":getImagePathCallback,"ch-tree-view-render":getTreeViewImagePathCallback};
