@anker-in/headless-ui 1.2.3-alpha.1778583232121 → 1.2.4
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/biz-components/AccordionCards/index.js +1 -1
- package/dist/cjs/biz-components/AccordionCards/index.js.map +3 -3
- package/dist/cjs/biz-components/ActivityMechanism/index.js +1 -1
- package/dist/cjs/biz-components/ActivityMechanism/index.js.map +3 -3
- package/dist/cjs/biz-components/ActivitySchedule/index.js +1 -1
- package/dist/cjs/biz-components/ActivitySchedule/index.js.map +3 -3
- package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
- package/dist/cjs/biz-components/AiuiProvider/index.js.map +3 -3
- package/dist/cjs/biz-components/AnchorNavigation/index.js +1 -1
- package/dist/cjs/biz-components/AnchorNavigation/index.js.map +3 -3
- package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.js +1 -1
- package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.js.map +3 -3
- package/dist/cjs/biz-components/Category/SwiperCategory.js +1 -1
- package/dist/cjs/biz-components/Category/SwiperCategory.js.map +3 -3
- package/dist/cjs/biz-components/Category/index.js +1 -1
- package/dist/cjs/biz-components/Category/index.js.map +3 -3
- package/dist/cjs/biz-components/Evaluate/index.js +1 -1
- package/dist/cjs/biz-components/Evaluate/index.js.map +3 -3
- package/dist/cjs/biz-components/EventSchedule/index.js +1 -1
- package/dist/cjs/biz-components/EventSchedule/index.js.map +3 -3
- package/dist/cjs/biz-components/Faq/Faq.js +1 -1
- package/dist/cjs/biz-components/Faq/Faq.js.map +2 -2
- package/dist/cjs/biz-components/Faq/types.d.ts +1 -0
- package/dist/cjs/biz-components/Faq/types.js +1 -1
- package/dist/cjs/biz-components/Faq/types.js.map +1 -1
- package/dist/cjs/biz-components/FeatureCards/FeatureCards.js +1 -1
- package/dist/cjs/biz-components/FeatureCards/FeatureCards.js.map +3 -3
- package/dist/cjs/biz-components/GiftBox/index.js +1 -1
- package/dist/cjs/biz-components/GiftBox/index.js.map +2 -2
- package/dist/cjs/biz-components/GiftShelf/index.js +1 -1
- package/dist/cjs/biz-components/GiftShelf/index.js.map +3 -3
- package/dist/cjs/biz-components/GiftTierShelf/index.js +1 -1
- package/dist/cjs/biz-components/GiftTierShelf/index.js.map +3 -3
- package/dist/cjs/biz-components/Graphic/index.js +1 -1
- package/dist/cjs/biz-components/Graphic/index.js.map +3 -3
- package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
- package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js.map +3 -3
- package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/index.js.map +3 -3
- package/dist/cjs/biz-components/HeaderNavigation/types.d.ts +1 -8
- package/dist/cjs/biz-components/HeaderNavigation/types.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/types.js.map +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.d.ts +0 -1
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.js.map +3 -3
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +3 -3
- package/dist/cjs/biz-components/HeroBanner/HeroBannerCarousel.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/HeroBannerCarousel.js.map +3 -3
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +1 -1
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.d.ts +0 -2
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.js +1 -1
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.js.map +1 -1
- package/dist/cjs/biz-components/LotteryShared/ErrorModal.d.ts +0 -4
- package/dist/cjs/biz-components/LotteryShared/ErrorModal.js.map +2 -2
- package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.d.ts +13 -13
- package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.js +1 -1
- package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.js.map +3 -3
- package/dist/cjs/biz-components/LotteryShared/types.d.ts +0 -9
- package/dist/cjs/biz-components/LotteryShared/types.js.map +2 -2
- package/dist/cjs/biz-components/Marquee/Marquee.js +1 -1
- package/dist/cjs/biz-components/Marquee/Marquee.js.map +2 -2
- package/dist/cjs/biz-components/MediaPlayerBase/index.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerBase/index.js.map +3 -3
- package/dist/cjs/biz-components/MediaPlayerMulti/index.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerMulti/index.js.map +3 -3
- package/dist/cjs/biz-components/MemberEquity/index.js +2 -2
- package/dist/cjs/biz-components/MemberEquity/index.js.map +3 -3
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
- package/dist/cjs/biz-components/NavigationSearch/index.js +2 -2
- package/dist/cjs/biz-components/NavigationSearch/index.js.map +2 -2
- package/dist/cjs/biz-components/ProductHero/ProductHero.js +1 -1
- package/dist/cjs/biz-components/ProductHero/ProductHero.js.map +3 -3
- package/dist/cjs/biz-components/ProductLottery/types.d.ts +5 -62
- package/dist/cjs/biz-components/ProductLottery/types.js +1 -1
- package/dist/cjs/biz-components/ProductLottery/types.js.map +2 -2
- package/dist/cjs/biz-components/ProductNav/ProductNav.js +1 -1
- package/dist/cjs/biz-components/ProductNav/ProductNav.js.map +3 -3
- package/dist/cjs/biz-components/PromotionalBar/index.js +1 -1
- package/dist/cjs/biz-components/PromotionalBar/index.js.map +3 -3
- package/dist/cjs/biz-components/SecondaryBanner/SecondaryBannerCarousel.d.ts +0 -1
- package/dist/cjs/biz-components/SecondaryBanner/SecondaryBannerCarousel.js +1 -1
- package/dist/cjs/biz-components/SecondaryBanner/SecondaryBannerCarousel.js.map +3 -3
- package/dist/cjs/biz-components/SecondaryBanner/index.d.ts +0 -9
- package/dist/cjs/biz-components/SecondaryBanner/index.js +1 -1
- package/dist/cjs/biz-components/SecondaryBanner/index.js.map +3 -3
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
- package/dist/cjs/biz-components/Subscribe/index.js +1 -1
- package/dist/cjs/biz-components/Subscribe/index.js.map +2 -2
- package/dist/cjs/biz-components/SwiperBox/index.js +1 -1
- package/dist/cjs/biz-components/SwiperBox/index.js.map +3 -3
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js.map +3 -3
- package/dist/cjs/biz-components/Title/index.js +1 -1
- package/dist/cjs/biz-components/Title/index.js.map +3 -3
- package/dist/cjs/biz-components/WheelLottery/index.js +1 -1
- package/dist/cjs/biz-components/WheelLottery/index.js.map +3 -3
- package/dist/cjs/biz-components/index.d.ts +0 -4
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/biz-components/index.js.map +3 -3
- package/dist/cjs/components/Countdown.js +1 -1
- package/dist/cjs/components/Countdown.js.map +3 -3
- package/dist/cjs/components/link.js +1 -1
- package/dist/cjs/components/link.js.map +2 -2
- package/dist/cjs/helpers/index.d.ts +1 -1
- package/dist/cjs/helpers/index.js +1 -1
- package/dist/cjs/helpers/index.js.map +2 -2
- package/dist/cjs/helpers/isLexicalEmpty.d.ts +0 -5
- package/dist/cjs/helpers/isLexicalEmpty.js +1 -1
- package/dist/cjs/helpers/isLexicalEmpty.js.map +3 -3
- package/dist/esm/biz-components/AccordionCards/index.js +1 -1
- package/dist/esm/biz-components/AccordionCards/index.js.map +3 -3
- package/dist/esm/biz-components/ActivityMechanism/index.js +1 -1
- package/dist/esm/biz-components/ActivityMechanism/index.js.map +3 -3
- package/dist/esm/biz-components/ActivitySchedule/index.js +1 -1
- package/dist/esm/biz-components/ActivitySchedule/index.js.map +3 -3
- package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
- package/dist/esm/biz-components/AiuiProvider/index.js.map +3 -3
- package/dist/esm/biz-components/AnchorNavigation/index.js +1 -1
- package/dist/esm/biz-components/AnchorNavigation/index.js.map +3 -3
- package/dist/esm/biz-components/BrandCardLink/BrandCardLink.js +1 -1
- package/dist/esm/biz-components/BrandCardLink/BrandCardLink.js.map +3 -3
- package/dist/esm/biz-components/Category/SwiperCategory.js +1 -1
- package/dist/esm/biz-components/Category/SwiperCategory.js.map +3 -3
- package/dist/esm/biz-components/Category/index.js +1 -1
- package/dist/esm/biz-components/Category/index.js.map +3 -3
- package/dist/esm/biz-components/Evaluate/index.js +1 -1
- package/dist/esm/biz-components/Evaluate/index.js.map +3 -3
- package/dist/esm/biz-components/EventSchedule/index.js +1 -1
- package/dist/esm/biz-components/EventSchedule/index.js.map +3 -3
- package/dist/esm/biz-components/Faq/Faq.js +1 -1
- package/dist/esm/biz-components/Faq/Faq.js.map +2 -2
- package/dist/esm/biz-components/Faq/types.d.ts +1 -0
- package/dist/esm/biz-components/FeatureCards/FeatureCards.js +1 -1
- package/dist/esm/biz-components/FeatureCards/FeatureCards.js.map +3 -3
- package/dist/esm/biz-components/GiftBox/index.js +1 -1
- package/dist/esm/biz-components/GiftBox/index.js.map +2 -2
- package/dist/esm/biz-components/GiftShelf/index.js +1 -1
- package/dist/esm/biz-components/GiftShelf/index.js.map +3 -3
- package/dist/esm/biz-components/GiftTierShelf/index.js +1 -1
- package/dist/esm/biz-components/GiftTierShelf/index.js.map +3 -3
- package/dist/esm/biz-components/Graphic/index.js +1 -1
- package/dist/esm/biz-components/Graphic/index.js.map +3 -3
- package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
- package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js.map +3 -3
- package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/index.js.map +3 -3
- package/dist/esm/biz-components/HeaderNavigation/types.d.ts +1 -8
- package/dist/esm/biz-components/HeaderNavigation/types.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/types.js.map +2 -2
- package/dist/esm/biz-components/HeaderNavigation/withCategory.d.ts +0 -1
- package/dist/esm/biz-components/HeaderNavigation/withCategory.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/withCategory.js.map +3 -3
- package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
- package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +3 -3
- package/dist/esm/biz-components/HeroBanner/HeroBannerCarousel.js +1 -1
- package/dist/esm/biz-components/HeroBanner/HeroBannerCarousel.js.map +3 -3
- package/dist/esm/biz-components/ImageWithText/ImageWithText.js +1 -1
- package/dist/esm/biz-components/ImageWithText/ImageWithText.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/PurchaseBar/types.d.ts +0 -2
- package/dist/esm/biz-components/LotteryShared/ErrorModal.d.ts +0 -4
- package/dist/esm/biz-components/LotteryShared/ErrorModal.js.map +2 -2
- package/dist/esm/biz-components/LotteryShared/MyRewardsModal.d.ts +13 -13
- package/dist/esm/biz-components/LotteryShared/MyRewardsModal.js +1 -1
- package/dist/esm/biz-components/LotteryShared/MyRewardsModal.js.map +3 -3
- package/dist/esm/biz-components/LotteryShared/types.d.ts +0 -9
- package/dist/esm/biz-components/LotteryShared/types.js.map +2 -2
- package/dist/esm/biz-components/Marquee/Marquee.js +1 -1
- package/dist/esm/biz-components/Marquee/Marquee.js.map +2 -2
- package/dist/esm/biz-components/MediaPlayerBase/index.js +1 -1
- package/dist/esm/biz-components/MediaPlayerBase/index.js.map +3 -3
- package/dist/esm/biz-components/MediaPlayerMulti/index.js +1 -1
- package/dist/esm/biz-components/MediaPlayerMulti/index.js.map +3 -3
- package/dist/esm/biz-components/MemberEquity/index.js +2 -2
- package/dist/esm/biz-components/MemberEquity/index.js.map +3 -3
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
- package/dist/esm/biz-components/NavigationSearch/index.js +2 -2
- package/dist/esm/biz-components/NavigationSearch/index.js.map +3 -3
- package/dist/esm/biz-components/ProductHero/ProductHero.js +1 -1
- package/dist/esm/biz-components/ProductHero/ProductHero.js.map +3 -3
- package/dist/esm/biz-components/ProductLottery/types.d.ts +5 -62
- package/dist/esm/biz-components/ProductLottery/types.js.map +2 -2
- package/dist/esm/biz-components/ProductNav/ProductNav.js +1 -1
- package/dist/esm/biz-components/ProductNav/ProductNav.js.map +3 -3
- package/dist/esm/biz-components/PromotionalBar/index.js +1 -1
- package/dist/esm/biz-components/PromotionalBar/index.js.map +3 -3
- package/dist/esm/biz-components/SecondaryBanner/SecondaryBannerCarousel.d.ts +0 -1
- package/dist/esm/biz-components/SecondaryBanner/SecondaryBannerCarousel.js +1 -1
- package/dist/esm/biz-components/SecondaryBanner/SecondaryBannerCarousel.js.map +3 -3
- package/dist/esm/biz-components/SecondaryBanner/index.d.ts +0 -9
- package/dist/esm/biz-components/SecondaryBanner/index.js +1 -1
- package/dist/esm/biz-components/SecondaryBanner/index.js.map +3 -3
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
- package/dist/esm/biz-components/Subscribe/index.js +1 -1
- package/dist/esm/biz-components/Subscribe/index.js.map +2 -2
- package/dist/esm/biz-components/SwiperBox/index.js +1 -1
- package/dist/esm/biz-components/SwiperBox/index.js.map +3 -3
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js.map +3 -3
- package/dist/esm/biz-components/Title/index.js +1 -1
- package/dist/esm/biz-components/Title/index.js.map +3 -3
- package/dist/esm/biz-components/WheelLottery/index.js +1 -1
- package/dist/esm/biz-components/WheelLottery/index.js.map +2 -2
- package/dist/esm/biz-components/index.d.ts +0 -4
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/biz-components/index.js.map +3 -3
- package/dist/esm/components/Countdown.js +1 -1
- package/dist/esm/components/Countdown.js.map +3 -3
- package/dist/esm/components/link.js +1 -1
- package/dist/esm/components/link.js.map +2 -2
- package/dist/esm/helpers/index.d.ts +1 -1
- package/dist/esm/helpers/index.js +1 -1
- package/dist/esm/helpers/index.js.map +3 -3
- package/dist/esm/helpers/isLexicalEmpty.d.ts +0 -5
- package/dist/esm/helpers/isLexicalEmpty.js +1 -1
- package/dist/esm/helpers/isLexicalEmpty.js.map +3 -3
- package/package.json +1 -1
- package/style.css +3 -94
- package/dist/cjs/biz-components/HeaderNavigation/MobileTextLinksMenu.d.ts +0 -12
- package/dist/cjs/biz-components/HeaderNavigation/MobileTextLinksMenu.js +0 -2
- package/dist/cjs/biz-components/HeaderNavigation/MobileTextLinksMenu.js.map +0 -7
- package/dist/cjs/biz-components/HeaderNavigation/TextLinksDropdown.d.ts +0 -10
- package/dist/cjs/biz-components/HeaderNavigation/TextLinksDropdown.js +0 -2
- package/dist/cjs/biz-components/HeaderNavigation/TextLinksDropdown.js.map +0 -7
- package/dist/cjs/biz-components/WebPushPopup/index.d.ts +0 -44
- package/dist/cjs/biz-components/WebPushPopup/index.js +0 -2
- package/dist/cjs/biz-components/WebPushPopup/index.js.map +0 -7
- package/dist/cjs/hooks/useEmarsysWebPush.d.ts +0 -111
- package/dist/cjs/hooks/useEmarsysWebPush.js +0 -2
- package/dist/cjs/hooks/useEmarsysWebPush.js.map +0 -7
- package/dist/cjs/hooks/useProductListTrack.d.ts +0 -43
- package/dist/cjs/hooks/useProductListTrack.js +0 -2
- package/dist/cjs/hooks/useProductListTrack.js.map +0 -7
- package/dist/esm/biz-components/HeaderNavigation/MobileTextLinksMenu.d.ts +0 -12
- package/dist/esm/biz-components/HeaderNavigation/MobileTextLinksMenu.js +0 -2
- package/dist/esm/biz-components/HeaderNavigation/MobileTextLinksMenu.js.map +0 -7
- package/dist/esm/biz-components/HeaderNavigation/TextLinksDropdown.d.ts +0 -10
- package/dist/esm/biz-components/HeaderNavigation/TextLinksDropdown.js +0 -2
- package/dist/esm/biz-components/HeaderNavigation/TextLinksDropdown.js.map +0 -7
- package/dist/esm/biz-components/WebPushPopup/index.d.ts +0 -44
- package/dist/esm/biz-components/WebPushPopup/index.js +0 -2
- package/dist/esm/biz-components/WebPushPopup/index.js.map +0 -7
- package/dist/esm/hooks/useEmarsysWebPush.d.ts +0 -111
- package/dist/esm/hooks/useEmarsysWebPush.js +0 -2
- package/dist/esm/hooks/useEmarsysWebPush.js.map +0 -7
- package/dist/esm/hooks/useProductListTrack.d.ts +0 -43
- package/dist/esm/hooks/useProductListTrack.js +0 -2
- package/dist/esm/hooks/useProductListTrack.js.map +0 -7
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var
|
|
1
|
+
"use strict";"use client";var z=Object.create;var f=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var j=(o,r)=>{for(var s in r)f(o,s,{get:r[s],enumerable:!0})},g=(o,r,s,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of D(r))!R.call(o,a)&&a!==s&&f(o,a,{get:()=>r[a],enumerable:!(u=E(r,a))||u.enumerable});return o};var B=(o,r,s)=>(s=o!=null?z(P(o)):{},g(r||!o||!o.__esModule?f(s,"default",{value:o,enumerable:!0}):s,o)),M=o=>g(f({},"__esModule",{value:!0}),o);var W={};j(W,{default:()=>V});module.exports=M(W);var e=require("react/jsx-runtime"),i=B(require("react")),l=require("../../components/index.js"),c=require("../../helpers/utils.js"),N=require("../../shared/Styles.js"),y=require("../../hooks/useExposure.js"),S=require("../AiuiProvider/index.js"),p=require("swiper/react"),h=require("swiper/modules"),q=require("swiper/css"),F=require("swiper/css/navigation"),G=require("swiper/css/pagination"),J=require("swiper/css/effect-coverflow");const H="carousel",U="three_d_carousel",I=()=>(0,e.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]",children:[(0,e.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"currentColor",fillOpacity:"0.2"}),(0,e.jsx)("path",{d:"M32 20L24 28L32 36",stroke:"white",strokeWidth:"2.66667",strokeLinecap:"round",strokeLinejoin:"round"})]}),O=()=>(0,e.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]",children:[(0,e.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"currentColor",fillOpacity:"0.2"}),(0,e.jsx)("path",{d:"M24 20L32 28L24 36",stroke:"white",strokeWidth:"2.66667",strokeLinecap:"round",strokeLinejoin:"round"})]}),k=i.default.forwardRef(({data:o,className:r},s)=>{const{title:u,items:a=[]}=o,w=a.length<4?[...a,...a]:a,n=(0,i.useRef)(null),v=(0,i.useRef)(null),x=(0,i.useRef)(null),[T,C]=i.default.useState(180),{locale:b="us"}=(0,S.useAiuiContext)();return(0,y.useExposure)(v,{componentType:H,componentName:U,componentTitle:u}),(0,i.useImperativeHandle)(s,()=>v.current),i.default.useEffect(()=>{const t=x.current;if(!t)return;const d=()=>{const L=t.offsetWidth,_=Math.round(L*.125);C(_),n.current?.params?.coverflowEffect&&(n.current.params.coverflowEffect.stretch=_,n.current.update())};d();const m=new ResizeObserver(d);return m.observe(t),()=>m.disconnect()},[]),(0,e.jsxs)("section",{ref:v,"data-ui-component-id":"ThreeDCarousel",className:(0,c.cn)("three-d-carousel laptop:overflow-hidden w-full overflow-visible",r),children:[(0,e.jsx)(l.Heading,{as:"h1",size:4,html:u,className:"three-d-carousel__title laptop:text-center text-left"}),(0,e.jsxs)("div",{ref:x,className:"three-d-carousel__desktop laptop:block relative mx-auto mt-[24px] hidden w-full",children:[(0,e.jsx)(p.Swiper,{onSwiper:t=>n.current=t,centeredSlides:!0,initialSlide:0,loop:!0,slidesPerView:"auto",spaceBetween:0,grabCursor:!0,modules:[h.EffectCoverflow,h.Navigation],slideToClickedSlide:!0,className:"three-d-carousel__swiper rounded-box relative aspect-[1386/502] overflow-visible",effect:"coverflow",coverflowEffect:{rotate:0,stretch:T,depth:300,modifier:1,slideShadows:!0},children:w.map((t,d)=>(0,e.jsx)(p.SwiperSlide,{className:"three-d-carousel__slide relative !w-1/2 cursor-grab overflow-hidden opacity-0 [.swiper-slide-active&]:opacity-100 [.swiper-slide-next&]:opacity-100 [.swiper-slide-prev&]:opacity-100",children:({isActive:m})=>(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l.Picture,{source:t.imageUrl?.url||"",alt:t.imageUrl?.alt||t.title,className:(0,c.cn)("three-d-carousel__image rounded-box mx-auto h-full overflow-hidden"),imgClassName:"h-full object-cover",style:{filter:m?"":"brightness(50%) contrast(120%)"}}),(0,e.jsxs)("div",{className:(0,c.cn)("three-d-carousel__image-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]",{"aiui-dark":t.theme==="dark","opacity-0":!m}),children:[(0,e.jsx)(l.Heading,{as:"h2",size:2,html:t.title}),(0,e.jsx)(l.Text,{as:"p",size:4,html:t.description,className:"three-d-carousel__image-description lg-desktop:text-[18px] desktop:text-[16px] text-[14px]"}),t.buttonText&&(0,e.jsx)("a",{href:(0,c.getLocalizedPath)(t.buttonLink||"",b),className:"three-d-carousel__image-link ",children:(0,e.jsx)(l.Button,{size:"base",variant:"secondary",className:"three-d-carousel__image-button desktop:mt-6 mt-4",children:t.buttonText})})]})]})},d))}),(0,e.jsxs)("div",{className:"three-d-carousel__nav-controls laptop:px-[64px] desktop:px-[140px] lg-desktop:px-[200px] absolute left-1/2 top-1/2 z-20 flex w-full -translate-x-1/2 -translate-y-1/2 justify-between",children:[(0,e.jsx)("button",{className:"three-d-carousel__nav-button three-d-carousel__nav-button--prev",onClick:()=>n.current?.slidePrev(),"aria-label":"Previous slide",children:(0,e.jsx)(I,{})}),(0,e.jsx)("button",{className:"three-d-carousel__nav-button three-d-carousel__nav-button--next",onClick:()=>n.current?.slideNext(),"aria-label":"Next slide",children:(0,e.jsx)(O,{})})]})]}),(0,e.jsx)("div",{className:"three-d-carousel__mobile laptop:hidden mt-[24px] block w-full overflow-visible",children:(0,e.jsx)(p.Swiper,{loop:!0,loopAdditionalSlides:1,slidesPerView:"auto",spaceBetween:12,grabCursor:!0,className:"three-d-carousel__swiper-mobile relative w-full !overflow-visible",children:w.map((t,d)=>(0,e.jsxs)(p.SwiperSlide,{className:"three-d-carousel__slide-mobile relative !h-[360px] !w-[296px] cursor-grab overflow-hidden",children:[(0,e.jsx)(l.Picture,{source:t.mobImageUrl?.url||t.imageUrl?.url||"",alt:t.mobImageUrl?.alt||t.title,className:"three-d-carousel__image-mobile rounded-box mx-auto h-full overflow-hidden",imgClassName:"h-full object-cover"}),(0,e.jsxs)("div",{className:(0,c.cn)("three-d-carousel__image-mobile-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]",{"aiui-dark":t.theme==="dark"}),children:[(0,e.jsx)(l.Heading,{as:"h2",size:2,html:t.title}),(0,e.jsx)(l.Text,{as:"p",size:4,html:t.description,className:"three-d-carousel__image-mobile-description text-[14px]"}),t.buttonText&&(0,e.jsx)("a",{href:(0,c.getLocalizedPath)(t.buttonLink||"",b),className:"three-d-carousel__image-mobile-link ",children:(0,e.jsx)(l.Button,{size:"base",variant:"secondary",className:"three-d-carousel__image-mobile-button mt-3",children:t.buttonText})})]})]},d))})})]})});k.displayName="ThreeDCarousel";var V=(0,N.withLayout)(k,{style:"overflow: hidden;"});
|
|
2
2
|
//# sourceMappingURL=ThreeDCarousel.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/ThreeDCarousel/ThreeDCarousel.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport React, { useRef, useImperativeHandle } from 'react'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport type { ThreeDCarouselProps } from './types.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Navigation, EffectCoverflow } from 'swiper/modules'\nimport type { Swiper as SwiperType } from 'swiper'\n\nimport 'swiper/css'\nimport 'swiper/css/navigation'\nimport 'swiper/css/pagination'\nimport 'swiper/css/effect-coverflow'\n\nconst componentType = 'carousel'\nconst componentName = 'three_d_carousel'\n\nconst ChevronLeft = () => (\n <svg\n width=\"56\"\n height=\"56\"\n viewBox=\"0 0 56 56\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]\"\n >\n <circle cx=\"28\" cy=\"28\" r=\"28\" fill=\"currentColor\" fillOpacity=\"0.2\" />\n <path d=\"M32 20L24 28L32 36\" stroke=\"white\" strokeWidth=\"2.66667\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n)\n\nconst ChevronRight = () => (\n <svg\n width=\"56\"\n height=\"56\"\n viewBox=\"0 0 56 56\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]\"\n >\n <circle cx=\"28\" cy=\"28\" r=\"28\" fill=\"currentColor\" fillOpacity=\"0.2\" />\n <path d=\"M24 20L32 28L24 36\" stroke=\"white\" strokeWidth=\"2.66667\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n)\n\nconst ThreeDCarousel = React.forwardRef<HTMLDivElement, ThreeDCarouselProps>(({ data, className }, ref) => {\n const { title, items = [] } = data\n const cloneItems = items.length < 4 ? [...items, ...items] : items\n const swiperRef = useRef<SwiperType | null>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n const containerRef = useRef<HTMLDivElement>(null)\n const [stretchValue, setStretchValue] = React.useState(180)\n const { locale = 'us', trackingData } = useAiuiContext()\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n // \u52A8\u6001\u8BA1\u7B97 stretch \u503C\uFF0C\u8BA9\u4E09\u4E2A slide \u521A\u597D\u5360\u6EE1\u5BB9\u5668\u5BBD\u5EA6\n React.useEffect(() => {\n const container = containerRef.current\n if (!container) return\n\n const updateStretch = () => {\n const containerWidth = container.offsetWidth\n // stretch \u4E3A\u5BB9\u5668\u5BBD\u5EA6\u7684 12.5%\uFF0C\u8BA9\u4E09\u4E2A slide (50% + 2*25%) \u521A\u597D\u5360\u6EE1\n const newStretch = Math.round(containerWidth * 0.125)\n setStretchValue(newStretch)\n\n // \u66F4\u65B0 Swiper \u914D\u7F6E\n if (swiperRef.current?.params?.coverflowEffect) {\n swiperRef.current.params.coverflowEffect.stretch = newStretch\n swiperRef.current.update()\n }\n }\n\n // \u521D\u59CB\u5316\u8BA1\u7B97\n updateStretch()\n\n // \u76D1\u542C\u5BB9\u5668\u5C3A\u5BF8\u53D8\u5316\n const resizeObserver = new ResizeObserver(updateStretch)\n resizeObserver.observe(container)\n\n return () => resizeObserver.disconnect()\n }, [])\n\n return (\n <section\n ref={boxRef}\n data-ui-component-id=\"ThreeDCarousel\"\n className={cn('three-d-carousel laptop:overflow-hidden w-full overflow-visible', className)}\n >\n <Heading as=\"h1\" size={4} html={title} className=\"three-d-carousel__title laptop:text-center text-left\" />\n\n {/* Desktop carousel with 3D effect */}\n <div\n ref={containerRef}\n className=\"three-d-carousel__desktop laptop:block relative mx-auto mt-[24px] hidden w-full\"\n >\n <Swiper\n onSwiper={swiper => (swiperRef.current = swiper)}\n centeredSlides={true}\n initialSlide={0}\n loop\n slidesPerView={'auto'}\n // loopAdditionalSlides={2}\n spaceBetween={0}\n grabCursor\n modules={[EffectCoverflow, Navigation]}\n slideToClickedSlide\n className=\"three-d-carousel__swiper rounded-box relative aspect-[1386/502] overflow-visible\"\n effect=\"coverflow\"\n coverflowEffect={{\n rotate: 0,\n stretch: stretchValue,\n depth: 300,\n modifier: 1,\n slideShadows: true,\n }}\n >\n {cloneItems.map((item, index) => (\n <SwiperSlide\n key={index}\n className=\"three-d-carousel__slide relative !w-1/2 cursor-grab overflow-hidden opacity-0 [.swiper-slide-active&]:opacity-100 [.swiper-slide-next&]:opacity-100 [.swiper-slide-prev&]:opacity-100\"\n >\n {({ isActive }) => (\n <>\n <Picture\n source={item.imageUrl?.url || ''}\n alt={item.imageUrl?.alt || item.title}\n className={cn('three-d-carousel__image rounded-box mx-auto h-full overflow-hidden')}\n imgClassName=\"h-full object-cover\"\n style={{\n filter: isActive ? '' : 'brightness(50%) contrast(120%)',\n }}\n />\n <div\n className={cn(\n 'three-d-carousel__image-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]',\n {\n 'aiui-dark': item.theme === 'dark',\n 'opacity-0': !isActive,\n }\n )}\n >\n <Heading as=\"h2\" size={2} html={item.title} />\n <Text\n as=\"p\"\n size={4}\n html={item.description}\n className=\"three-d-carousel__image-description lg-desktop:text-[18px] desktop:text-[16px] text-[14px]\"\n />\n {item.buttonText && (\n <a\n href={trackUrlRef(\n getLocalizedPath(item.buttonLink || '', locale),\n `${trackingData?.contextHandle || ''}_${componentType}_${componentName}`\n )}\n className=\"three-d-carousel__image-link \"\n >\n <Button\n size=\"base\"\n variant=\"secondary\"\n className=\"three-d-carousel__image-button desktop:mt-6 mt-4\"\n >\n {item.buttonText}\n </Button>\n </a>\n )}\n </div>\n </>\n )}\n </SwiperSlide>\n ))}\n </Swiper>\n <div className=\"three-d-carousel__nav-controls laptop:px-[64px] desktop:px-[140px] lg-desktop:px-[200px] absolute left-1/2 top-1/2 z-20 flex w-full -translate-x-1/2 -translate-y-1/2 justify-between\">\n <button\n className=\"three-d-carousel__nav-button three-d-carousel__nav-button--prev\"\n onClick={() => swiperRef.current?.slidePrev()}\n aria-label=\"Previous slide\"\n >\n <ChevronLeft />\n </button>\n <button\n className=\"three-d-carousel__nav-button three-d-carousel__nav-button--next\"\n onClick={() => swiperRef.current?.slideNext()}\n aria-label=\"Next slide\"\n >\n <ChevronRight />\n </button>\n </div>\n </div>\n\n {/* Mobile carousel */}\n <div className=\"three-d-carousel__mobile laptop:hidden mt-[24px] block w-full overflow-visible\">\n <Swiper\n loop={true}\n loopAdditionalSlides={1}\n slidesPerView={'auto'}\n spaceBetween={12}\n grabCursor\n className=\"three-d-carousel__swiper-mobile relative w-full !overflow-visible\"\n >\n {cloneItems.map((item, index) => (\n <SwiperSlide\n key={index}\n className=\"three-d-carousel__slide-mobile relative !h-[360px] !w-[296px] cursor-grab overflow-hidden\"\n >\n <Picture\n source={item.mobImageUrl?.url || item.imageUrl?.url || ''}\n alt={item.mobImageUrl?.alt || item.title}\n className=\"three-d-carousel__image-mobile rounded-box mx-auto h-full overflow-hidden\"\n imgClassName=\"h-full object-cover\"\n />\n <div\n className={cn(\n 'three-d-carousel__image-mobile-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]',\n {\n 'aiui-dark': item.theme === 'dark',\n }\n )}\n >\n <Heading as=\"h2\" size={2} html={item.title} />\n <Text\n as=\"p\"\n size={4}\n html={item.description}\n className=\"three-d-carousel__image-mobile-description text-[14px]\"\n />\n {item.buttonText && (\n <a\n href={trackUrlRef(\n getLocalizedPath(item.buttonLink || '', locale),\n `${trackingData?.contextHandle || ''}_${componentType}_${componentName}`\n )}\n className=\"three-d-carousel__image-mobile-link \"\n >\n <Button size=\"base\" variant=\"secondary\" className=\"three-d-carousel__image-mobile-button mt-3\">\n {item.buttonText}\n </Button>\n </a>\n )}\n </div>\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n </section>\n )\n})\n\nThreeDCarousel.displayName = 'ThreeDCarousel'\n\nexport default withLayout(ThreeDCarousel, { style: 'overflow: hidden;' })\n"],
|
|
5
|
-
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,
|
|
6
|
-
"names": ["ThreeDCarousel_exports", "__export", "ThreeDCarousel_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_utils", "import_Styles", "import_useExposure", "import_AiuiProvider", "
|
|
4
|
+
"sourcesContent": ["'use client'\nimport React, { useRef, useImperativeHandle } from 'react'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport type { ThreeDCarouselProps } from './types.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Navigation, EffectCoverflow } from 'swiper/modules'\nimport type { Swiper as SwiperType } from 'swiper'\n\nimport 'swiper/css'\nimport 'swiper/css/navigation'\nimport 'swiper/css/pagination'\nimport 'swiper/css/effect-coverflow'\n\nconst componentType = 'carousel'\nconst componentName = 'three_d_carousel'\n\nconst ChevronLeft = () => (\n <svg\n width=\"56\"\n height=\"56\"\n viewBox=\"0 0 56 56\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]\"\n >\n <circle cx=\"28\" cy=\"28\" r=\"28\" fill=\"currentColor\" fillOpacity=\"0.2\" />\n <path d=\"M32 20L24 28L32 36\" stroke=\"white\" strokeWidth=\"2.66667\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n)\n\nconst ChevronRight = () => (\n <svg\n width=\"56\"\n height=\"56\"\n viewBox=\"0 0 56 56\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]\"\n >\n <circle cx=\"28\" cy=\"28\" r=\"28\" fill=\"currentColor\" fillOpacity=\"0.2\" />\n <path d=\"M24 20L32 28L24 36\" stroke=\"white\" strokeWidth=\"2.66667\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n)\n\nconst ThreeDCarousel = React.forwardRef<HTMLDivElement, ThreeDCarouselProps>(({ data, className }, ref) => {\n const { title, items = [] } = data\n const cloneItems = items.length < 4 ? [...items, ...items] : items\n const swiperRef = useRef<SwiperType | null>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n const containerRef = useRef<HTMLDivElement>(null)\n const [stretchValue, setStretchValue] = React.useState(180)\n const { locale = 'us' } = useAiuiContext()\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n // \u52A8\u6001\u8BA1\u7B97 stretch \u503C\uFF0C\u8BA9\u4E09\u4E2A slide \u521A\u597D\u5360\u6EE1\u5BB9\u5668\u5BBD\u5EA6\n React.useEffect(() => {\n const container = containerRef.current\n if (!container) return\n\n const updateStretch = () => {\n const containerWidth = container.offsetWidth\n // stretch \u4E3A\u5BB9\u5668\u5BBD\u5EA6\u7684 12.5%\uFF0C\u8BA9\u4E09\u4E2A slide (50% + 2*25%) \u521A\u597D\u5360\u6EE1\n const newStretch = Math.round(containerWidth * 0.125)\n setStretchValue(newStretch)\n\n // \u66F4\u65B0 Swiper \u914D\u7F6E\n if (swiperRef.current?.params?.coverflowEffect) {\n swiperRef.current.params.coverflowEffect.stretch = newStretch\n swiperRef.current.update()\n }\n }\n\n // \u521D\u59CB\u5316\u8BA1\u7B97\n updateStretch()\n\n // \u76D1\u542C\u5BB9\u5668\u5C3A\u5BF8\u53D8\u5316\n const resizeObserver = new ResizeObserver(updateStretch)\n resizeObserver.observe(container)\n\n return () => resizeObserver.disconnect()\n }, [])\n\n return (\n <section\n ref={boxRef}\n data-ui-component-id=\"ThreeDCarousel\"\n className={cn('three-d-carousel laptop:overflow-hidden w-full overflow-visible', className)}\n >\n <Heading as=\"h1\" size={4} html={title} className=\"three-d-carousel__title laptop:text-center text-left\" />\n\n {/* Desktop carousel with 3D effect */}\n <div\n ref={containerRef}\n className=\"three-d-carousel__desktop laptop:block relative mx-auto mt-[24px] hidden w-full\"\n >\n <Swiper\n onSwiper={swiper => (swiperRef.current = swiper)}\n centeredSlides={true}\n initialSlide={0}\n loop\n slidesPerView={'auto'}\n // loopAdditionalSlides={2}\n spaceBetween={0}\n grabCursor\n modules={[EffectCoverflow, Navigation]}\n slideToClickedSlide\n className=\"three-d-carousel__swiper rounded-box relative aspect-[1386/502] overflow-visible\"\n effect=\"coverflow\"\n coverflowEffect={{\n rotate: 0,\n stretch: stretchValue,\n depth: 300,\n modifier: 1,\n slideShadows: true,\n }}\n >\n {cloneItems.map((item, index) => (\n <SwiperSlide\n key={index}\n className=\"three-d-carousel__slide relative !w-1/2 cursor-grab overflow-hidden opacity-0 [.swiper-slide-active&]:opacity-100 [.swiper-slide-next&]:opacity-100 [.swiper-slide-prev&]:opacity-100\"\n >\n {({ isActive }) => (\n <>\n <Picture\n source={item.imageUrl?.url || ''}\n alt={item.imageUrl?.alt || item.title}\n className={cn('three-d-carousel__image rounded-box mx-auto h-full overflow-hidden')}\n imgClassName=\"h-full object-cover\"\n style={{\n filter: isActive ? '' : 'brightness(50%) contrast(120%)',\n }}\n />\n <div\n className={cn(\n 'three-d-carousel__image-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]',\n {\n 'aiui-dark': item.theme === 'dark',\n 'opacity-0': !isActive,\n }\n )}\n >\n <Heading as=\"h2\" size={2} html={item.title} />\n <Text\n as=\"p\"\n size={4}\n html={item.description}\n className=\"three-d-carousel__image-description lg-desktop:text-[18px] desktop:text-[16px] text-[14px]\"\n />\n {item.buttonText && (\n <a\n href={getLocalizedPath(item.buttonLink || '', locale)}\n className=\"three-d-carousel__image-link \"\n >\n <Button\n size=\"base\"\n variant=\"secondary\"\n className=\"three-d-carousel__image-button desktop:mt-6 mt-4\"\n >\n {item.buttonText}\n </Button>\n </a>\n )}\n </div>\n </>\n )}\n </SwiperSlide>\n ))}\n </Swiper>\n <div className=\"three-d-carousel__nav-controls laptop:px-[64px] desktop:px-[140px] lg-desktop:px-[200px] absolute left-1/2 top-1/2 z-20 flex w-full -translate-x-1/2 -translate-y-1/2 justify-between\">\n <button\n className=\"three-d-carousel__nav-button three-d-carousel__nav-button--prev\"\n onClick={() => swiperRef.current?.slidePrev()}\n aria-label=\"Previous slide\"\n >\n <ChevronLeft />\n </button>\n <button\n className=\"three-d-carousel__nav-button three-d-carousel__nav-button--next\"\n onClick={() => swiperRef.current?.slideNext()}\n aria-label=\"Next slide\"\n >\n <ChevronRight />\n </button>\n </div>\n </div>\n\n {/* Mobile carousel */}\n <div className=\"three-d-carousel__mobile laptop:hidden mt-[24px] block w-full overflow-visible\">\n <Swiper\n loop={true}\n loopAdditionalSlides={1}\n slidesPerView={'auto'}\n spaceBetween={12}\n grabCursor\n className=\"three-d-carousel__swiper-mobile relative w-full !overflow-visible\"\n >\n {cloneItems.map((item, index) => (\n <SwiperSlide\n key={index}\n className=\"three-d-carousel__slide-mobile relative !h-[360px] !w-[296px] cursor-grab overflow-hidden\"\n >\n <Picture\n source={item.mobImageUrl?.url || item.imageUrl?.url || ''}\n alt={item.mobImageUrl?.alt || item.title}\n className=\"three-d-carousel__image-mobile rounded-box mx-auto h-full overflow-hidden\"\n imgClassName=\"h-full object-cover\"\n />\n <div\n className={cn(\n 'three-d-carousel__image-mobile-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]',\n {\n 'aiui-dark': item.theme === 'dark',\n }\n )}\n >\n <Heading as=\"h2\" size={2} html={item.title} />\n <Text\n as=\"p\"\n size={4}\n html={item.description}\n className=\"three-d-carousel__image-mobile-description text-[14px]\"\n />\n {item.buttonText && (\n <a\n href={getLocalizedPath(item.buttonLink || '', locale)}\n className=\"three-d-carousel__image-mobile-link \"\n >\n <Button size=\"base\" variant=\"secondary\" className=\"three-d-carousel__image-mobile-button mt-3\">\n {item.buttonText}\n </Button>\n </a>\n )}\n </div>\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n </section>\n )\n})\n\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M,EAAG,KAAMA,EAAK,MAAO,KAC5C,OAAC,QACC,GAAG,IACH,KAAM,EACN,KAAMA,EAAK,YACX,UAAU,yDACZ,EACCA,EAAK,eACJ,OAAC,KACC,QAAM,oBAAiBA,EAAK,YAAc,GAAIP,CAAM,EACpD,UAAU,uCAEV,mBAAC,UAAO,KAAK,OAAO,QAAQ,YAAY,UAAU,6CAC/C,SAAAO,EAAK,WACR,EACF,GAEJ,IAlCKC,CAmCP,CACD,EACH,EACF,GACF,CAEJ,CAAC,EAEDrB,EAAe,YAAc,iBAE7B,IAAOlB,KAAQ,cAAWkB,EAAgB,CAAE,MAAO,mBAAoB,CAAC",
|
|
6
|
+
"names": ["ThreeDCarousel_exports", "__export", "ThreeDCarousel_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_utils", "import_Styles", "import_useExposure", "import_AiuiProvider", "import_modules", "import_css", "import_navigation", "import_pagination", "import_effect_coverflow", "componentType", "componentName", "ChevronLeft", "ChevronRight", "ThreeDCarousel", "React", "data", "className", "ref", "title", "items", "cloneItems", "swiperRef", "boxRef", "containerRef", "stretchValue", "setStretchValue", "locale", "container", "updateStretch", "containerWidth", "newStretch", "resizeObserver", "swiper", "item", "index", "isActive"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var
|
|
1
|
+
"use strict";"use client";var dt=Object.create;var x=Object.defineProperty;var ct=Object.getOwnPropertyDescriptor;var ut=Object.getOwnPropertyNames;var mt=Object.getPrototypeOf,pt=Object.prototype.hasOwnProperty;var ft=(t,n)=>{for(var e in n)x(t,e,{get:n[e],enumerable:!0})},S=(t,n,e,l)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of ut(n))!pt.call(t,s)&&s!==e&&x(t,s,{get:()=>n[s],enumerable:!(l=ct(n,s))||l.enumerable});return t};var ht=(t,n,e)=>(e=t!=null?dt(mt(t)):{},S(n||!t||!t.__esModule?x(e,"default",{value:t,enumerable:!0}):e,t)),gt=t=>S(x({},"__esModule",{value:!0}),t);var vt={};ft(vt,{default:()=>bt});module.exports=gt(vt);var i=require("react/jsx-runtime"),r=ht(require("react")),w=require("gsap"),F=require("gsap/dist/SplitText"),H=require("gsap/dist/ScrollTrigger"),a=require("../../helpers/utils.js"),L=require("class-variance-authority"),d=require("../../components/index.js"),_=require("../../shared/Styles.js"),I=require("../../shared/trackUrlRef.js"),j=require("react-intersection-observer");const V="link",$="title",xt=(0,L.cva)("",{variants:{theme:{light:"text-[#080A0F]",dark:"text-[#F5F6F7]"}},defaultVariants:{theme:"light"}}),wt=(0,L.cva)("desktop:text-base desktop:mt-2 lg-desktop:text-[18px] mt-1 text-[14px] font-bold leading-[1.4] tracking-[-0.36px]",{variants:{theme:{light:"text-[#080A0F]",dark:"text-[#F5F6F7]"}},defaultVariants:{theme:"light"}}),A=({data:t,onClick:n,className:e})=>{const{theme:l="light",extensions:s,title:b,caption:v,align:h}=t;if(!s?.textLink)return null;const u=s?.link?(0,I.trackUrlRef)(s.link,`${V}_${$}`):void 0;return(0,i.jsxs)("a",{className:(0,a.cn)({"aiui-dark":l==="dark"},"hover:text-brand-0 [&_svg_path]:hover:fill-brand-0 lg-desktop:text-base flex cursor-pointer items-center overflow-hidden text-sm font-[700] leading-[1.4] transition-all duration-[0.4s]",{"text-[#080A0F]":l==="light"},{"text-[#F5F6F7]":l==="dark"},{"justify-center mt-4":h==="center"},{"mt-1 laptop:mt-0":h==="left"},e),...u?{href:u}:{},"data-headless-type-name":`${V}#${$}`,"data-headless-title-desc-button":`${b}#${v}`,...n?{onClick:n}:{},children:[(0,i.jsx)("div",{className:"truncate whitespace-nowrap",children:s?.textLink}),(0,i.jsx)("div",{className:"lg-desktop:size-5 size-4",children:(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 16 16",fill:"none",children:(0,i.jsx)("path",{d:"M5.52827 3.52864C5.78862 3.26829 6.21063 3.26829 6.47098 3.52864L10.471 7.52864C10.7313 7.78899 10.7313 8.21099 10.471 8.47134L6.47098 12.4713C6.21063 12.7317 5.78862 12.7317 5.52827 12.4713C5.26792 12.211 5.26792 11.789 5.52827 11.5286L9.05692 7.99999L5.52827 4.47134C5.26792 4.21099 5.26792 3.78899 5.52827 3.52864Z",fill:l==="dark"?"#F5F6F7":"#080A0F",className:"transition-all duration-[0.4s]"})})})]})},B=r.default.forwardRef(({data:t,className:n,classNames:e,as:l="h2",weight:s="bold",onButtonClick:b,...v},h)=>{const{title:u,titleSize:O=4,caption:D,subtitle:M,content:C,countdown:o,showCountdown:U=!1,theme:g="light",extensions:W,align:m="left"}=t,E=(0,r.useRef)(null),p=(0,r.useRef)(null),c=(0,r.useRef)(null),f=(0,r.useRef)(null),[Z,q]=(0,r.useState)(!0),{ref:G,inView:z}=(0,j.useInView)();(0,r.useImperativeHandle)(h,()=>E.current);const J=()=>{q(!1)},K=o?.targetDateTime||o?.targetDate||"",Q=o?.targetDateTime_tz,X=o?.labels?{day:o.labels.days||"Day",hour:o.labels.hours||"Hours",minute:o.labels.minutes||"Mins",second:o.labels.seconds||"Secs"}:void 0;return(0,r.useEffect)(()=>{w.gsap.registerPlugin(F.SplitText,H.ScrollTrigger);function Y(){if(!p.current)return;const tt=p.current?.clientHeight||80;c.current&&c.current.revert(),f.current&&f.current.kill(),c.current=new F.SplitText(p.current,{type:"words",wordsClass:"word"});const k=c.current.words;w.gsap.set(k,{opacity:0}),f.current=H.ScrollTrigger.create({trigger:p.current,start:"bottom bottom-=4%",end:`bottom+=${tt*1.5+60}px bottom-=4%`,scrub:!0,invalidateOnRefresh:!0,onUpdate:et=>{const nt=et.progress,R=k.length||1,it=.5,T=1/R,N=T*(1-it),P=(R-1)*N+T,ot=Math.min(1,P>0?nt/P:0);k.forEach((rt,st)=>{const at=st*N,lt=T;let y=(ot-at)/lt;y=Math.max(0,Math.min(1,y)),w.gsap.set(rt,{opacity:y})})}})}return z&&Y(),()=>{c.current&&c.current.revert(),f.current&&f.current.kill()}},[z]),(0,i.jsxs)("div",{...v,id:W?.id,className:(0,a.cn)("titleBottom title-box flex items-end justify-between gap-2 pb-6",n,e?.wrapper),ref:E,children:[(0,i.jsxs)("div",{ref:G,className:(0,a.cn)("flex-1",e?.container,{"aiui-dark":g==="dark","text-center":m==="center","text-left":m==="left"}),children:[(D||u)&&(0,i.jsx)(d.Heading,{ref:p,as:l,size:O,html:D||u,weight:s,className:(0,a.cn)(xt({theme:g}),e?.title)}),M&&(0,i.jsx)(d.Text,{html:M,as:"p",className:(0,a.cn)(wt({theme:g}),e?.subtitle)}),C&&(0,i.jsx)(d.Text,{html:C,as:"div",size:4,className:(0,a.cn)("title-content text-info-primary desktop:text-base desktop:mt-4 lg-desktop:text-[18px] mt-2 text-[14px] leading-[1.6]",e?.content)}),(0,i.jsx)(A,{data:t,className:(0,a.cn)({"laptop:hidden":m==="left"},e?.button)}),U&&o&&Z&&(0,i.jsx)(d.Countdown,{endDate:K,endDate_tz:Q,timeLabels:X,showDays:o?.showDays,showHours:o?.showHours,showMinutes:o?.showMinutes,showSeconds:o?.showSeconds,theme:g,onExpire:J,hideWhenExpired:!0,align:m==="center"?"center":"left",className:(0,a.cn)("mt-4",e?.countdown)})]}),(0,i.jsx)(A,{data:t,className:(0,a.cn)("hidden",{"laptop:flex":m==="left"},e?.button),onClick:b})]})});B.displayName="Title";var bt=(0,_.withLayout)(B);
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/Title/index.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport React, { useEffect, useRef, useImperativeHandle, useState } from 'react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn, extractLexicalText } from '../../helpers/index.js'\nimport { cva } from 'class-variance-authority'\nimport { Heading, Text, Countdown, type HeadingProps } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport type { TitlePropsBase } from './types.js'\n\nexport interface TitleProps extends TitlePropsBase, Omit<React.HTMLAttributes<HTMLDivElement>, 'className' | 'title'> {}\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { useInView } from 'react-intersection-observer'\n\nconst componentType = 'link'\nconst componentName = 'title'\n\n/**\n * \u6807\u9898\u6837\u5F0F\u53D8\u4F53\n */\nconst titleHeadingVariants = cva('', {\n variants: {\n theme: {\n light: 'text-[#080A0F]',\n dark: 'text-[#F5F6F7]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n})\n\n/**\n * \u526F\u6807\u9898\u6837\u5F0F\u53D8\u4F53\n */\nconst subtitleVariants = cva(\n 'desktop:text-base desktop:mt-2 lg-desktop:text-[18px] mt-1 text-[14px] font-bold leading-[1.4] tracking-[-0.36px]',\n {\n variants: {\n theme: {\n light: 'text-[#080A0F]',\n dark: 'text-[#F5F6F7]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n }\n)\n\nconst TitleButton = ({\n data,\n onClick,\n className,\n}: {\n data: TitleProps['data']\n onClick?: () => void\n className?: string\n}) => {\n const { theme = 'light', extensions, title, caption, align } = data\n const { trackingData } = useAiuiContext()\n const contextHandle = trackingData?.contextHandle || ''\n if (!extensions?.textLink) return null\n\n const href = extensions?.link\n ? trackUrlRef(extensions.link, `${contextHandle}_${componentType}_${componentName}`)\n : undefined\n\n return (\n <a\n className={cn(\n { 'aiui-dark': theme === 'dark' },\n 'hover:text-brand-0 [&_svg_path]:hover:fill-brand-0 lg-desktop:text-base flex cursor-pointer items-center overflow-hidden text-sm font-[700] leading-[1.4] transition-all duration-[0.4s]',\n { 'text-[#080A0F]': theme === 'light' },\n { 'text-[#F5F6F7]': theme === 'dark' },\n { 'justify-center mt-4': align === 'center' },\n { 'mt-1 laptop:mt-0': align === 'left' },\n className\n )}\n {...(href ? { href } : {})}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${caption}`}\n {...(onClick ? { onClick } : {})}\n >\n <div className=\"truncate whitespace-nowrap\">{extensions?.textLink}</div>\n <div className=\"lg-desktop:size-5 size-4\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100%\" height=\"100%\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path\n d=\"M5.52827 3.52864C5.78862 3.26829 6.21063 3.26829 6.47098 3.52864L10.471 7.52864C10.7313 7.78899 10.7313 8.21099 10.471 8.47134L6.47098 12.4713C6.21063 12.7317 5.78862 12.7317 5.52827 12.4713C5.26792 12.211 5.26792 11.789 5.52827 11.5286L9.05692 7.99999L5.52827 4.47134C5.26792 4.21099 5.26792 3.78899 5.52827 3.52864Z\"\n fill={theme === 'dark' ? '#F5F6F7' : '#080A0F'}\n className=\"transition-all duration-[0.4s]\"\n />\n </svg>\n </div>\n </a>\n )\n}\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(\n ({ data, className, classNames, as = 'h2', weight = 'bold', onButtonClick, ...rest }, ref) => {\n const {\n title,\n titleSize = 4,\n caption,\n subtitle,\n content,\n countdown,\n showCountdown = false,\n theme = 'light',\n extensions,\n align = 'left',\n } = data\n const innerRef = useRef<HTMLDivElement>(null)\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n\n // \u63A7\u5236\u5012\u8BA1\u65F6\u663E\u793A\u72B6\u6001\n const [isCountdownVisible, setIsCountdownVisible] = useState(true)\n\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n // \u66DD\u5149\u57CB\u70B9\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: extractLexicalText(caption) || extractLexicalText(title) || '',\n componentDescription: extractLexicalText(subtitle) || '',\n })\n\n // \u5012\u8BA1\u65F6\u7ED3\u675F\u56DE\u8C03\n const handleCountdownEnd = () => {\n setIsCountdownVisible(false)\n }\n\n // CMS field mapping: new targetDateTime > legacy targetDate\n const countdownEndDate = countdown?.targetDateTime || countdown?.targetDate || ''\n const countdownTz = countdown?.targetDateTime_tz\n // Label mapping: plural keys (Title CMS format) \u2192 atomic Countdown format\n const countdownLabels = countdown?.labels\n ? {\n day: countdown.labels.days || 'Day',\n hour: countdown.labels.hours || 'Hours',\n minute: countdown.labels.minutes || 'Mins',\n second: countdown.labels.seconds || 'Secs',\n }\n : undefined\n\n useEffect(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n function gsapResize() {\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\n if (splitTextInstance.current) {\n splitTextInstance.current.revert()\n }\n if (scrollTriggerRef.current) {\n scrollTriggerRef.current.kill()\n }\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5 + 60}px bottom-=4%`,\n scrub: true,\n invalidateOnRefresh: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length || 1\n const overlap = 0.5\n const interval = 1 / total\n const step = interval * (1 - overlap)\n const lastEnd = (total - 1) * step + interval\n const normalizedProgress = Math.min(1, lastEnd > 0 ? progress / lastEnd : 0)\n words.forEach((word: any, i: number) => {\n const start = i * step\n const width = interval\n let opacity = (normalizedProgress - start) / width\n opacity = Math.max(0, Math.min(1, opacity))\n gsap.set(word, { opacity })\n })\n },\n })\n }\n\n if (inView) {\n gsapResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n <div\n {...rest}\n id={extensions?.id}\n className={cn(\n 'titleBottom title-box flex items-end justify-between gap-2 pb-6',\n className,\n classNames?.wrapper\n )}\n ref={innerRef}\n >\n <div\n ref={inViewRef}\n className={cn('flex-1', classNames?.container, {\n 'aiui-dark': theme === 'dark',\n 'text-center': align === 'center',\n 'text-left': align === 'left',\n })}\n >\n {(caption || title) && (\n <Heading\n ref={titleRef}\n as={as}\n size={titleSize as HeadingProps['size']}\n html={caption || title}\n weight={weight}\n className={cn(titleHeadingVariants({ theme }), classNames?.title)}\n />\n )}\n {subtitle && (\n <Text html={subtitle} as=\"p\" className={cn(subtitleVariants({ theme }), classNames?.subtitle)} />\n )}\n {content && (\n <Text\n html={content}\n as=\"div\"\n size={4}\n className={cn(\n 'title-content text-info-primary desktop:text-base desktop:mt-4 lg-desktop:text-[18px] mt-2 text-[14px] leading-[1.6]',\n classNames?.content\n )}\n />\n )}\n <TitleButton data={data} className={cn({ 'laptop:hidden': align === 'left' }, classNames?.button)} />\n {showCountdown && countdown && isCountdownVisible && (\n <Countdown\n endDate={countdownEndDate}\n endDate_tz={countdownTz}\n timeLabels={countdownLabels}\n showDays={countdown?.showDays}\n showHours={countdown?.showHours}\n showMinutes={countdown?.showMinutes}\n showSeconds={countdown?.showSeconds}\n theme={theme}\n onExpire={handleCountdownEnd}\n hideWhenExpired={true}\n align={align === 'center' ? 'center' : 'left'}\n className={cn('mt-4', classNames?.countdown)}\n />\n )}\n </div>\n <TitleButton\n data={data}\n className={cn('hidden', { ['laptop:flex']: align === 'left' }, classNames?.button)}\n onClick={onButtonClick}\n />\n </div>\n )\n }\n)\n\nTitle.displayName = 'Title'\n\nexport default withLayout(Title)\n"],
|
|
5
|
-
"mappings": "olBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,
|
|
6
|
-
"names": ["Title_exports", "__export", "Title_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_SplitText", "import_ScrollTrigger", "
|
|
4
|
+
"sourcesContent": ["'use client'\nimport React, { useEffect, useRef, useImperativeHandle, useState } from 'react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { cva } from 'class-variance-authority'\nimport { Heading, Text, Countdown, type HeadingProps } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { TitlePropsBase } from './types.js'\n\nexport interface TitleProps extends TitlePropsBase, Omit<React.HTMLAttributes<HTMLDivElement>, 'className' | 'title'> {}\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useInView } from 'react-intersection-observer'\n\nconst componentType = 'link'\nconst componentName = 'title'\n\n/**\n * \u6807\u9898\u6837\u5F0F\u53D8\u4F53\n */\nconst titleHeadingVariants = cva('', {\n variants: {\n theme: {\n light: 'text-[#080A0F]',\n dark: 'text-[#F5F6F7]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n})\n\n/**\n * \u526F\u6807\u9898\u6837\u5F0F\u53D8\u4F53\n */\nconst subtitleVariants = cva(\n 'desktop:text-base desktop:mt-2 lg-desktop:text-[18px] mt-1 text-[14px] font-bold leading-[1.4] tracking-[-0.36px]',\n {\n variants: {\n theme: {\n light: 'text-[#080A0F]',\n dark: 'text-[#F5F6F7]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n }\n)\n\nconst TitleButton = ({\n data,\n onClick,\n className,\n}: {\n data: TitleProps['data']\n onClick?: () => void\n className?: string\n}) => {\n const { theme = 'light', extensions, title, caption, align } = data\n if (!extensions?.textLink) return null\n\n const href = extensions?.link ? trackUrlRef(extensions.link, `${componentType}_${componentName}`) : undefined\n\n return (\n <a\n className={cn(\n { 'aiui-dark': theme === 'dark' },\n 'hover:text-brand-0 [&_svg_path]:hover:fill-brand-0 lg-desktop:text-base flex cursor-pointer items-center overflow-hidden text-sm font-[700] leading-[1.4] transition-all duration-[0.4s]',\n { 'text-[#080A0F]': theme === 'light' },\n { 'text-[#F5F6F7]': theme === 'dark' },\n { 'justify-center mt-4': align === 'center' },\n { 'mt-1 laptop:mt-0': align === 'left' },\n className\n )}\n {...(href ? { href } : {})}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${caption}`}\n {...(onClick ? { onClick } : {})}\n >\n <div className=\"truncate whitespace-nowrap\">{extensions?.textLink}</div>\n <div className=\"lg-desktop:size-5 size-4\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100%\" height=\"100%\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path\n d=\"M5.52827 3.52864C5.78862 3.26829 6.21063 3.26829 6.47098 3.52864L10.471 7.52864C10.7313 7.78899 10.7313 8.21099 10.471 8.47134L6.47098 12.4713C6.21063 12.7317 5.78862 12.7317 5.52827 12.4713C5.26792 12.211 5.26792 11.789 5.52827 11.5286L9.05692 7.99999L5.52827 4.47134C5.26792 4.21099 5.26792 3.78899 5.52827 3.52864Z\"\n fill={theme === 'dark' ? '#F5F6F7' : '#080A0F'}\n className=\"transition-all duration-[0.4s]\"\n />\n </svg>\n </div>\n </a>\n )\n}\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(\n ({ data, className, classNames, as = 'h2', weight = 'bold', onButtonClick, ...rest }, ref) => {\n const {\n title,\n titleSize = 4,\n caption,\n subtitle,\n content,\n countdown,\n showCountdown = false,\n theme = 'light',\n extensions,\n align = 'left',\n } = data\n const innerRef = useRef<HTMLDivElement>(null)\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n\n // \u63A7\u5236\u5012\u8BA1\u65F6\u663E\u793A\u72B6\u6001\n const [isCountdownVisible, setIsCountdownVisible] = useState(true)\n\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n // \u5012\u8BA1\u65F6\u7ED3\u675F\u56DE\u8C03\n const handleCountdownEnd = () => {\n setIsCountdownVisible(false)\n }\n\n // CMS field mapping: new targetDateTime > legacy targetDate\n const countdownEndDate = countdown?.targetDateTime || countdown?.targetDate || ''\n const countdownTz = countdown?.targetDateTime_tz\n // Label mapping: plural keys (Title CMS format) \u2192 atomic Countdown format\n const countdownLabels = countdown?.labels\n ? {\n day: countdown.labels.days || 'Day',\n hour: countdown.labels.hours || 'Hours',\n minute: countdown.labels.minutes || 'Mins',\n second: countdown.labels.seconds || 'Secs',\n }\n : undefined\n\n useEffect(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n function gsapResize() {\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\n if (splitTextInstance.current) {\n splitTextInstance.current.revert()\n }\n if (scrollTriggerRef.current) {\n scrollTriggerRef.current.kill()\n }\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5 + 60}px bottom-=4%`,\n scrub: true,\n invalidateOnRefresh: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length || 1\n const overlap = 0.5\n const interval = 1 / total\n const step = interval * (1 - overlap)\n const lastEnd = (total - 1) * step + interval\n const normalizedProgress = Math.min(1, lastEnd > 0 ? progress / lastEnd : 0)\n words.forEach((word: any, i: number) => {\n const start = i * step\n const width = interval\n let opacity = (normalizedProgress - start) / width\n opacity = Math.max(0, Math.min(1, opacity))\n gsap.set(word, { opacity })\n })\n },\n })\n }\n\n if (inView) {\n gsapResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n <div\n {...rest}\n id={extensions?.id}\n className={cn(\n 'titleBottom title-box flex items-end justify-between gap-2 pb-6',\n className,\n classNames?.wrapper\n )}\n ref={innerRef}\n >\n <div\n ref={inViewRef}\n className={cn('flex-1', classNames?.container, {\n 'aiui-dark': theme === 'dark',\n 'text-center': align === 'center',\n 'text-left': align === 'left',\n })}\n >\n {(caption || title) && (\n <Heading\n ref={titleRef}\n as={as}\n size={titleSize as HeadingProps['size']}\n html={caption || title}\n weight={weight}\n className={cn(titleHeadingVariants({ theme }), classNames?.title)}\n />\n )}\n {subtitle && (\n <Text html={subtitle} as=\"p\" className={cn(subtitleVariants({ theme }), classNames?.subtitle)} />\n )}\n {content && (\n <Text\n html={content}\n as=\"div\"\n size={4}\n className={cn(\n 'title-content text-info-primary desktop:text-base desktop:mt-4 lg-desktop:text-[18px] mt-2 text-[14px] leading-[1.6]',\n classNames?.content\n )}\n />\n )}\n <TitleButton data={data} className={cn({ 'laptop:hidden': align === 'left' }, classNames?.button)} />\n {showCountdown && countdown && isCountdownVisible && (\n <Countdown\n endDate={countdownEndDate}\n endDate_tz={countdownTz}\n timeLabels={countdownLabels}\n showDays={countdown?.showDays}\n showHours={countdown?.showHours}\n showMinutes={countdown?.showMinutes}\n showSeconds={countdown?.showSeconds}\n theme={theme}\n onExpire={handleCountdownEnd}\n hideWhenExpired={true}\n align={align === 'center' ? 'center' : 'left'}\n className={cn('mt-4', classNames?.countdown)}\n />\n )}\n </div>\n <TitleButton\n data={data}\n className={cn('hidden', { ['laptop:flex']: align === 'left' }, classNames?.button)}\n onClick={onButtonClick}\n />\n </div>\n )\n }\n)\n\nTitle.displayName = 'Title'\n\nexport default withLayout(Title)\n"],
|
|
5
|
+
"mappings": "olBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAkEI,IAAAI,EAAA,6BAjEJC,EAAwE,qBACxEC,EAAqB,gBACrBC,EAA0B,+BAC1BC,EAA8B,mCAC9BC,EAAmB,kC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EACjB,OAAQQ,EACR,aAAW,MAAGhB,GAAqB,CAAE,MAAAM,CAAM,CAAC,EAAGQ,GAAY,KAAK,EAClE,EAEDO,MACC,OAAC,QAAK,KAAMA,EAAU,GAAG,IAAI,aAAW,MAAGpB,GAAiB,CAAE,MAAAK,CAAM,CAAC,EAAGQ,GAAY,QAAQ,EAAG,EAEhGQ,MACC,OAAC,QACC,KAAMA,EACN,GAAG,MACH,KAAM,EACN,aAAW,MACT,uHACAR,GAAY,OACd,EACF,KAEF,OAACZ,EAAA,CAAY,KAAMC,EAAM,aAAW,MAAG,CAAE,gBAAiBO,IAAU,MAAO,EAAGI,GAAY,MAAM,EAAG,EAClGU,GAAiBD,GAAaM,MAC7B,OAAC,aACC,QAASK,EACT,WAAYC,EACZ,WAAYC,EACZ,SAAUb,GAAW,SACrB,UAAWA,GAAW,UACtB,YAAaA,GAAW,YACxB,YAAaA,GAAW,YACxB,MAAOjB,EACP,SAAU2B,EACV,gBAAiB,GACjB,MAAOvB,IAAU,SAAW,SAAW,OACvC,aAAW,MAAG,OAAQI,GAAY,SAAS,EAC7C,GAEJ,KACA,OAACZ,EAAA,CACC,KAAMC,EACN,aAAW,MAAG,SAAU,CAAG,cAAgBO,IAAU,MAAO,EAAGI,GAAY,MAAM,EACjF,QAASG,EACX,GACF,CAEJ,CACF,EAEAL,EAAM,YAAc,QAEpB,IAAO3B,MAAQ,cAAW2B,CAAK",
|
|
6
|
+
"names": ["Title_exports", "__export", "Title_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_SplitText", "import_ScrollTrigger", "import_utils", "import_class_variance_authority", "import_components", "import_Styles", "import_trackUrlRef", "import_react_intersection_observer", "componentType", "componentName", "titleHeadingVariants", "subtitleVariants", "TitleButton", "data", "onClick", "className", "theme", "extensions", "title", "caption", "align", "href", "Title", "React", "classNames", "as", "weight", "onButtonClick", "rest", "ref", "titleSize", "subtitle", "content", "countdown", "showCountdown", "innerRef", "titleRef", "splitTextInstance", "scrollTriggerRef", "isCountdownVisible", "setIsCountdownVisible", "inViewRef", "inView", "handleCountdownEnd", "countdownEndDate", "countdownTz", "countdownLabels", "gsapResize", "height", "words", "self", "progress", "total", "overlap", "interval", "step", "lastEnd", "normalizedProgress", "word", "i", "start", "width", "opacity"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var D=Object.defineProperty;var dt=Object.getOwnPropertyDescriptor;var ct=Object.getOwnPropertyNames;var mt=Object.prototype.hasOwnProperty;var ft=(n,
|
|
1
|
+
"use strict";"use client";var D=Object.defineProperty;var dt=Object.getOwnPropertyDescriptor;var ct=Object.getOwnPropertyNames;var mt=Object.prototype.hasOwnProperty;var ft=(n,o)=>{for(var p in o)D(n,p,{get:o[p],enumerable:!0})},ut=(n,o,p,w)=>{if(o&&typeof o=="object"||typeof o=="function")for(let f of ct(o))!mt.call(n,f)&&f!==p&&D(n,f,{get:()=>o[f],enumerable:!(w=dt(o,f))||w.enumerable});return n};var xt=n=>ut(D({},"__esModule",{value:!0}),n);var wt={};ft(wt,{BaseModal:()=>ce.BaseModal,ErrorModal:()=>pe.ErrorModal,MyRewardsModal:()=>le.MyRewardsModal,RulesModal:()=>ae.RulesModal,ShareModal:()=>de.ShareModal,WheelLottery:()=>B,WinnerModal:()=>ie.WinnerModal,default:()=>ht});module.exports=xt(wt);var t=require("react/jsx-runtime"),e=require("react"),u=require("../../helpers/index.js"),x=require("./types.js"),N=require("../../components/grid.js"),Z=require("./Wheel.js"),q=require("../LotteryShared/PrizePool.js"),ee=require("../LotteryShared/ChanceMethods.js"),te=require("../LotteryShared/WinnerModal.js"),oe=require("../LotteryShared/RulesModal.js"),re=require("../LotteryShared/MyRewardsModal.js"),F=require("../LotteryShared/ErrorModal.js"),ne=require("../LotteryShared/ShareModal.js"),se=require("../../shared/Styles.js"),ie=require("../LotteryShared/WinnerModal.js"),ae=require("../LotteryShared/RulesModal.js"),le=require("../LotteryShared/MyRewardsModal.js"),pe=require("../LotteryShared/ErrorModal.js"),de=require("../LotteryShared/ShareModal.js"),ce=require("../LotteryShared/BaseModal.js");const B=(0,e.forwardRef)(({prizes:n,theme:o,winningPrizeId:p,spinDuration:w=x.DEFAULT_WHEEL_CONFIG.spinDuration,wheelBackgroundImage:f,pointerImage:me,chanceMethods:U=x.DEFAULT_CHANCE_METHODS,chanceTitle:fe=x.DEFAULT_WHEEL_CONFIG.chanceTitle,chanceSubtitle:ue,chanceFooterNote:xe,chanceMethodsText:v,mechanismType:he,inputConfig:we,winningInfos:ge=[],winnerNameTemplate:ye,prizesTitle:Te,onSpinStart:I,onSpinEnd:L,onSpinError:O,winnerModalConfig:s,rulesModalConfig:be={},myRewardsModalConfig:Se={},errorModalConfig:h={},shareModalConfig:g={},userData:d,onLoginRequired:C,onCopyCode:We,opportunitiesText:j=["Number of draws remaining today:"],className:Me},Pe)=>{const{rulesData:y,rulesText:G="Rules"}=be,{rewardsData:A,myRewardsText:H="My Rewards",codeText:ze="CODE:",copyText:_="COPY",copiedText:K="COPIED",prizeText:Ee="Prize time:",emptyText:Ne,copyError:ve,availableText:Ce,usedStatusText:Re,expiredText:Ie,notFoundText:Le}=Se,Ae=v?.completedText,ke=v?.usedText,T=d?.isLoggedIn??!1,$=d?.availableChances??0,De=T&&$<=0,[i,c]=(0,e.useState)(x.INITIAL_WHEEL_STATE),[Fe,b]=(0,e.useState)(!1),[Be,S]=(0,e.useState)(!1),[Ue,W]=(0,e.useState)(!1),[Oe,M]=(0,e.useState)(!1),[je,P]=(0,e.useState)(!1),[Ge,z]=(0,e.useState)(!1),[He,V]=(0,e.useState)(""),[_e,Ke]=(0,e.useState)(),[$e,Ve]=(0,e.useState)(),[Ye,Je]=(0,e.useState)(),[Qe,Xe]=(0,e.useState)(),[Ze,qe]=(0,e.useState)(),[a,et]=(0,e.useState)(),R=(0,e.useRef)(null);(0,e.useImperativeHandle)(Pe,()=>({showError:({message:r,title:l,confirmText:E})=>{V(r),Ke(l),Ve(E),M(!0)},hideError:()=>{M(!1)},showNoWin:r=>{Je(r?.title),Xe(r?.message),qe(r?.confirmText),P(!0)},hideNoWin:()=>{P(!1)},showWinner:(r,l)=>{c(E=>({...E,winningPrize:r})),et(l),b(!0)},hideWinner:()=>{b(!1)},showRules:()=>{S(!0)},hideRules:()=>{S(!1)},showRewards:()=>{W(!0)},hideRewards:()=>{W(!1)},showShare:()=>{z(!0)},hideShare:()=>{z(!1)},hideAllModals:()=>{b(!1),S(!1),W(!1),M(!1),P(!1),z(!1)}}),[]),(0,e.useEffect)(()=>{},[n,p]),(0,e.useEffect)(()=>()=>{R.current!==null&&cancelAnimationFrame(R.current)},[]);const Y=(0,e.useCallback)(async()=>{if(!i.isSpinning){if(!d?.isLoggedIn){C?.();return}if(!(d.availableChances<=0)){c(r=>({...r,isSpinning:!0,isButtonDisabled:!0}));try{let r=p;I&&(r=await I());const l=n.find(m=>m.prizeKey===r)||n[0],E=n.findIndex(m=>m.prizeKey===l.prizeKey),nt=360/n.length,st=E*nt,J=3*360+(360-st);await new Promise(m=>setTimeout(m,1500)),c(m=>({...m,isFinished:!0,currentRotation:0}));const it=Date.now(),Q=()=>{const at=Date.now()-it,X=Math.min(at/w,1),lt=1-Math.pow(1-X,3),pt=J*lt;c(k=>({...k,currentRotation:pt})),X<1?R.current=requestAnimationFrame(Q):(c(k=>({...k,isSpinning:!1,isButtonDisabled:!0,winningPrize:l,currentRotation:J})),L?L?.(l):setTimeout(()=>{l.prizeKey==="try-again"?P(!0):b(!0)},500))};R.current=requestAnimationFrame(Q)}catch(r){c(l=>({...l,isSpinning:!1,isButtonDisabled:!1})),V(r.message||"An error occurred"),M(!0),O?.(r),console.error("\u62BD\u5956\u63A5\u53E3\u8C03\u7528\u5931\u8D25:",r)}}}},[i.isSpinning,n,p,w,I,L,O,d,C]),tt=(0,e.useCallback)(()=>{if(T){Y();return}C?.()},[Y,T,C]),ot=(0,e.useCallback)(()=>{b(!1),c(r=>({...r,isButtonDisabled:!1,isFinished:!1}))},[]),rt=(0,e.useCallback)(()=>{P(!1),c(r=>({...r,isButtonDisabled:!1,isFinished:!1}))},[]);return(0,t.jsxs)("div",{className:(0,u.cn)("wheel-lottery-container","w-full",o==="dark"?"aiui-dark":"",Me),children:[(0,t.jsxs)("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:[i.isSpinning&&"\u62BD\u5956\u8FDB\u884C\u4E2D...",i.winningPrize&&!i.isSpinning&&`\u5DF2\u4E2D\u5956: ${i.winningPrize.name}`]}),(0,t.jsxs)(N.Grid,{className:(0,u.cn)("wheel-lottery-main","tablet:mb-4 mb-3"),children:[(0,t.jsx)(N.GridItem,{span:7,className:(0,u.cn)("wheel-section","relative flex w-full flex-1 items-center justify-center overflow-hidden","rounded-box","laptop:min-h-[288px] min-h-[240px]","lg-desktop:aspect-w-[964] lg-desktop:aspect-h-[480]","desktop:aspect-w-[759] desktop:aspect-h-[384]","laptop:aspect-w-[516] laptop:aspect-h-[288]","l-tablet:col-span-12","l-tablet:mb-3",o==="dark"?"bg-[#1E2024]":"bg-[#EAEAEC]"),children:(0,t.jsxs)("div",{className:(0,u.cn)("w-full px-[16px] pt-[16px]","lg-desktop:pb-[32px] lg-desktop:px-[32px]","desktop:pt-[24px] desktop:px-[24px]","laptop:pt-[16px] laptop:px-[16px]","tablet:px-[24px]","l-tablet:absolute l-tablet:top-0 l-tablet:inset-x-0 l-tablet:z-10"),children:[(0,t.jsxs)("div",{className:"tablet:max-h-[24px] relative z-10 mb-2 flex max-h-[40px] w-full flex-wrap items-center justify-between gap-3",children:[(0,t.jsx)("div",{children:T&&(0,t.jsxs)("p",{className:"text-info-primary font-[700]",children:[j?.[0],(0,t.jsx)("span",{className:"ml-1 text-[#FF6B35]",children:$}),j?.[1]||""]})}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[y&&y.length>0&&(0,t.jsx)("button",{onClick:()=>S(!0),className:"cursor-pointer touch-manipulation",type:"button",children:(0,t.jsx)("span",{className:"text-info-primary font-[700] underline",children:G})}),d?.isLoggedIn&&A&&(0,t.jsx)("button",{onClick:()=>W(!0),className:"cursor-pointer touch-manipulation whitespace-nowrap",type:"button",children:(0,t.jsx)("span",{className:"text-info-primary font-[700] underline",children:H})})]})]}),(0,t.jsx)(Z.Wheel,{theme:o,prizes:n,rotation:i.currentRotation,isSpinning:i.isSpinning,isFinished:i.isFinished,isButtonDisabled:i.isButtonDisabled||!T||De,userData:d,onGoClick:tt,wheelBackgroundImage:f,pointerImage:me})]})}),U.length>0&&(0,t.jsx)(N.GridItem,{span:5,className:(0,u.cn)("info-section","rounded-box","relative flex flex-col overflow-hidden","lg-desktop:aspect-w-[684] lg-desktop:aspect-h-[480]","desktop:aspect-w-[536] desktop:aspect-h-[384]","laptop:aspect-w-[364] laptop:aspect-h-[288]","l-tablet:min-h-[280px] laptop:max-h-[320px]","w-full","l-tablet:col-span-12",o==="dark"?"bg-[#1E2024]":"bg-[#EAEAEC]"),children:(0,t.jsx)(ee.ChanceMethods,{theme:o,userData:d,methods:U,title:fe,subtitle:ue,footerNote:xe,onOpenShareModal:()=>z(!0),chanceBadgeText:v?.chanceBadgeText,completedText:Ae,usedText:ke,loadingText:v?.loadingText,mechanismType:he,inputConfig:we})})]}),(0,t.jsx)("div",{className:(0,u.cn)("wheel-lottery-footer","rounded-box","flex flex-col overflow-hidden",o==="dark"?"bg-[#1E2024]":"bg-[#EAEAEC]"),children:(0,t.jsx)(q.PrizePool,{theme:o,prizes:n,title:Te,winningInfos:ge,winnerNameTemplate:ye})}),(0,t.jsx)(te.WinnerModal,{isOpen:Fe,prize:i.winningPrize,title:a?.title||s?.title,prizeTitle:a?.prizeTitle||s?.prizeTitle,prizeImage:a?.prizeImage||s?.prizeImage,prizeDescription:a?.prizeDescription||s?.prizeDescription,winnerNote:a?.winnerNote??i.winningPrize?.winnerModalConfig?.winnerNote??s?.winnerNote,learnMoreUrl:a?.learnMoreUrl||i.winningPrize?.winnerModalConfig?.learnMoreUrl||s?.learnMoreUrl,learnMoreText:a?.learnMoreText||i.winningPrize?.winnerModalConfig?.learnMoreText||s?.learnMoreText,couponCode:a?.couponCode||s?.couponCode,expiresAt:a?.expiresAt||s?.expiresAt,expiresAtLabel:a?.expiresAtLabel||s?.expiresAtLabel,couponDiscount:a?.couponDiscount||s?.couponDiscount,couponUnit:a?.couponUnit||s?.couponUnit,confirmText:a?.confirmText||i.winningPrize?.winnerModalConfig?.confirmText||s?.confirmText,confirmUrl:a?.confirmUrl||i.winningPrize?.winnerModalConfig?.confirmUrl||s?.confirmUrl,copyText:a?.copyText||s?.copyText||_,copiedText:a?.copiedText||s?.copiedText||K,onClose:ot,theme:o}),y&&y.length>0&&(0,t.jsx)(oe.RulesModal,{title:G,isOpen:Be,onClose:()=>S(!1),rules:y,theme:o}),A&&(0,t.jsx)(re.MyRewardsModal,{isOpen:Ue,onClose:()=>W(!1),rewards:A,onCopyCode:We,codeText:ze,copyText:_,copiedText:K,prizeText:Ee,emptyText:Ne,copyError:ve,availableText:Ce,usedStatusText:Re,expiredText:Ie,notFoundText:Le,theme:o,title:H}),(0,t.jsx)(F.ErrorModal,{isOpen:Oe,onClose:()=>M(!1),title:_e||h?.title,message:He||h?.message,confirmText:$e||h?.confirmText,theme:o}),(0,t.jsx)(F.ErrorModal,{isOpen:je,onClose:rt,title:Ye||h?.title,message:Qe||h?.message,confirmText:Ze||h?.confirmText,theme:o}),(0,t.jsx)(ne.ShareModal,{isOpen:Ge,onClose:()=>z(!1),title:g?.title,subtitle:g?.subtitle,note:g?.note,platforms:g?.platforms,onShareSuccess:g?.onShareSuccess,theme:o})]})});B.displayName="WheelLottery";var ht=(0,se.withLayout)(B);
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/WheelLottery/index.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * WheelLottery - \u5927\u8F6C\u76D8\u62BD\u5956\u7EC4\u4EF6\n *\n * \u7528\u4E8E\u8425\u9500\u6D3B\u52A8\u7684\u4EA4\u4E92\u5F0F\u62BD\u5956\u8F6C\u76D8\uFF0C\u652F\u6301\u591A\u54C1\u724C\u4E3B\u9898\u548C\u54CD\u5E94\u5F0F\u5E03\u5C40\u3002\n *\n * @module WheelLottery\n * @date 2025-12-17\n */\n\n'use client'\n\nimport { useState, useCallback, useRef, useEffect, useImperativeHandle, forwardRef } from 'react'\nimport { cn } from '../../helpers/index.js'\nimport { DEFAULT_WHEEL_CONFIG, DEFAULT_CHANCE_METHODS, INITIAL_WHEEL_STATE } from './types.js'\nimport { Grid, GridItem } from '../../components/grid.js'\nimport { Wheel } from './Wheel.js'\nimport { PrizePool } from '../LotteryShared/PrizePool.js'\nimport { ChanceMethods } from '../LotteryShared/ChanceMethods.js'\nimport { WinnerModal } from '../LotteryShared/WinnerModal.js'\nimport { RulesModal } from '../LotteryShared/RulesModal.js'\nimport { MyRewardsModal } from '../LotteryShared/MyRewardsModal.js'\nimport { ErrorModal } from '../LotteryShared/ErrorModal.js'\nimport { ShareModal } from '../LotteryShared/ShareModal.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nimport type { WheelLotteryProps, WheelState, WheelLotteryHandle, WinnerModalConfig } from './types.js'\n\n// ============================================================================\n// \u4E3B\u7EC4\u4EF6\n// ============================================================================\n\n/**\n * WheelLottery \u7EC4\u4EF6\n *\n * @example\n * ```tsx\n * // \u57FA\u7840\u4F7F\u7528\n * <WheelLottery\n * prizes={prizes}\n * winningPrizeId=\"prize-003\"\n * onSpinEnd={(prize) => alert(`You won ${prize.name}`)}\n * />\n *\n * // \u4F7F\u7528 ref \u63A7\u5236\u5F39\u7A97\n * const lotteryRef = useRef<WheelLotteryHandle>(null)\n *\n * <WheelLottery ref={lotteryRef} prizes={prizes} />\n *\n * // \u5916\u90E8\u89E6\u53D1\u5F39\u7A97\n * lotteryRef.current?.showError({\n * title: 'Error',\n * message: 'Something went wrong'\n * })\n * ```\n */\nexport const WheelLottery = forwardRef<WheelLotteryHandle, WheelLotteryProps>(\n (\n {\n prizes,\n theme,\n winningPrizeId,\n spinDuration = DEFAULT_WHEEL_CONFIG.spinDuration,\n wheelBackgroundImage,\n pointerImage,\n chanceMethods = DEFAULT_CHANCE_METHODS,\n chanceTitle = DEFAULT_WHEEL_CONFIG.chanceTitle,\n chanceSubtitle,\n chanceFooterNote,\n chanceMethodsText,\n mechanismType,\n inputConfig,\n winningInfos = [],\n winnerNameTemplate,\n prizesTitle,\n onSpinStart,\n onSpinEnd,\n onSpinError,\n winnerModalConfig,\n rulesModalConfig = {},\n myRewardsModalConfig = {},\n errorModalConfig = {},\n shareModalConfig = {},\n userData,\n onLoginRequired,\n onCopyCode,\n opportunitiesText = ['Number of draws remaining today:'],\n className,\n },\n ref\n ) => {\n const { rulesData, rulesText = 'Rules' } = rulesModalConfig\n const {\n rewardsData,\n myRewardsText = 'My Rewards',\n codeText = 'CODE:',\n copyText = 'COPY',\n copiedText = 'COPIED',\n prizeText = 'Prize time:',\n emptyText,\n copyError,\n availableText,\n usedStatusText,\n expiredText,\n notFoundText,\n } = myRewardsModalConfig\n const completedText = chanceMethodsText?.completedText\n const usedText = chanceMethodsText?.usedText\n const isLoggedIn = userData?.isLoggedIn ?? false\n const availableChances = userData?.availableChances ?? 0\n const isNoChancesState = isLoggedIn && availableChances <= 0\n // ==========================================================================\n // State \u7BA1\u7406\n // ==========================================================================\n\n const [wheelState, setWheelState] = useState<WheelState>(INITIAL_WHEEL_STATE)\n const [showWinnerModal, setShowWinnerModal] = useState(false)\n const [showRulesModal, setShowRulesModal] = useState(false)\n const [showRewardsModal, setShowRewardsModal] = useState(false)\n const [showErrorModal, setShowErrorModal] = useState(false)\n const [showNoWinModal, setShowNoWinModal] = useState(false)\n const [showShareModal, setShowShareModal] = useState(false)\n const [errorMessage, setErrorMessage] = useState('')\n const [errorTitle, setErrorTitle] = useState<string | undefined>()\n const [errorConfirmText, setErrorConfirmText] = useState<string | undefined>()\n const [noWinTitle, setNoWinTitle] = useState<string | undefined>()\n const [noWinMessage, setNoWinMessage] = useState<string | undefined>()\n const [noWinConfirmText, setNoWinConfirmText] = useState<string | undefined>()\n const [externalWinnerConfig, setExternalWinnerConfig] = useState<Partial<WinnerModalConfig> | undefined>()\n const animationRef = useRef<number | null>(null)\n\n // ==========================================================================\n // Imperative Handle - \u66B4\u9732\u65B9\u6CD5\u7ED9\u7236\u7EC4\u4EF6\n // ==========================================================================\n\n useImperativeHandle(\n ref,\n () => ({\n showError: ({ message, title, confirmText }) => {\n setErrorMessage(message)\n setErrorTitle(title)\n setErrorConfirmText(confirmText)\n setShowErrorModal(true)\n },\n hideError: () => {\n setShowErrorModal(false)\n },\n showNoWin: config => {\n setNoWinTitle(config?.title)\n setNoWinMessage(config?.message)\n setNoWinConfirmText(config?.confirmText)\n setShowNoWinModal(true)\n },\n hideNoWin: () => {\n setShowNoWinModal(false)\n },\n showWinner: (prize, config) => {\n setWheelState(prev => ({ ...prev, winningPrize: prize }))\n setExternalWinnerConfig(config)\n setShowWinnerModal(true)\n },\n hideWinner: () => {\n setShowWinnerModal(false)\n },\n showRules: () => {\n setShowRulesModal(true)\n },\n hideRules: () => {\n setShowRulesModal(false)\n },\n showRewards: () => {\n setShowRewardsModal(true)\n },\n hideRewards: () => {\n setShowRewardsModal(false)\n },\n showShare: () => {\n setShowShareModal(true)\n },\n hideShare: () => {\n setShowShareModal(false)\n },\n hideAllModals: () => {\n setShowWinnerModal(false)\n setShowRulesModal(false)\n setShowRewardsModal(false)\n setShowErrorModal(false)\n setShowNoWinModal(false)\n setShowShareModal(false)\n },\n }),\n []\n )\n\n // ==========================================================================\n // Props \u9A8C\u8BC1\uFF08\u5F00\u53D1\u73AF\u5883\uFF09\n // ==========================================================================\n\n useEffect(() => {\n if (process.env.NODE_ENV === 'development' && prizes) {\n if (prizes.length !== 8) {\n console.warn(\n `WheelLottery expects exactly 8 prizes, got ${prizes.length}. The component may not render correctly.`\n )\n }\n\n if (winningPrizeId && !prizes.find(p => p.prizeKey === winningPrizeId)) {\n console.warn(`WheelLottery: winningPrizeId \"${winningPrizeId}\" not found in prizes array.`)\n }\n }\n }, [prizes, winningPrizeId])\n\n // ==========================================================================\n // \u6E05\u7406\u52A8\u753B\n // ==========================================================================\n\n useEffect(() => {\n return () => {\n // \u7EC4\u4EF6\u5378\u8F7D\u65F6\u53D6\u6D88\u52A8\u753B\u5E27\n if (animationRef.current !== null) {\n cancelAnimationFrame(animationRef.current)\n }\n }\n }, [])\n\n // ==========================================================================\n // \u62BD\u5956\u903B\u8F91\n // ==========================================================================\n\n /**\n * \u5F00\u59CB\u62BD\u5956 - \u652F\u6301\u5F02\u6B65\u63A5\u53E3\u8C03\u7528\n * \u5229\u7528\u521D\u59CB\u6162\u901F\u65CB\u8F6C\uFF0C\u70B9\u51FB\u540E\u8FDB\u5165\u5FEB\u901F\u65CB\u8F6C\u72B6\u6001\uFF0C\u63A5\u53E3\u8FD4\u56DE\u540E\u51CF\u901F\u505C\u6B62\n */\n const handleSpinStart = useCallback(async () => {\n if (wheelState.isSpinning) return\n\n // \u68C0\u67E5\u7528\u6237\u662F\u5426\u5DF2\u767B\u5F55\n if (!userData?.isLoggedIn) {\n onLoginRequired?.()\n return\n }\n\n // \u2705 \u6B21\u6570\u4E3A 0 \u65F6\uFF0C\u6309\u94AE\u5DF2\u88AB\u7981\u7528\uFF0C\u8FD9\u91CC\u4E0D\u9700\u8981\u989D\u5916\u68C0\u67E5\n // \u9632\u5FA1\u6027\u7F16\u7A0B\uFF1A\u5982\u679C\u4ECD\u7136\u89E6\u53D1\uFF0C\u76F4\u63A5\u8FD4\u56DE\n if (userData.availableChances <= 0) {\n return\n }\n\n // \u8FDB\u5165\u5FEB\u901F\u65CB\u8F6C\u72B6\u6001\uFF08\u521D\u59CB\u6162\u901F\u65CB\u8F6C\u4F1A\u81EA\u52A8\u53D8\u4E3A\u5FEB\u901F\u65CB\u8F6C\uFF09\n setWheelState(prev => ({\n ...prev,\n isSpinning: true,\n isButtonDisabled: true,\n }))\n\n try {\n // \u8C03\u7528\u5916\u90E8\u63A5\u53E3\u83B7\u53D6\u4E2D\u5956\u7ED3\u679C\n let finalWinningPrizeId = winningPrizeId\n\n if (onSpinStart) {\n // \u7B49\u5F85\u63A5\u53E3\u8FD4\u56DE\u4E2D\u5956 ID\uFF08\u63A5\u53E3\u65F6\u95F4\u4E0D\u56FA\u5B9A\uFF0C1-30s\uFF09\n // \u5728\u6B64\u671F\u95F4\uFF0C\u8F6C\u76D8\u4F1A\u4FDD\u6301\u5FEB\u901F\u65CB\u8F6C\uFF08\u7531 CSS \u52A8\u753B\u63A7\u5236\uFF09\n finalWinningPrizeId = await onSpinStart()\n }\n\n // \u786E\u5B9A\u4E2D\u5956\u5956\u54C1\n const winningPrize = prizes.find(p => p.prizeKey === finalWinningPrizeId) || prizes[0]\n const winningIndex = prizes.findIndex(p => p.prizeKey === winningPrize.prizeKey)\n\n // \u8BA1\u7B97\u76EE\u6807\u89D2\u5EA6\n const degreesPerPrize = 360 / prizes.length\n const basePrizeAngle = winningIndex * degreesPerPrize\n // \u81F3\u5C11\u65CB\u8F6C 3 \u5708\uFF081080\u5EA6\uFF09+ \u76EE\u6807\u89D2\u5EA6\n const minRotations = 3\n const targetAngle = minRotations * 360 + (360 - basePrizeAngle)\n\n // \u63A5\u53E3\u8FD4\u56DE\u540E\uFF0C\u7B49\u5F85 1.5s \u518D\u5F00\u59CB\u505C\u6B62\u52A8\u753B\n await new Promise(resolve => setTimeout(resolve, 1500))\n\n // \u7ACB\u5373\u8FDB\u5165\u51CF\u901F\u72B6\u6001\uFF0C\u505C\u6B62 CSS \u5FAA\u73AF\u52A8\u753B\n setWheelState(prev => ({\n ...prev,\n isFinished: true,\n currentRotation: 0, // \u4ECE 0 \u5EA6\u5F00\u59CB\u51CF\u901F\u52A8\u753B\n }))\n\n // \u5F00\u59CB\u505C\u6B62\u65CB\u8F6C\u52A8\u753B\n const startTime = Date.now()\n\n const animate = () => {\n const now = Date.now()\n const elapsed = now - startTime\n const progress = Math.min(elapsed / spinDuration, 1)\n\n // \u5E94\u7528 ease-out \u7F13\u52A8\u51FD\u6570\n const eased = 1 - Math.pow(1 - progress, 3)\n\n // \u8BA1\u7B97\u5F53\u524D\u65CB\u8F6C\u89D2\u5EA6\n const currentRotation = targetAngle * eased\n\n // \u66F4\u65B0\u72B6\u6001\n setWheelState(prev => ({\n ...prev,\n currentRotation,\n }))\n\n // \u7EE7\u7EED\u52A8\u753B\u6216\u7ED3\u675F\n if (progress < 1) {\n animationRef.current = requestAnimationFrame(animate)\n } else {\n // \u52A8\u753B\u7ED3\u675F - \u4FDD\u6301\u6309\u94AE\u7981\u7528\u72B6\u6001,\u76F4\u5230\u5F39\u7A97\u5173\u95ED\n setWheelState(prev => ({\n ...prev,\n isSpinning: false,\n isButtonDisabled: true,\n winningPrize,\n currentRotation: targetAngle,\n }))\n\n // \u5EF6\u8FDF\u663E\u793A\u5F39\u7A97\uFF08500ms\u540E\uFF09\n if (onSpinEnd) {\n onSpinEnd?.(winningPrize)\n } else {\n setTimeout(() => {\n // \u68C0\u67E5\u662F\u5426\u672A\u4E2D\u5956\uFF08try-again\uFF09\n if (winningPrize.prizeKey === 'try-again') {\n // \u672A\u4E2D\u5956\uFF0C\u663E\u793A ErrorModal\n setShowNoWinModal(true)\n } else {\n // \u4E2D\u5956\uFF0C\u663E\u793A WinnerModal\n setShowWinnerModal(true)\n }\n }, 500)\n }\n }\n }\n\n // \u542F\u52A8\u505C\u6B62\u52A8\u753B\n animationRef.current = requestAnimationFrame(animate)\n } catch (error) {\n // \u63A5\u53E3\u62A5\u9519\uFF0C\u6062\u590D\u5230\u521D\u59CB\u6162\u901F\u65CB\u8F6C\u72B6\u6001\n setWheelState(prev => ({\n ...prev,\n isSpinning: false,\n isButtonDisabled: false,\n }))\n\n // \u663E\u793A\u9519\u8BEF\u5F39\u7A97\n setErrorMessage((error as Error).message || 'An error occurred')\n setShowErrorModal(true)\n\n // \u89E6\u53D1\u9519\u8BEF\u56DE\u8C03\n onSpinError?.(error as Error)\n\n console.error('\u62BD\u5956\u63A5\u53E3\u8C03\u7528\u5931\u8D25:', error)\n }\n }, [\n wheelState.isSpinning,\n prizes,\n winningPrizeId,\n spinDuration,\n onSpinStart,\n onSpinEnd,\n onSpinError,\n userData,\n onLoginRequired,\n ])\n\n const handleWheelGoClick = useCallback(() => {\n if (isLoggedIn) {\n void handleSpinStart()\n return\n }\n\n onLoginRequired?.()\n }, [handleSpinStart, isLoggedIn, onLoginRequired])\n\n // ==========================================================================\n // \u5F39\u7A97\u5173\u95ED\u5904\u7406\n // ==========================================================================\n\n /**\n * \u5173\u95ED\u4E2D\u5956\u5F39\u7A97\u5E76\u91CD\u7F6E\u8F6C\u76D8\u72B6\u6001\n */\n const handleCloseWinnerModal = useCallback(() => {\n setShowWinnerModal(false)\n // \u91CD\u7F6E\u8F6C\u76D8\u72B6\u6001,\u5141\u8BB8\u4E0B\u6B21\u62BD\u5956\n setWheelState(prev => ({\n ...prev,\n isButtonDisabled: false,\n isFinished: false, // \u91CD\u7F6E\u4E3A\u672A\u5B8C\u6210,\u6062\u590D\u521D\u59CB\u65CB\u8F6C\u52A8\u753B\n }))\n }, [])\n\n /**\n * \u5173\u95ED\u672A\u4E2D\u5956\u5F39\u7A97\u5E76\u91CD\u7F6E\u8F6C\u76D8\u72B6\u6001\n */\n const handleCloseNoWinModal = useCallback(() => {\n setShowNoWinModal(false)\n // \u91CD\u7F6E\u8F6C\u76D8\u72B6\u6001,\u5141\u8BB8\u4E0B\u6B21\u62BD\u5956\n setWheelState(prev => ({\n ...prev,\n isButtonDisabled: false,\n isFinished: false, // \u91CD\u7F6E\u4E3A\u672A\u5B8C\u6210,\u6062\u590D\u521D\u59CB\u65CB\u8F6C\u52A8\u753B\n }))\n }, [])\n\n // ==========================================================================\n // \u6E32\u67D3\n // ==========================================================================\n\n return (\n <div className={cn('wheel-lottery-container', 'w-full', theme === 'dark' ? 'aiui-dark' : '', className)}>\n {/* ARIA Live Region - \u5C4F\u5E55\u9605\u8BFB\u5668\u72B6\u6001\u64AD\u62A5 */}\n <div role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" className=\"sr-only\">\n {wheelState.isSpinning && '\u62BD\u5956\u8FDB\u884C\u4E2D...'}\n {wheelState.winningPrize && !wheelState.isSpinning && `\u5DF2\u4E2D\u5956: ${wheelState.winningPrize.name}`}\n </div>\n\n {/* \u4E3B\u5185\u5BB9\u533A - \u54CD\u5E94\u5F0F\u4E24\u680F/\u5355\u680F\u5E03\u5C40 */}\n <Grid className={cn('wheel-lottery-main', 'tablet:mb-4 mb-3')}>\n {/* \u5DE6\u4FA7\uFF1A\u8F6C\u76D8\u533A\u57DF */}\n <GridItem\n span={7}\n className={cn(\n 'wheel-section',\n 'relative flex w-full flex-1 items-center justify-center overflow-hidden',\n 'rounded-box',\n // \u79FB\u52A8\u7AEF\uFF08<=1024px\uFF09\u4F7F\u7528min-h\uFF0C\u684C\u9762\u7AEF\u4F7F\u7528aspect ratio\n 'laptop:min-h-[288px] min-h-[240px]',\n 'lg-desktop:aspect-w-[964] lg-desktop:aspect-h-[480]',\n 'desktop:aspect-w-[759] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[516] laptop:aspect-h-[288]',\n 'l-tablet:col-span-12',\n // \u79FB\u52A8\u7AEF\u5E95\u90E8\u95F4\u8DDD\n 'l-tablet:mb-3',\n theme === 'dark' ? 'bg-[#1E2024]' : 'bg-[#EAEAEC]'\n )}\n >\n <div\n className={cn(\n 'w-full px-[16px] pt-[16px]',\n 'lg-desktop:pb-[32px] lg-desktop:px-[32px]',\n 'desktop:pt-[24px] desktop:px-[24px]',\n 'laptop:pt-[16px] laptop:px-[16px]',\n 'tablet:px-[24px]',\n // \u79FB\u52A8\u7AEF(<=1024px)\u65F6\u4F7F\u7528\u7EDD\u5BF9\u5B9A\u4F4D\u8986\u76D6\u5728\u8F6C\u76D8\u80CC\u666F\u4E0A\n 'l-tablet:absolute l-tablet:top-0 l-tablet:inset-x-0 l-tablet:z-10'\n )}\n >\n {/* \u9876\u90E8\u4FE1\u606F\u680F\uFF1A\u5DE6\u4FA7\u673A\u4F1A\u8FDB\u5EA6\uFF0C\u53F3\u4FA7\u94FE\u63A5 */}\n <div className=\"tablet:max-h-[24px] relative z-10 mb-2 flex max-h-[40px] w-full flex-wrap items-center justify-between gap-3\">\n {/* \u5DE6\u4FA7\uFF1A\u673A\u4F1A\u5C55\u793A - \u4EC5\u767B\u5F55\u65F6\u663E\u793A */}\n <div>\n {isLoggedIn && (\n <p className=\"text-info-primary font-[700]\">\n {opportunitiesText?.[0]}\n <span className=\"ml-1 text-[#FF6B35]\">{availableChances}</span>\n {opportunitiesText?.[1] || ''}\n </p>\n )}\n </div>\n {/* \u53F3\u4FA7\uFF1ARules \u548C My Rewards \u6309\u94AE */}\n <div className=\"flex items-center gap-4\">\n {rulesData && rulesData.length > 0 && (\n <button\n onClick={e => {\n e.stopPropagation()\n setShowRulesModal(true)\n }}\n className=\"cursor-pointer touch-manipulation\"\n type=\"button\"\n >\n <span className=\"text-info-primary font-[700] underline\">{rulesText}</span>\n </button>\n )}\n {/* My Rewards \u6309\u94AE - \u4EC5\u767B\u5F55\u65F6\u663E\u793A */}\n {userData?.isLoggedIn && rewardsData && (\n <button\n onClick={e => {\n e.stopPropagation()\n setShowRewardsModal(true)\n }}\n className=\"cursor-pointer touch-manipulation whitespace-nowrap\"\n type=\"button\"\n >\n <span className=\"text-info-primary font-[700] underline\">{myRewardsText}</span>\n </button>\n )}\n </div>\n </div>\n {/* \u8F6C\u76D8\u7EC4\u4EF6 */}\n <Wheel\n theme={theme}\n prizes={prizes}\n rotation={wheelState.currentRotation}\n isSpinning={wheelState.isSpinning}\n isFinished={wheelState.isFinished}\n isButtonDisabled={wheelState.isButtonDisabled || !isLoggedIn || isNoChancesState}\n userData={userData}\n onGoClick={handleWheelGoClick}\n wheelBackgroundImage={wheelBackgroundImage}\n pointerImage={pointerImage}\n />\n </div>\n </GridItem>\n\n {/* \u53F3\u4FA7\uFF1A\u83B7\u53D6\u673A\u4F1A\u533A\u57DF */}\n {chanceMethods.length > 0 && (\n <GridItem\n span={5}\n className={cn(\n 'info-section',\n 'rounded-box',\n 'relative flex flex-col overflow-hidden',\n 'lg-desktop:aspect-w-[684] lg-desktop:aspect-h-[480]',\n 'desktop:aspect-w-[536] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[364] laptop:aspect-h-[288]',\n // \u79FB\u52A8\u7AEF\u4F7F\u7528min-h\u800C\u4E0D\u662Fmax-h\uFF0C\u786E\u4FDD\u5185\u5BB9\u5B8C\u6574\u663E\u793A\n 'l-tablet:min-h-[280px] laptop:max-h-[320px]',\n 'w-full',\n 'l-tablet:col-span-12',\n theme === 'dark' ? 'bg-[#1E2024]' : 'bg-[#EAEAEC]'\n )}\n >\n <ChanceMethods\n theme={theme}\n userData={userData}\n methods={chanceMethods}\n title={chanceTitle}\n subtitle={chanceSubtitle}\n footerNote={chanceFooterNote}\n onOpenShareModal={() => setShowShareModal(true)}\n chanceBadgeText={chanceMethodsText?.chanceBadgeText}\n completedText={completedText}\n usedText={usedText}\n loadingText={chanceMethodsText?.loadingText}\n mechanismType={mechanismType}\n inputConfig={inputConfig}\n />\n </GridItem>\n )}\n </Grid>\n\n {/* \u5E95\u90E8\u533A\u57DF\uFF1A\u5956\u54C1\u6C60(\u5305\u542B\u4E2D\u5956\u4EBA\u540D\u5355) */}\n <div\n className={cn(\n 'wheel-lottery-footer',\n 'rounded-box',\n 'flex flex-col overflow-hidden',\n theme === 'dark' ? 'bg-[#1E2024]' : 'bg-[#EAEAEC]'\n )}\n >\n {/* \u5956\u54C1\u6C60(\u5305\u542B\u4E2D\u5956\u4EBA\u540D\u5355\u81EA\u52A8\u6EDA\u52A8) */}\n <PrizePool\n theme={theme}\n prizes={prizes}\n title={prizesTitle}\n winningInfos={winningInfos}\n winnerNameTemplate={winnerNameTemplate}\n />\n </div>\n\n {/* \u4E2D\u5956\u5F39\u7A97 */}\n <WinnerModal\n isOpen={showWinnerModal}\n prize={wheelState.winningPrize}\n title={externalWinnerConfig?.title || winnerModalConfig?.title}\n prizeTitle={externalWinnerConfig?.prizeTitle || winnerModalConfig?.prizeTitle}\n prizeImage={externalWinnerConfig?.prizeImage || winnerModalConfig?.prizeImage}\n prizeDescription={externalWinnerConfig?.prizeDescription || winnerModalConfig?.prizeDescription}\n winnerNote={\n externalWinnerConfig?.winnerNote ??\n wheelState.winningPrize?.winnerModalConfig?.winnerNote ??\n winnerModalConfig?.winnerNote\n }\n learnMoreUrl={\n externalWinnerConfig?.learnMoreUrl ||\n wheelState.winningPrize?.winnerModalConfig?.learnMoreUrl ||\n winnerModalConfig?.learnMoreUrl\n }\n learnMoreText={\n externalWinnerConfig?.learnMoreText ||\n wheelState.winningPrize?.winnerModalConfig?.learnMoreText ||\n winnerModalConfig?.learnMoreText\n }\n couponCode={externalWinnerConfig?.couponCode || winnerModalConfig?.couponCode}\n expiresAt={externalWinnerConfig?.expiresAt || winnerModalConfig?.expiresAt}\n expiresAtLabel={externalWinnerConfig?.expiresAtLabel || winnerModalConfig?.expiresAtLabel}\n couponDiscount={externalWinnerConfig?.couponDiscount || winnerModalConfig?.couponDiscount}\n couponUnit={externalWinnerConfig?.couponUnit || winnerModalConfig?.couponUnit}\n confirmText={\n externalWinnerConfig?.confirmText ||\n wheelState.winningPrize?.winnerModalConfig?.confirmText ||\n winnerModalConfig?.confirmText\n }\n confirmUrl={\n externalWinnerConfig?.confirmUrl ||\n wheelState.winningPrize?.winnerModalConfig?.confirmUrl ||\n winnerModalConfig?.confirmUrl\n }\n copyText={externalWinnerConfig?.copyText || winnerModalConfig?.copyText || copyText}\n copiedText={externalWinnerConfig?.copiedText || winnerModalConfig?.copiedText || copiedText}\n onClose={handleCloseWinnerModal}\n theme={theme}\n />\n\n {/* Rules \u5F39\u7A97 */}\n {rulesData && rulesData.length > 0 && (\n <RulesModal\n title={rulesText}\n isOpen={showRulesModal}\n onClose={() => setShowRulesModal(false)}\n rules={rulesData}\n theme={theme}\n />\n )}\n\n {/* My Rewards \u5F39\u7A97 */}\n {rewardsData && (\n <MyRewardsModal\n isOpen={showRewardsModal}\n onClose={() => setShowRewardsModal(false)}\n rewards={rewardsData}\n onCopyCode={onCopyCode}\n codeText={codeText}\n copyText={copyText}\n copiedText={copiedText}\n prizeText={prizeText}\n emptyText={emptyText}\n copyError={copyError}\n availableText={availableText}\n usedStatusText={usedStatusText}\n expiredText={expiredText}\n notFoundText={notFoundText}\n theme={theme}\n title={myRewardsText}\n />\n )}\n\n {/* \u9519\u8BEF\u5F39\u7A97 */}\n <ErrorModal\n isOpen={showErrorModal}\n onClose={() => setShowErrorModal(false)}\n title={errorTitle || errorModalConfig?.title}\n message={errorMessage || errorModalConfig?.message}\n confirmText={errorConfirmText || errorModalConfig?.confirmText}\n theme={theme}\n />\n\n {/* \u672A\u4E2D\u5956\u5F39\u7A97 */}\n <ErrorModal\n isOpen={showNoWinModal}\n onClose={handleCloseNoWinModal}\n title={noWinTitle || errorModalConfig?.title}\n message={noWinMessage || errorModalConfig?.message}\n confirmText={noWinConfirmText || errorModalConfig?.confirmText}\n theme={theme}\n />\n\n {/* \u5206\u4EAB\u5F39\u7A97 */}\n <ShareModal\n isOpen={showShareModal}\n onClose={() => setShowShareModal(false)}\n title={shareModalConfig?.title}\n subtitle={shareModalConfig?.subtitle}\n note={shareModalConfig?.note}\n platforms={shareModalConfig?.platforms}\n onShareSuccess={shareModalConfig?.onShareSuccess}\n theme={theme}\n />\n </div>\n )\n }\n)\n\n// \u8BBE\u7F6E displayName \u7528\u4E8E\u8C03\u8BD5\nWheelLottery.displayName = 'WheelLottery'\n\n// ============================================================================\n// \u5BFC\u51FA\n// ============================================================================\n\nexport default withLayout(WheelLottery)\nexport { WinnerModal } from '../LotteryShared/WinnerModal.js'\nexport { RulesModal } from '../LotteryShared/RulesModal.js'\nexport { MyRewardsModal } from '../LotteryShared/MyRewardsModal.js'\nexport { ErrorModal } from '../LotteryShared/ErrorModal.js'\nexport { ShareModal } from '../LotteryShared/ShareModal.js'\nexport { BaseModal } from '../LotteryShared/BaseModal.js'\nexport type {\n WheelLotteryProps,\n WheelLotteryHandle,\n Prize,\n ChanceMethod,\n ChanceMethodStatus,\n WinningInfo,\n WheelProps,\n PrizePoolProps,\n ChanceMethodsProps,\n WinnerModalProps,\n WinnerModalConfig,\n UserData,\n ShareModalConfig,\n SocialPlatform,\n SharePlatformConfig,\n} from './types.js'\nexport type { RulesModalProps, RuleItem } from '../LotteryShared/RulesModal.js'\nexport type { MyRewardsModalProps, Reward, RewardStatus } from '../LotteryShared/MyRewardsModal.js'\nexport type { ErrorModalProps } from '../LotteryShared/ErrorModal.js'\nexport type { ShareModalProps } from '../LotteryShared/ShareModal.js'\nexport type { BaseModalProps } from '../LotteryShared/BaseModal.js'\nexport type { ContainerProps } from '../../shared/Styles.js'\n"],
|
|
5
|
-
"mappings": "gcAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,yKAAAE,EAAA,2CAAAC,KAAA,eAAAC,GAAAJ,IA6ZQ,IAAAK,EAAA,6BAlZRC,EAA0F,iBAC1FC,EAAmB,kCACnBC,EAAkF,sBAClFC,EAA+B,oCAC/BC,EAAsB,sBACtBC,EAA0B,yCAC1BC,GAA8B,6CAC9BC,GAA4B,2CAC5BC,GAA2B,0CAC3BC,GAA+B,8CAC/BC,EAA2B,0CAC3BC,GAA2B,0CAC3BC,GAA2B,
|
|
6
|
-
"names": ["WheelLottery_exports", "__export", "WheelLottery", "WheelLottery_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_helpers", "import_types", "import_grid", "import_Wheel", "import_PrizePool", "import_ChanceMethods", "import_WinnerModal", "import_RulesModal", "import_MyRewardsModal", "import_ErrorModal", "import_ShareModal", "import_Styles", "import_BaseModal", "prizes", "theme", "winningPrizeId", "spinDuration", "wheelBackgroundImage", "pointerImage", "chanceMethods", "chanceTitle", "chanceSubtitle", "chanceFooterNote", "chanceMethodsText", "mechanismType", "inputConfig", "winningInfos", "winnerNameTemplate", "prizesTitle", "onSpinStart", "onSpinEnd", "onSpinError", "winnerModalConfig", "rulesModalConfig", "myRewardsModalConfig", "errorModalConfig", "shareModalConfig", "userData", "onLoginRequired", "onCopyCode", "opportunitiesText", "className", "ref", "rulesData", "rulesText", "rewardsData", "myRewardsText", "codeText", "copyText", "copiedText", "prizeText", "emptyText", "copyError", "availableText", "usedStatusText", "expiredText", "notFoundText", "completedText", "usedText", "isLoggedIn", "availableChances", "isNoChancesState", "wheelState", "setWheelState", "showWinnerModal", "setShowWinnerModal", "showRulesModal", "setShowRulesModal", "showRewardsModal", "setShowRewardsModal", "showErrorModal", "setShowErrorModal", "showNoWinModal", "setShowNoWinModal", "showShareModal", "setShowShareModal", "errorMessage", "setErrorMessage", "errorTitle", "setErrorTitle", "errorConfirmText", "setErrorConfirmText", "noWinTitle", "setNoWinTitle", "noWinMessage", "setNoWinMessage", "noWinConfirmText", "setNoWinConfirmText", "externalWinnerConfig", "setExternalWinnerConfig", "animationRef", "message", "title", "confirmText", "config", "prize", "prev", "handleSpinStart", "finalWinningPrizeId", "winningPrize", "p", "winningIndex", "degreesPerPrize", "basePrizeAngle", "targetAngle", "resolve", "startTime", "animate", "elapsed", "progress", "eased", "currentRotation", "error", "handleWheelGoClick", "handleCloseWinnerModal", "handleCloseNoWinModal"
|
|
4
|
+
"sourcesContent": ["/**\n * WheelLottery - \u5927\u8F6C\u76D8\u62BD\u5956\u7EC4\u4EF6\n *\n * \u7528\u4E8E\u8425\u9500\u6D3B\u52A8\u7684\u4EA4\u4E92\u5F0F\u62BD\u5956\u8F6C\u76D8\uFF0C\u652F\u6301\u591A\u54C1\u724C\u4E3B\u9898\u548C\u54CD\u5E94\u5F0F\u5E03\u5C40\u3002\n *\n * @module WheelLottery\n * @date 2025-12-17\n */\n\n'use client'\n\nimport { useState, useCallback, useRef, useEffect, useImperativeHandle, forwardRef } from 'react'\nimport { cn } from '../../helpers/index.js'\nimport { DEFAULT_WHEEL_CONFIG, DEFAULT_CHANCE_METHODS, INITIAL_WHEEL_STATE } from './types.js'\nimport { Grid, GridItem } from '../../components/grid.js'\nimport { Wheel } from './Wheel.js'\nimport { PrizePool } from '../LotteryShared/PrizePool.js'\nimport { ChanceMethods } from '../LotteryShared/ChanceMethods.js'\nimport { WinnerModal } from '../LotteryShared/WinnerModal.js'\nimport { RulesModal } from '../LotteryShared/RulesModal.js'\nimport { MyRewardsModal } from '../LotteryShared/MyRewardsModal.js'\nimport { ErrorModal } from '../LotteryShared/ErrorModal.js'\nimport { ShareModal } from '../LotteryShared/ShareModal.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nimport type { WheelLotteryProps, WheelState, WheelLotteryHandle, WinnerModalConfig } from './types.js'\n\n// ============================================================================\n// \u4E3B\u7EC4\u4EF6\n// ============================================================================\n\n/**\n * WheelLottery \u7EC4\u4EF6\n *\n * @example\n * ```tsx\n * // \u57FA\u7840\u4F7F\u7528\n * <WheelLottery\n * prizes={prizes}\n * winningPrizeId=\"prize-003\"\n * onSpinEnd={(prize) => alert(`You won ${prize.name}`)}\n * />\n *\n * // \u4F7F\u7528 ref \u63A7\u5236\u5F39\u7A97\n * const lotteryRef = useRef<WheelLotteryHandle>(null)\n *\n * <WheelLottery ref={lotteryRef} prizes={prizes} />\n *\n * // \u5916\u90E8\u89E6\u53D1\u5F39\u7A97\n * lotteryRef.current?.showError({\n * title: 'Error',\n * message: 'Something went wrong'\n * })\n * ```\n */\nexport const WheelLottery = forwardRef<WheelLotteryHandle, WheelLotteryProps>(\n (\n {\n prizes,\n theme,\n winningPrizeId,\n spinDuration = DEFAULT_WHEEL_CONFIG.spinDuration,\n wheelBackgroundImage,\n pointerImage,\n chanceMethods = DEFAULT_CHANCE_METHODS,\n chanceTitle = DEFAULT_WHEEL_CONFIG.chanceTitle,\n chanceSubtitle,\n chanceFooterNote,\n chanceMethodsText,\n mechanismType,\n inputConfig,\n winningInfos = [],\n winnerNameTemplate,\n prizesTitle,\n onSpinStart,\n onSpinEnd,\n onSpinError,\n winnerModalConfig,\n rulesModalConfig = {},\n myRewardsModalConfig = {},\n errorModalConfig = {},\n shareModalConfig = {},\n userData,\n onLoginRequired,\n onCopyCode,\n opportunitiesText = ['Number of draws remaining today:'],\n className,\n },\n ref\n ) => {\n const { rulesData, rulesText = 'Rules' } = rulesModalConfig\n const {\n rewardsData,\n myRewardsText = 'My Rewards',\n codeText = 'CODE:',\n copyText = 'COPY',\n copiedText = 'COPIED',\n prizeText = 'Prize time:',\n emptyText,\n copyError,\n availableText,\n usedStatusText,\n expiredText,\n notFoundText,\n } = myRewardsModalConfig\n const completedText = chanceMethodsText?.completedText\n const usedText = chanceMethodsText?.usedText\n const isLoggedIn = userData?.isLoggedIn ?? false\n const availableChances = userData?.availableChances ?? 0\n const isNoChancesState = isLoggedIn && availableChances <= 0\n // ==========================================================================\n // State \u7BA1\u7406\n // ==========================================================================\n\n const [wheelState, setWheelState] = useState<WheelState>(INITIAL_WHEEL_STATE)\n const [showWinnerModal, setShowWinnerModal] = useState(false)\n const [showRulesModal, setShowRulesModal] = useState(false)\n const [showRewardsModal, setShowRewardsModal] = useState(false)\n const [showErrorModal, setShowErrorModal] = useState(false)\n const [showNoWinModal, setShowNoWinModal] = useState(false)\n const [showShareModal, setShowShareModal] = useState(false)\n const [errorMessage, setErrorMessage] = useState('')\n const [errorTitle, setErrorTitle] = useState<string | undefined>()\n const [errorConfirmText, setErrorConfirmText] = useState<string | undefined>()\n const [noWinTitle, setNoWinTitle] = useState<string | undefined>()\n const [noWinMessage, setNoWinMessage] = useState<string | undefined>()\n const [noWinConfirmText, setNoWinConfirmText] = useState<string | undefined>()\n const [externalWinnerConfig, setExternalWinnerConfig] = useState<Partial<WinnerModalConfig> | undefined>()\n const animationRef = useRef<number | null>(null)\n\n // ==========================================================================\n // Imperative Handle - \u66B4\u9732\u65B9\u6CD5\u7ED9\u7236\u7EC4\u4EF6\n // ==========================================================================\n\n useImperativeHandle(\n ref,\n () => ({\n showError: ({ message, title, confirmText }) => {\n setErrorMessage(message)\n setErrorTitle(title)\n setErrorConfirmText(confirmText)\n setShowErrorModal(true)\n },\n hideError: () => {\n setShowErrorModal(false)\n },\n showNoWin: config => {\n setNoWinTitle(config?.title)\n setNoWinMessage(config?.message)\n setNoWinConfirmText(config?.confirmText)\n setShowNoWinModal(true)\n },\n hideNoWin: () => {\n setShowNoWinModal(false)\n },\n showWinner: (prize, config) => {\n setWheelState(prev => ({ ...prev, winningPrize: prize }))\n setExternalWinnerConfig(config)\n setShowWinnerModal(true)\n },\n hideWinner: () => {\n setShowWinnerModal(false)\n },\n showRules: () => {\n setShowRulesModal(true)\n },\n hideRules: () => {\n setShowRulesModal(false)\n },\n showRewards: () => {\n setShowRewardsModal(true)\n },\n hideRewards: () => {\n setShowRewardsModal(false)\n },\n showShare: () => {\n setShowShareModal(true)\n },\n hideShare: () => {\n setShowShareModal(false)\n },\n hideAllModals: () => {\n setShowWinnerModal(false)\n setShowRulesModal(false)\n setShowRewardsModal(false)\n setShowErrorModal(false)\n setShowNoWinModal(false)\n setShowShareModal(false)\n },\n }),\n []\n )\n\n // ==========================================================================\n // Props \u9A8C\u8BC1\uFF08\u5F00\u53D1\u73AF\u5883\uFF09\n // ==========================================================================\n\n useEffect(() => {\n if (process.env.NODE_ENV === 'development' && prizes) {\n if (prizes.length !== 8) {\n console.warn(\n `WheelLottery expects exactly 8 prizes, got ${prizes.length}. The component may not render correctly.`\n )\n }\n\n if (winningPrizeId && !prizes.find(p => p.prizeKey === winningPrizeId)) {\n console.warn(`WheelLottery: winningPrizeId \"${winningPrizeId}\" not found in prizes array.`)\n }\n }\n }, [prizes, winningPrizeId])\n\n // ==========================================================================\n // \u6E05\u7406\u52A8\u753B\n // ==========================================================================\n\n useEffect(() => {\n return () => {\n // \u7EC4\u4EF6\u5378\u8F7D\u65F6\u53D6\u6D88\u52A8\u753B\u5E27\n if (animationRef.current !== null) {\n cancelAnimationFrame(animationRef.current)\n }\n }\n }, [])\n\n // ==========================================================================\n // \u62BD\u5956\u903B\u8F91\n // ==========================================================================\n\n /**\n * \u5F00\u59CB\u62BD\u5956 - \u652F\u6301\u5F02\u6B65\u63A5\u53E3\u8C03\u7528\n * \u5229\u7528\u521D\u59CB\u6162\u901F\u65CB\u8F6C\uFF0C\u70B9\u51FB\u540E\u8FDB\u5165\u5FEB\u901F\u65CB\u8F6C\u72B6\u6001\uFF0C\u63A5\u53E3\u8FD4\u56DE\u540E\u51CF\u901F\u505C\u6B62\n */\n const handleSpinStart = useCallback(async () => {\n if (wheelState.isSpinning) return\n\n // \u68C0\u67E5\u7528\u6237\u662F\u5426\u5DF2\u767B\u5F55\n if (!userData?.isLoggedIn) {\n onLoginRequired?.()\n return\n }\n\n // \u2705 \u6B21\u6570\u4E3A 0 \u65F6\uFF0C\u6309\u94AE\u5DF2\u88AB\u7981\u7528\uFF0C\u8FD9\u91CC\u4E0D\u9700\u8981\u989D\u5916\u68C0\u67E5\n // \u9632\u5FA1\u6027\u7F16\u7A0B\uFF1A\u5982\u679C\u4ECD\u7136\u89E6\u53D1\uFF0C\u76F4\u63A5\u8FD4\u56DE\n if (userData.availableChances <= 0) {\n return\n }\n\n // \u8FDB\u5165\u5FEB\u901F\u65CB\u8F6C\u72B6\u6001\uFF08\u521D\u59CB\u6162\u901F\u65CB\u8F6C\u4F1A\u81EA\u52A8\u53D8\u4E3A\u5FEB\u901F\u65CB\u8F6C\uFF09\n setWheelState(prev => ({\n ...prev,\n isSpinning: true,\n isButtonDisabled: true,\n }))\n\n try {\n // \u8C03\u7528\u5916\u90E8\u63A5\u53E3\u83B7\u53D6\u4E2D\u5956\u7ED3\u679C\n let finalWinningPrizeId = winningPrizeId\n\n if (onSpinStart) {\n // \u7B49\u5F85\u63A5\u53E3\u8FD4\u56DE\u4E2D\u5956 ID\uFF08\u63A5\u53E3\u65F6\u95F4\u4E0D\u56FA\u5B9A\uFF0C1-30s\uFF09\n // \u5728\u6B64\u671F\u95F4\uFF0C\u8F6C\u76D8\u4F1A\u4FDD\u6301\u5FEB\u901F\u65CB\u8F6C\uFF08\u7531 CSS \u52A8\u753B\u63A7\u5236\uFF09\n finalWinningPrizeId = await onSpinStart()\n }\n\n // \u786E\u5B9A\u4E2D\u5956\u5956\u54C1\n const winningPrize = prizes.find(p => p.prizeKey === finalWinningPrizeId) || prizes[0]\n const winningIndex = prizes.findIndex(p => p.prizeKey === winningPrize.prizeKey)\n\n // \u8BA1\u7B97\u76EE\u6807\u89D2\u5EA6\n const degreesPerPrize = 360 / prizes.length\n const basePrizeAngle = winningIndex * degreesPerPrize\n // \u81F3\u5C11\u65CB\u8F6C 3 \u5708\uFF081080\u5EA6\uFF09+ \u76EE\u6807\u89D2\u5EA6\n const minRotations = 3\n const targetAngle = minRotations * 360 + (360 - basePrizeAngle)\n\n // \u63A5\u53E3\u8FD4\u56DE\u540E\uFF0C\u7B49\u5F85 1.5s \u518D\u5F00\u59CB\u505C\u6B62\u52A8\u753B\n await new Promise(resolve => setTimeout(resolve, 1500))\n\n // \u7ACB\u5373\u8FDB\u5165\u51CF\u901F\u72B6\u6001\uFF0C\u505C\u6B62 CSS \u5FAA\u73AF\u52A8\u753B\n setWheelState(prev => ({\n ...prev,\n isFinished: true,\n currentRotation: 0, // \u4ECE 0 \u5EA6\u5F00\u59CB\u51CF\u901F\u52A8\u753B\n }))\n\n // \u5F00\u59CB\u505C\u6B62\u65CB\u8F6C\u52A8\u753B\n const startTime = Date.now()\n\n const animate = () => {\n const now = Date.now()\n const elapsed = now - startTime\n const progress = Math.min(elapsed / spinDuration, 1)\n\n // \u5E94\u7528 ease-out \u7F13\u52A8\u51FD\u6570\n const eased = 1 - Math.pow(1 - progress, 3)\n\n // \u8BA1\u7B97\u5F53\u524D\u65CB\u8F6C\u89D2\u5EA6\n const currentRotation = targetAngle * eased\n\n // \u66F4\u65B0\u72B6\u6001\n setWheelState(prev => ({\n ...prev,\n currentRotation,\n }))\n\n // \u7EE7\u7EED\u52A8\u753B\u6216\u7ED3\u675F\n if (progress < 1) {\n animationRef.current = requestAnimationFrame(animate)\n } else {\n // \u52A8\u753B\u7ED3\u675F - \u4FDD\u6301\u6309\u94AE\u7981\u7528\u72B6\u6001,\u76F4\u5230\u5F39\u7A97\u5173\u95ED\n setWheelState(prev => ({\n ...prev,\n isSpinning: false,\n isButtonDisabled: true,\n winningPrize,\n currentRotation: targetAngle,\n }))\n\n // \u5EF6\u8FDF\u663E\u793A\u5F39\u7A97\uFF08500ms\u540E\uFF09\n if (onSpinEnd) {\n onSpinEnd?.(winningPrize)\n } else {\n setTimeout(() => {\n // \u68C0\u67E5\u662F\u5426\u672A\u4E2D\u5956\uFF08try-again\uFF09\n if (winningPrize.prizeKey === 'try-again') {\n // \u672A\u4E2D\u5956\uFF0C\u663E\u793A ErrorModal\n setShowNoWinModal(true)\n } else {\n // \u4E2D\u5956\uFF0C\u663E\u793A WinnerModal\n setShowWinnerModal(true)\n }\n }, 500)\n }\n }\n }\n\n // \u542F\u52A8\u505C\u6B62\u52A8\u753B\n animationRef.current = requestAnimationFrame(animate)\n } catch (error) {\n // \u63A5\u53E3\u62A5\u9519\uFF0C\u6062\u590D\u5230\u521D\u59CB\u6162\u901F\u65CB\u8F6C\u72B6\u6001\n setWheelState(prev => ({\n ...prev,\n isSpinning: false,\n isButtonDisabled: false,\n }))\n\n // \u663E\u793A\u9519\u8BEF\u5F39\u7A97\n setErrorMessage((error as Error).message || 'An error occurred')\n setShowErrorModal(true)\n\n // \u89E6\u53D1\u9519\u8BEF\u56DE\u8C03\n onSpinError?.(error as Error)\n\n console.error('\u62BD\u5956\u63A5\u53E3\u8C03\u7528\u5931\u8D25:', error)\n }\n }, [\n wheelState.isSpinning,\n prizes,\n winningPrizeId,\n spinDuration,\n onSpinStart,\n onSpinEnd,\n onSpinError,\n userData,\n onLoginRequired,\n ])\n\n const handleWheelGoClick = useCallback(() => {\n if (isLoggedIn) {\n void handleSpinStart()\n return\n }\n\n onLoginRequired?.()\n }, [handleSpinStart, isLoggedIn, onLoginRequired])\n\n // ==========================================================================\n // \u5F39\u7A97\u5173\u95ED\u5904\u7406\n // ==========================================================================\n\n /**\n * \u5173\u95ED\u4E2D\u5956\u5F39\u7A97\u5E76\u91CD\u7F6E\u8F6C\u76D8\u72B6\u6001\n */\n const handleCloseWinnerModal = useCallback(() => {\n setShowWinnerModal(false)\n // \u91CD\u7F6E\u8F6C\u76D8\u72B6\u6001,\u5141\u8BB8\u4E0B\u6B21\u62BD\u5956\n setWheelState(prev => ({\n ...prev,\n isButtonDisabled: false,\n isFinished: false, // \u91CD\u7F6E\u4E3A\u672A\u5B8C\u6210,\u6062\u590D\u521D\u59CB\u65CB\u8F6C\u52A8\u753B\n }))\n }, [])\n\n /**\n * \u5173\u95ED\u672A\u4E2D\u5956\u5F39\u7A97\u5E76\u91CD\u7F6E\u8F6C\u76D8\u72B6\u6001\n */\n const handleCloseNoWinModal = useCallback(() => {\n setShowNoWinModal(false)\n // \u91CD\u7F6E\u8F6C\u76D8\u72B6\u6001,\u5141\u8BB8\u4E0B\u6B21\u62BD\u5956\n setWheelState(prev => ({\n ...prev,\n isButtonDisabled: false,\n isFinished: false, // \u91CD\u7F6E\u4E3A\u672A\u5B8C\u6210,\u6062\u590D\u521D\u59CB\u65CB\u8F6C\u52A8\u753B\n }))\n }, [])\n\n // ==========================================================================\n // \u6E32\u67D3\n // ==========================================================================\n\n return (\n <div className={cn('wheel-lottery-container', 'w-full', theme === 'dark' ? 'aiui-dark' : '', className)}>\n {/* ARIA Live Region - \u5C4F\u5E55\u9605\u8BFB\u5668\u72B6\u6001\u64AD\u62A5 */}\n <div role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" className=\"sr-only\">\n {wheelState.isSpinning && '\u62BD\u5956\u8FDB\u884C\u4E2D...'}\n {wheelState.winningPrize && !wheelState.isSpinning && `\u5DF2\u4E2D\u5956: ${wheelState.winningPrize.name}`}\n </div>\n\n {/* \u4E3B\u5185\u5BB9\u533A - \u54CD\u5E94\u5F0F\u4E24\u680F/\u5355\u680F\u5E03\u5C40 */}\n <Grid className={cn('wheel-lottery-main', 'tablet:mb-4 mb-3')}>\n {/* \u5DE6\u4FA7\uFF1A\u8F6C\u76D8\u533A\u57DF */}\n <GridItem\n span={7}\n className={cn(\n 'wheel-section',\n 'relative flex w-full flex-1 items-center justify-center overflow-hidden',\n 'rounded-box',\n // \u79FB\u52A8\u7AEF\uFF08<=1024px\uFF09\u4F7F\u7528min-h\uFF0C\u684C\u9762\u7AEF\u4F7F\u7528aspect ratio\n 'laptop:min-h-[288px] min-h-[240px]',\n 'lg-desktop:aspect-w-[964] lg-desktop:aspect-h-[480]',\n 'desktop:aspect-w-[759] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[516] laptop:aspect-h-[288]',\n 'l-tablet:col-span-12',\n // \u79FB\u52A8\u7AEF\u5E95\u90E8\u95F4\u8DDD\n 'l-tablet:mb-3',\n theme === 'dark' ? 'bg-[#1E2024]' : 'bg-[#EAEAEC]'\n )}\n >\n <div\n className={cn(\n 'w-full px-[16px] pt-[16px]',\n 'lg-desktop:pb-[32px] lg-desktop:px-[32px]',\n 'desktop:pt-[24px] desktop:px-[24px]',\n 'laptop:pt-[16px] laptop:px-[16px]',\n 'tablet:px-[24px]',\n // \u79FB\u52A8\u7AEF(<=1024px)\u65F6\u4F7F\u7528\u7EDD\u5BF9\u5B9A\u4F4D\u8986\u76D6\u5728\u8F6C\u76D8\u80CC\u666F\u4E0A\n 'l-tablet:absolute l-tablet:top-0 l-tablet:inset-x-0 l-tablet:z-10'\n )}\n >\n {/* \u9876\u90E8\u4FE1\u606F\u680F\uFF1A\u5DE6\u4FA7\u673A\u4F1A\u8FDB\u5EA6\uFF0C\u53F3\u4FA7\u94FE\u63A5 */}\n <div className=\"tablet:max-h-[24px] relative z-10 mb-2 flex max-h-[40px] w-full flex-wrap items-center justify-between gap-3\">\n {/* \u5DE6\u4FA7\uFF1A\u673A\u4F1A\u5C55\u793A - \u4EC5\u767B\u5F55\u65F6\u663E\u793A */}\n <div>\n {isLoggedIn && (\n <p className=\"text-info-primary font-[700]\">\n {opportunitiesText?.[0]}\n <span className=\"ml-1 text-[#FF6B35]\">{availableChances}</span>\n {opportunitiesText?.[1] || ''}\n </p>\n )}\n </div>\n {/* \u53F3\u4FA7\uFF1ARules \u548C My Rewards \u6309\u94AE */}\n <div className=\"flex items-center gap-4\">\n {rulesData && rulesData.length > 0 && (\n <button\n onClick={() => setShowRulesModal(true)}\n className=\"cursor-pointer touch-manipulation\"\n type=\"button\"\n >\n <span className=\"text-info-primary font-[700] underline\">{rulesText}</span>\n </button>\n )}\n {/* My Rewards \u6309\u94AE - \u4EC5\u767B\u5F55\u65F6\u663E\u793A */}\n {userData?.isLoggedIn && rewardsData && (\n <button\n onClick={() => setShowRewardsModal(true)}\n className=\"cursor-pointer touch-manipulation whitespace-nowrap\"\n type=\"button\"\n >\n <span className=\"text-info-primary font-[700] underline\">{myRewardsText}</span>\n </button>\n )}\n </div>\n </div>\n {/* \u8F6C\u76D8\u7EC4\u4EF6 */}\n <Wheel\n theme={theme}\n prizes={prizes}\n rotation={wheelState.currentRotation}\n isSpinning={wheelState.isSpinning}\n isFinished={wheelState.isFinished}\n isButtonDisabled={wheelState.isButtonDisabled || !isLoggedIn || isNoChancesState}\n userData={userData}\n onGoClick={handleWheelGoClick}\n wheelBackgroundImage={wheelBackgroundImage}\n pointerImage={pointerImage}\n />\n </div>\n </GridItem>\n\n {/* \u53F3\u4FA7\uFF1A\u83B7\u53D6\u673A\u4F1A\u533A\u57DF */}\n {chanceMethods.length > 0 && (\n <GridItem\n span={5}\n className={cn(\n 'info-section',\n 'rounded-box',\n 'relative flex flex-col overflow-hidden',\n 'lg-desktop:aspect-w-[684] lg-desktop:aspect-h-[480]',\n 'desktop:aspect-w-[536] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[364] laptop:aspect-h-[288]',\n // \u79FB\u52A8\u7AEF\u4F7F\u7528min-h\u800C\u4E0D\u662Fmax-h\uFF0C\u786E\u4FDD\u5185\u5BB9\u5B8C\u6574\u663E\u793A\n 'l-tablet:min-h-[280px] laptop:max-h-[320px]',\n 'w-full',\n 'l-tablet:col-span-12',\n theme === 'dark' ? 'bg-[#1E2024]' : 'bg-[#EAEAEC]'\n )}\n >\n <ChanceMethods\n theme={theme}\n userData={userData}\n methods={chanceMethods}\n title={chanceTitle}\n subtitle={chanceSubtitle}\n footerNote={chanceFooterNote}\n onOpenShareModal={() => setShowShareModal(true)}\n chanceBadgeText={chanceMethodsText?.chanceBadgeText}\n completedText={completedText}\n usedText={usedText}\n loadingText={chanceMethodsText?.loadingText}\n mechanismType={mechanismType}\n inputConfig={inputConfig}\n />\n </GridItem>\n )}\n </Grid>\n\n {/* \u5E95\u90E8\u533A\u57DF\uFF1A\u5956\u54C1\u6C60(\u5305\u542B\u4E2D\u5956\u4EBA\u540D\u5355) */}\n <div\n className={cn(\n 'wheel-lottery-footer',\n 'rounded-box',\n 'flex flex-col overflow-hidden',\n theme === 'dark' ? 'bg-[#1E2024]' : 'bg-[#EAEAEC]'\n )}\n >\n {/* \u5956\u54C1\u6C60(\u5305\u542B\u4E2D\u5956\u4EBA\u540D\u5355\u81EA\u52A8\u6EDA\u52A8) */}\n <PrizePool\n theme={theme}\n prizes={prizes}\n title={prizesTitle}\n winningInfos={winningInfos}\n winnerNameTemplate={winnerNameTemplate}\n />\n </div>\n\n {/* \u4E2D\u5956\u5F39\u7A97 */}\n <WinnerModal\n isOpen={showWinnerModal}\n prize={wheelState.winningPrize}\n title={externalWinnerConfig?.title || winnerModalConfig?.title}\n prizeTitle={externalWinnerConfig?.prizeTitle || winnerModalConfig?.prizeTitle}\n prizeImage={externalWinnerConfig?.prizeImage || winnerModalConfig?.prizeImage}\n prizeDescription={externalWinnerConfig?.prizeDescription || winnerModalConfig?.prizeDescription}\n winnerNote={\n externalWinnerConfig?.winnerNote ??\n wheelState.winningPrize?.winnerModalConfig?.winnerNote ??\n winnerModalConfig?.winnerNote\n }\n learnMoreUrl={\n externalWinnerConfig?.learnMoreUrl ||\n wheelState.winningPrize?.winnerModalConfig?.learnMoreUrl ||\n winnerModalConfig?.learnMoreUrl\n }\n learnMoreText={\n externalWinnerConfig?.learnMoreText ||\n wheelState.winningPrize?.winnerModalConfig?.learnMoreText ||\n winnerModalConfig?.learnMoreText\n }\n couponCode={externalWinnerConfig?.couponCode || winnerModalConfig?.couponCode}\n expiresAt={externalWinnerConfig?.expiresAt || winnerModalConfig?.expiresAt}\n expiresAtLabel={externalWinnerConfig?.expiresAtLabel || winnerModalConfig?.expiresAtLabel}\n couponDiscount={externalWinnerConfig?.couponDiscount || winnerModalConfig?.couponDiscount}\n couponUnit={externalWinnerConfig?.couponUnit || winnerModalConfig?.couponUnit}\n confirmText={\n externalWinnerConfig?.confirmText ||\n wheelState.winningPrize?.winnerModalConfig?.confirmText ||\n winnerModalConfig?.confirmText\n }\n confirmUrl={\n externalWinnerConfig?.confirmUrl ||\n wheelState.winningPrize?.winnerModalConfig?.confirmUrl ||\n winnerModalConfig?.confirmUrl\n }\n copyText={externalWinnerConfig?.copyText || winnerModalConfig?.copyText || copyText}\n copiedText={externalWinnerConfig?.copiedText || winnerModalConfig?.copiedText || copiedText}\n onClose={handleCloseWinnerModal}\n theme={theme}\n />\n\n {/* Rules \u5F39\u7A97 */}\n {rulesData && rulesData.length > 0 && (\n <RulesModal\n title={rulesText}\n isOpen={showRulesModal}\n onClose={() => setShowRulesModal(false)}\n rules={rulesData}\n theme={theme}\n />\n )}\n\n {/* My Rewards \u5F39\u7A97 */}\n {rewardsData && (\n <MyRewardsModal\n isOpen={showRewardsModal}\n onClose={() => setShowRewardsModal(false)}\n rewards={rewardsData}\n onCopyCode={onCopyCode}\n codeText={codeText}\n copyText={copyText}\n copiedText={copiedText}\n prizeText={prizeText}\n emptyText={emptyText}\n copyError={copyError}\n availableText={availableText}\n usedStatusText={usedStatusText}\n expiredText={expiredText}\n notFoundText={notFoundText}\n theme={theme}\n title={myRewardsText}\n />\n )}\n\n {/* \u9519\u8BEF\u5F39\u7A97 */}\n <ErrorModal\n isOpen={showErrorModal}\n onClose={() => setShowErrorModal(false)}\n title={errorTitle || errorModalConfig?.title}\n message={errorMessage || errorModalConfig?.message}\n confirmText={errorConfirmText || errorModalConfig?.confirmText}\n theme={theme}\n />\n\n {/* \u672A\u4E2D\u5956\u5F39\u7A97 */}\n <ErrorModal\n isOpen={showNoWinModal}\n onClose={handleCloseNoWinModal}\n title={noWinTitle || errorModalConfig?.title}\n message={noWinMessage || errorModalConfig?.message}\n confirmText={noWinConfirmText || errorModalConfig?.confirmText}\n theme={theme}\n />\n\n {/* \u5206\u4EAB\u5F39\u7A97 */}\n <ShareModal\n isOpen={showShareModal}\n onClose={() => setShowShareModal(false)}\n title={shareModalConfig?.title}\n subtitle={shareModalConfig?.subtitle}\n note={shareModalConfig?.note}\n platforms={shareModalConfig?.platforms}\n onShareSuccess={shareModalConfig?.onShareSuccess}\n theme={theme}\n />\n </div>\n )\n }\n)\n\n// \u8BBE\u7F6E displayName \u7528\u4E8E\u8C03\u8BD5\nWheelLottery.displayName = 'WheelLottery'\n\n// ============================================================================\n// \u5BFC\u51FA\n// ============================================================================\n\nexport default withLayout(WheelLottery)\nexport { WinnerModal } from '../LotteryShared/WinnerModal.js'\nexport { RulesModal } from '../LotteryShared/RulesModal.js'\nexport { MyRewardsModal } from '../LotteryShared/MyRewardsModal.js'\nexport { ErrorModal } from '../LotteryShared/ErrorModal.js'\nexport { ShareModal } from '../LotteryShared/ShareModal.js'\nexport { BaseModal } from '../LotteryShared/BaseModal.js'\nexport type {\n WheelLotteryProps,\n WheelLotteryHandle,\n Prize,\n ChanceMethod,\n ChanceMethodStatus,\n WinningInfo,\n WheelProps,\n PrizePoolProps,\n ChanceMethodsProps,\n WinnerModalProps,\n WinnerModalConfig,\n UserData,\n ShareModalConfig,\n SocialPlatform,\n SharePlatformConfig,\n} from './types.js'\nexport type { RulesModalProps, RuleItem } from '../LotteryShared/RulesModal.js'\nexport type { MyRewardsModalProps, Reward, RewardStatus } from '../LotteryShared/MyRewardsModal.js'\nexport type { ErrorModalProps } from '../LotteryShared/ErrorModal.js'\nexport type { ShareModalProps } from '../LotteryShared/ShareModal.js'\nexport type { BaseModalProps } from '../LotteryShared/BaseModal.js'\nexport type { ContainerProps } from '../../shared/Styles.js'\n"],
|
|
5
|
+
"mappings": "gcAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,yKAAAE,EAAA,2CAAAC,KAAA,eAAAC,GAAAJ,IA6ZQ,IAAAK,EAAA,6BAlZRC,EAA0F,iBAC1FC,EAAmB,kCACnBC,EAAkF,sBAClFC,EAA+B,oCAC/BC,EAAsB,sBACtBC,EAA0B,yCAC1BC,GAA8B,6CAC9BC,GAA4B,2CAC5BC,GAA2B,0CAC3BC,GAA+B,8CAC/BC,EAA2B,0CAC3BC,GAA2B,0CAC3BC,GAA2B,kCA8oB3BL,GAA4B,2CAC5BC,GAA2B,0CAC3BC,GAA+B,8CAC/BC,GAA2B,0CAC3BC,GAA2B,0CAC3BE,GAA0B,yCAnnBnB,MAAMjB,KAAe,cAC1B,CACE,CACE,OAAAkB,EACA,MAAAC,EACA,eAAAC,EACA,aAAAC,EAAe,uBAAqB,aACpC,qBAAAC,EACA,aAAAC,GACA,cAAAC,EAAgB,yBAChB,YAAAC,GAAc,uBAAqB,YACnC,eAAAC,GACA,iBAAAC,GACA,kBAAAC,EACA,cAAAC,GACA,YAAAC,GACA,aAAAC,GAAe,CAAC,EAChB,mBAAAC,GACA,YAAAC,GACA,YAAAC,EACA,UAAAC,EACA,YAAAC,EACA,kBAAAC,EACA,iBAAAC,GAAmB,CAAC,EACpB,qBAAAC,GAAuB,CAAC,EACxB,iBAAAC,EAAmB,CAAC,EACpB,iBAAAC,EAAmB,CAAC,EACpB,SAAAC,EACA,gBAAAC,EACA,WAAAC,GACA,kBAAAC,EAAoB,CAAC,kCAAkC,EACvD,UAAAC,EACF,EACAC,KACG,CACH,KAAM,CAAE,UAAAC,EAAW,UA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B,MACvC,QAASiD,IAAgBjD,GAAkB,QAC3C,YAAamD,IAAoBnD,GAAkB,YACnD,MAAOrB,EACT,KAGA,OAAC,eACC,OAAQ4D,GACR,QAAS,IAAMC,EAAkB,EAAK,EACtC,MAAOvC,GAAkB,MACzB,SAAUA,GAAkB,SAC5B,KAAMA,GAAkB,KACxB,UAAWA,GAAkB,UAC7B,eAAgBA,GAAkB,eAClC,MAAOtB,EACT,GACF,CAEJ,CACF,EAGAnB,EAAa,YAAc,eAM3B,IAAOC,MAAQ,eAAWD,CAAY",
|
|
6
|
+
"names": ["WheelLottery_exports", "__export", "WheelLottery", "WheelLottery_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_helpers", "import_types", "import_grid", "import_Wheel", "import_PrizePool", "import_ChanceMethods", "import_WinnerModal", "import_RulesModal", "import_MyRewardsModal", "import_ErrorModal", "import_ShareModal", "import_Styles", "import_BaseModal", "prizes", "theme", "winningPrizeId", "spinDuration", "wheelBackgroundImage", "pointerImage", "chanceMethods", "chanceTitle", "chanceSubtitle", "chanceFooterNote", "chanceMethodsText", "mechanismType", "inputConfig", "winningInfos", "winnerNameTemplate", "prizesTitle", "onSpinStart", "onSpinEnd", "onSpinError", "winnerModalConfig", "rulesModalConfig", "myRewardsModalConfig", "errorModalConfig", "shareModalConfig", "userData", "onLoginRequired", "onCopyCode", "opportunitiesText", "className", "ref", "rulesData", "rulesText", "rewardsData", "myRewardsText", "codeText", "copyText", "copiedText", "prizeText", "emptyText", "copyError", "availableText", "usedStatusText", "expiredText", "notFoundText", "completedText", "usedText", "isLoggedIn", "availableChances", "isNoChancesState", "wheelState", "setWheelState", "showWinnerModal", "setShowWinnerModal", "showRulesModal", "setShowRulesModal", "showRewardsModal", "setShowRewardsModal", "showErrorModal", "setShowErrorModal", "showNoWinModal", "setShowNoWinModal", "showShareModal", "setShowShareModal", "errorMessage", "setErrorMessage", "errorTitle", "setErrorTitle", "errorConfirmText", "setErrorConfirmText", "noWinTitle", "setNoWinTitle", "noWinMessage", "setNoWinMessage", "noWinConfirmText", "setNoWinConfirmText", "externalWinnerConfig", "setExternalWinnerConfig", "animationRef", "message", "title", "confirmText", "config", "prize", "prev", "handleSpinStart", "finalWinningPrizeId", "winningPrize", "p", "winningIndex", "degreesPerPrize", "basePrizeAngle", "targetAngle", "resolve", "startTime", "animate", "elapsed", "progress", "eased", "currentRotation", "error", "handleWheelGoClick", "handleCloseWinnerModal", "handleCloseNoWinModal"]
|
|
7
7
|
}
|
|
@@ -140,10 +140,6 @@ export { default as MiniCartCircleProgress } from './MiniCart/CircleProgress.js'
|
|
|
140
140
|
export type { CircleProgressProps as MiniCartCircleProgressProps } from './MiniCart/CircleProgress.js';
|
|
141
141
|
export { default as MiniCartDialog, MiniCartDialog as MiniCartDialogComponent } from './MiniCart/MiniCartDialog.js';
|
|
142
142
|
export type { MiniCartDialogProps, MiniCartDialogCopy, MiniCartDialogSemanticName, CartData, } from './MiniCart/MiniCartDialog.js';
|
|
143
|
-
export { default as WebPushPopup } from './WebPushPopup/index.js';
|
|
144
|
-
export type { WebPushPopupProps } from './WebPushPopup/index.js';
|
|
145
|
-
export { useEmarsysWebPush } from '../hooks/useEmarsysWebPush.js';
|
|
146
|
-
export type { UseEmarsysWebPushOptions, UseEmarsysWebPushReturn, EmarsysContactInfo, EmarsysInitConfig, } from '../hooks/useEmarsysWebPush.js';
|
|
147
143
|
/**
|
|
148
144
|
* 组件映射对象
|
|
149
145
|
*/
|