@anker-in/headless-ui 1.3.72 → 1.3.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";"use client";var be=Object.create;var N=Object.defineProperty;var fe=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var pe=Object.getPrototypeOf,ve=Object.prototype.hasOwnProperty;var Se=(e,a)=>{for(var o in a)N(e,o,{get:a[o],enumerable:!0})},$=(e,a,o,d)=>{if(a&&typeof a=="object"||typeof a=="function")for(let c of ye(a))!ve.call(e,c)&&c!==o&&N(e,c,{get:()=>a[c],enumerable:!(d=fe(a,c))||d.enumerable});return e};var Ce=(e,a,o)=>(o=e!=null?be(pe(e)):{},$(a||!e||!e.__esModule?N(o,"default",{value:e,enumerable:!0}):o,e)),he=e=>$(N({},"__esModule",{value:!0}),e);var Ae={};Se(Ae,{ProductCard:()=>B,default:()=>Ne});module.exports=he(Ae);var t=require("react/jsx-runtime"),A=Ce(require("react")),n=require("../../helpers/index.js"),i=require("../../components/index.js"),G=require("./MemberLabel.js"),z=require("./styles.js");const xe=5;function Te(e,a,o,d){if(e===void 0)return!0;switch(e){case"always":return!0;case"never":return!1;case"below-quantity":return a===void 0?!0:o<=a;case"below-percentage":return a===void 0?!0:o/d*100<=a;default:return!0}}const ke=({items:e})=>e?.length?(0,t.jsx)("div",{className:"active-shelf-display-social-endorsements desktop:gap-2 laptop:flex absolute right-0 top-0 z-10 hidden flex-col items-center gap-1",children:e.slice(0,3).map((a,o)=>typeof a.icon=="string"?(0,t.jsx)("img",{src:a.icon,alt:a.label||"",loading:"lazy",className:"desktop:size-10 lg-desktop:size-12 size-8 object-contain"},o):(0,t.jsx)(i.Text,{"aria-label":a.label,className:"desktop:size-10 lg-desktop:size-12 size-8 [&_img]:size-full [&_svg]:size-full",children:a.icon},o))}):null,U={style1:{bg:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/2_7746fc9c-d4e4-4a59-a972-fa4cb0f3f8bd.png?v=1789381635",textClass:"aiui-dark text-info-primary"},style2:{bg:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_e0438358-493b-40cb-9a58-89d6ee2d3751.png?v=1789381628",textClass:"aiui-dark text-info-primary"},style3:{bg:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_19208ba4-71ea-4580-892d-72167f1cf606.png?v=1789381639",textClass:"aiui-dark text-info-primary"}},Pe=({text:e,style:a="style1",icon:o,className:d,textClassName:c,layoutMode:h="flex",renderBadge:v})=>{if(!e)return null;const b=a==="custom",s=b&&!!v,S=b&&!v&&!!o?.url,C=b?void 0:U[a],f=U.style1,u=z.layoutModeStyles[h],x={style1:u.discountBadgeText,style2:u.discountBadgeTextStyle2,style3:u.discountBadgeTextStyle3},T=b?u.discountBadgeTextCenter:x[a];return(0,t.jsxs)("div",{className:(0,n.cn)("active-shelf-discount-badge","absolute left-0 top-0 z-10",u.discountBadgeSize,d),children:[s?v({text:e,layoutMode:h}):S?(0,t.jsx)(i.Picture,{source:o.url,alt:o.alt||e,className:"block size-full",imgClassName:"block size-full object-contain"}):(0,t.jsx)("img",{src:(C??f).bg,alt:e,loading:"lazy",className:"block size-full object-contain"}),!s&&(0,t.jsx)(i.Text,{className:(0,n.cn)("active-shelf-discount-badge-text text-center","absolute inset-0 font-bold !leading-[1.2]",T,(C??f).textClass,c),html:e})]})},B=A.forwardRef(({product:e,className:a,showTags:o=!0,stockDisplayMode:d,stockThresholdValue:c,onLearnMore:h,onShopNow:v,onAddToCart:b,classNames:s,secondaryButtonText:S,secondaryButtonFun:C,primaryButtonText:f,primaryButtonFun:u,showOriginalPrice:x,renderOriginalPrice:T,copy:y,onProductImageClick:k,tagTypeConfig:_,fill:M,outline:w,memberPriceTextColor:R,userType:P,memberImages:H,customTagsIcon:K,customTagStyle:J,onMemberSignUp:Q,onPlusMemberAddCart:W,showMemberPrice:I,layoutMode:L,renderDiscountBadge:X},Y)=>{const[Z,ee]=A.useState(!1),[te,ae]=A.useState(!1),ie=e?.memberDiscountAmount,ne=e?.plusMemberDiscountAmount,oe=e?.activityLabels??[],se=P==="guest"?"guest":"member",E=oe.find(l=>l.type===se)?.label,re=P==="guest"?y?.memberActivityLabelUnLogin:y?.memberActivityLabel,le=!!E||!!re,ce=e?.discountAmount,r=z.layoutModeStyles[L??"flex"],de=A.useMemo(()=>e?.availableForSale&&e?.quantityAvailable<=0?xe:e?.availableForSale?(e?.quantityAvailable??0)/(e?.totalInventory??1)*100:0,[e?.availableForSale,e?.quantityAvailable,e?.totalInventory]),F=async(l,g)=>{if(!l)return;const m=g==="primary"?ee:ae;m(!0);try{switch(l){case"buyNow":await v?.(e);break;case"addCart":await b?.(e);break;case"learnMore":await h?.(e);break;default:break}}finally{m(!1)}},ue=e.availableForSale&&e.quantityAvailable<=0,ge=(l,g)=>{const m=l===0?_?.firstTagVariant:l===1?_?.secondTagVariant:void 0,D=(m||void 0)??(g==="fill"?"fill":g!==void 0?"outline":l===0?"fill":"outline"),p=D==="fill"?{outline:M?.outlineColor,bg:M?.bgColor}:{outline:w?.outlineColor,bg:w?.bgColor},O={...p.outline?{outlineColor:p.outline}:{},...p.bg?{backgroundColor:p.bg,backgroundImage:"none"}:{}};return D==="outline"&&p.outline&&(O.color=p.outline),{variant:D,style:O}},j=!!e.custom_bg_image,me=!!e.custom_scene_image,q=l=>l?{backgroundImage:`url(${l})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}:void 0;return(0,t.jsxs)(i.Card,{ref:Y,className:(0,n.cn)("hover:bg-container-secondary-0 bg-container-primary relative flex h-full cursor-pointer flex-col overflow-hidden border-none",r.cardRadius,a,s?.productCard),children:[(0,t.jsx)(Pe,{text:ce,style:J,icon:K,layoutMode:L,renderBadge:X,className:s?.discountBadge,textClassName:s?.discountBadgeText}),(0,t.jsxs)(i.CardContent,{className:(0,n.cn)(r.cardContent,"relative flex flex-1 flex-col justify-between"),children:[(0,t.jsxs)("div",{className:"product-image-wrapper group/product-image relative mb-4",children:[j&&(0,t.jsx)("div",{"aria-hidden":!0,className:(0,n.cn)("pointer-events-none absolute inset-0 z-20",r.imageOffset),style:q(e.custom_bg_image)}),me&&(0,t.jsx)("div",{"aria-hidden":!0,className:(0,n.cn)("laptop:block laptop:group-hover/product-image:opacity-100 pointer-events-none absolute inset-0 z-20 hidden opacity-0 transition-opacity duration-300",r.imageOffset),style:q(e.custom_scene_image)}),(0,t.jsx)("div",{className:(0,n.cn)("product-image mx-auto cursor-pointer overflow-hidden",r.image),children:(0,t.jsx)("a",{onClick:()=>k?.(e),...!k&&{href:e?.listingLink},rel:"noreferrer",className:(0,n.cn)("block size-full",j&&"opacity-0"),children:(0,t.jsx)(i.Picture,{source:e.image,alt:e.name,className:"aspect-square size-full object-contain",imgClassName:"size-full object-contain"})})}),(0,t.jsx)(ke,{items:e?.socialEndorsements})]}),o&&(0,t.jsx)("div",{className:"desktop:mb-2 mb-1 flex h-[24px] gap-1",children:e.tags?.map((l,g)=>{if(!l.label)return null;const{variant:m,style:V}=ge(g,l.variant);return(0,t.jsx)(i.Badge,{size:"sm",variant:m,className:"active-shelf-items-tag py-0",style:V,children:l.label},g)})}),(0,t.jsxs)("div",{className:"flex h-full flex-1 grow flex-col justify-between gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(i.Heading,{as:"h3",size:"none",className:(0,n.cn)("text-info-primary",r.title,s?.productTitle),children:(0,t.jsx)("a",{onClick:()=>k?.(e),...!k&&{href:e?.listingLink},rel:"noreferrer",className:"hover:text-brand-0 cursor-pointer ",children:e.custom_name||e.name})}),e?.description&&(0,t.jsx)(i.Text,{size:"none",className:(0,n.cn)("active-shelf-product-description text-info-primary",r.description,s?.productDescription),html:e.custom_description||e.description})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:(0,n.cn)(s?.productPrice),children:(0,t.jsx)("div",{className:(0,n.cn)("flex items-baseline",r.priceGap),children:e.availableForSale?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Heading,{size:"none",className:(0,n.cn)("text-info-primary",r.price),as:"h6",children:e.price}),T?T(e,{showOriginalPrice:x}):x&&e.originalPrice&&(0,t.jsx)(i.Heading,{size:"none",className:(0,n.cn)("text-info-tertiary line-through",r.price,s?.originalPrice),as:"h6",children:e.originalPrice})]}):(0,t.jsx)(i.Heading,{size:"none",className:(0,n.cn)("text-info-tertiary",r.price),children:y?.outOfStockLabel??"Sold Out"})})}),I&&e?.priceLabel&&e?.availableForSale&&(0,t.jsx)("div",{className:(0,n.cn)("min-h-[1lh]",r.priceLabel),children:(0,t.jsx)(i.Text,{size:"none",className:(0,n.cn)("text-brand-0",s?.productPriceLabel),style:{...R?{color:R}:{}},children:e.priceLabel})}),(0,t.jsxs)("div",{className:(0,n.cn)("mt-2 flex",r.buttonContainer,s?.buttonGroup),children:[S&&(0,t.jsx)(i.Button,{variant:"secondary",size:"lg",className:(0,n.cn)(r.buttonItem,s?.secondaryButton),onClick:()=>F(C,"secondary"),disabled:!e.availableForSale&&C!=="learnMore",loading:te,"data-headless-type-name":"ActiveShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${S}`,"data-headless-sku":e.sku,children:S}),f&&(0,t.jsx)(i.Button,{variant:"primary",size:"lg",className:(0,n.cn)(r.buttonItem,s?.primaryButton),onClick:()=>F(u,"primary"),disabled:!e.availableForSale&&u!=="learnMore",loading:Z,"data-headless-type-name":"ActiveShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${f}`,"data-headless-sku":e.sku,children:f})]}),Te(d,c,e?.quantityAvailable??0,e?.totalInventory??0)&&(0,t.jsxs)("div",{className:"mt-4 flex flex-col gap-1",children:[(0,t.jsx)(i.Progress,{value:de,max:100,min:0,size:"base",variant:"default","aria-label":"stock progress",classNames:{root:(0,n.cn)("bg-[var(--progress-track-bg,rgba(0,0,0,0.2))]",s?.stockTrack),progressBar:(0,n.cn)("bg-brand-0 transition-all duration-300 ease-in-out",s?.stockBar)}}),(0,t.jsx)(i.Text,{size:3,className:"text-info-tertiary text-[14px]",children:ue?y?.limitedStock:y?.stockDisplayText?.replace("{count}",`${e.availableForSale?e.quantityAvailable:0}`)})]})]})]})]}),I&&P&&(0,t.jsx)(G.MemberLabel,{userType:P,copy:y,images:H,onSignUp:Q,onPlusMemberAddCart:W,hasActivity:le,activityLabel:E,memberDiscountAmount:ie,plusMemberDiscountAmount:ne,layoutMode:L})]})});B.displayName="ActiveShelf.ProductCard";var Ne=B;
1
+ "use strict";"use client";var be=Object.create;var N=Object.defineProperty;var fe=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var pe=Object.getPrototypeOf,ve=Object.prototype.hasOwnProperty;var Se=(e,a)=>{for(var o in a)N(e,o,{get:a[o],enumerable:!0})},$=(e,a,o,d)=>{if(a&&typeof a=="object"||typeof a=="function")for(let c of ye(a))!ve.call(e,c)&&c!==o&&N(e,c,{get:()=>a[c],enumerable:!(d=fe(a,c))||d.enumerable});return e};var Ce=(e,a,o)=>(o=e!=null?be(pe(e)):{},$(a||!e||!e.__esModule?N(o,"default",{value:e,enumerable:!0}):o,e)),he=e=>$(N({},"__esModule",{value:!0}),e);var Ae={};Se(Ae,{ProductCard:()=>B,default:()=>Ne});module.exports=he(Ae);var t=require("react/jsx-runtime"),A=Ce(require("react")),n=require("../../helpers/index.js"),i=require("../../components/index.js"),G=require("./MemberLabel.js"),z=require("./styles.js");const xe=5;function ke(e,a,o,d){if(e===void 0)return!0;switch(e){case"always":return!0;case"never":return!1;case"below-quantity":return a===void 0?!0:o<=a;case"below-percentage":return a===void 0?!0:o/d*100<=a;default:return!0}}const Te=({items:e})=>e?.length?(0,t.jsx)("div",{className:"active-shelf-display-social-endorsements desktop:gap-2 laptop:flex absolute right-0 top-0 z-10 hidden flex-col items-center gap-1",children:e.slice(0,3).map((a,o)=>typeof a.icon=="string"?(0,t.jsx)("img",{src:a.icon,alt:a.label||"",loading:"lazy",className:"desktop:size-10 lg-desktop:size-12 size-8 object-contain"},o):(0,t.jsx)(i.Text,{"aria-label":a.label,className:"desktop:size-10 lg-desktop:size-12 size-8 [&_img]:size-full [&_svg]:size-full",children:a.icon},o))}):null,U={style1:{bg:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/2_7746fc9c-d4e4-4a59-a972-fa4cb0f3f8bd.png?v=1789381635",textClass:"aiui-dark text-info-primary"},style2:{bg:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_e0438358-493b-40cb-9a58-89d6ee2d3751.png?v=1789381628",textClass:"aiui-dark text-info-primary"},style3:{bg:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_19208ba4-71ea-4580-892d-72167f1cf606.png?v=1789381639",textClass:"aiui-dark text-info-primary"}},Pe=({text:e,style:a="style1",icon:o,className:d,textClassName:c,layoutMode:h="flex",renderBadge:v})=>{if(!e)return null;const b=a==="custom",s=b&&!!v,S=b&&!v&&!!o?.url,C=b?void 0:U[a],f=U.style1,u=z.layoutModeStyles[h],x={style1:u.discountBadgeText,style2:u.discountBadgeTextStyle2,style3:u.discountBadgeTextStyle3},k=b?u.discountBadgeTextCenter:x[a];return(0,t.jsxs)("div",{className:(0,n.cn)("active-shelf-discount-badge","absolute left-0 top-0 z-10",u.discountBadgeSize,d),children:[s?v({text:e,layoutMode:h}):S?(0,t.jsx)(i.Picture,{source:o.url,alt:o.alt||e,className:"block size-full",imgClassName:"block size-full object-contain"}):(0,t.jsx)("img",{src:(C??f).bg,alt:e,loading:"lazy",className:"block size-full object-contain"}),!s&&(0,t.jsx)(i.Text,{className:(0,n.cn)("active-shelf-discount-badge-text text-center","absolute inset-0 font-bold !leading-[1.2]",k,(C??f).textClass,c),html:e})]})},B=A.forwardRef(({product:e,className:a,showTags:o=!0,stockDisplayMode:d,stockThresholdValue:c,onLearnMore:h,onShopNow:v,onAddToCart:b,classNames:s,secondaryButtonText:S,secondaryButtonFun:C,primaryButtonText:f,primaryButtonFun:u,showOriginalPrice:x,renderOriginalPrice:k,copy:y,onProductImageClick:T,tagTypeConfig:_,fill:M,outline:w,memberPriceTextColor:R,userType:P,memberImages:H,customTagsIcon:K,customTagStyle:J,onMemberSignUp:Q,onPlusMemberAddCart:W,showMemberPrice:I,layoutMode:L,renderDiscountBadge:X},Y)=>{const[Z,ee]=A.useState(!1),[te,ae]=A.useState(!1),ie=e?.memberDiscountAmount,ne=e?.plusMemberDiscountAmount,oe=e?.activityLabels??[],se=P==="guest"?"guest":"member",E=oe.find(l=>l.type===se)?.label,re=P==="guest"?y?.memberActivityLabelUnLogin:y?.memberActivityLabel,le=!!E||!!re,ce=e?.discountAmount,r=z.layoutModeStyles[L??"flex"],de=A.useMemo(()=>e?.availableForSale&&e?.quantityAvailable<=0?xe:e?.availableForSale?(e?.quantityAvailable??0)/(e?.totalInventory??1)*100:0,[e?.availableForSale,e?.quantityAvailable,e?.totalInventory]),F=async(l,g)=>{if(!l)return;const m=g==="primary"?ee:ae;m(!0);try{switch(l){case"buyNow":await v?.(e);break;case"addCart":await b?.(e);break;case"learnMore":await h?.(e);break;default:break}}finally{m(!1)}},ue=e.availableForSale&&e.quantityAvailable<=0,ge=(l,g)=>{const m=l===0?_?.firstTagVariant:l===1?_?.secondTagVariant:void 0,D=(m||void 0)??(g==="fill"?"fill":g!==void 0?"outline":l===0?"fill":"outline"),p=D==="fill"?{outline:M?.outlineColor,bg:M?.bgColor}:{outline:w?.outlineColor,bg:w?.bgColor},O={...p.outline?{outlineColor:p.outline}:{},...p.bg?{backgroundColor:p.bg,backgroundImage:"none"}:{}};return D==="outline"&&p.outline&&(O.color=p.outline),{variant:D,style:O}},j=!!e.custom_bg_image,me=!!e.custom_scene_image,q=l=>l?{backgroundImage:`url(${l})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}:void 0;return(0,t.jsxs)(i.Card,{ref:Y,className:(0,n.cn)("hover:bg-container-secondary-0 bg-container-primary relative flex h-full cursor-pointer flex-col overflow-hidden border-none",r.cardRadius,a,s?.productCard),children:[(0,t.jsx)(Pe,{text:ce,style:J,icon:K,layoutMode:L,renderBadge:X,className:s?.discountBadge,textClassName:s?.discountBadgeText}),(0,t.jsxs)(i.CardContent,{className:(0,n.cn)(r.cardContent,"relative flex flex-1 flex-col justify-between"),children:[(0,t.jsxs)("div",{className:"product-image-wrapper group/product-image laptop:pb-2 laptop:mb-4 desktop:pb-6 desktop:mb-4 relative pb-4",children:[j&&(0,t.jsx)("div",{"aria-hidden":!0,className:(0,n.cn)("pointer-events-none absolute inset-0 z-20",r.imageOffset),style:q(e.custom_bg_image)}),me&&(0,t.jsx)("div",{"aria-hidden":!0,className:(0,n.cn)("laptop:block laptop:group-hover/product-image:opacity-100 pointer-events-none absolute inset-0 z-20 hidden opacity-0 transition-opacity duration-300",r.imageOffset),style:q(e.custom_scene_image)}),(0,t.jsx)("div",{className:(0,n.cn)("product-image mx-auto cursor-pointer overflow-hidden",r.image),children:(0,t.jsx)("a",{onClick:()=>T?.(e),...!T&&{href:e?.listingLink},rel:"noreferrer",className:(0,n.cn)("block size-full",j&&"opacity-0"),children:(0,t.jsx)(i.Picture,{source:e.image,alt:e.name,className:"aspect-square size-full object-contain",imgClassName:"size-full object-contain"})})}),(0,t.jsx)(Te,{items:e?.socialEndorsements})]}),o&&(0,t.jsx)("div",{className:"desktop:mb-2 mb-1 flex h-[24px] gap-1",children:e.tags?.map((l,g)=>{if(!l.label)return null;const{variant:m,style:V}=ge(g,l.variant);return(0,t.jsx)(i.Badge,{size:"sm",variant:m,className:"active-shelf-items-tag py-0",style:V,children:l.label},g)})}),(0,t.jsxs)("div",{className:"flex h-full flex-1 grow flex-col justify-between gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(i.Heading,{as:"h3",size:"none",className:(0,n.cn)("text-info-primary",r.title,s?.productTitle),children:(0,t.jsx)("a",{onClick:()=>T?.(e),...!T&&{href:e?.listingLink},rel:"noreferrer",className:"hover:text-brand-0 cursor-pointer ",children:e.custom_name||e.name})}),e?.description&&(0,t.jsx)(i.Text,{size:"none",className:(0,n.cn)("active-shelf-product-description text-info-primary",r.description,s?.productDescription),html:e.custom_description||e.description})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:(0,n.cn)(s?.productPrice),children:(0,t.jsx)("div",{className:(0,n.cn)("flex items-baseline",r.priceGap),children:e.availableForSale?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Heading,{size:"none",className:(0,n.cn)("text-info-primary",r.price),as:"h6",children:e.price}),k?k(e,{showOriginalPrice:x}):x&&e.originalPrice&&(0,t.jsx)(i.Heading,{size:"none",className:(0,n.cn)("text-info-tertiary line-through",r.price,s?.originalPrice),as:"h6",children:e.originalPrice})]}):(0,t.jsx)(i.Heading,{size:"none",className:(0,n.cn)("text-info-tertiary",r.price),children:y?.outOfStockLabel??"Sold Out"})})}),I&&e?.priceLabel&&e?.availableForSale&&(0,t.jsx)("div",{className:(0,n.cn)("min-h-[1lh]",r.priceLabel),children:(0,t.jsx)(i.Text,{size:"none",className:(0,n.cn)("text-brand-0",s?.productPriceLabel),style:{...R?{color:R}:{}},children:e.priceLabel})}),(0,t.jsxs)("div",{className:(0,n.cn)("mt-2 flex",r.buttonContainer,s?.buttonGroup),children:[S&&(0,t.jsx)(i.Button,{variant:"secondary",size:"lg",className:(0,n.cn)(r.buttonItem,s?.secondaryButton),onClick:()=>F(C,"secondary"),disabled:!e.availableForSale&&C!=="learnMore",loading:te,"data-headless-type-name":"ActiveShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${S}`,"data-headless-sku":e.sku,children:S}),f&&(0,t.jsx)(i.Button,{variant:"primary",size:"lg",className:(0,n.cn)(r.buttonItem,s?.primaryButton),onClick:()=>F(u,"primary"),disabled:!e.availableForSale&&u!=="learnMore",loading:Z,"data-headless-type-name":"ActiveShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${f}`,"data-headless-sku":e.sku,children:f})]}),ke(d,c,e?.quantityAvailable??0,e?.totalInventory??0)&&(0,t.jsxs)("div",{className:"mt-4 flex flex-col gap-1",children:[(0,t.jsx)(i.Progress,{value:de,max:100,min:0,size:"base",variant:"default","aria-label":"stock progress",classNames:{root:(0,n.cn)("bg-[var(--progress-track-bg,rgba(0,0,0,0.2))]",s?.stockTrack),progressBar:(0,n.cn)("bg-brand-0 transition-all duration-300 ease-in-out",s?.stockBar)}}),(0,t.jsx)(i.Text,{size:3,className:"text-info-tertiary text-[14px]",children:ue?y?.limitedStock:y?.stockDisplayText?.replace("{count}",`${e.availableForSale?e.quantityAvailable:0}`)})]})]})]})]}),I&&P&&(0,t.jsx)(G.MemberLabel,{userType:P,copy:y,images:H,onSignUp:Q,onPlusMemberAddCart:W,hasActivity:le,activityLabel:E,memberDiscountAmount:ie,plusMemberDiscountAmount:ne,layoutMode:L})]})});B.displayName="ActiveShelf.ProductCard";var Ne=B;
@@ -1 +1 @@
1
- "use strict";var l=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var i=(e,t)=>{for(var o in t)l(e,o,{get:t[o],enumerable:!0})},n=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of s(t))!d.call(e,p)&&p!==o&&l(e,p,{get:()=>t[p],enumerable:!(a=x(t,p))||a.enumerable});return e};var g=e=>n(l({},"__esModule",{value:!0}),e);var c={};i(c,{layoutModeStyles:()=>r});module.exports=g(c);const r={flex:{cardContent:"px-2 pb-4 pt-6 laptop:px-4 desktop:p-6",image:"size-[125px] laptop:size-[180px] lg-desktop:size-[240px]",imageOffset:"-top-6 -left-2 -right-2 laptop:-left-4 laptop:-right-4 desktop:-left-6 desktop:-right-6",title:"text-[14px] leading-tight laptop:mb-1 laptop:text-[20px] lg-desktop:text-[24px] line-clamp-3 laptop:line-clamp-2",description:"hidden text-[14px] desktop:text-[16px] lg-desktop:text-[18px] laptop:block laptop:line-clamp-2 leading-normal",price:"text-[14px] leading-tight laptop:text-[20px] lg-desktop:text-[24px]",priceLabel:"text-[12px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px]",cardRadius:"rounded-box-small tablet:rounded-box",priceGap:"gap-[2px] laptop:gap-1",discountBadgeSize:"size-12 laptop:size-20 lg-desktop:size-24",discountBadgeText:"text-xs laptop:text-base lg-desktop:text-xl pl-2 pt-1 laptop:pl-4 laptop:pt-2",discountBadgeTextStyle2:"text-xs laptop:text-base lg-desktop:text-xl pt-2 desktop:pt-4",discountBadgeTextStyle3:"text-xs laptop:text-base lg-desktop:text-xl flex items-center pl-1 laptop:pl-2",discountBadgeTextCenter:"text-xs laptop:text-base lg-desktop:text-xl flex items-center justify-center",buttonContainer:"flex-wrap gap-2 laptop:flex-nowrap lg-desktop:gap-3",buttonItem:"w-full whitespace-nowrap laptop:w-fit laptop:min-w-0 laptop:whitespace-normal laptop:text-center",memberLabelContainer:"p-2 laptop:px-4 laptop:py-3 desktop:pl-6 desktop:py-4 desktop:pr-12 lg-desktop:pr-16",memberLabelText:"text-xs laptop:text-sm desktop:text-base lg-desktop:text-[18px]"},horizontal:{cardContent:"p-4 desktop:p-6",image:"size-[180px] lg-desktop:size-[240px]",imageOffset:"-top-4 -left-4 -right-4 desktop:-top-6 desktop:-left-6 desktop:-right-6",title:"mb-1 text-[20px] leading-[120%] lg-desktop:text-[24px] line-clamp-2",description:"text-[14px] desktop:text-[16px] lg-desktop:text-[18px] line-clamp-2 leading-normal",price:"text-[20px] leading-[120%] lg-desktop:text-[24px]",priceLabel:"text-[14px] leading-[140%] desktop:text-[16px] lg-desktop:text-[18px]",cardRadius:"rounded-box",priceGap:"gap-1",discountBadgeSize:"size-20 lg-desktop:size-24",discountBadgeText:"text-base lg-desktop:text-xl pt-2 pl-4",discountBadgeTextStyle2:"text-base lg-desktop:text-xl pt-2 desktop:pt-4",discountBadgeTextStyle3:"text-base lg-desktop:text-xl flex items-center pl-1 laptop:pl-2",discountBadgeTextCenter:"text-base lg-desktop:text-xl flex items-center justify-center",buttonContainer:"gap-2 lg-desktop:gap-3",buttonItem:"w-full whitespace-nowrap tablet:w-fit tablet:min-w-0 tablet:whitespace-normal tablet:text-center",memberLabelContainer:"px-4 py-3 desktop:pl-6 desktop:py-4 desktop:pr-12 lg-desktop:pr-16",memberLabelText:"text-xs laptop:text-sm desktop:text-base lg-desktop:text-[18px]"}};
1
+ "use strict";var l=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var i=(e,t)=>{for(var o in t)l(e,o,{get:t[o],enumerable:!0})},n=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of s(t))!d.call(e,p)&&p!==o&&l(e,p,{get:()=>t[p],enumerable:!(a=x(t,p))||a.enumerable});return e};var g=e=>n(l({},"__esModule",{value:!0}),e);var c={};i(c,{layoutModeStyles:()=>r});module.exports=g(c);const r={flex:{cardContent:"px-2 pb-4 pt-6 laptop:px-4 desktop:p-6 laptop:pt-6 desktop:pt-8 lg-desktop:pt-10",image:"size-[125px] laptop:size-[180px] lg-desktop:size-[240px]",imageOffset:"laptop:-top-6 desktop:-top-8 lg-desktop:-top-10 -left-2 -right-2 laptop:-left-4 laptop:-right-4 desktop:-left-6 desktop:-right-6",title:"text-[14px] leading-tight laptop:mb-1 laptop:text-[20px] lg-desktop:text-[24px] line-clamp-3 laptop:line-clamp-2",description:"hidden text-[14px] desktop:text-[16px] lg-desktop:text-[18px] laptop:block laptop:line-clamp-2 leading-normal",price:"text-[14px] leading-tight laptop:text-[20px] lg-desktop:text-[24px]",priceLabel:"text-[12px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px]",cardRadius:"rounded-box-small tablet:rounded-box",priceGap:"gap-[2px] laptop:gap-1",discountBadgeSize:"size-12 laptop:size-20 lg-desktop:size-24",discountBadgeText:"text-xs laptop:text-base lg-desktop:text-xl pl-2 pt-1 laptop:pl-4 laptop:pt-2",discountBadgeTextStyle2:"text-xs laptop:text-base lg-desktop:text-xl pt-2 desktop:pt-4",discountBadgeTextStyle3:"text-xs laptop:text-base lg-desktop:text-xl flex items-center pl-1 laptop:pl-2",discountBadgeTextCenter:"text-xs laptop:text-base lg-desktop:text-xl flex items-center justify-center",buttonContainer:"flex-wrap gap-2 laptop:flex-nowrap lg-desktop:gap-3",buttonItem:"w-full whitespace-nowrap laptop:w-fit laptop:min-w-0 laptop:whitespace-normal laptop:text-center",memberLabelContainer:"p-2 laptop:px-4 laptop:py-3 desktop:pl-6 desktop:py-4 desktop:pr-12 lg-desktop:pr-16",memberLabelText:"text-xs laptop:text-sm desktop:text-base lg-desktop:text-[18px]"},horizontal:{cardContent:"p-4 desktop:p-6 laptop:pt-6 desktop:pt-8 lg-desktop:pt-10",image:"size-[180px] lg-desktop:size-[240px]",imageOffset:"-top-4 -left-4 -right-4 laptop:-top-6 desktop:-top-8 lg-desktop:-top-10 desktop:-left-6 desktop:-right-6",title:"mb-1 text-[20px] leading-[120%] lg-desktop:text-[24px] line-clamp-2",description:"text-[14px] desktop:text-[16px] lg-desktop:text-[18px] line-clamp-2 leading-normal",price:"text-[20px] leading-[120%] lg-desktop:text-[24px]",priceLabel:"text-[14px] leading-[140%] desktop:text-[16px] lg-desktop:text-[18px]",cardRadius:"rounded-box",priceGap:"gap-1",discountBadgeSize:"size-20 lg-desktop:size-24",discountBadgeText:"text-base lg-desktop:text-xl pt-2 pl-4",discountBadgeTextStyle2:"text-base lg-desktop:text-xl pt-2 desktop:pt-4",discountBadgeTextStyle3:"text-base lg-desktop:text-xl flex items-center pl-1 laptop:pl-2",discountBadgeTextCenter:"text-base lg-desktop:text-xl flex items-center justify-center",buttonContainer:"gap-2 lg-desktop:gap-3",buttonItem:"w-full whitespace-nowrap tablet:w-fit tablet:min-w-0 tablet:whitespace-normal tablet:text-center",memberLabelContainer:"px-4 py-3 desktop:pl-6 desktop:py-4 desktop:pr-12 lg-desktop:pr-16",memberLabelText:"text-xs laptop:text-sm desktop:text-base lg-desktop:text-[18px]"}};
@@ -1 +1 @@
1
- "use strict";"use client";var C=Object.create;var f=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var w=(t,e)=>{for(var i in e)f(t,i,{get:e[i],enumerable:!0})},A=(t,e,i,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of D(e))!P.call(t,o)&&o!==i&&f(t,o,{get:()=>e[o],enumerable:!(l=z(e,o))||l.enumerable});return t};var L=(t,e,i)=>(i=t!=null?C(H(t)):{},A(e||!t||!t.__esModule?f(i,"default",{value:t,enumerable:!0}):i,t)),B=t=>A(f({},"__esModule",{value:!0}),t);var _={};w(_,{default:()=>j});module.exports=B(_);var s=require("react/jsx-runtime"),d=L(require("react")),a=require("../../components/index.js"),O=require("../../shared/Styles.js"),r=require("../../helpers/utils.js"),T=require("../../hooks/useExposure.js"),x=require("../../shared/trackUrlRef.js"),k=require("class-variance-authority"),y=require("../../helpers/index.js"),V=require("../AiuiProvider/index.js");const h="image",v="activity_mechanism",M=(0,k.cva)("line-clamp-2",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{theme:"light"}}),R=(0,k.cva)("desktop:text-[16px] mt-1 line-clamp-2 text-[14px] font-bold leading-[1.4] tracking-[-0.02em]",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white/80"}},defaultVariants:{theme:"light"}}),E=(0,k.cva)("mt-2 !p-0 text-[14px]",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{theme:"light"}}),g={default:767,tablet:1024,laptop:1439,desktop:1919,lgDesktop:9999},S=t=>{if(!t)return"";const e=[];return t.lgDesktop?.url&&e.push(`${t.lgDesktop.url}`),t.desktop?.url&&e.push(`${t.desktop.url} ${g.desktop}`),t.laptop?.url&&e.push(`${t.laptop.url} ${g.laptop}`),t.tablet?.url&&e.push(`${t.tablet.url} ${g.tablet}`),t.default?.url&&e.push(`${t.default.url} ${g.default}`),e.join(", ")},b=t=>t&&(t.default?.alt||t.tablet?.alt||t.laptop?.alt||t.desktop?.alt||t.lgDesktop?.alt)||"",F=({item:t,theme:e,classNames:i})=>{const{title:l,description:o,linkText:n,linkHref:c,backgroundImage:m}=t,p=S(m),u=b(m),{locale:$="us"}=(0,V.useAiuiContext)();return(0,s.jsx)("div",{className:(0,r.cn)("rounded-card relative flex flex-col overflow-hidden","desktop:px-6 h-[280px] p-4","laptop:gap-4 gap-3","laptop:h-[320px] lg-desktop:[400px]",i?.card),"data-headless-type-name":`${h}#${v}`,children:c?(0,s.jsxs)(a.Link,{href:(0,y.getLocalizedPath)((0,x.trackUrlRef)(c,`${h}_${v}`),$),className:"no-underline",children:[p&&(0,s.jsx)(a.Picture,{source:p,alt:u||l,className:(0,r.cn)("absolute inset-0 size-full",i?.background),imgClassName:"size-full object-cover"}),(0,s.jsxs)("div",{className:"relative z-10",children:[(0,s.jsx)(a.Heading,{as:"h3",size:3,className:(0,r.cn)(M({theme:e}),i?.title),children:l}),(0,s.jsx)(a.Text,{as:"p",className:(0,r.cn)(R({theme:e}),i?.description),children:o}),n&&(0,s.jsx)(a.Button,{variant:"link",as:"a",href:(0,y.getLocalizedPath)((0,x.trackUrlRef)(c,`${h}_${v}`),$),className:(0,r.cn)(E({theme:e}),i?.link),"data-headless-title-desc-button":`${l}#${o}#${n}`,children:n})]})]}):(0,s.jsxs)(s.Fragment,{children:[p&&(0,s.jsx)(a.Picture,{source:p,alt:u||l,className:(0,r.cn)("absolute inset-0 size-full",i?.background),imgClassName:"size-full object-cover"}),(0,s.jsxs)("div",{className:"relative z-10",children:[(0,s.jsx)(a.Heading,{as:"h3",size:3,className:(0,r.cn)(M({theme:e}),i?.title),children:l}),(0,s.jsx)(a.Text,{as:"p",className:(0,r.cn)(R({theme:e}),i?.description),children:o})]})]})})},N=d.default.forwardRef(({data:t,classNames:e},i)=>{const{items:l=[],theme:o="light"}=t,n=(0,d.useRef)(null);if((0,d.useImperativeHandle)(i,()=>n.current),(0,T.useExposure)(n,{componentType:h,componentName:v,componentTitle:l[0]?.title||"",componentDescription:l[0]?.description||""}),!l||l.length===0)return null;const c={1:"laptop:grid-cols-1 desktop:grid-cols-1 lg-desktop:grid-cols-1",2:"laptop:grid-cols-2 desktop:grid-cols-2 lg-desktop:grid-cols-2",3:"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-3 lg-desktop:grid-cols-3",4:"laptop:grid-cols-4 desktop:grid-cols-4 lg-desktop:grid-cols-4"},m=c[Math.min(l.length,4)]||c[4];return(0,s.jsx)(a.Container,{"data-ui-component-id":"ActivityMechanism",className:(0,r.cn)("activity-mechanism","w-full",e?.root),ref:n,children:(0,s.jsx)("div",{className:(0,r.cn)("tablet:grid-cols-2 laptop:gap-4 grid grid-cols-1 gap-3",m,e?.grid),children:l.map((p,u)=>(0,s.jsx)(F,{item:p,theme:o,classNames:{...e,...l?.length===3&&{card:e?.card+" first:tablet:col-span-full first:laptop:col-span-1"}}},`${p.title}-${u}`))})})});N.displayName="ActivityMechanism";var j=N;
1
+ "use strict";"use client";var C=Object.create;var f=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var w=(t,e)=>{for(var i in e)f(t,i,{get:e[i],enumerable:!0})},A=(t,e,i,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of D(e))!P.call(t,o)&&o!==i&&f(t,o,{get:()=>e[o],enumerable:!(l=z(e,o))||l.enumerable});return t};var L=(t,e,i)=>(i=t!=null?C(H(t)):{},A(e||!t||!t.__esModule?f(i,"default",{value:t,enumerable:!0}):i,t)),B=t=>A(f({},"__esModule",{value:!0}),t);var _={};w(_,{default:()=>j});module.exports=B(_);var s=require("react/jsx-runtime"),d=L(require("react")),a=require("../../components/index.js"),O=require("../../shared/Styles.js"),r=require("../../helpers/utils.js"),T=require("../../hooks/useExposure.js"),x=require("../../shared/trackUrlRef.js"),k=require("class-variance-authority"),y=require("../../helpers/index.js"),V=require("../AiuiProvider/index.js");const h="image",v="activity_mechanism",M=(0,k.cva)("line-clamp-2",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{theme:"light"}}),R=(0,k.cva)("desktop:text-[16px] mt-1 line-clamp-2 text-[14px] font-bold leading-[1.4] tracking-[-0.02em]",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white/80"}},defaultVariants:{theme:"light"}}),E=(0,k.cva)("mt-2 !p-0 text-[14px]",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{theme:"light"}}),g={default:767,tablet:1024,laptop:1439,desktop:1919,lgDesktop:9999},S=t=>{if(!t)return"";const e=[];return t.lgDesktop?.url&&e.push(`${t.lgDesktop.url}`),t.desktop?.url&&e.push(`${t.desktop.url} ${g.desktop}`),t.laptop?.url&&e.push(`${t.laptop.url} ${g.laptop}`),t.tablet?.url&&e.push(`${t.tablet.url} ${g.tablet}`),t.default?.url&&e.push(`${t.default.url} ${g.default}`),e.join(", ")},b=t=>t&&(t.default?.alt||t.tablet?.alt||t.laptop?.alt||t.desktop?.alt||t.lgDesktop?.alt)||"",F=({item:t,theme:e,classNames:i})=>{const{title:l,description:o,linkText:n,linkHref:c,backgroundImage:m}=t,p=S(m),u=b(m),{locale:$="us"}=(0,V.useAiuiContext)();return(0,s.jsx)("div",{className:(0,r.cn)("rounded-card relative flex flex-col overflow-hidden","desktop:px-6 h-[280px] p-4","laptop:gap-4 gap-3","laptop:h-[320px] lg-desktop:h-[400px]",i?.card),"data-headless-type-name":`${h}#${v}`,children:c?(0,s.jsxs)(a.Link,{href:(0,y.getLocalizedPath)((0,x.trackUrlRef)(c,`${h}_${v}`),$),className:"no-underline",children:[p&&(0,s.jsx)(a.Picture,{source:p,alt:u||l,className:(0,r.cn)("absolute inset-0 size-full",i?.background),imgClassName:"size-full object-cover"}),(0,s.jsxs)("div",{className:"relative z-10",children:[(0,s.jsx)(a.Heading,{as:"h3",size:3,className:(0,r.cn)(M({theme:e}),i?.title),children:l}),(0,s.jsx)(a.Text,{as:"p",className:(0,r.cn)(R({theme:e}),i?.description),children:o}),n&&(0,s.jsx)(a.Button,{variant:"link",as:"a",href:(0,y.getLocalizedPath)((0,x.trackUrlRef)(c,`${h}_${v}`),$),className:(0,r.cn)(E({theme:e}),i?.link),"data-headless-title-desc-button":`${l}#${o}#${n}`,children:n})]})]}):(0,s.jsxs)(s.Fragment,{children:[p&&(0,s.jsx)(a.Picture,{source:p,alt:u||l,className:(0,r.cn)("absolute inset-0 size-full",i?.background),imgClassName:"size-full object-cover"}),(0,s.jsxs)("div",{className:"relative z-10",children:[(0,s.jsx)(a.Heading,{as:"h3",size:3,className:(0,r.cn)(M({theme:e}),i?.title),children:l}),(0,s.jsx)(a.Text,{as:"p",className:(0,r.cn)(R({theme:e}),i?.description),children:o})]})]})})},N=d.default.forwardRef(({data:t,classNames:e},i)=>{const{items:l=[],theme:o="light"}=t,n=(0,d.useRef)(null);if((0,d.useImperativeHandle)(i,()=>n.current),(0,T.useExposure)(n,{componentType:h,componentName:v,componentTitle:l[0]?.title||"",componentDescription:l[0]?.description||""}),!l||l.length===0)return null;const c={1:"laptop:grid-cols-1 desktop:grid-cols-1 lg-desktop:grid-cols-1",2:"laptop:grid-cols-2 desktop:grid-cols-2 lg-desktop:grid-cols-2",3:"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-3 lg-desktop:grid-cols-3",4:"laptop:grid-cols-4 desktop:grid-cols-4 lg-desktop:grid-cols-4"},m=c[Math.min(l.length,4)]||c[4];return(0,s.jsx)(a.Container,{"data-ui-component-id":"ActivityMechanism",className:(0,r.cn)("activity-mechanism","w-full",e?.root),ref:n,children:(0,s.jsx)("div",{className:(0,r.cn)("tablet:grid-cols-2 laptop:gap-4 grid grid-cols-1 gap-3",m,e?.grid),children:l.map((p,u)=>(0,s.jsx)(F,{item:p,theme:o,classNames:{...e,...l?.length===3&&{card:e?.card+" first:tablet:col-span-full first:laptop:col-span-1"}}},`${p.title}-${u}`))})})});N.displayName="ActivityMechanism";var j=N;
@@ -1 +1 @@
1
- "use strict";"use client";var x=Object.create;var p=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var w=(e,l)=>{for(var o in l)p(e,o,{get:l[o],enumerable:!0})},n=(e,l,o,d)=>{if(l&&typeof l=="object"||typeof l=="function")for(let a of b(l))!h.call(e,a)&&a!==o&&p(e,a,{get:()=>l[a],enumerable:!(d=v(l,a))||d.enumerable});return e};var k=(e,l,o)=>(o=e!=null?x(g(e)):{},n(l||!e||!e.__esModule?p(o,"default",{value:e,enumerable:!0}):o,e)),M=e=>n(p({},"__esModule",{value:!0}),e);var T={};w(T,{default:()=>I});module.exports=M(T);var t=require("react/jsx-runtime"),r=require("../../helpers/utils.js"),c=k(require("../SwiperBox/index.js")),f=require("../../shared/Styles.js"),m=require("../../components/grid.js"),i=require("../../components/index.js");const N=({data:e,configuration:l})=>(0,t.jsx)("div",{className:(0,r.cn)("creativeModuleItem","text-info-primary aspect-h-[360] aspect-w-[296] relative flex-1 shrink-0 overflow-hidden md:basis-[296px]","rounded-box",{"aiui-dark":e.theme==="dark"}),children:(0,t.jsxs)("div",{className:"absolute inset-0",children:[(0,t.jsx)(i.Picture,{className:"h-full",imgClassName:"h-full object-cover",source:e?.mobileImg?.url||e?.img?.url,alt:e?.mobileImg?.alt||e?.img?.alt||""}),(0,t.jsxs)("div",{className:"z-1 absolute inset-x-0 bottom-4 box-border flex w-full flex-col overflow-hidden px-4",children:[(0,t.jsx)(i.Text,{html:e?.title,className:"graphic-title truncate text-xl font-bold leading-[1.2]"}),e?.description&&(0,t.jsx)(i.Text,{html:e?.description,className:"graphic-title line-clamp-2 text-sm font-bold leading-[1.2]"})]})]})}),y=({data:e,className:l,...o})=>{const{productsTab:d,shape:a}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{...o,className:(0,r.cn)("creativeModuleBlock","laptop:block box-border hidden w-full overflow-hidden",l),children:(0,t.jsx)(m.Grid,{className:(0,r.cn)("tablet:gap-4 grid grid-cols-12 gap-3 ",l),children:d?.map((s,u)=>(0,t.jsxs)(m.GridItem,{span:s.span,className:(0,r.cn)("text-info-primary relative w-full overflow-hidden","rounded-box","lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[288px]",{"aiui-dark":s.theme==="dark"}),children:[(0,t.jsx)(i.Picture,{source:s.img.url,className:"size-full",imgClassName:"h-full object-cover"}),(0,t.jsxs)("div",{className:"lg-desktop:bottom-8 lg-desktop:px-8 desktop:bottom-6 desktop:px-6 absolute inset-x-0 bottom-4 flex flex-col gap-[6px] overflow-hidden px-4",children:[s.title&&(0,t.jsx)(i.Text,{html:s.title,as:"p",className:"desktop:text-[32px] laptop:text-2xl line-clamp-2 text-xl font-bold"}),s.description&&(0,t.jsx)(i.Text,{html:s.description,className:"desktop:text-lg line-clamp-2 text-sm font-bold"})]})]},u))})}),(0,t.jsx)("div",{className:"laptop:hidden block w-full",children:(0,t.jsx)(c.default,{id:"CreativeModule",className:(0,r.cn)("!overflow-visible",l),data:{list:d||[],configuration:{shape:a}},Slide:N,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3}}})})]})};var I=(0,f.withLayout)(y);
1
+ "use strict";"use client";var x=Object.create;var p=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var w=(e,l)=>{for(var o in l)p(e,o,{get:l[o],enumerable:!0})},n=(e,l,o,d)=>{if(l&&typeof l=="object"||typeof l=="function")for(let a of v(l))!h.call(e,a)&&a!==o&&p(e,a,{get:()=>l[a],enumerable:!(d=g(l,a))||d.enumerable});return e};var k=(e,l,o)=>(o=e!=null?x(b(e)):{},n(l||!e||!e.__esModule?p(o,"default",{value:e,enumerable:!0}):o,e)),M=e=>n(p({},"__esModule",{value:!0}),e);var T={};w(T,{default:()=>I});module.exports=M(T);var t=require("react/jsx-runtime"),r=require("../../helpers/utils.js"),c=k(require("../SwiperBox/index.js")),f=require("../../shared/Styles.js"),m=require("../../components/grid.js"),i=require("../../components/index.js");const N=({data:e,configuration:l})=>(0,t.jsx)("div",{className:(0,r.cn)("creativeModuleItem","text-info-primary aspect-h-[360] aspect-w-[296] relative flex-1 shrink-0 overflow-hidden md:basis-[296px]","rounded-box",{"aiui-dark":e.theme==="dark"}),children:(0,t.jsxs)("div",{className:"absolute inset-0",children:[(0,t.jsx)(i.Picture,{className:"h-full",imgClassName:"h-full object-cover",source:e?.mobileImg?.url||e?.img?.url,alt:e?.mobileImg?.alt||e?.img?.alt||""}),(0,t.jsxs)("div",{className:"z-1 absolute inset-x-0 bottom-4 box-border flex w-full flex-col overflow-hidden px-4",children:[(0,t.jsx)(i.Text,{html:e?.title,className:"graphic-title truncate text-xl font-bold leading-[1.2]"}),e?.description&&(0,t.jsx)(i.Text,{html:e?.description,className:"graphic-title line-clamp-2 text-sm font-bold leading-[1.2]"})]})]})}),y=({data:e,className:l,...o})=>{const{productsTab:d,shape:a}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{...o,className:(0,r.cn)("creativeModuleBlock","laptop:block box-border hidden w-full overflow-hidden",l),children:(0,t.jsx)(m.Grid,{className:(0,r.cn)("tablet:gap-4 grid grid-cols-12 gap-3 ",l),children:d?.map((s,u)=>(0,t.jsxs)(m.GridItem,{span:s.span,className:(0,r.cn)("text-info-primary relative w-full overflow-hidden","rounded-box","lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[288px]",{"aiui-dark":s.theme==="dark"}),children:[(0,t.jsx)(i.Picture,{source:s.img.url,className:"size-full",imgClassName:"h-full object-cover"}),(0,t.jsxs)("div",{className:"lg-desktop:bottom-8 lg-desktop:px-8 desktop:bottom-6 desktop:px-6 absolute inset-x-0 bottom-4 flex flex-col gap-[6px] overflow-hidden px-4",children:[s.title&&(0,t.jsx)(i.Text,{html:s.title,as:"p",className:"desktop:text-[32px] laptop:text-2xl line-clamp-2 text-xl font-bold !leading-tight"}),s.description&&(0,t.jsx)(i.Text,{html:s.description,className:"desktop:text-lg line-clamp-2 text-sm font-bold !leading-normal"})]})]},u))})}),(0,t.jsx)("div",{className:"laptop:hidden block w-full",children:(0,t.jsx)(c.default,{id:"CreativeModule",className:(0,r.cn)("!overflow-visible",l),data:{list:d||[],configuration:{shape:a}},Slide:N,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3}}})})]})};var I=(0,f.withLayout)(y);
@@ -1 +1 @@
1
- "use strict";var d=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var L=(e,n)=>{for(var r in n)d(e,r,{get:n[r],enumerable:!0})},I=(e,n,r,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of b(n))!E.call(e,i)&&i!==r&&d(e,i,{get:()=>n[i],enumerable:!(t=S(n,i))||t.enumerable});return e};var P=e=>I(d({},"__esModule",{value:!0}),e);var A={};L(A,{formatPrice:()=>p,formatVariantPrice:()=>M,getFirstAvailableVariant:()=>C,getVariantBySku:()=>O,getVariantFromSelectedOptions:()=>F,languageMap:()=>f,languageTerritory:()=>m,optionsConstructor:()=>v});module.exports=P(A);var l=require("../const.js");function v(e){return e.reduce((n,r)=>(n[r.name]=r.values[0].label,n),{})}const C=e=>e.variants.find(n=>n.availableForSale)||e.variants[0],O=(e,n)=>e.variants.find(r=>r.sku===n),f={us:"en-US",uk:"en-GB",ca:"en-CA",au:"AU","eu-en":"en","eu-fr":"fr-FR",fr:"FR","ca-fr":"FR","nl-fr":"FR",my:"MY",it:"IT",vn:"VN",es:"es-ES","eu-it":"it-IT","eu-de":"de-DE",de:"de-DE","eu-es":"es-ES","cz-en":"en-CZ",nl:"nl-NL","dk-en":"en-DK","gr-en":"en-GR","mk-en":"en-MK","hu-en":"en-HU","se-en":"en-SE","hr-en":"en-HR","bg-en":"en-BG","ee-en":"en-EE","fi-en":"en-FI","lt-en":"en-LT",pl:"pl-PL","ro-en":"en-RO","si-en":"en-SI","sk-en":"en-SK","no-en":"en-NO","ad-en":"en-AD","al-en":"en-AL","ba-en":"en-BA","me-en":"en-ME","rs-en":"en-RS","gl-en":"en-GL","is-en":"en-IS","ua-en":"en-UA","by-en":"en-BY","md-en":"en-MD","lv-en":"en-LV","at-de":"de-AT","lu-de":"de-LU","li-de":"de-LI","va-it":"it-VA","sm-it":"it-SM","be-nl":"nl-BE","ae-en":"en-AE",nz:"en-NZ","sg-en":"en-SG","sa-en":"en-SA","vn-vi":"vi-VN",ie:"en-IE",tw:"zh-TW"},m=e=>(f[e]||console.warn(`[formatPrice] Unknown locale "${e}", falling back to en-US`),f[e]||"en-US");function p({amount:e,currencyCode:n,locale:r,maximumFractionDigits:t,minimumFractionDigits:i,removeTrailingZeros:o=!1}){const s=n?.trim()||"USD",c=m(r);let u;try{u=new Intl.NumberFormat(c,{style:"currency",currency:s,minimumFractionDigits:t===0?0:i,maximumFractionDigits:t})}catch{u=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:t===0?0:i,maximumFractionDigits:t})}let a=u.format(e);return["de-DE","fr-FR","it-IT","es-ES","de-AT","de-LU","de-LI","nl-BE","pl-PL","vi-VN"].includes(c)&&(a=a?.toString()?.replace(/[\s\u00A0\u202F]/g,"")),o&&(a=a.replace(/(\.\d*?[1-9])0+\b/,"$1").replace(/\.0+\b/,"").replace(/(\,\d*?[1-9])0+\b/,"$1").replace(/\,0+\b/,"")),a}function M({amount:e,baseAmount:n,currencyCode:r,locale:t,maximumFractionDigits:i,minimumFractionDigits:o,removeTrailingZeros:s}){if(typeof Intl>"u")return{price:`${l.PRICE_SYMBOL[t]}${e}`,basePrice:`${l.PRICE_SYMBOL[t]}${n}`,discount:`${l.PRICE_SYMBOL[t]}${n-e||0}`};const c=n>e,u=new Intl.NumberFormat(m(t),{style:"percent"}),a=c?u.format((n-e)/n):null,y=p({amount:e,currencyCode:r,locale:t,removeTrailingZeros:s}),g=c?p({amount:n,currencyCode:r,locale:t,maximumFractionDigits:i,minimumFractionDigits:o,removeTrailingZeros:s}):void 0;return{price:y,basePrice:g,discount:a}}function F({product:e,selectedOptions:n}){return e.variants.find(r=>Object.entries(n).every(([t,i])=>r.options.find(o=>{if(o.__typename==="MultipleChoiceOption"&&o.name===t)return o.values.find(s=>s.label===i)})))}
1
+ "use strict";var d=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var L=(e,n)=>{for(var r in n)d(e,r,{get:n[r],enumerable:!0})},I=(e,n,r,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of b(n))!E.call(e,i)&&i!==r&&d(e,i,{get:()=>n[i],enumerable:!(t=S(n,i))||t.enumerable});return e};var P=e=>I(d({},"__esModule",{value:!0}),e);var A={};L(A,{formatPrice:()=>p,formatVariantPrice:()=>M,getFirstAvailableVariant:()=>C,getVariantBySku:()=>O,getVariantFromSelectedOptions:()=>F,languageMap:()=>f,languageTerritory:()=>m,optionsConstructor:()=>v});module.exports=P(A);var l=require("../const.js");function v(e){return e.reduce((n,r)=>(n[r.name]=r.values[0].label,n),{})}const C=e=>e.variants.find(n=>n.availableForSale)||e.variants[0],O=(e,n)=>e.variants.find(r=>r.sku===n),f={us:"en-US",uk:"en-GB",ca:"en-CA",au:"AU","eu-en":"en","eu-fr":"fr-FR",fr:"FR","ca-fr":"FR","nl-fr":"FR",my:"MY",it:"IT",vn:"VN",es:"es-ES","eu-it":"it-IT","eu-de":"de-DE",de:"de-DE","eu-es":"es-ES","cz-en":"en-CZ",nl:"nl-NL","dk-en":"en-DK","gr-en":"en-GR","mk-en":"en-MK","hu-en":"en-HU","se-en":"en-SE","hr-en":"en-HR","bg-en":"en-BG","ee-en":"en-EE","fi-en":"en-FI","lt-en":"en-LT",pl:"pl-PL","ro-en":"en-RO","si-en":"en-SI","sk-en":"en-SK","no-en":"en-NO","ad-en":"en-AD","al-en":"en-AL","ba-en":"en-BA","me-en":"en-ME","rs-en":"en-RS","gl-en":"en-GL","is-en":"en-IS","ua-en":"en-UA","by-en":"en-BY","md-en":"en-MD","lv-en":"en-LV","at-de":"de-AT","lu-de":"de-LU","li-de":"de-LI","va-it":"it-VA","sm-it":"it-SM","be-nl":"nl-BE","ae-en":"en-AE",nz:"en-NZ","sg-en":"en-SG","sa-en":"en-SA","vn-vi":"vi-VN",ie:"en-IE",tw:"zh-TW",be:"nl-BE"},m=e=>(f[e]||console.warn(`[formatPrice] Unknown locale "${e}", falling back to en-US`),f[e]||"en-US");function p({amount:e,currencyCode:n,locale:r,maximumFractionDigits:t,minimumFractionDigits:i,removeTrailingZeros:o=!1}){const s=n?.trim()||"USD",c=m(r);let u;try{u=new Intl.NumberFormat(c,{style:"currency",currency:s,minimumFractionDigits:t===0?0:i,maximumFractionDigits:t})}catch{u=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:t===0?0:i,maximumFractionDigits:t})}let a=u.format(e);return["de-DE","fr-FR","it-IT","es-ES","de-AT","de-LU","de-LI","pl-PL","vi-VN"].includes(c)&&(a=a?.toString()?.replace(/[\s\u00A0\u202F]/g,"")),o&&(a=a.replace(/(\.\d*?[1-9])0+\b/,"$1").replace(/\.0+\b/,"").replace(/(\,\d*?[1-9])0+\b/,"$1").replace(/\,0+\b/,"")),a}function M({amount:e,baseAmount:n,currencyCode:r,locale:t,maximumFractionDigits:i,minimumFractionDigits:o,removeTrailingZeros:s}){if(typeof Intl>"u")return{price:`${l.PRICE_SYMBOL[t]}${e}`,basePrice:`${l.PRICE_SYMBOL[t]}${n}`,discount:`${l.PRICE_SYMBOL[t]}${n-e||0}`};const c=n>e,u=new Intl.NumberFormat(m(t),{style:"percent"}),a=c?u.format((n-e)/n):null,y=p({amount:e,currencyCode:r,locale:t,removeTrailingZeros:s}),g=c?p({amount:n,currencyCode:r,locale:t,maximumFractionDigits:i,minimumFractionDigits:o,removeTrailingZeros:s}):void 0;return{price:y,basePrice:g,discount:a}}function F({product:e,selectedOptions:n}){return e.variants.find(r=>Object.entries(n).every(([t,i])=>r.options.find(o=>{if(o.__typename==="MultipleChoiceOption"&&o.name===t)return o.values.find(s=>s.label===i)})))}
@@ -1 +1 @@
1
- "use client";import{Fragment as ke,jsx as t,jsxs as l}from"react/jsx-runtime";import*as N from"react";import{cn as a}from"../../helpers/index.js";import{Button as $,Badge as fe,Card as ye,CardContent as pe,Picture as U,Text as C,Heading as A,Progress as ve}from"../../components/index.js";import{MemberLabel as Se}from"./MemberLabel.js";import{layoutModeStyles as G}from"./styles.js";const Ce=5;function he(e,i,r,y){if(e===void 0)return!0;switch(e){case"always":return!0;case"never":return!1;case"below-quantity":return i===void 0?!0:r<=i;case"below-percentage":return i===void 0?!0:r/y*100<=i;default:return!0}}const xe=({items:e})=>e?.length?t("div",{className:"active-shelf-display-social-endorsements desktop:gap-2 laptop:flex absolute right-0 top-0 z-10 hidden flex-col items-center gap-1",children:e.slice(0,3).map((i,r)=>typeof i.icon=="string"?t("img",{src:i.icon,alt:i.label||"",loading:"lazy",className:"desktop:size-10 lg-desktop:size-12 size-8 object-contain"},r):t(C,{"aria-label":i.label,className:"desktop:size-10 lg-desktop:size-12 size-8 [&_img]:size-full [&_svg]:size-full",children:i.icon},r))}):null,H={style1:{bg:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/2_7746fc9c-d4e4-4a59-a972-fa4cb0f3f8bd.png?v=1789381635",textClass:"aiui-dark text-info-primary"},style2:{bg:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_e0438358-493b-40cb-9a58-89d6ee2d3751.png?v=1789381628",textClass:"aiui-dark text-info-primary"},style3:{bg:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_19208ba4-71ea-4580-892d-72167f1cf606.png?v=1789381639",textClass:"aiui-dark text-info-primary"}},Te=({text:e,style:i="style1",icon:r,className:y,textClassName:B,layoutMode:h="flex",renderBadge:p})=>{if(!e)return null;const g=i==="custom",n=g&&!!p,v=g&&!p&&!!r?.url,S=g?void 0:H[i],m=H.style1,c=G[h],x={style1:c.discountBadgeText,style2:c.discountBadgeTextStyle2,style3:c.discountBadgeTextStyle3},T=g?c.discountBadgeTextCenter:x[i];return l("div",{className:a("active-shelf-discount-badge","absolute left-0 top-0 z-10",c.discountBadgeSize,y),children:[n?p({text:e,layoutMode:h}):v?t(U,{source:r.url,alt:r.alt||e,className:"block size-full",imgClassName:"block size-full object-contain"}):t("img",{src:(S??m).bg,alt:e,loading:"lazy",className:"block size-full object-contain"}),!n&&t(C,{className:a("active-shelf-discount-badge-text text-center","absolute inset-0 font-bold !leading-[1.2]",T,(S??m).textClass,B),html:e})]})},z=N.forwardRef(({product:e,className:i,showTags:r=!0,stockDisplayMode:y,stockThresholdValue:B,onLearnMore:h,onShopNow:p,onAddToCart:g,classNames:n,secondaryButtonText:v,secondaryButtonFun:S,primaryButtonText:m,primaryButtonFun:c,showOriginalPrice:x,renderOriginalPrice:T,copy:b,onProductImageClick:k,tagTypeConfig:_,fill:M,outline:w,memberPriceTextColor:R,userType:P,memberImages:K,customTagsIcon:J,customTagStyle:Q,onMemberSignUp:W,onPlusMemberAddCart:X,showMemberPrice:I,layoutMode:L,renderDiscountBadge:Y},Z)=>{const[ee,te]=N.useState(!1),[ae,ie]=N.useState(!1),ne=e?.memberDiscountAmount,oe=e?.plusMemberDiscountAmount,se=e?.activityLabels??[],re=P==="guest"?"guest":"member",E=se.find(s=>s.type===re)?.label,le=P==="guest"?b?.memberActivityLabelUnLogin:b?.memberActivityLabel,ce=!!E||!!le,de=e?.discountAmount,o=G[L??"flex"],ue=N.useMemo(()=>e?.availableForSale&&e?.quantityAvailable<=0?Ce:e?.availableForSale?(e?.quantityAvailable??0)/(e?.totalInventory??1)*100:0,[e?.availableForSale,e?.quantityAvailable,e?.totalInventory]),F=async(s,d)=>{if(!s)return;const u=d==="primary"?te:ie;u(!0);try{switch(s){case"buyNow":await p?.(e);break;case"addCart":await g?.(e);break;case"learnMore":await h?.(e);break;default:break}}finally{u(!1)}},ge=e.availableForSale&&e.quantityAvailable<=0,me=(s,d)=>{const u=s===0?_?.firstTagVariant:s===1?_?.secondTagVariant:void 0,D=(u||void 0)??(d==="fill"?"fill":d!==void 0?"outline":s===0?"fill":"outline"),f=D==="fill"?{outline:M?.outlineColor,bg:M?.bgColor}:{outline:w?.outlineColor,bg:w?.bgColor},O={...f.outline?{outlineColor:f.outline}:{},...f.bg?{backgroundColor:f.bg,backgroundImage:"none"}:{}};return D==="outline"&&f.outline&&(O.color=f.outline),{variant:D,style:O}},j=!!e.custom_bg_image,be=!!e.custom_scene_image,q=s=>s?{backgroundImage:`url(${s})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}:void 0;return l(ye,{ref:Z,className:a("hover:bg-container-secondary-0 bg-container-primary relative flex h-full cursor-pointer flex-col overflow-hidden border-none",o.cardRadius,i,n?.productCard),children:[t(Te,{text:de,style:Q,icon:J,layoutMode:L,renderBadge:Y,className:n?.discountBadge,textClassName:n?.discountBadgeText}),l(pe,{className:a(o.cardContent,"relative flex flex-1 flex-col justify-between"),children:[l("div",{className:"product-image-wrapper group/product-image relative mb-4",children:[j&&t("div",{"aria-hidden":!0,className:a("pointer-events-none absolute inset-0 z-20",o.imageOffset),style:q(e.custom_bg_image)}),be&&t("div",{"aria-hidden":!0,className:a("laptop:block laptop:group-hover/product-image:opacity-100 pointer-events-none absolute inset-0 z-20 hidden opacity-0 transition-opacity duration-300",o.imageOffset),style:q(e.custom_scene_image)}),t("div",{className:a("product-image mx-auto cursor-pointer overflow-hidden",o.image),children:t("a",{onClick:()=>k?.(e),...!k&&{href:e?.listingLink},rel:"noreferrer",className:a("block size-full",j&&"opacity-0"),children:t(U,{source:e.image,alt:e.name,className:"aspect-square size-full object-contain",imgClassName:"size-full object-contain"})})}),t(xe,{items:e?.socialEndorsements})]}),r&&t("div",{className:"desktop:mb-2 mb-1 flex h-[24px] gap-1",children:e.tags?.map((s,d)=>{if(!s.label)return null;const{variant:u,style:V}=me(d,s.variant);return t(fe,{size:"sm",variant:u,className:"active-shelf-items-tag py-0",style:V,children:s.label},d)})}),l("div",{className:"flex h-full flex-1 grow flex-col justify-between gap-4",children:[l("div",{children:[t(A,{as:"h3",size:"none",className:a("text-info-primary",o.title,n?.productTitle),children:t("a",{onClick:()=>k?.(e),...!k&&{href:e?.listingLink},rel:"noreferrer",className:"hover:text-brand-0 cursor-pointer ",children:e.custom_name||e.name})}),e?.description&&t(C,{size:"none",className:a("active-shelf-product-description text-info-primary",o.description,n?.productDescription),html:e.custom_description||e.description})]}),l("div",{children:[t("div",{className:a(n?.productPrice),children:t("div",{className:a("flex items-baseline",o.priceGap),children:e.availableForSale?l(ke,{children:[t(A,{size:"none",className:a("text-info-primary",o.price),as:"h6",children:e.price}),T?T(e,{showOriginalPrice:x}):x&&e.originalPrice&&t(A,{size:"none",className:a("text-info-tertiary line-through",o.price,n?.originalPrice),as:"h6",children:e.originalPrice})]}):t(A,{size:"none",className:a("text-info-tertiary",o.price),children:b?.outOfStockLabel??"Sold Out"})})}),I&&e?.priceLabel&&e?.availableForSale&&t("div",{className:a("min-h-[1lh]",o.priceLabel),children:t(C,{size:"none",className:a("text-brand-0",n?.productPriceLabel),style:{...R?{color:R}:{}},children:e.priceLabel})}),l("div",{className:a("mt-2 flex",o.buttonContainer,n?.buttonGroup),children:[v&&t($,{variant:"secondary",size:"lg",className:a(o.buttonItem,n?.secondaryButton),onClick:()=>F(S,"secondary"),disabled:!e.availableForSale&&S!=="learnMore",loading:ae,"data-headless-type-name":"ActiveShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${v}`,"data-headless-sku":e.sku,children:v}),m&&t($,{variant:"primary",size:"lg",className:a(o.buttonItem,n?.primaryButton),onClick:()=>F(c,"primary"),disabled:!e.availableForSale&&c!=="learnMore",loading:ee,"data-headless-type-name":"ActiveShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${m}`,"data-headless-sku":e.sku,children:m})]}),he(y,B,e?.quantityAvailable??0,e?.totalInventory??0)&&l("div",{className:"mt-4 flex flex-col gap-1",children:[t(ve,{value:ue,max:100,min:0,size:"base",variant:"default","aria-label":"stock progress",classNames:{root:a("bg-[var(--progress-track-bg,rgba(0,0,0,0.2))]",n?.stockTrack),progressBar:a("bg-brand-0 transition-all duration-300 ease-in-out",n?.stockBar)}}),t(C,{size:3,className:"text-info-tertiary text-[14px]",children:ge?b?.limitedStock:b?.stockDisplayText?.replace("{count}",`${e.availableForSale?e.quantityAvailable:0}`)})]})]})]})]}),I&&P&&t(Se,{userType:P,copy:b,images:K,onSignUp:W,onPlusMemberAddCart:X,hasActivity:ce,activityLabel:E,memberDiscountAmount:ne,plusMemberDiscountAmount:oe,layoutMode:L})]})});z.displayName="ActiveShelf.ProductCard";var Le=z;export{z as ProductCard,Le as default};
1
+ "use client";import{Fragment as Te,jsx as t,jsxs as l}from"react/jsx-runtime";import*as N from"react";import{cn as a}from"../../helpers/index.js";import{Button as $,Badge as fe,Card as ye,CardContent as pe,Picture as U,Text as C,Heading as A,Progress as ve}from"../../components/index.js";import{MemberLabel as Se}from"./MemberLabel.js";import{layoutModeStyles as G}from"./styles.js";const Ce=5;function he(e,i,r,y){if(e===void 0)return!0;switch(e){case"always":return!0;case"never":return!1;case"below-quantity":return i===void 0?!0:r<=i;case"below-percentage":return i===void 0?!0:r/y*100<=i;default:return!0}}const xe=({items:e})=>e?.length?t("div",{className:"active-shelf-display-social-endorsements desktop:gap-2 laptop:flex absolute right-0 top-0 z-10 hidden flex-col items-center gap-1",children:e.slice(0,3).map((i,r)=>typeof i.icon=="string"?t("img",{src:i.icon,alt:i.label||"",loading:"lazy",className:"desktop:size-10 lg-desktop:size-12 size-8 object-contain"},r):t(C,{"aria-label":i.label,className:"desktop:size-10 lg-desktop:size-12 size-8 [&_img]:size-full [&_svg]:size-full",children:i.icon},r))}):null,H={style1:{bg:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/2_7746fc9c-d4e4-4a59-a972-fa4cb0f3f8bd.png?v=1789381635",textClass:"aiui-dark text-info-primary"},style2:{bg:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_e0438358-493b-40cb-9a58-89d6ee2d3751.png?v=1789381628",textClass:"aiui-dark text-info-primary"},style3:{bg:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_19208ba4-71ea-4580-892d-72167f1cf606.png?v=1789381639",textClass:"aiui-dark text-info-primary"}},ke=({text:e,style:i="style1",icon:r,className:y,textClassName:B,layoutMode:h="flex",renderBadge:p})=>{if(!e)return null;const g=i==="custom",n=g&&!!p,v=g&&!p&&!!r?.url,S=g?void 0:H[i],m=H.style1,c=G[h],x={style1:c.discountBadgeText,style2:c.discountBadgeTextStyle2,style3:c.discountBadgeTextStyle3},k=g?c.discountBadgeTextCenter:x[i];return l("div",{className:a("active-shelf-discount-badge","absolute left-0 top-0 z-10",c.discountBadgeSize,y),children:[n?p({text:e,layoutMode:h}):v?t(U,{source:r.url,alt:r.alt||e,className:"block size-full",imgClassName:"block size-full object-contain"}):t("img",{src:(S??m).bg,alt:e,loading:"lazy",className:"block size-full object-contain"}),!n&&t(C,{className:a("active-shelf-discount-badge-text text-center","absolute inset-0 font-bold !leading-[1.2]",k,(S??m).textClass,B),html:e})]})},z=N.forwardRef(({product:e,className:i,showTags:r=!0,stockDisplayMode:y,stockThresholdValue:B,onLearnMore:h,onShopNow:p,onAddToCart:g,classNames:n,secondaryButtonText:v,secondaryButtonFun:S,primaryButtonText:m,primaryButtonFun:c,showOriginalPrice:x,renderOriginalPrice:k,copy:b,onProductImageClick:T,tagTypeConfig:_,fill:M,outline:w,memberPriceTextColor:R,userType:P,memberImages:K,customTagsIcon:J,customTagStyle:Q,onMemberSignUp:W,onPlusMemberAddCart:X,showMemberPrice:I,layoutMode:L,renderDiscountBadge:Y},Z)=>{const[ee,te]=N.useState(!1),[ae,ie]=N.useState(!1),ne=e?.memberDiscountAmount,oe=e?.plusMemberDiscountAmount,se=e?.activityLabels??[],re=P==="guest"?"guest":"member",E=se.find(s=>s.type===re)?.label,le=P==="guest"?b?.memberActivityLabelUnLogin:b?.memberActivityLabel,ce=!!E||!!le,de=e?.discountAmount,o=G[L??"flex"],ue=N.useMemo(()=>e?.availableForSale&&e?.quantityAvailable<=0?Ce:e?.availableForSale?(e?.quantityAvailable??0)/(e?.totalInventory??1)*100:0,[e?.availableForSale,e?.quantityAvailable,e?.totalInventory]),F=async(s,d)=>{if(!s)return;const u=d==="primary"?te:ie;u(!0);try{switch(s){case"buyNow":await p?.(e);break;case"addCart":await g?.(e);break;case"learnMore":await h?.(e);break;default:break}}finally{u(!1)}},ge=e.availableForSale&&e.quantityAvailable<=0,me=(s,d)=>{const u=s===0?_?.firstTagVariant:s===1?_?.secondTagVariant:void 0,D=(u||void 0)??(d==="fill"?"fill":d!==void 0?"outline":s===0?"fill":"outline"),f=D==="fill"?{outline:M?.outlineColor,bg:M?.bgColor}:{outline:w?.outlineColor,bg:w?.bgColor},O={...f.outline?{outlineColor:f.outline}:{},...f.bg?{backgroundColor:f.bg,backgroundImage:"none"}:{}};return D==="outline"&&f.outline&&(O.color=f.outline),{variant:D,style:O}},j=!!e.custom_bg_image,be=!!e.custom_scene_image,q=s=>s?{backgroundImage:`url(${s})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}:void 0;return l(ye,{ref:Z,className:a("hover:bg-container-secondary-0 bg-container-primary relative flex h-full cursor-pointer flex-col overflow-hidden border-none",o.cardRadius,i,n?.productCard),children:[t(ke,{text:de,style:Q,icon:J,layoutMode:L,renderBadge:Y,className:n?.discountBadge,textClassName:n?.discountBadgeText}),l(pe,{className:a(o.cardContent,"relative flex flex-1 flex-col justify-between"),children:[l("div",{className:"product-image-wrapper group/product-image laptop:pb-2 laptop:mb-4 desktop:pb-6 desktop:mb-4 relative pb-4",children:[j&&t("div",{"aria-hidden":!0,className:a("pointer-events-none absolute inset-0 z-20",o.imageOffset),style:q(e.custom_bg_image)}),be&&t("div",{"aria-hidden":!0,className:a("laptop:block laptop:group-hover/product-image:opacity-100 pointer-events-none absolute inset-0 z-20 hidden opacity-0 transition-opacity duration-300",o.imageOffset),style:q(e.custom_scene_image)}),t("div",{className:a("product-image mx-auto cursor-pointer overflow-hidden",o.image),children:t("a",{onClick:()=>T?.(e),...!T&&{href:e?.listingLink},rel:"noreferrer",className:a("block size-full",j&&"opacity-0"),children:t(U,{source:e.image,alt:e.name,className:"aspect-square size-full object-contain",imgClassName:"size-full object-contain"})})}),t(xe,{items:e?.socialEndorsements})]}),r&&t("div",{className:"desktop:mb-2 mb-1 flex h-[24px] gap-1",children:e.tags?.map((s,d)=>{if(!s.label)return null;const{variant:u,style:V}=me(d,s.variant);return t(fe,{size:"sm",variant:u,className:"active-shelf-items-tag py-0",style:V,children:s.label},d)})}),l("div",{className:"flex h-full flex-1 grow flex-col justify-between gap-4",children:[l("div",{children:[t(A,{as:"h3",size:"none",className:a("text-info-primary",o.title,n?.productTitle),children:t("a",{onClick:()=>T?.(e),...!T&&{href:e?.listingLink},rel:"noreferrer",className:"hover:text-brand-0 cursor-pointer ",children:e.custom_name||e.name})}),e?.description&&t(C,{size:"none",className:a("active-shelf-product-description text-info-primary",o.description,n?.productDescription),html:e.custom_description||e.description})]}),l("div",{children:[t("div",{className:a(n?.productPrice),children:t("div",{className:a("flex items-baseline",o.priceGap),children:e.availableForSale?l(Te,{children:[t(A,{size:"none",className:a("text-info-primary",o.price),as:"h6",children:e.price}),k?k(e,{showOriginalPrice:x}):x&&e.originalPrice&&t(A,{size:"none",className:a("text-info-tertiary line-through",o.price,n?.originalPrice),as:"h6",children:e.originalPrice})]}):t(A,{size:"none",className:a("text-info-tertiary",o.price),children:b?.outOfStockLabel??"Sold Out"})})}),I&&e?.priceLabel&&e?.availableForSale&&t("div",{className:a("min-h-[1lh]",o.priceLabel),children:t(C,{size:"none",className:a("text-brand-0",n?.productPriceLabel),style:{...R?{color:R}:{}},children:e.priceLabel})}),l("div",{className:a("mt-2 flex",o.buttonContainer,n?.buttonGroup),children:[v&&t($,{variant:"secondary",size:"lg",className:a(o.buttonItem,n?.secondaryButton),onClick:()=>F(S,"secondary"),disabled:!e.availableForSale&&S!=="learnMore",loading:ae,"data-headless-type-name":"ActiveShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${v}`,"data-headless-sku":e.sku,children:v}),m&&t($,{variant:"primary",size:"lg",className:a(o.buttonItem,n?.primaryButton),onClick:()=>F(c,"primary"),disabled:!e.availableForSale&&c!=="learnMore",loading:ee,"data-headless-type-name":"ActiveShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${m}`,"data-headless-sku":e.sku,children:m})]}),he(y,B,e?.quantityAvailable??0,e?.totalInventory??0)&&l("div",{className:"mt-4 flex flex-col gap-1",children:[t(ve,{value:ue,max:100,min:0,size:"base",variant:"default","aria-label":"stock progress",classNames:{root:a("bg-[var(--progress-track-bg,rgba(0,0,0,0.2))]",n?.stockTrack),progressBar:a("bg-brand-0 transition-all duration-300 ease-in-out",n?.stockBar)}}),t(C,{size:3,className:"text-info-tertiary text-[14px]",children:ge?b?.limitedStock:b?.stockDisplayText?.replace("{count}",`${e.availableForSale?e.quantityAvailable:0}`)})]})]})]})]}),I&&P&&t(Se,{userType:P,copy:b,images:K,onSignUp:W,onPlusMemberAddCart:X,hasActivity:ce,activityLabel:E,memberDiscountAmount:ne,plusMemberDiscountAmount:oe,layoutMode:L})]})});z.displayName="ActiveShelf.ProductCard";var Le=z;export{z as ProductCard,Le as default};
@@ -1 +1 @@
1
- const t={flex:{cardContent:"px-2 pb-4 pt-6 laptop:px-4 desktop:p-6",image:"size-[125px] laptop:size-[180px] lg-desktop:size-[240px]",imageOffset:"-top-6 -left-2 -right-2 laptop:-left-4 laptop:-right-4 desktop:-left-6 desktop:-right-6",title:"text-[14px] leading-tight laptop:mb-1 laptop:text-[20px] lg-desktop:text-[24px] line-clamp-3 laptop:line-clamp-2",description:"hidden text-[14px] desktop:text-[16px] lg-desktop:text-[18px] laptop:block laptop:line-clamp-2 leading-normal",price:"text-[14px] leading-tight laptop:text-[20px] lg-desktop:text-[24px]",priceLabel:"text-[12px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px]",cardRadius:"rounded-box-small tablet:rounded-box",priceGap:"gap-[2px] laptop:gap-1",discountBadgeSize:"size-12 laptop:size-20 lg-desktop:size-24",discountBadgeText:"text-xs laptop:text-base lg-desktop:text-xl pl-2 pt-1 laptop:pl-4 laptop:pt-2",discountBadgeTextStyle2:"text-xs laptop:text-base lg-desktop:text-xl pt-2 desktop:pt-4",discountBadgeTextStyle3:"text-xs laptop:text-base lg-desktop:text-xl flex items-center pl-1 laptop:pl-2",discountBadgeTextCenter:"text-xs laptop:text-base lg-desktop:text-xl flex items-center justify-center",buttonContainer:"flex-wrap gap-2 laptop:flex-nowrap lg-desktop:gap-3",buttonItem:"w-full whitespace-nowrap laptop:w-fit laptop:min-w-0 laptop:whitespace-normal laptop:text-center",memberLabelContainer:"p-2 laptop:px-4 laptop:py-3 desktop:pl-6 desktop:py-4 desktop:pr-12 lg-desktop:pr-16",memberLabelText:"text-xs laptop:text-sm desktop:text-base lg-desktop:text-[18px]"},horizontal:{cardContent:"p-4 desktop:p-6",image:"size-[180px] lg-desktop:size-[240px]",imageOffset:"-top-4 -left-4 -right-4 desktop:-top-6 desktop:-left-6 desktop:-right-6",title:"mb-1 text-[20px] leading-[120%] lg-desktop:text-[24px] line-clamp-2",description:"text-[14px] desktop:text-[16px] lg-desktop:text-[18px] line-clamp-2 leading-normal",price:"text-[20px] leading-[120%] lg-desktop:text-[24px]",priceLabel:"text-[14px] leading-[140%] desktop:text-[16px] lg-desktop:text-[18px]",cardRadius:"rounded-box",priceGap:"gap-1",discountBadgeSize:"size-20 lg-desktop:size-24",discountBadgeText:"text-base lg-desktop:text-xl pt-2 pl-4",discountBadgeTextStyle2:"text-base lg-desktop:text-xl pt-2 desktop:pt-4",discountBadgeTextStyle3:"text-base lg-desktop:text-xl flex items-center pl-1 laptop:pl-2",discountBadgeTextCenter:"text-base lg-desktop:text-xl flex items-center justify-center",buttonContainer:"gap-2 lg-desktop:gap-3",buttonItem:"w-full whitespace-nowrap tablet:w-fit tablet:min-w-0 tablet:whitespace-normal tablet:text-center",memberLabelContainer:"px-4 py-3 desktop:pl-6 desktop:py-4 desktop:pr-12 lg-desktop:pr-16",memberLabelText:"text-xs laptop:text-sm desktop:text-base lg-desktop:text-[18px]"}};export{t as layoutModeStyles};
1
+ const t={flex:{cardContent:"px-2 pb-4 pt-6 laptop:px-4 desktop:p-6 laptop:pt-6 desktop:pt-8 lg-desktop:pt-10",image:"size-[125px] laptop:size-[180px] lg-desktop:size-[240px]",imageOffset:"laptop:-top-6 desktop:-top-8 lg-desktop:-top-10 -left-2 -right-2 laptop:-left-4 laptop:-right-4 desktop:-left-6 desktop:-right-6",title:"text-[14px] leading-tight laptop:mb-1 laptop:text-[20px] lg-desktop:text-[24px] line-clamp-3 laptop:line-clamp-2",description:"hidden text-[14px] desktop:text-[16px] lg-desktop:text-[18px] laptop:block laptop:line-clamp-2 leading-normal",price:"text-[14px] leading-tight laptop:text-[20px] lg-desktop:text-[24px]",priceLabel:"text-[12px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px]",cardRadius:"rounded-box-small tablet:rounded-box",priceGap:"gap-[2px] laptop:gap-1",discountBadgeSize:"size-12 laptop:size-20 lg-desktop:size-24",discountBadgeText:"text-xs laptop:text-base lg-desktop:text-xl pl-2 pt-1 laptop:pl-4 laptop:pt-2",discountBadgeTextStyle2:"text-xs laptop:text-base lg-desktop:text-xl pt-2 desktop:pt-4",discountBadgeTextStyle3:"text-xs laptop:text-base lg-desktop:text-xl flex items-center pl-1 laptop:pl-2",discountBadgeTextCenter:"text-xs laptop:text-base lg-desktop:text-xl flex items-center justify-center",buttonContainer:"flex-wrap gap-2 laptop:flex-nowrap lg-desktop:gap-3",buttonItem:"w-full whitespace-nowrap laptop:w-fit laptop:min-w-0 laptop:whitespace-normal laptop:text-center",memberLabelContainer:"p-2 laptop:px-4 laptop:py-3 desktop:pl-6 desktop:py-4 desktop:pr-12 lg-desktop:pr-16",memberLabelText:"text-xs laptop:text-sm desktop:text-base lg-desktop:text-[18px]"},horizontal:{cardContent:"p-4 desktop:p-6 laptop:pt-6 desktop:pt-8 lg-desktop:pt-10",image:"size-[180px] lg-desktop:size-[240px]",imageOffset:"-top-4 -left-4 -right-4 laptop:-top-6 desktop:-top-8 lg-desktop:-top-10 desktop:-left-6 desktop:-right-6",title:"mb-1 text-[20px] leading-[120%] lg-desktop:text-[24px] line-clamp-2",description:"text-[14px] desktop:text-[16px] lg-desktop:text-[18px] line-clamp-2 leading-normal",price:"text-[20px] leading-[120%] lg-desktop:text-[24px]",priceLabel:"text-[14px] leading-[140%] desktop:text-[16px] lg-desktop:text-[18px]",cardRadius:"rounded-box",priceGap:"gap-1",discountBadgeSize:"size-20 lg-desktop:size-24",discountBadgeText:"text-base lg-desktop:text-xl pt-2 pl-4",discountBadgeTextStyle2:"text-base lg-desktop:text-xl pt-2 desktop:pt-4",discountBadgeTextStyle3:"text-base lg-desktop:text-xl flex items-center pl-1 laptop:pl-2",discountBadgeTextCenter:"text-base lg-desktop:text-xl flex items-center justify-center",buttonContainer:"gap-2 lg-desktop:gap-3",buttonItem:"w-full whitespace-nowrap tablet:w-fit tablet:min-w-0 tablet:whitespace-normal tablet:text-center",memberLabelContainer:"px-4 py-3 desktop:pl-6 desktop:py-4 desktop:pr-12 lg-desktop:pr-16",memberLabelText:"text-xs laptop:text-sm desktop:text-base lg-desktop:text-[18px]"}};export{t as layoutModeStyles};
@@ -1 +1 @@
1
- "use client";import{Fragment as b,jsx as s,jsxs as h}from"react/jsx-runtime";import T,{useImperativeHandle as V,useRef as C}from"react";import{Heading as k,Picture as x,Text as y,Button as z,Link as D,Container as H}from"../../components/index.js";import"../../shared/Styles.js";import{cn as a}from"../../helpers/utils.js";import{useExposure as P}from"../../hooks/useExposure.js";import{trackUrlRef as $}from"../../shared/trackUrlRef.js";import{cva as v}from"class-variance-authority";import{getLocalizedPath as A}from"../../helpers/index.js";import{useAiuiContext as w}from"../AiuiProvider/index.js";const m="image",u="activity_mechanism",M=v("line-clamp-2",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{theme:"light"}}),R=v("desktop:text-[16px] mt-1 line-clamp-2 text-[14px] font-bold leading-[1.4] tracking-[-0.02em]",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white/80"}},defaultVariants:{theme:"light"}}),L=v("mt-2 !p-0 text-[14px]",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{theme:"light"}}),f={default:767,tablet:1024,laptop:1439,desktop:1919,lgDesktop:9999},B=t=>{if(!t)return"";const e=[];return t.lgDesktop?.url&&e.push(`${t.lgDesktop.url}`),t.desktop?.url&&e.push(`${t.desktop.url} ${f.desktop}`),t.laptop?.url&&e.push(`${t.laptop.url} ${f.laptop}`),t.tablet?.url&&e.push(`${t.tablet.url} ${f.tablet}`),t.default?.url&&e.push(`${t.default.url} ${f.default}`),e.join(", ")},E=t=>t&&(t.default?.alt||t.tablet?.alt||t.laptop?.alt||t.desktop?.alt||t.lgDesktop?.alt)||"",S=({item:t,theme:e,classNames:l})=>{const{title:i,description:p,linkText:o,linkHref:n,backgroundImage:c}=t,r=B(c),d=E(c),{locale:g="us"}=w();return s("div",{className:a("rounded-card relative flex flex-col overflow-hidden","desktop:px-6 h-[280px] p-4","laptop:gap-4 gap-3","laptop:h-[320px] lg-desktop:[400px]",l?.card),"data-headless-type-name":`${m}#${u}`,children:n?h(D,{href:A($(n,`${m}_${u}`),g),className:"no-underline",children:[r&&s(x,{source:r,alt:d||i,className:a("absolute inset-0 size-full",l?.background),imgClassName:"size-full object-cover"}),h("div",{className:"relative z-10",children:[s(k,{as:"h3",size:3,className:a(M({theme:e}),l?.title),children:i}),s(y,{as:"p",className:a(R({theme:e}),l?.description),children:p}),o&&s(z,{variant:"link",as:"a",href:A($(n,`${m}_${u}`),g),className:a(L({theme:e}),l?.link),"data-headless-title-desc-button":`${i}#${p}#${o}`,children:o})]})]}):h(b,{children:[r&&s(x,{source:r,alt:d||i,className:a("absolute inset-0 size-full",l?.background),imgClassName:"size-full object-cover"}),h("div",{className:"relative z-10",children:[s(k,{as:"h3",size:3,className:a(M({theme:e}),l?.title),children:i}),s(y,{as:"p",className:a(R({theme:e}),l?.description),children:p})]})]})})},N=T.forwardRef(({data:t,classNames:e},l)=>{const{items:i=[],theme:p="light"}=t,o=C(null);if(V(l,()=>o.current),P(o,{componentType:m,componentName:u,componentTitle:i[0]?.title||"",componentDescription:i[0]?.description||""}),!i||i.length===0)return null;const n={1:"laptop:grid-cols-1 desktop:grid-cols-1 lg-desktop:grid-cols-1",2:"laptop:grid-cols-2 desktop:grid-cols-2 lg-desktop:grid-cols-2",3:"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-3 lg-desktop:grid-cols-3",4:"laptop:grid-cols-4 desktop:grid-cols-4 lg-desktop:grid-cols-4"},c=n[Math.min(i.length,4)]||n[4];return s(H,{"data-ui-component-id":"ActivityMechanism",className:a("activity-mechanism","w-full",e?.root),ref:o,children:s("div",{className:a("tablet:grid-cols-2 laptop:gap-4 grid grid-cols-1 gap-3",c,e?.grid),children:i.map((r,d)=>s(S,{item:r,theme:p,classNames:{...e,...i?.length===3&&{card:e?.card+" first:tablet:col-span-full first:laptop:col-span-1"}}},`${r.title}-${d}`))})})});N.displayName="ActivityMechanism";var W=N;export{W as default};
1
+ "use client";import{Fragment as b,jsx as s,jsxs as h}from"react/jsx-runtime";import T,{useImperativeHandle as V,useRef as C}from"react";import{Heading as k,Picture as x,Text as y,Button as z,Link as D,Container as H}from"../../components/index.js";import"../../shared/Styles.js";import{cn as a}from"../../helpers/utils.js";import{useExposure as P}from"../../hooks/useExposure.js";import{trackUrlRef as $}from"../../shared/trackUrlRef.js";import{cva as v}from"class-variance-authority";import{getLocalizedPath as A}from"../../helpers/index.js";import{useAiuiContext as w}from"../AiuiProvider/index.js";const m="image",u="activity_mechanism",M=v("line-clamp-2",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{theme:"light"}}),R=v("desktop:text-[16px] mt-1 line-clamp-2 text-[14px] font-bold leading-[1.4] tracking-[-0.02em]",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white/80"}},defaultVariants:{theme:"light"}}),L=v("mt-2 !p-0 text-[14px]",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{theme:"light"}}),f={default:767,tablet:1024,laptop:1439,desktop:1919,lgDesktop:9999},B=t=>{if(!t)return"";const e=[];return t.lgDesktop?.url&&e.push(`${t.lgDesktop.url}`),t.desktop?.url&&e.push(`${t.desktop.url} ${f.desktop}`),t.laptop?.url&&e.push(`${t.laptop.url} ${f.laptop}`),t.tablet?.url&&e.push(`${t.tablet.url} ${f.tablet}`),t.default?.url&&e.push(`${t.default.url} ${f.default}`),e.join(", ")},E=t=>t&&(t.default?.alt||t.tablet?.alt||t.laptop?.alt||t.desktop?.alt||t.lgDesktop?.alt)||"",S=({item:t,theme:e,classNames:l})=>{const{title:i,description:p,linkText:o,linkHref:n,backgroundImage:c}=t,r=B(c),d=E(c),{locale:g="us"}=w();return s("div",{className:a("rounded-card relative flex flex-col overflow-hidden","desktop:px-6 h-[280px] p-4","laptop:gap-4 gap-3","laptop:h-[320px] lg-desktop:h-[400px]",l?.card),"data-headless-type-name":`${m}#${u}`,children:n?h(D,{href:A($(n,`${m}_${u}`),g),className:"no-underline",children:[r&&s(x,{source:r,alt:d||i,className:a("absolute inset-0 size-full",l?.background),imgClassName:"size-full object-cover"}),h("div",{className:"relative z-10",children:[s(k,{as:"h3",size:3,className:a(M({theme:e}),l?.title),children:i}),s(y,{as:"p",className:a(R({theme:e}),l?.description),children:p}),o&&s(z,{variant:"link",as:"a",href:A($(n,`${m}_${u}`),g),className:a(L({theme:e}),l?.link),"data-headless-title-desc-button":`${i}#${p}#${o}`,children:o})]})]}):h(b,{children:[r&&s(x,{source:r,alt:d||i,className:a("absolute inset-0 size-full",l?.background),imgClassName:"size-full object-cover"}),h("div",{className:"relative z-10",children:[s(k,{as:"h3",size:3,className:a(M({theme:e}),l?.title),children:i}),s(y,{as:"p",className:a(R({theme:e}),l?.description),children:p})]})]})})},N=T.forwardRef(({data:t,classNames:e},l)=>{const{items:i=[],theme:p="light"}=t,o=C(null);if(V(l,()=>o.current),P(o,{componentType:m,componentName:u,componentTitle:i[0]?.title||"",componentDescription:i[0]?.description||""}),!i||i.length===0)return null;const n={1:"laptop:grid-cols-1 desktop:grid-cols-1 lg-desktop:grid-cols-1",2:"laptop:grid-cols-2 desktop:grid-cols-2 lg-desktop:grid-cols-2",3:"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-3 lg-desktop:grid-cols-3",4:"laptop:grid-cols-4 desktop:grid-cols-4 lg-desktop:grid-cols-4"},c=n[Math.min(i.length,4)]||n[4];return s(H,{"data-ui-component-id":"ActivityMechanism",className:a("activity-mechanism","w-full",e?.root),ref:o,children:s("div",{className:a("tablet:grid-cols-2 laptop:gap-4 grid grid-cols-1 gap-3",c,e?.grid),children:i.map((r,d)=>s(S,{item:r,theme:p,classNames:{...e,...i?.length===3&&{card:e?.card+" first:tablet:col-span-full first:laptop:col-span-1"}}},`${r.title}-${d}`))})})});N.displayName="ActivityMechanism";var W=N;export{W as default};
@@ -1 +1 @@
1
- "use client";import{Fragment as g,jsx as e,jsxs as i}from"react/jsx-runtime";import{cn as o}from"../../helpers/utils.js";import c from"../SwiperBox/index.js";import{withLayout as f}from"../../shared/Styles.js";import{Grid as u,GridItem as x}from"../../components/grid.js";import{Picture as d,Text as s}from"../../components/index.js";const v=({data:t,configuration:a})=>e("div",{className:o("creativeModuleItem","text-info-primary aspect-h-[360] aspect-w-[296] relative flex-1 shrink-0 overflow-hidden md:basis-[296px]","rounded-box",{"aiui-dark":t.theme==="dark"}),children:i("div",{className:"absolute inset-0",children:[e(d,{className:"h-full",imgClassName:"h-full object-cover",source:t?.mobileImg?.url||t?.img?.url,alt:t?.mobileImg?.alt||t?.img?.alt||""}),i("div",{className:"z-1 absolute inset-x-0 bottom-4 box-border flex w-full flex-col overflow-hidden px-4",children:[e(s,{html:t?.title,className:"graphic-title truncate text-xl font-bold leading-[1.2]"}),t?.description&&e(s,{html:t?.description,className:"graphic-title line-clamp-2 text-sm font-bold leading-[1.2]"})]})]})}),b=({data:t,className:a,...p})=>{const{productsTab:r,shape:m}=t;return i(g,{children:[e("div",{...p,className:o("creativeModuleBlock","laptop:block box-border hidden w-full overflow-hidden",a),children:e(u,{className:o("tablet:gap-4 grid grid-cols-12 gap-3 ",a),children:r?.map((l,n)=>i(x,{span:l.span,className:o("text-info-primary relative w-full overflow-hidden","rounded-box","lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[288px]",{"aiui-dark":l.theme==="dark"}),children:[e(d,{source:l.img.url,className:"size-full",imgClassName:"h-full object-cover"}),i("div",{className:"lg-desktop:bottom-8 lg-desktop:px-8 desktop:bottom-6 desktop:px-6 absolute inset-x-0 bottom-4 flex flex-col gap-[6px] overflow-hidden px-4",children:[l.title&&e(s,{html:l.title,as:"p",className:"desktop:text-[32px] laptop:text-2xl line-clamp-2 text-xl font-bold"}),l.description&&e(s,{html:l.description,className:"desktop:text-lg line-clamp-2 text-sm font-bold"})]})]},n))})}),e("div",{className:"laptop:hidden block w-full",children:e(c,{id:"CreativeModule",className:o("!overflow-visible",a),data:{list:r||[],configuration:{shape:m}},Slide:v,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3}}})})]})};var y=f(b);export{y as default};
1
+ "use client";import{Fragment as b,jsx as e,jsxs as i}from"react/jsx-runtime";import{cn as o}from"../../helpers/utils.js";import c from"../SwiperBox/index.js";import{withLayout as f}from"../../shared/Styles.js";import{Grid as u,GridItem as x}from"../../components/grid.js";import{Picture as d,Text as s}from"../../components/index.js";const g=({data:t,configuration:a})=>e("div",{className:o("creativeModuleItem","text-info-primary aspect-h-[360] aspect-w-[296] relative flex-1 shrink-0 overflow-hidden md:basis-[296px]","rounded-box",{"aiui-dark":t.theme==="dark"}),children:i("div",{className:"absolute inset-0",children:[e(d,{className:"h-full",imgClassName:"h-full object-cover",source:t?.mobileImg?.url||t?.img?.url,alt:t?.mobileImg?.alt||t?.img?.alt||""}),i("div",{className:"z-1 absolute inset-x-0 bottom-4 box-border flex w-full flex-col overflow-hidden px-4",children:[e(s,{html:t?.title,className:"graphic-title truncate text-xl font-bold leading-[1.2]"}),t?.description&&e(s,{html:t?.description,className:"graphic-title line-clamp-2 text-sm font-bold leading-[1.2]"})]})]})}),v=({data:t,className:a,...p})=>{const{productsTab:r,shape:m}=t;return i(b,{children:[e("div",{...p,className:o("creativeModuleBlock","laptop:block box-border hidden w-full overflow-hidden",a),children:e(u,{className:o("tablet:gap-4 grid grid-cols-12 gap-3 ",a),children:r?.map((l,n)=>i(x,{span:l.span,className:o("text-info-primary relative w-full overflow-hidden","rounded-box","lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[288px]",{"aiui-dark":l.theme==="dark"}),children:[e(d,{source:l.img.url,className:"size-full",imgClassName:"h-full object-cover"}),i("div",{className:"lg-desktop:bottom-8 lg-desktop:px-8 desktop:bottom-6 desktop:px-6 absolute inset-x-0 bottom-4 flex flex-col gap-[6px] overflow-hidden px-4",children:[l.title&&e(s,{html:l.title,as:"p",className:"desktop:text-[32px] laptop:text-2xl line-clamp-2 text-xl font-bold !leading-tight"}),l.description&&e(s,{html:l.description,className:"desktop:text-lg line-clamp-2 text-sm font-bold !leading-normal"})]})]},n))})}),e("div",{className:"laptop:hidden block w-full",children:e(c,{id:"CreativeModule",className:o("!overflow-visible",a),data:{list:r||[],configuration:{shape:m}},Slide:g,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3}}})})]})};var y=f(v);export{y as default};
@@ -1 +1 @@
1
- import{PRICE_SYMBOL as l}from"../const.js";function S(e){return e.reduce((n,t)=>(n[t.name]=t.values[0].label,n),{})}const b=e=>e.variants.find(n=>n.availableForSale)||e.variants[0],E=(e,n)=>e.variants.find(t=>t.sku===n),f={us:"en-US",uk:"en-GB",ca:"en-CA",au:"AU","eu-en":"en","eu-fr":"fr-FR",fr:"FR","ca-fr":"FR","nl-fr":"FR",my:"MY",it:"IT",vn:"VN",es:"es-ES","eu-it":"it-IT","eu-de":"de-DE",de:"de-DE","eu-es":"es-ES","cz-en":"en-CZ",nl:"nl-NL","dk-en":"en-DK","gr-en":"en-GR","mk-en":"en-MK","hu-en":"en-HU","se-en":"en-SE","hr-en":"en-HR","bg-en":"en-BG","ee-en":"en-EE","fi-en":"en-FI","lt-en":"en-LT",pl:"pl-PL","ro-en":"en-RO","si-en":"en-SI","sk-en":"en-SK","no-en":"en-NO","ad-en":"en-AD","al-en":"en-AL","ba-en":"en-BA","me-en":"en-ME","rs-en":"en-RS","gl-en":"en-GL","is-en":"en-IS","ua-en":"en-UA","by-en":"en-BY","md-en":"en-MD","lv-en":"en-LV","at-de":"de-AT","lu-de":"de-LU","li-de":"de-LI","va-it":"it-VA","sm-it":"it-SM","be-nl":"nl-BE","ae-en":"en-AE",nz:"en-NZ","sg-en":"en-SG","sa-en":"en-SA","vn-vi":"vi-VN",ie:"en-IE",tw:"zh-TW"},m=e=>(f[e]||console.warn(`[formatPrice] Unknown locale "${e}", falling back to en-US`),f[e]||"en-US");function p({amount:e,currencyCode:n,locale:t,maximumFractionDigits:r,minimumFractionDigits:a,removeTrailingZeros:i=!1}){const s=n?.trim()||"USD",c=m(t);let u;try{u=new Intl.NumberFormat(c,{style:"currency",currency:s,minimumFractionDigits:r===0?0:a,maximumFractionDigits:r})}catch{u=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:r===0?0:a,maximumFractionDigits:r})}let o=u.format(e);return["de-DE","fr-FR","it-IT","es-ES","de-AT","de-LU","de-LI","nl-BE","pl-PL","vi-VN"].includes(c)&&(o=o?.toString()?.replace(/[\s\u00A0\u202F]/g,"")),i&&(o=o.replace(/(\.\d*?[1-9])0+\b/,"$1").replace(/\.0+\b/,"").replace(/(\,\d*?[1-9])0+\b/,"$1").replace(/\,0+\b/,"")),o}function L({amount:e,baseAmount:n,currencyCode:t,locale:r,maximumFractionDigits:a,minimumFractionDigits:i,removeTrailingZeros:s}){if(typeof Intl>"u")return{price:`${l[r]}${e}`,basePrice:`${l[r]}${n}`,discount:`${l[r]}${n-e||0}`};const c=n>e,u=new Intl.NumberFormat(m(r),{style:"percent"}),o=c?u.format((n-e)/n):null,d=p({amount:e,currencyCode:t,locale:r,removeTrailingZeros:s}),y=c?p({amount:n,currencyCode:t,locale:r,maximumFractionDigits:a,minimumFractionDigits:i,removeTrailingZeros:s}):void 0;return{price:d,basePrice:y,discount:o}}function I({product:e,selectedOptions:n}){return e.variants.find(t=>Object.entries(n).every(([r,a])=>t.options.find(i=>{if(i.__typename==="MultipleChoiceOption"&&i.name===r)return i.values.find(s=>s.label===a)})))}export{p as formatPrice,L as formatVariantPrice,b as getFirstAvailableVariant,E as getVariantBySku,I as getVariantFromSelectedOptions,f as languageMap,m as languageTerritory,S as optionsConstructor};
1
+ import{PRICE_SYMBOL as l}from"../const.js";function S(e){return e.reduce((n,t)=>(n[t.name]=t.values[0].label,n),{})}const b=e=>e.variants.find(n=>n.availableForSale)||e.variants[0],E=(e,n)=>e.variants.find(t=>t.sku===n),f={us:"en-US",uk:"en-GB",ca:"en-CA",au:"AU","eu-en":"en","eu-fr":"fr-FR",fr:"FR","ca-fr":"FR","nl-fr":"FR",my:"MY",it:"IT",vn:"VN",es:"es-ES","eu-it":"it-IT","eu-de":"de-DE",de:"de-DE","eu-es":"es-ES","cz-en":"en-CZ",nl:"nl-NL","dk-en":"en-DK","gr-en":"en-GR","mk-en":"en-MK","hu-en":"en-HU","se-en":"en-SE","hr-en":"en-HR","bg-en":"en-BG","ee-en":"en-EE","fi-en":"en-FI","lt-en":"en-LT",pl:"pl-PL","ro-en":"en-RO","si-en":"en-SI","sk-en":"en-SK","no-en":"en-NO","ad-en":"en-AD","al-en":"en-AL","ba-en":"en-BA","me-en":"en-ME","rs-en":"en-RS","gl-en":"en-GL","is-en":"en-IS","ua-en":"en-UA","by-en":"en-BY","md-en":"en-MD","lv-en":"en-LV","at-de":"de-AT","lu-de":"de-LU","li-de":"de-LI","va-it":"it-VA","sm-it":"it-SM","be-nl":"nl-BE","ae-en":"en-AE",nz:"en-NZ","sg-en":"en-SG","sa-en":"en-SA","vn-vi":"vi-VN",ie:"en-IE",tw:"zh-TW",be:"nl-BE"},m=e=>(f[e]||console.warn(`[formatPrice] Unknown locale "${e}", falling back to en-US`),f[e]||"en-US");function p({amount:e,currencyCode:n,locale:t,maximumFractionDigits:r,minimumFractionDigits:a,removeTrailingZeros:i=!1}){const s=n?.trim()||"USD",c=m(t);let u;try{u=new Intl.NumberFormat(c,{style:"currency",currency:s,minimumFractionDigits:r===0?0:a,maximumFractionDigits:r})}catch{u=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:r===0?0:a,maximumFractionDigits:r})}let o=u.format(e);return["de-DE","fr-FR","it-IT","es-ES","de-AT","de-LU","de-LI","pl-PL","vi-VN"].includes(c)&&(o=o?.toString()?.replace(/[\s\u00A0\u202F]/g,"")),i&&(o=o.replace(/(\.\d*?[1-9])0+\b/,"$1").replace(/\.0+\b/,"").replace(/(\,\d*?[1-9])0+\b/,"$1").replace(/\,0+\b/,"")),o}function L({amount:e,baseAmount:n,currencyCode:t,locale:r,maximumFractionDigits:a,minimumFractionDigits:i,removeTrailingZeros:s}){if(typeof Intl>"u")return{price:`${l[r]}${e}`,basePrice:`${l[r]}${n}`,discount:`${l[r]}${n-e||0}`};const c=n>e,u=new Intl.NumberFormat(m(r),{style:"percent"}),o=c?u.format((n-e)/n):null,d=p({amount:e,currencyCode:t,locale:r,removeTrailingZeros:s}),y=c?p({amount:n,currencyCode:t,locale:r,maximumFractionDigits:a,minimumFractionDigits:i,removeTrailingZeros:s}):void 0;return{price:d,basePrice:y,discount:o}}function I({product:e,selectedOptions:n}){return e.variants.find(t=>Object.entries(n).every(([r,a])=>t.options.find(i=>{if(i.__typename==="MultipleChoiceOption"&&i.name===r)return i.values.find(s=>s.label===a)})))}export{p as formatPrice,L as formatVariantPrice,b as getFirstAvailableVariant,E as getVariantBySku,I as getVariantFromSelectedOptions,f as languageMap,m as languageTerritory,S as optionsConstructor};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anker-in/headless-ui",
3
- "version": "1.3.72",
3
+ "version": "1.3.73",
4
4
  "type": "commonjs",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "types": "./dist/cjs/index.d.ts",
