maquinaweb-ui 2.47.3 → 2.47.4
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/dist/SystemSwitcherClient-BIpzOqMI.js +782 -0
- package/dist/SystemSwitcherClient-BIpzOqMI.js.map +1 -0
- package/dist/{button-B_p2e40T.js → button-DnQZXb45.js} +2 -2
- package/dist/{button-B_p2e40T.js.map → button-DnQZXb45.js.map} +1 -1
- package/dist/container-animation.d.ts +2 -2
- package/dist/container-animation.js +1 -1
- package/dist/date-field.d.ts +2 -2
- package/dist/date-field.js +6 -6
- package/dist/{input-help-D1JqF0YH.js → input-help-BqUOABJL.js} +3 -3
- package/dist/{input-help-D1JqF0YH.js.map → input-help-BqUOABJL.js.map} +1 -1
- package/dist/input-suggest.d.ts +2 -2
- package/dist/input-suggest.d.ts.map +1 -1
- package/dist/input-suggest.js +6 -6
- package/dist/{input-Bs61WBGW.js → input-t_PMoxhA.js} +2 -2
- package/dist/{input-Bs61WBGW.js.map → input-t_PMoxhA.js.map} +1 -1
- package/dist/{label-Bkg7B2j8.js → label-Dups7OHw.js} +2 -2
- package/dist/{label-Bkg7B2j8.js.map → label-Dups7OHw.js.map} +1 -1
- package/dist/page-header.d.ts +2 -2
- package/dist/page-header.d.ts.map +1 -1
- package/dist/page-header.js +3 -3
- package/dist/{popover-BQgd_AEd.js → popover-QIIEGl4K.js} +2 -2
- package/dist/{popover-BQgd_AEd.js.map → popover-QIIEGl4K.js.map} +1 -1
- package/dist/remote-selector.d.ts +3 -3
- package/dist/remote-selector.js +6 -6
- package/dist/{scroll-area-uROqFRFb.js → scroll-area-DF-8-fNu.js} +2 -2
- package/dist/{scroll-area-uROqFRFb.js.map → scroll-area-DF-8-fNu.js.map} +1 -1
- package/dist/split-text-poor.js +1 -1
- package/dist/system-switcher-client.d.ts +2 -2
- package/dist/system-switcher-client.js +3 -3
- package/dist/system-switcher.d.ts +2 -2
- package/dist/system-switcher.js +3 -3
- package/dist/text-field.d.ts +5 -5
- package/dist/text-field.js +4 -4
- package/dist/toggle-field.js +2 -2
- package/dist/{utils-C8_amEgK.js → utils-VsyQIiNl.js} +1 -1
- package/dist/{utils-C8_amEgK.js.map → utils-VsyQIiNl.js.map} +1 -1
- package/package.json +1 -1
- package/dist/SystemSwitcherClient-BQkpYndr.js +0 -91
- package/dist/SystemSwitcherClient-BQkpYndr.js.map +0 -1
|
@@ -0,0 +1,782 @@
|
|
|
1
|
+
import { n as PopoverContent, r as PopoverTrigger, t as Popover } from "./popover-QIIEGl4K.js";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { ChevronsUpDown, Lock } from "lucide-react";
|
|
5
|
+
import Image from "next/image";
|
|
6
|
+
|
|
7
|
+
//#region rolldown:runtime
|
|
8
|
+
var __create = Object.create;
|
|
9
|
+
var __defProp = Object.defineProperty;
|
|
10
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
11
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
12
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __commonJS = (cb, mod) => function() {
|
|
15
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
16
|
+
};
|
|
17
|
+
var __copyProps = (to, from, except, desc) => {
|
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
19
|
+
key = keys[i];
|
|
20
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
21
|
+
get: ((k) => from[k]).bind(null, key),
|
|
22
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return to;
|
|
26
|
+
};
|
|
27
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: true
|
|
30
|
+
}) : target, mod));
|
|
31
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
|
|
32
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
33
|
+
throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function.");
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region node_modules/cookies-next/lib/common/types.js
|
|
38
|
+
var require_types = /* @__PURE__ */ __commonJS({ "node_modules/cookies-next/lib/common/types.js": ((exports) => {
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
}) });
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region node_modules/cookie/dist/index.js
|
|
44
|
+
var require_dist = /* @__PURE__ */ __commonJS({ "node_modules/cookie/dist/index.js": ((exports) => {
|
|
45
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.parseCookie = parseCookie;
|
|
47
|
+
exports.parse = parseCookie;
|
|
48
|
+
exports.stringifyCookie = stringifyCookie;
|
|
49
|
+
exports.stringifySetCookie = stringifySetCookie;
|
|
50
|
+
exports.serialize = stringifySetCookie;
|
|
51
|
+
exports.parseSetCookie = parseSetCookie;
|
|
52
|
+
exports.stringifySetCookie = stringifySetCookie;
|
|
53
|
+
exports.serialize = stringifySetCookie;
|
|
54
|
+
/**
|
|
55
|
+
* RegExp to match cookie-name in RFC 6265 sec 4.1.1
|
|
56
|
+
* This refers out to the obsoleted definition of token in RFC 2616 sec 2.2
|
|
57
|
+
* which has been replaced by the token definition in RFC 7230 appendix B.
|
|
58
|
+
*
|
|
59
|
+
* cookie-name = token
|
|
60
|
+
* token = 1*tchar
|
|
61
|
+
* tchar = "!" / "#" / "$" / "%" / "&" / "'" /
|
|
62
|
+
* "*" / "+" / "-" / "." / "^" / "_" /
|
|
63
|
+
* "`" / "|" / "~" / DIGIT / ALPHA
|
|
64
|
+
*
|
|
65
|
+
* Note: Allowing more characters - https://github.com/jshttp/cookie/issues/191
|
|
66
|
+
* Allow same range as cookie value, except `=`, which delimits end of name.
|
|
67
|
+
*/
|
|
68
|
+
const cookieNameRegExp = /^[\u0021-\u003A\u003C\u003E-\u007E]+$/;
|
|
69
|
+
/**
|
|
70
|
+
* RegExp to match cookie-value in RFC 6265 sec 4.1.1
|
|
71
|
+
*
|
|
72
|
+
* cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
|
|
73
|
+
* cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
|
|
74
|
+
* ; US-ASCII characters excluding CTLs,
|
|
75
|
+
* ; whitespace DQUOTE, comma, semicolon,
|
|
76
|
+
* ; and backslash
|
|
77
|
+
*
|
|
78
|
+
* Allowing more characters: https://github.com/jshttp/cookie/issues/191
|
|
79
|
+
* Comma, backslash, and DQUOTE are not part of the parsing algorithm.
|
|
80
|
+
*/
|
|
81
|
+
const cookieValueRegExp = /^[\u0021-\u003A\u003C-\u007E]*$/;
|
|
82
|
+
/**
|
|
83
|
+
* RegExp to match domain-value in RFC 6265 sec 4.1.1
|
|
84
|
+
*
|
|
85
|
+
* domain-value = <subdomain>
|
|
86
|
+
* ; defined in [RFC1034], Section 3.5, as
|
|
87
|
+
* ; enhanced by [RFC1123], Section 2.1
|
|
88
|
+
* <subdomain> = <label> | <subdomain> "." <label>
|
|
89
|
+
* <label> = <let-dig> [ [ <ldh-str> ] <let-dig> ]
|
|
90
|
+
* Labels must be 63 characters or less.
|
|
91
|
+
* 'let-dig' not 'letter' in the first char, per RFC1123
|
|
92
|
+
* <ldh-str> = <let-dig-hyp> | <let-dig-hyp> <ldh-str>
|
|
93
|
+
* <let-dig-hyp> = <let-dig> | "-"
|
|
94
|
+
* <let-dig> = <letter> | <digit>
|
|
95
|
+
* <letter> = any one of the 52 alphabetic characters A through Z in
|
|
96
|
+
* upper case and a through z in lower case
|
|
97
|
+
* <digit> = any one of the ten digits 0 through 9
|
|
98
|
+
*
|
|
99
|
+
* Keep support for leading dot: https://github.com/jshttp/cookie/issues/173
|
|
100
|
+
*
|
|
101
|
+
* > (Note that a leading %x2E ("."), if present, is ignored even though that
|
|
102
|
+
* character is not permitted, but a trailing %x2E ("."), if present, will
|
|
103
|
+
* cause the user agent to ignore the attribute.)
|
|
104
|
+
*/
|
|
105
|
+
const domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i;
|
|
106
|
+
/**
|
|
107
|
+
* RegExp to match path-value in RFC 6265 sec 4.1.1
|
|
108
|
+
*
|
|
109
|
+
* path-value = <any CHAR except CTLs or ";">
|
|
110
|
+
* CHAR = %x01-7F
|
|
111
|
+
* ; defined in RFC 5234 appendix B.1
|
|
112
|
+
*/
|
|
113
|
+
const pathValueRegExp = /^[\u0020-\u003A\u003D-\u007E]*$/;
|
|
114
|
+
/**
|
|
115
|
+
* RegExp to match max-age-value in RFC 6265 sec 5.6.2
|
|
116
|
+
*/
|
|
117
|
+
const maxAgeRegExp = /^-?\d+$/;
|
|
118
|
+
const __toString = Object.prototype.toString;
|
|
119
|
+
const NullObject = /* @__PURE__ */ (() => {
|
|
120
|
+
const C = function() {};
|
|
121
|
+
C.prototype = Object.create(null);
|
|
122
|
+
return C;
|
|
123
|
+
})();
|
|
124
|
+
/**
|
|
125
|
+
* Parse a `Cookie` header.
|
|
126
|
+
*
|
|
127
|
+
* Parse the given cookie header string into an object
|
|
128
|
+
* The object has the various cookies as keys(names) => values
|
|
129
|
+
*/
|
|
130
|
+
function parseCookie(str, options) {
|
|
131
|
+
const obj = new NullObject();
|
|
132
|
+
const len = str.length;
|
|
133
|
+
if (len < 2) return obj;
|
|
134
|
+
const dec = options?.decode || decode$1;
|
|
135
|
+
let index = 0;
|
|
136
|
+
do {
|
|
137
|
+
const eqIdx = eqIndex(str, index, len);
|
|
138
|
+
if (eqIdx === -1) break;
|
|
139
|
+
const endIdx = endIndex(str, index, len);
|
|
140
|
+
if (eqIdx > endIdx) {
|
|
141
|
+
index = str.lastIndexOf(";", eqIdx - 1) + 1;
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
const key = valueSlice(str, index, eqIdx);
|
|
145
|
+
if (obj[key] === void 0) obj[key] = dec(valueSlice(str, eqIdx + 1, endIdx));
|
|
146
|
+
index = endIdx + 1;
|
|
147
|
+
} while (index < len);
|
|
148
|
+
return obj;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Stringifies an object into an HTTP `Cookie` header.
|
|
152
|
+
*/
|
|
153
|
+
function stringifyCookie(cookie, options) {
|
|
154
|
+
const enc = options?.encode || encodeURIComponent;
|
|
155
|
+
const cookieStrings = [];
|
|
156
|
+
for (const name of Object.keys(cookie)) {
|
|
157
|
+
const val = cookie[name];
|
|
158
|
+
if (val === void 0) continue;
|
|
159
|
+
if (!cookieNameRegExp.test(name)) throw new TypeError(`cookie name is invalid: ${name}`);
|
|
160
|
+
const value = enc(val);
|
|
161
|
+
if (!cookieValueRegExp.test(value)) throw new TypeError(`cookie val is invalid: ${val}`);
|
|
162
|
+
cookieStrings.push(`${name}=${value}`);
|
|
163
|
+
}
|
|
164
|
+
return cookieStrings.join("; ");
|
|
165
|
+
}
|
|
166
|
+
function stringifySetCookie(_name, _val, _opts) {
|
|
167
|
+
const cookie = typeof _name === "object" ? _name : {
|
|
168
|
+
..._opts,
|
|
169
|
+
name: _name,
|
|
170
|
+
value: String(_val)
|
|
171
|
+
};
|
|
172
|
+
const enc = (typeof _val === "object" ? _val : _opts)?.encode || encodeURIComponent;
|
|
173
|
+
if (!cookieNameRegExp.test(cookie.name)) throw new TypeError(`argument name is invalid: ${cookie.name}`);
|
|
174
|
+
const value = cookie.value ? enc(cookie.value) : "";
|
|
175
|
+
if (!cookieValueRegExp.test(value)) throw new TypeError(`argument val is invalid: ${cookie.value}`);
|
|
176
|
+
let str = cookie.name + "=" + value;
|
|
177
|
+
if (cookie.maxAge !== void 0) {
|
|
178
|
+
if (!Number.isInteger(cookie.maxAge)) throw new TypeError(`option maxAge is invalid: ${cookie.maxAge}`);
|
|
179
|
+
str += "; Max-Age=" + cookie.maxAge;
|
|
180
|
+
}
|
|
181
|
+
if (cookie.domain) {
|
|
182
|
+
if (!domainValueRegExp.test(cookie.domain)) throw new TypeError(`option domain is invalid: ${cookie.domain}`);
|
|
183
|
+
str += "; Domain=" + cookie.domain;
|
|
184
|
+
}
|
|
185
|
+
if (cookie.path) {
|
|
186
|
+
if (!pathValueRegExp.test(cookie.path)) throw new TypeError(`option path is invalid: ${cookie.path}`);
|
|
187
|
+
str += "; Path=" + cookie.path;
|
|
188
|
+
}
|
|
189
|
+
if (cookie.expires) {
|
|
190
|
+
if (!isDate(cookie.expires) || !Number.isFinite(cookie.expires.valueOf())) throw new TypeError(`option expires is invalid: ${cookie.expires}`);
|
|
191
|
+
str += "; Expires=" + cookie.expires.toUTCString();
|
|
192
|
+
}
|
|
193
|
+
if (cookie.httpOnly) str += "; HttpOnly";
|
|
194
|
+
if (cookie.secure) str += "; Secure";
|
|
195
|
+
if (cookie.partitioned) str += "; Partitioned";
|
|
196
|
+
if (cookie.priority) switch (typeof cookie.priority === "string" ? cookie.priority.toLowerCase() : void 0) {
|
|
197
|
+
case "low":
|
|
198
|
+
str += "; Priority=Low";
|
|
199
|
+
break;
|
|
200
|
+
case "medium":
|
|
201
|
+
str += "; Priority=Medium";
|
|
202
|
+
break;
|
|
203
|
+
case "high":
|
|
204
|
+
str += "; Priority=High";
|
|
205
|
+
break;
|
|
206
|
+
default: throw new TypeError(`option priority is invalid: ${cookie.priority}`);
|
|
207
|
+
}
|
|
208
|
+
if (cookie.sameSite) switch (typeof cookie.sameSite === "string" ? cookie.sameSite.toLowerCase() : cookie.sameSite) {
|
|
209
|
+
case true:
|
|
210
|
+
case "strict":
|
|
211
|
+
str += "; SameSite=Strict";
|
|
212
|
+
break;
|
|
213
|
+
case "lax":
|
|
214
|
+
str += "; SameSite=Lax";
|
|
215
|
+
break;
|
|
216
|
+
case "none":
|
|
217
|
+
str += "; SameSite=None";
|
|
218
|
+
break;
|
|
219
|
+
default: throw new TypeError(`option sameSite is invalid: ${cookie.sameSite}`);
|
|
220
|
+
}
|
|
221
|
+
return str;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Deserialize a `Set-Cookie` header into an object.
|
|
225
|
+
*
|
|
226
|
+
* deserialize('foo=bar; httpOnly')
|
|
227
|
+
* => { name: 'foo', value: 'bar', httpOnly: true }
|
|
228
|
+
*/
|
|
229
|
+
function parseSetCookie(str, options) {
|
|
230
|
+
const dec = options?.decode || decode$1;
|
|
231
|
+
const len = str.length;
|
|
232
|
+
const endIdx = endIndex(str, 0, len);
|
|
233
|
+
const eqIdx = eqIndex(str, 0, endIdx);
|
|
234
|
+
const setCookie$2 = eqIdx === -1 ? {
|
|
235
|
+
name: "",
|
|
236
|
+
value: dec(valueSlice(str, 0, endIdx))
|
|
237
|
+
} : {
|
|
238
|
+
name: valueSlice(str, 0, eqIdx),
|
|
239
|
+
value: dec(valueSlice(str, eqIdx + 1, endIdx))
|
|
240
|
+
};
|
|
241
|
+
let index = endIdx + 1;
|
|
242
|
+
while (index < len) {
|
|
243
|
+
const endIdx$1 = endIndex(str, index, len);
|
|
244
|
+
const eqIdx$1 = eqIndex(str, index, endIdx$1);
|
|
245
|
+
const attr = eqIdx$1 === -1 ? valueSlice(str, index, endIdx$1) : valueSlice(str, index, eqIdx$1);
|
|
246
|
+
const val = eqIdx$1 === -1 ? void 0 : valueSlice(str, eqIdx$1 + 1, endIdx$1);
|
|
247
|
+
switch (attr.toLowerCase()) {
|
|
248
|
+
case "httponly":
|
|
249
|
+
setCookie$2.httpOnly = true;
|
|
250
|
+
break;
|
|
251
|
+
case "secure":
|
|
252
|
+
setCookie$2.secure = true;
|
|
253
|
+
break;
|
|
254
|
+
case "partitioned":
|
|
255
|
+
setCookie$2.partitioned = true;
|
|
256
|
+
break;
|
|
257
|
+
case "domain":
|
|
258
|
+
setCookie$2.domain = val;
|
|
259
|
+
break;
|
|
260
|
+
case "path":
|
|
261
|
+
setCookie$2.path = val;
|
|
262
|
+
break;
|
|
263
|
+
case "max-age":
|
|
264
|
+
if (val && maxAgeRegExp.test(val)) setCookie$2.maxAge = Number(val);
|
|
265
|
+
break;
|
|
266
|
+
case "expires":
|
|
267
|
+
if (!val) break;
|
|
268
|
+
const date = new Date(val);
|
|
269
|
+
if (Number.isFinite(date.valueOf())) setCookie$2.expires = date;
|
|
270
|
+
break;
|
|
271
|
+
case "priority":
|
|
272
|
+
if (!val) break;
|
|
273
|
+
const priority = val.toLowerCase();
|
|
274
|
+
if (priority === "low" || priority === "medium" || priority === "high") setCookie$2.priority = priority;
|
|
275
|
+
break;
|
|
276
|
+
case "samesite":
|
|
277
|
+
if (!val) break;
|
|
278
|
+
const sameSite = val.toLowerCase();
|
|
279
|
+
if (sameSite === "lax" || sameSite === "strict" || sameSite === "none") setCookie$2.sameSite = sameSite;
|
|
280
|
+
break;
|
|
281
|
+
}
|
|
282
|
+
index = endIdx$1 + 1;
|
|
283
|
+
}
|
|
284
|
+
return setCookie$2;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Find the `;` character between `min` and `len` in str.
|
|
288
|
+
*/
|
|
289
|
+
function endIndex(str, min, len) {
|
|
290
|
+
const index = str.indexOf(";", min);
|
|
291
|
+
return index === -1 ? len : index;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Find the `=` character between `min` and `max` in str.
|
|
295
|
+
*/
|
|
296
|
+
function eqIndex(str, min, max) {
|
|
297
|
+
const index = str.indexOf("=", min);
|
|
298
|
+
return index < max ? index : -1;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Slice out a value between startPod to max.
|
|
302
|
+
*/
|
|
303
|
+
function valueSlice(str, min, max) {
|
|
304
|
+
let start = min;
|
|
305
|
+
let end = max;
|
|
306
|
+
do {
|
|
307
|
+
const code = str.charCodeAt(start);
|
|
308
|
+
if (code !== 32 && code !== 9) break;
|
|
309
|
+
} while (++start < end);
|
|
310
|
+
while (end > start) {
|
|
311
|
+
const code = str.charCodeAt(end - 1);
|
|
312
|
+
if (code !== 32 && code !== 9) break;
|
|
313
|
+
end--;
|
|
314
|
+
}
|
|
315
|
+
return str.slice(start, end);
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* URL-decode string value. Optimized to skip native call when no %.
|
|
319
|
+
*/
|
|
320
|
+
function decode$1(str) {
|
|
321
|
+
if (str.indexOf("%") === -1) return str;
|
|
322
|
+
try {
|
|
323
|
+
return decodeURIComponent(str);
|
|
324
|
+
} catch (e) {
|
|
325
|
+
return str;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Determine if value is a Date.
|
|
330
|
+
*/
|
|
331
|
+
function isDate(val) {
|
|
332
|
+
return __toString.call(val) === "[object Date]";
|
|
333
|
+
}
|
|
334
|
+
}) });
|
|
335
|
+
|
|
336
|
+
//#endregion
|
|
337
|
+
//#region node_modules/cookies-next/lib/common/utils.js
|
|
338
|
+
var require_utils = /* @__PURE__ */ __commonJS({ "node_modules/cookies-next/lib/common/utils.js": ((exports) => {
|
|
339
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
340
|
+
exports.getRenderPhase = exports.isClientSide = exports.decode = exports.stringify = void 0;
|
|
341
|
+
var stringify = function(value) {
|
|
342
|
+
try {
|
|
343
|
+
if (typeof value === "string") return value;
|
|
344
|
+
return JSON.stringify(value);
|
|
345
|
+
} catch (e) {
|
|
346
|
+
return value;
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
exports.stringify = stringify;
|
|
350
|
+
var decode = function(str) {
|
|
351
|
+
if (!str) return str;
|
|
352
|
+
return str.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
|
|
353
|
+
};
|
|
354
|
+
exports.decode = decode;
|
|
355
|
+
var isClientSide = function(options) {
|
|
356
|
+
return !(options === null || options === void 0 ? void 0 : options.req) && !(options === null || options === void 0 ? void 0 : options.res) && !(options && "cookies" in options && (options === null || options === void 0 ? void 0 : options.cookies));
|
|
357
|
+
};
|
|
358
|
+
exports.isClientSide = isClientSide;
|
|
359
|
+
var getRenderPhase = function() {
|
|
360
|
+
return typeof window === "undefined" ? "server" : "client";
|
|
361
|
+
};
|
|
362
|
+
exports.getRenderPhase = getRenderPhase;
|
|
363
|
+
}) });
|
|
364
|
+
|
|
365
|
+
//#endregion
|
|
366
|
+
//#region node_modules/cookies-next/lib/client/cookie-functions.js
|
|
367
|
+
var require_cookie_functions = /* @__PURE__ */ __commonJS({ "node_modules/cookies-next/lib/client/cookie-functions.js": ((exports) => {
|
|
368
|
+
var __assign$1 = exports && exports.__assign || function() {
|
|
369
|
+
__assign$1 = Object.assign || function(t) {
|
|
370
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
371
|
+
s = arguments[i];
|
|
372
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
373
|
+
}
|
|
374
|
+
return t;
|
|
375
|
+
};
|
|
376
|
+
return __assign$1.apply(this, arguments);
|
|
377
|
+
};
|
|
378
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
379
|
+
exports.revalidateCookies = exports.hasCookie = exports.deleteCookie = exports.setCookie = exports.getCookie = exports.getCookies = void 0;
|
|
380
|
+
var cookie_1 = require_dist();
|
|
381
|
+
var utils_1$1 = require_utils();
|
|
382
|
+
var ensureClientSide = function(options) {
|
|
383
|
+
if (!(0, utils_1$1.isClientSide)(options)) throw new Error("You are trying to access cookies on the server side. Please, use the server-side import with `cookies-next/server` instead.");
|
|
384
|
+
};
|
|
385
|
+
var getCookies = function(_options) {
|
|
386
|
+
ensureClientSide(_options);
|
|
387
|
+
if ((0, utils_1$1.getRenderPhase)() === "server") return;
|
|
388
|
+
var cookies = {};
|
|
389
|
+
var documentCookies = document.cookie ? document.cookie.split("; ") : [];
|
|
390
|
+
for (var i = 0, len = documentCookies.length; i < len; i++) {
|
|
391
|
+
var cookieParts = documentCookies[i].split("=");
|
|
392
|
+
var cookie = cookieParts.slice(1).join("=");
|
|
393
|
+
var name_1 = cookieParts[0];
|
|
394
|
+
cookies[name_1] = cookie;
|
|
395
|
+
}
|
|
396
|
+
return cookies;
|
|
397
|
+
};
|
|
398
|
+
exports.getCookies = getCookies;
|
|
399
|
+
var getCookie = function(key, options) {
|
|
400
|
+
ensureClientSide(options);
|
|
401
|
+
var _cookies = getCookies(options);
|
|
402
|
+
var value = _cookies === null || _cookies === void 0 ? void 0 : _cookies[key];
|
|
403
|
+
if (value === void 0) return void 0;
|
|
404
|
+
return (0, utils_1$1.decode)(value);
|
|
405
|
+
};
|
|
406
|
+
exports.getCookie = getCookie;
|
|
407
|
+
var setCookie$1 = function(key, data, options) {
|
|
408
|
+
ensureClientSide(options);
|
|
409
|
+
if ((0, utils_1$1.getRenderPhase)() === "server") return;
|
|
410
|
+
var _cookieOptions = options || {};
|
|
411
|
+
var cookieStr = (0, cookie_1.serialize)(key, (0, utils_1$1.stringify)(data), __assign$1({ path: "/" }, _cookieOptions));
|
|
412
|
+
document.cookie = cookieStr;
|
|
413
|
+
};
|
|
414
|
+
exports.setCookie = setCookie$1;
|
|
415
|
+
var deleteCookie = function(key, options) {
|
|
416
|
+
ensureClientSide(options);
|
|
417
|
+
setCookie$1(key, "", __assign$1(__assign$1({}, options), { maxAge: -1 }));
|
|
418
|
+
};
|
|
419
|
+
exports.deleteCookie = deleteCookie;
|
|
420
|
+
var hasCookie = function(key, options) {
|
|
421
|
+
ensureClientSide(options);
|
|
422
|
+
if (!key) return false;
|
|
423
|
+
var cookies = getCookies(options);
|
|
424
|
+
if (!cookies) return false;
|
|
425
|
+
return Object.prototype.hasOwnProperty.call(cookies, key);
|
|
426
|
+
};
|
|
427
|
+
exports.hasCookie = hasCookie;
|
|
428
|
+
var revalidateCookies = function(onChange, previousCookies) {
|
|
429
|
+
ensureClientSide();
|
|
430
|
+
if ((0, utils_1$1.getRenderPhase)() === "server") return;
|
|
431
|
+
var currentCookies = getCookies();
|
|
432
|
+
if (Object.keys(__assign$1(__assign$1({}, currentCookies), previousCookies)).some(function(key) {
|
|
433
|
+
return (currentCookies === null || currentCookies === void 0 ? void 0 : currentCookies[key]) !== (previousCookies === null || previousCookies === void 0 ? void 0 : previousCookies[key]);
|
|
434
|
+
})) {
|
|
435
|
+
onChange(currentCookies);
|
|
436
|
+
previousCookies = currentCookies;
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
exports.revalidateCookies = revalidateCookies;
|
|
440
|
+
}) });
|
|
441
|
+
|
|
442
|
+
//#endregion
|
|
443
|
+
//#region node_modules/cookies-next/lib/client/context.js
|
|
444
|
+
var require_context = /* @__PURE__ */ __commonJS({ "node_modules/cookies-next/lib/client/context.js": ((exports) => {
|
|
445
|
+
var __assign = exports && exports.__assign || function() {
|
|
446
|
+
__assign = Object.assign || function(t) {
|
|
447
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
448
|
+
s = arguments[i];
|
|
449
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
450
|
+
}
|
|
451
|
+
return t;
|
|
452
|
+
};
|
|
453
|
+
return __assign.apply(this, arguments);
|
|
454
|
+
};
|
|
455
|
+
var __createBinding$1 = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
456
|
+
if (k2 === void 0) k2 = k;
|
|
457
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
458
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
459
|
+
enumerable: true,
|
|
460
|
+
get: function() {
|
|
461
|
+
return m[k];
|
|
462
|
+
}
|
|
463
|
+
};
|
|
464
|
+
Object.defineProperty(o, k2, desc);
|
|
465
|
+
}) : (function(o, m, k, k2) {
|
|
466
|
+
if (k2 === void 0) k2 = k;
|
|
467
|
+
o[k2] = m[k];
|
|
468
|
+
}));
|
|
469
|
+
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
470
|
+
Object.defineProperty(o, "default", {
|
|
471
|
+
enumerable: true,
|
|
472
|
+
value: v
|
|
473
|
+
});
|
|
474
|
+
}) : function(o, v) {
|
|
475
|
+
o["default"] = v;
|
|
476
|
+
});
|
|
477
|
+
var __importStar = exports && exports.__importStar || function(mod) {
|
|
478
|
+
if (mod && mod.__esModule) return mod;
|
|
479
|
+
var result = {};
|
|
480
|
+
if (mod != null) {
|
|
481
|
+
for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding$1(result, mod, k);
|
|
482
|
+
}
|
|
483
|
+
__setModuleDefault(result, mod);
|
|
484
|
+
return result;
|
|
485
|
+
};
|
|
486
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
487
|
+
exports.CookieProvider = exports.CookieContext = void 0;
|
|
488
|
+
var react_1$1 = __importStar(__require("react"));
|
|
489
|
+
var _1 = require_client();
|
|
490
|
+
var utils_1 = require_utils();
|
|
491
|
+
exports.CookieContext = (0, react_1$1.createContext)(null);
|
|
492
|
+
function CookieProvider(_a) {
|
|
493
|
+
var children = _a.children, pollingOptions = _a.pollingOptions;
|
|
494
|
+
var _b = (0, react_1$1.useState)({}), cookies = _b[0], setCookies = _b[1];
|
|
495
|
+
(0, react_1$1.useEffect)(function() {
|
|
496
|
+
var initialCookies = (0, _1.getCookies)();
|
|
497
|
+
if (!initialCookies) return;
|
|
498
|
+
setCookies(initialCookies);
|
|
499
|
+
}, []);
|
|
500
|
+
(0, _1.useCookiesPolling)(function(newCookies) {
|
|
501
|
+
if (newCookies) setCookies(newCookies);
|
|
502
|
+
}, pollingOptions);
|
|
503
|
+
var value = (0, react_1$1.useMemo)(function() {
|
|
504
|
+
return {
|
|
505
|
+
cookies,
|
|
506
|
+
set: function(key, data) {
|
|
507
|
+
setCookies(function(prev) {
|
|
508
|
+
var _a$1;
|
|
509
|
+
return __assign(__assign({}, prev), (_a$1 = {}, _a$1[key] = encodeURIComponent((0, utils_1.stringify)(data)), _a$1));
|
|
510
|
+
});
|
|
511
|
+
},
|
|
512
|
+
get: function(key) {
|
|
513
|
+
return cookies === null || cookies === void 0 ? void 0 : cookies[key];
|
|
514
|
+
},
|
|
515
|
+
getAll: function() {
|
|
516
|
+
return cookies;
|
|
517
|
+
},
|
|
518
|
+
has: function(key) {
|
|
519
|
+
return cookies.hasOwnProperty(key);
|
|
520
|
+
},
|
|
521
|
+
delete: function(key) {
|
|
522
|
+
if (!cookies.hasOwnProperty(key)) return;
|
|
523
|
+
setCookies(function(prev) {
|
|
524
|
+
var newCookies = __assign({}, prev);
|
|
525
|
+
delete newCookies[key];
|
|
526
|
+
return newCookies;
|
|
527
|
+
});
|
|
528
|
+
},
|
|
529
|
+
revalidateCookiesState: function() {
|
|
530
|
+
(0, _1.revalidateCookies)(function(newCookies) {
|
|
531
|
+
if (!newCookies) return;
|
|
532
|
+
setCookies(newCookies);
|
|
533
|
+
}, cookies);
|
|
534
|
+
}
|
|
535
|
+
};
|
|
536
|
+
}, [cookies]);
|
|
537
|
+
return react_1$1.default.createElement(exports.CookieContext.Provider, { value }, children);
|
|
538
|
+
}
|
|
539
|
+
exports.CookieProvider = CookieProvider;
|
|
540
|
+
}) });
|
|
541
|
+
|
|
542
|
+
//#endregion
|
|
543
|
+
//#region node_modules/cookies-next/lib/client/hooks.js
|
|
544
|
+
var require_hooks = /* @__PURE__ */ __commonJS({ "node_modules/cookies-next/lib/client/hooks.js": ((exports) => {
|
|
545
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
546
|
+
exports.useRevalidateCookiesState = exports.useReactiveHasCookie = exports.useReactiveDeleteCookie = exports.useReactiveSetCookie = exports.useReactiveGetCookie = exports.useReactiveGetCookies = exports.useReactiveCookiesNext = exports.useCookiesNext = exports.useHasCookie = exports.useDeleteCookie = exports.useSetCookie = exports.useGetCookie = exports.useGetCookies = exports.useCookiesPolling = void 0;
|
|
547
|
+
var context_1$1 = require_context();
|
|
548
|
+
var react_1 = __require("react");
|
|
549
|
+
var cookie_functions_1 = require_cookie_functions();
|
|
550
|
+
var useWrappedCookieFn = function(cookieFnCb) {
|
|
551
|
+
var _a = (0, react_1.useState)(false), isMounted = _a[0], setIsMounted = _a[1];
|
|
552
|
+
(0, react_1.useEffect)(function() {
|
|
553
|
+
setIsMounted(true);
|
|
554
|
+
}, []);
|
|
555
|
+
return isMounted ? cookieFnCb : (function() {});
|
|
556
|
+
};
|
|
557
|
+
var useCookieContext = function() {
|
|
558
|
+
var context = (0, react_1.useContext)(context_1$1.CookieContext);
|
|
559
|
+
if (!context) throw new Error("useCookieContext must be used within a CookieProvider");
|
|
560
|
+
return context;
|
|
561
|
+
};
|
|
562
|
+
var useCookiesPolling = function(onChange, pollingOptions) {
|
|
563
|
+
var _a = pollingOptions || {}, _b = _a.intervalMs, intervalMs = _b === void 0 ? 1e3 : _b, _c = _a.enabled, enabled = _c === void 0 ? false : _c;
|
|
564
|
+
(0, react_1.useEffect)(function() {
|
|
565
|
+
if (!enabled) return;
|
|
566
|
+
var previousCookies = (0, cookie_functions_1.getCookies)();
|
|
567
|
+
var interval = setInterval(function() {
|
|
568
|
+
(0, cookie_functions_1.revalidateCookies)(onChange, previousCookies);
|
|
569
|
+
}, intervalMs);
|
|
570
|
+
return function() {
|
|
571
|
+
return clearInterval(interval);
|
|
572
|
+
};
|
|
573
|
+
}, [onChange, intervalMs]);
|
|
574
|
+
};
|
|
575
|
+
exports.useCookiesPolling = useCookiesPolling;
|
|
576
|
+
var useGetCookies = function() {
|
|
577
|
+
return useWrappedCookieFn(cookie_functions_1.getCookies);
|
|
578
|
+
};
|
|
579
|
+
exports.useGetCookies = useGetCookies;
|
|
580
|
+
var useGetCookie = function() {
|
|
581
|
+
return useWrappedCookieFn(cookie_functions_1.getCookie);
|
|
582
|
+
};
|
|
583
|
+
exports.useGetCookie = useGetCookie;
|
|
584
|
+
var useHasCookie = function() {
|
|
585
|
+
return useWrappedCookieFn(cookie_functions_1.hasCookie);
|
|
586
|
+
};
|
|
587
|
+
exports.useHasCookie = useHasCookie;
|
|
588
|
+
var useSetCookie = function() {
|
|
589
|
+
return useWrappedCookieFn(cookie_functions_1.setCookie);
|
|
590
|
+
};
|
|
591
|
+
exports.useSetCookie = useSetCookie;
|
|
592
|
+
var useDeleteCookie = function() {
|
|
593
|
+
return useWrappedCookieFn(cookie_functions_1.deleteCookie);
|
|
594
|
+
};
|
|
595
|
+
exports.useDeleteCookie = useDeleteCookie;
|
|
596
|
+
var useCookiesNext = function() {
|
|
597
|
+
return {
|
|
598
|
+
getCookies: useGetCookies(),
|
|
599
|
+
getCookie: useGetCookie(),
|
|
600
|
+
hasCookie: useHasCookie(),
|
|
601
|
+
setCookie: useSetCookie(),
|
|
602
|
+
deleteCookie: useDeleteCookie()
|
|
603
|
+
};
|
|
604
|
+
};
|
|
605
|
+
exports.useCookiesNext = useCookiesNext;
|
|
606
|
+
var useReactiveGetCookies = function() {
|
|
607
|
+
var context = useCookieContext();
|
|
608
|
+
return function() {
|
|
609
|
+
return context === null || context === void 0 ? void 0 : context.getAll();
|
|
610
|
+
};
|
|
611
|
+
};
|
|
612
|
+
exports.useReactiveGetCookies = useReactiveGetCookies;
|
|
613
|
+
var useReactiveGetCookie = function() {
|
|
614
|
+
var context = useCookieContext();
|
|
615
|
+
return function(key) {
|
|
616
|
+
return context === null || context === void 0 ? void 0 : context.get(key);
|
|
617
|
+
};
|
|
618
|
+
};
|
|
619
|
+
exports.useReactiveGetCookie = useReactiveGetCookie;
|
|
620
|
+
var useReactiveSetCookie = function() {
|
|
621
|
+
var context = useCookieContext();
|
|
622
|
+
return function(key, data, options) {
|
|
623
|
+
context === null || context === void 0 || context.set(key, data);
|
|
624
|
+
return (0, cookie_functions_1.setCookie)(key, data, options);
|
|
625
|
+
};
|
|
626
|
+
};
|
|
627
|
+
exports.useReactiveSetCookie = useReactiveSetCookie;
|
|
628
|
+
var useReactiveDeleteCookie = function() {
|
|
629
|
+
var context = useCookieContext();
|
|
630
|
+
return function(key, options) {
|
|
631
|
+
context === null || context === void 0 || context.delete(key);
|
|
632
|
+
return (0, cookie_functions_1.deleteCookie)(key, options);
|
|
633
|
+
};
|
|
634
|
+
};
|
|
635
|
+
exports.useReactiveDeleteCookie = useReactiveDeleteCookie;
|
|
636
|
+
var useReactiveHasCookie = function() {
|
|
637
|
+
var context = useCookieContext();
|
|
638
|
+
return function(key) {
|
|
639
|
+
return context === null || context === void 0 ? void 0 : context.has(key);
|
|
640
|
+
};
|
|
641
|
+
};
|
|
642
|
+
exports.useReactiveHasCookie = useReactiveHasCookie;
|
|
643
|
+
var useRevalidateCookiesState = function() {
|
|
644
|
+
var context = useCookieContext();
|
|
645
|
+
return function() {
|
|
646
|
+
context === null || context === void 0 || context.revalidateCookiesState();
|
|
647
|
+
};
|
|
648
|
+
};
|
|
649
|
+
exports.useRevalidateCookiesState = useRevalidateCookiesState;
|
|
650
|
+
var useReactiveCookiesNext = function() {
|
|
651
|
+
return {
|
|
652
|
+
getCookies: useReactiveGetCookies(),
|
|
653
|
+
getCookie: useReactiveGetCookie(),
|
|
654
|
+
hasCookie: useReactiveHasCookie(),
|
|
655
|
+
setCookie: useReactiveSetCookie(),
|
|
656
|
+
deleteCookie: useReactiveDeleteCookie(),
|
|
657
|
+
revalidateCookiesState: useRevalidateCookiesState()
|
|
658
|
+
};
|
|
659
|
+
};
|
|
660
|
+
exports.useReactiveCookiesNext = useReactiveCookiesNext;
|
|
661
|
+
}) });
|
|
662
|
+
|
|
663
|
+
//#endregion
|
|
664
|
+
//#region node_modules/cookies-next/lib/client/index.js
|
|
665
|
+
var require_client = /* @__PURE__ */ __commonJS({ "node_modules/cookies-next/lib/client/index.js": ((exports) => {
|
|
666
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
667
|
+
if (k2 === void 0) k2 = k;
|
|
668
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
669
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
670
|
+
enumerable: true,
|
|
671
|
+
get: function() {
|
|
672
|
+
return m[k];
|
|
673
|
+
}
|
|
674
|
+
};
|
|
675
|
+
Object.defineProperty(o, k2, desc);
|
|
676
|
+
}) : (function(o, m, k, k2) {
|
|
677
|
+
if (k2 === void 0) k2 = k;
|
|
678
|
+
o[k2] = m[k];
|
|
679
|
+
}));
|
|
680
|
+
var __exportStar = exports && exports.__exportStar || function(m, exports$1) {
|
|
681
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1, p)) __createBinding(exports$1, m, p);
|
|
682
|
+
};
|
|
683
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
684
|
+
exports.CookiesNextProvider = void 0;
|
|
685
|
+
__exportStar(require_types(), exports);
|
|
686
|
+
__exportStar(require_cookie_functions(), exports);
|
|
687
|
+
var context_1 = require_context();
|
|
688
|
+
Object.defineProperty(exports, "CookiesNextProvider", {
|
|
689
|
+
enumerable: true,
|
|
690
|
+
get: function() {
|
|
691
|
+
return context_1.CookieProvider;
|
|
692
|
+
}
|
|
693
|
+
});
|
|
694
|
+
__exportStar(require_hooks(), exports);
|
|
695
|
+
}) });
|
|
696
|
+
|
|
697
|
+
//#endregion
|
|
698
|
+
//#region src/components/system-switcher/SystemSwitcherClient.tsx
|
|
699
|
+
var import_client = /* @__PURE__ */ __toESM(require_client());
|
|
700
|
+
function SystemSwitcherClient({ systems, currentSystemId }) {
|
|
701
|
+
const [open, setOpen] = useState(false);
|
|
702
|
+
if (!systems?.length) return null;
|
|
703
|
+
let currentSystem = systems.find((s) => s.id === currentSystemId);
|
|
704
|
+
if (!currentSystem) {
|
|
705
|
+
if (typeof window !== "undefined") {
|
|
706
|
+
const host = window.location.host;
|
|
707
|
+
currentSystem = systems.find((s) => s.domains?.some((d) => host.includes(d.name)));
|
|
708
|
+
}
|
|
709
|
+
if (!currentSystem) currentSystem = systems[0];
|
|
710
|
+
}
|
|
711
|
+
const handleSelect = (system) => {
|
|
712
|
+
if (system.has_access === false) {
|
|
713
|
+
if (system.landing_page_url) window.open(system.landing_page_url, "_blank");
|
|
714
|
+
return;
|
|
715
|
+
}
|
|
716
|
+
if (system.id === currentSystem?.id) {
|
|
717
|
+
setOpen(false);
|
|
718
|
+
return;
|
|
719
|
+
}
|
|
720
|
+
(0, import_client.setCookie)("admin_system", system.id.toString(), { maxAge: 3600 * 24 * 365 });
|
|
721
|
+
setOpen(false);
|
|
722
|
+
const domainName = system.domains?.[0]?.name;
|
|
723
|
+
if (domainName && typeof window !== "undefined" && !window.location.host.includes(domainName)) {
|
|
724
|
+
const url = domainName.startsWith("http") ? domainName : `https://${domainName}`;
|
|
725
|
+
window.location.href = url;
|
|
726
|
+
} else window.location.reload();
|
|
727
|
+
};
|
|
728
|
+
return /* @__PURE__ */ jsxs(Popover, {
|
|
729
|
+
open,
|
|
730
|
+
onOpenChange: setOpen,
|
|
731
|
+
children: [/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
732
|
+
asChild: true,
|
|
733
|
+
children: /* @__PURE__ */ jsxs("button", {
|
|
734
|
+
className: "flex flex-row items-center justify-between gap-2.5 rounded-lg bg-primary/5 px-3 h-[42px] hover:bg-primary/10 transition-colors w-[180px] outline-none border border-transparent data-[state=open]:rounded-b-none data-[state=open]:border-border data-[state=open]:border-b-transparent data-[state=open]:bg-primary/5 relative z-10",
|
|
735
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
736
|
+
className: "flex-1 overflow-hidden flex items-center justify-start h-full",
|
|
737
|
+
children: currentSystem?.logo ? /* @__PURE__ */ jsx(Image, {
|
|
738
|
+
src: currentSystem.logo,
|
|
739
|
+
alt: currentSystem.name,
|
|
740
|
+
width: 80,
|
|
741
|
+
height: 80,
|
|
742
|
+
className: "h-[20px] w-auto max-w-[124px] object-contain object-left shrink-0"
|
|
743
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
744
|
+
className: "font-semibold text-primary truncate text-sm",
|
|
745
|
+
children: currentSystem?.name || "Selecione"
|
|
746
|
+
})
|
|
747
|
+
}), /* @__PURE__ */ jsx(ChevronsUpDown, { className: "h-4 w-4 text-muted-foreground shrink-0" })]
|
|
748
|
+
})
|
|
749
|
+
}), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
750
|
+
align: "start",
|
|
751
|
+
sideOffset: -1,
|
|
752
|
+
className: "w-(--radix-popover-trigger-width) rounded-b-lg rounded-t-none p-2 shadow-md border border-border border-solid [border-top-style:dashed] bg-background",
|
|
753
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
754
|
+
className: "text-muted-foreground text-xs px-2 py-1.5 font-medium mb-0.5",
|
|
755
|
+
children: "Outros Sistemas"
|
|
756
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
757
|
+
className: "flex flex-col gap-0.5",
|
|
758
|
+
children: systems.filter((s) => s.id !== currentSystem?.id).map((system) => /* @__PURE__ */ jsxs("button", {
|
|
759
|
+
onClick: () => handleSelect(system),
|
|
760
|
+
className: "flex w-full flex-row items-center justify-between rounded-md px-2 py-2 transition-colors hover:bg-accent disabled:opacity-50",
|
|
761
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
762
|
+
className: "flex-1 overflow-hidden flex items-center justify-start h-6",
|
|
763
|
+
children: system.logo ? /* @__PURE__ */ jsx(Image, {
|
|
764
|
+
src: system.logo,
|
|
765
|
+
alt: system.name,
|
|
766
|
+
width: 80,
|
|
767
|
+
height: 80,
|
|
768
|
+
className: "h-[18px] w-auto max-w-[130px] object-contain object-left shrink-0"
|
|
769
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
770
|
+
className: "font-medium text-foreground truncate text-sm pt-0.5",
|
|
771
|
+
children: system.name
|
|
772
|
+
})
|
|
773
|
+
}), system.has_access === false && /* @__PURE__ */ jsx(Lock, { className: "h-3.5 w-3.5 text-muted-foreground opacity-60 shrink-0 ml-2" })]
|
|
774
|
+
}, system.id))
|
|
775
|
+
})]
|
|
776
|
+
})]
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
//#endregion
|
|
781
|
+
export { SystemSwitcherClient as t };
|
|
782
|
+
//# sourceMappingURL=SystemSwitcherClient-BIpzOqMI.js.map
|