'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),common=require("./utils/common.js");require("./constants.js");var NoDataState=require("../../../common/components/NoDataState.js"),TooltipHover=require("../../../common/components/TooltipHover.js"),system=require("@gem-sdk/system"),attrs=require("./common/attrs.js"),classes=require("./common/classes.js"),styles=require("./common/styles.js");const ProductBadge=e=>{let{setting:s,styles:t,children:r,...a}=e,l=core.useProduct(),c=core.useCurrentVariant(),{moneyFormat:o}=core.useMoneyFormat(),n=core.useCurrentDevice(),{useProductCompareAtPrice:m}=core.useProductBundleDiscount(),i=a?.["bundle-item"],y=core.useEditorMode(),u="STATIC"===core.usePageType(),d=common.getBadgeContent({detail:l,currentVariant:c,bundleItem:i,useProductCompareAtPrice:m},s?.displayContent,o),g=common.getIsNoDiscountState({props:e,product:l,currentVariant:c,moneyFormat:o,useProductCompareAtPrice:m}),j=system.createClass({...classes.getContainerClasses({mode:y,isInstant:u,product:l,currentVariant:c,props:e})}),x=system.createStyle({...styles.getContainerStyle(e)}),C=system.createAttr({...attrs.getEditTooltipAttrs(e)}),p=system.createAttr({...attrs.getNoDataAttrs(e)}),S=system.createClass({...classes.getWrapperClasses(e)}),v=system.createClass({...classes.getSubWrapperClass(e,n)}),T=system.createStyle({...styles.getSubWrapperStyle(e,l,c,y)}),A=system.createAttr({...attrs.getSubWrapperAttrs(e,l)}),N=styles.getContentStyleInternal(e),R=system.createClass({...classes.getTextContainerClasses()}),h=system.createAttr({...attrs.getContainerAttrs(e)}),q=system.createClass({...classes.getTextWrapperClasses()}),I=system.createStyle({...styles.getTextBadgeWrapperStyles({setting:s,styles:t})}),f=system.createClass({...classes.getTextContentClasses(t)}),D=system.createStyle({...styles.getTextContentStyle({setting:s,styles:t})}),P=system.createAttr({...attrs.getTextContentAttrs()}),b=system.createClass({...classes.getImageContainerClasses()}),W=system.createStyle({...styles.getImageContainerStyles({setting:s,styles:t})}),B=system.createClass({...classes.getImageClasses()}),H=system.createAttr({...attrs.getImageAttr({setting:s})});return l?jsxRuntime.jsxs("div",{...h,style:x,className:j,children:[system.If("edit"===y&&g,jsxRuntime.jsx(TooltipHover.default,{...C,children:jsxRuntime.jsx(NoDataState.default,{...p})}),jsxRuntime.jsx("div",{className:S,children:jsxRuntime.jsxs("div",{...A,className:v,style:T,children:[jsxRuntime.jsx("style",{children:N}),system.If(s?.shape!=="image",jsxRuntime.jsx("div",{className:R,children:jsxRuntime.jsx("div",{className:q,style:I,children:jsxRuntime.jsx("pre",{...P,className:f,style:D,children:d})})}),jsxRuntime.jsx("div",{className:b,style:W,children:jsxRuntime.jsx("img",{...H,className:B,alt:""})}))]})})),core.filterToolbarPreview(r,!0)]}):null};exports.default=ProductBadge;
