(window.uiActionsEnhanced_bundle_jsonpfunction=window.uiActionsEnhanced_bundle_jsonpfunction||[]).push([[3],{23:function(e,n,t){"use strict";var l,o=function(){var e={};return function(n){if(void 0===e[n]){var t=document.querySelector(n);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}e[n]=t}return e[n]}}(),i=[];function r(e){for(var n=-1,t=0;t{const[o,r]=Object(l.useState)(!1),a=()=>r(!1),s=e.map((({label:e})=>({key:e,label:e})));return Object(v.jsx)(i.EuiPopover,{ownFocus:!0,button:Object(v.jsx)(i.EuiText,{size:"xs"},Object(v.jsx)(i.EuiLink,{onClick:()=>r(!0)},b," ",Object(v.jsx)(i.EuiIcon,{type:"indexOpen"}))),isOpen:o,closePopover:a,panelPaddingSize:"none",anchorPosition:"downLeft"},Object(v.jsx)(i.EuiSelectable,{singleSelection:!0,searchable:!0,searchProps:{placeholder:w,compressed:!0},options:s,onChange:e=>{const t=e.find((e=>"on"===e.checked));t&&(n(t.key),a())},listProps:{showIcons:!1}},((e,n)=>Object(v.jsx)("div",{style:{width:320}},Object(v.jsx)(i.EuiPopoverTitle,null,n),e,t&&Object(v.jsx)(i.EuiPopoverFooter,{className:"eui-textRight"},Object(v.jsx)(i.EuiLink,{external:!0,href:t,target:"_blank"},h))))))},m=({config:e,variables:n,exampleUrl:t,onConfig:a,syntaxHelpDocsLink:b,variablesHelpDocsLink:h})=>{var w,m;const j=Object(l.useRef)(null),[x,C]=o.a.useState(!0),E=null!==(w=e.url.template)&&void 0!==w?w:"",O=!x&&!E,T=Object(v.jsx)(g,{variables:n,variablesHelpLink:h,onSelect:e=>{const n=j.current;n&&n.trigger("keyboard","type",{text:"{{"+e+"}}"})}});return Object(v.jsx)(o.a.Fragment,null,Object(v.jsx)(i.EuiFormRow,{fullWidth:!0,isInvalid:O,className:"uaeUrlDrilldownCollectConfig__urlTemplateFormRow",label:s,helpText:b&&Object(v.jsx)(i.EuiLink,{external:!0,target:"_blank",href:b},c),labelAppend:T},Object(v.jsx)(r.UrlTemplateEditor,{variables:n,value:E,placeholder:t,onChange:n=>function(n){e.url.template!==n&&(C(!1),a({...e,url:{...e.url,template:n}}))}(n),onEditor:e=>{j.current=e}})),Object(v.jsx)(i.EuiSpacer,{size:"l"}),Object(v.jsx)(i.EuiAccordion,{id:"accordion_url_drilldown_additional_options",buttonContent:d,"data-test-subj":"urlDrilldownAdditionalOptions"},Object(v.jsx)(i.EuiSpacer,{size:"s"}),Object(v.jsx)(i.EuiPanel,{color:"subdued",borderRadius:"none",hasShadow:!1,style:{border:"none"}},Object(v.jsx)(i.EuiFormRow,{hasChildLabel:!1},Object(v.jsx)(i.EuiSwitch,{id:"openInNewTab",name:"openInNewTab",label:u,checked:e.openInNewTab,onChange:()=>a({...e,openInNewTab:!e.openInNewTab}),"data-test-subj":"urlDrilldownOpenInNewTab"})),Object(v.jsx)(i.EuiFormRow,{hasChildLabel:!1,fullWidth:!0},Object(v.jsx)(i.EuiSwitch,{id:"encodeUrl",name:"encodeUrl",label:Object(v.jsx)(o.a.Fragment,null,f,Object(v.jsx)(i.EuiSpacer,{size:"s"}),Object(v.jsx)(i.EuiTextColor,{color:"subdued"},p)),checked:null===(m=e.encodeUrl)||void 0===m||m,onChange:()=>{var n;return a({...e,encodeUrl:!(null===(n=e.encodeUrl)||void 0===n||n)})}})))))}}}]);