@feedmepos/mf-connect 0.1.117-dev → 0.1.118-dev

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.
Files changed (135) hide show
  1. package/README.md +12 -8
  2. package/dist/{App-BpcsgH7K.js → App-CBFNBDb2.js} +275 -275
  3. package/dist/{AuditLogs-BNnUiVnD.js → AuditLogs-BtSA8b08.js} +13 -13
  4. package/dist/{Bin-Cm0wjQeR.js → Bin-CjmS_Tfn.js} +8 -8
  5. package/dist/{Broadcast-BoJaHqnO.js → Broadcast-BeePmZa1.js} +12 -12
  6. package/dist/{CampaignAnalytic-Eg4xZW0B.js → CampaignAnalytic-CZlnyvOi.js} +7 -7
  7. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BXylK6Ze.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Du3Ah4HP.js} +9 -9
  8. package/dist/{Card-BfkMcFaG.js → Card-C8SzQQ0z.js} +23 -23
  9. package/dist/{Collections-RXmxQbII.js → Collections-BXNWTSZH.js} +8 -8
  10. package/dist/{Credit-CsRPM1jv.js → Credit-CK0-0yD1.js} +12 -12
  11. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-D2tvK7pw.js → DateRangeChip.vue_vue_type_script_setup_true_lang-BXYpYC7Y.js} +1 -1
  12. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BgPeHurN.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CdpnNDzR.js} +1042 -1045
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CUx8UIIq.js → EffectSheet.vue_vue_type_style_index_0_lang--Oyj3KYg.js} +6 -6
  14. package/dist/{Experience-BC8Pj-v9.js → Experience-CWJaj62g.js} +13 -13
  15. package/dist/{FileSaver.min-DzmoQFA0.js → FileSaver.min-lV9H82L5.js} +1 -1
  16. package/dist/{Game-DJXNHFBs.js → Game-zBV1LYAg.js} +13 -13
  17. package/dist/{GiftCardSetup-_0n8lU-t.js → GiftCardSetup-Cnq9353j.js} +10 -10
  18. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-C-AiJdui.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-CdgSBdrX.js} +7 -7
  19. package/dist/{Goals-DSZwKpds.js → Goals-Utk08egN.js} +4 -4
  20. package/dist/{Grab-DDc7e-AC.js → Grab-DwMmWmbT.js} +9 -9
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BZb-H4fM.js → ImageInput.vue_vue_type_script_setup_true_lang-CNPeU9xm.js} +1 -1
  22. package/dist/{Index-Cbi0bquE.js → Index-Bjgs18xf.js} +10 -10
  23. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-GLhMtvzi.js → LocationPicker.vue_vue_type_script_setup_true_lang-DWnf4lXH.js} +1 -1
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-Bt9CO_QR.js → LottieAnimation.vue_vue_type_script_setup_true_lang-Dy_oWJaZ.js} +1 -1
  25. package/dist/{LoyaltyDashboard-fK90c27A.js → LoyaltyDashboard-DmUfujX_.js} +15 -15
  26. package/dist/{MainLayout-Bf-l9yL4.js → MainLayout-DlDZQJfy.js} +1 -1
  27. package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-COR6YYYI.js → MainLayout.vue_vue_type_script_setup_true_lang-yAflY70k.js} +3 -3
  28. package/dist/{Marketing-B7cZGsO-.js → Marketing-B0iKlHP-.js} +4 -4
  29. package/dist/{MarketingMaterialEdit-5IcV2ct6.js → MarketingMaterialEdit-BNHxVb8A.js} +6 -6
  30. package/dist/{Member-BGTrRVdq.js → Member-Bcm3_pWB.js} +7 -7
  31. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-DJr2hV2W.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-CPp4OpOx.js} +24 -24
  32. package/dist/{MemberImportHistory--FxkTJmu.js → MemberImportHistory-AQgLzB3g.js} +7 -7
  33. package/dist/{MemberList-EjY5dgwt.js → MemberList-CkMTo2uD.js} +14 -14
  34. package/dist/{MemberTransactions-Oia7LIFK.js → MemberTransactions-CxLCVjvw.js} +1 -1
  35. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CLOQZCYy.js → MessageInput.vue_vue_type_script_setup_true_lang-4N20f8Sj.js} +10 -10
  36. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Ev3bB8cg.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DghbYpSQ.js} +1 -1
  37. package/dist/{Mission-BFHYb4aT.js → Mission-CQS1CoDN.js} +14 -14
  38. package/dist/{Overview-BVNyQxFL.js → Overview-NQ287sgq.js} +21 -21
  39. package/dist/{Overview-d5U37aot.js → Overview-UG1IjY7-.js} +4 -4
  40. package/dist/{Point-CXkqH02Z.js → Point-krMa_mb1.js} +14 -14
  41. package/dist/{Promotion-DdxNvlOO.js → Promotion-vFBmJSti.js} +14 -14
  42. package/dist/{Queue-C96oNKyP.js → Queue-BusxSPt-.js} +13 -13
  43. package/dist/{Record-Bj2e2Y4i.js → Record-DjKqn0za.js} +9 -9
  44. package/dist/{Review-CJK5S1oI.js → Review-CqLp8l7U.js} +2 -2
  45. package/dist/{ReviewFacebookCallback-ChG7TRy5.js → ReviewFacebookCallback-D2kMSVFC.js} +5 -5
  46. package/dist/{ReviewGoogleCallback-Dmk4VyGA.js → ReviewGoogleCallback-B1cHR-o2.js} +5 -5
  47. package/dist/Reward-FeSxgzuS.js +444 -0
  48. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-U47m3AAn.js → RewardGroup.vue_vue_type_script_setup_true_lang-CCxVjBsO.js} +14 -14
  49. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-2L6ZGMW7.js → RuleGroup.vue_vue_type_script_setup_true_lang-U403emCF.js} +15 -15
  50. package/dist/{Segment-FYvtCkqH.js → Segment-Nj59F9Nr.js} +26 -26
  51. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DPZZz2e0.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-Kg9m-0DS.js} +15 -15
  52. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-D8wBgLlS.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BLbDApPL.js} +4 -4
  53. package/dist/{Setting-CUAWjCqa.js → Setting-CCIzNxv-.js} +14 -14
  54. package/dist/{SettingAdvertisements-COIQwUD6.js → SettingAdvertisements-CkPyAg5y.js} +12 -12
  55. package/dist/{Settings-D2gFPvmW.js → Settings-CYjKGCpa.js} +5 -5
  56. package/dist/{Store-BAXwiyvx.js → Store-Bp8Zkzi2.js} +27 -27
  57. package/dist/{StoreRewards-2mUavtUg.js → StoreRewards-DXW5nVyW.js} +15 -15
  58. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-5g3yIL1a.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BYVezFI2.js} +25 -25
  59. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DHi4rdT1.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CS6b1cM3.js} +2 -2
  60. package/dist/{Tier-BmAOzRHL.js → Tier-B8Utn9Qb.js} +27 -27
  61. package/dist/{Title-DMxiUg30.js → Title-CwaNSFer.js} +23 -23
  62. package/dist/{Transaction-CF6hXEpN.js → Transaction-ieciAdXP.js} +2 -2
  63. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BON_t0dL.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CMwZl4E6.js} +6 -6
  64. package/dist/{Voucher-DrtITxq-.js → Voucher-BKfujj6r.js} +18 -18
  65. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-1DZOzJKx.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CkH-rNqZ.js} +12 -12
  66. package/dist/{WhatsappAccount-Bb0Y7ikk.js → WhatsappAccount-D73WDP7a.js} +66 -64
  67. package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-CPlyzkp4.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-C3L7vWZE.js} +1 -1
  68. package/dist/{WhatsappBot-DNvvaPey.js → WhatsappBot-DTWZAXhi.js} +324 -322
  69. package/dist/{WhatsappBotLogs-C8M-1pvv.js → WhatsappBotLogs-DtDcrjs9.js} +11 -11
  70. package/dist/{WhatsappBotSettings-D6egqUyU.js → WhatsappBotSettings-7_mH9U4y.js} +287 -288
  71. package/dist/WhatsappLayout-BVpaFJ8H.js +21 -0
  72. package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-CMeaNKJt.js +261 -0
  73. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CKZscSjU.js → ZodTextField.vue_vue_type_script_setup_true_lang-BO1zA9AR.js} +2 -2
  74. package/dist/{app-BjdLqYQq.js → app-DX7OWVY2.js} +528 -524
  75. package/dist/app.js +1 -1
  76. package/dist/{base.export-B68z5BF6.js → base.export-bamzzexi.js} +2 -2
  77. package/dist/{business-D9fgkHxb.js → business-D3U9HSu9.js} +1 -1
  78. package/dist/{campaign-Dw_ujovr.js → campaign-BqRf2VUO.js} +8 -8
  79. package/dist/{campaign-eMaPX8r6.js → campaign-CKfeN2xN.js} +2 -2
  80. package/dist/{campaign.fn-DFjGNvmN.js → campaign.fn-DQe5LZuT.js} +38 -38
  81. package/dist/{collection.fn-CCOWtB-c.js → collection.fn-BcGqExuE.js} +2 -2
  82. package/dist/{currency-CTLKReFC.js → currency-sjMYWoI8.js} +1 -1
  83. package/dist/{duplicateCampaign-BcpBfUGL.js → duplicateCampaign-CJF3ZLNd.js} +2 -2
  84. package/dist/{effect-CTI1ZH57.js → effect-Cv8ugBR3.js} +1 -1
  85. package/dist/{email-addresses-B74e3bnB.js → email-addresses-CWqtseTn.js} +2 -2
  86. package/dist/{feature-flag-DVdEaChJ.js → feature-flag-BIh6MM4i.js} +159 -159
  87. package/dist/{helper-as9K-piK.js → helper-WnxOxoRK.js} +1 -1
  88. package/dist/{index-CHU3UePP.js → index-5TTGGDnF.js} +1 -1
  89. package/dist/{index-Ba719MYq.js → index-B3CkAr-6.js} +1 -1
  90. package/dist/{index-Czg-2Ni0.js → index-B9XVyhtC.js} +3 -3
  91. package/dist/{index-BW7FoVEA.js → index-BGguMtc0.js} +1 -1
  92. package/dist/{index-BbVbqe4Y.js → index-Bdg48Cus.js} +2 -2
  93. package/dist/{index-B_wRpO02.js → index-BoAmM8QH.js} +2 -2
  94. package/dist/{index-TAoQpeLQ.js → index-BtmVXdRR.js} +1 -1
  95. package/dist/{index-3LjKJhQa.js → index-CDTETsXQ.js} +1 -1
  96. package/dist/{index-DKI8401o.js → index-CeafUn1o.js} +2 -2
  97. package/dist/{index-QHqcSN2q.js → index-CiSTQhs9.js} +1 -1
  98. package/dist/{index-C5V6u2Qd.js → index-ClvaVYkG.js} +2 -2
  99. package/dist/{index-CWLOcQ6j.js → index-CnsSd5Dg.js} +9 -9
  100. package/dist/{index-B0h0iYWP.js → index-D3yYjyaj.js} +2 -2
  101. package/dist/{index-8mBfDn3M.js → index-DDzi_-Lu.js} +7 -7
  102. package/dist/{index-Ckz6u3ac.js → index-DOgDR_QH.js} +2 -2
  103. package/dist/{index-BEKMTiFb.js → index-DqZX-A6e.js} +3 -3
  104. package/dist/{index-DcZiikOH.js → index-DxhNNZ-a.js} +2 -2
  105. package/dist/{index-wsCCqwdr.js → index-DzYFQGSw.js} +2 -2
  106. package/dist/{index-C-iwb2Ln.js → index-I9lmcd2w.js} +2 -2
  107. package/dist/{index-CQxkDpX0.js → index-iiWxryxo.js} +4 -4
  108. package/dist/{index-BhTrG89b.js → index-qI1yx02a.js} +4 -4
  109. package/dist/{index.esm2017-DL6rTGDW.js → index.esm2017-GI2alVO5.js} +1 -1
  110. package/dist/{loading-x6IScY4K.js → loading-Qx5K2WL0.js} +1 -1
  111. package/dist/{lodash-nwnDizYo.js → lodash-CeSjJptg.js} +1 -1
  112. package/dist/{member-import-C-b01Tyd.js → member-import-Cq8G7SsW.js} +1 -1
  113. package/dist/{membership-DfarOMtO.js → membership-BbeavSNs.js} +2 -2
  114. package/dist/{money-CFn-jR4W.js → money-D8YIFaGA.js} +1 -1
  115. package/dist/{number-CSlyDL2x.js → number-DAubZ5bt.js} +1 -1
  116. package/dist/{objectid-zcT6ESET.js → objectid-DeXFWDMh.js} +6 -6
  117. package/dist/{onboarding-DyaFaaF2.js → onboarding-SyFxaTJY.js} +3 -3
  118. package/dist/{onboardingSetup-DQt91O9f.js → onboardingSetup-CLpHlBn8.js} +2 -2
  119. package/dist/{plugins-DEHr0UOe.js → plugins-BHuaMEYA.js} +3 -3
  120. package/dist/{reward-Du_Pv-4p.js → reward-dYWnmAC8.js} +1 -1
  121. package/dist/{rule-DfqmQTVK.js → rule-BVsfOP2h.js} +10 -10
  122. package/dist/{template-CcbNF4PF.js → template-BcdtbhUJ.js} +6 -6
  123. package/dist/{timezone-_4tabIaK.js → timezone-CUc7q5Ii.js} +1 -1
  124. package/dist/{transaction.fn-C46PHwCV.js → transaction.fn-jF9u_cBy.js} +2 -2
  125. package/dist/{trigger-Dipr6btC.js → trigger-COlbQlaB.js} +5 -5
  126. package/dist/{useMarketingMaterialActions-BAw2ZjeF.js → useMarketingMaterialActions-Dq6-gsOW.js} +4 -4
  127. package/dist/{usePagination-D6RZ18zS.js → usePagination-BYZB6ORK.js} +1 -1
  128. package/dist/{user-BCexQj3Q.js → user-DK7L8VFR.js} +1 -1
  129. package/dist/{vue-i18n-DXvyTCZf.js → vue-i18n-CDSTH7g5.js} +162 -162
  130. package/dist/{xlsx-BTxt_Jg6.js → xlsx-CKxXlDzD.js} +1 -1
  131. package/dist/{zod-T4wMYjWT.js → zod-DjtAaF0U.js} +1 -1
  132. package/package.json +1 -1
  133. package/dist/Reward-Dh2YI0Xb.js +0 -442
  134. package/dist/WhatsappLayout-DeQTPuF6.js +0 -21
  135. package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DI0pcHcE.js +0 -253
