@emintech/core 0.9.0 → 0.9.1

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 (199) hide show
  1. package/dist/{chunk-7OPUQ2NO.js → chunk-27WJSL75.js} +1 -1
  2. package/dist/{chunk-SNPTKUE5.js → chunk-5LFO6VRS.js} +1 -1
  3. package/dist/chunk-ARU7FSI6.js +0 -0
  4. package/dist/{chunk-WUFYLSW5.js → chunk-CN6NPPO6.js} +1 -1
  5. package/dist/chunk-GL653BPU.js +0 -0
  6. package/dist/{chunk-XOU4MLVF.js → chunk-IN4S2FZY.js} +1 -1
  7. package/dist/{chunk-PVEMGAU6.js → chunk-JN47WU22.js} +1 -1
  8. package/dist/{chunk-4BF2G3HA.js → chunk-LHLB7FQU.js} +1 -1
  9. package/dist/{chunk-6NZQLO4H.js → chunk-M4WWDZLJ.js} +1 -1
  10. package/dist/{chunk-RJQGKBW5.js → chunk-MFEDVU5N.js} +1 -1
  11. package/dist/{chunk-IDXLUHHA.js → chunk-MIJMBHKX.js} +1 -1
  12. package/dist/{chunk-5OOSKZ2A.js → chunk-NLD7PVBE.js} +1 -1
  13. package/dist/{chunk-AEPKG2NX.js → chunk-PC75QMDC.js} +1 -1
  14. package/dist/chunk-QZ7BICYJ.js +1 -0
  15. package/dist/{chunk-AAYQMXGF.js → chunk-RBWDBGNJ.js} +1 -1
  16. package/dist/{chunk-PWQOU5TI.js → chunk-SZBMRQZB.js} +1 -1
  17. package/dist/{chunk-BCQVYKF6.js → chunk-TCXFBTBM.js} +1 -1
  18. package/dist/{chunk-VDWGKLE7.js → chunk-UTO7XKUN.js} +1 -1
  19. package/dist/{chunk-HGOBNKGK.js → chunk-V6XQBO4L.js} +1 -1
  20. package/dist/{chunk-6Q54CGSV.js → chunk-VTOYD4F3.js} +1 -1
  21. package/dist/{chunk-OS5YYRGY.js → chunk-VXSWY5HH.js} +1 -1
  22. package/dist/{chunk-3E62GAJ5.js → chunk-ZE5UNNBM.js} +1 -1
  23. package/dist/emincore.register.js +1 -1
  24. package/dist/features/account/change-password/components/PasswordForm.js +1 -1
  25. package/dist/features/account/change-password/index.js +1 -1
  26. package/dist/features/account/change-password/pages/index.js +1 -1
  27. package/dist/features/account/delete-account/components/DeleteAccountForm.js +1 -1
  28. package/dist/features/account/delete-account/index.js +1 -1
  29. package/dist/features/account/delete-account/pages/index.js +1 -1
  30. package/dist/features/account/index.js +1 -1
  31. package/dist/features/account/preferences/pages/index.js +1 -1
  32. package/dist/features/account/profile/components/Profile.js +1 -1
  33. package/dist/features/account/profile/components/ProfileForm.js +1 -1
  34. package/dist/features/account/profile/index.js +1 -1
  35. package/dist/features/account/profile/pages/EditProfilePage.js +1 -1
  36. package/dist/features/account/profile/pages/IndexProfilePage.js +1 -1
  37. package/dist/features/account/shared/components/MyAccountHeader.js +1 -1
  38. package/dist/features/account/shared/components/UserLabel.js +1 -1
  39. package/dist/features/account/shared/components/UserMenu.js +1 -1
  40. package/dist/features/account/shared/components/index.js +1 -1
  41. package/dist/features/account/shared/index.js +1 -1
  42. package/dist/features/account/shared/layouts/MyAccountLayout.js +1 -1
  43. package/dist/features/api-key/index.d.ts +1 -0
  44. package/dist/features/api-key/index.js +1 -0
  45. package/dist/features/api-key/types/api-key.types.d.ts +14 -0
  46. package/dist/features/api-key/types/api-key.types.js +1 -0
  47. package/dist/features/app/components/AppHeader.js +1 -1
  48. package/dist/features/app/components/AppLogo.js +1 -1
  49. package/dist/features/app/index.js +1 -1
  50. package/dist/features/app/layout/AppLayout.js +1 -1
  51. package/dist/features/appearance/components/AppearanceButton.js +1 -1
  52. package/dist/features/appearance/components/AppearanceDropdown.js +1 -1
  53. package/dist/features/appearance/components/AppearanceToggle.js +1 -1
  54. package/dist/features/appearance/hooks/use-appearance.js +1 -1
  55. package/dist/features/appearance/index.js +1 -1
  56. package/dist/features/appearance/lib/appearance-service.js +1 -1
  57. package/dist/features/auth/index.js +1 -1
  58. package/dist/features/auth/login/components/Login.js +1 -1
  59. package/dist/features/auth/login/hooks/use-login-form.js +1 -1
  60. package/dist/features/auth/login/index.js +1 -1
  61. package/dist/features/auth/password/confirmation/components/PasswordConfirmation.js +1 -1
  62. package/dist/features/auth/password/confirmation/index.js +1 -1
  63. package/dist/features/auth/password/forgot/components/PasswordForgot.js +1 -1
  64. package/dist/features/auth/password/forgot/index.js +1 -1
  65. package/dist/features/auth/password/index.js +1 -1
  66. package/dist/features/auth/password/reset/components/PasswordReset.js +1 -1
  67. package/dist/features/auth/password/reset/index.js +1 -1
  68. package/dist/features/auth/register/components/Register.js +1 -1
  69. package/dist/features/auth/register/index.js +1 -1
  70. package/dist/features/auth/shared/components/PasswordInput.js +1 -1
  71. package/dist/features/auth/shared/index.js +1 -1
  72. package/dist/features/auth/shared/layouts/AuthLayout.js +1 -1
  73. package/dist/features/auth/verify/email/components/EmailVerify.js +1 -1
  74. package/dist/features/auth/verify/email/index.js +1 -1
  75. package/dist/features/auth/verify/index.js +1 -1
  76. package/dist/features/dashboard/components/DashboardSidebar.js +1 -1
  77. package/dist/features/dashboard/components/DashboardTopbar.js +1 -1
  78. package/dist/features/dashboard/index.js +1 -1
  79. package/dist/features/dashboard/layouts/DashboardLayout.js +1 -1
  80. package/dist/features/emin-jobs/components/EminJobsComponents.js +1 -1
  81. package/dist/features/emin-jobs/hooks/use-emin-jobs.js +1 -1
  82. package/dist/features/emin-jobs/index.js +1 -1
  83. package/dist/features/marketplace/components/MarketplaceComponents.js +1 -1
  84. package/dist/features/marketplace/context/MarketplaceContext.js +1 -1
  85. package/dist/features/marketplace/index.js +1 -1
  86. package/dist/features/marketplace/pages/IndexMarketplacePage.js +1 -1
  87. package/dist/features/mobile-token/index.d.ts +1 -0
  88. package/dist/features/mobile-token/index.js +1 -0
  89. package/dist/features/mobile-token/types/mobile-token.types.d.ts +16 -0
  90. package/dist/features/mobile-token/types/mobile-token.types.js +1 -0
  91. package/dist/features/notifications/components/EminNotification.js +1 -1
  92. package/dist/features/notifications/context/NotificationsContext.js +1 -1
  93. package/dist/features/notifications/index.js +1 -1
  94. package/dist/features/notifications/pages/UserNotificationsPage.js +1 -1
  95. package/dist/features/package-manager/index.js +1 -1
  96. package/dist/features/package-manager/installer/index.js +1 -1
  97. package/dist/features/package-manager/installer/lib/installer-formatter.js +1 -1
  98. package/dist/features/package-manager/shared/components/PackageManagerModal.js +1 -1
  99. package/dist/features/package-manager/shared/context/PackageManagerContext.js +1 -1
  100. package/dist/features/package-manager/shared/hooks/use-package-version-selector.js +1 -1
  101. package/dist/features/package-manager/shared/index.js +1 -1
  102. package/dist/features/package-manager/shared/lib/package-manager-formatter.js +1 -1
  103. package/dist/features/package-manager/shared/lib/package-manager-services.js +1 -1
  104. package/dist/features/package-manager/updater/index.js +1 -1
  105. package/dist/features/package-manager/updater/lib/updater-formatter.js +1 -1
  106. package/dist/features/packages/components/Packages.js +1 -1
  107. package/dist/features/packages/components/PackagesTable.js +1 -1
  108. package/dist/features/packages/context/PackagesContext.js +1 -1
  109. package/dist/features/packages/index.js +1 -1
  110. package/dist/features/packages/lib/packages-formatter.js +1 -1
  111. package/dist/features/packages/pages/IndexPackagesPage.js +1 -1
  112. package/dist/features/platform/components/PlatformComponents.js +1 -1
  113. package/dist/features/platform/components/PlatformPageComponents.js +1 -1
  114. package/dist/features/platform/index.js +1 -1
  115. package/dist/features/platform/lib/platform-formatter.js +1 -1
  116. package/dist/features/platform/pages/IndexPlatformPage.js +1 -1
  117. package/dist/features/settings/api/settings.api.js +1 -1
  118. package/dist/features/settings/context/SettingsContext.js +1 -1
  119. package/dist/features/settings/index.js +1 -1
  120. package/dist/features/settings/layouts/SettingsLayout.js +1 -1
  121. package/dist/features/settings/lib/settings-formatter.js +1 -1
  122. package/dist/features/settings/pages/DesignSettingsPage.js +1 -1
  123. package/dist/features/settings/pages/GeneralSettingsPage.js +1 -1
  124. package/dist/features/settings/pages/MailSettingsPage.js +1 -1
  125. package/dist/features/settings/pages/NavPage.js +1 -1
  126. package/dist/features/slugs/components/slugs.js +1 -1
  127. package/dist/features/slugs/context/SlugsContext.js +1 -1
  128. package/dist/features/slugs/index.js +1 -1
  129. package/dist/features/users/components/UserModal.js +1 -1
  130. package/dist/features/users/components/UsersPage.js +1 -1
  131. package/dist/features/users/components/UsersStatistics.js +1 -1
  132. package/dist/features/users/components/UsersTable.js +1 -1
  133. package/dist/features/users/index.js +1 -1
  134. package/dist/features/users/lib/users-formatter.js +1 -1
  135. package/dist/features/users/widgets/UserStatisticsWidget.js +1 -1
  136. package/dist/features/widgets/components/WidgetMenu.js +1 -1
  137. package/dist/features/widgets/components/WidgetProfileMenu.js +1 -1
  138. package/dist/features/widgets/components/WidgetsComponents.js +1 -1
  139. package/dist/features/widgets/components/WidgetsScreen.js +1 -1
  140. package/dist/features/widgets/index.js +1 -1
  141. package/dist/integrations/emincore/page.registry.js +1 -1
  142. package/dist/integrations/emincore/provider.registry.js +1 -1
  143. package/dist/integrations/emincore/widget.registry.js +1 -1
  144. package/dist/pages/auth/login.js +1 -1
  145. package/dist/pages/auth/password-confirm.js +1 -1
  146. package/dist/pages/auth/password-forgot.js +1 -1
  147. package/dist/pages/auth/password-reset.js +1 -1
  148. package/dist/pages/auth/register.js +1 -1
  149. package/dist/pages/auth/verify-email.js +1 -1
  150. package/dist/pages/dashboard/index.js +1 -1
  151. package/dist/pages/dashboard/marketplace/index.js +1 -1
  152. package/dist/pages/dashboard/packages/index.js +1 -1
  153. package/dist/pages/dashboard/platform/index.js +1 -1
  154. package/dist/pages/dashboard/settings/index.js +1 -1
  155. package/dist/pages/dashboard/settings/slugs/index.js +1 -1
  156. package/dist/pages/dashboard/users/index.js +1 -1
  157. package/dist/pages/my-account/notifications/index.js +1 -1
  158. package/dist/pages/my-account/profile/edit-password.js +1 -1
  159. package/dist/pages/my-account/profile/edit.js +1 -1
  160. package/dist/pages/my-account/profile/index.js +1 -1
  161. package/dist/provider.js +1 -1
  162. package/dist/shared/components/composite/AlertModal.js +1 -1
  163. package/dist/shared/components/composite/EminEditable.js +1 -1
  164. package/dist/shared/components/composite/EminFormButton.js +1 -1
  165. package/dist/shared/components/composite/EminInput.d.ts +3 -3
  166. package/dist/shared/components/composite/EminInput.js +1 -1
  167. package/dist/shared/components/composite/EminPreference.js +1 -1
  168. package/dist/shared/components/composite/EminPreloader.js +1 -1
  169. package/dist/shared/components/composite/Menu/EminMenu.js +1 -1
  170. package/dist/shared/components/composite/Menu/EminSidebarMenu.js +1 -1
  171. package/dist/shared/components/composite/Menu/index.js +1 -1
  172. package/dist/shared/components/composite/QuickMenu/QuickMenu.js +1 -1
  173. package/dist/shared/components/composite/QuickMenu/index.js +1 -1
  174. package/dist/shared/components/composite/RoleBadge.js +1 -1
  175. package/dist/shared/components/composite/SectionCard.js +1 -1
  176. package/dist/shared/components/composite/StatisticCards.js +1 -1
  177. package/dist/shared/components/composite/index.js +1 -1
  178. package/dist/shared/components/index.js +1 -1
  179. package/dist/shared/components/ui/avatar.js +1 -1
  180. package/dist/shared/components/ui/breadcrumbs.js +1 -1
  181. package/dist/shared/components/ui/chart.js +1 -1
  182. package/dist/shared/components/ui/sidebar.js +1 -1
  183. package/dist/shared/components/ui/slider.js +1 -1
  184. package/dist/shared/components/ui/team-switcher.js +1 -1
  185. package/dist/shared/index.js +1 -1
  186. package/dist/shared/modules/emin-table/components/EminTable.js +1 -1
  187. package/dist/shared/modules/emin-table/components/EminTableContent.js +1 -1
  188. package/dist/shared/modules/emin-table/components/EminTablePagination.js +1 -1
  189. package/dist/shared/modules/emin-table/components/EminTableToolbar.js +1 -1
  190. package/dist/shared/modules/emin-table/context/EminTableContext.js +1 -1
  191. package/dist/shared/modules/emin-table/index.js +1 -1
  192. package/dist/shared/modules/index.js +1 -1
  193. package/dist/shared/modules/world-map/components/WorldMap2D.js +1 -1
  194. package/dist/shared/modules/world-map/context/WorldMapContext.js +1 -1
  195. package/dist/shared/modules/world-map/index.js +1 -1
  196. package/package.json +1 -1
  197. package/dist/chunk-4DHRTWA7.js +0 -1
  198. /package/dist/{chunk-YGU7VNF7.js → chunk-3SUNL2KP.js} +0 -0
  199. /package/dist/{chunk-C7BLCBBU.js → chunk-4BYSDVXA.js} +0 -0
