@sudobility/entity-components-rn 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs ADDED
@@ -0,0 +1,1509 @@
1
+ import Ue, { useState as q } from "react";
2
+ import { Pressable as $, View as i, Image as xe, Text as l, FlatList as ae, RefreshControl as be, ActivityIndicator as se, Modal as qe, TextInput as kr } from "react-native";
3
+ const H = [
4
+ {
5
+ role: "owner",
6
+ label: "Owner",
7
+ description: "Full access and ownership rights",
8
+ color: "purple"
9
+ },
10
+ {
11
+ role: "admin",
12
+ label: "Admin",
13
+ description: "Can manage members and settings",
14
+ color: "blue"
15
+ },
16
+ {
17
+ role: "member",
18
+ label: "Member",
19
+ description: "Can view and contribute",
20
+ color: "green"
21
+ },
22
+ {
23
+ role: "viewer",
24
+ label: "Viewer",
25
+ description: "Can only view content",
26
+ color: "gray"
27
+ },
28
+ {
29
+ role: "guest",
30
+ label: "Guest",
31
+ description: "Limited access",
32
+ color: "yellow"
33
+ }
34
+ ];
35
+ var te = { exports: {} }, G = {};
36
+ /**
37
+ * @license React
38
+ * react-jsx-runtime.production.min.js
39
+ *
40
+ * Copyright (c) Facebook, Inc. and its affiliates.
41
+ *
42
+ * This source code is licensed under the MIT license found in the
43
+ * LICENSE file in the root directory of this source tree.
44
+ */
45
+ var Ve;
46
+ function wr() {
47
+ if (Ve) return G;
48
+ Ve = 1;
49
+ var n = Ue, a = Symbol.for("react.element"), p = Symbol.for("react.fragment"), g = Object.prototype.hasOwnProperty, m = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, N = { key: !0, ref: !0, __self: !0, __source: !0 };
50
+ function w(E, h, C) {
51
+ var v, j = {}, _ = null, R = null;
52
+ C !== void 0 && (_ = "" + C), h.key !== void 0 && (_ = "" + h.key), h.ref !== void 0 && (R = h.ref);
53
+ for (v in h) g.call(h, v) && !N.hasOwnProperty(v) && (j[v] = h[v]);
54
+ if (E && E.defaultProps) for (v in h = E.defaultProps, h) j[v] === void 0 && (j[v] = h[v]);
55
+ return { $$typeof: a, type: E, key: _, ref: R, props: j, _owner: m.current };
56
+ }
57
+ return G.Fragment = p, G.jsx = w, G.jsxs = w, G;
58
+ }
59
+ var K = {};
60
+ /**
61
+ * @license React
62
+ * react-jsx-runtime.development.js
63
+ *
64
+ * Copyright (c) Facebook, Inc. and its affiliates.
65
+ *
66
+ * This source code is licensed under the MIT license found in the
67
+ * LICENSE file in the root directory of this source tree.
68
+ */
69
+ var We;
70
+ function Nr() {
71
+ return We || (We = 1, process.env.NODE_ENV !== "production" && (function() {
72
+ var n = Ue, a = Symbol.for("react.element"), p = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), N = Symbol.for("react.profiler"), w = Symbol.for("react.provider"), E = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), j = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), R = Symbol.for("react.offscreen"), T = Symbol.iterator, u = "@@iterator";
73
+ function I(e) {
74
+ if (e === null || typeof e != "object")
75
+ return null;
76
+ var t = T && e[T] || e[u];
77
+ return typeof t == "function" ? t : null;
78
+ }
79
+ var x = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
80
+ function c(e) {
81
+ {
82
+ for (var t = arguments.length, s = new Array(t > 1 ? t - 1 : 0), o = 1; o < t; o++)
83
+ s[o - 1] = arguments[o];
84
+ A("error", e, s);
85
+ }
86
+ }
87
+ function A(e, t, s) {
88
+ {
89
+ var o = x.ReactDebugCurrentFrame, y = o.getStackAddendum();
90
+ y !== "" && (t += "%s", s = s.concat([y]));
91
+ var k = s.map(function(f) {
92
+ return String(f);
93
+ });
94
+ k.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, k);
95
+ }
96
+ }
97
+ var P = !1, b = !1, V = !1, X = !1, ze = !1, me;
98
+ me = Symbol.for("react.module.reference");
99
+ function Je(e) {
100
+ return !!(typeof e == "string" || typeof e == "function" || e === g || e === N || ze || e === m || e === C || e === v || X || e === R || P || b || V || typeof e == "object" && e !== null && (e.$$typeof === _ || e.$$typeof === j || e.$$typeof === w || e.$$typeof === E || e.$$typeof === h || // This needs to include all possible module reference object
101
+ // types supported by any Flight configuration anywhere since
102
+ // we don't know which Flight build this will end up being used
103
+ // with.
104
+ e.$$typeof === me || e.getModuleId !== void 0));
105
+ }
106
+ function Ge(e, t, s) {
107
+ var o = e.displayName;
108
+ if (o)
109
+ return o;
110
+ var y = t.displayName || t.name || "";
111
+ return y !== "" ? s + "(" + y + ")" : s;
112
+ }
113
+ function ge(e) {
114
+ return e.displayName || "Context";
115
+ }
116
+ function M(e) {
117
+ if (e == null)
118
+ return null;
119
+ if (typeof e.tag == "number" && c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
120
+ return e.displayName || e.name || null;
121
+ if (typeof e == "string")
122
+ return e;
123
+ switch (e) {
124
+ case g:
125
+ return "Fragment";
126
+ case p:
127
+ return "Portal";
128
+ case N:
129
+ return "Profiler";
130
+ case m:
131
+ return "StrictMode";
132
+ case C:
133
+ return "Suspense";
134
+ case v:
135
+ return "SuspenseList";
136
+ }
137
+ if (typeof e == "object")
138
+ switch (e.$$typeof) {
139
+ case E:
140
+ var t = e;
141
+ return ge(t) + ".Consumer";
142
+ case w:
143
+ var s = e;
144
+ return ge(s._context) + ".Provider";
145
+ case h:
146
+ return Ge(e, e.render, "ForwardRef");
147
+ case j:
148
+ var o = e.displayName || null;
149
+ return o !== null ? o : M(e.type) || "Memo";
150
+ case _: {
151
+ var y = e, k = y._payload, f = y._init;
152
+ try {
153
+ return M(f(k));
154
+ } catch {
155
+ return null;
156
+ }
157
+ }
158
+ }
159
+ return null;
160
+ }
161
+ var W = Object.assign, z = 0, ye, pe, he, ve, je, ke, we;
162
+ function Ne() {
163
+ }
164
+ Ne.__reactDisabledLog = !0;
165
+ function Ke() {
166
+ {
167
+ if (z === 0) {
168
+ ye = console.log, pe = console.info, he = console.warn, ve = console.error, je = console.group, ke = console.groupCollapsed, we = console.groupEnd;
169
+ var e = {
170
+ configurable: !0,
171
+ enumerable: !0,
172
+ value: Ne,
173
+ writable: !0
174
+ };
175
+ Object.defineProperties(console, {
176
+ info: e,
177
+ log: e,
178
+ warn: e,
179
+ error: e,
180
+ group: e,
181
+ groupCollapsed: e,
182
+ groupEnd: e
183
+ });
184
+ }
185
+ z++;
186
+ }
187
+ }
188
+ function He() {
189
+ {
190
+ if (z--, z === 0) {
191
+ var e = {
192
+ configurable: !0,
193
+ enumerable: !0,
194
+ writable: !0
195
+ };
196
+ Object.defineProperties(console, {
197
+ log: W({}, e, {
198
+ value: ye
199
+ }),
200
+ info: W({}, e, {
201
+ value: pe
202
+ }),
203
+ warn: W({}, e, {
204
+ value: he
205
+ }),
206
+ error: W({}, e, {
207
+ value: ve
208
+ }),
209
+ group: W({}, e, {
210
+ value: je
211
+ }),
212
+ groupCollapsed: W({}, e, {
213
+ value: ke
214
+ }),
215
+ groupEnd: W({}, e, {
216
+ value: we
217
+ })
218
+ });
219
+ }
220
+ z < 0 && c("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
221
+ }
222
+ }
223
+ var ne = x.ReactCurrentDispatcher, le;
224
+ function Z(e, t, s) {
225
+ {
226
+ if (le === void 0)
227
+ try {
228
+ throw Error();
229
+ } catch (y) {
230
+ var o = y.stack.trim().match(/\n( *(at )?)/);
231
+ le = o && o[1] || "";
232
+ }
233
+ return `
234
+ ` + le + e;
235
+ }
236
+ }
237
+ var ie = !1, Q;
238
+ {
239
+ var Xe = typeof WeakMap == "function" ? WeakMap : Map;
240
+ Q = new Xe();
241
+ }
242
+ function Re(e, t) {
243
+ if (!e || ie)
244
+ return "";
245
+ {
246
+ var s = Q.get(e);
247
+ if (s !== void 0)
248
+ return s;
249
+ }
250
+ var o;
251
+ ie = !0;
252
+ var y = Error.prepareStackTrace;
253
+ Error.prepareStackTrace = void 0;
254
+ var k;
255
+ k = ne.current, ne.current = null, Ke();
256
+ try {
257
+ if (t) {
258
+ var f = function() {
259
+ throw Error();
260
+ };
261
+ if (Object.defineProperty(f.prototype, "props", {
262
+ set: function() {
263
+ throw Error();
264
+ }
265
+ }), typeof Reflect == "object" && Reflect.construct) {
266
+ try {
267
+ Reflect.construct(f, []);
268
+ } catch (L) {
269
+ o = L;
270
+ }
271
+ Reflect.construct(e, [], f);
272
+ } else {
273
+ try {
274
+ f.call();
275
+ } catch (L) {
276
+ o = L;
277
+ }
278
+ e.call(f.prototype);
279
+ }
280
+ } else {
281
+ try {
282
+ throw Error();
283
+ } catch (L) {
284
+ o = L;
285
+ }
286
+ e();
287
+ }
288
+ } catch (L) {
289
+ if (L && o && typeof L.stack == "string") {
290
+ for (var d = L.stack.split(`
291
+ `), F = o.stack.split(`
292
+ `), S = d.length - 1, O = F.length - 1; S >= 1 && O >= 0 && d[S] !== F[O]; )
293
+ O--;
294
+ for (; S >= 1 && O >= 0; S--, O--)
295
+ if (d[S] !== F[O]) {
296
+ if (S !== 1 || O !== 1)
297
+ do
298
+ if (S--, O--, O < 0 || d[S] !== F[O]) {
299
+ var D = `
300
+ ` + d[S].replace(" at new ", " at ");
301
+ return e.displayName && D.includes("<anonymous>") && (D = D.replace("<anonymous>", e.displayName)), typeof e == "function" && Q.set(e, D), D;
302
+ }
303
+ while (S >= 1 && O >= 0);
304
+ break;
305
+ }
306
+ }
307
+ } finally {
308
+ ie = !1, ne.current = k, He(), Error.prepareStackTrace = y;
309
+ }
310
+ var U = e ? e.displayName || e.name : "", Y = U ? Z(U) : "";
311
+ return typeof e == "function" && Q.set(e, Y), Y;
312
+ }
313
+ function Ze(e, t, s) {
314
+ return Re(e, !1);
315
+ }
316
+ function Qe(e) {
317
+ var t = e.prototype;
318
+ return !!(t && t.isReactComponent);
319
+ }
320
+ function ee(e, t, s) {
321
+ if (e == null)
322
+ return "";
323
+ if (typeof e == "function")
324
+ return Re(e, Qe(e));
325
+ if (typeof e == "string")
326
+ return Z(e);
327
+ switch (e) {
328
+ case C:
329
+ return Z("Suspense");
330
+ case v:
331
+ return Z("SuspenseList");
332
+ }
333
+ if (typeof e == "object")
334
+ switch (e.$$typeof) {
335
+ case h:
336
+ return Ze(e.render);
337
+ case j:
338
+ return ee(e.type, t, s);
339
+ case _: {
340
+ var o = e, y = o._payload, k = o._init;
341
+ try {
342
+ return ee(k(y), t, s);
343
+ } catch {
344
+ }
345
+ }
346
+ }
347
+ return "";
348
+ }
349
+ var J = Object.prototype.hasOwnProperty, Ee = {}, Ce = x.ReactDebugCurrentFrame;
350
+ function re(e) {
351
+ if (e) {
352
+ var t = e._owner, s = ee(e.type, e._source, t ? t.type : null);
353
+ Ce.setExtraStackFrame(s);
354
+ } else
355
+ Ce.setExtraStackFrame(null);
356
+ }
357
+ function er(e, t, s, o, y) {
358
+ {
359
+ var k = Function.call.bind(J);
360
+ for (var f in e)
361
+ if (k(e, f)) {
362
+ var d = void 0;
363
+ try {
364
+ if (typeof e[f] != "function") {
365
+ var F = Error((o || "React class") + ": " + s + " type `" + f + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[f] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
366
+ throw F.name = "Invariant Violation", F;
367
+ }
368
+ d = e[f](t, f, o, s, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
369
+ } catch (S) {
370
+ d = S;
371
+ }
372
+ d && !(d instanceof Error) && (re(y), c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", o || "React class", s, f, typeof d), re(null)), d instanceof Error && !(d.message in Ee) && (Ee[d.message] = !0, re(y), c("Failed %s type: %s", s, d.message), re(null));
373
+ }
374
+ }
375
+ }
376
+ var rr = Array.isArray;
377
+ function oe(e) {
378
+ return rr(e);
379
+ }
380
+ function tr(e) {
381
+ {
382
+ var t = typeof Symbol == "function" && Symbol.toStringTag, s = t && e[Symbol.toStringTag] || e.constructor.name || "Object";
383
+ return s;
384
+ }
385
+ }
386
+ function ar(e) {
387
+ try {
388
+ return _e(e), !1;
389
+ } catch {
390
+ return !0;
391
+ }
392
+ }
393
+ function _e(e) {
394
+ return "" + e;
395
+ }
396
+ function Se(e) {
397
+ if (ar(e))
398
+ return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", tr(e)), _e(e);
399
+ }
400
+ var Te = x.ReactCurrentOwner, sr = {
401
+ key: !0,
402
+ ref: !0,
403
+ __self: !0,
404
+ __source: !0
405
+ }, Oe, Pe;
406
+ function nr(e) {
407
+ if (J.call(e, "ref")) {
408
+ var t = Object.getOwnPropertyDescriptor(e, "ref").get;
409
+ if (t && t.isReactWarning)
410
+ return !1;
411
+ }
412
+ return e.ref !== void 0;
413
+ }
414
+ function lr(e) {
415
+ if (J.call(e, "key")) {
416
+ var t = Object.getOwnPropertyDescriptor(e, "key").get;
417
+ if (t && t.isReactWarning)
418
+ return !1;
419
+ }
420
+ return e.key !== void 0;
421
+ }
422
+ function ir(e, t) {
423
+ typeof e.ref == "string" && Te.current;
424
+ }
425
+ function or(e, t) {
426
+ {
427
+ var s = function() {
428
+ Oe || (Oe = !0, c("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
429
+ };
430
+ s.isReactWarning = !0, Object.defineProperty(e, "key", {
431
+ get: s,
432
+ configurable: !0
433
+ });
434
+ }
435
+ }
436
+ function cr(e, t) {
437
+ {
438
+ var s = function() {
439
+ Pe || (Pe = !0, c("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
440
+ };
441
+ s.isReactWarning = !0, Object.defineProperty(e, "ref", {
442
+ get: s,
443
+ configurable: !0
444
+ });
445
+ }
446
+ }
447
+ var dr = function(e, t, s, o, y, k, f) {
448
+ var d = {
449
+ // This tag allows us to uniquely identify this as a React Element
450
+ $$typeof: a,
451
+ // Built-in properties that belong on the element
452
+ type: e,
453
+ key: t,
454
+ ref: s,
455
+ props: f,
456
+ // Record the component responsible for creating this element.
457
+ _owner: k
458
+ };
459
+ return d._store = {}, Object.defineProperty(d._store, "validated", {
460
+ configurable: !1,
461
+ enumerable: !1,
462
+ writable: !0,
463
+ value: !1
464
+ }), Object.defineProperty(d, "_self", {
465
+ configurable: !1,
466
+ enumerable: !1,
467
+ writable: !1,
468
+ value: o
469
+ }), Object.defineProperty(d, "_source", {
470
+ configurable: !1,
471
+ enumerable: !1,
472
+ writable: !1,
473
+ value: y
474
+ }), Object.freeze && (Object.freeze(d.props), Object.freeze(d)), d;
475
+ };
476
+ function ur(e, t, s, o, y) {
477
+ {
478
+ var k, f = {}, d = null, F = null;
479
+ s !== void 0 && (Se(s), d = "" + s), lr(t) && (Se(t.key), d = "" + t.key), nr(t) && (F = t.ref, ir(t, y));
480
+ for (k in t)
481
+ J.call(t, k) && !sr.hasOwnProperty(k) && (f[k] = t[k]);
482
+ if (e && e.defaultProps) {
483
+ var S = e.defaultProps;
484
+ for (k in S)
485
+ f[k] === void 0 && (f[k] = S[k]);
486
+ }
487
+ if (d || F) {
488
+ var O = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
489
+ d && or(f, O), F && cr(f, O);
490
+ }
491
+ return dr(e, d, F, y, o, Te.current, f);
492
+ }
493
+ }
494
+ var ce = x.ReactCurrentOwner, $e = x.ReactDebugCurrentFrame;
495
+ function B(e) {
496
+ if (e) {
497
+ var t = e._owner, s = ee(e.type, e._source, t ? t.type : null);
498
+ $e.setExtraStackFrame(s);
499
+ } else
500
+ $e.setExtraStackFrame(null);
501
+ }
502
+ var de;
503
+ de = !1;
504
+ function ue(e) {
505
+ return typeof e == "object" && e !== null && e.$$typeof === a;
506
+ }
507
+ function Fe() {
508
+ {
509
+ if (ce.current) {
510
+ var e = M(ce.current.type);
511
+ if (e)
512
+ return `
513
+
514
+ Check the render method of \`` + e + "`.";
515
+ }
516
+ return "";
517
+ }
518
+ }
519
+ function fr(e) {
520
+ return "";
521
+ }
522
+ var Le = {};
523
+ function xr(e) {
524
+ {
525
+ var t = Fe();
526
+ if (!t) {
527
+ var s = typeof e == "string" ? e : e.displayName || e.name;
528
+ s && (t = `
529
+
530
+ Check the top-level render call using <` + s + ">.");
531
+ }
532
+ return t;
533
+ }
534
+ }
535
+ function Ie(e, t) {
536
+ {
537
+ if (!e._store || e._store.validated || e.key != null)
538
+ return;
539
+ e._store.validated = !0;
540
+ var s = xr(t);
541
+ if (Le[s])
542
+ return;
543
+ Le[s] = !0;
544
+ var o = "";
545
+ e && e._owner && e._owner !== ce.current && (o = " It was passed a child from " + M(e._owner.type) + "."), B(e), c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', s, o), B(null);
546
+ }
547
+ }
548
+ function Ae(e, t) {
549
+ {
550
+ if (typeof e != "object")
551
+ return;
552
+ if (oe(e))
553
+ for (var s = 0; s < e.length; s++) {
554
+ var o = e[s];
555
+ ue(o) && Ie(o, t);
556
+ }
557
+ else if (ue(e))
558
+ e._store && (e._store.validated = !0);
559
+ else if (e) {
560
+ var y = I(e);
561
+ if (typeof y == "function" && y !== e.entries)
562
+ for (var k = y.call(e), f; !(f = k.next()).done; )
563
+ ue(f.value) && Ie(f.value, t);
564
+ }
565
+ }
566
+ }
567
+ function br(e) {
568
+ {
569
+ var t = e.type;
570
+ if (t == null || typeof t == "string")
571
+ return;
572
+ var s;
573
+ if (typeof t == "function")
574
+ s = t.propTypes;
575
+ else if (typeof t == "object" && (t.$$typeof === h || // Note: Memo only checks outer props here.
576
+ // Inner props are checked in the reconciler.
577
+ t.$$typeof === j))
578
+ s = t.propTypes;
579
+ else
580
+ return;
581
+ if (s) {
582
+ var o = M(t);
583
+ er(s, e.props, "prop", o, e);
584
+ } else if (t.PropTypes !== void 0 && !de) {
585
+ de = !0;
586
+ var y = M(t);
587
+ c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", y || "Unknown");
588
+ }
589
+ typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
590
+ }
591
+ }
592
+ function mr(e) {
593
+ {
594
+ for (var t = Object.keys(e.props), s = 0; s < t.length; s++) {
595
+ var o = t[s];
596
+ if (o !== "children" && o !== "key") {
597
+ B(e), c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", o), B(null);
598
+ break;
599
+ }
600
+ }
601
+ e.ref !== null && (B(e), c("Invalid attribute `ref` supplied to `React.Fragment`."), B(null));
602
+ }
603
+ }
604
+ var De = {};
605
+ function Me(e, t, s, o, y, k) {
606
+ {
607
+ var f = Je(e);
608
+ if (!f) {
609
+ var d = "";
610
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (d += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
611
+ var F = fr();
612
+ F ? d += F : d += Fe();
613
+ var S;
614
+ e === null ? S = "null" : oe(e) ? S = "array" : e !== void 0 && e.$$typeof === a ? (S = "<" + (M(e.type) || "Unknown") + " />", d = " Did you accidentally export a JSX literal instead of a component?") : S = typeof e, c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", S, d);
615
+ }
616
+ var O = ur(e, t, s, y, k);
617
+ if (O == null)
618
+ return O;
619
+ if (f) {
620
+ var D = t.children;
621
+ if (D !== void 0)
622
+ if (o)
623
+ if (oe(D)) {
624
+ for (var U = 0; U < D.length; U++)
625
+ Ae(D[U], e);
626
+ Object.freeze && Object.freeze(D);
627
+ } else
628
+ c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
629
+ else
630
+ Ae(D, e);
631
+ }
632
+ if (J.call(t, "key")) {
633
+ var Y = M(e), L = Object.keys(t).filter(function(jr) {
634
+ return jr !== "key";
635
+ }), fe = L.length > 0 ? "{key: someKey, " + L.join(": ..., ") + ": ...}" : "{key: someKey}";
636
+ if (!De[Y + fe]) {
637
+ var vr = L.length > 0 ? "{" + L.join(": ..., ") + ": ...}" : "{}";
638
+ c(`A props object containing a "key" prop is being spread into JSX:
639
+ let props = %s;
640
+ <%s {...props} />
641
+ React keys must be passed directly to JSX without using spread:
642
+ let props = %s;
643
+ <%s key={someKey} {...props} />`, fe, Y, vr, Y), De[Y + fe] = !0;
644
+ }
645
+ }
646
+ return e === g ? mr(O) : br(O), O;
647
+ }
648
+ }
649
+ function gr(e, t, s) {
650
+ return Me(e, t, s, !0);
651
+ }
652
+ function yr(e, t, s) {
653
+ return Me(e, t, s, !1);
654
+ }
655
+ var pr = yr, hr = gr;
656
+ K.Fragment = g, K.jsx = pr, K.jsxs = hr;
657
+ })()), K;
658
+ }
659
+ var Ye;
660
+ function Rr() {
661
+ return Ye || (Ye = 1, process.env.NODE_ENV === "production" ? te.exports = wr() : te.exports = Nr()), te.exports;
662
+ }
663
+ var r = Rr();
664
+ const Er = (n) => {
665
+ const a = {
666
+ owner: "bg-purple-100 dark:bg-purple-900 text-purple-800 dark:text-purple-200",
667
+ admin: "bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200",
668
+ member: "bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200",
669
+ viewer: "bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200",
670
+ guest: "bg-yellow-100 dark:bg-yellow-900 text-yellow-800 dark:text-yellow-200"
671
+ };
672
+ return a[n] || a.member;
673
+ }, Cr = (n) => {
674
+ const a = H.find((p) => p.role === n);
675
+ return (a == null ? void 0 : a.label) || n;
676
+ }, _r = ({
677
+ entity: n,
678
+ onPress: a,
679
+ onLongPress: p,
680
+ selected: g = !1,
681
+ showRole: m = !0,
682
+ showMemberCount: N = !0,
683
+ showDescription: w = !0,
684
+ className: E = "",
685
+ style: h,
686
+ testID: C
687
+ }) => {
688
+ const v = () => {
689
+ a == null || a(n);
690
+ }, j = () => {
691
+ p == null || p(n);
692
+ };
693
+ return /* @__PURE__ */ r.jsxs(
694
+ $,
695
+ {
696
+ onPress: v,
697
+ onLongPress: j,
698
+ disabled: !a && !p,
699
+ className: `
700
+ flex-row items-center p-4 rounded-xl
701
+ bg-white dark:bg-gray-800
702
+ border border-gray-200 dark:border-gray-700
703
+ ${g ? "border-blue-500 dark:border-blue-400 bg-blue-50 dark:bg-blue-900/20" : ""}
704
+ active:opacity-80
705
+ ${E}
706
+ `,
707
+ style: h,
708
+ testID: C,
709
+ accessibilityRole: "button",
710
+ accessibilityLabel: `Entity: ${n.name}`,
711
+ accessibilityState: { selected: g },
712
+ children: [
713
+ /* @__PURE__ */ r.jsx(i, { className: "mr-3", children: n.avatarUrl ? /* @__PURE__ */ r.jsx(
714
+ xe,
715
+ {
716
+ source: { uri: n.avatarUrl },
717
+ className: "w-12 h-12 rounded-full bg-gray-200 dark:bg-gray-600",
718
+ accessibilityIgnoresInvertColors: !0
719
+ }
720
+ ) : /* @__PURE__ */ r.jsx(i, { className: "w-12 h-12 rounded-full bg-gray-200 dark:bg-gray-600 items-center justify-center", children: /* @__PURE__ */ r.jsx(l, { className: "text-lg font-semibold text-gray-600 dark:text-gray-300", children: n.name.charAt(0).toUpperCase() }) }) }),
721
+ /* @__PURE__ */ r.jsxs(i, { className: "flex-1", children: [
722
+ /* @__PURE__ */ r.jsxs(i, { className: "flex-row items-center flex-wrap", children: [
723
+ /* @__PURE__ */ r.jsx(
724
+ l,
725
+ {
726
+ className: "text-base font-semibold text-gray-900 dark:text-white mr-2",
727
+ numberOfLines: 1,
728
+ children: n.name
729
+ }
730
+ ),
731
+ m && n.role && /* @__PURE__ */ r.jsx(
732
+ i,
733
+ {
734
+ className: `px-2 py-0.5 rounded-full ${Er(n.role)}`,
735
+ children: /* @__PURE__ */ r.jsx(l, { className: "text-xs font-medium", children: Cr(n.role) })
736
+ }
737
+ )
738
+ ] }),
739
+ w && n.description && /* @__PURE__ */ r.jsx(
740
+ l,
741
+ {
742
+ className: "text-sm text-gray-600 dark:text-gray-400 mt-1",
743
+ numberOfLines: 2,
744
+ children: n.description
745
+ }
746
+ ),
747
+ N && n.memberCount !== void 0 && /* @__PURE__ */ r.jsxs(l, { className: "text-xs text-gray-500 dark:text-gray-500 mt-1", children: [
748
+ n.memberCount,
749
+ " ",
750
+ n.memberCount === 1 ? "member" : "members"
751
+ ] })
752
+ ] }),
753
+ a && /* @__PURE__ */ r.jsx(i, { className: "ml-2", children: /* @__PURE__ */ r.jsx(l, { className: "text-gray-400 dark:text-gray-500 text-lg", children: "›" }) })
754
+ ]
755
+ }
756
+ );
757
+ }, Wr = ({
758
+ entities: n,
759
+ onEntityPress: a,
760
+ onEntityLongPress: p,
761
+ selectedEntityId: g,
762
+ showRoles: m = !0,
763
+ showMemberCounts: N = !0,
764
+ showDescriptions: w = !0,
765
+ emptyMessage: E = "No entities found",
766
+ emptyIcon: h,
767
+ loading: C = !1,
768
+ refreshing: v = !1,
769
+ onRefresh: j,
770
+ ListHeaderComponent: _,
771
+ ListFooterComponent: R,
772
+ className: T = "",
773
+ style: u,
774
+ testID: I
775
+ }) => {
776
+ const x = ({ item: P }) => /* @__PURE__ */ r.jsx(
777
+ _r,
778
+ {
779
+ entity: P,
780
+ onPress: a,
781
+ onLongPress: p,
782
+ selected: g === P.id,
783
+ showRole: m,
784
+ showMemberCount: N,
785
+ showDescription: w,
786
+ className: "mb-3"
787
+ }
788
+ ), c = () => C ? /* @__PURE__ */ r.jsxs(i, { className: "flex-1 items-center justify-center py-12", children: [
789
+ /* @__PURE__ */ r.jsx(se, { size: "large", color: "#3B82F6" }),
790
+ /* @__PURE__ */ r.jsx(l, { className: "text-gray-500 dark:text-gray-400 mt-4", children: "Loading..." })
791
+ ] }) : /* @__PURE__ */ r.jsxs(i, { className: "flex-1 items-center justify-center py-12", children: [
792
+ h,
793
+ /* @__PURE__ */ r.jsx(l, { className: "text-gray-500 dark:text-gray-400 text-center mt-2", children: E })
794
+ ] }), A = (P) => P.id;
795
+ return /* @__PURE__ */ r.jsx(i, { className: `flex-1 ${T}`, style: u, testID: I, children: /* @__PURE__ */ r.jsx(
796
+ ae,
797
+ {
798
+ data: n,
799
+ renderItem: x,
800
+ keyExtractor: A,
801
+ ListHeaderComponent: _,
802
+ ListFooterComponent: R,
803
+ ListEmptyComponent: c,
804
+ contentContainerStyle: { flexGrow: 1, padding: 16 },
805
+ showsVerticalScrollIndicator: !1,
806
+ refreshControl: j ? /* @__PURE__ */ r.jsx(
807
+ be,
808
+ {
809
+ refreshing: v,
810
+ onRefresh: j,
811
+ tintColor: "#3B82F6"
812
+ }
813
+ ) : void 0
814
+ }
815
+ ) });
816
+ }, Yr = ({
817
+ entities: n,
818
+ selectedEntity: a,
819
+ onSelect: p,
820
+ placeholder: g = "Select an entity",
821
+ disabled: m = !1,
822
+ loading: N = !1,
823
+ showAvatars: w = !0,
824
+ showRoles: E = !1,
825
+ className: h = "",
826
+ style: C,
827
+ testID: v
828
+ }) => {
829
+ const [j, _] = q(!1), R = () => {
830
+ !m && !N && _(!0);
831
+ }, T = () => {
832
+ _(!1);
833
+ }, u = (c) => {
834
+ p(c), T();
835
+ }, I = (c, A = "md") => {
836
+ const P = A === "sm" ? "w-8 h-8" : "w-10 h-10", b = A === "sm" ? "text-sm" : "text-base";
837
+ return c.avatarUrl ? /* @__PURE__ */ r.jsx(
838
+ xe,
839
+ {
840
+ source: { uri: c.avatarUrl },
841
+ className: `${P} rounded-full bg-gray-200 dark:bg-gray-600`,
842
+ accessibilityIgnoresInvertColors: !0
843
+ }
844
+ ) : /* @__PURE__ */ r.jsx(
845
+ i,
846
+ {
847
+ className: `${P} rounded-full bg-gray-200 dark:bg-gray-600 items-center justify-center`,
848
+ children: /* @__PURE__ */ r.jsx(
849
+ l,
850
+ {
851
+ className: `${b} font-semibold text-gray-600 dark:text-gray-300`,
852
+ children: c.name.charAt(0).toUpperCase()
853
+ }
854
+ )
855
+ }
856
+ );
857
+ }, x = ({ item: c }) => /* @__PURE__ */ r.jsxs(
858
+ $,
859
+ {
860
+ onPress: () => u(c),
861
+ className: `
862
+ flex-row items-center px-4 py-3
863
+ ${(a == null ? void 0 : a.id) === c.id ? "bg-blue-50 dark:bg-blue-900/30" : ""}
864
+ active:bg-gray-100 dark:active:bg-gray-700
865
+ `,
866
+ accessibilityRole: "button",
867
+ accessibilityLabel: `Select ${c.name}`,
868
+ accessibilityState: { selected: (a == null ? void 0 : a.id) === c.id },
869
+ children: [
870
+ w && /* @__PURE__ */ r.jsx(i, { className: "mr-3", children: I(c, "sm") }),
871
+ /* @__PURE__ */ r.jsxs(i, { className: "flex-1", children: [
872
+ /* @__PURE__ */ r.jsx(
873
+ l,
874
+ {
875
+ className: "text-base text-gray-900 dark:text-white",
876
+ numberOfLines: 1,
877
+ children: c.name
878
+ }
879
+ ),
880
+ E && c.role && /* @__PURE__ */ r.jsx(l, { className: "text-xs text-gray-500 dark:text-gray-400 capitalize", children: c.role })
881
+ ] }),
882
+ (a == null ? void 0 : a.id) === c.id && /* @__PURE__ */ r.jsx(l, { className: "text-blue-500 dark:text-blue-400 text-lg", children: "✓" })
883
+ ]
884
+ }
885
+ );
886
+ return /* @__PURE__ */ r.jsxs(i, { className: h, style: C, testID: v, children: [
887
+ /* @__PURE__ */ r.jsxs(
888
+ $,
889
+ {
890
+ onPress: R,
891
+ disabled: m || N,
892
+ className: `
893
+ flex-row items-center px-4 py-3 rounded-xl
894
+ bg-white dark:bg-gray-800
895
+ border border-gray-200 dark:border-gray-700
896
+ ${m ? "opacity-50" : ""}
897
+ active:opacity-80
898
+ `,
899
+ accessibilityRole: "button",
900
+ accessibilityLabel: a ? `Selected: ${a.name}` : g,
901
+ accessibilityState: { disabled: m },
902
+ children: [
903
+ N ? /* @__PURE__ */ r.jsx(i, { className: "flex-row items-center", children: /* @__PURE__ */ r.jsx(l, { className: "text-gray-500 dark:text-gray-400", children: "Loading..." }) }) : a ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
904
+ w && /* @__PURE__ */ r.jsx(i, { className: "mr-3", children: I(a) }),
905
+ /* @__PURE__ */ r.jsxs(i, { className: "flex-1", children: [
906
+ /* @__PURE__ */ r.jsx(
907
+ l,
908
+ {
909
+ className: "text-base font-medium text-gray-900 dark:text-white",
910
+ numberOfLines: 1,
911
+ children: a.name
912
+ }
913
+ ),
914
+ E && a.role && /* @__PURE__ */ r.jsx(l, { className: "text-xs text-gray-500 dark:text-gray-400 capitalize", children: a.role })
915
+ ] })
916
+ ] }) : /* @__PURE__ */ r.jsx(l, { className: "flex-1 text-gray-500 dark:text-gray-400", children: g }),
917
+ /* @__PURE__ */ r.jsx(l, { className: "text-gray-400 dark:text-gray-500 text-lg ml-2", children: "▼" })
918
+ ]
919
+ }
920
+ ),
921
+ /* @__PURE__ */ r.jsx(
922
+ qe,
923
+ {
924
+ visible: j,
925
+ transparent: !0,
926
+ animationType: "fade",
927
+ onRequestClose: T,
928
+ children: /* @__PURE__ */ r.jsx(
929
+ $,
930
+ {
931
+ onPress: T,
932
+ className: "flex-1 bg-black/50 justify-center px-4",
933
+ children: /* @__PURE__ */ r.jsxs(
934
+ $,
935
+ {
936
+ onPress: (c) => c.stopPropagation(),
937
+ className: "bg-white dark:bg-gray-800 rounded-2xl overflow-hidden max-h-96",
938
+ children: [
939
+ /* @__PURE__ */ r.jsx(i, { className: "px-4 py-3 border-b border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ r.jsx(l, { className: "text-lg font-semibold text-gray-900 dark:text-white", children: "Select Entity" }) }),
940
+ /* @__PURE__ */ r.jsx(
941
+ ae,
942
+ {
943
+ data: n,
944
+ renderItem: x,
945
+ keyExtractor: (c) => c.id,
946
+ showsVerticalScrollIndicator: !1,
947
+ ListEmptyComponent: /* @__PURE__ */ r.jsx(i, { className: "py-8 items-center", children: /* @__PURE__ */ r.jsx(l, { className: "text-gray-500 dark:text-gray-400", children: "No entities available" }) })
948
+ }
949
+ ),
950
+ /* @__PURE__ */ r.jsx(
951
+ $,
952
+ {
953
+ onPress: T,
954
+ className: "px-4 py-3 border-t border-gray-200 dark:border-gray-700 items-center active:bg-gray-100 dark:active:bg-gray-700",
955
+ children: /* @__PURE__ */ r.jsx(l, { className: "text-blue-500 dark:text-blue-400 font-medium", children: "Cancel" })
956
+ }
957
+ )
958
+ ]
959
+ }
960
+ )
961
+ }
962
+ )
963
+ }
964
+ )
965
+ ] });
966
+ }, Sr = (n) => {
967
+ const a = {
968
+ owner: "bg-purple-100 dark:bg-purple-900 text-purple-800 dark:text-purple-200",
969
+ admin: "bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200",
970
+ member: "bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200",
971
+ viewer: "bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200",
972
+ guest: "bg-yellow-100 dark:bg-yellow-900 text-yellow-800 dark:text-yellow-200"
973
+ };
974
+ return a[n] || a.member;
975
+ }, Tr = (n) => {
976
+ const a = H.find((p) => p.role === n);
977
+ return (a == null ? void 0 : a.label) || n;
978
+ }, Or = (n) => {
979
+ switch (n) {
980
+ case "active":
981
+ return "bg-green-500";
982
+ case "inactive":
983
+ return "bg-gray-400";
984
+ case "pending":
985
+ return "bg-yellow-500";
986
+ default:
987
+ return "bg-green-500";
988
+ }
989
+ }, Br = ({
990
+ members: n,
991
+ onMemberPress: a,
992
+ onRoleChange: p,
993
+ onRemoveMember: g,
994
+ currentUserRole: m,
995
+ canEditRoles: N = !1,
996
+ canRemoveMembers: w = !1,
997
+ emptyMessage: E = "No members found",
998
+ emptyIcon: h,
999
+ loading: C = !1,
1000
+ refreshing: v = !1,
1001
+ onRefresh: j,
1002
+ ListHeaderComponent: _,
1003
+ ListFooterComponent: R,
1004
+ className: T = "",
1005
+ style: u,
1006
+ testID: I
1007
+ }) => {
1008
+ const x = (b) => !N || !m ? !1 : !!(m === "owner" && b.role !== "owner" || m === "admin" && ["member", "viewer", "guest"].includes(b.role)), c = (b) => !w || !m || b.role === "owner" ? !1 : !!(m === "owner" || m === "admin" && ["member", "viewer", "guest"].includes(b.role)), A = ({ item: b }) => /* @__PURE__ */ r.jsxs(
1009
+ $,
1010
+ {
1011
+ onPress: () => a == null ? void 0 : a(b),
1012
+ disabled: !a,
1013
+ className: `
1014
+ flex-row items-center p-4 rounded-xl mb-3
1015
+ bg-white dark:bg-gray-800
1016
+ border border-gray-200 dark:border-gray-700
1017
+ active:opacity-80
1018
+ `,
1019
+ accessibilityRole: "button",
1020
+ accessibilityLabel: `Member: ${b.name}, Role: ${b.role}`,
1021
+ children: [
1022
+ /* @__PURE__ */ r.jsxs(i, { className: "mr-3 relative", children: [
1023
+ b.avatarUrl ? /* @__PURE__ */ r.jsx(
1024
+ xe,
1025
+ {
1026
+ source: { uri: b.avatarUrl },
1027
+ className: "w-12 h-12 rounded-full bg-gray-200 dark:bg-gray-600",
1028
+ accessibilityIgnoresInvertColors: !0
1029
+ }
1030
+ ) : /* @__PURE__ */ r.jsx(i, { className: "w-12 h-12 rounded-full bg-gray-200 dark:bg-gray-600 items-center justify-center", children: /* @__PURE__ */ r.jsx(l, { className: "text-lg font-semibold text-gray-600 dark:text-gray-300", children: b.name.charAt(0).toUpperCase() }) }),
1031
+ /* @__PURE__ */ r.jsx(
1032
+ i,
1033
+ {
1034
+ className: `absolute bottom-0 right-0 w-3 h-3 rounded-full ${Or(b.status)} border-2 border-white dark:border-gray-800`
1035
+ }
1036
+ )
1037
+ ] }),
1038
+ /* @__PURE__ */ r.jsxs(i, { className: "flex-1", children: [
1039
+ /* @__PURE__ */ r.jsxs(i, { className: "flex-row items-center flex-wrap", children: [
1040
+ /* @__PURE__ */ r.jsx(
1041
+ l,
1042
+ {
1043
+ className: "text-base font-semibold text-gray-900 dark:text-white mr-2",
1044
+ numberOfLines: 1,
1045
+ children: b.name
1046
+ }
1047
+ ),
1048
+ /* @__PURE__ */ r.jsx(
1049
+ i,
1050
+ {
1051
+ className: `px-2 py-0.5 rounded-full ${Sr(b.role)}`,
1052
+ children: /* @__PURE__ */ r.jsx(l, { className: "text-xs font-medium", children: Tr(b.role) })
1053
+ }
1054
+ )
1055
+ ] }),
1056
+ /* @__PURE__ */ r.jsx(
1057
+ l,
1058
+ {
1059
+ className: "text-sm text-gray-600 dark:text-gray-400",
1060
+ numberOfLines: 1,
1061
+ children: b.email
1062
+ }
1063
+ ),
1064
+ b.joinedAt && /* @__PURE__ */ r.jsxs(l, { className: "text-xs text-gray-500 dark:text-gray-500 mt-1", children: [
1065
+ "Joined ",
1066
+ new Date(b.joinedAt).toLocaleDateString()
1067
+ ] })
1068
+ ] }),
1069
+ /* @__PURE__ */ r.jsxs(i, { className: "flex-row items-center ml-2", children: [
1070
+ x(b) && p && /* @__PURE__ */ r.jsx(
1071
+ $,
1072
+ {
1073
+ onPress: () => {
1074
+ },
1075
+ className: "p-2 mr-1 active:opacity-60",
1076
+ accessibilityRole: "button",
1077
+ accessibilityLabel: "Edit role",
1078
+ children: /* @__PURE__ */ r.jsx(l, { className: "text-blue-500 dark:text-blue-400 text-sm", children: "Edit" })
1079
+ }
1080
+ ),
1081
+ c(b) && g && /* @__PURE__ */ r.jsx(
1082
+ $,
1083
+ {
1084
+ onPress: () => g(b),
1085
+ className: "p-2 active:opacity-60",
1086
+ accessibilityRole: "button",
1087
+ accessibilityLabel: "Remove member",
1088
+ children: /* @__PURE__ */ r.jsx(l, { className: "text-red-500 dark:text-red-400 text-sm", children: "Remove" })
1089
+ }
1090
+ )
1091
+ ] })
1092
+ ]
1093
+ }
1094
+ ), P = () => C ? /* @__PURE__ */ r.jsxs(i, { className: "flex-1 items-center justify-center py-12", children: [
1095
+ /* @__PURE__ */ r.jsx(se, { size: "large", color: "#3B82F6" }),
1096
+ /* @__PURE__ */ r.jsx(l, { className: "text-gray-500 dark:text-gray-400 mt-4", children: "Loading..." })
1097
+ ] }) : /* @__PURE__ */ r.jsxs(i, { className: "flex-1 items-center justify-center py-12", children: [
1098
+ h,
1099
+ /* @__PURE__ */ r.jsx(l, { className: "text-gray-500 dark:text-gray-400 text-center mt-2", children: E })
1100
+ ] });
1101
+ return /* @__PURE__ */ r.jsx(i, { className: `flex-1 ${T}`, style: u, testID: I, children: /* @__PURE__ */ r.jsx(
1102
+ ae,
1103
+ {
1104
+ data: n,
1105
+ renderItem: A,
1106
+ keyExtractor: (b) => b.id,
1107
+ ListHeaderComponent: _,
1108
+ ListFooterComponent: R,
1109
+ ListEmptyComponent: P,
1110
+ contentContainerStyle: { flexGrow: 1, padding: 16 },
1111
+ showsVerticalScrollIndicator: !1,
1112
+ refreshControl: j ? /* @__PURE__ */ r.jsx(
1113
+ be,
1114
+ {
1115
+ refreshing: v,
1116
+ onRefresh: j,
1117
+ tintColor: "#3B82F6"
1118
+ }
1119
+ ) : void 0
1120
+ }
1121
+ ) });
1122
+ }, Be = (n) => {
1123
+ const a = {
1124
+ owner: "bg-purple-100 dark:bg-purple-900 text-purple-800 dark:text-purple-200",
1125
+ admin: "bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200",
1126
+ member: "bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200",
1127
+ viewer: "bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200",
1128
+ guest: "bg-yellow-100 dark:bg-yellow-900 text-yellow-800 dark:text-yellow-200"
1129
+ };
1130
+ return a[n] || a.member;
1131
+ }, Pr = ({
1132
+ selectedRole: n,
1133
+ onRoleChange: a,
1134
+ availableRoles: p = ["admin", "member", "viewer", "guest"],
1135
+ disabled: g = !1,
1136
+ showDescriptions: m = !0,
1137
+ className: N = "",
1138
+ style: w,
1139
+ testID: E
1140
+ }) => {
1141
+ const [h, C] = q(!1), v = () => {
1142
+ g || C(!0);
1143
+ }, j = () => {
1144
+ C(!1);
1145
+ }, _ = (u) => {
1146
+ a(u), j();
1147
+ }, R = H.find(
1148
+ (u) => u.role === n
1149
+ ), T = H.filter(
1150
+ (u) => p.includes(u.role)
1151
+ );
1152
+ return /* @__PURE__ */ r.jsxs(i, { className: N, style: w, testID: E, children: [
1153
+ /* @__PURE__ */ r.jsxs(
1154
+ $,
1155
+ {
1156
+ onPress: v,
1157
+ disabled: g,
1158
+ className: `
1159
+ flex-row items-center justify-between px-4 py-3 rounded-xl
1160
+ bg-white dark:bg-gray-800
1161
+ border border-gray-200 dark:border-gray-700
1162
+ ${g ? "opacity-50" : ""}
1163
+ active:opacity-80
1164
+ `,
1165
+ accessibilityRole: "button",
1166
+ accessibilityLabel: `Selected role: ${(R == null ? void 0 : R.label) || n}`,
1167
+ accessibilityState: { disabled: g },
1168
+ children: [
1169
+ /* @__PURE__ */ r.jsxs(i, { className: "flex-row items-center", children: [
1170
+ /* @__PURE__ */ r.jsx(
1171
+ i,
1172
+ {
1173
+ className: `px-3 py-1 rounded-full mr-2 ${Be(n)}`,
1174
+ children: /* @__PURE__ */ r.jsx(l, { className: "text-sm font-medium", children: (R == null ? void 0 : R.label) || n })
1175
+ }
1176
+ ),
1177
+ m && R && /* @__PURE__ */ r.jsx(
1178
+ l,
1179
+ {
1180
+ className: "text-sm text-gray-500 dark:text-gray-400 flex-1",
1181
+ numberOfLines: 1,
1182
+ children: R.description
1183
+ }
1184
+ )
1185
+ ] }),
1186
+ /* @__PURE__ */ r.jsx(l, { className: "text-gray-400 dark:text-gray-500 text-lg ml-2", children: "▼" })
1187
+ ]
1188
+ }
1189
+ ),
1190
+ /* @__PURE__ */ r.jsx(
1191
+ qe,
1192
+ {
1193
+ visible: h,
1194
+ transparent: !0,
1195
+ animationType: "fade",
1196
+ onRequestClose: j,
1197
+ children: /* @__PURE__ */ r.jsx(
1198
+ $,
1199
+ {
1200
+ onPress: j,
1201
+ className: "flex-1 bg-black/50 justify-center px-4",
1202
+ children: /* @__PURE__ */ r.jsxs(
1203
+ $,
1204
+ {
1205
+ onPress: (u) => u.stopPropagation(),
1206
+ className: "bg-white dark:bg-gray-800 rounded-2xl overflow-hidden",
1207
+ children: [
1208
+ /* @__PURE__ */ r.jsx(i, { className: "px-4 py-3 border-b border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ r.jsx(l, { className: "text-lg font-semibold text-gray-900 dark:text-white", children: "Select Role" }) }),
1209
+ T.map((u) => /* @__PURE__ */ r.jsx(
1210
+ $,
1211
+ {
1212
+ onPress: () => _(u.role),
1213
+ className: `
1214
+ px-4 py-4 border-b border-gray-100 dark:border-gray-700
1215
+ ${n === u.role ? "bg-blue-50 dark:bg-blue-900/30" : ""}
1216
+ active:bg-gray-100 dark:active:bg-gray-700
1217
+ `,
1218
+ accessibilityRole: "button",
1219
+ accessibilityLabel: `${u.label}: ${u.description}`,
1220
+ accessibilityState: { selected: n === u.role },
1221
+ children: /* @__PURE__ */ r.jsxs(i, { className: "flex-row items-center justify-between", children: [
1222
+ /* @__PURE__ */ r.jsxs(i, { className: "flex-1", children: [
1223
+ /* @__PURE__ */ r.jsx(i, { className: "flex-row items-center", children: /* @__PURE__ */ r.jsx(
1224
+ i,
1225
+ {
1226
+ className: `px-3 py-1 rounded-full ${Be(u.role)}`,
1227
+ children: /* @__PURE__ */ r.jsx(l, { className: "text-sm font-medium", children: u.label })
1228
+ }
1229
+ ) }),
1230
+ m && /* @__PURE__ */ r.jsx(l, { className: "text-sm text-gray-500 dark:text-gray-400 mt-2", children: u.description })
1231
+ ] }),
1232
+ n === u.role && /* @__PURE__ */ r.jsx(l, { className: "text-blue-500 dark:text-blue-400 text-lg ml-2", children: "✓" })
1233
+ ] })
1234
+ },
1235
+ u.role
1236
+ )),
1237
+ /* @__PURE__ */ r.jsx(
1238
+ $,
1239
+ {
1240
+ onPress: j,
1241
+ className: "px-4 py-3 items-center active:bg-gray-100 dark:active:bg-gray-700",
1242
+ children: /* @__PURE__ */ r.jsx(l, { className: "text-blue-500 dark:text-blue-400 font-medium", children: "Cancel" })
1243
+ }
1244
+ )
1245
+ ]
1246
+ }
1247
+ )
1248
+ }
1249
+ )
1250
+ }
1251
+ )
1252
+ ] });
1253
+ }, $r = (n) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n), Ur = ({
1254
+ onSubmit: n,
1255
+ availableRoles: a = ["admin", "member", "viewer", "guest"],
1256
+ defaultRole: p = "member",
1257
+ loading: g = !1,
1258
+ disabled: m = !1,
1259
+ placeholder: N = "Enter email address",
1260
+ submitLabel: w = "Send Invitation",
1261
+ className: E = "",
1262
+ style: h,
1263
+ testID: C
1264
+ }) => {
1265
+ const [v, j] = q(""), [_, R] = q(p), [T, u] = q(null), [I, x] = q(!1), c = (V) => {
1266
+ j(V), T && u(null);
1267
+ }, A = async () => {
1268
+ const V = v.trim();
1269
+ if (!V) {
1270
+ u("Email address is required");
1271
+ return;
1272
+ }
1273
+ if (!$r(V)) {
1274
+ u("Please enter a valid email address");
1275
+ return;
1276
+ }
1277
+ x(!0), u(null);
1278
+ try {
1279
+ await n(V, _), j(""), R(p);
1280
+ } catch (X) {
1281
+ u(
1282
+ X instanceof Error ? X.message : "Failed to send invitation"
1283
+ );
1284
+ } finally {
1285
+ x(!1);
1286
+ }
1287
+ }, P = m || g || I, b = v.trim().length > 0 && !P;
1288
+ return /* @__PURE__ */ r.jsxs(i, { className: `${E}`, style: h, testID: C, children: [
1289
+ /* @__PURE__ */ r.jsxs(i, { className: "mb-4", children: [
1290
+ /* @__PURE__ */ r.jsx(l, { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-2", children: "Email Address" }),
1291
+ /* @__PURE__ */ r.jsx(
1292
+ kr,
1293
+ {
1294
+ value: v,
1295
+ onChangeText: c,
1296
+ placeholder: N,
1297
+ placeholderTextColor: "#9CA3AF",
1298
+ keyboardType: "email-address",
1299
+ autoCapitalize: "none",
1300
+ autoCorrect: !1,
1301
+ autoComplete: "email",
1302
+ editable: !P,
1303
+ className: `
1304
+ px-4 py-3 rounded-xl
1305
+ bg-white dark:bg-gray-800
1306
+ border ${T ? "border-red-500" : "border-gray-200 dark:border-gray-700"}
1307
+ text-gray-900 dark:text-white
1308
+ ${P ? "opacity-50" : ""}
1309
+ `,
1310
+ accessibilityLabel: "Email address input",
1311
+ accessibilityHint: "Enter the email address of the person you want to invite"
1312
+ }
1313
+ ),
1314
+ T && /* @__PURE__ */ r.jsx(l, { className: "text-sm text-red-500 dark:text-red-400 mt-1", children: T })
1315
+ ] }),
1316
+ /* @__PURE__ */ r.jsxs(i, { className: "mb-4", children: [
1317
+ /* @__PURE__ */ r.jsx(l, { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-2", children: "Role" }),
1318
+ /* @__PURE__ */ r.jsx(
1319
+ Pr,
1320
+ {
1321
+ selectedRole: _,
1322
+ onRoleChange: R,
1323
+ availableRoles: a,
1324
+ disabled: P,
1325
+ showDescriptions: !0
1326
+ }
1327
+ )
1328
+ ] }),
1329
+ /* @__PURE__ */ r.jsx(
1330
+ $,
1331
+ {
1332
+ onPress: A,
1333
+ disabled: !b,
1334
+ className: `
1335
+ flex-row items-center justify-center px-6 py-4 rounded-xl
1336
+ ${b ? "bg-blue-500 dark:bg-blue-600 active:bg-blue-600 dark:active:bg-blue-700" : "bg-gray-300 dark:bg-gray-600"}
1337
+ `,
1338
+ accessibilityRole: "button",
1339
+ accessibilityLabel: w,
1340
+ accessibilityState: { disabled: !b },
1341
+ children: I ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
1342
+ /* @__PURE__ */ r.jsx(se, { size: "small", color: "#FFFFFF" }),
1343
+ /* @__PURE__ */ r.jsx(l, { className: "text-white font-semibold ml-2", children: "Sending..." })
1344
+ ] }) : /* @__PURE__ */ r.jsx(
1345
+ l,
1346
+ {
1347
+ className: `font-semibold ${b ? "text-white" : "text-gray-500 dark:text-gray-400"}`,
1348
+ children: w
1349
+ }
1350
+ )
1351
+ }
1352
+ ),
1353
+ /* @__PURE__ */ r.jsx(l, { className: "text-xs text-gray-500 dark:text-gray-400 mt-3 text-center", children: "The invitee will receive an email with instructions to join." })
1354
+ ] });
1355
+ }, Fr = (n) => {
1356
+ const a = {
1357
+ owner: "bg-purple-100 dark:bg-purple-900 text-purple-800 dark:text-purple-200",
1358
+ admin: "bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200",
1359
+ member: "bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200",
1360
+ viewer: "bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200",
1361
+ guest: "bg-yellow-100 dark:bg-yellow-900 text-yellow-800 dark:text-yellow-200"
1362
+ };
1363
+ return a[n] || a.member;
1364
+ }, Lr = (n) => {
1365
+ const a = H.find((p) => p.role === n);
1366
+ return (a == null ? void 0 : a.label) || n;
1367
+ }, Ir = (n) => {
1368
+ const a = {
1369
+ pending: "bg-yellow-100 dark:bg-yellow-900 text-yellow-800 dark:text-yellow-200",
1370
+ accepted: "bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200",
1371
+ declined: "bg-red-100 dark:bg-red-900 text-red-800 dark:text-red-200",
1372
+ expired: "bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200"
1373
+ };
1374
+ return a[n] || a.pending;
1375
+ }, Ar = (n) => n.charAt(0).toUpperCase() + n.slice(1), Dr = (n) => {
1376
+ const a = new Date(n), g = (/* @__PURE__ */ new Date()).getTime() - a.getTime(), m = Math.floor(g / (1e3 * 60 * 60 * 24)), N = Math.floor(g / (1e3 * 60 * 60)), w = Math.floor(g / (1e3 * 60));
1377
+ return m > 0 ? `${m} day${m > 1 ? "s" : ""} ago` : N > 0 ? `${N} hour${N > 1 ? "s" : ""} ago` : w > 0 ? `${w} minute${w > 1 ? "s" : ""} ago` : "Just now";
1378
+ }, qr = ({
1379
+ invitations: n,
1380
+ onResend: a,
1381
+ onCancel: p,
1382
+ canResend: g = !0,
1383
+ canCancel: m = !0,
1384
+ emptyMessage: N = "No pending invitations",
1385
+ emptyIcon: w,
1386
+ loading: E = !1,
1387
+ refreshing: h = !1,
1388
+ onRefresh: C,
1389
+ ListHeaderComponent: v,
1390
+ ListFooterComponent: j,
1391
+ className: _ = "",
1392
+ style: R,
1393
+ testID: T
1394
+ }) => {
1395
+ const u = ({ item: x }) => {
1396
+ const c = x.status === "pending", A = g && a && c, P = m && p && c;
1397
+ return /* @__PURE__ */ r.jsxs(
1398
+ i,
1399
+ {
1400
+ className: `
1401
+ p-4 rounded-xl mb-3
1402
+ bg-white dark:bg-gray-800
1403
+ border border-gray-200 dark:border-gray-700
1404
+ `,
1405
+ accessibilityLabel: `Invitation to ${x.email}, Status: ${x.status}`,
1406
+ children: [
1407
+ /* @__PURE__ */ r.jsxs(i, { className: "flex-row items-center justify-between mb-2", children: [
1408
+ /* @__PURE__ */ r.jsx(
1409
+ l,
1410
+ {
1411
+ className: "text-base font-semibold text-gray-900 dark:text-white flex-1",
1412
+ numberOfLines: 1,
1413
+ children: x.email
1414
+ }
1415
+ ),
1416
+ /* @__PURE__ */ r.jsx(
1417
+ i,
1418
+ {
1419
+ className: `px-2 py-0.5 rounded-full ${Ir(x.status)}`,
1420
+ children: /* @__PURE__ */ r.jsx(l, { className: "text-xs font-medium", children: Ar(x.status) })
1421
+ }
1422
+ )
1423
+ ] }),
1424
+ /* @__PURE__ */ r.jsxs(i, { className: "flex-row items-center mb-2", children: [
1425
+ /* @__PURE__ */ r.jsx(
1426
+ i,
1427
+ {
1428
+ className: `px-2 py-0.5 rounded-full mr-2 ${Fr(x.role)}`,
1429
+ children: /* @__PURE__ */ r.jsx(l, { className: "text-xs font-medium", children: Lr(x.role) })
1430
+ }
1431
+ ),
1432
+ /* @__PURE__ */ r.jsxs(l, { className: "text-xs text-gray-500 dark:text-gray-400", children: [
1433
+ "Invited ",
1434
+ Dr(x.invitedAt)
1435
+ ] })
1436
+ ] }),
1437
+ x.invitedBy && /* @__PURE__ */ r.jsxs(l, { className: "text-xs text-gray-500 dark:text-gray-400 mb-2", children: [
1438
+ "by ",
1439
+ x.invitedBy
1440
+ ] }),
1441
+ x.expiresAt && c && /* @__PURE__ */ r.jsxs(l, { className: "text-xs text-yellow-600 dark:text-yellow-400 mb-2", children: [
1442
+ "Expires: ",
1443
+ new Date(x.expiresAt).toLocaleDateString()
1444
+ ] }),
1445
+ (A || P) && /* @__PURE__ */ r.jsxs(i, { className: "flex-row items-center mt-2 pt-2 border-t border-gray-100 dark:border-gray-700", children: [
1446
+ A && /* @__PURE__ */ r.jsx(
1447
+ $,
1448
+ {
1449
+ onPress: () => a(x),
1450
+ className: "flex-row items-center mr-4 py-1 active:opacity-60",
1451
+ accessibilityRole: "button",
1452
+ accessibilityLabel: "Resend invitation",
1453
+ children: /* @__PURE__ */ r.jsx(l, { className: "text-blue-500 dark:text-blue-400 text-sm font-medium", children: "Resend" })
1454
+ }
1455
+ ),
1456
+ P && /* @__PURE__ */ r.jsx(
1457
+ $,
1458
+ {
1459
+ onPress: () => p(x),
1460
+ className: "flex-row items-center py-1 active:opacity-60",
1461
+ accessibilityRole: "button",
1462
+ accessibilityLabel: "Cancel invitation",
1463
+ children: /* @__PURE__ */ r.jsx(l, { className: "text-red-500 dark:text-red-400 text-sm font-medium", children: "Cancel" })
1464
+ }
1465
+ )
1466
+ ] })
1467
+ ]
1468
+ }
1469
+ );
1470
+ }, I = () => E ? /* @__PURE__ */ r.jsxs(i, { className: "flex-1 items-center justify-center py-12", children: [
1471
+ /* @__PURE__ */ r.jsx(se, { size: "large", color: "#3B82F6" }),
1472
+ /* @__PURE__ */ r.jsx(l, { className: "text-gray-500 dark:text-gray-400 mt-4", children: "Loading..." })
1473
+ ] }) : /* @__PURE__ */ r.jsxs(i, { className: "flex-1 items-center justify-center py-12", children: [
1474
+ w,
1475
+ /* @__PURE__ */ r.jsx(l, { className: "text-gray-500 dark:text-gray-400 text-center mt-2", children: N })
1476
+ ] });
1477
+ return /* @__PURE__ */ r.jsx(i, { className: `flex-1 ${_}`, style: R, testID: T, children: /* @__PURE__ */ r.jsx(
1478
+ ae,
1479
+ {
1480
+ data: n,
1481
+ renderItem: u,
1482
+ keyExtractor: (x) => x.id,
1483
+ ListHeaderComponent: v,
1484
+ ListFooterComponent: j,
1485
+ ListEmptyComponent: I,
1486
+ contentContainerStyle: { flexGrow: 1, padding: 16 },
1487
+ showsVerticalScrollIndicator: !1,
1488
+ refreshControl: C ? /* @__PURE__ */ r.jsx(
1489
+ be,
1490
+ {
1491
+ refreshing: h,
1492
+ onRefresh: C,
1493
+ tintColor: "#3B82F6"
1494
+ }
1495
+ ) : void 0
1496
+ }
1497
+ ) });
1498
+ };
1499
+ export {
1500
+ H as DEFAULT_ROLE_CONFIGS,
1501
+ _r as EntityCard,
1502
+ Wr as EntityList,
1503
+ Yr as EntitySelector,
1504
+ Ur as InvitationForm,
1505
+ qr as InvitationList,
1506
+ Br as MemberList,
1507
+ Pr as MemberRoleSelector
1508
+ };
1509
+ //# sourceMappingURL=index.mjs.map