s-platform-landing-section 0.1.10-alpha.9 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,17 +1,18 @@
1
- import React__default, { useState, useRef, useEffect, createElement, forwardRef, useImperativeHandle, memo, useCallback } from 'react';
2
- import { IoCartOutline, IoChevronDownOutline, IoInformationCircleOutline, IoLogOutOutline, IoLocationOutline, IoChevronBackOutline, IoChevronForwardOutline, IoCallOutline } from 'react-icons/io5';
3
- import { FaUserCircle, FaPhone, FaChevronLeft, FaChevronRight, FaAngleUp, FaAngleDown, FaCheckCircle, FaArrowLeft, FaArrowRight as FaArrowRight$1, FaFacebookSquare, FaFacebookMessenger, FaFacebookF } from 'react-icons/fa';
4
- import { FiMenu } from 'react-icons/fi';
1
+ import React__default, { useState, useRef, useEffect, forwardRef, useImperativeHandle, createElement, memo } from 'react';
2
+ import { IoCartOutline, IoChevronDownOutline, IoInformationCircleOutline, IoLogOutOutline, IoBagOutline, IoSearchOutline, IoChevronBackOutline, IoChevronForwardOutline, IoLocationOutline, IoCallOutline } from 'react-icons/io5';
3
+ import { FaUserCircle, FaFacebookF, FaFacebookMessenger, FaAngleUp, FaAngleDown, FaCheckCircle, FaBoxOpen, FaArrowLeft, FaArrowRight } from 'react-icons/fa';
4
+ import { FiMenu, FiShoppingCart, FiSearch } from 'react-icons/fi';
5
5
  import { RxCross2 } from 'react-icons/rx';
6
- import { PiHandbagSimpleLight } from 'react-icons/pi';
7
- import { CiSearch } from 'react-icons/ci';
8
- import { BsFilterLeft, BsCurrencyDollar } from 'react-icons/bs';
9
- import { FaMinus, FaPlus, FaArrowsRotate, FaStar, FaRegStarHalfStroke, FaRegStar } from 'react-icons/fa6';
6
+ import { SiZalo, SiVisa } from 'react-icons/si';
7
+ import { IoIosStar, IoIosArrowBack, IoIosArrowForward, IoMdCheckmark, IoIosHeartEmpty, IoMdQuote } from 'react-icons/io';
8
+ import { FaMinus, FaRegEyeSlash, FaPlus, FaArrowsRotate, FaStar, FaRegStarHalfStroke, FaRegStar } from 'react-icons/fa6';
9
+ import 'react-icons/pi';
10
+ import 'react-icons/ci';
11
+ import { BsCurrencyDollar } from 'react-icons/bs';
10
12
  import { LuSearch } from 'react-icons/lu';
11
- import { IoMdCheckmark, IoIosHeartEmpty } from 'react-icons/io';
12
13
  import DatePicker from 'react-datepicker';
13
14
  import 'react-datepicker/dist/react-datepicker.css';
14
- import { SiVisa, SiZalo } from 'react-icons/si';
15
+ import { AiOutlineShoppingCart } from 'react-icons/ai';
15
16
  import { GoCreditCard } from 'react-icons/go';
16
17
  import { RiDeleteBin7Line } from 'react-icons/ri';
17
18
 
@@ -28,8 +29,8 @@ var Button = function Button(props) {
28
29
  onClick = _props$onClick === void 0 ? function () {} : _props$onClick,
29
30
  _props$type = props.type,
30
31
  type = _props$type === void 0 ? "primary" : _props$type;
31
- var _className = type === "primary" ? "text-textButton bg-primary" : "text-primary bg-transparent border border-primary";
32
- _className = "font-medium rounded-lg text-sm px-4 py-2.5 hover:text-textButton hover:bg-primary hover:opacity-80 " + _className + " " + ((shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.buttonClass) || "") + " " + className;
32
+ var _className = type === "primary" ? "text-textButton bg-primary" : "text-primary border border-primary";
33
+ _className = "font-medium rounded-lg text-sm px-3 py-2 md:px-4 md:py-2.5 hover:text-textButton hover:bg-primary hover:opacity-80 " + _className + " " + ((shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.buttonClass) || "") + " " + className;
33
34
  return /*#__PURE__*/React__default.createElement("button", {
34
35
  type: "button",
35
36
  className: _className,
@@ -91,7 +92,7 @@ function _unsupportedIterableToArray(r, a) {
91
92
 
92
93
  var _excluded = ["Link"];
93
94
  var getDurationValue = function getDurationValue(attributes) {
94
- var _durationAtt$value, _durationAtt$unit;
95
+ var _durationAtt$value;
95
96
  if (!attributes) {
96
97
  return "";
97
98
  }
@@ -99,12 +100,12 @@ var getDurationValue = function getDurationValue(attributes) {
99
100
  attributes = JSON.parse(attributes || "[]");
100
101
  }
101
102
  var durationAtt = attributes.find(function (attr) {
102
- return attr.name === "Thời lượng (phút) / buổi";
103
+ return (attr === null || attr === void 0 ? void 0 : attr.name) === "Thời lượng (phút) / buổi";
103
104
  });
104
- return durationAtt ? ((durationAtt === null || durationAtt === void 0 ? void 0 : (_durationAtt$value = durationAtt.value) === null || _durationAtt$value === void 0 ? void 0 : _durationAtt$value[0]) || "0") + " " + ((durationAtt === null || durationAtt === void 0 ? void 0 : (_durationAtt$unit = durationAtt.unit) === null || _durationAtt$unit === void 0 ? void 0 : _durationAtt$unit[0]) || "") : "";
105
+ 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" : "";
105
106
  };
106
107
  var genProductSlug = function genProductSlug(productName, id) {
107
- var slug = productName.toLowerCase();
108
+ var slug = productName === null || productName === void 0 ? void 0 : productName.toLowerCase();
108
109
  slug = slug.replace(/(à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ)/g, "a");
109
110
  slug = slug.replace(/(è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ)/g, "e");
110
111
  slug = slug.replace(/(ì|í|ị|ỉ|ĩ)/g, "i");
@@ -122,12 +123,24 @@ var getLinkProductDetail = function getLinkProductDetail(product) {
122
123
  var slug = genProductSlug(product === null || product === void 0 ? void 0 : product.productName, product === null || product === void 0 ? void 0 : product.productId);
123
124
  return "/product/" + slug + "/" + (product === null || product === void 0 ? void 0 : product.shopId);
124
125
  };
126
+ var getLinkServiceDetail = function getLinkServiceDetail(product) {
127
+ var slug = genProductSlug(product === null || product === void 0 ? void 0 : product.productName, product === null || product === void 0 ? void 0 : product.productId);
128
+ return "/service/" + slug + "/" + (product === null || product === void 0 ? void 0 : product.shopId);
129
+ };
125
130
  var LinkToPage = function LinkToPage(props) {
126
131
  var _props$Link = props.Link,
127
132
  Link = _props$Link === void 0 ? null : _props$Link,
128
133
  otherProps = _objectWithoutPropertiesLoose(props, _excluded);
129
134
  return Link ? /*#__PURE__*/React__default.createElement(Link, otherProps, props.children) : /*#__PURE__*/React__default.createElement("a", otherProps, props.children);
130
135
  };
136
+ var SSHOP_SPA_TOKEN = "sshop-spa-token";
137
+ var genLinkSearch = function genLinkSearch(keyword) {
138
+ return "/search?keyword=" + keyword;
139
+ };
140
+ var configSvg = function configSvg(data) {
141
+ var _data$replace, _data$replace$replace;
142
+ 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="[^"]*"/, '');
143
+ };
131
144
 
132
145
  var Options = function Options(props) {
133
146
  var _props$className = props.className,
@@ -213,15 +226,17 @@ var NavBar7 = function NavBar7(props) {
213
226
  _props$logout = props.logout,
214
227
  logout = _props$logout === void 0 ? function () {} : _props$logout;
215
228
  var cartItems = useSelector === null || useSelector === void 0 ? void 0 : useSelector(function (state) {
216
- return state.cart.items;
229
+ var _state$cart;
230
+ return state === null || state === void 0 ? void 0 : (_state$cart = state.cart) === null || _state$cart === void 0 ? void 0 : _state$cart.items;
217
231
  });
218
232
  var userInfo = useSelector === null || useSelector === void 0 ? void 0 : useSelector(function (state) {
219
- return state.user.info;
233
+ var _state$user;
234
+ return state === null || state === void 0 ? void 0 : (_state$user = state.user) === null || _state$user === void 0 ? void 0 : _state$user.info;
220
235
  });
221
236
  var _useState2 = useState(""),
222
237
  totalItem = _useState2[0],
223
238
  setTotalItem = _useState2[1];
224
- var profileRoute = (_routes$find = routes.find(function (e) {
239
+ var profileRoute = routes === null || routes === void 0 ? void 0 : (_routes$find = routes.find(function (e) {
225
240
  return (e === null || e === void 0 ? void 0 : e.name) === "profile";
226
241
  })) === null || _routes$find === void 0 ? void 0 : _routes$find.route;
227
242
  var profileOptions = [{
@@ -240,9 +255,19 @@ var NavBar7 = function NavBar7(props) {
240
255
  })
241
256
  }];
242
257
  useEffect(function () {
243
- console.log("NavBar7 cartItems", cartItems);
244
- var totalItem = cartItems.reduce(function (total, item) {
245
- return total + item.quantity;
258
+ if ((shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode) === "cafe_1" || (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode) === "grocery_1" || (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode) === "fashion_1") {
259
+ routes === null || routes === void 0 ? void 0 : routes.forEach(function (route) {
260
+ if ((route === null || route === void 0 ? void 0 : route.name) === "home" || (route === null || route === void 0 ? void 0 : route.name) === "products" || (route === null || route === void 0 ? void 0 : route.name) === "about") {
261
+ route.isShow = true;
262
+ } else {
263
+ route.isShow = false;
264
+ }
265
+ });
266
+ }
267
+ }, [shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode]);
268
+ useEffect(function () {
269
+ var totalItem = cartItems === null || cartItems === void 0 ? void 0 : cartItems.reduce(function (total, item) {
270
+ return total + (item === null || item === void 0 ? void 0 : item.quantity);
246
271
  }, 0);
247
272
  if (totalItem > 9) {
248
273
  totalItem = "9+";
@@ -288,7 +313,7 @@ var NavBar7 = function NavBar7(props) {
288
313
  }, (item === null || item === void 0 ? void 0 : item.name) === (route === null || route === void 0 ? void 0 : route.name) ? /*#__PURE__*/React__default.createElement("div", {
289
314
  className: "py-1 border-b text-textHeading border-textHeading"
290
315
  }, item === null || item === void 0 ? void 0 : item.label) : /*#__PURE__*/React__default.createElement("div", {
291
- className: "py-1"
316
+ className: "py-1 text-textBody"
292
317
  }, item === null || item === void 0 ? void 0 : item.label));
293
318
  })), cart(), userInfo ?
294
319
  /*#__PURE__*/
@@ -376,6 +401,226 @@ var NavBar7 = function NavBar7(props) {
376
401
  })))) : null));
377
402
  };
378
403
 
404
+ var NavBar1 = function NavBar1(props) {
405
+ var _routes$find, _routes$filter, _routes$filter2;
406
+ var _useState = useState(false),
407
+ isOpen = _useState[0],
408
+ setIsOpen = _useState[1];
409
+ var _props$shopConfig = props.shopConfig,
410
+ shopConfig = _props$shopConfig === void 0 ? {} : _props$shopConfig,
411
+ shopConfigStyle = props.shopConfigStyle,
412
+ _props$routes = props.routes,
413
+ routes = _props$routes === void 0 ? [] : _props$routes,
414
+ _props$route = props.route,
415
+ route = _props$route === void 0 ? null : _props$route,
416
+ _props$Link = props.Link,
417
+ Link = _props$Link === void 0 ? null : _props$Link,
418
+ _props$useSelector = props.useSelector,
419
+ useSelector = _props$useSelector === void 0 ? null : _props$useSelector,
420
+ _props$logout = props.logout,
421
+ logout = _props$logout === void 0 ? function () {} : _props$logout;
422
+ var cartItems = useSelector === null || useSelector === void 0 ? void 0 : useSelector(function (state) {
423
+ var _state$cart;
424
+ return state === null || state === void 0 ? void 0 : (_state$cart = state.cart) === null || _state$cart === void 0 ? void 0 : _state$cart.items;
425
+ });
426
+ var userInfo = useSelector === null || useSelector === void 0 ? void 0 : useSelector(function (state) {
427
+ var _state$user;
428
+ return state === null || state === void 0 ? void 0 : (_state$user = state.user) === null || _state$user === void 0 ? void 0 : _state$user.info;
429
+ });
430
+ var _useState2 = useState(""),
431
+ totalItem = _useState2[0],
432
+ setTotalItem = _useState2[1];
433
+ var profileRoute = routes === null || routes === void 0 ? void 0 : (_routes$find = routes.find(function (e) {
434
+ return (e === null || e === void 0 ? void 0 : e.name) === "profile";
435
+ })) === null || _routes$find === void 0 ? void 0 : _routes$find.route;
436
+ var profileOptions = [{
437
+ label: "Thông tin cá nhân",
438
+ href: profileRoute,
439
+ icon: /*#__PURE__*/React__default.createElement(IoInformationCircleOutline, {
440
+ size: 24,
441
+ className: "text-gray3"
442
+ })
443
+ }, {
444
+ label: "Đăng xuất",
445
+ onClick: logout,
446
+ icon: /*#__PURE__*/React__default.createElement(IoLogOutOutline, {
447
+ size: 24,
448
+ className: "text-gray3"
449
+ })
450
+ }];
451
+ useEffect(function () {
452
+ if ((shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode) === "cafe_1" || (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode) === "grocery_1" || (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode) === "fashion_1") {
453
+ routes === null || routes === void 0 ? void 0 : routes.forEach(function (route) {
454
+ if ((route === null || route === void 0 ? void 0 : route.name) === "home" || (route === null || route === void 0 ? void 0 : route.name) === "products" || (route === null || route === void 0 ? void 0 : route.name) === "about") {
455
+ route.isShow = true;
456
+ } else {
457
+ route.isShow = false;
458
+ }
459
+ });
460
+ }
461
+ }, [shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode]);
462
+ useEffect(function () {
463
+ var totalItem = cartItems === null || cartItems === void 0 ? void 0 : cartItems.reduce(function (total, item) {
464
+ return total + (item === null || item === void 0 ? void 0 : item.quantity);
465
+ }, 0);
466
+ if (totalItem > 9) {
467
+ totalItem = "9+";
468
+ }
469
+ setTotalItem(totalItem);
470
+ }, [cartItems]);
471
+ var cart = function cart() {
472
+ return /*#__PURE__*/React__default.createElement(LinkToPage, {
473
+ Link: Link,
474
+ href: "/carts"
475
+ }, /*#__PURE__*/React__default.createElement("div", {
476
+ className: "relative cursor-pointer"
477
+ }, /*#__PURE__*/React__default.createElement(IoBagOutline, {
478
+ className: "text-primary",
479
+ size: 30
480
+ }), totalItem ? /*#__PURE__*/React__default.createElement("small", {
481
+ 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"
482
+ }, totalItem) : null));
483
+ };
484
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
485
+ className: "hidden lg:flex justify-end items-center gap-6 px-20 py-2 bg-primary"
486
+ }, shopConfig !== null && shopConfig !== void 0 && shopConfig.shopPhone ? /*#__PURE__*/React__default.createElement("div", {
487
+ className: "font-medium border-r pr-6 text-background"
488
+ }, "Hotline: ", shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopPhone) : null, /*#__PURE__*/React__default.createElement("div", {
489
+ className: "flex justify-start items-center gap-2"
490
+ }, /*#__PURE__*/React__default.createElement("a", {
491
+ href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopFacebookPage) || "#"
492
+ }, /*#__PURE__*/React__default.createElement(FaFacebookF, {
493
+ size: 24,
494
+ className: "p-1 rounded bg-background text-primary"
495
+ })), /*#__PURE__*/React__default.createElement("a", {
496
+ href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopMessenger) || "#"
497
+ }, /*#__PURE__*/React__default.createElement(FaFacebookMessenger, {
498
+ size: 24,
499
+ className: "p-1 rounded bg-background text-primary"
500
+ })), /*#__PURE__*/React__default.createElement("a", {
501
+ href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopZalo) || "#"
502
+ }, /*#__PURE__*/React__default.createElement(SiZalo, {
503
+ size: 24,
504
+ className: "p-1 rounded bg-background text-primary"
505
+ })))), /*#__PURE__*/React__default.createElement("div", {
506
+ 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 "
507
+ }, /*#__PURE__*/React__default.createElement(LinkToPage, {
508
+ Link: Link,
509
+ href: "/",
510
+ className: "flex items-center gap-2"
511
+ }, /*#__PURE__*/React__default.createElement("img", {
512
+ className: "object-cover w-12 h-12",
513
+ src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
514
+ alt: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName
515
+ }), /*#__PURE__*/React__default.createElement("h3", {
516
+ className: "text-xl md:text-2xl whitespace-nowrap font-semibold text-primary"
517
+ }, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName)), /*#__PURE__*/React__default.createElement("div", {
518
+ className: "hidden lg:flex flex-1 items-center gap-4"
519
+ }, routes === null || routes === void 0 ? void 0 : (_routes$filter = routes.filter(function (e) {
520
+ return e === null || e === void 0 ? void 0 : e.isShow;
521
+ })) === null || _routes$filter === void 0 ? void 0 : _routes$filter.map(function (item, index) {
522
+ return /*#__PURE__*/React__default.createElement(LinkToPage, {
523
+ Link: Link,
524
+ href: item === null || item === void 0 ? void 0 : item.route,
525
+ key: index
526
+ }, /*#__PURE__*/React__default.createElement("div", {
527
+ className: "py-1 " + ((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") + " "
528
+ }, item === null || item === void 0 ? void 0 : item.label));
529
+ })), cart(), userInfo ?
530
+ /*#__PURE__*/
531
+ React__default.createElement("div", {
532
+ className: "flex justify-center"
533
+ }, /*#__PURE__*/React__default.createElement(FaUserCircle, {
534
+ className: "text-primary",
535
+ size: 48
536
+ }), /*#__PURE__*/React__default.createElement("div", {
537
+ className: "ml-2"
538
+ }, /*#__PURE__*/React__default.createElement("label", null, "Xin ch\xE0o!"), /*#__PURE__*/React__default.createElement(Options, {
539
+ Link: Link,
540
+ options: profileOptions,
541
+ dropdownClassName: "right-0 top-8",
542
+ className: "flex gap-4 items-center"
543
+ }, /*#__PURE__*/React__default.createElement("div", {
544
+ className: "font-semibold"
545
+ }, userInfo === null || userInfo === void 0 ? void 0 : userInfo.name), /*#__PURE__*/React__default.createElement(IoChevronDownOutline, {
546
+ className: "text-gray3",
547
+ size: 24
548
+ })))) :
549
+ /*#__PURE__*/
550
+ React__default.createElement("div", {
551
+ className: "flex gap-2"
552
+ }, /*#__PURE__*/React__default.createElement(LinkToPage, {
553
+ Link: Link,
554
+ href: "/account"
555
+ }, /*#__PURE__*/React__default.createElement(Button, {
556
+ label: "Đăng nhập",
557
+ shopConfigStyle: shopConfigStyle
558
+ })), /*#__PURE__*/React__default.createElement(LinkToPage, {
559
+ Link: Link,
560
+ href: "/account"
561
+ }, /*#__PURE__*/React__default.createElement(Button, {
562
+ label: "Đăng ký",
563
+ shopConfigStyle: shopConfigStyle,
564
+ type: 'outline'
565
+ })))), /*#__PURE__*/React__default.createElement("div", {
566
+ className: "relative lg:hidden flex gap-4 items-center px-4 py-2"
567
+ }, /*#__PURE__*/React__default.createElement(LinkToPage, {
568
+ Link: Link,
569
+ href: "/",
570
+ className: "flex flex-1 gap-2 items-center"
571
+ }, /*#__PURE__*/React__default.createElement("img", {
572
+ className: "object-cover w-12 h-12",
573
+ src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
574
+ alt: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName
575
+ }), /*#__PURE__*/React__default.createElement("h3", {
576
+ className: "text-xl md:text-2xl font-semibold text-primary"
577
+ }, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName)), cart(), /*#__PURE__*/React__default.createElement("button", {
578
+ type: "button",
579
+ onClick: function onClick() {
580
+ setIsOpen(true);
581
+ }
582
+ }, /*#__PURE__*/React__default.createElement(FiMenu, {
583
+ size: 32,
584
+ className: "text-primary"
585
+ })), isOpen ? /*#__PURE__*/React__default.createElement("div", {
586
+ className: "absolute bg-[rgba(0,0,0,0.5)] h-screen w-full top-0 left-0 z-50 flex justify-end",
587
+ onClick: function onClick() {
588
+ setIsOpen(false);
589
+ }
590
+ }, /*#__PURE__*/React__default.createElement("div", {
591
+ className: "h-full w-[80vw] max-w-[320px] p-4 bg-bgSecondary",
592
+ onClick: function onClick(event) {
593
+ return event.stopPropagation();
594
+ }
595
+ }, /*#__PURE__*/React__default.createElement("div", {
596
+ className: "flex justify-between"
597
+ }, /*#__PURE__*/React__default.createElement("div", {
598
+ className: "flex gap-2 items-center"
599
+ }, /*#__PURE__*/React__default.createElement("img", {
600
+ src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
601
+ className: "h-14 w-14 bg-cover bg-no-repeat"
602
+ }), /*#__PURE__*/React__default.createElement("div", {
603
+ className: "text-xl font-semibold line-clamp-1"
604
+ }, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName)), /*#__PURE__*/React__default.createElement("button", {
605
+ className: "text-gray4",
606
+ onClick: function onClick() {
607
+ setIsOpen(false);
608
+ }
609
+ }, /*#__PURE__*/React__default.createElement(RxCross2, {
610
+ size: 24
611
+ }))), /*#__PURE__*/React__default.createElement("div", null, routes === null || routes === void 0 ? void 0 : (_routes$filter2 = routes.filter(function (e) {
612
+ return e === null || e === void 0 ? void 0 : e.isShow;
613
+ })) === null || _routes$filter2 === void 0 ? void 0 : _routes$filter2.map(function (item, index) {
614
+ return /*#__PURE__*/React__default.createElement(LinkToPage, {
615
+ Link: Link,
616
+ href: item === null || item === void 0 ? void 0 : item.route,
617
+ key: index
618
+ }, /*#__PURE__*/React__default.createElement("div", {
619
+ className: "py-2 " + ((item === null || item === void 0 ? void 0 : item.name) === (route === null || route === void 0 ? void 0 : route.name) ? "text-textHeading" : "")
620
+ }, item === null || item === void 0 ? void 0 : item.label));
621
+ })))) : null));
622
+ };
623
+
379
624
  var SvgIcon = function SvgIcon(_ref) {
380
625
  var className = _ref.className,
381
626
  style = _ref.style;
@@ -416,65 +661,364 @@ var SectionTitle1 = function SectionTitle1(props) {
416
661
  }, data === null || data === void 0 ? void 0 : data.sectionDescription) : null);
417
662
  };
418
663
 
419
- var Hero10 = function Hero10(props) {
420
- var _data$data, _data$data$, _data$data$$srcImages, _sectionData$, _sectionData$2, _sectionData$2$button;
421
- var shopConfigStyle = props.shopConfigStyle,
422
- data = props.data;
423
- var sectionData = data === null || data === void 0 ? void 0 : data.data;
664
+ var SectionTitle2 = function SectionTitle2(props) {
665
+ var _props$data = props.data,
666
+ data = _props$data === void 0 ? {} : _props$data;
424
667
  return /*#__PURE__*/React__default.createElement("div", {
425
- className: "relative w-full bg-cover bg-center bg-no-repeat ",
426
- style: {
427
- backgroundImage: "url(" + (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]) + ")"
428
- }
668
+ className: "flex flex-col gap-2"
669
+ }, data !== null && data !== void 0 && data.sectionTitle ? /*#__PURE__*/React__default.createElement("div", {
670
+ className: "flex gap-4 justify-center items-center"
429
671
  }, /*#__PURE__*/React__default.createElement("div", {
430
- className: "absolute top-0 w-full h-full bg-black opacity-40 z-0"
672
+ className: " w-32 h-0.5 rounded-full bg-stroke"
431
673
  }), /*#__PURE__*/React__default.createElement("div", {
432
- className: "relative w-full min-h-[540px] p-12 z-10 flex flex-col gap-6 items-center justify-center"
433
- }, /*#__PURE__*/React__default.createElement("div", {
434
- className: "text-3xl md:text-5xl text-white leading-[1.6] md:leading-[1.6] text-center font-headingFont"
435
- }, sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$ = sectionData[0]) === null || _sectionData$ === void 0 ? void 0 : _sectionData$.title), sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$2 = sectionData[0]) === null || _sectionData$2 === void 0 ? void 0 : (_sectionData$2$button = _sectionData$2.buttons) === null || _sectionData$2$button === void 0 ? void 0 : _sectionData$2$button.map(function (button) {
436
- return /*#__PURE__*/React__default.createElement("a", {
437
- href: (button === null || button === void 0 ? void 0 : button.route) || (button === null || button === void 0 ? void 0 : button.link) || "#"
438
- }, /*#__PURE__*/React__default.createElement(Button, {
439
- label: button === null || button === void 0 ? void 0 : button.label,
440
- shopConfigStyle: shopConfigStyle
441
- }));
442
- })));
674
+ className: "text-center whitespace-nowrap text-2xl md:text-4xl font-headingFont font-semibold leading-relaxed text-textHeading"
675
+ }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement("div", {
676
+ className: " w-32 h-0.5 rounded-full bg-stroke"
677
+ })) : null, /*#__PURE__*/React__default.createElement("div", {
678
+ className: "flex items-center gap-2 justify-center"
679
+ }, /*#__PURE__*/React__default.createElement(IoIosStar, {
680
+ className: "w-4 h-4 text-warning"
681
+ }), /*#__PURE__*/React__default.createElement(IoIosStar, {
682
+ className: "w-6 h-6 text-warning"
683
+ }), /*#__PURE__*/React__default.createElement(IoIosStar, {
684
+ className: "w-4 h-4 text-warning"
685
+ })), data !== null && data !== void 0 && data.sectionDescription ? /*#__PURE__*/React__default.createElement("div", {
686
+ className: "text-xl text-center leading-relaxed text-textSecondary"
687
+ }, data === null || data === void 0 ? void 0 : data.sectionDescription) : null);
443
688
  };
444
689
 
445
- var Dash = function Dash(props) {
446
- var _props$color = props.color,
447
- color = _props$color === void 0 ? "#ccc" : _props$color,
448
- _props$className = props.className,
449
- className = _props$className === void 0 ? "" : _props$className;
450
- return /*#__PURE__*/React__default.createElement("div", {
451
- className: "mx-auto w-full max-w-[240px] md:max-w-[720px] border-b-0 " + className,
452
- style: {
453
- backgroundImage: "repeating-linear-gradient(to right, " + color + " 0, " + color + " 10px, transparent 10px, transparent 20px)",
454
- height: "1px"
455
- }
456
- });
690
+ var SectionTitle3 = function SectionTitle3(props) {
691
+ var data = props.data;
692
+ return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("h3", {
693
+ className: "font-headingFont leading-relaxed text-textHeading text-2xl md:text-4xl font-semibold"
694
+ }, data === null || data === void 0 ? void 0 : data.sectionTitle), data !== null && data !== void 0 && data.sectionDescription ? /*#__PURE__*/React__default.createElement("p", {
695
+ className: "text-xl font-medium leading-relaxed text-textSecondary mt-4 lg:mt-6"
696
+ }, data === null || data === void 0 ? void 0 : data.sectionDescription) : null);
457
697
  };
458
698
 
