@momo-webplatform/mobase 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -67,7 +67,7 @@ import*as Fo from"react";import{ChevronDownIcon as bm}from"@heroicons/react/20/s
|
|
|
67
67
|
transform: translate3d(0, 30%, 0);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
`})]}),Xt=({className:e,children:o,title:t,shortTitle:a,qrImage:i,qrLink:n,logoQr:s,isQrForAll:l=!1,...m})=>M(Re,{...m,children:M(Ne,{className:r("h-auto max-h-screen overflow-hidden border-0 md:max-h-screen md:max-w-2xl lg:max-w-3xl [&>button>svg]:text-white",e),size:"xl",positionRightCloseBtn:!0,children:M(ze,{className:"p-0",children:ue("div",{className:"flex flex-row flex-wrap",children:[M("div",{className:"hidden flex-none w-full sm:block md:w-5/12",children:o||ue("div",{className:"grid grid-cols-1 gap-y-6 px-5 py-8 text-sm",children:[ue("div",{className:"flex flex-nowrap items-center",children:[M("div",{className:"flex-none",children:M("img",{className:"w-20",loading:"lazy",src:"https://homepage.momocdn.net/images/s/momo-upload-api-200917091602-637359309621891617.png",alt:"Step 1"})}),ue("div",{className:"flex-1 pl-4",children:[M("div",{className:"font-semibold text-gray-800 step",children:"B\u01B0\u1EDBc 1 :"}),M("div",{className:"mt-1 text-gray-500",children:l?"M\u1EDF app MoMo ho\u1EB7c \u1EE9ng d\u1EE5ng ng\xE2n h\xE0ng/v\xED \u0111i\u1EC7n t\u1EED ch\u1EA5p nh\u1EADn m\xE3 v\u1EA1ch t\u1EEB QR \u0110a N\u0103ng":"M\u1EDF \u1EE9ng d\u1EE5ng camera m\u1EB7c \u0111\u1ECBnh ho\u1EB7c \u1EE9ng d\u1EE5ng h\u1ED7 tr\u1EE3 QR code c\u1EE7a b\u1EA1n"})]})]}),ue("div",{className:"flex flex-nowrap items-center",children:[M("div",{className:"flex-none",children:M("img",{className:"w-20",loading:"lazy",src:"https://homepage.momocdn.net/images/s/momo-upload-api-200917091443-637359308837905996.png",alt:"Step 2"})}),ue("div",{className:"flex-1 pl-4",children:[M("div",{className:"font-semibold text-gray-800 step",children:"B\u01B0\u1EDBc 2 :"}),M("div",{className:"mt-1 text-gray-500",children:"Qu\xE9t m\xE3 QR Code theo h\xECnh b\xEAn ph\u1EA3i"})]})]}),ue("div",{className:"flex flex-nowrap items-center",children:[M("div",{className:"flex-none",children:M("img",{className:"w-20",loading:"lazy",src:"https://homepage.momocdn.net/images/s/momo-upload-api-200917090146-637359301062519803.png",alt:"Step 3"})}),ue("div",{className:"flex-1 pl-4",children:[M("div",{className:"font-semibold text-gray-800 step",children:"B\u01B0\u1EDBc 3 :"}),ue("div",{className:"mt-1 text-gray-500",children:["B\u1EA5m v\xE0o th\xF4ng b\xE1o hi\u1EC3n th\u1ECB \u0111\u1EC3 t\u1EA3i \u1EE9ng d\u1EE5ng ho\u1EB7c"," ",a||"Truy c\u1EADp ngay"]})]})]})]})}),M("div",{className:"flex justify-center items-center w-full h-auto md:w-7/12",style:{background:"url(https://homepage.momocdn.net/jk/momo2020/img/intro/qrcode-pattern.png) 10px 10px no-repeat,linear-gradient(to top,#c1177c,#e11b90)"},children:ue("div",{className:"px-5 py-10 text-center",children:[t&&M("h4",{className:"mb-5 text-base font-semibold text-white",children:t}),ue("div",{className:"relative",children:[l&&M("div",{className:"absolute -top-2 left-1/2 z-[5] -translate-x-1/2",children:M("img",{src:"https://homepage.momocdn.net/fileuploads/svg/momo-file-231211170324.svg",alt:"Title QR all"})}),M(Dm,{img:i,isQrForAll:l,children:n&&M(Sm,{value:n,size:215,imageSettings:{src:`${s||"https://homepage.momocdn.net/pwa/images/logoMomox50.png"}`,height:50,width:50,excavate:!0},level:"H"})})]})]})})]})})})});import{useState as Hm}from"react";import{useEffect as Mm,useLayoutEffect as Im,useState as Am}from"react";import Lm from"ua-parser-js";var zm=()=>Lm().device.type==="mobile",Em=typeof window<"u"?Im:Mm,vo=()=>{let[e,o]=Am(!1);return Em(()=>{o(zm())},[]),e};import{Fragment as _m,jsx as ba,jsxs as Fm}from"react/jsx-runtime";var Ge=({action:e,newTab:o,offset:t,dialogQrProps:a,className:i,children:n,...s})=>{let[l,m]=Hm(!1),c=vo(),d=!!a?.qrLink,p=()=>{let z=d?a?.qrLink:e;return typeof z=="string"?z.trim():""},g=()=>{let z=p();!z&&typeof e!="function"||(typeof e=="function"?e():window.open(z,o?"_blank":"_self"))},h=(z,W=0)=>{let _=document.querySelector(z);if(!_)return;let k=_.getBoundingClientRect().top+window.scrollY-W;window.scrollTo({top:k,behavior:"smooth"})},w=()=>{typeof e=="string"&&e.startsWith("#")?h(e,t):g()},T=()=>Fm(_m,{children:[ba(we,{...s,className:i,onClick:()=>m(!0),"data-name":"button-action-with-qr",children:n}),ba(Xt,{...a,open:l,onOpenChange:()=>m(!1),qrLink:a?.qrLink||""})]});return d?c?a?.isQrForAll?T():ba(we,{...s,className:i,onClick:g,"data-name":"button-action-with-qr",children:n}):T():ba(we,{...s,onClick:w,className:r("cursor-pointer",i),"data-name":"button-action-without-qr",rel:"noreferrer",children:n})};import*as ho from"react";import{ChevronRightIcon as Bm,DotsHorizontalIcon as Om}from"@radix-ui/react-icons";import{Slot as Vm}from"@radix-ui/react-slot";import{jsx as xt,jsxs as Gm}from"react/jsx-runtime";var Tr=ho.forwardRef(({className:e,...o},t)=>xt("nav",{ref:t,"aria-label":"breadcrumb",className:r("",e),...o}));Tr.displayName="Breadcrumb";var Sr=ho.forwardRef(({className:e,...o},t)=>xt("ol",{ref:t,className:r("flex items-center gap-2 break-words text-sm overflow-x-auto snap-mandatory snap-x [&::-webkit-scrollbar]:hidden",e),...o}));Sr.displayName="BreadcrumbList";var Dr=ho.forwardRef(({className:e,...o},t)=>xt("li",{ref:t,className:r("shrink-0 text-gray-900 hover:text-pink-500",e),...o}));Dr.displayName="BreadcrumbItem";var Mr=ho.forwardRef(({asChild:e,className:o,...t},a)=>xt(e?Vm:"a",{ref:a,className:r("transition-colors hover:text-foreground",o),...t}));Mr.displayName="BreadcrumbLink";var Ir=ho.forwardRef(({className:e,...o},t)=>xt("span",{ref:t,role:"link","aria-disabled":"true","aria-current":"page",className:r("text-sm text-gray-500",e),...o}));Ir.displayName="BreadcrumbPage";var Ar=({children:e,className:o,...t})=>xt("li",{role:"presentation","aria-hidden":"true",className:r("text-gray-900",o),...t,children:e??xt(Bm,{className:"w-2 h-2"})});Ar.displayName="BreadcrumbSeparator";var Lr=({className:e,...o})=>Gm("span",{role:"presentation","aria-hidden":"true",className:r("flex h-5 w-5 items-center justify-center",e),...o,children:[xt(Om,{className:"w-4 h-4 text-gray-900"}),xt("span",{className:"sr-only",children:"More"})]});Lr.displayName="BreadcrumbElipssis";import{createContext as Wm,useContext as zr}from"react";import{jsx as Vo}from"react/jsx-runtime";var pi=Wm({align:"center"}),fi=({color:e="pink",size:o="small",isTruncated:t=!1,className:a,children:i})=>{let n={regular:"text-gray-900",pink:"text-pink-500",white:"text-white"},s={small:"text-sm",large:"text-lg"};return Vo("div",{className:r("mb-1 font-semibold",n[e],s[o],t&&"truncate",a),children:i})},ui=({tagHeading:e="h2",size:o="small",color:t="pink",isTruncated:a=!1,className:i,children:n})=>{let s=e,l={regular:"text-gray-900",pink:"text-pink-500",white:"text-white"},m={small:"lg:text-3xl text-2xl",large:"lg:text-4xl md:text-3xl text-2xl"},{align:c}=zr(pi);return Vo(s,{className:r("max-w-4xl font-bold",c==="center"?"mx-auto":c==="right"?"ml-auto":"",l[t],m[o],a&&"truncate",i),children:n})},gi=({color:e="regular",size:o="small",marginTop:t="spacingX",isTruncated:a=!1,className:i,children:n})=>{let s={regular:"text-gray-500",white:"text-white/80"},l={small:"text-base",large:"md:text-lg text-base"},m={none:"",spacingX:"mt-2",spacingM:"mt-3",spacingL:"mt-4",spacingXl:"mt-5",spacing2Xl:"mt-6"},{align:c}=zr(pi);return Vo("div",{className:r(c==="center"?"mx-auto max-w-2xl":c==="right"?"ml-auto max-w-4xl":"max-w-4xl",s[e],l[o],m[t],a&&"truncate",i),children:n})},vi=({className:e,align:o="center",children:t})=>Vo("div",{className:r("mb-5 md:mb-8",{left:"text-left",center:"text-center",right:"text-right"}[o],e),children:Vo(pi.Provider,{value:{align:o},children:t})});import{jsx as Yt,jsxs as $m}from"react/jsx-runtime";var B=({idSection:e,className:o,background:t,children:a})=>Yt("section",{id:e,className:r("block-section py-8 md:py-10 lg:py-14",o),style:{background:t},children:Yt("div",{className:"wrapper relative",children:a})}),x=({align:e="center",tagline:o,title:t,description:a,tagHeading:i="h2",colorScheme:n="pink",sizeHeading:s="small",className:l})=>{let m=n==="black"?"pink":n==="pink"?"regular":"white",c=n==="pink"?"pink":n==="white"?"white":"regular",d=n==="white"?"white":"regular";return!t&&!a&&!o?null:$m(vi,{align:e,className:l,children:[o&&Yt(fi,{color:m,children:o}),t&&Yt(ui,{tagHeading:i,color:c,size:s,children:u(t)}),a&&Yt(gi,{color:d,size:"large",marginTop:s==="large"?"spacing2Xl":"spacingX",children:u(a)})]})},b=({align:e,isFullInMobile:o=!1,buttons:t,className:a})=>t?.length===0?null:Yt("div",{className:r("buttons-block mt-8 flex w-full gap-4 md:mt-10",e==="center"&&"justify-center",e==="right"&&"justify-end",o&&"flex-wrap md:flex-nowrap",a),children:t?.slice(0,2).map((i,n)=>{if(!i)return null;let{btnName:s,...l}=i;return Yt(Ge,{...l,className:r(o&&"w-full md:w-auto",i?.className),children:u(s)},n)})});import rc,{memo as nc}from"react";import{ArrowDownIcon as sc}from"@heroicons/react/20/solid";import{createContext as qm,useCallback as Xm,useContext as hi,useEffect as Ym,useRef as Zm,useState as Km}from"react";import{ChevronLeft as Jm,ChevronRight as ec}from"lucide-react";import*as Er from"react";import{Slot as jm}from"@radix-ui/react-slot";import{cva as Qm}from"class-variance-authority";import{jsx as Um}from"react/jsx-runtime";var Zt=Qm("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-semibold transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed border border-transparent",{variants:{variant:{primary:"bg-pink-500 text-white hover:bg-pink-600 disabled:bg-pink-300",secondary:"bg-white text-gray-900 hover:bg-gray-100 disabled:text-gray-400 disabled:bg-white border-gray-300",outline:"border-pink-500 text-pink-500 bg-white hover:bg-pink-50 disabled:bg-white disabled:border-pink-300 disabled:text-pink-300",tonal:"bg-pink-100 text-pink-500 hover:bg-pink-200 disabled:bg-gray-200 disabled:text-gray-400",danger:"bg-red-500 text-white hover:bg-red-600 disabled:bg-red-300",transparent:"text-gray-900 bg-transparent hover:bg-gray-100 disabled:text-gray-400 disabled:bg-transparent"},size:{default:"text-sm h-10 w-10",sm:"h-8 w-8 text-sm",lg:"h-12 w-12 text-base"}},defaultVariants:{variant:"primary",size:"default"}}),se=Er.forwardRef(({className:e,variant:o="primary",size:t="default",asChild:a=!1,isDisabled:i=!1,...n},s)=>{let l=a?jm:"button",m=r(Zt({variant:o,size:t,className:e}));return Um(l,{className:m,disabled:i,ref:s,...n,children:n.children})});se.displayName="IconButton";import{Fragment as tc,jsx as zt,jsxs as Hr}from"react/jsx-runtime";var ya=qm(void 0),bt=({showGradientOverlay:e=!0,gradientOverlayColor:o="255, 255, 255",className:t,children:a})=>{let i=Zm(null),[n,s]=Km({left:!1,right:!1}),l=Xm(()=>{let c=i.current;if(c){let{scrollLeft:d,scrollWidth:p,clientWidth:g}=c;s({left:d>0,right:Math.ceil(d+g)<p})}},[]);Ym(()=>{let c=i.current;if(c)return l(),window.addEventListener("resize",l),c.addEventListener("scroll",l),()=>{window.removeEventListener("resize",l),c.removeEventListener("scroll",l)}},[l]);let m=c=>{let d=i.current;if(d){let{scrollLeft:p,clientWidth:g,scrollWidth:h}=d,w=g*.7*(c==="left"?-1:1),T=p+w;T<0?T=0:T>h-g&&(T=h-g),d.scrollTo({left:T,behavior:"smooth"})}};return zt(ya.Provider,{value:{scrollContainerRef:i,showArrows:n,scroll:m,gradientOverlayColor:o},children:Hr("div",{className:r("relative w-full",t),children:[e&&Hr(tc,{children:[n.left&&zt("div",{className:"pointer-events-none absolute left-0 top-1/2 z-10 flex h-full w-16 -translate-y-1/2 items-center",style:{background:`linear-gradient( to left, rgba(255, 255, 255, 0),rgb(${o}),rgb(${o}))`}}),n.right&&zt("div",{className:"pointer-events-none absolute right-0 top-1/2 z-10 flex h-full w-16 -translate-y-1/2 items-center",style:{background:`linear-gradient(to right, rgba(255, 255, 255, 0), rgb(${o}),rgb(${o}))`}})]}),a]})})},yt=({className:e,children:o})=>{let t=hi(ya);if(!t)throw new Error("HorizontalContent must be used within a HorizontalScroll");return zt("div",{ref:t.scrollContainerRef,className:r("scrollbar-hide overflow-x-auto scroll-smooth",e),role:"region","aria-label":"Scrollable content",children:o})},wt=({className:e,children:o,...t})=>{let a=hi(ya);if(!a)throw new Error("HorizontalNavigation must be used within a HorizontalScroll");return a.showArrows.left?zt(se,{className:r("pointer-events-auto absolute left-0.5 top-1/2 z-10 h-6 w-6 -translate-y-1/2 rounded-full",e),onClick:()=>a.scroll("left"),"aria-label":"Scroll left",size:t.size||"sm",variant:t.variant||"secondary",...t,children:o||zt(Jm,{className:"h-4 w-4"})}):null},Nt=({className:e,children:o,...t})=>{let a=hi(ya);if(!a)throw new Error("HorizontalNavigation must be used within a HorizontalScroll");return a.showArrows.right?zt(se,{className:r("pointer-events-auto absolute right-0.5 top-1/2 z-10 h-6 w-6 -translate-y-1/2 rounded-full",e),onClick:()=>a.scroll("right"),"aria-label":"Scroll right",size:t.size||"sm",variant:t.variant||"secondary",...t,children:o||zt(ec,{className:"h-4 w-4"})}):null};import*as wa from"react";import*as We from"@radix-ui/react-tabs";import{jsx as xi}from"react/jsx-runtime";var Pt=We.Root,Ze=wa.forwardRef(({className:e,size:o="sm",isDivider:t=!1,...a},i)=>xi(We.List,{ref:i,className:r("inline-flex w-full flex-row items-center space-x-5 overflow-x-auto [&::-webkit-scrollbar]:hidden",`text-${o}`,t&&"border-b border-gray-200",e),...a}));Ze.displayName=We.List.displayName;var Ke=wa.forwardRef(({className:e,...o},t)=>xi(We.Trigger,{ref:t,className:r("ring-offset-background focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap border-b-2 border-transparent py-3 font-semibold text-gray-900 transition-all hover:text-pink-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:border-pink-500 data-[state=active]:text-pink-500",e),...o}));Ke.displayName=We.Trigger.displayName;var Je=wa.forwardRef(({className:e,...o},t)=>xi(We.Content,{ref:t,className:r("ring-offset-background focus-visible:ring-ring mt-3 text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",e),...o}));Je.displayName=We.Content.displayName;import*as _r from"react";import{Slot as oc}from"@radix-ui/react-slot";import{cva as ac}from"class-variance-authority";import{jsx as ic}from"react/jsx-runtime";var Fr=ac("inline-flex items-center justify-center whitespace-nowrap font-semibold transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed border border-transparent flex-nowrap",{variants:{variant:{default:"text-blue-700 hover:underline hover:bg-blue-50 disabled:bg-transparent disabled:text-gray-400 disabled:no-underline",primary:"text-pink-500 hover:underline hover:bg-pink-50 disabled:bg-transparent disabled:text-gray-400 disabled:no-underline",secondary:"text-gray-700 hover:underline hover:text-blue-700 hover:bg-blue-50 disabled:bg-transparent disabled:text-gray-400 disabled:no-underline"},size:{default:"text-sm",lg:"text-base"}},defaultVariants:{variant:"default",size:"default"}}),ie=_r.forwardRef(({className:e,variant:o="default",size:t="default",asChild:a=!1,isDisabled:i=!1,...n},s)=>{let l=a?oc:"button",m=r(Fr({variant:o,size:t,className:e}));return ic(l,{className:m,disabled:i,ref:s,...n,children:n.children})});ie.displayName="TextButton";import{Fragment as Br,jsx as $,jsxs as et}from"react/jsx-runtime";var lc=({blog:e})=>{let o=(t,a)=>{t?.preventDefault(),t?.stopPropagation(),window.open(a,"_blank")};return et(Br,{children:[$("div",{className:"flex-none basis-1/2 pr-3 md:basis-full md:pr-0",children:$("div",{className:"relative block aspect-[16/9] w-full overflow-hidden rounded-md bg-gray-100",children:et("picture",{children:[$("source",{media:"(min-width: 640px)",srcSet:e?.thumbnailDesktop}),$("img",{className:"h-full w-full object-cover",src:e?.thumbnailMobile,alt:e?.title})]})})}),et("div",{className:"basis-1/2 overflow-hidden md:mt-3 md:basis-full",children:[e?.category&&e?.categoryUrl&&$(ie,{variant:"default",className:"shink-0 mb-0.5 line-clamp-1 block justify-start whitespace-normal text-left text-xs md:hidden",onClick:t=>o(t,e?.categoryUrl||""),children:e?.category}),$("div",{className:"line-clamp-3 text-sm font-medium text-gray-900 group-hover:text-pink-500 md:line-clamp-none md:text-base",children:e?.title}),et("div",{className:"mt-2 flex items-center md:space-x-1",children:[e?.category&&e?.categoryUrl&&et(Br,{children:[$(ie,{variant:"default",className:"shink-0 hidden justify-start whitespace-normal text-left text-xs md:line-clamp-1 md:block",onClick:t=>o(t,e?.categoryUrl||""),children:e?.category}),e?.category&&e?.totalViews&&$("span",{className:"hidden flex-none leading-none md:block",children:"\xB7"})]}),e?.totalViews&&$("div",{className:"flex-none text-xs text-gray-500",children:e.totalViews})]})]})]})},Na=nc(({dataHeading:e,dataHorizontalScroll:o,dataBlog:t,onClickModal:a,onClickLoadMore:i})=>{let{showGradientOverlay:n=!0,gradientOverlayColor:s,className:l}=o||{},m=(d,p,g)=>{d?.preventDefault(),d?.stopPropagation(),a?a(p):window.open(g,"_blank")},c=(d,p)=>et("div",{children:[$("div",{className:r("-mx-3 flex flex-row flex-wrap gap-y-5",d?.blogList?.length<3?"md:justify-center":""),children:d?.blogList?.map((g,h)=>$("div",{className:"min-w-0 basis-full px-3 md:basis-1/2 lg:basis-1/3",children:$("div",{onClick:w=>m(w,g?.id,g?.url),className:r("group flex cursor-pointer flex-row md:flex-col",d?.classNameItem),children:$(lc,{blog:g})},g?.id)},h))}),d?.isShowBtn&&$("div",{className:"mt-8 flex w-full items-center justify-center",children:et(Ge,{action:i?()=>i?.(p):d?.btnUrl,newTab:d?.isNewTab,variant:"outline",children:[u(d.btnName||"Xem th\xEAm"),d?.isLoading?$(go,{className:"animate-spin-loading ml-2 h-5 w-5"}):i&&!d?.btnUrl&&$(sc,{className:"-mb-1 ml-2 h-5 w-5 animate-bounce"})]})})]},d?.title||p);return et(rc.Fragment,{children:[e&&$(x,{tagline:e?.tagline,title:e?.title,description:e?.description,tagHeading:e?.tagHeading,align:"center",colorScheme:e?.colorScheme||"pink",sizeHeading:e?.sizeHeading,className:r(e?.className)}),t?.length>1?et(Pt,{defaultValue:t[0]?.title,children:[et(bt,{showGradientOverlay:n,gradientOverlayColor:s,className:l,children:[$(yt,{className:"mb-6 text-center",children:$(Ze,{className:"mx-auto mb-0 inline-flex w-auto items-center overflow-visible",children:t.map((d,p)=>$(Ke,{value:d.title,children:d.title},d.title+p))})}),$(wt,{}),$(Nt,{})]}),t.map((d,p)=>$(Je,{value:d.title,children:c(d,p)},d.title+p))]}):t?.length===1&&t[0]&&c(t[0],0)]})});import fc,{memo as uc,useEffect as gc,useState as Gr}from"react";import{ChevronLeftIcon as vc,ChevronRightIcon as hc}from"@heroicons/react/20/solid";import*as O from"react";import{ChevronLeftIcon as mc,ChevronRightIcon as cc}from"@heroicons/react/20/solid";import dc from"embla-carousel-react";import{Fragment as pc,jsx as Ee,jsxs as Vr}from"react/jsx-runtime";var Or=O.createContext(null);function Go(){let e=O.useContext(Or);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}var ge=O.forwardRef(({orientation:e="horizontal",opts:o,setApi:t,plugins:a,className:i,children:n,...s},l)=>{let[m,c]=dc({align:"start",...o,axis:e==="horizontal"?"x":"y"},a),[d,p]=O.useState(!1),[g,h]=O.useState(!1),w=O.useCallback(W=>{W&&(p(W.canScrollPrev()),h(W.canScrollNext()))},[]),T=O.useCallback(()=>{c?.scrollPrev()},[c]),C=O.useCallback(()=>{c?.scrollNext()},[c]),z=O.useCallback(W=>{W.key==="ArrowLeft"?(W.preventDefault(),T()):W.key==="ArrowRight"&&(W.preventDefault(),C())},[T,C]);return O.useEffect(()=>{!c||!t||t(c)},[c,t]),O.useEffect(()=>{if(c)return w(c),c.on("reInit",w),c.on("select",w),()=>{c?.off("select",w)}},[c,w]),Ee(Or.Provider,{value:{carouselRef:m,api:c,opts:o,orientation:e||(o?.axis==="y"?"vertical":"horizontal"),scrollPrev:T,scrollNext:C,canScrollPrev:d,canScrollNext:g},children:Ee("div",{ref:l,onKeyDownCapture:z,className:r("relative",i),role:"region","aria-roledescription":"carousel",...s,children:n})})});ge.displayName="Carousel";var ve=O.forwardRef(({className:e,classNameContent:o,...t},a)=>{let{carouselRef:i,orientation:n}=Go();return Ee("div",{ref:i,className:r("overflow-hidden",o),children:Ee("div",{ref:a,className:r("flex",n==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})});ve.displayName="CarouselContent";var de=O.forwardRef(({className:e,...o},t)=>{let{orientation:a}=Go();return Ee("div",{ref:t,role:"group","aria-roledescription":"slide",className:r("min-w-0 shrink-0 grow-0 basis-full",a==="horizontal"?"pl-4":"pt-4",e),...o})});de.displayName="CarouselItem";var xo=O.forwardRef(({className:e,variant:o="secondary",size:t="default",...a},i)=>{let{orientation:n,scrollPrev:s,canScrollPrev:l}=Go();return Vr(se,{ref:i,variant:o,size:t,className:r("absolute h-8 w-8 rounded-full",n==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:s,...a,children:[Ee(mc,{className:"h-6 w-6"}),Ee("span",{className:"sr-only",children:"Previous slide"})]})});xo.displayName="CarouselPrevious";var bo=O.forwardRef(({className:e,variant:o="secondary",size:t="default",...a},i)=>{let{orientation:n,scrollNext:s,canScrollNext:l}=Go();return Vr(se,{ref:i,variant:o,size:t,className:r("absolute h-8 w-8 rounded-full",n==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:s,...a,children:[Ee(cc,{className:"h-6 w-6"}),Ee("span",{className:"sr-only",children:"Next slide"})]})});bo.displayName="CarouselNext";var yo=O.forwardRef((e,o)=>{let{api:t}=Go(),[,a]=O.useState(!1),i=O.useCallback(()=>a(l=>!l),[]);O.useEffect(()=>{if(t)return t.on("select",i),t.on("reInit",i),()=>{t.off("select",i),t.off("reInit",i)}},[t,i]);let n=t?.scrollSnapList().length||0,s=t?.selectedScrollSnap()||0;return n>1?Ee("div",{ref:o,className:` flex justify-center ${e.className}`,children:Array.from({length:n},(l,m)=>Ee(se,{className:`navigation-item mx-1 h-1.5 w-1.5 rounded-full p-0 ${m===s?"navigation-item-active scale-125 transform bg-gray-500 hover:bg-gray-500/90":"bg-gray-200 hover:bg-gray-100"}`,"aria-label":`Go to slide ${m+1}`,onClick:()=>t?.scrollTo(m)},m))}):Ee(pc,{})});yo.displayName="CarouselDots";import{Fragment as Pa,jsx as j,jsxs as $e}from"react/jsx-runtime";var xc=({blog:e})=>{let o=(t,a)=>{t?.preventDefault(),t?.stopPropagation(),window.open(a,"_blank")};return $e(Pa,{children:[j("div",{className:"relative block aspect-[16/9] w-full overflow-hidden rounded-md bg-gray-100",children:j("img",{className:"inset-0 h-full w-full object-cover",src:e?.thumbnailDesktop,alt:e?.title})}),$e("div",{className:"mt-4 md:pr-3",children:[j("div",{className:"font-semibold text-gray-900 group-hover:text-pink-500 md:text-lg md:leading-tight",children:e?.title}),e?.description&&j("div",{className:"mt-2 line-clamp-2 text-sm text-gray-500 md:text-sm",children:u(e?.description??"")}),$e("div",{className:"mt-2 flex items-center space-x-1",children:[e?.category&&e?.categoryUrl&&$e(Pa,{children:[j(ie,{variant:"default",className:"shink-0 justify-start whitespace-normal text-left text-sm md:line-clamp-1",onClick:t=>o(t,e?.categoryUrl||""),children:e?.category}),e?.category&&e?.totalViews&&j("span",{className:"flex-none leading-none text-gray-300",children:"\xB7"})]}),e?.totalViews&&j("div",{className:"flex-none text-sm text-gray-500",children:e.totalViews})]})]})]})},bc=({dataBlog:e,setCarouselRef:o,carouselRef:t,setCurrent:a,handleOnClickItem:i})=>{let{blogList:n=[],isShowBtn:s,btnName:l,btnUrl:m="#",isNewTab:c,classNameItem:d}=e??{};return gc(()=>{!t||!a||(a(t.selectedScrollSnap()+1),t.on("select",()=>{a&&a(t.selectedScrollSnap()+1)}))},[t,a]),$e(Pa,{children:[j(ge,{opts:{dragFree:!1},setApi:o,className:"w-full",children:j(ve,{classNameContent:"!overflow-visible",className:"-ml-5",children:n?.map(p=>j(de,{className:"basis-11/12 pl-5 md:basis-1/2 lg:basis-4/12",children:j("div",{onClick:g=>i(g,p?.id,p?.url),className:r("group cursor-pointer",d),children:j(xc,{blog:p})},p?.id)},p?.id))})}),s&&j("div",{className:"mt-8 flex w-full items-center justify-center md:mt-10",children:$e(Ge,{action:m&&m,newTab:c,variant:"outline",children:[u(l||"Xem th\xEAm")," "]})})]})},yc=({carouselRef:e})=>$e(se,{onClick:()=>e?.scrollPrev(),disabled:!e?.canScrollPrev(),style:{borderRadius:"100%"},size:"sm",variant:"secondary",children:[j(vc,{className:"h-6 w-6"}),j("span",{className:"sr-only",children:"Previous slide"})]}),wc=({carouselRef:e})=>$e(se,{onClick:()=>e?.scrollNext(),disabled:!e?.canScrollNext(),style:{borderRadius:"100%"},size:"sm",variant:"secondary",children:[j(hc,{className:"h-6 w-6"}),j("span",{className:"sr-only",children:"Next slide"})]}),bi=uc(({dataHeading:e,dataBlog:o,onClickModal:t,onClickLoadMore:a})=>{let i=(c,d,p)=>{c?.preventDefault(),c?.stopPropagation(),t?t(d):window.open(p,"_blank")},[n,s]=Gr(null),[,l]=Gr(0),m=()=>n?$e("div",{className:"ml-3 hidden items-center space-x-2 md:flex",children:[j(yc,{carouselRef:n}),j(wc,{carouselRef:n})]}):j(Pa,{});return $e(fc.Fragment,{children:[$e("div",{className:"flex items-center justify-between",children:[e&&j(x,{tagline:e?.tagline,title:e?.title,description:e?.description,tagHeading:e?.tagHeading,align:"left",colorScheme:e?.colorScheme||"pink",sizeHeading:e?.sizeHeading,className:r(e?.className)}),j(m,{})]}),j(bc,{dataBlog:o?.[0],onClickLoadMore:a,index:0,setCarouselRef:s,carouselRef:n,setCurrent:l,handleOnClickItem:i})]})});import{Fragment as kc,jsx as wo}from"react/jsx-runtime";var Nc=({template:e,dataBlog:o,dataHeading:t,dataHorizontalScroll:a,onClickModal:i,onClickLoadMore:n})=>{switch(e){case 1:return wo(Na,{dataBlog:o,dataHeading:t,dataHorizontalScroll:a,onClickModal:i,onClickLoadMore:n});case 2:return wo(bi,{dataBlog:o,dataHeading:t,dataHorizontalScroll:a,onClickModal:i,onClickLoadMore:n});default:return wo(Na,{dataBlog:o,dataHeading:t,dataHorizontalScroll:a,onClickModal:i,onClickLoadMore:n})}},Pc=({dataHeading:e,dataHorizontalScroll:o,dataBlog:t,template:a,onClickModal:i,onClickLoadMore:n})=>wo(kc,{children:Nc({dataHeading:e,dataHorizontalScroll:o,dataBlog:t,template:a,onClickModal:i,onClickLoadMore:n})}),Cc=({dataHeading:e,dataHorizontalScroll:o,dataBlog:t=[],idSection:a,className:i,background:n,template:s=1,onClickModal:l,onClickLoadMore:m})=>wo(B,{className:r("overflow-hidden",i),idSection:a,background:n,children:wo(Pc,{dataHeading:e,dataHorizontalScroll:o,dataBlog:t,template:s,onClickModal:l,onClickLoadMore:m})});import*as ka from"react";import{enUS as Dc,vi as Mc}from"date-fns/locale";import{ChevronLeft as Ic,ChevronRight as Ac}from"lucide-react";import Lc from"lunisolar";import{DayPicker as zc}from"react-day-picker";import*as Wr from"react";import*as Wo from"@radix-ui/react-checkbox";import{CheckIcon as Rc}from"@heroicons/react/16/solid";import{cva as $r}from"class-variance-authority";import{jsx as yi}from"react/jsx-runtime";var Tc=$r("peer shrink-0 rounded border-2 disabled:bg-gray-300 border-gray-300 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-default disabled:bg-gray-100 data-[state=checked]:border-none disabled:data-[state=checked]:bg-gray-400 disabled:data-[state=checked]:text-gray-100 data-[state=checked]:bg-pink-500 data-[state=checked]:text-white",{variants:{size:{medium:"h-4 w-4",large:"w-5 h-5"}},defaultVariants:{size:"medium"}}),Sc=$r("",{variants:{size:{medium:"h-4 w-4",large:"w-5 h-5"}},defaultVariants:{size:"medium"}}),Ca=Wr.forwardRef(({className:e,size:o,...t},a)=>yi(Wo.Root,{ref:a,className:r(Tc({size:o}),e),...t,children:yi(Wo.Indicator,{className:r("flex items-center justify-center text-current"),children:yi(Rc,{className:r(Sc({size:o}))})})}));Ca.displayName=Wo.Root.displayName;import{Fragment as Bc,jsx as tt,jsxs as wi}from"react/jsx-runtime";var Ec=({date:e,cusContent:o})=>{let t=null;return t=Lc(e).lunar,wi(Bc,{children:[o?o(e):e.getDate(),t&&tt("span",{className:"luna-date absolute right-0.5 top-1 hidden text-[8px] leading-none group-[.show-luna]:block",children:t.day})]})},Hc={formatCaption:e=>`Th\xE1ng ${e.getMonth()+1}/${e.getFullYear()}`,formatWeekdayName:e=>{let o=e.getDay();return["CN","T2","T3","T4","T5","T6","T7"][o]}};function _c({isShow:e,setIsShow:o,lang:t}){let a=ka.useId();return tt("div",{className:"w-full p-3 pt-0",children:wi("div",{className:"flex cursor-pointer items-center space-x-2 border-t border-gray-100 pt-3",children:[tt(Ca,{checked:e,id:`check-show-luna-${a}`,onCheckedChange:i=>{typeof i=="boolean"&&o(i)}}),tt("label",{htmlFor:`check-show-luna-${a}`,className:"z-[1] cursor-pointer text-sm leading-none text-gray-900 peer-disabled:cursor-default peer-disabled:text-gray-400",children:t==="vi"?"Hi\u1EC7n ng\xE0y \xE2m l\u1ECBch":"Show lunar date"})]})})}var Fc=e=>e.getDay()===0||e.getDay()===6;function Ra({className:e,classNames:o,showOutsideDays:t=!1,enableLunaDate:a=!1,lang:i="vi",cusContentDay:n,...s}){let[l,m]=ka.useState(!0);return tt(zc,{locale:i==="vi"?Mc:Dc,showOutsideDays:t,className:r("b w-fit rounded-b-md border border-gray-200 bg-white shadow-md",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-y-0",month:"p-3 pt-0 w-full",caption:"flex justify-center p-3 bg-blue-50 relative items-center -mx-3 mb-3",caption_label:"text-sm font-medium text-gray-900",nav:"space-x-1 flex items-center",nav_button:r(Ye({variant:"transparent"}),"h-7 w-7 p-0 text-gray-900 hover:bg-transparent hover:opacity-70"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse",head_row:"flex space-x-0.5",head_cell:r("w-11 rounded-md text-xs font-medium text-gray-500 [&:nth-child(7)]:!text-red-600",i==="vi"?"[&:nth-child(6)]:!text-red-600":"[&:nth-child(1)]:!text-red-600"),row:"flex w-full mt-0.5 space-x-0.5",cell:"h-11 w-11 text-center text-sm p-0 relative border-none",day:r(Ye({variant:"transparent"}),"group relative h-11 w-11 p-0 text-center text-sm font-semibold focus-within:relative focus-within:z-20 aria-selected:opacity-100 [&.day-range-end.day-range-start]:rounded-md aria-selected:[&:not(.day-range-middle)]:bg-pink-500 aria-selected:[&:not(.day-range-middle)]:text-white",a&&l&&"show-luna"),day_range_end:"day-range-end [&.day-range-end]:rounded-l-none",day_range_start:"day-range-start [&.day-range-start]:rounded-r-none",day_today:"day-today [&:not([aria-selected])]:text-pink-500 [&:not([aria-selected])]:border-gray-200",day_outside:"day-outside opacity-50 aria-selected:bg-accent/50 aria-selected:opacity-30",day_disabled:"opacity-50",day_range_middle:r("group/mid day-range-middle !rounded-none !bg-pink-50 text-gray-900 [&:nth-child(7)]:!text-red-600",i==="vi"?"[&:nth-child(6)]:!text-red-600":"[&:nth-child(1)]:!text-red-600"),day_hidden:"invisible",...o},modifiers:{weekend:Fc},modifiersClassNames:{weekend:"text-red-600"},components:{IconLeft:()=>tt(Ic,{className:"h-6 w-6"}),IconRight:()=>tt(Ac,{className:"h-6 w-6"}),DayContent:c=>tt(Ec,{date:c.date,cusContent:n}),Months:({children:c})=>wi("div",{className:"w-full",children:[tt("div",{className:r("months-wrapper flex flex-col sm:flex-row"),children:c}),a&&tt(_c,{isShow:l,setIsShow:m,lang:i})]})},formatters:i==="vi"?Hc:{},...s})}Ra.displayName="Calendar";import{QuestionMarkCircleIcon as Oc,XCircleIcon as Vc}from"@heroicons/react/16/solid";import{format as Ta}from"date-fns";import{Calendar as Gc}from"lucide-react";import*as Qr from"react";import*as Ct from"@radix-ui/react-popover";import{jsx as jr}from"react/jsx-runtime";var $o=Ct.Root,jo=Ct.Trigger,No=Qr.forwardRef(({className:e,align:o="center",sideOffset:t=4,...a},i)=>jr(Ct.Portal,{children:jr(Ct.Content,{ref:i,align:o,sideOffset:t,className:r("z-50 w-72 rounded-md border border-gray-200 bg-white p-4 sm:p-5 text-gray-900 shadow-small outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));No.displayName=Ct.Content.displayName;import{Fragment as Ur,jsx as Te,jsxs as Qo}from"react/jsx-runtime";var Wc=({label:e,placeholder:o="Select a value",size:t=1,message:a,isError:i,disabled:n,dateFormat:s="dd/MM/yyyy",buttonProps:l,popoverProps:m,calendarProps:c,popoverContentProps:d})=>{let p=c?.selected||null;return Qo("div",{children:[Qo($o,{...m,children:[Te(jo,{asChild:!0,children:Qo(we,{variant:"secondary",className:r("relative h-11 w-full justify-between overflow-visible text-left text-sm font-normal text-gray-900 ring-inset hover:ring-1 hover:ring-gray-400 focus:ring-1 focus:ring-gray-400 disabled:pointer-events-none disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 [&[data-state=open]]:border-pink-500 [&[data-state=open]]:ring-1 [&[data-state=open]]:ring-pink-500",t===2&&"h-12 text-base",(!p||!(p instanceof Date)&&typeof p=="object"&&(!("from"in p)||!p.from))&&"text-gray-500",i&&"border-red-500 ring-1 ring-red-500"),disabled:n,...l,children:[Te("div",{className:"line-clamp-1 flex-1",children:p instanceof Date?Ta(p,s):p&&typeof p=="object"&&"from"in p&&"to"in p?Te(Ur,{children:p.from?p.to?Qo(Ur,{children:[Te("span",{className:"date-from",children:Ta(p.from,s)})," ",Te("span",{className:"date-separator",children:"-"}),Te("span",{className:"date-to",children:Ta(p.to,s)})]}):Ta(p.from,s):o}):o}),e&&Te("span",{className:r("absolute -top-2 left-2 z-[1] bg-white px-1.5 text-xs text-gray-500",t===2&&" -top-2.5 text-sm",i&&"text-red-500"),children:e}),Te(Gc,{className:"ml-2 h-4 w-4 flex-none text-gray-500"})]})}),Te(No,{className:"w-auto border-none !p-0",...d,children:Te(Ra,{...c,defaultMonth:p&&typeof p=="object"&&"from"in p?p.from:p instanceof Date?p:void 0})})]}),a&&Qo("div",{className:"mobase-text-input-message mt-0.5 flex items-center space-x-1",children:[i?Te(Vc,{width:16,height:16,className:"text-red-500"}):Te(Oc,{width:16,height:16,className:"text-gray-500"}),Te("span",{className:r(i?"text-red-500":"text-gray-500",t===2?"text-sm":"text-xs"),children:a})]})]})};import{useEffect as qc,useState as en}from"react";import{QuestionMarkCircleIcon as Xc,XCircleIcon as Yc}from"@heroicons/react/16/solid";import{isValid as Zc}from"date-fns";import*as ot from"react";import{CheckIcon as $c,ChevronDownIcon as qr,ChevronUpIcon as jc,XCircleIcon as Qc}from"@heroicons/react/16/solid";import{QuestionMarkCircleIcon as Uc}from"@heroicons/react/24/outline";import*as D from"@radix-ui/react-select";import{jsx as Q,jsxs as Uo}from"react/jsx-runtime";var qo=ot.forwardRef(({className:e,children:o,label:t,message:a,size:i,isError:n,disabled:s,...l},m)=>Uo("div",{ref:m,className:r("select-mobase relative",e,s?"disabled":"",n?"[&>.select-mobase-button]:border-red-500 [&>.select-mobase-button]:ring-1 [&>.select-mobase-button]:ring-red-500":"",i===2?"[&>.select-mobase-button]:h-12 [&>.select-mobase-button]:text-base":""),children:[t&&Q("span",{className:r("mobase-select-label absolute -top-2 left-2 z-[1] bg-white px-1.5 text-xs text-gray-500",i===2&&"-top-2.5 text-sm",n&&"text-red-500"),children:t}),Q(D.Root,{disabled:s,...l,children:o}),a&&Uo("div",{className:r("mobase-select-message mt-1 flex items-center space-x-1 text-gray-500",n&&"text-red-500"),children:[n?Q(Qc,{width:16,height:16}):Q(Uc,{width:16,height:16}),Q("span",{className:r(i===2?"text-sm":"text-xs"),children:a})]})]})),Xo=D.Value,Po=ot.forwardRef(({className:e,children:o,...t},a)=>Uo(D.Trigger,{ref:a,className:r("select-mobase-button flex h-11 w-full items-center justify-between rounded-md border border-gray-300 bg-white p-3 text-sm text-gray-900 ring-0 ring-inset transition-all hover:ring-1 hover:ring-gray-400 focus-visible:border-pink-500 focus-visible:ring-1 focus-visible:!ring-pink-500 focus-visible:ring-offset-0 focus-visible:ring-offset-transparent disabled:pointer-events-none disabled:border-gray-200 disabled:bg-gray-50 data-[state=open]:border-pink-500 data-[placeholder]:text-gray-500 data-[state=open]:ring-1 data-[state=open]:ring-pink-500",e),...t,children:[Q("div",{className:"line-clamp-1 text-left",children:o}),Q(D.Icon,{asChild:!0,children:Q(qr,{className:"h-4 w-4 flex-none text-gray-500"})})]}));Po.displayName=D.Trigger.displayName;var Ni=ot.forwardRef(({className:e,...o},t)=>Q(D.ScrollUpButton,{ref:t,className:r("flex cursor-default items-center justify-center py-1",e),...o,children:Q(jc,{className:"h-5 w-5"})}));Ni.displayName=D.ScrollUpButton.displayName;var Pi=ot.forwardRef(({className:e,...o},t)=>Q(D.ScrollDownButton,{ref:t,className:r("flex cursor-default items-center justify-center bg-gradient-to-t from-white to-transparent py-1",e),...o,children:Q(qr,{className:"h-5 w-5"})}));Pi.displayName=D.ScrollDownButton.displayName;var Co=ot.forwardRef(({className:e,children:o,position:t="popper",...a},i)=>Q(D.Portal,{children:Uo(D.Content,{ref:i,className:r("shadow-small data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-gray-300 bg-white text-gray-900",t==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:t,...a,children:[Q(Ni,{}),Q(D.Viewport,{className:r("p-0",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:o}),Q(Pi,{})]})}));Co.displayName=D.Content.displayName;var Yo=ot.forwardRef(({className:e,children:o,...t},a)=>Q(D.Group,{ref:a,className:r("relative border-b border-gray-200 p-1 after:w-full last:border-0",e),...t,children:o})),Xr=ot.forwardRef(({className:e,...o},t)=>Q(D.Label,{ref:t,className:r("z-[1] py-1.5 pl-7 pr-2 text-sm font-semibold",e),...o}));Xr.displayName=D.Label.displayName;var Et=ot.forwardRef(({className:e,children:o,...t},a)=>Uo(D.Item,{ref:a,className:r("relative flex w-full cursor-default select-none items-center rounded-md py-1.5 pl-7 pr-2 text-sm outline-none focus:bg-gray-100 focus:text-gray-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t,children:[Q("span",{className:"absolute left-2 flex h-4 w-4 items-center justify-center",children:Q(D.ItemIndicator,{children:Q($c,{className:"h-4 w-4 text-pink-500"})})}),Q(D.ItemText,{children:o})]})),Yr=ot.forwardRef(({className:e,...o},t)=>Q(D.Separator,{ref:t,className:r("-mx-1 my-1 h-px",e),...o}));Yr.displayName=D.Separator.displayName;var Zr=["Th\xE1ng 01","Th\xE1ng 02","Th\xE1ng 03","Th\xE1ng 04","Th\xE1ng 05","Th\xE1ng 06","Th\xE1ng 07","Th\xE1ng 08","Th\xE1ng 09","Th\xE1ng 10","Th\xE1ng 11","Th\xE1ng 12"],Kr=["January","February","March","April","May","June","July","August","September","October","November","December"],Ci=(e,o,t,a)=>{let i=new Date(e,o,0).getDate(),n=t&&e===t.getFullYear()&&o===t.getMonth()+1?t.getDate():1,s=a&&e===a.getFullYear()&&o===a.getMonth()+1?a.getDate():i;return{daysInMonth:i,startDay:n,endDay:s}},Jr=(e,o,t,a)=>{let i=t?t.getFullYear():e,n=a?a.getFullYear():o;return Array.from({length:n-i+1},(s,l)=>n-l)};import{jsx as te,jsxs as at}from"react/jsx-runtime";var Kc=({label:e,selected:o,onSelect:t,size:a=1,message:i,isError:n,disabled:s,dateFormat:l="dd/MM/yyyy",lang:m="vi",fromYear:c=1900,toYear:d=new Date().getFullYear(),disableUnselect:p=!1})=>{let[g,h]=en(o??null),w=Math.min(c,d),T=Math.max(c,d),C=l==="MM/yyyy",z=(k,ne)=>{if(ne===0){h(void 0),t?.(void 0);return}let U=g?.getFullYear()||new Date().getFullYear(),ha=g?.getMonth()??0,qt=g?.getDate()??1;k==="month"&&ne!==null&&(ha=ne-1),k==="year"&&ne!==null&&(U=ne),C?qt=1:k==="day"&&ne!==null&&(qt=ne);let yr=Ci(U,ha+1).daysInMonth;qt>yr&&(qt=1);let Ho=new Date(U,ha,qt);Zc(Ho)&&(h(Ho),t?.(Ho))},[W,_]=en(!1),Ut=k=>{_(k)};return qc(()=>{h(o??null)},[o]),at("div",{className:r("relative",s&&"cursor-no-drop"),children:[at("div",{className:r("relative block h-11 w-full rounded-md border border-gray-300 bg-white px-1 py-3 text-sm text-gray-900 outline-none ring-inset transition-all placeholder:text-gray-500 hover:ring-1 hover:ring-gray-400 focus:border-pink-500 focus:ring-1 focus:ring-gray-400 disabled:pointer-events-none disabled:border-gray-200 disabled:bg-gray-50",W&&"border-pink-500 ring-1 ring-pink-500",a===2&&"h-12 text-base",g?"":"text-gray-500",n&&"border-red-500 ring-1 ring-red-500",s&&"pointer-events-none select-none border-gray-200 bg-gray-50"),children:[e&&te("span",{className:r("absolute -top-2 left-2 z-[1] bg-white px-1.5 text-xs text-gray-500",a===2&&" -top-2.5 text-sm",n&&"text-red-500"),children:e}),at("div",{className:"flex h-full flex-row divide-x",children:[!C&&at(qo,{value:g?g.getDate().toString().padStart(2,"0"):"",onValueChange:k=>z("day",parseInt(k,10)),onOpenChange:Ut,className:"w-[30%]",children:[te(Po,{className:"h-full w-full rounded-none border-none bg-transparent py-0 !ring-0 hover:!text-pink-500",children:te(Xo,{placeholder:m==="vi"?"Ng\xE0y":"Day"})}),te(Co,{onCloseAutoFocus:k=>k.preventDefault(),children:at(Yo,{children:[!p&&te(Et,{value:"0",className:"text-gray-600",children:m==="vi"?"B\u1ECF ch\u1ECDn":"None"}),Array.from({length:Ci(g?.getFullYear()||new Date().getFullYear(),(g?.getMonth()??0)+1).daysInMonth},(k,ne)=>(ne+1).toString().padStart(2,"0")).map(k=>te(Et,{value:k,children:k},k))]})})]}),at(qo,{value:g?(g.getMonth()+1).toString():"",onValueChange:k=>z("month",parseInt(k,10)),onOpenChange:Ut,className:r(C?"w-1/2":"w-2/5"),children:[te(Po,{className:"h-full w-full !rounded-none border-none bg-transparent py-0 !ring-0 hover:!text-pink-500",children:te(Xo,{placeholder:m==="vi"?"Th\xE1ng":"Month"})}),te(Co,{onCloseAutoFocus:k=>k.preventDefault(),children:at(Yo,{children:[!p&&te(Et,{value:"0",className:"text-gray-600",children:m==="vi"?"B\u1ECF ch\u1ECDn":"None"}),Array.from({length:12},(k,ne)=>ne+1).map(k=>te(Et,{value:k.toString(),children:m==="vi"?Zr[k-1]:Kr[k-1]},k))]})})]}),at(qo,{value:g?g.getFullYear().toString():"",onValueChange:k=>z("year",parseInt(k,10)),onOpenChange:Ut,className:r(C?"w-1/2":"w-[30%]"),children:[te(Po,{className:"h-full w-full !rounded-none border-none bg-transparent py-0 !ring-0 hover:!text-pink-500",children:te(Xo,{placeholder:m==="vi"?"N\u0103m":"Year"})}),te(Co,{onCloseAutoFocus:k=>k.preventDefault(),children:at(Yo,{children:[!p&&te(Et,{value:"0",className:"text-gray-600",children:m==="vi"?"B\u1ECF ch\u1ECDn":"None"}),Jr(w,T).map(k=>te(Et,{value:k.toString(),children:k},k))]})})]})]})]}),i&&at("div",{className:"mobase-text-input-message mt-0.5 flex items-center space-x-1",children:[n?te(Yc,{width:16,height:16,className:"text-red-500"}):te(Xc,{width:16,height:16,className:"text-gray-500"}),te("span",{className:r(n?"text-red-500":"text-gray-500",a===2?"text-sm":"text-xs"),children:i})]})]})};import*as Kt from"react";import*as V from"@radix-ui/react-alert-dialog";import{jsx as kt,jsxs as td}from"react/jsx-runtime";var Jc=V.Root,ed=V.Trigger,tn=V.Portal,ki=Kt.forwardRef(({className:e,...o},t)=>kt(V.Overlay,{className:r("fixed inset-0 z-50 bg-black/70 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...o,ref:t}));ki.displayName=V.Overlay.displayName;var on=Kt.forwardRef(({className:e,...o},t)=>td(tn,{children:[kt(ki,{}),kt(V.Content,{ref:t,className:r("fixed left-[50%] w-[90vw] bg-white text-gray-700 border border-gray-300 top-[50%] z-50 grid w- max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-xl",e),...o})]}));on.displayName=V.Content.displayName;var an=({className:e,...o})=>kt("div",{className:r("flex flex-col space-y-2 text-left",e),...o});an.displayName="AlertDialogHeader";var rn=({className:e,...o})=>kt("div",{className:r("flex flex-row justify-end space-x-4",e),...o});rn.displayName="AlertDialogFooter";var nn=Kt.forwardRef(({className:e,...o},t)=>kt(V.Title,{ref:t,className:r("text-lg text-gray-900 font-semibold",e),...o}));nn.displayName=V.Title.displayName;var sn=Kt.forwardRef(({className:e,...o},t)=>kt(V.Description,{ref:t,className:r("text-sm text-muted-foreground",e),...o}));sn.displayName=V.Description.displayName;var ln=Kt.forwardRef(({className:e,...o},t)=>kt(V.Action,{ref:t,className:r(Ye({variant:"primary"}),"",e),...o}));ln.displayName=V.Action.displayName;var mn=Kt.forwardRef(({className:e,...o},t)=>kt(V.Cancel,{ref:t,className:r(Ye({variant:"secondary"}),e),...o}));mn.displayName=V.Cancel.displayName;import{memo as cd,useState as dd}from"react";import{useEffect as od,useState as dn}from"react";import{motion as ad}from"motion/react";import*as cn from"@radix-ui/react-aspect-ratio";var H=cn.Root;import{Fragment as pn,jsx as oe,jsxs as Zo}from"react/jsx-runtime";var id=({guideGroup:e,mockup:o})=>{let[t,a]=dn(),[i,n]=dn(0),s={open:{height:"auto",opacity:1,transition:{duration:.3,ease:"easeInOut"}},closed:{height:0,opacity:0,transition:{duration:.3,ease:"easeInOut"}}};return od(()=>{t&&(n(t.selectedScrollSnap()+1),t.on("select",()=>{n(t.selectedScrollSnap()+1)}))},[t]),oe(pn,{children:e?.stepList&&e?.stepList?.length>0&&Zo("div",{className:"mx-auto flex max-w-3xl flex-nowrap justify-center",children:[oe("div",{className:"h-auto w-64 flex-none",children:Zo("div",{className:r("relative mx-auto w-full",o==="none"?"":"rounded-[2.5rem] border-8 border-gray-800 bg-gray-800 shadow-md",o==="small"?"px-1 py-5":""),children:[o!=="none"&&Zo(pn,{children:[oe("div",{className:"absolute -start-2.5 top-16 h-8 w-1.5 rounded-s-lg bg-gray-800"}),oe("div",{className:"absolute -start-2.5 top-32 h-12 w-1.5 rounded-s-lg bg-gray-800"}),oe("div",{className:"absolute -start-2.5 top-48 h-12 w-1.5 rounded-s-lg bg-gray-800"}),oe("div",{className:"absolute -end-2.5 top-40 h-16 w-1 rounded-e-lg bg-gray-800"})]}),oe("div",{className:r("relative h-full w-full overflow-hidden",o==="none"?"":"rounded-[2rem] bg-gray-200",o==="small"?"rounded-xl":""),children:Zo(ge,{setApi:a,children:[oe(ve,{className:"ml-0",children:e?.stepList.map((l,m)=>oe(de,{className:"pl-0",children:oe(H,{ratio:o==="small"?540/960:540/1168,children:l?.image&&oe("img",{src:l.image,className:"size-full object-contain",alt:l.title,"data-puck-editable":"true","data-puck-component":"GuideSection","data-puck-field":"dataGuide","data-puck-array-index":"0","data-puck-array-field":"stepList","data-puck-array-index-nested":m?.toString()??"","data-puck-nested-field":"image"})})},m))}),oe(xo,{className:"left-1 border-none bg-gray-900/30 text-white hover:bg-gray-900/40 disabled:hidden"}),oe(bo,{className:"right-1 border-none bg-gray-900/30 text-white hover:bg-gray-900/40 disabled:hidden"})]})})]})}),oe("div",{className:"flex flex-auto pl-12 pt-4",children:oe("ul",{className:"flex flex-col",children:e?.stepList.map((l,m)=>Zo("li",{className:r("relative min-h-20 pb-8 pl-14 after:absolute after:left-4 after:top-0 after:h-full after:border-l after:border-dashed after:border-gray-200 last:min-h-0 last:pb-0 last:after:hidden",m+1===i?"":"cursor-pointer"),onClick:()=>t&&t.scrollTo(m),children:[oe("div",{className:r("absolute -top-1.5 left-0 z-10 flex h-8 w-8 items-center justify-center rounded-full text-sm font-bold",m+1===i?"bg-pink-500 text-white":"bg-pink-100 text-pink-500"),children:m+1}),oe("div",{className:r("text-sm font-medium",m+1===i?"text-pink-500":"text-gray-900"),children:parse(l.title)}),l.content&&oe(ad.div,{initial:"closed",animate:m+1===i?"open":"closed",variants:s,style:{overflow:"hidden"},children:oe("div",{className:"mt-3 text-sm text-gray-700",children:u(l.content)})})]},m))})})]})})},Ri=id;import{useEffect as rd,useRef as nd,useState as Sa}from"react";import{ChevronRightIcon as fn}from"@heroicons/react/20/solid";import sd from"embla-carousel-autoplay";import{Fragment as Ti,jsx as N,jsxs as Pe}from"react/jsx-runtime";var ld=({open:e,setOpenDialog:o,dataStep:t,mockup:a})=>{let[i,n]=Sa(0),[s,l]=Sa();return rd(()=>{s&&(n(s.selectedScrollSnap()+1),s.on("select",()=>{n(s.selectedScrollSnap()+1)}))},[s]),!t||!t?.stepList?.length?null:N(Re,{open:e,onOpenChange:o,children:Pe(Ne,{position:"bottom",height:"full",children:[N(At,{children:N(Lt,{className:"line-clamp-1",children:t?.title})}),Pe(ze,{className:"grid overflow-hidden p-0",children:[N(ge,{setApi:l,className:"grid overflow-hidden",children:N(ve,{className:"ml-0 h-full",children:t.stepList.map((m,c)=>N(de,{className:"h-full w-full pl-0",children:Pe("div",{className:"flex h-full flex-col overflow-y-auto",children:[N("div",{className:"relative flex w-full flex-none justify-center bg-gray-100 p-5",children:N("div",{className:r("mx-auto",a==="small"?"w-56":"w-52"),children:Pe("div",{className:r("relative mx-auto w-full",a==="none"?"":"rounded-[2rem] border-8 border-gray-800 bg-gray-800 shadow-md",a==="small"?"px-0.5 py-3":""),children:[a!=="none"&&Pe(Ti,{children:[N("div",{className:"absolute -start-2.5 top-16 h-8 w-1.5 rounded-s-lg bg-gray-800"}),N("div",{className:"absolute -start-2.5 top-32 h-12 w-1.5 rounded-s-lg bg-gray-800"}),N("div",{className:"absolute -start-2.5 top-48 h-12 w-1.5 rounded-s-lg bg-gray-800"}),N("div",{className:"absolute -end-2.5 top-40 h-16 w-1 rounded-e-lg bg-gray-800"})]}),N("div",{className:r("relative h-full w-full overflow-hidden",a==="none"?"":"rounded-[1.5rem] bg-gray-200",a==="small"?"rounded-xl":""),children:N(H,{ratio:a==="small"?540/960:540/1168,children:m?.image&&N("img",{src:m.image,className:"size-full object-contain",alt:m.title})})})]})})}),Pe("div",{className:"p-5 pb-12",children:[N("div",{className:"font-semibold",children:u(m.title)}),m?.content&&N("div",{className:"mt-3 text-sm text-gray-800",children:u(m.content)})]})]})},c))})}),N("div",{className:"text-muted-foreground fixed bottom-3 left-1/2 flex -translate-x-1/2 items-center justify-center gap-1.5 rounded-full bg-gray-900/50 px-3 py-1 py-2 text-center text-sm text-gray-700",children:t.stepList.map((m,c)=>N("div",{className:`h-2 w-2 cursor-pointer rounded-full ${c+1===i?"bg-white":"bg-white/40"}`,onClick:()=>s&&s.scrollTo(c)},c))})]})]})})},md=({dataGuide:e,mockup:o,isStep:t})=>{let[a,i]=Sa(!1),[n,s]=Sa(null),l=nd(sd({delay:3500,stopOnInteraction:!1,stopOnMouseEnter:!1})),m=c=>{s(e?.[c]||null),i(!0)};return e?.length===0?null:Pe(Ti,{children:[e?.length>1?N("div",{className:"-mx-5 grid grid-cols-1 md:mx-0",children:e.map((c,d)=>Pe("div",{className:"relative flex cursor-pointer flex-nowrap items-center space-x-4 pl-5",onClick:()=>m(d),children:[N("div",{className:"borde flex h-28 w-20 justify-center overflow-hidden rounded-t-lg bg-gray-100 p-2 pb-0",children:(c?.avatar||c?.stepList?.[0]?.image)&&N("img",{src:c.avatar||c?.stepList?.[0]?.image,className:"h-full w-full object-cover object-top",alt:c.title,"data-puck-editable":"true","data-puck-component":"GuideSection","data-puck-field":"dataGuide","data-puck-array-index":d,"data-puck-nested-field":"avatar"})}),Pe("div",{className:r("relative grid min-h-32 flex-1 grid-cols-1 items-center pr-8",d+1!=e.length&&"after:absolute after:bottom-0 after:left-0 after:right-0 after:h-px after:bg-gray-200"),children:[Pe("div",{className:"py-2",children:[t&&N("span",{className:"text-sm font-medium text-pink-500",children:`B\u01B0\u1EDBc ${d+1}`}),N("div",{className:"font-semibold",children:u(c.title)}),c?.description&&N("div",{className:"mt-1 text-sm text-gray-500",children:u(c.description)})]}),N("div",{className:"absolute right-4 top-1/2 -translate-y-1/2 text-gray-500",children:N(fn,{className:"h-6 w-6"})})]})]},d))}):e?.[0]&&e[0].stepList?.length>0&&Pe("div",{className:"mx-auto flex max-w-3xl flex-col flex-wrap justify-center gap-y-6",children:[N("div",{className:"relative max-h-96 w-full flex-none overflow-hidden",style:{WebkitMask:"linear-gradient(to bottom, rgba(0, 0, 0, 1.0) 95%, rgba(0, 0, 0, 0.3) 98%, transparent 100%)"},children:N("div",{className:"mx-auto h-auto w-72",children:Pe("div",{className:r("relative mx-auto w-full",o==="none"?"":"rounded-[2.5rem] border-8 border-gray-800 bg-gray-800 shadow-md",o==="small"?"px-1 py-5":""),children:[o!=="none"&&Pe(Ti,{children:[N("div",{className:"absolute -start-2.5 top-16 h-8 w-1.5 rounded-s-lg bg-gray-800"}),N("div",{className:"absolute -start-2.5 top-32 h-12 w-1.5 rounded-s-lg bg-gray-800"}),N("div",{className:"absolute -start-2.5 top-48 h-12 w-1.5 rounded-s-lg bg-gray-800"}),N("div",{className:"absolute -end-2.5 top-40 h-16 w-1 rounded-e-lg bg-gray-800"})]}),N("div",{className:r("relative h-full w-full overflow-hidden",o==="none"?"":"rounded-[2rem] bg-gray-200",o==="small"?"rounded-xl":""),children:N(ge,{plugins:[l.current],children:N(ve,{className:"ml-0",children:e[0]?.stepList.map((c,d)=>N(de,{className:"pl-0",onClick:()=>m(0),children:N(H,{ratio:o==="small"?540/960:540/1168,children:c?.image&&N("img",{src:c.image,className:"size-full object-contain",alt:c.title,"data-puck-editable":"true","data-puck-component":"GuideSection","data-puck-field":"dataGuide","data-puck-array-index":0,"data-puck-array-field":"stepList","data-puck-array-index-nested":d?d?.toString():"","data-puck-nested-field":"image"})})},d))})})})]})})}),N("div",{className:"flex w-full flex-none justify-center",children:Pe(ie,{size:"lg",variant:"primary",onClick:()=>m(0),children:["Xem chi ti\u1EBFt h\u01B0\u1EDBng d\u1EABn ",N(fn,{className:"ml-1 h-5 w-5"})]})})]}),a&&N(ld,{open:a,setOpenDialog:i,dataStep:n,mockup:o})]})},un=md;import{Fragment as pd,jsx as pe,jsxs as Ko}from"react/jsx-runtime";var gn=({direction:e,className:o})=>{let t=e==="left"?{viewBox:"0 0 20 40",d:"M20 0H0L18 20L0 40H20V0Z",width:"20"}:{viewBox:"0 0 19 40",d:"M0.906128 0H0V40H0.906128L19 20L0.906128 0Z",width:"19"};return pe("svg",{fill:"none",viewBox:t.viewBox,xmlns:"http://www.w3.org/2000/svg",className:r("flex-0 absolute w-5 transition-all",o),children:pe("path",{d:t.d,fill:"currentColor"})})},Si=cd(({dataHeading:e,dataHorizontalScroll:o,dataGuide:t,dataButtons:a,mockup:i,isStep:n})=>{let{showGradientOverlay:s=!0,gradientOverlayColor:l,className:m}=o||{},[c,d]=dd(t?.[0]?.title||"");return Ko(pd,{children:[e&&pe(x,{tagline:e?.tagline,title:e?.title,description:e?.description,tagHeading:e?.tagHeading,align:"center",colorScheme:e?.colorScheme||"pink",sizeHeading:e?.sizeHeading,className:r(e?.className)}),t&&t?.length>0&&Ko(fo,{children:[pe(Xe,{lessThan:"md",children:pe(un,{dataGuide:t,mockup:i,isStep:n})}),pe(Xe,{greaterThan:"sm",children:t?.length>1?Ko(Pt,{defaultValue:t[0]?.title,onValueChange:p=>d(p),children:[Ko(bt,{showGradientOverlay:s,gradientOverlayColor:l,className:m,children:[pe(yt,{className:"mb-6 text-center",children:pe(Ze,{className:r("mx-auto mb-0 inline-flex w-auto items-center overflow-visible",n?"space-x-10":""),children:t.map((p,g)=>{let h=g===t.length-1,w=c===p?.title||"";return Ko(Ke,{value:p.title,className:r(n?"relative h-10 border-0 bg-pink-100 px-3 first:rounded-l-md first:pl-5 last:rounded-r-md last:pl-3 last:pr-5":"",w&&n?"data-[state=active]:bg-pink-500 data-[state=active]:text-white":""),children:[n&&g!==0&&pe(gn,{direction:"left",className:r("right-full top-0",w?"text-pink-500":"text-pink-100")}),p.title,n&&!h&&pe(gn,{direction:"right",className:r("left-full top-0",w?"text-pink-500":"text-pink-100")})]},p.title+g)})})}),pe(wt,{}),pe(Nt,{})]}),t.map((p,g)=>pe(Je,{value:p.title,children:pe(Ri,{guideGroup:p,mockup:i})},p.title+g))]}):t?.length===1&&t[0]&&pe(Ri,{guideGroup:t[0],mockup:i})})]}),a&&pe(b,{isFullInMobile:a?.isFullInMobile,buttons:a?.buttons,className:a?.className,align:"center"})]})});import{Fragment as vd,jsx as Jo}from"react/jsx-runtime";var fd=({template:e,dataHeading:o,dataGuide:t,dataHorizontalScroll:a,dataButtons:i,mockup:n,isStep:s})=>{switch(e){case 1:return Jo(Si,{dataHeading:o,dataHorizontalScroll:a,dataGuide:t,dataButtons:i,mockup:n,isStep:s});default:return Jo(Si,{dataHeading:o,dataHorizontalScroll:a,dataGuide:t,dataButtons:i,mockup:n,isStep:s})}},ud=({dataHeading:e,dataHorizontalScroll:o,dataGuide:t,dataButtons:a,template:i,mockup:n,isStep:s})=>Jo(vd,{children:fd({dataHeading:e,dataHorizontalScroll:o,dataGuide:t,dataButtons:a,template:i,mockup:n,isStep:s})}),gd=({idSection:e,dataHeading:o,dataGuide:t,dataHorizontalScroll:a,dataButtons:i,className:n,background:s,template:l=1,mockup:m="default",isStep:c=!1})=>Jo(B,{className:r(n),background:s,idSection:e,children:Jo(ud,{dataHeading:o,template:l,dataHorizontalScroll:a,dataGuide:t,dataButtons:i,mockup:m,isStep:c})});import{useState as vn}from"react";import{Fragment as Di,jsx as E,jsxs as Rt}from"react/jsx-runtime";var hn="text-xs font-medium md:text-sm",hd=({gift:e,onOpenModal:o,index:t})=>{let a=!!e.useModal,i=!!e.btnLink?.trim(),n=e.btnName||"Xem chi ti\u1EBFt",s=l=>{l.stopPropagation(),o(e)};return E("div",{className:"w-full px-2.5 md:w-1/2 lg:w-1/3",children:Rt("div",{className:r("relative h-full rounded-xl border border-gray-200 bg-white p-2 transition-all duration-300",e.isFeatured&&"border-pink-500",a&&"cursor-pointer ring-inset hover:border-pink-500 hover:shadow-lg hover:shadow-pink-500/20 hover:ring-1 hover:ring-pink-500"),role:a?"button":void 0,tabIndex:a?0:void 0,onClick:()=>a&&o(e),children:[e.tag&&Rt("span",{className:"absolute -top-2 right-2 z-10 inline-flex",children:[E("span",{className:"rounded-bl-md rounded-br-md bg-red-600 px-2 py-0.5 text-xs font-semibold uppercase text-white shadow-sm",children:u(e.tag)}),E("span",{"aria-hidden":!0,className:"absolute right-full top-0 h-0 w-0 border-r-8 border-t-8 border-r-red-800 border-t-transparent"})]}),Rt("div",{className:"relative z-10 flex h-full flex-row items-stretch gap-3",children:[e.thumbnail&&E("div",{className:"w-28 flex-none shrink-0 md:w-32",children:E(H,{ratio:1,className:"w-full",children:E("img",{src:e.thumbnail,alt:e.title||"Gift image",className:"h-full w-full rounded-md object-contain","data-puck-editable":"true","data-puck-component":"GiftListSection","data-puck-field":"dataGiftList","data-puck-array-index":t,"data-puck-nested-field":"thumbnail"})})}),Rt("div",{className:"flex min-w-0 flex-1 flex-col",children:[Rt("div",{className:"flex-1",children:[e.serviceName?E("span",{className:"mb-1.5 mt-1 block text-xs font-medium text-gray-700 md:mb-2",children:u(e.serviceName)}):E(Di,{}),E("h3",{className:"text-base font-semibold text-gray-900 md:text-lg",children:u(e.title)}),e.description&&E("p",{className:"line-clamp-2 text-sm text-gray-600",children:u(e.description)})]}),E("div",{className:"mt-auto flex flex-none justify-end pt-1 md:pt-2",children:n&&(i?E(ie,{variant:"primary",className:hn,asChild:!0,children:E("a",{href:e.btnLink,target:e.newTab?"_blank":"_self",rel:"noreferrer",onClick:l=>l.stopPropagation(),children:n})}):E(ie,{variant:"primary",size:"default",className:hn,type:"button",onClick:s,children:n}))})]})]})]})})},Da=({dataHeading:e,dataButtons:o,dataGiftList:t})=>{let[a,i]=vn(null),[n,s]=vn(!1),l=m=>{i(m),s(!0)};return Rt(Di,{children:[e&&E(x,{align:e.align||"center",tagline:e.tagline,title:e.title,description:e.description,tagHeading:e.tagHeading,colorScheme:e.colorScheme||"pink",sizeHeading:e.sizeHeading,className:e.className}),t&&t.length>0&&E("div",{className:"-mx-2.5 mt-8 flex flex-wrap justify-center gap-y-5 md:mt-10",children:t.map((m,c)=>E(hd,{gift:m,onOpenModal:l,index:c},c))}),o&&E(b,{isFullInMobile:o.isFullInMobile,buttons:o.buttons,className:o.className,align:o.align||"center"}),n&&E(Re,{open:n,onOpenChange:s,children:Rt(Ne,{size:"lg",position:"bottom",children:[E(At,{children:E(Lt,{children:"Th\xF4ng tin chi ti\u1EBFt th\u1EBB qu\xE0"})}),Rt(ze,{children:[Rt("div",{className:"text-center",children:[a?.serviceName&&E("span",{className:"mb-1 block text-xs font-medium text-gray-500",children:u(a.serviceName)}),a?.title&&E("h3",{className:"text-xl font-bold md:text-2xl",children:u(a.title)}),a?.description&&E("p",{className:"mt-1 text-sm text-gray-700",children:u(a.description||"")})]}),a?.content?E("div",{className:"prose prose-sm mt-6 max-w-none",children:u(a.content)}):E(Di,{})]}),E(xa,{children:E(we,{variant:"primary",size:"default",onClick:()=>s(!1),children:"\u0110\xF3ng"})})]})})]})};import{jsx as Mi}from"react/jsx-runtime";var xd=({template:e,dataHeading:o,dataButtons:t,dataGiftList:a})=>{switch(e){case 1:return Mi(Da,{dataHeading:o,dataButtons:t,dataGiftList:a});default:return Mi(Da,{dataHeading:o,dataButtons:t,dataGiftList:a})}},bd=({template:e=1,className:o,idSection:t,background:a,dataHeading:i,dataButtons:n,dataGiftList:s})=>Mi(B,{idSection:t,className:o,background:a,children:xd({template:e,dataHeading:i,dataButtons:n,dataGiftList:s})});import{ChevronLeft as yd,ChevronRight as wd}from"lucide-react";import{Fragment as Nd,jsx as He,jsxs as xn}from"react/jsx-runtime";function bn({current:e,total:o,onChange:t}){let a=i=>He("li",{children:He("button",{className:r(Zt({variant:e===i?"outline":"secondary",size:"sm"})),onClick:()=>t(i),children:i})},i);return He("nav",{role:"navigation","aria-label":"pagination",className:r("mx-auto flex w-full justify-center"),children:xn("ul",{className:r("flex flex-row flex-wrap items-center gap-2"),children:[o>1&&He("li",{children:He("button",{className:r(Zt({variant:"secondary",size:"sm"})),disabled:e===1,onClick:()=>e>1&&t(e-1),children:He(yd,{className:"h-4 w-4"})})}),o<=6?Array(o).fill(0).map((i,n)=>a(n+1)):xn(Nd,{children:[a(1),e===1&&[a(2),a(3)],e>3&&He("li",{children:He("button",{className:r(Zt({variant:"secondary",size:"sm"})),disabled:e===1,onClick:()=>t(e-3),children:"..."})}),e>2&&e!==1&&e!==o&&a(e-1),e>1&&e<o&&a(e),e<o-1&&e!==1&&a(e+1),e===o&&[a(o-2),a(o-1)],e<o-2&&e!==o&&He("button",{className:r(Zt({variant:"secondary",size:"sm"})),disabled:e===1,onClick:()=>t(e+3),children:"..."}),a(o)]}),o>1&&He("li",{children:He("button",{className:r(Zt({variant:"secondary",size:"sm"})),disabled:e===o,onClick:()=>e<o&&t(e+1),children:He(wd,{className:"h-4 w-4"})})})]})})}import{forwardRef as Pd}from"react";import{QuestionMarkCircleIcon as Cd}from"@heroicons/react/24/outline";import{XCircleIcon as kd}from"@heroicons/react/24/solid";import{jsx as ko,jsxs as yn}from"react/jsx-runtime";var Rd=Pd(({disabled:e,isError:o,message:t,label:a,className:i,inputClassName:n,size:s,rows:l=3,...m},c)=>yn("div",{className:r("relative",i,o&&"mobase-text-area-error"),children:[a&&ko("span",{className:r("mobase-text-area-label absolute -top-2.5 left-2 z-[1] bg-white px-1.5 text-sm text-gray-500",s===2&&" -top-2.5 text-sm"),children:a}),ko("textarea",{disabled:e,ref:c,className:r("mobase-text-area-box block w-full rounded-md border border-gray-300 bg-white p-3 text-sm text-gray-900 outline-none transition-all placeholder:text-gray-500 focus:border-pink-500 disabled:border-gray-200 disabled:bg-gray-50",s===2&&"text-base",n),rows:l,...m}),t&&yn("div",{className:"mobase-text-area-message mt-0.5 flex items-center space-x-1",children:[o?ko(kd,{width:16,height:16,className:"text-red-500"}):ko(Cd,{width:16,height:16,className:"text-gray-500"}),ko("span",{className:r("text-gray-500 ",s===2?"text-sm":"text-xs"),children:t})]}),ko("style",{children:`
|
|
70
|
+
`})]}),Xt=({className:e,children:o,title:t,shortTitle:a,qrImage:i,qrLink:n,logoQr:s,isQrForAll:l=!1,...m})=>M(Re,{...m,children:M(Ne,{className:r("h-auto max-h-screen overflow-hidden border-0 md:max-h-screen md:max-w-2xl lg:max-w-3xl [&>button>svg]:text-white",e),size:"xl",positionRightCloseBtn:!0,children:M(ze,{className:"p-0",children:ue("div",{className:"flex flex-row flex-wrap",children:[M("div",{className:"hidden flex-none w-full sm:block md:w-5/12",children:o||ue("div",{className:"grid grid-cols-1 gap-y-6 px-5 py-8 text-sm",children:[ue("div",{className:"flex flex-nowrap items-center",children:[M("div",{className:"flex-none",children:M("img",{className:"w-20",loading:"lazy",src:"https://homepage.momocdn.net/images/s/momo-upload-api-200917091602-637359309621891617.png",alt:"Step 1"})}),ue("div",{className:"flex-1 pl-4",children:[M("div",{className:"font-semibold text-gray-800 step",children:"B\u01B0\u1EDBc 1 :"}),M("div",{className:"mt-1 text-gray-500",children:l?"M\u1EDF app MoMo ho\u1EB7c \u1EE9ng d\u1EE5ng ng\xE2n h\xE0ng/v\xED \u0111i\u1EC7n t\u1EED ch\u1EA5p nh\u1EADn m\xE3 v\u1EA1ch t\u1EEB QR \u0110a N\u0103ng":"M\u1EDF \u1EE9ng d\u1EE5ng camera m\u1EB7c \u0111\u1ECBnh ho\u1EB7c \u1EE9ng d\u1EE5ng h\u1ED7 tr\u1EE3 QR code c\u1EE7a b\u1EA1n"})]})]}),ue("div",{className:"flex flex-nowrap items-center",children:[M("div",{className:"flex-none",children:M("img",{className:"w-20",loading:"lazy",src:"https://homepage.momocdn.net/images/s/momo-upload-api-200917091443-637359308837905996.png",alt:"Step 2"})}),ue("div",{className:"flex-1 pl-4",children:[M("div",{className:"font-semibold text-gray-800 step",children:"B\u01B0\u1EDBc 2 :"}),M("div",{className:"mt-1 text-gray-500",children:"Qu\xE9t m\xE3 QR Code theo h\xECnh b\xEAn ph\u1EA3i"})]})]}),ue("div",{className:"flex flex-nowrap items-center",children:[M("div",{className:"flex-none",children:M("img",{className:"w-20",loading:"lazy",src:"https://homepage.momocdn.net/images/s/momo-upload-api-200917090146-637359301062519803.png",alt:"Step 3"})}),ue("div",{className:"flex-1 pl-4",children:[M("div",{className:"font-semibold text-gray-800 step",children:"B\u01B0\u1EDBc 3 :"}),ue("div",{className:"mt-1 text-gray-500",children:["B\u1EA5m v\xE0o th\xF4ng b\xE1o hi\u1EC3n th\u1ECB \u0111\u1EC3 t\u1EA3i \u1EE9ng d\u1EE5ng ho\u1EB7c"," ",a||"Truy c\u1EADp ngay"]})]})]})]})}),M("div",{className:"flex justify-center items-center w-full h-auto md:w-7/12",style:{background:"url(https://homepage.momocdn.net/jk/momo2020/img/intro/qrcode-pattern.png) 10px 10px no-repeat,linear-gradient(to top,#c1177c,#e11b90)"},children:ue("div",{className:"px-5 py-10 text-center",children:[t&&M("h4",{className:"mb-5 text-base font-semibold text-white",children:t}),ue("div",{className:"relative",children:[l&&M("div",{className:"absolute -top-2 left-1/2 z-[5] -translate-x-1/2",children:M("img",{src:"https://homepage.momocdn.net/fileuploads/svg/momo-file-231211170324.svg",alt:"Title QR all"})}),M(Dm,{img:i,isQrForAll:l,children:n&&M(Sm,{value:n,size:215,imageSettings:{src:`${s||"https://homepage.momocdn.net/pwa/images/logoMomox50.png"}`,height:50,width:50,excavate:!0},level:"H"})})]})]})})]})})})});import{useState as Hm}from"react";import{useEffect as Mm,useLayoutEffect as Im,useState as Am}from"react";import Lm from"ua-parser-js";var zm=()=>Lm().device.type==="mobile",Em=typeof window<"u"?Im:Mm,vo=()=>{let[e,o]=Am(!1);return Em(()=>{o(zm())},[]),e};import{Fragment as _m,jsx as ba,jsxs as Fm}from"react/jsx-runtime";var Ge=({action:e,newTab:o,offset:t,dialogQrProps:a,className:i,children:n,...s})=>{let[l,m]=Hm(!1),c=vo(),d=!!a?.qrLink,p=()=>{let z=d?a?.qrLink:e;return typeof z=="string"?z.trim():""},g=()=>{let z=p();!z&&typeof e!="function"||(typeof e=="function"?e():window.open(z,o?"_blank":"_self"))},h=(z,W=0)=>{let _=document.querySelector(z);if(!_)return;let k=_.getBoundingClientRect().top+window.scrollY-W;window.scrollTo({top:k,behavior:"smooth"})},w=()=>{typeof e=="string"&&e.startsWith("#")?h(e,t):g()},T=()=>Fm(_m,{children:[ba(we,{...s,className:i,onClick:()=>m(!0),"data-name":"button-action-with-qr",children:n}),ba(Xt,{...a,open:l,onOpenChange:()=>m(!1),qrLink:a?.qrLink||""})]});return d?c?a?.isQrForAll?T():ba(we,{...s,className:i,onClick:g,"data-name":"button-action-with-qr",children:n}):T():ba(we,{...s,onClick:w,className:r("cursor-pointer",i),"data-name":"button-action-without-qr",rel:"noreferrer",children:n})};import*as ho from"react";import{ChevronRightIcon as Bm,DotsHorizontalIcon as Om}from"@radix-ui/react-icons";import{Slot as Vm}from"@radix-ui/react-slot";import{jsx as xt,jsxs as Gm}from"react/jsx-runtime";var Tr=ho.forwardRef(({className:e,...o},t)=>xt("nav",{ref:t,"aria-label":"breadcrumb",className:r("",e),...o}));Tr.displayName="Breadcrumb";var Sr=ho.forwardRef(({className:e,...o},t)=>xt("ol",{ref:t,className:r("flex items-center gap-2 break-words text-sm overflow-x-auto snap-mandatory snap-x [&::-webkit-scrollbar]:hidden",e),...o}));Sr.displayName="BreadcrumbList";var Dr=ho.forwardRef(({className:e,...o},t)=>xt("li",{ref:t,className:r("shrink-0 text-gray-900 hover:text-pink-500",e),...o}));Dr.displayName="BreadcrumbItem";var Mr=ho.forwardRef(({asChild:e,className:o,...t},a)=>xt(e?Vm:"a",{ref:a,className:r("transition-colors hover:text-foreground",o),...t}));Mr.displayName="BreadcrumbLink";var Ir=ho.forwardRef(({className:e,...o},t)=>xt("span",{ref:t,role:"link","aria-disabled":"true","aria-current":"page",className:r("text-sm text-gray-500",e),...o}));Ir.displayName="BreadcrumbPage";var Ar=({children:e,className:o,...t})=>xt("li",{role:"presentation","aria-hidden":"true",className:r("text-gray-900",o),...t,children:e??xt(Bm,{className:"w-2 h-2"})});Ar.displayName="BreadcrumbSeparator";var Lr=({className:e,...o})=>Gm("span",{role:"presentation","aria-hidden":"true",className:r("flex h-5 w-5 items-center justify-center",e),...o,children:[xt(Om,{className:"w-4 h-4 text-gray-900"}),xt("span",{className:"sr-only",children:"More"})]});Lr.displayName="BreadcrumbElipssis";import{createContext as Wm,useContext as zr}from"react";import{jsx as Vo}from"react/jsx-runtime";var pi=Wm({align:"center"}),fi=({color:e="pink",size:o="small",isTruncated:t=!1,className:a,children:i})=>{let n={regular:"text-gray-900",pink:"text-pink-500",white:"text-white"},s={small:"text-sm",large:"text-lg"};return Vo("div",{className:r("mb-1 font-semibold",n[e],s[o],t&&"truncate",a),children:i})},ui=({tagHeading:e="h2",size:o="small",color:t="pink",isTruncated:a=!1,className:i,children:n})=>{let s=e,l={regular:"text-gray-900",pink:"text-pink-500",white:"text-white"},m={small:"lg:text-3xl text-2xl",large:"lg:text-4xl md:text-3xl text-2xl"},{align:c}=zr(pi);return Vo(s,{className:r("max-w-4xl font-bold",c==="center"?"mx-auto":c==="right"?"ml-auto":"",l[t],m[o],a&&"truncate",i),children:n})},gi=({color:e="regular",size:o="small",marginTop:t="spacingX",isTruncated:a=!1,className:i,children:n})=>{let s={regular:"text-gray-500",white:"text-white/80"},l={small:"text-base",large:"md:text-lg text-base"},m={none:"",spacingX:"mt-2",spacingM:"mt-3",spacingL:"mt-4",spacingXl:"mt-5",spacing2Xl:"mt-6"},{align:c}=zr(pi);return Vo("div",{className:r(c==="center"?"mx-auto max-w-2xl":c==="right"?"ml-auto max-w-4xl":"max-w-4xl",s[e],l[o],m[t],a&&"truncate",i),children:n})},vi=({className:e,align:o="center",children:t})=>Vo("div",{className:r("mb-5 md:mb-8",{left:"text-left",center:"text-center",right:"text-right"}[o],e),children:Vo(pi.Provider,{value:{align:o},children:t})});import{jsx as Yt,jsxs as $m}from"react/jsx-runtime";var B=({idSection:e,className:o,background:t,children:a})=>Yt("section",{id:e,className:r("block-section py-8 md:py-10 lg:py-14",o),style:{background:t},children:Yt("div",{className:"wrapper relative",children:a})}),x=({align:e="center",tagline:o,title:t,description:a,tagHeading:i="h2",colorScheme:n="pink",sizeHeading:s="small",className:l})=>{let m=n==="black"?"pink":n==="pink"?"regular":"white",c=n==="pink"?"pink":n==="white"?"white":"regular",d=n==="white"?"white":"regular";return!t&&!a&&!o?null:$m(vi,{align:e,className:l,children:[o&&Yt(fi,{color:m,children:o}),t&&Yt(ui,{tagHeading:i,color:c,size:s,children:u(t)}),a&&Yt(gi,{color:d,size:"large",marginTop:s==="large"?"spacing2Xl":"spacingX",children:u(a)})]})},b=({align:e,isFullInMobile:o=!1,buttons:t,className:a})=>t?.length===0?null:Yt("div",{className:r("buttons-block mt-8 flex w-full gap-4 md:mt-10",e==="center"&&"justify-center",e==="right"&&"justify-end",o&&"flex-wrap md:flex-nowrap",a),children:t?.slice(0,2).map((i,n)=>{if(!i)return null;let{btnName:s,...l}=i;return Yt(Ge,{...l,className:r(o&&"w-full md:w-auto",i?.className),children:u(s)},n)})});import rc,{memo as nc}from"react";import{ArrowDownIcon as sc}from"@heroicons/react/20/solid";import{createContext as qm,useCallback as Xm,useContext as hi,useEffect as Ym,useRef as Zm,useState as Km}from"react";import{ChevronLeft as Jm,ChevronRight as ec}from"lucide-react";import*as Er from"react";import{Slot as jm}from"@radix-ui/react-slot";import{cva as Qm}from"class-variance-authority";import{jsx as Um}from"react/jsx-runtime";var Zt=Qm("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-semibold transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed border border-transparent",{variants:{variant:{primary:"bg-pink-500 text-white hover:bg-pink-600 disabled:bg-pink-300",secondary:"bg-white text-gray-900 hover:bg-gray-100 disabled:text-gray-400 disabled:bg-white border-gray-300",outline:"border-pink-500 text-pink-500 bg-white hover:bg-pink-50 disabled:bg-white disabled:border-pink-300 disabled:text-pink-300",tonal:"bg-pink-100 text-pink-500 hover:bg-pink-200 disabled:bg-gray-200 disabled:text-gray-400",danger:"bg-red-500 text-white hover:bg-red-600 disabled:bg-red-300",transparent:"text-gray-900 bg-transparent hover:bg-gray-100 disabled:text-gray-400 disabled:bg-transparent"},size:{default:"text-sm h-10 w-10",sm:"h-8 w-8 text-sm",lg:"h-12 w-12 text-base"}},defaultVariants:{variant:"primary",size:"default"}}),se=Er.forwardRef(({className:e,variant:o="primary",size:t="default",asChild:a=!1,isDisabled:i=!1,...n},s)=>{let l=a?jm:"button",m=r(Zt({variant:o,size:t,className:e}));return Um(l,{className:m,disabled:i,ref:s,...n,children:n.children})});se.displayName="IconButton";import{Fragment as tc,jsx as zt,jsxs as Hr}from"react/jsx-runtime";var ya=qm(void 0),bt=({showGradientOverlay:e=!0,gradientOverlayColor:o="255, 255, 255",className:t,children:a})=>{let i=Zm(null),[n,s]=Km({left:!1,right:!1}),l=Xm(()=>{let c=i.current;if(c){let{scrollLeft:d,scrollWidth:p,clientWidth:g}=c;s({left:d>0,right:Math.ceil(d+g)<p})}},[]);Ym(()=>{let c=i.current;if(c)return l(),window.addEventListener("resize",l),c.addEventListener("scroll",l),()=>{window.removeEventListener("resize",l),c.removeEventListener("scroll",l)}},[l]);let m=c=>{let d=i.current;if(d){let{scrollLeft:p,clientWidth:g,scrollWidth:h}=d,w=g*.7*(c==="left"?-1:1),T=p+w;T<0?T=0:T>h-g&&(T=h-g),d.scrollTo({left:T,behavior:"smooth"})}};return zt(ya.Provider,{value:{scrollContainerRef:i,showArrows:n,scroll:m,gradientOverlayColor:o},children:Hr("div",{className:r("relative w-full",t),children:[e&&Hr(tc,{children:[n.left&&zt("div",{className:"pointer-events-none absolute left-0 top-1/2 z-10 flex h-full w-16 -translate-y-1/2 items-center",style:{background:`linear-gradient( to left, rgba(255, 255, 255, 0),rgb(${o}),rgb(${o}))`}}),n.right&&zt("div",{className:"pointer-events-none absolute right-0 top-1/2 z-10 flex h-full w-16 -translate-y-1/2 items-center",style:{background:`linear-gradient(to right, rgba(255, 255, 255, 0), rgb(${o}),rgb(${o}))`}})]}),a]})})},yt=({className:e,children:o})=>{let t=hi(ya);if(!t)throw new Error("HorizontalContent must be used within a HorizontalScroll");return zt("div",{ref:t.scrollContainerRef,className:r("scrollbar-hide overflow-x-auto scroll-smooth",e),role:"region","aria-label":"Scrollable content",children:o})},wt=({className:e,children:o,...t})=>{let a=hi(ya);if(!a)throw new Error("HorizontalNavigation must be used within a HorizontalScroll");return a.showArrows.left?zt(se,{className:r("pointer-events-auto absolute left-0.5 top-1/2 z-10 h-6 w-6 -translate-y-1/2 rounded-full",e),onClick:()=>a.scroll("left"),"aria-label":"Scroll left",size:t.size||"sm",variant:t.variant||"secondary",...t,children:o||zt(Jm,{className:"h-4 w-4"})}):null},Nt=({className:e,children:o,...t})=>{let a=hi(ya);if(!a)throw new Error("HorizontalNavigation must be used within a HorizontalScroll");return a.showArrows.right?zt(se,{className:r("pointer-events-auto absolute right-0.5 top-1/2 z-10 h-6 w-6 -translate-y-1/2 rounded-full",e),onClick:()=>a.scroll("right"),"aria-label":"Scroll right",size:t.size||"sm",variant:t.variant||"secondary",...t,children:o||zt(ec,{className:"h-4 w-4"})}):null};import*as wa from"react";import*as We from"@radix-ui/react-tabs";import{jsx as xi}from"react/jsx-runtime";var Pt=We.Root,Ze=wa.forwardRef(({className:e,size:o="sm",isDivider:t=!1,...a},i)=>xi(We.List,{ref:i,className:r("inline-flex w-full flex-row items-center space-x-5 overflow-x-auto [&::-webkit-scrollbar]:hidden",`text-${o}`,t&&"border-b border-gray-200",e),...a}));Ze.displayName=We.List.displayName;var Ke=wa.forwardRef(({className:e,...o},t)=>xi(We.Trigger,{ref:t,className:r("ring-offset-background focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap border-b-2 border-transparent py-3 font-semibold text-gray-900 transition-all hover:text-pink-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:border-pink-500 data-[state=active]:text-pink-500",e),...o}));Ke.displayName=We.Trigger.displayName;var Je=wa.forwardRef(({className:e,...o},t)=>xi(We.Content,{ref:t,className:r("ring-offset-background focus-visible:ring-ring mt-3 text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",e),...o}));Je.displayName=We.Content.displayName;import*as _r from"react";import{Slot as oc}from"@radix-ui/react-slot";import{cva as ac}from"class-variance-authority";import{jsx as ic}from"react/jsx-runtime";var Fr=ac("inline-flex items-center justify-center whitespace-nowrap font-semibold transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed border border-transparent flex-nowrap",{variants:{variant:{default:"text-blue-700 hover:underline hover:bg-blue-50 disabled:bg-transparent disabled:text-gray-400 disabled:no-underline",primary:"text-pink-500 hover:underline hover:bg-pink-50 disabled:bg-transparent disabled:text-gray-400 disabled:no-underline",secondary:"text-gray-700 hover:underline hover:text-blue-700 hover:bg-blue-50 disabled:bg-transparent disabled:text-gray-400 disabled:no-underline"},size:{default:"text-sm",lg:"text-base"}},defaultVariants:{variant:"default",size:"default"}}),ie=_r.forwardRef(({className:e,variant:o="default",size:t="default",asChild:a=!1,isDisabled:i=!1,...n},s)=>{let l=a?oc:"button",m=r(Fr({variant:o,size:t,className:e}));return ic(l,{className:m,disabled:i,ref:s,...n,children:n.children})});ie.displayName="TextButton";import{Fragment as Br,jsx as $,jsxs as et}from"react/jsx-runtime";var lc=({blog:e})=>{let o=(t,a)=>{t?.preventDefault(),t?.stopPropagation(),window.open(a,"_blank")};return et(Br,{children:[$("div",{className:"flex-none basis-1/2 pr-3 md:basis-full md:pr-0",children:$("div",{className:"relative block aspect-[16/9] w-full overflow-hidden rounded-md bg-gray-100",children:et("picture",{children:[$("source",{media:"(min-width: 640px)",srcSet:e?.thumbnailDesktop}),$("img",{className:"h-full w-full object-cover",src:e?.thumbnailMobile,alt:e?.title})]})})}),et("div",{className:"basis-1/2 overflow-hidden md:mt-3 md:basis-full",children:[e?.category&&e?.categoryUrl&&$(ie,{variant:"default",className:"shink-0 mb-0.5 line-clamp-1 block justify-start whitespace-normal text-left text-xs md:hidden",onClick:t=>o(t,e?.categoryUrl||""),children:e?.category}),$("div",{className:"line-clamp-3 text-sm font-medium text-gray-900 group-hover:text-pink-500 md:line-clamp-none md:text-base",children:e?.title}),et("div",{className:"mt-2 flex items-center md:space-x-1",children:[e?.category&&e?.categoryUrl&&et(Br,{children:[$(ie,{variant:"default",className:"shink-0 hidden justify-start whitespace-normal text-left text-xs md:line-clamp-1 md:block",onClick:t=>o(t,e?.categoryUrl||""),children:e?.category}),e?.category&&e?.totalViews&&$("span",{className:"hidden flex-none leading-none md:block",children:"\xB7"})]}),e?.totalViews&&$("div",{className:"flex-none text-xs text-gray-500",children:e.totalViews})]})]})]})},Na=nc(({dataHeading:e,dataHorizontalScroll:o,dataBlog:t,onClickModal:a,onClickLoadMore:i})=>{let{showGradientOverlay:n=!0,gradientOverlayColor:s,className:l}=o||{},m=(d,p,g)=>{d?.preventDefault(),d?.stopPropagation(),a?a(p):window.open(g,"_blank")},c=(d,p)=>et("div",{children:[$("div",{className:r("-mx-3 flex flex-row flex-wrap gap-y-5",d?.blogList?.length<3?"md:justify-center":""),children:d?.blogList?.map((g,h)=>$("div",{className:"min-w-0 basis-full px-3 md:basis-1/2 lg:basis-1/3",children:$("div",{onClick:w=>m(w,g?.id,g?.url),className:r("group flex cursor-pointer flex-row md:flex-col",d?.classNameItem),children:$(lc,{blog:g})},g?.id)},h))}),d?.isShowBtn&&$("div",{className:"mt-8 flex w-full items-center justify-center",children:et(Ge,{action:i?()=>i?.(p):d?.btnUrl,newTab:d?.isNewTab,variant:"outline",children:[u(d.btnName||"Xem th\xEAm"),d?.isLoading?$(go,{className:"animate-spin-loading ml-2 h-5 w-5"}):i&&!d?.btnUrl&&$(sc,{className:"-mb-1 ml-2 h-5 w-5 animate-bounce"})]})})]},d?.title||p);return et(rc.Fragment,{children:[e&&$(x,{tagline:e?.tagline,title:e?.title,description:e?.description,tagHeading:e?.tagHeading,align:"center",colorScheme:e?.colorScheme||"pink",sizeHeading:e?.sizeHeading,className:r(e?.className)}),t?.length>1?et(Pt,{defaultValue:t[0]?.title,children:[et(bt,{showGradientOverlay:n,gradientOverlayColor:s,className:l,children:[$(yt,{className:"mb-6 text-center",children:$(Ze,{className:"mx-auto mb-0 inline-flex w-auto items-center overflow-visible",children:t.map((d,p)=>$(Ke,{value:d.title,children:d.title},d.title+p))})}),$(wt,{}),$(Nt,{})]}),t.map((d,p)=>$(Je,{value:d.title,children:c(d,p)},d.title+p))]}):t?.length===1&&t[0]&&c(t[0],0)]})});import fc,{memo as uc,useEffect as gc,useState as Gr}from"react";import{ChevronLeftIcon as vc,ChevronRightIcon as hc}from"@heroicons/react/20/solid";import*as O from"react";import{ChevronLeftIcon as mc,ChevronRightIcon as cc}from"@heroicons/react/20/solid";import dc from"embla-carousel-react";import{Fragment as pc,jsx as Ee,jsxs as Vr}from"react/jsx-runtime";var Or=O.createContext(null);function Go(){let e=O.useContext(Or);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}var ge=O.forwardRef(({orientation:e="horizontal",opts:o,setApi:t,plugins:a,className:i,children:n,...s},l)=>{let[m,c]=dc({align:"start",...o,axis:e==="horizontal"?"x":"y"},a),[d,p]=O.useState(!1),[g,h]=O.useState(!1),w=O.useCallback(W=>{W&&(p(W.canScrollPrev()),h(W.canScrollNext()))},[]),T=O.useCallback(()=>{c?.scrollPrev()},[c]),C=O.useCallback(()=>{c?.scrollNext()},[c]),z=O.useCallback(W=>{W.key==="ArrowLeft"?(W.preventDefault(),T()):W.key==="ArrowRight"&&(W.preventDefault(),C())},[T,C]);return O.useEffect(()=>{!c||!t||t(c)},[c,t]),O.useEffect(()=>{if(c)return w(c),c.on("reInit",w),c.on("select",w),()=>{c?.off("select",w)}},[c,w]),Ee(Or.Provider,{value:{carouselRef:m,api:c,opts:o,orientation:e||(o?.axis==="y"?"vertical":"horizontal"),scrollPrev:T,scrollNext:C,canScrollPrev:d,canScrollNext:g},children:Ee("div",{ref:l,onKeyDownCapture:z,className:r("relative",i),role:"region","aria-roledescription":"carousel",...s,children:n})})});ge.displayName="Carousel";var ve=O.forwardRef(({className:e,classNameContent:o,...t},a)=>{let{carouselRef:i,orientation:n}=Go();return Ee("div",{ref:i,className:r("overflow-hidden",o),children:Ee("div",{ref:a,className:r("flex",n==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})});ve.displayName="CarouselContent";var de=O.forwardRef(({className:e,...o},t)=>{let{orientation:a}=Go();return Ee("div",{ref:t,role:"group","aria-roledescription":"slide",className:r("min-w-0 shrink-0 grow-0 basis-full",a==="horizontal"?"pl-4":"pt-4",e),...o})});de.displayName="CarouselItem";var xo=O.forwardRef(({className:e,variant:o="secondary",size:t="default",...a},i)=>{let{orientation:n,scrollPrev:s,canScrollPrev:l}=Go();return Vr(se,{ref:i,variant:o,size:t,className:r("absolute h-8 w-8 rounded-full",n==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:s,...a,children:[Ee(mc,{className:"h-6 w-6"}),Ee("span",{className:"sr-only",children:"Previous slide"})]})});xo.displayName="CarouselPrevious";var bo=O.forwardRef(({className:e,variant:o="secondary",size:t="default",...a},i)=>{let{orientation:n,scrollNext:s,canScrollNext:l}=Go();return Vr(se,{ref:i,variant:o,size:t,className:r("absolute h-8 w-8 rounded-full",n==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:s,...a,children:[Ee(cc,{className:"h-6 w-6"}),Ee("span",{className:"sr-only",children:"Next slide"})]})});bo.displayName="CarouselNext";var yo=O.forwardRef((e,o)=>{let{api:t}=Go(),[,a]=O.useState(!1),i=O.useCallback(()=>a(l=>!l),[]);O.useEffect(()=>{if(t)return t.on("select",i),t.on("reInit",i),()=>{t.off("select",i),t.off("reInit",i)}},[t,i]);let n=t?.scrollSnapList().length||0,s=t?.selectedScrollSnap()||0;return n>1?Ee("div",{ref:o,className:` flex justify-center ${e.className}`,children:Array.from({length:n},(l,m)=>Ee(se,{className:`navigation-item mx-1 h-1.5 w-1.5 rounded-full p-0 ${m===s?"navigation-item-active scale-125 transform bg-gray-500 hover:bg-gray-500/90":"bg-gray-200 hover:bg-gray-100"}`,"aria-label":`Go to slide ${m+1}`,onClick:()=>t?.scrollTo(m)},m))}):Ee(pc,{})});yo.displayName="CarouselDots";import{Fragment as Pa,jsx as j,jsxs as $e}from"react/jsx-runtime";var xc=({blog:e})=>{let o=(t,a)=>{t?.preventDefault(),t?.stopPropagation(),window.open(a,"_blank")};return $e(Pa,{children:[j("div",{className:"relative block aspect-[16/9] w-full overflow-hidden rounded-md bg-gray-100",children:j("img",{className:"inset-0 h-full w-full object-cover",src:e?.thumbnailDesktop,alt:e?.title})}),$e("div",{className:"mt-4 md:pr-3",children:[j("div",{className:"font-semibold text-gray-900 group-hover:text-pink-500 md:text-lg md:leading-tight",children:e?.title}),e?.description&&j("div",{className:"mt-2 line-clamp-2 text-sm text-gray-500 md:text-sm",children:u(e?.description??"")}),$e("div",{className:"mt-2 flex items-center space-x-1",children:[e?.category&&e?.categoryUrl&&$e(Pa,{children:[j(ie,{variant:"default",className:"shink-0 justify-start whitespace-normal text-left text-sm md:line-clamp-1",onClick:t=>o(t,e?.categoryUrl||""),children:e?.category}),e?.category&&e?.totalViews&&j("span",{className:"flex-none leading-none text-gray-300",children:"\xB7"})]}),e?.totalViews&&j("div",{className:"flex-none text-sm text-gray-500",children:e.totalViews})]})]})]})},bc=({dataBlog:e,setCarouselRef:o,carouselRef:t,setCurrent:a,handleOnClickItem:i})=>{let{blogList:n=[],isShowBtn:s,btnName:l,btnUrl:m="#",isNewTab:c,classNameItem:d}=e??{};return gc(()=>{!t||!a||(a(t.selectedScrollSnap()+1),t.on("select",()=>{a&&a(t.selectedScrollSnap()+1)}))},[t,a]),$e(Pa,{children:[j(ge,{opts:{dragFree:!1},setApi:o,className:"w-full",children:j(ve,{classNameContent:"!overflow-visible",className:"-ml-5",children:n?.map(p=>j(de,{className:"basis-11/12 pl-5 md:basis-1/2 lg:basis-4/12",children:j("div",{onClick:g=>i(g,p?.id,p?.url),className:r("group cursor-pointer",d),children:j(xc,{blog:p})},p?.id)},p?.id))})}),s&&j("div",{className:"mt-8 flex w-full items-center justify-center md:mt-10",children:$e(Ge,{action:m&&m,newTab:c,variant:"outline",children:[u(l||"Xem th\xEAm")," "]})})]})},yc=({carouselRef:e})=>$e(se,{onClick:()=>e?.scrollPrev(),disabled:!e?.canScrollPrev(),style:{borderRadius:"100%"},size:"sm",variant:"secondary",children:[j(vc,{className:"h-6 w-6"}),j("span",{className:"sr-only",children:"Previous slide"})]}),wc=({carouselRef:e})=>$e(se,{onClick:()=>e?.scrollNext(),disabled:!e?.canScrollNext(),style:{borderRadius:"100%"},size:"sm",variant:"secondary",children:[j(hc,{className:"h-6 w-6"}),j("span",{className:"sr-only",children:"Next slide"})]}),bi=uc(({dataHeading:e,dataBlog:o,onClickModal:t,onClickLoadMore:a})=>{let i=(c,d,p)=>{c?.preventDefault(),c?.stopPropagation(),t?t(d):window.open(p,"_blank")},[n,s]=Gr(null),[,l]=Gr(0),m=()=>n?$e("div",{className:"ml-3 hidden items-center space-x-2 md:flex",children:[j(yc,{carouselRef:n}),j(wc,{carouselRef:n})]}):j(Pa,{});return $e(fc.Fragment,{children:[$e("div",{className:"flex items-center justify-between",children:[e&&j(x,{tagline:e?.tagline,title:e?.title,description:e?.description,tagHeading:e?.tagHeading,align:"left",colorScheme:e?.colorScheme||"pink",sizeHeading:e?.sizeHeading,className:r(e?.className)}),j(m,{})]}),j(bc,{dataBlog:o?.[0],onClickLoadMore:a,index:0,setCarouselRef:s,carouselRef:n,setCurrent:l,handleOnClickItem:i})]})});import{Fragment as kc,jsx as wo}from"react/jsx-runtime";var Nc=({template:e,dataBlog:o,dataHeading:t,dataHorizontalScroll:a,onClickModal:i,onClickLoadMore:n})=>{switch(e){case 1:return wo(Na,{dataBlog:o,dataHeading:t,dataHorizontalScroll:a,onClickModal:i,onClickLoadMore:n});case 2:return wo(bi,{dataBlog:o,dataHeading:t,dataHorizontalScroll:a,onClickModal:i,onClickLoadMore:n});default:return wo(Na,{dataBlog:o,dataHeading:t,dataHorizontalScroll:a,onClickModal:i,onClickLoadMore:n})}},Pc=({dataHeading:e,dataHorizontalScroll:o,dataBlog:t,template:a,onClickModal:i,onClickLoadMore:n})=>wo(kc,{children:Nc({dataHeading:e,dataHorizontalScroll:o,dataBlog:t,template:a,onClickModal:i,onClickLoadMore:n})}),Cc=({dataHeading:e,dataHorizontalScroll:o,dataBlog:t=[],idSection:a,className:i,background:n,template:s=1,onClickModal:l,onClickLoadMore:m})=>wo(B,{className:r("overflow-hidden",i),idSection:a,background:n,children:wo(Pc,{dataHeading:e,dataHorizontalScroll:o,dataBlog:t,template:s,onClickModal:l,onClickLoadMore:m})});import*as ka from"react";import{enUS as Dc,vi as Mc}from"date-fns/locale";import{ChevronLeft as Ic,ChevronRight as Ac}from"lucide-react";import Lc from"lunisolar";import{DayPicker as zc}from"react-day-picker";import*as Wr from"react";import*as Wo from"@radix-ui/react-checkbox";import{CheckIcon as Rc}from"@heroicons/react/16/solid";import{cva as $r}from"class-variance-authority";import{jsx as yi}from"react/jsx-runtime";var Tc=$r("peer shrink-0 rounded border-2 disabled:bg-gray-300 border-gray-300 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-default disabled:bg-gray-100 data-[state=checked]:border-none disabled:data-[state=checked]:bg-gray-400 disabled:data-[state=checked]:text-gray-100 data-[state=checked]:bg-pink-500 data-[state=checked]:text-white",{variants:{size:{medium:"h-4 w-4",large:"w-5 h-5"}},defaultVariants:{size:"medium"}}),Sc=$r("",{variants:{size:{medium:"h-4 w-4",large:"w-5 h-5"}},defaultVariants:{size:"medium"}}),Ca=Wr.forwardRef(({className:e,size:o,...t},a)=>yi(Wo.Root,{ref:a,className:r(Tc({size:o}),e),...t,children:yi(Wo.Indicator,{className:r("flex items-center justify-center text-current"),children:yi(Rc,{className:r(Sc({size:o}))})})}));Ca.displayName=Wo.Root.displayName;import{Fragment as Bc,jsx as tt,jsxs as wi}from"react/jsx-runtime";var Ec=({date:e,cusContent:o})=>{let t=null;return t=Lc(e).lunar,wi(Bc,{children:[o?o(e):e.getDate(),t&&tt("span",{className:"luna-date absolute right-0.5 top-1 hidden text-[8px] leading-none group-[.show-luna]:block",children:t.day})]})},Hc={formatCaption:e=>`Th\xE1ng ${e.getMonth()+1}/${e.getFullYear()}`,formatWeekdayName:e=>{let o=e.getDay();return["CN","T2","T3","T4","T5","T6","T7"][o]}};function _c({isShow:e,setIsShow:o,lang:t}){let a=ka.useId();return tt("div",{className:"w-full p-3 pt-0",children:wi("div",{className:"flex cursor-pointer items-center space-x-2 border-t border-gray-100 pt-3",children:[tt(Ca,{checked:e,id:`check-show-luna-${a}`,onCheckedChange:i=>{typeof i=="boolean"&&o(i)}}),tt("label",{htmlFor:`check-show-luna-${a}`,className:"z-[1] cursor-pointer text-sm leading-none text-gray-900 peer-disabled:cursor-default peer-disabled:text-gray-400",children:t==="vi"?"Hi\u1EC7n ng\xE0y \xE2m l\u1ECBch":"Show lunar date"})]})})}var Fc=e=>e.getDay()===0||e.getDay()===6;function Ra({className:e,classNames:o,showOutsideDays:t=!1,enableLunaDate:a=!1,lang:i="vi",cusContentDay:n,...s}){let[l,m]=ka.useState(!0);return tt(zc,{locale:i==="vi"?Mc:Dc,showOutsideDays:t,className:r("b w-fit rounded-b-md border border-gray-200 bg-white shadow-md",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-y-0",month:"p-3 pt-0 w-full",caption:"flex justify-center p-3 bg-blue-50 relative items-center -mx-3 mb-3",caption_label:"text-sm font-medium text-gray-900",nav:"space-x-1 flex items-center",nav_button:r(Ye({variant:"transparent"}),"h-7 w-7 p-0 text-gray-900 hover:bg-transparent hover:opacity-70"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse",head_row:"flex space-x-0.5",head_cell:r("w-11 rounded-md text-xs font-medium text-gray-500 [&:nth-child(7)]:!text-red-600",i==="vi"?"[&:nth-child(6)]:!text-red-600":"[&:nth-child(1)]:!text-red-600"),row:"flex w-full mt-0.5 space-x-0.5",cell:"h-11 w-11 text-center text-sm p-0 relative border-none",day:r(Ye({variant:"transparent"}),"group relative h-11 w-11 p-0 text-center text-sm font-semibold focus-within:relative focus-within:z-20 aria-selected:opacity-100 [&.day-range-end.day-range-start]:rounded-md aria-selected:[&:not(.day-range-middle)]:bg-pink-500 aria-selected:[&:not(.day-range-middle)]:text-white",a&&l&&"show-luna"),day_range_end:"day-range-end [&.day-range-end]:rounded-l-none",day_range_start:"day-range-start [&.day-range-start]:rounded-r-none",day_today:"day-today [&:not([aria-selected])]:text-pink-500 [&:not([aria-selected])]:border-gray-200",day_outside:"day-outside opacity-50 aria-selected:bg-accent/50 aria-selected:opacity-30",day_disabled:"opacity-50",day_range_middle:r("group/mid day-range-middle !rounded-none !bg-pink-50 text-gray-900 [&:nth-child(7)]:!text-red-600",i==="vi"?"[&:nth-child(6)]:!text-red-600":"[&:nth-child(1)]:!text-red-600"),day_hidden:"invisible",...o},modifiers:{weekend:Fc},modifiersClassNames:{weekend:"text-red-600"},components:{IconLeft:()=>tt(Ic,{className:"h-6 w-6"}),IconRight:()=>tt(Ac,{className:"h-6 w-6"}),DayContent:c=>tt(Ec,{date:c.date,cusContent:n}),Months:({children:c})=>wi("div",{className:"w-full",children:[tt("div",{className:r("months-wrapper flex flex-col sm:flex-row"),children:c}),a&&tt(_c,{isShow:l,setIsShow:m,lang:i})]})},formatters:i==="vi"?Hc:{},...s})}Ra.displayName="Calendar";import{QuestionMarkCircleIcon as Oc,XCircleIcon as Vc}from"@heroicons/react/16/solid";import{format as Ta}from"date-fns";import{Calendar as Gc}from"lucide-react";import*as Qr from"react";import*as Ct from"@radix-ui/react-popover";import{jsx as jr}from"react/jsx-runtime";var $o=Ct.Root,jo=Ct.Trigger,No=Qr.forwardRef(({className:e,align:o="center",sideOffset:t=4,...a},i)=>jr(Ct.Portal,{children:jr(Ct.Content,{ref:i,align:o,sideOffset:t,className:r("z-50 w-72 rounded-md border border-gray-200 bg-white p-4 sm:p-5 text-gray-900 shadow-small outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));No.displayName=Ct.Content.displayName;import{Fragment as Ur,jsx as Te,jsxs as Qo}from"react/jsx-runtime";var Wc=({label:e,placeholder:o="Select a value",size:t=1,message:a,isError:i,disabled:n,dateFormat:s="dd/MM/yyyy",buttonProps:l,popoverProps:m,calendarProps:c,popoverContentProps:d})=>{let p=c?.selected||null;return Qo("div",{children:[Qo($o,{...m,children:[Te(jo,{asChild:!0,children:Qo(we,{variant:"secondary",className:r("relative h-11 w-full justify-between overflow-visible text-left text-sm font-normal text-gray-900 ring-inset hover:ring-1 hover:ring-gray-400 focus:ring-1 focus:ring-gray-400 disabled:pointer-events-none disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 [&[data-state=open]]:border-pink-500 [&[data-state=open]]:ring-1 [&[data-state=open]]:ring-pink-500",t===2&&"h-12 text-base",(!p||!(p instanceof Date)&&typeof p=="object"&&(!("from"in p)||!p.from))&&"text-gray-500",i&&"border-red-500 ring-1 ring-red-500"),disabled:n,...l,children:[Te("div",{className:"line-clamp-1 flex-1",children:p instanceof Date?Ta(p,s):p&&typeof p=="object"&&"from"in p&&"to"in p?Te(Ur,{children:p.from?p.to?Qo(Ur,{children:[Te("span",{className:"date-from",children:Ta(p.from,s)})," ",Te("span",{className:"date-separator",children:"-"}),Te("span",{className:"date-to",children:Ta(p.to,s)})]}):Ta(p.from,s):o}):o}),e&&Te("span",{className:r("absolute -top-2 left-2 z-[1] bg-white px-1.5 text-xs text-gray-500",t===2&&" -top-2.5 text-sm",i&&"text-red-500"),children:e}),Te(Gc,{className:"ml-2 h-4 w-4 flex-none text-gray-500"})]})}),Te(No,{className:"w-auto border-none !p-0",...d,children:Te(Ra,{...c,defaultMonth:p&&typeof p=="object"&&"from"in p?p.from:p instanceof Date?p:void 0})})]}),a&&Qo("div",{className:"mobase-text-input-message mt-0.5 flex items-center space-x-1",children:[i?Te(Vc,{width:16,height:16,className:"text-red-500"}):Te(Oc,{width:16,height:16,className:"text-gray-500"}),Te("span",{className:r(i?"text-red-500":"text-gray-500",t===2?"text-sm":"text-xs"),children:a})]})]})};import{useEffect as qc,useState as en}from"react";import{QuestionMarkCircleIcon as Xc,XCircleIcon as Yc}from"@heroicons/react/16/solid";import{isValid as Zc}from"date-fns";import*as ot from"react";import{CheckIcon as $c,ChevronDownIcon as qr,ChevronUpIcon as jc,XCircleIcon as Qc}from"@heroicons/react/16/solid";import{QuestionMarkCircleIcon as Uc}from"@heroicons/react/24/outline";import*as D from"@radix-ui/react-select";import{jsx as Q,jsxs as Uo}from"react/jsx-runtime";var qo=ot.forwardRef(({className:e,children:o,label:t,message:a,size:i,isError:n,disabled:s,...l},m)=>Uo("div",{ref:m,className:r("select-mobase relative",e,s?"disabled":"",n?"[&>.select-mobase-button]:border-red-500 [&>.select-mobase-button]:ring-1 [&>.select-mobase-button]:ring-red-500":"",i===2?"[&>.select-mobase-button]:h-12 [&>.select-mobase-button]:text-base":""),children:[t&&Q("span",{className:r("mobase-select-label absolute -top-2 left-2 z-[1] bg-white px-1.5 text-xs text-gray-500",i===2&&"-top-2.5 text-sm",n&&"text-red-500"),children:t}),Q(D.Root,{disabled:s,...l,children:o}),a&&Uo("div",{className:r("mobase-select-message mt-1 flex items-center space-x-1 text-gray-500",n&&"text-red-500"),children:[n?Q(Qc,{width:16,height:16}):Q(Uc,{width:16,height:16}),Q("span",{className:r(i===2?"text-sm":"text-xs"),children:a})]})]})),Xo=D.Value,Po=ot.forwardRef(({className:e,children:o,...t},a)=>Uo(D.Trigger,{ref:a,className:r("select-mobase-button flex h-11 w-full items-center justify-between rounded-md border border-gray-300 bg-white p-3 text-sm text-gray-900 ring-0 ring-inset transition-all hover:ring-1 hover:ring-gray-400 focus-visible:border-pink-500 focus-visible:ring-1 focus-visible:!ring-pink-500 focus-visible:ring-offset-0 focus-visible:ring-offset-transparent disabled:pointer-events-none disabled:border-gray-200 disabled:bg-gray-50 data-[state=open]:border-pink-500 data-[placeholder]:text-gray-500 data-[state=open]:ring-1 data-[state=open]:ring-pink-500",e),...t,children:[Q("div",{className:"line-clamp-1 text-left",children:o}),Q(D.Icon,{asChild:!0,children:Q(qr,{className:"h-4 w-4 flex-none text-gray-500"})})]}));Po.displayName=D.Trigger.displayName;var Ni=ot.forwardRef(({className:e,...o},t)=>Q(D.ScrollUpButton,{ref:t,className:r("flex cursor-default items-center justify-center py-1",e),...o,children:Q(jc,{className:"h-5 w-5"})}));Ni.displayName=D.ScrollUpButton.displayName;var Pi=ot.forwardRef(({className:e,...o},t)=>Q(D.ScrollDownButton,{ref:t,className:r("flex cursor-default items-center justify-center bg-gradient-to-t from-white to-transparent py-1",e),...o,children:Q(qr,{className:"h-5 w-5"})}));Pi.displayName=D.ScrollDownButton.displayName;var Co=ot.forwardRef(({className:e,children:o,position:t="popper",...a},i)=>Q(D.Portal,{children:Uo(D.Content,{ref:i,className:r("shadow-small data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-gray-300 bg-white text-gray-900",t==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:t,...a,children:[Q(Ni,{}),Q(D.Viewport,{className:r("p-0",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:o}),Q(Pi,{})]})}));Co.displayName=D.Content.displayName;var Yo=ot.forwardRef(({className:e,children:o,...t},a)=>Q(D.Group,{ref:a,className:r("relative border-b border-gray-200 p-1 after:w-full last:border-0",e),...t,children:o})),Xr=ot.forwardRef(({className:e,...o},t)=>Q(D.Label,{ref:t,className:r("z-[1] py-1.5 pl-7 pr-2 text-sm font-semibold",e),...o}));Xr.displayName=D.Label.displayName;var Et=ot.forwardRef(({className:e,children:o,...t},a)=>Uo(D.Item,{ref:a,className:r("relative flex w-full cursor-default select-none items-center rounded-md py-1.5 pl-7 pr-2 text-sm outline-none focus:bg-gray-100 focus:text-gray-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t,children:[Q("span",{className:"absolute left-2 flex h-4 w-4 items-center justify-center",children:Q(D.ItemIndicator,{children:Q($c,{className:"h-4 w-4 text-pink-500"})})}),Q(D.ItemText,{children:o})]})),Yr=ot.forwardRef(({className:e,...o},t)=>Q(D.Separator,{ref:t,className:r("-mx-1 my-1 h-px",e),...o}));Yr.displayName=D.Separator.displayName;var Zr=["Th\xE1ng 01","Th\xE1ng 02","Th\xE1ng 03","Th\xE1ng 04","Th\xE1ng 05","Th\xE1ng 06","Th\xE1ng 07","Th\xE1ng 08","Th\xE1ng 09","Th\xE1ng 10","Th\xE1ng 11","Th\xE1ng 12"],Kr=["January","February","March","April","May","June","July","August","September","October","November","December"],Ci=(e,o,t,a)=>{let i=new Date(e,o,0).getDate(),n=t&&e===t.getFullYear()&&o===t.getMonth()+1?t.getDate():1,s=a&&e===a.getFullYear()&&o===a.getMonth()+1?a.getDate():i;return{daysInMonth:i,startDay:n,endDay:s}},Jr=(e,o,t,a)=>{let i=t?t.getFullYear():e,n=a?a.getFullYear():o;return Array.from({length:n-i+1},(s,l)=>n-l)};import{jsx as te,jsxs as at}from"react/jsx-runtime";var Kc=({label:e,selected:o,onSelect:t,size:a=1,message:i,isError:n,disabled:s,dateFormat:l="dd/MM/yyyy",lang:m="vi",fromYear:c=1900,toYear:d=new Date().getFullYear(),disableUnselect:p=!1})=>{let[g,h]=en(o??null),w=Math.min(c,d),T=Math.max(c,d),C=l==="MM/yyyy",z=(k,ne)=>{if(ne===0){h(void 0),t?.(void 0);return}let U=g?.getFullYear()||new Date().getFullYear(),ha=g?.getMonth()??0,qt=g?.getDate()??1;k==="month"&&ne!==null&&(ha=ne-1),k==="year"&&ne!==null&&(U=ne),C?qt=1:k==="day"&&ne!==null&&(qt=ne);let yr=Ci(U,ha+1).daysInMonth;qt>yr&&(qt=1);let Ho=new Date(U,ha,qt);Zc(Ho)&&(h(Ho),t?.(Ho))},[W,_]=en(!1),Ut=k=>{_(k)};return qc(()=>{h(o??null)},[o]),at("div",{className:r("relative",s&&"cursor-no-drop"),children:[at("div",{className:r("relative block h-11 w-full rounded-md border border-gray-300 bg-white px-1 py-3 text-sm text-gray-900 outline-none ring-inset transition-all placeholder:text-gray-500 hover:ring-1 hover:ring-gray-400 focus:border-pink-500 focus:ring-1 focus:ring-gray-400 disabled:pointer-events-none disabled:border-gray-200 disabled:bg-gray-50",W&&"border-pink-500 ring-1 ring-pink-500",a===2&&"h-12 text-base",g?"":"text-gray-500",n&&"border-red-500 ring-1 ring-red-500",s&&"pointer-events-none select-none border-gray-200 bg-gray-50"),children:[e&&te("span",{className:r("absolute -top-2 left-2 z-[1] bg-white px-1.5 text-xs text-gray-500",a===2&&" -top-2.5 text-sm",n&&"text-red-500"),children:e}),at("div",{className:"flex h-full flex-row divide-x",children:[!C&&at(qo,{value:g?g.getDate().toString().padStart(2,"0"):"",onValueChange:k=>z("day",parseInt(k,10)),onOpenChange:Ut,className:"w-[30%]",children:[te(Po,{className:"h-full w-full rounded-none border-none bg-transparent py-0 !ring-0 hover:!text-pink-500",children:te(Xo,{placeholder:m==="vi"?"Ng\xE0y":"Day"})}),te(Co,{onCloseAutoFocus:k=>k.preventDefault(),children:at(Yo,{children:[!p&&te(Et,{value:"0",className:"text-gray-600",children:m==="vi"?"B\u1ECF ch\u1ECDn":"None"}),Array.from({length:Ci(g?.getFullYear()||new Date().getFullYear(),(g?.getMonth()??0)+1).daysInMonth},(k,ne)=>(ne+1).toString().padStart(2,"0")).map(k=>te(Et,{value:k,children:k},k))]})})]}),at(qo,{value:g?(g.getMonth()+1).toString():"",onValueChange:k=>z("month",parseInt(k,10)),onOpenChange:Ut,className:r(C?"w-1/2":"w-2/5"),children:[te(Po,{className:"h-full w-full !rounded-none border-none bg-transparent py-0 !ring-0 hover:!text-pink-500",children:te(Xo,{placeholder:m==="vi"?"Th\xE1ng":"Month"})}),te(Co,{onCloseAutoFocus:k=>k.preventDefault(),children:at(Yo,{children:[!p&&te(Et,{value:"0",className:"text-gray-600",children:m==="vi"?"B\u1ECF ch\u1ECDn":"None"}),Array.from({length:12},(k,ne)=>ne+1).map(k=>te(Et,{value:k.toString(),children:m==="vi"?Zr[k-1]:Kr[k-1]},k))]})})]}),at(qo,{value:g?g.getFullYear().toString():"",onValueChange:k=>z("year",parseInt(k,10)),onOpenChange:Ut,className:r(C?"w-1/2":"w-[30%]"),children:[te(Po,{className:"h-full w-full !rounded-none border-none bg-transparent py-0 !ring-0 hover:!text-pink-500",children:te(Xo,{placeholder:m==="vi"?"N\u0103m":"Year"})}),te(Co,{onCloseAutoFocus:k=>k.preventDefault(),children:at(Yo,{children:[!p&&te(Et,{value:"0",className:"text-gray-600",children:m==="vi"?"B\u1ECF ch\u1ECDn":"None"}),Jr(w,T).map(k=>te(Et,{value:k.toString(),children:k},k))]})})]})]})]}),i&&at("div",{className:"mobase-text-input-message mt-0.5 flex items-center space-x-1",children:[n?te(Yc,{width:16,height:16,className:"text-red-500"}):te(Xc,{width:16,height:16,className:"text-gray-500"}),te("span",{className:r(n?"text-red-500":"text-gray-500",a===2?"text-sm":"text-xs"),children:i})]})]})};import*as Kt from"react";import*as V from"@radix-ui/react-alert-dialog";import{jsx as kt,jsxs as td}from"react/jsx-runtime";var Jc=V.Root,ed=V.Trigger,tn=V.Portal,ki=Kt.forwardRef(({className:e,...o},t)=>kt(V.Overlay,{className:r("fixed inset-0 z-50 bg-black/70 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...o,ref:t}));ki.displayName=V.Overlay.displayName;var on=Kt.forwardRef(({className:e,...o},t)=>td(tn,{children:[kt(ki,{}),kt(V.Content,{ref:t,className:r("fixed left-[50%] w-[90vw] bg-white text-gray-700 border border-gray-300 top-[50%] z-50 grid w- max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-xl",e),...o})]}));on.displayName=V.Content.displayName;var an=({className:e,...o})=>kt("div",{className:r("flex flex-col space-y-2 text-left",e),...o});an.displayName="AlertDialogHeader";var rn=({className:e,...o})=>kt("div",{className:r("flex flex-row justify-end space-x-4",e),...o});rn.displayName="AlertDialogFooter";var nn=Kt.forwardRef(({className:e,...o},t)=>kt(V.Title,{ref:t,className:r("text-lg text-gray-900 font-semibold",e),...o}));nn.displayName=V.Title.displayName;var sn=Kt.forwardRef(({className:e,...o},t)=>kt(V.Description,{ref:t,className:r("text-sm text-muted-foreground",e),...o}));sn.displayName=V.Description.displayName;var ln=Kt.forwardRef(({className:e,...o},t)=>kt(V.Action,{ref:t,className:r(Ye({variant:"primary"}),"",e),...o}));ln.displayName=V.Action.displayName;var mn=Kt.forwardRef(({className:e,...o},t)=>kt(V.Cancel,{ref:t,className:r(Ye({variant:"secondary"}),e),...o}));mn.displayName=V.Cancel.displayName;import{memo as cd,useState as dd}from"react";import{useEffect as od,useState as dn}from"react";import{motion as ad}from"motion/react";import*as cn from"@radix-ui/react-aspect-ratio";var H=cn.Root;import{Fragment as pn,jsx as oe,jsxs as Zo}from"react/jsx-runtime";var id=({guideGroup:e,mockup:o})=>{let[t,a]=dn(),[i,n]=dn(0),s={open:{height:"auto",opacity:1,transition:{duration:.3,ease:"easeInOut"}},closed:{height:0,opacity:0,transition:{duration:.3,ease:"easeInOut"}}};return od(()=>{t&&(n(t.selectedScrollSnap()+1),t.on("select",()=>{n(t.selectedScrollSnap()+1)}))},[t]),oe(pn,{children:e?.stepList&&e?.stepList?.length>0&&Zo("div",{className:"mx-auto flex max-w-3xl flex-nowrap justify-center",children:[oe("div",{className:"h-auto w-64 flex-none",children:Zo("div",{className:r("relative mx-auto w-full",o==="none"?"":"rounded-[2.5rem] border-8 border-gray-800 bg-gray-800 shadow-md",o==="small"?"px-1 py-5":""),children:[o!=="none"&&Zo(pn,{children:[oe("div",{className:"absolute -start-2.5 top-16 h-8 w-1.5 rounded-s-lg bg-gray-800"}),oe("div",{className:"absolute -start-2.5 top-32 h-12 w-1.5 rounded-s-lg bg-gray-800"}),oe("div",{className:"absolute -start-2.5 top-48 h-12 w-1.5 rounded-s-lg bg-gray-800"}),oe("div",{className:"absolute -end-2.5 top-40 h-16 w-1 rounded-e-lg bg-gray-800"})]}),oe("div",{className:r("relative h-full w-full overflow-hidden",o==="none"?"":"rounded-[2rem] bg-gray-200",o==="small"?"rounded-xl":""),children:Zo(ge,{setApi:a,children:[oe(ve,{className:"ml-0",children:e?.stepList.map((l,m)=>oe(de,{className:"pl-0",children:oe(H,{ratio:o==="small"?540/960:540/1168,children:l?.image&&oe("img",{src:l.image,className:"size-full object-contain",alt:l.title,"data-puck-editable":"true","data-puck-component":"GuideSection","data-puck-field":"dataGuide","data-puck-array-index":"0","data-puck-array-field":"stepList","data-puck-array-index-nested":m?.toString()??"","data-puck-nested-field":"image"})})},m))}),oe(xo,{className:"left-1 border-none bg-gray-900/30 text-white hover:bg-gray-900/40 disabled:hidden"}),oe(bo,{className:"right-1 border-none bg-gray-900/30 text-white hover:bg-gray-900/40 disabled:hidden"})]})})]})}),oe("div",{className:"flex flex-auto pl-12 pt-4",children:oe("ul",{className:"flex flex-col",children:e?.stepList.map((l,m)=>Zo("li",{className:r("relative min-h-20 pb-8 pl-14 after:absolute after:left-4 after:top-0 after:h-full after:border-l after:border-dashed after:border-gray-200 last:min-h-0 last:pb-0 last:after:hidden",m+1===i?"":"cursor-pointer"),onClick:()=>t&&t.scrollTo(m),children:[oe("div",{className:r("absolute -top-1.5 left-0 z-10 flex h-8 w-8 items-center justify-center rounded-full text-sm font-bold",m+1===i?"bg-pink-500 text-white":"bg-pink-100 text-pink-500"),children:m+1}),oe("div",{className:r("text-sm font-medium",m+1===i?"text-pink-500":"text-gray-900"),children:u(l.title)}),l.content&&oe(ad.div,{initial:"closed",animate:m+1===i?"open":"closed",variants:s,style:{overflow:"hidden"},children:oe("div",{className:"mt-3 text-sm text-gray-700",children:u(l.content)})})]},m))})})]})})},Ri=id;import{useEffect as rd,useRef as nd,useState as Sa}from"react";import{ChevronRightIcon as fn}from"@heroicons/react/20/solid";import sd from"embla-carousel-autoplay";import{Fragment as Ti,jsx as N,jsxs as Pe}from"react/jsx-runtime";var ld=({open:e,setOpenDialog:o,dataStep:t,mockup:a})=>{let[i,n]=Sa(0),[s,l]=Sa();return rd(()=>{s&&(n(s.selectedScrollSnap()+1),s.on("select",()=>{n(s.selectedScrollSnap()+1)}))},[s]),!t||!t?.stepList?.length?null:N(Re,{open:e,onOpenChange:o,children:Pe(Ne,{position:"bottom",height:"full",children:[N(At,{children:N(Lt,{className:"line-clamp-1",children:t?.title})}),Pe(ze,{className:"grid overflow-hidden p-0",children:[N(ge,{setApi:l,className:"grid overflow-hidden",children:N(ve,{className:"ml-0 h-full",children:t.stepList.map((m,c)=>N(de,{className:"h-full w-full pl-0",children:Pe("div",{className:"flex h-full flex-col overflow-y-auto",children:[N("div",{className:"relative flex w-full flex-none justify-center bg-gray-100 p-5",children:N("div",{className:r("mx-auto",a==="small"?"w-56":"w-52"),children:Pe("div",{className:r("relative mx-auto w-full",a==="none"?"":"rounded-[2rem] border-8 border-gray-800 bg-gray-800 shadow-md",a==="small"?"px-0.5 py-3":""),children:[a!=="none"&&Pe(Ti,{children:[N("div",{className:"absolute -start-2.5 top-16 h-8 w-1.5 rounded-s-lg bg-gray-800"}),N("div",{className:"absolute -start-2.5 top-32 h-12 w-1.5 rounded-s-lg bg-gray-800"}),N("div",{className:"absolute -start-2.5 top-48 h-12 w-1.5 rounded-s-lg bg-gray-800"}),N("div",{className:"absolute -end-2.5 top-40 h-16 w-1 rounded-e-lg bg-gray-800"})]}),N("div",{className:r("relative h-full w-full overflow-hidden",a==="none"?"":"rounded-[1.5rem] bg-gray-200",a==="small"?"rounded-xl":""),children:N(H,{ratio:a==="small"?540/960:540/1168,children:m?.image&&N("img",{src:m.image,className:"size-full object-contain",alt:m.title})})})]})})}),Pe("div",{className:"p-5 pb-12",children:[N("div",{className:"font-semibold",children:u(m.title)}),m?.content&&N("div",{className:"mt-3 text-sm text-gray-800",children:u(m.content)})]})]})},c))})}),N("div",{className:"text-muted-foreground fixed bottom-3 left-1/2 flex -translate-x-1/2 items-center justify-center gap-1.5 rounded-full bg-gray-900/50 px-3 py-1 py-2 text-center text-sm text-gray-700",children:t.stepList.map((m,c)=>N("div",{className:`h-2 w-2 cursor-pointer rounded-full ${c+1===i?"bg-white":"bg-white/40"}`,onClick:()=>s&&s.scrollTo(c)},c))})]})]})})},md=({dataGuide:e,mockup:o,isStep:t})=>{let[a,i]=Sa(!1),[n,s]=Sa(null),l=nd(sd({delay:3500,stopOnInteraction:!1,stopOnMouseEnter:!1})),m=c=>{s(e?.[c]||null),i(!0)};return e?.length===0?null:Pe(Ti,{children:[e?.length>1?N("div",{className:"-mx-5 grid grid-cols-1 md:mx-0",children:e.map((c,d)=>Pe("div",{className:"relative flex cursor-pointer flex-nowrap items-center space-x-4 pl-5",onClick:()=>m(d),children:[N("div",{className:"borde flex h-28 w-20 justify-center overflow-hidden rounded-t-lg bg-gray-100 p-2 pb-0",children:(c?.avatar||c?.stepList?.[0]?.image)&&N("img",{src:c.avatar||c?.stepList?.[0]?.image,className:"h-full w-full object-cover object-top",alt:c.title,"data-puck-editable":"true","data-puck-component":"GuideSection","data-puck-field":"dataGuide","data-puck-array-index":d,"data-puck-nested-field":"avatar"})}),Pe("div",{className:r("relative grid min-h-32 flex-1 grid-cols-1 items-center pr-8",d+1!=e.length&&"after:absolute after:bottom-0 after:left-0 after:right-0 after:h-px after:bg-gray-200"),children:[Pe("div",{className:"py-2",children:[t&&N("span",{className:"text-sm font-medium text-pink-500",children:`B\u01B0\u1EDBc ${d+1}`}),N("div",{className:"font-semibold",children:u(c.title)}),c?.description&&N("div",{className:"mt-1 text-sm text-gray-500",children:u(c.description)})]}),N("div",{className:"absolute right-4 top-1/2 -translate-y-1/2 text-gray-500",children:N(fn,{className:"h-6 w-6"})})]})]},d))}):e?.[0]&&e[0].stepList?.length>0&&Pe("div",{className:"mx-auto flex max-w-3xl flex-col flex-wrap justify-center gap-y-6",children:[N("div",{className:"relative max-h-96 w-full flex-none overflow-hidden",style:{WebkitMask:"linear-gradient(to bottom, rgba(0, 0, 0, 1.0) 95%, rgba(0, 0, 0, 0.3) 98%, transparent 100%)"},children:N("div",{className:"mx-auto h-auto w-72",children:Pe("div",{className:r("relative mx-auto w-full",o==="none"?"":"rounded-[2.5rem] border-8 border-gray-800 bg-gray-800 shadow-md",o==="small"?"px-1 py-5":""),children:[o!=="none"&&Pe(Ti,{children:[N("div",{className:"absolute -start-2.5 top-16 h-8 w-1.5 rounded-s-lg bg-gray-800"}),N("div",{className:"absolute -start-2.5 top-32 h-12 w-1.5 rounded-s-lg bg-gray-800"}),N("div",{className:"absolute -start-2.5 top-48 h-12 w-1.5 rounded-s-lg bg-gray-800"}),N("div",{className:"absolute -end-2.5 top-40 h-16 w-1 rounded-e-lg bg-gray-800"})]}),N("div",{className:r("relative h-full w-full overflow-hidden",o==="none"?"":"rounded-[2rem] bg-gray-200",o==="small"?"rounded-xl":""),children:N(ge,{plugins:[l.current],children:N(ve,{className:"ml-0",children:e[0]?.stepList.map((c,d)=>N(de,{className:"pl-0",onClick:()=>m(0),children:N(H,{ratio:o==="small"?540/960:540/1168,children:c?.image&&N("img",{src:c.image,className:"size-full object-contain",alt:c.title,"data-puck-editable":"true","data-puck-component":"GuideSection","data-puck-field":"dataGuide","data-puck-array-index":0,"data-puck-array-field":"stepList","data-puck-array-index-nested":d?d?.toString():"","data-puck-nested-field":"image"})})},d))})})})]})})}),N("div",{className:"flex w-full flex-none justify-center",children:Pe(ie,{size:"lg",variant:"primary",onClick:()=>m(0),children:["Xem chi ti\u1EBFt h\u01B0\u1EDBng d\u1EABn ",N(fn,{className:"ml-1 h-5 w-5"})]})})]}),a&&N(ld,{open:a,setOpenDialog:i,dataStep:n,mockup:o})]})},un=md;import{Fragment as pd,jsx as pe,jsxs as Ko}from"react/jsx-runtime";var gn=({direction:e,className:o})=>{let t=e==="left"?{viewBox:"0 0 20 40",d:"M20 0H0L18 20L0 40H20V0Z",width:"20"}:{viewBox:"0 0 19 40",d:"M0.906128 0H0V40H0.906128L19 20L0.906128 0Z",width:"19"};return pe("svg",{fill:"none",viewBox:t.viewBox,xmlns:"http://www.w3.org/2000/svg",className:r("flex-0 absolute w-5 transition-all",o),children:pe("path",{d:t.d,fill:"currentColor"})})},Si=cd(({dataHeading:e,dataHorizontalScroll:o,dataGuide:t,dataButtons:a,mockup:i,isStep:n})=>{let{showGradientOverlay:s=!0,gradientOverlayColor:l,className:m}=o||{},[c,d]=dd(t?.[0]?.title||"");return Ko(pd,{children:[e&&pe(x,{tagline:e?.tagline,title:e?.title,description:e?.description,tagHeading:e?.tagHeading,align:"center",colorScheme:e?.colorScheme||"pink",sizeHeading:e?.sizeHeading,className:r(e?.className)}),t&&t?.length>0&&Ko(fo,{children:[pe(Xe,{lessThan:"md",children:pe(un,{dataGuide:t,mockup:i,isStep:n})}),pe(Xe,{greaterThan:"sm",children:t?.length>1?Ko(Pt,{defaultValue:t[0]?.title,onValueChange:p=>d(p),children:[Ko(bt,{showGradientOverlay:s,gradientOverlayColor:l,className:m,children:[pe(yt,{className:"mb-6 text-center",children:pe(Ze,{className:r("mx-auto mb-0 inline-flex w-auto items-center overflow-visible",n?"space-x-10":""),children:t.map((p,g)=>{let h=g===t.length-1,w=c===p?.title||"";return Ko(Ke,{value:p.title,className:r(n?"relative h-10 border-0 bg-pink-100 px-3 first:rounded-l-md first:pl-5 last:rounded-r-md last:pl-3 last:pr-5":"",w&&n?"data-[state=active]:bg-pink-500 data-[state=active]:text-white":""),children:[n&&g!==0&&pe(gn,{direction:"left",className:r("right-full top-0",w?"text-pink-500":"text-pink-100")}),p.title,n&&!h&&pe(gn,{direction:"right",className:r("left-full top-0",w?"text-pink-500":"text-pink-100")})]},p.title+g)})})}),pe(wt,{}),pe(Nt,{})]}),t.map((p,g)=>pe(Je,{value:p.title,children:pe(Ri,{guideGroup:p,mockup:i})},p.title+g))]}):t?.length===1&&t[0]&&pe(Ri,{guideGroup:t[0],mockup:i})})]}),a&&pe(b,{isFullInMobile:a?.isFullInMobile,buttons:a?.buttons,className:a?.className,align:"center"})]})});import{Fragment as vd,jsx as Jo}from"react/jsx-runtime";var fd=({template:e,dataHeading:o,dataGuide:t,dataHorizontalScroll:a,dataButtons:i,mockup:n,isStep:s})=>{switch(e){case 1:return Jo(Si,{dataHeading:o,dataHorizontalScroll:a,dataGuide:t,dataButtons:i,mockup:n,isStep:s});default:return Jo(Si,{dataHeading:o,dataHorizontalScroll:a,dataGuide:t,dataButtons:i,mockup:n,isStep:s})}},ud=({dataHeading:e,dataHorizontalScroll:o,dataGuide:t,dataButtons:a,template:i,mockup:n,isStep:s})=>Jo(vd,{children:fd({dataHeading:e,dataHorizontalScroll:o,dataGuide:t,dataButtons:a,template:i,mockup:n,isStep:s})}),gd=({idSection:e,dataHeading:o,dataGuide:t,dataHorizontalScroll:a,dataButtons:i,className:n,background:s,template:l=1,mockup:m="default",isStep:c=!1})=>Jo(B,{className:r(n),background:s,idSection:e,children:Jo(ud,{dataHeading:o,template:l,dataHorizontalScroll:a,dataGuide:t,dataButtons:i,mockup:m,isStep:c})});import{useState as vn}from"react";import{Fragment as Di,jsx as E,jsxs as Rt}from"react/jsx-runtime";var hn="text-xs font-medium md:text-sm",hd=({gift:e,onOpenModal:o,index:t})=>{let a=!!e.useModal,i=!!e.btnLink?.trim(),n=e.btnName||"Xem chi ti\u1EBFt",s=l=>{l.stopPropagation(),o(e)};return E("div",{className:"w-full px-2.5 md:w-1/2 lg:w-1/3",children:Rt("div",{className:r("relative h-full rounded-xl border border-gray-200 bg-white p-2 transition-all duration-300",e.isFeatured&&"border-pink-500",a&&"cursor-pointer ring-inset hover:border-pink-500 hover:shadow-lg hover:shadow-pink-500/20 hover:ring-1 hover:ring-pink-500"),role:a?"button":void 0,tabIndex:a?0:void 0,onClick:()=>a&&o(e),children:[e.tag&&Rt("span",{className:"absolute -top-2 right-2 z-10 inline-flex",children:[E("span",{className:"rounded-bl-md rounded-br-md bg-red-600 px-2 py-0.5 text-xs font-semibold uppercase text-white shadow-sm",children:u(e.tag)}),E("span",{"aria-hidden":!0,className:"absolute right-full top-0 h-0 w-0 border-r-8 border-t-8 border-r-red-800 border-t-transparent"})]}),Rt("div",{className:"relative z-10 flex h-full flex-row items-stretch gap-3",children:[e.thumbnail&&E("div",{className:"w-28 flex-none shrink-0 md:w-32",children:E(H,{ratio:1,className:"w-full",children:E("img",{src:e.thumbnail,alt:e.title||"Gift image",className:"h-full w-full rounded-md object-contain","data-puck-editable":"true","data-puck-component":"GiftListSection","data-puck-field":"dataGiftList","data-puck-array-index":t,"data-puck-nested-field":"thumbnail"})})}),Rt("div",{className:"flex min-w-0 flex-1 flex-col",children:[Rt("div",{className:"flex-1",children:[e.serviceName?E("span",{className:"mb-1.5 mt-1 block text-xs font-medium text-gray-700 md:mb-2",children:u(e.serviceName)}):E(Di,{}),E("h3",{className:"text-base font-semibold text-gray-900 md:text-lg",children:u(e.title)}),e.description&&E("p",{className:"line-clamp-2 text-sm text-gray-600",children:u(e.description)})]}),E("div",{className:"mt-auto flex flex-none justify-end pt-1 md:pt-2",children:n&&(i?E(ie,{variant:"primary",className:hn,asChild:!0,children:E("a",{href:e.btnLink,target:e.newTab?"_blank":"_self",rel:"noreferrer",onClick:l=>l.stopPropagation(),children:n})}):E(ie,{variant:"primary",size:"default",className:hn,type:"button",onClick:s,children:n}))})]})]})]})})},Da=({dataHeading:e,dataButtons:o,dataGiftList:t})=>{let[a,i]=vn(null),[n,s]=vn(!1),l=m=>{i(m),s(!0)};return Rt(Di,{children:[e&&E(x,{align:e.align||"center",tagline:e.tagline,title:e.title,description:e.description,tagHeading:e.tagHeading,colorScheme:e.colorScheme||"pink",sizeHeading:e.sizeHeading,className:e.className}),t&&t.length>0&&E("div",{className:"-mx-2.5 mt-8 flex flex-wrap justify-center gap-y-5 md:mt-10",children:t.map((m,c)=>E(hd,{gift:m,onOpenModal:l,index:c},c))}),o&&E(b,{isFullInMobile:o.isFullInMobile,buttons:o.buttons,className:o.className,align:o.align||"center"}),n&&E(Re,{open:n,onOpenChange:s,children:Rt(Ne,{size:"lg",position:"bottom",children:[E(At,{children:E(Lt,{children:"Th\xF4ng tin chi ti\u1EBFt th\u1EBB qu\xE0"})}),Rt(ze,{children:[Rt("div",{className:"text-center",children:[a?.serviceName&&E("span",{className:"mb-1 block text-xs font-medium text-gray-500",children:u(a.serviceName)}),a?.title&&E("h3",{className:"text-xl font-bold md:text-2xl",children:u(a.title)}),a?.description&&E("p",{className:"mt-1 text-sm text-gray-700",children:u(a.description||"")})]}),a?.content?E("div",{className:"prose prose-sm mt-6 max-w-none",children:u(a.content)}):E(Di,{})]}),E(xa,{children:E(we,{variant:"primary",size:"default",onClick:()=>s(!1),children:"\u0110\xF3ng"})})]})})]})};import{jsx as Mi}from"react/jsx-runtime";var xd=({template:e,dataHeading:o,dataButtons:t,dataGiftList:a})=>{switch(e){case 1:return Mi(Da,{dataHeading:o,dataButtons:t,dataGiftList:a});default:return Mi(Da,{dataHeading:o,dataButtons:t,dataGiftList:a})}},bd=({template:e=1,className:o,idSection:t,background:a,dataHeading:i,dataButtons:n,dataGiftList:s})=>Mi(B,{idSection:t,className:o,background:a,children:xd({template:e,dataHeading:i,dataButtons:n,dataGiftList:s})});import{ChevronLeft as yd,ChevronRight as wd}from"lucide-react";import{Fragment as Nd,jsx as He,jsxs as xn}from"react/jsx-runtime";function bn({current:e,total:o,onChange:t}){let a=i=>He("li",{children:He("button",{className:r(Zt({variant:e===i?"outline":"secondary",size:"sm"})),onClick:()=>t(i),children:i})},i);return He("nav",{role:"navigation","aria-label":"pagination",className:r("mx-auto flex w-full justify-center"),children:xn("ul",{className:r("flex flex-row flex-wrap items-center gap-2"),children:[o>1&&He("li",{children:He("button",{className:r(Zt({variant:"secondary",size:"sm"})),disabled:e===1,onClick:()=>e>1&&t(e-1),children:He(yd,{className:"h-4 w-4"})})}),o<=6?Array(o).fill(0).map((i,n)=>a(n+1)):xn(Nd,{children:[a(1),e===1&&[a(2),a(3)],e>3&&He("li",{children:He("button",{className:r(Zt({variant:"secondary",size:"sm"})),disabled:e===1,onClick:()=>t(e-3),children:"..."})}),e>2&&e!==1&&e!==o&&a(e-1),e>1&&e<o&&a(e),e<o-1&&e!==1&&a(e+1),e===o&&[a(o-2),a(o-1)],e<o-2&&e!==o&&He("button",{className:r(Zt({variant:"secondary",size:"sm"})),disabled:e===1,onClick:()=>t(e+3),children:"..."}),a(o)]}),o>1&&He("li",{children:He("button",{className:r(Zt({variant:"secondary",size:"sm"})),disabled:e===o,onClick:()=>e<o&&t(e+1),children:He(wd,{className:"h-4 w-4"})})})]})})}import{forwardRef as Pd}from"react";import{QuestionMarkCircleIcon as Cd}from"@heroicons/react/24/outline";import{XCircleIcon as kd}from"@heroicons/react/24/solid";import{jsx as ko,jsxs as yn}from"react/jsx-runtime";var Rd=Pd(({disabled:e,isError:o,message:t,label:a,className:i,inputClassName:n,size:s,rows:l=3,...m},c)=>yn("div",{className:r("relative",i,o&&"mobase-text-area-error"),children:[a&&ko("span",{className:r("mobase-text-area-label absolute -top-2.5 left-2 z-[1] bg-white px-1.5 text-sm text-gray-500",s===2&&" -top-2.5 text-sm"),children:a}),ko("textarea",{disabled:e,ref:c,className:r("mobase-text-area-box block w-full rounded-md border border-gray-300 bg-white p-3 text-sm text-gray-900 outline-none transition-all placeholder:text-gray-500 focus:border-pink-500 disabled:border-gray-200 disabled:bg-gray-50",s===2&&"text-base",n),rows:l,...m}),t&&yn("div",{className:"mobase-text-area-message mt-0.5 flex items-center space-x-1",children:[o?ko(kd,{width:16,height:16,className:"text-red-500"}):ko(Cd,{width:16,height:16,className:"text-gray-500"}),ko("span",{className:r("text-gray-500 ",s===2?"text-sm":"text-xs"),children:t})]}),ko("style",{children:`
|
|
71
71
|
.mobase-text-area-box:hover {
|
|
72
72
|
box-shadow: 0px 0px 0px 1px rgb(var(--mobase-gray-400) / 1) inset;
|
|
73
73
|
}
|