@ozdao/prometheus-framework 0.2.63 → 0.2.65

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. package/dist/main-BoybHtmb.mjs +13753 -0
  2. package/dist/main-CJ7URLjm.js +91 -0
  3. package/dist/products.server.js +8 -1
  4. package/dist/products.server.mjs +8 -1
  5. package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
  6. package/dist/prometheus-framework/src/components/Block/Block.vue.js +3 -3
  7. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  8. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +20 -20
  9. package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
  10. package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +46 -1
  11. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
  12. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +1 -46
  13. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  14. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +1 -1
  15. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  16. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +1 -1
  17. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  18. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +1 -1
  19. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  20. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +1 -1
  21. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  22. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +1 -1
  23. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  24. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +1 -1
  25. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  26. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
  27. package/dist/prometheus-framework/src/modules/icons/icons.client.cjs +1 -1
  28. package/dist/prometheus-framework/src/modules/icons/icons.client.js +59 -58
  29. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  30. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
  31. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
  32. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +1 -13
  33. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
  34. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +13 -1
  35. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  36. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +1 -1
  37. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  38. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +1 -1
  39. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  40. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +2 -2
  41. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  42. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +2 -2
  43. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  44. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +1 -1
  45. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
  46. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
  47. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  48. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
  49. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  50. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +78 -74
  51. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  52. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +132 -85
  53. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
  54. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +19 -19
  55. package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.cjs +1 -1
  56. package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.js +28 -33
  57. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  58. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
  59. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
  60. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +59 -45
  61. package/dist/prometheus-framework/src/modules/products/store/leftovers.cjs +1 -1
  62. package/dist/prometheus-framework/src/modules/products/store/leftovers.js +8 -8
  63. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  64. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +1 -1
  65. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
  66. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
  67. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  68. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +1 -1
  69. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
  70. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
  71. package/dist/prometheus-framework.cjs.js +1 -1
  72. package/dist/prometheus-framework.es.js +1 -1
  73. package/dist/style.css +1 -1
  74. package/dist/web-B9Vtg5cN.mjs +54 -0
  75. package/dist/web-ZM1AOTc1.js +1 -0
  76. package/package.json +1 -1
  77. package/src/components/Block/Block.vue +1 -1
  78. package/src/modules/icons/icons.client.js +1 -0
  79. package/src/modules/products/components/blocks/CardPosition.vue +57 -51
  80. package/src/modules/products/components/pages/EditLeftover.vue +64 -16
  81. package/src/modules/products/components/pages/Products.vue +1 -1
@@ -1,10 +1,10 @@
1
- import { ref as i, computed as C, watch as m, openBlock as c, createElementBlock as n, createVNode as d, withCtx as P, unref as v, createCommentVNode as f } from "vue";
1
+ import { ref as i, computed as V, watch as m, openBlock as n, createElementBlock as c, createElementVNode as v, createVNode as s, unref as b, createCommentVNode as f, withCtx as C } from "vue";
2
2
  import y from "../../../../components/Field/Field.vue.js";
3
- import V from "../../../../components/Select/Select.vue2.js";
3
+ import P from "../../../../components/Select/Select.vue2.js";
4
4
  import q from "../../../../components/SelectMulti/SelectMulti.vue.js";
