s-platform-landing-section 0.1.10-alpha.2 → 0.1.10-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,43 +1,20 @@
1
- import React__default, { useRef, useState, useEffect, createElement, forwardRef, useImperativeHandle } from 'react';
2
- import { IoCartOutline, IoLocationOutline } from 'react-icons/io5';
3
- import { FaUserCircle, FaPhone, FaChevronLeft, FaChevronRight, FaArrowLeft, FaArrowRight as FaArrowRight$1, FaFacebookSquare, FaFacebookMessenger } from 'react-icons/fa';
1
+ import React__default, { useState, useEffect, useRef, createElement, forwardRef, useImperativeHandle, memo } from 'react';
2
+ import { IoCartOutline, IoLocationOutline, IoChevronBackOutline, IoChevronForwardOutline, IoCallOutline } from 'react-icons/io5';
3
+ import { FaUserCircle, FaPhone, FaChevronLeft, FaChevronRight, FaAngleUp, FaAngleDown, FaCheckCircle, FaArrowLeft, FaArrowRight as FaArrowRight$1, FaFacebookSquare, FaFacebookMessenger, FaFacebookF } from 'react-icons/fa';
4
4
  import { FiMenu } from 'react-icons/fi';
5
5
  import { RxCross2 } from 'react-icons/rx';
6
6
  import { PiHandbagSimpleLight } from 'react-icons/pi';
7
7
  import { CiSearch } from 'react-icons/ci';
8
8
  import { BsFilterLeft, BsCurrencyDollar } from 'react-icons/bs';
9
+ import { FaMinus, FaPlus, FaArrowsRotate, FaStar, FaRegStarHalfStroke, FaRegStar } from 'react-icons/fa6';
10
+ import { LuSearch } from 'react-icons/lu';
9
11
  import DatePicker from 'react-datepicker';
10
12
  import 'react-datepicker/dist/react-datepicker.css';
11
- import { FaArrowsRotate, FaStar, FaRegStarHalfStroke, FaRegStar } from 'react-icons/fa6';
12
- import 'react-icons/lu';
13
- import 'react-icons/io';
13
+ import { IoMdCheckmark, IoIosHeartEmpty } from 'react-icons/io';
14
14
  import { SiVisa, SiZalo } from 'react-icons/si';
15
15
  import { GoCreditCard } from 'react-icons/go';
16
16
 
17
- function _extends() {
18
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
19
- for (var e = 1; e < arguments.length; e++) {
20
- var t = arguments[e];
21
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
22
- }
23
- return n;
24
- }, _extends.apply(null, arguments);
25
- }
26
- function _objectDestructuringEmpty(t) {
27
- if (null == t) throw new TypeError("Cannot destructure " + t);
28
- }
29
- function _objectWithoutPropertiesLoose(r, e) {
30
- if (null == r) return {};
31
- var t = {};
32
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
33
- if (e.includes(n)) continue;
34
- t[n] = r[n];
35
- }
36
- return t;
37
- }
38
-
39
17
  var Button = function Button(props) {
40
- var _shopConfigStyle$colo;
41
18
  var _props$label = props.label,
42
19
  label = _props$label === void 0 ? "" : _props$label,
43
20
  _props$className = props.className,
@@ -47,21 +24,21 @@ var Button = function Button(props) {
47
24
  _props$shopConfigStyl = props.shopConfigStyle,
48
25
  shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
49
26
  _props$onClick = props.onClick,
50
- onClick = _props$onClick === void 0 ? function () {} : _props$onClick;
51
- var _className = "text-white font-medium rounded-lg text-sm px-4 py-2.5 " + ((shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.buttonClass) || "") + " " + className;
52
- var _style = _extends({
53
- backgroundColor: shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : (_shopConfigStyle$colo = shopConfigStyle.color) === null || _shopConfigStyle$colo === void 0 ? void 0 : _shopConfigStyle$colo.primary
54
- }, style);
27
+ onClick = _props$onClick === void 0 ? function () {} : _props$onClick,
28
+ _props$type = props.type,
29
+ type = _props$type === void 0 ? "primary" : _props$type;
30
+ var _className = type === "primary" ? "text-textButton bg-primary" : "text-primary bg-transparent border border-primary";
31
+ _className = "font-medium rounded-lg text-sm px-4 py-2.5 hover:text-textButton hover:bg-primary hover:opacity-80 " + _className + " " + ((shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.buttonClass) || "") + " " + className;
55
32
  return /*#__PURE__*/React__default.createElement("button", {
56
33
  type: "button",
57
34
  className: _className,
58
- style: _style,
35
+ style: style,
59
36
  onClick: onClick
60
37
  }, label);
61
38
  };
62
39
 
63
40
  var NavBar7 = function NavBar7(props) {
64
- var listRef = useRef(null);
41
+ var _routes$filter;
65
42
  var _useState = useState(false),
66
43
  isOpen = _useState[0],
67
44
  setIsOpen = _useState[1];
@@ -75,27 +52,8 @@ var NavBar7 = function NavBar7(props) {
75
52
  _props$userInfo = props.userInfo,
76
53
  userInfo = _props$userInfo === void 0 ? null : _props$userInfo,
77
54
  _props$cartItems = props.cartItems,
78
- cartItems = _props$cartItems === void 0 ? [] : _props$cartItems,
79
- _props$navToLogin = props.navToLogin,
80
- navToLogin = _props$navToLogin === void 0 ? function () {} : _props$navToLogin,
81
- _props$navToRegister = props.navToRegister,
82
- navToRegister = _props$navToRegister === void 0 ? function () {} : _props$navToRegister;
83
- var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
84
- _shopConfigStyle$colo2 = _shopConfigStyle$colo.primary,
85
- primary = _shopConfigStyle$colo2 === void 0 ? "#000" : _shopConfigStyle$colo2,
86
- _shopConfigStyle$colo3 = _shopConfigStyle$colo.textHeading,
87
- textHeading = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
88
- _shopConfigStyle$colo4 = _shopConfigStyle$colo.textBody,
89
- textBody = _shopConfigStyle$colo4 === void 0 ? "#000" : _shopConfigStyle$colo4,
90
- _shopConfigStyle$colo5 = _shopConfigStyle$colo.background,
91
- background = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5,
92
- _shopConfigStyle$colo6 = _shopConfigStyle$colo.bgSecondary,
93
- bgSecondary = _shopConfigStyle$colo6 === void 0 ? "#fff" : _shopConfigStyle$colo6,
94
- _shopConfigStyle$colo7 = _shopConfigStyle$colo.textButton,
95
- textButton = _shopConfigStyle$colo7 === void 0 ? "#fff" : _shopConfigStyle$colo7;
96
- console.log("NavBar7 routes", routes);
97
- console.log("NavBar7 userInfo", userInfo);
98
- console.log("NavBar7 cartItems", cartItems);
55
+ cartItems = _props$cartItems === void 0 ? [] : _props$cartItems;
56
+ console.log("cartItems", cartItems);
99
57
  var totalItem = cartItems.reduce(function (total, item) {
100
58
  return total + item.quantity;
101
59
  }, 0);
@@ -103,34 +61,21 @@ var NavBar7 = function NavBar7(props) {
103
61
  totalItem = "9+";
104
62
  }
105
63
  var cart = function cart() {
106
- return /*#__PURE__*/React__default.createElement("div", {
107
- className: "flex"
64
+ return /*#__PURE__*/React__default.createElement("a", {
65
+ href: "/carts"
108
66
  }, /*#__PURE__*/React__default.createElement("div", {
109
67
  className: "relative cursor-pointer"
110
68
  }, /*#__PURE__*/React__default.createElement(IoCartOutline, {
111
- style: {
112
- fontSize: "30px",
113
- color: primary
114
- }
69
+ className: "text-primary",
70
+ size: 30
115
71
  }), totalItem ? /*#__PURE__*/React__default.createElement("small", {
116
- className: "absolute aspect-square flex items-center bg-danger px-[2px] text-xs rounded-full",
117
- style: {
118
- color: textButton,
119
- top: 0,
120
- right: 0
121
- }
72
+ className: "absolute aspect-square flex items-center justify-center bg-danger w-5 text-xs rounded-full text-white -top-1 -right-1"
122
73
  }, totalItem) : null));
123
74
  };
124
75
  return /*#__PURE__*/React__default.createElement("div", {
125
- className: "w-full sticky top-0 shadow z-50",
126
- style: {
127
- background: background
128
- }
76
+ className: "w-full sticky top-0 shadow z-50 bg-background"
129
77
  }, /*#__PURE__*/React__default.createElement("div", {
130
- className: "hidden lg:flex gap-6 justify-between items-center py-2 px-4 xl:px-20",
131
- style: {
132
- color: textBody
133
- }
78
+ className: "hidden lg:flex gap-6 justify-between items-center py-2 px-4 xl:px-20"
134
79
  }, /*#__PURE__*/React__default.createElement("a", {
135
80
  href: "/",
136
81
  className: "flex items-center gap-2"
@@ -139,58 +84,46 @@ var NavBar7 = function NavBar7(props) {
139
84
  src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
140
85
  alt: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName
141
86
  }), /*#__PURE__*/React__default.createElement("h3", {
142
- className: "text-xl md:text-2xl whitespace-nowrap font-semibold",
143
- style: {
144
- color: primary
145
- }
87
+ className: "text-xl md:text-2xl whitespace-nowrap font-semibold text-primary"
146
88
  }, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName)), /*#__PURE__*/React__default.createElement("div", {
147
89
  className: "hidden lg:flex flex-1 items-center gap-4"
148
- }, routes === null || routes === void 0 ? void 0 : routes.map(function (route, index) {
90
+ }, routes === null || routes === void 0 ? void 0 : (_routes$filter = routes.filter(function (e) {
91
+ return e === null || e === void 0 ? void 0 : e.isShow;
92
+ })) === null || _routes$filter === void 0 ? void 0 : _routes$filter.map(function (route, index) {
149
93
  return /*#__PURE__*/React__default.createElement("a", {
150
94
  href: route === null || route === void 0 ? void 0 : route.route
151
95
  }, (section === null || section === void 0 ? void 0 : section.pageRoute) === (route === null || route === void 0 ? void 0 : route.name) ? /*#__PURE__*/React__default.createElement("div", {
152
- className: "py-1 border-b",
153
- style: {
154
- color: textHeading,
155
- borderColor: textHeading
156
- }
96
+ className: "py-1 border-b text-textHeading border-textHeading"
157
97
  }, route === null || route === void 0 ? void 0 : route.label) : /*#__PURE__*/React__default.createElement("div", {
158
98
  className: "py-1"
159
99
  }, route === null || route === void 0 ? void 0 : route.label));
160
- })), cart(), !userInfo ?
100
+ })), cart(), userInfo ?
161
101
  /*#__PURE__*/
162
102
  React__default.createElement("div", {
163
103
  className: "flex justify-center"
164
104
  }, /*#__PURE__*/React__default.createElement(FaUserCircle, {
165
- color: "#fff",
105
+ className: "text-bgSecondary",
166
106
  size: 48
167
107
  }), /*#__PURE__*/React__default.createElement("div", {
168
108
  className: "flex flex-col ml-2"
169
109
  }, /*#__PURE__*/React__default.createElement("label", null, "Xin ch\xE0o!"), /*#__PURE__*/React__default.createElement("label", {
170
110
  className: "font-semibold"
171
- }, userInfo === null || userInfo === void 0 ? void 0 : userInfo.name, "Nguyen Thanh Tung"))) :
111
+ }, userInfo === null || userInfo === void 0 ? void 0 : userInfo.name))) :
172
112
  /*#__PURE__*/
173
113
  React__default.createElement("div", {
174
114
  className: "flex gap-2"
115
+ }, /*#__PURE__*/React__default.createElement("a", {
116
+ href: "/account"
175
117
  }, /*#__PURE__*/React__default.createElement(Button, {
176
118
  label: "Đăng nhập",
177
- shopConfigStyle: shopConfigStyle,
178
- onClick: function onClick() {
179
- return navToLogin();
180
- }
181
- }), /*#__PURE__*/React__default.createElement(Button, {
119
+ shopConfigStyle: shopConfigStyle
120
+ })), /*#__PURE__*/React__default.createElement("a", {
121
+ href: "/account"
122
+ }, /*#__PURE__*/React__default.createElement(Button, {
182
123
  label: "Đăng ký",
183
124
  shopConfigStyle: shopConfigStyle,
184
- style: {
185
- backgroundColor: "transparent",
186
- borderColor: primary,
187
- color: primary
188
- },
189
- className: "border",
190
- onClick: function onClick() {
191
- return navToRegister();
192
- }
193
- }))), /*#__PURE__*/React__default.createElement("div", {
125
+ type: 'outline'
126
+ })))), /*#__PURE__*/React__default.createElement("div", {
194
127
  className: "relative lg:hidden flex gap-4 items-center px-4 py-2"
195
128
  }, /*#__PURE__*/React__default.createElement("a", {
196
129
  href: "/",
@@ -200,28 +133,22 @@ var NavBar7 = function NavBar7(props) {
200
133
  src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
201
134
  alt: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName
202
135
  }), /*#__PURE__*/React__default.createElement("h3", {
203
- className: "text-xl md:text-2xl font-semibold",
204
- style: {
205
- color: primary
206
- }
207
- }, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName)), /*#__PURE__*/React__default.createElement("button", {
136
+ className: "text-xl md:text-2xl font-semibold text-primary"
137
+ }, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName)), cart(), /*#__PURE__*/React__default.createElement("button", {
208
138
  type: "button",
209
139
  onClick: function onClick() {
210
140
  setIsOpen(true);
211
141
  }
212
142
  }, /*#__PURE__*/React__default.createElement(FiMenu, {
213
143
  size: 32,
214
- color: primary
144
+ className: "text-primary"
215
145
  })), isOpen ? /*#__PURE__*/React__default.createElement("div", {
216
146
  className: "absolute bg-[rgba(0,0,0,0.5)] h-screen w-full top-0 left-0 z-50 flex justify-end",
217
147
  onClick: function onClick() {
218
148
  setIsOpen(false);
219
149
  }
220
150
  }, /*#__PURE__*/React__default.createElement("div", {
221
- className: "h-full w-[80vw] max-w-[320px] p-4",
222
- style: {
223
- background: bgSecondary
224
- },
151
+ className: "h-full w-[80vw] max-w-[320px] p-4 bg-bgSecondary",
225
152
  onClick: function onClick(event) {
226
153
  return event.stopPropagation();
227
154
  }
@@ -236,12 +163,9 @@ var NavBar7 = function NavBar7(props) {
236
163
  return /*#__PURE__*/React__default.createElement("a", {
237
164
  href: route === null || route === void 0 ? void 0 : route.route
238
165
  }, /*#__PURE__*/React__default.createElement("div", {
239
- className: "py-2",
240
- style: (section === null || section === void 0 ? void 0 : section.pageRoute) === (route === null || route === void 0 ? void 0 : route.name) ? {
241
- color: textHeading
242
- } : null
166
+ className: "py-2 " + ((section === null || section === void 0 ? void 0 : section.pageRoute) === (route === null || route === void 0 ? void 0 : route.name) ? "text-textHeading" : "")
243
167
  }, route === null || route === void 0 ? void 0 : route.label));
244
- })))) : null, cart()));
168
+ })))) : null));
245
169
  };
246
170
 
247
171
  var SvgIcon = function SvgIcon(_ref) {
@@ -267,44 +191,20 @@ var SvgIcon = function SvgIcon(_ref) {
267
191
  }));
268
192
  };
269
193
  var SectionTitle1 = function SectionTitle1(props) {
270
- var _props$shopConfigStyl = props.shopConfigStyle,
271
- shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
272
- _props$data = props.data,
194
+ var _props$data = props.data,
273
195
  data = _props$data === void 0 ? {} : _props$data;
274
- var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
275
- _shopConfigStyle$colo2 = _shopConfigStyle$colo.textHeading,
276
- textHeading = _shopConfigStyle$colo2 === void 0 ? "#000" : _shopConfigStyle$colo2,
277
- _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
278
- secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
279
- _shopConfigStyle$colo4 = _shopConfigStyle$colo.textSecondary,
280
- textSecondary = _shopConfigStyle$colo4 === void 0 ? "#000" : _shopConfigStyle$colo4;
281
196
  return /*#__PURE__*/React__default.createElement("div", null, data !== null && data !== void 0 && data.sectionTitle ? /*#__PURE__*/React__default.createElement("div", {
282
- className: "text-center text-2xl md:text-4xl font-merienda font-semibold leading-relaxed",
283
- style: {
284
- color: textHeading
285
- }
197
+ className: "text-center text-2xl md:text-4xl font-headingFont font-semibold leading-relaxed text-textHeading"
286
198
  }, data === null || data === void 0 ? void 0 : data.sectionTitle) : null, /*#__PURE__*/React__default.createElement("div", {
287
199
  className: "flex items-center justify-center"
288
200
  }, /*#__PURE__*/React__default.createElement("div", {
289
- className: "w-32 h-0.5 rounded-full",
290
- style: {
291
- backgroundColor: secondary
292
- }
201
+ className: "w-32 h-0.5 rounded-full bg-secondary"
293
202
  }), /*#__PURE__*/React__default.createElement(SvgIcon, {
294
- className: "w-9 h-9",
295
- style: {
296
- color: secondary
297
- }
203
+ className: "w-9 h-9 text-secondary"
298
204
  }), /*#__PURE__*/React__default.createElement("div", {
299
- className: " w-32 h-0.5 rounded-full",
300
- style: {
301
- backgroundColor: secondary
302
- }
205
+ className: " w-32 h-0.5 rounded-full bg-secondary"
303
206
  })), data !== null && data !== void 0 && data.sectionDescription ? /*#__PURE__*/React__default.createElement("div", {
304
- className: "text-xl font-medium text-center leading-relaxed",
305
- style: {
306
- color: textSecondary
307
- }
207
+ className: "text-xl font-medium text-center leading-relaxed text-textSecondary"
308
208
  }, data === null || data === void 0 ? void 0 : data.sectionDescription) : null);
309
209
  };
310
210
 
@@ -323,12 +223,14 @@ var Hero10 = function Hero10(props) {
323
223
  }), /*#__PURE__*/React__default.createElement("div", {
324
224
  className: "relative w-full min-h-[540px] p-12 z-10 flex flex-col gap-6 items-center justify-center"
325
225
  }, /*#__PURE__*/React__default.createElement("div", {
326
- className: "text-3xl md:text-5xl text-white leading-[1.6] md:leading-[1.6] text-center " + (shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.headingFont)
226
+ className: "text-3xl md:text-5xl text-white leading-[1.6] md:leading-[1.6] text-center font-headingFont"
327
227
  }, sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$ = sectionData[0]) === null || _sectionData$ === void 0 ? void 0 : _sectionData$.title), sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$2 = sectionData[0]) === null || _sectionData$2 === void 0 ? void 0 : (_sectionData$2$button = _sectionData$2.buttons) === null || _sectionData$2$button === void 0 ? void 0 : _sectionData$2$button.map(function (button) {
328
- return /*#__PURE__*/React__default.createElement(Button, {
228
+ return /*#__PURE__*/React__default.createElement("a", {
229
+ href: (button === null || button === void 0 ? void 0 : button.route) || (button === null || button === void 0 ? void 0 : button.link) || "#"
230
+ }, /*#__PURE__*/React__default.createElement(Button, {
329
231
  label: button === null || button === void 0 ? void 0 : button.label,
330
232
  shopConfigStyle: shopConfigStyle
331
- });
233
+ }));
332
234
  })));
333
235
  };
334
236
 
@@ -346,6 +248,8 @@ var Dash = function Dash(props) {
346
248
  });
347
249
  };
348
250
 
