"use strict";(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[5181],{45181:(e,t,n)=>{n.r(t),n.d(t,{default:()=>O});var l=n(18446),a=n.n(l),r=n(87185),o=n.n(r),u=n(67294),i=n(55786),s=n(10581),c=n(62720),p=n(55867),d=n(16355),f=n(23279),h=n.n(f),v=n(90057),m=n(4715),S=n(27600),g=n(85633),b=n(52004),w=n(74448),y=n(56080),F=n(11965);function M(e,t){switch(t.type){case"ownState":return e.ownState={...e.ownState,...t.ownState},e;case"filterState":return e.extraFormData=t.extraFormData,e.__cache=t.__cache,e.filterState={...e.filterState,...t.filterState},e;default:return e}}function O(e){const{coltypeMap:t,data:n,filterState:l,formData:r,height:f,isRefreshing:O,width:C,setDataMask:N,setHoveredFilter:Z,unsetHoveredFilter:E,setFocusedFilter:T,unsetFocusedFilter:A,setFilterActive:k,appSection:x,showOverflow:L,parentRef:_,inputRef:R,filterBarOrientation:D}=e,{enableEmptyFilter:I,multiSelect:j,showSearch:P,inverseSelection:$,defaultToFirstItem:G,searchAllOptions:B}=r,H=(0,u.useMemo)((()=>(0,i.Z)(r.groupby).map(s.Z)),[r.groupby]),[J]=H,[K]=(0,u.useState)(t),[V,q]=(0,u.useState)(""),[W,Q]=(0,v.C)(M,{extraFormData:{},filterState:l}),U=t[J],z=(0,u.useMemo)((()=>(0,y.EG)({timeFormatter:c.Z})),[]),X=(0,u.useCallback)((e=>{const t=I&&!$&&!(null!=e&&e.length),n=$&&null!=e&&e.length?(0,p.t)(" (excluded)"):"";Q({type:"filterState",__cache:l,extraFormData:(0,y.vb)(J,e,t,$),filterState:{...l,label:null!=e&&e.length?`${(e||[]).map((e=>z(e,U))).join(", ")}${n}`:void 0,value:x===d.Tr.FILTER_CONFIG_MODAL&&G?void 0:e}})}),[x,J,U,G,Q,I,$,JSON.stringify(l),z]),Y=x===d.Tr.FILTER_CONFIG_MODAL&&G,ee=(0,u.useMemo)((()=>h()((e=>{q(e),B&&Q({type:"ownState",ownState:{coltypeMap:K,search:e}})}),S.M$)),[Q,K,B]),te=(0,u.useCallback)((()=>{q(""),B&&Q({type:"ownState",ownState:{coltypeMap:K,search:null}})}),[Q,K,B]),ne=(0,u.useCallback)((()=>{te(),A()}),[te,A]),le=(0,u.useCallback)((e=>{const t=null===e?[null]:(0,i.Z)(e);0===t.length?X(null):X(t)}),[X]),ae=0===n.length?(0,p.t)("No data"):(0,p.tn)("%s option","%s options",n.length,n.length),re=(0,u.useMemo)((()=>{if(l.validateMessage)return(0,F.tZ)(w.Am,{status:l.validateStatus},l.validateMessage)}),[l.validateMessage,l.validateStatus]),oe=(0,u.useMemo)((()=>{const e=[...n];return o()(e,a()).map((e=>{const[t]=H.map((t=>e[t]));return{label:z(t,U),value:t,isNewOption:!1}}))}),[n,U,H,z]),ue=(0,u.useMemo)((()=>(!V||j||(0,g.Gq)(V,oe,!0)||oe.unshift({label:V,value:V,isNewOption:!0}),oe)),[j,V,oe]),ie=(0,u.useCallback)(((e,t)=>{const n=(0,g.mj)("label");return r.sortAscending?n(e,t):n(t,e)}),[r.sortAscending]);return(0,u.useEffect)((()=>{if(G&&void 0===l.value){const e=n[0]?H.map((e=>n[0][e])):null;void 0!==(null==e?void 0:e[0])&&X(e)}else X(Y?null:l.value)}),[J,Y,G,I,$,X,n,H,JSON.stringify(l.value)]),(0,u.useEffect)((()=>{N(W)}),[JSON.stringify(W)]),(0,F.tZ)(w.un,{height:f,width:C},(0,F.tZ)(w.jp,{validateStatus:l.validateStatus,extra:re},(0,F.tZ)(m.Ph,{allowClear:!0,allowNewOptions:!0,allowSelectAll:!B,value:l.value||[],disabled:Y,getPopupContainer:L?()=>(null==_?void 0:_.current)||document.body:e=>(null==e?void 0:e.parentNode)||document.body,showSearch:P,mode:j?"multiple":"single",placeholder:ae,onSearch:ee,onSelect:te,onBlur:ne,onFocus:T,onMouseEnter:Z,onMouseLeave:E,onChange:le,ref:R,loading:O,oneLine:D===b.Bp.HORIZONTAL,invertSelection:$,options:ue,sortComparator:ie,onDropdownVisibleChange:k})))}},74448:(e,t,n)=>{n.d(t,{Am:()=>u,jp:()=>o,un:()=>r});var l=n(51995),a=n(4591);const r=l.iK.div`
  min-height: ${e=>{let{height:t}=e;return t}}px;
  width: ${e=>{let{width:t}=e;return t}}px;
`,o=(0,l.iK)(a.Z)`
  &.ant-row.ant-form-item {
    margin: 0;
  }
`,u=l.iK.div`
  color: ${e=>{var t;let{theme:n,status:l="error"}=e;return null==(t=n.colors[l])?void 0:t.base}};
`},56080:(e,t,n)=>{n.d(t,{EG:()=>i,WO:()=>u,vb:()=>o});var l=n(88889),a=n(54076),r=n(61641);const o=function(e,t,n,l){void 0===n&&(n=!1),void 0===l&&(l=!1);const a={};return n?a.adhoc_filters=[{expressionType:r.v.SQL,clause:r.P.WHERE,sqlExpression:"1 = 0"}]:null!=t&&0!==t.length&&(a.filters=[{col:e,op:l?"NOT IN":"IN",val:t}]),a},u=(e,t,n)=>{const l=[];return null!=t&&t!==n&&l.push({col:e,op:">=",val:t}),null!=n&&n!==t&&l.push({col:e,op:"<=",val:n}),null!=n&&null!=t&&n===t&&l.push({col:e,op:"==",val:n}),l.length?{filters:l}:{}};function i(e){let{timeFormatter:t,numberFormatter:n}=void 0===e?{}:e;return(e,r)=>{if(null==e)return a.li;if("boolean"==typeof e)return e?a.Tb:a.jy;if(r===l.Z.BOOLEAN)try{return JSON.parse(String(e).toLowerCase())?a.Tb:a.jy}catch{return a.jy}return"string"==typeof e?e:t&&r===l.Z.TEMPORAL?t(e):n&&"number"==typeof e&&r===l.Z.NUMERIC?n(e):String(e)}}},90057:(e,t,n)=>{n.d(t,{C:()=>o,x:()=>r});var l=n(12902),a=n(67294);function r(e){var t=(0,a.useState)((function(){return(0,l.vV)("function"==typeof e?e():e,!0)})),n=t[1];return[t[0],(0,a.useCallback)((function(e){n("function"==typeof e?(0,l.ZP)(e):(0,l.vV)(e))}),[])]}function o(e,t,n){var r=(0,a.useMemo)((function(){return(0,l.ZP)(e)}),[e]);return(0,a.useReducer)(r,t,n)}}}]);
//# sourceMappingURL=2de2db32ba60017ab66e.chunk.js.map