(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[665],{545578:(e,t,a)=>{var r=a(267206),n=a(345652);e.exports=function(e,t){return e&&e.length?n(e,r(t,2)):[]}},452630:(e,t,a)=>{"use strict";t.iB=t.YM=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},n=l(a(667294)),i=l(a(45697)),s=a(402371);function l(e){return e&&e.__esModule?e:{default:e}}t.YM=function(e){var t=e.itemTypeToComponent,a=e.WrapperComponent,l=void 0===a?"div":a,o=function(e){var a=e.currentPage,i=e.totalPages,o=e.boundaryPagesRange,d=e.siblingPagesRange,c=e.hideEllipsis,u=e.hidePreviousAndNextPageLinks,h=e.hideFirstAndLastPageLinks,p=e.onChange,g=e.disabled,m=function(e,t){var a={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(a[r]=e[r]);return a}(e,["currentPage","totalPages","boundaryPagesRange","siblingPagesRange","hideEllipsis","hidePreviousAndNextPageLinks","hideFirstAndLastPageLinks","onChange","disabled"]),v=(0,s.getPaginationModel)({currentPage:a,totalPages:i,boundaryPagesRange:o,siblingPagesRange:d,hideEllipsis:c,hidePreviousAndNextPageLinks:u,hideFirstAndLastPageLinks:h}),b=function(e,t,a){return function(i){var s,l,o,d=e[i.type],c=(l=(s=i).value,o=s.isDisabled,function(){!o&&a&&t!==l&&a(l)});return n.default.createElement(d,r({onClick:c},i))}}(t,a,p);return n.default.createElement(l,m,v.map((function(e){return b(r({},e,{isDisabled:!!g}))})))};return o.propTypes={currentPage:i.default.number.isRequired,totalPages:i.default.number.isRequired,boundaryPagesRange:i.default.number,siblingPagesRange:i.default.number,hideEllipsis:i.default.bool,hidePreviousAndNextPageLinks:i.default.bool,hideFirstAndLastPageLinks:i.default.bool,onChange:i.default.func,disabled:i.default.bool},o},t.iB=s.ITEM_TYPES},751794:(e,t,a)=>{"use strict";a.d(t,{Z:()=>n});var r=a(667294);const n=()=>{const[e,t]=(0,r.useState)(0),[a,n]=(0,r.useState)(!1),i=(0,r.useRef)(null),s=(0,r.useRef)(null);return(0,r.useLayoutEffect)((()=>{var e;const a=()=>{const e=i.current;if(!e)return;const a=s.current,{scrollWidth:r,clientWidth:l,childNodes:o}=e;if(r>l){const e=6,r=(null==a?void 0:a.offsetWidth)||0,i=l-e,s=o.length;let d=0,c=0;for(let e=0;e<s;e+=1)i-d-r<=0&&(c+=1),d+=o[e].offsetWidth;s>1&&c?(n(!0),t(c)):(n(!1),t(1))}else n(!1),t(0)},r=new ResizeObserver(a),l=null==(e=i.current)?void 0:e.parentElement;return l&&r.observe(l),a(),()=>{r.disconnect()}}),[s.current]),[i,s,e,a]}},554070:(e,t,a)=>{"use strict";a.d(t,{w:()=>l});var r=a(358593),n=a(83379),i=a(61988),s=a(135944);const l=({user:e,date:t})=>{const a=(0,s.tZ)("span",{className:"no-wrap",children:t});if(e){const t=(0,n.Z)(e),l=(0,i.t)("Modified by: %s",t);return(0,s.tZ)(r.u,{title:l,placement:"bottom",children:a})}return a}},727989:(e,t,a)=>{"use strict";a.d(t,{Z:()=>g});var r=a(667294),n=a(751995),i=a(61988),s=a(835932),l=a(774069),o=a(104715),d=a(34858),c=a(762921),u=a(135944);const h=n.iK.div`
  display: block;
  color: ${({theme:e})=>e.colors.grayscale.base};
  font-size: ${({theme:e})=>e.typography.sizes.s}px;
`,p=n.iK.div`
  padding-bottom: ${({theme:e})=>2*e.gridUnit}px;
  padding-top: ${({theme:e})=>2*e.gridUnit}px;

  & > div {
    margin: ${({theme:e})=>e.gridUnit}px 0;
  }

  &.extra-container {
    padding-top: 8px;
  }

  .confirm-overwrite {
    margin-bottom: ${({theme:e})=>2*e.gridUnit}px;
  }

  .input-container {
    display: flex;
    align-items: center;

    label {
      display: flex;
      margin-right: ${({theme:e})=>2*e.gridUnit}px;
    }

    i {
      margin: 0 ${({theme:e})=>e.gridUnit}px;
    }
  }

  input,
  textarea {
    flex: 1 1 auto;
  }

  textarea {
    height: 160px;
    resize: none;
  }

  input::placeholder,
  textarea::placeholder {
    color: ${({theme:e})=>e.colors.grayscale.light1};
  }

  textarea,
  input[type='text'],
  input[type='number'] {
    padding: ${({theme:e})=>1.5*e.gridUnit}px
      ${({theme:e})=>2*e.gridUnit}px;
    border-style: none;
    border: 1px solid ${({theme:e})=>e.colors.grayscale.light2};
    border-radius: ${({theme:e})=>e.gridUnit}px;

    &[name='name'] {
      flex: 0 1 auto;
      width: 40%;
    }

    &[name='sqlalchemy_uri'] {
      margin-right: ${({theme:e})=>3*e.gridUnit}px;
    }
  }
`,g=({resourceName:e,resourceLabel:t,passwordsNeededMessage:a,confirmOverwriteMessage:n,onModelImport:g,show:m,onHide:v,passwordFields:b=[],setPasswordFields:f=(()=>{}),sshTunnelPasswordFields:y=[],setSSHTunnelPasswordFields:_=(()=>{}),sshTunnelPrivateKeyFields:P=[],setSSHTunnelPrivateKeyFields:E=(()=>{}),sshTunnelPrivateKeyPasswordFields:S=[],setSSHTunnelPrivateKeyPasswordFields:w=(()=>{})})=>{const[T,I]=(0,r.useState)(!0),[L,N]=(0,r.useState)({}),[Z,k]=(0,r.useState)(!1),[x,A]=(0,r.useState)(!1),[M,C]=(0,r.useState)([]),[R,F]=(0,r.useState)(!1),[K,B]=(0,r.useState)(),[$,H]=(0,r.useState)({}),[O,Y]=(0,r.useState)({}),[D,X]=(0,r.useState)({}),U=()=>{C([]),f([]),N({}),k(!1),A(!1),F(!1),B(""),_([]),E([]),w([]),H({}),Y({}),X({})},{state:{alreadyExists:z,passwordsNeeded:G,sshPasswordNeeded:q,sshPrivateKeyNeeded:V,sshPrivateKeyPasswordNeeded:W},importResource:j}=(0,d.PW)(e,t,(e=>{B(e)}));(0,r.useEffect)((()=>{f(G),G.length>0&&F(!1)}),[G,f]),(0,r.useEffect)((()=>{k(z.length>0),z.length>0&&F(!1)}),[z,k]),(0,r.useEffect)((()=>{_(q),q.length>0&&F(!1)}),[q,_]),(0,r.useEffect)((()=>{E(V),V.length>0&&F(!1)}),[V,E]),(0,r.useEffect)((()=>{w(W),W.length>0&&F(!1)}),[W,w]);return T&&m&&I(!1),(0,u.BX)(l.default,{name:"model",className:"import-model-modal",disablePrimaryButton:0===M.length||Z&&!x||R,onHandledPrimaryAction:()=>{var e;(null==(e=M[0])?void 0:e.originFileObj)instanceof File&&(F(!0),j(M[0].originFileObj,L,$,O,D,x).then((e=>{e&&(U(),g())})))},onHide:()=>{I(!0),v(),U()},primaryButtonName:Z?(0,i.t)("Overwrite"):(0,i.t)("Import"),primaryButtonType:Z?"danger":"primary",width:"750px",show:m,title:(0,u.tZ)("h4",{children:(0,i.t)("Import %s",t)}),children:[(0,u.tZ)(p,{children:(0,u.tZ)(o.gq,{name:"modelFile",id:"modelFile",accept:".yaml,.json,.yml,.zip",fileList:M,onChange:e=>{C([{...e.file,status:"done"}])},onRemove:e=>(C(M.filter((t=>t.uid!==e.uid))),!1),customRequest:()=>{},disabled:R,children:(0,u.tZ)(s.Z,{loading:R,children:(0,i.t)("Select file")})})}),K&&(0,u.tZ)(c.Z,{errorMessage:K,showDbInstallInstructions:b.length>0||y.length>0||P.length>0||S.length>0}),(()=>{if(0===b.length&&0===y.length&&0===P.length&&0===S.length)return null;const e=[...new Set([...b,...y,...P,...S])];return(0,u.BX)(u.HY,{children:[(0,u.tZ)("h5",{children:(0,i.t)("Database passwords")}),(0,u.tZ)(h,{children:a}),e.map((e=>(0,u.BX)(u.HY,{children:[(null==b?void 0:b.indexOf(e))>=0&&(0,u.BX)(p,{children:[(0,u.BX)("div",{className:"control-label",children:[(0,i.t)("%s PASSWORD",e.slice(10)),(0,u.tZ)("span",{className:"required",children:"*"})]}),(0,u.tZ)("input",{name:`password-${e}`,autoComplete:`password-${e}`,type:"password",value:L[e],onChange:t=>N({...L,[e]:t.target.value})})]},`password-for-${e}`),(null==y?void 0:y.indexOf(e))>=0&&(0,u.BX)(p,{children:[(0,u.BX)("div",{className:"control-label",children:[(0,i.t)("%s SSH TUNNEL PASSWORD",e.slice(10)),(0,u.tZ)("span",{className:"required",children:"*"})]}),(0,u.tZ)("input",{name:`ssh_tunnel_password-${e}`,autoComplete:`ssh_tunnel_password-${e}`,type:"password",value:$[e],onChange:t=>H({...$,[e]:t.target.value})})]},`ssh_tunnel_password-for-${e}`),(null==P?void 0:P.indexOf(e))>=0&&(0,u.BX)(p,{children:[(0,u.BX)("div",{className:"control-label",children:[(0,i.t)("%s SSH TUNNEL PRIVATE KEY",e.slice(10)),(0,u.tZ)("span",{className:"required",children:"*"})]}),(0,u.tZ)("textarea",{name:`ssh_tunnel_private_key-${e}`,autoComplete:`ssh_tunnel_private_key-${e}`,value:O[e],onChange:t=>Y({...O,[e]:t.target.value})})]},`ssh_tunnel_private_key-for-${e}`),(null==S?void 0:S.indexOf(e))>=0&&(0,u.BX)(p,{children:[(0,u.BX)("div",{className:"control-label",children:[(0,i.t)("%s SSH TUNNEL PRIVATE KEY PASSWORD",e.slice(10)),(0,u.tZ)("span",{className:"required",children:"*"})]}),(0,u.tZ)("input",{name:`ssh_tunnel_private_key_password-${e}`,autoComplete:`ssh_tunnel_private_key_password-${e}`,type:"password",value:D[e],onChange:t=>X({...D,[e]:t.target.value})})]},`ssh_tunnel_private_key_password-for-${e}`)]})))]})})(),Z?(0,u.tZ)(u.HY,{children:(0,u.BX)(p,{children:[(0,u.tZ)("div",{className:"confirm-overwrite",children:n}),(0,u.tZ)("div",{className:"control-label",children:(0,i.t)('Type "%s" to confirm',(0,i.t)("OVERWRITE"))}),(0,u.tZ)("input",{id:"overwrite",type:"text",onChange:e=>{var t,a;const r=null!=(t=null==(a=e.currentTarget)?void 0:a.value)?t:"";A(r.toUpperCase()===(0,i.t)("OVERWRITE"))}})]})}):null]})}},25772:(e,t,a)=>{"use strict";a.d(t,{P:()=>r.Z});var r=a(465477);a(908420)},301510:(e,t,a)=>{"use strict";a.d(t,{GW:()=>y,Rz:()=>f,X3:()=>m,on:()=>p,vk:()=>g,zi:()=>h});var r=a(5364),n=a(616355),i=a(593185),s=a(61988),l=a(870400),o=a(81255),d=a(680621),c=a(920292);const u=()=>{var e,t;const a=(0,c.Z)();return(null==a||null==(e=a.common)||null==(t=e.conf)?void 0:t.NATIVE_FILTER_DEFAULT_ROW_LIMIT)||1e3},h=({datasetId:e,dependencies:t={},groupby:a,defaultDataMask:r,controlValues:n,filterType:i,sortMetric:s,adhoc_filters:o,time_range:d,granularity_sqla:c,type:h,dashboardId:p,id:g})=>{var m;const v={};return e&&(v.datasource=`${e}__table`),a&&(v.groupby=[a]),s&&(v.sortMetric=s),{...n,...v,adhoc_filters:null!=o?o:[],extra_filters:[],extra_form_data:t,granularity_sqla:c,metrics:["count"],row_limit:u(),showSearch:!0,defaultValue:null==r||null==(m=r.filterState)?void 0:m.value,time_range:d,url_params:(0,l.Z)("regular"),inView:!0,viz_type:i,type:h,dashboardId:p,native_filter_id:g}};function p(e={},t={}){const a={};return r.Ci.forEach((r=>{const n=[...e[r]||[],...t[r]||[]];n.length&&(a[r]=n)})),r.Ay.forEach((r=>{const n=e[r];void 0!==n&&(a[r]=n);const i=t[r];void 0!==i&&(a[r]=i)})),a}function g(e,t){let a={};return t.forEach((t=>{var r,n;a=p(a,null!=(r=null==(n=e[t])?void 0:n.extraFormData)?r:{})})),a}function m(e){return!e.includes(n.cg.NativeFilter)||(0,i.cr)(i.TT.DashboardCrossFilters)&&e.includes(n.cg.InteractiveChart)}const v=(e,t)=>{var a;return(null==e||null==(a=e[t])?void 0:a.type)===o.gn},b=(e,t,a,r,n,i)=>{var s,l,d,c,u,h;i.has(a)||(i.add(a),(null==e||null==(s=e[a])?void 0:s.type)===o.dW&&t.includes(null==(l=e[a])||null==(d=l.meta)?void 0:d.chartId)&&r.forEach(n.add,n),0===(null==e||null==(c=e[a])||null==(u=c.children)?void 0:u.length)||v(e,a)&&n.has(a)||null==(h=e[a])||h.children.forEach((a=>b(e,t,a,v(e,a)?[...r,a]:r,n,i))))},f=(e,t)=>{const a=e[d._4].children[0],r=a!==d.PV,n=new Set,i=new Set;var s,l;return r?null==(s=e[a])||null==(l=s.children)||l.forEach((a=>b(e,t,a,[a],n,i))):Object.values(e).filter((e=>(null==e?void 0:e.type)===o.gn)).forEach((a=>b(e,t,a.id,[a.id],n,i))),n},y=e=>null==e?"":"string"==typeof e||"number"==typeof e?`${e}`:Array.isArray(e)?e.join(", "):"object"==typeof e?JSON.stringify(e):(0,s.t)("Unknown value")},456911:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>ae});var r=a(545578),n=a.n(r),i=a(751995),s=a(61988),l=a(311064),o=a(431069),d=a(593185),c=a(667294),u=a(115926),h=a.n(u),p=a(828216),g=a(440768),m=a(34858),v=a(232228),b=a(419259),f=a(25772),y=a(586074),_=a(236674),P=a(616550),E=a(473727),S=a(593139),w=a(838703),T=a(961337),I=a(414114),L=a(983673),N=a(727989),Z=a(358593),k=a(313322),x=a(301510),A=a(608272),M=a(679789),C=a(685931),R=a(860718),F=a(222545),K=a(612066),B=a(212617),$=a(355786),H=a(751794),O=a(135944);const Y=i.iK.div`
  .link {
    color: ${({theme:e})=>e.colors.grayscale.light5};
    display: block;
    text-decoration: underline;
  }
`;function D({children:e,crossLinks:t=[],moreItems:a,show:r=!1}){return(0,O.tZ)(Z.u,{placement:"top",title:r&&(0,O.BX)(Y,{children:[t.map((e=>(0,O.tZ)(E.rU,{className:"link",to:e.to,target:"_blank",rel:"noreferer noopener",children:e.title},e.to))),a&&(0,O.tZ)("span",{children:(0,s.t)("+ %s more",a)})]}),children:e})}const X=i.iK.div`
  ${({theme:e})=>`\n    & > span {\n      width: 100%;\n      display: flex;\n\n      .ant-tooltip-open {\n        display: inline;\n      }\n\n      .truncated {\n        overflow: hidden;\n        text-overflow: ellipsis;\n        white-space: nowrap;\n        display: inline-block;\n        width: 100%;\n        vertical-align: bottom;\n      }\n\n      .count {\n        cursor: pointer;\n        color: ${e.colors.grayscale.base};\n        font-weight: ${e.typography.weights.bold};\n      }\n    }\n  `}
`;function U({crossLinks:e,maxLinks:t=20,linkPrefix:a="/superset/dashboard/"}){const[r,n,i,s]=(0,H.Z)(),l=(0,c.useMemo)((()=>e.length>t?e.length-t:void 0),[e,t]),o=(0,c.useMemo)((()=>(0,O.tZ)("span",{className:"truncated",ref:r,children:e.map(((e,t)=>(0,O.tZ)(E.rU,{to:a+e.id,children:0===t?e.title:`, ${e.title}`},e.id)))})),[e,r,a]),d=(0,c.useMemo)((()=>e.slice(0,t).map((e=>({title:e.title,to:a+e.id})))),[e,a,t]);return(0,O.tZ)(X,{children:(0,O.BX)(D,{moreItems:l,crossLinks:d,show:!!i,children:[o,s&&(0,O.BX)("span",{ref:n,className:"count",children:["+",i]})]})})}const z=(0,c.memo)(U),G=(0,c.memo)((({dashboards:e})=>{const t=(0,c.useMemo)((()=>(0,$.Z)(e).map((e=>({title:e.dashboard_title,id:e.id})))),[e]);return(0,O.tZ)(z,{crossLinks:t})}));var q=a(554070),V=a(400012);const W=i.iK.div`
  align-items: center;
  display: flex;

  a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
  }

  svg {
    margin-right: ${({theme:e})=>e.gridUnit}px;
  }
`,j=(0,s.t)('The passwords for the databases below are needed in order to import them together with the charts. Please note that the "Secure Extra" and "Certificate" sections of the database configuration are not present in export files, and should be added manually after the import if they are needed.'),J=(0,s.t)("You are importing one or more charts that already exist. Overwriting might cause you to lose some of your work. Are you sure you want to overwrite?"),Q=(0,l.Z)(),ee=async(e="",t,a)=>{var r;const i=e?{filters:[{col:"table_name",opr:"sw",value:e}]}:{},s=h().encode({columns:["datasource_name","datasource_id"],keys:["none"],order_column:"table_name",order_direction:"asc",page:t,page_size:a,...i}),{json:l={}}=await o.Z.get({endpoint:`/api/v1/dataset/?q=${s}`}),d=null==l||null==(r=l.result)?void 0:r.map((({table_name:e,id:t})=>({label:e,value:t})));return{data:n()(d,"value"),totalCount:null==l?void 0:l.count}},te=i.iK.div`
  color: ${({theme:e})=>e.colors.grayscale.base};
`,ae=(0,I.ZP)((function(e){const{addDangerToast:t,addSuccessToast:a,user:{userId:r}}=e,i=(0,P.k6)(),{state:{loading:l,resourceCount:u,resourceCollection:I,bulkSelectEnabled:$},setResourceCollection:H,hasPerm:Y,fetchData:D,toggleBulkSelect:X,refreshData:U}=(0,m.Yi)("chart",(0,s.t)("chart"),t),z=(0,c.useMemo)((()=>I.map((e=>e.id))),[I]),{roles:ae}=(0,p.v9)((e=>e.user)),re=(0,B.R)("can_read","Tag",ae),[ne,ie]=(0,m.NE)("chart",z,t),{sliceCurrentlyEditing:se,handleChartUpdated:le,openChartEditModal:oe,closeChartEditModal:de}=(0,m.fF)(H,I),[ce,ue]=(0,c.useState)(!1),[he,pe]=(0,c.useState)([]),[ge,me]=(0,c.useState)(!1),[ve,be]=(0,c.useState)([]),[fe,ye]=(0,c.useState)([]),[_e,Pe]=(0,c.useState)([]),Ee=(0,T.OH)(null==r?void 0:r.toString(),null),Se=Y("can_write"),we=Y("can_write"),Te=Y("can_write"),Ie=Y("can_export"),Le=[{id:"changed_on_delta_humanized",desc:!0}],Ne=e=>{const t=e.map((({id:e})=>e));(0,v.Z)("chart",t,(()=>{me(!1)})),me(!0)},Ze=async(e="",a,r)=>{var i,l,d;const c=e?{filters:[{col:"dashboard_title",opr:S.p.StartsWith,value:e}]}:{},u=h().encode({columns:["dashboard_title","id"],keys:["none"],order_column:"dashboard_title",order_direction:"asc",page:a,page_size:r,...c}),p=await o.Z.get({endpoint:`/api/v1/dashboard/?q=${u}`}).catch((()=>t((0,s.t)("An error occurred while fetching dashboards")))),g=null==p||null==(i=p.json)||null==(l=i.result)?void 0:l.map((({dashboard_title:e,id:t})=>({label:e,value:t})));return{data:n()(g,"value"),totalCount:null==p||null==(d=p.json)?void 0:d.count}},ke=(0,c.useMemo)((()=>[{Cell:({row:{original:{id:e}}})=>r&&(0,O.tZ)(_.Z,{itemId:e,saveFaveStar:ne,isStarred:ie[e]}),Header:"",id:"id",disableSortBy:!0,size:"xs",hidden:!r},{Cell:({row:{original:{url:e,slice_name:t,certified_by:a,certification_details:r,description:n}}})=>(0,O.BX)(W,{children:[(0,O.BX)(E.rU,{to:e,children:[a&&(0,O.BX)(O.HY,{children:[(0,O.tZ)(M.Z,{certifiedBy:a,details:r})," "]}),t]}),n&&(0,O.tZ)(A.Z,{tooltip:n})]}),Header:(0,s.t)("Name"),accessor:"slice_name"},{Cell:({row:{original:{viz_type:e}}})=>{var t;return(null==(t=Q.get(e))?void 0:t.name)||e},Header:(0,s.t)("Type"),accessor:"viz_type",size:"xxl"},{Cell:({row:{original:{datasource_name_text:e,datasource_url:t}}})=>(0,O.tZ)(C.m,{to:t,children:e}),Header:(0,s.t)("Dataset"),accessor:"datasource_id",disableSortBy:!0,size:"xl"},{Cell:({row:{original:{dashboards:e}}})=>(0,O.tZ)(G,{dashboards:e}),Header:(0,s.t)("On dashboards"),accessor:"dashboards",disableSortBy:!0,size:"xxl"},{Cell:({row:{original:{tags:e=[]}}})=>(0,O.tZ)(f.P,{tags:e.filter((e=>!e.type||1===e.type||"TagTypes.custom"===e.type)),maxTags:3}),Header:(0,s.t)("Tags"),accessor:"tags",disableSortBy:!0,hidden:!(0,d.cr)(d.TT.TaggingSystem)},{Cell:({row:{original:{owners:e=[]}}})=>(0,O.tZ)(F.Z,{users:e}),Header:(0,s.t)("Owners"),accessor:"owners",disableSortBy:!0,size:"xl"},{Cell:({row:{original:{changed_on_delta_humanized:e,changed_by:t}}})=>(0,O.tZ)(q.w,{date:e,user:t}),Header:(0,s.t)("Last modified"),accessor:"last_saved_at",size:"xl"},{Cell:({row:{original:e}})=>we||Te||Ie?(0,O.BX)(te,{className:"actions",children:[Te&&(0,O.tZ)(b.Z,{title:(0,s.t)("Please confirm"),description:(0,O.BX)(O.HY,{children:[(0,s.t)("Are you sure you want to delete")," ",(0,O.tZ)("b",{children:e.slice_name}),"?"]}),onConfirm:()=>(0,g.Gm)(e,a,t,U),children:e=>(0,O.tZ)(Z.u,{id:"delete-action-tooltip",title:(0,s.t)("Delete"),placement:"bottom",children:(0,O.tZ)("span",{role:"button",tabIndex:0,className:"action-button",onClick:e,children:(0,O.tZ)(k.Z.Trash,{})})})}),Ie&&(0,O.tZ)(Z.u,{id:"export-action-tooltip",title:(0,s.t)("Export"),placement:"bottom",children:(0,O.tZ)("span",{role:"button",tabIndex:0,className:"action-button",onClick:()=>Ne([e]),children:(0,O.tZ)(k.Z.Share,{})})}),we&&(0,O.tZ)(Z.u,{id:"edit-action-tooltip",title:(0,s.t)("Edit"),placement:"bottom",children:(0,O.tZ)("span",{role:"button",tabIndex:0,className:"action-button",onClick:()=>oe(e),children:(0,O.tZ)(k.Z.EditAlt,{})})})]}):null,Header:(0,s.t)("Actions"),id:"actions",disableSortBy:!0,hidden:!we&&!Te},{accessor:V.J.ChangedBy,hidden:!0}]),[r,we,Te,Ie,ne,ie,U,a,t]),xe=(0,c.useMemo)((()=>({Header:(0,s.t)("Favorite"),key:"favorite",id:"id",urlDisplay:"favorite",input:"select",operator:S.p.ChartIsFav,unfilteredLabel:(0,s.t)("Any"),selects:[{label:(0,s.t)("Yes"),value:!0},{label:(0,s.t)("No"),value:!1}]})),[]),Ae=(0,c.useMemo)((()=>[{Header:(0,s.t)("Name"),key:"search",id:"slice_name",input:"search",operator:S.p.ChartAllText},{Header:(0,s.t)("Type"),key:"viz_type",id:"viz_type",input:"select",operator:S.p.Equals,unfilteredLabel:(0,s.t)("All"),selects:Q.keys().filter((e=>{var t;return(0,x.X3)((null==(t=Q.get(e))?void 0:t.behaviors)||[])})).map((e=>{var t;return{label:(null==(t=Q.get(e))?void 0:t.name)||e,value:e}})).sort(((e,t)=>e.label&&t.label?e.label>t.label?1:e.label<t.label?-1:0:0))},{Header:(0,s.t)("Dataset"),key:"dataset",id:"datasource_id",input:"select",operator:S.p.Equals,unfilteredLabel:(0,s.t)("All"),fetchSelects:ee,paginate:!0},...(0,d.cr)(d.TT.TaggingSystem)&&re?[{Header:(0,s.t)("Tag"),key:"tags",id:"tags",input:"select",operator:S.p.ChartTagById,unfilteredLabel:(0,s.t)("All"),fetchSelects:R.m}]:[],{Header:(0,s.t)("Owner"),key:"owner",id:"owners",input:"select",operator:S.p.RelationManyMany,unfilteredLabel:(0,s.t)("All"),fetchSelects:(0,g.tm)("chart","owners",(0,g.v$)((e=>t((0,s.t)("An error occurred while fetching chart owners values: %s",e)))),e.user),paginate:!0},{Header:(0,s.t)("Dashboard"),key:"dashboards",id:"dashboards",input:"select",operator:S.p.RelationManyMany,unfilteredLabel:(0,s.t)("All"),fetchSelects:Ze,paginate:!0},...r?[xe]:[],{Header:(0,s.t)("Certified"),key:"certified",id:"id",urlDisplay:"certified",input:"select",operator:S.p.ChartIsCertified,unfilteredLabel:(0,s.t)("Any"),selects:[{label:(0,s.t)("Yes"),value:!0},{label:(0,s.t)("No"),value:!1}]},{Header:(0,s.t)("Modified by"),key:"changed_by",id:"changed_by",input:"select",operator:S.p.RelationOneMany,unfilteredLabel:(0,s.t)("All"),fetchSelects:(0,g.tm)("chart","changed_by",(0,g.v$)((e=>(0,s.t)("An error occurred while fetching dataset datasource values: %s",e))),e.user),paginate:!0}]),[t,xe,e.user]),Me=[{desc:!1,id:"slice_name",label:(0,s.t)("Alphabetical"),value:"alphabetical"},{desc:!0,id:"changed_on_delta_humanized",label:(0,s.t)("Recently modified"),value:"recently_modified"},{desc:!1,id:"changed_on_delta_humanized",label:(0,s.t)("Least recently modified"),value:"least_recently_modified"}],Ce=(0,c.useCallback)((e=>(0,O.tZ)(K.Z,{chart:e,showThumbnails:Ee?Ee.thumbnails:(0,d.cr)(d.TT.Thumbnails),hasPerm:Y,openChartEditModal:oe,bulkSelectEnabled:$,addDangerToast:t,addSuccessToast:a,refreshData:U,userId:r,loading:l,favoriteStatus:ie[e.id],saveFavoriteStatus:ne,handleBulkChartExport:Ne})),[t,a,$,ie,Y,l]),Re=[];return(Te||Ie)&&Re.push({name:(0,s.t)("Bulk select"),buttonStyle:"secondary",onClick:X}),Se&&(Re.push({name:(0,O.BX)(O.HY,{children:[(0,O.tZ)("i",{className:"fa fa-plus"})," ",(0,s.t)("Chart")]}),buttonStyle:"primary",onClick:()=>{i.push("/chart/add")}}),Re.push({name:(0,O.tZ)(Z.u,{id:"import-tooltip",title:(0,s.t)("Import charts"),placement:"bottomRight",children:(0,O.tZ)(k.Z.Import,{})}),buttonStyle:"link",onClick:()=>{ue(!0)}})),(0,O.BX)(O.HY,{children:[(0,O.tZ)(y.Z,{name:(0,s.t)("Charts"),buttons:Re}),se&&(0,O.tZ)(L.Z,{onHide:de,onSave:le,show:!0,slice:se}),(0,O.tZ)(b.Z,{title:(0,s.t)("Please confirm"),description:(0,s.t)("Are you sure you want to delete the selected charts?"),onConfirm:function(e){o.Z.delete({endpoint:`/api/v1/chart/?q=${h().encode(e.map((({id:e})=>e)))}`}).then((({json:e={}})=>{U(),a(e.message)}),(0,g.v$)((e=>t((0,s.t)("There was an issue deleting the selected charts: %s",e)))))},children:e=>{const r=[];return Te&&r.push({key:"delete",name:(0,s.t)("Delete"),type:"danger",onSelect:e}),Ie&&r.push({key:"export",name:(0,s.t)("Export"),type:"primary",onSelect:Ne}),(0,O.tZ)(S.Z,{bulkActions:r,bulkSelectEnabled:$,cardSortSelectOptions:Me,className:"chart-list-view",columns:ke,count:u,data:I,disableBulkSelect:X,refreshData:U,fetchData:D,filters:Ae,initialSort:Le,loading:l,pageSize:25,renderCard:Ce,enableBulkTag:!0,bulkTagResourceName:"chart",addSuccessToast:a,addDangerToast:t,showThumbnails:Ee?Ee.thumbnails:(0,d.cr)(d.TT.Thumbnails),defaultViewMode:(0,d.cr)(d.TT.ListviewsDefaultCardView)?"card":"table"})}}),(0,O.tZ)(N.Z,{resourceName:"chart",resourceLabel:(0,s.t)("chart"),passwordsNeededMessage:j,confirmOverwriteMessage:J,addDangerToast:t,addSuccessToast:a,onModelImport:()=>{ue(!1),U(),a((0,s.t)("Chart imported"))},show:ce,onHide:()=>{ue(!1)},passwordFields:he,setPasswordFields:pe,sshTunnelPasswordFields:ve,setSSHTunnelPasswordFields:be,sshTunnelPrivateKeyFields:fe,setSSHTunnelPrivateKeyFields:ye,sshTunnelPrivateKeyPasswordFields:_e,setSSHTunnelPrivateKeyPasswordFields:Pe}),ge&&(0,O.tZ)(w.Z,{})]})}))},656590:(e,t)=>{"use strict";t.ITEM_TYPES={PAGE:"PAGE",ELLIPSIS:"ELLIPSIS",FIRST_PAGE_LINK:"FIRST_PAGE_LINK",PREVIOUS_PAGE_LINK:"PREVIOUS_PAGE_LINK",NEXT_PAGE_LINK:"NEXT_PAGE_LINK",LAST_PAGE_LINK:"LAST_PAGE_LINK"},t.ITEM_KEYS={FIRST_ELLIPSIS:-1,SECOND_ELLIPSIS:-2,FIRST_PAGE_LINK:-3,PREVIOUS_PAGE_LINK:-4,NEXT_PAGE_LINK:-5,LAST_PAGE_LINK:-6}},653804:(e,t,a)=>{"use strict";var r=a(656590);t.createFirstEllipsis=function(e){return{type:r.ITEM_TYPES.ELLIPSIS,key:r.ITEM_KEYS.FIRST_ELLIPSIS,value:e,isActive:!1}},t.createSecondEllipsis=function(e){return{type:r.ITEM_TYPES.ELLIPSIS,key:r.ITEM_KEYS.SECOND_ELLIPSIS,value:e,isActive:!1}},t.createFirstPageLink=function(e){var t=e.currentPage;return{type:r.ITEM_TYPES.FIRST_PAGE_LINK,key:r.ITEM_KEYS.FIRST_PAGE_LINK,value:1,isActive:1===t}},t.createPreviousPageLink=function(e){var t=e.currentPage;return{type:r.ITEM_TYPES.PREVIOUS_PAGE_LINK,key:r.ITEM_KEYS.PREVIOUS_PAGE_LINK,value:Math.max(1,t-1),isActive:1===t}},t.createNextPageLink=function(e){var t=e.currentPage,a=e.totalPages;return{type:r.ITEM_TYPES.NEXT_PAGE_LINK,key:r.ITEM_KEYS.NEXT_PAGE_LINK,value:Math.min(a,t+1),isActive:t===a}},t.createLastPageLink=function(e){var t=e.currentPage,a=e.totalPages;return{type:r.ITEM_TYPES.LAST_PAGE_LINK,key:r.ITEM_KEYS.LAST_PAGE_LINK,value:a,isActive:t===a}},t.createPageFunctionFactory=function(e){var t=e.currentPage;return function(e){return{type:r.ITEM_TYPES.PAGE,key:e,value:e,isActive:e===t}}}},1158:(e,t)=>{"use strict";t.createRange=function(e,t){for(var a=[],r=e;r<=t;r++)a.push(r);return a}},402371:(e,t,a)=>{"use strict";var r=a(1158),n=a(653804);t.getPaginationModel=function(e){if(null==e)throw new Error("getPaginationModel(): options object should be a passed");var t=Number(e.totalPages);if(isNaN(t))throw new Error("getPaginationModel(): totalPages should be a number");if(t<0)throw new Error("getPaginationModel(): totalPages shouldn't be a negative number");var a=Number(e.currentPage);if(isNaN(a))throw new Error("getPaginationModel(): currentPage should be a number");if(a<0)throw new Error("getPaginationModel(): currentPage shouldn't be a negative number");if(a>t)throw new Error("getPaginationModel(): currentPage shouldn't be greater than totalPages");var i=null==e.boundaryPagesRange?1:Number(e.boundaryPagesRange);if(isNaN(i))throw new Error("getPaginationModel(): boundaryPagesRange should be a number");if(i<0)throw new Error("getPaginationModel(): boundaryPagesRange shouldn't be a negative number");var s=null==e.siblingPagesRange?1:Number(e.siblingPagesRange);if(isNaN(s))throw new Error("getPaginationModel(): siblingPagesRange should be a number");if(s<0)throw new Error("getPaginationModel(): siblingPagesRange shouldn't be a negative number");var l=Boolean(e.hidePreviousAndNextPageLinks),o=Boolean(e.hideFirstAndLastPageLinks),d=Boolean(e.hideEllipsis),c=d?0:1,u=[],h=n.createPageFunctionFactory(e);if(o||u.push(n.createFirstPageLink(e)),l||u.push(n.createPreviousPageLink(e)),1+2*c+2*s+2*i>=t){var p=r.createRange(1,t).map(h);u.push.apply(u,p)}else{var g=i,m=r.createRange(1,g).map(h),v=t+1-i,b=t,f=r.createRange(v,b).map(h),y=Math.min(Math.max(a-s,g+c+1),v-c-2*s-1),_=y+2*s,P=r.createRange(y,_).map(h);if(u.push.apply(u,m),!d){var E=y-1,S=(E===g+1?h:n.createFirstEllipsis)(E);u.push(S)}if(u.push.apply(u,P),!d){var w=_+1,T=(w===v-1?h:n.createSecondEllipsis)(w);u.push(T)}u.push.apply(u,f)}return l||u.push(n.createNextPageLink(e)),o||u.push(n.createLastPageLink(e)),u};var i=a(656590);t.ITEM_TYPES=i.ITEM_TYPES,t.ITEM_KEYS=i.ITEM_KEYS}}]);
//# sourceMappingURL=87224c56ddacb891dbf4.chunk.js.map