251
+ var SECTION_DEFAULT_CLASS = "my-12 mx-4 xl:mx-20 bg-background";
252
+
349
253
  var Hero11 = function Hero11(props) {
350
254
  var _data$data;
351
255
  var _props$shopConfigStyl = props.shopConfigStyle,
@@ -356,14 +260,9 @@ var Hero11 = function Hero11(props) {
356
260
  SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
357
261
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
358
262
  _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
359
- secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
360
- _shopConfigStyle$colo5 = _shopConfigStyle$colo.background,
361
- background = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5;
263
+ secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
362
264
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
363
- className: "relative w-full py-12 px-4 xl:px-20",
364
- style: {
365
- backgroundColor: background
366
- }
265
+ className: "" + SECTION_DEFAULT_CLASS
367
266
  }, /*#__PURE__*/React__default.createElement(SectionTitle, {
368
267
  data: data,
369
268
  shopConfigStyle: shopConfigStyle
@@ -383,14 +282,8 @@ var Hero11 = function Hero11(props) {
383
282
 
384
283
  var Hero11$1 = function Hero11(props) {
385
284
  var _data$data, _data$data$, _data$data$$srcImages, _data$data2, _data$data2$, _data$data3, _data$data3$;
386
- var _props$shopConfigStyl = props.shopConfigStyle,
387
- shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
388
- _props$data = props.data,
285
+ var _props$data = props.data,
389
286
  data = _props$data === void 0 ? {} : _props$data;
390
- var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
391
- _shopConfigStyle$colo2 = _shopConfigStyle$colo.textHeading,
392
- textHeading = _shopConfigStyle$colo2 === void 0 ? "#000" : _shopConfigStyle$colo2;
393
- console.log("Hero11 data", data);
394
287
  return /*#__PURE__*/React__default.createElement("div", {
395
288
  className: "relative w-full bg-cover bg-center bg-no-repeat grid grid-cols-1 md:grid-cols-2",
396
289
  style: {
@@ -403,10 +296,7 @@ var Hero11$1 = function Hero11(props) {
403
296
  }), /*#__PURE__*/React__default.createElement("div", {
404
297
  className: "relative p-12 z-1"
405
298
  }, /*#__PURE__*/React__default.createElement("div", {
406
- className: "text-2xl md:text-4xl leading-[1.6] " + (shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.headingFont),
407
- style: {
408
- color: textHeading
409
- }
299
+ className: "text-2xl md:text-4xl leading-[1.6] font-headingFont text-textHeading"
410
300
  }, data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : (_data$data2$ = _data$data2[0]) === null || _data$data2$ === void 0 ? void 0 : _data$data2$.title), /*#__PURE__*/React__default.createElement("div", {
411
301
  className: "pt-6"
412
302
  }, data === null || data === void 0 ? void 0 : (_data$data3 = data.data) === null || _data$data3 === void 0 ? void 0 : (_data$data3$ = _data$data3[0]) === null || _data$data3$ === void 0 ? void 0 : _data$data3$.description)));
@@ -431,6 +321,57 @@ function _catch(body, recover) {
431
321
  return result;
432
322
  }
433
323
 
324
+ function _arrayLikeToArray(r, a) {
325
+ (null == a || a > r.length) && (a = r.length);
326
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
327
+ return n;
328
+ }
329
+ function _createForOfIteratorHelperLoose(r, e) {
330
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
331
+ if (t) return (t = t.call(r)).next.bind(t);
332
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
333
+ t && (r = t);
334
+ var o = 0;
335
+ return function () {
336
+ return o >= r.length ? {
337
+ done: !0
338
+ } : {
339
+ done: !1,
340
+ value: r[o++]
341
+ };
342
+ };
343
+ }
344
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
345
+ }
346
+ function _extends() {
347
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
348
+ for (var e = 1; e < arguments.length; e++) {
349
+ var t = arguments[e];
350
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
351
+ }
352
+ return n;
353
+ }, _extends.apply(null, arguments);
354
+ }
355
+ function _objectDestructuringEmpty(t) {
356
+ if (null == t) throw new TypeError("Cannot destructure " + t);
357
+ }
358
+ function _objectWithoutPropertiesLoose(r, e) {
359
+ if (null == r) return {};
360
+ var t = {};
361
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
362
+ if (e.includes(n)) continue;
363
+ t[n] = r[n];
364
+ }
365
+ return t;
366
+ }
367
+ function _unsupportedIterableToArray(r, a) {
368
+ if (r) {
369
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
370
+ var t = {}.toString.call(r).slice(8, -1);
371
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
372
+ }
373
+ }
374
+
434
375
  function bind(fn, thisArg) {
435
376
  return function wrap() {
436
377
  return fn.apply(thisArg, arguments);
@@ -1751,12 +1692,12 @@ const hasStandardBrowserWebWorkerEnv = (() => {
1751
1692
  const origin = hasBrowserEnv && window.location.href || 'http://localhost';
1752
1693
 
1753
1694
  var utils$1 = {
1754
- __proto__: null,
1755
- hasBrowserEnv: hasBrowserEnv,
1756
- hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
1757
- hasStandardBrowserEnv: hasStandardBrowserEnv,
1758
- navigator: _navigator,
1759
- origin: origin
1695
+ __proto__: null,
1696
+ hasBrowserEnv: hasBrowserEnv,
1697
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
1698
+ hasStandardBrowserEnv: hasStandardBrowserEnv,
1699
+ navigator: _navigator,
1700
+ origin: origin
1760
1701
  };
1761
1702
 
1762
1703
  var platform$1 = {
@@ -4895,8 +4836,8 @@ var callBound = function callBoundIntrinsic(name, allowMissing) {
4895
4836
  var _nodeResolve_empty = {};
4896
4837
 
4897
4838
  var _nodeResolve_empty$1 = {
4898
- __proto__: null,
4899
- 'default': _nodeResolve_empty
4839
+ __proto__: null,
4840
+ 'default': _nodeResolve_empty
4900
4841
  };
4901
4842
 
4902
4843
  var utilInspect = getCjsExportFromNamespace(_nodeResolve_empty$1);
@@ -6544,21 +6485,30 @@ var getProductListApi = function getProductListApi(shopId, params) {
6544
6485
  }
6545
6486
  });
6546
6487
  };
6488
+ var getDetailProductApi = function getDetailProductApi(shopId, productId) {
6489
+ return api({
6490
+ method: "get",
6491
+ url: "/products/" + productId + "/shops/" + shopId + "/info",
6492
+ headers: {
6493
+ shopId: shopId
6494
+ }
6495
+ });
6496
+ };
6547
6497
 
6548
6498
  var CategoryController = function CategoryController(props) {
6549
6499
  var shopConfig = props.shopConfig,
6550
- params = props.params;
6500
+ _props$types = props.types,
6501
+ types = _props$types === void 0 ? "" : _props$types;
6551
6502
  var _useState = useState([]),
6552
6503
  categories = _useState[0],
6553
6504
  setCategories = _useState[1];
6554
- var defaultParams = {};
6555
6505
  useEffect(function () {
6556
6506
  getCategoryList();
6557
6507
  }, []);
6558
6508
  var getCategoryList = function getCategoryList() {
6559
6509
  try {
6560
6510
  var _temp = _catch(function () {
6561
- return Promise.resolve(getShopCategoriesApi(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopId, _extends({}, defaultParams, params))).then(function (res) {
6511
+ return Promise.resolve(getShopCategoriesApi(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopId, types)).then(function (res) {
6562
6512
  var _res$data, _res$data$status;
6563
6513
  if ((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$status = _res$data.status) === null || _res$data$status === void 0 ? void 0 : _res$data$status.code) == 200) {
6564
6514
  var _res$data2;
@@ -6859,22 +6809,12 @@ var Features1 = function Features1(props) {
6859
6809
  _props$SectionTitle = props.SectionTitle,
6860
6810
  SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
6861
6811
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
6862
- _shopConfigStyle$colo2 = _shopConfigStyle$colo.primary,
6863
- primary = _shopConfigStyle$colo2 === void 0 ? "#000" : _shopConfigStyle$colo2,
6864
6812
  _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
6865
- secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
6866
- _shopConfigStyle$colo4 = _shopConfigStyle$colo.textBody,
6867
- textBody = _shopConfigStyle$colo4 === void 0 ? "#000" : _shopConfigStyle$colo4,
6868
- _shopConfigStyle$colo5 = _shopConfigStyle$colo.background,
6869
- background = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5;
6813
+ secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
6870
6814
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
6871
- className: "relative w-full py-12 px-4 xl:px-20",
6872
- style: {
6873
- backgroundColor: background
6874
- }
6815
+ className: SECTION_DEFAULT_CLASS + " relative"
6875
6816
  }, /*#__PURE__*/React__default.createElement(SectionTitle, {
6876
- data: data,
6877
- shopConfigStyle: shopConfigStyle
6817
+ data: data
6878
6818
  }), /*#__PURE__*/React__default.createElement("div", {
6879
6819
  className: "mt-6 grid grid-cols-3 gap-4 md:gap-8"
6880
6820
  }, data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.map(function (it, index) {
@@ -6884,35 +6824,20 @@ var Features1 = function Features1(props) {
6884
6824
  }, /*#__PURE__*/React__default.createElement("div", {
6885
6825
  className: "relative w-40 h-24 flex items-center justify-center m-auto md:m-0"
6886
6826
  }, /*#__PURE__*/React__default.createElement("div", {
6887
- className: "absolute w-40 h-24 rounded-2xl z-10",
6888
- style: {
6889
- backgroundColor: primary
6890
- }
6827
+ className: "absolute w-40 h-24 rounded-2xl z-10 bg-primary"
6891
6828
  }), /*#__PURE__*/React__default.createElement("div", {
6892
- className: "absolute w-24 h-16 rounded-2xl -right-2 -top-2 z-0",
6893
- style: {
6894
- backgroundColor: secondary
6895
- }
6829
+ className: "absolute w-24 h-16 rounded-2xl -right-2 -top-2 z-0 bg-secondary"
6896
6830
  }), /*#__PURE__*/React__default.createElement("div", {
6897
6831
  className: "h-16 m-auto bg-center w-16 bg-cover bg-no-repeat z-20",
6898
6832
  style: {
6899
6833
  backgroundImage: "url(" + it.srcImage + ")"
6900
6834
  }
6901
6835
  })), /*#__PURE__*/React__default.createElement("p", {
6902
- className: "mx-auto md:mt-3 md:mx-0 text-xl py-2 font-medium w-fit rounded-lg",
6903
- style: {
6904
- color: textBody
6905
- }
6836
+ className: "mx-auto md:mt-3 md:mx-0 text-xl py-2 font-medium w-fit rounded-lg"
6906
6837
  }, it.title), /*#__PURE__*/React__default.createElement("div", {
6907
- className: "mx-auto md:mx-0 mb-2 w-28 h-2px rounded-full",
6908
- style: {
6909
- backgroundColor: secondary
6910
- }
6838
+ className: "mx-auto md:mx-0 mb-2 w-28 h-2px rounded-full bg-secondary"
6911
6839
  }), /*#__PURE__*/React__default.createElement("p", {
6912
- className: "text-base mx-auto md:mx-0 text-center md:text-start",
6913
- style: {
6914
- color: textBody
6915
- }
6840
+ className: "text-base mx-auto md:mx-0 text-center md:text-start"
6916
6841
  }, it.description));
6917
6842
  }))), /*#__PURE__*/React__default.createElement(Dash, {
6918
6843
  color: secondary
@@ -6920,43 +6845,20 @@ var Features1 = function Features1(props) {
6920
6845
  };
6921
6846
 
6922
6847
  var Features2 = function Features2(props) {
6923
- var data = props.data,
6924
- shopConfigStyle = props.shopConfigStyle;
6925
- var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
6926
- _shopConfigStyle$colo2 = _shopConfigStyle$colo.primary,
6927
- primary = _shopConfigStyle$colo2 === void 0 ? "#000" : _shopConfigStyle$colo2,
6928
- _shopConfigStyle$colo3 = _shopConfigStyle$colo.textBody,
6929
- textBody = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
6930
- _shopConfigStyle$colo4 = _shopConfigStyle$colo.background,
6931
- background = _shopConfigStyle$colo4 === void 0 ? "#fff" : _shopConfigStyle$colo4,
6932
- _shopConfigStyle$colo5 = _shopConfigStyle$colo.bgSecondary,
6933
- bgSecondary = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5;
6848
+ var data = props.data;
6934
6849
  var sectionData = data === null || data === void 0 ? void 0 : data.data;
6935
6850
  return /*#__PURE__*/React__default.createElement("div", {
6936
- className: "w-full pt-10 px-4 xl:px-20",
6937
- style: {
6938
- background: background,
6939
- color: textBody
6940
- }
6851
+ className: "" + SECTION_DEFAULT_CLASS
6941
6852
  }, /*#__PURE__*/React__default.createElement("div", {
6942
- className: "p-6 grid grid-cols-4 gap-8 rounded-xl",
6943
- style: {
6944
- background: bgSecondary
6945
- }
6853
+ className: "p-6 grid grid-cols-4 gap-8 rounded-xl bg-bgSecondary"
6946
6854
  }, sectionData && sectionData.length > 0 && sectionData.map(function (item, index) {
6947
6855
  return /*#__PURE__*/React__default.createElement("div", {
6948
6856
  className: "flex flex-col gap-2 items-center text-sm lg:text-lg font-semibold text-center",
6949
- key: "dfgg-" + index,
6950
- style: {
6951
- color: textBody
6952
- }
6857
+ key: "dfgg-" + index
6953
6858
  }, /*#__PURE__*/React__default.createElement("img", {
6954
6859
  src: item === null || item === void 0 ? void 0 : item.svgImage,
6955
- className: "w-12 md:w-16 lg:w-20 xl:w-24",
6956
- alt: "logo",
6957
- style: {
6958
- color: primary
6959
- }
6860
+ className: "w-12 md:w-16 lg:w-20 xl:w-24 text-primary",
6861
+ alt: "logo"
6960
6862
  }), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.title));
6961
6863
  })));
6962
6864
  };
@@ -7008,6 +6910,12 @@ var ProductController = function ProductController(props) {
7008
6910
  var _useState = useState([]),
7009
6911
  products = _useState[0],
7010
6912
  setProducts = _useState[1];
6913
+ var _useState2 = useState(true),
6914
+ loading = _useState2[0],
6915
+ setLoading = _useState2[1];
6916
+ var _useState3 = useState(),
6917
+ page = _useState3[0],
6918
+ setPage = _useState3[1];
7011
6919
  var defaultParams = {
7012
6920
  page: 0,
7013
6921
  size: 8,
@@ -7021,12 +6929,18 @@ var ProductController = function ProductController(props) {
7021
6929
  var getProductList = function getProductList() {
7022
6930
  try {
7023
6931
  var _temp = _catch(function () {
7024
- return Promise.resolve(getProductListApi(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopId, _extends({}, defaultParams, params))).then(function (res) {
6932
+ setLoading(true);
6933
+ var filterParams = _extends({}, defaultParams, params);
6934
+ console.log("filterParams params", params);
6935
+ console.log("filterParams", filterParams);
6936
+ return Promise.resolve(getProductListApi(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopId, filterParams)).then(function (res) {
7025
6937
  var _res$data, _res$data$status;
7026
6938
  if ((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$status = _res$data.status) === null || _res$data$status === void 0 ? void 0 : _res$data$status.code) == 200) {
7027
- var _res$data2;
6939
+ var _res$data2, _res$data3;
7028
6940
  setProducts(res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.data);
6941
+ setPage(res === null || res === void 0 ? void 0 : (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.page);
7029
6942
  }
6943
+ setLoading(false);
7030
6944
  });
7031
6945
  }, function (e) {
7032
6946
  console.log(e);
@@ -7037,7 +6951,9 @@ var ProductController = function ProductController(props) {
7037
6951
  }
7038
6952
  };
7039
6953
  return {
7040
- products: products
6954
+ products: products,
6955
+ loading: loading,
6956
+ page: page
7041
6957
  };
7042
6958
  };
7043
6959
 
@@ -7110,75 +7026,1083 @@ var ProductImage = function ProductImage(props) {
7110
7026
  });
7111
7027
  };
7112
7028
 
7113
- var Treatments1 = function Treatments1(props) {
7114
- var _props$shopConfigStyl = props.shopConfigStyle,
7115
- shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
7116
- _props$data = props.data,
7117
- data = _props$data === void 0 ? {} : _props$data,
7118
- _props$SectionTitle = props.SectionTitle,
7119
- SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
7120
- var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
7121
- _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
7122
- secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
7123
- _shopConfigStyle$colo4 = _shopConfigStyle$colo.textBody,
7124
- textBody = _shopConfigStyle$colo4 === void 0 ? "#000" : _shopConfigStyle$colo4,
7125
- _shopConfigStyle$colo5 = _shopConfigStyle$colo.background,
7126
- background = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5;
7127
- var _useState = useState({
7128
- size: 1
7129
- }),
7130
- params = _useState[0];
7131
- var _ProductController = ProductController(_extends({}, props, {
7132
- params: params
7133
- })),
7134
- _ProductController$pr = _ProductController.products,
7135
- products = _ProductController$pr === void 0 ? [] : _ProductController$pr;
7136
- console.log("Treatments1 products 1", products);
7137
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
7138
- className: "relative w-full py-12 px-4 xl:px-20",
7139
- style: {
7140
- backgroundColor: background
7141
- }
7142
- }, /*#__PURE__*/React__default.createElement(SectionTitle, {
7143
- data: data,
7144
- shopConfigStyle: shopConfigStyle
7145
- }), products === null || products === void 0 ? void 0 : products.map(function (product, index) {
7146
- var _product$productInfo, _product$productInfo2;
7147
- return /*#__PURE__*/React__default.createElement("div", {
7148
- className: "grid grid-cols-1 md:grid-cols-2 gap-6 mt-12",
7149
- key: index
7150
- }, index % 2 ? null : /*#__PURE__*/React__default.createElement(ProductImage, {
7151
- product: product === null || product === void 0 ? void 0 : product.productInfo,
7152
- className: "aspect-video rounded-2xl"
7153
- }), /*#__PURE__*/React__default.createElement("div", {
7154
- className: "" + (index % 2 ? "text-right" : "text-left")
7155
- }, /*#__PURE__*/React__default.createElement("div", {
7156
- className: "font-medium text-2xl",
7157
- style: {
7158
- color: textBody
7159
- }
7160
- }, product === null || product === void 0 ? void 0 : (_product$productInfo = product.productInfo) === null || _product$productInfo === void 0 ? void 0 : _product$productInfo.productName), /*#__PURE__*/React__default.createElement("div", {
7161
- className: "mt-4",
7162
- style: {
7163
- color: textBody
7164
- },
7165
- dangerouslySetInnerHTML: {
7166
- __html: product === null || product === void 0 ? void 0 : (_product$productInfo2 = product.productInfo) === null || _product$productInfo2 === void 0 ? void 0 : _product$productInfo2.description
7029
+ var ModalNotification = function ModalNotification(props) {
7030
+ var modalRef = useRef(null);
7031
+ var onClose = props.onClose,
7032
+ onCloseFormBooking = props.onCloseFormBooking;
7033
+ var handleClickOutside = function handleClickOutside(event) {
7034
+ if (modalRef.current && !modalRef.current.contains(event.target)) {
7035
+ onClose();
7036
+ if (onCloseFormBooking && typeof onCloseFormBooking === 'function') {
7037
+ console.log("đóng nhá");
7038
+ onCloseFormBooking();
7167
7039
  }
7168
- }), /*#__PURE__*/React__default.createElement(Button, {
7169
- label: "Đặt lịch ngay",
7170
- shopConfigStyle: shopConfigStyle,
7171
- className: "mt-4"
7172
- })), index % 2 ? /*#__PURE__*/React__default.createElement(ProductImage, {
7173
- product: product === null || product === void 0 ? void 0 : product.productInfo,
7174
- className: "aspect-video rounded-2xl"
7175
- }) : null);
7176
- })), /*#__PURE__*/React__default.createElement(Dash, {
7177
- color: secondary
7178
- }));
7040
+ }
7041
+ };
7042
+ useEffect(function () {
7043
+ document.addEventListener('click', handleClickOutside);
7044
+ return function () {
7045
+ document.removeEventListener('click', handleClickOutside);
7046
+ };
7047
+ }, []);
7048
+ return /*#__PURE__*/React__default.createElement("div", {
7049
+ className: "fixed inset-0 bg-black flex items-center justify-center bg-opacity-50 z-50 "
7050
+ }, /*#__PURE__*/React__default.createElement("div", {
7051
+ className: " flex items-center justify-center relative bg-red",
7052
+ ref: modalRef
7053
+ }, props === null || props === void 0 ? void 0 : props.children, /*#__PURE__*/React__default.createElement("button", {
7054
+ className: "absolute top-4 right-4",
7055
+ onClick: onClose
7056
+ }, /*#__PURE__*/React__default.createElement(RxCross2, null))));
7179
7057
  };
7180
7058
 
7181
- var _path$1;
7059
+ var getEmployeeListApi = function getEmployeeListApi(shopId) {
7060
+ return api({
7061
+ method: "get",
7062
+ url: "/chain-employment-profile/filter-employ-by-customer",
7063
+ params: {
7064
+ shopIds: shopId
7065
+ },
7066
+ headers: {
7067
+ shopId: shopId
7068
+ }
7069
+ });
7070
+ };
7071
+
7072
+ var EmployeeController = function EmployeeController(props) {
7073
+ var _props$isAutoGetList = props.isAutoGetList,
7074
+ isAutoGetList = _props$isAutoGetList === void 0 ? true : _props$isAutoGetList,
7075
+ shopConfig = props.shopConfig;
7076
+ var _useState = useState([]),
7077
+ listEmployment = _useState[0],
7078
+ setListEmployment = _useState[1];
7079
+ useEffect(function () {
7080
+ if (isAutoGetList) {
7081
+ getListEmployee();
7082
+ }
7083
+ }, [isAutoGetList]);
7084
+ var getListEmployee = function getListEmployee() {
7085
+ try {
7086
+ return Promise.resolve(_catch(function () {
7087
+ return Promise.resolve(getEmployeeListApi(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopId)).then(function (res) {
7088
+ var _res$data, _res$data$status;
7089
+ if ((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$status = _res$data.status) === null || _res$data$status === void 0 ? void 0 : _res$data$status.code) == 200) {
7090
+ var _res$data2;
7091
+ setListEmployment((res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.data) || []);
7092
+ }
7093
+ return res;
7094
+ });
7095
+ }, function (e) {
7096
+ console.log(e);
7097
+ }));
7098
+ } catch (e) {
7099
+ return Promise.reject(e);
7100
+ }
7101
+ };
7102
+ return {
7103
+ listEmployment: listEmployment,
7104
+ getListEmployee: getListEmployee
7105
+ };
7106
+ };
7107
+
7108
+ var createSpaScheduleApi = function createSpaScheduleApi(shopId, data) {
7109
+ return api({
7110
+ method: "post",
7111
+ url: "/spa-schedule/customer/create",
7112
+ data: data,
7113
+ headers: {
7114
+ shopId: shopId
7115
+ }
7116
+ });
7117
+ };
7118
+
7119
+ var _excluded = ["productName"];
7120
+ var BookingController = function BookingController(props) {
7121
+ _objectDestructuringEmpty(props);
7122
+ var createSchedule = function createSchedule(customerName, customerPhone, scheduleDate, services, shopId) {
7123
+ try {
7124
+ return Promise.resolve(_catch(function () {
7125
+ var data = {
7126
+ appId: "SSPA",
7127
+ customerName: customerName,
7128
+ customerPhone: customerPhone.replace("+", ""),
7129
+ isSellService: true,
7130
+ scheduleDate: new Date(scheduleDate).getTime(),
7131
+ services: services === null || services === void 0 ? void 0 : services.map(function (_ref) {
7132
+ var productName = _ref.productName,
7133
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
7134
+ return rest;
7135
+ }),
7136
+ shopId: shopId
7137
+ };
7138
+ return Promise.resolve(createSpaScheduleApi(shopId, data));
7139
+ }, function (e) {
7140
+ console.log(e);
7141
+ }));
7142
+ } catch (e) {
7143
+ return Promise.reject(e);
7144
+ }
7145
+ };
7146
+ return {
7147
+ createSchedule: createSchedule
7148
+ };
7149
+ };
7150
+
7151
+ var Input = forwardRef(function (props, ref) {
7152
+ var _props$label = props.label,
7153
+ label = _props$label === void 0 ? "" : _props$label,
7154
+ _props$placeholder = props.placeholder,
7155
+ placeholder = _props$placeholder === void 0 ? "" : _props$placeholder,
7156
+ _props$className = props.className,
7157
+ className = _props$className === void 0 ? "" : _props$className,
7158
+ _props$inputClassName = props.inputClassName,
7159
+ inputClassName = _props$inputClassName === void 0 ? "" : _props$inputClassName,
7160
+ _props$wrapClassName = props.wrapClassName,
7161
+ wrapClassName = _props$wrapClassName === void 0 ? "" : _props$wrapClassName,
7162
+ _props$labelClassName = props.labelClassName,
7163
+ labelClassName = _props$labelClassName === void 0 ? "" : _props$labelClassName,
7164
+ _props$name = props.name,
7165
+ name = _props$name === void 0 ? "" : _props$name,
7166
+ _props$onChange = props.onChange,
7167
+ onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
7168
+ _props$defaultValue = props.defaultValue,
7169
+ defaultValue = _props$defaultValue === void 0 ? "" : _props$defaultValue,
7170
+ _props$type = props.type,
7171
+ type = _props$type === void 0 ? "text" : _props$type,
7172
+ _props$rules = props.rules,
7173
+ rules = _props$rules === void 0 ? [] : _props$rules,
7174
+ _props$isQuantity = props.isQuantity,
7175
+ isQuantity = _props$isQuantity === void 0 ? false : _props$isQuantity,
7176
+ _props$min = props.min,
7177
+ min = _props$min === void 0 ? 0 : _props$min,
7178
+ _props$max = props.max,
7179
+ max = _props$max === void 0 ? null : _props$max;
7180
+ var _useState = useState(defaultValue),
7181
+ value = _useState[0],
7182
+ _setValue = _useState[1];
7183
+ var _useState2 = useState(""),
7184
+ error = _useState2[0],
7185
+ _setError = _useState2[1];
7186
+ var refInput = useRef();
7187
+ useImperativeHandle(ref, function () {
7188
+ return {
7189
+ validateData: function validateData() {
7190
+ return _validateData();
7191
+ },
7192
+ setValue: function setValue(text) {
7193
+ return _setValue(text);
7194
+ },
7195
+ getValue: function getValue() {
7196
+ return value;
7197
+ },
7198
+ setError: function setError(err) {
7199
+ return _setError(err);
7200
+ }
7201
+ };
7202
+ });
7203
+ var _validateData = function _validateData() {
7204
+ var count = 0;
7205
+ for (var _iterator = _createForOfIteratorHelperLoose(rules), _step; !(_step = _iterator()).done;) {
7206
+ var _e$pattern;
7207
+ var e = _step.value;
7208
+ if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && value === '') {
7209
+ _setError(e === null || e === void 0 ? void 0 : e.message);
7210
+ count++;
7211
+ break;
7212
+ } else if ((e === null || e === void 0 ? void 0 : e.type) === 'pattern' && !(e !== null && e !== void 0 && (_e$pattern = e.pattern) !== null && _e$pattern !== void 0 && _e$pattern.test(value))) {
7213
+ _setError(e === null || e === void 0 ? void 0 : e.message);
7214
+ count++;
7215
+ break;
7216
+ }
7217
+ }
7218
+ if (count) {
7219
+ return false;
7220
+ } else {
7221
+ _setError('');
7222
+ return true;
7223
+ }
7224
+ };
7225
+ var handleOnChange = function handleOnChange(event) {
7226
+ var value = event.target.value;
7227
+ if (isQuantity) {
7228
+ value = parseInt(value) || 1;
7229
+ }
7230
+ _setValue(value);
7231
+ onChange === null || onChange === void 0 ? void 0 : onChange(value);
7232
+ };
7233
+ var changeQuantity = function changeQuantity(quantity) {
7234
+ var newValue = parseInt(value) + quantity;
7235
+ if (newValue > min && (max === null || newValue <= max)) {
7236
+ _setValue(newValue);
7237
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
7238
+ }
7239
+ };
7240
+ var _className = "h-10 py-1 px-2 border border-stroke rounded focus:outline-none focus:ring-0 " + className;
7241
+ var _inputClassName = (isQuantity ? "text-center w-12" : "") + " " + inputClassName;
7242
+ var required = !!(rules !== null && rules !== void 0 && rules.find(function (e) {
7243
+ return (e === null || e === void 0 ? void 0 : e.type) === "required";
7244
+ }));
7245
+ var labelRequired = required ? /*#__PURE__*/React__default.createElement("span", {
7246
+ className: "text-danger"
7247
+ }, " *") : null;
7248
+ return /*#__PURE__*/React__default.createElement("div", {
7249
+ className: wrapClassName
7250
+ }, label ? /*#__PURE__*/React__default.createElement("div", {
7251
+ className: "mb-1 " + labelClassName
7252
+ }, label, labelRequired) : null, /*#__PURE__*/React__default.createElement("div", {
7253
+ className: "flex gap-2 " + _className
7254
+ }, isQuantity ? /*#__PURE__*/React__default.createElement("button", {
7255
+ onClick: function onClick() {
7256
+ return changeQuantity(-1);
7257
+ }
7258
+ }, /*#__PURE__*/React__default.createElement(FaMinus, null)) : null, /*#__PURE__*/React__default.createElement("input", {
7259
+ type: type,
7260
+ name: name,
7261
+ value: value,
7262
+ placeholder: placeholder,
7263
+ onChange: handleOnChange,
7264
+ required: required,
7265
+ className: _inputClassName,
7266
+ ref: refInput
7267
+ }), isQuantity ? /*#__PURE__*/React__default.createElement("button", {
7268
+ onClick: function onClick() {
7269
+ return changeQuantity(1);
7270
+ }
7271
+ }, /*#__PURE__*/React__default.createElement(FaPlus, null)) : null), error ? /*#__PURE__*/React__default.createElement("div", {
7272
+ className: "text-danger"
7273
+ }, error) : null);
7274
+ });
7275
+
7276
+ var Select = forwardRef(function (props, ref) {
7277
+ var _Object$keys;
7278
+ var _useState = useState(false),
7279
+ isOpen = _useState[0],
7280
+ setIsOpen = _useState[1];
7281
+ var _useState2 = useState([]),
7282
+ listOptions = _useState2[0],
7283
+ setListOptions = _useState2[1];
7284
+ var selectRef = useRef(null);
7285
+ var _useState3 = useState(""),
7286
+ error = _useState3[0],
7287
+ _setError = _useState3[1];
7288
+ var _props$label = props.label,
7289
+ label = _props$label === void 0 ? "" : _props$label,
7290
+ _props$placeholder = props.placeholder,
7291
+ placeholder = _props$placeholder === void 0 ? "" : _props$placeholder,
7292
+ _props$className = props.className,
7293
+ className = _props$className === void 0 ? "" : _props$className,
7294
+ _props$rules = props.rules,
7295
+ rules = _props$rules === void 0 ? [] : _props$rules,
7296
+ _props$options = props.options,
7297
+ options = _props$options === void 0 ? [] : _props$options,
7298
+ _props$value = props.value,
7299
+ value = _props$value === void 0 ? [] : _props$value,
7300
+ _props$renderItem = props.renderItem,
7301
+ renderItem = _props$renderItem === void 0 ? function () {} : _props$renderItem,
7302
+ displayItem = props.displayItem,
7303
+ searchOption = props.searchOption,
7304
+ handleSearchOption = props.handleSearchOption;
7305
+ var dropdownRef = useRef(null);
7306
+ var _useState4 = useState('bottom'),
7307
+ dropdownPosition = _useState4[0],
7308
+ setDropdownPosition = _useState4[1];
7309
+ useEffect(function () {
7310
+ var updateDropdownPosition = function updateDropdownPosition() {
7311
+ if (selectRef.current && dropdownRef.current) {
7312
+ var selectRect = selectRef.current.getBoundingClientRect();
7313
+ var spaceBelow = window.innerHeight - selectRect.bottom;
7314
+ var spaceAbove = selectRect.top;
7315
+ if (spaceBelow < spaceAbove) {
7316
+ setDropdownPosition('top');
7317
+ } else {
7318
+ setDropdownPosition('bottom');
7319
+ }
7320
+ }
7321
+ };
7322
+ if (isOpen) {
7323
+ updateDropdownPosition();
7324
+ window.addEventListener('resize', updateDropdownPosition);
7325
+ }
7326
+ return function () {
7327
+ window.removeEventListener('resize', updateDropdownPosition);
7328
+ };
7329
+ }, [isOpen]);
7330
+ var handleClickOutside = function handleClickOutside(event) {
7331
+ if (selectRef.current && !selectRef.current.contains(event.target)) {
7332
+ setIsOpen(false);
7333
+ }
7334
+ };
7335
+ useEffect(function () {
7336
+ setListOptions(options);
7337
+ document.addEventListener('click', handleClickOutside);
7338
+ return function () {
7339
+ document.removeEventListener('click', handleClickOutside);
7340
+ };
7341
+ }, [options]);
7342
+ useImperativeHandle(ref, function () {
7343
+ return {
7344
+ validateData: function validateData() {
7345
+ return _validateData();
7346
+ },
7347
+ setError: function setError(err) {
7348
+ return _setError(err);
7349
+ }
7350
+ };
7351
+ });
7352
+ var _validateData = function _validateData() {
7353
+ var count = 0;
7354
+ for (var _iterator = _createForOfIteratorHelperLoose(rules), _step; !(_step = _iterator()).done;) {
7355
+ var _e$pattern;
7356
+ var e = _step.value;
7357
+ if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && (value === null || value === void 0 ? void 0 : value.length) <= 0) {
7358
+ console.log("chưa chọn gì");
7359
+ _setError(e === null || e === void 0 ? void 0 : e.message);
7360
+ count++;
7361
+ break;
7362
+ } else if ((e === null || e === void 0 ? void 0 : e.type) === 'pattern' && !(e !== null && e !== void 0 && (_e$pattern = e.pattern) !== null && _e$pattern !== void 0 && _e$pattern.test(value))) {
7363
+ _setError(e === null || e === void 0 ? void 0 : e.message);
7364
+ count++;
7365
+ break;
7366
+ }
7367
+ }
7368
+ if (count) {
7369
+ return false;
7370
+ } else {
7371
+ _setError('');
7372
+ return true;
7373
+ }
7374
+ };
7375
+ var handleSearch = function handleSearch(e) {
7376
+ var listOptions = handleSearchOption(e);
7377
+ setListOptions(listOptions);
7378
+ };
7379
+ var required = !!(rules !== null && rules !== void 0 && rules.find(function (e) {
7380
+ return (e === null || e === void 0 ? void 0 : e.type) === "required";
7381
+ }));
7382
+ var labelRequired = required ? /*#__PURE__*/React__default.createElement("span", {
7383
+ className: "text-danger"
7384
+ }, " *") : null;
7385
+ return /*#__PURE__*/React__default.createElement("div", {
7386
+ ref: selectRef,
7387
+ className: className + " relative "
7388
+ }, label ? /*#__PURE__*/React__default.createElement("div", {
7389
+ className: "mb-1"
7390
+ }, label, labelRequired) : null, /*#__PURE__*/React__default.createElement("div", {
7391
+ className: className + " bg-white rounded-lg"
7392
+ }, /*#__PURE__*/React__default.createElement("button", {
7393
+ className: "w-full h-10 bg-transparent flex justify-between items-center px-3 py-2",
7394
+ onClick: function onClick() {
7395
+ setIsOpen(!isOpen);
7396
+ }
7397
+ }, displayItem && (Object === null || Object === void 0 ? void 0 : (_Object$keys = Object.keys(value)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0 && typeof displayItem === "function" ? displayItem(value) : /*#__PURE__*/React__default.createElement("div", {
7398
+ className: "flex justify-between items-center w-full"
7399
+ }, /*#__PURE__*/React__default.createElement("div", {
7400
+ className: "text-gray3 line-clamp-1"
7401
+ }, placeholder), /*#__PURE__*/React__default.createElement("div", {
7402
+ className: "ms-1"
7403
+ }, /*#__PURE__*/React__default.createElement(FaAngleUp, {
7404
+ className: "text-xs"
7405
+ }), /*#__PURE__*/React__default.createElement(FaAngleDown, {
7406
+ className: "text-xs"
7407
+ })))), isOpen ? /*#__PURE__*/React__default.createElement("div", {
7408
+ ref: dropdownRef,
7409
+ style: {
7410
+ background: "#FFFFFF"
7411
+ },
7412
+ className: className + " absolute p-1 my-2 rounded-2xl w-full z-50 border " + (dropdownPosition === 'top' ? 'bottom-full mb-2' : 'top-full mt-2')
7413
+ }, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
7414
+ className: "px-3 flex items-center border-b-[1px]"
7415
+ }, /*#__PURE__*/React__default.createElement(LuSearch, {
7416
+ className: "inline text-gray3 me-2"
7417
+ }), /*#__PURE__*/React__default.createElement("input", {
7418
+ type: "text",
7419
+ className: "py-2 w-full border-0 focus:outline-none focus:ring-0",
7420
+ placeholder: "T\xECm ki\u1EBFm",
7421
+ value: searchOption,
7422
+ onChange: function onChange(e) {
7423
+ handleSearch(e);
7424
+ }
7425
+ })), /*#__PURE__*/React__default.createElement("div", null, listOptions && listOptions.length > 0 ? listOptions.map(function (item, index) {
7426
+ return renderItem(item, index);
7427
+ }) : /*#__PURE__*/React__default.createElement("div", {
7428
+ className: "py-6 text-center"
7429
+ }, "Kh\xF4ng c\xF3 k\u1EBFt qu\u1EA3")))) : null), error ? /*#__PURE__*/React__default.createElement("div", {
7430
+ className: "text-danger"
7431
+ }, error) : null);
7432
+ });
7433
+ var Select$1 = memo(Select);
7434
+
7435
+ var DateTimePicker = forwardRef(function (props, ref) {
7436
+ var _props$label = props.label,
7437
+ label = _props$label === void 0 ? "" : _props$label,
7438
+ _props$className = props.className,
7439
+ className = _props$className === void 0 ? "" : _props$className,
7440
+ _props$defaultValue = props.defaultValue,
7441
+ defaultValue = _props$defaultValue === void 0 ? new Date() : _props$defaultValue,
7442
+ rules = props.rules;
7443
+ var _useState = useState(defaultValue),
7444
+ value = _useState[0],
7445
+ _setValue = _useState[1];
7446
+ var _useState2 = useState(""),
7447
+ error = _useState2[0],
7448
+ _setError = _useState2[1];
7449
+ var _className = "h-10 flex items-center py-1 px-2 border border-stroke rounded bg-white cursor-pointer " + className;
7450
+ var CustomInput = forwardRef(function (_ref, ref) {
7451
+ var value = _ref.value,
7452
+ onClick = _ref.onClick,
7453
+ className = _ref.className;
7454
+ return /*#__PURE__*/React__default.createElement("div", {
7455
+ className: className,
7456
+ onClick: onClick,
7457
+ ref: ref
7458
+ }, value);
7459
+ });
7460
+ useImperativeHandle(ref, function () {
7461
+ return {
7462
+ validateData: function validateData() {
7463
+ return _validateData();
7464
+ },
7465
+ setValue: function setValue(text) {
7466
+ return _setValue(text);
7467
+ },
7468
+ getValue: function getValue() {
7469
+ return value;
7470
+ },
7471
+ setError: function setError(err) {
7472
+ return _setError(err);
7473
+ }
7474
+ };
7475
+ });
7476
+ var _validateData = function _validateData() {
7477
+ var count = 0;
7478
+ rules.forEach(function (e) {
7479
+ var _e$pattern;
7480
+ if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && value === '') {
7481
+ _setError(e === null || e === void 0 ? void 0 : e.message);
7482
+ count++;
7483
+ return false;
7484
+ } else if ((e === null || e === void 0 ? void 0 : e.type) === 'pattern' && !(e !== null && e !== void 0 && (_e$pattern = e.pattern) !== null && _e$pattern !== void 0 && _e$pattern.test(value))) {
7485
+ _setError(e === null || e === void 0 ? void 0 : e.message);
7486
+ count++;
7487
+ return false;
7488
+ }
7489
+ });
7490
+ if (count) {
7491
+ return false;
7492
+ } else {
7493
+ _setError('');
7494
+ return true;
7495
+ }
7496
+ };
7497
+ var required = !!(rules !== null && rules !== void 0 && rules.find(function (e) {
7498
+ return (e === null || e === void 0 ? void 0 : e.type) === "required";
7499
+ }));
7500
+ var labelRequired = required ? /*#__PURE__*/React__default.createElement("span", {
7501
+ className: "text-danger"
7502
+ }, " *") : null;
7503
+ return /*#__PURE__*/React__default.createElement("div", {
7504
+ className: "w-full"
7505
+ }, label ? /*#__PURE__*/React__default.createElement("div", {
7506
+ className: "mb-1"
7507
+ }, label, labelRequired) : null, /*#__PURE__*/React__default.createElement(DatePicker, {
7508
+ selected: value,
7509
+ onChange: function onChange(date) {
7510
+ _setValue(date);
7511
+ console.log("check date: ", date);
7512
+ },
7513
+ customInput: /*#__PURE__*/React__default.createElement(CustomInput, {
7514
+ className: _className
7515
+ }),
7516
+ wrapperClassName: "w-full"
7517
+ }), error ? /*#__PURE__*/React__default.createElement("div", null, error) : null);
7518
+ });
7519
+
7520
+ var InputPhoneNumber = forwardRef(function (props, ref) {
7521
+ var _props$label = props.label,
7522
+ label = _props$label === void 0 ? "" : _props$label,
7523
+ _props$placeholder = props.placeholder,
7524
+ placeholder = _props$placeholder === void 0 ? "" : _props$placeholder,
7525
+ _props$className = props.className,
7526
+ className = _props$className === void 0 ? "" : _props$className,
7527
+ _props$name = props.name,
7528
+ name = _props$name === void 0 ? "" : _props$name,
7529
+ _props$onChange = props.onChange,
7530
+ onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
7531
+ _props$defaultValue = props.defaultValue,
7532
+ defaultValue = _props$defaultValue === void 0 ? "" : _props$defaultValue,
7533
+ _props$type = props.type,
7534
+ type = _props$type === void 0 ? "text" : _props$type,
7535
+ _props$rules = props.rules,
7536
+ rules = _props$rules === void 0 ? [] : _props$rules;
7537
+ var _useState = useState(defaultValue),
7538
+ value = _useState[0],
7539
+ _setValue = _useState[1];
7540
+ var _useState2 = useState(""),
7541
+ error = _useState2[0],
7542
+ _setError = _useState2[1];
7543
+ var handleOnChange = function handleOnChange(event) {
7544
+ var value = event.target.value;
7545
+ _setValue(value);
7546
+ onChange === null || onChange === void 0 ? void 0 : onChange(value);
7547
+ };
7548
+ useImperativeHandle(ref, function () {
7549
+ return {
7550
+ validateData: function validateData() {
7551
+ return _validateData();
7552
+ },
7553
+ setValue: function setValue(text) {
7554
+ return _setValue(text);
7555
+ },
7556
+ getValue: function getValue() {
7557
+ return value;
7558
+ },
7559
+ setError: function setError(err) {
7560
+ return _setError(err);
7561
+ }
7562
+ };
7563
+ });
7564
+ var _validateData = function _validateData() {
7565
+ var count = 0;
7566
+ for (var _iterator = _createForOfIteratorHelperLoose(rules), _step; !(_step = _iterator()).done;) {
7567
+ var _e$pattern;
7568
+ var e = _step.value;
7569
+ if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && value === '') {
7570
+ _setError(e === null || e === void 0 ? void 0 : e.message);
7571
+ count++;
7572
+ break;
7573
+ } else if ((e === null || e === void 0 ? void 0 : e.type) === 'pattern' && !(e !== null && e !== void 0 && (_e$pattern = e.pattern) !== null && _e$pattern !== void 0 && _e$pattern.test(value))) {
7574
+ _setError(e === null || e === void 0 ? void 0 : e.message);
7575
+ count++;
7576
+ break;
7577
+ }
7578
+ }
7579
+ if (count) {
7580
+ return false;
7581
+ } else {
7582
+ _setError('');
7583
+ return true;
7584
+ }
7585
+ };
7586
+ var required = !!(rules !== null && rules !== void 0 && rules.find(function (e) {
7587
+ return (e === null || e === void 0 ? void 0 : e.type) === "required";
7588
+ }));
7589
+ var labelRequired = required ? /*#__PURE__*/React__default.createElement("span", {
7590
+ className: "text-danger"
7591
+ }, " *") : null;
7592
+ var _className = "h-10 px-2 focus:outline-none focus:ring-0 " + className;
7593
+ var data = [{
7594
+ country: "Việt Nam",
7595
+ code: "+84"
7596
+ }];
7597
+ return /*#__PURE__*/React__default.createElement("div", {
7598
+ className: "flex flex-col px-2 py-1"
7599
+ }, label ? /*#__PURE__*/React__default.createElement("label", null, label, labelRequired) : null, /*#__PURE__*/React__default.createElement("div", {
7600
+ className: "flex items-center h-10 bg-white rounded-lg"
7601
+ }, /*#__PURE__*/React__default.createElement("button", {
7602
+ className: "flex items-center border-r-2"
7603
+ }, /*#__PURE__*/React__default.createElement(Select$1, {
7604
+ className: 'w-max',
7605
+ options: data,
7606
+ placeholder: "+84",
7607
+ renderItem: function renderItem(item, index) {
7608
+ return /*#__PURE__*/React__default.createElement("div", {
7609
+ key: "dd\u01B0vhu-" + index,
7610
+ className: "px-2 flex items-center hover:bg-gray-200 rounded-lg whitespace-nowrap v-max"
7611
+ }, item === null || item === void 0 ? void 0 : item.code, "-", item === null || item === void 0 ? void 0 : item.country);
7612
+ }
7613
+ })), /*#__PURE__*/React__default.createElement("input", {
7614
+ type: type,
7615
+ name: name,
7616
+ value: value,
7617
+ placeholder: placeholder,
7618
+ onChange: handleOnChange,
7619
+ required: required,
7620
+ className: _className
7621
+ })), error ? /*#__PURE__*/React__default.createElement("div", {
7622
+ className: "text-danger"
7623
+ }, error) : null);
7624
+ });
7625
+
7626
+ var formatCurrency = function formatCurrency(amount) {
7627
+ if (isNaN(amount)) {
7628
+ return '0 ₫';
7629
+ }
7630
+ var roundedAmount = Math.round(amount);
7631
+ var formattedAmount = roundedAmount.toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.');
7632
+ return formattedAmount + " \u20AB";
7633
+ };
7634
+ var pattern = {
7635
+ phoneNumberPattern: /^0[0-9]{9}$/
7636
+ };
7637
+ var numberPattern = /^\d+$/;
7638
+
7639
+ var dayjs_min = createCommonjsModule(function (module, exports) {
7640
+ !function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
7641
+ });
7642
+
7643
+ var BookingForm = function BookingForm(props) {
7644
+ var _props$shopConfig = props.shopConfig,
7645
+ shopConfig = _props$shopConfig === void 0 ? {} : _props$shopConfig,
7646
+ _props$shopConfigStyl = props.shopConfigStyle,
7647
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
7648
+ _props$onCloseFormBoo = props.onCloseFormBooking,
7649
+ onCloseFormBooking = _props$onCloseFormBoo === void 0 ? function () {} : _props$onCloseFormBoo,
7650
+ _props$defaultValue = props.defaultValue,
7651
+ defaultValue = _props$defaultValue === void 0 ? [] : _props$defaultValue,
7652
+ _props$className = props.className,
7653
+ className = _props$className === void 0 ? "" : _props$className;
7654
+ var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
7655
+ _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
7656
+ secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
7657
+ var _useState = useState(false);
7658
+ var _useState2 = useState({
7659
+ types: "1,10"
7660
+ }),
7661
+ productsParams = _useState2[0];
7662
+ var _useState3 = useState(false);
7663
+ var _useState4 = useState(new Date());
7664
+ var _useState5 = useState(defaultValue),
7665
+ listProductSelected = _useState5[0],
7666
+ setListProductSelected = _useState5[1];
7667
+ var _useState6 = useState(""),
7668
+ searchOption = _useState6[0],
7669
+ setSearchOption = _useState6[1];
7670
+ var inputNameRef = useRef(null);
7671
+ var inputDateRef = useRef(null);
7672
+ var inputPhoneNumberRef = useRef(null);
7673
+ var inputSelectedRef = useRef(null);
7674
+ var _useState7 = useState(false),
7675
+ isOpenPopup = _useState7[0],
7676
+ setIsOpenPopup = _useState7[1];
7677
+ var _useState8 = useState({}),
7678
+ dataBooking = _useState8[0],
7679
+ setDataBooking = _useState8[1];
7680
+ var _EmployeeController = EmployeeController(_extends({}, props)),
7681
+ _EmployeeController$l = _EmployeeController.listEmployment,
7682
+ listEmployment = _EmployeeController$l === void 0 ? [] : _EmployeeController$l;
7683
+ var _ProductController = ProductController(_extends({}, props, {
7684
+ params: productsParams
7685
+ })),
7686
+ products = _ProductController.products;
7687
+ console.log("BookingForm products", products);
7688
+ var _BookingController = BookingController(props),
7689
+ _BookingController$cr = _BookingController.createSchedule,
7690
+ createSchedule = _BookingController$cr === void 0 ? function () {} : _BookingController$cr;
7691
+ var handleSelectedProduct = function handleSelectedProduct(event, productSelected) {
7692
+ event.stopPropagation();
7693
+ console.log("check:", listProductSelected);
7694
+ var isExist = listProductSelected.some(function (item) {
7695
+ var _item$product;
7696
+ return (item === null || item === void 0 ? void 0 : (_item$product = item.product) === null || _item$product === void 0 ? void 0 : _item$product.productId) === (productSelected === null || productSelected === void 0 ? void 0 : productSelected.productId);
7697
+ });
7698
+ if (isExist) {
7699
+ setListProductSelected(function (prev) {
7700
+ return prev.filter(function (item) {
7701
+ var _item$product2;
7702
+ return (item === null || item === void 0 ? void 0 : (_item$product2 = item.product) === null || _item$product2 === void 0 ? void 0 : _item$product2.productId) !== (productSelected === null || productSelected === void 0 ? void 0 : productSelected.productId);
7703
+ });
7704
+ });
7705
+ } else {
7706
+ setListProductSelected(function (prev) {
7707
+ return [].concat(prev, [{
7708
+ product: productSelected,
7709
+ quantity: 1,
7710
+ technical: {},
7711
+ oldService: false
7712
+ }]);
7713
+ });
7714
+ }
7715
+ };
7716
+ var checkProductSelected = function checkProductSelected(productId) {
7717
+ if (listProductSelected && listProductSelected.length > 0) return listProductSelected === null || listProductSelected === void 0 ? void 0 : listProductSelected.some(function (item) {
7718
+ var _item$product3;
7719
+ return (item === null || item === void 0 ? void 0 : (_item$product3 = item.product) === null || _item$product3 === void 0 ? void 0 : _item$product3.productId) === productId;
7720
+ });
7721
+ };
7722
+ var handleChooseTechnical = function handleChooseTechnical(technicalSelected, index) {
7723
+ setListProductSelected(function (prev) {
7724
+ var updateListSelected = [].concat(prev);
7725
+ updateListSelected[index] = _extends({}, updateListSelected[index], {
7726
+ technical: technicalSelected
7727
+ });
7728
+ return updateListSelected;
7729
+ });
7730
+ };
7731
+ var handleOnChangeQuantity = function handleOnChangeQuantity(index, value) {
7732
+ if (!isNaN(value) && value >= 0) {
7733
+ setListProductSelected(function (prev) {
7734
+ var updateListSelected = [].concat(prev);
7735
+ updateListSelected[index] = _extends({}, updateListSelected[index], {
7736
+ quantity: value
7737
+ });
7738
+ return updateListSelected;
7739
+ });
7740
+ }
7741
+ };
7742
+ var checkTechnicalSelected = function checkTechnicalSelected(technicalStaffIds, index) {
7743
+ var _listProductSelected$, _listProductSelected$2;
7744
+ if (listProductSelected && (listProductSelected === null || listProductSelected === void 0 ? void 0 : listProductSelected.length) > 0) return (listProductSelected === null || listProductSelected === void 0 ? void 0 : (_listProductSelected$ = listProductSelected[index]) === null || _listProductSelected$ === void 0 ? void 0 : (_listProductSelected$2 = _listProductSelected$.technical) === null || _listProductSelected$2 === void 0 ? void 0 : _listProductSelected$2.sysUserId) === technicalStaffIds;
7745
+ };
7746
+ var removeTechnicalSelected = function removeTechnicalSelected(event, index) {
7747
+ event.stopPropagation();
7748
+ setListProductSelected(function (prev) {
7749
+ var updateListSelected = [].concat(prev);
7750
+ updateListSelected[index] = _extends({}, updateListSelected[index], {
7751
+ technical: {}
7752
+ });
7753
+ return updateListSelected;
7754
+ });
7755
+ };
7756
+ var handleSearchService = function handleSearchService(e) {
7757
+ var searchValue = e.target.value;
7758
+ setSearchOption(searchValue);
7759
+ var listCopy = products.filter(function (item) {
7760
+ var _item$productInfo, _item$productInfo$pro;
7761
+ return item === null || item === void 0 ? void 0 : (_item$productInfo = item.productInfo) === null || _item$productInfo === void 0 ? void 0 : (_item$productInfo$pro = _item$productInfo.productName) === null || _item$productInfo$pro === void 0 ? void 0 : _item$productInfo$pro.toLowerCase().includes(searchValue.toLowerCase());
7762
+ });
7763
+ return listCopy;
7764
+ };
7765
+ var handleSearchTechnical = function handleSearchTechnical(e) {
7766
+ var searchValue = e.target.value;
7767
+ setSearchOption(searchValue);
7768
+ var listCopy = listEmployment.filter(function (item) {
7769
+ var _item$name;
7770
+ return item === null || item === void 0 ? void 0 : (_item$name = item.name) === null || _item$name === void 0 ? void 0 : _item$name.toLowerCase().includes(searchValue.toLowerCase());
7771
+ });
7772
+ return listCopy;
7773
+ };
7774
+ var handleSubmit = function handleSubmit() {
7775
+ try {
7776
+ var _inputNameRef$current, _inputPhoneNumberRef$, _inputDateRef$current, _inputSelectedRef$cur;
7777
+ var validateName = inputNameRef === null || inputNameRef === void 0 ? void 0 : (_inputNameRef$current = inputNameRef.current) === null || _inputNameRef$current === void 0 ? void 0 : _inputNameRef$current.validateData();
7778
+ var validatePhoneNumber = inputPhoneNumberRef === null || inputPhoneNumberRef === void 0 ? void 0 : (_inputPhoneNumberRef$ = inputPhoneNumberRef.current) === null || _inputPhoneNumberRef$ === void 0 ? void 0 : _inputPhoneNumberRef$.validateData();
7779
+ var validateDate = inputDateRef === null || inputDateRef === void 0 ? void 0 : (_inputDateRef$current = inputDateRef.current) === null || _inputDateRef$current === void 0 ? void 0 : _inputDateRef$current.validateData();
7780
+ var validateService = inputSelectedRef === null || inputSelectedRef === void 0 ? void 0 : (_inputSelectedRef$cur = inputSelectedRef.current) === null || _inputSelectedRef$cur === void 0 ? void 0 : _inputSelectedRef$cur.validateData();
7781
+ var _temp = function () {
7782
+ if (validateName && validatePhoneNumber && validateDate && validateService) {
7783
+ var _inputPhoneNumberRef$2, _inputNameRef$current2, _inputDateRef$current2;
7784
+ var customerPhone = inputPhoneNumberRef === null || inputPhoneNumberRef === void 0 ? void 0 : (_inputPhoneNumberRef$2 = inputPhoneNumberRef.current) === null || _inputPhoneNumberRef$2 === void 0 ? void 0 : _inputPhoneNumberRef$2.getValue();
7785
+ var customerName = inputNameRef === null || inputNameRef === void 0 ? void 0 : (_inputNameRef$current2 = inputNameRef.current) === null || _inputNameRef$current2 === void 0 ? void 0 : _inputNameRef$current2.getValue();
7786
+ var scheduleDate = inputDateRef === null || inputDateRef === void 0 ? void 0 : (_inputDateRef$current2 = inputDateRef.current) === null || _inputDateRef$current2 === void 0 ? void 0 : _inputDateRef$current2.getValue();
7787
+ var services = listProductSelected === null || listProductSelected === void 0 ? void 0 : listProductSelected.map(function (item) {
7788
+ var _item$product4, _item$technical;
7789
+ return {
7790
+ productId: item === null || item === void 0 ? void 0 : (_item$product4 = item.product) === null || _item$product4 === void 0 ? void 0 : _item$product4.productId,
7791
+ technicalStaffIds: [item === null || item === void 0 ? void 0 : (_item$technical = item.technical) === null || _item$technical === void 0 ? void 0 : _item$technical.sysUserId],
7792
+ quantity: item === null || item === void 0 ? void 0 : item.quantity,
7793
+ oldService: item === null || item === void 0 ? void 0 : item.oldService
7794
+ };
7795
+ });
7796
+ var shopId = shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopId;
7797
+ console.log("check payload:::", services);
7798
+ return Promise.resolve(createSchedule(customerName, customerPhone, scheduleDate, services, shopId)).then(function (response) {
7799
+ var _response$data, _response$data$status;
7800
+ if ((response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$status = _response$data.status) === null || _response$data$status === void 0 ? void 0 : _response$data$status.code) === '200') {
7801
+ var _response$data2, _inputPhoneNumberRef$3, _inputNameRef$current3;
7802
+ setDataBooking(response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : _response$data2.data);
7803
+ setIsOpenPopup(true);
7804
+ inputPhoneNumberRef === null || inputPhoneNumberRef === void 0 ? void 0 : (_inputPhoneNumberRef$3 = inputPhoneNumberRef.current) === null || _inputPhoneNumberRef$3 === void 0 ? void 0 : _inputPhoneNumberRef$3.setValue("");
7805
+ inputNameRef === null || inputNameRef === void 0 ? void 0 : (_inputNameRef$current3 = inputNameRef.current) === null || _inputNameRef$current3 === void 0 ? void 0 : _inputNameRef$current3.setValue("");
7806
+ setListProductSelected([]);
7807
+ }
7808
+ });
7809
+ }
7810
+ }();
7811
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
7812
+ } catch (e) {
7813
+ return Promise.reject(e);
7814
+ }
7815
+ };
7816
+ var handleClosePopup = function handleClosePopup() {
7817
+ setIsOpenPopup(false);
7818
+ setDataBooking({});
7819
+ };
7820
+ return /*#__PURE__*/React__default.createElement("div", {
7821
+ className: "grid gap-4 rounded-lg p-6 " + className,
7822
+ style: {
7823
+ backgroundColor: secondary
7824
+ }
7825
+ }, /*#__PURE__*/React__default.createElement("div", {
7826
+ className: "grid grid-cols-1 md:grid-cols-2 gap-4"
7827
+ }, /*#__PURE__*/React__default.createElement(Input, {
7828
+ ref: inputNameRef,
7829
+ label: "Họ tên",
7830
+ placeholder: "Nhập họ tên",
7831
+ rules: [{
7832
+ type: "required",
7833
+ message: "Bắt buộc nhập họ tên"
7834
+ }],
7835
+ className: "w-full rounded-lg bg-white",
7836
+ inputClassName: "w-full focus:outline-none focus:ring-0"
7837
+ }), /*#__PURE__*/React__default.createElement(InputPhoneNumber, {
7838
+ ref: inputPhoneNumberRef,
7839
+ label: "Số điện thoại",
7840
+ placeholder: "Nhập số điện thoại",
7841
+ rules: [{
7842
+ type: "required",
7843
+ message: "Bắt buộc nhập số điện thoại"
7844
+ }, {
7845
+ type: "pattern",
7846
+ pattern: pattern === null || pattern === void 0 ? void 0 : pattern.phoneNumberPattern,
7847
+ message: "Số điện thoại không hợp lệ!"
7848
+ }],
7849
+ className: "w-full rounded-lg"
7850
+ })), /*#__PURE__*/React__default.createElement("div", {
7851
+ className: "grid grid-cols-1 gap-4"
7852
+ }, /*#__PURE__*/React__default.createElement("div", {
7853
+ className: "relative"
7854
+ }, /*#__PURE__*/React__default.createElement(Select$1, {
7855
+ ref: inputSelectedRef,
7856
+ searchOption: searchOption,
7857
+ handleSearchOption: handleSearchService,
7858
+ value: listProductSelected,
7859
+ rules: [{
7860
+ type: "required",
7861
+ message: "Bắt buộc chọn dịch vụ"
7862
+ }],
7863
+ label: "Dịch vụ",
7864
+ placeholder: "Chọn dịch vụ",
7865
+ options: products,
7866
+ renderItem: function renderItem(item, index) {
7867
+ var _item$productInfo2, _item$productInfo3;
7868
+ return /*#__PURE__*/React__default.createElement("div", {
7869
+ key: "dfjsvsjvhu-" + index,
7870
+ className: "px-2 py-1.5 flex items-center hover:bg-gray-100 rounded-lg",
7871
+ onClick: function onClick(event) {
7872
+ handleSelectedProduct(event, item === null || item === void 0 ? void 0 : item.productInfo);
7873
+ }
7874
+ }, /*#__PURE__*/React__default.createElement(IoMdCheckmark, {
7875
+ className: (checkProductSelected(item === null || item === void 0 ? void 0 : (_item$productInfo2 = item.productInfo) === null || _item$productInfo2 === void 0 ? void 0 : _item$productInfo2.productId) ? "" : "invisible") + " inline me-2 w-4"
7876
+ }), /*#__PURE__*/React__default.createElement("div", {
7877
+ className: " whitespace-nowrap line-clamp-1"
7878
+ }, item === null || item === void 0 ? void 0 : (_item$productInfo3 = item.productInfo) === null || _item$productInfo3 === void 0 ? void 0 : _item$productInfo3.productName));
7879
+ }
7880
+ })), /*#__PURE__*/React__default.createElement(DateTimePicker, {
7881
+ ref: inputDateRef,
7882
+ label: "Thời gian",
7883
+ className: "w-full rounded-lg",
7884
+ placeholder: "Chọn thời gian",
7885
+ rules: [{
7886
+ type: "required",
7887
+ message: "Bắt buộc chọn ngày đặt"
7888
+ }]
7889
+ })), (listProductSelected === null || listProductSelected === void 0 ? void 0 : listProductSelected.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
7890
+ className: "grid grid-cols-1"
7891
+ }, /*#__PURE__*/React__default.createElement("div", null, "D\u1ECBch v\u1EE5 \u0111\xE3 ch\u1ECDn"), listProductSelected === null || listProductSelected === void 0 ? void 0 : listProductSelected.map(function (item, optionIndex) {
7892
+ var _item$product5;
7893
+ return /*#__PURE__*/React__default.createElement("div", {
7894
+ className: "w-full bg-transparent border-b-2 py-3 grid grid-col-12 gap-2",
7895
+ key: "ohoihtr-" + optionIndex
7896
+ }, /*#__PURE__*/React__default.createElement("div", {
7897
+ className: "col-span-12 grid grid-cols-12"
7898
+ }, /*#__PURE__*/React__default.createElement("div", {
7899
+ className: "col-span-1 "
7900
+ }, /*#__PURE__*/React__default.createElement("div", null, optionIndex + 1, ".")), /*#__PURE__*/React__default.createElement("div", {
7901
+ className: "col-span-10"
7902
+ }, /*#__PURE__*/React__default.createElement("div", {
7903
+ className: "col-span-10 font-semibold "
7904
+ }, item === null || item === void 0 ? void 0 : (_item$product5 = item.product) === null || _item$product5 === void 0 ? void 0 : _item$product5.productName)), /*#__PURE__*/React__default.createElement("div", {
7905
+ className: "col-span-1 flex justify-center px-2"
7906
+ }, /*#__PURE__*/React__default.createElement("div", {
7907
+ className: "flex items-center justify-center cursor-pointer",
7908
+ onClick: function onClick(event) {
7909
+ handleSelectedProduct(event, item === null || item === void 0 ? void 0 : item.product);
7910
+ }
7911
+ }, /*#__PURE__*/React__default.createElement(RxCross2, {
7912
+ className: "text-base ",
7913
+ style: {
7914
+ color: "rgb(220, 38, 38)"
7915
+ }
7916
+ })))), /*#__PURE__*/React__default.createElement("div", {
7917
+ className: "col-span-12 grid grid-cols-12 gap-6"
7918
+ }, /*#__PURE__*/React__default.createElement("div", {
7919
+ className: "col-span-4 lg:col-start-2 lg:col-end-5 flex flex-col gap-2"
7920
+ }, /*#__PURE__*/React__default.createElement(Input, {
7921
+ isQuantity: true,
7922
+ labelClassName: "text-sm font-semibold ",
7923
+ wrapClassName: "w-full flex flex-col gap-2",
7924
+ label: "Số lượng",
7925
+ placeholder: "Nhập số lượng",
7926
+ rules: [{
7927
+ type: "required",
7928
+ message: "Bắt buộc nhập số lượng"
7929
+ }],
7930
+ defaultValue: item === null || item === void 0 ? void 0 : item.quantity,
7931
+ className: "w-full rounded-lg bg-bgSecondary ",
7932
+ inputClassName: "w-full focus:outline-none focus:ring-0",
7933
+ onChange: function onChange(value) {
7934
+ handleOnChangeQuantity(optionIndex, value);
7935
+ }
7936
+ })), /*#__PURE__*/React__default.createElement("div", {
7937
+ className: "col-end-13 col-span-8 flex flex-col gap-2 "
7938
+ }, /*#__PURE__*/React__default.createElement("div", {
7939
+ className: "font-semibold text-sm mb-1"
7940
+ }, "K\u1EF9 thu\u1EADt vi\xEAn"), /*#__PURE__*/React__default.createElement(Select$1, {
7941
+ placeholder: "Ch\u1ECDn k\u1EF9 thu\u1EADt vi\xEAn",
7942
+ searchOption: searchOption,
7943
+ handleSearchOption: handleSearchTechnical,
7944
+ value: item === null || item === void 0 ? void 0 : item.technical,
7945
+ className: "w-full border rounded-lg",
7946
+ displayItem: function displayItem(technicalSelected) {
7947
+ return /*#__PURE__*/React__default.createElement("div", {
7948
+ className: "flex justify-between items-center w-full"
7949
+ }, /*#__PURE__*/React__default.createElement("div", {
7950
+ className: "line-clamp-1 text-start "
7951
+ }, technicalSelected === null || technicalSelected === void 0 ? void 0 : technicalSelected.name, "(", technicalSelected === null || technicalSelected === void 0 ? void 0 : technicalSelected.roleName, ")"), /*#__PURE__*/React__default.createElement("div", {
7952
+ onClick: function onClick(event) {
7953
+ removeTechnicalSelected(event, optionIndex);
7954
+ }
7955
+ }, /*#__PURE__*/React__default.createElement(RxCross2, {
7956
+ className: "text-xs"
7957
+ })));
7958
+ },
7959
+ options: listEmployment,
7960
+ renderItem: function renderItem(employee, index) {
7961
+ return /*#__PURE__*/React__default.createElement("div", {
7962
+ key: "dds32vsjvhu-" + index,
7963
+ className: (checkTechnicalSelected(employee === null || employee === void 0 ? void 0 : employee.sysUserId, optionIndex) ? "bg-gray-100" : "") + " px-2 py-1.5 flex items-center hover:bg-gray-100 rounded-lg",
7964
+ onClick: function onClick() {
7965
+ handleChooseTechnical(employee, optionIndex);
7966
+ }
7967
+ }, /*#__PURE__*/React__default.createElement(IoMdCheckmark, {
7968
+ className: (checkTechnicalSelected(employee === null || employee === void 0 ? void 0 : employee.sysUserId, optionIndex) ? "" : "invisible") + " inline me-2 min-w-2 md:min-w-4 h-auto"
7969
+ }), /*#__PURE__*/React__default.createElement("div", {
7970
+ className: "hover:bg-gray-100 rounded-lg text-wrap md:text-base text-xs"
7971
+ }, employee === null || employee === void 0 ? void 0 : employee.name, "(", employee === null || employee === void 0 ? void 0 : employee.roleName, ")"));
7972
+ }
7973
+ }))));
7974
+ })) : null, /*#__PURE__*/React__default.createElement("div", {
7975
+ className: "text-center"
7976
+ }, /*#__PURE__*/React__default.createElement(Button, {
7977
+ label: "Đặt lịch ngay",
7978
+ shopConfigStyle: shopConfigStyle,
7979
+ onClick: handleSubmit
7980
+ })), isOpenPopup && /*#__PURE__*/React__default.createElement(ModalNotification, {
7981
+ onCloseFormBooking: onCloseFormBooking,
7982
+ onClose: handleClosePopup
7983
+ }, /*#__PURE__*/React__default.createElement("div", {
7984
+ className: "bg-white rounded-lg shadow-lg p-6 max-w-sm text-center md:min-w-[650px] min-h-[420px] md:min-h-[380px] lg:h-auto "
7985
+ }, /*#__PURE__*/React__default.createElement("div", {
7986
+ className: "h-20 mb-4 flex items-center justify-center"
7987
+ }, /*#__PURE__*/React__default.createElement(FaCheckCircle, {
7988
+ className: "h-full text-green-500",
7989
+ style: {
7990
+ fontSize: "150px"
7991
+ }
7992
+ })), /*#__PURE__*/React__default.createElement("div", {
7993
+ className: "mb-2"
7994
+ }, "Kh\xE1ch h\xE0ng: ", dataBooking === null || dataBooking === void 0 ? void 0 : dataBooking.customerName), /*#__PURE__*/React__default.createElement("div", {
7995
+ className: "mb-2"
7996
+ }, "S\u1ED1 \u0111i\u1EC7n tho\u1EA1i: ", dataBooking === null || dataBooking === void 0 ? void 0 : dataBooking.customerPhone), /*#__PURE__*/React__default.createElement("div", {
7997
+ className: "mb-4"
7998
+ }, "Th\u1EDDi gian: ", dayjs_min(dataBooking === null || dataBooking === void 0 ? void 0 : dataBooking.scheduleDate).format("DD/MM/YYYY")), /*#__PURE__*/React__default.createElement("p", {
7999
+ className: "mb-4"
8000
+ }, "B\u1EA1n \u0111\xE3 c\xF3 t\xE0i kho\u1EA3n, vui l\xF2ng \u0111\u0103ng nh\u1EADp \u0111\u1EC3 xem chi ti\u1EBFt c\xE1c s\u1EA3n ph\u1EA9m, d\u1ECBch v\u1EE5 li\u1EC7u tr\xECnh m\xE0 b\u1EA1n \u0111ang s\u1EDF h\u1EEFu"), /*#__PURE__*/React__default.createElement(Button, {
8001
+ label: "Đăng nhập",
8002
+ shopConfigStyle: shopConfigStyle
8003
+ }))));
8004
+ };
8005
+
8006
+ var Treatments1 = function Treatments1(props) {
8007
+ var _props$shopConfigStyl = props.shopConfigStyle,
8008
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
8009
+ _props$shopConfig = props.shopConfig,
8010
+ shopConfig = _props$shopConfig === void 0 ? {} : _props$shopConfig,
8011
+ _props$data = props.data,
8012
+ data = _props$data === void 0 ? {} : _props$data,
8013
+ _props$SectionTitle = props.SectionTitle,
8014
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
8015
+ var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
8016
+ _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
8017
+ secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
8018
+ var _useState = useState({
8019
+ size: 10,
8020
+ types: "1,10",
8021
+ isHighlight: true
8022
+ }),
8023
+ params = _useState[0];
8024
+ var _useState2 = useState(false),
8025
+ isOpenModal = _useState2[0],
8026
+ setIsOpenModal = _useState2[1];
8027
+ var _useState3 = useState([]),
8028
+ dataBooking = _useState3[0],
8029
+ setDataBooking = _useState3[1];
8030
+ var _ProductController = ProductController(_extends({}, props, {
8031
+ params: params
8032
+ })),
8033
+ _ProductController$pr = _ProductController.products,
8034
+ products = _ProductController$pr === void 0 ? [] : _ProductController$pr;
8035
+ console.log("treatment1:", products);
8036
+ var handleOpenModalBooking = function handleOpenModalBooking(event, data) {
8037
+ try {
8038
+ event.stopPropagation();
8039
+ setDataBooking([{
8040
+ product: data,
8041
+ quantity: 1,
8042
+ technical: {},
8043
+ oldService: false
8044
+ }]);
8045
+ setIsOpenModal(true);
8046
+ } catch (error) {
8047
+ console.log("::::::::::errrorrrrr::::::", error);
8048
+ }
8049
+ };
8050
+ var handleCloseModal = function handleCloseModal() {
8051
+ setIsOpenModal(false);
8052
+ console.log("đóng::::");
8053
+ setDataBooking([]);
8054
+ };
8055
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
8056
+ className: "" + SECTION_DEFAULT_CLASS
8057
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
8058
+ data: data,
8059
+ shopConfigStyle: shopConfigStyle
8060
+ }), products === null || products === void 0 ? void 0 : products.map(function (product, index) {
8061
+ var _product$productInfo, _product$productInfo2;
8062
+ return /*#__PURE__*/React__default.createElement("div", {
8063
+ className: "grid grid-cols-1 md:grid-cols-2 gap-6 mt-12",
8064
+ key: "rthirr-" + index
8065
+ }, /*#__PURE__*/React__default.createElement("div", {
8066
+ className: "block " + (index % 2 ? "md:hidden" : "")
8067
+ }, /*#__PURE__*/React__default.createElement(ProductImage, {
8068
+ product: product === null || product === void 0 ? void 0 : product.productInfo,
8069
+ className: "aspect-video rounded-2xl"
8070
+ })), /*#__PURE__*/React__default.createElement("div", {
8071
+ className: "text-left " + (index % 2 ? "md:text-right" : "")
8072
+ }, /*#__PURE__*/React__default.createElement("div", {
8073
+ className: "font-medium text-2xl"
8074
+ }, product === null || product === void 0 ? void 0 : (_product$productInfo = product.productInfo) === null || _product$productInfo === void 0 ? void 0 : _product$productInfo.productName), /*#__PURE__*/React__default.createElement("div", {
8075
+ className: "mt-4 text-textBody",
8076
+ dangerouslySetInnerHTML: {
8077
+ __html: product === null || product === void 0 ? void 0 : (_product$productInfo2 = product.productInfo) === null || _product$productInfo2 === void 0 ? void 0 : _product$productInfo2.description
8078
+ }
8079
+ }), /*#__PURE__*/React__default.createElement(Button, {
8080
+ label: "Đặt lịch ngay",
8081
+ shopConfigStyle: shopConfigStyle,
8082
+ className: "mt-4",
8083
+ onClick: function onClick(event) {
8084
+ handleOpenModalBooking(event, product === null || product === void 0 ? void 0 : product.productInfo);
8085
+ }
8086
+ })), /*#__PURE__*/React__default.createElement("div", {
8087
+ className: "hidden " + (index % 2 ? "md:block" : "")
8088
+ }, /*#__PURE__*/React__default.createElement(ProductImage, {
8089
+ product: product === null || product === void 0 ? void 0 : product.productInfo,
8090
+ className: "aspect-video rounded-2xl"
8091
+ })));
8092
+ })), /*#__PURE__*/React__default.createElement(Dash, {
8093
+ color: secondary
8094
+ }), isOpenModal ? /*#__PURE__*/React__default.createElement(ModalNotification, {
8095
+ onClose: handleCloseModal
8096
+ }, /*#__PURE__*/React__default.createElement(BookingForm, {
8097
+ className: "overflow-y-scroll hide-scrollbar max-h-[80vh]",
8098
+ onCloseFormBooking: handleCloseModal,
8099
+ defaultValue: dataBooking,
8100
+ shopConfig: shopConfig,
8101
+ shopConfigStyle: shopConfigStyle
8102
+ })) : null);
8103
+ };
8104
+
8105
+ var _path$1;
7182
8106
  function _extends$2() {
7183
8107
  return _extends$2 = Object.assign ? Object.assign.bind() : function (n) {
7184
8108
  for (var e = 1; e < arguments.length; e++) {
@@ -7227,8 +8151,6 @@ var ScrollHorizontal = function ScrollHorizontal(props) {
7227
8151
  className = _props$className === void 0 ? "" : _props$className,
7228
8152
  _props$style = props.style,
7229
8153
  style = _props$style === void 0 ? {} : _props$style,
7230
- _props$primaryColor = props.primaryColor,
7231
- primaryColor = _props$primaryColor === void 0 ? "" : _props$primaryColor,
7232
8154
  _props$renderItem = props.renderItem,
7233
8155
  renderItem = _props$renderItem === void 0 ? function () {} : _props$renderItem;
7234
8156
  var scrollContainerRef = useRef(null);
@@ -7282,20 +8204,14 @@ var ScrollHorizontal = function ScrollHorizontal(props) {
7282
8204
  className: "flex gap-2 items-center px-4"
7283
8205
  }, /*#__PURE__*/React__default.createElement("div", {
7284
8206
  onClick: scrollLeft,
7285
- className: "cursor-pointer w-8 h-8 rounded-full flex justify-center items-center",
7286
- style: {
7287
- backgroundColor: isScrolledToLeft ? "#BDBDBD" : primaryColor
7288
- }
8207
+ className: "cursor-pointer w-8 h-8 rounded-full flex justify-center items-center " + (isScrolledToLeft ? "bg-gray4" : "bg-primary")
7289
8208
  }, /*#__PURE__*/React__default.createElement(SvgAngleSmallLeft, {
7290
8209
  width: 24,
7291
8210
  height: 24,
7292
8211
  fill: "#fff"
7293
8212
  })), /*#__PURE__*/React__default.createElement("div", {
7294
8213
  onClick: scrollRight,
7295
- className: "cursor-pointer w-8 h-8 rounded-full flex justify-center items-center",
7296
- style: {
7297
- backgroundColor: isScrolledToRight ? "#BDBDBD" : primaryColor
7298
- }
8214
+ className: "cursor-pointer w-8 h-8 rounded-full flex justify-center items-center " + (isScrolledToRight ? "bg-gray4" : "bg-primary")
7299
8215
  }, /*#__PURE__*/React__default.createElement(SvgAngleSmallRight, {
7300
8216
  width: 24,
7301
8217
  height: 24,
@@ -7304,36 +8220,103 @@ var ScrollHorizontal = function ScrollHorizontal(props) {
7304
8220
  };
7305
8221
 
7306
8222
  var getDurationValue = function getDurationValue(attributes) {
7307
- var _parsedAttributes$fin;
7308
- var parsedAttributes = JSON.parse(attributes || "[]");
7309
- return ((_parsedAttributes$fin = parsedAttributes.find(function (attr) {
8223
+ var _durationAtt$value, _durationAtt$unit;
8224
+ if (!attributes) {
8225
+ return "";
8226
+ }
8227
+ if (typeof attributes === "string") {
8228
+ attributes = JSON.parse(attributes || "[]");
8229
+ }
8230
+ var durationAtt = attributes.find(function (attr) {
7310
8231
  return attr.name === "Thời lượng (phút) / buổi";
7311
- })) === null || _parsedAttributes$fin === void 0 ? void 0 : _parsedAttributes$fin.value[0]) || "0";
7312
- };
7313
-
7314
- var formatCurrency = function formatCurrency(amount) {
7315
- if (isNaN(amount)) {
7316
- return '0 ₫';
8232
+ });
8233
+ return durationAtt ? ((durationAtt === null || durationAtt === void 0 ? void 0 : (_durationAtt$value = durationAtt.value) === null || _durationAtt$value === void 0 ? void 0 : _durationAtt$value[0]) || "0") + " " + ((durationAtt === null || durationAtt === void 0 ? void 0 : (_durationAtt$unit = durationAtt.unit) === null || _durationAtt$unit === void 0 ? void 0 : _durationAtt$unit[0]) || "") : "";
8234
+ };
8235
+ var genProductSlug = function genProductSlug(productName, id) {
8236
+ var slug = productName.toLowerCase();
8237
+ slug = slug.replace(/(à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ)/g, "a");
8238
+ slug = slug.replace(/(è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ)/g, "e");
8239
+ slug = slug.replace(/(ì|í|ị|ỉ|ĩ)/g, "i");
8240
+ slug = slug.replace(/(ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ)/g, "o");
8241
+ slug = slug.replace(/(ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ)/g, "u");
8242
+ slug = slug.replace(/(ỳ|ý|ỵ|ỷ|ỹ)/g, "y");
8243
+ slug = slug.replace(/(đ)/g, "d");
8244
+ slug = slug.replace(/([^0-9a-z-\s])/g, "");
8245
+ slug = slug.replace(/(\s+)/g, "-");
8246
+ slug = slug.replace(/^-+/g, "");
8247
+ slug = slug.replace(/-+$/g, "");
8248
+ return slug + "-" + id;
8249
+ };
8250
+ var getLinkProductDetail = function getLinkProductDetail(product) {
8251
+ var slug = genProductSlug(product === null || product === void 0 ? void 0 : product.productName, product === null || product === void 0 ? void 0 : product.productId);
8252
+ return "/product/" + slug + "/" + (product === null || product === void 0 ? void 0 : product.shopId);
8253
+ };
8254
+
8255
+ function getMinMax(array, field) {
8256
+ if (!(array !== null && array !== void 0 && array.length) || !array[0].hasOwnProperty(field)) {
8257
+ return null;
7317
8258
  }
7318
- var roundedAmount = Math.round(amount);
7319
- var formattedAmount = roundedAmount.toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.');
7320
- return formattedAmount + " \u20AB";
7321
- };
7322
-
8259
+ var _array$reduce = array.reduce(function (acc, obj) {
8260
+ var value = obj[field];
8261
+ return {
8262
+ min: value < acc.min ? value : acc.min,
8263
+ max: value > acc.max ? value : acc.max
8264
+ };
8265
+ }, {
8266
+ min: array[0][field],
8267
+ max: array[0][field]
8268
+ }),
8269
+ min = _array$reduce.min,
8270
+ max = _array$reduce.max;
8271
+ return {
8272
+ min: min,
8273
+ max: max
8274
+ };
8275
+ }
7323
8276
  var ProductPrice = function ProductPrice(props) {
7324
8277
  var product = props.product,
8278
+ variant = props.variant,
7325
8279
  _props$className = props.className,
7326
8280
  className = _props$className === void 0 ? "" : _props$className,
7327
8281
  _props$style = props.style,
7328
8282
  style = _props$style === void 0 ? {} : _props$style;
8283
+ var _useState = useState(),
8284
+ displayPrice = _useState[0],
8285
+ setDisplayPrice = _useState[1];
8286
+ var _useState2 = useState(),
8287
+ displayPriceBeforeDiscount = _useState2[0],
8288
+ setDisplayPriceBeforeDiscount = _useState2[1];
8289
+ useEffect(function () {
8290
+ if (variant) {
8291
+ genProductPrice([variant]);
8292
+ } else if (product) {
8293
+ genProductPrice(product.variants);
8294
+ }
8295
+ }, [product, variant]);
8296
+ var genProductPrice = function genProductPrice(variants) {
8297
+ var mPrice = getMinMax(variants, 'price');
8298
+ var mPriceBeforeDiscount = getMinMax(variants, 'priceBeforeDiscount');
8299
+ if (mPrice && mPriceBeforeDiscount) {
8300
+ var _displayPriceBeforeDiscount = formatCurrency(mPriceBeforeDiscount.min);
8301
+ var _displayPrice = formatCurrency(mPrice.min);
8302
+ if (mPrice.min !== mPrice.max) {
8303
+ _displayPrice += " - " + formatCurrency(mPrice.max);
8304
+ }
8305
+ if (mPriceBeforeDiscount.min !== mPriceBeforeDiscount.max) {
8306
+ _displayPriceBeforeDiscount += " - " + formatCurrency(mPriceBeforeDiscount.max);
8307
+ }
8308
+ setDisplayPrice(_displayPrice);
8309
+ setDisplayPriceBeforeDiscount(_displayPriceBeforeDiscount);
8310
+ }
8311
+ };
7329
8312
  return /*#__PURE__*/React__default.createElement("div", {
7330
8313
  className: className
7331
- }, product !== null && product !== void 0 && product.priceBeforeDiscount ? /*#__PURE__*/React__default.createElement("span", {
7332
- className: "text-gray3 line-through"
7333
- }, formatCurrency(product === null || product === void 0 ? void 0 : product.priceBeforeDiscount)) : null, /*#__PURE__*/React__default.createElement("span", {
8314
+ }, displayPriceBeforeDiscount !== displayPrice ? /*#__PURE__*/React__default.createElement("span", {
8315
+ className: "text-gray3 line-through mr-2"
8316
+ }, displayPriceBeforeDiscount) : null, /*#__PURE__*/React__default.createElement("span", {
7334
8317
  className: "text-primary font-semibold",
7335
8318
  style: style
7336
- }, formatCurrency(product === null || product === void 0 ? void 0 : product.price)));
8319
+ }, displayPrice));
7337
8320
  };
7338
8321
 
7339
8322
  var ProductItem1 = function ProductItem1(props) {
@@ -7351,11 +8334,23 @@ var ProductItem1 = function ProductItem1(props) {
7351
8334
  className: "flex mt-2"
7352
8335
  }, /*#__PURE__*/React__default.createElement("div", {
7353
8336
  className: "flex-1 text-gray3"
7354
- }, getDurationValue(product === null || product === void 0 ? void 0 : product.attributes), " ph\xFAt"), /*#__PURE__*/React__default.createElement(ProductPrice, {
8337
+ }, getDurationValue(product === null || product === void 0 ? void 0 : product.attributes)), /*#__PURE__*/React__default.createElement(ProductPrice, {
7355
8338
  product: product
7356
8339
  }))));
7357
8340
  };
7358
8341
 
8342
+ var Loading = function Loading(props) {
8343
+ var _props$size = props.size,
8344
+ size = _props$size === void 0 ? 24 : _props$size;
8345
+ return /*#__PURE__*/React__default.createElement("div", {
8346
+ className: "border-4 boder-[rgba(255, 255, 255, 0.2)] rounded-full border-t-4 border-t-primary animate-spin",
8347
+ style: {
8348
+ width: size,
8349
+ height: size
8350
+ }
8351
+ });
8352
+ };
8353
+
7359
8354
  var Treatments1$1 = function Treatments1(props) {
7360
8355
  var _props$shopConfigStyl = props.shopConfigStyle,
7361
8356
  shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
@@ -7364,34 +8359,37 @@ var Treatments1$1 = function Treatments1(props) {
7364
8359
  _props$SectionTitle = props.SectionTitle,
7365
8360
  SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
7366
8361
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
7367
- _shopConfigStyle$colo2 = _shopConfigStyle$colo.primary,
7368
- primary = _shopConfigStyle$colo2 === void 0 ? "#000" : _shopConfigStyle$colo2,
7369
- _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
7370
- secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
7371
- _shopConfigStyle$colo4 = _shopConfigStyle$colo.textBody,
7372
- textBody = _shopConfigStyle$colo4 === void 0 ? "#000" : _shopConfigStyle$colo4,
7373
- _shopConfigStyle$colo5 = _shopConfigStyle$colo.textButton,
7374
- textButton = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5,
7375
- _shopConfigStyle$colo6 = _shopConfigStyle$colo.background,
7376
- background = _shopConfigStyle$colo6 === void 0 ? "#fff" : _shopConfigStyle$colo6;
7377
- var _useState = useState({}),
7378
- params = _useState[0];
7379
- var _CategoryController = CategoryController(_extends({}, props)),
8362
+ _shopConfigStyle$colo2 = _shopConfigStyle$colo.secondary,
8363
+ secondary = _shopConfigStyle$colo2 === void 0 ? "#000" : _shopConfigStyle$colo2;
8364
+ var _useState = useState({
8365
+ types: "1"
8366
+ }),
8367
+ params = _useState[0],
8368
+ setParams = _useState[1];
8369
+ var _CategoryController = CategoryController(_extends({}, props, {
8370
+ types: "1"
8371
+ })),
7380
8372
  categories = _CategoryController.categories;
7381
8373
  var _ProductController = ProductController(_extends({}, props, {
7382
8374
  params: params
7383
8375
  })),
7384
8376
  _ProductController$pr = _ProductController.products,
7385
- products = _ProductController$pr === void 0 ? [] : _ProductController$pr;
8377
+ products = _ProductController$pr === void 0 ? [] : _ProductController$pr,
8378
+ loading = _ProductController.loading;
7386
8379
  var _useState2 = useState(0),
7387
8380
  selectedCategory = _useState2[0],
7388
8381
  setSelectedCategory = _useState2[1];
7389
- console.log("Treatments2 products");
7390
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
7391
- className: "relative w-full py-12 px-4 xl:px-20",
7392
- style: {
7393
- backgroundColor: background
8382
+ useEffect(function () {
8383
+ var newParams = _extends({}, params, {
8384
+ categoryId: selectedCategory
8385
+ });
8386
+ if (!selectedCategory) {
8387
+ delete newParams.categoryId;
7394
8388
  }
8389
+ setParams(newParams);
8390
+ }, [selectedCategory]);
8391
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
8392
+ className: SECTION_DEFAULT_CLASS + " relative"
7395
8393
  }, /*#__PURE__*/React__default.createElement(SectionTitle, {
7396
8394
  data: data,
7397
8395
  shopConfigStyle: shopConfigStyle
@@ -7400,40 +8398,111 @@ var Treatments1$1 = function Treatments1(props) {
7400
8398
  categoryId: 0,
7401
8399
  cateName: "Tất cả"
7402
8400
  }].concat(categories),
7403
- style: {
7404
- backgroundColor: secondary
7405
- },
7406
- className: "mt-6 rounded-lg overflow-hidden",
7407
- primaryColor: primary,
8401
+ className: "mt-6 rounded-lg overflow-hidden bg-bgSecondary",
7408
8402
  renderItem: function renderItem(item, index) {
7409
8403
  return /*#__PURE__*/React__default.createElement("div", {
7410
8404
  key: index,
7411
- className: "p-3 flex gap-3 shrink-0 cursor-pointer text-base",
8405
+ className: "p-3 flex gap-3 shrink-0 cursor-pointer text-base " + (selectedCategory === item.categoryId ? "bg-primary text-textButton" : ""),
7412
8406
  onClick: function onClick() {
7413
8407
  return setSelectedCategory(item.categoryId);
7414
- },
7415
- style: {
7416
- backgroundColor: selectedCategory === item.categoryId ? primary : "inherit",
7417
- color: selectedCategory === item.categoryId ? textButton : textBody
7418
8408
  }
7419
8409
  }, item === null || item === void 0 ? void 0 : item.cateName);
7420
8410
  }
7421
- }), /*#__PURE__*/React__default.createElement("div", {
8411
+ }), loading ? /*#__PURE__*/React__default.createElement("div", {
8412
+ className: "flex w-full justify-center p-12"
8413
+ }, /*#__PURE__*/React__default.createElement(Loading, null)) : products !== null && products !== void 0 && products.length ? /*#__PURE__*/React__default.createElement("div", {
7422
8414
  className: "grid grid-cols-1 md:grid-cols-2 gap-10 mt-6"
7423
8415
  }, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
7424
8416
  return /*#__PURE__*/React__default.createElement(ProductItem1, {
7425
8417
  key: index,
7426
8418
  product: product === null || product === void 0 ? void 0 : product.productInfo
7427
8419
  });
7428
- }))), /*#__PURE__*/React__default.createElement(Dash, {
8420
+ })) : /*#__PURE__*/React__default.createElement("div", {
8421
+ className: "text-gray3 text-center p-12"
8422
+ }, "Kh\xF4ng c\xF3 d\u1ECBch v\u1EE5")), /*#__PURE__*/React__default.createElement(Dash, {
7429
8423
  color: secondary
7430
8424
  }));
7431
8425
  };
7432
8426
 
8427
+ var ProductDetailController = function ProductDetailController(props) {
8428
+ var shopConfig = props.shopConfig,
8429
+ _props$productId = props.productId,
8430
+ productId = _props$productId === void 0 ? 0 : _props$productId;
8431
+ var _useState = useState(),
8432
+ product = _useState[0],
8433
+ setProduct = _useState[1];
8434
+ useEffect(function () {
8435
+ if (productId) {
8436
+ getProductDetail();
8437
+ }
8438
+ }, [productId]);
8439
+ var getProductDetail = function getProductDetail() {
8440
+ try {
8441
+ var _temp = _catch(function () {
8442
+ return Promise.resolve(getDetailProductApi(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopId, productId)).then(function (res) {
8443
+ var _res$data, _res$data$status;
8444
+ if ((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$status = _res$data.status) === null || _res$data$status === void 0 ? void 0 : _res$data$status.code) == 200) {
8445
+ var _res$data2;
8446
+ setProduct(res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.data);
8447
+ }
8448
+ });
8449
+ }, function (e) {
8450
+ console.log(e);
8451
+ });
8452
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
8453
+ } catch (e) {
8454
+ return Promise.reject(e);
8455
+ }
8456
+ };
8457
+ return {
8458
+ product: product
8459
+ };
8460
+ };
8461
+
8462
+ var ServiceDetail1 = function ServiceDetail1(props) {
8463
+ var shopConfigStyle = props.shopConfigStyle;
8464
+ var _ProductDetailControl = ProductDetailController(props),
8465
+ product = _ProductDetailControl.product;
8466
+ console.log('product', product);
8467
+ return /*#__PURE__*/React__default.createElement("div", {
8468
+ className: SECTION_DEFAULT_CLASS + " !py-0"
8469
+ }, /*#__PURE__*/React__default.createElement("div", {
8470
+ className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-3 gap-6 bg-bgSecondary"
8471
+ }, /*#__PURE__*/React__default.createElement(ProductImage, {
8472
+ product: product,
8473
+ className: "w-full aspect-square rounded-2xl"
8474
+ }), /*#__PURE__*/React__default.createElement("div", {
8475
+ className: "col-span-2"
8476
+ }, /*#__PURE__*/React__default.createElement("p", {
8477
+ className: "font-semibold text-2xl"
8478
+ }, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
8479
+ product: product,
8480
+ className: "mt-6"
8481
+ }), /*#__PURE__*/React__default.createElement("div", {
8482
+ className: "flex gap-4 mt-6"
8483
+ }, /*#__PURE__*/React__default.createElement("div", null, "Th\u1EDDi l\u01B0\u1EE3ng: "), /*#__PURE__*/React__default.createElement("div", null, getDurationValue(product === null || product === void 0 ? void 0 : product.attributes))), /*#__PURE__*/React__default.createElement("div", {
8484
+ className: "flex gap-4 mt-6"
8485
+ }, /*#__PURE__*/React__default.createElement(Button, {
8486
+ label: "ĐẶT LỊCH",
8487
+ shopConfigStyle: shopConfigStyle
8488
+ })), /*#__PURE__*/React__default.createElement("p", {
8489
+ className: "text-lg mt-12 pt-6 border-t border-stroke"
8490
+ }, "M\xF4 t\u1EA3"), product !== null && product !== void 0 && product.description ? /*#__PURE__*/React__default.createElement("div", {
8491
+ className: "mt-6",
8492
+ dangerouslySetInnerHTML: {
8493
+ __html: product === null || product === void 0 ? void 0 : product.description
8494
+ }
8495
+ }) : /*#__PURE__*/React__default.createElement("div", {
8496
+ className: "text-gray3 mt-2"
8497
+ }, "Kh\xF4ng c\xF3 th\xF4ng tin"))));
8498
+ };
8499
+
7433
8500
  var ProductItem2 = function ProductItem2(props) {
7434
8501
  var product = props.product;
7435
- return /*#__PURE__*/React__default.createElement("div", {
7436
- className: "text-center"
8502
+ return /*#__PURE__*/React__default.createElement("a", {
8503
+ href: getLinkProductDetail(product)
8504
+ }, /*#__PURE__*/React__default.createElement("div", {
8505
+ className: "text-center relative group"
7437
8506
  }, /*#__PURE__*/React__default.createElement(ProductImage, {
7438
8507
  product: product,
7439
8508
  className: "max-w-[240px] rounded-full mx-auto"
@@ -7442,7 +8511,7 @@ var ProductItem2 = function ProductItem2(props) {
7442
8511
  className: "text-lg mt-4"
7443
8512
  }), /*#__PURE__*/React__default.createElement("div", {
7444
8513
  className: "text-lg mt-2"
7445
- }, product === null || product === void 0 ? void 0 : product.productName));
8514
+ }, product === null || product === void 0 ? void 0 : product.productName)));
7446
8515
  };