package/style.css CHANGED
@@ -3925,6 +3925,12 @@ video {
3925
3925
  .\!leading-\[1\.4\] {
3926
3926
  line-height: 1.4 !important;
3927
3927
  }
3928
+ .\!leading-normal {
3929
+ line-height: var(--line-height-normal) !important;
3930
+ }
3931
+ .\!leading-tight {
3932
+ line-height: var(--line-height-tight) !important;
3933
+ }
3928
3934
  .leading-4 {
3929
3935
  line-height: 1rem;
3930
3936
  }
@@ -6140,6 +6146,9 @@ video {
6140
6146
  .laptop\:-right-4 {
6141
6147
  right: -1rem;
6142
6148
  }
6149
+ .laptop\:-top-6 {
6150
+ top: -1.5rem;
6151
+ }
6143
6152
  .laptop\:bottom-6 {
6144
6153
  bottom: 1.5rem;
6145
6154
  }
@@ -7069,6 +7078,9 @@ video {
7069
7078
  .laptop\:pb-1 {
7070
7079
  padding-bottom: 0.25rem;
7071
7080
  }
7081
+ .laptop\:pb-2 {
7082
+ padding-bottom: 0.5rem;
7083
+ }
7072
7084
  .laptop\:pb-3 {
7073
7085
  padding-bottom: 0.75rem;
7074
7086
  }
@@ -7408,8 +7420,8 @@ video {
7408
7420
  .desktop\:-right-6 {
7409
7421
  right: -1.5rem;
7410
7422
  }
7411
- .desktop\:-top-6 {
7412
- top: -1.5rem;
7423
+ .desktop\:-top-8 {
7424
+ top: -2rem;
7413
7425
  }
7414
7426
  .desktop\:bottom-6 {
7415
7427
  bottom: 1.5rem;
@@ -7469,6 +7481,9 @@ video {
7469
7481
  .desktop\:mb-2 {
7470
7482
  margin-bottom: 0.5rem;
7471
7483
  }
7484
+ .desktop\:mb-4 {
7485
+ margin-bottom: 1rem;
7486
+ }
7472
7487
  .desktop\:mr-3 {
7473
7488
  margin-right: 0.75rem;
7474
7489
  }
@@ -8092,6 +8107,9 @@ video {
8092
8107
  .desktop\:pt-6 {
8093
8108
  padding-top: 1.5rem;
8094
8109
  }
8110
+ .desktop\:pt-8 {
8111
+ padding-top: 2rem;
8112
+ }
8095
8113
  .desktop\:pt-\[112px\] {
8096
8114
  padding-top: 112px;
8097
8115
  }
@@ -8176,6 +8194,9 @@ video {
8176
8194
  .lg-desktop\:\!bottom-6 {
8177
8195
  bottom: 1.5rem !important;
8178
8196
  }
8197
+ .lg-desktop\:-top-10 {
8198
+ top: -2.5rem;
8199
+ }
8179
8200
  .lg-desktop\:bottom-8 {
8180
8201
  bottom: 2rem;
8181
8202
  }
@@ -8783,6 +8804,9 @@ video {
8783
8804
  .lg-desktop\:pr-16 {
8784
8805
  padding-right: 4rem;
8785
8806
  }
8807
+ .lg-desktop\:pt-10 {
8808
+ padding-top: 2.5rem;
8809
+ }
8786
8810
  .lg-desktop\:pt-4 {
8787
8811
  padding-top: 1rem;
8788
8812
  }