@feedmepos/mf-connect 0.1.117-prod → 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.
- package/README.md +68 -1
- package/dist/{App-CAo1izHr.js → App-CBFNBDb2.js} +435 -418
- package/dist/AuditLogs-BtSA8b08.js +2016 -0
- package/dist/{Bin-DDDfjisJ.js → Bin-CjmS_Tfn.js} +8 -8
- package/dist/{Broadcast-BsCulZhE.js → Broadcast-BeePmZa1.js} +22 -21
- package/dist/{CampaignAnalytic-CnVYFSkT.js → CampaignAnalytic-CZlnyvOi.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-ZTHyZ_0y.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Du3Ah4HP.js} +9 -9
- package/dist/{Card-DPyQH9qZ.js → Card-C8SzQQ0z.js} +25 -24
- package/dist/{Collections-CZCVA969.js → Collections-BXNWTSZH.js} +197 -185
- package/dist/{Credit-BTg364-i.js → Credit-CK0-0yD1.js} +21 -20
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BJx8K6Ja.js → DateRangeChip.vue_vue_type_script_setup_true_lang-BXYpYC7Y.js} +1 -1
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CdpnNDzR.js +4439 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CfEnSXzg.js → EffectSheet.vue_vue_type_style_index_0_lang--Oyj3KYg.js} +32 -32
- package/dist/{Experience-Bk_eUcSX.js → Experience-CWJaj62g.js} +32 -31
- package/dist/{FileSaver.min-CXFiZAp7.js → FileSaver.min-lV9H82L5.js} +1 -1
- package/dist/{Game-CBnKpFdl.js → Game-zBV1LYAg.js} +19 -18
- package/dist/{GiftCardSetup-q75wNV_F.js → GiftCardSetup-Cnq9353j.js} +75 -75
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-Cga0Th2O.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-CdgSBdrX.js} +7 -7
- package/dist/{Goals-Bbbgurfd.js → Goals-Utk08egN.js} +4 -4
- package/dist/Grab-DwMmWmbT.js +301 -0
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CZS05h1r.js → ImageInput.vue_vue_type_script_setup_true_lang-CNPeU9xm.js} +1 -1
- package/dist/{Index-C8_OWllb.js → Index-Bjgs18xf.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BlCg-jI7.js → LocationPicker.vue_vue_type_script_setup_true_lang-DWnf4lXH.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CACxChIo.js → LottieAnimation.vue_vue_type_script_setup_true_lang-Dy_oWJaZ.js} +1 -1
- package/dist/{LoyaltyDashboard-DJlE0371.js → LoyaltyDashboard-DmUfujX_.js} +15 -15
- package/dist/MainLayout-DlDZQJfy.js +4 -0
- package/dist/{MainLayout-Bs2UPvFx.js → MainLayout.vue_vue_type_script_setup_true_lang-yAflY70k.js} +5 -4
- package/dist/Marketing-B0iKlHP-.js +269 -0
- package/dist/MarketingMaterialEdit-BNHxVb8A.js +1037 -0
- package/dist/{Member-C4yqwsMH.js → Member-Bcm3_pWB.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-BbumjyC_.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-CPp4OpOx.js} +43 -50
- package/dist/{MemberImportHistory-CbuXCdxC.js → MemberImportHistory-AQgLzB3g.js} +7 -7
- package/dist/{MemberList-CpAepPBe.js → MemberList-CkMTo2uD.js} +103 -105
- package/dist/{MemberTransactions-BbpXvsSk.js → MemberTransactions-CxLCVjvw.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BaWgxbad.js → MessageInput.vue_vue_type_script_setup_true_lang-4N20f8Sj.js} +14 -14
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CEgMElLo.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DghbYpSQ.js} +1 -1
- package/dist/{Mission-Bdb9KVeP.js → Mission-CQS1CoDN.js} +22 -21
- package/dist/{Overview-CEiyGMcf.js → Overview-NQ287sgq.js} +23 -22
- package/dist/{Overview-D_9JwnFU.js → Overview-UG1IjY7-.js} +145 -144
- package/dist/{Point-Bd5cMXQx.js → Point-krMa_mb1.js} +22 -21
- package/dist/{Promotion-D9gZDvgR.js → Promotion-vFBmJSti.js} +137 -131
- package/dist/{Queue-BnAOL_rp.js → Queue-BusxSPt-.js} +46 -45
- package/dist/{Record-D6TWFKe0.js → Record-DjKqn0za.js} +9 -9
- package/dist/{Review-DLEgvnc-.js → Review-CqLp8l7U.js} +2 -2
- package/dist/ReviewFacebookCallback-D2kMSVFC.js +225 -0
- package/dist/{ReviewGoogleCallback-BgAbO3pI.js → ReviewGoogleCallback-B1cHR-o2.js} +5 -5
- package/dist/Reward-FeSxgzuS.js +444 -0
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Bt-EqsiH.js → RewardGroup.vue_vue_type_script_setup_true_lang-CCxVjBsO.js} +16 -15
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-U403emCF.js +1923 -0
- package/dist/{Segment-B9Se5FFw.js → Segment-Nj59F9Nr.js} +304 -305
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-f7AS5vwv.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-Kg9m-0DS.js} +31 -30
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-3BKA0UFI.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BLbDApPL.js} +4 -4
- package/dist/Setting-CCIzNxv-.js +574 -0
- package/dist/{SettingAdvertisements-CLw-dqiA.js → SettingAdvertisements-CkPyAg5y.js} +12 -12
- package/dist/Settings-CYjKGCpa.js +286 -0
- package/dist/{Store-B5PPP5zM.js → Store-Bp8Zkzi2.js} +31 -30
- package/dist/{StoreRewards-DllyaVBY.js → StoreRewards-DXW5nVyW.js} +15 -15
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BYVezFI2.js +1319 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CS6b1cM3.js +7007 -0
- package/dist/{Tier-M_TApfju.js → Tier-B8Utn9Qb.js} +2576 -687
- package/dist/{Title-Cpltm-I2.js → Title-CwaNSFer.js} +94 -92
- package/dist/{Transaction-BYfAYRpv.js → Transaction-ieciAdXP.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BOhfGxVj.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CMwZl4E6.js} +26 -26
- package/dist/{Voucher-DHoyg0YZ.js → Voucher-BKfujj6r.js} +19 -19
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DWHwM6AJ.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CkH-rNqZ.js} +16 -16
- package/dist/WhatsappAccount-D73WDP7a.js +161 -0
- package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-C3L7vWZE.js +39 -0
- package/dist/WhatsappBot-DTWZAXhi.js +878 -0
- package/dist/WhatsappBotLogs-DtDcrjs9.js +372 -0
- package/dist/WhatsappBotSettings-7_mH9U4y.js +704 -0
- package/dist/WhatsappLayout-BVpaFJ8H.js +21 -0
- package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-CMeaNKJt.js +261 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B6tTjLAZ.js → ZodTextField.vue_vue_type_script_setup_true_lang-BO1zA9AR.js} +2 -2
- package/dist/{app-B_doYklh.js → app-DX7OWVY2.js} +9159 -7383
- package/dist/app.js +4 -3
- package/dist/{base.export-DmbnT_bp.js → base.export-bamzzexi.js} +2 -2
- package/dist/browser-BSAOEeIM.js +1478 -0
- package/dist/{business-DdVGtTvx.js → business-D3U9HSu9.js} +1 -1
- package/dist/{campaign-jEhKmpKg.js → campaign-BqRf2VUO.js} +121 -94
- package/dist/{campaign-CVkA08zl.js → campaign-CKfeN2xN.js} +31 -25
- package/dist/{campaign.enum-DWu6-kOo.js → campaign.enum-Dx-Zo68Q.js} +3 -2
- package/dist/{campaign.fn-BlgEyeFz.js → campaign.fn-DQe5LZuT.js} +82 -82
- package/dist/{collectible.enum-CVLkXKml.js → collectible.enum-Liy2wH3s.js} +1 -1
- package/dist/{collection.fn-DLNGTrPf.js → collection.fn-BcGqExuE.js} +2 -2
- package/dist/{currency-DKS1md4e.js → currency-sjMYWoI8.js} +1 -1
- package/dist/duplicateCampaign-CJF3ZLNd.js +51 -0
- package/dist/{effect-Bk-zYexf.js → effect-Cv8ugBR3.js} +1 -1
- package/dist/{email-addresses-I9A5iLzf.js → email-addresses-CWqtseTn.js} +2 -2
- package/dist/{feature-flag-DQti61iR.js → feature-flag-BIh6MM4i.js} +152 -136
- package/dist/google-BQK68wbe.js +5 -0
- package/dist/{helper-9cPlo6ae.js → helper-WnxOxoRK.js} +1 -1
- package/dist/{index-DuvnRxeo.js → index-5TTGGDnF.js} +1 -1
- package/dist/{index-CuyzSc1l.js → index-B3CkAr-6.js} +1 -1
- package/dist/{index-cgtAlOl9.js → index-B9XVyhtC.js} +8028 -10767
- package/dist/{index-ClYX4COd.js → index-BGguMtc0.js} +4 -3
- package/dist/{index-CNUXbXvG.js → index-Bdg48Cus.js} +19 -6
- package/dist/{index-fHiFL1dW.js → index-BoAmM8QH.js} +29 -15
- package/dist/{index-C-OnJpT8.js → index-BtmVXdRR.js} +1 -1
- package/dist/{index-1Cdj34z1.js → index-CDTETsXQ.js} +1 -1
- package/dist/index-C_H8jFYf.js +2743 -0
- package/dist/{index-BxpbI0GH.js → index-CeafUn1o.js} +7 -7
- package/dist/{index-Dj51vqab.js → index-CiSTQhs9.js} +4 -4
- package/dist/{index-CIwdXphn.js → index-ClvaVYkG.js} +2700 -2613
- package/dist/{index-Cj6oxbl0.js → index-CnsSd5Dg.js} +11 -10
- package/dist/{index-oNMFyOGe.js → index-D3yYjyaj.js} +8 -7
- package/dist/{index-BRm0LMTo.js → index-DDzi_-Lu.js} +611 -252
- package/dist/{index-3V8E9GaZ.js → index-DOgDR_QH.js} +2 -2
- package/dist/{index-DOE2VR99.js → index-DqZX-A6e.js} +198 -198
- package/dist/{index-vKvGJ4Ve.js → index-DxhNNZ-a.js} +2 -2
- package/dist/index-DzYFQGSw.js +74 -0
- package/dist/index-I9lmcd2w.js +109 -0
- package/dist/{index-728mP6kW.js → index-iiWxryxo.js} +683 -581
- package/dist/{index-DWkuIfHy.js → index-qI1yx02a.js} +390 -232
- package/dist/{index.esm2017-CsF37oA-.js → index.esm2017-GI2alVO5.js} +177 -177
- package/dist/{loading-BJJmTFoe.js → loading-Qx5K2WL0.js} +1 -1
- package/dist/{lodash-BMJ6_hsa.js → lodash-CeSjJptg.js} +1 -1
- package/dist/{member-import-DrGxVJt9.js → member-import-Cq8G7SsW.js} +6 -5
- package/dist/{membership-CAqKihwy.js → membership-BbeavSNs.js} +3 -3
- package/dist/{money-Bf9d2ZUH.js → money-D8YIFaGA.js} +1 -1
- package/dist/{number-CWXlGZa5.js → number-DAubZ5bt.js} +1 -1
- package/dist/objectid-DeXFWDMh.js +145 -0
- package/dist/{onboarding-Dn9O7r3a.js → onboarding-SyFxaTJY.js} +25 -25
- package/dist/{onboardingSetup-BMkDoGy-.js → onboardingSetup-CLpHlBn8.js} +2 -2
- package/dist/{plugins-KDgceFWV.js → plugins-BHuaMEYA.js} +3 -3
- package/dist/{MarketingMaterialEdit-o88sdvTM.js → remy-icon-BhUGu2NI.js} +2 -1031
- package/dist/{reward-eilGRaXi.js → reward-dYWnmAC8.js} +1 -1
- package/dist/{rule-Dr9Zjg_o.js → rule-BVsfOP2h.js} +572 -492
- package/dist/style.css +1 -1
- package/dist/template-BcdtbhUJ.js +188 -0
- package/dist/{timezone-C5CIfvHs.js → timezone-CUc7q5Ii.js} +1 -1
- package/dist/{transaction.fn-Cr-FLjh0.js → transaction.fn-jF9u_cBy.js} +2 -2
- package/dist/{trigger-B0Fv6wbN.js → trigger-COlbQlaB.js} +8 -8
- package/dist/useMarketingMaterialActions-Dq6-gsOW.js +125 -0
- package/dist/{usePagination-BcA-imTr.js → usePagination-BYZB6ORK.js} +1 -1
- package/dist/{user-DRvLwlBE.js → user-DK7L8VFR.js} +1 -1
- package/dist/vue-i18n-CDSTH7g5.js +2365 -0
- package/dist/{xlsx-CBObn76o.js → xlsx-CKxXlDzD.js} +224 -224
- package/dist/{zod-DWU5EdQV.js → zod-DjtAaF0U.js} +1 -1
- package/package.json +6 -2
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Ijya9Cho.js +0 -3494
- package/dist/Marketing-BvRYzFV8.js +0 -236
- package/dist/ReviewFacebookCallback-jVlm2O8f.js +0 -238
- package/dist/Reward-DBheQiFu.js +0 -442
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CKL8MEld.js +0 -1883
- package/dist/Setting-B92JT_Y4.js +0 -2037
- package/dist/Settings-BmmM8ZnR.js +0 -179
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-3Vvqf6_H.js +0 -1264
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-7ZZ0e5tQ.js +0 -142
- package/dist/google-C3S8u0mT.js +0 -4
- package/dist/objectid-2DN5a9sY.js +0 -145
- package/dist/rule-builder-cz6Dy-no.js +0 -102
- package/dist/template-DwbazO8p.js +0 -236
- package/dist/useMarketingMaterialActions-CNk3LR9M.js +0 -96
- package/dist/vue-i18n-y7bHQpNx.js +0 -2365
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { ref as
|
|
5
|
-
import { c as
|
|
6
|
-
import { useCoreStore as
|
|
7
|
-
var
|
|
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
|
+
var Kt = { exports: {} };
|
|
8
8
|
(function(m, u) {
|
|
9
9
|
(function(d, v) {
|
|
10
10
|
v(u);
|
|
11
|
-
})(
|
|
11
|
+
})(lt, function(d) {
|
|
12
12
|
var v = { getItemSync: function(a) {
|
|
13
13
|
try {
|
|
14
14
|
return localStorage.getItem(a) || null;
|
|
@@ -127,7 +127,7 @@ var Ut = { exports: {} };
|
|
|
127
127
|
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]);
|
|
128
128
|
return a.concat(i || Array.prototype.slice.call(e));
|
|
129
129
|
}
|
|
130
|
-
var
|
|
130
|
+
var it = function a(e, t) {
|
|
131
131
|
if (e === t) return !0;
|
|
132
132
|
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
133
133
|
if (e.constructor !== t.constructor) return !1;
|
|
@@ -153,7 +153,7 @@ var Ut = { exports: {} };
|
|
|
153
153
|
function _(a, e) {
|
|
154
154
|
var t = Object.keys(e || {}).filter(function(i) {
|
|
155
155
|
var n = a == null ? void 0 : a[i], r = e == null ? void 0 : e[i];
|
|
156
|
-
return !
|
|
156
|
+
return !it(n, r);
|
|
157
157
|
});
|
|
158
158
|
return Object.keys(a || {}).filter(function(i) {
|
|
159
159
|
Object.keys(e || {}).includes(i) || t.push(i);
|
|
@@ -167,19 +167,19 @@ var Ut = { exports: {} };
|
|
|
167
167
|
function G(a) {
|
|
168
168
|
return !!a && typeof a == "object" && a.value !== void 0;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function at(a) {
|
|
171
171
|
return Object.fromEntries(Object.entries(a).map(function(e) {
|
|
172
172
|
var t = e[0], i = e[1];
|
|
173
173
|
return [t, G(i) ? i : { value: i }];
|
|
174
174
|
}));
|
|
175
175
|
}
|
|
176
|
-
function
|
|
177
|
-
return s(s({}, a), { identity: a.identity ? s(s({}, a.identity), { traits:
|
|
176
|
+
function dt(a) {
|
|
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
|
|
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 Ut = { 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
|
|
191
|
+
var P = h.flags, O = h.traits, j = h.identifier;
|
|
192
192
|
t.isLoading = !1;
|
|
193
193
|
var I = {}, A = {};
|
|
194
|
-
|
|
194
|
+
O = O || [], (P = P || []).forEach(function(y) {
|
|
195
195
|
I[y.feature.name.toLowerCase().replace(/ /g, "_")] = { id: y.feature.id, enabled: y.enabled, value: y.feature_state_value };
|
|
196
|
-
}),
|
|
196
|
+
}), O.forEach(function(y) {
|
|
197
197
|
A[y.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: y.transient, value: y.trait_value };
|
|
198
198
|
}), t.oldFlags = s({}, t.flags);
|
|
199
|
-
var
|
|
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:
|
|
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
|
|
202
|
+
var W = {};
|
|
203
203
|
Object.keys(((l = t.evaluationContext.identity) === null || l === void 0 ? void 0 : l.traits) || {}).map(function(y) {
|
|
204
|
-
|
|
204
|
+
W[Bt + y] = t.getTrait(y);
|
|
205
205
|
});
|
|
206
|
-
var
|
|
207
|
-
t.log("Setting Datadog user",
|
|
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 Ut = { 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,
|
|
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 Ut = { exports: {} };
|
|
|
263
263
|
return [r, o == null ? void 0 : o.value];
|
|
264
264
|
}));
|
|
265
265
|
}, this.setContext = function(i) {
|
|
266
|
-
var n =
|
|
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;
|
|
@@ -271,7 +271,7 @@ var Ut = { exports: {} };
|
|
|
271
271
|
return t.setContext(s(s({}, t.getContext()), i));
|
|
272
272
|
}, this.setTrait = function(i, n) {
|
|
273
273
|
var r;
|
|
274
|
-
if (t.api) return t.setContext(s(s({}, t.evaluationContext), { identity: s(s({}, t.evaluationContext.identity), { traits: s(s({}, (r = t.evaluationContext.identity) === null || r === void 0 ? void 0 : r.traits),
|
|
274
|
+
if (t.api) return t.setContext(s(s({}, t.evaluationContext), { identity: s(s({}, t.evaluationContext.identity), { traits: s(s({}, (r = t.evaluationContext.identity) === null || r === void 0 ? void 0 : r.traits), at(Object.fromEntries([[i, n]]))) }) }));
|
|
275
275
|
}, this.setTraits = function(i) {
|
|
276
276
|
var n;
|
|
277
277
|
if (t.api) return t.setContext(s(s({}, t.evaluationContext), { identity: s(s({}, t.evaluationContext.identity), { traits: s(s({}, (n = t.evaluationContext.identity) === null || n === void 0 ? void 0 : n.traits), Object.fromEntries(Object.entries(i).map(function(r) {
|
|
@@ -292,9 +292,9 @@ var Ut = { 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,
|
|
296
|
-
if (l ===
|
|
297
|
-
var j = (
|
|
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
298
|
if (j) try {
|
|
299
299
|
var I = parseFloat(j);
|
|
300
300
|
if (isNaN(I)) return Promise.reject("Failed to parse x-flagsmith-document-updated-at");
|
|
@@ -303,15 +303,15 @@ var Ut = { exports: {} };
|
|
|
303
303
|
t.log(A, "Failed to parse x-flagsmith-document-updated-at", j);
|
|
304
304
|
}
|
|
305
305
|
return t.log("Fetch response: " + p.status + " " + (n || "GET") + 0 + i), p.text().then(function(A) {
|
|
306
|
-
var
|
|
306
|
+
var k = A;
|
|
307
307
|
try {
|
|
308
|
-
|
|
308
|
+
k = JSON.parse(A);
|
|
309
309
|
} catch {
|
|
310
310
|
}
|
|
311
|
-
return !
|
|
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(
|
|
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,72 +322,72 @@ var Ut = { 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 :
|
|
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
329
|
return T(this, void 0, void 0, function() {
|
|
330
|
-
var r, o, c, h, f, l, p, F,
|
|
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
331
|
return z(this, function(N) {
|
|
332
332
|
switch (N.label) {
|
|
333
333
|
case 0:
|
|
334
|
-
r =
|
|
334
|
+
r = dt(e.evaluationContext || this.evaluationContext), N.label = 1;
|
|
335
335
|
case 1:
|
|
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,
|
|
337
|
-
if (r.identity =
|
|
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
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,
|
|
340
|
-
x.setLoadingState(s(s({}, x.loadingState), { isFetching: !1, isLoading: !1, error: L })),
|
|
341
|
-
}, this.enableLogs = A || !1, this.cacheOptions =
|
|
342
|
-
return function(
|
|
343
|
-
var
|
|
344
|
-
return new Promise(function(
|
|
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
|
+
return function(U, R) {
|
|
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 L.get(
|
|
348
|
-
|
|
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 L.post(
|
|
355
|
-
|
|
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
|
-
}(
|
|
362
|
+
}(pt)), w && this.canUseStorage && w.getItem(rt).then(function(L) {
|
|
363
363
|
try {
|
|
364
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),
|
|
370
|
-
if (
|
|
371
|
-
var
|
|
372
|
-
if (
|
|
373
|
-
var
|
|
374
|
-
x.log("Retrieved events from cache",
|
|
369
|
+
}), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), w && this.canUseStorage && w.getItem(rt, function(L, U) {
|
|
370
|
+
if (U && x.evaluationContext.environment) {
|
|
371
|
+
var R = JSON.parse(U);
|
|
372
|
+
if (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 (!
|
|
379
|
-
Qt = function(L,
|
|
378
|
+
if (!w || !this.canUseStorage) return [3, 8];
|
|
379
|
+
Qt = function(L, U) {
|
|
380
380
|
return T(x, void 0, void 0, function() {
|
|
381
|
-
var
|
|
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
382
|
return z(this, function(V) {
|
|
383
383
|
switch (V.label) {
|
|
384
384
|
case 0:
|
|
385
|
-
if (!
|
|
386
|
-
|
|
385
|
+
if (!U) return [3, 7];
|
|
386
|
+
R = null, B = null, V.label = 1;
|
|
387
387
|
case 1:
|
|
388
|
-
return V.trys.push([1, 5, , 6]), S = JSON.parse(
|
|
389
|
-
var
|
|
390
|
-
(
|
|
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
393
|
return I ? [3, 4] : [4, this.getFlags()];
|
|
@@ -404,10 +404,10 @@ var Ut = { exports: {} };
|
|
|
404
404
|
case 8:
|
|
405
405
|
return V.sent(), [3, 10];
|
|
406
406
|
case 9:
|
|
407
|
-
if (
|
|
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(
|
|
410
|
-
this._onChange(null, { isFromServer: !1, flagsChanged: _({}, this.flags), traitsChanged: _({}, (
|
|
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
412
|
V.label = 10;
|
|
413
413
|
case 10:
|
|
@@ -417,13 +417,13 @@ var Ut = { exports: {} };
|
|
|
417
417
|
});
|
|
418
418
|
}, N.label = 2;
|
|
419
419
|
case 2:
|
|
420
|
-
return N.trys.push([2, 7, , 8]),
|
|
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,
|
|
422
|
+
return [4, w.getItem(this.getStorageKey())];
|
|
423
423
|
case 4:
|
|
424
|
-
|
|
424
|
+
mt = N.sent(), N.label = 5;
|
|
425
425
|
case 5:
|
|
426
|
-
return [4, Qt(null,
|
|
426
|
+
return [4, Qt(null, mt)];
|
|
427
427
|
case 6:
|
|
428
428
|
case 7:
|
|
429
429
|
return N.sent(), [3, 8];
|
|
@@ -434,8 +434,8 @@ var Ut = { exports: {} };
|
|
|
434
434
|
case 10:
|
|
435
435
|
return N.sent(), [3, 12];
|
|
436
436
|
case 11:
|
|
437
|
-
if (
|
|
438
|
-
else if (this.flags && (
|
|
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
439
|
N.label = 12;
|
|
440
440
|
case 12:
|
|
441
441
|
return [3, 14];
|
|
@@ -472,21 +472,21 @@ var Ut = { 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),
|
|
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
|
-
|
|
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
|
}
|
|
484
484
|
}, a.prototype.setLoadingState = function(e) {
|
|
485
485
|
var t;
|
|
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
|
-
|
|
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;
|
|
@@ -499,20 +499,20 @@ var Ut = { exports: {} };
|
|
|
499
499
|
}();
|
|
500
500
|
function Vt(a) {
|
|
501
501
|
var e = a.fetch, t = a.AsyncStorage, i = a.eventSource;
|
|
502
|
-
return new
|
|
502
|
+
return new le({ fetch: e, AsyncStorage: t, eventSource: i });
|
|
503
503
|
}
|
|
504
|
-
var
|
|
505
|
-
return
|
|
504
|
+
var ot, ue = (ot = function(a, e) {
|
|
505
|
+
return ot = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, i) {
|
|
506
506
|
t.__proto__ = i;
|
|
507
507
|
} || function(t, i) {
|
|
508
508
|
for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && (t[n] = i[n]);
|
|
509
|
-
},
|
|
509
|
+
}, ot(a, e);
|
|
510
510
|
}, function(a, e) {
|
|
511
511
|
if (typeof e != "function" && e !== null) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
|
|
512
512
|
function t() {
|
|
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
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);
|
|
@@ -520,7 +520,7 @@ var Ut = { exports: {} };
|
|
|
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
|
-
},
|
|
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 Ut = { exports: {} };
|
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
538
|
return o;
|
|
539
|
-
},
|
|
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
|
-
},
|
|
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
|
|
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
|
|
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();
|
|
@@ -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 = zt(
|
|
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] =
|
|
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,34 +649,34 @@ 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
|
-
},
|
|
653
|
-
typeof window < "u" && (window.flagsmith =
|
|
652
|
+
}, qt = Vt({ AsyncStorage: v, fetch: $t, eventSource: Mt });
|
|
653
|
+
typeof window < "u" && (window.flagsmith = qt), d.createFlagsmithInstance = function() {
|
|
654
654
|
return Vt({ AsyncStorage: v, fetch: $t, eventSource: Mt });
|
|
655
|
-
}, d.default =
|
|
655
|
+
}, d.default = qt, Object.defineProperty(d, "__esModule", { value: !0 });
|
|
656
656
|
});
|
|
657
|
-
})(
|
|
658
|
-
var
|
|
657
|
+
})(Kt, Kt.exports);
|
|
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,
|
|
664
|
+
}, ne = "business", K, pe = (K = class {
|
|
665
665
|
constructor() {
|
|
666
|
-
|
|
667
|
-
|
|
666
|
+
st(this, "flagsmithClient", null);
|
|
667
|
+
st(this, "userContext", null);
|
|
668
668
|
}
|
|
669
669
|
static getInstance() {
|
|
670
670
|
return K.instance || (K.instance = new K()), K.instance;
|
|
671
671
|
}
|
|
672
672
|
ensureInitialized() {
|
|
673
673
|
if (!this.flagsmithClient)
|
|
674
|
-
throw new Error(
|
|
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 =
|
|
679
|
+
this.flagsmithClient = ge.createFlagsmithInstance();
|
|
680
680
|
const v = d.reduce((s, T) => (s[T.feature.name] = T, s), {});
|
|
681
681
|
await this.flagsmithClient.init({
|
|
682
682
|
environmentID: u.apiKey,
|
|
@@ -763,22 +763,22 @@ var he = Ut.exports, de = {
|
|
|
763
763
|
reset() {
|
|
764
764
|
this.flagsmithClient = null, this.userContext = null;
|
|
765
765
|
}
|
|
766
|
-
},
|
|
767
|
-
function
|
|
768
|
-
const u = () =>
|
|
769
|
-
if (
|
|
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),
|
|
774
|
+
await m.init(g, C), ut.value = await m.getFlags(), nt.value = !0, Y.value = null;
|
|
775
775
|
} catch (b) {
|
|
776
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),
|
|
781
|
+
await m.setUser(g), ut.value = await m.getFlags(), Y.value = null;
|
|
782
782
|
} catch (C) {
|
|
783
783
|
console.error("Failed to set user:", C), Y.value = C;
|
|
784
784
|
}
|
|
@@ -800,69 +800,85 @@ function fe(m = ge) {
|
|
|
800
800
|
if (!u()) return b;
|
|
801
801
|
try {
|
|
802
802
|
return await m.getUserFlagValue(g, C, b, G);
|
|
803
|
-
} catch (
|
|
804
|
-
return console.error(`Error getting user flag value for ${C}:`,
|
|
803
|
+
} catch (at) {
|
|
804
|
+
return console.error(`Error getting user flag value for ${C}:`, at), b;
|
|
805
805
|
}
|
|
806
|
-
},
|
|
806
|
+
}, it = async (g, C, b = null, G) => D(`${ne}-${g}`, C, b, G), _ = () => {
|
|
807
807
|
try {
|
|
808
808
|
m.reset();
|
|
809
809
|
} catch (g) {
|
|
810
810
|
console.error("Error resetting feature flags:", g);
|
|
811
811
|
} finally {
|
|
812
|
-
|
|
812
|
+
ut.value = [], nt.value = !1, Y.value = null;
|
|
813
813
|
}
|
|
814
814
|
};
|
|
815
815
|
return {
|
|
816
|
-
flags:
|
|
817
|
-
isInitialized:
|
|
818
|
-
error:
|
|
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
822
|
getFlagValue: T,
|
|
823
823
|
getFlag: z,
|
|
824
824
|
getUserFlagValue: D,
|
|
825
|
-
getBusinessFlagValue:
|
|
825
|
+
getBusinessFlagValue: it,
|
|
826
826
|
reset: _
|
|
827
827
|
};
|
|
828
828
|
}
|
|
829
|
-
var
|
|
830
|
-
function
|
|
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
|
-
var
|
|
836
|
-
const
|
|
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 ct = {
|
|
837
837
|
broadcastAppInbox: "connect_broadcast_app_inbox_countries",
|
|
838
838
|
broadcastPush: "connect_broadcast_push_countries",
|
|
839
|
-
broadcastWhatsapp: "connect_broadcast_whatsapp_countries"
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
839
|
+
broadcastWhatsapp: "connect_broadcast_whatsapp_countries",
|
|
840
|
+
whatsappBot: "connect_whatsapp_bot"
|
|
841
|
+
}, be = {
|
|
842
|
+
APP_INBOX: ct.broadcastAppInbox,
|
|
843
|
+
PUSH: ct.broadcastPush,
|
|
844
|
+
WHATSAPP: ct.broadcastWhatsapp
|
|
845
|
+
}, {
|
|
846
|
+
init: _e,
|
|
847
|
+
isInitialized: Fe,
|
|
848
|
+
setBusiness: Ee,
|
|
849
|
+
flags: oe,
|
|
850
|
+
error: ie
|
|
851
|
+
} = Se(), M = ht("loading");
|
|
852
|
+
async function Ae(m) {
|
|
853
|
+
M.value = "loading";
|
|
847
854
|
try {
|
|
848
|
-
|
|
855
|
+
if (Fe.value || await _e({ apiKey: Ce.featureFlagApiKey }), await Ee(m), ie.value) throw ie.value;
|
|
856
|
+
M.value = "ready";
|
|
849
857
|
} catch (u) {
|
|
850
|
-
console.warn("CONNECT: loadBusinessFlags failed", u);
|
|
851
|
-
} finally {
|
|
852
|
-
Kt.value = !0;
|
|
858
|
+
M.value = "error", console.warn("CONNECT: loadBusinessFlags failed", u);
|
|
853
859
|
}
|
|
854
860
|
}
|
|
855
|
-
function
|
|
856
|
-
const m =
|
|
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";
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
function je() {
|
|
871
|
+
const m = ae();
|
|
857
872
|
return (u) => {
|
|
858
|
-
const d =
|
|
859
|
-
return d ?
|
|
860
|
-
|
|
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),
|
|
861
876
|
m.currentCountry.value
|
|
862
|
-
) ? "on" : "off" : "
|
|
877
|
+
) ? "on" : "off" : "on";
|
|
863
878
|
};
|
|
864
879
|
}
|
|
865
880
|
export {
|
|
866
|
-
|
|
867
|
-
Ae as
|
|
881
|
+
je as a,
|
|
882
|
+
Ae as l,
|
|
883
|
+
Le as u
|
|
868
884
|
};
|