@feedmepos/mf-miniprogram-v2 0.2.8-dev.1 → 0.2.8-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,14 @@
1
1
  var ke = Object.defineProperty;
2
2
  var je = (f, s, p) => s in f ? ke(f, s, { enumerable: !0, configurable: !0, writable: !0, value: p }) : f[s] = p;
3
3
  var Et = (f, s, p) => je(f, typeof s != "symbol" ? s + "" : s, p);
4
- import { readonly as ee, ref as Z, watch as Ee, defineComponent as Pe, computed as St, onMounted as Te, onBeforeUnmount as Ne, resolveComponent as wt, openBlock as J, createElementBlock as Q, Fragment as ne, createElementVNode as C, normalizeClass as ie, createVNode as T, renderList as ye, unref as _, withCtx as st, toDisplayString as ut, createBlock as Se, createCommentVNode as ae } from "vue";
4
+ import { readonly as ee, ref as Z, watch as Ee, defineComponent as Pe, computed as bt, onMounted as Te, onBeforeUnmount as Ne, resolveComponent as wt, openBlock as J, createElementBlock as Q, Fragment as ne, createElementVNode as C, normalizeClass as ie, createVNode as T, renderList as ye, unref as _, withCtx as st, toDisplayString as ut, createBlock as be, createCommentVNode as ae } from "vue";
5
5
  import { useCoreStore as we } from "@feedmepos/mf-common";
6
6
  import { useRoute as Re, useRouter as Ue, RouterView as Ke } from "vue-router";
7
- import { P as bt } from "./PortalIcon-DO0VrIoY.js";
8
- import { r as be, u as Me, w as Ce } from "./adminAccess-oXC0xjvK.js";
7
+ import { P as St } from "./PortalIcon-DO0VrIoY.js";
8
+ import { r as Se, u as Me, w as Ce } from "./adminAccess-D2K-L-Vt.js";
9
9
  import { c as Ot } from "./_commonjsHelpers-DaMA6jEr.js";
10
10
  import { p as De } from "./portalContext-DV-6uUwp.js";
11
- import { e as Ge, p as ct } from "./portalNavigation-BBORm5cp.js";
11
+ import { e as Ge, p as ct } from "./portalNavigation-C29ihtq_.js";
12
12
  import { _ as Be } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
13
  var re = { exports: {} };
