/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
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 e=()=>i({action:()=>import("@esri/calcite-components/dist/components/calcite-action")});function n(t,i,e){const{title:n,textEnabled:c}=i,{type:r,active:s,uid:d,disabled:l,indicator:u}=t;return t.visible?o("calcite-action",{...i,active:"toggle"===r&&t.value,appearance:"solid","data-action-id":t.id,"data-action-uid":d,disabled:l,icon:a(t),indicator:u,loading:s,scale:"s",text:n??"",title:c?void 0:n},e):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 e=o?.attributes,n="image"in i?i.image:void 0;return n&&e?t(n,e):n??""}export{a as getActionIcon,c as getActionStyles,e as loadActionUtilsComponents,n as renderAction,r as substituteActionImage};
