hunk.code_window: import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
   import { WidgetShell } from './ApplicationShell';
   import { NotificationCenterWidgetContainer } from './notification-center';
   import { sendNotificationClick, sendUrlChange, unseenChanged } from '../embed/embed.service';
   export function App() {
     return (
       <Router>
  
hunk.labels: keep keep keep replace keep keep keep keep
hunk.after_edit: import { actionClick, sendNotificationClick, sendUrlChange, unseenChanged } from '../embed/embed.service';
  
hunk.file_path: apps/widget/src/components/App.tsx
hunk.type: replace
file: import { IMessage } from '@novu/shared';
  
  export function sendUrlChange(url: string) {
    if (!window.parentIFrame) return;
    window.parentIFrame.sendMessage({
      type: 'url_change',
      url,
    });
  }
  
  export function sendNotificationClick(notification: IMessage) {
    if (!window.parentIFrame) return;
    window.parentIFrame.sendMessage({
      type: 'notification_click',
      notification,
    });
  }
  
  export function unseenChanged(unseenCount: number) {
    if ('parentIFrame' in window) {
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      (window as any).parentIFrame.sendMessage({
        type: 'unseen_count_changed',
        count: unseenCount,
      });
    }
  }
  