@feedmepos/mf-inventory-portal 1.6.3 → 1.7.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-C9leB4t0.js → App-BT6KYW8H.js} +6 -6
- package/dist/{ApprovalView-CqOXr5Hw.js → ApprovalView-Blu45mX4.js} +15 -15
- package/dist/{BindingsDialog-DRalvlwp.js → BindingsDialog-Ffb3DqzR.js} +3 -3
- package/dist/{BindingsPicker-zXli3Z1x.js → BindingsPicker-DJSieUGU.js} +6 -6
- package/dist/{BindingsTable--VoNPh7F.js → BindingsTable-BM_fnYD0.js} +5 -5
- package/dist/{BulkReceiveRequestView-Bon7uDCJ.js → BulkReceiveRequestView-LLE0EWF2.js} +36 -36
- package/dist/ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DlW8baJa.js +126 -0
- package/dist/{ClosingDraftView-CdxQiwuz.js → ClosingDraftView-SLu2RsF2.js} +41 -40
- package/dist/{ClosingHistoryView-CTkdBXBa.js → ClosingHistoryView-DavlvyI8.js} +8 -8
- package/dist/{ClosingTemplateView-h9ohxtwI.js → ClosingTemplateView-CfOmfFEo.js} +18 -18
- package/dist/{DefaultView-CLRzOH5K.js → DefaultView-BG6SM2dx.js} +4 -4
- package/dist/{DeliveryOrderPrintPreview-vgPmHbtx.js → DeliveryOrderPrintPreview-CTZqCk5h.js} +19 -19
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-CE9wwNB_.js → EmailDialog.vue_vue_type_script_setup_true_lang-CeuncSiy.js} +9313 -9301
- package/dist/{FmAdminBadge-DjnBAgyv.js → FmAdminBadge-DlplQOHb.js} +6 -6
- package/dist/{FmConfirmationButton.vue_vue_type_script_setup_true_lang-DLrMEGFR.js → FmConfirmationButton.vue_vue_type_script_setup_true_lang-Vg8U7WMZ.js} +5 -5
- package/dist/{FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js → FmCustomAttribute.vue_vue_type_script_setup_true_lang-CG1m-B2p.js} +6 -6
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-DTeWGr5O.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-BoP7islj.js} +3 -3
- package/dist/{FmDroppableField-J0xUsOTV.js → FmDroppableField-J0tG_U3w.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DaXycWeg.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Cp-IGhN8.js} +3 -3
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CbD3tpTg.js +118 -0
- package/dist/{FmMultiselectDialog-Bnouf9vX.js → FmMultiselectDialog-Btgi9bcG.js} +4 -4
- package/dist/{FmMultiselectDialog-BAMaksR7.js → FmMultiselectDialog-CYMF7L6M.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DnfFPNWn.js → FmUnitInput.vue_vue_type_script_setup_true_lang-p5zOSCsD.js} +9 -9
- package/dist/{ImportView-DYhLRkQA.js → ImportView-Druqo-SE.js} +11 -11
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-B4n5-iRK.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BrCQtful.js} +5 -5
- package/dist/{IngredientGroupView-Dn15H-1E.js → IngredientGroupView-X9-rsWxq.js} +9 -9
- package/dist/{IngredientsView-9sp4RWOF.js → IngredientsView-3VjrRo6Q.js} +26 -26
- package/dist/{IntegrationExplorerView-DSj9e9rb.js → IntegrationExplorerView-BsI1wdMs.js} +3897 -3898
- package/dist/{IntegrationView-DbcMnd4z.js → IntegrationView-DnClTLe8.js} +18 -18
- package/dist/{InventoryBindingForm-6OXalr29.js → InventoryBindingForm-GzG-Hd2M.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-6-CNpE55.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BRUPz8Nd.js} +6 -6
- package/dist/{InventoryBindingSummary-h7b4l6Wb.js → InventoryBindingSummary-CziMAdeu.js} +3 -3
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Cq_SuRtd.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-E8xHqN0A.js} +3 -3
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-7CXXGTvk.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Dn_l93Az.js} +3 -3
- package/dist/{PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js → PreviewBadge.vue_vue_type_script_setup_true_lang-DX2MJqL4.js} +2 -2
- package/dist/ProductionView-C5y_oeQ1.js +1330 -0
- package/dist/{PublishView-BNml0c7h.js → PublishView-DLaq3CIv.js} +7 -7
- package/dist/{PurchaseOrderPrintPreview-DMQ4-abx.js → PurchaseOrderPrintPreview-CfOxPPTs.js} +17 -17
- package/dist/{ReceiveRequestView-BTHWRSHt.js → ReceiveRequestView-CW0zq5Mi.js} +19 -19
- package/dist/{RecipeView-D7pdeDlr.js → RecipeView-MGQvVVkQ.js} +23 -23
- package/dist/{SettingsView-Ce3Fbejt.js → SettingsView-BAPGIrw5.js} +9 -9
- package/dist/{SingleColumnLayout.vue_vue_type_script_setup_true_lang-DGlWE5I8.js → SingleColumnLayout.vue_vue_type_script_setup_true_lang-DwrLsWX_.js} +2 -2
- package/dist/{StockView-BGH5uWNi.js → StockView-D1RGEL2U.js} +59 -58
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BegeXje7.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CzBZq9Vn.js} +8 -8
- package/dist/{SupplierView-BuyycuNM.js → SupplierView-CMH0w0sM.js} +201 -205
- package/dist/{SurchargeView-B3O9a7WC.js → SurchargeView-DTGGjNJz.js} +11 -11
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-TJ4VhnI3.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-CmYuaLTY.js} +4 -4
- package/dist/{TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js → TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js} +7 -7
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BgkgLkWo.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CZ-CIM6O.js} +4 -4
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-9_7cUWrk.js +4607 -0
- package/dist/{TransferTemplateView-CehWEgcU.js → TransferTemplateView-BHRlpNZL.js} +24 -24
- package/dist/{UnitCostHistoryView-N9UZOJVt.js → UnitCostHistoryView-DTcMOBYp.js} +8 -8
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-DpVe38HB.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-tnwNEshB.js} +9 -9
- package/dist/{UnitView-YB56lxTp.js → UnitView-CmaNofZF.js} +11 -11
- package/dist/{WarehouseView-DtBYtULO.js → WarehouseView-CrZOVqtW.js} +9 -9
- package/dist/{WastageTemplateView-BJQ94zo8.js → WastageTemplateView-oS1mOuVs.js} +18 -18
- package/dist/api/production.d.ts +29 -0
- package/dist/{app-DiX-EfV6.js → app-C39bYJmq.js} +283 -283
- package/dist/{app-CnwVdB-r.js → app-DurCmkYx.js} +6901 -6691
- package/dist/app.js +1 -1
- package/dist/{closing-template-B0GQRFlS.js → closing-template--ylzHY8o.js} +1 -1
- package/dist/{date2-CaCMUbxN.js → date2-Ci_bWmXL.js} +1 -1
- package/dist/{dayjs.min-C413l7qz.js → dayjs.min-C1KEGVyY.js} +3 -3
- package/dist/{decimal-dpWXqHCT.js → decimal-CqES0LqS.js} +2 -2
- package/dist/{defineDeepModel-wTAgCIGa.js → defineDeepModel-CPc4-vVR.js} +1 -1
- package/dist/{duplicate-template-DTkeAcof.js → duplicate-template-7WtxyOgk.js} +1 -1
- package/dist/{feature-CSsMjXm4.js → feature-BhtPIg0j.js} +209 -206
- package/dist/{format-time-from-id-A1BqDOzj.js → format-time-from-id-da6PCU8D.js} +1 -1
- package/dist/{format-unit-display-CHS1Vvqm.js → format-unit-display-DfnibgdI.js} +24 -25
- package/dist/{import-export.helper-C8qIeMrV.js → import-export.helper-OeITQ-ew.js} +6 -6
- package/dist/{index-CEbJe2zv.js → index-63f31zwB.js} +11 -15
- package/dist/{index-CCdOkfwD.js → index-C4oo6Jir.js} +3 -3
- package/dist/{index-dgiwVVtQ.js → index-CKo4S3fc.js} +1 -1
- package/dist/inventory-core-dart.default-CjR1Ux6B.js +25015 -0
- package/dist/{jszip.min-k8R8v9tK.js → jszip.min-wa9dg6V2.js} +133 -133
- package/dist/{lz-string-OLkSz-NK.js → lz-string-CEq3F4OR.js} +33 -34
- package/dist/{menu-usage-module-D7cxkbEk.js → menu-usage-module-BdjYEk3s.js} +5 -5
- package/dist/{netsuite-Cm4tUcLt.js → netsuite-BYihdmW3.js} +145 -145
- package/dist/{number-CF9W8sDX.js → number-DIjdjQTT.js} +3 -3
- package/dist/{predefined-templates-DmBAGnMN.js → predefined-templates-BZ5B0n2R.js} +4 -13
- package/dist/{purchase-order-template-C0ynPqX6.js → purchase-order-template-ri08SOOi.js} +1 -1
- package/dist/{recalculationUtils-pDs8JNho.js → recalculationUtils-7tP21R_L.js} +1 -1
- package/dist/router/name.d.ts +1 -0
- package/dist/{rules-CYCN4sgu.js → rules-De93ckqk.js} +2 -2
- package/dist/{stock-D8S1alJa.js → stock-DvslvTup.js} +1 -1
- package/dist/stock-oKttHRVV.js +75 -0
- package/dist/stores/feature.d.ts +2 -0
- package/dist/{supplier-CiPnrjsq.js → supplier-otlIc6_E.js} +2 -2
- package/dist/{surcharge-CanooUK6.js → surcharge-DMLazg9b.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-eVbKU0_1.js → uom-rules-BVc5JsZO.js} +1 -1
- package/dist/{use-ingredient-select-dialog-Lpcjl8Ws.js → use-ingredient-select-dialog-C3H4EuIT.js} +2 -2
- package/dist/{use-inventory-binding-dialog-CA_03e_q.js → use-inventory-binding-dialog-BlLaBr8C.js} +2 -2
- package/dist/{use-template-enabled-locations-CWMCe4nl.js → use-template-enabled-locations-CwXGrrU2.js} +2 -2
- package/dist/{use-transfer-locations-rvGiFI0e.js → use-transfer-locations-DAMl3X7w.js} +2 -2
- package/dist/{useHrmPermission-wOFwl59u.js → useHrmPermission-hRmteNSl.js} +1 -1
- package/dist/{useNavigationMenu-BoDv65KI.js → useNavigationMenu-CNhXOgEu.js} +12 -7
- package/dist/useSseClient-Cn8CX__U.js +453 -0
- package/dist/views/production/ProductionBindingsCell.vue.d.ts +29 -0
- package/dist/views/production/ProductionCompletionDialog.vue.d.ts +32 -0
- package/dist/views/production/ProductionDetailSheet.vue.d.ts +38 -0
- package/dist/views/production/ProductionDuplicateDialog.vue.d.ts +280 -0
- package/dist/views/production/ProductionPrepareBuilder.vue.d.ts +6 -0
- package/dist/views/production/ProductionView.vue.d.ts +2 -0
- package/dist/views/receive-request/components/price-adjustment/PriceAdjustmentEditForm.vue.d.ts +19 -0
- package/dist/views/receive-request/components/price-adjustment/PriceAdjustmentEditor.vue.d.ts +18 -0
- package/dist/views/receive-request/components/price-adjustment/PriceAdjustmentList.vue.d.ts +33 -0
- package/dist/views/receive-request/components/price-adjustment/use-price-adjustment-form-controller.d.ts +9 -0
- package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +10 -0
- package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +20 -0
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +120 -0
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +140 -0
- package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +100 -0
- package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-table.d.ts +20 -0
- package/dist/vue-i18n-DeNNnVic.js +2351 -0
- package/dist/{xlsx.util-0_Y_Q66v.js → xlsx.util-B8IJR8tZ.js} +3710 -3720
- package/package.json +3 -3
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CL9YNazx.js +0 -237
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CwY2xCQV.js +0 -4360
- package/dist/inventory-core-dart.default-CBuBQE02.js +0 -18716
- package/dist/useSseClient-DbWYwuT8.js +0 -524
- package/dist/vue-i18n-Bov_Y0eC.js +0 -2365
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
var ht = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var ce = (l, u, _) =>
|
|
2
|
+
var pt = (l, u, _) => u in l ? ht(l, u, { enumerable: !0, configurable: !0, writable: !0, value: _ }) : l[u] = _;
|
|
3
|
+
var ce = (l, u, _) => pt(l, typeof u != "symbol" ? u + "" : u, _);
|
|
4
4
|
import { useCoreStore as Ke } from "@feedmepos/mf-common";
|
|
5
|
-
import { Y as ve,
|
|
6
|
-
import {
|
|
7
|
-
import "./inventory-core-dart.default-
|
|
5
|
+
import { Y as ve, a as ft, u as Ve, j as ot } from "./app-DurCmkYx.js";
|
|
6
|
+
import { readonly as Ge, ref as de } from "vue";
|
|
7
|
+
import "./inventory-core-dart.default-CjR1Ux6B.js";
|
|
8
8
|
var qe = { exports: {} };
|
|
9
9
|
(function(l, u) {
|
|
10
|
-
(function(_,
|
|
11
|
-
|
|
10
|
+
(function(_, p) {
|
|
11
|
+
p(u);
|
|
12
12
|
})(ve, function(_) {
|
|
13
|
-
var
|
|
13
|
+
var p = { getItemSync: function(i) {
|
|
14
14
|
try {
|
|
15
15
|
return localStorage.getItem(i) || null;
|
|
16
16
|
} catch {
|
|
@@ -42,24 +42,24 @@ var qe = { exports: {} };
|
|
|
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(y) {
|
|
46
46
|
try {
|
|
47
|
-
d(r.next(
|
|
47
|
+
d(r.next(y));
|
|
48
48
|
} catch (c) {
|
|
49
49
|
a(c);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
function v(
|
|
52
|
+
function v(y) {
|
|
53
53
|
try {
|
|
54
|
-
d(r.throw(
|
|
54
|
+
d(r.throw(y));
|
|
55
55
|
} catch (c) {
|
|
56
56
|
a(c);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
function d(
|
|
59
|
+
function d(y) {
|
|
60
60
|
var c;
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
y.done ? n(y.value) : (c = y.value, c instanceof e ? c : new e(function(b) {
|
|
62
|
+
b(c);
|
|
63
63
|
})).then(o, v);
|
|
64
64
|
}
|
|
65
65
|
d((r = r.apply(i, [])).next());
|
|
@@ -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(y) {
|
|
78
78
|
return function(c) {
|
|
79
79
|
if (e) throw new TypeError("Generator is already executing.");
|
|
80
80
|
for (; o; ) try {
|
|
@@ -113,18 +113,18 @@ var qe = { exports: {} };
|
|
|
113
113
|
continue;
|
|
114
114
|
}
|
|
115
115
|
c = t.call(i, o);
|
|
116
|
-
} catch (
|
|
117
|
-
c = [6,
|
|
116
|
+
} catch (b) {
|
|
117
|
+
c = [6, b], r = 0;
|
|
118
118
|
} finally {
|
|
119
119
|
e = n = 0;
|
|
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, y]);
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function P(i, t, e) {
|
|
128
128
|
for (var r, n = 0, a = t.length; n < a; n++) !r && n in t || (r || (r = Array.prototype.slice.call(t, 0, n)), r[n] = t[n]);
|
|
129
129
|
return i.concat(r || Array.prototype.slice.call(t));
|
|
130
130
|
}
|
|
@@ -151,7 +151,7 @@ var qe = { exports: {} };
|
|
|
151
151
|
}
|
|
152
152
|
return t != t && e != e;
|
|
153
153
|
};
|
|
154
|
-
function
|
|
154
|
+
function E(i, t) {
|
|
155
155
|
var e = Object.keys(t || {}).filter(function(r) {
|
|
156
156
|
var n = i == null ? void 0 : i[r], a = t == null ? void 0 : t[r];
|
|
157
157
|
return !W(n, a);
|
|
@@ -160,18 +160,18 @@ var qe = { exports: {} };
|
|
|
160
160
|
Object.keys(t || {}).includes(r) || e.push(r);
|
|
161
161
|
}), Object.keys(e).length ? e : null;
|
|
162
162
|
}
|
|
163
|
-
var
|
|
164
|
-
function
|
|
163
|
+
var f, C;
|
|
164
|
+
function w(i, t, e) {
|
|
165
165
|
var r = "shortString", n = !0;
|
|
166
166
|
typeof e == "number" && (r = "javaDouble", n = !1), i[r] = i[r] || {}, i[r][t] = n ? e + "" : e;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function A(i) {
|
|
169
169
|
return !!i && typeof i == "object" && i.value !== void 0;
|
|
170
170
|
}
|
|
171
171
|
function $(i) {
|
|
172
172
|
return Object.fromEntries(Object.entries(i).map(function(t) {
|
|
173
173
|
var e = t[0], r = t[1];
|
|
174
|
-
return [e,
|
|
174
|
+
return [e, A(r) ? r : { value: r }];
|
|
175
175
|
}));
|
|
176
176
|
}
|
|
177
177
|
function Y(i) {
|
|
@@ -179,58 +179,58 @@ var qe = { exports: {} };
|
|
|
179
179
|
}
|
|
180
180
|
(function(i) {
|
|
181
181
|
i.NONE = "NONE", i.DEFAULT_FLAGS = "DEFAULT_FLAGS", i.CACHE = "CACHE", i.SERVER = "SERVER";
|
|
182
|
-
})(
|
|
183
|
-
var
|
|
182
|
+
})(f || (f = {}));
|
|
183
|
+
var pe, j = null, ut = "FLAGSMITH_EVENT", le = ut, Be = "https://edge.api.flagsmith.com/api/v1/", Je = "flagsmith_value_", Me = "flagsmith_enabled_", ze = "flagsmith_trait_", ct = function() {
|
|
184
184
|
function i(t) {
|
|
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
188
|
e.log("Get Flags"), e.isLoading = !0, e.loadingState.isFetching || e.setLoadingState(s(s({}, e.loadingState), { isFetching: !0 }));
|
|
189
189
|
var o = "".concat(e.getContext().identity), v = function(d) {
|
|
190
|
-
var
|
|
190
|
+
var y, c, b, k;
|
|
191
191
|
if (d && o === "".concat(e.getContext().identity)) {
|
|
192
|
-
var V = d.flags,
|
|
192
|
+
var V = d.flags, F = d.traits, U = d.identifier;
|
|
193
193
|
e.isLoading = !1;
|
|
194
|
-
var
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}),
|
|
198
|
-
N[
|
|
194
|
+
var I = {}, N = {};
|
|
195
|
+
F = F || [], (V = V || []).forEach(function(S) {
|
|
196
|
+
I[S.feature.name.toLowerCase().replace(/ /g, "_")] = { id: S.feature.id, enabled: S.enabled, value: S.feature_state_value };
|
|
197
|
+
}), F.forEach(function(S) {
|
|
198
|
+
N[S.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: S.transient, value: S.trait_value };
|
|
199
199
|
}), e.oldFlags = s({}, e.flags);
|
|
200
|
-
var G =
|
|
201
|
-
if ((U || Object.keys(N).length) && (e.evaluationContext.identity = s(s({}, e.evaluationContext.identity), { traits: N }), U && (e.evaluationContext.identity.identifier = U)), e.flags =
|
|
200
|
+
var G = E(e.oldFlags, I), re = E((y = e.evaluationContext.identity) === null || y === void 0 ? void 0 : y.traits, N);
|
|
201
|
+
if ((U || Object.keys(N).length) && (e.evaluationContext.identity = s(s({}, e.evaluationContext.identity), { traits: N }), U && (e.evaluationContext.identity.identifier = U)), e.flags = I, 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
|
-
Object.keys(((c = e.evaluationContext.identity) === null || c === void 0 ? void 0 : c.traits) || {}).map(function(
|
|
205
|
-
ie[ze +
|
|
204
|
+
Object.keys(((c = e.evaluationContext.identity) === null || c === void 0 ? void 0 : c.traits) || {}).map(function(S) {
|
|
205
|
+
ie[ze + S] = e.getTrait(S);
|
|
206
206
|
});
|
|
207
|
-
var Z = s(s(s({}, e.datadogRum.client.getUser()), { id: e.datadogRum.client.getUser().id || ((
|
|
207
|
+
var Z = s(s(s({}, 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
|
-
} catch (
|
|
211
|
-
console.error(
|
|
210
|
+
} catch (S) {
|
|
211
|
+
console.error(S);
|
|
212
212
|
}
|
|
213
213
|
if (e.dtrum) try {
|
|
214
214
|
var T = { javaDouble: {}, date: {}, shortString: {}, javaLongOrObject: {} };
|
|
215
|
-
Object.keys(e.flags).map(function(
|
|
216
|
-
|
|
217
|
-
}), Object.keys(((k = e.evaluationContext.identity) === null || k === void 0 ? void 0 : k.traits) || {}).map(function(
|
|
218
|
-
|
|
215
|
+
Object.keys(e.flags).map(function(S) {
|
|
216
|
+
w(T, Je + S, e.getValue(S, { skipAnalytics: !0 })), w(T, Me + S, e.hasFeature(S, { skipAnalytics: !0 }));
|
|
217
|
+
}), Object.keys(((k = e.evaluationContext.identity) === null || k === void 0 ? void 0 : k.traits) || {}).map(function(S) {
|
|
218
|
+
w(T, ze + S, e.getTrait(S));
|
|
219
219
|
}), e.log("Sending javaLongOrObject traits to dynatrace", T.javaLongOrObject), e.log("Sending date traits to dynatrace", T.date), e.log("Sending shortString traits to dynatrace", T.shortString), e.log("Sending javaDouble to dynatrace", T.javaDouble), e.dtrum.sendSessionProperties(T.javaLongOrObject, T.date, T.shortString, T.javaDouble);
|
|
220
|
-
} catch (
|
|
221
|
-
console.error(
|
|
220
|
+
} catch (S) {
|
|
221
|
+
console.error(S);
|
|
222
222
|
}
|
|
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 y = d[0], c = d[1];
|
|
227
|
+
return { trait_key: y, 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
231
|
return e.evaluationContext.identity = s(s({}, e.evaluationContext.identity), { traits: {} }), v(d == null ? void 0 : d[0]);
|
|
232
232
|
}).catch(function(d) {
|
|
233
|
-
var
|
|
233
|
+
var y = d.message, c = new Error(y);
|
|
234
234
|
return Promise.reject(c);
|
|
235
235
|
}) : e.getJSON(n + "flags/").then(function(d) {
|
|
236
236
|
return v({ flags: d, traits: void 0 });
|
|
@@ -245,7 +245,7 @@ var qe = { exports: {} };
|
|
|
245
245
|
}).catch(function(n) {
|
|
246
246
|
e.log("Exception fetching evaluationEvent", n);
|
|
247
247
|
}) : void 0;
|
|
248
|
-
}, this.datadogRum = null, this.loadingState = { isLoading: !0, isFetching: !0, error: null, source:
|
|
248
|
+
}, this.datadogRum = null, this.loadingState = { isLoading: !0, isFetching: !0, error: null, source: f.NONE }, this.canUseStorage = !1, this.analyticsInterval = null, this.api = null, this.cacheFlags = !1, this.ts = null, this.enableAnalytics = !1, this.enableLogs = !1, this.evaluationContext = {}, this.evaluationEvent = null, this.flags = null, this.getFlagInterval = null, this.headers = null, this.initialised = !1, this.oldFlags = null, this.onChange = null, this.onError = null, this.ticks = null, this.timer = null, this.dtrum = null, this.withTraits = null, this.cacheOptions = { ttl: 0, skipAPI: !1, loadStale: !1, storageKey: void 0 }, this.getValue = function(r, n, a) {
|
|
249
249
|
var o = e.flags && e.flags[r.toLowerCase().replace(/ /g, "_")], v = null;
|
|
250
250
|
if (o && (v = o.value), n != null && n.skipAnalytics || a || e.evaluateFlag(r, "VALUE"), v === null && (n == null ? void 0 : n.fallback) !== void 0) return n.fallback;
|
|
251
251
|
if (n != null && n.json) try {
|
|
@@ -277,7 +277,7 @@ var qe = { exports: {} };
|
|
|
277
277
|
var n;
|
|
278
278
|
if (e.api) return e.setContext(s(s({}, e.evaluationContext), { identity: s(s({}, e.evaluationContext.identity), { traits: s(s({}, (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
|
-
return [o,
|
|
280
|
+
return [o, A(v) ? v : { value: v }];
|
|
281
281
|
}))) }) }));
|
|
282
282
|
console.error("Attempted to setTraits a user before calling flagsmith.init. Call flagsmith.init first, if you wish to prevent it sending a request for flags, call init with preventFetch:true.");
|
|
283
283
|
}, this.hasFeature = function(r, n) {
|
|
@@ -289,30 +289,30 @@ 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, y = { method: n || "GET", body: a, cache: "no-cache", headers: {} };
|
|
293
|
+
e.evaluationContext.environment && (y.headers["X-Environment-Key"] = e.evaluationContext.environment.apiKey), n && n !== "GET" && (y.headers["Content-Type"] = "application/json; charset=utf-8"), d && Object.assign(y.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 ===
|
|
298
|
-
var U = (V =
|
|
295
|
+
return C(r, y).then(function(b) {
|
|
296
|
+
var k, V, F = "".concat((k = e.evaluationContext.identity) === null || k === void 0 ? void 0 : k.identifier);
|
|
297
|
+
if (c === F) {
|
|
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 I = parseFloat(U);
|
|
301
|
+
if (isNaN(I)) return Promise.reject("Failed to parse x-flagsmith-document-updated-at");
|
|
302
|
+
e.timestamp = I;
|
|
303
303
|
} catch (N) {
|
|
304
304
|
e.log(N, "Failed to parse x-flagsmith-document-updated-at", U);
|
|
305
305
|
}
|
|
306
|
-
return e.log("Fetch response: " +
|
|
306
|
+
return e.log("Fetch response: " + b.status + " " + (n || "GET") + 0 + r), b.text().then(function(N) {
|
|
307
307
|
var G = N;
|
|
308
308
|
try {
|
|
309
309
|
G = JSON.parse(N);
|
|
310
310
|
} catch {
|
|
311
311
|
}
|
|
312
|
-
return !G &&
|
|
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(F));
|
|
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) {
|
|
@@ -323,23 +323,23 @@ var qe = { exports: {} };
|
|
|
323
323
|
}, this._onChange = function(r, n, a) {
|
|
324
324
|
var o, v;
|
|
325
325
|
e.setLoadingState(a), (o = e.onChange) === null || o === void 0 || o.call(e, r, n, e.loadingState), (v = e._trigger) === null || v === void 0 || v.call(e);
|
|
326
|
-
}, C = t.fetch ? t.fetch : typeof fetch < "u" ? fetch : ve === null || ve === void 0 ? void 0 : ve.fetch, this.canUseStorage = typeof window < "u" || !!t.browserlessStorage, this.log("Constructing flagsmith instance " + t), t.eventSource && (
|
|
326
|
+
}, C = t.fetch ? t.fetch : typeof fetch < "u" ? fetch : ve === null || ve === void 0 ? void 0 : ve.fetch, this.canUseStorage = typeof window < "u" || !!t.browserlessStorage, this.log("Constructing flagsmith instance " + t), t.eventSource && (pe = t.eventSource), t.AsyncStorage && (j = t.AsyncStorage);
|
|
327
327
|
}
|
|
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, y, c, b, k, V, F, U, I, 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, y = t.headers, c = t.onChange, b = t.cacheFlags, k = t.datadogRum, V = t.onError, F = t.defaultFlags, U = t.fetch, I = 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 =
|
|
340
|
+
})) : {} } : a.identity, this.evaluationContext = a, this.api = d, this.headers = y, 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
341
|
L.setLoadingState(s(s({}, 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({},
|
|
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({}, F) || {}, 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 = s(s({}, 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) {
|
|
@@ -360,14 +360,14 @@ var qe = { exports: {} };
|
|
|
360
360
|
}
|
|
361
361
|
});
|
|
362
362
|
};
|
|
363
|
-
}(ye)),
|
|
363
|
+
}(ye)), j && this.canUseStorage && j.getItem(le).then(function(R) {
|
|
364
364
|
try {
|
|
365
365
|
L.evaluationEvent = JSON.parse(R) || {};
|
|
366
366
|
} catch {
|
|
367
367
|
L.evaluationEvent = {};
|
|
368
368
|
}
|
|
369
369
|
L.analyticsInterval = setInterval(L.analyticsFlags, L.ticks);
|
|
370
|
-
}), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval),
|
|
370
|
+
}), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), j && this.canUseStorage && j.getItem(le, function(R, q) {
|
|
371
371
|
if (q && L.evaluationContext.environment) {
|
|
372
372
|
var B = JSON.parse(q);
|
|
373
373
|
if (B[L.evaluationContext.environment.apiKey]) {
|
|
@@ -375,23 +375,23 @@ var qe = { exports: {} };
|
|
|
375
375
|
L.log("Retrieved events from cache", q), L.setState(s(s({}, z), { evaluationEvent: B[L.evaluationContext.environment.apiKey] }));
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
|
-
})), !
|
|
379
|
-
if (!
|
|
378
|
+
})), !b) return [3, 9];
|
|
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,
|
|
382
|
+
var B, z, x, te, X, M, Se, it, Ce, xe, we, Ee, Oe, ke, Te, Le, je, Pe, Ae, Fe, Ie, 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) === ((
|
|
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(s(s({}, x), { evaluationContext: Y(s(s({}, x.evaluationContext), { identity: !((Ae = x.evaluationContext) === null || Ae === void 0) && Ae.identity ? s(s({}, (Fe = x.evaluationContext) === null || Fe === void 0 ? void 0 : Fe.identity), { traits: s(s({}, ((Ne = (Ie = x.evaluationContext) === null || Ie === void 0 ? void 0 : Ie.identity) === null || Ne === void 0 ? void 0 : Ne.traits) || {}), ae || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", x))), te ? (Se = !I && (!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 I ? [3, 4] : [4, this.getFlags()];
|
|
395
395
|
case 3:
|
|
396
396
|
H.sent(), H.label = 4;
|
|
397
397
|
case 4:
|
|
@@ -401,14 +401,14 @@ var qe = { exports: {} };
|
|
|
401
401
|
case 6:
|
|
402
402
|
return [3, 10];
|
|
403
403
|
case 7:
|
|
404
|
-
return
|
|
404
|
+
return I ? [3, 9] : [4, this.getFlags()];
|
|
405
405
|
case 8:
|
|
406
406
|
return H.sent(), [3, 10];
|
|
407
407
|
case 9:
|
|
408
|
-
if (
|
|
408
|
+
if (F) 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
|
-
this._onChange(null, { isFromServer: !1, flagsChanged:
|
|
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));
|
|
412
412
|
}
|
|
413
413
|
H.label = 10;
|
|
414
414
|
case 10:
|
|
@@ -418,9 +418,9 @@ var qe = { exports: {} };
|
|
|
418
418
|
});
|
|
419
419
|
}, D.label = 2;
|
|
420
420
|
case 2:
|
|
421
|
-
return D.trys.push([2, 7, , 8]),
|
|
421
|
+
return D.trys.push([2, 7, , 8]), j.getItemSync ? (be = j.getItemSync(this.getStorageKey()), [3, 5]) : [3, 3];
|
|
422
422
|
case 3:
|
|
423
|
-
return [4,
|
|
423
|
+
return [4, j.getItem(this.getStorageKey())];
|
|
424
424
|
case 4:
|
|
425
425
|
be = D.sent(), D.label = 5;
|
|
426
426
|
case 5:
|
|
@@ -431,12 +431,12 @@ var qe = { exports: {} };
|
|
|
431
431
|
case 8:
|
|
432
432
|
return [3, 12];
|
|
433
433
|
case 9:
|
|
434
|
-
return
|
|
434
|
+
return I ? [3, 11] : [4, this.getFlags()];
|
|
435
435
|
case 10:
|
|
436
436
|
return D.sent(), [3, 12];
|
|
437
437
|
case 11:
|
|
438
|
-
if (
|
|
439
|
-
else if (this.flags && (oe = null, Object.keys(this.flags).length === 0 && (oe = me), this._onChange(null, { isFromServer: !1, flagsChanged:
|
|
438
|
+
if (F) this._onChange(null, { isFromServer: !1, flagsChanged: E({}, F), traitsChanged: E({}, (e = a.identity) === null || e === void 0 ? void 0 : e.traits) }, this._loadedState(null, f.DEFAULT_FLAGS));
|
|
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:
|
|
442
442
|
return [3, 14];
|
|
@@ -452,7 +452,7 @@ var qe = { exports: {} };
|
|
|
452
452
|
}, i.prototype.identify = function(t, e, r) {
|
|
453
453
|
return this.evaluationContext.identity = { identifier: t, transient: r, traits: this.evaluationContext.identity && this.evaluationContext.identity.identifier == t ? this.evaluationContext.identity.traits : {} }, this.evaluationContext.identity.identifier = t, this.log("Identify: " + this.evaluationContext.identity.identifier), e && (this.evaluationContext.identity.traits = Object.fromEntries(Object.entries(e).map(function(n) {
|
|
454
454
|
var a = n[0], o = n[1];
|
|
455
|
-
return [a,
|
|
455
|
+
return [a, A(o) ? o : { value: o }];
|
|
456
456
|
}))), this.initialised ? this.getFlags() : Promise.resolve();
|
|
457
457
|
}, i.prototype.getState = function() {
|
|
458
458
|
return { api: this.api, flags: this.flags, ts: this.ts, evaluationContext: this.evaluationContext, evaluationEvent: this.evaluationEvent };
|
|
@@ -468,17 +468,17 @@ var qe = { exports: {} };
|
|
|
468
468
|
return t === void 0 && (t = null), r === void 0 && (r = !1), { error: t, isFetching: r, isLoading: !1, source: e };
|
|
469
469
|
}, i.prototype.log = function() {
|
|
470
470
|
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
|
|
471
|
-
this.enableLogs && console.log.apply(this,
|
|
471
|
+
this.enableLogs && console.log.apply(this, P(["FLAGSMITH:", (/* @__PURE__ */ new Date()).valueOf() - (this.timer || 0), "ms"], t));
|
|
472
472
|
}, i.prototype.updateStorage = function() {
|
|
473
473
|
if (this.cacheFlags) {
|
|
474
474
|
this.ts = (/* @__PURE__ */ new Date()).valueOf();
|
|
475
475
|
var t = JSON.stringify(this.getState());
|
|
476
|
-
this.log("Setting storage", t),
|
|
476
|
+
this.log("Setting storage", t), j.setItem(this.getStorageKey(), t);
|
|
477
477
|
}
|
|
478
478
|
}, i.prototype.updateEventStorage = function() {
|
|
479
479
|
if (this.enableAnalytics) {
|
|
480
480
|
var t = JSON.stringify(this.getState().evaluationEvent);
|
|
481
|
-
|
|
481
|
+
j.setItem(le, t).catch(function(e) {
|
|
482
482
|
return console.error("Flagsmith: Error setting item in async storage", e);
|
|
483
483
|
});
|
|
484
484
|
}
|
|
@@ -487,7 +487,7 @@ var qe = { exports: {} };
|
|
|
487
487
|
W(t, this.loadingState) || (this.loadingState = s({}, 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) {
|
|
491
491
|
var o;
|
|
492
492
|
try {
|
|
493
493
|
o = JSON.parse(a.data).updated_at;
|
|
@@ -537,7 +537,7 @@ var qe = { exports: {} };
|
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
539
|
return o;
|
|
540
|
-
},
|
|
540
|
+
}, fe = function(i, t, e) {
|
|
541
541
|
if (arguments.length === 2) for (var r, n = 0, a = t.length; n < a; n++) !r && n in t || (r || (r = Array.prototype.slice.call(t, 0, n)), r[n] = t[n]);
|
|
542
542
|
return i.concat(r || Array.prototype.slice.call(t));
|
|
543
543
|
}, _t = function(i) {
|
|
@@ -595,7 +595,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
595
595
|
t && t.lastEventId && (this._lastEventId = t.lastEventId);
|
|
596
596
|
var n = this._listeners[t.type];
|
|
597
597
|
if (n != null) try {
|
|
598
|
-
for (var a = $e(
|
|
598
|
+
for (var a = $e(fe([], Xe(n), !1)), o = a.next(); !o.done; o = a.next())
|
|
599
599
|
o.value.call(this, t);
|
|
600
600
|
} catch (v) {
|
|
601
601
|
e = { error: v };
|
|
@@ -615,7 +615,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
615
615
|
}, i.prototype.addEventListener = function(t, e, r) {
|
|
616
616
|
this._listeners[t] == null && (this._listeners[t] = [], this._eventSource != null && this._eventSource.addEventListener(t, this._onevent_wrapped));
|
|
617
617
|
var n = this._listeners[t];
|
|
618
|
-
n.includes(e) || (this._listeners[t] =
|
|
618
|
+
n.includes(e) || (this._listeners[t] = fe(fe([], Xe(n), !1), [e], !1));
|
|
619
619
|
}, i.prototype.removeEventListener = function(t, e, r) {
|
|
620
620
|
var n = this._listeners[t];
|
|
621
621
|
this._listeners[t] = n.filter(function(a) {
|
|
@@ -643,25 +643,21 @@ 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
|
|
647
|
-
n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(c,
|
|
648
|
-
a.push(
|
|
646
|
+
for (var y in n.open(t.method || "get", i, !0), n.onload = function() {
|
|
647
|
+
n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(c, b, k) {
|
|
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(y, t.headers[y]);
|
|
651
651
|
n.send(t.body || null);
|
|
652
652
|
});
|
|
653
|
-
}, Ze = He({ AsyncStorage:
|
|
653
|
+
}, Ze = He({ AsyncStorage: p, fetch: Ye, eventSource: We });
|
|
654
654
|
typeof window < "u" && (window.flagsmith = Ze), _.createFlagsmithInstance = function() {
|
|
655
|
-
return He({ AsyncStorage:
|
|
655
|
+
return He({ AsyncStorage: p, fetch: Ye, eventSource: We });
|
|
656
656
|
}, _.default = Ze, Object.defineProperty(_, "__esModule", { value: !0 });
|
|
657
657
|
});
|
|
658
658
|
})(qe, qe.exports);
|
|
659
659
|
var gt = qe.exports, yt = {
|
|
660
|
-
NOT_INITIALIZED: "FeatureFlag not initialized. Call init() first."
|
|
661
|
-
INVALID_CONFIG: "Invalid Flagsmith configuration",
|
|
662
|
-
FETCH_FAILED: "Failed to fetch Flagsmith configuration",
|
|
663
|
-
NO_USER_CONTEXT: "User context not set. Call setUser() first.",
|
|
664
|
-
ALREADY_INITIALIZED: "FeatureFlag is already initialized."
|
|
660
|
+
NOT_INITIALIZED: "FeatureFlag not initialized. Call init() first."
|
|
665
661
|
}, st = "business", J, mt = (J = class {
|
|
666
662
|
constructor() {
|
|
667
663
|
ce(this, "flagsmithClient", null);
|
|
@@ -678,16 +674,16 @@ var gt = qe.exports, yt = {
|
|
|
678
674
|
if (!this.flagsmithClient)
|
|
679
675
|
try {
|
|
680
676
|
this.flagsmithClient = gt.createFlagsmithInstance();
|
|
681
|
-
const
|
|
677
|
+
const p = _.reduce((s, O) => (s[O.feature.name] = O, s), {});
|
|
682
678
|
await this.flagsmithClient.init({
|
|
683
679
|
environmentID: u.apiKey,
|
|
684
680
|
api: (u == null ? void 0 : u.url) ?? "https://feature-flag-proxy.feedme.farm/api/v1/",
|
|
685
681
|
enableAnalytics: (u == null ? void 0 : u.enableAnalytics) ?? !0,
|
|
686
|
-
defaultFlags:
|
|
682
|
+
defaultFlags: p,
|
|
687
683
|
cacheFlags: (u == null ? void 0 : u.cacheFlags) ?? !0
|
|
688
684
|
});
|
|
689
|
-
} catch (
|
|
690
|
-
throw console.error("Failed to initialize FeatureFlag:",
|
|
685
|
+
} catch (p) {
|
|
686
|
+
throw console.error("Failed to initialize FeatureFlag:", p), p;
|
|
691
687
|
}
|
|
692
688
|
}
|
|
693
689
|
async setUser(u) {
|
|
@@ -708,25 +704,25 @@ var gt = qe.exports, yt = {
|
|
|
708
704
|
async getFlags() {
|
|
709
705
|
this.ensureInitialized();
|
|
710
706
|
const u = this.flagsmithClient.getAllFlags();
|
|
711
|
-
return Object.entries(u).map(([_,
|
|
707
|
+
return Object.entries(u).map(([_, p]) => {
|
|
712
708
|
var s;
|
|
713
709
|
return {
|
|
714
710
|
feature: {
|
|
715
711
|
name: _,
|
|
716
|
-
id: (
|
|
712
|
+
id: (p == null ? void 0 : p.id) ?? 0
|
|
717
713
|
},
|
|
718
|
-
enabled:
|
|
719
|
-
value: ((s =
|
|
714
|
+
enabled: p.enabled,
|
|
715
|
+
value: ((s = p.value) == null ? void 0 : s.toString()) ?? null
|
|
720
716
|
};
|
|
721
717
|
});
|
|
722
718
|
}
|
|
723
719
|
getFlagValue(u, _) {
|
|
724
720
|
this.ensureInitialized();
|
|
725
|
-
const
|
|
726
|
-
if (
|
|
721
|
+
const p = this.flagsmithClient.getValue(u);
|
|
722
|
+
if (p == null)
|
|
727
723
|
return null;
|
|
728
724
|
try {
|
|
729
|
-
const s =
|
|
725
|
+
const s = p.toString();
|
|
730
726
|
return _ ? _(s) : typeof {} == "number" ? isNaN(Number(s)) ? null : Number(s) : typeof {} == "boolean" ? s.toLowerCase() === "true" : s;
|
|
731
727
|
} catch (s) {
|
|
732
728
|
return console.error("Error transforming flag value:", s), null;
|
|
@@ -736,28 +732,28 @@ var gt = qe.exports, yt = {
|
|
|
736
732
|
this.ensureInitialized();
|
|
737
733
|
const _ = this.flagsmithClient.getValue(u);
|
|
738
734
|
if (_ == null) return null;
|
|
739
|
-
const
|
|
735
|
+
const p = this.flagsmithClient.hasFeature(u);
|
|
740
736
|
return {
|
|
741
737
|
feature: {
|
|
742
738
|
name: u,
|
|
743
739
|
id: 0
|
|
744
740
|
},
|
|
745
|
-
enabled:
|
|
741
|
+
enabled: p,
|
|
746
742
|
value: _.toString()
|
|
747
743
|
};
|
|
748
744
|
}
|
|
749
|
-
async getUserFlagValue(u, _,
|
|
745
|
+
async getUserFlagValue(u, _, p = null, s) {
|
|
750
746
|
var K;
|
|
751
747
|
const O = this.userContext;
|
|
752
748
|
try {
|
|
753
|
-
return await this.setUser(u), this.getFlagValue(_, s) ??
|
|
754
|
-
} catch (
|
|
755
|
-
return console.error(`Error getting user flag value for ${_}:`,
|
|
749
|
+
return await this.setUser(u), this.getFlagValue(_, s) ?? p;
|
|
750
|
+
} catch (P) {
|
|
751
|
+
return console.error(`Error getting user flag value for ${_}:`, P), p;
|
|
756
752
|
} finally {
|
|
757
753
|
try {
|
|
758
754
|
await ((K = this.flagsmithClient) == null ? void 0 : K.logout()), this.userContext = null, O && await this.setUser(O.identifier);
|
|
759
|
-
} catch (
|
|
760
|
-
console.error("Error during cleanup:",
|
|
755
|
+
} catch (P) {
|
|
756
|
+
console.error("Error during cleanup:", P);
|
|
761
757
|
}
|
|
762
758
|
}
|
|
763
759
|
}
|
|
@@ -766,49 +762,49 @@ var gt = qe.exports, yt = {
|
|
|
766
762
|
}
|
|
767
763
|
}, ce(J, "instance"), J), bt = mt.getInstance(), se = de(!1), _e = de([]), ne = de(null);
|
|
768
764
|
function St(l = bt) {
|
|
769
|
-
const u = () => se.value ? !0 : (console.warn("FeatureFlag is not initialized. Using default values."), !1), _ = async (
|
|
765
|
+
const u = () => se.value ? !0 : (console.warn("FeatureFlag is not initialized. Using default values."), !1), _ = async (f, C = []) => {
|
|
770
766
|
if (se.value) {
|
|
771
767
|
console.warn("FeatureFlag is already initialized.");
|
|
772
768
|
return;
|
|
773
769
|
}
|
|
774
770
|
try {
|
|
775
|
-
await l.init(
|
|
776
|
-
} catch (
|
|
777
|
-
console.error("Failed to initialize feature flags:",
|
|
771
|
+
await l.init(f, C), _e.value = await l.getFlags(), se.value = !0, ne.value = null;
|
|
772
|
+
} catch (w) {
|
|
773
|
+
console.error("Failed to initialize feature flags:", w), ne.value = w;
|
|
778
774
|
}
|
|
779
|
-
},
|
|
775
|
+
}, p = async (f) => {
|
|
780
776
|
if (u())
|
|
781
777
|
try {
|
|
782
|
-
await l.setUser(
|
|
778
|
+
await l.setUser(f), _e.value = await l.getFlags(), ne.value = null;
|
|
783
779
|
} catch (C) {
|
|
784
780
|
console.error("Failed to set user:", C), ne.value = C;
|
|
785
781
|
}
|
|
786
|
-
}, s = async (
|
|
787
|
-
if (!u()) return
|
|
782
|
+
}, s = async (f) => p(`${st}-${f}`), O = (f, C, w = null) => {
|
|
783
|
+
if (!u()) return w;
|
|
788
784
|
try {
|
|
789
|
-
return l.getFlagValue(
|
|
790
|
-
} catch (
|
|
791
|
-
return console.error(`Error getting flag value for ${
|
|
785
|
+
return l.getFlagValue(f, C) ?? w;
|
|
786
|
+
} catch (A) {
|
|
787
|
+
return console.error(`Error getting flag value for ${f}:`, A), w;
|
|
792
788
|
}
|
|
793
|
-
}, K = (
|
|
789
|
+
}, K = (f, C) => {
|
|
794
790
|
if (!u()) return C ?? null;
|
|
795
791
|
try {
|
|
796
|
-
return l.getFlag(
|
|
797
|
-
} catch (
|
|
798
|
-
return console.error(`Error getting flag for ${
|
|
792
|
+
return l.getFlag(f) ?? C ?? null;
|
|
793
|
+
} catch (w) {
|
|
794
|
+
return console.error(`Error getting flag for ${f}:`, w), C ?? null;
|
|
799
795
|
}
|
|
800
|
-
},
|
|
801
|
-
if (!u()) return
|
|
796
|
+
}, P = async (f, C, w = null, A) => {
|
|
797
|
+
if (!u()) return w;
|
|
802
798
|
try {
|
|
803
|
-
return await l.getUserFlagValue(
|
|
799
|
+
return await l.getUserFlagValue(f, C, w, A);
|
|
804
800
|
} catch ($) {
|
|
805
|
-
return console.error(`Error getting user flag value for ${C}:`, $),
|
|
801
|
+
return console.error(`Error getting user flag value for ${C}:`, $), w;
|
|
806
802
|
}
|
|
807
|
-
}, W = async (
|
|
803
|
+
}, W = async (f, C, w = null, A) => P(`${st}-${f}`, C, w, A), E = () => {
|
|
808
804
|
try {
|
|
809
805
|
l.reset();
|
|
810
|
-
} catch (
|
|
811
|
-
console.error("Error resetting feature flags:",
|
|
806
|
+
} catch (f) {
|
|
807
|
+
console.error("Error resetting feature flags:", f);
|
|
812
808
|
} finally {
|
|
813
809
|
_e.value = [], se.value = !1, ne.value = null;
|
|
814
810
|
}
|
|
@@ -818,16 +814,16 @@ function St(l = bt) {
|
|
|
818
814
|
isInitialized: Ge(se),
|
|
819
815
|
error: Ge(ne),
|
|
820
816
|
init: _,
|
|
821
|
-
setUser:
|
|
817
|
+
setUser: p,
|
|
822
818
|
setBusiness: s,
|
|
823
819
|
getFlagValue: O,
|
|
824
820
|
getFlag: K,
|
|
825
|
-
getUserFlagValue:
|
|
821
|
+
getUserFlagValue: P,
|
|
826
822
|
getBusinessFlagValue: W,
|
|
827
|
-
reset:
|
|
823
|
+
reset: E
|
|
828
824
|
};
|
|
829
825
|
}
|
|
830
|
-
var he = () => St(),
|
|
826
|
+
var he = () => St(), g = /* @__PURE__ */ ((l) => (l.inventory_portal_must_use_transfer_template = "inventory_portal_must_use_transfer_template", l.inventory_portal_use_iframe = "inventory_portal_use_iframe", l.inventory_pos_adjust_v1 = "inventory_pos_adjust_v1", l.inventory_pos_adjust_v2_wastage = "inventory_pos_adjust_v2_wastage", l.inventory_pos_closing_recalculation = "inventory_pos_closing_recalculation", l.inventory_pos_closing_v1 = "inventory_pos_closing_v1", l.inventory_pos_closing_v2 = "inventory_pos_closing_v2", l.inventory_pos_convert_v1 = "inventory_pos_convert_v1", l.inventory_pos_costing = "inventory_pos_costing", l.inventory_pos_stock_return = "inventory_pos_stock_return", l.inventory_pos_transfer_require_fulfillment = "inventory_pos_transfer_require_fulfillment", l.inventory_purchase_order_approval = "inventory_purchase_order_approval", l.inventory_portal_xilnex_transfer_note = "inventory_portal_xilnex_transfer_note", l.inventory_portal_custom_attribute = "inventory_portal_custom_attribute", l.inventory_portal_purchase_order_v2 = "inventory_portal_purchase_order_v2", l.inventory_portal_accept_require_fulfillment = "inventory_portal_accept_require_fulfillment", l.inventory_portal_po_operate_v2 = "inventory_portal_po_operate_v2", l.inventory_pos_allow_receive_order = "inventory_pos_allow_receive_order", l.inventory_xilnex_opening_migration = "inventory_xilnex_opening_migration", l.inventory_ingredient_group = "inventory_ingredient_group", l.inventory_purchase_order_backdate = "inventory_purchase_order_backdate", l.inventory_synergy_opening_migration = "inventory_synergy_opening_migration", l.inventory_netsuite_inventory_transfer_out = "inventory_netsuite_inventory_transfer_out", l.inventory_portal_supplier_preparation_time = "inventory_portal_supplier_preparation_time", l.inventory_backdate_receive = "inventory_backdate_receive", l.inventory_portal_delivery_order_write = "inventory_portal_delivery_order_write", l.inventory_purchase_order_custom_cost = "inventory_purchase_order_custom_cost", l.inventory_bulk_import = "inventory_bulk_import", l.inventory_portal_surcharge = "inventory_portal_surcharge", l.inventory_purchase_order_cost_edit = "inventory_purchase_order_cost_edit", l.inventory_purchase_order_price_adjustment = "inventory_purchase_order_price_adjustment", l.inventory_purchase_order_workflow_allow_to_mark_completed = "inventory_purchase_order_workflow_allow_to_mark_completed", l.inventory_recipe_v2 = "inventory_recipe_v2", l.inventory_print_template = "inventory_print_template", l.inventory_purchase_order_email = "inventory_purchase_order_email", l.inventory_bulk_edit_recipes = "inventory_bulk_edit_recipes", l.inventory_stocksnapshot_cron_beta = "inventory_stocksnapshot_cron_beta", l.inventory_scheduler_daily_stock_snapshot = "inventory_scheduler_daily_stock_snapshot", l.inventory_scheduler_hourly_recalculation = "inventory_scheduler_hourly_recalculation", l))(g || {});
|
|
831
827
|
const Ct = /* @__PURE__ */ new Set([
|
|
832
828
|
// vivo pizza prod
|
|
833
829
|
"business_6687e91fa7240b001ba3f4c2",
|
|
@@ -869,6 +865,7 @@ function lt() {
|
|
|
869
865
|
inventory_bulk_import: !1,
|
|
870
866
|
inventory_portal_surcharge: !1,
|
|
871
867
|
inventory_purchase_order_cost_edit: !1,
|
|
868
|
+
inventory_purchase_order_price_adjustment: !1,
|
|
872
869
|
inventory_purchase_order_workflow_allow_to_mark_completed: !1,
|
|
873
870
|
inventory_recipe_v2: !1,
|
|
874
871
|
inventory_print_template: !1,
|
|
@@ -879,7 +876,7 @@ function lt() {
|
|
|
879
876
|
report_portal_po_forecast_days_default: 7
|
|
880
877
|
};
|
|
881
878
|
}
|
|
882
|
-
const h = de(lt()),
|
|
879
|
+
const h = de(lt()), wt = () => ({
|
|
883
880
|
get businessDbName() {
|
|
884
881
|
var _;
|
|
885
882
|
return `business_${((_ = Ke().currentBusiness.value) == null ? void 0 : _._id) ?? ""}`;
|
|
@@ -892,9 +889,9 @@ const h = de(lt()), Et = () => ({
|
|
|
892
889
|
var _;
|
|
893
890
|
const l = Ve();
|
|
894
891
|
return (_ = Ke().restaurants.value.find(
|
|
895
|
-
(
|
|
892
|
+
(p) => {
|
|
896
893
|
var s;
|
|
897
|
-
return
|
|
894
|
+
return p._id === ((s = l._currentLocation) == null ? void 0 : s.doc._id);
|
|
898
895
|
}
|
|
899
896
|
)) == null ? void 0 : _.posVersion;
|
|
900
897
|
},
|
|
@@ -981,6 +978,9 @@ const h = de(lt()), Et = () => ({
|
|
|
981
978
|
get enablePurchaseOrderCostEdit() {
|
|
982
979
|
return h.value.inventory_purchase_order_cost_edit;
|
|
983
980
|
},
|
|
981
|
+
get enablePurchaseOrderPriceAdjustment() {
|
|
982
|
+
return h.value.inventory_purchase_order_price_adjustment;
|
|
983
|
+
},
|
|
984
984
|
get poWorkflowAllowToMarkCompleted() {
|
|
985
985
|
return h.value.inventory_purchase_order_workflow_allow_to_mark_completed;
|
|
986
986
|
},
|
|
@@ -1006,81 +1006,84 @@ const h = de(lt()), Et = () => ({
|
|
|
1006
1006
|
return h.value.report_portal_po_forecast_days_default;
|
|
1007
1007
|
},
|
|
1008
1008
|
async init() {
|
|
1009
|
-
const l = Ke(), { init: u, setBusiness: _ } = he(),
|
|
1009
|
+
const l = Ke(), { init: u, setBusiness: _ } = he(), p = ft(), s = l.namespace.value === "prod";
|
|
1010
1010
|
await u({
|
|
1011
1011
|
apiKey: s ? "6GhcttsJ9Rj9cTevcdrpin" : "MaGoXrEWuEJNpWgKTqseee"
|
|
1012
1012
|
// url: 'https://flag.feedme.farm/api/v1/', // optional -> this is a default URL value
|
|
1013
1013
|
// enableAnalytics: true, // optional, defaults to true
|
|
1014
1014
|
// cacheFlags: true // optional, defaults to true
|
|
1015
1015
|
}), Ve().watchLocation(async (K) => {
|
|
1016
|
-
var
|
|
1016
|
+
var A, $, Y;
|
|
1017
1017
|
if (!K) {
|
|
1018
1018
|
h.value = lt();
|
|
1019
1019
|
return;
|
|
1020
1020
|
}
|
|
1021
|
-
const
|
|
1022
|
-
await _(
|
|
1023
|
-
const W = `business_${
|
|
1021
|
+
const P = ((A = l.currentBusiness.value) == null ? void 0 : A._id) ?? "";
|
|
1022
|
+
await _(P);
|
|
1023
|
+
const W = `business_${P}`, E = K.type === ot.enum.warehouse, f = (
|
|
1024
1024
|
// if menu v4, must manual receive && must use outlet app
|
|
1025
1025
|
(($ = l.currentBusiness.value) == null ? void 0 : $.menuVersion) === "v4" && // more guard for businesses using menu v4, only those listed for manual receive will be included
|
|
1026
1026
|
// TODO: may be removed to use menu version only
|
|
1027
1027
|
Ct.has(this.businessDbName)
|
|
1028
|
-
), C = xt.has(W) ||
|
|
1028
|
+
), C = xt.has(W) || m(g.inventory_portal_must_use_transfer_template), w = m(g.inventory_purchase_order_backdate) && (this.isWarehouse || p.state.closing !== null);
|
|
1029
1029
|
h.value = {
|
|
1030
1030
|
isLoaded: !0,
|
|
1031
1031
|
enableTotalCost: ((Y = l.currentBusiness.value) == null ? void 0 : Y.menuVersion) === "v4",
|
|
1032
|
-
enableBackdatePo:
|
|
1033
|
-
autoReceiveWarehouse:
|
|
1034
|
-
manualReceive:
|
|
1032
|
+
enableBackdatePo: w,
|
|
1033
|
+
autoReceiveWarehouse: E && !f,
|
|
1034
|
+
manualReceive: f,
|
|
1035
1035
|
enablePoTemplate: C,
|
|
1036
|
-
enableClosingTemplate:
|
|
1037
|
-
enableWastageTemplate:
|
|
1038
|
-
enableIngredientGroup:
|
|
1036
|
+
enableClosingTemplate: m(g.inventory_pos_closing_v2),
|
|
1037
|
+
enableWastageTemplate: m(g.inventory_pos_adjust_v2_wastage),
|
|
1038
|
+
enableIngredientGroup: m(g.inventory_ingredient_group),
|
|
1039
1039
|
mustUsePoTemplate: C,
|
|
1040
1040
|
businessSupplierOnly: C,
|
|
1041
|
-
enableXilnexTransferNote:
|
|
1042
|
-
enableCustomAttribute:
|
|
1043
|
-
usePurchaseOrderV2:
|
|
1044
|
-
acceptRequireFulfillment:
|
|
1045
|
-
|
|
1041
|
+
enableXilnexTransferNote: m(g.inventory_portal_xilnex_transfer_note),
|
|
1042
|
+
enableCustomAttribute: m(g.inventory_portal_custom_attribute),
|
|
1043
|
+
usePurchaseOrderV2: m(g.inventory_portal_purchase_order_v2),
|
|
1044
|
+
acceptRequireFulfillment: m(
|
|
1045
|
+
g.inventory_portal_accept_require_fulfillment
|
|
1046
|
+
),
|
|
1047
|
+
useOperatePurchaseOrderV2: m(g.inventory_portal_po_operate_v2),
|
|
1048
|
+
inventory_xilnex_opening_migration: m(
|
|
1049
|
+
g.inventory_xilnex_opening_migration
|
|
1046
1050
|
),
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
y.inventory_xilnex_opening_migration
|
|
1051
|
+
inventory_synergy_opening_migration: m(
|
|
1052
|
+
g.inventory_synergy_opening_migration
|
|
1050
1053
|
),
|
|
1051
|
-
|
|
1052
|
-
|
|
1054
|
+
inventory_netsuite_inventory_transfer_out: m(
|
|
1055
|
+
g.inventory_netsuite_inventory_transfer_out
|
|
1053
1056
|
),
|
|
1054
|
-
|
|
1055
|
-
|
|
1057
|
+
inventory_portal_supplier_preparation_time: m(
|
|
1058
|
+
g.inventory_portal_supplier_preparation_time
|
|
1056
1059
|
),
|
|
1057
|
-
|
|
1058
|
-
|
|
1060
|
+
inventory_portal_delivery_order_write: m(
|
|
1061
|
+
g.inventory_portal_delivery_order_write
|
|
1059
1062
|
),
|
|
1060
|
-
|
|
1061
|
-
|
|
1063
|
+
inventory_pos_transfer_require_fulfillment: m(
|
|
1064
|
+
g.inventory_pos_transfer_require_fulfillment
|
|
1062
1065
|
),
|
|
1063
|
-
|
|
1064
|
-
|
|
1066
|
+
inventory_backdate_receive: m(g.inventory_backdate_receive),
|
|
1067
|
+
inventory_purchase_order_custom_cost: m(
|
|
1068
|
+
g.inventory_purchase_order_custom_cost
|
|
1065
1069
|
),
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1070
|
+
inventory_bulk_import: m(g.inventory_bulk_import),
|
|
1071
|
+
inventory_portal_surcharge: m(g.inventory_portal_surcharge),
|
|
1072
|
+
inventory_purchase_order_cost_edit: m(
|
|
1073
|
+
g.inventory_purchase_order_cost_edit
|
|
1069
1074
|
),
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
inventory_purchase_order_cost_edit: S(
|
|
1073
|
-
y.inventory_purchase_order_cost_edit
|
|
1075
|
+
inventory_purchase_order_price_adjustment: m(
|
|
1076
|
+
g.inventory_purchase_order_price_adjustment
|
|
1074
1077
|
),
|
|
1075
|
-
inventory_purchase_order_workflow_allow_to_mark_completed:
|
|
1076
|
-
|
|
1078
|
+
inventory_purchase_order_workflow_allow_to_mark_completed: m(
|
|
1079
|
+
g.inventory_purchase_order_workflow_allow_to_mark_completed
|
|
1077
1080
|
),
|
|
1078
|
-
inventory_recipe_v2:
|
|
1079
|
-
inventory_print_template:
|
|
1080
|
-
inventory_purchase_order_email:
|
|
1081
|
-
inventory_bulk_edit_recipes:
|
|
1082
|
-
inventory_receive_request_beta:
|
|
1083
|
-
report_portal_po_forecast_days_constraint:
|
|
1081
|
+
inventory_recipe_v2: m(g.inventory_recipe_v2),
|
|
1082
|
+
inventory_print_template: m(g.inventory_print_template),
|
|
1083
|
+
inventory_purchase_order_email: m(g.inventory_purchase_order_email),
|
|
1084
|
+
inventory_bulk_edit_recipes: m(g.inventory_bulk_edit_recipes),
|
|
1085
|
+
inventory_receive_request_beta: m("inventory_receive_request_beta"),
|
|
1086
|
+
report_portal_po_forecast_days_constraint: Et(
|
|
1084
1087
|
"report_portal_po_forecast_days_constraint"
|
|
1085
1088
|
),
|
|
1086
1089
|
report_portal_po_forecast_days_default: Ot(
|
|
@@ -1099,14 +1102,14 @@ const h = de(lt()), Et = () => ({
|
|
|
1099
1102
|
});
|
|
1100
1103
|
}
|
|
1101
1104
|
});
|
|
1102
|
-
function
|
|
1105
|
+
function m(l, u) {
|
|
1103
1106
|
u = u === void 0 ? null : u;
|
|
1104
1107
|
const { getFlagValue: _ } = he();
|
|
1105
|
-
return _(l, (
|
|
1108
|
+
return _(l, (p) => p === "true") ?? u;
|
|
1106
1109
|
}
|
|
1107
|
-
function
|
|
1110
|
+
function Et(l) {
|
|
1108
1111
|
const { getFlagValue: u } = he();
|
|
1109
|
-
return u(l, (
|
|
1112
|
+
return u(l, (p) => p.trim() ? p.trim() : null) ?? null;
|
|
1110
1113
|
}
|
|
1111
1114
|
function Ot(l, u) {
|
|
1112
1115
|
const { getFlagValue: _ } = he();
|
|
@@ -1115,14 +1118,14 @@ function Ot(l, u) {
|
|
|
1115
1118
|
return isNaN(O) ? null : O;
|
|
1116
1119
|
}) ?? u;
|
|
1117
1120
|
}
|
|
1118
|
-
const
|
|
1121
|
+
const At = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1119
1122
|
__proto__: null,
|
|
1120
|
-
InventoryFeatureFlags:
|
|
1121
|
-
useFeatureStore:
|
|
1123
|
+
InventoryFeatureFlags: g,
|
|
1124
|
+
useFeatureStore: wt
|
|
1122
1125
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1123
1126
|
export {
|
|
1124
|
-
|
|
1127
|
+
g as I,
|
|
1125
1128
|
he as a,
|
|
1126
|
-
|
|
1127
|
-
|
|
1129
|
+
At as f,
|
|
1130
|
+
wt as u
|
|
1128
1131
|
};
|