'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("@gem-sdk/core"),t=require("../../text/components/Text.js"),r=require("../hooks/useDynamicProduct.js"),u=require("@gem-sdk/system"),i=require("../common/attrs.js"),o=require("../common/classes.js"),c=require("../common/styles.js"),a=require("../common/helpers.js");exports.default=({setting:n={},styles:d={},style:l,builderAttrs:m,builderProps:y,children:j})=>{let g=s.useProduct(),q=g?.baseID?.replace("gid://shopify/Product/",""),x=s.useProductOfferDiscount(),{isDynamicProduct:p,isEnableDynamicDiscount:f}=r.useDynamicProduct(),{typo:P,direction:C,textAlign:h,align:D,width:k}=d,{message:v}=n,S=!!x||p&&f,b=u.createClass({...o.getContainerClasses({uid:y?.uid})}),A=u.createAttr({...i.getContainerAttrs({currentProductId:q,uid:y?.uid})}),O=u.createStyle({...c.getContainerStyles({style:l,hasDiscount:S})}),T=a.getTextSettings({hasDiscount:S,message:v});return e.jsxs("div",{...A,className:b,style:O,children:[e.jsx(t.default,{setting:T,styles:{typo:P,direction:C,textAlign:h,align:D,width:k}}),j]})};
