@feedmepos/mf-inventory-portal 1.7.0-dev.7 → 1.7.0-dev.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-CdLmQWt8.js → App-DqkccxFd.js} +4 -4
- package/dist/{ApprovalView-CSsDqhpv.js → ApprovalView-CpeNbbnJ.js} +8 -8
- package/dist/{BindingsDialog-DHJ1tvNJ.js → BindingsDialog-CXBQwYIz.js} +2 -2
- package/dist/{BindingsPicker-C8MPcvSz.js → BindingsPicker-BfHSReUF.js} +2 -2
- package/dist/{BindingsTable-52py8Ws5.js → BindingsTable-CHxIsdzV.js} +3 -3
- package/dist/{BulkReceiveRequestView-DV-Pi8Dl.js → BulkReceiveRequestView-BFFeVxQF.js} +19 -19
- package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DqEFrMvv.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BfN7GDOL.js} +1 -1
- package/dist/{ClosingDraftView-By9Ubrjj.js → ClosingDraftView-BJQgyPTs.js} +19 -19
- package/dist/{ClosingHistoryView-DPX0oThW.js → ClosingHistoryView-CLhL3Xfc.js} +5 -5
- package/dist/{ClosingTemplateView-CPfsw6Jo.js → ClosingTemplateView-DikY2_9d.js} +16 -16
- package/dist/{DefaultView-bnlvalOA.js → DefaultView-BQ0Y_nGt.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-DvCoRkS5.js → DeliveryOrderPrintPreview-DHDu2E0L.js} +2 -2
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-hclhTx1v.js → EmailDialog.vue_vue_type_script_setup_true_lang-Dqy7-a53.js} +23 -23
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Dnb11ZZu.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-BeoDswK2.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-5zyDFkIj.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B9CWp_AG.js} +2 -2
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BGeYHCo3.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Bq1UiREV.js} +2 -2
- package/dist/{FmMultiselectDialog-BmsipVZ1.js → FmMultiselectDialog-BhDa1RwT.js} +1 -1
- package/dist/{FmMultiselectDialog-C89_c6t-.js → FmMultiselectDialog-CorNT8gl.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-mZVsLfXN.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DYIDe_N1.js} +5 -5
- package/dist/{ImportView-5o7viifV.js → ImportView-C57uYZRr.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-Cf5aYcgE.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-B96kvgzW.js} +1 -1
- package/dist/{IngredientGroupView-DFtA9PGx.js → IngredientGroupView-CwhJuG3d.js} +5 -5
- package/dist/{IngredientsView-B7xgch69.js → IngredientsView-oC9fFDvT.js} +15 -15
- package/dist/{IntegrationExplorerView-WgrLMM-S.js → IntegrationExplorerView-4QvHjDRJ.js} +4 -4
- package/dist/{IntegrationView-DODVvXar.js → IntegrationView-D-DT3YJs.js} +13 -13
- package/dist/{InventoryBindingForm-BFjgIg5X.js → InventoryBindingForm-CYw_09Za.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BafAL8Ko.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-urLsGkKG.js} +5 -5
- package/dist/{InventoryBindingSummary-DIbLUq8T.js → InventoryBindingSummary-CgqWRDNo.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CmMhWVV1.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DLUlL05A.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-ChruzrrP.js → PremiumBadge.vue_vue_type_script_setup_true_lang-3m70pVwB.js} +1 -1
- package/dist/{ProductionView-DbomR0mp.js → ProductionView--WPitDlY.js} +7 -7
- package/dist/{PublishView-CY8RPc96.js → PublishView-D0kB5NQ2.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-LlaeK9yj.js → PurchaseOrderPrintPreview-B1M-Moro.js} +2 -2
- package/dist/{ReceiveRequestView-DhaH8q7H.js → ReceiveRequestView-B1NWO9ih.js} +13 -13
- package/dist/{RecipeView-BssQDDZQ.js → RecipeView-C49tT8Cr.js} +17 -17
- package/dist/{SettingsView-t33Yw-Y7.js → SettingsView-Dt7a_Nkx.js} +4 -4
- package/dist/{StockView-BS4bOyqr.js → StockView-CNzq9TSj.js} +21 -21
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DuC1cXzZ.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Cx-XCR_k.js} +1 -1
- package/dist/{SupplierView-BJvfJjTL.js → SupplierView-7EbI5cfk.js} +12 -12
- package/dist/{SurchargeView-D9MTfTxj.js → SurchargeView-BbfzwuAB.js} +6 -6
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-BDbdkJMO.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-CT0KDVR4.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-bHKvO-R3.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-nO9sybW-.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CiLaobTu.js → TransferDetails.vue_vue_type_script_setup_true_lang-DxSXLCtP.js} +20 -20
- package/dist/{TransferTemplateView-BJyvlc5A.js → TransferTemplateView-Bz5W7dh5.js} +20 -20
- package/dist/{UnitCostHistoryView-D1x3terP.js → UnitCostHistoryView-5wAtW09L.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-CQuzAchK.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-Ze6egaj8.js} +4 -4
- package/dist/{UnitView-Bt6iIBYS.js → UnitView-Mp8CL-lp.js} +7 -7
- package/dist/{WarehouseView-Ds_FmW5Y.js → WarehouseView-DRkIDq76.js} +5 -5
- package/dist/{WastageTemplateView-DEYy49G9.js → WastageTemplateView-CRLaJJnu.js} +14 -14
- package/dist/{app-C5ZjmQBL.js → app-VqA3hs6t.js} +1700 -1691
- package/dist/app.js +1 -1
- package/dist/{closing-template-C1RAVtfm.js → closing-template-CdSV_waS.js} +1 -1
- package/dist/{date2-C_I6Sj_2.js → date2-ybHWeys0.js} +1 -1
- package/dist/{dayjs.min-DLA2WeAZ.js → dayjs.min-vhlHpfOd.js} +1 -1
- package/dist/{decimal-CmyPHcIE.js → decimal-BWaV7aqI.js} +2 -2
- package/dist/{defineDeepModel-DgZRD9r1.js → defineDeepModel-Dh55Rpy6.js} +1 -1
- package/dist/{duplicate-template-YgZzxaM1.js → duplicate-template-BX4CtnXP.js} +1 -1
- package/dist/{feature-DM1fHf-j.js → feature-_v_0Btg8.js} +130 -125
- package/dist/{format-time-from-id-ZLKKvFN3.js → format-time-from-id-CcnUAvw3.js} +1 -1
- package/dist/{format-unit-display-Dh9Gkal3.js → format-unit-display-CpfisOsO.js} +12 -12
- package/dist/{import-export.helper-NRzOlfjs.js → import-export.helper-DkxUoI70.js} +6 -6
- package/dist/{index-D6ZdZoYl.js → index-BWP_Oz85.js} +3 -3
- package/dist/{index-tlUzP5gu.js → index-C2-NacLA.js} +1 -1
- package/dist/{index-CH2gGkkr.js → index-CDTURjdV.js} +1 -1
- package/dist/{inventory-core-dart.default-DEJl1cw1.js → inventory-core-dart.default-CCuIh47-.js} +1 -1
- package/dist/{jszip.min-IIc159ih.js → jszip.min-CGd5HPaQ.js} +2 -2
- package/dist/{lz-string-CLDiS3IE.js → lz-string-DaTOnDE7.js} +1 -1
- package/dist/{netsuite-DuBR2cEF.js → netsuite-Bv8m4JOq.js} +2 -2
- package/dist/{number-D80m3cTF.js → number-Blpf0ylx.js} +3 -3
- package/dist/{predefined-templates-DRyPnzlW.js → predefined-templates-CH1yqXrS.js} +1 -1
- package/dist/{purchase-order-template-BBnMW_fW.js → purchase-order-template-Hzi2jg5i.js} +1 -1
- package/dist/{recalculationUtils-DJK6lrcN.js → recalculationUtils-Bg_M-poT.js} +1 -1
- package/dist/{rules-BVYE7agw.js → rules-CyLofMuT.js} +2 -2
- package/dist/{stock-Bp5E9dDF.js → stock-DfNx3w-V.js} +1 -1
- package/dist/{stock-WZL_VV0O.js → stock-vaSdMe5e.js} +3 -3
- package/dist/stores/feature.d.ts +2 -0
- package/dist/stores/inventory.import-errors.spec.d.ts +1 -0
- package/dist/{supplier-DaLG_xt7.js → supplier-DPLDqUXZ.js} +2 -2
- package/dist/{surcharge-4CBOByoy.js → surcharge-0-XdT9aW.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-B604Aftd.js → uom-rules-CbYmI74H.js} +1 -1
- package/dist/{use-ingredient-select-dialog-C6FoBmcN.js → use-ingredient-select-dialog-g1T1s6nQ.js} +2 -2
- package/dist/{use-inventory-binding-dialog-DGSFzKVG.js → use-inventory-binding-dialog-B0AniKhu.js} +2 -2
- package/dist/{use-template-enabled-locations-D5_hVbtg.js → use-template-enabled-locations-DRkN8eSx.js} +2 -2
- package/dist/{use-transfer-locations-C8Tn4jb9.js → use-transfer-locations-BG1GERbt.js} +2 -2
- package/dist/{useHrmPermission-Cu0490uh.js → useHrmPermission-CUPAhcDP.js} +1 -1
- package/dist/{useNavigationMenu-HSwbFOrI.js → useNavigationMenu-D2onvhoK.js} +30 -30
- package/dist/{useSseClient-CptMV4gY.js → useSseClient-DvQsSC57.js} +1 -1
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftApprovalDialog.vue.d.ts +4 -2
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +8 -4
- package/dist/views/closing-draft/components/closing-draft-groups/ClosingGroupDetailSideSheet.vue.d.ts +4 -2
- package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +12 -6
- package/dist/views/closing-draft/composables/use-closing-draft-import.d.ts +2 -1
- package/dist/{vue-i18n-CXcdytIG.js → vue-i18n-CwNxhUsM.js} +1 -1
- package/dist/{xlsx.util-Dhm1k2gt.js → xlsx.util-dMHkd6XK.js} +2 -2
- package/package.json +5 -5
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var ht = Object.defineProperty;
|
|
2
|
-
var pt = (
|
|
3
|
-
var ce = (
|
|
2
|
+
var pt = (s, u, _) => u in s ? ht(s, u, { enumerable: !0, configurable: !0, writable: !0, value: _ }) : s[u] = _;
|
|
3
|
+
var ce = (s, u, _) => pt(s, typeof u != "symbol" ? u + "" : u, _);
|
|
4
4
|
import { useCoreStore as Ke } from "@feedmepos/mf-common";
|
|
5
|
-
import { Y as ve, a as ft, u as Ve, j as ot } from "./app-
|
|
5
|
+
import { Y as ve, a as ft, u as Ve, j as ot } from "./app-VqA3hs6t.js";
|
|
6
6
|
import { readonly as Ge, ref as de } from "vue";
|
|
7
|
-
import "./inventory-core-dart.default-
|
|
7
|
+
import "./inventory-core-dart.default-CCuIh47-.js";
|
|
8
8
|
var qe = { exports: {} };
|
|
9
|
-
(function(
|
|
9
|
+
(function(s, u) {
|
|
10
10
|
(function(_, p) {
|
|
11
11
|
p(u);
|
|
12
12
|
})(ve, function(_) {
|
|
@@ -34,31 +34,31 @@ var qe = { exports: {} };
|
|
|
34
34
|
e && e(a, null), n(a);
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
|
-
} },
|
|
38
|
-
return
|
|
37
|
+
} }, l = function() {
|
|
38
|
+
return l = Object.assign || function(i) {
|
|
39
39
|
for (var t, e = 1, r = arguments.length; e < r; e++) for (var n in t = arguments[e]) Object.prototype.hasOwnProperty.call(t, n) && (i[n] = t[n]);
|
|
40
40
|
return i;
|
|
41
|
-
},
|
|
41
|
+
}, l.apply(this, arguments);
|
|
42
42
|
};
|
|
43
43
|
function O(i, t, e, r) {
|
|
44
44
|
return new (e || (e = Promise))(function(n, a) {
|
|
45
|
-
function o(
|
|
45
|
+
function o(m) {
|
|
46
46
|
try {
|
|
47
|
-
d(r.next(
|
|
47
|
+
d(r.next(m));
|
|
48
48
|
} catch (c) {
|
|
49
49
|
a(c);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
function v(
|
|
52
|
+
function v(m) {
|
|
53
53
|
try {
|
|
54
|
-
d(r.throw(
|
|
54
|
+
d(r.throw(m));
|
|
55
55
|
} catch (c) {
|
|
56
56
|
a(c);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
function d(
|
|
59
|
+
function d(m) {
|
|
60
60
|
var c;
|
|
61
|
-
|
|
61
|
+
m.done ? n(m.value) : (c = m.value, c instanceof e ? c : new e(function(b) {
|
|
62
62
|
b(c);
|
|
63
63
|
})).then(o, v);
|
|
64
64
|
}
|
|
@@ -74,7 +74,7 @@ var qe = { exports: {} };
|
|
|
74
74
|
return this;
|
|
75
75
|
}), a;
|
|
76
76
|
function v(d) {
|
|
77
|
-
return function(
|
|
77
|
+
return function(m) {
|
|
78
78
|
return function(c) {
|
|
79
79
|
if (e) throw new TypeError("Generator is already executing.");
|
|
80
80
|
for (; o; ) try {
|
|
@@ -120,7 +120,7 @@ var qe = { exports: {} };
|
|
|
120
120
|
}
|
|
121
121
|
if (5 & c[0]) throw c[1];
|
|
122
122
|
return { value: c[0] ? c[1] : void 0, done: !0 };
|
|
123
|
-
}([d,
|
|
123
|
+
}([d, m]);
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
126
|
}
|
|
@@ -175,7 +175,7 @@ var qe = { exports: {} };
|
|
|
175
175
|
}));
|
|
176
176
|
}
|
|
177
177
|
function Y(i) {
|
|
178
|
-
return
|
|
178
|
+
return l(l({}, i), { identity: i.identity ? l(l({}, i.identity), { traits: $(i.identity.traits || {}) }) : void 0 });
|
|
179
179
|
}
|
|
180
180
|
(function(i) {
|
|
181
181
|
i.NONE = "NONE", i.DEFAULT_FLAGS = "DEFAULT_FLAGS", i.CACHE = "CACHE", i.SERVER = "SERVER";
|
|
@@ -185,26 +185,26 @@ var qe = { exports: {} };
|
|
|
185
185
|
var e = this;
|
|
186
186
|
this._trigger = null, this._triggerLoadingState = null, this.timestamp = null, this.isLoading = !1, this.eventSource = null, this.getFlags = function() {
|
|
187
187
|
var r = e, n = r.api, a = r.evaluationContext;
|
|
188
|
-
e.log("Get Flags"), e.isLoading = !0, e.loadingState.isFetching || e.setLoadingState(
|
|
188
|
+
e.log("Get Flags"), e.isLoading = !0, e.loadingState.isFetching || e.setLoadingState(l(l({}, e.loadingState), { isFetching: !0 }));
|
|
189
189
|
var o = "".concat(e.getContext().identity), v = function(d) {
|
|
190
|
-
var
|
|
190
|
+
var m, c, b, k;
|
|
191
191
|
if (d && o === "".concat(e.getContext().identity)) {
|
|
192
|
-
var V = d.flags,
|
|
192
|
+
var V = d.flags, I = d.traits, U = d.identifier;
|
|
193
193
|
e.isLoading = !1;
|
|
194
|
-
var
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}),
|
|
194
|
+
var F = {}, N = {};
|
|
195
|
+
I = I || [], (V = V || []).forEach(function(S) {
|
|
196
|
+
F[S.feature.name.toLowerCase().replace(/ /g, "_")] = { id: S.feature.id, enabled: S.enabled, value: S.feature_state_value };
|
|
197
|
+
}), I.forEach(function(S) {
|
|
198
198
|
N[S.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: S.transient, value: S.trait_value };
|
|
199
|
-
}), e.oldFlags =
|
|
200
|
-
var G = E(e.oldFlags,
|
|
201
|
-
if ((U || Object.keys(N).length) && (e.evaluationContext.identity =
|
|
199
|
+
}), e.oldFlags = l({}, e.flags);
|
|
200
|
+
var G = E(e.oldFlags, F), re = E((m = e.evaluationContext.identity) === null || m === void 0 ? void 0 : m.traits, N);
|
|
201
|
+
if ((U || Object.keys(N).length) && (e.evaluationContext.identity = l(l({}, e.evaluationContext.identity), { traits: N }), U && (e.evaluationContext.identity.identifier = U)), e.flags = F, e.updateStorage(), e._onChange(e.oldFlags, { isFromServer: !0, flagsChanged: G, traitsChanged: re }, e._loadedState(null, f.SERVER)), e.datadogRum) try {
|
|
202
202
|
if (e.datadogRum.trackTraits) {
|
|
203
203
|
var ie = {};
|
|
204
204
|
Object.keys(((c = e.evaluationContext.identity) === null || c === void 0 ? void 0 : c.traits) || {}).map(function(S) {
|
|
205
205
|
ie[ze + S] = e.getTrait(S);
|
|
206
206
|
});
|
|
207
|
-
var Z =
|
|
207
|
+
var Z = l(l(l({}, e.datadogRum.client.getUser()), { id: e.datadogRum.client.getUser().id || ((b = e.evaluationContext.identity) === null || b === void 0 ? void 0 : b.identifier) }), ie);
|
|
208
208
|
e.log("Setting Datadog user", Z), e.datadogRum.client.setUser(Z);
|
|
209
209
|
}
|
|
210
210
|
} catch (S) {
|
|
@@ -223,14 +223,14 @@ var qe = { exports: {} };
|
|
|
223
223
|
}
|
|
224
224
|
};
|
|
225
225
|
return a.identity ? Promise.all([a.identity.traits && Object.keys(a.identity.traits).length || !a.identity.identifier ? e.getJSON(n + "identities/", "POST", JSON.stringify({ identifier: a.identity.identifier, transient: a.identity.transient, traits: Object.entries(a.identity.traits).map(function(d) {
|
|
226
|
-
var
|
|
227
|
-
return { trait_key:
|
|
226
|
+
var m = d[0], c = d[1];
|
|
227
|
+
return { trait_key: m, trait_value: c == null ? void 0 : c.value, transient: c == null ? void 0 : c.transient };
|
|
228
228
|
}).filter(function(d) {
|
|
229
229
|
return d.trait_value !== void 0 || (e.log("Warning - attempted to set an undefined trait value for key", d.trait_key), !1);
|
|
230
230
|
}) })) : e.getJSON(n + "identities/?identifier=" + encodeURIComponent(a.identity.identifier) + (a.identity.transient ? "&transient=true" : ""))]).then(function(d) {
|
|
231
|
-
return e.evaluationContext.identity =
|
|
231
|
+
return e.evaluationContext.identity = l(l({}, e.evaluationContext.identity), { traits: {} }), v(d == null ? void 0 : d[0]);
|
|
232
232
|
}).catch(function(d) {
|
|
233
|
-
var
|
|
233
|
+
var m = d.message, c = new Error(m);
|
|
234
234
|
return Promise.reject(c);
|
|
235
235
|
}) : e.getJSON(n + "flags/").then(function(d) {
|
|
236
236
|
return v({ flags: d, traits: void 0 });
|
|
@@ -240,7 +240,7 @@ var qe = { exports: {} };
|
|
|
240
240
|
if (e.evaluationEvent && e.evaluationContext.environment && e.evaluationEvent[e.evaluationContext.environment.apiKey]) return e.evaluationEvent && Object.getOwnPropertyNames(e.evaluationEvent).length !== 0 && Object.getOwnPropertyNames(e.evaluationEvent[e.evaluationContext.environment.apiKey]).length !== 0 ? e.getJSON(r + "analytics/flags/", "POST", JSON.stringify(e.evaluationEvent[e.evaluationContext.environment.apiKey])).then(function(n) {
|
|
241
241
|
if (e.evaluationContext.environment) {
|
|
242
242
|
var a = e.getState();
|
|
243
|
-
e.evaluationEvent || (e.evaluationEvent = {}), e.evaluationEvent[e.evaluationContext.environment.apiKey] = {}, e.setState(
|
|
243
|
+
e.evaluationEvent || (e.evaluationEvent = {}), e.evaluationEvent[e.evaluationContext.environment.apiKey] = {}, e.setState(l(l({}, a), { evaluationEvent: e.evaluationEvent })), e.updateEventStorage();
|
|
244
244
|
}
|
|
245
245
|
}).catch(function(n) {
|
|
246
246
|
e.log("Exception fetching evaluationEvent", n);
|
|
@@ -265,17 +265,17 @@ var qe = { exports: {} };
|
|
|
265
265
|
}));
|
|
266
266
|
}, this.setContext = function(r) {
|
|
267
267
|
var n = Y(r);
|
|
268
|
-
return e.evaluationContext =
|
|
268
|
+
return e.evaluationContext = l(l({}, n), { environment: n.environment || e.evaluationContext.environment }), e.initialised ? e.getFlags() : Promise.resolve();
|
|
269
269
|
}, this.getContext = function() {
|
|
270
270
|
return e.evaluationContext;
|
|
271
271
|
}, this.updateContext = function(r) {
|
|
272
|
-
return e.setContext(
|
|
272
|
+
return e.setContext(l(l({}, e.getContext()), r));
|
|
273
273
|
}, this.setTrait = function(r, n) {
|
|
274
274
|
var a;
|
|
275
|
-
if (e.api) return e.setContext(
|
|
275
|
+
if (e.api) return e.setContext(l(l({}, e.evaluationContext), { identity: l(l({}, e.evaluationContext.identity), { traits: l(l({}, (a = e.evaluationContext.identity) === null || a === void 0 ? void 0 : a.traits), $(Object.fromEntries([[r, n]]))) }) }));
|
|
276
276
|
}, this.setTraits = function(r) {
|
|
277
277
|
var n;
|
|
278
|
-
if (e.api) return e.setContext(
|
|
278
|
+
if (e.api) return e.setContext(l(l({}, e.evaluationContext), { identity: l(l({}, e.evaluationContext.identity), { traits: l(l({}, (n = e.evaluationContext.identity) === null || n === void 0 ? void 0 : n.traits), Object.fromEntries(Object.entries(r).map(function(a) {
|
|
279
279
|
var o = a[0], v = a[1];
|
|
280
280
|
return [o, A(v) ? v : { value: v }];
|
|
281
281
|
}))) }) }));
|
|
@@ -289,17 +289,17 @@ var qe = { exports: {} };
|
|
|
289
289
|
}, this.getJSON = function(r, n, a) {
|
|
290
290
|
var o, v = e;
|
|
291
291
|
v.evaluationContext;
|
|
292
|
-
var d = v.headers,
|
|
293
|
-
e.evaluationContext.environment && (
|
|
292
|
+
var d = v.headers, m = { method: n || "GET", body: a, cache: "no-cache", headers: {} };
|
|
293
|
+
e.evaluationContext.environment && (m.headers["X-Environment-Key"] = e.evaluationContext.environment.apiKey), n && n !== "GET" && (m.headers["Content-Type"] = "application/json; charset=utf-8"), d && Object.assign(m.headers, d), C || console.error("Flagsmith: fetch is undefined, please specify a fetch implementation into flagsmith.init to support SSR.");
|
|
294
294
|
var c = "".concat((o = e.evaluationContext.identity) === null || o === void 0 ? void 0 : o.identifier);
|
|
295
|
-
return C(r,
|
|
296
|
-
var k, V,
|
|
297
|
-
if (c ===
|
|
295
|
+
return C(r, m).then(function(b) {
|
|
296
|
+
var k, V, I = "".concat((k = e.evaluationContext.identity) === null || k === void 0 ? void 0 : k.identifier);
|
|
297
|
+
if (c === I) {
|
|
298
298
|
var U = (V = b.headers) === null || V === void 0 ? void 0 : V.get("x-flagsmith-document-updated-at");
|
|
299
299
|
if (U) try {
|
|
300
|
-
var
|
|
301
|
-
if (isNaN(
|
|
302
|
-
e.timestamp =
|
|
300
|
+
var F = parseFloat(U);
|
|
301
|
+
if (isNaN(F)) return Promise.reject("Failed to parse x-flagsmith-document-updated-at");
|
|
302
|
+
e.timestamp = F;
|
|
303
303
|
} catch (N) {
|
|
304
304
|
e.log(N, "Failed to parse x-flagsmith-document-updated-at", U);
|
|
305
305
|
}
|
|
@@ -312,7 +312,7 @@ var qe = { exports: {} };
|
|
|
312
312
|
return !G && b.status && (G = "API Response: ".concat(b.status)), b.status && b.status >= 200 && b.status < 300 ? G : Promise.reject(new Error(G));
|
|
313
313
|
});
|
|
314
314
|
}
|
|
315
|
-
e.log("Received response with identity mismatch, ignoring response. Requested: ".concat(c, ", Current: ").concat(
|
|
315
|
+
e.log("Received response with identity mismatch, ignoring response. Requested: ".concat(c, ", Current: ").concat(I));
|
|
316
316
|
});
|
|
317
317
|
}, this.evaluateFlag = function(r, n) {
|
|
318
318
|
if (e.datadogRum && (e.datadogRum.client.addFeatureFlagEvaluation ? n === "VALUE" ? e.datadogRum.client.addFeatureFlagEvaluation(Je + r, e.getValue(r, {}, !0)) : e.datadogRum.client.addFeatureFlagEvaluation(Me + r, e.hasFeature(r, !0)) : console.error("Flagsmith: Your datadog RUM client does not support the function addFeatureFlagEvaluation, please update it.")), e.enableAnalytics) {
|
|
@@ -328,18 +328,18 @@ var qe = { exports: {} };
|
|
|
328
328
|
return i.prototype.init = function(t) {
|
|
329
329
|
var e, r, n;
|
|
330
330
|
return O(this, void 0, void 0, function() {
|
|
331
|
-
var a, o, v, d,
|
|
331
|
+
var a, o, v, d, m, c, b, k, V, I, U, F, N, G, re, ie, Z, T, S, ge, ae, Qe, Q, ye, et, tt, me, nt, be, oe, ee, rt, L = this;
|
|
332
332
|
return K(this, function(D) {
|
|
333
333
|
switch (D.label) {
|
|
334
334
|
case 0:
|
|
335
335
|
a = Y(t.evaluationContext || this.evaluationContext), D.label = 1;
|
|
336
336
|
case 1:
|
|
337
|
-
if (D.trys.push([1, 13, , 14]), o = t.environmentID, v = t.api, d = v === void 0 ? Be : v,
|
|
337
|
+
if (D.trys.push([1, 13, , 14]), o = t.environmentID, v = t.api, d = v === void 0 ? Be : v, m = t.headers, c = t.onChange, b = t.cacheFlags, k = t.datadogRum, V = t.onError, I = t.defaultFlags, U = t.fetch, F = t.preventFetch, N = t.enableLogs, G = t.enableDynatrace, re = t.enableAnalytics, ie = t.realtime, Z = t.eventSourceUrl, T = Z === void 0 ? "https://realtime.flagsmith.com/" : Z, S = t.AsyncStorage, ge = t.identity, ae = t.traits, Qe = t.state, Q = t.cacheOptions, ye = t.angularHttpClient, et = t._trigger, tt = t._triggerLoadingState, a.environment = o ? { apiKey: o } : a.environment, !a.environment || !a.environment.apiKey) throw new Error("Please provide `evaluationContext.environment` with non-empty `apiKey`");
|
|
338
338
|
if (a.identity = ge || ae ? { identifier: ge, traits: ae ? Object.fromEntries(Object.entries(ae).map(function(R) {
|
|
339
339
|
return [R[0], { value: R[1] }];
|
|
340
|
-
})) : {} } : a.identity, this.evaluationContext = a, this.api = d, this.headers =
|
|
341
|
-
L.setLoadingState(
|
|
342
|
-
}, this.enableLogs = N || !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."), U && (C = U), this.enableAnalytics = re || !1, this.flags = Object.assign({},
|
|
340
|
+
})) : {} } : a.identity, this.evaluationContext = a, this.api = d, this.headers = m, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = c, me = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = et || this._trigger, this._triggerLoadingState = tt || this._triggerLoadingState, this.onError = function(R) {
|
|
341
|
+
L.setLoadingState(l(l({}, L.loadingState), { isFetching: !1, isLoading: !1, error: R })), V == null || V(R);
|
|
342
|
+
}, this.enableLogs = N || !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."), U && (C = U), this.enableAnalytics = re || !1, this.flags = Object.assign({}, I) || {}, this.datadogRum = k || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = j !== void 0 && !!b, le = "FLAGSMITH_EVENT_" + a.environment.apiKey, S && (j = S), ie && typeof window < "u" && this.setupRealtime(T, a.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = l(l({}, this.loadingState), { isLoading: !1, source: f.DEFAULT_FLAGS })), this.setState(Qe), this.log("Initialising with properties", t, this), G && (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), ye && (C = /* @__PURE__ */ function(R) {
|
|
343
343
|
return function(q, B) {
|
|
344
344
|
var z = B.headers, x = B.method, te = B.body;
|
|
345
345
|
return new Promise(function(X) {
|
|
@@ -372,26 +372,26 @@ var qe = { exports: {} };
|
|
|
372
372
|
var B = JSON.parse(q);
|
|
373
373
|
if (B[L.evaluationContext.environment.apiKey]) {
|
|
374
374
|
var z = L.getState();
|
|
375
|
-
L.log("Retrieved events from cache", q), L.setState(
|
|
375
|
+
L.log("Retrieved events from cache", q), L.setState(l(l({}, z), { evaluationEvent: B[L.evaluationContext.environment.apiKey] }));
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
})), !b) return [3, 9];
|
|
379
379
|
if (!j || !this.canUseStorage) return [3, 8];
|
|
380
380
|
nt = function(R, q) {
|
|
381
381
|
return O(L, void 0, void 0, function() {
|
|
382
|
-
var B, z, x, te, X, M, Se, it, Ce, xe, we, Ee, Oe, ke, Te, Le, je, Pe, Ae,
|
|
382
|
+
var B, z, x, te, X, M, Se, it, Ce, xe, we, Ee, Oe, ke, Te, Le, je, Pe, Ae, Ie, Fe, Ne, Re, Ue, at = this;
|
|
383
383
|
return K(this, function(H) {
|
|
384
384
|
switch (H.label) {
|
|
385
385
|
case 0:
|
|
386
386
|
if (!q) return [3, 7];
|
|
387
387
|
B = null, z = null, H.label = 1;
|
|
388
388
|
case 1:
|
|
389
|
-
return H.trys.push([1, 5, , 6]), x = JSON.parse(q), te = !1, X = !1, x && x.api === this.api && ((xe = (Ce = x.evaluationContext) === null || Ce === void 0 ? void 0 : Ce.environment) === null || xe === void 0 ? void 0 : xe.apiKey) === ((we = this.evaluationContext.environment) === null || we === void 0 ? void 0 : we.apiKey) && (M = !0, this.evaluationContext.identity && ((Oe = (Ee = x.evaluationContext) === null || Ee === void 0 ? void 0 : Ee.identity) === null || Oe === void 0 ? void 0 : Oe.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((Te = (ke = x.evaluationContext) === null || ke === void 0 ? void 0 : ke.identity) === null || Te === void 0 ? void 0 : Te.identifier) + " to " + this.evaluationContext.identity.identifier), M = !1), this.cacheOptions.ttl && (!x.ts || (/* @__PURE__ */ new Date()).valueOf() - x.ts > this.cacheOptions.ttl) && (x.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + x.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - x.ts) + "ms"), M = !1) : x.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + x.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - x.ts) + "ms"), X = !0, M = !0)), M && (te = !0, z = E((Le = this.evaluationContext.identity) === null || Le === void 0 ? void 0 : Le.traits, (Pe = (je = x.evaluationContext) === null || je === void 0 ? void 0 : je.identity) === null || Pe === void 0 ? void 0 : Pe.traits), B = E(this.flags, x.flags), this.setState(
|
|
389
|
+
return H.trys.push([1, 5, , 6]), x = JSON.parse(q), te = !1, X = !1, x && x.api === this.api && ((xe = (Ce = x.evaluationContext) === null || Ce === void 0 ? void 0 : Ce.environment) === null || xe === void 0 ? void 0 : xe.apiKey) === ((we = this.evaluationContext.environment) === null || we === void 0 ? void 0 : we.apiKey) && (M = !0, this.evaluationContext.identity && ((Oe = (Ee = x.evaluationContext) === null || Ee === void 0 ? void 0 : Ee.identity) === null || Oe === void 0 ? void 0 : Oe.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((Te = (ke = x.evaluationContext) === null || ke === void 0 ? void 0 : ke.identity) === null || Te === void 0 ? void 0 : Te.identifier) + " to " + this.evaluationContext.identity.identifier), M = !1), this.cacheOptions.ttl && (!x.ts || (/* @__PURE__ */ new Date()).valueOf() - x.ts > this.cacheOptions.ttl) && (x.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + x.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - x.ts) + "ms"), M = !1) : x.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + x.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - x.ts) + "ms"), X = !0, M = !0)), M && (te = !0, z = E((Le = this.evaluationContext.identity) === null || Le === void 0 ? void 0 : Le.traits, (Pe = (je = x.evaluationContext) === null || je === void 0 ? void 0 : je.identity) === null || Pe === void 0 ? void 0 : Pe.traits), B = E(this.flags, x.flags), this.setState(l(l({}, x), { evaluationContext: Y(l(l({}, x.evaluationContext), { identity: !((Ae = x.evaluationContext) === null || Ae === void 0) && Ae.identity ? l(l({}, (Ie = x.evaluationContext) === null || Ie === void 0 ? void 0 : Ie.identity), { traits: l(l({}, ((Ne = (Fe = x.evaluationContext) === null || Fe === void 0 ? void 0 : Fe.identity) === null || Ne === void 0 ? void 0 : Ne.traits) || {}), ae || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", x))), te ? (Se = !F && (!this.cacheOptions.skipAPI || X), this._onChange(null, { isFromServer: !1, flagsChanged: B, traitsChanged: z }, this._loadedState(null, f.CACHE, Se)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && te && !X && this.log("Skipping API, using cache"), Se && this.getFlags().catch(function(dt) {
|
|
390
390
|
var De;
|
|
391
391
|
(De = at.onError) === null || De === void 0 || De.call(at, dt);
|
|
392
392
|
}), [3, 4]) : [3, 2];
|
|
393
393
|
case 2:
|
|
394
|
-
return
|
|
394
|
+
return F ? [3, 4] : [4, this.getFlags()];
|
|
395
395
|
case 3:
|
|
396
396
|
H.sent(), H.label = 4;
|
|
397
397
|
case 4:
|
|
@@ -401,11 +401,11 @@ var qe = { exports: {} };
|
|
|
401
401
|
case 6:
|
|
402
402
|
return [3, 10];
|
|
403
403
|
case 7:
|
|
404
|
-
return
|
|
404
|
+
return F ? [3, 9] : [4, this.getFlags()];
|
|
405
405
|
case 8:
|
|
406
406
|
return H.sent(), [3, 10];
|
|
407
407
|
case 9:
|
|
408
|
-
if (
|
|
408
|
+
if (I) this._onChange(null, { isFromServer: !1, flagsChanged: E({}, this.flags), traitsChanged: E({}, (Re = this.evaluationContext.identity) === null || Re === void 0 ? void 0 : Re.traits) }, this._loadedState(null, f.DEFAULT_FLAGS));
|
|
409
409
|
else {
|
|
410
410
|
if (!this.flags) throw new Error(me);
|
|
411
411
|
this._onChange(null, { isFromServer: !1, flagsChanged: E({}, this.flags), traitsChanged: E({}, (Ue = this.evaluationContext.identity) === null || Ue === void 0 ? void 0 : Ue.traits) }, this._loadedState(null, f.DEFAULT_FLAGS));
|
|
@@ -431,11 +431,11 @@ var qe = { exports: {} };
|
|
|
431
431
|
case 8:
|
|
432
432
|
return [3, 12];
|
|
433
433
|
case 9:
|
|
434
|
-
return
|
|
434
|
+
return F ? [3, 11] : [4, this.getFlags()];
|
|
435
435
|
case 10:
|
|
436
436
|
return D.sent(), [3, 12];
|
|
437
437
|
case 11:
|
|
438
|
-
if (
|
|
438
|
+
if (I) this._onChange(null, { isFromServer: !1, flagsChanged: E({}, I), traitsChanged: E({}, (e = a.identity) === null || e === void 0 ? void 0 : e.traits) }, this._loadedState(null, f.DEFAULT_FLAGS));
|
|
439
439
|
else if (this.flags && (oe = null, Object.keys(this.flags).length === 0 && (oe = me), this._onChange(null, { isFromServer: !1, flagsChanged: E({}, this.flags), traitsChanged: E({}, (r = a.identity) === null || r === void 0 ? void 0 : r.traits) }, this._loadedState(oe, f.DEFAULT_FLAGS)), oe)) throw new Error(oe);
|
|
440
440
|
D.label = 12;
|
|
441
441
|
case 12:
|
|
@@ -484,7 +484,7 @@ var qe = { exports: {} };
|
|
|
484
484
|
}
|
|
485
485
|
}, i.prototype.setLoadingState = function(t) {
|
|
486
486
|
var e;
|
|
487
|
-
W(t, this.loadingState) || (this.loadingState =
|
|
487
|
+
W(t, this.loadingState) || (this.loadingState = l({}, t), this.log("Loading state changed", t), (e = this._triggerLoadingState) === null || e === void 0 || e.call(this));
|
|
488
488
|
}, i.prototype.setupRealtime = function(t, e) {
|
|
489
489
|
var r = this, n = t + "sse/environments/" + e + "/stream";
|
|
490
490
|
pe ? this.eventSource || (this.log("Creating event source with url " + n), this.eventSource = new pe(n), this.eventSource.addEventListener("environment_updated", function(a) {
|
|
@@ -643,11 +643,11 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
643
643
|
return c.toLowerCase() in v;
|
|
644
644
|
} } };
|
|
645
645
|
};
|
|
646
|
-
for (var
|
|
646
|
+
for (var m in n.open(t.method || "get", i, !0), n.onload = function() {
|
|
647
647
|
n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(c, b, k) {
|
|
648
648
|
a.push(b = b.toLowerCase()), o.push([b, k]), v[b] = v[b] ? v[b] + "," + k : k;
|
|
649
649
|
}), e(d());
|
|
650
|
-
}, n.onerror = r, n.withCredentials = t.credentials == "include", t.headers) n.setRequestHeader(
|
|
650
|
+
}, n.onerror = r, n.withCredentials = t.credentials == "include", t.headers) n.setRequestHeader(m, t.headers[m]);
|
|
651
651
|
n.send(t.body || null);
|
|
652
652
|
});
|
|
653
653
|
}, Ze = He({ AsyncStorage: p, fetch: Ye, eventSource: We });
|
|
@@ -674,7 +674,7 @@ var gt = qe.exports, yt = {
|
|
|
674
674
|
if (!this.flagsmithClient)
|
|
675
675
|
try {
|
|
676
676
|
this.flagsmithClient = gt.createFlagsmithInstance();
|
|
677
|
-
const p = _.reduce((
|
|
677
|
+
const p = _.reduce((l, O) => (l[O.feature.name] = O, l), {});
|
|
678
678
|
await this.flagsmithClient.init({
|
|
679
679
|
environmentID: u.apiKey,
|
|
680
680
|
api: (u == null ? void 0 : u.url) ?? "https://feature-flag-proxy.feedme.farm/api/v1/",
|
|
@@ -705,14 +705,14 @@ var gt = qe.exports, yt = {
|
|
|
705
705
|
this.ensureInitialized();
|
|
706
706
|
const u = this.flagsmithClient.getAllFlags();
|
|
707
707
|
return Object.entries(u).map(([_, p]) => {
|
|
708
|
-
var
|
|
708
|
+
var l;
|
|
709
709
|
return {
|
|
710
710
|
feature: {
|
|
711
711
|
name: _,
|
|
712
712
|
id: (p == null ? void 0 : p.id) ?? 0
|
|
713
713
|
},
|
|
714
714
|
enabled: p.enabled,
|
|
715
|
-
value: ((
|
|
715
|
+
value: ((l = p.value) == null ? void 0 : l.toString()) ?? null
|
|
716
716
|
};
|
|
717
717
|
});
|
|
718
718
|
}
|
|
@@ -722,10 +722,10 @@ var gt = qe.exports, yt = {
|
|
|
722
722
|
if (p == null)
|
|
723
723
|
return null;
|
|
724
724
|
try {
|
|
725
|
-
const
|
|
726
|
-
return _ ? _(
|
|
727
|
-
} catch (
|
|
728
|
-
return console.error("Error transforming flag value:",
|
|
725
|
+
const l = p.toString();
|
|
726
|
+
return _ ? _(l) : typeof {} == "number" ? isNaN(Number(l)) ? null : Number(l) : typeof {} == "boolean" ? l.toLowerCase() === "true" : l;
|
|
727
|
+
} catch (l) {
|
|
728
|
+
return console.error("Error transforming flag value:", l), null;
|
|
729
729
|
}
|
|
730
730
|
}
|
|
731
731
|
getFlag(u) {
|
|
@@ -742,11 +742,11 @@ var gt = qe.exports, yt = {
|
|
|
742
742
|
value: _.toString()
|
|
743
743
|
};
|
|
744
744
|
}
|
|
745
|
-
async getUserFlagValue(u, _, p = null,
|
|
745
|
+
async getUserFlagValue(u, _, p = null, l) {
|
|
746
746
|
var K;
|
|
747
747
|
const O = this.userContext;
|
|
748
748
|
try {
|
|
749
|
-
return await this.setUser(u), this.getFlagValue(_,
|
|
749
|
+
return await this.setUser(u), this.getFlagValue(_, l) ?? p;
|
|
750
750
|
} catch (P) {
|
|
751
751
|
return console.error(`Error getting user flag value for ${_}:`, P), p;
|
|
752
752
|
} finally {
|
|
@@ -761,48 +761,48 @@ var gt = qe.exports, yt = {
|
|
|
761
761
|
this.flagsmithClient = null, this.userContext = null;
|
|
762
762
|
}
|
|
763
763
|
}, ce(J, "instance"), J), bt = mt.getInstance(), se = de(!1), _e = de([]), ne = de(null);
|
|
764
|
-
function St(
|
|
764
|
+
function St(s = bt) {
|
|
765
765
|
const u = () => se.value ? !0 : (console.warn("FeatureFlag is not initialized. Using default values."), !1), _ = async (f, C = []) => {
|
|
766
766
|
if (se.value) {
|
|
767
767
|
console.warn("FeatureFlag is already initialized.");
|
|
768
768
|
return;
|
|
769
769
|
}
|
|
770
770
|
try {
|
|
771
|
-
await
|
|
771
|
+
await s.init(f, C), _e.value = await s.getFlags(), se.value = !0, ne.value = null;
|
|
772
772
|
} catch (w) {
|
|
773
773
|
console.error("Failed to initialize feature flags:", w), ne.value = w;
|
|
774
774
|
}
|
|
775
775
|
}, p = async (f) => {
|
|
776
776
|
if (u())
|
|
777
777
|
try {
|
|
778
|
-
await
|
|
778
|
+
await s.setUser(f), _e.value = await s.getFlags(), ne.value = null;
|
|
779
779
|
} catch (C) {
|
|
780
780
|
console.error("Failed to set user:", C), ne.value = C;
|
|
781
781
|
}
|
|
782
|
-
},
|
|
782
|
+
}, l = async (f) => p(`${st}-${f}`), O = (f, C, w = null) => {
|
|
783
783
|
if (!u()) return w;
|
|
784
784
|
try {
|
|
785
|
-
return
|
|
785
|
+
return s.getFlagValue(f, C) ?? w;
|
|
786
786
|
} catch (A) {
|
|
787
787
|
return console.error(`Error getting flag value for ${f}:`, A), w;
|
|
788
788
|
}
|
|
789
789
|
}, K = (f, C) => {
|
|
790
790
|
if (!u()) return C ?? null;
|
|
791
791
|
try {
|
|
792
|
-
return
|
|
792
|
+
return s.getFlag(f) ?? C ?? null;
|
|
793
793
|
} catch (w) {
|
|
794
794
|
return console.error(`Error getting flag for ${f}:`, w), C ?? null;
|
|
795
795
|
}
|
|
796
796
|
}, P = async (f, C, w = null, A) => {
|
|
797
797
|
if (!u()) return w;
|
|
798
798
|
try {
|
|
799
|
-
return await
|
|
799
|
+
return await s.getUserFlagValue(f, C, w, A);
|
|
800
800
|
} catch ($) {
|
|
801
801
|
return console.error(`Error getting user flag value for ${C}:`, $), w;
|
|
802
802
|
}
|
|
803
803
|
}, W = async (f, C, w = null, A) => P(`${st}-${f}`, C, w, A), E = () => {
|
|
804
804
|
try {
|
|
805
|
-
|
|
805
|
+
s.reset();
|
|
806
806
|
} catch (f) {
|
|
807
807
|
console.error("Error resetting feature flags:", f);
|
|
808
808
|
} finally {
|
|
@@ -815,7 +815,7 @@ function St(l = bt) {
|
|
|
815
815
|
error: Ge(ne),
|
|
816
816
|
init: _,
|
|
817
817
|
setUser: p,
|
|
818
|
-
setBusiness:
|
|
818
|
+
setBusiness: l,
|
|
819
819
|
getFlagValue: O,
|
|
820
820
|
getFlag: K,
|
|
821
821
|
getUserFlagValue: P,
|
|
@@ -823,7 +823,7 @@ function St(l = bt) {
|
|
|
823
823
|
reset: E
|
|
824
824
|
};
|
|
825
825
|
}
|
|
826
|
-
var he = () => St(), g = /* @__PURE__ */ ((
|
|
826
|
+
var he = () => St(), g = /* @__PURE__ */ ((s) => (s.inventory_portal_must_use_transfer_template = "inventory_portal_must_use_transfer_template", s.inventory_portal_use_iframe = "inventory_portal_use_iframe", s.inventory_pos_adjust_v1 = "inventory_pos_adjust_v1", s.inventory_pos_adjust_v2_wastage = "inventory_pos_adjust_v2_wastage", s.inventory_pos_closing_recalculation = "inventory_pos_closing_recalculation", s.inventory_pos_closing_v1 = "inventory_pos_closing_v1", s.inventory_pos_closing_v2 = "inventory_pos_closing_v2", s.inventory_pos_convert_v1 = "inventory_pos_convert_v1", s.inventory_pos_costing = "inventory_pos_costing", s.inventory_pos_stock_return = "inventory_pos_stock_return", s.inventory_pos_transfer_require_fulfillment = "inventory_pos_transfer_require_fulfillment", s.inventory_purchase_order_approval = "inventory_purchase_order_approval", s.inventory_portal_xilnex_transfer_note = "inventory_portal_xilnex_transfer_note", s.inventory_portal_custom_attribute = "inventory_portal_custom_attribute", s.inventory_portal_purchase_order_v2 = "inventory_portal_purchase_order_v2", s.inventory_portal_accept_require_fulfillment = "inventory_portal_accept_require_fulfillment", s.inventory_portal_po_operate_v2 = "inventory_portal_po_operate_v2", s.inventory_pos_allow_receive_order = "inventory_pos_allow_receive_order", s.inventory_xilnex_opening_migration = "inventory_xilnex_opening_migration", s.inventory_ingredient_group = "inventory_ingredient_group", s.inventory_purchase_order_backdate = "inventory_purchase_order_backdate", s.inventory_synergy_opening_migration = "inventory_synergy_opening_migration", s.inventory_netsuite_inventory_transfer_out = "inventory_netsuite_inventory_transfer_out", s.inventory_portal_supplier_preparation_time = "inventory_portal_supplier_preparation_time", s.inventory_backdate_receive = "inventory_backdate_receive", s.inventory_portal_delivery_order_write = "inventory_portal_delivery_order_write", s.inventory_purchase_order_custom_cost = "inventory_purchase_order_custom_cost", s.inventory_bulk_import = "inventory_bulk_import", s.inventory_portal_surcharge = "inventory_portal_surcharge", s.inventory_purchase_order_cost_edit = "inventory_purchase_order_cost_edit", s.inventory_purchase_order_price_adjustment = "inventory_purchase_order_price_adjustment", s.inventory_purchase_order_workflow_allow_to_mark_completed = "inventory_purchase_order_workflow_allow_to_mark_completed", s.inventory_recipe_v2 = "inventory_recipe_v2", s.inventory_print_template = "inventory_print_template", s.inventory_purchase_order_email = "inventory_purchase_order_email", s.inventory_bulk_edit_recipes = "inventory_bulk_edit_recipes", s.inventory_stocksnapshot_cron_beta = "inventory_stocksnapshot_cron_beta", s.inventory_scheduler_daily_stock_snapshot = "inventory_scheduler_daily_stock_snapshot", s.inventory_scheduler_hourly_recalculation = "inventory_scheduler_hourly_recalculation", s.inventory_portal_production_item = "inventory_portal_production_item", s))(g || {});
|
|
827
827
|
const Ct = /* @__PURE__ */ new Set([
|
|
828
828
|
// vivo pizza prod
|
|
829
829
|
"business_6687e91fa7240b001ba3f4c2",
|
|
@@ -872,6 +872,7 @@ function lt() {
|
|
|
872
872
|
inventory_purchase_order_email: !1,
|
|
873
873
|
inventory_bulk_edit_recipes: !1,
|
|
874
874
|
inventory_receive_request_beta: !1,
|
|
875
|
+
inventory_portal_production_item: !1,
|
|
875
876
|
report_portal_po_forecast_days_constraint: null,
|
|
876
877
|
report_portal_po_forecast_days_default: 7
|
|
877
878
|
};
|
|
@@ -887,11 +888,11 @@ const h = de(lt()), wt = () => ({
|
|
|
887
888
|
},
|
|
888
889
|
get restaurantPosVersion() {
|
|
889
890
|
var _;
|
|
890
|
-
const
|
|
891
|
+
const s = Ve();
|
|
891
892
|
return (_ = Ke().restaurants.value.find(
|
|
892
893
|
(p) => {
|
|
893
|
-
var
|
|
894
|
-
return p._id === ((
|
|
894
|
+
var l;
|
|
895
|
+
return p._id === ((l = s._currentLocation) == null ? void 0 : l.doc._id);
|
|
895
896
|
}
|
|
896
897
|
)) == null ? void 0 : _.posVersion;
|
|
897
898
|
},
|
|
@@ -999,6 +1000,9 @@ const h = de(lt()), wt = () => ({
|
|
|
999
1000
|
get enableReceiveRequestBeta() {
|
|
1000
1001
|
return h.value.inventory_receive_request_beta;
|
|
1001
1002
|
},
|
|
1003
|
+
get enableProductionItem() {
|
|
1004
|
+
return h.value.inventory_portal_production_item;
|
|
1005
|
+
},
|
|
1002
1006
|
get poForecastDaysConstraint() {
|
|
1003
1007
|
return h.value.report_portal_po_forecast_days_constraint;
|
|
1004
1008
|
},
|
|
@@ -1006,9 +1010,9 @@ const h = de(lt()), wt = () => ({
|
|
|
1006
1010
|
return h.value.report_portal_po_forecast_days_default;
|
|
1007
1011
|
},
|
|
1008
1012
|
async init() {
|
|
1009
|
-
const
|
|
1013
|
+
const s = Ke(), { init: u, setBusiness: _ } = he(), p = ft(), l = s.namespace.value === "prod";
|
|
1010
1014
|
await u({
|
|
1011
|
-
apiKey:
|
|
1015
|
+
apiKey: l ? "6GhcttsJ9Rj9cTevcdrpin" : "MaGoXrEWuEJNpWgKTqseee"
|
|
1012
1016
|
// url: 'https://flag.feedme.farm/api/v1/', // optional -> this is a default URL value
|
|
1013
1017
|
// enableAnalytics: true, // optional, defaults to true
|
|
1014
1018
|
// cacheFlags: true // optional, defaults to true
|
|
@@ -1018,71 +1022,72 @@ const h = de(lt()), wt = () => ({
|
|
|
1018
1022
|
h.value = lt();
|
|
1019
1023
|
return;
|
|
1020
1024
|
}
|
|
1021
|
-
const P = ((A =
|
|
1025
|
+
const P = ((A = s.currentBusiness.value) == null ? void 0 : A._id) ?? "";
|
|
1022
1026
|
await _(P);
|
|
1023
1027
|
const W = `business_${P}`, E = K.type === ot.enum.warehouse, f = (
|
|
1024
1028
|
// if menu v4, must manual receive && must use outlet app
|
|
1025
|
-
(($ =
|
|
1029
|
+
(($ = s.currentBusiness.value) == null ? void 0 : $.menuVersion) === "v4" && // more guard for businesses using menu v4, only those listed for manual receive will be included
|
|
1026
1030
|
// TODO: may be removed to use menu version only
|
|
1027
1031
|
Ct.has(this.businessDbName)
|
|
1028
|
-
), C = xt.has(W) ||
|
|
1032
|
+
), C = xt.has(W) || y(g.inventory_portal_must_use_transfer_template), w = y(g.inventory_purchase_order_backdate) && (this.isWarehouse || p.state.closing !== null);
|
|
1029
1033
|
h.value = {
|
|
1030
1034
|
isLoaded: !0,
|
|
1031
|
-
enableTotalCost: ((Y =
|
|
1035
|
+
enableTotalCost: ((Y = s.currentBusiness.value) == null ? void 0 : Y.menuVersion) === "v4",
|
|
1032
1036
|
enableBackdatePo: w,
|
|
1033
1037
|
autoReceiveWarehouse: E && !f,
|
|
1034
1038
|
manualReceive: f,
|
|
1035
1039
|
enablePoTemplate: C,
|
|
1036
|
-
enableClosingTemplate:
|
|
1037
|
-
enableWastageTemplate:
|
|
1038
|
-
enableIngredientGroup:
|
|
1040
|
+
enableClosingTemplate: y(g.inventory_pos_closing_v2),
|
|
1041
|
+
enableWastageTemplate: y(g.inventory_pos_adjust_v2_wastage),
|
|
1042
|
+
enableIngredientGroup: y(g.inventory_ingredient_group),
|
|
1039
1043
|
mustUsePoTemplate: C,
|
|
1040
1044
|
businessSupplierOnly: C,
|
|
1041
|
-
enableXilnexTransferNote:
|
|
1042
|
-
enableCustomAttribute:
|
|
1043
|
-
usePurchaseOrderV2:
|
|
1044
|
-
acceptRequireFulfillment:
|
|
1045
|
+
enableXilnexTransferNote: y(g.inventory_portal_xilnex_transfer_note),
|
|
1046
|
+
enableCustomAttribute: y(g.inventory_portal_custom_attribute),
|
|
1047
|
+
usePurchaseOrderV2: y(g.inventory_portal_purchase_order_v2),
|
|
1048
|
+
acceptRequireFulfillment: y(
|
|
1045
1049
|
g.inventory_portal_accept_require_fulfillment
|
|
1046
1050
|
),
|
|
1047
|
-
useOperatePurchaseOrderV2:
|
|
1048
|
-
inventory_xilnex_opening_migration:
|
|
1051
|
+
useOperatePurchaseOrderV2: y(g.inventory_portal_po_operate_v2),
|
|
1052
|
+
inventory_xilnex_opening_migration: y(
|
|
1049
1053
|
g.inventory_xilnex_opening_migration
|
|
1050
1054
|
),
|
|
1051
|
-
inventory_synergy_opening_migration:
|
|
1055
|
+
inventory_synergy_opening_migration: y(
|
|
1052
1056
|
g.inventory_synergy_opening_migration
|
|
1053
1057
|
),
|
|
1054
|
-
inventory_netsuite_inventory_transfer_out:
|
|
1058
|
+
inventory_netsuite_inventory_transfer_out: y(
|
|
1055
1059
|
g.inventory_netsuite_inventory_transfer_out
|
|
1056
1060
|
),
|
|
1057
|
-
inventory_portal_supplier_preparation_time:
|
|
1061
|
+
inventory_portal_supplier_preparation_time: y(
|
|
1058
1062
|
g.inventory_portal_supplier_preparation_time
|
|
1059
1063
|
),
|
|
1060
|
-
inventory_portal_delivery_order_write:
|
|
1064
|
+
inventory_portal_delivery_order_write: y(
|
|
1061
1065
|
g.inventory_portal_delivery_order_write
|
|
1062
1066
|
),
|
|
1063
|
-
inventory_pos_transfer_require_fulfillment:
|
|
1067
|
+
inventory_pos_transfer_require_fulfillment: y(
|
|
1064
1068
|
g.inventory_pos_transfer_require_fulfillment
|
|
1065
1069
|
),
|
|
1066
|
-
inventory_backdate_receive:
|
|
1067
|
-
inventory_purchase_order_custom_cost:
|
|
1070
|
+
inventory_backdate_receive: y(g.inventory_backdate_receive),
|
|
1071
|
+
inventory_purchase_order_custom_cost: y(
|
|
1068
1072
|
g.inventory_purchase_order_custom_cost
|
|
1069
1073
|
),
|
|
1070
|
-
inventory_bulk_import:
|
|
1071
|
-
inventory_portal_surcharge:
|
|
1072
|
-
inventory_purchase_order_cost_edit:
|
|
1074
|
+
inventory_bulk_import: y(g.inventory_bulk_import),
|
|
1075
|
+
inventory_portal_surcharge: y(g.inventory_portal_surcharge),
|
|
1076
|
+
inventory_purchase_order_cost_edit: y(
|
|
1073
1077
|
g.inventory_purchase_order_cost_edit
|
|
1074
1078
|
),
|
|
1075
|
-
inventory_purchase_order_price_adjustment:
|
|
1079
|
+
inventory_purchase_order_price_adjustment: y(
|
|
1076
1080
|
g.inventory_purchase_order_price_adjustment
|
|
1077
1081
|
),
|
|
1078
|
-
inventory_purchase_order_workflow_allow_to_mark_completed:
|
|
1082
|
+
inventory_purchase_order_workflow_allow_to_mark_completed: y(
|
|
1079
1083
|
g.inventory_purchase_order_workflow_allow_to_mark_completed
|
|
1080
1084
|
),
|
|
1081
|
-
inventory_recipe_v2:
|
|
1082
|
-
inventory_print_template:
|
|
1083
|
-
inventory_purchase_order_email:
|
|
1084
|
-
inventory_bulk_edit_recipes:
|
|
1085
|
-
inventory_receive_request_beta:
|
|
1085
|
+
inventory_recipe_v2: y(g.inventory_recipe_v2),
|
|
1086
|
+
inventory_print_template: y(g.inventory_print_template),
|
|
1087
|
+
inventory_purchase_order_email: y(g.inventory_purchase_order_email),
|
|
1088
|
+
inventory_bulk_edit_recipes: y(g.inventory_bulk_edit_recipes),
|
|
1089
|
+
inventory_receive_request_beta: y("inventory_receive_request_beta"),
|
|
1090
|
+
inventory_portal_production_item: y(g.inventory_portal_production_item),
|
|
1086
1091
|
report_portal_po_forecast_days_constraint: Et(
|
|
1087
1092
|
"report_portal_po_forecast_days_constraint"
|
|
1088
1093
|
),
|
|
@@ -1093,28 +1098,28 @@ const h = de(lt()), wt = () => ({
|
|
|
1093
1098
|
};
|
|
1094
1099
|
}, "feature");
|
|
1095
1100
|
},
|
|
1096
|
-
async awaitFeatureLoaded(
|
|
1101
|
+
async awaitFeatureLoaded(s) {
|
|
1097
1102
|
return new Promise((u) => {
|
|
1098
1103
|
const _ = () => {
|
|
1099
|
-
h.value.isLoaded ? u(
|
|
1104
|
+
h.value.isLoaded ? u(s()) : setTimeout(_, 100);
|
|
1100
1105
|
};
|
|
1101
1106
|
_();
|
|
1102
1107
|
});
|
|
1103
1108
|
}
|
|
1104
1109
|
});
|
|
1105
|
-
function
|
|
1110
|
+
function y(s, u) {
|
|
1106
1111
|
u = u === void 0 ? null : u;
|
|
1107
1112
|
const { getFlagValue: _ } = he();
|
|
1108
|
-
return _(
|
|
1113
|
+
return _(s, (p) => p === "true") ?? u;
|
|
1109
1114
|
}
|
|
1110
|
-
function Et(
|
|
1115
|
+
function Et(s) {
|
|
1111
1116
|
const { getFlagValue: u } = he();
|
|
1112
|
-
return u(
|
|
1117
|
+
return u(s, (p) => p.trim() ? p.trim() : null) ?? null;
|
|
1113
1118
|
}
|
|
1114
|
-
function Ot(
|
|
1119
|
+
function Ot(s, u) {
|
|
1115
1120
|
const { getFlagValue: _ } = he();
|
|
1116
|
-
return _(
|
|
1117
|
-
const O = parseInt(
|
|
1121
|
+
return _(s, (l) => {
|
|
1122
|
+
const O = parseInt(l, 10);
|
|
1118
1123
|
return isNaN(O) ? null : O;
|
|
1119
1124
|
}) ?? u;
|
|
1120
1125
|
}
|