'use client';
import{jsxs as e,jsx as m}from"react/jsx-runtime";import{useProduct as s,useCurrentVariant as o,useMoneyFormat as t,useCurrentDevice as r,useProductBundleDiscount as l,useEditorMode as i,useRenderMode as a,usePageType as c,filterToolbarPreview as n}from"@gem-sdk/core";import{getBadgeContent as d,getIsNoDiscountState as p}from"./utils/common.js";import"./constants.js";import f from"../../../common/components/NoDataState.js";import h from"../../../common/components/TooltipHover.js";import{createClass as y,createStyle as N,createAttr as j,If as u}from"@gem-sdk/system";import{getEditTooltipAttrs as v,getNoDataAttrs as g,getSubWrapperAttrs as T,getContainerAttrs as k,getTextContentAttrs as x,getImageAttr as B}from"./common/attrs.js";import{getContainerClasses as C,getWrapperClasses as P,getSubWrapperClass as S,getTextContainerClasses as b,getTextWrapperClasses as A,getTextContentClasses as D,getImageContainerClasses as H,getImageClasses as I}from"./common/classes.js";import{getContainerStyle as q,getSubWrapperStyle as w,getContentStyleInternal as z,getTextBadgeWrapperStyles as E,getTextContentStyle as F,getImageContainerStyles as G}from"./common/styles.js";let ProductBadge=J=>{let{setting:K,styles:L,children:M,...O}=J,Q=s(),R=o(),{moneyFormat:U}=t(),V=r(),{useProductCompareAtPrice:W}=l(),X=O?.["bundle-item"],Y=i(),{isEditMode:Z}=a(),$="STATIC"===c(),_=d({detail:Q,currentVariant:R,bundleItem:X,useProductCompareAtPrice:W},K?.displayContent,U),ee=p({props:J,product:Q,currentVariant:R,moneyFormat:U,useProductCompareAtPrice:W}),em=y({...C({mode:Y,isInstant:$,product:Q,currentVariant:R,props:J})}),es=N({...q(J)}),eo=j({...v(J)}),et=j({...g(J)}),er=y({...P(J)}),el=y({...S(J,V)}),ei=N({...w({props:J,product:Q,currentVariant:R,isEditMode:Z})}),ea=j({...T(J,Q)}),ec=z(J),en=y({...b()}),ed=j({...k(J)}),ep=y({...A()}),ef=N({...E({setting:K,styles:L})}),eh=y({...D(L)}),ey=N({...F({setting:K,styles:L})}),eN=j({...x()}),ej=y({...H()}),eu=N({...G({setting:K,styles:L})}),ev=y({...I()}),eg=j({...B({setting:K})});return Q?e("div",{...ed,style:es,className:em,children:[u(Z&&ee,m(h,{...eo,children:m(f,{...et})}),m("div",{className:er,children:e("div",{...ea,className:el,style:ei,children:[m("style",{children:ec}),u(K?.shape!=="image",m("div",{className:en,children:m("div",{className:ep,style:ef,children:m("pre",{...eN,className:eh,style:ey,children:_})})}),m("div",{className:ej,style:eu,children:m("img",{...eg,className:ev,alt:""})}))]})})),n(M,!0)]}):null};export{ProductBadge as default};
