@anker-in/headless-ui 1.3.84 → 1.3.85
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/ActiveShelf/ProductCard.d.ts +4 -3
- package/dist/cjs/biz-components/ActiveShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/ActiveShelf/index.js +1 -1
- package/dist/cjs/biz-components/ActivityMechanism/index.d.ts +4 -7
- package/dist/cjs/biz-components/ActivityMechanism/index.js +1 -1
- package/dist/cjs/biz-components/ActivitySchedule/index.js +1 -1
- package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
- package/dist/cjs/biz-components/AnchorNavigation/index.js +1 -1
- package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/FreeGiftItem.d.ts +2 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/FreeGiftItem.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/GiftSelection.d.ts +2 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/GiftSelection.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/PriceAndActions.d.ts +2 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/PriceAndActions.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +2 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductImage.d.ts +4 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductImage.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductInfo.d.ts +2 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductInfo.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/index.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/tracking.d.ts +20 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/tracking.js +1 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/types.d.ts +2 -0
- package/dist/cjs/biz-components/Category/index.d.ts +4 -2
- package/dist/cjs/biz-components/Category/index.js +1 -1
- package/dist/cjs/biz-components/Chat/action.d.ts +25 -0
- package/dist/cjs/biz-components/Chat/action.js +1 -0
- package/dist/cjs/biz-components/Chat/button.d.ts +3 -0
- package/dist/cjs/biz-components/Chat/button.js +1 -0
- package/dist/cjs/biz-components/Chat/chatContext.d.ts +101 -0
- package/dist/cjs/biz-components/Chat/chatContext.js +1 -0
- package/dist/cjs/biz-components/Chat/exports.d.ts +3 -0
- package/dist/cjs/biz-components/Chat/exports.js +1 -0
- package/dist/cjs/biz-components/Chat/helpers/fetchResponse.d.ts +14 -0
- package/dist/cjs/biz-components/Chat/helpers/fetchResponse.js +1 -0
- package/dist/cjs/biz-components/Chat/helpers/fetcher.d.ts +2 -0
- package/dist/cjs/biz-components/Chat/helpers/fetcher.js +1 -0
- package/dist/cjs/biz-components/Chat/index.d.ts +71 -0
- package/dist/cjs/biz-components/Chat/index.js +1 -0
- package/dist/cjs/biz-components/Chat/markdown.d.ts +5 -0
- package/dist/cjs/biz-components/Chat/markdown.js +1 -0
- package/dist/cjs/biz-components/Chat/messages.d.ts +3 -0
- package/dist/cjs/biz-components/Chat/messages.js +1 -0
- package/dist/cjs/biz-components/Chat/props.d.ts +43 -0
- package/dist/cjs/biz-components/Chat/props.js +1 -0
- package/dist/cjs/biz-components/Chat/response.d.ts +4 -0
- package/dist/cjs/biz-components/Chat/response.js +1 -0
- package/dist/cjs/biz-components/Chat/suggestions.d.ts +3 -0
- package/dist/cjs/biz-components/Chat/suggestions.js +1 -0
- package/dist/cjs/biz-components/Chat/utils.d.ts +3 -0
- package/dist/cjs/biz-components/Chat/utils.js +1 -0
- package/dist/cjs/biz-components/Evaluate/index.js +1 -1
- package/dist/cjs/biz-components/EventSchedule/index.js +1 -1
- package/dist/cjs/biz-components/Faq/Faq.d.ts +3 -1
- package/dist/cjs/biz-components/Faq/Faq.js +2 -2
- package/dist/cjs/biz-components/FeatureCards/FeatureCards.js +1 -1
- package/dist/cjs/biz-components/GiftShelf/index.js +1 -1
- package/dist/cjs/biz-components/GiftTierShelf/index.js +1 -1
- package/dist/cjs/biz-components/Graphic/index.js +1 -1
- package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerMulti/index.js +1 -1
- package/dist/cjs/biz-components/MemberEquity/index.js +2 -2
- package/dist/cjs/biz-components/MiniCart/index.js +1 -1
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/cjs/biz-components/ProductHero/ProductHero.js +1 -1
- package/dist/cjs/biz-components/ProductNav/ProductNav.js +1 -1
- package/dist/cjs/biz-components/PromotionalBar/index.d.ts +3 -2
- package/dist/cjs/biz-components/PromotionalBar/index.js +1 -1
- package/dist/cjs/biz-components/SceneShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/SceneShelf/ProductsPanel.js +1 -1
- package/dist/cjs/biz-components/SceneShelf/Root.js +1 -1
- package/dist/cjs/biz-components/SceneShelf/context.d.ts +11 -1
- package/dist/cjs/biz-components/SceneShelf/context.js +1 -1
- package/dist/cjs/biz-components/SceneShelf/types.d.ts +5 -0
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
- package/dist/cjs/biz-components/Title/index.js +1 -1
- package/dist/cjs/shared/track.d.ts +13 -7
- package/dist/cjs/shared/track.js +1 -1
- package/dist/esm/biz-components/AccordionCards/index.js +1 -1
- package/dist/esm/biz-components/ActiveShelf/ProductCard.d.ts +4 -3
- package/dist/esm/biz-components/ActiveShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/ActiveShelf/index.js +1 -1
- package/dist/esm/biz-components/ActivityMechanism/index.d.ts +4 -7
- package/dist/esm/biz-components/ActivityMechanism/index.js +1 -1
- package/dist/esm/biz-components/ActivitySchedule/index.js +1 -1
- package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
- package/dist/esm/biz-components/AnchorNavigation/index.js +1 -1
- package/dist/esm/biz-components/BrandCardLink/BrandCardLink.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/FreeGiftItem.d.ts +2 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/FreeGiftItem.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/GiftSelection.d.ts +2 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/GiftSelection.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/PriceAndActions.d.ts +2 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/PriceAndActions.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +2 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductImage.d.ts +4 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductImage.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductInfo.d.ts +2 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductInfo.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/index.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/tracking.d.ts +20 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/tracking.js +1 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/types.d.ts +2 -0
- package/dist/esm/biz-components/Category/index.d.ts +4 -2
- package/dist/esm/biz-components/Category/index.js +1 -1
- package/dist/esm/biz-components/Chat/action.d.ts +25 -0
- package/dist/esm/biz-components/Chat/action.js +1 -0
- package/dist/esm/biz-components/Chat/button.d.ts +3 -0
- package/dist/esm/biz-components/Chat/button.js +1 -0
- package/dist/esm/biz-components/Chat/chatContext.d.ts +101 -0
- package/dist/esm/biz-components/Chat/chatContext.js +1 -0
- package/dist/esm/biz-components/Chat/exports.d.ts +3 -0
- package/dist/esm/biz-components/Chat/exports.js +1 -0
- package/dist/esm/biz-components/Chat/helpers/fetchResponse.d.ts +14 -0
- package/dist/esm/biz-components/Chat/helpers/fetchResponse.js +1 -0
- package/dist/esm/biz-components/Chat/helpers/fetcher.d.ts +2 -0
- package/dist/esm/biz-components/Chat/helpers/fetcher.js +1 -0
- package/dist/esm/biz-components/Chat/index.d.ts +71 -0
- package/dist/esm/biz-components/Chat/index.js +1 -0
- package/dist/esm/biz-components/Chat/markdown.d.ts +5 -0
- package/dist/esm/biz-components/Chat/markdown.js +1 -0
- package/dist/esm/biz-components/Chat/messages.d.ts +3 -0
- package/dist/esm/biz-components/Chat/messages.js +1 -0
- package/dist/esm/biz-components/Chat/props.d.ts +43 -0
- package/dist/esm/biz-components/Chat/props.js +1 -0
- package/dist/esm/biz-components/Chat/response.d.ts +4 -0
- package/dist/esm/biz-components/Chat/response.js +1 -0
- package/dist/esm/biz-components/Chat/suggestions.d.ts +3 -0
- package/dist/esm/biz-components/Chat/suggestions.js +1 -0
- package/dist/esm/biz-components/Chat/utils.d.ts +3 -0
- package/dist/esm/biz-components/Chat/utils.js +1 -0
- package/dist/esm/biz-components/Evaluate/index.js +1 -1
- package/dist/esm/biz-components/EventSchedule/index.js +1 -1
- package/dist/esm/biz-components/Faq/Faq.d.ts +3 -1
- package/dist/esm/biz-components/Faq/Faq.js +2 -2
- package/dist/esm/biz-components/FeatureCards/FeatureCards.js +1 -1
- package/dist/esm/biz-components/GiftShelf/index.js +1 -1
- package/dist/esm/biz-components/GiftTierShelf/index.js +1 -1
- package/dist/esm/biz-components/Graphic/index.js +1 -1
- package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
- package/dist/esm/biz-components/ImageWithText/ImageWithText.js +1 -1
- package/dist/esm/biz-components/MediaPlayerMulti/index.js +1 -1
- package/dist/esm/biz-components/MemberEquity/index.js +2 -2
- package/dist/esm/biz-components/MiniCart/index.js +1 -1
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/esm/biz-components/ProductHero/ProductHero.js +1 -1
- package/dist/esm/biz-components/ProductNav/ProductNav.js +1 -1
- package/dist/esm/biz-components/PromotionalBar/index.d.ts +3 -2
- package/dist/esm/biz-components/PromotionalBar/index.js +1 -1
- package/dist/esm/biz-components/SceneShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/SceneShelf/ProductsPanel.js +1 -1
- package/dist/esm/biz-components/SceneShelf/Root.js +1 -1
- package/dist/esm/biz-components/SceneShelf/context.d.ts +11 -1
- package/dist/esm/biz-components/SceneShelf/context.js +1 -1
- package/dist/esm/biz-components/SceneShelf/types.d.ts +5 -0
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
- package/dist/esm/biz-components/Title/index.js +1 -1
- package/dist/esm/shared/track.d.ts +13 -7
- package/dist/esm/shared/track.js +1 -1
- package/package.json +50 -3
- package/src/biz-components/Chat/styles/chat.css +14 -0
- package/src/biz-components/Chat/styles/css/animations.css +35 -0
- package/src/biz-components/Chat/styles/css/button.css +56 -0
- package/src/biz-components/Chat/styles/css/colors.css +12 -0
- package/src/biz-components/Chat/styles/css/console.css +134 -0
- package/src/biz-components/Chat/styles/css/header.css +43 -0
- package/src/biz-components/Chat/styles/css/input.css +89 -0
- package/src/biz-components/Chat/styles/css/markdown.css +131 -0
- package/src/biz-components/Chat/styles/css/messages.css +85 -0
- package/src/biz-components/Chat/styles/css/panel.css +23 -0
- package/src/biz-components/Chat/styles/css/popup.css +44 -0
- package/src/biz-components/Chat/styles/css/response.css +25 -0
- package/src/biz-components/Chat/styles/css/sidebar.css +31 -0
- package/src/biz-components/Chat/styles/css/suggestions.css +36 -0
- package/src/biz-components/Chat/styles/css/window.css +60 -0
- package/src/biz-components/Chat/styles/image.png +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as o,jsxs as x}from"react/jsx-runtime";import S,{useImperativeHandle as _,useRef as f}from"react";import{cn as l,getLocalizedPath as D}from"../../helpers/utils.js";import b from"../../components/picture.js";import{withLayout as E}from"../../shared/Styles.js";import{useAiuiContext as h}from"../AiuiProvider/index.js";import M from"../Title/index.js";import v from"./SwiperCategory.js";import{useExposure as C}from"../../hooks/useExposure.js";import{useTracking as k}from"../../hooks/useTracking.js";import{buildClickTrackingProps as z}from"../../shared/track.js";import{trackUrlRef as H}from"../../shared/trackUrlRef.js";const p="image",d="category_banner",u=5,I=3,P=(e,i)=>{const t=[];for(let r=0;r<e.length;r+=i)t.push(e.slice(r,r+i));return t},w=(e,i,t)=>e?.trim()?H(D(e,i),t):void 0,N=(e,i)=>z({interactive:!0,componentType:p,componentName:d,title:e?.name,description:e?.name,buttonName:e?.name,position:i,creativeId:e?.image?.id}),A=({data:e,configuration:i})=>{const t=f(null),{locale:r="us"}=h(),{buildRef:n}=k();return C(t,{componentType:p,componentName:d,componentTitle:e?.name,componentDescription:e?.name,position:i?.index+1,creativeId:e?.image?.id}),x("div",{ref:t,className:l("tablet:p-3 laptop:p-4 desktop:p-6","bg-container-primary hover:bg-info-white group box-border flex h-full cursor-pointer flex-col justify-start overflow-hidden duration-300","desktop:gap-2 gap-1","rounded-box"),children:[o("div",{className:"flex items-center justify-center transition-all duration-300 group-hover:scale-110",children:o("a",{"aria-label":e?.name,href:w(e?.link,r,n(p,d)),...N(e,(i?.index??0)+1),onClick:()=>i?.event?.primaryButton(e,i?.index),children:o(b,{alt:e?.image?.alt||"",source:e?.image?.url||"",className:"laptop:size-[88px] desktop:size-[116px] lg-desktop:size-[146px] size-[72px]",imgClassName:"size-full object-cover"})})}),o("p",{className:"lg-desktop:text-lg lg-desktop:!leading-6 text-info-primary box-border line-clamp-2 text-center text-sm font-bold leading-4",children:e?.name})]})},R=({data:e,configuration:i,index:t,pageSize:r,isFirstItemLarger:n})=>{const a=(i?.index??0)*r+t+1,s=f(null),{locale:m="us"}=h(),{buildRef:g}=k();C(s,{componentType:p,componentName:d,componentTitle:e?.name,componentDescription:e?.name,position:a,creativeId:e?.image?.id});const c=t===0;return x("div",{ref:s,className:l("bg-container-primary box-border flex w-full shrink-0 flex-col items-center justify-center overflow-hidden","hover:bg-info-white cursor-pointer duration-300",n?l("p-4",c?"aspect-h-[252] row-span-2":"aspect-h-[120]"):"max-h-[126px] px-3 py-4","rounded-box"),children:[o("a",{href:w(e?.link,m,g(p,d)),...N(e,a),onClick:()=>i?.event?.primaryButton(e,a),children:o(b,{source:e?.image?.url||"",alt:e?.image?.alt||"",className:l("m-auto mb-2 flex justify-center object-contain [&_img]:h-full [&_img]:w-auto [&_img]:object-contain",n?l(c?"size-full max-h-[146px] overflow-hidden":"max-h-[72px] max-w-[72px]"):"size-[72px]")})}),o("p",{className:l("text-info-primary w-full text-center text-sm font-bold",n?"line-clamp-2":"shrink-0 truncate"),children:e?.name})]})},j=({data:e,configuration:i})=>{const r=(i?.totalCategories??0)<=u,n=r?u:I;return o("div",{className:`gap-3 ${r?"grid grid-cols-2":"flex h-full flex-col"}`,children:e?.map((a,s)=>o(R,{index:s,pageSize:n,data:a,configuration:i,isFirstItemLarger:r},s))})},T=S.forwardRef((e,i)=>{const{data:t,className:r="",key:n,event:a,...s}=e,m=(t?.isShowSelect?t?.products:t?.productData)||[],g=m.length>u,c=m.length,L=P(m,g?I:u),y=f(null);return _(i,()=>y.current),x("div",{...s,ref:y,className:l("w-full overflow-hidden",r,{"aiui-dark":t?.theme==="dark"}),children:[t?.title&&o(M,{data:{title:t?.title},className:"text-4xl"}),o("div",{className:"tablet:block hidden",children:o(v,{id:`Category${n}`,Slide:A,data:{list:m,configuration:{shape:t?.shape,event:a,title:t?.title,totalCategories:c}},paginationClassName:"[&_.swiper-pagination]:!-bottom-6"})}),o("div",{className:"tablet:hidden block",children:o(v,{id:`Category1${n}`,Slide:j,data:{list:L,configuration:{shape:t?.shape,event:a,title:t?.title,totalCategories:c}},isHalf:g,paginationClassName:"[&_.swiper-pagination]:!-bottom-6"})}),o("div",{className:"h-7"})]})});T.displayName="Category";var Q=E(T);export{Q as default};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Message {
|
|
3
|
+
content: string;
|
|
4
|
+
role: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
scope?: any;
|
|
7
|
+
arguments?: any;
|
|
8
|
+
}
|
|
9
|
+
export interface ActionProps {
|
|
10
|
+
start?: string;
|
|
11
|
+
history: Message[];
|
|
12
|
+
addtocartHandler?: (_args: any) => Promise<any>;
|
|
13
|
+
commonRender?: string | ((_props: any) => React.ReactElement);
|
|
14
|
+
pointsExchangeCouponRender?: string | ((_props: any) => React.ReactElement);
|
|
15
|
+
gotocheckoutRender?: string | ((_props: any) => React.ReactElement);
|
|
16
|
+
gotocartRender?: string | ((_props: any) => React.ReactElement);
|
|
17
|
+
addtocartRender?: string | ((_props: any) => React.ReactElement);
|
|
18
|
+
signupRender?: string | ((_props: any) => React.ReactElement);
|
|
19
|
+
shulexRender?: string | ((_props: any) => React.ReactElement);
|
|
20
|
+
productRender?: string | ((_props: any) => React.ReactElement);
|
|
21
|
+
productRenderTipMessage?: string;
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
export declare const CopilotAction: ({ start, history, addtocartHandler, commonRender, pointsExchangeCouponRender, gotocheckoutRender, gotocartRender, addtocartRender, productRender, signupRender, shulexRender, children, }: ActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import"react";import{useEffect as N}from"react";import{useCopilotChat as v,useCopilotAction as t,useCopilotReadable as E}from"@copilotkit/react-core";import{Role as c,ActionExecutionMessage as x,TextMessage as S}from"@copilotkit/runtime-client-gql";const T=({start:J,history:s,addtocartHandler:i,commonRender:d,pointsExchangeCouponRender:p,gotocheckoutRender:m,gotocartRender:g,addtocartRender:l,productRender:u,signupRender:h,shulexRender:y,children:R})=>{const{setMessages:f,appendMessage:O,isLoading:M}=v();return N(()=>{const e=s?.filter(r=>r?.content||r?.arguments);if(e?.length>0){const r=e?.map(a=>{if(a?.name&&a?.arguments){const _=a?.arguments?.map(o=>o?{...o,ishistory:!0}:{});return new x({name:a?.name,arguments:_,scope:a?.scope})}return new S({...a,role:a?.role==="user"?c.User:c.Assistant})});f(r)}},[s]),t({name:"go_to_checkout",description:"go to cart",parameters:[{sku:"",handle:""}],render:m||(e=>n("div",{className:"hidden",children:JSON.stringify(e)})),handler:function(){}}),t({name:"common_action",description:"common action",parameters:[{act:""}],render:d||(e=>n("div",{className:"hidden",children:JSON.stringify(e)})),handler:function(){}}),t({name:"points_exchange_coupon",description:"points exchange coupon",parameters:[{act:""}],render:p||(e=>n("div",{className:"hidden",children:JSON.stringify(e)})),handler:function(){}}),t({name:"go_to_cart",description:"go to cart",parameters:[{sku:"",handle:""}],render:g||(e=>n("div",{className:"hidden",children:JSON.stringify(e)})),handler:function(){}}),t({name:"add_to_cart",description:"add to cart",parameters:[{sku:"",handle:""}],render:l||(e=>n("div",{className:"hidden",children:JSON.stringify(e)})),handler:function(e){i&&i(e)}}),t({name:"show_product_card",description:"product card",parameters:[{sku:"",handle:""}],render:u||(e=>n("div",{className:"hidden",children:JSON.stringify(e)})),handler:function(e){}}),t({name:"signup",description:"signup",parameters:[{name:"signup"}],render:h||(e=>n("div",{className:"hidden",children:JSON.stringify(e)})),handler:function(){}}),t({name:"shulex",description:"shulex",parameters:[{name:"shulex"}],render:y||(e=>n("div",{className:"hidden",children:JSON.stringify(e)})),handler:function(){}}),E({description:"Today's date",value:new Date().toLocaleDateString()}),n("div",{children:R})};export{T as CopilotAction};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t,jsxs as p}from"react/jsx-runtime";import{useChatContext as c}from"@copilotkit/react-ui";const i=({setOpen:n})=>{const o=c();return p("button",{onClick:()=>n(),className:"copilotKitButton ","aria-label":"Open Chat",children:[t("div",{className:"copilotKitButtonIcon copilotKitButtonIconOpen",children:o.icons.openIcon}),t("div",{className:"copilotKitButtonIcon copilotKitButtonIconClose",children:o.icons.closeIcon})]})};var e=i;export{e as default};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Icons for CopilotChat component.
|
|
4
|
+
*/
|
|
5
|
+
export interface CopilotChatIcons {
|
|
6
|
+
/**
|
|
7
|
+
* The icon to use for the open chat button.
|
|
8
|
+
* @default <OpenIcon />
|
|
9
|
+
*/
|
|
10
|
+
openIcon?: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* The icon to use for the close chat button.
|
|
13
|
+
* @default <CloseIcon />
|
|
14
|
+
*/
|
|
15
|
+
closeIcon?: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* The icon to use for the close chat button in the header.
|
|
18
|
+
* @default <HeaderCloseIcon />
|
|
19
|
+
*/
|
|
20
|
+
headerCloseIcon?: React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* The icon to use for the send button.
|
|
23
|
+
* @default <SendIcon />
|
|
24
|
+
*/
|
|
25
|
+
sendIcon?: React.ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* The icon to use for the activity indicator.
|
|
28
|
+
* @default <ActivityIcon />
|
|
29
|
+
*/
|
|
30
|
+
activityIcon?: React.ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* The icon to use for the spinner.
|
|
33
|
+
* @default <SpinnerIcon />
|
|
34
|
+
*/
|
|
35
|
+
spinnerIcon?: React.ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* The icon to use for the stop button.
|
|
38
|
+
* @default <StopIcon />
|
|
39
|
+
*/
|
|
40
|
+
stopIcon?: React.ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* The icon to use for the regenerate button.
|
|
43
|
+
* @default <RegenerateIcon />
|
|
44
|
+
*/
|
|
45
|
+
regenerateIcon?: React.ReactNode;
|
|
46
|
+
/**
|
|
47
|
+
* The icons to use for push to talk.
|
|
48
|
+
* @default <PushToTalkIcon />
|
|
49
|
+
*/
|
|
50
|
+
pushToTalkIcon?: React.ReactNode;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Labels for CopilotChat component.
|
|
54
|
+
*/
|
|
55
|
+
export interface CopilotChatLabels {
|
|
56
|
+
/**
|
|
57
|
+
* The initial message(s) to display in the chat window.
|
|
58
|
+
*/
|
|
59
|
+
initial?: string | string[];
|
|
60
|
+
/**
|
|
61
|
+
* The title to display in the header.
|
|
62
|
+
* @default "CopilotKit"
|
|
63
|
+
*/
|
|
64
|
+
title?: string;
|
|
65
|
+
/**
|
|
66
|
+
* The placeholder to display in the input.
|
|
67
|
+
* @default "Type a message..."
|
|
68
|
+
*/
|
|
69
|
+
placeholder?: string;
|
|
70
|
+
/**
|
|
71
|
+
* The message to display when an error occurs.
|
|
72
|
+
* @default "❌ An error occurred. Please try again."
|
|
73
|
+
*/
|
|
74
|
+
error?: string;
|
|
75
|
+
/**
|
|
76
|
+
* The label to display on the stop button.
|
|
77
|
+
* @default "Stop generating"
|
|
78
|
+
*/
|
|
79
|
+
stopGenerating?: string;
|
|
80
|
+
/**
|
|
81
|
+
* The label to display on the regenerate button.
|
|
82
|
+
* @default "Regenerate response"
|
|
83
|
+
*/
|
|
84
|
+
regenerateResponse?: string;
|
|
85
|
+
}
|
|
86
|
+
interface ChatContext {
|
|
87
|
+
labels: Required<CopilotChatLabels>;
|
|
88
|
+
icons: Required<CopilotChatIcons>;
|
|
89
|
+
open: boolean;
|
|
90
|
+
setOpen: (_open: boolean) => void;
|
|
91
|
+
}
|
|
92
|
+
export declare const ChatContext: React.Context<ChatContext | undefined>;
|
|
93
|
+
export declare function useChatContext(): ChatContext;
|
|
94
|
+
export interface ChatContextProps {
|
|
95
|
+
labels?: CopilotChatLabels;
|
|
96
|
+
icons?: CopilotChatIcons;
|
|
97
|
+
children?: React.ReactNode;
|
|
98
|
+
open: boolean;
|
|
99
|
+
setOpen: (_open: boolean) => void;
|
|
100
|
+
}
|
|
101
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";const o=t.createContext(void 0);function a(){const e=t.useContext(o);if(e===void 0)throw new Error("Context not found. Did you forget to wrap your app in a <ChatContextProvider> component?");return e}export{o as ChatContext,a as useChatContext};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{default as t}from"./index.js";import{Role as a,ActionExecutionMessage as p,TextMessage as i,useCopilotChat as r,useCopilotAction as l,useCopilotReadable as x}from"./utils.js";export{p as ActionExecutionMessage,t as Chat,a as Role,i as TextMessage,l as useCopilotAction,r as useCopilotChat,x as useCopilotReadable};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare function getAsyncError(res: {
|
|
2
|
+
json: () => any;
|
|
3
|
+
status: any;
|
|
4
|
+
statusText: any;
|
|
5
|
+
}): Promise<{
|
|
6
|
+
status: any;
|
|
7
|
+
statusText: any;
|
|
8
|
+
errors: any;
|
|
9
|
+
type: any;
|
|
10
|
+
data: any;
|
|
11
|
+
message: any;
|
|
12
|
+
} | undefined>;
|
|
13
|
+
declare const handleFetchResponse: (res: Response) => Promise<any>;
|
|
14
|
+
export default handleFetchResponse;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
async function e(a){try{const t=await a.json();return{status:a.status,statusText:a.statusText,errors:t?.data?.error||t?.data?.code||a.statusText||a.status,type:t?.data?.type,data:t?.data,message:t?.data?.message}}catch(t){console.log(t)}}const o=async a=>{if(a.ok)try{const t=await a.json(),{errors:s}=t;return s&&s.length?{errors:s,status:a.status}:t}catch(t){console.log(t)}return await e(a)};var n=o;export{n as default,e as getAsyncError};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import f from"./fetchResponse.js";const g=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),y=async({locale:e="en",url:s,method:a="POST",headers:l={},repeatKey:p,body:r,type:c,timeout:t=9e4})=>{let n="";c==="uploadFile"?n=r:n=r?JSON.stringify(r):"";const o=new AbortController;t&&setTimeout(()=>o.abort(),t);const i=await fetch(s,{method:a,mode:"cors",headers:{"current-language":e,...l},...t&&{signal:o.signal},...a!=="GET"&&{body:n}});return f(i)};var u=y;export{u as default};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ChatProps {
|
|
3
|
+
title: string;
|
|
4
|
+
runtimeUrl: string;
|
|
5
|
+
shopifyDomain: string;
|
|
6
|
+
/** GA 的 client id
|
|
7
|
+
*/
|
|
8
|
+
userId: string;
|
|
9
|
+
/** 是否登陆用户 0 or 1
|
|
10
|
+
*/
|
|
11
|
+
account?: string;
|
|
12
|
+
/** 用户浏览器语言
|
|
13
|
+
*/
|
|
14
|
+
locale?: string;
|
|
15
|
+
/** 开场白
|
|
16
|
+
*/
|
|
17
|
+
prologue?: string;
|
|
18
|
+
/** ?a=1&b=2
|
|
19
|
+
*/
|
|
20
|
+
query?: string;
|
|
21
|
+
/** 'follow' or 'unfollow' | true or false
|
|
22
|
+
* follow: ResponseButton 会跟随在 messages 的后边
|
|
23
|
+
* unfollow: ResponseButton 在聊天框底部
|
|
24
|
+
*/
|
|
25
|
+
showResponseButton?: string | boolean;
|
|
26
|
+
/** messages 的回调事件
|
|
27
|
+
* 每次生成/接受新的messages,会将 整个 messages list 传递给外部
|
|
28
|
+
*/
|
|
29
|
+
messagesCallback?: (_messages: any) => void;
|
|
30
|
+
/** 通用 action 的触发事件
|
|
31
|
+
*/
|
|
32
|
+
commonRender?: string | ((_props: any) => React.ReactElement);
|
|
33
|
+
/** shulex的 action 的触发事件
|
|
34
|
+
*/
|
|
35
|
+
shulexRender?: string | ((_props: any) => React.ReactElement);
|
|
36
|
+
/** 通用 积分 换 Coupon 的触发事件
|
|
37
|
+
*/
|
|
38
|
+
pointsExchangeCouponRender?: string | ((_props: any) => React.ReactElement);
|
|
39
|
+
/** 跳转 checkout action 卡片,接受参数: {"status":"complete","args":[{"sku":["A3936031"],"handle":"space-a40-a3936031"}],"result":""}
|
|
40
|
+
* 后端接口文档:https://anker-in.feishu.cn/wiki/DOYJwE9oxipWmYk072ncnJNznBb
|
|
41
|
+
*/
|
|
42
|
+
gotocheckoutRender?: string | ((_props: any) => React.ReactElement);
|
|
43
|
+
/** 打开购物车 action 卡片,接受参数: {"status":"complete","args":[{"sku":["A3936031"],"handle":"space-a40-a3936031"}],"result":""}
|
|
44
|
+
* 后端接口文档:https://anker-in.feishu.cn/wiki/DOYJwE9oxipWmYk072ncnJNznBb
|
|
45
|
+
*/
|
|
46
|
+
gotocartRender?: string | ((_props: any) => React.ReactElement);
|
|
47
|
+
/** 打开购物车 action 的触发事件
|
|
48
|
+
*/
|
|
49
|
+
addtocartHandler?: (_args: any) => Promise<any>;
|
|
50
|
+
/** 加购卡片,接受参数: {"status":"complete","args":[{"sku":["A3936031"],"handle":"space-a40-a3936031"}],"result":""}
|
|
51
|
+
* 后端接口文档:https://anker-in.feishu.cn/wiki/DOYJwE9oxipWmYk072ncnJNznBb
|
|
52
|
+
*/
|
|
53
|
+
addtocartRender?: string | ((_props: any) => React.ReactElement);
|
|
54
|
+
/** 订阅卡片,接受参数: {"status":"complete","args":[{"sku":["A3936031"],"handle":"space-a40-a3936031"}],"result":""}
|
|
55
|
+
* 后端接口文档:https://anker-in.feishu.cn/wiki/DOYJwE9oxipWmYk072ncnJNznBb
|
|
56
|
+
*/
|
|
57
|
+
signupRender?: string | ((_props: any) => React.ReactElement);
|
|
58
|
+
/** 产品卡片,接受参数: {"status":"complete","args":[{"sku":["A3936031"],"handle":"space-a40-a3936031"}],"result":""}
|
|
59
|
+
* 后端接口文档:https://anker-in.feishu.cn/wiki/DOYJwE9oxipWmYk072ncnJNznBb
|
|
60
|
+
*/
|
|
61
|
+
productRender?: string | ((_props: any) => React.ReactElement);
|
|
62
|
+
/** CopilotPopup 自定义参数,参考:https://docs.copilotkit.ai/reference/components/CopilotPopup */
|
|
63
|
+
popup?: any;
|
|
64
|
+
/** 文案,{"productRenderTipMessage": "","popupTip": "Hi ! Welcome to soundcore Innovations live chat!", "popupTipTimeout": [3000, 6000]} */
|
|
65
|
+
lang?: any;
|
|
66
|
+
/** 参考此文档:https://docs.copilotkit.ai/concepts/customize-look-and-feel */
|
|
67
|
+
style?: any;
|
|
68
|
+
className?: string;
|
|
69
|
+
}
|
|
70
|
+
declare const Chat: (props: ChatProps) => import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
export default Chat;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Fragment as ne,jsx as t,jsxs as re}from"react/jsx-runtime";import{useMemo as W}from"react";import{useCallback as h,useState as a,useEffect as _}from"react";import{CopilotKit as X}from"@copilotkit/react-core";import{CopilotPopup as Y}from"@copilotkit/react-ui";import Z from"./button.js";import j from"./messages.js";import ee from"./response.js";import te from"./suggestions.js";import{CopilotAction as oe}from"./action.js";import b from"./helpers/fetcher.js";const se=P=>{const{title:k,runtimeUrl:i,popup:f,shopifyDomain:p,userId:s="",account:c="",prologue:x="",locale:l="",query:n="",messagesCallback:B,showResponseButton:y,gotocheckoutRender:O,commonRender:v,shulexRender:w,pointsExchangeCouponRender:S,gotocartRender:M,addtocartRender:$,productRender:q,signupRender:D,addtocartHandler:K,style:N,className:I="",lang:u}=P,[H,U]=u?.popupTipTimeout||[3e3,6e3],[C,g]=a(!1),[d,G]=a(!1),[r,A]=a(x),[F,m]=a([]),[T,L]=a([]),R=W(()=>({"x-user-id":s||"","x-shopify-domain":p,"x-member-ship":c,"x-user-locale":l}),[s,p,c,l]),z=h(async()=>{const e=await b({url:`${i}/copilotkit/start${n}`,method:"GET",headers:R});m(e?.suggested_questions?.map(o=>({message:o,title:o}))||[]),A(e?.opening_statement||""),L(e?.history||[])},[s,p,c,l,n]),J=h(async()=>{const e=await b({url:`${i}/copilotkit/suggested_questions${n}`,method:"GET",headers:R});m(e?.suggested_questions?.data?.map(o=>({message:o,title:o}))||[])},[s,p,c,l,n]),Q=()=>{C||g(!0),setTimeout(()=>{g(!1)},U)};return _(()=>{const e=setTimeout(()=>{Q()},H);return()=>{clearTimeout(e)}},[]),t("div",{className:I,style:N||{},children:s&&i&&t(X,{runtimeUrl:`${i}/copilotkit/chat${n}`,showDevConsole:!1,headers:R,children:t(Y,{...f,showResponseButton:y!=="follow",labels:{title:k||"DTC Live Chat",initial:r||""},instructions:r||"",onInProgress:e=>{d&&e&&m([]),d&&!e&&J()},Messages:({messages:e,inProgress:o})=>t(j,{messages:e,inProgress:o,messagesCallback:B,ResponseButton:y==="follow"?t(ee,{messagesId:e?.[e.length-1]?.id}):void 0,children:t(te,{currentSuggestions:F})}),Button:({open:e,setOpen:o})=>{const V=f?.Button||Z;_(()=>{G(e)},[e]);const E=h(()=>{o(!e),g(!1),(!r||!T?.length)&&z()},[r]);return re(ne,{children:[u?.popupTip&&C&&!d&&t("div",{className:"copilotKitPopup copilotKitPopupTip",children:t("button",{onClick:E,"aria-label":"Open Chat",className:"copilotKitPopupTipContent",children:u?.popupTip})}),t(V,{open:e,setOpen:E})]})},children:t(oe,{start:r,history:T,commonRender:v,shulexRender:w,pointsExchangeCouponRender:S,gotocartRender:M,gotocheckoutRender:O,addtocartRender:$,signupRender:D,productRender:q,addtocartHandler:K,productRenderTipMessage:u?.productRenderTipMessage})})})})};var fe=se;export{fe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{memo as n}from"react";import t from"react-markdown";import a from"remark-gfm";import m from"remark-math";const p=n(t,(o,e)=>o.children===e.children&&o.className===e.className),k=({content:o})=>r("div",{className:"copilotKitMarkdown",children:r(p,{components:i,remarkPlugins:[a,m],children:o})}),i={p({children:o}){return r("p",{children:o})},a({children:o,...e}){return r("a",{style:{color:"blue",textDecoration:"underline"},...e,target:"_blank",rel:"noopener noreferrer",children:o})}};export{k as Markdown};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as n,jsxs as h}from"react/jsx-runtime";import K,{useEffect as f,useMemo as I,useState as L}from"react";import{useChatContext as T}from"@copilotkit/react-ui";import{Markdown as C}from"./markdown.js";import{useCopilotContext as w}from"@copilotkit/react-core";import{MessageStatusCode as H,ActionExecutionMessage as A,ResultMessage as k,TextMessage as g,Role as S}from"@copilotkit/runtime-client-gql";const b=({messages:t,inProgress:o,ResponseButton:p,messagesCallback:R,children:x})=>{const[d,a]=L(!0),{chatComponentsCache:M}=w(),r=T();t=[...I(()=>B(r.labels.initial),[r.labels.initial]),...t];const v={};for(let e=0;e<t.length;e++)if(t[e]instanceof A){const s=t[e].id,i=t.find(c=>c instanceof k&&c.actionExecutionId===s);i&&(v[s]=k.decodeResult(i.result||""))}const y=K.useRef(null),E=K.useRef(null),m=()=>{y.current&&y.current.scrollIntoView({behavior:"auto"})};return f(()=>{m()},[t]),f(()=>{R&&R(t)},[t]),f(()=>{const e=document.querySelector(".copilotKitInput textarea");e&&e.addEventListener("click",function(){e.value&&document.activeElement===e?a(!1):(a(!0),m())}),e&&e.addEventListener("input",function(){e.value&&document.activeElement===e?a(!1):(a(!0),m())})},[]),f(()=>{const e=E.current;d&&e?(e.style.maxHeight="500px",e.style.overflow="visible"):!d&&e&&(e.style.maxHeight="0",e.style.overflow="hidden")},[d]),h("div",{className:"copilotKitMessages",children:[t.map((e,s)=>{const i=s===t.length-1;if(e instanceof g&&e.role==="user")return n("div",{className:"copilotKitMessage copilotKitUserMessage",children:n(C,{content:e.content})},s);if(e instanceof g&&e.role=="assistant")return n("div",{className:"copilotKitMessage copilotKitAssistantMessage",children:i&&o&&!e.content?r.icons.spinnerIcon:n(C,{content:e.content})},s);if(e instanceof A)if(M.current!==null&&M.current[e.name]){const c=M.current[e.name];if(typeof c=="string")return i&&o?h("div",{className:"copilotKitMessage copilotKitAssistantMessage",children:[r.icons.spinnerIcon," ",n("span",{className:"inProgressLabel",children:c})]},s):null;{const N=e.arguments;let l="inProgress";v[e.id]!==void 0?l="complete":e.status.code!==H.Pending&&(l="executing");const u=c({status:l,args:N,result:v[e.id]});return!u&&l==="complete"?null:typeof u=="string"?h("div",{className:"copilotKitMessage copilotKitAssistantMessage",children:[i&&o&&r.icons.spinnerIcon," ",u]},s):n("div",{className:"copilotKitCustomAssistantMessage",children:u},s)}}else return!o||!i?null:n("div",{className:"copilotKitMessage copilotKitAssistantMessage",children:r.icons.spinnerIcon},s)}),n("div",{className:"responseButtonBox",children:p}),n("footer",{ref:y,children:n("div",{className:"copilotKitMessagesFooter",ref:E,children:x})})]})};function B(t){let o=[];return t&&(Array.isArray(t)?o.push(...t):o.push(t)),o.map(p=>new g({role:S.Assistant,content:p}))}var z=b;export{z as default};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Message } from '@copilotkit/runtime-client-gql';
|
|
3
|
+
export interface ButtonProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
setOpen: () => void;
|
|
6
|
+
}
|
|
7
|
+
export interface WindowProps {
|
|
8
|
+
open: boolean;
|
|
9
|
+
setOpen: (open: boolean) => void;
|
|
10
|
+
clickOutsideToClose: boolean;
|
|
11
|
+
hitEscapeToClose: boolean;
|
|
12
|
+
shortcut: string;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export interface HeaderProps {
|
|
16
|
+
open: boolean;
|
|
17
|
+
setOpen: (open: boolean) => void;
|
|
18
|
+
}
|
|
19
|
+
export interface ChatSuggestions {
|
|
20
|
+
currentSuggestions: SuggestionsProps[];
|
|
21
|
+
}
|
|
22
|
+
export interface SuggestionsProps {
|
|
23
|
+
title: string;
|
|
24
|
+
message: string;
|
|
25
|
+
partial?: boolean;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface MessagesProps {
|
|
29
|
+
messages: Message[];
|
|
30
|
+
inProgress: boolean;
|
|
31
|
+
ResponseButton?: React.ReactElement;
|
|
32
|
+
children?: React.ReactNode;
|
|
33
|
+
messagesCallback?: (messages: any) => void;
|
|
34
|
+
}
|
|
35
|
+
export interface InputProps {
|
|
36
|
+
inProgress: boolean;
|
|
37
|
+
onSend: (text: string) => Promise<Message>;
|
|
38
|
+
isVisible?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface ResponseButtonProps {
|
|
41
|
+
onClick: () => void;
|
|
42
|
+
inProgress: boolean;
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"react";import"@copilotkit/runtime-client-gql";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as r,jsxs as i}from"react/jsx-runtime";import{useChatContext as n}from"@copilotkit/react-ui";import{useCopilotChat as a}from"@copilotkit/react-core";const p=({messagesId:c})=>{const e=n(),{isLoading:o,reloadMessages:s,stopGeneration:t}=a();return!o&&i("button",{onClick:()=>o?t():s(),className:"copilotKitResponseButton",children:[o?e.labels.stopGenerating:e.labels.regenerateResponse,r("span",{children:o?e.icons.stopIcon:e.icons.regenerateIcon})]})};var u=p;export{u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as s}from"react/jsx-runtime";import{useCopilotChat as u}from"@copilotkit/react-core";import{Role as l,TextMessage as m}from"@copilotkit/runtime-client-gql";const d=({currentSuggestions:o})=>{const{appendMessage:e}=u();return o?.length>0&&s("div",{className:"suggestions",children:o.map(({title:n,message:t,partial:p,className:a},g)=>s("button",{disabled:p,onClick:i=>{i.preventDefault();const r=new m({content:t,role:l.User});e(r)},className:a||"suggestion",children:s("span",{children:n})},t+g))})};var C=d;export{C as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { useCopilotChat, useCopilotAction, useCopilotReadable } from '@copilotkit/react-core';
|
|
2
|
+
import { Role, ActionExecutionMessage, TextMessage } from '@copilotkit/runtime-client-gql';
|
|
3
|
+
export { useCopilotChat, useCopilotAction, useCopilotReadable, Role, ActionExecutionMessage, TextMessage };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useCopilotChat as o,useCopilotAction as e,useCopilotReadable as t}from"@copilotkit/react-core";import{Role as i,ActionExecutionMessage as s,TextMessage as p}from"@copilotkit/runtime-client-gql";export{s as ActionExecutionMessage,i as Role,p as TextMessage,e as useCopilotAction,o as useCopilotChat,t as useCopilotReadable};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as
|
|
1
|
+
"use client";import{jsx as t,jsxs as r}from"react/jsx-runtime";import h,{useImperativeHandle as g,useRef as x,useState as k}from"react";import{createPortal as y}from"react-dom";import N from"../Title/index.js";import{cn as n,getLocalizedPath as M}from"../../helpers/utils.js";import L from"../../components/picture.js";import T from"../SwiperBox/index.js";import{withLayout as C}from"../../shared/Styles.js";import{Avatar as E,AvatarImage as P,AvatarFallback as z}from"../../components/avatar.js";import{Container as A}from"../../components/container.js";import{Text as B}from"../../components/text.js";import{useExposure as R}from"../../hooks/useExposure.js";import{trackUrlRef as I}from"../../shared/trackUrlRef.js";import{useAiuiContext as F}from"../AiuiProvider/index.js";import{useTracking as H}from"../../hooks/useTracking.js";const u="copy",f="product_review",$=({data:e,configuration:o})=>{const{buildRef:d}=H(),p=x(null),[s,m]=k({visible:!1,x:0,y:0,text:""}),a=i=>{const l=Number(i),w=Number.isFinite(l)?Math.max(0,Math.floor(l)):0;return Array.from({length:w})||[]},c=i=>{e?.description&&m({visible:!0,x:i.clientX,y:i.clientY,text:e.description})},v=()=>{m(i=>({...i,visible:!1}))};return R(p,{componentType:u,componentName:f,componentTitle:e?.title,componentDescription:e?.description,position:o?.index+1}),t("div",{ref:p,className:n("bg-background tablet:hover:bg-info-white box-border w-full overflow-hidden duration-300","rounded-box","lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]","laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative","md-tablet:h-[360px]"),children:r("div",{className:"desktop:p-6 absolute inset-0 box-border flex flex-col overflow-hidden p-4",children:[r("div",{className:n("lg-desktop:mb-16 desktop:mb-10 mb-8 flex w-full justify-between"),children:[r("div",{className:"flex-1",children:[e?.title?t("h4",{className:"laptop:text-lg text-sm font-bold",children:e?.title}):null,t("div",{className:"mt-1 flex items-center",children:a(e?.rating)?.map?.((i,l)=>t("div",{className:"mr-1",children:t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:t("path",{d:"M7.32745 1.36274C7.60256 0.805304 8.39744 0.805305 8.67255 1.36274L10.1766 4.41035C10.2859 4.63171 10.4971 4.78514 10.7413 4.82063L14.1046 5.30934C14.7197 5.39873 14.9654 6.15471 14.5202 6.58861L12.0866 8.96084C11.9098 9.13315 11.8292 9.3814 11.8709 9.62469L12.4454 12.9743C12.5505 13.587 11.9074 14.0542 11.3572 13.765L8.349 12.1835C8.13051 12.0686 7.86949 12.0686 7.65099 12.1835L4.64282 13.765C4.0926 14.0542 3.44953 13.587 3.55461 12.9743L4.12912 9.62469C4.17085 9.3814 4.09019 9.13315 3.91342 8.96084L1.47976 6.58861C1.03462 6.15471 1.28025 5.39873 1.89542 5.30934L5.25866 4.82063C5.50294 4.78514 5.71412 4.63171 5.82336 4.41035L7.32745 1.36274Z",fill:"#F77234"})})},l))})]}),t("div",{className:"desktop:size-12 size-10 overflow-hidden",children:e?.avatar?.url?r(E,{className:"size-full",isAdaptation:!e?.avatar?.url,children:[t(P,{src:e?.avatar?.url}),t(z,{children:e?.title})]}):null})]}),r("div",{className:"flex-1",onMouseMove:c,onMouseLeave:v,children:[t(B,{className:n("lg-desktop:text-2xl text-info-primary evaluate-description line-clamp-5 break-words text-xl font-bold leading-[1.2]"),children:e?.description||""}),typeof window<"u"&&s.visible&&y(t("div",{className:"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200",style:{left:`${s.x+16}px`,top:`${s.y+16}px`},children:s.text}),document.body)]}),t("a",{href:I(M(e?.link||"",o?.locale||"us"),d(u,f)),onClick:()=>{o?.event?.primaryButton(e,o?.index+1)},"data-headless-type-name":`${u}#${f}`,"data-headless-title-desc-button":`${e?.title}#${e?.description||e?.subTitle}`,"data-headless-nav-position":`''#${o?.index+1}`,children:r("div",{className:n("mt-3 flex cursor-pointer items-center overflow-hidden bg-[#F7F8F9] p-3","rounded-box"),children:[t("div",{className:"laptop:size-16 desktop:size-20 mr-3 flex size-12 items-center",children:t(L,{className:"w-full object-cover",source:e?.img?.url,alt:e?.img?.alt||""})}),t("p",{className:"lg-desktop:text-[18px] desktop-[16px] line-clamp-2 flex-1 text-[14px] font-bold tracking-[-0.04em]",children:e?.subTitle||""})]})})]})})},b=h.forwardRef(({className:e="",data:o,key:d,...p},s)=>{const{products:m,title:a,theme:c,...v}=o,i=x(null),{locale:l="us"}=F();return g(s,()=>i.current),t("div",{...p,ref:i,className:e,children:t("div",{className:"evaluate-box relative z-10",children:t(A,{...o?.containerProps||{},className:"overflow-hidden",children:r("div",{ref:s,className:n("w-full",e,{"aiui-dark":c==="dark"}),children:[a&&t(N,{data:{title:a}}),t(T,{className:"!overflow-visible",id:"Evaluate"+d,data:{list:m,configuration:{...v,title:a,locale:l}},Slide:$,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}})]})})})})});b.displayName="Evaluate";var Q=C(b);export{Q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as n,jsxs as f}from"react/jsx-runtime";import*as r from"react";import{cn as l}from"../../helpers/index.js";import{withLayout as W}from"../../shared/Styles.js";import{Text as V,Picture as q,Heading as Z}from"../../components/index.js";import{Swiper as A,SwiperSlide as B}from"swiper/react";import{cva as b}from"class-variance-authority";import{buildSsrSlideCss as H}from"../SwiperBox/buildSsrSlideCss.js";import{useExposure as G}from"../../hooks/useExposure.js";const J="image",K="event_schedule",y=(e,s)=>{const d=Date.now(),c=new Date(e).getTime(),m=new Date(s).getTime();return d>m?"completed":d<c?"not-started":"in-progress"},O=b("h-1 w-full overflow-hidden",{variants:{state:{"in-progress-light":"bg-[#F6CD4E]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F6CD4E]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),Q=b("size-4 rounded-full transition-colors",{variants:{state:{"in-progress-light":"bg-[#F6CD4E]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F6CD4E]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),D=b("font-bold leading-[1.2]",{variants:{state:{"in-progress-light":"text-[#080A0F]","in-progress-dark":"text-white","not-started-light":"text-[#080A0F]","not-started-dark":"text-[#F5F6F7]","completed-light":"text-[#4A4C56]/60","completed-dark":"text-[#F5F6F7]/60"}},defaultVariants:{state:"not-started-light"}}),U=b("laptop:h-[160px] rounded-box relative flex h-[120px] min-w-0 flex-col justify-between gap-2 overflow-hidden",{variants:{state:{"in-progress-light":"bg-[#F4E8BC]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F4E8BC]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),X=({timeStatus:e,theme:s="light",className:d,index:c,nodeLength:m})=>{const o=`${e}-${s}`,a=c===0,i=c===m-1;return f("div",{className:l(`event-schedule-timeline-node event-schedule-timeline-node--${e} relative my-2 flex h-1 w-full items-center justify-center`,d),children:[n("div",{className:l(`event-schedule-timeline-progress event-schedule-timeline-progress--${e}`,O({state:o}),a&&"rounded-l-full",i&&"rounded-r-full")}),n("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2",children:n("div",{className:l(`event-schedule-timeline-dot event-schedule-timeline-dot--${e}`,Q({state:o}))})})]})},Y=(e,s)=>{if(e)return s==="in-progress"?e.active:s==="completed"&&e.completed||e.inactive},ee=({timeStatus:e,item:s,theme:d="light",className:c,scheduleCount:m})=>{const o=r.useMemo(()=>Y(s.icon,e),[s.icon,e]),a=`${e}-${d}`;return f("div",{className:l(`event-schedule-card event-schedule-card--${e}`,U({state:a}),c),children:[o&&n("div",{className:`event-schedule-card__background-icon event-schedule-card__background-icon--${e} laptop:w-[128px] desktop:w-[160px] absolute bottom-0 right-0 z-10 w-[120px]`,children:n(q,{source:o.url,alt:o.alt,className:"aspect-square"})}),f("div",{className:`event-schedule-card__content event-schedule-card__content--${e} tablet:px-4 tablet:py-3 desktop:pl-6 desktop:pr-16 relative z-20 flex h-full flex-col justify-between p-4 pr-8`,children:[n(Z,{html:s.title,className:l(`event-schedule-card__title event-schedule-card__title--${e}`,m>=4?"desktop:text-[24px]":"desktop:text-[32px]","laptop:text-[24px] line-clamp-1 text-[20px]",D({state:a}))}),n("div",{className:`event-schedule-card__details event-schedule-card__details--${e} flex flex-col gap-0.5`,children:s.items.map((i,h)=>f("div",{className:`event-schedule-card__detail-item event-schedule-card__detail-item--${e} flex items-center gap-2`,children:[i.icon&&n(V,{className:l(`event-schedule-card__detail-icon event-schedule-card__detail-icon--${e} desktop:size-6 size-5 shrink-0`,D({state:a})),html:i.icon}),n(V,{html:i.label,className:l(`event-schedule-card__detail-text event-schedule-card__detail-text--${e} lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 flex-1 text-[14px] leading-[1.4]`,D({state:a}))})]},h))})]})]})},P=r.forwardRef(({classNames:e={},data:s,className:d,...c},m)=>{const o=s.theme||"light",a=r.useRef(null);r.useImperativeHandle(m,()=>a.current),G(a,{componentType:J,componentName:K,componentTitle:s.scheduleList?.[0]?.title});const i=r.useRef(null),h=r.useRef(null),u=r.useRef(!1),v=r.useMemo(()=>s?.scheduleList?.length||2,[s?.scheduleList]),S=r.useMemo(()=>s.scheduleList.findIndex(t=>y(t.startDate,t.endDate)==="in-progress"),[s.scheduleList]),w=r.useCallback((t,g=!1)=>{const p=j=>{switch(j){case"mobile":return{slidesPerView:1.17};case"tablet":return t===2?{slidesPerView:2}:{slidesPerView:2.4};case"laptop":return t===2?{}:t===4?{slidesPerView:3.2}:{slidesPerView:t};case"desktop":return t===2?{slidesPerView:2}:{slidesPerView:t}}},M=p("mobile"),$=p("tablet"),I=p("laptop"),F=p("desktop");return g?{0:{...M,spaceBetween:12},768:{...$,spaceBetween:12},1024:{...I,spaceBetween:16},1440:{...F,spaceBetween:16}}:{0:M,768:$,1024:I,1440:F}},[]),x=r.useMemo(()=>w(v,!0),[v,w]),k=r.useMemo(()=>w(v,!1),[v,w]),L=r.useId().replace(/[^a-zA-Z0-9_-]/g,""),T=`swiper-ssr-timeline-${L}`,E=`swiper-ssr-cards-${L}`,C=r.useMemo(()=>H(`.${T}`,k),[T,k]),_=r.useMemo(()=>H(`.${E}`,x),[E,x]),N=s.showTimeline!==!1,R=r.useCallback(t=>{u.current||!h.current||(u.current=!0,h.current.slideTo(t.activeIndex,t.params.speed),setTimeout(()=>{u.current=!1},50))},[]),z=r.useCallback(t=>{u.current||!i.current||(u.current=!0,i.current.slideTo(t.activeIndex,t.params.speed),setTimeout(()=>{u.current=!1},50))},[]);return r.useEffect(()=>{i.current&&h.current&&S>=0&&setTimeout(()=>{u.current=!0,i.current?.slideTo(S,500),h.current?.slideTo(S,500),setTimeout(()=>{u.current=!1},600)},100)},[S]),f("div",{...c,ref:a,className:l("event-schedule-root overflow-hidden",e?.root,d),children:[N&&C&&n("style",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:C}}),_&&n("style",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:_}}),N&&n(A,{breakpoints:k,className:l("event-schedule-timeline h-4 w-full !overflow-visible",C&&T),onSwiper:t=>{h.current=t},onSlideChange:z,children:s.scheduleList.map((t,g)=>{const p=y(t.startDate,t.endDate);return n(B,{className:"",children:n(X,{className:e?.timeline,timeStatus:p,theme:o,index:g,nodeLength:s.scheduleList.length})},"timelineNode"+g)})}),n(A,{breakpoints:x,className:l("event-schedule-cards w-full !overflow-visible",_&&E),onSwiper:t=>{i.current=t},onSlideChange:R,children:s.scheduleList.map((t,g)=>{const p=y(t.startDate,t.endDate);return n(B,{children:n(ee,{timeStatus:p,className:l(N?"laptop:mt-4 mt-2":"",e?.eventScheduleCard),item:t,theme:o,scheduleCount:s.scheduleList.length})},"SwiperSlideItem"+g)})})]})});P.displayName="EventSchedule";var oe=W(P);export{oe as default};
|
|
@@ -3,10 +3,12 @@ import type { FaqProps, FaqItem as ItemType, FaqSemanticName } from './types.js'
|
|
|
3
3
|
interface FaqItemProps {
|
|
4
4
|
data: ItemType;
|
|
5
5
|
index: number;
|
|
6
|
+
/** 当前是否展开,用于点击埋点区分 expand / collapse;不传时按收起处理 */
|
|
7
|
+
isOpen?: boolean;
|
|
6
8
|
classNames?: Partial<Record<FaqSemanticName, string>>;
|
|
7
9
|
}
|
|
8
10
|
declare const FaqItem: {
|
|
9
|
-
({ data, index, classNames }: FaqItemProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
({ data, index, isOpen, classNames }: FaqItemProps): import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
displayName: string;
|
|
11
13
|
};
|
|
12
14
|
declare const _default: React.ForwardRefExoticComponent<Omit<FaqProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../index.js").ContainerProps & React.RefAttributes<unknown>> & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as
|
|
1
|
+
"use client";import{jsx as t,jsxs as d}from"react/jsx-runtime";import u,{useImperativeHandle as b,useRef as w}from"react";import*as r from"@radix-ui/react-accordion";import{Text as F,Heading as D}from"../../components/index.js";import{cn as a}from"../../helpers/index.js";import{withLayout as N}from"../../shared/Styles.js";import{useExposure as T}from"../../hooks/useExposure.js";import{toPlainTrackingText as g}from"../../shared/track.js";const h="copy",y="faq",x=u.forwardRef(({data:e,className:s,defaultOpenIndex:i,classNames:o={}},n)=>{const c=w(null);b(n,()=>c.current),T(c,{componentType:h,componentName:y,componentTitle:e?.productData?.[0]?.title,componentDescription:e?.productData?.[0]?.richDesc??e?.productData?.[0]?.desc});const v=(Array.isArray(i)?i:i!==void 0?[i]:e?.openFirst??!0?[0]:[]).map(m=>`item-${m}`),[f,q]=u.useState(v);return d("div",{ref:c,className:a(s,o.root),children:[t("style",{children:`
|
|
2
2
|
@keyframes faq-slide-down {
|
|
3
3
|
from { height: 0; opacity: 0; }
|
|
4
4
|
to { height: var(--radix-accordion-content-height); opacity: 1; }
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
from { height: var(--radix-accordion-content-height); opacity: 1; }
|
|
8
8
|
to { height: 0; opacity: 0; }
|
|
9
9
|
}
|
|
10
|
-
`}),t(r.Root,{type:"multiple",
|
|
10
|
+
`}),t(r.Root,{type:"multiple",value:f,onValueChange:q,children:e?.productData?.map((m,p)=>t(l,{data:m,index:p,classNames:o,isOpen:f.includes(`item-${p}`)},p))})]})});x.displayName="Faq";const l=({data:e,index:s,isOpen:i=!1,classNames:o={}})=>{const n={"data-headless-type-name":`${h}#${y}`,"data-headless-title-desc-button":`${g(e?.title)}#${g(e?.richDesc??e?.desc)}#${i?"collapse":"expand"}`,"data-headless-nav-position":`#${s+1}`};return d(r.Item,{value:`item-${s}`,className:a("tablet:py-6 border-b border-[#E4E5E6] py-4",o.item),children:[t(r.Header,{className:"flex",children:d(r.Trigger,{...n,className:a("tablet:gap-[128px] group flex flex-1 !cursor-pointer items-center justify-between gap-4 text-left",o.itemHeader),children:[t(D,{as:"h3",html:e?.title,className:a("desktop:text-base lg-desktop:text-lg text-info-primary text-sm font-bold leading-[1.4]",o.title)}),t("div",{className:a("transition-transform duration-300 group-data-[state=open]:rotate-180",o.icon),children:t("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-[20px]",width:"20",height:"21",viewBox:"0 0 20 21",fill:"none",children:t("path",{d:"M14.4111 7.41107C14.7365 7.08563 15.264 7.08563 15.5895 7.41107C15.9149 7.73651 15.9149 8.26402 15.5895 8.58946L10.5895 13.5895C10.264 13.9149 9.73651 13.9149 9.41107 13.5895L4.41107 8.58946C4.08563 8.26402 4.08563 7.73651 4.41107 7.41107C4.73651 7.08563 5.26402 7.08563 5.58946 7.41107L10.0003 11.8219L14.4111 7.41107Z",fill:"#1D1D1F"})})})]})}),t(r.Content,{forceMount:!0,className:a("overflow-hidden text-[#4A4C56]","data-[state=closed]:h-0 data-[state=closed]:opacity-0","data-[state=open]:animate-[faq-slide-down_300ms_ease-out]","data-[state=closed]:animate-[faq-slide-up_300ms_ease-out]",o.content),children:t("div",{className:"mt-2",children:t(F,{html:e?.richDesc??e?.desc,className:a("desktop:text-base lg-desktop:text-lg [&_a]:text-brand-0 text-sm font-bold leading-[1.4] [&_a]:underline",o.description)})})})]})};l.displayName="FaqItem";var P=N(x);export{l as FaqItem,P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as
|
|
1
|
+
"use client";import{Fragment as I,jsx as t,jsxs as l}from"react/jsx-runtime";import _,{useImperativeHandle as z,useRef as H}from"react";import{Heading as u,Picture as v,Text as c}from"../../components/index.js";import{cn as f}from"../../helpers/utils.js";import{withLayout as R}from"../../shared/Styles.js";import{useExposure as S}from"../../hooks/useExposure.js";import{trackUrlRef as j}from"../../shared/trackUrlRef.js";import{Swiper as L,SwiperSlide as $}from"swiper/react";import{useTracking as D}from"../../hooks/useTracking.js";const n="image",x="feature_cards",E=(a,r)=>r===2?a===0?"laptop:flex-[2]":"laptop:flex-[3]":r===3?"laptop:flex-[1]":r===4?a===0?"laptop:flex-[2]":a===1||a===2?"laptop:flex-[3]":"laptop:flex-[2]":r===5?a<3?"laptop:flex-[1]":a===3?"laptop:flex-[2]":"laptop:flex-[3]":"laptop:flex-[1]",P=(a,r)=>r===4&&a===1||r===5&&a===2,b=_.forwardRef(({data:a,className:r},k)=>{const{buildRef:N}=D(),{title:o,subtitle:i,items:p=[],theme:w="light",titleTag:y}=a,d=H(null);S(d,{componentType:n,componentName:x,componentTitle:o,componentDescription:i}),z(k,()=>d.current);const m="rounded-box",C=(e,s)=>{const h=l(I,{children:[t(v,{source:e.image?.url,alt:e.image?.alt||e.title,className:"feature-cards__card-image absolute inset-0 !h-full",imgClassName:"!h-full object-cover"}),l("div",{className:"feature-cards__card-content z-10",children:[t(u,{size:3,as:"h2",className:"feature-cards__card-title laptop:text-[20px] desktop:text-[32px] lg-desktop:text-[32px]",children:e.title}),t(c,{size:4,as:"p",className:"feature-cards__card-subtitle laptop:h-[42px] lg-desktop:h-[54px] lg-desktop:text-[18px] mt-[4px] line-clamp-2 h-[42px] text-[14px]",children:e.subtitle})]})]}),T="feature-cards__card relative flex h-[360px] max-h-[560px] flex-col justify-end gap-[16px] overflow-hidden px-[16px] py-[12px] text-info-primary tablet:h-[336px] laptop:h-[336px] laptop:px-[16px] laptop:py-[16px] desktop:h-[448px] desktop:px-[32px] desktop:py-[24px] lg-desktop:h-[560px]",F=s!==void 0?E(s,p.length):"flex-1",g=f(T,m,F,{"aiui-dark":e.theme==="dark","aiui-light":e.theme==="light"});return e.link?t("a",{href:j(e.link,N(n,x)),className:g,"data-headless-type-name":`${n}#${x}`,"data-headless-title-desc-button":`${o}#${e.title}#${e.subtitle}`,children:h}):t("div",{className:g,children:h})};return l("section",{ref:d,"data-ui-component-id":"FeatureCards",className:f("feature-cards text-info-primary flex w-full flex-col justify-center",{"aiui-dark":w==="dark"},r),children:[l("div",{className:"feature-cards__header",children:[t(u,{size:4,as:y??"h2",className:"feature-cards__title laptop:text-center text-left",children:o}),i&&t(c,{size:2,as:"p",className:"feature-cards__subtitle laptop:text-center desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-left text-[14px]",children:i})]}),t("div",{className:"feature-cards__grid laptop:mt-[32px] laptop:flex desktop:mt-[40px] lg-desktop:mt-[24px] mt-[24px] hidden w-full flex-wrap gap-[16px]",children:p.map((e,s)=>l(_.Fragment,{children:[C(e,s),P(s,p.length)&&t("div",{className:"laptop:basis-full laptop:h-0"})]},e.title))}),t("div",{className:"feature-cards__swiper-container laptop:hidden mt-[24px] w-full",children:t(L,{spaceBetween:12,slidesPerView:"auto",grabCursor:!0,className:"feature-cards__swiper relative w-full !overflow-visible",children:p.map(e=>t($,{className:"feature-cards__swiper-slide relative !h-[360px] !w-[296px]",children:l("div",{className:f("feature-cards__card feature-cards__card--mobile text-info-primary absolute inset-0 flex flex-1 flex-col justify-end gap-[16px] overflow-hidden px-[16px] py-[12px]",m,{"aiui-dark":e.theme==="dark","aiui-light":e.theme==="light"}),children:[t(v,{source:e.image?.url,alt:e.image?.alt||e.title,className:"feature-cards__card-image absolute inset-0 !h-full",imgClassName:"!h-full object-cover"}),l("div",{className:"feature-cards__card-content z-10",children:[t(u,{size:3,as:"h2",className:"feature-cards__card-title",children:e.title}),t(c,{size:4,as:"p",className:"feature-cards__card-subtitle laptop:h-[42px] lg-desktop:h-[54px] lg-desktop:text-[18px] mt-[4px] line-clamp-2 h-[42px] overflow-visible text-[14px]",children:e.subtitle})]})]},e.title)},e.title))})})]})});b.displayName="FeatureCards";var K=R(b,{style:"overflow: hidden;"});export{K as default};
|