/*! Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one or more contributor license agreements. * Licensed under the Elastic License 2.0; you may not use this file except in compliance with the Elastic License 2.0. */ (window.triggersActionsUi_bundle_jsonpfunction=window.triggersActionsUi_bundle_jsonpfunction||[]).push([[61],{95:function(e,t,o){"use strict";o.r(t),o.d(t,"RuleTagBadge",(function(){return r})),o.d(t,"default",(function(){return r}));var a=o(1),s=o(3),i=o(2),n=o(0);const u=s.i18n.translate("xpack.triggersActionsUI.sections.rules_list.rules_tag_badge.tagTitle",{defaultMessage:"Tag"}),l={width:"300px"},c=e=>`ruleTagBadgeItem-${e}`,r=e=>{const{tagsOutPopover:t=!1,tags:o=[],badgeDataTestSubj:s="ruleTagBadge",titleDataTestSubj:r="ruleTagPopoverTitle",tagItemDataTestSubj:g=c}=e,{isOpen:d,onClose:b,onClick:j}=e,p=Object(a.useMemo)((()=>Object(n.jsx)(i.EuiBadge,{"data-test-subj":s,color:"hollow",iconType:"tag",iconSide:"left",tabIndex:-1,onClick:j,onClickAriaLabel:"Tags",iconOnClick:j,iconOnClickAriaLabel:"Tags"},o.length)),[s,j,o.length]),T=Object(a.useMemo)((()=>o.map(((e,t)=>Object(n.jsx)(i.EuiBadge,{"data-test-subj":g(e),key:t,color:"hollow",iconType:"tag",iconSide:"left"},e)))),[o,g]);return t?Object(n.jsx)(i.EuiFlexGroup,{"data-test-subj":"tagsOutPopover",style:{marginLeft:0},wrap:!0},T):Object(n.jsx)(i.EuiPopover,{button:p,anchorPosition:"upCenter",isOpen:d,closePopover:b},Object(n.jsx)(i.EuiPopoverTitle,{"data-test-subj":r},u),Object(n.jsx)("div",{style:l},T))}}}]);