@lokalise/harmony 1.8.2 → 1.11.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.
- package/README.md +63 -0
- package/dist/harmony.cjs +1 -1
- package/dist/harmony.mjs +923 -507
- package/dist/types/src/features/auth/backend/services/getAuthenticatedSessionDetailFromRequest.d.ts +10 -0
- package/dist/types/src/features/auth/backend/services/getAuthenticatedSessionPayloadFromRequest.test.d.ts +1 -0
- package/dist/types/src/features/auth/core/jwtTokenPayload.d.ts +7 -0
- package/dist/types/src/features/auth/core/jwtTokenPayload.test.d.ts +1 -0
- package/dist/types/src/features/auth/core/lokaliseAuthAddon.d.ts +14 -0
- package/dist/types/src/features/auth/core/middleware/jwtAuthMiddleware.d.ts +13 -0
- package/dist/types/src/features/auth/core/middleware/jwtAuthMiddleware.test.d.ts +1 -0
- package/dist/types/src/features/auth/core/middleware/publicApiHeadersMiddleware.d.ts +5 -0
- package/dist/types/src/features/auth/core/types/jwtTokenPayload.d.ts +42 -0
- package/dist/types/src/features/auth/core/types/jwtTokenPayload.fixture.d.ts +27 -0
- package/dist/types/src/features/auth/core/utils/makeAuthHeader.d.ts +2 -0
- package/dist/types/src/features/auth/core/utils/makeAuthHeader.test.d.ts +1 -0
- package/dist/types/src/features/auth/frontend/addon/lokaliseAuthBrowserAddon.d.ts +35 -0
- package/dist/types/src/features/auth/frontend/events/NewJwtIssuedEvent.d.ts +20 -0
- package/dist/types/src/features/auth/frontend/hooks/useAuthenticatedProjectContributor.d.ts +28 -0
- package/dist/types/src/features/auth/frontend/hooks/useAuthenticatedSessionPayload.d.ts +18 -0
- package/dist/types/src/features/auth/frontend/hooks/useAuthenticatedUser.d.ts +18 -0
- package/dist/types/src/features/auth/frontend/hooks/useGetPromotedClassicSessionJwtQuery.d.ts +12 -0
- package/dist/types/src/features/auth/frontend/middleware/promoteClassicSessionToJwtMiddleware.d.ts +14 -0
- package/dist/types/src/features/auth/frontend/middleware/promoteClassicSessionToJwtMiddleware.test.d.ts +1 -0
- package/dist/types/src/features/auth/frontend/utils/cookieTokenUtils.d.ts +4 -0
- package/dist/types/src/features/auth/frontend/utils/cookieTokenUtils.test.d.ts +1 -0
- package/dist/types/src/features/auth/node.d.ts +9 -0
- package/dist/types/src/features/node.d.ts +2 -0
- package/dist/types/src/features/publicApi/contributors.d.ts +111 -0
- package/dist/types/src/features/publicApi/hooks/useCreateProjectMutation.d.ts +76 -0
- package/dist/types/src/features/publicApi/hooks/useGetTeamUsersQuery.d.ts +26 -0
- package/dist/types/src/features/publicApi/hooks/useGetUserTokenQuery.d.ts +20 -0
- package/dist/types/src/features/publicApi/hooks/useListProjectsQuery.d.ts +81 -0
- package/dist/types/src/features/publicApi/hooks/useRetrieveContributorQuery.d.ts +34 -0
- package/dist/types/src/features/publicApi/hooks/useRetrieveProjectQuery.d.ts +72 -0
- package/dist/types/src/features/publicApi/node.d.ts +16 -0
- package/dist/types/src/features/publicApi/projects.d.ts +1132 -0
- package/dist/types/src/features/publicApi/teamUsers.d.ts +61 -0
- package/dist/types/src/features/publicApi/types/contributorTypes.d.ts +171 -0
- package/dist/types/src/features/publicApi/types/languageTypes.d.ts +29 -0
- package/dist/types/src/features/publicApi/types/projectTypes.d.ts +1061 -0
- package/dist/types/src/features/publicApi/types/teamRoleTypes.d.ts +3 -0
- package/dist/types/src/features/publicApi/types/teamUserTypes.d.ts +70 -0
- package/dist/types/src/features/publicApi/types/userTokenTypes.d.ts +26 -0
- package/dist/types/src/features/publicApi/userToken.d.ts +35 -0
- package/dist/types/src/node.d.ts +2 -1
- package/dist/types/src/utils/testing/createMockFactoryWithDefaults.d.ts +2 -0
- package/dist/types/src/utils/testing/createMockFactoryWithDefaults.test.d.ts +1 -0
- package/dist/types/src/utils/testing/deepOverride.d.ts +4 -0
- package/dist/types/src/utils/testing/deepOverride.test.d.ts +1 -0
- package/dist/types/src/utils/types/apiMutationOverrides.d.ts +2 -0
- package/dist/types/src/utils/types/apiQueryOverrides.d.ts +2 -0
- package/package.json +13 -2
package/dist/harmony.mjs
CHANGED
@@ -1,691 +1,1107 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
import {
|
5
|
-
import
|
6
|
-
import {
|
7
|
-
|
8
|
-
|
1
|
+
var Ct = Object.defineProperty;
|
2
|
+
var Nt = (e, t, n) => t in e ? Ct(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
3
|
+
var Re = (e, t, n) => Nt(e, typeof t != "symbol" ? t + "" : t, n);
|
4
|
+
import { jsx as i, jsxs as p, Fragment as rt } from "react/jsx-runtime";
|
5
|
+
import * as q from "react";
|
6
|
+
import { useRef as at, useState as ge, useCallback as je, useEffect as M, useContext as Rt, createContext as jt, cloneElement as Pt, Fragment as ot, forwardRef as At } from "react";
|
7
|
+
import { Tooltip as he, Link as it, Menu as pe, MenuList as ve, CaretUpIcon as Ot, UserIcon as st, MenuItem as J, MenuDivider as ct, Tag as Lt } from "@lokalise/louis";
|
8
|
+
import { format as lt } from "date-fns";
|
9
|
+
import { toZonedTime as qt } from "date-fns-tz";
|
10
|
+
import { z as r } from "zod";
|
11
|
+
import { sendByPayloadRoute as K, sendByGetRoute as W } from "@lokalise/frontend-http-client";
|
12
|
+
import { buildPayloadRoute as ut } from "@lokalise/universal-ts-utils/api-contracts/apiContracts";
|
13
|
+
import { useQuery as x, useMutation as Mt } from "@tanstack/react-query";
|
14
|
+
import { buildGetRoute as Q } from "@lokalise/universal-ts-utils/node";
|
15
|
+
var H = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
16
|
+
function dt(e) {
|
9
17
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
10
18
|
}
|
11
|
-
var
|
12
|
-
function
|
13
|
-
if (
|
14
|
-
|
15
|
-
function e(
|
16
|
-
var
|
17
|
-
return
|
19
|
+
var Z, Pe;
|
20
|
+
function Te() {
|
21
|
+
if (Pe) return Z;
|
22
|
+
Pe = 1;
|
23
|
+
function e(t) {
|
24
|
+
var n = typeof t;
|
25
|
+
return t != null && (n == "object" || n == "function");
|
18
26
|
}
|
19
|
-
return
|
20
|
-
}
|
21
|
-
var
|
22
|
-
function
|
23
|
-
if (
|
24
|
-
|
25
|
-
var e = typeof
|
26
|
-
return
|
27
|
-
}
|
28
|
-
var
|
29
|
-
function
|
30
|
-
if (
|
31
|
-
|
32
|
-
var e =
|
33
|
-
return
|
34
|
-
}
|
35
|
-
var
|
36
|
-
function
|
37
|
-
if (
|
38
|
-
|
39
|
-
var e =
|
27
|
+
return Z = e, Z;
|
28
|
+
}
|
29
|
+
var X, Ae;
|
30
|
+
function xt() {
|
31
|
+
if (Ae) return X;
|
32
|
+
Ae = 1;
|
33
|
+
var e = typeof H == "object" && H && H.Object === Object && H;
|
34
|
+
return X = e, X;
|
35
|
+
}
|
36
|
+
var ee, Oe;
|
37
|
+
function mt() {
|
38
|
+
if (Oe) return ee;
|
39
|
+
Oe = 1;
|
40
|
+
var e = xt(), t = typeof self == "object" && self && self.Object === Object && self, n = e || t || Function("return this")();
|
41
|
+
return ee = n, ee;
|
42
|
+
}
|
43
|
+
var te, Le;
|
44
|
+
function Ut() {
|
45
|
+
if (Le) return te;
|
46
|
+
Le = 1;
|
47
|
+
var e = mt(), t = function() {
|
40
48
|
return e.Date.now();
|
41
49
|
};
|
42
|
-
return
|
50
|
+
return te = t, te;
|
43
51
|
}
|
44
|
-
var
|
45
|
-
function
|
46
|
-
if (
|
47
|
-
|
52
|
+
var ne, qe;
|
53
|
+
function Bt() {
|
54
|
+
if (qe) return ne;
|
55
|
+
qe = 1;
|
48
56
|
var e = /\s/;
|
49
|
-
function n
|
50
|
-
for (var
|
57
|
+
function t(n) {
|
58
|
+
for (var a = n.length; a-- && e.test(n.charAt(a)); )
|
51
59
|
;
|
52
|
-
return
|
60
|
+
return a;
|
53
61
|
}
|
54
|
-
return
|
55
|
-
}
|
56
|
-
var
|
57
|
-
function
|
58
|
-
if (
|
59
|
-
|
60
|
-
var e =
|
61
|
-
function
|
62
|
-
return
|
62
|
+
return ne = t, ne;
|
63
|
+
}
|
64
|
+
var re, Me;
|
65
|
+
function $t() {
|
66
|
+
if (Me) return re;
|
67
|
+
Me = 1;
|
68
|
+
var e = Bt(), t = /^\s+/;
|
69
|
+
function n(a) {
|
70
|
+
return a && a.slice(0, e(a) + 1).replace(t, "");
|
63
71
|
}
|
64
|
-
return
|
65
|
-
}
|
66
|
-
var
|
67
|
-
function
|
68
|
-
if (
|
69
|
-
|
70
|
-
var e =
|
71
|
-
return
|
72
|
-
}
|
73
|
-
var
|
74
|
-
function
|
75
|
-
if (
|
76
|
-
|
77
|
-
var e =
|
78
|
-
function
|
79
|
-
var
|
72
|
+
return re = n, re;
|
73
|
+
}
|
74
|
+
var ae, xe;
|
75
|
+
function ft() {
|
76
|
+
if (xe) return ae;
|
77
|
+
xe = 1;
|
78
|
+
var e = mt(), t = e.Symbol;
|
79
|
+
return ae = t, ae;
|
80
|
+
}
|
81
|
+
var oe, Ue;
|
82
|
+
function Ht() {
|
83
|
+
if (Ue) return oe;
|
84
|
+
Ue = 1;
|
85
|
+
var e = ft(), t = Object.prototype, n = t.hasOwnProperty, a = t.toString, o = e ? e.toStringTag : void 0;
|
86
|
+
function s(c) {
|
87
|
+
var u = n.call(c, o), d = c[o];
|
80
88
|
try {
|
81
|
-
|
82
|
-
var
|
89
|
+
c[o] = void 0;
|
90
|
+
var l = !0;
|
83
91
|
} catch {
|
84
92
|
}
|
85
|
-
var
|
86
|
-
return
|
93
|
+
var m = a.call(c);
|
94
|
+
return l && (u ? c[o] = d : delete c[o]), m;
|
87
95
|
}
|
88
|
-
return
|
89
|
-
}
|
90
|
-
var
|
91
|
-
function
|
92
|
-
if (
|
93
|
-
|
94
|
-
var e = Object.prototype,
|
95
|
-
function
|
96
|
-
return
|
96
|
+
return oe = s, oe;
|
97
|
+
}
|
98
|
+
var ie, Be;
|
99
|
+
function Dt() {
|
100
|
+
if (Be) return ie;
|
101
|
+
Be = 1;
|
102
|
+
var e = Object.prototype, t = e.toString;
|
103
|
+
function n(a) {
|
104
|
+
return t.call(a);
|
97
105
|
}
|
98
|
-
return
|
99
|
-
}
|
100
|
-
var
|
101
|
-
function
|
102
|
-
if (
|
103
|
-
|
104
|
-
var e =
|
105
|
-
function
|
106
|
-
return
|
106
|
+
return ie = n, ie;
|
107
|
+
}
|
108
|
+
var se, $e;
|
109
|
+
function zt() {
|
110
|
+
if ($e) return se;
|
111
|
+
$e = 1;
|
112
|
+
var e = ft(), t = Ht(), n = Dt(), a = "[object Null]", o = "[object Undefined]", s = e ? e.toStringTag : void 0;
|
113
|
+
function c(u) {
|
114
|
+
return u == null ? u === void 0 ? o : a : s && s in Object(u) ? t(u) : n(u);
|
107
115
|
}
|
108
|
-
return
|
109
|
-
}
|
110
|
-
var
|
111
|
-
function
|
112
|
-
if (
|
113
|
-
|
114
|
-
function e(
|
115
|
-
return
|
116
|
+
return se = c, se;
|
117
|
+
}
|
118
|
+
var ce, He;
|
119
|
+
function Ft() {
|
120
|
+
if (He) return ce;
|
121
|
+
He = 1;
|
122
|
+
function e(t) {
|
123
|
+
return t != null && typeof t == "object";
|
116
124
|
}
|
117
|
-
return
|
118
|
-
}
|
119
|
-
var
|
120
|
-
function
|
121
|
-
if (
|
122
|
-
|
123
|
-
var e =
|
124
|
-
function
|
125
|
-
return typeof
|
125
|
+
return ce = e, ce;
|
126
|
+
}
|
127
|
+
var le, De;
|
128
|
+
function Gt() {
|
129
|
+
if (De) return le;
|
130
|
+
De = 1;
|
131
|
+
var e = zt(), t = Ft(), n = "[object Symbol]";
|
132
|
+
function a(o) {
|
133
|
+
return typeof o == "symbol" || t(o) && e(o) == n;
|
126
134
|
}
|
127
|
-
return
|
128
|
-
}
|
129
|
-
var
|
130
|
-
function
|
131
|
-
if (
|
132
|
-
|
133
|
-
var e =
|
134
|
-
function
|
135
|
-
if (typeof
|
136
|
-
return
|
137
|
-
if (
|
138
|
-
return
|
139
|
-
if (
|
140
|
-
var
|
141
|
-
|
135
|
+
return le = a, le;
|
136
|
+
}
|
137
|
+
var ue, ze;
|
138
|
+
function Jt() {
|
139
|
+
if (ze) return ue;
|
140
|
+
ze = 1;
|
141
|
+
var e = $t(), t = Te(), n = Gt(), a = NaN, o = /^[-+]0x[0-9a-f]+$/i, s = /^0b[01]+$/i, c = /^0o[0-7]+$/i, u = parseInt;
|
142
|
+
function d(l) {
|
143
|
+
if (typeof l == "number")
|
144
|
+
return l;
|
145
|
+
if (n(l))
|
146
|
+
return a;
|
147
|
+
if (t(l)) {
|
148
|
+
var m = typeof l.valueOf == "function" ? l.valueOf() : l;
|
149
|
+
l = t(m) ? m + "" : m;
|
142
150
|
}
|
143
|
-
if (typeof
|
144
|
-
return
|
145
|
-
|
146
|
-
var
|
147
|
-
return
|
151
|
+
if (typeof l != "string")
|
152
|
+
return l === 0 ? l : +l;
|
153
|
+
l = e(l);
|
154
|
+
var _ = s.test(l);
|
155
|
+
return _ || c.test(l) ? u(l.slice(2), _ ? 2 : 8) : o.test(l) ? a : +l;
|
148
156
|
}
|
149
|
-
return
|
157
|
+
return ue = d, ue;
|
150
158
|
}
|
151
|
-
var
|
152
|
-
function
|
153
|
-
if (
|
154
|
-
|
155
|
-
var e =
|
156
|
-
function
|
157
|
-
var
|
158
|
-
if (typeof
|
159
|
-
throw new TypeError(
|
160
|
-
|
161
|
-
function
|
162
|
-
var
|
163
|
-
return
|
159
|
+
var de, Fe;
|
160
|
+
function bt() {
|
161
|
+
if (Fe) return de;
|
162
|
+
Fe = 1;
|
163
|
+
var e = Te(), t = Ut(), n = Jt(), a = "Expected a function", o = Math.max, s = Math.min;
|
164
|
+
function c(u, d, l) {
|
165
|
+
var m, _, y, E, b, T, w = 0, S = !1, g = !1, k = !0;
|
166
|
+
if (typeof u != "function")
|
167
|
+
throw new TypeError(a);
|
168
|
+
d = n(d) || 0, e(l) && (S = !!l.leading, g = "maxWait" in l, y = g ? o(n(l.maxWait) || 0, d) : y, k = "trailing" in l ? !!l.trailing : k);
|
169
|
+
function v(f) {
|
170
|
+
var C = m, L = _;
|
171
|
+
return m = _ = void 0, w = f, E = u.apply(L, C), E;
|
164
172
|
}
|
165
|
-
function
|
166
|
-
return w = f,
|
173
|
+
function h(f) {
|
174
|
+
return w = f, b = setTimeout($, d), S ? v(f) : E;
|
167
175
|
}
|
168
|
-
function
|
169
|
-
var
|
170
|
-
return g ?
|
176
|
+
function B(f) {
|
177
|
+
var C = f - T, L = f - w, Ne = d - C;
|
178
|
+
return g ? s(Ne, y - L) : Ne;
|
171
179
|
}
|
172
|
-
function
|
173
|
-
var
|
174
|
-
return
|
180
|
+
function ke(f) {
|
181
|
+
var C = f - T, L = f - w;
|
182
|
+
return T === void 0 || C >= d || C < 0 || g && L >= y;
|
175
183
|
}
|
176
|
-
function
|
177
|
-
var f =
|
178
|
-
if (
|
179
|
-
return
|
180
|
-
|
184
|
+
function $() {
|
185
|
+
var f = t();
|
186
|
+
if (ke(f))
|
187
|
+
return Ce(f);
|
188
|
+
b = setTimeout($, B(f));
|
181
189
|
}
|
182
|
-
function
|
183
|
-
return
|
190
|
+
function Ce(f) {
|
191
|
+
return b = void 0, k && m ? v(f) : (m = _ = void 0, E);
|
184
192
|
}
|
185
|
-
function
|
186
|
-
|
193
|
+
function Et() {
|
194
|
+
b !== void 0 && clearTimeout(b), w = 0, m = T = _ = b = void 0;
|
187
195
|
}
|
188
|
-
function
|
189
|
-
return
|
196
|
+
function kt() {
|
197
|
+
return b === void 0 ? E : Ce(t());
|
190
198
|
}
|
191
|
-
function
|
192
|
-
var f =
|
193
|
-
if (
|
194
|
-
if (
|
195
|
-
return
|
199
|
+
function V() {
|
200
|
+
var f = t(), C = ke(f);
|
201
|
+
if (m = arguments, _ = this, T = f, C) {
|
202
|
+
if (b === void 0)
|
203
|
+
return h(T);
|
196
204
|
if (g)
|
197
|
-
return clearTimeout(
|
205
|
+
return clearTimeout(b), b = setTimeout($, d), v(T);
|
198
206
|
}
|
199
|
-
return
|
207
|
+
return b === void 0 && (b = setTimeout($, d)), E;
|
200
208
|
}
|
201
|
-
return
|
209
|
+
return V.cancel = Et, V.flush = kt, V;
|
202
210
|
}
|
203
|
-
return
|
204
|
-
}
|
205
|
-
var
|
206
|
-
const
|
207
|
-
var
|
208
|
-
function
|
209
|
-
if (
|
210
|
-
|
211
|
-
var e =
|
212
|
-
function
|
213
|
-
var
|
214
|
-
if (typeof
|
215
|
-
throw new TypeError(
|
216
|
-
return
|
217
|
-
leading:
|
218
|
-
maxWait:
|
219
|
-
trailing:
|
211
|
+
return de = c, de;
|
212
|
+
}
|
213
|
+
var Kt = bt();
|
214
|
+
const Wt = /* @__PURE__ */ dt(Kt);
|
215
|
+
var me, Ge;
|
216
|
+
function Qt() {
|
217
|
+
if (Ge) return me;
|
218
|
+
Ge = 1;
|
219
|
+
var e = bt(), t = Te(), n = "Expected a function";
|
220
|
+
function a(o, s, c) {
|
221
|
+
var u = !0, d = !0;
|
222
|
+
if (typeof o != "function")
|
223
|
+
throw new TypeError(n);
|
224
|
+
return t(c) && (u = "leading" in c ? !!c.leading : u, d = "trailing" in c ? !!c.trailing : d), e(o, s, {
|
225
|
+
leading: u,
|
226
|
+
maxWait: s,
|
227
|
+
trailing: d
|
220
228
|
});
|
221
229
|
}
|
222
|
-
return
|
230
|
+
return me = a, me;
|
223
231
|
}
|
224
|
-
var
|
225
|
-
const
|
226
|
-
switch (
|
232
|
+
var Yt = Qt();
|
233
|
+
const Vt = /* @__PURE__ */ dt(Yt), Zt = (e, t, n, a) => {
|
234
|
+
switch (t) {
|
227
235
|
case "debounce":
|
228
|
-
return
|
236
|
+
return Wt(e, n, a);
|
229
237
|
case "throttle":
|
230
|
-
return
|
238
|
+
return Vt(e, n, a);
|
231
239
|
default:
|
232
240
|
return e;
|
233
241
|
}
|
234
|
-
},
|
242
|
+
}, Xt = (
|
235
243
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
236
244
|
(e) => {
|
237
|
-
const
|
238
|
-
return
|
239
|
-
|
240
|
-
}),
|
241
|
-
var
|
242
|
-
return (
|
245
|
+
const t = q.useRef(e);
|
246
|
+
return q.useEffect(() => {
|
247
|
+
t.current = e;
|
248
|
+
}), q.useMemo(() => (...n) => {
|
249
|
+
var a;
|
250
|
+
return (a = t.current) === null || a === void 0 ? void 0 : a.call(t, ...n);
|
243
251
|
}, []);
|
244
252
|
}
|
245
|
-
),
|
253
|
+
), en = (
|
246
254
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
247
255
|
(e) => {
|
248
|
-
const [
|
256
|
+
const [t, n] = q.useState((e == null ? void 0 : e.current) || null);
|
249
257
|
return e && setTimeout(() => {
|
250
|
-
e.current !==
|
251
|
-
}, 0), { refProxy:
|
252
|
-
|
258
|
+
e.current !== t && n(e.current);
|
259
|
+
}, 0), { refProxy: q.useMemo(() => new Proxy((o) => {
|
260
|
+
o !== t && n(o);
|
253
261
|
}, {
|
254
|
-
get(
|
255
|
-
return
|
262
|
+
get(o, s) {
|
263
|
+
return s === "current" ? t : o[s];
|
256
264
|
},
|
257
|
-
set(
|
258
|
-
return
|
265
|
+
set(o, s, c) {
|
266
|
+
return s === "current" ? n(c) : o[s] = c, !0;
|
259
267
|
}
|
260
|
-
}), [
|
268
|
+
}), [t]), refElement: t, setRefElement: n };
|
261
269
|
}
|
262
|
-
),
|
270
|
+
), tn = (e, t) => t === "border-box" ? {
|
263
271
|
width: e.borderBoxSize[0].inlineSize,
|
264
272
|
height: e.borderBoxSize[0].blockSize
|
265
|
-
} :
|
273
|
+
} : t === "content-box" ? {
|
266
274
|
width: e.contentBoxSize[0].inlineSize,
|
267
275
|
height: e.contentBoxSize[0].blockSize
|
268
276
|
} : {
|
269
277
|
width: e.contentRect.width,
|
270
278
|
height: e.contentRect.height
|
271
279
|
};
|
272
|
-
function
|
273
|
-
const
|
280
|
+
function nn({ skipOnMount: e = !1, refreshMode: t, refreshRate: n = 1e3, refreshOptions: a, handleWidth: o = !0, handleHeight: s = !0, targetRef: c, observerOptions: u, onResize: d } = {}) {
|
281
|
+
const l = at(e), m = Xt(d), [_, y] = ge({
|
274
282
|
width: void 0,
|
275
283
|
height: void 0
|
276
|
-
}), { refProxy:
|
277
|
-
if (!
|
284
|
+
}), { refProxy: E, refElement: b } = en(c), { box: T } = u || {}, w = je((g) => {
|
285
|
+
if (!o && !s)
|
278
286
|
return;
|
279
|
-
if (
|
280
|
-
|
287
|
+
if (l.current) {
|
288
|
+
l.current = !1;
|
281
289
|
return;
|
282
290
|
}
|
283
|
-
const
|
284
|
-
g.forEach((
|
285
|
-
const
|
286
|
-
|
287
|
-
width:
|
288
|
-
height:
|
289
|
-
entry:
|
290
|
-
}),
|
291
|
+
const k = (v, h) => o && v.width !== h.width || s && v.height !== h.height;
|
292
|
+
g.forEach((v) => {
|
293
|
+
const h = tn(v, T);
|
294
|
+
y((B) => k(B, h) ? (m == null || m({
|
295
|
+
width: h.width,
|
296
|
+
height: h.height,
|
297
|
+
entry: v
|
298
|
+
}), h) : B);
|
291
299
|
});
|
292
|
-
}, [
|
300
|
+
}, [o, s, l, T]), S = je(Zt(w, t, n, a), [
|
293
301
|
w,
|
294
|
-
n,
|
295
302
|
t,
|
296
|
-
|
303
|
+
n,
|
304
|
+
a
|
297
305
|
]);
|
298
|
-
return
|
306
|
+
return M(() => {
|
299
307
|
let g;
|
300
|
-
return
|
308
|
+
return b ? (g = new window.ResizeObserver(S), g.observe(b, u)) : (_.width || _.height) && (m == null || m({
|
301
309
|
width: null,
|
302
310
|
height: null,
|
303
311
|
entry: null
|
304
|
-
}),
|
305
|
-
var
|
306
|
-
(
|
312
|
+
}), y({ width: void 0, height: void 0 })), () => {
|
313
|
+
var k, v, h;
|
314
|
+
(k = g == null ? void 0 : g.disconnect) === null || k === void 0 || k.call(g), (h = (v = S).cancel) === null || h === void 0 || h.call(v);
|
307
315
|
};
|
308
|
-
}, [
|
316
|
+
}, [S, b]), Object.assign({ ref: E }, _);
|
309
317
|
}
|
310
|
-
function
|
311
|
-
var
|
312
|
-
if (typeof e == "string" || typeof e == "number")
|
318
|
+
function _t(e) {
|
319
|
+
var t, n, a = "";
|
320
|
+
if (typeof e == "string" || typeof e == "number") a += e;
|
313
321
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
314
|
-
var
|
315
|
-
for (
|
316
|
-
} else for (
|
317
|
-
return
|
318
|
-
}
|
319
|
-
function
|
320
|
-
for (var e,
|
321
|
-
return
|
322
|
-
}
|
323
|
-
const
|
324
|
-
headerContainer:
|
325
|
-
navigationTabList:
|
326
|
-
navigationTab:
|
327
|
-
headerContent:
|
328
|
-
staticEnabled:
|
329
|
-
},
|
330
|
-
const { ref:
|
322
|
+
var o = e.length;
|
323
|
+
for (t = 0; t < o; t++) e[t] && (n = _t(e[t])) && (a && (a += " "), a += n);
|
324
|
+
} else for (n in e) e[n] && (a && (a += " "), a += n);
|
325
|
+
return a;
|
326
|
+
}
|
327
|
+
function j() {
|
328
|
+
for (var e, t, n = 0, a = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t = _t(e)) && (a && (a += " "), a += t);
|
329
|
+
return a;
|
330
|
+
}
|
331
|
+
const rn = "_headerContainer_1cubo_1", an = "_navigationTabList_1cubo_8", on = "_navigationTab_1cubo_8", sn = "_headerContent_1cubo_34", cn = "_staticEnabled_1cubo_50", A = {
|
332
|
+
headerContainer: rn,
|
333
|
+
navigationTabList: an,
|
334
|
+
navigationTab: on,
|
335
|
+
headerContent: sn,
|
336
|
+
staticEnabled: cn
|
337
|
+
}, ln = 77, z = ({ sticky: e, children: t }) => {
|
338
|
+
const { ref: n, height: a } = nn({
|
331
339
|
refreshMode: "debounce",
|
332
340
|
refreshRate: 0
|
333
|
-
}), [
|
334
|
-
|
335
|
-
const
|
336
|
-
|
341
|
+
}), [o, s] = ge(!1), c = () => o ? !e : !0;
|
342
|
+
M(() => {
|
343
|
+
const d = () => {
|
344
|
+
s(window.scrollY > 0);
|
337
345
|
};
|
338
|
-
return window.addEventListener("scroll",
|
346
|
+
return window.addEventListener("scroll", d), () => window.removeEventListener("scroll", d);
|
339
347
|
}, []);
|
340
|
-
const
|
341
|
-
return /* @__PURE__ */ i("div", { style: { minHeight:
|
348
|
+
const u = `${a || ln}px`;
|
349
|
+
return /* @__PURE__ */ i("div", { style: { minHeight: u }, children: /* @__PURE__ */ i("div", { children: /* @__PURE__ */ p(
|
342
350
|
"div",
|
343
351
|
{
|
344
|
-
ref:
|
345
|
-
className:
|
346
|
-
[
|
352
|
+
ref: n,
|
353
|
+
className: j(A.headerContent, {
|
354
|
+
[A.staticEnabled]: c()
|
347
355
|
}),
|
348
356
|
children: [
|
349
|
-
/* @__PURE__ */ i(
|
350
|
-
/* @__PURE__ */ i(
|
351
|
-
|
357
|
+
/* @__PURE__ */ i(z.Header, {}),
|
358
|
+
/* @__PURE__ */ i(z.Tabs, {}),
|
359
|
+
t
|
352
360
|
]
|
353
361
|
}
|
354
362
|
) }) });
|
355
363
|
};
|
356
|
-
|
357
|
-
|
358
|
-
const
|
359
|
-
sidebarContainer:
|
360
|
-
},
|
361
|
-
logoLink:
|
362
|
-
},
|
363
|
-
link:
|
364
|
-
active:
|
365
|
-
},
|
366
|
-
|
364
|
+
z.Header = ({ children: e }) => /* @__PURE__ */ i("div", { className: A.headerContainer, children: e });
|
365
|
+
z.Tabs = ({ children: e }) => /* @__PURE__ */ i("div", { className: "flex justify-between gap-2 nowrap", children: e });
|
366
|
+
const un = "_sidebarContainer_bmdti_1", dn = {
|
367
|
+
sidebarContainer: un
|
368
|
+
}, mn = "_logoLink_1baxb_1", fn = {
|
369
|
+
logoLink: mn
|
370
|
+
}, bn = ({ src: e, href: t = "/", ariaLabel: n = "Home", alt: a = "Lokalise" }) => /* @__PURE__ */ i("a", { className: fn.logoLink, href: t, "aria-label": n, children: /* @__PURE__ */ i("img", { src: e, alt: a }) }), _n = "_link_1weq1_1", gn = "_active_1weq1_18", Je = {
|
371
|
+
link: _n,
|
372
|
+
active: gn
|
373
|
+
}, hn = ({ label: e, to: t, icon: n }) => /* @__PURE__ */ i(he, { placement: "right", tooltip: e, children: /* @__PURE__ */ i(
|
374
|
+
it,
|
367
375
|
{
|
368
|
-
className:
|
369
|
-
[
|
376
|
+
className: j(Je.link, {
|
377
|
+
[Je.active]: window.location.pathname.startsWith(t)
|
370
378
|
}),
|
371
|
-
href:
|
372
|
-
children: /* @__PURE__ */ i(
|
379
|
+
href: t,
|
380
|
+
children: /* @__PURE__ */ i(n, { size: "25px" })
|
373
381
|
}
|
374
|
-
) }),
|
375
|
-
dropdownButton:
|
376
|
-
dropdownButtonActive:
|
377
|
-
},
|
378
|
-
|
382
|
+
) }), pn = "_dropdownButton_hwh0c_1", vn = "_dropdownButtonActive_hwh0c_18", Ke = {
|
383
|
+
dropdownButton: pn,
|
384
|
+
dropdownButtonActive: vn
|
385
|
+
}, Tn = ({ children: e, icon: t }) => /* @__PURE__ */ i(
|
386
|
+
pe,
|
379
387
|
{
|
380
|
-
menuButton: ({ opened:
|
388
|
+
menuButton: ({ opened: n }) => /* @__PURE__ */ i(he, { placement: "right", tooltip: "Help", children: /* @__PURE__ */ i(
|
381
389
|
"button",
|
382
390
|
{
|
383
391
|
type: "button",
|
384
|
-
className:
|
385
|
-
[
|
392
|
+
className: j(Ke.dropdownButton, {
|
393
|
+
[Ke.dropdownButtonActive]: n
|
386
394
|
}),
|
387
|
-
children: /* @__PURE__ */ i(
|
395
|
+
children: /* @__PURE__ */ i(t, { size: "25px" })
|
388
396
|
}
|
389
397
|
) }),
|
390
|
-
children: /* @__PURE__ */ i(
|
398
|
+
children: /* @__PURE__ */ i(ve, { placement: "right-start", children: e })
|
391
399
|
}
|
392
|
-
),
|
393
|
-
iconContainer:
|
394
|
-
},
|
400
|
+
), yn = "_iconContainer_nz34m_1", wn = {
|
401
|
+
iconContainer: yn
|
402
|
+
}, gt = ({ className: e = "" }) => /* @__PURE__ */ i(
|
395
403
|
"div",
|
396
404
|
{
|
397
405
|
"aria-label": "Upgrade Icon",
|
398
|
-
className:
|
399
|
-
|
406
|
+
className: j(
|
407
|
+
wn.iconContainer,
|
400
408
|
"flex-row",
|
401
409
|
"items-center",
|
402
410
|
"justify-center",
|
403
411
|
e
|
404
412
|
),
|
405
|
-
children: /* @__PURE__ */ i(
|
413
|
+
children: /* @__PURE__ */ i(Ot, {})
|
406
414
|
}
|
407
|
-
),
|
408
|
-
menuContainer:
|
409
|
-
profileButton:
|
410
|
-
profileImage:
|
411
|
-
profileImageHighlight:
|
412
|
-
profileImageUpgradeIcon:
|
413
|
-
userIconWrapper:
|
414
|
-
},
|
415
|
+
), Sn = "_menuContainer_wbu3u_5", In = "_profileButton_wbu3u_16", En = "_profileImage_wbu3u_29", kn = "_profileImageHighlight_wbu3u_37", Cn = "_profileImageUpgradeIcon_wbu3u_41", Nn = "_userIconWrapper_wbu3u_47", N = {
|
416
|
+
menuContainer: Sn,
|
417
|
+
profileButton: In,
|
418
|
+
profileImage: En,
|
419
|
+
profileImageHighlight: kn,
|
420
|
+
profileImageUpgradeIcon: Cn,
|
421
|
+
userIconWrapper: Nn
|
422
|
+
}, ht = jt({}), U = () => Rt(ht), Rn = ({ children: e }) => {
|
415
423
|
const {
|
416
|
-
currentTeam:
|
417
|
-
otherTeams:
|
418
|
-
showUpgradeCta:
|
419
|
-
showBillingButton:
|
420
|
-
allowTeamCreation:
|
421
|
-
isProviderAlpha:
|
422
|
-
canAccessTeamSettings:
|
423
|
-
isEndOfTrialActive:
|
424
|
-
isTeamSuspended:
|
425
|
-
isFullyAuthenticated:
|
426
|
-
} =
|
424
|
+
currentTeam: t,
|
425
|
+
otherTeams: n,
|
426
|
+
showUpgradeCta: a,
|
427
|
+
showBillingButton: o,
|
428
|
+
allowTeamCreation: s,
|
429
|
+
isProviderAlpha: c,
|
430
|
+
canAccessTeamSettings: u,
|
431
|
+
isEndOfTrialActive: d,
|
432
|
+
isTeamSuspended: l,
|
433
|
+
isFullyAuthenticated: m
|
434
|
+
} = U();
|
427
435
|
return /* @__PURE__ */ i(
|
428
|
-
|
436
|
+
pe,
|
429
437
|
{
|
430
|
-
menuButton: () => /* @__PURE__ */
|
431
|
-
|
438
|
+
menuButton: () => /* @__PURE__ */ p("button", { className: N.profileButton, "aria-label": "Profile menu", type: "button", children: [
|
439
|
+
t != null && t.logoUrl ? /* @__PURE__ */ i(
|
432
440
|
"img",
|
433
441
|
{
|
434
|
-
src:
|
435
|
-
className:
|
436
|
-
[
|
442
|
+
src: t.logoUrl,
|
443
|
+
className: j(N.profileImage, {
|
444
|
+
[N.profileImageHighlight]: a
|
437
445
|
}),
|
438
446
|
alt: "Team Logo"
|
439
447
|
}
|
440
448
|
) : /* @__PURE__ */ i(
|
441
449
|
"div",
|
442
450
|
{
|
443
|
-
className:
|
444
|
-
[
|
451
|
+
className: j(N.userIconWrapper, "flex-row", "align-center", "items-center", {
|
452
|
+
[N.profileImageHighlight]: a
|
445
453
|
}),
|
446
|
-
children: /* @__PURE__ */ i(
|
454
|
+
children: /* @__PURE__ */ i(st, { size: "25px" })
|
447
455
|
}
|
448
456
|
),
|
449
|
-
|
457
|
+
a && /* @__PURE__ */ i(gt, { className: N.profileImageUpgradeIcon })
|
450
458
|
] }),
|
451
|
-
children: /* @__PURE__ */ i(
|
452
|
-
allowTeamCreation:
|
453
|
-
otherTeams:
|
454
|
-
canAccessTeamSettings:
|
455
|
-
isEndOfTrialActive:
|
456
|
-
isTeamSuspended:
|
457
|
-
showBillingButton:
|
458
|
-
isProviderAlpha:
|
459
|
-
isFullyAuthenticated:
|
459
|
+
children: /* @__PURE__ */ i(ve, { placement: "right-end", className: N.menuContainer, children: e({
|
460
|
+
allowTeamCreation: s,
|
461
|
+
otherTeams: n,
|
462
|
+
canAccessTeamSettings: u,
|
463
|
+
isEndOfTrialActive: d,
|
464
|
+
isTeamSuspended: l,
|
465
|
+
showBillingButton: o,
|
466
|
+
isProviderAlpha: c,
|
467
|
+
isFullyAuthenticated: m
|
460
468
|
}) })
|
461
469
|
}
|
462
470
|
);
|
463
|
-
},
|
464
|
-
const
|
465
|
-
if (
|
471
|
+
}, pt = 0, jn = 9999, Pn = [150, 151, 250, 251], An = [152, 153, 252, 253], On = [154, 155, 157, 158, 254, 255, 258, 354, 355, 358], Ln = [156, 159, 160, 256, 259, 260], vt = 9998, ye = (e) => e === pt, Tt = (e) => e === jn, aa = (e) => Pn.includes(e), oa = (e) => An.includes(e), ia = (e) => On.includes(e), sa = (e) => Ln.includes(e), ca = (e) => e > pt && e < vt, la = (e) => e === vt, qn = /\n/, We = (e, t, n) => e.split(t).flatMap((a, o) => o !== 0 ? [Pt(n, { key: Math.random().toString(32).slice(0, 10) }), a] : a), Mn = (e, t, n) => typeof e == "string" ? We(e, t, n) : e.flatMap((a) => typeof a == "string" ? We(a, t, n) : a), ua = (e) => Mn(e, qn, /* @__PURE__ */ i("br", {})), xn = /(\b(https?|):\/\/[-a-zA-Zа-яА-Я0-9+&@#/%?=~_|!:,.;]*[-a-zA-Zа-яА-Я0-9+&@#/%=~_|])/gi, Un = (e) => e.match(xn) ?? [], Qe = (e, t, n) => {
|
472
|
+
const a = e.split(t);
|
473
|
+
if (a.length === 1)
|
466
474
|
return e;
|
467
|
-
const
|
468
|
-
return
|
469
|
-
/* @__PURE__ */ i("a", { href:
|
470
|
-
),
|
471
|
-
},
|
472
|
-
const
|
473
|
-
return
|
474
|
-
},
|
475
|
-
|
476
|
-
},
|
475
|
+
const o = [];
|
476
|
+
return a[0] !== "" && o.push(a[0]), a.shift(), a[a.length - 1] === "" && a.pop(), o.push(
|
477
|
+
/* @__PURE__ */ i("a", { href: t, target: "_blank", rel: "noreferrer noopener", children: t }, t + n)
|
478
|
+
), o.push(a.join(t)), o.filter((s) => s !== "");
|
479
|
+
}, Ye = (e) => {
|
480
|
+
const t = Un(e);
|
481
|
+
return t != null && t.length ? t.reduce((n, a, o) => typeof n == "string" ? Qe(n, a, o) : n.flatMap((s) => typeof s == "string" ? Qe(s, a, o) : s), e) : e;
|
482
|
+
}, da = (e) => typeof e == "string" ? Ye(e) : e.flatMap((t) => typeof t == "string" ? Ye(t) : t, e), ma = (e, t = "PP") => lt(e, t), fa = (e, t, n = "PP") => lt(qt(e, t), n), ba = (e) => {
|
483
|
+
M(e, []);
|
484
|
+
}, Ve = {
|
477
485
|
biller: "biller",
|
478
486
|
owner: "owner"
|
479
|
-
},
|
480
|
-
|
481
|
-
|
482
|
-
],
|
483
|
-
const { teams:
|
484
|
-
...
|
485
|
-
currentTeam:
|
486
|
-
otherTeams:
|
487
|
-
canChangeBilling:
|
488
|
-
canAccessTeamSettings:
|
489
|
-
isOnFreeOrTrialPlan:
|
490
|
-
showUpgradeCta:
|
491
|
-
showBillingButton:
|
492
|
-
allowTeamCreation:
|
487
|
+
}, Ze = [
|
488
|
+
Ve.biller,
|
489
|
+
Ve.owner
|
490
|
+
], Bn = ({ children: e, config: t }) => {
|
491
|
+
const { teams: n, currentTeamId: a, planId: o, isEndOfTrialActive: s, isFullyAuthenticated: c, userTeamRole: u } = t, d = n.find((S) => S.id === a), l = n.filter((S) => S.id !== a), m = Ze.includes(u), _ = Ze.includes(u), y = ye(o) || Tt(o), w = {
|
492
|
+
...t,
|
493
|
+
currentTeam: d,
|
494
|
+
otherTeams: l,
|
495
|
+
canChangeBilling: m,
|
496
|
+
canAccessTeamSettings: _,
|
497
|
+
isOnFreeOrTrialPlan: y,
|
498
|
+
showUpgradeCta: c && y && m,
|
499
|
+
showBillingButton: c && _ && m,
|
500
|
+
allowTeamCreation: c && !s
|
493
501
|
};
|
494
|
-
return /* @__PURE__ */ i(
|
495
|
-
},
|
496
|
-
container:
|
497
|
-
profileEmail:
|
498
|
-
},
|
502
|
+
return /* @__PURE__ */ i(ht.Provider, { value: w, children: e });
|
503
|
+
}, $n = ({ config: e, children: t }) => /* @__PURE__ */ i(Bn, { config: e, children: /* @__PURE__ */ i(Rn, { children: t }) }), Hn = "_container_q5pot_1", Dn = "_profileEmail_q5pot_5", Xe = {
|
504
|
+
container: Hn,
|
505
|
+
profileEmail: Dn
|
506
|
+
}, zn = ({
|
499
507
|
href: e,
|
500
|
-
onClick:
|
501
|
-
userEmail:
|
502
|
-
hideBottomDivider:
|
508
|
+
onClick: t,
|
509
|
+
userEmail: n,
|
510
|
+
hideBottomDivider: a
|
503
511
|
}) => {
|
504
|
-
const { isEndOfTrialActive:
|
505
|
-
return
|
512
|
+
const { isEndOfTrialActive: o, isTeamSuspended: s } = U();
|
513
|
+
return o || s ? null : /* @__PURE__ */ p(rt, { children: [
|
506
514
|
/* @__PURE__ */ i(
|
507
|
-
|
515
|
+
J,
|
508
516
|
{
|
509
517
|
href: e,
|
510
518
|
onClick: () => {
|
511
|
-
|
519
|
+
t == null || t();
|
512
520
|
},
|
513
|
-
children: /* @__PURE__ */
|
521
|
+
children: /* @__PURE__ */ p("div", { className: `flex-col ${Xe.container}`, children: [
|
514
522
|
/* @__PURE__ */ i("span", { children: "Profile Settings" }),
|
515
|
-
/* @__PURE__ */ i("span", { className:
|
523
|
+
/* @__PURE__ */ i("span", { className: Xe.profileEmail, children: n })
|
516
524
|
] })
|
517
525
|
}
|
518
526
|
),
|
519
|
-
!
|
527
|
+
!a && /* @__PURE__ */ i(ct, {})
|
520
528
|
] });
|
521
|
-
},
|
522
|
-
wrapper:
|
523
|
-
profileImage:
|
524
|
-
teamName:
|
525
|
-
planLabel:
|
526
|
-
membership:
|
527
|
-
defaultProfileImage:
|
528
|
-
},
|
529
|
-
const { currentTeam:
|
530
|
-
if (!
|
529
|
+
}, Fn = "_wrapper_15d85_1", Gn = "_profileImage_15d85_14", Jn = "_teamName_15d85_22", Kn = "_planLabel_15d85_29", Wn = "_membership_15d85_38", Qn = "_defaultProfileImage_15d85_44", P = {
|
530
|
+
wrapper: Fn,
|
531
|
+
profileImage: Gn,
|
532
|
+
teamName: Jn,
|
533
|
+
planLabel: Kn,
|
534
|
+
membership: Wn,
|
535
|
+
defaultProfileImage: Qn
|
536
|
+
}, yt = ({ team: e, onClick: t, hidePlanLabel: n }) => {
|
537
|
+
const { currentTeam: a, planId: o } = U(), s = e || a;
|
538
|
+
if (!s)
|
531
539
|
return null;
|
532
|
-
const
|
533
|
-
return /* @__PURE__ */
|
534
|
-
|
540
|
+
const c = ye(o) ? "Free" : Tt(o) ? "Trial" : void 0;
|
541
|
+
return /* @__PURE__ */ p(
|
542
|
+
t ? J : "div",
|
535
543
|
{
|
536
|
-
className: `flex-row gap-2 flex-nowrap items-center ${
|
537
|
-
...
|
544
|
+
className: `flex-row gap-2 flex-nowrap items-center ${P.wrapper}`,
|
545
|
+
...t && { onClick: () => t(s) },
|
538
546
|
children: [
|
539
|
-
|
540
|
-
/* @__PURE__ */
|
541
|
-
/* @__PURE__ */
|
542
|
-
/* @__PURE__ */ i("span", { title:
|
543
|
-
|
547
|
+
s.logoUrl ? /* @__PURE__ */ i("img", { className: P.profileImage, src: s.logoUrl, alt: "Team Logo" }) : /* @__PURE__ */ i("span", { className: `flex-row justify-center items-center ${P.defaultProfileImage}`, children: /* @__PURE__ */ i(st, { size: "25px" }) }),
|
548
|
+
/* @__PURE__ */ p("div", { className: "flex-col items-start", children: [
|
549
|
+
/* @__PURE__ */ p("div", { className: "flex-row items-center flex-nowrap gap-2", children: [
|
550
|
+
/* @__PURE__ */ i("span", { title: s.name, className: P.teamName, children: s.name }),
|
551
|
+
c && !n && /* @__PURE__ */ i("span", { className: `flex-row justify-center items-center ${P.planLabel}`, children: c })
|
544
552
|
] }),
|
545
|
-
/* @__PURE__ */ i("span", { className:
|
553
|
+
/* @__PURE__ */ i("span", { className: P.membership, children: s.role })
|
546
554
|
] })
|
547
555
|
]
|
548
556
|
}
|
549
557
|
);
|
550
|
-
},
|
551
|
-
teamsContainer:
|
552
|
-
},
|
553
|
-
const { otherTeams:
|
554
|
-
return
|
555
|
-
},
|
556
|
-
container:
|
557
|
-
planCta:
|
558
|
-
upgradeIconWrapper:
|
559
|
-
},
|
560
|
-
const { planId:
|
561
|
-
if (!
|
558
|
+
}, Yn = "_teamsContainer_1t68g_1", Vn = {
|
559
|
+
teamsContainer: Yn
|
560
|
+
}, Zn = ({ onSwitchTeam: e }) => {
|
561
|
+
const { otherTeams: t } = U();
|
562
|
+
return t.length === 0 ? null : /* @__PURE__ */ i("div", { className: `flex-col items-stretch ${Vn.teamsContainer}`, children: t.map((n) => /* @__PURE__ */ i(yt, { team: n, onClick: e, hidePlanLabel: !0 }, n.id)) });
|
563
|
+
}, Xn = "_container_1u995_1", er = "_planCta_1u995_15", tr = "_upgradeIconWrapper_1u995_19", fe = {
|
564
|
+
container: Xn,
|
565
|
+
planCta: er,
|
566
|
+
upgradeIconWrapper: tr
|
567
|
+
}, nr = ({ upgradeOptionHref: e }) => {
|
568
|
+
const { planId: t, trialDaysLeft: n, showUpgradeCta: a } = U();
|
569
|
+
if (!a)
|
562
570
|
return null;
|
563
|
-
const
|
564
|
-
return /* @__PURE__ */
|
565
|
-
/* @__PURE__ */ i("span", { className:
|
566
|
-
/* @__PURE__ */
|
567
|
-
/* @__PURE__ */ i(
|
571
|
+
const c = ye(t) ? "Your team is currently on the Free plan" : `Free trial ends in ${n} ${n === 1 ? "day" : "days"}`;
|
572
|
+
return /* @__PURE__ */ p(J, { href: e, className: `flex-col gap-1 items-start ${fe.container}`, children: [
|
573
|
+
/* @__PURE__ */ i("span", { className: fe.planCta, children: c }),
|
574
|
+
/* @__PURE__ */ p("div", { className: `flex-row items-center gap-1 ${fe.upgradeIconWrapper}`, children: [
|
575
|
+
/* @__PURE__ */ i(gt, {}),
|
568
576
|
/* @__PURE__ */ i("span", { children: "See upgrade options" })
|
569
577
|
] })
|
570
578
|
] });
|
571
|
-
},
|
572
|
-
|
573
|
-
const
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
const
|
584
|
-
breadcrumbsItem:
|
585
|
-
breadcrumbs:
|
586
|
-
},
|
587
|
-
/* @__PURE__ */ i(
|
588
|
-
|
589
|
-
] }, `${
|
590
|
-
!!
|
591
|
-
|
592
|
-
] },
|
593
|
-
badge:
|
594
|
-
tag:
|
595
|
-
withNavLinkStyle:
|
596
|
-
disabled:
|
597
|
-
projectNavigationItem:
|
598
|
-
projectNavigationItemDisabled:
|
599
|
-
},
|
600
|
-
/* @__PURE__ */
|
579
|
+
}, I = ({ children: e, ...t }) => /* @__PURE__ */ i("nav", { ...t, className: dn.sidebarContainer, children: e }), rr = ({ children: e }) => /* @__PURE__ */ i("div", { children: e });
|
580
|
+
I.Top = rr;
|
581
|
+
const ar = ({ children: e }) => /* @__PURE__ */ i("div", { children: e });
|
582
|
+
I.Bottom = ar;
|
583
|
+
I.Avatar = bn;
|
584
|
+
I.IconLink = hn;
|
585
|
+
I.Menu = Tn;
|
586
|
+
I.ProfileMenu = $n;
|
587
|
+
I.TeamSwitch = Zn;
|
588
|
+
I.TeamMenuItem = yt;
|
589
|
+
I.UpgradeMenuItem = nr;
|
590
|
+
I.ProfileSettingsMenuItem = zn;
|
591
|
+
const or = "_breadcrumbsItem_1hm6a_1", ir = "_breadcrumbs_1hm6a_1", et = {
|
592
|
+
breadcrumbsItem: or,
|
593
|
+
breadcrumbs: ir
|
594
|
+
}, _a = ({ items: e }) => /* @__PURE__ */ i("nav", { "aria-label": "breadcrumb", className: et.breadcrumbs, children: e.map((t, n) => /* @__PURE__ */ p(ot, { children: [
|
595
|
+
/* @__PURE__ */ i(it, { className: et.breadcrumbsItem, href: t.link, rel: "noreferrer", children: t.name }),
|
596
|
+
n < e.length - 1 && /* @__PURE__ */ i("span", { children: " — " })
|
597
|
+
] }, `${t.link}-${t.name}`)) }), sr = ({ items: e }) => /* @__PURE__ */ i(rt, { children: e.map((t, n) => /* @__PURE__ */ p(ot, { children: [
|
598
|
+
!!n && t.some((a) => a.visible) && /* @__PURE__ */ i(ct, {}),
|
599
|
+
t.filter(({ visible: a }) => a).map(({ link: a, label: o, onClick: s }) => /* @__PURE__ */ i(J, { href: a || "#", "aria-label": o, onClick: s, children: o }, o))
|
600
|
+
] }, t[0].label)) }), cr = "_badge_1pc1v_1", lr = "_tag_1pc1v_15", ur = "_withNavLinkStyle_1pc1v_42 _withLinkStyle_1pc1v_21", dr = "_disabled_1pc1v_57", mr = "_projectNavigationItem_1pc1v_61", fr = "_projectNavigationItemDisabled_1pc1v_67", R = {
|
601
|
+
badge: cr,
|
602
|
+
tag: lr,
|
603
|
+
withNavLinkStyle: ur,
|
604
|
+
disabled: dr,
|
605
|
+
projectNavigationItem: mr,
|
606
|
+
projectNavigationItemDisabled: fr
|
607
|
+
}, tt = ({ label: e, badge: t, novel: n }) => /* @__PURE__ */ p("div", { className: "flex gap-1", children: [
|
608
|
+
/* @__PURE__ */ p("div", { children: [
|
601
609
|
/* @__PURE__ */ i("span", { children: e }),
|
602
|
-
!!
|
610
|
+
!!t && /* @__PURE__ */ i("div", { className: R.badge, "aria-label": `${t} items requiring attention`, children: t > 9 ? "9+" : t })
|
603
611
|
] }),
|
604
|
-
!!
|
605
|
-
] }),
|
606
|
-
({ label: e, href:
|
612
|
+
!!n && /* @__PURE__ */ i(Lt, { className: R.tag, children: n })
|
613
|
+
] }), be = At(
|
614
|
+
({ label: e, href: t = "", disabled: n = !1, badge: a, onClick: o, novel: s }, c) => /* @__PURE__ */ i(he, { tooltip: "You do not have access to this function", show: n, children: /* @__PURE__ */ i(
|
607
615
|
"div",
|
608
616
|
{
|
609
|
-
className:
|
610
|
-
children:
|
617
|
+
className: n ? R.projectNavigationItemDisabled : R.projectNavigationItem,
|
618
|
+
children: o || n || !t ? /* @__PURE__ */ i(
|
611
619
|
"button",
|
612
620
|
{
|
613
621
|
type: "button",
|
614
|
-
ref:
|
615
|
-
className: R
|
616
|
-
[
|
622
|
+
ref: c,
|
623
|
+
className: j(R.withNavLinkStyle, {
|
624
|
+
[R.disabled]: n
|
617
625
|
}),
|
618
|
-
disabled:
|
619
|
-
onClick:
|
620
|
-
children: /* @__PURE__ */ i(
|
626
|
+
disabled: n,
|
627
|
+
onClick: o,
|
628
|
+
children: /* @__PURE__ */ i(tt, { label: e, badge: a, novel: s })
|
621
629
|
}
|
622
|
-
) : /* @__PURE__ */ i("a", { href:
|
630
|
+
) : /* @__PURE__ */ i("a", { href: t, className: R.withNavLinkStyle, children: /* @__PURE__ */ i(tt, { label: e, badge: a, novel: s }) })
|
623
631
|
}
|
624
632
|
) })
|
625
633
|
);
|
626
|
-
|
627
|
-
const
|
628
|
-
var
|
629
|
-
return
|
634
|
+
be.displayName = "NavigationTabsItem";
|
635
|
+
const br = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible))) ?? !1, _r = (e) => e.visible && (!e.dropdown || br(e.dropdown)), ga = ({ navigation: e, activeItem: t }) => /* @__PURE__ */ i("nav", { "aria-label": "Project", children: /* @__PURE__ */ i("ul", { className: A.navigationTabList, "aria-orientation": "horizontal", children: e.filter(_r).map((n) => {
|
636
|
+
var a, o, s;
|
637
|
+
return n.dropdown ? /* @__PURE__ */ i(
|
630
638
|
"li",
|
631
639
|
{
|
632
|
-
className:
|
633
|
-
"data-testid":
|
634
|
-
"aria-selected": (
|
640
|
+
className: A.navigationTab,
|
641
|
+
"data-testid": n.key,
|
642
|
+
"aria-selected": (a = n.isActive) == null ? void 0 : a.call(n, t),
|
635
643
|
children: /* @__PURE__ */ i(
|
636
|
-
|
644
|
+
pe,
|
637
645
|
{
|
638
|
-
menuButton: ({ opened:
|
639
|
-
children: /* @__PURE__ */ i(
|
646
|
+
menuButton: ({ opened: c }) => /* @__PURE__ */ i(be, { label: n.label, disabled: n.disabled, active: c }),
|
647
|
+
children: /* @__PURE__ */ i(ve, { children: /* @__PURE__ */ i(sr, { items: n.dropdown }) })
|
640
648
|
}
|
641
649
|
)
|
642
650
|
},
|
643
|
-
|
651
|
+
n.key
|
644
652
|
) : /* @__PURE__ */ i(
|
645
653
|
"li",
|
646
654
|
{
|
647
|
-
className:
|
648
|
-
"data-testid":
|
649
|
-
"aria-selected": (
|
655
|
+
className: A.navigationTab,
|
656
|
+
"data-testid": n.key,
|
657
|
+
"aria-selected": (o = n.isActive) == null ? void 0 : o.call(n, t),
|
650
658
|
children: /* @__PURE__ */ i(
|
651
|
-
|
659
|
+
be,
|
652
660
|
{
|
653
|
-
label:
|
654
|
-
href:
|
655
|
-
onClick:
|
656
|
-
disabled:
|
657
|
-
badge:
|
658
|
-
novel:
|
659
|
-
active: (
|
661
|
+
label: n.label,
|
662
|
+
href: n.link,
|
663
|
+
onClick: n.onClick,
|
664
|
+
disabled: n.disabled,
|
665
|
+
badge: n.badge,
|
666
|
+
novel: n.novel,
|
667
|
+
active: (s = n.isActive) == null ? void 0 : s.call(n, t)
|
660
668
|
}
|
661
669
|
)
|
662
670
|
},
|
663
|
-
|
671
|
+
n.key
|
664
672
|
);
|
665
|
-
}) }) })
|
673
|
+
}) }) }), gr = r.object({
|
674
|
+
accessToken: r.string(),
|
675
|
+
refreshToken: r.string()
|
676
|
+
}), hr = r.union([
|
677
|
+
r.object({ Authorization: r.string().startsWith("Bearer ") }),
|
678
|
+
r.object({ "x-csrf-token": r.string() })
|
679
|
+
]), we = ut({
|
680
|
+
description: "Takes a teamId and returns a JWT token access and refresh token for the user",
|
681
|
+
method: "post",
|
682
|
+
requestPathParamsSchema: r.object({ teamId: r.number() }),
|
683
|
+
pathResolver: (e) => `/team/${e.teamId}/actions/get-user-token`,
|
684
|
+
requestHeaderSchema: hr,
|
685
|
+
requestBodySchema: r.undefined(),
|
686
|
+
successResponseBodySchema: gr
|
687
|
+
}), pr = {
|
688
|
+
teamKeyCsrf: (e, t) => ["getUserToken", "x-csrf-token", t, e],
|
689
|
+
teamKeyJwt: (e, t) => ["getUserToken", "Authorization", `Bearer ${t}`, e]
|
690
|
+
}, vr = (e, t) => x({
|
691
|
+
...t,
|
692
|
+
queryFn: ({ queryKey: [n, a, o, s] }) => K(e, we, {
|
693
|
+
pathParams: { teamId: s },
|
694
|
+
headers: a === "x-csrf-token" ? { "x-csrf-token": o } : { Authorization: o }
|
695
|
+
})
|
696
|
+
}), wt = r.union([
|
697
|
+
r.literal("owner"),
|
698
|
+
r.literal("admin"),
|
699
|
+
r.literal("biller"),
|
700
|
+
r.literal("member")
|
701
|
+
]), Tr = r.object({
|
702
|
+
userId: r.number(),
|
703
|
+
userUuid: r.string(),
|
704
|
+
teamId: r.number(),
|
705
|
+
userTeamRole: wt,
|
706
|
+
userEmail: r.string().email(),
|
707
|
+
userName: r.string(),
|
708
|
+
userCurrentTeamId: r.number(),
|
709
|
+
planId: r.number(),
|
710
|
+
planName: r.string(),
|
711
|
+
isProviderAlpha: r.boolean(),
|
712
|
+
isFullyAuthenticated: r.boolean(),
|
713
|
+
exp: r.number()
|
714
|
+
});
|
715
|
+
function Y(e) {
|
716
|
+
try {
|
717
|
+
const t = e.split(".")[1], n = atob(t);
|
718
|
+
return Tr.parse(JSON.parse(n));
|
719
|
+
} catch {
|
720
|
+
return;
|
721
|
+
}
|
722
|
+
}
|
723
|
+
const G = class G extends CustomEvent {
|
724
|
+
constructor(t) {
|
725
|
+
super(G.eventName, {
|
726
|
+
detail: { token: t, payload: Y(t.accessToken) }
|
727
|
+
});
|
728
|
+
}
|
729
|
+
};
|
730
|
+
Re(G, "eventName", "new-jwt-issued");
|
731
|
+
let O = G;
|
732
|
+
function Se() {
|
733
|
+
const e = _e(document.cookie, "accessToken"), t = _e(document.cookie, "refreshToken");
|
734
|
+
if (!(!e || !t))
|
735
|
+
return { accessToken: e, refreshToken: t };
|
736
|
+
}
|
737
|
+
function St() {
|
738
|
+
return _e(document.cookie, "csrf_token");
|
739
|
+
}
|
740
|
+
function _e(e, t) {
|
741
|
+
var n, a;
|
742
|
+
return (a = (n = e.split(";").find((o) => o.trim().startsWith(`${t}=`))) == null ? void 0 : n.trim()) == null ? void 0 : a.substring(t.length + 1);
|
743
|
+
}
|
744
|
+
function ha(e, t) {
|
745
|
+
const n = St(), a = vr(e, {
|
746
|
+
queryKey: pr.teamKeyCsrf(t, n ?? ""),
|
747
|
+
enabled: n !== void 0
|
748
|
+
}), o = at();
|
749
|
+
return M(() => {
|
750
|
+
a.data && a.data.accessToken !== o.current && (window.dispatchEvent(new O(a.data)), o.current = a.data.accessToken);
|
751
|
+
}, [a.data]), a;
|
752
|
+
}
|
753
|
+
function It() {
|
754
|
+
const [e, t] = ge();
|
755
|
+
return M(() => {
|
756
|
+
const n = (o) => {
|
757
|
+
t(o.detail.payload);
|
758
|
+
}, a = Se();
|
759
|
+
return t(a && Y(a.accessToken)), window.addEventListener(O.eventName, n), () => {
|
760
|
+
window.removeEventListener(O.eventName, n);
|
761
|
+
};
|
762
|
+
}, []), e;
|
763
|
+
}
|
764
|
+
const yr = r.object({
|
765
|
+
user_id: r.number(),
|
766
|
+
email: r.string().email(),
|
767
|
+
fullname: r.string(),
|
768
|
+
created_at: r.string(),
|
769
|
+
created_at_timestamp: r.number(),
|
770
|
+
role: wt
|
771
|
+
}), wr = r.object({
|
772
|
+
team_id: r.number(),
|
773
|
+
team_user: yr
|
774
|
+
}), Sr = Q({
|
775
|
+
description: "Get the details of a team user",
|
776
|
+
requestPathParamsSchema: r.object({ teamId: r.number(), userId: r.number() }),
|
777
|
+
pathResolver: ({ teamId: e, userId: t }) => `/teams/${e}/users/${t}`,
|
778
|
+
successResponseBodySchema: wr
|
779
|
+
}), Ir = {
|
780
|
+
teamUserKey: (e, t) => ["GetTeamUsers", e, t]
|
781
|
+
}, Er = (e, t) => x({
|
782
|
+
...t,
|
783
|
+
queryFn: ({ queryKey: [n, a, o] }) => W(e, Sr, { pathParams: { teamId: a, userId: o } })
|
784
|
+
});
|
785
|
+
function pa(e) {
|
786
|
+
const t = It();
|
787
|
+
return Er(e, {
|
788
|
+
queryKey: Ir.teamUserKey((t == null ? void 0 : t.teamId) ?? 0, (t == null ? void 0 : t.userId) ?? 0),
|
789
|
+
enabled: (t == null ? void 0 : t.userId) !== void 0 && t.teamId !== void 0
|
790
|
+
});
|
791
|
+
}
|
792
|
+
const kr = r.object({
|
793
|
+
lang_id: r.number(),
|
794
|
+
lang_iso: r.string(),
|
795
|
+
lang_name: r.string(),
|
796
|
+
is_writable: r.union([r.literal(0), r.literal(1)])
|
797
|
+
}), Cr = r.object({
|
798
|
+
user_id: r.number(),
|
799
|
+
email: r.string().email(),
|
800
|
+
fullname: r.string(),
|
801
|
+
created_at: r.string(),
|
802
|
+
created_at_timestamp: r.number(),
|
803
|
+
admin_rights: r.array(r.string()),
|
804
|
+
languages: r.array(kr),
|
805
|
+
is_admin: r.boolean(),
|
806
|
+
is_reviewer: r.boolean()
|
807
|
+
}), Nr = r.object({
|
808
|
+
project_id: r.string(),
|
809
|
+
contributors: r.array(Cr)
|
810
|
+
}), Rr = Q({
|
811
|
+
description: "Get the details of a project contributor",
|
812
|
+
requestPathParamsSchema: r.object({ projectId: r.string(), contributorId: r.number() }),
|
813
|
+
pathResolver: ({ projectId: e, contributorId: t }) => `/projects/${e}/contributors/${t}`,
|
814
|
+
successResponseBodySchema: Nr
|
815
|
+
}), jr = {
|
816
|
+
projectUserKey: (e, t) => ["RetrieveContributor", e, t]
|
817
|
+
}, Pr = (e, t) => x({
|
818
|
+
...t,
|
819
|
+
queryFn: ({ queryKey: [n, a, o] }) => W(e, Rr, {
|
820
|
+
pathParams: { projectId: a, contributorId: o }
|
821
|
+
})
|
822
|
+
});
|
823
|
+
function va(e, t) {
|
824
|
+
const n = It();
|
825
|
+
return Pr(e, {
|
826
|
+
queryKey: jr.projectUserKey(t, (n == null ? void 0 : n.userId) ?? 0),
|
827
|
+
enabled: n !== void 0
|
828
|
+
});
|
829
|
+
}
|
830
|
+
function Ta() {
|
831
|
+
const e = Se();
|
832
|
+
if (!e)
|
833
|
+
return;
|
834
|
+
const t = Y(e.accessToken);
|
835
|
+
if (t)
|
836
|
+
return { ...e, payload: t };
|
837
|
+
}
|
838
|
+
function ya() {
|
839
|
+
return (e) => (t, n) => e(t, {
|
840
|
+
...n,
|
841
|
+
headers: {
|
842
|
+
...n.headers,
|
843
|
+
"x-lokalise-plugin": "true"
|
844
|
+
},
|
845
|
+
credentials: "omit"
|
846
|
+
});
|
847
|
+
}
|
848
|
+
function D(e) {
|
849
|
+
return { Authorization: `Bearer ${e}` };
|
850
|
+
}
|
851
|
+
function Ar(e, t) {
|
852
|
+
return (n) => async (a, o) => {
|
853
|
+
var u;
|
854
|
+
const s = await t.getCachedJwtToken();
|
855
|
+
if (s === void 0)
|
856
|
+
return n(a, o);
|
857
|
+
const c = await n(a, {
|
858
|
+
...o,
|
859
|
+
headers: { ...o.headers, ...D(s.accessToken) }
|
860
|
+
});
|
861
|
+
if (s && (c.status === 401 || c.status === 403)) {
|
862
|
+
const d = Y(s.accessToken);
|
863
|
+
if (!d)
|
864
|
+
return c;
|
865
|
+
const l = await K(e, we, {
|
866
|
+
pathParams: { teamId: d.teamId },
|
867
|
+
headers: D(s.refreshToken)
|
868
|
+
});
|
869
|
+
return await ((u = t.onNewJwtTokenIssued) == null ? void 0 : u.call(t, l)), n(a, {
|
870
|
+
...o,
|
871
|
+
headers: { ...o.headers, ...D(l.accessToken) }
|
872
|
+
});
|
873
|
+
}
|
874
|
+
return c;
|
875
|
+
};
|
876
|
+
}
|
877
|
+
const Or = {
|
878
|
+
wretch: {
|
879
|
+
lokaliseAuth(e) {
|
880
|
+
return this.middlewares([Ar(this, e)]);
|
881
|
+
}
|
882
|
+
}
|
883
|
+
};
|
884
|
+
function Lr(e, t) {
|
885
|
+
return (n) => async (a, o) => {
|
886
|
+
var d;
|
887
|
+
if (await t.getCachedJwtToken() !== void 0)
|
888
|
+
return n(a, o);
|
889
|
+
const c = await t.getCsrfToken();
|
890
|
+
if (c === void 0)
|
891
|
+
return n(a, o);
|
892
|
+
const u = await K(e, we, {
|
893
|
+
pathParams: { teamId: await t.getTeamId() },
|
894
|
+
headers: { "x-csrf-token": c }
|
895
|
+
});
|
896
|
+
return await ((d = t.onNewJwtTokenIssued) == null ? void 0 : d.call(t, u)), n(a, {
|
897
|
+
...o,
|
898
|
+
headers: { ...o.headers, ...D(u.accessToken) }
|
899
|
+
});
|
900
|
+
};
|
901
|
+
}
|
902
|
+
const wa = {
|
903
|
+
wretch: {
|
904
|
+
lokaliseAuth(e = {}) {
|
905
|
+
return this.addon(Or).lokaliseAuth(nt(e));
|
906
|
+
},
|
907
|
+
promoteClassicSession(e) {
|
908
|
+
const t = nt(e);
|
909
|
+
return this.middlewares([Lr(this, t)]);
|
910
|
+
}
|
911
|
+
}
|
912
|
+
};
|
913
|
+
function nt(e) {
|
914
|
+
return {
|
915
|
+
...e,
|
916
|
+
getCachedJwtToken: e.getCachedJwtToken ?? (async () => Se()),
|
917
|
+
getCsrfToken: "getCsrfToken" in e ? e.getCsrfToken : async () => St(),
|
918
|
+
onNewJwtTokenIssued: (t) => {
|
919
|
+
var n;
|
920
|
+
return window.dispatchEvent(new O(t)), ((n = e.onNewJwtTokenIssued) == null ? void 0 : n.call(e, t)) ?? Promise.resolve();
|
921
|
+
}
|
922
|
+
};
|
923
|
+
}
|
924
|
+
const qr = r.object({
|
925
|
+
lang_iso: r.string(),
|
926
|
+
custom_iso: r.string().optional()
|
927
|
+
}), Mr = r.object({
|
928
|
+
language_id: r.number(),
|
929
|
+
language_iso: r.string(),
|
930
|
+
progress: r.number(),
|
931
|
+
words_to_do: r.number()
|
932
|
+
}), Ie = r.union([
|
933
|
+
r.literal("localization_files"),
|
934
|
+
r.literal("paged_documents"),
|
935
|
+
r.literal("marketing")
|
936
|
+
]), xr = r.object({
|
937
|
+
per_platform_key_names: r.boolean(),
|
938
|
+
reviewing: r.boolean(),
|
939
|
+
auto_toggle_unverified: r.boolean(),
|
940
|
+
offline_translation: r.boolean(),
|
941
|
+
key_editing: r.boolean(),
|
942
|
+
inline_machine_translations: r.boolean(),
|
943
|
+
custom_translation_statuses: r.boolean(),
|
944
|
+
custom_translation_statuses_allow_multiple: r.boolean(),
|
945
|
+
segmentation: r.boolean(),
|
946
|
+
contributor_preview_download_enabled: r.boolean()
|
947
|
+
}), Ur = r.object({
|
948
|
+
not_reviewed: r.number(),
|
949
|
+
unverified: r.number(),
|
950
|
+
spelling_grammar: r.number(),
|
951
|
+
inconsistent_placeholders: r.number(),
|
952
|
+
inconsistent_html: r.number(),
|
953
|
+
different_number_of_urls: r.number(),
|
954
|
+
different_urls: r.number(),
|
955
|
+
leading_whitespace: r.number(),
|
956
|
+
trailing_whitespace: r.number(),
|
957
|
+
different_number_of_email_address: r.number(),
|
958
|
+
different_email_address: r.number(),
|
959
|
+
different_brackets: r.number(),
|
960
|
+
different_numbers: r.number(),
|
961
|
+
double_space: r.number(),
|
962
|
+
special_placeholder: r.number(),
|
963
|
+
unbalanced_brackets: r.number()
|
964
|
+
}), Br = r.object({
|
965
|
+
progress_total: r.number(),
|
966
|
+
keys_total: r.number(),
|
967
|
+
team: r.number(),
|
968
|
+
base_words: r.number(),
|
969
|
+
qa_issues_total: r.number(),
|
970
|
+
qa_issues: Ur,
|
971
|
+
languages: r.array(Mr)
|
972
|
+
}), F = r.object({
|
973
|
+
project_id: r.string(),
|
974
|
+
uuid: r.string().uuid(),
|
975
|
+
project_type: Ie,
|
976
|
+
name: r.string(),
|
977
|
+
description: r.string(),
|
978
|
+
created_at: r.string(),
|
979
|
+
created_at_timestamp: r.number(),
|
980
|
+
created_by: r.number(),
|
981
|
+
created_by_email: r.string(),
|
982
|
+
team_id: r.number(),
|
983
|
+
base_language_id: r.number(),
|
984
|
+
base_language_iso: r.string(),
|
985
|
+
settings: xr,
|
986
|
+
statistics: Br
|
987
|
+
}), $r = r.object({
|
988
|
+
name: r.string(),
|
989
|
+
team_id: r.string(),
|
990
|
+
base_lang_iso: r.string(),
|
991
|
+
languages: r.array(qr),
|
992
|
+
project_type: Ie,
|
993
|
+
is_segmentation_enabled: r.boolean()
|
994
|
+
}), Hr = r.object({
|
995
|
+
project_type: Ie.optional(),
|
996
|
+
filter_team_id: r.number().optional(),
|
997
|
+
filter_names: r.string().optional(),
|
998
|
+
include_statistics: r.boolean().optional(),
|
999
|
+
include_settings: r.boolean().optional(),
|
1000
|
+
limit: r.number().optional(),
|
1001
|
+
page: r.number().optional()
|
1002
|
+
}), Dr = r.array(
|
1003
|
+
r.union([
|
1004
|
+
F.omit({ statistics: !0, settings: !0 }),
|
1005
|
+
F.pick({ settings: !0, statistics: !0 }).partial()
|
1006
|
+
])
|
1007
|
+
), zr = r.object({
|
1008
|
+
project_id: r.string()
|
1009
|
+
}), Ee = () => "/projects", Fr = ut({
|
1010
|
+
description: "Create a new project",
|
1011
|
+
method: "post",
|
1012
|
+
pathResolver: Ee,
|
1013
|
+
requestBodySchema: $r,
|
1014
|
+
successResponseBodySchema: F
|
1015
|
+
}), Gr = Q({
|
1016
|
+
description: "List all projects",
|
1017
|
+
pathResolver: Ee,
|
1018
|
+
requestQuerySchema: Hr,
|
1019
|
+
successResponseBodySchema: Dr
|
1020
|
+
}), Jr = Q({
|
1021
|
+
description: "Retrieve a project",
|
1022
|
+
pathResolver: Ee,
|
1023
|
+
requestQuerySchema: zr,
|
1024
|
+
successResponseBodySchema: F
|
1025
|
+
});
|
1026
|
+
function Sa(e, t = {}) {
|
1027
|
+
return Mt({
|
1028
|
+
...t,
|
1029
|
+
mutationFn: (n) => K(e, Fr, {
|
1030
|
+
body: n
|
1031
|
+
})
|
1032
|
+
});
|
1033
|
+
}
|
1034
|
+
const Ia = {
|
1035
|
+
paramsKey: (e) => ["listProjects", e]
|
1036
|
+
};
|
1037
|
+
function Ea(e, t) {
|
1038
|
+
return x({
|
1039
|
+
...t,
|
1040
|
+
queryFn: ({ queryKey: [n, a] }) => W(e, Gr, {
|
1041
|
+
queryParams: a
|
1042
|
+
})
|
1043
|
+
});
|
1044
|
+
}
|
1045
|
+
const ka = {
|
1046
|
+
projectIdKey: (e) => ["retrieveProject", e]
|
1047
|
+
};
|
1048
|
+
function Ca(e, t) {
|
1049
|
+
return x({
|
1050
|
+
...t,
|
1051
|
+
queryFn: ({ queryKey: [n, a] }) => W(e, Jr, {
|
1052
|
+
queryParams: { project_id: a }
|
1053
|
+
})
|
1054
|
+
});
|
1055
|
+
}
|
666
1056
|
export {
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
1057
|
+
_a as Breadcrumbs,
|
1058
|
+
vt as ENTERPRISE_OPENSOURCE_PLAN_ID,
|
1059
|
+
Ln as ENTERPRISE_PLAN_IDS,
|
1060
|
+
An as ESSENTIAL_PLAN_IDS,
|
1061
|
+
pt as FREE_PLAN_ID,
|
1062
|
+
Or as LokaliseAuthAddon,
|
1063
|
+
wa as LokaliseAuthBrowserAddon,
|
1064
|
+
z as NavigationPanel,
|
1065
|
+
ga as NavigationTabs,
|
1066
|
+
On as PRO_PLAN_IDS,
|
1067
|
+
Pn as START_PLAN_IDS,
|
1068
|
+
I as Sidebar,
|
1069
|
+
jn as TRIAL_PLAN_ID,
|
1070
|
+
ua as convertNewLineToBreakTag,
|
1071
|
+
Fr as createProject,
|
1072
|
+
ma as formatDate,
|
1073
|
+
fa as formatDateTz,
|
1074
|
+
Ta as getAuthenticatedSessionDetailFromRequest,
|
1075
|
+
Sr as getTeamUser,
|
1076
|
+
Ir as getTeamUsersQueryKey,
|
1077
|
+
we as getUserToken,
|
1078
|
+
pr as getUserTokenKey,
|
1079
|
+
la as isEnterpriseOpenSourcePlan,
|
1080
|
+
sa as isEnterprisePlan,
|
1081
|
+
oa as isEssentialPlan,
|
1082
|
+
ye as isFreePlan,
|
1083
|
+
ca as isPaidPlan,
|
1084
|
+
ia as isProPlan,
|
1085
|
+
aa as isStartPlan,
|
1086
|
+
Tt as isTrialPlan,
|
1087
|
+
Gr as listProjects,
|
1088
|
+
Ia as listProjectsKey,
|
1089
|
+
da as makeUrlClickable,
|
1090
|
+
Y as parseJwtTokenPayload,
|
1091
|
+
ya as publicApiHeadersMiddleware,
|
1092
|
+
Rr as retrieveContributor,
|
1093
|
+
jr as retrieveContributorKeys,
|
1094
|
+
Jr as retrieveProject,
|
1095
|
+
ka as retrieveProjectQueryKey,
|
1096
|
+
va as useAuthenticatedProjectContributor,
|
1097
|
+
It as useAuthenticatedSessionPayload,
|
1098
|
+
pa as useAuthenticatedUser,
|
1099
|
+
Sa as useCreateProjectMutation,
|
1100
|
+
ba as useEffectOnce,
|
1101
|
+
ha as useGetPromotedClassicSessionJwtQuery,
|
1102
|
+
Er as useGetTeamUsersQuery,
|
1103
|
+
vr as useGetUserTokenQuery,
|
1104
|
+
Ea as useListProjectsQuery,
|
1105
|
+
Pr as useRetrieveContributorQuery,
|
1106
|
+
Ca as useRetrieveProjectQuery
|
691
1107
|
};
|