7447
8516
 
7448
8517
  var Products1 = function Products1(props) {
@@ -7454,9 +8523,7 @@ var Products1 = function Products1(props) {
7454
8523
  SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
7455
8524
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
7456
8525
  _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
7457
- secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
7458
- _shopConfigStyle$colo6 = _shopConfigStyle$colo.background,
7459
- background = _shopConfigStyle$colo6 === void 0 ? "#fff" : _shopConfigStyle$colo6;
8526
+ secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
7460
8527
  var _useState = useState({
7461
8528
  size: 4
7462
8529
  }),
@@ -7468,10 +8535,7 @@ var Products1 = function Products1(props) {
7468
8535
  products = _ProductController$pr === void 0 ? [] : _ProductController$pr;
7469
8536
  console.log("Products1 products");
7470
8537
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
7471
- className: "w-full py-12 px-4 xl:px-20 text-center",
7472
- style: {
7473
- backgroundColor: background
7474
- }
8538
+ className: SECTION_DEFAULT_CLASS + " text-center"
7475
8539
  }, /*#__PURE__*/React__default.createElement(SectionTitle, {
7476
8540
  data: data,
7477
8541
  shopConfigStyle: shopConfigStyle
@@ -7487,162 +8551,39 @@ var Products1 = function Products1(props) {
7487
8551
  shopConfigStyle: shopConfigStyle,
7488
8552
  className: "mt-12"
7489
8553
  })), /*#__PURE__*/React__default.createElement(Dash, {
7490
- color: secondary
7491
- }));
7492
- };
7493
-
7494
- var ItemProduct = function ItemProduct(props) {
7495
- var _shopConfigStyle$colo, _shopConfigStyle$colo2, _shopConfigStyle$colo3;
7496
- var product = props.product,
7497
- shopConfigStyle = props.shopConfigStyle;
7498
- return /*#__PURE__*/React__default.createElement("div", {
7499
- className: "pb-4 rounded-2xl w-full",
7500
- style: {
7501
- background: shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : (_shopConfigStyle$colo = shopConfigStyle.color) === null || _shopConfigStyle$colo === void 0 ? void 0 : _shopConfigStyle$colo.bgSecondary
7502
- }
7503
- }, /*#__PURE__*/React__default.createElement("div", {
7504
- className: "relative pt-2 flex justify-center h-32 sm:h-40 lg:h-52"
7505
- }, /*#__PURE__*/React__default.createElement("a", {
7506
- href: "#"
7507
- }, /*#__PURE__*/React__default.createElement(ProductImage, {
7508
- product: product,
7509
- className: "aspect-w-1 aspect-h-1 max-h-32 sm:max-h-40 lg:max-h-52 object-cover"
7510
- })), product && (product === null || product === void 0 ? void 0 : product.priceBeforeDiscount) && +(product === null || product === void 0 ? void 0 : product.priceBeforeDiscount) !== (product === null || product === void 0 ? void 0 : product.price) && /*#__PURE__*/React__default.createElement("label", {
7511
- className: "absolute bg-red-600 rounded-r-lg sm:px-2",
7512
- style: {
7513
- top: "10%",
7514
- color: shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : (_shopConfigStyle$colo2 = shopConfigStyle.color) === null || _shopConfigStyle$colo2 === void 0 ? void 0 : _shopConfigStyle$colo2.textButton
7515
- }
7516
- }, ((product === null || product === void 0 ? void 0 : product.priceBeforeDiscount) - (product === null || product === void 0 ? void 0 : product.price)) / (product === null || product === void 0 ? void 0 : product.priceBeforeDiscount) * 100, "%")), /*#__PURE__*/React__default.createElement("div", {
7517
- className: "px-4 h-[100px] mt-6"
7518
- }, /*#__PURE__*/React__default.createElement("label", {
7519
- className: "line-clamp-2 lg:h-12 lg:block"
7520
- }, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement("div", {
7521
- className: "mt-3 md:flex md:justify-between flex-col"
7522
- }, /*#__PURE__*/React__default.createElement(ProductPrice, {
7523
- product: product,
7524
- style: {
7525
- color: shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : (_shopConfigStyle$colo3 = shopConfigStyle.color) === null || _shopConfigStyle$colo3 === void 0 ? void 0 : _shopConfigStyle$colo3.primary
7526
- }
7527
- }))));
7528
- };
7529
-
7530
- var Carousel = function Carousel(props) {
7531
- var carouselRef = useRef(null);
7532
- var _useState = useState(false),
7533
- isScrolledToLeft = _useState[0],
7534
- setIsScrolledToLeft = _useState[1];
7535
- var _useState2 = useState(true),
7536
- isScrolledToRight = _useState2[0],
7537
- setIsScrolledToRight = _useState2[1];
7538
- var _props$datas = props.datas,
7539
- datas = _props$datas === void 0 ? [] : _props$datas,
7540
- _props$className = props.className,
7541
- className = _props$className === void 0 ? "" : _props$className,
7542
- _props$style = props.style,
7543
- style = _props$style === void 0 ? {} : _props$style,
7544
- _props$primaryColor = props.primaryColor,
7545
- primaryColor = _props$primaryColor === void 0 ? "" : _props$primaryColor,
7546
- _props$renderItem = props.renderItem,
7547
- renderItem = _props$renderItem === void 0 ? function () {} : _props$renderItem;
7548
- var handleClickPrevImg = function handleClickPrevImg() {
7549
- if (carouselRef.current) {
7550
- setIsScrolledToLeft(true);
7551
- setIsScrolledToRight(false);
7552
- carouselRef.current.scrollBy({
7553
- left: -300,
7554
- behavior: "smooth"
7555
- });
7556
- }
7557
- };
7558
- var handleClickNextImg = function handleClickNextImg() {
7559
- setIsScrolledToRight(true);
7560
- setIsScrolledToLeft(false);
7561
- if (carouselRef.current) {
7562
- carouselRef.current.scrollBy({
7563
- left: 300,
7564
- behavior: "smooth"
7565
- });
7566
- }
7567
- };
7568
- return /*#__PURE__*/React__default.createElement("div", {
7569
- className: "relative " + className + " ",
7570
- style: style
7571
- }, /*#__PURE__*/React__default.createElement("div", {
7572
- className: " w-full pe-2 h-full flex overflow-x-auto hide-scrollbar",
7573
- ref: carouselRef
7574
- }, datas && datas.length > 0 && datas.map(function (item, index) {
7575
- return renderItem(item, index);
7576
- })), datas && datas.length > 0 && /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("button", {
7577
- className: " hidden md:block bg-gray3 p-3 rounded-full absolute top-[45%] left-[-8px] lg:left-[-1%]",
7578
- style: {
7579
- backgroundColor: isScrolledToLeft ? primaryColor : "#BDBDBD"
7580
- },
7581
- onClick: handleClickPrevImg
7582
- }, /*#__PURE__*/React__default.createElement(FaArrowLeft, {
7583
- className: "text-sm lg:text-lg text-white"
7584
- })), /*#__PURE__*/React__default.createElement("button", {
7585
- className: " hidden md:block p-3 rounded-full absolute top-[45%] right-[-2%] lg:right-0",
7586
- style: {
7587
- backgroundColor: isScrolledToRight ? primaryColor : "#BDBDBD"
7588
- },
7589
- onClick: handleClickNextImg
7590
- }, /*#__PURE__*/React__default.createElement(FaArrowRight$1, {
7591
- className: "text-sm lg:text-lg text-white"
7592
- }))));
7593
- };
7594
-
7595
- var Products2 = function Products2(props) {
7596
- var shopConfigStyle = props.shopConfigStyle,
7597
- data = props.data;
7598
- var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
7599
- _shopConfigStyle$colo2 = _shopConfigStyle$colo.primary,
7600
- primary = _shopConfigStyle$colo2 === void 0 ? "#000" : _shopConfigStyle$colo2,
7601
- _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
7602
- secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
7603
- _shopConfigStyle$colo4 = _shopConfigStyle$colo.textBody,
7604
- textBody = _shopConfigStyle$colo4 === void 0 ? "#000" : _shopConfigStyle$colo4,
7605
- _shopConfigStyle$colo5 = _shopConfigStyle$colo.background,
7606
- background = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5,
7607
- _shopConfigStyle$colo6 = _shopConfigStyle$colo.textButton,
7608
- textButton = _shopConfigStyle$colo6 === void 0 ? "#fff" : _shopConfigStyle$colo6;
7609
- var _ProductController = ProductController(props),
7610
- _ProductController$pr = _ProductController.products,
7611
- products = _ProductController$pr === void 0 ? [] : _ProductController$pr;
7612
- console.log("Products2 products");
8554
+ color: secondary
8555
+ }));
8556
+ };
8557
+
8558
+ var ItemProduct = function ItemProduct(props) {
8559
+ var product = props.product;
7613
8560
  return /*#__PURE__*/React__default.createElement("div", {
7614
- className: "pt-10 px-4 xl:px-20",
7615
- style: {
7616
- background: background,
7617
- color: textBody
7618
- }
8561
+ className: "pb-4 rounded-2xl w-full bg-bgSecondary"
7619
8562
  }, /*#__PURE__*/React__default.createElement("div", {
7620
- className: "rounded-3xl w-full py-10 md:px-10 sm:px-6 px-4",
7621
- style: {
7622
- background: secondary
7623
- }
7624
- }, /*#__PURE__*/React__default.createElement("h2", {
7625
- className: "font-semibold text-2xl md:text-3xl lg:text-4xl ps-5 pb-4",
8563
+ className: "relative pt-2 flex justify-center h-32 sm:h-40 lg:h-52"
8564
+ }, /*#__PURE__*/React__default.createElement("a", {
8565
+ href: "#"
8566
+ }, /*#__PURE__*/React__default.createElement(ProductImage, {
8567
+ product: product,
8568
+ className: "aspect-w-1 aspect-h-1 max-h-32 sm:max-h-40 lg:max-h-52 object-cover"
8569
+ })), product && (product === null || product === void 0 ? void 0 : product.priceBeforeDiscount) && +(product === null || product === void 0 ? void 0 : product.priceBeforeDiscount) !== (product === null || product === void 0 ? void 0 : product.price) && /*#__PURE__*/React__default.createElement("label", {
8570
+ className: "absolute bg-red-600 rounded-r-lg sm:px-2 text-textButton",
7626
8571
  style: {
7627
- color: textButton
7628
- }
7629
- }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement(Carousel, {
7630
- datas: products,
7631
- primaryColor: primary,
7632
- renderItem: function renderItem(item, index) {
7633
- return /*#__PURE__*/React__default.createElement("div", {
7634
- key: "carousel-" + index,
7635
- className: " min-w-[40vw] object-cover sm:min-w-[25vw] lg:min-w-[22vw] xl:min-w-[20vw] pe-4 xl:pe-6"
7636
- }, /*#__PURE__*/React__default.createElement(ItemProduct, {
7637
- product: item.productInfo,
7638
- shopConfigStyle: shopConfigStyle
7639
- }));
8572
+ top: "10%"
7640
8573
  }
7641
- })));
8574
+ }, ((product === null || product === void 0 ? void 0 : product.priceBeforeDiscount) - (product === null || product === void 0 ? void 0 : product.price)) / (product === null || product === void 0 ? void 0 : product.priceBeforeDiscount) * 100, "%")), /*#__PURE__*/React__default.createElement("div", {
8575
+ className: "px-4 h-[100px] mt-6"
8576
+ }, /*#__PURE__*/React__default.createElement("label", {
8577
+ className: "line-clamp-2 lg:h-12 lg:block"
8578
+ }, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement("div", {
8579
+ className: "mt-3 md:flex md:justify-between flex-col"
8580
+ }, /*#__PURE__*/React__default.createElement(ProductPrice, {
8581
+ product: product
8582
+ }))));
7642
8583
  };
