'use strict';
import { internalTableColumnTypes } from '../table-models.js';
import { fetchResource } from '../../resource-providers.js';
import { fetchResourceMeta } from '../../meta-providers.js';
import { resourceNames } from '../../../../fd-toolbox/resources/resource-names.js';
import { fetchActiveOrTrialSubscription } from '../../subscription-plan/fetch-active-or-trial-subscription.js';

var __defProp=Object['defineProperty'],__name=(_0x166e3e,_0x2b5c90)=>__defProp(_0x166e3e,'name',{'value':_0x2b5c90,'configurable':!![]});async function onInitTableHeader(_0x469971,_0x5054c5){if(_0x469971['internalTableColumn']['type']===internalTableColumnTypes['customHeaderAction']){const _0x4b9605=await fetchActiveOrTrialSubscription(),_0x462dd4=_0x4b9605?.['pricing']?.['paymentPlanId'];if(_0x462dd4){const _0x55b699=await fetchResourceMeta(resourceNames['paymentPlan']),_0x4ef2ba=await fetchResource(_0x55b699,_0x462dd4);_0x4ef2ba&&_0x5054c5(_0x4ef2ba);}}}__name(onInitTableHeader,'onInitTableHeader');function setOverlayVisibility(_0x212303,_0x2aaa78,_0x56962e){const _0x4b8928=_0x56962e?.['allowedNumberOfProducts'];_0x4b8928&&_0x2aaa78(_0x212303['tableInstance']['tableRows']['length']>=_0x4b8928);}__name(setOverlayVisibility,'setOverlayVisibility');function onEditActionButtonClick(_0x643c76,_0xc2624,_0x5b219a){_0xc2624?.['onHeaderCellAction']?.(_0x643c76),onCustomAction({'shouldTableRefresh':_0xc2624?.['shouldTableRefreshAfter']??!![]},_0x5b219a);}__name(onEditActionButtonClick,'onEditActionButtonClick');function onCustomAction(_0x5ce793,_0x58aba0){if(_0x5ce793['shouldTableRefresh'])_0x58aba0?.();}__name(onCustomAction,'onCustomAction');

export { onCustomAction, onEditActionButtonClick, onInitTableHeader, setOverlayVisibility };
