@feedmepos/mf-connect 0.1.122-dev → 0.1.123-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/dist/{App-Otfhp3H1.js → App-BHqbxq_5.js} +10 -10
  2. package/dist/{AuditLogs-C4DQ624f.js → AuditLogs-FB5BGl_F.js} +12 -12
  3. package/dist/{Bin-B5aee7-4.js → Bin-Bc5C_yvE.js} +8 -8
  4. package/dist/{Broadcast-BAQl4nEs.js → Broadcast-CEJc8daU.js} +12 -12
  5. package/dist/{CampaignAnalytic-mc0rWnt4.js → CampaignAnalytic-wUhISw-Z.js} +7 -7
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C06IzthB.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BlLw8Tb5.js} +8 -8
  7. package/dist/{Card-CoeclAye.js → Card-uviAfIRX.js} +22 -22
  8. package/dist/{Collections-DIamDQDK.js → Collections-COA2uZGw.js} +8 -8
  9. package/dist/{Credit-CoIPdhRy.js → Credit-Dh4GleW1.js} +12 -12
  10. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-nI2oXZiR.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DM-uzm4_.js} +1 -1
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CXNf6M-7.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-9fDPd8x9.js} +35 -35
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BZ42IxXy.js → EffectSheet.vue_vue_type_style_index_0_lang-DorkQcT5.js} +6 -6
  13. package/dist/{Experience-bJSkl9Xm.js → Experience-oOmPXIh-.js} +13 -13
  14. package/dist/{FileSaver.min-CFKCOdNt.js → FileSaver.min-_q7Dx4wn.js} +1 -1
  15. package/dist/{Game-DMoyicRl.js → Game-BTfpDAXf.js} +13 -13
  16. package/dist/{GiftCardSetup-B28jebxX.js → GiftCardSetup-FhOKl3OA.js} +10 -10
  17. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-il1_TmfZ.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-BWP_vdpd.js} +7 -7
  18. package/dist/{Goals-B9XRX-to.js → Goals-A5qHITPJ.js} +4 -4
  19. package/dist/{Grab-CNXLDEKx.js → Grab-D7BOmVRB.js} +9 -9
  20. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BZH5In2V.js → ImageInput.vue_vue_type_script_setup_true_lang-CqkwVS2r.js} +1 -1
  21. package/dist/{Index-BgGZBhf8.js → Index-CuSQjKgG.js} +10 -10
  22. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-M6eRk_nC.js → LocationPicker.vue_vue_type_script_setup_true_lang-D6bURd7V.js} +1 -1
  23. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DQCpH8dV.js → LottieAnimation.vue_vue_type_script_setup_true_lang-C3Nt5VLS.js} +1 -1
  24. package/dist/{LoyaltyDashboard-B-vMpAdx.js → LoyaltyDashboard-B66W2agI.js} +15 -15
  25. package/dist/{MainLayout-rv2xd7Yc.js → MainLayout-CguQ_XOG.js} +1 -1
  26. package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-BMwNt98l.js → MainLayout.vue_vue_type_script_setup_true_lang-ByHEOOgE.js} +3 -3
  27. package/dist/{Marketing-Wu2M2xPV.js → Marketing-DsRvHFfJ.js} +4 -4
  28. package/dist/{MarketingMaterialEdit-C5s0grZF.js → MarketingMaterialEdit-DLqupGle.js} +6 -6
  29. package/dist/{Member-D02_98Yo.js → Member-BlRWRmf7.js} +7 -7
  30. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-DGVDww0P.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-GZ5gUgb8.js} +23 -23
  31. package/dist/{MemberImportHistory-ZqjppSHQ.js → MemberImportHistory-DxpuDRx4.js} +7 -7
  32. package/dist/{MemberList-DpWX6mT9.js → MemberList-DnKQ0nCm.js} +14 -14
  33. package/dist/{MemberTransactions-BiE7FtKT.js → MemberTransactions-bs3canOe.js} +1 -1
  34. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DUtNRTNB.js → MessageInput.vue_vue_type_script_setup_true_lang-DRU6aeH8.js} +10 -10
  35. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DD5GkLoA.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-BYH3qzyb.js} +1 -1
  36. package/dist/{Mission-D3uyaxrt.js → Mission-DHXh7T93.js} +14 -14
  37. package/dist/{Overview-Dzs2l9dt.js → Overview-CVQBgphM.js} +4 -4
  38. package/dist/{Overview-C80up9Cz.js → Overview-UAF9JSio.js} +20 -20
  39. package/dist/{Point-CtyqLefg.js → Point-C6wv1uzT.js} +14 -14
  40. package/dist/{Promotion-C1pB_Mup.js → Promotion-CeZRHUed.js} +14 -14
  41. package/dist/{Queue-DkmBLRMM.js → Queue-BxTSJ6LA.js} +12 -12
  42. package/dist/{Record-B5onEmZr.js → Record-DoOyOT7I.js} +9 -9
  43. package/dist/{Review-fkpAgnWl.js → Review-BSpjwVxg.js} +2 -2
  44. package/dist/{ReviewFacebookCallback-CLeQP52t.js → ReviewFacebookCallback-CMAQ_PXJ.js} +5 -5
  45. package/dist/{ReviewGoogleCallback-Cj9zmCme.js → ReviewGoogleCallback-D---BE3G.js} +5 -5
  46. package/dist/{Reward-BNt4rJXG.js → Reward-BC2PCxwA.js} +16 -16
  47. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CJbD7izQ.js → RewardGroup.vue_vue_type_script_setup_true_lang-VV8I4Pnl.js} +13 -13
  48. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-ie0okvmi.js → RuleGroup.vue_vue_type_script_setup_true_lang-DmOKmXkP.js} +14 -14
  49. package/dist/{Segment-9weq5m6d.js → Segment-CcRapIdF.js} +25 -25
  50. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-j_DlD4Uz.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-D9Ino3uS.js} +14 -14
  51. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Bq1XKmWl.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-C42YDmfw.js} +4 -4
  52. package/dist/{Setting-DadiBCUq.js → Setting-CTWV-j-u.js} +14 -14
  53. package/dist/{SettingAdvertisements-BdXfSnNM.js → SettingAdvertisements-1WCqp0FF.js} +12 -12
  54. package/dist/{Settings-SF-Ai88W.js → Settings-BxgqmIBl.js} +5 -5
  55. package/dist/{Store-D3cAsGJ6.js → Store-uhCU5WYY.js} +26 -26
  56. package/dist/{StoreRewards-C2y1M4Ps.js → StoreRewards-DjgbbZsB.js} +15 -15
  57. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DX8nrBZd.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BgT5nChN.js} +24 -24
  58. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CjBucvpJ.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BAUBxdV2.js} +2 -2
  59. package/dist/{Tier-Dci8VbpH.js → Tier-B6sp_dj5.js} +26 -26
  60. package/dist/{Title-D4BpqJPQ.js → Title-Dew9vKN4.js} +22 -22
  61. package/dist/{Transaction-1biUZvIt.js → Transaction-ITefNWob.js} +2 -2
  62. package/dist/{Upselling-BTqqiZlc.js → Upselling-AMpfgEvH.js} +397 -387
  63. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-D7W1cxlp.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-B4LP8LZ-.js} +6 -6
  64. package/dist/{Voucher-DSygKr_u.js → Voucher-CRP6KY1f.js} +18 -18
  65. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-JL1V_LbU.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BZEJecca.js} +12 -12
  66. package/dist/{WhatsappAccount-CZ-js350.js → WhatsappAccount-MkutDvBs.js} +6 -6
  67. package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-DBiqtHgs.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-vDLl0J7v.js} +1 -1
  68. package/dist/{WhatsappBot-Bygdlech.js → WhatsappBot-B0m21qPb.js} +6 -6
  69. package/dist/{WhatsappBotLogs-BFLRYeQf.js → WhatsappBotLogs-BHyoUuef.js} +6 -6
  70. package/dist/{WhatsappBotSettings-COZEGQxT.js → WhatsappBotSettings-BbiHQ3Qb.js} +4 -4
  71. package/dist/{WhatsappLayout-DEzbS1SP.js → WhatsappLayout-yq05I3IA.js} +3 -3
  72. package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DUX8zJnw.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-BrjbWgKf.js} +3 -3
  73. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BJFYIRZl.js → ZodTextField.vue_vue_type_script_setup_true_lang-CLiZ6jd6.js} +2 -2
  74. package/dist/{app-gGao9t7Z.js → app-Ce3Q-VS4.js} +70 -70
  75. package/dist/app.js +1 -1
  76. package/dist/{base.export-cVWgL6vy.js → base.export-Ds3PiiHA.js} +2 -2
  77. package/dist/{business-DbDh-BxN.js → business-CfxfaERu.js} +1 -1
  78. package/dist/{campaign-B9tq1vZv.js → campaign-COuKKIRA.js} +8 -8
  79. package/dist/{campaign-D8jV7hA8.js → campaign-CtX-q7KI.js} +2 -2
  80. package/dist/{campaign.fn-DiQIanat.js → campaign.fn-oUqhH0SU.js} +152 -152
  81. package/dist/{collection.fn-DBfMa_P2.js → collection.fn-PhjmENfo.js} +2 -2
  82. package/dist/{currency-SZSbDgAr.js → currency-DmSaw6iQ.js} +1 -1
  83. package/dist/{duplicateCampaign-3K1VYqMD.js → duplicateCampaign-DzF45eaZ.js} +2 -2
  84. package/dist/{effect-CVTuOMbk.js → effect-sAKjjlrO.js} +1 -1
  85. package/dist/{email-addresses-DpVS_e0D.js → email-addresses-jSqlPLwS.js} +2 -2
  86. package/dist/{feature-flag-orm4I4-0.js → feature-flag-Dvz3D7kC.js} +1 -1
  87. package/dist/{helper-Ct1_-IEp.js → helper-Dn6pU0yd.js} +1 -1
  88. package/dist/{index-CONIxgEK.js → index--A062GN8.js} +4 -4
  89. package/dist/{index-B6hbCvzb.js → index-2B_HRy_7.js} +1 -1
  90. package/dist/{index-DCuUA8EI.js → index-8wWIydMw.js} +7 -7
  91. package/dist/{index-Bz2GhZNd.js → index-Aqx0Hc_6.js} +2 -2
  92. package/dist/{index-DFePTLAw.js → index-B_GA0PSb.js} +8 -8
  93. package/dist/{index-B2GJ653R.js → index-B_aWWeg9.js} +3 -3
  94. package/dist/{index-BOoNJIJh.js → index-BiBBY6Sk.js} +2 -2
  95. package/dist/{index-DwofBI5n.js → index-BoFxBf97.js} +1 -1
  96. package/dist/{index-NN_GXe7Q.js → index-BrqespAR.js} +1 -1
  97. package/dist/{index-BeGbQvrb.js → index-Bu2uqM4e.js} +2 -2
  98. package/dist/{index-DW5cDL7l.js → index-C4O-Fym0.js} +2 -2
  99. package/dist/{index-Clg5CVmr.js → index-C8fp9YtA.js} +1 -1
  100. package/dist/{index-MlhU8ucu.js → index-CRFiQOrt.js} +1 -1
  101. package/dist/{index-BXXLVdgj.js → index-CUaL0i4I.js} +1 -1
  102. package/dist/{index-DBpHsVZR.js → index-Cgg1NNfN.js} +2 -2
  103. package/dist/{index-COAgKj0v.js → index-CjAhwLNW.js} +2 -2
  104. package/dist/{index-CrluLS6Q.js → index-D6wQPKHc.js} +2 -2
  105. package/dist/{index-vfdh50L9.js → index-DFAceV6T.js} +1 -1
  106. package/dist/{index-uIOAK7Yt.js → index-bGITzW-d.js} +4 -4
  107. package/dist/{index-BUDFQtMG.js → index-pCmNLjIj.js} +3 -3
  108. package/dist/{index.esm2017-ZSQn8C-d.js → index.esm2017-ChJMTCyQ.js} +40 -40
  109. package/dist/{loading-B-xDCOdo.js → loading-DhiMqWJA.js} +1 -1
  110. package/dist/{lodash-DFW9UbwC.js → lodash-CCBK4pXz.js} +1 -1
  111. package/dist/{member-import-J0fm9uzH.js → member-import-BUvsg-Lu.js} +1 -1
  112. package/dist/{membership-B8KWhxBD.js → membership-7X3Uc50t.js} +2 -2
  113. package/dist/{money-CSIA5h2F.js → money-D5EIeVr_.js} +1 -1
  114. package/dist/{number-mHKvdu_x.js → number-Bj7X6VoA.js} +1 -1
  115. package/dist/objectid-CzFM8vy5.js +145 -0
  116. package/dist/{onboarding-CbvpduVK.js → onboarding-0mA1gXrv.js} +3 -3
  117. package/dist/{onboardingSetup-pQHr4ATi.js → onboardingSetup-BBPg-cAT.js} +2 -2
  118. package/dist/{plugins-D_LhWxFb.js → plugins-bprg7ahs.js} +3 -3
  119. package/dist/{reward-CFEIG_Fc.js → reward-WTxymIQH.js} +1 -1
  120. package/dist/{rule-Dqxm0TiU.js → rule-hJuK8Yqw.js} +9 -9
  121. package/dist/{template-BKPcMDwU.js → template-wt4Q2S3f.js} +6 -6
  122. package/dist/{timezone-CijbubTV.js → timezone-BWkDzpwA.js} +1 -1
  123. package/dist/{transaction.fn-Bg5w0js6.js → transaction.fn-DzwtEBIZ.js} +2 -2
  124. package/dist/{trigger-Z2ynsa7k.js → trigger-D6hitqvM.js} +5 -5
  125. package/dist/{useMarketingMaterialActions-Dgm-u9Nu.js → useMarketingMaterialActions-ByWwvQRt.js} +4 -4
  126. package/dist/{usePagination-Dlw4BUF1.js → usePagination-Mr6qWVOa.js} +1 -1
  127. package/dist/{user-BRNDlg4h.js → user-Dpl2lhox.js} +1 -1
  128. package/dist/{vue-i18n-h2H0nxj-.js → vue-i18n-BEFR04bc.js} +446 -446
  129. package/dist/{xlsx-CnlrcvXS.js → xlsx-Cu5ybiy4.js} +1 -1
  130. package/dist/{zod-DPWT8J03.js → zod-CcKqtEqX.js} +1 -1
  131. package/package.json +2 -2
  132. package/dist/objectid-BVNgDFLu.js +0 -145
