=12)){var r=d.map((function(e,t){return e-(t===p.target?n:0)}));h(r)}}}),[p,l]),_=(0,r.useCallback)((function(){g(ct(ct({},p),{},{enable:!1}))}),[p]),b=function(e){return function(t){!function(e,t){g({start:e.clientX,target:t,enable:!0})}(t,e)}};return Nr("mousemove",y),Nr("mouseup",_),Ht("div",{className:"vm-predefined-dashboard",children:Ht(ta,{defaultExpanded:c,onChange:function(e){return s(e)},title:Ht((function(){return Ht("div",{className:wr()({"vm-predefined-dashboard-header":!0,"vm-predefined-dashboard-header_open":c}),children:[(n||a)&&Ht("span",{className:"vm-predefined-dashboard-header__title",children:n||"".concat(t+1,". ").concat(a)}),i&&Ht("span",{className:"vm-predefined-dashboard-header__count",children:["(",i.length," panels)"]})]})}),{}),children:Ht("div",{className:"vm-predefined-dashboard-panels",children:Array.isArray(i)&&i.length?i.map((function(e,t){return Ht("div",{className:"vm-predefined-dashboard-panels-panel vm-block vm-block_empty-padding",style:{gridColumn:"span ".concat(d[t])},children:[Ht(Df,{title:e.title,description:e.description,unit:e.unit,expr:e.expr,alias:e.alias,filename:a,showLegend:e.showLegend}),Ht("button",{className:"vm-predefined-dashboard-panels-panel__resizer",onMouseDown:b(t)})]},t)})):Ht("div",{className:"vm-predefined-dashboard-panels-panel__alert",children:Ht(Kr,{variant:"error",children:[Ht("code",{children:'"panels"'})," not found. Check the configuration file ",Ht("b",{children:a}),"."]})})})})})},kf=function(){!function(){var e=Nn(),t=e.duration,n=e.relativeTime,i=e.period.date,a=Ur().customStep,o=Wi().setSearchParamsFromKeys,l=function(){var e,r=Es((lt(e={},"g0.range_input",t),lt(e,"g0.end_input",i),lt(e,"g0.step_input",a),lt(e,"g0.relative_time",n),e));o(r)};(0,r.useEffect)(l,[t,n,i,a]),(0,r.useEffect)(l,[])}();var e=Qr().isMobile,t=ni(),n=t.dashboardsSettings,i=t.dashboardsLoading,a=t.dashboardsError,o=v((0,r.useState)(0),2),l=o[0],u=o[1],c=(0,r.useMemo)((function(){return n.map((function(e,t){return{label:e.title||"",value:t}}))}),[n]),s=(0,r.useMemo)((function(){return n[l]||{}}),[n,l]),f=(0,r.useMemo)((function(){return null===s||void 0===s?void 0:s.rows}),[s]),d=(0,r.useMemo)((function(){return s.title||s.filename||""}),[s]),h=(0,r.useMemo)((function(){return Array.isArray(f)&&!!f.length}),[f]),m=function(e){return function(){!function(e){u(e)}(e)}};return Ht("div",{className:"vm-predefined-panels",children:[i&&Ht(_s,{}),!n.length&&a&&Ht(Kr,{variant:"error",children:a}),!n.length&&Ht(Kr,{variant:"info",children:"Dashboards not found"}),c.length>1&&Ht("div",{className:wr()({"vm-predefined-panels-tabs":!0,"vm-predefined-panels-tabs_mobile":e}),children:c.map((function(e){return Ht("div",{className:wr()({"vm-predefined-panels-tabs__tab":!0,"vm-predefined-panels-tabs__tab_active":e.value==l}),onClick:m(e.value),children:e.label},e.value)}))}),Ht("div",{className:"vm-predefined-panels__dashboards",children:[h&&f.map((function(e,t){return Ht(wf,{index:t,filename:d,title:e.title,panels:e.panels},"".concat(l,"_").concat(t))})),!!n.length&&!h&&Ht(Kr,{variant:"error",children:[Ht("code",{children:'"rows"'})," not found. Check the configuration file ",Ht("b",{children:d}),"."]})]})]})},xf=function(e,t){var n=t.match?"&match[]="+encodeURIComponent(t.match):"",r=t.focusLabel?"&focusLabel="+encodeURIComponent(t.focusLabel):"";return"".concat(e,"/api/v1/status/tsdb?topN=").concat(t.topN,"&date=").concat(t.date).concat(n).concat(r)},Sf=function(){function e(){b(this,e),this.tsdbStatus=void 0,this.tabsNames=void 0,this.tsdbStatus=this.defaultTSDBStatus,this.tabsNames=["table","graph"],this.getDefaultState=this.getDefaultState.bind(this)}return k(e,[{key:"tsdbStatusData",get:function(){return this.tsdbStatus},set:function(e){this.tsdbStatus=e}},{key:"defaultTSDBStatus",get:function(){return{totalSeries:0,totalSeriesPrev:0,totalSeriesByAll:0,totalLabelValuePairs:0,seriesCountByMetricName:[],seriesCountByLabelName:[],seriesCountByFocusLabelValue:[],seriesCountByLabelValuePair:[],labelValueCountByLabelName:[]}}},{key:"keys",value:function(e,t){var n=e&&/__name__=".+"/.test(e),r=e&&/{.+=".+"}/g.test(e),i=e&&/__name__=".+", .+!=""/g.test(e),a=[];return a=t||i?a.concat("seriesCountByFocusLabelValue"):n?a.concat("labelValueCountByLabelName"):r?a.concat("seriesCountByMetricName","seriesCountByLabelName"):a.concat("seriesCountByMetricName","seriesCountByLabelName","seriesCountByLabelValuePair","labelValueCountByLabelName"),a}},{key:"getDefaultState",value:function(e,t){var n=this;return this.keys(e,t).reduce((function(e,t){return ct(ct({},e),{},{tabs:ct(ct({},e.tabs),{},lt({},t,n.tabsNames)),containerRefs:ct(ct({},e.containerRefs),{},lt({},t,(0,r.useRef)(null)))})}),{tabs:{},containerRefs:{}})}},{key:"sectionsTitles",value:function(e){return{seriesCountByMetricName:"Metric names with the highest number of series",seriesCountByLabelName:"Labels with the highest number of series",seriesCountByFocusLabelValue:'Values for "'.concat(e,'" label with the highest number of series'),seriesCountByLabelValuePair:"Label=value pairs with the highest number of series",labelValueCountByLabelName:"Labels with the highest number of unique values"}}},{key:"sectionsTips",get:function(){return{seriesCountByMetricName:"\n \n This table returns a list of metrics with the highest cardinality.\n The cardinality of a metric is the number of time series associated with that metric,\n where each time series is defined as a unique combination of key-value label pairs.\n
\n \n When looking to reduce the number of active series in your data source,\n you can start by inspecting individual metrics with high cardinality\n (i.e. that have lots of active time series associated with them),\n since that single metric contributes a large fraction of the series that make up your total series count.\n
",seriesCountByLabelName:"\n \n This table returns a list of the labels with the highest number of series.\n
\n \n Use this table to identify labels that are storing dimensions with high cardinality\n (many different label values).\n
\n \n It is recommended to choose labels such that they have a finite set of values,\n since every unique combination of key-value label pairs creates a new time series\n and therefore can dramatically increase the number of time series in your system.\n
",seriesCountByFocusLabelValue:"\n \n This table returns a list of unique label values per selected label.\n
\n \n Use this table to identify label values that are storing per each selected series.\n
",labelValueCountByLabelName:"\n \n This table returns a list of labels with the highest number of the unique values.\n
\n ",seriesCountByLabelValuePair:"\n \n This table returns a list of the label values pairs with the highest number of series.\n
\n \n Use this table to identify unique label values pairs. This helps to identify same labels \n is applied to count timeseries in your system, since every unique combination of key-value label pairs \n creates a new time series and therefore can dramatically increase the number of time series in your system\n
"}}},{key:"tablesHeaders",get:function(){return{seriesCountByMetricName:Ef,seriesCountByLabelName:Af,seriesCountByFocusLabelValue:Nf,seriesCountByLabelValuePair:Mf,labelValueCountByLabelName:Ff}}},{key:"totalSeries",value:function(e){return"labelValueCountByLabelName"===e?-1:arguments.length>1&&void 0!==arguments[1]&&arguments[1]?this.tsdbStatus.totalSeriesPrev:this.tsdbStatus.totalSeries}}]),e}(),Ef=[{id:"name",label:"Metric name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Share in total",info:"Shows the share of a metric to the total number of series"},{id:"action",label:""}],Af=[{id:"name",label:"Label name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Share in total",info:"Shows the share of the label to the total number of series"},{id:"action",label:""}],Nf=[{id:"name",label:"Label value"},{id:"value",label:"Number of series"},{id:"percentage",label:"Share in total"},{disablePadding:!1,id:"action",label:"",numeric:!1}],Mf=[{id:"name",label:"Label=value pair"},{id:"value",label:"Number of series"},{id:"percentage",label:"Share in total",info:"Shows the share of the label value pair to the total number of series"},{id:"action",label:""}],Ff=[{id:"name",label:"Label name"},{id:"value",label:"Number of unique values"},{id:"action",label:""}],Tf={seriesCountByMetricName:function(e){var t=e.query;return Of("__name__",t)},seriesCountByLabelName:function(e){var t=e.query;return"{".concat(t,'!=""}')},seriesCountByFocusLabelValue:function(e){var t=e.query,n=e.focusLabel;return Of(n,t)},seriesCountByLabelValuePair:function(e){var t=e.query.split("="),n=t[0],r=t.slice(1).join("=");return Of(n,r)},labelValueCountByLabelName:function(e){var t=e.query,n=e.match;return""===n?"{".concat(t,'!=""}'):"".concat(n.replace("}",""),", ").concat(t,'!=""}')}},Of=function(e,t){return e?"{"+e+"="+JSON.stringify(t)+"}":""},If=function(e){var t,n=e.totalSeries,r=e.totalSeriesPrev,i=e.totalSeriesAll,a=e.seriesCountByMetricName,o=Qr().isMobile,l=v(at(),1)[0],u=l.get("match"),c=l.get("focusLabel"),s=/__name__/.test(u||""),f=(null===(t=a[0])||void 0===t?void 0:t.value)/i*100,d=n-r,h=Math.abs(d)/r*100,m=[{title:"Total series",value:n.toLocaleString("en-US"),dynamic:n&&r?"".concat(h.toFixed(2),"%"):"",display:!c,info:'The total number of active time series. \n A time series is uniquely identified by its name plus a set of its labels. \n For example, temperature{city="NY",country="US"} and temperature{city="SF",country="US"} \n are two distinct series, since they differ by the city label.'},{title:"Percentage from total",value:isNaN(f)?"-":"".concat(f.toFixed(2),"%"),display:s,info:"The share of these series in the total number of time series."}].filter((function(e){return e.display}));return m.length?Ht("div",{className:wr()({"vm-cardinality-totals":!0,"vm-cardinality-totals_mobile":o}),children:m.map((function(e){var t=e.title,n=e.value,i=e.info,a=e.dynamic;return Ht("div",{className:"vm-cardinality-totals-card",children:[Ht("h4",{className:"vm-cardinality-totals-card__title",children:[t,i&&Ht(mi,{title:Ht("p",{className:"vm-cardinality-totals-card__tooltip",children:i}),children:Ht("div",{className:"vm-cardinality-totals-card__info-icon",children:Ht(Yn,{})})})]}),Ht("span",{className:"vm-cardinality-totals-card__value",children:n}),!!a&&Ht(mi,{title:"in relation to the previous day: ".concat(r.toLocaleString("en-US")),children:Ht("span",{className:wr()({"vm-dynamic-number":!0,"vm-dynamic-number_positive vm-dynamic-number_down":d<0,"vm-dynamic-number_negative vm-dynamic-number_up":d>0}),children:a})})]},t)}))}):null},Pf=function(e,t){var n=v(at(),1)[0],i=n.get(t)?n.get(t):e,a=v((0,r.useState)(i),2),o=a[0],l=a[1];return(0,r.useEffect)((function(){i!==o&&l(i)}),[i]),[o,l]},Lf=function(e){var t=Qr().isMobile,n=v(at(),1)[0],i=Wi().setSearchParamsFromKeys,a=n.get("tips")||"",o=v(Pf("","match"),2),l=o[0],u=o[1],c=v(Pf("","focusLabel"),2),s=c[0],f=c[1],d=v(Pf(10,"topN"),2),h=d[0],m=d[1],p=(0,r.useMemo)((function(){return h<0?"Number must be bigger than zero":""}),[h]),g=function(){i({match:l,topN:h,focusLabel:s})};return(0,r.useEffect)((function(){var e=n.get("match"),t=+(n.get("topN")||10),r=n.get("focusLabel");e!==l&&u(e||""),t!==h&&m(t),r!==s&&f(r||"")}),[n]),Ht("div",{className:wr()({"vm-cardinality-configurator":!0,"vm-cardinality-configurator_mobile":t,"vm-block":!0,"vm-block_mobile":t}),children:[Ht("div",{className:"vm-cardinality-configurator-controls",children:[Ht("div",{className:"vm-cardinality-configurator-controls__query",children:Ht(Ai,{label:"Time series selector",type:"string",value:l,onChange:u,onEnter:g})}),Ht("div",{className:"vm-cardinality-configurator-controls__item",children:Ht(Ai,{label:"Focus label",type:"text",value:s||"",onChange:f,onEnter:g,endIcon:Ht(mi,{title:Ht("div",{children:Ht("p",{children:"To identify values with the highest number of series for the selected label."})}),children:Ht(vr,{})})})}),Ht("div",{className:"vm-cardinality-configurator-controls__item vm-cardinality-configurator-controls__item_limit",children:Ht(Ai,{label:"Limit entries",type:"number",value:h,error:p,onChange:function(e){var t=+e;m(isNaN(t)?0:t)},onEnter:g})})]}),Ht("div",{className:"vm-cardinality-configurator-bottom",children:[Ht(If,ct({},e)),Ht("div",{className:"vm-cardinality-configurator-bottom-helpful",children:Ht("a",{className:"vm-link vm-link_with-icon",target:"_blank",href:"https://docs.victoriametrics.com/#cardinality-explorer",rel:"help noreferrer",children:[Ht(mr,{}),"Documentation"]})}),Ht("div",{className:"vm-cardinality-configurator-bottom__execute",children:[Ht(mi,{title:a?"Hide tips":"Show tips",children:Ht(oi,{variant:"text",color:a?"warning":"gray",startIcon:Ht(br,{}),onClick:function(){var e=n.get("tips")||"";i({tips:e?"":"true"})}})}),Ht(oi,{variant:"text",startIcon:Ht($n,{}),onClick:function(){i({match:"",focusLabel:""})},children:"Reset"}),Ht(oi,{startIcon:Ht(er,{}),onClick:g,children:"Execute Query"})]})]})]})};function Bf(e){var t=e.order,n=e.orderBy,r=e.onRequestSort,i=e.headerCells;return Ht("thead",{className:"vm-table-header vm-cardinality-panel-table__header",children:Ht("tr",{className:"vm-table__row vm-table__row_header",children:i.map((function(e){return Ht("th",{className:wr()({"vm-table-cell vm-table-cell_header":!0,"vm-table-cell_sort":"action"!==e.id&&"percentage"!==e.id,"vm-table-cell_right":"action"===e.id}),onClick:(i=e.id,function(e){r(e,i)}),children:Ht("div",{className:"vm-table-cell__content",children:[e.info?Ht(mi,{title:e.info,children:[Ht("div",{className:"vm-metrics-content-header__tip-icon",children:Ht(Yn,{})}),e.label]}):Ht(zt.HY,{children:e.label}),"action"!==e.id&&"percentage"!==e.id&&Ht("div",{className:wr()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":n===e.id,"vm-table__sort-icon_desc":"desc"===t&&n===e.id}),children:Ht(Qn,{})})]})},e.id);var i}))})})}function Rf(e,t,n){return t[n]e[n]?1:0}function zf(e,t){return"desc"===e?function(e,n){return Rf(e,n,t)}:function(e,n){return-Rf(e,n,t)}}function jf(e,t){var n=e.map((function(e,t){return[e,t]}));return n.sort((function(e,n){var r=t(e[0],n[0]);return 0!==r?r:e[1]-n[1]})),n.map((function(e){return e[0]}))}var Hf=function(e){var t=e.rows,n=e.headerCells,i=e.defaultSortColumn,a=e.tableCells,o=v((0,r.useState)("desc"),2),l=o[0],u=o[1],c=v((0,r.useState)(i),2),s=c[0],f=c[1],d=jf(t,zf(l,s));return Ht("table",{className:"vm-table vm-cardinality-panel-table",children:[Ht(Bf,{order:l,orderBy:s,onRequestSort:function(e,t){u(s===t&&"asc"===l?"desc":"asc"),f(t)},rowCount:t.length,headerCells:n}),Ht("tbody",{className:"vm-table-header",children:d.map((function(e){return Ht("tr",{className:"vm-table__row",children:a(e)},e.name)}))})]})},$f=function(e){var t=e.row,n=e.totalSeries,r=e.totalSeriesPrev,i=e.onActionClick,a=n>0?t.value/n*100:-1,o=r>0?t.valuePrev/r*100:-1,l=[a,o].some((function(e){return-1===e})),u=a-o,c=l?"":"".concat(u.toFixed(2),"%"),s=function(){i(t.name)};return Ht(zt.HY,{children:[Ht("td",{className:"vm-table-cell",children:Ht("span",{className:"vm-link vm-link_colored",onClick:s,children:t.name})},t.name),Ht("td",{className:"vm-table-cell",children:[t.value,!!t.diff&&Ht(mi,{title:"in relation to the previous day: ".concat(t.valuePrev),children:Ht("span",{className:wr()({"vm-dynamic-number":!0,"vm-dynamic-number_positive":t.diff<0,"vm-dynamic-number_negative":t.diff>0}),children:["\xa0",t.diff>0?"+":"",t.diff]})})]},t.value),a>0&&Ht("td",{className:"vm-table-cell",children:Ht("div",{className:"vm-cardinality-panel-table__progress",children:[Ht(bs,{value:a}),c&&Ht(mi,{title:"in relation to the previous day",children:Ht("span",{className:wr()({"vm-dynamic-number":!0,"vm-dynamic-number_positive vm-dynamic-number_down":u<0,"vm-dynamic-number_negative vm-dynamic-number_up":u>0}),children:c})})]})},t.progressValue),Ht("td",{className:"vm-table-cell vm-table-cell_right",children:Ht("div",{className:"vm-table-cell__content",children:Ht(mi,{title:"Filter by ".concat(t.name),children:Ht(oi,{variant:"text",size:"small",onClick:s,children:Ht(tr,{})})})})},"action")]})},Yf=function(e){var t=e.data,n=v((0,r.useState)([]),2),i=n[0],a=n[1],o=v((0,r.useState)([0,0]),2),l=o[0],u=o[1];return(0,r.useEffect)((function(){var e=t.sort((function(e,t){return t.value-e.value})),n=function(e){var t=e.map((function(e){return e.value})),n=Math.ceil(t[0]||1),r=n/9;return new Array(11).fill(n+r).map((function(e,t){return Math.round(e-r*t)}))}(e);u(n),a(e.map((function(e){return ct(ct({},e),{},{percentage:e.value/n[0]*100})})))}),[t]),Ht("div",{className:"vm-simple-bar-chart",children:[Ht("div",{className:"vm-simple-bar-chart-y-axis",children:l.map((function(e){return Ht("div",{className:"vm-simple-bar-chart-y-axis__tick",children:e},e)}))}),Ht("div",{className:"vm-simple-bar-chart-data",children:i.map((function(e){var t=e.name,n=e.value,r=e.percentage;return Ht(mi,{title:"".concat(t,": ").concat(n),placement:"top-center",children:Ht("div",{className:"vm-simple-bar-chart-data-item",style:{maxHeight:"".concat(r||0,"%")}})},"".concat(t,"_").concat(n))}))})]})},Vf=function(e){var t=e.rows,n=e.tabs,i=void 0===n?[]:n,a=e.chartContainer,o=e.totalSeries,l=e.totalSeriesPrev,u=e.onActionClick,c=e.sectionTitle,s=e.tip,f=e.tableHeaderCells,d=Qr().isMobile,h=v((0,r.useState)("table"),2),m=h[0],p=h[1],g=(0,r.useMemo)((function(){return i.map((function(e,t){return{value:e,label:e,icon:Ht(0===t?rr:nr,{})}}))}),[i]);return Ht("div",{className:wr()({"vm-metrics-content":!0,"vm-metrics-content_mobile":d,"vm-block":!0,"vm-block_mobile":d}),children:[Ht("div",{className:"vm-metrics-content-header vm-section-header",children:[Ht("h5",{className:wr()({"vm-metrics-content-header__title":!0,"vm-section-header__title":!0,"vm-section-header__title_mobile":d}),children:[!d&&s&&Ht(mi,{title:Ht("p",{dangerouslySetInnerHTML:{__html:s},className:"vm-metrics-content-header__tip"}),children:Ht("div",{className:"vm-metrics-content-header__tip-icon",children:Ht(Yn,{})})}),c]}),Ht("div",{className:"vm-section-header__tabs",children:Ht(Fr,{activeItem:m,items:g,onChange:p})})]}),"table"===m&&Ht("div",{ref:a,className:wr()({"vm-metrics-content__table":!0,"vm-metrics-content__table_mobile":d}),children:Ht(Hf,{rows:t,headerCells:f,defaultSortColumn:"value",tableCells:function(e){return Ht($f,{row:e,totalSeries:o,totalSeriesPrev:l,onActionClick:u})}})}),"graph"===m&&Ht("div",{className:"vm-metrics-content__chart",children:Ht(Yf,{data:t.map((function(e){return{name:e.name,value:e.value}}))})})]})},Uf=function(e){var t=e.title,n=e.children;return Ht("div",{className:"vm-cardinality-tip",children:[Ht("div",{className:"vm-cardinality-tip-header",children:[Ht("div",{className:"vm-cardinality-tip-header__tip-icon",children:Ht(br,{})}),Ht("h4",{className:"vm-cardinality-tip-header__title",children:t||"Tips"})]}),Ht("p",{className:"vm-cardinality-tip__description",children:n})]})},qf=function(){return Ht(Uf,{title:"Metrics with a high number of series",children:Ht("ul",{children:[Ht("li",{children:["Identify and eliminate labels with frequently changed values to reduce their\xa0",Ht(Ts,{href:"https://docs.victoriametrics.com/FAQ.html#what-is-high-cardinality",children:"cardinality"}),"\xa0and\xa0",Ht(Ts,{href:"https://docs.victoriametrics.com/FAQ.html#what-is-high-churn-rate",children:"high churn rate"})]}),Ht("li",{children:["Find unused time series and\xa0",Ht(Ts,{href:"https://docs.victoriametrics.com/relabeling.html",children:"drop entire metrics"})]}),Ht("li",{children:["Aggregate time series before they got ingested into the database via\xa0",Ht(Ts,{href:"https://docs.victoriametrics.com/stream-aggregation.html",children:"streaming aggregation"})]})]})})},Wf=function(){return Ht(Uf,{title:"Labels with a high number of unique values",children:Ht("ul",{children:[Ht("li",{children:"Decrease the number of unique label values to reduce cardinality"}),Ht("li",{children:["Drop the label entirely via\xa0",Ht(Ts,{href:"https://docs.victoriametrics.com/relabeling.html",children:"relabeling"})]}),Ht("li",{children:"For volatile label values (such as URL path, user session, etc.) consider printing them to the log file instead of adding to time series"})]})})},Zf=function(){return Ht(Uf,{title:"Dashboard of a single metric",children:[Ht("p",{children:"This dashboard helps to understand the cardinality of a single metric."}),Ht("p",{children:"Each time series is a unique combination of key-value label pairs. Therefore a label key with many values can create a lot of time series for a particular metric. If you\u2019re trying to decrease the cardinality of a metric, start by looking at the labels with the highest number of values."}),Ht("p",{children:"Use the series selector at the top of the page to apply additional filters."})]})},Qf=function(){return Ht(Uf,{title:"Dashboard of a label",children:[Ht("p",{children:"This dashboard helps you understand the count of time series per label."}),Ht("p",{children:"Use the selector at the top of the page to pick a label name you\u2019d like to inspect. For the selected label name, you\u2019ll see the label values that have the highest number of series associated with them. So if you\u2019ve chosen `instance` as your label name, you may see that `657` time series have value \u201chost-1\u201d attached to them and `580` time series have value `host-2` attached to them."}),Ht("p",{children:"This can be helpful in allowing you to determine where the bulk of your time series are coming from. If the label \u201cinstance=host-1\u201d was applied to 657 series and the label \u201cinstance=host-2\u201d was only applied to 580 series, you\u2019d know, for example, that host-01 was responsible for sending the majority of the time series."})]})},Gf=function(){var e=Qr().isMobile,t=v(at(),1)[0],n=Wi().setSearchParamsFromKeys,i=t.get("tips")||"",o=t.get("match")||"",l=t.get("focusLabel")||"",u=function(){var e=new Sf,t=v(at(),1)[0],n=t.get("match"),i=t.get("focusLabel"),o=+(t.get("topN")||10),l=t.get("date")||a()().tz().format(qt),u=Yt().serverUrl,c=v((0,r.useState)(!1),2),s=c[0],f=c[1],d=v((0,r.useState)(),2),h=d[0],m=d[1],p=v((0,r.useState)(e.defaultTSDBStatus),2),g=p[0],y=p[1],_=function(){var t=sa(ua().mark((function t(r){var i,o,l,c,s,d,h,p,g,_,b,C,D,w,k,x;return ua().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u){t.next=2;break}return t.abrupt("return");case 2:return m(""),f(!0),y(e.defaultTSDBStatus),i={date:r.date,topN:0,match:"",focusLabel:""},o=ct(ct({},r),{},{date:a()(r.date).subtract(1,"day").tz().format(qt)}),l=xf(u,r),c=xf(u,o),s=xf(u,i),d=[l,c,s],t.prev=11,t.next=14,Promise.all(d.map((function(e){return fetch(e)})));case 14:return h=t.sent,t.next=17,Promise.all(h.map((function(e){return e.json()})));case 17:p=t.sent,g=v(p,3),_=g[0],b=g[1],C=g[2],h[0].ok?(D=C.data,w=ct({},b.data),(k=ct({},_.data)).totalSeriesByAll=null===D||void 0===D?void 0:D.totalSeries,k.totalSeriesPrev=null===w||void 0===w?void 0:w.totalSeries,x=null===n||void 0===n?void 0:n.replace(/[{}"]/g,""),k.seriesCountByLabelValuePair=k.seriesCountByLabelValuePair.filter((function(e){return e.name!==x})),Object.keys(k).forEach((function(e){var t=e,n=k[t],r=w[t];Array.isArray(n)&&Array.isArray(r)&&n.forEach((function(e){var t,n=null===(t=r.find((function(t){return t.name===e.name})))||void 0===t?void 0:t.value;e.diff=n?e.value-n:0,e.valuePrev=n||0}))})),y(k),f(!1)):(m(_.error),y(e.defaultTSDBStatus),f(!1)),t.next=29;break;case 25:t.prev=25,t.t0=t.catch(11),f(!1),t.t0 instanceof Error&&m("".concat(t.t0.name,": ").concat(t.t0.message));case 29:case"end":return t.stop()}}),t,null,[[11,25]])})));return function(e){return t.apply(this,arguments)}}();return(0,r.useEffect)((function(){_({topN:o,match:n,date:l,focusLabel:i})}),[u,n,i,o,l]),(0,r.useEffect)((function(){h&&(y(e.defaultTSDBStatus),f(!1))}),[h]),e.tsdbStatusData=g,{isLoading:s,appConfigurator:e,error:h}}(),c=u.isLoading,s=u.appConfigurator,f=u.error,d=s.tsdbStatusData,h=s.getDefaultState,m=s.tablesHeaders,p=s.sectionsTips,g=h(o,l);return Ht("div",{className:wr()({"vm-cardinality-panel":!0,"vm-cardinality-panel_mobile":e}),children:[c&&Ht(_s,{message:"Please wait while cardinality stats is calculated. \n This may take some time if the db contains big number of time series."}),Ht(Lf,{totalSeries:d.totalSeries,totalSeriesPrev:d.totalSeriesPrev,totalSeriesAll:d.totalSeriesByAll,totalLabelValuePairs:d.totalLabelValuePairs,seriesCountByMetricName:d.seriesCountByMetricName}),i&&Ht("div",{className:"vm-cardinality-panel-tips",children:[!o&&!l&&Ht(qf,{}),o&&!l&&Ht(Zf,{}),!o&&!l&&Ht(Wf,{}),l&&Ht(Qf,{})]}),f&&Ht(Kr,{variant:"error",children:f}),s.keys(o,l).map((function(e){return Ht(Vf,{sectionTitle:s.sectionsTitles(l)[e],tip:p[e],rows:d[e],onActionClick:(t=e,function(e){var r={match:Tf[t]({query:e,focusLabel:l,match:o})};"labelValueCountByLabelName"!==t&&"seriesCountByLabelName"!=t||(r.focusLabel=e),"seriesCountByFocusLabelValue"==t&&(r.focusLabel=""),n(r)}),tabs:g.tabs[e],chartContainer:g.containerRefs[e],totalSeriesPrev:s.totalSeries(e,!0),totalSeries:s.totalSeries(e),tableHeaderCells:m[e]},e);var t}))]})},Kf=function(e){var t=e.topN,n=e.maxLifetime,i=Yt().serverUrl,a=Wi().setSearchParamsFromKeys,o=v((0,r.useState)(null),2),l=o[0],u=o[1],c=v((0,r.useState)(!1),2),s=c[0],f=c[1],d=v((0,r.useState)(),2),h=d[0],m=d[1],p=(0,r.useMemo)((function(){return function(e,t,n){return"".concat(e,"/api/v1/status/top_queries?topN=").concat(t||"","&maxLifetime=").concat(n||"")}(i,t,n)}),[i,t,n]),g=function(){var e=sa(ua().mark((function e(){var r,i;return ua().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f(!0),a({topN:t,maxLifetime:n}),e.prev=2,e.next=5,fetch(p);case 5:return r=e.sent,e.next=8,r.json();case 8:i=e.sent,r.ok&&["topByAvgDuration","topByCount","topBySumDuration"].forEach((function(e){var t=i[e];Array.isArray(t)&&t.forEach((function(e){return e.timeRange=dn(1e3*e.timeRangeSeconds)}))})),u(r.ok?i:null),m(String(i.error||"")),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(2),e.t0 instanceof Error&&"AbortError"!==e.t0.name&&m("".concat(e.t0.name,": ").concat(e.t0.message));case 17:f(!1);case 18:case"end":return e.stop()}}),e,null,[[2,14]])})));return function(){return e.apply(this,arguments)}}();return{data:l,error:h,loading:s,fetch:g}},Jf=function(e){var t=e.rows,n=e.columns,i=e.defaultOrderBy,a=Fc(),o=v((0,r.useState)(i||"count"),2),l=o[0],u=o[1],c=v((0,r.useState)("desc"),2),s=c[0],f=c[1],d=(0,r.useMemo)((function(){return jf(t,zf(s,l))}),[t,l,s]),h=function(e){return function(){var t;t=e,f((function(e){return"asc"===e&&l===t?"desc":"asc"})),u(t)}},m=function(e){var t=e.query;return sa(ua().mark((function e(){return ua().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a(t,"Query has been copied");case 2:case"end":return e.stop()}}),e)})))};return Ht("table",{className:"vm-table",children:[Ht("thead",{className:"vm-table-header",children:Ht("tr",{className:"vm-table__row vm-table__row_header",children:[n.map((function(e){return Ht("th",{className:"vm-table-cell vm-table-cell_header vm-table-cell_sort",onClick:h(e.sortBy||e.key),children:Ht("div",{className:"vm-table-cell__content",children:[e.title||e.key,Ht("div",{className:wr()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":l===e.key,"vm-table__sort-icon_desc":"desc"===s&&l===e.key}),children:Ht(Qn,{})})]})},e.key)})),Ht("th",{className:"vm-table-cell vm-table-cell_header"})," "]})}),Ht("tbody",{className:"vm-table-body",children:d.map((function(e,t){return Ht("tr",{className:"vm-table__row",children:[n.map((function(t){return Ht("td",{className:"vm-table-cell",children:e[t.key]||"-"},t.key)})),Ht("td",{className:"vm-table-cell vm-table-cell_no-padding",children:Ht("div",{className:"vm-top-queries-panels__table-actions",children:[Ht(mi,{title:"Execute query",children:Ht(tt,{to:"".concat(mt.home,"?g0.expr=").concat(encodeURIComponent(e.query)),target:"_blank",rel:"noreferrer",children:Ht(oi,{variant:"text",size:"small",startIcon:Ht(tr,{})})})}),Ht(mi,{title:"Copy query",children:Ht(oi,{variant:"text",size:"small",startIcon:Ht(fr,{}),onClick:m(e)})})]})})]},t)}))})]})},Xf=["table","JSON"].map((function(e,t){return{value:String(t),label:e,icon:Ht(0===t?rr:ir,{})}})),ed=function(e){var t=e.rows,n=e.title,i=e.columns,a=e.defaultOrderBy,o=Qr().isMobile,l=v((0,r.useState)(0),2),u=l[0],c=l[1];return Ht("div",{className:wr()({"vm-top-queries-panel":!0,"vm-block":!0,"vm-block_mobile":o}),children:[Ht("div",{className:wr()({"vm-top-queries-panel-header":!0,"vm-section-header":!0,"vm-top-queries-panel-header_mobile":o}),children:[Ht("h5",{className:wr()({"vm-section-header__title":!0,"vm-section-header__title_mobile":o}),children:n}),Ht("div",{className:"vm-section-header__tabs",children:Ht(Fr,{activeItem:String(u),items:Xf,onChange:function(e){c(+e)}})})]}),Ht("div",{className:wr()({"vm-top-queries-panel__table":!0,"vm-top-queries-panel__table_mobile":o}),children:[0===u&&Ht(Jf,{rows:t,columns:i,defaultOrderBy:a}),1===u&&Ht(ps,{data:t})]})]})},td=function(){var e=Qr().isMobile,t=v(Pf(10,"topN"),2),n=t[0],i=t[1],o=v(Pf("10m","maxLifetime"),2),l=o[0],u=o[1],c=Kf({topN:n,maxLifetime:l}),s=c.data,f=c.error,d=c.loading,h=c.fetch,m=(0,r.useMemo)((function(){var e=l.trim().split(" ").reduce((function(e,t){var n=on(t);return n?ct(ct({},e),n):ct({},e)}),{});return!!a().duration(e).asMilliseconds()}),[l]),p=(0,r.useMemo)((function(){return!!n&&n<1}),[n]),g=(0,r.useMemo)((function(){return p?"Number must be bigger than zero":""}),[p]),y=(0,r.useMemo)((function(){return m?"":"Invalid duration value"}),[m]),_=function(e){if(!s)return e;var t=s[e];return"number"===typeof t?vc(t,t,t):t||e},b=function(e){"Enter"===e.key&&h()};return(0,r.useEffect)((function(){s&&(n||i(+s.topN),l||u(s.maxLifetime))}),[s]),(0,r.useEffect)((function(){return h(),window.addEventListener("popstate",h),function(){window.removeEventListener("popstate",h)}}),[]),Ht("div",{className:wr()({"vm-top-queries":!0,"vm-top-queries_mobile":e}),children:[d&&Ht(_s,{containerStyles:{height:"500px"}}),Ht("div",{className:wr()({"vm-top-queries-controls":!0,"vm-block":!0,"vm-block_mobile":e}),children:[Ht("div",{className:"vm-top-queries-controls-fields",children:[Ht("div",{className:"vm-top-queries-controls-fields__item",children:Ht(Ai,{label:"Max lifetime",value:l,error:y,helperText:"For example ".concat("30ms, 15s, 3d4h, 1y2w"),onChange:function(e){u(e)},onKeyDown:b})}),Ht("div",{className:"vm-top-queries-controls-fields__item",children:Ht(Ai,{label:"Number of returned queries",type:"number",value:n||"",error:g,onChange:function(e){i(+e)},onKeyDown:b})})]}),Ht("div",{className:wr()({"vm-top-queries-controls-bottom":!0,"vm-top-queries-controls-bottom_mobile":e}),children:[Ht("div",{className:"vm-top-queries-controls-bottom__info",children:["VictoriaMetrics tracks the last\xa0",Ht(mi,{title:"search.queryStats.lastQueriesCount",children:Ht("b",{children:_("search.queryStats.lastQueriesCount")})}),"\xa0queries with durations at least\xa0",Ht(mi,{title:"search.queryStats.minQueryDuration",children:Ht("b",{children:_("search.queryStats.minQueryDuration")})})]}),Ht("div",{className:"vm-top-queries-controls-bottom__button",children:Ht(oi,{startIcon:Ht(er,{}),onClick:h,children:"Execute"})})]})]}),f&&Ht(Kr,{variant:"error",children:f}),s&&Ht(zt.HY,{children:Ht("div",{className:"vm-top-queries-panels",children:[Ht(ed,{rows:s.topByCount,title:"Most frequently executed queries",columns:[{key:"query"},{key:"timeRange",sortBy:"timeRangeSeconds",title:"query time interval"},{key:"count"}]}),Ht(ed,{rows:s.topByAvgDuration,title:"Most heavy queries",columns:[{key:"query"},{key:"avgDurationSeconds",title:"avg duration, sec"},{key:"timeRange",sortBy:"timeRangeSeconds",title:"query time interval"},{key:"count"}],defaultOrderBy:"avgDurationSeconds"}),Ht(ed,{rows:s.topBySumDuration,title:"Queries with most summary time to execute",columns:[{key:"query"},{key:"sumDurationSeconds",title:"sum duration, sec"},{key:"timeRange",sortBy:"timeRangeSeconds",title:"query time interval"},{key:"count"}],defaultOrderBy:"sumDurationSeconds"})]})})]})},nd={"color-primary":"#589DF6","color-secondary":"#316eca","color-error":"#e5534b","color-warning":"#c69026","color-info":"#539bf5","color-success":"#57ab5a","color-background-body":"#22272e","color-background-block":"#2d333b","color-background-tooltip":"rgba(22, 22, 22, 0.8)","color-text":"#cdd9e5","color-text-secondary":"#768390","color-text-disabled":"#636e7b","box-shadow":"rgba(0, 0, 0, 0.16) 1px 2px 6px","box-shadow-popper":"rgba(0, 0, 0, 0.2) 0px 2px 8px 0px","border-divider":"1px solid rgba(99, 110, 123, 0.5)","color-hover-black":"rgba(0, 0, 0, 0.12)"},rd={"color-primary":"#3F51B5","color-secondary":"#E91E63","color-error":"#FD080E","color-warning":"#FF8308","color-info":"#03A9F4","color-success":"#4CAF50","color-background-body":"#FEFEFF","color-background-block":"#FFFFFF","color-background-tooltip":"rgba(97,97,97, 0.92)","color-text":"#110f0f","color-text-secondary":"#706F6F","color-text-disabled":"#A09F9F","box-shadow":"rgba(0, 0, 0, 0.08) 1px 2px 6px","box-shadow-popper":"rgba(0, 0, 0, 0.1) 0px 2px 8px 0px","border-divider":"1px solid rgba(0, 0, 0, 0.15)","color-hover-black":"rgba(0, 0, 0, 0.06)"},id=function(){var e=v((0,r.useState)(Pt()),2),t=e[0],n=e[1],i=function(e){n(e.matches)};return(0,r.useEffect)((function(){var e=window.matchMedia("(prefers-color-scheme: dark)");return e.addEventListener("change",i),function(){return e.removeEventListener("change",i)}}),[]),t},ad=["primary","secondary","error","warning","info","success"],od=function(e){var t,n=e.onLoaded,i=vt(),a=pt().palette,o=void 0===a?{}:a,l=Yt().theme,u=id(),c=Vt(),s=Mr(),f=v((0,r.useState)((lt(t={},Tt.dark,nd),lt(t,Tt.light,rd),lt(t,Tt.system,Pt()?nd:rd),t)),2),d=f[0],h=f[1],m=function(){var e=window,t=e.innerWidth,n=e.innerHeight,r=document.documentElement,i=r.clientWidth,a=r.clientHeight;It("scrollbar-width","".concat(t-i,"px")),It("scrollbar-height","".concat(n-a,"px")),It("vh","".concat(.01*n,"px"))},p=function(){ad.forEach((function(e,t){var r=function(e){var t=e.replace("#","").trim();if(3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6!==t.length)throw new Error("Invalid HEX color.");return(299*parseInt(t.slice(0,2),16)+587*parseInt(t.slice(2,4),16)+114*parseInt(t.slice(4,6),16))/1e3>=128?"#000000":"#FFFFFF"}(Ot("color-".concat(e)));It("".concat(e,"-text"),r),t===ad.length-1&&(c({type:"SET_DARK_THEME"}),n(!0))}))},g=function(){var e=Nt("THEME")||Tt.system,t=d[e];Object.entries(t).forEach((function(e){var t=v(e,2),n=t[0],r=t[1];It(n,r)})),p(),i&&(ad.forEach((function(e){var t=o[e];t&&It("color-".concat(e),t)})),p())};return(0,r.useEffect)((function(){m(),g()}),[d]),(0,r.useEffect)(m,[s]),(0,r.useEffect)((function(){var e=Pt()?nd:rd;d[Tt.system]!==e?h((function(t){return ct(ct({},t),{},lt({},Tt.system,e))})):g()}),[l,u]),(0,r.useEffect)((function(){i&&c({type:"SET_THEME",payload:Tt.light})}),[]),null},ld=function(){var e=v((0,r.useState)([]),2),t=e[0],n=e[1],i=v((0,r.useState)(!1),2),a=i[0],o=i[1],l=(0,r.useRef)(document.body),u=function(e){e.preventDefault(),e.stopPropagation(),"dragenter"===e.type||"dragover"===e.type?o(!0):"dragleave"===e.type&&o(!1)};return Nr("dragenter",u,l),Nr("dragleave",u,l),Nr("dragover",u,l),Nr("drop",(function(e){var t;e.preventDefault(),e.stopPropagation(),o(!1),null!==e&&void 0!==e&&null!==(t=e.dataTransfer)&&void 0!==t&&t.files&&e.dataTransfer.files[0]&&function(e){var t=Array.from(e||[]);n(t)}(e.dataTransfer.files)}),l),Nr("paste",(function(e){var t,r=null===(t=e.clipboardData)||void 0===t?void 0:t.items;if(r){var i=Array.from(r).filter((function(e){return"application/json"===e.type})).map((function(e){return e.getAsFile()})).filter((function(e){return null!==e}));n(i)}}),l),{files:t,dragging:a}},ud=function(e){var t=e.onOpenModal,n=e.onChange;return Ht("div",{className:"vm-trace-page-controls",children:[Ht(oi,{variant:"outlined",onClick:t,children:"Paste JSON"}),Ht(mi,{title:"The file must contain tracing information in JSON format",children:Ht(oi,{children:["Upload Files",Ht("input",{id:"json",type:"file",accept:"application/json",multiple:!0,title:" ",onChange:n})]})})]})},cd=function(){var e=v((0,r.useState)([]),2),t=e[0],n=e[1],i=v((0,r.useState)([]),2),a=i[0],o=i[1],l=(0,r.useMemo)((function(){return!!t.length}),[t]),u=li(!1),c=u.value,s=u.setTrue,f=u.setFalse,d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";o((function(n){return[{filename:t,text:": ".concat(e.message)}].concat(_(n))}))},h=function(e,t){try{var r=JSON.parse(e),i=r.trace||r;if(!i.duration_msec)return void d(new Error(Ft.traceNotFound),t);var a=new hs(i,t);n((function(e){return[a].concat(_(e))}))}catch(o){o instanceof Error&&d(o,t)}},m=function(e){e.map((function(e){var t=new FileReader,n=(null===e||void 0===e?void 0:e.name)||"";t.onload=function(e){var t,r=String(null===(t=e.target)||void 0===t?void 0:t.result);h(r,n)},t.readAsText(e)}))},p=function(e){o([]);var t=Array.from(e.target.files||[]);m(t),e.target.value=""},g=function(e){return function(){!function(e){o((function(t){return t.filter((function(t,n){return n!==e}))}))}(e)}},y=ld(),b=y.files,C=y.dragging;return(0,r.useEffect)((function(){m(b)}),[b]),Ht("div",{className:"vm-trace-page",children:[Ht("div",{className:"vm-trace-page-header",children:[Ht("div",{className:"vm-trace-page-header-errors",children:a.map((function(e,t){return Ht("div",{className:"vm-trace-page-header-errors-item",children:[Ht(Kr,{variant:"error",children:[Ht("b",{className:"vm-trace-page-header-errors-item__filename",children:e.filename}),Ht("span",{children:e.text})]}),Ht(oi,{className:"vm-trace-page-header-errors-item__close",startIcon:Ht(Hn,{}),variant:"text",color:"error",onClick:g(t)})]},"".concat(e,"_").concat(t))}))}),Ht("div",{children:l&&Ht(ud,{onOpenModal:s,onChange:p})})]}),l&&Ht("div",{children:Ht(ws,{jsonEditor:!0,traces:t,onDeleteClick:function(e){var r=t.filter((function(t){return t.idValue!==e.idValue}));n(_(r))}})}),!l&&Ht("div",{className:"vm-trace-page-preview",children:[Ht("p",{className:"vm-trace-page-preview__text",children:["Please, upload file with JSON response content.","\n","The file must contain tracing information in JSON format.","\n","In order to use tracing please refer to the doc:\xa0",Ht("a",{className:"vm-link vm-link_colored",href:"https://docs.victoriametrics.com/#query-tracing",target:"_blank",rel:"help noreferrer",children:"https://docs.victoriametrics.com/#query-tracing"}),"\n","Tracing graph will be displayed after file upload.","\n","Attach files by dragging & dropping, selecting or pasting them."]}),Ht(ud,{onOpenModal:s,onChange:p})]}),c&&Ht(hi,{title:"Paste JSON",onClose:f,children:Ht(Ds,{editable:!0,displayTitle:!0,defaultTile:"JSON ".concat(t.length+1),onClose:f,onUpload:h})}),C&&Ht("div",{className:"vm-trace-page__dropzone"})]})},sd=function(e){var t=Yt().serverUrl,n=Nn().period,i=v((0,r.useState)([]),2),a=i[0],o=i[1],l=v((0,r.useState)(!1),2),u=l[0],c=l[1],s=v((0,r.useState)(),2),f=s[0],d=s[1],h=(0,r.useMemo)((function(){return function(e,t,n){var r="{job=".concat(JSON.stringify(n),"}");return"".concat(e,"/api/v1/label/instance/values?match[]=").concat(encodeURIComponent(r),"&start=").concat(t.start,"&end=").concat(t.end)}(t,n,e)}),[t,n,e]);return(0,r.useEffect)((function(){if(e){var t=function(){var e=sa(ua().mark((function e(){var t,n,r;return ua().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c(!0),e.prev=1,e.next=4,fetch(h);case 4:return t=e.sent,e.next=7,t.json();case 7:n=e.sent,r=n.data||[],o(r.sort((function(e,t){return e.localeCompare(t)}))),t.ok?d(void 0):d("".concat(n.errorType,"\r\n").concat(null===n||void 0===n?void 0:n.error)),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),e.t0 instanceof Error&&d("".concat(e.t0.name,": ").concat(e.t0.message));case 16:c(!1);case 17:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(){return e.apply(this,arguments)}}();t().catch(console.error)}}),[h]),{instances:a,isLoading:u,error:f}},fd=function(e,t){var n=Yt().serverUrl,i=Nn().period,a=v((0,r.useState)([]),2),o=a[0],l=a[1],u=v((0,r.useState)(!1),2),c=u[0],s=u[1],f=v((0,r.useState)(),2),d=f[0],h=f[1],m=(0,r.useMemo)((function(){return function(e,t,n,r){var i=Object.entries({job:n,instance:r}).filter((function(e){return e[1]})).map((function(e){var t=v(e,2),n=t[0],r=t[1];return"".concat(n,"=").concat(JSON.stringify(r))})).join(","),a="{".concat(i,"}");return"".concat(e,"/api/v1/label/__name__/values?match[]=").concat(encodeURIComponent(a),"&start=").concat(t.start,"&end=").concat(t.end)}(n,i,e,t)}),[n,i,e,t]);return(0,r.useEffect)((function(){if(e){var t=function(){var e=sa(ua().mark((function e(){var t,n,r;return ua().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s(!0),e.prev=1,e.next=4,fetch(m);case 4:return t=e.sent,e.next=7,t.json();case 7:n=e.sent,r=n.data||[],l(r.sort((function(e,t){return e.localeCompare(t)}))),t.ok?h(void 0):h("".concat(n.errorType,"\r\n").concat(null===n||void 0===n?void 0:n.error)),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),e.t0 instanceof Error&&h("".concat(e.t0.name,": ").concat(e.t0.message));case 16:s(!1);case 17:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(){return e.apply(this,arguments)}}();t().catch(console.error)}}),[m]),{names:o,isLoading:c,error:d}},dd=function(e){var t=e.name,n=e.job,i=e.instance,a=e.rateEnabled,o=e.isBucket,l=e.height,u=Qr().isMobile,c=Ur(),s=c.customStep,f=c.yaxis,d=Nn().period,h=qr(),m=Mn(),p=un(d.end-d.start),g=ln(s),y=dn(10*g*1e3),_=v((0,r.useState)(!1),2),b=_[0],C=_[1],D=b&&s===p?y:s,w=li(!1),k=w.value,x=w.setTrue,S=(0,r.useMemo)((function(){var e=Object.entries({job:n,instance:i}).filter((function(e){return e[1]})).map((function(e){var t=v(e,2),n=t[0],r=t[1];return"".concat(n,"=").concat(JSON.stringify(r))}));e.push("__name__=".concat(JSON.stringify(t))),"node_cpu_seconds_total"==t&&e.push('mode!="idle"');var r="{".concat(e.join(","),"}");if(o)return"sum(rate(".concat(r,")) by (vmrange, le)");var l=a?"rollup_rate(".concat(r,")"):"rollup(".concat(r,")");return"\nwith (q = ".concat(l,') (\n alias(min(label_match(q, "rollup", "min")), "min"),\n alias(max(label_match(q, "rollup", "max")), "max"),\n alias(avg(label_match(q, "rollup", "avg")), "avg"),\n)')}),[t,n,i,a,o]),E=ms({predefinedQuery:[S],visible:!0,customStep:D,showAllSeries:k}),A=E.isLoading,N=E.graphData,M=E.error,F=E.warning,T=E.isHistogram;return(0,r.useEffect)((function(){C(T)}),[T]),Ht("div",{className:wr()({"vm-explore-metrics-graph":!0,"vm-explore-metrics-graph_mobile":u}),children:[A&&Ht(_s,{}),M&&Ht(Kr,{variant:"error",children:M}),F&&Ht(Kr,{variant:"warning",children:Ht("div",{className:"vm-explore-metrics-graph__warning",children:[Ht("p",{children:F}),Ht(oi,{color:"warning",variant:"outlined",onClick:x,children:"Show all"})]})}),N&&d&&Ht(es,{data:N,period:d,customStep:D,query:[S],yaxis:f,setYaxisLimits:function(e){h({type:"SET_YAXIS_LIMITS",payload:e})},setPeriod:function(e){var t=e.from,n=e.to;m({type:"SET_PERIOD",payload:{from:t,to:n}})},showLegend:!1,height:l,isHistogram:T})]})},hd=function(e){var t=e.name,n=e.index,r=e.length,i=e.isBucket,a=e.rateEnabled,o=e.onChangeRate,l=e.onRemoveItem,u=e.onChangeOrder,c=Qr().isMobile,s=li(!1),f=s.value,d=s.setTrue,h=s.setFalse,m=function(){l(t)},p=function(){u(t,n,n+1)},v=function(){u(t,n,n-1)};return Ht("div",c?{className:"vm-explore-metrics-item-header vm-explore-metrics-item-header_mobile",children:[Ht("div",{className:"vm-explore-metrics-item-header__name",children:t}),Ht(oi,{variant:"text",size:"small",startIcon:Ht(yr,{}),onClick:d}),f&&Ht(hi,{title:t,onClose:h,children:Ht("div",{className:"vm-explore-metrics-item-header-modal",children:[Ht("div",{className:"vm-explore-metrics-item-header-modal-order",children:[Ht(oi,{startIcon:Ht(lr,{}),variant:"outlined",onClick:v,disabled:0===n}),Ht("p",{children:["position:",Ht("span",{className:"vm-explore-metrics-item-header-modal-order__index",children:["#",n+1]})]}),Ht(oi,{endIcon:Ht(or,{}),variant:"outlined",onClick:p,disabled:n===r-1})]}),!i&&Ht("div",{className:"vm-explore-metrics-item-header-modal__rate",children:[Ht(rs,{label:Ht("span",{children:["enable ",Ht("code",{children:"rate()"})]}),value:a,onChange:o,fullWidth:!0}),Ht("p",{children:"calculates the average per-second speed of metrics change"})]}),Ht(oi,{startIcon:Ht(Hn,{}),color:"error",variant:"outlined",onClick:m,fullWidth:!0,children:"Remove graph"})]})})]}:{className:"vm-explore-metrics-item-header",children:[Ht("div",{className:"vm-explore-metrics-item-header-order",children:[Ht(mi,{title:"move graph up",children:Ht(oi,{className:"vm-explore-metrics-item-header-order__up",startIcon:Ht(Zn,{}),variant:"text",color:"gray",size:"small",onClick:v})}),Ht("div",{className:"vm-explore-metrics-item-header__index",children:["#",n+1]}),Ht(mi,{title:"move graph down",children:Ht(oi,{className:"vm-explore-metrics-item-header-order__down",startIcon:Ht(Zn,{}),variant:"text",color:"gray",size:"small",onClick:p})})]}),Ht("div",{className:"vm-explore-metrics-item-header__name",children:t}),!i&&Ht("div",{className:"vm-explore-metrics-item-header__rate",children:Ht(mi,{title:"calculates the average per-second speed of metric's change",children:Ht(rs,{label:Ht("span",{children:["enable ",Ht("code",{children:"rate()"})]}),value:a,onChange:o})})}),Ht("div",{className:"vm-explore-metrics-item-header__close",children:Ht(mi,{title:"close graph",children:Ht(oi,{startIcon:Ht(Hn,{}),variant:"text",color:"gray",size:"small",onClick:m})})})]})},md=function(e){var t=e.name,n=e.job,i=e.instance,a=e.index,o=e.length,l=e.size,u=e.onRemoveItem,c=e.onChangeOrder,s=(0,r.useMemo)((function(){return/_sum?|_total?|_count?/.test(t)}),[t]),f=(0,r.useMemo)((function(){return/_bucket?/.test(t)}),[t]),d=v((0,r.useState)(s),2),h=d[0],m=d[1],p=Mr(),g=(0,r.useMemo)(l.height,[l,p]);return(0,r.useEffect)((function(){m(s)}),[n]),Ht("div",{className:"vm-explore-metrics-item vm-block vm-block_empty-padding",children:[Ht(hd,{name:t,index:a,length:o,isBucket:f,rateEnabled:h,size:l.id,onChangeRate:m,onRemoveItem:u,onChangeOrder:c}),Ht(dd,{name:t,job:n,instance:i,rateEnabled:h,isBucket:f,height:g},"".concat(t,"_").concat(n,"_").concat(i,"_").concat(h))]})},pd=function(e){var t=e.values,n=e.onRemoveItem,r=Qr().isMobile;return r?Ht("span",{className:"vm-select-input-content__counter",children:["selected ",t.length]}):Ht(zt.HY,{children:t.map((function(e){return Ht("div",{className:"vm-select-input-content__selected",children:[Ht("span",{children:e}),Ht("div",{onClick:(t=e,function(e){n(t),e.stopPropagation()}),children:Ht(Hn,{})})]},e);var t}))})},vd=function(e){var t=e.value,n=e.list,i=e.label,a=e.placeholder,o=e.noOptionsText,l=e.clearable,u=void 0!==l&&l,c=e.searchable,s=void 0!==c&&c,f=e.autofocus,d=e.onChange,h=Yt().isDarkTheme,m=Qr().isMobile,p=v((0,r.useState)(""),2),g=p[0],y=p[1],_=(0,r.useRef)(null),b=v((0,r.useState)(!1),2),C=b[0],D=b[1],w=(0,r.useRef)(null),k=Array.isArray(t),x=Array.isArray(t)?t:void 0,S=m&&k&&!(null===x||void 0===x||!x.length),E=(0,r.useMemo)((function(){return C?g:Array.isArray(t)?"":t}),[t,g,C,k]),A=(0,r.useMemo)((function(){return C?g||"(.+)":""}),[g,C]),N=function(){w.current&&w.current.blur()},M=function(e){d(e),k||(D(!1),N()),k&&w.current&&w.current.focus()};return(0,r.useEffect)((function(){y(""),C&&w.current&&w.current.focus(),C||N()}),[C,w]),(0,r.useEffect)((function(){f&&w.current&&!m&&w.current.focus()}),[f,w]),Nr("keyup",(function(e){w.current!==e.target&&D(!1)})),Ht("div",{className:wr()({"vm-select":!0,"vm-select_dark":h}),children:[Ht("div",{className:"vm-select-input",onClick:function(e){e.target instanceof HTMLInputElement||D((function(e){return!e}))},ref:_,children:[Ht("div",{className:"vm-select-input-content",children:[!(null===x||void 0===x||!x.length)&&Ht(pd,{values:x,onRemoveItem:M}),!S&&Ht("input",{value:E,type:"text",placeholder:a,onInput:function(e){y(e.target.value)},onFocus:function(){D(!0)},ref:w,readOnly:m||!s})]}),i&&Ht("span",{className:"vm-text-field__label",children:i}),u&&t&&Ht("div",{className:"vm-select-input__icon",onClick:function(e){return function(t){M(e),t.stopPropagation()}}(""),children:Ht(Hn,{})}),Ht("div",{className:wr()({"vm-select-input__icon":!0,"vm-select-input__icon_open":C}),children:Ht(Qn,{})})]}),Ht(ts,{label:i,value:A,options:n,anchor:_,selected:x,maxWords:10,minLength:0,fullWidth:!0,noOptionsText:o,onSelect:M,onOpenAutocomplete:D})]})},gd=St.map((function(e){return e.id})),yd=function(e){var t=e.jobs,n=e.instances,i=e.names,a=e.job,o=e.instance,l=e.size,u=e.selectedMetrics,c=e.onChangeJob,s=e.onChangeInstance,f=e.onToggleMetric,d=e.onChangeSize,h=(0,r.useMemo)((function(){return a?"":"No instances. Please select job"}),[a]),m=(0,r.useMemo)((function(){return a?"":"No metric names. Please select job"}),[a]),p=Qr().isMobile;return Ht("div",{className:wr()({"vm-explore-metrics-header":!0,"vm-explore-metrics-header_mobile":p,"vm-block":!0,"vm-block_mobile":p}),children:[Ht("div",{className:"vm-explore-metrics-header__job",children:Ht(vd,{value:a,list:t,label:"Job",placeholder:"Please select job",onChange:c,autofocus:!a,searchable:!0})}),Ht("div",{className:"vm-explore-metrics-header__instance",children:Ht(vd,{value:o,list:n,label:"Instance",placeholder:"Please select instance",onChange:s,noOptionsText:h,clearable:!0,searchable:!0})}),Ht("div",{className:"vm-explore-metrics-header__size",children:Ht(vd,{label:"Size graphs",value:l,list:gd,onChange:d})}),Ht("div",{className:"vm-explore-metrics-header-metrics",children:Ht(vd,{label:"Metrics",value:u,list:i,placeholder:"Search metric name",onChange:f,noOptionsText:m,clearable:!0,searchable:!0})})]})},_d=Et("job",""),bd=Et("instance",""),Cd=Et("metrics",""),Dd=Et("size",""),wd=St.find((function(e){return Dd?e.id===Dd:e.isDefault}))||St[0],kd=function(){var e=v((0,r.useState)(_d),2),t=e[0],n=e[1],i=v((0,r.useState)(bd),2),a=i[0],o=i[1],l=v((0,r.useState)(Cd?Cd.split("&"):[]),2),u=l[0],c=l[1],s=v((0,r.useState)(wd),2),f=s[0],d=s[1];!function(e){var t=e.job,n=e.instance,i=e.metrics,a=e.size,o=Nn(),l=o.duration,u=o.relativeTime,c=o.period.date,s=Ur().customStep,f=Wi().setSearchParamsFromKeys,d=function(){var e,r=Es((lt(e={},"g0.range_input",l),lt(e,"g0.end_input",c),lt(e,"g0.step_input",s),lt(e,"g0.relative_time",u),lt(e,"size",a),lt(e,"job",t),lt(e,"instance",n),lt(e,"metrics",i),e));f(r)};(0,r.useEffect)(d,[l,u,c,s,t,n,i,a]),(0,r.useEffect)(d,[])}({job:t,instance:a,metrics:u.join("&"),size:f.id});var h=function(){var e=Yt().serverUrl,t=Nn().period,n=v((0,r.useState)([]),2),i=n[0],a=n[1],o=v((0,r.useState)(!1),2),l=o[0],u=o[1],c=v((0,r.useState)(),2),s=c[0],f=c[1],d=(0,r.useMemo)((function(){return function(e,t){return"".concat(e,"/api/v1/label/job/values?start=").concat(t.start,"&end=").concat(t.end)}(e,t)}),[e,t]);return(0,r.useEffect)((function(){var e=function(){var e=sa(ua().mark((function e(){var t,n,r;return ua().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u(!0),e.prev=1,e.next=4,fetch(d);case 4:return t=e.sent,e.next=7,t.json();case 7:n=e.sent,r=n.data||[],a(r.sort((function(e,t){return e.localeCompare(t)}))),t.ok?f(void 0):f("".concat(n.errorType,"\r\n").concat(null===n||void 0===n?void 0:n.error)),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),e.t0 instanceof Error&&f("".concat(e.t0.name,": ").concat(e.t0.message));case 16:u(!1);case 17:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(){return e.apply(this,arguments)}}();e().catch(console.error)}),[d]),{jobs:i,isLoading:l,error:s}}(),m=h.jobs,p=h.isLoading,g=h.error,y=sd(t),b=y.instances,C=y.isLoading,D=y.error,w=fd(t,a),k=w.names,x=w.isLoading,S=w.error,E=(0,r.useMemo)((function(){return p||C||x}),[p,C,x]),A=(0,r.useMemo)((function(){return g||D||S}),[g,D,S]),N=function(e){c(e?function(t){return t.includes(e)?t.filter((function(t){return t!==e})):[].concat(_(t),[e])}:[])},M=function(e,t,n){var r=n>u.length-1;n<0||r||c((function(e){var r=_(e),i=v(r.splice(t,1),1)[0];return r.splice(n,0,i),r}))};return(0,r.useEffect)((function(){a&&b.length&&!b.includes(a)&&o("")}),[b,a]),Ht("div",{className:"vm-explore-metrics",children:[Ht(yd,{jobs:m,instances:b,names:k,job:t,size:f.id,instance:a,selectedMetrics:u,onChangeJob:n,onChangeSize:function(e){var t=St.find((function(t){return t.id===e}));t&&d(t)},onChangeInstance:o,onToggleMetric:N}),E&&Ht(_s,{}),A&&Ht(Kr,{variant:"error",children:A}),!t&&Ht(Kr,{variant:"info",children:"Please select job to see list of metric names."}),t&&!u.length&&Ht(Kr,{variant:"info",children:"Please select metric names to see the graphs."}),Ht("div",{className:"vm-explore-metrics-body",children:u.map((function(e,n){return Ht(md,{name:e,job:t,instance:a,index:n,length:u.length,size:f,onRemoveItem:N,onChangeOrder:M},e)}))})]})},xd=function(){var t=Fc();return Ht("div",{className:"vm-preview-icons",children:Object.entries(e).map((function(e){var n,r=v(e,2),i=r[0],a=r[1];return Ht("div",{className:"vm-preview-icons-item",onClick:(n=i,sa(ua().mark((function e(){return ua().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t("<".concat(n,"/>"),"<".concat(n,"/> has been copied"));case 2:case"end":return e.stop()}}),e)})))),children:[Ht("div",{className:"vm-preview-icons-item__svg",children:a()}),Ht("div",{className:"vm-preview-icons-item__name",children:"<".concat(i,"/>")})]},i)}))})},Sd=function(e){return e.copy="Copy",e.copied="Copied",e}(Sd||{}),Ed=function(e){var t=e.code,n=v((0,r.useState)(Sd.copy),2),i=n[0],a=n[1];return(0,r.useEffect)((function(){var e=null;return i===Sd.copied&&(e=setTimeout((function(){return a(Sd.copy)}),1e3)),function(){e&&clearTimeout(e)}}),[i]),Ht("code",{className:"vm-code-example",children:[t,Ht("div",{className:"vm-code-example__copy",children:Ht(mi,{title:i,children:Ht(oi,{size:"small",variant:"text",onClick:function(){navigator.clipboard.writeText(t),a(Sd.copied)},startIcon:Ht(fr,{})})})})]})},Ad=function(){return Ht("a",{className:"vm-link vm-link_colored",href:"https://docs.victoriametrics.com/MetricsQL.html",target:"_blank",rel:"help noreferrer",children:"MetricsQL"})},Nd=function(){return Ht("a",{className:"vm-link vm-link_colored",href:"https://grafana.com/grafana/dashboards/1860-node-exporter-full/",target:"_blank",rel:"help noreferrer",children:"Node Exporter Full"})},Md=function(){return Ht("section",{className:"vm-with-template-tutorial",children:[Ht("h2",{className:"vm-with-template-tutorial__title",children:["Tutorial for WITH expressions in ",Ht(Ad,{})]}),Ht("div",{className:"vm-with-template-tutorial-section",children:[Ht("p",{className:"vm-with-template-tutorial-section__text",children:["Let's look at the following real query from ",Ht(Nd,{})," dashboard:"]}),Ht(Ed,{code:'(\n (\n node_memory_MemTotal_bytes{instance=~"$node:$port", job=~"$job"}\n -\n node_memory_MemFree_bytes{instance=~"$node:$port", job=~"$job"}\n )\n /\n node_memory_MemTotal_bytes{instance=~"$node:$port", job=~"$job"}\n) * 100'}),Ht("p",{className:"vm-with-template-tutorial-section__text",children:"It is clear the query calculates the percentage of used memory for the given $node, $port and $job. Isn't it? :)"})]}),Ht("div",{className:"vm-with-template-tutorial-section",children:[Ht("p",{className:"vm-with-template-tutorial-section__text",children:"What's wrong with this query? Copy-pasted label filters for distinct timeseries which makes it easy to mistype these filters during modification. Let's simplify the query with WITH expressions:"}),Ht(Ed,{code:'WITH (\n commonFilters = {instance=~"$node:$port",job=~"$job"}\n)\n(\n node_memory_MemTotal_bytes{commonFilters}\n -\n node_memory_MemFree_bytes{commonFilters}\n)\n /\nnode_memory_MemTotal_bytes{commonFilters} * 100'})]}),Ht("div",{className:"vm-with-template-tutorial-section",children:[Ht("p",{className:"vm-with-template-tutorial-section__text",children:["Now label filters are located in a single place instead of three distinct places. The query mentions node_memory_MemTotal_bytes metric twice and ","{commonFilters}"," three times. WITH expressions may improve this:"]}),Ht(Ed,{code:'WITH (\n my_resource_utilization(free, limit, filters) = (limit{filters} - free{filters}) / limit{filters} * 100\n)\nmy_resource_utilization(\n node_memory_MemFree_bytes,\n node_memory_MemTotal_bytes,\n {instance=~"$node:$port",job=~"$job"},\n)'}),Ht("p",{className:"vm-with-template-tutorial-section__text",children:"Now the template function my_resource_utilization() may be used for monitoring arbitrary resources - memory, CPU, network, storage, you name it."})]}),Ht("div",{className:"vm-with-template-tutorial-section",children:[Ht("p",{className:"vm-with-template-tutorial-section__text",children:["Let's take another nice query from ",Ht(Nd,{})," dashboard:"]}),Ht(Ed,{code:'(\n (\n (\n count(\n count(node_cpu_seconds_total{instance=~"$node:$port",job=~"$job"}) by (cpu)\n )\n )\n -\n avg(\n sum by (mode) (rate(node_cpu_seconds_total{mode=\'idle\',instance=~"$node:$port",job=~"$job"}[5m]))\n )\n )\n *\n 100\n)\n /\ncount(\n count(node_cpu_seconds_total{instance=~"$node:$port",job=~"$job"}) by (cpu)\n)'}),Ht("p",{className:"vm-with-template-tutorial-section__text",children:"Do you understand what does this mess do? Is it manageable? :) WITH expressions are happy to help in a few iterations."})]}),Ht("div",{className:"vm-with-template-tutorial-section",children:[Ht("p",{className:"vm-with-template-tutorial-section__text",children:"1. Extract common filters used in multiple places into a commonFilters variable:"}),Ht(Ed,{code:'WITH (\n commonFilters = {instance=~"$node:$port",job=~"$job"}\n)\n(\n (\n (\n count(\n count(node_cpu_seconds_total{commonFilters}) by (cpu)\n )\n )\n -\n avg(\n sum by (mode) (rate(node_cpu_seconds_total{mode=\'idle\',commonFilters}[5m]))\n )\n )\n *\n 100\n)\n /\ncount(\n count(node_cpu_seconds_total{commonFilters}) by (cpu)\n)'})]}),Ht("div",{className:"vm-with-template-tutorial-section",children:[Ht("p",{className:"vm-with-template-tutorial-section__text",children:'2. Extract "count(count(...) by (cpu))" into cpuCount variable:'}),Ht(Ed,{code:'WITH (\n commonFilters = {instance=~"$node:$port",job=~"$job"},\n cpuCount = count(count(node_cpu_seconds_total{commonFilters}) by (cpu))\n)\n(\n (\n cpuCount\n -\n avg(\n sum by (mode) (rate(node_cpu_seconds_total{mode=\'idle\',commonFilters}[5m]))\n )\n )\n *\n 100\n) / cpuCount'})]}),Ht("div",{className:"vm-with-template-tutorial-section",children:[Ht("p",{className:"vm-with-template-tutorial-section__text",children:"3. Extract rate(...) part into cpuIdle variable, since it is clear now that this part calculates the number of idle CPUs:"}),Ht(Ed,{code:'WITH (\n commonFilters = {instance=~"$node:$port",job=~"$job"},\n cpuCount = count(count(node_cpu_seconds_total{commonFilters}) by (cpu)),\n cpuIdle = sum(rate(node_cpu_seconds_total{mode=\'idle\',commonFilters}[5m]))\n)\n((cpuCount - cpuIdle) * 100) / cpuCount'})]}),Ht("div",{className:"vm-with-template-tutorial-section",children:[Ht("p",{className:"vm-with-template-tutorial-section__text",children:["4. Put node_cpu_seconds_total","{commonFilters}"," into its own varialbe with the name cpuSeconds:"]}),Ht(Ed,{code:'WITH (\n cpuSeconds = node_cpu_seconds_total{instance=~"$node:$port",job=~"$job"},\n cpuCount = count(count(cpuSeconds) by (cpu)),\n cpuIdle = sum(rate(cpuSeconds{mode=\'idle\'}[5m]))\n)\n((cpuCount - cpuIdle) * 100) / cpuCount'}),Ht("p",{className:"vm-with-template-tutorial-section__text",children:"Now the query became more clear comparing to the initial query."})]}),Ht("div",{className:"vm-with-template-tutorial-section",children:[Ht("p",{className:"vm-with-template-tutorial-section__text",children:"WITH expressions may be nested and may be put anywhere. Try expanding the following query:"}),Ht(Ed,{code:"WITH (\n f(a, b) = WITH (\n f1(x) = b-x,\n f2(x) = x+x\n ) f1(a)*f2(b)\n) f(foo, with(x=bar) x)"})]})]})},Fd=function(e,t){return"".concat(e,"/expand-with-exprs?query=").concat(t,"&format=json")},Td=function(){var e=function(){var e=Yt().serverUrl,t=v((0,r.useState)(""),2),n=t[0],i=t[1],a=v((0,r.useState)(!1),2),o=a[0],l=a[1],u=v((0,r.useState)(),2),c=u[0],s=u[1],f=function(){var t=sa(ua().mark((function t(n){var r,a,o;return ua().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Fd(e,n),l(!0),t.prev=2,t.next=5,fetch(r);case 5:return a=t.sent,t.next=8,a.json();case 8:o=t.sent,i((null===o||void 0===o?void 0:o.expr)||""),s(String(o.error||"")),t.next=16;break;case 13:t.prev=13,t.t0=t.catch(2),t.t0 instanceof Error&&"AbortError"!==t.t0.name&&s("".concat(t.t0.name,": ").concat(t.t0.message));case 16:l(!1);case 17:case"end":return t.stop()}}),t,null,[[2,13]])})));return function(e){return t.apply(this,arguments)}}();return{data:n,error:c,loading:o,expand:f}}(),t=e.data,n=e.loading,i=e.error,a=e.expand,o=v((0,r.useState)(""),2),l=o[0],u=o[1];return Ht("section",{className:"vm-with-template",children:[n&&Ht(_s,{}),Ht("div",{className:"vm-with-template-body vm-block",children:[Ht("div",{className:"vm-with-template-body__expr",children:Ht(Ai,{type:"textarea",label:"MetricsQL query with optional WITH expressions",value:l,error:i,autofocus:!0,onChange:function(e){u(e)}})}),Ht("div",{className:"vm-with-template-body__result",children:Ht(Ai,{type:"textarea",label:"MetricsQL query after expanding WITH expressions and applying other optimizations",value:t,disabled:!0})}),Ht("div",{className:"vm-with-template-body-top",children:Ht(oi,{variant:"contained",onClick:function(){a(l)},startIcon:Ht(er,{}),children:"Expand"})})]}),Ht("div",{className:"vm-block",children:Ht(Md,{})})]})},Od=function(e,t,n){var r=["format=json","relabel_configs=".concat(encodeURIComponent(t)),"metric=".concat(encodeURIComponent(n))];return"".concat(e,"/metric-relabel-debug?").concat(r.join("&"))},Id='- if: \'{bar_label=~"b.*"}\'\n source_labels: [foo_label, bar_label]\n separator: "_"\n target_label: foobar\n- action: labeldrop\n regex: "foo_.*"\n- target_label: job\n replacement: "my-application-2"',Pd='{__name__="my_metric", bar_label="bar", foo_label="foo", job="my-application", instance="192.168.0.1"}',Ld=function(){var e=v(at(),2),t=e[0],n=e[1],i=function(){var e=Yt().serverUrl,t=v((0,r.useState)(null),2),n=t[0],i=t[1],a=v((0,r.useState)(!1),2),o=a[0],l=a[1],u=v((0,r.useState)(),2),c=u[0],s=u[1],f=function(){var t=sa(ua().mark((function t(n,r){var a,o,u;return ua().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=Od(e,n,r),l(!0),t.prev=2,t.next=5,fetch(a);case 5:return o=t.sent,t.next=8,o.json();case 8:u=t.sent,i(u.error?null:u),s(String(u.error||"")),t.next=16;break;case 13:t.prev=13,t.t0=t.catch(2),t.t0 instanceof Error&&"AbortError"!==t.t0.name&&s("".concat(t.t0.name,": ").concat(t.t0.message));case 16:l(!1);case 17:case"end":return t.stop()}}),t,null,[[2,13]])})));return function(e,n){return t.apply(this,arguments)}}();return{data:n,error:c,loading:o,fetchData:f}}(),a=i.data,o=i.loading,l=i.error,u=i.fetchData,c=v(Pf("","config"),2),s=c[0],f=c[1],d=v(Pf("","labels"),2),h=d[0],m=d[1];return(0,r.useEffect)((function(){var e=t.get("config")||"",n=t.get("labels")||"";(n||e)&&(u(e,n),f(e),m(n))}),[]),Ht("section",{className:"vm-relabeling",children:[o&&Ht(_s,{}),Ht("div",{className:"vm-relabeling-header vm-block",children:[Ht("div",{className:"vm-relabeling-header__configs",children:Ht(Ai,{type:"textarea",label:"Relabel configs",value:s,autofocus:!0,onChange:function(e){f(e)}})}),Ht("div",{className:"vm-relabeling-header__labels",children:Ht(Ai,{type:"textarea",label:"Labels",value:h,onChange:function(e){m(e)}})}),Ht("div",{className:"vm-relabeling-header-bottom",children:[Ht("a",{className:"vm-link vm-link_with-icon",target:"_blank",href:"https://docs.victoriametrics.com/relabeling.html",rel:"help noreferrer",children:[Ht(Yn,{}),"Relabeling cookbook"]}),Ht("a",{className:"vm-link vm-link_with-icon",target:"_blank",href:"https://docs.victoriametrics.com/vmagent.html#relabeling",rel:"help noreferrer",children:[Ht(mr,{}),"Documentation"]}),Ht(oi,{variant:"text",onClick:function(){var e=Id,r=Pd;f(e),m(r),u(e,r),t.set("config",e),t.set("labels",r),n(t)},children:"Try example"}),Ht(oi,{variant:"contained",onClick:function(){u(s,h),t.set("config",s),t.set("labels",h),n(t)},startIcon:Ht(er,{}),children:"Submit"})]})]}),l&&Ht(Kr,{variant:"error",children:l}),a&&Ht("div",{className:"vm-relabeling-steps vm-block",children:[a.originalLabels&&Ht("div",{className:"vm-relabeling-steps-item",children:Ht("div",{className:"vm-relabeling-steps-item__row",children:[Ht("span",{children:"Original labels:"}),Ht("code",{dangerouslySetInnerHTML:{__html:a.originalLabels}})]})}),a.steps.map((function(e,t){return Ht("div",{className:"vm-relabeling-steps-item",children:[Ht("div",{className:"vm-relabeling-steps-item__row",children:[Ht("span",{children:"Step:"}),t+1]}),Ht("div",{className:"vm-relabeling-steps-item__row",children:[Ht("span",{children:"Relabeling Rule:"}),Ht("code",{children:Ht("pre",{children:e.rule})})]}),Ht("div",{className:"vm-relabeling-steps-item__row",children:[Ht("span",{children:"Input Labels:"}),Ht("code",{children:Ht("pre",{dangerouslySetInnerHTML:{__html:e.inLabels}})})]}),Ht("div",{className:"vm-relabeling-steps-item__row",children:[Ht("span",{children:"Output labels:"}),Ht("code",{children:Ht("pre",{dangerouslySetInnerHTML:{__html:e.outLabels}})})]})]},t)})),a.resultingLabels&&Ht("div",{className:"vm-relabeling-steps-item",children:Ht("div",{className:"vm-relabeling-steps-item__row",children:[Ht("span",{children:"Resulting labels:"}),Ht("code",{dangerouslySetInnerHTML:{__html:a.resultingLabels}})]})})]})]})},Bd=[10,25,50,100,250,500,1e3],Rd=function(e){var t=e.limit,n=e.tooltip,i=e.onChange,a=Qr().isMobile,o=n||"Rows per page",l=(0,r.useRef)(null),u=li(!1),c=u.value,s=u.toggle,f=u.setFalse,d=function(e){return function(){i(e),f()}};return Ht(zt.HY,{children:[Ht(mi,{title:o,children:Ht("div",{ref:l,children:Ht(oi,{variant:"text",endIcon:Ht(Qn,{}),onClick:s,children:t})})}),Ht(ui,{open:c,onClose:f,placement:"bottom-right",buttonRef:l,children:Ht("div",{className:"vm-select-limits",children:Bd.map((function(e){return Ht("div",{className:wr()({"vm-list-item":!0,"vm-list-item_mobile":a,"vm-list-item_active":e===t}),onClick:d(e),children:e},e)}))})})]})},zd=function(e){var t=e.rows,n=e.columns,i=e.defaultOrderBy,a=e.copyToClipboard,o=e.paginationOffset,l=v((0,r.useState)(i),2),u=l[0],c=l[1],s=v((0,r.useState)("desc"),2),f=s[0],d=s[1],h=v((0,r.useState)(null),2),m=h[0],p=h[1],g=(0,r.useMemo)((function(){var e=o.startIndex,n=o.endIndex;return jf(t,zf(f,u)).slice(e,n)}),[t,u,f,o]),y=function(e,t){return sa(ua().mark((function n(){return ua().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(m!==t){n.next=2;break}return n.abrupt("return");case 2:return n.prev=2,n.next=5,navigator.clipboard.writeText(String(e));case 5:p(t),n.next=11;break;case 8:n.prev=8,n.t0=n.catch(2),console.error(n.t0);case 11:case"end":return n.stop()}}),n,null,[[2,8]])})))};return(0,r.useEffect)((function(){if(null!==m){var e=setTimeout((function(){return p(null)}),2e3);return function(){return clearTimeout(e)}}}),[m]),Ht("table",{className:"vm-table",children:[Ht("thead",{className:"vm-table-header",children:Ht("tr",{className:"vm-table__row vm-table__row_header",children:[n.map((function(e){return Ht("th",{className:"vm-table-cell vm-table-cell_header vm-table-cell_sort",onClick:(t=e.key,function(){d((function(e){return"asc"===e&&u===t?"desc":"asc"})),c(t)}),children:Ht("div",{className:"vm-table-cell__content",children:[Ht("div",{children:String(e.title||e.key)}),Ht("div",{className:wr()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":u===e.key,"vm-table__sort-icon_desc":"desc"===f&&u===e.key}),children:Ht(Qn,{})})]})},String(e.key));var t})),a&&Ht("th",{className:"vm-table-cell vm-table-cell_header"})]})}),Ht("tbody",{className:"vm-table-body",children:g.map((function(e,t){return Ht("tr",{className:"vm-table__row",children:[n.map((function(t){return Ht("td",{className:wr()(lt({"vm-table-cell":!0},"".concat(t.className),t.className)),children:e[t.key]||"-"},String(t.key))})),a&&Ht("td",{className:"vm-table-cell vm-table-cell_right",children:e[a]&&Ht("div",{className:"vm-table-cell__content",children:Ht(mi,{title:m===t?"Copied":"Copy row",children:Ht(oi,{variant:"text",color:m===t?"success":"gray",size:"small",startIcon:Ht(m===t?ur:fr,{}),onClick:y(e[a],t)})})})})]},t)}))})]})},jd=function(e){var t=e.page,n=e.length,r=e.limit,i=e.onChange,a=Qr().isMobile,o=function(e){return function(){i(+t+e),window.scrollTo(0,0)}};return Ht("div",{className:wr()({"vm-pagination":!0,"vm-pagination_mobile":a}),children:[t>1&&Ht(oi,{variant:"text",onClick:o(-1),startIcon:Ht("div",{className:"vm-pagination__icon vm-pagination__icon_prev",children:Ht(Zn,{})}),children:"Previous"}),n>=r&&Ht(oi,{variant:"text",onClick:o(1),endIcon:Ht("div",{className:"vm-pagination__icon vm-pagination__icon_next",children:Ht(Zn,{})}),children:"Next"})]})},Hd=function(e){var t=e.logs,n=e.limitRows,i=e.displayColumns,a=e.tableCompact,o=e.columns,l=Wi().setSearchParamsFromKeys,u=v(Pf(1,"page"),2),c=u[0],s=u[1],f=function(e){switch(e){case"time":return"vm-table-cell_logs-time";case"data":return"vm-table-cell_logs vm-table-cell_pre";default:return"vm-table-cell_logs"}},d=(0,r.useMemo)((function(){var e=(c-1)*Number(n);return{startIndex:e,endIndex:e+Number(n)}}),[c,n]),h=(0,r.useMemo)((function(){return a?[{key:"data",title:"Data",className:f("data")}]:o.map((function(e){return{key:e,title:e,className:f(e)}}))}),[a,o]),m=(0,r.useMemo)((function(){return null===i||void 0===i||!i.length||a?h:h.filter((function(e){return i.includes(e.key)}))}),[h,i,a]);return Ht(zt.HY,{children:[Ht(zd,{rows:t,columns:m,defaultOrderBy:"time",copyToClipboard:"data",paginationOffset:d}),Ht(jd,{page:c,limit:+n,length:t.slice(d.startIndex,d.endIndex).length,onChange:function(e){s(e),l({page:e})}})]})},$d=function(e){var t=e.logs,n=e.columns,i=(0,r.useMemo)((function(){var e=["_msg","time","data","_time"],r=n.filter((function(t){return!e.includes(t)}));return function(e,t){var n=e.reduce((function(e,n){var r=t.map((function(e){return"".concat(e,": ").concat(n[e]||"-")})).join("|");return(e[r]=e[r]||[]).push(n),e}),{});return Object.entries(n).map((function(e){var t=v(e,2),n=t[0],r=t[1];return{keys:n.split("|"),values:r}}))}(t,r)}),[t]);return Ht("div",{className:"vm-explore-logs-body-content",children:i.map((function(e){return Ht("div",{className:"vm-explore-logs-body-content-group",children:Ht(ta,{defaultExpanded:!0,title:Ht("div",{className:"vm-explore-logs-body-content-group-keys",children:[Ht("span",{className:"vm-explore-logs-body-content-group-keys__title",children:"Group by:"}),e.keys.map((function(e){return Ht("div",{className:"vm-explore-logs-body-content-group-keys__key",children:e},e)}))]}),children:Ht("div",{className:"vm-explore-logs-body-content-group-rows",children:e.values.map((function(e){return Ht("div",{className:"vm-explore-logs-body-content-group-rows-item",children:[Ht("div",{className:"vm-explore-logs-body-content-group-rows-item__time",children:e.time}),Ht("div",{className:"vm-explore-logs-body-content-group-rows-item__msg",children:e._msg})]},"".concat(e._msg).concat(e._time))}))})})},e.keys.join(""))}))})},Yd=function(e){return e.group="group",e.table="table",e.json="json",e}(Yd||{}),Vd=[{label:"Group",value:Yd.group,icon:Ht(Cr,{})},{label:"Table",value:Yd.table,icon:Ht(rr,{})},{label:"JSON",value:Yd.json,icon:Ht(ir,{})}],Ud=function(e){var t=e.data,n=Qr().isMobile,i=Nn().timezone,o=Wi().setSearchParamsFromKeys,l=v(Pf(Nt("LOGS_LIMIT")||50,"limit"),2),u=l[0],c=l[1],s=v(Pf(Yd.group,"view"),2),f=s[0],d=s[1],h=v((0,r.useState)([]),2),m=h[0],p=h[1],y=li(!1),_=y.value,b=y.toggle,C=(0,r.useMemo)((function(){return t.map((function(e){return ct({time:a()(e._time).tz().format("MMM DD, YYYY \nHH:mm:ss.SSS"),data:JSON.stringify(e,null,2)},e)}))}),[t,i]),D=(0,r.useMemo)((function(){if(null===C||void 0===C||!C.length)return[];var e,t=["data","_time"],n=new Set,r=g(C);try{for(r.s();!(e=r.n()).done;){var i=e.value;for(var a in i)n.add(a)}}catch(o){r.e(o)}finally{r.f()}return Array.from(n).filter((function(e){return!t.includes(e)}))}),[C]);return Ht("div",{className:wr()({"vm-explore-logs-body":!0,"vm-block":!0,"vm-block_mobile":n}),children:[Ht("div",{className:wr()({"vm-explore-logs-body-header":!0,"vm-section-header":!0,"vm-explore-logs-body-header_mobile":n}),children:[Ht("div",{className:"vm-section-header__tabs",children:Ht(Fr,{activeItem:String(f),items:Vd,onChange:function(e){d(e),o({view:e})}})}),f===Yd.table&&Ht("div",{className:"vm-explore-logs-body-header__settings",children:[Ht(Rd,{limit:+u,onChange:function(e){c(e),o({limit:e}),At("LOGS_LIMIT","".concat(e))}}),Ht(Ss,{columns:D,defaultColumns:m,onChangeColumns:p,tableCompact:_,toggleTableCompact:b})]})]}),Ht("div",{className:wr()({"vm-explore-logs-body__table":!0,"vm-explore-logs-body__table_mobile":n}),children:!!t.length&&Ht(zt.HY,{children:[f===Yd.table&&Ht(Hd,{logs:C,limitRows:+u,displayColumns:m,tableCompact:_,columns:D}),f===Yd.group&&Ht($d,{logs:C,columns:D}),f===Yd.json&&Ht(ps,{data:t})]})})]})},qd=1e3,Wd=function(e){var t=e.query,n=e.onChange,r=e.onRun,i=Qr().isMobile;return Ht("div",{className:wr()({"vm-explore-logs-header":!0,"vm-block":!0,"vm-block_mobile":i}),children:[Ht("div",{className:"vm-explore-logs-header__input",children:Ht(ns,{value:t,autocomplete:!1,options:[],onArrowUp:function(){return null},onArrowDown:function(){return null},onEnter:r,onChange:n,label:"Log query"})}),Ht("div",{className:"vm-explore-logs-header-bottom",children:[Ht("div",{className:"vm-explore-logs-header-bottom-helpful",children:[Ht("a",{className:"vm-link vm-link_with-icon",target:"_blank",href:"https://docs.victoriametrics.com/VictoriaLogs/LogsQL.html",rel:"help noreferrer",children:[Ht(Yn,{}),"Query language docs"]}),Ht("a",{className:"vm-link vm-link_with-icon",target:"_blank",href:"https://docs.victoriametrics.com/VictoriaLogs/",rel:"help noreferrer",children:[Ht(mr,{}),"Documentation"]})]}),Ht("div",{className:"vm-explore-logs-header-bottom__execute",children:Ht(oi,{startIcon:Ht(er,{}),onClick:r,fullWidth:!0,children:"Execute Query"})})]})]})},Zd=function(){var e=Yt().serverUrl,t=Wi().setSearchParamsFromKeys,n=v(Pf("","query"),2),i=n[0],a=n[1],o=Mi(i),l=function(e,t){var n=v((0,r.useState)([]),2),i=n[0],a=n[1],o=v((0,r.useState)(!1),2),l=o[0],u=o[1],c=v((0,r.useState)(),2),s=c[0],f=c[1],d=(0,r.useMemo)((function(){return function(e){return"".concat(e,"/select/logsql/query")}(e)}),[e]),h=(0,r.useMemo)((function(){return{method:"POST",headers:{Accept:"application/stream+json; charset=utf-8","Content-Type":"application/x-www-form-urlencoded"},body:"query=".concat(encodeURIComponent(t.trim()))}}),[t]);return{logs:i,isLoading:l,error:s,fetchLogs:(0,r.useCallback)(sa(ua().mark((function e(){var t,n,r,i,o,l,c,s,m,p;return ua().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u(!0),f(void 0),e.prev=2,e.next=5,fetch(d,h);case 5:if((t=e.sent).ok&&t.body){e.next=14;break}return e.next=9,t.text();case 9:return n=e.sent,f(n),a([]),u(!1),e.abrupt("return");case 14:r=t.body.getReader(),i=new TextDecoder("utf-8"),o=[];case 17:if(!r){e.next=33;break}return e.next=20,r.read();case 20:if(l=e.sent,c=l.done,s=l.value,!c){e.next=25;break}return e.abrupt("break",33);case 25:if(m=i.decode(s,{stream:!0}).split("\n"),o.push.apply(o,_(m)),o.length>qd&&o.splice(0,o.length-qd),!(o.length>=qd)){e.next=31;break}return r.cancel(),e.abrupt("break",33);case 31:e.next=17;break;case 33:p=o.map((function(e){try{return JSON.parse(e)}catch(t){return""}})).filter((function(e){return e})),a(p),e.next=42;break;case 37:e.prev=37,e.t0=e.catch(2),console.error(e.t0),a([]),e.t0 instanceof Error&&f("".concat(e.t0.name,": ").concat(e.t0.message));case 42:u(!1);case 43:case"end":return e.stop()}}),e,null,[[2,37]])}))),[d,h])}}(e,i),u=l.logs,c=l.isLoading,s=l.error,f=l.fetchLogs,d=function(){f(),t(o&&i!==o?{query:i,page:1}:{query:i})};return(0,r.useEffect)((function(){i&&d()}),[]),Ht("div",{className:"vm-explore-logs",children:[Ht(Wd,{query:i,onChange:a,onRun:d}),c&&Ht(_s,{}),s&&Ht(Kr,{variant:"error",children:s}),Ht(Ud,{data:u})]})},Qd=function(){var e={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!1}.REACT_APP_LOGS,t=v((0,r.useState)(!1),2),n=t[0],i=t[1];return Ht(zt.HY,{children:Ht(Je,{children:Ht(ri,{children:Ht(zt.HY,{children:[Ht(od,{onLoaded:i}),n&&Ht(Ve,{children:Ht($e,{path:"/",element:Ht(_a,{}),children:[!e&&Ht(zt.HY,{children:[Ht($e,{path:mt.home,element:Ht(Ls,{})}),Ht($e,{path:mt.metrics,element:Ht(kd,{})}),Ht($e,{path:mt.cardinality,element:Ht(Gf,{})}),Ht($e,{path:mt.topQueries,element:Ht(td,{})}),Ht($e,{path:mt.trace,element:Ht(cd,{})}),Ht($e,{path:mt.dashboards,element:Ht(kf,{})}),Ht($e,{path:mt.withTemplate,element:Ht(Td,{})}),Ht($e,{path:mt.relabel,element:Ht(Ld,{})}),Ht($e,{path:mt.icons,element:Ht(xd,{})})]}),Ht($e,{path:e?"/":mt.logs,element:Ht(Zd,{})})]})})]})})})})},Gd=function(e){e&&n.e(27).then(n.bind(n,27)).then((function(t){var n=t.getCLS,r=t.getFID,i=t.getFCP,a=t.getLCP,o=t.getTTFB;n(e),r(e),i(e),a(e),o(e)}))},Kd=document.getElementById("root");Kd&&(0,r.render)(Ht(Qd,{}),Kd),Gd()}()}();
\ No newline at end of file
diff --git a/app/vlselect/vmui/static/js/main.46d11611.js.LICENSE.txt b/app/vmselect/vmui/static/js/main.6bf10b2e.js.LICENSE.txt
similarity index 91%
rename from app/vlselect/vmui/static/js/main.46d11611.js.LICENSE.txt
rename to app/vmselect/vmui/static/js/main.6bf10b2e.js.LICENSE.txt
index 766948666..bd52e372e 100644
--- a/app/vlselect/vmui/static/js/main.46d11611.js.LICENSE.txt
+++ b/app/vmselect/vmui/static/js/main.6bf10b2e.js.LICENSE.txt
@@ -7,7 +7,7 @@
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
/**
- * @remix-run/router v1.5.0
+ * @remix-run/router v1.6.2
*
* Copyright (c) Remix Software Inc.
*
@@ -18,7 +18,7 @@
*/
/**
- * React Router DOM v6.10.0
+ * React Router DOM v6.11.2
*
* Copyright (c) Remix Software Inc.
*
@@ -29,7 +29,7 @@
*/
/**
- * React Router v6.10.0
+ * React Router v6.11.2
*
* Copyright (c) Remix Software Inc.
*
diff --git a/app/vmselect/vmui/static/js/main.ff1e4560.js b/app/vmselect/vmui/static/js/main.ff1e4560.js
deleted file mode 100644
index 1770f3447..000000000
--- a/app/vmselect/vmui/static/js/main.ff1e4560.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! For license information please see main.ff1e4560.js.LICENSE.txt */
-!function(){var e={680:function(e,t,n){"use strict";var r=n(476),i=n(962),a=i(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"===typeof n&&a(e,".prototype.")>-1?i(n):n}},962:function(e,t,n){"use strict";var r=n(199),i=n(476),a=i("%Function.prototype.apply%"),o=i("%Function.prototype.call%"),u=i("%Reflect.apply%",!0)||r.call(o,a),l=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),s=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(d){c=null}e.exports=function(e){var t=u(r,o,arguments);l&&c&&(l(t,"length").configurable&&c(t,"length",{value:1+s(0,e.length-(arguments.length-1))}));return t};var f=function(){return u(r,a,arguments)};c?c(e.exports,"apply",{value:f}):e.exports.apply=f},123:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e=[],t=0;t=t?e:""+Array(t+1-r.length).join(n)+e},y={s:g,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+g(r,2,"0")+":"+g(i,2,"0")},m:function e(t,n){if(t.date()1)return e(o[0])}else{var u=t.name;b[u]=t,i=u}return!r&&i&&(_=i),i||!r&&_},k=function(e,t){if(D(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new C(n)},x=y;x.l=w,x.i=D,x.w=function(e,t){return k(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var C=function(){function v(e){this.$L=w(e.locale,null,!0),this.parse(e)}var g=v.prototype;return g.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(x.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(p);if(r){var i=r[2]-1||0,a=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},g.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},g.$utils=function(){return x},g.isValid=function(){return!(this.$d.toString()===h)},g.isSame=function(e,t){var n=k(e);return this.startOf(t)<=n&&n<=this.endOf(t)},g.isAfter=function(e,t){return k(e)=0&&(a[f]=parseInt(s,10))}var d=a[3],h=24===d?0:d,p=a[0]+"-"+a[1]+"-"+a[2]+" "+h+":"+a[4]+":"+a[5]+":000",m=+t;return(i.utc(p).valueOf()-(m-=m%1e3))/6e4},l=r.prototype;l.tz=function(e,t){void 0===e&&(e=a);var n=this.utcOffset(),r=this.toDate(),o=r.toLocaleString("en-US",{timeZone:e}),u=Math.round((r-new Date(o))/1e3/60),l=i(o).$set("millisecond",this.$ms).utcOffset(15*-Math.round(r.getTimezoneOffset()/15)-u,!0);if(t){var c=l.utcOffset();l=l.add(n-c,"minute")}return l.$x.$timezone=e,l},l.offsetName=function(e){var t=this.$x.$timezone||i.tz.guess(),n=o(this.valueOf(),t,{timeZoneName:e}).find((function(e){return"timezonename"===e.type.toLowerCase()}));return n&&n.value};var c=l.startOf;l.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return c.call(this,e,t);var n=i(this.format("YYYY-MM-DD HH:mm:ss:SSS"));return c.call(n,e,t).tz(this.$x.$timezone,!0)},i.tz=function(e,t,n){var r=n&&t,o=n||t||a,l=u(+i(),o);if("string"!=typeof e)return i(e).tz(o);var c=function(e,t,n){var r=e-60*t*1e3,i=u(r,n);if(t===i)return[r,t];var a=u(r-=60*(i-t)*1e3,n);return i===a?[r,i]:[e-60*Math.min(i,a)*1e3,Math.max(i,a)]}(i.utc(e,r).valueOf(),l,o),s=c[0],f=c[1],d=i(s).utcOffset(f);return d.$x.$timezone=o,d},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(e){a=e}}}()},635:function(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,i,a){var o=i.prototype;a.utc=function(e){return new i({date:e,utc:!0,args:arguments})},o.utc=function(t){var n=a(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},o.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var u=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),u.call(this,e)};var l=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var c=o.utcOffset;o.utcOffset=function(r,i){var a=this.$utils().u;if(a(r))return this.$u?0:a(this.$offset)?c.call(this):this.$offset;if("string"==typeof r&&(r=function(e){void 0===e&&(e="");var r=e.match(t);if(!r)return null;var i=(""+r[0]).match(n)||["-",0,0],a=i[0],o=60*+i[1]+ +i[2];return 0===o?0:"+"===a?o:-o}(r),null===r))return this;var o=Math.abs(r)<=16?60*r:r,u=this;if(i)return u.$offset=o,u.$u=0===r,u;if(0!==r){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(u=this.local().add(o+l,e)).$offset=o,u.$x.$localOffset=l}else u=this.utc();return u};var s=o.format;o.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return s.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var f=o.toDate;o.toDate=function(e){return"s"===e&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var d=o.diff;o.diff=function(e,t,n){if(e&&this.$u===e.$u)return d.call(this,e,t,n);var r=this.local(),i=a(e).local();return d.call(r,i,t,n)}}}()},781:function(e){"use strict";var t=Array.prototype.slice,n=Object.prototype.toString;e.exports=function(e){var r=this;if("function"!==typeof r||"[object Function]"!==n.call(r))throw new TypeError("Function.prototype.bind called on incompatible "+r);for(var i,a=t.call(arguments,1),o=Math.max(0,r.length-a.length),u=[],l=0;l1&&"boolean"!==typeof t)throw new o('"allowMissing" argument must be a boolean');if(null===C(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=x(e,0,1),n=x(e,-1);if("%"===t&&"%"!==n)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var r=[];return k(e,E,(function(e,t,n,i){r[r.length]=n?k(i,S,"$1"):t||e})),r}(e),r=n.length>0?n[0]:"",a=A("%"+r+"%",t),u=a.name,c=a.value,s=!1,f=a.alias;f&&(r=f[0],w(n,D([0,1],f)));for(var d=1,h=!0;d=n.length){var y=l(c,p);c=(h=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:c[p]}else h=b(c,p),c=c[p];h&&!s&&(m[u]=c)}}return c}},520:function(e,t,n){"use strict";var r="undefined"!==typeof Symbol&&Symbol,i=n(541);e.exports=function(){return"function"===typeof r&&("function"===typeof Symbol&&("symbol"===typeof r("foo")&&("symbol"===typeof Symbol("bar")&&i())))}},541:function(e){"use strict";e.exports=function(){if("function"!==typeof Symbol||"function"!==typeof Object.getOwnPropertySymbols)return!1;if("symbol"===typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"===typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"===typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"===typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"===typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},838:function(e,t,n){"use strict";var r=n(199);e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},936:function(e,t,n){var r=NaN,i="[object Symbol]",a=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt,s="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,f="object"==typeof self&&self&&self.Object===Object&&self,d=s||f||Function("return this")(),h=Object.prototype.toString,p=Math.max,m=Math.min,v=function(){return d.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function y(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&h.call(e)==i}(e))return r;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var n=u.test(e);return n||l.test(e)?c(e.slice(2),n?2:8):o.test(e)?r:+e}e.exports=function(e,t,n){var r,i,a,o,u,l,c=0,s=!1,f=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var n=r,a=i;return r=i=void 0,c=t,o=e.apply(a,n)}function _(e){var n=e-l;return void 0===l||n>=t||n<0||f&&e-c>=a}function b(){var e=v();if(_(e))return D(e);u=setTimeout(b,function(e){var n=t-(e-l);return f?m(n,a-(e-c)):n}(e))}function D(e){return u=void 0,d&&r?h(e):(r=i=void 0,o)}function w(){var e=v(),n=_(e);if(r=arguments,i=this,l=e,n){if(void 0===u)return function(e){return c=e,u=setTimeout(b,t),s?h(e):o}(l);if(f)return u=setTimeout(b,t),h(l)}return void 0===u&&(u=setTimeout(b,t)),o}return t=y(t)||0,g(n)&&(s=!!n.leading,a=(f="maxWait"in n)?p(y(n.maxWait)||0,t):a,d="trailing"in n?!!n.trailing:d),w.cancel=function(){void 0!==u&&clearTimeout(u),c=0,r=l=i=u=void 0},w.flush=function(){return void 0===u?o:D(v())},w}},7:function(e,t,n){var r="__lodash_hash_undefined__",i=1/0,a="[object Function]",o="[object GeneratorFunction]",u="[object Symbol]",l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c=/^\w*$/,s=/^\./,f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,d=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,p="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,m="object"==typeof self&&self&&self.Object===Object&&self,v=p||m||Function("return this")();var g=Array.prototype,y=Function.prototype,_=Object.prototype,b=v["__core-js_shared__"],D=function(){var e=/[^.]+$/.exec(b&&b.keys&&b.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),w=y.toString,k=_.hasOwnProperty,x=_.toString,C=RegExp("^"+w.call(k).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),E=v.Symbol,S=g.splice,A=z(v,"Map"),N=z(Object,"create"),M=E?E.prototype:void 0,F=M?M.toString:void 0;function T(e){var t=-1,n=e?e.length:0;for(this.clear();++t-1},O.prototype.set=function(e,t){var n=this.__data__,r=B(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},I.prototype.clear=function(){this.__data__={hash:new T,map:new(A||O),string:new T}},I.prototype.delete=function(e){return L(this,e).delete(e)},I.prototype.get=function(e){return L(this,e).get(e)},I.prototype.has=function(e){return L(this,e).has(e)},I.prototype.set=function(e,t){return L(this,e).set(e,t),this};var j=H((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(V(e))return F?F.call(e):"";var t=e+"";return"0"==t&&1/e==-i?"-0":t}(t);var n=[];return s.test(e)&&n.push(""),e.replace(f,(function(e,t,r,i){n.push(r?i.replace(d,"$1"):t||e)})),n}));function $(e){if("string"==typeof e||V(e))return e;var t=e+"";return"0"==t&&1/e==-i?"-0":t}function H(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function n(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o),o};return n.cache=new(H.Cache||I),n}H.Cache=I;var Y=Array.isArray;function U(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function V(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&x.call(e)==u}e.exports=function(e,t,n){var r=null==e?void 0:P(e,t);return void 0===r?n:r}},61:function(e,t,n){var r="Expected a function",i=NaN,a="[object Symbol]",o=/^\s+|\s+$/g,u=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt,f="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,d="object"==typeof self&&self&&self.Object===Object&&self,h=f||d||Function("return this")(),p=Object.prototype.toString,m=Math.max,v=Math.min,g=function(){return h.Date.now()};function y(e,t,n){var i,a,o,u,l,c,s=0,f=!1,d=!1,h=!0;if("function"!=typeof e)throw new TypeError(r);function p(t){var n=i,r=a;return i=a=void 0,s=t,u=e.apply(r,n)}function y(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-s>=o}function D(){var e=g();if(y(e))return w(e);l=setTimeout(D,function(e){var n=t-(e-c);return d?v(n,o-(e-s)):n}(e))}function w(e){return l=void 0,h&&i?p(e):(i=a=void 0,u)}function k(){var e=g(),n=y(e);if(i=arguments,a=this,c=e,n){if(void 0===l)return function(e){return s=e,l=setTimeout(D,t),f?p(e):u}(c);if(d)return l=setTimeout(D,t),p(c)}return void 0===l&&(l=setTimeout(D,t)),u}return t=b(t)||0,_(n)&&(f=!!n.leading,o=(d="maxWait"in n)?m(b(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h),k.cancel=function(){void 0!==l&&clearTimeout(l),s=0,i=c=a=l=void 0},k.flush=function(){return void 0===l?u:w(g())},k}function _(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function b(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&p.call(e)==a}(e))return i;if(_(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=_(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=l.test(e);return n||c.test(e)?s(e.slice(2),n?2:8):u.test(e)?i:+e}e.exports=function(e,t,n){var i=!0,a=!0;if("function"!=typeof e)throw new TypeError(r);return _(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),y(e,t,{leading:i,maxWait:t,trailing:a})}},154:function(e,t,n){var r="function"===typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,a=r&&i&&"function"===typeof i.get?i.get:null,o=r&&Map.prototype.forEach,u="function"===typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=u&&l&&"function"===typeof l.get?l.get:null,s=u&&Set.prototype.forEach,f="function"===typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"===typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,h="function"===typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,m=Object.prototype.toString,v=Function.prototype.toString,g=String.prototype.match,y=String.prototype.slice,_=String.prototype.replace,b=String.prototype.toUpperCase,D=String.prototype.toLowerCase,w=RegExp.prototype.test,k=Array.prototype.concat,x=Array.prototype.join,C=Array.prototype.slice,E=Math.floor,S="function"===typeof BigInt?BigInt.prototype.valueOf:null,A=Object.getOwnPropertySymbols,N="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?Symbol.prototype.toString:null,M="function"===typeof Symbol&&"object"===typeof Symbol.iterator,F="function"===typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===M||"symbol")?Symbol.toStringTag:null,T=Object.prototype.propertyIsEnumerable,O=("function"===typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function I(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||w.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"===typeof e){var r=e<0?-E(-e):E(e);if(r!==e){var i=String(r),a=y.call(t,i.length+1);return _.call(i,n,"$&_")+"."+_.call(_.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return _.call(t,n,"$&_")}var B=n(654),P=B.custom,R=H(P)?P:null;function L(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function z(e){return _.call(String(e),/"/g,""")}function j(e){return"[object Array]"===V(e)&&(!F||!("object"===typeof e&&F in e))}function $(e){return"[object RegExp]"===V(e)&&(!F||!("object"===typeof e&&F in e))}function H(e){if(M)return e&&"object"===typeof e&&e instanceof Symbol;if("symbol"===typeof e)return!0;if(!e||"object"!==typeof e||!N)return!1;try{return N.call(e),!0}catch(t){}return!1}e.exports=function e(t,n,r,i){var u=n||{};if(U(u,"quoteStyle")&&"single"!==u.quoteStyle&&"double"!==u.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(U(u,"maxStringLength")&&("number"===typeof u.maxStringLength?u.maxStringLength<0&&u.maxStringLength!==1/0:null!==u.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=!U(u,"customInspect")||u.customInspect;if("boolean"!==typeof l&&"symbol"!==l)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(U(u,"indent")&&null!==u.indent&&"\t"!==u.indent&&!(parseInt(u.indent,10)===u.indent&&u.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(U(u,"numericSeparator")&&"boolean"!==typeof u.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var m=u.numericSeparator;if("undefined"===typeof t)return"undefined";if(null===t)return"null";if("boolean"===typeof t)return t?"true":"false";if("string"===typeof t)return W(t,u);if("number"===typeof t){if(0===t)return 1/0/t>0?"0":"-0";var b=String(t);return m?I(t,b):b}if("bigint"===typeof t){var w=String(t)+"n";return m?I(t,w):w}var E="undefined"===typeof u.depth?5:u.depth;if("undefined"===typeof r&&(r=0),r>=E&&E>0&&"object"===typeof t)return j(t)?"[Array]":"[Object]";var A=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"===typeof e.indent&&e.indent>0))return null;n=x.call(Array(e.indent+1)," ")}return{base:n,prev:x.call(Array(t+1),n)}}(u,r);if("undefined"===typeof i)i=[];else if(q(i,t)>=0)return"[Circular]";function P(t,n,a){if(n&&(i=C.call(i)).push(n),a){var o={depth:u.depth};return U(u,"quoteStyle")&&(o.quoteStyle=u.quoteStyle),e(t,o,r+1,i)}return e(t,u,r+1,i)}if("function"===typeof t&&!$(t)){var Y=function(e){if(e.name)return e.name;var t=g.call(v.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),Q=X(t,P);return"[Function"+(Y?": "+Y:" (anonymous)")+"]"+(Q.length>0?" { "+x.call(Q,", ")+" }":"")}if(H(t)){var ee=M?_.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):N.call(t);return"object"!==typeof t||M?ee:G(ee)}if(function(e){if(!e||"object"!==typeof e)return!1;if("undefined"!==typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"===typeof e.nodeName&&"function"===typeof e.getAttribute}(t)){for(var te="<"+D.call(String(t.nodeName)),ne=t.attributes||[],re=0;re",t.childNodes&&t.childNodes.length&&(te+="..."),te+=""+D.call(String(t.nodeName))+">"}if(j(t)){if(0===t.length)return"[]";var ie=X(t,P);return A&&!function(e){for(var t=0;t=0)return!1;return!0}(ie)?"["+K(ie,A)+"]":"[ "+x.call(ie,", ")+" ]"}if(function(e){return"[object Error]"===V(e)&&(!F||!("object"===typeof e&&F in e))}(t)){var ae=X(t,P);return"cause"in Error.prototype||!("cause"in t)||T.call(t,"cause")?0===ae.length?"["+String(t)+"]":"{ ["+String(t)+"] "+x.call(ae,", ")+" }":"{ ["+String(t)+"] "+x.call(k.call("[cause]: "+P(t.cause),ae),", ")+" }"}if("object"===typeof t&&l){if(R&&"function"===typeof t[R]&&B)return B(t,{depth:E-r});if("symbol"!==l&&"function"===typeof t.inspect)return t.inspect()}if(function(e){if(!a||!e||"object"!==typeof e)return!1;try{a.call(e);try{c.call(e)}catch(te){return!0}return e instanceof Map}catch(t){}return!1}(t)){var oe=[];return o&&o.call(t,(function(e,n){oe.push(P(n,t,!0)+" => "+P(e,t))})),Z("Map",a.call(t),oe,A)}if(function(e){if(!c||!e||"object"!==typeof e)return!1;try{c.call(e);try{a.call(e)}catch(t){return!0}return e instanceof Set}catch(n){}return!1}(t)){var ue=[];return s&&s.call(t,(function(e){ue.push(P(e,t))})),Z("Set",c.call(t),ue,A)}if(function(e){if(!f||!e||"object"!==typeof e)return!1;try{f.call(e,f);try{d.call(e,d)}catch(te){return!0}return e instanceof WeakMap}catch(t){}return!1}(t))return J("WeakMap");if(function(e){if(!d||!e||"object"!==typeof e)return!1;try{d.call(e,d);try{f.call(e,f)}catch(te){return!0}return e instanceof WeakSet}catch(t){}return!1}(t))return J("WeakSet");if(function(e){if(!h||!e||"object"!==typeof e)return!1;try{return h.call(e),!0}catch(t){}return!1}(t))return J("WeakRef");if(function(e){return"[object Number]"===V(e)&&(!F||!("object"===typeof e&&F in e))}(t))return G(P(Number(t)));if(function(e){if(!e||"object"!==typeof e||!S)return!1;try{return S.call(e),!0}catch(t){}return!1}(t))return G(P(S.call(t)));if(function(e){return"[object Boolean]"===V(e)&&(!F||!("object"===typeof e&&F in e))}(t))return G(p.call(t));if(function(e){return"[object String]"===V(e)&&(!F||!("object"===typeof e&&F in e))}(t))return G(P(String(t)));if(!function(e){return"[object Date]"===V(e)&&(!F||!("object"===typeof e&&F in e))}(t)&&!$(t)){var le=X(t,P),ce=O?O(t)===Object.prototype:t instanceof Object||t.constructor===Object,se=t instanceof Object?"":"null prototype",fe=!ce&&F&&Object(t)===t&&F in t?y.call(V(t),8,-1):se?"Object":"",de=(ce||"function"!==typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(fe||se?"["+x.call(k.call([],fe||[],se||[]),": ")+"] ":"");return 0===le.length?de+"{}":A?de+"{"+K(le,A)+"}":de+"{ "+x.call(le,", ")+" }"}return String(t)};var Y=Object.prototype.hasOwnProperty||function(e){return e in this};function U(e,t){return Y.call(e,t)}function V(e){return m.call(e)}function q(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n