459
- var SECTION_DEFAULT_CLASS = "my-12 mx-4 xl:mx-20 bg-background";
460
-
461
- var Hero11 = function Hero11(props) {
462
- var _data$data;
463
- var _props$shopConfigStyl = props.shopConfigStyle,
464
- shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
465
- _props$data = props.data,
466
- data = _props$data === void 0 ? {} : _props$data,
467
- _props$SectionTitle = props.SectionTitle,
468
- SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
469
- var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
470
- _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
471
- secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
472
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
473
- className: "" + SECTION_DEFAULT_CLASS
474
- }, /*#__PURE__*/React__default.createElement(SectionTitle, {
475
- data: data,
476
- shopConfigStyle: shopConfigStyle
477
- }), /*#__PURE__*/React__default.createElement("div", {
699
+ var Input = forwardRef(function (props, ref) {
700
+ var _props$label = props.label,
701
+ label = _props$label === void 0 ? "" : _props$label,
702
+ _props$placeholder = props.placeholder,
703
+ placeholder = _props$placeholder === void 0 ? "" : _props$placeholder,
704
+ _props$className = props.className,
705
+ className = _props$className === void 0 ? "" : _props$className,
706
+ _props$inputClassName = props.inputClassName,
707
+ inputClassName = _props$inputClassName === void 0 ? "" : _props$inputClassName,
708
+ _props$wrapClassName = props.wrapClassName,
709
+ wrapClassName = _props$wrapClassName === void 0 ? "" : _props$wrapClassName,
710
+ _props$labelClassName = props.labelClassName,
711
+ labelClassName = _props$labelClassName === void 0 ? "" : _props$labelClassName,
712
+ _props$name = props.name,
713
+ name = _props$name === void 0 ? "" : _props$name,
714
+ _props$style = props.style,
715
+ style = _props$style === void 0 ? {} : _props$style,
716
+ _props$onChange = props.onChange,
717
+ onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
718
+ _props$defaultValue = props.defaultValue,
719
+ defaultValue = _props$defaultValue === void 0 ? "" : _props$defaultValue,
720
+ _props$type = props.type,
721
+ type = _props$type === void 0 ? "text" : _props$type,
722
+ _props$rules = props.rules,
723
+ rules = _props$rules === void 0 ? [] : _props$rules,
724
+ _props$isQuantity = props.isQuantity,
725
+ isQuantity = _props$isQuantity === void 0 ? false : _props$isQuantity,
726
+ _props$min = props.min,
727
+ min = _props$min === void 0 ? 0 : _props$min,
728
+ _props$max = props.max,
729
+ max = _props$max === void 0 ? null : _props$max,
730
+ _props$isHidden = props.isHidden,
731
+ isHidden = _props$isHidden === void 0 ? false : _props$isHidden,
732
+ icons = props.icons,
733
+ suffix = props.suffix;
734
+ var _useState = useState(defaultValue),
735
+ value = _useState[0],
736
+ _setValue = _useState[1];
737
+ var _useState2 = useState(""),
738
+ error = _useState2[0],
739
+ _setError = _useState2[1];
740
+ var _useState3 = useState(type),
741
+ typeInput = _useState3[0],
742
+ setTypeInput = _useState3[1];
743
+ var refInput = useRef();
744
+ useImperativeHandle(ref, function () {
745
+ return {
746
+ validateData: function validateData() {
747
+ return _validateData();
748
+ },
749
+ setValue: function setValue(text) {
750
+ return _setValue(text);
751
+ },
752
+ getValue: function getValue() {
753
+ return value;
754
+ },
755
+ setError: function setError(err) {
756
+ return _setError(err);
757
+ }
758
+ };
759
+ });
760
+ var _validateData = function _validateData() {
761
+ var count = 0;
762
+ for (var _iterator = _createForOfIteratorHelperLoose(rules), _step; !(_step = _iterator()).done;) {
763
+ var _e$pattern, _e$validate;
764
+ var e = _step.value;
765
+ if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && value === '') {
766
+ _setError(e === null || e === void 0 ? void 0 : e.message);
767
+ count++;
768
+ break;
769
+ } else if ((e === null || e === void 0 ? void 0 : e.type) === 'pattern' && !(e !== null && e !== void 0 && (_e$pattern = e.pattern) !== null && _e$pattern !== void 0 && _e$pattern.test(value))) {
770
+ _setError(e === null || e === void 0 ? void 0 : e.message);
771
+ count++;
772
+ break;
773
+ } else if ((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))) {
774
+ _setError(e === null || e === void 0 ? void 0 : e.message);
775
+ count++;
776
+ break;
777
+ }
778
+ }
779
+ if (count) {
780
+ return false;
781
+ } else {
782
+ _setError('');
783
+ return true;
784
+ }
785
+ };
786
+ var handleOnChange = function handleOnChange(event) {
787
+ var value = event.target.value;
788
+ if (isQuantity) {
789
+ value = parseInt(value) || 1;
790
+ }
791
+ _setValue(value);
792
+ onChange === null || onChange === void 0 ? void 0 : onChange(value);
793
+ };
794
+ var changeQuantity = function changeQuantity(quantity) {
795
+ var newValue = parseInt(value) + quantity;
796
+ if (newValue > min && (max === null || newValue <= max)) {
797
+ _setValue(newValue);
798
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
799
+ }
800
+ };
801
+ var changeHidden = function changeHidden() {
802
+ if (typeInput === "text") setTypeInput("password");else {
803
+ setTypeInput("text");
804
+ }
805
+ };
806
+ var _className = "h-9 md:h-10 py-1 px-2 border border-stroke rounded-lg " + className;
807
+ var _inputClassName = (isQuantity ? "text-center w-12" : "") + " focus:outline-none focus:ring-0 bg-transparent\t " + inputClassName;
808
+ var required = !!(rules !== null && rules !== void 0 && rules.find(function (e) {
809
+ return (e === null || e === void 0 ? void 0 : e.type) === "required";
810
+ }));
811
+ var labelRequired = required ? /*#__PURE__*/React__default.createElement("span", {
812
+ className: "text-danger"
813
+ }, " *") : null;
814
+ return /*#__PURE__*/React__default.createElement("div", {
815
+ className: wrapClassName
816
+ }, label ? /*#__PURE__*/React__default.createElement("div", {
817
+ className: "mb-1 " + labelClassName
818
+ }, label, labelRequired) : null, /*#__PURE__*/React__default.createElement("div", {
819
+ className: "flex gap-2 items-center bg-white " + _className,
820
+ style: style
821
+ }, isQuantity ? /*#__PURE__*/React__default.createElement("button", {
822
+ onClick: function onClick() {
823
+ return changeQuantity(-1);
824
+ }
825
+ }, /*#__PURE__*/React__default.createElement(FaMinus, null)) : null, icons ? /*#__PURE__*/React__default.createElement("div", null, icons) : null, /*#__PURE__*/React__default.createElement("input", {
826
+ type: typeInput,
827
+ name: name,
828
+ value: value,
829
+ placeholder: placeholder,
830
+ onChange: handleOnChange,
831
+ required: required,
832
+ className: _inputClassName,
833
+ ref: refInput
834
+ }), suffix ? /*#__PURE__*/React__default.createElement("div", null, suffix) : null, isHidden ? /*#__PURE__*/React__default.createElement("button", {
835
+ onClick: function onClick() {
836
+ changeHidden();
837
+ }
838
+ }, /*#__PURE__*/React__default.createElement(FaRegEyeSlash, {
839
+ className: "font-semibold"
840
+ })) : null, isQuantity ? /*#__PURE__*/React__default.createElement("button", {
841
+ onClick: function onClick() {
842
+ return changeQuantity(1);
843
+ }
844
+ }, /*#__PURE__*/React__default.createElement(FaPlus, null)) : null), error ? /*#__PURE__*/React__default.createElement("div", {
845
+ className: "text-danger"
846
+ }, error) : null);
847
+ });
848
+
849
+ var Hero1 = function Hero1(props) {
850
+ var _sectionData$, _sectionData$$srcImag, _sectionData$2, _sectionData$3, _sectionData$4, _sectionData$4$button, _sectionData$4$button2, _sectionData$5, _sectionData$5$button, _sectionData$5$button2;
851
+ var shopConfigStyle = props.shopConfigStyle,
852
+ data = props.data,
853
+ _props$Link = props.Link,
854
+ Link = _props$Link === void 0 ? null : _props$Link;
855
+ var _useState = useState(""),
856
+ value = _useState[0],
857
+ setValue = _useState[1];
858
+ var sectionData = data === null || data === void 0 ? void 0 : data.data;
859
+ return /*#__PURE__*/React__default.createElement("div", {
860
+ style: {
861
+ 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]) + ")"
862
+ },
863
+ 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"
864
+ }, /*#__PURE__*/React__default.createElement("div", {
865
+ 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]"
866
+ }, /*#__PURE__*/React__default.createElement("div", {
867
+ className: "text-xl md:text-4xl lg:text-[40px] text-primary font-medium"
868
+ }, sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$2 = sectionData[0]) === null || _sectionData$2 === void 0 ? void 0 : _sectionData$2.title), /*#__PURE__*/React__default.createElement("div", {
869
+ className: "text-center md:text-2xl lg:text-3xl font-medium"
870
+ }, 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, {
871
+ Link: Link,
872
+ 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.link
873
+ }, /*#__PURE__*/React__default.createElement(Button, {
874
+ label: 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.label,
875
+ shopConfigStyle: shopConfigStyle
876
+ })), " "), /*#__PURE__*/React__default.createElement("div", {
877
+ className: "w-[90%] md:w-2/3 xl:w-1/2 bg-background flex gap-2 md:gap-4 lg:gap-6 p-2 md:p-4 lg:p-6 rounded-xl absolute bottom-[-40px] shadow-lg"
878
+ }, /*#__PURE__*/React__default.createElement(Input, {
879
+ placeholder: "Tìm kiếm sản phẩm",
880
+ icons: /*#__PURE__*/React__default.createElement(IoSearchOutline, null),
881
+ wrapClassName: "w-full",
882
+ inputClassName: "w-full",
883
+ onChange: setValue
884
+ }), value && (value === null || value === void 0 ? void 0 : value.length) > 0 ? /*#__PURE__*/React__default.createElement(LinkToPage, {
885
+ Link: Link,
886
+ href: genLinkSearch(value)
887
+ }, /*#__PURE__*/React__default.createElement(Button, {
888
+ label: "T\xECm ki\u1EBFm",
889
+ className: "whitespace-nowrap h-full ",
890
+ shopConfigStyle: shopConfigStyle
891
+ })) : /*#__PURE__*/React__default.createElement(Button, {
892
+ label: "T\xECm ki\u1EBFm",
893
+ className: "whitespace-nowrap ",
894
+ shopConfigStyle: shopConfigStyle
895
+ })));
896
+ };
897
+
898
+ var Hero2 = function Hero2(props) {
899
+ var _data$data, _data$data$, _data$data$$srcImages, _data$data2, _data$data2$, _data$data3, _data$data3$;
900
+ var shopConfig = props.shopConfig,
901
+ data = props.data;
902
+ return /*#__PURE__*/React__default.createElement("div", {
903
+ className: "relative"
904
+ }, /*#__PURE__*/React__default.createElement("img", {
905
+ 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],
906
+ className: "w-full object-cover min-h-[25vh] md:min-h-[30vh] max-h-[100vh]"
907
+ }), /*#__PURE__*/React__default.createElement("div", {
908
+ 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%]"
909
+ }, /*#__PURE__*/React__default.createElement("img", {
910
+ src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
911
+ className: "h-6 w-6 md:h-16 md:w-16 lg:h-20 lg:w-20"
912
+ }), /*#__PURE__*/React__default.createElement("div", {
913
+ className: "text-lg md:text-3xl lg:text-4xl font-medium"
914
+ }, 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", {
915
+ className: "text-sm md:text-xl lg:text-2xl "
916
+ }, 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)));
917
+ };
918
+
919
+ var Hero5 = function Hero5(props) {
920
+ var _data$data, _data$data$, _data$data$$srcImages, _data$data2, _data$data2$, _data$data3, _data$data3$;
921
+ var data = props.data;
922
+ return /*#__PURE__*/React__default.createElement("div", {
923
+ className: "relative"
924
+ }, /*#__PURE__*/React__default.createElement("img", {
925
+ 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],
926
+ className: "w-full min-h-[25vh] md:min-h-[30vh] max-h-[100vh]"
927
+ }), /*#__PURE__*/React__default.createElement("div", {
928
+ 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"
929
+ }, /*#__PURE__*/React__default.createElement("div", {
930
+ className: "text-xl md:text-3xl lg:text-4xl text-textHeading font-medium"
931
+ }, 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", {
932
+ className: "md:text-xl lg:text-2xl text-primary line-clamp-3 md:line-clamp-none"
933
+ }, 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)));
934
+ };
935
+
936
+ var Hero6 = function Hero6(props) {
937
+ var _data$data, _data$data$, _data$data$$srcImages, _data$data2, _data$data2$, _data$data3, _data$data3$, _sectionData$, _sectionData$$buttons;
938
+ var shopConfigStyle = props.shopConfigStyle,
939
+ data = props.data;
940
+ var sectionData = data === null || data === void 0 ? void 0 : data.data;
941
+ return /*#__PURE__*/React__default.createElement("div", {
942
+ className: "relative"
943
+ }, /*#__PURE__*/React__default.createElement("img", {
944
+ 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],
945
+ className: "w-full h-auto min-h-[25vh md:min-h-[30vh] max-h-[100vh]"
946
+ }), /*#__PURE__*/React__default.createElement("div", {
947
+ 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"
948
+ }, /*#__PURE__*/React__default.createElement("div", {
949
+ className: "text-primary text-xl md:text-3xl lg:text-5xl leading-[1.6] md:leading-[1.6] text-center font-headingFont"
950
+ }, 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", {
951
+ className: "md:text-xl"
952
+ }, 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) {
953
+ return /*#__PURE__*/React__default.createElement("a", {
954
+ href: (button === null || button === void 0 ? void 0 : button.route) || (button === null || button === void 0 ? void 0 : button.link) || "#"
955
+ }, /*#__PURE__*/React__default.createElement(Button, {
956
+ label: button === null || button === void 0 ? void 0 : button.label,
957
+ shopConfigStyle: shopConfigStyle
958
+ }));
959
+ })));
960
+ };
961
+
962
+ var Hero10 = function Hero10(props) {
963
+ var _data$data, _data$data$, _data$data$$srcImages, _sectionData$, _sectionData$2, _sectionData$2$button;
964
+ var shopConfigStyle = props.shopConfigStyle,
965
+ data = props.data;
966
+ var sectionData = data === null || data === void 0 ? void 0 : data.data;
967
+ return /*#__PURE__*/React__default.createElement("div", {
968
+ className: "relative w-full bg-cover bg-center bg-no-repeat ",
969
+ style: {
970
+ backgroundImage: "url(" + (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]) + ")"
971
+ }
972
+ }, /*#__PURE__*/React__default.createElement("div", {
973
+ className: "absolute top-0 w-full h-full bg-black opacity-40 z-0"
974
+ }), /*#__PURE__*/React__default.createElement("div", {
975
+ className: "relative w-full min-h-[540px] p-12 z-10 flex flex-col gap-6 items-center justify-center"
976
+ }, /*#__PURE__*/React__default.createElement("div", {
977
+ className: "text-3xl md:text-5xl text-white leading-[1.6] md:leading-[1.6] text-center font-headingFont"
978
+ }, sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$ = sectionData[0]) === null || _sectionData$ === void 0 ? void 0 : _sectionData$.title), sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$2 = sectionData[0]) === null || _sectionData$2 === void 0 ? void 0 : (_sectionData$2$button = _sectionData$2.buttons) === null || _sectionData$2$button === void 0 ? void 0 : _sectionData$2$button.map(function (button) {
979
+ return /*#__PURE__*/React__default.createElement("a", {
980
+ href: (button === null || button === void 0 ? void 0 : button.route) || (button === null || button === void 0 ? void 0 : button.link) || "#"
981
+ }, /*#__PURE__*/React__default.createElement(Button, {
982
+ label: button === null || button === void 0 ? void 0 : button.label,
983
+ shopConfigStyle: shopConfigStyle
984
+ }));
985
+ })));
986
+ };
987
+
988
+ var Dash = function Dash(props) {
989
+ var _props$color = props.color,
990
+ color = _props$color === void 0 ? "#ccc" : _props$color,
991
+ _props$className = props.className,
992
+ className = _props$className === void 0 ? "" : _props$className;
993
+ return /*#__PURE__*/React__default.createElement("div", {
994
+ className: "mx-auto w-full max-w-[240px] md:max-w-[720px] border-b-0 " + className,
995
+ style: {
996
+ backgroundImage: "repeating-linear-gradient(to right, " + color + " 0, " + color + " 10px, transparent 10px, transparent 20px)",
997
+ height: "1px"
998
+ }
999
+ });
1000
+ };
1001
+
1002
+ var SECTION_DEFAULT_CLASS = "my-12 mx-4 xl:mx-20 bg-background";
1003
+ var SECTION_CLASS = "my-6 md:my-12 px-4 xl:px-20 bg-background";
1004
+
1005
+ var Hero11 = function Hero11(props) {
1006
+ var _data$data;
1007
+ var _props$shopConfigStyl = props.shopConfigStyle,
1008
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
1009
+ _props$data = props.data,
1010
+ data = _props$data === void 0 ? {} : _props$data,
1011
+ _props$SectionTitle = props.SectionTitle,
1012
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
1013
+ var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
1014
+ _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
1015
+ secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
1016
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
1017
+ className: "" + SECTION_DEFAULT_CLASS
1018
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
1019
+ data: data,
1020
+ shopConfigStyle: shopConfigStyle
1021
+ }), /*#__PURE__*/React__default.createElement("div", {
478
1022
  className: "mt-6 grid grid-cols-2 md:grid-cols-4 gap-1 md:gap-2"
479
1023
  }, data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.map(function (it, index) {
480
1024
  var _it$srcImages;
@@ -510,6 +1054,89 @@ var Hero11$1 = function Hero11(props) {
510
1054
  }, 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)));
511
1055
  };
512
1056
 
1057
+ var CarouselItem = function CarouselItem(props) {
1058
+ var _Object$keys;
1059
+ var _props$data = props.data,
1060
+ data = _props$data === void 0 ? [] : _props$data,
1061
+ _props$className = props.className,
1062
+ className = _props$className === void 0 ? "" : _props$className,
1063
+ _props$style = props.style,
1064
+ style = _props$style === void 0 ? {} : _props$style,
1065
+ _props$onClick = props.onClick,
1066
+ onClick = _props$onClick === void 0 ? function () {} : _props$onClick,
1067
+ _props$isAll = props.isAll,
1068
+ isAll = _props$isAll === void 0 ? true : _props$isAll,
1069
+ _props$isNavigateButt = props.isNavigateButton,
1070
+ isNavigateButton = _props$isNavigateButt === void 0 ? true : _props$isNavigateButt,
1071
+ _props$itemClassName = props.itemClassName,
1072
+ itemClassName = _props$itemClassName === void 0 ? "" : _props$itemClassName;
1073
+ var listRef = useRef(null);
1074
+ var _useState = useState(true),
1075
+ isScrolledToRight = _useState[0],
1076
+ setIsScrolledToRight = _useState[1];
1077
+ var _useState2 = useState({}),
1078
+ value = _useState2[0],
1079
+ setValue = _useState2[1];
1080
+ var handleClickPrevImg = function handleClickPrevImg() {
1081
+ if (listRef.current) {
1082
+ setIsScrolledToRight(false);
1083
+ listRef.current.scrollBy({
1084
+ left: -150,
1085
+ behavior: "smooth"
1086
+ });
1087
+ }
1088
+ };
1089
+ var handleClickNextImg = function handleClickNextImg() {
1090
+ setIsScrolledToRight(true);
1091
+ if (listRef.current) {
1092
+ listRef.current.scrollBy({
1093
+ left: 150,
1094
+ behavior: "smooth"
1095
+ });
1096
+ }
1097
+ };
1098
+ var handleOnClick = function handleOnClick(item) {
1099
+ setValue(item);
1100
+ onClick === null || onClick === void 0 ? void 0 : onClick(item);
1101
+ };
1102
+ return /*#__PURE__*/React__default.createElement("div", {
1103
+ className: "grid grid-cols-12 h-10 md:h-12 " + className,
1104
+ style: style
1105
+ }, /*#__PURE__*/React__default.createElement("div", {
1106
+ className: "col-span-12 lg:col-span-10 md:col-span-9 overflow-hidden "
1107
+ }, /*#__PURE__*/React__default.createElement("div", {
1108
+ className: "flex overflow-x-auto gap-2 hide-scrollbar items-center",
1109
+ ref: listRef
1110
+ }, isAll ? /*#__PURE__*/React__default.createElement("div", {
1111
+ className: " " + ((Object === null || Object === void 0 ? void 0 : (_Object$keys = Object.keys(value)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) <= 0 ? "bg-primary text-textButton" : "bg-background") + " w-max border border-primary p-1 md:p-2 rounded-lg cursor-pointer whitespace-nowrap",
1112
+ onClick: function onClick() {
1113
+ handleOnClick({});
1114
+ }
1115
+ }, "T\u1EA5t c\u1EA3") : null, data && (data === null || data === void 0 ? void 0 : data.length) > 0 && (data === null || data === void 0 ? void 0 : data.map(function (item, index) {
1116
+ return /*#__PURE__*/React__default.createElement("div", {
1117
+ className: ((value === null || value === void 0 ? void 0 : value.value) === (item === null || item === void 0 ? void 0 : item.value) ? "bg-primary text-textButton" : "bg-background") + " w-max border border-primary py-1 px-2 md:py-2 md:px-3 rounded-lg cursor-pointer whitespace-nowrap " + itemClassName,
1118
+ key: "carousel-" + index,
1119
+ onClick: function onClick() {
1120
+ handleOnClick(item);
1121
+ }
1122
+ }, item === null || item === void 0 ? void 0 : item.label);
1123
+ })))), isNavigateButton ? /*#__PURE__*/React__default.createElement("div", {
1124
+ className: "hidden my-auto col-span-5 md:col-span-3 lg:col-span-2 gap-4 md:flex justify-end "
1125
+ }, /*#__PURE__*/React__default.createElement("button", {
1126
+ className: "p-2 h-full w-10 md:w-12 rounded-full " + (isScrolledToRight ? "bg-gray5" : "bg-primary"),
1127
+ onClick: handleClickPrevImg
1128
+ }, /*#__PURE__*/React__default.createElement(IoIosArrowBack, {
1129
+ size: 32,
1130
+ className: "inline-block text-lg text-textButton"
1131
+ })), /*#__PURE__*/React__default.createElement("button", {
1132
+ className: " p-2 h-full w-10 md:w-12 rounded-full " + (isScrolledToRight ? "bg-primary" : "bg-gray5"),
1133
+ onClick: handleClickNextImg
1134
+ }, /*#__PURE__*/React__default.createElement(IoIosArrowForward, {
1135
+ size: 32,
1136
+ className: "inline-block text-lg text-textButton"
1137
+ }))) : null);
1138
+ };
1139
+
513
1140
  // A type of promise-like that resolves synchronously and supports only one observer
514
1141
 
515
1142
  const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator"))) : "@@iterator";
@@ -6599,362 +7226,109 @@ request.interceptors.response.use(function (response) {
6599
7226
  });
6600
7227
  });
6601
7228
  var api = function api(options) {
6602
- var config = _extends({
6603
- baseURL: getBaseUrl()
6604
- }, options, {
6605
- paramsSerializer: function paramsSerializer(params) {
6606
- return lib.stringify(params, {
6607
- arrayFormat: "repeat"
6608
- });
6609
- },
6610
- headers: _extends({}, options.headers)
6611
- });
6612
- return request(config);
6613
- };
6614
-
6615
- var getShopCategoriesApi = function getShopCategoriesApi(shopId, types) {
6616
- return api({
6617
- method: "get",
6618
- url: "/landing-shop/get-product-category-on-landing",
6619
- params: {
6620
- shopId: shopId,
6621
- types: types,
6622
- isShowOnLanding: true
6623
- },
6624
- headers: {
6625
- shopId: shopId
6626
- }
6627
- });
6628
- };
6629
- var getProductListApi = function getProductListApi(shopId, params) {
6630
- if (params === void 0) {
6631
- params = {};
6632
- }
6633
- return api({
6634
- method: "get",
6635
- url: "/landing-shop/get-product-on-landing",
6636
- params: _extends({
6637
- shopId: shopId,
6638
- isShowOnLanding: true
6639
- }, params),
6640
- headers: {
6641
- shopId: shopId
6642
- }
6643
- });
6644
- };
6645
- var getDetailProductApi = function getDetailProductApi(shopId, productId) {
6646
- return api({
6647
- method: "get",
6648
- url: "/products/" + productId + "/shops/" + shopId + "/info",
6649
- headers: {
6650
- shopId: shopId
6651
- }
6652
- });
6653
- };
6654
-
6655
- var CategoryController = function CategoryController(props) {
6656
- var shopConfig = props.shopConfig,
6657
- _props$types = props.types,
6658
- types = _props$types === void 0 ? "" : _props$types;
6659
- var _useState = useState([]),
6660
- categories = _useState[0],
6661
- setCategories = _useState[1];
6662
- useEffect(function () {
6663
- getCategoryList();
6664
- }, []);
6665
- var getCategoryList = function getCategoryList() {
6666
- try {
6667
- var _temp = _catch(function () {
6668
- return Promise.resolve(getShopCategoriesApi(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopId, types)).then(function (res) {
6669
- var _res$data, _res$data$status;
6670
- if ((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$status = _res$data.status) === null || _res$data$status === void 0 ? void 0 : _res$data$status.code) == 200) {
6671
- var _res$data2;
6672
- setCategories(res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.data);
6673
- }
6674
- });
6675
- }, function (e) {
6676
- console.log(e);
6677
- });
6678
- return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
6679
- } catch (e) {
6680
- return Promise.reject(e);
6681
- }
6682
- };
6683
- return {
6684
- categories: categories
6685
- };
6686
- };
6687
-
6688
- var Hero13 = function Hero13(props) {
6689
- var listRef = useRef(null);
6690
- var _useState = useState(false),
6691
- isOpen = _useState[0],
6692
- setIsOpen = _useState[1];
6693
- var shopConfigStyle = props.shopConfigStyle,
6694
- data = props.data;
6695
- var sectionData = data === null || data === void 0 ? void 0 : data.data;
6696
- var _CategoryController = CategoryController(props),
6697
- _CategoryController$c = _CategoryController.categories,
6698
- categories = _CategoryController$c === void 0 ? [] : _CategoryController$c;
6699
- var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
6700
- _shopConfigStyle$colo2 = _shopConfigStyle$colo.primary,
6701
- primary = _shopConfigStyle$colo2 === void 0 ? "#000" : _shopConfigStyle$colo2,
6702
- _shopConfigStyle$colo3 = _shopConfigStyle$colo.textBody,
6703
- textBody = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
6704
- _shopConfigStyle$colo4 = _shopConfigStyle$colo.background,
6705
- background = _shopConfigStyle$colo4 === void 0 ? "#fff" : _shopConfigStyle$colo4,
6706
- _shopConfigStyle$colo5 = _shopConfigStyle$colo.bgSecondary,
6707
- bgSecondary = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5,
6708
- _shopConfigStyle$colo6 = _shopConfigStyle$colo.textButton,
6709
- textButton = _shopConfigStyle$colo6 === void 0 ? "#fff" : _shopConfigStyle$colo6;
6710
- var handleClickPrevImg = function handleClickPrevImg() {
6711
- if (listRef.current) {
6712
- listRef.current.scrollBy({
6713
- left: -90,
6714
- behavior: "smooth"
6715
- });
6716
- }
6717
- };
6718
- var handleClickNextImg = function handleClickNextImg() {
6719
- if (listRef.current) {
6720
- listRef.current.scrollBy({
6721
- left: 90,
6722
- behavior: "smooth"
6723
- });
6724
- }
6725
- };
6726
- return /*#__PURE__*/React__default.createElement("div", {
6727
- style: {
6728
- background: background
6729
- }
6730
- }, /*#__PURE__*/React__default.createElement("div", {
6731
- className: "lg:block hidden lg:flex lg:flex-row justify-between h-20 items-center px-4 md:px-8 lg:px-12 xl:px-20",
6732
- style: {
6733
- background: bgSecondary,
6734
- color: textBody
6735
- }
6736
- }, /*#__PURE__*/React__default.createElement("a", {
6737
- href: "/",
6738
- className: "flex items-center"
6739
- }, /*#__PURE__*/React__default.createElement("img", {
6740
- className: "object-cover w-14 ",
6741
- src: "https://s3-alpha-sig.figma.com/img/05e9/1165/8608d0a8b864cc9e15fa74b32f8bfabc?Expires=1730073600&Key-Pair-Id=APKAQ4GOSFWCVNEHN3O4&Signature=qkNnTVXTSs7-CbaDRo5jFJm9a5drVP9BvVPKX8ToQS4fi0lKL0atq45SIxxzXQV21dgoMvHvNZwO5-lsnrq6hbeedSkTWSWLrU65pUy7X9W0d20kGMLnP5KH3RWdZ0bfgJ9ZvRBbsqMz1bIucbLNeAt8PLaHvLl4HLKz5qvKVbWb6j098vwScj6LI51qG2y01N9qu051QWzOj5ijYS7qWNXT1PTlf4o07xAThnGObDdatBIaocIQPno6srkWK~agAdBrW9IdE~l3UP5XBP~pR~zvLGiniYloQoDvAscoaYr2aTTjf6z9DQLl35WBbNGKrWcKFA80WAE69QdpNJxckQ__",
6742
- alt: ""
6743
- }), /*#__PURE__*/React__default.createElement("h3", {
6744
- className: "text-xl md:text-2xl whitespace-nowrap font-semibold ms-2",
6745
- style: {
6746
- color: primary
6747
- }
6748
- }, data !== null && data !== void 0 && data.sectionTitle ? data.sectionTitle : "Điện thoại Hải Anh")), /*#__PURE__*/React__default.createElement("div", {
6749
- className: " hidden lg:flex items-center py-8"
6750
- }, /*#__PURE__*/React__default.createElement("a", {
6751
- href: "/"
6752
- }, /*#__PURE__*/React__default.createElement("div", {
6753
- className: "border-b-2",
6754
- style: {
6755
- color: primary,
6756
- borderColor: primary
6757
- }
6758
- }, "Trang ch\u1EE7")), /*#__PURE__*/React__default.createElement("div", {
6759
- className: "relative group "
6760
- }, /*#__PURE__*/React__default.createElement("div", {
6761
- className: " mx-4 "
6762
- }, "Danh m\u1EE5c"), /*#__PURE__*/React__default.createElement("div", {
6763
- className: "absolute hidden grid group-hover:grid grid-cols-3 lg:w-[400px] 2xl:w-[600px] ms-4 py-2 px-2 gap-2 leading-10 rounded-xl z-50",
6764
- style: {
6765
- background: bgSecondary
6766
- }
6767
- }, categories && categories.length > 0 && categories.map(function (item) {
6768
- return /*#__PURE__*/React__default.createElement("div", {
6769
- key: "hover-" + item.categoryId,
6770
- className: "hover:bg-gray4 hover:text-white mx-auto px-6"
6771
- }, /*#__PURE__*/React__default.createElement("a", {
6772
- href: "#"
6773
- }, /*#__PURE__*/React__default.createElement("div", null, item.cateName)));
6774
- }))), /*#__PURE__*/React__default.createElement("a", {
6775
- href: "/introduction"
6776
- }, /*#__PURE__*/React__default.createElement("div", null, "Gi\u1EDBi thi\u1EC7u"))), /*#__PURE__*/React__default.createElement("div", {
6777
- className: " hidden xl:flex group "
6778
- }, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(FaPhone, {
6779
- className: "inline-block mb-1 me-2",
6780
- style: {
6781
- color: primary
6782
- }
6783
- }), " 0123456789"), /*#__PURE__*/React__default.createElement("div", {
6784
- className: "relative"
6785
- }, /*#__PURE__*/React__default.createElement("div", {
6786
- className: " ms-5"
6787
- }, /*#__PURE__*/React__default.createElement(IoLocationOutline, {
6788
- className: " inline-block\ttext-xl mb-1",
6789
- style: {
6790
- color: primary
6791
- }
6792
- }), " \u0110\u1ECBa ch\u1EC9 c\u1EEDa h\xE0ng"), /*#__PURE__*/React__default.createElement("div", {
6793
- className: "absolute grid grid-cols-1 hidden group-hover:grid w-[420px] ms-6 leading-6 rounded-xl z-50"
6794
- }))), /*#__PURE__*/React__default.createElement("div", {
6795
- className: "flex"
6796
- }, /*#__PURE__*/React__default.createElement("div", {
6797
- className: "relative"
6798
- }, /*#__PURE__*/React__default.createElement(PiHandbagSimpleLight, {
6799
- style: {
6800
- fontSize: "30px",
6801
- color: primary
6802
- }
6803
- }), /*#__PURE__*/React__default.createElement("small", {
6804
- className: " border leading-3 absolute flex items-center bg-red-500 px-[1px] text-sm rounded-full",
6805
- style: {
6806
- color: textButton,
6807
- fontSize: "10px",
6808
- width: "50%",
6809
- top: "1px",
6810
- right: "2px"
6811
- }
6812
- }, "11"))),
6813
- /*#__PURE__*/
6814
- React__default.createElement("div", {
6815
- className: "flex"
6816
- }, /*#__PURE__*/React__default.createElement("button", {
6817
- className: "me-3 p-2 rounded-lg ",
6818
- style: {
6819
- background: primary,
6820
- color: textButton
6821
- }
6822
- }, "\u0110\u0103ng nh\u1EADp"), /*#__PURE__*/React__default.createElement("button", {
6823
- className: "border rounded-lg p-2",
6824
- style: {
6825
- color: primary,
6826
- borderColor: primary
6827
- }
6828
- }, "\u0110\u0103ng k\xFD"))), /*#__PURE__*/React__default.createElement("div", {
6829
- className: "relative lg:hidden block flex justify-between items-center h-12 items-center px-4 md:px-8"
6830
- }, /*#__PURE__*/React__default.createElement("div", {
6831
- className: ""
6832
- }, isOpen === false ? /*#__PURE__*/React__default.createElement("button", {
6833
- type: "button",
6834
- onClick: function onClick() {
6835
- setIsOpen(true);
6836
- }
6837
- }, /*#__PURE__*/React__default.createElement(FiMenu, {
6838
- className: "text-3xl mt-2"
6839
- })) : /*#__PURE__*/React__default.createElement("div", {
6840
- className: "absolute h-screen top-0 -ms-4 md:-ms-8 lg:-ms-12 xl:-ms-20 py-4 w-[60vw] z-50 ",
6841
- style: {
6842
- background: bgSecondary
6843
- }
6844
- }, /*#__PURE__*/React__default.createElement("div", {
6845
- className: "flex justify-between items-center px-2 mb-6"
6846
- }, /*#__PURE__*/React__default.createElement("a", {
6847
- href: "/",
6848
- className: "flex items-center"
6849
- }, /*#__PURE__*/React__default.createElement("img", {
6850
- className: "object-cover w-14 ",
6851
- src: "https://s3-alpha-sig.figma.com/img/05e9/1165/8608d0a8b864cc9e15fa74b32f8bfabc?Expires=1730073600&Key-Pair-Id=APKAQ4GOSFWCVNEHN3O4&Signature=qkNnTVXTSs7-CbaDRo5jFJm9a5drVP9BvVPKX8ToQS4fi0lKL0atq45SIxxzXQV21dgoMvHvNZwO5-lsnrq6hbeedSkTWSWLrU65pUy7X9W0d20kGMLnP5KH3RWdZ0bfgJ9ZvRBbsqMz1bIucbLNeAt8PLaHvLl4HLKz5qvKVbWb6j098vwScj6LI51qG2y01N9qu051QWzOj5ijYS7qWNXT1PTlf4o07xAThnGObDdatBIaocIQPno6srkWK~agAdBrW9IdE~l3UP5XBP~pR~zvLGiniYloQoDvAscoaYr2aTTjf6z9DQLl35WBbNGKrWcKFA80WAE69QdpNJxckQ__",
6852
- alt: ""
6853
- }), /*#__PURE__*/React__default.createElement("h3", {
6854
- className: "text-xl md:text-2xl font-semibold ms-2",
6855
- style: {
6856
- color: primary
6857
- }
6858
- }, data !== null && data !== void 0 && data.sectionTitle ? data.sectionTitle : "Điện thoại Hải Anh")), /*#__PURE__*/React__default.createElement("button", {
6859
- className: "text-4xl text-gray3",
6860
- onClick: function onClick() {
6861
- setIsOpen(false);
7229
+ var config = _extends({
7230
+ baseURL: getBaseUrl()
7231
+ }, options, {
7232
+ paramsSerializer: function paramsSerializer(params) {
7233
+ return lib.stringify(params, {
7234
+ arrayFormat: "repeat"
7235
+ });
7236
+ },
7237
+ headers: _extends({}, options.headers)
7238
+ });
7239
+ return request(config);
7240
+ };
7241
+
7242
+ var getShopCategoriesApi = function getShopCategoriesApi(shopId, types) {
7243
+ return api({
7244
+ method: "get",
7245
+ url: "/landing-shop/get-product-category-on-landing",
7246
+ params: {
7247
+ shopId: shopId,
7248
+ types: types,
7249
+ isShowOnLanding: true
7250
+ },
7251
+ headers: {
7252
+ shopId: shopId
6862
7253
  }
6863
- }, /*#__PURE__*/React__default.createElement(RxCross2, null))), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
6864
- className: "col-span-4"
6865
- }, /*#__PURE__*/React__default.createElement("div", {
6866
- className: "lg:hidden flex flex-col gap-4"
6867
- }, /*#__PURE__*/React__default.createElement("a", {
6868
- href: "/"
6869
- }, /*#__PURE__*/React__default.createElement("div", {
6870
- className: " border-2 rounded-lg p-4"
6871
- }, "Trang ch\u1EE7")), /*#__PURE__*/React__default.createElement("a", {
6872
- href: "/product/category"
6873
- }, /*#__PURE__*/React__default.createElement("div", {
6874
- className: "border-2 rounded-lg p-4"
6875
- }, "Danh m\u1EE5c")), /*#__PURE__*/React__default.createElement("a", {
6876
- href: "/introduction"
6877
- }, /*#__PURE__*/React__default.createElement("div", {
6878
- className: "border-2 rounded-lg p-4"
6879
- }, "Gi\u1EDBi thi\u1EC7u"))))))), /*#__PURE__*/React__default.createElement("a", {
6880
- href: "/",
6881
- className: "flex items-center"
6882
- }, /*#__PURE__*/React__default.createElement("img", {
6883
- className: "object-cover w-12 md:w-14 ",
6884
- src: "https://s3-alpha-sig.figma.com/img/05e9/1165/8608d0a8b864cc9e15fa74b32f8bfabc?Expires=1730073600&Key-Pair-Id=APKAQ4GOSFWCVNEHN3O4&Signature=qkNnTVXTSs7-CbaDRo5jFJm9a5drVP9BvVPKX8ToQS4fi0lKL0atq45SIxxzXQV21dgoMvHvNZwO5-lsnrq6hbeedSkTWSWLrU65pUy7X9W0d20kGMLnP5KH3RWdZ0bfgJ9ZvRBbsqMz1bIucbLNeAt8PLaHvLl4HLKz5qvKVbWb6j098vwScj6LI51qG2y01N9qu051QWzOj5ijYS7qWNXT1PTlf4o07xAThnGObDdatBIaocIQPno6srkWK~agAdBrW9IdE~l3UP5XBP~pR~zvLGiniYloQoDvAscoaYr2aTTjf6z9DQLl35WBbNGKrWcKFA80WAE69QdpNJxckQ__",
6885
- alt: ""
6886
- }), /*#__PURE__*/React__default.createElement("h3", {
6887
- className: "text-xl md:text-2xl font-semibold ",
6888
- style: {
6889
- color: primary
7254
+ });
7255
+ };
7256
+ var getProductListApi = function getProductListApi(shopId, params) {
7257
+ if (params === void 0) {
7258
+ params = {};
7259
+ }
7260
+ return api({
7261
+ method: "get",
7262
+ url: "/landing-shop/get-product-on-landing",
7263
+ params: _extends({
7264
+ shopId: shopId,
7265
+ isShowOnLanding: true
7266
+ }, params),
7267
+ headers: {
7268
+ shopId: shopId
6890
7269
  }
6891
- }, data !== null && data !== void 0 && data.sectionTitle ? data.sectionTitle : "Điện thoại Hải Anh")), /*#__PURE__*/React__default.createElement("div", {
6892
- className: "relative"
6893
- }, /*#__PURE__*/React__default.createElement(PiHandbagSimpleLight, {
6894
- style: {
6895
- fontSize: "30px",
6896
- color: primary
7270
+ });
7271
+ };
7272
+ var getDetailProductApi = function getDetailProductApi(shopId, productId) {
7273
+ return api({
7274
+ method: "get",
7275
+ url: "/products/" + productId + "/shops/" + shopId + "/info",
7276
+ headers: {
7277
+ shopId: shopId
6897
7278
  }
6898
- }), /*#__PURE__*/React__default.createElement("small", {
6899
- className: " border leading-3 absolute flex items-center bg-red-500 px-[1px] text-sm rounded-full",
6900
- style: {
6901
- color: textButton,
6902
- fontSize: "10px",
6903
- width: "50%",
6904
- top: "1px",
6905
- right: "2px"
6906
- }
6907
- }, "11"))), /*#__PURE__*/React__default.createElement("div", {
6908
- div: true,
6909
- className: "grid grid-cols-12 flex items-center px-4 md:px-8 lg:px-12 xl:px-20 ",
6910
- style: {
6911
- background: primary,
6912
- color: textButton
7279
+ });
7280
+ };
7281
+
7282
+ var CategoryController = function CategoryController(props) {
7283
+ var shopConfig = props.shopConfig,
7284
+ _props$types = props.types,
7285
+ types = _props$types === void 0 ? "" : _props$types;
7286
+ var _useState = useState([]),
7287
+ categories = _useState[0],
7288
+ setCategories = _useState[1];
7289
+ useEffect(function () {
7290
+ getCategoryList();
7291
+ }, []);
7292
+ var getCategoryList = function getCategoryList() {
7293
+ try {
7294
+ var _temp = _catch(function () {
7295
+ return Promise.resolve(getShopCategoriesApi(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopId, types)).then(function (res) {
7296
+ var _res$data, _res$data$status;
7297
+ if ((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$status = _res$data.status) === null || _res$data$status === void 0 ? void 0 : _res$data$status.code) == 200) {
7298
+ var _res$data2, _res$data2$data;
7299
+ var mappingCategory = res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : (_res$data2$data = _res$data2.data) === null || _res$data2$data === void 0 ? void 0 : _res$data2$data.map(function (item) {
7300
+ return _extends({}, item, {
7301
+ label: item === null || item === void 0 ? void 0 : item.cateName,
7302
+ value: item === null || item === void 0 ? void 0 : item.categoryId
7303
+ });
7304
+ });
7305
+ setCategories(mappingCategory);
7306
+ }
7307
+ });
7308
+ }, function (e) {
7309
+ console.log(e);
7310
+ });
7311
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
7312
+ } catch (e) {
7313
+ return Promise.reject(e);
6913
7314
  }
6914
- }, /*#__PURE__*/React__default.createElement("div", {
6915
- className: "hidden md:grid md:grid-cols-12 flex items-center col-span-9 h-12 "
6916
- }, /*#__PURE__*/React__default.createElement("label", {
6917
- className: "lg:col-span-2 "
6918
- }, /*#__PURE__*/React__default.createElement(BsFilterLeft, {
6919
- className: "inline-block\t text-3xl"
6920
- }), " ", /*#__PURE__*/React__default.createElement("span", {
6921
- className: "hidden lg:inline-block whitespace-nowrap "
6922
- }, "Danh m\u1EE5c")), /*#__PURE__*/React__default.createElement("div", {
6923
- className: "overflow-hidden col-span-10 lg:col-span-9 lg:pe-6 w-full relative "
6924
- }, /*#__PURE__*/React__default.createElement("div", {
6925
- className: " flex my-auto h-full overflow-x-auto hide-scrollbar",
6926
- ref: listRef
6927
- }, categories && categories.length > 0 && categories.map(function (item) {
6928
- return /*#__PURE__*/React__default.createElement("button", {
6929
- key: "cateN-" + item.categoryId,
6930
- className: "items whitespace-nowrap border-r-2 border-r-white px-6 "
6931
- }, /*#__PURE__*/React__default.createElement("a", {
6932
- href: "/products/category?id=" + item.categoryId
6933
- }, item.cateName));
6934
- }))), /*#__PURE__*/React__default.createElement("div", {
6935
- className: "lg:block hidden lg:col-span-1 my-auto flex "
6936
- }, /*#__PURE__*/React__default.createElement("button", {
6937
- className: "",
6938
- onClick: handleClickPrevImg
6939
- }, /*#__PURE__*/React__default.createElement(FaChevronLeft, {
6940
- className: "inline-block\t text-2xl lg:me-2 xl:me-4 2xl:me-6"
6941
- })), /*#__PURE__*/React__default.createElement("button", {
6942
- onClick: handleClickNextImg
6943
- }, /*#__PURE__*/React__default.createElement(FaChevronRight, {
6944
- className: "inline-block\t text-2xl"
6945
- })))), /*#__PURE__*/React__default.createElement("div", {
6946
- className: "col-span-12 sm:col-span-3 my-auto relative py-2"
6947
- }, /*#__PURE__*/React__default.createElement("input", {
6948
- type: "text",
6949
- placeholder: "T\xECm ki\u1EBFm...",
6950
- className: "w-full sm:v-max md:h-10 h-8 lg:ms-6 ps-12 pb-1 border text-gray3 rounded-lg"
6951
- }), /*#__PURE__*/React__default.createElement(CiSearch, {
6952
- className: "absolute text-gray3 text-2xl left-4 lg:left-10 top-1/4 "
6953
- }))), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("img", {
6954
- className: "h-max",
6955
- src: sectionData && sectionData.length > 0 && sectionData[0].srcImages && sectionData[0].srcImages.length > 0 ? sectionData[0].srcImages[0] : "",
6956
- alt: ""
6957
- })));
7315
+ };
7316
+ return {
7317
+ categories: categories
7318
+ };
7319
+ };
7320
+
7321
+ var Hero13 = function Hero13(props) {
7322
+ var _sectionData$, _sectionData$$srcImag;
7323
+ var listRef = useRef(null);
7324
+ var _useState = useState(false);
7325
+ var data = props.data;
7326
+ var sectionData = data === null || data === void 0 ? void 0 : data.data;
7327
+ var _CategoryController = CategoryController(props);
7328
+ return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("img", {
7329
+ 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],
7330
+ className: "w-full"
7331
+ }));
6958
7332
  };