@@ -1,10 +1,10 @@
1
- import { defineComponent as me, computed as B, ref as $, watch as G, reactive as ke, onMounted as Ce, onBeforeUnmount as ce, openBlock as p, createElementBlock as w, unref as u, createElementVNode as g, toDisplayString as b, createCommentVNode as _, createBlock as ne, createVNode as se, createTextVNode as $e, Fragment as ie, renderList as ue, withCtx as Te, normalizeClass as xe, normalizeStyle as Re, shallowRef as je, TransitionGroup as Le } from "vue";
2
- import { onBeforeRouteLeave as Me } from "vue-router";
1
+ import { defineComponent as me, computed as B, ref as R, watch as Y, reactive as ke, onMounted as Ce, onBeforeUnmount as ce, openBlock as p, createElementBlock as w, unref as i, createElementVNode as g, toDisplayString as b, createCommentVNode as _, createBlock as ne, createVNode as se, createTextVNode as Re, Fragment as ue, renderList as ie, withCtx as Se, normalizeClass as Te, normalizeStyle as $e, shallowRef as je, TransitionGroup as Me } from "vue";
2
+ import { onBeforeRouteLeave as Ne } from "vue-router";
3
3
  import { useCoreStore as he } from "@feedmepos/mf-common";
4
- import { components as Se } from "@feedmepos/ui-library";
5
- import { z as c } from "./app-gGao9t7Z.js";
6
- import { S as Ue, a as _e } from "./index-Bz2GhZNd.js";
7
- import { f as Ne } from "./currency-SZSbDgAr.js";
4
+ import { components as Ee } from "@feedmepos/ui-library";
5
+ import { z as c } from "./app-Ce3Q-VS4.js";
6
+ import { S as xe, a as _e } from "./index-Aqx0Hc_6.js";
7
+ import { f as Le } from "./currency-DmSaw6iQ.js";
8
8
  const We = {
9
9
  title: "Upselling settings",
10
10
  description: "Adjust product weight. Higher weight gives a product more priority in recommendations.",
@@ -88,98 +88,98 @@ const We = {
88
88
  previewMeal: "Picked for you",
89
89
  previewEmpty: "No recommendations returned."
90
90
  }, re = (e) => e.map((t) => ({ ...t })), de = (e) => JSON.stringify(
91
- [...e].sort((t, s) => t.productId.localeCompare(s.productId))
91
+ [...e].sort((t, a) => t.productId.localeCompare(a.productId))
92
92
  );
93
93
  function Be(e) {
94
- const t = je([]), s = $([]), l = $([]), m = $(!1), I = $(!1), k = $(!1), r = $(null), P = $(!1), a = $(!1), O = B(() => de(s.value) !== de(l.value)), A = ke(/* @__PURE__ */ new Map()), S = B(() => O.value || A.size > 0), N = (x) => JSON.stringify([x.businessId, x.restaurantId]);
95
- let M = "", T = 0;
96
- const W = B(() => new Map(s.value.map((x) => [x.productId, x]))), J = B(() => {
97
- const x = new Set(t.value.map((E) => E.productId));
94
+ const t = je([]), a = R([]), r = R([]), m = R(!1), I = R(!1), k = R(!1), s = R(null), P = R(!1), l = R(!1), U = B(() => de(a.value) !== de(r.value)), A = ke(/* @__PURE__ */ new Map()), E = B(() => U.value || A.size > 0), L = (T) => JSON.stringify([T.businessId, T.restaurantId]);
95
+ let N = "", S = 0;
96
+ const W = B(() => new Map(a.value.map((T) => [T.productId, T]))), X = B(() => {
97
+ const T = new Set(t.value.map((O) => O.productId));
98
98
  return [
99
- ...t.value.map((E) => ({ ...E, unavailable: !1 })),
100
- ...s.value.filter((E) => !x.has(E.productId)).map((E) => ({
101
- productId: E.productId,
102
- name: E.productId,
99
+ ...t.value.map((O) => ({ ...O, unavailable: !1 })),
100
+ ...a.value.filter((O) => !T.has(O.productId)).map((O) => ({
101
+ productId: O.productId,
102
+ name: O.productId,
103
103
  unavailable: !0
104
104
  }))
105
105
  ];
106
106
  });
107
107
  function q() {
108
- M && k.value && (O.value ? A.set(M, { items: re(s.value), baseline: re(l.value) }) : A.delete(M));
108
+ N && k.value && (U.value ? A.set(N, { items: re(a.value), baseline: re(r.value) }) : A.delete(N));
109
109
  }
110
- async function D() {
110
+ async function F() {
111
111
  q();
112
- const x = ++T, E = { businessId: e.businessId, restaurantId: e.restaurantId || void 0 };
113
- if (M = N(E), s.value = [], l.value = [], t.value = [], k.value = !1, I.value = !1, r.value = null, P.value = !1, a.value = !1, m.value = !!E.businessId, !!m.value)
112
+ const T = ++S, O = { businessId: e.businessId, restaurantId: e.restaurantId || void 0 };
113
+ if (N = L(O), a.value = [], r.value = [], t.value = [], k.value = !1, I.value = !1, s.value = null, P.value = !1, l.value = !1, m.value = !!O.businessId, !!m.value)
114
114
  try {
115
- const [j, V] = await Promise.all([e.api.get(E), e.loadProducts(E)]);
116
- if (x !== T) return;
117
- if (j.businessId !== E.businessId || (j.restaurantId || void 0) !== E.restaurantId)
115
+ const [j, V] = await Promise.all([e.api.get(O), e.loadProducts(O)]);
116
+ if (T !== S) return;
117
+ if (j.businessId !== O.businessId || (j.restaurantId || void 0) !== O.restaurantId)
118
118
  throw new Error("Settings scope mismatch");
119
- const L = A.get(M);
120
- l.value = re((L == null ? void 0 : L.baseline) ?? j.items), s.value = re((L == null ? void 0 : L.items) ?? j.items), a.value = j.inherited === !0, t.value = V, k.value = !0;
119
+ const M = A.get(N);
120
+ r.value = re((M == null ? void 0 : M.baseline) ?? j.items), a.value = re((M == null ? void 0 : M.items) ?? j.items), l.value = j.inherited === !0, t.value = V, k.value = !0;
121
121
  } catch {
122
- x === T && (r.value = "load");
122
+ T === S && (s.value = "load");
123
123
  } finally {
124
- x === T && (m.value = !1);
124
+ T === S && (m.value = !1);
125
125
  }
126
126
  }
127
- function F(x, E) {
127
+ function D(T, O) {
128
128
  if (!k.value || I.value) return;
129
- const j = W.value.get(x);
130
- j ? Object.assign(j, E) : s.value.push({ productId: x, adjustWeight: !1, weight: 0.5, ...E }), r.value = null, P.value = !1;
129
+ const j = W.value.get(T);
130
+ j ? Object.assign(j, O) : a.value.push({ productId: T, adjustWeight: !1, weight: 0.5, ...O }), s.value = null, P.value = !1;
131
131
  }
132
- function Q() {
133
- I.value || (s.value = re(l.value), A.delete(M), r.value = null, P.value = !1);
132
+ function J() {
133
+ I.value || (a.value = re(r.value), A.delete(N), s.value = null, P.value = !1);
134
134
  }
135
- async function U(x = !1) {
136
- if (!k.value || I.value || !x && !O.value) return;
137
- const E = T, j = M, V = { businessId: e.businessId, restaurantId: e.restaurantId || void 0 };
138
- if (x && (!V.restaurantId || !e.api.reset) || N(V) !== j) return;
139
- const L = re(s.value);
140
- I.value = !0, P.value = !1, r.value = null;
135
+ async function x(T = !1) {
136
+ if (!k.value || I.value || !T && !U.value) return;
137
+ const O = S, j = N, V = { businessId: e.businessId, restaurantId: e.restaurantId || void 0 };
138
+ if (T && (!V.restaurantId || !e.api.reset) || L(V) !== j) return;
139
+ const M = re(a.value);
140
+ I.value = !0, P.value = !1, s.value = null;
141
141
  try {
142
- const z = x ? await e.api.reset(V) : await e.api.save(V, L);
142
+ const z = T ? await e.api.reset(V) : await e.api.save(V, M);
143
143
  if (z.businessId !== V.businessId || (z.restaurantId || void 0) !== V.restaurantId)
144
144
  throw new Error("Settings scope mismatch");
145
- if (E !== T) {
146
- const K = A.get(j);
147
- j !== M && K && de(K.items) === de(L) && A.delete(j);
145
+ if (O !== S) {
146
+ const G = A.get(j);
147
+ j !== N && G && de(G.items) === de(M) && A.delete(j);
148
148
  return;
149
149
  }
150
- return s.value = re(z.items), l.value = re(z.items), a.value = z.inherited === !0, A.delete(j), P.value = !0, z;
150
+ return a.value = re(z.items), r.value = re(z.items), l.value = z.inherited === !0, A.delete(j), P.value = !0, z;
151
151
  } catch {
152
- E === T && (r.value = "save");
152
+ O === S && (s.value = "save");
153
153
  } finally {
154
- E === T && (I.value = !1);
154
+ O === S && (I.value = !1);
155
155
  }
156
156
  }
157
- return G(() => [e.businessId, e.restaurantId, e.api, e.loadProducts], D, { immediate: !0, flush: "sync" }), ce(() => {
158
- T++;
159
- }), { hasUnsaved: S, items: s, baseline: l, itemMap: W, rows: J, loaded: k, loading: m, saving: I, dirty: O, error: r, saved: P, inherited: a, load: D, save: () => U(), reset: () => U(!0), change: F, discard: Q };
157
+ return Y(() => [e.businessId, e.restaurantId, e.api, e.loadProducts], F, { immediate: !0, flush: "sync" }), ce(() => {
158
+ S++;
159
+ }), { hasUnsaved: E, items: a, baseline: r, itemMap: W, rows: X, loaded: k, loading: m, saving: I, dirty: U, error: s, saved: P, inherited: l, load: F, save: () => x(), reset: () => x(!0), change: D, discard: J };
160
160
  }
161
161
  function ve(e, t = 5) {
162
- const s = e.filter((m) => !m.unit && !m.perXUnit && !m.isOutOfStocked), l = Math.min(s.length, 5, Math.max(0, Math.floor(t)));
163
- return s.slice(0, l % 2 === 0 ? Math.max(0, l - 1) : l);
162
+ const a = e.filter((m) => !m.unit && !m.perXUnit && !m.isOutOfStocked), r = Math.min(a.length, 5, Math.max(0, Math.floor(t)));
163
+ return a.slice(0, r % 2 === 0 ? Math.max(0, r - 1) : r);
164
164
  }
165
- const fe = (e) => JSON.stringify([e.businessId, e.restaurantId || void 0]), De = (e, t) => (e == null ? void 0 : e.adjustWeight) === t.adjustWeight && (e == null ? void 0 : e.weight) === t.weight;
166
- function Fe(e, t) {
167
- const s = new Map(e.map((l) => [l.productId, l]));
168
- return t.filter((l) => !De(s.get(l.productId), l)).map((l) => ({ ...l }));
165
+ const fe = (e) => JSON.stringify([e.businessId, e.restaurantId || void 0]), Fe = (e, t) => (e == null ? void 0 : e.adjustWeight) === t.adjustWeight && (e == null ? void 0 : e.weight) === t.weight;
166
+ function De(e, t) {
167
+ const a = new Map(e.map((r) => [r.productId, r]));
168
+ return t.filter((r) => !Fe(a.get(r.productId), r)).map((r) => ({ ...r }));
169
169
  }
170
170
  function Ve(e, t) {
171
- const s = new Map(e.map((l) => [l.productId, { ...l }]));
172
- for (const l of t) s.set(l.productId, { ...l });
173
- return [...s.values()];
171
+ const a = new Map(e.map((r) => [r.productId, { ...r }]));
172
+ for (const r of t) a.set(r.productId, { ...r });
173
+ return [...a.values()];
174
174
  }
175
- const He = ["aria-label"], qe = { class: "upsell-preview-header" }, ze = { class: "fm-typo-en-body-lg-600" }, Je = ["aria-label"], Qe = ["aria-pressed", "onClick"], Ye = {
175
+ const He = ["aria-label"], qe = { class: "upsell-preview-header" }, ze = { class: "fm-typo-en-body-lg-600" }, Xe = ["aria-label"], Je = ["aria-pressed", "onClick"], Qe = {
176
176
  key: 0,
177
177
  class: "upsell-preview-context"
178
- }, Xe = { class: "upsell-preview-cart" }, Ge = ["data-cart-product"], Ke = { class: "upsell-preview-quantity" }, Ze = { class: "upsell-sr-only" }, et = ["value", "onChange"], tt = ["aria-label", "title", "onClick"], at = { class: "upsell-preview-cart-note" }, rt = {
178
+ }, Ke = { class: "upsell-preview-cart" }, Ye = ["data-cart-product"], Ge = { class: "upsell-preview-quantity" }, Ze = { class: "upsell-sr-only" }, et = ["value", "onChange"], tt = ["aria-label", "title", "onClick"], at = { class: "upsell-preview-cart-note" }, rt = {
179
179
  key: 1,
180
180
  class: "upsell-sr-only",
181
181
  role: "status"
182
- }, lt = ["aria-busy"], st = ["data-preview"], nt = { class: "upsell-preview-panel-label" }, ot = { class: "fm-typo-en-body-md-600" }, it = { class: "upsell-preview-touchpoint" }, ut = {
182
+ }, lt = ["aria-busy"], st = ["data-preview"], nt = { class: "upsell-preview-panel-label" }, ot = { class: "fm-typo-en-body-md-600" }, ut = { class: "upsell-preview-touchpoint" }, it = {
183
183
  key: 0,
184
184
  class: "upsell-preview-signals"
185
185
  }, dt = ["data-active"], ct = ["data-active"], pt = ["role"], vt = {
@@ -199,86 +199,86 @@ const He = ["aria-label"], qe = { class: "upsell-preview-header" }, ze = { class
199
199
  touchpoints: {}
200
200
  },
201
201
  setup(e) {
202
- const t = e, { FmSelect: s, FmButton: l } = Se, m = $([]), I = $(""), k = $("restaurant"), r = $([]), P = $(!1), a = $(!1), O = $(!1), A = $(/* @__PURE__ */ new Set()), S = $(null);
203
- let N = 0, M = "", T, W, J = !1, q;
202
+ const t = e, { FmSelect: a, FmButton: r } = Ee, m = R([]), I = R(""), k = R("restaurant"), s = R([]), P = R(!1), l = R(!1), U = R(!1), A = R(/* @__PURE__ */ new Set()), E = R(null);
203
+ let L = 0, N = "", S, W, X = !1, q;
204
204
  ce(() => {
205
- J = !0, N++, clearTimeout(q);
205
+ X = !0, L++, clearTimeout(q);
206
206
  });
207
- const D = B(() => m.value.find((h) => h.scope.restaurantId === I.value)), F = B(() => {
207
+ const F = B(() => m.value.find((h) => h.scope.restaurantId === I.value)), D = B(() => {
208
208
  var h;
209
- return ((h = D.value) == null ? void 0 : h.products) ?? [];
210
- }), Q = B(() => F.value.filter((h) => !r.value.some((C) => C.productId === h.productId)).map((h) => ({ value: h.productId, label: h.name }))), U = B(() => m.value.map((h) => ({ value: h.scope.restaurantId, label: h.name }))), x = B(() => [
209
+ return ((h = F.value) == null ? void 0 : h.products) ?? [];
210
+ }), J = B(() => D.value.filter((h) => !s.value.some((C) => C.productId === h.productId)).map((h) => ({ value: h.productId, label: h.name }))), x = B(() => m.value.map((h) => ({ value: h.scope.restaurantId, label: h.name }))), T = B(() => [
211
211
  { value: "restaurant", label: t.text.previewRestaurant },
212
212
  { value: "cart", label: t.text.previewCartBased }
213
- ]), E = B(() => {
214
- var h, C, v, y, o, R;
213
+ ]), O = B(() => {
214
+ var h, C, v, y, o, $;
215
215
  return [
216
- { id: "saved", title: t.text.previewSaved, products: ((h = S.value) == null ? void 0 : h.saved.products) ?? [], source: (C = S.value) == null ? void 0 : C.saved.source, weightsEnabled: (v = S.value) == null ? void 0 : v.saved.weightsEnabled },
217
- { id: "draft", title: t.text.previewDraft, products: ((y = S.value) == null ? void 0 : y.draft.products) ?? [], source: (o = S.value) == null ? void 0 : o.draft.source, weightsEnabled: (R = S.value) == null ? void 0 : R.draft.weightsEnabled }
216
+ { id: "saved", title: t.text.previewSaved, products: ((h = E.value) == null ? void 0 : h.saved.products) ?? [], source: (C = E.value) == null ? void 0 : C.saved.source, weightsEnabled: (v = E.value) == null ? void 0 : v.saved.weightsEnabled },
217
+ { id: "draft", title: t.text.previewDraft, products: ((y = E.value) == null ? void 0 : y.draft.products) ?? [], source: (o = E.value) == null ? void 0 : o.draft.source, weightsEnabled: ($ = E.value) == null ? void 0 : $.draft.weightsEnabled }
218
218
  ];
219
219
  }), j = B(() => {
220
220
  var h;
221
- return O.value || a.value ? t.text.previewLoadError : D.value ? k.value === "cart" && !r.value.length ? t.text.previewCartEmpty : (h = t.host) != null && h.loadPreview ? P.value && !S.value ? t.text.previewLoading : "" : t.text.previewUnavailable : t.text.previewChooseOutlet;
221
+ return U.value || l.value ? t.text.previewLoadError : F.value ? k.value === "cart" && !s.value.length ? t.text.previewCartEmpty : (h = t.host) != null && h.loadPreview ? P.value && !E.value ? t.text.previewLoading : "" : t.text.previewUnavailable : t.text.previewChooseOutlet;
222
222
  });
223
223
  async function V() {
224
224
  var h, C;
225
- O.value = !1;
225
+ U.value = !1;
226
226
  try {
227
227
  const v = t.host;
228
228
  let y = [];
229
- if (v != null && v.loadApplyTargets ? y = await v.loadApplyTargets(v.businessId) : v != null && v.restaurantId && (y = [{ scope: { businessId: v.businessId, restaurantId: v.restaurantId }, name: v.restaurantName ?? v.restaurantId, products: t.products }]), J) return;
229
+ if (v != null && v.loadApplyTargets ? y = await v.loadApplyTargets(v.businessId) : v != null && v.restaurantId && (y = [{ scope: { businessId: v.businessId, restaurantId: v.restaurantId }, name: v.restaurantName ?? v.restaurantId, products: t.products }]), X) return;
230
230
  m.value = y.filter((o) => (!(v != null && v.restaurantId) || o.scope.restaurantId === v.restaurantId) && o.scope.restaurantId && o.scope.businessId === (v == null ? void 0 : v.businessId) && !o.unavailableReason), I.value = ((h = m.value.find((o) => o.scope.restaurantId === (v == null ? void 0 : v.restaurantId))) == null ? void 0 : h.scope.restaurantId) ?? ((C = m.value[0]) == null ? void 0 : C.scope.restaurantId) ?? "";
231
231
  } catch {
232
- J || (O.value = !0);
232
+ X || (U.value = !0);
233
233
  }
234
234
  }
235
- Ce(V), G(I, () => {
236
- r.value = [], A.value = /* @__PURE__ */ new Set();
235
+ Ce(V), Y(I, () => {
236
+ s.value = [], A.value = /* @__PURE__ */ new Set();
237
237
  });
238
- function L(h) {
239
- Q.value.some((C) => C.value === h) && (r.value = [...r.value, { productId: h, quantity: 1 }]);
238
+ function M(h) {
239
+ J.value.some((C) => C.value === h) && (s.value = [...s.value, { productId: h, quantity: 1 }]);
240
240
  }
241
241
  function z(h, C) {
242
- const v = Number(C.target.value), y = r.value.find((o) => o.productId === h);
242
+ const v = Number(C.target.value), y = s.value.find((o) => o.productId === h);
243
243
  y && (y.quantity = Number.isInteger(v) && v >= 1 && v <= 99 ? v : 1), C.target.value = String((y == null ? void 0 : y.quantity) ?? 1);
244
244
  }
245
- function K(h, C) {
245
+ function G(h, C) {
246
246
  if (!h || !["historical", "weight_only", "no_data", "unknown"].includes(h.source) || !Array.isArray(h.products)) throw new Error("Invalid preview products");
247
247
  const v = h.products.map((y) => y.productId);
248
248
  if (v.some((y) => !C.has(y)) || new Set(v).size !== v.length) throw new Error("Invalid preview products");
249
249
  }
250
250
  async function Z(h = !0) {
251
- h && (T = void 0, W = void 0), clearTimeout(q);
252
- const C = ++N;
253
- a.value = !1, P.value = !1;
254
- const v = t.host, y = D.value, o = `${v == null ? void 0 : v.businessId}:${y == null ? void 0 : y.scope.restaurantId}:${k.value}`;
255
- if (o !== M && (S.value = null), M = o, !(v != null && v.loadPreview) || !(y != null && y.scope.restaurantId) || k.value === "cart" && !r.value.length) {
256
- S.value = null;
251
+ h && (S = void 0, W = void 0), clearTimeout(q);
252
+ const C = ++L;
253
+ l.value = !1, P.value = !1;
254
+ const v = t.host, y = F.value, o = `${v == null ? void 0 : v.businessId}:${y == null ? void 0 : y.scope.restaurantId}:${k.value}`;
255
+ if (o !== N && (E.value = null), N = o, !(v != null && v.loadPreview) || !(y != null && y.scope.restaurantId) || k.value === "cart" && !s.value.length) {
256
+ E.value = null;
257
257
  return;
258
258
  }
259
- const R = { businessId: v.businessId, restaurantId: y.scope.restaurantId }, ee = k.value, X = ee === "cart" ? r.value.map((Y) => ({ ...Y })) : [], te = new Set(y.products.map((Y) => Y.productId)), H = Fe(t.savedItems, t.draftItems).filter((Y) => te.has(Y.productId)), ae = v.loadPreview;
259
+ const $ = { businessId: v.businessId, restaurantId: y.scope.restaurantId }, ee = k.value, K = ee === "cart" ? s.value.map((Q) => ({ ...Q })) : [], te = new Set(y.products.map((Q) => Q.productId)), H = De(t.savedItems, t.draftItems).filter((Q) => te.has(Q.productId)), ae = v.loadPreview;
260
260
  P.value = !0;
261
261
  try {
262
- const Y = await (T ?? (T = v.api.get(R)));
263
- if (C !== N) return;
264
- if (fe(Y) !== fe(R)) throw new Error("Preview scope mismatch");
265
- const oe = (f) => ({ ...R, catalog: y.products, recommendationType: ee, cart: X.map((le) => ({ ...le })), items: f.filter((le) => te.has(le.productId)).map((le) => ({ ...le })), limit: 5 }), i = v.restaurantId || Y.inherited === !0 ? H : [], d = [{ ...oe(Y.items), mode: "current" }, { ...oe(Ve(Y.items, i)), mode: "preview" }];
262
+ const Q = await (S ?? (S = v.api.get($)));
263
+ if (C !== L) return;
264
+ if (fe(Q) !== fe($)) throw new Error("Preview scope mismatch");
265
+ const oe = (f) => ({ ...$, catalog: y.products, recommendationType: ee, cart: K.map((le) => ({ ...le })), items: f.filter((le) => te.has(le.productId)).map((le) => ({ ...le })), limit: 5 }), u = v.restaurantId || Q.inherited === !0 ? H : [], d = [{ ...oe(Q.items), mode: "current" }, { ...oe(Ve(Q.items, u)), mode: "preview" }];
266
266
  W ?? (W = ae(d[0]));
267
267
  const n = await Promise.all([W, ae(d[1])]);
268
- if (C !== N) return;
269
- n.forEach((f) => K(f, te)), S.value = { saved: { ...n[0], weightsEnabled: d[0].items.some((f) => f.adjustWeight), products: ve(n[0].products) }, draft: { ...n[1], weightsEnabled: d[1].items.some((f) => f.adjustWeight), products: ve(n[1].products) } };
268
+ if (C !== L) return;
269
+ n.forEach((f) => G(f, te)), E.value = { saved: { ...n[0], weightsEnabled: d[0].items.some((f) => f.adjustWeight), products: ve(n[0].products) }, draft: { ...n[1], weightsEnabled: d[1].items.some((f) => f.adjustWeight), products: ve(n[1].products) } };
270
270
  } catch {
271
- C === N && (T = void 0, W = void 0, S.value = null, a.value = !0);
271
+ C === L && (S = void 0, W = void 0, E.value = null, l.value = !0);
272
272
  } finally {
273
- C === N && (P.value = !1);
273
+ C === L && (P.value = !1);
274
274
  }
275
275
  }
276
- return G(() => {
276
+ return Y(() => {
277
277
  var h, C, v, y;
278
- return [D.value, k.value, r.value, t.savedItems, (h = t.host) == null ? void 0 : h.loadPreview, (C = t.host) == null ? void 0 : C.api, (v = t.host) == null ? void 0 : v.businessId, (y = t.host) == null ? void 0 : y.restaurantId];
279
- }, () => Z(), { deep: !0, flush: "post" }), G(() => t.draftItems, () => {
278
+ return [F.value, k.value, s.value, t.savedItems, (h = t.host) == null ? void 0 : h.loadPreview, (C = t.host) == null ? void 0 : C.api, (v = t.host) == null ? void 0 : v.businessId, (y = t.host) == null ? void 0 : y.restaurantId];
279
+ }, () => Z(), { deep: !0, flush: "post" }), Y(() => t.draftItems, () => {
280
280
  var h;
281
- N++, a.value = !1, P.value = !!((h = t.host) != null && h.loadPreview), clearTimeout(q), q = setTimeout(() => Z(!1), 250);
281
+ L++, l.value = !1, P.value = !!((h = t.host) != null && h.loadPreview), clearTimeout(q), q = setTimeout(() => Z(!1), 250);
282
282
  }, { deep: !0 }), (h, C) => {
283
283
  var v, y;
284
284
  return ((v = e.touchpoints) == null ? void 0 : v.length) !== 0 ? (p(), w("section", {
@@ -288,43 +288,43 @@ const He = ["aria-label"], qe = { class: "upsell-preview-header" }, ze = { class
288
288
  }, [
289
289
  g("header", qe, [
290
290
  g("h2", ze, b(e.text.preview), 1),
291
- (y = e.host) != null && y.restaurantId ? _("", !0) : (p(), ne(u(s), {
291
+ (y = e.host) != null && y.restaurantId ? _("", !0) : (p(), ne(i(a), {
292
292
  key: 0,
293
293
  modelValue: I.value,
294
294
  "onUpdate:modelValue": C[0] || (C[0] = (o) => I.value = o),
295
295
  label: e.text.previewOutlet,
296
- items: U.value
296
+ items: x.value
297
297
  }, null, 8, ["modelValue", "label", "items"])),
298
298
  g("div", {
299
299
  class: "upsell-preview-tabs",
300
300
  role: "group",
301
301
  "aria-label": e.text.preview
302
302
  }, [
303
- (p(!0), w(ie, null, ue(x.value, (o) => (p(), w("button", {
303
+ (p(!0), w(ue, null, ie(T.value, (o) => (p(), w("button", {
304
304
  key: o.value,
305
305
  type: "button",
306
306
  "aria-pressed": k.value === o.value,
307
- onClick: (R) => k.value = o.value
308
- }, b(o.label), 9, Qe))), 128))
309
- ], 8, Je)
307
+ onClick: ($) => k.value = o.value
308
+ }, b(o.label), 9, Je))), 128))
309
+ ], 8, Xe)
310
310
  ]),
311
- k.value === "cart" ? (p(), w("div", Ye, [
312
- se(u(s), {
311
+ k.value === "cart" ? (p(), w("div", Qe, [
312
+ se(i(a), {
313
313
  "model-value": "",
314
314
  label: e.text.previewOrder,
315
- items: Q.value,
316
- "onUpdate:modelValue": L
315
+ items: J.value,
316
+ "onUpdate:modelValue": M
317
317
  }, null, 8, ["label", "items"]),
318
- g("ul", Xe, [
319
- (p(!0), w(ie, null, ue(r.value, (o) => {
320
- var R, ee, X, te;
318
+ g("ul", Ke, [
319
+ (p(!0), w(ue, null, ie(s.value, (o) => {
320
+ var $, ee, K, te;
321
321
  return p(), w("li", {
322
322
  key: o.productId,
323
323
  "data-cart-product": o.productId
324
324
  }, [
325
- g("span", null, b((R = F.value.find((H) => H.productId === o.productId)) == null ? void 0 : R.name), 1),
326
- g("label", Ke, [
327
- g("span", Ze, b(e.text.previewQuantity) + ": " + b((ee = F.value.find((H) => H.productId === o.productId)) == null ? void 0 : ee.name), 1),
325
+ g("span", null, b(($ = D.value.find((H) => H.productId === o.productId)) == null ? void 0 : $.name), 1),
326
+ g("label", Ge, [
327
+ g("span", Ze, b(e.text.previewQuantity) + ": " + b((ee = D.value.find((H) => H.productId === o.productId)) == null ? void 0 : ee.name), 1),
328
328
  C[2] || (C[2] = g("span", { "aria-hidden": "true" }, "×", -1)),
329
329
  g("input", {
330
330
  type: "number",
@@ -337,9 +337,9 @@ const He = ["aria-label"], qe = { class: "upsell-preview-header" }, ze = { class
337
337
  g("button", {
338
338
  type: "button",
339
339
  class: "upsell-preview-remove",
340
- "aria-label": `${e.text.previewRemove} ${(X = F.value.find((H) => H.productId === o.productId)) == null ? void 0 : X.name}`,
341
- title: `${e.text.previewRemove} ${(te = F.value.find((H) => H.productId === o.productId)) == null ? void 0 : te.name}`,
342
- onClick: (H) => r.value = r.value.filter((ae) => ae.productId !== o.productId)
340
+ "aria-label": `${e.text.previewRemove} ${(K = D.value.find((H) => H.productId === o.productId)) == null ? void 0 : K.name}`,
341
+ title: `${e.text.previewRemove} ${(te = D.value.find((H) => H.productId === o.productId)) == null ? void 0 : te.name}`,
342
+ onClick: (H) => s.value = s.value.filter((ae) => ae.productId !== o.productId)
343
343
  }, [...C[3] || (C[3] = [
344
344
  g("svg", {
345
345
  width: "16",
@@ -356,17 +356,17 @@ const He = ["aria-label"], qe = { class: "upsell-preview-header" }, ze = { class
356
356
  })
357
357
  ], -1)
358
358
  ])], 8, tt)
359
- ], 8, Ge);
359
+ ], 8, Ye);
360
360
  }), 128))
361
361
  ]),
362
362
  g("p", at, b(e.text.previewCartQuantities), 1)
363
363
  ])) : _("", !0),
364
- P.value && S.value ? (p(), w("p", rt, b(e.text.previewLoading), 1)) : _("", !0),
364
+ P.value && E.value ? (p(), w("p", rt, b(e.text.previewLoading), 1)) : _("", !0),
365
365
  g("div", {
366
366
  class: "upsell-preview-panels",
367
367
  "aria-busy": P.value
368
368
  }, [
369
- (p(!0), w(ie, null, ue(E.value, (o) => (p(), w("article", {
369
+ (p(!0), w(ue, null, ie(O.value, (o) => (p(), w("article", {
370
370
  key: o.id,
371
371
  "data-preview": o.id,
372
372
  class: "upsell-preview-panel"
@@ -374,8 +374,8 @@ const He = ["aria-label"], qe = { class: "upsell-preview-header" }, ze = { class
374
374
  g("div", nt, [
375
375
  g("h3", ot, b(o.title), 1)
376
376
  ]),
377
- g("div", it, [
378
- o.source && o.source !== "unknown" ? (p(), w("div", ut, [
377
+ g("div", ut, [
378
+ o.source && o.source !== "unknown" ? (p(), w("div", it, [
379
379
  g("span", {
380
380
  "data-active": o.weightsEnabled
381
381
  }, b(o.weightsEnabled ? e.text.previewWeightsOn : e.text.previewWeightsOff), 9, dt),
@@ -385,29 +385,29 @@ const He = ["aria-label"], qe = { class: "upsell-preview-header" }, ze = { class
385
385
  ])) : _("", !0),
386
386
  j.value ? (p(), w("p", {
387
387
  key: 1,
388
- class: xe(["upsell-preview-none", { "upsell-error": a.value || O.value }]),
389
- role: a.value || O.value ? "alert" : "status"
390
- }, b(j.value), 11, pt)) : S.value && !o.products.length ? (p(), w("p", vt, b(o.source === "no_data" ? e.text.previewNoData : e.text.previewEmpty), 1)) : (p(), ne(Le, {
388
+ class: Te(["upsell-preview-none", { "upsell-error": l.value || U.value }]),
389
+ role: l.value || U.value ? "alert" : "status"
390
+ }, b(j.value), 11, pt)) : E.value && !o.products.length ? (p(), w("p", vt, b(o.source === "no_data" ? e.text.previewNoData : e.text.previewEmpty), 1)) : (p(), ne(Me, {
391
391
  key: 3,
392
392
  tag: "ul",
393
393
  name: "upsell-suggestion",
394
394
  "aria-label": o.source === "unknown" ? o.title : `${o.title}: ${o.weightsEnabled ? e.text.previewWeightsOn : e.text.previewWeightsOff}, ${o.source === "historical" ? e.text.previewRelevanceOn : e.text.previewRelevanceOff}`
395
395
  }, {
396
- default: Te(() => [
397
- (p(!0), w(ie, null, ue(o.products, (R) => (p(), w("li", {
398
- key: R.productId,
399
- "data-preview-product": R.productId
396
+ default: Se(() => [
397
+ (p(!0), w(ue, null, ie(o.products, ($) => (p(), w("li", {
398
+ key: $.productId,
399
+ "data-preview-product": $.productId
400
400
  }, [
401
- R.imageUrl && !A.value.has(R.productId) ? (p(), w("img", {
401
+ $.imageUrl && !A.value.has($.productId) ? (p(), w("img", {
402
402
  key: 0,
403
- src: R.imageUrl,
403
+ src: $.imageUrl,
404
404
  alt: "",
405
405
  loading: "lazy",
406
- onError: (ee) => A.value.add(R.productId)
406
+ onError: (ee) => A.value.add($.productId)
407
407
  }, null, 40, ht)) : (p(), w("span", gt, b(e.text.missingPhoto), 1)),
408
408
  g("div", null, [
409
- g("h4", null, b(R.name), 1),
410
- R.priceLabel ? (p(), w("p", wt, b(R.priceLabel), 1)) : _("", !0)
409
+ g("h4", null, b($.name), 1),
410
+ $.priceLabel ? (p(), w("p", wt, b($.priceLabel), 1)) : _("", !0)
411
411
  ])
412
412
  ], 8, mt))), 128))
413
413
  ]),
@@ -416,11 +416,11 @@ const He = ["aria-label"], qe = { class: "upsell-preview-header" }, ze = { class
416
416
  ])
417
417
  ], 8, st))), 128))
418
418
  ], 8, lt),
419
- a.value || O.value ? (p(), ne(u(l), {
419
+ l.value || U.value ? (p(), ne(i(r), {
420
420
  key: 2,
421
421
  label: e.text.retry,
422
422
  variant: "secondary",
423
- onClick: C[1] || (C[1] = (o) => O.value ? V() : Z())
423
+ onClick: C[1] || (C[1] = (o) => U.value ? V() : Z())
424
424
  }, null, 8, ["label"])) : _("", !0)
425
425
  ], 8, He)) : _("", !0);
426
426
  };
@@ -431,55 +431,55 @@ const He = ["aria-label"], qe = { class: "upsell-preview-header" }, ze = { class
431
431
  }, kt = {
432
432
  key: 1,
433
433
  class: "upsell-eyebrow"
434
- }, Ct = { class: "upsell-actions" }, Tt = { class: "upsell-note" }, xt = {
434
+ }, Ct = { class: "upsell-actions" }, St = { class: "upsell-note" }, Tt = {
435
435
  key: 0,
436
436
  class: "upsell-scope"
437
- }, St = { class: "upsell-description" }, Ut = {
437
+ }, Et = { class: "upsell-description" }, xt = {
438
438
  key: 0,
439
439
  class: "upsell-error",
440
440
  role: "alert"
441
441
  }, Pt = {
442
442
  key: 1,
443
443
  class: "upsell-description"
444
- }, Et = {
444
+ }, Ot = {
445
445
  class: "upsell-feedback",
446
446
  "aria-live": "polite"
447
- }, Ot = {
447
+ }, Ut = {
448
448
  key: 0,
449
449
  role: "alert",
450
450
  class: "upsell-error"
451
451
  }, At = {
452
452
  key: 1,
453
453
  class: "upsell-success"
454
- }, $t = { key: 2 }, Rt = {
454
+ }, Rt = { key: 2 }, $t = {
455
455
  key: 2,
456
456
  class: "upsell-empty"
457
457
  }, jt = {
458
458
  key: 3,
459
459
  class: "upsell-empty",
460
460
  role: "status"
461
- }, Lt = {
461
+ }, Mt = {
462
462
  key: 4,
463
463
  class: "upsell-empty"
464
- }, Mt = {
464
+ }, Nt = {
465
465
  key: 5,
466
466
  class: "upsell-editor"
467
- }, _t = { class: "upsell-editor-products" }, Nt = { class: "upsell-toolbar" }, Wt = { class: "upsell-search" }, Bt = {
467
+ }, _t = { class: "upsell-editor-products" }, Lt = { class: "upsell-toolbar" }, Wt = { class: "upsell-search" }, Bt = {
468
468
  key: 0,
469
469
  class: "upsell-empty"
470
- }, Dt = {
470
+ }, Ft = {
471
471
  key: 1,
472
472
  class: "upsell-empty"
473
- }, Ft = {
473
+ }, Dt = {
474
474
  key: 2,
475
475
  class: "upsell-products"
476
476
  }, Vt = ["data-product-id"], Ht = { class: "upsell-product" }, qt = ["src", "onError"], zt = {
477
477
  key: 1,
478
478
  class: "upsell-photo upsell-no-photo"
479
- }, Jt = { key: 0 }, Qt = { key: 1 }, Yt = {
479
+ }, Xt = { key: 0 }, Jt = { key: 1 }, Qt = {
480
480
  key: 2,
481
481
  class: "upsell-unavailable"
482
- }, Xt = { class: "upsell-switch" }, Gt = { class: "upsell-sr-only" }, Kt = { class: "upsell-weight-heading" }, Zt = { key: 0 }, ea = ["aria-label"], ta = ["value", "aria-label", "aria-valuetext", "disabled", "data-boosted", "onInput", "onPointermove", "onPointerup", "onPointercancel", "onLostpointercapture"], aa = /* @__PURE__ */ me({
482
+ }, Kt = { class: "upsell-switch" }, Yt = { class: "upsell-sr-only" }, Gt = { class: "upsell-weight-heading" }, Zt = { key: 0 }, ea = ["aria-label"], ta = ["value", "aria-label", "aria-valuetext", "disabled", "data-boosted", "onInput", "onPointermove", "onPointerup", "onPointercancel", "onLostpointercapture"], aa = /* @__PURE__ */ me({
483
483
  __name: "UpsellingSettings",
484
484
  props: {
485
485
  loadPreview: { type: Function },
@@ -493,196 +493,196 @@ const He = ["aria-label"], qe = { class: "upsell-preview-header" }, ze = { class
493
493
  restaurantId: {}
494
494
  },
495
495
  emits: ["dirty-change", "busy-change", "saved"],
496
- setup(e, { expose: t, emit: s }) {
497
- const { FmButton: l, FmSwitch: m, FmTextField: I, FmSelect: k } = Se, r = e, P = s, a = B(() => ({ ...We, ...r.messages })), O = $(""), A = $(/* @__PURE__ */ new Set()), S = $(r.restaurantId ?? ""), N = $([]), M = $(!1), T = $(!1);
496
+ setup(e, { expose: t, emit: a }) {
497
+ const { FmButton: r, FmSwitch: m, FmTextField: I, FmSelect: k } = Ee, s = e, P = a, l = B(() => ({ ...We, ...s.messages })), U = R(""), A = R(/* @__PURE__ */ new Set()), E = R(s.restaurantId ?? ""), L = R([]), N = R(!1), S = R(!1);
498
498
  let W = 0;
499
- const J = B(() => {
500
- const i = r.businessId, d = r.loadApplyTargets;
499
+ const X = B(() => {
500
+ const u = s.businessId, d = s.loadApplyTargets;
501
501
  let n;
502
- return () => n ?? (n = d(i).catch((f) => {
502
+ return () => n ?? (n = d(u).catch((f) => {
503
503
  throw n = void 0, f;
504
504
  }));
505
505
  }), q = B(() => {
506
- const i = J.value;
506
+ const u = X.value;
507
507
  return async (d) => {
508
- const n = (await i()).find((f) => f.scope.businessId === d.businessId && f.scope.restaurantId === d.restaurantId);
508
+ const n = (await u()).find((f) => f.scope.businessId === d.businessId && f.scope.restaurantId === d.restaurantId);
509
509
  if (!n || n.unavailableReason) throw new Error("Catalog unavailable for editing scope");
510
510
  return n.products;
511
511
  };
512
512
  });
513
- G(() => [r.businessId, r.restaurantId], () => {
514
- S.value = r.restaurantId ?? "";
513
+ Y(() => [s.businessId, s.restaurantId], () => {
514
+ E.value = s.restaurantId ?? "";
515
515
  }, { flush: "sync" });
516
- async function D() {
517
- const i = ++W;
518
- N.value = [], T.value = !1, M.value = !!r.loadApplyTargets;
516
+ async function F() {
517
+ const u = ++W;
518
+ L.value = [], S.value = !1, N.value = !!s.loadApplyTargets;
519
519
  try {
520
- const d = r.loadApplyTargets ? await J.value() : [];
521
- i === W && (N.value = d.filter((n) => n.scope.businessId === r.businessId));
520
+ const d = s.loadApplyTargets ? await X.value() : [];
521
+ u === W && (L.value = d.filter((n) => n.scope.businessId === s.businessId));
522
522
  } catch {
523
- i === W && (T.value = !0);
523
+ u === W && (S.value = !0);
524
524
  } finally {
525
- i === W && (M.value = !1);
525
+ u === W && (N.value = !1);
526
526
  }
527
527
  }
528
- G(() => [r.businessId, r.loadApplyTargets], D, { immediate: !0 });
529
- const F = B(() => [
530
- { value: "", label: a.value.businessDefault },
531
- ...N.value.filter((i) => i.scope.restaurantId && !i.unavailableReason).map((i) => ({ value: i.scope.restaurantId, label: i.name }))
532
- ]), Q = ke({
528
+ Y(() => [s.businessId, s.loadApplyTargets], F, { immediate: !0 });
529
+ const D = B(() => [
530
+ { value: "", label: l.value.businessDefault },
531
+ ...L.value.filter((u) => u.scope.restaurantId && !u.unavailableReason).map((u) => ({ value: u.scope.restaurantId, label: u.name }))
532
+ ]), J = ke({
533
533
  get businessId() {
534
- return r.businessId;
534
+ return s.businessId;
535
535
  },
536
536
  get restaurantId() {
537
- return S.value || void 0;
537
+ return E.value || void 0;
538
538
  },
539
539
  get restaurantName() {
540
- var i;
541
- return ((i = N.value.find((d) => d.scope.restaurantId === S.value)) == null ? void 0 : i.name) ?? r.restaurantName;
540
+ var u;
541
+ return ((u = L.value.find((d) => d.scope.restaurantId === E.value)) == null ? void 0 : u.name) ?? s.restaurantName;
542
542
  },
543
543
  get api() {
544
- return r.api;
544
+ return s.api;
545
545
  },
546
546
  get loadProducts() {
547
- return r.loadApplyTargets ? q.value : r.loadProducts;
547
+ return s.loadApplyTargets ? q.value : s.loadProducts;
548
548
  },
549
549
  get loadApplyTargets() {
550
- return r.loadApplyTargets ? J.value : void 0;
550
+ return s.loadApplyTargets ? X.value : void 0;
551
551
  },
552
552
  get loadPreview() {
553
- return r.loadPreview;
553
+ return s.loadPreview;
554
554
  }
555
- }), U = Be(Q), { hasUnsaved: x } = U;
556
- async function E() {
557
- await Promise.all([D(), U.load()]);
555
+ }), x = Be(J), { hasUnsaved: T } = x;
556
+ async function O() {
557
+ await Promise.all([F(), x.load()]);
558
558
  }
559
- const { itemMap: j, loading: V, saving: L, loaded: z, error: K, dirty: Z, saved: h, inherited: C } = U, v = B(() => {
560
- const i = O.value.trim().toLocaleLowerCase();
561
- return U.rows.value.filter((d) => !d.unavailable).filter((d) => `${d.name} ${d.category ?? ""} ${d.productId}`.toLocaleLowerCase().includes(i));
559
+ const { itemMap: j, loading: V, saving: M, loaded: z, error: G, dirty: Z, saved: h, inherited: C } = x, v = B(() => {
560
+ const u = U.value.trim().toLocaleLowerCase();
561
+ return x.rows.value.filter((d) => !d.unavailable).filter((d) => `${d.name} ${d.category ?? ""} ${d.productId}`.toLocaleLowerCase().includes(u));
562
562
  });
563
- function y(i) {
563
+ function y(u) {
564
564
  var d;
565
- return ((d = j.value.get(i)) == null ? void 0 : d.weight) ?? 0.5;
565
+ return ((d = j.value.get(u)) == null ? void 0 : d.weight) ?? 0.5;
566
566
  }
567
- function o(i) {
567
+ function o(u) {
568
568
  var d;
569
- return ((d = j.value.get(i)) == null ? void 0 : d.adjustWeight) ?? !1;
569
+ return ((d = j.value.get(u)) == null ? void 0 : d.adjustWeight) ?? !1;
570
570
  }
571
- function R(i) {
572
- return o(i) ? y(i) === 0 ? a.value.excluded : y(i) < 0.4 ? a.value.weak : y(i) < 0.6 ? a.value.normal : y(i) < 0.8 ? a.value.strong : a.value.strongest : a.value.automatic;
571
+ function $(u) {
572
+ return o(u) ? y(u) === 0 ? l.value.excluded : y(u) < 0.4 ? l.value.weak : y(u) < 0.6 ? l.value.normal : y(u) < 0.8 ? l.value.strong : l.value.strongest : l.value.automatic;
573
573
  }
574
- function ee(i, d) {
574
+ function ee(u, d) {
575
575
  const n = Number(d.target.value);
576
- U.change(i, { weight: n / 100 });
576
+ x.change(u, { weight: n / 100 });
577
577
  }
578
- const X = /* @__PURE__ */ new WeakMap();
579
- function te(i) {
580
- const d = i.currentTarget;
581
- d.disabled || i.button !== 0 || (i.preventDefault(), d.focus({ preventScroll: !0 }), X.set(d, { pointerId: i.pointerId, x: i.clientX, value: Number(d.value), width: d.clientWidth || 1 }), d.setPointerCapture(i.pointerId), d.dataset.dragging = "true");
578
+ const K = /* @__PURE__ */ new WeakMap();
579
+ function te(u) {
580
+ const d = u.currentTarget;
581
+ d.disabled || u.button !== 0 || (u.preventDefault(), d.focus({ preventScroll: !0 }), K.set(d, { pointerId: u.pointerId, x: u.clientX, value: Number(d.value), width: d.clientWidth || 1 }), d.setPointerCapture(u.pointerId), d.dataset.dragging = "true");
582
582
  }
583
- function H(i, d) {
584
- const n = d.currentTarget, f = X.get(n);
583
+ function H(u, d) {
584
+ const n = d.currentTarget, f = K.get(n);
585
585
  if (!f || f.pointerId !== d.pointerId) return;
586
586
  const le = d.clientX - f.x, we = f.value + le / f.width * 100, ye = Math.max(0, Math.min(100, we)), Ae = Math.round(ye);
587
- U.change(i, { weight: Ae / 100 });
587
+ x.change(u, { weight: Ae / 100 });
588
588
  const pe = (we - ye) / 100 * f.width;
589
589
  pe !== 0 && n.style.setProperty("--upsell-origin", pe > 0 ? "left center" : "right center"), n.style.setProperty("--upsell-stretch", `${1 + 10 * Math.tanh(Math.abs(pe) / 90) / f.width}`);
590
590
  }
591
- function ae(i, d) {
591
+ function ae(u, d) {
592
592
  var n;
593
593
  const f = d.currentTarget;
594
- ((n = X.get(f)) == null ? void 0 : n.pointerId) === d.pointerId && (X.delete(f), delete f.dataset.dragging, d.type === "pointerup" && U.change(i, { weight: Math.round(y(i) * 20) / 20 }), f.style.removeProperty("--upsell-stretch"), f.hasPointerCapture(d.pointerId) && f.releasePointerCapture(d.pointerId));
594
+ ((n = K.get(f)) == null ? void 0 : n.pointerId) === d.pointerId && (K.delete(f), delete f.dataset.dragging, d.type === "pointerup" && x.change(u, { weight: Math.round(y(u) * 20) / 20 }), f.style.removeProperty("--upsell-stretch"), f.hasPointerCapture(d.pointerId) && f.releasePointerCapture(d.pointerId));
595
595
  }
596
- async function Y() {
597
- const i = await U.save();
598
- i && P("saved", i);
596
+ async function Q() {
597
+ const u = await x.save();
598
+ u && P("saved", u);
599
599
  }
600
- function oe(i) {
601
- (x.value || L.value) && (i.preventDefault(), i.returnValue = "");
600
+ function oe(u) {
601
+ (T.value || M.value) && (u.preventDefault(), u.returnValue = "");
602
602
  }
603
- return G(x, (i) => P("dirty-change", i), { immediate: !0 }), G(() => L.value, (i) => P("busy-change", i), { immediate: !0 }), G(() => [r.businessId, S.value], () => {
604
- O.value = "", A.value = /* @__PURE__ */ new Set();
603
+ return Y(T, (u) => P("dirty-change", u), { immediate: !0 }), Y(() => M.value, (u) => P("busy-change", u), { immediate: !0 }), Y(() => [s.businessId, E.value], () => {
604
+ U.value = "", A.value = /* @__PURE__ */ new Set();
605
605
  }), Ce(() => window.addEventListener("beforeunload", oe)), ce(() => {
606
606
  W++;
607
- }), ce(() => window.removeEventListener("beforeunload", oe)), t({ dirty: x, saving: L, discard: U.discard }), (i, d) => (p(), w("section", {
607
+ }), ce(() => window.removeEventListener("beforeunload", oe)), t({ dirty: T, saving: M, discard: x.discard }), (u, d) => (p(), w("section", {
608
608
  class: "fm-upselling",
609
- "aria-label": a.value.title,
610
- "aria-busy": u(V) || u(L)
609
+ "aria-label": l.value.title,
610
+ "aria-busy": i(V) || i(M)
611
611
  }, [
612
612
  g("header", bt, [
613
613
  g("div", null, [
614
614
  !e.loadApplyTargets && e.restaurantName ? (p(), w("p", It, b(e.restaurantName), 1)) : _("", !0),
615
- e.loadApplyTargets ? _("", !0) : (p(), w("p", kt, b(e.restaurantId ? a.value.restaurantOverride : a.value.businessDefault), 1)),
616
- g("h1", null, b(a.value.title), 1)
615
+ e.loadApplyTargets ? _("", !0) : (p(), w("p", kt, b(e.restaurantId ? l.value.restaurantOverride : l.value.businessDefault), 1)),
616
+ g("h1", null, b(l.value.title), 1)
617
617
  ]),
618
618
  g("div", Ct, [
619
- S.value && e.api.reset ? (p(), ne(u(l), {
619
+ E.value && e.api.reset ? (p(), ne(i(r), {
620
620
  key: 0,
621
621
  variant: "secondary",
622
- label: a.value.reset,
623
- disabled: u(L) || !u(z) || u(C) && !u(Z),
624
- onClick: u(U).reset
622
+ label: l.value.reset,
623
+ disabled: i(M) || !i(z) || i(C) && !i(Z),
624
+ onClick: i(x).reset
625
625
  }, null, 8, ["label", "disabled", "onClick"])) : _("", !0),
626
- se(u(l), {
626
+ se(i(r), {
627
627
  variant: "secondary",
628
- label: a.value.discard,
629
- disabled: !u(Z) || u(L) || !u(z),
630
- onClick: u(U).discard
628
+ label: l.value.discard,
629
+ disabled: !i(Z) || i(M) || !i(z),
630
+ onClick: i(x).discard
631
631
  }, null, 8, ["label", "disabled", "onClick"]),
632
- se(u(l), {
633
- label: u(L) ? a.value.saving : e.loadApplyTargets ? a.value.apply : a.value.save,
634
- loading: u(L),
635
- disabled: !u(Z) || u(L) || M.value || T.value || !u(z),
636
- onClick: Y
632
+ se(i(r), {
633
+ label: i(M) ? l.value.saving : e.loadApplyTargets ? l.value.apply : l.value.save,
634
+ loading: i(M),
635
+ disabled: !i(Z) || i(M) || N.value || S.value || !i(z),
636
+ onClick: Q
637
637
  }, null, 8, ["label", "loading", "disabled"])
638
638
  ])
639
639
  ]),
640
- g("p", Tt, b(a.value.hint), 1),
641
- e.loadApplyTargets ? (p(), w("div", xt, [
642
- se(u(k), {
643
- modelValue: S.value,
644
- "onUpdate:modelValue": d[0] || (d[0] = (n) => S.value = n),
645
- label: a.value.editingScope,
646
- items: F.value,
647
- disabled: u(L) || M.value || T.value
640
+ g("p", St, b(l.value.hint), 1),
641
+ e.loadApplyTargets ? (p(), w("div", Tt, [
642
+ se(i(k), {
643
+ modelValue: E.value,
644
+ "onUpdate:modelValue": d[0] || (d[0] = (n) => E.value = n),
645
+ label: l.value.editingScope,
646
+ items: D.value,
647
+ disabled: i(M) || N.value || S.value
648
648
  }, null, 8, ["modelValue", "label", "items", "disabled"]),
649
- g("p", St, b(S.value ? a.value.editingOutletHint : a.value.editingBusinessHint), 1),
650
- T.value ? (p(), w("p", Ut, b(a.value.loadError), 1)) : _("", !0),
651
- T.value ? (p(), ne(u(l), {
649
+ g("p", Et, b(E.value ? l.value.editingOutletHint : l.value.editingBusinessHint), 1),
650
+ S.value ? (p(), w("p", xt, b(l.value.loadError), 1)) : _("", !0),
651
+ S.value ? (p(), ne(i(r), {
652
652
  key: 1,
653
653
  variant: "secondary",
654
- label: a.value.retry,
655
- onClick: E
654
+ label: l.value.retry,
655
+ onClick: O
656
656
  }, null, 8, ["label"])) : _("", !0)
657
657
  ])) : _("", !0),
658
- S.value && u(C) ? (p(), w("p", Pt, b(a.value.inherited), 1)) : _("", !0),
659
- g("div", Et, [
660
- u(K) ? (p(), w("p", Ot, b(u(K) === "load" ? a.value.loadError : a.value.saveError), 1)) : u(h) ? (p(), w("p", At, b(a.value.saved), 1)) : u(Z) ? (p(), w("p", $t, b(a.value.dirty), 1)) : _("", !0)
658
+ E.value && i(C) ? (p(), w("p", Pt, b(l.value.inherited), 1)) : _("", !0),
659
+ g("div", Ot, [
660
+ i(G) ? (p(), w("p", Ut, b(i(G) === "load" ? l.value.loadError : l.value.saveError), 1)) : i(h) ? (p(), w("p", At, b(l.value.saved), 1)) : i(Z) ? (p(), w("p", Rt, b(l.value.dirty), 1)) : _("", !0)
661
661
  ]),
662
- e.businessId ? u(V) ? (p(), w("p", jt, b(a.value.loading), 1)) : u(K) === "load" ? (p(), w("div", Lt, [
663
- se(u(l), {
662
+ e.businessId ? i(V) ? (p(), w("p", jt, b(l.value.loading), 1)) : i(G) === "load" ? (p(), w("div", Mt, [
663
+ se(i(r), {
664
664
  variant: "secondary",
665
- label: a.value.retry,
666
- onClick: u(U).load
665
+ label: l.value.retry,
666
+ onClick: i(x).load
667
667
  }, null, 8, ["label", "onClick"])
668
- ])) : u(z) ? (p(), w("div", Mt, [
668
+ ])) : i(z) ? (p(), w("div", Nt, [
669
669
  g("div", _t, [
670
- g("div", Nt, [
670
+ g("div", Lt, [
671
671
  g("h2", null, [
672
- $e(b(a.value.products) + " ", 1),
673
- g("span", null, b(u(U).rows.value.filter((n) => !n.unavailable).length), 1)
672
+ Re(b(l.value.products) + " ", 1),
673
+ g("span", null, b(i(x).rows.value.filter((n) => !n.unavailable).length), 1)
674
674
  ]),
675
675
  g("div", Wt, [
676
- se(u(I), {
677
- modelValue: O.value,
678
- "onUpdate:modelValue": d[1] || (d[1] = (n) => O.value = n),
679
- label: a.value.search,
680
- placeholder: a.value.search
676
+ se(i(I), {
677
+ modelValue: U.value,
678
+ "onUpdate:modelValue": d[1] || (d[1] = (n) => U.value = n),
679
+ label: l.value.search,
680
+ placeholder: l.value.search
681
681
  }, null, 8, ["modelValue", "label", "placeholder"])
682
682
  ])
683
683
  ]),
684
- u(U).rows.value.some((n) => !n.unavailable) ? v.value.length ? (p(), w("ul", Ft, [
685
- (p(!0), w(ie, null, ue(v.value, (n) => (p(), w("li", {
684
+ i(x).rows.value.some((n) => !n.unavailable) ? v.value.length ? (p(), w("ul", Dt, [
685
+ (p(!0), w(ue, null, ie(v.value, (n) => (p(), w("li", {
686
686
  key: n.productId,
687
687
  class: "upsell-row",
688
688
  "data-product-id": n.productId
@@ -695,33 +695,33 @@ const He = ["aria-label"], qe = { class: "upsell-preview-header" }, ze = { class
695
695
  class: "upsell-photo",
696
696
  loading: "lazy",
697
697
  onError: (f) => A.value.add(n.productId)
698
- }, null, 40, qt)) : (p(), w("span", zt, b(a.value.missingPhoto), 1)),
698
+ }, null, 40, qt)) : (p(), w("span", zt, b(l.value.missingPhoto), 1)),
699
699
  g("div", null, [
700
- g("h3", null, b(n.unavailable ? a.value.unavailable : n.name), 1),
701
- n.unavailable ? (p(), w("p", Jt, b(n.productId), 1)) : (p(), w("p", Qt, b([n.category, n.priceLabel].filter(Boolean).join(" · ")), 1)),
702
- n.unavailable ? (p(), w("p", Yt, b(a.value.unavailableHint), 1)) : _("", !0)
700
+ g("h3", null, b(n.unavailable ? l.value.unavailable : n.name), 1),
701
+ n.unavailable ? (p(), w("p", Xt, b(n.productId), 1)) : (p(), w("p", Jt, b([n.category, n.priceLabel].filter(Boolean).join(" · ")), 1)),
702
+ n.unavailable ? (p(), w("p", Qt, b(l.value.unavailableHint), 1)) : _("", !0)
703
703
  ])
704
704
  ]),
705
- g("div", Xt, [
706
- se(u(m), {
705
+ g("div", Kt, [
706
+ se(i(m), {
707
707
  "model-value": o(n.productId),
708
- disabled: u(L),
709
- "onUpdate:modelValue": (f) => u(U).change(n.productId, { adjustWeight: f })
708
+ disabled: i(M),
709
+ "onUpdate:modelValue": (f) => i(x).change(n.productId, { adjustWeight: f })
710
710
  }, {
711
- label: Te(() => [
712
- g("span", Gt, b(a.value.adjust) + ": " + b(n.name), 1)
711
+ label: Se(() => [
712
+ g("span", Yt, b(l.value.adjust) + ": " + b(n.name), 1)
713
713
  ]),
714
714
  _: 2
715
715
  }, 1032, ["model-value", "disabled", "onUpdate:modelValue"])
716
716
  ]),
717
717
  g("div", {
718
- class: xe(["upsell-weight", { "upsell-weight-auto": !o(n.productId) }])
718
+ class: Te(["upsell-weight", { "upsell-weight-auto": !o(n.productId) }])
719
719
  }, [
720
- g("div", Kt, [
721
- o(n.productId) ? (p(), w("span", Zt, b(R(n.productId)), 1)) : _("", !0),
720
+ g("div", Gt, [
721
+ o(n.productId) ? (p(), w("span", Zt, b($(n.productId)), 1)) : _("", !0),
722
722
  g("output", {
723
- "aria-label": `${a.value.weight}: ${n.name}`
724
- }, b(o(n.productId) ? `${Math.round(y(n.productId) * 100)}%` : a.value.automatic), 9, ea)
723
+ "aria-label": `${l.value.weight}: ${n.name}`
724
+ }, b(o(n.productId) ? `${Math.round(y(n.productId) * 100)}%` : l.value.automatic), 9, ea)
725
725
  ]),
726
726
  g("input", {
727
727
  type: "range",
@@ -729,11 +729,11 @@ const He = ["aria-label"], qe = { class: "upsell-preview-header" }, ze = { class
729
729
  max: "100",
730
730
  step: "1",
731
731
  value: Math.round(y(n.productId) * 100),
732
- "aria-label": `${a.value.weight}: ${n.name}`,
733
- "aria-valuetext": `${Math.round(y(n.productId) * 100)}% — ${R(n.productId)}`,
734
- disabled: !o(n.productId) || u(L),
732
+ "aria-label": `${l.value.weight}: ${n.name}`,
733
+ "aria-valuetext": `${Math.round(y(n.productId) * 100)}% — ${$(n.productId)}`,
734
+ disabled: !o(n.productId) || i(M),
735
735
  "data-boosted": o(n.productId) && y(n.productId) >= 0.8,
736
- style: Re({ "--upsell-fill": `${o(n.productId) ? y(n.productId) * 100 : 0}%` }),
736
+ style: $e({ "--upsell-fill": `${o(n.productId) ? y(n.productId) * 100 : 0}%` }),
737
737
  onInput: (f) => ee(n.productId, f),
738
738
  onPointerdown: te,
739
739
  onPointermove: (f) => H(n.productId, f),
@@ -743,18 +743,18 @@ const He = ["aria-label"], qe = { class: "upsell-preview-header" }, ze = { class
743
743
  }, null, 44, ta)
744
744
  ], 2)
745
745
  ], 8, Vt))), 128))
746
- ])) : (p(), w("p", Dt, b(a.value.noMatches), 1)) : (p(), w("p", Bt, b(a.value.empty), 1))
746
+ ])) : (p(), w("p", Ft, b(l.value.noMatches), 1)) : (p(), w("p", Bt, b(l.value.empty), 1))
747
747
  ]),
748
748
  (p(), ne(yt, {
749
- host: Q,
750
- key: JSON.stringify([e.businessId, S.value]),
751
- products: u(U).rows.value.filter((n) => !n.unavailable),
752
- "saved-items": u(U).baseline.value,
753
- "draft-items": u(U).items.value,
754
- text: a.value,
749
+ host: J,
750
+ key: JSON.stringify([e.businessId, E.value]),
751
+ products: i(x).rows.value.filter((n) => !n.unavailable),
752
+ "saved-items": i(x).baseline.value,
753
+ "draft-items": i(x).items.value,
754
+ text: l.value,
755
755
  touchpoints: e.previewTouchpoints
756
756
  }, null, 8, ["host", "products", "saved-items", "draft-items", "text", "touchpoints"]))
757
- ])) : _("", !0) : (p(), w("p", Rt, b(a.value.chooseRestaurant), 1))
757
+ ])) : _("", !0) : (p(), w("p", $t, b(l.value.chooseRestaurant), 1))
758
758
  ], 8, ft));
759
759
  }
760
760
  });
@@ -764,40 +764,40 @@ function ra(e) {
764
764
  throw new Error("Use HTTPS for report-service, or HTTP on localhost.");
765
765
  if (t.username || t.password || t.search || t.hash)
766
766
  throw new Error("Report-service URL must not contain credentials, query parameters or a fragment.");
767
- async function s(l, m, I = m === void 0 ? "GET" : "PUT") {
767
+ async function a(r, m, I = m === void 0 ? "GET" : "PUT") {
768
768
  const k = await e.getToken();
769
769
  if (!k) throw new Error("Sign in to Portal to load upselling settings.");
770
- const r = await fetch(`${t.href.replace(/\/$/, "")}${l}`, {
770
+ const s = await fetch(`${t.href.replace(/\/$/, "")}${r}`, {
771
771
  method: I,
772
772
  headers: { Authorization: `Bearer ${k}`, ...m === void 0 ? {} : { "Content-Type": "application/json" } },
773
773
  body: m === void 0 ? void 0 : JSON.stringify(m),
774
774
  cache: "no-store",
775
775
  redirect: "error"
776
776
  });
777
- if (!r.ok) throw new Error(`Unable to ${m === void 0 ? "load" : "save"} upselling settings (${r.status}).`);
778
- return { data: await r.json() };
777
+ if (!s.ok) throw new Error(`Unable to ${m === void 0 ? "load" : "save"} upselling settings (${s.status}).`);
778
+ return { data: await s.json() };
779
779
  }
780
- return la({ get: (l) => s(l), put: (l, m) => s(l, m), delete: (l) => s(l, void 0, "DELETE") });
780
+ return la({ get: (r) => a(r), put: (r, m) => a(r, m), delete: (r) => a(r, void 0, "DELETE") });
781
781
  }
782
782
  function la(e) {
783
- const t = ({ businessId: s, restaurantId: l }) => `/${encodeURIComponent(s)}${l ? `/${encodeURIComponent(l)}` : ""}/upsell-settings`;
783
+ const t = ({ businessId: a, restaurantId: r }) => `/${encodeURIComponent(a)}${r ? `/${encodeURIComponent(r)}` : ""}/upsell-settings`;
784
784
  return {
785
- async get(s) {
786
- return (await e.get(t(s))).data;
785
+ async get(a) {
786
+ return (await e.get(t(a))).data;
787
787
  },
788
- async save(s, l) {
789
- const m = { items: l.map(({ productId: I, adjustWeight: k, weight: r }) => ({ productId: I, adjustWeight: k, weight: r })) };
790
- return (await e.put(t(s), m)).data;
788
+ async save(a, r) {
789
+ const m = { items: r.map(({ productId: I, adjustWeight: k, weight: s }) => ({ productId: I, adjustWeight: k, weight: s })) };
790
+ return (await e.put(t(a), m)).data;
791
791
  },
792
- ...e.delete ? { async reset(s) {
793
- if (!s.restaurantId) throw new Error("Only restaurant overrides can be reset");
794
- return (await e.delete(t(s))).data;
792
+ ...e.delete ? { async reset(a) {
793
+ if (!a.restaurantId) throw new Error("Only restaurant overrides can be reset");
794
+ return (await e.delete(t(a))).data;
795
795
  } } : {}
796
796
  };
797
797
  }
798
798
  function sa(e) {
799
- const t = new URL(e), s = ["localhost", "127.0.0.1", "[::1]"].includes(t.hostname);
800
- if (t.protocol !== "https:" && !(t.protocol === "http:" && s))
799
+ const t = new URL(e), a = ["localhost", "127.0.0.1", "[::1]"].includes(t.hostname);
800
+ if (t.protocol !== "https:" && !(t.protocol === "http:" && a))
801
801
  throw new Error("Use HTTPS for recommendations, or HTTP on localhost.");
802
802
  if (t.username || t.password || t.search || t.hash)
803
803
  throw new Error("Recommendation URL must not contain credentials, query parameters or a fragment.");
@@ -805,34 +805,44 @@ function sa(e) {
805
805
  }
806
806
  function na(e, t) {
807
807
  if (!e || typeof e != "object") return !1;
808
- const s = e;
809
- if (s.restaurant_id !== t.restaurantId || t.mode === "current" && !["restaurant", "business", "none"].includes(s.source ?? "")) return !1;
810
- const l = s.product_id, m = s.score;
811
- return Array.isArray(l) && Array.isArray(m) && l.length === m.length && l.every((I) => typeof I == "string" && I.length > 0) && m.every((I) => typeof I == "number" && Number.isFinite(I)) && new Set(l).size === l.length;
808
+ const a = e;
809
+ if (a.restaurant_id !== t.restaurantId || t.mode === "current" && !["restaurant", "business", "none"].includes(a.source ?? "")) return !1;
810
+ const r = a.product_id, m = a.score;
811
+ return Array.isArray(r) && Array.isArray(m) && r.length === m.length && r.every((I) => typeof I == "string" && I.length > 0) && m.every((I) => typeof I == "number" && Number.isFinite(I)) && new Set(r).size === r.length;
812
+ }
813
+ function oa(e, t) {
814
+ if (!e || typeof e != "object") return !1;
815
+ const a = e, r = t.recommendationType === "cart" ? "cart recommendation" : "top sale";
816
+ return a.statusCode === 404 && a.error === "Not Found" && a.message === `No ${r} data found for restaurantId: ${t.restaurantId}`;
812
817
  }
813
- function oa(e) {
818
+ function ua(e) {
814
819
  const t = sa(e.baseUrl);
815
- return async (s) => {
816
- const l = await e.getToken();
817
- if (!l) throw new Error("Authentication required for preview");
818
- const m = e.fetch ?? fetch, I = s.mode ?? "preview", k = await m(`${t}/recommendation/${encodeURIComponent(s.businessId)}/${I}`, {
820
+ return async (a) => {
821
+ const r = await e.getToken();
822
+ if (!r) throw new Error("Authentication required for preview");
823
+ const m = e.fetch ?? fetch, I = a.mode ?? "preview", k = await m(`${t}/recommendation/${encodeURIComponent(a.businessId)}/${I}`, {
819
824
  method: "POST",
820
825
  cache: "no-store",
821
826
  redirect: "error",
822
827
  signal: AbortSignal.timeout(15e3),
823
- headers: { "Content-Type": "application/json", Authorization: `Bearer ${l}` },
828
+ headers: { "Content-Type": "application/json", Authorization: `Bearer ${r}` },
824
829
  body: JSON.stringify({
825
- restaurant_id: s.restaurantId,
826
- type: s.recommendationType === "cart" ? "cart" : "whats_hot",
827
- ...s.recommendationType === "cart" ? { cart_item: [...new Set(s.cart.map((a) => a.productId))] } : {},
828
- ...I === "preview" ? { items: s.items.map(({ productId: a, adjustWeight: O, weight: A }) => ({ productId: a, adjustWeight: O, weight: A })) } : {}
830
+ restaurant_id: a.restaurantId,
831
+ type: a.recommendationType === "cart" ? "cart" : "whats_hot",
832
+ ...a.recommendationType === "cart" ? { cart_item: [...new Set(a.cart.map((l) => l.productId))] } : {},
833
+ ...I === "preview" ? { items: a.items.map(({ productId: l, adjustWeight: U, weight: A }) => ({ productId: l, adjustWeight: U, weight: A })) } : {}
829
834
  })
830
835
  });
831
- if (!k.ok) throw new Error(`Recommendation preview failed (${k.status})`);
832
- const r = await k.json();
833
- if (!na(r, s)) throw new Error("Preview response is not supported");
834
- const P = new Map((s.catalog ?? await e.loadProducts({ businessId: s.businessId, restaurantId: s.restaurantId })).map((a) => [a.productId, a]));
835
- return { products: ve(r.product_id.flatMap((a) => P.has(a) ? [P.get(a)] : []), s.limit), source: "unknown" };
836
+ if (!k.ok) {
837
+ if (k.status === 404 && oa(await k.json().catch(() => {
838
+ }), a))
839
+ return { products: [], source: "no_data" };
840
+ throw new Error(`Recommendation preview failed (${k.status})`);
841
+ }
842
+ const s = await k.json();
843
+ if (!na(s, a)) throw new Error("Preview response is not supported");
844
+ const P = new Map((a.catalog ?? await e.loadProducts({ businessId: a.businessId, restaurantId: a.restaurantId })).map((l) => [l.productId, l]));
845
+ return { products: ve(s.product_id.flatMap((l) => P.has(l) ? [P.get(l)] : []), a.limit), source: "unknown" };
836
846
  };
837
847
  }
838
848
  const be = c.object({
@@ -889,49 +899,49 @@ function ge() {
889
899
  function ia() {
890
900
  return ra({
891
901
  baseUrl: "https://query-engine.feedmeapidev.com",
892
- getToken: () => (ge(), Ue.getIdToken() ?? "")
902
+ getToken: () => (ge(), xe.getIdToken() ?? "")
893
903
  });
894
904
  }
895
- function ua(e) {
896
- const t = new URL(e), s = t.protocol === "http:" && ["127.0.0.1", "localhost"].includes(t.hostname), l = t.origin === "https://public-query-engine.feedmeapidev.com";
897
- if (!s && !l || t.username || t.password || t.search || t.hash || t.pathname !== "/")
905
+ function da(e) {
906
+ const t = new URL(e), a = t.protocol === "http:" && ["127.0.0.1", "localhost"].includes(t.hostname), r = t.origin === "https://public-query-engine.feedmeapidev.com";
907
+ if (!a && !r || t.username || t.password || t.search || t.hash || t.pathname !== "/")
898
908
  throw new Error(
899
909
  "Use a local or MY dev recommendation backend for preview."
900
910
  );
901
- return oa({
911
+ return ua({
902
912
  baseUrl: t.origin,
903
- getToken: () => (ge(), Ue.getIdToken() ?? ""),
904
- loadProducts: Ee
913
+ getToken: () => (ge(), xe.getIdToken() ?? ""),
914
+ loadProducts: Oe
905
915
  });
906
916
  }
907
917
  function Ie(e, t) {
908
918
  var I, k;
909
- const s = Pe.parse(e), l = s.restaurants || s.menuMode === "restaurantLevel" ? (k = (I = s.restaurants) == null ? void 0 : I.find((r) => r.restaurantId === t)) == null ? void 0 : k.modules : s.modules;
910
- if (!l) return [];
919
+ const a = Pe.parse(e), r = a.restaurants || a.menuMode === "restaurantLevel" ? (k = (I = a.restaurants) == null ? void 0 : I.find((s) => s.restaurantId === t)) == null ? void 0 : k.modules : a.modules;
920
+ if (!r) return [];
911
921
  const m = new Map(
912
- l.category.map((r) => [r._id, r.name])
922
+ r.category.map((s) => [s._id, s.name])
913
923
  );
914
- return l.item.map((r) => ({
915
- productId: r._id,
916
- name: r.name,
917
- ...r.unit != null ? { unit: r.unit } : {},
918
- ...r.perXUnit != null ? { perXUnit: r.perXUnit } : {},
919
- ...r.isOutOfStocked != null ? { isOutOfStocked: r.isOutOfStocked } : {},
920
- imageUrl: r.thumbnail ?? void 0,
921
- category: m.get(r.category ?? ""),
922
- priceLabel: r.price ? Ne(r.price) : void 0
924
+ return r.item.map((s) => ({
925
+ productId: s._id,
926
+ name: s.name,
927
+ ...s.unit != null ? { unit: s.unit } : {},
928
+ ...s.perXUnit != null ? { perXUnit: s.perXUnit } : {},
929
+ ...s.isOutOfStocked != null ? { isOutOfStocked: s.isOutOfStocked } : {},
930
+ imageUrl: s.thumbnail ?? void 0,
931
+ category: m.get(s.category ?? ""),
932
+ priceLabel: s.price ? Le(s.price) : void 0
923
933
  }));
924
934
  }
925
- const Ee = async ({
935
+ const Oe = async ({
926
936
  businessId: e,
927
937
  restaurantId: t
928
938
  }) => {
929
- const l = (await Oe(e)).find((m) => m.scope.restaurantId === t);
930
- if (!l)
939
+ const r = (await Ue(e)).find((m) => m.scope.restaurantId === t);
940
+ if (!r)
931
941
  throw new Error("This outlet is not available in the current business.");
932
- if (l.unavailableReason) throw new Error(l.unavailableReason);
933
- return l.products;
934
- }, da = c.array(
942
+ if (r.unavailableReason) throw new Error(r.unavailableReason);
943
+ return r.products;
944
+ }, ca = c.array(
935
945
  c.object({
936
946
  _id: c.string(),
937
947
  businessId: c.string(),
@@ -941,14 +951,14 @@ const Ee = async ({
941
951
  takeaway: c.object({ catalogId: c.string().nullish() }).passthrough().nullish(),
942
952
  pickup: c.object({ catalogId: c.string().nullish() }).passthrough().nullish()
943
953
  }).passthrough()
944
- ), Oe = async (e) => {
945
- var P, a, O, A, S, N, M;
954
+ ), Ue = async (e) => {
955
+ var P, l, U, A, E, L, N;
946
956
  ge();
947
- const t = he(), s = da.parse(t.restaurants.value).filter((T) => T.businessId === e), l = c.object({ menuVersion: c.enum(["v3", "v4"]).nullish() }).parse(t.currentBusiness.value).menuVersion, m = await _e(
957
+ const t = he(), a = ca.parse(t.restaurants.value).filter((S) => S.businessId === e), r = c.object({ menuVersion: c.enum(["v3", "v4"]).nullish() }).parse(t.currentBusiness.value).menuVersion, m = await _e(
948
958
  `menu-v4/businesses/${encodeURIComponent(
949
959
  e
950
960
  )}/menu-v4/effective-menu?modules=item,category,catalog`
951
- ).get(""), I = Pe.parse(m.data), k = I.menuMode === "restaurantLevel", r = [
961
+ ).get(""), I = Pe.parse(m.data), k = I.menuMode === "restaurantLevel", s = [
952
962
  {
953
963
  name: "Business default",
954
964
  scope: { businessId: e },
@@ -958,75 +968,75 @@ const Ee = async ({
958
968
  } : {}
959
969
  }
960
970
  ];
961
- for (const T of s) {
962
- const W = k ? (a = (P = I.restaurants) == null ? void 0 : P.find((D) => D.restaurantId === T._id)) == null ? void 0 : a.modules : I.modules, J = /* @__PURE__ */ new Set();
971
+ for (const S of a) {
972
+ const W = k ? (l = (P = I.restaurants) == null ? void 0 : P.find((F) => F.restaurantId === S._id)) == null ? void 0 : l.modules : I.modules, X = /* @__PURE__ */ new Set();
963
973
  let q;
964
974
  if (!W) q = "No menu is available for this outlet.";
965
- else if (l !== "v3" && l !== "v4")
975
+ else if (r !== "v3" && r !== "v4")
966
976
  q = "Menu version could not be verified. Nothing will be applied.";
967
977
  else {
968
- const D = [
969
- T.catalogId ?? null,
970
- ...T.additionalCatalogs ?? [],
971
- (O = T.takeaway) == null ? void 0 : O.catalogId,
972
- (A = T.pickup) == null ? void 0 : A.catalogId
973
- ].filter((F) => F !== void 0);
974
- for (const F of D) {
975
- const Q = F ? W.catalog.find((U) => U._id === F) : void 0;
976
- if (F && !Q) {
978
+ const F = [
979
+ S.catalogId ?? null,
980
+ ...S.additionalCatalogs ?? [],
981
+ (U = S.takeaway) == null ? void 0 : U.catalogId,
982
+ (A = S.pickup) == null ? void 0 : A.catalogId
983
+ ].filter((D) => D !== void 0);
984
+ for (const D of F) {
985
+ const J = D ? W.catalog.find((x) => x._id === D) : void 0;
986
+ if (D && !J) {
977
987
  q = "An assigned catalog is unavailable. Reload this outlet’s menu before applying.";
978
988
  break;
979
989
  }
980
- for (const U of W.item) {
981
- const x = (N = (S = Q == null ? void 0 : Q.override.items) == null ? void 0 : S[U._id]) == null ? void 0 : N.find(
990
+ for (const x of W.item) {
991
+ const T = (L = (E = J == null ? void 0 : J.override.items) == null ? void 0 : E[x._id]) == null ? void 0 : L.find(
982
992
  (j) => !j.combinationKey
983
993
  );
984
- ((x == null ? void 0 : x.orderFrom) ?? U.orderFrom) !== "NONE" && (l === "v4" || (x == null ? void 0 : x.category) !== "") && J.add(U._id);
994
+ ((T == null ? void 0 : T.orderFrom) ?? x.orderFrom) !== "NONE" && (r === "v4" || (T == null ? void 0 : T.category) !== "") && X.add(x._id);
985
995
  }
986
996
  }
987
997
  }
988
- r.push({
989
- name: ((M = T.profile) == null ? void 0 : M.name) ?? T._id,
990
- scope: { businessId: e, restaurantId: T._id },
991
- products: Ie(m.data, T._id).filter(
992
- (D) => J.has(D.productId)
998
+ s.push({
999
+ name: ((N = S.profile) == null ? void 0 : N.name) ?? S._id,
1000
+ scope: { businessId: e, restaurantId: S._id },
1001
+ products: Ie(m.data, S._id).filter(
1002
+ (F) => X.has(F.productId)
993
1003
  ),
994
1004
  unavailableReason: q
995
1005
  });
996
1006
  }
997
- return r;
1007
+ return s;
998
1008
  };
999
- var ca = { mode: "development", appMode: "mf" };
1000
- const fa = /* @__PURE__ */ me({
1009
+ var pa = { mode: "development", appMode: "mf" };
1010
+ const ba = /* @__PURE__ */ me({
1001
1011
  __name: "Upselling",
1002
1012
  setup(e) {
1003
- const t = he(), s = ia(), l = ua(
1013
+ const t = he(), a = ia(), r = da(
1004
1014
  "https://public-query-engine.feedmeapidev.com"
1005
- ), m = $(!1), I = $(!1), k = B(
1006
- () => ca.mode === "development" && t.namespace.value === "dev" && t.currentCountry.value === "MY"
1007
- ), r = B(
1015
+ ), m = R(!1), I = R(!1), k = B(
1016
+ () => pa.mode === "development" && t.namespace.value === "dev" && t.currentCountry.value === "MY"
1017
+ ), s = B(
1008
1018
  () => {
1009
1019
  var P;
1010
1020
  return `${t.namespace.value}:${t.currentCountry.value}:${(P = t.sessionUser.value) == null ? void 0 : P.id}`;
1011
1021
  }
1012
1022
  );
1013
- return Me(
1023
+ return Ne(
1014
1024
  () => !I.value && (!m.value || window.confirm("Discard unsaved changes?"))
1015
- ), (P, a) => {
1016
- var O;
1017
- return k.value ? (p(), ne(u(aa), {
1018
- key: r.value,
1019
- "business-id": ((O = u(t).currentBusiness.value) == null ? void 0 : O._id) ?? "",
1020
- api: u(s),
1021
- "load-products": u(Ee),
1022
- "load-apply-targets": u(Oe),
1023
- "load-preview": u(l),
1024
- onDirtyChange: a[0] || (a[0] = (A) => m.value = A),
1025
- onBusyChange: a[1] || (a[1] = (A) => I.value = A)
1025
+ ), (P, l) => {
1026
+ var U;
1027
+ return k.value ? (p(), ne(i(aa), {
1028
+ key: s.value,
1029
+ "business-id": ((U = i(t).currentBusiness.value) == null ? void 0 : U._id) ?? "",
1030
+ api: i(a),
1031
+ "load-products": i(Oe),
1032
+ "load-apply-targets": i(Ue),
1033
+ "load-preview": i(r),
1034
+ onDirtyChange: l[0] || (l[0] = (A) => m.value = A),
1035
+ onBusyChange: l[1] || (l[1] = (A) => I.value = A)
1026
1036
  }, null, 8, ["business-id", "api", "load-products", "load-apply-targets", "load-preview"])) : _("", !0);
1027
1037
  };
1028
1038
  }
1029
1039
  });
1030
1040
  export {
1031
- fa as default
1041
+ ba as default
1032
1042
  };