@unleash/unleash-react-native-sdk 1.0.0-alpha.2 → 1.0.0-alpha.3

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.
@@ -1,420 +1,71 @@
1
- import Q from "react-native";
2
- import { UnleashClient as L } from "unleash-proxy-client";
3
- import { InMemoryStorageProvider as Ne, LocalStorageProvider as $e } from "unleash-proxy-client";
4
- import m, { useState as S, useRef as M, useEffect as R, useMemo as H, useContext as Y } from "react";
5
- var d = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
6
- function W(e) {
7
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
8
- }
9
- var f = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 62, 0, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 63, 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51], X = function(t, n) {
10
- for (var r = t.length, o = t[r - 2] === "=" ? 2 : t[r - 1] === "=" ? 1 : 0, s, i = 0, l = r - o & 4294967292, a = 0; a < l; a += 4)
11
- s = f[t.charCodeAt(a)] << 18 | f[t.charCodeAt(a + 1)] << 12 | f[t.charCodeAt(a + 2)] << 6 | f[t.charCodeAt(a + 3)], n[i++] = s >> 16 & 255, n[i++] = s >> 8 & 255, n[i++] = s & 255;
12
- o === 1 && (s = f[t.charCodeAt(a)] << 10 | f[t.charCodeAt(a + 1)] << 4 | f[t.charCodeAt(a + 2)] >> 2, n[i++] = s >> 8 & 255, n[i++] = s & 255), o === 2 && (s = f[t.charCodeAt(a)] << 2 | f[t.charCodeAt(a + 1)] >> 4, n[i++] = s & 255);
13
- };
14
- const Z = X, { TurboModuleRegistry: k } = Q;
15
- class ee extends Error {
16
- }
17
- class te extends Error {
18
- }
19
- let T = !1;
20
- function ne(e) {
21
- T || (console.warn("Using an insecure random number generator, this should only happen when running in a debugger without support for crypto.getRandomValues"), T = !0);
22
- for (let t = 0, n; t < e.length; t++)
23
- t & 3 || (n = Math.random() * 4294967296), e[t] = n >>> ((t & 3) << 3) & 255;
24
- return e;
25
- }
26
- let A = null;
27
- function re(e) {
28
- return A == null && (A = k.getEnforcing("RNGetRandomValues")), A.getRandomBase64(e);
29
- }
30
- function oe(e) {
31
- var t, n, r;
32
- if (!(e instanceof Int8Array || e instanceof Uint8Array || e instanceof Int16Array || e instanceof Uint16Array || e instanceof Int32Array || e instanceof Uint32Array || e instanceof Uint8ClampedArray))
33
- throw new ee("Expected an integer array");
34
- if (e.byteLength > 65536)
35
- throw new te("Can only request a maximum of 65536 bytes");
36
- return (r = (n = (t = d.expo) == null ? void 0 : t.modules) == null ? void 0 : n.ExpoCrypto) != null && r.getRandomValues ? (d.expo.modules.ExpoCrypto.getRandomValues(e), e) : se() ? ne(e) : (Z(re(e.byteLength), new Uint8Array(e.buffer, e.byteOffset, e.byteLength)), e);
37
- }
38
- function se() {
39
- return "RN$Bridgeless" in d && RN$Bridgeless === !0 ? !1 : __DEV__ && typeof d.nativeCallSyncHook > "u";
40
- }
41
- typeof d.crypto != "object" && (d.crypto = {});
42
- typeof d.crypto.getRandomValues != "function" && (d.crypto.getRandomValues = oe);
43
- const D = m.createContext(null), ae = {
44
- bootstrap: [],
45
- disableRefresh: !0,
46
- disableMetrics: !0,
47
- url: "http://localhost",
48
- appName: "offline",
49
- clientKey: "not-used"
50
- }, ie = "startTransition", le = m[ie] || ((e) => e()), ue = ({
51
- config: e,
52
- children: t,
53
- unleashClient: n,
54
- startClient: r = !0,
55
- stopClient: o = !0,
56
- startTransition: s = le
57
- }) => {
58
- var i, l, a;
59
- const v = e || ae, u = m.useRef(
60
- n || new L(v)
61
- ), [I, j] = m.useState(
62
- !!(n ? e != null && e.bootstrap && (e == null ? void 0 : e.bootstrapOverride) !== !1 || (i = n.isReady) != null && i.call(n) : v.bootstrap && v.bootstrapOverride !== !1)
63
- ), [V, E] = S(((a = (l = u.current).getError) == null ? void 0 : a.call(l)) || null);
64
- R(() => {
65
- !v && !n && console.error(
66
- `You must provide either a config or an unleash client to the flag provider.
67
- If you are initializing the client in useEffect, you can avoid this warning
68
- by checking if the client exists before rendering.`
69
- );
70
- const c = ($) => {
71
- s(() => {
72
- E((z) => z || $);
73
- });
74
- }, U = ($) => {
75
- s(() => {
76
- E(null);
77
- });
78
- };
79
- let P = null;
80
- const N = () => {
81
- P = setTimeout(() => {
82
- s(() => {
83
- j(!0);
84
- });
85
- }, 0);
86
- };
87
- return u.current.on("ready", N), u.current.on("error", c), u.current.on("recovered", U), r && (u.current.stop(), u.current.start()), function() {
88
- u.current && (u.current.off("error", c), u.current.off("ready", N), u.current.off("recovered", U), o && u.current.stop()), P && clearTimeout(P);
89
- };
90
- }, []);
91
- const q = H(
92
- () => ({
93
- on: (...c) => u.current.on(...c),
94
- off: (...c) => u.current.off(...c),
95
- isEnabled: (...c) => u.current.isEnabled(...c),
96
- updateContext: async (...c) => await u.current.updateContext(...c),
97
- getVariant: (...c) => u.current.getVariant(...c),
98
- client: u.current,
99
- flagsReady: I,
100
- flagsError: V,
101
- setFlagsReady: j,
102
- setFlagsError: E
103
- }),
104
- [I, V]
105
- );
106
- return /* @__PURE__ */ m.createElement(D.Provider, { value: q }, t);
107
- }, J = {
108
- on: (e, t, n) => (console.error("on() must be used within a FlagProvider"), C),
109
- off: (e, t) => (console.error("off() must be used within a FlagProvider"), C),
110
- updateContext: async () => {
111
- console.error("updateContext() must be used within a FlagProvider");
112
- },
113
- isEnabled: () => (console.error("isEnabled() must be used within a FlagProvider"), !1),
114
- getVariant: () => (console.error("getVariant() must be used within a FlagProvider"), { name: "disabled", enabled: !1 })
115
- }, C = {
116
- ...J,
117
- toggles: [],
118
- impressionDataAll: {},
119
- context: {},
120
- storage: {},
121
- start: () => {
122
- },
123
- stop: () => {
124
- },
125
- isReady: () => !1,
126
- getError: () => null,
127
- getAllToggles: () => []
128
- }, ce = {
129
- ...J,
130
- client: C,
131
- flagsReady: !1,
132
- setFlagsReady: () => {
133
- console.error("setFlagsReady() must be used within a FlagProvider");
134
- },
135
- flagsError: null,
136
- setFlagsError: () => {
137
- console.error("setFlagsError() must be used within a FlagProvider");
138
- }
139
- };
140
- function b() {
141
- return Y(D) || (console.error("useFlagContext() must be used within a FlagProvider"), ce);
142
- }
143
- const Ae = (e) => {
144
- const { isEnabled: t, client: n } = b(), [r, o] = S(!!t(e)), s = M();
145
- return s.current = r, R(() => {
146
- if (!n)
147
- return;
148
- const i = () => {
149
- const a = t(e);
150
- a !== s.current && (s.current = a, o(!!a));
151
- }, l = () => {
152
- const a = t(e);
153
- s.current = a, o(a);
154
- };
155
- return n.on("update", i), n.on("ready", l), () => {
156
- n.off("update", i), n.off("ready", l);
157
- };
158
- }, [n]), r;
159
- }, Ce = () => {
160
- const { flagsReady: e, flagsError: t } = b();
161
- return { flagsReady: e, flagsError: t };
162
- }, fe = (e, t) => {
163
- var n, r, o, s;
164
- return !(e.name === (t == null ? void 0 : t.name) && e.enabled === (t == null ? void 0 : t.enabled) && e.feature_enabled === (t == null ? void 0 : t.feature_enabled) && ((n = e.payload) == null ? void 0 : n.type) === ((r = t == null ? void 0 : t.payload) == null ? void 0 : r.type) && ((o = e.payload) == null ? void 0 : o.value) === ((s = t == null ? void 0 : t.payload) == null ? void 0 : s.value));
165
- }, Fe = (e) => {
166
- const { getVariant: t, client: n } = b(), [r, o] = S(t(e)), s = M({
167
- name: r.name,
168
- enabled: r.enabled
169
- });
170
- return s.current = r, R(() => {
171
- if (!n)
172
- return;
173
- const i = () => {
174
- const a = t(e);
175
- fe(s.current, a) && (o(a), s.current = a);
176
- }, l = () => {
177
- const a = t(e);
178
- s.current.name = a == null ? void 0 : a.name, s.current.enabled = a == null ? void 0 : a.enabled, o(a);
179
- };
180
- return n.on("update", i), n.on("ready", l), () => {
181
- n.off("update", i), n.off("ready", l);
182
- };
183
- }, [n]), r || {};
184
- }, Se = () => {
185
- const { updateContext: e } = b();
186
- return e;
187
- }, Re = () => {
188
- const { client: e } = b();
189
- return e;
190
- };
191
- var de = (e) => {
192
- if (Object.prototype.toString.call(e) !== "[object Object]")
193
- return !1;
194
- const t = Object.getPrototypeOf(e);
195
- return t === null || t === Object.prototype;
196
- };
197
- const O = de, { hasOwnProperty: K } = Object.prototype, { propertyIsEnumerable: pe } = Object, h = (e, t, n) => Object.defineProperty(e, t, {
198
- value: n,
199
- writable: !0,
200
- enumerable: !0,
201
- configurable: !0
202
- }), ge = d, _ = {
203
- concatArrays: !1,
204
- ignoreUndefined: !1
205
- }, x = (e) => {
206
- const t = [];
207
- for (const n in e)
208
- K.call(e, n) && t.push(n);
209
- if (Object.getOwnPropertySymbols) {
210
- const n = Object.getOwnPropertySymbols(e);
211
- for (const r of n)
212
- pe.call(e, r) && t.push(r);
213
- }
214
- return t;
215
- };
216
- function y(e) {
217
- return Array.isArray(e) ? me(e) : O(e) ? he(e) : e;
218
- }
219
- function me(e) {
220
- const t = e.slice(0, 0);
221
- return x(e).forEach((n) => {
222
- h(t, n, y(e[n]));
223
- }), t;
224
- }
225
- function he(e) {
226
- const t = Object.getPrototypeOf(e) === null ? /* @__PURE__ */ Object.create(null) : {};
227
- return x(e).forEach((n) => {
228
- h(t, n, y(e[n]));
229
- }), t;
230
- }
231
- const B = (e, t, n, r) => (n.forEach((o) => {
232
- typeof t[o] > "u" && r.ignoreUndefined || (o in e && e[o] !== Object.getPrototypeOf(e) ? h(e, o, F(e[o], t[o], r)) : h(e, o, y(t[o])));
233
- }), e), ye = (e, t, n) => {
234
- let r = e.slice(0, 0), o = 0;
235
- return [e, t].forEach((s) => {
236
- const i = [];
237
- for (let l = 0; l < s.length; l++)
238
- K.call(s, l) && (i.push(String(l)), s === e ? h(r, o++, s[l]) : h(r, o++, y(s[l])));
239
- r = B(r, s, x(s).filter((l) => !i.includes(l)), n);
240
- }), r;
241
- };
242
- function F(e, t, n) {
243
- return n.concatArrays && Array.isArray(e) && Array.isArray(t) ? ye(e, t, n) : !O(t) || !O(e) ? y(t) : B(e, t, x(t), n);
244
- }
245
- var be = function(...e) {
246
- const t = F(y(_), this !== ge && this || {}, _);
247
- let n = { _: {} };
248
- for (const r of e)
249
- if (r !== void 0) {
250
- if (!O(r))
251
- throw new TypeError("`" + r + "` is not an Option Object");
252
- n = F(n, { _: r }, t);
253
- }
254
- return n._;
255
- };
256
- const ve = /* @__PURE__ */ W(be), we = ve.bind({
257
- concatArrays: !0,
258
- ignoreUndefined: !0
259
- });
260
- function Oe(e, t) {
261
- const n = window.localStorage.getItem(e);
262
- if (n) {
263
- const r = JSON.parse(n), o = JSON.parse(t), s = JSON.stringify(we(r, o));
264
- window.localStorage.setItem(e, s);
265
- } else
266
- window.localStorage.setItem(e, t);
267
- }
268
- function p(e, t) {
269
- return new Promise((n, r) => {
270
- try {
271
- const o = e();
272
- t == null || t(null, o), n(o);
273
- } catch (o) {
274
- t == null || t(o), r(o);
275
- }
276
- });
277
- }
278
- function w(e, t, n) {
279
- return Promise.all(e).then((r) => {
280
- const o = (n == null ? void 0 : n(r)) ?? null;
281
- return t == null || t(null, o), Promise.resolve(o);
282
- }, (r) => (t == null || t(r), Promise.reject(r)));
283
- }
284
- const g = {
285
- /**
286
- * Fetches `key` value.
287
- */
288
- getItem: (e, t) => p(() => window.localStorage.getItem(e), t),
289
- /**
290
- * Sets `value` for `key`.
291
- */
292
- setItem: (e, t, n) => p(() => window.localStorage.setItem(e, t), n),
293
- /**
294
- * Removes a `key`
295
- */
296
- removeItem: (e, t) => p(() => window.localStorage.removeItem(e), t),
297
- /**
298
- * Merges existing value with input value, assuming they are stringified JSON.
299
- */
300
- mergeItem: (e, t, n) => p(() => Oe(e, t), n),
301
- /**
302
- * Erases *all* AsyncStorage for the domain.
303
- */
304
- clear: (e) => p(() => window.localStorage.clear(), e),
305
- /**
306
- * Gets *all* keys known to the app, for all callers, libraries, etc.
307
- */
308
- getAllKeys: (e) => p(() => {
309
- const t = window.localStorage.length, n = [];
310
- for (let r = 0; r < t; r += 1) {
311
- const o = window.localStorage.key(r) || "";
312
- n.push(o);
313
- }
314
- return n;
315
- }, e),
316
- /**
317
- * (stub) Flushes any pending requests using a single batch call to get the data.
318
- */
319
- flushGetRequests: () => {
320
- },
321
- /**
322
- * multiGet resolves to an array of key-value pair arrays that matches the
323
- * input format of multiSet.
324
- *
325
- * multiGet(['k1', 'k2']) -> [['k1', 'val1'], ['k2', 'val2']]
326
- */
327
- multiGet: (e, t) => {
328
- const n = e.map((o) => g.getItem(o));
329
- return w(n, t, (o) => o.map((s, i) => [e[i], s]));
330
- },
331
- /**
332
- * Takes an array of key-value array pairs.
333
- * multiSet([['k1', 'val1'], ['k2', 'val2']])
334
- */
335
- multiSet: (e, t) => {
336
- const n = e.map((r) => g.setItem(r[0], r[1]));
337
- return w(n, t);
338
- },
339
- /**
340
- * Delete all the keys in the `keys` array.
341
- */
342
- multiRemove: (e, t) => {
343
- const n = e.map((r) => g.removeItem(r));
344
- return w(n, t);
345
- },
346
- /**
347
- * Takes an array of key-value array pairs and merges them with existing
348
- * values, assuming they are stringified JSON.
349
- *
350
- * multiMerge([['k1', 'val1'], ['k2', 'val2']])
351
- */
352
- multiMerge: (e, t) => {
353
- const n = e.map((r) => g.mergeItem(r[0], r[1]));
354
- return w(n, t);
355
- }
356
- };
357
- class G {
358
- constructor(t = "unleash:repository") {
359
- this.prefix = t;
1
+ import "react-native-get-random-values";
2
+ import { UnleashClient as n } from "unleash-proxy-client";
3
+ import { InMemoryStorageProvider as f, LocalStorageProvider as x } from "unleash-proxy-client";
4
+ import { FlagProvider as l } from "@unleash/proxy-client-react";
5
+ import { FlagContext as S, useFlag as F, useFlagsStatus as N, useUnleashClient as $, useUnleashContext as U, useVariant as w } from "@unleash/proxy-client-react";
6
+ import o from "@react-native-async-storage/async-storage";
7
+ import c from "react";
8
+ class s {
9
+ constructor(e = "unleash:repository") {
10
+ this.prefix = e;
360
11
  }
361
12
  // biome-ignore lint/suspicious/noExplicitAny: any is used to match the IStorageProvider interface
362
- async save(t, n) {
13
+ async save(e, t) {
363
14
  try {
364
- const r = JSON.stringify(n), o = `${this.prefix}:${t}`;
365
- await g.setItem(o, r);
15
+ const r = JSON.stringify(t), i = `${this.prefix}:${e}`;
16
+ await o.setItem(i, r);
366
17
  } catch (r) {
367
18
  console.error(r);
368
19
  }
369
20
  }
370
- async get(t) {
21
+ async get(e) {
371
22
  try {
372
- const n = `${this.prefix}:${t}`, r = await g.getItem(n);
23
+ const t = `${this.prefix}:${e}`, r = await o.getItem(t);
373
24
  return r ? JSON.parse(r) : void 0;
374
- } catch (n) {
375
- console.error(n);
25
+ } catch (t) {
26
+ console.error(t);
376
27
  }
377
28
  }
378
29
  }
379
- class Ie extends L {
380
- constructor(t) {
381
- const n = {
382
- ...t,
383
- storageProvider: t.storageProvider ?? new G(t.appName)
30
+ class u extends n {
31
+ constructor(e) {
32
+ const t = {
33
+ ...e,
34
+ storageProvider: e.storageProvider ?? new s(e.appName)
384
35
  };
385
- super(n);
36
+ super(t);
386
37
  }
387
38
  }
388
- const je = ({
389
- config: e,
390
- startTransition: t = (r) => r(),
391
- ...n
39
+ const h = ({
40
+ config: a,
41
+ startTransition: e = (r) => r(),
42
+ ...t
392
43
  }) => {
393
- let r = e;
394
- return e && (r = {
395
- ...e,
396
- storageProvider: e.storageProvider ?? new G(e.appName)
397
- }), /* @__PURE__ */ m.createElement(
398
- ue,
44
+ let r = a;
45
+ return a && (r = {
46
+ ...a,
47
+ storageProvider: a.storageProvider ?? new s(a.appName)
48
+ }), /* @__PURE__ */ c.createElement(
49
+ l,
399
50
  {
400
- ...n,
51
+ ...t,
401
52
  config: r,
402
- startTransition: t
53
+ startTransition: e
403
54
  }
404
55
  );
405
56
  };
406
57
  export {
407
- D as FlagContext,
408
- je as FlagProvider,
409
- Ne as InMemoryStorageProvider,
410
- $e as LocalStorageProvider,
411
- Ie as UnleashClient,
412
- je as default,
413
- G as defaultStorageProvider,
414
- Ae as useFlag,
415
- Ce as useFlagsStatus,
416
- Re as useUnleashClient,
417
- Se as useUnleashContext,
418
- Fe as useVariant
58
+ S as FlagContext,
59
+ h as FlagProvider,
60
+ f as InMemoryStorageProvider,
61
+ x as LocalStorageProvider,
62
+ u as UnleashClient,
63
+ h as default,
64
+ s as defaultStorageProvider,
65
+ F as useFlag,
66
+ N as useFlagsStatus,
67
+ $ as useUnleashClient,
68
+ U as useUnleashContext,
69
+ w as useVariant
419
70
  };
420
71
  //# sourceMappingURL=unleash-react-native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"unleash-react-native.js","sources":["../node_modules/fast-base64-decode/index.js","../node_modules/react-native-get-random-values/index.js","../node_modules/@unleash/proxy-client-react/dist/unleash-react.js","../node_modules/is-plain-obj/index.js","../node_modules/merge-options/index.js","../node_modules/@react-native-async-storage/async-storage/lib/module/AsyncStorage.js","../src/asyncStorageProvider.ts","../src/unleashClient.ts","../src/FlagProvider.tsx"],"sourcesContent":["'use strict'\n\nvar lookup = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 62, 0, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 63, 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51]\n\nmodule.exports = function base64Decode (source, target) {\n var sourceLength = source.length\n var paddingLength = (source[sourceLength - 2] === '=' ? 2 : (source[sourceLength - 1] === '=' ? 1 : 0))\n\n var tmp\n var byteIndex = 0\n var baseLength = (sourceLength - paddingLength) & 0xfffffffc\n\n for (var i = 0; i < baseLength; i += 4) {\n tmp = (lookup[source.charCodeAt(i)] << 18) | (lookup[source.charCodeAt(i + 1)] << 12) | (lookup[source.charCodeAt(i + 2)] << 6) | (lookup[source.charCodeAt(i + 3)])\n\n target[byteIndex++] = (tmp >> 16) & 0xFF\n target[byteIndex++] = (tmp >> 8) & 0xFF\n target[byteIndex++] = (tmp) & 0xFF\n }\n\n if (paddingLength === 1) {\n tmp = (lookup[source.charCodeAt(i)] << 10) | (lookup[source.charCodeAt(i + 1)] << 4) | (lookup[source.charCodeAt(i + 2)] >> 2)\n\n target[byteIndex++] = (tmp >> 8) & 0xFF\n target[byteIndex++] = tmp & 0xFF\n }\n\n if (paddingLength === 2) {\n tmp = (lookup[source.charCodeAt(i)] << 2) | (lookup[source.charCodeAt(i + 1)] >> 4)\n\n target[byteIndex++] = tmp & 0xFF\n }\n}\n","const base64Decode = require('fast-base64-decode')\nconst { TurboModuleRegistry } = require('react-native')\n\nclass TypeMismatchError extends Error {}\nclass QuotaExceededError extends Error {}\n\nlet warned = false\nfunction insecureRandomValues (array) {\n if (!warned) {\n console.warn('Using an insecure random number generator, this should only happen when running in a debugger without support for crypto.getRandomValues')\n warned = true\n }\n\n for (let i = 0, r; i < array.length; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000\n array[i] = (r >>> ((i & 0x03) << 3)) & 0xff\n }\n\n return array\n}\n\nlet module = null\n/**\n * @param {number} byteLength\n * @returns {string}\n */\nfunction getRandomBase64 (byteLength) {\n if (module == null) {\n module = TurboModuleRegistry.getEnforcing('RNGetRandomValues')\n }\n\n return module.getRandomBase64(byteLength)\n}\n\n/**\n * @param {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Uint8ClampedArray} array\n */\nfunction getRandomValues (array) {\n if (!(array instanceof Int8Array || array instanceof Uint8Array || array instanceof Int16Array || array instanceof Uint16Array || array instanceof Int32Array || array instanceof Uint32Array || array instanceof Uint8ClampedArray)) {\n throw new TypeMismatchError('Expected an integer array')\n }\n\n if (array.byteLength > 65536) {\n throw new QuotaExceededError('Can only request a maximum of 65536 bytes')\n }\n\n // Expo SDK 48+\n if (global.expo?.modules?.ExpoCrypto?.getRandomValues) {\n // ExpoCrypto.getRandomValues doesn't return the array\n global.expo.modules.ExpoCrypto.getRandomValues(array)\n return array\n }\n\n // Calling getRandomBase64 in remote debugging mode leads to the error\n // \"Calling synchronous methods on native modules is not supported in Chrome\".\n // So in that specific case we fall back to just using Math.random().\n if (isRemoteDebuggingInChrome()) {\n return insecureRandomValues(array)\n }\n\n base64Decode(getRandomBase64(array.byteLength), new Uint8Array(array.buffer, array.byteOffset, array.byteLength))\n\n return array\n}\n\nfunction isRemoteDebuggingInChrome () {\n // Remote debugging in Chrome is not supported in bridgeless\n if ('RN$Bridgeless' in global && RN$Bridgeless === true) {\n return false\n }\n\n return __DEV__ && typeof global.nativeCallSyncHook === 'undefined'\n}\n\nif (typeof global.crypto !== 'object') {\n global.crypto = {}\n}\n\nif (typeof global.crypto.getRandomValues !== 'function') {\n global.crypto.getRandomValues = getRandomValues\n}\n","import { UnleashClient as H } from \"unleash-proxy-client\";\nimport { InMemoryStorageProvider as Z, LocalStorageProvider as $, UnleashClient as N } from \"unleash-proxy-client\";\nimport f, { useState as i, useEffect as g, useMemo as C, useContext as M, useRef as k } from \"react\";\nconst A = f.createContext(null), _ = {\n bootstrap: [],\n disableRefresh: !0,\n disableMetrics: !0,\n url: \"http://localhost\",\n appName: \"offline\",\n clientKey: \"not-used\"\n}, q = \"startTransition\", I = f[q] || ((e) => e()), K = ({\n config: e,\n children: r,\n unleashClient: t,\n startClient: a = !0,\n stopClient: u = !0,\n startTransition: s = I\n}) => {\n var E, h, m;\n const l = e || _, o = f.useRef(\n t || new H(l)\n ), [n, F] = f.useState(\n !!(t ? e != null && e.bootstrap && (e == null ? void 0 : e.bootstrapOverride) !== !1 || (E = t.isReady) != null && E.call(t) : l.bootstrap && l.bootstrapOverride !== !1)\n ), [x, b] = i(((m = (h = o.current).getError) == null ? void 0 : m.call(h)) || null);\n g(() => {\n !l && !t && console.error(\n `You must provide either a config or an unleash client to the flag provider.\n If you are initializing the client in useEffect, you can avoid this warning\n by checking if the client exists before rendering.`\n );\n const c = (y) => {\n s(() => {\n b((U) => U || y);\n });\n }, R = (y) => {\n s(() => {\n b(null);\n });\n };\n let p = null;\n const P = () => {\n p = setTimeout(() => {\n s(() => {\n F(!0);\n });\n }, 0);\n };\n return o.current.on(\"ready\", P), o.current.on(\"error\", c), o.current.on(\"recovered\", R), a && (o.current.stop(), o.current.start()), function() {\n o.current && (o.current.off(\"error\", c), o.current.off(\"ready\", P), o.current.off(\"recovered\", R), u && o.current.stop()), p && clearTimeout(p);\n };\n }, []);\n const T = C(\n () => ({\n on: (...c) => o.current.on(...c),\n off: (...c) => o.current.off(...c),\n isEnabled: (...c) => o.current.isEnabled(...c),\n updateContext: async (...c) => await o.current.updateContext(...c),\n getVariant: (...c) => o.current.getVariant(...c),\n client: o.current,\n flagsReady: n,\n flagsError: x,\n setFlagsReady: F,\n setFlagsError: b\n }),\n [n, x]\n );\n return /* @__PURE__ */ f.createElement(A.Provider, { value: T }, r);\n}, S = {\n on: (e, r, t) => (console.error(\"on() must be used within a FlagProvider\"), v),\n off: (e, r) => (console.error(\"off() must be used within a FlagProvider\"), v),\n updateContext: async () => {\n console.error(\"updateContext() must be used within a FlagProvider\");\n },\n isEnabled: () => (console.error(\"isEnabled() must be used within a FlagProvider\"), !1),\n getVariant: () => (console.error(\"getVariant() must be used within a FlagProvider\"), { name: \"disabled\", enabled: !1 })\n}, v = {\n ...S,\n toggles: [],\n impressionDataAll: {},\n context: {},\n storage: {},\n start: () => {\n },\n stop: () => {\n },\n isReady: () => !1,\n getError: () => null,\n getAllToggles: () => []\n}, O = {\n ...S,\n client: v,\n flagsReady: !1,\n setFlagsReady: () => {\n console.error(\"setFlagsReady() must be used within a FlagProvider\");\n },\n flagsError: null,\n setFlagsError: () => {\n console.error(\"setFlagsError() must be used within a FlagProvider\");\n }\n};\nfunction d() {\n const e = M(A);\n return e || (console.error(\"useFlagContext() must be used within a FlagProvider\"), O);\n}\nconst L = (e) => {\n const { isEnabled: r, client: t } = d(), [a, u] = i(!!r(e)), s = k();\n return s.current = a, g(() => {\n if (!t)\n return;\n const l = () => {\n const n = r(e);\n n !== s.current && (s.current = n, u(!!n));\n }, o = () => {\n const n = r(e);\n s.current = n, u(n);\n };\n return t.on(\"update\", l), t.on(\"ready\", o), () => {\n t.off(\"update\", l), t.off(\"ready\", o);\n };\n }, [t]), a;\n}, Y = () => {\n const { client: e } = d(), [r, t] = i(e.getAllToggles());\n return g(() => {\n const a = () => {\n t(e.getAllToggles());\n };\n return e.on(\"update\", a), () => {\n e.off(\"update\", a);\n };\n }, []), r;\n}, j = () => {\n const { flagsReady: e, flagsError: r } = d();\n return { flagsReady: e, flagsError: r };\n}, z = (e, r) => {\n var a, u, s, l;\n return !(e.name === (r == null ? void 0 : r.name) && e.enabled === (r == null ? void 0 : r.enabled) && e.feature_enabled === (r == null ? void 0 : r.feature_enabled) && ((a = e.payload) == null ? void 0 : a.type) === ((u = r == null ? void 0 : r.payload) == null ? void 0 : u.type) && ((s = e.payload) == null ? void 0 : s.value) === ((l = r == null ? void 0 : r.payload) == null ? void 0 : l.value));\n}, G = (e) => {\n const { getVariant: r, client: t } = d(), [a, u] = i(r(e)), s = k({\n name: a.name,\n enabled: a.enabled\n });\n return s.current = a, g(() => {\n if (!t)\n return;\n const l = () => {\n const n = r(e);\n z(s.current, n) && (u(n), s.current = n);\n }, o = () => {\n const n = r(e);\n s.current.name = n == null ? void 0 : n.name, s.current.enabled = n == null ? void 0 : n.enabled, u(n);\n };\n return t.on(\"update\", l), t.on(\"ready\", o), () => {\n t.off(\"update\", l), t.off(\"ready\", o);\n };\n }, [t]), a || {};\n}, J = () => {\n const { updateContext: e } = d();\n return e;\n}, Q = () => {\n const { client: e } = d();\n return e;\n};\nexport {\n A as FlagContext,\n K as FlagProvider,\n Z as InMemoryStorageProvider,\n $ as LocalStorageProvider,\n N as UnleashClient,\n K as default,\n L as useFlag,\n Y as useFlags,\n j as useFlagsStatus,\n Q as useUnleashClient,\n J as useUnleashContext,\n G as useVariant\n};\n//# sourceMappingURL=unleash-react.js.map\n","'use strict';\n\nmodule.exports = value => {\n\tif (Object.prototype.toString.call(value) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn prototype === null || prototype === Object.prototype;\n};\n","'use strict';\nconst isOptionObject = require('is-plain-obj');\n\nconst {hasOwnProperty} = Object.prototype;\nconst {propertyIsEnumerable} = Object;\nconst defineProperty = (object, name, value) => Object.defineProperty(object, name, {\n\tvalue,\n\twritable: true,\n\tenumerable: true,\n\tconfigurable: true\n});\n\nconst globalThis = this;\nconst defaultMergeOptions = {\n\tconcatArrays: false,\n\tignoreUndefined: false\n};\n\nconst getEnumerableOwnPropertyKeys = value => {\n\tconst keys = [];\n\n\tfor (const key in value) {\n\t\tif (hasOwnProperty.call(value, key)) {\n\t\t\tkeys.push(key);\n\t\t}\n\t}\n\n\t/* istanbul ignore else */\n\tif (Object.getOwnPropertySymbols) {\n\t\tconst symbols = Object.getOwnPropertySymbols(value);\n\n\t\tfor (const symbol of symbols) {\n\t\t\tif (propertyIsEnumerable.call(value, symbol)) {\n\t\t\t\tkeys.push(symbol);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn keys;\n};\n\nfunction clone(value) {\n\tif (Array.isArray(value)) {\n\t\treturn cloneArray(value);\n\t}\n\n\tif (isOptionObject(value)) {\n\t\treturn cloneOptionObject(value);\n\t}\n\n\treturn value;\n}\n\nfunction cloneArray(array) {\n\tconst result = array.slice(0, 0);\n\n\tgetEnumerableOwnPropertyKeys(array).forEach(key => {\n\t\tdefineProperty(result, key, clone(array[key]));\n\t});\n\n\treturn result;\n}\n\nfunction cloneOptionObject(object) {\n\tconst result = Object.getPrototypeOf(object) === null ? Object.create(null) : {};\n\n\tgetEnumerableOwnPropertyKeys(object).forEach(key => {\n\t\tdefineProperty(result, key, clone(object[key]));\n\t});\n\n\treturn result;\n}\n\n/**\n * @param {*} merged already cloned\n * @param {*} source something to merge\n * @param {string[]} keys keys to merge\n * @param {Object} config Config Object\n * @returns {*} cloned Object\n */\nconst mergeKeys = (merged, source, keys, config) => {\n\tkeys.forEach(key => {\n\t\tif (typeof source[key] === 'undefined' && config.ignoreUndefined) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Do not recurse into prototype chain of merged\n\t\tif (key in merged && merged[key] !== Object.getPrototypeOf(merged)) {\n\t\t\tdefineProperty(merged, key, merge(merged[key], source[key], config));\n\t\t} else {\n\t\t\tdefineProperty(merged, key, clone(source[key]));\n\t\t}\n\t});\n\n\treturn merged;\n};\n\n/**\n * @param {*} merged already cloned\n * @param {*} source something to merge\n * @param {Object} config Config Object\n * @returns {*} cloned Object\n *\n * see [Array.prototype.concat ( ...arguments )](http://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.concat)\n */\nconst concatArrays = (merged, source, config) => {\n\tlet result = merged.slice(0, 0);\n\tlet resultIndex = 0;\n\n\t[merged, source].forEach(array => {\n\t\tconst indices = [];\n\n\t\t// `result.concat(array)` with cloning\n\t\tfor (let k = 0; k < array.length; k++) {\n\t\t\tif (!hasOwnProperty.call(array, k)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tindices.push(String(k));\n\n\t\t\tif (array === merged) {\n\t\t\t\t// Already cloned\n\t\t\t\tdefineProperty(result, resultIndex++, array[k]);\n\t\t\t} else {\n\t\t\t\tdefineProperty(result, resultIndex++, clone(array[k]));\n\t\t\t}\n\t\t}\n\n\t\t// Merge non-index keys\n\t\tresult = mergeKeys(result, array, getEnumerableOwnPropertyKeys(array).filter(key => !indices.includes(key)), config);\n\t});\n\n\treturn result;\n};\n\n/**\n * @param {*} merged already cloned\n * @param {*} source something to merge\n * @param {Object} config Config Object\n * @returns {*} cloned Object\n */\nfunction merge(merged, source, config) {\n\tif (config.concatArrays && Array.isArray(merged) && Array.isArray(source)) {\n\t\treturn concatArrays(merged, source, config);\n\t}\n\n\tif (!isOptionObject(source) || !isOptionObject(merged)) {\n\t\treturn clone(source);\n\t}\n\n\treturn mergeKeys(merged, source, getEnumerableOwnPropertyKeys(source), config);\n}\n\nmodule.exports = function (...options) {\n\tconst config = merge(clone(defaultMergeOptions), (this !== globalThis && this) || {}, defaultMergeOptions);\n\tlet merged = {_: {}};\n\n\tfor (const option of options) {\n\t\tif (option === undefined) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!isOptionObject(option)) {\n\t\t\tthrow new TypeError('`' + option + '` is not an Option Object');\n\t\t}\n\n\t\tmerged = merge(merged, {_: option}, config);\n\t}\n\n\treturn merged._;\n};\n","\"use strict\";\n\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport mergeOptions from \"merge-options\";\n\n// eslint-disable-next-line @typescript-eslint/ban-types\n\n// eslint-disable-next-line @typescript-eslint/ban-types\n\nconst merge = mergeOptions.bind({\n concatArrays: true,\n ignoreUndefined: true\n});\nfunction mergeLocalStorageItem(key, value) {\n const oldValue = window.localStorage.getItem(key);\n if (oldValue) {\n const oldObject = JSON.parse(oldValue);\n const newObject = JSON.parse(value);\n const nextValue = JSON.stringify(merge(oldObject, newObject));\n window.localStorage.setItem(key, nextValue);\n } else {\n window.localStorage.setItem(key, value);\n }\n}\nfunction createPromise(getValue, callback) {\n return new Promise((resolve, reject) => {\n try {\n const value = getValue();\n callback?.(null, value);\n resolve(value);\n } catch (err) {\n callback?.(err);\n reject(err);\n }\n });\n}\nfunction createPromiseAll(promises, callback, processResult) {\n return Promise.all(promises).then(result => {\n const value = processResult?.(result) ?? null;\n callback?.(null, value);\n return Promise.resolve(value);\n }, errors => {\n callback?.(errors);\n return Promise.reject(errors);\n });\n}\nconst AsyncStorage = {\n /**\n * Fetches `key` value.\n */\n getItem: (key, callback) => {\n return createPromise(() => window.localStorage.getItem(key), callback);\n },\n /**\n * Sets `value` for `key`.\n */\n setItem: (key, value, callback) => {\n return createPromise(() => window.localStorage.setItem(key, value), callback);\n },\n /**\n * Removes a `key`\n */\n removeItem: (key, callback) => {\n return createPromise(() => window.localStorage.removeItem(key), callback);\n },\n /**\n * Merges existing value with input value, assuming they are stringified JSON.\n */\n mergeItem: (key, value, callback) => {\n return createPromise(() => mergeLocalStorageItem(key, value), callback);\n },\n /**\n * Erases *all* AsyncStorage for the domain.\n */\n clear: callback => {\n return createPromise(() => window.localStorage.clear(), callback);\n },\n /**\n * Gets *all* keys known to the app, for all callers, libraries, etc.\n */\n getAllKeys: callback => {\n return createPromise(() => {\n const numberOfKeys = window.localStorage.length;\n const keys = [];\n for (let i = 0; i < numberOfKeys; i += 1) {\n const key = window.localStorage.key(i) || \"\";\n keys.push(key);\n }\n return keys;\n }, callback);\n },\n /**\n * (stub) Flushes any pending requests using a single batch call to get the data.\n */\n flushGetRequests: () => undefined,\n /**\n * multiGet resolves to an array of key-value pair arrays that matches the\n * input format of multiSet.\n *\n * multiGet(['k1', 'k2']) -> [['k1', 'val1'], ['k2', 'val2']]\n */\n multiGet: (keys, callback) => {\n const promises = keys.map(key => AsyncStorage.getItem(key));\n const processResult = result => result.map((value, i) => [keys[i], value]);\n return createPromiseAll(promises, callback, processResult);\n },\n /**\n * Takes an array of key-value array pairs.\n * multiSet([['k1', 'val1'], ['k2', 'val2']])\n */\n multiSet: (keyValuePairs, callback) => {\n const promises = keyValuePairs.map(item => AsyncStorage.setItem(item[0], item[1]));\n return createPromiseAll(promises, callback);\n },\n /**\n * Delete all the keys in the `keys` array.\n */\n multiRemove: (keys, callback) => {\n const promises = keys.map(key => AsyncStorage.removeItem(key));\n return createPromiseAll(promises, callback);\n },\n /**\n * Takes an array of key-value array pairs and merges them with existing\n * values, assuming they are stringified JSON.\n *\n * multiMerge([['k1', 'val1'], ['k2', 'val2']])\n */\n multiMerge: (keyValuePairs, callback) => {\n const promises = keyValuePairs.map(item => AsyncStorage.mergeItem(item[0], item[1]));\n return createPromiseAll(promises, callback);\n }\n};\nexport default AsyncStorage;\n//# sourceMappingURL=AsyncStorage.js.map","import AsyncStorage from '@react-native-async-storage/async-storage'\nimport type { IStorageProvider } from 'unleash-proxy-client'\n\nexport class AsyncStorageProvider implements IStorageProvider {\n private prefix: string\n\n constructor(name = 'unleash:repository') {\n this.prefix = name\n }\n\n // biome-ignore lint/suspicious/noExplicitAny: any is used to match the IStorageProvider interface\n public async save(name: string, data: any) {\n try {\n const repo = JSON.stringify(data)\n const key = `${this.prefix}:${name}`\n await AsyncStorage.setItem(key, repo)\n } catch (e) {\n console.error(e)\n }\n }\n\n public async get(name: string) {\n try {\n const key = `${this.prefix}:${name}`\n const data = await AsyncStorage.getItem(key)\n return data ? JSON.parse(data) : undefined\n } catch (e) {\n console.error(e)\n }\n }\n}\n","import {\n UnleashClient as BaseUnleashClient,\n type IConfig\n} from 'unleash-proxy-client'\nimport { AsyncStorageProvider } from './asyncStorageProvider'\n\nexport class UnleashClient extends BaseUnleashClient {\n constructor(config: IConfig) {\n const reactNativeConfig = {\n ...config,\n storageProvider:\n config.storageProvider ?? new AsyncStorageProvider(config.appName)\n }\n\n super(reactNativeConfig)\n }\n}\n","import React, { type PropsWithChildren } from 'react'\nimport {\n FlagProvider as BaseFlagProvider,\n type IFlagProvider\n} from '@unleash/proxy-client-react'\nimport { AsyncStorageProvider } from './asyncStorageProvider'\n\nexport const FlagProvider = ({\n config,\n startTransition = fn => fn(),\n ...props\n}: PropsWithChildren<IFlagProvider>) => {\n let reactNativeConfig = config\n if (config) {\n reactNativeConfig = {\n ...config,\n storageProvider:\n config.storageProvider ?? new AsyncStorageProvider(config.appName)\n }\n }\n\n return (\n <BaseFlagProvider\n {...props}\n config={reactNativeConfig}\n startTransition={startTransition}\n />\n )\n}\n\nexport default FlagProvider\n"],"names":["lookup","fastBase64Decode","source","target","sourceLength","paddingLength","tmp","byteIndex","baseLength","i","base64Decode","require$$0","TurboModuleRegistry","require$$1","TypeMismatchError","QuotaExceededError","warned","insecureRandomValues","array","r","module","getRandomBase64","byteLength","getRandomValues","global","isRemoteDebuggingInChrome","A","f","_","q","I","K","t","a","u","E","h","m","l","o","H","n","F","x","b","g","y","U","R","p","P","T","C","S","v","O","d","M","L","k","j","z","s","G","J","Q","isPlainObj","value","prototype","isOptionObject","hasOwnProperty","propertyIsEnumerable","defineProperty","object","name","globalThis","this","defaultMergeOptions","getEnumerableOwnPropertyKeys","keys","key","symbols","symbol","clone","cloneArray","cloneOptionObject","result","mergeKeys","merged","config","merge","concatArrays","resultIndex","indices","mergeOptions","options","option","mergeLocalStorageItem","oldValue","oldObject","newObject","nextValue","createPromise","getValue","callback","resolve","reject","err","createPromiseAll","promises","processResult","errors","AsyncStorage","numberOfKeys","keyValuePairs","item","AsyncStorageProvider","data","repo","e","UnleashClient","BaseUnleashClient","reactNativeConfig","FlagProvider","startTransition","fn","props","React","BaseFlagProvider"],"mappings":";;;;;;;;AAEA,IAAIA,IAAS,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,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AAK,MAAM,IAAIN,CAAI,IAC5B2C,IAAO,MAAML,EAAa,QAAQhC,CAAG;AAC3C,aAAOqC,IAAO,KAAK,MAAMA,CAAI,IAAI;AAAA,IACnC,SAASE,GAAG;AACV,cAAQ,MAAMA,CAAC;AAAA,IACjB;AAAA,EACF;AACF;ACxBO,MAAMC,WAAsBC,EAAkB;AAAA,EACnD,YAAYhC,GAAiB;AAC3B,UAAMiC,IAAoB;AAAA,MACxB,GAAGjC;AAAA,MACH,iBACEA,EAAO,mBAAmB,IAAI2B,EAAqB3B,EAAO,OAAO;AAAA,IAAA;AAGrE,UAAMiC,CAAiB;AAAA,EACzB;AACF;ACTO,MAAMC,KAAe,CAAC;AAAA,EAC3B,QAAAlC;AAAA,EACA,iBAAAmC,IAAkB,OAAMC,EAAA;AAAA,EACxB,GAAGC;AACL,MAAwC;AACtC,MAAIJ,IAAoBjC;AACxB,SAAIA,MACFiC,IAAoB;AAAA,IAClB,GAAGjC;AAAA,IACH,iBACEA,EAAO,mBAAmB,IAAI2B,EAAqB3B,EAAO,OAAO;AAAA,EAAA,IAKrEsC,gBAAAA,EAAA;AAAA,IAACC;AAAAA,IAAA;AAAA,MACE,GAAGF;AAAA,MACJ,QAAQJ;AAAA,MACR,iBAAAE;AAAA,IAAA;AAAA,EAAA;AAGN;","x_google_ignoreList":[0,1,2,3,4,5]}
1
+ {"version":3,"file":"unleash-react-native.js","sources":["../src/asyncStorageProvider.ts","../src/unleashClient.ts","../src/FlagProvider.tsx"],"sourcesContent":["import AsyncStorage from '@react-native-async-storage/async-storage'\nimport type { IStorageProvider } from 'unleash-proxy-client'\n\nexport class AsyncStorageProvider implements IStorageProvider {\n private prefix: string\n\n constructor(name = 'unleash:repository') {\n this.prefix = name\n }\n\n // biome-ignore lint/suspicious/noExplicitAny: any is used to match the IStorageProvider interface\n public async save(name: string, data: any) {\n try {\n const repo = JSON.stringify(data)\n const key = `${this.prefix}:${name}`\n await AsyncStorage.setItem(key, repo)\n } catch (e) {\n console.error(e)\n }\n }\n\n public async get(name: string) {\n try {\n const key = `${this.prefix}:${name}`\n const data = await AsyncStorage.getItem(key)\n return data ? JSON.parse(data) : undefined\n } catch (e) {\n console.error(e)\n }\n }\n}\n","import {\n UnleashClient as BaseUnleashClient,\n type IConfig\n} from 'unleash-proxy-client'\nimport { AsyncStorageProvider } from './asyncStorageProvider'\n\nexport class UnleashClient extends BaseUnleashClient {\n constructor(config: IConfig) {\n const reactNativeConfig = {\n ...config,\n storageProvider:\n config.storageProvider ?? new AsyncStorageProvider(config.appName)\n }\n\n super(reactNativeConfig)\n }\n}\n","import React, { type PropsWithChildren } from 'react'\nimport {\n FlagProvider as BaseFlagProvider,\n type IFlagProvider\n} from '@unleash/proxy-client-react'\nimport { AsyncStorageProvider } from './asyncStorageProvider'\n\nexport const FlagProvider = ({\n config,\n startTransition = fn => fn(),\n ...props\n}: PropsWithChildren<IFlagProvider>) => {\n let reactNativeConfig = config\n if (config) {\n reactNativeConfig = {\n ...config,\n storageProvider:\n config.storageProvider ?? new AsyncStorageProvider(config.appName)\n }\n }\n\n return (\n <BaseFlagProvider\n {...props}\n config={reactNativeConfig}\n startTransition={startTransition}\n />\n )\n}\n\nexport default FlagProvider\n"],"names":["AsyncStorageProvider","name","data","repo","key","AsyncStorage","e","UnleashClient","BaseUnleashClient","config","reactNativeConfig","FlagProvider","startTransition","fn","props","React","BaseFlagProvider"],"mappings":";;;;;;;AAGO,MAAMA,EAAiD;AAAA,EAG5D,YAAYC,IAAO,sBAAsB;AACvC,SAAK,SAASA;AAAA,EAChB;AAAA;AAAA,EAGA,MAAa,KAAKA,GAAcC,GAAW;AACzC,QAAI;AACF,YAAMC,IAAO,KAAK,UAAUD,CAAI,GAC1BE,IAAM,GAAG,KAAK,MAAM,IAAIH,CAAI;AAClC,YAAMI,EAAa,QAAQD,GAAKD,CAAI;AAAA,IACtC,SAASG,GAAG;AACV,cAAQ,MAAMA,CAAC;AAAA,IACjB;AAAA,EACF;AAAA,EAEA,MAAa,IAAIL,GAAc;AAC7B,QAAI;AACF,YAAMG,IAAM,GAAG,KAAK,MAAM,IAAIH,CAAI,IAC5BC,IAAO,MAAMG,EAAa,QAAQD,CAAG;AAC3C,aAAOF,IAAO,KAAK,MAAMA,CAAI,IAAI;AAAA,IACnC,SAASI,GAAG;AACV,cAAQ,MAAMA,CAAC;AAAA,IACjB;AAAA,EACF;AACF;ACxBO,MAAMC,UAAsBC,EAAkB;AAAA,EACnD,YAAYC,GAAiB;AAC3B,UAAMC,IAAoB;AAAA,MACxB,GAAGD;AAAA,MACH,iBACEA,EAAO,mBAAmB,IAAIT,EAAqBS,EAAO,OAAO;AAAA,IAAA;AAGrE,UAAMC,CAAiB;AAAA,EACzB;AACF;ACTO,MAAMC,IAAe,CAAC;AAAA,EAC3B,QAAAF;AAAA,EACA,iBAAAG,IAAkB,OAAMC,EAAA;AAAA,EACxB,GAAGC;AACL,MAAwC;AACtC,MAAIJ,IAAoBD;AACxB,SAAIA,MACFC,IAAoB;AAAA,IAClB,GAAGD;AAAA,IACH,iBACEA,EAAO,mBAAmB,IAAIT,EAAqBS,EAAO,OAAO;AAAA,EAAA,IAKrE,gBAAAM,EAAA;AAAA,IAACC;AAAAA,IAAA;AAAA,MACE,GAAGF;AAAA,MACJ,QAAQJ;AAAA,MACR,iBAAAE;AAAA,IAAA;AAAA,EAAA;AAGN;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unleash/unleash-react-native-sdk",
3
- "version": "1.0.0-alpha.2",
3
+ "version": "1.0.0-alpha.3",
4
4
  "description": "A React Native / Expo SDK for Unleash",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,13 +9,11 @@
9
9
  "license": "Apache-2.0",
10
10
  "type": "module",
11
11
  "module": "dist/unleash-react-native.js",
12
- "main": "dist/unleash-react-native.umd.cjs",
13
12
  "react-native": "dist/unleash-react-native.js",
14
13
  "types": "dist/index.d.ts",
15
14
  "exports": {
16
15
  ".": {
17
16
  "import": "./dist/unleash-react-native.js",
18
- "require": "./dist/unleash-react-native.umd.cjs",
19
17
  "types": "./dist/index.d.ts"
20
18
  }
21
19
  },
@@ -1,4 +0,0 @@
1
- (function(a,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("react-native"),require("unleash-proxy-client"),require("react")):typeof define=="function"&&define.amd?define(["exports","react-native","unleash-proxy-client","react"],v):(a=typeof globalThis<"u"?globalThis:a||self,v(a.UnleashReactNative={},a.ReactNative,a.unleashProxyClient,a.react))})(this,function(a,v,O,d){"use strict";var g=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function G(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,0,62,0,63,52,53,54,55,56,57,58,59,60,61,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,0,0,0,0,63,0,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],z=function(t,n){for(var r=t.length,o=t[r-2]==="="?2:t[r-1]==="="?1:0,s,l=0,u=r-o&4294967292,i=0;i<u;i+=4)s=p[t.charCodeAt(i)]<<18|p[t.charCodeAt(i+1)]<<12|p[t.charCodeAt(i+2)]<<6|p[t.charCodeAt(i+3)],n[l++]=s>>16&255,n[l++]=s>>8&255,n[l++]=s&255;o===1&&(s=p[t.charCodeAt(i)]<<10|p[t.charCodeAt(i+1)]<<4|p[t.charCodeAt(i+2)]>>2,n[l++]=s>>8&255,n[l++]=s&255),o===2&&(s=p[t.charCodeAt(i)]<<2|p[t.charCodeAt(i+1)]>>4,n[l++]=s&255)};const Q=z,{TurboModuleRegistry:H}=v;class Y extends Error{}class W extends Error{}let U=!1;function X(e){U||(console.warn("Using an insecure random number generator, this should only happen when running in a debugger without support for crypto.getRandomValues"),U=!0);for(let t=0,n;t<e.length;t++)t&3||(n=Math.random()*4294967296),e[t]=n>>>((t&3)<<3)&255;return e}let C=null;function Z(e){return C==null&&(C=H.getEnforcing("RNGetRandomValues")),C.getRandomBase64(e)}function k(e){var t,n,r;if(!(e instanceof Int8Array||e instanceof Uint8Array||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8ClampedArray))throw new Y("Expected an integer array");if(e.byteLength>65536)throw new W("Can only request a maximum of 65536 bytes");return(r=(n=(t=g.expo)==null?void 0:t.modules)==null?void 0:n.ExpoCrypto)!=null&&r.getRandomValues?(g.expo.modules.ExpoCrypto.getRandomValues(e),e):ee()?X(e):(Q(Z(e.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e)}function ee(){return"RN$Bridgeless"in g&&RN$Bridgeless===!0?!1:__DEV__&&typeof g.nativeCallSyncHook>"u"}typeof g.crypto!="object"&&(g.crypto={}),typeof g.crypto.getRandomValues!="function"&&(g.crypto.getRandomValues=k);const F=d.createContext(null),te={bootstrap:[],disableRefresh:!0,disableMetrics:!0,url:"http://localhost",appName:"offline",clientKey:"not-used"},ne="startTransition",re=d[ne]||(e=>e()),oe=({config:e,children:t,unleashClient:n,startClient:r=!0,stopClient:o=!0,startTransition:s=re})=>{var l,u,i;const A=e||te,c=d.useRef(n||new O.UnleashClient(A)),[$,D]=d.useState(!!(n?e!=null&&e.bootstrap&&(e==null?void 0:e.bootstrapOverride)!==!1||(l=n.isReady)!=null&&l.call(n):A.bootstrap&&A.bootstrapOverride!==!1)),[q,j]=d.useState(((i=(u=c.current).getError)==null?void 0:i.call(u))||null);d.useEffect(()=>{!A&&!n&&console.error(`You must provide either a config or an unleash client to the flag provider.
2
- If you are initializing the client in useEffect, you can avoid this warning
3
- by checking if the client exists before rendering.`);const f=B=>{s(()=>{j(Ee=>Ee||B)})},J=B=>{s(()=>{j(null)})};let V=null;const K=()=>{V=setTimeout(()=>{s(()=>{D(!0)})},0)};return c.current.on("ready",K),c.current.on("error",f),c.current.on("recovered",J),r&&(c.current.stop(),c.current.start()),function(){c.current&&(c.current.off("error",f),c.current.off("ready",K),c.current.off("recovered",J),o&&c.current.stop()),V&&clearTimeout(V)}},[]);const Pe=d.useMemo(()=>({on:(...f)=>c.current.on(...f),off:(...f)=>c.current.off(...f),isEnabled:(...f)=>c.current.isEnabled(...f),updateContext:async(...f)=>await c.current.updateContext(...f),getVariant:(...f)=>c.current.getVariant(...f),client:c.current,flagsReady:$,flagsError:q,setFlagsReady:D,setFlagsError:j}),[$,q]);return d.createElement(F.Provider,{value:Pe},t)},N={on:(e,t,n)=>(console.error("on() must be used within a FlagProvider"),R),off:(e,t)=>(console.error("off() must be used within a FlagProvider"),R),updateContext:async()=>{console.error("updateContext() must be used within a FlagProvider")},isEnabled:()=>(console.error("isEnabled() must be used within a FlagProvider"),!1),getVariant:()=>(console.error("getVariant() must be used within a FlagProvider"),{name:"disabled",enabled:!1})},R={...N,toggles:[],impressionDataAll:{},context:{},storage:{},start:()=>{},stop:()=>{},isReady:()=>!1,getError:()=>null,getAllToggles:()=>[]},se={...N,client:R,flagsReady:!1,setFlagsReady:()=>{console.error("setFlagsReady() must be used within a FlagProvider")},flagsError:null,setFlagsError:()=>{console.error("setFlagsError() must be used within a FlagProvider")}};function w(){return d.useContext(F)||(console.error("useFlagContext() must be used within a FlagProvider"),se)}const ie=e=>{const{isEnabled:t,client:n}=w(),[r,o]=d.useState(!!t(e)),s=d.useRef();return s.current=r,d.useEffect(()=>{if(!n)return;const l=()=>{const i=t(e);i!==s.current&&(s.current=i,o(!!i))},u=()=>{const i=t(e);s.current=i,o(i)};return n.on("update",l),n.on("ready",u),()=>{n.off("update",l),n.off("ready",u)}},[n]),r},ae=()=>{const{flagsReady:e,flagsError:t}=w();return{flagsReady:e,flagsError:t}},le=(e,t)=>{var n,r,o,s;return!(e.name===(t==null?void 0:t.name)&&e.enabled===(t==null?void 0:t.enabled)&&e.feature_enabled===(t==null?void 0:t.feature_enabled)&&((n=e.payload)==null?void 0:n.type)===((r=t==null?void 0:t.payload)==null?void 0:r.type)&&((o=e.payload)==null?void 0:o.value)===((s=t==null?void 0:t.payload)==null?void 0:s.value))},ue=e=>{const{getVariant:t,client:n}=w(),[r,o]=d.useState(t(e)),s=d.useRef({name:r.name,enabled:r.enabled});return s.current=r,d.useEffect(()=>{if(!n)return;const l=()=>{const i=t(e);le(s.current,i)&&(o(i),s.current=i)},u=()=>{const i=t(e);s.current.name=i==null?void 0:i.name,s.current.enabled=i==null?void 0:i.enabled,o(i)};return n.on("update",l),n.on("ready",u),()=>{n.off("update",l),n.off("ready",u)}},[n]),r||{}},ce=()=>{const{updateContext:e}=w();return e},de=()=>{const{client:e}=w();return e};var fe=e=>{if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype};const P=fe,{hasOwnProperty:T}=Object.prototype,{propertyIsEnumerable:ge}=Object,m=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}),pe=g,_={concatArrays:!1,ignoreUndefined:!1},E=e=>{const t=[];for(const n in e)T.call(e,n)&&t.push(n);if(Object.getOwnPropertySymbols){const n=Object.getOwnPropertySymbols(e);for(const r of n)ge.call(e,r)&&t.push(r)}return t};function y(e){return Array.isArray(e)?me(e):P(e)?ye(e):e}function me(e){const t=e.slice(0,0);return E(e).forEach(n=>{m(t,n,y(e[n]))}),t}function ye(e){const t=Object.getPrototypeOf(e)===null?Object.create(null):{};return E(e).forEach(n=>{m(t,n,y(e[n]))}),t}const M=(e,t,n,r)=>(n.forEach(o=>{typeof t[o]>"u"&&r.ignoreUndefined||(o in e&&e[o]!==Object.getPrototypeOf(e)?m(e,o,x(e[o],t[o],r)):m(e,o,y(t[o])))}),e),he=(e,t,n)=>{let r=e.slice(0,0),o=0;return[e,t].forEach(s=>{const l=[];for(let u=0;u<s.length;u++)T.call(s,u)&&(l.push(String(u)),s===e?m(r,o++,s[u]):m(r,o++,y(s[u])));r=M(r,s,E(s).filter(u=>!l.includes(u)),n)}),r};function x(e,t,n){return n.concatArrays&&Array.isArray(e)&&Array.isArray(t)?he(e,t,n):!P(t)||!P(e)?y(t):M(e,t,E(t),n)}var be=function(...e){const t=x(y(_),this!==pe&&this||{},_);let n={_:{}};for(const r of e)if(r!==void 0){if(!P(r))throw new TypeError("`"+r+"` is not an Option Object");n=x(n,{_:r},t)}return n._};const ve=G(be).bind({concatArrays:!0,ignoreUndefined:!0});function we(e,t){const n=window.localStorage.getItem(e);if(n){const r=JSON.parse(n),o=JSON.parse(t),s=JSON.stringify(ve(r,o));window.localStorage.setItem(e,s)}else window.localStorage.setItem(e,t)}function h(e,t){return new Promise((n,r)=>{try{const o=e();t==null||t(null,o),n(o)}catch(o){t==null||t(o),r(o)}})}function S(e,t,n){return Promise.all(e).then(r=>{const o=(n==null?void 0:n(r))??null;return t==null||t(null,o),Promise.resolve(o)},r=>(t==null||t(r),Promise.reject(r)))}const b={getItem:(e,t)=>h(()=>window.localStorage.getItem(e),t),setItem:(e,t,n)=>h(()=>window.localStorage.setItem(e,t),n),removeItem:(e,t)=>h(()=>window.localStorage.removeItem(e),t),mergeItem:(e,t,n)=>h(()=>we(e,t),n),clear:e=>h(()=>window.localStorage.clear(),e),getAllKeys:e=>h(()=>{const t=window.localStorage.length,n=[];for(let r=0;r<t;r+=1){const o=window.localStorage.key(r)||"";n.push(o)}return n},e),flushGetRequests:()=>{},multiGet:(e,t)=>{const n=e.map(o=>b.getItem(o));return S(n,t,o=>o.map((s,l)=>[e[l],s]))},multiSet:(e,t)=>{const n=e.map(r=>b.setItem(r[0],r[1]));return S(n,t)},multiRemove:(e,t)=>{const n=e.map(r=>b.removeItem(r));return S(n,t)},multiMerge:(e,t)=>{const n=e.map(r=>b.mergeItem(r[0],r[1]));return S(n,t)}};class I{constructor(t="unleash:repository"){this.prefix=t}async save(t,n){try{const r=JSON.stringify(n),o=`${this.prefix}:${t}`;await b.setItem(o,r)}catch(r){console.error(r)}}async get(t){try{const n=`${this.prefix}:${t}`,r=await b.getItem(n);return r?JSON.parse(r):void 0}catch(n){console.error(n)}}}class Oe extends O.UnleashClient{constructor(t){const n={...t,storageProvider:t.storageProvider??new I(t.appName)};super(n)}}const L=({config:e,startTransition:t=r=>r(),...n})=>{let r=e;return e&&(r={...e,storageProvider:e.storageProvider??new I(e.appName)}),d.createElement(oe,{...n,config:r,startTransition:t})};Object.defineProperty(a,"InMemoryStorageProvider",{enumerable:!0,get:()=>O.InMemoryStorageProvider}),Object.defineProperty(a,"LocalStorageProvider",{enumerable:!0,get:()=>O.LocalStorageProvider}),a.FlagContext=F,a.FlagProvider=L,a.UnleashClient=Oe,a.default=L,a.defaultStorageProvider=I,a.useFlag=ie,a.useFlagsStatus=ae,a.useUnleashClient=de,a.useUnleashContext=ce,a.useVariant=ue,Object.defineProperties(a,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
4
- //# sourceMappingURL=unleash-react-native.umd.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unleash-react-native.umd.cjs","sources":["../node_modules/fast-base64-decode/index.js","../node_modules/react-native-get-random-values/index.js","../node_modules/@unleash/proxy-client-react/dist/unleash-react.js","../node_modules/is-plain-obj/index.js","../node_modules/merge-options/index.js","../node_modules/@react-native-async-storage/async-storage/lib/module/AsyncStorage.js","../src/asyncStorageProvider.ts","../src/unleashClient.ts","../src/FlagProvider.tsx"],"sourcesContent":["'use strict'\n\nvar lookup = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 62, 0, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 63, 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51]\n\nmodule.exports = function base64Decode (source, target) {\n var sourceLength = source.length\n var paddingLength = (source[sourceLength - 2] === '=' ? 2 : (source[sourceLength - 1] === '=' ? 1 : 0))\n\n var tmp\n var byteIndex = 0\n var baseLength = (sourceLength - paddingLength) & 0xfffffffc\n\n for (var i = 0; i < baseLength; i += 4) {\n tmp = (lookup[source.charCodeAt(i)] << 18) | (lookup[source.charCodeAt(i + 1)] << 12) | (lookup[source.charCodeAt(i + 2)] << 6) | (lookup[source.charCodeAt(i + 3)])\n\n target[byteIndex++] = (tmp >> 16) & 0xFF\n target[byteIndex++] = (tmp >> 8) & 0xFF\n target[byteIndex++] = (tmp) & 0xFF\n }\n\n if (paddingLength === 1) {\n tmp = (lookup[source.charCodeAt(i)] << 10) | (lookup[source.charCodeAt(i + 1)] << 4) | (lookup[source.charCodeAt(i + 2)] >> 2)\n\n target[byteIndex++] = (tmp >> 8) & 0xFF\n target[byteIndex++] = tmp & 0xFF\n }\n\n if (paddingLength === 2) {\n tmp = (lookup[source.charCodeAt(i)] << 2) | (lookup[source.charCodeAt(i + 1)] >> 4)\n\n target[byteIndex++] = tmp & 0xFF\n }\n}\n","const base64Decode = require('fast-base64-decode')\nconst { TurboModuleRegistry } = require('react-native')\n\nclass TypeMismatchError extends Error {}\nclass QuotaExceededError extends Error {}\n\nlet warned = false\nfunction insecureRandomValues (array) {\n if (!warned) {\n console.warn('Using an insecure random number generator, this should only happen when running in a debugger without support for crypto.getRandomValues')\n warned = true\n }\n\n for (let i = 0, r; i < array.length; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000\n array[i] = (r >>> ((i & 0x03) << 3)) & 0xff\n }\n\n return array\n}\n\nlet module = null\n/**\n * @param {number} byteLength\n * @returns {string}\n */\nfunction getRandomBase64 (byteLength) {\n if (module == null) {\n module = TurboModuleRegistry.getEnforcing('RNGetRandomValues')\n }\n\n return module.getRandomBase64(byteLength)\n}\n\n/**\n * @param {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Uint8ClampedArray} array\n */\nfunction getRandomValues (array) {\n if (!(array instanceof Int8Array || array instanceof Uint8Array || array instanceof Int16Array || array instanceof Uint16Array || array instanceof Int32Array || array instanceof Uint32Array || array instanceof Uint8ClampedArray)) {\n throw new TypeMismatchError('Expected an integer array')\n }\n\n if (array.byteLength > 65536) {\n throw new QuotaExceededError('Can only request a maximum of 65536 bytes')\n }\n\n // Expo SDK 48+\n if (global.expo?.modules?.ExpoCrypto?.getRandomValues) {\n // ExpoCrypto.getRandomValues doesn't return the array\n global.expo.modules.ExpoCrypto.getRandomValues(array)\n return array\n }\n\n // Calling getRandomBase64 in remote debugging mode leads to the error\n // \"Calling synchronous methods on native modules is not supported in Chrome\".\n // So in that specific case we fall back to just using Math.random().\n if (isRemoteDebuggingInChrome()) {\n return insecureRandomValues(array)\n }\n\n base64Decode(getRandomBase64(array.byteLength), new Uint8Array(array.buffer, array.byteOffset, array.byteLength))\n\n return array\n}\n\nfunction isRemoteDebuggingInChrome () {\n // Remote debugging in Chrome is not supported in bridgeless\n if ('RN$Bridgeless' in global && RN$Bridgeless === true) {\n return false\n }\n\n return __DEV__ && typeof global.nativeCallSyncHook === 'undefined'\n}\n\nif (typeof global.crypto !== 'object') {\n global.crypto = {}\n}\n\nif (typeof global.crypto.getRandomValues !== 'function') {\n global.crypto.getRandomValues = getRandomValues\n}\n","import { UnleashClient as H } from \"unleash-proxy-client\";\nimport { InMemoryStorageProvider as Z, LocalStorageProvider as $, UnleashClient as N } from \"unleash-proxy-client\";\nimport f, { useState as i, useEffect as g, useMemo as C, useContext as M, useRef as k } from \"react\";\nconst A = f.createContext(null), _ = {\n bootstrap: [],\n disableRefresh: !0,\n disableMetrics: !0,\n url: \"http://localhost\",\n appName: \"offline\",\n clientKey: \"not-used\"\n}, q = \"startTransition\", I = f[q] || ((e) => e()), K = ({\n config: e,\n children: r,\n unleashClient: t,\n startClient: a = !0,\n stopClient: u = !0,\n startTransition: s = I\n}) => {\n var E, h, m;\n const l = e || _, o = f.useRef(\n t || new H(l)\n ), [n, F] = f.useState(\n !!(t ? e != null && e.bootstrap && (e == null ? void 0 : e.bootstrapOverride) !== !1 || (E = t.isReady) != null && E.call(t) : l.bootstrap && l.bootstrapOverride !== !1)\n ), [x, b] = i(((m = (h = o.current).getError) == null ? void 0 : m.call(h)) || null);\n g(() => {\n !l && !t && console.error(\n `You must provide either a config or an unleash client to the flag provider.\n If you are initializing the client in useEffect, you can avoid this warning\n by checking if the client exists before rendering.`\n );\n const c = (y) => {\n s(() => {\n b((U) => U || y);\n });\n }, R = (y) => {\n s(() => {\n b(null);\n });\n };\n let p = null;\n const P = () => {\n p = setTimeout(() => {\n s(() => {\n F(!0);\n });\n }, 0);\n };\n return o.current.on(\"ready\", P), o.current.on(\"error\", c), o.current.on(\"recovered\", R), a && (o.current.stop(), o.current.start()), function() {\n o.current && (o.current.off(\"error\", c), o.current.off(\"ready\", P), o.current.off(\"recovered\", R), u && o.current.stop()), p && clearTimeout(p);\n };\n }, []);\n const T = C(\n () => ({\n on: (...c) => o.current.on(...c),\n off: (...c) => o.current.off(...c),\n isEnabled: (...c) => o.current.isEnabled(...c),\n updateContext: async (...c) => await o.current.updateContext(...c),\n getVariant: (...c) => o.current.getVariant(...c),\n client: o.current,\n flagsReady: n,\n flagsError: x,\n setFlagsReady: F,\n setFlagsError: b\n }),\n [n, x]\n );\n return /* @__PURE__ */ f.createElement(A.Provider, { value: T }, r);\n}, S = {\n on: (e, r, t) => (console.error(\"on() must be used within a FlagProvider\"), v),\n off: (e, r) => (console.error(\"off() must be used within a FlagProvider\"), v),\n updateContext: async () => {\n console.error(\"updateContext() must be used within a FlagProvider\");\n },\n isEnabled: () => (console.error(\"isEnabled() must be used within a FlagProvider\"), !1),\n getVariant: () => (console.error(\"getVariant() must be used within a FlagProvider\"), { name: \"disabled\", enabled: !1 })\n}, v = {\n ...S,\n toggles: [],\n impressionDataAll: {},\n context: {},\n storage: {},\n start: () => {\n },\n stop: () => {\n },\n isReady: () => !1,\n getError: () => null,\n getAllToggles: () => []\n}, O = {\n ...S,\n client: v,\n flagsReady: !1,\n setFlagsReady: () => {\n console.error(\"setFlagsReady() must be used within a FlagProvider\");\n },\n flagsError: null,\n setFlagsError: () => {\n console.error(\"setFlagsError() must be used within a FlagProvider\");\n }\n};\nfunction d() {\n const e = M(A);\n return e || (console.error(\"useFlagContext() must be used within a FlagProvider\"), O);\n}\nconst L = (e) => {\n const { isEnabled: r, client: t } = d(), [a, u] = i(!!r(e)), s = k();\n return s.current = a, g(() => {\n if (!t)\n return;\n const l = () => {\n const n = r(e);\n n !== s.current && (s.current = n, u(!!n));\n }, o = () => {\n const n = r(e);\n s.current = n, u(n);\n };\n return t.on(\"update\", l), t.on(\"ready\", o), () => {\n t.off(\"update\", l), t.off(\"ready\", o);\n };\n }, [t]), a;\n}, Y = () => {\n const { client: e } = d(), [r, t] = i(e.getAllToggles());\n return g(() => {\n const a = () => {\n t(e.getAllToggles());\n };\n return e.on(\"update\", a), () => {\n e.off(\"update\", a);\n };\n }, []), r;\n}, j = () => {\n const { flagsReady: e, flagsError: r } = d();\n return { flagsReady: e, flagsError: r };\n}, z = (e, r) => {\n var a, u, s, l;\n return !(e.name === (r == null ? void 0 : r.name) && e.enabled === (r == null ? void 0 : r.enabled) && e.feature_enabled === (r == null ? void 0 : r.feature_enabled) && ((a = e.payload) == null ? void 0 : a.type) === ((u = r == null ? void 0 : r.payload) == null ? void 0 : u.type) && ((s = e.payload) == null ? void 0 : s.value) === ((l = r == null ? void 0 : r.payload) == null ? void 0 : l.value));\n}, G = (e) => {\n const { getVariant: r, client: t } = d(), [a, u] = i(r(e)), s = k({\n name: a.name,\n enabled: a.enabled\n });\n return s.current = a, g(() => {\n if (!t)\n return;\n const l = () => {\n const n = r(e);\n z(s.current, n) && (u(n), s.current = n);\n }, o = () => {\n const n = r(e);\n s.current.name = n == null ? void 0 : n.name, s.current.enabled = n == null ? void 0 : n.enabled, u(n);\n };\n return t.on(\"update\", l), t.on(\"ready\", o), () => {\n t.off(\"update\", l), t.off(\"ready\", o);\n };\n }, [t]), a || {};\n}, J = () => {\n const { updateContext: e } = d();\n return e;\n}, Q = () => {\n const { client: e } = d();\n return e;\n};\nexport {\n A as FlagContext,\n K as FlagProvider,\n Z as InMemoryStorageProvider,\n $ as LocalStorageProvider,\n N as UnleashClient,\n K as default,\n L as useFlag,\n Y as useFlags,\n j as useFlagsStatus,\n Q as useUnleashClient,\n J as useUnleashContext,\n G as useVariant\n};\n//# sourceMappingURL=unleash-react.js.map\n","'use strict';\n\nmodule.exports = value => {\n\tif (Object.prototype.toString.call(value) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn prototype === null || prototype === Object.prototype;\n};\n","'use strict';\nconst isOptionObject = require('is-plain-obj');\n\nconst {hasOwnProperty} = Object.prototype;\nconst {propertyIsEnumerable} = Object;\nconst defineProperty = (object, name, value) => Object.defineProperty(object, name, {\n\tvalue,\n\twritable: true,\n\tenumerable: true,\n\tconfigurable: true\n});\n\nconst globalThis = this;\nconst defaultMergeOptions = {\n\tconcatArrays: false,\n\tignoreUndefined: false\n};\n\nconst getEnumerableOwnPropertyKeys = value => {\n\tconst keys = [];\n\n\tfor (const key in value) {\n\t\tif (hasOwnProperty.call(value, key)) {\n\t\t\tkeys.push(key);\n\t\t}\n\t}\n\n\t/* istanbul ignore else */\n\tif (Object.getOwnPropertySymbols) {\n\t\tconst symbols = Object.getOwnPropertySymbols(value);\n\n\t\tfor (const symbol of symbols) {\n\t\t\tif (propertyIsEnumerable.call(value, symbol)) {\n\t\t\t\tkeys.push(symbol);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn keys;\n};\n\nfunction clone(value) {\n\tif (Array.isArray(value)) {\n\t\treturn cloneArray(value);\n\t}\n\n\tif (isOptionObject(value)) {\n\t\treturn cloneOptionObject(value);\n\t}\n\n\treturn value;\n}\n\nfunction cloneArray(array) {\n\tconst result = array.slice(0, 0);\n\n\tgetEnumerableOwnPropertyKeys(array).forEach(key => {\n\t\tdefineProperty(result, key, clone(array[key]));\n\t});\n\n\treturn result;\n}\n\nfunction cloneOptionObject(object) {\n\tconst result = Object.getPrototypeOf(object) === null ? Object.create(null) : {};\n\n\tgetEnumerableOwnPropertyKeys(object).forEach(key => {\n\t\tdefineProperty(result, key, clone(object[key]));\n\t});\n\n\treturn result;\n}\n\n/**\n * @param {*} merged already cloned\n * @param {*} source something to merge\n * @param {string[]} keys keys to merge\n * @param {Object} config Config Object\n * @returns {*} cloned Object\n */\nconst mergeKeys = (merged, source, keys, config) => {\n\tkeys.forEach(key => {\n\t\tif (typeof source[key] === 'undefined' && config.ignoreUndefined) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Do not recurse into prototype chain of merged\n\t\tif (key in merged && merged[key] !== Object.getPrototypeOf(merged)) {\n\t\t\tdefineProperty(merged, key, merge(merged[key], source[key], config));\n\t\t} else {\n\t\t\tdefineProperty(merged, key, clone(source[key]));\n\t\t}\n\t});\n\n\treturn merged;\n};\n\n/**\n * @param {*} merged already cloned\n * @param {*} source something to merge\n * @param {Object} config Config Object\n * @returns {*} cloned Object\n *\n * see [Array.prototype.concat ( ...arguments )](http://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.concat)\n */\nconst concatArrays = (merged, source, config) => {\n\tlet result = merged.slice(0, 0);\n\tlet resultIndex = 0;\n\n\t[merged, source].forEach(array => {\n\t\tconst indices = [];\n\n\t\t// `result.concat(array)` with cloning\n\t\tfor (let k = 0; k < array.length; k++) {\n\t\t\tif (!hasOwnProperty.call(array, k)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tindices.push(String(k));\n\n\t\t\tif (array === merged) {\n\t\t\t\t// Already cloned\n\t\t\t\tdefineProperty(result, resultIndex++, array[k]);\n\t\t\t} else {\n\t\t\t\tdefineProperty(result, resultIndex++, clone(array[k]));\n\t\t\t}\n\t\t}\n\n\t\t// Merge non-index keys\n\t\tresult = mergeKeys(result, array, getEnumerableOwnPropertyKeys(array).filter(key => !indices.includes(key)), config);\n\t});\n\n\treturn result;\n};\n\n/**\n * @param {*} merged already cloned\n * @param {*} source something to merge\n * @param {Object} config Config Object\n * @returns {*} cloned Object\n */\nfunction merge(merged, source, config) {\n\tif (config.concatArrays && Array.isArray(merged) && Array.isArray(source)) {\n\t\treturn concatArrays(merged, source, config);\n\t}\n\n\tif (!isOptionObject(source) || !isOptionObject(merged)) {\n\t\treturn clone(source);\n\t}\n\n\treturn mergeKeys(merged, source, getEnumerableOwnPropertyKeys(source), config);\n}\n\nmodule.exports = function (...options) {\n\tconst config = merge(clone(defaultMergeOptions), (this !== globalThis && this) || {}, defaultMergeOptions);\n\tlet merged = {_: {}};\n\n\tfor (const option of options) {\n\t\tif (option === undefined) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!isOptionObject(option)) {\n\t\t\tthrow new TypeError('`' + option + '` is not an Option Object');\n\t\t}\n\n\t\tmerged = merge(merged, {_: option}, config);\n\t}\n\n\treturn merged._;\n};\n","\"use strict\";\n\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport mergeOptions from \"merge-options\";\n\n// eslint-disable-next-line @typescript-eslint/ban-types\n\n// eslint-disable-next-line @typescript-eslint/ban-types\n\nconst merge = mergeOptions.bind({\n concatArrays: true,\n ignoreUndefined: true\n});\nfunction mergeLocalStorageItem(key, value) {\n const oldValue = window.localStorage.getItem(key);\n if (oldValue) {\n const oldObject = JSON.parse(oldValue);\n const newObject = JSON.parse(value);\n const nextValue = JSON.stringify(merge(oldObject, newObject));\n window.localStorage.setItem(key, nextValue);\n } else {\n window.localStorage.setItem(key, value);\n }\n}\nfunction createPromise(getValue, callback) {\n return new Promise((resolve, reject) => {\n try {\n const value = getValue();\n callback?.(null, value);\n resolve(value);\n } catch (err) {\n callback?.(err);\n reject(err);\n }\n });\n}\nfunction createPromiseAll(promises, callback, processResult) {\n return Promise.all(promises).then(result => {\n const value = processResult?.(result) ?? null;\n callback?.(null, value);\n return Promise.resolve(value);\n }, errors => {\n callback?.(errors);\n return Promise.reject(errors);\n });\n}\nconst AsyncStorage = {\n /**\n * Fetches `key` value.\n */\n getItem: (key, callback) => {\n return createPromise(() => window.localStorage.getItem(key), callback);\n },\n /**\n * Sets `value` for `key`.\n */\n setItem: (key, value, callback) => {\n return createPromise(() => window.localStorage.setItem(key, value), callback);\n },\n /**\n * Removes a `key`\n */\n removeItem: (key, callback) => {\n return createPromise(() => window.localStorage.removeItem(key), callback);\n },\n /**\n * Merges existing value with input value, assuming they are stringified JSON.\n */\n mergeItem: (key, value, callback) => {\n return createPromise(() => mergeLocalStorageItem(key, value), callback);\n },\n /**\n * Erases *all* AsyncStorage for the domain.\n */\n clear: callback => {\n return createPromise(() => window.localStorage.clear(), callback);\n },\n /**\n * Gets *all* keys known to the app, for all callers, libraries, etc.\n */\n getAllKeys: callback => {\n return createPromise(() => {\n const numberOfKeys = window.localStorage.length;\n const keys = [];\n for (let i = 0; i < numberOfKeys; i += 1) {\n const key = window.localStorage.key(i) || \"\";\n keys.push(key);\n }\n return keys;\n }, callback);\n },\n /**\n * (stub) Flushes any pending requests using a single batch call to get the data.\n */\n flushGetRequests: () => undefined,\n /**\n * multiGet resolves to an array of key-value pair arrays that matches the\n * input format of multiSet.\n *\n * multiGet(['k1', 'k2']) -> [['k1', 'val1'], ['k2', 'val2']]\n */\n multiGet: (keys, callback) => {\n const promises = keys.map(key => AsyncStorage.getItem(key));\n const processResult = result => result.map((value, i) => [keys[i], value]);\n return createPromiseAll(promises, callback, processResult);\n },\n /**\n * Takes an array of key-value array pairs.\n * multiSet([['k1', 'val1'], ['k2', 'val2']])\n */\n multiSet: (keyValuePairs, callback) => {\n const promises = keyValuePairs.map(item => AsyncStorage.setItem(item[0], item[1]));\n return createPromiseAll(promises, callback);\n },\n /**\n * Delete all the keys in the `keys` array.\n */\n multiRemove: (keys, callback) => {\n const promises = keys.map(key => AsyncStorage.removeItem(key));\n return createPromiseAll(promises, callback);\n },\n /**\n * Takes an array of key-value array pairs and merges them with existing\n * values, assuming they are stringified JSON.\n *\n * multiMerge([['k1', 'val1'], ['k2', 'val2']])\n */\n multiMerge: (keyValuePairs, callback) => {\n const promises = keyValuePairs.map(item => AsyncStorage.mergeItem(item[0], item[1]));\n return createPromiseAll(promises, callback);\n }\n};\nexport default AsyncStorage;\n//# sourceMappingURL=AsyncStorage.js.map","import AsyncStorage from '@react-native-async-storage/async-storage'\nimport type { IStorageProvider } from 'unleash-proxy-client'\n\nexport class AsyncStorageProvider implements IStorageProvider {\n private prefix: string\n\n constructor(name = 'unleash:repository') {\n this.prefix = name\n }\n\n // biome-ignore lint/suspicious/noExplicitAny: any is used to match the IStorageProvider interface\n public async save(name: string, data: any) {\n try {\n const repo = JSON.stringify(data)\n const key = `${this.prefix}:${name}`\n await AsyncStorage.setItem(key, repo)\n } catch (e) {\n console.error(e)\n }\n }\n\n public async get(name: string) {\n try {\n const key = `${this.prefix}:${name}`\n const data = await AsyncStorage.getItem(key)\n return data ? JSON.parse(data) : undefined\n } catch (e) {\n console.error(e)\n }\n }\n}\n","import {\n UnleashClient as BaseUnleashClient,\n type IConfig\n} from 'unleash-proxy-client'\nimport { AsyncStorageProvider } from './asyncStorageProvider'\n\nexport class UnleashClient extends BaseUnleashClient {\n constructor(config: IConfig) {\n const reactNativeConfig = {\n ...config,\n storageProvider:\n config.storageProvider ?? new AsyncStorageProvider(config.appName)\n }\n\n super(reactNativeConfig)\n }\n}\n","import React, { type PropsWithChildren } from 'react'\nimport {\n FlagProvider as BaseFlagProvider,\n type IFlagProvider\n} from '@unleash/proxy-client-react'\nimport { AsyncStorageProvider } from './asyncStorageProvider'\n\nexport const FlagProvider = ({\n config,\n startTransition = fn => fn(),\n ...props\n}: PropsWithChildren<IFlagProvider>) => {\n let reactNativeConfig = config\n if (config) {\n reactNativeConfig = {\n ...config,\n storageProvider:\n config.storageProvider ?? new AsyncStorageProvider(config.appName)\n }\n }\n\n return (\n <BaseFlagProvider\n {...props}\n config={reactNativeConfig}\n startTransition={startTransition}\n />\n )\n}\n\nexport default FlagProvider\n"],"names":["lookup","fastBase64Decode","source","target","sourceLength","paddingLength","tmp","byteIndex","baseLength","base64Decode","require$$0","TurboModuleRegistry","require$$1","TypeMismatchError","QuotaExceededError","warned","insecureRandomValues","array","i","r","module","getRandomBase64","byteLength","getRandomValues","global","isRemoteDebuggingInChrome","A","f","_","q","I","K","t","a","u","E","h","m","l","o","H","n","F","x","b","g","c","y","U","R","p","P","T","C","S","v","O","d","M","L","k","j","z","s","G","J","Q","isPlainObj","value","prototype","isOptionObject","hasOwnProperty","propertyIsEnumerable","defineProperty","object","name","globalThis","this","defaultMergeOptions","getEnumerableOwnPropertyKeys","keys","key","symbols","symbol","clone","cloneArray","cloneOptionObject","result","mergeKeys","merged","config","merge","concatArrays","resultIndex","indices","mergeOptions","options","option","mergeLocalStorageItem","oldValue","oldObject","newObject","nextValue","createPromise","getValue","callback","resolve","reject","err","createPromiseAll","promises","processResult","errors","AsyncStorage","numberOfKeys","keyValuePairs","item","AsyncStorageProvider","data","repo","e","UnleashClient","BaseUnleashClient","reactNativeConfig","FlagProvider","startTransition","fn","props","React","BaseFlagProvider"],"mappings":"umBAEA,IAAIA,EAAS,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,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