import{useEffect as e}from"react";import{usePageStore as t}from"@gem-sdk/core";let i=({productId:i,elementUid:r,isSubscription:o,hasNoSellingPlanOptions:s,isDynamicProduct:c})=>{let u=t(e=>e.setSubscriptionVisible),l=t(e=>e.getSubscriptionVisible);e(()=>{if(!i||!o)return;let e=`${r}-${i}`,t=!(s||c),n=l()??{};if(!t){u({...n,[i]:(n[i]??[]).filter(t=>t!==e)});return}u({...n,[i]:[...n[i]??[],e]})},[r,l,s,c,o,i,u])};export{i as useCheckProductsSubscriptionExistence};
