s-platform-landing-section 0.1.20 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -6,10 +6,11 @@ var io5 = require('react-icons/io5');
6
6
  var fa = require('react-icons/fa');
7
7
  var fi = require('react-icons/fi');
8
8
  var rx = require('react-icons/rx');
9
+ var pi = require('react-icons/pi');
10
+ var tb = require('react-icons/tb');
9
11
  var si = require('react-icons/si');
10
12
  var io = require('react-icons/io');
11
13
  var fa6 = require('react-icons/fa6');
12
- require('react-icons/pi');
13
14
  require('react-icons/ci');
14
15
  var bs = require('react-icons/bs');
15
16
  var lu = require('react-icons/lu');
@@ -20,6 +21,8 @@ require('slick-carousel/slick/slick.css');
20
21
  require('slick-carousel/slick/slick-theme.css');
21
22
  var ai = require('react-icons/ai');
22
23
  var go = require('react-icons/go');
24
+ var hi = require('react-icons/hi');
25
+ var md = require('react-icons/md');
23
26
  var ri = require('react-icons/ri');
24
27
  var gi = require('react-icons/gi');
25
28
 
@@ -111,36 +114,35 @@ var getDurationValue = function getDurationValue(attributes) {
111
114
  });
112
115
  return durationAtt ? ((durationAtt === null || durationAtt === void 0 ? void 0 : (_durationAtt$value = durationAtt.value) === null || _durationAtt$value === void 0 ? void 0 : _durationAtt$value[0]) || "0") + " p" : "";
113
116
  };
114
- var genProductSlug = function genProductSlug(productName, id) {
115
- var _slug, _slug2, _slug3, _slug4, _slug5, _slug6, _slug7, _slug8, _slug9, _slug10, _slug11;
116
- var slug = productName === null || productName === void 0 ? void 0 : productName.toLowerCase();
117
- slug = (_slug = slug) === null || _slug === void 0 ? void 0 : _slug.replace(/(à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ)/g, "a");
118
- slug = (_slug2 = slug) === null || _slug2 === void 0 ? void 0 : _slug2.replace(/(è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ)/g, "e");
119
- slug = (_slug3 = slug) === null || _slug3 === void 0 ? void 0 : _slug3.replace(/(ì|í|ị|ỉ|ĩ)/g, "i");
120
- slug = (_slug4 = slug) === null || _slug4 === void 0 ? void 0 : _slug4.replace(/(ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ)/g, "o");
121
- slug = (_slug5 = slug) === null || _slug5 === void 0 ? void 0 : _slug5.replace(/(ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ)/g, "u");
122
- slug = (_slug6 = slug) === null || _slug6 === void 0 ? void 0 : _slug6.replace(/(ỳ|ý|ỵ|ỷ|ỹ)/g, "y");
123
- slug = (_slug7 = slug) === null || _slug7 === void 0 ? void 0 : _slug7.replace(/(đ)/g, "d");
124
- slug = (_slug8 = slug) === null || _slug8 === void 0 ? void 0 : _slug8.replace(/([^0-9a-z-\s])/g, "");
125
- slug = (_slug9 = slug) === null || _slug9 === void 0 ? void 0 : _slug9.replace(/(\s+)/g, "-");
126
- slug = (_slug10 = slug) === null || _slug10 === void 0 ? void 0 : _slug10.replace(/^-+/g, "");
127
- slug = (_slug11 = slug) === null || _slug11 === void 0 ? void 0 : _slug11.replace(/-+$/g, "");
128
- return slug + "-" + id;
117
+ var genProductSlugVi = function genProductSlugVi(productName, id) {
118
+ var _productName$replace;
119
+ return (productName === null || productName === void 0 ? void 0 : (_productName$replace = productName.replace(/\s+/g, "-")) === null || _productName$replace === void 0 ? void 0 : _productName$replace.replace(/\//g, "~")) + "-" + id;
129
120
  };
130
121
  var getLinkProductDetail = function getLinkProductDetail(product) {
131
- var slug = genProductSlug(product === null || product === void 0 ? void 0 : product.productName, product === null || product === void 0 ? void 0 : product.productId);
132
- return "/product/" + slug + "/" + (product === null || product === void 0 ? void 0 : product.shopId);
122
+ var slug = genProductSlugVi(product === null || product === void 0 ? void 0 : product.productName, product === null || product === void 0 ? void 0 : product.productId);
123
+ return "/san-pham/" + slug;
133
124
  };
134
125
  var getLinkServiceDetail = function getLinkServiceDetail(product) {
135
- var slug = genProductSlug(product === null || product === void 0 ? void 0 : product.productName, product === null || product === void 0 ? void 0 : product.productId);
136
- return "/service/" + slug + "/" + (product === null || product === void 0 ? void 0 : product.shopId);
126
+ var slug = genProductSlugVi(product === null || product === void 0 ? void 0 : product.productName, product === null || product === void 0 ? void 0 : product.productId);
127
+ return "/dich-vu/" + slug;
137
128
  };
138
129
  var getLinkNewsDetail = function getLinkNewsDetail(news) {
139
- var slug = genProductSlug(news === null || news === void 0 ? void 0 : news.title, news === null || news === void 0 ? void 0 : news.articleId);
140
- return "/news_detail/" + slug + "/" + (news === null || news === void 0 ? void 0 : news.catId) + "/" + (news === null || news === void 0 ? void 0 : news.shopId);
130
+ var slug = genProductSlugVi(news === null || news === void 0 ? void 0 : news.title, news === null || news === void 0 ? void 0 : news.articleId);
131
+ var category = genProductSlugVi(news === null || news === void 0 ? void 0 : news.catName, news === null || news === void 0 ? void 0 : news.catId);
132
+ return "/tin-tuc/" + category + "/" + slug;
141
133
  };
142
134
  var getLinkNewsByCategory = function getLinkNewsByCategory(news) {
143
- return "/news_by_category/" + (news === null || news === void 0 ? void 0 : news.catId) + "/" + (news === null || news === void 0 ? void 0 : news.shopId);
135
+ var slug = genProductSlugVi(news === null || news === void 0 ? void 0 : news.catName, news === null || news === void 0 ? void 0 : news.catId);
136
+ return "/tin-tuc-theo-danh-muc/" + slug;
137
+ };
138
+ var getLinkProductsByCategory = function getLinkProductsByCategory(product) {
139
+ if (product !== null && product !== void 0 && product.categoryName) {
140
+ var slug = genProductSlugVi(product === null || product === void 0 ? void 0 : product.categoryName, product === null || product === void 0 ? void 0 : product.categoryId);
141
+ return "/danh-muc/" + slug;
142
+ } else {
143
+ var _slug12 = genProductSlugVi(product === null || product === void 0 ? void 0 : product.cateName, product === null || product === void 0 ? void 0 : product.categoryId);
144
+ return "/danh-muc/" + _slug12;
145
+ }
144
146
  };
145
147
  var LinkToPage = function LinkToPage(props) {
146
148
  var _props$Link = props.Link,
@@ -150,12 +152,22 @@ var LinkToPage = function LinkToPage(props) {
150
152
  };
151
153
  var SSHOP_SPA_TOKEN = "sshop-spa-token";
152
154
  var genLinkSearch = function genLinkSearch(keyword) {
153
- return "/search?keyword=" + keyword;
155
+ return "/tim-kiem?tu-khoa=" + keyword;
154
156
  };
155
157
  var configSvg = function configSvg(data) {
156
158
  var _data$replace, _data$replace$replace;
157
159
  return data === null || data === void 0 ? void 0 : (_data$replace = data.replace(/<path(?![^>]*fill=")[^>]*>/g, "<path fill=\"currentColor\" $&")) === null || _data$replace === void 0 ? void 0 : (_data$replace$replace = _data$replace.replace(/width="[^"]*"/, '')) === null || _data$replace$replace === void 0 ? void 0 : _data$replace$replace.replace(/height="[^"]*"/, '');
158
160
  };
161
+ var urlMappings = {
162
+ "/products": "/san-pham",
163
+ "/news": "/tin-tuc",
164
+ "/services": "/dich-vu",
165
+ "/booking": "/dat-lich",
166
+ "/about": "/gioi-thieu"
167
+ };
168
+ function convertURL(path) {
169
+ return urlMappings[path] || path;
170
+ }
159
171
 
160
172
  var Options = function Options(props) {
161
173
  var _props$className = props.className,
@@ -222,6 +234,29 @@ var Options = function Options(props) {
222
234
  }))) : null);
223
235
  };
224
236
 
237
+ var listIconRoute = {
238
+ home: /*#__PURE__*/React__default.createElement(fi.FiHome, {
239
+ size: 20
240
+ }),
241
+ products: /*#__PURE__*/React__default.createElement(fi.FiBox, {
242
+ size: 20
243
+ }),
244
+ services: /*#__PURE__*/React__default.createElement(fi.FiPhoneCall, {
245
+ size: 20
246
+ }),
247
+ booking: /*#__PURE__*/React__default.createElement(pi.PiHandHeartBold, {
248
+ size: 20
249
+ }),
250
+ news: /*#__PURE__*/React__default.createElement(fa.FaRegNewspaper, {
251
+ size: 20
252
+ }),
253
+ news_by_category: /*#__PURE__*/React__default.createElement(tb.TbCategory, {
254
+ size: 20
255
+ }),
256
+ about: /*#__PURE__*/React__default.createElement(io5.IoInformationCircleOutline, {
257
+ size: 24
258
+ })
259
+ };
225
260
  var NavBar7 = function NavBar7(props) {
226
261
  var _routes$find, _shopConfigStyle$navB, _shopConfigStyle$navB2, _shopConfigStyle$navB3, _shopConfigStyle$navB4;
227
262
  var _useState = React.useState(false),
@@ -281,7 +316,7 @@ var NavBar7 = function NavBar7(props) {
281
316
  var cart = function cart() {
282
317
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
283
318
  Link: Link,
284
- href: "/carts"
319
+ href: "/gio-hang"
285
320
  }, /*#__PURE__*/React__default.createElement("div", {
286
321
  className: "relative cursor-pointer"
287
322
  }, /*#__PURE__*/React__default.createElement(io5.IoCartOutline, {
@@ -293,7 +328,12 @@ var NavBar7 = function NavBar7(props) {
293
328
  };
294
329
  return /*#__PURE__*/React__default.createElement("div", {
295
330
  className: "w-full sticky top-0 shadow z-50 bg-background"
296
- }, /*#__PURE__*/React__default.createElement("div", {
331
+ }, /*#__PURE__*/React__default.createElement("h1", {
332
+ style: {
333
+ position: "fixed",
334
+ top: "-100px"
335
+ }
336
+ }, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.defaultDomain, " | ", shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName), /*#__PURE__*/React__default.createElement("div", {
297
337
  className: "hidden lg:flex gap-6 justify-between items-center py-2 px-4 xl:px-20"
298
338
  }, /*#__PURE__*/React__default.createElement(LinkToPage, {
299
339
  Link: Link,
@@ -312,8 +352,8 @@ var NavBar7 = function NavBar7(props) {
312
352
  })) === null || _shopConfigStyle$navB2 === void 0 ? void 0 : _shopConfigStyle$navB2.map(function (item, index) {
313
353
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
314
354
  Link: Link,
315
- href: item === null || item === void 0 ? void 0 : item.route,
316
- key: index
355
+ href: convertURL(item === null || item === void 0 ? void 0 : item.route),
356
+ key: "dhfs" + index
317
357
  }, (item === null || item === void 0 ? void 0 : item.name) === (route === null || route === void 0 ? void 0 : route.name) ? /*#__PURE__*/React__default.createElement("div", {
318
358
  className: "whitespace-nowrap py-1 border-b text-textHeading border-textHeading"
319
359
  }, item === null || item === void 0 ? void 0 : item.label) : /*#__PURE__*/React__default.createElement("div", {
@@ -324,7 +364,7 @@ var NavBar7 = function NavBar7(props) {
324
364
  React__default.createElement("div", {
325
365
  className: "flex justify-center"
326
366
  }, /*#__PURE__*/React__default.createElement(fa.FaUserCircle, {
327
- className: "text-bgSecondary",
367
+ className: "text-primary",
328
368
  size: 48
329
369
  }), /*#__PURE__*/React__default.createElement("div", {
330
370
  className: "ml-2"
@@ -344,7 +384,7 @@ var NavBar7 = function NavBar7(props) {
344
384
  className: "flex gap-2"
345
385
  }, /*#__PURE__*/React__default.createElement(LinkToPage, {
346
386
  Link: Link,
347
- href: "/account"
387
+ href: "/dang-nhap"
348
388
  }, /*#__PURE__*/React__default.createElement(Button, {
349
389
  label: "Đăng nhập",
350
390
  shopConfigStyle: shopConfigStyle
@@ -387,42 +427,102 @@ var NavBar7 = function NavBar7(props) {
387
427
  }
388
428
  }, /*#__PURE__*/React__default.createElement("div", {
389
429
  className: "flex justify-between"
390
- }, /*#__PURE__*/React__default.createElement("div", {
391
- className: "flex gap-2 items-center"
392
430
  }, /*#__PURE__*/React__default.createElement(LinkToPage, {
393
431
  Link: Link,
394
432
  href: "/",
395
433
  onClick: function onClick() {
396
434
  return setIsOpen(false);
397
435
  }
436
+ }, /*#__PURE__*/React__default.createElement("div", {
437
+ className: "flex gap-2 items-center"
398
438
  }, /*#__PURE__*/React__default.createElement("img", {
399
439
  src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
400
440
  className: "h-14 w-14 bg-cover bg-no-repeat"
401
- })), /*#__PURE__*/React__default.createElement("div", {
441
+ }), /*#__PURE__*/React__default.createElement("h3", {
402
442
  className: "text-xl font-semibold line-clamp-1"
403
- }, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName)), /*#__PURE__*/React__default.createElement("button", {
443
+ }, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName))), /*#__PURE__*/React__default.createElement("button", {
404
444
  className: "text-gray4",
405
445
  onClick: function onClick() {
406
446
  setIsOpen(false);
407
447
  }
408
448
  }, /*#__PURE__*/React__default.createElement(rx.RxCross2, {
409
449
  size: 24
410
- }))), /*#__PURE__*/React__default.createElement("div", null, shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : (_shopConfigStyle$navB3 = shopConfigStyle.navBarMenus) === null || _shopConfigStyle$navB3 === void 0 ? void 0 : (_shopConfigStyle$navB4 = _shopConfigStyle$navB3.filter(function (e) {
450
+ }))), /*#__PURE__*/React__default.createElement("div", {
451
+ className: "flex flex-col justify-start"
452
+ }, shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : (_shopConfigStyle$navB3 = shopConfigStyle.navBarMenus) === null || _shopConfigStyle$navB3 === void 0 ? void 0 : (_shopConfigStyle$navB4 = _shopConfigStyle$navB3.filter(function (e) {
411
453
  return e === null || e === void 0 ? void 0 : e.isShow;
412
454
  })) === null || _shopConfigStyle$navB4 === void 0 ? void 0 : _shopConfigStyle$navB4.map(function (item, index) {
413
455
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
414
456
  Link: Link,
415
- href: item === null || item === void 0 ? void 0 : item.route,
416
- key: index,
457
+ href: convertURL(item === null || item === void 0 ? void 0 : item.route),
458
+ key: "ieytg-" + index,
417
459
  onClick: function onClick() {
418
460
  return setIsOpen(false);
419
461
  }
420
462
  }, /*#__PURE__*/React__default.createElement("div", {
421
- className: "py-2 " + ((item === null || item === void 0 ? void 0 : item.name) === (route === null || route === void 0 ? void 0 : route.name) ? "text-textHeading" : "")
422
- }, item === null || item === void 0 ? void 0 : item.label));
423
- })))) : null));
463
+ className: "py-2 px-4 flex items-center gap-4 " + ((item === null || item === void 0 ? void 0 : item.name) === (route === null || route === void 0 ? void 0 : route.name) ? "text-textHeading" : "")
464
+ }, /*#__PURE__*/React__default.createElement("div", null, (listIconRoute === null || listIconRoute === void 0 ? void 0 : listIconRoute[item === null || item === void 0 ? void 0 : item.name]) || ""), item === null || item === void 0 ? void 0 : item.label));
465
+ }), /*#__PURE__*/React__default.createElement("hr", {
466
+ className: "border-black"
467
+ }), userInfo ? profileOptions === null || profileOptions === void 0 ? void 0 : profileOptions.map(function (option, index) {
468
+ return option !== null && option !== void 0 && option.href ? /*#__PURE__*/React__default.createElement(LinkToPage, {
469
+ onClick: function onClick() {
470
+ return setIsOpen(false);
471
+ },
472
+ key: "hkfdfh-" + index,
473
+ Link: Link,
474
+ href: option === null || option === void 0 ? void 0 : option.href,
475
+ className: "flex gap-2 px-4 py-2 text-black hover:bg-gray-100 rounded cursor-pointer",
476
+ role: "menuitem"
477
+ }, /*#__PURE__*/React__default.createElement(io5.IoPersonCircleOutline, {
478
+ size: 24
479
+ }), /*#__PURE__*/React__default.createElement("p", null, option === null || option === void 0 ? void 0 : option.label)) : /*#__PURE__*/React__default.createElement("div", {
480
+ key: "hkfdfh-" + index,
481
+ onClick: function onClick() {
482
+ setIsOpen(false);
483
+ logout();
484
+ },
485
+ className: "flex gap-2 px-4 py-2 text-black hover:bg-gray-100 rounded cursor-pointer",
486
+ role: "menuitem"
487
+ }, /*#__PURE__*/React__default.createElement(io5.IoLogOutOutline, {
488
+ size: 24
489
+ }), /*#__PURE__*/React__default.createElement("p", null, option === null || option === void 0 ? void 0 : option.label));
490
+ }) : /*#__PURE__*/React__default.createElement(LinkToPage, {
491
+ Link: Link,
492
+ href: "/dang-nhap",
493
+ onClick: function onClick() {
494
+ return setIsOpen(false);
495
+ }
496
+ }, /*#__PURE__*/React__default.createElement("div", {
497
+ className: "py-2 px-4 flex items-center gap-4"
498
+ }, /*#__PURE__*/React__default.createElement(fi.FiLogIn, {
499
+ size: 20
500
+ }), "\u0110\u0103ng nh\u1EADp"))))) : null));
501
+ };
502
+
503
+ var listIconRoute$1 = {
504
+ home: /*#__PURE__*/React__default.createElement(fi.FiHome, {
505
+ size: 20
506
+ }),
507
+ products: /*#__PURE__*/React__default.createElement(fi.FiBox, {
508
+ size: 20
509
+ }),
510
+ services: /*#__PURE__*/React__default.createElement(fi.FiPhoneCall, {
511
+ size: 20
512
+ }),
513
+ booking: /*#__PURE__*/React__default.createElement(pi.PiHandHeartBold, {
514
+ size: 20
515
+ }),
516
+ news: /*#__PURE__*/React__default.createElement(fa.FaRegNewspaper, {
517
+ size: 20
518
+ }),
519
+ news_by_category: /*#__PURE__*/React__default.createElement(tb.TbCategory, {
520
+ size: 20
521
+ }),
522
+ about: /*#__PURE__*/React__default.createElement(io5.IoInformationCircleOutline, {
523
+ size: 24
524
+ })
424
525
  };
425
-
426
526
  var NavBar1 = function NavBar1(props) {
427
527
  var _routes$find, _shopConfigStyle$navB, _shopConfigStyle$navB2, _shopConfigStyle$navB3, _shopConfigStyle$navB4;
428
528
  var _useState = React.useState(false),
@@ -440,7 +540,8 @@ var NavBar1 = function NavBar1(props) {
440
540
  _props$useSelector = props.useSelector,
441
541
  useSelector = _props$useSelector === void 0 ? null : _props$useSelector,
442
542
  _props$logout = props.logout,
443
- logout = _props$logout === void 0 ? function () {} : _props$logout;
543
+ logout = _props$logout === void 0 ? function () {} : _props$logout,
544
+ data = props.data;
444
545
  var cartItems = useSelector === null || useSelector === void 0 ? void 0 : useSelector(function (state) {
445
546
  var _state$cart;
446
547
  return state === null || state === void 0 ? void 0 : (_state$cart = state.cart) === null || _state$cart === void 0 ? void 0 : _state$cart.items;
@@ -482,7 +583,7 @@ var NavBar1 = function NavBar1(props) {
482
583
  var cart = function cart() {
483
584
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
484
585
  Link: Link,
485
- href: "/carts"
586
+ href: "/gio-hang"
486
587
  }, /*#__PURE__*/React__default.createElement("div", {
487
588
  className: "relative cursor-pointer"
488
589
  }, /*#__PURE__*/React__default.createElement(io5.IoBagOutline, {
@@ -492,28 +593,40 @@ var NavBar1 = function NavBar1(props) {
492
593
  className: "absolute aspect-square flex items-center justify-center bg-danger w-5 text-xs rounded-full text-white -top-1 -right-1 pb-px ps-px"
493
594
  }, totalItem) : null));
494
595
  };
495
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
496
- className: "hidden lg:flex justify-end items-center gap-6 px-20 py-2 bg-primary"
596
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("h1", {
597
+ style: {
598
+ position: "fixed",
599
+ top: "-100px"
600
+ }
601
+ }, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.defaultDomain, " | ", shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName), /*#__PURE__*/React__default.createElement("div", {
602
+ className: "hidden lg:flex justify-between items-center px-20 py-2 bg-primary"
603
+ }, /*#__PURE__*/React__default.createElement("div", {
604
+ className: "text-background text-xl"
605
+ }, data === null || data === void 0 ? void 0 : data.title), /*#__PURE__*/React__default.createElement("div", {
606
+ className: "flex gap-6 "
497
607
  }, shopConfig !== null && shopConfig !== void 0 && shopConfig.shopPhone ? /*#__PURE__*/React__default.createElement("div", {
498
608
  className: "font-medium border-r pr-6 text-background"
499
609
  }, "Hotline: ", shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopPhone) : null, /*#__PURE__*/React__default.createElement("div", {
500
610
  className: "flex justify-start items-center gap-2"
501
611
  }, /*#__PURE__*/React__default.createElement("a", {
502
- href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopFacebookPage) || "#"
612
+ href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopFacebookPage) || "#",
613
+ target: shopConfig !== null && shopConfig !== void 0 && shopConfig.shopFacebookPage ? "_blank" : "_self"
503
614
  }, /*#__PURE__*/React__default.createElement(fa.FaFacebookF, {
504
615
  size: 24,
505
616
  className: "p-1 rounded bg-background text-primary"
506
617
  })), /*#__PURE__*/React__default.createElement("a", {
507
- href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopMessenger) || "#"
618
+ href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopMessenger) || "#",
619
+ target: shopConfig !== null && shopConfig !== void 0 && shopConfig.shopMessenger ? "_blank" : "_self"
508
620
  }, /*#__PURE__*/React__default.createElement(fa.FaFacebookMessenger, {
509
621
  size: 24,
510
622
  className: "p-1 rounded bg-background text-primary"
511
623
  })), /*#__PURE__*/React__default.createElement("a", {
512
- href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopZalo) || "#"
624
+ href: "https://zalo.me/" + (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopZalo) || "#",
625
+ target: "_blank"
513
626
  }, /*#__PURE__*/React__default.createElement(si.SiZalo, {
514
627
  size: 24,
515
628
  className: "p-1 rounded bg-background text-primary"
516
- })))), /*#__PURE__*/React__default.createElement("div", {
629
+ }))))), /*#__PURE__*/React__default.createElement("div", {
517
630
  className: "hidden lg:flex gap-6 justify-between items-center py-2 px-4 xl:px-20 sticky top-0 z-50 bg-background shadow "
518
631
  }, /*#__PURE__*/React__default.createElement(LinkToPage, {
519
632
  Link: Link,
@@ -532,7 +645,7 @@ var NavBar1 = function NavBar1(props) {
532
645
  })) === null || _shopConfigStyle$navB2 === void 0 ? void 0 : _shopConfigStyle$navB2.map(function (item, index) {
533
646
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
534
647
  Link: Link,
535
- href: item === null || item === void 0 ? void 0 : item.route,
648
+ href: convertURL(item === null || item === void 0 ? void 0 : item.route),
536
649
  key: index
537
650
  }, /*#__PURE__*/React__default.createElement("div", {
538
651
  className: "py-1 whitespace-nowrap " + ((item === null || item === void 0 ? void 0 : item.name) === (route === null || route === void 0 ? void 0 : route.name) ? "border-b text-primary border-primary" : "text-textBody") + " "
@@ -562,7 +675,7 @@ var NavBar1 = function NavBar1(props) {
562
675
  className: "flex gap-2"
563
676
  }, /*#__PURE__*/React__default.createElement(LinkToPage, {
564
677
  Link: Link,
565
- href: "/account"
678
+ href: "/dang-nhap"
566
679
  }, /*#__PURE__*/React__default.createElement(Button, {
567
680
  label: "Đăng nhập",
568
681
  shopConfigStyle: shopConfigStyle
@@ -605,40 +718,77 @@ var NavBar1 = function NavBar1(props) {
605
718
  }
606
719
  }, /*#__PURE__*/React__default.createElement("div", {
607
720
  className: "flex justify-between"
608
- }, /*#__PURE__*/React__default.createElement("div", {
609
- className: "flex gap-2 items-center"
610
721
  }, /*#__PURE__*/React__default.createElement(LinkToPage, {
611
722
  Link: Link,
612
723
  href: "/",
613
724
  onClick: function onClick() {
614
725
  return setIsOpen(false);
615
726
  }
727
+ }, /*#__PURE__*/React__default.createElement("div", {
728
+ className: "flex gap-2 items-center"
616
729
  }, /*#__PURE__*/React__default.createElement("img", {
617
730
  src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
618
731
  className: "h-14 w-14 bg-cover bg-no-repeat"
619
- })), /*#__PURE__*/React__default.createElement("div", {
732
+ }), /*#__PURE__*/React__default.createElement("div", {
620
733
  className: "text-xl font-semibold line-clamp-1"
621
- }, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName)), /*#__PURE__*/React__default.createElement("button", {
734
+ }, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName))), /*#__PURE__*/React__default.createElement("button", {
622
735
  className: "text-gray4",
623
736
  onClick: function onClick() {
624
737
  setIsOpen(false);
625
738
  }
626
739
  }, /*#__PURE__*/React__default.createElement(rx.RxCross2, {
627
740
  size: 24
628
- }))), /*#__PURE__*/React__default.createElement("div", null, shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : (_shopConfigStyle$navB3 = shopConfigStyle.navBarMenus) === null || _shopConfigStyle$navB3 === void 0 ? void 0 : (_shopConfigStyle$navB4 = _shopConfigStyle$navB3.filter(function (e) {
741
+ }))), /*#__PURE__*/React__default.createElement("div", {
742
+ className: "flex flex-col justify-start"
743
+ }, shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : (_shopConfigStyle$navB3 = shopConfigStyle.navBarMenus) === null || _shopConfigStyle$navB3 === void 0 ? void 0 : (_shopConfigStyle$navB4 = _shopConfigStyle$navB3.filter(function (e) {
629
744
  return e === null || e === void 0 ? void 0 : e.isShow;
630
745
  })) === null || _shopConfigStyle$navB4 === void 0 ? void 0 : _shopConfigStyle$navB4.map(function (item, index) {
631
746
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
632
747
  Link: Link,
633
- href: item === null || item === void 0 ? void 0 : item.route,
748
+ href: convertURL(item === null || item === void 0 ? void 0 : item.route),
634
749
  key: index,
635
750
  onClick: function onClick() {
636
751
  return setIsOpen(false);
637
752
  }
638
753
  }, /*#__PURE__*/React__default.createElement("div", {
639
- className: "py-2 " + ((item === null || item === void 0 ? void 0 : item.name) === (route === null || route === void 0 ? void 0 : route.name) ? "text-textHeading" : "")
640
- }, item === null || item === void 0 ? void 0 : item.label));
641
- })))) : null));
754
+ className: "py-2 px-4 flex items-center gap-4 " + ((item === null || item === void 0 ? void 0 : item.name) === (route === null || route === void 0 ? void 0 : route.name) ? "text-textHeading" : "")
755
+ }, /*#__PURE__*/React__default.createElement("div", null, (listIconRoute$1 === null || listIconRoute$1 === void 0 ? void 0 : listIconRoute$1[item === null || item === void 0 ? void 0 : item.name]) || ""), item === null || item === void 0 ? void 0 : item.label));
756
+ }), /*#__PURE__*/React__default.createElement("hr", {
757
+ className: "border-black"
758
+ }), userInfo ? profileOptions === null || profileOptions === void 0 ? void 0 : profileOptions.map(function (option, index) {
759
+ return option !== null && option !== void 0 && option.href ? /*#__PURE__*/React__default.createElement(LinkToPage, {
760
+ onClick: function onClick() {
761
+ return setIsOpen(false);
762
+ },
763
+ key: "hkfdfh-" + index,
764
+ Link: Link,
765
+ href: option === null || option === void 0 ? void 0 : option.href,
766
+ className: "flex gap-2 px-4 py-2 text-black hover:bg-gray-100 rounded cursor-pointer",
767
+ role: "menuitem"
768
+ }, /*#__PURE__*/React__default.createElement(io5.IoPersonCircleOutline, {
769
+ size: 24
770
+ }), /*#__PURE__*/React__default.createElement("p", null, option === null || option === void 0 ? void 0 : option.label)) : /*#__PURE__*/React__default.createElement("div", {
771
+ key: "hkfdfh-" + index,
772
+ onClick: function onClick() {
773
+ setIsOpen(false);
774
+ logout();
775
+ },
776
+ className: "flex gap-2 px-4 py-2 text-black hover:bg-gray-100 rounded cursor-pointer",
777
+ role: "menuitem"
778
+ }, /*#__PURE__*/React__default.createElement(io5.IoLogOutOutline, {
779
+ size: 24
780
+ }), /*#__PURE__*/React__default.createElement("p", null, option === null || option === void 0 ? void 0 : option.label));
781
+ }) : /*#__PURE__*/React__default.createElement(LinkToPage, {
782
+ Link: Link,
783
+ href: "/dang-nhap",
784
+ onClick: function onClick() {
785
+ return setIsOpen(false);
786
+ }
787
+ }, /*#__PURE__*/React__default.createElement("div", {
788
+ className: "py-2 px-4 flex items-center gap-4"
789
+ }, /*#__PURE__*/React__default.createElement(fi.FiLogIn, {
790
+ size: 20
791
+ }), "\u0110\u0103ng nh\u1EADp"))))) : null));
642
792
  };
