"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("@gem-sdk/system"),r=require("../common/styles.js"),t=require("../common/classes.js"),l=require("../common/helpers.js"),a=require("@gem-sdk/core"),i=require("./PostPurchaseCheckbox.js"),o=require("../hooks/useBuyerConsentChecked.js");exports.default=({styles:c,builderProps:n,setting:d,builderAttrs:u,style:y,children:m})=>{let{isEditMode:h}=a.useRenderMode(),C=a.useProduct(),{checked:g,setChecked:p}=o.useBuyerConsentChecked(),j=a.usePageStore(e=>e.subscriptionVisible),{description:k,policyLabel:x,policyLink:b,align:S}=d??{},q=C?.id?`buyer-consent-product-${n?.uid}-${C.id}`:void 0,f=l.getComponentTag(b),v=s.createStyle(r.getWrapperStyles({styles:c})),N=s.createClass(t.getWrapperClassName({align:S,uid:n?.uid})),P=s.createStyle(r.getContainerStyles({styles:c})),T=s.createClass(t.getCheckboxContainerClassName()),_=s.createStyle(r.getTextStyle({styles:c})),B=s.createClass(t.getLinkComponentClassName()),L=s.createStyle(t.getLinkComponentStyles()),M=!h&&!j?.[C?.id??""]?.length;return M?null:e.jsxs("div",{...u,style:{...y},children:[e.jsx("div",{"data-id":n?.uid,style:v,className:N,children:e.jsxs("label",{htmlFor:q,dir:c?.direction??"ltr",style:P,className:T,children:[e.jsx(i.default,{id:q,name:q,type:"checkbox",checked:g,onChange:e=>{p(e.target.checked)}}),e.jsxs("bdo",{dir:c?.direction??"ltr",style:_,children:[k," ",e.jsx(f,{target:"_blank",rel:"noreferrer",href:b,className:B,style:L,children:x})]})]})}),a.filterToolbarPreview(m,!0)]})};