6959
7333
 
6960
7334
  var Features1 = function Features1(props) {
@@ -6984,7 +7358,13 @@ var Features1 = function Features1(props) {
6984
7358
  className: "absolute w-40 h-24 rounded-2xl z-10 bg-primary"
6985
7359
  }), /*#__PURE__*/React__default.createElement("div", {
6986
7360
  className: "absolute w-24 h-16 rounded-2xl -right-2 -top-2 z-0 bg-secondary"
6987
- }), /*#__PURE__*/React__default.createElement("div", {
7361
+ }), it !== null && it !== void 0 && it.svgImage ? /*#__PURE__*/React__default.createElement("div", {
7362
+ className: "w-12 text-primary h-16 w-16 z-20 m-auto"
7363
+ }, /*#__PURE__*/React__default.createElement("div", {
7364
+ dangerouslySetInnerHTML: {
7365
+ __html: configSvg(it === null || it === void 0 ? void 0 : it.svgImage)
7366
+ }
7367
+ })) : /*#__PURE__*/React__default.createElement("div", {
6988
7368
  className: "h-16 m-auto bg-center w-16 bg-cover bg-no-repeat z-20",
6989
7369
  style: {
6990
7370
  backgroundImage: "url(" + it.srcImage + ")"
@@ -7007,13 +7387,18 @@ var Features2 = function Features2(props) {
7007
7387
  return /*#__PURE__*/React__default.createElement("div", {
7008
7388
  className: "" + SECTION_DEFAULT_CLASS
7009
7389
  }, /*#__PURE__*/React__default.createElement("div", {
7010
- className: "p-6 grid grid-cols-4 gap-8 rounded-xl bg-bgSecondary"
7390
+ className: "p-6 grid grid-cols-2 md:grid-cols-4 gap-4 md:gap-6 lg:gap-8 rounded-xl bg-bgSecondary"
7011
7391
  }, sectionData && sectionData.length > 0 && sectionData.map(function (item, index) {
7012
7392
  return /*#__PURE__*/React__default.createElement("div", {
7013
7393
  className: "flex flex-col gap-2 items-center text-sm lg:text-lg font-semibold text-center",
7014
7394
  key: "dfgg-" + index
7015
- }, /*#__PURE__*/React__default.createElement("img", {
7016
- src: item === null || item === void 0 ? void 0 : item.svgImage,
7395
+ }, item !== null && item !== void 0 && item.svgImage ? /*#__PURE__*/React__default.createElement("div", {
7396
+ className: "w-12 text-primary md:w-16 lg:w-20 xl:w-24 h-24",
7397
+ dangerouslySetInnerHTML: {
7398
+ __html: configSvg(item === null || item === void 0 ? void 0 : item.svgImage)
7399
+ }
7400
+ }) : /*#__PURE__*/React__default.createElement("img", {
7401
+ src: item === null || item === void 0 ? void 0 : item.srcImage,
7017
7402
  className: "w-12 md:w-16 lg:w-20 xl:w-24 text-primary",
7018
7403
  alt: "logo"
7019
7404
  }), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.title));
@@ -7021,11 +7406,16 @@ var Features2 = function Features2(props) {
7021
7406
  };
7022
7407
 
7023
7408
  var Features3 = function Features3(props) {
7409
+ var _data$sectionTitle;
7024
7410
  var shopConfigStyle = props.shopConfigStyle,
7025
7411
  shopConfig = props.shopConfig,
7026
- data = props.data;
7412
+ data = props.data,
7413
+ _props$SectionTitle = props.SectionTitle,
7414
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
7415
+ _props$Link = props.Link,
7416
+ Link = _props$Link === void 0 ? null : _props$Link;
7027
7417
  var sectionData = data === null || data === void 0 ? void 0 : data.data;
7028
- data.sectionTitle = data.sectionTitle.replace("{shopName}", shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName);
7418
+ data.sectionTitle = data === null || data === void 0 ? void 0 : (_data$sectionTitle = data.sectionTitle) === null || _data$sectionTitle === void 0 ? void 0 : _data$sectionTitle.replace("{shopName}", shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName);
7029
7419
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
7030
7420
  _shopConfigStyle$colo3 = _shopConfigStyle$colo.textBody,
7031
7421
  textBody = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
@@ -7034,28 +7424,37 @@ var Features3 = function Features3(props) {
7034
7424
  _shopConfigStyle$colo5 = _shopConfigStyle$colo.bgSecondary,
7035
7425
  bgSecondary = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5;
7036
7426
  return /*#__PURE__*/React__default.createElement("div", {
7037
- className: " w-full pt-10 px-4 xl:px-20",
7427
+ className: SECTION_DEFAULT_CLASS + " flex flex-col gap-4 lg:gap-6",
7038
7428
  style: {
7039
7429
  background: background,
7040
7430
  color: textBody
7041
7431
  }
7042
- }, /*#__PURE__*/React__default.createElement("h2", {
7043
- className: "text-2xl md:text-3xl lg:text-4xl font-semibold mb-6"
7044
- }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement("p", {
7045
- className: "text-gray3 text-lg sm:text-xl md:text-2xl"
7046
- }, data === null || data === void 0 ? void 0 : data.sectionDescription), /*#__PURE__*/React__default.createElement("div", {
7047
- className: "grid grid-cols-2 sm:grid-cols-4 gap-6 mt-6 text-sm md:text-base"
7432
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
7433
+ data: data,
7434
+ shopConfigStyle: shopConfigStyle
7435
+ }), /*#__PURE__*/React__default.createElement("div", {
7436
+ className: "grid grid-cols-2 sm:grid-cols-4 gap-6 text-sm md:text-base"
7048
7437
  }, sectionData && sectionData.length > 0 && sectionData.map(function (item, index) {
7049
- return /*#__PURE__*/React__default.createElement("div", {
7438
+ return /*#__PURE__*/React__default.createElement(LinkToPage, {
7439
+ Link: Link,
7440
+ href: (item === null || item === void 0 ? void 0 : item.link) || (item === null || item === void 0 ? void 0 : item.route)
7441
+ }, /*#__PURE__*/React__default.createElement("div", {
7050
7442
  className: "grid grid-cols-2 p-3 rounded-lg font-semibold",
7051
7443
  key: "dfsdfj-" + index,
7052
7444
  style: {
7053
7445
  background: bgSecondary
7054
7446
  }
7055
- }, /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.title), /*#__PURE__*/React__default.createElement("img", {
7447
+ }, /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.title), item !== null && item !== void 0 && item.svgImage ? /*#__PURE__*/React__default.createElement("div", {
7448
+ className: "w-12 text-primary md:w-20 lg:w-24 xl:w-32 h-auto"
7449
+ }, /*#__PURE__*/React__default.createElement("div", {
7450
+ dangerouslySetInnerHTML: {
7451
+ __html: configSvg(item === null || item === void 0 ? void 0 : item.svgImage)
7452
+ }
7453
+ })) : /*#__PURE__*/React__default.createElement("img", {
7056
7454
  src: item === null || item === void 0 ? void 0 : item.srcImage,
7455
+ className: "w-12 text-primary md:w-20 lg:w-24 xl:w-32 object-cover",
7057
7456
  alt: ""
7058
- }));
7457
+ })));
7059
7458
  })));
7060
7459
  };
7061
7460
 
@@ -7085,8 +7484,8 @@ var ProductController = function ProductController(props) {
7085
7484
  }, [params, isAutoGetList]);
7086
7485
  var getProductList = function getProductList() {
7087
7486
  try {
7487
+ setLoading(true);
7088
7488
  var _temp = _catch(function () {
7089
- setLoading(true);
7090
7489
  var filterParams = _extends({}, defaultParams, params);
7091
7490
  console.log("filterParams params", params);
7092
7491
  console.log("filterParams", filterParams);
@@ -7100,6 +7499,7 @@ var ProductController = function ProductController(props) {
7100
7499
  setLoading(false);
7101
7500
  });
7102
7501
  }, function (e) {
7502
+ setLoading(false);
7103
7503
  console.log(e);
7104
7504
  });
7105
7505
  return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
@@ -7107,10 +7507,35 @@ var ProductController = function ProductController(props) {
7107
7507
  return Promise.reject(e);
7108
7508
  }
7109
7509
  };
7510
+ var getProductListSearch = function getProductListSearch(data) {
7511
+ try {
7512
+ setLoading(true);
7513
+ return Promise.resolve(_catch(function () {
7514
+ var filterParams = _extends({}, defaultParams, data);
7515
+ return Promise.resolve(getProductListApi(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopId, filterParams)).then(function (res) {
7516
+ var _res$data4, _res$data4$status;
7517
+ if ((res === null || res === void 0 ? void 0 : (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : (_res$data4$status = _res$data4.status) === null || _res$data4$status === void 0 ? void 0 : _res$data4$status.code) == 200) {
7518
+ var _res$data5;
7519
+ setLoading(false);
7520
+ return res === null || res === void 0 ? void 0 : (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.data;
7521
+ } else {
7522
+ setLoading(false);
7523
+ return [];
7524
+ }
7525
+ });
7526
+ }, function (e) {
7527
+ setLoading(false);
7528
+ console.log(e);
7529
+ }));
7530
+ } catch (e) {
7531
+ return Promise.reject(e);
7532
+ }
7533
+ };
7110
7534
  return {
7111
7535
  products: products,
7112
7536
  loading: loading,
7113
- page: page
7537
+ page: page,
7538
+ getProductListSearch: getProductListSearch
7114
7539
  };
7115
7540
  };
7116
7541
 
@@ -7293,156 +7718,32 @@ var BookingController = function BookingController(props) {
7293
7718
  var createSchedule = function createSchedule(customerName, customerPhone, scheduleDate, services, shopId) {
7294
7719
  try {
7295
7720
  return Promise.resolve(_catch(function () {
7721
+ var _Date;
7296
7722
  var data = {
7297
7723
  appId: "SSPA",
7298
7724
  customerName: customerName,
7299
- customerPhone: customerPhone.replace("+", ""),
7725
+ customerPhone: customerPhone === null || customerPhone === void 0 ? void 0 : customerPhone.replace("+", ""),
7300
7726
  isSellService: true,
7301
- scheduleDate: new Date(scheduleDate).getTime(),
7727
+ scheduleDate: (_Date = new Date(scheduleDate)) === null || _Date === void 0 ? void 0 : _Date.getTime(),
7302
7728
  services: services === null || services === void 0 ? void 0 : services.map(function (_ref) {
7303
7729
  var productName = _ref.productName,
7304
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
7305
- return rest;
7306
- }),
7307
- shopId: shopId
7308
- };
7309
- return Promise.resolve(createSpaScheduleApi(shopId, data));
7310
- }, function (e) {
7311
- console.log(e);
7312
- }));
7313
- } catch (e) {
7314
- return Promise.reject(e);
7315
- }
7316
- };
7317
- return {
7318
- createSchedule: createSchedule
7319
- };
7320
- };
7321
-
7322
- var Input = forwardRef(function (props, ref) {
7323
- var _props$label = props.label,
7324
- label = _props$label === void 0 ? "" : _props$label,
7325
- _props$placeholder = props.placeholder,
7326
- placeholder = _props$placeholder === void 0 ? "" : _props$placeholder,
7327
- _props$className = props.className,
7328
- className = _props$className === void 0 ? "" : _props$className,
7329
- _props$inputClassName = props.inputClassName,
7330
- inputClassName = _props$inputClassName === void 0 ? "" : _props$inputClassName,
7331
- _props$wrapClassName = props.wrapClassName,
7332
- wrapClassName = _props$wrapClassName === void 0 ? "" : _props$wrapClassName,
7333
- _props$labelClassName = props.labelClassName,
7334
- labelClassName = _props$labelClassName === void 0 ? "" : _props$labelClassName,
7335
- _props$name = props.name,
7336
- name = _props$name === void 0 ? "" : _props$name,
7337
- _props$onChange = props.onChange,
7338
- onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
7339
- _props$defaultValue = props.defaultValue,
7340
- defaultValue = _props$defaultValue === void 0 ? "" : _props$defaultValue,
7341
- _props$type = props.type,
7342
- type = _props$type === void 0 ? "text" : _props$type,
7343
- _props$rules = props.rules,
7344
- rules = _props$rules === void 0 ? [] : _props$rules,
7345
- _props$isQuantity = props.isQuantity,
7346
- isQuantity = _props$isQuantity === void 0 ? false : _props$isQuantity,
7347
- _props$min = props.min,
7348
- min = _props$min === void 0 ? 0 : _props$min,
7349
- _props$max = props.max,
7350
- max = _props$max === void 0 ? null : _props$max;
7351
- var _useState = useState(defaultValue),
7352
- value = _useState[0],
7353
- _setValue = _useState[1];
7354
- var _useState2 = useState(""),
7355
- error = _useState2[0],
7356
- _setError = _useState2[1];
7357
- var refInput = useRef();
7358
- useImperativeHandle(ref, function () {
7359
- return {
7360
- validateData: function validateData() {
7361
- return _validateData();
7362
- },
7363
- setValue: function setValue(text) {
7364
- return _setValue(text);
7365
- },
7366
- getValue: function getValue() {
7367
- return value;
7368
- },
7369
- setError: function setError(err) {
7370
- return _setError(err);
7371
- }
7372
- };
7373
- });
7374
- var _validateData = function _validateData() {
7375
- var count = 0;
7376
- for (var _iterator = _createForOfIteratorHelperLoose(rules), _step; !(_step = _iterator()).done;) {
7377
- var _e$pattern;
7378
- var e = _step.value;
7379
- if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && value === '') {
7380
- _setError(e === null || e === void 0 ? void 0 : e.message);
7381
- count++;
7382
- break;
7383
- } else if ((e === null || e === void 0 ? void 0 : e.type) === 'pattern' && !(e !== null && e !== void 0 && (_e$pattern = e.pattern) !== null && _e$pattern !== void 0 && _e$pattern.test(value))) {
7384
- _setError(e === null || e === void 0 ? void 0 : e.message);
7385
- count++;
7386
- break;
7387
- }
7388
- }
7389
- if (count) {
7390
- return false;
7391
- } else {
7392
- _setError('');
7393
- return true;
7394
- }
7395
- };
7396
- var handleOnChange = function handleOnChange(event) {
7397
- var value = event.target.value;
7398
- if (isQuantity) {
7399
- value = parseInt(value) || 1;
7730
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
7731
+ return rest;
7732
+ }),
7733
+ shopId: shopId
7734
+ };
7735
+ return Promise.resolve(createSpaScheduleApi(shopId, data));
7736
+ }, function (e) {
7737
+ console.log(e);
7738
+ }));
7739
+ } catch (e) {
7740
+ return Promise.reject(e);
7400
7741
  }
7401
- _setValue(value);
7402
- onChange === null || onChange === void 0 ? void 0 : onChange(value);
7403
7742
  };
7404
- var changeQuantity = function changeQuantity(quantity) {
7405
- var newValue = parseInt(value) + quantity;
7406
- if (newValue > min && (max === null || newValue <= max)) {
7407
- _setValue(newValue);
7408
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
7409
- }
7743
+ return {
7744
+ createSchedule: createSchedule
7410
7745
  };
7411
- var _className = "h-10 py-1 px-2 border border-stroke rounded " + className;
7412
- var _inputClassName = (isQuantity ? "text-center w-12" : "") + " " + inputClassName + " focus:outline-none focus:ring-0";
7413
- var required = !!(rules !== null && rules !== void 0 && rules.find(function (e) {
7414
- return (e === null || e === void 0 ? void 0 : e.type) === "required";
7415
- }));
7416
- var labelRequired = required ? /*#__PURE__*/React__default.createElement("span", {
7417
- className: "text-danger"
7418
- }, " *") : null;
7419
- return /*#__PURE__*/React__default.createElement("div", {
7420
- className: wrapClassName
7421
- }, label ? /*#__PURE__*/React__default.createElement("div", {
7422
- className: "mb-1 " + labelClassName
7423
- }, label, labelRequired) : null, /*#__PURE__*/React__default.createElement("div", {
7424
- className: "flex gap-2 " + _className
7425
- }, isQuantity ? /*#__PURE__*/React__default.createElement("button", {
7426
- onClick: function onClick() {
7427
- return changeQuantity(-1);
7428
- }
7429
- }, /*#__PURE__*/React__default.createElement(FaMinus, null)) : null, /*#__PURE__*/React__default.createElement("input", {
7430
- type: type,
7431
- name: name,
7432
- value: value,
7433
- placeholder: placeholder,
7434
- onChange: handleOnChange,
7435
- required: required,
7436
- className: _inputClassName,
7437
- ref: refInput
7438
- }), isQuantity ? /*#__PURE__*/React__default.createElement("button", {
7439
- onClick: function onClick() {
7440
- return changeQuantity(1);
7441
- }
7442
- }, /*#__PURE__*/React__default.createElement(FaPlus, null)) : null), error ? /*#__PURE__*/React__default.createElement("div", {
7443
- className: "text-danger"
7444
- }, error) : null);
7445
- });
7746
+ };
7446
7747
 
7447
7748
  var Select = forwardRef(function (props, ref) {
7448
7749
  var _props$label = props.label,
@@ -7453,14 +7754,18 @@ var Select = forwardRef(function (props, ref) {
7453
7754
  placeholder = _props$placeholder === void 0 ? "" : _props$placeholder,
7454
7755
  _props$className = props.className,
7455
7756
  className = _props$className === void 0 ? "" : _props$className,
7757
+ _props$optionClassNam = props.optionClassName,
7758
+ optionClassName = _props$optionClassNam === void 0 ? "" : _props$optionClassNam,
7759
+ _props$wrapClassName = props.wrapClassName,
7760
+ wrapClassName = _props$wrapClassName === void 0 ? "" : _props$wrapClassName,
7761
+ _props$selectClassNam = props.selectClassName,
7762
+ selectClassName = _props$selectClassNam === void 0 ? "" : _props$selectClassNam,
7456
7763
  _props$rules = props.rules,
7457
7764
  rules = _props$rules === void 0 ? [] : _props$rules,
7458
7765
  options = props.options,
7459
7766
  _props$defaultValue = props.defaultValue,
7460
7767
  defaultValue = _props$defaultValue === void 0 ? {} : _props$defaultValue,
7461
7768
  handleSearchOption = props.handleSearchOption,
7462
- _props$wrapClassName = props.wrapClassName,
7463
- wrapClassName = _props$wrapClassName === void 0 ? "" : _props$wrapClassName,
7464
7769
  _props$isMulti = props.isMulti,
7465
7770
  isMulti = _props$isMulti === void 0 ? false : _props$isMulti,
7466
7771
  _props$onClick = props.onClick,
@@ -7470,7 +7775,8 @@ var Select = forwardRef(function (props, ref) {
7470
7775
  _props$funcDelete = props.funcDelete,
7471
7776
  funcDelete = _props$funcDelete === void 0 ? function () {} : _props$funcDelete,
7472
7777
  _props$isSearch = props.isSearch,
7473
- isSearch = _props$isSearch === void 0 ? true : _props$isSearch;
7778
+ isSearch = _props$isSearch === void 0 ? true : _props$isSearch,
7779
+ renderItem = props.renderItem;
7474
7780
  var _useState = useState(false),
7475
7781
  isOpen = _useState[0],
7476
7782
  setIsOpen = _useState[1];
@@ -7492,21 +7798,12 @@ var Select = forwardRef(function (props, ref) {
7492
7798
  dropdownPosition = _useState6[0],
7493
7799
  setDropdownPosition = _useState6[1];
7494
7800
  var inputRef = useRef(null);
7495
- useEffect(function () {
7496
- if (isMulti) return;else {
7497
- setIsOpen(false);
7498
- setInputSearch("");
7499
- setListOptions(options);
7500
- }
7501
- }, [value]);
7502
7801
  useEffect(function () {
7503
7802
  if (isMulti) setValue(defaultValue);
7504
7803
  }, [defaultValue]);
7505
7804
  useEffect(function () {
7506
7805
  setListOptions(options);
7507
- if (!isMulti) {
7508
- setValue({});
7509
- }
7806
+ if (!isMulti) setValue(defaultValue);
7510
7807
  }, [options]);
7511
7808
  useEffect(function () {
7512
7809
  var _inputRef$current;
@@ -7611,8 +7908,12 @@ var Select = forwardRef(function (props, ref) {
7611
7908
  });
7612
7909
  return (value === null || value === void 0 ? void 0 : value.value) == valueId;
7613
7910
  };
7614
- var handleSelection = function handleSelection(item) {
7615
- if (isMulti === false) setValue(item);
7911
+ var handleSelection = function handleSelection(item, e) {
7912
+ e.stopPropagation();
7913
+ if (!isMulti) {
7914
+ setValue(item);
7915
+ setIsOpen(false);
7916
+ }
7616
7917
  onClick === null || onClick === void 0 ? void 0 : onClick(item);
7617
7918
  };
7618
7919
  var handleDeleteSelection = function handleDeleteSelection(e, item) {
@@ -7628,21 +7929,24 @@ var Select = forwardRef(function (props, ref) {
7628
7929
  }, " *") : null;
7629
7930
  return /*#__PURE__*/React__default.createElement("div", {
7630
7931
  ref: selectRef,
7631
- className: wrapClassName + " relative "
7932
+ className: "relative " + wrapClassName
7632
7933
  }, label ? /*#__PURE__*/React__default.createElement("div", {
7633
- className: labelClassName + " mb-1"
7934
+ className: "mb-1 " + labelClassName
7634
7935
  }, label, " ", labelRequired) : null, /*#__PURE__*/React__default.createElement("div", {
7635
- className: className + " flex flex-col gap-2 rounded-lg"
7936
+ className: "flex flex-col gap-2 rounded-lg w-full bg-white border " + className
7636
7937
  }, /*#__PURE__*/React__default.createElement("button", {
7637
- className: "w-full h-10 bg-transparent flex justify-between items-center px-3 py-2",
7938
+ className: "w-full h-10 bg-transparent flex justify-between items-center px-3 py-2 " + selectClassName,
7638
7939
  onClick: handleToggleSelect
7639
7940
  }, /*#__PURE__*/React__default.createElement("div", {
7640
7941
  className: "flex justify-between items-center w-full"
7641
7942
  }, isEmpty(value) || isMulti ? /*#__PURE__*/React__default.createElement("div", {
7642
7943
  className: "text-gray3 line-clamp-1"
7643
7944
  }, placeholder) : /*#__PURE__*/React__default.createElement("div", {
7644
- className: "line-clamp-1"
7645
- }, value === null || value === void 0 ? void 0 : value.label), isButtonDelete && !isEmpty(value) ? /*#__PURE__*/React__default.createElement("div", {
7945
+ className: "w-full text-start pointer-events-none line-clamp-1",
7946
+ dangerouslySetInnerHTML: {
7947
+ __html: value === null || value === void 0 ? void 0 : value.label
7948
+ }
7949
+ }), isButtonDelete && !isEmpty(value) ? /*#__PURE__*/React__default.createElement("div", {
7646
7950
  onClick: function onClick(e) {
7647
7951
  handleDeleteSelection(e, value);
7648
7952
  }
@@ -7657,7 +7961,7 @@ var Select = forwardRef(function (props, ref) {
7657
7961
  style: {
7658
7962
  background: "#FFFFFF"
7659
7963
  },
7660
- className: className + " overflow-y-auto max-h-72 absolute p-1 my-2 rounded-2xl w-full z-50 border " + (dropdownPosition === 'top' ? 'bottom-full mb-2' : 'top-full mt-2')
7964
+ className: "overflow-y-auto max-h-72 absolute p-1 my-2 rounded-2xl w-full z-50 border " + (dropdownPosition === 'top' ? 'bottom-full mb-2' : 'top-full mt-2') + " " + optionClassName
7661
7965
  }, /*#__PURE__*/React__default.createElement("div", null, isSearch ? /*#__PURE__*/React__default.createElement("div", {
7662
7966
  className: "px-3 flex items-center border-b-[1px]"
7663
7967
  }, /*#__PURE__*/React__default.createElement(LuSearch, {
@@ -7675,12 +7979,12 @@ var Select = forwardRef(function (props, ref) {
7675
7979
  return /*#__PURE__*/React__default.createElement("div", {
7676
7980
  key: "gjfd-" + index,
7677
7981
  className: "px-2 cursor-default py-1.5 flex items-center hover:bg-gray-100 rounded-lg",
7678
- onClick: function onClick() {
7679
- handleSelection(item);
7982
+ onClick: function onClick(e) {
7983
+ handleSelection(item, e);
7680
7984
  }
7681
7985
  }, /*#__PURE__*/React__default.createElement(IoMdCheckmark, {
7682
7986
  className: (checkSelection(item === null || item === void 0 ? void 0 : item.value) ? "" : 'invisible') + " inline me-2 w-4"
7683
- }), /*#__PURE__*/React__default.createElement("div", {
7987
+ }), renderItem ? renderItem(item) : /*#__PURE__*/React__default.createElement("div", {
7684
7988
  className: " whitespace-nowrap line-clamp-1"
7685
7989
  }, item === null || item === void 0 ? void 0 : item.label));
7686
7990
  }) : /*#__PURE__*/React__default.createElement("div", {
@@ -7696,6 +8000,8 @@ var DateTimePicker = forwardRef(function (props, ref) {
7696
8000
  label = _props$label === void 0 ? "" : _props$label,
7697
8001
  _props$className = props.className,
7698
8002
  className = _props$className === void 0 ? "" : _props$className,
8003
+ _props$labelClassName = props.labelClassName,
8004
+ labelClassName = _props$labelClassName === void 0 ? "" : _props$labelClassName,
7699
8005
  _props$defaultValue = props.defaultValue,
7700
8006
  defaultValue = _props$defaultValue === void 0 ? new Date() : _props$defaultValue,
7701
8007
  rules = props.rules;
@@ -7734,7 +8040,7 @@ var DateTimePicker = forwardRef(function (props, ref) {
7734
8040
  });
7735
8041
  var _validateData = function _validateData() {
7736
8042
  var count = 0;
7737
- rules.forEach(function (e) {
8043
+ rules === null || rules === void 0 ? void 0 : rules.forEach(function (e) {
7738
8044
  var _e$pattern;
7739
8045
  if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && value === '') {
7740
8046
  _setError(e === null || e === void 0 ? void 0 : e.message);
@@ -7762,7 +8068,7 @@ var DateTimePicker = forwardRef(function (props, ref) {
7762
8068
  return /*#__PURE__*/React__default.createElement("div", {
7763
8069
  className: "w-full"
7764
8070
  }, label ? /*#__PURE__*/React__default.createElement("div", {
7765
- className: "mb-1"
8071
+ className: "mb-1 " + labelClassName
7766
8072
  }, label, labelRequired) : null, /*#__PURE__*/React__default.createElement(DatePicker, {
7767
8073
  selected: value,
7768
8074
  onChange: function onChange(date) {
@@ -7795,12 +8101,22 @@ var InputPhoneNumber = forwardRef(function (props, ref) {
7795
8101
  rules = _props$rules === void 0 ? [] : _props$rules,
7796
8102
  _props$wrapClassName = props.wrapClassName,
7797
8103
  wrapClassName = _props$wrapClassName === void 0 ? "" : _props$wrapClassName,
7798
- inputClassName = props.inputClassName;
7799
- var _useState = useState(defaultValue),
8104
+ _props$inputClassName = props.inputClassName,
8105
+ inputClassName = _props$inputClassName === void 0 ? "" : _props$inputClassName,
8106
+ _props$labelClassName = props.labelClassName,
8107
+ labelClassName = _props$labelClassName === void 0 ? "" : _props$labelClassName,
8108
+ _props$options = props.options,
8109
+ options = _props$options === void 0 ? [{
8110
+ label: "<svg width=\"20\" height=\"20\" viewBox=\"0 0 36 36\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-hidden=\"true\" role=\"img\" class=\"iconify iconify--twemoji\" preserveAspectRatio=\"xMidYMid meet\"><path fill=\"#DA251D\" d=\"M32 5H4a4 4 0 0 0-4 4v18a4 4 0 0 0 4 4h28a4 4 0 0 0 4-4V9a4 4 0 0 0-4-4z\"></path><path fill=\"#FF0\" d=\"M19.753 16.037L18 10.642l-1.753 5.395h-5.672l4.589 3.333l-1.753 5.395L18 21.431l4.589 3.334l-1.753-5.395l4.589-3.333z\"></path></svg>",
8111
+ country: "Việt Nam",
8112
+ value: "+84"
8113
+ }] : _props$options;
8114
+ var _useState = useState(""),
7800
8115
  value = _useState[0],
7801
8116
  _setValue = _useState[1];
7802
8117
  var _useState2 = useState({
7803
- label: "+84",
8118
+ label: "<svg width=\"20\" height=\"20\" viewBox=\"0 0 36 36\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-hidden=\"true\" role=\"img\" class=\"iconify iconify--twemoji\" preserveAspectRatio=\"xMidYMid meet\"><path fill=\"#DA251D\" d=\"M32 5H4a4 4 0 0 0-4 4v18a4 4 0 0 0 4 4h28a4 4 0 0 0 4-4V9a4 4 0 0 0-4-4z\"></path><path fill=\"#FF0\" d=\"M19.753 16.037L18 10.642l-1.753 5.395h-5.672l4.589 3.333l-1.753 5.395L18 21.431l4.589 3.334l-1.753-5.395l4.589-3.333z\"></path></svg>",
8119
+ country: "Việt Nam",
7804
8120
  value: "+84"
7805
8121
  }),
7806
8122
  countryCode = _useState2[0],
@@ -7808,6 +8124,11 @@ var InputPhoneNumber = forwardRef(function (props, ref) {
7808
8124
  var _useState3 = useState(""),
7809
8125
  error = _useState3[0],
7810
8126
  _setError = _useState3[1];
8127
+ useEffect(function () {
8128
+ if (defaultValue) {
8129
+ _setValue("+" + defaultValue);
8130
+ }
8131
+ }, []);
7811
8132
  var handleOnChange = function handleOnChange(event) {
7812
8133
  var value = event.target.value;
7813
8134
  _setValue(value);
@@ -7822,8 +8143,10 @@ var InputPhoneNumber = forwardRef(function (props, ref) {
7822
8143
  return _setValue(text);
7823
8144
  },
7824
8145
  getValue: function getValue() {
7825
- var phoneNumber = (countryCode === null || countryCode === void 0 ? void 0 : countryCode.value) + (value === null || value === void 0 ? void 0 : value.slice(1));
7826
- return phoneNumber;
8146
+ if (!(value !== null && value !== void 0 && value.startsWith(countryCode === null || countryCode === void 0 ? void 0 : countryCode.value))) {
8147
+ return (countryCode === null || countryCode === void 0 ? void 0 : countryCode.value) + (value === null || value === void 0 ? void 0 : value.replace(/^0/, ''));
8148
+ }
8149
+ return value;
7827
8150
  },
7828
8151
  setError: function setError(err) {
7829
8152
  return _setError(err);
@@ -7858,25 +8181,37 @@ var InputPhoneNumber = forwardRef(function (props, ref) {
7858
8181
  var labelRequired = required ? /*#__PURE__*/React__default.createElement("span", {
7859
8182
  className: "text-danger"
7860
8183
  }, " *") : null;
7861
- var _inputClassName = "h-10 px-2 focus:outline-none focus:ring-0 " + inputClassName;
7862
- var data = useCallback([{
7863
- label: "+84",
7864
- value: "+84"
7865
- }], []);
8184
+ var _inputClassName = "h-full w-full px-2 focus:outline-none focus:ring-0 " + inputClassName;
7866
8185
  return /*#__PURE__*/React__default.createElement("div", {
7867
- className: wrapClassName + " flex flex-col"
8186
+ className: "flex flex-col " + wrapClassName
7868
8187
  }, label ? /*#__PURE__*/React__default.createElement("label", {
7869
- className: "mb-1"
8188
+ className: "mb-1 " + labelClassName
7870
8189
  }, label, labelRequired) : null, /*#__PURE__*/React__default.createElement("div", {
7871
- className: "flex items-center h-10 rounded-lg px-2 py-1 " + className
8190
+ className: "flex items-center h-10 rounded-lg border " + className
7872
8191
  }, /*#__PURE__*/React__default.createElement("button", {
7873
- className: "flex items-center border-r-2"
8192
+ className: "border-r-2 "
7874
8193
  }, /*#__PURE__*/React__default.createElement(Select$1, {
7875
- className: 'w-max',
8194
+ className: 'w-max border-0 !rounded-none !rounded-l-lg',
7876
8195
  defaultValue: countryCode,
7877
- options: data,
8196
+ options: options,
8197
+ optionClassName: "w-max",
7878
8198
  placeholder: "+84",
7879
- onClick: setCountryCode
8199
+ onClick: setCountryCode,
8200
+ selectClassName: "h-full !rounded-none py-[7px] ps-2 pr-1",
8201
+ renderItem: function renderItem(item) {
8202
+ return /*#__PURE__*/React__default.createElement("div", {
8203
+ className: "flex gap-3 items-center w-full"
8204
+ }, /*#__PURE__*/React__default.createElement("div", {
8205
+ dangerouslySetInnerHTML: {
8206
+ __html: item === null || item === void 0 ? void 0 : item.label
8207
+ }
8208
+ }), /*#__PURE__*/React__default.createElement("div", {
8209
+ className: "text-start flex-1 text-sm"
8210
+ }, item === null || item === void 0 ? void 0 : item.country), /*#__PURE__*/React__default.createElement("div", {
8211
+ className: "text-gray3"
8212
+ }, item === null || item === void 0 ? void 0 : item.value));
8213
+ },
8214
+ wrapClassName: "w-full"
7880
8215
  })), /*#__PURE__*/React__default.createElement("input", {
7881
8216
  type: type,
7882
8217
  name: name,
@@ -7884,7 +8219,7 @@ var InputPhoneNumber = forwardRef(function (props, ref) {
7884
8219
  placeholder: placeholder,
7885
8220
  onChange: handleOnChange,
7886
8221
  required: required,
7887
- className: _inputClassName
8222
+ className: "bg-white rounded-r-lg " + _inputClassName
7888
8223
  })), error ? /*#__PURE__*/React__default.createElement("div", {
7889
8224
  className: "text-danger"
7890
8225
  }, error) : null);
@@ -7899,7 +8234,7 @@ var formatCurrency = function formatCurrency(amount) {
7899
8234
  return formattedAmount + " \u20AB";
7900
8235
  };
7901
8236
  var pattern = {
7902
- phoneNumberPattern: /^0[0-9]{9}$/
8237
+ phoneNumberPattern: /^(?:\+84|0)\d{9}$/
7903
8238
  };
7904
8239
  var numberPattern = /^\d+$/;
7905
8240
 
@@ -7907,6 +8242,147 @@ var dayjs_min = createCommonjsModule(function (module, exports) {
7907
8242
  !function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
7908
8243
  });
7909
8244
 
8245
+ var js_cookie = createCommonjsModule(function (module, exports) {
8246
+ (function (global, factory) {
8247
+ module.exports = factory() ;
8248
+ })(commonjsGlobal, (function () {
8249
+ /* eslint-disable no-var */
8250
+ function assign (target) {
8251
+ for (var i = 1; i < arguments.length; i++) {
8252
+ var source = arguments[i];
8253
+ for (var key in source) {
8254
+ target[key] = source[key];
8255
+ }
8256
+ }
8257
+ return target
8258
+ }
8259
+ /* eslint-enable no-var */
8260
+
8261
+ /* eslint-disable no-var */
8262
+ var defaultConverter = {
8263
+ read: function (value) {
8264
+ if (value[0] === '"') {
8265
+ value = value.slice(1, -1);
8266
+ }
8267
+ return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent)
8268
+ },
8269
+ write: function (value) {
8270
+ return encodeURIComponent(value).replace(
8271
+ /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
8272
+ decodeURIComponent
8273
+ )
8274
+ }
8275
+ };
8276
+ /* eslint-enable no-var */
8277
+
8278
+ /* eslint-disable no-var */
8279
+
8280
+ function init (converter, defaultAttributes) {
8281
+ function set (name, value, attributes) {
8282
+ if (typeof document === 'undefined') {
8283
+ return
8284
+ }
8285
+
8286
+ attributes = assign({}, defaultAttributes, attributes);
8287
+
8288
+ if (typeof attributes.expires === 'number') {
8289
+ attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
8290
+ }
8291
+ if (attributes.expires) {
8292
+ attributes.expires = attributes.expires.toUTCString();
8293
+ }
8294
+
8295
+ name = encodeURIComponent(name)
8296
+ .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)
8297
+ .replace(/[()]/g, escape);
8298
+
8299
+ var stringifiedAttributes = '';
8300
+ for (var attributeName in attributes) {
8301
+ if (!attributes[attributeName]) {
8302
+ continue
8303
+ }
8304
+
8305
+ stringifiedAttributes += '; ' + attributeName;
8306
+
8307
+ if (attributes[attributeName] === true) {
8308
+ continue
8309
+ }
8310
+
8311
+ // Considers RFC 6265 section 5.2:
8312
+ // ...
8313
+ // 3. If the remaining unparsed-attributes contains a %x3B (";")
8314
+ // character:
8315
+ // Consume the characters of the unparsed-attributes up to,
8316
+ // not including, the first %x3B (";") character.
8317
+ // ...
8318
+ stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
8319
+ }
8320
+
8321
+ return (document.cookie =
8322
+ name + '=' + converter.write(value, name) + stringifiedAttributes)
8323
+ }
8324
+
8325
+ function get (name) {
8326
+ if (typeof document === 'undefined' || (arguments.length && !name)) {
8327
+ return
8328
+ }
8329
+
8330
+ // To prevent the for loop in the first place assign an empty array
8331
+ // in case there are no cookies at all.
8332
+ var cookies = document.cookie ? document.cookie.split('; ') : [];
8333
+ var jar = {};
8334
+ for (var i = 0; i < cookies.length; i++) {
8335
+ var parts = cookies[i].split('=');
8336
+ var value = parts.slice(1).join('=');
8337
+
8338
+ try {
8339
+ var found = decodeURIComponent(parts[0]);
8340
+ jar[found] = converter.read(value, found);
8341
+
8342
+ if (name === found) {
8343
+ break
8344
+ }
8345
+ } catch (e) {}
8346
+ }
8347
+
8348
+ return name ? jar[name] : jar
8349
+ }
8350
+
8351
+ return Object.create(
8352
+ {
8353
+ set,
8354
+ get,
8355
+ remove: function (name, attributes) {
8356
+ set(
8357
+ name,
8358
+ '',
8359
+ assign({}, attributes, {
8360
+ expires: -1
8361
+ })
8362
+ );
8363
+ },
8364
+ withAttributes: function (attributes) {
8365
+ return init(this.converter, assign({}, this.attributes, attributes))
8366
+ },
8367
+ withConverter: function (converter) {
8368
+ return init(assign({}, this.converter, converter), this.attributes)
8369
+ }
8370
+ },
8371
+ {
8372
+ attributes: { value: Object.freeze(defaultAttributes) },
8373
+ converter: { value: Object.freeze(converter) }
8374
+ }
8375
+ )
8376
+ }
8377
+
8378
+ var api = init(defaultConverter, { path: '/' });
8379
+ /* eslint-enable no-var */
8380
+
8381
+ return api;
8382
+
8383
+ }));
8384
+ });
8385
+
7910
8386
  var BookingForm = function BookingForm(props) {
7911
8387
  var _props$shopConfig = props.shopConfig,
7912
8388
  shopConfig = _props$shopConfig === void 0 ? {} : _props$shopConfig,
@@ -7919,8 +8395,8 @@ var BookingForm = function BookingForm(props) {
7919
8395
  _props$className = props.className,
7920
8396
  className = _props$className === void 0 ? "" : _props$className;
7921
8397
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
7922
- _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
7923
- secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
8398
+ _shopConfigStyle$colo5 = _shopConfigStyle$colo.background,
8399
+ background = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5;
7924
8400
  var _useState = useState(false);
7925
8401
  var _useState2 = useState({
7926
8402
  types: "1,10"
@@ -7950,11 +8426,11 @@ var BookingForm = function BookingForm(props) {
7950
8426
  var _EmployeeController = EmployeeController(_extends({}, props)),
7951
8427
  _EmployeeController$l = _EmployeeController.listEmployment,
7952
8428
  listEmployment = _EmployeeController$l === void 0 ? [] : _EmployeeController$l;
8429
+ var token = js_cookie === null || js_cookie === void 0 ? void 0 : js_cookie.get(SSHOP_SPA_TOKEN);
7953
8430
  var _ProductController = ProductController(_extends({}, props, {
7954
8431
  params: productsParams
7955
8432
  })),
7956
8433
  products = _ProductController.products;
7957
- console.log("BookingForm products", products);
7958
8434
  var _BookingController = BookingController(props),
7959
8435
  _BookingController$cr = _BookingController.createSchedule,
7960
8436
  createSchedule = _BookingController$cr === void 0 ? function () {} : _BookingController$cr;
@@ -8055,9 +8531,9 @@ var BookingForm = function BookingForm(props) {
8055
8531
  var customerName = inputNameRef === null || inputNameRef === void 0 ? void 0 : (_inputNameRef$current2 = inputNameRef.current) === null || _inputNameRef$current2 === void 0 ? void 0 : _inputNameRef$current2.getValue();
8056
8532
  var scheduleDate = inputDateRef === null || inputDateRef === void 0 ? void 0 : (_inputDateRef$current2 = inputDateRef.current) === null || _inputDateRef$current2 === void 0 ? void 0 : _inputDateRef$current2.getValue();
8057
8533
  var services = listProductSelected === null || listProductSelected === void 0 ? void 0 : listProductSelected.map(function (item) {
8058
- var _item$productInfo6, _item$technical;
8534
+ var _item$technical;
8059
8535
  return {
8060
- productId: item === null || item === void 0 ? void 0 : (_item$productInfo6 = item.productInfo) === null || _item$productInfo6 === void 0 ? void 0 : _item$productInfo6.productId,
8536
+ productId: item === null || item === void 0 ? void 0 : item.value,
8061
8537
  technicalStaffIds: [item === null || item === void 0 ? void 0 : (_item$technical = item.technical) === null || _item$technical === void 0 ? void 0 : _item$technical.sysUserId],
8062
8538
  quantity: item === null || item === void 0 ? void 0 : item.quantity,
8063
8539
  oldService: item === null || item === void 0 ? void 0 : item.oldService
@@ -8095,9 +8571,9 @@ var BookingForm = function BookingForm(props) {
8095
8571
  });
8096
8572
  };
8097
8573
  return /*#__PURE__*/React__default.createElement("div", {
8098
- className: "grid gap-4 rounded-lg p-6 " + className,
8574
+ className: "grid gap-4 rounded-2xl p-6 border " + className,
8099
8575
  style: {
8100
- backgroundColor: secondary
8576
+ backgroundColor: background
8101
8577
  }
8102
8578
  }, /*#__PURE__*/React__default.createElement("div", {
8103
8579
  className: "grid grid-cols-1 md:grid-cols-2 gap-4"
@@ -8123,8 +8599,7 @@ var BookingForm = function BookingForm(props) {
8123
8599
  pattern: pattern === null || pattern === void 0 ? void 0 : pattern.phoneNumberPattern,
8124
8600
  message: "Số điện thoại không hợp lệ!"
8125
8601
  }],
8126
- className: "w-full rounded-lg rounded-lg bg-bgSecondary",
8127
- inputClassName: "w-full"
8602
+ className: "bg-bgSecondary"
8128
8603
  })), /*#__PURE__*/React__default.createElement("div", {
8129
8604
  className: "grid grid-cols-1 gap-4"
8130
8605
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -8135,7 +8610,7 @@ var BookingForm = function BookingForm(props) {
8135
8610
  defaultValue: listProductSelected,
8136
8611
  onClick: handleSelectedProduct,
8137
8612
  handleSearchOption: handleSearchProducts,
8138
- className: "bg-bgSecondary rounded-lg",
8613
+ className: "bg-bgSecondary",
8139
8614
  rules: [{
8140
8615
  type: "required",
8141
8616
  message: "Bắt buộc chọn dịch vụ"
@@ -8155,9 +8630,8 @@ var BookingForm = function BookingForm(props) {
8155
8630
  })), (listProductSelected === null || listProductSelected === void 0 ? void 0 : listProductSelected.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
8156
8631
  className: "grid grid-cols-1"
8157
8632
  }, /*#__PURE__*/React__default.createElement("div", null, "D\u1ECBch v\u1EE5 \u0111\xE3 ch\u1ECDn"), listProductSelected === null || listProductSelected === void 0 ? void 0 : listProductSelected.map(function (item, optionIndex) {
8158
- var _item$productInfo7;
8159
8633
  return /*#__PURE__*/React__default.createElement("div", {
8160
- className: "w-full bg-transparent border-b-2 py-3 grid grid-col-12 gap-2",
8634
+ className: "w-full bg-transparent border-b py-3 grid grid-col-12 gap-2",
8161
8635
  key: "ohoihtr-" + optionIndex
8162
8636
  }, /*#__PURE__*/React__default.createElement("div", {
8163
8637
  className: "col-span-12 grid grid-cols-12"
@@ -8167,7 +8641,7 @@ var BookingForm = function BookingForm(props) {
8167
8641
  className: "col-span-10"
8168
8642
  }, /*#__PURE__*/React__default.createElement("div", {
8169
8643
  className: "col-span-10 font-semibold "
8170
- }, item === null || item === void 0 ? void 0 : (_item$productInfo7 = item.productInfo) === null || _item$productInfo7 === void 0 ? void 0 : _item$productInfo7.productName)), /*#__PURE__*/React__default.createElement("div", {
8644
+ }, item === null || item === void 0 ? void 0 : item.label)), /*#__PURE__*/React__default.createElement("div", {
8171
8645
  className: "col-span-1 flex justify-center px-2"
8172
8646
  }, /*#__PURE__*/React__default.createElement("div", {
8173
8647
  className: "flex items-center justify-center cursor-pointer",
@@ -8213,8 +8687,8 @@ var BookingForm = function BookingForm(props) {
8213
8687
  options: listEmploymentMapping,
8214
8688
  isButtonDelete: true,
8215
8689
  funcDelete: function funcDelete(technical) {
8216
- var _item$productInfo8;
8217
- removeTechnicalSelected(item === null || item === void 0 ? void 0 : (_item$productInfo8 = item.productInfo) === null || _item$productInfo8 === void 0 ? void 0 : _item$productInfo8.productId);
8690
+ var _item$productInfo6;
8691
+ removeTechnicalSelected(item === null || item === void 0 ? void 0 : (_item$productInfo6 = item.productInfo) === null || _item$productInfo6 === void 0 ? void 0 : _item$productInfo6.productId);
8218
8692
  }
8219
8693
  }))));
8220
8694
  })) : null, /*#__PURE__*/React__default.createElement("div", {
@@ -8227,7 +8701,7 @@ var BookingForm = function BookingForm(props) {
8227
8701
  onCloseFormBooking: onCloseFormBooking,
8228
8702
  onClose: handleClosePopup
8229
8703
  }, /*#__PURE__*/React__default.createElement("div", {
8230
- className: "bg-white rounded-lg shadow-lg p-6 max-w-sm text-center md:min-w-[650px] min-h-[420px] md:min-h-[380px] lg:h-auto "
8704
+ 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 "
8231
8705
  }, /*#__PURE__*/React__default.createElement("div", {
8232
8706
  className: "h-20 mb-4 flex items-center justify-center"
8233
8707
  }, /*#__PURE__*/React__default.createElement(FaCheckCircle, {
@@ -8241,12 +8715,14 @@ var BookingForm = function BookingForm(props) {
8241
8715
  className: "mb-2"
8242
8716
  }, "S\u1ED1 \u0111i\u1EC7n tho\u1EA1i: ", dataBooking === null || dataBooking === void 0 ? void 0 : dataBooking.customerPhone), /*#__PURE__*/React__default.createElement("div", {
8243
8717
  className: "mb-4"
8244
- }, "Th\u1EDDi gian: ", dayjs_min(dataBooking === null || dataBooking === void 0 ? void 0 : dataBooking.scheduleDate).format("DD/MM/YYYY")), /*#__PURE__*/React__default.createElement("p", {
8245
- className: "mb-4"
8718
+ }, "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", {
8719
+ className: "flex flex-col items-center"
8720
+ }, /*#__PURE__*/React__default.createElement("p", {
8721
+ className: "mb-4 text-center"
8246
8722
  }, "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, {
8247
8723
  label: "Đăng nhập",
8248
8724
  shopConfigStyle: shopConfigStyle
8249
- }))));
8725
+ })))));
8250
8726
  };
8251
8727
 
8252
8728
  var Treatments1 = function Treatments1(props) {
@@ -8341,7 +8817,7 @@ var Treatments1 = function Treatments1(props) {
8341
8817
  }), isOpenModal ? /*#__PURE__*/React__default.createElement(ModalNotification, {
8342
8818
  onClose: handleCloseModal
8343
8819
  }, /*#__PURE__*/React__default.createElement(BookingForm, {
8344
- className: "overflow-y-auto hide-scrollbar max-h-[80vh]",
8820
+ className: "overflow-y-auto hide-scrollbar max-h-[80vh] !bg-bgSecondary",
8345
8821
  onCloseFormBooking: handleCloseModal,
8346
8822
  defaultValue: dataBooking,
8347
8823
  shopConfig: shopConfig,
@@ -8521,11 +8997,14 @@ var ProductPrice = function ProductPrice(props) {
8521
8997
  }
8522
8998
  setDisplayPrice(_displayPrice);
8523
8999
  setDisplayPriceBeforeDiscount(_displayPriceBeforeDiscount);
9000
+ } else {
9001
+ var _displayPrice2 = formatCurrency(product === null || product === void 0 ? void 0 : product.price);
9002
+ setDisplayPrice(_displayPrice2);
8524
9003
  }
8525
9004
  };
8526
9005
  return /*#__PURE__*/React__default.createElement("div", {
8527
9006
  className: className
8528
- }, displayPriceBeforeDiscount !== displayPrice ? /*#__PURE__*/React__default.createElement("span", {
9007
+ }, displayPriceBeforeDiscount !== displayPrice && displayPriceBeforeDiscount != null ? /*#__PURE__*/React__default.createElement("span", {
8529
9008
  className: "text-gray3 line-through mr-2"
8530
9009
  }, displayPriceBeforeDiscount) : null, /*#__PURE__*/React__default.createElement("span", {
8531
9010
  className: "text-primary font-semibold",
@@ -8638,6 +9117,71 @@ var Treatments1$1 = function Treatments1(props) {
8638
9117
  }));
8639
9118
  };
8640
9119
 
9120
+ var NotFoundProduct = function NotFoundProduct() {
9121
+ return /*#__PURE__*/React__default.createElement("div", {
9122
+ className: "h-60 flex flex-col justify-center items-center text-xl text-gray3"
9123
+ }, /*#__PURE__*/React__default.createElement(FaBoxOpen, {
9124
+ size: 80
9125
+ }), /*#__PURE__*/React__default.createElement("div", null, "Kh\xF4ng c\xF3 s\u1EA3n ph\u1EA9m"));
9126
+ };
9127
+
9128
+ var TreatmentsList6 = function TreatmentsList6(props) {
9129
+ var _products$slice;
9130
+ var data = props.data,
9131
+ _props$Link = props.Link,
9132
+ Link = _props$Link === void 0 ? null : _props$Link,
9133
+ _props$SectionTitle = props.SectionTitle,
9134
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
9135
+ _props$TreatmentItem = props.TreatmentItem,
9136
+ TreatmentItem = _props$TreatmentItem === void 0 ? null : _props$TreatmentItem,
9137
+ _props$shopConfigStyl = props.shopConfigStyle,
9138
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl;
9139
+ var _useState = useState({
9140
+ size: 12,
9141
+ types: "1"
9142
+ }),
9143
+ params = _useState[0],
9144
+ setParams = _useState[1];
9145
+ var _useState2 = useState(true),
9146
+ isGetMore = _useState2[0],
9147
+ setIsGetMore = _useState2[1];
9148
+ var _ProductController = ProductController(_extends({}, props, {
9149
+ params: params
9150
+ })),
9151
+ products = _ProductController.products,
9152
+ loading = _ProductController.loading;
9153
+ var handleGetMoreProducts = function handleGetMoreProducts() {
9154
+ setIsGetMore(false);
9155
+ setParams(function (prev) {
9156
+ return _extends({}, prev, {
9157
+ size: (prev === null || prev === void 0 ? void 0 : prev.size) + 4
9158
+ });
9159
+ });
9160
+ };
9161
+ return /*#__PURE__*/React__default.createElement("div", {
9162
+ className: SECTION_CLASS + " flex flex-col gap-8 "
9163
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
9164
+ data: data,
9165
+ shopConfigStyle: shopConfigStyle
9166
+ }), loading && isGetMore ? /*#__PURE__*/React__default.createElement("div", {
9167
+ className: "m-auto mt-20 min-h-32"
9168
+ }, /*#__PURE__*/React__default.createElement(Loading, null)) : (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
9169
+ 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"
9170
+ }, products === null || products === void 0 ? void 0 : (_products$slice = products.slice(0, params.size - 4)) === null || _products$slice === void 0 ? void 0 : _products$slice.map(function (product, idx) {
9171
+ return /*#__PURE__*/React__default.createElement(TreatmentItem, {
9172
+ Link: Link,
9173
+ shopConfigStyle: shopConfigStyle,
9174
+ product: product === null || product === void 0 ? void 0 : product.productInfo,
9175
+ key: "htrhr-" + idx
9176
+ });
9177
+ })) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null), !loading && (products === null || products === void 0 ? void 0 : products.length) > (params === null || params === void 0 ? void 0 : params.size) - 4 ? /*#__PURE__*/React__default.createElement(Button, {
9178
+ label: "Xem thêm",
9179
+ onClick: handleGetMoreProducts,
9180
+ className: "mx-auto " + (shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.buttonClass),
9181
+ type: "outline"
9182
+ }) : null);
9183
+ };
9184
+
8641
9185
  var ProductDetailController = function ProductDetailController(props) {
8642
9186
  var shopConfig = props.shopConfig,
8643
9187
  _props$productId = props.productId,
@@ -8706,17 +9250,176 @@ var ServiceDetail1 = function ServiceDetail1(props) {
8706
9250
  dangerouslySetInnerHTML: {
8707
9251
  __html: product === null || product === void 0 ? void 0 : product.description
8708
9252
  }
8709
- }) : /*#__PURE__*/React__default.createElement("div", {
9253
+ }) : /*#__PURE__*/React__default.createElement("div", {
9254
+ className: "text-gray3 mt-2"
9255
+ }, "Kh\xF4ng c\xF3 th\xF4ng tin"))));
9256
+ };
9257
+
9258
+ var CartController = function CartController(props) {
9259
+ var addToCart = props.addToCart,
9260
+ dispatch = props.dispatch;
9261
+ useEffect(function () {}, []);
9262
+ var addProductToCart = function addProductToCart(product, variant, quantity) {
9263
+ try {
9264
+ try {
9265
+ dispatch(addToCart({
9266
+ product: product,
9267
+ variant: variant,
9268
+ quantity: quantity
9269
+ }));
9270
+ } catch (e) {
9271
+ console.log(e);
9272
+ }
9273
+ return Promise.resolve();
9274
+ } catch (e) {
9275
+ return Promise.reject(e);
9276
+ }
9277
+ };
9278
+ return {
9279
+ addProductToCart: addProductToCart
9280
+ };
9281
+ };
9282
+
9283
+ var TreatmentDetail1 = function TreatmentDetail1(props) {
9284
+ var _product$images;
9285
+ var shopConfigStyle = props.shopConfigStyle,
9286
+ shopConfig = props.shopConfig;
9287
+ var _ProductDetailControl = ProductDetailController(props),
9288
+ product = _ProductDetailControl.product;
9289
+ var _useState = useState(),
9290
+ displayImage = _useState[0],
9291
+ setDisplayImage = _useState[1];
9292
+ var _useState2 = useState(false),
9293
+ isSeeMore = _useState2[0],
9294
+ setIsSeeMore = _useState2[1];
9295
+ var _useState3 = useState(true),
9296
+ hiddenButton = _useState3[0],
9297
+ setHiddenButton = _useState3[1];
9298
+ var descriptionRef = useRef();
9299
+ var _useState4 = useState(false),
9300
+ isBooking = _useState4[0],
9301
+ setIsBooking = _useState4[1];
9302
+ var _useState5 = useState([]),
9303
+ dataBooking = _useState5[0],
9304
+ setDataBooking = _useState5[1];
9305
+ useEffect(function () {
9306
+ if (product) {
9307
+ if (descriptionRef.current) {
9308
+ var descriptionHeight = descriptionRef.current.offsetHeight;
9309
+ if (descriptionHeight >= 700) {
9310
+ setHiddenButton(false);
9311
+ }
9312
+ }
9313
+ }
9314
+ }, [product]);
9315
+ var handleDisplayImage = function handleDisplayImage(item) {
9316
+ setDisplayImage(item);
9317
+ };
9318
+ var handleOpenModalBooking = function handleOpenModalBooking(event) {
9319
+ try {
9320
+ event.stopPropagation();
9321
+ setDataBooking([_extends({}, product, {
9322
+ quantity: 1,
9323
+ technical: {},
9324
+ oldService: false,
9325
+ label: product === null || product === void 0 ? void 0 : product.productName,
9326
+ value: product === null || product === void 0 ? void 0 : product.productId
9327
+ })]);
9328
+ setIsBooking(true);
9329
+ } catch (error) {
9330
+ console.log("::::::::::errrorrrrr::::::", error);
9331
+ }
9332
+ };
9333
+ var handleCloseModal = function handleCloseModal() {
9334
+ setIsBooking(false);
9335
+ setDataBooking([]);
9336
+ };
9337
+ return /*#__PURE__*/React__default.createElement("div", {
9338
+ className: SECTION_CLASS + " mt-6 mb-12 " + ((shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode) === 'fashion_1' ? "bg-bgSecondary pb-8" : "bg-background")
9339
+ }, /*#__PURE__*/React__default.createElement("div", {
9340
+ className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-5 gap-6 bg-bgSecondary"
9341
+ }, /*#__PURE__*/React__default.createElement("div", {
9342
+ className: "flex flex-col gap-4 col-span-2"
9343
+ }, displayImage ? /*#__PURE__*/React__default.createElement("img", {
9344
+ src: displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageUrl,
9345
+ className: "w-full aspect-square rounded-2xl"
9346
+ }) : /*#__PURE__*/React__default.createElement(ProductImage, {
9347
+ product: product,
9348
+ className: "w-full aspect-square rounded-2xl"
9349
+ }), /*#__PURE__*/React__default.createElement("div", {
9350
+ className: "flex gap-1 w-[80vw] overflow-x-auto md:w-full md:gap-2 md:flex-wrap"
9351
+ }, product === null || product === void 0 ? void 0 : (_product$images = product.images) === null || _product$images === void 0 ? void 0 : _product$images.map(function (item) {
9352
+ return /*#__PURE__*/React__default.createElement("img", {
9353
+ src: item === null || item === void 0 ? void 0 : item.imageUrl,
9354
+ key: item === null || item === void 0 ? void 0 : item.imageId,
9355
+ alt: "",
9356
+ className: (displayImage ? "" : "first:border first:opacity-100 first:brightness-100") + " 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"),
9357
+ onClick: function onClick() {
9358
+ handleDisplayImage(item);
9359
+ }
9360
+ });
9361
+ }))), /*#__PURE__*/React__default.createElement("div", {
9362
+ className: "col-span-3"
9363
+ }, /*#__PURE__*/React__default.createElement("p", {
9364
+ className: "font-semibold text-2xl"
9365
+ }, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
9366
+ product: product,
9367
+ className: "mt-6 text-[22px]"
9368
+ }), /*#__PURE__*/React__default.createElement("div", {
9369
+ className: " text-lg py-3"
9370
+ }, "Th\u1EDDi gian: " + getDurationValue(product === null || product === void 0 ? void 0 : product.attributes)), /*#__PURE__*/React__default.createElement(Button, {
9371
+ label: "ĐẶT LỊCH NGAY",
9372
+ shopConfigStyle: shopConfigStyle,
9373
+ onClick: function onClick(e) {
9374
+ return handleOpenModalBooking(e);
9375
+ }
9376
+ }), /*#__PURE__*/React__default.createElement("p", {
9377
+ className: "text-lg mt-12 text-xl pb-1 pt-6 border-t border-stroke"
9378
+ }, "M\xF4 t\u1EA3 s\u1EA3n ph\u1EA9m"), product !== null && product !== void 0 && product.description ? /*#__PURE__*/React__default.createElement("div", {
9379
+ className: "h-max"
9380
+ }, /*#__PURE__*/React__default.createElement("div", {
9381
+ ref: descriptionRef,
9382
+ className: "" + (isSeeMore && !hiddenButton ? "h-full mb-4" : "max-h-[700px] overflow-hidden"),
9383
+ dangerouslySetInnerHTML: {
9384
+ __html: product === null || product === void 0 ? void 0 : product.description
9385
+ }
9386
+ }), !isSeeMore && !hiddenButton ? /*#__PURE__*/React__default.createElement("div", {
9387
+ className: "h-10 relative -mt-10 rounded-b-lg",
9388
+ style: {
9389
+ background: "linear-gradient(to top, #81818169 0%, #00000003 50%)"
9390
+ }
9391
+ }) : null, !hiddenButton ? /*#__PURE__*/React__default.createElement("div", {
9392
+ className: "w-full flex justify-center mt-2"
9393
+ }, /*#__PURE__*/React__default.createElement(Button, {
9394
+ label: isSeeMore ? "Thu nhỏ" : "Xem thêm",
9395
+ className: " bottom-0 z-50",
9396
+ onClick: function onClick() {
9397
+ setIsSeeMore(!isSeeMore);
9398
+ }
9399
+ })) : null) : /*#__PURE__*/React__default.createElement("div", {
8710
9400
  className: "text-gray3 mt-2"
8711
- }, "Kh\xF4ng c\xF3 th\xF4ng tin"))));
9401
+ }, "Kh\xF4ng c\xF3 th\xF4ng tin"))), isBooking ? /*#__PURE__*/React__default.createElement(ModalNotification, {
9402
+ onClose: handleCloseModal
9403
+ }, /*#__PURE__*/React__default.createElement(BookingForm, {
9404
+ className: "overflow-y-auto hide-scrollbar max-h-[80vh]",
9405
+ onCloseFormBooking: handleCloseModal,
9406
+ defaultValue: dataBooking,
9407
+ shopConfig: shopConfig,
9408
+ shopConfigStyle: shopConfigStyle
9409
+ })) : null);
8712
9410
  };
8713
9411
 
8714
9412
  var ProductItem2 = function ProductItem2(props) {
8715
- var product = props.product;
8716
- return /*#__PURE__*/React__default.createElement("a", {
9413
+ var product = props.product,
9414
+ _props$Link = props.Link,
9415
+ Link = _props$Link === void 0 ? null : _props$Link,
9416
+ _props$className = props.className,
9417
+ className = _props$className === void 0 ? "" : _props$className;
9418
+ return /*#__PURE__*/React__default.createElement(LinkToPage, {
9419
+ Link: Link,
8717
9420
  href: getLinkProductDetail(product)
8718
9421
  }, /*#__PURE__*/React__default.createElement("div", {
8719
- className: "text-center relative group"
9422
+ className: "text-center relative group " + className
8720
9423
  }, /*#__PURE__*/React__default.createElement(ProductImage, {
8721
9424
  product: product,
8722
9425
  className: "max-w-[240px] rounded-full mx-auto"
@@ -8728,13 +9431,168 @@ var ProductItem2 = function ProductItem2(props) {
8728
9431
  }, product === null || product === void 0 ? void 0 : product.productName)));
8729
9432
  };
8730
9433
 
9434
+ var ProductItem3 = function ProductItem3(props) {
9435
+ var product = props.product,
9436
+ _props$Link = props.Link,
9437
+ Link = _props$Link === void 0 ? null : _props$Link,
9438
+ _props$className = props.className,
9439
+ className = _props$className === void 0 ? "" : _props$className;
9440
+ return /*#__PURE__*/React__default.createElement(LinkToPage, {
9441
+ Link: Link,
9442
+ href: getLinkProductDetail(product)
9443
+ }, /*#__PURE__*/React__default.createElement("div", {
9444
+ className: "w-full border rounded-2xl " + className
9445
+ }, /*#__PURE__*/React__default.createElement(ProductImage, {
9446
+ product: product,
9447
+ className: "w-full h-44 md:h-56 lg:h-64 xl:h-72 bg-cover bg-no-repeat rounded-t-2xl"
9448
+ }), /*#__PURE__*/React__default.createElement("div", {
9449
+ className: "p-4 flex flex-col gap-4 justify-start"
9450
+ }, /*#__PURE__*/React__default.createElement("div", {
9451
+ className: "line-clamp-1"
9452
+ }, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
9453
+ product: product,
9454
+ className: "text-lg text-start"
9455
+ }))));
9456
+ };
9457
+
9458
+ var ProductItem4 = function ProductItem4(props) {
9459
+ var _props$shopConfigStyl = props.shopConfigStyle,
9460
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
9461
+ product = props.product,
9462
+ _props$Link = props.Link,
9463
+ Link = _props$Link === void 0 ? null : _props$Link,
9464
+ _props$className = props.className,
9465
+ className = _props$className === void 0 ? "" : _props$className;
9466
+ return /*#__PURE__*/React__default.createElement(LinkToPage, {
9467
+ Link: Link,
9468
+ href: getLinkProductDetail(product)
9469
+ }, /*#__PURE__*/React__default.createElement("div", {
9470
+ className: "w-full border flex flex-col gap-2 md:gap-4 rounded-2xl p-2 md:p-4 xl:p-6 " + className
9471
+ }, /*#__PURE__*/React__default.createElement(ProductImage, {
9472
+ product: product,
9473
+ className: "w-full h-44 sm:h-56 xl:h-72 bg-cover bg-no-repeat rounded-2xl"
9474
+ }), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
9475
+ className: "line-clamp-1"
9476
+ }, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
9477
+ product: product,
9478
+ className: "text-lg text-start"
9479
+ })), /*#__PURE__*/React__default.createElement("div", {
9480
+ className: "flex pt-4 gap-2 md:gap-4 border-t items-center"
9481
+ }, /*#__PURE__*/React__default.createElement("div", {
9482
+ className: "p-2 md:p-[10px] rounded-full hover:opacity-80 border border-primary h-full w-auto flex items-center justify-center " + (shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.buttonClass)
9483
+ }, /*#__PURE__*/React__default.createElement(FiShoppingCart, {
9484
+ className: "text-primary "
9485
+ })), /*#__PURE__*/React__default.createElement(Button, {
9486
+ label: "Mua ngay",
9487
+ className: "!rounded-3xl w-full",
9488
+ shopConfigStyle: shopConfigStyle
9489
+ }))));
9490
+ };
9491
+
9492
+ var ProductItem5 = function ProductItem5(props) {
9493
+ var product = props.product,
9494
+ _props$Link = props.Link,
9495
+ Link = _props$Link === void 0 ? null : _props$Link,
9496
+ _props$shopConfigStyl = props.shopConfigStyle,
9497
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
9498
+ _props$className = props.className,
9499
+ className = _props$className === void 0 ? "" : _props$className;
9500
+ return /*#__PURE__*/React__default.createElement(LinkToPage, {
9501
+ Link: Link,
9502
+ href: getLinkProductDetail(product)
9503
+ }, /*#__PURE__*/React__default.createElement("div", {
9504
+ className: "w-full flex flex-col gap-4 rounded-2xl p-1 " + className
9505
+ }, /*#__PURE__*/React__default.createElement(ProductImage, {
9506
+ product: product,
9507
+ className: "w-full w-full h-44 md:h-56 lg:h-64 xl:h-72 bg-cover bg-no-repeat rounded-2xl"
9508
+ }), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
9509
+ className: "line-clamp-1 mb-2"
9510
+ }, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
9511
+ product: product,
9512
+ className: "text-lg text-start"
9513
+ })), /*#__PURE__*/React__default.createElement("div", {
9514
+ className: "flex gap-2 md:gap-4 "
9515
+ }, /*#__PURE__*/React__default.createElement(AiOutlineShoppingCart, {
9516
+ className: "text-primary p-2.5 h-10 w-12 border border-primary rounded-lg hover:bg-primary hover:text-textButton " + (shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.buttonClass)
9517
+ }), /*#__PURE__*/React__default.createElement(Button, {
9518
+ label: "Mua ngay",
9519
+ className: "w-full",
9520
+ shopConfigStyle: shopConfigStyle
9521
+ }))));
9522
+ };
9523
+
9524
+ var ProductItem6 = function ProductItem6(props) {
9525
+ var product = props.product,
9526
+ _props$shopConfigStyl = props.shopConfigStyle,
9527
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
9528
+ _props$Link = props.Link,
9529
+ Link = _props$Link === void 0 ? null : _props$Link,
9530
+ _props$className = props.className,
9531
+ className = _props$className === void 0 ? "" : _props$className;
9532
+ return /*#__PURE__*/React__default.createElement(LinkToPage, {
9533
+ Link: Link,
9534
+ href: getLinkProductDetail(product)
9535
+ }, /*#__PURE__*/React__default.createElement("div", {
9536
+ className: "w-full border flex flex-col gap-2 md:gap-4 rounded-2xl p-2 md:p-4 xl:p-6 " + className
9537
+ }, /*#__PURE__*/React__default.createElement(ProductImage, {
9538
+ product: product,
9539
+ className: "w-full h-44 sm:h-56 xl:h-72 bg-cover bg-no-repeat rounded-2xl"
9540
+ }), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
9541
+ className: "line-clamp-1"
9542
+ }, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
9543
+ product: product,
9544
+ className: "text-lg text-start"
9545
+ })), /*#__PURE__*/React__default.createElement("div", {
9546
+ className: "flex pt-4 gap-2 md:gap-4 border-t items-center"
9547
+ }, /*#__PURE__*/React__default.createElement("div", {
9548
+ className: "p-2 md:p-[10px] text-primary rounded-lg hover:bg-primary hover:text-textButton hover:opacity-80 border border-primary h-full w-auto flex items-center justify-center " + (shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.buttonClass) + " "
9549
+ }, /*#__PURE__*/React__default.createElement(FiShoppingCart, null)), /*#__PURE__*/React__default.createElement(Button, {
9550
+ label: "Mua ngay",
9551
+ className: "w-full",
9552
+ shopConfigStyle: shopConfigStyle
9553
+ }))));
9554
+ };
9555
+
9556
+ var TreatmentItem1 = function TreatmentItem1(props) {
9557
+ var product = props.product,
9558
+ _props$Link = props.Link,
9559
+ Link = _props$Link === void 0 ? null : _props$Link,
9560
+ _props$shopConfigStyl = props.shopConfigStyle,
9561
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl;
9562
+ return /*#__PURE__*/React__default.createElement(LinkToPage, {
9563
+ Link: Link,
9564
+ href: getLinkServiceDetail(product)
9565
+ }, /*#__PURE__*/React__default.createElement("div", {
9566
+ className: "w-full flex flex-col gap-4 rounded-2xl p-1"
9567
+ }, /*#__PURE__*/React__default.createElement(ProductImage, {
9568
+ product: product,
9569
+ className: "w-full w-full h-44 md:h-56 lg:h-64 xl:h-72 bg-cover bg-no-repeat rounded-2xl"
9570
+ }), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
9571
+ className: "line-clamp-1 mb-2 font-medium text-lg"
9572
+ }, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
9573
+ product: product,
9574
+ className: "text-lg text-start"
9575
+ })), /*#__PURE__*/React__default.createElement("div", {
9576
+ className: "flex flex-col md:flex-row gap-2 md:items-center md:gap-6 "
9577
+ }, /*#__PURE__*/React__default.createElement("div", {
9578
+ className: "whitespace-nowrap"
9579
+ }, "Th\u1EDDi gian: 120p"), /*#__PURE__*/React__default.createElement(Button, {
9580
+ shopConfigStyle: shopConfigStyle,
9581
+ label: "\u0110\u1EB7t l\u1ECBch",
9582
+ className: "w-full"
9583
+ }))));
9584
+ };
9585
+
8731
9586
  var Products1 = function Products1(props) {
8732
9587
  var _props$shopConfigStyl = props.shopConfigStyle,
8733
9588
  shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
8734
9589
  _props$data = props.data,
8735
9590
  data = _props$data === void 0 ? {} : _props$data,
8736
9591
  _props$SectionTitle = props.SectionTitle,
8737
- SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
9592
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
9593
+ _props$Link = props.Link,
9594
+ Link = _props$Link === void 0 ? null : _props$Link,
9595
+ ProductItem = props.ProductItem;
8738
9596
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
8739
9597
  _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
8740
9598
  secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
@@ -8756,7 +9614,9 @@ var Products1 = function Products1(props) {
8756
9614
  }), /*#__PURE__*/React__default.createElement("div", {
8757
9615
  className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-10 mt-12"
8758
9616
  }, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
8759
- return /*#__PURE__*/React__default.createElement(ProductItem2, {
9617
+ return /*#__PURE__*/React__default.createElement(ProductItem, {
9618
+ Link: Link,
9619
+ shopConfigStyle: shopConfigStyle,
8760
9620
  key: index,
8761
9621
  product: product === null || product === void 0 ? void 0 : product.productInfo
8762
9622
  });
@@ -8769,43 +9629,14 @@ var Products1 = function Products1(props) {
8769
9629
  }));
8770
9630
  };
8771
9631
 
8772
- var ItemProduct = function ItemProduct(props) {
8773
- var product = props.product;
8774
- return /*#__PURE__*/React__default.createElement("div", {
8775
- className: "pb-4 rounded-2xl w-full bg-bgSecondary"
8776
- }, /*#__PURE__*/React__default.createElement("div", {
8777
- className: "relative pt-2 flex justify-center h-32 sm:h-40 lg:h-52"
8778
- }, /*#__PURE__*/React__default.createElement("a", {
8779
- href: "#"
8780
- }, /*#__PURE__*/React__default.createElement(ProductImage, {
8781
- product: product,
8782
- className: "aspect-w-1 aspect-h-1 max-h-32 sm:max-h-40 lg:max-h-52 object-cover"
8783
- })), product && (product === null || product === void 0 ? void 0 : product.priceBeforeDiscount) && +(product === null || product === void 0 ? void 0 : product.priceBeforeDiscount) !== (product === null || product === void 0 ? void 0 : product.price) && /*#__PURE__*/React__default.createElement("label", {
8784
- className: "absolute bg-red-600 rounded-r-lg sm:px-2 text-textButton",
8785
- style: {
8786
- top: "10%"
8787
- }
8788
- }, ((product === null || product === void 0 ? void 0 : product.priceBeforeDiscount) - (product === null || product === void 0 ? void 0 : product.price)) / (product === null || product === void 0 ? void 0 : product.priceBeforeDiscount) * 100, "%")), /*#__PURE__*/React__default.createElement("div", {
8789
- className: "px-4 h-[100px] mt-6"
8790
- }, /*#__PURE__*/React__default.createElement("label", {
8791
- className: "line-clamp-2 lg:h-12 lg:block"
8792
- }, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement("div", {
8793
- className: "mt-3 md:flex md:justify-between flex-col"
8794
- }, /*#__PURE__*/React__default.createElement(ProductPrice, {
8795
- product: product
8796
- }))));
8797
- };
8798
-
8799
9632
  var Carousel = function Carousel(props) {
8800
9633
  var carouselRef = useRef(null);
8801
9634
  var _useState = useState(false),
8802
9635
  isScrolledToLeft = _useState[0],
8803
9636
  setIsScrolledToLeft = _useState[1];
8804
- var _useState2 = useState(true),
8805
- isScrolledToRight = _useState2[0],
8806
- setIsScrolledToRight = _useState2[1];
8807
- var _props$datas = props.datas,
8808
- datas = _props$datas === void 0 ? [] : _props$datas,
9637
+ var _useState2 = useState(0);
9638
+ var _props$data = props.data,
9639
+ data = _props$data === void 0 ? [] : _props$data,
8809
9640
  _props$className = props.className,
8810
9641
  className = _props$className === void 0 ? "" : _props$className,
8811
9642
  _props$style = props.style,
@@ -8815,21 +9646,20 @@ var Carousel = function Carousel(props) {
8815
9646
  _props$renderItem = props.renderItem,
8816
9647
  renderItem = _props$renderItem === void 0 ? function () {} : _props$renderItem;
8817
9648
  var handleClickPrevImg = function handleClickPrevImg() {
8818
- if (carouselRef.current) {
9649
+ if (carouselRef !== null && carouselRef !== void 0 && carouselRef.current) {
8819
9650
  setIsScrolledToLeft(true);
8820
- setIsScrolledToRight(false);
8821
9651
  carouselRef.current.scrollBy({
8822
- left: -300,
9652
+ left: -carouselRef.current.offsetWidth / 4,
8823
9653
  behavior: "smooth"
8824
9654
  });
8825
9655
  }
8826
9656
  };
8827
9657
  var handleClickNextImg = function handleClickNextImg() {
8828
- setIsScrolledToRight(true);
8829
9658
  setIsScrolledToLeft(false);
8830
- if (carouselRef.current) {
8831
- carouselRef.current.scrollBy({
8832
- left: 300,
9659
+ if (carouselRef !== null && carouselRef !== void 0 && carouselRef.current) {
9660
+ var _carouselRef$current, _carouselRef$current2;
9661
+ carouselRef === null || carouselRef === void 0 ? void 0 : (_carouselRef$current = carouselRef.current) === null || _carouselRef$current === void 0 ? void 0 : _carouselRef$current.scrollBy({
9662
+ left: (carouselRef === null || carouselRef === void 0 ? void 0 : (_carouselRef$current2 = carouselRef.current) === null || _carouselRef$current2 === void 0 ? void 0 : _carouselRef$current2.offsetWidth) / 4,
8833
9663
  behavior: "smooth"
8834
9664
  });
8835
9665
  }
@@ -8837,13 +9667,13 @@ var Carousel = function Carousel(props) {
8837
9667
  return /*#__PURE__*/React__default.createElement("div", {
8838
9668
  className: "relative " + className + " ",
8839
9669
  style: style
8840
- }, /*#__PURE__*/React__default.createElement("div", {
8841
- className: " w-full pe-2 h-full flex overflow-x-auto hide-scrollbar",
9670
+ }, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
9671
+ className: " w-full pe-2 h-full flex gap-2 md:gap-4 xl:gap-6 overflow-x-auto hide-scrollbar",
8842
9672
  ref: carouselRef
8843
- }, datas && datas.length > 0 && datas.map(function (item, index) {
9673
+ }, data && (data === null || data === void 0 ? void 0 : data.length) > 0 ? data === null || data === void 0 ? void 0 : data.map(function (item, index) {
8844
9674
  return renderItem(item, index);
8845
- })), datas && datas.length > 0 && /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("button", {
8846
- className: " hidden md:block bg-gray3 p-3 rounded-full absolute top-[45%] left-[-8px] lg:left-[-1%]",
9675
+ }) : null)), data && (data === null || data === void 0 ? void 0 : data.length) > 4 ? /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("button", {
9676
+ className: " hidden lg:block bg-gray3 p-3 rounded-full absolute top-[45%] left-[-8px] lg:left-[-2%]",
8847
9677
  style: {
8848
9678
  backgroundColor: isScrolledToLeft ? primaryColor : "#BDBDBD"
8849
9679
  },
@@ -8851,19 +9681,23 @@ var Carousel = function Carousel(props) {
8851
9681
  }, /*#__PURE__*/React__default.createElement(FaArrowLeft, {
8852
9682
  className: "text-sm lg:text-lg text-white"
8853
9683
  })), /*#__PURE__*/React__default.createElement("button", {
8854
- className: " hidden md:block p-3 rounded-full absolute top-[45%] right-[-2%] lg:right-0",
9684
+ className: " hidden lg:block p-3 rounded-full absolute top-[45%] right-[-2%] ",
8855
9685
  style: {
8856
- backgroundColor: isScrolledToRight ? primaryColor : "#BDBDBD"
9686
+ backgroundColor: !isScrolledToLeft ? primaryColor : "#BDBDBD"
8857
9687
  },
8858
9688
  onClick: handleClickNextImg
8859
- }, /*#__PURE__*/React__default.createElement(FaArrowRight$1, {
9689
+ }, /*#__PURE__*/React__default.createElement(FaArrowRight, {
8860
9690
  className: "text-sm lg:text-lg text-white"
8861
- }))));
9691
+ }))) : null);
8862
9692
  };
8863
9693
 
8864
9694
  var Products2 = function Products2(props) {
8865
9695
  var shopConfigStyle = props.shopConfigStyle,
8866
- data = props.data;
9696
+ data = props.data,
9697
+ _props$ProductItem = props.ProductItem,
9698
+ ProductItem = _props$ProductItem === void 0 ? null : _props$ProductItem,
9699
+ _props$Link = props.Link,
9700
+ Link = _props$Link === void 0 ? null : _props$Link;
8867
9701
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
8868
9702
  _shopConfigStyle$colo2 = _shopConfigStyle$colo.primary,
8869
9703
  primary = _shopConfigStyle$colo2 === void 0 ? "#000" : _shopConfigStyle$colo2,
@@ -8896,15 +9730,17 @@ var Products2 = function Products2(props) {
8896
9730
  color: textButton
8897
9731
  }
8898
9732
  }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement(Carousel, {
8899
- datas: products,
9733
+ data: products,
8900
9734
  primaryColor: primary,
8901
9735
  renderItem: function renderItem(item, index) {
8902
9736
  return /*#__PURE__*/React__default.createElement("div", {
8903
9737
  key: "carousel-" + index,
8904
- className: " min-w-[40vw] object-cover sm:min-w-[25vw] lg:min-w-[22vw] xl:min-w-[20vw] pe-4 xl:pe-6"
8905
- }, /*#__PURE__*/React__default.createElement(ItemProduct, {
9738
+ className: "flex-shrink-0 w-[calc(50%-2px)] md:w-[calc(34%-16px)] lg:w-[calc(25%-12px)] xl:w-[calc(25%-19px)]"
9739
+ }, /*#__PURE__*/React__default.createElement(ProductItem, {
8906
9740
  product: item.productInfo,
8907
- shopConfigStyle: shopConfigStyle
9741
+ Link: Link,
9742
+ shopConfigStyle: shopConfigStyle,
9743
+ className: "border-0 bg-bgSecondary"
8908
9744
  }));
8909
9745
  }
8910
9746
  })));
@@ -8955,7 +9791,11 @@ var Products3 = function Products3(props) {
8955
9791
  _props$data = props.data,
8956
9792
  data = _props$data === void 0 ? {} : _props$data,
8957
9793
  _props$SectionTitle = props.SectionTitle,
8958
- SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
9794
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
9795
+ _props$Link = props.Link,
9796
+ Link = _props$Link === void 0 ? null : _props$Link,
9797
+ _props$ProductItem = props.ProductItem,
9798
+ ProductItem = _props$ProductItem === void 0 ? null : _props$ProductItem;
8959
9799
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
8960
9800
  _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
8961
9801
  secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
@@ -9036,8 +9876,10 @@ var Products3 = function Products3(props) {
9036
9876
  })) : /*#__PURE__*/React__default.createElement("div", {
9037
9877
  className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-12 mt-12"
9038
9878
  }, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
9039
- return /*#__PURE__*/React__default.createElement(ProductItem2, {
9879
+ return /*#__PURE__*/React__default.createElement(ProductItem, {
9880
+ Link: Link,
9040
9881
  key: index,
9882
+ shopConfigStyle: shopConfigStyle,
9041
9883
  product: product === null || product === void 0 ? void 0 : product.productInfo
9042
9884
  });
9043
9885
  })), /*#__PURE__*/React__default.createElement(Pagination, _extends({
@@ -9049,162 +9891,123 @@ var Products3 = function Products3(props) {
9049
9891
  }));
9050
9892
  };
9051
9893
 
9052
- var CarouselItem = function CarouselItem(props) {
9053
- var listRef = useRef(null);
9054
- var _useState = useState(false),
9055
- isScrolledToLeft = _useState[0],
9056
- setIsScrolledToLeft = _useState[1];
9057
- var _useState2 = useState(true),
9058
- isScrolledToRight = _useState2[0],
9059
- setIsScrolledToRight = _useState2[1];
9060
- var _props$datas = props.datas,
9061
- datas = _props$datas === void 0 ? [] : _props$datas,
9062
- _props$className = props.className,
9063
- className = _props$className === void 0 ? "" : _props$className,
9064
- _props$style = props.style,
9065
- style = _props$style === void 0 ? {} : _props$style,
9066
- _props$primaryColor = props.primaryColor,
9067
- primaryColor = _props$primaryColor === void 0 ? "" : _props$primaryColor,
9068
- _props$textButtonColo = props.textButtonColor,
9069
- textButtonColor = _props$textButtonColo === void 0 ? "" : _props$textButtonColo,
9070
- _props$renderItem = props.renderItem,
9071
- renderItem = _props$renderItem === void 0 ? function () {} : _props$renderItem;
9072
- var handleClickPrevImg = function handleClickPrevImg() {
9073
- if (listRef.current) {
9074
- setIsScrolledToLeft(true);
9075
- setIsScrolledToRight(false);
9076
- listRef.current.scrollBy({
9077
- left: -80,
9078
- behavior: "smooth"
9079
- });
9080
- }
9081
- };
9082
- var handleClickNextImg = function handleClickNextImg() {
9083
- setIsScrolledToRight(true);
9084
- setIsScrolledToLeft(false);
9085
- if (listRef.current) {
9086
- listRef.current.scrollBy({
9087
- left: 80,
9088
- behavior: "smooth"
9089
- });
9090
- }
9091
- };
9092
- console.log("check propsss::::::::", datas);
9093
- return /*#__PURE__*/React__default.createElement("div", {
9094
- className: "grid grid-cols-12 h-12 " + className,
9095
- style: style
9096
- }, /*#__PURE__*/React__default.createElement("div", {
9097
- className: "col-span-12 lg:col-span-10 md:col-span-9 overflow-hidden "
9098
- }, /*#__PURE__*/React__default.createElement("div", {
9099
- className: "flex overflow-x-auto gap-2 hide-scrollbar items-center",
9100
- ref: listRef
9101
- }, datas && datas.length > 0 && datas.map(function (item, index) {
9102
- return renderItem(item, index);
9103
- }))), datas && datas.length > 0 && /*#__PURE__*/React__default.createElement("div", {
9104
- className: "hidden my-auto col-span-5 md:col-span-3 lg:col-span-2 gap-4 md:flex justify-end "
9105
- }, /*#__PURE__*/React__default.createElement("button", {
9106
- className: " px-4 py-3 rounded-full",
9107
- onClick: handleClickPrevImg,
9108
- style: {
9109
- backgroundColor: isScrolledToLeft ? primaryColor : "#BDBDBD"
9110
- }
9111
- }, /*#__PURE__*/React__default.createElement(FaArrowLeft, {
9112
- className: "inline-block mb-1 text-lg",
9113
- style: {
9114
- color: textButtonColor
9115
- }
9116
- })), /*#__PURE__*/React__default.createElement("button", {
9117
- className: "bg-gray2 px-4 py-3 rounded-full",
9118
- style: {
9119
- backgroundColor: isScrolledToRight ? primaryColor : "#BDBDBD"
9120
- },
9121
- onClick: handleClickNextImg
9122
- }, /*#__PURE__*/React__default.createElement(FaArrowRight$1, {
9123
- className: "inline-block mb-1 text-lg",
9124
- style: {
9125
- color: textButtonColor
9126
- }
9127
- }))));
9128
- };
9129
-
9130
- var ListProduct = function ListProduct(props) {
9131
- var _props$datas = props.datas,
9132
- datas = _props$datas === void 0 ? [] : _props$datas,
9133
- _props$style = props.style,
9134
- style = _props$style === void 0 ? {} : _props$style,
9135
- _props$className = props.className,
9136
- className = _props$className === void 0 ? {} : _props$className,
9137
- _props$renderItem = props.renderItem,
9138
- renderItem = _props$renderItem === void 0 ? function () {} : _props$renderItem;
9894
+ var Products10 = function Products10(props) {
9895
+ var _useState = useState({
9896
+ size: 8
9897
+ }),
9898
+ params = _useState[0],
9899
+ setParams = _useState[1];
9900
+ var shopConfigStyle = props.shopConfigStyle,
9901
+ data = props.data,
9902
+ _props$SectionTitle = props.SectionTitle,
9903
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
9904
+ _props$ProductItem = props.ProductItem,
9905
+ ProductItem = _props$ProductItem === void 0 ? null : _props$ProductItem,
9906
+ _props$Link = props.Link,
9907
+ Link = _props$Link === void 0 ? null : _props$Link;
9908
+ var _CategoryController = CategoryController(props),
9909
+ _CategoryController$c = _CategoryController.categories,
9910
+ categories = _CategoryController$c === void 0 ? [] : _CategoryController$c;
9911
+ var _ProductController = ProductController(_extends({}, props, {
9912
+ params: params
9913
+ })),
9914
+ _ProductController$pr = _ProductController.products,
9915
+ products = _ProductController$pr === void 0 ? [] : _ProductController$pr,
9916
+ loading = _ProductController.loading;
9917
+ var handleChooseCategory = function handleChooseCategory(item) {
9918
+ setParams(_extends({}, params, {
9919
+ categoryId: item === null || item === void 0 ? void 0 : item.categoryId
9920
+ }));
9921
+ };
9139
9922
  return /*#__PURE__*/React__default.createElement("div", {
9140
- className: "grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4 2xl:grid-cols-5 mt-6 " + className,
9141
- style: style
9142
- }, datas && datas.length > 0 && datas.map(function (item, index) {
9143
- return renderItem(item, index);
9144
- }));
9923
+ className: SECTION_DEFAULT_CLASS + " flex flex-col gap-4 md:gap-6 "
9924
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
9925
+ data: data,
9926
+ shopConfigStyle: shopConfigStyle
9927
+ }), /*#__PURE__*/React__default.createElement(CarouselItem, {
9928
+ data: categories,
9929
+ onClick: handleChooseCategory
9930
+ }), loading ? /*#__PURE__*/React__default.createElement("div", {
9931
+ className: "m-auto mt-20 min-h-32"
9932
+ }, /*#__PURE__*/React__default.createElement(Loading, null)) : (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
9933
+ 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"
9934
+ }, products === null || products === void 0 ? void 0 : products.map(function (product, idx) {
9935
+ return /*#__PURE__*/React__default.createElement(ProductItem, {
9936
+ Link: Link,
9937
+ className: "border-0 bg-bgSecondary",
9938
+ shopConfigStyle: shopConfigStyle,
9939
+ product: product === null || product === void 0 ? void 0 : product.productInfo,
9940
+ key: "zjk-" + idx
9941
+ });
9942
+ })) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null));
9145
9943
  };
9146
9944
 
9147
- var Products10 = function Products10(props) {
9148
- var _useState = useState(""),
9149
- selectCategory = _useState[0],
9150
- setSelectCategory = _useState[1];
9151
- var shopConfigStyle = props.shopConfigStyle,
9152
- data = props.data;
9153
- var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
9154
- _shopConfigStyle$colo2 = _shopConfigStyle$colo.primary,
9155
- primary = _shopConfigStyle$colo2 === void 0 ? "#000" : _shopConfigStyle$colo2,
9156
- _shopConfigStyle$colo3 = _shopConfigStyle$colo.textBody,
9157
- textBody = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
9158
- _shopConfigStyle$colo4 = _shopConfigStyle$colo.textButton,
9159
- textButton = _shopConfigStyle$colo4 === void 0 ? "#fff" : _shopConfigStyle$colo4,
9160
- _shopConfigStyle$colo5 = _shopConfigStyle$colo.background,
9161
- background = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5,
9162
- _shopConfigStyle$colo6 = _shopConfigStyle$colo.bgSecondary,
9163
- bgSecondary = _shopConfigStyle$colo6 === void 0 ? "#fff" : _shopConfigStyle$colo6;
9164
- var _CategoryController = CategoryController(props),
9945
+ var ProductCategory2 = function ProductCategory2(props) {
9946
+ var _products$slice;
9947
+ var _props$Link = props.Link,
9948
+ Link = _props$Link === void 0 ? null : _props$Link,
9949
+ data = props.data,
9950
+ shopConfigStyle = props.shopConfigStyle,
9951
+ _props$SectionTitle = props.SectionTitle,
9952
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
9953
+ _props$ProductItem = props.ProductItem,
9954
+ ProductItem = _props$ProductItem === void 0 ? null : _props$ProductItem;
9955
+ var _useState = useState({
9956
+ size: 12
9957
+ }),
9958
+ params = _useState[0],
9959
+ setParams = _useState[1];
9960
+ var _CategoryController = CategoryController(_extends({}, props)),
9165
9961
  _CategoryController$c = _CategoryController.categories,
9166
9962
  categories = _CategoryController$c === void 0 ? [] : _CategoryController$c;
9167
- var _ProductController = ProductController(props),
9963
+ var _ProductController = ProductController(_extends({}, props, {
9964
+ params: params
9965
+ })),
9168
9966
  _ProductController$pr = _ProductController.products,
9169
- products = _ProductController$pr === void 0 ? [] : _ProductController$pr;
9170
- console.log("Products10 products");
9967
+ products = _ProductController$pr === void 0 ? [] : _ProductController$pr,
9968
+ loading = _ProductController.loading;
9969
+ var _useState2 = useState(true),
9970
+ isFilter = _useState2[0],
9971
+ setIsFilter = _useState2[1];
9972
+ var handleChooseCategory = function handleChooseCategory(item) {
9973
+ setIsFilter(true);
9974
+ setParams(_extends({}, params, {
9975
+ categoryId: item === null || item === void 0 ? void 0 : item.categoryId,
9976
+ size: 12
9977
+ }));
9978
+ };
9979
+ var handleGetMoreProducts = function handleGetMoreProducts() {
9980
+ setIsFilter(false);
9981
+ setParams(_extends({}, params, {
9982
+ size: (params === null || params === void 0 ? void 0 : params.size) + 4
9983
+ }));
9984
+ };
9171
9985
  return /*#__PURE__*/React__default.createElement("div", {
9172
- className: "w-full pt-10 px-4 xl:px-20",
9173
- style: {
9174
- background: background,
9175
- color: textBody
9176
- }
9177
- }, /*#__PURE__*/React__default.createElement("h2", {
9178
- className: "text-2xl lg:text-3xl xl:text-4xl font-semibold mb-6"
9179
- }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement(CarouselItem, {
9180
- datas: categories,
9181
- primaryColor: primary,
9182
- textButtonColor: textButton,
9183
- renderItem: function renderItem(item, index) {
9184
- return /*#__PURE__*/React__default.createElement("div", {
9185
- key: item.categoryId + "-" + index,
9186
- className: "border-2 items whitespace-nowrap p-2 rounded-lg cursor-pointer ",
9187
- style: {
9188
- borderColor: primary,
9189
- color: selectCategory === item.categoryId ? textButton : primary,
9190
- background: selectCategory === item.categoryId ? primary : bgSecondary
9191
- },
9192
- onClick: function onClick() {
9193
- setSelectCategory(item.categoryId);
9194
- }
9195
- }, item.cateName);
9196
- }
9197
- }), /*#__PURE__*/React__default.createElement(ListProduct, {
9198
- datas: products,
9199
- renderItem: function renderItem(item, index) {
9200
- return /*#__PURE__*/React__default.createElement("div", {
9201
- key: "productfsd-" + index
9202
- }, /*#__PURE__*/React__default.createElement(ItemProduct, {
9203
- product: item.productInfo,
9204
- shopConfigStyle: shopConfigStyle
9205
- }));
9206
- }
9207
- }));
9986
+ className: SECTION_CLASS + " flex flex-col gap-4 md:gap-6 "
9987
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
9988
+ data: data,
9989
+ shopConfigStyle: shopConfigStyle
9990
+ }), /*#__PURE__*/React__default.createElement(CarouselItem, {
9991
+ data: categories,
9992
+ onClick: handleChooseCategory
9993
+ }), loading && isFilter ? /*#__PURE__*/React__default.createElement("div", {
9994
+ className: "m-auto mt-20 min-h-32"
9995
+ }, /*#__PURE__*/React__default.createElement(Loading, null)) : (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
9996
+ 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"
9997
+ }, 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) {
9998
+ return /*#__PURE__*/React__default.createElement(ProductItem, {
9999
+ Link: Link,
10000
+ shopConfigStyle: shopConfigStyle,
10001
+ product: product === null || product === void 0 ? void 0 : product.productInfo,
10002
+ key: "zjk-" + idx
10003
+ });
10004
+ })) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null), !loading && (products === null || products === void 0 ? void 0 : products.length) > (params === null || params === void 0 ? void 0 : params.size) - 4 ? /*#__PURE__*/React__default.createElement(Button, {
10005
+ label: "Xem thêm",
10006
+ onClick: handleGetMoreProducts,
10007
+ className: "mx-auto",
10008
+ type: "outline",
10009
+ shopConfigStyle: shopConfigStyle
10010
+ }) : null);
9208
10011
  };
9209
10012
 
9210
10013
  var ProductSale2 = function ProductSale2(props) {
@@ -9213,7 +10016,8 @@ var ProductSale2 = function ProductSale2(props) {
9213
10016
  _props$data = props.data,
9214
10017
  data = _props$data === void 0 ? {} : _props$data,
9215
10018
  _props$SectionTitle = props.SectionTitle,
9216
- SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
10019
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
10020
+ ProductItem = props.ProductItem;
9217
10021
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
9218
10022
  _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
9219
10023
  secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
@@ -9230,7 +10034,7 @@ var ProductSale2 = function ProductSale2(props) {
9230
10034
  }), /*#__PURE__*/React__default.createElement("div", {
9231
10035
  className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-10 mt-12"
9232
10036
  }, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
9233
- return /*#__PURE__*/React__default.createElement(ProductItem2, {
10037
+ return /*#__PURE__*/React__default.createElement(ProductItem, {
9234
10038
  key: index,
9235
10039
  product: product === null || product === void 0 ? void 0 : product.productInfo
9236
10040
  });
@@ -9243,13 +10047,171 @@ var ProductSale2 = function ProductSale2(props) {
9243
10047
  })) : null;
9244
10048
  };
9245
10049
 
10050
+ var ProductSearch1 = function ProductSearch1(props) {
10051
+ var _window, _window$location;
10052
+ var _props$Link = props.Link,
10053
+ Link = _props$Link === void 0 ? null : _props$Link,
10054
+ _props$SectionTitle = props.SectionTitle,
10055
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
10056
+ _props$ProductItem = props.ProductItem,
10057
+ ProductItem = _props$ProductItem === void 0 ? null : _props$ProductItem,
10058
+ shopConfigStyle = props.shopConfigStyle;
10059
+ 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);
10060
+ var keywordValue = queryParams === null || queryParams === void 0 ? void 0 : queryParams.get('keyword');
10061
+ var _useState = useState(0),
10062
+ length = _useState[0],
10063
+ setLength = _useState[1];
10064
+ var _useState2 = useState({
10065
+ productName: keywordValue,
10066
+ size: 24
10067
+ }),
10068
+ params = _useState2[0],
10069
+ setParams = _useState2[1];
10070
+ var _useState3 = useState(true),
10071
+ isGetMore = _useState3[0],
10072
+ setIsGetMore = _useState3[1];
10073
+ var _ProductController = ProductController(_extends({}, props, {
10074
+ params: params
10075
+ })),
10076
+ products = _ProductController.products,
10077
+ loading = _ProductController.loading;
10078
+ useEffect(function () {
10079
+ setParams(function (prev) {
10080
+ return _extends({}, prev, {
10081
+ productName: keywordValue
10082
+ });
10083
+ });
10084
+ }, [keywordValue]);
10085
+ var handleGetMoreProducts = function handleGetMoreProducts() {
10086
+ setIsGetMore(false);
10087
+ setLength(function (prev) {
10088
+ return prev + 4;
10089
+ });
10090
+ };
10091
+ var listFilter = [{
10092
+ label: "Khuyến mãi",
10093
+ value: "discount",
10094
+ filter: {
10095
+ isDiscount: true
10096
+ }
10097
+ }, {
10098
+ label: "Nổi bật",
10099
+ value: "highlight",
10100
+ filter: {
10101
+ isHighlight: true
10102
+ }
10103
+ }];
10104
+ var handleFilter = function handleFilter(item) {
10105
+ setParams(function (prev) {
10106
+ var _Object$keys;
10107
+ var newParams = _extends({}, prev);
10108
+ Object === null || Object === void 0 ? void 0 : (_Object$keys = Object.keys(newParams)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.forEach(function (key) {
10109
+ if (key !== 'productName' && key !== 'size') {
10110
+ delete newParams[key];
10111
+ }
10112
+ });
10113
+ return _extends({}, newParams, item === null || item === void 0 ? void 0 : item.filter);
10114
+ });
10115
+ };
10116
+ return /*#__PURE__*/React__default.createElement("div", {
10117
+ className: SECTION_CLASS + " flex flex-col gap-4 md:gap-6 "
10118
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
10119
+ data: {
10120
+ sectionTitle: "Kết quả tìm kiếm"
10121
+ },
10122
+ shopConfigStyle: shopConfigStyle
10123
+ }), /*#__PURE__*/React__default.createElement("div", {
10124
+ className: "text-lg"
10125
+ }, "T\u1EEB kh\xF3a \"", keywordValue, "\" (", products === null || products === void 0 ? void 0 : products.length, " s\u1EA3n ph\u1EA9m)"), /*#__PURE__*/React__default.createElement(CarouselItem, {
10126
+ data: listFilter,
10127
+ isNavigateButton: false,
10128
+ onClick: handleFilter
10129
+ }), loading && isGetMore ? /*#__PURE__*/React__default.createElement("div", {
10130
+ className: "m-auto mt-20 min-h-32"
10131
+ }, /*#__PURE__*/React__default.createElement(Loading, null)) : (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
10132
+ 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"
10133
+ }, products.slice(0, 8 + length).map(function (product, idx) {
10134
+ return /*#__PURE__*/React__default.createElement(ProductItem, {
10135
+ Link: Link,
10136
+ product: product === null || product === void 0 ? void 0 : product.productInfo,
10137
+ key: "htrhr-" + idx
10138
+ });
10139
+ })) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null), !loading && (products === null || products === void 0 ? void 0 : products.length) > 8 + length ? /*#__PURE__*/React__default.createElement(Button, {
10140
+ label: "Xem thêm",
10141
+ onClick: handleGetMoreProducts,
10142
+ className: "mx-auto " + (shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.buttonClass),
10143
+ type: "outline"
10144
+ }) : null);
10145
+ };
10146
+
10147
+ var ProductHot1 = function ProductHot1(props) {
10148
+ var _products$slice;
10149
+ var _props$Link = props.Link,
10150
+ Link = _props$Link === void 0 ? null : _props$Link,
10151
+ data = props.data,
10152
+ _props$shopConfigStyl = props.shopConfigStyle,
10153
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
10154
+ _props$SectionTitle = props.SectionTitle,
10155
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
10156
+ _props$ProductItem = props.ProductItem,
10157
+ ProductItem = _props$ProductItem === void 0 ? null : _props$ProductItem;
10158
+ var _useState = useState({
10159
+ sort: "ranked,DESC",
10160
+ size: 12
10161
+ }),
10162
+ params = _useState[0],
10163
+ setParams = _useState[1];
10164
+ var _useState2 = useState(true),
10165
+ isGetMore = _useState2[0],
10166
+ setIsGetMore = _useState2[1];
10167
+ var _ProductController = ProductController(_extends({}, props, {
10168
+ params: params
10169
+ })),
10170
+ _ProductController$pr = _ProductController.products,
10171
+ products = _ProductController$pr === void 0 ? [] : _ProductController$pr,
10172
+ loading = _ProductController.loading;
10173
+ var handleGetMoreProducts = function handleGetMoreProducts() {
10174
+ setIsGetMore(false);
10175
+ setParams(_extends({}, params, {
10176
+ size: (params === null || params === void 0 ? void 0 : params.size) + 4
10177
+ }));
10178
+ };
10179
+ return /*#__PURE__*/React__default.createElement("div", {
10180
+ className: SECTION_CLASS + " flex flex-col gap-4 md:gap-8"
10181
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
10182
+ data: data,
10183
+ shopConfigStyle: shopConfigStyle
10184
+ }), loading && isGetMore ? /*#__PURE__*/React__default.createElement("div", {
10185
+ className: "m-auto mt-20 min-h-32"
10186
+ }, /*#__PURE__*/React__default.createElement(Loading, null)) : (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
10187
+ 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"
10188
+ }, 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) {
10189
+ return /*#__PURE__*/React__default.createElement(ProductItem, {
10190
+ Link: Link,
10191
+ shopConfigStyle: shopConfigStyle,
10192
+ product: product === null || product === void 0 ? void 0 : product.productInfo,
10193
+ key: "zjk-" + idx
10194
+ });
10195
+ })) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null), !loading && (products === null || products === void 0 ? void 0 : products.length) > (params === null || params === void 0 ? void 0 : params.size) - 4 ? /*#__PURE__*/React__default.createElement(Button, {
10196
+ label: "Xem thêm",
10197
+ onClick: handleGetMoreProducts,
10198
+ className: "mx-auto",
10199
+ type: "outline",
10200
+ shopConfigStyle: shopConfigStyle
10201
+ }) : null);
10202
+ };
10203
+
9246
10204
  var ProductHot3 = function ProductHot3(props) {
9247
10205
  var _props$shopConfigStyl = props.shopConfigStyle,
9248
10206
  shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
9249
10207
  _props$data = props.data,
9250
10208
  data = _props$data === void 0 ? {} : _props$data,
9251
10209
  _props$SectionTitle = props.SectionTitle,
9252
- SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
10210
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
10211
+ _props$Link = props.Link,
10212
+ Link = _props$Link === void 0 ? null : _props$Link,
10213
+ _props$ProductItem = props.ProductItem,
10214
+ ProductItem = _props$ProductItem === void 0 ? null : _props$ProductItem;
9253
10215
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
9254
10216
  _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
9255
10217
  secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
@@ -9272,8 +10234,10 @@ var ProductHot3 = function ProductHot3(props) {
9272
10234
  }), /*#__PURE__*/React__default.createElement("div", {
9273
10235
  className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-10 mt-12"
9274
10236
  }, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
9275
- return /*#__PURE__*/React__default.createElement(ProductItem2, {
9276
- key: index,
10237
+ return /*#__PURE__*/React__default.createElement(ProductItem, {
10238
+ Link: Link,
10239
+ shopConfigStyle: shopConfigStyle,
10240
+ key: "htjtr-" + index,
9277
10241
  product: product === null || product === void 0 ? void 0 : product.productInfo
9278
10242
  });
9279
10243
  }))), /*#__PURE__*/React__default.createElement(Dash, {
@@ -9283,61 +10247,159 @@ var ProductHot3 = function ProductHot3(props) {
9283
10247
 
9284
10248
  var ProductsTop1 = function ProductsTop1(props) {
9285
10249
  var data = props.data,
9286
- shopConfigStyle = props.shopConfigStyle;
9287
- var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
9288
- _shopConfigStyle$colo2 = _shopConfigStyle$colo.background,
9289
- background = _shopConfigStyle$colo2 === void 0 ? "#fff" : _shopConfigStyle$colo2;
9290
- var _ProductController = ProductController(props),
10250
+ _props$shopConfigStyl = props.shopConfigStyle,
10251
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
10252
+ _props$SectionTitle = props.SectionTitle,
10253
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
10254
+ _props$ProductItem = props.ProductItem,
10255
+ ProductItem = _props$ProductItem === void 0 ? null : _props$ProductItem,
10256
+ _props$Link = props.Link,
10257
+ Link = _props$Link === void 0 ? null : _props$Link;
10258
+ var _useState = useState({
10259
+ size: 8
10260
+ }),
10261
+ params = _useState[0];
10262
+ var _ProductController = ProductController(_extends({}, props, {
10263
+ params: params
10264
+ })),
9291
10265
  _ProductController$pr = _ProductController.products,
9292
- products = _ProductController$pr === void 0 ? [] : _ProductController$pr;
10266
+ products = _ProductController$pr === void 0 ? [] : _ProductController$pr,
10267
+ loading = _ProductController.loading;
9293
10268
  console.log("ProductsTop1 products");
9294
10269
  return /*#__PURE__*/React__default.createElement("div", {
9295
- className: "w-full pt-10 px-4 xl:px-20",
9296
- style: {
9297
- background: background
9298
- }
9299
- }, /*#__PURE__*/React__default.createElement("h2", {
9300
- className: "text-2xl md:text-3xl lg:text-4xl font-semibold mb-6"
9301
- }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement(ListProduct, {
9302
- datas: products,
9303
- renderItem: function renderItem(item, index) {
9304
- return /*#__PURE__*/React__default.createElement("div", {
9305
- key: "productfsd-" + index
9306
- }, /*#__PURE__*/React__default.createElement(ItemProduct, {
9307
- product: item.productInfo,
9308
- shopConfigStyle: shopConfigStyle
9309
- }));
9310
- }
9311
- }));
10270
+ className: SECTION_DEFAULT_CLASS + " flex flex-col gap-8 "
10271
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
10272
+ data: data,
10273
+ shopConfigStyle: shopConfigStyle
10274
+ }), loading ? /*#__PURE__*/React__default.createElement("div", {
10275
+ className: "m-auto mt-20 min-h-32"
10276
+ }, /*#__PURE__*/React__default.createElement(Loading, null)) : (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
10277
+ 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"
10278
+ }, products === null || products === void 0 ? void 0 : products.map(function (product, idx) {
10279
+ return /*#__PURE__*/React__default.createElement(ProductItem, {
10280
+ Link: Link,
10281
+ className: "bg-bgSecondary border-0",
10282
+ shopConfigStyle: shopConfigStyle,
10283
+ product: product === null || product === void 0 ? void 0 : product.productInfo,
10284
+ key: "htrhr-" + idx
10285
+ });
10286
+ })) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null));
9312
10287
  };
9313
10288
 
9314
- var CartController = function CartController(props) {
9315
- var addToCart = props.addToCart,
9316
- dispatch = props.dispatch;
9317
- useEffect(function () {}, []);
9318
- var addProductToCart = function addProductToCart(product, variant, quantity) {
9319
- try {
9320
- try {
9321
- dispatch(addToCart({
9322
- product: product,
9323
- variant: variant,
9324
- quantity: quantity
9325
- }));
9326
- } catch (e) {
9327
- console.log(e);
9328
- }
9329
- return Promise.resolve();
9330
- } catch (e) {
9331
- return Promise.reject(e);
9332
- }
10289
+ var ProductList5 = function ProductList5(props) {
10290
+ var data = props.data,
10291
+ _props$Link = props.Link,
10292
+ Link = _props$Link === void 0 ? null : _props$Link,
10293
+ _props$SectionTitle = props.SectionTitle,
10294
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
10295
+ _props$ProductItem = props.ProductItem,
10296
+ ProductItem = _props$ProductItem === void 0 ? null : _props$ProductItem,
10297
+ _props$shopConfigStyl = props.shopConfigStyle,
10298
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl;
10299
+ var _useState = useState({
10300
+ size: 12
10301
+ }),
10302
+ params = _useState[0],
10303
+ setParams = _useState[1];
10304
+ var _useState2 = useState(true),
10305
+ isGetMore = _useState2[0],
10306
+ setIsGetMore = _useState2[1];
10307
+ var _ProductController = ProductController(_extends({}, props, {
10308
+ params: params
10309
+ })),
10310
+ products = _ProductController.products,
10311
+ loading = _ProductController.loading;
10312
+ var handleGetMoreProducts = function handleGetMoreProducts() {
10313
+ setIsGetMore(false);
10314
+ setParams(function (prev) {
10315
+ return _extends({}, prev, {
10316
+ size: (prev === null || prev === void 0 ? void 0 : prev.size) + 4
10317
+ });
10318
+ });
9333
10319
  };
9334
- return {
9335
- addProductToCart: addProductToCart
10320
+ return /*#__PURE__*/React__default.createElement("div", {
10321
+ className: SECTION_CLASS + " flex flex-col gap-8 "
10322
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
10323
+ data: data,
10324
+ shopConfigStyle: shopConfigStyle
10325
+ }), loading && isGetMore ? /*#__PURE__*/React__default.createElement("div", {
10326
+ className: "m-auto mt-20 min-h-32"
10327
+ }, /*#__PURE__*/React__default.createElement(Loading, null)) : (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
10328
+ 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"
10329
+ }, products.slice(0, params.size - 4).map(function (product, idx) {
10330
+ return /*#__PURE__*/React__default.createElement(ProductItem, {
10331
+ Link: Link,
10332
+ shopConfigStyle: shopConfigStyle,
10333
+ product: product === null || product === void 0 ? void 0 : product.productInfo,
10334
+ key: "htrhr-" + idx
10335
+ });
10336
+ })) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null), !loading && (products === null || products === void 0 ? void 0 : products.length) > (params === null || params === void 0 ? void 0 : params.size) - 4 ? /*#__PURE__*/React__default.createElement(Button, {
10337
+ label: "Xem thêm",
10338
+ onClick: handleGetMoreProducts,
10339
+ className: "mx-auto",
10340
+ type: "outline",
10341
+ shopConfigStyle: shopConfigStyle
10342
+ }) : null);
10343
+ };
10344
+
10345
+ var ProductHighlight1 = function ProductHighlight1(props) {
10346
+ var _products$slice;
10347
+ var _props$Link = props.Link,
10348
+ Link = _props$Link === void 0 ? null : _props$Link,
10349
+ data = props.data,
10350
+ shopConfigStyle = props.shopConfigStyle,
10351
+ _props$SectionTitle = props.SectionTitle,
10352
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
10353
+ _props$ProductItem = props.ProductItem,
10354
+ ProductItem = _props$ProductItem === void 0 ? null : _props$ProductItem;
10355
+ var _useState = useState(true),
10356
+ isGetMore = _useState[0],
10357
+ setIsGetMore = _useState[1];
10358
+ var _useState2 = useState({
10359
+ size: 8,
10360
+ isHighlight: true
10361
+ }),
10362
+ params = _useState2[0],
10363
+ setParams = _useState2[1];
10364
+ var _ProductController = ProductController(_extends({}, props, {
10365
+ params: params
10366
+ })),
10367
+ _ProductController$pr = _ProductController.products,
10368
+ products = _ProductController$pr === void 0 ? [] : _ProductController$pr,
10369
+ loading = _ProductController.loading;
10370
+ var handleGetMoreProducts = function handleGetMoreProducts() {
10371
+ setIsGetMore(false);
10372
+ setParams(_extends({}, params, {
10373
+ size: (params === null || params === void 0 ? void 0 : params.size) + 4
10374
+ }));
9336
10375
  };
10376
+ return /*#__PURE__*/React__default.createElement("div", {
10377
+ className: SECTION_CLASS + " flex flex-col gap-4 md:gap-6 "
10378
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
10379
+ data: data,
10380
+ shopConfigStyle: shopConfigStyle
10381
+ }), loading && isGetMore ? /*#__PURE__*/React__default.createElement("div", {
10382
+ className: "m-auto mt-20 min-h-32"
10383
+ }, /*#__PURE__*/React__default.createElement(Loading, null)) : (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
10384
+ 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"
10385
+ }, 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) {
10386
+ return /*#__PURE__*/React__default.createElement(ProductItem, {
10387
+ Link: Link,
10388
+ product: product === null || product === void 0 ? void 0 : product.productInfo,
10389
+ key: "zjk-" + idx
10390
+ });
10391
+ })) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null), !loading && (products === null || products === void 0 ? void 0 : products.length) > (params === null || params === void 0 ? void 0 : params.size) - 4 ? /*#__PURE__*/React__default.createElement(Button, {
10392
+ label: "Xem thêm",
10393
+ onClick: handleGetMoreProducts,
10394
+ className: "mx-auto " + (shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.buttonClass),
10395
+ type: "outline"
10396
+ }) : null);
9337
10397
  };
9338
10398
 
9339
10399
  var ProductDetail10 = function ProductDetail10(props) {
9340
- var shopConfigStyle = props.shopConfigStyle;
10400
+ var _product$images;
10401
+ var shopConfigStyle = props.shopConfigStyle,
10402
+ shopConfig = props.shopConfig;
9341
10403
  var _ProductDetailControl = ProductDetailController(props),
9342
10404
  product = _ProductDetailControl.product;
9343
10405
  var _useState = useState(),
@@ -9346,18 +10408,34 @@ var ProductDetail10 = function ProductDetail10(props) {
9346
10408
  var _useState2 = useState([]),
9347
10409
  options = _useState2[0],
9348
10410
  setOptions = _useState2[1];
10411
+ var _useState3 = useState(),
10412
+ displayImage = _useState3[0],
10413
+ setDisplayImage = _useState3[1];
10414
+ var _useState4 = useState(false),
10415
+ isSeeMore = _useState4[0],
10416
+ setIsSeeMore = _useState4[1];
10417
+ var _useState5 = useState(true),
10418
+ hiddenButton = _useState5[0],
10419
+ setHiddenButton = _useState5[1];
9349
10420
  var _CartController = CartController(props),
9350
10421
  addProductToCart = _CartController.addProductToCart;
9351
10422
  var refInputQuantity = useRef();
10423
+ var descriptionRef = useRef();
9352
10424
  useEffect(function () {
9353
10425
  if (product) {
9354
10426
  initVariant();
10427
+ if (descriptionRef.current) {
10428
+ var descriptionHeight = descriptionRef.current.offsetHeight;
10429
+ if (descriptionHeight >= 700) {
10430
+ setHiddenButton(false);
10431
+ }
10432
+ }
9355
10433
  }
9356
10434
  }, [product]);
9357
10435
  var initVariant = function initVariant() {
9358
- var _product$variants;
10436
+ var _product$variants, _variant$index;
9359
10437
  var variant = product === null || product === void 0 ? void 0 : (_product$variants = product.variants) === null || _product$variants === void 0 ? void 0 : _product$variants[0];
9360
- var indexOptions = variant.index.split(",");
10438
+ var indexOptions = variant === null || variant === void 0 ? void 0 : (_variant$index = variant.index) === null || _variant$index === void 0 ? void 0 : _variant$index.split(",");
9361
10439
  setVariant(variant);
9362
10440
  var options = (product === null || product === void 0 ? void 0 : product.optionValues) || [];
9363
10441
  options = options.map(function (e, i) {
@@ -9411,21 +10489,41 @@ var ProductDetail10 = function ProductDetail10(props) {
9411
10489
  }
9412
10490
  };
9413
10491
  var buyNow = function buyNow() {};
10492
+ var handleDisplayImage = function handleDisplayImage(item) {
10493
+ setDisplayImage(item);
10494
+ };
9414
10495
  return /*#__PURE__*/React__default.createElement("div", {
9415
- className: SECTION_DEFAULT_CLASS + " mb-0"
10496
+ 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")
9416
10497
  }, /*#__PURE__*/React__default.createElement("div", {
9417
- className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-3 gap-6 bg-bgSecondary"
9418
- }, /*#__PURE__*/React__default.createElement(ProductImage, {
10498
+ className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-5 gap-6 bg-bgSecondary"
10499
+ }, /*#__PURE__*/React__default.createElement("div", {
10500
+ className: "flex flex-col gap-4 col-span-2"
10501
+ }, displayImage ? /*#__PURE__*/React__default.createElement("img", {
10502
+ src: displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageUrl,
10503
+ className: "w-full aspect-square rounded-2xl "
10504
+ }) : /*#__PURE__*/React__default.createElement(ProductImage, {
9419
10505
  product: product,
9420
10506
  className: "w-full aspect-square rounded-2xl"
9421
10507
  }), /*#__PURE__*/React__default.createElement("div", {
9422
- className: "col-span-2"
10508
+ className: "flex gap-1 w-[80vw] overflow-x-auto md:w-full md:gap-2 md:flex-wrap"
10509
+ }, product === null || product === void 0 ? void 0 : (_product$images = product.images) === null || _product$images === void 0 ? void 0 : _product$images.map(function (item) {
10510
+ return /*#__PURE__*/React__default.createElement("img", {
10511
+ src: item === null || item === void 0 ? void 0 : item.imageUrl,
10512
+ key: item === null || item === void 0 ? void 0 : item.imageId,
10513
+ alt: "",
10514
+ 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"),
10515
+ onClick: function onClick() {
10516
+ handleDisplayImage(item);
10517
+ }
10518
+ });
10519
+ }))), /*#__PURE__*/React__default.createElement("div", {
10520
+ className: "col-span-3"
9423
10521
  }, /*#__PURE__*/React__default.createElement("p", {
9424
10522
  className: "font-semibold text-2xl"
9425
10523
  }, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
9426
10524
  product: product,
9427
10525
  variant: variant,
9428
- className: "mt-6"
10526
+ className: "mt-6 text-[22px]"
9429
10527
  }), options.map(function (option, index) {
9430
10528
  return /*#__PURE__*/React__default.createElement("div", {
9431
10529
  className: "flex gap-2 mt-6",
@@ -9445,7 +10543,7 @@ var ProductDetail10 = function ProductDetail10(props) {
9445
10543
  })));
9446
10544
  }), /*#__PURE__*/React__default.createElement(Input, {
9447
10545
  label: "Số lượng",
9448
- wrapClassName: "flex items-center gap-6 mt-6",
10546
+ wrapClassName: "flex items-center gap-6 mt-6 ",
9449
10547
  rules: [{
9450
10548
  type: "required",
9451
10549
  message: "Bắt buộc nhập số lượng"
@@ -9456,7 +10554,8 @@ var ProductDetail10 = function ProductDetail10(props) {
9456
10554
  }],
9457
10555
  defaultValue: 1,
9458
10556
  isQuantity: true,
9459
- min: 1,
10557
+ min: 0,
10558
+ className: "bg-background",
9460
10559
  ref: refInputQuantity
9461
10560
  }), /*#__PURE__*/React__default.createElement("div", {
9462
10561
  className: "flex gap-4 mt-6"
@@ -9474,13 +10573,29 @@ var ProductDetail10 = function ProductDetail10(props) {
9474
10573
  return buyNow();
9475
10574
  }
9476
10575
  })), /*#__PURE__*/React__default.createElement("p", {
9477
- className: "text-lg mt-12 pt-6 border-t border-stroke"
10576
+ className: "text-lg mt-12 text-xl pb-1 pt-6 border-t border-stroke"
9478
10577
  }, "M\xF4 t\u1EA3 s\u1EA3n ph\u1EA9m"), product !== null && product !== void 0 && product.description ? /*#__PURE__*/React__default.createElement("div", {
9479
- className: "mt-6",
10578
+ className: "h-max"
10579
+ }, /*#__PURE__*/React__default.createElement("div", {
10580
+ ref: descriptionRef,
10581
+ className: "" + (isSeeMore && !hiddenButton ? "h-full mb-4" : "max-h-[700px] overflow-hidden"),
9480
10582
  dangerouslySetInnerHTML: {
9481
10583
  __html: product === null || product === void 0 ? void 0 : product.description
9482
10584
  }
9483
- }) : /*#__PURE__*/React__default.createElement("div", {
10585
+ }), !isSeeMore && !hiddenButton ? /*#__PURE__*/React__default.createElement("div", {
10586
+ className: "h-10 relative -mt-10 rounded-b-lg",
10587
+ style: {
10588
+ background: "linear-gradient(to top, #81818169 0%, #00000003 50%)"
10589
+ }
10590
+ }) : null, !hiddenButton ? /*#__PURE__*/React__default.createElement("div", {
10591
+ className: "w-full flex justify-center mt-2"
10592
+ }, /*#__PURE__*/React__default.createElement(Button, {
10593
+ label: isSeeMore ? "Thu nhỏ" : "Xem thêm",
10594
+ className: " bottom-0 z-50",
10595
+ onClick: function onClick() {
10596
+ setIsSeeMore(!isSeeMore);
10597
+ }
10598
+ })) : null) : /*#__PURE__*/React__default.createElement("div", {
9484
10599
  className: "text-gray3 mt-2"
9485
10600
  }, "Kh\xF4ng c\xF3 th\xF4ng tin"))));
9486
10601
  };
@@ -9511,7 +10626,8 @@ var Booking1 = function Booking1(props) {
9511
10626
  className: "mt-12 grid grid-cols-1 gap-6 md:grid-cols-2 md:gap-12"
9512
10627
  }, /*#__PURE__*/React__default.createElement(BookingForm, {
9513
10628
  shopConfigStyle: shopConfigStyle,
9514
- shopConfig: shopConfig
10629
+ shopConfig: shopConfig,
10630
+ className: "!bg-bgSecondary"
9515
10631
  }), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
9516
10632
  className: "text-xl"
9517
10633
  }, 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), /*#__PURE__*/React__default.createElement("div", {
@@ -9519,15 +10635,51 @@ var Booking1 = function Booking1(props) {
9519
10635
  }, 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$.description))));
