"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),ProductSubscriptionContent=require("./components/ProductSubscriptionContent.js"),OneTimePurchaseTooltip=require("./components/OneTimePurchaseTooltip.js"),useProductSubscriptionContentData=require("./hooks/useProductSubscriptionContentData.js");const ProductSubscription=({styles:e,setting:t,builderProps:i,builderAttrs:s,style:r,children:n})=>{let{isEditMode:o}=core.useRenderMode(),u=system.createStyle({...r}),c=useProductSubscriptionContentData.useProductSubscriptionContentData({setting:t,styles:e,builderProps:i});return c.visibility.isOneTimeHidden||c.visibility.hasNoSellingPlanOptions||c.isDynamicProduct?jsxRuntime.jsxs("div",{...s,style:u,children:[o&&jsxRuntime.jsx(OneTimePurchaseTooltip.OneTimePurchaseTooltip,{ref:c.componentRef,setting:t}),core.filterToolbarPreview(n,!0)]}):c.visibility.isOnetimeOnly&&!o?"":jsxRuntime.jsxs("div",{...s,style:u,children:[jsxRuntime.jsx("div",{ref:c.componentRef,dir:c.direction,"data-selling-type":t?.sellingType,id:c.componentId,className:c.wrapperClasses,style:c.subscriptionWrapperStyles,children:jsxRuntime.jsx(ProductSubscriptionContent.ProductSubscriptionContent,{data:c,setting:t,styles:e,builderProps:i})}),core.filterToolbarPreview(n,!0)]})};exports.default=ProductSubscription;
