@anker-in/headless-ui 1.0.16 → 1.0.17

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.
Files changed (92) hide show
  1. package/dist/cjs/biz-components/AccordionCards/index.js +1 -1
  2. package/dist/cjs/biz-components/AccordionCards/index.js.map +3 -3
  3. package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
  4. package/dist/cjs/biz-components/AiuiProvider/index.js.map +2 -2
  5. package/dist/cjs/biz-components/Category/SwiperCategory.js +1 -1
  6. package/dist/cjs/biz-components/Category/SwiperCategory.js.map +2 -2
  7. package/dist/cjs/biz-components/Category/index.js +1 -1
  8. package/dist/cjs/biz-components/Category/index.js.map +3 -3
  9. package/dist/cjs/biz-components/Evaluate/index.js +1 -1
  10. package/dist/cjs/biz-components/Evaluate/index.js.map +3 -3
  11. package/dist/cjs/biz-components/Graphic/index.js +1 -1
  12. package/dist/cjs/biz-components/Graphic/index.js.map +3 -3
  13. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
  14. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +2 -2
  15. package/dist/cjs/biz-components/MediaPlayerBase/index.js +1 -1
  16. package/dist/cjs/biz-components/MediaPlayerBase/index.js.map +3 -3
  17. package/dist/cjs/biz-components/MediaPlayerMulti/index.js +1 -1
  18. package/dist/cjs/biz-components/MediaPlayerMulti/index.js.map +3 -3
  19. package/dist/cjs/biz-components/MediaPlayerSticky/index.js +1 -1
  20. package/dist/cjs/biz-components/MediaPlayerSticky/index.js.map +2 -2
  21. package/dist/cjs/biz-components/MemberEquity/index.js +2 -2
  22. package/dist/cjs/biz-components/MemberEquity/index.js.map +2 -2
  23. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  24. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
  25. package/dist/cjs/biz-components/ShelfDisplay/index.js +1 -1
  26. package/dist/cjs/biz-components/ShelfDisplay/index.js.map +3 -3
  27. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js +1 -1
  28. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js.map +2 -2
  29. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +4 -4
  30. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
  31. package/dist/cjs/biz-components/TextModal/index.js +1 -1
  32. package/dist/cjs/biz-components/TextModal/index.js.map +2 -2
  33. package/dist/cjs/biz-components/Title/index.js +1 -1
  34. package/dist/cjs/biz-components/Title/index.js.map +3 -3
  35. package/dist/cjs/biz-components/Title/types.d.ts +1 -0
  36. package/dist/cjs/biz-components/Title/types.js +1 -1
  37. package/dist/cjs/biz-components/Title/types.js.map +1 -1
  38. package/dist/cjs/components/board.d.ts +3 -1
  39. package/dist/cjs/components/board.js +1 -1
  40. package/dist/cjs/components/board.js.map +3 -3
  41. package/dist/cjs/components/dialog.js +1 -1
  42. package/dist/cjs/components/dialog.js.map +2 -2
  43. package/dist/cjs/components/picture.js +1 -1
  44. package/dist/cjs/components/picture.js.map +3 -3
  45. package/dist/cjs/hooks/useIntersectionObserver.js +1 -1
  46. package/dist/cjs/hooks/useIntersectionObserver.js.map +3 -3
  47. package/dist/esm/biz-components/AccordionCards/index.js +1 -1
  48. package/dist/esm/biz-components/AccordionCards/index.js.map +3 -3
  49. package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
  50. package/dist/esm/biz-components/AiuiProvider/index.js.map +2 -2
  51. package/dist/esm/biz-components/Category/SwiperCategory.js +1 -1
  52. package/dist/esm/biz-components/Category/SwiperCategory.js.map +2 -2
  53. package/dist/esm/biz-components/Category/index.js +1 -1
  54. package/dist/esm/biz-components/Category/index.js.map +3 -3
  55. package/dist/esm/biz-components/Evaluate/index.js +1 -1
  56. package/dist/esm/biz-components/Evaluate/index.js.map +3 -3
  57. package/dist/esm/biz-components/Graphic/index.js +1 -1
  58. package/dist/esm/biz-components/Graphic/index.js.map +3 -3
  59. package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
  60. package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +2 -2
  61. package/dist/esm/biz-components/MediaPlayerBase/index.js +1 -1
  62. package/dist/esm/biz-components/MediaPlayerBase/index.js.map +3 -3
  63. package/dist/esm/biz-components/MediaPlayerMulti/index.js +1 -1
  64. package/dist/esm/biz-components/MediaPlayerMulti/index.js.map +3 -3
  65. package/dist/esm/biz-components/MediaPlayerSticky/index.js +1 -1
  66. package/dist/esm/biz-components/MediaPlayerSticky/index.js.map +2 -2
  67. package/dist/esm/biz-components/MemberEquity/index.js +2 -2
  68. package/dist/esm/biz-components/MemberEquity/index.js.map +2 -2
  69. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  70. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
  71. package/dist/esm/biz-components/ShelfDisplay/index.js +1 -1
  72. package/dist/esm/biz-components/ShelfDisplay/index.js.map +3 -3
  73. package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js +1 -1
  74. package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js.map +2 -2
  75. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +9 -9
  76. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
  77. package/dist/esm/biz-components/TextModal/index.js +1 -1
  78. package/dist/esm/biz-components/TextModal/index.js.map +2 -2
  79. package/dist/esm/biz-components/Title/index.js +1 -1
  80. package/dist/esm/biz-components/Title/index.js.map +3 -3
  81. package/dist/esm/biz-components/Title/types.d.ts +1 -0
  82. package/dist/esm/components/board.d.ts +3 -1
  83. package/dist/esm/components/board.js +1 -1
  84. package/dist/esm/components/board.js.map +3 -3
  85. package/dist/esm/components/dialog.js +1 -1
  86. package/dist/esm/components/dialog.js.map +2 -2
  87. package/dist/esm/components/picture.js +1 -1
  88. package/dist/esm/components/picture.js.map +3 -3
  89. package/dist/esm/hooks/useIntersectionObserver.js +1 -1
  90. package/dist/esm/hooks/useIntersectionObserver.js.map +3 -3
  91. package/package.json +1 -1
  92. package/style.css +3 -0
