/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{substitute as t}from"../../intl.js";import{loadCalciteComponents as i}from"../../widgets/support/componentsUtils.js";import{tsx as o}from"../../widgets/support/widget.js";const n=()=>i({action:()=>import("@esri/calcite-components/dist/components/calcite-action")});function e(t,i,n){const{title:e,textEnabled:c}=i,{type:r,active:s,uid:d,disabled:u,indicator:l}=t;return t.visible?o("calcite-action",{...i,active:"toggle"===r&&t.value,"data-action-id":t.id,"data-action-uid":d,disabled:u,icon:a(t),indicator:l,loading:s,text:e??"",title:c?void 0:e},n):null}function a(t){return t.icon?t.icon:"image"in t&&t.image||t.className?void 0:"question"}function c(t){return t?{backgroundImage:`url(${t})`}:{}}function r({action:i,feature:o}){const n=o?.attributes,e="image"in i?i.image:void 0;return e&&n?t(e,n):e??""}export{a as getActionIcon,c as getActionStyles,n as loadActionUtilsComponents,e as renderAction,r as substituteActionImage};