14
14
  (function(f, s) {
@@ -63,8 +63,8 @@ var re = { exports: {} };
63
63
  }
64
64
  function d(y) {
65
65
  var u;
66
- y.done ? n(y.value) : (u = y.value, u instanceof t ? u : new t(function(S) {
67
- S(u);
66
+ y.done ? n(y.value) : (u = y.value, u instanceof t ? u : new t(function(b) {
67
+ b(u);
68
68
  })).then(l, c);
69
69
  }
70
70
  d((i = i.apply(a, [])).next());
@@ -118,8 +118,8 @@ var re = { exports: {} };
118
118
  continue;
119
119
  }
120
120
  u = e.call(a, l);
121
- } catch (S) {
122
- u = [6, S], i = 0;
121
+ } catch (b) {
122
+ u = [6, b], i = 0;
123
123
  } finally {
124
124
  t = n = 0;
125
125
  }
@@ -192,38 +192,38 @@ var re = { exports: {} };
192
192
  var i = t, n = i.api, r = i.evaluationContext;
193
193
  t.log("Get Flags"), t.isLoading = !0, t.loadingState.isFetching || t.setLoadingState(o(o({}, t.loadingState), { isFetching: !0 }));
194
194
  var l = "".concat(t.getContext().identity), c = function(d) {
195
- var y, u, S, k;
195
+ var y, u, b, k;
196
196
  if (d && l === "".concat(t.getContext().identity)) {
197
197
  var z = d.flags, R = d.traits, G = d.identifier;
198
198
  t.isLoading = !1;
199
199
  var U = {}, K = {};
200
- R = R || [], (z = z || []).forEach(function(b) {
201
- U[b.feature.name.toLowerCase().replace(/ /g, "_")] = { id: b.feature.id, enabled: b.enabled, value: b.feature_state_value };
202
- }), R.forEach(function(b) {
203
- K[b.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: b.transient, value: b.trait_value };
200
+ R = R || [], (z = z || []).forEach(function(S) {
201
+ U[S.feature.name.toLowerCase().replace(/ /g, "_")] = { id: S.feature.id, enabled: S.enabled, value: S.feature_state_value };
202
+ }), R.forEach(function(S) {
203
+ K[S.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: S.transient, value: S.trait_value };
204
204
  }), t.oldFlags = o({}, t.flags);
205
205
  var q = F(t.oldFlags, U), ft = F((y = t.evaluationContext.identity) === null || y === void 0 ? void 0 : y.traits, K);
206
206
  if ((G || Object.keys(K).length) && (t.evaluationContext.identity = o(o({}, t.evaluationContext.identity), { traits: K }), G && (t.evaluationContext.identity.identifier = G)), t.flags = U, t.updateStorage(), t._onChange(t.oldFlags, { isFromServer: !0, flagsChanged: q, traitsChanged: ft }, t._loadedState(null, g.SERVER)), t.datadogRum) try {
207
207
  if (t.datadogRum.trackTraits) {
208
208
  var pt = {};
209
- Object.keys(((u = t.evaluationContext.identity) === null || u === void 0 ? void 0 : u.traits) || {}).map(function(b) {
210
- pt[Ft + b] = t.getTrait(b);
209
+ Object.keys(((u = t.evaluationContext.identity) === null || u === void 0 ? void 0 : u.traits) || {}).map(function(S) {
210
+ pt[Ft + S] = t.getTrait(S);
211
211
  });
212
- var at = o(o(o({}, t.datadogRum.client.getUser()), { id: t.datadogRum.client.getUser().id || ((S = t.evaluationContext.identity) === null || S === void 0 ? void 0 : S.identifier) }), pt);
212
+ var at = o(o(o({}, t.datadogRum.client.getUser()), { id: t.datadogRum.client.getUser().id || ((b = t.evaluationContext.identity) === null || b === void 0 ? void 0 : b.identifier) }), pt);
213
213
  t.log("Setting Datadog user", at), t.datadogRum.client.setUser(at);
214
214
  }
215
- } catch (b) {
216
- console.error(b);
215
+ } catch (S) {
216
+ console.error(S);
217
217
  }
218
218
  if (t.dtrum) try {
219
219
  var j = { javaDouble: {}, date: {}, shortString: {}, javaLongOrObject: {} };
220
- Object.keys(t.flags).map(function(b) {
221
- E(j, N + b, t.getValue(b, { skipAnalytics: !0 })), E(j, ht + b, t.hasFeature(b, { skipAnalytics: !0 }));
222
- }), Object.keys(((k = t.evaluationContext.identity) === null || k === void 0 ? void 0 : k.traits) || {}).map(function(b) {
223
- E(j, Ft + b, t.getTrait(b));
220
+ Object.keys(t.flags).map(function(S) {
221
+ E(j, N + S, t.getValue(S, { skipAnalytics: !0 })), E(j, ht + S, t.hasFeature(S, { skipAnalytics: !0 }));
222
+ }), Object.keys(((k = t.evaluationContext.identity) === null || k === void 0 ? void 0 : k.traits) || {}).map(function(S) {
223
+ E(j, Ft + S, t.getTrait(S));
224
224
  }), t.log("Sending javaLongOrObject traits to dynatrace", j.javaLongOrObject), t.log("Sending date traits to dynatrace", j.date), t.log("Sending shortString traits to dynatrace", j.shortString), t.log("Sending javaDouble to dynatrace", j.javaDouble), t.dtrum.sendSessionProperties(j.javaLongOrObject, j.date, j.shortString, j.javaDouble);
225
- } catch (b) {
226
- console.error(b);
225
+ } catch (S) {
226
+ console.error(S);
227
227
  }
228
228
  }
229
229
  };
@@ -297,10 +297,10 @@ var re = { exports: {} };
297
297
  var d = c.headers, y = { method: n || "GET", body: r, cache: "no-cache", headers: {} };
298
298
  t.evaluationContext.environment && (y.headers["X-Environment-Key"] = t.evaluationContext.environment.apiKey), n && n !== "GET" && (y.headers["Content-Type"] = "application/json; charset=utf-8"), d && Object.assign(y.headers, d), m || console.error("Flagsmith: fetch is undefined, please specify a fetch implementation into flagsmith.init to support SSR.");
299
299
  var u = "".concat((l = t.evaluationContext.identity) === null || l === void 0 ? void 0 : l.identifier);
300
- return m(i, y).then(function(S) {
300
+ return m(i, y).then(function(b) {
301
301
  var k, z, R = "".concat((k = t.evaluationContext.identity) === null || k === void 0 ? void 0 : k.identifier);
302
302
  if (u === R) {
303
- var G = (z = S.headers) === null || z === void 0 ? void 0 : z.get("x-flagsmith-document-updated-at");
303
+ var G = (z = b.headers) === null || z === void 0 ? void 0 : z.get("x-flagsmith-document-updated-at");
304
304
  if (G) try {
305
305
  var U = parseFloat(G);
306
306
  if (isNaN(U)) return Promise.reject("Failed to parse x-flagsmith-document-updated-at");
@@ -308,13 +308,13 @@ var re = { exports: {} };
308
308
  } catch (K) {
309
309
  t.log(K, "Failed to parse x-flagsmith-document-updated-at", G);
310
310
  }
311
- return t.log("Fetch response: " + S.status + " " + (n || "GET") + 0 + i), S.text().then(function(K) {
311
+ return t.log("Fetch response: " + b.status + " " + (n || "GET") + 0 + i), b.text().then(function(K) {
312
312
  var q = K;
313
313
  try {
314
314
  q = JSON.parse(K);
315
315
  } catch {
316
316
  }
317
- return !q && S.status && (q = "API Response: ".concat(S.status)), S.status && S.status >= 200 && S.status < 300 ? q : Promise.reject(new Error(q));
317
+ return !q && b.status && (q = "API Response: ".concat(b.status)), b.status && b.status >= 200 && b.status < 300 ? q : Promise.reject(new Error(q));
318
318
  });
319
319
  }
320
320
  t.log("Received response with identity mismatch, ignoring response. Requested: ".concat(u, ", Current: ").concat(R));
@@ -333,18 +333,18 @@ var re = { exports: {} };
333
333
  return a.prototype.init = function(e) {
334
334
  var t, i, n;
335
335
  return w(this, void 0, void 0, function() {
336
- var r, l, c, d, y, u, S, k, z, R, G, U, K, q, ft, pt, at, j, b, Pt, mt, de, rt, Tt, ve, ge, Nt, he, Rt, yt, ot, fe, P = this;
336
+ var r, l, c, d, y, u, b, k, z, R, G, U, K, q, ft, pt, at, j, S, Pt, mt, de, rt, Tt, ve, ge, Nt, he, Rt, yt, ot, fe, P = this;
337
337
  return I(this, function(B) {
338
338
  switch (B.label) {
339
339
  case 0:
340
340
  r = vt(e.evaluationContext || this.evaluationContext), B.label = 1;
341
341
  case 1:
342
- if (B.trys.push([1, 13, , 14]), l = e.environmentID, c = e.api, d = c === void 0 ? h : c, y = e.headers, u = e.onChange, S = e.cacheFlags, k = e.datadogRum, z = e.onError, R = e.defaultFlags, G = e.fetch, U = e.preventFetch, K = e.enableLogs, q = e.enableDynatrace, ft = e.enableAnalytics, pt = e.realtime, at = e.eventSourceUrl, j = at === void 0 ? "https://realtime.flagsmith.com/" : at, b = e.AsyncStorage, Pt = e.identity, mt = e.traits, de = e.state, rt = e.cacheOptions, Tt = e.angularHttpClient, ve = e._trigger, ge = e._triggerLoadingState, r.environment = l ? { apiKey: l } : r.environment, !r.environment || !r.environment.apiKey) throw new Error("Please provide `evaluationContext.environment` with non-empty `apiKey`");
342
+ if (B.trys.push([1, 13, , 14]), l = e.environmentID, c = e.api, d = c === void 0 ? h : c, y = e.headers, u = e.onChange, b = e.cacheFlags, k = e.datadogRum, z = e.onError, R = e.defaultFlags, G = e.fetch, U = e.preventFetch, K = e.enableLogs, q = e.enableDynatrace, ft = e.enableAnalytics, pt = e.realtime, at = e.eventSourceUrl, j = at === void 0 ? "https://realtime.flagsmith.com/" : at, S = e.AsyncStorage, Pt = e.identity, mt = e.traits, de = e.state, rt = e.cacheOptions, Tt = e.angularHttpClient, ve = e._trigger, ge = e._triggerLoadingState, r.environment = l ? { apiKey: l } : r.environment, !r.environment || !r.environment.apiKey) throw new Error("Please provide `evaluationContext.environment` with non-empty `apiKey`");
343
343
  if (r.identity = Pt || mt ? { identifier: Pt, traits: mt ? Object.fromEntries(Object.entries(mt).map(function(M) {
344
344
  return [M[0], { value: M[1] }];
345
345
  })) : {} } : r.identity, this.evaluationContext = r, this.api = d, this.headers = y, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = u, Nt = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = ve || this._trigger, this._triggerLoadingState = ge || this._triggerLoadingState, this.onError = function(M) {
346
346
  P.setLoadingState(o(o({}, P.loadingState), { isFetching: !1, isLoading: !1, error: M })), z == null || z(M);
347
- }, this.enableLogs = K || !1, this.cacheOptions = rt ? { skipAPI: !!rt.skipAPI, ttl: rt.ttl || 0, storageKey: rt.storageKey, loadStale: !!rt.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."), G && (m = G), this.enableAnalytics = ft || !1, this.flags = Object.assign({}, R) || {}, this.datadogRum = k || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = A !== void 0 && !!S, V = "FLAGSMITH_EVENT_" + r.environment.apiKey, b && (A = b), pt && typeof window < "u" && this.setupRealtime(j, r.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = o(o({}, this.loadingState), { isLoading: !1, source: g.DEFAULT_FLAGS })), this.setState(de), this.log("Initialising with properties", e, this), q && (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), Tt && (m = /* @__PURE__ */ function(M) {
347
+ }, this.enableLogs = K || !1, this.cacheOptions = rt ? { skipAPI: !!rt.skipAPI, ttl: rt.ttl || 0, storageKey: rt.storageKey, loadStale: !!rt.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."), G && (m = G), this.enableAnalytics = ft || !1, this.flags = Object.assign({}, R) || {}, this.datadogRum = k || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = A !== void 0 && !!b, V = "FLAGSMITH_EVENT_" + r.environment.apiKey, S && (A = S), pt && typeof window < "u" && this.setupRealtime(j, r.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = o(o({}, this.loadingState), { isLoading: !1, source: g.DEFAULT_FLAGS })), this.setState(de), this.log("Initialising with properties", e, this), q && (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), Tt && (m = /* @__PURE__ */ function(M) {
348
348
  return function($, H) {
349
349
  var tt = H.headers, x = H.method, lt = H.body;
350
350
  return new Promise(function(nt) {
@@ -380,7 +380,7 @@ var re = { exports: {} };
380
380
  P.log("Retrieved events from cache", $), P.setState(o(o({}, tt), { evaluationEvent: H[P.evaluationContext.environment.apiKey] }));
381
381
  }
382
382
  }
383
- })), !S) return [3, 9];
383
+ })), !b) return [3, 9];
384
384
  if (!A || !this.canUseStorage) return [3, 8];
385
385
  he = function(M, $) {
386
386
  return w(P, void 0, void 0, function() {
@@ -649,8 +649,8 @@ Consider loading an EventSource polyfill and making it available globally as Eve
649
649
  } } };
650
650
  };
651
651
  for (var y in n.open(e.method || "get", a, !0), n.onload = function() {
652
- n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(u, S, k) {
653
- r.push(S = S.toLowerCase()), l.push([S, k]), c[S] = c[S] ? c[S] + "," + k : k;
652
+ n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(u, b, k) {
653
+ r.push(b = b.toLowerCase()), l.push([b, k]), c[b] = c[b] ? c[b] + "," + k : k;
654
654
  }), t(d());
655
655
  }, n.onerror = i, n.withCredentials = e.credentials == "include", e.headers) n.setRequestHeader(y, e.headers[y]);
656
656
  n.send(e.body || null);
@@ -948,12 +948,12 @@ const en = {
948
948
  }
949
949
  }
950
950
  }), Ye(v.namespace.value);
951
- const I = Ze(), O = St(() => s.name === "miniprogram-v2-project"), W = St(() => I.loading.value || I.enabled.value), F = Z(
952
- be(
951
+ const I = Ze(), O = bt(() => s.name === "miniprogram-v2-project"), W = bt(() => I.loading.value || I.enabled.value), F = Z(
952
+ Se(
953
953
  "mpv2:portal-collapsed",
954
954
  typeof window < "u" && window.matchMedia("(max-width: 1000px)").matches
955
955
  )
956
- ), g = Z(be("mpv2:editor-collapsed", !0)), m = St(() => O.value ? g.value : F.value), E = St(
956
+ ), g = Z(Se("mpv2:editor-collapsed", !0)), m = bt(() => O.value ? g.value : F.value), E = bt(
957
957
  () => {
958
958
  var V;
959
959
  return O.value ? (V = o.context.value) == null ? void 0 : V.project.name : String(s.meta.title ?? "Ecosystem");
@@ -962,7 +962,7 @@ const en = {
962
962
  { name: "miniprogram-v2-ecosystem", label: "Ecosystem", icon: "ecosystem" },
963
963
  { name: "miniprogram-v2-brand-kit", label: "Brand Kit", icon: "brand" },
964
964
  { name: "miniprogram-v2-pages", label: "Pages", icon: "pages" }
965
- ], it = St(() => ({ name: "miniprogram-v2-mobile-projects", query: ct(s.query) })), vt = Me(), gt = tn();
965
+ ], it = bt(() => ({ name: "miniprogram-v2-mobile-projects", query: ct(s.query) })), vt = Me(), gt = tn();
966
966
  let A = !1;
967
967
  Te(() => {
968
968
  A = v.hideSidebar.value, v.hideSidebar.value = !0;
@@ -995,7 +995,7 @@ const en = {
995
995
  "aria-label": m.value ? "Expand navigation" : "Collapse navigation",
996
996
  onClick: At
997
997
  }, [
998
- T(bt, { name: "collapse" }),
998
+ T(St, { name: "collapse" }),
999
999
  h[0] || (h[0] = C("span", { class: "portal-nav-label" }, "Mini Program", -1))
1000
1000
  ], 8, nn),
1001
1001
  C("nav", an, [
@@ -1008,7 +1008,7 @@ const en = {
1008
1008
  "aria-current": _(s).name === L.name ? "page" : void 0
1009
1009
  }, {
1010
1010
  default: st(() => [
1011
- T(bt, {
1011
+ T(St, {
1012
1012
  name: L.icon
1013
1013
  }, null, 8, ["name"]),
1014
1014
  C("span", rn, ut(L.label), 1)
@@ -1024,7 +1024,7 @@ const en = {
1024
1024
  "aria-current": O.value ? "page" : void 0
1025
1025
  }, {
1026
1026
  default: st(() => [
1027
- T(bt, { name: "mobile" }),
1027
+ T(St, { name: "mobile" }),
1028
1028
  h[1] || (h[1] = C("span", { class: "portal-nav-label" }, "Mobile Ordering", -1))
1029
1029
  ]),
1030
1030
  _: 1
@@ -1037,7 +1037,7 @@ const en = {
1037
1037
  "aria-label": L === "tablet" ? "Tablet" : "Kiosk"
1038
1038
  }, {
1039
1039
  default: st(() => [
1040
- T(bt, { name: L }, null, 8, ["name"]),
1040
+ T(St, { name: L }, null, 8, ["name"]),
1041
1041
  C("span", on, ut(L === "tablet" ? "Tablet" : "Kiosk"), 1)
1042
1042
  ]),
1043
1043
  _: 2
@@ -1058,7 +1058,7 @@ const en = {
1058
1058
  ]),
1059
1059
  _: 1
1060
1060
  }, 8, ["to", "class"]),
1061
- _(vt) && _(gt) ? (J(), Se(N, {
1061
+ _(vt) && _(gt) ? (J(), be(N, {
1062
1062
  key: 0,
1063
1063
  to: { name: "miniprogram-v2-template-center", query: _(ct)(_(s).query) },
1064
1064
  class: "portal-nav-item",
@@ -1082,7 +1082,7 @@ const en = {
1082
1082
  "aria-label": "Settings"
1083
1083
  }, {
1084
1084
  default: st(() => [
1085
- T(bt, { name: "settings" }),
1085
+ T(St, { name: "settings" }),
1086
1086
  h[6] || (h[6] = C("span", { class: "portal-nav-label" }, "Settings", -1))
1087
1087
  ]),
1088
1088
  _: 1
@@ -1109,7 +1109,7 @@ const en = {
1109
1109
  label: "Try again",
1110
1110
  onClick: _(o).refresh
1111
1111
  }, null, 8, ["onClick"])
1112
- ])) : (J(), Se(_(Ke), {
1112
+ ])) : (J(), be(_(Ke), {
1113
1113
  key: `${_(o).businessId.value}:${_(s).params.projectId ?? String(_(s).name)}`
1114
1114
  })) : (J(), Q("section", vn, [
1115
1115
  h[11] || (h[11] = C("h1", null, "Mini Program is not available for this business", -1)),
@@ -1124,7 +1124,7 @@ const en = {
1124
1124
  ], 64);
1125
1125
  };
1126
1126
  }
1127
- }), En = /* @__PURE__ */ Be(hn, [["__scopeId", "data-v-37c75dd1"]]);
1127
+ }), En = /* @__PURE__ */ Be(hn, [["__scopeId", "data-v-697eb20d"]]);
1128
1128
  export {
1129
1129
  En as default
1130
1130
  };