643
793
 
644
794
  var SvgIcon = function SvgIcon(_ref) {
@@ -666,7 +816,7 @@ var SvgIcon = function SvgIcon(_ref) {
666
816
  var SectionTitle1 = function SectionTitle1(props) {
667
817
  var _props$data = props.data,
668
818
  data = _props$data === void 0 ? {} : _props$data;
669
- return /*#__PURE__*/React__default.createElement("div", null, data !== null && data !== void 0 && data.sectionTitle ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
819
+ return /*#__PURE__*/React__default.createElement("div", null, data !== null && data !== void 0 && data.sectionTitle ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("h2", {
670
820
  className: "text-center text-2xl md:text-4xl font-headingFont font-semibold leading-relaxed text-textHeading"
671
821
  }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement("div", {
672
822
  className: "flex items-center justify-center"
@@ -690,7 +840,7 @@ var SectionTitle2 = function SectionTitle2(props) {
690
840
  className: "flex gap-4 justify-center items-center"
691
841
  }, /*#__PURE__*/React__default.createElement("div", {
692
842
  className: " w-32 h-0.5 rounded-full bg-stroke"
693
- }), /*#__PURE__*/React__default.createElement("div", {
843
+ }), /*#__PURE__*/React__default.createElement("h2", {
694
844
  className: "text-center whitespace-nowrap text-2xl md:text-4xl font-headingFont font-semibold leading-relaxed text-textHeading"
695
845
  }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement("div", {
696
846
  className: " w-32 h-0.5 rounded-full bg-stroke"
@@ -709,7 +859,7 @@ var SectionTitle2 = function SectionTitle2(props) {
709
859
 
710
860
  var SectionTitle3 = function SectionTitle3(props) {
711
861
  var data = props.data;
712
- return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("h3", {
862
+ return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("h2", {
713
863
  className: "font-headingFont leading-relaxed text-textHeading text-2xl md:text-4xl font-semibold"
714
864
  }, data === null || data === void 0 ? void 0 : data.sectionTitle), data !== null && data !== void 0 && data.sectionDescription ? /*#__PURE__*/React__default.createElement("p", {
715
865
  className: "text-xl font-medium leading-relaxed text-textSecondary mt-4 lg:mt-6"
@@ -735,6 +885,8 @@ var Input = React.forwardRef(function (props, ref) {
735
885
  style = _props$style === void 0 ? {} : _props$style,
736
886
  _props$onChange = props.onChange,
737
887
  onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
888
+ _props$disabled = props.disabled,
889
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
738
890
  _props$defaultValue = props.defaultValue,
739
891
  defaultValue = _props$defaultValue === void 0 ? "" : _props$defaultValue,
740
892
  _props$type = props.type,
@@ -782,15 +934,15 @@ var Input = React.forwardRef(function (props, ref) {
782
934
  for (var _iterator = _createForOfIteratorHelperLoose(rules), _step; !(_step = _iterator()).done;) {
783
935
  var _e$pattern, _e$validate;
784
936
  var e = _step.value;
785
- if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && (value === '' || value === null)) {
937
+ if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && !value) {
786
938
  _setError(e === null || e === void 0 ? void 0 : e.message);
787
939
  count++;
788
940
  break;
789
- } else if (value !== "" && (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))) {
941
+ } else if (value && (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))) {
790
942
  _setError(e === null || e === void 0 ? void 0 : e.message);
791
943
  count++;
792
944
  break;
793
- } else if (value !== "" && (e === null || e === void 0 ? void 0 : e.type) === "validate" && e !== null && e !== void 0 && e.validate && !(e !== null && e !== void 0 && (_e$validate = e.validate) !== null && _e$validate !== void 0 && _e$validate.call(e))) {
945
+ } else if (value && (e === null || e === void 0 ? void 0 : e.type) === "validate" && e !== null && e !== void 0 && e.validate && !(e !== null && e !== void 0 && (_e$validate = e.validate) !== null && _e$validate !== void 0 && _e$validate.call(e))) {
794
946
  _setError(e === null || e === void 0 ? void 0 : e.message);
795
947
  count++;
796
948
  break;
@@ -813,7 +965,7 @@ var Input = React.forwardRef(function (props, ref) {
813
965
  };
814
966
  var changeQuantity = function changeQuantity(quantity) {
815
967
  var newValue = parseInt(value) + quantity;
816
- if (newValue > min && (max === null || newValue <= max)) {
968
+ if (!disabled && newValue > min && (max === null || newValue <= max)) {
817
969
  _setValue(newValue);
818
970
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
819
971
  }
@@ -836,7 +988,7 @@ var Input = React.forwardRef(function (props, ref) {
836
988
  }, label ? /*#__PURE__*/React__default.createElement("div", {
837
989
  className: "mb-1 " + labelClassName
838
990
  }, label, labelRequired) : null, /*#__PURE__*/React__default.createElement("div", {
839
- className: "flex gap-2 items-center bg-white " + _className,
991
+ className: "bg-white " + (disabled ? "!bg-gray6" : "") + " flex gap-2 items-center " + _className,
840
992
  style: style
841
993
  }, isQuantity ? /*#__PURE__*/React__default.createElement("button", {
842
994
  onClick: function onClick() {
@@ -847,6 +999,7 @@ var Input = React.forwardRef(function (props, ref) {
847
999
  name: name,
848
1000
  value: value,
849
1001
  placeholder: placeholder,
1002
+ disabled: disabled,
850
1003
  onChange: handleOnChange,
851
1004
  required: required,
852
1005
  className: _inputClassName,
@@ -880,7 +1033,7 @@ var Hero1 = function Hero1(props) {
880
1033
  style: {
881
1034
  backgroundImage: "url(" + (sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$ = sectionData[0]) === null || _sectionData$ === void 0 ? void 0 : (_sectionData$$srcImag = _sectionData$.srcImages) === null || _sectionData$$srcImag === void 0 ? void 0 : _sectionData$$srcImag[0]) + ")"
882
1035
  },
883
- className: "relative w-full h-[200px] md:h-[320px] lg:h-[400px] xl:h-[480px] bg-cover bg-center bg-no-repeat z-0 flex flex-col items-center justify-center mb-24"
1036
+ className: "relative w-full min-h-[200px] md:min-h-[320px] lg:min-h-[400px] xl:min-h-[480px] h-full bg-cover bg-center bg-no-repeat z-0 flex flex-col items-center justify-center mb-24"
884
1037
  }, /*#__PURE__*/React__default.createElement("div", {
885
1038
  className: "w-[80%] md:w-2/3 xl:w-1/2 md:h-2/3 flex flex-col gap-2 md:gap-8 justify-center items-center bg-background opacity-90 absolute top-5 md:top-10 px-6 py-4 rounded-tr-[40px] rounded-bl-[40px] md:rounded-tr-[80px] md:rounded-bl-[80px]"
886
1039
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -892,7 +1045,7 @@ var Hero1 = function Hero1(props) {
892
1045
  className: "text-center md:text-2xl lg:text-3xl font-medium"
893
1046
  }, sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$3 = sectionData[0]) === null || _sectionData$3 === void 0 ? void 0 : _sectionData$3.description), /*#__PURE__*/React__default.createElement(LinkToPage, {
894
1047
  Link: Link,
895
- href: (sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$4 = sectionData[0]) === null || _sectionData$4 === void 0 ? void 0 : (_sectionData$4$button = _sectionData$4.buttons) === null || _sectionData$4$button === void 0 ? void 0 : (_sectionData$4$button2 = _sectionData$4$button[0]) === null || _sectionData$4$button2 === void 0 ? void 0 : _sectionData$4$button2.route) || (sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$5 = sectionData[0]) === null || _sectionData$5 === void 0 ? void 0 : (_sectionData$5$button = _sectionData$5.buttons) === null || _sectionData$5$button === void 0 ? void 0 : (_sectionData$5$button2 = _sectionData$5$button[0]) === null || _sectionData$5$button2 === void 0 ? void 0 : _sectionData$5$button2.link) || "#"
1048
+ href: convertURL(sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$4 = sectionData[0]) === null || _sectionData$4 === void 0 ? void 0 : (_sectionData$4$button = _sectionData$4.buttons) === null || _sectionData$4$button === void 0 ? void 0 : (_sectionData$4$button2 = _sectionData$4$button[0]) === null || _sectionData$4$button2 === void 0 ? void 0 : _sectionData$4$button2.route) || (sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$5 = sectionData[0]) === null || _sectionData$5 === void 0 ? void 0 : (_sectionData$5$button = _sectionData$5.buttons) === null || _sectionData$5$button === void 0 ? void 0 : (_sectionData$5$button2 = _sectionData$5$button[0]) === null || _sectionData$5$button2 === void 0 ? void 0 : _sectionData$5$button2.link) || "#"
896
1049
  }, /*#__PURE__*/React__default.createElement(Button, {
897
1050
  label: sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$6 = sectionData[0]) === null || _sectionData$6 === void 0 ? void 0 : (_sectionData$6$button = _sectionData$6.buttons) === null || _sectionData$6$button === void 0 ? void 0 : (_sectionData$6$button2 = _sectionData$6$button[0]) === null || _sectionData$6$button2 === void 0 ? void 0 : _sectionData$6$button2.label,
898
1051
  shopConfigStyle: shopConfigStyle
@@ -919,45 +1072,48 @@ var Hero1 = function Hero1(props) {
919
1072
  };
920
1073
 
921
1074
  var Hero2 = function Hero2(props) {
922
- var _data$data, _data$data$, _data$data$$srcImages, _data$data2, _data$data2$, _data$data3, _data$data3$;
1075
+ var _data$data, _data$data$, _data$data$$srcImages, _data$data2, _data$data2$, _data$data3, _data$data3$, _data$data4, _data$data4$;
923
1076
  var shopConfig = props.shopConfig,
924
1077
  data = props.data;
925
1078
  return /*#__PURE__*/React__default.createElement("div", {
926
1079
  className: "relative"
927
1080
  }, /*#__PURE__*/React__default.createElement("img", {
928
1081
  src: data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$ = _data$data[0]) === null || _data$data$ === void 0 ? void 0 : (_data$data$$srcImages = _data$data$.srcImages) === null || _data$data$$srcImages === void 0 ? void 0 : _data$data$$srcImages[0],
1082
+ alt: 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,
929
1083
  className: "w-full object-cover min-h-[30vh] md:min-h-[50vh] max-h-[100vh]"
930
1084
  }), /*#__PURE__*/React__default.createElement("div", {
931
1085
  className: "absolute flex flex-col gap-1 md:gap-4 absolute w-1/2 lg:w-1/3 top-2 sm:top-[20%] xl:top-1/4 right-[2%] lg:right-[15%]"
932
1086
  }, /*#__PURE__*/React__default.createElement("img", {
933
1087
  src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
1088
+ alt: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName,
934
1089
  className: "h-6 w-6 md:h-16 md:w-16 lg:h-20 lg:w-20"
935
1090
  }), /*#__PURE__*/React__default.createElement("div", {
936
1091
  className: "text-lg md:text-3xl lg:text-4xl font-medium"
937
- }, 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", {
1092
+ }, 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$.title), /*#__PURE__*/React__default.createElement("div", {
938
1093
  className: "text-sm md:text-xl lg:text-2xl "
939
- }, 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)));
1094
+ }, data === null || data === void 0 ? void 0 : (_data$data4 = data.data) === null || _data$data4 === void 0 ? void 0 : (_data$data4$ = _data$data4[0]) === null || _data$data4$ === void 0 ? void 0 : _data$data4$.description)));
940
1095
  };
941
1096
 
942
1097
  var Hero5 = function Hero5(props) {
943
- var _data$data, _data$data$, _data$data$$srcImages, _data$data2, _data$data2$, _data$data3, _data$data3$;
1098
+ var _data$data, _data$data$, _data$data$$srcImages, _data$data2, _data$data2$, _data$data3, _data$data3$, _data$data4, _data$data4$;
944
1099
  var data = props.data;
945
1100
  return /*#__PURE__*/React__default.createElement("div", {
946
1101
  className: "relative"
947
1102
  }, /*#__PURE__*/React__default.createElement("img", {
948
1103
  src: data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$ = _data$data[0]) === null || _data$data$ === void 0 ? void 0 : (_data$data$$srcImages = _data$data$.srcImages) === null || _data$data$$srcImages === void 0 ? void 0 : _data$data$$srcImages[0],
949
- className: "w-full min-h-[30vh] md:min-h-[50vh] max-h-[100vh]"
1104
+ alt: 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,
1105
+ className: "w-full min-h-[30vh] md:min-h-[50vh] max-h-[100vh] object-cover"
950
1106
  }), /*#__PURE__*/React__default.createElement("div", {
951
1107
  className: "flex flex-col gap-2 md:gap-4 absolute top-5 md:top-[20%] w-1/2 lg:w-1/3 left-4 xl:left-20"
952
1108
  }, /*#__PURE__*/React__default.createElement("div", {
953
1109
  className: "text-xl md:text-3xl lg:text-4xl text-textHeading font-medium"
954
- }, 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", {
1110
+ }, 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$.title), /*#__PURE__*/React__default.createElement("div", {
955
1111
  className: "md:text-xl lg:text-2xl text-primary line-clamp-3 md:line-clamp-none"
956
- }, 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)));
1112
+ }, data === null || data === void 0 ? void 0 : (_data$data4 = data.data) === null || _data$data4 === void 0 ? void 0 : (_data$data4$ = _data$data4[0]) === null || _data$data4$ === void 0 ? void 0 : _data$data4$.description)));
957
1113
  };
958
1114
 
959
1115
  var Hero6 = function Hero6(props) {
960
- var _data$data, _data$data$, _data$data$$srcImages, _data$data2, _data$data2$, _data$data3, _data$data3$, _sectionData$, _sectionData$$buttons;
1116
+ var _data$data, _data$data$, _data$data$$srcImages, _data$data2, _data$data2$, _data$data3, _data$data3$, _data$data4, _data$data4$, _sectionData$, _sectionData$$buttons;
961
1117
  var shopConfigStyle = props.shopConfigStyle,
962
1118
  data = props.data,
963
1119
  _props$Link = props.Link,
@@ -967,17 +1123,18 @@ var Hero6 = function Hero6(props) {
967
1123
  className: "relative"
968
1124
  }, /*#__PURE__*/React__default.createElement("img", {
969
1125
  src: data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$ = _data$data[0]) === null || _data$data$ === void 0 ? void 0 : (_data$data$$srcImages = _data$data$.srcImages) === null || _data$data$$srcImages === void 0 ? void 0 : _data$data$$srcImages[0],
970
- className: "w-full h-auto min-h-[30vh] md:min-h-[50vh] max-h-[100vh]"
1126
+ alt: 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,
1127
+ className: "object-cover w-full h-auto min-h-[30vh] md:min-h-[50vh] max-h-[100vh]"
971
1128
  }), /*#__PURE__*/React__default.createElement("div", {
972
1129
  className: "absolute top-0 md:top-14 lg:top-20 w-full p-3 md:p-6 lg:p-12 z-10 flex flex-col gap-2 md:gap-4 lg:gap-6 items-center justify-center"
973
1130
  }, /*#__PURE__*/React__default.createElement("div", {
974
1131
  className: "text-primary text-xl md:text-3xl lg:text-5xl leading-[1.6] md:leading-[1.6] text-center font-headingFont"
975
- }, 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", {
1132
+ }, 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$.title), /*#__PURE__*/React__default.createElement("div", {
976
1133
  className: "md:text-xl"
977
- }, 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), sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$ = sectionData[0]) === null || _sectionData$ === void 0 ? void 0 : (_sectionData$$buttons = _sectionData$.buttons) === null || _sectionData$$buttons === void 0 ? void 0 : _sectionData$$buttons.map(function (button) {
1134
+ }, data === null || data === void 0 ? void 0 : (_data$data4 = data.data) === null || _data$data4 === void 0 ? void 0 : (_data$data4$ = _data$data4[0]) === null || _data$data4$ === void 0 ? void 0 : _data$data4$.description), sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$ = sectionData[0]) === null || _sectionData$ === void 0 ? void 0 : (_sectionData$$buttons = _sectionData$.buttons) === null || _sectionData$$buttons === void 0 ? void 0 : _sectionData$$buttons.map(function (button) {
978
1135
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
979
1136
  Link: Link,
980
- href: (button === null || button === void 0 ? void 0 : button.route) || (button === null || button === void 0 ? void 0 : button.link) || "#"
1137
+ href: convertURL(button === null || button === void 0 ? void 0 : button.route) || (button === null || button === void 0 ? void 0 : button.link) || "#"
981
1138
  }, /*#__PURE__*/React__default.createElement(Button, {
982
1139
  label: button === null || button === void 0 ? void 0 : button.label,
983
1140
  shopConfigStyle: shopConfigStyle
@@ -1007,7 +1164,7 @@ var Hero10 = function Hero10(props) {
1007
1164
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
1008
1165
  Link: Link,
1009
1166
  key: "gdf-" + index,
1010
- href: (button === null || button === void 0 ? void 0 : button.route) || (button === null || button === void 0 ? void 0 : button.link) || "#"
1167
+ href: convertURL(button === null || button === void 0 ? void 0 : button.route) || (button === null || button === void 0 ? void 0 : button.link) || "#"
1011
1168
  }, /*#__PURE__*/React__default.createElement(Button, {
1012
1169
  label: button === null || button === void 0 ? void 0 : button.label,
1013
1170
  shopConfigStyle: shopConfigStyle
@@ -7302,7 +7459,7 @@ var CategoryController = function CategoryController(props) {
7302
7459
  };
7303
7460
 
7304
7461
  var Hero13 = function Hero13(props) {
7305
- var _sectionData$, _sectionData$$srcImag;
7462
+ var _sectionData$, _sectionData$$srcImag, _data$data, _data$data$;
7306
7463
  var listRef = React.useRef(null);
7307
7464
  var _useState = React.useState(false);
7308
7465
  var data = props.data;
@@ -7310,7 +7467,8 @@ var Hero13 = function Hero13(props) {
7310
7467
  var _CategoryController = CategoryController(props);
7311
7468
  return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("img", {
7312
7469
  src: sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$ = sectionData[0]) === null || _sectionData$ === void 0 ? void 0 : (_sectionData$$srcImag = _sectionData$.srcImages) === null || _sectionData$$srcImag === void 0 ? void 0 : _sectionData$$srcImag[0],
7313
- className: "w-full"
7470
+ alt: data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$ = _data$data[0]) === null || _data$data$ === void 0 ? void 0 : _data$data$.title,
7471
+ className: "w-full object-cover"
7314
7472
  }));
7315
7473
  };
7316
7474
 
@@ -7373,7 +7531,7 @@ var Features3 = function Features3(props) {
7373
7531
  }, sectionData && sectionData.length > 0 && sectionData.map(function (item, index) {
7374
7532
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
7375
7533
  Link: Link,
7376
- href: (item === null || item === void 0 ? void 0 : item.link) || (item === null || item === void 0 ? void 0 : item.route) || "#"
7534
+ href: (item === null || item === void 0 ? void 0 : item.link) || convertURL(item === null || item === void 0 ? void 0 : item.route) || "#"
7377
7535
  }, /*#__PURE__*/React__default.createElement("div", {
7378
7536
  className: "grid grid-cols-2 p-3 rounded-lg font-semibold",
7379
7537
  key: "dfsdfj-" + index,
@@ -7431,6 +7589,11 @@ var ProductController = function ProductController(props) {
7431
7589
  var _res$data2, _res$data3;
7432
7590
  setProducts(res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.data);
7433
7591
  setPage(res === null || res === void 0 ? void 0 : (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.page);
7592
+ var url = new URL(window.location.href);
7593
+ if (/^(\/(danh-muc))\/[^/]+-\d+$/.test(url.pathname)) {
7594
+ url.pathname = url.pathname.replace(/\/[^/]+-\d+$/, "");
7595
+ window.history.replaceState({}, '', url.pathname + url.search);
7596
+ }
7434
7597
  }
7435
7598
  setLoading(false);
7436
7599
  });
@@ -7469,6 +7632,7 @@ var ProductController = function ProductController(props) {
7469
7632
  };
7470
7633
  return {
7471
7634
  products: products,
7635
+ setProducts: setProducts,
7472
7636
  loading: loading,
7473
7637
  page: page,
7474
7638
  getProductListSearch: getProductListSearch
@@ -7618,13 +7782,16 @@ function SvgImageGallery(props) {
7618
7782
  }
7619
7783
 
7620
7784
  var DefaultImage = function DefaultImage(props) {
7621
- var _props$className = props.className,
7785
+ var _props$size = props.size,
7786
+ size = _props$size === void 0 ? 0 : _props$size,
7787
+ _props$className = props.className,
7622
7788
  className = _props$className === void 0 ? "" : _props$className;
7623
7789
  return /*#__PURE__*/React__default.createElement("div", {
7624
- className: "flex justify-center items-center w-full aspect-square " + className,
7625
- style: {
7626
- backgroundColor: "#FAFAFA"
7627
- }
7790
+ className: "flex justify-center items-center w-full aspect-square " + className + " bg-[#FAFAFA]",
7791
+ style: size ? {
7792
+ width: size,
7793
+ height: size
7794
+ } : null
7628
7795
  }, /*#__PURE__*/React__default.createElement(SvgImageGallery, {
7629
7796
  width: "25%",
7630
7797
  height: "25%",
@@ -7645,12 +7812,20 @@ var ProductImage = function ProductImage(props) {
7645
7812
  }, [product]);
7646
7813
  var getProductImage = function getProductImage() {
7647
7814
  var _JSON$parse, _JSON$parse$;
7648
- var src = (_JSON$parse = JSON.parse((product === null || product === void 0 ? void 0 : product.imagesUrl) || "[]")) === null || _JSON$parse === void 0 ? void 0 : (_JSON$parse$ = _JSON$parse[0]) === null || _JSON$parse$ === void 0 ? void 0 : _JSON$parse$.imageUrl;
7649
- setSrc(src);
7815
+ var src = (_JSON$parse = JSON.parse((product === null || product === void 0 ? void 0 : product.imagesUrl) || "[]")) === null || _JSON$parse === void 0 ? void 0 : (_JSON$parse$ = _JSON$parse[0]) === null || _JSON$parse$ === void 0 ? void 0 : _JSON$parse$.src;
7816
+ if (src !== null && src !== void 0 && src.startsWith("http")) {
7817
+ setSrc(src);
7818
+ } else if (src) {
7819
+ var urlImage = "https://test-apigateway.sfin.vn/assets/images/sshop/shops/" + (product === null || product === void 0 ? void 0 : product.shopId) + "/" + (product === null || product === void 0 ? void 0 : product.productId) + "/" + src;
7820
+ setSrc(urlImage);
7821
+ } else {
7822
+ setSrc(src);
7823
+ }
7650
7824
  };
7651
7825
  return src ? /*#__PURE__*/React__default.createElement("img", {
7652
7826
  src: src,
7653
- className: "w-full aspect-square " + className,
7827
+ alt: product === null || product === void 0 ? void 0 : product.productName,
7828
+ className: "w-full aspect-square object-cover " + className,
7654
7829
  style: size ? {
7655
7830
  width: size,
7656
7831
  height: size
@@ -7678,6 +7853,7 @@ var getYoutubeVideoIdByUrl = function getYoutubeVideoIdByUrl(url) {
7678
7853
  var match = url === null || url === void 0 ? void 0 : url.match(regex);
7679
7854
  return match ? match[1] : null;
7680
7855
  };
7856
+ var linkPagePolicy = "https://sites.google.com/view/sodofin-landing-page-policy";
7681
7857
 
7682
7858
  function getMinMax(array, field) {
7683
7859
  if (!(array !== null && array !== void 0 && array.length) || !array[0].hasOwnProperty(field)) {
@@ -8093,6 +8269,8 @@ var Select = React.forwardRef(function (props, ref) {
8093
8269
  wrapClassName = _props$wrapClassName === void 0 ? "" : _props$wrapClassName,
8094
8270
  _props$selectClassNam = props.selectClassName,
8095
8271
  selectClassName = _props$selectClassNam === void 0 ? "" : _props$selectClassNam,
8272
+ _props$disabled = props.disabled,
8273
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
8096
8274
  _props$rules = props.rules,
8097
8275
  rules = _props$rules === void 0 ? [] : _props$rules,
8098
8276
  options = props.options,
@@ -8272,10 +8450,11 @@ var Select = React.forwardRef(function (props, ref) {
8272
8450
  }, label ? /*#__PURE__*/React__default.createElement("div", {
8273
8451
  className: "mb-1 " + labelClassName
8274
8452
  }, label, " ", labelRequired) : null, /*#__PURE__*/React__default.createElement("div", {
8275
- className: "flex flex-col gap-2 rounded-lg w-full bg-white border " + className
8453
+ className: "flex flex-col gap-2 rounded-lg w-full bg-white " + (disabled ? "!bg-gray6" : "") + " border " + className
8276
8454
  }, /*#__PURE__*/React__default.createElement("button", {
8277
- className: "w-full h-10 bg-transparent flex justify-between items-center px-3 py-2 " + selectClassName,
8278
- onClick: handleToggleSelect
8455
+ className: " w-full h-10 bg-transparent flex justify-between items-center px-3 py-2 " + selectClassName,
8456
+ onClick: handleToggleSelect,
8457
+ disabled: disabled
8279
8458
  }, /*#__PURE__*/React__default.createElement("div", {
8280
8459
  className: "flex justify-between items-center w-full"
8281
8460
  }, isEmpty(value) || isMulti ? /*#__PURE__*/React__default.createElement("div", {
@@ -8343,6 +8522,8 @@ var DateTimePicker = React.forwardRef(function (props, ref) {
8343
8522
  labelClassName = _props$labelClassName === void 0 ? "" : _props$labelClassName,
8344
8523
  _props$defaultValue = props.defaultValue,
8345
8524
  defaultValue = _props$defaultValue === void 0 ? new Date() : _props$defaultValue,
8525
+ _props$time = props.time,
8526
+ time = _props$time === void 0 ? false : _props$time,
8346
8527
  rules = props.rules;
8347
8528
  var _useState = React.useState(defaultValue),
8348
8529
  value = _useState[0],
@@ -8380,7 +8561,7 @@ var DateTimePicker = React.forwardRef(function (props, ref) {
8380
8561
  var _validateData = function _validateData() {
8381
8562
  var count = 0;
8382
8563
  rules === null || rules === void 0 ? void 0 : rules.forEach(function (e) {
8383
- var _e$pattern;
8564
+ var _e$pattern, _e$validate;
8384
8565
  if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && value === '') {
8385
8566
  _setError(e === null || e === void 0 ? void 0 : e.message);
8386
8567
  count++;
@@ -8389,6 +8570,10 @@ var DateTimePicker = React.forwardRef(function (props, ref) {
8389
8570
  _setError(e === null || e === void 0 ? void 0 : e.message);
8390
8571
  count++;
8391
8572
  return false;
8573
+ } else if (value !== "" && (e === null || e === void 0 ? void 0 : e.type) === "validate" && e !== null && e !== void 0 && e.validate && !(e !== null && e !== void 0 && (_e$validate = e.validate) !== null && _e$validate !== void 0 && _e$validate.call(e))) {
8574
+ _setError(e === null || e === void 0 ? void 0 : e.message);
8575
+ count++;
8576
+ return false;
8392
8577
  }
8393
8578
  });
8394
8579
  if (count) {
@@ -8412,13 +8597,17 @@ var DateTimePicker = React.forwardRef(function (props, ref) {
8412
8597
  selected: value,
8413
8598
  onChange: function onChange(date) {
8414
8599
  _setValue(date);
8415
- console.log("check date: ", date);
8416
8600
  },
8417
8601
  customInput: /*#__PURE__*/React__default.createElement(CustomInput, {
8418
8602
  className: _className
8419
8603
  }),
8604
+ dateFormat: time ? "dd/MM/yyyy HH:mm" : "dd/MM/yyyy",
8605
+ showTimeSelect: time,
8606
+ timeIntervals: 15,
8420
8607
  wrapperClassName: "w-full"
8421
- }), error ? /*#__PURE__*/React__default.createElement("div", null, error) : null);
8608
+ }), error ? /*#__PURE__*/React__default.createElement("div", {
8609
+ className: "text-danger"
8610
+ }, error) : null);
8422
8611
  });
8423
8612
 
8424
8613
  var InputPhoneNumber = React.forwardRef(function (props, ref) {
@@ -8432,6 +8621,8 @@ var InputPhoneNumber = React.forwardRef(function (props, ref) {
8432
8621
  name = _props$name === void 0 ? "" : _props$name,
8433
8622
  _props$onChange = props.onChange,
8434
8623
  onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
8624
+ _props$disabled = props.disabled,
8625
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
8435
8626
  _props$defaultValue = props.defaultValue,
8436
8627
  defaultValue = _props$defaultValue === void 0 ? "" : _props$defaultValue,
8437
8628
  _props$type = props.type,
@@ -8497,11 +8688,11 @@ var InputPhoneNumber = React.forwardRef(function (props, ref) {
8497
8688
  for (var _iterator = _createForOfIteratorHelperLoose(rules), _step; !(_step = _iterator()).done;) {
8498
8689
  var _e$pattern;
8499
8690
  var e = _step.value;
8500
- if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && value === '') {
8691
+ if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && !value) {
8501
8692
  _setError(e === null || e === void 0 ? void 0 : e.message);
8502
8693
  count++;
8503
8694
  break;
8504
- } else if (value !== "" && (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))) {
8695
+ } else if (value && (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))) {
8505
8696
  _setError(e === null || e === void 0 ? void 0 : e.message);
8506
8697
  count++;
8507
8698
  break;
@@ -8533,6 +8724,7 @@ var InputPhoneNumber = React.forwardRef(function (props, ref) {
8533
8724
  className: 'w-max border-0 !rounded-none !rounded-l-lg',
8534
8725
  defaultValue: countryCode,
8535
8726
  options: options,
8727
+ disabled: disabled,
8536
8728
  optionClassName: "w-max",
8537
8729
  placeholder: "+84",
8538
8730
  onClick: setCountryCode,
@@ -8554,11 +8746,12 @@ var InputPhoneNumber = React.forwardRef(function (props, ref) {
8554
8746
  })), /*#__PURE__*/React__default.createElement("input", {
8555
8747
  type: type,
8556
8748
  name: name,
8749
+ disabled: disabled,
8557
8750
  value: value,
8558
8751
  placeholder: placeholder,
8559
8752
  onChange: handleOnChange,
8560
8753
  required: required,
8561
- className: "bg-white rounded-r-lg " + _inputClassName
8754
+ className: "bg-white " + (disabled ? "!bg-gray6" : "") + " rounded-r-lg " + _inputClassName
8562
8755
  })), error ? /*#__PURE__*/React__default.createElement("div", {
8563
8756
  className: "text-danger"
8564
8757
  }, error) : null);
@@ -8719,7 +8912,9 @@ var BookingForm = function BookingForm(props) {
8719
8912
  _props$defaultValue = props.defaultValue,
8720
8913
  defaultValue = _props$defaultValue === void 0 ? [] : _props$defaultValue,
8721
8914
  _props$className = props.className,
8722
- className = _props$className === void 0 ? "" : _props$className;
8915
+ className = _props$className === void 0 ? "" : _props$className,
8916
+ _props$isModalBooking = props.isModalBooking,
8917
+ isModalBooking = _props$isModalBooking === void 0 ? false : _props$isModalBooking;
8723
8918
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
8724
8919
  _shopConfigStyle$colo5 = _shopConfigStyle$colo.background,
8725
8920
  background = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5;
@@ -8746,9 +8941,9 @@ var BookingForm = function BookingForm(props) {
8746
8941
  var _useState7 = React.useState(false),
8747
8942
  isOpenPopup = _useState7[0],
8748
8943
  setIsOpenPopup = _useState7[1];
8749
- var _useState8 = React.useState({}),
8750
- dataBooking = _useState8[0],
8751
- setDataBooking = _useState8[1];
8944
+ var _useState8 = React.useState(false),
8945
+ isHiddenForm = _useState8[0],
8946
+ setIsHiddenForm = _useState8[1];
8752
8947
  var _EmployeeController = EmployeeController(_extends({}, props)),
8753
8948
  _EmployeeController$l = _EmployeeController.listEmployment,
8754
8949
  listEmployment = _EmployeeController$l === void 0 ? [] : _EmployeeController$l;
@@ -8843,19 +9038,24 @@ var BookingForm = function BookingForm(props) {
8843
9038
  });
8844
9039
  });
8845
9040
  };
9041
+ var checkDateBooking = function checkDateBooking() {
9042
+ var _inputDateRef$current;
9043
+ var scheduleDate = inputDateRef === null || inputDateRef === void 0 ? void 0 : (_inputDateRef$current = inputDateRef.current) === null || _inputDateRef$current === void 0 ? void 0 : _inputDateRef$current.getValue();
9044
+ return scheduleDate && scheduleDate >= Date.now();
9045
+ };
8846
9046
  var handleSubmit = function handleSubmit() {
8847
9047
  try {
8848
- var _inputNameRef$current, _inputPhoneNumberRef$, _inputDateRef$current, _inputSelectedRef$cur;
9048
+ var _inputNameRef$current, _inputPhoneNumberRef$, _inputDateRef$current2, _inputSelectedRef$cur;
8849
9049
  var validateName = inputNameRef === null || inputNameRef === void 0 ? void 0 : (_inputNameRef$current = inputNameRef.current) === null || _inputNameRef$current === void 0 ? void 0 : _inputNameRef$current.validateData();
8850
9050
  var validatePhoneNumber = inputPhoneNumberRef === null || inputPhoneNumberRef === void 0 ? void 0 : (_inputPhoneNumberRef$ = inputPhoneNumberRef.current) === null || _inputPhoneNumberRef$ === void 0 ? void 0 : _inputPhoneNumberRef$.validateData();
8851
- var validateDate = inputDateRef === null || inputDateRef === void 0 ? void 0 : (_inputDateRef$current = inputDateRef.current) === null || _inputDateRef$current === void 0 ? void 0 : _inputDateRef$current.validateData();
9051
+ var validateDate = inputDateRef === null || inputDateRef === void 0 ? void 0 : (_inputDateRef$current2 = inputDateRef.current) === null || _inputDateRef$current2 === void 0 ? void 0 : _inputDateRef$current2.validateData();
8852
9052
  var validateService = inputSelectedRef === null || inputSelectedRef === void 0 ? void 0 : (_inputSelectedRef$cur = inputSelectedRef.current) === null || _inputSelectedRef$cur === void 0 ? void 0 : _inputSelectedRef$cur.validateData();
8853
9053
  var _temp = function () {
8854
9054
  if (validateName && validatePhoneNumber && validateDate && validateService) {
8855
- var _inputPhoneNumberRef$2, _inputNameRef$current2, _inputDateRef$current2;
9055
+ var _inputPhoneNumberRef$2, _inputNameRef$current2, _inputDateRef$current3;
8856
9056
  var customerPhone = inputPhoneNumberRef === null || inputPhoneNumberRef === void 0 ? void 0 : (_inputPhoneNumberRef$2 = inputPhoneNumberRef.current) === null || _inputPhoneNumberRef$2 === void 0 ? void 0 : _inputPhoneNumberRef$2.getValue();
8857
9057
  var customerName = inputNameRef === null || inputNameRef === void 0 ? void 0 : (_inputNameRef$current2 = inputNameRef.current) === null || _inputNameRef$current2 === void 0 ? void 0 : _inputNameRef$current2.getValue();
8858
- var scheduleDate = inputDateRef === null || inputDateRef === void 0 ? void 0 : (_inputDateRef$current2 = inputDateRef.current) === null || _inputDateRef$current2 === void 0 ? void 0 : _inputDateRef$current2.getValue();
9058
+ var scheduleDate = inputDateRef === null || inputDateRef === void 0 ? void 0 : (_inputDateRef$current3 = inputDateRef.current) === null || _inputDateRef$current3 === void 0 ? void 0 : _inputDateRef$current3.getValue();
8859
9059
  var services = listProductSelected === null || listProductSelected === void 0 ? void 0 : listProductSelected.map(function (item) {
8860
9060
  var _item$technical;
8861
9061
  return {
@@ -8870,11 +9070,14 @@ var BookingForm = function BookingForm(props) {
8870
9070
  return Promise.resolve(createSchedule(customerName, customerPhone, scheduleDate, services, shopId)).then(function (response) {
8871
9071
  var _response$data, _response$data$status;
8872
9072
  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') {
8873
- var _response$data2, _inputPhoneNumberRef$3, _inputNameRef$current3;
8874
- setDataBooking(response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : _response$data2.data);
9073
+ var _inputPhoneNumberRef$3, _inputNameRef$current3, _inputDateRef$current4;
9074
+ if (isModalBooking) {
9075
+ setIsHiddenForm(true);
9076
+ }
8875
9077
  setIsOpenPopup(true);
8876
9078
  inputPhoneNumberRef === null || inputPhoneNumberRef === void 0 ? void 0 : (_inputPhoneNumberRef$3 = inputPhoneNumberRef.current) === null || _inputPhoneNumberRef$3 === void 0 ? void 0 : _inputPhoneNumberRef$3.setValue("");
8877
9079
  inputNameRef === null || inputNameRef === void 0 ? void 0 : (_inputNameRef$current3 = inputNameRef.current) === null || _inputNameRef$current3 === void 0 ? void 0 : _inputNameRef$current3.setValue("");
9080
+ inputDateRef === null || inputDateRef === void 0 ? void 0 : (_inputDateRef$current4 = inputDateRef.current) === null || _inputDateRef$current4 === void 0 ? void 0 : _inputDateRef$current4.setValue(new Date());
8878
9081
  setListProductSelected([]);
8879
9082
  }
8880
9083
  });
@@ -8887,7 +9090,7 @@ var BookingForm = function BookingForm(props) {
8887
9090
  };
8888
9091
  var handleClosePopup = function handleClosePopup() {
8889
9092
  setIsOpenPopup(false);
8890
- setDataBooking({});
9093
+ setIsHiddenForm(false);
8891
9094
  };
8892
9095
  var handleSearchProducts = function handleSearchProducts(value) {
8893
9096
  setProductsParams(function (prev) {
@@ -8896,7 +9099,7 @@ var BookingForm = function BookingForm(props) {
8896
9099
  });
8897
9100
  });
8898
9101
  };
8899
- return /*#__PURE__*/React__default.createElement("div", {
9102
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !isHiddenForm ? /*#__PURE__*/React__default.createElement("div", {
8900
9103
  className: "grid gap-4 rounded-2xl p-6 border " + className,
8901
9104
  style: {
8902
9105
  backgroundColor: background
@@ -8949,9 +9152,14 @@ var BookingForm = function BookingForm(props) {
8949
9152
  label: "Thời gian",
8950
9153
  className: "w-full rounded-lg",
8951
9154
  placeholder: "Chọn thời gian",
9155
+ time: true,
8952
9156
  rules: [{
8953
9157
  type: "required",
8954
9158
  message: "Bắt buộc chọn ngày đặt"
9159
+ }, {
9160
+ type: "validate",
9161
+ message: "Thời gian không hợp lệ",
9162
+ validate: checkDateBooking
8955
9163
  }]
8956
9164
  })), (listProductSelected === null || listProductSelected === void 0 ? void 0 : listProductSelected.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
8957
9165
  className: "grid grid-cols-1"
@@ -9023,32 +9231,23 @@ var BookingForm = function BookingForm(props) {
9023
9231
  label: "Đặt lịch ngay",
9024
9232
  shopConfigStyle: shopConfigStyle,
9025
9233
  onClick: handleSubmit
9026
- })), isOpenPopup && /*#__PURE__*/React__default.createElement(ModalNotification, {
9234
+ }))) : null, isOpenPopup && /*#__PURE__*/React__default.createElement(ModalNotification, {
9027
9235
  onCloseFormBooking: onCloseFormBooking,
9028
9236
  onClose: handleClosePopup
9029
9237
  }, /*#__PURE__*/React__default.createElement("div", {
9030
- className: "bg-white rounded-lg shadow-lg p-6 max-w-sm flex flex-col items-center justify-center min-w-[320px] md:min-w-[650px] min-h-[420px] md:min-h-[380px] lg:h-auto "
9238
+ className: "bg-white rounded-lg shadow-lg p-6 lg:px-16 lg:pb-10 max-w-sm flex gap-4 flex-col items-center justify-center"
9031
9239
  }, /*#__PURE__*/React__default.createElement("div", {
9032
- className: "h-20 mb-4 flex items-center justify-center"
9240
+ className: "flex items-center justify-center"
9033
9241
  }, /*#__PURE__*/React__default.createElement(fa.FaCheckCircle, {
9034
9242
  className: "h-full text-green-500",
9035
9243
  style: {
9036
- fontSize: "150px"
9244
+ fontSize: "56px"
9037
9245
  }
9038
9246
  })), /*#__PURE__*/React__default.createElement("div", {
9039
- className: "mb-2"
9040
- }, "Kh\xE1ch h\xE0ng: ", dataBooking === null || dataBooking === void 0 ? void 0 : dataBooking.customerName), /*#__PURE__*/React__default.createElement("div", {
9041
- className: "mb-2"
9042
- }, "S\u1ED1 \u0111i\u1EC7n tho\u1EA1i: ", dataBooking === null || dataBooking === void 0 ? void 0 : dataBooking.customerPhone), /*#__PURE__*/React__default.createElement("div", {
9043
- className: "mb-4"
9044
- }, "Th\u1EDDi gian: ", dayjs_min(dataBooking === null || dataBooking === void 0 ? void 0 : dataBooking.scheduleDate).format("DD/MM/YYYY")), token ? /*#__PURE__*/React__default.createElement("div", null) : /*#__PURE__*/React__default.createElement("div", {
9045
- className: "flex flex-col items-center"
9046
- }, /*#__PURE__*/React__default.createElement("p", {
9047
- className: "mb-4 text-center"
9048
- }, "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, {
9049
- label: "Đăng nhập",
9050
- shopConfigStyle: shopConfigStyle
9051
- })))));
9247
+ className: "font-medium text-2xl"
9248
+ }, "\u0110\u1EB7t l\u1ECBch th\xE0nh c\xF4ng"), /*#__PURE__*/React__default.createElement("div", {
9249
+ className: "text-center"
9250
+ }, "Ch\xFAng t\xF4i \u0111\xE3 ghi nh\u1EADn th\xF4ng tin c\u1EE7a b\u1EA1n v\xE0 s\u1EBD li\xEAn h\u1EC7 l\u1EA1i ngay"))));
9052
9251
  };
9053
9252
 
9054
9253
  var TreatmentsList7 = function TreatmentsList7(props) {
@@ -9173,7 +9372,8 @@ var TreatmentsList7 = function TreatmentsList7(props) {
9173
9372
  onCloseFormBooking: handleCloseModal,
9174
9373
  defaultValue: dataBooking,
9175
9374
  shopConfig: shopConfig,
9176
- shopConfigStyle: shopConfigStyle
9375
+ shopConfigStyle: shopConfigStyle,
9376
+ isModalBooking: isOpenModal
9177
9377
  })) : null);
9178
9378
  };
9179
9379
 
@@ -9337,10 +9537,10 @@ var TreatmentDetail1 = function TreatmentDetail1(props) {
9337
9537
  className: "flex flex-col gap-4 col-span-2"
9338
9538
  }, displayImage ? /*#__PURE__*/React__default.createElement("img", {
9339
9539
  src: displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageUrl,
9340
- className: "w-full aspect-square rounded-2xl"
9540
+ className: "w-full aspect-square object-cover rounded-2xl"
9341
9541
  }) : /*#__PURE__*/React__default.createElement(ProductImage, {
9342
9542
  product: product,
9343
- className: "w-full aspect-square rounded-2xl"
9543
+ className: "w-full aspect-square object-contain rounded-2xl"
9344
9544
  }), /*#__PURE__*/React__default.createElement("div", {
9345
9545
  className: "flex gap-1 w-[80vw] overflow-x-auto md:w-full md:gap-2 md:flex-wrap"
9346
9546
  }, product === null || product === void 0 ? void 0 : (_product$images = product.images) === null || _product$images === void 0 ? void 0 : _product$images.map(function (item) {
@@ -9417,7 +9617,7 @@ var ProductItem2 = function ProductItem2(props) {
9417
9617
  className: "text-center relative group " + className
9418
9618
  }, /*#__PURE__*/React__default.createElement(ProductImage, {
9419
9619
  product: product,
9420
- className: "max-w-[240px] rounded-full mx-auto"
9620
+ className: "max-w-[240px] rounded-full mx-auto !object-cover"
9421
9621
  }), /*#__PURE__*/React__default.createElement(ProductPrice, {
9422
9622
  product: product,
9423
9623
  className: "text-lg mt-4"
@@ -9642,7 +9842,7 @@ var ProductList7 = function ProductList7(props) {
9642
9842
  product: product === null || product === void 0 ? void 0 : product.productInfo
9643
9843
  });
9644
9844
  })), (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement(LinkToPage, {
9645
- href: "/products",
9845
+ href: "/san-pham",
9646
9846
  Link: Link
9647
9847
  }, /*#__PURE__*/React__default.createElement(Button, {
9648
9848
  label: "Xem tất cả",
@@ -9653,68 +9853,6 @@ var ProductList7 = function ProductList7(props) {
9653
9853
  }));
9654
9854
  };
9655
9855
 
9656
- var Carousel = function Carousel(props) {
9657
- var carouselRef = React.useRef(null);
9658
- var _useState = React.useState(false),
9659
- isScrolledToLeft = _useState[0],
9660
- setIsScrolledToLeft = _useState[1];
9661
- var _useState2 = React.useState(0);
9662
- var _props$data = props.data,
9663
- data = _props$data === void 0 ? [] : _props$data,
9664
- _props$className = props.className,
9665
- className = _props$className === void 0 ? "" : _props$className,
9666
- _props$style = props.style,
9667
- style = _props$style === void 0 ? {} : _props$style,
9668
- _props$primaryColor = props.primaryColor,
9669
- primaryColor = _props$primaryColor === void 0 ? "" : _props$primaryColor,
9670
- _props$renderItem = props.renderItem,
9671
- renderItem = _props$renderItem === void 0 ? function () {} : _props$renderItem;
9672
- var handleClickPrevImg = function handleClickPrevImg() {
9673
- if (carouselRef !== null && carouselRef !== void 0 && carouselRef.current) {
9674
- setIsScrolledToLeft(true);
9675
- carouselRef.current.scrollBy({
9676
- left: -carouselRef.current.offsetWidth / 4,
9677
- behavior: "smooth"
9678
- });
9679
- }
9680
- };
9681
- var handleClickNextImg = function handleClickNextImg() {
9682
- setIsScrolledToLeft(false);
9683
- if (carouselRef !== null && carouselRef !== void 0 && carouselRef.current) {
9684
- var _carouselRef$current, _carouselRef$current2;
9685
- carouselRef === null || carouselRef === void 0 ? void 0 : (_carouselRef$current = carouselRef.current) === null || _carouselRef$current === void 0 ? void 0 : _carouselRef$current.scrollBy({
9686
- left: (carouselRef === null || carouselRef === void 0 ? void 0 : (_carouselRef$current2 = carouselRef.current) === null || _carouselRef$current2 === void 0 ? void 0 : _carouselRef$current2.offsetWidth) / 4,
9687
- behavior: "smooth"
9688
- });
9689
- }
9690
- };
9691
- return /*#__PURE__*/React__default.createElement("div", {
9692
- className: "relative " + className + " ",
9693
- style: style
9694
- }, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
9695
- className: " w-full pe-2 h-full flex gap-2 md:gap-4 xl:gap-6 overflow-x-auto no-scrollbar",
9696
- ref: carouselRef
9697
- }, data && (data === null || data === void 0 ? void 0 : data.length) > 0 ? data === null || data === void 0 ? void 0 : data.map(function (item, index) {
9698
- return renderItem(item, index);
9699
- }) : null)), data && (data === null || data === void 0 ? void 0 : data.length) > 4 ? /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("button", {
9700
- className: " hidden lg:block bg-gray3 p-3 rounded-full absolute top-[45%] left-[-8px] lg:left-[-2%]",
9701
- style: {
9702
- backgroundColor: isScrolledToLeft ? primaryColor : "#BDBDBD"
9703
- },
9704
- onClick: handleClickPrevImg
9705
- }, /*#__PURE__*/React__default.createElement(fa.FaArrowLeft, {
9706
- className: "text-sm lg:text-lg text-white"
9707
- })), /*#__PURE__*/React__default.createElement("button", {
9708
- className: " hidden lg:block p-3 rounded-full absolute top-[45%] right-[-2%] ",
9709
- style: {
9710
- backgroundColor: !isScrolledToLeft ? primaryColor : "#BDBDBD"
9711
- },
9712
- onClick: handleClickNextImg
9713
- }, /*#__PURE__*/React__default.createElement(fa.FaArrowRight, {
9714
- className: "text-sm lg:text-lg text-white"
9715
- }))) : null);
9716
- };
9717
-
9718
9856
  var Products2 = function Products2(props) {
9719
9857
  var shopConfigStyle = props.shopConfigStyle,
9720
9858
  data = props.data,
@@ -9723,8 +9861,6 @@ var Products2 = function Products2(props) {
9723
9861
  _props$Link = props.Link,
9724
9862
  Link = _props$Link === void 0 ? null : _props$Link;
9725
9863
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
9726
- _shopConfigStyle$colo2 = _shopConfigStyle$colo.primary,
9727
- primary = _shopConfigStyle$colo2 === void 0 ? "#000" : _shopConfigStyle$colo2,
9728
9864
  _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
9729
9865
  secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
9730
9866
  _shopConfigStyle$colo4 = _shopConfigStyle$colo.textBody,
@@ -9735,8 +9871,53 @@ var Products2 = function Products2(props) {
9735
9871
  textButton = _shopConfigStyle$colo6 === void 0 ? "#fff" : _shopConfigStyle$colo6;
9736
9872
  var _ProductController = ProductController(props),
9737
9873
  _ProductController$pr = _ProductController.products,
9738
- products = _ProductController$pr === void 0 ? [] : _ProductController$pr;
9874
+ products = _ProductController$pr === void 0 ? [] : _ProductController$pr,
9875
+ _ProductController$lo = _ProductController.loading,
9876
+ loading = _ProductController$lo === void 0 ? true : _ProductController$lo;
9877
+ var sliderRef = React.useRef(null);
9739
9878
  console.log("Products2 products");
9879
+ var settings = {
9880
+ infinite: false,
9881
+ slidesToShow: 4,
9882
+ slidesToScroll: 1,
9883
+ speed: 500,
9884
+ autoplay: false,
9885
+ autoplaySpeed: 4000,
9886
+ pauseOnHover: true,
9887
+ dots: false,
9888
+ swipe: true,
9889
+ touchMove: true,
9890
+ arrows: false,
9891
+ responsive: [{
9892
+ breakpoint: 1024,
9893
+ settings: {
9894
+ slidesToShow: 4,
9895
+ slidesToScroll: 4
9896
+ }
9897
+ }, {
9898
+ breakpoint: 1023,
9899
+ settings: {
9900
+ slidesToShow: 3,
9901
+ slidesToScroll: 3
9902
+ }
9903
+ }, {
9904
+ breakpoint: 635,
9905
+ settings: {
9906
+ slidesToShow: 2,
9907
+ slidesToScroll: 2
9908
+ }
9909
+ }]
9910
+ };
9911
+ var goToNext = function goToNext() {
9912
+ if (sliderRef.current) {
9913
+ sliderRef.current.slickNext();
9914
+ }
9915
+ };
9916
+ var goToPrev = function goToPrev() {
9917
+ if (sliderRef.current) {
9918
+ sliderRef.current.slickPrev();
9919
+ }
9920
+ };
9740
9921
  return /*#__PURE__*/React__default.createElement("div", {
9741
9922
  className: "pt-10 px-4 xl:px-20",
9742
9923
  style: {
@@ -9744,29 +9925,43 @@ var Products2 = function Products2(props) {
9744
9925
  color: textBody
9745
9926
  }
9746
9927
  }, /*#__PURE__*/React__default.createElement("div", {
9747
- className: "rounded-3xl w-full py-10 md:px-10 sm:px-6 px-4",
9928
+ className: "relative rounded-3xl w-full py-10 md:px-10 sm:px-6 px-4",
9748
9929
  style: {
9749
9930
  background: secondary
9750
9931
  }
9751
9932
  }, /*#__PURE__*/React__default.createElement("h2", {
9752
- className: "font-semibold text-2xl md:text-3xl lg:text-4xl ps-5 pb-4",
9933
+ className: "font-semibold text-2xl md:text-4xl lg:text-4xl ps-5 pb-4",
9753
9934
  style: {
9754
9935
  color: textButton
9755
9936
  }
9756
- }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement(Carousel, {
9757
- data: products,
9758
- primaryColor: primary,
9759
- renderItem: function renderItem(item, index) {
9760
- return /*#__PURE__*/React__default.createElement("div", {
9761
- className: "border-0 flex-shrink-0 w-[calc(50%-2px)] md:w-[calc(34%-16px)] lg:w-[calc(25%-12px)] xl:w-[calc(25%-19px)]"
9762
- }, /*#__PURE__*/React__default.createElement(ProductItem, {
9763
- product: item.productInfo,
9764
- key: "carousel-" + index,
9765
- Link: Link,
9766
- shopConfigStyle: shopConfigStyle
9767
- }));
9768
- }
9769
- })));
9937
+ }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement("div", null, loading ? /*#__PURE__*/React__default.createElement("div", {
9938
+ className: "flex justify-center mt-20 w-full min-h-32"
9939
+ }, /*#__PURE__*/React__default.createElement("div", {
9940
+ className: "mx-auto"
9941
+ }, /*#__PURE__*/React__default.createElement(Loading, null))) : (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement(Slider, _extends({
9942
+ ref: sliderRef
9943
+ }, settings), products === null || products === void 0 ? void 0 : products.map(function (product, index) {
9944
+ return /*#__PURE__*/React__default.createElement("div", {
9945
+ className: "px-2 lg:px-3",
9946
+ key: "dfg-" + index
9947
+ }, /*#__PURE__*/React__default.createElement(ProductItem, {
9948
+ product: product === null || product === void 0 ? void 0 : product.productInfo,
9949
+ Link: Link,
9950
+ shopConfigStyle: shopConfigStyle
9951
+ }));
9952
+ })) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null)), /*#__PURE__*/React__default.createElement("div", {
9953
+ className: "absolute left-0 top-1/2 w-full flex justify-between px-2 md:px-4 lg:px-6"
9954
+ }, /*#__PURE__*/React__default.createElement("button", {
9955
+ onClick: goToPrev,
9956
+ className: "bg-primary p-2 rounded-full"
9957
+ }, /*#__PURE__*/React__default.createElement(fa.FaArrowLeft, {
9958
+ className: "text-white text-lg md:text-2xl"
9959
+ }), " "), /*#__PURE__*/React__default.createElement("button", {
9960
+ onClick: goToNext,
9961
+ className: "bg-primary p-2 rounded-full"
9962
+ }, /*#__PURE__*/React__default.createElement(fa.FaArrowRight, {
9963
+ className: "text-white text-lg md:text-2xl"
9964
+ }), " "))));
9770
9965
  };
9771
9966
 
9772
9967
  var Pagination = function Pagination(props) {
@@ -9790,8 +9985,11 @@ var Pagination = function Pagination(props) {
9790
9985
  return /*#__PURE__*/React__default.createElement("div", {
9791
9986
  className: "flex gap-4 items-center justify-self-center " + className
9792
9987
  }, /*#__PURE__*/React__default.createElement(io5.IoChevronBackOutline, {
9793
- className: has_previous ? "text-primary" : "text-gray3",
9794
- size: size
9988
+ className: has_previous ? "text-primary cursor-pointer" : "text-gray3",
9989
+ size: size,
9990
+ onClick: function onClick() {
9991
+ if (has_previous) handlePageChange(current_page - 1);
9992
+ }
9795
9993
  }), /*#__PURE__*/React__default.createElement("div", {
9796
9994
  className: "flex items-center space-x-1"
9797
9995
  }, Array(total_pages).fill().map(function (_, index) {
@@ -9803,8 +10001,11 @@ var Pagination = function Pagination(props) {
9803
10001
  className: "px-4 py-1 rounded-md " + (index === current_page ? 'bg-primary text-textButton' : 'bg-transparent text-primary') + " hover:opacity-80"
9804
10002
  }, index + 1);
9805
10003
  })), /*#__PURE__*/React__default.createElement(io5.IoChevronForwardOutline, {
9806
- className: has_next ? "text-primary" : "text-gray3",
9807
- size: size
10004
+ className: has_next ? "text-primary cursor-pointer" : "text-gray3",
10005
+ size: size,
10006
+ onClick: function onClick() {
10007
+ if (has_next) handlePageChange(current_page + 1);
10008
+ }
9808
10009
  }));
9809
10010
  };
9810
10011
 
@@ -9914,6 +10115,77 @@ var Products3 = function Products3(props) {
9914
10115
  }));
9915
10116
  };
9916
10117
 
10118
+ var Products9 = function Products9(props) {
10119
+ var _props$Link = props.Link,
10120
+ Link = _props$Link === void 0 ? null : _props$Link,
10121
+ shopConfigStyle = props.shopConfigStyle,
10122
+ _props$ProductItem = props.ProductItem,
10123
+ ProductItem = _props$ProductItem === void 0 ? null : _props$ProductItem;
10124
+ var _useState = React.useState({
10125
+ size: 12
10126
+ }),
10127
+ params = _useState[0],
10128
+ setParams = _useState[1];
10129
+ var _CategoryController = CategoryController(_extends({}, props)),
10130
+ _CategoryController$c = _CategoryController.categories,
10131
+ categories = _CategoryController$c === void 0 ? [] : _CategoryController$c;
10132
+ var _ProductController = ProductController(_extends({}, props, {
10133
+ params: params
10134
+ })),
10135
+ _ProductController$pr = _ProductController.products,
10136
+ products = _ProductController$pr === void 0 ? [] : _ProductController$pr,
10137
+ loading = _ProductController.loading;
10138
+ var handleChooseCategory = function handleChooseCategory(item) {
10139
+ setParams(_extends({}, params, {
10140
+ categoryId: item === null || item === void 0 ? void 0 : item.categoryId,
10141
+ size: 12
10142
+ }));
10143
+ };
10144
+ var groupedProducts = products === null || products === void 0 ? void 0 : products.reduce(function (acc, product) {
10145
+ var _product$productInfo = product === null || product === void 0 ? void 0 : product.productInfo,
10146
+ categoryName = _product$productInfo.categoryName;
10147
+ if (!acc[categoryName]) {
10148
+ acc[categoryName] = [];
10149
+ }
10150
+ acc[categoryName].push(product);
10151
+ return acc;
10152
+ }, {});
10153
+ console.log(groupedProducts);
10154
+ return /*#__PURE__*/React__default.createElement("div", {
10155
+ className: SECTION_CLASS + " flex flex-col gap-4 mt-0 md:gap-6 "
10156
+ }, /*#__PURE__*/React__default.createElement(CarouselItem, {
10157
+ data: categories,
10158
+ onClick: handleChooseCategory
10159
+ }), loading ? /*#__PURE__*/React__default.createElement("div", {
10160
+ className: "m-auto mt-20 min-h-32"
10161
+ }, /*#__PURE__*/React__default.createElement(Loading, null)) : groupedProducts ? Object.entries(groupedProducts).map(function (_ref, index) {
10162
+ var _products$;
10163
+ var categoryName = _ref[0],
10164
+ products = _ref[1];
10165
+ return /*#__PURE__*/React__default.createElement("div", {
10166
+ key: "wds-" + index,
10167
+ id: categoryName
10168
+ }, (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
10169
+ className: "flex justify-between items-center"
10170
+ }, /*#__PURE__*/React__default.createElement("h2", {
10171
+ className: "text-2xl md:text-4xl font-semibold mb-4"
10172
+ }, categoryName), /*#__PURE__*/React__default.createElement(LinkToPage, {
10173
+ Link: Link,
10174
+ href: getLinkProductsByCategory(products === null || products === void 0 ? void 0 : (_products$ = products[0]) === null || _products$ === void 0 ? void 0 : _products$.productInfo),
10175
+ className: "font-semibold text-primary cursor-pointer"
10176
+ }, "Xem t\u1EA5t c\u1EA3")) : null, /*#__PURE__*/React__default.createElement("div", {
10177
+ className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-2 md:gap-4 lg:gap-8"
10178
+ }, (products === null || products === void 0 ? void 0 : products.length) > 0 ? products === null || products === void 0 ? void 0 : products.map(function (product) {
10179
+ return /*#__PURE__*/React__default.createElement(ProductItem, {
10180
+ Link: Link,
10181
+ shopConfigStyle: shopConfigStyle,
10182
+ product: product === null || product === void 0 ? void 0 : product.productInfo,
10183
+ key: product === null || product === void 0 ? void 0 : product.landingShopProductId
10184
+ });
10185
+ }) : null));
10186
+ }) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null));
10187
+ };
10188
+
9917
10189
  var Products10 = function Products10(props) {
9918
10190
  var _useState = React.useState({
9919
10191
  size: 8
@@ -9953,7 +10225,7 @@ var Products10 = function Products10(props) {
9953
10225
  }), loading ? /*#__PURE__*/React__default.createElement("div", {
9954
10226
  className: "m-auto mt-20 min-h-32"
9955
10227
  }, /*#__PURE__*/React__default.createElement(Loading, null)) : (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
9956
- className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-2 gap-y-4 md:gap-4 xl:gap-6"
10228
+ className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-x-2 gap-y-4 md:gap-4 xl:gap-6"
9957
10229
  }, products === null || products === void 0 ? void 0 : products.map(function (product, idx) {
9958
10230
  return /*#__PURE__*/React__default.createElement(ProductItem, {
9959
10231
  Link: Link,
@@ -9965,12 +10237,173 @@ var Products10 = function Products10(props) {
9965
10237
  })) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null));
9966
10238
  };
9967
10239
 
9968
- var ProductCategory2 = function ProductCategory2(props) {
9969
- var _products$slice;
9970
- var _props$Link = props.Link,
9971
- Link = _props$Link === void 0 ? null : _props$Link,
9972
- data = props.data,
9973
- shopConfigStyle = props.shopConfigStyle,
10240
+ var listFilter = [{
10241
+ label: "Khuyến mãi",
10242
+ value: "discount",
10243
+ filter: {
10244
+ isDiscount: true
10245
+ }
10246
+ }, {
10247
+ label: "Nổi bật",
10248
+ value: "isHighlight",
10249
+ filter: {
10250
+ isHighlight: true
10251
+ }
10252
+ }, {
10253
+ label: "Giá thấp đến cao",
10254
+ value: "sortPriceDESC",
10255
+ filter: {
10256
+ isHighlight: true
10257
+ }
10258
+ }];
10259
+ var Products11 = function Products11(props) {
10260
+ var _productsFilter$slice;
10261
+ var _props$shopConfigStyl = props.shopConfigStyle,
10262
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
10263
+ _props$Link = props.Link,
10264
+ Link = _props$Link === void 0 ? null : _props$Link,
10265
+ _props$categoryId = props.categoryId,
10266
+ categoryId = _props$categoryId === void 0 ? 0 : _props$categoryId,
10267
+ _props$ProductItem = props.ProductItem,
10268
+ ProductItem = _props$ProductItem === void 0 ? null : _props$ProductItem;
10269
+ var _useState = React.useState({
10270
+ page: 0,
10271
+ size: 12,
10272
+ categoryId: categoryId
10273
+ }),
10274
+ params = _useState[0],
10275
+ setParams = _useState[1];
10276
+ var _useState2 = React.useState(true),
10277
+ firstLoading = _useState2[0],
10278
+ setFirstLoading = _useState2[1];
10279
+ var _useState3 = React.useState({}),
10280
+ categorySelected = _useState3[0],
10281
+ setCategorySelected = _useState3[1];
10282
+ var _useState4 = React.useState([]),
10283
+ productsFilter = _useState4[0],
10284
+ setProductsFilter = _useState4[1];
10285
+ var _CategoryController = CategoryController(_extends({}, props, {
10286
+ params: params
10287
+ })),
10288
+ _CategoryController$c = _CategoryController.categories,
10289
+ categories = _CategoryController$c === void 0 ? [] : _CategoryController$c;
10290
+ var _ProductController = ProductController(_extends({}, props, {
10291
+ params: params
10292
+ })),
10293
+ _ProductController$pr = _ProductController.products,
10294
+ products = _ProductController$pr === void 0 ? [] : _ProductController$pr,
10295
+ loading = _ProductController.loading,
10296
+ page = _ProductController.page;
10297
+ var handleOnChangePage = function handleOnChangePage(pageIndex) {
10298
+ setFirstLoading(false);
10299
+ setParams(function (prev) {
10300
+ return _extends({}, prev, {
10301
+ page: pageIndex
10302
+ });
10303
+ });
10304
+ };
10305
+ var handleChooseCategory = function handleChooseCategory(category) {
10306
+ setCategorySelected(category);
10307
+ setFirstLoading(true);
10308
+ setParams(function (prev) {
10309
+ return _extends({}, prev, {
10310
+ categoryId: category === null || category === void 0 ? void 0 : category.categoryId,
10311
+ size: 12
10312
+ });
10313
+ });
10314
+ };
10315
+ React.useEffect(function () {
10316
+ if ((categories === null || categories === void 0 ? void 0 : categories.length) > 0 && params !== null && params !== void 0 && params.categoryId) {
10317
+ var category = categories === null || categories === void 0 ? void 0 : categories.find(function (item) {
10318
+ return (item === null || item === void 0 ? void 0 : item.categoryId) == (params === null || params === void 0 ? void 0 : params.categoryId);
10319
+ });
10320
+ setCategorySelected(category);
10321
+ }
10322
+ }, [categories]);
10323
+ React.useEffect(function () {
10324
+ if ((products === null || products === void 0 ? void 0 : products.length) > 0) {
10325
+ setProductsFilter(products);
10326
+ }
10327
+ }, [products]);
10328
+ var handleFilter = function handleFilter(item) {
10329
+ if ((item === null || item === void 0 ? void 0 : item.value) === "sortPriceDESC") {
10330
+ var productsCopy = [].concat(products);
10331
+ productsCopy === null || productsCopy === void 0 ? void 0 : productsCopy.sort(function (a, b) {
10332
+ var _b$productInfo, _a$productInfo;
10333
+ return +(b === null || b === void 0 ? void 0 : (_b$productInfo = b.productInfo) === null || _b$productInfo === void 0 ? void 0 : _b$productInfo.price) - (a === null || a === void 0 ? void 0 : (_a$productInfo = a.productInfo) === null || _a$productInfo === void 0 ? void 0 : _a$productInfo.price);
10334
+ });
10335
+ setProductsFilter(productsCopy);
10336
+ } else if ((item === null || item === void 0 ? void 0 : item.value) === "discount") {
10337
+ var _productsCopy = [].concat(products);
10338
+ _productsCopy === null || _productsCopy === void 0 ? void 0 : _productsCopy.filter(function (product) {
10339
+ return (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);
10340
+ });
10341
+ setProductsFilter(_productsCopy);
10342
+ } else if ((item === null || item === void 0 ? void 0 : item.value) === "isHighlight") {
10343
+ var _productsCopy3;
10344
+ var _productsCopy2 = [].concat(products);
10345
+ _productsCopy2 = (_productsCopy3 = _productsCopy2) === null || _productsCopy3 === void 0 ? void 0 : _productsCopy3.filter(function (product) {
10346
+ return (product === null || product === void 0 ? void 0 : product[item === null || item === void 0 ? void 0 : item.value]) === true;
10347
+ });
10348
+ setProductsFilter(_productsCopy2);
10349
+ } else {
10350
+ setProductsFilter(products);
10351
+ }
10352
+ };
10353
+ return /*#__PURE__*/React__default.createElement("div", {
10354
+ className: SECTION_CLASS + " grid grid-cols-1 md:grid-cols-4 gap-6"
10355
+ }, /*#__PURE__*/React__default.createElement("div", {
10356
+ className: "md:sticky top-20 self-start"
10357
+ }, /*#__PURE__*/React__default.createElement("div", {
10358
+ className: " flex flex-col gap-2 rounded-3xl bg-bgSecondary p-4"
10359
+ }, categories === null || categories === void 0 ? void 0 : categories.map(function (item, index) {
10360
+ return /*#__PURE__*/React__default.createElement("div", {
10361
+ className: "px-6 py-2 hover:bg-gray-100 hover:text-primary cursor-pointer rounded-lg " + ((categorySelected === null || categorySelected === void 0 ? void 0 : categorySelected.categoryId) === (item === null || item === void 0 ? void 0 : item.categoryId) ? " bg-primary text-textButton" : ""),
10362
+ onClick: function onClick() {
10363
+ handleChooseCategory(item);
10364
+ },
10365
+ key: "sdjfdh-" + index
10366
+ }, item === null || item === void 0 ? void 0 : item.cateName);
10367
+ }))), /*#__PURE__*/React__default.createElement("div", {
10368
+ className: "md:col-span-3 flex flex-col gap-8"
10369
+ }, /*#__PURE__*/React__default.createElement(CarouselItem, {
10370
+ data: listFilter,
10371
+ isNavigateButton: false,
10372
+ onClick: handleFilter
10373
+ }), loading && firstLoading ? /*#__PURE__*/React__default.createElement("div", {
10374
+ className: "w-full h-96 mb-1 flex justify-center items-center"
10375
+ }, /*#__PURE__*/React__default.createElement(Loading, null)) : /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
10376
+ className: "grid grid-cols-2 md:grid-cols-2 lg:grid-cols-3 gap-3 md:gap-6 lg:gap-8"
10377
+ }, (productsFilter === null || productsFilter === void 0 ? void 0 : productsFilter.length) > 0 ? productsFilter === null || productsFilter === void 0 ? void 0 : (_productsFilter$slice = productsFilter.slice(0, (params === null || params === void 0 ? void 0 : params.size) - 4)) === null || _productsFilter$slice === void 0 ? void 0 : _productsFilter$slice.map(function (product, index) {
10378
+ return /*#__PURE__*/React__default.createElement(LinkToPage, {
10379
+ href: getLinkProductDetail(product === null || product === void 0 ? void 0 : product.productInfo),
10380
+ Link: Link,
10381
+ key: "kghf-" + index
10382
+ }, /*#__PURE__*/React__default.createElement(ProductItem, {
10383
+ Link: Link,
10384
+ shopConfigStyle: shopConfigStyle,
10385
+ product: product === null || product === void 0 ? void 0 : product.productInfo,
10386
+ key: product === null || product === void 0 ? void 0 : product.landingShopProductId
10387
+ }));
10388
+ }) : /*#__PURE__*/React__default.createElement("div", {
10389
+ className: "md:col-span-2 lg:col-span-3 mt-20 m-auto"
10390
+ }, /*#__PURE__*/React__default.createElement(NotFoundProduct, null)))), /*#__PURE__*/React__default.createElement("div", {
10391
+ className: "w-full m-auto"
10392
+ }, (page === null || page === void 0 ? void 0 : page.total_pages) > 1 ? /*#__PURE__*/React__default.createElement(Pagination, {
10393
+ total_pages: page === null || page === void 0 ? void 0 : page.total_pages,
10394
+ has_next: page === null || page === void 0 ? void 0 : page.has_next,
10395
+ has_previous: page === null || page === void 0 ? void 0 : page.has_previous,
10396
+ current_page: page === null || page === void 0 ? void 0 : page.current_page,
10397
+ onPageChange: handleOnChangePage
10398
+ }) : null)));
10399
+ };
10400
+
10401
+ var ProductCategory2 = function ProductCategory2(props) {
10402
+ var _products$slice;
10403
+ var _props$Link = props.Link,
10404
+ Link = _props$Link === void 0 ? null : _props$Link,
10405
+ data = props.data,
10406
+ shopConfigStyle = props.shopConfigStyle,
9974
10407
  _props$SectionTitle = props.SectionTitle,
9975
10408
  SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
9976
10409
  _props$ProductItem = props.ProductItem,
@@ -10016,7 +10449,7 @@ var ProductCategory2 = function ProductCategory2(props) {
10016
10449
  }), loading && isFilter ? /*#__PURE__*/React__default.createElement("div", {
10017
10450
  className: "m-auto mt-20 min-h-32"
10018
10451
  }, /*#__PURE__*/React__default.createElement(Loading, null)) : (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
10019
- className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-2 gap-y-4 md:gap-4 xl:gap-6"
10452
+ className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-x-2 gap-y-4 md:gap-4 xl:gap-6"
10020
10453
  }, products === null || products === void 0 ? void 0 : (_products$slice = products.slice(0, (params === null || params === void 0 ? void 0 : params.size) - 4)) === null || _products$slice === void 0 ? void 0 : _products$slice.map(function (product, idx) {
10021
10454
  return /*#__PURE__*/React__default.createElement(ProductItem, {
10022
10455
  Link: Link,
@@ -10070,8 +10503,21 @@ var ProductSale2 = function ProductSale2(props) {
10070
10503
  })) : null;
10071
10504
  };
10072
10505
 
10506
+ var listFilter$1 = [{
10507
+ label: "Khuyến mãi",
10508
+ value: "discount",
10509
+ filter: {
10510
+ isDiscount: true
10511
+ }
10512
+ }, {
10513
+ label: "Nổi bật",
10514
+ value: "isHighlight",
10515
+ filter: {
10516
+ isHighlight: true
10517
+ }
10518
+ }];
10073
10519
  var ProductSearch1 = function ProductSearch1(props) {
10074
- var _window, _window$location;
10520
+ var _window, _window$location, _productsFilter$slice;
10075
10521
  var _props$Link = props.Link,
10076
10522
  Link = _props$Link === void 0 ? null : _props$Link,
10077
10523
  _props$SectionTitle = props.SectionTitle,
@@ -10080,13 +10526,13 @@ var ProductSearch1 = function ProductSearch1(props) {
10080
10526
  ProductItem = _props$ProductItem === void 0 ? null : _props$ProductItem,
10081
10527
  shopConfigStyle = props.shopConfigStyle;
10082
10528
  var queryParams = new URLSearchParams((_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.search);
10083
- var keywordValue = queryParams === null || queryParams === void 0 ? void 0 : queryParams.get('keyword');
10084
- var _useState = React.useState(0),
10085
- length = _useState[0],
10086
- setLength = _useState[1];
10529
+ var keywordValue = queryParams === null || queryParams === void 0 ? void 0 : queryParams.get('tu-khoa');
10530
+ var _useState = React.useState([]),
10531
+ productsFilter = _useState[0],
10532
+ setProductsFilter = _useState[1];
10087
10533
  var _useState2 = React.useState({
10088
10534
  productName: keywordValue,
10089
- size: 24
10535
+ size: 12
10090
10536
  }),
10091
10537
  params = _useState2[0],
10092
10538
  setParams = _useState2[1];
@@ -10105,36 +10551,34 @@ var ProductSearch1 = function ProductSearch1(props) {
10105
10551
  });
10106
10552
  });
10107
10553
  }, [keywordValue]);
10554
+ React.useEffect(function () {
10555
+ if ((products === null || products === void 0 ? void 0 : products.length) > 0) setProductsFilter(products);
10556
+ }, [products]);
10108
10557
  var handleGetMoreProducts = function handleGetMoreProducts() {
10109
10558
  setIsGetMore(false);
10110
- setLength(function (prev) {
10111
- return prev + 4;
10559
+ setParams(function (prev) {
10560
+ return _extends({}, prev, {
10561
+ size: (prev === null || prev === void 0 ? void 0 : prev.size) + 4
10562
+ });
10112
10563
  });
10113
10564
  };
10114
- var listFilter = [{
10115
- label: "Khuyến mãi",
10116
- value: "discount",
10117
- filter: {
10118
- isDiscount: true
10119
- }
10120
- }, {
10121
- label: "Nổi bật",
10122
- value: "highlight",
10123
- filter: {
10124
- isHighlight: true
10125
- }
10126
- }];
10127
10565
  var handleFilter = function handleFilter(item) {
10128
- setParams(function (prev) {
10129
- var _Object$keys;
10130
- var newParams = _extends({}, prev);
10131
- Object === null || Object === void 0 ? void 0 : (_Object$keys = Object.keys(newParams)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.forEach(function (key) {
10132
- if (key !== 'productName' && key !== 'size') {
10133
- delete newParams[key];
10134
- }
10566
+ if ((item === null || item === void 0 ? void 0 : item.value) === "discount") {
10567
+ var productsCopy = [].concat(products);
10568
+ productsCopy === null || productsCopy === void 0 ? void 0 : productsCopy.filter(function (product) {
10569
+ return (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);
10135
10570
  });
10136
- return _extends({}, newParams, item === null || item === void 0 ? void 0 : item.filter);
10137
- });
10571
+ setProductsFilter(productsCopy);
10572
+ } else if ((item === null || item === void 0 ? void 0 : item.value) === "isHighlight") {
10573
+ var _productsCopy2;
10574
+ var _productsCopy = [].concat(products);
10575
+ _productsCopy = (_productsCopy2 = _productsCopy) === null || _productsCopy2 === void 0 ? void 0 : _productsCopy2.filter(function (product) {
10576
+ return (product === null || product === void 0 ? void 0 : product[item === null || item === void 0 ? void 0 : item.value]) === true;
10577
+ });
10578
+ setProductsFilter(_productsCopy);
10579
+ } else {
10580
+ setProductsFilter(products);
10581
+ }
10138
10582
  };
10139
10583
  return /*#__PURE__*/React__default.createElement("div", {
10140
10584
  className: SECTION_CLASS + " flex flex-col gap-4 md:gap-6 "
@@ -10146,20 +10590,20 @@ var ProductSearch1 = function ProductSearch1(props) {
10146
10590
  }), /*#__PURE__*/React__default.createElement("div", {
10147
10591
  className: "text-lg"
10148
10592
  }, "T\u1EEB kh\xF3a \"", keywordValue, "\" (", products === null || products === void 0 ? void 0 : products.length, " s\u1EA3n ph\u1EA9m)"), /*#__PURE__*/React__default.createElement(CarouselItem, {
10149
- data: listFilter,
10593
+ data: listFilter$1,
10150
10594
  isNavigateButton: false,
10151
10595
  onClick: handleFilter
10152
10596
  }), loading && isGetMore ? /*#__PURE__*/React__default.createElement("div", {
10153
10597
  className: "m-auto mt-20 min-h-32"
10154
- }, /*#__PURE__*/React__default.createElement(Loading, null)) : (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
10598
+ }, /*#__PURE__*/React__default.createElement(Loading, null)) : (productsFilter === null || productsFilter === void 0 ? void 0 : productsFilter.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
10155
10599
  className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-x-2 gap-y-4 md:gap-4 xl:gap-6"
10156
- }, products.slice(0, 8 + length).map(function (product, idx) {
10600
+ }, productsFilter === null || productsFilter === void 0 ? void 0 : (_productsFilter$slice = productsFilter.slice(0, (params === null || params === void 0 ? void 0 : params.size) - 4)) === null || _productsFilter$slice === void 0 ? void 0 : _productsFilter$slice.map(function (product, idx) {
10157
10601
  return /*#__PURE__*/React__default.createElement(ProductItem, {
10158
10602
  Link: Link,
10159
10603
  product: product === null || product === void 0 ? void 0 : product.productInfo,
10160
10604
  key: "htrhr-" + idx
10161
10605
  });
10162
- })) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null), !loading && (products === null || products === void 0 ? void 0 : products.length) > 8 + length ? /*#__PURE__*/React__default.createElement(Button, {
10606
+ })) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null), !loading && (productsFilter === null || productsFilter === void 0 ? void 0 : productsFilter.length) > (params === null || params === void 0 ? void 0 : params.size) - 4 ? /*#__PURE__*/React__default.createElement(Button, {
10163
10607
  label: "Xem thêm",
10164
10608
  onClick: handleGetMoreProducts,
10165
10609
  className: "mx-auto " + (shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.buttonClass),
@@ -10279,6 +10723,7 @@ var ProductsTop1 = function ProductsTop1(props) {
10279
10723
  _props$Link = props.Link,
10280
10724
  Link = _props$Link === void 0 ? null : _props$Link;
10281
10725
  var _useState = React.useState({
10726
+ sort: "ranked,DESC",
10282
10727
  size: 8
10283
10728
  }),
10284
10729
  params = _useState[0];
@@ -10289,6 +10734,7 @@ var ProductsTop1 = function ProductsTop1(props) {
10289
10734
  products = _ProductController$pr === void 0 ? [] : _ProductController$pr,
10290
10735
  loading = _ProductController.loading;
10291
10736
  console.log("ProductsTop1 products");
10737
+ console.log(products);
10292
10738
  return /*#__PURE__*/React__default.createElement("div", {
10293
10739
  className: SECTION_DEFAULT_CLASS + " flex flex-col gap-8 "
10294
10740
  }, /*#__PURE__*/React__default.createElement(SectionTitle, {
@@ -10379,7 +10825,7 @@ var ProductHighlight1 = function ProductHighlight1(props) {
10379
10825
  isGetMore = _useState[0],
10380
10826
  setIsGetMore = _useState[1];
10381
10827
  var _useState2 = React.useState({
10382
- size: 8,
10828
+ size: 12,
10383
10829
  isHighlight: true
10384
10830
  }),
10385
10831
  params = _useState2[0],
@@ -10404,7 +10850,7 @@ var ProductHighlight1 = function ProductHighlight1(props) {
10404
10850
  }), loading && isGetMore ? /*#__PURE__*/React__default.createElement("div", {
10405
10851
  className: "m-auto mt-20 min-h-32"
10406
10852
  }, /*#__PURE__*/React__default.createElement(Loading, null)) : (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
10407
- className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-2 gap-y-4 md:gap-4 xl:gap-6"
10853
+ className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-x-2 gap-y-4 md:gap-4 xl:gap-6"
10408
10854
  }, products === null || products === void 0 ? void 0 : (_products$slice = products.slice(0, (params === null || params === void 0 ? void 0 : params.size) - 4)) === null || _products$slice === void 0 ? void 0 : _products$slice.map(function (product, idx) {
10409
10855
  return /*#__PURE__*/React__default.createElement(ProductItem, {
10410
10856
  Link: Link,
@@ -10422,7 +10868,7 @@ var ProductHighlight1 = function ProductHighlight1(props) {
10422
10868
  };
10423
10869
 
10424
10870
  var ProductDetail10 = function ProductDetail10(props) {
10425
- var _product$images;
10871
+ var _product$images2;
10426
10872
  var shopConfigStyle = props.shopConfigStyle,
10427
10873
  shopConfig = props.shopConfig,
10428
10874
  _props$handleRedirect = props.handleRedirect,
@@ -10450,6 +10896,7 @@ var ProductDetail10 = function ProductDetail10(props) {
10450
10896
  var descriptionRef = React.useRef();
10451
10897
  React.useEffect(function () {
10452
10898
  if (product) {
10899
+ var _product$images;
10453
10900
  initVariant();
10454
10901
  if (descriptionRef.current) {
10455
10902
  var descriptionHeight = descriptionRef.current.offsetHeight;
@@ -10457,6 +10904,7 @@ var ProductDetail10 = function ProductDetail10(props) {
10457
10904
  setHiddenButton(false);
10458
10905
  }
10459
10906
  }
10907
+ setDisplayImage(product === null || product === void 0 ? void 0 : (_product$images = product.images) === null || _product$images === void 0 ? void 0 : _product$images[0]);
10460
10908
  }
10461
10909
  }, [product]);
10462
10910
  var initVariant = function initVariant() {
@@ -10522,7 +10970,7 @@ var ProductDetail10 = function ProductDetail10(props) {
10522
10970
  var _refInputQuantity$cur3;
10523
10971
  var quantity = refInputQuantity === null || refInputQuantity === void 0 ? void 0 : (_refInputQuantity$cur3 = refInputQuantity.current) === null || _refInputQuantity$cur3 === void 0 ? void 0 : _refInputQuantity$cur3.getValue();
10524
10972
  return Promise.resolve(addProductToCart(product, variant, quantity)).then(function () {
10525
- handleRedirect("/carts");
10973
+ handleRedirect("/gio-hang");
10526
10974
  });
10527
10975
  }
10528
10976
  }();
@@ -10539,21 +10987,27 @@ var ProductDetail10 = function ProductDetail10(props) {
10539
10987
  }, /*#__PURE__*/React__default.createElement("div", {
10540
10988
  className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-5 gap-6 bg-bgSecondary"
10541
10989
  }, /*#__PURE__*/React__default.createElement("div", {
10542
- className: "flex flex-col gap-4 col-span-2"
10990
+ className: "flex flex-col gap-4 col-span-2 "
10543
10991
  }, displayImage ? /*#__PURE__*/React__default.createElement("img", {
10544
10992
  src: displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageUrl,
10545
- className: "w-full aspect-square rounded-2xl "
10546
- }) : /*#__PURE__*/React__default.createElement(ProductImage, {
10547
- product: product,
10548
- className: "w-full aspect-square rounded-2xl"
10549
- }), /*#__PURE__*/React__default.createElement("div", {
10993
+ className: "w-full border rounded-2xl p-2 bg-background aspect-square object-contain rounded-2xl "
10994
+ }) : /*#__PURE__*/React__default.createElement("div", {
10995
+ className: "flex justify-center items-center w-full rounded-2xl aspect-square",
10996
+ style: {
10997
+ backgroundColor: "#FAFAFA"
10998
+ }
10999
+ }, /*#__PURE__*/React__default.createElement(SvgImageGallery, {
11000
+ width: "25%",
11001
+ height: "25%",
11002
+ fill: "#D9D9D9"
11003
+ })), /*#__PURE__*/React__default.createElement("div", {
10550
11004
  className: "flex gap-1 w-[80vw] overflow-x-auto md:w-full md:gap-2 md:flex-wrap"
10551
- }, product === null || product === void 0 ? void 0 : (_product$images = product.images) === null || _product$images === void 0 ? void 0 : _product$images.map(function (item) {
11005
+ }, product === null || product === void 0 ? void 0 : (_product$images2 = product.images) === null || _product$images2 === void 0 ? void 0 : _product$images2.map(function (item) {
10552
11006
  return /*#__PURE__*/React__default.createElement("img", {
10553
11007
  src: item === null || item === void 0 ? void 0 : item.imageUrl,
10554
11008
  key: item === null || item === void 0 ? void 0 : item.imageId,
10555
11009
  alt: "",
10556
- className: (displayImage ? "" : "first:border first:opacity-100 first:brightness-100") + " cursor-pointer h-16 w-16 rounded-lg \n " + ((displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageId) === (item === null || item === void 0 ? void 0 : item.imageId) ? "border" : "opacity-50 brightness-75 bg-background"),
11010
+ className: "cursor-pointer h-16 w-16 rounded-lg bg-background\n " + ((displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageId) === (item === null || item === void 0 ? void 0 : item.imageId) ? "border" : "opacity-50 brightness-75 "),
10557
11011
  onClick: function onClick() {
10558
11012
  handleDisplayImage(item);
10559
11013
  }
@@ -10642,6 +11096,274 @@ var ProductDetail10 = function ProductDetail10(props) {
10642
11096
  }, "Kh\xF4ng c\xF3 th\xF4ng tin"))));
10643
11097
  };
10644
11098
 
11099
+ var ProductDetail11 = function ProductDetail11(props) {
11100
+ var _product$images2, _product$images3, _product$images4, _product$images5, _product$attributes, _product$attributes2;
11101
+ var shopConfigStyle = props.shopConfigStyle,
11102
+ shopConfig = props.shopConfig,
11103
+ _props$handleRedirect = props.handleRedirect,
11104
+ handleRedirect = _props$handleRedirect === void 0 ? function () {} : _props$handleRedirect;
11105
+ var _ProductDetailControl = ProductDetailController(props),
11106
+ product = _ProductDetailControl.product;
11107
+ var _useState = React.useState(),
11108
+ variant = _useState[0],
11109
+ setVariant = _useState[1];
11110
+ var _useState2 = React.useState([]),
11111
+ options = _useState2[0],
11112
+ setOptions = _useState2[1];
11113
+ var _useState3 = React.useState(),
11114
+ displayImage = _useState3[0],
11115
+ setDisplayImage = _useState3[1];
11116
+ var _useState4 = React.useState(false),
11117
+ isSeeMore = _useState4[0],
11118
+ setIsSeeMore = _useState4[1];
11119
+ var _useState5 = React.useState(true),
11120
+ hiddenButton = _useState5[0],
11121
+ setHiddenButton = _useState5[1];
11122
+ var _CartController = CartController(props),
11123
+ addProductToCart = _CartController.addProductToCart;
11124
+ var refInputQuantity = React.useRef();
11125
+ var descriptionRef = React.useRef();
11126
+ React.useEffect(function () {
11127
+ if (product) {
11128
+ var _product$images;
11129
+ initVariant();
11130
+ if (descriptionRef.current) {
11131
+ var descriptionHeight = descriptionRef.current.offsetHeight;
11132
+ if (descriptionHeight >= 700) {
11133
+ setHiddenButton(false);
11134
+ }
11135
+ }
11136
+ setDisplayImage(product === null || product === void 0 ? void 0 : (_product$images = product.images) === null || _product$images === void 0 ? void 0 : _product$images[0]);
11137
+ }
11138
+ }, [product]);
11139
+ var initVariant = function initVariant() {
11140
+ var _product$variants, _variant$index;
11141
+ var variant = product === null || product === void 0 ? void 0 : (_product$variants = product.variants) === null || _product$variants === void 0 ? void 0 : _product$variants[0];
11142
+ var indexOptions = variant === null || variant === void 0 ? void 0 : (_variant$index = variant.index) === null || _variant$index === void 0 ? void 0 : _variant$index.split(",");
11143
+ setVariant(variant);
11144
+ var options = (product === null || product === void 0 ? void 0 : product.optionValues) || [];
11145
+ options = options.map(function (e, i) {
11146
+ return _extends({}, e, {
11147
+ valueIndex: (indexOptions === null || indexOptions === void 0 ? void 0 : indexOptions[i]) || 0
11148
+ });
11149
+ });
11150
+ setOptions(options);
11151
+ };
11152
+ var selectOption = function selectOption(optionIndex, valueIndex) {
11153
+ console.log("selectOption optionIndex valueIndex", optionIndex, valueIndex);
11154
+ var newOption = _extends({}, options[optionIndex], {
11155
+ valueIndex: valueIndex
11156
+ });
11157
+ options.splice(optionIndex, 1, newOption);
11158
+ var newOptions = [].concat(options);
11159
+ setOptions(newOptions);
11160
+ console.log("newOptions", newOptions);
11161
+ var variant = getVariantFromOption(newOptions);
11162
+ console.log("getVariantFromOption variant", variant);
11163
+ setVariant(variant);
11164
+ };
11165
+ var getVariantFromOption = function getVariantFromOption(_options) {
11166
+ console.log("getVariantFromOption options", _options);
11167
+ var listOptionIndexSelected = _options.map(function (e) {
11168
+ return e.valueIndex;
11169
+ }).filter(function (e) {
11170
+ return e !== undefined;
11171
+ });
11172
+ var variantIndex = listOptionIndexSelected.join(",");
11173
+ return ((product === null || product === void 0 ? void 0 : product.variants) || []).find(function (e) {
11174
+ return e.index === variantIndex;
11175
+ });
11176
+ };
11177
+ var validateData = function validateData() {
11178
+ var _refInputQuantity$cur;
11179
+ return (refInputQuantity === null || refInputQuantity === void 0 ? void 0 : (_refInputQuantity$cur = refInputQuantity.current) === null || _refInputQuantity$cur === void 0 ? void 0 : _refInputQuantity$cur.validateData()) && variant;
11180
+ };
11181
+ var addToCart = function addToCart() {
11182
+ try {
11183
+ var _temp = function () {
11184
+ if (validateData()) {
11185
+ var _refInputQuantity$cur2;
11186
+ var quantity = refInputQuantity === null || refInputQuantity === void 0 ? void 0 : (_refInputQuantity$cur2 = refInputQuantity.current) === null || _refInputQuantity$cur2 === void 0 ? void 0 : _refInputQuantity$cur2.getValue();
11187
+ return Promise.resolve(addProductToCart(product, variant, quantity)).then(function () {});
11188
+ }
11189
+ }();
11190
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
11191
+ } catch (e) {
11192
+ return Promise.reject(e);
11193
+ }
11194
+ };
11195
+ var buyNow = function buyNow() {
11196
+ try {
11197
+ var _temp2 = function () {
11198
+ if (validateData()) {
11199
+ var _refInputQuantity$cur3;
11200
+ var quantity = refInputQuantity === null || refInputQuantity === void 0 ? void 0 : (_refInputQuantity$cur3 = refInputQuantity.current) === null || _refInputQuantity$cur3 === void 0 ? void 0 : _refInputQuantity$cur3.getValue();
11201
+ return Promise.resolve(addProductToCart(product, variant, quantity)).then(function () {
11202
+ handleRedirect("/gio-hang");
11203
+ });
11204
+ }
11205
+ }();
11206
+ return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
11207
+ } catch (e) {
11208
+ return Promise.reject(e);
11209
+ }
11210
+ };
11211
+ var handleDisplayImage = function handleDisplayImage(item) {
11212
+ setDisplayImage(item);
11213
+ };
11214
+ return /*#__PURE__*/React__default.createElement("div", {
11215
+ className: SECTION_CLASS + " mt-6 md:mt-6 mb-0 " + ((shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode) === 'fashion_1' ? "bg-bgSecondary pb-8" : "bg-background")
11216
+ }, /*#__PURE__*/React__default.createElement("div", {
11217
+ className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-2 bg-bgSecondary"
11218
+ }, /*#__PURE__*/React__default.createElement("div", {
11219
+ className: "grid grid-cols-5 gap-6"
11220
+ }, /*#__PURE__*/React__default.createElement("div", {
11221
+ className: "hidden lg:block col-span-1 lg:min-h-[240px] lg:max-h-[400px] xl:min-h-[400px] xl:max-h-[480px] overflow-y-auto overflow-hidden no-scrollbar"
11222
+ }, (product === null || product === void 0 ? void 0 : (_product$images2 = product.images) === null || _product$images2 === void 0 ? void 0 : _product$images2.length) > 0 ? product === null || product === void 0 ? void 0 : (_product$images3 = product.images) === null || _product$images3 === void 0 ? void 0 : _product$images3.map(function (item) {
11223
+ return /*#__PURE__*/React__default.createElement("img", {
11224
+ src: item === null || item === void 0 ? void 0 : item.imageUrl,
11225
+ key: item === null || item === void 0 ? void 0 : item.imageId,
11226
+ alt: "",
11227
+ className: "cursor-pointer px-3 py-2 !h-24 !w-24 object-cover rounded-lg \n " + ((displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageId) === (item === null || item === void 0 ? void 0 : item.imageId) ? "border border-primary" : ""),
11228
+ onClick: function onClick() {
11229
+ handleDisplayImage(item);
11230
+ }
11231
+ });
11232
+ }) : /*#__PURE__*/React__default.createElement("div", {
11233
+ className: "p-2 border rounded-lg"
11234
+ }, /*#__PURE__*/React__default.createElement(SvgImageGallery, {
11235
+ width: "100%",
11236
+ height: "25%",
11237
+ fill: "#D9D9D9"
11238
+ }))), /*#__PURE__*/React__default.createElement("div", {
11239
+ className: "flex flex-col gap-4 col-span-5 lg:col-span-4 p-4 border border-stroke rounded-2xl"
11240
+ }, displayImage ? /*#__PURE__*/React__default.createElement("img", {
11241
+ src: displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageUrl,
11242
+ className: "w-full aspect-square object-contain rounded-2xl "
11243
+ }) : /*#__PURE__*/React__default.createElement("div", {
11244
+ className: "flex justify-center items-center rounded-2xl w-full aspect-square",
11245
+ style: {
11246
+ backgroundColor: "#FAFAFA"
11247
+ }
11248
+ }, /*#__PURE__*/React__default.createElement(SvgImageGallery, {
11249
+ width: "25%",
11250
+ height: "25%",
11251
+ fill: "#D9D9D9"
11252
+ }))), /*#__PURE__*/React__default.createElement("div", {
11253
+ className: " block lg:hidden w-full flex gap-4 col-span-5 overflow-x-auto overflow-hidden no-scrollbar"
11254
+ }, (product === null || product === void 0 ? void 0 : (_product$images4 = product.images) === null || _product$images4 === void 0 ? void 0 : _product$images4.length) > 0 ? product === null || product === void 0 ? void 0 : (_product$images5 = product.images) === null || _product$images5 === void 0 ? void 0 : _product$images5.map(function (item) {
11255
+ return /*#__PURE__*/React__default.createElement("img", {
11256
+ src: item === null || item === void 0 ? void 0 : item.imageUrl,
11257
+ key: item === null || item === void 0 ? void 0 : item.imageId,
11258
+ alt: "",
11259
+ className: "cursor-pointer px-2 py-1 !h-24 !w-24 object-cover rounded-lg \n " + ((displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageId) === (item === null || item === void 0 ? void 0 : item.imageId) ? "border border-primary" : ""),
11260
+ onClick: function onClick() {
11261
+ handleDisplayImage(item);
11262
+ }
11263
+ });
11264
+ }) : null)), /*#__PURE__*/React__default.createElement("div", {
11265
+ className: "mt-2 md:ms-10"
11266
+ }, /*#__PURE__*/React__default.createElement("p", {
11267
+ className: "font-semibold text-2xl"
11268
+ }, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
11269
+ product: product,
11270
+ variant: variant,
11271
+ className: "mt-4 md:mt-6 text-[22px]"
11272
+ }), options.map(function (option, index) {
11273
+ return /*#__PURE__*/React__default.createElement("div", {
11274
+ className: "flex gap-2 mt-4 md:mt-6",
11275
+ key: index
11276
+ }, /*#__PURE__*/React__default.createElement("div", {
11277
+ className: "min-w-24 my-auto"
11278
+ }, option === null || option === void 0 ? void 0 : option.name, ":"), /*#__PURE__*/React__default.createElement("div", {
11279
+ className: "flex gap-2"
11280
+ }, ((option === null || option === void 0 ? void 0 : option.value) || []).map(function (v, i) {
11281
+ return /*#__PURE__*/React__default.createElement("button", {
11282
+ key: i,
11283
+ onClick: function onClick() {
11284
+ return selectOption(index, i);
11285
+ },
11286
+ className: "rounded py-1 px-2 " + (i == option.valueIndex ? "bg-primary text-textButton" : "border bg-gray6")
11287
+ }, v);
11288
+ })));
11289
+ }), /*#__PURE__*/React__default.createElement(Input, {
11290
+ label: "Số lượng",
11291
+ wrapClassName: "flex items-center gap-6 mt-4 md:mt-6 ",
11292
+ rules: [{
11293
+ type: "required",
11294
+ message: "Bắt buộc nhập số lượng"
11295
+ }, {
11296
+ type: "pattern",
11297
+ pattern: numberPattern,
11298
+ message: "Số lượng không đúng"
11299
+ }],
11300
+ defaultValue: 1,
11301
+ isQuantity: true,
11302
+ min: 0,
11303
+ className: "bg-background",
11304
+ ref: refInputQuantity
11305
+ }), /*#__PURE__*/React__default.createElement("div", {
11306
+ className: "flex gap-4 mt-6"
11307
+ }, /*#__PURE__*/React__default.createElement(Button, {
11308
+ label: "THÊM VÀO GIỎ",
11309
+ shopConfigStyle: shopConfigStyle,
11310
+ type: "outline",
11311
+ onClick: function onClick() {
11312
+ return addToCart();
11313
+ }
11314
+ }), /*#__PURE__*/React__default.createElement(Button, {
11315
+ label: "MUA NGAY",
11316
+ shopConfigStyle: shopConfigStyle,
11317
+ onClick: function onClick() {
11318
+ return buyNow();
11319
+ }
11320
+ })))), /*#__PURE__*/React__default.createElement("div", {
11321
+ className: "grid grid-cols-1 lg:grid-cols-5 mt-8 lg:gap-8"
11322
+ }, /*#__PURE__*/React__default.createElement("div", {
11323
+ className: "lg:col-span-3 "
11324
+ }, /*#__PURE__*/React__default.createElement("h2", {
11325
+ className: "mb-8 font-semibold text-3xl"
11326
+ }, "M\xF4 t\u1EA3 s\u1EA3n ph\u1EA9m"), product !== null && product !== void 0 && product.description ? /*#__PURE__*/React__default.createElement("div", {
11327
+ className: "h-max relative p-2 p-6 pb-0 rounded-2xl bg-bgSecondary"
11328
+ }, /*#__PURE__*/React__default.createElement("div", {
11329
+ ref: descriptionRef,
11330
+ className: "" + (isSeeMore && !hiddenButton ? "h-full mb-4" : "max-h-[700px] overflow-hidden"),
11331
+ dangerouslySetInnerHTML: {
11332
+ __html: product === null || product === void 0 ? void 0 : product.description
11333
+ }
11334
+ }), !isSeeMore && !hiddenButton ? /*#__PURE__*/React__default.createElement("div", {
11335
+ className: "absolute bottom-0 rounded-b-2xl left-0 w-full h-24 bg-gradient-to-t from-black/40 to-transparent"
11336
+ }) : null, !hiddenButton ? /*#__PURE__*/React__default.createElement("div", {
11337
+ className: "w-full " + (!isSeeMore ? "absolute bottom-4" : "mt-2 pb-2") + " flex justify-center "
11338
+ }, /*#__PURE__*/React__default.createElement(Button, {
11339
+ label: isSeeMore ? /*#__PURE__*/React__default.createElement("div", {
11340
+ className: "flex items-center gap-2"
11341
+ }, "Thu nh\u1ECF ", /*#__PURE__*/React__default.createElement(fa6.FaMinus, null)) : /*#__PURE__*/React__default.createElement("div", {
11342
+ className: "flex items-center gap-2"
11343
+ }, "Xem th\xEAm ", /*#__PURE__*/React__default.createElement(fa6.FaPlus, null)),
11344
+ className: " bottom-0 z-50",
11345
+ onClick: function onClick() {
11346
+ setIsSeeMore(!isSeeMore);
11347
+ }
11348
+ })) : null) : /*#__PURE__*/React__default.createElement("div", {
11349
+ className: "text-lg text-gray3 rounded-lg p-2"
11350
+ }, "Kh\xF4ng c\xF3 th\xF4ng tin s\u1EA3n ph\u1EA9m")), (product === null || product === void 0 ? void 0 : (_product$attributes = product.attributes) === null || _product$attributes === void 0 ? void 0 : _product$attributes.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
11351
+ className: "lg:col-span-2"
11352
+ }, /*#__PURE__*/React__default.createElement("h2", {
11353
+ className: "text-3xl mb-8 font-semibold"
11354
+ }, "Th\xF4ng tin s\u1EA3n ph\u1EA9m"), /*#__PURE__*/React__default.createElement("div", {
11355
+ className: "bg-bgSecondary rounded-2xl py-2 px-2 md:px-6"
11356
+ }, product === null || product === void 0 ? void 0 : (_product$attributes2 = product.attributes) === null || _product$attributes2 === void 0 ? void 0 : _product$attributes2.map(function (item, index) {
11357
+ var _item$value;
11358
+ return /*#__PURE__*/React__default.createElement("div", {
11359
+ className: "p-4 flex gap-4 rounded-lg even:bg-background",
11360
+ key: "ptyh-" + index
11361
+ }, /*#__PURE__*/React__default.createElement("div", {
11362
+ className: "min-w-32 max-w-32 text-wrap"
11363
+ }, item === null || item === void 0 ? void 0 : item.name), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : (_item$value = item.value) === null || _item$value === void 0 ? void 0 : _item$value[0]));
11364
+ }))) : null));
11365
+ };
11366
+
10645
11367
  var Booking1 = function Booking1(props) {
10646
11368
  var _data$data, _data$data$, _data$data2, _data$data2$;
10647
11369
  var _props$shopConfigStyl = props.shopConfigStyle,
@@ -10696,7 +11418,7 @@ var BookingForm6 = function BookingForm6(props) {
10696
11418
  }), /*#__PURE__*/React__default.createElement("div", {
10697
11419
  className: "mt-12 grid grid-cols-1 gap-6 md:grid-cols-3 md:gap-12"
10698
11420
  }, /*#__PURE__*/React__default.createElement(LinkToPage, {
10699
- href: (data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$ = _data$data[0]) === null || _data$data$ === void 0 ? void 0 : _data$data$.route) || (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$.link) || "#"
11421
+ href: convertURL(data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$ = _data$data[0]) === null || _data$data$ === void 0 ? void 0 : _data$data$.route) || (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$.link) || "#"
10700
11422
  }, data !== null && data !== void 0 && (_data$data3 = data.data) !== null && _data$data3 !== void 0 && (_data$data3$ = _data$data3[0]) !== null && _data$data3$ !== void 0 && _data$data3$.svgImage ? /*#__PURE__*/React__default.createElement("div", {
10701
11423
  className: "text-primary w-full h-auto"
10702
11424
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -10814,7 +11536,7 @@ var Banner3 = function Banner3(props) {
10814
11536
  }, sectionData === null || sectionData === void 0 ? void 0 : sectionData.map(function (item, index) {
10815
11537
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
10816
11538
  Link: Link,
10817
- href: (item === null || item === void 0 ? void 0 : item.route) || (item === null || item === void 0 ? void 0 : item.link) || "#",
11539
+ href: convertURL(item === null || item === void 0 ? void 0 : item.route) || (item === null || item === void 0 ? void 0 : item.link) || "#",
10818
11540
  key: "djsd-" + index
10819
11541
  }, /*#__PURE__*/React__default.createElement("img", {
10820
11542
  src: item === null || item === void 0 ? void 0 : item.srcImage,
@@ -10970,11 +11692,12 @@ var Address1 = function Address1(props) {
10970
11692
  className: "sm:flex justify-between mt-3"
10971
11693
  }, /*#__PURE__*/React__default.createElement("small", null, "M\u1EDF c\u1EEDa 08:00-21:00"), /*#__PURE__*/React__default.createElement(LinkToPage, {
10972
11694
  Link: Link,
10973
- href: "#"
11695
+ href: "https://www.google.com/maps/search/?q=" + encodeURIComponent(item === null || item === void 0 ? void 0 : item.address),
11696
+ target: "_black"
10974
11697
  }, /*#__PURE__*/React__default.createElement("small", {
10975
11698
  className: "text-primary block"
10976
11699
  }, "Ch\u1EC9 \u0111\u01B0\u1EDDng ", /*#__PURE__*/React__default.createElement(fa.FaArrowRight, {
10977
- className: "inline-block\t text-primary"
11700
+ className: "inline-block text-primary"
10978
11701
  }), " "))));
10979
11702
  }))));
10980
11703
  };
@@ -10995,8 +11718,8 @@ var Links1 = function Links1(props) {
10995
11718
  }, [1, 2, 3].map(function (item, index) {
10996
11719
  return /*#__PURE__*/React__default.createElement("div", {
10997
11720
  key: "qwikf-" + index + " "
10998
- }, /*#__PURE__*/React__default.createElement("h4", {
10999
- className: "text-lg md:text-xl lg:text-2xl font-semibold mb-4"
11721
+ }, /*#__PURE__*/React__default.createElement("h3", {
11722
+ className: "text-lg md:text-2xl font-semibold mb-4"
11000
11723
  }, "\u0110a d\u1EA1ng thanh to\xE1n"), /*#__PURE__*/React__default.createElement("div", {
11001
11724
  className: "leading-10 flex flex-col bg-background2 p-4 rounded-xl bg-bgSecondary "
11002
11725
  }, /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement(fa6.FaArrowsRotate, {
@@ -11031,7 +11754,7 @@ var Footer1 = function Footer1(props) {
11031
11754
  var genShopAddress = function genShopAddress() {
11032
11755
  try {
11033
11756
  var addressJson = JSON.parse(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopAddress);
11034
- if (addressJson) {
11757
+ if (Array.isArray(addressJson) && addressJson && (addressJson === null || addressJson === void 0 ? void 0 : addressJson.length) > 0) {
11035
11758
  setShopAddressList(addressJson);
11036
11759
  } else {
11037
11760
  setShopAddressList([{
@@ -11055,7 +11778,7 @@ var Footer1 = function Footer1(props) {
11055
11778
  }, /*#__PURE__*/React__default.createElement("img", {
11056
11779
  className: "object-cover w-16 h-16",
11057
11780
  src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
11058
- alt: ""
11781
+ alt: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName
11059
11782
  }), /*#__PURE__*/React__default.createElement("h3", {
11060
11783
  className: " text-2xl md:text-3xl font-semibold ms-2",
11061
11784
  style: {
@@ -11067,10 +11790,10 @@ var Footer1 = function Footer1(props) {
11067
11790
  className: " col-span-2 flex flex-col mb-10 leading-8 sm:mb-0 "
11068
11791
  }, /*#__PURE__*/React__default.createElement("div", {
11069
11792
  className: "mb-3 font-semibold text-md md:text-lg"
11070
- }, "Th\xF4ng tin li\xEAn h\u1EC7"), shopAddressList === null || shopAddressList === void 0 ? void 0 : shopAddressList.map(function (item, index) {
11793
+ }, "Th\xF4ng tin li\xEAn h\u1EC7"), Array.isArray(shopAddressList) ? shopAddressList === null || shopAddressList === void 0 ? void 0 : shopAddressList.map(function (item, index) {
11071
11794
  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", {
11072
- className: "flex gap-1 items-center"
11073
- }, /*#__PURE__*/React__default.createElement(io5.IoLocationOutline, {
11795
+ className: "flex gap-2 items-center"
11796
+ }, /*#__PURE__*/React__default.createElement(hi.HiOutlineLocationMarker, {
11074
11797
  size: 24,
11075
11798
  className: "inline-block",
11076
11799
  style: {
@@ -11078,14 +11801,14 @@ var Footer1 = function Footer1(props) {
11078
11801
  }
11079
11802
  }), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.address)), /*#__PURE__*/React__default.createElement("div", {
11080
11803
  className: "flex gap-2 items-center"
11081
- }, /*#__PURE__*/React__default.createElement(io5.IoCallOutline, {
11804
+ }, /*#__PURE__*/React__default.createElement(ai.AiOutlinePhone, {
11082
11805
  size: 24,
11083
11806
  className: "inline-block",
11084
11807
  style: {
11085
11808
  color: primary
11086
11809
  }
11087
11810
  }), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.phone)));
11088
- })), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
11811
+ }) : null), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
11089
11812
  className: "mb-3 font-semibold text-lg"
11090
11813
  }, "Li\xEAn k\u1EBFt"), /*#__PURE__*/React__default.createElement("div", {
11091
11814
  className: "leading-10 flex flex-col "
@@ -11094,7 +11817,7 @@ var Footer1 = function Footer1(props) {
11094
11817
  })) === null || _shopConfigStyle$navB2 === void 0 ? void 0 : _shopConfigStyle$navB2.map(function (route, index) {
11095
11818
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
11096
11819
  Link: Link,
11097
- href: (route === null || route === void 0 ? void 0 : route.route) || "#",
11820
+ href: convertURL(route === null || route === void 0 ? void 0 : route.route) || "#",
11098
11821
  key: "dfjg-" + index
11099
11822
  }, /*#__PURE__*/React__default.createElement("div", null, route === null || route === void 0 ? void 0 : route.label));
11100
11823
  }))), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
@@ -11102,7 +11825,8 @@ var Footer1 = function Footer1(props) {
11102
11825
  }, "H\u1ED7 tr\u1EE3"), /*#__PURE__*/React__default.createElement("div", {
11103
11826
  className: "flex justify-start items-center gap-4"
11104
11827
  }, /*#__PURE__*/React__default.createElement("a", {
11105
- href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopFacebookPage) || "#"
11828
+ href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopFacebookPage) || "#",
11829
+ target: shopConfig !== null && shopConfig !== void 0 && shopConfig.shopFacebookPage ? "_blank" : "_self"
11106
11830
  }, /*#__PURE__*/React__default.createElement(fa.FaFacebookF, {
11107
11831
  size: 40,
11108
11832
  color: textButton,
@@ -11111,7 +11835,8 @@ var Footer1 = function Footer1(props) {
11111
11835
  background: primary
11112
11836
  }
11113
11837
  })), /*#__PURE__*/React__default.createElement("a", {
11114
- href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopMessenger) || "#"
11838
+ href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopMessenger) || "#",
11839
+ target: shopConfig !== null && shopConfig !== void 0 && shopConfig.shopMessenger ? "_blank" : "_self"
11115
11840
  }, /*#__PURE__*/React__default.createElement(fa.FaFacebookMessenger, {
11116
11841
  size: 40,
11117
11842
  color: textButton,
@@ -11120,7 +11845,8 @@ var Footer1 = function Footer1(props) {
11120
11845
  background: primary
11121
11846
  }
11122
11847
  })), /*#__PURE__*/React__default.createElement("a", {
11123
- href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopZalo) || "#"
11848
+ href: "https://zalo.me/" + (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopZalo) || "#",
11849
+ target: "_blank"
11124
11850
  }, /*#__PURE__*/React__default.createElement(si.SiZalo, {
11125
11851
  size: 40,
11126
11852
  color: textButton,
@@ -11133,7 +11859,8 @@ var Footer1 = function Footer1(props) {
11133
11859
  }, /*#__PURE__*/React__default.createElement("small", {
11134
11860
  className: "me-5"
11135
11861
  }, "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", {
11136
- href: "#"
11862
+ href: linkPagePolicy,
11863
+ target: "_blank"
11137
11864
  }, /*#__PURE__*/React__default.createElement("small", {
11138
11865
  className: "underline decoration-solid",
11139
11866
  style: {
@@ -11167,7 +11894,7 @@ var Footer7 = function Footer7(props) {
11167
11894
  var genShopAddress = function genShopAddress() {
11168
11895
  try {
11169
11896
  var addressJson = JSON.parse(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopAddress);
11170
- if (addressJson) {
11897
+ if (Array.isArray(addressJson) && addressJson && (addressJson === null || addressJson === void 0 ? void 0 : addressJson.length) > 0) {
11171
11898
  setShopAddressList(addressJson);
11172
11899
  } else {
11173
11900
  setShopAddressList([{
@@ -11195,7 +11922,7 @@ var Footer7 = function Footer7(props) {
11195
11922
  }, /*#__PURE__*/React__default.createElement("img", {
11196
11923
  className: "object-cover w-14",
11197
11924
  src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
11198
- alt: ""
11925
+ alt: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName
11199
11926
  }), /*#__PURE__*/React__default.createElement("h3", {
11200
11927
  className: " text-2xl md:text-3xl font-semibold ms-2",
11201
11928
  style: {
@@ -11211,16 +11938,16 @@ var Footer7 = function Footer7(props) {
11211
11938
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
11212
11939
  key: "dlkhg-" + index
11213
11940
  }, /*#__PURE__*/React__default.createElement("div", null, "C\u01A1 s\u1EDF ", index + 1), /*#__PURE__*/React__default.createElement("div", {
11214
- className: "flex gap-1"
11215
- }, /*#__PURE__*/React__default.createElement(io5.IoLocationOutline, {
11941
+ className: "flex gap-2"
11942
+ }, /*#__PURE__*/React__default.createElement(hi.HiOutlineLocationMarker, {
11216
11943
  size: 24,
11217
11944
  className: "inline-block mt-1",
11218
11945
  style: {
11219
11946
  color: primary
11220
11947
  }
11221
11948
  }), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.address)), /*#__PURE__*/React__default.createElement("div", {
11222
- className: "flex gap-1"
11223
- }, /*#__PURE__*/React__default.createElement(io5.IoCallOutline, {
11949
+ className: "flex gap-2"
11950
+ }, /*#__PURE__*/React__default.createElement(ai.AiOutlinePhone, {
11224
11951
  size: 24,
11225
11952
  className: "inline-block mt-1",
11226
11953
  style: {
@@ -11235,7 +11962,7 @@ var Footer7 = function Footer7(props) {
11235
11962
  return e === null || e === void 0 ? void 0 : e.isShow;
11236
11963
  })) === null || _shopConfigStyle$navB2 === void 0 ? void 0 : _shopConfigStyle$navB2.map(function (route, index) {
11237
11964
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
11238
- href: (route === null || route === void 0 ? void 0 : route.route) || "#",
11965
+ href: convertURL(route === null || route === void 0 ? void 0 : route.route) || "#",
11239
11966
  Link: Link,
11240
11967
  key: "fiddf-" + index
11241
11968
  }, /*#__PURE__*/React__default.createElement("div", null, route === null || route === void 0 ? void 0 : route.label));
@@ -11244,7 +11971,8 @@ var Footer7 = function Footer7(props) {
11244
11971
  }, "H\u1ED7 tr\u1EE3"), /*#__PURE__*/React__default.createElement("div", {
11245
11972
  className: "flex justify-start items-center gap-4"
11246
11973
  }, /*#__PURE__*/React__default.createElement("a", {
11247
- href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopFacebookPage) || "#"
11974
+ href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopFacebookPage) || "#",
11975
+ target: shopConfig !== null && shopConfig !== void 0 && shopConfig.shopFacebookPage ? "_blank" : "_self"
11248
11976
  }, /*#__PURE__*/React__default.createElement(fa.FaFacebookF, {
11249
11977
  size: 40,
11250
11978
  color: textButton,
@@ -11253,7 +11981,8 @@ var Footer7 = function Footer7(props) {
11253
11981
  background: primary
11254
11982
  }
11255
11983
  })), /*#__PURE__*/React__default.createElement("a", {
11256
- href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopMessenger) || "#"
11984
+ href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopMessenger) || "#",
11985
+ target: shopConfig !== null && shopConfig !== void 0 && shopConfig.shopMessenger ? "_blank" : "_self"
11257
11986
  }, /*#__PURE__*/React__default.createElement(fa.FaFacebookMessenger, {
11258
11987
  size: 40,
11259
11988
  color: textButton,
@@ -11262,7 +11991,8 @@ var Footer7 = function Footer7(props) {
11262
11991
  background: primary
11263
11992
  }
11264
11993
  })), /*#__PURE__*/React__default.createElement("a", {
11265
- href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopZalo) || "#"
11994
+ href: "https://zalo.me/" + (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopZalo) || "#",
11995
+ target: "_blank"
11266
11996
  }, /*#__PURE__*/React__default.createElement(si.SiZalo, {
11267
11997
  size: 40,
11268
11998
  color: textButton,
@@ -11275,7 +12005,8 @@ var Footer7 = function Footer7(props) {
11275
12005
  }, /*#__PURE__*/React__default.createElement("small", {
11276
12006
  className: "me-5"
11277
12007
  }, "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", {
11278
- href: "#"
12008
+ href: linkPagePolicy,
12009
+ target: "_blank"
11279
12010
  }, /*#__PURE__*/React__default.createElement("small", {
11280
12011
  className: "underline decoration-solid",
11281
12012
  style: {
@@ -11412,7 +12143,7 @@ var CustomerRating6 = function CustomerRating6(props) {
11412
12143
  _props$SectionTitle = props.SectionTitle,
11413
12144
  SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
11414
12145
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
11415
- className: SECTION_CLASS + " !my-0 py-12 bg-bgSecondary"
12146
+ className: SECTION_CLASS + " !my-0 py-12 bg-"
11416
12147
  }, /*#__PURE__*/React__default.createElement(SectionTitle, {
11417
12148
  data: data,
11418
12149
  shopConfigStyle: shopConfigStyle
@@ -11422,9 +12153,9 @@ var CustomerRating6 = function CustomerRating6(props) {
11422
12153
  return /*#__PURE__*/React__default.createElement("div", {
11423
12154
  key: index,
11424
12155
  className: "relative bg-primary rounded-lg text-textButton px-6 py-4"
11425
- }, /*#__PURE__*/React__default.createElement(io.IoMdQuote, {
11426
- size: 30,
11427
- className: "absolute text-textButton top-[-15px] right-8"
12156
+ }, /*#__PURE__*/React__default.createElement(md.MdOutlineFormatQuote, {
12157
+ size: 43,
12158
+ className: "absolute text-black top-[-20px] right-8"
11428
12159
  }), /*#__PURE__*/React__default.createElement("div", {
11429
12160
  className: "flex items-end gap-2"
11430
12161
  }, /*#__PURE__*/React__default.createElement("img", {
@@ -11562,7 +12293,7 @@ var PageTitle1 = function PageTitle1(props) {
11562
12293
  className: "absolute top-0 w-full h-full bg-black opacity-40 z-0"
11563
12294
  }), /*#__PURE__*/React__default.createElement("div", {
11564
12295
  className: "relative w-full p-20 z-10 flex flex-col gap-6 items-center justify-center"
11565
- }, /*#__PURE__*/React__default.createElement("div", {
12296
+ }, /*#__PURE__*/React__default.createElement("h2", {
11566
12297
  className: "text-3xl md:text-5xl text-white leading-[1.6] md:leading-[1.6] text-center font-headingFont"
11567
12298
  }, sectionData !== null && sectionData !== void 0 && sectionData.sectionTitle ? sectionData === null || sectionData === void 0 ? void 0 : sectionData.sectionTitle : route === null || route === void 0 ? void 0 : route.label)));
11568
12299
  };
@@ -11577,6 +12308,7 @@ var About1 = function About1(props) {
11577
12308
  }, data === null || data === void 0 ? void 0 : data.sectionTitle) : null, data !== null && data !== void 0 && data.sectionDescription ? /*#__PURE__*/React__default.createElement("div", {
11578
12309
  className: "text-xl"
11579
12310
  }, data === null || data === void 0 ? void 0 : data.sectionDescription) : null, /*#__PURE__*/React__default.createElement("div", {
12311
+ className: "text-wrap",
11580
12312
  dangerouslySetInnerHTML: {
11581
12313
  __html: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopAbout
11582
12314
  }
@@ -11595,7 +12327,7 @@ var About5 = function About5(props) {
11595
12327
  src: sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$ = sectionData[0]) === null || _sectionData$ === void 0 ? void 0 : _sectionData$.srcImage,
11596
12328
  className: "w-full hidden lg:block rounded-xl"
11597
12329
  }), /*#__PURE__*/React__default.createElement("div", {
11598
- className: "ck-content",
12330
+ className: "ck-content text-wrap",
11599
12331
  dangerouslySetInnerHTML: {
11600
12332
  __html: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopAbout
11601
12333
  }
@@ -11605,6 +12337,32 @@ var About5 = function About5(props) {
11605
12337
  }));
11606
12338
  };
11607
12339
 
12340
+ var About6 = function About6(props) {
12341
+ var _sectionData$, _sectionData$2;
12342
+ var shopConfig = props.shopConfig,
12343
+ data = props.data;
12344
+ var sectionData = data === null || data === void 0 ? void 0 : data.data;
12345
+ console.log("About5 sectionData", sectionData);
12346
+ return /*#__PURE__*/React__default.createElement("div", {
12347
+ className: SECTION_DEFAULT_CLASS + " mt-0"
12348
+ }, /*#__PURE__*/React__default.createElement("h2", {
12349
+ className: "text-2xl md:text-4xl text-textHeading font-semibold mb-6 lg:mb-8"
12350
+ }, data === null || data === void 0 ? void 0 : data.sectionTitle) , /*#__PURE__*/React__default.createElement("div", {
12351
+ className: "grid grid-cols-1 lg:grid-cols-5 gap-6 lg:gap-10"
12352
+ }, /*#__PURE__*/React__default.createElement("img", {
12353
+ src: sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$ = sectionData[0]) === null || _sectionData$ === void 0 ? void 0 : _sectionData$.srcImage,
12354
+ className: "w-full h-auto object-cover lg:hidden block rounded-xl"
12355
+ }), /*#__PURE__*/React__default.createElement("div", {
12356
+ className: "ck-content text-wrap lg:col-span-3 bg-bgSecondary p-4 lg:p-6 rounded-2xl",
12357
+ dangerouslySetInnerHTML: {
12358
+ __html: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopAbout
12359
+ }
12360
+ }), /*#__PURE__*/React__default.createElement("img", {
12361
+ src: sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$2 = sectionData[0]) === null || _sectionData$2 === void 0 ? void 0 : _sectionData$2.srcImage,
12362
+ className: "w-full h-auto object-cover lg:col-span-2 lg:block hidden rounded-xl"
12363
+ })));
12364
+ };
12365
+
11608
12366
  var Contact1 = function Contact1(props) {
11609
12367
  var _sectionData$;
11610
12368
  var shopConfigStyle = props.shopConfigStyle,
@@ -11622,7 +12380,7 @@ var Contact1 = function Contact1(props) {
11622
12380
  className: "grid grid-cols-1 lg:grid-cols-2 gap-12 mt-6"
11623
12381
  }, /*#__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", {
11624
12382
  className: "flex items-center gap-2 rounded-lg overflow-hidden bg-white mt-6"
11625
- }, /*#__PURE__*/React__default.createElement(fa.FaFacebookF, {
12383
+ }, /*#__PURE__*/React__default.createElement(fa.FaPhoneAlt, {
11626
12384
  size: 40,
11627
12385
  className: "p-2 text-textButton bg-primary"
11628
12386
  }), /*#__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", {
@@ -11668,11 +12426,12 @@ var Breadcrumb1 = function Breadcrumb1(props) {
11668
12426
  return e === null || e === void 0 ? void 0 : e.length;
11669
12427
  })) === null || _route$route$split$fi === void 0 ? void 0 : _route$route$split$fi.slice(0, 2);
11670
12428
  items = (_items = items) === null || _items === void 0 ? void 0 : _items.map(function (e) {
12429
+ var _e, _e$replace, _e$replace$replace, _e$replace$replace$re;
11671
12430
  if (e === "product") e = "products";else if (e === "service") e = "services";
11672
12431
  return (routes === null || routes === void 0 ? void 0 : routes.find(function (r) {
11673
12432
  return (r === null || r === void 0 ? void 0 : r.name) === e;
11674
12433
  })) || {
11675
- label: e
12434
+ label: (_e = e) === null || _e === void 0 ? void 0 : (_e$replace = _e.replace(/-{3}/g, "###")) === null || _e$replace === void 0 ? void 0 : (_e$replace$replace = _e$replace.replace(/-/g, " ")) === null || _e$replace$replace === void 0 ? void 0 : (_e$replace$replace$re = _e$replace$replace.replace(/###/g, "-")) === null || _e$replace$replace$re === void 0 ? void 0 : _e$replace$replace$re.replace(/~/g, "/")
11676
12435
  };
11677
12436
  });
11678
12437
  (_items2 = items) === null || _items2 === void 0 ? void 0 : _items2.unshift({
@@ -11693,7 +12452,7 @@ var Breadcrumb1 = function Breadcrumb1(props) {
11693
12452
  className: "text-gray4"
11694
12453
  }, "/") : null, item !== null && item !== void 0 && item.route ? /*#__PURE__*/React__default.createElement(LinkToPage, {
11695
12454
  Link: Link,
11696
- href: (item === null || item === void 0 ? void 0 : item.route) || "#",
12455
+ href: convertURL(item === null || item === void 0 ? void 0 : item.route) || "#",
11697
12456
  style: {
11698
12457
  color: textHeading
11699
12458
  }
@@ -12810,7 +13569,7 @@ var ShopHighlights2 = function ShopHighlights2(props) {
12810
13569
  }, sectionData === null || sectionData === void 0 ? void 0 : sectionData.map(function (item, index) {
12811
13570
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
12812
13571
  Link: Link,
12813
- href: (item === null || item === void 0 ? void 0 : item.route) || (item === null || item === void 0 ? void 0 : item.link) || "#"
13572
+ href: convertURL(item === null || item === void 0 ? void 0 : item.route) || (item === null || item === void 0 ? void 0 : item.link) || "#"
12814
13573
  }, /*#__PURE__*/React__default.createElement("div", {
12815
13574
  className: "flex flex-col items-center text-center lg:px-3 gap-3",
12816
13575
  key: "kdf-" + index
@@ -12838,7 +13597,7 @@ var ShopHighlights5 = function ShopHighlights5(props) {
12838
13597
  className: SECTION_CLASS + " grid md:grid-cols-3 py-6 gap-4 lg:gap-6 bg-bgSecondary"
12839
13598
  }, sectionData === null || sectionData === void 0 ? void 0 : sectionData.map(function (item, index) {
12840
13599
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
12841
- href: (item === null || item === void 0 ? void 0 : item.route) || (item === null || item === void 0 ? void 0 : item.link) || "#",
13600
+ href: convertURL(item === null || item === void 0 ? void 0 : item.route) || (item === null || item === void 0 ? void 0 : item.link) || "#",
12842
13601
  Link: Link
12843
13602
  }, /*#__PURE__*/React__default.createElement("div", {
12844
13603
  className: "flex flex-col items-center text-center md:px-3 lg:px-6 gap-3",
@@ -12884,7 +13643,7 @@ var ShopHighlights6 = function ShopHighlights6(props) {
12884
13643
  className: " w-44 h-0.5 rounded-full bg-primary"
12885
13644
  }), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.description), /*#__PURE__*/React__default.createElement(LinkToPage, {
12886
13645
  Link: Link,
12887
- href: (item === null || item === void 0 ? void 0 : item.route) || (item === null || item === void 0 ? void 0 : item.link) || "#"
13646
+ href: convertURL(item === null || item === void 0 ? void 0 : item.route) || (item === null || item === void 0 ? void 0 : item.link) || "#"
12888
13647
  }, /*#__PURE__*/React__default.createElement(Button, {
12889
13648
  shopConfigStyle: shopConfigStyle,
12890
13649
  label: item === null || item === void 0 ? void 0 : item.title
@@ -12914,7 +13673,7 @@ var ShopHighlights7 = function ShopHighlights7(props) {
12914
13673
  }, data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.map(function (it, index) {
12915
13674
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
12916
13675
  Link: Link,
12917
- href: (it === null || it === void 0 ? void 0 : it.route) || (it === null || it === void 0 ? void 0 : it.link) || "#",
13676
+ href: convertURL(it === null || it === void 0 ? void 0 : it.route) || (it === null || it === void 0 ? void 0 : it.link) || "#",
12918
13677
  key: index,
12919
13678
  className: "pt-6 col-span-3 md:col-span-1"
12920
13679
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -13033,6 +13792,11 @@ var NewsController = function NewsController(props) {
13033
13792
  var _response$data2, _response$data2$data, _response$data3, _response$data3$data;
13034
13793
  setNewsArticles(response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : (_response$data2$data = _response$data2.data) === null || _response$data2$data === void 0 ? void 0 : _response$data2$data.content);
13035
13794
  setPage(response === null || response === void 0 ? void 0 : (_response$data3 = response.data) === null || _response$data3 === void 0 ? void 0 : (_response$data3$data = _response$data3.data) === null || _response$data3$data === void 0 ? void 0 : _response$data3$data.totalElements);
13795
+ var url = new URL(window.location.href);
13796
+ if (/^(\/(tin-tuc-theo-danh-muc))\/[^/]+-\d+$/.test(url.pathname)) {
13797
+ url.pathname = url.pathname.replace(/\/[^/]+-\d+$/, "");
13798
+ window.history.replaceState({}, '', url.pathname + url.search);
13799
+ }
13036
13800
  }
13037
13801
  setLoading(false);
13038
13802
  });
@@ -13228,13 +13992,12 @@ var News1 = function News1(props) {
13228
13992
  shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
13229
13993
  _props$Link = props.Link,
13230
13994
  Link = _props$Link === void 0 ? null : _props$Link,
13231
- _props$catId = props.catId,
13232
- catId = _props$catId === void 0 ? "" : _props$catId;
13995
+ catId = props.catId;
13233
13996
  var _useState = React.useState({
13234
13997
  page: 0,
13235
13998
  sort: "timeUpdate,DESC",
13236
- size: 10,
13237
- catId: catId
13999
+ catId: catId,
14000
+ size: 10
13238
14001
  }),
13239
14002
  params = _useState[0],
13240
14003
  setParams = _useState[1];
@@ -13264,11 +14027,11 @@ var News1 = function News1(props) {
13264
14027
  React.useEffect(function () {
13265
14028
  if ((newsCategories === null || newsCategories === void 0 ? void 0 : newsCategories.length) > 0 && params !== null && params !== void 0 && params.catId) {
13266
14029
  var category = newsCategories === null || newsCategories === void 0 ? void 0 : newsCategories.find(function (item) {
13267
- return (item === null || item === void 0 ? void 0 : item.catId) == catId;
14030
+ return (item === null || item === void 0 ? void 0 : item.catId) == (params === null || params === void 0 ? void 0 : params.catId);
13268
14031
  });
13269
14032
  setCategorySelected(category);
13270
14033
  }
13271
- }, [params === null || params === void 0 ? void 0 : params.catId, newsCategories]);
14034
+ }, [newsCategories]);
13272
14035
  return /*#__PURE__*/React__default.createElement("div", {
13273
14036
  className: SECTION_CLASS + " grid grid-cols-1 md:grid-cols-3 gap-6"
13274
14037
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -13313,18 +14076,29 @@ var News1 = function News1(props) {
13313
14076
  }) : null)), /*#__PURE__*/React__default.createElement("div", {
13314
14077
  className: "sticky top-20 self-start"
13315
14078
  }, /*#__PURE__*/React__default.createElement("div", {
13316
- className: "px-6 py-3 bg-primary rounded-t-lg text-lg text-textButton text-center"
14079
+ className: "px-6 py-3 bg-primary rounded-t-lg text-lg text-textButton text-center ",
14080
+ onClick: function onClick() {
14081
+ setParams({
14082
+ page: 0,
14083
+ sort: "timeUpdate,DESC",
14084
+ size: 10
14085
+ });
14086
+ }
13317
14087
  }, "Chuy\xEAn m\u1EE5c"), /*#__PURE__*/React__default.createElement("div", {
13318
14088
  className: "rounded-b-lg bg-bgSecondary"
13319
14089
  }, newsCategories === null || newsCategories === void 0 ? void 0 : newsCategories.map(function (item, index) {
13320
- return /*#__PURE__*/React__default.createElement(LinkToPage, {
13321
- href: getLinkNewsByCategory(item),
13322
- Link: Link,
13323
- key: "fjhnfg-" + index
13324
- }, /*#__PURE__*/React__default.createElement("div", {
14090
+ return /*#__PURE__*/React__default.createElement("div", {
13325
14091
  className: "px-6 py-3 hover:bg-gray-100 hover:text-primary cursor-pointer",
13326
- key: "sdjfdh-" + index
13327
- }, item === null || item === void 0 ? void 0 : item.catName));
14092
+ key: "sdjfdh-" + index,
14093
+ onClick: function onClick() {
14094
+ setCategorySelected(item);
14095
+ setParams(function (prev) {
14096
+ return _extends({}, prev, {
14097
+ catId: item === null || item === void 0 ? void 0 : item.catId
14098
+ });
14099
+ });
14100
+ }
14101
+ }, item === null || item === void 0 ? void 0 : item.catName);
13328
14102
  }))));
13329
14103
  };
13330
14104
 
@@ -13452,6 +14226,7 @@ var NewsDetail1 = function NewsDetail1(props) {
13452
14226
 
13453
14227
  exports.About1 = About1;
13454
14228
  exports.About5 = About5;
14229
+ exports.About6 = About6;
13455
14230
  exports.Address1 = Address1;
13456
14231
  exports.Banner1 = Banner1;
13457
14232
  exports.Banner2 = Banner2;
@@ -13496,9 +14271,11 @@ exports.PageTitle1 = PageTitle1;
13496
14271
  exports.Partner1 = Partner1;
13497
14272
  exports.ProductCategory2 = ProductCategory2;
13498
14273
  exports.ProductDetail10 = ProductDetail10;
14274
+ exports.ProductDetail11 = ProductDetail11;
13499
14275
  exports.ProductHighlight1 = ProductHighlight1;
13500
14276
  exports.ProductHot1 = ProductHot1;
13501
14277
  exports.ProductHot3 = ProductHot3;
14278
+ exports.ProductImage = ProductImage;
13502
14279
  exports.ProductItem2 = ProductItem2;
13503
14280
  exports.ProductItem3 = ProductItem3;
13504
14281
  exports.ProductItem4 = ProductItem4;
@@ -13510,8 +14287,10 @@ exports.ProductList7 = ProductList7;
13510
14287
  exports.ProductSale2 = ProductSale2;
13511
14288
  exports.ProductSearch1 = ProductSearch1;
13512
14289
  exports.Products10 = Products10;
14290
+ exports.Products11 = Products11;
13513
14291
  exports.Products2 = Products2;
13514
14292
  exports.Products3 = Products3;
14293
+ exports.Products9 = Products9;
13515
14294
  exports.ProductsTop1 = ProductsTop1;
13516
14295
  exports.SearchBar2 = SearchBar2;
13517
14296
  exports.SearchBar5 = SearchBar5;