9520
10636
  };
9521
10637
 
10638
+ var BookingForm6 = function BookingForm6(props) {
10639
+ var _data$data, _data$data$, _data$data2, _data$data2$;
10640
+ var _props$shopConfigStyl = props.shopConfigStyle,
10641
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
10642
+ _props$shopConfig = props.shopConfig,
10643
+ shopConfig = _props$shopConfig === void 0 ? {} : _props$shopConfig,
10644
+ _props$data = props.data,
10645
+ data = _props$data === void 0 ? {} : _props$data,
10646
+ _props$SectionTitle = props.SectionTitle,
10647
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
10648
+ console.log("booking data", data);
10649
+ return /*#__PURE__*/React__default.createElement("div", {
10650
+ className: "relative w-full px-4 xl:px-20 py-12 bg-bgSecondary"
10651
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
10652
+ data: data,
10653
+ shopConfigStyle: shopConfigStyle
10654
+ }), /*#__PURE__*/React__default.createElement("div", {
10655
+ className: "mt-12 grid grid-cols-1 gap-6 md:grid-cols-3 md:gap-12"
10656
+ }, /*#__PURE__*/React__default.createElement("div", {
10657
+ className: ""
10658
+ }, /*#__PURE__*/React__default.createElement("img", {
10659
+ 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$.srcImage,
10660
+ className: "w-full h-auto"
10661
+ }), /*#__PURE__*/React__default.createElement("div", {
10662
+ className: "mt-4 whitespace-pre-line"
10663
+ }, 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$.description)), /*#__PURE__*/React__default.createElement(BookingForm, {
10664
+ shopConfigStyle: shopConfigStyle,
10665
+ shopConfig: shopConfig,
10666
+ className: "col-span-2"
10667
+ })));
10668
+ };
10669
+
9522
10670
  var Banner1 = function Banner1(props) {
9523
- var data = props.data;
10671
+ var data = props.data,
10672
+ shopConfigStyle = props.shopConfigStyle,
10673
+ _props$SectionTitle = props.SectionTitle,
10674
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
9524
10675
  var sectionData = data === null || data === void 0 ? void 0 : data.data;
9525
10676
  return /*#__PURE__*/React__default.createElement("div", {
9526
- className: "w-full pt-10 px-4 xl:px-20 bg-background"
9527
- }, /*#__PURE__*/React__default.createElement("h3", {
9528
- className: "text-2xl lg:text-3xl xl:text-4xl font-semibold"
9529
- }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement("div", {
9530
- className: "grid grid-cols-1 sm:grid-cols-3 gap-6 mt-6"
10677
+ className: "" + SECTION_DEFAULT_CLASS
10678
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
10679
+ data: data,
10680
+ shopConfigStyle: shopConfigStyle
10681
+ }), /*#__PURE__*/React__default.createElement("div", {
10682
+ className: "grid grid-cols-1 sm:grid-cols-3 gap-4 lg:gap-6 mt-6"
9531
10683
  }, sectionData && sectionData.length > 0 && sectionData.map(function (item, index) {
9532
10684
  return /*#__PURE__*/React__default.createElement("img", {
9533
10685
  src: item === null || item === void 0 ? void 0 : item.srcImage,
@@ -9538,9 +10690,44 @@ var Banner1 = function Banner1(props) {
9538
10690
  })));
9539
10691
  };
9540
10692
 
10693
+ var Banner3 = function Banner3(props) {
10694
+ var data = props.data;
10695
+ var sectionData = data === null || data === void 0 ? void 0 : data.data;
10696
+ return /*#__PURE__*/React__default.createElement("div", {
10697
+ className: SECTION_CLASS + " grid grid-cols-1 md:grid-cols-3 gap-5"
10698
+ }, sectionData === null || sectionData === void 0 ? void 0 : sectionData.map(function (item, index) {
10699
+ return /*#__PURE__*/React__default.createElement("img", {
10700
+ src: item === null || item === void 0 ? void 0 : item.srcImage,
10701
+ className: "bg-cover bg-no-repeat h-full rounded-xl"
10702
+ });
10703
+ }));
10704
+ };
10705
+
10706
+ var BannerFull1 = function BannerFull1(props) {
10707
+ var data = props.data;
10708
+ var sectionData = data === null || data === void 0 ? void 0 : data.data;
10709
+ return /*#__PURE__*/React__default.createElement("div", {
10710
+ className: "" + SECTION_CLASS
10711
+ }, /*#__PURE__*/React__default.createElement("img", {
10712
+ src: sectionData === null || sectionData === void 0 ? void 0 : sectionData.srcImages,
10713
+ className: "bg-cover bg-no-repeat w-full rounded-xl"
10714
+ }));
10715
+ };
10716
+
10717
+ var BannerFull2 = function BannerFull2(props) {
10718
+ var _data$data;
10719
+ var data = props.data;
10720
+ return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("img", {
10721
+ src: data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.srcImages,
10722
+ className: "w-full h-auto object-cover "
10723
+ }));
10724
+ };
10725
+
9541
10726
  var Partner1 = function Partner1(props) {
9542
10727
  var shopConfigStyle = props.shopConfigStyle,
9543
- data = props.data;
10728
+ data = props.data,
10729
+ _props$SectionTitle = props.SectionTitle,
10730
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
9544
10731
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
9545
10732
  _shopConfigStyle$colo5 = _shopConfigStyle$colo.background,
9546
10733
  background = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5,
@@ -9548,14 +10735,15 @@ var Partner1 = function Partner1(props) {
9548
10735
  bgSecondary = _shopConfigStyle$colo6 === void 0 ? "#fff" : _shopConfigStyle$colo6;
9549
10736
  var sectionData = data === null || data === void 0 ? void 0 : data.data;
9550
10737
  return /*#__PURE__*/React__default.createElement("div", {
9551
- className: "w-full pt-10 px-4 xl:px-20",
10738
+ className: "" + SECTION_DEFAULT_CLASS,
9552
10739
  style: {
9553
10740
  background: background
9554
10741
  }
9555
- }, /*#__PURE__*/React__default.createElement("h2", {
9556
- className: "text-2xl lg:text-3xl xl:text-4xl font-semibold"
9557
- }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement("div", {
9558
- className: "grid grid-cols-4 md:grid-cols-6 gap-4 mt-6 p-6 rounded-xl",
10742
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
10743
+ data: data,
10744
+ shopConfigStyle: shopConfigStyle
10745
+ }), /*#__PURE__*/React__default.createElement("div", {
10746
+ className: "grid grid-cols-4 md:grid-cols-6 gap-6 mt-4 md:mt-6 p-6 rounded-xl",
9559
10747
  style: {
9560
10748
  background: bgSecondary
9561
10749
  }
@@ -9571,7 +10759,12 @@ var Partner1 = function Partner1(props) {
9571
10759
 
9572
10760
  var Address1 = function Address1(props) {
9573
10761
  var shopConfigStyle = props.shopConfigStyle,
9574
- data = props.data;
10762
+ shopConfig = props.shopConfig,
10763
+ data = props.data,
10764
+ _props$SectionTitle = props.SectionTitle,
10765
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
10766
+ _props$Link = props.Link,
10767
+ Link = _props$Link === void 0 ? null : _props$Link;
9575
10768
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
9576
10769
  _shopConfigStyle$colo3 = _shopConfigStyle$colo.textBody,
9577
10770
  textBody = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
@@ -9579,18 +10772,42 @@ var Address1 = function Address1(props) {
9579
10772
  background = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5,
9580
10773
  _shopConfigStyle$colo6 = _shopConfigStyle$colo.bgSecondary,
9581
10774
  bgSecondary = _shopConfigStyle$colo6 === void 0 ? "#fff" : _shopConfigStyle$colo6;
9582
- var sectionData = data === null || data === void 0 ? void 0 : data.data;
10775
+ var _useState = useState([]),
10776
+ shopAddressList = _useState[0],
10777
+ setShopAddressList = _useState[1];
10778
+ useEffect(function () {
10779
+ genShopAddress();
10780
+ }, [shopConfig]);
10781
+ var genShopAddress = function genShopAddress() {
10782
+ try {
10783
+ var addressJson = JSON.parse(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopAddress);
10784
+ if (addressJson) {
10785
+ setShopAddressList(addressJson);
10786
+ } else {
10787
+ setShopAddressList([{
10788
+ address: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopAddress,
10789
+ phone: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopPhone
10790
+ }]);
10791
+ }
10792
+ } catch (e) {
10793
+ setShopAddressList([{
10794
+ address: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopAddress,
10795
+ phone: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopPhone
10796
+ }]);
10797
+ }
10798
+ };
9583
10799
  return /*#__PURE__*/React__default.createElement("div", {
9584
- className: "w-full pt-10 px-4 xl:px-20 ",
10800
+ className: "" + SECTION_DEFAULT_CLASS,
9585
10801
  style: {
9586
10802
  background: background,
9587
10803
  color: textBody
9588
10804
  }
9589
- }, /*#__PURE__*/React__default.createElement("h2", {
9590
- className: "text-2xl lg:text-3xl xl:text-4xl font-semibold"
9591
- }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement("div", {
9592
- className: "grid grid-cols-2 sm:grid-cols-3 gap-4 mt-6 "
9593
- }, sectionData && sectionData.length > 0 && sectionData.map(function (item, index) {
10805
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
10806
+ data: data,
10807
+ shopConfigStyle: shopConfigStyle
10808
+ }), /*#__PURE__*/React__default.createElement("div", {
10809
+ className: "grid grid-cols-2 sm:grid-cols-3 gap-4 lg:gap-6 mt-6 "
10810
+ }, shopAddressList && shopAddressList.length > 0 && (shopAddressList === null || shopAddressList === void 0 ? void 0 : shopAddressList.map(function (item, index) {
9594
10811
  return /*#__PURE__*/React__default.createElement("div", {
9595
10812
  className: "lg:leading-6 p-4 rounded-xl",
9596
10813
  key: "fyfoy-" + index,
@@ -9599,30 +10816,39 @@ var Address1 = function Address1(props) {
9599
10816
  }
9600
10817
  }, /*#__PURE__*/React__default.createElement("div", {
9601
10818
  className: "font-semibold mb-3"
9602
- }, item.city), /*#__PURE__*/React__default.createElement("div", null, item.address), /*#__PURE__*/React__default.createElement("div", {
10819
+ }, item !== null && item !== void 0 && item.city ? item === null || item === void 0 ? void 0 : item.city : "Hà Nội"), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.address), /*#__PURE__*/React__default.createElement("div", {
9603
10820
  className: "sm:flex justify-between mt-3"
9604
- }, /*#__PURE__*/React__default.createElement("small", null, item.open), /*#__PURE__*/React__default.createElement("a", {
10821
+ }, /*#__PURE__*/React__default.createElement("small", null, "M\u1EDF c\u1EEDa 08:00-21:00"), /*#__PURE__*/React__default.createElement(LinkToPage, {
10822
+ Link: Link,
9605
10823
  href: "#"
9606
10824
  }, /*#__PURE__*/React__default.createElement("small", {
9607
10825
  className: "text-primary block"
9608
10826
  }, "Ch\u1EC9 \u0111\u01B0\u1EDDng ", /*#__PURE__*/React__default.createElement(FaArrowRight, {
9609
10827
  className: "inline-block\t text-primary"
9610
10828
  }), " "))));
9611
- })));
10829
+ }))));
9612
10830
  };
9613
10831
 
9614
10832
  var Links1 = function Links1(props) {
9615
- var data = props.data;
9616
- var sectionData = data === null || data === void 0 ? void 0 : data.data;
10833
+ var data = props.data,
10834
+ _props$SectionTitle = props.SectionTitle,
10835
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
10836
+ _props$shopConfigStyl = props.shopConfigStyle,
10837
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl;
9617
10838
  return /*#__PURE__*/React__default.createElement("div", {
9618
- className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 w-full pt-10 px-4 xl:px-20 bg-background"
9619
- }, sectionData && sectionData.length > 0 && sectionData.map(function (item, index) {
10839
+ className: "" + SECTION_DEFAULT_CLASS
10840
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
10841
+ data: data,
10842
+ shopConfigStyle: shopConfigStyle
10843
+ }), /*#__PURE__*/React__default.createElement("div", {
10844
+ className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 md:gap-6 lg:gap-8 w-full bg-background"
10845
+ }, [1, 2, 3].map(function (item, index) {
9620
10846
  return /*#__PURE__*/React__default.createElement("div", {
9621
- key: "qwikf-" + index
10847
+ key: "qwikf-" + index + " "
9622
10848
  }, /*#__PURE__*/React__default.createElement("h4", {
9623
10849
  className: "text-lg md:text-xl lg:text-2xl font-semibold mb-4"
9624
10850
  }, "\u0110a d\u1EA1ng thanh to\xE1n"), /*#__PURE__*/React__default.createElement("div", {
9625
- className: "leading-10 flex flex-col bg-background2 p-4 rounded-xl h-72 "
10851
+ className: "leading-10 flex flex-col bg-background2 p-4 rounded-xl bg-bgSecondary "
9626
10852
  }, /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement(FaArrowsRotate, {
9627
10853
  className: "inline-block\t text-primary text-2xl mb-1 me-3"
9628
10854
  }), " Chuy\u1EC3n kho\u1EA3n"), /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement(BsCurrencyDollar, {
@@ -9632,93 +10858,126 @@ var Links1 = function Links1(props) {
9632
10858
  }), " Th\u1EBB ATM"), /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement(SiVisa, {
9633
10859
  className: "inline-block\t text-primary text-2xl mb-1 me-3"
9634
10860
  }), " Th\u1EBB Qu\u1ED1c t\u1EBF")));
9635
- }));
10861
+ })));
9636
10862
  };
9637
10863
 
9638
10864
  var Footer1 = function Footer1(props) {
9639
- var shopConfigStyle = props.shopConfigStyle;
10865
+ var _routes$filter;
10866
+ var shopConfig = props.shopConfig,
10867
+ shopConfigStyle = props.shopConfigStyle,
10868
+ _props$Link = props.Link,
10869
+ Link = _props$Link === void 0 ? null : _props$Link,
10870
+ _props$routes = props.routes,
10871
+ routes = _props$routes === void 0 ? [] : _props$routes;
9640
10872
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
9641
10873
  _shopConfigStyle$colo2 = _shopConfigStyle$colo.primary,
9642
10874
  primary = _shopConfigStyle$colo2 === void 0 ? "#000" : _shopConfigStyle$colo2,
9643
- _shopConfigStyle$colo3 = _shopConfigStyle$colo.textBody,
9644
- textBody = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
9645
10875
  _shopConfigStyle$colo4 = _shopConfigStyle$colo.textButton,
9646
- textButton = _shopConfigStyle$colo4 === void 0 ? "#fff" : _shopConfigStyle$colo4,
9647
- _shopConfigStyle$colo5 = _shopConfigStyle$colo.bgSecondary,
9648
- bgSecondary = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5;
9649
- return /*#__PURE__*/React__default.createElement("div", {
9650
- className: "footer px-4 py-10 xl:px-20 ",
9651
- style: {
9652
- background: bgSecondary,
9653
- color: textBody
10876
+ textButton = _shopConfigStyle$colo4 === void 0 ? "#fff" : _shopConfigStyle$colo4;
10877
+ var _useState = useState([]),
10878
+ shopAddressList = _useState[0],
10879
+ setShopAddressList = _useState[1];
10880
+ useEffect(function () {
10881
+ genShopAddress();
10882
+ }, [shopConfig]);
10883
+ var genShopAddress = function genShopAddress() {
10884
+ try {
10885
+ var addressJson = JSON.parse(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopAddress);
10886
+ if (addressJson) {
10887
+ setShopAddressList(addressJson);
10888
+ } else {
10889
+ setShopAddressList([{
10890
+ address: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopAddress,
10891
+ phone: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopPhone
10892
+ }]);
10893
+ }
10894
+ } catch (e) {
10895
+ setShopAddressList([{
10896
+ address: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopAddress,
10897
+ phone: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopPhone
10898
+ }]);
9654
10899
  }
10900
+ };
10901
+ return /*#__PURE__*/React__default.createElement("div", {
10902
+ className: SECTION_CLASS + " !md:my-0 !my-0 pt-12 bg-bgSecondary"
9655
10903
  }, /*#__PURE__*/React__default.createElement("div", {
9656
10904
  className: "flex items-center"
9657
10905
  }, /*#__PURE__*/React__default.createElement("img", {
9658
- className: "object-cover w-14 ",
9659
- src: "https://s3-alpha-sig.figma.com/img/05e9/1165/8608d0a8b864cc9e15fa74b32f8bfabc?Expires=1730073600&Key-Pair-Id=APKAQ4GOSFWCVNEHN3O4&Signature=qkNnTVXTSs7-CbaDRo5jFJm9a5drVP9BvVPKX8ToQS4fi0lKL0atq45SIxxzXQV21dgoMvHvNZwO5-lsnrq6hbeedSkTWSWLrU65pUy7X9W0d20kGMLnP5KH3RWdZ0bfgJ9ZvRBbsqMz1bIucbLNeAt8PLaHvLl4HLKz5qvKVbWb6j098vwScj6LI51qG2y01N9qu051QWzOj5ijYS7qWNXT1PTlf4o07xAThnGObDdatBIaocIQPno6srkWK~agAdBrW9IdE~l3UP5XBP~pR~zvLGiniYloQoDvAscoaYr2aTTjf6z9DQLl35WBbNGKrWcKFA80WAE69QdpNJxckQ__",
10906
+ className: "object-cover w-16 h-16",
10907
+ src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
9660
10908
  alt: ""
9661
10909
  }), /*#__PURE__*/React__default.createElement("h3", {
9662
10910
  className: " text-2xl md:text-3xl font-semibold ms-2",
9663
10911
  style: {
9664
10912
  color: primary
9665
10913
  }
9666
- }, "\u0110i\u1EC7n m\xE1y H\u1EA3i Anh")), /*#__PURE__*/React__default.createElement("div", {
10914
+ }, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName)), /*#__PURE__*/React__default.createElement("div", {
9667
10915
  className: "mt-6 grid grid-cols-1 sm:grid-cols-4 mb-12"
9668
10916
  }, /*#__PURE__*/React__default.createElement("div", {
9669
- className: " col-span-2 flex flex-col leading-8 mb-10 sm:mb-0 "
10917
+ className: " col-span-2 flex flex-col mb-10 leading-8 sm:mb-0 "
9670
10918
  }, /*#__PURE__*/React__default.createElement("div", {
9671
10919
  className: "mb-3 font-semibold text-md md:text-lg"
9672
- }, "Th\xF4ng tin li\xEAn h\u1EC7"), /*#__PURE__*/React__default.createElement("div", null, "C\u01A1 s\u1EDF 1"), /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement(IoLocationOutline, {
9673
- className: " inline-block\t text-2xl",
9674
- style: {
9675
- color: primary
9676
- }
9677
- }), " S\u1ED1 18 Tam Trinh, Hai B\xE0 Tr\u01B0ng, H\xE0 N\u1ED9i"), /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement(FaPhone, {
9678
- className: "inline-block ms-1 me-2 mb-2",
9679
- style: {
9680
- color: primary
9681
- }
9682
- }), /*#__PURE__*/React__default.createElement("span", null, "0123456789")), /*#__PURE__*/React__default.createElement("div", {
9683
- className: "mt-6"
9684
- }, "C\u01A1 s\u1EDF 2"), /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement(IoLocationOutline, {
9685
- className: "inline-block text-2xl",
9686
- style: {
9687
- color: primary
9688
- }
9689
- }), " S\u1ED1 18 Tam Trinh, Hai B\xE0 Tr\u01B0ng, H\xE0 N\u1ED9i"), /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement(FaPhone, {
9690
- className: "inline-block ms-1 me-2 mb-2",
9691
- style: {
9692
- color: primary
9693
- }
9694
- }), /*#__PURE__*/React__default.createElement("span", null, "0123456789"))), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
9695
- className: "mb-4 font-semibold text-lg"
10920
+ }, "Th\xF4ng tin li\xEAn h\u1EC7"), shopAddressList === null || shopAddressList === void 0 ? void 0 : shopAddressList.map(function (item, index) {
10921
+ 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", {
10922
+ className: "flex gap-1 items-center"
10923
+ }, /*#__PURE__*/React__default.createElement(IoLocationOutline, {
10924
+ size: 24,
10925
+ className: "inline-block",
10926
+ style: {
10927
+ color: primary
10928
+ }
10929
+ }), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.address)), /*#__PURE__*/React__default.createElement("div", {
10930
+ className: "flex gap-2 items-center"
10931
+ }, /*#__PURE__*/React__default.createElement(IoCallOutline, {
10932
+ size: 24,
10933
+ className: "inline-block",
10934
+ style: {
10935
+ color: primary
10936
+ }
10937
+ }), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.phone)));
10938
+ })), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
10939
+ className: "mb-3 font-semibold text-lg"
9696
10940
  }, "Li\xEAn k\u1EBFt"), /*#__PURE__*/React__default.createElement("div", {
9697
10941
  className: "leading-10 flex flex-col "
9698
- }, /*#__PURE__*/React__default.createElement("label", null, "D\u1ECBch v\u1EE5"), /*#__PURE__*/React__default.createElement("label", null, "S\u1EA3n ph\u1EA9m"), /*#__PURE__*/React__default.createElement("label", null, "\u0110\u1EB7t l\u1ECBch"), /*#__PURE__*/React__default.createElement("label", null, "Gi\u1EDBi thi\u1EC7u"))), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
10942
+ }, routes === null || routes === void 0 ? void 0 : (_routes$filter = routes.filter(function (e) {
10943
+ return e === null || e === void 0 ? void 0 : e.isShow;
10944
+ })) === null || _routes$filter === void 0 ? void 0 : _routes$filter.map(function (route, index) {
10945
+ return /*#__PURE__*/React__default.createElement(LinkToPage, {
10946
+ Link: Link,
10947
+ href: route === null || route === void 0 ? void 0 : route.route
10948
+ }, /*#__PURE__*/React__default.createElement("div", null, route === null || route === void 0 ? void 0 : route.label));
10949
+ }))), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
9699
10950
  className: "font-semibold mb-4 text-lg"
