"use strict";(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[9541],{1862:(e,t,a)=>{a.r(t),a.d(t,{default:()=>we});var n=a(11965),i=a(15926),o=a.n(i),s=a(67294),l=a(45697),r=a.n(l),d=a(87183),c=a(57011),h=a(29487),u=a(82607),m=a(14670),p=a.n(m),g=a(51995),b=a(61988),f=a(93185),y=a(31069),Z=a(55786),C=a(37208),_=a(68135),v=a(4715),x=a(49238),w=a(35932),T=a(71262),S=a(79789),E=a(86057),k=a(73995),D=a(37921),I=a(38703),A=a(17982),M=a(38270),K=a(98286),L=a(79069),P=a(79684),N=a(42878),q=a(665),U=a(14114),$=a(70707),z=a(9870),R=a(73126),F=a(9882);function O(e,t,a){return s.Children.map(e,(e=>{let n=e;return e&&e.type.name===t.name&&(n=s.cloneElement(e,a(e))),n&&n.props.children&&(n=s.cloneElement(n,{children:O(n.props.children,t,a)})),n}))}var B=a(58593);const j=n.iv`
  .ant-form-item-control-input-content {
    display: flex;
    flex-direction: row;
  }
`;function H({fieldKey:e,value:t,label:a,description:i=null,control:o,onChange:l=(()=>{}),compact:r=!1,inline:d}){const c=(0,s.useCallback)((t=>{l(e,t)}),[l,e]),h=s.cloneElement(o,{value:t,onChange:c});return(0,n.tZ)(x.xJ,{label:(0,n.tZ)(x.lX,{className:"m-r-5"},a||e,r&&i&&(0,n.tZ)(B.u,{id:"field-descr",placement:"right",title:i},(0,n.tZ)("i",{className:"fa fa-info-circle m-l-5"}))),css:d&&j},h,!r&&i&&(0,n.tZ)("div",{css:e=>({color:e.colors.grayscale.base,[d?"marginLeft":"marginTop"]:e.gridUnit})},i))}class W extends s.PureComponent{constructor(e){super(e),this.onChange=this.onChange.bind(this)}onChange(e,t){return this.props.onChange({...this.props.item,[e]:t})}render(){const{title:e}=this.props;return(0,n.tZ)(x.l0,{className:"CRUD",layout:"vertical"},e&&(0,n.tZ)("legend",null,e),O(this.props.children,H,(e=>({onChange:this.onChange,value:this.props.item[e.props.fieldKey],compact:this.props.compact}))))}}var G;function V(e){const t=e.map((e=>({...e,id:e.id||p().generate()}))),a={};return t.forEach((e=>{a[e.id]=e})),{collection:a,collectionArray:t}}W.defaultProps={compact:!1,title:null},function(e){e[e.Asc=1]="Asc",e[e.Desc=2]="Desc",e[e.Unsorted=0]="Unsorted"}(G||(G={}));const Q=g.iK.div`
  ${({stickyHeader:e})=>e&&"\n      height: 350px;\n      overflow-y: auto;\n      overflow-x: auto;\n\n      .table {\n        min-width: 800px;\n      }\n      thead th {\n        background: #fff;\n        position: sticky;\n        top: 0;\n        z-index: 9;\n        min\n      }\n    "}
  ${({theme:e})=>`\n    th span {\n      vertical-align: ${-2*e.gridUnit}px;\n    }\n    .text-right {\n      text-align: right;\n    }\n    .empty-collection {\n      padding: ${2*e.gridUnit+2}px;\n    }\n    .tiny-cell {\n      width: ${e.gridUnit+1}px;\n    }\n    i.fa-caret-down,\n    i.fa-caret-up {\n      width: ${e.gridUnit+1}px;\n    }\n    td.expanded {\n      border-top: 0;\n      padding: 0;\n    }\n  `}
`,J=g.iK.div`
  text-align: right;
  ${({theme:e})=>`margin-bottom: ${2*e.gridUnit}px`}
`,X=g.iK.span`
  ${({theme:e})=>`\n    margin-top: ${3*e.gridUnit}px;\n    margin-left: ${3*e.gridUnit}px;\n  `}
`;class Y extends s.PureComponent{constructor(e){super(e);const{collection:t,collectionArray:a}=V(e.collection);this.state={expandedColumns:{},collection:t,collectionArray:a,sortColumn:"",sort:0},this.renderItem=this.renderItem.bind(this),this.onAddItem=this.onAddItem.bind(this),this.renderExpandableSection=this.renderExpandableSection.bind(this),this.getLabel=this.getLabel.bind(this),this.onFieldsetChange=this.onFieldsetChange.bind(this),this.renderTableBody=this.renderTableBody.bind(this),this.changeCollection=this.changeCollection.bind(this),this.sortColumn=this.sortColumn.bind(this),this.renderSortIcon=this.renderSortIcon.bind(this)}UNSAFE_componentWillReceiveProps(e){if(e.collection!==this.props.collection){const{collection:t,collectionArray:a}=V(e.collection);this.setState({collection:t,collectionArray:a})}}onCellChange(e,t,a){this.changeCollection({...this.state.collection,[e]:{...this.state.collection[e],[t]:a}})}onAddItem(){if(this.props.itemGenerator){let e=this.props.itemGenerator();e.id||(e={...e,id:p().generate()}),this.changeCollection(this.state.collection,e)}}onFieldsetChange(e){this.changeCollection({...this.state.collection,[e.id]:e})}getLabel(e){const{columnLabels:t}=this.props;let a=null!=t&&t[e]?t[e]:e;return a.startsWith("__")&&(a=""),a}getTooltip(e){const{columnLabelTooltips:t}=this.props;return null==t?void 0:t[e]}changeCollection(e,t){if(this.setState({collection:e}),this.props.onChange){const a=this.state.collectionArray.map((t=>e[t.id])).filter((e=>void 0!==e));t&&a.unshift(t),this.props.onChange(a)}}deleteItem(e){const t={...this.state.collection};delete t[e],this.changeCollection(t)}effectiveTableColumns(){const{tableColumns:e,allowDeletes:t,expandFieldset:a}=this.props,n=t?e.concat(["__actions"]):e;return a?["__expand"].concat(n):n}toggleExpand(e){this.onCellChange(e,"__expanded",!1),this.setState((t=>({expandedColumns:{...t.expandedColumns,[e]:!t.expandedColumns[e]}})))}sortColumn(e,t=G.Unsorted){const{sortColumns:a}=this.props;return()=>{if(null!=a&&a.includes(e)){if(t===G.Unsorted){const{collection:e}=V(this.props.collection),a=function(e){return Object.keys(e).map((t=>e[t]))}(e);return void this.setState({collectionArray:a,sortColumn:"",sort:t})}const a=[...this.state.collectionArray].sort(((t,a)=>{return n=t[e],i=a[e],"string"==typeof n?(n||" ").localeCompare(i):n-i;var n,i})),n=t===G.Asc?a:a.reverse();this.setState((a=>({...a,collectionArray:n,sortColumn:e,sort:t})))}}}renderSortIcon(e){return this.state.sortColumn===e&&this.state.sort===G.Asc?(0,n.tZ)($.Z.SortAsc,{onClick:this.sortColumn(e,2)}):this.state.sortColumn===e&&this.state.sort===G.Desc?(0,n.tZ)($.Z.SortDesc,{onClick:this.sortColumn(e,0)}):(0,n.tZ)($.Z.Sort,{onClick:this.sortColumn(e,1)})}renderTH(e,t){const a=this.getTooltip(e);return(0,n.tZ)("th",{key:e,className:"no-wrap"},this.getLabel(e),a&&(0,n.tZ)(s.Fragment,null," ",(0,n.tZ)(F.V,{label:(0,b.t)("description"),tooltip:a})),(null==t?void 0:t.includes(e))&&this.renderSortIcon(e))}renderHeaderRow(){const e=this.effectiveTableColumns(),{allowDeletes:t,expandFieldset:a,extraButtons:i,sortColumns:o}=this.props;return(0,n.tZ)("thead",null,(0,n.tZ)("tr",null,a&&(0,n.tZ)("th",{"aria-label":"Expand",className:"tiny-cell"}),e.map((e=>this.renderTH(e,o))),i,t&&(0,n.tZ)("th",{key:"delete-item","aria-label":"Delete",className:"tiny-cell"})))}renderExpandableSection(e){return O(this.props.expandFieldset,W,(()=>({item:e,onChange:this.onFieldsetChange})))}getCellProps(e,t){var a;const n=null==(a=this.props.itemCellProps)?void 0:a[t],i=e[t];return n?n(i,this.getLabel(t),e):{}}renderCell(e,t){var a;const n=null==(a=this.props.itemRenderers)?void 0:a[t],i=e[t],o=this.onCellChange.bind(this,e.id,t);return n?n(i,o,this.getLabel(t),e):i}renderItem(e){const{allowAddItem:t,allowDeletes:a,expandFieldset:i,tableColumns:o}=this.props,s=!!this.state.expandedColumns[e.id]||e.__expanded;let l=[];i&&l.push((0,n.tZ)("td",{key:"__expand",className:"expand"},(0,n.tZ)("i",{role:"button","aria-label":"Toggle expand",tabIndex:0,className:`fa fa-caret-${s?"down":"right"} text-primary pointer`,onClick:this.toggleExpand.bind(this,e.id)}))),l=l.concat(o.map((t=>(0,n.tZ)("td",(0,R.Z)({},this.getCellProps(e,t),{key:t}),this.renderCell(e,t))))),t&&l.push((0,n.tZ)("td",{key:"add"})),a&&l.push((0,n.tZ)("td",{key:"__actions",className:"text-primary"},(0,n.tZ)($.Z.Trash,{"aria-label":"Delete item",className:"pointer",role:"button",tabIndex:0,onClick:this.deleteItem.bind(this,e.id)})));const r=[(0,n.tZ)("tr",{"data-test":"table-row",className:"row",key:e.id},l)];return s&&r.push((0,n.tZ)("tr",{className:"exp",key:`exp__${e.id}`},(0,n.tZ)("td",{colSpan:this.effectiveTableColumns().length,className:"expanded"},(0,n.tZ)("div",null,this.renderExpandableSection(e))))),r}renderEmptyCell(){return(0,n.tZ)("tr",null,(0,n.tZ)("td",{className:"empty-collection"},this.props.emptyMessage))}renderTableBody(){const e=this.state.collectionArray,t=e.length?e.map((e=>this.renderItem(e))):this.renderEmptyCell();return(0,n.tZ)("tbody",null,t)}render(){return(0,n.tZ)(s.Fragment,null,(0,n.tZ)(J,null,this.props.allowAddItem&&(0,n.tZ)(X,null,(0,n.tZ)(w.Z,{buttonSize:"small",buttonStyle:"tertiary",onClick:this.onAddItem},(0,n.tZ)("i",{className:"fa fa-plus"})," ",(0,b.t)("Add item")))),(0,n.tZ)(Q,{className:"CRUD",stickyHeader:this.props.stickyHeader},(0,n.tZ)("table",{className:"table"},this.renderHeaderRow(),this.renderTableBody())))}}const ee=g.iK.div`
  .change-warning {
    margin: 16px 10px 0;
    color: ${({theme:e})=>e.colors.warning.base};
  }

  .change-warning .bold {
    font-weight: ${({theme:e})=>e.typography.weights.bold};
  }

  .form-group.has-feedback > .help-block {
    margin-top: 8px;
  }

  .form-group.form-group-md {
    margin-bottom: 8px;
  }
`,te=g.iK.div`
  align-items: center;
  display: flex;

  svg {
    margin-right: ${({theme:e})=>e.gridUnit}px;
  }
`,ae=(0,g.iK)(T.ZP)`
  overflow: visible;
  .ant-tabs-content-holder {
    overflow: visible;
  }
`,ne=(0,g.iK)(u.Z)`
  .ant-badge-count {
    line-height: ${({theme:e})=>4*e.gridUnit}px;
    height: ${({theme:e})=>4*e.gridUnit}px;
    margin-left: ${({theme:e})=>e.gridUnit}px;
  }
`,ie=g.iK.div`
  font-size: ${({theme:e})=>e.typography.sizes.s}px;
  display: flex;
  align-items: center;
  a {
    padding: 0 10px;
  }
`,oe=g.iK.div`
  text-align: right;
  ${({theme:e})=>`margin-bottom: ${2*e.gridUnit}px`}
`,se=g.iK.div`
  display: flex;
  align-items: center;
  span {
    margin-right: ${({theme:e})=>e.gridUnit}px;
  }
`,le=g.iK.div`
  .table > tbody > tr > td {
    vertical-align: middle;
  }

  .ant-tag {
    margin-top: ${({theme:e})=>e.gridUnit}px;
  }
`,re=g.iK.span`
  ${({theme:e})=>`\n    margin-top: ${3*e.gridUnit}px;\n    margin-left: ${3*e.gridUnit}px;\n  `}
`,de=(e,t)=>(0,n.tZ)(L.Z,{value:e,onChange:t}),ce=[{value:"STRING",label:(0,b.t)("STRING")},{value:"NUMERIC",label:(0,b.t)("NUMERIC")},{value:"DATETIME",label:(0,b.t)("DATETIME")},{value:"BOOLEAN",label:(0,b.t)("BOOLEAN")}],he=[{key:"physical",label:(0,b.t)("Physical (table or view)")},{key:"virtual",label:(0,b.t)("Virtual (SQL)")}],ue={};he.forEach((e=>{ue[e.key]=e}));var me={name:"s5xdrg",styles:"display:flex;align-items:center"};function pe({title:e,collection:t}){return(0,n.tZ)("div",{css:me},e," ",(0,n.tZ)(ne,{count:t?t.length:0,showZero:!0}))}function ge({columns:e,datasource:t,onColumnsChange:a,onDatasourceChange:i,editableColumnName:o,showExpression:l,allowAddItem:r,allowEditDataType:c,itemGenerator:h,columnLabelTooltips:u}){return(0,n.tZ)(Y,{tableColumns:(0,f.cr)(f.TT.EnableAdvancedDataTypes)?["column_name","advanced_data_type","type","is_dttm","main_dttm_col","filterable","groupby"]:["column_name","type","is_dttm","main_dttm_col","filterable","groupby"],sortColumns:(0,f.cr)(f.TT.EnableAdvancedDataTypes)?["column_name","advanced_data_type","type","is_dttm","main_dttm_col","filterable","groupby"]:["column_name","type","is_dttm","main_dttm_col","filterable","groupby"],allowDeletes:!0,allowAddItem:r,itemGenerator:h,collection:e,columnLabelTooltips:u,stickyHeader:!0,expandFieldset:(0,n.tZ)(fe,null,(0,n.tZ)(W,{compact:!0},l&&(0,n.tZ)(H,{fieldKey:"expression",label:(0,b.t)("SQL expression"),control:(0,n.tZ)(N.Z,{language:"markdown",offerEditInModal:!1,resize:"vertical"})}),(0,n.tZ)(H,{fieldKey:"verbose_name",label:(0,b.t)("Label"),control:(0,n.tZ)(P.Z,{controlId:"verbose_name",placeholder:(0,b.t)("Label")})}),(0,n.tZ)(H,{fieldKey:"description",label:(0,b.t)("Description"),control:(0,n.tZ)(P.Z,{controlId:"description",placeholder:(0,b.t)("Description")})}),c&&(0,n.tZ)(H,{fieldKey:"type",label:(0,b.t)("Data type"),control:(0,n.tZ)(v.Ph,{ariaLabel:(0,b.t)("Data type"),options:ce,name:"type",allowNewOptions:!0,allowClear:!0})}),(0,f.cr)(f.TT.EnableAdvancedDataTypes)?(0,n.tZ)(H,{fieldKey:"advanced_data_type",label:(0,b.t)("Advanced data type"),control:(0,n.tZ)(P.Z,{controlId:"advanced_data_type",placeholder:(0,b.t)("Advanced Data type")})}):(0,n.tZ)(s.Fragment,null),(0,n.tZ)(H,{fieldKey:"python_date_format",label:(0,b.t)("Datetime format"),description:(0,n.tZ)("div",null,(0,b.t)("The pattern of timestamp format. For strings use "),(0,n.tZ)("a",{href:"https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior"},(0,b.t)("Python datetime string pattern")),(0,b.t)(" expression which needs to adhere to the "),(0,n.tZ)("a",{href:"https://en.wikipedia.org/wiki/ISO_8601"},(0,b.t)("ISO 8601")),(0,b.t)(" standard to ensure that the lexicographical ordering\n                      coincides with the chronological ordering. If the\n                      timestamp format does not adhere to the ISO 8601 standard\n                      you will need to define an expression and type for\n                      transforming the string into a date or timestamp. Note\n                      currently time zones are not supported. If time is stored\n                      in epoch format, put `epoch_s` or `epoch_ms`. If no pattern\n                      is specified we fall back to using the optional defaults on a per\n                      database/column name level via the extra parameter.")),control:(0,n.tZ)(P.Z,{controlId:"python_date_format",placeholder:"%Y-%m-%d"})}),(0,n.tZ)(H,{fieldKey:"certified_by",label:(0,b.t)("Certified By"),description:(0,b.t)("Person or group that has certified this metric"),control:(0,n.tZ)(P.Z,{controlId:"certified",placeholder:(0,b.t)("Certified by")})}),(0,n.tZ)(H,{fieldKey:"certification_details",label:(0,b.t)("Certification details"),description:(0,b.t)("Details of the certification"),control:(0,n.tZ)(P.Z,{controlId:"certificationDetails",placeholder:(0,b.t)("Certification details")})}))),columnLabels:(0,f.cr)(f.TT.EnableAdvancedDataTypes)?{column_name:(0,b.t)("Column"),advanced_data_type:(0,b.t)("Advanced data type"),type:(0,b.t)("Data type"),groupby:(0,b.t)("Is dimension"),is_dttm:(0,b.t)("Is temporal"),main_dttm_col:(0,b.t)("Default datetime"),filterable:(0,b.t)("Is filterable")}:{column_name:(0,b.t)("Column"),type:(0,b.t)("Data type"),groupby:(0,b.t)("Is dimension"),is_dttm:(0,b.t)("Is temporal"),main_dttm_col:(0,b.t)("Default datetime"),filterable:(0,b.t)("Is filterable")},onChange:a,itemRenderers:(0,f.cr)(f.TT.EnableAdvancedDataTypes)?{column_name:(e,t,a,i)=>o?(0,n.tZ)(se,null,i.is_certified&&(0,n.tZ)(S.Z,{certifiedBy:i.certified_by,details:i.certification_details}),(0,n.tZ)(M.Z,{canEdit:!0,title:e,onSaveTitle:t})):(0,n.tZ)(se,null,i.is_certified&&(0,n.tZ)(S.Z,{certifiedBy:i.certified_by,details:i.certification_details}),e),main_dttm_col:(a,o,s,l)=>{const r=t.main_dttm_col===l.column_name,c=!e.find((e=>e.column_name===l.column_name)).is_dttm;return(0,n.tZ)(d.Y,{checked:r,disabled:c,onChange:()=>i({...t,main_dttm_col:l.column_name})})},type:e=>e?(0,n.tZ)(D.Z,null,e):null,advanced_data_type:e=>(0,n.tZ)(D.Z,{onChange:a},e),is_dttm:de,filterable:de,groupby:de}:{column_name:(e,t,a,i)=>o?(0,n.tZ)(se,null,i.is_certified&&(0,n.tZ)(S.Z,{certifiedBy:i.certified_by,details:i.certification_details}),(0,n.tZ)(P.Z,{value:e,onChange:t})):(0,n.tZ)(se,null,i.is_certified&&(0,n.tZ)(S.Z,{certifiedBy:i.certified_by,details:i.certification_details}),e),main_dttm_col:(a,o,s,l)=>{const r=t.main_dttm_col===l.column_name,c=!e.find((e=>e.column_name===l.column_name)).is_dttm;return(0,n.tZ)(d.Y,{checked:r,disabled:c,onChange:()=>i({...t,main_dttm_col:l.column_name})})},type:e=>e?(0,n.tZ)(D.Z,null,e):null,is_dttm:de,filterable:de,groupby:de}})}function be({label:e,formElement:t}){return(0,n.tZ)("div",null,(0,n.tZ)("div",null,(0,n.tZ)("strong",null,e)),(0,n.tZ)("div",null,t))}function fe({children:e}){return(0,n.tZ)(c.Z,{padded:!0},e)}pe.propTypes={title:r().string,collection:r().array},ge.propTypes={columns:r().array.isRequired,datasource:r().object.isRequired,onColumnsChange:r().func.isRequired,onDatasourceChange:r().func.isRequired,editableColumnName:r().bool,showExpression:r().bool,allowAddItem:r().bool,allowEditDataType:r().bool,itemGenerator:r().func},ge.defaultProps={editableColumnName:!1,showExpression:!1,allowAddItem:!1,allowEditDataType:!1,itemGenerator:()=>({column_name:(0,b.t)("<new column>"),filterable:!0,groupby:!0})},be.propTypes={label:r().string,formElement:r().node},fe.propTypes={children:r().node};const ye={datasource:r().object.isRequired,onChange:r().func,addSuccessToast:r().func.isRequired,addDangerToast:r().func.isRequired,setIsEditing:r().func};function Ze({datasource:e,onChange:t}){const a=(0,s.useCallback)(((e="",t,a)=>{const n=o().encode({filter:e,page:t,page_size:a});return y.Z.get({endpoint:`/api/v1/dataset/related/owners?q=${n}`}).then((e=>({data:e.json.result.filter((e=>e.extra.active)).map((e=>({value:e.value,label:e.text}))),totalCount:e.json.count})))}),[]);return(0,n.tZ)(v.qb,{ariaLabel:(0,b.t)("Select owners"),mode:"multiple",name:"owners",value:e.owners,options:a,onChange:t,header:(0,n.tZ)(x.lX,null,(0,b.t)("Owners")),allowClear:!0})}var Ce={name:"hkh81z",styles:"margin-top:8px"},_e={name:"hkh81z",styles:"margin-top:8px"};class ve extends s.PureComponent{constructor(e){var t;super(e),this.state={datasource:{...e.datasource,owners:e.datasource.owners.map((e=>({value:e.value||e.id,label:e.label||`${e.first_name} ${e.last_name}`}))),metrics:null==(t=e.datasource.metrics)?void 0:t.map((e=>{const{certified_by:t,certification_details:a}=e,{certification:{details:n,certified_by:i}={},warning_markdown:o}=JSON.parse(e.extra||"{}")||{};return{...e,certification_details:a||n,warning_markdown:o||"",certified_by:i||t}}))},errors:[],isSqla:"table"===e.datasource.datasource_type||"table"===e.datasource.type,isEditMode:!1,databaseColumns:e.datasource.columns.filter((e=>!e.expression)),calculatedColumns:e.datasource.columns.filter((e=>!!e.expression)),metadataLoading:!1,activeTabKey:0,datasourceType:e.datasource.sql?ue.virtual.key:ue.physical.key},this.onChange=this.onChange.bind(this),this.onChangeEditMode=this.onChangeEditMode.bind(this),this.onDatasourcePropChange=this.onDatasourcePropChange.bind(this),this.onDatasourceChange=this.onDatasourceChange.bind(this),this.tableChangeAndSyncMetadata=this.tableChangeAndSyncMetadata.bind(this),this.syncMetadata=this.syncMetadata.bind(this),this.setColumns=this.setColumns.bind(this),this.validateAndChange=this.validateAndChange.bind(this),this.handleTabSelect=this.handleTabSelect.bind(this),this.currencies=(0,Z.Z)(e.currencies).map((e=>({value:e,label:`${(0,C.j)({symbol:e})} (${e})`})))}onChange(){const{datasourceType:e,datasource:t}=this.state,a=e===ue.physical.key?"":t.sql,n={...this.state.datasource,sql:a,columns:[...this.state.databaseColumns,...this.state.calculatedColumns]};this.props.onChange(n,this.state.errors)}onChangeEditMode(){this.props.setIsEditing(!this.state.isEditMode),this.setState((e=>({isEditMode:!e.isEditMode})))}onDatasourceChange(e,t=this.validateAndChange){this.setState({datasource:e},t)}onDatasourcePropChange(e,t){if(void 0===t)return;const a={...this.state.datasource,[e]:t};this.setState((a=>({datasource:{...a.datasource,[e]:t}})),"table_name"===e?this.onDatasourceChange(a,this.tableChangeAndSyncMetadata):this.onDatasourceChange(a,this.validateAndChange))}onDatasourceTypeChange(e){this.setState({datasourceType:e})}setColumns(e){this.setState(e,this.validateAndChange)}validateAndChange(){this.validate(this.onChange)}tableChangeAndSyncMetadata(){this.validate((()=>{this.syncMetadata(),this.onChange()}))}updateColumns(e){const{databaseColumns:t}=this.state,a=e.map((e=>e.column_name)),n=t.reduce(((e,t)=>({...e,[t.column_name]:t})),{}),i=[],o={added:[],modified:[],removed:t.map((e=>e.column_name)).filter((e=>!a.includes(e)))};return e.forEach((e=>{const t=n[e.column_name];t?t.type!==e.type||!t.is_dttm&&e.is_dttm?(i.push({...t,type:e.type,is_dttm:t.is_dttm||e.is_dttm}),o.modified.push(e.column_name)):i.push(t):(i.push({id:p().generate(),column_name:e.column_name,type:e.type,groupby:!0,filterable:!0,is_dttm:e.is_dttm}),o.added.push(e.column_name))})),(o.added.length||o.modified.length||o.removed.length)&&this.setColumns({databaseColumns:i}),o}syncMetadata(){const{datasource:e}=this.state,t={datasource_type:e.type||e.datasource_type,database_name:e.database.database_name||e.database.name,schema_name:e.schema,table_name:e.table_name,normalize_columns:e.normalize_columns,always_filter_main_dttm:e.always_filter_main_dttm};Object.entries(t).forEach((([e,a])=>{void 0===a&&(t[e]=null)}));const a=`/datasource/external_metadata_by_name/?q=${o().encode_uri(t)}`;this.setState({metadataLoading:!0}),y.Z.get({endpoint:a}).then((({json:e})=>{const t=this.updateColumns(e);t.modified.length&&this.props.addSuccessToast((0,b.t)("Modified columns: %s",t.modified.join(", "))),t.removed.length&&this.props.addSuccessToast((0,b.t)("Removed columns: %s",t.removed.join(", "))),t.added.length&&this.props.addSuccessToast((0,b.t)("New columns added: %s",t.added.join(", "))),this.props.addSuccessToast((0,b.t)("Metadata has been synced")),this.setState({metadataLoading:!1})})).catch((e=>(0,K.O$)(e).then((({error:e,statusText:t})=>{this.props.addDangerToast(e||t||(0,b.t)("An error has occurred")),this.setState({metadataLoading:!1})}))))}findDuplicates(e,t){const a={},n=[];return e.forEach((e=>{const i=t(e);i in a?n.push(i):a[i]=null})),n}validate(e){let t,a=[];const{datasource:n}=this.state;t=this.findDuplicates(n.columns,(e=>e.column_name)),a=a.concat(t.map((e=>(0,b.t)("Column name [%s] is duplicated",e)))),t=this.findDuplicates(n.metrics,(e=>e.metric_name)),a=a.concat(t.map((e=>(0,b.t)("Metric name [%s] is duplicated",e))));const i=this.state.calculatedColumns.filter((e=>!e.expression&&!e.json));a=a.concat(i.map((e=>(0,b.t)("Calculated column [%s] requires an expression",e.column_name))));try{var o;null==(o=this.state.datasource.metrics)||o.forEach((e=>{var t;return(null==(t=e.currency)?void 0:t.symbol)&&new Intl.NumberFormat("en-US",{style:"currency",currency:e.currency.symbol})}))}catch{a=a.concat([(0,b.t)("Invalid currency code in saved metrics")])}this.setState({errors:a},e)}handleTabSelect(e){this.setState({activeTabKey:e})}sortMetrics(e){return e.sort((({id:e},{id:t})=>t-e))}renderSettingsFieldset(){const{datasource:e}=this.state;return(0,n.tZ)(W,{title:(0,b.t)("Basic"),item:e,onChange:this.onDatasourceChange},(0,n.tZ)(H,{fieldKey:"description",label:(0,b.t)("Description"),control:(0,n.tZ)(N.Z,{language:"markdown",offerEditInModal:!1,resize:"vertical"})}),(0,n.tZ)(H,{fieldKey:"default_endpoint",label:(0,b.t)("Default URL"),description:(0,b.t)("Default URL to redirect to when accessing from the dataset list page"),control:(0,n.tZ)(P.Z,{controlId:"default_endpoint"})}),(0,n.tZ)(H,{inline:!0,fieldKey:"filter_select_enabled",label:(0,b.t)("Autocomplete filters"),description:(0,b.t)("Whether to populate autocomplete filters options"),control:(0,n.tZ)(L.Z,null)}),this.state.isSqla&&(0,n.tZ)(H,{fieldKey:"fetch_values_predicate",label:(0,b.t)("Autocomplete query predicate"),description:(0,b.t)('When using "Autocomplete filters", this can be used to improve performance of the query fetching the values. Use this option to apply a predicate (WHERE clause) to the query selecting the distinct values from the table. Typically the intent would be to limit the scan by applying a relative time filter on a partitioned or indexed time-related field.'),control:(0,n.tZ)(N.Z,{language:"sql",controlId:"fetch_values_predicate",minLines:5,resize:"vertical"})}),this.state.isSqla&&(0,n.tZ)(H,{fieldKey:"extra",label:(0,b.t)("Extra"),description:(0,b.t)('Extra data to specify table metadata. Currently supports metadata of the format: `{ "certification": { "certified_by": "Data Platform Team", "details": "This table is the source of truth." }, "warning_markdown": "This is a warning." }`.'),control:(0,n.tZ)(N.Z,{controlId:"extra",language:"json",offerEditInModal:!1,resize:"vertical"})}),(0,n.tZ)(Ze,{datasource:e,onChange:t=>{this.onDatasourceChange({...e,owners:t})}}))}renderAdvancedFieldset(){const{datasource:e}=this.state;return(0,n.tZ)(W,{title:(0,b.t)("Advanced"),item:e,onChange:this.onDatasourceChange},(0,n.tZ)(H,{fieldKey:"cache_timeout",label:(0,b.t)("Cache timeout"),description:(0,b.t)("The duration of time in seconds before the cache is invalidated. Set to -1 to bypass the cache."),control:(0,n.tZ)(P.Z,{controlId:"cache_timeout"})}),(0,n.tZ)(H,{fieldKey:"offset",label:(0,b.t)("Hours offset"),control:(0,n.tZ)(P.Z,{controlId:"offset"}),description:(0,b.t)("The number of hours, negative or positive, to shift the time column. This can be used to move UTC time to local time.")}),this.state.isSqla&&(0,n.tZ)(H,{fieldKey:"template_params",label:(0,b.t)("Template parameters"),description:(0,b.t)("A set of parameters that become available in the query using Jinja templating syntax"),control:(0,n.tZ)(P.Z,{controlId:"template_params"})}),(0,n.tZ)(H,{inline:!0,fieldKey:"normalize_columns",label:(0,b.t)("Normalize column names"),description:(0,b.t)("Allow column names to be changed to case insensitive format, if supported (e.g. Oracle, Snowflake)."),control:(0,n.tZ)(L.Z,{controlId:"normalize_columns"})}),(0,n.tZ)(H,{inline:!0,fieldKey:"always_filter_main_dttm",label:(0,b.t)("Always filter main datetime column"),description:(0,b.t)("When the secondary temporal columns are filtered, apply the same filter to the main datetime column."),control:(0,n.tZ)(L.Z,{controlId:"always_filter_main_dttm"})}))}renderSpatialTab(){const{datasource:e}=this.state,{spatials:t,all_cols:a}=e;return(0,n.tZ)(T.ZP.TabPane,{tab:(0,n.tZ)(pe,{collection:t,title:(0,b.t)("Spatial")}),key:4},(0,n.tZ)(Y,{tableColumns:["name","config"],onChange:this.onDatasourcePropChange.bind(this,"spatials"),itemGenerator:()=>({name:(0,b.t)("<new spatial>"),type:(0,b.t)("<no type>"),config:null}),collection:t,allowDeletes:!0,itemRenderers:{name:(e,t)=>(0,n.tZ)(M.Z,{canEdit:!0,title:e,onSaveTitle:t}),config:(e,t)=>(0,n.tZ)(q.Z,{value:e,onChange:t,choices:a})}}))}renderSourceFieldset(e){var t,a,i;const{datasource:o}=this.state;return(0,n.tZ)("div",null,(0,n.tZ)(ie,null,(0,n.tZ)("span",{role:"button",tabIndex:0,onClick:this.onChangeEditMode},this.state.isEditMode?(0,n.tZ)($.Z.LockUnlocked,{iconColor:e.colors.grayscale.base}):(0,n.tZ)($.Z.LockLocked,{iconColor:e.colors.grayscale.base})),!this.state.isEditMode&&(0,n.tZ)("div",null,(0,b.t)("Click the lock to make changes.")),this.state.isEditMode&&(0,n.tZ)("div",null,(0,b.t)("Click the lock to prevent further changes."))),(0,n.tZ)("div",{className:"m-l-10 m-t-20 m-b-10"},he.map((e=>(0,n.tZ)(d.Y,{key:e.key,value:e.key,inline:!0,onChange:this.onDatasourceTypeChange.bind(this,e.key),checked:this.state.datasourceType===e.key,disabled:!this.state.isEditMode},e.label)))),(0,n.tZ)("hr",null),(0,n.tZ)(W,{item:o,onChange:this.onDatasourceChange,compact:!0},this.state.datasourceType===ue.virtual.key&&(0,n.tZ)("div",null,this.state.isSqla&&(0,n.tZ)(s.Fragment,null,(0,n.tZ)(v.JX,{xs:24,md:12},(0,n.tZ)(H,{fieldKey:"databaseSelector",label:(0,b.t)("virtual"),control:(0,n.tZ)("div",{css:Ce},(0,n.tZ)(k.Z,{db:null==o?void 0:o.database,schema:o.schema,onSchemaChange:e=>this.state.isEditMode&&this.onDatasourcePropChange("schema",e),onDbChange:e=>this.state.isEditMode&&this.onDatasourcePropChange("database",e),formMode:!1,handleError:this.props.addDangerToast,readOnly:!this.state.isEditMode}))}),(0,n.tZ)("div",{css:(0,n.iv)({width:"calc(100% - 34px)",marginTop:-16},"","")},(0,n.tZ)(H,{fieldKey:"table_name",label:(0,b.t)("Name"),control:(0,n.tZ)(P.Z,{controlId:"table_name",onChange:e=>{this.onDatasourcePropChange("table_name",e)},placeholder:(0,b.t)("Dataset name"),disabled:!this.state.isEditMode})}))),(0,n.tZ)(H,{fieldKey:"sql",label:(0,b.t)("SQL"),description:(0,b.t)("When specifying SQL, the datasource acts as a view. Superset will use this statement as a subquery while grouping and filtering on the generated parent queries."),control:(0,n.tZ)(N.Z,{language:"sql",offerEditInModal:!1,minLines:20,maxLines:1/0,readOnly:!this.state.isEditMode,resize:"both"})}))),this.state.datasourceType===ue.physical.key&&(0,n.tZ)(v.JX,{xs:24,md:12},this.state.isSqla&&(0,n.tZ)(H,{fieldKey:"tableSelector",label:(0,b.t)("Physical"),control:(0,n.tZ)("div",{css:_e},(0,n.tZ)(A.ZP,{clearable:!1,database:{...o.database,database_name:(null==(t=o.database)?void 0:t.database_name)||(null==(a=o.database)?void 0:a.name)},dbId:null==(i=o.database)?void 0:i.id,handleError:this.props.addDangerToast,schema:o.schema,sqlLabMode:!1,tableValue:o.table_name,onSchemaChange:this.state.isEditMode?e=>this.onDatasourcePropChange("schema",e):void 0,onDbChange:this.state.isEditMode?e=>this.onDatasourcePropChange("database",e):void 0,onTableSelectChange:this.state.isEditMode?e=>this.onDatasourcePropChange("table_name",e):void 0,readOnly:!this.state.isEditMode})),description:(0,b.t)("The pointer to a physical table (or view). Keep in mind that the chart is associated to this Superset logical table, and this logical table points the physical table referenced here.")}))))}renderErrors(){return this.state.errors.length>0?(0,n.tZ)(h.Z,{css:e=>({marginBottom:4*e.gridUnit}),type:"error",message:(0,n.tZ)(s.Fragment,null,this.state.errors.map((e=>(0,n.tZ)("div",{key:e},e))))}):null}renderMetricCollection(){const{datasource:e}=this.state,{metrics:t}=e,a=null!=t&&t.length?this.sortMetrics(t):[];return(0,n.tZ)(Y,{tableColumns:["metric_name","verbose_name","expression"],sortColumns:["metric_name","verbose_name","expression"],columnLabels:{metric_name:(0,b.t)("Metric Key"),verbose_name:(0,b.t)("Label"),expression:(0,b.t)("SQL expression")},columnLabelTooltips:{metric_name:(0,b.t)("This field is used as a unique identifier to attach the metric to charts. It is also used as the alias in the SQL query.")},expandFieldset:(0,n.tZ)(fe,null,(0,n.tZ)(W,{compact:!0},(0,n.tZ)(H,{fieldKey:"description",label:(0,b.t)("Description"),control:(0,n.tZ)(P.Z,{controlId:"description",placeholder:(0,b.t)("Description")})}),(0,n.tZ)(H,{fieldKey:"d3format",label:(0,b.t)("D3 format"),control:(0,n.tZ)(P.Z,{controlId:"d3format",placeholder:"%y/%m/%d"})}),(0,n.tZ)(H,{fieldKey:"currency",label:(0,b.t)("Metric currency"),control:(0,n.tZ)(z.Z,{currencySelectOverrideProps:{placeholder:(0,b.t)("Select or type currency symbol")},symbolSelectAdditionalStyles:n.iv`
                      max-width: 30%;
                    `})}),(0,n.tZ)(H,{label:(0,b.t)("Certified by"),fieldKey:"certified_by",description:(0,b.t)("Person or group that has certified this metric"),control:(0,n.tZ)(P.Z,{controlId:"certified_by",placeholder:(0,b.t)("Certified by")})}),(0,n.tZ)(H,{label:(0,b.t)("Certification details"),fieldKey:"certification_details",description:(0,b.t)("Details of the certification"),control:(0,n.tZ)(P.Z,{controlId:"certification_details",placeholder:(0,b.t)("Certification details")})}),(0,n.tZ)(H,{label:(0,b.t)("Warning"),fieldKey:"warning_markdown",description:(0,b.t)("Optional warning about use of this metric"),control:(0,n.tZ)(N.Z,{controlId:"warning_markdown",language:"markdown",offerEditInModal:!1,resize:"vertical"})}))),collection:a,allowAddItem:!0,onChange:this.onDatasourcePropChange.bind(this,"metrics"),itemGenerator:()=>({metric_name:(0,b.t)("<new metric>"),verbose_name:"",expression:""}),itemCellProps:{expression:()=>({width:"240px"})},itemRenderers:{metric_name:(e,t,a,i)=>(0,n.tZ)(te,null,i.is_certified&&(0,n.tZ)(S.Z,{certifiedBy:i.certified_by,details:i.certification_details}),i.warning_markdown&&(0,n.tZ)(E.Z,{warningMarkdown:i.warning_markdown}),(0,n.tZ)(M.Z,{canEdit:!0,title:e,onSaveTitle:t})),verbose_name:(e,t)=>(0,n.tZ)(P.Z,{canEdit:!0,value:e,onChange:t}),expression:(e,t)=>(0,n.tZ)(N.Z,{canEdit:!0,initialValue:e,onChange:t,extraClasses:["datasource-sql-expression"],language:"sql",offerEditInModal:!1,minLines:5,textAreaStyles:{minWidth:"200px",maxWidth:"450px"},resize:"both"}),description:(e,t,a)=>(0,n.tZ)(be,{label:a,formElement:(0,n.tZ)(P.Z,{value:e,onChange:t})}),d3format:(e,t,a)=>(0,n.tZ)(be,{label:a,formElement:(0,n.tZ)(P.Z,{value:e,onChange:t})})},allowDeletes:!0,stickyHeader:!0})}render(){const{datasource:e,activeTabKey:t}=this.state,{metrics:a}=e,i=null!=a&&a.length?this.sortMetrics(a):[],{theme:o}=this.props;return(0,n.tZ)(ee,null,this.renderErrors(),(0,n.tZ)(h.Z,{css:e=>({marginBottom:4*e.gridUnit}),type:"warning",message:(0,n.tZ)(s.Fragment,null," ",(0,n.tZ)("strong",null,(0,b.t)("Be careful.")," "),(0,b.t)("Changing these settings will affect all charts using this dataset, including charts owned by other people."))}),(0,n.tZ)(ae,{fullWidth:!1,id:"table-tabs",onChange:this.handleTabSelect,defaultActiveKey:t},(0,n.tZ)(T.ZP.TabPane,{key:0,tab:(0,b.t)("Source")},this.renderSourceFieldset(o)),(0,n.tZ)(T.ZP.TabPane,{tab:(0,n.tZ)(pe,{collection:i,title:(0,b.t)("Metrics")}),key:1},this.renderMetricCollection()),(0,n.tZ)(T.ZP.TabPane,{tab:(0,n.tZ)(pe,{collection:this.state.databaseColumns,title:(0,b.t)("Columns")}),key:2},(0,n.tZ)(le,null,(0,n.tZ)(oe,null,(0,n.tZ)(re,null,(0,n.tZ)(w.Z,{buttonSize:"small",buttonStyle:"tertiary",onClick:this.syncMetadata,className:"sync-from-source",disabled:this.state.isEditMode},(0,n.tZ)("i",{className:"fa fa-database"})," ",(0,b.t)("Sync columns from source")))),(0,n.tZ)(ge,{className:"columns-table",columns:this.state.databaseColumns,datasource:e,onColumnsChange:e=>this.setColumns({databaseColumns:e}),onDatasourceChange:this.onDatasourceChange}),this.state.metadataLoading&&(0,n.tZ)(I.Z,null))),(0,n.tZ)(T.ZP.TabPane,{tab:(0,n.tZ)(pe,{collection:this.state.calculatedColumns,title:(0,b.t)("Calculated columns")}),key:3},(0,n.tZ)(le,null,(0,n.tZ)(ge,{columns:this.state.calculatedColumns,onColumnsChange:e=>this.setColumns({calculatedColumns:e}),columnLabelTooltips:{column_name:(0,b.t)("This field is used as a unique identifier to attach the calculated dimension to charts. It is also used as the alias in the SQL query.")},onDatasourceChange:this.onDatasourceChange,datasource:e,editableColumnName:!0,showExpression:!0,allowAddItem:!0,allowEditDataType:!0,itemGenerator:()=>({column_name:(0,b.t)("<new column>"),filterable:!0,groupby:!0,expression:(0,b.t)("<enter SQL expression here>"),__expanded:!0})}))),(0,n.tZ)(T.ZP.TabPane,{key:4,tab:(0,b.t)("Settings")},(0,n.tZ)(v.X2,{gutter:16},(0,n.tZ)(v.JX,{xs:24,md:12},(0,n.tZ)(fe,null,this.renderSettingsFieldset())),(0,n.tZ)(v.JX,{xs:24,md:12},(0,n.tZ)(fe,null,this.renderAdvancedFieldset()))))))}}ve.defaultProps={onChange:()=>{},setIsEditing:()=>{}},ve.propTypes=ye;const xe=(0,_.b)(ve),we=(0,U.ZP)(xe)},42878:(e,t,a)=>{a.d(t,{Z:()=>f});var n=a(73126),i=a(67294),o=a(45697),s=a.n(o),l=a(9875),r=a(61988),d=a(68135),c=a(35932),h=a(94670),u=a(1304),m=a(82342),p=a(11965);const g={name:s().string,onChange:s().func,initialValue:s().string,height:s().number,minLines:s().number,maxLines:s().number,offerEditInModal:s().bool,language:s().oneOf([null,"json","html","sql","markdown","javascript"]),aboveEditorSection:s().node,readOnly:s().bool,resize:s().oneOf([null,"block","both","horizontal","inline","none","vertical"]),textAreaStyles:s().object};class b extends i.Component{onControlChange(e){const{value:t}=e.target;this.props.onChange(t)}onAreaEditorChange(e){this.props.onChange(e)}renderEditor(e=!1){const t=e?40:this.props.minLines||12;if(this.props.language){const a={border:`1px solid ${this.props.theme.colors.grayscale.light1}`,minHeight:`${t}em`,width:"auto",...this.props.textAreaStyles};return this.props.resize&&(a.resize=this.props.resize),this.props.readOnly&&(a.backgroundColor="#f2f2f2"),(0,p.tZ)(h.YH,(0,n.Z)({mode:this.props.language,style:a,minLines:t,maxLines:e?1e3:this.props.maxLines,editorProps:{$blockScrolling:!0},defaultValue:this.props.initialValue,readOnly:this.props.readOnly,key:this.props.name},this.props,{onChange:this.onAreaEditorChange.bind(this)}))}return(0,p.tZ)(l.Kx,{placeholder:(0,r.t)("textarea"),onChange:this.onControlChange.bind(this),defaultValue:this.props.initialValue,disabled:this.props.readOnly,style:{height:this.props.height}})}renderModalBody(){return(0,p.tZ)(i.Fragment,null,(0,p.tZ)("div",null,this.props.aboveEditorSection),this.renderEditor(!0))}render(){const e=(0,p.tZ)(m.Z,this.props);return(0,p.tZ)("div",null,e,this.renderEditor(),this.props.offerEditInModal&&(0,p.tZ)(u.Z,{modalTitle:e,triggerNode:(0,p.tZ)(c.Z,{buttonSize:"small",className:"m-t-5"},(0,r.t)("Edit")," ",(0,p.tZ)("strong",null,this.props.language)," ",(0,r.t)("in modal")),modalBody:this.renderModalBody(!0),responsive:!0}))}}b.propTypes=g,b.defaultProps={onChange:()=>{},initialValue:"",height:250,minLines:3,maxLines:10,offerEditInModal:!0,readOnly:!1,resize:null,textAreaStyles:{}};const f=(0,d.b)(b)},57011:(e,t,a)=>{a.d(t,{Z:()=>s});var n=a(73126),i=(a(67294),a(70302)),o=a(11965);const s=({padded:e,...t})=>(0,o.tZ)(i.Z,(0,n.Z)({},t,{css:t=>({backgroundColor:t.colors.grayscale.light4,borderRadius:t.borderRadius,".ant-card-body":{padding:e?4*t.gridUnit:t.gridUnit}})}))},87253:(e,t,a)=>{a.d(t,{lU:()=>l.lU,zq:()=>l.zq,ZP:()=>s}),a(67294);var n=a(51995),i=a(11965);const o=n.iK.span`
  &,
  & svg {
    vertical-align: top;
  }
`;function s({checked:e,onChange:t,style:a,className:n}){return(0,i.tZ)(o,{style:a,onClick:()=>{t(!e)},role:"checkbox",tabIndex:0,"aria-checked":e,"aria-label":"Checkbox",className:n||""},e?(0,i.tZ)(l.lU,null):(0,i.tZ)(l.zq,null))}var l=a(13842)},38270:(e,t,a)=>{a.d(t,{Z:()=>p});var n=a(73126),i=a(67294),o=a(73727),s=a(94184),l=a.n(s),r=a(51995),d=a(61988),c=a(11965),h=a(58593),u=a(79789);const m=(0,r.iK)(u.Z)`
  vertical-align: middle;
`;function p({canEdit:e=!1,editing:t=!1,extraClasses:a,multiLine:s=!1,noPermitTooltip:r,onSaveTitle:u,showTooltip:p=!0,style:g,title:b="",defaultTitle:f="",placeholder:y="",certifiedBy:Z,certificationDetails:C,url:_,...v}){const[x,w]=(0,i.useState)(t),[T,S]=(0,i.useState)(b),[E,k]=(0,i.useState)(b),[D,I]=(0,i.useState)(null),A=(0,i.useRef)();function M(){if(!e||x)return;const t=A.current?A.current.getBoundingClientRect():null;w(!0),I(t)}function K(){const t=T.trim();e&&(w(!1),t.length?(E!==t&&k(t),b!==t&&u(t)):S(E))}function L(e){" "===e.key&&e.stopPropagation(),"Enter"===e.key&&(e.preventDefault(),K())}function P(t){e&&S(t.target.value)}function N(e){"Enter"===e.key&&(e.preventDefault(),K())}let q;(0,i.useEffect)((()=>{b!==T&&(k(T),S(b))}),[b]),(0,i.useEffect)((()=>{if(x&&(A.current.focus(),A.current.setSelectionRange)){const{length:e}=A.current.value;A.current.setSelectionRange(e,e),A.current.scrollLeft=A.current.scrollWidth,A.current.scrollTop=A.current.scrollHeight}}),[x]),q=T,x||T||(q=f||b);const U=x&&D?{height:`${D.height}px`}:void 0;let $=s&&x?(0,c.tZ)("textarea",{ref:A,value:q,className:b?void 0:"text-muted",onKeyDown:L,onChange:P,onBlur:K,onClick:M,onKeyPress:N,placeholder:y,style:U}):(0,c.tZ)("input",{ref:A,type:x?"text":"button",value:q,className:b?void 0:"text-muted",onKeyDown:L,onChange:P,onBlur:K,onClick:M,onKeyPress:N,placeholder:y});return p&&!x&&($=(0,c.tZ)(h.u,{id:"title-tooltip",title:e?(0,d.t)("Click to edit"):r||(0,d.t)("You don't have the rights to alter this title.")},$)),e||($=_?(0,c.tZ)(o.rU,{to:_,css:e=>c.iv`
          color: ${e.colors.grayscale.dark1};
          text-decoration: none;
          :hover {
            text-decoration: underline;
          }
        `},q):(0,c.tZ)("span",null,q)),(0,c.tZ)("span",(0,n.Z)({className:l()("editable-title",a,e&&"editable-title--editable",x&&"editable-title--editing"),style:g},v),Z&&(0,c.tZ)(i.Fragment,null,(0,c.tZ)(m,{certifiedBy:Z,details:C,size:"xl"})," "),$)}},99299:(e,t,a)=>{a.d(t,{Z:()=>o}),a(67294);var n=a(19181),i=a(11965);const o=e=>(0,i.tZ)(n.Z,e)}}]);
//# sourceMappingURL=5372112b8291fb6b751c.chunk.js.map