"use strict";(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[1456],{379069:(e,t,o)=>{o.d(t,{Z:()=>u});var i=o(667294),n=o(45697),l=o.n(n),s=o(751995),r=o(211965),a=o(482342),h=o(787253),c=o(135944);const d={value:l().bool,label:l().string,onChange:l().func},p=s.iK.div`
  ${({theme:e})=>r.iv`
    .ControlHeader label {
      color: ${e.colors.grayscale.dark1};
    }
    span[role='checkbox'] {
      padding-right: ${2*e.gridUnit}px;
    }
  `}
`;class u extends i.Component{onChange(){this.props.onChange(!this.props.value)}renderCheckbox(){return(0,c.tZ)(h.ZP,{onChange:this.onChange.bind(this),checked:!!this.props.value})}render(){return this.props.label?(0,c.tZ)(p,{children:(0,c.tZ)(a.Z,{...this.props,leftNode:this.renderCheckbox(),onClick:this.onChange.bind(this)})}):this.renderCheckbox()}}u.propTypes=d,u.defaultProps={value:!1,onChange:()=>{}}},182199:(e,t,o)=>{o.d(t,{Z:()=>u});var i=o(667294),n=o(45697),l=o.n(n),s=o(201111),r=o(61988),a=o(211965),h=o(281315),c=o(482342),d=o(135944);const p={ariaLabel:l().string,autoFocus:l().bool,choices:l().array,clearable:l().bool,description:l().oneOfType([l().string,l().node]),disabled:l().bool,freeForm:l().bool,isLoading:l().bool,mode:l().string,multi:l().bool,isMulti:l().bool,name:l().string.isRequired,onChange:l().func,onFocus:l().func,onSelect:l().func,onDeselect:l().func,value:l().oneOfType([l().string,l().number,l().array]),default:l().oneOfType([l().string,l().number,l().array]),showHeader:l().bool,optionRenderer:l().func,valueKey:l().string,options:l().array,placeholder:l().string,filterOption:l().func,tokenSeparators:l().arrayOf(l().string),notFoundContent:l().object,label:l().string,renderTrigger:l().bool,validationErrors:l().array,rightNode:l().node,leftNode:l().node,onClick:l().func,hovered:l().bool,tooltipOnClick:l().func,warning:l().string,danger:l().string};class u extends i.PureComponent{constructor(e){super(e),this.state={options:this.getOptions(e)},this.onChange=this.onChange.bind(this),this.handleFilterOptions=this.handleFilterOptions.bind(this)}UNSAFE_componentWillReceiveProps(e){if(!(0,s.Z)(e.choices,this.props.choices)||!(0,s.Z)(e.options,this.props.options)){const t=this.getOptions(e);this.setState({options:t})}}onChange(e){const{valueKey:t}=this.props;let o=e;Array.isArray(e)&&(o=e.map((e=>void 0!==(null==e?void 0:e[t])?e[t]:e))),"object"==typeof e&&void 0!==(null==e?void 0:e[t])&&(o=e[t]),this.props.onChange(o,[])}getOptions(e){const{choices:t,optionRenderer:o,valueKey:i}=e;let n=[];return e.options?n=e.options.map((e=>({...e,value:e[i],label:e.label||e[i],customLabel:o?o(e):void 0}))):t&&(n=t.map((e=>{if(Array.isArray(e)){const[t,o]=e.length>1?e:[e[0],e[0]];return{value:t,label:o}}return Object.is(e)?{...e,value:e[i],label:e.label||e[i]}:{value:e,label:e}}))),n}handleFilterOptions(e,t){const{filterOption:o}=this.props;return o({data:t},e)}render(){const{ariaLabel:e,autoFocus:t,clearable:o,disabled:i,filterOption:n,freeForm:l,isLoading:s,isMulti:p,label:u,multi:g,name:C,notFoundContent:b,onFocus:v,onSelect:m,onDeselect:y,placeholder:f,showHeader:Z,tokenSeparators:x,value:k,description:S,renderTrigger:F,rightNode:O,leftNode:X,validationErrors:P,onClick:w,hovered:L,tooltipOnClick:T,warning:B,danger:$}=this.props,N={name:C,label:u,description:S,renderTrigger:F,rightNode:O,leftNode:X,validationErrors:P,onClick:w,hovered:L,tooltipOnClick:T,warning:B,danger:$},R={allowNewOptions:l,autoFocus:t,ariaLabel:e||("string"==typeof u?u:(0,r.t)("Select ...")),allowClear:o,disabled:i,filterOption:!n||"function"!=typeof n||this.handleFilterOptions,header:Z&&(0,d.tZ)(c.Z,{...N}),loading:s,mode:this.props.mode||(p||g?"multiple":"single"),name:`select-${C}`,onChange:this.onChange,onFocus:v,onSelect:m,onDeselect:y,options:this.state.options,placeholder:f,sortComparator:this.props.sortComparator,value:(()=>{const e=null!=k?k:void 0!==this.props.default?this.props.default:void 0;if(null!==e||this.state.options.find((e=>null===e.value)))return e})(),tokenSeparators:x,notFoundContent:b};return(0,d.tZ)("div",{css:e=>a.iv`
          .type-label {
            margin-right: ${2*e.gridUnit}px;
          }
          .Select__multi-value__label > span,
          .Select__option > span,
          .Select__single-value > span {
            display: flex;
            align-items: center;
          }
        `,children:(0,d.tZ)(h.Z,{...R})})}}u.propTypes=p,u.defaultProps={autoFocus:!1,choices:[],clearable:!0,description:null,disabled:!1,freeForm:!1,isLoading:!1,label:null,multi:!1,onChange:()=>{},onFocus:()=>{},showHeader:!0,valueKey:"value"}},100665:(e,t,o)=>{o.d(t,{Z:()=>y});var i=o(667294),n=o(45697),l=o.n(n),s=o(104715),r=o(61988),a=o(737921),h=o(999075),c=o(883734),d=o(787253),p=o(482342),u=o(182199),g=o(135944);const C="latlong",b="delimited",v="geohash",m={onChange:l().func,value:l().object,animation:l().bool,choices:l().array};class y extends i.Component{constructor(e){super(e);const t=e.value||{};let o;e.choices.length>0&&(o=e.choices[0][0]),this.state={type:t.type||C,delimiter:t.delimiter||",",latCol:t.latCol||o,lonCol:t.lonCol||o,lonlatCol:t.lonlatCol||o,reverseCheckbox:t.reverseCheckbox||!1,geohashCol:t.geohashCol||o,value:null,errors:[]},this.toggleCheckbox=this.toggleCheckbox.bind(this),this.onChange=this.onChange.bind(this),this.renderReverseCheckbox=this.renderReverseCheckbox.bind(this)}componentDidMount(){this.onChange()}onChange(){const{type:e}=this.state,t={type:e},o=[],i=(0,r.t)("Invalid lat/long configuration.");e===C?(t.latCol=this.state.latCol,t.lonCol=this.state.lonCol,t.lonCol&&t.latCol||o.push(i)):e===b?(t.lonlatCol=this.state.lonlatCol,t.delimiter=this.state.delimiter,t.reverseCheckbox=this.state.reverseCheckbox,t.lonlatCol&&t.delimiter||o.push(i)):e===v&&(t.geohashCol=this.state.geohashCol,t.reverseCheckbox=this.state.reverseCheckbox,t.geohashCol||o.push(i)),this.setState({value:t,errors:o}),this.props.onChange(t,o)}setType(e){this.setState({type:e},this.onChange)}toggleCheckbox(){this.setState((e=>({reverseCheckbox:!e.reverseCheckbox})),this.onChange)}renderLabelContent(){return this.state.errors.length>0?"N/A":this.state.type===C?`${this.state.lonCol} | ${this.state.latCol}`:this.state.type===b?`${this.state.lonlatCol}`:this.state.type===v?`${this.state.geohashCol}`:null}renderSelect(e,t){return(0,g.tZ)(u.Z,{ariaLabel:e,name:e,choices:this.props.choices,value:this.state[e],clearable:!1,onFocus:()=>{this.setType(t)},onChange:t=>{this.setState({[e]:t},this.onChange)}})}renderReverseCheckbox(){return(0,g.BX)("span",{children:[(0,r.t)("Reverse lat/long "),(0,g.tZ)(d.ZP,{checked:this.state.reverseCheckbox,onChange:this.toggleCheckbox})]})}renderPopoverContent(){return(0,g.BX)("div",{style:{width:"300px"},children:[(0,g.tZ)(c.Z,{title:(0,r.t)("Longitude & Latitude columns"),isSelected:this.state.type===C,onSelect:this.setType.bind(this,C),children:(0,g.BX)(s.X2,{gutter:16,children:[(0,g.BX)(s.JX,{xs:24,md:12,children:[(0,r.t)("Longitude"),this.renderSelect("lonCol",C)]}),(0,g.BX)(s.JX,{xs:24,md:12,children:[(0,r.t)("Latitude"),this.renderSelect("latCol",C)]})]})}),(0,g.tZ)(c.Z,{title:(0,r.t)("Delimited long & lat single column"),info:(0,r.t)("Multiple formats accepted, look the geopy.points Python library for more details"),isSelected:this.state.type===b,onSelect:this.setType.bind(this,b),children:(0,g.BX)(s.X2,{gutter:16,children:[(0,g.BX)(s.JX,{xs:24,md:12,children:[(0,r.t)("Column"),this.renderSelect("lonlatCol",b)]}),(0,g.tZ)(s.JX,{xs:24,md:12,children:this.renderReverseCheckbox()})]})}),(0,g.tZ)(c.Z,{title:(0,r.t)("Geohash"),isSelected:this.state.type===v,onSelect:this.setType.bind(this,v),children:(0,g.BX)(s.X2,{gutter:16,children:[(0,g.BX)(s.JX,{xs:24,md:12,children:[(0,r.t)("Column"),this.renderSelect("geohashCol",v)]}),(0,g.tZ)(s.JX,{xs:24,md:12,children:this.renderReverseCheckbox()})]})})]})}render(){return(0,g.BX)("div",{children:[(0,g.tZ)(p.Z,{...this.props}),(0,g.tZ)(h.J,{content:this.renderPopoverContent(),placement:"topLeft",trigger:"click",children:(0,g.tZ)(a.Z,{className:"pointer",children:this.renderLabelContent()})})]})}}y.propTypes=m,y.defaultProps={onChange:()=>{},animation:!0,choices:[]}},883734:(e,t,o)=>{o.d(t,{Z:()=>a});var i=o(211965),n=o(751995),l=o(358593),s=o(313322),r=o(135944);function a({title:e,isSelected:t,children:o,onSelect:a,info:h}){const c=(0,n.Fg)();return(0,r.BX)("div",{css:(0,i.iv)({paddingBottom:2*c.gridUnit,opacity:t?1:c.opacity.mediumHeavy},"",""),children:[(0,r.BX)("div",{role:"button",tabIndex:0,onClick:a,css:(0,i.iv)({display:"flex",alignItems:"center",cursor:a?"pointer":"default"},"",""),children:[(0,r.tZ)("strong",{children:e}),h&&(0,r.tZ)(l.u,{title:h,css:(0,i.iv)({marginLeft:c.gridUnit},"",""),children:(0,r.tZ)(s.Z.InfoSolidSmall,{role:"img",width:14,height:14,iconColor:c.colors.grayscale.light1})}),(0,r.tZ)(s.Z.Check,{role:"img",iconColor:t?c.colors.primary.base:c.colors.grayscale.base})]}),(0,r.tZ)("div",{css:(0,i.iv)({marginLeft:c.gridUnit,marginTop:c.gridUnit},"",""),children:o})]})}},209870:(e,t,o)=>{o.d(t,{Z:()=>C});var i=o(667294),n=o(828216),l=o(751995),s=o(211965),r=o(61988),a=o(355786),h=o(537208),c=o(104715),d=o(482342),p=o(135944);const u=l.iK.div`
  ${({theme:e})=>s.iv`
    display: flex;
    align-items: center;

    & > :first-child {
      margin-right: ${4*e.gridUnit}px;
      min-width: 0;
      flex: 1;
    }

    & > :nth-child(2) {
      min-width: 0;
      flex: 1;
    }
  `}
`,g=[{value:"prefix",label:(0,r.t)("Prefix")},{value:"suffix",label:(0,r.t)("Suffix")}],C=({onChange:e,value:t={},symbolSelectOverrideProps:o={},currencySelectOverrideProps:l={},symbolSelectAdditionalStyles:C,currencySelectAdditionalStyles:b,...v})=>{const m=(0,n.v9)((e=>{var t;return null==(t=e.common)?void 0:t.currencies})),y=(0,i.useMemo)((()=>(0,a.Z)(m).map((e=>({value:e,label:`${(0,h.j)({symbol:e})} (${e})`})))),[m]);return(0,p.BX)(p.HY,{children:[(0,p.tZ)(d.Z,{...v}),(0,p.BX)(u,{css:s.iv`
          & > :first-child {
            ${C};
          }
          & > :nth-child(2) {
            ${b};
          }
        `,className:"currency-control-container",children:[(0,p.tZ)(c.Ph,{ariaLabel:(0,r.t)("Currency prefix or suffix"),options:g,placeholder:(0,r.t)("Prefix or suffix"),onChange:o=>{e({...t,symbolPosition:o})},onClear:()=>e({...t,symbolPosition:void 0}),value:null==t?void 0:t.symbolPosition,allowClear:!0,...o}),(0,p.tZ)(c.Ph,{ariaLabel:(0,r.t)("Currency symbol"),options:y,placeholder:(0,r.t)("Currency"),onChange:o=>{e({...t,symbol:o})},onClear:()=>e({...t,symbol:void 0}),value:null==t?void 0:t.symbol,allowClear:!0,allowNewOptions:!0,...l})]})]})}},979684:(e,t,o)=>{o.d(t,{Z:()=>u});var i=o(23279),n=o.n(i),l=o(667294),s=o(799298),r=o(375294),a=o(427600),h=o(482342),c=o(9875),d=o(135944);const p=e=>null==e?"":String(e);class u extends l.Component{constructor(e){super(e),this.initialValue=void 0,this.onChange=e=>{var t,o;let i=e;const n=[];if(""!==e&&this.props.isFloat){const t=(0,s.Z)(e);t?n.push(t):i=e.match(/.*([.0])$/g)?e:parseFloat(e)}if(""!==e&&this.props.isInt){const t=(0,r.Z)(e);t?n.push(t):i=parseInt(e,10)}null==(t=(o=this.props).onChange)||t.call(o,i,n)},this.debouncedOnChange=n()((e=>{this.onChange(e)}),a.oP),this.onChangeWrapper=e=>{const{value:t}=e.target;this.setState({value:t},(()=>{this.debouncedOnChange(t)}))},this.initialValue=e.value,this.state={value:p(this.initialValue)}}render(){let{value:e}=this.state;return this.initialValue!==this.props.value&&(this.initialValue=this.props.value,e=p(this.props.value)),(0,d.BX)("div",{children:[(0,d.tZ)(h.Z,{...this.props}),(0,d.tZ)(c.II,{type:"text",placeholder:this.props.placeholder,onChange:this.onChangeWrapper,onFocus:this.props.onFocus,value:e,disabled:this.props.disabled,"aria-label":this.props.label})]})}}}}]);
//# sourceMappingURL=61c20624bc36544cf64d.chunk.js.map