5
- import h from "../../../icons/navigation/IconAdd.vue.js";
6
- import S from "../../../icons/navigation/IconDelete.vue.js";
7
- const U = { class: "gap-thin flex-nowrap flex" }, Q = ["disabled"], F = {
5
+ import S from "../../../icons/navigation/IconAdd.vue.js";
6
+ import U from "../../../icons/navigation/IconDelete.vue.js";
7
+ const _ = { class: "gap-thin" }, N = { class: "gap-thin mn-b-thin flex-nowrap flex" }, Q = ["disabled"], A = { class: "gap-thin flex-nowrap flex" }, O = {
8
8
  __name: "CardPosition",
9
9
  props: {
10
10
  product: Object,
@@ -16,94 +16,98 @@ const U = { class: "gap-thin flex-nowrap flex" }, Q = ["disabled"], F = {
16
16
  "delete",
17
17
  "update"
18
18
  ],
19
- setup(s, { emit: b }) {
20
- const e = s, p = b, l = i(null), t = i(1), u = i("pcs"), a = i(0), g = C(
21
- () => l.value && t.value > 0 && a.value > 0
19
+ setup(d, { emit: g }) {
20
+ const e = d, p = g, t = i(null), l = i(1), u = i("pcs"), a = i(0), x = V(
21
+ () => t.value && l.value > 0 && a.value > 0
22
22
  );
23
23
  m(e.array, () => {
24
- l.value = e.product, t.value = e.product.quantity || 1, a.value = e.product.price, u.value = e.product.type;
25
- }), e.product && (l.value = e.product, t.value = e.product.quantity || 1, a.value = e.product.price, u.value = e.product.type), m([l, t, a, u], () => {
24
+ t.value = e.product, l.value = e.product.quantity || 1, a.value = e.product.price, u.value = e.product.type;
25
+ }), e.product && (t.value = e.product, l.value = e.product.quantity || 1, a.value = e.product.price, u.value = e.product.type), m([t, l, a, u], () => {
26
26
  p("update", {
27
- ...l.value,
27
+ ...t.value,
28
28
  price: a.value,
29
- quantity: t.value || 1,
29
+ quantity: l.value || 1,
30
30
  type: u.value
31
31
  });
32
32
  });
33
- function k() {
33
+ function h() {
34
34
  p("add", {
35
- ...l.value,
35
+ ...t.value,
36
36
  price: a.value,
37
- quantity: t.value || 1,
37
+ quantity: l.value || 1,
38
38
  type: u.value
39
39
  });
40
40
  }
41
- function w() {
41
+ function k() {
42
42
  p("delete", {
43
- ...l.value,
43
+ ...t.value,
44
44
  price: a.value,
45
- quantity: t.value || 1,
45
+ quantity: l.value || 1,
46
46
  type: u.value
47
47
  });
48
48
  }
49
- return (x, o) => (c(), n("div", U, [
50
- d(q, {
51
- modelValue: l.value,
52
- "onUpdate:modelValue": o[0] || (o[0] = (r) => l.value = r),
53
- options: s.products,
54
- label: "name",
55
- multiple: !1,
56
- taggable: !1,
57
- placeholder: "Select a product",
58
- class: "bg-white pd-small radius-small"
59
- }, null, 8, ["modelValue", "options"]),
60
- d(y, {
61
- field: a.value,
62
- "onUpdate:field": o[1] || (o[1] = (r) => a.value = r),
63
- type: "number",
64
- label: "Price",
65
- symbol: x.returnCurrency(),
66
- class: "bg-white pd-small radius-small"
67
- }, null, 8, ["field", "symbol"]),
68
- d(y, {
69
- field: t.value,
70
- "onUpdate:field": o[3] || (o[3] = (r) => t.value = r),
71
- type: "number",
72
- label: "Qty",
73
- class: "bg-white pd-small radius-small"
74
- }, {
75
- default: P(() => [
76
- d(V, {
77
- select: u.value,
78
- "onUpdate:select": o[2] || (o[2] = (r) => u.value = r),
79
- options: [
80
- "pcs",
81
- "g",
82
- "ml"
83
- ],
84
- class: "bg-grey pd-thin radius-thin"
85
- }, null, 8, ["select"])
86
- ]),
87
- _: 1
88
- }, 8, ["field"]),
89
- s.product ? f("", !0) : (c(), n("button", {
90
- key: 0,
91
- disabled: !g.value,
92
- onClick: k,
93
- class: "bg-main aspect-1x1 radius-small pd-small"
94
- }, [
95
- d(v(h), { class: "i-semi" })
96
- ], 8, Q)),
97
- s.product ? (c(), n("button", {
98
- key: 1,
99
- onClick: w,
100
- class: "bg-red aspect-1x1 radius-small pd-small"
101
- }, [
102
- d(v(S), { class: "i-semi" })
103
- ])) : f("", !0)
49
+ return (w, r) => (n(), c("div", _, [
50
+ v("div", N, [
51
+ s(q, {
52
+ modelValue: t.value,
53
+ "onUpdate:modelValue": r[0] || (r[0] = (o) => t.value = o),
54
+ options: d.products,
55
+ label: "name",
56
+ multiple: !1,
57
+ taggable: !1,
58
+ placeholder: "Select a product",
59
+ class: "bg-white br-solid br-1px br-black-transp-5 pd-small radius-small"
60
+ }, null, 8, ["modelValue", "options"]),
61
+ d.product ? f("", !0) : (n(), c("button", {
62
+ key: 0,
63
+ disabled: !x.value,
64
+ onClick: h,
65
+ class: "bg-main aspect-1x1 radius-small pd-small"
66
+ }, [
67
+ s(b(S), { class: "i-semi" })
68
+ ], 8, Q)),
69
+ d.product ? (n(), c("button", {
70
+ key: 1,
71
+ onClick: k,
72
+ class: "bg-red aspect-1x1 radius-small pd-small"
73
+ }, [
74
+ s(b(U), { class: "i-semi" })
75
+ ])) : f("", !0)
76
+ ]),
77
+ v("div", A, [
78
+ s(y, {
79
+ field: a.value,
80
+ "onUpdate:field": r[1] || (r[1] = (o) => a.value = o),
81
+ type: "number",
82
+ label: "Price",
83
+ symbol: w.returnCurrency(),
84
+ class: "bg-white w-100 br-solid br-1px br-black-transp-5 pd-small radius-small"
85
+ }, null, 8, ["field", "symbol"]),
86
+ s(y, {
87
+ field: l.value,
88
+ "onUpdate:field": r[3] || (r[3] = (o) => l.value = o),
89
+ type: "number",
90
+ label: "Qty",
91
+ class: "bg-white w-100 br-solid br-1px br-black-transp-5 pd-small radius-small"
92
+ }, {
93
+ default: C(() => [
94
+ s(P, {
95
+ select: u.value,
96
+ "onUpdate:select": r[2] || (r[2] = (o) => u.value = o),
97
+ options: [
98
+ "pcs",
99
+ "g",
100
+ "ml"
101
+ ],
102
+ class: "bg-grey pd-r-thin pd-l-thin pd-t-nano pd-b-nano radius-thin"
103
+ }, null, 8, ["select"])
104
+ ]),
105
+ _: 1
106
+ }, 8, ["field"])
107
+ ])
104
108
  ]));
105
109
  }
106
110
  };
107
111
  export {
108
- F as default
112
+ O as default
109
113
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../../../../components/Block/Block.vue.cjs");require("../../../../components/Field/Field.vue2.cjs");const _=require("../../../../components/Select/Select.vue2.cjs");require("../../../../components/SelectMulti/SelectMulti.vue2.cjs");const p=require("../blocks/CardPosition.vue.cjs"),m=require("vue-router"),l=require("../../../globals/store/globals.cjs"),t=require("../../store/leftovers.cjs"),f=require("../../store/products.cjs");require("./EditLeftover.vue2.cjs");const g={class:"mn-b-medium gap-small flex-v-center flex-nowrap flex"},N={class:""},h={class:"gap-thin flex-v-center flex-nojustify flex"},V={class:"mn-r-auto"},q={__name:"EditLeftover",setup(E){const o=m.useRoute(),i=m.useRouter(),c=e.ref(f.state.all);e.ref(null);const v=e.computed(()=>Number(t.state.current.positions.reduce((s,r)=>Number(s)+Number(r.price),0)));e.onMounted(async()=>{if(o.params.leftover)try{await t.actions.fetch(o.params.leftover)}catch{console.error("error")}else t.state.current={type:"",order:"",positions:[]};try{const s=await f.actions.read({organization:o.params._id,limit:100});c.value=s}catch{console.error("error")}});function b(){o.params.leftover?t.actions.fetch(o.params.leftover):t.state.current={type:"",order:"",positions:[]}}function y(){t.state.current.organization=o.params._id,o.params.leftover?t.actions.update(t.state.current).then(()=>i.push({name:"Leftovers",params:{_id:o.params._id}}),s=>console.error("error")):t.actions.create(t.state.current).then(()=>i.push({name:"Leftovers",params:{_id:o.params._id}}),s=>console.error("error"))}function k(){t.actions.delete(o.params.leftover).then(()=>i.push({name:"Leftovers",params:{_id:o.params._id}}),s=>console.error("error"))}return(s,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("header",g,[e.createElementVNode("h2",N,e.toDisplayString(e.unref(o).params.leftover?"Edit ":"Add ")+" Inventory",1),e.createVNode(_.default,{select:t.state.current.type,"onUpdate:select":r[0]||(r[0]=n=>t.state.current.type=n),options:["stock-in","stock-out","write-off"],placeholder:"Select type",class:"bg-main t-black w-max pd-small t-semi p-big uppercase radius-small"},null,8,["select"])]),e.createVNode(u.default,{title:"Add Position",class:"mn-b-semi"},{default:e.withCtx(()=>[e.createVNode(p.default,{onAdd:r[1]||(r[1]=n=>l.actions.add(t.state.current.positions,n)),products:c.value},null,8,["products"])]),_:1}),e.createVNode(u.default,{title:"Invetory Sheet",placeholder:"No positions added yet",class:"mn-b-semi"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.positions,(n,d)=>(e.openBlock(),e.createBlock(p.default,{key:n._id,product:n,array:t.state.current.positions,products:c.value,onAdd:r[2]||(r[2]=a=>l.actions.add(t.state.current.positions,a)),onUpdate:a=>l.actions.update(t.state.current.positions,a,d),onDelete:a=>l.actions.delete(t.state.current.positions,a,d)},null,8,["product","array","products","onUpdate","onDelete"]))),128))]),_:1}),e.createVNode(u.default,{class:""},{default:e.withCtx(()=>[e.createElementVNode("section",h,[e.createElementVNode("h3",V," In total: "+e.toDisplayString(s.formatPrice(v.value)),1),e.createElementVNode("a",{onClick:r[3]||(r[3]=n=>y()),class:"bg-main button"}," Save "),e.createElementVNode("a",{class:"t-white bg-second button",onClick:r[4]||(r[4]=n=>b())}," Reset "),e.unref(o).params.leftover?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:r[5]||(r[5]=n=>k()),class:"t-white bg-red button"}," Delete ")):e.createCommentVNode("",!0)])]),_:1})],64))}};exports.default=q;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("../../../../components/Block/Block.vue.cjs");require("../../../../components/Field/Field.vue2.cjs");const N=require("../../../../components/Feed/Feed.vue.cjs"),w=require("../../../../components/Select/Select.vue2.cjs"),q=require("../../../../components/Popup/Popup.vue.cjs");require("../../../../components/SelectMulti/SelectMulti.vue2.cjs");const P=require("../blocks/CardPosition.vue.cjs"),C=require("../../../orders/components/blocks/CardOrderItem.vue.cjs"),v=require("vue-router"),d=require("../../../globals/store/globals.cjs"),E=require("../../../auth/store/auth.cjs"),t=require("../../store/leftovers.cjs"),p=require("../../store/products.cjs");require("./EditLeftover.vue2.cjs");const V={class:"pd-thin"},x={class:"mn-b-medium gap-small flex-v-center flex-nowrap flex"},B={class:""},S=e.createElementVNode("h3",{class:"mn-b-small"},"Add to order",-1),D={class:"bg-grey mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big"},L={class:"gap-thin flex-v-center flex-nojustify flex"},R={class:"mn-r-auto"},O={__name:"EditLeftover",setup(z){const r=v.useRoute(),l=v.useRouter(),m=e.ref(p.state.all);e.ref(null);const _=e.computed(()=>Number(t.state.current.positions.reduce((s,a)=>Number(s)+Number(a.price),0))),c=e.ref(!1);function b(){c.value=!0}function f(){c.value=!1}e.onMounted(async()=>{if(r.params.leftover)try{await t.actions.fetch(r.params.leftover)}catch{console.error("error")}else t.state.current={type:"",order:"",positions:[]};try{const s=await p.actions.read({organization:r.params._id,limit:100});m.value=s}catch{console.error("error")}});function g(){r.params.leftover?t.actions.fetch(r.params.leftover):t.state.current={type:"",order:"",positions:[]}}function y(){t.state.current.organization=r.params._id,r.params.leftover?t.actions.update(t.state.current).then(()=>l.push({name:"Leftovers",params:{_id:r.params._id}}),s=>console.error("error")):(t.state.current.creator={type:"user",target:E.state.user._id},t.state.current.owner={type:"organization",target:r.params._id},console.log("leftover state is",t.state.current),t.actions.create(t.state.current).then(()=>l.push({name:"Leftovers",params:{_id:r.params._id}}),s=>console.error("error")))}function k(){t.actions.delete(r.params.leftover).then(()=>l.push({name:"Leftovers",params:{_id:r.params._id}}),s=>console.error("error"))}return(s,a)=>(e.openBlock(),e.createElementBlock("div",V,[e.createElementVNode("header",x,[e.createElementVNode("h2",B,e.toDisplayString(e.unref(r).params.leftover?"Edit ":"Add ")+" Inventory",1),e.createVNode(w.default,{select:t.state.current.type,"onUpdate:select":a[0]||(a[0]=o=>t.state.current.type=o),options:["stock-in","stock-out"],placeholder:"Select type",class:"bg-main t-black w-max pd-small t-semi p-big uppercase radius-small"},null,8,["select"])]),e.createVNode(q.default,{title:"Add position",onClosePopup:f,isPopupOpen:c.value,class:"bg-white w-min-30r w-max-30r radius-big pd-medium"},{default:e.withCtx(()=>[S,e.createElementVNode("div",D,[e.createVNode(N.default,{search:!0,states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:o=>p.actions.read(o),state:null},options:{organization:e.unref(r).params._id},class:""},{default:e.withCtx(({items:o})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o,(n,i)=>(e.openBlock(),e.createBlock(C.default,{key:n._id,editable:!1,product:n,onClick:()=>{let u={...n};u.quantity=1,u.type="pcs",d.actions.add(t.state.current.positions,u),f()},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["product","onClick"]))),128))]),_:1},8,["states","store","options"])])]),_:1},8,["isPopupOpen"]),e.createVNode(h.default,{title:"Invetory Sheet",actions:[{label:"+",function:()=>b()}],placeholder:"No positions added yet",class:"mn-b-semi"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.positions,(o,n)=>(e.openBlock(),e.createBlock(P.default,{key:o._id,product:o,array:t.state.current.positions,products:m.value,onUpdate:i=>d.actions.update(t.state.current.positions,i,n),onDelete:i=>d.actions.delete(t.state.current.positions,i,n),class:"mn-b-small radius-medium bg-white pd-small"},null,8,["product","array","products","onUpdate","onDelete"]))),128))]),_:1},8,["actions"]),e.createVNode(h.default,{class:""},{default:e.withCtx(()=>[e.createElementVNode("section",L,[e.createElementVNode("h3",R," In total: "+e.toDisplayString(s.formatPrice(_.value)),1),e.createElementVNode("a",{onClick:a[1]||(a[1]=o=>y()),class:"bg-main button"}," Save "),e.createElementVNode("a",{class:"t-white bg-second button",onClick:a[2]||(a[2]=o=>g())}," Reset "),e.unref(r).params.leftover?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:a[3]||(a[3]=o=>k()),class:"t-white bg-red button"}," Delete ")):e.createCommentVNode("",!0)])]),_:1})]))}};exports.default=O;
@@ -1,140 +1,187 @@
1
- import { ref as y, computed as S, onMounted as C, openBlock as c, createElementBlock as d, Fragment as b, createElementVNode as n, toDisplayString as h, unref as g, createVNode as i, withCtx as f, renderList as D, createBlock as L, createCommentVNode as R } from "vue";
2
- import v from "../../../../components/Block/Block.vue.js";
1
+ import { ref as h, computed as z, onMounted as E, openBlock as i, createElementBlock as u, createElementVNode as a, toDisplayString as k, unref as v, createVNode as l, withCtx as m, Fragment as w, renderList as P, createBlock as $, createCommentVNode as A } from "vue";
2
+ import x from "../../../../components/Block/Block.vue.js";
3
3
  import "../../../../components/Field/Field.vue2.js";
4
- import A from "../../../../components/Select/Select.vue2.js";
4
+ import B from "../../../../components/Feed/Feed.vue.js";
5
+ import I from "../../../../components/Select/Select.vue2.js";
6
+ import O from "../../../../components/Popup/Popup.vue.js";
5
7
  import "../../../../components/SelectMulti/SelectMulti.vue2.js";
6
- import k from "../blocks/CardPosition.vue.js";
7
- import { useRoute as E, useRouter as P } from "vue-router";
8
- import { actions as p } from "../../../globals/store/globals.js";
9
- import { state as t, actions as l } from "../../store/leftovers.js";
10
- import { state as B, actions as I } from "../../store/products.js";
8
+ import U from "../blocks/CardPosition.vue.js";
9
+ import V from "../../../orders/components/blocks/CardOrderItem.vue.js";
10
+ import { useRoute as F, useRouter as j } from "vue-router";
11
+ import { actions as b } from "../../../globals/store/globals.js";
12
+ import { state as q } from "../../../auth/store/auth.js";
13
+ import { state as e, actions as c } from "../../store/leftovers.js";
14
+ import { state as M, actions as C } from "../../store/products.js";
11
15
  import "./EditLeftover.vue2.js";
12
- const U = { class: "mn-b-medium gap-small flex-v-center flex-nowrap flex" }, V = { class: "" }, z = { class: "gap-thin flex-v-center flex-nojustify flex" }, j = { class: "mn-r-auto" }, Y = {
16
+ const G = { class: "pd-thin" }, H = { class: "mn-b-medium gap-small flex-v-center flex-nowrap flex" }, J = { class: "" }, K = /* @__PURE__ */ a("h3", { class: "mn-b-small" }, "Add to order", -1), Q = { class: "bg-grey mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big" }, T = { class: "gap-thin flex-v-center flex-nojustify flex" }, W = { class: "mn-r-auto" }, de = {
13
17
  __name: "EditLeftover",
14
- setup(F) {
15
- const r = E(), u = P(), m = y(B.all);
16
- y(null);
17
- const w = S(() => Number(t.current.positions.reduce((o, e) => Number(o) + Number(e.price), 0)));
18
- C(async () => {
19
- if (r.params.leftover)
18
+ setup(X) {
19
+ const t = F(), d = j(), y = h(M.all);
20
+ h(null);
21
+ const N = z(() => Number(e.current.positions.reduce((o, s) => Number(o) + Number(s.price), 0))), f = h(!1);
22
+ function S() {
23
+ f.value = !0;
24
+ }
25
+ function g() {
26
+ f.value = !1;
27
+ }
28
+ E(async () => {
29
+ if (t.params.leftover)
20
30
  try {
21
- await l.fetch(r.params.leftover);
31
+ await c.fetch(t.params.leftover);
22
32
  } catch {
23
33
  console.error("error");
24
34
  }
25
35
  else
26
- t.current = { type: "", order: "", positions: [] };
36
+ e.current = { type: "", order: "", positions: [] };
27
37
  try {
28
- const o = await I.read({
29
- organization: r.params._id,
38
+ const o = await C.read({
39
+ organization: t.params._id,
30
40
  limit: 100
31
41
  });
32
- m.value = o;
42
+ y.value = o;
33
43
  } catch {
34
44
  console.error("error");
35
45
  }
36
46
  });
37
- function x() {
38
- r.params.leftover ? l.fetch(r.params.leftover) : t.current = { type: "", order: "", positions: [] };
47
+ function D() {
48
+ t.params.leftover ? c.fetch(t.params.leftover) : e.current = { type: "", order: "", positions: [] };
39
49
  }
40
- function $() {
41
- t.current.organization = r.params._id, r.params.leftover ? l.update(t.current).then(
42
- () => u.push({ name: "Leftovers", params: { _id: r.params._id } }),
50
+ function L() {
51
+ e.current.organization = t.params._id, t.params.leftover ? c.update(e.current).then(
52
+ () => d.push({ name: "Leftovers", params: { _id: t.params._id } }),
43
53
  (o) => console.error("error")
44
- ) : l.create(t.current).then(
45
- () => u.push({ name: "Leftovers", params: { _id: r.params._id } }),
54
+ ) : (e.current.creator = {
55
+ type: "user",
56
+ target: q.user._id
57
+ }, e.current.owner = {
58
+ type: "organization",
59
+ target: t.params._id
60
+ }, console.log("leftover state is", e.current), c.create(e.current).then(
61
+ () => d.push({ name: "Leftovers", params: { _id: t.params._id } }),
46
62
  (o) => console.error("error")
47
- );
63
+ ));
48
64
  }
49
- function N() {
50
- l.delete(r.params.leftover).then(
51
- () => u.push({ name: "Leftovers", params: { _id: r.params._id } }),
65
+ function R() {
66
+ c.delete(t.params.leftover).then(
67
+ () => d.push({ name: "Leftovers", params: { _id: t.params._id } }),
52
68
  (o) => console.error("error")
53
69
  );
54
70
  }
55
- return (o, e) => (c(), d(b, null, [
56
- n("header", U, [
57
- n("h2", V, h(g(r).params.leftover ? "Edit " : "Add ") + " Inventory", 1),
58
- i(A, {
59
- select: t.current.type,
60
- "onUpdate:select": e[0] || (e[0] = (s) => t.current.type = s),
71
+ return (o, s) => (i(), u("div", G, [
72
+ a("header", H, [
73
+ a("h2", J, k(v(t).params.leftover ? "Edit " : "Add ") + " Inventory", 1),
74
+ l(I, {
75
+ select: e.current.type,
76
+ "onUpdate:select": s[0] || (s[0] = (r) => e.current.type = r),
61
77
  options: [
62
78
  "stock-in",
63
- "stock-out",
64
- "write-off"
79
+ "stock-out"
65
80
  ],
66
81
  placeholder: "Select type",
67
82
  class: "bg-main t-black w-max pd-small t-semi p-big uppercase radius-small"
68
83
  }, null, 8, ["select"])
69
84
  ]),
70
- i(v, {
71
- title: "Add Position",
72
- class: "mn-b-semi"
85
+ l(O, {
86
+ title: "Add position",
87
+ onClosePopup: g,
88
+ isPopupOpen: f.value,
89
+ class: "bg-white w-min-30r w-max-30r radius-big pd-medium"
73
90
  }, {
74
- default: f(() => [
75
- i(k, {
76
- onAdd: e[1] || (e[1] = (s) => p.add(
77
- t.current.positions,
78
- s
79
- )),
80
- products: m.value
81
- }, null, 8, ["products"])
91
+ default: m(() => [
92
+ K,
93
+ a("div", Q, [
94
+ l(B, {
95
+ search: !0,
96
+ states: {
97
+ empty: {
98
+ title: "No Products Found",
99
+ description: "Currently, there are no such products available."
100
+ }
101
+ },
102
+ store: {
103
+ read: (r) => C.read(r),
104
+ state: null
105
+ },
106
+ options: {
107
+ organization: v(t).params._id
108
+ },
109
+ class: ""
110
+ }, {
111
+ default: m(({
112
+ items: r
113
+ }) => [
114
+ (i(!0), u(w, null, P(r, (n, p) => (i(), $(V, {
115
+ key: n._id,
116
+ editable: !1,
117
+ product: n,
118
+ onClick: () => {
119
+ let _ = { ...n };
120
+ _.quantity = 1, _.type = "pcs", b.add(e.current.positions, _), g();
121
+ },
122
+ class: "bg-white pd-thin radius-medium w-100 mn-b-thin"
123
+ }, null, 8, ["product", "onClick"]))), 128))
124
+ ]),
125
+ _: 1
126
+ }, 8, ["states", "store", "options"])
127
+ ])
82
128
  ]),
83
129
  _: 1
84
- }),
85
- i(v, {
130
+ }, 8, ["isPopupOpen"]),
131
+ l(x, {
86
132
  title: "Invetory Sheet",
133
+ actions: [{
134
+ label: "+",
135
+ function: () => S()
136
+ }],
87
137
  placeholder: "No positions added yet",
88
138
  class: "mn-b-semi"
89
139
  }, {
90
- default: f(() => [
91
- (c(!0), d(b, null, D(t.current.positions, (s, _) => (c(), L(k, {
92
- key: s._id,
93
- product: s,
94
- array: t.current.positions,
95
- products: m.value,
96
- onAdd: e[2] || (e[2] = (a) => p.add(
97
- t.current.positions,
98
- a
99
- )),
100
- onUpdate: (a) => p.update(
101
- t.current.positions,
102
- a,
103
- _
140
+ default: m(() => [
141
+ (i(!0), u(w, null, P(e.current.positions, (r, n) => (i(), $(U, {
142
+ key: r._id,
143
+ product: r,
144
+ array: e.current.positions,
145
+ products: y.value,
146
+ onUpdate: (p) => b.update(
147
+ e.current.positions,
148
+ p,
149
+ n
150
+ ),
151
+ onDelete: (p) => b.delete(
152
+ e.current.positions,
153
+ p,
154
+ n
104
155
  ),
105
- onDelete: (a) => p.delete(
106
- t.current.positions,
107
- a,
108
- _
109
- )
156
+ class: "mn-b-small radius-medium bg-white pd-small"
110
157
  }, null, 8, ["product", "array", "products", "onUpdate", "onDelete"]))), 128))
111
158
  ]),
112
159
  _: 1
113
- }),
114
- i(v, { class: "" }, {
115
- default: f(() => [
116
- n("section", z, [
117
- n("h3", j, " In total: " + h(o.formatPrice(w.value)), 1),
118
- n("a", {
119
- onClick: e[3] || (e[3] = (s) => $()),
160
+ }, 8, ["actions"]),
161
+ l(x, { class: "" }, {
162
+ default: m(() => [
163
+ a("section", T, [
164
+ a("h3", W, " In total: " + k(o.formatPrice(N.value)), 1),
165
+ a("a", {
166
+ onClick: s[1] || (s[1] = (r) => L()),
120
167
  class: "bg-main button"
121
168
  }, " Save "),
122
- n("a", {
169
+ a("a", {
123
170
  class: "t-white bg-second button",
124
- onClick: e[4] || (e[4] = (s) => x())
171
+ onClick: s[2] || (s[2] = (r) => D())
125
172
  }, " Reset "),
126
- g(r).params.leftover ? (c(), d("a", {
173
+ v(t).params.leftover ? (i(), u("a", {
127
174
  key: 0,
128
- onClick: e[5] || (e[5] = (s) => N()),
175
+ onClick: s[3] || (s[3] = (r) => R()),
129
176
  class: "t-white bg-red button"
130
- }, " Delete ")) : R("", !0)
177
+ }, " Delete ")) : A("", !0)
131
178
  ])
132
179
  ]),
133
180
  _: 1
134
181
  })
135
- ], 64));
182
+ ]));
136
183
  }
137
184
  };
138
185
  export {
139
- Y as default
186
+ de as default
140
187
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),a=require("vue-router"),d=require("../../../../components/Tab/Tab.vue2.cjs"),m=require("../../../../components/Feed/Feed.vue.cjs"),f=require("../blocks/CardLeftover.vue.cjs"),u=require("../../store/leftovers.cjs");require("./Leftovers.vue2.cjs");const p={class:"pd-thin"},v={class:"mn-b-medium flex-v-center flex-nowrap flex"},b=e.createElementVNode("h2",{class:"mn-r-medium"},"Inventory",-1),_={class:"mn-b-semi pd-medium bg-grey radius-big"},g=e.createElementVNode("p",{class:"mn-b-thin"},"Spended:",-1),h={__name:"Leftovers",setup(k){const s=a.useRoute();a.useRouter();const l=e.ref(s.query.tab?s.query.tab:"all"),i=e.computed(()=>u.state.all.reduce((o,r)=>{const t=r.positions.reduce((n,c)=>n+c.price,0);return r.type==="stock-in"?o-t:r.type==="stock-out"?o+t:o},0));return(o,r)=>(e.openBlock(),e.createElementBlock("div",p,[e.createElementVNode("header",v,[b,e.createElementVNode("button",{onClick:r[0]||(r[0]=t=>o.$router.push({name:"LeftoverAdd"})),class:"radius-100 i-big hover-scale-1 cursor-pointer t-white bg-second"}," + ")]),e.createElementVNode("section",_,[g,e.createElementVNode("h3",null,e.toDisplayString(o.formatPrice(i.value)),1)]),e.createVNode(d.default,{selected:l.value,"onUpdate:selected":r[1]||(r[1]=t=>l.value=t),tabs:[{name:"All",value:"all"},{name:"Stock-In",value:"stock-in"},{name:"Stock-Out",value:"stock-out"},{name:"Write-Off",value:"write-off"}],class:"mn-b-small o-hidden h5 radius-big bg-grey"},null,8,["selected"]),e.createVNode(m.default,{states:{empty:{title:"No Leftovers Found",description:"Currently, there are no leftovers available."}},store:{read:t=>u.actions.read(t)},options:{limit:15,organization:e.unref(s).params._id}},{default:e.withCtx(({items:t})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,n=>(e.openBlock(),e.createBlock(f.default,{leftover:n,class:"bg-grey pd-small mn-b-thin radius-small"},null,8,["leftover"]))),256))]),_:1},8,["states","store","options"])]))}};exports.default=h;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),a=require("vue-router"),d=require("../../../../components/Tab/Tab.vue.cjs"),m=require("../../../../components/Feed/Feed.vue.cjs"),p=require("../blocks/CardLeftover.vue.cjs"),u=require("../../store/leftovers.cjs");require("./Leftovers.vue2.cjs");const v={class:"pd-thin"},f={class:"mn-b-medium flex-v-center flex-nowrap flex"},b=e.createElementVNode("h2",{class:"mn-r-medium"},"Inventory",-1),_={class:"mn-b-semi pd-medium bg-grey radius-big"},g=e.createElementVNode("p",{class:"mn-b-thin"},"Spended:",-1),h={__name:"Leftovers",setup(k){const n=a.useRoute();a.useRouter();const s=e.ref(n.query.tab?n.query.tab:"all"),i=e.computed(()=>u.state.all.reduce((o,r)=>{const t=r.positions.reduce((l,c)=>l+c.price,0);return r.type==="stock-in"?o-t:r.type==="stock-out"?o+t:o},0));return(o,r)=>(e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("header",f,[b,e.createElementVNode("button",{onClick:r[0]||(r[0]=t=>o.$router.push({name:"LeftoverAdd"})),class:"radius-100 i-big hover-scale-1 cursor-pointer t-white bg-second"}," + ")]),e.createElementVNode("section",_,[g,e.createElementVNode("h3",null,e.toDisplayString(o.formatPrice(i.value)),1)]),e.createVNode(d.default,{selected:s.value,"onUpdate:selected":r[1]||(r[1]=t=>s.value=t),tabs:[{name:"All",value:"all"},{name:"Stock-In",value:"stock-in"},{name:"Stock-Out",value:"stock-out"}],class:"mn-b-small o-hidden h5 radius-big bg-grey"},null,8,["selected"]),e.createVNode(m.default,{states:{empty:{title:"No Leftovers Found",description:"Currently, there are no leftovers available."}},store:{read:t=>u.actions.read(t)},options:{limit:15,organization:e.unref(n).params._id,...s.value!=="all"&&{type:s.value}}},{default:e.withCtx(({items:t})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,l=>(e.openBlock(),e.createBlock(p.default,{leftover:l,class:"bg-grey pd-small mn-b-thin radius-small"},null,8,["leftover"]))),256))]),_:1},8,["states","store","options"])]))}};exports.default=h;
@@ -1,17 +1,17 @@
1
- import { ref as d, computed as p, openBlock as a, createElementBlock as i, createElementVNode as o, toDisplayString as f, createVNode as u, unref as v, withCtx as b, Fragment as _, renderList as h, createBlock as g } from "vue";
1
+ import { ref as m, computed as p, openBlock as a, createElementBlock as i, createElementVNode as o, toDisplayString as f, createVNode as u, unref as v, withCtx as b, Fragment as _, renderList as h, createBlock as g } from "vue";
2
2
  import { useRoute as y, useRouter as k } from "vue-router";
3
- import L from "../../../../components/Tab/Tab.vue2.js";
4
- import w from "../../../../components/Feed/Feed.vue.js";
5
- import x from "../blocks/CardLeftover.vue.js";
6
- import { state as C, actions as $ } from "../../store/leftovers.js";
3
+ import L from "../../../../components/Tab/Tab.vue.js";
4
+ import x from "../../../../components/Feed/Feed.vue.js";
5
+ import C from "../blocks/CardLeftover.vue.js";
6
+ import { state as $, actions as w } from "../../store/leftovers.js";
7
7
  import "./Leftovers.vue2.js";
8
- const B = { class: "pd-thin" }, N = { class: "mn-b-medium flex-v-center flex-nowrap flex" }, q = /* @__PURE__ */ o("h2", { class: "mn-r-medium" }, "Inventory", -1), A = { class: "mn-b-semi pd-medium bg-grey radius-big" }, E = /* @__PURE__ */ o("p", { class: "mn-b-thin" }, "Spended:", -1), D = {
8
+ const B = { class: "pd-thin" }, N = { class: "mn-b-medium flex-v-center flex-nowrap flex" }, q = /* @__PURE__ */ o("h2", { class: "mn-r-medium" }, "Inventory", -1), A = { class: "mn-b-semi pd-medium bg-grey radius-big" }, E = /* @__PURE__ */ o("p", { class: "mn-b-thin" }, "Spended:", -1), O = {
9
9
  __name: "Leftovers",
10
10
  setup(F) {
11
- const s = y();
11
+ const n = y();
12
12
  k();
13
- const l = d(s.query.tab ? s.query.tab : "all"), c = p(() => C.all.reduce((r, t) => {
14
- const e = t.positions.reduce((n, m) => n + m.price, 0);
13
+ const s = m(n.query.tab ? n.query.tab : "all"), c = p(() => $.all.reduce((r, t) => {
14
+ const e = t.positions.reduce((l, d) => l + d.price, 0);
15
15
  return t.type === "stock-in" ? r - e : t.type === "stock-out" ? r + e : r;
16
16
  }, 0));
17
17
  return (r, t) => (a(), i("div", B, [
@@ -29,17 +29,16 @@ const B = { class: "pd-thin" }, N = { class: "mn-b-medium flex-v-center flex-now
29
29
  o("h3", null, f(r.formatPrice(c.value)), 1)
30
30
  ]),
31
31
  u(L, {
32
- selected: l.value,
33
- "onUpdate:selected": t[1] || (t[1] = (e) => l.value = e),
32
+ selected: s.value,
33
+ "onUpdate:selected": t[1] || (t[1] = (e) => s.value = e),
34
34
  tabs: [
35
35
  { name: "All", value: "all" },
36
36
  { name: "Stock-In", value: "stock-in" },
37
- { name: "Stock-Out", value: "stock-out" },
38
- { name: "Write-Off", value: "write-off" }
37
+ { name: "Stock-Out", value: "stock-out" }
39
38
  ],
40
39
  class: "mn-b-small o-hidden h5 radius-big bg-grey"
41
40
  }, null, 8, ["selected"]),
42
- u(w, {
41
+ u(x, {
43
42
  states: {
44
43
  empty: {
45
44
  title: "No Leftovers Found",
@@ -47,19 +46,20 @@ const B = { class: "pd-thin" }, N = { class: "mn-b-medium flex-v-center flex-now
47
46
  }
48
47
  },
49
48
  store: {
50
- read: (e) => $.read(e)
49
+ read: (e) => w.read(e)
51
50
  },
52
51
  options: {
53
52
  limit: 15,
54
- organization: v(s).params._id
53
+ organization: v(n).params._id,
54
+ ...s.value !== "all" && { type: s.value }
55
55
  // user: user
56
56
  }
57
57
  }, {
58
58
  default: b(({
59
59
  items: e
60
60
  }) => [
61
- (a(!0), i(_, null, h(e, (n) => (a(), g(x, {
62
- leftover: n,
61
+ (a(!0), i(_, null, h(e, (l) => (a(), g(C, {
62
+ leftover: l,
63
63
  class: "bg-grey pd-small mn-b-thin radius-small"
64
64
  }, null, 8, ["leftover"]))), 256))
65
65
  ]),
@@ -69,5 +69,5 @@ const B = { class: "pd-thin" }, N = { class: "mn-b-medium flex-v-center flex-now
69
69
  }
70
70
  };
71
71
  export {
72
- D as default
72
+ O as default
73
73
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("vue-router"),q=require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const g=require("../sections/PopularProducts.vue.cjs"),y=require("../sections/SectionProduct.vue.cjs");require("../../store/categories.cjs");const h=require("../../../../../../node_modules/vue-meta/dist/vue-meta.esm-browser.min.cjs"),f=require("../../../auth/store/auth.cjs"),r=require("../../store/products.cjs");require("./Product.vue2.cjs");const k={class:"flex flex-column w-100 o-hidden gap-thin pd-thin"},B={key:0},S={__name:"Product",async setup(x){let o,n;const u=p.useRoute();p.useRouter(),[o,n]=e.withAsyncContext(()=>r.actions.fetchProduct(u.params.product)),await o,n(),u.meta.title.en=r.state.current.name,u.meta.title.ru=r.state.current.name;const t=e.computed(()=>r.state.current),m={messages:{en:{},ru:{}}},{t:_}=q.useI18n(m),v=e.computed(()=>({title:r.state.current.name,description:_("description")}));return h.useMeta(v),e.onMounted(()=>{}),(M,P)=>{var s,c,i,a,l,d;return e.openBlock(),e.createElementBlock("div",k,[e.createTextVNode(e.toDisplayString(t.value.quantity)+" ",1),t.value.ingredients?(e.openBlock(),e.createElementBlock("div",B,e.toDisplayString((c=(s=t.value)==null?void 0:s.ingredients[0])==null?void 0:c._id)+" "+e.toDisplayString((a=(i=t.value)==null?void 0:i.ingredients[0])==null?void 0:a.quantity)+" "+e.toDisplayString((d=(l=t.value)==null?void 0:l.ingredients[1])==null?void 0:d.quantity),1)):e.createCommentVNode("",!0),t.value?(e.openBlock(),e.createBlock(y.default,{key:1,product:t.value,user:f.state.user,class:"pos-relative"},null,8,["product","user"])):e.createCommentVNode("",!0),e.createVNode(g.default)])}}};exports.default=S;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("vue-router"),d=require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const l=require("../sections/PopularProducts.vue.cjs"),p=require("../sections/SectionProduct.vue.cjs");require("../../store/categories.cjs");const m=require("../../../../../../node_modules/vue-meta/dist/vue-meta.esm-browser.min.cjs"),_=require("../../../auth/store/auth.cjs"),t=require("../../store/products.cjs");require("./Product.vue2.cjs");const q={class:"flex flex-column w-100 o-hidden gap-thin pd-thin"},v={__name:"Product",async setup(f){let u,o;const r=s.useRoute();s.useRouter(),[u,o]=e.withAsyncContext(()=>t.actions.fetchProduct(r.params.product)),await u,o(),r.meta.title.en=t.state.current.name,r.meta.title.ru=t.state.current.name;const c=e.computed(()=>t.state.current),n={messages:{en:{},ru:{}}},{t:a}=d.useI18n(n),i=e.computed(()=>({title:t.state.current.name,description:a("description")}));return m.useMeta(i),e.onMounted(()=>{}),(h,M)=>(e.openBlock(),e.createElementBlock("div",q,[c.value?(e.openBlock(),e.createBlock(p.default,{key:0,product:c.value,user:_.state.user,class:"pos-relative"},null,8,["product","user"])):e.createCommentVNode("",!0),e.createVNode(l.default)]))}};exports.default=v;