'use strict';
import { getPaymentPlanButtonId } from '../../level2/client/components/subscription-plan/SubscriptionPlan.funcs.js';
import { subscriptionButtonText } from '../../level2/common/subscription-plan/subscription-plan-constants.js';
import { elements } from '../../fd-toolbox/constants/elements.js';
import { routes } from '../../fd-toolbox/routing/routes.js';
import { stripeInputFields } from '../constants/ui-tester/stripe-input-fields.js';
import { getUiTester } from '../ui-tester/global-ui-test.js';
import { SubscriptionPlan } from '../../level2/client/components/subscription-plan/SubscriptionPlan.js';
import { elementSuffixes } from '../../fd-toolbox/constants/element-suffixes.js';
import { getElementId } from '../../fd-toolbox/html/element-ids.js';
import { htmlElementVisibilityState } from '../constants/ui-tester/html-contants.js';

var __defProp=Object['defineProperty'],__name=(_0x3175fe,_0x11805a)=>__defProp(_0x3175fe,'name',{'value':_0x11805a,'configurable':!![]});const iframeStripePaymentIframeTitle='iframe[title=\x22Secure\x20card\x20payment\x20input\x20frame\x22]';async function paymentPlanPoGoToPaymentPlan(){const _0xdc8bab=getUiTester();await _0xdc8bab['goAndWait'](new URL(routes['paymentPlans'],_0xdc8bab['getBaseUrl']())['href']);}__name(paymentPlanPoGoToPaymentPlan,'paymentPlanPoGoToPaymentPlan');async function paymentPlanPoSelectPaymentPlanByName(_0x34d4bd){const _0x50adb0=getUiTester();await _0x50adb0['click'](getPaymentPlanButtonId(SubscriptionPlan['displayName'],_0x34d4bd));}__name(paymentPlanPoSelectPaymentPlanByName,'paymentPlanPoSelectPaymentPlanByName');async function paymentPlanPoGetPaymentPlanButtonTextByName(_0xb11fb1){const _0x2c5ef3=getUiTester(),_0x2d3f74=await _0x2c5ef3['getText'](getPaymentPlanButtonId(SubscriptionPlan['displayName'],_0xb11fb1));return _0x2d3f74;}__name(paymentPlanPoGetPaymentPlanButtonTextByName,'paymentPlanPoGetPaymentPlanButtonTextByName');async function paymentPlanPoChangePaymentPlan(_0x28e480){const _0x594785=getUiTester();await paymentPlanPoSelectPaymentPlanByName(_0x28e480),await _0x594785['click'](elements['dialogButton']['yes']);}__name(paymentPlanPoChangePaymentPlan,'paymentPlanPoChangePaymentPlan');async function paymentPlanPoCancelPaymentPlan(_0xf7d6a){await paymentPlanPoSelectPaymentPlanByName(_0xf7d6a);}__name(paymentPlanPoCancelPaymentPlan,'paymentPlanPoCancelPaymentPlan');async function paymentPlanPoWaitForChangeButtonText(_0x1f5c43){const _0x13b8af=getUiTester();await _0x13b8af['waitForElementTextById'](getPaymentPlanButtonId(SubscriptionPlan['displayName'],_0x1f5c43),subscriptionButtonText['change']);}__name(paymentPlanPoWaitForChangeButtonText,'paymentPlanPoWaitForChangeButtonText');async function paymentPlanPoWaitForCancelButtonText(_0x3afb1f){const _0x41a043=getUiTester();await _0x41a043['waitForElementTextById'](getPaymentPlanButtonId(SubscriptionPlan['displayName'],_0x3afb1f),subscriptionButtonText['cancel']);}__name(paymentPlanPoWaitForCancelButtonText,'paymentPlanPoWaitForCancelButtonText');async function paymentPlanPoWaitForScheduledCancellationButtonText(_0x4e460a){const _0x461823=getUiTester();await _0x461823['waitForElementTextById'](getPaymentPlanButtonId(SubscriptionPlan['displayName'],_0x4e460a),subscriptionButtonText['scheduledCancellation']);}__name(paymentPlanPoWaitForScheduledCancellationButtonText,'paymentPlanPoWaitForScheduledCancellationButtonText');async function paymentPlanPoWaitForContactUsButtonText(_0x407e5b){const _0x26b2be=getUiTester();await _0x26b2be['waitForElementTextById'](getPaymentPlanButtonId(SubscriptionPlan['displayName'],_0x407e5b),subscriptionButtonText['contactUs']);}__name(paymentPlanPoWaitForContactUsButtonText,'paymentPlanPoWaitForContactUsButtonText');async function paymentPlanPoClickBackButton(){const _0x43d839=getUiTester(),_0x1baf3b=new URL(routes['paymentPlans'],_0x43d839['getBaseUrl']())['href'],_0x878e5d=getElementId(elementSuffixes['back'],SubscriptionPlan['displayName']);await _0x43d839['click'](_0x878e5d),await _0x43d839['waitForDisappearFromUrl'](_0x1baf3b),await _0x43d839['page']['waitForLoadState'](htmlElementVisibilityState['domcontentloaded']);}__name(paymentPlanPoClickBackButton,'paymentPlanPoClickBackButton');async function paymentPlanPoFillStripeCardNumber(_0x587fea){const _0x32df7f=getUiTester(),_0x3b668b=_0x32df7f['page']['frameLocator'](iframeStripePaymentIframeTitle);await paymentPlanPoFillInputField(_0x3b668b,stripeInputFields['cardNumber'],_0x587fea);}__name(paymentPlanPoFillStripeCardNumber,'paymentPlanPoFillStripeCardNumber');async function paymentPlanPoFillStripeExpDateAndCvc(_0x22c052,_0x2e5d18){const _0x5fe1dc=getUiTester(),_0x7c8aa=_0x5fe1dc['page']['frameLocator'](iframeStripePaymentIframeTitle);await paymentPlanPoFillInputField(_0x7c8aa,stripeInputFields['expDate'],_0x22c052),await paymentPlanPoFillInputField(_0x7c8aa,stripeInputFields['cvc'],_0x2e5d18);}__name(paymentPlanPoFillStripeExpDateAndCvc,'paymentPlanPoFillStripeExpDateAndCvc');async function paymentPlanPoFillStripeCardDetails(_0x592f97,_0x27efca,_0xfa2d3c){await paymentPlanPoFillStripeCardNumber(_0x592f97),await paymentPlanPoFillStripeExpDateAndCvc(_0x27efca,_0xfa2d3c);}__name(paymentPlanPoFillStripeCardDetails,'paymentPlanPoFillStripeCardDetails');async function paymentPlanPoFillInputField(_0x15a76e,_0x450c0f,_0x5c80dd){await _0x15a76e['locator']('input[name=\x27'+_0x450c0f+'\x27]')['fill'](_0x5c80dd);}__name(paymentPlanPoFillInputField,'paymentPlanPoFillInputField');

export { paymentPlanPoCancelPaymentPlan, paymentPlanPoChangePaymentPlan, paymentPlanPoClickBackButton, paymentPlanPoFillStripeCardDetails, paymentPlanPoFillStripeCardNumber, paymentPlanPoFillStripeExpDateAndCvc, paymentPlanPoGetPaymentPlanButtonTextByName, paymentPlanPoGoToPaymentPlan, paymentPlanPoSelectPaymentPlanByName, paymentPlanPoWaitForCancelButtonText, paymentPlanPoWaitForChangeButtonText, paymentPlanPoWaitForContactUsButtonText, paymentPlanPoWaitForScheduledCancellationButtonText };
