/*!
 * Copyright © 2018 Splunk Inc.
 * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
 * in part without a valid written license from Splunk Inc. is PROHIBITED.
 */(()=>{"use strict";var e={5456:(e,t,r)=>{r.r(t),r.d(t,{default:()=>x});var a=r(6195),n=r.n(a),l=r(9497),i=r.n(l),o=r(23),s=r.n(o),u=r(232),d=r.n(u),c=r(4793),f=r(6649),p=r(8965),b=r.n(p),m=r(9967),g=r(4008),v=r.n(g);function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){n()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const _=d().div`
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    [data-test='control-group'] {
        margin: 0;
    }
`,O=i().createElement(_,null,i().createElement("span",{"data-test":"form-row-header-label"},(0,f._)("Label")),i().createElement("span",{"data-test":"form-row-header-value"},(0,f._)("Value"))),P=(e,t)=>e.filter(((e,r)=>r!==t)),S=(e,t,r)=>"string"!=typeof e||""===e.trim()||t.filter((t=>t[r]===e)).length>1,j=(e,t)=>S(e,t,"label"),C=(e,t)=>S(e,t,"value"),D=d().div`
    width: 100%;
`,E=[],M=({onChange:e,name:t,value:r=E,labelPosition:a="top",label:n="",validate:o})=>{const[s,u]=(0,l.useState)(r),[d,p]=(0,l.useState)(r.length);(0,l.useEffect)((()=>{u(r),r.length>d&&p(r.length)}),[r,d]);const g=(0,l.useCallback)((a=>{var n;(0,c.isEqual)(a,r)||((n=a).some((({label:e,value:t})=>"string"!=typeof e||""===e.trim()||"string"!=typeof t||""===t.trim()))||(0,c.uniqBy)(n,(e=>e.value)).length!==n.length||(0,c.uniqBy)(n,(e=>e.label)).length!==n.length)?u(a):e(null,t,a)}),[r,t,e]),y=(0,l.useCallback)(((e,{index:t})=>{const r=P(s,t);g(r)}),[s,g]),S=(0,l.useCallback)((({fromIndex:e,toIndex:t})=>{const r=s[e],a=P(s,e);a.splice(t,0,r),g(a)}),[s,g]),M=(0,l.useCallback)(((e,t)=>(r,a,n="")=>{const l=s[e],i=[...s];i.splice(e,1,h(h({},l),{},{[t]:n.trim()})),g(i)}),[s,g]),x=(0,l.useCallback)((()=>{const e=s.concat({label:`Label ${d}`,value:`menu_v${d}`});p(d+1),g(e)}),[s,d,g]),F=s.map(((e,t)=>{const{label:r,value:a}=e;return i().createElement(b().Row,{index:t,key:`${r}_${a}_${t}`,onRequestRemove:y},i().createElement(_,null,i().createElement(m.default,{label:(0,f._)("Label"),hideLabel:!0,value:r,onChange:M(t,"label"),name:"item-label-editor",error:j(r,s),validate:o}),i().createElement(m.default,{label:(0,f._)("Value"),hideLabel:!0,value:a,onChange:M(t,"value"),name:"item-value-editor",error:C(a,s),validate:o})))}));return i().createElement(v(),{label:n,labelPosition:a},i().createElement(D,null,i().createElement(b(),{addLabel:(0,f._)("Add new"),header:O,onRequestAdd:x,onRequestMove:S},F)))};M.propTypes={onChange:s().func.isRequired,name:s().string.isRequired,label:s().string,value:s().arrayOf(s().exact({label:s().string,value:s().string})),labelPosition:s().oneOf(["top","left"]),validate:s().func};const x=M},9967:(e,t,r)=>{r.d(t,{default:()=>S});var a=r(2649),n=r.n(a),l=r(6195),i=r.n(l);const o=require("@babel/runtime/helpers/objectWithoutProperties");var s=r.n(o),u=r(9497),d=r.n(u),c=r(23),f=r.n(c),p=r(4793),b=r(4082),m=r.n(b),g=r(4008),v=r.n(g),y=r(5862);const h=["onChange","name","value","label","labelPosition","labelWidth","labelStyle","hideLabel","isAdvanced","isDisabled","help","tooltip","validate","error"];function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}const O={},P=e=>{let{onChange:t,name:r,value:a="",label:l,labelPosition:o="top",labelWidth:c,labelStyle:f=O,hideLabel:b=!1,isAdvanced:g,isDisabled:P=!1,help:S,tooltip:j,validate:C,error:D}=e,E=s()(e,h);const[M,x]=(0,u.useState)(a),F=(0,u.useCallback)((e=>"function"==typeof C?C({value:e}):null),[C]),[w,k]=(0,u.useState)(F(a)),A=(0,u.useMemo)((()=>(0,p.debounce)((e=>{k(F(e))}),250)),[F]);(0,u.useEffect)((()=>()=>{A.cancel()}),[A]),(0,u.useEffect)((()=>{x(a),k(F(a))}),[F,a]);const q=(0,u.useCallback)(((e,{value:t})=>{x(t),A(t)}),[A]),T=(0,u.useCallback)((e=>{const n=M.trim();if(n===a)return;const l=F(n);k(l),l||t(e,r,n)}),[M,a,F,t,r]),B=(0,u.useCallback)((e=>{"Enter"===e.key&&T(e)}),[T]),L=(0,u.useMemo)((()=>l&&""!==l?f:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},f)),[l,f]);return d().createElement(v(),{label:l,labelPosition:o,labelWidth:c,style:L,hideLabel:b,help:S,tooltip:j,error:(null==w?void 0:w.message)||D,isAdvanced:g},d().createElement(m(),n()({key:a,"data-test":r,style:y.editorStyle,onChange:q,onKeyDown:B,onBlur:T,value:M,disabled:P,canClear:!0},E,{error:!!w||D})))};P.propTypes={onChange:f().func.isRequired,name:f().string.isRequired,label:f().string.isRequired,value:f().string,labelPosition:f().oneOf(["top","left"]),labelWidth:f().number,labelStyle:f().object,hideLabel:f().bool,isAdvanced:f().bool,isDisabled:f().bool,validate:f().func,error:f().bool,help:f().string,tooltip:f().string};const S=P},5731:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,n)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return n(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ColumnSelectionEditor=void 0;const o=l(r(9497)),s=l(r(23)),u=i(r(2373)),d=r(1413),c=r(9033),f=r(6801),p=r(1385),b=r(1256),m=i(r(4008)),g=r(5862),v=r(8999),y=Object.assign(Object.assign({},f.BaseEditorPropTypes),{dataSourceKey:s.string.isRequired,prepareValue:s.func,filterByTypes:s.arrayOf(s.string),tooltip:s.string,hideEditorWhenLoading:s.bool});t.ColumnSelectionEditor=({name:e,value:t,label:r="",labelPosition:a="top",dataSourceKey:n="primary",dataSourceBindings:l,prepareValue:i=(e=>e),onChange:s,isAdvanced:f,isDisabled:y,filterByTypes:h,tooltip:_,hideEditorWhenLoading:O=!1})=>{const P=(0,p.useDataSource)({dataSourceBindings:l,dataSourceKey:n}),{columns:S,fields:j}=(null==P?void 0:P.data)||{columns:[],fields:[]},C=(0,b.getAvailableFieldsWithTypes)(S,j),D=null==t?t:(0,d.getFieldsFromDSL)(t,{[n]:P})[0]||"",[E,M]=(0,o.useState)(D);o.default.useEffect((()=>{M(D)}),[D]);const[x,F]=(0,o.useState)(""),w=C.filter((e=>-1!==e.name.indexOf(x))),k=(0,v.useColumnSelectorFooterMessage)({availableFields:C,selectedFields:[E],filteredFields:w,filter:x}),A=(0,o.useCallback)(((t,{value:r})=>{M(r);const a=i({options:{[e]:`> ${n} | seriesByName('${r}')`}});s(t,a)}),[n,e,s,i]),q=(0,o.useCallback)(((e,{keyword:t})=>{F(t)}),[]),{hasError:T,isMissing:B,isLoading:L}=(0,c.getDataSourceStateInfo)(P),R=B||T||y,N=(0,b.getPlaceholderMessage)({isMissing:B,isLoading:L,hasError:T});return(!O||!!E)&&o.default.createElement(m.default,{label:r,labelPosition:a,tooltip:_,isAdvanced:f},o.default.createElement(u.default,{"data-test":"ColumnSelectionEditor",value:E,onFilterChange:q,onChange:A,footerMessage:k,disabled:R,placeholder:N,isLoadingOptions:L,error:T,style:g.editorStyle,filter:!0},w.map((e=>o.default.createElement(u.default.Option,{key:e.name,label:`${e.name} (${e.type})`,value:e.name,disabled:!!(null==h?void 0:h.length)&&!h.find((t=>t===e.type))})))))},t.ColumnSelectionEditor.propTypes=y,t.default=t.ColumnSelectionEditor},7585:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,n)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return n(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=l(r(9497)),s=l(r(23)),u=r(4793),d=i(r(4082)),c=i(r(9250)),f=i(r(7143)),p=r(6649),b=i(r(5731)),m=i(r(5456)),g=r(4381),v=r(5862),y=(0,p._)("Advanced configuration options are being used by this input. Please edit in source mode."),h=({name:e,context:t,value:r="",label:a,onChange:n,dataSourceBindings:l,labelPosition:i="top",labelWidth:s,help:h=y,validate:_})=>{const[O,P]=o.useState([]),[S,j]=o.useState(""),[C,D]=o.useState("");o.useEffect((()=>{const{staticOptions:e,dynamicOptionsLabel:a,dynamicOptionsValue:n}=(0,g.getDynamicOptionsFromConfig)({items:r,context:t});P(e),j(a),D(n)}),[r,t]),o.useEffect((()=>{void 0!==l.primary||Array.isArray(r)||n(null,{context:{formattedConfig:void 0,formattedStatics:void 0,statics:void 0,label:void 0,value:void 0},options:{[e]:O}})}),[l,e,r,n,O]);const E=o.useCallback(((t,a,l)=>{if(Array.isArray(r)&&(!a||!l))n(null,{options:{[e]:t}});else{const r=(0,u.unzip)(t.map((({label:e,value:t})=>[e,t])));n(null,{context:{formattedConfig:{number:{prefix:""}},formattedStatics:">statics | formatByType(formattedConfig)",statics:r,label:`>primary | seriesByName("${a}") | renameSeries("label") | formatByType(formattedConfig)`,value:`>primary | seriesByName("${l}") | renameSeries("value") | formatByType(formattedConfig)`},options:{[e]:">frame(label, value) | prepend(formattedStatics) | objects()"}})}}),[e,r,n]),M=o.useCallback(((e,t,r)=>{E(r,S,C)}),[E,S,C]),x=o.useCallback(((e,{value:t})=>{""===C?j(t):E(O,t,C)}),[E,O,C]),F=o.useCallback(((e,{value:t})=>{""===S?D(t):E(O,S,t)}),[E,O,S]),w=e=>t=>{var r;const a=null===(r=null==t?void 0:t.options)||void 0===r?void 0:r[e];return"string"==typeof a?{value:(0,g.getFieldFromFieldNameDsl)(a)}:{value:""}};if(o.useMemo((()=>(0,g.isConfigAdvanced)({items:r,context:t})),[r,t]))return o.createElement(c.default,{label:(0,p._)(a),labelPosition:i,labelWidth:s,help:h},o.createElement(d.default,{key:r.toString(),"data-test":e,disabled:!0,defaultValue:r.toString()}));const k=!!l.primary;return o.createElement(o.Fragment,null,o.createElement(m.default,{name:"",label:(0,p._)("Static menu configuration"),labelPosition:i,value:O,onChange:M,validate:_}),k&&o.createElement(f.default,{key:"dynamic-item-editor-label-value-layout",gutter:v.VERTICAL_EDITOR_SPACING},o.createElement(f.default.Row,{key:"dynamic-item-editor-label-row"},o.createElement(b.default,{name:"label",label:(0,p._)("Dynamic menu label field"),dataSourceKey:"primary",dataSourceBindings:l,value:`>primary | seriesByName("${S}")`,context:t,onChange:x,prepareValue:w("label")})),o.createElement(f.default.Row,{key:"dynamic-item-editor-value-row"},o.createElement(b.default,{name:"value",label:(0,p._)("Dynamic menu value field"),dataSourceKey:"primary",dataSourceBindings:l,value:`>primary | seriesByName("${C}")`,context:t,onChange:F,prepareValue:w("value")}))))};h.propTypes={onChange:s.func.isRequired,name:s.string.isRequired,label:s.string.isRequired,value:s.oneOfType([s.arrayOf(s.shape({label:s.string.isRequired,value:s.string.isRequired}).isRequired),s.string]),labelPosition:s.oneOf(["top","left"]),labelWidth:s.number,context:s.shape({label:s.string,value:s.string,statics:s.arrayOf(s.arrayOf(s.string.isRequired).isRequired)}).isRequired,dataSourceBindings:s.shape({primary:s.any}).isRequired,help:s.string},t.default=h},8999:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,n)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useColumnSelectorFooterMessage=void 0;const i=l(r(9497)),o=r(3620);t.useColumnSelectorFooterMessage=({filter:e,availableFields:t,selectedFields:r,filteredFields:a,noSelectedFieldsInfo:n=!1})=>{const l=(0,i.useMemo)((()=>{if(!r||!a)return[];const e=new Set(r.filter((e=>""!==e&&void 0!==e)));return a.filter((t=>e.has(t.name)))}),[r,a]);return e&&!a.length?null:i.default.createElement(o.ColumnSelectorFooterMessage,{noSelectedFieldsInfo:n,numSelected:null==l?void 0:l.length,numFiltered:a.length,numAvailable:t.length,filter:e})}},1385:function(e,t,r){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useDataSource=void 0;const n=r(9497),l=a(r(4853)),i=r(4793);t.useDataSource=({dataSourceBindings:e,dataSourceKey:t})=>{const r=(0,n.useContext)(l.default),[a,o]=(0,n.useState)();return(0,n.useEffect)((()=>{if(!(0,i.get)(e,t))return o(null),()=>{};const a=(0,i.isFunction)(r.subscribe)&&r.subscribe(t,(e=>o(e)));return()=>{a&&a()}}),[e]),a}},6801:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,n)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseEditorPropTypes=void 0;const i=l(r(23));t.BaseEditorPropTypes={name:i.string.isRequired,value:i.oneOfType([i.string,i.object,i.arrayOf(i.string)]),context:i.object,label:i.string,labelPosition:i.oneOf(["top","left"]),labelWidth:i.number,onChange:i.func,isAdvanced:i.bool,isDisabled:i.bool,dataSourceBindings:i.object,options:i.object,optionsSchema:i.object}},4008:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,n)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return n(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AdvancedConfigButton=void 0;const o=l(r(9497)),s=l(r(23)),u=i(r(232)),d=r(6649),c=i(r(6643)),f=r(3563),p=i(r(6379)),b=i(r(7020)),m=i(r(9250)),g=(0,u.default)(m.default)`
    margin-top: 0;
    padding: 0;
    // adjust bottom margin according to theme
    margin-bottom: ${f.variables.spacingMedium};
    width: 100%;

    // remove top margin of the first component in control group
    &:first-child {
        margin-top: 0;
    }

    // remove bottom margin of the last component in control group
    &:last-child {
        margin-bottom: 0;
    }
    // remove top padding on label of the first control group
    [data-test='label']:first-of-type {
        padding-top: 0;
    }
`,v=(0,u.default)(p.default)`
    display: flex;
    > span {
        display: flex;
        width: 35px;
    }
`,y=(0,u.default)(b.default)`
    color: ${f.variables.contentColorActive} !important;
    &:hover {
        background-color: ${f.variables.interactiveColorOverlayDrag} !important;
    }
`;t.AdvancedConfigButton=({label:e="",onClick:t})=>o.default.createElement(v,{"data-test":`${e}-advanced-config-button-tooltip`,content:(0,d._)("Advanced configurations")},o.default.createElement(y,{"data-test":`${e}-advanced-config-button`,icon:o.default.createElement(c.default,{"data-test":`${e}-advanced-config-button-icon`}),appearance:"subtle",onClick:t}));const h=({"data-test":e,children:r,isAdvanced:a=!1,label:n,hideLabel:l,labelPosition:i,labelWidth:s,tooltip:u,help:d,style:c,error:f,controlsLayout:p,onClick:b,onAdvancedConfigButtonClick:m})=>o.default.createElement(g,{"data-test":null!=e?e:"control-group",label:n,hideLabel:l,labelPosition:i,labelWidth:s,tooltip:u,help:d,error:f,style:c,onClick:b,controlsLayout:p},a?o.Children.toArray(r).filter(Boolean).map((e=>(0,o.cloneElement)(e,{style:{flex:1}}))):r,a?o.default.createElement(t.AdvancedConfigButton,{label:n,onClick:m}):null);h.propTypes={style:s.object,isAdvanced:s.bool,onClick:s.func,onAdvancedConfigButtonClick:s.func},t.default=h},3620:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,n)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ColumnSelectorFooterMessage=void 0;const i=l(r(9497)),o=r(3773),s=r(6649),u=r(9497);t.ColumnSelectorFooterMessage=({numSelected:e,numFiltered:t,numAvailable:r,filter:a,noSelectedFieldsInfo:n})=>{const l=(0,u.useMemo)((()=>a?n?(0,o.sprintf)((0,s._)("%(filtered)d filtered from %(available)d fields"),{filtered:t,available:r}):(0,o.sprintf)((0,s._)("%(selected)d selected from %(filtered)d filtered"),{selected:e,filtered:t}):n?(0,o.sprintf)((0,s._)("%(shown)d of %(available)d fields"),{shown:t,available:r}):(0,o.sprintf)((0,s._)("%(selected)d selected from %(available)d"),{selected:e,available:r})),[a,n,t,r,e]);return i.createElement("span",{"data-test":"footer-message","aria-live":"polite","aria-atomic":"true"},l)}},5862:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.editorStyle=t.DROPDOWN_MENU_WIDTH=t.VERTICAL_EDITOR_SPACING=t.FLYOUT_WIDTH=t.COLUMN_FLYOUT_PADDING=t.FLYOUT_PADDING=void 0,t.FLYOUT_PADDING=21,t.COLUMN_FLYOUT_PADDING=16,t.FLYOUT_WIDTH=344,t.VERTICAL_EDITOR_SPACING=16,t.DROPDOWN_MENU_WIDTH=327,t.editorStyle={width:"100%"}},1256:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getPlaceholderMessage=t.sanitizeFieldNames=t.getFilteredFields=t.getAvailableFieldsWithTypes=void 0;const a=r(6649),n=r(2588);t.getAvailableFieldsWithTypes=(e,t)=>t.map(((t,r)=>{const{name:a}=t;return{name:a,type:(0,n.canInferTypeFromMeta)(t)?(0,n.getDataTypeForMeta)(t):(0,n.inferDataTypeFromData)(e[r])}}));t.getFilteredFields=(e,t)=>e.filter((e=>-1!==e.name.indexOf(t)));t.sanitizeFieldNames=(e,t)=>"string"==typeof e&&t.includes(e)?[e]:Array.isArray(e)?e.filter((e=>t.includes(e))):[];t.getPlaceholderMessage=({hasError:e,isLoading:t,isMissing:r,defaultMessage:n="Select a field from data source"})=>r?(0,a._)("Set up data source to select"):e?(0,a._)("Please set up valid data source to select"):t?(0,a._)("Loading data source..."):(0,a._)(n)},4381:function(e,t,r){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getDynamicOptionsFromConfig=t.isConfigAdvanced=t.getFieldFromFieldNameDsl=void 0;const n=r(4793),l=r(2918),i=a(r(3453));t.getFieldFromFieldNameDsl=e=>{try{const t=l.DslParser.parse(i.default.withoutArrow(e)),r=(0,n.find)(t,{type:"method",name:"seriesByName"});return(0,n.get)(r,["args","0","v"],"")}catch(e){return""}};const o=e=>{try{const t=l.DslParser.parse(i.default.withoutArrow(e)),r=(0,n.findLastIndex)(t,{type:"method",name:"seriesByName"}),a=(0,n.findLastIndex)(t,{type:"method",name:"renameSeries"});return-1!==r&&-1!==a&&r<a}catch(e){return!1}};t.isConfigAdvanced=({items:e,context:t})=>{if("string"!=typeof e)return!1;const{label:r,value:a}=t;return"string"!=typeof r||"string"!=typeof a||(!(e=>{try{const t=l.DslParser.parse(i.default.withoutArrow(e));return 3===t.length&&(0,n.isMatch)(t[0],{type:"method",name:"frame"})&&(0,n.isMatch)(t[1],{type:"method",name:"prepend"})&&(0,n.isMatch)(t[2],{type:"method",name:"objects"})}catch(e){return!1}})(e)||!o(r)||!o(a))};t.getDynamicOptionsFromConfig=({items:e,context:r})=>{if(Array.isArray(e))return{staticOptions:e,dynamicOptionsLabel:"",dynamicOptionsValue:""};const a=r.statics||[],l=(0,n.zipWith)(...a,((e,t)=>({label:e,value:t}))),{label:i,value:o}=r;return{staticOptions:l,dynamicOptionsLabel:i?(0,t.getFieldFromFieldNameDsl)(i):"",dynamicOptionsValue:o?(0,t.getFieldFromFieldNameDsl)(o):""}}},6195:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},2649:e=>{e.exports=require("@babel/runtime/helpers/extends")},6643:e=>{e.exports=require("@splunk/react-icons/SlidersDoubleHorizontal")},7020:e=>{e.exports=require("@splunk/react-ui/Button")},7143:e=>{e.exports=require("@splunk/react-ui/ColumnLayout")},9250:e=>{e.exports=require("@splunk/react-ui/ControlGroup")},8965:e=>{e.exports=require("@splunk/react-ui/FormRows")},2373:e=>{e.exports=require("@splunk/react-ui/Select")},4082:e=>{e.exports=require("@splunk/react-ui/Text")},6379:e=>{e.exports=require("@splunk/react-ui/Tooltip")},3563:e=>{e.exports=require("@splunk/themes")},3773:e=>{e.exports=require("@splunk/ui-utils/format")},6649:e=>{e.exports=require("@splunk/ui-utils/i18n")},4853:e=>{e.exports=require("@splunk/visualization-context/DataSourceContext")},2918:e=>{e.exports=require("@splunk/visualization-encoding/DslParser")},3453:e=>{e.exports=require("@splunk/visualization-encoding/EncodingParser")},1413:e=>{e.exports=require("@splunk/visualization-encoding/utils/dsl")},2588:e=>{e.exports=require("@splunk/visualization-encoding/utils/types")},9033:e=>{e.exports=require("@splunk/visualizations-shared/dataSourceUtils")},4793:e=>{e.exports=require("lodash")},23:e=>{e.exports=require("prop-types")},9497:e=>{e.exports=require("react")},232:e=>{e.exports=require("styled-components")}},t={};function r(a){var n=t[a];if(void 0!==n)return n.exports;var l=t[a]={exports:{}};return e[a].call(l.exports,l,l.exports,r),l.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a=r(7585);module.exports=a})();
//# sourceMappingURL=DynamicItemEditor.js.map