@cobaltcore-dev/aurora 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist/client/App.d.ts +2 -1
  2. package/dist/client/AuroraApp.d.ts +25 -0
  3. package/dist/client/{AuthProvider-5TyZKZkx.mjs → AuthProvider-BS5OVv8n.mjs} +2 -2
  4. package/dist/client/AuthProvider-BS5OVv8n.mjs.map +1 -0
  5. package/dist/client/{ContentHeader-D64NtKvo.mjs → ContentHeader-BHMUzd9H.mjs} +16 -16
  6. package/dist/client/{ContentHeader-D64NtKvo.mjs.map → ContentHeader-BHMUzd9H.mjs.map} +1 -1
  7. package/dist/client/{DeleteFlavorModal-C2K43ABZ.mjs → DeleteFlavorModal-BP83t9zX.mjs} +283 -294
  8. package/dist/client/DeleteFlavorModal-BP83t9zX.mjs.map +1 -0
  9. package/dist/client/{FiltersInput-Bw8TFfwb.mjs → FiltersInput-B8CNBg1L.mjs} +23 -23
  10. package/dist/client/{FiltersInput-Bw8TFfwb.mjs.map → FiltersInput-B8CNBg1L.mjs.map} +1 -1
  11. package/dist/client/{FloatingIpActionModals-BfEDfYg9.mjs → FloatingIpActionModals-BraiJWBi.mjs} +48 -48
  12. package/dist/client/{FloatingIpActionModals-BfEDfYg9.mjs.map → FloatingIpActionModals-BraiJWBi.mjs.map} +1 -1
  13. package/dist/client/ImageToastNotifications-BXMHJaIH.mjs +1131 -0
  14. package/dist/client/ImageToastNotifications-BXMHJaIH.mjs.map +1 -0
  15. package/dist/client/{RouteError-B-NPGIv7.mjs → RouteError-hAF8_jbe.mjs} +2 -2
  16. package/dist/client/{RouteError-B-NPGIv7.mjs.map → RouteError-hAF8_jbe.mjs.map} +1 -1
  17. package/dist/client/{SortInput-DysAXpB3.mjs → SortInput-Cqs2poV3.mjs} +7 -7
  18. package/dist/client/{SortInput-DysAXpB3.mjs.map → SortInput-Cqs2poV3.mjs.map} +1 -1
  19. package/dist/client/{StatusError-DX-GvLjq.mjs → StatusError-C5KodQOq.mjs} +4 -4
  20. package/dist/client/{StatusError-DX-GvLjq.mjs.map → StatusError-C5KodQOq.mjs.map} +1 -1
  21. package/dist/client/{TwoColumnDescriptionList-B3xunXmz.mjs → TwoColumnDescriptionList-DiDx3PnH.mjs} +6 -6
  22. package/dist/client/{TwoColumnDescriptionList-B3xunXmz.mjs.map → TwoColumnDescriptionList-DiDx3PnH.mjs.map} +1 -1
  23. package/dist/client/{_auth-R5H2yKFf.mjs → _auth-DJ9wHZaj.mjs} +2 -2
  24. package/dist/client/{_auth-R5H2yKFf.mjs.map → _auth-DJ9wHZaj.mjs.map} +1 -1
  25. package/dist/client/{_flavorId-Zj7LNL-R.mjs → _flavorId-BN_qessZ.mjs} +2 -2
  26. package/dist/client/{_flavorId-Zj7LNL-R.mjs.map → _flavorId-BN_qessZ.mjs.map} +1 -1
  27. package/dist/client/{_flavorId-Dit5mM8I.mjs → _flavorId-CJjEB_Ao.mjs} +34 -34
  28. package/dist/client/{_flavorId-Dit5mM8I.mjs.map → _flavorId-CJjEB_Ao.mjs.map} +1 -1
  29. package/dist/client/{_floatingIpId-DCQQpNO-.mjs → _floatingIpId-CwDGHkWm.mjs} +2 -2
  30. package/dist/client/{_floatingIpId-DCQQpNO-.mjs.map → _floatingIpId-CwDGHkWm.mjs.map} +1 -1
  31. package/dist/client/{_floatingIpId-B0MCoqE3.mjs → _floatingIpId-foMIwbE4.mjs} +23 -23
  32. package/dist/client/{_floatingIpId-B0MCoqE3.mjs.map → _floatingIpId-foMIwbE4.mjs.map} +1 -1
  33. package/dist/client/_imageId-BtJ7GmYB.mjs +558 -0
  34. package/dist/client/{_imageId-CZYzBAVx.mjs.map → _imageId-BtJ7GmYB.mjs.map} +1 -1
  35. package/dist/client/{_projectId-DhSWowQo.mjs → _projectId-BmtCuzJu.mjs} +4 -4
  36. package/dist/client/{_projectId-DhSWowQo.mjs.map → _projectId-BmtCuzJu.mjs.map} +1 -1
  37. package/dist/client/_projectId-Byt3GQDW.mjs +99 -0
  38. package/dist/client/_projectId-Byt3GQDW.mjs.map +1 -0
  39. package/dist/client/_projectId-NYk1IN_a.mjs +291 -0
  40. package/dist/client/_projectId-NYk1IN_a.mjs.map +1 -0
  41. package/dist/client/{_projectId-D2pFfYIs.mjs → _projectId-QueiFczy.mjs} +3 -3
  42. package/dist/client/{_projectId-D2pFfYIs.mjs.map → _projectId-QueiFczy.mjs.map} +1 -1
  43. package/dist/client/{_securityGroupId-Mj8NJT2-.mjs → _securityGroupId-BcbkRhsN.mjs} +2 -2
  44. package/dist/client/{_securityGroupId-Mj8NJT2-.mjs.map → _securityGroupId-BcbkRhsN.mjs.map} +1 -1
  45. package/dist/client/{_securityGroupId-DZ4D4WwB.mjs → _securityGroupId-pPtJsCoe.mjs} +438 -442
  46. package/dist/client/{_securityGroupId-DZ4D4WwB.mjs.map → _securityGroupId-pPtJsCoe.mjs.map} +1 -1
  47. package/dist/client/_storageType-BmqrU06i.mjs +2202 -0
  48. package/dist/client/_storageType-BmqrU06i.mjs.map +1 -0
  49. package/dist/client/{about-WLyShNgE.mjs → about-_73VmpTB.mjs} +2 -2
  50. package/dist/client/{about-WLyShNgE.mjs.map → about-_73VmpTB.mjs.map} +1 -1
  51. package/dist/client/assets/{objectDownload.worker-BXFQIIU_.js.map → objectDownload.worker-CWWLPDyb.js.map} +1 -1
  52. package/dist/client/assets/{objectDownload.worker-ECvFtmOF.js.map → objectDownload.worker-kZlQuo3F.js.map} +1 -1
  53. package/dist/client/{aurora-IMO9HhqJ.mjs → aurora-EbwGRLLf.mjs} +2 -2
  54. package/dist/client/{aurora-IMO9HhqJ.mjs.map → aurora-EbwGRLLf.mjs.map} +1 -1
  55. package/dist/client/{build-DnD-T35u.mjs → build-C_4vRMCq.mjs} +2233 -2662
  56. package/dist/client/{build-DnD-T35u.mjs.map → build-C_4vRMCq.mjs.map} +1 -1
  57. package/dist/client/{flavors-Cp0LEGOH.mjs → flavors-CiHCYrtZ.mjs} +2 -2
  58. package/dist/client/{flavors-Cp0LEGOH.mjs.map → flavors-CiHCYrtZ.mjs.map} +1 -1
  59. package/dist/client/{flavors-CwMbDRHm2.mjs → flavors-DY-bDc8l.mjs} +164 -164
  60. package/dist/client/flavors-DY-bDc8l.mjs.map +1 -0
  61. package/dist/client/{floatingips-ICwo-rV_.mjs → floatingips-Ci4jHkaG.mjs} +177 -177
  62. package/dist/client/{floatingips-ICwo-rV_.mjs.map → floatingips-Ci4jHkaG.mjs.map} +1 -1
  63. package/dist/client/{hooks-CrriowRk.mjs → hooks-LutR2Yg3.mjs} +2 -2
  64. package/dist/client/{hooks-CrriowRk.mjs.map → hooks-LutR2Yg3.mjs.map} +1 -1
  65. package/dist/client/images-91U7tr9Y2.mjs +1976 -0
  66. package/dist/client/images-91U7tr9Y2.mjs.map +1 -0
  67. package/dist/client/{images-DWiM_72I.mjs → images-CS4kZQyu.mjs} +2 -2
  68. package/dist/client/{images-DWiM_72I.mjs.map → images-CS4kZQyu.mjs.map} +1 -1
  69. package/dist/client/index.d.ts +4 -1
  70. package/dist/client/index.js +444 -586
  71. package/dist/client/index.js.map +1 -1
  72. package/dist/client/{md-DNzcRhmz.mjs → md-kvaGCNAK.mjs} +4 -22
  73. package/dist/client/{md-DNzcRhmz.mjs.map → md-kvaGCNAK.mjs.map} +1 -1
  74. package/dist/client/{objects-DeK2WD5K.mjs → objects-C3azvW8m.mjs} +2019 -2023
  75. package/dist/client/{objects-DeK2WD5K.mjs.map → objects-C3azvW8m.mjs.map} +1 -1
  76. package/dist/client/{objects-DI1-tnKr.mjs → objects-CM265S6b.mjs} +2 -2
  77. package/dist/client/{objects-DI1-tnKr.mjs.map → objects-CM265S6b.mjs.map} +1 -1
  78. package/dist/client/{objects-D2MKUCxc.mjs → objects-EE9Cd1wI.mjs} +2 -2
  79. package/dist/client/{objects-D2MKUCxc.mjs.map → objects-EE9Cd1wI.mjs.map} +1 -1
  80. package/dist/client/{routeInfo-CdTRlSxv.mjs → routeInfo-DXqB2HCf.mjs} +3 -3
  81. package/dist/client/routeInfo-DXqB2HCf.mjs.map +1 -0
  82. package/dist/client/router.d.ts +2 -1
  83. package/dist/client/{routes-DOJr5onJ.mjs → routes-CBd8CCuM.mjs} +13 -13
  84. package/dist/client/{routes-DOJr5onJ.mjs.map → routes-CBd8CCuM.mjs.map} +1 -1
  85. package/dist/client/{routes-B05u5bk4.mjs → routes-CdDm-hhO.mjs} +2 -2
  86. package/dist/client/{routes-B05u5bk4.mjs.map → routes-CdDm-hhO.mjs.map} +1 -1
  87. package/dist/client/{securitygroups-Be2Qgmew.mjs → securitygroups-Bd_uV4S9.mjs} +198 -198
  88. package/dist/client/{securitygroups-Be2Qgmew.mjs.map → securitygroups-Bd_uV4S9.mjs.map} +1 -1
  89. package/dist/client/{securitygroups-_7SYN2jN.mjs → securitygroups-Byte-iSp.mjs} +2 -2
  90. package/dist/client/{securitygroups-_7SYN2jN.mjs.map → securitygroups-Byte-iSp.mjs.map} +1 -1
  91. package/dist/client/services-D1PbooD1.mjs +6 -0
  92. package/dist/client/services-D1PbooD1.mjs.map +1 -0
  93. package/dist/client/services-DEMVtFyn.mjs +9 -0
  94. package/dist/client/services-DEMVtFyn.mjs.map +1 -0
  95. package/dist/client/trpcClient.d.ts +18 -367
  96. package/dist/client/{useSecurityGroupPermissions-qPwm4mFt.mjs → useSecurityGroupPermissions-C29mzb3b.mjs} +15 -15
  97. package/dist/client/{useSecurityGroupPermissions-qPwm4mFt.mjs.map → useSecurityGroupPermissions-C29mzb3b.mjs.map} +1 -1
  98. package/dist/server/index.d.ts +43 -369
  99. package/dist/server/index.js +71 -276
  100. package/package.json +1 -3
  101. package/dist/client/AuthProvider-5TyZKZkx.mjs.map +0 -1
  102. package/dist/client/DeleteFlavorModal-C2K43ABZ.mjs.map +0 -1
  103. package/dist/client/DeletePcaModal-D9v8E0Ki.mjs +0 -92
  104. package/dist/client/DeletePcaModal-D9v8E0Ki.mjs.map +0 -1
  105. package/dist/client/DetailsInfo-h7rPJ4Jf.mjs +0 -61
  106. package/dist/client/DetailsInfo-h7rPJ4Jf.mjs.map +0 -1
  107. package/dist/client/ImageToastNotifications-C0Tluzq-.mjs +0 -1125
  108. package/dist/client/ImageToastNotifications-C0Tluzq-.mjs.map +0 -1
  109. package/dist/client/_imageId-CZYzBAVx.mjs +0 -558
  110. package/dist/client/_pcaId-CHRRsWmO.mjs +0 -605
  111. package/dist/client/_pcaId-CHRRsWmO.mjs.map +0 -1
  112. package/dist/client/_projectId-B8wWSxPu.mjs +0 -98
  113. package/dist/client/_projectId-B8wWSxPu.mjs.map +0 -1
  114. package/dist/client/_projectId-C5DUYIjt.mjs +0 -291
  115. package/dist/client/_projectId-C5DUYIjt.mjs.map +0 -1
  116. package/dist/client/_storageType-C-9bNkmZ.mjs +0 -2211
  117. package/dist/client/_storageType-C-9bNkmZ.mjs.map +0 -1
  118. package/dist/client/flavors-CwMbDRHm2.mjs.map +0 -1
  119. package/dist/client/images-DOGZmr3D.mjs +0 -1937
  120. package/dist/client/images-DOGZmr3D.mjs.map +0 -1
  121. package/dist/client/pca-BokFv4Gz.mjs +0 -239
  122. package/dist/client/pca-BokFv4Gz.mjs.map +0 -1
  123. package/dist/client/pca-D5jHAl0b.mjs +0 -26
  124. package/dist/client/pca-D5jHAl0b.mjs.map +0 -1
  125. package/dist/client/pcaAccess-Br4kVjLQ.mjs +0 -9
  126. package/dist/client/pcaAccess-Br4kVjLQ.mjs.map +0 -1
  127. package/dist/client/routeInfo-CdTRlSxv.mjs.map +0 -1
