adminizer 4.3.0-build.80 → 4.3.0-build.81

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.
Files changed (167) hide show
  1. package/assets/add-ChaPnvFv.js +1 -0
  2. package/assets/{add-form-C04ZI5LT.js → add-form-DNqlORQQ.js} +1 -1
  3. package/assets/add-group-D6YsQVrC.js +1 -0
  4. package/assets/{add-group-form-CyRwxTs3.js → add-group-form-CDi1y4af.js} +1 -1
  5. package/assets/{add-user-form-yp020h4r.js → add-user-form-BzXHahSY.js} +1 -1
  6. package/assets/add-user-psdNyGx8.js +1 -0
  7. package/assets/{app-CpGtjhxF.css → app-PLVuwM-H.css} +1 -1
  8. package/assets/{app-layout-BmT5KQwc.js → app-layout-AWzEe1aH.js} +1 -1
  9. package/assets/{app-sidebar-4lm9f_CG.js → app-sidebar-Bd4nWVXq.js} +1 -1
  10. package/assets/app-sidebar-header-jBFp1qZb.js +1 -0
  11. package/assets/app.js +3 -3
  12. package/assets/{catalog-CG_EB2kz.js → catalog-XiWBZptC.js} +1 -1
  13. package/assets/{dashboard-CsmJfdLb.js → dashboard-DcRJErQB.js} +1 -1
  14. package/assets/date-picker-A6CYw4SC.js +1 -0
  15. package/assets/del-modal-0klf0PNC.js +1 -0
  16. package/assets/{field-renderer-Bp1lfm0v.js → field-renderer-CYB5W2He.js} +3 -3
  17. package/assets/form-B-he6_tT.js +1 -0
  18. package/assets/{form-CSTeMDf5.js → form-BGRpsR-M.js} +1 -1
  19. package/assets/{home-D00XjLjD.js → home-B7aZTHTv.js} +2 -2
  20. package/assets/icon-k6999vVE.js +1 -0
  21. package/assets/{init-user-L-oxFTOv.js → init-user-Btm16ElL.js} +1 -1
  22. package/assets/input-error-Dbp_lp61.js +1 -0
  23. package/assets/list-_tZumymo.js +1 -0
  24. package/assets/{list-table-vIvydJV2.js → list-table-OzVUH7i4.js} +4 -4
  25. package/assets/{login-DLMJ6l_r.js → login-DeqxLVx3.js} +1 -1
  26. package/assets/manifest.json +74 -74
  27. package/assets/material-icon-B9BY_7p9.js +1 -0
  28. package/assets/{media-manager-ASGJ4PcS.js → media-manager-DQ5CA_na.js} +1 -1
  29. package/assets/{module-mxngd2cA.js → module-Drcr0QjC.js} +1 -1
  30. package/assets/{nav-footer-DbGCtmmN.js → nav-footer-DWHxIgb7.js} +1 -1
  31. package/assets/{nav-main-BcWhl71g.js → nav-main-CRT9ezos.js} +1 -1
  32. package/assets/notification-C7K-zK4k.js +27 -0
  33. package/assets/{register-C_W_hOmq.js → register-CMhPasDj.js} +1 -1
  34. package/assets/tabs-GDFuClHU.js +1 -0
  35. package/assets/{theme-switcher-D1G6OSMc.js → theme-switcher-C35zBCil.js} +1 -1
  36. package/assets/{welcome-FHRCdke0.js → welcome-CbhDDQlg.js} +1 -1
  37. package/controllers/add.js +1 -1
  38. package/controllers/catalog/FrontentCatalogAdapter.d.ts +4 -4
  39. package/controllers/edit.js +1 -15
  40. package/controllers/list.js +2 -2
  41. package/controllers/login.js +2 -2
  42. package/controllers/navigation/edit.js +1 -1
  43. package/controllers/notifications/NotificationController.d.ts +5 -5
  44. package/controllers/notifications/NotificationController.js +77 -78
  45. package/controllers/remove.js +1 -11
  46. package/controllers/view.js +1 -1
  47. package/helpers/configHelper.d.ts +1 -1
  48. package/helpers/fieldsHelper.d.ts +1 -1
  49. package/helpers/fieldsHelper.js +1 -1
  50. package/helpers/inertiaAddHelper.d.ts +1 -1
  51. package/helpers/translationHelper.d.ts +1 -1
  52. package/helpers/translationHelper.js +1 -1
  53. package/index.d.ts +14 -13
  54. package/index.js +14 -13
  55. package/interfaces/adminpanelConfig.d.ts +1 -1
  56. package/interfaces/global.d.ts +3 -3
  57. package/interfaces/types.d.ts +10 -1
  58. package/lib/Adminizer.d.ts +7 -7
  59. package/lib/Adminizer.js +7 -7
  60. package/lib/{v4/DataAccessor.d.ts → DataAccessor.d.ts} +4 -4
  61. package/lib/{v4/DataAccessor.js → DataAccessor.js} +3 -3
  62. package/lib/{v4/I18n.js → I18n.js} +2 -2
  63. package/lib/{v4/PolicyManager.d.ts → PolicyManager.d.ts} +1 -1
  64. package/lib/{v4/PolicyManager.js → PolicyManager.js} +2 -2
  65. package/lib/{v4/catalog → catalog}/AbstractCatalog.d.ts +1 -1
  66. package/lib/{v4/catalog → catalog}/Navigation.d.ts +2 -2
  67. package/lib/{v4/catalog → catalog}/Navigation.js +1 -1
  68. package/lib/{v4/controls → controls}/AbstractControls.d.ts +1 -1
  69. package/lib/{v4/controls → controls}/codeEditor/MonacoEditor.d.ts +1 -1
  70. package/lib/{v4/controls → controls}/geojsoneditor/GeoEditor.d.ts +1 -1
  71. package/lib/{v4/controls → controls}/jsoneditor/JsonEditor.d.ts +1 -1
  72. package/lib/{v4/controls → controls}/markdown/ToastUiEditor.d.ts +1 -1
  73. package/lib/{v4/controls → controls}/table/Handsontable.d.ts +1 -1
  74. package/lib/{v4/controls → controls}/wysiwyg/CKeditor.d.ts +1 -1
  75. package/lib/{v4/datatable → datatable}/NodeTable.d.ts +1 -1
  76. package/lib/{v4/model → model}/AbstractModel.d.ts +12 -0
  77. package/lib/model/AbstractModel.js +178 -0
  78. package/lib/{v4/model → model}/ModelHandler.js +1 -1
  79. package/lib/{v4/model → model}/adapter/sequelize.d.ts +0 -1
  80. package/lib/{v4/model → model}/adapter/sequelize.js +6 -3
  81. package/lib/{v4/notifications → notifications}/AbstractNotificationService.d.ts +14 -7
  82. package/lib/notifications/AbstractNotificationService.js +233 -0
  83. package/lib/{v4/notifications → notifications}/GeneralNotificationService.d.ts +1 -1
  84. package/lib/{v4/notifications → notifications}/GeneralNotificationService.js +4 -2
  85. package/lib/notifications/NotificationHandler.d.ts +27 -0
  86. package/lib/notifications/NotificationHandler.js +41 -0
  87. package/lib/{v4/notifications → notifications}/SystemNotificationService.d.ts +5 -4
  88. package/lib/notifications/SystemNotificationService.js +173 -0
  89. package/lib/{v4/widgets → widgets}/abstractCustom.d.ts +1 -1
  90. package/lib/{v4/widgets → widgets}/abstractLink.d.ts +1 -1
  91. package/lib/{v4/widgets → widgets}/abstractWidgetBase.d.ts +1 -1
  92. package/lib/{v4/widgets → widgets}/widgetHandler.d.ts +2 -2
  93. package/migrations/index.d.ts +3 -0
  94. package/migrations/index.js +4 -0
  95. package/migrations/index.ts +5 -0
  96. package/migrations/umzug/0001.d.ts +7 -0
  97. package/migrations/umzug/0001.js +119 -0
  98. package/migrations/umzug/0001.ts +132 -0
  99. package/migrations/umzug.d.ts +2 -0
  100. package/migrations/umzug.js +8 -0
  101. package/migrations/umzug.ts +9 -0
  102. package/models/NotificationAP.d.ts +8 -0
  103. package/models/NotificationAP.js +8 -0
  104. package/models/UserAP.d.ts +1 -1
  105. package/package.json +5 -4
  106. package/system/Router.js +4 -8
  107. package/system/bindControls.js +6 -6
  108. package/system/bindInertia.js +4 -3
  109. package/system/bindNavigation.js +1 -1
  110. package/system/bindNotifications.js +3 -3
  111. package/system/bindReqFunctions.js +8 -25
  112. package/system/defaults.js +1 -1
  113. package/ui/components/ui/table.d.ts +1 -1
  114. package/ui/components/ui/table.js +2 -2
  115. package/assets/add-DSapOiv0.js +0 -1
  116. package/assets/add-group-DWR7SBTO.js +0 -1
  117. package/assets/add-user-acATGxUL.js +0 -1
  118. package/assets/app-sidebar-header-CxXmzszq.js +0 -1
  119. package/assets/date-picker-By3kj-Rx.js +0 -1
  120. package/assets/del-modal-DlcbcdR5.js +0 -1
  121. package/assets/form-CxHRGp7p.js +0 -1
  122. package/assets/icon-ButfCBrt.js +0 -1
  123. package/assets/input-error-CHsDLcK0.js +0 -1
  124. package/assets/list-4TOTsjqE.js +0 -1
  125. package/assets/material-icon-sXk4BK-N.js +0 -1
  126. package/assets/notification-BEfA5sT6.js +0 -1
  127. package/assets/tabs-CgZW_LLn.js +0 -1
  128. package/lib/v4/model/AbstractModel.js +0 -79
  129. package/lib/v4/notifications/AbstractNotificationService.js +0 -150
  130. package/lib/v4/notifications/NotificationHandler.d.ts +0 -69
  131. package/lib/v4/notifications/NotificationHandler.js +0 -127
  132. package/lib/v4/notifications/SystemNotificationService.js +0 -124
  133. /package/lib/{v4/I18n.d.ts → I18n.d.ts} +0 -0
  134. /package/lib/{v4/POWCaptcha.d.ts → POWCaptcha.d.ts} +0 -0
  135. /package/lib/{v4/POWCaptcha.js → POWCaptcha.js} +0 -0
  136. /package/lib/{v4/catalog → catalog}/AbstractCatalog.js +0 -0
  137. /package/lib/{v4/catalog → catalog}/CatalogHandler.d.ts +0 -0
  138. /package/lib/{v4/catalog → catalog}/CatalogHandler.js +0 -0
  139. /package/lib/{v4/controls → controls}/AbstractControls.js +0 -0
  140. /package/lib/{v4/controls → controls}/ControlsHandler.d.ts +0 -0
  141. /package/lib/{v4/controls → controls}/ControlsHandler.js +0 -0
  142. /package/lib/{v4/controls → controls}/codeEditor/MonacoEditor.js +0 -0
  143. /package/lib/{v4/controls → controls}/geojsoneditor/GeoEditor.js +0 -0
  144. /package/lib/{v4/controls → controls}/jsoneditor/JsonEditor.js +0 -0
  145. /package/lib/{v4/controls → controls}/markdown/ToastUiEditor.js +0 -0
  146. /package/lib/{v4/controls → controls}/table/Handsontable.js +0 -0
  147. /package/lib/{v4/controls → controls}/wysiwyg/CKeditor.js +0 -0
  148. /package/lib/{v4/datatable → datatable}/NodeTable.js +0 -0
  149. /package/lib/{v4/helper → helper}/jwt.d.ts +0 -0
  150. /package/lib/{v4/helper → helper}/jwt.js +0 -0
  151. /package/lib/{v4/inertia → inertia}/flash.d.ts +0 -0
  152. /package/lib/{v4/inertia → inertia}/flash.js +0 -0
  153. /package/lib/{v4/inertia → inertia}/inertiaAdapter.d.ts +0 -0
  154. /package/lib/{v4/inertia → inertia}/inertiaAdapter.js +0 -0
  155. /package/lib/{v4/model → model}/ModelHandler.d.ts +0 -0
  156. /package/lib/{v4/model → model}/adapter/waterline.d.ts +0 -0
  157. /package/lib/{v4/model → model}/adapter/waterline.js +0 -0
  158. /package/lib/{v4/widgets → widgets}/abstractAction.d.ts +0 -0
  159. /package/lib/{v4/widgets → widgets}/abstractAction.js +0 -0
  160. /package/lib/{v4/widgets → widgets}/abstractCustom.js +0 -0
  161. /package/lib/{v4/widgets → widgets}/abstractInfo.d.ts +0 -0
  162. /package/lib/{v4/widgets → widgets}/abstractInfo.js +0 -0
  163. /package/lib/{v4/widgets → widgets}/abstractLink.js +0 -0
  164. /package/lib/{v4/widgets → widgets}/abstractSwitch.d.ts +0 -0
  165. /package/lib/{v4/widgets → widgets}/abstractSwitch.js +0 -0
  166. /package/lib/{v4/widgets → widgets}/abstractWidgetBase.js +0 -0
  167. /package/lib/{v4/widgets → widgets}/widgetHandler.js +0 -0
