@feedmepos/mf-menu 0.32.62 → 0.32.63-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-CE4fZP2_.js → App-DhfTGlgM.js} +467 -462
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-PpYjjdOP.js → ApplyProduct.vue_vue_type_script_setup_true_lang-C5-8qdJK.js} +3 -3
- package/dist/{ApplyProductDialog.vue_vue_type_script_setup_true_lang-C_JKiJRD.js → ApplyProductDialog.vue_vue_type_script_setup_true_lang-CXm-0H18.js} +8 -8
- package/dist/{Catalog-C2MyXkps.js → Catalog-WuZJfM6l.js} +78 -78
- package/dist/{Category-B7Uxbyug.js → Category-BeIo7XWY.js} +20 -20
- package/dist/{Category-BoV0MYQp.js → Category-D-cQQCPS.js} +19 -19
- package/dist/{CookingGuide-Bdyj8XMv.js → CookingGuide-B-yvD9ZA.js} +88 -88
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-EDbgLHTU.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-2_yzXoa4.js} +1 -1
- package/dist/{Group-BuFbi0Z-.js → Group-13i5igrS.js} +5 -5
- package/dist/{Group-DYpxc5ui.js → Group-CY8lUzQG.js} +1 -1
- package/dist/{Group.vue_vue_type_script_setup_true_lang-B5Uw2Rzm.js → Group.vue_vue_type_script_setup_true_lang-DZhxy0tb.js} +95 -94
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-COYg8e7h.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CWqv-oUd.js} +13 -13
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-YY25YW4B.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-DTs4Vpdi.js} +219 -220
- package/dist/{Ingredient-Ddw06I0B.js → Ingredient-vrUOW6gk.js} +49 -49
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-CsWdL5Lz.js → InventoryBinding.vue_vue_type_script_setup_true_lang-xcVjRjqD.js} +2 -2
- package/dist/{LinkProductSideSheet-COAMZqOM.js → LinkProductSideSheet-DMbJG6wf.js} +8 -8
- package/dist/{MenuSetting--G1_lGoV.js → MenuSetting-Di2xwm00.js} +10 -10
- package/dist/{OrderPacing-DnvLJh5M.js → OrderPacing-CCe-IcGO.js} +28 -28
- package/dist/{PrintRoute-CP-3JGP3.js → PrintRoute-CcfObcHY.js} +27 -27
- package/dist/{Product-D-q15-Qw.js → Product-ChUVnMgG.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-BaOg60Q6.js → Product.vue_vue_type_script_setup_true_lang-C9Qp50hL.js} +153 -152
- package/dist/{ProductInternalTools-wYn0bzml.js → ProductInternalTools-D9HXhgo5.js} +80 -79
- package/dist/{Products-CxEsB-7l.js → Products-Bly2ktEC.js} +75 -74
- package/dist/{Publish-BCljLztW.js → Publish-C8ubb8Qf.js} +113 -113
- package/dist/{Recipe-DgfobgnQ.js → Recipe-BpMRLsyO.js} +32 -32
- package/dist/{RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-BgDVFKRI.js → RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-BD5OCDRn.js} +1 -1
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-DCbrAMxd.js → RuleView.vue_vue_type_script_setup_true_lang-Ba3djmX1.js} +474 -473
- package/dist/{Scheduler-C-LJs7Gl.js → Scheduler-CiB4b2Fn.js} +9 -9
- package/dist/{ServingSequence-BoaDRfsc.js → ServingSequence-BlcyW-dv.js} +18 -18
- package/dist/{Setting-BfFqBD9u.js → Setting-DqkL6YYU.js} +31 -31
- package/dist/{Subcategory-BsnC9ZSS.js → Subcategory-B4Jg_wtT.js} +43 -43
- package/dist/{Takeaway-PilRifJP.js → Takeaway-5G3f7jWT.js} +1 -1
- package/dist/{Takeaway-dSEAc70g.js → Takeaway-5rFPYYNA.js} +16 -16
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-CgioM0sV.js → Takeaway.vue_vue_type_script_setup_true_lang-CVsOhg_E.js} +23 -23
- package/dist/{TranslationFieldSection.vue_vue_type_script_setup_true_lang-CHf3g1ia.js → TranslationFieldSection.vue_vue_type_script_setup_true_lang-CPqxA6JD.js} +1 -1
- package/dist/{TranslationSideSheet.vue_vue_type_script_setup_true_lang-A43XxqyC.js → TranslationSideSheet.vue_vue_type_script_setup_true_lang-yrNuTD-3.js} +8 -9
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-T71R68sq.js +5836 -0
- package/dist/{Unit-DW1dFJas.js → Unit-CAkdmQLg.js} +2 -2
- package/dist/{Variant-CzLzrt2N.js → Variant-BbLQqbAK.js} +13 -13
- package/dist/{_id_-qfASfKMD.js → _id_-Dzacr40I.js} +13 -13
- package/dist/{app-BB33yKM6.js → app-4yWs09Fr.js} +495 -495
- package/dist/{app-CJnEQz-U.js → app-Deov1985.js} +3 -3
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/api/media.d.ts +161 -0
- package/dist/apps/mf-menu/src/app.d.ts +340 -0
- package/dist/apps/mf-menu/src/components/feature/CategoryManager/CategoriesSelector.vue.d.ts +1 -1
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/productImages.d.ts +150 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/image/CustomDimensionDialog.vue.d.ts +17 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/image/ImageUploadDialog.vue.d.ts +16 -1
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/image/ManageImageDrawer.vue.d.ts +42 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/image/ProductImageField.vue.d.ts +75 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/image/RegenerateImageDialog.vue.d.ts +17 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/item/ProductDetail.vue.d.ts +3 -6
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/menuV2.d.ts +1 -1
- package/dist/apps/mf-menu/src/composable/remyImageTarget.d.ts +5 -0
- package/dist/apps/mf-menu/src/helper/menu.d.ts +14 -1
- package/dist/apps/mf-menu/src/stores/menu.d.ts +1 -0
- package/dist/apps/mf-menu/src/types/rule.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Catalog/Edit/AddProductPopup/Form.vue.d.ts +3 -2
- package/dist/apps/mf-menu/src/views/Catalog/Edit/AddProductPopup/ProductDetail.vue.d.ts +8 -8
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-VaVE9Pyh.js → linked-status-B2WLhKkV.js} +3 -3
- package/dist/assets/{menu-export-DD9Zt6XH.js → menu-export-Dcw5a_dN.js} +3 -3
- package/dist/assets/{override-menu-DZCgrhuF.js → override-menu-cBe2aMY6.js} +3 -3
- package/dist/assets/{validate-menu-BFsQlikL.js → validate-menu-BM-5GK85.js} +2 -2
- package/dist/{catalog-Cvn1ZMGp.js → catalog-DKygS2Cs.js} +6 -6
- package/dist/{catalogSetting-D2bOCGW7.js → catalogSetting-Bn2TplvM.js} +1 -1
- package/dist/currency-DXgNHtK8.js +7 -0
- package/dist/dayjs.min-DpX65tgj.js +7 -0
- package/dist/discardConfirm-DZwzKO-Q.js +3704 -0
- package/dist/{index-B2fxLO4K.js → index-B48KLyqg.js} +61 -61
- package/dist/{index-CizrxT_e.js → index-BEocaqRK.js} +30 -30
- package/dist/index-K-MBqJJo.js +222 -0
- package/dist/{index.vue_vue_type_script_setup_true_lang-gaRM4vfS.js → index.vue_vue_type_script_setup_true_lang-Nl505vPi.js} +44918 -51563
- package/dist/item-Da3ArD-G.js +13213 -0
- package/dist/{jszip.min-BXLegUsz.js → jszip.min-Cc2eR4Cq.js} +119 -119
- package/dist/linkProducts-GNuUxFEE.js +331 -0
- package/dist/{memberPricing-CizI1rUM.js → memberPricing-T-jr7tn1.js} +1 -1
- package/dist/{menu-BCed1YCE.js → menu-DSDRAil-.js} +1 -1
- package/dist/{menuV2-Bo9AHrdr.js → menuV2-fTlJdjxi.js} +162 -160
- package/dist/mf-menu.css +1 -1
- package/dist/{order_pacing-BkfQeNeC.js → order_pacing-Dgo1fySS.js} +17 -17
- package/dist/packages/shared/src/helpers/agentCode.d.ts +9 -0
- package/dist/{priceTier-rjuK-b6U.js → priceTier-aT_gIfrN.js} +3 -3
- package/dist/{rules-DHX_hK6G.js → rules-Cx2hkV20.js} +8 -8
- package/dist/{scheduler-BsfPbtM2.js → scheduler-Bd-q7yF8.js} +62 -62
- package/dist/{toExcel-DJHljg_L.js → toExcel-qfjR83qT.js} +2 -2
- package/dist/{unit-BxTWR1dZ.js → unit-n1T9grbM.js} +64 -64
- package/package.json +3 -3
- package/dist/Thumbnail.vue_vue_type_script_setup_true_lang-DGqao47l.js +0 -399
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DY1umres.js +0 -6058
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/thumbnailUpload.d.ts +0 -6
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/image/ImageUploadForm.vue.d.ts +0 -38
- package/dist/currency-DQDsuXB5.js +0 -7
- package/dist/dayjs.min-CzUkrXIR.js +0 -7
- package/dist/discardConfirm-BHni0LNu.js +0 -28
- package/dist/index-CisutoS9.js +0 -156
- package/dist/item-DOHVD6CN.js +0 -9098
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import { defineComponent as Z, ref as v, computed as $, resolveComponent as
|
|
2
|
-
import { J as
|
|
3
|
-
import {
|
|
4
|
-
import { useI18n as
|
|
5
|
-
import { FmButtonVariant as z, useSnackbar as V, useDialog as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { a as
|
|
9
|
-
import {
|
|
1
|
+
import { defineComponent as Z, ref as v, computed as $, resolveComponent as q, createElementBlock as c, openBlock as r, createElementVNode as s, createVNode as I, unref as h, createCommentVNode as T, normalizeClass as E, toDisplayString as U, createStaticVNode as B, Fragment as P, renderList as R, createBlock as oe, withCtx as A } from "vue";
|
|
2
|
+
import { J as O, F as ne } from "./jszip.min-Cc2eR4Cq.js";
|
|
3
|
+
import { l as D } from "./discardConfirm-DZwzKO-Q.js";
|
|
4
|
+
import { useI18n as le } from "@feedmepos/mf-common";
|
|
5
|
+
import { FmButtonVariant as z, useSnackbar as V, useDialog as ie, FmButtonColorThemeVariant as M } from "@feedmepos/ui-library";
|
|
6
|
+
import { b as re, u as ce, p as de, q as me } from "./index.vue_vue_type_script_setup_true_lang-Nl505vPi.js";
|
|
7
|
+
import { _ as ue } from "./PageLayout.vue_vue_type_script_setup_true_lang-BVmHMvKD.js";
|
|
8
|
+
import { u as pe, a as ge } from "./menu-DSDRAil-.js";
|
|
9
|
+
import { a as fe } from "./Product.vue_vue_type_script_setup_true_lang-C9Qp50hL.js";
|
|
10
|
+
import { aj as he, ak as ye, al as be, am as ve, an as _e } from "./item-Da3ArD-G.js";
|
|
10
11
|
const we = { class: "h-full flex flex-col" }, xe = { class: "flex items-center justify-between p-16 border-b border-gray-200" }, Ie = { class: "flex gap-8" }, ke = { class: "border-b border-gray-200" }, Ce = { class: "flex" }, Ue = { class: "flex-1 overflow-hidden" }, je = {
|
|
11
12
|
key: 0,
|
|
12
13
|
class: "h-full flex flex-col"
|
|
13
14
|
}, Fe = {
|
|
14
15
|
key: 0,
|
|
15
16
|
class: "flex-1 flex items-center justify-center"
|
|
16
|
-
},
|
|
17
|
+
}, Se = {
|
|
17
18
|
key: 1,
|
|
18
19
|
class: "flex-1 overflow-y-auto p-16"
|
|
19
|
-
},
|
|
20
|
+
}, Me = { class: "space-y-12" }, $e = { class: "fm-typo-en-body-sm font-medium" }, ze = { class: "flex" }, Pe = { class: "w-64 h-64 bg-gray-100 rounded-md overflow-hidden flex items-center justify-center" }, Le = ["src", "alt"], Ne = {
|
|
20
21
|
key: 1,
|
|
21
22
|
class: "text-gray-400 text-xs"
|
|
22
|
-
}, Te = { class: "flex" },
|
|
23
|
+
}, Te = { class: "flex" }, Ee = { class: "w-64 h-64 bg-gray-100 rounded-md overflow-hidden" }, Be = ["src", "alt"], Re = {
|
|
23
24
|
key: 1,
|
|
24
25
|
class: "h-full flex flex-col"
|
|
25
|
-
},
|
|
26
|
+
}, Ae = {
|
|
26
27
|
key: 0,
|
|
27
28
|
class: "flex-1 flex items-center justify-center"
|
|
28
|
-
},
|
|
29
|
+
}, Oe = {
|
|
29
30
|
key: 1,
|
|
30
31
|
class: "flex-1 overflow-y-auto p-16"
|
|
31
|
-
}, De = { class: "space-y-12" }, Ve = { class: "fm-typo-en-body-sm font-medium break-all" }, Ze = { class: "flex" },
|
|
32
|
+
}, De = { class: "space-y-12" }, Ve = { class: "fm-typo-en-body-sm font-medium break-all" }, Ze = { class: "flex" }, qe = { class: "w-64 h-64 bg-gray-100 rounded-md overflow-hidden" }, We = ["src", "alt"], Ge = /* @__PURE__ */ Z({
|
|
32
33
|
__name: "ImageUpdatePreview",
|
|
33
34
|
props: {
|
|
34
35
|
matchedImages: {},
|
|
@@ -40,11 +41,11 @@ const we = { class: "h-full flex flex-col" }, xe = { class: "flex items-center j
|
|
|
40
41
|
function _() {
|
|
41
42
|
F("cancel");
|
|
42
43
|
}
|
|
43
|
-
function
|
|
44
|
+
function S() {
|
|
44
45
|
F("update", u.matchedImages);
|
|
45
46
|
}
|
|
46
47
|
return (w, l) => {
|
|
47
|
-
const x =
|
|
48
|
+
const x = q("fm-button");
|
|
48
49
|
return r(), c("div", we, [
|
|
49
50
|
s("div", xe, [
|
|
50
51
|
l[2] || (l[2] = s("h2", { class: "fm-typo-en-headline-sm font-semibold" }, "Update Product Images", -1)),
|
|
@@ -58,14 +59,14 @@ const we = { class: "h-full flex flex-col" }, xe = { class: "flex items-center j
|
|
|
58
59
|
variant: h(z).Primary,
|
|
59
60
|
label: "Update",
|
|
60
61
|
disabled: b.value === 0,
|
|
61
|
-
onClick:
|
|
62
|
+
onClick: S
|
|
62
63
|
}, null, 8, ["variant", "disabled"])
|
|
63
64
|
])
|
|
64
65
|
]),
|
|
65
66
|
s("div", ke, [
|
|
66
67
|
s("div", Ce, [
|
|
67
68
|
s("button", {
|
|
68
|
-
class:
|
|
69
|
+
class: E([
|
|
69
70
|
"px-16 py-12 font-medium text-sm border-b-2 transition-colors",
|
|
70
71
|
y.value === "matched" ? "border-blue-500 text-blue-600 bg-blue-50" : "border-transparent text-gray-500 hover:text-gray-700"
|
|
71
72
|
]),
|
|
@@ -73,7 +74,7 @@ const we = { class: "h-full flex flex-col" }, xe = { class: "flex items-center j
|
|
|
73
74
|
}, " Matched Images (" + U(b.value) + ") ", 3),
|
|
74
75
|
k.value > 0 ? (r(), c("button", {
|
|
75
76
|
key: 0,
|
|
76
|
-
class:
|
|
77
|
+
class: E([
|
|
77
78
|
"px-16 py-12 font-medium text-sm border-b-2 transition-colors",
|
|
78
79
|
y.value === "unmatched" ? "border-blue-500 text-blue-600 bg-blue-50" : "border-transparent text-gray-500 hover:text-gray-700"
|
|
79
80
|
]),
|
|
@@ -84,15 +85,15 @@ const we = { class: "h-full flex flex-col" }, xe = { class: "flex items-center j
|
|
|
84
85
|
s("div", Ue, [
|
|
85
86
|
y.value === "matched" ? (r(), c("div", je, [
|
|
86
87
|
b.value === 0 ? (r(), c("div", Fe, l[3] || (l[3] = [
|
|
87
|
-
|
|
88
|
-
]))) : (r(), c("div",
|
|
88
|
+
B('<div class="text-center text-gray-500"><svg class="mx-auto h-48 w-48 text-gray-400 mb-16" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"></path></svg><p class="fm-typo-en-body-lg text-gray-500">No matched images found</p><p class="fm-typo-en-body-sm text-gray-400 mt-4"> Make sure your image filenames match product names </p></div>', 1)
|
|
89
|
+
]))) : (r(), c("div", Se, [
|
|
89
90
|
l[4] || (l[4] = s("div", { class: "grid grid-cols-3 gap-16 pb-12 border-b border-gray-200 mb-16" }, [
|
|
90
91
|
s("div", { class: "fm-typo-en-body-sm-600 font-semibold text-gray-700" }, "Product Name"),
|
|
91
92
|
s("div", { class: "fm-typo-en-body-sm-600 font-semibold text-gray-700" }, "Current Image"),
|
|
92
93
|
s("div", { class: "fm-typo-en-body-sm-600 font-semibold text-gray-700" }, "New Image")
|
|
93
94
|
], -1)),
|
|
94
|
-
s("div",
|
|
95
|
-
(r(!0), c(P, null,
|
|
95
|
+
s("div", Me, [
|
|
96
|
+
(r(!0), c(P, null, R(u.matchedImages, (m, C) => (r(), c("div", {
|
|
96
97
|
key: C,
|
|
97
98
|
class: "grid grid-cols-3 gap-16 py-12 border-b border-gray-100 items-center"
|
|
98
99
|
}, [
|
|
@@ -108,33 +109,33 @@ const we = { class: "h-full flex flex-col" }, xe = { class: "flex items-center j
|
|
|
108
109
|
])
|
|
109
110
|
]),
|
|
110
111
|
s("div", Te, [
|
|
111
|
-
s("div",
|
|
112
|
+
s("div", Ee, [
|
|
112
113
|
s("img", {
|
|
113
114
|
src: m.newImageUrl,
|
|
114
115
|
alt: m.newImage.name,
|
|
115
116
|
class: "w-full h-full object-cover"
|
|
116
|
-
}, null, 8,
|
|
117
|
+
}, null, 8, Be)
|
|
117
118
|
])
|
|
118
119
|
])
|
|
119
120
|
]))), 128))
|
|
120
121
|
])
|
|
121
122
|
]))
|
|
122
|
-
])) : y.value === "unmatched" ? (r(), c("div",
|
|
123
|
-
k.value === 0 ? (r(), c("div",
|
|
124
|
-
|
|
125
|
-
]))) : (r(), c("div",
|
|
123
|
+
])) : y.value === "unmatched" ? (r(), c("div", Re, [
|
|
124
|
+
k.value === 0 ? (r(), c("div", Ae, l[5] || (l[5] = [
|
|
125
|
+
B('<div class="text-center text-gray-500"><svg class="mx-auto h-48 w-48 text-gray-400 mb-16" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg><p class="fm-typo-en-body-lg text-gray-500">All images matched!</p><p class="fm-typo-en-body-sm text-gray-400 mt-4">No unmatched images found</p></div>', 1)
|
|
126
|
+
]))) : (r(), c("div", Oe, [
|
|
126
127
|
l[6] || (l[6] = s("div", { class: "grid grid-cols-2 gap-16 pb-12 border-b border-gray-200 mb-16" }, [
|
|
127
128
|
s("div", { class: "fm-typo-en-body-sm-600 font-semibold text-gray-700" }, "Filename"),
|
|
128
129
|
s("div", { class: "fm-typo-en-body-sm-600 font-semibold text-gray-700" }, "Image")
|
|
129
130
|
], -1)),
|
|
130
131
|
s("div", De, [
|
|
131
|
-
(r(!0), c(P, null,
|
|
132
|
+
(r(!0), c(P, null, R(u.unmatchedImages, (m, C) => (r(), c("div", {
|
|
132
133
|
key: C,
|
|
133
134
|
class: "grid grid-cols-2 gap-16 py-12 border-b border-gray-100 items-center"
|
|
134
135
|
}, [
|
|
135
136
|
s("div", Ve, U(m.filename), 1),
|
|
136
137
|
s("div", Ze, [
|
|
137
|
-
s("div",
|
|
138
|
+
s("div", qe, [
|
|
138
139
|
s("img", {
|
|
139
140
|
src: m.imageUrl,
|
|
140
141
|
alt: m.filename,
|
|
@@ -151,32 +152,32 @@ const we = { class: "h-full flex flex-col" }, xe = { class: "flex items-center j
|
|
|
151
152
|
};
|
|
152
153
|
}
|
|
153
154
|
});
|
|
154
|
-
var
|
|
155
|
+
var Je = { firebase: { storageBucket: "image.feedmedev.cc" } };
|
|
155
156
|
const He = {
|
|
156
157
|
key: 0,
|
|
157
158
|
class: "h-screen"
|
|
158
|
-
},
|
|
159
|
+
}, Xe = { class: "flex-1 flex justify-between gap-8 pl-8" }, Ke = { class: "flex items-center" }, Qe = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, Ye = { class: "fm-typo-en-body-md-600 font-semibold" }, et = { class: "flex gap-8" }, mt = /* @__PURE__ */ Z({
|
|
159
160
|
__name: "ProductInternalTools",
|
|
160
161
|
setup(L) {
|
|
161
|
-
const { t: j } =
|
|
162
|
+
const { t: j } = le(), u = re(V()), F = V(), y = ie(), b = ce(), { selectedCategories: k } = pe(), _ = v(!1), S = v(), w = v([]), l = v([]), x = $(() => {
|
|
162
163
|
const e = D.flatten(k.value.map((a) => a.items));
|
|
163
164
|
return D.uniqBy(e, (a) => a._id);
|
|
164
165
|
}), m = $(() => x.value.length);
|
|
165
166
|
async function C(e, a) {
|
|
166
|
-
return await
|
|
167
|
+
return await be(e, {
|
|
167
168
|
withTimestamp: !0,
|
|
168
169
|
filename: a
|
|
169
170
|
});
|
|
170
171
|
}
|
|
171
172
|
async function W(e, a = "images.zip") {
|
|
172
|
-
const o = new
|
|
173
|
+
const o = new O();
|
|
173
174
|
e.forEach(({ blob: d, filename: n }) => {
|
|
174
175
|
d && o.file(n, d);
|
|
175
176
|
});
|
|
176
|
-
const
|
|
177
|
-
ne.saveAs(
|
|
177
|
+
const p = await o.generateAsync({ type: "blob" });
|
|
178
|
+
ne.saveAs(p, a);
|
|
178
179
|
}
|
|
179
|
-
async function
|
|
180
|
+
async function G() {
|
|
180
181
|
const e = x.value.filter((a) => a.thumbnail);
|
|
181
182
|
if (e.length === 0) {
|
|
182
183
|
F.open({ type: "error", title: "No downloadable images found" });
|
|
@@ -197,16 +198,16 @@ const He = {
|
|
|
197
198
|
const a = v("Preparing download...");
|
|
198
199
|
await u.minor(
|
|
199
200
|
async () => {
|
|
200
|
-
const o = e.filter((n) => n.thumbnail).map((n,
|
|
201
|
-
let t = n.name || `image_${Date.now()}_${
|
|
201
|
+
const o = e.filter((n) => n.thumbnail).map((n, g) => {
|
|
202
|
+
let t = n.name || `image_${Date.now()}_${g}`;
|
|
202
203
|
return t += ".jpg", {
|
|
203
204
|
url: n.thumbnail,
|
|
204
205
|
filename: t,
|
|
205
|
-
index:
|
|
206
|
+
index: g + 1
|
|
206
207
|
};
|
|
207
208
|
});
|
|
208
209
|
a.value = `Starting download of ${o.length} images...`;
|
|
209
|
-
const d = (await
|
|
210
|
+
const d = (await he(o, C, {
|
|
210
211
|
batchSize: 5,
|
|
211
212
|
// Download 5 images at a time
|
|
212
213
|
batchDelay: 200,
|
|
@@ -227,15 +228,15 @@ const He = {
|
|
|
227
228
|
);
|
|
228
229
|
});
|
|
229
230
|
}
|
|
230
|
-
async function
|
|
231
|
-
const o = await new
|
|
231
|
+
async function J(e) {
|
|
232
|
+
const o = await new O().loadAsync(e), p = [];
|
|
232
233
|
for (const [d, n] of Object.entries(o.files)) {
|
|
233
234
|
if (n.dir || d.includes("__MACOSX/") || !N(d))
|
|
234
235
|
continue;
|
|
235
|
-
const
|
|
236
|
-
|
|
236
|
+
const g = await n.async("blob"), t = d.split("/").pop() || d, i = new File([g], t, { type: H(t) });
|
|
237
|
+
p.push(i);
|
|
237
238
|
}
|
|
238
|
-
return
|
|
239
|
+
return p;
|
|
239
240
|
}
|
|
240
241
|
function N(e) {
|
|
241
242
|
const a = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".bmp"], o = e.toLowerCase().substring(e.lastIndexOf("."));
|
|
@@ -252,17 +253,17 @@ const He = {
|
|
|
252
253
|
".bmp": "image/bmp"
|
|
253
254
|
}[a] || "image/jpeg";
|
|
254
255
|
}
|
|
255
|
-
function
|
|
256
|
+
function X(e) {
|
|
256
257
|
return (e.substring(0, e.lastIndexOf(".")) || e).toLowerCase().trim().replace(/[_\-\s]+/g, " ");
|
|
257
258
|
}
|
|
258
|
-
function
|
|
259
|
+
function K(e) {
|
|
259
260
|
return e.toLowerCase().trim().replace(/[_\-\s]+/g, " ");
|
|
260
261
|
}
|
|
261
262
|
async function Q(e) {
|
|
262
263
|
const a = [];
|
|
263
264
|
for (const t of e)
|
|
264
265
|
if (t.type === "application/zip" || t.name.toLowerCase().endsWith(".zip")) {
|
|
265
|
-
const i = await
|
|
266
|
+
const i = await J(t);
|
|
266
267
|
a.push(...i);
|
|
267
268
|
} else N(t.name) && a.push(t);
|
|
268
269
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -270,13 +271,13 @@ const He = {
|
|
|
270
271
|
const i = t.name.toLowerCase();
|
|
271
272
|
o.has(i) || o.set(i, t);
|
|
272
273
|
});
|
|
273
|
-
const
|
|
274
|
+
const p = Array.from(o.values()), d = [], n = [], g = /* @__PURE__ */ new Map();
|
|
274
275
|
x.value.forEach((t) => {
|
|
275
|
-
const i =
|
|
276
|
-
|
|
276
|
+
const i = K(t.name);
|
|
277
|
+
g.set(i, t);
|
|
277
278
|
});
|
|
278
|
-
for (const t of
|
|
279
|
-
const i =
|
|
279
|
+
for (const t of p) {
|
|
280
|
+
const i = X(t.name), f = g.get(i);
|
|
280
281
|
f ? d.push({
|
|
281
282
|
productId: f._id,
|
|
282
283
|
productName: f.name,
|
|
@@ -308,12 +309,12 @@ const He = {
|
|
|
308
309
|
await u.minor(
|
|
309
310
|
async () => {
|
|
310
311
|
const o = async (t) => {
|
|
311
|
-
const i =
|
|
312
|
+
const i = ve(t.productId);
|
|
312
313
|
let f = "";
|
|
313
|
-
return t.newImage && (await
|
|
314
|
+
return t.newImage && (await _e.update(i, t.newImage, Je.firebase.storageBucket), f = me(i)), { productId: t.productId, newImageUrl: f };
|
|
314
315
|
};
|
|
315
316
|
a.value = `Starting upload of ${e.length} product images...`;
|
|
316
|
-
const
|
|
317
|
+
const p = await ye({
|
|
317
318
|
items: e,
|
|
318
319
|
processor: o,
|
|
319
320
|
batchSize: 5,
|
|
@@ -325,9 +326,9 @@ const He = {
|
|
|
325
326
|
}
|
|
326
327
|
});
|
|
327
328
|
a.value = "Updating product data...";
|
|
328
|
-
const d = b.state.menu, n =
|
|
329
|
+
const d = b.state.menu, n = de(d), g = new Map(p.map((t) => [t == null ? void 0 : t.productId, t]));
|
|
329
330
|
n.modules.item = n.modules.item.map((t) => {
|
|
330
|
-
const i =
|
|
331
|
+
const i = g.get(t._id);
|
|
331
332
|
return i && i.newImageUrl ? { ...t, thumbnail: i.newImageUrl } : t;
|
|
332
333
|
}), await b.updateMenuSetting(n), await b.importMenu(n);
|
|
333
334
|
},
|
|
@@ -343,7 +344,7 @@ const He = {
|
|
|
343
344
|
}
|
|
344
345
|
function ae() {
|
|
345
346
|
var e;
|
|
346
|
-
(e =
|
|
347
|
+
(e = S.value) == null || e.click();
|
|
347
348
|
}
|
|
348
349
|
function se(e) {
|
|
349
350
|
const a = e.target;
|
|
@@ -353,41 +354,41 @@ const He = {
|
|
|
353
354
|
}
|
|
354
355
|
a.value = "";
|
|
355
356
|
}
|
|
356
|
-
return
|
|
357
|
-
const o =
|
|
357
|
+
return ge().resetOnMount(), (e, a) => {
|
|
358
|
+
const o = q("fm-button");
|
|
358
359
|
return r(), c(P, null, [
|
|
359
360
|
_.value ? (r(), c("div", He, [
|
|
360
|
-
I(
|
|
361
|
+
I(Ge, {
|
|
361
362
|
"matched-images": w.value,
|
|
362
363
|
"unmatched-images": l.value,
|
|
363
364
|
onCancel: te,
|
|
364
365
|
onUpdate: ee
|
|
365
366
|
}, null, 8, ["matched-images", "unmatched-images"])
|
|
366
|
-
])) : (r(), oe(
|
|
367
|
+
])) : (r(), oe(ue, {
|
|
367
368
|
key: 1,
|
|
368
369
|
heading: h(j)("menu.productInternalTools.title")
|
|
369
370
|
}, {
|
|
370
|
-
default:
|
|
371
|
-
I(
|
|
371
|
+
default: A(() => [
|
|
372
|
+
I(fe)
|
|
372
373
|
]),
|
|
373
|
-
"append-heading":
|
|
374
|
-
s("div",
|
|
375
|
-
s("div",
|
|
374
|
+
"append-heading": A(() => [
|
|
375
|
+
s("div", Xe, [
|
|
376
|
+
s("div", Ke, [
|
|
376
377
|
s("div", Qe, [
|
|
377
378
|
s("p", Ye, U(m.value), 1)
|
|
378
379
|
])
|
|
379
380
|
]),
|
|
380
381
|
s("div", et, [
|
|
381
382
|
I(o, {
|
|
382
|
-
"bg-color": h(
|
|
383
|
-
"text-color": h(
|
|
383
|
+
"bg-color": h(M).NeutralGray100,
|
|
384
|
+
"text-color": h(M).TypoSecondary,
|
|
384
385
|
variant: h(z).Primary,
|
|
385
386
|
label: "Download Images",
|
|
386
|
-
onClick:
|
|
387
|
+
onClick: G
|
|
387
388
|
}, null, 8, ["bg-color", "text-color", "variant"]),
|
|
388
389
|
I(o, {
|
|
389
|
-
"bg-color": h(
|
|
390
|
-
"text-color": h(
|
|
390
|
+
"bg-color": h(M).NeutralGray100,
|
|
391
|
+
"text-color": h(M).TypoSecondary,
|
|
391
392
|
variant: h(z).Primary,
|
|
392
393
|
label: "Update Images",
|
|
393
394
|
onClick: ae
|
|
@@ -399,7 +400,7 @@ const He = {
|
|
|
399
400
|
}, 8, ["heading"])),
|
|
400
401
|
s("input", {
|
|
401
402
|
ref_key: "fileInput",
|
|
402
|
-
ref:
|
|
403
|
+
ref: S,
|
|
403
404
|
type: "file",
|
|
404
405
|
multiple: "",
|
|
405
406
|
accept: "image/*,.zip",
|
|
@@ -411,5 +412,5 @@ const He = {
|
|
|
411
412
|
}
|
|
412
413
|
});
|
|
413
414
|
export {
|
|
414
|
-
|
|
415
|
+
mt as default
|
|
415
416
|
};
|