{\n declare context: GrafanaContextType;\n static contextType = GrafanaContext;\n\n state: State = {\n panel: null,\n notFound: false,\n };\n\n componentDidMount() {\n const { match, route } = this.props;\n\n this.props.initDashboard({\n urlSlug: match.params.slug,\n urlUid: match.params.uid,\n urlType: match.params.type,\n routeName: route.routeName,\n fixUrl: false,\n keybindingSrv: this.context.keybindings,\n });\n }\n\n getPanelId(): number {\n return parseInt(this.props.queryParams.panelId ?? '0', 10);\n }\n\n componentDidUpdate(prevProps: Props) {\n const { dashboard } = this.props;\n\n if (!dashboard) {\n return;\n }\n\n // we just got a new dashboard\n if (!prevProps.dashboard || prevProps.dashboard.uid !== dashboard.uid) {\n const panel = dashboard.getPanelByUrlId(this.props.queryParams.panelId);\n\n if (!panel) {\n this.setState({ notFound: true });\n return;\n }\n\n if (panel) {\n dashboard.exitViewPanel(panel);\n }\n\n this.setState({ panel });\n dashboard.initViewPanel(panel);\n }\n }\n\n render() {\n return (\n \n );\n }\n}\n\nexport interface SoloPanelProps extends State {\n dashboard: DashboardModel | null;\n panelId: number;\n timezone?: string;\n}\n\nexport const SoloPanel = ({ dashboard, notFound, panel, panelId, timezone }: SoloPanelProps) => {\n if (notFound) {\n return Panel with id {panelId} not found
;\n }\n\n if (!panel || !dashboard) {\n return Loading & initializing dashboard
;\n }\n\n return (\n \n
\n {({ width, height }) => {\n if (width === 0) {\n return null;\n }\n return (\n \n );\n }}\n \n
\n );\n};\n\nexport default connector(SoloPanelPage);\n"],"names":["mapStateToProps","state","mapDispatchToProps","connector","SoloPanelPage","match","route","prevProps","dashboard","panel","SoloPanel","notFound","panelId","timezone","width","height"],"sourceRoot":""}