/*!
 * 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={8687:function(e,t,o){var r=this&&this.__createBinding||(Object.create?function(e,t,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(t,o);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,r,n)}:function(e,t,o,r){void 0===r&&(r=o),e[r]=t[o]}),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 o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&r(t,e,o);return n(t,e),t},a=this&&this.__rest||function(e,t){var o={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(o[r[n]]=e[r[n]])}return o},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const u=l(o(9497)),s=i(o(23)),c=l(o(232)),d=i(o(5905)),p=o(3563),f=i(o(4008)),b=o(5862),v=o(6801),h=(0,c.default)(d.default)`
    textarea[disabled] {
        ${(0,p.pick)({enterprise:{dark:c.css`
                    color: ${p.variables.textDisabledColor};
                    background-color: ${p.variables.borderColor};
                    border-color: ${p.variables.backgroundColorHover};
                `}})}
    }
`,_=e=>{var{onChange:t,name:o,value:r="",label:n,labelPosition:l="top",labelWidth:i,hideLabel:s,isDisabled:c,help:d,tooltip:p,error:v}=e,_=a(e,["onChange","name","value","label","labelPosition","labelWidth","hideLabel","isDisabled","help","tooltip","error"]);const[g,O]=(0,u.useState)(r);(0,u.useEffect)((()=>O(r)),[r]);const y=(0,u.useCallback)(((e,{value:t})=>{O(t)}),[]),m=(0,u.useCallback)((e=>{const n=g.trim();n!==r&&t(e,o,n)}),[g,r,t,o]);return u.default.createElement(f.default,{label:n,labelPosition:l,labelWidth:i,hideLabel:s,help:d,tooltip:p,error:v},u.default.createElement(h,Object.assign({key:r,"data-test":o,style:b.editorStyle,onChange:y,onBlur:m,value:g,disabled:c},_,{error:v})))},g=Object.assign(Object.assign({},v.BaseEditorPropTypes),{value:s.default.string,hideLabel:s.default.bool,help:s.default.string,tooltip:s.default.string,error:s.default.bool});_.propTypes=g,t.default=_},6801:function(e,t,o){var r=this&&this.__createBinding||(Object.create?function(e,t,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(t,o);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,r,n)}:function(e,t,o,r){void 0===r&&(r=o),e[r]=t[o]}),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 o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&r(t,e,o);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseEditorPropTypes=void 0;const a=l(o(23));t.BaseEditorPropTypes={name:a.string.isRequired,value:a.oneOfType([a.string,a.object,a.arrayOf(a.string)]),context:a.object,label:a.string,labelPosition:a.oneOf(["top","left"]),labelWidth:a.number,onChange:a.func,isAdvanced:a.bool,isDisabled:a.bool,dataSourceBindings:a.object,options:a.object,optionsSchema:a.object}},4008:function(e,t,o){var r=this&&this.__createBinding||(Object.create?function(e,t,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(t,o);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,r,n)}:function(e,t,o,r){void 0===r&&(r=o),e[r]=t[o]}),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 o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&r(t,e,o);return n(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AdvancedConfigButton=void 0;const i=l(o(9497)),u=l(o(23)),s=a(o(232)),c=o(6649),d=a(o(6643)),p=o(3563),f=a(o(6379)),b=a(o(7020)),v=a(o(9250)),h=(0,s.default)(v.default)`
    margin-top: 0;
    padding: 0;
    // adjust bottom margin according to theme
    margin-bottom: ${p.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;
    }
`,_=(0,s.default)(f.default)`
    display: flex;
    > span {
        display: flex;
        width: 35px;
    }
`,g=(0,s.default)(b.default)`
    color: ${p.variables.contentColorActive} !important;
    &:hover {
        background-color: ${p.variables.interactiveColorOverlayDrag} !important;
    }
`;t.AdvancedConfigButton=({label:e="",onClick:t})=>i.default.createElement(_,{"data-test":`${e}-advanced-config-button-tooltip`,content:(0,c._)("Advanced configurations")},i.default.createElement(g,{"data-test":`${e}-advanced-config-button`,icon:i.default.createElement(d.default,{"data-test":`${e}-advanced-config-button-icon`}),appearance:"subtle",onClick:t}));const O=({"data-test":e,children:o,isAdvanced:r=!1,label:n,hideLabel:l,labelPosition:a,labelWidth:u,tooltip:s,help:c,style:d,error:p,controlsLayout:f,onClick:b,onAdvancedConfigButtonClick:v})=>i.default.createElement(h,{"data-test":null!=e?e:"control-group",label:n,hideLabel:l,labelPosition:a,labelWidth:u,tooltip:s,help:c,error:p,style:d,onClick:b,controlsLayout:f},r?i.Children.toArray(o).filter(Boolean).map((e=>(0,i.cloneElement)(e,{style:{flex:1}}))):o,r?i.default.createElement(t.AdvancedConfigButton,{label:n,onClick:v}):null);O.propTypes={style:u.object,isAdvanced:u.bool,onClick:u.func,onAdvancedConfigButtonClick:u.func},t.default=O},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%"}},6643:e=>{e.exports=require("@splunk/react-icons/SlidersDoubleHorizontal")},7020:e=>{e.exports=require("@splunk/react-ui/Button")},9250:e=>{e.exports=require("@splunk/react-ui/ControlGroup")},5905:e=>{e.exports=require("@splunk/react-ui/TextArea")},6379:e=>{e.exports=require("@splunk/react-ui/Tooltip")},3563:e=>{e.exports=require("@splunk/themes")},6649:e=>{e.exports=require("@splunk/ui-utils/i18n")},23:e=>{e.exports=require("prop-types")},9497:e=>{e.exports=require("react")},232:e=>{e.exports=require("styled-components")}},t={};var o=function o(r){var n=t[r];if(void 0!==n)return n.exports;var l=t[r]={exports:{}};return e[r].call(l.exports,l,l.exports,o),l.exports}(8687);module.exports=o})();
//# sourceMappingURL=TextAreaEditor.js.map