@@ -0,0 +1,558 @@
1
+ import { A as e, E as t, F as n, O as r, R as i, W as a, X as o, a as s, c, g as l, it as u, j as d, n as f, nt as p, s as m, x as h } from "./build-C_4vRMCq.mjs";
2
+ import { a as g } from "./trpcClient-D7gpR7YG.mjs";
3
+ import { n as _, t as ee } from "./ContentHeader-BHMUzd9H.mjs";
4
+ import { t as v } from "./TwoColumnDescriptionList-DiDx3PnH.mjs";
5
+ import { A as y, D as te, E as ne, F as b, I as x, N as re, O as ie, P as S, T as ae, d as oe, k as se, u as ce } from "./ImageToastNotifications-BXMHJaIH.mjs";
6
+ import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
7
+ import E, { useState as D } from "react";
8
+ import { useNavigate as le, useParams as ue, useSearch as de } from "@tanstack/react-router";
9
+ import { Trans as O, useLingui as k } from "@lingui/react";
10
+ //#region src/client/routes/_auth/projects/$projectId/compute/-components/Images/-components/ImageDetailsView.tsx
11
+ var A = ({ image: e, myMemberData: t, canUpdateMember: n, onStatusChange: r, isLoading: a }) => {
12
+ let { i18n: o, _: c } = k(), l = t.status === b.PENDING, u = t.status === b.REJECTED, f = t.created_at ? new Date(t.created_at).toLocaleString() : o._({ id: "fj5byd" }), p = t.updated_at ? new Date(t.updated_at).toLocaleString() : o._({ id: "fj5byd" }), m = e.owner ?? "";
13
+ return /*#__PURE__*/ T(i, { children: [
14
+ l && /*#__PURE__*/ w("p", {
15
+ className: "text-theme-highest font-semibold",
16
+ children: /*#__PURE__*/ w(O, { id: "/EcdUM" })
17
+ }),
18
+ /*#__PURE__*/ w("p", { children: /*#__PURE__*/ w(O, {
19
+ id: "Uwo8Xw",
20
+ values: {
21
+ ownerProject: m,
22
+ sharedAt: f
23
+ },
24
+ components: { 0: /*#__PURE__*/ w("span", { className: "font-semibold" }) }
25
+ }) }),
26
+ /*#__PURE__*/ T("ul", { children: [
27
+ /*#__PURE__*/ T("li", { children: [
28
+ /*#__PURE__*/ w("span", {
29
+ className: "font-semibold",
30
+ children: /*#__PURE__*/ w(O, { id: "azXlY+" })
31
+ }),
32
+ " ",
33
+ t.status
34
+ ] }),
35
+ /*#__PURE__*/ T("li", { children: [
36
+ /*#__PURE__*/ w("span", {
37
+ className: "font-semibold",
38
+ children: /*#__PURE__*/ w(O, { id: "G6AP+o" })
39
+ }),
40
+ " ",
41
+ f
42
+ ] }),
43
+ /*#__PURE__*/ T("li", { children: [
44
+ /*#__PURE__*/ w("span", {
45
+ className: "font-semibold",
46
+ children: /*#__PURE__*/ w(O, { id: "pFg+7w" })
47
+ }),
48
+ " ",
49
+ p
50
+ ] })
51
+ ] }),
52
+ n && (l || u) && /*#__PURE__*/ T(d, { children: [/*#__PURE__*/ w(s, {
53
+ onClick: () => r(b.ACCEPTED),
54
+ disabled: a,
55
+ children: /*#__PURE__*/ w(O, { id: "g3UF2V" })
56
+ }), l && /*#__PURE__*/ w(s, {
57
+ onClick: () => r(b.REJECTED),
58
+ disabled: a,
59
+ children: /*#__PURE__*/ w(O, { id: "1t/NnN" })
60
+ })] })
61
+ ] });
62
+ }, j = ({ image: t }) => {
63
+ let { i18n: n, _: r } = k(), i = [
64
+ {
65
+ label: n._({ id: "S0kLOH" }),
66
+ value: /*#__PURE__*/ w(_, { text: t.id })
67
+ },
68
+ {
69
+ label: n._({ id: "6YtxFj" }),
70
+ value: t.name
71
+ },
72
+ {
73
+ label: n._({ id: "uAQUqI" }),
74
+ value: t.status
75
+ },
76
+ {
77
+ label: n._({ id: "Cj2Gtd" }),
78
+ value: /*#__PURE__*/ w(x, { size: t.size })
79
+ },
80
+ {
81
+ label: n._({ id: "Cxgv2U" }),
82
+ value: `${t.min_disk} GB`
83
+ },
84
+ {
85
+ label: n._({ id: "B2Czeb" }),
86
+ value: `${t.min_ram} MB`
87
+ },
88
+ {
89
+ label: n._({ id: "NopYGU" }),
90
+ value: /*#__PURE__*/ w("span", {
91
+ className: "uppercase",
92
+ children: t.disk_format
93
+ })
94
+ },
95
+ {
96
+ label: n._({ id: "6/xipy" }),
97
+ value: /*#__PURE__*/ w("span", {
98
+ className: "uppercase",
99
+ children: t.container_format
100
+ })
101
+ },
102
+ {
103
+ label: n._({ id: "88kg0+" }),
104
+ value: t.created_at ? new Date(t.created_at).toLocaleDateString() : n._({ id: "fj5byd" })
105
+ },
106
+ {
107
+ label: n._({ id: "Llcakz" }),
108
+ value: t.updated_at ? new Date(t.updated_at).toLocaleDateString() : n._({ id: "fj5byd" })
109
+ }
110
+ ];
111
+ return /*#__PURE__*/ T(e, {
112
+ px: !1,
113
+ py: !0,
114
+ children: [/*#__PURE__*/ w(p, { children: n._({ id: "nW/hX9" }) }), /*#__PURE__*/ w(v, { items: i })]
115
+ });
116
+ }, M = ({ image: t, currentProjectId: n }) => {
117
+ let { i18n: r, _: i } = k(), a = [
118
+ {
119
+ label: t.visibility === "shared" && t.owner !== void 0 && t.owner !== n ? r._({ id: "20axE5" }) : r._({ id: "YsrbQh" }),
120
+ value: t.owner ? /*#__PURE__*/ w(_, { text: t.owner }) : ""
121
+ },
122
+ {
123
+ label: r._({ id: "2q/Q7x" }),
124
+ value: t.visibility
125
+ },
126
+ {
127
+ label: r._({ id: "644xgx" }),
128
+ value: t.protected ? r._({ id: "l75CjT" }) : r._({ id: "1UzENP" })
129
+ },
130
+ {
131
+ label: r._({ id: "PzgYM9" }),
132
+ value: t?.checksum ? t.checksum : ""
133
+ }
134
+ ];
135
+ return /*#__PURE__*/ T(e, {
136
+ px: !1,
137
+ py: !0,
138
+ children: [/*#__PURE__*/ w(p, { children: r._({ id: "a3LDKx" }) }), /*#__PURE__*/ w(v, { items: a })]
139
+ });
140
+ }, N = ({ image: n }) => {
141
+ let { i18n: r, _: i } = k(), a = /* @__PURE__ */ new Set([
142
+ "id",
143
+ "name",
144
+ "status",
145
+ "visibility",
146
+ "size",
147
+ "disk_format",
148
+ "container_format",
149
+ "min_disk",
150
+ "min_ram",
151
+ "owner",
152
+ "protected",
153
+ "created_at",
154
+ "updated_at",
155
+ "checksum"
156
+ ]), o = Object.entries(n).filter(([e]) => !a.has(e)).sort(([e], [t]) => e.localeCompare(t)), s = o.length > 0;
157
+ return /*#__PURE__*/ T(e, {
158
+ px: !1,
159
+ py: !0,
160
+ children: [/*#__PURE__*/ w(p, { children: r._({ id: "bc67JN" }) }), s ? /*#__PURE__*/ w(m, {
161
+ alignTerms: "right",
162
+ className: "grid-cols-4",
163
+ children: o.map(([e, n]) => /*#__PURE__*/ T(E.Fragment, { children: [/*#__PURE__*/ w(f, {
164
+ className: "col-span-1",
165
+ children: e
166
+ }), /*#__PURE__*/ w(t, {
167
+ className: "col-span-1",
168
+ children: n == null ? /*#__PURE__*/ w("span", { children: "null" }) : typeof n == "object" ? /*#__PURE__*/ w("span", {
169
+ className: "break-all",
170
+ children: JSON.stringify(n)
171
+ }) : typeof n == "boolean" ? n ? r._({ id: "c+xCSz" }) : r._({ id: "ocUvR+" }) : /*#__PURE__*/ w("span", {
172
+ className: "break-all",
173
+ children: String(n)
174
+ })
175
+ })] }, e))
176
+ }) : /*#__PURE__*/ w("p", {
177
+ className: "text-theme-light",
178
+ children: r._({ id: "9v5VLp" })
179
+ })]
180
+ });
181
+ }, P = (e) => {
182
+ let t = "px-6 py-3 font-semibold border-b-2 transition-colors";
183
+ return e ? `${t} border-theme-accent text-theme-highest` : `${t} border-transparent text-theme-secondary hover:text-theme-high`;
184
+ }, F = ({ image: t, permissions: r, currentProjectId: i }) => {
185
+ let [a, o] = D(!1), [s, c] = D(null), { data: l, isLoading: u } = g.compute.listImageMembers.useQuery({
186
+ project_id: i,
187
+ imageId: t.id
188
+ }, { enabled: !!t.id && !!i });
189
+ return /*#__PURE__*/ T(e, {
190
+ px: !1,
191
+ py: !0,
192
+ children: [s && /*#__PURE__*/ w(n, {
193
+ text: s.text,
194
+ variant: s.type,
195
+ onDismiss: () => c(null),
196
+ className: "mb-4"
197
+ }), /*#__PURE__*/ w(y, {
198
+ image: t,
199
+ imageMembers: l,
200
+ isMembersLoading: u,
201
+ canAdd: r?.canCreateMember ?? !1,
202
+ canRemove: r?.canDeleteMember ?? !1,
203
+ isAddingMember: a,
204
+ setIsAddingMember: o,
205
+ setMessage: c,
206
+ projectId: i
207
+ })]
208
+ });
209
+ }, fe = ({ image: e, currentProjectId: t, activeTab: n = "details", onTabChange: r, permissions: i, myMemberData: a, onMemberStatusChange: s, isMemberStatusChanging: c, actions: l }) => {
210
+ let { i18n: u, _: d } = k(), f = e.visibility === "shared" && e.owner !== void 0 && e.owner !== t, p = e.owner === t && e.visibility === "shared";
211
+ return /*#__PURE__*/ T(o, {
212
+ direction: "vertical",
213
+ gap: "6",
214
+ children: [
215
+ f && a && s && /*#__PURE__*/ w(A, {
216
+ image: e,
217
+ myMemberData: a,
218
+ canUpdateMember: i?.canUpdateMember ?? !1,
219
+ onStatusChange: s,
220
+ isLoading: c ?? !1
221
+ }),
222
+ p && /*#__PURE__*/ w("div", {
223
+ className: "border-theme-background-lvl-3 border-b",
224
+ children: /*#__PURE__*/ T(o, {
225
+ direction: "horizontal",
226
+ gap: "0",
227
+ children: [/*#__PURE__*/ w("button", {
228
+ className: P(n === "details"),
229
+ onClick: () => r?.("details"),
230
+ children: u._({ id: "URmyfc" })
231
+ }), /*#__PURE__*/ w("button", {
232
+ className: P(n === "sharing"),
233
+ onClick: () => r?.("sharing"),
234
+ children: u._({ id: "aG9OiI" })
235
+ })]
236
+ })
237
+ }),
238
+ (n === "details" || !p) && /*#__PURE__*/ T(C, { children: [
239
+ l,
240
+ /*#__PURE__*/ w(j, { image: e }),
241
+ /*#__PURE__*/ w(M, {
242
+ image: e,
243
+ currentProjectId: t
244
+ }),
245
+ /*#__PURE__*/ w(N, { image: e })
246
+ ] }),
247
+ n === "sharing" && p && /*#__PURE__*/ w(F, {
248
+ image: e,
249
+ permissions: i
250
+ })
251
+ ]
252
+ });
253
+ };
254
+ //#endregion
255
+ //#region src/client/routes/_auth/projects/$projectId/compute/images/$imageId.tsx?tsr-split=component
256
+ function I() {
257
+ let { projectId: e, imageId: t } = ue({ from: "/_auth/projects/$projectId/compute/images/$imageId" }), { tab: n } = de({ from: "/_auth/projects/$projectId/compute/images/$imageId" }), i = le(), { i18n: f, _: p } = k(), { data: m, status: _, error: v } = g.compute.getImageById.useQuery({
258
+ project_id: e,
259
+ imageId: t
260
+ }), { data: y } = g.compute.canUser.useQuery({
261
+ project_id: e,
262
+ permission: [
263
+ "images:delete",
264
+ "images:update",
265
+ "images:create_member",
266
+ "images:delete_member",
267
+ "images:update_member"
268
+ ]
269
+ }), b = {
270
+ canDelete: y?.[0] ?? !1,
271
+ canUpdate: y?.[1] ?? !1,
272
+ canCreateMember: y?.[2] ?? !1,
273
+ canDeleteMember: y?.[3] ?? !1,
274
+ canUpdateMember: y?.[4] ?? !1
275
+ }, x = g.useUtils(), [E, A] = D(!1), [j, M] = D(!1), [N, P] = D(!1), [F, I] = D(!1), [L, R] = D(!1), z = g.compute.updateImage.useMutation({ onSuccess: (n) => {
276
+ x.compute.getImageById.setData({
277
+ project_id: e,
278
+ imageId: t
279
+ }, n), x.compute.listImagesWithPagination.invalidate();
280
+ } }), B = g.compute.deleteImage.useMutation({ onSuccess: () => {
281
+ x.compute.listImagesWithPagination.invalidate();
282
+ } }), V = g.compute.deactivateImage.useMutation({ onSuccess: () => {
283
+ x.compute.getImageById.invalidate({
284
+ project_id: e,
285
+ imageId: t
286
+ });
287
+ } }), H = g.compute.reactivateImage.useMutation({ onSuccess: () => {
288
+ x.compute.getImageById.invalidate({
289
+ project_id: e,
290
+ imageId: t
291
+ });
292
+ } }), U = g.compute.updateImageVisibility.useMutation({ onSuccess: (n) => {
293
+ x.compute.getImageById.setData({
294
+ project_id: e,
295
+ imageId: t
296
+ }, n);
297
+ } }), W = m?.visibility === S.SHARED && m?.owner !== void 0 && m?.owner !== e, { data: G } = g.compute.getImageMember.useQuery({
298
+ project_id: e,
299
+ imageId: t,
300
+ memberId: e
301
+ }, { enabled: W && !!t && !!e }), K = g.compute.updateImageMember.useMutation({ onSuccess: () => {
302
+ x.compute.getImageMember.invalidate({
303
+ project_id: e,
304
+ imageId: t,
305
+ memberId: e
306
+ }), x.compute.listImageMembers.invalidate({
307
+ project_id: e,
308
+ imageId: t
309
+ }), x.compute.listImagesWithPagination.invalidate(), x.compute.listSharedImagesByMemberStatus.invalidate();
310
+ } }), q = async (n) => {
311
+ try {
312
+ await K.mutateAsync({
313
+ project_id: e,
314
+ imageId: t,
315
+ memberId: e,
316
+ status: n
317
+ });
318
+ let { message: r, ...i } = oe(n);
319
+ u.info(r, i);
320
+ } catch (e) {
321
+ let t = e?.message, { message: n, ...r } = ce(t);
322
+ u.error(n, r);
323
+ }
324
+ }, J = () => {
325
+ i({
326
+ to: "/projects/$projectId/compute/images",
327
+ params: { projectId: e }
328
+ });
329
+ }, Y = z.isPending || B.isPending || V.isPending || H.isPending || U.isPending, pe = (e, t) => {
330
+ let n = [];
331
+ return Object.entries(e).forEach(([e, r]) => {
332
+ let i = `/${e}`;
333
+ if (r == null) e in t && n.push({
334
+ op: "remove",
335
+ path: i
336
+ });
337
+ else {
338
+ let a = e in t;
339
+ n.push({
340
+ op: a ? "replace" : "add",
341
+ path: i,
342
+ value: r
343
+ });
344
+ }
345
+ }), n;
346
+ }, X = async (n) => {
347
+ if (!m) return !1;
348
+ let r = pe(n, m);
349
+ try {
350
+ return await z.mutateAsync({
351
+ project_id: e,
352
+ imageId: t,
353
+ operations: r
354
+ }), A(!1), !0;
355
+ } catch {
356
+ return !1;
357
+ }
358
+ }, me = async (t) => {
359
+ try {
360
+ await B.mutateAsync({
361
+ project_id: e,
362
+ imageId: t.id
363
+ }), P(!1), J();
364
+ } catch {
365
+ P(!1);
366
+ }
367
+ }, he = async (t) => {
368
+ try {
369
+ await H.mutateAsync({
370
+ project_id: e,
371
+ imageId: t.id
372
+ }), I(!1);
373
+ } catch {
374
+ I(!1);
375
+ }
376
+ }, ge = async (t) => {
377
+ try {
378
+ await V.mutateAsync({
379
+ project_id: e,
380
+ imageId: t.id
381
+ }), R(!1);
382
+ } catch {
383
+ R(!1);
384
+ }
385
+ }, _e = async (t) => {
386
+ if (m) try {
387
+ await U.mutateAsync({
388
+ project_id: e,
389
+ imageId: m.id,
390
+ visibility: t
391
+ });
392
+ } catch {}
393
+ };
394
+ if (_ === "pending") return /*#__PURE__*/ T(o, {
395
+ className: "fixed inset-0",
396
+ distribution: "center",
397
+ alignment: "center",
398
+ direction: "vertical",
399
+ children: [/*#__PURE__*/ w(a, {
400
+ variant: "primary",
401
+ size: "large",
402
+ className: "mb-2"
403
+ }), /*#__PURE__*/ w(O, { id: "hH3kDo" })]
404
+ });
405
+ if (_ === "error") {
406
+ let e = v?.message || "Unknown error";
407
+ return /*#__PURE__*/ T(o, {
408
+ className: "fixed inset-0",
409
+ distribution: "center",
410
+ alignment: "center",
411
+ direction: "vertical",
412
+ gap: "5",
413
+ children: [
414
+ /*#__PURE__*/ w("p", {
415
+ className: "text-theme-error font-semibold",
416
+ children: /*#__PURE__*/ w(O, { id: "Jh4rAZ" })
417
+ }),
418
+ /*#__PURE__*/ w("p", {
419
+ className: "text-theme-highest",
420
+ children: e
421
+ }),
422
+ /*#__PURE__*/ w(s, {
423
+ onClick: J,
424
+ variant: "primary",
425
+ children: /*#__PURE__*/ w(O, { id: "bnql/K" })
426
+ })
427
+ ]
428
+ });
429
+ }
430
+ if (!m) return /*#__PURE__*/ T(o, {
431
+ className: "fixed inset-0",
432
+ distribution: "center",
433
+ alignment: "center",
434
+ direction: "vertical",
435
+ gap: "5",
436
+ children: [/*#__PURE__*/ w("p", {
437
+ className: "text-theme-highest",
438
+ children: /*#__PURE__*/ w(O, { id: "1pdLQw" })
439
+ }), /*#__PURE__*/ w(s, {
440
+ onClick: J,
441
+ variant: "primary",
442
+ children: /*#__PURE__*/ w(O, { id: "bnql/K" })
443
+ })]
444
+ });
445
+ let Z = m.status === re.DEACTIVATED, ve = m.visibility === S.PRIVATE, ye = G?.status === "accepted", Q = m.owner === e, $ = W && ye && b.canUpdateMember, be = !W && b.canUpdate, xe = !W && b.canDelete && !m.protected, Se = !W && Q && m.visibility === S.SHARED && (b.canCreateMember || b.canDeleteMember), Ce = $ || be || xe || Se, we = Ce || !W && b.canUpdate ? /*#__PURE__*/ T(d, { children: [
446
+ Ce && /*#__PURE__*/ T(r, { children: [/*#__PURE__*/ w(c, {
447
+ as: "div",
448
+ children: /*#__PURE__*/ w(s, {
449
+ icon: "moreVert",
450
+ disabled: Y,
451
+ children: /*#__PURE__*/ w(O, { id: "PgNNGl" })
452
+ })
453
+ }), /*#__PURE__*/ T(l, { children: [
454
+ $ && /*#__PURE__*/ w(h, {
455
+ label: f._({ id: "1t/NnN" }),
456
+ onClick: () => q("rejected")
457
+ }),
458
+ !W && b.canUpdate && /*#__PURE__*/ w(h, {
459
+ label: Z ? f._({ id: "FQBaXG" }) : f._({ id: "5y3O+A" }),
460
+ onClick: () => Z ? I(!0) : R(!0)
461
+ }),
462
+ !W && b.canUpdate && ve && /*#__PURE__*/ w(h, {
463
+ label: f._({ id: "gMYsdZ" }),
464
+ onClick: () => _e("shared")
465
+ }),
466
+ !W && Q && m.visibility === S.SHARED && (b.canCreateMember || b.canDeleteMember) && /*#__PURE__*/ w(h, {
467
+ label: f._({ id: "cWbW6w" }),
468
+ onClick: () => i({
469
+ to: "/projects/$projectId/compute/images/$imageId",
470
+ params: {
471
+ projectId: e,
472
+ imageId: m.id
473
+ },
474
+ search: { tab: "sharing" }
475
+ })
476
+ }),
477
+ !W && b.canDelete && !m.protected && /*#__PURE__*/ w(h, {
478
+ label: f._({ id: "cnGeoo" }),
479
+ onClick: () => P(!0)
480
+ })
481
+ ] })] }),
482
+ !W && b.canUpdate && /*#__PURE__*/ w(s, {
483
+ onClick: () => M(!0),
484
+ disabled: Y,
485
+ children: /*#__PURE__*/ w(O, { id: "SIfYq6" })
486
+ }),
487
+ !W && b.canUpdate && /*#__PURE__*/ w(s, {
488
+ onClick: () => A(!0),
489
+ variant: "primary",
490
+ disabled: Y,
491
+ children: /*#__PURE__*/ w(O, { id: "Y1YKad" })
492
+ })
493
+ ] }) : void 0;
494
+ return /*#__PURE__*/ T(C, { children: [
495
+ /*#__PURE__*/ w(ee, {
496
+ title: String(m.name ?? m.id),
497
+ projectId: e,
498
+ actions: we
499
+ }),
500
+ /*#__PURE__*/ w("div", {
501
+ className: "mt-3",
502
+ children: /*#__PURE__*/ w(fe, {
503
+ image: m,
504
+ currentProjectId: e,
505
+ activeTab: n ?? "details",
506
+ onTabChange: (e) => i({ search: { tab: e === "details" ? void 0 : e } }),
507
+ permissions: {
508
+ canCreateMember: b.canCreateMember,
509
+ canDeleteMember: b.canDeleteMember,
510
+ canUpdateMember: b.canUpdateMember
511
+ },
512
+ myMemberData: G,
513
+ onMemberStatusChange: q,
514
+ isMemberStatusChanging: K.isPending
515
+ }, m.id)
516
+ }),
517
+ E && /*#__PURE__*/ w(se, {
518
+ image: m,
519
+ isOpen: E,
520
+ isLoading: z.isPending,
521
+ onClose: () => A(!1),
522
+ onSave: X
523
+ }),
524
+ j && /*#__PURE__*/ w(ie, {
525
+ image: m,
526
+ isOpen: j,
527
+ isLoading: z.isPending,
528
+ onClose: () => M(!1),
529
+ onSave: X
530
+ }),
531
+ N && /*#__PURE__*/ w(te, {
532
+ image: m,
533
+ isOpen: N,
534
+ isLoading: B.isPending,
535
+ isDisabled: !!m.protected,
536
+ onClose: () => P(!1),
537
+ onDelete: me
538
+ }),
539
+ F && /*#__PURE__*/ w(ne, {
540
+ image: m,
541
+ isOpen: F,
542
+ isLoading: H.isPending,
543
+ onClose: () => I(!1),
544
+ onActivate: he
545
+ }),
546
+ L && /*#__PURE__*/ w(ae, {
547
+ image: m,
548
+ isOpen: L,
549
+ isLoading: V.isPending,
550
+ onClose: () => R(!1),
551
+ onDeactivate: ge
552
+ })
553
+ ] });
554
+ }
555
+ //#endregion
556
+ export { I as component };
557
+
558
+ //# sourceMappingURL=_imageId-BtJ7GmYB.mjs.map