@novu/js 2.3.1 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
- import { Novu, isSameFilter } from '../chunk-QIWP6QB5.mjs';
1
+ import { Novu, isSameFilter } from '../chunk-YGB4AV4G.mjs';
2
+ import { parseMarkdownIntoTokens } from '../chunk-GPV65U5R.mjs';
2
3
  import { __privateAdd, __privateSet, __privateMethod, __privateGet, __spreadProps, __spreadValues, __objRest, __async } from '../chunk-STZMOEWR.mjs';
3
4
  import { delegateEvents, createComponent, mergeProps, render, Portal, spread, template, insert, memo, effect, className, use, addEventListener, setAttribute, Dynamic, isServer } from 'solid-js/web';
4
5
  import { createSignal, createContext, useContext, onMount, onCleanup, For, createMemo, createEffect, splitProps, Show, Switch as Switch$1, Match, createResource, createComputed, batch } from 'solid-js';
@@ -247,7 +248,7 @@ function formatToRelativeTime({
247
248
  } else if (diffInSeconds < SECONDS.inMonth) {
248
249
  return formatter.format(Math.floor(-diffInSeconds / SECONDS.inDay), "day");
249
250
  } else {
250
- return new Intl.DateTimeFormat(locale, { month: "short", day: "numeric" }).format(toDate);
251
+ return new Intl.DateTimeFormat(locale, { month: "short", day: "numeric" }).format(fromDate);
251
252
  }
252
253
  }
