"use strict";var e=require("react");exports.useSellingPlanChange=({defaultValue:l,selectedSellingPlan:t,setSelectedSellingPlan:r,sellingPlanOptions:u})=>{let n=e.useRef(!0);e.useEffect(()=>{if(n.current){if(!t){let e=l||u[0]?.value||"";e&&r(e)}n.current=!1;return}if(t){let e=u.some(e=>e.value===t);if(!e&&u.length>0){let e=l||u[0]?.value||"";e&&r(e)}}},[l,u,t,r]);let a=t||l||u[0]?.value||"";return{selectedValue:a,handleSellingPlanChange:e=>{r(e)}}};
