@sudobility/subscription-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.js ADDED
@@ -0,0 +1,1629 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const require$$0 = require("react");
4
+ const reactNative = require("react-native");
5
+ var jsxRuntime = { exports: {} };
6
+ var reactJsxRuntime_production_min = {};
7
+ /**
8
+ * @license React
9
+ * react-jsx-runtime.production.min.js
10
+ *
11
+ * Copyright (c) Facebook, Inc. and its affiliates.
12
+ *
13
+ * This source code is licensed under the MIT license found in the
14
+ * LICENSE file in the root directory of this source tree.
15
+ */
16
+ var hasRequiredReactJsxRuntime_production_min;
17
+ function requireReactJsxRuntime_production_min() {
18
+ if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
19
+ hasRequiredReactJsxRuntime_production_min = 1;
20
+ var f = require$$0, k = Symbol.for("react.element"), l = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: true, ref: true, __self: true, __source: true };
21
+ function q(c, a, g) {
22
+ var b, d = {}, e = null, h = null;
23
+ void 0 !== g && (e = "" + g);
24
+ void 0 !== a.key && (e = "" + a.key);
25
+ void 0 !== a.ref && (h = a.ref);
26
+ for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
27
+ if (c && c.defaultProps) for (b in a = c.defaultProps, a) void 0 === d[b] && (d[b] = a[b]);
28
+ return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
29
+ }
30
+ reactJsxRuntime_production_min.Fragment = l;
31
+ reactJsxRuntime_production_min.jsx = q;
32
+ reactJsxRuntime_production_min.jsxs = q;
33
+ return reactJsxRuntime_production_min;
34
+ }
35
+ var reactJsxRuntime_development = {};
36
+ /**
37
+ * @license React
38
+ * react-jsx-runtime.development.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 hasRequiredReactJsxRuntime_development;
46
+ function requireReactJsxRuntime_development() {
47
+ if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
48
+ hasRequiredReactJsxRuntime_development = 1;
49
+ if (process.env.NODE_ENV !== "production") {
50
+ (function() {
51
+ var React = require$$0;
52
+ var REACT_ELEMENT_TYPE = Symbol.for("react.element");
53
+ var REACT_PORTAL_TYPE = Symbol.for("react.portal");
54
+ var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
55
+ var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
56
+ var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
57
+ var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
58
+ var REACT_CONTEXT_TYPE = Symbol.for("react.context");
59
+ var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
60
+ var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
61
+ var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
62
+ var REACT_MEMO_TYPE = Symbol.for("react.memo");
63
+ var REACT_LAZY_TYPE = Symbol.for("react.lazy");
64
+ var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
65
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
66
+ var FAUX_ITERATOR_SYMBOL = "@@iterator";
67
+ function getIteratorFn(maybeIterable) {
68
+ if (maybeIterable === null || typeof maybeIterable !== "object") {
69
+ return null;
70
+ }
71
+ var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
72
+ if (typeof maybeIterator === "function") {
73
+ return maybeIterator;
74
+ }
75
+ return null;
76
+ }
77
+ var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
78
+ function error(format) {
79
+ {
80
+ {
81
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
82
+ args[_key2 - 1] = arguments[_key2];
83
+ }
84
+ printWarning("error", format, args);
85
+ }
86
+ }
87
+ }
88
+ function printWarning(level, format, args) {
89
+ {
90
+ var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
91
+ var stack = ReactDebugCurrentFrame2.getStackAddendum();
92
+ if (stack !== "") {
93
+ format += "%s";
94
+ args = args.concat([stack]);
95
+ }
96
+ var argsWithFormat = args.map(function(item) {
97
+ return String(item);
98
+ });
99
+ argsWithFormat.unshift("Warning: " + format);
100
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
101
+ }
102
+ }
103
+ var enableScopeAPI = false;
104
+ var enableCacheElement = false;
105
+ var enableTransitionTracing = false;
106
+ var enableLegacyHidden = false;
107
+ var enableDebugTracing = false;
108
+ var REACT_MODULE_REFERENCE;
109
+ {
110
+ REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
111
+ }
112
+ function isValidElementType(type) {
113
+ if (typeof type === "string" || typeof type === "function") {
114
+ return true;
115
+ }
116
+ if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
117
+ return true;
118
+ }
119
+ if (typeof type === "object" && type !== null) {
120
+ if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
121
+ // types supported by any Flight configuration anywhere since
122
+ // we don't know which Flight build this will end up being used
123
+ // with.
124
+ type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
125
+ return true;
126
+ }
127
+ }
128
+ return false;
129
+ }
130
+ function getWrappedName(outerType, innerType, wrapperName) {
131
+ var displayName = outerType.displayName;
132
+ if (displayName) {
133
+ return displayName;
134
+ }
135
+ var functionName = innerType.displayName || innerType.name || "";
136
+ return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
137
+ }
138
+ function getContextName(type) {
139
+ return type.displayName || "Context";
140
+ }
141
+ function getComponentNameFromType(type) {
142
+ if (type == null) {
143
+ return null;
144
+ }
145
+ {
146
+ if (typeof type.tag === "number") {
147
+ error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
148
+ }
149
+ }
150
+ if (typeof type === "function") {
151
+ return type.displayName || type.name || null;
152
+ }
153
+ if (typeof type === "string") {
154
+ return type;
155
+ }
156
+ switch (type) {
157
+ case REACT_FRAGMENT_TYPE:
158
+ return "Fragment";
159
+ case REACT_PORTAL_TYPE:
160
+ return "Portal";
161
+ case REACT_PROFILER_TYPE:
162
+ return "Profiler";
163
+ case REACT_STRICT_MODE_TYPE:
164
+ return "StrictMode";
165
+ case REACT_SUSPENSE_TYPE:
166
+ return "Suspense";
167
+ case REACT_SUSPENSE_LIST_TYPE:
168
+ return "SuspenseList";
169
+ }
170
+ if (typeof type === "object") {
171
+ switch (type.$$typeof) {
172
+ case REACT_CONTEXT_TYPE:
173
+ var context = type;
174
+ return getContextName(context) + ".Consumer";
175
+ case REACT_PROVIDER_TYPE:
176
+ var provider = type;
177
+ return getContextName(provider._context) + ".Provider";
178
+ case REACT_FORWARD_REF_TYPE:
179
+ return getWrappedName(type, type.render, "ForwardRef");
180
+ case REACT_MEMO_TYPE:
181
+ var outerName = type.displayName || null;
182
+ if (outerName !== null) {
183
+ return outerName;
184
+ }
185
+ return getComponentNameFromType(type.type) || "Memo";
186
+ case REACT_LAZY_TYPE: {
187
+ var lazyComponent = type;
188
+ var payload = lazyComponent._payload;
189
+ var init = lazyComponent._init;
190
+ try {
191
+ return getComponentNameFromType(init(payload));
192
+ } catch (x) {
193
+ return null;
194
+ }
195
+ }
196
+ }
197
+ }
198
+ return null;
199
+ }
200
+ var assign = Object.assign;
201
+ var disabledDepth = 0;
202
+ var prevLog;
203
+ var prevInfo;
204
+ var prevWarn;
205
+ var prevError;
206
+ var prevGroup;
207
+ var prevGroupCollapsed;
208
+ var prevGroupEnd;
209
+ function disabledLog() {
210
+ }
211
+ disabledLog.__reactDisabledLog = true;
212
+ function disableLogs() {
213
+ {
214
+ if (disabledDepth === 0) {
215
+ prevLog = console.log;
216
+ prevInfo = console.info;
217
+ prevWarn = console.warn;
218
+ prevError = console.error;
219
+ prevGroup = console.group;
220
+ prevGroupCollapsed = console.groupCollapsed;
221
+ prevGroupEnd = console.groupEnd;
222
+ var props = {
223
+ configurable: true,
224
+ enumerable: true,
225
+ value: disabledLog,
226
+ writable: true
227
+ };
228
+ Object.defineProperties(console, {
229
+ info: props,
230
+ log: props,
231
+ warn: props,
232
+ error: props,
233
+ group: props,
234
+ groupCollapsed: props,
235
+ groupEnd: props
236
+ });
237
+ }
238
+ disabledDepth++;
239
+ }
240
+ }
241
+ function reenableLogs() {
242
+ {
243
+ disabledDepth--;
244
+ if (disabledDepth === 0) {
245
+ var props = {
246
+ configurable: true,
247
+ enumerable: true,
248
+ writable: true
249
+ };
250
+ Object.defineProperties(console, {
251
+ log: assign({}, props, {
252
+ value: prevLog
253
+ }),
254
+ info: assign({}, props, {
255
+ value: prevInfo
256
+ }),
257
+ warn: assign({}, props, {
258
+ value: prevWarn
259
+ }),
260
+ error: assign({}, props, {
261
+ value: prevError
262
+ }),
263
+ group: assign({}, props, {
264
+ value: prevGroup
265
+ }),
266
+ groupCollapsed: assign({}, props, {
267
+ value: prevGroupCollapsed
268
+ }),
269
+ groupEnd: assign({}, props, {
270
+ value: prevGroupEnd
271
+ })
272
+ });
273
+ }
274
+ if (disabledDepth < 0) {
275
+ error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
276
+ }
277
+ }
278
+ }
279
+ var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
280
+ var prefix;
281
+ function describeBuiltInComponentFrame(name, source, ownerFn) {
282
+ {
283
+ if (prefix === void 0) {
284
+ try {
285
+ throw Error();
286
+ } catch (x) {
287
+ var match = x.stack.trim().match(/\n( *(at )?)/);
288
+ prefix = match && match[1] || "";
289
+ }
290
+ }
291
+ return "\n" + prefix + name;
292
+ }
293
+ }
294
+ var reentry = false;
295
+ var componentFrameCache;
296
+ {
297
+ var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
298
+ componentFrameCache = new PossiblyWeakMap();
299
+ }
300
+ function describeNativeComponentFrame(fn, construct) {
301
+ if (!fn || reentry) {
302
+ return "";
303
+ }
304
+ {
305
+ var frame = componentFrameCache.get(fn);
306
+ if (frame !== void 0) {
307
+ return frame;
308
+ }
309
+ }
310
+ var control;
311
+ reentry = true;
312
+ var previousPrepareStackTrace = Error.prepareStackTrace;
313
+ Error.prepareStackTrace = void 0;
314
+ var previousDispatcher;
315
+ {
316
+ previousDispatcher = ReactCurrentDispatcher.current;
317
+ ReactCurrentDispatcher.current = null;
318
+ disableLogs();
319
+ }
320
+ try {
321
+ if (construct) {
322
+ var Fake = function() {
323
+ throw Error();
324
+ };
325
+ Object.defineProperty(Fake.prototype, "props", {
326
+ set: function() {
327
+ throw Error();
328
+ }
329
+ });
330
+ if (typeof Reflect === "object" && Reflect.construct) {
331
+ try {
332
+ Reflect.construct(Fake, []);
333
+ } catch (x) {
334
+ control = x;
335
+ }
336
+ Reflect.construct(fn, [], Fake);
337
+ } else {
338
+ try {
339
+ Fake.call();
340
+ } catch (x) {
341
+ control = x;
342
+ }
343
+ fn.call(Fake.prototype);
344
+ }
345
+ } else {
346
+ try {
347
+ throw Error();
348
+ } catch (x) {
349
+ control = x;
350
+ }
351
+ fn();
352
+ }
353
+ } catch (sample) {
354
+ if (sample && control && typeof sample.stack === "string") {
355
+ var sampleLines = sample.stack.split("\n");
356
+ var controlLines = control.stack.split("\n");
357
+ var s = sampleLines.length - 1;
358
+ var c = controlLines.length - 1;
359
+ while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
360
+ c--;
361
+ }
362
+ for (; s >= 1 && c >= 0; s--, c--) {
363
+ if (sampleLines[s] !== controlLines[c]) {
364
+ if (s !== 1 || c !== 1) {
365
+ do {
366
+ s--;
367
+ c--;
368
+ if (c < 0 || sampleLines[s] !== controlLines[c]) {
369
+ var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
370
+ if (fn.displayName && _frame.includes("<anonymous>")) {
371
+ _frame = _frame.replace("<anonymous>", fn.displayName);
372
+ }
373
+ {
374
+ if (typeof fn === "function") {
375
+ componentFrameCache.set(fn, _frame);
376
+ }
377
+ }
378
+ return _frame;
379
+ }
380
+ } while (s >= 1 && c >= 0);
381
+ }
382
+ break;
383
+ }
384
+ }
385
+ }
386
+ } finally {
387
+ reentry = false;
388
+ {
389
+ ReactCurrentDispatcher.current = previousDispatcher;
390
+ reenableLogs();
391
+ }
392
+ Error.prepareStackTrace = previousPrepareStackTrace;
393
+ }
394
+ var name = fn ? fn.displayName || fn.name : "";
395
+ var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
396
+ {
397
+ if (typeof fn === "function") {
398
+ componentFrameCache.set(fn, syntheticFrame);
399
+ }
400
+ }
401
+ return syntheticFrame;
402
+ }
403
+ function describeFunctionComponentFrame(fn, source, ownerFn) {
404
+ {
405
+ return describeNativeComponentFrame(fn, false);
406
+ }
407
+ }
408
+ function shouldConstruct(Component) {
409
+ var prototype = Component.prototype;
410
+ return !!(prototype && prototype.isReactComponent);
411
+ }
412
+ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
413
+ if (type == null) {
414
+ return "";
415
+ }
416
+ if (typeof type === "function") {
417
+ {
418
+ return describeNativeComponentFrame(type, shouldConstruct(type));
419
+ }
420
+ }
421
+ if (typeof type === "string") {
422
+ return describeBuiltInComponentFrame(type);
423
+ }
424
+ switch (type) {
425
+ case REACT_SUSPENSE_TYPE:
426
+ return describeBuiltInComponentFrame("Suspense");
427
+ case REACT_SUSPENSE_LIST_TYPE:
428
+ return describeBuiltInComponentFrame("SuspenseList");
429
+ }
430
+ if (typeof type === "object") {
431
+ switch (type.$$typeof) {
432
+ case REACT_FORWARD_REF_TYPE:
433
+ return describeFunctionComponentFrame(type.render);
434
+ case REACT_MEMO_TYPE:
435
+ return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
436
+ case REACT_LAZY_TYPE: {
437
+ var lazyComponent = type;
438
+ var payload = lazyComponent._payload;
439
+ var init = lazyComponent._init;
440
+ try {
441
+ return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
442
+ } catch (x) {
443
+ }
444
+ }
445
+ }
446
+ }
447
+ return "";
448
+ }
449
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
450
+ var loggedTypeFailures = {};
451
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
452
+ function setCurrentlyValidatingElement(element) {
453
+ {
454
+ if (element) {
455
+ var owner = element._owner;
456
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
457
+ ReactDebugCurrentFrame.setExtraStackFrame(stack);
458
+ } else {
459
+ ReactDebugCurrentFrame.setExtraStackFrame(null);
460
+ }
461
+ }
462
+ }
463
+ function checkPropTypes(typeSpecs, values, location, componentName, element) {
464
+ {
465
+ var has = Function.call.bind(hasOwnProperty);
466
+ for (var typeSpecName in typeSpecs) {
467
+ if (has(typeSpecs, typeSpecName)) {
468
+ var error$1 = void 0;
469
+ try {
470
+ if (typeof typeSpecs[typeSpecName] !== "function") {
471
+ var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
472
+ err.name = "Invariant Violation";
473
+ throw err;
474
+ }
475
+ error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
476
+ } catch (ex) {
477
+ error$1 = ex;
478
+ }
479
+ if (error$1 && !(error$1 instanceof Error)) {
480
+ setCurrentlyValidatingElement(element);
481
+ error("%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).", componentName || "React class", location, typeSpecName, typeof error$1);
482
+ setCurrentlyValidatingElement(null);
483
+ }
484
+ if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
485
+ loggedTypeFailures[error$1.message] = true;
486
+ setCurrentlyValidatingElement(element);
487
+ error("Failed %s type: %s", location, error$1.message);
488
+ setCurrentlyValidatingElement(null);
489
+ }
490
+ }
491
+ }
492
+ }
493
+ }
494
+ var isArrayImpl = Array.isArray;
495
+ function isArray(a) {
496
+ return isArrayImpl(a);
497
+ }
498
+ function typeName(value) {
499
+ {
500
+ var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
501
+ var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
502
+ return type;
503
+ }
504
+ }
505
+ function willCoercionThrow(value) {
506
+ {
507
+ try {
508
+ testStringCoercion(value);
509
+ return false;
510
+ } catch (e) {
511
+ return true;
512
+ }
513
+ }
514
+ }
515
+ function testStringCoercion(value) {
516
+ return "" + value;
517
+ }
518
+ function checkKeyStringCoercion(value) {
519
+ {
520
+ if (willCoercionThrow(value)) {
521
+ error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
522
+ return testStringCoercion(value);
523
+ }
524
+ }
525
+ }
526
+ var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
527
+ var RESERVED_PROPS = {
528
+ key: true,
529
+ ref: true,
530
+ __self: true,
531
+ __source: true
532
+ };
533
+ var specialPropKeyWarningShown;
534
+ var specialPropRefWarningShown;
535
+ function hasValidRef(config) {
536
+ {
537
+ if (hasOwnProperty.call(config, "ref")) {
538
+ var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
539
+ if (getter && getter.isReactWarning) {
540
+ return false;
541
+ }
542
+ }
543
+ }
544
+ return config.ref !== void 0;
545
+ }
546
+ function hasValidKey(config) {
547
+ {
548
+ if (hasOwnProperty.call(config, "key")) {
549
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
550
+ if (getter && getter.isReactWarning) {
551
+ return false;
552
+ }
553
+ }
554
+ }
555
+ return config.key !== void 0;
556
+ }
557
+ function warnIfStringRefCannotBeAutoConverted(config, self) {
558
+ {
559
+ if (typeof config.ref === "string" && ReactCurrentOwner.current && self) ;
560
+ }
561
+ }
562
+ function defineKeyPropWarningGetter(props, displayName) {
563
+ {
564
+ var warnAboutAccessingKey = function() {
565
+ if (!specialPropKeyWarningShown) {
566
+ specialPropKeyWarningShown = true;
567
+ error("%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)", displayName);
568
+ }
569
+ };
570
+ warnAboutAccessingKey.isReactWarning = true;
571
+ Object.defineProperty(props, "key", {
572
+ get: warnAboutAccessingKey,
573
+ configurable: true
574
+ });
575
+ }
576
+ }
577
+ function defineRefPropWarningGetter(props, displayName) {
578
+ {
579
+ var warnAboutAccessingRef = function() {
580
+ if (!specialPropRefWarningShown) {
581
+ specialPropRefWarningShown = true;
582
+ error("%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)", displayName);
583
+ }
584
+ };
585
+ warnAboutAccessingRef.isReactWarning = true;
586
+ Object.defineProperty(props, "ref", {
587
+ get: warnAboutAccessingRef,
588
+ configurable: true
589
+ });
590
+ }
591
+ }
592
+ var ReactElement = function(type, key, ref, self, source, owner, props) {
593
+ var element = {
594
+ // This tag allows us to uniquely identify this as a React Element
595
+ $$typeof: REACT_ELEMENT_TYPE,
596
+ // Built-in properties that belong on the element
597
+ type,
598
+ key,
599
+ ref,
600
+ props,
601
+ // Record the component responsible for creating this element.
602
+ _owner: owner
603
+ };
604
+ {
605
+ element._store = {};
606
+ Object.defineProperty(element._store, "validated", {
607
+ configurable: false,
608
+ enumerable: false,
609
+ writable: true,
610
+ value: false
611
+ });
612
+ Object.defineProperty(element, "_self", {
613
+ configurable: false,
614
+ enumerable: false,
615
+ writable: false,
616
+ value: self
617
+ });
618
+ Object.defineProperty(element, "_source", {
619
+ configurable: false,
620
+ enumerable: false,
621
+ writable: false,
622
+ value: source
623
+ });
624
+ if (Object.freeze) {
625
+ Object.freeze(element.props);
626
+ Object.freeze(element);
627
+ }
628
+ }
629
+ return element;
630
+ };
631
+ function jsxDEV(type, config, maybeKey, source, self) {
632
+ {
633
+ var propName;
634
+ var props = {};
635
+ var key = null;
636
+ var ref = null;
637
+ if (maybeKey !== void 0) {
638
+ {
639
+ checkKeyStringCoercion(maybeKey);
640
+ }
641
+ key = "" + maybeKey;
642
+ }
643
+ if (hasValidKey(config)) {
644
+ {
645
+ checkKeyStringCoercion(config.key);
646
+ }
647
+ key = "" + config.key;
648
+ }
649
+ if (hasValidRef(config)) {
650
+ ref = config.ref;
651
+ warnIfStringRefCannotBeAutoConverted(config, self);
652
+ }
653
+ for (propName in config) {
654
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
655
+ props[propName] = config[propName];
656
+ }
657
+ }
658
+ if (type && type.defaultProps) {
659
+ var defaultProps = type.defaultProps;
660
+ for (propName in defaultProps) {
661
+ if (props[propName] === void 0) {
662
+ props[propName] = defaultProps[propName];
663
+ }
664
+ }
665
+ }
666
+ if (key || ref) {
667
+ var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
668
+ if (key) {
669
+ defineKeyPropWarningGetter(props, displayName);
670
+ }
671
+ if (ref) {
672
+ defineRefPropWarningGetter(props, displayName);
673
+ }
674
+ }
675
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
676
+ }
677
+ }
678
+ var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
679
+ var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
680
+ function setCurrentlyValidatingElement$1(element) {
681
+ {
682
+ if (element) {
683
+ var owner = element._owner;
684
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
685
+ ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
686
+ } else {
687
+ ReactDebugCurrentFrame$1.setExtraStackFrame(null);
688
+ }
689
+ }
690
+ }
691
+ var propTypesMisspellWarningShown;
692
+ {
693
+ propTypesMisspellWarningShown = false;
694
+ }
695
+ function isValidElement(object) {
696
+ {
697
+ return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
698
+ }
699
+ }
700
+ function getDeclarationErrorAddendum() {
701
+ {
702
+ if (ReactCurrentOwner$1.current) {
703
+ var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
704
+ if (name) {
705
+ return "\n\nCheck the render method of `" + name + "`.";
706
+ }
707
+ }
708
+ return "";
709
+ }
710
+ }
711
+ function getSourceInfoErrorAddendum(source) {
712
+ {
713
+ return "";
714
+ }
715
+ }
716
+ var ownerHasKeyUseWarning = {};
717
+ function getCurrentComponentErrorInfo(parentType) {
718
+ {
719
+ var info = getDeclarationErrorAddendum();
720
+ if (!info) {
721
+ var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
722
+ if (parentName) {
723
+ info = "\n\nCheck the top-level render call using <" + parentName + ">.";
724
+ }
725
+ }
726
+ return info;
727
+ }
728
+ }
729
+ function validateExplicitKey(element, parentType) {
730
+ {
731
+ if (!element._store || element._store.validated || element.key != null) {
732
+ return;
733
+ }
734
+ element._store.validated = true;
735
+ var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
736
+ if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
737
+ return;
738
+ }
739
+ ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
740
+ var childOwner = "";
741
+ if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
742
+ childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
743
+ }
744
+ setCurrentlyValidatingElement$1(element);
745
+ error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
746
+ setCurrentlyValidatingElement$1(null);
747
+ }
748
+ }
749
+ function validateChildKeys(node, parentType) {
750
+ {
751
+ if (typeof node !== "object") {
752
+ return;
753
+ }
754
+ if (isArray(node)) {
755
+ for (var i = 0; i < node.length; i++) {
756
+ var child = node[i];
757
+ if (isValidElement(child)) {
758
+ validateExplicitKey(child, parentType);
759
+ }
760
+ }
761
+ } else if (isValidElement(node)) {
762
+ if (node._store) {
763
+ node._store.validated = true;
764
+ }
765
+ } else if (node) {
766
+ var iteratorFn = getIteratorFn(node);
767
+ if (typeof iteratorFn === "function") {
768
+ if (iteratorFn !== node.entries) {
769
+ var iterator = iteratorFn.call(node);
770
+ var step;
771
+ while (!(step = iterator.next()).done) {
772
+ if (isValidElement(step.value)) {
773
+ validateExplicitKey(step.value, parentType);
774
+ }
775
+ }
776
+ }
777
+ }
778
+ }
779
+ }
780
+ }
781
+ function validatePropTypes(element) {
782
+ {
783
+ var type = element.type;
784
+ if (type === null || type === void 0 || typeof type === "string") {
785
+ return;
786
+ }
787
+ var propTypes;
788
+ if (typeof type === "function") {
789
+ propTypes = type.propTypes;
790
+ } else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
791
+ // Inner props are checked in the reconciler.
792
+ type.$$typeof === REACT_MEMO_TYPE)) {
793
+ propTypes = type.propTypes;
794
+ } else {
795
+ return;
796
+ }
797
+ if (propTypes) {
798
+ var name = getComponentNameFromType(type);
799
+ checkPropTypes(propTypes, element.props, "prop", name, element);
800
+ } else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
801
+ propTypesMisspellWarningShown = true;
802
+ var _name = getComponentNameFromType(type);
803
+ error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
804
+ }
805
+ if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
806
+ error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
807
+ }
808
+ }
809
+ }
810
+ function validateFragmentProps(fragment) {
811
+ {
812
+ var keys = Object.keys(fragment.props);
813
+ for (var i = 0; i < keys.length; i++) {
814
+ var key = keys[i];
815
+ if (key !== "children" && key !== "key") {
816
+ setCurrentlyValidatingElement$1(fragment);
817
+ error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
818
+ setCurrentlyValidatingElement$1(null);
819
+ break;
820
+ }
821
+ }
822
+ if (fragment.ref !== null) {
823
+ setCurrentlyValidatingElement$1(fragment);
824
+ error("Invalid attribute `ref` supplied to `React.Fragment`.");
825
+ setCurrentlyValidatingElement$1(null);
826
+ }
827
+ }
828
+ }
829
+ var didWarnAboutKeySpread = {};
830
+ function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
831
+ {
832
+ var validType = isValidElementType(type);
833
+ if (!validType) {
834
+ var info = "";
835
+ if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
836
+ info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
837
+ }
838
+ var sourceInfo = getSourceInfoErrorAddendum();
839
+ if (sourceInfo) {
840
+ info += sourceInfo;
841
+ } else {
842
+ info += getDeclarationErrorAddendum();
843
+ }
844
+ var typeString;
845
+ if (type === null) {
846
+ typeString = "null";
847
+ } else if (isArray(type)) {
848
+ typeString = "array";
849
+ } else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
850
+ typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
851
+ info = " Did you accidentally export a JSX literal instead of a component?";
852
+ } else {
853
+ typeString = typeof type;
854
+ }
855
+ error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
856
+ }
857
+ var element = jsxDEV(type, props, key, source, self);
858
+ if (element == null) {
859
+ return element;
860
+ }
861
+ if (validType) {
862
+ var children = props.children;
863
+ if (children !== void 0) {
864
+ if (isStaticChildren) {
865
+ if (isArray(children)) {
866
+ for (var i = 0; i < children.length; i++) {
867
+ validateChildKeys(children[i], type);
868
+ }
869
+ if (Object.freeze) {
870
+ Object.freeze(children);
871
+ }
872
+ } else {
873
+ error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
874
+ }
875
+ } else {
876
+ validateChildKeys(children, type);
877
+ }
878
+ }
879
+ }
880
+ {
881
+ if (hasOwnProperty.call(props, "key")) {
882
+ var componentName = getComponentNameFromType(type);
883
+ var keys = Object.keys(props).filter(function(k) {
884
+ return k !== "key";
885
+ });
886
+ var beforeExample = keys.length > 0 ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
887
+ if (!didWarnAboutKeySpread[componentName + beforeExample]) {
888
+ var afterExample = keys.length > 0 ? "{" + keys.join(": ..., ") + ": ...}" : "{}";
889
+ error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
890
+ didWarnAboutKeySpread[componentName + beforeExample] = true;
891
+ }
892
+ }
893
+ }
894
+ if (type === REACT_FRAGMENT_TYPE) {
895
+ validateFragmentProps(element);
896
+ } else {
897
+ validatePropTypes(element);
898
+ }
899
+ return element;
900
+ }
901
+ }
902
+ function jsxWithValidationStatic(type, props, key) {
903
+ {
904
+ return jsxWithValidation(type, props, key, true);
905
+ }
906
+ }
907
+ function jsxWithValidationDynamic(type, props, key) {
908
+ {
909
+ return jsxWithValidation(type, props, key, false);
910
+ }
911
+ }
912
+ var jsx = jsxWithValidationDynamic;
913
+ var jsxs = jsxWithValidationStatic;
914
+ reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
915
+ reactJsxRuntime_development.jsx = jsx;
916
+ reactJsxRuntime_development.jsxs = jsxs;
917
+ })();
918
+ }
919
+ return reactJsxRuntime_development;
920
+ }
921
+ var hasRequiredJsxRuntime;
922
+ function requireJsxRuntime() {
923
+ if (hasRequiredJsxRuntime) return jsxRuntime.exports;
924
+ hasRequiredJsxRuntime = 1;
925
+ if (process.env.NODE_ENV === "production") {
926
+ jsxRuntime.exports = requireReactJsxRuntime_production_min();
927
+ } else {
928
+ jsxRuntime.exports = requireReactJsxRuntime_development();
929
+ }
930
+ return jsxRuntime.exports;
931
+ }
932
+ var jsxRuntimeExports = requireJsxRuntime();
933
+ const BADGE_COLORS = {
934
+ purple: "bg-purple-500",
935
+ green: "bg-green-500",
936
+ blue: "bg-blue-500",
937
+ yellow: "bg-yellow-400",
938
+ red: "bg-red-500"
939
+ };
940
+ function SubscriptionTile({
941
+ id: _id,
942
+ title,
943
+ price,
944
+ periodLabel,
945
+ features,
946
+ isSelected,
947
+ onSelect,
948
+ isCurrentPlan = false,
949
+ topBadge,
950
+ discountBadge,
951
+ premiumCallout,
952
+ bottomNote,
953
+ introPriceNote,
954
+ isBestValue: _isBestValue = false,
955
+ ctaButton,
956
+ className = "",
957
+ children,
958
+ disabled = false,
959
+ enabled = true,
960
+ accessibilityLabel,
961
+ onTrack,
962
+ trackingLabel,
963
+ componentName = "SubscriptionTile",
964
+ hideSelectionIndicator = false
965
+ }) {
966
+ const isCtaMode = !!ctaButton;
967
+ const showIndicator = !hideSelectionIndicator && !isCurrentPlan && enabled;
968
+ const isInteractive = enabled && !isCurrentPlan && !disabled;
969
+ const containerClasses = [
970
+ "relative rounded-2xl p-6",
971
+ isSelected ? "bg-blue-600 border-2 border-blue-600" : isCurrentPlan ? "bg-gray-100 dark:bg-gray-800 border-2 border-blue-500 dark:border-blue-400" : !enabled ? "bg-gray-100 dark:bg-gray-800 border-2 border-gray-200 dark:border-gray-700 opacity-50" : "bg-gray-100 dark:bg-gray-800 border-2 border-gray-200 dark:border-gray-700",
972
+ className
973
+ ].filter(Boolean).join(" ");
974
+ const handlePress = () => {
975
+ if (isInteractive && !isCtaMode) {
976
+ onTrack == null ? void 0 : onTrack({ action: "select", trackingLabel, componentName });
977
+ onSelect();
978
+ }
979
+ };
980
+ const handleCtaPress = () => {
981
+ var _a;
982
+ onTrack == null ? void 0 : onTrack({ action: "cta_click", trackingLabel, componentName });
983
+ (_a = ctaButton == null ? void 0 : ctaButton.onPress) == null ? void 0 : _a.call(ctaButton);
984
+ };
985
+ const defaultLabel = `${title} - ${price}${periodLabel || ""}`;
986
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
987
+ reactNative.Pressable,
988
+ {
989
+ onPress: handlePress,
990
+ disabled: !isInteractive || isCtaMode,
991
+ accessibilityRole: isCtaMode ? "summary" : "radio",
992
+ accessibilityState: {
993
+ checked: isCtaMode ? void 0 : isSelected,
994
+ disabled: !isInteractive
995
+ },
996
+ accessibilityLabel: accessibilityLabel || defaultLabel,
997
+ className: containerClasses,
998
+ children: [
999
+ topBadge && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "absolute top-0 left-1/2 -translate-x-1/2 -translate-y-1/2 z-10", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1000
+ reactNative.View,
1001
+ {
1002
+ className: [
1003
+ BADGE_COLORS[topBadge.color],
1004
+ "px-4 py-1.5 rounded-full"
1005
+ ].join(" "),
1006
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-white text-sm font-semibold", children: topBadge.text })
1007
+ }
1008
+ ) }),
1009
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "flex-1", children: [
1010
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
1011
+ reactNative.View,
1012
+ {
1013
+ className: ["items-center mb-6", topBadge ? "mt-2" : ""].filter(Boolean).join(" "),
1014
+ children: [
1015
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1016
+ reactNative.Text,
1017
+ {
1018
+ className: [
1019
+ "text-xl font-bold mb-2",
1020
+ isSelected ? "text-white" : "text-gray-900 dark:text-gray-100"
1021
+ ].join(" "),
1022
+ children: title
1023
+ }
1024
+ ),
1025
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "flex-row items-baseline mb-3", children: [
1026
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1027
+ reactNative.Text,
1028
+ {
1029
+ className: [
1030
+ "text-4xl font-bold",
1031
+ isSelected ? "text-white" : "text-gray-900 dark:text-gray-100"
1032
+ ].join(" "),
1033
+ children: price
1034
+ }
1035
+ ),
1036
+ periodLabel && /* @__PURE__ */ jsxRuntimeExports.jsx(
1037
+ reactNative.Text,
1038
+ {
1039
+ className: [
1040
+ "text-lg",
1041
+ isSelected ? "text-blue-100" : "text-gray-500 dark:text-gray-400"
1042
+ ].join(" "),
1043
+ children: periodLabel
1044
+ }
1045
+ )
1046
+ ] }),
1047
+ discountBadge && /* @__PURE__ */ jsxRuntimeExports.jsx(
1048
+ reactNative.View,
1049
+ {
1050
+ className: [
1051
+ "px-2 py-1 rounded-full",
1052
+ isSelected ? "bg-blue-500" : "bg-green-100 dark:bg-green-900/50"
1053
+ ].join(" "),
1054
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1055
+ reactNative.Text,
1056
+ {
1057
+ className: [
1058
+ "text-sm font-semibold",
1059
+ isSelected ? "text-white" : "text-green-700 dark:text-green-300"
1060
+ ].join(" "),
1061
+ children: discountBadge.text
1062
+ }
1063
+ )
1064
+ }
1065
+ )
1066
+ ]
1067
+ }
1068
+ ),
1069
+ children,
1070
+ features.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "gap-3 mb-6", children: features.map((feature, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "flex-row items-start", children: [
1071
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1072
+ reactNative.Text,
1073
+ {
1074
+ className: [
1075
+ "mr-3",
1076
+ isSelected ? "text-blue-200" : "text-green-500"
1077
+ ].join(" "),
1078
+ children: "✓"
1079
+ }
1080
+ ),
1081
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1082
+ reactNative.Text,
1083
+ {
1084
+ className: [
1085
+ "text-sm flex-1",
1086
+ isSelected ? "text-white" : "text-gray-700 dark:text-gray-300"
1087
+ ].join(" "),
1088
+ children: feature.replace(/^✓\s*/, "")
1089
+ }
1090
+ )
1091
+ ] }, index)) }),
1092
+ premiumCallout && /* @__PURE__ */ jsxRuntimeExports.jsxs(
1093
+ reactNative.View,
1094
+ {
1095
+ className: [
1096
+ "rounded-lg p-4 mb-4",
1097
+ isSelected ? "bg-blue-500/30" : "bg-purple-50 dark:bg-purple-900/20"
1098
+ ].join(" "),
1099
+ children: [
1100
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1101
+ reactNative.Text,
1102
+ {
1103
+ className: [
1104
+ "font-semibold text-sm mb-2",
1105
+ isSelected ? "text-white" : "text-purple-600 dark:text-purple-400"
1106
+ ].join(" "),
1107
+ children: premiumCallout.title
1108
+ }
1109
+ ),
1110
+ premiumCallout.features.map((feat, idx) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
1111
+ reactNative.Text,
1112
+ {
1113
+ className: [
1114
+ "text-xs",
1115
+ isSelected ? "text-blue-100" : "text-gray-600 dark:text-gray-400"
1116
+ ].join(" "),
1117
+ children: [
1118
+ "• ",
1119
+ feat
1120
+ ]
1121
+ },
1122
+ idx
1123
+ ))
1124
+ ]
1125
+ }
1126
+ ),
1127
+ bottomNote && /* @__PURE__ */ jsxRuntimeExports.jsx(
1128
+ reactNative.Text,
1129
+ {
1130
+ className: [
1131
+ "text-center text-sm font-medium mb-4",
1132
+ isSelected ? "text-blue-100" : "text-blue-600 dark:text-blue-400"
1133
+ ].join(" "),
1134
+ children: bottomNote
1135
+ }
1136
+ ),
1137
+ introPriceNote && /* @__PURE__ */ jsxRuntimeExports.jsx(
1138
+ reactNative.View,
1139
+ {
1140
+ className: [
1141
+ "p-3 rounded-lg",
1142
+ isSelected ? "bg-blue-500/30" : "bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800"
1143
+ ].join(" "),
1144
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1145
+ reactNative.Text,
1146
+ {
1147
+ className: [
1148
+ "text-sm font-semibold text-center",
1149
+ isSelected ? "text-white" : "text-yellow-700 dark:text-yellow-300"
1150
+ ].join(" "),
1151
+ children: introPriceNote
1152
+ }
1153
+ )
1154
+ }
1155
+ )
1156
+ ] }),
1157
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "h-14 justify-end items-center", children: [
1158
+ showIndicator && isCtaMode && /* @__PURE__ */ jsxRuntimeExports.jsx(
1159
+ reactNative.Pressable,
1160
+ {
1161
+ onPress: handleCtaPress,
1162
+ disabled,
1163
+ className: [
1164
+ "w-full py-3 rounded-lg items-center",
1165
+ isSelected ? "bg-white" : "bg-blue-600",
1166
+ disabled ? "opacity-50" : ""
1167
+ ].filter(Boolean).join(" "),
1168
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1169
+ reactNative.Text,
1170
+ {
1171
+ className: [
1172
+ "font-semibold",
1173
+ isSelected ? "text-blue-600" : "text-white"
1174
+ ].join(" "),
1175
+ children: ctaButton.label
1176
+ }
1177
+ )
1178
+ }
1179
+ ),
1180
+ showIndicator && !isCtaMode && /* @__PURE__ */ jsxRuntimeExports.jsx(
1181
+ reactNative.View,
1182
+ {
1183
+ className: [
1184
+ "w-5 h-5 rounded-full border-2 items-center justify-center",
1185
+ isSelected ? "border-white bg-white" : "border-gray-300 dark:border-gray-600"
1186
+ ].join(" "),
1187
+ children: isSelected && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "w-2 h-2 rounded-full bg-blue-600" })
1188
+ }
1189
+ )
1190
+ ] })
1191
+ ]
1192
+ }
1193
+ );
1194
+ }
1195
+ function SubscriptionLayout({
1196
+ title,
1197
+ children,
1198
+ error,
1199
+ variant = "selection",
1200
+ currentStatus,
1201
+ primaryAction,
1202
+ secondaryAction,
1203
+ className = "",
1204
+ headerContent,
1205
+ aboveProducts,
1206
+ footerContent,
1207
+ currentStatusLabel = "Current Status",
1208
+ freeTileConfig,
1209
+ onTrack,
1210
+ trackingLabel,
1211
+ componentName = "SubscriptionLayout"
1212
+ }) {
1213
+ var _a, _b, _c, _d;
1214
+ const showActionButtons = variant === "selection" && primaryAction;
1215
+ const shouldShowFreeTile = variant === "cta" && freeTileConfig;
1216
+ const handlePrimaryPress = () => {
1217
+ onTrack == null ? void 0 : onTrack({ action: "primary_action", trackingLabel, componentName });
1218
+ primaryAction == null ? void 0 : primaryAction.onPress();
1219
+ };
1220
+ const handleSecondaryPress = () => {
1221
+ onTrack == null ? void 0 : onTrack({ action: "secondary_action", trackingLabel, componentName });
1222
+ secondaryAction == null ? void 0 : secondaryAction.onPress();
1223
+ };
1224
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
1225
+ reactNative.ScrollView,
1226
+ {
1227
+ className: "flex-1",
1228
+ contentContainerClassName: "p-4",
1229
+ showsVerticalScrollIndicator: false,
1230
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className, children: [
1231
+ headerContent,
1232
+ currentStatus && /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "mb-6", children: [
1233
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-2xl font-bold text-gray-900 dark:text-gray-100 mb-4", children: currentStatusLabel }),
1234
+ currentStatus.isActive ? /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-4", children: [
1235
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "flex-row items-center mb-2", children: [
1236
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "w-3 h-3 bg-green-500 rounded-full mr-3" }),
1237
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "font-semibold text-green-800 dark:text-green-300", children: ((_a = currentStatus.activeContent) == null ? void 0 : _a.title) || "Active Subscription" })
1238
+ ] }),
1239
+ ((_b = currentStatus.activeContent) == null ? void 0 : _b.fields) && currentStatus.activeContent.fields.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "mt-4 gap-4", children: currentStatus.activeContent.fields.map(
1240
+ (field, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { children: [
1241
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-sm text-green-600 dark:text-green-400", children: field.label }),
1242
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "font-semibold text-green-800 dark:text-green-300", children: field.value })
1243
+ ] }, index)
1244
+ ) })
1245
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4", children: [
1246
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "flex-row items-center mb-2", children: [
1247
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "w-3 h-3 bg-yellow-500 rounded-full mr-3" }),
1248
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "font-semibold text-yellow-800 dark:text-yellow-300", children: ((_c = currentStatus.inactiveContent) == null ? void 0 : _c.title) || "No Active Subscription" })
1249
+ ] }),
1250
+ ((_d = currentStatus.inactiveContent) == null ? void 0 : _d.message) && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-yellow-700 dark:text-yellow-400", children: currentStatus.inactiveContent.message })
1251
+ ] })
1252
+ ] }),
1253
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-2xl font-bold text-gray-900 dark:text-gray-100 mb-4", children: title }),
1254
+ aboveProducts,
1255
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "gap-4", children: [
1256
+ shouldShowFreeTile && /* @__PURE__ */ jsxRuntimeExports.jsx(
1257
+ SubscriptionTile,
1258
+ {
1259
+ id: "free",
1260
+ title: freeTileConfig.title,
1261
+ price: freeTileConfig.price,
1262
+ periodLabel: freeTileConfig.periodLabel,
1263
+ features: freeTileConfig.features,
1264
+ isSelected: false,
1265
+ onSelect: () => {
1266
+ },
1267
+ topBadge: freeTileConfig.topBadge,
1268
+ ctaButton: freeTileConfig.ctaButton
1269
+ }
1270
+ ),
1271
+ children
1272
+ ] }),
1273
+ footerContent,
1274
+ error && /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 mt-6", children: /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-red-600 dark:text-red-400", children: error }) }),
1275
+ showActionButtons && /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "gap-3 mt-6", children: [
1276
+ secondaryAction && /* @__PURE__ */ jsxRuntimeExports.jsx(
1277
+ reactNative.Pressable,
1278
+ {
1279
+ onPress: handleSecondaryPress,
1280
+ disabled: secondaryAction.disabled || secondaryAction.loading,
1281
+ className: [
1282
+ "py-3 rounded-lg border border-gray-300 dark:border-gray-600 items-center",
1283
+ secondaryAction.disabled || secondaryAction.loading ? "opacity-50" : ""
1284
+ ].filter(Boolean).join(" "),
1285
+ children: secondaryAction.loading ? /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.ActivityIndicator, { size: "small" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "font-semibold text-gray-900 dark:text-gray-100", children: secondaryAction.label })
1286
+ }
1287
+ ),
1288
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1289
+ reactNative.Pressable,
1290
+ {
1291
+ onPress: handlePrimaryPress,
1292
+ disabled: primaryAction.disabled || primaryAction.loading,
1293
+ className: [
1294
+ "py-3 rounded-lg bg-blue-600 items-center",
1295
+ primaryAction.disabled || primaryAction.loading ? "opacity-50" : ""
1296
+ ].filter(Boolean).join(" "),
1297
+ children: primaryAction.loading ? /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.ActivityIndicator, { size: "small", color: "white" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "font-semibold text-white", children: primaryAction.label })
1298
+ }
1299
+ )
1300
+ ] })
1301
+ ] })
1302
+ }
1303
+ );
1304
+ }
1305
+ function SubscriptionDivider({
1306
+ label,
1307
+ className = ""
1308
+ }) {
1309
+ if (label) {
1310
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "flex-row items-center gap-4 my-4 " + className, children: [
1311
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "flex-1 h-px bg-gray-200 dark:bg-gray-700" }),
1312
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-sm text-gray-500 dark:text-gray-400", children: label }),
1313
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "flex-1 h-px bg-gray-200 dark:bg-gray-700" })
1314
+ ] });
1315
+ }
1316
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.View, { className: "h-px bg-gray-200 dark:bg-gray-700 my-4 " + className });
1317
+ }
1318
+ function SubscriptionFooter({
1319
+ termsText = "Terms of Service",
1320
+ privacyText = "Privacy Policy",
1321
+ restoreText = "Restore Purchases",
1322
+ onRestore,
1323
+ onTermsPress,
1324
+ onPrivacyPress,
1325
+ className = ""
1326
+ }) {
1327
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "items-center gap-3 " + className, children: [
1328
+ onRestore && /* @__PURE__ */ jsxRuntimeExports.jsx(
1329
+ reactNative.Text,
1330
+ {
1331
+ className: "text-sm text-blue-500 dark:text-blue-400 underline",
1332
+ onPress: onRestore,
1333
+ accessibilityRole: "button",
1334
+ children: restoreText
1335
+ }
1336
+ ),
1337
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(reactNative.View, { className: "flex-row items-center gap-4", children: [
1338
+ onTermsPress && /* @__PURE__ */ jsxRuntimeExports.jsx(
1339
+ reactNative.Text,
1340
+ {
1341
+ className: "text-xs text-gray-500 dark:text-gray-400 underline",
1342
+ onPress: onTermsPress,
1343
+ accessibilityRole: "link",
1344
+ children: termsText
1345
+ }
1346
+ ),
1347
+ onPrivacyPress && /* @__PURE__ */ jsxRuntimeExports.jsx(
1348
+ reactNative.Text,
1349
+ {
1350
+ className: "text-xs text-gray-500 dark:text-gray-400 underline",
1351
+ onPress: onPrivacyPress,
1352
+ accessibilityRole: "link",
1353
+ children: privacyText
1354
+ }
1355
+ )
1356
+ ] }),
1357
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: "text-xs text-gray-400 dark:text-gray-500 text-center px-4", children: "Subscriptions will automatically renew unless canceled at least 24 hours before the end of the current period." })
1358
+ ] });
1359
+ }
1360
+ const sizeClasses = {
1361
+ sm: {
1362
+ container: "p-1 rounded-lg",
1363
+ segment: "px-3 py-1.5 rounded-md",
1364
+ text: "text-xs",
1365
+ badge: "text-xs px-1.5 py-0.5"
1366
+ },
1367
+ md: {
1368
+ container: "p-1 rounded-lg",
1369
+ segment: "px-4 py-2 rounded-md",
1370
+ text: "text-sm",
1371
+ badge: "text-xs px-2 py-0.5"
1372
+ },
1373
+ lg: {
1374
+ container: "p-1 rounded-lg",
1375
+ segment: "px-6 py-3 rounded-lg",
1376
+ text: "text-base",
1377
+ badge: "text-sm px-2 py-1"
1378
+ }
1379
+ };
1380
+ function SegmentedControl({
1381
+ options,
1382
+ value,
1383
+ onChange,
1384
+ className = "",
1385
+ disabled = false,
1386
+ size = "md",
1387
+ fullWidth = true,
1388
+ accessibilityLabel
1389
+ }) {
1390
+ const sizes = sizeClasses[size];
1391
+ const containerClasses = [
1392
+ "flex-row bg-gray-100 dark:bg-gray-800",
1393
+ sizes.container,
1394
+ fullWidth ? "w-full" : "",
1395
+ disabled ? "opacity-50" : "",
1396
+ className
1397
+ ].filter(Boolean).join(" ");
1398
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
1399
+ reactNative.View,
1400
+ {
1401
+ className: containerClasses,
1402
+ accessibilityRole: "tablist",
1403
+ accessibilityLabel,
1404
+ children: options.map((option) => {
1405
+ const isSelected = value === option.value;
1406
+ const isDisabled = disabled || option.disabled;
1407
+ const segmentClasses = [
1408
+ sizes.segment,
1409
+ "flex-1 items-center justify-center flex-row gap-2",
1410
+ isSelected ? "bg-white dark:bg-gray-700 shadow-sm" : "bg-transparent",
1411
+ isDisabled ? "opacity-50" : ""
1412
+ ].filter(Boolean).join(" ");
1413
+ const textClasses = [
1414
+ sizes.text,
1415
+ "font-medium",
1416
+ isSelected ? "text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"
1417
+ ].join(" ");
1418
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
1419
+ reactNative.Pressable,
1420
+ {
1421
+ onPress: () => !isDisabled && onChange(option.value),
1422
+ disabled: isDisabled,
1423
+ accessibilityRole: "tab",
1424
+ accessibilityState: {
1425
+ selected: isSelected,
1426
+ disabled: isDisabled
1427
+ },
1428
+ accessibilityLabel: option.label + (option.badge ? ", " + option.badge : ""),
1429
+ className: segmentClasses,
1430
+ children: [
1431
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactNative.Text, { className: textClasses, children: option.label }),
1432
+ option.badge && /* @__PURE__ */ jsxRuntimeExports.jsx(
1433
+ reactNative.View,
1434
+ {
1435
+ className: [
1436
+ sizes.badge,
1437
+ "rounded-full",
1438
+ isSelected ? "bg-green-100 dark:bg-green-900" : "bg-gray-200 dark:bg-gray-700"
1439
+ ].join(" "),
1440
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1441
+ reactNative.Text,
1442
+ {
1443
+ className: [
1444
+ "text-xs font-semibold",
1445
+ isSelected ? "text-green-700 dark:text-green-300" : "text-gray-600 dark:text-gray-400"
1446
+ ].join(" "),
1447
+ children: option.badge
1448
+ }
1449
+ )
1450
+ }
1451
+ )
1452
+ ]
1453
+ },
1454
+ option.value
1455
+ );
1456
+ })
1457
+ }
1458
+ );
1459
+ }
1460
+ function PeriodSelector({
1461
+ period,
1462
+ onPeriodChange,
1463
+ monthlyLabel = "Monthly",
1464
+ yearlyLabel = "Yearly",
1465
+ yearlySavings,
1466
+ size = "md",
1467
+ className = "",
1468
+ disabled = false
1469
+ }) {
1470
+ const options = [
1471
+ { value: "monthly", label: monthlyLabel },
1472
+ { value: "yearly", label: yearlyLabel, badge: yearlySavings }
1473
+ ];
1474
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
1475
+ SegmentedControl,
1476
+ {
1477
+ options,
1478
+ value: period,
1479
+ onChange: onPeriodChange,
1480
+ size,
1481
+ className,
1482
+ disabled,
1483
+ accessibilityLabel: "Billing period selector"
1484
+ }
1485
+ );
1486
+ }
1487
+ const SubscriptionContext = require$$0.createContext(
1488
+ void 0
1489
+ );
1490
+ function SubscriptionProvider({
1491
+ apiKey,
1492
+ userEmail,
1493
+ onError,
1494
+ onPurchaseSuccess,
1495
+ children
1496
+ }) {
1497
+ const [products, setProducts] = require$$0.useState([]);
1498
+ const [currentSubscription, setCurrentSubscription] = require$$0.useState(null);
1499
+ const [isLoading, setIsLoading] = require$$0.useState(false);
1500
+ const [error, setError] = require$$0.useState(null);
1501
+ const [isInitialized, setIsInitialized] = require$$0.useState(false);
1502
+ const isDevelopment = !apiKey || apiKey === "your_revenuecat_api_key_here";
1503
+ const initialize = require$$0.useCallback(
1504
+ async (userId, email) => {
1505
+ if (isInitialized) return;
1506
+ try {
1507
+ setIsLoading(true);
1508
+ setError(null);
1509
+ if (isDevelopment) {
1510
+ console.warn(
1511
+ "[SubscriptionProvider] RevenueCat API key not configured"
1512
+ );
1513
+ setProducts([]);
1514
+ setCurrentSubscription(null);
1515
+ } else {
1516
+ void userId;
1517
+ void email;
1518
+ void userEmail;
1519
+ }
1520
+ setIsInitialized(true);
1521
+ } catch (err) {
1522
+ const errorMsg = err instanceof Error ? err.message : "Failed to initialize";
1523
+ setError(errorMsg);
1524
+ setCurrentSubscription(null);
1525
+ setProducts([]);
1526
+ onError == null ? void 0 : onError(err instanceof Error ? err : new Error(errorMsg));
1527
+ } finally {
1528
+ setIsLoading(false);
1529
+ }
1530
+ },
1531
+ [isInitialized, isDevelopment, userEmail, onError]
1532
+ );
1533
+ const purchase = require$$0.useCallback(
1534
+ async (productIdentifier, _subscriptionUserId) => {
1535
+ try {
1536
+ setIsLoading(true);
1537
+ setError(null);
1538
+ if (isDevelopment) {
1539
+ await new Promise((resolve) => setTimeout(resolve, 2e3));
1540
+ const mockSubscription = {
1541
+ isActive: true,
1542
+ expirationDate: new Date(Date.now() + 365 * 24 * 60 * 60 * 1e3),
1543
+ purchaseDate: /* @__PURE__ */ new Date(),
1544
+ productIdentifier,
1545
+ willRenew: true
1546
+ };
1547
+ setCurrentSubscription(mockSubscription);
1548
+ onPurchaseSuccess == null ? void 0 : onPurchaseSuccess(productIdentifier);
1549
+ return true;
1550
+ }
1551
+ return false;
1552
+ } catch (err) {
1553
+ const errorMsg = err instanceof Error ? err.message : "Purchase failed";
1554
+ setError(errorMsg);
1555
+ onError == null ? void 0 : onError(err instanceof Error ? err : new Error(errorMsg));
1556
+ return false;
1557
+ } finally {
1558
+ setIsLoading(false);
1559
+ }
1560
+ },
1561
+ [isDevelopment, onPurchaseSuccess, onError]
1562
+ );
1563
+ const restore = require$$0.useCallback(
1564
+ async (_subscriptionUserId) => {
1565
+ try {
1566
+ setIsLoading(true);
1567
+ setError(null);
1568
+ if (isDevelopment) {
1569
+ await new Promise((resolve) => setTimeout(resolve, 1e3));
1570
+ setError("No previous purchases found");
1571
+ return false;
1572
+ }
1573
+ return false;
1574
+ } catch (err) {
1575
+ const errorMsg = err instanceof Error ? err.message : "Restore failed";
1576
+ setError(errorMsg);
1577
+ onError == null ? void 0 : onError(err instanceof Error ? err : new Error(errorMsg));
1578
+ return false;
1579
+ } finally {
1580
+ setIsLoading(false);
1581
+ }
1582
+ },
1583
+ [isDevelopment, onError]
1584
+ );
1585
+ const refresh = require$$0.useCallback(async () => {
1586
+ if (isDevelopment) return;
1587
+ try {
1588
+ setError(null);
1589
+ } catch (err) {
1590
+ const errorMsg = err instanceof Error ? err.message : "Refresh failed";
1591
+ setError(errorMsg);
1592
+ onError == null ? void 0 : onError(err instanceof Error ? err : new Error(errorMsg));
1593
+ }
1594
+ }, [isDevelopment, onError]);
1595
+ const clearError = require$$0.useCallback(() => {
1596
+ setError(null);
1597
+ }, []);
1598
+ const value = {
1599
+ products,
1600
+ currentSubscription,
1601
+ isLoading,
1602
+ error,
1603
+ initialize,
1604
+ purchase,
1605
+ restore,
1606
+ refresh,
1607
+ clearError
1608
+ };
1609
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(SubscriptionContext.Provider, { value, children });
1610
+ }
1611
+ function useSubscriptionContext() {
1612
+ const context = require$$0.useContext(SubscriptionContext);
1613
+ if (!context) {
1614
+ throw new Error(
1615
+ "useSubscriptionContext must be used within a SubscriptionProvider"
1616
+ );
1617
+ }
1618
+ return context;
1619
+ }
1620
+ exports.PeriodSelector = PeriodSelector;
1621
+ exports.SegmentedControl = SegmentedControl;
1622
+ exports.SubscriptionContext = SubscriptionContext;
1623
+ exports.SubscriptionDivider = SubscriptionDivider;
1624
+ exports.SubscriptionFooter = SubscriptionFooter;
1625
+ exports.SubscriptionLayout = SubscriptionLayout;
1626
+ exports.SubscriptionProvider = SubscriptionProvider;
1627
+ exports.SubscriptionTile = SubscriptionTile;
1628
+ exports.useSubscriptionContext = useSubscriptionContext;
1629
+ //# sourceMappingURL=index.js.map