7643
8584
 
7644
- var CarouselItem = function CarouselItem(props) {
7645
- var listRef = useRef(null);
8585
+ var Carousel = function Carousel(props) {
8586
+ var carouselRef = useRef(null);
7646
8587
  var _useState = useState(false),
7647
8588
  isScrolledToLeft = _useState[0],
7648
8589
  setIsScrolledToLeft = _useState[1];
@@ -7657,16 +8598,14 @@ var CarouselItem = function CarouselItem(props) {
7657
8598
  style = _props$style === void 0 ? {} : _props$style,
7658
8599
  _props$primaryColor = props.primaryColor,
7659
8600
  primaryColor = _props$primaryColor === void 0 ? "" : _props$primaryColor,
7660
- _props$textButtonColo = props.textButtonColor,
7661
- textButtonColor = _props$textButtonColo === void 0 ? "" : _props$textButtonColo,
7662
8601
  _props$renderItem = props.renderItem,
7663
8602
  renderItem = _props$renderItem === void 0 ? function () {} : _props$renderItem;
7664
8603
  var handleClickPrevImg = function handleClickPrevImg() {
7665
- if (listRef.current) {
8604
+ if (carouselRef.current) {
7666
8605
  setIsScrolledToLeft(true);
7667
8606
  setIsScrolledToRight(false);
7668
- listRef.current.scrollBy({
7669
- left: -80,
8607
+ carouselRef.current.scrollBy({
8608
+ left: -300,
7670
8609
  behavior: "smooth"
7671
8610
  });
7672
8611
  }
@@ -7674,541 +8613,657 @@ var CarouselItem = function CarouselItem(props) {
7674
8613
  var handleClickNextImg = function handleClickNextImg() {
7675
8614
  setIsScrolledToRight(true);
7676
8615
  setIsScrolledToLeft(false);
7677
- if (listRef.current) {
7678
- listRef.current.scrollBy({
7679
- left: 80,
8616
+ if (carouselRef.current) {
8617
+ carouselRef.current.scrollBy({
8618
+ left: 300,
7680
8619
  behavior: "smooth"
7681
8620
  });
7682
8621
  }
7683
8622
  };
7684
- console.log("check propsss::::::::", datas);
7685
8623
  return /*#__PURE__*/React__default.createElement("div", {
7686
- className: "grid grid-cols-12 h-12 " + className,
8624
+ className: "relative " + className + " ",
7687
8625
  style: style
7688
8626
  }, /*#__PURE__*/React__default.createElement("div", {
7689
- className: "col-span-12 lg:col-span-10 md:col-span-9 overflow-hidden "
7690
- }, /*#__PURE__*/React__default.createElement("div", {
7691
- className: "flex overflow-x-auto gap-2 hide-scrollbar items-center",
7692
- ref: listRef
8627
+ className: " w-full pe-2 h-full flex overflow-x-auto hide-scrollbar",
8628
+ ref: carouselRef
7693
8629
  }, datas && datas.length > 0 && datas.map(function (item, index) {
7694
8630
  return renderItem(item, index);
7695
- }))), datas && datas.length > 0 && /*#__PURE__*/React__default.createElement("div", {
7696
- className: "hidden my-auto col-span-5 md:col-span-3 lg:col-span-2 gap-4 md:flex justify-end "
7697
- }, /*#__PURE__*/React__default.createElement("button", {
7698
- className: " px-4 py-3 rounded-full",
7699
- onClick: handleClickPrevImg,
8631
+ })), datas && datas.length > 0 && /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("button", {
8632
+ className: " hidden md:block bg-gray3 p-3 rounded-full absolute top-[45%] left-[-8px] lg:left-[-1%]",
7700
8633
  style: {
7701
8634
  backgroundColor: isScrolledToLeft ? primaryColor : "#BDBDBD"
7702
- }
8635
+ },
8636
+ onClick: handleClickPrevImg
7703
8637
  }, /*#__PURE__*/React__default.createElement(FaArrowLeft, {
7704
- className: "inline-block mb-1 text-lg",
7705
- style: {
7706
- color: textButtonColor
7707
- }
8638
+ className: "text-sm lg:text-lg text-white"
7708
8639
  })), /*#__PURE__*/React__default.createElement("button", {
7709
- className: "bg-gray2 px-4 py-3 rounded-full",
8640
+ className: " hidden md:block p-3 rounded-full absolute top-[45%] right-[-2%] lg:right-0",
7710
8641
  style: {
7711
8642
  backgroundColor: isScrolledToRight ? primaryColor : "#BDBDBD"
7712
8643
  },
7713
8644
  onClick: handleClickNextImg
7714
8645
  }, /*#__PURE__*/React__default.createElement(FaArrowRight$1, {
7715
- className: "inline-block mb-1 text-lg",
7716
- style: {
7717
- color: textButtonColor
7718
- }
8646
+ className: "text-sm lg:text-lg text-white"
7719
8647
  }))));
7720
8648
  };
7721
8649
 
7722
- var ListProduct = function ListProduct(props) {
7723
- var _props$datas = props.datas,
7724
- datas = _props$datas === void 0 ? [] : _props$datas,
7725
- _props$style = props.style,
7726
- style = _props$style === void 0 ? {} : _props$style,
7727
- _props$className = props.className,
7728
- className = _props$className === void 0 ? {} : _props$className,
7729
- _props$renderItem = props.renderItem,
7730
- renderItem = _props$renderItem === void 0 ? function () {} : _props$renderItem;
7731
- return /*#__PURE__*/React__default.createElement("div", {
7732
- className: "grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4 2xl:grid-cols-5 mt-6 " + className,
7733
- style: style
7734
- }, datas && datas.length > 0 && datas.map(function (item, index) {
7735
- return renderItem(item, index);
7736
- }));
7737
- };
7738
-
7739
- var Products10 = function Products10(props) {
7740
- var _useState = useState(""),
7741
- selectCategory = _useState[0],
7742
- setSelectCategory = _useState[1];
8650
+ var Products2 = function Products2(props) {
7743
8651
  var shopConfigStyle = props.shopConfigStyle,
7744
8652
  data = props.data;
7745
8653
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
7746
8654
  _shopConfigStyle$colo2 = _shopConfigStyle$colo.primary,
7747
8655
  primary = _shopConfigStyle$colo2 === void 0 ? "#000" : _shopConfigStyle$colo2,
7748
- _shopConfigStyle$colo3 = _shopConfigStyle$colo.textBody,
7749
- textBody = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
7750
- _shopConfigStyle$colo4 = _shopConfigStyle$colo.textButton,
7751
- textButton = _shopConfigStyle$colo4 === void 0 ? "#fff" : _shopConfigStyle$colo4,
8656
+ _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
8657
+ secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
8658
+ _shopConfigStyle$colo4 = _shopConfigStyle$colo.textBody,
8659
+ textBody = _shopConfigStyle$colo4 === void 0 ? "#000" : _shopConfigStyle$colo4,
7752
8660
  _shopConfigStyle$colo5 = _shopConfigStyle$colo.background,
7753
8661
  background = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5,
7754
- _shopConfigStyle$colo6 = _shopConfigStyle$colo.bgSecondary,
7755
- bgSecondary = _shopConfigStyle$colo6 === void 0 ? "#fff" : _shopConfigStyle$colo6;
7756
- var _CategoryController = CategoryController(props),
7757
- _CategoryController$c = _CategoryController.categories,
7758
- categories = _CategoryController$c === void 0 ? [] : _CategoryController$c;
8662
+ _shopConfigStyle$colo6 = _shopConfigStyle$colo.textButton,
8663
+ textButton = _shopConfigStyle$colo6 === void 0 ? "#fff" : _shopConfigStyle$colo6;
7759
8664
  var _ProductController = ProductController(props),
7760
8665
  _ProductController$pr = _ProductController.products,
7761
8666
  products = _ProductController$pr === void 0 ? [] : _ProductController$pr;
7762
- console.log("Products10 products");
8667
+ console.log("Products2 products");
7763
8668
  return /*#__PURE__*/React__default.createElement("div", {
7764
- className: "w-full pt-10 px-4 xl:px-20",
8669
+ className: "pt-10 px-4 xl:px-20",
7765
8670
  style: {
7766
8671
  background: background,
7767
8672
  color: textBody
7768
8673
  }
7769
- }, /*#__PURE__*/React__default.createElement("h2", {
7770
- className: "text-2xl lg:text-3xl xl:text-4xl font-semibold mb-6"
7771
- }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement(CarouselItem, {
7772
- datas: categories,
7773
- primaryColor: primary,
7774
- textButtonColor: textButton,
7775
- renderItem: function renderItem(item, index) {
7776
- return /*#__PURE__*/React__default.createElement("div", {
7777
- key: item.categoryId + "-" + index,
7778
- className: "border-2 items whitespace-nowrap p-2 rounded-lg cursor-pointer ",
7779
- style: {
7780
- borderColor: primary,
7781
- color: selectCategory === item.categoryId ? textButton : primary,
7782
- background: selectCategory === item.categoryId ? primary : bgSecondary
7783
- },
7784
- onClick: function onClick() {
7785
- setSelectCategory(item.categoryId);
7786
- }
7787
- }, item.cateName);
7788
- }
7789
- }), /*#__PURE__*/React__default.createElement(ListProduct, {
7790
- datas: products,
7791
- renderItem: function renderItem(item, index) {
7792
- return /*#__PURE__*/React__default.createElement("div", {
7793
- key: "productfsd-" + index
7794
- }, /*#__PURE__*/React__default.createElement(ItemProduct, {
7795
- product: item.productInfo,
7796
- shopConfigStyle: shopConfigStyle
7797
- }));
7798
- }
7799
- }));
7800
- };
7801
-
7802
- var ProductsTop1 = function ProductsTop1(props) {
7803
- var data = props.data,
7804
- shopConfigStyle = props.shopConfigStyle;
7805
- var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
7806
- _shopConfigStyle$colo2 = _shopConfigStyle$colo.background,
7807
- background = _shopConfigStyle$colo2 === void 0 ? "#fff" : _shopConfigStyle$colo2;
7808
- var _ProductController = ProductController(props),
7809
- _ProductController$pr = _ProductController.products,
7810
- products = _ProductController$pr === void 0 ? [] : _ProductController$pr;
7811
- console.log("ProductsTop1 products");
7812
- return /*#__PURE__*/React__default.createElement("div", {
7813
- className: "w-full pt-10 px-4 xl:px-20",
8674
+ }, /*#__PURE__*/React__default.createElement("div", {
8675
+ className: "rounded-3xl w-full py-10 md:px-10 sm:px-6 px-4",
7814
8676
  style: {
7815
- background: background
8677
+ background: secondary
7816
8678
  }
7817
8679
  }, /*#__PURE__*/React__default.createElement("h2", {
7818
- className: "text-2xl md:text-3xl lg:text-4xl font-semibold mb-6"
7819
- }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement(ListProduct, {
7820
- datas: products,
7821
- renderItem: function renderItem(item, index) {
7822
- return /*#__PURE__*/React__default.createElement("div", {
7823
- key: "productfsd-" + index
7824
- }, /*#__PURE__*/React__default.createElement(ItemProduct, {
7825
- product: item.productInfo,
7826
- shopConfigStyle: shopConfigStyle
7827
- }));
7828
- }
7829
- }));
7830
- };
7831
-
7832
- var getEmployeeListApi = function getEmployeeListApi(shopId) {
7833
- return api({
7834
- method: "post",
7835
- url: "/chain-employment-profile/filter-employ-by-customer",
7836
- headers: {
7837
- shopId: shopId
7838
- }
7839
- });
7840
- };
7841
-
7842
- var EmployeeController = function EmployeeController(props) {
7843
- var _props$isAutoGetList = props.isAutoGetList,
7844
- isAutoGetList = _props$isAutoGetList === void 0 ? true : _props$isAutoGetList,
7845
- shopConfig = props.shopConfig;
7846
- var _useState = useState([]),
7847
- listEmployment = _useState[0],
7848
- setListEmployment = _useState[1];
7849
- useEffect(function () {
7850
- if (isAutoGetList) {
7851
- getListEmployee();
7852
- }
7853
- }, [isAutoGetList]);
7854
- var getListEmployee = function getListEmployee() {
7855
- try {
7856
- return Promise.resolve(_catch(function () {
7857
- return Promise.resolve(getEmployeeListApi(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopId)).then(function (res) {
7858
- var _res$data, _res$data$status;
7859
- if ((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$status = _res$data.status) === null || _res$data$status === void 0 ? void 0 : _res$data$status.code) == 200) {
7860
- var _res$data2;
7861
- setListEmployment((res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.data) || []);
7862
- }
7863
- return res;
7864
- });
7865
- }, function (e) {
7866
- console.log(e);
7867
- }));
7868
- } catch (e) {
7869
- return Promise.reject(e);
7870
- }
7871
- };
7872
- return {
7873
- listEmployment: listEmployment,
7874
- getListEmployee: getListEmployee
7875
- };
7876
- };
7877
-
7878
- var createSpaScheduleApi = function createSpaScheduleApi(shopId, data) {
7879
- return api({
7880
- method: "post",
7881
- url: "/spa-schedule/customer/create",
7882
- data: data,
7883
- headers: {
7884
- shopId: shopId
8680
+ className: "font-semibold text-2xl md:text-3xl lg:text-4xl ps-5 pb-4",
8681
+ style: {
8682
+ color: textButton
7885
8683
  }
7886
- });
7887
- };
7888
-
7889
- var _excluded = ["productName"];
7890
- var BookingController = function BookingController(props) {
7891
- _objectDestructuringEmpty(props);
7892
- var createSchedule = function createSchedule(customerName, customerPhone, scheduleDate, services, shopId) {
7893
- try {
7894
- return Promise.resolve(_catch(function () {
7895
- var data = {
7896
- appId: "SSPA",
7897
- customerName: customerName,
7898
- customerPhone: customerPhone.replace("+", ""),
7899
- isSellService: true,
7900
- scheduleDate: new Date(scheduleDate).getTime(),
7901
- services: services === null || services === void 0 ? void 0 : services.map(function (_ref) {
7902
- var productName = _ref.productName,
7903
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
7904
- return rest;
7905
- }),
7906
- shopId: shopId
7907
- };
7908
- return Promise.resolve(createSpaScheduleApi(shopId, data));
7909
- }, function (e) {
7910
- console.log(e);
8684
+ }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement(Carousel, {
8685
+ datas: products,
8686
+ primaryColor: primary,
8687
+ renderItem: function renderItem(item, index) {
8688
+ return /*#__PURE__*/React__default.createElement("div", {
8689
+ key: "carousel-" + index,
8690
+ className: " min-w-[40vw] object-cover sm:min-w-[25vw] lg:min-w-[22vw] xl:min-w-[20vw] pe-4 xl:pe-6"
8691
+ }, /*#__PURE__*/React__default.createElement(ItemProduct, {
8692
+ product: item.productInfo,
8693
+ shopConfigStyle: shopConfigStyle
7911
8694
  }));
7912
- } catch (e) {
7913
- return Promise.reject(e);
7914
8695
  }
7915
- };
7916
- return {
7917
- createSchedule: createSchedule
7918
- };
8696
+ })));
7919
8697
  };
7920
8698
 
7921
- var Input = forwardRef(function (props, ref) {
7922
- var _props$label = props.label,
7923
- label = _props$label === void 0 ? "" : _props$label,
7924
- _props$placeholder = props.placeholder,
7925
- placeholder = _props$placeholder === void 0 ? "" : _props$placeholder,
8699
+ var Pagination = function Pagination(props) {
8700
+ var _props$size = props.size,
8701
+ size = _props$size === void 0 ? 24 : _props$size,
7926
8702
  _props$className = props.className,
7927
8703
  className = _props$className === void 0 ? "" : _props$className,
7928
- _props$name = props.name,
7929
- name = _props$name === void 0 ? "" : _props$name,
7930
- _props$onChange = props.onChange,
7931
- onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
7932
- _props$defaultValue = props.defaultValue,
7933
- defaultValue = _props$defaultValue === void 0 ? "" : _props$defaultValue,
7934
- _props$type = props.type,
7935
- type = _props$type === void 0 ? "text" : _props$type,
7936
- _props$rules = props.rules,
7937
- rules = _props$rules === void 0 ? [] : _props$rules;
7938
- var _useState = useState(defaultValue),
7939
- value = _useState[0],
7940
- _setValue = _useState[1];
7941
- var _useState2 = useState(""),
7942
- error = _useState2[0],
7943
- _setError = _useState2[1];
7944
- useImperativeHandle(ref, function () {
7945
- return {
7946
- validateData: function validateData() {
7947
- return _validateData();
7948
- },
7949
- setValue: function setValue(text) {
7950
- return _setValue(text);
7951
- },
7952
- getValue: function getValue() {
7953
- return value();
8704
+ _props$total_pages = props.total_pages,
8705
+ total_pages = _props$total_pages === void 0 ? 0 : _props$total_pages,
8706
+ _props$has_next = props.has_next,
8707
+ has_next = _props$has_next === void 0 ? true : _props$has_next,
8708
+ _props$has_previous = props.has_previous,
8709
+ has_previous = _props$has_previous === void 0 ? false : _props$has_previous,
8710
+ _props$current_page = props.current_page,
8711
+ current_page = _props$current_page === void 0 ? 0 : _props$current_page,
8712
+ _props$onPageChange = props.onPageChange,
8713
+ onPageChange = _props$onPageChange === void 0 ? function () {} : _props$onPageChange;
8714
+ var handlePageChange = function handlePageChange(page) {
8715
+ onPageChange(page);
8716
+ };
8717
+ return /*#__PURE__*/React__default.createElement("div", {
8718
+ className: "flex gap-4 items-center justify-self-center " + className
8719
+ }, /*#__PURE__*/React__default.createElement(IoChevronBackOutline, {
8720
+ className: has_previous ? "text-primary" : "text-gray3",
8721
+ size: size
8722
+ }), /*#__PURE__*/React__default.createElement("div", {
8723
+ className: "flex items-center space-x-1"
8724
+ }, Array(total_pages).fill().map(function (_, index) {
8725
+ return /*#__PURE__*/React__default.createElement("button", {
8726
+ key: index,
8727
+ onClick: function onClick() {
8728
+ return handlePageChange(index);
7954
8729
  },
7955
- setError: function setError(err) {
7956
- return _setError(err);
7957
- }
7958
- };
7959
- });
7960
- var _validateData = function _validateData() {
7961
- var count = 0;
7962
- rules.forEach(function (e) {
7963
- var _e$pattern;
7964
- if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && value === '') {
7965
- _setError(e === null || e === void 0 ? void 0 : e.message);
7966
- count++;
7967
- return false;
7968
- } else if ((e === null || e === void 0 ? void 0 : e.type) === 'pattern' && !(e !== null && e !== void 0 && (_e$pattern = e.pattern) !== null && _e$pattern !== void 0 && _e$pattern.test(value))) {
7969
- _setError(e === null || e === void 0 ? void 0 : e.message);
7970
- count++;
7971
- return false;
8730
+ className: "px-4 py-1 rounded-md " + (index === current_page ? 'bg-primary text-textButton' : 'bg-transparent text-primary') + " hover:opacity-80"
8731
+ }, index + 1);
8732
+ })), /*#__PURE__*/React__default.createElement(IoChevronForwardOutline, {
8733
+ className: has_next ? "text-primary" : "text-gray3",
8734
+ size: size
8735
+ }));
8736
+ };
8737
+
8738
+ var Products3 = function Products3(props) {
8739
+ var _props$shopConfigStyl = props.shopConfigStyle,
8740
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
8741
+ _props$data = props.data,
8742
+ data = _props$data === void 0 ? {} : _props$data,
8743
+ _props$SectionTitle = props.SectionTitle,
8744
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
8745
+ var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
8746
+ _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
8747
+ secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
8748
+ var _useState = useState({
8749
+ size: 6
8750
+ }),
8751
+ productParams = _useState[0],
8752
+ setProductParams = _useState[1];
8753
+ var _useState2 = useState(false),
8754
+ isAutoGetList = _useState2[0],
8755
+ setIsAutoGetList = _useState2[1];
8756
+ var _useState3 = useState(),
8757
+ categorySelected = _useState3[0],
8758
+ setCategorySelected = _useState3[1];
8759
+ var _ProductController = ProductController(_extends({}, props, {
8760
+ params: productParams,
8761
+ isAutoGetList: isAutoGetList
8762
+ })),
8763
+ _ProductController$pr = _ProductController.products,
8764
+ products = _ProductController$pr === void 0 ? [] : _ProductController$pr,
8765
+ loading = _ProductController.loading,
8766
+ page = _ProductController.page;
8767
+ var _CategoryController = CategoryController(_extends({}, props, {
8768
+ params: {
8769
+ type: "0"
7972
8770
  }
7973
- });
7974
- if (count) {
7975
- return false;
7976
- } else {
7977
- _setError('');
7978
- return true;
8771
+ })),
8772
+ categories = _CategoryController.categories;
8773
+ useEffect(function () {
8774
+ setCategorySelected(categories === null || categories === void 0 ? void 0 : categories[0]);
8775
+ }, [categories]);
8776
+ useEffect(function () {
8777
+ if (categorySelected) {
8778
+ setProductParams(_extends({}, productParams, {
8779
+ page: 0,
8780
+ categoryId: categorySelected === null || categorySelected === void 0 ? void 0 : categorySelected.categoryId
8781
+ }));
8782
+ setIsAutoGetList(true);
7979
8783
  }
8784
+ }, [categorySelected]);
8785
+ var onSelectCategory = function onSelectCategory(category) {
8786
+ setCategorySelected(category);
7980
8787
  };
7981
- var handleOnChange = function handleOnChange(event) {
7982
- var value = event.target.value;
7983
- _setValue(value);
7984
- onChange === null || onChange === void 0 ? void 0 : onChange(value);
8788
+ var onPageChange = function onPageChange(pageNum) {
8789
+ setProductParams(_extends({}, productParams, {
8790
+ page: pageNum
8791
+ }));
7985
8792
  };
7986
- var _className = "h-10 py-1 px-2 border border-stroke rounded " + className;
7987
- var required = !!(rules !== null && rules !== void 0 && rules.find(function (e) {
7988
- return (e === null || e === void 0 ? void 0 : e.type) === "required";
8793
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
8794
+ className: "" + SECTION_DEFAULT_CLASS
8795
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
8796
+ data: data,
8797
+ shopConfigStyle: shopConfigStyle
8798
+ }), /*#__PURE__*/React__default.createElement("div", {
8799
+ className: "grid grid-cols-1 md:grid-cols-4 gap-12"
8800
+ }, /*#__PURE__*/React__default.createElement("div", {
8801
+ className: "hidden md:block"
8802
+ }, /*#__PURE__*/React__default.createElement("div", {
8803
+ className: "text-xl"
8804
+ }, "Danh m\u1EE5c s\u1EA3n ph\u1EA9m"), categories === null || categories === void 0 ? void 0 : categories.map(function (category, index) {
8805
+ return /*#__PURE__*/React__default.createElement("div", {
8806
+ className: "flex gap-2 py-4 border-b border-stroke cursor-pointer hover:text-primary " + ((categorySelected === null || categorySelected === void 0 ? void 0 : categorySelected.categoryId) === (category === null || category === void 0 ? void 0 : category.categoryId) ? "text-primary" : "text-textSecondary"),
8807
+ key: index,
8808
+ onClick: function onClick() {
8809
+ return onSelectCategory(category);
8810
+ }
8811
+ }, /*#__PURE__*/React__default.createElement(IoIosHeartEmpty, {
8812
+ size: 24
8813
+ }), /*#__PURE__*/React__default.createElement("div", null, category === null || category === void 0 ? void 0 : category.cateName));
8814
+ })), /*#__PURE__*/React__default.createElement("div", {
8815
+ className: "md:hidden"
8816
+ }), /*#__PURE__*/React__default.createElement("div", {
8817
+ className: "col-span-3 text-center"
8818
+ }, loading ? /*#__PURE__*/React__default.createElement("div", {
8819
+ className: "flex w-full justify-center p-12"
8820
+ }, /*#__PURE__*/React__default.createElement(Loading, {
8821
+ size: 32
8822
+ })) : /*#__PURE__*/React__default.createElement("div", {
8823
+ className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-12 mt-12"
8824
+ }, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
8825
+ return /*#__PURE__*/React__default.createElement(ProductItem2, {
8826
+ key: index,
8827
+ product: product === null || product === void 0 ? void 0 : product.productInfo
8828
+ });
8829
+ })), /*#__PURE__*/React__default.createElement(Pagination, _extends({
8830
+ className: "mt-12"
8831
+ }, page, {
8832
+ onPageChange: onPageChange
8833
+ }))))), /*#__PURE__*/React__default.createElement(Dash, {
8834
+ color: secondary
7989
8835
  }));
7990
- var labelRequired = required ? /*#__PURE__*/React__default.createElement("span", {
7991
- className: "text-danger"
7992
- }, " *") : null;
7993
- return /*#__PURE__*/React__default.createElement("div", null, label ? /*#__PURE__*/React__default.createElement("div", {
7994
- className: "mb-1"
7995
- }, label, labelRequired) : null, /*#__PURE__*/React__default.createElement("input", {
7996
- type: type,
7997
- name: name,
7998
- value: value,
7999
- placeholder: placeholder,
8000
- onChange: handleOnChange,
8001
- required: required,
8002
- className: _className
8003
- }), error ? /*#__PURE__*/React__default.createElement("div", null, error) : null);
8004
- });
8836
+ };
8005
8837
 
8006
- var Select = forwardRef(function (props, ref) {
8007
- var _props$label = props.label,
8008
- label = _props$label === void 0 ? "" : _props$label,
8009
- _props$placeholder = props.placeholder,
8010
- placeholder = _props$placeholder === void 0 ? "" : _props$placeholder,
8838
+ var CarouselItem = function CarouselItem(props) {
8839
+ var listRef = useRef(null);
8840
+ var _useState = useState(false),
8841
+ isScrolledToLeft = _useState[0],
8842
+ setIsScrolledToLeft = _useState[1];
8843
+ var _useState2 = useState(true),
8844
+ isScrolledToRight = _useState2[0],
8845
+ setIsScrolledToRight = _useState2[1];
8846
+ var _props$datas = props.datas,
8847
+ datas = _props$datas === void 0 ? [] : _props$datas,
8011
8848
  _props$className = props.className,
8012
8849
  className = _props$className === void 0 ? "" : _props$className,
8013
- _props$name = props.name,
8014
- name = _props$name === void 0 ? "" : _props$name,
8015
- _props$onChange = props.onChange,
8016
- onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
8017
- _props$defaultValue = props.defaultValue,
8018
- defaultValue = _props$defaultValue === void 0 ? null : _props$defaultValue,
8019
- _props$rules = props.rules,
8020
- rules = _props$rules === void 0 ? [] : _props$rules,
8021
- _props$options = props.options,
8022
- options = _props$options === void 0 ? [] : _props$options,
8023
- _props$required = props.required,
8024
- required = _props$required === void 0 ? false : _props$required;
8025
- var _useState = useState(defaultValue),
8026
- value = _useState[0],
8027
- _setValue = _useState[1];
8028
- var _useState2 = useState(""),
8029
- error = _useState2[0],
8030
- _setError = _useState2[1];
8031
- useImperativeHandle(ref, function () {
8032
- return {
8033
- validateData: function validateData() {
8034
- return _validateData();
8035
- },
8036
- setValue: function setValue(text) {
8037
- return _setValue(text);
8038
- },
8039
- getValue: function getValue() {
8040
- return value();
8041
- },
8042
- setError: function setError(err) {
8043
- return _setError(err);
8044
- }
8045
- };
8046
- });
8047
- var _validateData = function _validateData() {
8048
- var count = 0;
8049
- rules.forEach(function (e) {
8050
- var _e$pattern;
8051
- if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && value === '') {
8052
- _setError(e === null || e === void 0 ? void 0 : e.message);
8053
- count++;
8054
- return false;
8055
- } else if ((e === null || e === void 0 ? void 0 : e.type) === 'pattern' && !(e !== null && e !== void 0 && (_e$pattern = e.pattern) !== null && _e$pattern !== void 0 && _e$pattern.test(value))) {
8056
- _setError(e === null || e === void 0 ? void 0 : e.message);
8057
- count++;
8058
- return false;
8059
- }
8060
- });
8061
- if (count) {
8062
- return false;
8063
- } else {
8064
- _setError('');
8065
- return true;
8850
+ _props$style = props.style,
8851
+ style = _props$style === void 0 ? {} : _props$style,
8852
+ _props$primaryColor = props.primaryColor,
8853
+ primaryColor = _props$primaryColor === void 0 ? "" : _props$primaryColor,
8854
+ _props$textButtonColo = props.textButtonColor,
8855
+ textButtonColor = _props$textButtonColo === void 0 ? "" : _props$textButtonColo,
8856
+ _props$renderItem = props.renderItem,
8857
+ renderItem = _props$renderItem === void 0 ? function () {} : _props$renderItem;
8858
+ var handleClickPrevImg = function handleClickPrevImg() {
8859
+ if (listRef.current) {
8860
+ setIsScrolledToLeft(true);
8861
+ setIsScrolledToRight(false);
8862
+ listRef.current.scrollBy({
8863
+ left: -80,
8864
+ behavior: "smooth"
8865
+ });
8866
+ }
8867
+ };
8868
+ var handleClickNextImg = function handleClickNextImg() {
8869
+ setIsScrolledToRight(true);
8870
+ setIsScrolledToLeft(false);
8871
+ if (listRef.current) {
8872
+ listRef.current.scrollBy({
8873
+ left: 80,
8874
+ behavior: "smooth"
8875
+ });
8066
8876
  }
8067
8877
  };
8068
- var handleOnChange = function handleOnChange(event) {
8069
- var value = event.target.value;
8070
- _setValue(value);
8071
- onChange === null || onChange === void 0 ? void 0 : onChange(value);
8072
- };
8073
- var _className = "h-10 py-1 px-2 border border-stroke rounded " + className;
8074
- var labelRequired = required ? /*#__PURE__*/React__default.createElement("span", {
8075
- className: "text-danger"
8076
- }, " *") : null;
8077
- return /*#__PURE__*/React__default.createElement("div", null, label ? /*#__PURE__*/React__default.createElement("div", {
8078
- className: "mb-1"
8079
- }, label, labelRequired) : null, /*#__PURE__*/React__default.createElement("select", {
8080
- name: name,
8081
- value: value,
8082
- onChange: handleOnChange,
8083
- required: required,
8084
- className: _className
8085
- }, /*#__PURE__*/React__default.createElement("option", {
8086
- value: "",
8087
- disabled: true,
8088
- selected: true,
8089
- hidden: true
8090
- }, placeholder), options === null || options === void 0 ? void 0 : options.map(function (option, index) {
8091
- return /*#__PURE__*/React__default.createElement("option", {
8092
- value: option.value,
8093
- key: index
8094
- }, option === null || option === void 0 ? void 0 : option.label);
8095
- })), error ? /*#__PURE__*/React__default.createElement("div", null, error) : null);
8096
- });
8878
+ console.log("check propsss::::::::", datas);
8879
+ return /*#__PURE__*/React__default.createElement("div", {
8880
+ className: "grid grid-cols-12 h-12 " + className,
8881
+ style: style
8882
+ }, /*#__PURE__*/React__default.createElement("div", {
8883
+ className: "col-span-12 lg:col-span-10 md:col-span-9 overflow-hidden "
8884
+ }, /*#__PURE__*/React__default.createElement("div", {
8885
+ className: "flex overflow-x-auto gap-2 hide-scrollbar items-center",
8886
+ ref: listRef
8887
+ }, datas && datas.length > 0 && datas.map(function (item, index) {
8888
+ return renderItem(item, index);
8889
+ }))), datas && datas.length > 0 && /*#__PURE__*/React__default.createElement("div", {
8890
+ className: "hidden my-auto col-span-5 md:col-span-3 lg:col-span-2 gap-4 md:flex justify-end "
8891
+ }, /*#__PURE__*/React__default.createElement("button", {
8892
+ className: " px-4 py-3 rounded-full",
8893
+ onClick: handleClickPrevImg,
8894
+ style: {
8895
+ backgroundColor: isScrolledToLeft ? primaryColor : "#BDBDBD"
8896
+ }
8897
+ }, /*#__PURE__*/React__default.createElement(FaArrowLeft, {
8898
+ className: "inline-block mb-1 text-lg",
8899
+ style: {
8900
+ color: textButtonColor
8901
+ }
8902
+ })), /*#__PURE__*/React__default.createElement("button", {
8903
+ className: "bg-gray2 px-4 py-3 rounded-full",
8904
+ style: {
8905
+ backgroundColor: isScrolledToRight ? primaryColor : "#BDBDBD"
8906
+ },
8907
+ onClick: handleClickNextImg
8908
+ }, /*#__PURE__*/React__default.createElement(FaArrowRight$1, {
8909
+ className: "inline-block mb-1 text-lg",
8910
+ style: {
8911
+ color: textButtonColor
8912
+ }
8913
+ }))));
8914
+ };
8097
8915
 
8098
- var DateTimePicker = function DateTimePicker(props) {
8099
- var _props$label = props.label,
8100
- label = _props$label === void 0 ? "" : _props$label,
8916
+ var ListProduct = function ListProduct(props) {
8917
+ var _props$datas = props.datas,
8918
+ datas = _props$datas === void 0 ? [] : _props$datas,
8919
+ _props$style = props.style,
8920
+ style = _props$style === void 0 ? {} : _props$style,
8101
8921
  _props$className = props.className,
8102
- className = _props$className === void 0 ? "" : _props$className,
8103
- _props$defaultValue = props.defaultValue,
8104
- defaultValue = _props$defaultValue === void 0 ? new Date() : _props$defaultValue,
8105
- _props$required = props.required,
8106
- required = _props$required === void 0 ? false : _props$required;
8107
- var _useState = useState(defaultValue),
8108
- value = _useState[0],
8109
- setValue = _useState[1];
8110
- var _useState2 = useState(""),
8111
- error = _useState2[0];
8112
- var _className = "h-10 flex items-center py-1 px-2 border border-stroke rounded bg-white cursor-pointer " + className;
8113
- var labelRequired = required ? /*#__PURE__*/React__default.createElement("span", {
8114
- className: "text-danger"
8115
- }, " *") : null;
8116
- var CustomInput = forwardRef(function (_ref, ref) {
8117
- var value = _ref.value,
8118
- onClick = _ref.onClick,
8119
- className = _ref.className;
8120
- return /*#__PURE__*/React__default.createElement("div", {
8121
- className: className,
8122
- onClick: onClick,
8123
- ref: ref
8124
- }, value);
8125
- });
8922
+ className = _props$className === void 0 ? {} : _props$className,
8923
+ _props$renderItem = props.renderItem,
8924
+ renderItem = _props$renderItem === void 0 ? function () {} : _props$renderItem;
8126
8925
  return /*#__PURE__*/React__default.createElement("div", {
8127
- className: "w-full"
8128
- }, label ? /*#__PURE__*/React__default.createElement("div", {
8129
- className: "mb-1"
8130
- }, label, labelRequired) : null, /*#__PURE__*/React__default.createElement(DatePicker, {
8131
- selected: value,
8132
- onChange: function onChange(date) {
8133
- return setValue(date);
8134
- },
8135
- customInput: /*#__PURE__*/React__default.createElement(CustomInput, {
8136
- className: _className
8137
- }),
8138
- wrapperClassName: "w-full"
8139
- }), error ? /*#__PURE__*/React__default.createElement("div", null, error) : null);
8926
+ className: "grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4 2xl:grid-cols-5 mt-6 " + className,
8927
+ style: style
8928
+ }, datas && datas.length > 0 && datas.map(function (item, index) {
8929
+ return renderItem(item, index);
8930
+ }));
8140
8931
  };
8141
8932
 
8142
- var BookingForm = function BookingForm(props) {
8933
+ var Products10 = function Products10(props) {
8934
+ var _useState = useState(""),
8935
+ selectCategory = _useState[0],
8936
+ setSelectCategory = _useState[1];
8937
+ var shopConfigStyle = props.shopConfigStyle,
8938
+ data = props.data;
8939
+ var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
8940
+ _shopConfigStyle$colo2 = _shopConfigStyle$colo.primary,
8941
+ primary = _shopConfigStyle$colo2 === void 0 ? "#000" : _shopConfigStyle$colo2,
8942
+ _shopConfigStyle$colo3 = _shopConfigStyle$colo.textBody,
8943
+ textBody = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
8944
+ _shopConfigStyle$colo4 = _shopConfigStyle$colo.textButton,
8945
+ textButton = _shopConfigStyle$colo4 === void 0 ? "#fff" : _shopConfigStyle$colo4,
8946
+ _shopConfigStyle$colo5 = _shopConfigStyle$colo.background,
8947
+ background = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5,
8948
+ _shopConfigStyle$colo6 = _shopConfigStyle$colo.bgSecondary,
8949
+ bgSecondary = _shopConfigStyle$colo6 === void 0 ? "#fff" : _shopConfigStyle$colo6;
8950
+ var _CategoryController = CategoryController(props),
8951
+ _CategoryController$c = _CategoryController.categories,
8952
+ categories = _CategoryController$c === void 0 ? [] : _CategoryController$c;
8953
+ var _ProductController = ProductController(props),
8954
+ _ProductController$pr = _ProductController.products,
8955
+ products = _ProductController$pr === void 0 ? [] : _ProductController$pr;
8956
+ console.log("Products10 products");
8957
+ return /*#__PURE__*/React__default.createElement("div", {
8958
+ className: "w-full pt-10 px-4 xl:px-20",
8959
+ style: {
8960
+ background: background,
8961
+ color: textBody
8962
+ }
8963
+ }, /*#__PURE__*/React__default.createElement("h2", {
8964
+ className: "text-2xl lg:text-3xl xl:text-4xl font-semibold mb-6"
8965
+ }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement(CarouselItem, {
8966
+ datas: categories,
8967
+ primaryColor: primary,
8968
+ textButtonColor: textButton,
8969
+ renderItem: function renderItem(item, index) {
8970
+ return /*#__PURE__*/React__default.createElement("div", {
8971
+ key: item.categoryId + "-" + index,
8972
+ className: "border-2 items whitespace-nowrap p-2 rounded-lg cursor-pointer ",
8973
+ style: {
8974
+ borderColor: primary,
8975
+ color: selectCategory === item.categoryId ? textButton : primary,
8976
+ background: selectCategory === item.categoryId ? primary : bgSecondary
8977
+ },
8978
+ onClick: function onClick() {
8979
+ setSelectCategory(item.categoryId);
8980
+ }
8981
+ }, item.cateName);
8982
+ }
8983
+ }), /*#__PURE__*/React__default.createElement(ListProduct, {
8984
+ datas: products,
8985
+ renderItem: function renderItem(item, index) {
8986
+ return /*#__PURE__*/React__default.createElement("div", {
8987
+ key: "productfsd-" + index
8988
+ }, /*#__PURE__*/React__default.createElement(ItemProduct, {
8989
+ product: item.productInfo,
8990
+ shopConfigStyle: shopConfigStyle
8991
+ }));
8992
+ }
8993
+ }));
8994
+ };
8995
+
8996
+ var ProductSale2 = function ProductSale2(props) {
8143
8997
  var _props$shopConfigStyl = props.shopConfigStyle,
8144
- shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl;
8998
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
8999
+ _props$data = props.data,
9000
+ data = _props$data === void 0 ? {} : _props$data,
9001
+ _props$SectionTitle = props.SectionTitle,
9002
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
8145
9003
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
8146
9004
  _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
8147
9005
  secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
8148
- var _useState = useState(false),
8149
- isAutoGetListProduct = _useState[0];
8150
- var _useState2 = useState({
8151
- types: "1,10"
9006
+ var _useState = useState({
9007
+ size: 4
9008
+ });
9009
+ var products = [];
9010
+ console.log("Products1 products");
9011
+ return products !== null && products !== void 0 && products.length ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
9012
+ className: SECTION_DEFAULT_CLASS + " text-center"
9013
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
9014
+ data: data,
9015
+ shopConfigStyle: shopConfigStyle
9016
+ }), /*#__PURE__*/React__default.createElement("div", {
9017
+ className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-10 mt-12"
9018
+ }, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
9019
+ return /*#__PURE__*/React__default.createElement(ProductItem2, {
9020
+ key: index,
9021
+ product: product === null || product === void 0 ? void 0 : product.productInfo
9022
+ });
9023
+ })), /*#__PURE__*/React__default.createElement(Button, {
9024
+ label: "Xem tất cả",
9025
+ shopConfigStyle: shopConfigStyle,
9026
+ className: "mt-12"
9027
+ })), /*#__PURE__*/React__default.createElement(Dash, {
9028
+ color: secondary
9029
+ })) : null;
9030
+ };
9031
+
9032
+ var ProductHot3 = function ProductHot3(props) {
9033
+ var _props$shopConfigStyl = props.shopConfigStyle,
9034
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
9035
+ _props$data = props.data,
9036
+ data = _props$data === void 0 ? {} : _props$data,
9037
+ _props$SectionTitle = props.SectionTitle,
9038
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
9039
+ var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
9040
+ _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
9041
+ secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
9042
+ var _useState = useState({
9043
+ size: 4,
9044
+ isHighlight: true
8152
9045
  }),
8153
- productsParams = _useState2[0];
8154
- var _useState3 = useState(false),
8155
- isAutoGetListEmployee = _useState3[0];
8156
- var _useState4 = useState(new Date());
8157
- var _EmployeeController = EmployeeController(_extends({}, props, {
8158
- isAutoGetList: isAutoGetListEmployee
8159
- }));
9046
+ params = _useState[0];
8160
9047
  var _ProductController = ProductController(_extends({}, props, {
8161
- isAutoGetList: isAutoGetListProduct,
8162
- params: productsParams
8163
- }));
8164
- console.log("BookingForm products");
8165
- var _BookingController = BookingController(props);
9048
+ params: params
9049
+ })),
9050
+ _ProductController$pr = _ProductController.products,
9051
+ products = _ProductController$pr === void 0 ? [] : _ProductController$pr;
9052
+ console.log("Products1 products");
9053
+ return products !== null && products !== void 0 && products.length ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
9054
+ className: SECTION_DEFAULT_CLASS + " text-center"
9055
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
9056
+ data: data,
9057
+ shopConfigStyle: shopConfigStyle
9058
+ }), /*#__PURE__*/React__default.createElement("div", {
9059
+ className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-10 mt-12"
9060
+ }, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
9061
+ return /*#__PURE__*/React__default.createElement(ProductItem2, {
9062
+ key: index,
9063
+ product: product === null || product === void 0 ? void 0 : product.productInfo
9064
+ });
9065
+ }))), /*#__PURE__*/React__default.createElement(Dash, {
9066
+ color: secondary
9067
+ })) : null;
9068
+ };
9069
+
9070
+ var ProductsTop1 = function ProductsTop1(props) {
9071
+ var data = props.data,
9072
+ shopConfigStyle = props.shopConfigStyle;
9073
+ var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
9074
+ _shopConfigStyle$colo2 = _shopConfigStyle$colo.background,
9075
+ background = _shopConfigStyle$colo2 === void 0 ? "#fff" : _shopConfigStyle$colo2;
9076
+ var _ProductController = ProductController(props),
9077
+ _ProductController$pr = _ProductController.products,
9078
+ products = _ProductController$pr === void 0 ? [] : _ProductController$pr;
9079
+ console.log("ProductsTop1 products");
8166
9080
  return /*#__PURE__*/React__default.createElement("div", {
8167
- className: "grid gap-4 rounded-lg p-6",
9081
+ className: "w-full pt-10 px-4 xl:px-20",
8168
9082
  style: {
8169
- backgroundColor: secondary
9083
+ background: background
9084
+ }
9085
+ }, /*#__PURE__*/React__default.createElement("h2", {
9086
+ className: "text-2xl md:text-3xl lg:text-4xl font-semibold mb-6"
9087
+ }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement(ListProduct, {
9088
+ datas: products,
9089
+ renderItem: function renderItem(item, index) {
9090
+ return /*#__PURE__*/React__default.createElement("div", {
9091
+ key: "productfsd-" + index
9092
+ }, /*#__PURE__*/React__default.createElement(ItemProduct, {
9093
+ product: item.productInfo,
9094
+ shopConfigStyle: shopConfigStyle
9095
+ }));
8170
9096
  }
9097
+ }));
9098
+ };
9099
+
9100
+ var CartController = function CartController(props) {
9101
+ var addToCart = props.addToCart,
9102
+ dispatch = props.dispatch;
9103
+ useEffect(function () {}, []);
9104
+ var addProductToCart = function addProductToCart(product, variant, quantity) {
9105
+ try {
9106
+ try {
9107
+ dispatch(addToCart({
9108
+ product: product,
9109
+ variant: variant,
9110
+ quantity: quantity
9111
+ }));
9112
+ } catch (e) {
9113
+ console.log(e);
9114
+ }
9115
+ return Promise.resolve();
9116
+ } catch (e) {
9117
+ return Promise.reject(e);
9118
+ }
9119
+ };
9120
+ return {
9121
+ addProductToCart: addProductToCart
9122
+ };
9123
+ };
9124
+
9125
+ var ProductDetail10 = function ProductDetail10(props) {
9126
+ var shopConfigStyle = props.shopConfigStyle;
9127
+ var _ProductDetailControl = ProductDetailController(props),
9128
+ product = _ProductDetailControl.product;
9129
+ var _useState = useState(),
9130
+ variant = _useState[0],
9131
+ setVariant = _useState[1];
9132
+ var _useState2 = useState([]),
9133
+ options = _useState2[0],
9134
+ setOptions = _useState2[1];
9135
+ var _CartController = CartController(props),
9136
+ addProductToCart = _CartController.addProductToCart;
9137
+ var refInputQuantity = useRef();
9138
+ useEffect(function () {
9139
+ if (product) {
9140
+ initVariant();
9141
+ }
9142
+ }, [product]);
9143
+ var initVariant = function initVariant() {
9144
+ var _product$variants;
9145
+ var variant = product === null || product === void 0 ? void 0 : (_product$variants = product.variants) === null || _product$variants === void 0 ? void 0 : _product$variants[0];
9146
+ var indexOptions = variant.index.split(",");
9147
+ setVariant(variant);
9148
+ var options = (product === null || product === void 0 ? void 0 : product.optionValues) || [];
9149
+ indexOptions.map(function (value, index) {
9150
+ return options[index].valueIndex = value;
9151
+ });
9152
+ setOptions(options);
9153
+ };
9154
+ var selectOption = function selectOption(optionIndex, valueIndex) {
9155
+ console.log("selectOption optionIndex valueIndex", optionIndex, valueIndex);
9156
+ var newOptions = [].concat(options);
9157
+ newOptions[optionIndex].valueIndex = valueIndex;
9158
+ setOptions(newOptions);
9159
+ console.log("newOptions", newOptions);
9160
+ var variant = getVariantFromOption(newOptions);
9161
+ console.log("getVariantFromOption variant", variant);
9162
+ setVariant(variant);
9163
+ };
9164
+ var getVariantFromOption = function getVariantFromOption(_options) {
9165
+ console.log("getVariantFromOption options", _options);
9166
+ var listOptionIndexSelected = _options.map(function (e) {
9167
+ return e.valueIndex;
9168
+ }).filter(function (e) {
9169
+ return e !== undefined;
9170
+ });
9171
+ var variantIndex = listOptionIndexSelected.join(",");
9172
+ return ((product === null || product === void 0 ? void 0 : product.variants) || []).find(function (e) {
9173
+ return e.index === variantIndex;
9174
+ });
9175
+ };
9176
+ var validateData = function validateData() {
9177
+ var _refInputQuantity$cur;
9178
+ return (refInputQuantity === null || refInputQuantity === void 0 ? void 0 : (_refInputQuantity$cur = refInputQuantity.current) === null || _refInputQuantity$cur === void 0 ? void 0 : _refInputQuantity$cur.validateData()) && variant;
9179
+ };
9180
+ var addToCart = function addToCart() {
9181
+ try {
9182
+ var _temp = function () {
9183
+ if (validateData()) {
9184
+ var _refInputQuantity$cur2;
9185
+ var quantity = refInputQuantity === null || refInputQuantity === void 0 ? void 0 : (_refInputQuantity$cur2 = refInputQuantity.current) === null || _refInputQuantity$cur2 === void 0 ? void 0 : _refInputQuantity$cur2.getValue();
9186
+ return Promise.resolve(addProductToCart(product, variant, quantity)).then(function () {});
9187
+ }
9188
+ }();
9189
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
9190
+ } catch (e) {
9191
+ return Promise.reject(e);
9192
+ }
9193
+ };
9194
+ var buyNow = function buyNow() {};
9195
+ return /*#__PURE__*/React__default.createElement("div", {
9196
+ className: SECTION_DEFAULT_CLASS + " mb-0"
8171
9197
  }, /*#__PURE__*/React__default.createElement("div", {
8172
- className: "grid grid-cols-1 md:grid-cols-2 gap-4"
8173
- }, /*#__PURE__*/React__default.createElement(Input, {
8174
- label: "Họ tên",
8175
- placeholder: "Nhập họ tên",
8176
- rules: [{
8177
- type: "required",
8178
- message: "Bắt buộc nhập họ tên"
8179
- }],
8180
- className: "w-full rounded-lg"
9198
+ className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-3 gap-6 bg-bgSecondary"
9199
+ }, /*#__PURE__*/React__default.createElement(ProductImage, {
9200
+ product: product,
9201
+ className: "w-full aspect-square rounded-2xl"
9202
+ }), /*#__PURE__*/React__default.createElement("div", {
9203
+ className: "col-span-2"
9204
+ }, /*#__PURE__*/React__default.createElement("p", {
9205
+ className: "font-semibold text-2xl"
9206
+ }, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
9207
+ product: product,
9208
+ variant: variant,
9209
+ className: "mt-6"
9210
+ }), options.map(function (option, index) {
9211
+ return /*#__PURE__*/React__default.createElement("div", {
9212
+ className: "flex gap-2 mt-6",
9213
+ key: index
9214
+ }, /*#__PURE__*/React__default.createElement("div", {
9215
+ className: "min-w-24"
9216
+ }, option === null || option === void 0 ? void 0 : option.name, ":"), /*#__PURE__*/React__default.createElement("div", {
9217
+ className: "flex gap-2"
9218
+ }, ((option === null || option === void 0 ? void 0 : option.value) || []).map(function (v, i) {
9219
+ return /*#__PURE__*/React__default.createElement("button", {
9220
+ key: i,
9221
+ onClick: function onClick() {
9222
+ return selectOption(index, i);
9223
+ },
9224
+ className: "rounded py-1 px-2 " + (i == option.valueIndex ? "bg-primary text-textButton" : "border bg-gray6")
9225
+ }, v);
9226
+ })));
8181
9227
  }), /*#__PURE__*/React__default.createElement(Input, {
8182
- label: "Họ tên",
8183
- placeholder: "Nhập họ tên",
9228
+ label: "Số lượng",
9229
+ wrapClassName: "flex items-center gap-6 mt-6",
8184
9230
  rules: [{
8185
9231
  type: "required",
8186
- message: "Bắt buộc nhập họ tên"
8187
- }],
8188
- className: "w-full rounded-lg"
8189
- })), /*#__PURE__*/React__default.createElement("div", {
8190
- className: "grid grid-cols-1 md:grid-cols-2 gap-4"
8191
- }, /*#__PURE__*/React__default.createElement(Select, {
8192
- label: "Dịch vụ",
8193
- options: [{
8194
- label: "123",
8195
- value: "456"
9232
+ message: "Bắt buộc nhập số lượng"
8196
9233
  }, {
8197
- label: "1235",
8198
- value: "4567"
9234
+ type: "pattern",
9235
+ pattern: numberPattern,
9236
+ message: "Số lượng không đúng"
8199
9237
  }],
8200
- className: "w-full rounded-lg",
8201
- placeholder: "Chọn dịch vụ"
8202
- }), /*#__PURE__*/React__default.createElement(DateTimePicker, {
8203
- label: "Thời gian",
8204
- className: "w-full rounded-lg",
8205
- placeholder: "Chọn thời gian"
8206
- })), /*#__PURE__*/React__default.createElement("div", {
8207
- className: "text-center"
9238
+ defaultValue: 1,
9239
+ isQuantity: true,
9240
+ min: 1,
9241
+ ref: refInputQuantity
9242
+ }), /*#__PURE__*/React__default.createElement("div", {
9243
+ className: "flex gap-4 mt-6"
8208
9244
  }, /*#__PURE__*/React__default.createElement(Button, {
8209
- label: "Đặt lịch ngay",
8210
- shopConfigStyle: shopConfigStyle
8211
- })));
9245
+ label: "THÊM VÀO GIỎ",
9246
+ shopConfigStyle: shopConfigStyle,
9247
+ type: "outline",
9248
+ onClick: function onClick() {
9249
+ return addToCart();
9250
+ }
9251
+ }), /*#__PURE__*/React__default.createElement(Button, {
9252
+ label: "MUA NGAY",
9253
+ shopConfigStyle: shopConfigStyle,
9254
+ onClick: function onClick() {
9255
+ return buyNow();
9256
+ }
9257
+ })), /*#__PURE__*/React__default.createElement("p", {
9258
+ className: "text-lg mt-12 pt-6 border-t border-stroke"
9259
+ }, "M\xF4 t\u1EA3 s\u1EA3n ph\u1EA9m"), product !== null && product !== void 0 && product.description ? /*#__PURE__*/React__default.createElement("div", {
9260
+ className: "mt-6",
9261
+ dangerouslySetInnerHTML: {
9262
+ __html: product === null || product === void 0 ? void 0 : product.description
9263
+ }
9264
+ }) : /*#__PURE__*/React__default.createElement("div", {
9265
+ className: "text-gray3 mt-2"
9266
+ }, "Kh\xF4ng c\xF3 th\xF4ng tin"))));
8212
9267
  };