253
254
  var twMerge = extendTailwindMerge({
@@ -519,9 +520,9 @@ var useNovuEvent = ({
519
520
  }) => {
520
521
  const novu = useNovu();
521
522
  onMount(() => {
522
- novu.on(event, eventHandler);
523
+ const cleanup = novu.on(event, eventHandler);
523
524
  onCleanup(() => {
524
- novu.off(event, eventHandler);
525
+ cleanup();
525
526
  });
526
527
  });
527
528
  };
@@ -578,11 +579,14 @@ var useWebSocketEvent = ({
578
579
  postMessage(data);
579
580
  };
580
581
  onMount(() => {
582
+ let cleanup;
581
583
  const resolveLock = requestLock(`nv.${webSocketEvent}`, () => {
582
- novu.on(webSocketEvent, updateReadCount);
584
+ cleanup = novu.on(webSocketEvent, updateReadCount);
583
585
  });
584
586
  onCleanup(() => {
585
- novu.off(webSocketEvent, updateReadCount);
587
+ if (cleanup) {
588
+ cleanup();
589
+ }
586
590
  resolveLock();
587
591
  });
588
592
  });
@@ -1042,7 +1046,7 @@ var ExternalElementRenderer = (props) => {
1042
1046
  return _el$;
1043
1047
  })();
1044
1048
  };
1045
- var _tmpl$2 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M17.117 4.358l-1.159-1.4A1.21 1.21 0 0015 2.5H5c-.392 0-.733.175-.967.458l-1.15 1.4A1.632 1.632 0 002.5 5.417v10.416c0 .917.75 1.667 1.667 1.667h11.666c.917 0 1.667-.75 1.667-1.667V5.417c0-.4-.142-.775-.383-1.059zM5.2 4.167h9.6l.675.808H4.533l.667-.808zM4.167 15.833V6.667h11.666v9.166H4.167zm7.041-7.5H8.792v2.5H6.667L10 14.167l3.333-3.334h-2.125v-2.5z">`);
1049
+ var _tmpl$2 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M16.25 15V6.875L15 4.375H5L3.75 6.877V15c0 .345.28.625.625.625h11.25c.345 0 .625-.28.625-.625zM5 8.125h10v6.25H5v-6.25zm.772-2.5h8.455l.625 1.25H5.148l.625-1.25zm6.103 3.75h-3.75v1.25h3.75v-1.25z">`);
1046
1050
  var Archive = (props) => {
1047
1051
  return (() => {
1048
1052
  var _el$ = _tmpl$2();
@@ -1178,7 +1182,7 @@ var Unarchive = (props) => {
1178
1182
  return _el$;
1179
1183
  })();
1180
1184
  };
1181
- var _tmpl$19 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M18.334 5.817v7.516c0 .917-.75 1.667-1.667 1.667H5l-3.333 3.333v-15c0-.916.75-1.666 1.667-1.666h8.416c-.05.266-.083.55-.083.833 0 .283.033.567.083.833H3.334v10h13.333v-6.75a4.127 4.127 0 001.667-.766zm-5-3.317c0 1.383 1.116 2.5 2.5 2.5 1.383 0 2.5-1.117 2.5-2.5S17.217 0 15.834 0a2.497 2.497 0 00-2.5 2.5z">`);
1185
+ var _tmpl$19 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M10 15v1.25H4.996a.625.625 0 01-.621-.62V4.37c0-.342.28-.62.624-.62H12.5l3.125 3.125v4.375h-1.25V7.5h-2.5V5h-6.25v10H10zm1.54-.335l2.21 2.21 3.094-3.093-.884-.884-2.21 2.21-1.326-1.326-.884.883z">`);
1182
1186
  var Unread = (props) => {
1183
1187
  return (() => {
1184
1188
  var _el$ = _tmpl$19();
@@ -1186,17 +1190,13 @@ var Unread = (props) => {
1186
1190
  return _el$;
1187
1191
  })();
1188
1192
  };
1189
- var _tmpl$20 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=16 height=16 fill=none viewBox="0 0 16 16"><path fill=currentColor d="M8 11.333c.733 0 1.333-.6 1.333-1.333S8.733 8.667 8 8.667s-1.333.6-1.333 1.333.6 1.333 1.333 1.333zm4-6h-.667V4a3.335 3.335 0 00-6.666 0v1.333H4c-.733 0-1.333.6-1.333 1.334v6.666c0 .734.6 1.334 1.333 1.334h8c.733 0 1.333-.6 1.333-1.334V6.667c0-.734-.6-1.334-1.333-1.334zM5.933 4c0-1.14.927-2.067 2.067-2.067 1.14 0 2.067.927 2.067 2.067v1.333H5.933V4zM12 13.333H4V6.667h8v6.666z">`);
1190
- var Lock = () => {
1191
- return _tmpl$20();
1192
- };
1193
1193
 
1194
1194
  // src/ui/components/elements/Bell/DefaultBellContainer.tsx
1195
- var _tmpl$21 = /* @__PURE__ */ template(`<span>`);
1195
+ var _tmpl$20 = /* @__PURE__ */ template(`<span>`);
1196
1196
  var BellContainer = (props) => {
1197
1197
  const style = useStyle();
1198
1198
  return (() => {
1199
- var _el$ = _tmpl$21();
1199
+ var _el$ = _tmpl$20();
1200
1200
  insert(_el$, createComponent(BellIcon, {
1201
1201
  get ["class"]() {
1202
1202
  return style("bellIcon");
@@ -1207,7 +1207,7 @@ var BellContainer = (props) => {
1207
1207
  return props.unreadCount > 0;
1208
1208
  },
1209
1209
  get children() {
1210
- var _el$2 = _tmpl$21();
1210
+ var _el$2 = _tmpl$20();
1211
1211
  effect(() => className(_el$2, style("bellDot", "nt-absolute nt-top-2 nt-right-2 nt-block nt-size-2 nt-transform nt-translate-x-1/2 -nt-translate-y-1/2 nt-bg-primary nt-rounded-full nt-border nt-border-background")));
1212
1212
  return _el$2;
1213
1213
  }
@@ -1240,7 +1240,7 @@ var Bell = (props) => {
1240
1240
  }
1241
1241
  });
1242
1242
  };
1243
- var _tmpl$22 = /* @__PURE__ */ template(`<div class="nt-flex nt-shrink-0 nt-justify-center nt-items-center nt-gap-1 nt-mt-auto nt-pt-9 nt-pb-3 nt-text-foreground-alpha-200"><span class=nt-text-xs>Powered by Novu`);
1243
+ var _tmpl$21 = /* @__PURE__ */ template(`<div class="nt-flex nt-shrink-0 nt-justify-center nt-items-center nt-gap-1 nt-mt-auto nt-pt-9 nt-pb-3 nt-text-foreground-alpha-200"><span class=nt-text-xs>Powered by Novu`);
1244
1244
  var Footer = () => {
1245
1245
  const {
1246
1246
  hideBranding
@@ -1250,13 +1250,13 @@ var Footer = () => {
1250
1250
  return !hideBranding();
1251
1251
  },
1252
1252
  get children() {
1253
- var _el$ = _tmpl$22(), _el$2 = _el$.firstChild;
1253
+ var _el$ = _tmpl$21(), _el$2 = _el$.firstChild;
1254
1254
  insert(_el$, createComponent(Novu2, {}), _el$2);
1255
1255
  return _el$;
1256
1256
  }
1257
1257
  });
1258
1258
  };
1259
- var _tmpl$23 = /* @__PURE__ */ template(`<button>`);
1259
+ var _tmpl$22 = /* @__PURE__ */ template(`<button>`);
1260
1260
  var buttonVariants = cva("nt-inline-flex nt-gap-4 nt-items-center nt-justify-center nt-whitespace-nowrap nt-rounded-lg nt-text-sm nt-font-medium nt-ring-offset-background nt-transition-colors focus-visible:nt-outline-none focus-visible:nt-ring-2 focus-visible:nt-ring-primary nt-focus-visible:nt-ring-offset-2 disabled:nt-pointer-events-none disabled:nt-opacity-50", {
1261
1261
  variants: {
1262
1262
  variant: {
@@ -1283,7 +1283,7 @@ var Button = (props) => {
1283
1283
  const [local, rest] = splitProps(props, ["class", "appearanceKey"]);
1284
1284
  const style = useStyle();
1285
1285
  return (() => {
1286
- var _el$ = _tmpl$23();
1286
+ var _el$ = _tmpl$22();
1287
1287
  spread(_el$, mergeProps({
1288
1288
  get ["data-variant"]() {
1289
1289
  return props.variant;
@@ -1301,7 +1301,7 @@ var Button = (props) => {
1301
1301
  return _el$;
1302
1302
  })();
1303
1303
  };
1304
- var _tmpl$24 = /* @__PURE__ */ template(`<button>`);
1304
+ var _tmpl$23 = /* @__PURE__ */ template(`<button>`);
1305
1305
  var PopoverClose = (props) => {
1306
1306
  const {
1307
1307
  onClose
@@ -1322,7 +1322,7 @@ var PopoverClose = (props) => {
1322
1322
  }, rest));
1323
1323
  }
1324
1324
  return (() => {
1325
- var _el$ = _tmpl$24();
1325
+ var _el$ = _tmpl$23();
1326
1326
  _el$.$$click = handleClick;
1327
1327
  spread(_el$, rest, false, false);
1328
1328
  return _el$;
@@ -1515,7 +1515,7 @@ var PopoverContent = (props) => {
1515
1515
  }
1516
1516
  });
1517
1517
  };
1518
- var _tmpl$25 = /* @__PURE__ */ template(`<button>`);
1518
+ var _tmpl$24 = /* @__PURE__ */ template(`<button>`);
1519
1519
  var PopoverTrigger = (props) => {
1520
1520
  const {
1521
1521
  setReference,
@@ -1539,7 +1539,7 @@ var PopoverTrigger = (props) => {
1539
1539
  }, rest));
1540
1540
  }
1541
1541
  return (() => {
1542
- var _el$ = _tmpl$25();
1542
+ var _el$ = _tmpl$24();
1543
1543
  _el$.$$click = handleClick;
1544
1544
  use(setReference, _el$);
1545
1545
  spread(_el$, mergeProps({
@@ -1639,14 +1639,14 @@ var Dropdown = {
1639
1639
  */
1640
1640
  Item: DropdownItem
1641
1641
  };
1642
- var _tmpl$26 = /* @__PURE__ */ template(`<div role=tablist>`);
1643
- var _tmpl$27 = /* @__PURE__ */ template(`<div class="nt-border-t nt-border-secondary nt-mt-[-0.25rem] nt-relative nt-z-[-1]">`);
1642
+ var _tmpl$25 = /* @__PURE__ */ template(`<div role=tablist>`);
1643
+ var _tmpl$26 = /* @__PURE__ */ template(`<div class="nt-border-t nt-border-secondary nt-mt-[-0.25rem] nt-relative nt-z-[-1]">`);
1644
1644
  var tabsListVariants = () => "nt-flex nt-gap-6 nt-px-6 nt-py-1 nt-overflow-hidden";
1645
1645
  var TabsList = (props) => {
1646
1646
  const [local, rest] = splitProps(props, ["class", "appearanceKey", "ref", "children"]);
1647
1647
  const style = useStyle();
1648
1648
  return [(() => {
1649
- var _el$ = _tmpl$26();
1649
+ var _el$ = _tmpl$25();
1650
1650
  var _ref$ = local.ref;
1651
1651
  typeof _ref$ === "function" ? use(_ref$, _el$) : local.ref = _el$;
1652
1652
  spread(_el$, mergeProps({
@@ -1656,7 +1656,7 @@ var TabsList = (props) => {
1656
1656
  }, rest), false, true);
1657
1657
  insert(_el$, () => local.children);
1658
1658
  return _el$;
1659
- })(), _tmpl$27()];
1659
+ })(), _tmpl$26()];
1660
1660
  };
1661
1661
  var useKeyboardNavigation = ({
1662
1662
  activeTab,
@@ -1707,7 +1707,7 @@ var useKeyboardNavigation = ({
1707
1707
  };
1708
1708
 
1709
1709
  // src/ui/components/primitives/Tabs/TabsRoot.tsx
1710
- var _tmpl$28 = /* @__PURE__ */ template(`<div>`);
1710
+ var _tmpl$27 = /* @__PURE__ */ template(`<div>`);
1711
1711
  var TabsContext = createContext(void 0);
1712
1712
  var useTabsContext = () => {
1713
1713
  const context = useContext(TabsContext);
@@ -1746,7 +1746,7 @@ var TabsRoot = (props) => {
1746
1746
  setVisibleTabs
1747
1747
  },
1748
1748
  get children() {
1749
- var _el$ = _tmpl$28();
1749
+ var _el$ = _tmpl$27();
1750
1750
  use(setTabsContainer, _el$);
1751
1751
  spread(_el$, mergeProps({
1752
1752
  get ["class"]() {
@@ -1760,7 +1760,7 @@ var TabsRoot = (props) => {
1760
1760
  };
1761
1761
 
1762
1762
  // src/ui/components/primitives/Tabs/TabsContent.tsx
1763
- var _tmpl$29 = /* @__PURE__ */ template(`<div role=tabpanel>`);
1763
+ var _tmpl$28 = /* @__PURE__ */ template(`<div role=tabpanel>`);
1764
1764
  var TabsContent = (props) => {
1765
1765
  const [local, rest] = splitProps(props, ["value", "class", "appearanceKey", "children"]);
1766
1766
  const style = useStyle();
@@ -1772,7 +1772,7 @@ var TabsContent = (props) => {
1772
1772
  return activeTab() === local.value;
1773
1773
  },
1774
1774
  get children() {
1775
- var _el$ = _tmpl$29();
1775
+ var _el$ = _tmpl$28();
1776
1776
  spread(_el$, mergeProps({
1777
1777
  get ["class"]() {
1778
1778
  return memo(() => !!local.class)() ? local.class : style(local.appearanceKey || "tabsContent", activeTab() === local.value ? "nt-block" : "nt-hidden");
@@ -1859,7 +1859,7 @@ var inboxFilterLocalizationKeys = {
1859
1859
  unread: "inbox.filters.labels.unread",
1860
1860
  archived: "inbox.filters.labels.archived"
1861
1861
  };
1862
- var _tmpl$30 = /* @__PURE__ */ template(`<span><span></span><span>`);
1862
+ var _tmpl$29 = /* @__PURE__ */ template(`<span><span></span><span>`);
1863
1863
  var _tmpl$210 = /* @__PURE__ */ template(`<span>`);
1864
1864
  var cases = [{
1865
1865
  status: "unreadRead" /* UNREAD_READ */,
@@ -1904,7 +1904,7 @@ var StatusItem = (props) => {
1904
1904
  },
1905
1905
  get children() {
1906
1906
  return [(() => {
1907
- var _el$ = _tmpl$30(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
1907
+ var _el$ = _tmpl$29(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
1908
1908
  insert(_el$2, () => props.icon());
1909
1909
  insert(_el$3, () => t(props.localizationKey));
1910
1910
  effect((_p$) => {
@@ -1937,7 +1937,7 @@ var StatusItem = (props) => {
1937
1937
  };
1938
1938
 
1939
1939
  // src/ui/components/elements/InboxStatus/InboxStatusDropdown.tsx
1940
- var _tmpl$31 = /* @__PURE__ */ template(`<span>`);
1940
+ var _tmpl$30 = /* @__PURE__ */ template(`<span>`);
1941
1941
  var StatusDropdown = () => {
1942
1942
  const style = useStyle();
1943
1943
  const {
@@ -1962,7 +1962,7 @@ var StatusDropdown = () => {
1962
1962
  }, triggerProps, {
1963
1963
  get children() {
1964
1964
  return [(() => {
1965
- var _el$ = _tmpl$31();
1965
+ var _el$ = _tmpl$30();
1966
1966
  insert(_el$, () => t(inboxFilterLocalizationKeys[status()]));
1967
1967
  effect((_p$) => {
1968
1968
  var _v$ = inboxFilterLocalizationKeys[status()], _v$2 = style("inboxStatus__title", "nt-text-xl nt-font-semibold");
@@ -1975,7 +1975,7 @@ var StatusDropdown = () => {
1975
1975
  });
1976
1976
  return _el$;
1977
1977
  })(), (() => {
1978
- var _el$2 = _tmpl$31();
1978
+ var _el$2 = _tmpl$30();
1979
1979
  insert(_el$2, createComponent(ArrowDropDown, {}));
1980
1980
  effect(() => className(_el$2, style("inboxStatus__dropdownItemRight__icon", "nt-text-foreground-alpha-600")));
1981
1981
  return _el$2;
@@ -2011,8 +2011,8 @@ var useNotificationsInfiniteScroll = (props) => {
2011
2011
  }
2012
2012
  mutate({ data: data2.notifications, hasMore: data2.hasMore });
2013
2013
  };
2014
- novu.on("notifications.list.updated", listener);
2015
- onCleanup(() => novu.off("notifications.list.updated", listener));
2014
+ const cleanup = novu.on("notifications.list.updated", listener);
2015
+ onCleanup(() => cleanup());
2016
2016
  });
2017
2017
  createEffect(() => {
2018
2018
  const newFilter = __spreadValues({}, props.options());
@@ -2048,8 +2048,8 @@ var usePreferences = (options) => {
2048
2048
  }
2049
2049
  mutate(data);
2050
2050
  };
2051
- novu.on("preferences.list.updated", listener);
2052
- onCleanup(() => novu.off("preferences.list.updated", listener));
2051
+ const cleanup = novu.on("preferences.list.updated", listener);
2052
+ onCleanup(() => cleanup());
2053
2053
  });
2054
2054
  createEffect(() => {
2055
2055
  setLoading(preferences.loading);
@@ -2103,7 +2103,7 @@ var useArchiveAllRead = (props) => {
2103
2103
  };
2104
2104
 
2105
2105
  // src/ui/components/elements/Header/MoreActionsOptions.tsx
2106
- var _tmpl$32 = /* @__PURE__ */ template(`<span>`);
2106
+ var _tmpl$31 = /* @__PURE__ */ template(`<span>`);
2107
2107
  var MoreActionsOptions = () => {
2108
2108
  const {
2109
2109
  filter
@@ -2151,12 +2151,12 @@ var ActionsItem = (props) => {
2151
2151
  },
2152
2152
  get children() {
2153
2153
  return [(() => {
2154
- var _el$ = _tmpl$32();
2154
+ var _el$ = _tmpl$31();
2155
2155
  insert(_el$, () => props.icon());
2156
2156
  effect(() => className(_el$, style("moreActions__dropdownItemLeft__icon", "nt-text-foreground-alpha-600")));
2157
2157
  return _el$;
2158
2158
  })(), (() => {
2159
- var _el$2 = _tmpl$32();
2159
+ var _el$2 = _tmpl$31();
2160
2160
  insert(_el$2, () => t(props.localizationKey));
2161
2161
  effect((_p$) => {
2162
2162
  var _v$ = props.localizationKey, _v$2 = style("moreActions__dropdownItemLabel");
@@ -2215,11 +2215,11 @@ var MoreActionsDropdown = () => {
2215
2215
  };
2216
2216
 
2217
2217
  // src/ui/components/elements/Header/ActionsContainer.tsx
2218
- var _tmpl$33 = /* @__PURE__ */ template(`<div>`);
2218
+ var _tmpl$32 = /* @__PURE__ */ template(`<div>`);
2219
2219
  var ActionsContainer = (props) => {
2220
2220
  const style = useStyle();
2221
2221
  return (() => {
2222
- var _el$ = _tmpl$33();
2222
+ var _el$ = _tmpl$32();
2223
2223
  insert(_el$, createComponent(MoreActionsDropdown, {}), null);
2224
2224
  insert(_el$, createComponent(Show, {
2225
2225
  get when() {
@@ -2243,11 +2243,11 @@ var ActionsContainer = (props) => {
2243
2243
  };
2244
2244
 
2245
2245
  // src/ui/components/elements/Header/Header.tsx
2246
- var _tmpl$34 = /* @__PURE__ */ template(`<div>`);
2246
+ var _tmpl$33 = /* @__PURE__ */ template(`<div>`);
2247
2247
  var Header = (props) => {
2248
2248
  const style = useStyle();
2249
2249
  return (() => {
2250
- var _el$ = _tmpl$34();
2250
+ var _el$ = _tmpl$33();
2251
2251
  insert(_el$, createComponent(StatusDropdown, {}), null);
2252
2252
  insert(_el$, createComponent(ActionsContainer, {
2253
2253
  get showPreferences() {
@@ -2258,7 +2258,7 @@ var Header = (props) => {
2258
2258
  return _el$;
2259
2259
  })();
2260
2260
  };
2261
- var _tmpl$35 = /* @__PURE__ */ template(`<div><div data-localization=preferences.title>`);
2261
+ var _tmpl$34 = /* @__PURE__ */ template(`<div><div data-localization=preferences.title>`);
2262
2262
  var _tmpl$211 = /* @__PURE__ */ template(`<button>`);
2263
2263
  var PreferencesHeader = (props) => {
2264
2264
  const style = useStyle();
@@ -2266,7 +2266,7 @@ var PreferencesHeader = (props) => {
2266
2266
  t
2267
2267
  } = useLocalization();
2268
2268
  return (() => {
2269
- var _el$ = _tmpl$35(), _el$2 = _el$.firstChild;
2269
+ var _el$ = _tmpl$34(), _el$2 = _el$.firstChild;
2270
2270
  insert(_el$, createComponent(Show, {
2271
2271
  get when() {
2272
2272
  return props.navigateToNotifications;
@@ -2293,7 +2293,7 @@ var PreferencesHeader = (props) => {
2293
2293
  })();
2294
2294
  };
2295
2295
  delegateEvents(["click"]);
2296
- var _tmpl$36 = /* @__PURE__ */ template(`<div>`);
2296
+ var _tmpl$35 = /* @__PURE__ */ template(`<div>`);
2297
2297
  var Root = (props) => {
2298
2298
  const [_, rest] = splitProps(props, ["class"]);
2299
2299
  const {
@@ -2309,7 +2309,7 @@ var Root = (props) => {
2309
2309
  },
2310
2310
  children: new Comment(" Powered by Novu - https://novu.co ")
2311
2311
  }), (() => {
2312
- var _el$ = _tmpl$36();
2312
+ var _el$ = _tmpl$35();
2313
2313
  spread(_el$, mergeProps({
2314
2314
  get id() {
2315
2315
  return `novu-root-${id()}`;
@@ -2321,191 +2321,24 @@ var Root = (props) => {
2321
2321
  return _el$;
2322
2322
  })()];
2323
2323
  };
2324
- var TooltipContext = createContext(void 0);
2325
- function TooltipRoot(props) {
2326
- const [reference, setReference] = createSignal(null);
2327
- const [floating, setFloating] = createSignal(null);
2328
- const position = useFloating(reference, floating, {
2329
- placement: props.placement || "top",
2330
- whileElementsMounted: autoUpdate,
2331
- middleware: [offset(10), flip({
2332
- fallbackPlacements: props.fallbackPlacements || ["bottom"]
2333
- }), shift()]
2334
- });
2335
- const [isOpen, setIsOpen] = useUncontrolledState({
2336
- value: props.open,
2337
- fallbackValue: false
2338
- });
2339
- return createComponent(TooltipContext.Provider, {
2340
- value: {
2341
- reference,
2342
- setReference,
2343
- floating,
2344
- setFloating,
2345
- open: isOpen,
2346
- setOpen: setIsOpen,
2347
- floatingStyles: () => {
2348
- var _a, _b;
2349
- return {
2350
- position: position.strategy,
2351
- top: `${(_a = position.y) != null ? _a : 0}px`,
2352
- left: `${(_b = position.x) != null ? _b : 0}px`
2353
- };
2354
- }
2355
- },
2356
- get children() {
2357
- return props.children;
2358
- }
2359
- });
2360
- }
2361
- function useTooltip() {
2362
- const context = useContext(TooltipContext);
2363
- if (!context) {
2364
- throw new Error("useTooltip must be used within Tooltip.Root component");
2365
- }
2366
- return context;
2367
- }
2368
-
2369
- // src/ui/components/primitives/Tooltip/TooltipContent.tsx
2370
- var _tmpl$37 = /* @__PURE__ */ template(`<div>`);
2371
- var tooltipContentVariants = () => "nt-bg-foreground nt-p-2 nt-shadow-tooltip nt-rounded-lg nt-text-background nt-text-xs";
2372
- var TooltipContentBody = (props) => {
2373
- const {
2374
- open,
2375
- setFloating,
2376
- floating,
2377
- floatingStyles
2378
- } = useTooltip();
2379
- const {
2380
- setActive,
2381
- removeActive
2382
- } = useFocusManager();
2383
- const [local, rest] = splitProps(props, ["class", "appearanceKey", "style"]);
2384
- const style = useStyle();
2385
- onMount(() => {
2386
- const floatingEl = floating();
2387
- setActive(floatingEl);
2388
- onCleanup(() => {
2389
- removeActive(floatingEl);
2390
- });
2391
- });
2392
- return (() => {
2393
- var _el$ = _tmpl$37();
2394
- use(setFloating, _el$);
2395
- spread(_el$, mergeProps({
2396
- get ["class"]() {
2397
- return memo(() => !!local.class)() ? local.class : style(local.appearanceKey || "tooltipContent", tooltipContentVariants());
2398
- },
2399
- get style() {
2400
- return __spreadProps(__spreadValues({}, floatingStyles()), {
2401
- "z-index": 99999
2402
- });
2403
- },
2404
- get ["data-open"]() {
2405
- return open();
2406
- }
2407
- }, rest), false, false);
2408
- return _el$;
2409
- })();
2410
- };
2411
- var TooltipContent = (props) => {
2412
- const {
2413
- open
2414
- } = useTooltip();
2415
- return createComponent(Show, {
2416
- get when() {
2417
- return open();
2418
- },
2419
- get children() {
2420
- return createComponent(Portal, {
2421
- get children() {
2422
- return createComponent(Root, {
2423
- get children() {
2424
- return createComponent(TooltipContentBody, props);
2425
- }
2426
- });
2427
- }
2428
- });
2429
- }
2430
- });
2431
- };
2432
- var _tmpl$38 = /* @__PURE__ */ template(`<button>`);
2433
- var TooltipTrigger = (props) => {
2434
- const {
2435
- setReference,
2436
- setOpen
2437
- } = useTooltip();
2438
- const style = useStyle();
2439
- const [local, rest] = splitProps(props, ["appearanceKey", "asChild", "onClick"]);
2440
- if (local.asChild) {
2441
- return createComponent(Dynamic, mergeProps({
2442
- get component() {
2443
- return local.asChild;
2444
- },
2445
- ref: setReference,
2446
- onMouseEnter: () => {
2447
- setOpen(true);
2448
- },
2449
- onMouseLeave: () => {
2450
- setOpen(false);
2451
- }
2452
- }, rest));
2453
- }
2454
- return (() => {
2455
- var _el$ = _tmpl$38();
2456
- _el$.addEventListener("mouseleave", () => {
2457
- setOpen(false);
2458
- });
2459
- _el$.addEventListener("mouseenter", () => {
2460
- setOpen(true);
2461
- });
2462
- use(setReference, _el$);
2463
- spread(_el$, mergeProps({
2464
- get ["class"]() {
2465
- return style(local.appearanceKey || "tooltipTrigger");
2466
- }
2467
- }, rest), false, true);
2468
- insert(_el$, () => props.children);
2469
- return _el$;
2470
- })();
2471
- };
2472
-
2473
- // src/ui/components/primitives/Tooltip/index.ts
2474
- var Tooltip = {
2475
- Root: TooltipRoot,
2476
- /**
2477
- * Tooltip.Trigger renders a `button` and has no default styling.
2478
- */
2479
- Trigger: TooltipTrigger,
2480
- /**
2481
- * Tooltip.Content renders a `div` and has popover specific styling.
2482
- */
2483
- Content: TooltipContent
2484
- };
2485
- var _tmpl$39 = /* @__PURE__ */ template(`<label><input type=checkbox class="nt-peer nt-sr-only"><div>`);
2324
+ var _tmpl$36 = /* @__PURE__ */ template(`<label><input type=checkbox class="nt-peer nt-sr-only"><div>`);
2486
2325
  var Switch = (props) => {
2487
2326
  const style = useStyle();
2488
2327
  return (() => {
2489
- var _el$ = _tmpl$39(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
2328
+ var _el$ = _tmpl$36(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
2490
2329
  _el$2.addEventListener("change", (e) => {
2491
2330
  props.onChange(e.target.checked);
2492
2331
  });
2493
2332
  effect((_p$) => {
2494
- var _v$ = style("channelSwitch", `nt-relative nt-inline-flex nt-cursor-pointer nt-items-center data-[disabled=true]:nt-cursor-not-allowed`), _v$2 = props.disabled, _v$3 = props.disabled, _v$4 = style("channelSwitchThumb", `nt-peer nt-h-6 nt-w-11 nt-rounded-full nt-border nt-border-neutral-alpha-200 peer-checked:nt-border-neutral-alpha-400 nt-bg-neutral-alpha-300 after:nt-absolute after:nt-left-[2px] after:nt-top-0.5 after:nt-h-5 after:nt-w-5 after:nt-rounded-full after:nt-border after:nt-border-neutral-alpha-400 after:nt-bg-background after:nt-transition-all after:nt-content-[''] peer-checked:nt-bg-primary peer-checked:after:nt-translate-x-full peer-checked:after:nt-border-background nt-transition-all nt-duration-200 after:nt-duration-200 data-[disabled=true]:nt-opacity-40`), _v$5 = props.disabled, _v$6 = props.checked;
2333
+ var _v$ = style("channelSwitch", `nt-relative nt-inline-flex nt-cursor-pointer nt-items-center`), _v$2 = style("channelSwitchThumb", `nt-peer nt-h-6 nt-w-11 nt-rounded-full nt-border nt-border-neutral-alpha-200 peer-checked:nt-border-neutral-alpha-400 nt-bg-neutral-alpha-300 after:nt-absolute after:nt-left-[2px] after:nt-top-0.5 after:nt-h-5 after:nt-w-5 after:nt-rounded-full after:nt-border after:nt-border-neutral-alpha-400 after:nt-bg-background after:nt-transition-all after:nt-content-[''] peer-checked:nt-bg-primary peer-checked:after:nt-translate-x-full peer-checked:after:nt-border-background nt-transition-all nt-duration-200 after:nt-duration-200`), _v$3 = props.checked;
2495
2334
  _v$ !== _p$.e && className(_el$, _p$.e = _v$);
2496
- _v$2 !== _p$.t && setAttribute(_el$, "data-disabled", _p$.t = _v$2);
2497
- _v$3 !== _p$.a && (_el$2.disabled = _p$.a = _v$3);
2498
- _v$4 !== _p$.o && className(_el$3, _p$.o = _v$4);
2499
- _v$5 !== _p$.i && setAttribute(_el$3, "data-disabled", _p$.i = _v$5);
2500
- _v$6 !== _p$.n && setAttribute(_el$3, "data-checked", _p$.n = _v$6);
2335
+ _v$2 !== _p$.t && className(_el$3, _p$.t = _v$2);
2336
+ _v$3 !== _p$.a && setAttribute(_el$3, "data-checked", _p$.a = _v$3);
2501
2337
  return _p$;
2502
2338
  }, {
2503
2339
  e: void 0,
2504
2340
  t: void 0,
2505
- a: void 0,
2506
- o: void 0,
2507
- i: void 0,
2508
- n: void 0
2341
+ a: void 0
2509
2342
  });
2510
2343
  effect(() => _el$2.checked = props.checked);
2511
2344
  return _el$;
@@ -2513,13 +2346,10 @@ var Switch = (props) => {
2513
2346
  };
2514
2347
 
2515
2348
  // src/ui/components/elements/Preferences/ChannelRow.tsx
2516
- var _tmpl$40 = /* @__PURE__ */ template(`<div><div><div></div><span></span></div><div>`);
2349
+ var _tmpl$37 = /* @__PURE__ */ template(`<div><div><div></div><span></span></div><div>`);
2517
2350
  var ChannelRow = (props) => {
2518
2351
  const style = useStyle();
2519
2352
  const updatePreference = (enabled) => __async(void 0, null, function* () {
2520
- if (props.isCritical) {
2521
- return;
2522
- }
2523
2353
  props.onChange({
2524
2354
  channel: props.channel,
2525
2355
  enabled,
@@ -2530,7 +2360,7 @@ var ChannelRow = (props) => {
2530
2360
  updatePreference(checked);
2531
2361
  };
2532
2362
  return (() => {
2533
- var _el$ = _tmpl$40(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling;
2363
+ var _el$ = _tmpl$37(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling;
2534
2364
  insert(_el$3, createComponent(ChannelIcon, {
2535
2365
  get channel() {
2536
2366
  return props.channel;
@@ -2541,25 +2371,20 @@ var ChannelRow = (props) => {
2541
2371
  get checked() {
2542
2372
  return props.enabled;
2543
2373
  },
2544
- onChange: (checked) => onChange(checked),
2545
- get disabled() {
2546
- return props.isCritical;
2547
- }
2374
+ onChange: (checked) => onChange(checked)
2548
2375
  }));
2549
2376
  effect((_p$) => {
2550
- var _v$ = style("channelContainer", "nt-flex nt-justify-between nt-items-center nt-h-11 nt-gap-2 data-[disabled=true]:nt-text-foreground-alpha-600"), _v$2 = props.isCritical, _v$3 = style("channelLabelContainer", "nt-flex nt-items-center nt-gap-2"), _v$4 = style("channelLabel", "nt-text-base nt-font-semibold"), _v$5 = style("channelSwitchContainer", "nt-flex nt-items-center");
2377
+ var _v$ = style("channelContainer", "nt-flex nt-justify-between nt-items-center nt-h-11 nt-gap-2 data-[disabled=true]:nt-text-foreground-alpha-600"), _v$2 = style("channelLabelContainer", "nt-flex nt-items-center nt-gap-2"), _v$3 = style("channelLabel", "nt-text-base nt-font-semibold"), _v$4 = style("channelSwitchContainer", "nt-flex nt-items-center");
2551
2378
  _v$ !== _p$.e && className(_el$, _p$.e = _v$);
2552
- _v$2 !== _p$.t && setAttribute(_el$, "data-disabled", _p$.t = _v$2);
2553
- _v$3 !== _p$.a && className(_el$2, _p$.a = _v$3);
2554
- _v$4 !== _p$.o && className(_el$4, _p$.o = _v$4);
2555
- _v$5 !== _p$.i && className(_el$5, _p$.i = _v$5);
2379
+ _v$2 !== _p$.t && className(_el$2, _p$.t = _v$2);
2380
+ _v$3 !== _p$.a && className(_el$4, _p$.a = _v$3);
2381
+ _v$4 !== _p$.o && className(_el$5, _p$.o = _v$4);
2556
2382
  return _p$;
2557
2383
  }, {
2558
2384
  e: void 0,
2559
2385
  t: void 0,
2560
2386
  a: void 0,
2561
- o: void 0,
2562
- i: void 0
2387
+ o: void 0
2563
2388
  });
2564
2389
  return _el$;
2565
2390
  })();
@@ -2596,11 +2421,11 @@ var getLabel = (channel) => {
2596
2421
  return "";
2597
2422
  }
2598
2423
  };
2599
- var _tmpl$41 = /* @__PURE__ */ template(`<div>`);
2424
+ var _tmpl$38 = /* @__PURE__ */ template(`<div>`);
2600
2425
  var SkeletonText = (props) => {
2601
2426
  const style = useStyle();
2602
2427
  return (() => {
2603
- var _el$ = _tmpl$41();
2428
+ var _el$ = _tmpl$38();
2604
2429
  effect(() => className(_el$, style(props.appearanceKey, cn("nt-w-full nt-h-3 nt-rounded nt-bg-foreground-alpha-100", props.class))));
2605
2430
  return _el$;
2606
2431
  })();
@@ -2608,14 +2433,14 @@ var SkeletonText = (props) => {
2608
2433
  var SkeletonAvatar = (props) => {
2609
2434
  const style = useStyle();
2610
2435
  return (() => {
2611
- var _el$2 = _tmpl$41();
2436
+ var _el$2 = _tmpl$38();
2612
2437
  effect(() => className(_el$2, style(props.appearanceKey, cn("nt-size-8 nt-rounded-lg nt-bg-foreground-alpha-100", props.class))));
2613
2438
  return _el$2;
2614
2439
  })();
2615
2440
  };
2616
2441
 
2617
2442
  // src/ui/components/elements/Preferences/LoadingScreen.tsx
2618
- var _tmpl$42 = /* @__PURE__ */ template(`<div><div class="nt-flex nt-flex-col nt-self-stretch nt-gap-1 nt-flex-1"></div><div>`);
2443
+ var _tmpl$39 = /* @__PURE__ */ template(`<div><div class="nt-flex nt-flex-col nt-self-stretch nt-gap-1 nt-flex-1"></div><div>`);
2619
2444
  var LoadingScreen = () => {
2620
2445
  return createComponent(For, {
2621
2446
  get each() {
@@ -2629,7 +2454,7 @@ var LoadingScreen = () => {
2629
2454
  var LoadingSkeleton = () => {
2630
2455
  const style = useStyle();
2631
2456
  return (() => {
2632
- var _el$ = _tmpl$42(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
2457
+ var _el$ = _tmpl$39(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
2633
2458
  insert(_el$2, createComponent(SkeletonText, {
2634
2459
  appearanceKey: "skeletonText",
2635
2460
  "class": "nt-w-1/3"
@@ -2645,10 +2470,9 @@ var LoadingSkeleton = () => {
2645
2470
  };
2646
2471
 
2647
2472
  // src/ui/components/elements/Preferences/Preferences.tsx
2648
- var _tmpl$43 = /* @__PURE__ */ template(`<div>`);
2473
+ var _tmpl$40 = /* @__PURE__ */ template(`<div>`);
2649
2474
  var _tmpl$212 = /* @__PURE__ */ template(`<span>`);
2650
- var _tmpl$310 = /* @__PURE__ */ template(`<span data-localization=preferences.workflow.disabled.notice>`);
2651
- var _tmpl$44 = /* @__PURE__ */ template(`<div><div><div><div></div></div><span>`);
2475
+ var _tmpl$310 = /* @__PURE__ */ template(`<div><div><div><div></div></div><span>`);
2652
2476
  var Preferences = () => {
2653
2477
  var _a;
2654
2478
  const style = useStyle();
@@ -2695,7 +2519,7 @@ var Preferences = () => {
2695
2519
  });
2696
2520
  };
2697
2521
  return (() => {
2698
- var _el$ = _tmpl$43();
2522
+ var _el$ = _tmpl$40();
2699
2523
  insert(_el$, createComponent(Show, {
2700
2524
  get when() {
2701
2525
  return loading();
@@ -2743,10 +2567,6 @@ var Preferences = () => {
2743
2567
  },
2744
2568
  get onChange() {
2745
2569
  return optimisticUpdate(preference());
2746
- },
2747
- get isCritical() {
2748
- var _a2;
2749
- return (_a2 = preference().workflow) == null ? void 0 : _a2.critical;
2750
2570
  }
2751
2571
  });
2752
2572
  }
@@ -2777,7 +2597,7 @@ var ChannelsLabel = (props) => {
2777
2597
  return channels.map((c, index) => [c, memo(() => index < channels.length - 1 && ", ")]);
2778
2598
  };
2779
2599
  return (() => {
2780
- var _el$3 = _tmpl$43();
2600
+ var _el$3 = _tmpl$40();
2781
2601
  insert(_el$3, channelNames);
2782
2602
  effect(() => className(_el$3, style("channelDescription", "nt-text-sm nt-text-foreground-alpha-600 nt-text-start")));
2783
2603
  return _el$3;
@@ -2795,37 +2615,9 @@ var PreferencesRow = (props) => {
2795
2615
  return channels().length > 0;
2796
2616
  },
2797
2617
  get children() {
2798
- var _el$4 = _tmpl$44(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$6.nextSibling;
2618
+ var _el$4 = _tmpl$310(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$6.nextSibling;
2799
2619
  _el$5.$$click = () => setIsOpen((prev) => !prev);
2800
- insert(_el$7, createComponent(Show, {
2801
- get when() {
2802
- return props.isCritical;
2803
- },
2804
- get children() {
2805
- return createComponent(Tooltip.Root, {
2806
- get children() {
2807
- return [createComponent(Tooltip.Trigger, {
2808
- asChild: (childProps) => (() => {
2809
- var _el$11 = _tmpl$212();
2810
- spread(_el$11, mergeProps({
2811
- get ["class"]() {
2812
- return style("workflowLabelDisabled__icon", "nt-text-foreground-alpha-600");
2813
- }
2814
- }, childProps), false, true);
2815
- insert(_el$11, createComponent(Lock, {}));
2816
- return _el$11;
2817
- })()
2818
- }), createComponent(Tooltip.Content, {
2819
- "data-localization": "preferences.workflow.disabled.tooltip",
2820
- get children() {
2821
- return t("preferences.workflow.disabled.tooltip");
2822
- }
2823
- })];
2824
- }
2825
- });
2826
- }
2827
- }), null);
2828
- insert(_el$7, () => t(props.localizationKey), null);
2620
+ insert(_el$7, () => t(props.localizationKey));
2829
2621
  insert(_el$6, createComponent(ChannelsLabel, {
2830
2622
  get channels() {
2831
2623
  return props.channels;
@@ -2859,18 +2651,7 @@ var PreferencesRow = (props) => {
2859
2651
  return style("channelsContainerCollapsible", "nt-grid nt-self-stretch");
2860
2652
  },
2861
2653
  get children() {
2862
- var _el$9 = _tmpl$43();
2863
- insert(_el$9, createComponent(Show, {
2864
- get when() {
2865
- return props.isCritical;
2866
- },
2867
- get children() {
2868
- var _el$10 = _tmpl$310();
2869
- insert(_el$10, () => t("preferences.workflow.disabled.notice"));
2870
- effect(() => className(_el$10, style("workflowContainerDisabledNotice", "nt-text-sm nt-text-foreground-alpha-600 nt-text-start")));
2871
- return _el$10;
2872
- }
2873
- }), null);
2654
+ var _el$9 = _tmpl$40();
2874
2655
  insert(_el$9, createComponent(For, {
2875
2656
  get each() {
2876
2657
  return channels();
@@ -2885,12 +2666,9 @@ var PreferencesRow = (props) => {
2885
2666
  },
2886
2667
  get onChange() {
2887
2668
  return props.onChange;
2888
- },
2889
- get isCritical() {
2890
- return props.isCritical;
2891
2669
  }
2892
2670
  })
2893
- }), null);
2671
+ }));
2894
2672
  effect(() => className(_el$9, style("channelsContainer", "nt-overflow-hidden nt-flex-col nt-gap-1")));
2895
2673
  return _el$9;
2896
2674
  }
@@ -2900,20 +2678,16 @@ var PreferencesRow = (props) => {
2900
2678
  }
2901
2679
  }), null);
2902
2680
  effect((_p$) => {
2903
- var _v$ = style("workflowContainer", `nt-p-4 nt-flex nt-flex-col nt-gap-1 nt-items-start nt-self-stretch hover:nt-bg-neutral-alpha-50 nt-rounded-lg data-[disabled=true]:nt-bg-neutral-alpha-50`), _v$2 = props.isCritical, _v$3 = isOpen(), _v$4 = style("workflowLabelContainer", "nt-flex nt-justify-between nt-flex-nowrap nt-self-stretch nt-cursor-pointer nt-items-center"), _v$5 = props.isCritical, _v$6 = isOpen(), _v$7 = style("workflowLabel", "nt-text-base nt-font-semibold nt-text-start nt-flex nt-items-center nt-gap-1"), _v$8 = props.isCritical, _v$9 = props.localizationKey, _v$10 = isOpen(), _v$11 = style("workflowContainerRight__icon", `nt-text-foreground-alpha-600 nt-transition-all nt-duration-200 data-[open=true]:nt-transform data-[open=true]:nt-rotate-180`), _v$12 = props.isCritical, _v$13 = isOpen();
2681
+ var _v$ = style("workflowContainer", `nt-p-4 nt-flex nt-flex-col nt-gap-1 nt-items-start nt-self-stretch hover:nt-bg-neutral-alpha-50 nt-rounded-lg data-[disabled=true]:nt-bg-neutral-alpha-50`), _v$2 = isOpen(), _v$3 = style("workflowLabelContainer", "nt-flex nt-justify-between nt-flex-nowrap nt-self-stretch nt-cursor-pointer nt-items-center"), _v$4 = isOpen(), _v$5 = style("workflowLabel", "nt-text-base nt-font-semibold nt-text-start nt-flex nt-items-center nt-gap-1"), _v$6 = props.localizationKey, _v$7 = isOpen(), _v$8 = style("workflowContainerRight__icon", `nt-text-foreground-alpha-600 nt-transition-all nt-duration-200 data-[open=true]:nt-transform data-[open=true]:nt-rotate-180`), _v$9 = isOpen();
2904
2682
  _v$ !== _p$.e && className(_el$4, _p$.e = _v$);
2905
- _v$2 !== _p$.t && setAttribute(_el$4, "data-disabled", _p$.t = _v$2);
2906
- _v$3 !== _p$.a && setAttribute(_el$4, "data-open", _p$.a = _v$3);
2907
- _v$4 !== _p$.o && className(_el$5, _p$.o = _v$4);
2908
- _v$5 !== _p$.i && setAttribute(_el$5, "data-disabled", _p$.i = _v$5);
2909
- _v$6 !== _p$.n && setAttribute(_el$5, "data-open", _p$.n = _v$6);
2910
- _v$7 !== _p$.s && className(_el$7, _p$.s = _v$7);
2911
- _v$8 !== _p$.h && setAttribute(_el$7, "data-disabled", _p$.h = _v$8);
2912
- _v$9 !== _p$.r && setAttribute(_el$7, "data-localization", _p$.r = _v$9);
2913
- _v$10 !== _p$.d && setAttribute(_el$7, "data-open", _p$.d = _v$10);
2914
- _v$11 !== _p$.l && className(_el$8, _p$.l = _v$11);
2915
- _v$12 !== _p$.u && setAttribute(_el$8, "data-disabled", _p$.u = _v$12);
2916
- _v$13 !== _p$.c && setAttribute(_el$8, "data-open", _p$.c = _v$13);
2683
+ _v$2 !== _p$.t && setAttribute(_el$4, "data-open", _p$.t = _v$2);
2684
+ _v$3 !== _p$.a && className(_el$5, _p$.a = _v$3);
2685
+ _v$4 !== _p$.o && setAttribute(_el$5, "data-open", _p$.o = _v$4);
2686
+ _v$5 !== _p$.i && className(_el$7, _p$.i = _v$5);
2687
+ _v$6 !== _p$.n && setAttribute(_el$7, "data-localization", _p$.n = _v$6);
2688
+ _v$7 !== _p$.s && setAttribute(_el$7, "data-open", _p$.s = _v$7);
2689
+ _v$8 !== _p$.h && className(_el$8, _p$.h = _v$8);
2690
+ _v$9 !== _p$.r && setAttribute(_el$8, "data-open", _p$.r = _v$9);
2917
2691
  return _p$;
2918
2692
  }, {
2919
2693
  e: void 0,
@@ -2924,53 +2698,19 @@ var PreferencesRow = (props) => {
2924
2698
  n: void 0,
2925
2699
  s: void 0,
2926
2700
  h: void 0,
2927
- r: void 0,
2928
- d: void 0,
2929
- l: void 0,
2930
- u: void 0,
2931
- c: void 0
2701
+ r: void 0
2932
2702
  });
2933
2703
  return _el$4;
2934
2704
  }
2935
2705
  });
2936
2706
  };
2937
2707
  delegateEvents(["click"]);
2938
- var _tmpl$45 = /* @__PURE__ */ template(`<strong>`);
2708
+ var _tmpl$41 = /* @__PURE__ */ template(`<strong>`);
2939
2709
  var _tmpl$213 = /* @__PURE__ */ template(`<p>`);
2940
- var parseMarkdownIntoTokens = (text) => {
2941
- const tokens = [];
2942
- let buffer = "";
2943
- let inBold = false;
2944
- for (let i = 0; i < text.length; i += 1) {
2945
- if (text[i] === "\\" && text[i + 1] === "*") {
2946
- buffer += "*";
2947
- i += 1;
2948
- } else if (text[i] === "*" && text[i + 1] === "*") {
2949
- if (buffer) {
2950
- tokens.push({
2951
- type: inBold ? "bold" : "text",
2952
- content: buffer
2953
- });
2954
- buffer = "";
2955
- }
2956
- inBold = !inBold;
2957
- i += 1;
2958
- } else {
2959
- buffer += text[i];
2960
- }
2961
- }
2962
- if (buffer) {
2963
- tokens.push({
2964
- type: inBold ? "bold" : "text",
2965
- content: buffer
2966
- });
2967
- }
2968
- return tokens;
2969
- };
2970
2710
  var Bold = (props) => {
2971
2711
  const style = useStyle();
2972
2712
  return (() => {
2973
- var _el$ = _tmpl$45();
2713
+ var _el$ = _tmpl$41();
2974
2714
  insert(_el$, () => props.children);
2975
2715
  effect(() => className(_el$, style(props.appearanceKey || "strong", "nt-font-semibold")));
2976
2716
  return _el$;
@@ -3014,9 +2754,170 @@ var Markdown = (props) => {
3014
2754
  })();
3015
2755
  };
3016
2756
  var Markdown_default = Markdown;
2757
+ var TooltipContext = createContext(void 0);
2758
+ function TooltipRoot(props) {
2759
+ const [reference, setReference] = createSignal(null);
2760
+ const [floating, setFloating] = createSignal(null);
2761
+ const position = useFloating(reference, floating, {
2762
+ placement: props.placement || "top",
2763
+ whileElementsMounted: autoUpdate,
2764
+ middleware: [offset(10), flip({
2765
+ fallbackPlacements: props.fallbackPlacements || ["bottom"]
2766
+ }), shift()]
2767
+ });
2768
+ const [isOpen, setIsOpen] = useUncontrolledState({
2769
+ value: props.open,
2770
+ fallbackValue: false
2771
+ });
2772
+ return createComponent(TooltipContext.Provider, {
2773
+ value: {
2774
+ reference,
2775
+ setReference,
2776
+ floating,
2777
+ setFloating,
2778
+ open: isOpen,
2779
+ setOpen: setIsOpen,
2780
+ floatingStyles: () => {
2781
+ var _a, _b;
2782
+ return {
2783
+ position: position.strategy,
2784
+ top: `${(_a = position.y) != null ? _a : 0}px`,
2785
+ left: `${(_b = position.x) != null ? _b : 0}px`
2786
+ };
2787
+ }
2788
+ },
2789
+ get children() {
2790
+ return props.children;
2791
+ }
2792
+ });
2793
+ }
2794
+ function useTooltip() {
2795
+ const context = useContext(TooltipContext);
2796
+ if (!context) {
2797
+ throw new Error("useTooltip must be used within Tooltip.Root component");
2798
+ }
2799
+ return context;
2800
+ }
2801
+
2802
+ // src/ui/components/primitives/Tooltip/TooltipContent.tsx
2803
+ var _tmpl$42 = /* @__PURE__ */ template(`<div>`);
2804
+ var tooltipContentVariants = () => "nt-bg-foreground nt-p-2 nt-shadow-tooltip nt-rounded-lg nt-text-background nt-text-xs";
2805
+ var TooltipContentBody = (props) => {
2806
+ const {
2807
+ open,
2808
+ setFloating,
2809
+ floating,
2810
+ floatingStyles
2811
+ } = useTooltip();
2812
+ const {
2813
+ setActive,
2814
+ removeActive
2815
+ } = useFocusManager();
2816
+ const [local, rest] = splitProps(props, ["class", "appearanceKey", "style"]);
2817
+ const style = useStyle();
2818
+ onMount(() => {
2819
+ const floatingEl = floating();
2820
+ setActive(floatingEl);
2821
+ onCleanup(() => {
2822
+ removeActive(floatingEl);
2823
+ });
2824
+ });
2825
+ return (() => {
2826
+ var _el$ = _tmpl$42();
2827
+ use(setFloating, _el$);
2828
+ spread(_el$, mergeProps({
2829
+ get ["class"]() {
2830
+ return memo(() => !!local.class)() ? local.class : style(local.appearanceKey || "tooltipContent", tooltipContentVariants());
2831
+ },
2832
+ get style() {
2833
+ return __spreadProps(__spreadValues({}, floatingStyles()), {
2834
+ "z-index": 99999
2835
+ });
2836
+ },
2837
+ get ["data-open"]() {
2838
+ return open();
2839
+ }
2840
+ }, rest), false, false);
2841
+ return _el$;
2842
+ })();
2843
+ };
2844
+ var TooltipContent = (props) => {
2845
+ const {
2846
+ open
2847
+ } = useTooltip();
2848
+ return createComponent(Show, {
2849
+ get when() {
2850
+ return open();
2851
+ },
2852
+ get children() {
2853
+ return createComponent(Portal, {
2854
+ get children() {
2855
+ return createComponent(Root, {
2856
+ get children() {
2857
+ return createComponent(TooltipContentBody, props);
2858
+ }
2859
+ });
2860
+ }
2861
+ });
2862
+ }
2863
+ });
2864
+ };
2865
+ var _tmpl$43 = /* @__PURE__ */ template(`<button>`);
2866
+ var TooltipTrigger = (props) => {
2867
+ const {
2868
+ setReference,
2869
+ setOpen
2870
+ } = useTooltip();
2871
+ const style = useStyle();
2872
+ const [local, rest] = splitProps(props, ["appearanceKey", "asChild", "onClick"]);
2873
+ if (local.asChild) {
2874
+ return createComponent(Dynamic, mergeProps({
2875
+ get component() {
2876
+ return local.asChild;
2877
+ },
2878
+ ref: setReference,
2879
+ onMouseEnter: () => {
2880
+ setOpen(true);
2881
+ },
2882
+ onMouseLeave: () => {
2883
+ setOpen(false);
2884
+ }
2885
+ }, rest));
2886
+ }
2887
+ return (() => {
2888
+ var _el$ = _tmpl$43();
2889
+ _el$.addEventListener("mouseleave", () => {
2890
+ setOpen(false);
2891
+ });
2892
+ _el$.addEventListener("mouseenter", () => {
2893
+ setOpen(true);
2894
+ });
2895
+ use(setReference, _el$);
2896
+ spread(_el$, mergeProps({
2897
+ get ["class"]() {
2898
+ return style(local.appearanceKey || "tooltipTrigger");
2899
+ }
2900
+ }, rest), false, true);
2901
+ insert(_el$, () => props.children);
2902
+ return _el$;
2903
+ })();
2904
+ };
2905
+
2906
+ // src/ui/components/primitives/Tooltip/index.ts
2907
+ var Tooltip = {
2908
+ Root: TooltipRoot,
2909
+ /**
2910
+ * Tooltip.Trigger renders a `button` and has no default styling.
2911
+ */
2912
+ Trigger: TooltipTrigger,
2913
+ /**
2914
+ * Tooltip.Content renders a `div` and has popover specific styling.
2915
+ */
2916
+ Content: TooltipContent
2917
+ };
3017
2918
 
3018
2919
  // src/ui/components/Notification/DefaultNotification.tsx
3019
- var _tmpl$46 = /* @__PURE__ */ template(`<span>`);
2920
+ var _tmpl$44 = /* @__PURE__ */ template(`<span>`);
3020
2921
  var _tmpl$214 = /* @__PURE__ */ template(`<img>`);
3021
2922
  var _tmpl$311 = /* @__PURE__ */ template(`<a><div><div class="nt-relative nt-shrink-0 nt-float-right nt-ml-1 nt-pr-1.5"><p></p><div></div></div><div>`);
3022
2923
  var DefaultNotification = (props) => {
@@ -3074,7 +2975,7 @@ var DefaultNotification = (props) => {
3074
2975
  return !props.notification.isRead;
3075
2976
  },
3076
2977
  get children() {
3077
- var _el$2 = _tmpl$46();
2978
+ var _el$2 = _tmpl$44();
3078
2979
  effect(() => className(_el$2, style("notificationDot", "nt-absolute -nt-translate-x-[1.0625rem] nt-translate-y-1/2 nt-size-2.5 nt-bg-primary nt-rounded-full nt-border nt-border-neutral-alpha-200")));
3079
2980
  return _el$2;
3080
2981
  }
@@ -3120,7 +3021,7 @@ var DefaultNotification = (props) => {
3120
3021
  e.stopPropagation();
3121
3022
  props.notification.read();
3122
3023
  },
3123
- "class": "hover:nt-bg-neutral-alpha-50 nt-py-0.5",
3024
+ "class": "hover:nt-bg-neutral-alpha-50 nt-p-0.5",
3124
3025
  get children() {
3125
3026
  return createComponent(ReadAll, {});
3126
3027
  }
@@ -3147,7 +3048,7 @@ var DefaultNotification = (props) => {
3147
3048
  e.stopPropagation();
3148
3049
  props.notification.unread();
3149
3050
  },
3150
- "class": "hover:nt-bg-neutral-alpha-50 nt-py-0.5",
3051
+ "class": "hover:nt-bg-neutral-alpha-50 nt-p-0.5",
3151
3052
  get children() {
3152
3053
  return createComponent(Unread, {});
3153
3054
  }
@@ -3181,7 +3082,7 @@ var DefaultNotification = (props) => {
3181
3082
  e.stopPropagation();
3182
3083
  props.notification.archive();
3183
3084
  },
3184
- "class": "hover:nt-bg-neutral-alpha-50 nt-py-0.5",
3085
+ "class": "hover:nt-bg-neutral-alpha-50 nt-p-0.5",
3185
3086
  get children() {
3186
3087
  return createComponent(Archive, {});
3187
3088
  }
@@ -3208,7 +3109,7 @@ var DefaultNotification = (props) => {
3208
3109
  e.stopPropagation();
3209
3110
  props.notification.unarchive();
3210
3111
  },
3211
- "class": "hover:nt-bg-neutral-alpha-50 nt-py-0.5",
3112
+ "class": "hover:nt-bg-neutral-alpha-50 nt-p-0.5",
3212
3113
  get children() {
3213
3114
  return createComponent(Unarchive, {});
3214
3115
  }
@@ -3278,7 +3179,7 @@ var DefaultNotification = (props) => {
3278
3179
  var _a;
3279
3180
  var _v$3 = style("notification", cn("nt-w-full nt-text-sm hover:nt-bg-neutral-alpha-50 nt-group nt-relative nt-flex nt-py-4 nt-px-6 nt-gap-2", {
3280
3181
  "nt-cursor-pointer": !props.notification.isRead || !!((_a = props.notification.redirect) == null ? void 0 : _a.url)
3281
- })), _v$4 = style("notificationBody", "nt-overflow-hidden nt-w-full"), _v$5 = style("notificationDate", "nt-transition nt-duration-100 nt-ease-out nt-text-foreground-alpha-400 nt-shrink-0 nt-float-right nt-text-right group-hover:nt-opacity-0"), _v$6 = style("notificationDefaultActions", `nt-transition nt-duration-100 nt-ease-out nt-gap-2 nt-flex nt-shrink-0 nt-opacity-0 group-hover:nt-opacity-100 nt-justify-center nt-items-center nt-absolute nt-top-0 nt-right-0 nt-bg-neutral-alpha-50 nt-rounded-lg`), _v$7 = style("notificationCustomActions", "nt-flex nt-flex-wrap nt-gap-4 nt-mt-4");
3182
+ })), _v$4 = style("notificationBody", "nt-overflow-hidden nt-w-full"), _v$5 = style("notificationDate", "nt-transition nt-duration-100 nt-ease-out nt-text-foreground-alpha-400 nt-shrink-0 nt-float-right nt-text-right group-hover:nt-opacity-0"), _v$6 = style("notificationDefaultActions", `nt-transition nt-duration-100 nt-ease-out nt-gap-2 nt-flex nt-shrink-0 nt-opacity-0 group-hover:nt-opacity-100 nt-justify-center nt-items-center nt-absolute nt-top-0 nt-right-0 nt-bg-neutral-alpha-50 nt-rounded-lg nt-backdrop-blur-md nt-p-0.5`), _v$7 = style("notificationCustomActions", "nt-flex nt-flex-wrap nt-gap-4 nt-mt-4");
3282
3183
  _v$3 !== _p$.e && className(_el$, _p$.e = _v$3);
3283
3184
  _v$4 !== _p$.t && className(_el$4, _p$.t = _v$4);
3284
3185
  _v$5 !== _p$.a && className(_el$6, _p$.a = _v$5);
@@ -3326,10 +3227,10 @@ var Notification = (props) => {
3326
3227
  }
3327
3228
  });
3328
3229
  };
3329
- var _tmpl$47 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=48 height=48 viewBox="0 0 48 48"fill=none><path fill=currentColor d="M35.2 21.62L32.38 18.8L39.5 11.7L42.32 14.52C42.1 14.58 35.2 21.62 35.2 21.62ZM26 6H22V16H26V6ZM12.8 21.62L15.62 18.8L8.52 11.68L5.68 14.52C5.9 14.58 12.8 21.62 12.8 21.62ZM40 28H33.16C31.62 31.52 28.08 34 24 34C19.92 34 16.38 31.52 14.84 28H8V38H40V28ZM40 24C42.2 24 44 25.8 44 28V38C44 40.2 42.2 42 40 42H8C5.8 42 4 40.2 4 38V28C4 25.8 5.8 24 8 24H18C18 27.32 20.68 30 24 30C27.32 30 30 27.32 30 24H40Z">`);
3230
+ var _tmpl$45 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=48 height=48 viewBox="0 0 48 48"fill=none><path fill=currentColor d="M35.2 21.62L32.38 18.8L39.5 11.7L42.32 14.52C42.1 14.58 35.2 21.62 35.2 21.62ZM26 6H22V16H26V6ZM12.8 21.62L15.62 18.8L8.52 11.68L5.68 14.52C5.9 14.58 12.8 21.62 12.8 21.62ZM40 28H33.16C31.62 31.52 28.08 34 24 34C19.92 34 16.38 31.52 14.84 28H8V38H40V28ZM40 24C42.2 24 44 25.8 44 28V38C44 40.2 42.2 42 40 42H8C5.8 42 4 40.2 4 38V28C4 25.8 5.8 24 8 24H18C18 27.32 20.68 30 24 30C27.32 30 30 27.32 30 24H40Z">`);
3330
3231
  function EmptyIcon(props) {
3331
3232
  return (() => {
3332
- var _el$ = _tmpl$47();
3233
+ var _el$ = _tmpl$45();
3333
3234
  spread(_el$, props, true, true);
3334
3235
  return _el$;
3335
3236
  })();
@@ -3360,10 +3261,10 @@ var NewMessagesCta = (props) => {
3360
3261
  }
3361
3262
  });
3362
3263
  };
3363
- var _tmpl$48 = /* @__PURE__ */ template(`<div class="nt-flex nt-gap-2 nt-px-6 nt-py-4 nt-w-full"><div class="nt-flex nt-flex-col nt-self-stretch nt-gap-3 nt-flex-1"><div class="nt-flex nt-gap-1"></div><div class="nt-flex nt-gap-1">`);
3264
+ var _tmpl$46 = /* @__PURE__ */ template(`<div class="nt-flex nt-gap-2 nt-px-6 nt-py-4 nt-w-full"><div class="nt-flex nt-flex-col nt-self-stretch nt-gap-3 nt-flex-1"><div class="nt-flex nt-gap-1"></div><div class="nt-flex nt-gap-1">`);
3364
3265
  var NotificationSkeleton = () => {
3365
3266
  return (() => {
3366
- var _el$ = _tmpl$48(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling;
3267
+ var _el$ = _tmpl$46(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling;
3367
3268
  insert(_el$, createComponent(SkeletonAvatar, {
3368
3269
  appearanceKey: "skeletonAvatar"
3369
3270
  }), _el$2);
@@ -3400,7 +3301,7 @@ var NotificationListSkeleton = (props) => {
3400
3301
  };
3401
3302
 
3402
3303
  // src/ui/components/Notification/NotificationList.tsx
3403
- var _tmpl$49 = /* @__PURE__ */ template(`<div><p data-localization=notifications.emptyNotice>`);
3304
+ var _tmpl$47 = /* @__PURE__ */ template(`<div><p data-localization=notifications.emptyNotice>`);
3404
3305
  var _tmpl$215 = /* @__PURE__ */ template(`<div>`);
3405
3306
  var _tmpl$312 = /* @__PURE__ */ template(`<div><div>`);
3406
3307
  var EmptyNotificationList = () => {
@@ -3409,7 +3310,7 @@ var EmptyNotificationList = () => {
3409
3310
  t
3410
3311
  } = useLocalization();
3411
3312
  return (() => {
3412
- var _el$ = _tmpl$49(), _el$2 = _el$.firstChild;
3313
+ var _el$ = _tmpl$47(), _el$2 = _el$.firstChild;
3413
3314
  insert(_el$, createComponent(EmptyIcon, {
3414
3315
  get ["class"]() {
3415
3316
  return style("notificationListEmptyNoticeIcon");
@@ -3556,13 +3457,13 @@ var NotificationList = (props) => {
3556
3457
  return _el$3;
3557
3458
  })();
3558
3459
  };
3559
- var _tmpl$50 = /* @__PURE__ */ template(`<span>`);
3460
+ var _tmpl$48 = /* @__PURE__ */ template(`<span>`);
3560
3461
  var getDisplayCount = (count) => count >= 100 ? "99+" : count;
3561
3462
  var InboxTabUnreadNotificationsCount = (props) => {
3562
3463
  const style = useStyle();
3563
3464
  const displayCount = createMemo(() => getDisplayCount(props.count));
3564
3465
  return (() => {
3565
- var _el$ = _tmpl$50();
3466
+ var _el$ = _tmpl$48();
3566
3467
  insert(_el$, displayCount);
3567
3468
  effect(() => className(_el$, style("notificationsTabsTriggerCount", "nt-rounded-full nt-bg-counter nt-px-[6px] nt-text-counter-foreground nt-text-sm")));
3568
3469
  return _el$;
@@ -3587,7 +3488,7 @@ var InboxTab = (props) => {
3587
3488
  },
3588
3489
  get children() {
3589
3490
  return [(() => {
3590
- var _el$2 = _tmpl$50();
3491
+ var _el$2 = _tmpl$48();
3591
3492
  insert(_el$2, () => props.label);
3592
3493
  effect(() => className(_el$2, style("notificationsTabsTriggerLabel", "nt-text-sm nt-font-medium")));
3593
3494
  return _el$2;
@@ -3622,7 +3523,7 @@ var InboxDropdownTab = (props) => {
3622
3523
  },
3623
3524
  get children() {
3624
3525
  return [(() => {
3625
- var _el$3 = _tmpl$50();
3526
+ var _el$3 = _tmpl$48();
3626
3527
  insert(_el$3, () => props.label);
3627
3528
  effect(() => className(_el$3, style("moreTabs__dropdownItemLabel", "nt-mr-auto")));
3628
3529
  return _el$3;
@@ -3822,7 +3723,7 @@ var InboxTabs = (props) => {
3822
3723
  };
3823
3724
 
3824
3725
  // src/ui/components/Inbox.tsx
3825
- var _tmpl$51 = /* @__PURE__ */ template(`<div>`);
3726
+ var _tmpl$49 = /* @__PURE__ */ template(`<div>`);
3826
3727
  var InboxPage = /* @__PURE__ */ function(InboxPage2) {
3827
3728
  InboxPage2["Notifications"] = "notifications";
3828
3729
  InboxPage2["Preferences"] = "preferences";
@@ -3844,7 +3745,7 @@ var InboxContent = (props) => {
3844
3745
  };
3845
3746
  });
3846
3747
  return (() => {
3847
- var _el$ = _tmpl$51();
3748
+ var _el$ = _tmpl$49();
3848
3749
  insert(_el$, createComponent(Switch$1, {
3849
3750
  get children() {
3850
3751
  return [createComponent(Match, {
@@ -4091,7 +3992,7 @@ var Renderer = (props) => {
4091
3992
  }
4092
3993
  });
4093
3994
  };
4094
- var version = "2.3.1";
3995
+ var version = "2.5.0";
4095
3996
  var cssHref = `https://cdn.jsdelivr.net/npm/@novu/js@${version}/dist/index.css`;
4096
3997
  var _dispose, _rootElement, _mountedElements, _setMountedElements, _appearance, _setAppearance, _localization, _setLocalization, _options, _setOptions, _tabs, _setTabs, _routerPush, _setRouterPush, _preferencesFilter, _setPreferencesFilter, _predefinedNovu, _NovuUI_instances, mountComponentRenderer_fn, updateComponentProps_fn;
4097
3998
  var NovuUI = class {