@@ -1,9 +1,9 @@
1
- var ce = Object.defineProperty;
2
- var he = (m, u, d) => u in m ? ce(m, u, { enumerable: !0, configurable: !0, writable: !0, value: d }) : m[u] = d;
3
- var st = (m, u, d) => he(m, typeof u != "symbol" ? u + "" : u, d);
4
- import { ref as ct, readonly as Ut } from "vue";
5
- import { c as lt } from "./app-BjdLqYQq.js";
6
- import { useCoreStore as de } from "@feedmepos/mf-common";
1
+ var de = Object.defineProperty;
2
+ var ve = (m, u, d) => u in m ? de(m, u, { enumerable: !0, configurable: !0, writable: !0, value: d }) : m[u] = d;
3
+ var st = (m, u, d) => ve(m, typeof u != "symbol" ? u + "" : u, d);
4
+ import { ref as ht, readonly as Rt } from "vue";
5
+ import { c as lt } from "./app-DX7OWVY2.js";
6
+ import { useCoreStore as ae } from "@feedmepos/mf-common";
7
7
  var Kt = { exports: {} };
8
8
  (function(m, u) {
9
9
  (function(d, v) {
@@ -39,7 +39,7 @@ var Kt = { exports: {} };
39
39
  return a;
40
40
  }, s.apply(this, arguments);
41
41
  };
42
- function w(a, e, t, i) {
42
+ function T(a, e, t, i) {
43
43
  return new (t || (t = Promise))(function(n, r) {
44
44
  function o(f) {
45
45
  try {
@@ -64,7 +64,7 @@ var Kt = { exports: {} };
64
64
  h((i = i.apply(a, [])).next());
65
65
  });
66
66
  }
67
- function H(a, e) {
67
+ function z(a, e) {
68
68
  var t, i, n, r, o = { label: 0, sent: function() {
69
69
  if (1 & n[0]) throw n[1];
70
70
  return n[1];
@@ -173,13 +173,13 @@ var Kt = { exports: {} };
173
173
  return [t, G(i) ? i : { value: i }];
174
174
  }));
175
175
  }
176
- function ht(a) {
176
+ function dt(a) {
177
177
  return s(s({}, a), { identity: a.identity ? s(s({}, a.identity), { traits: at(a.identity.traits || {}) }) : void 0 });
178
178
  }
179
179
  (function(a) {
180
180
  a.NONE = "NONE", a.DEFAULT_FLAGS = "DEFAULT_FLAGS", a.CACHE = "CACHE", a.SERVER = "SERVER";
181
181
  })(g || (g = {}));
182
- var dt, O = null, re = "FLAGSMITH_EVENT", rt = re, Dt = "https://edge.api.flagsmith.com/api/v1/", Gt = "flagsmith_value_", Jt = "flagsmith_enabled_", Vt = "flagsmith_trait_", oe = function() {
182
+ var vt, w = null, se = "FLAGSMITH_EVENT", rt = se, Dt = "https://edge.api.flagsmith.com/api/v1/", Gt = "flagsmith_value_", Jt = "flagsmith_enabled_", Bt = "flagsmith_trait_", le = function() {
183
183
  function a(e) {
184
184
  var t = this;
185
185
  this._trigger = null, this._triggerLoadingState = null, this.timestamp = null, this.isLoading = !1, this.eventSource = null, this.getFlags = function() {
@@ -188,23 +188,23 @@ var Kt = { exports: {} };
188
188
  var o = "".concat(t.getContext().identity), c = function(h) {
189
189
  var f, l, p, F;
190
190
  if (h && o === "".concat(t.getContext().identity)) {
191
- var P = h.flags, I = h.traits, N = h.identifier;
191
+ var P = h.flags, O = h.traits, j = h.identifier;
192
192
  t.isLoading = !1;
193
- var A = {}, L = {};
194
- I = I || [], (P = P || []).forEach(function(y) {
195
- A[y.feature.name.toLowerCase().replace(/ /g, "_")] = { id: y.feature.id, enabled: y.enabled, value: y.feature_state_value };
196
- }), I.forEach(function(y) {
197
- L[y.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: y.transient, value: y.trait_value };
193
+ var I = {}, A = {};
194
+ O = O || [], (P = P || []).forEach(function(y) {
195
+ I[y.feature.name.toLowerCase().replace(/ /g, "_")] = { id: y.feature.id, enabled: y.enabled, value: y.feature_state_value };
196
+ }), O.forEach(function(y) {
197
+ A[y.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: y.transient, value: y.trait_value };
198
198
  }), t.oldFlags = s({}, t.flags);
199
- var k = _(t.oldFlags, A), Y = _((f = t.evaluationContext.identity) === null || f === void 0 ? void 0 : f.traits, L);
200
- if ((N || Object.keys(L).length) && (t.evaluationContext.identity = s(s({}, t.evaluationContext.identity), { traits: L }), N && (t.evaluationContext.identity.identifier = N)), t.flags = A, t.updateStorage(), t._onChange(t.oldFlags, { isFromServer: !0, flagsChanged: k, traitsChanged: Y }, t._loadedState(null, g.SERVER)), t.datadogRum) try {
199
+ var k = _(t.oldFlags, I), Q = _((f = t.evaluationContext.identity) === null || f === void 0 ? void 0 : f.traits, A);
200
+ if ((j || Object.keys(A).length) && (t.evaluationContext.identity = s(s({}, t.evaluationContext.identity), { traits: A }), j && (t.evaluationContext.identity.identifier = j)), t.flags = I, t.updateStorage(), t._onChange(t.oldFlags, { isFromServer: !0, flagsChanged: k, traitsChanged: Q }, t._loadedState(null, g.SERVER)), t.datadogRum) try {
201
201
  if (t.datadogRum.trackTraits) {
202
- var Q = {};
202
+ var W = {};
203
203
  Object.keys(((l = t.evaluationContext.identity) === null || l === void 0 ? void 0 : l.traits) || {}).map(function(y) {
204
- Q[Vt + y] = t.getTrait(y);
204
+ W[Bt + y] = t.getTrait(y);
205
205
  });
206
- var M = s(s(s({}, t.datadogRum.client.getUser()), { id: t.datadogRum.client.getUser().id || ((p = t.evaluationContext.identity) === null || p === void 0 ? void 0 : p.identifier) }), Q);
207
- t.log("Setting Datadog user", M), t.datadogRum.client.setUser(M);
206
+ var $ = s(s(s({}, t.datadogRum.client.getUser()), { id: t.datadogRum.client.getUser().id || ((p = t.evaluationContext.identity) === null || p === void 0 ? void 0 : p.identifier) }), W);
207
+ t.log("Setting Datadog user", $), t.datadogRum.client.setUser($);
208
208
  }
209
209
  } catch (y) {
210
210
  console.error(y);
@@ -214,7 +214,7 @@ var Kt = { exports: {} };
214
214
  Object.keys(t.flags).map(function(y) {
215
215
  b(E, Gt + y, t.getValue(y, { skipAnalytics: !0 })), b(E, Jt + y, t.hasFeature(y, { skipAnalytics: !0 }));
216
216
  }), Object.keys(((F = t.evaluationContext.identity) === null || F === void 0 ? void 0 : F.traits) || {}).map(function(y) {
217
- b(E, Vt + y, t.getTrait(y));
217
+ b(E, Bt + y, t.getTrait(y));
218
218
  }), t.log("Sending javaLongOrObject traits to dynatrace", E.javaLongOrObject), t.log("Sending date traits to dynatrace", E.date), t.log("Sending shortString traits to dynatrace", E.shortString), t.log("Sending javaDouble to dynatrace", E.javaDouble), t.dtrum.sendSessionProperties(E.javaLongOrObject, E.date, E.shortString, E.javaDouble);
219
219
  } catch (y) {
220
220
  console.error(y);
@@ -263,7 +263,7 @@ var Kt = { exports: {} };
263
263
  return [r, o == null ? void 0 : o.value];
264
264
  }));
265
265
  }, this.setContext = function(i) {
266
- var n = ht(i);
266
+ var n = dt(i);
267
267
  return t.evaluationContext = s(s({}, n), { environment: n.environment || t.evaluationContext.environment }), t.initialised ? t.getFlags() : Promise.resolve();
268
268
  }, this.getContext = function() {
269
269
  return t.evaluationContext;
@@ -292,26 +292,26 @@ var Kt = { exports: {} };
292
292
  t.evaluationContext.environment && (f.headers["X-Environment-Key"] = t.evaluationContext.environment.apiKey), n && n !== "GET" && (f.headers["Content-Type"] = "application/json; charset=utf-8"), h && Object.assign(f.headers, h), C || console.error("Flagsmith: fetch is undefined, please specify a fetch implementation into flagsmith.init to support SSR.");
293
293
  var l = "".concat((o = t.evaluationContext.identity) === null || o === void 0 ? void 0 : o.identifier);
294
294
  return C(i, f).then(function(p) {
295
- var F, P, I = "".concat((F = t.evaluationContext.identity) === null || F === void 0 ? void 0 : F.identifier);
296
- if (l === I) {
297
- var N = (P = p.headers) === null || P === void 0 ? void 0 : P.get("x-flagsmith-document-updated-at");
298
- if (N) try {
299
- var A = parseFloat(N);
300
- if (isNaN(A)) return Promise.reject("Failed to parse x-flagsmith-document-updated-at");
301
- t.timestamp = A;
302
- } catch (L) {
303
- t.log(L, "Failed to parse x-flagsmith-document-updated-at", N);
295
+ var F, P, O = "".concat((F = t.evaluationContext.identity) === null || F === void 0 ? void 0 : F.identifier);
296
+ if (l === O) {
297
+ var j = (P = p.headers) === null || P === void 0 ? void 0 : P.get("x-flagsmith-document-updated-at");
298
+ if (j) try {
299
+ var I = parseFloat(j);
300
+ if (isNaN(I)) return Promise.reject("Failed to parse x-flagsmith-document-updated-at");
301
+ t.timestamp = I;
302
+ } catch (A) {
303
+ t.log(A, "Failed to parse x-flagsmith-document-updated-at", j);
304
304
  }
305
- return t.log("Fetch response: " + p.status + " " + (n || "GET") + 0 + i), p.text().then(function(L) {
306
- var k = L;
305
+ return t.log("Fetch response: " + p.status + " " + (n || "GET") + 0 + i), p.text().then(function(A) {
306
+ var k = A;
307
307
  try {
308
- k = JSON.parse(L);
308
+ k = JSON.parse(A);
309
309
  } catch {
310
310
  }
311
311
  return !k && p.status && (k = "API Response: ".concat(p.status)), p.status && p.status >= 200 && p.status < 300 ? k : Promise.reject(new Error(k));
312
312
  });
313
313
  }
314
- t.log("Received response with identity mismatch, ignoring response. Requested: ".concat(l, ", Current: ").concat(I));
314
+ t.log("Received response with identity mismatch, ignoring response. Requested: ".concat(l, ", Current: ").concat(O));
315
315
  });
316
316
  }, this.evaluateFlag = function(i, n) {
317
317
  if (t.datadogRum && (t.datadogRum.client.addFeatureFlagEvaluation ? n === "VALUE" ? t.datadogRum.client.addFeatureFlagEvaluation(Gt + i, t.getValue(i, {}, !0)) : t.datadogRum.client.addFeatureFlagEvaluation(Jt + i, t.hasFeature(i, !0)) : console.error("Flagsmith: Your datadog RUM client does not support the function addFeatureFlagEvaluation, please update it.")), t.enableAnalytics) {
@@ -322,125 +322,125 @@ var Kt = { exports: {} };
322
322
  }, this._onChange = function(i, n, r) {
323
323
  var o, c;
324
324
  t.setLoadingState(r), (o = t.onChange) === null || o === void 0 || o.call(t, i, n, t.loadingState), (c = t._trigger) === null || c === void 0 || c.call(t);
325
- }, C = e.fetch ? e.fetch : typeof fetch < "u" ? fetch : lt === null || lt === void 0 ? void 0 : lt.fetch, this.canUseStorage = typeof window < "u" || !!e.browserlessStorage, this.log("Constructing flagsmith instance " + e), e.eventSource && (dt = e.eventSource), e.AsyncStorage && (O = e.AsyncStorage);
325
+ }, C = e.fetch ? e.fetch : typeof fetch < "u" ? fetch : lt === null || lt === void 0 ? void 0 : lt.fetch, this.canUseStorage = typeof window < "u" || !!e.browserlessStorage, this.log("Constructing flagsmith instance " + e), e.eventSource && (vt = e.eventSource), e.AsyncStorage && (w = e.AsyncStorage);
326
326
  }
327
327
  return a.prototype.init = function(e) {
328
328
  var t, i, n;
329
- return w(this, void 0, void 0, function() {
330
- var r, o, c, h, f, l, p, F, P, I, N, A, L, k, Y, Q, M, E, y, gt, W, Xt, $, ft, Zt, Yt, pt, Qt, yt, tt, q, Wt, x = this;
331
- return H(this, function(T) {
332
- switch (T.label) {
329
+ return T(this, void 0, void 0, function() {
330
+ var r, o, c, h, f, l, p, F, P, O, j, I, A, k, Q, W, $, E, y, ft, tt, Xt, q, pt, Zt, Yt, yt, Qt, mt, et, X, Wt, x = this;
331
+ return z(this, function(N) {
332
+ switch (N.label) {
333
333
  case 0:
334
- r = ht(e.evaluationContext || this.evaluationContext), T.label = 1;
334
+ r = dt(e.evaluationContext || this.evaluationContext), N.label = 1;
335
335
  case 1:
336
- if (T.trys.push([1, 13, , 14]), o = e.environmentID, c = e.api, h = c === void 0 ? Dt : c, f = e.headers, l = e.onChange, p = e.cacheFlags, F = e.datadogRum, P = e.onError, I = e.defaultFlags, N = e.fetch, A = e.preventFetch, L = e.enableLogs, k = e.enableDynatrace, Y = e.enableAnalytics, Q = e.realtime, M = e.eventSourceUrl, E = M === void 0 ? "https://realtime.flagsmith.com/" : M, y = e.AsyncStorage, gt = e.identity, W = e.traits, Xt = e.state, $ = e.cacheOptions, ft = e.angularHttpClient, Zt = e._trigger, Yt = e._triggerLoadingState, r.environment = o ? { apiKey: o } : r.environment, !r.environment || !r.environment.apiKey) throw new Error("Please provide `evaluationContext.environment` with non-empty `apiKey`");
337
- if (r.identity = gt || W ? { identifier: gt, traits: W ? Object.fromEntries(Object.entries(W).map(function(j) {
338
- return [j[0], { value: j[1] }];
339
- })) : {} } : r.identity, this.evaluationContext = r, this.api = h, this.headers = f, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = l, pt = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = Zt || this._trigger, this._triggerLoadingState = Yt || this._triggerLoadingState, this.onError = function(j) {
340
- x.setLoadingState(s(s({}, x.loadingState), { isFetching: !1, isLoading: !1, error: j })), P == null || P(j);
341
- }, this.enableLogs = L || !1, this.cacheOptions = $ ? { skipAPI: !!$.skipAPI, ttl: $.ttl || 0, storageKey: $.storageKey, loadStale: !!$.loadStale } : this.cacheOptions, !this.cacheOptions.ttl && this.cacheOptions.skipAPI && console.warn("Flagsmith: you have set a cache ttl of 0 and are skipping API calls, this means the API will not be hit unless you clear local storage."), N && (C = N), this.enableAnalytics = Y || !1, this.flags = Object.assign({}, I) || {}, this.datadogRum = F || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = O !== void 0 && !!p, rt = "FLAGSMITH_EVENT_" + r.environment.apiKey, y && (O = y), Q && typeof window < "u" && this.setupRealtime(E, r.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = s(s({}, this.loadingState), { isLoading: !1, source: g.DEFAULT_FLAGS })), this.setState(Xt), this.log("Initialising with properties", e, this), k && (typeof dtrum > "u" ? console.error("You have attempted to enable dynatrace but dtrum is undefined, please check you have the Dynatrace RUM JavaScript API installed.") : this.dtrum = dtrum), ft && (C = /* @__PURE__ */ function(j) {
336
+ if (N.trys.push([1, 13, , 14]), o = e.environmentID, c = e.api, h = c === void 0 ? Dt : c, f = e.headers, l = e.onChange, p = e.cacheFlags, F = e.datadogRum, P = e.onError, O = e.defaultFlags, j = e.fetch, I = e.preventFetch, A = e.enableLogs, k = e.enableDynatrace, Q = e.enableAnalytics, W = e.realtime, $ = e.eventSourceUrl, E = $ === void 0 ? "https://realtime.flagsmith.com/" : $, y = e.AsyncStorage, ft = e.identity, tt = e.traits, Xt = e.state, q = e.cacheOptions, pt = e.angularHttpClient, Zt = e._trigger, Yt = e._triggerLoadingState, r.environment = o ? { apiKey: o } : r.environment, !r.environment || !r.environment.apiKey) throw new Error("Please provide `evaluationContext.environment` with non-empty `apiKey`");
337
+ if (r.identity = ft || tt ? { identifier: ft, traits: tt ? Object.fromEntries(Object.entries(tt).map(function(L) {
338
+ return [L[0], { value: L[1] }];
339
+ })) : {} } : r.identity, this.evaluationContext = r, this.api = h, this.headers = f, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = l, yt = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = Zt || this._trigger, this._triggerLoadingState = Yt || this._triggerLoadingState, this.onError = function(L) {
340
+ x.setLoadingState(s(s({}, x.loadingState), { isFetching: !1, isLoading: !1, error: L })), P == null || P(L);
341
+ }, this.enableLogs = A || !1, this.cacheOptions = q ? { skipAPI: !!q.skipAPI, ttl: q.ttl || 0, storageKey: q.storageKey, loadStale: !!q.loadStale } : this.cacheOptions, !this.cacheOptions.ttl && this.cacheOptions.skipAPI && console.warn("Flagsmith: you have set a cache ttl of 0 and are skipping API calls, this means the API will not be hit unless you clear local storage."), j && (C = j), this.enableAnalytics = Q || !1, this.flags = Object.assign({}, O) || {}, this.datadogRum = F || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = w !== void 0 && !!p, rt = "FLAGSMITH_EVENT_" + r.environment.apiKey, y && (w = y), W && typeof window < "u" && this.setupRealtime(E, r.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = s(s({}, this.loadingState), { isLoading: !1, source: g.DEFAULT_FLAGS })), this.setState(Xt), this.log("Initialising with properties", e, this), k && (typeof dtrum > "u" ? console.error("You have attempted to enable dynatrace but dtrum is undefined, please check you have the Dynatrace RUM JavaScript API installed.") : this.dtrum = dtrum), pt && (C = /* @__PURE__ */ function(L) {
342
342
  return function(U, R) {
343
- var V = R.headers, S = R.method, X = R.body;
344
- return new Promise(function(B) {
343
+ var B = R.headers, S = R.method, Z = R.body;
344
+ return new Promise(function(H) {
345
345
  switch (S) {
346
346
  case "GET":
347
- return j.get(U, { headers: V }).subscribe(function(J) {
348
- B({ ok: !0, text: function() {
347
+ return L.get(U, { headers: B }).subscribe(function(J) {
348
+ H({ ok: !0, text: function() {
349
349
  return Promise.resolve(J);
350
350
  } });
351
351
  });
352
352
  case "POST":
353
353
  case "PUT":
354
- return j.post(U, X, { headers: V }).subscribe(function(J) {
355
- B({ ok: !0, text: function() {
354
+ return L.post(U, Z, { headers: B }).subscribe(function(J) {
355
+ H({ ok: !0, text: function() {
356
356
  return Promise.resolve(J);
357
357
  } });
358
358
  });
359
359
  }
360
360
  });
361
361
  };
362
- }(ft)), O && this.canUseStorage && O.getItem(rt).then(function(j) {
362
+ }(pt)), w && this.canUseStorage && w.getItem(rt).then(function(L) {
363
363
  try {
364
- x.evaluationEvent = JSON.parse(j) || {};
364
+ x.evaluationEvent = JSON.parse(L) || {};
365
365
  } catch {
366
366
  x.evaluationEvent = {};
367
367
  }
368
368
  x.analyticsInterval = setInterval(x.analyticsFlags, x.ticks);
369
- }), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), O && this.canUseStorage && O.getItem(rt, function(j, U) {
369
+ }), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), w && this.canUseStorage && w.getItem(rt, function(L, U) {
370
370
  if (U && x.evaluationContext.environment) {
371
371
  var R = JSON.parse(U);
372
372
  if (R[x.evaluationContext.environment.apiKey]) {
373
- var V = x.getState();
374
- x.log("Retrieved events from cache", U), x.setState(s(s({}, V), { evaluationEvent: R[x.evaluationContext.environment.apiKey] }));
373
+ var B = x.getState();
374
+ x.log("Retrieved events from cache", U), x.setState(s(s({}, B), { evaluationEvent: R[x.evaluationContext.environment.apiKey] }));
375
375
  }
376
376
  }
377
377
  })), !p) return [3, 9];
378
- if (!O || !this.canUseStorage) return [3, 8];
379
- Qt = function(j, U) {
380
- return w(x, void 0, void 0, function() {
381
- var R, V, S, X, B, J, mt, te, St, Ct, bt, _t, Ft, Et, xt, Ot, wt, It, At, Lt, jt, Nt, Tt, Pt, ee = this;
382
- return H(this, function(z) {
383
- switch (z.label) {
378
+ if (!w || !this.canUseStorage) return [3, 8];
379
+ Qt = function(L, U) {
380
+ return T(x, void 0, void 0, function() {
381
+ var R, B, S, Z, H, J, St, te, Ct, bt, _t, Ft, Et, xt, wt, Ot, It, At, Lt, jt, Nt, Tt, Pt, kt, ee = this;
382
+ return z(this, function(V) {
383
+ switch (V.label) {
384
384
  case 0:
385
385
  if (!U) return [3, 7];
386
- R = null, V = null, z.label = 1;
386
+ R = null, B = null, V.label = 1;
387
387
  case 1:
388
- return z.trys.push([1, 5, , 6]), S = JSON.parse(U), X = !1, B = !1, S && S.api === this.api && ((Ct = (St = S.evaluationContext) === null || St === void 0 ? void 0 : St.environment) === null || Ct === void 0 ? void 0 : Ct.apiKey) === ((bt = this.evaluationContext.environment) === null || bt === void 0 ? void 0 : bt.apiKey) && (J = !0, this.evaluationContext.identity && ((Ft = (_t = S.evaluationContext) === null || _t === void 0 ? void 0 : _t.identity) === null || Ft === void 0 ? void 0 : Ft.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((xt = (Et = S.evaluationContext) === null || Et === void 0 ? void 0 : Et.identity) === null || xt === void 0 ? void 0 : xt.identifier) + " to " + this.evaluationContext.identity.identifier), J = !1), this.cacheOptions.ttl && (!S.ts || (/* @__PURE__ */ new Date()).valueOf() - S.ts > this.cacheOptions.ttl) && (S.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + S.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - S.ts) + "ms"), J = !1) : S.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + S.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - S.ts) + "ms"), B = !0, J = !0)), J && (X = !0, V = _((Ot = this.evaluationContext.identity) === null || Ot === void 0 ? void 0 : Ot.traits, (It = (wt = S.evaluationContext) === null || wt === void 0 ? void 0 : wt.identity) === null || It === void 0 ? void 0 : It.traits), R = _(this.flags, S.flags), this.setState(s(s({}, S), { evaluationContext: ht(s(s({}, S.evaluationContext), { identity: !((At = S.evaluationContext) === null || At === void 0) && At.identity ? s(s({}, (Lt = S.evaluationContext) === null || Lt === void 0 ? void 0 : Lt.identity), { traits: s(s({}, ((Nt = (jt = S.evaluationContext) === null || jt === void 0 ? void 0 : jt.identity) === null || Nt === void 0 ? void 0 : Nt.traits) || {}), W || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", S))), X ? (mt = !A && (!this.cacheOptions.skipAPI || B), this._onChange(null, { isFromServer: !1, flagsChanged: R, traitsChanged: V }, this._loadedState(null, g.CACHE, mt)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && X && !B && this.log("Skipping API, using cache"), mt && this.getFlags().catch(function(ue) {
389
- var kt;
390
- (kt = ee.onError) === null || kt === void 0 || kt.call(ee, ue);
388
+ return V.trys.push([1, 5, , 6]), S = JSON.parse(U), Z = !1, H = !1, S && S.api === this.api && ((bt = (Ct = S.evaluationContext) === null || Ct === void 0 ? void 0 : Ct.environment) === null || bt === void 0 ? void 0 : bt.apiKey) === ((_t = this.evaluationContext.environment) === null || _t === void 0 ? void 0 : _t.apiKey) && (J = !0, this.evaluationContext.identity && ((Et = (Ft = S.evaluationContext) === null || Ft === void 0 ? void 0 : Ft.identity) === null || Et === void 0 ? void 0 : Et.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((wt = (xt = S.evaluationContext) === null || xt === void 0 ? void 0 : xt.identity) === null || wt === void 0 ? void 0 : wt.identifier) + " to " + this.evaluationContext.identity.identifier), J = !1), this.cacheOptions.ttl && (!S.ts || (/* @__PURE__ */ new Date()).valueOf() - S.ts > this.cacheOptions.ttl) && (S.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + S.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - S.ts) + "ms"), J = !1) : S.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + S.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - S.ts) + "ms"), H = !0, J = !0)), J && (Z = !0, B = _((Ot = this.evaluationContext.identity) === null || Ot === void 0 ? void 0 : Ot.traits, (At = (It = S.evaluationContext) === null || It === void 0 ? void 0 : It.identity) === null || At === void 0 ? void 0 : At.traits), R = _(this.flags, S.flags), this.setState(s(s({}, S), { evaluationContext: dt(s(s({}, S.evaluationContext), { identity: !((Lt = S.evaluationContext) === null || Lt === void 0) && Lt.identity ? s(s({}, (jt = S.evaluationContext) === null || jt === void 0 ? void 0 : jt.identity), { traits: s(s({}, ((Tt = (Nt = S.evaluationContext) === null || Nt === void 0 ? void 0 : Nt.identity) === null || Tt === void 0 ? void 0 : Tt.traits) || {}), tt || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", S))), Z ? (St = !I && (!this.cacheOptions.skipAPI || H), this._onChange(null, { isFromServer: !1, flagsChanged: R, traitsChanged: B }, this._loadedState(null, g.CACHE, St)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && Z && !H && this.log("Skipping API, using cache"), St && this.getFlags().catch(function(he) {
389
+ var Ut;
390
+ (Ut = ee.onError) === null || Ut === void 0 || Ut.call(ee, he);
391
391
  }), [3, 4]) : [3, 2];
392
392
  case 2:
393
- return A ? [3, 4] : [4, this.getFlags()];
393
+ return I ? [3, 4] : [4, this.getFlags()];
394
394
  case 3:
395
- z.sent(), z.label = 4;
395
+ V.sent(), V.label = 4;
396
396
  case 4:
397
397
  return [3, 6];
398
398
  case 5:
399
- return te = z.sent(), this.log("Exception fetching cached logs", te), [3, 6];
399
+ return te = V.sent(), this.log("Exception fetching cached logs", te), [3, 6];
400
400
  case 6:
401
401
  return [3, 10];
402
402
  case 7:
403
- return A ? [3, 9] : [4, this.getFlags()];
403
+ return I ? [3, 9] : [4, this.getFlags()];
404
404
  case 8:
405
- return z.sent(), [3, 10];
405
+ return V.sent(), [3, 10];
406
406
  case 9:
407
- if (I) this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (Tt = this.evaluationContext.identity) === null || Tt === void 0 ? void 0 : Tt.traits) }, this._loadedState(null, g.DEFAULT_FLAGS));
407
+ if (O) this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (Pt = this.evaluationContext.identity) === null || Pt === void 0 ? void 0 : Pt.traits) }, this._loadedState(null, g.DEFAULT_FLAGS));
408
408
  else {
409
- if (!this.flags) throw new Error(pt);
410
- this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (Pt = this.evaluationContext.identity) === null || Pt === void 0 ? void 0 : Pt.traits) }, this._loadedState(null, g.DEFAULT_FLAGS));
409
+ if (!this.flags) throw new Error(yt);
410
+ this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (kt = this.evaluationContext.identity) === null || kt === void 0 ? void 0 : kt.traits) }, this._loadedState(null, g.DEFAULT_FLAGS));
411
411
  }
412
- z.label = 10;
412
+ V.label = 10;
413
413
  case 10:
414
414
  return [2];
415
415
  }
416
416
  });
417
417
  });
418
- }, T.label = 2;
418
+ }, N.label = 2;
419
419
  case 2:
420
- return T.trys.push([2, 7, , 8]), O.getItemSync ? (yt = O.getItemSync(this.getStorageKey()), [3, 5]) : [3, 3];
420
+ return N.trys.push([2, 7, , 8]), w.getItemSync ? (mt = w.getItemSync(this.getStorageKey()), [3, 5]) : [3, 3];
421
421
  case 3:
422
- return [4, O.getItem(this.getStorageKey())];
422
+ return [4, w.getItem(this.getStorageKey())];
423
423
  case 4:
424
- yt = T.sent(), T.label = 5;
424
+ mt = N.sent(), N.label = 5;
425
425
  case 5:
426
- return [4, Qt(null, yt)];
426
+ return [4, Qt(null, mt)];
427
427
  case 6:
428
428
  case 7:
429
- return T.sent(), [3, 8];
429
+ return N.sent(), [3, 8];
430
430
  case 8:
431
431
  return [3, 12];
432
432
  case 9:
433
- return A ? [3, 11] : [4, this.getFlags()];
433
+ return I ? [3, 11] : [4, this.getFlags()];
434
434
  case 10:
435
- return T.sent(), [3, 12];
435
+ return N.sent(), [3, 12];
436
436
  case 11:
437
- if (I) this._onChange(null, { isFromServer: !1, flagsChanged: _({}, I), traitsChanged: _({}, (t = r.identity) === null || t === void 0 ? void 0 : t.traits) }, this._loadedState(null, g.DEFAULT_FLAGS));
438
- else if (this.flags && (tt = null, Object.keys(this.flags).length === 0 && (tt = pt), this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (i = r.identity) === null || i === void 0 ? void 0 : i.traits) }, this._loadedState(tt, g.DEFAULT_FLAGS)), tt)) throw new Error(tt);
439
- T.label = 12;
437
+ if (O) this._onChange(null, { isFromServer: !1, flagsChanged: _({}, O), traitsChanged: _({}, (t = r.identity) === null || t === void 0 ? void 0 : t.traits) }, this._loadedState(null, g.DEFAULT_FLAGS));
438
+ else if (this.flags && (et = null, Object.keys(this.flags).length === 0 && (et = yt), this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (i = r.identity) === null || i === void 0 ? void 0 : i.traits) }, this._loadedState(et, g.DEFAULT_FLAGS)), et)) throw new Error(et);
439
+ N.label = 12;
440
440
  case 12:
441
441
  return [3, 14];
442
442
  case 13:
443
- throw q = T.sent(), this.log("Error during initialisation ", q), Wt = q instanceof Error ? q : new Error("".concat(q)), (n = this.onError) === null || n === void 0 || n.call(this, Wt), q;
443
+ throw X = N.sent(), this.log("Error during initialisation ", X), Wt = X instanceof Error ? X : new Error("".concat(X)), (n = this.onError) === null || n === void 0 || n.call(this, Wt), X;
444
444
  case 14:
445
445
  return [2];
446
446
  }
@@ -472,12 +472,12 @@ var Kt = { exports: {} };
472
472
  if (this.cacheFlags) {
473
473
  this.ts = (/* @__PURE__ */ new Date()).valueOf();
474
474
  var e = JSON.stringify(this.getState());
475
- this.log("Setting storage", e), O.setItem(this.getStorageKey(), e);
475
+ this.log("Setting storage", e), w.setItem(this.getStorageKey(), e);
476
476
  }
477
477
  }, a.prototype.updateEventStorage = function() {
478
478
  if (this.enableAnalytics) {
479
479
  var e = JSON.stringify(this.getState().evaluationEvent);
480
- O.setItem(rt, e).catch(function(t) {
480
+ w.setItem(rt, e).catch(function(t) {
481
481
  return console.error("Flagsmith: Error setting item in async storage", t);
482
482
  });
483
483
  }
@@ -486,7 +486,7 @@ var Kt = { exports: {} };
486
486
  it(e, this.loadingState) || (this.loadingState = s({}, e), this.log("Loading state changed", e), (t = this._triggerLoadingState) === null || t === void 0 || t.call(this));
487
487
  }, a.prototype.setupRealtime = function(e, t) {
488
488
  var i = this, n = e + "sse/environments/" + t + "/stream";
489
- dt ? this.eventSource || (this.log("Creating event source with url " + n), this.eventSource = new dt(n), this.eventSource.addEventListener("environment_updated", function(r) {
489
+ vt ? this.eventSource || (this.log("Creating event source with url " + n), this.eventSource = new vt(n), this.eventSource.addEventListener("environment_updated", function(r) {
490
490
  var o;
491
491
  try {
492
492
  o = JSON.parse(r.data).updated_at;
@@ -497,11 +497,11 @@ var Kt = { exports: {} };
497
497
  })) : this.log("Error, EventSource is undefined");
498
498
  }, a;
499
499
  }();
500
- function zt(a) {
500
+ function Vt(a) {
501
501
  var e = a.fetch, t = a.AsyncStorage, i = a.eventSource;
502
- return new oe({ fetch: e, AsyncStorage: t, eventSource: i });
502
+ return new le({ fetch: e, AsyncStorage: t, eventSource: i });
503
503
  }
504
- var ot, se = (ot = function(a, e) {
504
+ var ot, ue = (ot = function(a, e) {
505
505
  return ot = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, i) {
506
506
  t.__proto__ = i;
507
507
  } || function(t, i) {
@@ -513,14 +513,14 @@ var Kt = { exports: {} };
513
513
  this.constructor = a;
514
514
  }
515
515
  ot(a, e), a.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
516
- }), Ht = function(a) {
516
+ }), zt = function(a) {
517
517
  var e = typeof Symbol == "function" && Symbol.iterator, t = e && a[e], i = 0;
518
518
  if (t) return t.call(a);
519
519
  if (a && typeof a.length == "number") return { next: function() {
520
520
  return a && i >= a.length && (a = void 0), { value: a && a[i++], done: !a };
521
521
  } };
522
522
  throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
523
- }, Bt = function(a, e) {
523
+ }, Ht = function(a, e) {
524
524
  var t = typeof Symbol == "function" && a[Symbol.iterator];
525
525
  if (!t) return a;
526
526
  var i, n, r = t.call(a), o = [];
@@ -536,19 +536,19 @@ var Kt = { exports: {} };
536
536
  }
537
537
  }
538
538
  return o;
539
- }, vt = function(a, e, t) {
539
+ }, gt = function(a, e, t) {
540
540
  if (arguments.length === 2) for (var i, n = 0, r = e.length; n < r; n++) !i && n in e || (i || (i = Array.prototype.slice.call(e, 0, n)), i[n] = e[n]);
541
541
  return a.concat(i || Array.prototype.slice.call(e));
542
- }, le = function(a) {
542
+ }, ce = function(a) {
543
543
  function e() {
544
544
  return a.call(this, `EventSource not available.
545
545
  Consider loading an EventSource polyfill and making it available globally as EventSource, or passing one in as eventSourceClass to the ReconnectingEventSource constructor.`) || this;
546
546
  }
547
- return se(e, a), e;
547
+ return ue(e, a), e;
548
548
  }(Error), Mt = function() {
549
549
  function a(e, t) {
550
550
  var i = this;
551
- if (this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, this._configuration = t != null ? Object.assign({}, t) : void 0, this.withCredentials = !1, this._eventSource = null, this._lastEventId = null, this._timer = null, this._listeners = { open: [], error: [], message: [] }, this.url = e.toString(), this.readyState = this.CONNECTING, this.max_retry_time = 3e3, this.eventSourceClass = globalThis.FlagsmithEventSource, this._configuration != null && (this._configuration.lastEventId && (this._lastEventId = this._configuration.lastEventId, delete this._configuration.lastEventId), this._configuration.max_retry_time && (this.max_retry_time = this._configuration.max_retry_time, delete this._configuration.max_retry_time), this._configuration.eventSourceClass && (this.eventSourceClass = this._configuration.eventSourceClass, delete this._configuration.eventSourceClass)), this.eventSourceClass == null || typeof this.eventSourceClass != "function") throw new le();
551
+ if (this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, this._configuration = t != null ? Object.assign({}, t) : void 0, this.withCredentials = !1, this._eventSource = null, this._lastEventId = null, this._timer = null, this._listeners = { open: [], error: [], message: [] }, this.url = e.toString(), this.readyState = this.CONNECTING, this.max_retry_time = 3e3, this.eventSourceClass = globalThis.FlagsmithEventSource, this._configuration != null && (this._configuration.lastEventId && (this._lastEventId = this._configuration.lastEventId, delete this._configuration.lastEventId), this._configuration.max_retry_time && (this.max_retry_time = this._configuration.max_retry_time, delete this._configuration.max_retry_time), this._configuration.eventSourceClass && (this.eventSourceClass = this._configuration.eventSourceClass, delete this._configuration.eventSourceClass)), this.eventSourceClass == null || typeof this.eventSourceClass != "function") throw new ce();
552
552
  this._onevent_wrapped = function(n) {
553
553
  i._onevent(n);
554
554
  }, this._start();
@@ -565,7 +565,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
565
565
  i.onmessage(h);
566
566
  };
567
567
  try {
568
- for (var r = Ht(Object.keys(this._listeners)), o = r.next(); !o.done; o = r.next()) {
568
+ for (var r = zt(Object.keys(this._listeners)), o = r.next(); !o.done; o = r.next()) {
569
569
  var c = o.value;
570
570
  this._eventSource.addEventListener(c, this._onevent_wrapped);
571
571
  }
@@ -594,7 +594,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
594
594
  e && e.lastEventId && (this._lastEventId = e.lastEventId);
595
595
  var n = this._listeners[e.type];
596
596
  if (n != null) try {
597
- for (var r = Ht(vt([], Bt(n), !1)), o = r.next(); !o.done; o = r.next())
597
+ for (var r = zt(gt([], Ht(n), !1)), o = r.next(); !o.done; o = r.next())
598
598
  o.value.call(this, e);
599
599
  } catch (c) {
600
600
  t = { error: c };
@@ -614,7 +614,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
614
614
  }, a.prototype.addEventListener = function(e, t, i) {
615
615
  this._listeners[e] == null && (this._listeners[e] = [], this._eventSource != null && this._eventSource.addEventListener(e, this._onevent_wrapped));
616
616
  var n = this._listeners[e];
617
- n.includes(t) || (this._listeners[e] = vt(vt([], Bt(n), !1), [t], !1));
617
+ n.includes(t) || (this._listeners[e] = gt(gt([], Ht(n), !1), [t], !1));
618
618
  }, a.prototype.removeEventListener = function(e, t, i) {
619
619
  var n = this._listeners[e];
620
620
  this._listeners[e] = n.filter(function(r) {
@@ -649,19 +649,19 @@ Consider loading an EventSource polyfill and making it available globally as Eve
649
649
  }, n.onerror = i, n.withCredentials = e.credentials == "include", e.headers) n.setRequestHeader(f, e.headers[f]);
650
650
  n.send(e.body || null);
651
651
  });
652
- }, qt = zt({ AsyncStorage: v, fetch: $t, eventSource: Mt });
652
+ }, qt = Vt({ AsyncStorage: v, fetch: $t, eventSource: Mt });
653
653
  typeof window < "u" && (window.flagsmith = qt), d.createFlagsmithInstance = function() {
654
- return zt({ AsyncStorage: v, fetch: $t, eventSource: Mt });
654
+ return Vt({ AsyncStorage: v, fetch: $t, eventSource: Mt });
655
655
  }, d.default = qt, Object.defineProperty(d, "__esModule", { value: !0 });
656
656
  });
657
657
  })(Kt, Kt.exports);
658
- var ve = Kt.exports, ge = {
658
+ var ge = Kt.exports, fe = {
659
659
  NOT_INITIALIZED: "FeatureFlag not initialized. Call init() first.",
660
660
  INVALID_CONFIG: "Invalid Flagsmith configuration",
661
661
  FETCH_FAILED: "Failed to fetch Flagsmith configuration",
662
662
  NO_USER_CONTEXT: "User context not set. Call setUser() first.",
663
663
  ALREADY_INITIALIZED: "FeatureFlag is already initialized."
664
- }, ne = "business", K, fe = (K = class {
664
+ }, ne = "business", K, pe = (K = class {
665
665
  constructor() {
666
666
  st(this, "flagsmithClient", null);
667
667
  st(this, "userContext", null);
@@ -671,13 +671,13 @@ var ve = Kt.exports, ge = {
671
671
  }
672
672
  ensureInitialized() {
673
673
  if (!this.flagsmithClient)
674
- throw new Error(ge.NOT_INITIALIZED);
674
+ throw new Error(fe.NOT_INITIALIZED);
675
675
  }
676
676
  async init(u, d = []) {
677
677
  if (!this.flagsmithClient)
678
678
  try {
679
- this.flagsmithClient = ve.createFlagsmithInstance();
680
- const v = d.reduce((s, w) => (s[w.feature.name] = w, s), {});
679
+ this.flagsmithClient = ge.createFlagsmithInstance();
680
+ const v = d.reduce((s, T) => (s[T.feature.name] = T, s), {});
681
681
  await this.flagsmithClient.init({
682
682
  environmentID: u.apiKey,
683
683
  api: (u == null ? void 0 : u.url) ?? "https://feature-flag-proxy.feedme.farm/api/v1/",
@@ -746,15 +746,15 @@ var ve = Kt.exports, ge = {
746
746
  };
747
747
  }
748
748
  async getUserFlagValue(u, d, v = null, s) {
749
- var H;
750
- const w = this.userContext;
749
+ var z;
750
+ const T = this.userContext;
751
751
  try {
752
752
  return await this.setUser(u), this.getFlagValue(d, s) ?? v;
753
753
  } catch (D) {
754
754
  return console.error(`Error getting user flag value for ${d}:`, D), v;
755
755
  } finally {
756
756
  try {
757
- await ((H = this.flagsmithClient) == null ? void 0 : H.logout()), this.userContext = null, w && await this.setUser(w.identifier);
757
+ await ((z = this.flagsmithClient) == null ? void 0 : z.logout()), this.userContext = null, T && await this.setUser(T.identifier);
758
758
  } catch (D) {
759
759
  console.error("Error during cleanup:", D);
760
760
  }
@@ -763,33 +763,33 @@ var ve = Kt.exports, ge = {
763
763
  reset() {
764
764
  this.flagsmithClient = null, this.userContext = null;
765
765
  }
766
- }, st(K, "instance"), K), pe = fe.getInstance(), et = ct(!1), ut = ct([]), Z = ct(null);
767
- function ye(m = pe) {
768
- const u = () => et.value ? !0 : (console.warn("FeatureFlag is not initialized. Using default values."), !1), d = async (g, C = []) => {
769
- if (et.value) {
766
+ }, st(K, "instance"), K), ye = pe.getInstance(), nt = ht(!1), ut = ht([]), Y = ht(null);
767
+ function me(m = ye) {
768
+ const u = () => nt.value ? !0 : (console.warn("FeatureFlag is not initialized. Using default values."), !1), d = async (g, C = []) => {
769
+ if (nt.value) {
770
770
  console.warn("FeatureFlag is already initialized.");
771
771
  return;
772
772
  }
773
773
  try {
774
- await m.init(g, C), ut.value = await m.getFlags(), et.value = !0, Z.value = null;
774
+ await m.init(g, C), ut.value = await m.getFlags(), nt.value = !0, Y.value = null;
775
775
  } catch (b) {
776
- console.error("Failed to initialize feature flags:", b), Z.value = b;
776
+ console.error("Failed to initialize feature flags:", b), Y.value = b;
777
777
  }
778
778
  }, v = async (g) => {
779
779
  if (u())
780
780
  try {
781
- await m.setUser(g), ut.value = await m.getFlags(), Z.value = null;
781
+ await m.setUser(g), ut.value = await m.getFlags(), Y.value = null;
782
782
  } catch (C) {
783
- console.error("Failed to set user:", C), Z.value = C;
783
+ console.error("Failed to set user:", C), Y.value = C;
784
784
  }
785
- }, s = async (g) => v(`${ne}-${g}`), w = (g, C, b = null) => {
785
+ }, s = async (g) => v(`${ne}-${g}`), T = (g, C, b = null) => {
786
786
  if (!u()) return b;
787
787
  try {
788
788
  return m.getFlagValue(g, C) ?? b;
789
789
  } catch (G) {
790
790
  return console.error(`Error getting flag value for ${g}:`, G), b;
791
791
  }
792
- }, H = (g, C) => {
792
+ }, z = (g, C) => {
793
793
  if (!u()) return C ?? null;
794
794
  try {
795
795
  return m.getFlag(g) ?? C ?? null;
@@ -809,76 +809,76 @@ function ye(m = pe) {
809
809
  } catch (g) {
810
810
  console.error("Error resetting feature flags:", g);
811
811
  } finally {
812
- ut.value = [], et.value = !1, Z.value = null;
812
+ ut.value = [], nt.value = !1, Y.value = null;
813
813
  }
814
814
  };
815
815
  return {
816
- flags: Ut(ut),
817
- isInitialized: Ut(et),
818
- error: Ut(Z),
816
+ flags: Rt(ut),
817
+ isInitialized: Rt(nt),
818
+ error: Rt(Y),
819
819
  init: d,
820
820
  setUser: v,
821
821
  setBusiness: s,
822
- getFlagValue: w,
823
- getFlag: H,
822
+ getFlagValue: T,
823
+ getFlag: z,
824
824
  getUserFlagValue: D,
825
825
  getBusinessFlagValue: it,
826
826
  reset: _
827
827
  };
828
828
  }
829
- var me = () => ye();
830
- function Se(m, u) {
829
+ var Se = () => me();
830
+ function re(m, u) {
831
831
  if (!(m != null && m.enabled)) return !1;
832
832
  const d = (m.value ?? "").split(",").map((v) => v.trim().toUpperCase()).filter(Boolean);
833
833
  return !d.length || d.includes("*") ? !0 : !!u && d.includes(u.toUpperCase());
834
834
  }
835
835
  var Ce = { firebase: { apiKey: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", authDomain: "feedme-dev-4c3ef.firebaseapp.com", databaseURL: "https://feedme-dev-4c3ef.firebaseio.com", projectId: "feedme-dev-4c3ef", storageBucket: "feedme-dev-4c3ef.appspot.com", messagingSenderId: "458797803788", appId: "1:458797803788:web:37f2af2926a84288f0c129", measurementId: "G-J2QG09D2Q7" }, assetBucketUrl: "feedme-dev-4c3ef.appspot.com", importFilesBucketUrl: "feedme-dev-4c3ef.appspot.com", clientId: "1a362d621873497b277ea55258cc82594ba148d235257f7bd44ea2acc132d8a4", featureFlagApiKey: "MaGoXrEWuEJNpWgKTqseee" };
836
- const Rt = {
836
+ const ct = {
837
837
  broadcastAppInbox: "connect_broadcast_app_inbox_countries",
838
838
  broadcastPush: "connect_broadcast_push_countries",
839
839
  broadcastWhatsapp: "connect_broadcast_whatsapp_countries",
840
840
  whatsappBot: "connect_whatsapp_bot"
841
841
  }, be = {
842
- APP_INBOX: Rt.broadcastAppInbox,
843
- PUSH: Rt.broadcastPush,
844
- WHATSAPP: Rt.broadcastWhatsapp
842
+ APP_INBOX: ct.broadcastAppInbox,
843
+ PUSH: ct.broadcastPush,
844
+ WHATSAPP: ct.broadcastWhatsapp
845
845
  }, {
846
846
  init: _e,
847
847
  isInitialized: Fe,
848
848
  setBusiness: Ee,
849
- flags: ae,
849
+ flags: oe,
850
850
  error: ie
851
- } = me(), nt = ct("loading");
852
- async function Le(m) {
853
- nt.value = "loading";
851
+ } = Se(), M = ht("loading");
852
+ async function Ae(m) {
853
+ M.value = "loading";
854
854
  try {
855
855
  if (Fe.value || await _e({ apiKey: Ce.featureFlagApiKey }), await Ee(m), ie.value) throw ie.value;
856
- nt.value = "ready";
856
+ M.value = "ready";
857
857
  } catch (u) {
858
- nt.value = "error", console.warn("CONNECT: loadBusinessFlags failed", u);
858
+ M.value = "error", console.warn("CONNECT: loadBusinessFlags failed", u);
859
859
  }
860
860
  }
861
- function xe() {
862
- return (m) => {
863
- var u;
864
- return nt.value === "loading" ? "loading" : nt.value === "error" ? "off" : (u = ae.value.find((d) => d.feature.name === m)) != null && u.enabled ? "on" : "off";
861
+ function Le() {
862
+ const m = ae();
863
+ return () => {
864
+ if (M.value === "loading") return "loading";
865
+ if (M.value === "error") return "off";
866
+ const u = oe.value.find((d) => d.feature.name === ct.whatsappBot);
867
+ return re(u, m.currentCountry.value) ? "on" : "off";
865
868
  };
866
869
  }
867
870
  function je() {
868
- const m = de(), u = xe();
869
- return (d) => {
870
- const v = be[d];
871
- if (!v) return "on";
872
- const s = u(v);
873
- return s !== "on" ? s : Se(
874
- ae.value.find((w) => w.feature.name === v),
871
+ const m = ae();
872
+ return (u) => {
873
+ const d = be[u];
874
+ return d ? M.value === "loading" ? "loading" : M.value === "error" ? "off" : re(
875
+ oe.value.find((v) => v.feature.name === d),
875
876
  m.currentCountry.value
876
- ) ? "on" : "off";
877
+ ) ? "on" : "off" : "on";
877
878
  };
878
879
  }
879
880
  export {
880
- Rt as F,
881
881
  je as a,
882
- Le as l,
883
- xe as u
882
+ Ae as l,
883
+ Le as u
884
884
  };