/*! 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.aiops_bundle_jsonpfunction=window.aiops_bundle_jsonpfunction||[]).push([[12],{107:function(e,t,i){"use strict";i.r(t);var l=i(53),a=i.n(l),s=(i(1),i(2)),u=i(11),n=i(0),o={name:"5iz1wr",styles:"width:48px"},d={name:"ovk77c",styles:"min-width:0"};t.default=({"data-test-subj":e,onAddFilter:t,overrideFieldTopValueBar:i,...l})=>{var r,c,j,p;const f=i?i(l):{},{field:b,type:g,fieldValue:x,formattedFieldValue:m,formattedPercentage:v,progressValue:h,count:O,color:F,textProps:T={}}={...l,...f},E=null!==(r=null==b||null===(c=b.subType)||void 0===c||null===(j=c.multi)||void 0===j?void 0:j.parent)&&void 0!==r?r:b.name;return Object(n.jsx)(s.EuiFlexGroup,{alignItems:"stretch",gutterSize:"s",responsive:!1,"data-test-subj":`${e}-topValues-bucket`},Object(n.jsx)(s.EuiFlexItem,{grow:1,css:d},Object(n.jsx)(s.EuiFlexGroup,{alignItems:"stretch",gutterSize:"s",responsive:!1},Object(n.jsx)(s.EuiFlexItem,{grow:!0,className:"eui-textTruncate","data-test-subj":`${e}-topValues-formattedFieldValue`},(null!==(p=null==m?void 0:m.length)&&void 0!==p?p:0)>0?Object(n.jsx)(s.EuiToolTip,{content:m,delay:"long"},Object(n.jsx)(s.EuiText,a()({size:"xs",className:"eui-textTruncate",color:"subdued"},T),m)):Object(n.jsx)(s.EuiText,{size:"xs"},"other"===g?u.i18n.translate("unifiedFieldList.fieldStats.otherDocsLabel",{defaultMessage:"Other"}):""===m?u.i18n.translate("unifiedFieldList.fieldStats.emptyStringValueLabel",{defaultMessage:"(empty)"}):"-")),Object(n.jsx)(s.EuiFlexItem,{grow:!1,"data-test-subj":`${e}-topValues-formattedPercentage`},Object(n.jsx)(s.EuiToolTip,{content:u.i18n.translate("unifiedFieldList.fieldStats.bucketPercentageTooltip",{defaultMessage:"{formattedPercentage} ({count, plural, one {# record} other {# records}})",values:{formattedPercentage:v,count:O}}),delay:"long"},Object(n.jsx)(s.EuiText,{size:"xs",textAlign:"left",color:F},v)))),Object(n.jsx)(s.EuiProgress,{value:h,max:1,size:"s",color:"other"===g?"subdued":F,"aria-label":`${m} (${v})`})),t&&b.filterable&&Object(n.jsx)(s.EuiFlexItem,{grow:!1},"other"===g?Object(n.jsx)("div",{css:o}):Object(n.jsx)("div",null,Object(n.jsx)(s.EuiButtonIcon,{iconSize:"s",iconType:"plusInCircle",onClick:()=>t(b,x,"+"),"aria-label":u.i18n.translate("unifiedFieldList.fieldStats.filterValueButtonAriaLabel",{defaultMessage:'Filter for {field}: "{value}"',values:{value:m,field:E}}),"data-test-subj":`plus-${E}-${x}`,style:{minHeight:"auto",minWidth:"auto",paddingRight:2,paddingLeft:2,paddingTop:0,paddingBottom:0}}),Object(n.jsx)(s.EuiButtonIcon,{iconSize:"s",iconType:"minusInCircle",onClick:()=>t(b,x,"-"),"aria-label":u.i18n.translate("unifiedFieldList.fieldStats.filterOutValueButtonAriaLabel",{defaultMessage:'Filter out {field}: "{value}"',values:{value:m,field:E}}),"data-test-subj":`minus-${E}-${x}`,style:{minHeight:"auto",minWidth:"auto",paddingTop:0,paddingBottom:0,paddingRight:2,paddingLeft:2}}))))}}}]);