@@ -1 +1 @@
1
- import{a as l,ua as v,y as h}from"./chunk-HGOBNKGK.js";import{a as u}from"./chunk-E2ZUBHVJ.js";import{a as n,c as s,e as d,h as p,i as c,k as m}from"./chunk-PWQOU5TI.js";import{b as t}from"./chunk-TVCWAJFT.js";import{a as b}from"./chunk-G4EEZUTC.js";import{d as i}from"./chunk-GND5KQRZ.js";import{usePage as S}from"@inertiajs/react";import{Transition as f}from"@headlessui/react";import{jsx as e,jsxs as o}from"react/jsx-runtime";var E=({...y})=>{let{url:T}=S(),a=S().props,{dashboard:g}=a?.emin_core_menus,x=a?.app?.logos??[],{state:r}=n(),F=u(g,T);return o(s,{collapsible:"icon",...y,children:[o(p,{children:[o("div",{className:"relative items-center !h-[50px]",children:[e(f,{show:r=="collapsed",enter:"duration-500",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"duration-500",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:e("img",{className:"absolute !max-w-[35px] !max-h-[35px]",src:i(x?.favicon)})}),e(f,{show:r=="expanded",enter:"duration-500",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"duration-500",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:e("div",{children:e(v,{link:route("dashboard")})})})]}),e("hr",{className:"w-full"}),e(h,{})]}),e("hr",{}),e(m,{children:e(l,{sidebarMenu:F})}),e(c,{children:o(t,{variant:"outline",className:"flex items-center",children:[e(b,{iconName:"IconHelp"}),e("span",{className:"group-data-[collapsible=icon]:hidden",children:"Get Help"})]})}),e(d,{})]})};export{E as a};
1
+ import{a as l,ua as v,y as h}from"./chunk-V6XQBO4L.js";import{a as u}from"./chunk-E2ZUBHVJ.js";import{a as n,c as s,e as d,h as p,i as c,k as m}from"./chunk-SZBMRQZB.js";import{b as t}from"./chunk-TVCWAJFT.js";import{a as b}from"./chunk-G4EEZUTC.js";import{d as i}from"./chunk-GND5KQRZ.js";import{usePage as S}from"@inertiajs/react";import{Transition as f}from"@headlessui/react";import{jsx as e,jsxs as o}from"react/jsx-runtime";var E=({...y})=>{let{url:T}=S(),a=S().props,{dashboard:g}=a?.emin_core_menus,x=a?.app?.logos??[],{state:r}=n(),F=u(g,T);return o(s,{collapsible:"icon",...y,children:[o(p,{children:[o("div",{className:"relative items-center !h-[50px]",children:[e(f,{show:r=="collapsed",enter:"duration-500",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"duration-500",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:e("img",{className:"absolute !max-w-[35px] !max-h-[35px]",src:i(x?.favicon)})}),e(f,{show:r=="expanded",enter:"duration-500",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"duration-500",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:e("div",{children:e(v,{link:route("dashboard")})})})]}),e("hr",{className:"w-full"}),e(h,{})]}),e("hr",{}),e(m,{children:e(l,{sidebarMenu:F})}),e(c,{children:o(t,{variant:"outline",className:"flex items-center",children:[e(b,{iconName:"IconHelp"}),e("span",{className:"group-data-[collapsible=icon]:hidden",children:"Get Help"})]})}),e(d,{})]})};export{E as a};
@@ -1,2 +1,2 @@
1
- import{c as D}from"./chunk-AEPKG2NX.js";import{a as B}from"./chunk-SC5FEULM.js";import{a as E}from"./chunk-6Q54CGSV.js";import{g as y}from"./chunk-HGOBNKGK.js";import{a as C,b as S,c as w,d as T,f as b}from"./chunk-3DBYUBWW.js";import{b as g}from"./chunk-TVCWAJFT.js";import{a as M}from"./chunk-65LRDGYI.js";import{a as c}from"./chunk-G4EEZUTC.js";import{a as h}from"./chunk-GND5KQRZ.js";import{a as N}from"./chunk-QKP3C5FM.js";import{Link as G,useForm as $,useHttp as Q}from"@inertiajs/react";import{useEffect as W,useState as f}from"react";import{toast as F}from"sonner";import{IconAlertCircleFilled as X,IconArrowUpRight as Y,IconCircleCheckFilled as Z,IconRefresh as L}from"@tabler/icons-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";var he=({account:r})=>e(M,{title:"My Platform Account",icon:"IconUserCircle",description:"Manage your platform account settings.",className:"col-span-full",buttons:r?e(g,{variant:"outline",size:"sm",children:t("a",{href:"https://emincore.io/login",target:"_blank",className:"flex items-center gap-2",children:[e(c,{iconName:"IconUserCircle",className:"h-4 w-4"}),e("span",{children:r.email})]})}):e(G,{href:route("dashboard.marketplace"),className:"flex items-center gap-2",children:t(g,{variant:"default",size:"sm",children:[e(c,{iconName:"IconUserCircle",className:"h-4 w-4"}),e("span",{children:"Connect to Platform"})]})})}),fe=({eminCore:r})=>t(C,{className:"col-span-2",children:[t(S,{children:[t(w,{className:"flex gap-1",children:[t("div",{className:"grid gap-2",children:[e("img",{src:"https://emin.llc/wp-content/uploads/2022/11/siyah-logo-arkasiz.svg",className:"h-8"}),e("span",{className:"text-xl font-bold text-primary",children:"EminCore - The Cross-Ecosystem Orchestrator"})]}),t("div",{className:"ml-auto flex max-w-[400px] flex-wrap gap-1",children:[t(g,{variant:"outline",size:"sm",className:"gap-2",children:[e(c,{iconName:"IconCode",className:"h-4 w-4"}),t("span",{className:"text-xs font-bold",children:["v",r.version]})]}),t(g,{variant:"outline",size:"sm",className:"gap-2",children:[e(c,{iconName:"IconBuilding",className:"h-4 w-4"}),e("span",{className:"text-xs font-bold",children:"Emin Tech"})]}),t(g,{variant:"outline",size:"sm",className:"gap-2",children:[e(c,{iconName:"IconBook",className:"h-4 w-4"}),e("span",{className:"text-xs font-bold",children:"Docs"})]})]})]}),e(T,{children:e("p",{children:"A modular application platform that orchestrates Composer and npm ecosystems through a unified package architecture, marketplace, and runtime."})})]}),e(b,{className:"grid gap-6",children:e(ee,{})})]}),xe=({requirements:r})=>{let o=({requirement:n})=>{let m=Math.random()*500+800,[k,s]=f(!0);return f(()=>{let v=setTimeout(()=>s(!1),m);return()=>clearTimeout(v)}),k?e(c,{iconName:"IconLoader2",className:"animate-spin mx-auto h-4 w-4 my-0.5"}):e("span",{className:h("font-mono font-bold text-sm",n.status?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"),children:n.value??"-"})};return t(C,{className:"col-span-2",children:[e(S,{children:t(w,{className:"flex items-center gap-2",children:[e(c,{iconName:"IconServer",className:"h-5 w-5 text-primary"}),e("h3",{className:"font-semibold",children:"System Status"})]})}),e(b,{children:e("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-7 gap-3",children:r?.map(n=>t("div",{className:"rounded-md border p-3 text-center grid gap-[1px]",children:[t("span",{className:"text-xs text-muted-foreground mx-auto flex items-center gap-1",children:[e(c,{iconName:n.icon,className:"h-4 w-4 text-primary mx-auto"}),n.title]}),e(o,{requirement:n}),n.requirements&&e("span",{className:"font-mono font-bold text-xs text-muted-foreground",children:n.requirements})]}))})})]})},Ne=()=>t("div",{className:"col-span-2 text-center grid gap-3",children:[t("p",{className:"text-sm text-muted-foreground px-5 mx-auto",children:["A two-year R&D effort carried out by a single-person team resulted in the completion of this platform and ecosystem. It provides users with a unique infrastructure built on the most modern and powerful technology stacks. This infrastructure enables you to prepare your project in the shortest possible time while achieving maximum performance, user engagement, and rich functionality.",e("br",{}),"Thank you for choosing us."]}),e("img",{src:"https://eminilhan.com/wp-content/uploads/2023/04/beyaz-logo-1.png",className:"h-10 mx-auto"})]}),ee=()=>{let r=localStorage?.getItem("last_core_update_checked"),[o,n]=f(localStorage?.getItem("is_core_up_to_date")==="true"),[m,k]=f(r?new Date(r):null),[s,v]=f(JSON.parse(localStorage?.getItem("last_core_versions")??"null")),d=Q();W(()=>{localStorage.setItem("is_core_up_to_date",o?"true":"false"),localStorage.setItem("last_core_versions",JSON.stringify(s)),localStorage.setItem("last_core_update_checked",m?m.toISOString():"")},[o,s,m]);let R=D(),{packages:I,isLoading:P,setIsLoading:V,setLoadingContent:O,setIsModalOpen:z,setPackageManifest:_,setProcess:U,setValidationError:A}=R,{selectVersion:j,SelectionModal:q}=E(),H=()=>d.processing?e(L,{className:"h-6 w-6 text-primary animate-spin shrink-0"}):o?e(Z,{className:"h-6 w-6 text-green-600 dark:text-green-400 shrink-0"}):e(X,{className:"h-6 w-6 text-blue-600 dark:text-blue-500 shrink-0"}),J=()=>t("div",{className:"grid",children:[e("span",{className:h("text-sm font-medium",d.processing?"text-primary":o?"text-green-600 dark:text-green-400":"text-blue-600 dark:text-blue-500"),children:d.processing?"Checking updates...":o?"System is up to date!":"New version available!"}),e("span",{className:"text-xs text-primary/70",children:o===!0?"Last checked: "+(m?.toLocaleString()??"never"):"Keep your system up to date with the latest features, performance improvements, and security updates."})]});return t("div",{className:"grid md:flex md:items-center gap-2",children:[e(()=>t("div",{className:"flex items-center gap-2",children:[e(H,{}),e(J,{})]}),{}),t("div",{className:"grid md:flex md:items-center gap-3 md:ml-auto",children:[e(()=>{let i=$(),x=(a,l)=>({process:"update",manifest:{code:N,version:a==="update"?l.latest_compatible.version:l.latest.version,core_constraint:"latest"}}),p=()=>{P||i.processing||!s||u().then(()=>{U("update"),V(!0),O({title:"Updating System",description:"Please wait while we update your system to the latest version."}),_({...I.find(a=>a.code==N),version:"latest"}),z(!0),i.post(route("dashboard.packages.manager"),{onError:a=>A(Object.values(a).join(`
1
+ import{c as D}from"./chunk-PC75QMDC.js";import{a as E}from"./chunk-VTOYD4F3.js";import{a as B}from"./chunk-SC5FEULM.js";import{g as y}from"./chunk-V6XQBO4L.js";import{a as C,b as S,c as w,d as T,f as b}from"./chunk-3DBYUBWW.js";import{a as M}from"./chunk-65LRDGYI.js";import{b as g}from"./chunk-TVCWAJFT.js";import{a as c}from"./chunk-G4EEZUTC.js";import{a as N}from"./chunk-QKP3C5FM.js";import{a as h}from"./chunk-GND5KQRZ.js";import{Link as G,useForm as $,useHttp as Q}from"@inertiajs/react";import{useEffect as W,useState as f}from"react";import{toast as F}from"sonner";import{IconAlertCircleFilled as X,IconArrowUpRight as Y,IconCircleCheckFilled as Z,IconRefresh as L}from"@tabler/icons-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";var he=({account:r})=>e(M,{title:"My Platform Account",icon:"IconUserCircle",description:"Manage your platform account settings.",className:"col-span-full",buttons:r?e(g,{variant:"outline",size:"sm",children:t("a",{href:"https://emincore.io/login",target:"_blank",className:"flex items-center gap-2",children:[e(c,{iconName:"IconUserCircle",className:"h-4 w-4"}),e("span",{children:r.email})]})}):e(G,{href:route("dashboard.marketplace"),className:"flex items-center gap-2",children:t(g,{variant:"default",size:"sm",children:[e(c,{iconName:"IconUserCircle",className:"h-4 w-4"}),e("span",{children:"Connect to Platform"})]})})}),fe=({eminCore:r})=>t(C,{className:"col-span-2",children:[t(S,{children:[t(w,{className:"flex gap-1",children:[t("div",{className:"grid gap-2",children:[e("img",{src:"https://emin.llc/wp-content/uploads/2022/11/siyah-logo-arkasiz.svg",className:"h-8"}),e("span",{className:"text-xl font-bold text-primary",children:"EminCore - The Cross-Ecosystem Orchestrator"})]}),t("div",{className:"ml-auto flex max-w-[400px] flex-wrap gap-1",children:[t(g,{variant:"outline",size:"sm",className:"gap-2",children:[e(c,{iconName:"IconCode",className:"h-4 w-4"}),t("span",{className:"text-xs font-bold",children:["v",r.version]})]}),t(g,{variant:"outline",size:"sm",className:"gap-2",children:[e(c,{iconName:"IconBuilding",className:"h-4 w-4"}),e("span",{className:"text-xs font-bold",children:"Emin Tech"})]}),t(g,{variant:"outline",size:"sm",className:"gap-2",children:[e(c,{iconName:"IconBook",className:"h-4 w-4"}),e("span",{className:"text-xs font-bold",children:"Docs"})]})]})]}),e(T,{children:e("p",{children:"A modular application platform that orchestrates Composer and npm ecosystems through a unified package architecture, marketplace, and runtime."})})]}),e(b,{className:"grid gap-6",children:e(ee,{})})]}),xe=({requirements:r})=>{let o=({requirement:n})=>{let m=Math.random()*500+800,[k,s]=f(!0);return f(()=>{let v=setTimeout(()=>s(!1),m);return()=>clearTimeout(v)}),k?e(c,{iconName:"IconLoader2",className:"animate-spin mx-auto h-4 w-4 my-0.5"}):e("span",{className:h("font-mono font-bold text-sm",n.status?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"),children:n.value??"-"})};return t(C,{className:"col-span-2",children:[e(S,{children:t(w,{className:"flex items-center gap-2",children:[e(c,{iconName:"IconServer",className:"h-5 w-5 text-primary"}),e("h3",{className:"font-semibold",children:"System Status"})]})}),e(b,{children:e("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-7 gap-3",children:r?.map(n=>t("div",{className:"rounded-md border p-3 text-center grid gap-[1px]",children:[t("span",{className:"text-xs text-muted-foreground mx-auto flex items-center gap-1",children:[e(c,{iconName:n.icon,className:"h-4 w-4 text-primary mx-auto"}),n.title]}),e(o,{requirement:n}),n.requirements&&e("span",{className:"font-mono font-bold text-xs text-muted-foreground",children:n.requirements})]}))})})]})},Ne=()=>t("div",{className:"col-span-2 text-center grid gap-3",children:[t("p",{className:"text-sm text-muted-foreground px-5 mx-auto",children:["A two-year R&D effort carried out by a single-person team resulted in the completion of this platform and ecosystem. It provides users with a unique infrastructure built on the most modern and powerful technology stacks. This infrastructure enables you to prepare your project in the shortest possible time while achieving maximum performance, user engagement, and rich functionality.",e("br",{}),"Thank you for choosing us."]}),e("img",{src:"https://eminilhan.com/wp-content/uploads/2023/04/beyaz-logo-1.png",className:"h-10 mx-auto"})]}),ee=()=>{let r=localStorage?.getItem("last_core_update_checked"),[o,n]=f(localStorage?.getItem("is_core_up_to_date")==="true"),[m,k]=f(r?new Date(r):null),[s,v]=f(JSON.parse(localStorage?.getItem("last_core_versions")??"null")),d=Q();W(()=>{localStorage.setItem("is_core_up_to_date",o?"true":"false"),localStorage.setItem("last_core_versions",JSON.stringify(s)),localStorage.setItem("last_core_update_checked",m?m.toISOString():"")},[o,s,m]);let R=D(),{packages:I,isLoading:P,setIsLoading:V,setLoadingContent:O,setIsModalOpen:z,setPackageManifest:_,setProcess:U,setValidationError:A}=R,{selectVersion:j,SelectionModal:q}=E(),H=()=>d.processing?e(L,{className:"h-6 w-6 text-primary animate-spin shrink-0"}):o?e(Z,{className:"h-6 w-6 text-green-600 dark:text-green-400 shrink-0"}):e(X,{className:"h-6 w-6 text-blue-600 dark:text-blue-500 shrink-0"}),J=()=>t("div",{className:"grid",children:[e("span",{className:h("text-sm font-medium",d.processing?"text-primary":o?"text-green-600 dark:text-green-400":"text-blue-600 dark:text-blue-500"),children:d.processing?"Checking updates...":o?"System is up to date!":"New version available!"}),e("span",{className:"text-xs text-primary/70",children:o===!0?"Last checked: "+(m?.toLocaleString()??"never"):"Keep your system up to date with the latest features, performance improvements, and security updates."})]});return t("div",{className:"grid md:flex md:items-center gap-2",children:[e(()=>t("div",{className:"flex items-center gap-2",children:[e(H,{}),e(J,{})]}),{}),t("div",{className:"grid md:flex md:items-center gap-3 md:ml-auto",children:[e(()=>{let i=$(),x=(a,l)=>({process:"update",manifest:{code:N,version:a==="update"?l.latest_compatible.version:l.latest.version,core_constraint:"latest"}}),p=()=>{P||i.processing||!s||u().then(()=>{U("update"),V(!0),O({title:"Updating System",description:"Please wait while we update your system to the latest version."}),_({...I.find(a=>a.code==N),version:"latest"}),z(!0),i.post(route("dashboard.packages.manager"),{onError:a=>A(Object.values(a).join(`
2
2
  `))})})},u=async()=>{if(!s)return;if(s.latest.version!==s.latest_compatible.version)await j(s).then(l=>{if(l!==null){let K=l.version===s.latest.version?"upgrade":"update";i.setData(x(K,s))}else return Promise.reject("User cancelled selection.")});else return i.setData(x("update",s)),Promise.resolve()};return!o&&!P&&t(y,{processing:i.processing,recentlySuccessful:i.recentlySuccessful,processingText:"Updating System...",successText:"System updated successfully!",size:"sm",variant:"ghost",className:h("gap-2"),onClick:()=>p(),children:[e(Y,{className:h("h-4 w-4")}),"Update Now"]})},{}),e(()=>{let i=()=>{let p=new Date().getTime()-(m?.getTime()??0),u=60*1e3-p;if(u>0)return F.warning(`Please wait ${Math.ceil(u/1e3)} seconds before checking again.`),!1;let a=new Date().toISOString();return k(new Date(a)),localStorage.setItem("last_core_update_checked",a),!0},x=()=>{if(d.processing||!i())return;let p=I.find(a=>a.code==N);U("update"),_(p);let u=a=>{let l=a.latest.version===p.version;n(l),l||v(a)};B(d,p.id).then(a=>u(a)).catch(()=>F.error("Failed to check updates for Emin Core."))};return t(y,{processing:d.processing,recentlySuccessful:d.recentlySuccessful,processingText:"Checking updates...",successText:o?"System is up to date!":"New version available!",size:"sm",variant:"outline",onClick:()=>x(),children:[e(L,{className:"h-4 w-4"}),"Check Updates"]})},{})]}),e(q,{})]})};export{he as a,fe as b,xe as c,Ne as d};
File without changes
@@ -1 +1 @@
1
- import{a as e}from"./chunk-IDXLUHHA.js";import{a}from"./chunk-7OPUQ2NO.js";import{va as i,wa as t}from"./chunk-HGOBNKGK.js";import{b as o,f as d}from"./chunk-PWQOU5TI.js";import{jsx as r,jsxs as s}from"react/jsx-runtime";var c=({children:b,type:p="sidebar",breadcrumbs:m})=>{if(typeof window>"u")return r(t,{});if(p==="sidebar")return r(i,{children:s(o,{style:{"--sidebar-width":"calc(var(--spacing) * 72)","--header-height":"calc(var(--spacing) * 12)"},children:[r(a,{variant:"inset"}),s(d,{children:[r(e,{breadcrumbs:m}),r("div",{className:"@container/main p-7",children:b})]})]})})};export{c as a};
1
+ import{a}from"./chunk-27WJSL75.js";import{a as e}from"./chunk-MIJMBHKX.js";import{va as i,wa as t}from"./chunk-V6XQBO4L.js";import{b as o,f as d}from"./chunk-SZBMRQZB.js";import{jsx as r,jsxs as s}from"react/jsx-runtime";var c=({children:b,type:p="sidebar",breadcrumbs:m})=>{if(typeof window>"u")return r(t,{});if(p==="sidebar")return r(i,{children:s(o,{style:{"--sidebar-width":"calc(var(--spacing) * 72)","--header-height":"calc(var(--spacing) * 12)"},children:[r(a,{variant:"inset"}),s(d,{children:[r(e,{breadcrumbs:m}),r("div",{className:"@container/main p-7",children:b})]})]})})};export{c as a};
File without changes
@@ -1 +1 @@
1
- import{B as d,da as m,ha as l,k as n}from"./chunk-HGOBNKGK.js";import{a as o,b as c,f as t}from"./chunk-3DBYUBWW.js";import{a as i}from"./chunk-65LRDGYI.js";import{a}from"./chunk-G4EEZUTC.js";import{Head as p}from"@inertiajs/react";import{jsx as e,jsxs as r}from"react/jsx-runtime";var A=({mustVerifyEmail:s,status:f})=>r(d,{breadcrumbs:[{title:"Edit Profile",href:route("user.profile.edit"),icon:"IconEdit"}],children:[e(p,{title:"Account Settings"}),r("div",{className:"grid md:grid-cols-[2fr_4fr] gap-12",children:[e(m,{}),r(o,{children:[e(c,{children:e(i,{icon:e(a,{iconName:"IconUser"}),title:"Profile Information",description:"Update your name and email address"})}),e(t,{children:e(l,{mustVerifyEmail:s,status:f})})]}),e(o,{className:"col-span-full",children:r(t,{className:"grid gap-8 md:flex md:items-center",children:[e(i,{icon:e(a,{iconName:"IconPalette"}),title:"Appearance",description:"Change your account appearance"}),e(n,{className:"md:ml-auto"})]})})]})]});export{A as a};
1
+ import{B as d,da as m,ha as l,k as n}from"./chunk-V6XQBO4L.js";import{a as o,b as c,f as t}from"./chunk-3DBYUBWW.js";import{a as i}from"./chunk-65LRDGYI.js";import{a}from"./chunk-G4EEZUTC.js";import{Head as p}from"@inertiajs/react";import{jsx as e,jsxs as r}from"react/jsx-runtime";var A=({mustVerifyEmail:s,status:f})=>r(d,{breadcrumbs:[{title:"Edit Profile",href:route("user.profile.edit"),icon:"IconEdit"}],children:[e(p,{title:"Account Settings"}),r("div",{className:"grid md:grid-cols-[2fr_4fr] gap-12",children:[e(m,{}),r(o,{children:[e(c,{children:e(i,{icon:e(a,{iconName:"IconUser"}),title:"Profile Information",description:"Update your name and email address"})}),e(t,{children:e(l,{mustVerifyEmail:s,status:f})})]}),e(o,{className:"col-span-full",children:r(t,{className:"grid gap-8 md:flex md:items-center",children:[e(i,{icon:e(a,{iconName:"IconPalette"}),title:"Appearance",description:"Change your account appearance"}),e(n,{className:"md:ml-auto"})]})})]})]});export{A as a};
@@ -1 +1 @@
1
- import{a as g}from"./chunk-XHQB4Q52.js";import{a as W,b as d}from"./chunk-5SCOJRW6.js";import{a as K}from"./chunk-VDWGKLE7.js";import{a as q}from"./chunk-KND3PUAR.js";import{a as H}from"./chunk-WUFYLSW5.js";import{Aa as L,Ea as z,c as D,t as U,u as A,v as w}from"./chunk-HGOBNKGK.js";import{a as k}from"./chunk-M5QT5SFN.js";import{a as R,f as _,g as M,i as B}from"./chunk-QFUZ6MVT.js";import{b as T}from"./chunk-TVCWAJFT.js";import{a as f,b as y,c as h,d as b}from"./chunk-PRCYNFKC.js";import{a as l}from"./chunk-G4EEZUTC.js";import{a as u}from"./chunk-G22OJQWL.js";import{a as C}from"./chunk-GND5KQRZ.js";import{b as i}from"./chunk-QKP3C5FM.js";import{router as $}from"@inertiajs/react";import{jsx as J}from"react/jsx-runtime";var x=()=>{let a=d(),{users:o,meta:r}=a,t=O(),m=V();return J(z,{data:o,columns:t,meta:r,handleRequest:s=>G(s,a),bulkActions:m})},G=(a,o)=>{$.get(route("dashboard.users"),{...a},{preserveState:!0,preserveScroll:!0,preserveUrl:!0,only:["users","meta"],onSuccess:r=>{o.setUsers(r.props.users),o.setMeta(r.props.meta)}})};import{Head as Q}from"@inertiajs/react";import{jsx as p,jsxs as I}from"react/jsx-runtime";var X=({users:a,roles:o,meta:r,statistics:t})=>{let m=[{title:"WM Dashboard",href:route("dashboard")},{title:"Users"}];return I(H,{breadcrumbs:m,children:[p(Q,{title:"Users"}),p(q,{title:"Users",description:"Here you can see and manage all the system users.",icon:p(l,{iconName:"IconUsers",className:"h-10 w-10 my-2"})}),I(W,{users:a,roles:o,meta:r,children:[I("div",{className:"grid gap-4",children:[p(K,{statistics:t}),p("div",{children:p(x,{})})]}),p(E,{})]})]})};import{useEffect as Y,useState as j}from"react";import{toast as S}from"sonner";import{Fragment as ee,jsx as e,jsxs as n}from"react/jsx-runtime";var F=(a,o)=>[{key:"name",label:"Name",value:a.name,type:"text",editable:!1},{key:"surname",label:"surname",value:a.surname,type:"text",editable:!1},{key:"email",label:"Email",value:a.email,editable:!1},{key:"role_code",label:"Role",value:a.role_code,type:"select",options:o.map(r=>({label:r.title,value:r.code}))},{key:"status",label:"Status",value:Number(a.status),type:"select",options:Object.entries(i).map(([r,t])=>({label:r,value:Number(t)}))},{key:"last_seen_at",label:"Last Seen At",value:a.last_seen_at?new Date(a.last_seen_at).toLocaleString():"Never",editable:!1},{key:"registered_at",label:"Registered At",value:new Date(a.created_at).toLocaleString(),editable:!1},{key:"updated_at",label:"Updated At",value:new Date(a.updated_at).toLocaleString(),editable:!1}],O=()=>{let{setSelectedUser:a,setShowUserModal:o,roles:r}=d(),[t,m]=j(!0);return Y(()=>{m(!1);let s=setTimeout(()=>m(!0),50);return()=>clearTimeout(s)},[]),[{id:"select",header:({table:s})=>e(k,{checked:s.getIsAllPageRowsSelected()||s.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:v=>s.toggleAllPageRowsSelected(!!v),"aria-label":"T\xFCm\xFCn\xFC se\xE7"}),cell:({row:s,table:v})=>e(k,{id:`select-row-${s.id}`,checked:s.getIsSelected(),onCheckedChange:P=>{s.toggleSelected(!!P)},"aria-label":"Sat\u0131r se\xE7"}),enableSorting:!1,enableHiding:!1},{accessorKey:"id",header:"ID",cell:({row:s})=>n("div",{className:"flex",children:[e(u,{className:"my-2 h-5 w-10",style:{display:t?"none":"block"}}),n("span",{style:{display:t?"block":"none"},children:["#",s.original.id]})]})},{accessorKey:"user",header:"User",cell:({row:s})=>n("div",{className:"flex",children:[e(u,{className:"my-2 h-5 w-10",style:{display:t?"none":"block"}}),n("div",{style:{display:t?"flex":"none"},className:"cursor-pointer",onClick:()=>{a(s.original),o(!0)},children:[e("div",{className:"flex sm:hidden",children:e(w,{user:s.original??null,settings:{showEmail:!0}})}),n("div",{className:"hidden sm:flex items-center gap-2",children:[e(U,{user:s.original,type:"square"}),e(A,{user:s.original,settings:{showId:!1}})]})]})]})},{accessorKey:"status",header:()=>n(f,{trigger:"hover",children:[e(h,{children:"Status"}),n(b,{children:[e(y,{children:"Status"}),e("span",{children:"The status of user"})]})]}),cell:({row:s})=>n(f,{trigger:"hover",children:[n(h,{children:[e(u,{className:"my-2 h-5 w-10",style:{display:t?"none":"block"}}),e("div",{style:{display:t?"block":"none"},children:s.original.status==0?e(l,{iconName:"IconPlayerPause",className:"h-4 w-4 text-primary"}):s.original.status==1?e(l,{iconName:"IconCircleCheckFilled",className:"h-4 w-4 text-green-400"}):s.original.status==2?e(l,{iconName:"IconZoom",className:"h-4 w-4 text-yellow-400"}):s.original.status==3&&e(l,{iconName:"IconBan",className:"h-4 w-4 text-red-400"})})]}),n(b,{children:[e(y,{children:"User Status"}),e("span",{children:s.original?.status==i.Inactive?"Inactive":s.original?.status==i.Active?"Active":s.original?.status==i.Pending?"Pending":"Suspended"})]})]})},{id:"role",accessorKey:"role",header:()=>n(f,{trigger:"hover",children:[e(h,{children:"Role"}),n(b,{children:[e(y,{children:"Role"}),e("span",{children:"The role of user"})]})]}),cell:({row:s})=>{let v=r.find(P=>P.code==s.original.role_code);return n(f,{trigger:"hover",isActive:s.original.role!==void 0,children:[n(h,{children:[e(u,{className:"my-2 h-5 w-10",style:{display:t?"none":"block"}}),e("div",{style:{display:t?"block":"none"},children:v?e(L,{...v}):e("span",{className:"capitalize",children:s.original.role_code})})]}),n(b,{children:[e(y,{children:"Role"}),e("span",{children:s.original.role_code})]})]})}},{id:"actions",header:()=>"Actions",cell:({row:s})=>n(ee,{children:[e(u,{className:"my-2 h-5 w-10",style:{display:t?"none":"block"}}),e("div",{style:{display:t?"flex":"none"},className:"gap-1",children:e(T,{variant:"ghost",size:"sm",onClick:()=>{console.log("test"),a(s.original),o(!0)},children:e(l,{iconName:"IconEye"})})})]})}]},V=()=>[{label:"Suspend",icon:e(l,{iconName:"IconBan",className:"h-4 w-4 mr-1"}),variant:"destructive",confirm:!0,confirmTitle:"Suspend Users",confirmContent:"Are you sure to suspend these users?",confirmIcon:e(l,{iconName:"IconCheck",size:30}),cancel:()=>S.info("Process cancelled"),action:(a,o)=>{let r=a.map(t=>t.original.id.toString());g(r,{status:i.Suspended}).then(()=>o&&o())}},{label:"Confirm",icon:e(l,{iconName:"IconCheck",className:"h-4 w-4 mr-1"}),variant:"outline",confirm:!0,confirmTitle:"Confirm Users",confirmContent:"Are you sure to confirm these users?",confirmIcon:e(l,{iconName:"IconCheck",size:30}),cancel:()=>S.info("Process cancelled"),action:(a,o)=>{let r=a.map(t=>t.original.id.toString());g(r,{status:i.Active}).then(()=>o&&o())}},{label:"Disable",icon:e(l,{iconName:"IconPlayerPause",className:"h-4 w-4 mr-1"}),variant:"outline",confirm:!0,confirmTitle:"Make Users Inactive",confirmContent:"Are you sure to make these users inactive?",confirmIcon:e(l,{iconName:"IconCheck",size:30}),cancel:()=>S.info("Process cancelled"),action:(a,o)=>{let r=a.map(t=>t.original.id.toString());g(r,{status:i.Inactive}).then(()=>o&&o())}}];import{jsx as c,jsxs as N}from"react/jsx-runtime";var E=()=>{let{selectedUser:a,showUserModal:o,setShowUserModal:r}=d();return c(R,{open:o,onOpenChange:r,children:N(_,{className:"max-h-[90vh] sm:max-w-[50vw] grid !gap-4 overflow-auto",children:[c(M,{className:"pb-4 border-b shrink-0",children:N(B,{children:["Details of ",a?.name]})}),c(Z,{})]})})},Z=()=>{let{selectedUser:a,roles:o}=d();if(!a)return;let r=F(a,o);return N("div",{className:"grid md:grid-cols-[200px_auto] gap-5",children:[c("div",{className:"flex items-center gap-4",children:c(U,{user:a,type:"square",className:"h-full w-full"})}),c("div",{className:"grid grid-cols-2 gap-y-3",children:r.map(t=>N("div",{className:C("flex flex-col items-start justify-start",t.value?.toString()?.length>30?"col-span-2":""),children:[c("p",{className:"text-sm text-muted-foreground capitalize",children:t?.label}),c(D,{item:t,onChange:(m,s)=>g([a.id.toString()],{[m]:s}),children:t.key==="status"?t.value==i.Inactive?c("span",{className:"text-sm text-primary",children:"Inactive"}):t.value==i.Active?c("span",{className:"text-sm text-green-400",children:"Active"}):t.value==i.Pending?c("span",{className:"text-sm text-yellow-400",children:"Pending"}):t.value==i.Suspended&&c("span",{className:"text-sm text-red-400",children:"Suspended"}):c("span",{className:"text-sm",children:t?.value??"-"})},t.key)]},t.key))})]})};export{E as a,Z as b,x as c,X as d,F as e,O as f,V as g};
1
+ import{a as W,b as d}from"./chunk-5SCOJRW6.js";import{a as g}from"./chunk-XHQB4Q52.js";import{a as K}from"./chunk-UTO7XKUN.js";import{a as q}from"./chunk-KND3PUAR.js";import{a as H}from"./chunk-CN6NPPO6.js";import{Aa as L,Ea as z,c as D,t as U,u as A,v as w}from"./chunk-V6XQBO4L.js";import{a as R,f as _,g as M,i as B}from"./chunk-QFUZ6MVT.js";import{a as k}from"./chunk-M5QT5SFN.js";import{b as T}from"./chunk-TVCWAJFT.js";import{a as u}from"./chunk-G22OJQWL.js";import{a as f,b as y,c as h,d as b}from"./chunk-PRCYNFKC.js";import{a as l}from"./chunk-G4EEZUTC.js";import{b as i}from"./chunk-QKP3C5FM.js";import{a as C}from"./chunk-GND5KQRZ.js";import{router as $}from"@inertiajs/react";import{jsx as J}from"react/jsx-runtime";var x=()=>{let a=d(),{users:o,meta:r}=a,t=O(),m=V();return J(z,{data:o,columns:t,meta:r,handleRequest:s=>G(s,a),bulkActions:m})},G=(a,o)=>{$.get(route("dashboard.users"),{...a},{preserveState:!0,preserveScroll:!0,preserveUrl:!0,only:["users","meta"],onSuccess:r=>{o.setUsers(r.props.users),o.setMeta(r.props.meta)}})};import{Head as Q}from"@inertiajs/react";import{jsx as p,jsxs as I}from"react/jsx-runtime";var X=({users:a,roles:o,meta:r,statistics:t})=>{let m=[{title:"WM Dashboard",href:route("dashboard")},{title:"Users"}];return I(H,{breadcrumbs:m,children:[p(Q,{title:"Users"}),p(q,{title:"Users",description:"Here you can see and manage all the system users.",icon:p(l,{iconName:"IconUsers",className:"h-10 w-10 my-2"})}),I(W,{users:a,roles:o,meta:r,children:[I("div",{className:"grid gap-4",children:[p(K,{statistics:t}),p("div",{children:p(x,{})})]}),p(E,{})]})]})};import{useEffect as Y,useState as j}from"react";import{toast as S}from"sonner";import{Fragment as ee,jsx as e,jsxs as n}from"react/jsx-runtime";var F=(a,o)=>[{key:"name",label:"Name",value:a.name,type:"text",editable:!1},{key:"surname",label:"surname",value:a.surname,type:"text",editable:!1},{key:"email",label:"Email",value:a.email,editable:!1},{key:"role_code",label:"Role",value:a.role_code,type:"select",options:o.map(r=>({label:r.title,value:r.code}))},{key:"status",label:"Status",value:Number(a.status),type:"select",options:Object.entries(i).map(([r,t])=>({label:r,value:Number(t)}))},{key:"last_seen_at",label:"Last Seen At",value:a.last_seen_at?new Date(a.last_seen_at).toLocaleString():"Never",editable:!1},{key:"registered_at",label:"Registered At",value:new Date(a.created_at).toLocaleString(),editable:!1},{key:"updated_at",label:"Updated At",value:new Date(a.updated_at).toLocaleString(),editable:!1}],O=()=>{let{setSelectedUser:a,setShowUserModal:o,roles:r}=d(),[t,m]=j(!0);return Y(()=>{m(!1);let s=setTimeout(()=>m(!0),50);return()=>clearTimeout(s)},[]),[{id:"select",header:({table:s})=>e(k,{checked:s.getIsAllPageRowsSelected()||s.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:v=>s.toggleAllPageRowsSelected(!!v),"aria-label":"T\xFCm\xFCn\xFC se\xE7"}),cell:({row:s,table:v})=>e(k,{id:`select-row-${s.id}`,checked:s.getIsSelected(),onCheckedChange:P=>{s.toggleSelected(!!P)},"aria-label":"Sat\u0131r se\xE7"}),enableSorting:!1,enableHiding:!1},{accessorKey:"id",header:"ID",cell:({row:s})=>n("div",{className:"flex",children:[e(u,{className:"my-2 h-5 w-10",style:{display:t?"none":"block"}}),n("span",{style:{display:t?"block":"none"},children:["#",s.original.id]})]})},{accessorKey:"user",header:"User",cell:({row:s})=>n("div",{className:"flex",children:[e(u,{className:"my-2 h-5 w-10",style:{display:t?"none":"block"}}),n("div",{style:{display:t?"flex":"none"},className:"cursor-pointer",onClick:()=>{a(s.original),o(!0)},children:[e("div",{className:"flex sm:hidden",children:e(w,{user:s.original??null,settings:{showEmail:!0}})}),n("div",{className:"hidden sm:flex items-center gap-2",children:[e(U,{user:s.original,type:"square"}),e(A,{user:s.original,settings:{showId:!1}})]})]})]})},{accessorKey:"status",header:()=>n(f,{trigger:"hover",children:[e(h,{children:"Status"}),n(b,{children:[e(y,{children:"Status"}),e("span",{children:"The status of user"})]})]}),cell:({row:s})=>n(f,{trigger:"hover",children:[n(h,{children:[e(u,{className:"my-2 h-5 w-10",style:{display:t?"none":"block"}}),e("div",{style:{display:t?"block":"none"},children:s.original.status==0?e(l,{iconName:"IconPlayerPause",className:"h-4 w-4 text-primary"}):s.original.status==1?e(l,{iconName:"IconCircleCheckFilled",className:"h-4 w-4 text-green-400"}):s.original.status==2?e(l,{iconName:"IconZoom",className:"h-4 w-4 text-yellow-400"}):s.original.status==3&&e(l,{iconName:"IconBan",className:"h-4 w-4 text-red-400"})})]}),n(b,{children:[e(y,{children:"User Status"}),e("span",{children:s.original?.status==i.Inactive?"Inactive":s.original?.status==i.Active?"Active":s.original?.status==i.Pending?"Pending":"Suspended"})]})]})},{id:"role",accessorKey:"role",header:()=>n(f,{trigger:"hover",children:[e(h,{children:"Role"}),n(b,{children:[e(y,{children:"Role"}),e("span",{children:"The role of user"})]})]}),cell:({row:s})=>{let v=r.find(P=>P.code==s.original.role_code);return n(f,{trigger:"hover",isActive:s.original.role!==void 0,children:[n(h,{children:[e(u,{className:"my-2 h-5 w-10",style:{display:t?"none":"block"}}),e("div",{style:{display:t?"block":"none"},children:v?e(L,{...v}):e("span",{className:"capitalize",children:s.original.role_code})})]}),n(b,{children:[e(y,{children:"Role"}),e("span",{children:s.original.role_code})]})]})}},{id:"actions",header:()=>"Actions",cell:({row:s})=>n(ee,{children:[e(u,{className:"my-2 h-5 w-10",style:{display:t?"none":"block"}}),e("div",{style:{display:t?"flex":"none"},className:"gap-1",children:e(T,{variant:"ghost",size:"sm",onClick:()=>{console.log("test"),a(s.original),o(!0)},children:e(l,{iconName:"IconEye"})})})]})}]},V=()=>[{label:"Suspend",icon:e(l,{iconName:"IconBan",className:"h-4 w-4 mr-1"}),variant:"destructive",confirm:!0,confirmTitle:"Suspend Users",confirmContent:"Are you sure to suspend these users?",confirmIcon:e(l,{iconName:"IconCheck",size:30}),cancel:()=>S.info("Process cancelled"),action:(a,o)=>{let r=a.map(t=>t.original.id.toString());g(r,{status:i.Suspended}).then(()=>o&&o())}},{label:"Confirm",icon:e(l,{iconName:"IconCheck",className:"h-4 w-4 mr-1"}),variant:"outline",confirm:!0,confirmTitle:"Confirm Users",confirmContent:"Are you sure to confirm these users?",confirmIcon:e(l,{iconName:"IconCheck",size:30}),cancel:()=>S.info("Process cancelled"),action:(a,o)=>{let r=a.map(t=>t.original.id.toString());g(r,{status:i.Active}).then(()=>o&&o())}},{label:"Disable",icon:e(l,{iconName:"IconPlayerPause",className:"h-4 w-4 mr-1"}),variant:"outline",confirm:!0,confirmTitle:"Make Users Inactive",confirmContent:"Are you sure to make these users inactive?",confirmIcon:e(l,{iconName:"IconCheck",size:30}),cancel:()=>S.info("Process cancelled"),action:(a,o)=>{let r=a.map(t=>t.original.id.toString());g(r,{status:i.Inactive}).then(()=>o&&o())}}];import{jsx as c,jsxs as N}from"react/jsx-runtime";var E=()=>{let{selectedUser:a,showUserModal:o,setShowUserModal:r}=d();return c(R,{open:o,onOpenChange:r,children:N(_,{className:"max-h-[90vh] sm:max-w-[50vw] grid !gap-4 overflow-auto",children:[c(M,{className:"pb-4 border-b shrink-0",children:N(B,{children:["Details of ",a?.name]})}),c(Z,{})]})})},Z=()=>{let{selectedUser:a,roles:o}=d();if(!a)return;let r=F(a,o);return N("div",{className:"grid md:grid-cols-[200px_auto] gap-5",children:[c("div",{className:"flex items-center gap-4",children:c(U,{user:a,type:"square",className:"h-full w-full"})}),c("div",{className:"grid grid-cols-2 gap-y-3",children:r.map(t=>N("div",{className:C("flex flex-col items-start justify-start",t.value?.toString()?.length>30?"col-span-2":""),children:[c("p",{className:"text-sm text-muted-foreground capitalize",children:t?.label}),c(D,{item:t,onChange:(m,s)=>g([a.id.toString()],{[m]:s}),children:t.key==="status"?t.value==i.Inactive?c("span",{className:"text-sm text-primary",children:"Inactive"}):t.value==i.Active?c("span",{className:"text-sm text-green-400",children:"Active"}):t.value==i.Pending?c("span",{className:"text-sm text-yellow-400",children:"Pending"}):t.value==i.Suspended&&c("span",{className:"text-sm text-red-400",children:"Suspended"}):c("span",{className:"text-sm",children:t?.value??"-"})},t.key)]},t.key))})]})};export{E as a,Z as b,x as c,X as d,F as e,O as f,V as g};
@@ -1 +1 @@
1
- import{a as b,b as R,c as z,d as B,e as V,g as H}from"./chunk-NFOQ4KW2.js";import{a as T}from"./chunk-HDYNFDEV.js";import{a as P}from"./chunk-KND3PUAR.js";import{a as L}from"./chunk-WUFYLSW5.js";import{a as C}from"./chunk-QKGQOXDM.js";import{b as G}from"./chunk-TVCWAJFT.js";import{a as o}from"./chunk-G4EEZUTC.js";import{a as D}from"./chunk-G22OJQWL.js";import{useEffect as F}from"react";import{Head as U,usePage as W}from"@inertiajs/react";import{createContext as J,useContext as K,useState as p}from"react";import{jsx as O}from"react/jsx-runtime";var _=J({}),E=({children:t,slugGroups:a,onChange:u})=>{let[l,i]=p(a),[d,c]=p(""),[n,m]=p(new Set),[N,r]=p(new Set),[f,v]=p(new Set),[x,y]=p({}),[k,A]=p({}),j={onChange:u,slugGroups:l,setSlugGroups:i,searchTerm:d,setSearchTerm:c,expandedGroups:n,setExpandedGroups:m,expandedSlugs:N,setExpandedSlugs:r,invalidSlugs:f,setInvalidSlugs:v,slugInputTemps:x,setSlugInputTemps:y,slugInput:k,setSlugInput:A,toggleSlug:g=>{r(S=>{let w=new Set(S);return w.has(g)?w.delete(g):w.add(g),w})},setAllExpanded:g=>{g?(m(new Set(B(l))),r(new Set(V(l)))):(m(new Set),r(new Set))},toggleGroup:g=>{let S=new Set(n);S.has(g)?S.delete(g):S.add(g),m(S)}};return O(_.Provider,{value:j,children:t})},h=()=>{let t=K(_);if(!t)throw new Error("useSlugs sadece SlugsProvider i\xE7inde kullan\u0131labilir!");return t};import{jsx as e,jsxs as s}from"react/jsx-runtime";var $=()=>{let{slugGroups:t,searchTerm:a,setSearchTerm:u,setExpandedGroups:l,setSlugInputTemps:i,setSlugInput:d,setAllExpanded:c}=h();return F(()=>{let n=R(t);i(n),d(n)},[t]),F(()=>{if(a){let n=new Set;H(t,n,a),l(n)}},[a]),s("div",{className:"p-4",children:[e("div",{className:"mb-4",children:s("div",{className:"relative",children:[e("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none",children:e(o,{iconName:"IconSearch",className:"h-5 w-5 text-gray-400"})}),e(C,{type:"text",className:"pr-10 focus-visible:ring-0"+(a?"border-gray-400":""),placeholder:"Searchs...",value:a,onChange:n=>u(n.target.value)})]})}),s("div",{className:"mb-4 grid grid-cols-1 lg:flex gap-2",children:[s(G,{size:"sm",variant:"outline",onClick:()=>c(!1),className:"flex items-center gap-2",children:[e(o,{iconName:"IconMinimize"}),"Collapse All"]}),s(G,{size:"sm",variant:"outline",onClick:()=>c(!0),className:"flex items-center gap-2",children:[e(o,{iconName:"IconArrowsMaximize"}),"Expand All"]})]}),e("div",{className:"space-y-2",children:t.length>0?z(t,a).map(n=>e(q,{group:n,depth:0},n.id)):s("div",{className:"text-center py-8 text-muted-foreground",children:[e(o,{iconName:"IconSearch",className:"mx-auto mb-2",size:24}),e("p",{children:"Arama kriterlerinize uygun sonu\xE7 bulunamad\u0131."})]})})]})},X=({slug:t})=>{let{expandedSlugs:a,searchTerm:u,setSlugInputTemps:l,slugInputTemps:i,setSlugInput:d,slugInput:c,setInvalidSlugs:n,invalidSlugs:m,onChange:N,toggleSlug:r}=h(),{title:f,description:v}=t?.slug_data??{title:"N/A",description:"N/A"},x=a.has(t.id),y=b(f,u),k=b(v,u);return e("div",{className:"ml-6 p-2 pr-0 border-l-2 border-accent",children:s("div",{className:`dark:bg-[#101010] bg-accent rounded-lg p-3 grid grid-cols-1 items-center shadow-sm ${y||k?"bg-accent/50":""}`,children:[s("button",{onClick:()=>r(t.id),className:"flex items-center gap-2 w-full text-left",children:[x?e(o,{iconName:"IconChevronDown",className:"h-5 w-5"}):e(o,{iconName:"IconChevronRight",className:"h-5 w-5"}),s("div",{className:"flex items-center gap-1 w-full",children:[e(o,{iconName:t.icon??"IconLink"}),s("div",{className:"ml-2 text-left",children:[e("h4",{className:"font-semibold",children:y?e("span",{className:"dark:bg-gray-800 dark:text-white bg-gray-300",children:t.slug_data.title}):f}),e("p",{className:"text-sm",children:k?e("span",{className:"dark:bg-gray-800 bg-gray-300 font-medium",children:v}):v})]})]})]}),s("div",{className:`${x?"grid":"hidden"}`,children:[e("hr",{className:"mb-5 mt-2"}),e("div",{children:e("div",{className:"flex gap-2",children:e("div",{className:"w-full",children:e("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-2",children:s("div",{className:"group relative",children:[e(C,{id:t.id.toString(),type:"text",required:!0,defaultValue:i[t.id],onBlur:I=>{l({...i,[t.id]:I.target.value})},placeholder:"slug",className:"border-0 bg-muted/50 focus-visible:ring-1 px-10 bg-background border-1",autoComplete:"off","aria-invalid":m.has(t.id)}),e("div",{className:"text-muted-foreground/80 absolute inset-y-0 start-0 flex items-center justify-center ps-3",children:e(o,{iconName:t.icon??"IconLink",size:16})}),e("div",{className:"absolute inset-y-0 end-0 flex items-center justify-center gap-1",children:s(G,{variant:"ghost",disabled:i[t.id]===c[t.id],onClick:()=>{let I={...t,slug:i[t.id]};N(I,M=>{M?d({...c,[t.id]:i[t.id]}):n(new Set(m).add(t.id))})},children:[e(o,{iconName:t.icon??"IconDeviceFloppy",size:16}),e("span",{className:"text-xs",children:"Save"})]})})]})},t.code)})})})]})]})},t.code)},q=({group:t,depth:a=0})=>{let{expandedGroups:u,toggleGroup:l}=h(),{title:i,description:d}=t?.group_data??{title:"N/A",description:"N/A"},c=u.has(t.id),n=b(i),m=b(d);return s("div",{children:[s("button",{onClick:()=>l(t.id),className:`w-full flex items-center p-3 rounded-lg dark:bg-[#101010] bg-accent hover:bg-accent/20 transition-colors ${n||m?"bg-accent/50":"bg-accent"}`,children:[c?e(o,{iconName:"IconChevronDown",className:"h-5 w-5"}):e(o,{iconName:"IconChevronRight",className:"h-5 w-5"}),e(o,{iconName:t.icon??"IconLink",className:"ml-2",fallback:e(D,{className:"w-5 h-5"})}),s("div",{className:"ml-2 text-left",children:[e("h4",{className:"font-semibold",children:n?e("span",{className:"dark:bg-gray-800 dark:text-white bg-gray-300",children:i}):i}),e("p",{className:"text-sm",children:m?e("span",{className:"dark:bg-gray-800 bg-gray-300 font-medium",children:d}):d})]})]}),c&&s("div",{className:"mt-2",children:[e("div",{className:"mb-2",style:{marginLeft:a*16},children:t.slugs?.map(r=>e(X,{slug:r},r.id))}),Array.isArray(t.childrens)&&t.childrens.length>0&&e("div",{className:"mt-2",style:{marginLeft:(a<1?1:a)*16},children:t.childrens.map(r=>e("div",{className:"mb-2",style:{marginLeft:a*16},children:e(q,{group:r,depth:a+1},r.id)}))}),Number(t.slugs?.length)<1&&Number(t.childrens?.length)<1&&e("div",{className:"text-sm text-muted-foreground mt-2 ml-4",children:"There is no slugs or child groups found."})]})]},t.code)},Q=({slugGroups:t})=>{let a=[{title:"Dashboard",href:route("dashboard")},{title:"Settings",href:route("dashboard.settings")},{title:"Slugs",href:route("dashboard.settings.slugs")}],{eminLang:u}=W().props;return s(L,{breadcrumbs:a,children:[e(U,{title:"Slugs"}),s("div",{className:"container mx-auto",children:[e(P,{title:"Slugs",description:"Here you can see and manage all the system slugs.",icon:e(o,{iconName:"IconLink",className:"h-10 w-10 my-2 opacity-75"})}),u?.multiLanguage&&s("div",{className:"flex items-center gap-4",children:[e(o,{iconName:"IconAlertTriangle",className:"h-10 w-10 my-2 text-red-500"}),s("div",{children:[e("h3",{className:"font-bold text-lg",children:"Dikkat!"}),e("span",{className:"text-muted-foreground",children:"Sisteminizde \xE7oklu dil eklentisi aktiftir. Bu sebeple buradaki link yap\u0131lar\u0131 \xE7oklu dil eklentisi aktif oldu\u011Fu s\xFCre boyunca \xE7al\u0131\u015Fmayacakt\u0131r."})]})]}),e(E,{slugGroups:t,onChange:(l,i)=>{T(l,d=>{d?(l.slug=l.slug,i?.(!0)):i?.(!1)})},children:e($,{})})]})]})};export{$ as a,X as b,q as c,Q as d,E as e,h as f};
1
+ import{a as b,b as R,c as z,d as B,e as V,g as H}from"./chunk-NFOQ4KW2.js";import{a as T}from"./chunk-HDYNFDEV.js";import{a as P}from"./chunk-KND3PUAR.js";import{a as L}from"./chunk-CN6NPPO6.js";import{a as C}from"./chunk-QKGQOXDM.js";import{b as G}from"./chunk-TVCWAJFT.js";import{a as D}from"./chunk-G22OJQWL.js";import{a as o}from"./chunk-G4EEZUTC.js";import{useEffect as F}from"react";import{Head as U,usePage as W}from"@inertiajs/react";import{createContext as J,useContext as K,useState as p}from"react";import{jsx as O}from"react/jsx-runtime";var _=J({}),E=({children:t,slugGroups:a,onChange:u})=>{let[l,i]=p(a),[d,c]=p(""),[n,m]=p(new Set),[N,r]=p(new Set),[f,v]=p(new Set),[x,y]=p({}),[k,A]=p({}),j={onChange:u,slugGroups:l,setSlugGroups:i,searchTerm:d,setSearchTerm:c,expandedGroups:n,setExpandedGroups:m,expandedSlugs:N,setExpandedSlugs:r,invalidSlugs:f,setInvalidSlugs:v,slugInputTemps:x,setSlugInputTemps:y,slugInput:k,setSlugInput:A,toggleSlug:g=>{r(S=>{let w=new Set(S);return w.has(g)?w.delete(g):w.add(g),w})},setAllExpanded:g=>{g?(m(new Set(B(l))),r(new Set(V(l)))):(m(new Set),r(new Set))},toggleGroup:g=>{let S=new Set(n);S.has(g)?S.delete(g):S.add(g),m(S)}};return O(_.Provider,{value:j,children:t})},h=()=>{let t=K(_);if(!t)throw new Error("useSlugs sadece SlugsProvider i\xE7inde kullan\u0131labilir!");return t};import{jsx as e,jsxs as s}from"react/jsx-runtime";var $=()=>{let{slugGroups:t,searchTerm:a,setSearchTerm:u,setExpandedGroups:l,setSlugInputTemps:i,setSlugInput:d,setAllExpanded:c}=h();return F(()=>{let n=R(t);i(n),d(n)},[t]),F(()=>{if(a){let n=new Set;H(t,n,a),l(n)}},[a]),s("div",{className:"p-4",children:[e("div",{className:"mb-4",children:s("div",{className:"relative",children:[e("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none",children:e(o,{iconName:"IconSearch",className:"h-5 w-5 text-gray-400"})}),e(C,{type:"text",className:"pr-10 focus-visible:ring-0"+(a?"border-gray-400":""),placeholder:"Searchs...",value:a,onChange:n=>u(n.target.value)})]})}),s("div",{className:"mb-4 grid grid-cols-1 lg:flex gap-2",children:[s(G,{size:"sm",variant:"outline",onClick:()=>c(!1),className:"flex items-center gap-2",children:[e(o,{iconName:"IconMinimize"}),"Collapse All"]}),s(G,{size:"sm",variant:"outline",onClick:()=>c(!0),className:"flex items-center gap-2",children:[e(o,{iconName:"IconArrowsMaximize"}),"Expand All"]})]}),e("div",{className:"space-y-2",children:t.length>0?z(t,a).map(n=>e(q,{group:n,depth:0},n.id)):s("div",{className:"text-center py-8 text-muted-foreground",children:[e(o,{iconName:"IconSearch",className:"mx-auto mb-2",size:24}),e("p",{children:"Arama kriterlerinize uygun sonu\xE7 bulunamad\u0131."})]})})]})},X=({slug:t})=>{let{expandedSlugs:a,searchTerm:u,setSlugInputTemps:l,slugInputTemps:i,setSlugInput:d,slugInput:c,setInvalidSlugs:n,invalidSlugs:m,onChange:N,toggleSlug:r}=h(),{title:f,description:v}=t?.slug_data??{title:"N/A",description:"N/A"},x=a.has(t.id),y=b(f,u),k=b(v,u);return e("div",{className:"ml-6 p-2 pr-0 border-l-2 border-accent",children:s("div",{className:`dark:bg-[#101010] bg-accent rounded-lg p-3 grid grid-cols-1 items-center shadow-sm ${y||k?"bg-accent/50":""}`,children:[s("button",{onClick:()=>r(t.id),className:"flex items-center gap-2 w-full text-left",children:[x?e(o,{iconName:"IconChevronDown",className:"h-5 w-5"}):e(o,{iconName:"IconChevronRight",className:"h-5 w-5"}),s("div",{className:"flex items-center gap-1 w-full",children:[e(o,{iconName:t.icon??"IconLink"}),s("div",{className:"ml-2 text-left",children:[e("h4",{className:"font-semibold",children:y?e("span",{className:"dark:bg-gray-800 dark:text-white bg-gray-300",children:t.slug_data.title}):f}),e("p",{className:"text-sm",children:k?e("span",{className:"dark:bg-gray-800 bg-gray-300 font-medium",children:v}):v})]})]})]}),s("div",{className:`${x?"grid":"hidden"}`,children:[e("hr",{className:"mb-5 mt-2"}),e("div",{children:e("div",{className:"flex gap-2",children:e("div",{className:"w-full",children:e("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-2",children:s("div",{className:"group relative",children:[e(C,{id:t.id.toString(),type:"text",required:!0,defaultValue:i[t.id],onBlur:I=>{l({...i,[t.id]:I.target.value})},placeholder:"slug",className:"border-0 bg-muted/50 focus-visible:ring-1 px-10 bg-background border-1",autoComplete:"off","aria-invalid":m.has(t.id)}),e("div",{className:"text-muted-foreground/80 absolute inset-y-0 start-0 flex items-center justify-center ps-3",children:e(o,{iconName:t.icon??"IconLink",size:16})}),e("div",{className:"absolute inset-y-0 end-0 flex items-center justify-center gap-1",children:s(G,{variant:"ghost",disabled:i[t.id]===c[t.id],onClick:()=>{let I={...t,slug:i[t.id]};N(I,M=>{M?d({...c,[t.id]:i[t.id]}):n(new Set(m).add(t.id))})},children:[e(o,{iconName:t.icon??"IconDeviceFloppy",size:16}),e("span",{className:"text-xs",children:"Save"})]})})]})},t.code)})})})]})]})},t.code)},q=({group:t,depth:a=0})=>{let{expandedGroups:u,toggleGroup:l}=h(),{title:i,description:d}=t?.group_data??{title:"N/A",description:"N/A"},c=u.has(t.id),n=b(i),m=b(d);return s("div",{children:[s("button",{onClick:()=>l(t.id),className:`w-full flex items-center p-3 rounded-lg dark:bg-[#101010] bg-accent hover:bg-accent/20 transition-colors ${n||m?"bg-accent/50":"bg-accent"}`,children:[c?e(o,{iconName:"IconChevronDown",className:"h-5 w-5"}):e(o,{iconName:"IconChevronRight",className:"h-5 w-5"}),e(o,{iconName:t.icon??"IconLink",className:"ml-2",fallback:e(D,{className:"w-5 h-5"})}),s("div",{className:"ml-2 text-left",children:[e("h4",{className:"font-semibold",children:n?e("span",{className:"dark:bg-gray-800 dark:text-white bg-gray-300",children:i}):i}),e("p",{className:"text-sm",children:m?e("span",{className:"dark:bg-gray-800 bg-gray-300 font-medium",children:d}):d})]})]}),c&&s("div",{className:"mt-2",children:[e("div",{className:"mb-2",style:{marginLeft:a*16},children:t.slugs?.map(r=>e(X,{slug:r},r.id))}),Array.isArray(t.childrens)&&t.childrens.length>0&&e("div",{className:"mt-2",style:{marginLeft:(a<1?1:a)*16},children:t.childrens.map(r=>e("div",{className:"mb-2",style:{marginLeft:a*16},children:e(q,{group:r,depth:a+1},r.id)}))}),Number(t.slugs?.length)<1&&Number(t.childrens?.length)<1&&e("div",{className:"text-sm text-muted-foreground mt-2 ml-4",children:"There is no slugs or child groups found."})]})]},t.code)},Q=({slugGroups:t})=>{let a=[{title:"Dashboard",href:route("dashboard")},{title:"Settings",href:route("dashboard.settings")},{title:"Slugs",href:route("dashboard.settings.slugs")}],{eminLang:u}=W().props;return s(L,{breadcrumbs:a,children:[e(U,{title:"Slugs"}),s("div",{className:"container mx-auto",children:[e(P,{title:"Slugs",description:"Here you can see and manage all the system slugs.",icon:e(o,{iconName:"IconLink",className:"h-10 w-10 my-2 opacity-75"})}),u?.multiLanguage&&s("div",{className:"flex items-center gap-4",children:[e(o,{iconName:"IconAlertTriangle",className:"h-10 w-10 my-2 text-red-500"}),s("div",{children:[e("h3",{className:"font-bold text-lg",children:"Dikkat!"}),e("span",{className:"text-muted-foreground",children:"Sisteminizde \xE7oklu dil eklentisi aktiftir. Bu sebeple buradaki link yap\u0131lar\u0131 \xE7oklu dil eklentisi aktif oldu\u011Fu s\xFCre boyunca \xE7al\u0131\u015Fmayacakt\u0131r."})]})]}),e(E,{slugGroups:t,onChange:(l,i)=>{T(l,d=>{d?(l.slug=l.slug,i?.(!0)):i?.(!1)})},children:e($,{})})]})]})};export{$ as a,X as b,q as c,Q as d,E as e,h as f};
@@ -1,2 +1,2 @@
1
- import{a as A,b as p}from"./chunk-OS5YYRGY.js";import{a as O,b as f,c as y,d as V,e as R,f as U}from"./chunk-X5PHT6XR.js";import{c as x,h as I}from"./chunk-AEPKG2NX.js";import{a as F}from"./chunk-WUFYLSW5.js";import{g as k}from"./chunk-HGOBNKGK.js";import{a as E}from"./chunk-QKGQOXDM.js";import{a as z}from"./chunk-3DBYUBWW.js";import{a as B,f as L,j as _}from"./chunk-QFUZ6MVT.js";import{b as d}from"./chunk-TVCWAJFT.js";import{a as b}from"./chunk-65LRDGYI.js";import{a as m}from"./chunk-G4EEZUTC.js";import{a as o}from"./chunk-GND5KQRZ.js";import{IconCircleCheckFilled as H,IconCircleX as W,IconDownload as re,IconRefresh as oe,IconStar as q,IconStarFilled as M,IconUsersGroup as ne,IconX as ie}from"@tabler/icons-react";import{Fragment as ce,jsx as n,jsxs as N}from"react/jsx-runtime";var fe=({packages:a,marketPackages:t,meta:c,account:r,error:i})=>n(F,{breadcrumbs:[{icon:"IconBuildingStore",title:"Marketplace"}],children:n(A,{packages:a,marketPackages:t,account:r??null,meta:c,error:i,children:N("div",{className:"grid gap-10",children:[n(T,{className:"mt-15 mb-25"}),n(te,{}),n($,{})]})})}),te=()=>{let{marketPackages:a}=p(),t=a?.filter(r=>r.code.startsWith("emintech")),c=a?.filter(r=>!r.code.startsWith("emintech"));return N(ce,{children:[t&&t?.length>0&&N("div",{className:"grid gap-7",children:[n(b,{title:"Official Packages",description:"Explore the Emin Tech's official packages.",icon:"IconStar",buttons:n(d,{variant:"link",children:"View All"})}),n("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-5",children:t.map(r=>n(C,{pkg:r}))})]}),c&&c.length>0&&N("div",{className:"grid gap-7",children:[n(b,{title:"Community Packages",description:"These community packages have been quality-checked and are fully compatible.",icon:"IconUsers",buttons:n(d,{variant:"link",children:"View All"})}),n("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-5",children:c.map(r=>n(C,{pkg:r}))})]})]})};import{useForm as le}from"@inertiajs/react";import{Fragment as G,jsx as e,jsxs as s}from"react/jsx-runtime";var T=({className:a})=>{let{meta:t}=p();return s("div",{className:o("grid gap-4",a),children:[e(m,{iconName:"IconPackages",className:"mx-auto h-15 w-15"}),s("div",{className:"grid text-center",children:[e("h2",{className:"text-2xl font-bold",children:"Search what do you need?"}),e("span",{className:"text-sm text-muted-foreground",children:"Search for packages by name or category."})]}),e(E,{placeholder:"Search package name, author, or category...",value:t?.search,className:"bg-accent/10"})]})},C=({pkg:a,className:t})=>{let{setSelectedPackage:c,setIsDetailModalOpen:r}=p(),{packages:i}=x(),g=i.find(h=>h.code===a.code)??null;return s(z,{className:o("p-2 bg-accent/10 w-full shadow-md hover:scale-105 duration-300",t),children:[s("div",{className:"grid gap-4 cursor-pointer",onClick:()=>{c(a),r(!0)},children:[e("div",{className:"w-full h-auto rounded-lg aspect-[4/3] shadow-sm",style:{backgroundImage:`url(${a.image})`,backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover"}}),s("div",{className:"grid px-2 gap-2",children:[s("div",{className:"flex items-center gap-1",children:[e(X,{pkg:a}),e(I,{pkg:{...a,is_custom:!1},className:"ml-auto text-sm",size:18})]}),e("hr",{}),s("span",{className:"text-sm text-muted-foreground truncate",children:[a.description," "]}),s("div",{className:"flex items-center",children:[g?s("div",{className:"flex items-center gap-2",children:[e(H,{className:"w-5 h-5 text-green-500 shrink-0"}),e("span",{className:"text-xs text-green-500",children:"Installed"})]}):e(K,{pkg:a,className:"text-xs"}),e(Y,{pkg:a,className:"text-xs ml-auto text-muted-foreground"})]})]})]}),e("div",{className:"px-2 mb-1",children:e(J,{pkg:a})})]})},$=()=>{let{isDetailModalOpen:a,setIsDetailModalOpen:t,selectedPackage:c}=p(),{packages:r}=x();if(!a||!c)return;let i=r.find(g=>g.code===c.code)??null;return e(B,{open:a,onOpenChange:t,children:s(L,{className:"min-h-[25vh] max-h-[80vh] min-w-[90vw] sm:min-w-[70vw] xl:min-w-[60vw] 2xl:min-w-[50vw] grid gap-5 overflow-y-auto",children:[e("div",{className:"",children:e("div",{className:"w-full h-auto rounded-lg aspect-[4/3] shadow-sm lg:aspect-[16/5]",style:{backgroundImage:`url(${c.cover??c.image})`,backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover"}})}),s("div",{className:"grid grid-cols-1 lg:grid-cols-[4fr_2fr] gap-5",children:[s("div",{className:"grid grid-cols-1 gap-2",children:[e(X,{pkg:c}),e(_,{children:c.description}),e(K,{pkg:c,className:"text-xs"})]}),s("div",{className:"grid gap-3",children:[e(j,{pkg:c,className:"text-sm text-muted-foreground hover:text-primary cursor-pointer"}),e(I,{pkg:{...c,is_custom:!1},className:"text-sm flex items-center gap-2",size:20}),e(de,{pkg:c,className:"text-sm text-muted-foreground"}),e(me,{pkg:c,className:"text-sm text-muted-foreground"}),s("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e(ne,{className:"w-5 h-5 shrink-0"}),e(Y,{pkg:c,className:"text-sm"})]})]}),s("div",{className:"col-span-full grid gap-2",children:[e(J,{pkg:c}),y(c,i)==="uninstall"&&e("div",{className:"col-span-full w-full grid gap-2",children:s("span",{className:"text-xs text-center text-muted-foreground",children:["You installed that at ",i?.created_at?new Date(i.created_at).toLocaleString():"N/A"]})})]})]})]})})},X=({pkg:a,className:t})=>s("div",{className:o("grid grid-cols-[25px_auto] gap-2",t),children:[e(m,{iconName:"IconPackage",className:"shrink-0 w-full"}),e("span",{className:"font-bold truncate",children:a.name})]}),Ue=({pkg:a,className:t})=>e("div",{className:o("grid gap-2",t),children:e(j,{pkg:a})}),K=({pkg:a,className:t})=>e("div",{className:o("flex items-center gap-2",t),children:U(a)?s(G,{children:[e(H,{className:"w-5 h-5 shrink-0 text-green-400"}),e("div",{className:"grid",children:e("span",{className:"text-green-400 truncate",children:"Compatible with your app"})})]}):s(G,{children:[e(W,{className:"w-5 h-5 shrink-0 text-red-400"}),e("div",{className:"grid",children:e("span",{className:"text-red-400 truncate",children:"Not compatible with your app"})})]})}),Y=({pkg:a,className:t})=>s("div",{className:o("flex items-center gap-2 shrink-0",t),children:[s("span",{className:"shrink-0",children:[Math.floor(Math.random()*1e3).toFixed(0)," Reviews"]}),s("div",{className:"flex items-center gap-0 shrink-0",children:[e(M,{className:"h-[18px] w-[18px] shrink-0 text-yellow-500"}),e(M,{className:"h-[18px] w-[18px] shrink-0 text-yellow-500"}),e(M,{className:"h-[18px] w-[18px] shrink-0 text-yellow-500"}),e(q,{className:"h-[18px] w-[18px] shrink-0"}),e(q,{className:"h-[18px] w-[18px] shrink-0"})]})]}),j=({pkg:a,className:t})=>s("div",{className:o("flex items-center gap-2",t),children:[e(m,{iconName:"IconUserCircle",className:"shrink-0 w-5 h-5"}),e("a",{href:O(a.author),className:"capitalize",children:a.author??"yok"})]}),me=({pkg:a,text:t="Last Update:",className:c})=>s("div",{className:o("flex items-center gap-2",c),children:[e(m,{iconName:"IconCalendar",className:"shrink-0 w-5 h-5"}),s("span",{children:[t,"\xA0",new Date(a.updated_at??"").toLocaleDateString()??"-"]})]}),de=({pkg:a,text:t="Core Requirement:",className:c})=>s("div",{className:o("flex items-center gap-2",c),children:[e(m,{iconName:"IconInfoCircle",className:"shrink-0 w-5 h-5"}),s("span",{children:[t,"\xA0",f(a)?.core_constraint??"-"]})]}),J=({pkg:a,className:t})=>{let{packages:c,setProcess:r,setPackageManifest:i,setIsLoading:g,setIsModalOpen:h,setValidationError:Q}=x(),Z=c.find(l=>l.code===a.code)??null,D=f(a),u=y(a,Z),{post:ee,setData:ae,recentlySuccessful:v,processing:P}=le(),se=()=>(g(!0),h(!0),new Promise(l=>ee(route("dashboard.packages.manager"),{onSuccess:()=>l(!0),onError:S=>{l(S),Q(Object.values(S).join(`
1
+ import{a as A,b as p}from"./chunk-VXSWY5HH.js";import{a as O,b as f,c as y,d as V,e as R,f as U}from"./chunk-X5PHT6XR.js";import{c as x,h as I}from"./chunk-PC75QMDC.js";import{a as F}from"./chunk-CN6NPPO6.js";import{g as k}from"./chunk-V6XQBO4L.js";import{a as B,f as L,j as _}from"./chunk-QFUZ6MVT.js";import{a as E}from"./chunk-QKGQOXDM.js";import{a as z}from"./chunk-3DBYUBWW.js";import{a as b}from"./chunk-65LRDGYI.js";import{b as d}from"./chunk-TVCWAJFT.js";import{a as m}from"./chunk-G4EEZUTC.js";import{a as o}from"./chunk-GND5KQRZ.js";import{IconCircleCheckFilled as H,IconCircleX as W,IconDownload as re,IconRefresh as oe,IconStar as q,IconStarFilled as M,IconUsersGroup as ne,IconX as ie}from"@tabler/icons-react";import{Fragment as ce,jsx as n,jsxs as N}from"react/jsx-runtime";var fe=({packages:a,marketPackages:t,meta:c,account:r,error:i})=>n(F,{breadcrumbs:[{icon:"IconBuildingStore",title:"Marketplace"}],children:n(A,{packages:a,marketPackages:t,account:r??null,meta:c,error:i,children:N("div",{className:"grid gap-10",children:[n(T,{className:"mt-15 mb-25"}),n(te,{}),n($,{})]})})}),te=()=>{let{marketPackages:a}=p(),t=a?.filter(r=>r.code.startsWith("emintech")),c=a?.filter(r=>!r.code.startsWith("emintech"));return N(ce,{children:[t&&t?.length>0&&N("div",{className:"grid gap-7",children:[n(b,{title:"Official Packages",description:"Explore the Emin Tech's official packages.",icon:"IconStar",buttons:n(d,{variant:"link",children:"View All"})}),n("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-5",children:t.map(r=>n(C,{pkg:r}))})]}),c&&c.length>0&&N("div",{className:"grid gap-7",children:[n(b,{title:"Community Packages",description:"These community packages have been quality-checked and are fully compatible.",icon:"IconUsers",buttons:n(d,{variant:"link",children:"View All"})}),n("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-5",children:c.map(r=>n(C,{pkg:r}))})]})]})};import{useForm as le}from"@inertiajs/react";import{Fragment as G,jsx as e,jsxs as s}from"react/jsx-runtime";var T=({className:a})=>{let{meta:t}=p();return s("div",{className:o("grid gap-4",a),children:[e(m,{iconName:"IconPackages",className:"mx-auto h-15 w-15"}),s("div",{className:"grid text-center",children:[e("h2",{className:"text-2xl font-bold",children:"Search what do you need?"}),e("span",{className:"text-sm text-muted-foreground",children:"Search for packages by name or category."})]}),e(E,{placeholder:"Search package name, author, or category...",value:t?.search,className:"bg-accent/10"})]})},C=({pkg:a,className:t})=>{let{setSelectedPackage:c,setIsDetailModalOpen:r}=p(),{packages:i}=x(),g=i.find(h=>h.code===a.code)??null;return s(z,{className:o("p-2 bg-accent/10 w-full shadow-md hover:scale-105 duration-300",t),children:[s("div",{className:"grid gap-4 cursor-pointer",onClick:()=>{c(a),r(!0)},children:[e("div",{className:"w-full h-auto rounded-lg aspect-[4/3] shadow-sm",style:{backgroundImage:`url(${a.image})`,backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover"}}),s("div",{className:"grid px-2 gap-2",children:[s("div",{className:"flex items-center gap-1",children:[e(X,{pkg:a}),e(I,{pkg:{...a,is_custom:!1},className:"ml-auto text-sm",size:18})]}),e("hr",{}),s("span",{className:"text-sm text-muted-foreground truncate",children:[a.description," "]}),s("div",{className:"flex items-center",children:[g?s("div",{className:"flex items-center gap-2",children:[e(H,{className:"w-5 h-5 text-green-500 shrink-0"}),e("span",{className:"text-xs text-green-500",children:"Installed"})]}):e(K,{pkg:a,className:"text-xs"}),e(Y,{pkg:a,className:"text-xs ml-auto text-muted-foreground"})]})]})]}),e("div",{className:"px-2 mb-1",children:e(J,{pkg:a})})]})},$=()=>{let{isDetailModalOpen:a,setIsDetailModalOpen:t,selectedPackage:c}=p(),{packages:r}=x();if(!a||!c)return;let i=r.find(g=>g.code===c.code)??null;return e(B,{open:a,onOpenChange:t,children:s(L,{className:"min-h-[25vh] max-h-[80vh] min-w-[90vw] sm:min-w-[70vw] xl:min-w-[60vw] 2xl:min-w-[50vw] grid gap-5 overflow-y-auto",children:[e("div",{className:"",children:e("div",{className:"w-full h-auto rounded-lg aspect-[4/3] shadow-sm lg:aspect-[16/5]",style:{backgroundImage:`url(${c.cover??c.image})`,backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover"}})}),s("div",{className:"grid grid-cols-1 lg:grid-cols-[4fr_2fr] gap-5",children:[s("div",{className:"grid grid-cols-1 gap-2",children:[e(X,{pkg:c}),e(_,{children:c.description}),e(K,{pkg:c,className:"text-xs"})]}),s("div",{className:"grid gap-3",children:[e(j,{pkg:c,className:"text-sm text-muted-foreground hover:text-primary cursor-pointer"}),e(I,{pkg:{...c,is_custom:!1},className:"text-sm flex items-center gap-2",size:20}),e(de,{pkg:c,className:"text-sm text-muted-foreground"}),e(me,{pkg:c,className:"text-sm text-muted-foreground"}),s("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e(ne,{className:"w-5 h-5 shrink-0"}),e(Y,{pkg:c,className:"text-sm"})]})]}),s("div",{className:"col-span-full grid gap-2",children:[e(J,{pkg:c}),y(c,i)==="uninstall"&&e("div",{className:"col-span-full w-full grid gap-2",children:s("span",{className:"text-xs text-center text-muted-foreground",children:["You installed that at ",i?.created_at?new Date(i.created_at).toLocaleString():"N/A"]})})]})]})]})})},X=({pkg:a,className:t})=>s("div",{className:o("grid grid-cols-[25px_auto] gap-2",t),children:[e(m,{iconName:"IconPackage",className:"shrink-0 w-full"}),e("span",{className:"font-bold truncate",children:a.name})]}),Ue=({pkg:a,className:t})=>e("div",{className:o("grid gap-2",t),children:e(j,{pkg:a})}),K=({pkg:a,className:t})=>e("div",{className:o("flex items-center gap-2",t),children:U(a)?s(G,{children:[e(H,{className:"w-5 h-5 shrink-0 text-green-400"}),e("div",{className:"grid",children:e("span",{className:"text-green-400 truncate",children:"Compatible with your app"})})]}):s(G,{children:[e(W,{className:"w-5 h-5 shrink-0 text-red-400"}),e("div",{className:"grid",children:e("span",{className:"text-red-400 truncate",children:"Not compatible with your app"})})]})}),Y=({pkg:a,className:t})=>s("div",{className:o("flex items-center gap-2 shrink-0",t),children:[s("span",{className:"shrink-0",children:[Math.floor(Math.random()*1e3).toFixed(0)," Reviews"]}),s("div",{className:"flex items-center gap-0 shrink-0",children:[e(M,{className:"h-[18px] w-[18px] shrink-0 text-yellow-500"}),e(M,{className:"h-[18px] w-[18px] shrink-0 text-yellow-500"}),e(M,{className:"h-[18px] w-[18px] shrink-0 text-yellow-500"}),e(q,{className:"h-[18px] w-[18px] shrink-0"}),e(q,{className:"h-[18px] w-[18px] shrink-0"})]})]}),j=({pkg:a,className:t})=>s("div",{className:o("flex items-center gap-2",t),children:[e(m,{iconName:"IconUserCircle",className:"shrink-0 w-5 h-5"}),e("a",{href:O(a.author),className:"capitalize",children:a.author??"yok"})]}),me=({pkg:a,text:t="Last Update:",className:c})=>s("div",{className:o("flex items-center gap-2",c),children:[e(m,{iconName:"IconCalendar",className:"shrink-0 w-5 h-5"}),s("span",{children:[t,"\xA0",new Date(a.updated_at??"").toLocaleDateString()??"-"]})]}),de=({pkg:a,text:t="Core Requirement:",className:c})=>s("div",{className:o("flex items-center gap-2",c),children:[e(m,{iconName:"IconInfoCircle",className:"shrink-0 w-5 h-5"}),s("span",{children:[t,"\xA0",f(a)?.core_constraint??"-"]})]}),J=({pkg:a,className:t})=>{let{packages:c,setProcess:r,setPackageManifest:i,setIsLoading:g,setIsModalOpen:h,setValidationError:Q}=x(),Z=c.find(l=>l.code===a.code)??null,D=f(a),u=y(a,Z),{post:ee,setData:ae,recentlySuccessful:v,processing:P}=le(),se=()=>(g(!0),h(!0),new Promise(l=>ee(route("dashboard.packages.manager"),{onSuccess:()=>l(!0),onError:S=>{l(S),Q(Object.values(S).join(`
2
2
  `))}}))),w=l=>{r(l),i(V(a,f(a).version)),ae({process:l,manifest:{code:a.code,version:D.version,core_constraint:D.core_constraint}}),se()};return u==="buy"?e("a",{href:R(a),target:"_blank",rel:"noopener noreferrer",children:s(d,{size:"sm",variant:"outline",className:o("col-span-full w-full flex items-center gap-2",t),children:[e(m,{iconName:a.price?"IconCreditCardPay":"IconMoodHappy",className:"shrink-0 w-5 h-5"}),e("span",{children:a.price?a.price+"$":"Get It Free"})]})}):u==="install"?s(k,{size:"sm",variant:"outline",className:o("col-span-full w-full flex items-center gap-2",t),onClick:()=>w("install"),recentlySuccessful:v,processing:P,children:[e(re,{className:"shrink-0 w-5 h-5"}),e("span",{children:"Install"})]}):u=="uninstall"?s(k,{size:"sm",variant:"destructive",className:o("col-span-full w-full flex items-center gap-2",t),onClick:()=>w("uninstall"),recentlySuccessful:v,processing:P,children:[e(ie,{className:"w-5 h-5 shrink-0"}),e("span",{children:"Uninstall"})]}):u=="update"?s(k,{size:"sm",variant:"outline",className:o("col-span-full w-full flex items-center gap-2",t),onClick:()=>w("update"),recentlySuccessful:v,processing:P,children:[e(oe,{className:"w-5 h-5 shrink-0"}),e("span",{children:"Update"})]}):s(d,{size:"sm",variant:"outline",className:o("col-span-full w-full flex items-center gap-2",t),disabled:!0,children:[e(W,{className:"w-5 h-5 shrink-0 text-red-400"}),e("span",{children:"Not Compatible with your core version"})]})};export{T as a,C as b,$ as c,X as d,Ue as e,K as f,Y as g,j as h,me as i,de as j,J as k,fe as l,te as m};
@@ -1 +1 @@
1
- import{B as o,ga as t}from"./chunk-HGOBNKGK.js";import{Head as e}from"@inertiajs/react";import{jsx as c,jsxs as i}from"react/jsx-runtime";var f=()=>i(o,{children:[c(e,{title:"Account Settings"}),c(t,{})]});export{f as a};
1
+ import{B as o,ga as t}from"./chunk-V6XQBO4L.js";import{Head as e}from"@inertiajs/react";import{jsx as c,jsxs as i}from"react/jsx-runtime";var f=()=>i(o,{children:[c(e,{title:"Account Settings"}),c(t,{})]});export{f as a};
@@ -1 +1 @@
1
- import{i as t,ia as n,xa as m}from"./chunk-HGOBNKGK.js";import{a as i}from"./chunk-E2ZUBHVJ.js";import{d as o}from"./chunk-PWQOU5TI.js";import{a as r}from"./chunk-CZM7FKLS.js";import{a as s}from"./chunk-3H6NZAII.js";import{usePage as a}from"@inertiajs/react";import{jsx as e,jsxs as c}from"react/jsx-runtime";var y=({breadcrumbs:p=[]})=>{let d=a().props,{dashboard:l}=a().props?.emin_core_menus,{url:h}=a(),{user:u,notifications:f,unread_notifications:b}=d.auth;return e("header",{className:"flex h-(--header-height) shrink-0 items-center gap-2 border-b transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-(--header-height)",children:c("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[e(o,{className:"-ml-1"}),e(r,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),e(s,{breadcrumbs:p,className:"hidden md:flex"}),c("div",{className:"ml-auto flex items-center gap-2",children:[u&&e(n,{notifications:f??[],unreadNotifications:b??0}),e(m,{placeholder:"Type a command or search...",menu:i(l,h)}),e(t,{className:"w-8 h-8"})]})]})})};export{y as a};
1
+ import{i as t,ia as n,xa as m}from"./chunk-V6XQBO4L.js";import{a as i}from"./chunk-E2ZUBHVJ.js";import{d as o}from"./chunk-SZBMRQZB.js";import{a as r}from"./chunk-CZM7FKLS.js";import{a as s}from"./chunk-3H6NZAII.js";import{usePage as a}from"@inertiajs/react";import{jsx as e,jsxs as c}from"react/jsx-runtime";var y=({breadcrumbs:p=[]})=>{let d=a().props,{dashboard:l}=a().props?.emin_core_menus,{url:h}=a(),{user:u,notifications:f,unread_notifications:b}=d.auth;return e("header",{className:"flex h-(--header-height) shrink-0 items-center gap-2 border-b transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-(--header-height)",children:c("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[e(o,{className:"-ml-1"}),e(r,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),e(s,{breadcrumbs:p,className:"hidden md:flex"}),c("div",{className:"ml-auto flex items-center gap-2",children:[u&&e(n,{notifications:f??[],unreadNotifications:b??0}),e(m,{placeholder:"Type a command or search...",menu:i(l,h)}),e(t,{className:"w-8 h-8"})]})]})})};export{y as a};
@@ -1 +1 @@
1
- import{a as w,b as A,c as R,d as F}from"./chunk-SNPTKUE5.js";import{b as k}from"./chunk-AEPKG2NX.js";import{a as S}from"./chunk-KND3PUAR.js";import{a as _}from"./chunk-4DHRTWA7.js";import{a as E}from"./chunk-WUFYLSW5.js";import{g as x}from"./chunk-HGOBNKGK.js";import{a as N,b as C,f as v,g as h,i as D,j as b}from"./chunk-QFUZ6MVT.js";import{b as P}from"./chunk-TVCWAJFT.js";import{a}from"./chunk-G4EEZUTC.js";import{a as I}from"./chunk-QKP3C5FM.js";import{useState as G}from"react";import{useForm as q,usePage as W}from"@inertiajs/react";import{IconAlertCircle as L}from"@tabler/icons-react";import{Fragment as g,jsx as n,jsxs as M}from"react/jsx-runtime";var B=t=>[{step:M(g,{children:["Log in to ",n("strong",{children:"emincore.io"})]})},{step:M(g,{children:["Select the application for ",n("strong",{children:t.app.url})]})},{step:n(g,{children:"Generate or regenerate an API Secret key and fill it in the form below."})},{step:n(g,{children:"Submit and complete the connection process."})}],U=t=>{switch(t){case"invalid_api_secret":return{icon:n(L,{className:"text-red-500 mx-auto h-15 w-15"}),title:"Invalid API Secret Key",message:"Please check your API Secret key to access all ecosystem features.",content:n(f,{})};case"get_api_secret":return{icon:"IconPackages",title:"Connect to EminCore Platform",message:"Connect your application to the EminCore platform with your API Secret key to access all ecosystem features.",content:n(f,{})};case"403":return{icon:"IconBan",title:"403 Forbidden",message:"You do not have permission to access this resource."};default:return null}};import{Head as K}from"@inertiajs/react";import{Fragment as z,jsx as r,jsxs as y}from"react/jsx-runtime";var ne=({packages:t,requirements:s,account:i,error:l})=>{let m=[{title:"WM Dashboard",href:route("dashboard")},{title:"Platform"}],d=t.find(u=>u.code==I);return y(z,{children:[r(K,{title:"Platform"}),r(E,{breadcrumbs:m,children:r(k,{packages:t,children:y("div",{className:"container mx-auto",children:[r(S,{title:"Platform",description:"Platform overview",icon:r(a,{iconName:"IconCloudCog"})}),y("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6",children:[r(w,{account:i}),r(A,{eminCore:d}),r(R,{requirements:s}),r(F,{})]})]})})})]})};import{toast as Y}from"sonner";import{jsx as e,jsxs as o}from"react/jsx-runtime";var be=({icon:t,title:s,message:i,content:l,className:m})=>o("div",{className:`grid gap-4 mt-15 mb-25 ${m}`,children:[t&&(typeof t=="string"?e(a,{iconName:t,className:"mx-auto h-15 w-15"}):t),o("div",{className:"grid gap-2 text-center",children:[e("h2",{className:"text-2xl font-bold",children:s}),e("span",{className:"text-sm text-muted-foreground",children:i}),l]})]}),f=()=>{let[t,s]=G(!1),i=W().props,{data:l,setData:m,post:d,processing:u,recentlySuccessful:T,errors:O}=q({api_secret_key:""});return o(N,{open:t,onOpenChange:s,children:[e(C,{children:o(P,{variant:"default",size:"sm",className:"mt-2",children:[e(a,{iconName:"IconPlug"}),e("span",{children:"Connect"})]})}),o(v,{children:[o(h,{children:[o(D,{className:"grid text-center mx-auto gap-2",children:[e(a,{iconName:"IconPlug",className:"mx-auto h-10 w-10"}),e("span",{children:"Connect to EminCore Platform"})]}),e(b,{className:"text-center",children:"Please follow the steps below to get an API Secret key and connect your application to the EminCore platform."})]}),e("div",{className:"grid gap-3",children:o("form",{onSubmit:c=>{c.preventDefault();let p=new Promise(H=>d(route("dashboard.settings.platform.connect"),{onFinish:H}));Y.promise(p,{loading:"Connecting to EminCore Platform..."})},children:[e("div",{className:"grid gap-4 text-left max-w-md mx-auto text-center justify-center border-y py-4 my-4",children:B(i).map((c,p)=>o("div",{className:"grid text-center gap-3",children:[e("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary/10 text-primary flex items-center justify-center text-xs font-bold mx-auto",children:p+1}),e("span",{className:"text-sm text-muted-foreground",children:c.step})]},p))}),o("div",{className:"grid gap-4 text-center",children:[e(_,{placeholder:"Enter your API secret key",icon:"IconKey",value:l.api_secret_key,onChange:c=>m({api_secret_key:c.target.value}),error:O.api_secret_key}),o(x,{recentlySuccessful:T,processing:u,variant:"default",size:"sm",className:"mt-2",children:[e(a,{iconName:"IconPlug"}),e("span",{children:"Connect"})]})]})]})})]})]})};export{be as a,f as b,B as c,U as d,ne as e};
1
+ import{a as w,b as A,c as R,d as F}from"./chunk-5LFO6VRS.js";import{b as k}from"./chunk-PC75QMDC.js";import{a as _}from"./chunk-QZ7BICYJ.js";import{a as S}from"./chunk-KND3PUAR.js";import{a as E}from"./chunk-CN6NPPO6.js";import{g as x}from"./chunk-V6XQBO4L.js";import{a as N,b as C,f as v,g as h,i as D,j as b}from"./chunk-QFUZ6MVT.js";import{b as P}from"./chunk-TVCWAJFT.js";import{a}from"./chunk-G4EEZUTC.js";import{a as I}from"./chunk-QKP3C5FM.js";import{useState as G}from"react";import{useForm as q,usePage as W}from"@inertiajs/react";import{IconAlertCircle as L}from"@tabler/icons-react";import{Fragment as g,jsx as n,jsxs as M}from"react/jsx-runtime";var B=t=>[{step:M(g,{children:["Log in to ",n("strong",{children:"emincore.io"})]})},{step:M(g,{children:["Select the application for ",n("strong",{children:t.app.url})]})},{step:n(g,{children:"Generate or regenerate an API Secret key and fill it in the form below."})},{step:n(g,{children:"Submit and complete the connection process."})}],U=t=>{switch(t){case"invalid_api_secret":return{icon:n(L,{className:"text-red-500 mx-auto h-15 w-15"}),title:"Invalid API Secret Key",message:"Please check your API Secret key to access all ecosystem features.",content:n(f,{})};case"get_api_secret":return{icon:"IconPackages",title:"Connect to EminCore Platform",message:"Connect your application to the EminCore platform with your API Secret key to access all ecosystem features.",content:n(f,{})};case"403":return{icon:"IconBan",title:"403 Forbidden",message:"You do not have permission to access this resource."};default:return null}};import{Head as K}from"@inertiajs/react";import{Fragment as z,jsx as r,jsxs as y}from"react/jsx-runtime";var ne=({packages:t,requirements:s,account:i,error:l})=>{let m=[{title:"WM Dashboard",href:route("dashboard")},{title:"Platform"}],d=t.find(u=>u.code==I);return y(z,{children:[r(K,{title:"Platform"}),r(E,{breadcrumbs:m,children:r(k,{packages:t,children:y("div",{className:"container mx-auto",children:[r(S,{title:"Platform",description:"Platform overview",icon:r(a,{iconName:"IconCloudCog"})}),y("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6",children:[r(w,{account:i}),r(A,{eminCore:d}),r(R,{requirements:s}),r(F,{})]})]})})})]})};import{toast as Y}from"sonner";import{jsx as e,jsxs as o}from"react/jsx-runtime";var be=({icon:t,title:s,message:i,content:l,className:m})=>o("div",{className:`grid gap-4 mt-15 mb-25 ${m}`,children:[t&&(typeof t=="string"?e(a,{iconName:t,className:"mx-auto h-15 w-15"}):t),o("div",{className:"grid gap-2 text-center",children:[e("h2",{className:"text-2xl font-bold",children:s}),e("span",{className:"text-sm text-muted-foreground",children:i}),l]})]}),f=()=>{let[t,s]=G(!1),i=W().props,{data:l,setData:m,post:d,processing:u,recentlySuccessful:T,errors:O}=q({api_secret_key:""});return o(N,{open:t,onOpenChange:s,children:[e(C,{children:o(P,{variant:"default",size:"sm",className:"mt-2",children:[e(a,{iconName:"IconPlug"}),e("span",{children:"Connect"})]})}),o(v,{children:[o(h,{children:[o(D,{className:"grid text-center mx-auto gap-2",children:[e(a,{iconName:"IconPlug",className:"mx-auto h-10 w-10"}),e("span",{children:"Connect to EminCore Platform"})]}),e(b,{className:"text-center",children:"Please follow the steps below to get an API Secret key and connect your application to the EminCore platform."})]}),e("div",{className:"grid gap-3",children:o("form",{onSubmit:c=>{c.preventDefault();let p=new Promise(H=>d(route("dashboard.settings.platform.connect"),{onFinish:H}));Y.promise(p,{loading:"Connecting to EminCore Platform..."})},children:[e("div",{className:"grid gap-4 text-left max-w-md mx-auto text-center justify-center border-y py-4 my-4",children:B(i).map((c,p)=>o("div",{className:"grid text-center gap-3",children:[e("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary/10 text-primary flex items-center justify-center text-xs font-bold mx-auto",children:p+1}),e("span",{className:"text-sm text-muted-foreground",children:c.step})]},p))}),o("div",{className:"grid gap-4 text-center",children:[e(_,{placeholder:"Enter your API secret key",icon:"IconKey",value:l.api_secret_key,onChange:c=>m({api_secret_key:c.target.value}),error:O.api_secret_key}),o(x,{recentlySuccessful:T,processing:u,variant:"default",size:"sm",className:"mt-2",children:[e(a,{iconName:"IconPlug"}),e("span",{children:"Connect"})]})]})]})})]})]})};export{be as a,f as b,B as c,U as d,ne as e};
@@ -1,3 +1,3 @@
1
- import{a as Ne}from"./chunk-SC5FEULM.js";import{a as be}from"./chunk-AG4EHKB7.js";import{a as xe}from"./chunk-6Q54CGSV.js";import{a as K}from"./chunk-Z6APYDZ7.js";import{a as he}from"./chunk-KND3PUAR.js";import{a as ke}from"./chunk-WUFYLSW5.js";import{a as Pe}from"./chunk-D5ORVBB6.js";import{a as ve}from"./chunk-L37X7O6L.js";import{Ca as ue,Ea as fe,b as q,g as pe}from"./chunk-HGOBNKGK.js";import{a as me}from"./chunk-7NKFSFMC.js";import{a as te}from"./chunk-M5QT5SFN.js";import{a as W,f as j,g as J,h as ge,i as T,j as F}from"./chunk-QFUZ6MVT.js";import{b as y}from"./chunk-TVCWAJFT.js";import{a as L,c as R,d as z}from"./chunk-PRCYNFKC.js";import{a as r}from"./chunk-G4EEZUTC.js";import{a as $}from"./chunk-G22OJQWL.js";import{a as ae}from"./chunk-GND5KQRZ.js";import{createContext as Je,useContext as Ke,useEffect as oe,useState as D}from"react";import{jsx as Ye,jsxs as Ge}from"react/jsx-runtime";var Ce=Je({}),we=({children:e,packages:a,process:t="install",step:o=1,isValid:c=!1,is_custom:l=!1})=>{let u={title:"Loading",description:"Please wait while we process your request."},[v,i]=D(a),[k,m]=D(t),[g,P]=D(!1),[f,S]=D(o),[s,x]=D(null),[b,C]=D(null),[I,B]=D(c),[Z,ce]=D(""),[qe,le]=D(!1),[We,X]=D(u),ee=Pe();oe(()=>{g||setTimeout(()=>{S(1),m(t),x(null),C(null),B(!1),le(!1),ce(""),X(u)},250)},[g]),oe(()=>{!b||!ee||Object.values(ee).forEach(U=>{U?.jobCode===`${b.code}_${k}`&&X({title:U.title,description:U.description,progress:U.progress,error:U.status==="failed"})})},[ee]),oe(()=>{i(a)},[a]);let de=()=>b?.is_custom===!1,je={packages:v,setPackages:i,process:k,setProcess:m,isModalOpen:g,setIsModalOpen:P,step:f,setStep:S,selectedFile:s,setSelectedFile:x,packageManifest:b,setPackageManifest:C,isValid:I,setIsValid:B,validationError:Z,setValidationError:ce,isLoading:qe,setIsLoading:le,loadingContent:We,setLoadingContent:X,isOfficial:de,isCustom:()=>!de()};return Ge(Ce.Provider,{value:je,children:[e,Ye(ye,{})]})},h=()=>{let e=Ke(Ce);if(!e)throw new Error("PackageManagerContext must be used within a PackageManagerProvider");return e};import{Fragment as Me,jsx as w,jsxs as Y}from"react/jsx-runtime";var Ie=e=>{let{loadingContent:a,validationError:t}=h(),o={title:a.title,description:a.description,content:Y(Me,{children:[w("div",{className:"animate-spin rounded-full h-15 w-15 border-b-2 border-primary mx-auto"}),Y("div",{className:"text-center",children:[w(T,{className:"text-base text-lg",children:a.title}),w(F,{className:"text-sm",children:a.description}),a.progress&&Y(Me,{children:[w(ve,{value:a.progress,className:"my-2"}),"%",a.progress]}),a.error&&w(F,{className:"text-red-500 text-sm",children:a.error})]})]})},c={title:null,description:null,content:Y("div",{className:"grid gap-2 justify-center text-center animate-in fade-in duration-500",children:[w(r,{iconName:"IconExclamationCircleFilled",className:"text-red-500 h-15 w-15 mx-auto"}),w("span",{className:"text-2xl font-bold",children:"Error"}),w("span",{className:"text-sm text-muted-foreground",children:t})]})};if(t)return c;if(e=="loading")return o;let l=Ee(),u=Se(),[v,i,k]=e.split("-"),m=v,g=i,P=Number(k);return{custom:{install:{1:l.selectInstallationMethod,2:l.uploadPackageZipFile,3:l.customInstallSummary()},update:{1:l.uploadPackageZipFile,2:u.updateSummary()}},market:{update:{1:u.updateSummary()}}}[m]?.[g]?.[P]??l.selectInstallationMethod},De=e=>[{key:"code",value:w("span",{className:"",children:e.code??"\u2014"})},{key:"version",value:w("span",{children:e?.version??"\u2014"})},{key:"author",value:w("span",{children:e?.author??"\u2014"})},{key:"source",value:w("span",{className:"text-orange-400",children:"Custom"})}];import{unzip as Qe}from"fflate";import{toast as Xe}from"sonner";var ea=e=>new Promise((a,t)=>{Qe(e,(o,c)=>{if(o)return t(new Error("ZIP file is corrupted"));a(c)})}),Ve=async e=>{let{process:a,selectedFile:t,setIsLoading:o,step:c,setStep:l,setPackageManifest:u,setValidationError:v,setIsValid:i,packages:k,setLoadingContent:m}=e;try{if(!t)throw new Error("Please select a file.");if(o(!0),m({title:"Package Verifying",description:"Please wait while we verify the package."}),t.size>100*1024*1024)throw new Error("File should be less than 100MB");let g=new Uint8Array(await t.arrayBuffer()),P=await ea(g);if(!P["emincore.json"])throw new Error("Manifest (emincore.json) has not been found in the ZIP file.");let f=JSON.parse(new TextDecoder().decode(P["emincore.json"]));u(f);let s=["code","name","version","description","author","core_constraint"].filter(C=>f[C]==null||f[C]==="");if(s.length)throw new Error("Manifest is missing required fields: "+s.join(", "));let x=f.composer_package&&f.composer_package_version,b=f.npm_package&&f.npm_package_version;if(!x&&!b)throw new Error("Package must has at least one of composer package or npm package.");if(a=="update"){let C=be(k.find(I=>I.code==f?.code),f);if(typeof C=="string")throw new Error(C)}i(!0)}catch(g){throw Xe.error(String(g)),v(String(g)),i(!1),g}finally{l(c+1),o(!1)}};import{router as ga,useForm as ua}from"@inertiajs/react";import{useState as aa,useEffect as ta}from"react";import{Fragment as se,jsx as d,jsxs as V}from"react/jsx-runtime";var ne=({pkg:e,showBadge:a=!0,showBadgeTitle:t=!0,className:o})=>V("div",{className:ae("flex items-center gap-1",o),children:[d("span",{className:"font-medium",children:e?.name||e?.code}),a&&d(oa,{pkg:e,showBadgeTitle:t})]}),oa=({pkg:e,showBadgeTitle:a=!0,className:t,size:o=18})=>d("div",{className:ae("flex items-center gap-1",t),children:e?.is_custom===!1?e.code.slice(0,8)==="emintech"?V(se,{children:[d(r,{iconName:"IconCertificate",className:"text-cyan-600 dark:text-cyan-400",size:o}),a&&d("span",{className:"font-medium text-cyan-600 dark:text-cyan-400",children:"Official"})]}):V(se,{children:[d(r,{iconName:"IconRosetteDiscountCheckFilled",className:"text-emerald-600 dark:text-emerald-400",size:o}),a&&d("span",{className:"font-medium text-emerald-600 dark:text-emerald-400",children:"Verified"})]}):V(se,{children:[d(r,{iconName:"IconInfoCircleFilled",className:"text-slate-500 dark:text-slate-400",size:o}),a&&d("span",{className:"font-medium text-slate-500 dark:text-slate-400",children:"Unverified"})]})}),at=({statistics:e})=>{let[a,t]=aa(e);ta(()=>{t(e)},[e]);let o=[{title:"Total Packages",subtext:"Total packages counts",value:String(a.total_packages),icon:d(r,{iconName:"IconFilter",className:"h-4 w-4 text-muted-foreground"})},{title:"Enabled Packages",subtext:"Enabled packages counts",value:String(a.enabled_packages),icon:d(r,{iconName:"IconFilter",className:"h-4 w-4 text-muted-foreground"})},{title:"Disabled Packages",subtext:"Disabled packages counts",value:String(a.disabled_packages),icon:d(r,{iconName:"IconFilter",className:"h-4 w-4 text-muted-foreground"})},{title:"Need Update",subtext:"Packages need update counts",value:String(a?.need_update_packages),icon:d(r,{iconName:"IconFilter",className:"h-4 w-4 text-muted-foreground"})}];return d("div",{className:"grid grid-cols-1 md:grid-cols-4 lg:grid-cols-4 gap-6 mb-8",children:o.map(c=>d(ue,{...c},c.title?.toString()))})},A=({pkg:e,details:a})=>{let t=a??Fe(e);return V("div",{className:"space-y-4",children:[V("div",{className:e?.image?"grid gap-3":"flex items-center gap-3",children:[e?.image?d("div",{className:"w-full h-auto rounded-lg aspect-[16/9] shadow-sm",style:{backgroundImage:`url(${e.image})`,backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover"}}):d(r,{iconName:"IconPackage",className:"h-7 w-7 text-muted-foreground shrink-0"}),V(J,{children:[d(T,{className:"text-base",children:e?.name?d(ne,{pkg:e}):e.code}),d(F,{className:"text-xs",children:e?.description??"No description"})]})]}),d("hr",{}),d("div",{className:"space-y-3 text-sm",children:t.map(o=>V("div",{className:"flex justify-between",children:[d("span",{className:"text-muted-foreground capitalize",children:o.key}),o.value]},o.key))})]})},_e=({isModalOpen:e,setIsModalOpen:a,package:t,details:o})=>d(W,{open:e,onOpenChange:a,children:d(j,{className:"sm:max-w-md",children:d(A,{pkg:t,details:o})})});import{Fragment as sa,jsx as G,jsxs as Te}from"react/jsx-runtime";var Ae=()=>{let{packages:e,selectedPackage:a,isDetailsModalOpen:t,setIsDetailsModalOpen:o}=Q(),{setIsModalOpen:c,setProcess:l,setStep:u}=h(),v=Be(),i=Oe();return Te(sa,{children:[Te(y,{size:"sm",variant:"outline",className:"mb-4 flex items-center gap-2",onClick:()=>{c(!0),l("install"),u(1)},children:[G(r,{iconName:"IconUpload"}),G("span",{children:"Install Package"})]}),G(fe,{columns:i,data:e,bulkActions:v}),a&&G(_e,{isModalOpen:t,setIsModalOpen:o,package:a})]})};import{router as na,useHttp as ra}from"@inertiajs/react";import{useEffect as ia,useState as ca}from"react";import{toast as Ue}from"sonner";import{Fragment as Le,jsx as n,jsxs as E}from"react/jsx-runtime";var Oe=()=>{let[e,a]=ca(!0);ia(()=>{a(!1);let s=setTimeout(()=>a(!0),50);return()=>clearTimeout(s)},[]);let{setSelectedPackage:t,setIsDetailsModalOpen:o}=Q(),{setPackageManifest:c,setProcess:l,setIsModalOpen:u,setStep:v,setIsLoading:i,setLoadingContent:k,setValidationError:m}=h(),{selectVersion:g,SelectionModal:P}=xe(),f=ra(),S=s=>{if(c(s),l("update"),u(!0),!s.is_custom){i(!0),k({title:"Checking Package Updates",description:"Please wait while we check the latest updates for this package."});let x=async b=>{let{latest:C,latest_compatible:I}=b;C.version!==I.version?await g(b).then(Z=>Z!==null?c({...Z,is_custom:!1}):u(!1)):c({...I,is_custom:!1}),v(1)};Ne(f,s.id).then(b=>x(b)).catch(()=>m("Failed to check updates for this package.")).finally(()=>i(!1))}};return[{id:"select",header:({table:s})=>n(te,{checked:s.getIsAllPageRowsSelected()||s.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:x=>s.toggleAllPageRowsSelected(!!x),"aria-label":"T\xFCm\xFCn\xFC se\xE7"}),cell:({row:s})=>n(te,{id:`select-row-${s.id}`,checked:s.getIsSelected(),onCheckedChange:x=>{s.toggleSelected(!!x)},"aria-label":"Sat\u0131r se\xE7"}),enableSorting:!1,enableHiding:!1},{accessorKey:"package",header:"Package",cell:({row:s})=>E("div",{className:"flex items-center gap-5 cursor-pointer",onClick:()=>{t(s.original),o(!0)},children:[n($,{className:"my-2 h-5 w-10",style:{display:e?"none":"block"}}),E("span",{style:{display:e?"flex":"none"},className:"items-center gap-3",children:[n(r,{iconName:"IconPackage",className:"h-7 my-2 cursor-pointer"}),E("div",{className:"flex flex-col",children:[n("div",{className:"flex items-center gap-1",children:n(ne,{pkg:s.original})}),n("span",{className:"text-muted-foreground text-xs",children:s.original.description?s.original.description.length>61?s.original?.description?.slice(0,60)+"...":s.original?.description:"No description"}),n("span",{className:"text-muted-foreground text-xs",children:s.original?.version})]})]})]})},{accessorKey:"is_active",header:()=>E(L,{trigger:"hover",children:[n(R,{children:"Status"}),n(z,{className:"w-auto",children:"Is the package enabled?"})]}),cell:({row:s})=>E(Le,{children:[n($,{className:"my-2 h-5 w-10",style:{display:e?"none":"block"}}),n("div",{style:{display:e?"block":"none"},children:n(me,{checked:s.original.is_active,onCheckedChange:x=>{K([s.original.id],{is_active:x})}})})]})},{accessorKey:"actions",header:()=>E(L,{trigger:"hover",children:[n(R,{children:"Actions"}),n(z,{className:"w-auto",children:"Actions of the package"})]}),cell:({row:s})=>E(Le,{children:[n($,{className:"my-2 h-5 w-10",style:{display:e?"none":"block"}}),E("div",{style:{display:e?"flex":"none"},className:"gap-2",children:[E(L,{trigger:"hover",children:[n(R,{children:n(q,{title:"Uninstall Package",content:"Are you sure to uninstall this package?",onConfirm:()=>{na.post(route("dashboard.packages.manager"),{process:"uninstall",manifest:{code:s.original.code}})},children:n(y,{variant:"outline",size:"sm",className:"flex items-center",disabled:s.original.is_active,children:n(r,{iconName:"IconTrash",className:"h-4 w-4"})})})}),n(z,{children:s.original.is_active?"Disable Package First":"Uninstall Package"})]}),E(L,{trigger:"hover",children:[n(R,{children:n(y,{variant:"outline",size:"sm",className:"flex items-center",onClick:()=>S(s.original),children:n(r,{iconName:"IconRefresh",className:"h-4 w-4"})})}),n(z,{children:s.original.is_custom?"Update Package":"Check Updates"})]}),n(P,{})]})]})}]},Be=()=>[{label:"Enable",icon:n(r,{iconName:"IconCheck",className:"h-4 w-4 mr-1"}),variant:"outline",confirm:!0,confirmTitle:"Enable Packages",confirmContent:"Are you sure to enable these packages?",confirmIcon:n(r,{iconName:"IconCheck",size:30}),cancel:()=>{Ue.info("Process cancelled")},action:(e,a)=>{let t=e.map(o=>o.original.id);K(t,{is_active:!0},o=>o&&a&&a())}},{label:"Disable",icon:n(r,{iconName:"IconCreativeCommonsNd",className:"h-4 w-4 mr-1"}),variant:"destructive",confirm:!0,confirmTitle:"Disable Packages",confirmContent:"Are you sure to disable these packages?",confirmIcon:n(r,{iconName:"IconCreativeCommonsNd",size:30}),cancel:()=>{Ue.info("Process cancelled")},action:(e,a)=>{let t=e.map(o=>o.original.id);K(t,{is_active:!1},o=>{o&&a&&a()})}}],Fe=e=>[{key:"code",value:n("span",{className:"",children:e.code??"\u2014"})},{key:"version",value:n("span",{children:e?.version??"\u2014"})},{key:"author",value:n("span",{children:e?.author??"\u2014"})},{key:"source",value:n("span",{className:e?.is_custom!==!1?"text-orange-400":"text-green-600",children:e?.is_custom!==!1?"Custom":"Marketplace"})},{key:"status",value:n("span",{className:e?.is_active?"text-green-600":"text-destructive",children:e?.is_active?"Enabled":"Disabled"})},{key:"installed at",value:n("span",{children:e?.created_at?new Date(e.created_at).toLocaleDateString():"\u2014"})},{key:"last updated at",value:n("span",{children:e?.updated_at?new Date(e.updated_at).toLocaleDateString():"\u2014"})}];import{createContext as la,useContext as da,useEffect as ma,useState as re}from"react";import{jsx as Re}from"react/jsx-runtime";var ze=la({}),He=({packages:e,children:a})=>{let[t,o]=re(e),[c,l]=re(null),[u,v]=re(!1);ma(()=>{o(e)},[e]);let i={packages:t,setPackages:o,selectedPackage:c,setSelectedPackage:l,isDetailsModalOpen:u,setIsDetailsModalOpen:v};return Re(we,{packages:t,children:Re(ze.Provider,{value:i,children:a})})},Q=()=>{let e=da(ze);if(!e)throw new Error("usePackagesContext must be used within a PackagesProvider");return e};import{Head as pa}from"@inertiajs/react";import{jsx as H,jsxs as Ze}from"react/jsx-runtime";var Bt=({packages:e})=>{let a=[{title:"WM Dashboard",href:route("dashboard")},{title:"Packages",href:"#"}];return Ze(ke,{breadcrumbs:a,children:[H(pa,{title:"Packages"}),Ze("div",{className:"container mx-auto",children:[H(he,{title:"Packages",description:"Here you can see and manage all the system packages.",icon:H(r,{iconName:"IconLink",className:"h-10 w-10 my-2 opacity-75"})}),H(He,{packages:e,children:H(Ae,{})})]})]})};import{Fragment as $e,jsx as p,jsxs as N}from"react/jsx-runtime";var Ee=()=>{let{process:e,setStep:a,selectedFile:t,setSelectedFile:o,isValid:c,packageManifest:l,validationError:u}=h(),v=h();return{selectInstallationMethod:{title:"Select Installation Method",description:"Choose whether to install the package from a file or a URL.",content:N("div",{className:"grid grid-cols-2 gap-2",children:[N("div",{className:"border-2 rounded-lg p-6 text-center cursor-pointer hover:border-gray-400 transition-colors",onClick:()=>a(2),children:[p(r,{iconName:"IconUpload",className:"h-12 w-12 mx-auto mb-3"}),p("h3",{className:"font-semibold mb-1",children:"Manual Upload"}),p("p",{className:"text-sm",children:"Upload your custom package file"})]}),N("div",{className:"border-2 rounded-lg p-6 text-center cursor-pointer hover:border-gray-400 transition-colors",onClick:()=>ga.get(route("dashboard.packages.marketplace")),children:[p(r,{iconName:"IconShoppingBag",className:"h-12 w-12 mx-auto mb-3"}),p("h3",{className:"font-semibold mb-1",children:"Marketplace"}),p("p",{className:"text-sm",children:"Browse and install from marketplace"})]})]})},uploadPackageZipFile:{title:t?"Verify Package File":"Upload Package File",description:t?"Verify the package file to ensure it is valid.":"Upload your custom package file (.zip)",content:N("div",{className:"grid grid-cols-1 gap-2",children:[N("div",{className:"border-2 rounded-lg p-6 text-center cursor-pointer border-dashed "+(t?"border-gray-400 text-primary":"text-muted-foreground hover:border-gray-400 hover:text-primary transition-colors"),onDrop:i=>{i.preventDefault();let k=i.dataTransfer.files;if(k.length>0){o(k[0]);return}},onClick:()=>document.querySelector('input[type="file"]')?.click(),onDragOver:i=>i.preventDefault(),children:[t?N("div",{children:[p(r,{iconName:"IconFileTypeZip",className:"h-12 w-12 mx-auto mb-3"}),p("div",{className:"flex items-center justify-center gap-2",children:p("span",{className:"text-sm",children:t.name})})]}):N($e,{children:[p(r,{iconName:"IconUpload",className:"h-12 w-12 mx-auto mb-3"}),p("h3",{className:"font-semibold mb-1",children:"Upload Package"}),N("p",{className:"text-sm",children:["Drag and drop or ",p("span",{className:"text-primary cursor-pointer",children:"choose file"})," to upload"]})]}),p("input",{type:"file",className:"hidden",onChange:i=>{i?.target?.files&&i.target.files.length>0&&(o(i.target.files[0]),i.target.files=null)}})]}),t&&N($e,{children:[N(y,{variant:"link",size:"sm",className:"w-full flex items-center",onClick:()=>o(null),children:[p(r,{iconName:"IconTrash",className:"h-4 w-4 text-muted-foreground cursor-pointer"}),"Delete"]}),p(y,{className:"w-full",variant:"outline",onClick:()=>Ve(v),children:"Verify Package"})]})]})},customInstallSummary:()=>{let{packages:i,setIsLoading:k,setValidationError:m}=h(),g=i.find(I=>I.code==l?.code)??!1,P=g!==!1,f=c?"Package Verified":"Package Not Verified",S=c?"Your package documents are valid. You can install it now.":"Your package is not verified. Please contact the package author for more information.",{post:s,recentlySuccessful:x,processing:b}=ua({process:e,manifest:{code:l?.code,version:l?.version,core_constraint:l?.core_constraint},packageZip:t??null}),C=()=>(k(!0),new Promise(I=>s(route("dashboard.packages.manager"),{onSuccess:()=>I(!0),onError:B=>m(Object.values(B).join(`
1
+ import{a as xe}from"./chunk-VTOYD4F3.js";import{a as Ne}from"./chunk-SC5FEULM.js";import{a as be}from"./chunk-AG4EHKB7.js";import{a as K}from"./chunk-Z6APYDZ7.js";import{a as he}from"./chunk-KND3PUAR.js";import{a as ke}from"./chunk-CN6NPPO6.js";import{a as Pe}from"./chunk-D5ORVBB6.js";import{a as ve}from"./chunk-L37X7O6L.js";import{Ca as ue,Ea as fe,b as q,g as pe}from"./chunk-V6XQBO4L.js";import{a as me}from"./chunk-7NKFSFMC.js";import{a as W,f as j,g as J,h as ge,i as T,j as F}from"./chunk-QFUZ6MVT.js";import{a as te}from"./chunk-M5QT5SFN.js";import{b as y}from"./chunk-TVCWAJFT.js";import{a as $}from"./chunk-G22OJQWL.js";import{a as L,c as R,d as z}from"./chunk-PRCYNFKC.js";import{a as r}from"./chunk-G4EEZUTC.js";import{a as ae}from"./chunk-GND5KQRZ.js";import{createContext as Je,useContext as Ke,useEffect as oe,useState as D}from"react";import{jsx as Ye,jsxs as Ge}from"react/jsx-runtime";var Ce=Je({}),we=({children:e,packages:a,process:t="install",step:o=1,isValid:c=!1,is_custom:l=!1})=>{let u={title:"Loading",description:"Please wait while we process your request."},[v,i]=D(a),[k,m]=D(t),[g,P]=D(!1),[f,S]=D(o),[s,x]=D(null),[b,C]=D(null),[I,B]=D(c),[Z,ce]=D(""),[qe,le]=D(!1),[We,X]=D(u),ee=Pe();oe(()=>{g||setTimeout(()=>{S(1),m(t),x(null),C(null),B(!1),le(!1),ce(""),X(u)},250)},[g]),oe(()=>{!b||!ee||Object.values(ee).forEach(U=>{U?.jobCode===`${b.code}_${k}`&&X({title:U.title,description:U.description,progress:U.progress,error:U.status==="failed"})})},[ee]),oe(()=>{i(a)},[a]);let de=()=>b?.is_custom===!1,je={packages:v,setPackages:i,process:k,setProcess:m,isModalOpen:g,setIsModalOpen:P,step:f,setStep:S,selectedFile:s,setSelectedFile:x,packageManifest:b,setPackageManifest:C,isValid:I,setIsValid:B,validationError:Z,setValidationError:ce,isLoading:qe,setIsLoading:le,loadingContent:We,setLoadingContent:X,isOfficial:de,isCustom:()=>!de()};return Ge(Ce.Provider,{value:je,children:[e,Ye(ye,{})]})},h=()=>{let e=Ke(Ce);if(!e)throw new Error("PackageManagerContext must be used within a PackageManagerProvider");return e};import{Fragment as Me,jsx as w,jsxs as Y}from"react/jsx-runtime";var Ie=e=>{let{loadingContent:a,validationError:t}=h(),o={title:a.title,description:a.description,content:Y(Me,{children:[w("div",{className:"animate-spin rounded-full h-15 w-15 border-b-2 border-primary mx-auto"}),Y("div",{className:"text-center",children:[w(T,{className:"text-base text-lg",children:a.title}),w(F,{className:"text-sm",children:a.description}),a.progress&&Y(Me,{children:[w(ve,{value:a.progress,className:"my-2"}),"%",a.progress]}),a.error&&w(F,{className:"text-red-500 text-sm",children:a.error})]})]})},c={title:null,description:null,content:Y("div",{className:"grid gap-2 justify-center text-center animate-in fade-in duration-500",children:[w(r,{iconName:"IconExclamationCircleFilled",className:"text-red-500 h-15 w-15 mx-auto"}),w("span",{className:"text-2xl font-bold",children:"Error"}),w("span",{className:"text-sm text-muted-foreground",children:t})]})};if(t)return c;if(e=="loading")return o;let l=Ee(),u=Se(),[v,i,k]=e.split("-"),m=v,g=i,P=Number(k);return{custom:{install:{1:l.selectInstallationMethod,2:l.uploadPackageZipFile,3:l.customInstallSummary()},update:{1:l.uploadPackageZipFile,2:u.updateSummary()}},market:{update:{1:u.updateSummary()}}}[m]?.[g]?.[P]??l.selectInstallationMethod},De=e=>[{key:"code",value:w("span",{className:"",children:e.code??"\u2014"})},{key:"version",value:w("span",{children:e?.version??"\u2014"})},{key:"author",value:w("span",{children:e?.author??"\u2014"})},{key:"source",value:w("span",{className:"text-orange-400",children:"Custom"})}];import{unzip as Qe}from"fflate";import{toast as Xe}from"sonner";var ea=e=>new Promise((a,t)=>{Qe(e,(o,c)=>{if(o)return t(new Error("ZIP file is corrupted"));a(c)})}),Ve=async e=>{let{process:a,selectedFile:t,setIsLoading:o,step:c,setStep:l,setPackageManifest:u,setValidationError:v,setIsValid:i,packages:k,setLoadingContent:m}=e;try{if(!t)throw new Error("Please select a file.");if(o(!0),m({title:"Package Verifying",description:"Please wait while we verify the package."}),t.size>100*1024*1024)throw new Error("File should be less than 100MB");let g=new Uint8Array(await t.arrayBuffer()),P=await ea(g);if(!P["emincore.json"])throw new Error("Manifest (emincore.json) has not been found in the ZIP file.");let f=JSON.parse(new TextDecoder().decode(P["emincore.json"]));u(f);let s=["code","name","version","description","author","core_constraint"].filter(C=>f[C]==null||f[C]==="");if(s.length)throw new Error("Manifest is missing required fields: "+s.join(", "));let x=f.composer_package&&f.composer_package_version,b=f.npm_package&&f.npm_package_version;if(!x&&!b)throw new Error("Package must has at least one of composer package or npm package.");if(a=="update"){let C=be(k.find(I=>I.code==f?.code),f);if(typeof C=="string")throw new Error(C)}i(!0)}catch(g){throw Xe.error(String(g)),v(String(g)),i(!1),g}finally{l(c+1),o(!1)}};import{router as ga,useForm as ua}from"@inertiajs/react";import{useState as aa,useEffect as ta}from"react";import{Fragment as se,jsx as d,jsxs as V}from"react/jsx-runtime";var ne=({pkg:e,showBadge:a=!0,showBadgeTitle:t=!0,className:o})=>V("div",{className:ae("flex items-center gap-1",o),children:[d("span",{className:"font-medium",children:e?.name||e?.code}),a&&d(oa,{pkg:e,showBadgeTitle:t})]}),oa=({pkg:e,showBadgeTitle:a=!0,className:t,size:o=18})=>d("div",{className:ae("flex items-center gap-1",t),children:e?.is_custom===!1?e.code.slice(0,8)==="emintech"?V(se,{children:[d(r,{iconName:"IconCertificate",className:"text-cyan-600 dark:text-cyan-400",size:o}),a&&d("span",{className:"font-medium text-cyan-600 dark:text-cyan-400",children:"Official"})]}):V(se,{children:[d(r,{iconName:"IconRosetteDiscountCheckFilled",className:"text-emerald-600 dark:text-emerald-400",size:o}),a&&d("span",{className:"font-medium text-emerald-600 dark:text-emerald-400",children:"Verified"})]}):V(se,{children:[d(r,{iconName:"IconInfoCircleFilled",className:"text-slate-500 dark:text-slate-400",size:o}),a&&d("span",{className:"font-medium text-slate-500 dark:text-slate-400",children:"Unverified"})]})}),at=({statistics:e})=>{let[a,t]=aa(e);ta(()=>{t(e)},[e]);let o=[{title:"Total Packages",subtext:"Total packages counts",value:String(a.total_packages),icon:d(r,{iconName:"IconFilter",className:"h-4 w-4 text-muted-foreground"})},{title:"Enabled Packages",subtext:"Enabled packages counts",value:String(a.enabled_packages),icon:d(r,{iconName:"IconFilter",className:"h-4 w-4 text-muted-foreground"})},{title:"Disabled Packages",subtext:"Disabled packages counts",value:String(a.disabled_packages),icon:d(r,{iconName:"IconFilter",className:"h-4 w-4 text-muted-foreground"})},{title:"Need Update",subtext:"Packages need update counts",value:String(a?.need_update_packages),icon:d(r,{iconName:"IconFilter",className:"h-4 w-4 text-muted-foreground"})}];return d("div",{className:"grid grid-cols-1 md:grid-cols-4 lg:grid-cols-4 gap-6 mb-8",children:o.map(c=>d(ue,{...c},c.title?.toString()))})},A=({pkg:e,details:a})=>{let t=a??Fe(e);return V("div",{className:"space-y-4",children:[V("div",{className:e?.image?"grid gap-3":"flex items-center gap-3",children:[e?.image?d("div",{className:"w-full h-auto rounded-lg aspect-[16/9] shadow-sm",style:{backgroundImage:`url(${e.image})`,backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover"}}):d(r,{iconName:"IconPackage",className:"h-7 w-7 text-muted-foreground shrink-0"}),V(J,{children:[d(T,{className:"text-base",children:e?.name?d(ne,{pkg:e}):e.code}),d(F,{className:"text-xs",children:e?.description??"No description"})]})]}),d("hr",{}),d("div",{className:"space-y-3 text-sm",children:t.map(o=>V("div",{className:"flex justify-between",children:[d("span",{className:"text-muted-foreground capitalize",children:o.key}),o.value]},o.key))})]})},_e=({isModalOpen:e,setIsModalOpen:a,package:t,details:o})=>d(W,{open:e,onOpenChange:a,children:d(j,{className:"sm:max-w-md",children:d(A,{pkg:t,details:o})})});import{Fragment as sa,jsx as G,jsxs as Te}from"react/jsx-runtime";var Ae=()=>{let{packages:e,selectedPackage:a,isDetailsModalOpen:t,setIsDetailsModalOpen:o}=Q(),{setIsModalOpen:c,setProcess:l,setStep:u}=h(),v=Be(),i=Oe();return Te(sa,{children:[Te(y,{size:"sm",variant:"outline",className:"mb-4 flex items-center gap-2",onClick:()=>{c(!0),l("install"),u(1)},children:[G(r,{iconName:"IconUpload"}),G("span",{children:"Install Package"})]}),G(fe,{columns:i,data:e,bulkActions:v}),a&&G(_e,{isModalOpen:t,setIsModalOpen:o,package:a})]})};import{router as na,useHttp as ra}from"@inertiajs/react";import{useEffect as ia,useState as ca}from"react";import{toast as Ue}from"sonner";import{Fragment as Le,jsx as n,jsxs as E}from"react/jsx-runtime";var Oe=()=>{let[e,a]=ca(!0);ia(()=>{a(!1);let s=setTimeout(()=>a(!0),50);return()=>clearTimeout(s)},[]);let{setSelectedPackage:t,setIsDetailsModalOpen:o}=Q(),{setPackageManifest:c,setProcess:l,setIsModalOpen:u,setStep:v,setIsLoading:i,setLoadingContent:k,setValidationError:m}=h(),{selectVersion:g,SelectionModal:P}=xe(),f=ra(),S=s=>{if(c(s),l("update"),u(!0),!s.is_custom){i(!0),k({title:"Checking Package Updates",description:"Please wait while we check the latest updates for this package."});let x=async b=>{let{latest:C,latest_compatible:I}=b;C.version!==I.version?await g(b).then(Z=>Z!==null?c({...Z,is_custom:!1}):u(!1)):c({...I,is_custom:!1}),v(1)};Ne(f,s.id).then(b=>x(b)).catch(()=>m("Failed to check updates for this package.")).finally(()=>i(!1))}};return[{id:"select",header:({table:s})=>n(te,{checked:s.getIsAllPageRowsSelected()||s.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:x=>s.toggleAllPageRowsSelected(!!x),"aria-label":"T\xFCm\xFCn\xFC se\xE7"}),cell:({row:s})=>n(te,{id:`select-row-${s.id}`,checked:s.getIsSelected(),onCheckedChange:x=>{s.toggleSelected(!!x)},"aria-label":"Sat\u0131r se\xE7"}),enableSorting:!1,enableHiding:!1},{accessorKey:"package",header:"Package",cell:({row:s})=>E("div",{className:"flex items-center gap-5 cursor-pointer",onClick:()=>{t(s.original),o(!0)},children:[n($,{className:"my-2 h-5 w-10",style:{display:e?"none":"block"}}),E("span",{style:{display:e?"flex":"none"},className:"items-center gap-3",children:[n(r,{iconName:"IconPackage",className:"h-7 my-2 cursor-pointer"}),E("div",{className:"flex flex-col",children:[n("div",{className:"flex items-center gap-1",children:n(ne,{pkg:s.original})}),n("span",{className:"text-muted-foreground text-xs",children:s.original.description?s.original.description.length>61?s.original?.description?.slice(0,60)+"...":s.original?.description:"No description"}),n("span",{className:"text-muted-foreground text-xs",children:s.original?.version})]})]})]})},{accessorKey:"is_active",header:()=>E(L,{trigger:"hover",children:[n(R,{children:"Status"}),n(z,{className:"w-auto",children:"Is the package enabled?"})]}),cell:({row:s})=>E(Le,{children:[n($,{className:"my-2 h-5 w-10",style:{display:e?"none":"block"}}),n("div",{style:{display:e?"block":"none"},children:n(me,{checked:s.original.is_active,onCheckedChange:x=>{K([s.original.id],{is_active:x})}})})]})},{accessorKey:"actions",header:()=>E(L,{trigger:"hover",children:[n(R,{children:"Actions"}),n(z,{className:"w-auto",children:"Actions of the package"})]}),cell:({row:s})=>E(Le,{children:[n($,{className:"my-2 h-5 w-10",style:{display:e?"none":"block"}}),E("div",{style:{display:e?"flex":"none"},className:"gap-2",children:[E(L,{trigger:"hover",children:[n(R,{children:n(q,{title:"Uninstall Package",content:"Are you sure to uninstall this package?",onConfirm:()=>{na.post(route("dashboard.packages.manager"),{process:"uninstall",manifest:{code:s.original.code}})},children:n(y,{variant:"outline",size:"sm",className:"flex items-center",disabled:s.original.is_active,children:n(r,{iconName:"IconTrash",className:"h-4 w-4"})})})}),n(z,{children:s.original.is_active?"Disable Package First":"Uninstall Package"})]}),E(L,{trigger:"hover",children:[n(R,{children:n(y,{variant:"outline",size:"sm",className:"flex items-center",onClick:()=>S(s.original),children:n(r,{iconName:"IconRefresh",className:"h-4 w-4"})})}),n(z,{children:s.original.is_custom?"Update Package":"Check Updates"})]}),n(P,{})]})]})}]},Be=()=>[{label:"Enable",icon:n(r,{iconName:"IconCheck",className:"h-4 w-4 mr-1"}),variant:"outline",confirm:!0,confirmTitle:"Enable Packages",confirmContent:"Are you sure to enable these packages?",confirmIcon:n(r,{iconName:"IconCheck",size:30}),cancel:()=>{Ue.info("Process cancelled")},action:(e,a)=>{let t=e.map(o=>o.original.id);K(t,{is_active:!0},o=>o&&a&&a())}},{label:"Disable",icon:n(r,{iconName:"IconCreativeCommonsNd",className:"h-4 w-4 mr-1"}),variant:"destructive",confirm:!0,confirmTitle:"Disable Packages",confirmContent:"Are you sure to disable these packages?",confirmIcon:n(r,{iconName:"IconCreativeCommonsNd",size:30}),cancel:()=>{Ue.info("Process cancelled")},action:(e,a)=>{let t=e.map(o=>o.original.id);K(t,{is_active:!1},o=>{o&&a&&a()})}}],Fe=e=>[{key:"code",value:n("span",{className:"",children:e.code??"\u2014"})},{key:"version",value:n("span",{children:e?.version??"\u2014"})},{key:"author",value:n("span",{children:e?.author??"\u2014"})},{key:"source",value:n("span",{className:e?.is_custom!==!1?"text-orange-400":"text-green-600",children:e?.is_custom!==!1?"Custom":"Marketplace"})},{key:"status",value:n("span",{className:e?.is_active?"text-green-600":"text-destructive",children:e?.is_active?"Enabled":"Disabled"})},{key:"installed at",value:n("span",{children:e?.created_at?new Date(e.created_at).toLocaleDateString():"\u2014"})},{key:"last updated at",value:n("span",{children:e?.updated_at?new Date(e.updated_at).toLocaleDateString():"\u2014"})}];import{createContext as la,useContext as da,useEffect as ma,useState as re}from"react";import{jsx as Re}from"react/jsx-runtime";var ze=la({}),He=({packages:e,children:a})=>{let[t,o]=re(e),[c,l]=re(null),[u,v]=re(!1);ma(()=>{o(e)},[e]);let i={packages:t,setPackages:o,selectedPackage:c,setSelectedPackage:l,isDetailsModalOpen:u,setIsDetailsModalOpen:v};return Re(we,{packages:t,children:Re(ze.Provider,{value:i,children:a})})},Q=()=>{let e=da(ze);if(!e)throw new Error("usePackagesContext must be used within a PackagesProvider");return e};import{Head as pa}from"@inertiajs/react";import{jsx as H,jsxs as Ze}from"react/jsx-runtime";var Bt=({packages:e})=>{let a=[{title:"WM Dashboard",href:route("dashboard")},{title:"Packages",href:"#"}];return Ze(ke,{breadcrumbs:a,children:[H(pa,{title:"Packages"}),Ze("div",{className:"container mx-auto",children:[H(he,{title:"Packages",description:"Here you can see and manage all the system packages.",icon:H(r,{iconName:"IconLink",className:"h-10 w-10 my-2 opacity-75"})}),H(He,{packages:e,children:H(Ae,{})})]})]})};import{Fragment as $e,jsx as p,jsxs as N}from"react/jsx-runtime";var Ee=()=>{let{process:e,setStep:a,selectedFile:t,setSelectedFile:o,isValid:c,packageManifest:l,validationError:u}=h(),v=h();return{selectInstallationMethod:{title:"Select Installation Method",description:"Choose whether to install the package from a file or a URL.",content:N("div",{className:"grid grid-cols-2 gap-2",children:[N("div",{className:"border-2 rounded-lg p-6 text-center cursor-pointer hover:border-gray-400 transition-colors",onClick:()=>a(2),children:[p(r,{iconName:"IconUpload",className:"h-12 w-12 mx-auto mb-3"}),p("h3",{className:"font-semibold mb-1",children:"Manual Upload"}),p("p",{className:"text-sm",children:"Upload your custom package file"})]}),N("div",{className:"border-2 rounded-lg p-6 text-center cursor-pointer hover:border-gray-400 transition-colors",onClick:()=>ga.get(route("dashboard.packages.marketplace")),children:[p(r,{iconName:"IconShoppingBag",className:"h-12 w-12 mx-auto mb-3"}),p("h3",{className:"font-semibold mb-1",children:"Marketplace"}),p("p",{className:"text-sm",children:"Browse and install from marketplace"})]})]})},uploadPackageZipFile:{title:t?"Verify Package File":"Upload Package File",description:t?"Verify the package file to ensure it is valid.":"Upload your custom package file (.zip)",content:N("div",{className:"grid grid-cols-1 gap-2",children:[N("div",{className:"border-2 rounded-lg p-6 text-center cursor-pointer border-dashed "+(t?"border-gray-400 text-primary":"text-muted-foreground hover:border-gray-400 hover:text-primary transition-colors"),onDrop:i=>{i.preventDefault();let k=i.dataTransfer.files;if(k.length>0){o(k[0]);return}},onClick:()=>document.querySelector('input[type="file"]')?.click(),onDragOver:i=>i.preventDefault(),children:[t?N("div",{children:[p(r,{iconName:"IconFileTypeZip",className:"h-12 w-12 mx-auto mb-3"}),p("div",{className:"flex items-center justify-center gap-2",children:p("span",{className:"text-sm",children:t.name})})]}):N($e,{children:[p(r,{iconName:"IconUpload",className:"h-12 w-12 mx-auto mb-3"}),p("h3",{className:"font-semibold mb-1",children:"Upload Package"}),N("p",{className:"text-sm",children:["Drag and drop or ",p("span",{className:"text-primary cursor-pointer",children:"choose file"})," to upload"]})]}),p("input",{type:"file",className:"hidden",onChange:i=>{i?.target?.files&&i.target.files.length>0&&(o(i.target.files[0]),i.target.files=null)}})]}),t&&N($e,{children:[N(y,{variant:"link",size:"sm",className:"w-full flex items-center",onClick:()=>o(null),children:[p(r,{iconName:"IconTrash",className:"h-4 w-4 text-muted-foreground cursor-pointer"}),"Delete"]}),p(y,{className:"w-full",variant:"outline",onClick:()=>Ve(v),children:"Verify Package"})]})]})},customInstallSummary:()=>{let{packages:i,setIsLoading:k,setValidationError:m}=h(),g=i.find(I=>I.code==l?.code)??!1,P=g!==!1,f=c?"Package Verified":"Package Not Verified",S=c?"Your package documents are valid. You can install it now.":"Your package is not verified. Please contact the package author for more information.",{post:s,recentlySuccessful:x,processing:b}=ua({process:e,manifest:{code:l?.code,version:l?.version,core_constraint:l?.core_constraint},packageZip:t??null}),C=()=>(k(!0),new Promise(I=>s(route("dashboard.packages.manager"),{onSuccess:()=>I(!0),onError:B=>m(Object.values(B).join(`
2
2
  `))})));return{title:f,description:S,content:c&&l?N("div",{className:"border-2 rounded-lg p-6 text-center cursor-pointer text-muted-foreground text-primary transition-colors",children:[p(A,{pkg:l,details:De(l)}),N("div",{className:"mt-4",children:[p(q,{title:e=="install"?"Confirm Installation":"Confirm Update",content:p("div",{className:"!text-center",children:"This package has passed basic manifest validation only. This does not guarantee safety or full compatibility. Only proceed if you are absolutely certain of its origin and trust the source."}),confirmText:e=="install"?"Confirm and Install":"Confirm and Update",onConfirm:()=>C(),children:P?p(y,{className:"w-full",variant:"outline",disabled:!0,children:"Installed"}):N(pe,{recentlySuccessful:x,processing:b,children:[p(r,{iconName:e=="install"?"IconDownload":"IconRefresh"}),p("span",{children:e=="install"?"Install Package":"Update Package"})]})}),P&&N("div",{className:"text-red-500 my-3",children:[g.code," - ",g.version," already exists."]})]})]}):p("div",{children:u??"An error occurred while verifying the package. Please contact the package author for more information."})}}}};import{useForm as fa}from"@inertiajs/react";import{Fragment as ka,jsx as M,jsxs as O}from"react/jsx-runtime";var Se=()=>{let{packages:e,packageManifest:a,validationError:t,setValidationError:o,isCustom:c,process:l,selectedFile:u,setIsLoading:v}=h();return{updateSummary:()=>{let i="Package Updates",k="Here are the latest updates for this package.",m=e.find(s=>s.code===a?.code),g=a,P=g?.version!=m?.version,f=fa();!P&&m?.is_custom===!1&&(i=k=null);let S=()=>{a&&(v(!0),f.setData({process:l,manifest:{code:a.code,version:a.version,core_constraint:a.core_constraint},...a.is_custom&&{packageZip:u}}),f.post(route("dashboard.packages.manager"),{onError:s=>o(Object.values(s).join(`
3
3
  `))}))};return{title:i,description:k,content:M(ka,{children:!P&&m?.is_custom===!1?O("div",{className:"grid gap-2 justify-center text-center animate-in fade-in duration-500 !border-none",children:[M(r,{iconName:"IconCircleCheckFilled",className:"text-green-500 h-15 w-15 mx-auto"}),O("span",{className:"text-2xl font-bold",children:[m.name," is up to date!"]}),M("span",{className:"text-sm text-muted-foreground",children:"There are no updates available for this package."})]}):O("div",{className:"grid grid-cols-1 gap-3",children:[O("div",{className:"grid grid-cols-[4fr_40px_4fr] gap-2",children:[O("div",{className:"!opacity-70",children:[M("span",{className:"font-bold mb-2 block text-center",children:"Old Version"}),M("div",{className:"border-2 rounded-lg p-6 text-center text-muted-foreground text-primary transition-colors",children:m&&M(A,{pkg:m})})]}),M("div",{className:"flex items-center justify-center",children:M(r,{iconName:"IconArrowBarRight",className:"h-10 w-10"})}),O("div",{children:[M("span",{className:"font-bold mb-2 block text-center",children:"New Version"}),M("div",{className:"border-2 rounded-lg p-6 text-center text-muted-foreground text-primary transition-colors",children:g&&M(A,{pkg:{...g,is_active:!1,is_custom:c(),id:0}})})]})]}),M(y,{className:"w-full mt-2",variant:"outline",disabled:!!t,onClick:()=>S(),children:"Update Package"})]})})}}}};import{Fragment as va,jsx as _,jsxs as ie}from"react/jsx-runtime";var ye=()=>{let{isModalOpen:e,setIsModalOpen:a,isLoading:t,process:o,step:c,isCustom:l,setStep:u,setValidationError:v}=h(),i=l()?"custom":"market",k=t?"loading":`${i}-${o}-${c}`,m=Ie(k);return _(W,{open:e,onOpenChange:a,children:ie(j,{className:"max-h-[90vh] overflow-auto break-all min-w-[50vh] max-w-[75vh] w-auto",children:[_(J,{children:!t&&(m.title||m.description)&&ie(va,{children:[_(T,{className:"text-base text-lg",children:m.title}),_(F,{className:"text-sm",children:m.description}),_("hr",{})]})}),m.content,_(ge,{children:c>1&&!t&&_("div",{className:"grid mx-auto",children:ie(y,{variant:"link",size:"sm",className:"flex items-center gap-1",onClick:()=>{u(c-1),v("")},children:[_(r,{iconName:"IconArrowLeft",className:"h-4 w-4"}),"Back"]})})})]})})};export{ye as a,we as b,h as c,Ie as d,De as e,Ve as f,ne as g,oa as h,at as i,A as j,_e as k,Ae as l,Oe as m,Be as n,Fe as o,He as p,Q as q,Bt as r,Ee as s,Se as t};
@@ -0,0 +1 @@
1
+ import{a as p}from"./chunk-DSY4KVMF.js";import{a}from"./chunk-QKGQOXDM.js";import{a as o}from"./chunk-G4EEZUTC.js";import{a as r}from"./chunk-GND5KQRZ.js";import{jsx as e,jsxs as s}from"react/jsx-runtime";var I=({label:n,icon:t,value:i,placeholder:m,type:u="text",error:l,onChange:c,helpPopover:d,className:g,...v})=>s("div",{className:"grid gap-1",children:[n&&e("span",{className:"text-sm text-muted-foreground",children:n}),s("div",{className:"group relative",children:[e(a,{type:u,value:i,onChange:c,placeholder:m,className:r("w-full px-10",g),min:"1",...v}),t&&e("div",{className:"text-muted-foreground/80 absolute inset-y-0 start-0 flex items-center justify-center ps-3",children:typeof t=="string"?e(o,{iconName:t,size:16}):t}),d??null]}),e(p,{message:l})]});export{I as a};
@@ -1 +1 @@
1
- import{b as se,c as x}from"./chunk-QXMEPU4D.js";import{a as ne}from"./chunk-BI4PD4EL.js";import{a as re,c as Z,d as de,e as le,f as j,h as ce}from"./chunk-3QPHFHMI.js";import{a as ae}from"./chunk-4DHRTWA7.js";import{b as X,c as $,g as A}from"./chunk-HGOBNKGK.js";import{b as T,c as B,d as G,e as H,f as R,h as O}from"./chunk-GBXDCZP6.js";import{a as J,b as q,f as K,g as V,h as ee,i as te,j as oe}from"./chunk-QFUZ6MVT.js";import{b as k}from"./chunk-TVCWAJFT.js";import{a as ie}from"./chunk-65LRDGYI.js";import{a as y}from"./chunk-G4EEZUTC.js";import{a as h}from"./chunk-GND5KQRZ.js";import{a as U}from"./chunk-QL2STABI.js";import{useEffect as be,useState as we}from"react";import{useForm as Ie}from"@inertiajs/react";import{IconPlus as Ne,IconTrash as Ce}from"@tabler/icons-react";import{Fragment as Le,jsx as m,jsxs as b}from"react/jsx-runtime";var me=()=>{let[e,o]=we(!1);return b(Le,{children:[b(k,{variant:"outline",className:"flex items-center gap-2",onClick:()=>o(!e),children:[m(y,{iconName:"IconLayoutGrid"}),"Widgets"]}),m(We,{isOpen:e,setIsOpen:o})]})},We=({isOpen:e,setIsOpen:o})=>{let{widgets:t}=x(),n=ne(t);return b(T,{open:e,onOpenChange:o,title:"Widgets",description:"Select a widget to add to your dashboard.",children:[m(B,{placeholder:"Search widgets..."}),b(G,{className:"max-h-[420px]",children:[m(H,{children:"No widget found."}),n.map(({packageCode:a,widgets:r})=>r.length>0&&m(R,{className:"p-5",heading:m(De,{packageCode:a,totalWidgets:r.length}),children:r.map(s=>m(O,{value:s.id,keywords:[s.title,s?.description??""],className:"!bg-background",children:m(Pe,{widget:s})},s.id))}))]})]})},De=({packageCode:e,totalWidgets:o})=>b("div",{className:"flex items-center gap-2",children:[m(y,{iconName:"IconLayoutGrid",className:"w-5 h-5 text-primary"}),b("span",{className:"font-bold text-base capitalize text-primary",children:[e.replace("_"," ")," widgets"]}),b("span",{className:"text-xs text-muted-foreground ml-auto",children:[o," ",o===1?"widget":"widgets"," provided"]})]}),Pe=({widget:e})=>{let{profile:o}=x(),t=o.items?.find(n=>n.widget_id===e.id);return b("div",{className:h("flex items-center gap-3 justify-center h-full w-full min-h-[50px] rounded-lg border p-4",t?.is_expanded?"text-muted-foreground":""),children:[m(y,{iconName:e?.icon??"IconPackage",className:"h-7 w-7 shrink-0"}),b("div",{className:"grid gap-2",children:[m("div",{className:"text-sm font-bold",children:e.title}),e.description&&m("div",{className:"text-xs text-center",children:e.description??""})]}),m(ke,{widget:e})]})},ke=({widget:e})=>{let{profile:o,breakPoints:t}=x(),a=re(e,o)?"delete":"post",r=()=>a==="delete"?{id:o.items?.find(D=>D.widget_id===e.id)?.id}:{widget_profile_id:o.id,widget_id:e.id,is_expanded:!0,layouts:le(e,t)},s=Ie(r());be(()=>s.setData(r()),[o]);let g=a==="delete"?route("widgets.profiles.items.destroy"):route("widgets.profiles.items.store"),d=()=>s[a](g),C=a==="delete"?s.recentlySuccessful?"outline":"destructive":s.recentlySuccessful?"destructive":"outline",W=a==="delete"?s.recentlySuccessful?"Widget Added!":"":s.recentlySuccessful?"Widget Removed!":"",I=a==="delete"?"Widget Removing...":"Widget Adding...";return b(A,{variant:C,size:"sm",className:"text-primary ml-auto",recentlySuccessful:s.recentlySuccessful,processing:s.processing,successText:W,processingText:I,onClick:()=>d(),children:[a==="delete"?m(Ce,{}):m(Ne,{}),m("span",{children:a==="delete"?"Remove":"Add"})]})};import{useState as ue}from"react";import{router as pe,useForm as Y}from"@inertiajs/react";import{Fragment as fe,jsx as i,jsxs as p}from"react/jsx-runtime";var ge=()=>{let{profile:e}=x(),[o,t]=ue(!1);return p(fe,{children:[p(k,{variant:"outline",className:"flex items-center gap-2",onClick:()=>t(!o),children:[i(y,{iconName:"IconLayout"}),e?.title||"Layouts"]}),i(Ee,{open:o,onOpenChange:t})]})},Ee=({open:e,onOpenChange:o})=>{let{profiles:t,profile:n}=x();return p(T,{open:e,onOpenChange:o,title:"Layouts",description:"See your current layout, default layout, and create a new one.",children:[i(B,{placeholder:"Search layouts..."}),p(G,{className:"max-h-[420px]",children:[i(H,{children:"No layout found."}),i(R,{className:"p-5",children:t.map(a=>i(O,{value:`${a.title} ${a.is_default?"default":"normal"} ${a.id===n?.id?"current active":""}`,className:"mb-2 flex items-center gap-3 rounded-lg border bg-background hover:bg-background/70 !py-5 !px-5 data-[selected=true]:bg-background data-[selected=true]:text-foreground last:mb-0",children:i(Se,{profile:a})},a.id))})]}),p("div",{className:"px-3 pt-3 pb-7 grid gap-2",children:[i("div",{className:"text-sm text-muted-foreground text-center",children:"Create a new layout from here."}),i(_e,{})]})]})},Se=({profile:e})=>{let{profile:o,indexRouteName:t}=x(),n={label:"Layout Name",key:"title",value:e.title,type:"text",editable:!0},a=g=>new Promise((d,C)=>{pe.put(route("widgets.profiles.update"),{id:e.id,title:g},{onSuccess:()=>d(!0),onError:()=>C(!1)})}),r=e.id===o?.id,s=route(t,{widget_profile_id:e.id});return p(fe,{children:[i("div",{className:"flex items-center w-2 h-2",children:i("span",{className:h("h-2 w-2 rounded-full",r?"bg-green-500":"bg-muted")})}),p("div",{className:"grid gap-1 text-left",children:[p("div",{className:"flex flex-wrap items-center gap-2",children:[i("div",{className:"group flex items-center gap-1",children:i($,{item:n,onChange:(g,d)=>a(d),children:p("div",{className:"flex items-center gap-2 !cursor-text",children:[i("span",{className:"font-semibold text-base",children:e.title}),i(y,{iconName:"IconPencil",className:"h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100"})]})})}),e.is_default&&i("span",{className:"rounded-md border px-2 py-0.5 text-xs font-medium",children:"Default"})]}),i(Me,{updatedAt:e.updated_at}),i(ze,{profile:e})]}),i("div",{className:"flex items-center gap-2 ml-auto shrink-0 self-center cursor-pointer",onClick:()=>!r&&pe.visit(s,{preserveUrl:!0}),children:i("div",{className:h("h-4 w-4 rounded-full border-2 flex items-center justify-center",r?"border-primary":"border-muted hover:border-primary"),children:r&&i("div",{className:"h-2 w-2 rounded-full bg-primary"})})})]})},ze=({profile:e})=>p("div",{className:"flex items-center gap-2",children:[i(Ae,{profile:e,className:"!p-0 h-4"}),i(Te,{profile:e,className:"!p-0 h-4"})]}),Me=({updatedAt:e})=>p("span",{className:"text-xs text-primary/70",children:["Updated At: ",e?new Date(e).toLocaleString():"Never"]}),_e=()=>{let[e,o]=ue(!1),t=Y({title:""}),n=()=>t.post(route("widgets.profiles.store"),{onSuccess:()=>t.reset()});return p(J,{open:e,onOpenChange:o,children:[i(q,{children:p(k,{variant:"outline",className:"flex items-center justify-center mx-auto gap-2",onClick:()=>o(!0),children:[i(y,{iconName:"IconPlus"}),i("span",{children:"Create new layout"})]})}),p(K,{className:"grid gap-3",children:[p(V,{children:[i(te,{children:"Create new layout"}),i(oe,{children:"Create a new layout to use. You can switch between layouts at any time."})]}),i("div",{children:i(ae,{label:"Layout Name",icon:"IconLayout",type:"text",placeholder:"Give a name to your new layout",error:t.errors.title,value:t.data.title,onChange:a=>t.setData({title:a.target.value})})}),i(ee,{children:p(A,{recentlySuccessful:t.recentlySuccessful,processing:t.processing,successText:"Layout Created!",processingText:"Layout creating...",variant:"default",onClick:()=>n(),children:[i(y,{iconName:"IconPlus"}),"Create Now"]})})]})]})},Ae=({profile:e,className:o})=>{let t=Y(),n=()=>{t.setData({id:e.id}),t.delete(route("widgets.profiles.destroy"))};return i(X,{title:"Are you sure to delete this layout?",content:"This action is permanent and cannot be undone.",onConfirm:()=>n(),children:i(k,{className:h(!t.processing||!t.recentlySuccessful?"text-red-500":"text-primary",o),type:"button",variant:"link",size:"sm",disabled:t.processing,onClick:a=>a.stopPropagation(),children:t.processing?"Deleting...":"Delete"})})},Te=({profile:e,className:o})=>{let t=Y(),n=()=>{t.setData({id:e.id,is_default:!e.is_default}),t.put(route("widgets.profiles.update"))};return!e.is_default&&i(k,{className:h("",o),type:"button",variant:"link",size:"sm",disabled:t.processing,onClick:a=>{a.preventDefault(),a.stopPropagation(),n()},children:t.processing?"Saving...":"Set as default"})};import{Fragment as Be,jsx as S,jsxs as ye}from"react/jsx-runtime";var Ct=({profile:e,profiles:o,widgets:t,indexRouteName:n})=>S(se,{profile:e,profiles:o,widgets:t,indexRouteName:n,children:ye("div",{className:"grid grid-cols-1 gap-7 overflow-visible",children:[S(ie,{title:"Dashboard",description:"Overview of your application",icon:"IconDeviceDesktop",buttons:ye(Be,{children:[S(me,{}),S(ge,{})]})}),S(xe,{})]})});import{useHttp as he}from"@inertiajs/react";import{IconLoader2 as Ge,IconMinus as He,IconPlus as Re,IconX as Oe}from"@tabler/icons-react";import{lazy as Fe,Suspense as Ze,useCallback as Q,useMemo as F}from"react";import{useContainerWidth as je,Responsive as Ye}from"react-grid-layout";import"react-grid-layout/css/styles.css";import{jsx as l,jsxs as z}from"react/jsx-runtime";var ve=new Map,Qe=(e,o)=>{let t=ve.get(e);if(t)return t;let n=Fe(o);return ve.set(e,n),n},xe=()=>{let{width:e,containerRef:o,mounted:t}=je(),{breakPoints:n,profile:a,setProfile:r}=x(),s=a?.items,g=F(()=>Object.keys(Z),[]),d=he({items:s??[]}),C=F(()=>s?.map(u=>u.widget)??[],[s]),W=F(()=>{let u={};return g.forEach(v=>{u[v]=s?.map(c=>c.layouts?.[v]??j(c.widget,!c.is_expanded,v))??[]}),u},[g,s]),I=Q((u,v)=>{r(c=>c&&{...c,items:u}),d.setData({items:u}),d.put(route("widgets.profiles.items.update"),{onError:()=>r(c=>c&&{...c,items:v})})},[d,r]),D=Q((u,v)=>{let c=v;if(ce(W,c,g))return;let w=s??[],M=w.map(_=>({..._,layouts:g.reduce((E,L)=>{let P=(c[L]??[]).find(f=>f.i===String(_.widget.id));return P&&(E[L]=P),E},{})}));I(M,w)},[I,g,W,s]),N=Q(u=>{let v=s??[],c=v.map(w=>{if(w.id!==u)return w;let M=!w.is_expanded,_=g.reduce((E,L)=>{let P=w.layouts?.[L],f=j(w.widget,!M,L);return E[L]={...P??f,i:f.i,x:P?.x??f.x,y:P?.y??f.y,w:P?.w??f.w,h:f.h,minH:f.minH,maxH:f.maxH,minW:f.minW,maxW:f.maxW},E},{});return{...w,is_expanded:M,layouts:_}});I(c,v)},[I,g,s]);return t&&l("div",{ref:o,children:l(Ye,{width:e,layouts:W,breakpoints:n,cols:Z,rowHeight:de,margin:[12,12],containerPadding:[0,0],dragConfig:{enabled:!0,handle:".widget-drag-handle"},resizeConfig:{enabled:!0},onLayoutChange:D,children:C.map(u=>l("div",{className:" overflow-visible",children:l(Ue,{widget:u,onToggleExpand:N})},String(u.id)))})})},Ue=({widget:e,onToggleExpand:o})=>{let{profile:t,setProfile:n}=x(),a=U.get(e.code),r=a?.loader,s=typeof r=="function",g=F(()=>s?Qe(e.code,r):()=>null,[e.code,r,s]),d=t.items.find(D=>D.widget_id===e.id),C=()=>o(d.id),W=he({id:d.id}),I=()=>{let D=t.items??[];n(N=>({...N,items:N?.items?.filter(u=>u.id!==d.id)})),W.delete(route("widgets.profiles.items.destroy"),{onError:()=>n(N=>N&&{...N,items:D})})};return s&&d&&z("div",{className:h(d?.is_expanded?"flex h-full w-full min-h-0 flex-col overflow-hidden rounded-lg border bg-background shadow-sm":""),children:[z("div",{className:h("flex items-center gap-2 widget-drag-handle shrink-0 px-3 py-3 bg-muted/30",d?.is_expanded?"border-b cursor-move select-none":"rounded-lg border shadow-sm"),children:[l(y,{iconName:a?.icon??"IconTag",className:"w-5 h-5 shrink-0"}),l("span",{className:"text-sm font-medium",children:e.title}),z("div",{className:"flex items-center gap-5 ml-auto",children:[l("span",{className:"text-sm text-muted-foreground",children:e.package_code}),z("div",{className:"flex items-center gap-2",children:[l("div",{onClick:()=>C(),children:d?.is_expanded?l(He,{className:"h-5 w-5 cursor-pointer"}):l(Re,{className:"h-5 w-5 cursor-pointer"})}),l("div",{onClick:()=>I(),children:l(Oe,{className:"h-5 w-5 cursor-pointer"})})]})]})]}),d?.is_expanded&&l("div",{className:"flex-1 min-h-0 overflow-auto p-3",children:l(Ze,{fallback:l("div",{className:"flex items-center justify-center w-full h-full",children:z("div",{className:"grid gap-2",children:[l("span",{className:"font-bold",children:e.title}),l(Ge,{className:"animate-spin h-7 w-7 mx-auto"})]})}),children:l(g,{props:e.props})})})]})};export{xe as a,Ue as b,me as c,ge as d,Ct as e};
1
+ import{b as se,c as x}from"./chunk-QXMEPU4D.js";import{a as ne}from"./chunk-BI4PD4EL.js";import{a as re,c as Z,d as de,e as le,f as j,h as ce}from"./chunk-3QPHFHMI.js";import{a as ae}from"./chunk-QZ7BICYJ.js";import{b as X,c as $,g as A}from"./chunk-V6XQBO4L.js";import{b as T,c as B,d as G,e as H,f as R,h as O}from"./chunk-GBXDCZP6.js";import{a as J,b as q,f as K,g as V,h as ee,i as te,j as oe}from"./chunk-QFUZ6MVT.js";import{a as ie}from"./chunk-65LRDGYI.js";import{b as k}from"./chunk-TVCWAJFT.js";import{a as y}from"./chunk-G4EEZUTC.js";import{a as h}from"./chunk-GND5KQRZ.js";import{a as U}from"./chunk-QL2STABI.js";import{useEffect as be,useState as we}from"react";import{useForm as Ie}from"@inertiajs/react";import{IconPlus as Ne,IconTrash as Ce}from"@tabler/icons-react";import{Fragment as Le,jsx as m,jsxs as b}from"react/jsx-runtime";var me=()=>{let[e,o]=we(!1);return b(Le,{children:[b(k,{variant:"outline",className:"flex items-center gap-2",onClick:()=>o(!e),children:[m(y,{iconName:"IconLayoutGrid"}),"Widgets"]}),m(We,{isOpen:e,setIsOpen:o})]})},We=({isOpen:e,setIsOpen:o})=>{let{widgets:t}=x(),n=ne(t);return b(T,{open:e,onOpenChange:o,title:"Widgets",description:"Select a widget to add to your dashboard.",children:[m(B,{placeholder:"Search widgets..."}),b(G,{className:"max-h-[420px]",children:[m(H,{children:"No widget found."}),n.map(({packageCode:a,widgets:r})=>r.length>0&&m(R,{className:"p-5",heading:m(De,{packageCode:a,totalWidgets:r.length}),children:r.map(s=>m(O,{value:s.id,keywords:[s.title,s?.description??""],className:"!bg-background",children:m(Pe,{widget:s})},s.id))}))]})]})},De=({packageCode:e,totalWidgets:o})=>b("div",{className:"flex items-center gap-2",children:[m(y,{iconName:"IconLayoutGrid",className:"w-5 h-5 text-primary"}),b("span",{className:"font-bold text-base capitalize text-primary",children:[e.replace("_"," ")," widgets"]}),b("span",{className:"text-xs text-muted-foreground ml-auto",children:[o," ",o===1?"widget":"widgets"," provided"]})]}),Pe=({widget:e})=>{let{profile:o}=x(),t=o.items?.find(n=>n.widget_id===e.id);return b("div",{className:h("flex items-center gap-3 justify-center h-full w-full min-h-[50px] rounded-lg border p-4",t?.is_expanded?"text-muted-foreground":""),children:[m(y,{iconName:e?.icon??"IconPackage",className:"h-7 w-7 shrink-0"}),b("div",{className:"grid gap-2",children:[m("div",{className:"text-sm font-bold",children:e.title}),e.description&&m("div",{className:"text-xs text-center",children:e.description??""})]}),m(ke,{widget:e})]})},ke=({widget:e})=>{let{profile:o,breakPoints:t}=x(),a=re(e,o)?"delete":"post",r=()=>a==="delete"?{id:o.items?.find(D=>D.widget_id===e.id)?.id}:{widget_profile_id:o.id,widget_id:e.id,is_expanded:!0,layouts:le(e,t)},s=Ie(r());be(()=>s.setData(r()),[o]);let g=a==="delete"?route("widgets.profiles.items.destroy"):route("widgets.profiles.items.store"),d=()=>s[a](g),C=a==="delete"?s.recentlySuccessful?"outline":"destructive":s.recentlySuccessful?"destructive":"outline",W=a==="delete"?s.recentlySuccessful?"Widget Added!":"":s.recentlySuccessful?"Widget Removed!":"",I=a==="delete"?"Widget Removing...":"Widget Adding...";return b(A,{variant:C,size:"sm",className:"text-primary ml-auto",recentlySuccessful:s.recentlySuccessful,processing:s.processing,successText:W,processingText:I,onClick:()=>d(),children:[a==="delete"?m(Ce,{}):m(Ne,{}),m("span",{children:a==="delete"?"Remove":"Add"})]})};import{useState as ue}from"react";import{router as pe,useForm as Y}from"@inertiajs/react";import{Fragment as fe,jsx as i,jsxs as p}from"react/jsx-runtime";var ge=()=>{let{profile:e}=x(),[o,t]=ue(!1);return p(fe,{children:[p(k,{variant:"outline",className:"flex items-center gap-2",onClick:()=>t(!o),children:[i(y,{iconName:"IconLayout"}),e?.title||"Layouts"]}),i(Ee,{open:o,onOpenChange:t})]})},Ee=({open:e,onOpenChange:o})=>{let{profiles:t,profile:n}=x();return p(T,{open:e,onOpenChange:o,title:"Layouts",description:"See your current layout, default layout, and create a new one.",children:[i(B,{placeholder:"Search layouts..."}),p(G,{className:"max-h-[420px]",children:[i(H,{children:"No layout found."}),i(R,{className:"p-5",children:t.map(a=>i(O,{value:`${a.title} ${a.is_default?"default":"normal"} ${a.id===n?.id?"current active":""}`,className:"mb-2 flex items-center gap-3 rounded-lg border bg-background hover:bg-background/70 !py-5 !px-5 data-[selected=true]:bg-background data-[selected=true]:text-foreground last:mb-0",children:i(Se,{profile:a})},a.id))})]}),p("div",{className:"px-3 pt-3 pb-7 grid gap-2",children:[i("div",{className:"text-sm text-muted-foreground text-center",children:"Create a new layout from here."}),i(_e,{})]})]})},Se=({profile:e})=>{let{profile:o,indexRouteName:t}=x(),n={label:"Layout Name",key:"title",value:e.title,type:"text",editable:!0},a=g=>new Promise((d,C)=>{pe.put(route("widgets.profiles.update"),{id:e.id,title:g},{onSuccess:()=>d(!0),onError:()=>C(!1)})}),r=e.id===o?.id,s=route(t,{widget_profile_id:e.id});return p(fe,{children:[i("div",{className:"flex items-center w-2 h-2",children:i("span",{className:h("h-2 w-2 rounded-full",r?"bg-green-500":"bg-muted")})}),p("div",{className:"grid gap-1 text-left",children:[p("div",{className:"flex flex-wrap items-center gap-2",children:[i("div",{className:"group flex items-center gap-1",children:i($,{item:n,onChange:(g,d)=>a(d),children:p("div",{className:"flex items-center gap-2 !cursor-text",children:[i("span",{className:"font-semibold text-base",children:e.title}),i(y,{iconName:"IconPencil",className:"h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100"})]})})}),e.is_default&&i("span",{className:"rounded-md border px-2 py-0.5 text-xs font-medium",children:"Default"})]}),i(Me,{updatedAt:e.updated_at}),i(ze,{profile:e})]}),i("div",{className:"flex items-center gap-2 ml-auto shrink-0 self-center cursor-pointer",onClick:()=>!r&&pe.visit(s,{preserveUrl:!0}),children:i("div",{className:h("h-4 w-4 rounded-full border-2 flex items-center justify-center",r?"border-primary":"border-muted hover:border-primary"),children:r&&i("div",{className:"h-2 w-2 rounded-full bg-primary"})})})]})},ze=({profile:e})=>p("div",{className:"flex items-center gap-2",children:[i(Ae,{profile:e,className:"!p-0 h-4"}),i(Te,{profile:e,className:"!p-0 h-4"})]}),Me=({updatedAt:e})=>p("span",{className:"text-xs text-primary/70",children:["Updated At: ",e?new Date(e).toLocaleString():"Never"]}),_e=()=>{let[e,o]=ue(!1),t=Y({title:""}),n=()=>t.post(route("widgets.profiles.store"),{onSuccess:()=>t.reset()});return p(J,{open:e,onOpenChange:o,children:[i(q,{children:p(k,{variant:"outline",className:"flex items-center justify-center mx-auto gap-2",onClick:()=>o(!0),children:[i(y,{iconName:"IconPlus"}),i("span",{children:"Create new layout"})]})}),p(K,{className:"grid gap-3",children:[p(V,{children:[i(te,{children:"Create new layout"}),i(oe,{children:"Create a new layout to use. You can switch between layouts at any time."})]}),i("div",{children:i(ae,{label:"Layout Name",icon:"IconLayout",type:"text",placeholder:"Give a name to your new layout",error:t.errors.title,value:t.data.title,onChange:a=>t.setData({title:a.target.value})})}),i(ee,{children:p(A,{recentlySuccessful:t.recentlySuccessful,processing:t.processing,successText:"Layout Created!",processingText:"Layout creating...",variant:"default",onClick:()=>n(),children:[i(y,{iconName:"IconPlus"}),"Create Now"]})})]})]})},Ae=({profile:e,className:o})=>{let t=Y(),n=()=>{t.setData({id:e.id}),t.delete(route("widgets.profiles.destroy"))};return i(X,{title:"Are you sure to delete this layout?",content:"This action is permanent and cannot be undone.",onConfirm:()=>n(),children:i(k,{className:h(!t.processing||!t.recentlySuccessful?"text-red-500":"text-primary",o),type:"button",variant:"link",size:"sm",disabled:t.processing,onClick:a=>a.stopPropagation(),children:t.processing?"Deleting...":"Delete"})})},Te=({profile:e,className:o})=>{let t=Y(),n=()=>{t.setData({id:e.id,is_default:!e.is_default}),t.put(route("widgets.profiles.update"))};return!e.is_default&&i(k,{className:h("",o),type:"button",variant:"link",size:"sm",disabled:t.processing,onClick:a=>{a.preventDefault(),a.stopPropagation(),n()},children:t.processing?"Saving...":"Set as default"})};import{Fragment as Be,jsx as S,jsxs as ye}from"react/jsx-runtime";var Ct=({profile:e,profiles:o,widgets:t,indexRouteName:n})=>S(se,{profile:e,profiles:o,widgets:t,indexRouteName:n,children:ye("div",{className:"grid grid-cols-1 gap-7 overflow-visible",children:[S(ie,{title:"Dashboard",description:"Overview of your application",icon:"IconDeviceDesktop",buttons:ye(Be,{children:[S(me,{}),S(ge,{})]})}),S(xe,{})]})});import{useHttp as he}from"@inertiajs/react";import{IconLoader2 as Ge,IconMinus as He,IconPlus as Re,IconX as Oe}from"@tabler/icons-react";import{lazy as Fe,Suspense as Ze,useCallback as Q,useMemo as F}from"react";import{useContainerWidth as je,Responsive as Ye}from"react-grid-layout";import"react-grid-layout/css/styles.css";import{jsx as l,jsxs as z}from"react/jsx-runtime";var ve=new Map,Qe=(e,o)=>{let t=ve.get(e);if(t)return t;let n=Fe(o);return ve.set(e,n),n},xe=()=>{let{width:e,containerRef:o,mounted:t}=je(),{breakPoints:n,profile:a,setProfile:r}=x(),s=a?.items,g=F(()=>Object.keys(Z),[]),d=he({items:s??[]}),C=F(()=>s?.map(u=>u.widget)??[],[s]),W=F(()=>{let u={};return g.forEach(v=>{u[v]=s?.map(c=>c.layouts?.[v]??j(c.widget,!c.is_expanded,v))??[]}),u},[g,s]),I=Q((u,v)=>{r(c=>c&&{...c,items:u}),d.setData({items:u}),d.put(route("widgets.profiles.items.update"),{onError:()=>r(c=>c&&{...c,items:v})})},[d,r]),D=Q((u,v)=>{let c=v;if(ce(W,c,g))return;let w=s??[],M=w.map(_=>({..._,layouts:g.reduce((E,L)=>{let P=(c[L]??[]).find(f=>f.i===String(_.widget.id));return P&&(E[L]=P),E},{})}));I(M,w)},[I,g,W,s]),N=Q(u=>{let v=s??[],c=v.map(w=>{if(w.id!==u)return w;let M=!w.is_expanded,_=g.reduce((E,L)=>{let P=w.layouts?.[L],f=j(w.widget,!M,L);return E[L]={...P??f,i:f.i,x:P?.x??f.x,y:P?.y??f.y,w:P?.w??f.w,h:f.h,minH:f.minH,maxH:f.maxH,minW:f.minW,maxW:f.maxW},E},{});return{...w,is_expanded:M,layouts:_}});I(c,v)},[I,g,s]);return t&&l("div",{ref:o,children:l(Ye,{width:e,layouts:W,breakpoints:n,cols:Z,rowHeight:de,margin:[12,12],containerPadding:[0,0],dragConfig:{enabled:!0,handle:".widget-drag-handle"},resizeConfig:{enabled:!0},onLayoutChange:D,children:C.map(u=>l("div",{className:" overflow-visible",children:l(Ue,{widget:u,onToggleExpand:N})},String(u.id)))})})},Ue=({widget:e,onToggleExpand:o})=>{let{profile:t,setProfile:n}=x(),a=U.get(e.code),r=a?.loader,s=typeof r=="function",g=F(()=>s?Qe(e.code,r):()=>null,[e.code,r,s]),d=t.items.find(D=>D.widget_id===e.id),C=()=>o(d.id),W=he({id:d.id}),I=()=>{let D=t.items??[];n(N=>({...N,items:N?.items?.filter(u=>u.id!==d.id)})),W.delete(route("widgets.profiles.items.destroy"),{onError:()=>n(N=>N&&{...N,items:D})})};return s&&d&&z("div",{className:h(d?.is_expanded?"flex h-full w-full min-h-0 flex-col overflow-hidden rounded-lg border bg-background shadow-sm":""),children:[z("div",{className:h("flex items-center gap-2 widget-drag-handle shrink-0 px-3 py-3 bg-muted/30",d?.is_expanded?"border-b cursor-move select-none":"rounded-lg border shadow-sm"),children:[l(y,{iconName:a?.icon??"IconTag",className:"w-5 h-5 shrink-0"}),l("span",{className:"text-sm font-medium",children:e.title}),z("div",{className:"flex items-center gap-5 ml-auto",children:[l("span",{className:"text-sm text-muted-foreground",children:e.package_code}),z("div",{className:"flex items-center gap-2",children:[l("div",{onClick:()=>C(),children:d?.is_expanded?l(He,{className:"h-5 w-5 cursor-pointer"}):l(Re,{className:"h-5 w-5 cursor-pointer"})}),l("div",{onClick:()=>I(),children:l(Oe,{className:"h-5 w-5 cursor-pointer"})})]})]})]}),d?.is_expanded&&l("div",{className:"flex-1 min-h-0 overflow-auto p-3",children:l(Ze,{fallback:l("div",{className:"flex items-center justify-center w-full h-full",children:z("div",{className:"grid gap-2",children:[l("span",{className:"font-bold",children:e.title}),l(Ge,{className:"animate-spin h-7 w-7 mx-auto"})]})}),children:l(g,{props:e.props})})})]})};export{xe as a,Ue as b,me as c,ge as d,Ct as e};
@@ -1 +1 @@
1
- import{a as E,b as O,c as B,d as D}from"./chunk-2UOSQSPQ.js";import{a as M}from"./chunk-CZM7FKLS.js";import{a as _,d as k,e as z,g as I,h as T}from"./chunk-AW6EOFKV.js";import{a as N}from"./chunk-QKGQOXDM.js";import{b as P}from"./chunk-TVCWAJFT.js";import{a as C}from"./chunk-G22OJQWL.js";import{a as o}from"./chunk-GND5KQRZ.js";import{a as y}from"./chunk-QVUL22EY.js";import*as s from"react";import{Slot as h}from"@radix-ui/react-slot";import{cva as V}from"class-variance-authority";import{IconLayoutSidebar as G}from"@tabler/icons-react";import{jsx as t,jsxs as f}from"react/jsx-runtime";var L="sidebar_state",$=3600*24*7,W="16rem",j="18rem",q="3rem",F="b",A=s.createContext(null);function w(){let a=s.useContext(A);if(!a)throw new Error("useSidebar must be used within a SidebarProvider.");return a}function se({defaultOpen:a=!0,open:e,onOpenChange:r,className:i,style:n,children:c,...m}){let l=y(),[p,u]=s.useState(!1),[v,H]=s.useState(a),g=e??v,x=s.useCallback(d=>{let b=typeof d=="function"?d(g):d;r?r(b):H(b),document.cookie=`${L}=${b}; path=/; max-age=${$}`},[r,g]),S=s.useCallback(()=>l?u(d=>!d):x(d=>!d),[l,x,u]);s.useEffect(()=>{let d=b=>{b.key===F&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),S())};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[S]);let R=g?"expanded":"collapsed",K=s.useMemo(()=>({state:R,open:g,setOpen:x,isMobile:l,openMobile:p,setOpenMobile:u,toggleSidebar:S}),[R,g,x,l,p,u,S]);return t(A.Provider,{value:K,children:t(E,{delayDuration:0,children:t("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":W,"--sidebar-width-icon":q,...n},className:o("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",i),...m,children:c})})})}function de({side:a="left",variant:e="sidebar",collapsible:r="offcanvas",className:i,children:n,...c}){let{isMobile:m,state:l,openMobile:p,setOpenMobile:u}=w();return r==="none"?t("div",{"data-slot":"sidebar",className:o("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",i),...c,children:n}):m?t(_,{open:p,onOpenChange:u,...c,children:f(k,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":j},side:a,children:[f(z,{className:"sr-only",children:[t(I,{children:"Sidebar"}),t(T,{children:"Displays the mobile sidebar."})]}),t("div",{className:"flex h-full w-full flex-col",children:n})]})}):f("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":l,"data-collapsible":l==="collapsed"?r:"","data-variant":e,"data-side":a,"data-slot":"sidebar",children:[t("div",{"data-slot":"sidebar-gap",className:o("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),t("div",{"data-slot":"sidebar-container",className:o("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",a==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",i),...c,children:t("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:n})})]})}function le({className:a,onClick:e,...r}){let{toggleSidebar:i}=w();return f(P,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:o("size-7",a),onClick:n=>{e?.(n),i()},...r,children:[t(G,{}),t("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function ce({className:a,...e}){let{toggleSidebar:r}=w();return t("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:o("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",a),...e})}function ue({className:a,...e}){return t("main",{"data-slot":"sidebar-inset",className:o("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",a),...e})}function be({className:a,...e}){return t(N,{"data-slot":"sidebar-input","data-sidebar":"input",className:o("bg-background h-8 w-full shadow-none",a),...e})}function pe({className:a,...e}){return t("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:o("flex flex-col gap-2 p-2",a),...e})}function fe({className:a,...e}){return t("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:o("flex flex-col gap-2 p-2",a),...e})}function me({className:a,...e}){return t(M,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:o("bg-sidebar-border mx-2 w-auto",a),...e})}function ge({className:a,...e}){return t("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:o("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",a),...e})}function he({className:a,...e}){return t("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:o("relative flex w-full min-w-0 flex-col p-2",a),...e})}function ve({className:a,asChild:e=!1,...r}){return t(e?h:"div",{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:o("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",a),...r})}function xe({className:a,asChild:e=!1,...r}){return t(e?h:"button",{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:o("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",a),...r})}function Se({className:a,...e}){return t("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:o("w-full text-sm",a),...e})}function we({className:a,...e}){return t("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:o("flex w-full min-w-0 flex-col gap-1",a),...e})}function Ce({className:a,...e}){return t("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:o("group/menu-item relative",a),...e})}var U=V("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Re({asChild:a=!1,isActive:e=!1,variant:r="default",size:i="default",tooltip:n,className:c,...m}){let l=a?h:"button",{isMobile:p,state:u}=w(),v=t(l,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":i,"data-active":e,className:o(U({variant:r,size:i}),c),...m});return n?(typeof n=="string"&&(n={children:n}),f(O,{children:[t(B,{asChild:!0,children:v}),t(D,{side:"right",align:"center",hidden:u!=="collapsed"||p,...n})]})):v}function ye({className:a,asChild:e=!1,showOnHover:r=!1,...i}){return t(e?h:"button",{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:o("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",a),...i})}function Pe({className:a,...e}){return t("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:o("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a),...e})}function Ne({className:a,showIcon:e=!1,...r}){let i=s.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return f("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:o("flex h-8 items-center gap-2 rounded-md px-2",a),...r,children:[e&&t(C,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),t(C,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":i}})]})}function Me({className:a,...e}){return t("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:o("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",a),...e})}function _e({className:a,...e}){return t("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:o("group/menu-sub-item relative",a),...e})}function ke({asChild:a=!1,size:e="md",isActive:r=!1,className:i,...n}){return t(a?h:"a",{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":e,"data-active":r,className:o("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",e==="sm"&&"text-xs",e==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",i),...n})}export{w as a,se as b,de as c,le as d,ce as e,ue as f,be as g,pe as h,fe as i,me as j,ge as k,he as l,ve as m,xe as n,Se as o,we as p,Ce as q,Re as r,ye as s,Pe as t,Ne as u,Me as v,_e as w,ke as x};
1
+ import{a as E,b as O,c as B,d as D}from"./chunk-2UOSQSPQ.js";import{a as _,d as k,e as z,g as I,h as T}from"./chunk-AW6EOFKV.js";import{a as M}from"./chunk-CZM7FKLS.js";import{a as N}from"./chunk-QKGQOXDM.js";import{b as P}from"./chunk-TVCWAJFT.js";import{a as C}from"./chunk-G22OJQWL.js";import{a as y}from"./chunk-QVUL22EY.js";import{a as o}from"./chunk-GND5KQRZ.js";import*as s from"react";import{Slot as h}from"@radix-ui/react-slot";import{cva as V}from"class-variance-authority";import{IconLayoutSidebar as G}from"@tabler/icons-react";import{jsx as t,jsxs as f}from"react/jsx-runtime";var L="sidebar_state",$=3600*24*7,W="16rem",j="18rem",q="3rem",F="b",A=s.createContext(null);function w(){let a=s.useContext(A);if(!a)throw new Error("useSidebar must be used within a SidebarProvider.");return a}function se({defaultOpen:a=!0,open:e,onOpenChange:r,className:i,style:n,children:c,...m}){let l=y(),[p,u]=s.useState(!1),[v,H]=s.useState(a),g=e??v,x=s.useCallback(d=>{let b=typeof d=="function"?d(g):d;r?r(b):H(b),document.cookie=`${L}=${b}; path=/; max-age=${$}`},[r,g]),S=s.useCallback(()=>l?u(d=>!d):x(d=>!d),[l,x,u]);s.useEffect(()=>{let d=b=>{b.key===F&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),S())};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[S]);let R=g?"expanded":"collapsed",K=s.useMemo(()=>({state:R,open:g,setOpen:x,isMobile:l,openMobile:p,setOpenMobile:u,toggleSidebar:S}),[R,g,x,l,p,u,S]);return t(A.Provider,{value:K,children:t(E,{delayDuration:0,children:t("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":W,"--sidebar-width-icon":q,...n},className:o("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",i),...m,children:c})})})}function de({side:a="left",variant:e="sidebar",collapsible:r="offcanvas",className:i,children:n,...c}){let{isMobile:m,state:l,openMobile:p,setOpenMobile:u}=w();return r==="none"?t("div",{"data-slot":"sidebar",className:o("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",i),...c,children:n}):m?t(_,{open:p,onOpenChange:u,...c,children:f(k,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":j},side:a,children:[f(z,{className:"sr-only",children:[t(I,{children:"Sidebar"}),t(T,{children:"Displays the mobile sidebar."})]}),t("div",{className:"flex h-full w-full flex-col",children:n})]})}):f("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":l,"data-collapsible":l==="collapsed"?r:"","data-variant":e,"data-side":a,"data-slot":"sidebar",children:[t("div",{"data-slot":"sidebar-gap",className:o("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),t("div",{"data-slot":"sidebar-container",className:o("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",a==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",i),...c,children:t("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:n})})]})}function le({className:a,onClick:e,...r}){let{toggleSidebar:i}=w();return f(P,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:o("size-7",a),onClick:n=>{e?.(n),i()},...r,children:[t(G,{}),t("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function ce({className:a,...e}){let{toggleSidebar:r}=w();return t("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:o("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",a),...e})}function ue({className:a,...e}){return t("main",{"data-slot":"sidebar-inset",className:o("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",a),...e})}function be({className:a,...e}){return t(N,{"data-slot":"sidebar-input","data-sidebar":"input",className:o("bg-background h-8 w-full shadow-none",a),...e})}function pe({className:a,...e}){return t("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:o("flex flex-col gap-2 p-2",a),...e})}function fe({className:a,...e}){return t("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:o("flex flex-col gap-2 p-2",a),...e})}function me({className:a,...e}){return t(M,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:o("bg-sidebar-border mx-2 w-auto",a),...e})}function ge({className:a,...e}){return t("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:o("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",a),...e})}function he({className:a,...e}){return t("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:o("relative flex w-full min-w-0 flex-col p-2",a),...e})}function ve({className:a,asChild:e=!1,...r}){return t(e?h:"div",{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:o("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",a),...r})}function xe({className:a,asChild:e=!1,...r}){return t(e?h:"button",{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:o("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",a),...r})}function Se({className:a,...e}){return t("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:o("w-full text-sm",a),...e})}function we({className:a,...e}){return t("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:o("flex w-full min-w-0 flex-col gap-1",a),...e})}function Ce({className:a,...e}){return t("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:o("group/menu-item relative",a),...e})}var U=V("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Re({asChild:a=!1,isActive:e=!1,variant:r="default",size:i="default",tooltip:n,className:c,...m}){let l=a?h:"button",{isMobile:p,state:u}=w(),v=t(l,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":i,"data-active":e,className:o(U({variant:r,size:i}),c),...m});return n?(typeof n=="string"&&(n={children:n}),f(O,{children:[t(B,{asChild:!0,children:v}),t(D,{side:"right",align:"center",hidden:u!=="collapsed"||p,...n})]})):v}function ye({className:a,asChild:e=!1,showOnHover:r=!1,...i}){return t(e?h:"button",{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:o("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",a),...i})}function Pe({className:a,...e}){return t("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:o("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a),...e})}function Ne({className:a,showIcon:e=!1,...r}){let i=s.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return f("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:o("flex h-8 items-center gap-2 rounded-md px-2",a),...r,children:[e&&t(C,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),t(C,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":i}})]})}function Me({className:a,...e}){return t("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:o("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",a),...e})}function _e({className:a,...e}){return t("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:o("group/menu-sub-item relative",a),...e})}function ke({asChild:a=!1,size:e="md",isActive:r=!1,className:i,...n}){return t(a?h:"a",{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":e,"data-active":r,className:o("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",e==="sm"&&"text-xs",e==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",i),...n})}export{w as a,se as b,de as c,le as d,ce as e,ue as f,be as g,pe as h,fe as i,me as j,ge as k,he as l,ve as m,xe as n,Se as o,we as p,Ce as q,Re as r,ye as s,Pe as t,Ne as u,Me as v,_e as w,ke as x};