8213
9268
 
8214
9269
  var Booking1 = function Booking1(props) {
@@ -8458,6 +9513,142 @@ var Footer1 = function Footer1(props) {
8458
9513
  }, "Xem \u0111i\u1EC1u kho\u1EA3n v\xE0 ch\xEDnh s\xE1ch"))));
8459
9514
  };
8460
9515
 
9516
+ var Footer7 = function Footer7(props) {
9517
+ var _routes$filter;
9518
+ var shopConfig = props.shopConfig,
9519
+ shopConfigStyle = props.shopConfigStyle,
9520
+ _props$routes = props.routes,
9521
+ routes = _props$routes === void 0 ? [] : _props$routes;
9522
+ var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
9523
+ _shopConfigStyle$colo2 = _shopConfigStyle$colo.primary,
9524
+ primary = _shopConfigStyle$colo2 === void 0 ? "#000" : _shopConfigStyle$colo2,
9525
+ _shopConfigStyle$colo3 = _shopConfigStyle$colo.textBody,
9526
+ textBody = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
9527
+ _shopConfigStyle$colo4 = _shopConfigStyle$colo.textButton,
9528
+ textButton = _shopConfigStyle$colo4 === void 0 ? "#fff" : _shopConfigStyle$colo4,
9529
+ _shopConfigStyle$colo5 = _shopConfigStyle$colo.bgSecondary,
9530
+ bgSecondary = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5;
9531
+ console.log("Footer7 shopConfig", shopConfig);
9532
+ var _useState = useState([]),
9533
+ shopAddressList = _useState[0],
9534
+ setShopAddressList = _useState[1];
9535
+ useEffect(function () {
9536
+ genShopAddress();
9537
+ }, [shopConfig]);
9538
+ var genShopAddress = function genShopAddress() {
9539
+ try {
9540
+ var addressJson = JSON.parse(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopAddress);
9541
+ if (addressJson) {
9542
+ setShopAddressList(addressJson);
9543
+ } else {
9544
+ setShopAddressList([{
9545
+ address: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopAddress,
9546
+ phone: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopPhone
9547
+ }]);
9548
+ }
9549
+ } catch (e) {
9550
+ setShopAddressList([{
9551
+ address: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopAddress,
9552
+ phone: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopPhone
9553
+ }]);
9554
+ }
9555
+ };
9556
+ return /*#__PURE__*/React__default.createElement("div", {
9557
+ className: "footer px-4 pt-10 xl:px-20",
9558
+ style: {
9559
+ background: bgSecondary,
9560
+ color: textBody
9561
+ }
9562
+ }, /*#__PURE__*/React__default.createElement("div", {
9563
+ className: "flex items-center gap-2"
9564
+ }, /*#__PURE__*/React__default.createElement("img", {
9565
+ className: "object-cover w-14",
9566
+ src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
9567
+ alt: ""
9568
+ }), /*#__PURE__*/React__default.createElement("h3", {
9569
+ className: " text-2xl md:text-3xl font-semibold ms-2",
9570
+ style: {
9571
+ color: primary
9572
+ }
9573
+ }, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName)), /*#__PURE__*/React__default.createElement("div", {
9574
+ className: "mt-6 grid grid-cols-1 sm:grid-cols-4 gap-6"
9575
+ }, /*#__PURE__*/React__default.createElement("div", {
9576
+ className: " col-span-2 flex flex-col leading-8 mb-10 sm:mb-0 "
9577
+ }, /*#__PURE__*/React__default.createElement("div", {
9578
+ className: "mb-3 font-semibold text-md md:text-lg"
9579
+ }, "Th\xF4ng tin li\xEAn h\u1EC7"), shopAddressList === null || shopAddressList === void 0 ? void 0 : shopAddressList.map(function (item, index) {
9580
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", null, "C\u01A1 s\u1EDF ", index + 1), /*#__PURE__*/React__default.createElement("div", {
9581
+ className: "flex gap-1"
9582
+ }, /*#__PURE__*/React__default.createElement(IoLocationOutline, {
9583
+ size: 24,
9584
+ className: "inline-block mt-1",
9585
+ style: {
9586
+ color: primary
9587
+ }
9588
+ }), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.address)), /*#__PURE__*/React__default.createElement("div", {
9589
+ className: "flex gap-1"
9590
+ }, /*#__PURE__*/React__default.createElement(IoCallOutline, {
9591
+ size: 24,
9592
+ className: "inline-block mt-1",
9593
+ style: {
9594
+ color: primary
9595
+ }
9596
+ }), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.phone)));
9597
+ })), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
9598
+ className: "mb-4 font-semibold text-lg"
9599
+ }, "Li\xEAn k\u1EBFt"), /*#__PURE__*/React__default.createElement("div", {
9600
+ className: "leading-10 flex flex-col "
9601
+ }, routes === null || routes === void 0 ? void 0 : (_routes$filter = routes.filter(function (e) {
9602
+ return e === null || e === void 0 ? void 0 : e.isShow;
9603
+ })) === null || _routes$filter === void 0 ? void 0 : _routes$filter.map(function (route, index) {
9604
+ return /*#__PURE__*/React__default.createElement("a", {
9605
+ href: route === null || route === void 0 ? void 0 : route.route
9606
+ }, /*#__PURE__*/React__default.createElement("div", null, route === null || route === void 0 ? void 0 : route.label));
9607
+ }))), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
9608
+ className: "font-semibold mb-4 text-lg"
9609
+ }, "H\u1ED7 tr\u1EE3"), /*#__PURE__*/React__default.createElement("div", {
9610
+ className: "flex justify-start items-center gap-4"
9611
+ }, /*#__PURE__*/React__default.createElement("a", {
9612
+ href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopFacebookPage) || "#"
9613
+ }, /*#__PURE__*/React__default.createElement(FaFacebookF, {
9614
+ size: 40,
9615
+ color: textButton,
9616
+ className: "p-2 rounded-lg",
9617
+ style: {
9618
+ background: primary
9619
+ }
9620
+ })), /*#__PURE__*/React__default.createElement("a", {
9621
+ href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopMessenger) || "#"
9622
+ }, /*#__PURE__*/React__default.createElement(FaFacebookMessenger, {
9623
+ size: 40,
9624
+ color: textButton,
9625
+ className: "p-2 rounded-lg",
9626
+ style: {
9627
+ background: primary
9628
+ }
9629
+ })), /*#__PURE__*/React__default.createElement("a", {
9630
+ href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopZalo) || "#"
9631
+ }, /*#__PURE__*/React__default.createElement(SiZalo, {
9632
+ size: 40,
9633
+ color: textButton,
9634
+ className: "p-2 rounded-lg",
9635
+ style: {
9636
+ background: primary
9637
+ }
9638
+ }))))), /*#__PURE__*/React__default.createElement("hr", null), /*#__PURE__*/React__default.createElement("div", {
9639
+ className: "py-4"
9640
+ }, /*#__PURE__*/React__default.createElement("small", {
9641
+ className: "me-5"
9642
+ }, "B\u1EA3n quy\u1EC1n thu\u1ED9c c\xF4ng ty c\u1ED5 ph\u1EA7n c\xF4ng ngh\u1EC7 th\xF4ng minh SFIN."), /*#__PURE__*/React__default.createElement("a", {
9643
+ href: "#"
9644
+ }, /*#__PURE__*/React__default.createElement("small", {
9645
+ className: "underline decoration-solid",
9646
+ style: {
9647
+ color: primary
9648
+ }
9649
+ }, "Xem \u0111i\u1EC1u kho\u1EA3n v\xE0 ch\xEDnh s\xE1ch"))));
9650
+ };
9651
+
8461
9652
  var RatingStar = function RatingStar(props) {
8462
9653
  var _props$star = props.star,
8463
9654
  star = _props$star === void 0 ? 5 : _props$star,
@@ -8498,14 +9689,9 @@ var CustomerRating10 = function CustomerRating10(props) {
8498
9689
  SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
8499
9690
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
8500
9691
  _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
8501
- secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
8502
- _shopConfigStyle$colo5 = _shopConfigStyle$colo.background,
8503
- background = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5;
9692
+ secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
8504
9693
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
8505
- className: "relative w-full py-12 px-4 xl:px-20",
8506
- style: {
8507
- backgroundColor: background
8508
- }
9694
+ className: SECTION_DEFAULT_CLASS
8509
9695
  }, /*#__PURE__*/React__default.createElement(SectionTitle, {
8510
9696
  data: data,
8511
9697
  shopConfigStyle: shopConfigStyle
@@ -8542,18 +9728,12 @@ var Employees1 = function Employees1(props) {
8542
9728
  SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
8543
9729
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
8544
9730
  _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
8545
- secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
8546
- _shopConfigStyle$colo5 = _shopConfigStyle$colo.background,
8547
- background = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5;
9731
+ secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
8548
9732
  console.log("Employee data", data);
8549
9733
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
8550
- className: "relative w-full py-12 px-4 xl:px-20",
8551
- style: {
8552
- backgroundColor: background
8553
- }
9734
+ className: SECTION_DEFAULT_CLASS + " relative"
8554
9735
  }, /*#__PURE__*/React__default.createElement(SectionTitle, {
8555
- data: data,
8556
- shopConfigStyle: shopConfigStyle
9736
+ data: data
8557
9737
  }), /*#__PURE__*/React__default.createElement("div", {
8558
9738
  className: "mt-12 grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 lg:gap-12"
8559
9739
  }, data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.map(function (item, index) {
@@ -8585,15 +9765,10 @@ var Gallery1 = function Gallery1(props) {
8585
9765
  SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
8586
9766
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
8587
9767
  _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
8588
- secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
8589
- _shopConfigStyle$colo5 = _shopConfigStyle$colo.background,
8590
- background = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5;
9768
+ secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
8591
9769
  console.log("Gallery1 data", data);
8592
9770
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
8593
- className: "relative w-full py-12 px-4 xl:px-20",
8594
- style: {
8595
- backgroundColor: background
8596
- }
9771
+ className: "" + SECTION_DEFAULT_CLASS
8597
9772
  }, /*#__PURE__*/React__default.createElement(SectionTitle, {
8598
9773
  data: data,
8599
9774
  shopConfigStyle: shopConfigStyle
@@ -8610,5 +9785,216 @@ var Gallery1 = function Gallery1(props) {
8610
9785
  }));
8611
9786
  };
8612
9787
 
8613
- export { Address1, Banner1, Booking1, CustomerRating10, Employees1, Features1, Features2, Features3, Footer1, Gallery1, Hero10, Hero11, Hero11$1 as Hero12, Hero13, Links1, NavBar7, Partner1, Products1, Products10, Products2, ProductsTop1, SectionTitle1, Treatments1, Treatments1$1 as Treatments2 };
9788
+ var PageTitle1 = function PageTitle1(props) {
9789
+ var _sectionData$;
9790
+ var data = props.data,
9791
+ route = props.route;
9792
+ var sectionData = data === null || data === void 0 ? void 0 : data.data;
9793
+ return /*#__PURE__*/React__default.createElement("div", {
9794
+ className: "relative w-full bg-cover bg-center bg-no-repeat ",
9795
+ style: {
9796
+ backgroundImage: "url(" + (sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$ = sectionData[0]) === null || _sectionData$ === void 0 ? void 0 : _sectionData$.srcImage) + ")"
9797
+ }
9798
+ }, /*#__PURE__*/React__default.createElement("div", {
9799
+ className: "absolute top-0 w-full h-full bg-black opacity-40 z-0"
9800
+ }), /*#__PURE__*/React__default.createElement("div", {
9801
+ className: "relative w-full p-20 z-10 flex flex-col gap-6 items-center justify-center"
9802
+ }, /*#__PURE__*/React__default.createElement("div", {
9803
+ className: "text-3xl md:text-5xl text-white leading-[1.6] md:leading-[1.6] text-center font-headingFont"
9804
+ }, route === null || route === void 0 ? void 0 : route.label)));
9805
+ };
9806
+
9807
+ var About5 = function About5(props) {
9808
+ var _sectionData$, _sectionData$2;
9809
+ var shopConfig = props.shopConfig,
9810
+ data = props.data;
9811
+ var sectionData = data === null || data === void 0 ? void 0 : data.data;
9812
+ console.log("About5 sectionData", sectionData);
9813
+ return /*#__PURE__*/React__default.createElement("div", {
9814
+ className: SECTION_DEFAULT_CLASS + " grid grid-cols-1 lg:grid-cols-2 gap-12"
9815
+ }, /*#__PURE__*/React__default.createElement("img", {
9816
+ src: sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$ = sectionData[0]) === null || _sectionData$ === void 0 ? void 0 : _sectionData$.srcImage,
9817
+ className: "w-full hidden lg:block rounded-xl"
9818
+ }), /*#__PURE__*/React__default.createElement("div", {
9819
+ className: "ck-content",
9820
+ dangerouslySetInnerHTML: {
9821
+ __html: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopAbout
9822
+ }
9823
+ }), /*#__PURE__*/React__default.createElement("img", {
9824
+ src: sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$2 = sectionData[0]) === null || _sectionData$2 === void 0 ? void 0 : _sectionData$2.srcImage,
9825
+ className: "w-full block lg:hidden rounded-xl"
9826
+ }));
9827
+ };
9828
+
9829
+ var Contact1 = function Contact1(props) {
9830
+ var _sectionData$;
9831
+ var shopConfigStyle = props.shopConfigStyle,
9832
+ shopConfig = props.shopConfig,
9833
+ data = props.data,
9834
+ _props$SectionTitle = props.SectionTitle,
9835
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
9836
+ var sectionData = data === null || data === void 0 ? void 0 : data.data;
9837
+ return /*#__PURE__*/React__default.createElement("div", {
9838
+ className: "" + SECTION_DEFAULT_CLASS
9839
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
9840
+ data: data,
9841
+ shopConfigStyle: shopConfigStyle
9842
+ }), /*#__PURE__*/React__default.createElement("div", {
9843
+ className: "grid grid-cols-1 lg:grid-cols-2 gap-12 mt-6"
9844
+ }, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("p", null, "Trong qu\xE1 tr\xECnh gh\xE9 th\u0103m website, n\u1EBFu qu\xFD kh\xE1ch c\xF3 b\u1EA5t k\u1EF3 th\u1EAFc m\u1EAFc hay c\u1EA7n s\u1EF1 h\u1ED7 tr\u1EE3 n\xE0o, h\xE3y li\xEAn h\u1EC7 v\u1EDBi ch\xFAng t\xF4i theo c\xE1c k\xEAnh sau: "), shopConfig !== null && shopConfig !== void 0 && shopConfig.shopPhone ? /*#__PURE__*/React__default.createElement("div", {
9845
+ className: "flex items-center gap-2 rounded-lg overflow-hidden bg-white mt-6"
9846
+ }, /*#__PURE__*/React__default.createElement(FaFacebookF, {
9847
+ size: 40,
9848
+ className: "p-2 text-textButton bg-primary"
9849
+ }), /*#__PURE__*/React__default.createElement("div", null, "S\u1ED1 \u0111i\u1EC7n tho\u1EA1i: ", shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopPhone)) : null, shopConfig !== null && shopConfig !== void 0 && shopConfig.shopZalo ? /*#__PURE__*/React__default.createElement("div", {
9850
+ className: "flex items-center gap-2 rounded-lg overflow-hidden bg-white mt-6"
9851
+ }, /*#__PURE__*/React__default.createElement(SiZalo, {
9852
+ size: 40,
9853
+ className: "p-2 text-textButton bg-primary"
9854
+ }), /*#__PURE__*/React__default.createElement("div", null, "Zalo: ", shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopZalo)) : null, shopConfig !== null && shopConfig !== void 0 && shopConfig.shopFacebookPage ? /*#__PURE__*/React__default.createElement("div", {
9855
+ className: "flex items-center gap-2 rounded-lg overflow-hidden bg-white mt-6"
9856
+ }, /*#__PURE__*/React__default.createElement(FaFacebookF, {
9857
+ size: 40,
9858
+ className: "p-2 text-textButton bg-primary"
9859
+ }), /*#__PURE__*/React__default.createElement("div", null, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopFacebookPage)) : null, shopConfig !== null && shopConfig !== void 0 && shopConfig.shopMessenger ? /*#__PURE__*/React__default.createElement("div", {
9860
+ className: "flex items-center gap-2 rounded-lg overflow-hidden bg-white mt-6"
9861
+ }, /*#__PURE__*/React__default.createElement(FaFacebookMessenger, {
9862
+ size: 40,
9863
+ className: "p-2 text-textButton bg-primary"
9864
+ }), /*#__PURE__*/React__default.createElement("div", null, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopMessenger)) : null), /*#__PURE__*/React__default.createElement("img", {
9865
+ src: sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$ = sectionData[0]) === null || _sectionData$ === void 0 ? void 0 : _sectionData$.srcImage,
9866
+ className: "w-full rounded-xl border-white border-8 shadow-lg"
9867
+ })));
9868
+ };
9869
+
9870
+ var Breadcrumb1 = function Breadcrumb1(props) {
9871
+ var shopConfigStyle = props.shopConfigStyle,
9872
+ route = props.route,
9873
+ _props$routes = props.routes,
9874
+ routes = _props$routes === void 0 ? [] : _props$routes;
9875
+ var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
9876
+ _shopConfigStyle$colo3 = _shopConfigStyle$colo.textHeading,
9877
+ textHeading = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
9878
+ var _useState = useState([]),
9879
+ items = _useState[0],
9880
+ setItems = _useState[1];
9881
+ useEffect(function () {
9882
+ getItems();
9883
+ }, [route]);
9884
+ var getItems = function getItems() {
9885
+ var _route$route, _route$route$split, _route$route$split$fi;
9886
+ var items = route === null || route === void 0 ? void 0 : (_route$route = route.route) === null || _route$route === void 0 ? void 0 : (_route$route$split = _route$route.split("/")) === null || _route$route$split === void 0 ? void 0 : (_route$route$split$fi = _route$route$split.filter(function (e) {
9887
+ return e === null || e === void 0 ? void 0 : e.length;
9888
+ })) === null || _route$route$split$fi === void 0 ? void 0 : _route$route$split$fi.slice(0, 2);
9889
+ items = items.map(function (e) {
9890
+ return (routes === null || routes === void 0 ? void 0 : routes.find(function (r) {
9891
+ return (r === null || r === void 0 ? void 0 : r.name) === e;
9892
+ })) || {
9893
+ label: e
9894
+ };
9895
+ });
9896
+ items.unshift({
9897
+ name: "home",
9898
+ label: "Trang chủ",
9899
+ route: "/"
9900
+ });
9901
+ setItems(items);
9902
+ };
9903
+ return /*#__PURE__*/React__default.createElement("div", {
9904
+ className: SECTION_DEFAULT_CLASS + " !my-6 flex gap-2"
9905
+ }, items === null || items === void 0 ? void 0 : items.map(function (item, index) {
9906
+ return /*#__PURE__*/React__default.createElement("div", {
9907
+ key: index,
9908
+ className: "flex gap-2"
9909
+ }, index ? /*#__PURE__*/React__default.createElement("div", {
9910
+ className: "text-gray4"
9911
+ }, "/") : null, item !== null && item !== void 0 && item.route ? /*#__PURE__*/React__default.createElement("a", {
9912
+ href: item === null || item === void 0 ? void 0 : item.route,
9913
+ style: {
9914
+ color: textHeading
9915
+ }
9916
+ }, item === null || item === void 0 ? void 0 : item.label) : /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.label));
9917
+ }));
9918
+ };
9919
+
9920
+ var Carts1 = function Carts1(props) {
9921
+ var _props$cartItems = props.cartItems,
9922
+ cartItems = _props$cartItems === void 0 ? [] : _props$cartItems;
9923
+ var _useState = useState(false),
9924
+ checkAll = _useState[0],
9925
+ setCheckAll = _useState[1];
9926
+ var handleCheckAll = function handleCheckAll(event) {
9927
+ var _event$target = event.target,
9928
+ checked = _event$target.checked;
9929
+ setCheckAll(checked);
9930
+ };
9931
+ return /*#__PURE__*/React__default.createElement("div", {
9932
+ className: SECTION_DEFAULT_CLASS + " mt-0 rounded-2xl bg-bgSecondary p-4"
9933
+ }, /*#__PURE__*/React__default.createElement("div", {
9934
+ className: "flex gap-4 pb-4"
9935
+ }, /*#__PURE__*/React__default.createElement("input", {
9936
+ type: "checkbox",
9937
+ checked: checkAll,
9938
+ onChange: handleCheckAll
9939
+ }), /*#__PURE__*/React__default.createElement("div", {
9940
+ className: "flex-1"
9941
+ }, "S\u1EA3n ph\u1EA9m"), /*#__PURE__*/React__default.createElement("div", {
9942
+ className: "w-32 text-right"
9943
+ }, "\u0110\u01A1n gi\xE1"), /*#__PURE__*/React__default.createElement("div", {
9944
+ className: "w-32 text-center"
9945
+ }, "S\u1ED1 l\u01B0\u1EE3ng"), /*#__PURE__*/React__default.createElement("div", {
9946
+ className: "w-32 text-right"
9947
+ }, "Th\xE0nh ti\u1EC1n"), /*#__PURE__*/React__default.createElement("div", {
9948
+ className: "w-32 text-center"
9949
+ }, "H\xE0nh \u0111\u1ED9ng")), cartItems.map(function (item, index) {
9950
+ return /*#__PURE__*/React__default.createElement(CartItem, {
9951
+ item: item,
9952
+ key: index
9953
+ });
9954
+ }));
9955
+ };
9956
+ var CartItem = function CartItem(props) {
9957
+ var item = props.item;
9958
+ var _useState2 = useState(item.quantity),
9959
+ quantity = _useState2[0],
9960
+ setQuantity = _useState2[1];
9961
+ var refInputQuantity = useRef();
9962
+ var handleCheckItem = function handleCheckItem(event) {};
9963
+ return /*#__PURE__*/React__default.createElement("div", {
9964
+ className: "flex items-center gap-4 border-t py-4"
9965
+ }, /*#__PURE__*/React__default.createElement("input", {
9966
+ type: "checkbox",
9967
+ checked: false,
9968
+ onChange: handleCheckItem
9969
+ }), /*#__PURE__*/React__default.createElement("div", {
9970
+ className: "flex-1"
9971
+ }, "S\u1EA3n ph\u1EA9m"), /*#__PURE__*/React__default.createElement("div", {
9972
+ className: "w-32 text-right"
9973
+ }, formatCurrency(item.price)), /*#__PURE__*/React__default.createElement("div", {
9974
+ className: "w-32 text-right"
9975
+ }, /*#__PURE__*/React__default.createElement(Input, {
9976
+ rules: [{
9977
+ type: "required",
9978
+ message: "Bắt buộc nhập số lượng"
9979
+ }, {
9980
+ type: "pattern",
9981
+ pattern: numberPattern,
9982
+ message: "Số lượng không đúng"
9983
+ }],
9984
+ defaultValue: quantity,
9985
+ isQuantity: true,
9986
+ min: 1,
9987
+ onChange: function onChange(text) {
9988
+ return setQuantity(parseInt(text));
9989
+ },
9990
+ ref: refInputQuantity,
9991
+ wrapClassName: "w-fit mx-auto"
9992
+ })), /*#__PURE__*/React__default.createElement("div", {
9993
+ className: "w-32 text-right"
9994
+ }, formatCurrency(item.price * quantity)), /*#__PURE__*/React__default.createElement("div", {
9995
+ className: "w-32 text-center"
9996
+ }, "H\xE0nh \u0111\u1ED9ng"));
9997
+ };
9998
+
9999
+ export { About5, Address1, Banner1, Booking1, Breadcrumb1, Carts1, Contact1, CustomerRating10, Employees1, Features1, Features2, Features3, Footer1, Footer7, Gallery1, Hero10, Hero11, Hero11$1 as Hero12, Hero13, Links1, NavBar7, PageTitle1, Partner1, ProductDetail10, ProductHot3, ProductSale2, Products1, Products10, Products2, Products3, ProductsTop1, SectionTitle1, ServiceDetail1, Treatments1, Treatments1$1 as Treatments2 };
8614
10000
  //# sourceMappingURL=index.modern.js.map