9700
10951
  }, "H\u1ED7 tr\u1EE3"), /*#__PURE__*/React__default.createElement("div", {
9701
- className: "flex justify-start items-center"
9702
- }, /*#__PURE__*/React__default.createElement(FaFacebookSquare, {
10952
+ className: "flex justify-start items-center gap-4"
10953
+ }, /*#__PURE__*/React__default.createElement("a", {
10954
+ href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopFacebookPage) || "#"
10955
+ }, /*#__PURE__*/React__default.createElement(FaFacebookF, {
10956
+ size: 40,
10957
+ color: textButton,
10958
+ className: "p-2 rounded-lg",
9703
10959
  style: {
9704
- fontSize: "43px",
9705
- color: primary
10960
+ background: primary
9706
10961
  }
9707
- }), /*#__PURE__*/React__default.createElement(FaFacebookMessenger, {
9708
- className: " p-2 rounded-lg mx-2",
10962
+ })), /*#__PURE__*/React__default.createElement("a", {
10963
+ href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopMessenger) || "#"
10964
+ }, /*#__PURE__*/React__default.createElement(FaFacebookMessenger, {
10965
+ size: 40,
10966
+ color: textButton,
10967
+ className: "p-2 rounded-lg",
9709
10968
  style: {
9710
- fontSize: "40px",
9711
- color: textButton,
9712
10969
  background: primary
9713
10970
  }
9714
- }), /*#__PURE__*/React__default.createElement(SiZalo, {
10971
+ })), /*#__PURE__*/React__default.createElement("a", {
10972
+ href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopZalo) || "#"
10973
+ }, /*#__PURE__*/React__default.createElement(SiZalo, {
10974
+ size: 40,
10975
+ color: textButton,
9715
10976
  className: "p-2 rounded-lg",
9716
10977
  style: {
9717
- fontSize: "40px",
9718
- color: textButton,
9719
10978
  background: primary
9720
10979
  }
9721
- })))), /*#__PURE__*/React__default.createElement("hr", null), /*#__PURE__*/React__default.createElement("div", {
10980
+ }))))), /*#__PURE__*/React__default.createElement("hr", null), /*#__PURE__*/React__default.createElement("div", {
9722
10981
  className: "mt-6"
9723
10982
  }, /*#__PURE__*/React__default.createElement("small", {
9724
10983
  className: "me-5"
@@ -9898,6 +11157,157 @@ var RatingStar = function RatingStar(props) {
9898
11157
  }, res);
9899
11158
  };
9900
11159
 
11160
+ var CustomerRating1 = function CustomerRating1(props) {
11161
+ var _data$data;
11162
+ var _props$shopConfigStyl = props.shopConfigStyle,
11163
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
11164
+ _props$data = props.data,
11165
+ data = _props$data === void 0 ? {} : _props$data,
11166
+ _props$SectionTitle = props.SectionTitle,
11167
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
11168
+ var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
11169
+ _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
11170
+ secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
11171
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
11172
+ className: SECTION_DEFAULT_CLASS
11173
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
11174
+ data: data,
11175
+ shopConfigStyle: shopConfigStyle
11176
+ }), /*#__PURE__*/React__default.createElement("div", {
11177
+ className: "mt-4 md:mt-8 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 xl:gap-6"
11178
+ }, data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.map(function (item, index) {
11179
+ return /*#__PURE__*/React__default.createElement("div", {
11180
+ key: index,
11181
+ className: "border rounded-lg bg-bgSecondary p-3 md:p-4"
11182
+ }, /*#__PURE__*/React__default.createElement("div", {
11183
+ className: "flex items-end gap-2"
11184
+ }, /*#__PURE__*/React__default.createElement("img", {
11185
+ src: item === null || item === void 0 ? void 0 : item.avatar,
11186
+ className: "w-20 h-20 rounded-full object-cover object-center"
11187
+ }), /*#__PURE__*/React__default.createElement("div", {
11188
+ className: "ml-4"
11189
+ }, /*#__PURE__*/React__default.createElement("div", {
11190
+ className: "mb-1 font-medium"
11191
+ }, item === null || item === void 0 ? void 0 : item.name), /*#__PURE__*/React__default.createElement(RatingStar, {
11192
+ star: (item === null || item === void 0 ? void 0 : item.rate) || 5
11193
+ }))), /*#__PURE__*/React__default.createElement("div", {
11194
+ className: "mt-4"
11195
+ }, "\"", item === null || item === void 0 ? void 0 : item.content, "\""));
11196
+ }))), /*#__PURE__*/React__default.createElement(Dash, {
11197
+ color: secondary
11198
+ }));
11199
+ };
11200
+
11201
+ var CustomerRating5 = function CustomerRating5(props) {
11202
+ var _props$data = props.data,
11203
+ data = _props$data === void 0 ? {} : _props$data;
11204
+ var _useState = useState(0),
11205
+ currentIndex = _useState[0],
11206
+ setCurrentIndex = _useState[1];
11207
+ var sectionData = data === null || data === void 0 ? void 0 : data.data;
11208
+ var _useState2 = useState(0),
11209
+ startX = _useState2[0],
11210
+ setStartX = _useState2[1];
11211
+ var _useState3 = useState(0),
11212
+ endX = _useState3[0],
11213
+ setEndX = _useState3[1];
11214
+ var sliderRef = useRef();
11215
+ var handleTouchStart = function handleTouchStart(e) {
11216
+ var touchStart = e.touches[0].clientX;
11217
+ setStartX(touchStart);
11218
+ };
11219
+ var handleTouchMove = function handleTouchMove(e) {
11220
+ var touchMove = e.touches[0].clientX;
11221
+ setEndX(touchMove);
11222
+ };
11223
+ var handleTouchEnd = function handleTouchEnd() {
11224
+ var diff = startX - endX;
11225
+ var threshold = sliderRef.current.offsetWidth / 3;
11226
+ if (diff > threshold && currentIndex < sectionData.length - 1) {
11227
+ setCurrentIndex(currentIndex + 1);
11228
+ } else if (diff < -threshold && currentIndex > 0) {
11229
+ setCurrentIndex(currentIndex - 1);
11230
+ }
11231
+ };
11232
+ return /*#__PURE__*/React__default.createElement("div", {
11233
+ className: SECTION_CLASS + " mx-0 md:mx-4 xl:mx-20 rounded-xl relative"
11234
+ }, /*#__PURE__*/React__default.createElement("div", {
11235
+ className: "absolute mt-16 inset-0 bg-bgSecondary [clip-path:polygon(0%_0%,_100%_30%,_100%_100%,_0%_100%)] z-0 rounded-3xl"
11236
+ }), /*#__PURE__*/React__default.createElement("div", {
11237
+ className: "w-full relative z-10 border border-textHeading rounded-3xl flex overflow-hidden",
11238
+ ref: sliderRef,
11239
+ onTouchStart: handleTouchStart,
11240
+ onTouchMove: handleTouchMove,
11241
+ onTouchEnd: handleTouchEnd
11242
+ }, /*#__PURE__*/React__default.createElement("div", {
11243
+ className: "flex justify-start transition-transform duration-300",
11244
+ style: {
11245
+ transform: "translateX(-" + currentIndex * 100 + "%)"
11246
+ }
11247
+ }, sectionData === null || sectionData === void 0 ? void 0 : sectionData.map(function (item, index) {
11248
+ return /*#__PURE__*/React__default.createElement("div", {
11249
+ className: "flex flex-col px-2 py-2 md:px-6 lg:px-12 md:py-6 items-center md:flex-row gap-6 md:gap-12 min-w-full overflow-hidden",
11250
+ key: "lpky-" + index
11251
+ }, /*#__PURE__*/React__default.createElement("img", {
11252
+ src: item === null || item === void 0 ? void 0 : item.avatar,
11253
+ className: "w-80 h-96 object-cover rounded-3xl"
11254
+ }), /*#__PURE__*/React__default.createElement("div", {
11255
+ className: "flex flex-col items-center md:items-start gap-6 justify-center"
11256
+ }, /*#__PURE__*/React__default.createElement("div", {
11257
+ className: "text-4xl font-semibold"
11258
+ }, item === null || item === void 0 ? void 0 : item.name), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.content), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.description)));
11259
+ })), /*#__PURE__*/React__default.createElement("div", {
11260
+ className: "absolute bottom-2 md:bottom-20 lg:bottom-[30%] left-1/2 md:left-2/3 xl:left-1/2 transform -translate-x-1/2 flex gap-2"
11261
+ }, sectionData === null || sectionData === void 0 ? void 0 : sectionData.map(function (_, index) {
11262
+ return /*#__PURE__*/React__default.createElement("div", {
11263
+ key: "dot-" + index,
11264
+ onClick: function onClick() {
11265
+ setCurrentIndex(index);
11266
+ },
11267
+ className: (currentIndex === index ? "w-6 bg-primary" : "w-3 bg-gray4") + " h-3 rounded-full hover:opacity-80 cursor-pointer "
11268
+ });
11269
+ }))));
11270
+ };
11271
+
11272
+ var CustomerRating6 = function CustomerRating6(props) {
11273
+ var _data$data;
11274
+ var _props$shopConfigStyl = props.shopConfigStyle,
11275
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
11276
+ _props$data = props.data,
11277
+ data = _props$data === void 0 ? {} : _props$data,
11278
+ _props$SectionTitle = props.SectionTitle,
11279
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
11280
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
11281
+ className: SECTION_CLASS + " !my-0 py-12 bg-bgSecondary"
11282
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
11283
+ data: data,
11284
+ shopConfigStyle: shopConfigStyle
11285
+ }), /*#__PURE__*/React__default.createElement("div", {
11286
+ className: "mt-12 grid grid-cols-1 md:grid-cols-2 gap-6"
11287
+ }, data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.map(function (item, index) {
11288
+ return /*#__PURE__*/React__default.createElement("div", {
11289
+ key: index,
11290
+ className: "relative bg-primary rounded-lg text-textButton px-6 py-4"
11291
+ }, /*#__PURE__*/React__default.createElement(IoMdQuote, {
11292
+ size: 30,
11293
+ className: "absolute text-textButton top-[-15px] right-8"
11294
+ }), /*#__PURE__*/React__default.createElement("div", {
11295
+ className: "flex items-end gap-2"
11296
+ }, /*#__PURE__*/React__default.createElement("img", {
11297
+ src: item === null || item === void 0 ? void 0 : item.avatar,
11298
+ className: "w-24 h-24 rounded-full object-cover"
11299
+ }), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
11300
+ className: "text-xl md:text-2xl mt-2"
11301
+ }, item === null || item === void 0 ? void 0 : item.name), /*#__PURE__*/React__default.createElement("div", {
11302
+ className: "text-gray3"
11303
+ }, item === null || item === void 0 ? void 0 : item.description))), /*#__PURE__*/React__default.createElement("hr", {
11304
+ className: "mt-4"
11305
+ }), /*#__PURE__*/React__default.createElement("div", {
11306
+ className: "mt-2 md:text-lg"
11307
+ }, item === null || item === void 0 ? void 0 : item.content));
11308
+ }))));
11309
+ };
11310
+
9901
11311
  var CustomerRating10 = function CustomerRating10(props) {
9902
11312
  var _data$data;
9903
11313
  var _props$shopConfigStyl = props.shopConfigStyle,
@@ -10020,7 +11430,25 @@ var PageTitle1 = function PageTitle1(props) {
10020
11430
  className: "relative w-full p-20 z-10 flex flex-col gap-6 items-center justify-center"
10021
11431
  }, /*#__PURE__*/React__default.createElement("div", {
10022
11432
  className: "text-3xl md:text-5xl text-white leading-[1.6] md:leading-[1.6] text-center font-headingFont"
10023
- }, route === null || route === void 0 ? void 0 : route.label)));
11433
+ }, 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)));
11434
+ };
11435
+
11436
+ var About1 = function About1(props) {
11437
+ return /*#__PURE__*/React__default.createElement("div", {
11438
+ className: SECTION_CLASS + " flex flex-col gap-4"
11439
+ }, /*#__PURE__*/React__default.createElement("div", null, "Tr\xE1i c\xE2y s\u1EA1ch - an to\xE0n cho s\u1EE9c kho\u1EBB ng\u01B0\u1EDDi ti\xEAu d\xF9ng. C\u1EEDa h\xE0ng ORGANIC FOOD c\u1EE7a ch\xFAng t\xF4i t\u1EEBng b\u01B0\u1EDBc \u0111i v\xE0o th\u1ECB tr\u01B0\u1EDDng v\xE0 ni\u1EC1m tin c\u1EE7a kh\xE1ch h\xE0ng. Ho\u1EA1t \u0111\u1ED9ng v\xE0o th\xE1ng 5/2020, ORGANIC FOOD \u0111\xE3 tr\u1EDF th\xE0nh c\xE1i t\xEAn quen thu\u1ED9c trong l\u0129nh v\u1EF1c cung c\u1EA5p tr\xE1i c\xE2y s\u1EA1ch, an to\xE0n, cam k\u1EBFt ch\xEDn t\u1EF1 nhi\xEAn 100% v\xE0 h\u01B0\u1EDBng \u0111\u1EBFn s\u1EE9c kho\u1EBB ng\u01B0\u1EDDi ti\xEAu d\xF9ng qua 3 ti\xEAu ch\xED:"), /*#__PURE__*/React__default.createElement("div", {
11440
+ className: "font-semibold"
11441
+ }, "T\u1EA7m Nh\xECn"), /*#__PURE__*/React__default.createElement("div", null, "S\u1EA3n ph\u1EA9m t\u01B0\u0300 ORGANIC FOOD se\u0303 tr\u1EDF tha\u0300nh thu\u031Bo\u031Bng hi\u1EB9\u0302u quen thu\u1ECD\u0302c va\u0300 h\u01B0\u1EDBng \u0111\u1EBFn ch\u1EA5t l\u01B0\u1EE3ng t\u1ED1t nh\u1EA5t."), /*#__PURE__*/React__default.createElement("div", {
11442
+ className: "font-semibold"
11443
+ }, "S\u1EE9 m\u1EC7nh"), /*#__PURE__*/React__default.createElement("li", {
11444
+ className: "ps-4"
11445
+ }, " \u0110\u1ECD\u0302i ngu\u0303 ba\u0301n ha\u0300ng s\u0103\u0303n sa\u0300ng l\u0103\u0301ng nghe va\u0300 t\u1EA1\u0302n ta\u0302m nhi\u1EB9\u0302t huy\xEA\u0301t trong co\u0302ng vi\u1EB9\u0302c."), /*#__PURE__*/React__default.createElement("li", {
11446
+ className: "ps-4"
11447
+ }, " Sa\u0309n ph\xE2\u0309m th\u01B0\u0301c u\xF4\u0301ng \u0111a da\u0323ng, \u0111a\u0309m ba\u0309o t\xF4\u0301t s\u01B0\u0301c kho\u0309e va\u0300 \u0111a\u0301p \u01B0\u0301ng \u0111u\u031B\u01A1\u0323c mong \u0111\u01A1\u0323i cu\u0309a kha\u0301ch ha\u0300ng."), /*#__PURE__*/React__default.createElement("li", {
11448
+ className: "ps-4"
11449
+ }, " Tr\xE1i c\xE2y \u0111a d\u1EA1ng, cam k\u1EBFt h\xE0ng s\u1EA1ch \u0111\u1EA3m b\u1EA3o ch\u1EA5t l\u01B0\u1EE3ng t\u1ED1t nh\u1EA5t v\xE0 an to\xE0n tuy\u1EC7t \u0111\u1ED1i cho ng\u01B0\u1EDDi ti\xEAu d\xF9ng"), /*#__PURE__*/React__default.createElement("div", {
11450
+ className: "font-semibold"
11451
+ }, "Gi\xE1 Tr\u1ECB C\u1ED1t L\xF5i"), /*#__PURE__*/React__default.createElement("div", null, "ORGANIC FOOD s\u1EBD lu\xF4n l\xE0 ng\u01B0\u1EDDi b\u1EA1n tin c\u1EADy nh\u1EA5t c\xF9ng kh\xE1ch h\xE0ng, tr\xE1i c\xE2y s\u1EA1ch lu\xF4n \u0111\u1EA3m b\u1EA3o ch\u1EA5t l\u01B0\u1EE3ng v\xE0 mang l\u1EA1i ngu\u1ED3n dinh d\u01B0\u1EE1ng c\u0169ng nh\u01B0 s\u1EF1 an to\xE0n cho kh\xE1ch h\xE0ng, g\xF3p ph\u1EA7n mang \u0111\u1EBFn cu\u1ED9c s\u1ED1ng xanh kho\u1EBB m\u1EA1nh cho m\u1ECDi nh\xE0."));
10024
11452
  };