@@ -1,10 +1,10 @@
1
- import{Fragment as D,jsx as l,jsxs as p}from"react/jsx-runtime";import{useAiuiContext as I}from"../AiuiProvider/index.js";import{formatVariantPrice as T}from"./shelfDisplay.js";import C from"../../components/picture.js";import P from"../../components/badge.js";import{cn as m}from"../../helpers/utils.js";import{Text as $}from"../../components/text.js";import y from"../../components/button.js";import{gaTrack as j}from"../../shared/track.js";import{trackUrlRef as O}from"../../shared/trackUrlRef.js";import{Heading as z}from"../../components/heading.js";const F="image",H="product_shelf",L=999999999e-2,Q=({data:e,configuration:t})=>{const{isDisplayBackImage:f=!1,itemShape:h}=t||{},{locale:r="us",copyWriting:k}=I(),w=(o,s,i)=>t?.event?.primaryButton?.(o,s+1,i),g=(o,s,i)=>t?.event?.secondaryButton?.(o,s+1,i),a=e?.variants?.find(o=>o?.sku===e?.sku)||e?.variants?.[0]||{},S=!a?.availableForSale&&a?.price?.amount===L,_=t?.isShowTag,u=t?.isShowOriginalPrice,c=a?.coupons?.[0],{price:N,basePrice:B}=T({locale:r,amount:u&&c?c.variant_price4wscode:a.price,baseAmount:u&&c?a.price:0,currencyCode:e?.price?.currencyCode||"USD"}),b=()=>{const o=e?.sku,s=e?.variants;return s?.find(x=>x?.sku===o)?.image?.url||s?.[0]?.image?.url||""},n=e?.custom_name||e?.title,v=e?.custom_description||e?.description,d=()=>p(D,{children:[_?l("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:e?.tags?.filter?.(o=>o?.startsWith?.("CLtag"))?.map?.(o=>o?.replace?.("CLtag:",""))?.slice?.(0,2)?.map?.((o,s)=>l(P,{children:o},s))}):null,n?l(z,{as:"h3",title:n||"",size:2,className:"shelf-display-product-title mb-1 line-clamp-2",html:n||""}):null,v?l($,{size:2,className:"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description line-clamp-1 h-5 text-sm",html:v||""}):null,l("div",{className:"mb-2 mt-5 flex items-center",children:S?l("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:k?.soldOutText}):p(D,{children:[l("div",{className:"final-price tablet:text-2xl text-info-primary text-xl font-bold",children:a?.availableForSale&&N||""}),l("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:a?.availableForSale&&B||""})]})}),p("div",{className:m("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?l(y,{variant:"secondary",onClick:()=>g(e,t?.index,t),className:`
2
- ${t.direction==="vertical"?"w-full":""}
3
- `,children:t?.secondaryButton||""}):null,t?.primaryButton?l(y,{variant:"primary",onClick:()=>w(e,t?.index,t),className:`
4
- ${t.direction==="vertical"?"w-full":""}
5
- `,children:t?.primaryButton||""}):null]})]});return l("div",{className:m("bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full cursor-pointer overflow-hidden duration-300",h==="round"?"rounded-2xl":"rounded-none","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:f?l("div",{className:"absolute inset-0 box-border overflow-hidden",children:p("div",{className:"relative inset-0 size-full",children:[l(C,{source:b(),alt:"",className:"flex h-full justify-center object-cover [&_img]:w-auto"}),l("div",{className:"desktop:p-6 absolute inset-x-0 bottom-0 box-border overflow-hidden p-4",children:d()})]})}):p("div",{className:"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4",children:[l("div",{className:m("lg-desktop:mb-3 lg-desktop:h-[195px] relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden"),children:l("a",{"aria-label":n,target:t?.target,href:O(`${r==="us"||!r?"":`/${r}`}/products/${e?.handle}`,`${F}_${H}`),onClick:()=>{j({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||a?.sku,item_name:e?.name,item_variant:a?.name,price:a?.price,index:t?.index+1}]}})},children:l(C,{source:b(),alt:"",className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),d()]})},e?.id||e?.handle)},X=({data:e,configuration:t})=>{const{itemShape:f,itemLength:h}=t||{},{locale:r="us",copyWriting:k}=I(),w=(s,i,x)=>t?.event?.primaryButton?.(s,i+1,x),g=(s,i,x)=>t?.event?.secondaryButton?.(s,i+1,x),a=e?.variants?.find(s=>s?.sku===e?.sku)||e?.variants?.[0]||{},S=!a?.availableForSale&&a?.price?.amount===L,_=t?.isShowTag,u=t?.isShowOriginalPrice,c=a?.coupons?.[0],{price:N,basePrice:B}=T({locale:r,amount:u&&c?c.variant_price4wscode:a.price,baseAmount:u&&c?a.price:0,currencyCode:e?.price?.currencyCode||"USD"}),b=()=>{const s=e?.sku,i=e?.variants;return i?.find(U=>U?.sku===s)?.image?.url||i?.[0]?.image?.url||""},n=e?.custom_name||e?.title,v=e?.custom_description||e?.description,d=()=>h>=2?{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] max-w-full",imgItem:"m-tablet:m-auto lg-desktop:max-w-[330px] lg-desktop:max-h-[330px] desktop:max-w-[260px] desktop:max-h-[260px] max-w-[138px] max-h-[138px]",wrap:"lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480] desktop:aspect-w-[648] desktop:aspect-h-[380] laptop:aspect-w-[440] laptop:aspect-h-[356] tablet:aspect-w-[346] tablet:aspect-h-[360] md-tablet:w-full"}:{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] laptop:max-w-[289px] max-w-[262px]",imgItem:"md-tablet:m-auto lg-desktop:max-w-[450px] lg-desktop:max-h-[450px] desktop:max-w-[332px] desktop:max-h-[332px] max-w-[312px] max-h-[312px]",wrap:"lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[480] desktop:aspect-w-[1312] desktop:aspect-h-[380] laptop:aspect-w-[896] laptop:aspect-h-[356] tablet:aspect-w-[704] tablet:aspect-h-[360] md-tablet:w-full"},o=()=>h>=2?"flex flex-col justify-between desktop:gap-12 desktop:flex-row desktop:justify-center desktop:items-center":"flex justify-center items-center gap-6 md-tablet:flex-col";return l("div",{className:m(d().wrap,f==="round"?"rounded-2xl":"rounded-none","bg-container-secondary-1 tablet:hover:bg-info-white duration-300 gap-6","box-border w-full cursor-pointer overflow-hidden relative md-tablet:h-[360px]"),children:p("div",{className:m(o(),"desktop:p-6 absolute inset-0 box-border overflow-hidden p-4"),children:[l("div",{className:m(d().imgItem,"relative overflow-hidden desktop:mb-0 mb-1"),children:l("a",{"aria-label":n,target:t?.target,href:O(`${r==="us"||!r?"":`/${r}`}/products/${e?.handle}`,`${F}_${H}`),onClick:()=>{j({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||a?.sku,item_name:e?.name,item_variant:a?.name,price:a?.price,index:t?.index+1}]}})},children:l(C,{source:b(),alt:"",className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),p("div",{className:m("flex flex-col justify-center items-start",d().boxItem),children:[_?l("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:e?.tags?.filter?.(s=>s?.startsWith?.("CLtag"))?.map?.(s=>s?.replace?.("CLtag:",""))?.slice?.(0,2)?.map?.((s,i)=>l(P,{children:s},i))}):null,n?l(z,{as:"h3",title:n||"",size:2,className:"shelf-display-product-title mb-1 line-clamp-2",html:n||""}):null,v?l($,{size:2,className:"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description line-clamp-1 h-5 text-sm",html:v||""}):null,l("div",{className:"mb-2 mt-5 flex items-center",children:S?l("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:k?.soldOutText}):p(D,{children:[l("div",{className:"final-price tablet:text-2xl text-info-primary text-xl font-bold",children:a?.availableForSale&&N||""}),l("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:a?.availableForSale&&B||""})]})}),p("div",{className:m("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?l(y,{variant:"secondary",onClick:()=>g(e,t?.index,t),className:`
6
- ${t.direction==="vertical"?"w-full":""}
7
- `,children:t?.secondaryButton||""}):null,t?.primaryButton?l(y,{variant:"primary",onClick:()=>w(e,t?.index,t),className:`
8
- ${t.direction==="vertical"?"w-full":""}
9
- `,children:t?.primaryButton||""}):null]})]})]})},e?.id||e?.handle)};export{X as ShelfDisplayHorizontalItem,Q as ShelfDisplayWrapItem};
1
+ import{Fragment as P,jsx as l,jsxs as p}from"react/jsx-runtime";import{useAiuiContext as $}from"../AiuiProvider/index.js";import{formatVariantPrice as j}from"./shelfDisplay.js";import I from"../../components/picture.js";import O from"../../components/badge.js";import{cn as m}from"../../helpers/utils.js";import{Text as H}from"../../components/text.js";import y from"../../components/button.js";import{gaTrack as L}from"../../shared/track.js";import{trackUrlRef as z}from"../../shared/trackUrlRef.js";import{Heading as E}from"../../components/heading.js";import{useExposure as F}from"../../hooks/useExposure.js";import{useRef as U}from"react";const k="image",w="product_shelf",W=999999999e-2,te=({data:t,configuration:e})=>{const{isDisplayBackImage:g=!1,itemShape:f}=e||{},{locale:n="us",copyWriting:S}=$(),v=U(null),_=(o,s,i)=>e?.event?.primaryButton?.(o,s+1,i),N=(o,s,i)=>e?.event?.secondaryButton?.(o,s+1,i),a=t?.variants?.find(o=>o?.sku===t?.sku)||t?.variants?.[0]||{},B=!a?.availableForSale&&a?.price?.amount===W,D=e?.isShowTag,h=e?.isShowOriginalPrice,c=a?.coupons?.[0],{price:T,basePrice:C}=j({locale:n,amount:h&&c?c.variant_price4wscode:a.price,baseAmount:h&&c?a.price:0,currencyCode:t?.price?.currencyCode||"USD"}),b=()=>{const o=t?.sku,s=t?.variants;return s?.find(u=>u?.sku===o)?.image?.url||s?.[0]?.image?.url||""},r=t?.custom_name||t?.title,d=t?.custom_description||t?.description;F(v,{componentType:k,componentName:w,componentTitle:r,componentDescription:d,position:e?.index+1});const x=()=>p(P,{children:[D?l("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:t?.tags?.filter?.(o=>o?.startsWith?.("CLtag"))?.map?.(o=>o?.replace?.("CLtag:",""))?.slice?.(0,2)?.map?.((o,s)=>l(O,{children:o},s))}):null,r?l(E,{as:"h3",title:r||"",size:2,className:"shelf-display-product-title mb-1 line-clamp-2",html:r||""}):null,d?l(H,{size:2,className:"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description line-clamp-1 h-5 text-sm",html:d||""}):null,l("div",{className:"mb-2 mt-5 flex items-center",children:B?l("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:S?.soldOutText}):p(P,{children:[l("div",{className:"final-price tablet:text-2xl text-info-primary text-xl font-bold",children:a?.availableForSale&&T||""}),l("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:a?.availableForSale&&C||""})]})}),p("div",{className:m("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",e.direction==="vertical"?"flex-col":""),children:[e?.secondaryButton?l(y,{variant:"secondary",onClick:()=>N(t,e?.index,e),className:`
2
+ ${e.direction==="vertical"?"w-full":""}
3
+ `,children:e?.secondaryButton||""}):null,e?.primaryButton?l(y,{variant:"primary",onClick:()=>_(t,e?.index,e),className:`
4
+ ${e.direction==="vertical"?"w-full":""}
5
+ `,children:e?.primaryButton||""}):null]})]});return l("div",{ref:v,className:m("bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full cursor-pointer overflow-hidden duration-300",f==="round"?"rounded-2xl":"rounded-none","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:g?l("div",{className:"absolute inset-0 box-border overflow-hidden",children:p("div",{className:"relative inset-0 size-full",children:[l(I,{source:b(),alt:"",className:"flex h-full justify-center object-cover [&_img]:w-auto"}),l("div",{className:"desktop:p-6 absolute inset-x-0 bottom-0 box-border overflow-hidden p-4",children:x()})]})}):p("div",{className:"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4",children:[l("div",{className:m("lg-desktop:mb-3 lg-desktop:h-[195px] relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden"),children:l("a",{"aria-label":r,target:e?.target,href:z(`${n==="us"||!n?"":`/${n}`}/products/${t?.handle}`,`${k}_${w}`),onClick:()=>{L({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:t?.sku||a?.sku,item_name:t?.name,item_variant:a?.name,price:a?.price,index:e?.index+1}]}})},children:l(I,{source:b(),alt:"",className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),x()]})},t?.id||t?.handle)},le=({data:t,configuration:e})=>{const{itemShape:g,itemLength:f}=e||{},{locale:n="us",copyWriting:S}=$(),v=U(null),_=(s,i,u)=>e?.event?.primaryButton?.(s,i+1,u),N=(s,i,u)=>e?.event?.secondaryButton?.(s,i+1,u),a=t?.variants?.find(s=>s?.sku===t?.sku)||t?.variants?.[0]||{},B=!a?.availableForSale&&a?.price?.amount===W,D=e?.isShowTag,h=e?.isShowOriginalPrice,c=a?.coupons?.[0],{price:T,basePrice:C}=j({locale:n,amount:h&&c?c.variant_price4wscode:a.price,baseAmount:h&&c?a.price:0,currencyCode:t?.price?.currencyCode||"USD"}),b=()=>{const s=t?.sku,i=t?.variants;return i?.find(A=>A?.sku===s)?.image?.url||i?.[0]?.image?.url||""},r=t?.custom_name||t?.title,d=t?.custom_description||t?.description;F(v,{componentType:k,componentName:w,componentTitle:r,componentDescription:d,position:e?.index+1});const x=()=>f>=2?{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] max-w-full",imgItem:"m-tablet:m-auto lg-desktop:max-w-[330px] lg-desktop:max-h-[330px] desktop:max-w-[260px] desktop:max-h-[260px] max-w-[138px] max-h-[138px]",wrap:"lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480] desktop:aspect-w-[648] desktop:aspect-h-[380] laptop:aspect-w-[440] laptop:aspect-h-[356] tablet:aspect-w-[346] tablet:aspect-h-[360] md-tablet:w-full"}:{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] laptop:max-w-[289px] max-w-[262px]",imgItem:"md-tablet:m-auto lg-desktop:max-w-[450px] lg-desktop:max-h-[450px] desktop:max-w-[332px] desktop:max-h-[332px] max-w-[312px] max-h-[312px]",wrap:"lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[480] desktop:aspect-w-[1312] desktop:aspect-h-[380] laptop:aspect-w-[896] laptop:aspect-h-[356] tablet:aspect-w-[704] tablet:aspect-h-[360] md-tablet:w-full"},o=()=>f>=2?"flex flex-col justify-between desktop:gap-12 desktop:flex-row desktop:justify-center desktop:items-center":"flex justify-center items-center gap-6 md-tablet:flex-col";return l("div",{ref:v,className:m(x().wrap,g==="round"?"rounded-2xl":"rounded-none","bg-container-secondary-1 tablet:hover:bg-info-white duration-300 gap-6","box-border w-full cursor-pointer overflow-hidden relative md-tablet:h-[360px]"),children:p("div",{className:m(o(),"desktop:p-6 absolute inset-0 box-border overflow-hidden p-4"),children:[l("div",{className:m(x().imgItem,"relative overflow-hidden desktop:mb-0 mb-1"),children:l("a",{"aria-label":r,target:e?.target,href:z(`${n==="us"||!n?"":`/${n}`}/products/${t?.handle}`,`${k}_${w}`),onClick:()=>{L({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:t?.sku||a?.sku,item_name:t?.name,item_variant:a?.name,price:a?.price,index:e?.index+1}]}})},children:l(I,{source:b(),alt:"",className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),p("div",{className:m("flex flex-col justify-center items-start",x().boxItem),children:[D?l("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:t?.tags?.filter?.(s=>s?.startsWith?.("CLtag"))?.map?.(s=>s?.replace?.("CLtag:",""))?.slice?.(0,2)?.map?.((s,i)=>l(O,{children:s},i))}):null,r?l(E,{as:"h3",title:r||"",size:2,className:"shelf-display-product-title mb-1 line-clamp-2",html:r||""}):null,d?l(H,{size:2,className:"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description line-clamp-1 h-5 text-sm",html:d||""}):null,l("div",{className:"mb-2 mt-5 flex items-center",children:B?l("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:S?.soldOutText}):p(P,{children:[l("div",{className:"final-price tablet:text-2xl text-info-primary text-xl font-bold",children:a?.availableForSale&&T||""}),l("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:a?.availableForSale&&C||""})]})}),p("div",{className:m("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",e.direction==="vertical"?"flex-col":""),children:[e?.secondaryButton?l(y,{variant:"secondary",onClick:()=>N(t,e?.index,e),className:`
6
+ ${e.direction==="vertical"?"w-full":""}
7
+ `,children:e?.secondaryButton||""}):null,e?.primaryButton?l(y,{variant:"primary",onClick:()=>_(t,e?.index,e),className:`
8
+ ${e.direction==="vertical"?"w-full":""}
9
+ `,children:e?.primaryButton||""}):null]})]})]})},t?.id||t?.handle)};export{le as ShelfDisplayHorizontalItem,te as ShelfDisplayWrapItem};
10
10
  //# sourceMappingURL=shelfDisplayItem.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/ShelfDisplay/shelfDisplayItem.tsx"],
4
- "sourcesContent": ["import { useAiuiContext } from '../AiuiProvider/index.js'\nimport { formatVariantPrice } from './shelfDisplay.js'\nimport Picture from '../../components/picture.js'\nimport Badge from '../../components/badge.js'\nimport { cn } from '../../helpers/utils.js'\nimport { Text } from '../../components/text.js'\nimport Button from '../../components/button.js'\nimport { gaTrack } from '../../shared/track.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { Heading } from '../../components/heading.js'\nimport type { ShelfDisplayItem, ShelfDisplayType } from './shelfDisplay.js'\n\nconst componentType = 'image'\nconst componentName = 'product_shelf'\n\nconst SOLD_OUT_PRICE = 9999999.99\n\nexport const ShelfDisplayWrapItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const { isDisplayBackImage = false, itemShape } = configuration || {}\n const { locale = 'us', copyWriting } = useAiuiContext()\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType) =>\n configuration?.event?.primaryButton?.(params, index + 1, data)\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType) =>\n configuration?.event?.secondaryButton?.(params, index + 1, data)\n\n const variant = data?.variants?.find((item: any) => item?.sku === data?.sku) || data?.variants?.[0] || {}\n\n const isSoldOut = !variant?.availableForSale && variant?.price?.amount === SOLD_OUT_PRICE\n const isShowTag = configuration?.isShowTag\n const isShowOriginalPrice = configuration?.isShowOriginalPrice\n\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n\n const { price, basePrice } = formatVariantPrice({\n locale: locale,\n amount: isShowOriginalPrice && coupon ? coupon.variant_price4wscode : variant.price,\n baseAmount: isShowOriginalPrice && coupon ? variant.price : 0,\n currencyCode: data?.price?.currencyCode || 'USD',\n })\n\n const handleUrl = () => {\n const sku = data?.sku\n const skuArray = data?.variants\n const findSku = skuArray?.find((item: any) => item?.sku === sku)\n return findSku?.image?.url || skuArray?.[0]?.image?.url || ''\n }\n\n const displayTitle = data?.custom_name || data?.title\n const displayDescription = data?.custom_description || data?.description\n\n const bottomContent = () => {\n return (\n <>\n {isShowTag ? (\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {data?.tags\n ?.filter?.((item: any) => item?.startsWith?.('CLtag'))\n ?.map?.((item: any) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, 2)\n ?.map?.((item: any, index: number) => <Badge key={index}>{item}</Badge>)}\n </div>\n ) : null}\n {displayTitle ? (\n <Heading\n as=\"h3\"\n title={displayTitle || ''}\n size={2}\n className=\"shelf-display-product-title mb-1 line-clamp-2\"\n html={displayTitle || ''}\n />\n ) : null}\n {displayDescription ? (\n <Text\n size={2}\n className=\"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description line-clamp-1 h-5 text-sm\"\n html={displayDescription || ''}\n />\n ) : null}\n <div className=\"mb-2 mt-5 flex items-center\">\n {isSoldOut ? (\n <div className=\"tablet:text-2xl text-info-primary text-xl font-bold\">{copyWriting?.soldOutText}</div>\n ) : (\n <>\n <div className=\"final-price tablet:text-2xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n <div className=\"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through\">\n {variant?.availableForSale ? basePrice || '' : ''}\n </div>\n </>\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn(\n 'shelf-flex-button-group',\n 'lg-desktop:gap-3 flex items-center gap-2',\n configuration.direction === 'vertical' ? 'flex-col' : ''\n )}\n >\n {configuration?.secondaryButton ? (\n <Button\n variant=\"secondary\"\n onClick={() => onSecondaryButton(data, configuration?.index, configuration)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n variant=\"primary\"\n onClick={() => onPrimaryButton(data, configuration?.index, configuration)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.primaryButton || ''}\n </Button>\n ) : null}\n </div>\n </>\n )\n }\n\n return (\n <div\n key={data?.id || data?.handle}\n className={cn(\n 'bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full cursor-pointer overflow-hidden duration-300',\n itemShape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative',\n 'md-tablet:h-[360px]'\n )}\n >\n {isDisplayBackImage ? (\n <div className=\"absolute inset-0 box-border overflow-hidden\">\n <div className=\"relative inset-0 size-full\">\n <Picture source={handleUrl()} alt=\"\" className=\"flex h-full justify-center object-cover [&_img]:w-auto\" />\n <div className=\"desktop:p-6 absolute inset-x-0 bottom-0 box-border overflow-hidden p-4\">\n {bottomContent()}\n </div>\n </div>\n </div>\n ) : (\n <div className=\"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4\">\n <div\n className={cn(\n 'lg-desktop:mb-3 lg-desktop:h-[195px] relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden'\n )}\n >\n <a\n aria-label={displayTitle}\n target={configuration?.target}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}`,\n `${componentType}_${componentName}`\n )}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'select_item',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: [\n {\n item_id: data?.sku || variant?.sku,\n item_name: data?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: configuration?.index + 1,\n },\n ],\n },\n })\n }}\n >\n <Picture source={handleUrl()} alt=\"\" className=\"flex h-full justify-center object-cover [&_img]:w-auto\" />\n </a>\n </div>\n {bottomContent()}\n </div>\n )}\n </div>\n )\n}\n\nexport const ShelfDisplayHorizontalItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const { itemShape, itemLength } = configuration || {}\n const { locale = 'us', copyWriting } = useAiuiContext()\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType) =>\n configuration?.event?.primaryButton?.(params, index + 1, data)\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType) =>\n configuration?.event?.secondaryButton?.(params, index + 1, data)\n\n const variant = data?.variants?.find((item: any) => item?.sku === data?.sku) || data?.variants?.[0] || {}\n\n const isSoldOut = !variant?.availableForSale && variant?.price?.amount === SOLD_OUT_PRICE\n const isShowTag = configuration?.isShowTag\n const isShowOriginalPrice = configuration?.isShowOriginalPrice\n\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n\n const { price, basePrice } = formatVariantPrice({\n locale: locale,\n amount: isShowOriginalPrice && coupon ? coupon.variant_price4wscode : variant.price,\n baseAmount: isShowOriginalPrice && coupon ? variant.price : 0,\n currencyCode: data?.price?.currencyCode || 'USD',\n })\n\n const handleUrl = () => {\n const sku = data?.sku\n const skuArray = data?.variants\n const findSku = skuArray?.find((item: any) => item?.sku === sku)\n return findSku?.image?.url || skuArray?.[0]?.image?.url || ''\n }\n\n const displayTitle = data?.custom_name || data?.title\n const displayDescription = data?.custom_description || data?.description\n\n const showSizeClass = (): {\n boxItem: string \n imgItem: string\n wrap: string\n } => {\n if (itemLength >= 2) {\n return {\n boxItem: 'lg-desktop:max-w-[401px] desktop:max-w-[292px] max-w-full',\n imgItem:\n 'm-tablet:m-auto lg-desktop:max-w-[330px] lg-desktop:max-h-[330px] desktop:max-w-[260px] desktop:max-h-[260px] max-w-[138px] max-h-[138px]',\n wrap: 'lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480] desktop:aspect-w-[648] desktop:aspect-h-[380] laptop:aspect-w-[440] laptop:aspect-h-[356] tablet:aspect-w-[346] tablet:aspect-h-[360] md-tablet:w-full',\n }\n }\n return {\n boxItem: 'lg-desktop:max-w-[401px] desktop:max-w-[292px] laptop:max-w-[289px] max-w-[262px]',\n imgItem:\n 'md-tablet:m-auto lg-desktop:max-w-[450px] lg-desktop:max-h-[450px] desktop:max-w-[332px] desktop:max-h-[332px] max-w-[312px] max-h-[312px]',\n wrap: 'lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[480] desktop:aspect-w-[1312] desktop:aspect-h-[380] laptop:aspect-w-[896] laptop:aspect-h-[356] tablet:aspect-w-[704] tablet:aspect-h-[360] md-tablet:w-full',\n }\n }\n \n const handleWrapClass = () => {\n if (itemLength >= 2) {\n return 'flex flex-col justify-between desktop:gap-12 desktop:flex-row desktop:justify-center desktop:items-center'\n }\n return 'flex justify-center items-center gap-6 md-tablet:flex-col'\n }\n\n return (\n <div\n key={data?.id || data?.handle}\n className={cn(\n showSizeClass().wrap,\n itemShape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'bg-container-secondary-1 tablet:hover:bg-info-white duration-300 gap-6',\n 'box-border w-full cursor-pointer overflow-hidden relative md-tablet:h-[360px]'\n )}\n >\n <div className={cn(handleWrapClass(), 'desktop:p-6 absolute inset-0 box-border overflow-hidden p-4')}>\n <div className={cn(showSizeClass().imgItem, 'relative overflow-hidden desktop:mb-0 mb-1')}>\n <a\n aria-label={displayTitle}\n target={configuration?.target}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}`,\n `${componentType}_${componentName}`\n )}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'select_item',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: [\n {\n item_id: data?.sku || variant?.sku,\n item_name: data?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: configuration?.index + 1,\n },\n ],\n },\n })\n }}\n >\n <Picture source={handleUrl()} alt=\"\" className=\"flex h-full justify-center object-cover [&_img]:w-auto\" />\n </a>\n </div>\n <div className={cn('flex flex-col justify-center items-start', showSizeClass().boxItem)}>\n {isShowTag ? (\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {data?.tags\n ?.filter?.((item: any) => item?.startsWith?.('CLtag'))\n ?.map?.((item: any) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, 2)\n ?.map?.((item: any, index: number) => <Badge key={index}>{item}</Badge>)}\n </div>\n ) : null}\n {displayTitle ? (\n <Heading\n as=\"h3\"\n title={displayTitle || ''}\n size={2}\n className=\"shelf-display-product-title mb-1 line-clamp-2\"\n html={displayTitle || ''}\n />\n ) : null}\n {displayDescription ? (\n <Text\n size={2}\n className=\"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description line-clamp-1 h-5 text-sm\"\n html={displayDescription || ''}\n />\n ) : null}\n <div className=\"mb-2 mt-5 flex items-center\">\n {isSoldOut ? (\n <div className=\"tablet:text-2xl text-info-primary text-xl font-bold\">{copyWriting?.soldOutText}</div>\n ) : (\n <>\n <div className=\"final-price tablet:text-2xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n <div className=\"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through\">\n {variant?.availableForSale ? basePrice || '' : ''}\n </div>\n </>\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn(\n 'shelf-flex-button-group',\n 'lg-desktop:gap-3 flex items-center gap-2',\n configuration.direction === 'vertical' ? 'flex-col' : ''\n )}\n >\n {configuration?.secondaryButton ? (\n <Button\n variant=\"secondary\"\n onClick={() => onSecondaryButton(data, configuration?.index, configuration)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n variant=\"primary\"\n onClick={() => onPrimaryButton(data, configuration?.index, configuration)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.primaryButton || ''}\n </Button>\n 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AO0B,GAAgB,GACvB,KAAM,EACN,UAAU,gDACV,KAAMA,GAAgB,GACxB,EACE,KACHC,EACCtC,EAACO,EAAA,CACC,KAAM,EACN,UAAU,kIACV,KAAM+B,GAAsB,GAC9B,EACE,KACJtC,EAAC,OAAI,UAAU,8BACZ,SAAA4B,EACC5B,EAAC,OAAI,UAAU,sDAAuD,SAAAqB,GAAa,YAAY,EAE/FpB,EAAAF,EAAA,CACE,UAAAC,EAAC,OAAI,UAAU,kEACZ,SAAA0B,GAAS,kBAAmBM,GAAS,GACxC,EACAhC,EAAC,OAAI,UAAU,sFACZ,SAAA0B,GAAS,kBAAmBO,GAAa,GAC5C,GACF,EAEJ,EAEAhC,EAAC,OACC,UAAWK,EACT,0BACA,2CACAW,EAAc,YAAc,WAAa,WAAa,EACxD,EAEC,UAAAA,GAAe,gBACdjB,EAACQ,EAAA,CACC,QAAQ,YACR,QAAS,IAAMiB,EAAkBT,EAAMC,GAAe,MAAOA,CAAa,EAC1E,UAAW;AAAA,kBACTA,EAAc,YAAc,WAAa,SAAW,EAAE;AAAA,gBAGvD,SAAAA,GAAe,iBAAmB,GACrC,EACE,KACHA,GAAe,cACdjB,EAACQ,EAAA,CACC,QAAQ,UACR,QAAS,IAAMc,EAAgBN,EAAMC,GAAe,MAAOA,CAAa,EACxE,UAAW;AAAA,gBACXA,EAAc,YAAc,WAAa,SAAW,EAAE;AAAA,cAGrD,SAAAA,GAAe,eAAiB,GACnC,EACE,MACN,GACF,GACF,GAhHKD,GAAM,IAAMA,GAAM,MAiHzB,CAEJ",
6
- "names": ["Fragment", "jsx", "jsxs", "useAiuiContext", "formatVariantPrice", "Picture", "Badge", "cn", "Text", "Button", "gaTrack", "trackUrlRef", "Heading", "componentType", "componentName", "SOLD_OUT_PRICE", "ShelfDisplayWrapItem", "data", "configuration", "isDisplayBackImage", "itemShape", "locale", "copyWriting", "onPrimaryButton", "params", "index", "onSecondaryButton", "variant", "item", "isSoldOut", "isShowTag", "isShowOriginalPrice", "coupon", "price", "basePrice", "handleUrl", "sku", "skuArray", "displayTitle", "displayDescription", "bottomContent", "ShelfDisplayHorizontalItem", "itemLength", "showSizeClass", "handleWrapClass"]
4
+ "sourcesContent": ["import { useAiuiContext } from '../AiuiProvider/index.js'\nimport { formatVariantPrice } from './shelfDisplay.js'\nimport Picture from '../../components/picture.js'\nimport Badge from '../../components/badge.js'\nimport { cn } from '../../helpers/utils.js'\nimport { Text } from '../../components/text.js'\nimport Button from '../../components/button.js'\nimport { gaTrack } from '../../shared/track.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { Heading } from '../../components/heading.js'\nimport type { ShelfDisplayItem, ShelfDisplayType } from './shelfDisplay.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useRef } from 'react'\n\nconst componentType = 'image'\nconst componentName = 'product_shelf'\n\nconst SOLD_OUT_PRICE = 9999999.99\n\nexport const ShelfDisplayWrapItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const { isDisplayBackImage = false, itemShape } = configuration || {}\n const { locale = 'us', copyWriting } = useAiuiContext()\n const ref = useRef<HTMLDivElement>(null)\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType) =>\n configuration?.event?.primaryButton?.(params, index + 1, data)\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType) =>\n configuration?.event?.secondaryButton?.(params, index + 1, data)\n\n const variant = data?.variants?.find((item: any) => item?.sku === data?.sku) || data?.variants?.[0] || {}\n\n const isSoldOut = !variant?.availableForSale && variant?.price?.amount === SOLD_OUT_PRICE\n const isShowTag = configuration?.isShowTag\n const isShowOriginalPrice = configuration?.isShowOriginalPrice\n\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n\n const { price, basePrice } = formatVariantPrice({\n locale: locale,\n amount: isShowOriginalPrice && coupon ? coupon.variant_price4wscode : variant.price,\n baseAmount: isShowOriginalPrice && coupon ? variant.price : 0,\n currencyCode: data?.price?.currencyCode || 'USD',\n })\n\n const handleUrl = () => {\n const sku = data?.sku\n const skuArray = data?.variants\n const findSku = skuArray?.find((item: any) => item?.sku === sku)\n return findSku?.image?.url || skuArray?.[0]?.image?.url || ''\n }\n\n const displayTitle = data?.custom_name || data?.title\n const displayDescription = data?.custom_description || data?.description\n\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: displayTitle,\n componentDescription: displayDescription,\n position: configuration?.index + 1,\n })\n\n const bottomContent = () => {\n return (\n <>\n {isShowTag ? (\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {data?.tags\n ?.filter?.((item: any) => item?.startsWith?.('CLtag'))\n ?.map?.((item: any) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, 2)\n ?.map?.((item: any, index: number) => <Badge key={index}>{item}</Badge>)}\n </div>\n ) : null}\n {displayTitle ? (\n <Heading\n as=\"h3\"\n title={displayTitle || ''}\n size={2}\n className=\"shelf-display-product-title mb-1 line-clamp-2\"\n html={displayTitle || ''}\n />\n ) : null}\n {displayDescription ? (\n <Text\n size={2}\n className=\"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description line-clamp-1 h-5 text-sm\"\n html={displayDescription || ''}\n />\n ) : null}\n <div className=\"mb-2 mt-5 flex items-center\">\n {isSoldOut ? (\n <div className=\"tablet:text-2xl text-info-primary text-xl font-bold\">{copyWriting?.soldOutText}</div>\n ) : (\n <>\n <div className=\"final-price tablet:text-2xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n <div className=\"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through\">\n {variant?.availableForSale ? basePrice || '' : ''}\n </div>\n </>\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn(\n 'shelf-flex-button-group',\n 'lg-desktop:gap-3 flex items-center gap-2',\n configuration.direction === 'vertical' ? 'flex-col' : ''\n )}\n >\n {configuration?.secondaryButton ? (\n <Button\n variant=\"secondary\"\n onClick={() => onSecondaryButton(data, configuration?.index, configuration)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n variant=\"primary\"\n onClick={() => onPrimaryButton(data, configuration?.index, configuration)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.primaryButton || ''}\n </Button>\n ) : null}\n </div>\n </>\n )\n }\n\n return (\n <div\n ref={ref}\n key={data?.id || data?.handle}\n className={cn(\n 'bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full cursor-pointer overflow-hidden duration-300',\n itemShape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative',\n 'md-tablet:h-[360px]'\n )}\n >\n {isDisplayBackImage ? (\n <div className=\"absolute inset-0 box-border overflow-hidden\">\n <div className=\"relative inset-0 size-full\">\n <Picture source={handleUrl()} alt=\"\" className=\"flex h-full justify-center object-cover [&_img]:w-auto\" />\n <div className=\"desktop:p-6 absolute inset-x-0 bottom-0 box-border overflow-hidden p-4\">\n {bottomContent()}\n </div>\n </div>\n </div>\n ) : (\n <div className=\"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4\">\n <div\n className={cn(\n 'lg-desktop:mb-3 lg-desktop:h-[195px] relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden'\n )}\n >\n <a\n aria-label={displayTitle}\n target={configuration?.target}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}`,\n `${componentType}_${componentName}`\n )}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'select_item',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: [\n {\n item_id: data?.sku || variant?.sku,\n item_name: data?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: configuration?.index + 1,\n },\n ],\n },\n })\n }}\n >\n <Picture source={handleUrl()} alt=\"\" className=\"flex h-full justify-center object-cover [&_img]:w-auto\" />\n </a>\n </div>\n {bottomContent()}\n </div>\n )}\n </div>\n )\n}\n\nexport const ShelfDisplayHorizontalItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const { itemShape, itemLength } = configuration || {}\n const { locale = 'us', copyWriting } = useAiuiContext()\n const ref = useRef<HTMLDivElement>(null)\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType) =>\n configuration?.event?.primaryButton?.(params, index + 1, data)\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType) =>\n configuration?.event?.secondaryButton?.(params, index + 1, data)\n\n const variant = data?.variants?.find((item: any) => item?.sku === data?.sku) || data?.variants?.[0] || {}\n\n const isSoldOut = !variant?.availableForSale && variant?.price?.amount === SOLD_OUT_PRICE\n const isShowTag = configuration?.isShowTag\n const isShowOriginalPrice = configuration?.isShowOriginalPrice\n\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n\n const { price, basePrice } = formatVariantPrice({\n locale: locale,\n amount: isShowOriginalPrice && coupon ? coupon.variant_price4wscode : variant.price,\n baseAmount: isShowOriginalPrice && coupon ? variant.price : 0,\n currencyCode: data?.price?.currencyCode || 'USD',\n })\n\n const handleUrl = () => {\n const sku = data?.sku\n const skuArray = data?.variants\n const findSku = skuArray?.find((item: any) => item?.sku === sku)\n return findSku?.image?.url || skuArray?.[0]?.image?.url || ''\n }\n\n const displayTitle = data?.custom_name || data?.title\n const displayDescription = data?.custom_description || data?.description\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: displayTitle,\n componentDescription: displayDescription,\n position: configuration?.index + 1,\n })\n\n const showSizeClass = (): {\n boxItem: string \n imgItem: string\n wrap: string\n } => {\n if (itemLength >= 2) {\n return {\n boxItem: 'lg-desktop:max-w-[401px] desktop:max-w-[292px] max-w-full',\n imgItem:\n 'm-tablet:m-auto lg-desktop:max-w-[330px] lg-desktop:max-h-[330px] desktop:max-w-[260px] desktop:max-h-[260px] max-w-[138px] max-h-[138px]',\n wrap: 'lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480] desktop:aspect-w-[648] desktop:aspect-h-[380] laptop:aspect-w-[440] laptop:aspect-h-[356] tablet:aspect-w-[346] tablet:aspect-h-[360] md-tablet:w-full',\n }\n }\n return {\n boxItem: 'lg-desktop:max-w-[401px] desktop:max-w-[292px] laptop:max-w-[289px] max-w-[262px]',\n imgItem:\n 'md-tablet:m-auto lg-desktop:max-w-[450px] lg-desktop:max-h-[450px] desktop:max-w-[332px] desktop:max-h-[332px] max-w-[312px] max-h-[312px]',\n wrap: 'lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[480] desktop:aspect-w-[1312] desktop:aspect-h-[380] laptop:aspect-w-[896] laptop:aspect-h-[356] tablet:aspect-w-[704] tablet:aspect-h-[360] md-tablet:w-full',\n }\n }\n \n const handleWrapClass = () => {\n if (itemLength >= 2) {\n return 'flex flex-col justify-between desktop:gap-12 desktop:flex-row desktop:justify-center desktop:items-center'\n }\n return 'flex justify-center items-center gap-6 md-tablet:flex-col'\n }\n\n return (\n <div\n ref={ref}\n key={data?.id || data?.handle}\n className={cn(\n showSizeClass().wrap,\n itemShape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'bg-container-secondary-1 tablet:hover:bg-info-white duration-300 gap-6',\n 'box-border w-full cursor-pointer overflow-hidden relative md-tablet:h-[360px]'\n )}\n >\n <div className={cn(handleWrapClass(), 'desktop:p-6 absolute inset-0 box-border overflow-hidden p-4')}>\n <div className={cn(showSizeClass().imgItem, 'relative overflow-hidden desktop:mb-0 mb-1')}>\n <a\n aria-label={displayTitle}\n target={configuration?.target}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}`,\n `${componentType}_${componentName}`\n )}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'select_item',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: [\n {\n item_id: data?.sku || variant?.sku,\n item_name: data?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: configuration?.index + 1,\n },\n ],\n },\n })\n }}\n >\n <Picture source={handleUrl()} alt=\"\" className=\"flex h-full justify-center object-cover [&_img]:w-auto\" />\n </a>\n </div>\n <div className={cn('flex flex-col justify-center items-start', showSizeClass().boxItem)}>\n {isShowTag ? (\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {data?.tags\n ?.filter?.((item: any) => item?.startsWith?.('CLtag'))\n ?.map?.((item: any) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, 2)\n ?.map?.((item: any, index: number) => <Badge key={index}>{item}</Badge>)}\n </div>\n ) : null}\n {displayTitle ? (\n <Heading\n as=\"h3\"\n title={displayTitle || ''}\n size={2}\n className=\"shelf-display-product-title mb-1 line-clamp-2\"\n html={displayTitle || ''}\n />\n ) : null}\n {displayDescription ? (\n <Text\n size={2}\n className=\"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description line-clamp-1 h-5 text-sm\"\n html={displayDescription || ''}\n />\n ) : null}\n <div className=\"mb-2 mt-5 flex items-center\">\n {isSoldOut ? (\n <div className=\"tablet:text-2xl text-info-primary text-xl font-bold\">{copyWriting?.soldOutText}</div>\n ) : (\n <>\n <div className=\"final-price tablet:text-2xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n <div className=\"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through\">\n {variant?.availableForSale ? basePrice || '' : ''}\n </div>\n </>\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn(\n 'shelf-flex-button-group',\n 'lg-desktop:gap-3 flex items-center gap-2',\n configuration.direction === 'vertical' ? 'flex-col' : ''\n )}\n >\n {configuration?.secondaryButton ? (\n <Button\n variant=\"secondary\"\n onClick={() => onSecondaryButton(data, configuration?.index, configuration)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n variant=\"primary\"\n onClick={() => onPrimaryButton(data, configuration?.index, configuration)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.primaryButton || ''}\n </Button>\n ) : null}\n </div>\n </div>\n </div>\n </div>\n )\n}\n"],
5
+ "mappings": "AA0EoD,OAuBxC,YAAAA,EAvBwC,OAAAC,EAuBxC,QAAAC,MAvBwC,oBA1EpD,OAAS,kBAAAC,MAAsB,2BAC/B,OAAS,sBAAAC,MAA0B,oBACnC,OAAOC,MAAa,8BACpB,OAAOC,MAAW,4BAClB,OAAS,MAAAC,MAAU,yBACnB,OAAS,QAAAC,MAAY,2BACrB,OAAOC,MAAY,6BACnB,OAAS,WAAAC,MAAe,wBACxB,OAAS,eAAAC,MAAmB,8BAC5B,OAAS,WAAAC,MAAe,8BAExB,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,UAAAC,MAAc,QAEvB,MAAMC,EAAgB,QAChBC,EAAgB,gBAEhBC,EAAiB,aAEVC,GAAuB,CAAC,CAAE,KAAAC,EAAM,cAAAC,CAAc,IAA0C,CACnG,KAAM,CAAE,mBAAAC,EAAqB,GAAO,UAAAC,CAAU,EAAIF,GAAiB,CAAC,EAC9D,CAAE,OAAAG,EAAS,KAAM,YAAAC,CAAY,EAAIrB,EAAe,EAChDsB,EAAMX,EAAuB,IAAI,EAEjCY,EAAkB,CAACC,EAA0BC,EAAeT,IAChEC,GAAe,OAAO,gBAAgBO,EAAQC,EAAQ,EAAGT,CAAI,EAEzDU,EAAoB,CAACF,EAA0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ACA,2CACAa,EAAc,YAAc,WAAa,WAAa,EACxD,EAEC,UAAAA,GAAe,gBACdnB,EAACQ,EAAA,CACC,QAAQ,YACR,QAAS,IAAMoB,EAAkBV,EAAMC,GAAe,MAAOA,CAAa,EAC1E,UAAW;AAAA,kBACTA,EAAc,YAAc,WAAa,SAAW,EAAE;AAAA,gBAGvD,SAAAA,GAAe,iBAAmB,GACrC,EACE,KACHA,GAAe,cACdnB,EAACQ,EAAA,CACC,QAAQ,UACR,QAAS,IAAMiB,EAAgBP,EAAMC,GAAe,MAAOA,CAAa,EACxE,UAAW;AAAA,gBACXA,EAAc,YAAc,WAAa,SAAW,EAAE;AAAA,cAGrD,SAAAA,GAAe,eAAiB,GACnC,EACE,MACN,GACF,GACF,GAhHKD,GAAM,IAAMA,GAAM,MAiHzB,CAEJ",
6
+ "names": ["Fragment", "jsx", "jsxs", "useAiuiContext", "formatVariantPrice", "Picture", "Badge", "cn", "Text", "Button", "gaTrack", "trackUrlRef", "Heading", "useExposure", "useRef", "componentType", "componentName", "SOLD_OUT_PRICE", "ShelfDisplayWrapItem", "data", "configuration", "isDisplayBackImage", "itemShape", "locale", "copyWriting", "ref", "onPrimaryButton", "params", "index", "onSecondaryButton", "variant", "item", "isSoldOut", "isShowTag", "isShowOriginalPrice", "coupon", "price", "basePrice", "handleUrl", "sku", "skuArray", "displayTitle", "displayDescription", "bottomContent", "ShelfDisplayHorizontalItem", "itemLength", "showSizeClass", "handleWrapClass"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{jsx as t,jsxs as a}from"react/jsx-runtime";import{Dialog as n,DialogContent as x}from"../../components/dialog.js";import{Picture as d,Text as l}from"../../components/index.js";import"../../helpers/index.js";const p=i=>{const{textVisible:s,extension:e,onCloseModal:o}=i;return t(n,{open:s,onOpenChange:()=>o(),children:t(x,{className:" tablet:max-h-[535px] tablet:max-w-[896px] md-tablet:h-[490px] md-tablet:w-[358px] tablet:rounded-2xl mx-auto rounded-lg border-none bg-white p-0 [&_button]:hidden",children:a("div",{className:"tablet:rounded-2xl overflow-hidden rounded-lg",children:[t("div",{className:"min-h-[260px] w-full",children:t(d,{source:`${e?.textPcImg?.url||""} , ${e?.textMobileImg?.url||""} 767`,className:"size-full",imgClassName:"w-full h-full object-cover"})}),t("div",{className:"tablet:inset-x-8 tablet:top-8 absolute inset-x-4 top-4",children:t(l,{html:e?.textTitle,className:"tablet:text-[24px] text-[20px] font-bold leading-[1.2]"})}),t("div",{onClick:()=>o(),className:"absolute right-4 top-4 cursor-pointer",children:t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",children:t("g",{"clip-path":"url(#clip0_2548_10038)",children:t("path",{d:"M5.63545 6.13604C6.02592 5.74546 6.65913 5.74551 7.04966 6.13604L11.9994 11.0858L16.9492 6.13604C17.3397 5.74552 17.9729 5.74546 18.3634 6.13604C18.7538 6.52659 18.7538 7.15972 18.3634 7.55025L13.4136 12.5L18.3634 17.4497C18.7538 17.8403 18.7538 18.4734 18.3634 18.864C17.9729 19.2545 17.3397 19.2545 16.9492 18.864L11.9994 13.9142L7.04966 18.864C6.65913 19.2545 6.02592 19.2545 5.63545 18.864C5.24501 18.4734 5.24502 17.8403 5.63545 17.4497L10.5852 12.5L5.63545 7.55025C5.24502 7.15972 5.24501 6.52658 5.63545 6.13604Z",fill:"white"})})})}),a("div",{className:"tablet:p-8 p-4 text-[#1D1D1F]",children:[t(l,{html:e?.text,className:" tablet:text-2xl text-xl font-bold leading-[1.2]"}),t("br",{}),t(l,{html:e?.textDesc,className:"tablet:leading-[1.2] pt-1 text-base font-bold leading-[1.4]"})]})]})})})};export{p as TextModal};
1
+ import{jsx as t,jsxs as a}from"react/jsx-runtime";import{Dialog as x,DialogContent as d}from"../../components/dialog.js";import{Picture as n,Text as l}from"../../components/index.js";import"../../helpers/index.js";const m=i=>{const{textVisible:s,extension:e,onCloseModal:o}=i;return t(x,{open:s,onOpenChange:()=>o(),children:t(d,{className:"tablet:max-w-[896px] md-tablet:h-[490px] md-tablet:w-[358px] tablet:rounded-2xl mx-auto rounded-lg border-none bg-white p-0 [&_button]:hidden",children:a("div",{className:"tablet:rounded-2xl overflow-hidden rounded-lg md-tablet:flex md-tablet:flex-col",children:[t("div",{className:"min-h-[260px] w-full md-tablet:flex-1",children:t(n,{source:`${e?.textPcImg?.url||""} , ${e?.textMobileImg?.url||""} 767`,className:"size-full",imgClassName:"w-full h-full object-cover"})}),t("div",{className:"tablet:inset-x-8 tablet:top-8 absolute inset-x-4 top-4",children:t(l,{html:e?.textTitle,className:"tablet:text-[24px] text-[20px] font-bold leading-[1.2]"})}),t("div",{onClick:()=>o(),className:"absolute right-4 top-4 cursor-pointer",children:t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",children:t("g",{"clip-path":"url(#clip0_2548_10038)",children:t("path",{d:"M5.63545 6.13604C6.02592 5.74546 6.65913 5.74551 7.04966 6.13604L11.9994 11.0858L16.9492 6.13604C17.3397 5.74552 17.9729 5.74546 18.3634 6.13604C18.7538 6.52659 18.7538 7.15972 18.3634 7.55025L13.4136 12.5L18.3634 17.4497C18.7538 17.8403 18.7538 18.4734 18.3634 18.864C17.9729 19.2545 17.3397 19.2545 16.9492 18.864L11.9994 13.9142L7.04966 18.864C6.65913 19.2545 6.02592 19.2545 5.63545 18.864C5.24501 18.4734 5.24502 17.8403 5.63545 17.4497L10.5852 12.5L5.63545 7.55025C5.24502 7.15972 5.24501 6.52658 5.63545 6.13604Z",fill:"white"})})})}),a("div",{className:"tablet:p-8 p-4 text-[#1D1D1F] tablet:max-h-60 md-tablet:flex-1 overflow-y-auto",children:[t(l,{html:e?.text,className:" tablet:text-2xl text-xl font-bold leading-[1.2]"}),t("br",{}),t(l,{html:e?.textDesc,className:"tablet:leading-[1.2] pt-1 text-base font-bold leading-[1.4]"})]})]})})})};export{m as TextModal};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/TextModal/index.tsx"],
4
- "sourcesContent": ["import type { Media } from '../../types/props.js'\nimport { Dialog, DialogContent } from '../../components/dialog.js'\nimport { Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/index.js'\nimport type { Img } from '../../types/props.js'\n\nexport type TextModalType = {\n textVisible: boolean\n extension?: {\n textPcImg: Img\n textMobileImg: Img\n textTitle: string\n text: string\n textDesc: string\n }\n onCloseModal: () => void\n}\n\nconst TextModal = (props: TextModalType) => {\n const { textVisible, extension, onCloseModal } = props\n\n return (\n <Dialog open={textVisible} onOpenChange={() => onCloseModal()}>\n <DialogContent className=\" tablet:max-h-[535px] tablet:max-w-[896px] md-tablet:h-[490px] md-tablet:w-[358px] tablet:rounded-2xl mx-auto rounded-lg border-none bg-white p-0 [&_button]:hidden\">\n <div className=\"tablet:rounded-2xl overflow-hidden rounded-lg\">\n <div className=\"min-h-[260px] w-full\">\n <Picture\n source={`${extension?.textPcImg?.url || ''} , ${extension?.textMobileImg?.url || ''} 767`}\n className=\"size-full\"\n imgClassName=\"w-full h-full object-cover\"\n />\n </div>\n <div className=\"tablet:inset-x-8 tablet:top-8 absolute inset-x-4 top-4\">\n <Text html={extension?.textTitle} className=\"tablet:text-[24px] text-[20px] font-bold leading-[1.2]\" />\n </div>\n <div onClick={() => onCloseModal()} className=\"absolute right-4 top-4 cursor-pointer\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"25\" viewBox=\"0 0 24 25\" fill=\"none\">\n <g clip-path=\"url(#clip0_2548_10038)\">\n <path\n d=\"M5.63545 6.13604C6.02592 5.74546 6.65913 5.74551 7.04966 6.13604L11.9994 11.0858L16.9492 6.13604C17.3397 5.74552 17.9729 5.74546 18.3634 6.13604C18.7538 6.52659 18.7538 7.15972 18.3634 7.55025L13.4136 12.5L18.3634 17.4497C18.7538 17.8403 18.7538 18.4734 18.3634 18.864C17.9729 19.2545 17.3397 19.2545 16.9492 18.864L11.9994 13.9142L7.04966 18.864C6.65913 19.2545 6.02592 19.2545 5.63545 18.864C5.24501 18.4734 5.24502 17.8403 5.63545 17.4497L10.5852 12.5L5.63545 7.55025C5.24502 7.15972 5.24501 6.52658 5.63545 6.13604Z\"\n fill=\"white\"\n />\n </g>\n </svg>\n </div>\n <div className=\"tablet:p-8 p-4 text-[#1D1D1F]\">\n <Text html={extension?.text} className=\" tablet:text-2xl text-xl font-bold leading-[1.2]\" />\n <br />\n <Text html={extension?.textDesc} className=\"tablet:leading-[1.2] pt-1 text-base font-bold leading-[1.4]\" />\n </div>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport { TextModal }\n"],
5
- "mappings": "AA0BY,cAAAA,EAmBF,QAAAC,MAnBE,oBAzBZ,OAAS,UAAAC,EAAQ,iBAAAC,MAAqB,6BACtC,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC9B,MAAmB,yBAenB,MAAMC,EAAaC,GAAyB,CAC1C,KAAM,CAAE,YAAAC,EAAa,UAAAC,EAAW,aAAAC,CAAa,EAAIH,EAEjD,OACEP,EAACE,EAAA,CAAO,KAAMM,EAAa,aAAc,IAAME,EAAa,EAC1D,SAAAV,EAACG,EAAA,CAAc,UAAU,sKACvB,SAAAF,EAAC,OAAI,UAAU,gDACb,UAAAD,EAAC,OAAI,UAAU,uBACb,SAAAA,EAACI,EAAA,CACC,OAAQ,GAAGK,GAAW,WAAW,KAAO,EAAE,MAAMA,GAAW,eAAe,KAAO,EAAE,OACnF,UAAU,YACV,aAAa,6BACf,EACF,EACAT,EAAC,OAAI,UAAU,yDACb,SAAAA,EAACK,EAAA,CAAK,KAAMI,GAAW,UAAW,UAAU,yDAAyD,EACvG,EACAT,EAAC,OAAI,QAAS,IAAMU,EAAa,EAAG,UAAU,wCAC5C,SAAAV,EAAC,OAAI,MAAM,6BAA6B,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OACtF,SAAAA,EAAC,KAAE,YAAU,yBACX,SAAAA,EAAC,QACC,EAAE,0gBACF,KAAK,QACP,EACF,EACF,EACF,EACAC,EAAC,OAAI,UAAU,gCACb,UAAAD,EAACK,EAAA,CAAK,KAAMI,GAAW,KAAM,UAAU,mDAAmD,EAC1FT,EAAC,OAAG,EACJA,EAACK,EAAA,CAAK,KAAMI,GAAW,SAAU,UAAU,8DAA8D,GAC3G,GACF,EACF,EACF,CAEJ",
4
+ "sourcesContent": ["import type { Media } from '../../types/props.js'\nimport { Dialog, DialogContent } from '../../components/dialog.js'\nimport { Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/index.js'\nimport type { Img } from '../../types/props.js'\n\nexport type TextModalType = {\n textVisible: boolean\n extension?: {\n textPcImg: Img\n textMobileImg: Img\n textTitle: string\n text: string\n textDesc: string\n }\n onCloseModal: () => void\n}\n\nconst TextModal = (props: TextModalType) => {\n const { textVisible, extension, onCloseModal } = props\n\n return (\n <Dialog open={textVisible} onOpenChange={() => onCloseModal()}>\n <DialogContent className=\"tablet:max-w-[896px] md-tablet:h-[490px] md-tablet:w-[358px] tablet:rounded-2xl mx-auto rounded-lg border-none bg-white p-0 [&_button]:hidden\">\n <div className=\"tablet:rounded-2xl overflow-hidden rounded-lg md-tablet:flex md-tablet:flex-col\">\n <div className=\"min-h-[260px] w-full md-tablet:flex-1\">\n <Picture\n source={`${extension?.textPcImg?.url || ''} , ${extension?.textMobileImg?.url || ''} 767`}\n className=\"size-full\"\n imgClassName=\"w-full h-full object-cover\"\n />\n </div>\n <div className=\"tablet:inset-x-8 tablet:top-8 absolute inset-x-4 top-4\">\n <Text html={extension?.textTitle} className=\"tablet:text-[24px] text-[20px] font-bold leading-[1.2]\" />\n </div>\n <div onClick={() => onCloseModal()} className=\"absolute right-4 top-4 cursor-pointer\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"25\" viewBox=\"0 0 24 25\" fill=\"none\">\n <g clip-path=\"url(#clip0_2548_10038)\">\n <path\n d=\"M5.63545 6.13604C6.02592 5.74546 6.65913 5.74551 7.04966 6.13604L11.9994 11.0858L16.9492 6.13604C17.3397 5.74552 17.9729 5.74546 18.3634 6.13604C18.7538 6.52659 18.7538 7.15972 18.3634 7.55025L13.4136 12.5L18.3634 17.4497C18.7538 17.8403 18.7538 18.4734 18.3634 18.864C17.9729 19.2545 17.3397 19.2545 16.9492 18.864L11.9994 13.9142L7.04966 18.864C6.65913 19.2545 6.02592 19.2545 5.63545 18.864C5.24501 18.4734 5.24502 17.8403 5.63545 17.4497L10.5852 12.5L5.63545 7.55025C5.24502 7.15972 5.24501 6.52658 5.63545 6.13604Z\"\n fill=\"white\"\n />\n </g>\n </svg>\n </div>\n <div className=\"tablet:p-8 p-4 text-[#1D1D1F] tablet:max-h-60 md-tablet:flex-1 overflow-y-auto\">\n <Text html={extension?.text} className=\" tablet:text-2xl text-xl font-bold leading-[1.2]\" />\n <br />\n <Text html={extension?.textDesc} className=\"tablet:leading-[1.2] pt-1 text-base font-bold leading-[1.4]\" />\n </div>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport { TextModal }\n"],
5
+ "mappings": "AA0BY,cAAAA,EAmBF,QAAAC,MAnBE,oBAzBZ,OAAS,UAAAC,EAAQ,iBAAAC,MAAqB,6BACtC,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC9B,MAAmB,yBAenB,MAAMC,EAAaC,GAAyB,CAC1C,KAAM,CAAE,YAAAC,EAAa,UAAAC,EAAW,aAAAC,CAAa,EAAIH,EAEjD,OACEP,EAACE,EAAA,CAAO,KAAMM,EAAa,aAAc,IAAME,EAAa,EAC1D,SAAAV,EAACG,EAAA,CAAc,UAAU,gJACvB,SAAAF,EAAC,OAAI,UAAU,kFACb,UAAAD,EAAC,OAAI,UAAU,wCACb,SAAAA,EAACI,EAAA,CACC,OAAQ,GAAGK,GAAW,WAAW,KAAO,EAAE,MAAMA,GAAW,eAAe,KAAO,EAAE,OACnF,UAAU,YACV,aAAa,6BACf,EACF,EACAT,EAAC,OAAI,UAAU,yDACb,SAAAA,EAACK,EAAA,CAAK,KAAMI,GAAW,UAAW,UAAU,yDAAyD,EACvG,EACAT,EAAC,OAAI,QAAS,IAAMU,EAAa,EAAG,UAAU,wCAC5C,SAAAV,EAAC,OAAI,MAAM,6BAA6B,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OACtF,SAAAA,EAAC,KAAE,YAAU,yBACX,SAAAA,EAAC,QACC,EAAE,0gBACF,KAAK,QACP,EACF,EACF,EACF,EACAC,EAAC,OAAI,UAAU,iFACb,UAAAD,EAACK,EAAA,CAAK,KAAMI,GAAW,KAAM,UAAU,mDAAmD,EAC1FT,EAAC,OAAG,EACJA,EAACK,EAAA,CAAK,KAAMI,GAAW,SAAU,UAAU,8DAA8D,GAC3G,GACF,EACF,EACF,CAEJ",
6
6
  "names": ["jsx", "jsxs", "Dialog", "DialogContent", "Picture", "Text", "TextModal", "props", "textVisible", "extension", "onCloseModal"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as n,jsxs as b}from"react/jsx-runtime";import z,{useEffect as U,useRef as r,useImperativeHandle as j}from"react";import{gsap as p}from"gsap";import{SplitText as v}from"gsap/dist/SplitText";import{ScrollTrigger as T}from"gsap/dist/ScrollTrigger";import{cn as k}from"../../helpers/utils.js";import{Heading as B}from"../../components/index.js";import{withLayout as C}from"../../shared/Styles.js";import{useExposure as F}from"../../hooks/useExposure.js";import{trackUrlRef as _}from"../../shared/trackUrlRef.js";import{useInView as q}from"react-intersection-observer";const u="link",f="title",y=z.forwardRef(({data:d,className:L},R)=>{const{title:o,caption:i,theme:g,extensions:s}=d,l=r(null),t=r(null),e=r(null),a=r(null),{ref:H,inView:h}=q();return j(R,()=>l.current),F(l,{componentType:u,componentName:f,componentTitle:d?.title}),U(()=>{p.registerPlugin(v,T);function E(){if(!t.current)return;const M=t.current?.clientHeight||80;e.current=new v(t.current,{type:"words",wordsClass:"word"});const c=e.current.words;p.set(c,{opacity:0}),a.current=T.create({trigger:t.current,start:"bottom bottom-=4%",end:`bottom+=${M*1.5+60}px bottom-=4%`,scrub:!0,onUpdate:N=>{const $=N.progress,w=c.length,D=1/w,x=.5;c.forEach((S,I)=>{const P=I/w*(1-x),V=D*(1+x);let m=($-P)/V;m=Math.max(0,Math.min(m,1)),p.set(S,{opacity:m})})}})}return h&&E(),()=>{e.current&&e.current.revert(),a.current&&a.current.kill()}},[h]),(o||i)&&b("div",{className:"mb-6 flex items-end justify-between overflow-hidden title-box",ref:l,children:[n("div",{ref:H,className:k("space-y-4 flex-1",L,{"aiui-dark":g==="dark"}),children:n(B,{ref:t,as:"h1",size:4,html:i||o})}),s?.textLink&&b("a",{className:k({"aiui-dark":g==="dark"},"flex items-center text-base font-[700] leading-[1.4] text-[#777] transition-all duration-[0.4s] hover:text-[#1D1D1F]"),href:_(s?.link,`${u}_${f}`),"data-headless-type-name":`${u}#${f}`,"data-headless-title-desc-button":`${o}#${i}`,children:[s?.textLink,n("svg",{width:"24",height:"24",className:"mb-[3px]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:n("path",{className:"transition-all duration-[0.4s]",d:"M10.5 8L14.5 12L10.5 16",stroke:"#777","stroke-width":"1.5","stroke-linecap":"round"})})]})]})});y.displayName="Title";var tt=C(y);export{tt as default};
1
+ "use client";import{jsx as o,jsxs as R}from"react/jsx-runtime";import C,{useEffect as F,useRef as n,useImperativeHandle as O}from"react";import{gsap as u}from"gsap";import{SplitText as v}from"gsap/dist/SplitText";import{ScrollTrigger as x}from"gsap/dist/ScrollTrigger";import{cn as T}from"../../helpers/utils.js";import{Heading as _}from"../../components/index.js";import{withLayout as q}from"../../shared/Styles.js";import"../../hooks/useExposure.js";import{trackUrlRef as A}from"../../shared/trackUrlRef.js";import{useInView as G}from"react-intersection-observer";const k="link",y="title",b=C.forwardRef(({data:L,className:E,as:H="h2"},M)=>{const{title:i,caption:s,theme:p,extensions:l}=L,f=n(null),e=n(null),t=n(null),r=n(null),{ref:N,inView:d}=G();return O(M,()=>f.current),F(()=>{u.registerPlugin(v,x);function $(){if(!e.current)return;const D=e.current?.clientHeight||80;t.current&&t.current.revert(),r.current&&r.current.kill(),t.current=new v(e.current,{type:"words",wordsClass:"word"});const a=t.current.words;u.set(a,{opacity:0}),r.current=x.create({trigger:e.current,start:"bottom bottom-=4%",end:`bottom+=${D*1.5+60}px bottom-=4%`,scrub:!0,invalidateOnRefresh:!0,onUpdate:P=>{const S=P.progress,g=a.length||1,z=.5,c=1/g,h=c*(1-z),w=(g-1)*h+c,I=Math.min(1,w>0?S/w:0);a.forEach((V,U)=>{const j=U*h,B=c;let m=(I-j)/B;m=Math.max(0,Math.min(1,m)),u.set(V,{opacity:m})})}})}return d&&$(),()=>{t.current&&t.current.revert(),r.current&&r.current.kill()}},[d]),(i||s)&&R("div",{className:"mb-6 flex items-end justify-between overflow-hidden title-box",ref:f,children:[o("div",{ref:N,className:T("space-y-4 flex-1",E,{"aiui-dark":p==="dark"}),children:o(_,{ref:e,as:H,size:4,html:s||i})}),l?.textLink&&R("a",{className:T({"aiui-dark":p==="dark"},"flex items-center text-base font-[700] leading-[1.4] text-[#777] transition-all duration-[0.4s] hover:text-[#1D1D1F]"),href:A(l?.link,`${k}_${y}`),"data-headless-type-name":`${k}#${y}`,"data-headless-title-desc-button":`${i}#${s}`,children:[l?.textLink,o("svg",{width:"24",height:"24",className:"mb-[3px]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:o("path",{className:"transition-all duration-[0.4s]",d:"M10.5 8L14.5 12L10.5 16",stroke:"#777","stroke-width":"1.5","stroke-linecap":"round"})})]})]})});b.displayName="Title";var ot=q(b);export{ot as default};
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 } 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 { Heading } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { TitleProps } from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useInView } from 'react-intersection-observer'\n\nconst componentType = 'link'\nconst componentName = 'title'\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(({ data, className }, ref) => {\n const { title, caption, theme, extensions } = 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 const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: data?.title,\n })\n\n useEffect(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n function gsapResize() {\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\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 onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word: any, i: number) => {\n const start = (i / total) * (1 - overlap)\n const width = interval * (1 + overlap)\n let opacity = (progress - start) / width\n opacity = Math.max(0, Math.min(opacity, 1))\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 (title || caption) && (\n <div className=\"mb-6 flex items-end justify-between overflow-hidden title-box\" ref={innerRef}>\n <div ref={inViewRef} className={cn('space-y-4 flex-1', className, { 'aiui-dark': theme === 'dark' })}>\n <Heading ref={titleRef} as=\"h1\" size={4} html={caption || title} />\n </div>\n {extensions?.textLink && (\n <a\n className={cn(\n { 'aiui-dark': theme === 'dark' },\n 'flex items-center text-base font-[700] leading-[1.4] text-[#777] transition-all duration-[0.4s] hover:text-[#1D1D1F]'\n )}\n href={trackUrlRef(extensions?.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${caption}`}\n >\n {extensions?.textLink}\n <svg\n width=\"24\"\n height=\"24\"\n className=\"mb-[3px]\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <path\n className=\"transition-all duration-[0.4s]\"\n d=\"M10.5 8L14.5 12L10.5 16\"\n stroke=\"#777\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n ></path>\n </svg>\n </a>\n )}\n </div>\n )\n )\n})\n\nTitle.displayName = 'Title'\n\nexport default withLayout(Title)\n"],
5
- "mappings": "aAgFU,cAAAA,EAGA,QAAAC,MAHA,oBA/EV,OAAOC,GAAS,aAAAC,EAAW,UAAAC,EAAQ,uBAAAC,MAA2B,QAC9D,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,sBAC1B,OAAS,iBAAAC,MAAqB,0BAC9B,OAAS,MAAAC,MAAU,yBACnB,OAAS,WAAAC,MAAe,4BACxB,OAAS,cAAAC,MAAkB,yBAE3B,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,eAAAC,MAAmB,8BAC5B,OAAS,aAAAC,MAAiB,8BAE1B,MAAMC,EAAgB,OAChBC,EAAgB,QAEhBC,EAAQf,EAAM,W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,CAC5B,CAAC,CACH,CACF,CAAC,CACH,CAEA,OAAIb,GACFC,EAAW,EAGN,IAAM,CACXJ,EAAkB,SAAWA,EAAkB,QAAQ,OAAO,EAE9DC,EAAiB,SAAWA,EAAiB,QAAQ,KAAK,CAC5D,CACF,EAAG,CAACE,CAAM,CAAC,GAGRT,GAASC,IACRrB,EAAC,OAAI,UAAU,gEAAgE,IAAKwB,EAClF,UAAAzB,EAAC,OAAI,IAAK6B,EAAW,UAAWpB,EAAG,mBAAoBU,EAAW,CAAE,YAAaI,IAAU,MAAO,CAAC,EACjG,SAAAvB,EAACU,EAAA,CAAQ,IAAKgB,EAAU,GAAG,KAAK,KAAM,EAAG,KAAMJ,GAAWD,EAAO,EACnE,EACCG,GAAY,UACXvB,EAAC,KACC,UAAWQ,EACT,CAAE,YAAac,IAAU,MAAO,EAChC,sHACF,EACA,KAAMV,EAAYW,GAAY,KAAM,GAAGT,CAAa,IAAIC,CAAa,EAAE,EACvE,0BAAyB,GAAGD,CAAa,IAAIC,CAAa,GAC1D,kCAAiC,GAAGK,CAAK,IAAIC,CAAO,GAEnD,UAAAE,GAAY,SACbxB,EAAC,OACC,MAAM,KACN,OAAO,KACP,UAAU,WACV,MAAM,6BACN,QAAQ,YACR,KAAK,OAEL,SAAAA,EAAC,QACC,UAAU,iCACV,EAAE,0BACF,OAAO,OACP,eAAa,MACb,iBAAe,QAChB,EACH,GACF,GAEJ,CAGN,CAAC,EAEDiB,EAAM,YAAc,QAEpB,IAAO2B,GAAQjC,EAAWM,CAAK",
6
- "names": ["jsx", "jsxs", "React", "useEffect", "useRef", "useImperativeHandle", "gsap", "SplitText", "ScrollTrigger", "cn", "Heading", "withLayout", "useExposure", "trackUrlRef", "useInView", "componentType", "componentName", "Title", "data", "className", "ref", "title", "caption", "theme", "extensions", "innerRef", "titleRef", "splitTextInstance", "scrollTriggerRef", "inViewRef", "inView", "gsapResize", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "i", "start", "width", "opacity", "Title_default"]
4
+ "sourcesContent": ["'use client'\nimport React, { useEffect, useRef, useImperativeHandle } 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 { Heading } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { TitleProps } from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useInView } from 'react-intersection-observer'\n\nconst componentType = 'link'\nconst componentName = 'title'\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(({ data, className, as = 'h2' }, ref) => {\n const { title, caption, theme, extensions } = 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 const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\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 (title || caption) && (\n <div className=\"mb-6 flex items-end justify-between overflow-hidden title-box\" ref={innerRef}>\n <div ref={inViewRef} className={cn('space-y-4 flex-1', className, { 'aiui-dark': theme === 'dark' })}>\n <Heading ref={titleRef} as={as} size={4} html={caption || title} />\n </div>\n {extensions?.textLink && (\n <a\n className={cn(\n { 'aiui-dark': theme === 'dark' },\n 'flex items-center text-base font-[700] leading-[1.4] text-[#777] transition-all duration-[0.4s] hover:text-[#1D1D1F]'\n )}\n href={trackUrlRef(extensions?.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${caption}`}\n >\n {extensions?.textLink}\n <svg\n width=\"24\"\n height=\"24\"\n className=\"mb-[3px]\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <path\n className=\"transition-all duration-[0.4s]\"\n d=\"M10.5 8L14.5 12L10.5 16\"\n stroke=\"#777\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n ></path>\n </svg>\n </a>\n )}\n </div>\n )\n )\n})\n\nTitle.displayName = 'Title'\n\nexport default withLayout(Title)\n"],
5
+ "mappings": "aAqFU,cAAAA,EAGA,QAAAC,MAHA,oBApFV,OAAOC,GAAS,aAAAC,EAAW,UAAAC,EAAQ,uBAAAC,MAA2B,QAC9D,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,sBAC1B,OAAS,iBAAAC,MAAqB,0BAC9B,OAAS,MAA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J,CAGN,CAAC,EAEDgB,EAAM,YAAc,QAEpB,IAAO+B,GAAQpC,EAAWK,CAAK",
6
+ "names": ["jsx", "jsxs", "React", "useEffect", "useRef", "useImperativeHandle", "gsap", "SplitText", "ScrollTrigger", "cn", "Heading", "withLayout", "trackUrlRef", "useInView", "componentType", "componentName", "Title", "data", "className", "as", "ref", "title", "caption", "theme", "extensions", "innerRef", "titleRef", "splitTextInstance", "scrollTriggerRef", "inViewRef", "inView", "gsapResize", "height", "words", "self", "progress", "total", "overlap", "interval", "step", "lastEnd", "normalizedProgress", "word", "i", "start", "width", "opacity", "Title_default"]
7
7
  }
@@ -29,4 +29,5 @@ export interface TitleProps {
29
29
  * 自定义类名
30
30
  */
31
31
  className?: string;
32
+ as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
32
33
  }
@@ -1,2 +1,4 @@
1
- declare const Board: () => import("react/jsx-runtime").JSX.Element;
1
+ declare const Board: ({ href }: {
2
+ href?: string;
3
+ }) => import("react/jsx-runtime").JSX.Element;
2
4
  export default Board;
@@ -1,2 +1,2 @@
1
- import{jsx as C,jsxs as t}from"react/jsx-runtime";import{Container as V}from"./container";const L=()=>C("div",{className:"relative z-[46] h-[30px]",children:C(V,{childClassName:"flex !bg-[#1D1D1F] items-center justify-end",className:"h-full",children:C(e,{})})}),e=H=>t("svg",{width:"148",height:"10",viewBox:"0 0 148 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...H,children:[C("path",{d:"M88.5391 1.66872C90.8392 1.6688 92.7041 3.53461 92.7041 5.83474C92.7039 8.13468 90.839 9.9997 88.5391 9.99977C86.239 9.99977 84.3733 8.13473 84.373 5.83474C84.373 3.53456 86.2389 1.66872 88.5391 1.66872ZM106.479 1.66872C107.484 1.66872 108.407 2.02531 109.127 2.61892L109.477 1.86208H110.645V9.79958H109.477L109.13 9.0486C108.409 9.64225 107.486 9.99977 106.479 9.99977C104.179 9.99954 102.314 8.13458 102.313 5.83474C102.313 3.53471 104.179 1.66896 106.479 1.66872ZM126.684 1.66872C128.984 1.66872 130.849 3.53456 130.849 5.83474C130.848 8.13473 128.984 9.99977 126.684 9.99977C124.384 9.99972 122.519 8.13469 122.519 5.83474C122.519 3.5346 124.383 1.66878 126.684 1.66872ZM144.748 1.66188C146.602 1.66198 147.794 2.66292 147.823 4.20778H146.278C146.249 3.44345 145.631 3.04577 144.719 3.04567C143.806 3.04567 143.247 3.429 143.247 4.0027C143.247 4.7082 144.07 4.85598 145.026 5.0027L145.025 5.00173C146.365 5.23788 147.998 5.48784 147.998 7.44509C147.998 8.98988 146.716 9.99001 144.775 9.99001C142.834 9.98986 141.568 8.93061 141.524 7.28298H143.128C143.172 8.12086 143.878 8.54763 144.835 8.54763C145.703 8.5475 146.38 8.17982 146.38 7.51833C146.38 6.76851 145.527 6.5909 144.556 6.42946C143.232 6.20932 141.673 5.90104 141.673 4.0613C141.673 2.6337 142.893 1.66188 144.748 1.66188ZM115.1 1.85427H117.434V3.24685H115.102V6.85524C115.102 7.79295 115.614 8.32097 116.582 8.32106H117.478V9.80251L116.275 9.8406C114.545 9.84058 113.474 8.76932 113.474 7.02419V3.24685H112.285V2.93532L114.577 0.000751495H115.1V1.85427ZM63.7627 9.79958H62.1367V-0.000225067H63.7627V9.79958ZM97.5566 7.32302L100.108 1.85427H101.884L98.1787 9.79958H96.9355L93.2305 1.85427H95.0059L97.5566 7.32302ZM120.852 9.79958H119.226V3.24587H120.852V9.79958ZM67.8779 2.61892C68.6117 2.02787 69.5403 1.67165 70.5557 1.67165H70.5566C72.1803 1.67165 73.498 2.98838 73.498 4.61208V9.7986H71.8711V4.96462C71.8711 4.00413 71.0923 3.22462 70.1318 3.22438C68.9018 3.22438 67.9045 4.221 67.9043 5.45095V9.7986H66.2725V1.67165H67.4404L67.8779 2.61892ZM77.3252 2.61892C78.059 2.02789 78.9876 1.67165 80.0029 1.67165H80.0039C81.6276 1.67165 82.9443 2.98838 82.9443 4.61208V9.7986H81.3184V4.96462C81.3184 4.00399 80.5388 3.22438 79.5781 3.22438C78.3483 3.2246 77.3518 4.22113 77.3516 5.45095V9.7986H75.7197V1.67165H76.8877L77.3252 2.61892ZM133.85 1.67165L134.287 2.61892C135.021 2.02792 135.95 1.67173 136.965 1.67165H136.967C138.59 1.67181 139.907 2.98848 139.907 4.61208V9.7986H138.28V4.96462C138.28 4.00403 137.502 3.22446 136.541 3.22438C135.311 3.22438 134.315 4.221 134.314 5.45095V9.7986H132.683V1.67165H133.85ZM88.5391 3.29567C87.1368 3.29567 86 4.43248 86 5.83474C86.0002 7.23681 87.1369 8.3738 88.5391 8.3738C89.9411 8.37372 91.0779 7.23676 91.0781 5.83474C91.0781 4.43253 89.9412 3.29575 88.5391 3.29567ZM106.479 3.29567C105.076 3.29591 103.94 4.43263 103.94 5.83474C103.941 7.23666 105.077 8.37356 106.479 8.3738C107.881 8.3738 109.017 7.23681 109.018 5.83474C109.018 4.43248 107.881 3.29567 106.479 3.29567ZM126.684 3.29567C125.281 3.29573 124.145 4.43252 124.145 5.83474C124.145 7.23677 125.282 8.37374 126.684 8.3738C128.086 8.3738 129.222 7.23681 129.223 5.83474C129.223 4.43248 128.086 3.29567 126.684 3.29567ZM120.852 1.84938H119.226V-0.000225067H120.852V1.84938Z",fill:"white"}),C("path",{d:"M11.124 10.0002H8.73438L5.63672 3.35569L2.53809 10.0002H0.148438L4.81152 0.000221252H6.46191L11.124 10.0002ZM20.3516 6.48264V0.000221252H22.5371V9.99924H20.3516L15.2871 3.51682V9.99924H13.1016V0.000221252H15.2871L20.3516 6.48264ZM27.209 9.99924H25.0234V0.000221252H27.209V9.99924ZM30.3037 4.99924L34.21 9.99924H31.4619L27.5586 4.99632L31.4619 0.000221252H34.21L30.3037 4.99924ZM44.6006 2.00413H38.1348V3.99827H43.2354V6.0012H38.1348V7.99534H44.6006V9.99924H35.9492V0.000221252H44.6006V2.00413ZM52.3105 0.000221252C54.2297 0.000274701 55.7852 1.55571 55.7852 3.47483C55.7851 5.0072 54.7924 6.30365 53.416 6.76585L55.9414 9.99729H53.1934L49.29 4.99534H52.2998C53.1392 4.99513 53.8203 4.31423 53.8203 3.47483C53.8203 2.63538 53.1392 1.95453 52.2998 1.95432H48.7715V9.99924H46.5859V0.000221252H52.3105Z",fill:"white"})]});var Z=L;export{Z as default};
1
+ import{jsx as C,jsxs as i}from"react/jsx-runtime";import{Container as V}from"./container";import L from"./link";const e=({href:H})=>C(L,{href:H,asChild:!H,children:C("div",{className:"relative z-[46] h-[30px]",children:C(V,{childClassName:"flex !bg-[#1D1D1F] items-center justify-end",className:"h-full",children:C(t,{})})})}),t=H=>i("svg",{width:"148",height:"10",viewBox:"0 0 148 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...H,children:[C("path",{d:"M88.5391 1.66872C90.8392 1.6688 92.7041 3.53461 92.7041 5.83474C92.7039 8.13468 90.839 9.9997 88.5391 9.99977C86.239 9.99977 84.3733 8.13473 84.373 5.83474C84.373 3.53456 86.2389 1.66872 88.5391 1.66872ZM106.479 1.66872C107.484 1.66872 108.407 2.02531 109.127 2.61892L109.477 1.86208H110.645V9.79958H109.477L109.13 9.0486C108.409 9.64225 107.486 9.99977 106.479 9.99977C104.179 9.99954 102.314 8.13458 102.313 5.83474C102.313 3.53471 104.179 1.66896 106.479 1.66872ZM126.684 1.66872C128.984 1.66872 130.849 3.53456 130.849 5.83474C130.848 8.13473 128.984 9.99977 126.684 9.99977C124.384 9.99972 122.519 8.13469 122.519 5.83474C122.519 3.5346 124.383 1.66878 126.684 1.66872ZM144.748 1.66188C146.602 1.66198 147.794 2.66292 147.823 4.20778H146.278C146.249 3.44345 145.631 3.04577 144.719 3.04567C143.806 3.04567 143.247 3.429 143.247 4.0027C143.247 4.7082 144.07 4.85598 145.026 5.0027L145.025 5.00173C146.365 5.23788 147.998 5.48784 147.998 7.44509C147.998 8.98988 146.716 9.99001 144.775 9.99001C142.834 9.98986 141.568 8.93061 141.524 7.28298H143.128C143.172 8.12086 143.878 8.54763 144.835 8.54763C145.703 8.5475 146.38 8.17982 146.38 7.51833C146.38 6.76851 145.527 6.5909 144.556 6.42946C143.232 6.20932 141.673 5.90104 141.673 4.0613C141.673 2.6337 142.893 1.66188 144.748 1.66188ZM115.1 1.85427H117.434V3.24685H115.102V6.85524C115.102 7.79295 115.614 8.32097 116.582 8.32106H117.478V9.80251L116.275 9.8406C114.545 9.84058 113.474 8.76932 113.474 7.02419V3.24685H112.285V2.93532L114.577 0.000751495H115.1V1.85427ZM63.7627 9.79958H62.1367V-0.000225067H63.7627V9.79958ZM97.5566 7.32302L100.108 1.85427H101.884L98.1787 9.79958H96.9355L93.2305 1.85427H95.0059L97.5566 7.32302ZM120.852 9.79958H119.226V3.24587H120.852V9.79958ZM67.8779 2.61892C68.6117 2.02787 69.5403 1.67165 70.5557 1.67165H70.5566C72.1803 1.67165 73.498 2.98838 73.498 4.61208V9.7986H71.8711V4.96462C71.8711 4.00413 71.0923 3.22462 70.1318 3.22438C68.9018 3.22438 67.9045 4.221 67.9043 5.45095V9.7986H66.2725V1.67165H67.4404L67.8779 2.61892ZM77.3252 2.61892C78.059 2.02789 78.9876 1.67165 80.0029 1.67165H80.0039C81.6276 1.67165 82.9443 2.98838 82.9443 4.61208V9.7986H81.3184V4.96462C81.3184 4.00399 80.5388 3.22438 79.5781 3.22438C78.3483 3.2246 77.3518 4.22113 77.3516 5.45095V9.7986H75.7197V1.67165H76.8877L77.3252 2.61892ZM133.85 1.67165L134.287 2.61892C135.021 2.02792 135.95 1.67173 136.965 1.67165H136.967C138.59 1.67181 139.907 2.98848 139.907 4.61208V9.7986H138.28V4.96462C138.28 4.00403 137.502 3.22446 136.541 3.22438C135.311 3.22438 134.315 4.221 134.314 5.45095V9.7986H132.683V1.67165H133.85ZM88.5391 3.29567C87.1368 3.29567 86 4.43248 86 5.83474C86.0002 7.23681 87.1369 8.3738 88.5391 8.3738C89.9411 8.37372 91.0779 7.23676 91.0781 5.83474C91.0781 4.43253 89.9412 3.29575 88.5391 3.29567ZM106.479 3.29567C105.076 3.29591 103.94 4.43263 103.94 5.83474C103.941 7.23666 105.077 8.37356 106.479 8.3738C107.881 8.3738 109.017 7.23681 109.018 5.83474C109.018 4.43248 107.881 3.29567 106.479 3.29567ZM126.684 3.29567C125.281 3.29573 124.145 4.43252 124.145 5.83474C124.145 7.23677 125.282 8.37374 126.684 8.3738C128.086 8.3738 129.222 7.23681 129.223 5.83474C129.223 4.43248 128.086 3.29567 126.684 3.29567ZM120.852 1.84938H119.226V-0.000225067H120.852V1.84938Z",fill:"white"}),C("path",{d:"M11.124 10.0002H8.73438L5.63672 3.35569L2.53809 10.0002H0.148438L4.81152 0.000221252H6.46191L11.124 10.0002ZM20.3516 6.48264V0.000221252H22.5371V9.99924H20.3516L15.2871 3.51682V9.99924H13.1016V0.000221252H15.2871L20.3516 6.48264ZM27.209 9.99924H25.0234V0.000221252H27.209V9.99924ZM30.3037 4.99924L34.21 9.99924H31.4619L27.5586 4.99632L31.4619 0.000221252H34.21L30.3037 4.99924ZM44.6006 2.00413H38.1348V3.99827H43.2354V6.0012H38.1348V7.99534H44.6006V9.99924H35.9492V0.000221252H44.6006V2.00413ZM52.3105 0.000221252C54.2297 0.000274701 55.7852 1.55571 55.7852 3.47483C55.7851 5.0072 54.7924 6.30365 53.416 6.76585L55.9414 9.99729H53.1934L49.29 4.99534H52.2998C53.1392 4.99513 53.8203 4.31423 53.8203 3.47483C53.8203 2.63538 53.1392 1.95453 52.2998 1.95432H48.7715V9.99924H46.5859V0.000221252H52.3105Z",fill:"white"})]});var n=e;export{n as default};
2
2
  //# sourceMappingURL=board.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/board.tsx"],
4
- "sourcesContent": ["import { Container } from './container'\n\nconst Board = () => {\n return (\n <div className=\"relative z-[46] h-[30px]\">\n <Container childClassName=\"flex !bg-[#1D1D1F] items-center justify-end\" className=\"h-full\">\n <AnkerInnovations />\n </Container>\n </div>\n )\n}\n\nconst AnkerInnovations = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"148\" height=\"10\" viewBox=\"0 0 148 10\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n d=\"M88.5391 1.66872C90.8392 1.6688 92.7041 3.53461 92.7041 5.83474C92.7039 8.13468 90.839 9.9997 88.5391 9.99977C86.239 9.99977 84.3733 8.13473 84.373 5.83474C84.373 3.53456 86.2389 1.66872 88.5391 1.66872ZM106.479 1.66872C107.484 1.66872 108.407 2.02531 109.127 2.61892L109.477 1.86208H110.645V9.79958H109.477L109.13 9.0486C108.409 9.64225 107.486 9.99977 106.479 9.99977C104.179 9.99954 102.314 8.13458 102.313 5.83474C102.313 3.53471 104.179 1.66896 106.479 1.66872ZM126.684 1.66872C128.984 1.66872 130.849 3.53456 130.849 5.83474C130.848 8.13473 128.984 9.99977 126.684 9.99977C124.384 9.99972 122.519 8.13469 122.519 5.83474C122.519 3.5346 124.383 1.66878 126.684 1.66872ZM144.748 1.66188C146.602 1.66198 147.794 2.66292 147.823 4.20778H146.278C146.249 3.44345 145.631 3.04577 144.719 3.04567C143.806 3.04567 143.247 3.429 143.247 4.0027C143.247 4.7082 144.07 4.85598 145.026 5.0027L145.025 5.00173C146.365 5.23788 147.998 5.48784 147.998 7.44509C147.998 8.98988 146.716 9.99001 144.775 9.99001C142.834 9.98986 141.568 8.93061 141.524 7.28298H143.128C143.172 8.12086 143.878 8.54763 144.835 8.54763C145.703 8.5475 146.38 8.17982 146.38 7.51833C146.38 6.76851 145.527 6.5909 144.556 6.42946C143.232 6.20932 141.673 5.90104 141.673 4.0613C141.673 2.6337 142.893 1.66188 144.748 1.66188ZM115.1 1.85427H117.434V3.24685H115.102V6.85524C115.102 7.79295 115.614 8.32097 116.582 8.32106H117.478V9.80251L116.275 9.8406C114.545 9.84058 113.474 8.76932 113.474 7.02419V3.24685H112.285V2.93532L114.577 0.000751495H115.1V1.85427ZM63.7627 9.79958H62.1367V-0.000225067H63.7627V9.79958ZM97.5566 7.32302L100.108 1.85427H101.884L98.1787 9.79958H96.9355L93.2305 1.85427H95.0059L97.5566 7.32302ZM120.852 9.79958H119.226V3.24587H120.852V9.79958ZM67.8779 2.61892C68.6117 2.02787 69.5403 1.67165 70.5557 1.67165H70.5566C72.1803 1.67165 73.498 2.98838 73.498 4.61208V9.7986H71.8711V4.96462C71.8711 4.00413 71.0923 3.22462 70.1318 3.22438C68.9018 3.22438 67.9045 4.221 67.9043 5.45095V9.7986H66.2725V1.67165H67.4404L67.8779 2.61892ZM77.3252 2.61892C78.059 2.02789 78.9876 1.67165 80.0029 1.67165H80.0039C81.6276 1.67165 82.9443 2.98838 82.9443 4.61208V9.7986H81.3184V4.96462C81.3184 4.00399 80.5388 3.22438 79.5781 3.22438C78.3483 3.2246 77.3518 4.22113 77.3516 5.45095V9.7986H75.7197V1.67165H76.8877L77.3252 2.61892ZM133.85 1.67165L134.287 2.61892C135.021 2.02792 135.95 1.67173 136.965 1.67165H136.967C138.59 1.67181 139.907 2.98848 139.907 4.61208V9.7986H138.28V4.96462C138.28 4.00403 137.502 3.22446 136.541 3.22438C135.311 3.22438 134.315 4.221 134.314 5.45095V9.7986H132.683V1.67165H133.85ZM88.5391 3.29567C87.1368 3.29567 86 4.43248 86 5.83474C86.0002 7.23681 87.1369 8.3738 88.5391 8.3738C89.9411 8.37372 91.0779 7.23676 91.0781 5.83474C91.0781 4.43253 89.9412 3.29575 88.5391 3.29567ZM106.479 3.29567C105.076 3.29591 103.94 4.43263 103.94 5.83474C103.941 7.23666 105.077 8.37356 106.479 8.3738C107.881 8.3738 109.017 7.23681 109.018 5.83474C109.018 4.43248 107.881 3.29567 106.479 3.29567ZM126.684 3.29567C125.281 3.29573 124.145 4.43252 124.145 5.83474C124.145 7.23677 125.282 8.37374 126.684 8.3738C128.086 8.3738 129.222 7.23681 129.223 5.83474C129.223 4.43248 128.086 3.29567 126.684 3.29567ZM120.852 1.84938H119.226V-0.000225067H120.852V1.84938Z\"\n fill=\"white\"\n />\n <path\n d=\"M11.124 10.0002H8.73438L5.63672 3.35569L2.53809 10.0002H0.148438L4.81152 0.000221252H6.46191L11.124 10.0002ZM20.3516 6.48264V0.000221252H22.5371V9.99924H20.3516L15.2871 3.51682V9.99924H13.1016V0.000221252H15.2871L20.3516 6.48264ZM27.209 9.99924H25.0234V0.000221252H27.209V9.99924ZM30.3037 4.99924L34.21 9.99924H31.4619L27.5586 4.99632L31.4619 0.000221252H34.21L30.3037 4.99924ZM44.6006 2.00413H38.1348V3.99827H43.2354V6.0012H38.1348V7.99534H44.6006V9.99924H35.9492V0.000221252H44.6006V2.00413ZM52.3105 0.000221252C54.2297 0.000274701 55.7852 1.55571 55.7852 3.47483C55.7851 5.0072 54.7924 6.30365 53.416 6.76585L55.9414 9.99729H53.1934L49.29 4.99534H52.2998C53.1392 4.99513 53.8203 4.31423 53.8203 3.47483C53.8203 2.63538 53.1392 1.95453 52.2998 1.95432H48.7715V9.99924H46.5859V0.000221252H52.3105Z\"\n fill=\"white\"\n />\n </svg>\n )\n}\n\nexport default Board\n"],
5
- "mappings": "AAMQ,cAAAA,EAQJ,QAAAC,MARI,oBANR,OAAS,aAAAC,MAAiB,cAE1B,MAAMC,EAAQ,IAEVH,EAAC,OAAI,UAAU,2BACb,SAAAA,EAACE,EAAA,CAAU,eAAe,8CAA8C,UAAU,SAChF,SAAAF,EAACI,EAAA,EAAiB,EACpB,EACF,EAIEA,EAAoBC,GAEtBJ,EAAC,OAAI,MAAM,MAAM,OAAO,KAAK,QAAQ,aAAa,KAAK,OAAO,MAAM,6BAA8B,GAAGI,EACnG,UAAAL,EAAC,QACC,EAAE,uqGACF,KAAK,QACP,EACAA,EAAC,QACC,EAAE,iyBACF,KAAK,QACP,GACF,EAIJ,IAAOM,EAAQH",
6
- "names": ["jsx", "jsxs", "Container", "Board", "AnkerInnovations", "props", "board_default"]
4
+ "sourcesContent": ["import { Container } from './container'\nimport Link from './link'\n\nconst Board = ({ href }: { href?: string }) => {\n return (\n <Link href={href} asChild={!href}>\n <div className=\"relative z-[46] h-[30px]\">\n <Container childClassName=\"flex !bg-[#1D1D1F] items-center justify-end\" className=\"h-full\">\n <AnkerInnovations />\n </Container>\n </div>\n </Link>\n )\n}\n\nconst AnkerInnovations = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"148\" height=\"10\" viewBox=\"0 0 148 10\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n d=\"M88.5391 1.66872C90.8392 1.6688 92.7041 3.53461 92.7041 5.83474C92.7039 8.13468 90.839 9.9997 88.5391 9.99977C86.239 9.99977 84.3733 8.13473 84.373 5.83474C84.373 3.53456 86.2389 1.66872 88.5391 1.66872ZM106.479 1.66872C107.484 1.66872 108.407 2.02531 109.127 2.61892L109.477 1.86208H110.645V9.79958H109.477L109.13 9.0486C108.409 9.64225 107.486 9.99977 106.479 9.99977C104.179 9.99954 102.314 8.13458 102.313 5.83474C102.313 3.53471 104.179 1.66896 106.479 1.66872ZM126.684 1.66872C128.984 1.66872 130.849 3.53456 130.849 5.83474C130.848 8.13473 128.984 9.99977 126.684 9.99977C124.384 9.99972 122.519 8.13469 122.519 5.83474C122.519 3.5346 124.383 1.66878 126.684 1.66872ZM144.748 1.66188C146.602 1.66198 147.794 2.66292 147.823 4.20778H146.278C146.249 3.44345 145.631 3.04577 144.719 3.04567C143.806 3.04567 143.247 3.429 143.247 4.0027C143.247 4.7082 144.07 4.85598 145.026 5.0027L145.025 5.00173C146.365 5.23788 147.998 5.48784 147.998 7.44509C147.998 8.98988 146.716 9.99001 144.775 9.99001C142.834 9.98986 141.568 8.93061 141.524 7.28298H143.128C143.172 8.12086 143.878 8.54763 144.835 8.54763C145.703 8.5475 146.38 8.17982 146.38 7.51833C146.38 6.76851 145.527 6.5909 144.556 6.42946C143.232 6.20932 141.673 5.90104 141.673 4.0613C141.673 2.6337 142.893 1.66188 144.748 1.66188ZM115.1 1.85427H117.434V3.24685H115.102V6.85524C115.102 7.79295 115.614 8.32097 116.582 8.32106H117.478V9.80251L116.275 9.8406C114.545 9.84058 113.474 8.76932 113.474 7.02419V3.24685H112.285V2.93532L114.577 0.000751495H115.1V1.85427ZM63.7627 9.79958H62.1367V-0.000225067H63.7627V9.79958ZM97.5566 7.32302L100.108 1.85427H101.884L98.1787 9.79958H96.9355L93.2305 1.85427H95.0059L97.5566 7.32302ZM120.852 9.79958H119.226V3.24587H120.852V9.79958ZM67.8779 2.61892C68.6117 2.02787 69.5403 1.67165 70.5557 1.67165H70.5566C72.1803 1.67165 73.498 2.98838 73.498 4.61208V9.7986H71.8711V4.96462C71.8711 4.00413 71.0923 3.22462 70.1318 3.22438C68.9018 3.22438 67.9045 4.221 67.9043 5.45095V9.7986H66.2725V1.67165H67.4404L67.8779 2.61892ZM77.3252 2.61892C78.059 2.02789 78.9876 1.67165 80.0029 1.67165H80.0039C81.6276 1.67165 82.9443 2.98838 82.9443 4.61208V9.7986H81.3184V4.96462C81.3184 4.00399 80.5388 3.22438 79.5781 3.22438C78.3483 3.2246 77.3518 4.22113 77.3516 5.45095V9.7986H75.7197V1.67165H76.8877L77.3252 2.61892ZM133.85 1.67165L134.287 2.61892C135.021 2.02792 135.95 1.67173 136.965 1.67165H136.967C138.59 1.67181 139.907 2.98848 139.907 4.61208V9.7986H138.28V4.96462C138.28 4.00403 137.502 3.22446 136.541 3.22438C135.311 3.22438 134.315 4.221 134.314 5.45095V9.7986H132.683V1.67165H133.85ZM88.5391 3.29567C87.1368 3.29567 86 4.43248 86 5.83474C86.0002 7.23681 87.1369 8.3738 88.5391 8.3738C89.9411 8.37372 91.0779 7.23676 91.0781 5.83474C91.0781 4.43253 89.9412 3.29575 88.5391 3.29567ZM106.479 3.29567C105.076 3.29591 103.94 4.43263 103.94 5.83474C103.941 7.23666 105.077 8.37356 106.479 8.3738C107.881 8.3738 109.017 7.23681 109.018 5.83474C109.018 4.43248 107.881 3.29567 106.479 3.29567ZM126.684 3.29567C125.281 3.29573 124.145 4.43252 124.145 5.83474C124.145 7.23677 125.282 8.37374 126.684 8.3738C128.086 8.3738 129.222 7.23681 129.223 5.83474C129.223 4.43248 128.086 3.29567 126.684 3.29567ZM120.852 1.84938H119.226V-0.000225067H120.852V1.84938Z\"\n fill=\"white\"\n />\n <path\n d=\"M11.124 10.0002H8.73438L5.63672 3.35569L2.53809 10.0002H0.148438L4.81152 0.000221252H6.46191L11.124 10.0002ZM20.3516 6.48264V0.000221252H22.5371V9.99924H20.3516L15.2871 3.51682V9.99924H13.1016V0.000221252H15.2871L20.3516 6.48264ZM27.209 9.99924H25.0234V0.000221252H27.209V9.99924ZM30.3037 4.99924L34.21 9.99924H31.4619L27.5586 4.99632L31.4619 0.000221252H34.21L30.3037 4.99924ZM44.6006 2.00413H38.1348V3.99827H43.2354V6.0012H38.1348V7.99534H44.6006V9.99924H35.9492V0.000221252H44.6006V2.00413ZM52.3105 0.000221252C54.2297 0.000274701 55.7852 1.55571 55.7852 3.47483C55.7851 5.0072 54.7924 6.30365 53.416 6.76585L55.9414 9.99729H53.1934L49.29 4.99534H52.2998C53.1392 4.99513 53.8203 4.31423 53.8203 3.47483C53.8203 2.63538 53.1392 1.95453 52.2998 1.95432H48.7715V9.99924H46.5859V0.000221252H52.3105Z\"\n fill=\"white\"\n />\n </svg>\n )\n}\n\nexport default Board\n"],
5
+ "mappings": "AAQU,cAAAA,EASN,QAAAC,MATM,oBARV,OAAS,aAAAC,MAAiB,cAC1B,OAAOC,MAAU,SAEjB,MAAMC,EAAQ,CAAC,CAAE,KAAAC,CAAK,IAElBL,EAACG,EAAA,CAAK,KAAME,EAAM,QAAS,CAACA,EAC1B,SAAAL,EAAC,OAAI,UAAU,2BACb,SAAAA,EAACE,EAAA,CAAU,eAAe,8CAA8C,UAAU,SAChF,SAAAF,EAACM,EAAA,EAAiB,EACpB,EACF,EACF,EAIEA,EAAoBC,GAEtBN,EAAC,OAAI,MAAM,MAAM,OAAO,KAAK,QAAQ,aAAa,KAAK,OAAO,MAAM,6BAA8B,GAAGM,EACnG,UAAAP,EAAC,QACC,EAAE,uqGACF,KAAK,QACP,EACAA,EAAC,QACC,EAAE,iyBACF,KAAK,QACP,GACF,EAIJ,IAAOQ,EAAQJ",
6
+ "names": ["jsx", "jsxs", "Container", "Link", "Board", "href", "AnkerInnovations", "props", "board_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as o,jsxs as r}from"react/jsx-runtime";import*as s from"react";import*as e from"@radix-ui/react-dialog";import{Cross2Icon as u}from"@radix-ui/react-icons";import{cn as l}from"../helpers/index.js";const d=e.Root;d.displayName="Dialog";const R=e.Trigger,c=e.Portal,v=e.Close,n=s.forwardRef(({className:t,...a},i)=>o(e.Overlay,{ref:i,className:l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",t),...a}));n.displayName=e.Overlay.displayName;const f=s.forwardRef(({className:t,children:a,...i},y)=>r(c,{children:[o(n,{}),r(e.Content,{ref:y,className:l("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] tablet:rounded-lg fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border p-6 shadow-lg duration-200",t),...i,children:[a,r(e.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none",children:[o(u,{className:"size-4"}),o("span",{className:"sr-only",children:"Close"})]})]})]}));f.displayName=e.Content.displayName;const m=({className:t,...a})=>o("div",{className:l("tablet:text-left flex flex-col space-y-1.5 text-center",t),...a});m.displayName="DialogHeader";const p=({className:t,...a})=>o("div",{className:l("tablet:flex-row tablet:justify-end tablet:space-x-2 flex flex-col-reverse",t),...a});p.displayName="DialogFooter";const g=s.forwardRef(({className:t,...a},i)=>o(e.Title,{ref:i,className:l("text-lg font-semibold leading-none tracking-tight",t),...a}));g.displayName=e.Title.displayName;const D=s.forwardRef(({className:t,...a},i)=>o(e.Description,{ref:i,className:l("text-muted-foreground text-sm",t),...a}));D.displayName=e.Description.displayName;export{d as Dialog,v as DialogClose,f as DialogContent,D as DialogDescription,p as DialogFooter,m as DialogHeader,n as DialogOverlay,c as DialogPortal,g as DialogTitle,R as DialogTrigger};
1
+ "use client";import{jsx as o,jsxs as r}from"react/jsx-runtime";import*as s from"react";import*as e from"@radix-ui/react-dialog";import{Cross2Icon as u}from"@radix-ui/react-icons";import{cn as l}from"../helpers/index.js";const d=e.Root;d.displayName="Dialog";const R=e.Trigger,c=e.Portal,v=e.Close,n=s.forwardRef(({className:t,...a},i)=>o(e.Overlay,{ref:i,className:l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[100] bg-black/80",t),...a}));n.displayName=e.Overlay.displayName;const f=s.forwardRef(({className:t,children:a,...i},y)=>r(c,{children:[o(n,{}),r(e.Content,{ref:y,className:l("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] tablet:rounded-lg fixed left-1/2 top-1/2 z-[100] grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border p-6 shadow-lg duration-200",t),...i,children:[a,r(e.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none",children:[o(u,{className:"size-4"}),o("span",{className:"sr-only",children:"Close"})]})]})]}));f.displayName=e.Content.displayName;const m=({className:t,...a})=>o("div",{className:l("tablet:text-left flex flex-col space-y-1.5 text-center",t),...a});m.displayName="DialogHeader";const p=({className:t,...a})=>o("div",{className:l("tablet:flex-row tablet:justify-end tablet:space-x-2 flex flex-col-reverse",t),...a});p.displayName="DialogFooter";const g=s.forwardRef(({className:t,...a},i)=>o(e.Title,{ref:i,className:l("text-lg font-semibold leading-none tracking-tight",t),...a}));g.displayName=e.Title.displayName;const D=s.forwardRef(({className:t,...a},i)=>o(e.Description,{ref:i,className:l("text-muted-foreground text-sm",t),...a}));D.displayName=e.Description.displayName;export{d as Dialog,v as DialogClose,f as DialogContent,D as DialogDescription,p as DialogFooter,m as DialogHeader,n as DialogOverlay,c as DialogPortal,g as DialogTitle,R as DialogTrigger};
2
2
  //# sourceMappingURL=dialog.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/dialog.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport * as DialogPrimitive from '@radix-ui/react-dialog'\nimport { Cross2Icon } from '@radix-ui/react-icons'\n\nimport { cn } from '../helpers/index.js'\n\nconst Dialog = DialogPrimitive.Root\nDialog.displayName = 'Dialog'\n\nconst DialogTrigger = DialogPrimitive.Trigger\n\nconst DialogPortal = DialogPrimitive.Portal\n\nconst DialogClose = DialogPrimitive.Close\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80',\n className\n )}\n {...props}\n />\n))\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] tablet:rounded-lg fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border p-6 shadow-lg duration-200',\n className\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none\">\n <Cross2Icon className=\"size-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n))\nDialogContent.displayName = DialogPrimitive.Content.displayName\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('tablet:text-left flex flex-col space-y-1.5 text-center', className)} {...props} />\n)\nDialogHeader.displayName = 'DialogHeader'\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn('tablet:flex-row tablet:justify-end tablet:space-x-2 flex flex-col-reverse', className)}\n {...props}\n />\n)\nDialogFooter.displayName = 'DialogFooter'\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold leading-none tracking-tight', className)}\n {...props}\n />\n))\nDialogTitle.displayName = DialogPrimitive.Title.displayName\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />\n))\nDialogDescription.displayName = DialogPrimitive.Description.displayName\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n}\n"],
5
- "mappings": "aAqBE,cAAAA,EA0BI,QAAAC,MA1BJ,oBAnBF,UAAYC,MAAW,QACvB,UAAYC,MAAqB,yBACjC,OAAS,cAAAC,MAAkB,wBAE3B,OAAS,MAAAC,MAAU,sBAEnB,MAAMC,EAASH,EAAgB,KAC/BG,EAAO,YAAc,SAErB,MAAMC,EAAgBJ,EAAgB,QAEhCK,EAAeL,EAAgB,OAE/BM,EAAcN,EAAgB,MAE9BO,EAAgBR,EAAM,WAG1B,CAAC,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,IAC1Bb,EAACG,EAAgB,QAAhB,CACC,IAAKU,EACL,UAAWR,EACT,0JACAM,CACF,EACC,GAAGC,EACN,CACD,EACDF,EAAc,YAAcP,EAAgB,QAAQ,YAEpD,MAAMW,EAAgBZ,EAAM,WAG1B,CAAC,CAAE,UAAAS,EAAW,SAAAI,EAAU,GAAGH,CAAM,EAAGC,IACpCZ,EAACO,EAAA,CACC,UAAAR,EAACU,EAAA,EAAc,EACfT,EAACE,EAAgB,QAAhB,CACC,IAAKU,EACL,UAAWR,EACT,0fACAM,CACF,EACC,GAAGC,EAEH,UAAAG,EACDd,EAACE,EAAgB,MAAhB,CAAsB,UAAU,gRAC/B,UAAAH,EAACI,EAAA,CAAW,UAAU,SAAS,EAC/BJ,EAAC,QAAK,UAAU,UAAU,iBAAK,GACjC,GACF,GACF,CACD,EACDc,EAAc,YAAcX,EAAgB,QAAQ,YAEpD,MAAMa,EAAe,CAAC,CAAE,UAAAL,EAAW,GAAGC,CAAM,IAC1CZ,EAAC,OAAI,UAAWK,EAAG,yDAA0DM,CAAS,EAAI,GAAGC,EAAO,EAEtGI,EAAa,YAAc,eAE3B,MAAMC,EAAe,CAAC,CAAE,UAAAN,EAAW,GAAGC,CAAM,IAC1CZ,EAAC,OACC,UAAWK,EAAG,4EAA6EM,CAAS,EACnG,GAAGC,EACN,EAEFK,EAAa,YAAc,eAE3B,MAAMC,EAAchB,EAAM,WAGxB,CAAC,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,IAC1Bb,EAACG,EAAgB,MAAhB,CACC,IAAKU,EACL,UAAWR,EAAG,oDAAqDM,CAAS,EAC3E,GAAGC,EACN,CACD,EACDM,EAAY,YAAcf,EAAgB,MAAM,YAEhD,MAAMgB,EAAoBjB,EAAM,WAG9B,CAAC,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,IAC1Bb,EAACG,EAAgB,YAAhB,CAA4B,IAAKU,EAAK,UAAWR,EAAG,gCAAiCM,CAAS,EAAI,GAAGC,EAAO,CAC9G,EACDO,EAAkB,YAAchB,EAAgB,YAAY",
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport * as DialogPrimitive from '@radix-ui/react-dialog'\nimport { Cross2Icon } from '@radix-ui/react-icons'\n\nimport { cn } from '../helpers/index.js'\n\nconst Dialog = DialogPrimitive.Root\nDialog.displayName = 'Dialog'\n\nconst DialogTrigger = DialogPrimitive.Trigger\n\nconst DialogPortal = DialogPrimitive.Portal\n\nconst DialogClose = DialogPrimitive.Close\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[100] bg-black/80',\n className\n )}\n {...props}\n />\n))\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] tablet:rounded-lg fixed left-1/2 top-1/2 z-[100] grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border p-6 shadow-lg duration-200',\n className\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none\">\n <Cross2Icon className=\"size-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n))\nDialogContent.displayName = DialogPrimitive.Content.displayName\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('tablet:text-left flex flex-col space-y-1.5 text-center', className)} {...props} />\n)\nDialogHeader.displayName = 'DialogHeader'\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn('tablet:flex-row tablet:justify-end tablet:space-x-2 flex flex-col-reverse', className)}\n {...props}\n />\n)\nDialogFooter.displayName = 'DialogFooter'\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold leading-none tracking-tight', className)}\n {...props}\n />\n))\nDialogTitle.displayName = DialogPrimitive.Title.displayName\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />\n))\nDialogDescription.displayName = DialogPrimitive.Description.displayName\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n}\n"],
5
+ "mappings": "aAqBE,cAAAA,EA0BI,QAAAC,MA1BJ,oBAnBF,UAAYC,MAAW,QACvB,UAAYC,MAAqB,yBACjC,OAAS,cAAAC,MAAkB,wBAE3B,OAAS,MAAAC,MAAU,sBAEnB,MAAMC,EAASH,EAAgB,KAC/BG,EAAO,YAAc,SAErB,MAAMC,EAAgBJ,EAAgB,QAEhCK,EAAeL,EAAgB,OAE/BM,EAAcN,EAAgB,MAE9BO,EAAgBR,EAAM,WAG1B,CAAC,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,IAC1Bb,EAACG,EAAgB,QAAhB,CACC,IAAKU,EACL,UAAWR,EACT,6JACAM,CACF,EACC,GAAGC,EACN,CACD,EACDF,EAAc,YAAcP,EAAgB,QAAQ,YAEpD,MAAMW,EAAgBZ,EAAM,WAG1B,CAAC,CAAE,UAAAS,EAAW,SAAAI,EAAU,GAAGH,CAAM,EAAGC,IACpCZ,EAACO,EAAA,CACC,UAAAR,EAACU,EAAA,EAAc,EACfT,EAACE,EAAgB,QAAhB,CACC,IAAKU,EACL,UAAWR,EACT,6fACAM,CACF,EACC,GAAGC,EAEH,UAAAG,EACDd,EAACE,EAAgB,MAAhB,CAAsB,UAAU,gRAC/B,UAAAH,EAACI,EAAA,CAAW,UAAU,SAAS,EAC/BJ,EAAC,QAAK,UAAU,UAAU,iBAAK,GACjC,GACF,GACF,CACD,EACDc,EAAc,YAAcX,EAAgB,QAAQ,YAEpD,MAAMa,EAAe,CAAC,CAAE,UAAAL,EAAW,GAAGC,CAAM,IAC1CZ,EAAC,OAAI,UAAWK,EAAG,yDAA0DM,CAAS,EAAI,GAAGC,EAAO,EAEtGI,EAAa,YAAc,eAE3B,MAAMC,EAAe,CAAC,CAAE,UAAAN,EAAW,GAAGC,CAAM,IAC1CZ,EAAC,OACC,UAAWK,EAAG,4EAA6EM,CAAS,EACnG,GAAGC,EACN,EAEFK,EAAa,YAAc,eAE3B,MAAMC,EAAchB,EAAM,WAGxB,CAAC,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,IAC1Bb,EAACG,EAAgB,MAAhB,CACC,IAAKU,EACL,UAAWR,EAAG,oDAAqDM,CAAS,EAC3E,GAAGC,EACN,CACD,EACDM,EAAY,YAAcf,EAAgB,MAAM,YAEhD,MAAMgB,EAAoBjB,EAAM,WAG9B,CAAC,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,IAC1Bb,EAACG,EAAgB,YAAhB,CAA4B,IAAKU,EAAK,UAAWR,EAAG,gCAAiCM,CAAS,EAAI,GAAGC,EAAO,CAC9G,EACDO,EAAkB,YAAchB,EAAgB,YAAY",
6
6
  "names": ["jsx", "jsxs", "React", "DialogPrimitive", "Cross2Icon", "cn", "Dialog", "DialogTrigger", "DialogPortal", "DialogClose", "DialogOverlay", "className", "props", "ref", "DialogContent", "children", "DialogHeader", "DialogFooter", "DialogTitle", "DialogDescription"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as d,jsxs as k}from"react/jsx-runtime";import I,{useCallback as f,useMemo as S}from"react";const _=["cdn.shopify.com","cdn.shopifycdn.net","www.facebook.com"],$=3960,x=3980,A=n=>_.some(c=>n==c),L=(n="")=>/\.(png|apng|jpg|jpeg|gif|svg|webp|tif)/.test(n),y=I.forwardRef(({imgClassName:n="",source:c="",quality:p=2,deviceSizes:l=[375,767,1023,1024,1279,1440,1439,1539,1919,1920],className:h,loading:w="lazy",alt:M="",...m},P)=>{const i=f(({src:t,width:r})=>{const s=r;try{const e=new URL(t);if(!A(e.hostname))return t;const o=e.pathname.split("/").pop()||"";if(L(o)){const[g,a]=o.split(".");return`${e.origin}${e.pathname.replace(o,`${g}_${s<$?s:x}x.${a}`)}`}}catch{return t}},[]),u=f(({srcArr:t,width:r})=>{const s=r*p,e=i({src:t[0][0],width:s});let o;return t.forEach(a=>{var E=a[0];a.length>1&&parseInt(a[1],10)>=r&&(o=i({src:E,width:s}))}),d("source",{srcSet:o||e,media:`(max-width: ${r}px)`},r)},[i,p]),b=S(()=>{if(typeof c!="string"||!c)return[];let t;try{t=c.replace(/[\r\n]/g,"").replace(/\s\s+/g," ").split(",").map(e=>e.split(" ").filter(Boolean))}catch(e){return console.log(e),[]}const r=l.map(e=>u({srcArr:t,width:e})),s=i({src:t[0][0],width:1920*p});return r.push(d("img",{src:s,className:`w-full ${n}`,loading:w,alt:M??"",...m},"default")),r},[l,n,i,p,c,u]);return k("picture",{ref:P,className:`block overflow-hidden ${h}`,children:[b,m.children]})});var N=y;export{N as default};
1
+ "use client";import{jsx as h,jsxs as F}from"react/jsx-runtime";import I,{useCallback as d,useMemo as _}from"react";const x=["cdn.shopify.com","cdn.shopifycdn.net","www.facebook.com"],$=3960,v=3980,A={domains:["cdn.shopify.com","cdn.shopifycdn.net","www.facebook.com"],deviceSizes:[375,768,1024,1280,1440,1540,1920]},L=s=>x.some(o=>s==o),k=(s="")=>/\.(png|apng|jpg|jpeg|gif|svg|webp|tif)/.test(s),j=I.forwardRef(({imgClassName:s="",source:o="",quality:a=2,deviceSizes:g=[375,767,1023,1024,1279,1440,1439,1539,1919,1920],className:w,loading:b="lazy",alt:M="",...l},P)=>{const S=t=>(A?.domains||[]).some(r=>t.includes(r)),i=d(({src:t,width:n})=>{const r=n;try{const e=new URL(t);if(!L(e.hostname))return t;const p=e.pathname.split("/").pop()||"";if(k(p))return t?.split("/")?.map(m=>{if(S(t)&&/\.(png|apng|jpg|jpeg|gif|svg|webp|tif)(\?.*)?/.test(m)&&/_[0-9]{2,4}x/.test(t)===!1){const c=m.split(".");return c.map((u,E)=>E===c.length-2?`${u}_${r<3960?r:3980}x`:u).join(".")}return m}).join("/")}catch{return t}},[]),f=d(({srcArr:t,width:n})=>{const r=n*a,e=i({src:t[0][0],width:r});let p;return t.forEach(c=>{var u=c[0];c.length>1&&parseInt(c[1],10)>=n&&(p=i({src:u,width:r}))}),h("source",{srcSet:p||e,media:`(max-width: ${n}px)`},n)},[i,a]),y=_(()=>{if(typeof o!="string"||!o)return[];let t;try{t=o.replace(/[\r\n]/g,"").replace(/\s\s+/g," ").split(",").map(e=>e.split(" ").filter(Boolean))}catch(e){return console.log(e),[]}const n=g.map(e=>f({srcArr:t,width:e})),r=i({src:t[0][0],width:1920*a});return n.push(h("img",{src:r,className:`w-full ${s}`,loading:b,alt:M??"",...l},"default")),n},[g,s,i,a,o,f]);return F("picture",{ref:P,className:`block overflow-hidden ${w}`,children:[y,l.children]})});var z=j;export{z as default};
2
2
  //# sourceMappingURL=picture.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/picture.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useCallback, useMemo } from 'react'\n\nconst APPEND_FILE_SUFFIX_MATCH_DOMAIN = ['cdn.shopify.com', 'cdn.shopifycdn.net', 'www.facebook.com']\n\nconst MAX_SIZE = 3960\nconst FIXED_MAX_SIZE = 3980\n\nexport interface PictureProps extends React.ImgHTMLAttributes<HTMLImageElement> {\n /** picture \u5185\u90E8img \u6807\u7B7E\u7684\u7C7B\u540D */\n imgClassName?: string\n /** \u56FE\u7247url , \u652F\u6301\u4F20\u5165\u4E0D\u540C\u5206\u8FA8\u7387\u4E0B\u7684\u56FE\u7247\uFF0C\u6BD4\u5982\uFF0C\u683C\u5F0F \"url1 1920\uFF0C url2 1080, url3 767\" */\n source?: string\n /** \u56FE\u7247\u8D28\u91CF */\n quality?: number\n /** \u54CD\u5E94\u5F0F\u56FE\u7247\uFF0C\u5BF9\u5E94picture \u4E0Bsource \u7684max-width */\n deviceSizes?: number[]\n}\n\nconst isMatchDomain = (srcDomain: string) => {\n return APPEND_FILE_SUFFIX_MATCH_DOMAIN.some(domain => srcDomain == domain)\n}\nconst idMatchFileExtensions = (fileName: string = '') => /\\.(png|apng|jpg|jpeg|gif|svg|webp|tif)/.test(fileName)\n\nconst Picture = React.forwardRef<HTMLPictureElement, PictureProps>(\n (\n {\n imgClassName = '',\n source = '',\n quality = 2,\n deviceSizes = [375, 767, 1023, 1024, 1279, 1440, 1439, 1539, 1919, 1920],\n className,\n loading = 'lazy',\n alt = '',\n ...rest\n }: PictureProps,\n ref\n ) => {\n const imgSrcSetsize = useCallback(({ src, width }: { src: string; width: number }) => {\n const size = width\n try {\n const parsedUrl = new URL(src)\n if (!isMatchDomain(parsedUrl.hostname)) {\n return src\n }\n const fileName = parsedUrl.pathname.split('/').pop() || ''\n if (idMatchFileExtensions(fileName)) {\n const [name, extension] = fileName.split('.')\n return `${parsedUrl.origin}${parsedUrl.pathname.replace(\n fileName,\n `${name}_${size < MAX_SIZE ? size : FIXED_MAX_SIZE}x.${extension}`\n )}`\n }\n } catch (error) {\n return src\n }\n }, [])\n\n const sourceSrcSet = useCallback(\n ({ srcArr, width }: { srcArr: string[][]; width: number }) => {\n const computedWidth = width * quality\n const def = imgSrcSetsize({ src: srcArr[0][0], width: computedWidth })\n let result\n srcArr.forEach(ele => {\n var img = ele[0]\n if (ele.length > 1 && parseInt(ele[1], 10) >= width) {\n result = imgSrcSetsize({ src: img, width: computedWidth })\n }\n })\n const srcset = result || def\n return <source key={width} srcSet={srcset} media={`(max-width: ${width}px)`} />\n },\n [imgSrcSetsize, quality]\n )\n\n const sourceList = useMemo(() => {\n if (typeof source !== 'string' || !source) return []\n let srcArr\n try {\n srcArr = source\n .replace(/[\\r\\n]/g, '')\n .replace(/\\s\\s+/g, ' ')\n .split(',')\n .map(item => item.split(' ').filter(Boolean))\n } catch (error) {\n console.log(error)\n return []\n }\n const sourceList = deviceSizes.map(width => {\n return sourceSrcSet({ srcArr, width })\n })\n\n const img = imgSrcSetsize({ src: srcArr[0][0], width: 1920 * quality })\n\n sourceList.push(\n <img key=\"default\" src={img} className={`w-full ${imgClassName}`} loading={loading} alt={alt ?? ''} {...rest} />\n )\n return sourceList\n }, [deviceSizes, imgClassName, imgSrcSetsize, quality, source, sourceSrcSet])\n\n return (\n <picture ref={ref} className={`block overflow-hidden ${className}`}>\n {sourceList}\n {rest.children}\n </picture>\n )\n }\n)\nexport default Picture\n"],
5
- "mappings": "aAsEe,cAAAA,EA+BT,QAAAC,MA/BS,oBArEf,OAAOC,GAAS,eAAAC,EAAa,WAAAC,MAAe,QAE5C,MAAMC,EAAkC,CAAC,kBAAmB,qBAAsB,kBAAkB,EAE9FC,EAAW,KACXC,EAAiB,KAajBC,EAAiBC,GACdJ,EAAgC,KAAKK,GAAUD,GAAaC,CAAM,EAErEC,EAAwB,CAACC,EAAmB,KAAO,yCAAyC,KAAKA,CAAQ,EAEzGC,EAAUX,EAAM,WACpB,CACE,CACE,aAAAY,EAAe,GACf,OAAAC,EAAS,GACT,QAAAC,EAAU,EACV,YAAAC,EAAc,CAAC,IAAK,IAAK,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,IAAI,EACvE,UAAAC,EACA,QAAA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AI,CACFA,EAAShB,EACN,QAAQ,UAAW,EAAE,EACrB,QAAQ,SAAU,GAAG,EACrB,MAAM,GAAG,EACT,IAAIuB,GAAQA,EAAK,MAAM,GAAG,EAAE,OAAO,OAAO,CAAC,CAChD,OAASC,EAAO,CACd,eAAQ,IAAIA,CAAK,EACV,CAAC,CACV,CACA,MAAMF,EAAapB,EAAY,IAAIQ,GAC1BK,EAAa,CAAE,OAAAC,EAAQ,MAAAN,CAAM,CAAC,CACtC,EAEKW,EAAMb,EAAc,CAAE,IAAKQ,EAAO,CAAC,EAAE,CAAC,EAAG,MAAO,KAAOf,CAAQ,CAAC,EAEtE,OAAAqB,EAAW,KACTrC,EAAC,OAAkB,IAAKoC,EAAK,UAAW,UAAUtB,CAAY,GAAI,QAASK,EAAS,IAAKC,GAAO,GAAK,GAAGC,GAA/F,SAAqG,CAChH,EACOgB,CACT,EAAG,CAACpB,EAAaH,EAAcS,EAAeP,EAASD,EAAQe,CAAY,CAAC,EAE5E,OACE7B,EAAC,WAAQ,IAAKqB,EAAK,UAAW,yBAAyBJ,CAAS,GAC7D,UAAAmB,EACAhB,EAAK,UACR,CAEJ,CACF,EACA,IAAOmB,EAAQ3B",
6
- "names": ["jsx", "jsxs", "React", "useCallback", "useMemo", "APPEND_FILE_SUFFIX_MATCH_DOMAIN", "MAX_SIZE", "FIXED_MAX_SIZE", "isMatchDomain", "srcDomain", "domain", "idMatchFileExtensions", "fileName", "Picture", "imgClassName", "source", "quality", "deviceSizes", "className", "loading", "alt", "rest", "ref", "imgSrcSetsize", "src", "width", "size", "parsedUrl", "name", "extension", "sourceSrcSet", "srcArr", "computedWidth", "def", "result", "ele", "img", "sourceList", "item", "error", "picture_default"]
4
+ "sourcesContent": ["'use client'\nimport React, { useCallback, useMemo } from 'react'\n\nconst APPEND_FILE_SUFFIX_MATCH_DOMAIN = ['cdn.shopify.com', 'cdn.shopifycdn.net', 'www.facebook.com']\n\nconst MAX_SIZE = 3960\nconst FIXED_MAX_SIZE = 3980\n\nexport interface PictureProps extends React.ImgHTMLAttributes<HTMLImageElement> {\n /** picture \u5185\u90E8img \u6807\u7B7E\u7684\u7C7B\u540D */\n imgClassName?: string\n /** \u56FE\u7247url , \u652F\u6301\u4F20\u5165\u4E0D\u540C\u5206\u8FA8\u7387\u4E0B\u7684\u56FE\u7247\uFF0C\u6BD4\u5982\uFF0C\u683C\u5F0F \"url1 1920\uFF0C url2 1080, url3 767\" */\n source?: string\n /** \u56FE\u7247\u8D28\u91CF */\n quality?: number\n /** \u54CD\u5E94\u5F0F\u56FE\u7247\uFF0C\u5BF9\u5E94picture \u4E0Bsource \u7684max-width */\n deviceSizes?: number[]\n}\nconst images = {\n domains: ['cdn.shopify.com', 'cdn.shopifycdn.net', 'www.facebook.com'],\n deviceSizes: [375, 768, 1024, 1280, 1440, 1540, 1920],\n}\n\nconst isMatchDomain = (srcDomain: string) => {\n return APPEND_FILE_SUFFIX_MATCH_DOMAIN.some(domain => srcDomain == domain)\n}\nconst idMatchFileExtensions = (fileName: string = '') => /\\.(png|apng|jpg|jpeg|gif|svg|webp|tif)/.test(fileName)\n\nconst Picture = React.forwardRef<HTMLPictureElement, PictureProps>(\n (\n {\n imgClassName = '',\n source = '',\n quality = 2,\n deviceSizes = [375, 767, 1023, 1024, 1279, 1440, 1439, 1539, 1919, 1920],\n className,\n loading = 'lazy',\n alt = '',\n ...rest\n }: PictureProps,\n ref\n ) => {\n const isShopifycdn = (src: string | string[]) => {\n const domains = images?.domains || []\n return domains.some(domain => src.includes(domain))\n }\n\n const imgSrcSetsize = useCallback(({ src, width }: { src: string; width: number }) => {\n const size = width\n try {\n const parsedUrl = new URL(src)\n if (!isMatchDomain(parsedUrl.hostname)) {\n return src\n }\n const fileName = parsedUrl.pathname.split('/').pop() || ''\n if (idMatchFileExtensions(fileName)) {\n return src\n ?.split('/')\n ?.map(item => {\n if (\n isShopifycdn(src) &&\n /\\.(png|apng|jpg|jpeg|gif|svg|webp|tif)(\\?.*)?/.test(item) &&\n /_[0-9]{2,4}x/.test(src) === false\n ) {\n const name = item.split('.')\n return name\n .map((v, i) => {\n if (i === name.length - 2) {\n return `${v}_${size < 3960 ? size : 3980}x`\n }\n return v\n })\n .join('.')\n }\n return item\n })\n .join('/')\n }\n } catch (error) {\n return src\n }\n }, [])\n\n const sourceSrcSet = useCallback(\n ({ srcArr, width }: { srcArr: string[][]; width: number }) => {\n const computedWidth = width * quality\n const def = imgSrcSetsize({ src: srcArr[0][0], width: computedWidth })\n let result\n srcArr.forEach(ele => {\n var img = ele[0]\n if (ele.length > 1 && parseInt(ele[1], 10) >= width) {\n result = imgSrcSetsize({ src: img, width: computedWidth })\n }\n })\n const srcset = result || def\n return <source key={width} srcSet={srcset} media={`(max-width: ${width}px)`} />\n },\n [imgSrcSetsize, quality]\n )\n\n const sourceList = useMemo(() => {\n if (typeof source !== 'string' || !source) return []\n let srcArr\n try {\n srcArr = source\n .replace(/[\\r\\n]/g, '')\n .replace(/\\s\\s+/g, ' ')\n .split(',')\n .map(item => item.split(' ').filter(Boolean))\n } catch (error) {\n console.log(error)\n return []\n }\n const sourceList = deviceSizes.map(width => {\n return sourceSrcSet({ srcArr, width })\n })\n\n const img = imgSrcSetsize({ src: srcArr[0][0], width: 1920 * quality })\n\n sourceList.push(\n <img key=\"default\" src={img} className={`w-full ${imgClassName}`} loading={loading} alt={alt ?? ''} {...rest} />\n )\n return sourceList\n }, [deviceSizes, imgClassName, imgSrcSetsize, quality, source, sourceSrcSet])\n\n return (\n <picture ref={ref} className={`block overflow-hidden ${className}`}>\n {sourceList}\n {rest.children}\n </picture>\n )\n }\n)\nexport default Picture\n"],
5
+ "mappings": "aA+Fe,cAAAA,EA+BT,QAAAC,MA/BS,oBA9Ff,OAAOC,GAAS,eAAAC,EAAa,WAAAC,MAAe,QAE5C,MAAMC,EAAkC,CAAC,kBAAmB,qBAAsB,kBAAkB,EAE9FC,EAAW,KACXC,EAAiB,KAYjBC,EAAS,CACb,QAAS,CAAC,kBAAmB,qBAAs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AAC,EAE5E,OACEjC,EAAC,WAAQ,IAAKsB,EAAK,UAAW,yBAAyBJ,CAAS,GAC7D,UAAAsB,EACAnB,EAAK,UACR,CAEJ,CACF,EACA,IAAOqB,EAAQ7B",
6
+ "names": ["jsx", "jsxs", "React", "useCallback", "useMemo", "APPEND_FILE_SUFFIX_MATCH_DOMAIN", "MAX_SIZE", "FIXED_MAX_SIZE", "images", "isMatchDomain", "srcDomain", "domain", "idMatchFileExtensions", "fileName", "Picture", "imgClassName", "source", "quality", "deviceSizes", "className", "loading", "alt", "rest", "ref", "isShopifycdn", "src", "imgSrcSetsize", "width", "size", "parsedUrl", "item", "name", "v", "i", "sourceSrcSet", "srcArr", "computedWidth", "def", "result", "ele", "img", "sourceList", "error", "picture_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{useRef as f,useEffect as m}from"react";const w=(n,{callback:c,once:i,threshold:u=.8,delay:t=0})=>{const e=f(0),r=f(!1);m(()=>{if(!n?.current||typeof IntersectionObserver>"u")return;const s=n.current,d={root:null,rootMargin:"0px",threshold:u},o=new IntersectionObserver(l=>{l.forEach(b=>{if(b.isIntersecting){if(t){if(window.clearTimeout(e.current),r.current)return;e.current=window.setTimeout(()=>{c(),r.current=!0},t)}else c(),r.current=!0;i&&r.current&&o.disconnect()}else e.current&&window.clearTimeout(e.current)})},d);return s&&o.observe(s),()=>{o.disconnect(),window.clearTimeout(e.current)}},[i,u,t,n?.current])};export{w as useIntersectionObserverDelay};
1
+ import{useRef as f,useEffect as d}from"react";const o=new WeakMap,p=500,v=e=>{const t=Date.now(),c=o.get(e);if(c&&t-c.timestamp<p)return c.visible;const n=e;if(!n)return o.set(e,{visible:!1,timestamp:t}),!1;if(!document.contains(n))return o.set(e,{visible:!1,timestamp:t}),!1;const s=n.getBoundingClientRect();if(s.width===0||s.height===0)return o.set(e,{visible:!1,timestamp:t}),!1;const i=n.style;if(i.display==="none"||i.visibility==="hidden"||i.opacity==="0")return o.set(e,{visible:!1,timestamp:t}),!1;if(s.width>0&&s.height>0){const u=window.getComputedStyle(n);if(u.display==="none"||u.visibility==="hidden"||u.opacity==="0")return o.set(e,{visible:!1,timestamp:t}),!1}const r=!0;return o.set(e,{visible:r,timestamp:t}),r},y=(e,{callback:t,once:c,threshold:n=.8,delay:s=0})=>{const i=f(0),r=f(!1);d(()=>{if(!e?.current||typeof IntersectionObserver>"u")return;const u=e.current,m={root:null,rootMargin:"0px",threshold:n},l=new IntersectionObserver(b=>{b.forEach(a=>{if(a.isIntersecting&&v(a.target)){if(s){if(window.clearTimeout(i.current),r.current)return;i.current=window.setTimeout(()=>{t(),r.current=!0},s)}else t(),r.current=!0;c&&r.current&&l.disconnect()}else i.current&&window.clearTimeout(i.current)})},m);return u&&l.observe(u),()=>{l.disconnect(),window.clearTimeout(i.current)}},[c,n,s,e?.current])};export{y as useIntersectionObserverDelay};
2
2
  //# sourceMappingURL=useIntersectionObserver.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/hooks/useIntersectionObserver.ts"],
4
- "sourcesContent": ["import { type RefObject, useRef, useEffect } from 'react'\n\ntype DelayOptions = {\n callback: () => void\n once?: boolean\n threshold?: number\n delay?: number\n}\n/**\n * \u53EA\u6709\u63D0\u7559\u8D85\u8FC7delay\u8BBE\u7F6E\u7684\u65F6\u95F4\u624D\u4F1A\u89E6\u53D1callback\n * @param targetRef\n * @param callback\n * @param once\n * @param threshold\n * @param delay\n */\nexport const useIntersectionObserverDelay = (\n targetRef: RefObject<any> | undefined,\n { callback, once, threshold = 0.8, delay = 0 }: DelayOptions\n) => {\n const timeoutRef = useRef<number>(0)\n const triggeredRef = useRef(false)\n\n useEffect(() => {\n if (!targetRef?.current) {\n return\n }\n\n if (typeof IntersectionObserver === 'undefined') {\n return\n }\n\n const current = targetRef.current\n const options = {\n root: null,\n rootMargin: '0px',\n threshold: threshold,\n }\n const observer = new IntersectionObserver(entries => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n if (delay) {\n window.clearTimeout(timeoutRef.current)\n if (triggeredRef.current) return\n timeoutRef.current = window.setTimeout(() => {\n callback()\n triggeredRef.current = true\n }, delay)\n } else {\n callback()\n triggeredRef.current = true\n }\n\n if (once && triggeredRef.current) {\n observer.disconnect()\n }\n } else {\n if (timeoutRef.current) {\n window.clearTimeout(timeoutRef.current)\n }\n }\n })\n }, options)\n if (current) {\n observer.observe(current)\n }\n return () => {\n observer.disconnect()\n window.clearTimeout(timeoutRef.current)\n }\n }, [once, threshold, delay, targetRef?.current])\n}\n"],
5
- "mappings": "AAAA,OAAyB,UAAAA,EAAQ,aAAAC,MAAiB,QAgB3C,MAAMC,EAA+B,CAC1CC,EACA,CAAE,SAAAC,EAAU,KAAAC,EAAM,UAAAC,EAAY,GAAK,MAAAC,EAAQ,CAAE,IAC1C,CACH,MAAMC,EAAaR,EAAe,CAAC,EAC7BS,EAAeT,EAAO,EAAK,EAEjCC,EAAU,IAAM,CAKd,GAJI,CAACE,GAAW,SAIZ,OAAO,qBAAyB,IAClC,OAGF,MAAMO,EAAUP,EAAU,QACpBQ,EAAU,CACd,KAAM,KACN,WAAY,MACZ,UAAWL,CACb,EACMM,EAAW,IAAI,qBAAqBC,GAAW,CACnDA,EAAQ,QAAQC,GAAS,CACvB,GAAIA,EAAM,eAAgB,CACxB,GAAIP,EAAO,CAET,GADA,OAAO,aAAaC,EAAW,OAAO,EAClCC,EAAa,QAAS,OAC1BD,EAAW,QAAU,OAAO,WAAW,IAAM,CAC3CJ,EAAS,EACTK,EAAa,QAAU,EACzB,EAAGF,CAAK,CACV,MACEH,EAAS,EACTK,EAAa,QAAU,GAGrBJ,GAAQI,EAAa,SACvBG,EAAS,WAAW,CAExB,MACMJ,EAAW,SACb,OAAO,aAAaA,EAAW,OAAO,CAG5C,CAAC,CACH,EAAGG,CAAO,EACV,OAAID,GACFE,EAAS,QAAQF,CAAO,EAEnB,IAAM,CACXE,EAAS,WAAW,EACpB,OAAO,aAAaJ,EAAW,OAAO,CACxC,CACF,EAAG,CAACH,EAAMC,EAAWC,EAAOJ,GAAW,OAAO,CAAC,CACjD",
6
- "names": ["useRef", "useEffect", "useIntersectionObserverDelay", "targetRef", "callback", "once", "threshold", "delay", "timeoutRef", "triggeredRef", "current", "options", "observer", "entries", "entry"]
4
+ "sourcesContent": ["import { type RefObject, useRef, useEffect } from 'react'\n\ntype DelayOptions = {\n callback: () => void\n once?: boolean\n threshold?: number\n delay?: number\n}\n\n// \u7F13\u5B58\u53EF\u89C1\u6027\u68C0\u67E5\u7ED3\u679C\uFF0C\u907F\u514D\u91CD\u590D\u8BA1\u7B97\nconst visibilityCache = new WeakMap<Element, { visible: boolean; timestamp: number }>()\nconst CACHE_DURATION = 500 // \u7F13\u5B58500ms\uFF0C\u5E73\u8861\u6027\u80FD\u548C\u51C6\u786E\u6027\n\n/**\n * \u68C0\u67E5\u5143\u7D20\u662F\u5426\u771F\u6B63\u53EF\u89C1\uFF08\u4F18\u5316\u7248\u672C\uFF0C\u5E26\u7F13\u5B58\uFF09\n * @param element \u8981\u68C0\u67E5\u7684\u5143\u7D20\n * @returns \u5143\u7D20\u662F\u5426\u53EF\u89C1\n */\nconst isElementVisible = (element: Element): boolean => {\n const now = Date.now()\n \n // \u68C0\u67E5\u7F13\u5B58\n const cached = visibilityCache.get(element)\n if (cached && (now - cached.timestamp) < CACHE_DURATION) {\n return cached.visible\n }\n \n const el = element as HTMLElement\n \n // \u5FEB\u901F\u68C0\u67E5\uFF1A\u5143\u7D20\u662F\u5426\u5B58\u5728\n if (!el) {\n visibilityCache.set(element, { visible: false, timestamp: now })\n return false\n }\n \n // \u5FEB\u901F\u68C0\u67E5\uFF1A\u5143\u7D20\u662F\u5426\u5728DOM\u4E2D\n if (!document.contains(el)) {\n visibilityCache.set(element, { visible: false, timestamp: now })\n return false\n }\n \n // \u4F7F\u7528 getBoundingClientRect \u8FDB\u884C\u5FEB\u901F\u68C0\u67E5\uFF08\u6BD4 getComputedStyle \u66F4\u5FEB\uFF09\n const rect = el.getBoundingClientRect()\n \n // \u5982\u679C\u5143\u7D20\u6CA1\u6709\u5C3A\u5BF8\uFF0C\u76F4\u63A5\u8FD4\u56DE false\uFF08\u8FD9\u6BD4\u68C0\u67E5 CSS \u6837\u5F0F\u66F4\u5FEB\uFF09\n if (rect.width === 0 || rect.height === 0) {\n visibilityCache.set(element, { visible: false, timestamp: now })\n return false\n }\n \n // \u53EA\u6709\u5728\u5FC5\u8981\u65F6\u624D\u68C0\u67E5 CSS \u6837\u5F0F\uFF08\u5EF6\u8FDF\u68C0\u67E5\uFF09\n // \u5148\u68C0\u67E5\u6700\u5E38\u89C1\u7684\u9690\u85CF\u60C5\u51B5\n const style = el.style\n if (style.display === 'none' || style.visibility === 'hidden' || style.opacity === '0') {\n visibilityCache.set(element, { visible: false, timestamp: now })\n return false\n }\n \n // \u5982\u679C\u5185\u8054\u6837\u5F0F\u6CA1\u6709\u9690\u85CF\uFF0C\u518D\u68C0\u67E5\u8BA1\u7B97\u6837\u5F0F\uFF08\u66F4\u6602\u8D35\u7684\u64CD\u4F5C\uFF09\n // \u4F46\u53EA\u5728\u5143\u7D20\u786E\u5B9E\u6709\u5C3A\u5BF8\u4E14\u5728\u89C6\u53E3\u5185\u65F6\u624D\u68C0\u67E5\n if (rect.width > 0 && rect.height > 0) {\n const computedStyle = window.getComputedStyle(el)\n if (computedStyle.display === 'none' || \n computedStyle.visibility === 'hidden' || \n computedStyle.opacity === '0') {\n visibilityCache.set(element, { visible: false, timestamp: now })\n return false\n }\n }\n \n const visible = true\n visibilityCache.set(element, { visible, timestamp: now })\n return visible\n}\n/**\n * \u53EA\u6709\u63D0\u7559\u8D85\u8FC7delay\u8BBE\u7F6E\u7684\u65F6\u95F4\u624D\u4F1A\u89E6\u53D1callback\n * @param targetRef\n * @param callback\n * @param once\n * @param threshold\n * @param delay\n */\nexport const useIntersectionObserverDelay = (\n targetRef: RefObject<any> | undefined,\n { callback, once, threshold = 0.8, delay = 0 }: DelayOptions\n) => {\n const timeoutRef = useRef<number>(0)\n const triggeredRef = useRef(false)\n\n useEffect(() => {\n if (!targetRef?.current) {\n return\n }\n\n if (typeof IntersectionObserver === 'undefined') {\n return\n }\n\n const current = targetRef.current\n const options = {\n root: null,\n rootMargin: '0px',\n threshold: threshold,\n }\n const observer = new IntersectionObserver(entries => {\n entries.forEach(entry => {\n if (entry.isIntersecting && isElementVisible(entry.target)) {\n if (delay) {\n window.clearTimeout(timeoutRef.current)\n if (triggeredRef.current) return\n timeoutRef.current = window.setTimeout(() => {\n callback()\n triggeredRef.current = true\n }, delay)\n } else {\n callback()\n triggeredRef.current = true\n }\n\n if (once && triggeredRef.current) {\n observer.disconnect()\n }\n } else {\n if (timeoutRef.current) {\n window.clearTimeout(timeoutRef.current)\n }\n }\n })\n }, options)\n if (current) {\n observer.observe(current)\n }\n return () => {\n observer.disconnect()\n window.clearTimeout(timeoutRef.current)\n }\n }, [once, threshold, delay, targetRef?.current])\n}\n"],
5
+ "mappings": "AAAA,OAAyB,UAAAA,EAAQ,aAAAC,MAAiB,QAUlD,MAAMC,EAAkB,IAAI,QACtBC,EAAiB,IAOjBC,EAAoBC,GAA8B,CACtD,MAAMC,EAAM,KAAK,IAAI,EAGfC,EAASL,EAAgB,IAAIG,CAAO,EAC1C,GAAIE,GAAWD,EAAMC,EAAO,UAAaJ,EACvC,OAAOI,EAAO,QAGhB,MAAMC,EAAKH,EAGX,GAAI,CAACG,EACH,OAAAN,EAAgB,IAAIG,EAAS,CAAE,QAAS,GAAO,UAAWC,CAAI,CAAC,EACxD,GAIT,GAAI,CAAC,SAAS,SAASE,CAAE,EACvB,OAAAN,EAAgB,IAAIG,EAAS,CAAE,QAAS,GAAO,UAAWC,CAAI,CAAC,EACxD,GAIT,MAAMG,EAAOD,EAAG,sBAAsB,EAGtC,GAAIC,EAAK,QAAU,GAAKA,EAAK,SAAW,EACtC,OAAAP,EAAgB,IAAIG,EAAS,CAAE,QAAS,GAAO,UAAWC,CAAI,CAAC,EACxD,GAK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W,OAAO,CAG5C,CAAC,CACH,EAAGG,CAAO,EACV,OAAID,GACFE,EAAS,QAAQF,CAAO,EAEnB,IAAM,CACXE,EAAS,WAAW,EACpB,OAAO,aAAaJ,EAAW,OAAO,CACxC,CACF,EAAG,CAACH,EAAMC,EAAWC,EAAOJ,GAAW,OAAO,CAAC,CACjD",
6
+ "names": ["useRef", "useEffect", "visibilityCache", "CACHE_DURATION", "isElementVisible", "element", "now", "cached", "el", "rect", "style", "computedStyle", "visible", "useIntersectionObserverDelay", "targetRef", "callback", "once", "threshold", "delay", "timeoutRef", "triggeredRef", "current", "options", "observer", "entries", "entry"]
7
7
  }