@@ -1 +1 @@
1
- import{q as N,j as s,aK as b,aL as g,aM as i,aN as c,aO as f,aP as v,aQ as k,aR as d,B as C,aS as M,aT as w,aU as _,aV as y,aW as B,aX as x,U as n,aY as T,aZ as p,a_ as t,C as o,a$ as h,b0 as j,b1 as m,b2 as u,b3 as R,b4 as U}from"./app.js";import{NavMain as $}from"./nav-main-BcWhl71g.js";import l from"./material-icon-sXk4BK-N.js";import"./jsoneditor-CBqATVR0.js";import"./vendor-DoC2WAmd.js";import"./monaco-B1uVVM7f.js";import"./handsontable-D6MvFmcM.js";function G(){const r=N();return s.jsxs(b,{collapsible:"icon",variant:"inset",children:[s.jsx(g,{children:s.jsx(i,{children:s.jsxs(c,{children:[s.jsx(f,{className:"p-0 shadow-none border-none bg-transparent hidden md:block",children:s.jsxs(v,{children:[s.jsx(k,{asChild:!0,className:"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground rounded-md",children:s.jsx(d,{asChild:!0,children:s.jsx(C,{variant:"ghost",asChild:!0,className:`w-full ${r.props.section?"":"pointer-events-none"}`,children:s.jsxs("div",{children:[s.jsx(l,{name:"rocket_launch",className:"!text-[18px]"}),s.jsx("span",{className:"group-data-[state=collapsed]:hidden",children:r.props.brand}),r.props.section&&s.jsx(M,{className:"ml-auto group-data-[state=collapsed]:hidden"})]})})})}),r.props.section&&s.jsx(w,{side:"right",className:"z-[1003]",children:r.props.section.map(a=>s.jsx("div",{children:a.subItems?s.jsxs(_,{children:[s.jsxs(y,{className:"flex gap-2 items-center cursor-pointer",children:[s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:a.title})]}),s.jsx(B,{children:a.subItems.map(e=>s.jsx(x,{children:e.type==="blank"?s.jsxs("a",{href:e.link,target:"_blank",className:"flex gap-2 items-center",children:[e.icon&&s.jsx(l,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]},e.id):s.jsxs(n,{href:e.link,className:"flex gap-2 items-center",children:[e.icon&&s.jsx(l,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]},e.id)},e.id))})]}):s.jsx(x,{children:a.type==="blank"?s.jsxs("a",{href:a.link,target:"_blank",className:"flex gap-2 items-center",children:[a.icon&&s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:a.title})]}):s.jsxs(n,{href:a.link,className:"flex gap-2 items-center",children:[a.icon&&s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:a.title})]})})},a.id))})]})}),s.jsx(T,{className:"px-2 py-0 block md:hidden",children:s.jsx(i,{children:s.jsx(p,{asChild:!0,className:"group/collapsible",children:s.jsxs(c,{children:[s.jsx(t,{asChild:!0,children:s.jsxs(d,{children:[s.jsx(l,{name:"rocket_launch",className:"!text-[18px]"}),s.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:r.props.brand}),r.props.section&&s.jsx(o,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),r.props.section&&s.jsx(h,{children:s.jsx(j,{children:r.props.section&&r.props.section.map(a=>a.subItems?s.jsx(i,{children:s.jsx(p,{asChild:!0,className:"group/collapsible-sub",children:s.jsxs(c,{children:[s.jsx(t,{asChild:!0,children:s.jsxs(d,{children:[s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:a.title}),s.jsx(o,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible-sub:rotate-90"})]})}),s.jsx(h,{children:s.jsx(j,{children:a.subItems.map(e=>s.jsx(m,{children:s.jsx(u,{asChild:!0,children:e.type==="blank"?s.jsxs("a",{href:e.link,target:"_blank",className:"flex gap-2 items-center",children:[e.icon&&s.jsx(l,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]}):s.jsxs(n,{href:e.link,className:"flex gap-2 items-center",children:[e.icon&&s.jsx(l,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]})})},e.id))})})]})})},a.id):s.jsx(m,{children:s.jsx(u,{asChild:!0,children:a.type==="blank"?s.jsxs("a",{href:a.link,target:"_blank",className:"flex gap-2 items-center",children:[a.icon&&s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:a.title})]}):s.jsxs(n,{href:a.link,className:"flex gap-2 items-center",children:[a.icon&&s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:a.title})]})})},a.id))})})]})})})})]},r.props.brand)})}),s.jsx(R,{children:s.jsx($,{items:r.props.menu})}),s.jsx(U,{children:s.jsx("div",{className:"text-center opacity-70",children:r.props.showVersion&&"v.4.3.0"})})]})}export{G as AppSidebar};
1
+ import{q as N,j as s,aK as b,aL as g,aM as i,aN as c,aO as f,aP as v,aQ as k,aR as d,B as C,aS as M,aT as w,aU as _,aV as y,aW as B,aX as x,U as n,aY as T,aZ as p,a_ as t,C as o,a$ as h,b0 as j,b1 as m,b2 as u,b3 as R,b4 as U}from"./app.js";import{NavMain as $}from"./nav-main-CRT9ezos.js";import l from"./material-icon-B9BY_7p9.js";import"./jsoneditor-CBqATVR0.js";import"./vendor-DoC2WAmd.js";import"./monaco-B1uVVM7f.js";import"./handsontable-D6MvFmcM.js";function G(){const r=N();return s.jsxs(b,{collapsible:"icon",variant:"inset",children:[s.jsx(g,{children:s.jsx(i,{children:s.jsxs(c,{children:[s.jsx(f,{className:"p-0 shadow-none border-none bg-transparent hidden md:block",children:s.jsxs(v,{children:[s.jsx(k,{asChild:!0,className:"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground rounded-md",children:s.jsx(d,{asChild:!0,children:s.jsx(C,{variant:"ghost",asChild:!0,className:`w-full ${r.props.section?"":"pointer-events-none"}`,children:s.jsxs("div",{children:[s.jsx(l,{name:"rocket_launch",className:"!text-[18px]"}),s.jsx("span",{className:"group-data-[state=collapsed]:hidden",children:r.props.brand}),r.props.section&&s.jsx(M,{className:"ml-auto group-data-[state=collapsed]:hidden"})]})})})}),r.props.section&&s.jsx(w,{side:"right",className:"z-[1003]",children:r.props.section.map(a=>s.jsx("div",{children:a.subItems?s.jsxs(_,{children:[s.jsxs(y,{className:"flex gap-2 items-center cursor-pointer",children:[s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:a.title})]}),s.jsx(B,{children:a.subItems.map(e=>s.jsx(x,{children:e.type==="blank"?s.jsxs("a",{href:e.link,target:"_blank",className:"flex gap-2 items-center",children:[e.icon&&s.jsx(l,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]},e.id):s.jsxs(n,{href:e.link,className:"flex gap-2 items-center",children:[e.icon&&s.jsx(l,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]},e.id)},e.id))})]}):s.jsx(x,{children:a.type==="blank"?s.jsxs("a",{href:a.link,target:"_blank",className:"flex gap-2 items-center",children:[a.icon&&s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:a.title})]}):s.jsxs(n,{href:a.link,className:"flex gap-2 items-center",children:[a.icon&&s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:a.title})]})})},a.id))})]})}),s.jsx(T,{className:"px-2 py-0 block md:hidden",children:s.jsx(i,{children:s.jsx(p,{asChild:!0,className:"group/collapsible",children:s.jsxs(c,{children:[s.jsx(t,{asChild:!0,children:s.jsxs(d,{children:[s.jsx(l,{name:"rocket_launch",className:"!text-[18px]"}),s.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:r.props.brand}),r.props.section&&s.jsx(o,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),r.props.section&&s.jsx(h,{children:s.jsx(j,{children:r.props.section&&r.props.section.map(a=>a.subItems?s.jsx(i,{children:s.jsx(p,{asChild:!0,className:"group/collapsible-sub",children:s.jsxs(c,{children:[s.jsx(t,{asChild:!0,children:s.jsxs(d,{children:[s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:a.title}),s.jsx(o,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible-sub:rotate-90"})]})}),s.jsx(h,{children:s.jsx(j,{children:a.subItems.map(e=>s.jsx(m,{children:s.jsx(u,{asChild:!0,children:e.type==="blank"?s.jsxs("a",{href:e.link,target:"_blank",className:"flex gap-2 items-center",children:[e.icon&&s.jsx(l,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]}):s.jsxs(n,{href:e.link,className:"flex gap-2 items-center",children:[e.icon&&s.jsx(l,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]})})},e.id))})})]})})},a.id):s.jsx(m,{children:s.jsx(u,{asChild:!0,children:a.type==="blank"?s.jsxs("a",{href:a.link,target:"_blank",className:"flex gap-2 items-center",children:[a.icon&&s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:a.title})]}):s.jsxs(n,{href:a.link,className:"flex gap-2 items-center",children:[a.icon&&s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:a.title})]})})},a.id))})})]})})})})]},r.props.brand)})}),s.jsx(R,{children:s.jsx($,{items:r.props.menu})}),s.jsx(U,{children:s.jsx("div",{className:"text-center opacity-70",children:r.props.showVersion&&"v.4.3.0"})})]})}export{G as AppSidebar};
@@ -0,0 +1 @@
1
+ import{q as E,j as e,g as m,aF as R,r as B,B as M,aG as O,u as z,v as L,aH as _,J,K as H,Z as F,M as G,m as U,aI as q,U as K,L as $,aJ as V}from"./app.js";import{Breadcrumbs as Y}from"./breadcrumbs-livOfa2Z.js";import{NavUser as Z}from"./nav-user-BN2veV3l.js";import{ThemeSwitcher as Q}from"./theme-switcher-C35zBCil.js";import{r as l}from"./monaco-B1uVVM7f.js";import W from"./material-icon-B9BY_7p9.js";const P=l.createContext(void 0),ne=({children:n})=>{const[p,f]=l.useState([]),[y,d]=l.useState([]),[v,u]=l.useState([]),[b,r]=l.useState(!1),[c,g]=l.useState([]),S=E(),w=[...y,...v],i=async()=>{try{const t=await m.get(`${window.routePrefix}/api/notifications`,{params:{unreadOnly:!0,limit:4}});f(t.data)}catch(t){console.error("Error fetching bell notifications:",t)}},j=async()=>{await i()},x=async()=>{try{const t=await m.put(`${window.routePrefix}/api/notifications/get-classes`);g(t.data)}catch(t){console.error("Error fetching tabs:",t)}},N=async(t,s)=>{try{if(!t){await h(s);return}const a=await m.post(`${window.routePrefix}/api/notifications/search`,{s:t,notificationClass:s});u(a.data)}catch(a){console.error("Error searching notifications:",a)}},h=async t=>{r(!0);try{const s=`${window.routePrefix}/api/notifications/${t}`,a=await m.get(s,{params:{limit:20,skip:0,unreadOnly:!1}});return d([]),u(a.data),a.data}catch(s){return console.error("Error fetching all notifications:",s),[]}finally{r(!1)}},C=async(t,s)=>{try{const a=`${window.routePrefix}/api/notifications/${t}`,o=await m.get(a,{params:{limit:20,skip:s,unreadOnly:!1}});return u(D=>[...D,...o.data]),o.data}catch(a){return console.error("Error paginating notifications:",a),[]}};l.useEffect(()=>{if(!S.props.notifications)return;i();const t=new EventSource(`${window.routePrefix}/api/notifications/stream`);return t.addEventListener("connected",s=>{const a=JSON.parse(s.data);console.log("Connected event:",a),x()}),t.addEventListener("notification",s=>{const a=JSON.parse(s.data);d(o=>[a,...o]),f(o=>[a,...o].slice(0,4))}),t.onerror=()=>{console.error("SSE connection error")},()=>t.close()},[]);const A=async(t,s)=>{try{await m.put(`${window.routePrefix}/api/notifications/${t}/${s}/read`,{}),d(a=>a.map(o=>o.id===s?{...o,read:!0}:o)),u(a=>a.map(o=>o.id===s?{...o,read:!0}:o)),f([])}catch(a){console.error("Error marking as read:",a)}},I=async()=>{try{await m.put(`${window.routePrefix}/api/notifications/read-all`),d(t=>t.map(s=>({...s,read:!0}))),u(t=>t.map(s=>({...s,read:!0}))),await i()}catch(t){console.error("Error marking all as read:",t)}},k=p.filter(t=>!t.read).length;return e.jsx(P.Provider,{value:{bellNotifications:p,allNotifications:w,unreadCount:k,getTabs:x,tabs:c,search:N,markAsRead:A,markAllAsRead:I,fetchAllNotifications:h,paginateNotifications:C,loading:b,refreshBellNotifications:j},children:n})},T=()=>{const n=l.useContext(P);if(n===void 0)throw new Error("useNotifications must be used within a NotificationProvider");return n};function X(){const{bellNotifications:n,markAsRead:p,unreadCount:f,refreshBellNotifications:y}=T(),[d,v]=l.useState(!1),u=async(r,c)=>{v(!0);try{await p(r,c),await y()}catch(g){console.error("Error marking as read:",g)}finally{v(!1)}},b=r=>{const c=new Date,g=new Date(r),S=c.getTime()-g.getTime(),w=Math.floor(S/1e3),i=new Intl.RelativeTimeFormat("en",{numeric:"auto"});if(w<60)return i.format(-w,"second");const j=Math.floor(w/60);if(j<60)return i.format(-j,"minute");const x=Math.floor(j/60);if(x<24)return i.format(-x,"hour");const N=Math.floor(x/24);if(N<30)return i.format(-N,"day");const h=Math.floor(N/30);if(h<12)return i.format(-h,"month");const C=Math.floor(h/12);return i.format(-C,"year")};return e.jsxs(R,{children:[e.jsx(B,{asChild:!0,className:"cursor-pointer data-[state=open]:bg-sidebar-accent",children:e.jsxs(M,{variant:"ghost",className:"relative",children:[e.jsx(O,{}),f>0&&e.jsx("div",{className:"absolute top-1.5 right-1.5 size-1.5 rounded-full bg-destructive"})]})}),e.jsxs(z,{className:"z-[1002] p-2",align:"end",onCloseAutoFocus:r=>r.preventDefault(),children:[e.jsx(L,{className:`${d?"opacity-50 pointer-events-none":""}`,children:n.length===0?e.jsx("div",{className:"p-4 text-center text-muted-foreground",children:"No notifications"}):n.map(r=>e.jsxs("div",{children:[e.jsx(_,{asChild:!0,className:"cursor-pointer",onSelect:c=>{c.preventDefault(),U.visit(`${window.routePrefix}/notifications?type=${r.notificationClass}`)},children:e.jsxs("div",{className:"grid grid-cols-[32px_250px] grid-rows-[auto_1fr] items-start gap-x-4 gap-y-2",children:[r.icon?e.jsx(W,{name:r.icon.icon,style:{color:r.icon.iconColor},className:"!text-[32px]"}):e.jsx("div",{}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-medium",children:r.title}),e.jsx("span",{className:"truncate",children:r.message})]}),e.jsxs("div",{className:"col-start-2 flex justify-between flex-nowrap items-center",children:[e.jsxs("div",{className:"flex flex-nowrap gap-2 items-center",children:[r.notificationClass==="general"?e.jsx("div",{className:"font-medium",children:"Info"}):e.jsx("div",{className:"font-medium",children:"Activity"}),e.jsx("span",{children:"●"}),e.jsx("div",{children:b(r.createdAt)})]}),e.jsxs(J,{children:[e.jsx(H,{asChild:!0,children:e.jsx(M,{variant:"ghost",size:"icon",className:"size-4",onClick:c=>{c.stopPropagation(),u(r.notificationClass,r.id)},children:e.jsx(F,{className:"text-primary"})})}),e.jsx(G,{side:"left",className:"z-[1003]",children:e.jsx("p",{children:"Make read"})})]})]})]})}),e.jsx(q,{})]},r.id))}),e.jsx(M,{variant:"secondary",asChild:!0,children:e.jsxs(K,{href:`${window.routePrefix}/notifications?type=general`,className:`w-full ${d?"opacity-50 pointer-events-none":""}`,children:["View All",d&&e.jsx($,{className:"h-4 w-4 animate-spin"})]})})]})]})}function ee({breadcrumbs:n=[]}){const{tabs:p}=T(),f=E();return e.jsx("header",{className:"border-sidebar-border/50 flex h-16 shrink-0 items-center gap-2 border-b px-6 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12 md:px-4",children:e.jsxs("div",{className:"flex justify-between w-full",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(V,{className:"-ml-1"}),e.jsx(Y,{breadcrumbs:n})]}),e.jsxs("div",{className:"flex gap-4 items-center",children:[e.jsx(Q,{}),f.props.notifications&&(p.length>0?e.jsx(X,{}):e.jsx("div",{className:"w-[40px] flex-none flex justify-center",children:e.jsx($,{className:"size-4 animate-spin"})})),e.jsx(Z,{})]})]})})}const ce=Object.freeze(Object.defineProperty({__proto__:null,AppSidebarHeader:ee},Symbol.toStringTag,{value:"Module"}));export{ee as A,ne as N,ce as a,T as u};