10025
11453
 
10026
11454
  var About5 = function About5(props) {
@@ -10090,7 +11518,9 @@ var Breadcrumb1 = function Breadcrumb1(props) {
10090
11518
  var shopConfigStyle = props.shopConfigStyle,
10091
11519
  route = props.route,
10092
11520
  _props$routes = props.routes,
10093
- routes = _props$routes === void 0 ? [] : _props$routes;
11521
+ routes = _props$routes === void 0 ? [] : _props$routes,
11522
+ _props$Link = props.Link,
11523
+ Link = _props$Link === void 0 ? null : _props$Link;
10094
11524
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
10095
11525
  _shopConfigStyle$colo3 = _shopConfigStyle$colo.textHeading,
10096
11526
  textHeading = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
@@ -10101,18 +11531,19 @@ var Breadcrumb1 = function Breadcrumb1(props) {
10101
11531
  getItems();
10102
11532
  }, [route]);
10103
11533
  var getItems = function getItems() {
10104
- var _route$route, _route$route$split, _route$route$split$fi;
11534
+ var _route$route, _route$route$split, _route$route$split$fi, _items, _items2;
10105
11535
  var items = route === null || route === void 0 ? void 0 : (_route$route = route.route) === null || _route$route === void 0 ? void 0 : (_route$route$split = _route$route.split("/")) === null || _route$route$split === void 0 ? void 0 : (_route$route$split$fi = _route$route$split.filter(function (e) {
10106
11536
  return e === null || e === void 0 ? void 0 : e.length;
10107
11537
  })) === null || _route$route$split$fi === void 0 ? void 0 : _route$route$split$fi.slice(0, 2);
10108
- items = items.map(function (e) {
11538
+ items = (_items = items) === null || _items === void 0 ? void 0 : _items.map(function (e) {
11539
+ if (e === "product") e = "products";else if (e === "service") e = "services";
10109
11540
  return (routes === null || routes === void 0 ? void 0 : routes.find(function (r) {
10110
11541
  return (r === null || r === void 0 ? void 0 : r.name) === e;
10111
11542
  })) || {
10112
11543
  label: e
10113
11544
  };
10114
11545
  });
10115
- items.unshift({
11546
+ (_items2 = items) === null || _items2 === void 0 ? void 0 : _items2.unshift({
10116
11547
  name: "home",
10117
11548
  label: "Trang chủ",
10118
11549
  route: "/"
@@ -10127,7 +11558,8 @@ var Breadcrumb1 = function Breadcrumb1(props) {
10127
11558
  className: "flex gap-2"
10128
11559
  }, index ? /*#__PURE__*/React__default.createElement("div", {
10129
11560
  className: "text-gray4"
10130
- }, "/") : null, item !== null && item !== void 0 && item.route ? /*#__PURE__*/React__default.createElement("a", {
11561
+ }, "/") : null, item !== null && item !== void 0 && item.route ? /*#__PURE__*/React__default.createElement(LinkToPage, {
11562
+ Link: Link,
10131
11563
  href: item === null || item === void 0 ? void 0 : item.route,
10132
11564
  style: {
10133
11565
  color: textHeading
@@ -10266,6 +11698,8 @@ var TextArea = forwardRef(function (props, ref) {
10266
11698
  className = _props$className === void 0 ? "" : _props$className,
10267
11699
  _props$defaultValue = props.defaultValue,
10268
11700
  defaultValue = _props$defaultValue === void 0 ? "" : _props$defaultValue,
11701
+ _props$labelClassName = props.labelClassName,
11702
+ labelClassName = _props$labelClassName === void 0 ? "" : _props$labelClassName,
10269
11703
  _props$onChange = props.onChange,
10270
11704
  onChange = _props$onChange === void 0 ? function () {} : _props$onChange;
10271
11705
  var _useState = useState(defaultValue),
@@ -10326,11 +11760,11 @@ var TextArea = forwardRef(function (props, ref) {
10326
11760
  return /*#__PURE__*/React__default.createElement("div", {
10327
11761
  className: "" + className
10328
11762
  }, label ? /*#__PURE__*/React__default.createElement("div", {
10329
- className: "mb-1"
11763
+ className: "mb-1 " + labelClassName
10330
11764
  }, label, labelRequired) : null, /*#__PURE__*/React__default.createElement("textarea", {
10331
11765
  name: "",
10332
11766
  id: "",
10333
- className: textareaClassName + " focus:outline-none focus:ring-0",
11767
+ className: "focus:outline-none focus:ring-0 " + textareaClassName,
10334
11768
  placeholder: placeholder,
10335
11769
  value: value,
10336
11770
  onChange: function onChange(e) {
@@ -10794,7 +12228,7 @@ var Carts1 = function Carts1(props) {
10794
12228
  label: /*#__PURE__*/React__default.createElement("a", {
10795
12229
  href: "#",
10796
12230
  className: "flex items-center justify-center bg-primary text-Button gap-2"
10797
- }, "\u0110\u1EB7t h\xE0ng ", /*#__PURE__*/React__default.createElement(FaArrowRight$1, null)),
12231
+ }, "\u0110\u1EB7t h\xE0ng ", /*#__PURE__*/React__default.createElement(FaArrowRight, null)),
10798
12232
  onClick: function onClick() {
10799
12233
  setIsCheckout(false);
10800
12234
  }
@@ -10877,7 +12311,7 @@ var Carts1 = function Carts1(props) {
10877
12311
  setIsOpenModal(false);
10878
12312
  setOrderSuccessInfo({});
10879
12313
  }
10880
- }, "Ti\u1EBFp t\u1EE5c mua s\u1EAFm ", /*#__PURE__*/React__default.createElement(FaArrowRight$1, null)),
12314
+ }, "Ti\u1EBFp t\u1EE5c mua s\u1EAFm ", /*#__PURE__*/React__default.createElement(FaArrowRight, null)),
10881
12315
  shopConfigStyle: shopConfigStyle
10882
12316
  }))));
10883
12317
  };
@@ -10966,5 +12400,309 @@ var CartItem = function CartItem(props) {
10966
12400
  }, /*#__PURE__*/React__default.createElement(RiDeleteBin7Line, null), /*#__PURE__*/React__default.createElement("span", null, "X\xF3a"))));
10967
12401
  };
10968
12402
 
10969
- export { About5, Address1, Banner1, Booking1, Breadcrumb1, Button, Carts1, Contact1, CustomerRating10, Employees1, Features1, Features2, Features3, Footer1, Footer7, Gallery1, Hero10, Hero11, Hero11$1 as Hero12, Hero13, Input, InputPhoneNumber, Links1, NavBar7, PageTitle1, Partner1, ProductDetail10, ProductHot3, ProductSale2, Products1, Products10, Products2, Products3, ProductsTop1, SectionTitle1, Select$1 as Select, ServiceDetail1, Treatments1, Treatments1$1 as Treatments2 };
12403
+ var SearchProduct1 = function SearchProduct1(props) {
12404
+ var _props$Link = props.Link,
12405
+ Link = _props$Link === void 0 ? null : _props$Link;
12406
+ var _props$shopConfigStyl = props.shopConfigStyle,
12407
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
12408
+ data = props.data;
12409
+ var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
12410
+ _shopConfigStyle$colo6 = _shopConfigStyle$colo.bgSecondary,
12411
+ bgSecondary = _shopConfigStyle$colo6 === void 0 ? "#fffff" : _shopConfigStyle$colo6;
12412
+ var _useState = useState([]),
12413
+ listProducts = _useState[0],
12414
+ setListProducts = _useState[1];
12415
+ var _ProductController = ProductController(_extends({}, props)),
12416
+ getProductListSearch = _ProductController.getProductListSearch;
12417
+ var handleSearch = function handleSearch(productName) {
12418
+ try {
12419
+ var _temp = function () {
12420
+ if (productName) {
12421
+ return Promise.resolve(getProductListSearch({
12422
+ productName: productName
12423
+ })).then(function (data) {
12424
+ setListProducts(data);
12425
+ });
12426
+ } else {
12427
+ setListProducts([]);
12428
+ }
12429
+ }();
12430
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
12431
+ } catch (e) {
12432
+ return Promise.reject(e);
12433
+ }
12434
+ };
12435
+ return /*#__PURE__*/React__default.createElement("div", {
12436
+ className: "flex flex-col gap-2 px-6 md:w-[720px] rounded-lg mx-auto mt-12 "
12437
+ }, /*#__PURE__*/React__default.createElement(Input, {
12438
+ className: "flex items-center w-full h-9 md:h-14",
12439
+ style: {
12440
+ backgroundColor: bgSecondary
12441
+ },
12442
+ inputClassName: "w-full h-full p-2 text-lg",
12443
+ placeholder: (data === null || data === void 0 ? void 0 : data.sectionTitle) || "Tìm kiếm sản phẩm",
12444
+ onChange: handleSearch,
12445
+ icons: /*#__PURE__*/React__default.createElement("div", {
12446
+ className: "px-2"
12447
+ }, /*#__PURE__*/React__default.createElement(FiSearch, {
12448
+ style: {
12449
+ color: "#828282"
12450
+ }
12451
+ }))
12452
+ }), (listProducts === null || listProducts === void 0 ? void 0 : listProducts.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
12453
+ className: "max-h-64 overflow-y-auto flex flex-col gap-2 pr-3"
12454
+ }, listProducts === null || listProducts === void 0 ? void 0 : listProducts.map(function (item) {
12455
+ var _item$productInfo, _item$productInfo2;
12456
+ return /*#__PURE__*/React__default.createElement(LinkToPage, {
12457
+ Link: Link,
12458
+ href: getLinkProductDetail(item === null || item === void 0 ? void 0 : item.productInfo),
12459
+ className: "flex gap-2 text-Body"
12460
+ }, /*#__PURE__*/React__default.createElement(ProductImage, {
12461
+ product: item,
12462
+ className: "h-20 max-w-20 rounded-lg border"
12463
+ }), /*#__PURE__*/React__default.createElement("div", {
12464
+ className: "flex flex-col px-1 gap-2 border-b w-full"
12465
+ }, /*#__PURE__*/React__default.createElement("div", {
12466
+ className: "mt-1 text-lg font-medium\t"
12467
+ }, item === null || item === void 0 ? void 0 : (_item$productInfo = item.productInfo) === null || _item$productInfo === void 0 ? void 0 : _item$productInfo.productName), /*#__PURE__*/React__default.createElement("div", {
12468
+ className: " text-lg font-medium\t"
12469
+ }, formatCurrency(item === null || item === void 0 ? void 0 : (_item$productInfo2 = item.productInfo) === null || _item$productInfo2 === void 0 ? void 0 : _item$productInfo2.price))));
12470
+ })) : /*#__PURE__*/React__default.createElement("div", {
12471
+ className: "text-center"
12472
+ }, data === null || data === void 0 ? void 0 : data.sectionDescription));
12473
+ };
12474
+
12475
+ var SearchBar2 = function SearchBar2(props) {
12476
+ var _props$Link = props.Link,
12477
+ Link = _props$Link === void 0 ? null : _props$Link,
12478
+ data = props.data;
12479
+ var _useState = useState([]),
12480
+ products = _useState[0],
12481
+ setProducts = _useState[1];
12482
+ var _ProductController = ProductController(_extends({}, props)),
12483
+ getProductListSearch = _ProductController.getProductListSearch;
12484
+ var handleSearch = function handleSearch(productName) {
12485
+ if (productName === void 0) {
12486
+ productName = "";
12487
+ }
12488
+ try {
12489
+ var _temp = function () {
12490
+ if (productName === "") setProducts([]);else {
12491
+ return Promise.resolve(getProductListSearch({
12492
+ productName: productName
12493
+ })).then(function (productList) {
12494
+ setProducts(productList);
12495
+ });
12496
+ }
12497
+ }();
12498
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
12499
+ } catch (e) {
12500
+ return Promise.reject(e);
12501
+ }
12502
+ };
12503
+ return /*#__PURE__*/React__default.createElement("div", {
12504
+ className: "w-[100vw] md:w-[50vw] py-6 mx-auto px-6 flex flex-col gap-4"
12505
+ }, /*#__PURE__*/React__default.createElement(Input, {
12506
+ icons: /*#__PURE__*/React__default.createElement(IoSearchOutline, {
12507
+ className: "text-gray3"
12508
+ }),
12509
+ className: "w-full",
12510
+ inputClassName: "w-full",
12511
+ placeholder: data !== null && data !== void 0 && data.sectionTitle ? data === null || data === void 0 ? void 0 : data.sectionTitle : "Tìm kiếm sản phẩm",
12512
+ onChange: handleSearch
12513
+ }), (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
12514
+ className: "max-h-64 overflow-y-auto flex flex-col gap-2"
12515
+ }, products === null || products === void 0 ? void 0 : products.map(function (item, index) {
12516
+ var _item$productInfo;
12517
+ return /*#__PURE__*/React__default.createElement(LinkToPage, {
12518
+ Link: Link,
12519
+ href: getLinkProductDetail(item === null || item === void 0 ? void 0 : item.productInfo),
12520
+ key: "jkgr-" + index,
12521
+ className: "flex gap-2 text-Body"
12522
+ }, /*#__PURE__*/React__default.createElement(ProductImage, {
12523
+ product: item,
12524
+ className: "h-20 max-w-20 rounded-lg border"
12525
+ }), /*#__PURE__*/React__default.createElement("div", {
12526
+ className: "flex flex-col px-1 gap-2 border-b w-full"
12527
+ }, /*#__PURE__*/React__default.createElement("div", {
12528
+ className: "mt-1 text-lg font-medium\t"
12529
+ }, item === null || item === void 0 ? void 0 : (_item$productInfo = item.productInfo) === null || _item$productInfo === void 0 ? void 0 : _item$productInfo.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
12530
+ product: item === null || item === void 0 ? void 0 : item.productInfo
12531
+ })));
12532
+ })) : /*#__PURE__*/React__default.createElement("div", {
12533
+ className: "mx-auto"
12534
+ }, data === null || data === void 0 ? void 0 : data.sectionDescription));
12535
+ };
12536
+
12537
+ var SearchBar5 = function SearchBar5(props) {
12538
+ var _data$data, _data$data2, _data$data3;
12539
+ var _props$Link = props.Link,
12540
+ Link = _props$Link === void 0 ? null : _props$Link,
12541
+ shopConfigStyle = props.shopConfigStyle,
12542
+ data = props.data;
12543
+ var _useState = useState(""),
12544
+ value = _useState[0],
12545
+ setValue = _useState[1];
12546
+ return /*#__PURE__*/React__default.createElement("div", {
12547
+ className: SECTION_CLASS + " md:mt-6"
12548
+ }, /*#__PURE__*/React__default.createElement("div", {
12549
+ className: " w-full flex flex-col justify-center px-6 gap-2 md:gap-4 items-center h-32 md:h-48 lg:h-56 rounded-xl md:rounded-3xl ",
12550
+ style: {
12551
+ background: "url(" + (data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.srcImage) + ")",
12552
+ backgroundPosition: "center",
12553
+ backgroundSize: "cover"
12554
+ }
12555
+ }, /*#__PURE__*/React__default.createElement("div", {
12556
+ className: "text-xl font-semibold md:text-3xl lg:text-4xl text-textButton text-center"
12557
+ }, data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : _data$data2.title), /*#__PURE__*/React__default.createElement("div", null, data === null || data === void 0 ? void 0 : (_data$data3 = data.data) === null || _data$data3 === void 0 ? void 0 : _data$data3.description), /*#__PURE__*/React__default.createElement(Input, {
12558
+ onChange: setValue,
12559
+ icons: /*#__PURE__*/React__default.createElement(IoSearchOutline, {
12560
+ className: "text-gray3 text-xl md:text-2xl"
12561
+ }),
12562
+ className: "w-full bg-bgSecondary w-full md:w-[50vw] lg:w-[35vw] mb-2 md:h-12",
12563
+ style: {
12564
+ borderRadius: "32px"
12565
+ },
12566
+ inputClassName: "w-full",
12567
+ placeholder: data !== null && data !== void 0 && data.sectionTitle ? data === null || data === void 0 ? void 0 : data.sectionTitle : "Tìm kiếm sản phẩm",
12568
+ suffix: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, value && (value === null || value === void 0 ? void 0 : value.length) > 0 ? /*#__PURE__*/React__default.createElement(LinkToPage, {
12569
+ Link: Link,
12570
+ href: genLinkSearch(value)
12571
+ }, /*#__PURE__*/React__default.createElement(Button, {
12572
+ label: "T\xECm ki\u1EBFm",
12573
+ className: "whitespace-nowrap h-full ",
12574
+ shopConfigStyle: shopConfigStyle
12575
+ })) : /*#__PURE__*/React__default.createElement(Button, {
12576
+ label: "T\xECm ki\u1EBFm",
12577
+ className: "whitespace-nowrap ",
12578
+ shopConfigStyle: shopConfigStyle
12579
+ }))
12580
+ })));
12581
+ };
12582
+
12583
+ var SearchBar6 = function SearchBar6(props) {
12584
+ var _data$data, _data$data2, _data$data3;
12585
+ var shopConfigStyle = props.shopConfigStyle,
12586
+ _props$Link = props.Link,
12587
+ Link = _props$Link === void 0 ? null : _props$Link,
12588
+ data = props.data;
12589
+ var _useState = useState(""),
12590
+ value = _useState[0],
12591
+ setValue = _useState[1];
12592
+ return /*#__PURE__*/React__default.createElement("div", {
12593
+ className: "w-full flex flex-col justify-center px-3 md:px-6 gap-2 lg:gap-3 items-center h-32 lg:h-44 ",
12594
+ style: {
12595
+ background: "url(" + (data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.srcImage) + ")",
12596
+ backgroundPosition: "center",
12597
+ backgroundSize: "cover"
12598
+ }
12599
+ }, /*#__PURE__*/React__default.createElement("div", {
12600
+ className: "text-lg font-semibold text-textBody md:text-2xl lg:text-3xl text-center"
12601
+ }, data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : _data$data2.title), /*#__PURE__*/React__default.createElement("div", null, data === null || data === void 0 ? void 0 : (_data$data3 = data.data) === null || _data$data3 === void 0 ? void 0 : _data$data3.description), /*#__PURE__*/React__default.createElement("div", {
12602
+ className: "flex gap-2 md:gap-4 lg:gap-6 mb-2 md:mb-0"
12603
+ }, /*#__PURE__*/React__default.createElement(Input, {
12604
+ icons: /*#__PURE__*/React__default.createElement(IoSearchOutline, {
12605
+ className: "text-gray3"
12606
+ }),
12607
+ className: "w-full h-full md:h-12 w-full md:w-[70vw] bg-background lg:w-[50vw]",
12608
+ inputClassName: "w-full",
12609
+ placeholder: data !== null && data !== void 0 && data.sectionTitle ? data === null || data === void 0 ? void 0 : data.sectionTitle : "Tìm kiếm sản phẩm",
12610
+ onChange: setValue
12611
+ }), /*#__PURE__*/React__default.createElement(React__default.Fragment, null, value && (value === null || value === void 0 ? void 0 : value.length) > 0 ? /*#__PURE__*/React__default.createElement(LinkToPage, {
12612
+ Link: Link,
12613
+ href: genLinkSearch(value)
12614
+ }, /*#__PURE__*/React__default.createElement(Button, {
12615
+ label: "T\xECm ki\u1EBFm",
12616
+ className: "whitespace-nowrap h-full",
12617
+ shopConfigStyle: shopConfigStyle
12618
+ })) : /*#__PURE__*/React__default.createElement(Button, {
12619
+ label: "T\xECm ki\u1EBFm",
12620
+ className: "whitespace-nowrap ",
12621
+ shopConfigStyle: shopConfigStyle
12622
+ }))));
12623
+ };
12624
+
12625
+ var ShopHighlights2 = function ShopHighlights2(props) {
12626
+ var data = props.data;
12627
+ var sectionData = data === null || data === void 0 ? void 0 : data.data;
12628
+ return /*#__PURE__*/React__default.createElement("div", {
12629
+ className: SECTION_CLASS + " my-0 md:my-0 py-6 grid grid-cols-2 md:grid-cols-4 gap-4 lg:gap-6"
12630
+ }, sectionData === null || sectionData === void 0 ? void 0 : sectionData.map(function (item, index) {
12631
+ return /*#__PURE__*/React__default.createElement("div", {
12632
+ className: "flex flex-col items-center text-center lg:px-3 gap-3",
12633
+ key: "kdf-" + index
12634
+ }, item !== null && item !== void 0 && item.svgImage ? /*#__PURE__*/React__default.createElement("div", {
12635
+ className: "w-12 text-primary w-16 h-16 rounded-full",
12636
+ dangerouslySetInnerHTML: {
12637
+ __html: configSvg(item === null || item === void 0 ? void 0 : item.svgImage)
12638
+ }
12639
+ }) : /*#__PURE__*/React__default.createElement("img", {
12640
+ src: item === null || item === void 0 ? void 0 : item.srcImage,
12641
+ alt: "logo",
12642
+ className: "w-16 h-16 p-3 rounded-full bg-primary"
12643
+ }), /*#__PURE__*/React__default.createElement("div", {
12644
+ className: "font-medium text-lg"
12645
+ }, item === null || item === void 0 ? void 0 : item.title), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.description));
12646
+ }));
12647
+ };
12648
+
12649
+ var ShopHighlights5 = function ShopHighlights5(props) {
12650
+ var data = props.data;
12651
+ var sectionData = data === null || data === void 0 ? void 0 : data.data;
12652
+ return /*#__PURE__*/React__default.createElement("div", {
12653
+ className: SECTION_CLASS + " grid md:grid-cols-3 py-6 gap-4 lg:gap-6 bg-bgSecondary"
12654
+ }, sectionData === null || sectionData === void 0 ? void 0 : sectionData.map(function (item, index) {
12655
+ return /*#__PURE__*/React__default.createElement("div", {
12656
+ className: "flex flex-col items-center text-center md:px-3 lg:px-6 gap-3",
12657
+ key: "kdf-" + index
12658
+ }, item !== null && item !== void 0 && item.svgImage ? /*#__PURE__*/React__default.createElement("div", {
12659
+ className: "w-16 h-16 rounded-full text-primary ",
12660
+ dangerouslySetInnerHTML: {
12661
+ __html: configSvg(item === null || item === void 0 ? void 0 : item.svgImage)
12662
+ }
12663
+ }) : /*#__PURE__*/React__default.createElement("img", {
12664
+ src: item === null || item === void 0 ? void 0 : item.srcImage,
12665
+ alt: "logo",
12666
+ className: "w-16 h-16 rounded-full bg-primary"
12667
+ }), /*#__PURE__*/React__default.createElement("div", {
12668
+ className: "font-medium text-xl text-textHeading pt-2 border-t border-textHeading"
12669
+ }, item === null || item === void 0 ? void 0 : item.title), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.description));
12670
+ }));
12671
+ };
12672
+
12673
+ var ShopHighlights6 = function ShopHighlights6(props) {
12674
+ var data = props.data,
12675
+ _props$Link = props.Link,
12676
+ Link = _props$Link === void 0 ? null : _props$Link,
12677
+ _props$shopConfigStyl = props.shopConfigStyle,
12678
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl;
12679
+ var sectionData = data === null || data === void 0 ? void 0 : data.data;
12680
+ return /*#__PURE__*/React__default.createElement("div", {
12681
+ className: SECTION_CLASS + " grid md:grid-cols-3 py-6 gap-8 md:gap-4 lg:gap-6"
12682
+ }, sectionData === null || sectionData === void 0 ? void 0 : sectionData.map(function (item, index) {
12683
+ return /*#__PURE__*/React__default.createElement("div", {
12684
+ className: "flex flex-col items-center text-center md:px-3 lg:px-6 gap-3",
12685
+ key: "kdf-" + index
12686
+ }, item !== null && item !== void 0 && item.svgImage ? /*#__PURE__*/React__default.createElement("div", {
12687
+ className: "text-primary w-16 h-16 rounded-full",
12688
+ dangerouslySetInnerHTML: {
12689
+ __html: configSvg(item === null || item === void 0 ? void 0 : item.svgImage)
12690
+ }
12691
+ }) : /*#__PURE__*/React__default.createElement("img", {
12692
+ src: item === null || item === void 0 ? void 0 : item.srcImage,
12693
+ alt: "logo",
12694
+ className: "w-16 h-16 rounded-full bg-primary"
12695
+ }), /*#__PURE__*/React__default.createElement("div", {
12696
+ className: " w-44 h-0.5 rounded-full bg-primary"
12697
+ }), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.description), /*#__PURE__*/React__default.createElement(LinkToPage, {
12698
+ Link: Link,
12699
+ href: (item === null || item === void 0 ? void 0 : item.link) || (item === null || item === void 0 ? void 0 : item.route)
12700
+ }, /*#__PURE__*/React__default.createElement(Button, {
12701
+ shopConfigStyle: shopConfigStyle,
12702
+ label: item === null || item === void 0 ? void 0 : item.title
12703
+ })));
12704
+ }));
12705
+ };
12706
+
12707
+ export { About1, About5, Address1, Banner1, Banner3, BannerFull1, BannerFull2, Booking1, BookingForm6, Breadcrumb1, Button, Carts1, Contact1, CustomerRating1, CustomerRating10, CustomerRating5, CustomerRating6, DateTimePicker, Employees1, Features1, Features2, Features3, Footer1, Footer7, Gallery1, Hero1, Hero10, Hero11, Hero11$1 as Hero12, Hero13, Hero2, Hero5, Hero6, Input, InputPhoneNumber, Links1, ModalNotification, NavBar1, NavBar7, PageTitle1, Partner1, ProductCategory2, ProductDetail10, ProductHighlight1, ProductHot1, ProductHot3, ProductItem2, ProductItem3, ProductItem4, ProductItem5, ProductItem6, ProductList5, ProductSale2, ProductSearch1, Products1, Products10, Products2, Products3, ProductsTop1, SearchBar2, SearchBar5, SearchBar6, SearchProduct1, SectionTitle1, SectionTitle2, SectionTitle3, Select$1 as Select, ServiceDetail1, ShopHighlights2, ShopHighlights5, ShopHighlights6, TextArea, TreatmentDetail1, TreatmentItem1, Treatments1, Treatments1$1 as Treatments2, TreatmentsList6 };
10970
12708
  //# sourceMappingURL=index.modern.js.map