"use strict";(self.webpackChunkgrafana_lokiexplore_app=self.webpackChunkgrafana_lokiexplore_app||[]).push([[546],{8546:(e,_,l)=>{l.r(_),l.d(_,{default:()=>u});var t=l(5959),a=l.n(t),o=l(7781),n=l(8531),r=l(2007),s=l(4509),i=l(7389),d=l(6854);const c={[o.AbstractLabelOperator.Equal]:d.KQ.Equal,[o.AbstractLabelOperator.NotEqual]:d.KQ.NotEqual,[o.AbstractLabelOperator.EqualRegEx]:d.KQ.RegexEqual,[o.AbstractLabelOperator.NotEqualRegEx]:d.KQ.RegexNotEqual};function u({datasourceUid:e,from:_,renderButton:l,returnToPreviousSource:d,streamSelectors:u,to:g}){const m=(0,n.useReturnToPrevious)(),h=(0,t.useMemo)(()=>{const l=u[0];if(!l||(null==l?void 0:l.operator)!==o.AbstractLabelOperator.Equal)return null;const t=(0,i.uu)(l.value);let a=new URLSearchParams;return e&&(a=(0,i.xh)(i.I8.DatasourceId,e,a)),_&&(a=(0,i.xh)(i.I8.TimeRangeFrom,_,a)),g&&(a=(0,i.xh)(i.I8.TimeRangeTo,g,a)),u.forEach(e=>{a=(0,i.zH)(i.I8.Labels,`${e.name}|${c[e.operator]}|${(0,i.XH)((0,i.vh)(e.value))},${(0,i.XH)((0,i.rx)(e.value))}`,a)}),(0,i.Rk)(`/explore/${l.name}/${t}/logs`,a)},[e,_,g,u]);return h?l?l({href:h}):a().createElement(r.LinkButton,{variant:"secondary",href:h,onClick:()=>{(0,s.EE)(s.NO.service_details,s.ir.service_details.link_button_click),m(d||"previous")}},"Open in Logs Drilldown"):null}},4509:(e,_,l)=>{l.d(_,{EE:()=>o,NO:()=>n,ir:()=>r});var t=l(8531),a=l(2533);const o=(e,_,l,o=!1)=>{const n=((e,_)=>`${a.id.replace(/-/g,"_")}_${e}_${_}`)(e,_);if(o){if(sessionStorage.getItem(n))return;sessionStorage.setItem(n,"1")}(0,t.reportInteraction)(n,l)},n={all:"all",service_details:"service_details",service_selection:"service_selection"},r={[n.service_selection]:{add_to_filters:"add_to_filters",aggregated_metrics_toggled:"aggregated_metrics_toggled",search_services_changed:"search_services_changed",service_selected:"service_selected"},[n.service_details]:{action_view_changed:"action_view_changed",add_to_filters_in_breakdown_clicked:"add_to_filters_in_breakdown_clicked",add_to_filters_in_json_panel:"add_to_filters_in_json_panel",change_line_format_in_json_panel:"change_line_format_in_json_panel",change_viz_type:"change_viz_type",label_in_panel_summary_clicked:"label_in_panel_summary_clicked",layout_type_changed:"layout_type_changed",level_in_logs_volume_clicked:"level_in_logs_volume_clicked",logs_clear_displayed_fields:"logs_clear_displayed_fields",logs_on_query_complete:"logs_on_query_complete",logs_on_query_error:"logs_on_query_error",logs_detail_filter_applied:"logs_detail_filter_applied",logs_popover_line_filter:"logs_popover_line_filter",logs_toggle_displayed_field:"logs_toggle_displayed_field",logs_visualization_toggle:"logs_visualization_toggle",open_in_explore_clicked:"open_in_explore_clicked",pattern_field_clicked:"pattern_field_clicked",pattern_removed:"pattern_removed",pattern_selected:"pattern_selected",search_string_in_logs_changed:"search_string_in_logs_changed",search_string_in_variables_changed:"search_string_in_variables_changed",select_field_in_breakdown_clicked:"select_field_in_breakdown_clicked",toggle_error_panels:"toggle_error_panels",value_breakdown_sort_change:"value_breakdown_sort_change",wasm_not_supported:"wasm_not_supported",embedded_go_to_explore_clicked:"embedded_go_to_explore_clicked",visualization_init:"visualization_init",fields_panel_type_toggle:"fields_panel_type_toggle",table_columns_header_button_reset_width:"table_columns_header_button_reset_width",table_columns_header_button_show_labels:"table_columns_header_button_show_labels",table_columns_header_button_show_text:"table_columns_header_button_show_text",table_columns_header_menu_show:"table_columns_header_menu_show",table_columns_header_menu_reset_width:"table_columns_header_menu_reset_width",table_columns_header_menu_show_labels:"table_columns_header_menu_show_labels",table_columns_header_menu_show_text:"table_columns_header_menu_show_text",table_columns_header_menu_slide_left:"table_columns_header_menu_slide_left",table_columns_header_menu_slide_right:"table_columns_header_menu_slide_right",table_columns_header_menu_hide_column:"table_columns_header_menu_hide_column",embedded_init:"embedded_init",embedded_error:"embedded_error",link_button_click:"link_button_click"},[n.all]:{interval_too_long:"interval_too_long",open_in_explore_menu_clicked:"open_in_explore_menu_clicked"}}}}]);
//# sourceMappingURL=546.js.map?_cache=810d946f2213fe3deeaf